airport-one-widgets 0.2.85 → 0.2.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1180,4 +1180,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1180
1180
|
}`;function eA(){var e=sk,t=ck,n=Q.cssPrefix,r=Q.replacementClass,i=$k;if(n!==e||r!==t){var a=RegExp(`\\.${e}\\-`,`g`),o=RegExp(`\\--${e}\\-`,`g`),s=RegExp(`\\.${t}`,`g`);i=i.replace(a,`.${n}-`).replace(o,`--${n}-`).replace(s,`.${r}`)}return i}var tA=!1;function nA(){Q.autoAddCss&&!tA&&(Hk(eA()),tA=!0)}var rA={mixout:function(){return{dom:{css:eA,insertCss:nA}}},hooks:function(){return{beforeDOMElementCreation:function(){nA()},beforeI2svg:function(){nA()}}}},iA=kD||{};iA[ak]||(iA[ak]={}),iA[ak].styles||(iA[ak].styles={}),iA[ak].hooks||(iA[ak].hooks={}),iA[ak].shims||(iA[ak].shims=[]);var aA=iA[ak],oA=[],sA=function(){AD.removeEventListener(`DOMContentLoaded`,sA),cA=1,oA.map(function(e){return e()})},cA=!1;ND&&(cA=(AD.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(AD.readyState),cA||AD.addEventListener(`DOMContentLoaded`,sA));function lA(e){ND&&(cA?setTimeout(e,0):oA.push(e))}function uA(e){var t=e.tag,n=e.attributes,r=n===void 0?{}:n,i=e.children,a=i===void 0?[]:i;return typeof e==`string`?qk(e):`<${t} ${Jk(r)}>${a.map(uA).join(``)}</${t}>`}function dA(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}var fA=function(e,t){return function(n,r,i,a){return e.call(t,n,r,i,a)}},pA=function(e,t,n,r){var i=Object.keys(e),a=i.length,o=r===void 0?t:fA(t,r),s,c,l;for(n===void 0?(s=1,l=e[i[0]]):(s=0,l=n);s<a;s++)c=i[s],l=o(l,e[c],c,e);return l};function mA(e){return _D(e).length===1?e.codePointAt(0).toString(16):null}function hA(e){return Object.keys(e).reduce(function(t,n){var r=e[n];return r.icon?t[r.iconName]=r.icon:t[n]=r,t},{})}function gA(e,t){var n=(arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}).skipHooks,r=n!==void 0&&n,i=hA(t);typeof aA.hooks.addPack==`function`&&!r?aA.hooks.addPack(e,hA(t)):aA.styles[e]=Z(Z({},aA.styles[e]||{}),i),e===`fas`&&gA(`fa`,t)}var _A=aA.styles,vA=aA.shims,yA=Object.keys(Tk),bA=yA.reduce(function(e,t){return e[t]=Object.keys(Tk[t]),e},{}),xA=null,SA={},CA={},wA={},TA={},EA={};function DA(e){return~Mk.indexOf(e)}function OA(e,t){var n=t.split(`-`),r=n[0],i=n.slice(1).join(`-`);return r===e&&i!==``&&!DA(i)?i:null}var kA=function(){var e=function(e){return pA(_A,function(t,n,r){return t[r]=pA(n,e,{}),t},{})};SA=e(function(e,t,n){return t[3]&&(e[t[3]]=n),t[2]&&t[2].filter(function(e){return typeof e==`number`}).forEach(function(t){e[t.toString(16)]=n}),e}),CA=e(function(e,t,n){return e[n]=n,t[2]&&t[2].filter(function(e){return typeof e==`string`}).forEach(function(t){e[t]=n}),e}),EA=e(function(e,t,n){var r=t[2];return e[n]=n,r.forEach(function(t){e[t]=n}),e});var t=`far`in _A||Q.autoFetchSvg,n=pA(vA,function(e,n){var r=n[0],i=n[1],a=n[2];return i===`far`&&!t&&(i=`fas`),typeof r==`string`&&(e.names[r]={prefix:i,iconName:a}),typeof r==`number`&&(e.unicodes[r.toString(16)]={prefix:i,iconName:a}),e},{names:{},unicodes:{}});wA=n.names,TA=n.unicodes,xA=RA(Q.styleDefault,{family:Q.familyDefault})};zk(function(e){xA=RA(e.styleDefault,{family:Q.familyDefault})}),kA();function AA(e,t){return(SA[e]||{})[t]}function jA(e,t){return(CA[e]||{})[t]}function MA(e,t){return(EA[e]||{})[t]}function NA(e){return wA[e]||{prefix:null,iconName:null}}function PA(e){var t=TA[e],n=AA(`fas`,e);return t||(n?{prefix:`fas`,iconName:n}:null)||{prefix:null,iconName:null}}function FA(){return xA}var IA=function(){return{prefix:null,iconName:null,rest:[]}};function LA(e){var t=VD,n=yA.reduce(function(e,t){return e[t]=`${Q.cssPrefix}-${t}`,e},{});return FO.forEach(function(r){(e.includes(n[r])||e.some(function(e){return bA[r].includes(e)}))&&(t=r)}),t}function RA(e){var t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).family,n=t===void 0?VD:t,r=xk[n][e];if(n===HD&&!e)return`fad`;var i=Ck[n][e]||Ck[n][r],a=e in aA.styles?e:null;return i||a||null}function zA(e){var t=[],n=null;return e.forEach(function(e){var r=OA(Q.cssPrefix,e);r?n=r:e&&t.push(e)}),{iconName:n,rest:t}}function BA(e){return e.sort().filter(function(e,t,n){return n.indexOf(e)===t})}var VA=$O.concat(BO);function HA(e){var t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).skipLookups,n=t!==void 0&&t,r=null,i=BA(e.filter(function(e){return VA.includes(e)})),a=BA(e.filter(function(e){return!VA.includes(e)})),o=gD(i.filter(function(e){return r=e,!BD.includes(e)}),1)[0],s=o===void 0?null:o,c=LA(i),l=Z(Z({},zA(a)),{},{prefix:RA(s,{family:c})});return Z(Z(Z({},l),KA({values:e,family:c,styles:_A,config:Q,canonical:l,givenPrefix:r})),UA(n,r,l))}function UA(e,t,n){var r=n.prefix,i=n.iconName;if(e||!r||!i)return{prefix:r,iconName:i};var a=t===`fa`?NA(i):{},o=MA(r,i);return i=a.iconName||o||i,r=a.prefix||r,r===`far`&&!_A.far&&_A.fas&&!Q.autoFetchSvg&&(r=`fas`),{prefix:r,iconName:i}}var WA=FO.filter(function(e){return e!==VD||e!==HD}),GA=Object.keys(QO).filter(function(e){return e!==VD}).map(function(e){return Object.keys(QO[e])}).flat();function KA(e){var t=e.values,n=e.family,r=e.canonical,i=e.givenPrefix,a=i===void 0?``:i,o=e.styles,s=o===void 0?{}:o,c=e.config,l=c===void 0?{}:c,u=n===HD,d=t.includes(`fa-duotone`)||t.includes(`fad`),f=l.familyDefault===`duotone`,p=r.prefix===`fad`||r.prefix===`fa-duotone`;return!u&&(d||f||p)&&(r.prefix=`fad`),(t.includes(`fa-brands`)||t.includes(`fab`))&&(r.prefix=`fab`),!r.prefix&&WA.includes(n)&&(Object.keys(s).find(function(e){return GA.includes(e)})||l.autoFetchSvg)&&(r.prefix=RO.get(n).defaultShortPrefixId,r.iconName=MA(r.prefix,r.iconName)||r.iconName),(r.prefix===`fa`||a===`fa`)&&(r.prefix=FA()||`fas`),r}var qA=function(){function e(){sD(this,e),this.definitions={}}return lD(e,[{key:`add`,value:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.reduce(this._pullDefinitions,{});Object.keys(i).forEach(function(t){e.definitions[t]=Z(Z({},e.definitions[t]||{}),i[t]),gA(t,i[t]);var n=Tk[VD][t];n&&gA(n,i[t]),kA()})}},{key:`reset`,value:function(){this.definitions={}}},{key:`_pullDefinitions`,value:function(e,t){var n=t.prefix&&t.iconName&&t.icon?{0:t}:t;return Object.keys(n).map(function(t){var r=n[t],i=r.prefix,a=r.iconName,o=r.icon,s=o[2];e[i]||(e[i]={}),s.length>0&&s.forEach(function(t){typeof t==`string`&&(e[i][t]=o)}),e[i][a]=o}),e}}])}(),JA=[],YA={},XA={},ZA=Object.keys(XA);function QA(e,t){var n=t.mixoutsTo;return JA=e,YA={},Object.keys(XA).forEach(function(e){ZA.indexOf(e)===-1&&delete XA[e]}),JA.forEach(function(e){var t=e.mixout?e.mixout():{};if(Object.keys(t).forEach(function(e){typeof t[e]==`function`&&(n[e]=t[e]),bD(t[e])===`object`&&Object.keys(t[e]).forEach(function(r){n[e]||(n[e]={}),n[e][r]=t[e][r]})}),e.hooks){var r=e.hooks();Object.keys(r).forEach(function(e){YA[e]||(YA[e]=[]),YA[e].push(r[e])})}e.provides&&e.provides(XA)}),n}function $A(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return(YA[e]||[]).forEach(function(e){t=e.apply(null,[t].concat(r))}),t}function ej(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];(YA[e]||[]).forEach(function(e){e.apply(null,n)})}function tj(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);return XA[e]?XA[e].apply(null,t):void 0}function nj(e){e.prefix===`fa`&&(e.prefix=`fas`);var t=e.iconName,n=e.prefix||FA();if(t)return t=MA(n,t)||t,dA(rj.definitions,n,t)||dA(aA.styles,n,t)}var rj=new qA,ij={noAuto:function(){Q.autoReplaceSvg=!1,Q.observeMutations=!1,ej(`noAuto`)},config:Q,dom:{i2svg:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return ND?(ej(`beforeI2svg`,e),tj(`pseudoElements2svg`,e),tj(`i2svg`,e)):Promise.reject(Error(`Operation requires a DOM of some kind.`))},watch:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.autoReplaceSvgRoot;Q.autoReplaceSvg===!1&&(Q.autoReplaceSvg=!0),Q.observeMutations=!0,lA(function(){aj({autoReplaceSvgRoot:t}),ej(`watch`,e)})}},parse:{icon:function(e){if(e===null)return null;if(bD(e)===`object`&&e.prefix&&e.iconName)return{prefix:e.prefix,iconName:MA(e.prefix,e.iconName)||e.iconName};if(Array.isArray(e)&&e.length===2){var t=e[1].indexOf(`fa-`)===0?e[1].slice(3):e[1],n=RA(e[0]);return{prefix:n,iconName:MA(n,t)||t}}if(typeof e==`string`&&(e.indexOf(`${Q.cssPrefix}-`)>-1||e.match(Dk))){var r=HA(e.split(` `),{skipLookups:!0});return{prefix:r.prefix||FA(),iconName:MA(r.prefix,r.iconName)||r.iconName}}if(typeof e==`string`){var i=FA();return{prefix:i,iconName:MA(i,e)||e}}}},library:rj,findIconDefinition:nj,toHtml:uA},aj=function(){var e=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).autoReplaceSvgRoot,t=e===void 0?AD:e;(Object.keys(aA.styles).length>0||Q.autoFetchSvg)&&ND&&Q.autoReplaceSvg&&ij.dom.i2svg({node:t})};function oj(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map(function(e){return uA(e)})}}),Object.defineProperty(e,"node",{get:function(){if(ND){var t=AD.createElement(`div`);return t.innerHTML=e.html,t.children}}}),e}function sj(e){var t=e.children,n=e.main,r=e.mask,i=e.attributes,a=e.styles,o=e.transform;if(Xk(o)&&n.found&&!r.found){var s={x:n.width/n.height/2,y:.5};i.style=Yk(Z(Z({},a),{},{"transform-origin":`${s.x+o.x/16}em ${s.y+o.y/16}em`}))}return[{tag:`svg`,attributes:i,children:t}]}function cj(e){var t=e.prefix,n=e.iconName,r=e.children,i=e.attributes,a=e.symbol,o=a===!0?`${t}-${Q.cssPrefix}-${n}`:a;return[{tag:`svg`,attributes:{style:`display: none;`},children:[{tag:`symbol`,attributes:Z(Z({},i),{},{id:o}),children:r}]}]}function lj(e){return[`aria-label`,`aria-labelledby`,`title`,`role`].some(function(t){return t in e})}function uj(e){var t=e.icons,n=t.main,r=t.mask,i=e.prefix,a=e.iconName,o=e.transform,s=e.symbol,c=e.maskId,l=e.extra,u=e.watchable,d=u!==void 0&&u,f=r.found?r:n,p=f.width,m=f.height,h=[Q.replacementClass,a?`${Q.cssPrefix}-${a}`:``].filter(function(e){return l.classes.indexOf(e)===-1}).filter(function(e){return e!==``||!!e}).concat(l.classes).join(` `),g={children:[],attributes:Z(Z({},l.attributes),{},{"data-prefix":i,"data-icon":a,class:h,role:l.attributes.role||`img`,viewBox:`0 0 ${p} ${m}`})};!lj(l.attributes)&&!l.attributes[`aria-hidden`]&&(g.attributes[`aria-hidden`]=`true`),d&&(g.attributes[lk]=``);var _=Z(Z({},g),{},{prefix:i,iconName:a,main:n,mask:r,maskId:c,transform:o,symbol:s,styles:Z({},l.styles)}),v=r.found&&n.found?tj(`generateAbstractMask`,_)||{children:[],attributes:{}}:tj(`generateAbstractIcon`,_)||{children:[],attributes:{}},y=v.children,b=v.attributes;return _.children=y,_.attributes=b,s?cj(_):sj(_)}function dj(e){var t=e.content,n=e.width,r=e.height,i=e.transform,a=e.extra,o=e.watchable,s=o!==void 0&&o,c=Z(Z({},a.attributes),{},{class:a.classes.join(` `)});s&&(c[lk]=``);var l=Z({},a.styles);Xk(i)&&(l.transform=Qk({transform:i,startCentered:!0,width:n,height:r}),l[`-webkit-transform`]=l.transform);var u=Yk(l);u.length>0&&(c.style=u);var d=[];return d.push({tag:`span`,attributes:c,children:[t]}),d}function fj(e){var t=e.content,n=e.extra,r=Z(Z({},n.attributes),{},{class:n.classes.join(` `)}),i=Yk(n.styles);i.length>0&&(r.style=i);var a=[];return a.push({tag:`span`,attributes:r,children:[t]}),a}var pj=aA.styles;function mj(e){var t=e[0],n=e[1],r=gD(e.slice(4),1)[0],i=null;return i=Array.isArray(r)?{tag:`g`,attributes:{class:`${Q.cssPrefix}-${jk.GROUP}`},children:[{tag:`path`,attributes:{class:`${Q.cssPrefix}-${jk.SECONDARY}`,fill:`currentColor`,d:r[0]}},{tag:`path`,attributes:{class:`${Q.cssPrefix}-${jk.PRIMARY}`,fill:`currentColor`,d:r[1]}}]}:{tag:`path`,attributes:{fill:`currentColor`,d:r}},{found:!0,width:t,height:n,icon:i}}var hj={found:!1,width:512,height:512};function gj(e,t){!vk&&!Q.showMissingIcons&&e&&console.error(`Icon with name "${e}" and prefix "${t}" is missing.`)}function _j(e,t){var n=t;return t===`fa`&&Q.styleDefault!==null&&(t=FA()),new Promise(function(r,i){if(n===`fa`){var a=NA(e)||{};e=a.iconName||e,t=a.prefix||t}if(e&&t&&pj[t]&&pj[t][e]){var o=pj[t][e];return r(mj(o))}gj(e,t),r(Z(Z({},hj),{},{icon:Q.showMissingIcons&&e&&tj(`missingIconAbstract`)||{}}))})}var vj=function(){},yj=Q.measurePerformance&&MD&&MD.mark&&MD.measure?MD:{mark:vj,measure:vj},bj=`FA "7.3.1"`,xj=function(e){return yj.mark(`${bj} ${e} begins`),function(){return Sj(e)}},Sj=function(e){yj.mark(`${bj} ${e} ends`),yj.measure(`${bj} ${e}`,`${bj} ${e} begins`,`${bj} ${e} ends`)},Cj={begin:xj,end:Sj},wj=function(){};function Tj(e){return typeof(e.getAttribute?e.getAttribute(lk):null)==`string`}function Ej(e){var t=e.getAttribute?e.getAttribute(fk):null,n=e.getAttribute?e.getAttribute(pk):null;return t&&n}function Dj(e){return e&&e.classList&&e.classList.contains&&e.classList.contains(Q.replacementClass)}function Oj(){return Q.autoReplaceSvg===!0?Nj.replace:Nj[Q.autoReplaceSvg]||Nj.replace}function kj(e){return AD.createElementNS(`http://www.w3.org/2000/svg`,e)}function Aj(e){return AD.createElement(e)}function jj(e){var t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).ceFn,n=t===void 0?e.tag===`svg`?kj:Aj:t;if(typeof e==`string`)return AD.createTextNode(e);var r=n(e.tag);return Object.keys(e.attributes||[]).forEach(function(t){r.setAttribute(t,e.attributes[t])}),(e.children||[]).forEach(function(e){r.appendChild(jj(e,{ceFn:n}))}),r}function Mj(e){var t=` ${e.outerHTML} `;return t=`${t}Font Awesome fontawesome.com `,t}var Nj={replace:function(e){var t=e[0];if(t.parentNode){if(e[1].forEach(function(e){t.parentNode.insertBefore(jj(e),t)}),t.getAttribute(lk)===null&&Q.keepOriginalSource){var n=AD.createComment(Mj(t));t.parentNode.replaceChild(n,t)}else t.remove()}},nest:function(e){var t=e[0],n=e[1];if(~Kk(t).indexOf(Q.replacementClass))return Nj.replace(e);var r=RegExp(`${Q.cssPrefix}-.*`);if(delete n[0].attributes.id,n[0].attributes.class){var i=n[0].attributes.class.split(` `).reduce(function(e,t){return t===Q.replacementClass||t.match(r)?e.toSvg.push(t):e.toNode.push(t),e},{toNode:[],toSvg:[]});n[0].attributes.class=i.toSvg.join(` `),i.toNode.length===0?t.removeAttribute(`class`):t.setAttribute(`class`,i.toNode.join(` `))}var a=n.map(function(e){return uA(e)}).join(`
|
|
1181
1181
|
`);t.setAttribute(lk,``),t.innerHTML=a}};function Pj(e){e()}function Fj(e,t){var n=typeof t==`function`?t:wj;if(e.length===0)n();else{var r=Pj;Q.mutateApproach===hk&&(r=kD.requestAnimationFrame||Pj),r(function(){var t=Oj(),r=Cj.begin(`mutate`);e.map(t),r(),n()})}}var Ij=!1;function Lj(){Ij=!0}function Rj(){Ij=!1}var zj=null;function Bj(e){if(jD&&Q.observeMutations){var t=e.treeCallback,n=t===void 0?wj:t,r=e.nodeCallback,i=r===void 0?wj:r,a=e.pseudoElementsCallback,o=a===void 0?wj:a,s=e.observeMutationsRoot,c=s===void 0?AD:s;zj=new jD(function(e){if(!Ij){var t=FA();Gk(e).forEach(function(e){if(e.type===`childList`&&e.addedNodes.length>0&&!Tj(e.addedNodes[0])&&(Q.searchPseudoElements&&o(e.target),n(e.target)),e.type===`attributes`&&e.target.parentNode&&Q.searchPseudoElements&&o([e.target],!0),e.type===`attributes`&&Tj(e.target)&&~Ak.indexOf(e.attributeName)){if(e.attributeName===`class`&&Ej(e.target)){var r=HA(Kk(e.target)),a=r.prefix,s=r.iconName;e.target.setAttribute(fk,a||t),s&&e.target.setAttribute(pk,s)}else Dj(e.target)&&i(e.target)}})}}),ND&&zj.observe(c,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}}function Vj(){zj&&zj.disconnect()}function Hj(e){var t=e.getAttribute(`style`),n=[];return t&&(n=t.split(`;`).reduce(function(e,t){var n=t.split(`:`),r=n[0],i=n.slice(1);return r&&i.length>0&&(e[r]=i.join(`:`).trim()),e},{})),n}function Uj(e){var t=e.getAttribute(`data-prefix`),n=e.getAttribute(`data-icon`),r=e.innerText===void 0?``:e.innerText.trim(),i=HA(Kk(e));return i.prefix||=FA(),t&&n&&(i.prefix=t,i.iconName=n),i.iconName&&i.prefix||(i.prefix&&r.length>0&&(i.iconName=jA(i.prefix,e.innerText)||AA(i.prefix,mA(e.innerText))),!i.iconName&&Q.autoFetchSvg&&e.firstChild&&e.firstChild.nodeType===Node.TEXT_NODE&&(i.iconName=e.firstChild.data)),i}function Wj(e){return Gk(e.attributes).reduce(function(e,t){return e.name!==`class`&&e.name!==`style`&&(e[t.name]=t.value),e},{})}function Gj(){return{iconName:null,prefix:null,transform:Vk,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function Kj(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0},n=Uj(e),r=n.iconName,i=n.prefix,a=n.rest,o=Wj(e),s=$A(`parseNodeAttributes`,{},e);return Z({iconName:r,prefix:i,transform:Vk,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:a,styles:t.styleParser?Hj(e):[],attributes:o}},s)}var qj=aA.styles;function Jj(e){var t=Q.autoReplaceSvg===`nest`?Kj(e,{styleParser:!1}):Kj(e);return~t.extra.classes.indexOf(Ok)?tj(`generateLayersText`,e,t):tj(`generateSvgReplacementMutation`,e,t)}function Yj(){return[].concat(_D(BO),_D($O))}function Xj(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!ND)return Promise.resolve();var n=AD.documentElement.classList,r=function(e){return n.add(`${mk}-${e}`)},i=function(e){return n.remove(`${mk}-${e}`)},a=Q.autoFetchSvg?Yj():BD.concat(Object.keys(qj));a.includes(`fa`)||a.push(`fa`);var o=[`.${Ok}:not([${lk}])`].concat(a.map(function(e){return`.${e}:not([${lk}])`})).join(`, `);if(o.length===0)return Promise.resolve();var s=[];try{s=Gk(e.querySelectorAll(o))}catch{}if(s.length>0)r(`pending`),i(`complete`);else return Promise.resolve();var c=Cj.begin(`onTree`),l=s.reduce(function(e,t){try{var n=Jj(t);n&&e.push(n)}catch(e){vk||e.name===`MissingIcon`&&console.error(e)}return e},[]);return new Promise(function(e,n){Promise.all(l).then(function(n){Fj(n,function(){r(`active`),r(`complete`),i(`pending`),typeof t==`function`&&t(),c(),e()})}).catch(function(e){c(),n(e)})})}function Zj(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;Jj(e).then(function(e){e&&Fj([e],t)})}function Qj(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=(t||{}).icon?t:nj(t||{}),i=n.mask;return i&&=(i||{}).icon?i:nj(i||{}),e(r,Z(Z({},n),{},{mask:i}))}}var $j=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.transform,r=n===void 0?Vk:n,i=t.symbol,a=i!==void 0&&i,o=t.mask,s=o===void 0?null:o,c=t.maskId,l=c===void 0?null:c,u=t.classes,d=u===void 0?[]:u,f=t.attributes,p=f===void 0?{}:f,m=t.styles,h=m===void 0?{}:m;if(e){var g=e.prefix,_=e.iconName,v=e.icon;return oj(Z({type:`icon`},e),function(){return ej(`beforeDOMElementCreation`,{iconDefinition:e,params:t}),uj({icons:{main:mj(v),mask:s?mj(s.icon):{found:!1,width:null,height:null,icon:{}}},prefix:g,iconName:_,transform:Z(Z({},Vk),r),symbol:a,maskId:l,extra:{attributes:p,styles:h,classes:d}})})}},eM={mixout:function(){return{icon:Qj($j)}},hooks:function(){return{mutationObserverCallbacks:function(e){return e.treeCallback=Xj,e.nodeCallback=Zj,e}}},provides:function(e){e.i2svg=function(e){var t=e.node,n=t===void 0?AD:t,r=e.callback;return Xj(n,r===void 0?function(){}:r)},e.generateSvgReplacementMutation=function(e,t){var n=t.iconName,r=t.prefix,i=t.transform,a=t.symbol,o=t.mask,s=t.maskId,c=t.extra;return new Promise(function(t,l){Promise.all([_j(n,r),o.iconName?_j(o.iconName,o.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(function(o){var l=gD(o,2),u=l[0],d=l[1];t([e,uj({icons:{main:u,mask:d},prefix:r,iconName:n,transform:i,symbol:a,maskId:s,extra:c,watchable:!0})])}).catch(l)})},e.generateAbstractIcon=function(e){var t=e.children,n=e.attributes,r=e.main,i=e.transform,a=e.styles,o=Yk(a);o.length>0&&(n.style=o);var s;return Xk(i)&&(s=tj(`generateAbstractTransformGrouping`,{main:r,transform:i,containerWidth:r.width,iconWidth:r.width})),t.push(s||r.icon),{children:t,attributes:n}}}},tM={mixout:function(){return{layer:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.classes,r=n===void 0?[]:n;return oj({type:`layer`},function(){ej(`beforeDOMElementCreation`,{assembler:e,params:t});var n=[];return e(function(e){Array.isArray(e)?e.map(function(e){n=n.concat(e.abstract)}):n=n.concat(e.abstract)}),[{tag:`span`,attributes:{class:[`${Q.cssPrefix}-layers`].concat(_D(r)).join(` `)},children:n}]})}}}},nM={mixout:function(){return{counter:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.title,r=n===void 0?null:n,i=t.classes,a=i===void 0?[]:i,o=t.attributes,s=o===void 0?{}:o,c=t.styles,l=c===void 0?{}:c;return oj({type:`counter`,content:e},function(){return ej(`beforeDOMElementCreation`,{content:e,params:t}),fj({content:e.toString(),title:r,extra:{attributes:s,styles:l,classes:[`${Q.cssPrefix}-layers-counter`].concat(_D(a))}})})}}}},rM={mixout:function(){return{text:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.transform,r=n===void 0?Vk:n,i=t.classes,a=i===void 0?[]:i,o=t.attributes,s=o===void 0?{}:o,c=t.styles,l=c===void 0?{}:c;return oj({type:`text`,content:e},function(){return ej(`beforeDOMElementCreation`,{content:e,params:t}),dj({content:e,transform:Z(Z({},Vk),r),extra:{attributes:s,styles:l,classes:[`${Q.cssPrefix}-layers-text`].concat(_D(a))}})})}}},provides:function(e){e.generateLayersText=function(e,t){var n=t.transform,r=t.extra,i=null,a=null;if(PD){var o=parseInt(getComputedStyle(e).fontSize,10),s=e.getBoundingClientRect();i=s.width/o,a=s.height/o}return Promise.resolve([e,dj({content:e.innerHTML,width:i,height:a,transform:n,extra:r,watchable:!0})])}}},iM=RegExp(`"`,`ug`),aM=[1105920,1112319],oM=Z(Z(Z(Z({},{FontAwesome:{normal:`fas`,400:`fas`}}),LO),ik),WO),sM=Object.keys(oM).reduce(function(e,t){return e[t.toLowerCase()]=oM[t],e},{}),cM=Object.keys(sM).reduce(function(e,t){var n=sM[t];return e[t]=n[900]||_D(Object.entries(n))[0][1],e},{});function lM(e){return mA(_D(e.replace(iM,``))[0]||``)}function uM(e){var t=e.getPropertyValue(`font-feature-settings`).includes(`ss01`),n=e.getPropertyValue(`content`).replace(iM,``),r=n.codePointAt(0),i=r>=aM[0]&&r<=aM[1],a=n.length===2&&n[0]===n[1];return i||a||t}function dM(e,t){var n=e.replace(/^['"]|['"]$/g,``).toLowerCase(),r=parseInt(t),i=isNaN(r)?`normal`:r;return(sM[n]||{})[i]||cM[n]}function fM(e,t){var n=`${dk}${t.replace(`:`,`-`)}`;return new Promise(function(r,i){if(e.getAttribute(n)!==null)return r();var a=Gk(e.children).filter(function(e){return e.getAttribute(uk)===t})[0],o=kD.getComputedStyle(e,t),s=o.getPropertyValue(`font-family`),c=s.match(kk),l=o.getPropertyValue(`font-weight`),u=o.getPropertyValue(`content`);if(a&&!c)return e.removeChild(a),r();if(c&&u!==`none`&&u!==``){var d=o.getPropertyValue(`content`),f=dM(s,l),p=lM(d),m=c[0].startsWith(`FontAwesome`),h=uM(o),g=AA(f,p),_=g;if(m){var v=PA(p);v.iconName&&v.prefix&&(g=v.iconName,f=v.prefix)}if(g&&!h&&(!a||a.getAttribute(fk)!==f||a.getAttribute(pk)!==_)){e.setAttribute(n,_),a&&e.removeChild(a);var y=Gj(),b=y.extra;b.attributes[uk]=t,_j(g,f).then(function(i){var a=uj(Z(Z({},y),{},{icons:{main:i,mask:IA()},prefix:f,iconName:_,extra:b,watchable:!0})),o=AD.createElementNS(`http://www.w3.org/2000/svg`,`svg`);t===`::before`?e.insertBefore(o,e.firstChild):e.appendChild(o),o.outerHTML=a.map(function(e){return uA(e)}).join(`
|
|
1182
1182
|
`),e.removeAttribute(n),r()}).catch(i)}else r()}else r()})}function pM(e){return Promise.all([fM(e,`::before`),fM(e,`::after`)])}function mM(e){return e.parentNode!==document.head&&!~gk.indexOf(e.tagName.toUpperCase())&&!e.getAttribute(uk)&&(!e.parentNode||e.parentNode.tagName!==`svg`)}var hM=function(e){return!!e&&_k.some(function(t){return e.includes(t)})},gM=function(e){if(!e)return[];var t=new Set,n=e.split(/,(?![^()]*\))/).map(function(e){return e.trim()});n=n.flatMap(function(e){return e.includes(`(`)?e:e.split(`,`).map(function(e){return e.trim()})});var r=uD(n),i;try{for(r.s();!(i=r.n()).done;){var a=i.value;if(hM(a)){var o=_k.reduce(function(e,t){return e.replace(t,``)},a);o!==``&&o!==`*`&&t.add(o)}}}catch(e){r.e(e)}finally{r.f()}return t};function _M(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(ND){var n;if(t)n=e;else if(Q.searchPseudoElementsFullScan)n=e.querySelectorAll(`*`);else{var r=new Set,i=uD(document.styleSheets),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;try{var s=uD(o.cssRules),c;try{for(s.s();!(c=s.n()).done;){var l=c.value,u=uD(gM(l.selectorText)),d;try{for(u.s();!(d=u.n()).done;){var f=d.value;r.add(f)}}catch(e){u.e(e)}finally{u.f()}}}catch(e){s.e(e)}finally{s.f()}}catch(e){Q.searchPseudoElementsWarnings&&console.warn(`Font Awesome: cannot parse stylesheet: ${o.href} (${e.message})
|
|
1183
|
-
If it declares any Font Awesome CSS pseudo-elements, they will not be rendered as SVG icons. Add crossorigin="anonymous" to the <link>, enable searchPseudoElementsFullScan for slower but more thorough DOM parsing, or suppress this warning by setting searchPseudoElementsWarnings to false.`)}}}catch(e){i.e(e)}finally{i.f()}if(!r.size)return;var p=Array.from(r).join(`, `);try{n=e.querySelectorAll(p)}catch{}}return new Promise(function(e,t){var r=Gk(n).filter(mM).map(pM),i=Cj.begin(`searchPseudoElements`);Lj(),Promise.all(r).then(function(){i(),Rj(),e()}).catch(function(){i(),Rj(),t()})})}}var vM={hooks:function(){return{mutationObserverCallbacks:function(e){return e.pseudoElementsCallback=_M,e}}},provides:function(e){e.pseudoElements2svg=function(e){var t=e.node,n=t===void 0?AD:t;Q.searchPseudoElements&&_M(n)}}},yM=!1,bM={mixout:function(){return{dom:{unwatch:function(){Lj(),yM=!0}}}},hooks:function(){return{bootstrap:function(){Bj($A(`mutationObserverCallbacks`,{}))},noAuto:function(){Vj()},watch:function(e){var t=e.observeMutationsRoot;yM?Rj():Bj($A(`mutationObserverCallbacks`,{observeMutationsRoot:t}))}}}},xM=function(e){return e.toLowerCase().split(` `).reduce(function(e,t){var n=t.toLowerCase().split(`-`),r=n[0],i=n.slice(1).join(`-`);if(r&&i===`h`)return e.flipX=!0,e;if(r&&i===`v`)return e.flipY=!0,e;if(i=parseFloat(i),isNaN(i))return e;switch(r){case`grow`:e.size+=i;break;case`shrink`:e.size-=i;break;case`left`:e.x-=i;break;case`right`:e.x+=i;break;case`up`:e.y-=i;break;case`down`:e.y+=i;break;case`rotate`:e.rotate+=i}return e},{size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0})},SM={mixout:function(){return{parse:{transform:function(e){return xM(e)}}}},hooks:function(){return{parseNodeAttributes:function(e,t){var n=t.getAttribute(`data-fa-transform`);return n&&(e.transform=xM(n)),e}}},provides:function(e){e.generateAbstractTransformGrouping=function(e){var t=e.main,n=e.transform,r=e.containerWidth,i=e.iconWidth,a={outer:{transform:`translate(${r/2} 256)`},inner:{transform:`${`translate(${n.x*32}, ${n.y*32}) `} ${`scale(${n.size/16*(n.flipX?-1:1)}, ${n.size/16*(n.flipY?-1:1)}) `} ${`rotate(${n.rotate} 0 0)`}`},path:{transform:`translate(${i/2*-1} -256)`}};return{tag:`g`,attributes:Z({},a.outer),children:[{tag:`g`,attributes:Z({},a.inner),children:[{tag:t.icon.tag,children:t.icon.children,attributes:Z(Z({},t.icon.attributes),a.path)}]}]}}}},CM={x:0,y:0,width:`100%`,height:`100%`};function wM(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e.attributes&&(e.attributes.fill||t)&&(e.attributes.fill=`black`),e}function TM(e){return e.tag===`g`?e.children:[e]}QA([rA,eM,tM,nM,rM,vM,bM,SM,{hooks:function(){return{parseNodeAttributes:function(e,t){var n=t.getAttribute(`data-fa-mask`),r=n?HA(n.split(` `).map(function(e){return e.trim()})):IA();return r.prefix||=FA(),e.mask=r,e.maskId=t.getAttribute(`data-fa-mask-id`),e}}},provides:function(e){e.generateAbstractMask=function(e){var t=e.children,n=e.attributes,r=e.main,i=e.mask,a=e.maskId,o=e.transform,s=r.width,c=r.icon,l=i.width,u=i.icon,d=Zk({transform:o,containerWidth:l,iconWidth:s}),f={tag:`rect`,attributes:Z(Z({},CM),{},{fill:`white`})},p=c.children?{children:c.children.map(wM)}:{},m={tag:`g`,attributes:Z({},d.inner),children:[wM(Z({tag:c.tag,attributes:Z(Z({},c.attributes),d.path)},p))]},h={tag:`g`,attributes:Z({},d.outer),children:[m]},g=`mask-${a||Wk()}`,_=`clip-${a||Wk()}`,v={tag:`mask`,attributes:Z(Z({},CM),{},{id:g,maskUnits:`userSpaceOnUse`,maskContentUnits:`userSpaceOnUse`}),children:[f,h]},y={tag:`defs`,children:[{tag:`clipPath`,attributes:{id:_},children:TM(u)},v]};return t.push(y,{tag:`rect`,attributes:Z({fill:`currentColor`,"clip-path":`url(#${_})`,mask:`url(#${g})`},CM)}),{children:t,attributes:n}}}},{provides:function(e){var t=!1;kD.matchMedia&&(t=kD.matchMedia(`(prefers-reduced-motion: reduce)`).matches),e.missingIconAbstract=function(){var e=[],n={fill:`currentColor`},r={attributeType:`XML`,repeatCount:`indefinite`,dur:`2s`};e.push({tag:`path`,attributes:Z(Z({},n),{},{d:`M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z`})});var i=Z(Z({},r),{},{attributeName:`opacity`}),a={tag:`circle`,attributes:Z(Z({},n),{},{cx:`256`,cy:`364`,r:`28`}),children:[]};return t||a.children.push({tag:`animate`,attributes:Z(Z({},r),{},{attributeName:`r`,values:`28;14;28;28;14;28;`})},{tag:`animate`,attributes:Z(Z({},i),{},{values:`1;0;1;1;0;1;`})}),e.push(a),e.push({tag:`path`,attributes:Z(Z({},n),{},{opacity:`1`,d:`M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z`}),children:t?[]:[{tag:`animate`,attributes:Z(Z({},i),{},{values:`1;0;0;0;0;1;`})}]}),t||e.push({tag:`path`,attributes:Z(Z({},n),{},{opacity:`0`,d:`M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z`}),children:[{tag:`animate`,attributes:Z(Z({},i),{},{values:`0;0;1;1;0;0;`})}]}),{tag:`g`,attributes:{class:`missing`},children:e}}}},{hooks:function(){return{parseNodeAttributes:function(e,t){var n=t.getAttribute(`data-fa-symbol`);return e.symbol=n===null?!1:n===``||n,e}}}}],{mixoutsTo:ij}),ij.noAuto;var EM=ij.config;ij.library,ij.dom;var DM=ij.parse;ij.findIconDefinition,ij.toHtml;var OM=ij.icon;ij.layer,ij.text,ij.counter;function kM(e){return e-=0,e===e}function AM(e){return kM(e)?e:(e=e.replace(/[_-]+(.)?/g,(e,t)=>t?t.toUpperCase():``),e.charAt(0).toLowerCase()+e.slice(1))}var jM=(e,t)=>G.createElement(`stop`,{key:`${t}-${e.offset}`,offset:e.offset,stopColor:e.color,...e.opacity!==void 0&&{stopOpacity:e.opacity}});function MM(e){return e.charAt(0).toUpperCase()+e.slice(1)}var NM=new Map,PM=1e3;function FM(e){if(NM.has(e))return NM.get(e);let t={},n=0,r=e.length;for(;n<r;){let i=e.indexOf(`;`,n),a=i===-1?r:i,o=e.slice(n,a).trim();if(o){let e=o.indexOf(`:`);if(e>0){let n=o.slice(0,e).trim(),r=o.slice(e+1).trim();if(n&&r){let e=AM(n);t[e.startsWith(`webkit`)?MM(e):e]=r}}}n=a+1}if(NM.size===PM){let e=NM.keys().next().value;e&&NM.delete(e)}return NM.set(e,t),t}function IM(e,t,n={}){if(typeof t==`string`)return t;let r=(t.children||[]).map(t=>{let r=t;return(`fill`in n||n.gradientFill)&&t.tag===`path`&&`fill`in t.attributes&&(r={...t,attributes:{...t.attributes,fill:void 0}}),IM(e,r)}),i=t.attributes||{},a={};for(let[e,t]of Object.entries(i))switch(!0){case e===`class`:a.className=t;break;case e===`style`:a.style=FM(String(t));break;case e.startsWith(`aria-`):case e.startsWith(`data-`):a[e.toLowerCase()]=t;break;default:a[AM(e)]=t}let{style:o,role:s,"aria-label":c,gradientFill:l,...u}=n;if(o&&(a.style=a.style?{...a.style,...o}:o),s&&(a.role=s),c&&(a[`aria-label`]=c,a[`aria-hidden`]=`false`),l){a.fill=`url(#${l.id})`;let{type:t,stops:n=[],...i}=l;r.unshift(e(t===`linear`?`linearGradient`:`radialGradient`,{...i,id:l.id},n.map(jM)))}return e(t.tag,{...a,...u},...r)}var LM=IM.bind(null,G.createElement),RM=(e,t)=>{let n=(0,G.useId)();return e||(t?n:void 0)},zM=class{constructor(e=`react-fontawesome`){this.enabled=!1;let t=!1;try{t=!1}catch{}this.scope=e,this.enabled=t}log(...e){this.enabled&&console.log(`[${this.scope}]`,...e)}warn(...e){this.enabled&&console.warn(`[${this.scope}]`,...e)}error(...e){this.enabled&&console.error(`[${this.scope}]`,...e)}};({env:{NODE_ENV:`production`}}).env?.FA_VERSION;var BM=`searchPseudoElementsFullScan`in EM&&typeof EM.searchPseudoElementsFullScan==`boolean`?`7.0.0`:`6.0.0`,VM=Number.parseInt(BM)>=7,HM=()=>VM,UM=`fa`,WM={beat:`fa-beat`,fade:`fa-fade`,beatFade:`fa-beat-fade`,bounce:`fa-bounce`,shake:`fa-shake`,spin:`fa-spin`,spinPulse:`fa-spin-pulse`,spinReverse:`fa-spin-reverse`,pulse:`fa-pulse`,flip360:`fa-flip-360`,buzz:`fa-buzz`,float:`fa-float`,jello:`fa-jello`,spinSnap:`fa-spin-snap`,spinSnap4:`fa-spin-snap-4`,spinSnap8:`fa-spin-snap-8`,swing:`fa-swing`,wag:`fa-wag`},GM={left:`fa-pull-left`,right:`fa-pull-right`},KM={90:`fa-rotate-90`,180:`fa-rotate-180`,270:`fa-rotate-270`},qM={"2xs":`fa-2xs`,xs:`fa-xs`,sm:`fa-sm`,lg:`fa-lg`,xl:`fa-xl`,"2xl":`fa-2xl`,"1x":`fa-1x`,"2x":`fa-2x`,"3x":`fa-3x`,"4x":`fa-4x`,"5x":`fa-5x`,"6x":`fa-6x`,"7x":`fa-7x`,"8x":`fa-8x`,"9x":`fa-9x`,"10x":`fa-10x`},JM={border:`fa-border`,fixedWidth:`fa-fw`,flip:`fa-flip`,flipHorizontal:`fa-flip-horizontal`,flipVertical:`fa-flip-vertical`,inverse:`fa-inverse`,rotateBy:`fa-rotate-by`,swapOpacity:`fa-swap-opacity`,widthAuto:`fa-width-auto`,canvasSquare:`fa-canvas-square`,canvasRoomy:`fa-canvas-roomy`},YM={default:`fa-layers`};function XM(e){let t=EM.cssPrefix||EM.familyPrefix||UM;return t===UM?e:e.replace(new RegExp(String.raw`(?<=^|\s)${UM}-`,`g`),`${t}-`)}function ZM(e){let{beat:t,fade:n,beatFade:r,bounce:i,shake:a,spin:o,spinPulse:s,spinReverse:c,pulse:l,fixedWidth:u,inverse:d,border:f,flip:p,size:m,rotation:h,pull:g,swapOpacity:_,rotateBy:v,widthAuto:y,canvasSquare:b,canvasRoomy:x,flip360:S,buzz:C,float:w,jello:T,spinSnap:E,spinSnap4:D,spinSnap8:O,swing:k,wag:A,className:j}=e,M=[];return j&&M.push(...j.split(` `)),t&&M.push(WM.beat),n&&M.push(WM.fade),r&&M.push(WM.beatFade),i&&M.push(WM.bounce),a&&M.push(WM.shake),o&&M.push(WM.spin),c&&M.push(WM.spinReverse),s&&M.push(WM.spinPulse),l&&M.push(WM.pulse),u&&M.push(JM.fixedWidth),d&&M.push(JM.inverse),f&&M.push(JM.border),p===!0&&M.push(JM.flip),(p===`horizontal`||p===`both`)&&M.push(JM.flipHorizontal),(p===`vertical`||p===`both`)&&M.push(JM.flipVertical),m!=null&&M.push(qM[m]),h!=null&&h!==0&&M.push(KM[h]),g!=null&&M.push(GM[g]),_&&M.push(JM.swapOpacity),HM()?(v&&M.push(JM.rotateBy),y&&M.push(JM.widthAuto),b&&M.push(JM.canvasSquare),x&&M.push(JM.canvasRoomy),S&&M.push(WM.flip360),C&&M.push(WM.buzz),w&&M.push(WM.float),T&&M.push(WM.jello),E&&M.push(WM.spinSnap),D&&M.push(WM.spinSnap4),O&&M.push(WM.spinSnap8),k&&M.push(WM.swing),A&&M.push(WM.wag),(EM.cssPrefix||EM.familyPrefix||UM)===UM?M:M.map(XM)):M}var QM=e=>typeof e==`object`&&`icon`in e&&!!e.icon;function $M(e){if(e)return QM(e)?e:DM.icon(e)}function eN(e){return Object.keys(e)}var tN=new zM(`FontAwesomeIcon`),nN={border:!1,className:``,mask:void 0,maskId:void 0,fixedWidth:!1,inverse:!1,flip:!1,icon:void 0,listItem:!1,pull:void 0,pulse:!1,rotation:void 0,rotateBy:!1,size:void 0,spin:!1,spinPulse:!1,spinReverse:!1,beat:!1,fade:!1,beatFade:!1,bounce:!1,shake:!1,symbol:!1,title:``,titleId:void 0,transform:void 0,swapOpacity:!1,widthAuto:!1,canvasSquare:!1,canvasRoomy:!1,flip360:!1,buzz:!1,float:!1,jello:!1,spinSnap:!1,spinSnap4:!1,spinSnap8:!1,swing:!1,wag:!1},rN=new Set(Object.keys(nN)),iN=G.forwardRef((e,t)=>{let n={...nN,...e},{icon:r,mask:i,symbol:a,title:o,titleId:s,maskId:c,transform:l}=n,u=RM(c,!!i),d=RM(s,!!o),f=$M(r);if(!f)return tN.error(`Icon lookup is undefined`,r),null;let p=ZM(n),m=typeof l==`string`?DM.transform(l):l,h=$M(i),g=OM(f,{...p.length>0&&{classes:p},...m&&{transform:m},...h&&{mask:h},symbol:a,title:o,titleId:d,maskId:u});if(!g)return tN.error(`Could not find icon`,f),null;let{abstract:_}=g,v={ref:t};for(let e of eN(n))rN.has(e)||(v[e]=n[e]);return LM(_[0],v)});iN.displayName=`FontAwesomeIcon`,`${YM.default}${JM.fixedWidth}`;function aN({message:e,className:t,buttonRef:n}){let r=(0,G.useId)(),[i,a]=(0,G.useState)(!1);return(0,K.jsxs)(`span`,{className:(0,q.default)(`aone:relative aone:inline-flex`,t),onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[(0,K.jsx)(`button`,{type:`button`,ref:n,className:`aone:inline-flex aone:items-center aone:justify-center aone:h-4 aone:w-4 aone:cursor-pointer aone:rounded-sm aone:text-red-500 aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-red-500 aone:focus:ring-offset-1`,"data-testid":`error-icon`,"aria-label":`Validation error: ${e}`,"aria-expanded":i,"aria-controls":r,"aria-describedby":i?r:void 0,onFocus:()=>a(!0),onBlur:()=>a(!1),onClick:()=>a(e=>!e),children:(0,K.jsx)(iN,{icon:QE,"aria-hidden":`true`,className:`aone:h-4 aone:w-4`})}),i&&(0,K.jsx)(`div`,{id:r,role:`tooltip`,className:`aone:absolute aone:z-20 aone:top-full aone:left-1/2 aone:-translate-x-1/2 aone:mt-2 aone:bg-red-600 aone:text-white aone:text-xs aone:rounded aone:px-2 aone:py-1 aone:whitespace-nowrap`,children:e})]})}var oN=e=>{let t=e.match(/\d+/g)??[];if(t.length===0)return null;let n=parseInt(t[0].slice(0,2),10);if(Number.isNaN(n)||n<1||n>12)return null;let r=t[1]?.slice(0,2),i=Number(r??`1`);(Number.isNaN(i)||i<1||i>31)&&(i=1);let a=new Date().getFullYear(),o=t[2],s=a;if(o){let e=parseInt(o,10);s=o.length<=2?2e3+e:e}let c=new Date(s,n-1,i);return Dl(c)?xl(c):null},sN=/^\d{2}\/\d{2}\/\d{2}$/,cN=e=>e.toLocaleDateString(`en-US`,{year:`2-digit`,month:`2-digit`,day:`2-digit`}),lN=(e,t=``)=>{let n=e.length<t.length,r=e.replace(/\D/g,``).slice(0,8);if(!n&&e.endsWith(`/`)){let t=e.slice(0,-1).split(`/`);if(t.length===1){let e=t[0];if(e&&e.length===1)return`0${e}/`}if(t.length===2){let e=t[0],n=t[1];if(n&&n.length===1)return`${(e??``).padStart(2,`0`)}/${`0${n}`}/`}}if(r.length===1&&t===``&&!n&&parseInt(r,10)>=3)return`0${r}/`;if(e.indexOf(`/`)===1&&r.length>=1){let e=r.slice(0,1).padStart(2,`0`),t=r.slice(1);switch(t.length){case 0:return n?e:`${e}/`;case 1:return`${e}/${t}`;case 2:return n?`${e}/${t}`:`${e}/${t}/`;default:return`${e}/${t.slice(0,2)}/${t.slice(2).slice(-2).padStart(2,`0`)}`}}switch(r.length){case 0:return``;case 1:return r;case 2:return n?e:`${r}/`;case 3:{let e=r.slice(0,2),i=r.slice(2);return!n&&t.replace(/\D/g,``).length===2&&/^\d{2}\/$/.test(t)&&parseInt(i,10)>=4?`${e}/0${i}/`:`${e}/${i}`}case 4:{let e=r.slice(0,2),t=r.slice(2,4);return n?`${e}/${t}`:`${e}/${t}/`}default:return`${r.slice(0,2)}/${r.slice(2,4)}/${r.slice(4).slice(-2)}`}},uN=e=>{let t=e.trim();if(t===``)return``;let n=(t.match(/\d+/g)??[]).slice(0,3);if(n.length===0)return``;let r=n[0].slice(-2).padStart(2,`0`);if(n.length===1)return r;let i=n[1].slice(-2).padStart(2,`0`);return n.length===2?`${r}/${i}`:`${r}/${i}/${n[2].slice(-2).padStart(2,`0`)}`},dN=e=>{if(!sN.test(e))return null;let t=Ad(e,`MM/dd/yy`,new Date);return Dl(t)&&cN(xl(t))===e?xl(t):null};function fN({origin:e,destination:t,onChange:n,onMonthViewChange:r,oneWay:i,className:a,primaryColor:o,secondaryColor:s,startDateLabel:c=`Start Date`,endDateLabel:l=`End Date`,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,initialStartDate:p,initialEndDate:m,referenceDates:h,minDate:g,showButtons:_=!0}){let v=(0,G.useRef)(null),[y,b]=(0,G.useState)(null);(0,G.useLayoutEffect)(()=>{if(!v.current)return;let e=v.current.getRootNode();if(!(e instanceof ShadowRoot))return;let t=document.createElement(`div`);return e.appendChild(t),queueMicrotask(()=>b(t)),()=>{t.parentNode&&t.parentNode.removeChild(t)}},[]);let[x,S]=(0,G.useState)(``),[C,w]=(0,G.useState)(``),[T,E]=(0,G.useState)(null),[D,O]=(0,G.useState)(null),[k,A]=(0,G.useState)(p||null),[j,M]=(0,G.useState)(m||null),[N,P]=(0,G.useState)(!1),[ee,F]=(0,G.useState)(p||null),[te,ne]=(0,G.useState)(!1),[I,re]=(0,G.useState)(!1),[L]=(0,G.useState)(()=>p||new Date),ie=(0,G.useRef)(n),ae=(0,G.useRef)(null),oe=(0,G.useRef)(null),se=(0,G.useRef)(null),ce=(0,G.useRef)(0),le=(0,G.useRef)(null),R=(0,G.useRef)(null),ue=()=>Date.now()<ce.current,de=()=>{ue()||P(!0)},fe=()=>{ce.current=Date.now()+250,P(!1)},pe=e=>{e?de():fe()};(0,G.useEffect)(()=>{ie.current=n},[n]),(0,G.useEffect)(()=>{i&&queueMicrotask(()=>{M(null),w(``),O(null)})},[i]),(0,G.useEffect)(()=>{queueMicrotask(()=>{!k&&p&&A(p),!j&&m&&M(m)})},[p,m,k,j]);let me=xl(new Date),he=fl(me,6),ge=e=>{S(e);let t=dN(e);return e===``||!e?(E(null),A(null),!0):t?xu(t,me)?(E(`Date cannot be in the past`),A(null),!1):bu(t,he)?(E(`Date must be within 6 months`),A(null),!1):g&&xu(t,g)?(E(`Date must be no earlier than `+g.toLocaleDateString()),A(null),!1):(E(null),A(t),F(t),j&&xu(j,t)&&(M(null),w(``)),!0):(E(`Enter a date in MM/DD/YY format`),A(null),!1)},_e=e=>{if(i)return!0;w(e);let t=dN(e);return e===``||!e?(O(null),M(null),!0):t?xu(t,me)?(O(`Date cannot be in the past`),M(null),!1):bu(t,he)?(O(`Date must be within 6 months`),M(null),!1):k?xu(t,k)?(O(`Return date must be after departure`),M(null),!1):g&&xu(t,g)?(O(`Date must be no earlier than `+g.toLocaleDateString()),M(null),!1):(O(null),M(t),F(t),!0):(O(`Enter departure date first`),M(null),!1):(O(`Enter a date in MM/DD/YY format`),M(null),!1)},ve=()=>ge(x),ye=()=>_e(C),be=e=>{let t=e.getTime()<(k?.getTime()||0);k?!j&&t?A(e):j?k&&j&&(Tl(e,k)&&Tl(e,j)?(A(e),M(null)):xu(e,j)&&xu(e,dl(k,3))?A(e):M(e)):i?A(e):M(e):A(e)},xe=()=>{A(null),M(null),S(``),w(``),E(null),O(null),F(null),ie.current(null,null)};(0,G.useEffect)(()=>{ie.current(k,j)},[k,j]),(0,G.useEffect)(()=>{queueMicrotask(()=>{k?(S(cN(k)),E(null)):T||S(``)})},[k]),(0,G.useEffect)(()=>{queueMicrotask(()=>{j?(w(cN(j)),O(null)):D||w(``)})},[j]);let Se={};o&&(Se[`--color-primary`]=o),s&&(Se[`--color-secondary`]=s);let Ce=DE(),we=(0,G.useId)(),Te=`${we}-description`,Ee=(0,K.jsxs)(`div`,{ref:se,onClick:de,className:(0,q.default)(`aone:relative aone:h-full aone:flex aone:flex-col aone:gap-4 aone:px-3 aone:py-2 aone:rounded-lg aone:bg-white aone:cursor-pointer`,`aone:@2xl:flex-row aone:@2xl:items-center`,{"aone:border-2 aone:border-primary":N,"aone:border-2 aone:border-gray-200":!N}),children:[(0,K.jsxs)(`fieldset`,{className:`aone:border-0 aone:p-0 aone:m-0 aone:@2xl:flex-1 aone:@2xl:pr-3`,children:[(0,K.jsx)(`legend`,{className:`aone:sr-only`,children:`Date range selection`}),(0,K.jsxs)(`div`,{className:`aone:flex aone:grow aone:items-center`,children:[(0,K.jsx)(`span`,{children:(0,K.jsx)(OE,{})}),(0,K.jsxs)(`div`,{className:`aone:relative aone:flex-grow`,children:[(0,K.jsx)(`input`,{type:`text`,name:`start-date`,value:x,"aria-label":c,"aria-invalid":T?`true`:void 0,placeholder:te?`mm/dd/yy`:c,autoComplete:`off`,className:(0,q.default)(`aone:ml-2 aone:all-initial aone:focus:outline-none aone:disabled:bg-white aone:text-black aone:text-base aone:w-full aone:pr-1`,{"aone:text-red-500 ":!!T}),onChange:e=>{let t=lN(e.target.value,x);S(t),E(null),F(oN(t)),ie.current(null,j)},onFocus:()=>{ne(!0),de()},onBlur:e=>{let t=uN(e.target.value);S(t);let n=ge(t);ne(!1),!n&&le.current===`forward`&&requestAnimationFrame(()=>ae.current?.focus()),le.current=null},onKeyDown:e=>{e.key===`Tab`&&(le.current=e.shiftKey?`backward`:`forward`),e.key===`Enter`&&(e.preventDefault(),ve(),e.target.blur())}}),T&&(0,K.jsx)(`span`,{className:`aone:absolute aone:right-2 aone:top-1/2 aone:-translate-y-1/2`,children:(0,K.jsx)(aN,{message:T,buttonRef:ae})})]})]})]}),!i&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`aone:absolute aone:left-2 aone:right-2 aone:top-1/2 aone:@2xl:top-2 aone:@2xl:bottom-2 aone:@2xl:left-1/2 aone:rounded-lg aone:h-[2px] aone:@2xl:h-[initial] aone:@2xl:w-[2px] aone:bg-gray-200`}),(0,K.jsxs)(`fieldset`,{className:`aone:border-0 aone:p-0 aone:m-0 aone:@2xl:flex-1 aone:@2xl:pl-3`,children:[(0,K.jsx)(`legend`,{className:`aone:sr-only`,children:`Return date selection`}),(0,K.jsxs)(`div`,{className:`aone:flex aone:grow aone:items-center`,children:[(0,K.jsx)(`span`,{className:`aone:@2xl:hidden`,children:(0,K.jsx)(OE,{})}),(0,K.jsxs)(`div`,{className:`aone:relative aone:flex-grow`,children:[(0,K.jsx)(`input`,{type:`text`,name:`end-date`,value:C,"aria-label":l,"aria-invalid":D?`true`:void 0,placeholder:I?`mm/dd/yy`:l,autoComplete:`off`,className:(0,q.default)(`aone:ml-2 aone:focus:outline-none aone:disabled:bg-white aone:text-black aone:text-base aone:w-full aone:pr-7`,{"aone:text-red-500":!!D}),onChange:e=>{let t=lN(e.target.value,C);w(t),O(null),F(oN(t)),ie.current(k,null)},onFocus:()=>{re(!0),de()},onBlur:e=>{let t=uN(e.target.value);w(t);let n=_e(t);re(!1),!n&&R.current===`forward`&&requestAnimationFrame(()=>oe.current?.focus()),R.current=null},onKeyDown:e=>{e.key===`Tab`&&(R.current=e.shiftKey?`backward`:`forward`),e.key===`Enter`&&(e.preventDefault(),ye(),e.target.blur())}}),D&&(0,K.jsx)(`span`,{className:`aone:absolute aone:right-2 aone:top-1/2 aone:-translate-y-1/2`,children:(0,K.jsx)(aN,{message:D,buttonRef:oe})})]})]})]})]})]});return(0,K.jsxs)(`div`,{id:`A1-DateRangePicker`,ref:v,className:a,style:Se,role:`group`,"aria-label":`Date range picker`,"aria-describedby":Te,children:[Ce?(0,K.jsxs)(bE,{open:N,onOpenChange:pe,children:[Ee,(0,K.jsxs)(yE,{className:`ao-dialog--calendar-light`,open:N,onOpenChange:pe,"aria-labelledby":we,"aria-describedby":void 0,children:[(0,K.jsx)(xE,{id:we,className:`aone:sr-only`,children:`Filter Options`}),(0,K.jsx)(PE,{origin:e,destination:t,initialDate:L,startDate:k,endDate:j,previewDate:ee,onChange:be,onMonthViewChange:r,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,referenceDates:h,minDate:g},L.toISOString()),_&&(0,K.jsxs)(`div`,{className:`aone:mt-3 aone:flex aone:justify-between aone:items-center aone:pt-0 aone:pb-1 aone:md:pb-2 aone:px-1`,children:[(0,K.jsx)(`button`,{type:`button`,className:`aone:bg-slate-400 aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-slate-500`,onClick:xe,"data-testid":`date-range-picker-reset-button`,children:`Reset`}),(0,K.jsx)(`button`,{type:`button`,className:`aone:bg-primary aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-primary`,onClick:fe,"data-testid":`date-range-picker-done-button`,children:`Done`})]})]})]}):(0,K.jsxs)(SE,{open:N,onOpenChange:pe,children:[(0,K.jsx)(TE,{asChild:!0,children:Ee}),(0,K.jsxs)(wE,{side:`bottom`,align:`center`,sticky:`always`,avoidCollisions:!1,onOpenAutoFocus:e=>e.preventDefault(),onInteractOutside:e=>{let t=e.target;t&&se.current?.contains(t)&&e.preventDefault()},sideOffset:4,portalContainer:y,role:`dialog`,"aria-label":`Calendar for date selection`,"aria-describedby":`calendar-instructions`,className:`aone:w-max aone:max-w-[100vw] aone:p-0 aone:bg-white aone:border aone:border-gray-300 aone:rounded-xl aone:shadow-lg aone:md:mt-2 aone:pb-2`,children:[(0,K.jsx)(`div`,{id:`calendar-instructions`,className:`aone:sr-only`,children:`Use arrow keys to navigate dates. Press Enter or Space to select a date. Press Escape to close the calendar.`}),(0,K.jsx)(PE,{origin:e,destination:t,initialDate:L,startDate:k,endDate:j,previewDate:ee,onChange:be,onMonthViewChange:r,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,referenceDates:h,minDate:g},L.toISOString()),_&&(0,K.jsxs)(`div`,{className:`aone:mt-3 aone:md:mt-0 aone:flex aone:justify-between aone:items-center aone:pt-0 aone:pb-1 aone:md:pb-2 aone:px-5`,children:[(0,K.jsx)(`button`,{type:`button`,className:`aone:bg-slate-400 aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-slate-500`,onClick:xe,"data-testid":`date-range-picker-popover-reset-button`,children:`Reset`}),(0,K.jsx)(`button`,{type:`button`,className:`aone:bg-primary aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-primary`,onClick:fe,"data-testid":`date-range-picker-popover-done-button`,children:`Done`})]})]})]}),(0,K.jsx)(`div`,{id:Te,className:`aone:sr-only`,children:i?`Departure date input. Enter a date manually or open the calendar to pick one.`:`Departure and return date inputs. Enter dates manually or open the calendar to pick a date range.`})]})}function pN(e){if(e===`00:00`)return`Midnight`;if(e===`12:00`)return`Noon`;let[t=`00`,n=`00`]=e.split(`:`),r=parseInt(t,10),i=r<12?`am`:`pm`;return r===0&&(r=12),r>12&&(r-=12),`${r}:${n.padStart(2,`0`)} ${i}`}var mN=Array.from({length:48},(e,t)=>{let n=Math.floor(t/2),r=t%2==0?`00`:`30`;return`${n.toString().padStart(2,`0`)}:${r}`}),hN=`00:00`,gN=`12:00`;function _N(e,t=!1){let n=`time-picker-option-${e.replace(`:`,`-`)}`;return t?`${n}-highlight`:n}function vN({label:e,time:t,isSelected:n,onSelect:r,testId:i}){return(0,K.jsx)(`button`,{type:`button`,className:`aone:w-full aone:rounded aone:px-3 aone:py-1 aone:text-center aone:text-xs aone:font-semibold aone:uppercase aone:tracking-wide aone:transition ${n?`aone:bg-primary aone:text-primary-foreground hover:aone:bg-primary/90`:`aone:bg-gray-200 aone:text-gray-700 hover:aone:bg-gray-300`}`,onClick:()=>r(t),"data-testid":i,children:e})}var yN=({value:e,onChange:t,label:n,header:r=`Select pick-up time`,portalContainer:i,hasError:a=!1,dataTestId:o=`time-picker-trigger`,minTime:s})=>{let[c,l]=(0,G.useState)(!1),u=(0,G.useRef)(null),d=(0,G.useMemo)(()=>s?mN.filter(e=>e>=s):mN,[s]),{beforeNoon:f,hasMidnight:p,hasNoon:m,afterNoon:h}=(0,G.useMemo)(()=>{let e=[],t=[],n=!1,r=!1;for(let i of d)i===hN?n=!0:i===gN?r=!0:i<gN?e.push(i):t.push(i);return{beforeNoon:e,hasMidnight:n,hasNoon:r,afterNoon:t}},[d]),g=(0,G.useCallback)(()=>{let t=u.current;if(!t||!e)return;let n=e===gN&&m?_N(gN,!0):e===hN&&p?_N(hN,!0):_N(e),r=t.querySelector(`[data-testid="${n}"]`)??t.querySelector(`[data-testid="${_N(e)}"]`);if(!r)return;let i=t.getBoundingClientRect(),a=r.getBoundingClientRect().top-i.top-t.clientHeight/2+r.clientHeight/2;t.scrollTop+=a,r.focus({preventScroll:!0})},[e,p,m]);(0,G.useEffect)(()=>{if(!c||!e)return;let t=window.setTimeout(()=>{g()},50);return()=>window.clearTimeout(t)},[c,e,g]);let _=e=>{t(e),l(!1)},v=e=>{e.preventDefault(),window.setTimeout(()=>{g()},50)},y=t=>(0,K.jsx)(`button`,{type:`button`,className:`aone:w-full aone:rounded-md aone:px-2 aone:py-2 aone:text-left aone:text-sm aone:transition ${e===t&&t!==gN&&t!==hN?`aone:bg-primary aone:text-primary-foreground hover:aone:bg-primary/90`:`aone:bg-transparent aone:text-foreground hover:aone:bg-muted`}`,onClick:()=>_(t),"data-testid":_N(t),children:pN(t)},t),b=e=>e.length>0?(0,K.jsx)(`div`,{className:`aone:grid aone:grid-cols-2 aone:gap-2`,children:e.map(y)}):null;return(0,K.jsxs)(SE,{open:c,onOpenChange:l,children:[(0,K.jsx)(CE,{asChild:!0,children:(0,K.jsxs)(`button`,{type:`button`,className:`aone:w-full aone:h-full aone:text-base aone:px-4 aone:py-2 aone:bg-white aone:dark:bg-gray-800 aone:rounded-md aone:text-left aone:shadow-sm aone:flex aone:items-center aone:justify-between aone:cursor-pointer aone:border-2 aone:dark:border-gray-600 aone:text-foreground ${a?`aone:border-red-500 aone:ring-2 aone:ring-red-200`:`aone:border-gray-200`}`,"data-testid":o,children:[(0,K.jsx)(`span`,{children:e?pN(e):n||`Select time`}),(0,K.jsx)(`div`,{className:`aone:pointer-events-none aone:flex aone:items-center`,children:(0,K.jsx)(iN,{icon:c?RE:ZE,className:`aone:h-4 aone:w-4 aone:text-muted-foreground`})})]})}),(0,K.jsxs)(wE,{className:`aone:p-0 aone:w-64 aone:shadow-lg aone:rounded-xl`,portalContainer:i,onOpenAutoFocus:v,children:[(0,K.jsx)(`div`,{className:`aone:border-b aone:px-4 aone:py-3 aone:font-semibold aone:text-base aone:text-foreground`,children:r}),(0,K.jsx)(`div`,{ref:u,className:`aone:max-h-72 aone:overflow-y-auto aone:p-2`,style:{WebkitOverflowScrolling:`touch`,overscrollBehavior:`contain`,touchAction:`pan-y`},onTouchStart:e=>e.stopPropagation(),onTouchMove:e=>e.stopPropagation(),children:(0,K.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:gap-2`,children:[b(p?[hN,...f]:f),m?(0,K.jsx)(vN,{label:`Noon`,time:gN,isSelected:e===gN,onSelect:_,testId:_N(gN,!0)}):null,b(m?[gN,...h]:h),p?(0,K.jsx)(vN,{label:`Midnight`,time:hN,isSelected:e===hN,onSelect:_,testId:_N(hN,!0)}):null]})})]})]})};function bN({label:e,dateValue:t,timeValue:n,onDateChange:r,onTimeChange:i,origin:a,destination:o,className:s,referenceDates:c,minDate:l,shadowRoot:u}){let d=(0,G.useRef)(null),[f,p]=(0,G.useState)(null);return(0,G.useLayoutEffect)(()=>{if(!u||!d.current)return;let e=document.createElement(`div`);return u.appendChild(e),queueMicrotask(()=>p(e)),()=>{e.parentNode&&e.parentNode.removeChild(e)}},[u]),(0,K.jsxs)(`div`,{ref:d,className:`w-full md:w-auto md:flex-1 md:min-w-[325px] ${s||``}`,children:[(0,K.jsx)(`label`,{className:`aone:block aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:e}),(0,K.jsxs)(`div`,{className:`aone:mt-1 aone:flex aone:bg-white aone:dark:bg-gray-800 aone:rounded-lg`,children:[(0,K.jsx)(`div`,{className:`aone:grow`,children:(0,K.jsx)(fN,{className:`aone:grow`,origin:a,destination:o,startDateLabel:e,endDateLabel:``,initialStartDate:t?new Date(t):null,initialEndDate:null,onChange:r,onMonthViewChange:()=>{},oneWay:!0,referenceDates:c,minDate:l,showButtons:!0,shadowRoot:u})}),(0,K.jsx)(`div`,{className:`aone:min-w-[150px] `,children:(0,K.jsx)(yN,{value:n,onChange:i,portalContainer:f})})]})]})}function xN(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function SN(){return SN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},SN.apply(null,arguments)}var CN=s(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),wN=s(((e,t)=>{var n=CN();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),TN=s(((e,t)=>{t.exports=wN()()})),EN=s((e=>{})),DN=s(((e,t)=>{t.exports=EN()})),$=l(TN(),1);DN();var ON=e=>typeof e==`object`&&!!e&&e.nodeType===1,kN=(e,t)=>(!t||e!==`hidden`)&&e!==`visible`&&e!==`clip`,AN=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return kN(n.overflowY,t)||kN(n.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch{return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},jN=(e,t,n,r,i,a,o,s)=>a<e&&o>t||a>e&&o<t?0:a<=e&&s<=n||o>=t&&s>=n?a-e-r:o>t&&s<n||a<e&&s>n?o-t+i:0,MN=e=>e.parentElement??(e.getRootNode().host||null),NN=(e,t)=>{if(typeof document>`u`)return[];let{scrollMode:n,block:r,inline:i,boundary:a,skipOverflowHiddenElements:o}=t,s=typeof a==`function`?a:e=>e!==a;if(!ON(e))throw TypeError(`Invalid target`);let c=document.scrollingElement||document.documentElement,l=[],u=e;for(;ON(u)&&s(u);){if(u=MN(u),u===c){l.push(u);break}u!=null&&u===document.body&&AN(u)&&!AN(document.documentElement)||u!=null&&AN(u,o)&&l.push(u)}let d=window.visualViewport?.width??innerWidth,f=window.visualViewport?.height??innerHeight,{scrollX:p,scrollY:m}=window,{height:h,width:g,top:_,right:v,bottom:y,left:b}=e.getBoundingClientRect(),{top:x,right:S,bottom:C,left:w}=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e),T=r===`start`||r===`nearest`?_-x:r===`end`?y+C:_+h/2-x+C,E=i===`center`?b+g/2-w+S:i===`end`?v+S:b-w,D=[];for(let e=0;e<l.length;e++){let t=l[e],{height:a,width:o,top:s,right:u,bottom:x,left:S}=t.getBoundingClientRect();if(n===`if-needed`&&_>=0&&b>=0&&y<=f&&v<=d&&(t===c&&!AN(t)||_>=s&&y<=x&&b>=S&&v<=u))return D;let C=getComputedStyle(t),w=parseInt(C.borderLeftWidth,10),O=parseInt(C.borderTopWidth,10),k=parseInt(C.borderRightWidth,10),A=parseInt(C.borderBottomWidth,10),j=0,M=0,N=`offsetWidth`in t?t.offsetWidth-t.clientWidth-w-k:0,P=`offsetHeight`in t?t.offsetHeight-t.clientHeight-O-A:0,ee=`offsetWidth`in t?t.offsetWidth===0?0:o/t.offsetWidth:0,F=`offsetHeight`in t?t.offsetHeight===0?0:a/t.offsetHeight:0;if(c===t)j=r===`start`?T:r===`end`?T-f:r===`nearest`?jN(m,m+f,f,O,A,m+T,m+T+h,h):T-f/2,M=i===`start`?E:i===`center`?E-d/2:i===`end`?E-d:jN(p,p+d,d,w,k,p+E,p+E+g,g),j=Math.max(0,j+m),M=Math.max(0,M+p);else{j=r===`start`?T-s-O:r===`end`?T-x+A+P:r===`nearest`?jN(s,x,a,O,A+P,T,T+h,h):T-(s+a/2)+P/2,M=i===`start`?E-S-w:i===`center`?E-(S+o/2)+N/2:i===`end`?E-u+k+N:jN(S,u,o,w,k+N,E,E+g,g);let{scrollLeft:e,scrollTop:n}=t;j=F===0?0:Math.max(0,Math.min(n+j/F,t.scrollHeight-a/F+P)),M=ee===0?0:Math.max(0,Math.min(e+M/ee,t.scrollWidth-o/ee+N)),T+=n-j,E+=e-M}D.push({el:t,top:j,left:M})}return D},PN=0;function FN(){return String(PN++)}var IN=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?G.useLayoutEffect:G.useEffect;function LN(e){var t=G.useRef(e);return IN(function(){t.current=e},[e]),t}function RN(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach(function(t){typeof t==`function`?t(e):t&&(t.current=e)})}}function zN(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.some(function(t){return t&&t.apply(void 0,[e].concat(r)),e.preventDownshiftDefault||e.hasOwnProperty(`nativeEvent`)&&e.nativeEvent.preventDownshiftDefault})}}function BN(e,t){var n;function r(){n&&clearTimeout(n)}function i(){for(var i=arguments.length,a=Array(i),o=0;o<i;o++)a[o]=arguments[o];r(),n=setTimeout(function(){n=null,e.apply(void 0,a)},t)}return i.cancel=r,i}var VN=BN(function(e){HN(e).textContent=``},500);function HN(e){var t=e.getElementById(`a11y-status-message`);return t||(t=e.createElement(`div`),t.setAttribute(`id`,`a11y-status-message`),t.setAttribute(`role`,`status`),t.setAttribute(`aria-live`,`polite`),t.setAttribute(`aria-relevant`,`additions text`),Object.assign(t.style,{border:`0`,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:`0`,position:`absolute`,width:`1px`}),e.body.appendChild(t),t)}function UN(e,t){if(e&&t){var n=HN(t);n.textContent=e,VN(t)}}function WN(e){var t=e?.getElementById(`a11y-status-message`);t&&t.remove()}function GN(){}var KN=GN;function qN(e,t){return t?Object.keys(e).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},SN({},e)):e}function JN(e,t){e&&NN(e,{boundary:t,block:`nearest`,scrollMode:`if-needed`}).forEach(function(e){var t=e.el,n=e.top,r=e.left;t.scrollTop=n,t.scrollLeft=r})}function YN(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&!t.startsWith(`Arrow`)?`Arrow`+t:t}function XN(e,t,n,r,i){i===void 0&&(i=!1);var a=n.length;if(t){for(var o=e;o>=0;o--)if(!r(n[o],o))return o}else for(var s=e;s<a;s++)if(!r(n[s],s))return s;return i?XN(t?a-1:0,t,n,r):-1}function ZN(e,t,n,r,i){i===void 0&&(i=!1);var a=n.length;if(a===0)return-1;var o=a-1;(typeof e!=`number`||e<0||e>o)&&(e=t>0?-1:o+1);var s=e+t;s<0?s=i?o:0:s>o&&(s=i?0:o);var c=XN(s,t<0,n,r,i);return c===-1?e>=a?-1:e:c}function QN(e,t,n,r){return r===void 0&&(r=!0),!!n&&t.some(function(t){return t&&($N(t,e,n)||r&&$N(t,n.document.activeElement,n))})}function $N(e,t,n){return e===t||t instanceof n.Node&&e.contains(t)}function eP(e){return``+e.slice(0,1).toUpperCase()+e.slice(1)}function tP(e,t,n,r){for(var i=e.type,a={},o=Object.keys(n),s=0,c=o;s<c.length;s++){var l=c[s];nP(l,e,t,n,r),r[l]!==n[l]&&(a[l]=r[l])}typeof t.onStateChange==`function`&&Object.keys(a).length&&t.onStateChange(SN({type:i},a))}function nP(e,t,n,r,i){if(i[e]!==r[e]){var a=n[`on`+eP(e)+`Change`];if(typeof a==`function`){var o=t.type;a(SN({type:o},i))}}}function rP(e,t,n,r){var i=G.useRef({}),a=G.useCallback(function(t,n){var r=t.state;r=qN(r,n.props);var i=e(r,n),a=n.props.stateReducer(r,SN({},n,{changes:i}));return{state:SN({},r,a),lastAction:n}},[e]),o=G.useReducer(a,t,function(e){return{state:n(e),lastAction:void 0}}),s=o[0],c=s.state,l=s.lastAction,u=o[1],d=LN(t),f=G.useCallback(function(e){return u(SN({},e,{props:d.current}))},[d]);return G.useEffect(function(){if(l){var e=qN(i.current,l.props);r(e,c)||tP(l,l.props,e,c)}i.current=c},[c,l,r]),[c,f]}function iP(e,t,n,r){var i=rP(e,t,n,r),a=i[0],o=i[1];return[qN(a,t),o]}function aP(e,t,n,r){if(e!==void 0&&t!==void 0)return[e,t];if(e!==void 0){if(n.indexOf(e)<0)throw Error(r);return[e,n.indexOf(e)]}if(t!==void 0){var i=n[t];if(i===void 0)throw Error(r);return[i,t]}throw Error(r)}function oP(){var e=G.useRef(!0);return G.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]),e.current}var sP={environment:$.default.shape({addEventListener:$.default.func.isRequired,removeEventListener:$.default.func.isRequired,document:$.default.shape({createElement:$.default.func.isRequired,getElementById:$.default.func.isRequired,activeElement:$.default.any.isRequired,body:$.default.any.isRequired}).isRequired,Node:$.default.func.isRequired}),itemToKey:$.default.func,stateReducer:$.default.func};function cP(e,t){return e===void 0?t:e}function lP(e,t,n,r){return e===void 0?t===void 0?n===void 0?r:n:t:e}var uP=BN(function(e,t){UN(e,t)},200);function dP(e,t,n,r){var i=r?.document,a=oP();G.useEffect(function(){e&&!a&&i&&uP(e(t),i)},n),G.useEffect(function(){return function(){uP.cancel(),WN(i)}},[i])}var fP=SN({},sP,{getA11yStatusMessage:$.default.func,highlightedIndex:$.default.number,defaultHighlightedIndex:$.default.number,initialHighlightedIndex:$.default.number,isOpen:$.default.bool,defaultIsOpen:$.default.bool,initialIsOpen:$.default.bool,selectedItem:$.default.any,initialSelectedItem:$.default.any,defaultSelectedItem:$.default.any,id:$.default.string,labelId:$.default.string,menuId:$.default.string,getItemId:$.default.func,toggleButtonId:$.default.string,onSelectedItemChange:$.default.func,onHighlightedIndexChange:$.default.func,onStateChange:$.default.func,onIsOpenChange:$.default.func,scrollIntoView:$.default.func}),pP={itemToString:function(e){return e?String(e):``},itemToKey:function(e){return e},isItemDisabled:function(e){return!1},stateReducer:function(e,t){return t.changes},scrollIntoView:JN,environment:typeof window>`u`?void 0:window},mP={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:``},hP=SN({},G).useId,gP=typeof hP==`function`?_P:vP;function _P(e){var t=e.id,n=e.labelId,r=e.menuId,i=e.getItemId,a=e.toggleButtonId,o=e.inputId,s=`downshift-`+hP();return t||=s,G.useMemo(function(){return{labelId:n??t+`-label`,menuId:r??t+`-menu`,getItemId:i??function(e){return t+`-item-`+e},toggleButtonId:a??t+`-toggle-button`,inputId:o??t+`-input`}},[i,t,o,n,r,a])}function vP(e){var t=e.id,n=e.labelId,r=e.menuId,i=e.getItemId,a=e.toggleButtonId,o=e.inputId,s=G.useState(function(){return t??`downshift-`+FN()})[0];return G.useMemo(function(){return{labelId:n??s+`-label`,menuId:r??s+`-menu`,getItemId:i??function(e){return s+`-item-`+e},toggleButtonId:a??s+`-toggle-button`,inputId:o??s+`-input`}},[i,o,n,r,a,s])}function yP(e,t,n){var r=cP(n,mP.highlightedIndex);return e[r]&&t(e[r],r)?-1:r}function bP(e,t,n,r,i,a){var o=e.length&&i>=0;return SN({isOpen:!1,highlightedIndex:-1},o&&SN({selectedItem:e[i],isOpen:cP(n,mP.isOpen),highlightedIndex:cP(r,mP.highlightedIndex)},a&&{inputValue:t(e[i])}))}function xP(e,t,n,r,i,a,o,s){return e.length===0?-1:t!==void 0&&o===t&&(t===-1||e[t]!==void 0&&!r(e[t],t))?t:n!==void 0&&(n===-1||e[n]!==void 0&&!r(e[n],n))?n:a?e.findIndex(function(e){return i(a)===i(e)}):s<0&&e[e.length-1]&&!r(e[e.length-1],e.length-1)?e.length-1:s>0&&e[0]&&!r(e[0],0)?0:-1}function SP(e){var t=lP(e.selectedItem,e.initialSelectedItem,e.defaultSelectedItem,mP.selectedItem),n=lP(e.isOpen,e.initialIsOpen,e.defaultIsOpen,mP.isOpen),r=CP(e),i=lP(e.inputValue,e.initialInputValue,e.defaultInputValue,mP.inputValue);return{highlightedIndex:r<0&&t&&n?e.items.findIndex(function(n){return e.itemToKey(n)===e.itemToKey(t)}):r,isOpen:n,selectedItem:t,inputValue:i}}function CP(e){var t=lP(e.highlightedIndex,e.initialHighlightedIndex,e.defaultHighlightedIndex,mP.highlightedIndex);return t>-1&&e.items[t]&&e.isItemDisabled(e.items[t],t)?-1:t}var wP=GN;function TP(e,t,n){var r=G.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1}),i=G.useCallback(function(){return n.map(function(e){return e.current})},[n]);return G.useEffect(function(){if(!e)return GN;function n(){r.current.isTouchEnd=!1,r.current.isMouseDown=!0}function a(n){r.current.isMouseDown=!1,QN(n.target,i(),e)||t()}function o(){r.current.isTouchEnd=!1,r.current.isTouchMove=!1}function s(){r.current.isTouchMove=!0}function c(n){r.current.isTouchEnd=!0,!r.current.isTouchMove&&!QN(n.target,i(),e,!1)&&t()}return e.addEventListener(`mousedown`,n),e.addEventListener(`mouseup`,a),e.addEventListener(`touchstart`,o),e.addEventListener(`touchmove`,s),e.addEventListener(`touchend`,c),function(){e.removeEventListener(`mousedown`,n),e.removeEventListener(`mouseup`,a),e.removeEventListener(`touchstart`,o),e.removeEventListener(`touchmove`,s),e.removeEventListener(`touchend`,c)}},[e,i,t]),r}var EP=function(){return GN};function DP(e,t,n,r,i,a){var o=G.useRef(!0);return IN(function(){if(!(t<0||!n||!Object.keys(i.current).length)){if(o.current){var s=i.current[a(t)];s&&r.current&&e(s,r.current)}else o.current=!0}},[t]),G.useCallback(function(){o.current=!1},[])}function OP(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function kP(e,t,n,r){var i=n.type,a;switch(i){case r.ItemMouseMove:a={highlightedIndex:n.disabled?-1:n.index};break;case r.MenuMouseLeave:a={highlightedIndex:-1};break;case r.ToggleButtonClick:case r.FunctionToggleMenu:a={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:xP(t.items,t.initialHighlightedIndex,t.defaultHighlightedIndex,t.isItemDisabled,t.itemToKey,e.selectedItem,e.highlightedIndex,0)};break;case r.FunctionOpenMenu:a={isOpen:!0,highlightedIndex:xP(t.items,t.initialHighlightedIndex,t.defaultHighlightedIndex,t.isItemDisabled,t.itemToKey,e.selectedItem,e.highlightedIndex,0)};break;case r.FunctionCloseMenu:a={isOpen:!1};break;case r.FunctionSetHighlightedIndex:var o=n.highlightedIndex;a={highlightedIndex:t.isItemDisabled(t.items[o],o)?-1:o};break;case r.FunctionSetInputValue:a={inputValue:n.inputValue};break;case r.FunctionReset:a={highlightedIndex:yP(t.items,t.isItemDisabled,t.defaultHighlightedIndex),isOpen:cP(t.defaultIsOpen,mP.isOpen),selectedItem:cP(t.defaultSelectedItem,mP.selectedItem),inputValue:cP(t.defaultInputValue,mP.inputValue)};break;default:throw Error(`Reducer called without proper action type.`)}return SN({},e,a)}var AP=SN({},fP,{items:$.default.array.isRequired,isItemDisabled:$.default.func});function jP(e){for(var t=e.keysSoFar,n=e.highlightedIndex,r=e.items,i=e.itemToString,a=e.isItemDisabled,o=t.toLowerCase(),s=0;s<r.length;s++){var c=(s+n+ +(t.length<2))%r.length,l=r[c];if(l!==void 0&&i(l).toLowerCase().startsWith(o)&&!a(l,c))return c}return n}var MP=0,NP=1,PP=2,FP=3,IP=4,LP=5,RP=6,zP=7,BP=8,VP=9,HP=10,UP=11,WP=12,GP=13,KP=14,qP=15,JP=16,YP=17,XP=18,ZP=19,QP=20,$P=21,eF=Object.freeze({__proto__:null,FunctionCloseMenu:YP,FunctionOpenMenu:JP,FunctionReset:$P,FunctionSelectItem:ZP,FunctionSetHighlightedIndex:XP,FunctionSetInputValue:QP,FunctionToggleMenu:qP,ItemClick:KP,ItemMouseMove:GP,MenuMouseLeave:WP,ToggleButtonBlur:UP,ToggleButtonClick:MP,ToggleButtonKeyDownArrowDown:NP,ToggleButtonKeyDownArrowUp:PP,ToggleButtonKeyDownCharacter:FP,ToggleButtonKeyDownEnd:RP,ToggleButtonKeyDownEnter:zP,ToggleButtonKeyDownEscape:IP,ToggleButtonKeyDownHome:LP,ToggleButtonKeyDownPageDown:HP,ToggleButtonKeyDownPageUp:VP,ToggleButtonKeyDownSpaceButton:BP});function tF(e,t){var n=t.type,r=t.props,i;switch(n){case KP:i={isOpen:cP(r.defaultIsOpen,mP.isOpen),highlightedIndex:yP(r.items,r.isItemDisabled,r.defaultHighlightedIndex),selectedItem:r.items[t.index]};break;case FP:var a=t.key,o=``+e.inputValue+a;i={inputValue:o,highlightedIndex:jP({keysSoFar:o,highlightedIndex:!e.isOpen&&e.selectedItem?r.items.findIndex(function(t){return r.itemToKey(t)===r.itemToKey(e.selectedItem)}):e.highlightedIndex,items:r.items,itemToString:r.itemToString,isItemDisabled:r.isItemDisabled}),isOpen:!0};break;case NP:var s=t.altKey;i={highlightedIndex:e.isOpen?ZN(e.highlightedIndex,1,r.items,r.isItemDisabled):s&&e.selectedItem==null?-1:xP(r.items,r.initialHighlightedIndex,r.defaultHighlightedIndex,r.isItemDisabled,r.itemToKey,e.selectedItem,e.highlightedIndex,1),isOpen:!0};break;case PP:var c=t.altKey;i=e.isOpen&&c?bP(r.items,r.itemToString,r.defaultIsOpen,r.defaultHighlightedIndex,e.highlightedIndex,!1):{highlightedIndex:e.isOpen?ZN(e.highlightedIndex,-1,r.items,r.isItemDisabled):xP(r.items,r.initialHighlightedIndex,r.defaultHighlightedIndex,r.isItemDisabled,r.itemToKey,e.selectedItem,e.highlightedIndex,-1),isOpen:!0};break;case zP:case BP:i=bP(r.items,r.itemToString,r.defaultIsOpen,r.defaultHighlightedIndex,e.highlightedIndex,!1);break;case LP:i={highlightedIndex:XN(0,!1,r.items,r.isItemDisabled),isOpen:!0};break;case RP:i={highlightedIndex:XN(r.items.length-1,!0,r.items,r.isItemDisabled),isOpen:!0};break;case VP:i={highlightedIndex:ZN(e.highlightedIndex,-10,r.items,r.isItemDisabled)};break;case HP:i={highlightedIndex:ZN(e.highlightedIndex,10,r.items,r.isItemDisabled)};break;case IP:i={isOpen:!1,highlightedIndex:-1};break;case UP:i=SN({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&r.items.length&&{selectedItem:r.items[e.highlightedIndex]});break;case ZP:i={selectedItem:t.selectedItem};break;default:return kP(e,r,t,eF)}return SN({},e,i)}var nF=[`onClick`],rF=[`onMouseLeave`,`refKey`,`ref`,`aria-label`],iF=[`onBlur`,`onClick`,`onPress`,`onKeyDown`,`refKey`,`ref`],aF=[`item`,`index`,`onMouseMove`,`onClick`,`onMouseDown`,`onPress`,`refKey`,`disabled`,`ref`];oF.stateChangeTypes=eF;function oF(e){e===void 0&&(e={}),KN(e,oF,AP);var t=SN({},pP,e),n=t.items,r=t.isItemDisabled,i=t.scrollIntoView,a=t.environment,o=t.getA11yStatusMessage,s=iP(tF,t,SP,OP),c=s[0],l=s[1],u=c.isOpen,d=c.highlightedIndex,f=c.selectedItem,p=c.inputValue,m=(0,G.useRef)(null),h=(0,G.useRef)(null),g=(0,G.useRef)({}),_=(0,G.useRef)(null),v=gP(t),y=LN(c);dP(o,c,[u,d,f,p],a);var b=DP(i,d,u,h,g,v.getItemId);(0,G.useEffect)(function(){return _.current=BN(function(e){e({type:QP,inputValue:``})},500),function(){var e;(e=_.current)==null||e.cancel()}},[]),(0,G.useEffect)(function(){p&&(_.current==null||_.current(l))},[l,p]),wP({props:t,state:c}),(0,G.useEffect)(function(){lP(t.isOpen,t.initialIsOpen,t.defaultIsOpen,mP.isOpen)&&m.current&&m.current.focus()},[]);var x=TP(a,(0,G.useCallback)(function(){y.current.isOpen&&l({type:UP})},[l,y]),(0,G.useMemo)(function(){return[h,m]},[])),S=EP(`getMenuProps`,`getToggleButtonProps`);(0,G.useEffect)(function(){u||(g.current={})},[u]);var C=(0,G.useMemo)(function(){return{ArrowDown:function(e){e.preventDefault(),l({type:NP,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),l({type:PP,altKey:e.altKey})},Home:function(e){e.preventDefault(),l({type:LP})},End:function(e){e.preventDefault(),l({type:RP})},Escape:function(){y.current.isOpen&&l({type:IP})},Enter:function(e){e.preventDefault(),l({type:y.current.isOpen?zP:MP})},PageUp:function(e){y.current.isOpen&&(e.preventDefault(),l({type:VP}))},PageDown:function(e){y.current.isOpen&&(e.preventDefault(),l({type:HP}))}," ":function(e){e.preventDefault();var t=y.current;t.isOpen?t.inputValue?l({type:FP,key:` `}):l({type:BP}):l({type:MP})}}},[l,y]),w=(0,G.useCallback)(function(e){var t=e??{},n=t.onClick,r=xN(t,nF);return SN({id:v.labelId,htmlFor:v.toggleButtonId,onClick:zN(n,function(){var e;(e=m.current)==null||e.focus()})},r)},[v]),T=(0,G.useCallback)(function(e,t){var n,r=e??{},i=r.onMouseLeave,a=r.refKey,o=a===void 0?`ref`:a,s=r.ref,c=r[`aria-label`],u=xN(r,rF),d=(t??{}).suppressRefError;return S(`getMenuProps`,d!==void 0&&d,o,h),SN((n={},n[o]=RN(s,function(e){h.current=e}),n.id=v.menuId,n.role=`listbox`,n[`aria-label`]=c,n[`aria-labelledby`]=c?void 0:``+v.labelId,n.onMouseLeave=zN(i,function(){l({type:WP})}),n),u)},[l,S,v]),E=(0,G.useCallback)(function(e,t){var n,r=e??{},i=r.onBlur,a=r.onClick;r.onPress;var o=r.onKeyDown,s=r.refKey,c=s===void 0?`ref`:s,f=r.ref,p=xN(r,iF),h=(t??{}).suppressRefError,g=h!==void 0&&h,_=function(){l({type:MP})},b=function(){y.current.isOpen&&!x.current.isMouseDown&&l({type:UP})},w=function(e){var t=YN(e);t&&t in C?C[t](e):/^\S{1}$/.test(t)&&l({type:FP,key:t})},T=SN((n={},n[c]=RN(f,function(e){m.current=e}),n[`aria-activedescendant`]=u&&d>-1?v.getItemId(d):``,n[`aria-controls`]=v.menuId,n[`aria-expanded`]=u,n[`aria-haspopup`]=`listbox`,n[`aria-labelledby`]=p[`aria-label`]?void 0:``+v.labelId,n.id=v.toggleButtonId,n.role=`combobox`,n.tabIndex=0,n.onBlur=zN(i,b),n),p);return p.disabled||Object.assign(T,{onClick:zN(a,_),onKeyDown:zN(o,w)}),S(`getToggleButtonProps`,g,c,m),T},[l,v,u,d,x,S,C,y]),D=(0,G.useCallback)(function(e){var t,i=e??{},a=i.item,o=i.index,s=i.onMouseMove,c=i.onClick,u=i.onMouseDown;i.onPress;var d=i.refKey,p=d===void 0?`ref`:d,m=i.disabled,h=i.ref,_=xN(i,aF);m!==void 0&&console.warn(`Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.`);var S=aP(a,o,n,`Pass either item or index to getItemProps!`),C=S[0],w=S[1],T=r(C,w),E=function(){x.current.isTouchEnd||w===y.current.highlightedIndex||(b(),l({type:GP,index:w,disabled:T}))},D=function(){l({type:KP,index:w})},O=SN((t={},t[p]=RN(h,function(e){e&&(g.current[v.getItemId(w)]=e)}),t[`aria-disabled`]=T,t[`aria-selected`]=C===f,t.id=v.getItemId(w),t.role=`option`,t.onMouseMove=zN(s,E),t.onMouseDown=zN(u,function(e){return e.preventDefault()}),t),_);return T||Object.assign(O,{onClick:zN(c,D)}),O},[n,r,f,v,x,b,l,y]),O=(0,G.useCallback)(function(){l({type:qP})},[l]),k=(0,G.useCallback)(function(){l({type:YP})},[l]);return{getToggleButtonProps:E,getLabelProps:w,getMenuProps:T,getItemProps:D,toggleMenu:O,openMenu:(0,G.useCallback)(function(){l({type:JP})},[l]),closeMenu:k,setHighlightedIndex:(0,G.useCallback)(function(e){l({type:XP,highlightedIndex:e})},[l]),selectItem:(0,G.useCallback)(function(e){l({type:ZP,selectedItem:e})},[l]),reset:(0,G.useCallback)(function(){l({type:$P})},[l]),setInputValue:(0,G.useCallback)(function(e){l({type:QP,inputValue:e})},[l]),highlightedIndex:d,isOpen:u,selectedItem:f,inputValue:p}}function sF(e){var t=SP(e),n=t.selectedItem,r=t.inputValue;return r===``&&n&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(r=e.itemToString(n)),SN({},t,{inputValue:r})}var cF=0,lF=1,uF=2,dF=3,fF=4,pF=5,mF=6,hF=7,gF=8,_F=9,vF=10,yF=11,bF=12,xF=13,SF=14,CF=15,wF=16,TF=17,EF=18,DF=19,OF=20,kF=21,AF=22,jF=Object.freeze({__proto__:null,ControlledPropUpdatedSelectedItem:AF,FunctionCloseMenu:TF,FunctionOpenMenu:wF,FunctionReset:kF,FunctionSelectItem:DF,FunctionSetHighlightedIndex:EF,FunctionSetInputValue:OF,FunctionToggleMenu:CF,InputBlur:_F,InputChange:gF,InputClick:vF,InputKeyDownArrowDown:cF,InputKeyDownArrowUp:lF,InputKeyDownEnd:fF,InputKeyDownEnter:hF,InputKeyDownEscape:uF,InputKeyDownHome:dF,InputKeyDownPageDown:mF,InputKeyDownPageUp:pF,ItemClick:xF,ItemMouseMove:bF,MenuMouseLeave:yF,ToggleButtonClick:SF});function MF(e,t,n,r){var i=(0,G.useRef)(null),a=rP(e,t,n,r),o=a[0],s=a[1],c=oP();return(0,G.useEffect)(function(){t.selectedItem!==void 0&&(c||t.itemToKey(t.selectedItem)!==t.itemToKey(i.current)&&s({type:AF,inputValue:t.itemToString(t.selectedItem)}),i.current=o.selectedItem===i.current?t.selectedItem:o.selectedItem)},[o.selectedItem,t.selectedItem]),[qN(o,t),s]}var NF=SN({},fP,{items:$.default.array.isRequired,isItemDisabled:$.default.func,inputValue:$.default.string,defaultInputValue:$.default.string,initialInputValue:$.default.string,inputId:$.default.string,onInputValueChange:$.default.func});function PF(e,t){var n=t.type,r=t.props,i;switch(n){case xF:i={isOpen:cP(r.defaultIsOpen,mP.isOpen),highlightedIndex:yP(r.items,r.isItemDisabled,r.defaultHighlightedIndex),selectedItem:r.items[t.index],inputValue:r.itemToString(r.items[t.index])};break;case cF:i=e.isOpen?{highlightedIndex:ZN(e.highlightedIndex,1,r.items,r.isItemDisabled,!0)}:{highlightedIndex:t.altKey&&e.selectedItem==null?-1:xP(r.items,r.initialHighlightedIndex,r.defaultHighlightedIndex,r.isItemDisabled,r.itemToKey,e.selectedItem,e.highlightedIndex,1),isOpen:r.items.length>=0};break;case lF:i=e.isOpen?t.altKey?bP(r.items,r.itemToString,r.defaultIsOpen,r.defaultHighlightedIndex,e.highlightedIndex,!0):{highlightedIndex:ZN(e.highlightedIndex,-1,r.items,r.isItemDisabled,!0)}:{highlightedIndex:xP(r.items,r.initialHighlightedIndex,r.defaultHighlightedIndex,r.isItemDisabled,r.itemToKey,e.selectedItem,e.highlightedIndex,-1),isOpen:r.items.length>=0};break;case hF:i=bP(r.items,r.itemToString,r.defaultIsOpen,r.defaultHighlightedIndex,e.highlightedIndex,!0);break;case uF:i=SN({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:``});break;case pF:i={highlightedIndex:ZN(e.highlightedIndex,-10,r.items,r.isItemDisabled,!0)};break;case mF:i={highlightedIndex:ZN(e.highlightedIndex,10,r.items,r.isItemDisabled,!0)};break;case dF:i={highlightedIndex:XN(0,!1,r.items,r.isItemDisabled)};break;case fF:i={highlightedIndex:XN(r.items.length-1,!0,r.items,r.isItemDisabled)};break;case _F:i=SN({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&r.items.length&&t.selectItem&&{selectedItem:r.items[e.highlightedIndex],inputValue:r.itemToString(r.items[e.highlightedIndex])});break;case gF:i={isOpen:!0,highlightedIndex:yP(r.items,r.isItemDisabled,r.defaultHighlightedIndex),inputValue:t.inputValue};break;case vF:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:xP(r.items,r.initialHighlightedIndex,r.defaultHighlightedIndex,r.isItemDisabled,r.itemToKey,e.selectedItem,e.highlightedIndex,0)};break;case DF:i={selectedItem:t.selectedItem,inputValue:r.itemToString(t.selectedItem)};break;case AF:i={inputValue:t.inputValue};break;default:return kP(e,r,t,jF)}return SN({},e,i)}var FF=[`onMouseLeave`,`refKey`,`ref`,`aria-label`],IF=[`item`,`index`,`refKey`,`ref`,`onMouseMove`,`onMouseDown`,`onClick`,`onPress`,`disabled`],LF=[`onClick`,`onPress`,`refKey`,`ref`],RF=[`aria-label`,`onKeyDown`,`onChange`,`onInput`,`onBlur`,`onChangeText`,`onClick`,`refKey`,`ref`];zF.stateChangeTypes=jF;function zF(e){e===void 0&&(e={}),KN(e,zF,NF);var t=SN({},pP,e),n=t.items,r=t.isItemDisabled,i=t.scrollIntoView,a=t.environment,o=t.getA11yStatusMessage,s=MF(PF,t,sF,OP),c=s[0],l=s[1],u=c.isOpen,d=c.highlightedIndex,f=c.selectedItem,p=c.inputValue,m=(0,G.useRef)(null),h=(0,G.useRef)({}),g=(0,G.useRef)(null),_=(0,G.useRef)(null),v=oP(),y=gP(t),b=(0,G.useRef)(),x=LN(c);dP(o,c,[u,d,f,p],a);var S=DP(i,d,u,m,h,y.getItemId);wP({state:c,props:t}),(0,G.useEffect)(function(){lP(t.isOpen,t.initialIsOpen,t.defaultIsOpen,mP.isOpen)&&g.current&&g.current.focus()},[]),(0,G.useEffect)(function(){v||(b.current=n.length)});var C=TP(a,(0,G.useCallback)(function(){x.current.isOpen&&l({type:_F})},[l,x]),(0,G.useMemo)(function(){return[m,_,g]},[])),w=EP(`getInputProps`,`getMenuProps`);(0,G.useEffect)(function(){u||(h.current={})},[u]),(0,G.useEffect)(function(){var e;u&&a!=null&&a.document&&(e=g.current)!=null&&e.focus&&a.document.activeElement!==g.current&&g.current.focus()},[u,a]);var T=(0,G.useMemo)(function(){return{ArrowDown:function(e){e.preventDefault(),l({type:cF,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),l({type:lF,altKey:e.altKey})},Home:function(e){x.current.isOpen&&(e.preventDefault(),l({type:dF}))},End:function(e){x.current.isOpen&&(e.preventDefault(),l({type:fF}))},Escape:function(e){var t=x.current;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),l({type:uF}))},Enter:function(e){x.current.isOpen&&e.which!==229&&(e.preventDefault(),l({type:hF}))},PageUp:function(e){x.current.isOpen&&(e.preventDefault(),l({type:pF}))},PageDown:function(e){x.current.isOpen&&(e.preventDefault(),l({type:mF}))}}},[l,x]),E=(0,G.useCallback)(function(e){return SN({id:y.labelId,htmlFor:y.inputId},e)},[y]),D=(0,G.useCallback)(function(e,t){var n,r=e??{},i=r.onMouseLeave,a=r.refKey,o=a===void 0?`ref`:a,s=r.ref,c=r[`aria-label`],u=xN(r,FF),d=(t??{}).suppressRefError;return w(`getMenuProps`,d!==void 0&&d,o,m),SN((n={},n[o]=RN(s,function(e){m.current=e}),n.id=y.menuId,n.role=`listbox`,n[`aria-label`]=c,n[`aria-labelledby`]=c?void 0:``+y.labelId,n.onMouseLeave=zN(i,function(){l({type:yF})}),n),u)},[l,w,y]),O=(0,G.useCallback)(function(e){var t,i,a=e??{},o=a.item,s=a.index,c=a.refKey,u=c===void 0?`ref`:c,f=a.ref,p=a.onMouseMove,m=a.onMouseDown,g=a.onClick;a.onPress;var _=a.disabled,v=xN(a,IF);_!==void 0&&console.warn(`Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.`);var b=aP(o,s,n,`Pass either item or index to getItemProps!`),w=b[0],T=b[1],E=r(w,T),D=`onClick`,O=g;return SN((t={},t[u]=RN(f,function(e){e&&(h.current[y.getItemId(T)]=e)}),t[`aria-disabled`]=E,t[`aria-selected`]=T===d,t.id=y.getItemId(T),t.role=`option`,t),!E&&(i={},i[D]=zN(O,function(){l({type:xF,index:T})}),i),{onMouseMove:zN(p,function(){C.current.isTouchEnd||T===x.current.highlightedIndex||(S(),l({type:bF,index:T,disabled:E}))}),onMouseDown:zN(m,function(e){return e.preventDefault()})},v)},[l,y,n,r,d,C,S,x]),k=(0,G.useCallback)(function(e){var t,n=e??{},r=n.onClick;n.onPress;var i=n.refKey,a=i===void 0?`ref`:i,o=n.ref,s=xN(n,LF);return SN((t={},t[a]=RN(o,function(e){_.current=e}),t[`aria-controls`]=y.menuId,t[`aria-expanded`]=u,t.id=y.toggleButtonId,t.tabIndex=-1,t),!s.disabled&&SN({},{onClick:zN(r,function(){l({type:SF})})}),s)},[l,u,y]),A=(0,G.useCallback)(function(e,t){var n,r=e??{},i=r[`aria-label`],o=r.onKeyDown,s=r.onChange,c=r.onInput,f=r.onBlur;r.onChangeText;var m=r.onClick,h=r.refKey,_=h===void 0?`ref`:h,v=r.ref,b=xN(r,RF),S=(t??{}).suppressRefError;w(`getInputProps`,S!==void 0&&S,_,g);var E=function(e){var t=YN(e);t&&t in T&&T[t](e)},D=function(e){l({type:gF,inputValue:e.target.value})},O=function(e){a!=null&&a.document&&x.current.isOpen&&!C.current.isMouseDown&&l({type:_F,selectItem:e.relatedTarget!==null||a.document.activeElement===a.document.body})},k=function(){l({type:vF})},A=`onChange`,j={};if(!b.disabled){var M;j=(M={},M[A]=zN(s,c,D),M.onKeyDown=zN(o,E),M.onBlur=zN(f,O),M.onClick=zN(m,k),M)}return SN((n={},n[_]=RN(v,function(e){g.current=e}),n[`aria-activedescendant`]=u&&d>-1?y.getItemId(d):``,n[`aria-autocomplete`]=`list`,n[`aria-controls`]=y.menuId,n[`aria-expanded`]=u,n[`aria-labelledby`]=i?void 0:y.labelId,n[`aria-label`]=i,n.autoComplete=`off`,n.id=y.inputId,n.role=`combobox`,n.value=p,n),j,b)},[l,y,a,T,u,d,p,C,w,x]),j=(0,G.useCallback)(function(){l({type:CF})},[l]),M=(0,G.useCallback)(function(){l({type:TF})},[l]),N=(0,G.useCallback)(function(){l({type:wF})},[l]),P=(0,G.useCallback)(function(e){l({type:EF,highlightedIndex:e})},[l]),ee=(0,G.useCallback)(function(e){l({type:DF,selectedItem:e})},[l]);return{getItemProps:O,getLabelProps:E,getMenuProps:D,getInputProps:A,getToggleButtonProps:k,toggleMenu:j,openMenu:N,closeMenu:M,setHighlightedIndex:P,setInputValue:(0,G.useCallback)(function(e){l({type:OF,inputValue:e})},[l]),selectItem:ee,reset:(0,G.useCallback)(function(){l({type:kF})},[l]),highlightedIndex:d,isOpen:u,selectedItem:f,inputValue:p}}var BF={activeIndex:-1,selectedItems:[]};function VF(e){return{activeIndex:lP(e.activeIndex,e.initialActiveIndex,e.defaultActiveIndex,BF.activeIndex),selectedItems:lP(e.selectedItems,e.initialSelectedItems,e.defaultSelectedItems,BF.selectedItems)}}function HF(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&t.value!==``&&(t.selectionStart!==0||t.selectionEnd!==0))}function UF(e,t){return e.selectedItems===t.selectedItems&&e.activeIndex===t.activeIndex}fP.stateReducer,fP.itemToKey,fP.environment,$.default.array,$.default.array,$.default.array,$.default.func,$.default.number,$.default.number,$.default.number,$.default.func,$.default.func,$.default.string,$.default.string;var WF={itemToKey:pP.itemToKey,stateReducer:pP.stateReducer,environment:pP.environment,keyNavigationNext:`ArrowRight`,keyNavigationPrevious:`ArrowLeft`},GF=GN,KF=0,qF=1,JF=2,YF=3,XF=4,ZF=5,QF=6,$F=7,eI=8,tI=9,nI=10,rI=11,iI=12,aI=Object.freeze({__proto__:null,DropdownClick:$F,DropdownKeyDownBackspace:QF,DropdownKeyDownNavigationPrevious:ZF,FunctionAddSelectedItem:eI,FunctionRemoveSelectedItem:tI,FunctionReset:iI,FunctionSetActiveIndex:rI,FunctionSetSelectedItems:nI,SelectedItemClick:KF,SelectedItemKeyDownBackspace:JF,SelectedItemKeyDownDelete:qF,SelectedItemKeyDownNavigationNext:YF,SelectedItemKeyDownNavigationPrevious:XF});function oI(e,t){var n=t.type,r=t.index,i=t.selectedItem,a=t.props,o=e.activeIndex,s=e.selectedItems,c;switch(n){case KF:c={activeIndex:r};break;case XF:c={activeIndex:o-1<0?0:o-1};break;case YF:c={activeIndex:o+1>=s.length?-1:o+1};break;case JF:case qF:if(o<0)break;var l=o;s.length===1?l=-1:o===s.length-1&&(l=s.length-2),c=SN({selectedItems:[].concat(s.slice(0,o),s.slice(o+1))},{activeIndex:l});break;case ZF:c={activeIndex:s.length-1};break;case QF:c={selectedItems:s.slice(0,s.length-1)};break;case eI:c={selectedItems:[].concat(s,[i])};break;case $F:c={activeIndex:-1};break;case tI:var u=o,d=s.findIndex(function(e){return a.itemToKey(e)===a.itemToKey(i)});if(d<0)break;s.length===1?u=-1:d===s.length-1&&(u=s.length-2),c={selectedItems:[].concat(s.slice(0,d),s.slice(d+1)),activeIndex:u};break;case nI:c={selectedItems:t.selectedItems};break;case rI:c={activeIndex:t.activeIndex};break;case iI:c={activeIndex:cP(a.defaultActiveIndex,BF.activeIndex),selectedItems:cP(a.defaultSelectedItems,BF.selectedItems)};break;default:throw Error(`Reducer called without proper action type.`)}return SN({},e,c)}var sI=[`refKey`,`ref`,`onClick`,`onKeyDown`,`selectedItem`,`index`],cI=[`refKey`,`ref`,`onKeyDown`,`onClick`,`preventKeyAction`];lI.stateChangeTypes=aI;function lI(e){e===void 0&&(e={}),GF(e,lI);var t=SN({},WF,e),n=t.getA11yStatusMessage,r=t.environment,i=t.keyNavigationNext,a=t.keyNavigationPrevious,o=iP(oI,t,VF,UF),s=o[0],c=o[1],l=s.activeIndex,u=s.selectedItems,d=oP(),f=(0,G.useRef)(null),p=(0,G.useRef)(null);p.current===null&&(p.current=new Map),dP(n,s,[l,u],r),(0,G.useEffect)(function(){if(!d){if(l===-1&&f.current)f.current.focus();else{var e;(e=p.current.get(l))==null||e.focus()}}},[l]),wP({props:t,state:s});var m=EP(`getDropdownProps`),h=(0,G.useMemo)(function(){var e={};return e[a]=function(){c({type:XF})},e[i]=function(){c({type:YF})},e.Delete=function(){c({type:qF})},e.Backspace=function(){c({type:JF})},e},[c,i,a]),g=(0,G.useMemo)(function(){var e={};return e[a]=function(e){HF(e)&&c({type:ZF})},e.Backspace=function(e){HF(e)&&c({type:QF})},e},[c,a]);return{getSelectedItemProps:(0,G.useCallback)(function(e){var t,n=e===void 0?{}:e,r=n.refKey,i=r===void 0?`ref`:r,a=n.ref,o=n.onClick,s=n.onKeyDown,d=n.selectedItem,f=n.index,m=xN(n,sI),g=aP(d,f,u,`Pass either item or index to getSelectedItemProps!`)[1],_=g>-1&&g===l;return SN((t={},t[i]=RN(a,function(e){e?p.current.set(g,e):p.current.delete(g)}),t.tabIndex=_?0:-1,t.onClick=zN(o,function(){c({type:KF,index:g})}),t.onKeyDown=zN(s,function(e){var t=YN(e);t&&h[t]&&h[t](e)}),t),m)},[c,u,l,h]),getDropdownProps:(0,G.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.refKey,a=i===void 0?`ref`:i,o=r.ref,s=r.onKeyDown,l=r.onClick,u=r.preventKeyAction,d=u!==void 0&&u,p=xN(r,cI),h=(t===void 0?{}:t).suppressRefError;return m(`getDropdownProps`,h!==void 0&&h,a,f),SN((n={},n[a]=RN(o,function(e){e&&(f.current=e)}),n),!d&&{onKeyDown:zN(s,function(e){var t=YN(e);t&&g[t]&&g[t](e)}),onClick:zN(l,function(){c({type:$F})})},p)},[c,g,m]),addSelectedItem:(0,G.useCallback)(function(e){c({type:eI,selectedItem:e})},[c]),removeSelectedItem:(0,G.useCallback)(function(e){c({type:tI,selectedItem:e})},[c]),setSelectedItems:(0,G.useCallback)(function(e){c({type:nI,selectedItems:e})},[c]),setActiveIndex:(0,G.useCallback)(function(e){c({type:rI,activeIndex:e})},[c]),reset:(0,G.useCallback)(function(){c({type:iI})},[c]),selectedItems:u,activeIndex:l}}var uI=0,dI=1,fI=2,pI=3,mI=4,hI=5,gI=6,_I=Object.freeze({__proto__:null,FunctionAddItem:gI,TagClick:uI,TagGroupKeyDownArrowLeft:dI,TagGroupKeyDownArrowRight:fI,TagGroupKeyDownBackspace:mI,TagGroupKeyDownDelete:pI,TagRemoveClick:hI});function vI(e,t){var n=t.type,r;switch(n){case uI:r={activeIndex:t.index};break;case dI:r={activeIndex:e.activeIndex===0?e.items.length-1:e.activeIndex-1};break;case fI:r={activeIndex:e.activeIndex===e.items.length-1?0:e.activeIndex+1};break;case mI:case pI:var i=[].concat(e.items.slice(0,e.activeIndex),e.items.slice(e.activeIndex+1)),a=i.length===0?-1:i.length===e.activeIndex?e.activeIndex-1:e.activeIndex;r={items:[].concat(e.items.slice(0,e.activeIndex),e.items.slice(e.activeIndex+1)),activeIndex:a};break;case hI:var o=[].concat(e.items.slice(0,t.index),e.items.slice(t.index+1));r={items:o,activeIndex:o.length===0?-1:o.length===t.index?t.index-1:t.index};break;case gI:var s=[];s=t.index===void 0?[].concat(e.items,[t.item]):[].concat(e.items.slice(0,t.index),[t.item],e.items.slice(t.index));var c=e.activeIndex===-1?s.length-1:e.activeIndex;r={items:s,activeIndex:c};break;default:throw Error(`Invalid useTagGroup reducer action.`)}return SN({},e,r)}var yI=SN({},G).useId,bI=typeof yI==`function`?xI:SI;function xI(e){var t=e.id,n=e.tagGroupId,r=e.getTagId,i=`downshift-`+yI();return t||=i,G.useMemo(function(){return{tagGroupId:n??t+`-tag-group`,getTagId:r??function(e){return t+`-tag-`+e}}},[r,t,n])}function SI(e){var t=e.id,n=e.getTagId,r=e.tagGroupId,i=G.useState(function(){return t??`downshift-`+FN()})[0];return G.useMemo(function(){return{tagGroupId:r??i+`-tag-group`,getTagId:n??function(e){return i+`-tag-`+e}}},[n,i,r])}function CI(e){var t=e.items??e.initialItems??[];return{activeIndex:e.activeIndex??e.initialActiveIndex??(t.length===0?-1:0),items:t}}function wI(e,t){return e.activeIndex===t.activeIndex&&e.items===t.items}var TI=`tag-group-a11y-description`;function EI(e,t){G.useEffect(function(){if(e){var n=e.createElement(`div`);return n.setAttribute(`id`,TI),n.style.display=`none`,n.textContent=t,e.body.appendChild(n),function(){n.remove()}}},[t,e])}function DI(e){return SN({stateReducer:function(e,t){return t.changes},environment:typeof window>`u`?void 0:window,removeElementDescription:`Press Delete or Backspace to remove tag.`},e)}function OI(e,t,n){var r=G.useRef({}),i=G.useRef(e),a=G.useRef(t);return G.useEffect(function(){if(e!==-1&&i.current!==-1&&e!==i.current||a.current===t+1){var o;(o=r.current[n(e)])==null||o.focus()}i.current=e,a.current=t},[e,n,t]),r}var kI={isItemDisabled:$.default.func},AI=[`onKeyDown`],jI=[`index`,`refKey`,`ref`,`onClick`],MI=[`index`,`onClick`],NI=function(e){e===void 0&&(e={}),KN(e,NI,kI);var t=DI(e),n=iP(vI,t,CI,wI),r=n[0],i=n[1],a=r.activeIndex,o=r.items,s=bI({getTagId:t.getTagId,id:t.id,tagGroupId:t.tagGroupId});EI(t.environment?.document,t.removeElementDescription);var c=OI(a,o.length,s.getTagId),l=(0,G.useCallback)(function(e){var t=e??{},n=t.onKeyDown,r=xN(t,AI);return SN({id:s.tagGroupId,"aria-live":`polite`,"aria-atomic":`false`,"aria-relevant":`additions`,role:`listbox`,onKeyDown:zN(n,function(e){switch(e.key){case`ArrowLeft`:i({type:dI});break;case`ArrowRight`:i({type:fI});break;case`Delete`:i({type:pI});break;case`Backspace`:i({type:mI})}})},r)},[i,s.tagGroupId]),u=(0,G.useCallback)(function(e){var t,n=e.index,r=e.refKey,o=r===void 0?`ref`:r,l=e.ref,u=e.onClick,d=xN(e,jI);if(!Number.isInteger(n)||n<0)throw Error(`Pass correct item index to getTagProps!`);var f=function(){i({type:uI,index:n})},p=s.getTagId(n);return SN((t={"aria-describedby":TI},t[o]=RN(l,function(e){e&&(c.current[p]=e)}),t[`aria-labelledby`]=p,t.role=`option`,t.id=p,t.onClick=zN(u,f),t.tabIndex=a===n?0:-1,t),d)},[i,s,a,c]),d=(0,G.useCallback)(function(e){var t=e.index,n=e.onClick,r=xN(e,MI);if(!Number.isInteger(t)||t<0)throw Error(`Pass correct item index to getTagRemoveProps!`);var a=function(e){e.stopPropagation(),i({type:hI,index:t})},o=s.getTagId(t),c=o+`-remove`;return SN({id:c,tabIndex:-1,"aria-labelledby":c+` `+o,onClick:zN(n,a)},r)},[s,i]);return{activeIndex:a,addItem:(0,G.useCallback)(function(e,t){i({type:gI,item:e,index:t})},[i]),getTagGroupProps:l,getTagProps:u,getTagRemoveProps:d,items:o}};NI.stateChangeTypes=_I;function PI({items:e,selectedItems:t,onInputChange:n,onSelectedItemsChange:r,fieldLabel:i,placeholder:a,icon:o,disabled:s,shadowRoot:c,dataTestId:l}){let[u,d]=(0,G.useState)(``),f=(0,G.useId)(),p=(0,G.useId)(),m=(0,G.useId)(),h=(0,G.useId)(),g=(0,G.useId)(),_=(0,G.useMemo)(()=>e.filter(e=>e.type===`airport`||e.type===`place`).reduce((e,t)=>{if(t.type===`airport`){let n=t,r=u.toLowerCase();if(n.iata_code.toLowerCase()===r||n.iata_display_list?.some(e=>e.toLowerCase()===r))return t.sectionIndex>=0?[...e,t]:[{...t,sectionIndex:-1},...e]}return[...e,t]},[]).reduce((e,t)=>t.type===`airport`?{items:[...e.items,t],airportCount:e.airportCount+1}:t.type===`place`?e.airportCount<20?{...e,items:[...e.items,t]}:e:e.airportCount<=20?{...e,items:[...e.items,t]}:e,{items:[],airportCount:0}).items,[u,e]);function v(e){return e.kayak?.stateCode&&e.kayak?.countryCode?`${e.name}, ${e.kayak.stateCode}, ${e.kayak.countryCode}`:e.kayak?.countryCode&&!e.kayak?.stateCode?`${e.name}, ${e.kayak.countryCode}`:e.formatted_address}function y(e){return e.state_code?`${e.city}, ${e.state_code}, ${e.country_code}`:e.location_display?e.location_display:`${e.city}, ${e.country_code}`}function b(e){return e.iata_display_list&&e.iata_display_list.length>0?e.iata_display_list.join(`, `):e.iata_code}function x(e){if(e.type===`airport`){let n=e;return t?.length>1?b(n):n.country_code===`US`?`${n.city} (${b(n)})`:`${n.city}, ${n.country_code} (${b(n)})`}if(e.type===`place`){let t=e;return t.formatted_address?.length<20?t.formatted_address:t.name}return``}let S=typeof Proxy==`function`&&!Object.isSealed(new Proxy({},{}));function C(e){let t=e.ownerDocument,n={document:t,addEventListener:t.addEventListener.bind(e),removeEventListener:t.removeEventListener.bind(e),Node:window.Node,Element:window.Element,HTMLElement:window.HTMLElement,SVGElement:window.SVGElement};return S?new Proxy(n,{get(e,t){return e[t]}}):n}let{getSelectedItemProps:w,getDropdownProps:T,removeSelectedItem:E}=lI({selectedItems:t,onStateChange({selectedItems:e,type:t}){t===lI.stateChangeTypes.FunctionRemoveSelectedItem&&r(e)}}),{isOpen:D,getMenuProps:O,getInputProps:k,getItemProps:A,highlightedIndex:j,setHighlightedIndex:M}=zF({environment:c?C(c):void 0,items:_,isItemDisabled(e){return!!e?.disabled},itemToKey(e){return e?.key??``},itemToString(e){return e?e.type===`airport`?x(e):e.name??``:``},defaultHighlightedIndex:0,selectedItem:null,inputValue:u,onInputValueChange({inputValue:e}){let t=e??``;d(t),n(t)},stateReducer(e,t){let{changes:n,type:r}=t;switch(r){case zF.stateChangeTypes.InputKeyDownEnter:case zF.stateChangeTypes.ItemClick:return n;case zF.stateChangeTypes.InputKeyDownArrowDown:case zF.stateChangeTypes.InputKeyDownArrowUp:return n;case zF.stateChangeTypes.InputBlur:return n;case zF.stateChangeTypes.FunctionCloseMenu:return{...n,isOpen:!0};case zF.stateChangeTypes.InputKeyDownEscape:return n;case zF.stateChangeTypes.ItemMouseMove:return e;default:return n}},onStateChange({type:e,selectedItem:t}){switch(e){case zF.stateChangeTypes.InputKeyDownEnter:case zF.stateChangeTypes.ItemClick:t&&(r([t]),d(``))}}}),N=(0,G.useMemo)(()=>{if(s)return`Field is locked.`;if(D&&_.length>0){let e=_.length;return`Suggestion list open, ${e} ${e===1?`option`:`options`}.`}return D&&_.length===0?u.trim()?`Suggestion list open, no matching options.`:`Suggestion list open, no options yet.`:`Suggestion list closed.`},[s,D,_.length,u]),P=(0,G.useMemo)(()=>`Type to search airports and places. When the list is open, use arrow keys to move through suggestions and Enter to choose. Tab to selected locations above to remove them, or press Backspace in this field when it is empty.`,[]),ee=i?`${i}, search airports and places`:`Search airports and places`,F=i?`${i} suggestions`:`Search results`,te=t.length===0?`No airport or place selected.`:(()=>{let e=t.map(e=>x(e));return`Selected ${t.length===1?`location`:`${t.length} locations`}: ${e.join(`, `)}.`})(),ne=[m,h,g].join(` `);(0,G.useEffect)(()=>{s&&queueMicrotask(()=>d(``))},[s]);let I=!!s;function re(){let e=k({...T(),id:p,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":D,"aria-controls":D?f:void 0,"aria-activedescendant":D&&j!=null&&j>-1?`${f}-${j}`:void 0,"aria-label":ee,onKeyDown:e=>{if(e.key===`Backspace`&&!u&&t.length>0&&!s){let e=t[t.length-1];E(e)}}});return(0,K.jsx)(`input`,{className:(0,q.default)(`aone:outline-none aone:disabled:bg-transparent aone:text-base aone:placeholder:text-gray-500`,{"aone:min-w-[120px] aone:max-w-[200px]":t.length>0,"aone:w-full":t.length===0}),placeholder:!I&&t.length===0?a:``,...e,value:e.value??``,"aria-describedby":ne,disabled:I})}return(0,K.jsxs)(`div`,{className:`aone:w-full aone:h-full aone:relative aone:z-10`,"data-testid":l,role:`group`,"aria-disabled":s?!0:void 0,children:[(0,K.jsxs)(`div`,{className:(0,q.default)({"aone:bg-white aone:rounded-lg aone:gap-2 aone:items-center aone:py-2 aone:px-3 aone:h-[44px] aone:box-border aone:w-full aone:overflow-hidden":!0,"aone:grid":!0,"aone:grid-cols-[24px_1fr]":t.length===0,"aone:grid-cols-[24px_auto_1fr]":t.length===1,"aone:grid-cols-[24px_auto_auto_1fr]":t.length===2,"aone:grid-cols-[24px_auto_auto_auto_1fr]":t.length===3,"aone:border-2 aone:border-gray-200 aone:focus-within:border-primary":!0,"aone:opacity-60 aone:cursor-not-allowed":!!s}),children:[o,t.map((e,n)=>(0,K.jsxs)(`span`,{...w({selectedItem:e,index:n}),"aria-label":`Selected location: ${x(e)}. Item ${n+1} of ${t.length}.`,className:(0,q.default)({"aone:bg-gray-200 aone:rounded aone:px-1 aone:focus:bg-gray-400 aone:whitespace-nowrap aone:text-ellipsis aone:shrink-0":!0,"aone:text-sm":t.length>0,"aone:flex aone:items-center":!0}),children:[(0,K.jsx)(`span`,{className:`aone:overflow-hidden aone:grow aone:font-medium`,children:x(e)}),!e.disabled&&(0,K.jsx)(`button`,{type:`button`,disabled:!!s||!!e.disabled,className:(0,q.default)(`aone:ml-2 aone:text-base aone:leading-[20px] aone:rounded aone:px-1 aone:transition-colors`,{"aone:hover:bg-gray-300 aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-offset-2 aone:focus-visible:ring-gray-400":!s&&!e.disabled,"aone:cursor-not-allowed aone:opacity-60":!!s}),"data-testid":`autocomplete-remove-item-button`,"aria-label":`Remove ${x(e)}`,onClick:t=>{t.stopPropagation(),!s&&E(e)},children:`×`})]},n)),(0,K.jsx)(`span`,{id:m,className:`aone:sr-only`,children:te}),(0,K.jsx)(`span`,{id:h,className:`aone:sr-only`,children:N}),(0,K.jsx)(`span`,{id:g,className:`aone:sr-only`,children:P}),re()]}),(0,K.jsx)(`div`,{className:(0,q.default)(`aone:absolute aone:z-10 aone:mt-2 aone:w-inherit aone:rounded-lg aone:bg-white aone:p-0 aone:shadow-md aone:overflow-hidden`,!(D&&_.length>0)&&`aone:hidden`),children:(0,K.jsx)(`ul`,{...O(),id:f,role:`listbox`,"aria-multiselectable":`true`,"aria-label":F,tabIndex:-1,className:`aone:overflow-y-auto aone:overflow-x-hidden aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2`,children:D&&_.length>0&&_.map((e,n)=>{if(e.type===`airport`){let r=e,i=(r.distance||0)*.621371,a=j===n,o=e.sectionIndex>-1&&!r.kayak_shimmed,s=!!t.find(t=>t.key===e.key),c=n+1;return(0,K.jsxs)(`li`,{...A({item:e,index:n,onMouseEnter:()=>M(n)}),id:`${f}-${n}`,role:`option`,tabIndex:-1,"aria-selected":s,"aria-label":`Option ${c} - ${r.name}, ${y(r)}, ${b(r)}${o?`, ${i.toFixed(+(i<1))} miles away`:``}, ${s?`selected`:`not selected`}`,className:(0,q.default)({"aone:hover:bg-blue-100":!0,"aone:bg-blue-100":a,"aone:font-bold":a,"aone:shadow-sm aone:py-2 aone:px-2 aone:cursor-pointer":!0,"aone:pl-5 aone:border-l-4 aone:border-gray-500":e.sectionIndex>-1,"aone:grid aone:grid-cols-[26px_1fr_30px] aone:gap-1 aone:justify-start aone:items-center":!0,"aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2":!0}),children:[(0,K.jsx)(iN,{className:`aone:w-6 aone:h-6 aone:-rotate-45`,icon:XE}),(0,K.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,K.jsxs)(`div`,{className:`aone:gap-2 aone:flex aone:items-center aone:w-full`,children:[(0,K.jsx)(`span`,{className:`aone:flex-1 aone:min-w-0 aone:font-medium aone:text-base aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:r.name}),(0,K.jsx)(`span`,{className:`aone:text-sm aone:uppercase aone:shrink-0 aone:text-gray-500`,children:b(r)})]}),(0,K.jsxs)(`span`,{className:`aone:text-sm aone:text-gray-500`,children:[y(r),o&&(0,K.jsxs)(K.Fragment,{children:[`\xA0•\xA0`,i.toFixed(+(i<1)),`mi`]})]})]}),(0,K.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-1`,"aria-hidden":`true`,children:(0,K.jsx)(`span`,{className:(0,q.default)(`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border`,{"aone:border-gray-400 aone:bg-white":!s,"aone:border-primary aone:bg-primary":s})})})]},`${e.key}-${n}`)}if(e.type===`place`){let r=e,i=j===n,a=_p(r.kayak?.apicode),o=v(r),s=!!t.find(t=>t.key===e.key);return(0,K.jsxs)(`li`,{...A({item:e,index:n,onMouseEnter:()=>M(n)}),id:`${f}-${n}`,role:`option`,tabIndex:-1,"aria-selected":s,"aria-label":`${a?`${r.name}, ${a}, ${o}`:`${r.name}, ${o}`}, ${s?`selected`:`not selected`}`,className:(0,q.default)({"aone:hover:bg-blue-100":!0,"aone:bg-blue-100":i,"aone:font-bold":i,"aone:shadow-sm aone:py-2 aone:px-2 aone:cursor-pointer":!0,"aone:grid aone:grid-cols-[26px_1fr_30px] aone:gap-1 aone:justify-start aone:items-center":!0,"aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2":!0}),children:[(0,K.jsx)(iN,{className:`aone:w-6 aone:h-6`,icon:rD}),(0,K.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,K.jsxs)(`div`,{className:`aone:gap-2 aone:flex aone:items-end aone:w-full`,children:[(0,K.jsx)(`span`,{className:`aone:flex-1 aone:min-w-0 aone:font-medium aone:text-base aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:r.name}),a&&(0,K.jsx)(`span`,{className:`aone:text-sm aone:uppercase aone:shrink-0 aone:text-gray-500`,children:a})]}),(0,K.jsx)(`span`,{className:`aone:text-sm aone:shrink-0 aone:text-gray-500`,children:o})]}),(0,K.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-1`,"aria-hidden":`true`,children:(0,K.jsx)(`span`,{className:(0,q.default)(`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border`,{"aone:border-gray-400 aone:bg-white":!s,"aone:border-primary aone:bg-primary":s})})})]},`${e.key}-${n}`)}return null})})})]})}function FI({hideByDefault:e=!0}){return(0,K.jsx)(`div`,{className:(0,q.default)({"aone:pb-0.5 aone:flex-col aone:items-center aone:@2xl:items-end aone:@2xl:w-[175px]":!0,"aone:hidden aone:@2xl:flex":e,flex:!e}),children:(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`aone:text-center aone:text-[12px] aone:text-black aone:dark:text-white`,children:`Powered by`}),(0,K.jsx)(`div`,{className:`aone:flex aone:justify-center aone:max-w-[95px]`,children:(0,K.jsx)(`img`,{src:`https://content.r9cdn.net/res/images/horizon/common/promo/powered-kayak-logo.png?v=5845dc09c6b1c19380844fe6157a3b640856624b&cluster=4`,alt:`Kayak`,width:95,height:21})})]})})}var II=s(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),LI=s(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),RI=s(((e,t)=>{var n=LI(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),zI=s(((e,t)=>{var n=RI();t.exports=function(){return n.Date.now()}})),BI=s(((e,t)=>{var n=/\s/;function r(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}t.exports=r})),VI=s(((e,t)=>{var n=BI(),r=/^\s+/;function i(e){return e&&e.slice(0,n(e)+1).replace(r,``)}t.exports=i})),HI=s(((e,t)=>{t.exports=RI().Symbol})),UI=s(((e,t)=>{var n=HI(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),WI=s(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),GI=s(((e,t)=>{var n=HI(),r=UI(),i=WI(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),KI=s(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),qI=s(((e,t)=>{var n=GI(),r=KI(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),JI=s(((e,t)=>{var n=VI(),r=II(),i=qI(),a=NaN,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function u(e){if(typeof e==`number`)return e;if(i(e))return a;if(r(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=r(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=n(e);var u=s.test(e);return u||c.test(e)?l(e.slice(2),u?2:8):o.test(e)?a:+e}t.exports=u})),YI=l(s(((e,t)=>{var n=II(),r=zI(),i=JI(),a=`Expected a function`,o=Math.max,s=Math.min;function c(e,t,c){var l,u,d,f,p,m,h=0,g=!1,_=!1,v=!0;if(typeof e!=`function`)throw TypeError(a);t=i(t)||0,n(c)&&(g=!!c.leading,_=`maxWait`in c,d=_?o(i(c.maxWait)||0,t):d,v=`trailing`in c?!!c.trailing:v);function y(t){var n=l,r=u;return l=u=void 0,h=t,f=e.apply(r,n),f}function b(e){return h=e,p=setTimeout(C,t),g?y(e):f}function x(e){var n=e-m,r=e-h,i=t-n;return _?s(i,d-r):i}function S(e){var n=e-m,r=e-h;return m===void 0||n>=t||n<0||_&&r>=d}function C(){var e=r();if(S(e))return w(e);p=setTimeout(C,x(e))}function w(e){return p=void 0,v&&l?y(e):(l=u=void 0,f)}function T(){p!==void 0&&clearTimeout(p),h=0,l=m=u=p=void 0}function E(){return p===void 0?f:w(r())}function D(){var e=r(),n=S(e);if(l=arguments,u=this,m=e,n){if(p===void 0)return b(m);if(_)return clearTimeout(p),p=setTimeout(C,t),y(m)}return p===void 0&&(p=setTimeout(C,t)),f}return D.cancel=T,D.flush=E,D}t.exports=c}))(),1);function XI(e,t,n,r){return n?`${n}/v1/${e}?${r}`:`${t}/api/${e}?${r}`}async function ZI({departureAirport:e,apiDomain:t,suggestApiBaseUrl:n,sessionId:r,clickId:i}){let a=new URLSearchParams({departureAirportIATA:e}).toString(),o={};r&&(o[d_]=r),i&&(o[f_]=i);let s=await fetch(XI(`iata-auto-complete`,t,n,a),{headers:o});if(!s.ok)throw console.error(`Unable to fetch airport suggestions`,{departureAirport:e,apiDomain:t,status:s.status,statusText:s.statusText}),Error(`Unable to fetch airport suggestions`);let c=await s.json();return Id.parse(c)}async function QI(e,t,n,r,i,a){if(!t)return[];let o=await ZI({query:e,departureAirport:t,apiDomain:n,suggestApiBaseUrl:a,sessionId:r,clickId:i});return o.success?o.data.map(e=>({itemType:W.AIRPORT,iata_code:e.airportIata,city:e.city,state:e.state,country:e.country,stops:e.stops||0,airlineCodes:e.airlineCodes||[],name:e.city+` (`+e.airportIata+`)`,type:`airport`,lat:0,lng:0,country_code:e.country||``,geometry:{location:{lat:0,lng:0}},formatted_address:``,cid:e.airportIata,types:[`airport`],nearbyAirports:[{name:e.airportIata+` (`+e.city+`)`,iata_code:e.airportIata,city:e.city,country_code:e.country,stops:e.stops||0,airlineCodes:e.airlineCodes||[],routeStart:e.routeStart,lat:0,lng:0}]})).map(e=>{let t={...e,airlineCodes:e.airlineCodes?.map(e=>e===`DWI`?`DW`:e)};return t.nearbyAirports=e.nearbyAirports.map(e=>({...e,airlineCodes:e.airlineCodes?.map(e=>e===`DWI`?`DW`:e)})),t}).sort((e,t)=>!e.city||!t.city?0:e.city.localeCompare(t.city)):[]}async function $I({query:e,departureAirport:t,marketingCarrierCodeIATA:n,apiDomain:r,suggestApiBaseUrl:i,sessionId:a,clickId:o}){let s=new URLSearchParams({query:e,departureAirportIATA:t,marketingCarrierCodeIATA:n}).toString(),c={};a&&(c[d_]=a),o&&(c[f_]=o);let l=await fetch(XI(`iata-directs`,r,i,s),{headers:c});if(!l.ok)throw console.error(`Unable to fetch airport suggestions`,{departureAirport:t,apiDomain:r,status:l.status,statusText:l.statusText}),Error(`Unable to fetch airport suggestions`);let u=await l.json();return Rc.parse(u)}async function eL(e,t,n,r,i,a,o){if(!t)return[];let s=await $I({query:e,departureAirport:t,marketingCarrierCodeIATA:n,apiDomain:r,suggestApiBaseUrl:o,sessionId:i,clickId:a});return s.success?s.data.map(e=>({itemType:W.AIRPORT,iata_code:e.airportIata,city:e.city,lat:0,lng:0,country_code:e.country,name:e.airportIata+` (`+e.city+`)`,geometry:{location:{lat:0,lng:0}},formatted_address:``,cid:e.airportIata,types:[`airport`],nearbyAirports:[{name:e.airportIata+` (`+e.city+`)`,iata_code:e.airportIata,city:e.city,country_code:e.country,lat:0,lng:0}]})):[]}function tL(e){return Math.PI/180*e}function nL(e){return e*.621371}function rL(e,t,n,r){let i=tL(n-e),a=tL(r-t),o=Math.sin(i/2)*Math.sin(i/2)+Math.cos(tL(e))*Math.cos(tL(n))*Math.sin(a/2)*Math.sin(a/2);return 6371*(2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)))}function iL(e,t){if(!Array.isArray(e.types)||!e.types.includes(`place`)||e.itemType!==W.METRO)return!1;let n=gp(e.kayak?.apicode);if(n.length>0&&n.includes(t.id.toUpperCase()))return!0;let r=e.kayak?.ctid;if(r!==void 0&&r===t.ctid)return!0;let i=e.kayak?.metroId?.toUpperCase(),a=t.cityCode?.toUpperCase();return!!(t.sub===!0&&i&&a===i)}function aL(e){let t=new Set;for(let n=0;n<e.length;n++){let r=e[n];if(!r||!Array.isArray(r.types)||!r.types.includes(`airport`))continue;let i=r.kayakAirport;if(!i)continue;let a=e.findIndex(e=>iL(e,i));if(a<0)continue;let o=e[a],s=r.nearbyAirports[0];if(s){if(!o.nearbyAirports.some(e=>e.iata_code.toUpperCase()===s.iata_code.toUpperCase())){let{lat:e,lng:t}=o.geometry.location;s.distance=nL(rL(e,t,s.lat,s.lng)),o.nearbyAirports.push(s)}t.add(n)}}return e.filter((e,n)=>!t.has(n))}function oL(e){if(!Array.isArray(e.types)||!e.types.includes(`place`))return;let t=e.kayak?.apicode;if(!t?.trim())return;let n=gp(t);if(n.length===0)return;let r=n.length>1,{lat:i,lng:a}=e.geometry.location,o=e.name,s=e.kayak?.stateCode,c=e.kayak?.countryCode;if(!c)return;let l=e.kayak?.metroId??``,u=t=>e.nearbyAirports.find(e=>e.iata_code.toUpperCase()===t.toUpperCase()),d=[],f=new Set;l.toUpperCase();for(let t of n){t.toUpperCase();let n=u(t);n?(d.push(n),f.add(t)):r&&(d.push({iata_code:t,city:o,lat:i,lng:a,country_code:c,name:`${o} (${t})`,state_code:s,location_display:s?void 0:e.formatted_address,kayak_shimmed:!0}),f.add(t))}for(let t of e.nearbyAirports){let e=t.iata_code.toUpperCase();f.has(e)||d.push(t)}let p=d.filter(e=>e.kayak_shimmed),m=d.filter(e=>!e.kayak_shimmed);m.sort((e,t)=>{let n=e.distance??1/0,r=t.distance??1/0;return n===r?e.iata_code.localeCompare(t.iata_code):n-r}),e.nearbyAirports=[...p,...m]}async function sL({query:e,searchType:t}){let n=await fetch(`https://www.kayak.com/mv/marvel?f=j&s=${t}&v=v1&where=${e}&lc=en&lc_cc=US`);if(!n.ok)throw Error(`Unable to get kayak suggestions`);return await n.json()}async function cL(e,t=vp.Hotels){if(!e?.length||e.length<3)return[];let n=aL((await sL({query:e,searchType:t})).reduce((e,t)=>{if(t.isMetroOnly){let n=t.rc?.trim();e.push({nearbyAirports:[],itemType:W.METRO,iata_code:t.displayType.type===`country`?void 0:t.id,formatted_address:t.cityname,geometry:{location:{lat:t.lat,lng:t.lng}},name:t.cityonly,cid:t.cid,kayak:{ctid:t.ctid,apicode:t.apicode,stateCode:n||void 0,countryCode:t.cc,metroId:t.id,metroAirportName:t.airportname},types:[`place`]})}else if(t.displayType.type===`country`)e.push({nearbyAirports:[],itemType:W.AIRPORT,formatted_address:t.displayname,geometry:{location:{lat:t.lat,lng:t.lng}},name:t.displayname,cid:t.cid,types:[`place`]});else if(t.displayType.type===`state`)e.push({nearbyAirports:[],itemType:W.AIRPORT,formatted_address:t.displayname,geometry:{location:{lat:t.lat,lng:t.lng}},name:t.displayname,cid:t.cid,types:[`place`]});else if(t.displayType.type===`airport`){let n=e.findIndex(e=>iL(e,t)),r=t.rc?.trim(),i={iata_code:t.id,city:t.cityonly,lat:t.lat,lng:t.lng,country_code:t.cc,name:t.displayname,state_code:r||void 0,location_display:r?void 0:t.cityname};if(n>-1){let{lat:r,lng:a}=e[n].geometry.location;i.distance=nL(rL(r,a,t.lat,t.lng)),e[n].nearbyAirports.push(i)}else e.push({nearbyAirports:[i],itemType:W.AIRPORT,formatted_address:t.cityname,geometry:{location:{lat:t.lat,lng:t.lng}},name:t.name,rid:t.rid,kayakAirport:{id:t.id,ctid:t.ctid,sub:t.sub,cityCode:t.cityCode},types:[`airport`]})}return e},[]));for(let e of n)oL(e);return n}function lL({key:e,apiDomain:t,suggestApiBaseUrl:n,airportIATA:r,providersArr:i,airlinesArr:a,debounceTime:o=500,autocompleteType:s=`kayak`}){let{sessionId:c}=a_(),{clickId:l}=fh(),[u,d]=(0,G.useState)(``),f=(0,G.useMemo)(()=>(0,YI.default)(d,o),[o]),{data:p,status:m}=Zg({queryKey:[e,r,i,a,u,s,n??`fma-app`,c].flat(),queryFn:()=>s===xp.schedule_data&&r?.length&&r?.length===3?QI(u,r,t,c,l,n):r?.length&&r?.length===3&&(i?.length||0)>0&&(a?.length||0)>0&&i?.every(e=>e===`G4`)&&a?.every(e=>e===`G4`)?eL(u,r,a[0],t,c,l,n):cL(u),enabled:!!c});return{data:p,status:m,setQuery:f}}function uL(){return(0,K.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,"aria-hidden":`true`,className:`aone:w-6 aone:h-6`,children:(0,K.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z`})})}function dL({value:e,onChange:t}){return(0,K.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:gap-2`,children:[(0,K.jsx)(`label`,{className:`aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Pick-up / Drop-off location`}),(0,K.jsxs)(`div`,{className:`aone:flex aone:items-center aone:gap-3`,children:[(0,K.jsx)(`span`,{className:`aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Same`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>t(e===`same-location`?`different-location`:`same-location`),className:`aone:relative aone:inline-flex aone:h-6 aone:w-11 aone:shrink-0 aone:cursor-pointer aone:items-center aone:rounded-full aone:border-2 aone:border-transparent aone:transition-colors aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-blue-500 aone:focus-visible:ring-offset-2 ${e===`different-location`?`aone:bg-blue-600 aone:dark:bg-blue-500`:`aone:bg-gray-200 aone:dark:bg-gray-600`}`,"aria-label":`Toggle to ${e===`same-location`?`different location`:`same location`}`,children:(0,K.jsx)(`span`,{className:`aone:pointer-events-none aone:block aone:h-5 aone:w-5 aone:rounded-full aone:bg-white aone:shadow-lg aone:ring-0 aone:transition-transform ${e===`different-location`?`aone:translate-x-5`:`aone:translate-x-0`}`})}),(0,K.jsx)(`span`,{className:`aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Different`})]})]})}function fL({shadowRoot:e,origin:t,theme:n}){let{apiDomain:r}=c_(),[i,a]=(0,G.useState)(`same-location`),[o,s]=(0,G.useState)(t.toUpperCase()),[c,l]=(0,G.useState)(t.toUpperCase()),[u,d]=(0,G.useState)(``),[f,p]=(0,G.useState)(`12:00`),[m,h]=(0,G.useState)(``),[g,_]=(0,G.useState)(`12:00`),v=(0,G.useMemo)(()=>u&&f?`${u}T${f}`:``,[u,f]),y=(0,G.useMemo)(()=>m&&g?`${m}T${g}`:``,[m,g]),b=i===`same-location`?o:c,{data:x,status:S,setQuery:C}=lL({key:`carfare-from-suggest`,apiDomain:r,airportIATA:b}),{data:w,status:T,setQuery:E}=lL({key:`carfare-to-suggest`,apiDomain:r,airportIATA:o}),[D,O]=(0,G.useState)([]),[k,A]=(0,G.useState)([]),[j,M]=(0,G.useState)(!1);(0,G.useEffect)(()=>{t&&t.length===3&&!j&&C(t)},[t,C,j]),(0,G.useEffect)(()=>{if(x&&x.length>0&&!D.length&&!j){let e=x.filter(e=>e.nearbyAirports?.length).flatMap(e=>e.nearbyAirports).find(e=>e.iata_code?.toUpperCase()===t.toUpperCase());if(e){let t={...e,sectionIndex:0,type:`airport`,key:e.iata_code},n=e.iata_code??``;queueMicrotask(()=>{O([t]),s(n),M(!0)})}}},[x,t,D.length,j]);let N=(0,G.useMemo)(()=>x?x.filter(e=>e.nearbyAirports?.length).map(e=>{let t=e.types.includes(`airport`);return[{...e,sectionIndex:0,type:t?`airport-place`:`place`,key:e.formatted_address},...e.nearbyAirports.map((e,n)=>({...e,sectionIndex:t?-1:n,type:`airport`,key:`${e.iata_code}`}))]}).flat().filter((e,t,n)=>{if(e.type===`place`){let e=n.at(t+1);if(!e||e.type!==`airport`)return!1}return!0}):[],[x]),P=(0,G.useMemo)(()=>w?w.filter(e=>e.nearbyAirports?.length).map(e=>{let t=e.types.includes(`airport`);return[{...e,sectionIndex:0,type:t?`airport-place`:`place`,key:e.formatted_address},...e.nearbyAirports.map((e,n)=>({...e,sectionIndex:t?-1:n,type:`airport`,key:`${e.iata_code}`}))]}).flat().filter((e,t,n)=>{if(e.type===`place`){let e=n.at(t+1);if(!e||e.type!==`airport`)return!1}return!0}):[],[w]),ee=(0,G.useCallback)(()=>{let e=/^[A-Za-z]{3}$/,t=e.test(o),n=e.test(b);if(!t||!n||!v||!y)return;let r=new URLSearchParams({fromAirport:o.toUpperCase(),toAirport:b.toUpperCase(),tripOption:i,fromDateTime:v,toDateTime:y}),a=`https://flymyairport.com/from/${o.toUpperCase()}/cars?${r.toString()}`,s=document.createElement(`a`);s.href=a,s.target=`_blank`,s.rel=`noopener noreferrer`,s.click(),s.remove()},[o,b,i,v,y]),F=(0,G.useMemo)(()=>{let e=/^[A-Za-z]{3}$/;if(!e.test(o)||!e.test(b)||!v||!y)return!1;try{let e=new Date(v),t=new Date(y),n=new Date;return n.setHours(0,0,0,0),e.getTime()<=t.getTime()&&e.getTime()>=n.getTime()}catch{return!1}},[o,b,v,y]);return(0,K.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:gap-3`,part:`carfare-search-container`,"data-mode":n,children:[(0,K.jsxs)(`div`,{className:`aone:flex aone:items-center aone:justify-between aone:gap-2`,children:[(0,K.jsx)(dL,{value:i,onChange:a}),(0,K.jsx)(`div`,{className:`aone:ml-2`,children:(0,K.jsx)(FI,{hideByDefault:!1})})]}),(0,K.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:md:flex-row aone:md:flex-wrap aone:gap-2 aone:md:gap-4 aone:md:items-end`,children:[(0,K.jsxs)(`div`,{className:`aone:w-full aone:md:w-auto aone:md:flex-1 aone:md:min-w-[200px] aone:h-[72px]`,children:[(0,K.jsx)(`label`,{className:`aone:block aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Pick-up Location`}),(0,K.jsx)(`div`,{className:`aone:mt-1 aone:md:mt-2`,children:(0,K.jsx)(PI,{shadowRoot:e,dataTestId:`carfare-from-airport`,icon:S===`pending`?(0,K.jsx)(Th,{}):(0,K.jsx)(uL,{}),placeholder:`From?`,items:N,selectedItems:D,onInputChange:C,onSelectedItemsChange:e=>{if(!e||e.length===0){O([]),s(``);return}let t=e[0];t.type===`airport`&&(O(e),s(t.iata_code??``))}})})]}),i===`different-location`&&(0,K.jsxs)(`div`,{className:`aone:w-full aone:md:w-auto aone:md:flex-1 aone:md:min-w-[200px]`,children:[(0,K.jsx)(`label`,{className:`aone:block aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Drop-off Location`}),(0,K.jsx)(`div`,{className:`aone:mt-1 aone:md:mt-2`,children:(0,K.jsx)(PI,{shadowRoot:e,dataTestId:`carfare-to-airport`,icon:T===`pending`?(0,K.jsx)(Th,{}):(0,K.jsx)(uL,{}),placeholder:`To?`,items:P,selectedItems:k,onInputChange:E,onSelectedItemsChange:e=>{if(!e||e.length===0){A([]),l(``);return}let t=e[0];t.type===`airport`&&(A(e),l(t.iata_code??``))}})})]}),(0,K.jsx)(bN,{label:`Pick-up Date`,dateValue:u,timeValue:f,onDateChange:e=>{let t=e?e.toISOString().split(`T`)[0]??``:``;d(t),t&&h(e=>{if(e)return e;let n=new Date(t);return n.setDate(n.getDate()+1),n.toISOString().split(`T`)[0]??``})},onTimeChange:e=>p(e),origin:o,destination:b,minDate:new Date,shadowRoot:e}),(0,K.jsx)(bN,{label:`Drop-off Date`,dateValue:m,timeValue:g,onDateChange:e=>{let t=e?e.toISOString().split(`T`)[0]??``:``;h(t)},onTimeChange:e=>_(e),origin:o,destination:b,minDate:u?new Date(u):new Date,shadowRoot:e,referenceDates:(()=>{let e=[];if(u){let t=u.split(`-`);if(t.length===3){let n=t[0],r=t[1],i=t[2],a=parseInt(n,10),o=parseInt(r,10),s=parseInt(i,10);!Number.isNaN(a)&&!Number.isNaN(o)&&!Number.isNaN(s)&&e.push({date:new Date(a,o-1,s,12,0,0),label:`Pick-up`})}}if(m){let t=m.split(`-`);if(t.length===3){let n=t[0],r=t[1],i=t[2],a=parseInt(n,10),o=parseInt(r,10),s=parseInt(i,10);!Number.isNaN(a)&&!Number.isNaN(o)&&!Number.isNaN(s)&&e.push({date:new Date(a,o-1,s,12,0,0),label:`Drop-off`})}}return e.length?e:void 0})()}),(0,K.jsx)(`button`,{type:`button`,disabled:!F,onClick:ee,"aria-label":`Search for car rentals`,className:`aone:w-full aone:md:w-auto aone:px-6 aone:py-2 aone:bg-green-500 aone:dark:bg-green-600 aone:text-white aone:rounded-lg aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-green-700 aone:focus:ring-offset-2 aone:h-[44px] aone:text-base aone:font-medium aone:enabled:hover:bg-green-700 aone:enabled:active:bg-green-700 aone:disabled:bg-gray-400 aone:dark:disabled:bg-gray-600 aone:disabled:text-white/70 aone:disabled:cursor-not-allowed`,children:(0,K.jsxs)(`div`,{className:`aone:flex aone:items-center aone:justify-center aone:gap-2`,children:[(0,K.jsx)(uL,{}),(0,K.jsx)(`span`,{children:`Search`})]})})]})]})}var pL=new Ig;function mL({children:e,props:t}){return(0,K.jsx)(Oh,{client:pL,children:(0,K.jsx)(s_,{apiDomain:t.apiDomain,consentAnalytics:t.consentAnalytics,consentAdvertising:t.consentAdvertising,consentFunctional:t.consentFunctional,children:e})})}function hL(e){return!e.origin||e.origin.length!==3?(console.error(`Origin is not a valid IATA code, not rendering widget.`),null):(0,K.jsxs)(mL,{props:e,children:[(0,K.jsx)(`style`,{children:l_}),e.userStyleBlock?(0,K.jsx)(`style`,{children:e.userStyleBlock}):null,(0,K.jsx)($g,{componentName:`carfare search`,children:(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(Th,{}),children:(0,K.jsx)(fL,{shadowRoot:e.shadowRoot,origin:e.origin,theme:e.theme})})})]})}var gL=[`origin`,`primary-color`,`secondary-color`,`consent-analytics`,`consent-advertising`,`consent-functional`,`theme`,Pp,`id`],_L=class extends HTMLElement{_shadowRoot;_mountPoint;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;_mountTelemetrySent=!1;_lastPublicConfigTelemetryKey=null;static get observedAttributes(){return Array.from(gL)}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this._scheduleRender()}connectedCallback(){this.style.position=`relative`,this.style.zIndex=`10`,this.style.lineHeight=`1.5`,this.style.display=`flex`,this.style.flexDirection=`column`,this._scheduleRender()}disconnectedCallback(){this._reactRoot&&=(this._reactRoot.unmount(),void 0),this._mountTelemetrySent=!1,this._lastPublicConfigTelemetryKey=null}_scheduleRender(){this._renderScheduled||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&this._renderAsync()}))}async _renderAsync(){if(this._renderInProgress)this._renderQueued=!0;else{this._renderInProgress=!0;try{let e=cm(this),t=mm(),n=null,r=!1,i={attempted:!1,durationMs:0},a;if(e&&t){let t=await hm(e);i=t.metrics;let o=t.config;o?.widgetType&&o.widgetType!==`carfare-search`&&(console.warn(`[airport-one-widgets] Widget instance type does not match carfare-search:`,o.widgetType),a=`widget_type_mismatch`,o=null),n=o,r=!n,i.attempted&&n===null&&a===void 0&&i.failureKind&&(a=i.failureKind)}if(!this.isConnected)return;let o=xm(n),s=window[Ac],c=w_(this,`https://flymyairport.vercel.app`,s,o),l=!i.attempted&&(!t||!e)?t?`no_instance_id`:`no_api_base`:void 0;if(c.consentAnalytics){let r=i.attempted?`attempt:${t}|${e}|${n===null?`fail`:`ok`}|${a??``}`:`skip:${l??`none`}`;r!==this._lastPublicConfigTelemetryKey&&(this._lastPublicConfigTelemetryKey=r,Sh(!0,{widget_runtime:`carfare-search`,widget_instance_id:Np(e)??void 0,attempted:i.attempted,duration_ms:i.durationMs,ok:i.attempted?n!==null:!1,error_kind:i.attempted&&n===null?a:void 0,skip_reason:l}))}r&&console.warn(`${um}: carfare-search — managed instance config not applied; using host attributes and window defaults.`),this._paintCarfare(c),c.consentAnalytics&&!this._mountTelemetrySent&&(this._mountTelemetrySent=!0,Ch(!0,{widget_runtime:`carfare-search`,widget_instance_id:Np(e)??void 0,public_config_unavailable:r}))}finally{this._renderInProgress=!1,this._renderQueued&&(this._renderQueued=!1,queueMicrotask(()=>{this.isConnected&&this._renderAsync()}))}}}_paintCarfare(e){let t=this._shadowRoot??=this.attachShadow({mode:`closed`}),n=this._mountPoint??=document.createElement(`span`);n.parentNode!==t&&t.appendChild(n);let r={...e,shadowRoot:t},i=r.primaryColor??`210 100% 50%`,a=r.secondaryColor??`210 100% 50%`,o=r.primaryColor!=null&&Kp.test(r.primaryColor),s=r.secondaryColor!=null&&Kp.test(r.secondaryColor);n.style.setProperty(`--primary`,o?Yp(i):i),n.style.setProperty(`--secondary`,s?Yp(a):a),r.theme===`dark`?this.setAttribute(`data-mode`,`dark`):this.removeAttribute(`data-mode`),(this._reactRoot??=rm.createRoot(n)).render((0,K.jsx)(hL,{...r}))}};customElements.get(`fma-carfare-search`)||customElements.define(`fma-carfare-search`,_L);function vL(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}function yL(e){return Array.from(new Set([e,e.toLowerCase(),vL(e)]))}function bL(e,t){if(e===void 0)return t;let n=e.trim().toLowerCase();return t?n!==`false`:n===`true`}function xL(e){let t=e.trim();return/^(?:\d+\.?\d*|\.\d+)$/.test(t)?`${t.endsWith(`.`)?t.slice(0,-1):t}px`:t}var SL=`80 64 646 101`,CL=646/101,wL={white:`#fff`,black:`#1f1f1f`},TL=[`M98.5,141.34h-11.27v-20l11.27-8.22v28.22Z`,`M137.06,81.95h-38.55v23.13h.52l16.22-.02c4.76,0,8.83,3.41,9.65,8.09l-57.38-.05-5.68-16.12h5.55l8.13,8.1h11.71v-34.1h49.83v10.97Z`,`M144.49,70.76h10.37v70.36h-10.37v-70.36Z`,`M205.29,91.5h11.58l-31.31,72.68h-11.47l10.27-23.76-19.83-48.92h12.08l8.56,23.45,4.93,14.09,5.33-13.89,9.86-23.66Z`,`M288.11,141.23v-54.05l-23.96,33.32h-2.42l-23.66-33.32v54.05h-11.27v-70.46h13.09l23.25,33.02,23.15-33.02h13.09v70.46h-11.27Z`,`M350.58,91.5h11.58l-31.31,72.68h-11.48l10.27-23.76-19.83-48.92h12.08l8.56,23.45,4.93,14.09,5.34-13.89,9.86-23.66Z`,`M421,141.13l-6.74-14.8h-38.15l-6.64,14.8h-11.98l31.61-70.46h12.28l31.61,70.46h-11.98ZM410.13,116.06l-14.9-33.52-14.9,33.52h29.8Z`,`M451.26,91.3v49.83h-10.37v-49.83h10.37ZM439.68,76.9c0,8.56,12.88,8.56,12.88,0s-12.88-8.46-12.88,0Z`,`M462.51,91.5h9.66l.7,6.54c3.62-6.34,9.26-7.65,14.6-7.65,4.83,0,9.46,1.71,12.28,4.23l-4.73,9.06c-2.52-2.01-4.93-3.02-8.76-3.02-7.15,0-13.39,4.43-13.39,13.59v26.88h-10.37v-49.63Z`,`M533.58,132.17c9.06,0,15.7-6.54,15.7-15.8s-6.24-15.8-15.7-15.8-15.6,6.95-15.6,15.8,6.54,15.8,15.6,15.8ZM517.07,164.18h-10.37v-72.68h9.76l.6,8.05c3.83-6.04,10.87-9.06,17.51-9.06,14.8.1,25.06,10.87,25.06,25.87s-9.66,25.87-25.06,25.87c-6.04,0-13.79-2.21-17.51-8.35v30.3Z`,`M592.15,90.49c15.3,0,25.77,11.27,25.77,25.87s-10.17,25.77-25.77,25.77-25.57-11.07-25.57-25.77,10.17-25.87,25.57-25.87ZM592.15,100.06c-9.46,0-15.2,7.55-15.2,16.31s5.74,16.11,15.2,16.11,15.3-7.25,15.3-16.11-6.24-16.31-15.3-16.31Z`,`M624.88,91.5h9.66l.71,6.54c3.62-6.34,9.26-7.65,14.6-7.65,4.83,0,9.46,1.71,12.28,4.23l-4.73,9.06c-2.52-2.01-4.93-3.02-8.76-3.02-7.15,0-13.39,4.43-13.39,13.59v26.88h-10.37v-49.63Z`,`M674.75,78.31l10.47-1.11v14.39h14.5v8.96h-14.6v23.66c0,5.23,2.32,8.15,7.15,8.15,2.01,0,4.33-.7,6.34-1.71l3.02,8.86c-3.42,1.51-6.44,2.21-9.97,2.21-10.77.3-16.91-5.84-16.91-17.51v-23.66h-9.56v-8.96h9.56v-13.29Z`,`M715.78,63.99c6.85,0,10.68,4.93,10.68,10.77s-3.83,10.77-10.68,10.77-10.65-4.93-10.65-10.77,3.84-10.77,10.65-10.77ZM707.84,74.76c.03,4.66,2.89,8.32,7.94,8.32s7.94-3.66,7.94-8.32-2.86-8.35-7.94-8.35-7.91,3.69-7.94,8.35ZM721,79.66l-2.89-3.48c4.07-.8,3.42-6.93-1.36-6.93h-5.13v10.95h2.48v-3.6h1.39l2.83,3.6h2.69v-.53ZM714.09,71.49h2.65c2.04,0,2.04,2.98-.03,2.98h-2.63v-2.98Z`];function EL({variant:e=`white`,className:t,height:n=28}){return(0,K.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:SL,width:Math.round(n*CL),height:n,className:t,role:`img`,"aria-label":`FlyMyAirport`,children:(0,K.jsx)(`g`,{fill:wL[e],children:TL.map(e=>(0,K.jsx)(`path`,{d:e},e))})})}function DL(e,t=500){let[n,r]=(0,G.useState)(e),i=(0,G.useRef)(e);return(0,G.useEffect)(()=>{if(i.current===e)return;let n=e,a=setTimeout(()=>{i.current!==n&&(i.current=n,r(n))},t);return()=>clearTimeout(a)},[e,t]),n}function OL(e){return(e.split(`,`)[0]??``).trim().toUpperCase()}function kL(e){let t=String(e.getMonth()+1).padStart(2,`0`);return`${e.getFullYear()}-${t}`}function AL(e){return new Date(e.getFullYear(),e.getMonth(),1)}function jL(e,t){let n=t??e,r=AL(e),i=AL(n),a=[],o=r;for(;o<=i;)a.push(kL(o)),o=new Date(o.getFullYear(),o.getMonth()+1,1);return a}function ML(e=new Date){let t=AL(e),n=new Date(t.getFullYear(),t.getMonth()+1,1);return[kL(t),kL(n)]}function NL({startDate:e,endDate:t,lookaheadMonths:n=1,referenceDate:r=new Date}){if(!e){let e=ML(r);return{visibleMonths:e,fetchMonths:e}}let i=jL(e,t),a=new Set([...ML(r),...i]),o=AL(t??e);for(let e=1;e<=n;e+=1)a.add(kL(new Date(o.getFullYear(),o.getMonth()+e,1)));return{visibleMonths:i,fetchMonths:Array.from(a).sort()}}function PL(e,t,n,r){let i={iata:OL(e),locationType:n},a={iata:OL(t),locationType:r},o=i.iata<=a.iata;return{canonicalFrom:o?i:a,canonicalTo:o?a:i,requestedDirectionInCanonicalEnvelope:o?`forward`:`reverse`}}function FL(e){if(typeof e!=`object`||!e||Array.isArray(e))throw Error(`Unable to get route calendar month`);let t=e;if(t.success!==!0)throw Error(`Unable to get route calendar month`);return t.data}async function IL(e){let t={};e.sessionId&&(t[d_]=e.sessionId),e.clickId&&(t[f_]=e.clickId);let n={departureAirport:e.departureAirport,arrivalAirport:e.arrivalAirport,month:e.month,departureLocationType:e.departureLocationType,arrivalLocationType:e.arrivalLocationType},r=!!e.calendarApiBaseUrl,i=r?await fetch(`${e.calendarApiBaseUrl}/v1/route-calendar-month?${new URLSearchParams(n).toString()}`,{method:`GET`,headers:t}):await fetch(`${e.apiDomain}/api/calendar-month`,{method:`POST`,headers:{...t,"Content-Type":`application/json`},body:JSON.stringify(n)});if(!i.ok)throw Error(`Unable to get route calendar month`);let a=await i.json();return Ic.parse(r?FL(a):a)}function LL(e){let t=new Date;return t.setDate(t.getDate()-1),t.setHours(0,0,0,0),Object.fromEntries(Object.entries(e).filter(([e])=>new Date(e)>=t))}function RL(e){return e.reduce((e,t)=>(Object.assign(e.forward,t.forward),Object.assign(e.reverse,t.reverse),e),{forward:{},reverse:{}})}function zL({selectedDirection:e,mergedDirections:t}){return e===`forward`?{selectedData:t.forward,oppositeData:t.reverse}:{selectedData:t.reverse,oppositeData:t.forward}}var BL=new Map;function VL({apiDomain:e,calendarApiBaseUrl:t,params:n,debounceTime:r=500}){let{sessionId:i}=a_(),{clickId:a}=fh(),o=DL((0,G.useMemo)(()=>({startDate:n.startDate,endDate:n.endDate}),[n.startDate,n.endDate]),r),s=n.departureLocationType??W.AIRPORT,c=n.arrivalLocationType??W.AIRPORT,l=PL(n.origin,n.destination,s,c),{visibleMonths:u,fetchMonths:d}=NL({startDate:o.startDate,endDate:o.endDate}),f=l.canonicalFrom.iata.length>0,p=l.canonicalTo.iata.length>0,m=f&&p,h=Yg({queries:d.map(n=>{let r=l.canonicalFrom.iata,o=l.canonicalTo.iata,s=l.canonicalFrom.locationType,c=l.canonicalTo.locationType;return{queryKey:[`route-calendar-month`,r,o,s,c,n,t??`fma-app`,i],enabled:m&&!!i,queryFn:async()=>{let l=Fc.safeParse({departureAirport:r,arrivalAirport:o,month:n,departureLocationType:s,arrivalLocationType:c});if(!l.success)throw Error(`Invalid route-calendar-month parameters`);return IL({apiDomain:e,calendarApiBaseUrl:t,departureAirport:l.data.departureAirport,arrivalAirport:l.data.arrivalAirport,month:l.data.month,departureLocationType:l.data.departureLocationType,arrivalLocationType:l.data.arrivalLocationType,sessionId:i,clickId:a})},staleTime:6e4}})}),g=(0,G.useMemo)(()=>[l.canonicalFrom.iata,l.canonicalTo.iata,l.canonicalFrom.locationType,l.canonicalTo.locationType,i??`no-session`].join(`|`),[l.canonicalFrom.iata,l.canonicalTo.iata,l.canonicalFrom.locationType,l.canonicalTo.locationType,i]),{forwardData:_,reverseData:v,data:y,oppositeData:b}=(0,G.useMemo)(()=>{let e=h.filter(e=>!!e.data);if(e.length===0)return BL.get(g)??{forwardData:void 0,reverseData:void 0,data:void 0,oppositeData:void 0};let t=RL(e.map(e=>e.data)),n=l.requestedDirectionInCanonicalEnvelope,{selectedData:r,oppositeData:i}=zL({selectedDirection:n,mergedDirections:t}),a={forwardData:LL(t.forward),reverseData:LL(t.reverse),data:LL(r),oppositeData:LL(i)};return BL.set(g,a),a},[h,g,l.requestedDirectionInCanonicalEnvelope]);return{forwardData:_,reverseData:v,data:y,oppositeData:b,status:(0,G.useMemo)(()=>{if(!m||!i)return`pending`;let e=new Set(u),t=h.filter((t,n)=>e.has(d[n]??``));return t.length===0?`pending`:t.some(e=>e.status===`error`)?`error`:t.some(e=>e.status===`pending`)?`pending`:`success`},[h,d,u,i,m])}}function HL(){return(0,K.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,className:`aone:w-6 aone:h-6`,children:(0,K.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M7.5 21L3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5`})})}var UL=s(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),WL=s(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),GL=s(((e,t)=>{var n=WL();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),KL=s(((e,t)=>{var n=GL(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),qL=s(((e,t)=>{var n=GL();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),JL=s(((e,t)=>{var n=GL();function r(e){return n(this.__data__,e)>-1}t.exports=r})),YL=s(((e,t)=>{var n=GL();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),XL=s(((e,t)=>{var n=UL(),r=KL(),i=qL(),a=JL(),o=YL();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),ZL=s(((e,t)=>{var n=XL();function r(){this.__data__=new n,this.size=0}t.exports=r})),QL=s(((e,t)=>{function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.exports=n})),$L=s(((e,t)=>{function n(e){return this.__data__.get(e)}t.exports=n})),eR=s(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),tR=s(((e,t)=>{var n=GI(),r=II(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),nR=s(((e,t)=>{t.exports=RI()[`__core-js_shared__`]})),rR=s(((e,t)=>{var n=nR(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),iR=s(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),aR=s(((e,t)=>{var n=tR(),r=rR(),i=II(),a=iR(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),oR=s(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),sR=s(((e,t)=>{var n=aR(),r=oR();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),cR=s(((e,t)=>{t.exports=sR()(RI(),`Map`)})),lR=s(((e,t)=>{t.exports=sR()(Object,`create`)})),uR=s(((e,t)=>{var n=lR();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),dR=s(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}t.exports=n})),fR=s(((e,t)=>{var n=lR(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),pR=s(((e,t)=>{var n=lR(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),mR=s(((e,t)=>{var n=lR(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=+!this.has(e),i[e]=n&&t===void 0?r:t,this}t.exports=i})),hR=s(((e,t)=>{var n=uR(),r=dR(),i=fR(),a=pR(),o=mR();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),gR=s(((e,t)=>{var n=hR(),r=XL(),i=cR();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),_R=s(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),vR=s(((e,t)=>{var n=_R();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),yR=s(((e,t)=>{var n=vR();function r(e){var t=n(this,e).delete(e);return this.size-=+!!t,t}t.exports=r})),bR=s(((e,t)=>{var n=vR();function r(e){return n(this,e).get(e)}t.exports=r})),xR=s(((e,t)=>{var n=vR();function r(e){return n(this,e).has(e)}t.exports=r})),SR=s(((e,t)=>{var n=vR();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),CR=s(((e,t)=>{var n=gR(),r=yR(),i=bR(),a=xR(),o=SR();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),wR=s(((e,t)=>{var n=XL(),r=cR(),i=CR(),a=200;function o(e,t){var o=this.__data__;if(o instanceof n){var s=o.__data__;if(!r||s.length<a-1)return s.push([e,t]),this.size=++o.size,this;o=this.__data__=new i(s)}return o.set(e,t),this.size=o.size,this}t.exports=o})),TR=s(((e,t)=>{var n=XL(),r=ZL(),i=QL(),a=$L(),o=eR(),s=wR();function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=o,c.prototype.set=s,t.exports=c})),ER=s(((e,t)=>{function n(e){return this.__data__.set(e,`__lodash_hash_undefined__`),this}t.exports=n})),DR=s(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),OR=s(((e,t)=>{var n=CR(),r=ER(),i=DR();function a(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}a.prototype.add=a.prototype.push=r,a.prototype.has=i,t.exports=a})),kR=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.exports=n})),AR=s(((e,t)=>{function n(e,t){return e.has(t)}t.exports=n})),jR=s(((e,t)=>{var n=OR(),r=kR(),i=AR(),a=1,o=2;function s(e,t,s,c,l,u){var d=s&a,f=e.length,p=t.length;if(f!=p&&!(d&&p>f))return!1;var m=u.get(e),h=u.get(t);if(m&&h)return m==t&&h==e;var g=-1,_=!0,v=s&o?new n:void 0;for(u.set(e,t),u.set(t,e);++g<f;){var y=e[g],b=t[g];if(c)var x=d?c(b,y,g,t,e,u):c(y,b,g,e,t,u);if(x!==void 0){if(x)continue;_=!1;break}if(v){if(!r(t,function(e,t){if(!i(v,t)&&(y===e||l(y,e,s,c,u)))return v.push(t)})){_=!1;break}}else if(!(y===b||l(y,b,s,c,u))){_=!1;break}}return u.delete(e),u.delete(t),_}t.exports=s})),MR=s(((e,t)=>{t.exports=RI().Uint8Array})),NR=s(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}t.exports=n})),PR=s(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}t.exports=n})),FR=s(((e,t)=>{var n=HI(),r=MR(),i=WL(),a=jR(),o=NR(),s=PR(),c=1,l=2,u=`[object Boolean]`,d=`[object Date]`,f=`[object Error]`,p=`[object Map]`,m=`[object Number]`,h=`[object RegExp]`,g=`[object Set]`,_=`[object String]`,v=`[object Symbol]`,y=`[object ArrayBuffer]`,b=`[object DataView]`,x=n?n.prototype:void 0,S=x?x.valueOf:void 0;function C(e,t,n,x,C,w,T){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y:return!(e.byteLength!=t.byteLength||!w(new r(e),new r(t)));case u:case d:case m:return i(+e,+t);case f:return e.name==t.name&&e.message==t.message;case h:case _:return e==t+``;case p:var E=o;case g:var D=x&c;if(E||=s,e.size!=t.size&&!D)return!1;var O=T.get(e);if(O)return O==t;x|=l,T.set(e,t);var k=a(E(e),E(t),x,C,w,T);return T.delete(e),k;case v:if(S)return S.call(e)==S.call(t)}return!1}t.exports=C})),IR=s(((e,t)=>{function n(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}t.exports=n})),LR=s(((e,t)=>{t.exports=Array.isArray})),RR=s(((e,t)=>{var n=IR(),r=LR();function i(e,t,i){var a=t(e);return r(e)?a:n(a,i(e))}t.exports=i})),zR=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}t.exports=n})),BR=s(((e,t)=>{function n(){return[]}t.exports=n})),VR=s(((e,t)=>{var n=zR(),r=BR(),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;t.exports=a?function(e){return e==null?[]:(e=Object(e),n(a(e),function(t){return i.call(e,t)}))}:r})),HR=s(((e,t)=>{function n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}t.exports=n})),UR=s(((e,t)=>{var n=GI(),r=KI(),i=`[object Arguments]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),WR=s(((e,t)=>{var n=UR(),r=KI(),i=Object.prototype,a=i.hasOwnProperty,o=i.propertyIsEnumerable;t.exports=n(function(){return arguments}())?n:function(e){return r(e)&&a.call(e,`callee`)&&!o.call(e,`callee`)}})),GR=s(((e,t)=>{function n(){return!1}t.exports=n})),KR=s(((e,t)=>{var n=RI(),r=GR(),i=typeof e==`object`&&e&&!e.nodeType&&e,a=i&&typeof t==`object`&&t&&!t.nodeType&&t,o=a&&a.exports===i?n.Buffer:void 0;t.exports=(o?o.isBuffer:void 0)||r})),qR=s(((e,t)=>{var n=/^(?:0|[1-9]\d*)$/;function r(e,t){var r=typeof e;return t??=9007199254740991,!!t&&(r==`number`||r!=`symbol`&&n.test(e))&&e>-1&&e%1==0&&e<t}t.exports=r})),JR=s(((e,t)=>{function n(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=9007199254740991}t.exports=n})),YR=s(((e,t)=>{var n=GI(),r=JR(),i=KI(),a=`[object Arguments]`,o=`[object Array]`,s=`[object Boolean]`,c=`[object Date]`,l=`[object Error]`,u=`[object Function]`,d=`[object Map]`,f=`[object Number]`,p=`[object Object]`,m=`[object RegExp]`,h=`[object Set]`,g=`[object String]`,_=`[object WeakMap]`,v=`[object ArrayBuffer]`,y=`[object DataView]`,b=`[object Float32Array]`,x=`[object Float64Array]`,S=`[object Int8Array]`,C=`[object Int16Array]`,w=`[object Int32Array]`,T=`[object Uint8Array]`,E=`[object Uint8ClampedArray]`,D=`[object Uint16Array]`,O=`[object Uint32Array]`,k={};k[b]=k[x]=k[S]=k[C]=k[w]=k[T]=k[E]=k[D]=k[O]=!0,k[a]=k[o]=k[v]=k[s]=k[y]=k[c]=k[l]=k[u]=k[d]=k[f]=k[p]=k[m]=k[h]=k[g]=k[_]=!1;function A(e){return i(e)&&r(e.length)&&!!k[n(e)]}t.exports=A})),XR=s(((e,t)=>{function n(e){return function(t){return e(t)}}t.exports=n})),ZR=s(((e,t)=>{var n=LI(),r=typeof e==`object`&&e&&!e.nodeType&&e,i=r&&typeof t==`object`&&t&&!t.nodeType&&t,a=i&&i.exports===r&&n.process;t.exports=function(){try{return i&&i.require&&i.require(`util`).types||a&&a.binding&&a.binding(`util`)}catch{}}()})),QR=s(((e,t)=>{var n=YR(),r=XR(),i=ZR(),a=i&&i.isTypedArray;t.exports=a?r(a):n})),$R=s(((e,t)=>{var n=HR(),r=WR(),i=LR(),a=KR(),o=qR(),s=QR(),c=Object.prototype.hasOwnProperty;function l(e,t){var l=i(e),u=!l&&r(e),d=!l&&!u&&a(e),f=!l&&!u&&!d&&s(e),p=l||u||d||f,m=p?n(e.length,String):[],h=m.length;for(var g in e)(t||c.call(e,g))&&!(p&&(g==`length`||d&&(g==`offset`||g==`parent`)||f&&(g==`buffer`||g==`byteLength`||g==`byteOffset`)||o(g,h)))&&m.push(g);return m}t.exports=l})),ez=s(((e,t)=>{var n=Object.prototype;function r(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||n)}t.exports=r})),tz=s(((e,t)=>{function n(e,t){return function(n){return e(t(n))}}t.exports=n})),nz=s(((e,t)=>{t.exports=tz()(Object.keys,Object)})),rz=s(((e,t)=>{var n=ez(),r=nz(),i=Object.prototype.hasOwnProperty;function a(e){if(!n(e))return r(e);var t=[];for(var a in Object(e))i.call(e,a)&&a!=`constructor`&&t.push(a);return t}t.exports=a})),iz=s(((e,t)=>{var n=tR(),r=JR();function i(e){return e!=null&&r(e.length)&&!n(e)}t.exports=i})),az=s(((e,t)=>{var n=$R(),r=rz(),i=iz();function a(e){return i(e)?n(e):r(e)}t.exports=a})),oz=s(((e,t)=>{var n=RR(),r=VR(),i=az();function a(e){return n(e,i,r)}t.exports=a})),sz=s(((e,t)=>{var n=oz(),r=1,i=Object.prototype.hasOwnProperty;function a(e,t,a,o,s,c){var l=a&r,u=n(e),d=u.length;if(d!=n(t).length&&!l)return!1;for(var f=d;f--;){var p=u[f];if(!(l?p in t:i.call(t,p)))return!1}var m=c.get(e),h=c.get(t);if(m&&h)return m==t&&h==e;var g=!0;c.set(e,t),c.set(t,e);for(var _=l;++f<d;){p=u[f];var v=e[p],y=t[p];if(o)var b=l?o(y,v,p,t,e,c):o(v,y,p,e,t,c);if(!(b===void 0?v===y||s(v,y,a,o,c):b)){g=!1;break}_||=p==`constructor`}if(g&&!_){var x=e.constructor,S=t.constructor;x!=S&&`constructor`in e&&`constructor`in t&&!(typeof x==`function`&&x instanceof x&&typeof S==`function`&&S instanceof S)&&(g=!1)}return c.delete(e),c.delete(t),g}t.exports=a})),cz=s(((e,t)=>{t.exports=sR()(RI(),`DataView`)})),lz=s(((e,t)=>{t.exports=sR()(RI(),`Promise`)})),uz=s(((e,t)=>{t.exports=sR()(RI(),`Set`)})),dz=s(((e,t)=>{t.exports=sR()(RI(),`WeakMap`)})),fz=s(((e,t)=>{var n=cz(),r=cR(),i=lz(),a=uz(),o=dz(),s=GI(),c=iR(),l=`[object Map]`,u=`[object Object]`,d=`[object Promise]`,f=`[object Set]`,p=`[object WeakMap]`,m=`[object DataView]`,h=c(n),g=c(r),_=c(i),v=c(a),y=c(o),b=s;(n&&b(new n(new ArrayBuffer(1)))!=m||r&&b(new r)!=l||i&&b(i.resolve())!=d||a&&b(new a)!=f||o&&b(new o)!=p)&&(b=function(e){var t=s(e),n=t==u?e.constructor:void 0,r=n?c(n):``;if(r)switch(r){case h:return m;case g:return l;case _:return d;case v:return f;case y:return p}return t}),t.exports=b})),pz=s(((e,t)=>{var n=TR(),r=jR(),i=FR(),a=sz(),o=fz(),s=LR(),c=KR(),l=QR(),u=1,d=`[object Arguments]`,f=`[object Array]`,p=`[object Object]`,m=Object.prototype.hasOwnProperty;function h(e,t,h,g,_,v){var y=s(e),b=s(t),x=y?f:o(e),S=b?f:o(t);x=x==d?p:x,S=S==d?p:S;var C=x==p,w=S==p,T=x==S;if(T&&c(e)){if(!c(t))return!1;y=!0,C=!1}if(T&&!C)return v||=new n,y||l(e)?r(e,t,h,g,_,v):i(e,t,x,h,g,_,v);if(!(h&u)){var E=C&&m.call(e,`__wrapped__`),D=w&&m.call(t,`__wrapped__`);if(E||D){var O=E?e.value():e,k=D?t.value():t;return v||=new n,_(O,k,h,g,v)}}return T?(v||=new n,a(e,t,h,g,_,v)):!1}t.exports=h})),mz=s(((e,t)=>{var n=pz(),r=KI();function i(e,t,a,o,s){return e===t?!0:e==null||t==null||!r(e)&&!r(t)?e!==e&&t!==t:n(e,t,a,o,i,s)}t.exports=i})),hz=s(((e,t)=>{var n=TR(),r=mz(),i=1,a=2;function o(e,t,o,s){var c=o.length,l=c,u=!s;if(e==null)return!l;for(e=Object(e);c--;){var d=o[c];if(u&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++c<l;){d=o[c];var f=d[0],p=e[f],m=d[1];if(u&&d[2]){if(p===void 0&&!(f in e))return!1}else{var h=new n;if(s)var g=s(p,m,f,e,t,h);if(!(g===void 0?r(m,p,i|a,s,h):g))return!1}}return!0}t.exports=o})),gz=s(((e,t)=>{var n=II();function r(e){return e===e&&!n(e)}t.exports=r})),_z=s(((e,t)=>{var n=gz(),r=az();function i(e){for(var t=r(e),i=t.length;i--;){var a=t[i],o=e[a];t[i]=[a,o,n(o)]}return t}t.exports=i})),vz=s(((e,t)=>{function n(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}}t.exports=n})),yz=s(((e,t)=>{var n=hz(),r=_z(),i=vz();function a(e){var t=r(e);return t.length==1&&t[0][2]?i(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}t.exports=a})),bz=s(((e,t)=>{var n=LR(),r=qI(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function o(e,t){if(n(e))return!1;var o=typeof e;return o==`number`||o==`symbol`||o==`boolean`||e==null||r(e)?!0:a.test(e)||!i.test(e)||t!=null&&e in Object(t)}t.exports=o})),xz=s(((e,t)=>{var n=CR(),r=`Expected a function`;function i(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(r);var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(i.Cache||n),a}i.Cache=n,t.exports=i})),Sz=s(((e,t)=>{var n=xz(),r=500;function i(e){var t=n(e,function(e){return i.size===r&&i.clear(),e}),i=t.cache;return t}t.exports=i})),Cz=s(((e,t)=>{var n=Sz(),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;t.exports=n(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,`$1`):n||e)}),t})})),wz=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=n})),Tz=s(((e,t)=>{var n=HI(),r=wz(),i=LR(),a=qI(),o=1/0,s=n?n.prototype:void 0,c=s?s.toString:void 0;function l(e){if(typeof e==`string`)return e;if(i(e))return r(e,l)+``;if(a(e))return c?c.call(e):``;var t=e+``;return t==`0`&&1/e==-o?`-0`:t}t.exports=l})),Ez=s(((e,t)=>{var n=Tz();function r(e){return e==null?``:n(e)}t.exports=r})),Dz=s(((e,t)=>{var n=LR(),r=bz(),i=Cz(),a=Ez();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),Oz=s(((e,t)=>{var n=qI(),r=1/0;function i(e){if(typeof e==`string`||n(e))return e;var t=e+``;return t==`0`&&1/e==-r?`-0`:t}t.exports=i})),kz=s(((e,t)=>{var n=Dz(),r=Oz();function i(e,t){t=n(t,e);for(var i=0,a=t.length;e!=null&&i<a;)e=e[r(t[i++])];return i&&i==a?e:void 0}t.exports=i})),Az=s(((e,t)=>{var n=kz();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r})),jz=s(((e,t)=>{function n(e,t){return e!=null&&t in Object(e)}t.exports=n})),Mz=s(((e,t)=>{var n=Dz(),r=WR(),i=LR(),a=qR(),o=JR(),s=Oz();function c(e,t,c){t=n(t,e);for(var l=-1,u=t.length,d=!1;++l<u;){var f=s(t[l]);if(!(d=e!=null&&c(e,f)))break;e=e[f]}return d||++l!=u?d:(u=e==null?0:e.length,!!u&&o(u)&&a(f,u)&&(i(e)||r(e)))}t.exports=c})),Nz=s(((e,t)=>{var n=jz(),r=Mz();function i(e,t){return e!=null&&r(e,t,n)}t.exports=i})),Pz=s(((e,t)=>{var n=mz(),r=Az(),i=Nz(),a=bz(),o=gz(),s=vz(),c=Oz(),l=1,u=2;function d(e,t){return a(e)&&o(t)?s(c(e),t):function(a){var o=r(a,e);return o===void 0&&o===t?i(a,e):n(t,o,l|u)}}t.exports=d})),Fz=s(((e,t)=>{function n(e){return e}t.exports=n})),Iz=s(((e,t)=>{function n(e){return function(t){return t?.[e]}}t.exports=n})),Lz=s(((e,t)=>{var n=kz();function r(e){return function(t){return n(t,e)}}t.exports=r})),Rz=s(((e,t)=>{var n=Iz(),r=Lz(),i=bz(),a=Oz();function o(e){return i(e)?n(a(e)):r(e)}t.exports=o})),zz=s(((e,t)=>{var n=yz(),r=Pz(),i=Fz(),a=LR(),o=Rz();function s(e){return typeof e==`function`?e:e==null?i:typeof e==`object`?a(e)?r(e[0],e[1]):n(e):o(e)}t.exports=s})),Bz=s(((e,t)=>{function n(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}t.exports=n})),Vz=s(((e,t)=>{function n(e){return e!==e}t.exports=n})),Hz=s(((e,t)=>{function n(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}t.exports=n})),Uz=s(((e,t)=>{var n=Bz(),r=Vz(),i=Hz();function a(e,t,a){return t===t?i(e,t,a):n(e,r,a)}t.exports=a})),Wz=s(((e,t)=>{var n=Uz();function r(e,t){return!!(e!=null&&e.length)&&n(e,t,0)>-1}t.exports=r})),Gz=s(((e,t)=>{function n(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}t.exports=n})),Kz=s(((e,t)=>{function n(){}t.exports=n})),qz=s(((e,t)=>{var n=uz(),r=Kz(),i=PR();t.exports=n&&1/i(new n([,-0]))[1]==1/0?function(e){return new n(e)}:r})),Jz=s(((e,t)=>{var n=OR(),r=Wz(),i=Gz(),a=AR(),o=qz(),s=PR(),c=200;function l(e,t,l){var u=-1,d=r,f=e.length,p=!0,m=[],h=m;if(l)p=!1,d=i;else if(f>=c){var g=t?null:o(e);if(g)return s(g);p=!1,d=a,h=new n}else h=t?[]:m;outer:for(;++u<f;){var _=e[u],v=t?t(_):_;if(_=l||_!==0?_:0,p&&v===v){for(var y=h.length;y--;)if(h[y]===v)continue outer;t&&h.push(v),m.push(_)}else d(h,v,l)||(h!==m&&h.push(v),m.push(_))}return m}t.exports=l})),Yz=l(s(((e,t)=>{var n=zz(),r=Jz();function i(e,t){return e&&e.length?r(e,n(t,2)):[]}t.exports=i}))(),1),Xz=new WeakMap,Zz=new WeakMap,Qz=`data-a1-flight-combobox-open`;function $z(e){let t=Zz.get(e);t!=null&&(clearTimeout(t),Zz.delete(e));let n=(Xz.get(e)??0)+1;Xz.set(e,n),e.setAttribute(Qz,``)}function eB(e){let t=Math.max(0,(Xz.get(e)??0)-1);if(t===0){Xz.delete(e);let t=Zz.get(e);t!=null&&clearTimeout(t);let n=window.setTimeout(()=>{Zz.delete(e),e.removeAttribute(Qz)},400);Zz.set(e,n)}else Xz.set(e,t)}function tB({items:e,selectedItems:t,onInputChange:n,onSelectedItemsChange:r,fieldLabel:i,inputId:a,required:o=!1,placeholder:s,icon:c,disabled:l,shadowRoot:u,dataTestId:d}){let[f,p]=(0,G.useState)(``),[m,h]=(0,G.useState)(``),g=(0,G.useRef)(null),_=(0,G.useRef)(null),v=(0,G.useId)(),y=(0,G.useId)(),b=a??y,x=(0,G.useId)(),S=(0,G.useId)(),C=(0,G.useId)(),[w,T]=(0,G.useState)({}),E=u??null,D=(0,G.useCallback)(()=>{let e=g.current;if(!e)return;let t=e.getBoundingClientRect(),n=window.innerHeight-t.bottom-8,r=Math.max(120,Math.min(320,n-8)),i=t.left,a=t.width;i+a>window.innerWidth-8&&(i=Math.max(8,window.innerWidth-a-8)),T({position:`fixed`,top:t.bottom+8,left:i,width:a,maxHeight:r,zIndex:1e4})},[]),O=(0,G.useMemo)(()=>e.filter(e=>e.type===`airport`||e.type===`place`).reduce((e,t)=>{if(t.type===`airport`){let n=t,r=f.toLowerCase();if(n.iata_code.toLowerCase()===r||n.iata_display_list?.some(e=>e.toLowerCase()===r))return t.sectionIndex>=0?[...e,t]:[{...t,sectionIndex:-1},...e]}return[...e,t]},[]).reduce((e,t)=>t.type===`airport`?{items:[...e.items,t],airportCount:e.airportCount+1}:t.type===`place`?e.airportCount<20?{...e,items:[...e.items,t]}:e:e.airportCount<=20?{...e,items:[...e.items,t]}:e,{items:[],airportCount:0}).items,[f,e]);function k(e){return e.kayak?.stateCode&&e.kayak?.countryCode?`${e.name}, ${e.kayak.stateCode}, ${e.kayak.countryCode}`:e.kayak?.countryCode&&!e.kayak?.stateCode?`${e.name}, ${e.kayak.countryCode}`:e.formatted_address}function A(e){return e.state_code?`${e.city}, ${e.state_code}, ${e.country_code}`:e.location_display?e.location_display:`${e.city}, ${e.country_code}`}function j(e){return e.iata_display_list&&e.iata_display_list.length>0?e.iata_display_list.join(`, `):e.iata_code}function M(e){if(e.type===`airport`){let n=e;return t?.length>1?j(n):n.country_code===`US`?`${n.city} (${j(n)})`:`${n.city}, ${n.country_code} (${j(n)})`}if(e.type===`place`){let t=e;return t.formatted_address?.length<20?t.formatted_address:t.name}return``}function N(){let e=i?.trim().toLowerCase();return e?e.endsWith(`s`)?e:e===`destination`?`destinations`:e===`origin`?`origins`:`${e}s`:`locations`}function P(e){let t=M(e)||`Selection`;h(``),queueMicrotask(()=>{h(`${t} has been removed from the selected ${N()}.`)})}let ee=typeof Proxy==`function`&&!Object.isSealed(new Proxy({},{}));function F(e){let t=e.ownerDocument,n={document:t,addEventListener:t.addEventListener.bind(e),removeEventListener:t.removeEventListener.bind(e),Node:window.Node,Element:window.Element,HTMLElement:window.HTMLElement,SVGElement:window.SVGElement};return ee?new Proxy(n,{get(e,t){return e[t]}}):n}let{getSelectedItemProps:te,getDropdownProps:ne,removeSelectedItem:I}=lI({selectedItems:t,onStateChange({selectedItems:e,type:t}){t===lI.stateChangeTypes.FunctionRemoveSelectedItem&&r(e)}});function re(e){P(e),I(e)}let{isOpen:L,getMenuProps:ie,getInputProps:ae,getItemProps:oe,highlightedIndex:se,setHighlightedIndex:ce}=zF({environment:u?F(u):void 0,items:O,isItemDisabled(e){return!!e?.disabled},itemToKey(e){return e?.key??``},itemToString(e){return e?e.type===`airport`?M(e):e.name??``:``},defaultHighlightedIndex:0,selectedItem:null,inputValue:f,stateReducer(e,t){let{changes:n,type:r}=t;switch(r){case zF.stateChangeTypes.InputKeyDownEnter:case zF.stateChangeTypes.ItemClick:case zF.stateChangeTypes.InputKeyDownArrowDown:case zF.stateChangeTypes.InputKeyDownArrowUp:case zF.stateChangeTypes.InputBlur:case zF.stateChangeTypes.InputKeyDownEscape:return n;case zF.stateChangeTypes.ItemMouseMove:return e;case zF.stateChangeTypes.FunctionCloseMenu:return{...n,isOpen:!0};default:return n}},onStateChange({inputValue:e,type:t,selectedItem:n}){switch(t){case zF.stateChangeTypes.InputKeyDownEnter:case zF.stateChangeTypes.ItemClick:n&&(r([n]),p(``));break;case zF.stateChangeTypes.MenuMouseLeave:case zF.stateChangeTypes.ItemMouseMove:case zF.stateChangeTypes.InputKeyDownArrowDown:case zF.stateChangeTypes.InputKeyDownArrowUp:case zF.stateChangeTypes.InputBlur:case zF.stateChangeTypes.ControlledPropUpdatedSelectedItem:}}}),le=(0,G.useMemo)(()=>{if(l)return`Field is locked.`;if(L&&O.length>0){let e=O.length;return`Suggestion list open, ${e} ${e===1?`option`:`options`}.`}return L&&O.length===0?f.trim()?`Suggestion list open, no matching options.`:`Suggestion list open, no options yet.`:`Suggestion list closed.`},[l,L,O.length,f]),R=(0,G.useMemo)(()=>`Type to search airports and places. When the list is open, use arrow keys to move through suggestions and Enter to choose. Tab to selected locations above to remove them, or press Backspace in this field when it is empty.`,[]),ue=i?`${i}, search airports and places`:`Search airports and places`,de=i?`${i} suggestions`:`Search results`,fe=t.length===0?`No airport or place selected.`:(()=>{let e=t.map(e=>M(e));return`Selected ${t.length===1?`location`:`${t.length} locations`}: ${e.join(`, `)}.`})(),pe=[x,S,C].join(` `);(0,G.useEffect)(()=>{l&&queueMicrotask(()=>p(``))},[l]),(0,G.useLayoutEffect)(()=>{if(!L||O.length===0||!E)return;D();let e=g.current,t=e&&typeof ResizeObserver<`u`?new ResizeObserver(D):null;return e&&t?.observe(e),window.addEventListener(`scroll`,D,!0),window.addEventListener(`resize`,D),()=>{t?.disconnect(),window.removeEventListener(`scroll`,D,!0),window.removeEventListener(`resize`,D)}},[L,O.length,E,D]);let me=L&&O.length>0;(0,G.useEffect)(()=>{let e=u?.host;if(e instanceof HTMLElement&&me&&E)return $z(e),()=>eB(e)},[me,u,E]);let he=!!l;function ge(e,t){e.pointerType===`touch`&&(e.preventDefault(),e.stopPropagation(),r([t]),p(``),n(``))}function _e(){let e=ae({...ne(),id:b,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":L,"aria-controls":L?v:void 0,"aria-activedescendant":L&&se!=null&&se>-1?`${v}-${se}`:void 0,"aria-label":ue,onChange:e=>{let t=e.currentTarget.value;p(t),n(t)},onKeyDown:e=>{if(e.key===`Backspace`&&!f&&t.length>0&&!l){let e=t[t.length-1];re(e)}}});return(0,K.jsx)(`input`,{className:(0,q.default)(`aone:outline-none aone:disabled:bg-transparent aone:text-base aone:placeholder:text-gray-700 aone:placeholder:opacity-100`,{"aone:min-w-[120px] aone:max-w-[200px]":t.length>0,"aone:w-full":t.length===0}),placeholder:!he&&t.length===0?s:``,...e,"aria-required":o||void 0,"aria-describedby":pe,disabled:he})}let ve=(0,K.jsx)(`ul`,{...ie(),ref:_,id:v,role:`listbox`,"aria-multiselectable":`true`,"aria-label":de,tabIndex:-1,className:`aone:text-gray-900 aone:max-h-full aone:overflow-y-auto aone:overflow-x-hidden aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2`,children:O.map((e,n)=>{if(e.type===`airport`){let r=e,i=(r.distance||0)*.621371,a=se===n,o=e.sectionIndex>-1&&!r.kayak_shimmed,s=!!t.find(t=>t.key===e.key),c=n+1;return(0,K.jsxs)(`li`,{...oe({item:e,index:n,onPointerDown:t=>ge(t,e),onMouseEnter:()=>ce(n)}),id:`${v}-${n}`,role:`option`,tabIndex:-1,"aria-selected":s,"aria-label":`Option ${c} - ${r.name}, ${A(r)}, ${j(r)}${o?`, ${i.toFixed(+(i<1))} miles away`:``}, ${s?`selected`:`not selected`}`,className:(0,q.default)({"aone:hover:bg-blue-100":!0,"aone:bg-blue-100":a,"aone:font-bold":a,"aone:shadow-sm aone:py-2 aone:px-2 aone:cursor-pointer":!0,"aone:pl-5 aone:border-l-4 aone:border-gray-500":e.sectionIndex>-1,"aone:grid aone:grid-cols-[26px_1fr_30px] aone:gap-1 aone:justify-start aone:items-center":!0,"aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2":!0}),children:[(0,K.jsx)(iN,{className:`aone:w-6 aone:h-6 aone:-rotate-45 aone:text-gray-600`,icon:XE}),(0,K.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,K.jsxs)(`div`,{className:`aone:gap-2 aone:flex aone:items-center aone:w-full`,children:[(0,K.jsx)(`span`,{className:`aone:flex-1 aone:min-w-0 aone:font-medium aone:text-base aone:text-gray-900 aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:r.name}),(0,K.jsx)(`span`,{className:`aone:text-sm aone:uppercase aone:shrink-0 aone:text-gray-600`,children:j(r)})]}),(0,K.jsxs)(`span`,{className:`aone:text-sm aone:text-gray-600`,children:[A(r),o&&(0,K.jsxs)(K.Fragment,{children:[`\xA0•\xA0`,i.toFixed(+(i<1)),`mi`]})]})]}),(0,K.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-1`,"aria-hidden":`true`,children:(0,K.jsx)(`span`,{className:(0,q.default)(`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border aone:flex aone:items-center aone:justify-center`,{"aone:border-gray-700 aone:bg-white":!s,"aone:border-primary aone:bg-primary":s}),children:s?(0,K.jsx)(iN,{icon:GE,className:`aone:h-2.5 aone:w-2.5 aone:text-white`}):null})})]},`${e.key}-${n}`)}if(e.type===`place`){let r=e,i=se===n,a=_p(r.kayak?.apicode),o=k(r),s=!!t.find(t=>t.key===e.key);return(0,K.jsxs)(`li`,{...oe({item:e,index:n,onPointerDown:t=>ge(t,e),onMouseEnter:()=>ce(n)}),id:`${v}-${n}`,role:`option`,tabIndex:-1,"aria-selected":s,"aria-label":`${a?`${r.name}, ${a}, ${o}`:`${r.name}, ${o}`}, ${s?`selected`:`not selected`}`,className:(0,q.default)({"aone:hover:bg-blue-100":!0,"aone:bg-blue-100":i,"aone:font-bold":i,"aone:shadow-sm aone:py-2 aone:px-2 aone:cursor-pointer":!0,"aone:grid aone:grid-cols-[26px_1fr_30px] aone:gap-1 aone:justify-start aone:items-center":!0,"aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2":!0}),children:[(0,K.jsx)(iN,{className:`aone:w-6 aone:h-6 aone:text-gray-600`,icon:rD}),(0,K.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,K.jsxs)(`div`,{className:`aone:gap-2 aone:flex aone:items-end aone:w-full`,children:[(0,K.jsx)(`span`,{className:`aone:flex-1 aone:min-w-0 aone:font-medium aone:text-base aone:text-gray-900 aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:r.name}),a&&(0,K.jsx)(`span`,{className:`aone:text-sm aone:uppercase aone:shrink-0 aone:text-gray-600`,children:a})]}),(0,K.jsx)(`span`,{className:`aone:text-sm aone:shrink-0 aone:text-gray-600`,children:o})]}),(0,K.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-1`,"aria-hidden":`true`,children:(0,K.jsx)(`span`,{className:(0,q.default)(`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border aone:flex aone:items-center aone:justify-center`,{"aone:border-gray-700 aone:bg-white":!s,"aone:border-primary aone:bg-primary":s}),children:s?(0,K.jsx)(iN,{icon:GE,className:`aone:h-2.5 aone:w-2.5 aone:text-white`}):null})})]},`${e.key}-${n}`)}return null})});return(0,K.jsxs)(`div`,{className:`aone:w-full aone:h-full aone:relative aone:z-10`,"data-testid":d,role:`group`,"aria-disabled":l?!0:void 0,children:[i?(0,K.jsxs)(`label`,{htmlFor:b,className:`aone:sr-only`,children:[i,o?` (required)`:``]}):null,(0,K.jsxs)(`div`,{ref:g,className:(0,q.default)({"aone:bg-white aone:text-gray-900 aone:rounded-lg aone:gap-2 aone:items-center aone:py-2 aone:px-3 aone:h-[44px] aone:box-border aone:w-full aone:overflow-hidden":!0,"aone:grid":!0,"aone:grid-cols-[24px_1fr]":t.length===0,"aone:grid-cols-[24px_auto_1fr]":t.length===1,"aone:grid-cols-[24px_auto_auto_1fr]":t.length===2,"aone:grid-cols-[24px_auto_auto_auto_1fr]":t.length===3,"aone:border-2 aone:border-gray-200 aone:focus-within:border-primary":!0,"aone:opacity-60 aone:cursor-not-allowed":!!l}),children:[c,t.map((e,n)=>(0,K.jsxs)(`span`,{...te({selectedItem:e,index:n}),"aria-label":`Selected location: ${M(e)}. Item ${n+1} of ${t.length}.`,className:(0,q.default)({"aone:bg-gray-200 aone:rounded aone:px-1 aone:focus:bg-gray-400 aone:whitespace-nowrap aone:text-ellipsis aone:shrink-0":!0,"aone:text-sm":t.length>0,"aone:flex aone:items-center":!0}),children:[(0,K.jsx)(`span`,{className:`aone:overflow-hidden aone:grow aone:font-medium`,children:M(e)}),!e.disabled&&(0,K.jsx)(`button`,{type:`button`,disabled:!!l||!!e.disabled,className:(0,q.default)(`aone:ml-2 aone:text-base aone:leading-[20px] aone:rounded aone:px-1 aone:transition-colors`,{"aone:hover:bg-gray-300 aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-offset-2 aone:focus-visible:ring-gray-700":!l&&!e.disabled,"aone:cursor-not-allowed aone:opacity-60":!!l}),"data-testid":`autocomplete-remove-item-button`,"aria-label":`Remove ${M(e)}`,onClick:t=>{t.stopPropagation(),!l&&re(e)},children:`×`})]},n)),(0,K.jsx)(`span`,{id:x,className:`aone:sr-only`,children:fe}),(0,K.jsx)(`span`,{id:S,className:`aone:sr-only`,children:le}),(0,K.jsx)(`span`,{id:C,className:`aone:sr-only`,children:R}),_e()]}),(0,K.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`aone:sr-only`,children:m}),L&&O.length>0&&(E?(0,cv.createPortal)((0,K.jsx)(`div`,{className:`aone:bg-white aone:text-gray-900 aone:rounded-lg aone:overflow-hidden aone:shadow-md aone:p-0 aone:box-border`,style:w,children:ve}),E):(0,K.jsx)(`div`,{className:`aone:absolute aone:w-inherit aone:bg-white aone:text-gray-900 aone:mt-2 aone:rounded-lg aone:overflow-hidden aone:shadow-md aone:p-0 aone:z-10`,children:ve}))]})}var nB=100;function rB({items:e,selectedItems:t,onInputChange:n,onSelectedItemsChange:r,fieldLabel:i,inputId:a,required:o=!1,placeholder:s,icon:c,disabled:l,shadowRoot:u}){let[d,f]=(0,G.useState)(``),[p,m]=(0,G.useState)(!1),[h,g]=(0,G.useState)(``),_=(0,G.useRef)(null),v=(0,G.useId)(),y=(0,G.useId)(),b=a??y,x=(0,G.useRef)(null),S=(0,G.useMemo)(()=>e=>{x.current&&clearTimeout(x.current),e.trim()&&m(!0),x.current=setTimeout(()=>{n(e),m(!1),x.current=null},300)},[n]),C=(0,G.useMemo)(()=>{if(!e||e.length===0)return[];let t=new Date(new Date().getTime()+2592e6),n=new Set,r=e.reduce((e,r)=>{if(n.has(r.key))return e;let i=`routeStart`in r&&r.routeStart&&r.routeStart>t?{...r,isNewRoute:!0}:r;return n.add(r.key),[...e,i]},[]);if(d?.trim()){let e=d.toLowerCase().trim();r=r.filter(t=>{let n=t;return!!(n.iata_code?.toLowerCase().includes(e)||n.city?.toLowerCase().includes(e)||n.name?.toLowerCase().includes(e)||n.country_code?.toLowerCase().includes(e)||n.state?.toLowerCase().includes(e))}),r.sort((t,n)=>{let r=t,i=n,a=r.iata_code?.toLowerCase()||``,o=i.iata_code?.toLowerCase()||``,s=r.city?.toLowerCase()||``,c=i.city?.toLowerCase()||``,l=e.toLowerCase();return a===l&&o!==l?-1:o===l&&a!==l?1:a.startsWith(l)&&!o.startsWith(l)?-1:o.startsWith(l)&&!a.startsWith(l)?1:s.startsWith(l)&&!c.startsWith(l)?-1:c.startsWith(l)&&!s.startsWith(l)?1:a.includes(l)&&!o.includes(l)?-1:o.includes(l)&&!a.includes(l)?1:0})}else r=r.slice(0,250);return r.sort((e,t)=>{let n=e,r=t,i=n.city?.toLowerCase()||``,a=r.city?.toLowerCase()||``;if(i===a){let e=n.iata_code?.toLowerCase()||``,t=r.iata_code?.toLowerCase()||``;return e.localeCompare(t)}return i.localeCompare(a)}),r.slice(0,nB)},[d,e]),w=(0,G.useMemo)(()=>{let e={};return C.forEach((t,n)=>{if(t.type===`airport`){let r=t.city?.charAt(0).toUpperCase();r&&!e[r]&&(e[r]=n)}}),e},[C]),T=e=>{let t=w[e];if(t===void 0||!_.current)return;let n=_.current.querySelector(`ul`);if(!n)return;let r=n.children[t];if(!r)return;let i=n.getBoundingClientRect(),a=r.getBoundingClientRect(),o=n.scrollTop,s=a.top-i.top+o;n.scrollTo({top:s,behavior:`smooth`})},E=(0,G.useMemo)(()=>Array.from({length:26},(e,t)=>String.fromCharCode(65+t)),[]),D=(e,t)=>{e.preventDefault(),e.stopPropagation(),T(t)},O=e=>{let n=e;if(t.length>1)return n.iata_code||``;let r=n.country===`US`&&n.state?`, ${n.state}`:``;return`${n.city}${r} (${n.iata_code})`},k=e=>{let t=e.ownerDocument,n=typeof Proxy==`function`&&!Object.isSealed(new Proxy({},{})),r={document:t,addEventListener:t.addEventListener.bind(e),removeEventListener:t.removeEventListener.bind(e),Node:window.Node,Element:window.Element,HTMLElement:window.HTMLElement,SVGElement:window.SVGElement};return n?new Proxy(r,{get(e,t){return e[t]}}):r},{getSelectedItemProps:A,getDropdownProps:j,removeSelectedItem:M}=lI({selectedItems:t,onStateChange({selectedItems:e,type:t}){t===lI.stateChangeTypes.FunctionRemoveSelectedItem&&r(e)}});function N(){let e=i?.trim().toLowerCase();return e?e.endsWith(`s`)?e:e===`destination`?`destinations`:e===`origin`?`origins`:`${e}s`:`locations`}function P(e){let t=O(e)||`Selection`;g(``),queueMicrotask(()=>{g(`${t} has been removed from the selected ${N()}.`)})}function ee(e){P(e),M(e)}let{isOpen:F,getMenuProps:te,getInputProps:ne,getItemProps:I,selectedItem:re}=zF({environment:u?k(u):void 0,items:C,itemToString:e=>e?O(e):``,defaultHighlightedIndex:0,selectedItem:null,inputValue:d,onStateChange({inputValue:e,type:t,selectedItem:n}){switch(t){case zF.stateChangeTypes.InputKeyDownEnter:case zF.stateChangeTypes.ItemClick:n&&(r([n]),f(``));break;case zF.stateChangeTypes.InputChange:{let t=e??``;f(t),S(t);break}case zF.stateChangeTypes.InputBlur:}}}),L=!!l,ie=t.length>0,ae=(F||d.trim()&&C.length>0)&&C.length>10&&Object.keys(w).length>3,oe=F||d.trim().length>0&&C.length>0;(0,G.useEffect)(()=>{let e=u?.host;if(e instanceof HTMLElement&&oe)return $z(e),()=>eB(e)},[oe,u]);let se=i?`${i}, search airports and places`:`Search airports and places`;return(0,K.jsxs)(`div`,{className:`aone:w-full aone:h-full aone:relative aone:z-10`,role:`group`,"aria-disabled":l?!0:void 0,children:[i?(0,K.jsxs)(`label`,{htmlFor:b,className:`aone:sr-only`,children:[i,o?` (required)`:``]}):null,(0,K.jsxs)(`div`,{className:(0,q.default)({"aone:bg-white aone:text-gray-700 aone:rounded-lg aone:gap-2 aone:items-center aone:py-2 aone:px-3 aone:h-[44px] aone:box-border aone:w-full aone:overflow-hidden aone:grid":!0,"aone:grid-cols-[24px_1fr]":t.length===0,"aone:grid-cols-[24px_auto_1fr]":t.length===1,"aone:grid-cols-[24px_auto_auto_1fr]":t.length===2,"aone:grid-cols-[24px_auto_auto_auto_1fr]":t.length===3,"aone:border-2 aone:border-gray-200 aone:focus-within:border-primary":!0,"aone:opacity-60 aone:cursor-not-allowed":!!l}),children:[c,t.map((e,t)=>(0,K.jsxs)(`span`,{...A({selectedItem:e,index:t}),className:`aone:bg-gray-200 aone:rounded aone:px-1 aone:focus:bg-gray-400 aone:whitespace-nowrap aone:text-ellipsis aone:shrink-0 aone:text-sm aone:flex aone:items-center`,children:[(0,K.jsx)(`span`,{className:`aone:overflow-hidden aone:grow`,children:O(e)}),!e.disabled&&(0,K.jsx)(`button`,{type:`button`,disabled:!!l||!!e.disabled,className:(0,q.default)(`aone:ml-2 aone:text-base aone:leading-[20px] aone:rounded aone:px-1 aone:transition-colors`,{"aone:hover:bg-gray-300 aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-offset-2 aone:focus-visible:ring-gray-700":!l&&!e.disabled,"aone:cursor-not-allowed aone:opacity-60":!!l}),"aria-label":`Remove ${O(e)}`,"data-testid":`schedule-autocomplete-remove-item-button`,onClick:t=>{t.stopPropagation(),!l&&ee(e)},children:`×`})]},t)),l&&(0,K.jsx)(`span`,{id:v,className:`aone:sr-only`,children:`Field is locked`}),(()=>{let e=ne({...j({preventKeyAction:F}),id:b,role:`combobox`,"aria-label":se,onKeyDown:e=>{if(e.key===`Backspace`&&!d&&t.length>0&&!l){let e=t[t.length-1];ee(e)}}});return(0,K.jsx)(`input`,{className:`aone:outline-none aone:disabled:bg-transparent aone:text-base aone:placeholder:text-gray-700 aone:placeholder:opacity-100`,placeholder:L?``:s,...e,"aria-required":o||void 0,"aria-describedby":l?v:void 0,readOnly:ie,disabled:L})})()]}),(0,K.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`aone:sr-only`,children:h}),(F||d.trim()&&C.length>0)&&(0,K.jsx)(`div`,{className:`aone:absolute aone:w-full aone:min-w-full aone:bg-white aone:text-gray-900 aone:mt-2 aone:rounded-lg aone:shadow-md aone:p-0 aone:z-10`,children:(0,K.jsx)(`div`,{className:`aone:relative aone:w-full aone:overflow-hidden`,children:(0,K.jsxs)(`div`,{...te({className:`aone:flex aone:flex-col aone:min-w-0 aone:overflow-hidden`}),children:[ae&&(0,K.jsx)(`div`,{className:`aone:flex aone:flex-wrap aone:gap-x-0.5 aone:gap-y-1 aone:justify-center aone:border-b aone:border-gray-200 aone:bg-gray-50 aone:px-2 aone:py-1.5`,role:`navigation`,"aria-label":`Jump to results by letter`,children:E.map(e=>{let t=w[e]!==void 0;return(0,K.jsx)(`button`,{type:`button`,onClick:n=>t?D(n,e):void 0,className:(0,q.default)({"aone:min-w-5 aone:text-xs aone:font-medium aone:px-0.5 aone:py-0.5 aone:rounded aone:transition-colors aone:cursor-pointer aone:text-center aone:shrink-0 aone:leading-none":!0,"aone:text-gray-600 aone:hover:text-blue-600 aone:hover:bg-blue-50":t,"aone:text-gray-300 aone:cursor-default":!t}),"data-testid":`schedule-autocomplete-letter-${e.toLowerCase()}`,title:t?`Jump to ${e}`:`No results for ${e}`,disabled:!t,children:e},e)})}),(0,K.jsx)(`div`,{className:`aone:min-w-0`,ref:_,children:(0,K.jsxs)(`ul`,{className:`aone:text-gray-900 aone:max-h-[600px] aone:overflow-y-auto aone:overflow-x-hidden aone:w-full`,children:[p&&(0,K.jsx)(`li`,{className:`aone:py-4 aone:px-3 aone:text-center aone:text-gray-500`,children:(0,K.jsxs)(`div`,{className:`aone:flex aone:items-center aone:justify-center aone:gap-2`,children:[(0,K.jsx)(`div`,{className:`aone:animate-spin aone:rounded-full aone:h-4 aone:w-4 aone:border-b-2 aone:border-primary`}),(0,K.jsx)(`span`,{children:`Searching airports...`})]})}),!p&&C.length>0&&C.map((e,n)=>{let r=e;return(0,K.jsxs)(`li`,{...I({item:e,index:n}),className:(0,q.default)({"aone:shadow-sm aone:py-2 aone:pl-3 aone:pr-2 aone:cursor-pointer aone:grid aone:grid-cols-[26px_1fr_40px] aone:gap-2 aone:justify-start aone:items-center aone:relative":!0,"aone:font-bold":re===e}),children:[(0,K.jsx)(`div`,{className:`aone:w-6 aone:h-6 aone:relative aone:flex aone:items-center aone:justify-center`,children:r.airlineCodes&&r.airlineCodes.length>0&&(0,K.jsx)(K.Fragment,{children:r.airlineCodes.length===1?(0,K.jsx)(`img`,{src:`https://content.r9cdn.net/rimg/provider-logos/airlines/v/${r.airlineCodes[0]}.png`,alt:r.airlineCodes[0],className:`aone:w-6 aone:h-6 aone:object-contain`},r.airlineCodes[0]):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(iN,{icon:BE,className:`aone:w-6 aone:h-6 aone:text-gray-600`,title:`${r.airlineCodes.length} airlines`}),(0,K.jsx)(`span`,{className:`aone:absolute aone:right-0 aone:bg-blue-600 aone:text-white aone:text-[9px] aone:font-semibold aone:leading-none aone:px-1 aone:py-0.5 aone:rounded-full aone:min-w-[16px] aone:h-[16px] aone:flex aone:items-center aone:justify-center aone:shadow-sm aone:border aone:border-white`,style:{bottom:`-8px`},title:`${r.airlineCodes.length} airlines`,children:r.airlineCodes.length})]})})}),(0,K.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,K.jsx)(`div`,{className:`aone:gap-2 aone:flex aone:items-end`,children:(0,K.jsxs)(`span`,{className:(0,q.default)({"aone:font-medium aone:text-sm aone:text-gray-900 aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis aone:shrink":!0}),children:[r.city,r.country_code===`US`&&r.state?`, ${r.state}`:``]})}),(0,K.jsxs)(`span`,{className:(0,q.default)({"aone:text-sm aone:text-gray-600":!0}),children:[r.iata_code,` -`,` `,r.stops===0?`Nonstop Flight`:`One Stop`,`routeStart`in r&&r.routeStart&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`br`,{}),(0,K.jsx)(`span`,{className:(0,q.default)({"aone:text-sm aone:font-bold aone:text-green-600 aone:whitespace-nowrap":!0}),children:e.isNewRoute?`Route Starts `+r.routeStart.toLocaleDateString(`en-US`,{month:`2-digit`,day:`2-digit`,year:`2-digit`}):``})]})]})]}),(0,K.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-4`,children:(0,K.jsx)(`input`,{type:`checkbox`,className:`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border aone:border-gray-700 aone:bg-white`,defaultChecked:!!t.find(t=>t.key===e.key)})})]},`${e.key}-${n}`)}),!p&&C.length===0&&d.trim()&&(0,K.jsxs)(`li`,{className:`aone:shadow-sm aone:py-2 aone:pl-3 aone:pr-2 aone:grid aone:grid-cols-[26px_1fr_40px] aone:gap-2 aone:justify-start aone:items-center`,children:[(0,K.jsx)(`div`,{className:`aone:w-6 aone:h-6 aone:relative aone:flex aone:items-center aone:justify-center`,children:(0,K.jsx)(iN,{icon:XE,className:`aone:w-5 aone:h-5 aone:text-gray-300`})}),(0,K.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,K.jsxs)(`span`,{className:`aone:font-medium aone:text-sm aone:text-gray-900 aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:[`No airports found for`,(0,K.jsx)(`span`,{className:`aone:ml-1 aone:font-semibold`,children:d})]}),(0,K.jsx)(`span`,{className:`aone:text-sm aone:text-gray-600`,children:`Try a different search term`})]}),(0,K.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-4`})]})]})})]})})})]})}function iB(...e){return _E(Hw(e))}function aB({className:e,...t}){return(0,K.jsx)(I_,{role:`status`,"aria-label":`Loading`,className:iB(`aone:size-4 aone:animate-spin`,e),...t})}var oB=G.forwardRef(({open:e,onOpenChange:t,children:n,title:r,className:i,...a},o)=>{let s=(0,G.useRef)(null);return(0,G.useImperativeHandle)(o,()=>s.current),(0,G.useEffect)(()=>{let n=s.current;if(!n)return;e&&!n.open&&n.showModal(),!e&&n.open&&n.close();let r=()=>document.documentElement.style.overflow=`hidden`,i=()=>document.documentElement.style.removeProperty(`overflow`);e?r():i();let a=()=>{i(),t(!1)},o=e=>{e.preventDefault(),t(!1)};return n.addEventListener(`close`,a),n.addEventListener(`cancel`,o),()=>{n.removeEventListener(`close`,a),n.removeEventListener(`cancel`,o),i()}},[e,t]),(0,K.jsxs)(`dialog`,{ref:s,className:`ao-dialog ${i??``}`,...a,children:[r&&(0,K.jsx)(`h2`,{id:`ao-title`,className:`aone:text-lg aone:font-semibold`,children:r}),(0,K.jsx)(`div`,{className:`ao-dialog__body`,children:n})]})});oB.displayName=`TopLayerDialog`;function sB({...e}){return(0,K.jsx)(vx,{"data-slot":`dialog`,...e})}function cB({...e}){return(0,K.jsx)(Sx,{"data-slot":`dialog-portal`,...e})}function lB({className:e,...t}){return(0,K.jsx)(wx,{"data-slot":`dialog-overlay`,className:vE(`aone:fixed aone:inset-0 aone:z-50 aone:bg-black/50 aone:data-[state=closed]:animate-out aone:data-[state=closed]:fade-out-0 aone:data-[state=open]:animate-in aone:data-[state=open]:fade-in-0`,e),...t})}function uB({className:e,children:t,showCloseButton:n=!0,portalContainer:r,overlayClassName:i,...a}){return(0,K.jsxs)(cB,{container:r??void 0,"data-slot":`dialog-portal`,children:[(0,K.jsx)(lB,{className:i}),(0,K.jsxs)(Ox,{"data-slot":`dialog-content`,className:vE(`aone:fixed aone:top-[50%] aone:left-[50%] aone:z-50 aone:grid aone:w-full aone:max-w-[calc(100%-2rem)] aone:translate-x-[-50%] aone:translate-y-[-50%] aone:gap-4 aone:rounded-lg aone:border aone:bg-background aone:p-6 aone:shadow-lg aone:duration-200 aone:outline-none aone:data-[state=closed]:animate-out aone:data-[state=closed]:fade-out-0 aone:data-[state=closed]:zoom-out-95 aone:data-[state=open]:animate-in aone:data-[state=open]:fade-in-0 aone:data-[state=open]:zoom-in-95 aone:sm:max-w-lg`,e),...a,children:[t,n&&(0,K.jsxs)(Px,{"data-slot":`dialog-close`,className:`aone:absolute aone:top-4 aone:right-4 aone:z-60 aone:pointer-events-auto aone:rounded-xs aone:bg-white/90 aone:opacity-70 aone:ring-offset-background aone:transition-opacity aone:hover:opacity-100 aone:focus:outline-hidden aone:disabled:pointer-events-none aone:data-[state=open]:bg-accent aone:data-[state=open]:text-muted-foreground aone:[&_svg]:pointer-events-none aone:[&_svg]:shrink-0 aone:[&_svg:not([class*=size-])]:size-4`,children:[(0,K.jsx)(z_,{}),(0,K.jsx)(`span`,{className:`aone:sr-only`,children:`Close`})]})]})]})}function dB({className:e,...t}){return(0,K.jsx)(Mx,{"data-slot":`dialog-title`,className:vE(`aone:text-lg aone:leading-none aone:font-semibold`,e),...t})}function fB({...e}){return(0,K.jsx)(ww,{"data-slot":`popover`,...e})}function pB({className:e,align:t=`center`,sideOffset:n=4,portalContainer:r,...i}){return(0,K.jsx)(Mw,{container:r,children:(0,K.jsx)(Pw,{"data-slot":`popover-content`,align:t,sideOffset:n,className:vE(`aone:z-50 aone:w-72 aone:origin-(--radix-popover-content-transform-origin) aone:rounded-md aone:border aone:bg-popover aone:p-4 aone:text-popover-foreground aone:shadow-md aone:outline-hidden aone:data-[side=bottom]:slide-in-from-top-2 aone:data-[side=left]:slide-in-from-right-2 aone:data-[side=right]:slide-in-from-left-2 aone:data-[side=top]:slide-in-from-bottom-2 aone:data-[state=closed]:animate-out aone:data-[state=closed]:fade-out-0 aone:data-[state=closed]:zoom-out-95 aone:data-[state=open]:animate-in aone:data-[state=open]:fade-in-0 aone:data-[state=open]:zoom-in-95`,e),...i})})}function mB({...e}){return(0,K.jsx)(Ew,{"data-slot":`popover-anchor`,...e})}var hB=768;function gB(){let[e,t]=G.useState(()=>typeof window<`u`&&window.innerWidth<hB);return G.useEffect(()=>{let e=window.matchMedia(`(max-width: 767px)`),n=()=>{t(window.innerWidth<hB)};return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}var _B=`aone:text-[#16A34A]`,vB=`aone:text-[#5895F7]`;function yB({date:e,startDate:t,endDate:n,onChange:r,onHover:i,stops:a,onlyDirects:o,previewDate:s,referenceDates:c,minDate:l}){let u=xl(new Date),d=l||u,f=t?Tl(e,t):!1,p=t&&n?bu(e,xl(t))&&xu(e,n):!1,m=n?Tl(e,n):!1,h=xu(e,d),g=s&&!f&&!m?Tl(e,s):!1,_=c?.filter(t=>Tl(xl(e),xl(t.date)))||[],v=!1,y=o&&a!==0?null:a;return o&&a!==0&&(v=!0),(0,K.jsx)(`div`,{className:(0,q.default)({"aone:w-14 aone:h-14 aone:flex aone:flex-col aone:items-center aone:justify-start aone:cursor-pointer":!0,"aone:text-white":f||m,"aone:bg-gray-600 aone:rounded-sm":f||m,"aone:bg-gray-200":p&&!!t&&!!n,"aone:text-[#565656]":!f&&!m,"aone:ring-2 aone:ring-primary":g,"aone:ring-2 aone:ring-blue-500 aone:ring-opacity-75 aone:bg-blue-50":_.length>0&&!f&&!m,"aone:cursor-not-allowed":h||v,"aone:relative aone:hover:ring-2 aone:hover:ring-blue-500 aone:hover:rounded-sm":!h&&!v,"aone:relative aone:after:absolute aone:after:bg-gray-600 aone:after:top-0 aone:after:bottom-0 aone:after:left-0 aone:after:right-0 aone:after:rounded-sm":f,"aone:before:absolute aone:before:left-1/2 aone:before:right-0 aone:before:top-0 aone:before:bottom-0 aone:before:bg-gray-200":f&&!!n,"aone:rounded-none":p,"aone:relative aone:after:absolute aone:after:bg-gray-600 aone:after:top-0 aone:after:bottom-0 aone:after:left-0 aone:after:right-0 aone:after:rounded-sm aone:before:absolute aone:before:left-0 aone:before:right-1/2 aone:before:top-0 aone:before:bottom-0 aone:before:bg-gray-200":m}),role:`gridcell`,tabIndex:!h&&!v?0:-1,"aria-label":(()=>{let t=`${e.toLocaleDateString(`en-US`,{weekday:`long`})}, ${e.toLocaleDateString(`en-US`,{month:`long`})} ${e.getDate()}, ${e.getFullYear()}`;if(f?t+=`, selected as start date`:m?t+=`, selected as end date`:p?t+=`, within selected date range`:g&&(t+=`, preview date`),h?t+=`, not available (before minimum date)`:v&&(t+=`, not available (no direct flights)`),y===0?t+=`, direct flights available`:y===1&&(t+=`, one-stop flights available`),_.length>0){let e=_.map(e=>e.label).join(`, `);t+=`, reference dates: ${e}`}return t})(),"aria-selected":f||m||p,"aria-disabled":h||v,"data-preview":g?`true`:void 0,onClick:()=>{!h&&!v&&r(new Date(e))},onMouseOver:()=>{!h&&!v&&i(new Date(e))},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&!h&&!v&&(t.preventDefault(),r(new Date(e)))},children:(0,K.jsxs)(`span`,{className:(0,q.default)({"aone:relative aone:z-20 aone:font-semibold aone:leading-[16px] aone:flex aone:flex-col aone:justify-start aone:items-center aone:gap-1 aone:pt-2":!0,"aone:opacity-50":h||v}),children:[(0,K.jsx)(`span`,{children:e.getDate()}),y===0&&(0,K.jsx)(`span`,{className:(0,q.default)({"aone:text-[9px] aone:font-light aone:leading-none aone:whitespace-nowrap":!0,[_B]:!0}),"aria-label":`Nonstop flights available`,children:`Nonstop`}),y===1&&(0,K.jsx)(`span`,{className:(0,q.default)({"aone:text-[9px] aone:font-light aone:leading-none aone:whitespace-nowrap":!0,[vB]:!0}),"aria-label":`One-stop flights available`,children:`1 Stop`}),_.map((e,t)=>(0,K.jsx)(`div`,{className:(0,q.default)({"aone:text-[10px] aone:font-light aone:text-blue-700 aone:leading-tight aone:bg-blue-100 aone:px-1 aone:rounded aone:whitespace-nowrap":!0}),"aria-label":`Reference date: ${e.label}`,children:e.label},`${e.label}-${t}`))]})})}function bB({origin:e,previewDate:t,initialDate:n,startDate:r,endDate:i,oneWay:a,onlyDirects:o,onMonthViewChange:s,onChange:c,flightCalendar:l,referenceDates:u,minDate:d}){let[f,p]=(0,G.useState)(Ol(n)),m=gu(f,`MMMM yyyy`),h=gl(f),g=a?null:i;(0,G.useEffect)(()=>{r&&queueMicrotask(()=>p(Ol(r)))},[r]),(0,G.useEffect)(()=>{t&&queueMicrotask(()=>p(Ol(t)))},[t]),(0,G.useEffect)(()=>{let e=gl(f);s(e,dl(e,42))},[f,s]);let _=Array(42).fill(0).map((e,t)=>dl(h,t));return(0,K.jsxs)(`div`,{className:`aone:w-max aone:max-[767px]:w-full aone:text-[14px] aone:max-w-[100vw] aone:md:px-2 aone:md:pt-2 aone:lg:m-2`,role:`application`,"aria-label":`Calendar`,children:[(0,K.jsx)(`div`,{className:`aone:px-3 aone:py-1 aone:md:px-4 aone:md:py-2 aone:flex aone:gap-4`,children:(0,K.jsxs)(`div`,{className:`aone:flex aone:flex-grow aone:justify-between aone:items-center aone:text-gray-700`,children:[(0,K.jsx)(`button`,{type:`button`,className:`aone:w-8 aone:h-8 aone:bg-white aone:rounded-full aone:flex aone:items-center aone:justify-center aone:text-gray-700 aone:p-0`,onClick:()=>p(Pd(f,{months:1})),"aria-label":`Previous month, go to ${gu(Pd(f,{months:1}),`MMMM yyyy`)}`,"data-testid":`calendar-previous-month-button`,children:(0,K.jsx)(kE,{})}),(0,K.jsx)(`div`,{className:`aone:text-base aone:font-bold aone:mx-2`,"aria-live":`polite`,"aria-label":`Current month: ${m}`,children:m}),(0,K.jsx)(`button`,{type:`button`,className:`aone:w-8 aone:h-8 aone:bg-white aone:rounded-full aone:flex aone:items-center aone:justify-center aone:text-gray-700 aone:p-0`,onClick:()=>p(pl(f,{months:1})),"aria-label":`Next month, go to ${gu(pl(f,{months:1}),`MMMM yyyy`)}`,"data-testid":`calendar-next-month-button`,children:(0,K.jsx)(AE,{})})]})}),(0,K.jsx)(`div`,{className:`aone:grid aone:grid-cols-7 aone:border-b`,role:`rowgroup`,"aria-label":`Weekday headers`,children:Fp.map((e,t)=>(0,K.jsx)(`div`,{className:`aone:min-w-0 aone:w-full aone:md:w-10 aone:h-7 aone:md:h-8 aone:flex aone:items-center aone:justify-center aone:text-black aone:font-bold aone:text-[#5b5b5b] aone:text-[13px] aone:md:text-[16px]`,"aria-hidden":`true`,children:e},`${e}-${t}`))}),(0,K.jsx)(`div`,{className:`aone:grid aone:grid-cols-7 aone:grid-rows-6 aone:pt-1 aone:md:pt-2 aone:pb-4 aone:md:pb-2 `,role:`grid`,"aria-label":`Calendar for ${m}`,children:_.map(n=>{let i=gu(n,`yyyy-MM-dd`),a=l?.[i];return(0,K.jsx)(yB,{date:n,startDate:r,endDate:g,previewDate:t,onChange:c,onHover:()=>{},origin:e,onlyDirects:o,stops:a?.stops,flightState:a?.flightsState,referenceDates:u,minDate:d},n.toISOString())})})]})}function xB({message:e,className:t,buttonRef:n}){let r=(0,G.useId)(),[i,a]=(0,G.useState)(!1);return(0,K.jsxs)(`span`,{className:(0,q.default)(`aone:relative aone:inline-flex`,t),onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[(0,K.jsx)(`button`,{type:`button`,ref:n,className:`aone:inline-flex aone:items-center aone:justify-center aone:h-4 aone:w-4 aone:cursor-pointer aone:rounded-sm aone:text-red-500 aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-red-500 aone:focus:ring-offset-1`,"data-testid":`error-icon`,"aria-label":`Validation error: ${e}`,"aria-expanded":i,"aria-controls":r,"aria-describedby":i?r:void 0,onFocus:()=>a(!0),onBlur:()=>a(!1),onClick:()=>a(e=>!e),children:(0,K.jsx)(iN,{icon:QE,"aria-hidden":`true`,className:`aone:h-4 aone:w-4`})}),i&&(0,K.jsx)(`div`,{id:r,role:`tooltip`,className:`aone:absolute aone:z-20 aone:top-full aone:left-1/2 aone:-translate-x-1/2 aone:mt-2 aone:bg-red-600 aone:text-white aone:text-xs aone:rounded aone:px-2 aone:py-1 aone:whitespace-nowrap`,children:e})]})}var SB=e=>{let t=e.match(/\d+/g)??[];if(t.length===0)return null;let n=parseInt(t[0].slice(0,2),10);if(Number.isNaN(n)||n<1||n>12)return null;let r=t[1]?.slice(0,2),i=Number(r??`1`);(Number.isNaN(i)||i<1||i>31)&&(i=1);let a=new Date().getFullYear(),o=t[2],s=a;if(o){let e=parseInt(o,10);s=o.length<=2?2e3+e:e}let c=new Date(s,n-1,i);return Dl(c)?xl(c):null},CB=/^\d{2}\/\d{2}\/\d{2}$/,wB=e=>e.toLocaleDateString(`en-US`,{year:`2-digit`,month:`2-digit`,day:`2-digit`}),TB=(e,t=``)=>{let n=e.length<t.length,r=e.replace(/\D/g,``).slice(0,8);if(!n&&e.endsWith(`/`)){let t=e.slice(0,-1).split(`/`);if(t.length===1){let e=t[0];if(e&&e.length===1)return`0${e}/`}if(t.length===2){let e=t[0],n=t[1];if(n&&n.length===1)return`${(e??``).padStart(2,`0`)}/${`0${n}`}/`}}if(r.length===1&&t===``&&!n&&parseInt(r,10)>=3)return`0${r}/`;if(e.indexOf(`/`)===1&&r.length>=1){let e=r.slice(0,1).padStart(2,`0`),t=r.slice(1);switch(t.length){case 0:return n?e:`${e}/`;case 1:return`${e}/${t}`;case 2:return n?`${e}/${t}`:`${e}/${t}/`;default:return`${e}/${t.slice(0,2)}/${t.slice(2).slice(-2).padStart(2,`0`)}`}}switch(r.length){case 0:return``;case 1:return r;case 2:return n?e:`${r}/`;case 3:{let e=r.slice(0,2),i=r.slice(2);return!n&&t.replace(/\D/g,``).length===2&&/^\d{2}\/$/.test(t)&&parseInt(i,10)>=4?`${e}/0${i}/`:`${e}/${i}`}case 4:{let e=r.slice(0,2),t=r.slice(2,4);return n?`${e}/${t}`:`${e}/${t}/`}default:return`${r.slice(0,2)}/${r.slice(2,4)}/${r.slice(4).slice(-2)}`}},EB=e=>{let t=e.trim();if(t===``)return``;let n=(t.match(/\d+/g)??[]).slice(0,3);if(n.length===0)return``;let r=n[0].slice(-2).padStart(2,`0`);if(n.length===1)return r;let i=n[1].slice(-2).padStart(2,`0`);return n.length===2?`${r}/${i}`:`${r}/${i}/${n[2].slice(-2).padStart(2,`0`)}`},DB=e=>{if(!CB.test(e))return null;let t=Ad(e,`MM/dd/yy`,new Date);return Dl(t)&&wB(xl(t))===e?xl(t):null};function OB({origin:e,destination:t,onChange:n,onMonthViewChange:r,oneWay:i,className:a,primaryColor:o,secondaryColor:s,startDateLabel:c=`Start Date`,endDateLabel:l=`End Date`,startDateRequired:u=!1,endDateRequired:d=!1,flightCalendar:f,flightCalendarStatus:p,onlyDirects:m,initialStartDate:h,initialEndDate:g,referenceDates:_,minDate:v,showButtons:y=!0}){let b=(0,G.useRef)(null),x=(0,G.useRef)(null),S=(0,G.useRef)(null),C=(0,G.useRef)(null),w=(0,G.useRef)(null),T=(0,G.useRef)(null),E=(0,G.useRef)(0),D=(0,G.useRef)(!1),O=gB(),[k,A]=(0,G.useState)(null);(0,G.useLayoutEffect)(()=>{if(!b.current)return;let e=b.current.getRootNode();if(!(e instanceof ShadowRoot))return;let t=document.createElement(`div`);return e.appendChild(t),queueMicrotask(()=>A(t)),()=>{t.parentNode&&t.parentNode.removeChild(t)}},[]);let[j,M]=(0,G.useState)(``),[N,P]=(0,G.useState)(``),[ee,F]=(0,G.useState)(null),[te,ne]=(0,G.useState)(null),[I,re]=(0,G.useState)(h||null),[L,ie]=(0,G.useState)(g||null),[ae,oe]=(0,G.useState)(!1),[se,ce]=(0,G.useState)(h||null),[le,R]=(0,G.useState)(``),[ue,de]=(0,G.useState)(``),[fe]=(0,G.useState)(()=>h||new Date),pe=(0,G.useRef)(n),me=(0,G.useRef)(!1),he=()=>Date.now()<E.current,ge=()=>{he()||D.current||(oe(!0),de(``),queueMicrotask(()=>{de(`Calendar for date selection opened. Use arrow keys to choose a date, or keep typing in the date field.`)}))},_e=()=>{let e=w.current;e&&(D.current=!0,requestAnimationFrame(()=>{e.focus(),requestAnimationFrame(()=>{D.current=!1})}))},ve=()=>{E.current=Date.now()+250,oe(!1),de(``)},ye=e=>{e?ge():ve()},be=()=>{let e=T.current;e&&e.querySelector(`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`)?.focus()},xe=e=>{if(e.key!==`Tab`)return;let t=T.current;if(!t)return;let n=Array.from(t.querySelectorAll(`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`)).filter(e=>e.offsetParent!==null||e===document.activeElement);if(n.length===0)return;let r=n[0],i=n[n.length-1],a=document.activeElement;e.shiftKey&&a===r?(e.preventDefault(),i.focus()):!e.shiftKey&&a===i&&(e.preventDefault(),r.focus())};(0,G.useEffect)(()=>{ae?me.current=!0:me.current&&(me.current=!1,O&&_e())},[ae,O]),(0,G.useEffect)(()=>{pe.current=n},[n]),(0,G.useEffect)(()=>{i&&queueMicrotask(()=>{ie(null),P(``),ne(null)})},[i]),(0,G.useEffect)(()=>{queueMicrotask(()=>{!I&&h&&re(h),!L&&g&&ie(g)})},[h,g,I,L]);let Se=xl(new Date),Ce=fl(Se,6),we=e=>{M(e);let t=DB(e);e===``||!e?(F(null),re(null)):t?xu(t,Se)?(F(`Date cannot be in the past`),re(null)):bu(t,Ce)?(F(`Date must be within 6 months`),re(null)):v&&xu(t,v)?(F(`Date must be no earlier than `+v.toLocaleDateString()),re(null)):(F(null),re(t),ce(t),L&&xu(L,t)&&(ie(null),P(``))):(F(`Enter a date in MM/DD/YY format`),re(null))},Te=e=>{if(i)return;P(e);let t=DB(e);e===``||!e?(ne(null),ie(null)):t?xu(t,Se)?(ne(`Date cannot be in the past`),ie(null)):bu(t,Ce)?(ne(`Date must be within 6 months`),ie(null)):I?xu(t,I)?(ne(`Return date must be after departure`),ie(null)):v&&xu(t,v)?(ne(`Date must be no earlier than `+v.toLocaleDateString()),ie(null)):(ne(null),ie(t),ce(t)):(ne(`Enter departure date first`),ie(null)):(ne(`Enter a date in MM/DD/YY format`),ie(null))},Ee=()=>we(j),De=()=>Te(N),Oe=e=>{let t=e.getTime()<(I?.getTime()||0);I?!L&&t?re(e):L?I&&L&&(Tl(e,I)&&Tl(e,L)?(re(e),ie(null)):xu(e,L)&&xu(e,dl(I,3))?re(e):ie(e)):i?re(e):ie(e):re(e)},ke=()=>{re(null),ie(null),M(``),P(``),F(null),ne(null),ce(null),pe.current(null,null),R(``),queueMicrotask(()=>{R(`Date selection has been reset.`)})};(0,G.useEffect)(()=>{pe.current(I,L)},[I,L]),(0,G.useEffect)(()=>{queueMicrotask(()=>{I?(M(wB(I)),F(null)):ee||M(``)})},[I]),(0,G.useEffect)(()=>{queueMicrotask(()=>{L?(P(wB(L)),ne(null)):te||P(``)})},[L]);let Ae={};o&&(Ae[`--color-primary`]=o),s&&(Ae[`--color-secondary`]=s);let je=(0,G.useId)(),Me=`${je}-description`,Ne=`${je}-calendar-instructions`,Pe=(0,K.jsxs)(`div`,{ref:x,onClick:()=>{w.current||=S.current,ge()},className:(0,q.default)(`aone:relative aone:h-full aone:flex aone:flex-col aone:gap-4 aone:px-3 aone:py-2 aone:rounded-lg aone:bg-white aone:text-gray-700 aone:cursor-pointer`,`aone:@2xl:flex-row aone:@2xl:items-center`,{"aone:border-2 aone:border-primary":ae,"aone:border-2 aone:border-gray-200":!ae}),children:[(0,K.jsxs)(`fieldset`,{className:`aone:border-0 aone:p-0 aone:m-0 aone:@2xl:flex-1 aone:@2xl:pr-3`,children:[(0,K.jsx)(`legend`,{className:`aone:sr-only`,children:`Date range selection`}),(0,K.jsxs)(`div`,{className:`aone:flex aone:grow aone:items-center`,children:[(0,K.jsx)(`span`,{children:(0,K.jsx)(OE,{})}),(0,K.jsxs)(`div`,{className:`aone:relative aone:grow aone:min-w-0`,children:[(0,K.jsxs)(`label`,{htmlFor:`departure-date`,className:`aone:sr-only`,children:[c,u?` (required)`:``]}),(0,K.jsxs)(`div`,{className:`aone:relative aone:w-full`,children:[(0,K.jsx)(`input`,{ref:S,id:`departure-date`,type:`text`,name:`start-date`,value:j,"aria-invalid":ee?`true`:void 0,"aria-required":u||void 0,"aria-haspopup":`dialog`,"aria-expanded":ae,placeholder:`mm/dd/yy`,autoComplete:`off`,className:(0,q.default)(`aone:ml-2 aone:all-initial aone:focus:outline-none aone:disabled:bg-white aone:text-black aone:text-base aone:w-full aone:pr-1 aone:placeholder:text-gray-700 aone:placeholder:opacity-100`,{"aone:text-red-500 ":!!ee}),onChange:e=>{let t=TB(e.target.value,j);M(t),F(null),ce(SB(t)),pe.current(null,L)},onFocus:()=>{w.current=S.current,ge()},onBlur:e=>{let t=EB(e.target.value);M(t),we(t)},onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),Ee(),e.target.blur()):e.key===`Tab`&&!e.shiftKey&&ae&&(e.preventDefault(),be())}}),ee&&(0,K.jsx)(`span`,{className:`aone:absolute aone:right-2 aone:top-1/2 aone:-translate-y-1/2`,children:(0,K.jsx)(xB,{message:ee})})]})]})]})]}),!i&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`aone:absolute aone:left-2 aone:right-2 aone:top-1/2 aone:@2xl:top-2 aone:@2xl:bottom-2 aone:@2xl:left-1/2 aone:rounded-lg aone:h-[2px] aone:@2xl:h-[initial] aone:@2xl:w-[2px] aone:bg-gray-200`}),(0,K.jsxs)(`fieldset`,{className:`aone:border-0 aone:p-0 aone:m-0 aone:@2xl:flex-1 aone:@2xl:pl-3`,children:[(0,K.jsx)(`legend`,{className:`aone:sr-only`,children:`Return date selection`}),(0,K.jsxs)(`div`,{className:`aone:flex aone:grow aone:items-center`,children:[(0,K.jsx)(`span`,{className:`aone:@2xl:hidden`,children:(0,K.jsx)(OE,{})}),(0,K.jsxs)(`div`,{className:`aone:relative aone:grow aone:min-w-0`,children:[(0,K.jsxs)(`label`,{htmlFor:`return-date`,className:`aone:sr-only`,children:[l,d?` (required)`:``]}),(0,K.jsxs)(`div`,{className:`aone:relative aone:w-full`,children:[(0,K.jsx)(`input`,{ref:C,id:`return-date`,type:`text`,name:`end-date`,value:N,"aria-invalid":te?`true`:void 0,"aria-required":d||void 0,"aria-haspopup":`dialog`,"aria-expanded":ae,placeholder:`mm/dd/yy`,autoComplete:`off`,className:(0,q.default)(`aone:ml-2 aone:focus:outline-none aone:disabled:bg-white aone:text-black aone:text-base aone:w-full aone:pr-7 aone:placeholder:text-gray-700 aone:placeholder:opacity-100`,{"aone:text-red-500":!!te}),onChange:e=>{let t=TB(e.target.value,N);P(t),ne(null),ce(SB(t)),pe.current(I,null)},onFocus:()=>{w.current=C.current,ge()},onBlur:e=>{let t=EB(e.target.value);P(t),Te(t)},onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),De(),e.target.blur()):e.key===`Tab`&&!e.shiftKey&&ae&&(e.preventDefault(),be())}}),te&&(0,K.jsx)(`span`,{className:`aone:absolute aone:right-2 aone:top-1/2 aone:-translate-y-1/2`,children:(0,K.jsx)(xB,{message:te})})]})]})]})]})]})]});return(0,K.jsxs)(`div`,{id:`A1-DateRangePicker`,ref:b,className:a,style:Ae,role:`group`,"aria-label":`Date range picker`,"aria-describedby":Me,children:[O?(0,K.jsxs)(sB,{open:ae,onOpenChange:ye,children:[Pe,(0,K.jsxs)(oB,{className:`ao-dialog--calendar-light`,open:ae,onOpenChange:ye,role:`dialog`,"aria-modal":`true`,"aria-labelledby":je,"aria-describedby":Ne,children:[(0,K.jsx)(dB,{id:je,className:`aone:sr-only`,children:`Calendar for date selection`}),(0,K.jsx)(`div`,{id:Ne,className:`aone:sr-only`,children:`Use arrow keys to navigate dates. Press Enter or Space to select a date. Press Escape to close the calendar.`}),(0,K.jsx)(bB,{origin:e,destination:t,initialDate:fe,startDate:I,endDate:L,previewDate:se,onChange:Oe,onMonthViewChange:r,flightCalendar:f,flightCalendarStatus:p,onlyDirects:m,referenceDates:_,minDate:v},fe.toISOString()),y&&(0,K.jsxs)(`div`,{className:`aone:mt-3 aone:flex aone:justify-between aone:items-center aone:pt-0 aone:pb-1 aone:md:pb-2 aone:px-1`,children:[(0,K.jsx)(`button`,{type:`button`,className:`aone:bg-slate-700 aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-slate-800`,onClick:ke,"data-testid":`date-range-picker-reset-button`,children:`Reset`}),(0,K.jsx)(`button`,{type:`button`,className:`aone:bg-primary aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-primary`,onClick:ve,"data-testid":`date-range-picker-done-button`,children:`Done`})]})]})]}):(0,K.jsxs)(fB,{open:ae,onOpenChange:ye,children:[(0,K.jsx)(mB,{asChild:!0,children:Pe}),(0,K.jsx)(pB,{side:`bottom`,align:`center`,sticky:`always`,avoidCollisions:!1,onOpenAutoFocus:e=>{e.preventDefault()},onCloseAutoFocus:e=>{e.preventDefault(),_e()},onInteractOutside:e=>{let t=e.target;t&&x.current?.contains(t)&&e.preventDefault()},onKeyDown:xe,sideOffset:4,portalContainer:k,role:`dialog`,"aria-modal":`true`,"aria-label":`Calendar for date selection`,"aria-describedby":Ne,className:`aone:w-max aone:max-w-[100vw] aone:max-h-[calc(100dvh-1.5rem)] aone:overflow-y-auto aone:p-0 aone:bg-white aone:border aone:border-gray-300 aone:rounded-xl aone:shadow-lg aone:md:mt-2 aone:pb-2`,children:(0,K.jsxs)(`div`,{ref:T,children:[(0,K.jsx)(`div`,{id:Ne,className:`aone:sr-only`,children:`Use arrow keys to navigate dates. Press Enter or Space to select a date. Press Escape to close the calendar. Press Tab from the date field to move into this calendar.`}),(0,K.jsx)(bB,{origin:e,destination:t,initialDate:fe,startDate:I,endDate:L,previewDate:se,onChange:Oe,onMonthViewChange:r,flightCalendar:f,flightCalendarStatus:p,onlyDirects:m,referenceDates:_,minDate:v},fe.toISOString()),y&&(0,K.jsxs)(`div`,{className:`aone:mt-3 aone:md:mt-0 aone:flex aone:justify-between aone:items-center aone:pt-0 aone:pb-1 aone:md:pb-2 aone:px-5`,children:[(0,K.jsx)(`button`,{type:`button`,className:`aone:bg-slate-700 aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-slate-800`,onClick:ke,"data-testid":`date-range-picker-popover-reset-button`,children:`Reset`}),(0,K.jsx)(`button`,{type:`button`,className:`aone:bg-primary aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-primary`,onClick:ve,"data-testid":`date-range-picker-popover-done-button`,children:`Done`})]})]})})]}),(0,K.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`aone:sr-only`,children:ue}),(0,K.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`aone:sr-only`,children:le}),(0,K.jsx)(`div`,{id:Me,className:`aone:sr-only`,children:i?`Departure date input. Enter a date manually or open the calendar to pick one.`:`Departure and return date inputs. Enter dates manually or open the calendar to pick a date range.`})]})}function kB(e){let t=e[0];if(!t)return`not set`;if(t.type===`airport`){let e=t;return e.city||e.iata_code||`not set`}if(t.type===`place`){let e=t;return e.city||e.name||e.iata_code||`not set`}return`not set`}var AB=U({apiDomain:B(),locationId:B().optional(),origin:B().nullable().optional(),destination:B().nullable().optional(),destinations:B().optional(),primaryColor:B().optional(),secondaryColor:B().optional(),airlines:B().nullable().optional(),providers:B().nullable().optional(),workerUrl:B().optional(),theme:ec([`dark`,`light`]).optional(),defaultNearbyDatesForLowerFares:H().optional(),shadowRoot:Tc(e=>typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot).optional(),subscribingAirport:B().optional(),consentDataSharing:H().optional(),consentAnalytics:H().optional(),consentAdvertising:H().optional(),consentFunctional:H().optional(),onOriginChange:Tc(e=>typeof e==`function`).optional(),onDestinationChange:Tc(e=>typeof e==`function`).optional(),fmaDomain:B().optional(),hideBranding:H().optional(),hideCarButton:H().optional(),disableOrigins:H().optional(),disableDestinations:H().optional(),experimentId:B().optional(),autocompleteType:ec(Cp).optional(),arrivalAirportLabel:B().optional(),departureAirportLabel:B().optional(),departureDateLabel:B().optional(),returnDateLabel:B().optional(),channel:ec(up).optional(),widgetInstanceId:B().optional(),widgetType:B().optional()});function jB(e,t){return e?void 0:t??void 0}var MB=new Ig,NB=m_()||void 0;function PB(e){let t=``;for(let n=0;n<e.length;++n){let r=e[n];if(r){if(r.type===`place`){let e=r;e.iata_code?t+=e.iata_code:e.nearbyAirports&&e.nearbyAirports.length>0&&(t+=e.nearbyAirports[0].iata_code+`,nearby`)}r.type===`airport`&&(t+=r.iata_code),n<e.length-1&&e.length>1&&(t+=`,`)}}return t}function FB({apiDomain:e,origin:t,destination:n,airlines:r,providers:i,destinations:a,locationId:o,experimentId:s,widgetInstanceId:c,widgetType:l,departureDateLabel:u=`Departure Date`,returnDateLabel:d=`Return Date`,departureAirportLabel:f=`Origin`,arrivalAirportLabel:p=`Destination`,workerUrl:m=`https://worker-v2.flymyairport.com`,theme:h=`light`,channel:g,defaultNearbyDatesForLowerFares:_,shadowRoot:v,subscribingAirport:y,consentDataSharing:b=!0,consentAnalytics:x=!0,consentAdvertising:S=!0,consentFunctional:C=!0,onOriginChange:w=()=>{},onDestinationChange:T=()=>{},fmaDomain:E=`https://flymyairport.com`,hideBranding:D=!1,hideCarButton:O=!1,disableOrigins:k=!0,disableDestinations:A=!0,autocompleteType:j=xp.kayak}){let[M,N]=(0,G.useState)({origins:[],destinations:[],startDate:null,endDate:null,oneWay:!1,defaultNearbyDatesForLowerFares:!!_}),[P,ee]=(0,G.useState)(``),F=(0,G.useId)(),{clickId:te}=fh(),ne=(0,G.useMemo)(()=>{let e=PB(M.origins);return w(e),e},[M.origins,w]),I=(0,G.useMemo)(()=>{let e=PB(M.destinations);return T(e),e},[M.destinations,T]),re=M.origins[0],L=M.destinations[0],ie=!!(re?.itemType===W.METRO&&re?.iata_code),ae=!!(L?.itemType===W.METRO&&L?.iata_code);if(!mp.safeParse(o).success)throw Error(`Unable to parse location id`);if(s&&s!==`0`&&s!==`1`)throw Error(`experimentId must be 0 or 1`);let oe=t?.toLocaleUpperCase(),se=n?.toLocaleUpperCase(),ce=r?.split(`,`).map(e=>e.toLocaleUpperCase().trim()).filter(e=>e!==``),le=i?.split(`,`).map(e=>e.toLocaleUpperCase().trim()).filter(e=>e!==``),R=i===r&&i?.length===2&&r?.length===2,[ue,de]=(0,G.useState)(!1),fe=ue?!!se:!!oe,pe=ue?!!oe:!!se,[me,he]=(0,G.useState)(null),[ge,_e]=(0,G.useState)(null),ve=(0,G.useMemo)(()=>M.origins?.length&&M.destinations?.length&&M.startDate?M.endDate&&M.oneWay===!1?!0:!(!M.endDate&&M.oneWay===!1):!1,[M]),ye=e=>j===xp.schedule_data?(0,K.jsx)(rB,{shadowRoot:v,fieldLabel:e.fieldLabel,inputId:e.inputId,required:e.required,icon:e.icon,placeholder:e.placeholder,disabled:e.disabled,items:e.items,selectedItems:e.selectedItems,onInputChange:e.onInputChange,onSelectedItemsChange:e.onSelectedItemsChange}):(0,K.jsx)(tB,{dataTestId:e.dataTestId,fieldLabel:e.fieldLabel,inputId:e.inputId,required:e.required,shadowRoot:v,icon:e.icon,placeholder:e.placeholder,disabled:e.disabled,items:e.items,selectedItems:e.selectedItems,onInputChange:e.onInputChange,onSelectedItemsChange:e.onSelectedItemsChange}),{data:be,status:xe,setQuery:Se}=lL({suggestApiBaseUrl:NB,key:`origin-suggest`,apiDomain:e,airportIATA:I,providersArr:le,airlinesArr:ce,autocompleteType:j}),Ce=(0,G.useMemo)(()=>j===xp.schedule_data?be?.map((e,t)=>({...e,sectionIndex:t,type:`airport`,key:e.iata_code||`airport-${t}`}))||[]:(0,Yz.default)(be?.filter(e=>!!e.nearbyAirports?.length||e.itemType===W.METRO).map(e=>{let t=e.types.includes(`airport`);return[{...e,sectionIndex:0,type:t?`airport-place`:`place`,key:e.formatted_address},...e.nearbyAirports.map((e,n)=>({...e,itemType:W.AIRPORT,sectionIndex:t?-1:n,type:`airport`,key:`${e.iata_code}`}))]}).flat(),e=>e.key).filter((e,t,n)=>{if(e.type===`place`){let r=e;if(r.itemType===W.METRO&&r.iata_code)return!0;let i=n.at(t+1);if(!i||i.type!==`airport`)return!1}return!0}),[be,j]),{data:we,status:Te,setQuery:Ee}=lL({suggestApiBaseUrl:NB,key:`destination-suggest`,apiDomain:e,airportIATA:ne,providersArr:le||[],airlinesArr:ce||[],autocompleteType:j}),De=(0,G.useMemo)(()=>j===xp.schedule_data?we?.map((e,t)=>({...e,sectionIndex:t,type:`airport`,key:e.iata_code||`airport-${t}`}))||[]:(0,Yz.default)(we?.filter(e=>!!e.nearbyAirports?.length||e.itemType===W.METRO).map(e=>{let t=e.types.includes(`airport`);return[{...e,sectionIndex:0,type:t?`airport-place`:`place`,key:e.formatted_address},...e.nearbyAirports.map((e,n)=>({...e,itemType:W.AIRPORT,sectionIndex:t?-1:n,type:`airport`,key:`${e.iata_code}`}))]}).flat(),e=>e.key).filter((e,t,n)=>{if(e.type===`place`){let r=e;if(r.itemType===W.METRO&&r.iata_code)return!0;let i=n.at(t+1);if(!i||i.type!==`airport`)return!1}return!0}),[we,j]),Oe=(0,G.useMemo)(()=>me?wl([me,new Date]):null,[me]),ke=(0,G.useMemo)(()=>M.startDate?dl(M.startDate,1):null,[M.startDate]),Ae=(0,G.useMemo)(()=>jB(M.oneWay,ke),[M.oneWay,ke]),je=(0,G.useMemo)(()=>Oe&&Ae?Oe<=Ae?Oe:Ae:Oe??Ae,[Oe,Ae]),{data:Me,oppositeData:Ne,status:Pe}=VL({apiDomain:e,calendarApiBaseUrl:NB,params:(0,G.useMemo)(()=>({origin:ne,destination:I,startDate:je||void 0,endDate:ge||void 0,departureLocationType:ie?W.METRO:W.AIRPORT,arrivalLocationType:ae?W.METRO:W.AIRPORT}),[ne,I,je,ge,ie,ae])}),Fe=Pe,Ie=Pe;(0,G.useEffect)(()=>{if(oe&&sL({query:oe,searchType:vp.Flights}).then(e=>{let t=e.find(e=>e.id.toLowerCase()===oe.toLowerCase());if(t){let e={iata_code:t.id,city:t.cityonly,lat:t.lat,lng:t.lng,country_code:t.cc,name:t.displayname,itemType:t.isMetroOnly?W.METRO:W.AIRPORT};N(n=>({...n,origins:[{...e,type:`airport`,key:t.id,sectionIndex:-1,disabled:k}]}))}}),se){let e=se.split(`,`).map(e=>sL({query:e,searchType:vp.Flights}).then(t=>{let n=t.find(t=>t.id.toLowerCase()===e?.toLowerCase());return n?{iata_code:n.id,city:n.cityonly,lat:n.lat,lng:n.lng,country_code:n.cc,name:n.displayname,itemType:n.isMetroOnly?W.METRO:W.AIRPORT,type:`airport`,key:n.id,sectionIndex:-1,disabled:A}:null}));Promise.all(e).then(e=>{let t=e.filter(e=>e!==null);t.length>0&&N(e=>({...e,destinations:t}))})}},[oe,se,k,A]);let Le=(0,G.useCallback)((e,n)=>{N({...M,startDate:e,endDate:n}),(e||n)&&Am({name:`Flight Search - Date Range Change`,properties:{airport_iata:t||``,origin:ne,desination:I,destination:I,departure_date:e?.toISOString(),return_date:n?.toISOString()}})},[M,t,ne,I]),Re=(0,G.useCallback)((e,t)=>{he(t=>t&&t.getTime()===e.getTime()?t:e),_e(e=>e&&e.getTime()===t.getTime()?e:t)},[]),ze=fe||pe,Be=[fe?f:null,pe?p:null].filter(Boolean),Ve=Be.length>0?`Activating Switch will also change the locked ${Be.join(` and `)} field${Be.length>1?`s`:``}.`:``,z=()=>{let{origins:e,destinations:t}=M,n=kB(t),r=kB(e);de(e=>!e),N({...M,origins:t,destinations:e}),ee(``),queueMicrotask(()=>{ee(`${f} and ${p} have been switched. ${f} is ${n}. ${p} is ${r}.`)})},He=e=>{e.preventDefault();let n=new FormData(e.currentTarget),r=Object.fromEntries(n.entries()),i=ne,a=I,s=M.startDate,u=M.endDate,d=M.oneWay;if(!i||!a||!s||!u&&!d)throw Error(`All fields must be filled out`);let f=s.toISOString().split(`T`)[0],p=u?.toISOString().split(`T`)[0];if(r[`flexible-dates`]&&!R){let e=`-flexible-3days`;f+=e,p+=e}let h=r.cabin,_=r.pax,v=Hp({worker_domain:m,airport_iata:y||t||i,dep_iata:i||``,arr_iata:a+``||``,departDate:f||``,returnDate:p||``,cabin:h||void 0,pax:_||void 0,filterState:{providers:le?.join(`,`),airlines:ce?.join(`,`)},params:{enc_cid:te||``,...c?{a1_wid:c}:{},...l?{a1_wtype:l}:{},enc_lid:yp({airport:y||t||i,channel:g||`EMB`,action:`SEARCH`,userDefinedPage:o||`UNDEF`,originIATA:i,destinationIATA:a}),consent_data_sharing:b,consent_analytics:x,consent_advertising:S,consent_functional:C,departure_location_type:ie?W.METRO:W.AIRPORT,arrival_location_type:ae?W.METRO:W.AIRPORT,from_url:encodeURIComponent(window?.location.href)}});Am({name:`Flight Search - Search Button Clicked`,properties:{airport_iata:t||``,origin:ne,desination:I,destination:I,departure_date:s?.toISOString(),return_date:M.endDate?.toISOString(),...c?{widget_instance_id:c}:{},...l?{widget_type:l}:{}}}),window.open(v,`_blank`)},Ue=[{display:`Roundtrip`,value:`roundtrip`},{display:`One-way`,value:`one-way`}],We=[{display:`Economy`,value:Lp.enum.economy},{display:`Premium Economy`,value:Lp.enum.premium},{display:`Business`,value:Lp.enum.business},{display:`First`,value:Lp.enum.first}],Ge=Array(9).fill(0).map((e,t)=>{let n=t+1;return{value:Rp.options[t],display:`${n} Traveler${n>1?`s`:``}`}}),Ke=[`Flights`,...O?[]:[`Cars`]],qe=(0,G.useMemo)(()=>y&&se?.includes(y)?`to`:`from`,[y,se]),Je=Ke.map((e,t)=>(0,K.jsx)(G.Fragment,{children:(0,K.jsx)(`a`,{href:t>0?`${E}/${qe}/${y}/${e.toLowerCase()}`:`#`,onClick:e=>{t===0&&e.preventDefault()},target:`_blank`,className:(0,q.default)({"aone:text-black aone:border-white aone:ring-1 aone:ring-white aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-white aone:dark:text-white aone:text-base aone:leading-tight aone:w-[96px] aone:text-center aone:px-4 aone:py-1":!0,"aone:@xl:hover:bg-secondary aone:grow-0":t>=1," aone:bg-transparent aone:rounded-lg aone:@xl:hover:text-black aone:dark:@xl:hover:text-white":t>=1,"aone:bg-primary aone:text-white aone:grow-0 aone:rounded-lg":t===0,"aone:justify-center aone:items-center":t===0}),children:e})},t)),Ye=(0,K.jsx)(`div`,{className:`aone:flex aone:rounded-md aone:items-center aone:justify-center aone:gap-2`,children:Je}),Xe=(0,K.jsx)(FI,{hideByDefault:!0}),Ze=(0,K.jsxs)(`div`,{className:`aone:@2xl:flex aone:@2xl:flex-row aone:pb-1 aone:items-center aone:justify-between`,children:[(0,K.jsx)(`div`,{className:`aone:flex aone:flex-col aone:@2xl:flex-row aone:items-center aone:@2xl:gap-2 aone:mb-2 aone:@2xl:mb-0`,children:(0,K.jsx)(`div`,{className:`aone:flex aone:justify-center aone:@2xl:justify-start`,children:(0,K.jsx)(EL,{variant:h===`dark`?`white`:`black`,height:25,className:`aone:block aone:h-[25px] aone:w-auto`})})}),(0,K.jsx)(`div`,{className:(0,q.default)({"aone:hidden":!0,"aone:@2xl:justify-start aone:@2xl:flex aone:@2xl:w-[190px]":E!==``}),children:Ye}),(0,K.jsx)(`div`,{className:`aone:block aone:@2xl:hidden`,children:Ye}),(0,K.jsx)(`div`,{className:(0,q.default)({"aone:pb-0.5":!0,"aone:hidden aone:@2xl:flex aone:flex-col aone:items-center aone:@2xl:items-end aone:@2xl:w-[190px]":!0}),children:ce&&ce.length>0?null:(0,K.jsx)(`div`,{children:Xe})})]});return(0,K.jsxs)(Oh,{client:MB,children:[(0,K.jsx)(`div`,{"data-mode":h,style:{"--primary":`var(--color-primary-hsl, 210 100% 50%)`,"--secondary":`var(--color-secondary-hsl, 210 100% 50%)`},className:`aone:w-full aone:@container aone:relative`,children:(0,K.jsxs)(`form`,{className:`aone:flex aone:flex-col aone:gap-2`,onSubmit:He,children:[!D&&Ze,(0,K.jsxs)(`div`,{className:`aone:flex aone:flex-wrap aone:justify-between aone:gap-4 aone:max-w-full aone:w-full`,children:[(0,K.jsxs)(`div`,{className:(0,q.default)({"aone:flex aone:gap-1 aone:@2xl:gap-4":!0}),children:[(0,K.jsx)(`label`,{htmlFor:`trip-option`,className:`aone:sr-only`,children:`Trip type`}),(0,K.jsx)(`select`,{id:`trip-option`,name:`trip-option`,className:`aone:text-foreground aone:text-base aone:bg-transparent aone:truncate aone:min-w-0 aone:w-full`,onChange:e=>{N(t=>({...t,oneWay:e.target.value===`one-way`}))},children:Ue.map((e,t)=>(0,K.jsx)(`option`,{className:`aone:dark:bg-black aone:dark:text-white aone:text-base`,value:e.value,children:e.display},`${e.value}-${t}`))}),(0,K.jsx)(`label`,{htmlFor:`pax`,className:`aone:sr-only`,children:`Travelers`}),(0,K.jsx)(`select`,{id:`pax`,name:`pax`,className:`aone:text-foreground aone:text-base aone:bg-transparent aone:truncate aone:min-w-0 aone:w-full`,children:Ge.map((e,t)=>(0,K.jsx)(`option`,{className:`aone:dark:bg-black aone:dark:text-white aone:text-base`,value:e.value,children:e.display},`${e.value}-${t}`))}),(0,K.jsx)(`label`,{htmlFor:`cabin`,className:`aone:sr-only`,children:`Cabin class`}),(0,K.jsx)(`select`,{id:`cabin`,name:`cabin`,className:`aone:text-foreground aone:text-base aone:bg-transparent aone:truncate aone:min-w-0 aone:w-full`,children:We.map((e,t)=>(0,K.jsx)(`option`,{className:`aone:dark:bg-black aone:dark:text-white aone:text-base`,value:e.value,children:e.display},`${e.value}-${t}`))})]}),!R&&(0,K.jsxs)(`label`,{className:`aone:hidden aone:@5xl:flex aone:text-foreground aone:items-center aone:text-base aone:gap-2`,children:[(0,K.jsx)(`input`,{type:`checkbox`,name:`flexible-dates`,defaultChecked:_,className:`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border-2 aone:border-gray-700 aone:bg-white aone:accent-blue-700`}),`Show nearby dates for lower fares`]})]}),(0,K.jsxs)(`div`,{className:(0,q.default)({"aone:flex aone:flex-col aone:gap-6":!0,"aone:@5xl:grid aone:@5xl:grid-cols-2":!M.oneWay,"aone:@5xl:grid aone:@5xl:grid-cols-[3fr_400px]":M.oneWay}),children:[(0,K.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:items-stretch aone:@xl:grid aone:@xl:grid-cols-[calc(50%-20px)_24px_calc(50%-20px)] aone:@xl:items-end aone:w-full aone:gap-2`,children:[(0,K.jsx)(`div`,{className:`aone:flex aone:items-center aone:w-full aone:relative aone:z-100`,children:ye({dataTestId:`flight-search-form-origin`,fieldLabel:f,inputId:`origin`,required:!0,icon:xe===`pending`?(0,K.jsx)(aB,{}):(0,K.jsx)(iN,{className:`aone:w-6 aone:h-6`,icon:BE,style:{width:`24px`,height:`24px`}}),placeholder:`From?`,disabled:fe,items:Ce||[],selectedItems:M.origins,onInputChange:e=>Se(e),onSelectedItemsChange:e=>{let n=k?e?.slice(0,1):e;Am({name:`Flight Search - Origin Changed`,properties:{airport_iata:t||``,origin:ne,desination:I,destination:I,departure_date:M.startDate?.toISOString(),return_date:M.endDate?.toISOString()}}),N(e=>({...e,origins:n||[]}))}})}),(0,K.jsx)(`button`,{type:`button`,className:`aone:w-6 aone:self-center aone:@xl:self-end aone:@xl:mb-2 aone:text-gray-900 aone:rotate-90 aone:@xl:rotate-0 aone:dark:text-gray-400`,onClick:z,"aria-label":`Switch Origin and Destination`,"aria-describedby":ze?F:void 0,title:ze?Ve:`Switch Origin and Destination`,"data-testid":`flight-search-switch-airports-button`,children:(0,K.jsx)(HL,{})}),(0,K.jsx)(`div`,{className:`aone:flex aone:items-center aone:w-full`,children:ye({dataTestId:`flight-search-form-destination-autocomplete`,fieldLabel:p,inputId:`destination`,required:!0,icon:Te===`pending`?(0,K.jsx)(aB,{}):(0,K.jsx)(iN,{className:`aone:w-6 aone:h-6`,icon:FE,style:{width:`24px`,height:`24px`}}),placeholder:`To?`,disabled:pe,items:De||[],selectedItems:M.destinations,onInputChange:e=>Ee(e),onSelectedItemsChange:e=>{let n=A?e?.slice(0,1):e;Am({name:`Flight Search - Destination Changed`,properties:{airport_iata:t||``,origin:ne,desination:I,destination:I,departure_date:M.startDate?.toISOString(),return_date:M.endDate?.toISOString()}}),N(e=>({...e,destinations:n||[]}))}})})]}),ze&&(0,K.jsx)(`span`,{id:F,className:`aone:sr-only`,children:Ve}),(0,K.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`aone:sr-only`,children:P}),(0,K.jsxs)(`div`,{className:(0,q.default)({"aone:flex aone:flex-col aone:items-center aone:gap-4":!0,"aone:@5xl:flex-row aone:@5xl:items-end aone:@5xl:gap-4":!0,grow:!0}),children:[(0,K.jsx)(`div`,{className:`aone:w-full aone:@5xl:flex-1 aone:@5xl:min-w-0`,children:(0,K.jsx)(OB,{origin:ne,destination:I,startDateLabel:u,endDateLabel:d,startDateRequired:!0,endDateRequired:!M.oneWay,onChange:Le,onMonthViewChange:Re,oneWay:M.oneWay,shadowRoot:v,onlyDirects:le&&ce&&le?.length>0&&ce?.length>0,flightCalendar:!M.startDate||M.oneWay?Me:Ne,flightCalendarStatus:!M.startDate||M.oneWay?Fe:Ie})}),(0,K.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:gap-6 aone:items-center aone:justify-center aone:@5xl:shrink-0`,children:[!R&&(0,K.jsxs)(`label`,{className:`aone:text-foreground aone:text-base aone:flex aone:items-center aone:@5xl:hidden aone:gap-3`,children:[(0,K.jsx)(`input`,{type:`checkbox`,name:`flexible-dates`,defaultChecked:_,className:`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border-2 aone:border-gray-700 aone:bg-white aone:accent-blue-700`}),(0,K.jsx)(`span`,{children:`Show nearby dates for lower fares`})]}),(0,K.jsxs)(`button`,{"aria-label":ve?`Search flights`:`Search flights - Please complete all required fields`,"aria-disabled":!ve,tabIndex:0,type:`submit`,"data-testid":`flight-search-submit-button`,onClick:e=>{ve||e.preventDefault()},className:`aone:h-[44px] aone:w-auto aone:min-w-[100px] aone:max-w-[200px] aone:rounded-lg aone:flex aone:align-center aone:items-center aone:gap-1 aone:px-4 aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-offset-2 aone:focus-visible:ring-offset-white aone:dark:focus-visible:ring-offset-black ${ve?`aone:bg-green-500 aone:text-white aone:hover:bg-green-700 aone:active:bg-green-700 aone:focus-visible:ring-green-700 aone:dark:bg-green-600 aone:dark:hover:bg-green-800 aone:dark:active:bg-green-800 aone:dark:focus-visible:ring-green-600`:`aone:bg-gray-300 aone:text-gray-700 aone:cursor-not-allowed aone:dark:bg-gray-600 aone:dark:text-gray-300`}`,children:[(0,K.jsx)(uL,{}),(0,K.jsx)(`span`,{className:`aone:text-base`,children:`Search`})]})]})]})]})]})}),(0,K.jsx)(`div`,{className:`aone:visible aone:@2xl:hidden`,children:!D&&Xe})]})}var IB=new Set([`widgetInstanceId`,`widgetType`]),LB=Object.keys(AB.shape).filter(e=>!IB.has(e)),RB={consentAdvertising:!0,consentAnalytics:!0,consentDataSharing:!0,consentFunctional:!0,defaultNearbyDatesForLowerFares:!1,hideCarButton:!1},zB=[`consentAdvertising`,`consentAnalytics`,`consentDataSharing`,`consentFunctional`];function BB(e){typeof e.destination!=`string`&&typeof e.destinations==`string`&&(e.destination=e.destinations),typeof e.destinations!=`string`&&typeof e.destination==`string`&&(e.destinations=e.destination)}function VB(e){return typeof e.destination==`string`&&e.destination.trim()!==``||typeof e.destinations==`string`&&e.destinations.trim()!==``}function HB(e,t,n){let r={...n};e.hasAttribute(`data-widget-preview`)&&(delete r.origin,delete r.destination,delete r.destinations),BB(r),r.primaryColor==null&&t?.primaryColor&&(r.primaryColor=t.primaryColor),r.secondaryColor==null&&t?.secondaryColor&&(r.secondaryColor=t.secondaryColor);for(let t of LB){let n=yL(t).map(t=>e.getAttribute(t)).find(e=>e!==null&&e.trim()!==``);n!==void 0&&(r[t]=n)}BB(r),r.origin==null&&!VB(r)&&t?.iata&&(r.origin=t.iata.toUpperCase()),(r.subscribingAirport==null||typeof r.subscribingAirport==`string`&&r.subscribingAirport.trim()===``)&&t?.iata?.trim()&&(r.subscribingAirport=t.iata.trim().toUpperCase());for(let[e,t]of Object.entries(RB)){let n=r[e];typeof n==`string`&&(r[e]=bL(n,t))}for(let e of zB)r[e]===void 0&&(r[e]=!0);return r}function UB(e,t,n,r,i={}){return{...HB(e,n,r),apiDomain:t,...i.widgetInstanceId?{widgetInstanceId:i.widgetInstanceId,widgetType:i.widgetType}:{},...r.userStyleBlock?.trim()?{userStyleBlock:r.userStyleBlock}:{}}}var WB=new Ig;function GB(e){let{userStyleBlock:t,...n}=e;return(0,K.jsx)(Oh,{client:WB,children:(0,K.jsxs)(i_,{useSessionStorageOnly:!0,children:[(0,K.jsx)(`style`,{children:l_}),(0,K.jsx)(`style`,{children:e_}),t?(0,K.jsx)(`style`,{children:t}):null,(0,K.jsx)(FB,{...n})]})})}function KB(e){if(!e||typeof e.iata!=`string`)return;let t=e.iata.trim().toUpperCase();return t.length===3?t:void 0}var qB=Object.keys(AB.shape),JB=[...new Set([...qB.flatMap(e=>yL(e)),`borderradius`,`border-radius`,`theme`,Pp,`id`])],YB=class extends HTMLElement{_shadowRoot;_mountPoint;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;_mountTelemetrySent=!1;_lastPublicConfigTelemetryKey=null;static get observedAttributes(){return Array.from(JB)}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this._scheduleRender()}connectedCallback(){this.style.position=`relative`,this.style.zIndex=`10`,this.style.lineHeight=`1.5`,this.style.display=`flex`,this.style.flexDirection=`column`,this._scheduleRender()}disconnectedCallback(){this._reactRoot&&=(this._reactRoot.unmount(),void 0),this._mountTelemetrySent=!1,this._lastPublicConfigTelemetryKey=null}_scheduleRender(){this._renderScheduled||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&this._renderAsync()}))}async _renderAsync(){if(this._renderInProgress)this._renderQueued=!0;else{this._renderInProgress=!0;try{let e=cm(this),t=mm(),n=null,r=!1,i={attempted:!1,durationMs:0},a;if(e&&t){let t=await hm(e);i=t.metrics;let o=t.config;o?.widgetType&&o.widgetType!==`airfare-search`&&(console.warn(`[airport-one-widgets] Widget instance type does not match airfare-search:`,o.widgetType),a=`widget_type_mismatch`,o=null),n=o,r=!n,i.attempted&&n===null&&a===void 0&&i.failureKind&&(a=i.failureKind)}if(!this.isConnected)return;let o=Cm(n),s=window[Ac],c=UB(this,`https://flymyairport.vercel.app`,s,o,{widgetInstanceId:Np(e)??void 0,widgetType:`airfare-search`}),l=KB(n);l&&(c.subscribingAirport=l);let u=!i.attempted&&(!t||!e)?t?`no_instance_id`:`no_api_base`:void 0;if(c.consentAnalytics){let r=i.attempted?`attempt:${t}|${e}|${n===null?`fail`:`ok`}|${a??``}`:`skip:${u??`none`}`;r!==this._lastPublicConfigTelemetryKey&&(this._lastPublicConfigTelemetryKey=r,Sh(!0,{widget_runtime:`airfare-search`,widget_instance_id:c.widgetInstanceId,attempted:i.attempted,duration_ms:i.durationMs,ok:i.attempted?n!==null:!1,error_kind:i.attempted&&n===null?a:void 0,skip_reason:u}))}r&&console.warn(`${um}: airfare-search — managed instance config not applied; using host attributes and window defaults.`),this._paintAirfareSearch(c),c.consentAnalytics&&!this._mountTelemetrySent&&(this._mountTelemetrySent=!0,Ch(!0,{widget_runtime:`airfare-search`,widget_instance_id:c.widgetInstanceId,public_config_unavailable:r}))}finally{this._renderInProgress=!1,this._renderQueued&&(this._renderQueued=!1,queueMicrotask(()=>{this.isConnected&&this._renderAsync()}))}}}_paintAirfareSearch(e){let t=this._shadowRoot??=this.attachShadow({mode:`closed`}),n=this._mountPoint??=document.createElement(`span`);n.style.background=`none`,n.style.backgroundColor=`transparent`,n.parentNode!==t&&t.appendChild(n);let r={...e,shadowRoot:t},i=r.primaryColor!=null&&Kp.test(r.primaryColor),a=r.secondaryColor!=null&&Kp.test(r.secondaryColor),o=r.primaryColor??`210 100% 50%`,s=r.secondaryColor??`210 100% 50%`,c=i?Yp(o):o,l=a?Yp(s):s;this.style.setProperty(`--primary`,c),this.style.setProperty(`--secondary`,l),this.style.setProperty(`--color-primary`,`hsl(${c})`),this.style.setProperty(`--color-secondary`,`hsl(${l})`),this.style.setProperty(`--color-primary-hsl`,c),this.style.setProperty(`--color-secondary-hsl`,l);let u=this.getAttribute(`borderradius`)??this.getAttribute(`border-radius`);u?.trim()&&this.style.setProperty(`--radius`,xL(u)),r.theme===`dark`?this.setAttribute(`data-mode`,`dark`):this.removeAttribute(`data-mode`),(this._reactRoot??=rm.createRoot(n)).render((0,K.jsx)(GB,{...r}))}};customElements.get(`fma-airfare-search`)||customElements.define(`fma-airfare-search`,YB);var XB=new Map,ZB=36e5,QB=432e5;function $B(){let e=Date.now(),t=e-ZB,n=e+QB;return{scheduleWindowStartUtc:new Date(t).toISOString(),scheduleWindowEndUtcExclusive:new Date(n).toISOString()}}function eV(e){let t=e?.scheduleWindowStartUtc?.trim(),n=e?.scheduleWindowEndUtcExclusive?.trim();return t&&n?{scheduleWindowStartUtc:t,scheduleWindowEndUtcExclusive:n}:$B()}function tV(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t={};for(let[n,r]of Object.entries(e)){if(!r||typeof r!=`object`||Array.isArray(r))return null;let e=r;if(typeof e.code!=`string`||typeof e.name!=`string`)return null;t[n]={code:e.code,name:e.name,iconUrl:typeof e.iconUrl==`string`?e.iconUrl:``,logoUrl:typeof e.logoUrl==`string`?e.logoUrl:``}}return t}function nV(e){if(e==null)return{};if(typeof e!=`object`||Array.isArray(e))return null;let t={};for(let[n,r]of Object.entries(e)){if(!r||typeof r!=`object`||Array.isArray(r))return null;let e=r.timezoneRegionName;if(typeof e!=`string`||!e.trim())return null;let i=r.name,a=r.cityName;t[n]={timezoneRegionName:e.trim(),...typeof i==`string`&&i.trim()?{name:i.trim()}:{},...typeof a==`string`&&a.trim()?{cityName:a.trim()}:{}}}return t}function rV(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t=e;if(t.success!==!0)return null;let n=t.data;return typeof n!=`object`||!n||Array.isArray(n)?null:iV(n)}function iV(e){if(e.apiVersion!==3||typeof e.instanceId!=`string`||typeof e.iata!=`string`||e.mode!==`arrivals`&&e.mode!==`departures`&&e.mode!==`both`&&e.mode!==`weather`||!Array.isArray(e.arrivals)||!Array.isArray(e.departures)||typeof e.asOfUtc!=`string`)return null;let t=tV(e.airlines);if(!t)return null;let n=nV(e.airports);if(!n||!e.meta||typeof e.meta!=`object`||Array.isArray(e.meta)||typeof e.meta.lookbackEventsCap!=`number`||typeof e.meta.limitPerDirection!=`number`)return null;let r=e.meta,i=r.scheduleWindow,a;if(i!=null){if(typeof i!=`object`||Array.isArray(i))return null;let e=i;if(e.source!==`client`||typeof e.startUtc!=`string`||typeof e.endUtcExclusive!=`string`)return null;a={source:`client`,startUtc:e.startUtc,endUtcExclusive:e.endUtcExclusive}}return{apiVersion:3,instanceId:e.instanceId,iata:e.iata,mode:e.mode,asOfUtc:e.asOfUtc,arrivals:e.arrivals,departures:e.departures,airlines:t,airports:n,meta:{lookbackEventsCap:r.lookbackEventsCap,limitPerDirection:r.limitPerDirection,...a?{scheduleWindow:a}:{}}}}function aV(){return`https://api.airportonellc.com`.replace(/\/+$/,``)}function oV(e,t){return`${e}\0${t.scheduleWindowStartUtc}\0${t.scheduleWindowEndUtcExclusive}`}function sV(e,t){let n=aV();if(!n||!e.trim())return Promise.resolve({data:null,metrics:{attempted:!1,durationMs:0}});let r=eV(t),i=oV(e,r),a=XB.get(i);if(a)return a;let o=`?${new URLSearchParams({scheduleWindowStartUtc:r.scheduleWindowStartUtc,scheduleWindowEndUtcExclusive:r.scheduleWindowEndUtcExclusive}).toString()}`,s=`${n}/widgets/v1/fids/widget-instances/${encodeURIComponent(e)}/flights${o}`,c=typeof performance<`u`&&typeof performance.now==`function`?performance.now():0,l=()=>typeof performance<`u`&&typeof performance.now==`function`?Math.round(performance.now()-c):0,u=(async()=>{try{let e=await fetch(s,{credentials:`omit`,mode:`cors`});if(!e.ok)return{data:null,metrics:{attempted:!0,durationMs:l(),failureKind:`http_error`}};let t;try{t=await e.json()}catch{return{data:null,metrics:{attempted:!0,durationMs:l(),failureKind:`invalid_json`}}}let n=rV(t);return n?{data:n,metrics:{attempted:!0,durationMs:l()}}:{data:null,metrics:{attempted:!0,durationMs:l(),failureKind:`parse_failed`}}}catch{return{data:null,metrics:{attempted:!0,durationMs:l(),failureKind:`network_error`}}}finally{XB.delete(i)}})();return XB.set(i,u),u}var cV={panelBackgroundColor:`#ffffff`,primaryTextColor:`#0f172a`,accentTextColor:`#0f766e`,mutedTextColor:`#64748b`,headerIconTileBackgroundColor:`#f1f5f9`},lV=[`panelBackgroundColor`,`primaryTextColor`,`accentTextColor`,`mutedTextColor`,`headerIconTileBackgroundColor`];function uV(e){return lV.some(t=>!!e[t]?.trim())}function dV(e){let t=e?.trim();return t&&t.length>0?t:void 0}function fV(e,t){let n=e[t];if(typeof n!=`string`)return;let r=n.trim();return r.length>0?r:void 0}function pV(e){let t={},n=e.mode;(n===`blue`||n===`standard`||n===`black`||n===`custom`)&&(t.mode=n);let r=fV(e,`preset`);r&&(t.preset=r);for(let n of[`panelBackgroundColor`,`primaryTextColor`,`accentTextColor`,`mutedTextColor`,`headerIconTileBackgroundColor`]){let r=fV(e,n);r&&(t[n]=r)}return t}function mV(e){let t={...cV};if(!e||typeof e!=`object`||Array.isArray(e))return t;let n=pV(e);if(n.mode===`blue`||n.mode===`standard`||n.mode===`black`||n.mode===`custom`)return nf(n);if(uV(n)){let e={...t};for(let t of lV){let r=n[t]?.trim();r&&(e[t]=r)}return e}return t}function hV(e,t={}){let n=e?.variables,r=dV(t.primaryColor),i=dV(t.secondaryColor),a=e=>({...e,accentTextColor:r??e.accentTextColor,headerIconTileBackgroundColor:i??e.headerIconTileBackgroundColor});if(!n||typeof n!=`object`||Array.isArray(n))return a({...cV});let o=n.fids;if(!o||typeof o!=`object`||Array.isArray(o))return a({...cV});let s=o.theme;return a(mV(s))}function gV(e){return`color-mix(in srgb, ${e.trim()} 18%, transparent)`}var _V={prefix:`fas`,iconName:`plane-landing-gear`,icon:[640,512,[],`e7bc`,`M249.8 74.4L401.7 240 552.3 240c30.9 0 56 25.1 56 56s-25.1 56-56 56l-450.6 0c-30.9 0-57.4-22.1-63-52.6l-19-104.6C18 185 25.5 176 35.5 176l17.3 0c7.3 0 14.2 3.3 18.7 9l44 55 103.5 0-51.6-154.9C163.9 74.7 171.6 64 182.5 64l43.7 0c9 0 17.5 3.8 23.6 10.4zM224.3 416a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z`]},vV={prefix:`fas`,iconName:`plane-departure`,icon:[576,512,[128747],`f5b0`,`M372 143.9L172.7 40.2c-8-4.1-17.3-4.8-25.7-1.7l-41.1 15c-10.3 3.7-13.8 16.4-7.1 25L200.3 206.4 100.1 242.8 40 206.2c-6.2-3.8-13.8-4.5-20.7-2.1L3 210.1c-9.4 3.4-13.4 14.5-8.3 23.1l53.6 91.8c15.6 26.7 48.1 38.4 77.1 27.8l12.9-4.7 0 0 398.4-145c29.1-10.6 44-42.7 33.5-71.8s-42.7-44-71.8-33.5L372 143.9zM32.2 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l512 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-512 0z`]};function yV(e,t=new Date){let n=e?.trim();if(n)try{return new Intl.DateTimeFormat(`en-US`,{timeZone:n,timeZoneName:`short`}).formatToParts(t).find(e=>e.type===`timeZoneName`)?.value?.trim()||n}catch{return n}}function bV(e){if(!e)return{gate:``,terminal:``};let t=e.gate,n=e.terminal;return{gate:typeof t==`string`?t.trim():typeof t==`number`&&Number.isFinite(t)?String(t).trim():``,terminal:typeof n==`string`?n.trim():typeof n==`number`&&Number.isFinite(n)?String(n).trim():``}}function xV(e,t){if(!t||!e?.airport)return!1;let n=e.airport.iata?.trim().toUpperCase()??``,r=e.airport.fs?.trim().toUpperCase()??``;return n===t||r===t}function SV(e){let{gate:t,terminal:n}=bV(e);return t.length>0||n.length>0}function CV(e,t){let n=t.trim().toUpperCase(),r=e.departure,i=e.arrival,a=xV(r,n),o=xV(i,n),s=!!(r?.airport&&i?.airport);if(e.direction===`departure`){if(a)return SV(r)?r:o&&SV(i)?i:r;if(!a&&o&&SV(i))return i;if(!s||!a&&!o&&!(r?.airport&&i?.airport)){if(SV(r))return r;if(SV(i))return i}return r??i}if(e.direction===`arrival`){if(o)return SV(i)?i:a&&SV(r)?r:i;if(!o&&a&&SV(r))return r;if(!s||!a&&!o&&!(r?.airport&&i?.airport)){if(SV(i))return i;if(SV(r))return r}return i??r}}function wV(e){let t=e.trim();if(!t)return null;let n=!(/z\s*$/i.test(t)||/[+-]\d{2}:\d{2}\s*$/.test(t))&&/^\d{4}-\d{2}-\d{2}T/.test(t)?`${t}Z`:t,r=Date.parse(n);return Number.isNaN(r)?null:new Date(r)}var TV={kind:`on-time`};function EV(e){return e.departureGatePunctuality??TV}function DV(e){return e.arrivalGatePunctuality??TV}function OV(e){let t=e.direction===`departure`?EV(e):DV(e),n=t.kind===`on-time`?`on-time`:t.kind===`early`?`early`:`delayed`;return{text:tp(t),tone:n}}function kV(e,t){return e===`on-time`||e===`early`?Ld.statusGreen:e===`delayed`?Ld.statusRed:t.accentTextColor}function AV(e,t){return new Intl.DateTimeFormat(`en-CA`,{year:`numeric`,month:`2-digit`,day:`2-digit`,...t?{timeZone:t}:{}}).format(e)}function jV(e,t){return new Intl.DateTimeFormat(`en-US`,{year:`numeric`,...t?{timeZone:t}:{}}).format(e)}function MV(e,t){if(!e)return`—`;try{let n=wV(e);if(!n)return e;let r=t?.trim()||void 0,i=new Date;if(AV(n,r)===AV(i,r))return n.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`,...r?{timeZone:r}:{}});let a={month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`,...r?{timeZone:r}:{}};return jV(n,r)!==jV(i,r)&&(a.year=`numeric`),n.toLocaleString(void 0,a)}catch{return e}}var NV=`https://flymyairport.com`,PV=760,FV=784,IV=960,LV=984,RV=`320px`,zV=`minmax(${RV}, max-content) minmax(0, 1fr) max-content`,BV={fontSize:`0.67rem`,fontWeight:700,letterSpacing:`0.05em`,textTransform:`uppercase`,whiteSpace:`nowrap`},VV={display:`inline-flex`,minHeight:28,maxWidth:`100%`,alignItems:`center`,justifyContent:`center`,borderRadius:8,padding:`6px 12px`,fontSize:`0.75rem`,fontWeight:400,lineHeight:1,textDecoration:`none`,whiteSpace:`nowrap`,boxSizing:`border-box`,backgroundColor:`#374151`,color:`#ffffff`,border:`none`,cursor:`pointer`};function HV(e){return e===`arrivals`?`arrival`:`departure`}function UV(e,t,n){let r=Xf(e,HV(n));if(!r)return null;let i=NV.replace(/\/$/,``),a=new URL(`${i}/${encodeURIComponent(t.trim().toUpperCase())}/fids/flight/${encodeURIComponent(r)}`);return a.searchParams.set(`fid`,e.flightId),a.toString()}function WV(e,t,n){let r=Xf(e,HV(n));return r?$f(NV,t,r,{rowFlightId:e.flightId}):null}function GV(e){let t=e.marketingCarrier??e.operatingCarrier;return t?.iata?t.iata:t?.fs?t.fs:``}function KV(e){let t=GV(e),n=e.flightNumber?.trim();return t&&n?`${t} ${n}`:n||e.flightId}function qV(e){let t=e.marketingCarrier??e.operatingCarrier;return t?.iata?.trim().toUpperCase()||(t?.fs?.trim().toUpperCase()??``)}function JV(e,t){let n=qV(e);return n&&t[n]?.name?.trim()||null}function YV(e,t){let n=qV(e);return n&&(t[n]?.iconUrl?.trim()||t[n]?.logoUrl?.trim())||null}function XV(e){return typeof e==`string`?e.trim():typeof e==`number`&&Number.isFinite(e)?String(e):``}function ZV(e,t){let n=CV(e,t);return{gate:XV(n?.gate)||`—`,terminal:XV(n?.terminal)||`—`}}function QV(e,t){return XV(CV(e,t)?.terminal).length>0}function $V(e,t){let n=e?.trim().toUpperCase();if(n)return t[n]?.timezoneRegionName?.trim()||void 0}function eH(e){return e.direction===`arrival`?e.arrival?.gateTime?.scheduled?.utc:e.departure?.gateTime?.scheduled?.utc}function tH(e){let t=e.direction===`departure`?e.departure:e.arrival;return t?.gateTime?.published?.utc??t?.gateTime?.scheduled?.utc}function nH(e){let t=e.direction===`departure`?e.departure:e.arrival;return t?.gateTime?.actual?.utc??t?.gateTime?.estimated?.utc}function rH(e){if(e)return e.replace(/\s+(?:[A-Z]{2,5}|GMT[+-]\d{1,2}(?::?\d{2})?)$/u,``).trim()}function iH(e){switch(e?.trim().toUpperCase()??``){case`CANCELLED`:return`Cancelled`;case`DIVERTED`:return`Diverted`;case`REDIRECTED`:return`Redirected`;case`LANDED`:return`Landed`;case`ACTIVE`:return`En route`;case`SCHEDULED`:return`Scheduled`;case`UNKNOWN`:return`Unknown`;default:return e?e.length<=20?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():e:`—`}}function aH(e){let t=e?.trim().toUpperCase()??``;switch(t){case`CANCELLED`:return{label:`Cancelled`,backgroundColor:`#ffedd5`,color:`#9a3412`};case`DIVERTED`:case`REDIRECTED`:return{label:t===`DIVERTED`?`Diverted`:`Redirected`,backgroundColor:`#fef3c7`,color:`#92400e`};case`LANDED`:return{label:`Landed`,backgroundColor:`#d1fae5`,color:`#065f46`};case`ACTIVE`:return{label:`In Flight`,backgroundColor:`#d1fae5`,color:`#065f46`};case`SCHEDULED`:return{label:`Scheduled`,backgroundColor:`#0f766e`,color:`#ffffff`};case`UNKNOWN`:return{label:`Unknown`,backgroundColor:`#f3f4f6`,color:`#4b5563`};default:return e?{label:e.length<=20?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():e,backgroundColor:`#0f766e`,color:`#ffffff`}:{label:`—`,backgroundColor:`#f3f4f6`,color:`#4b5563`}}}function oH(e,t,n){if(e.displayTime){let n=OV(e);return{timeLabel:rH(e.displayTime.label)??e.displayTime.label,scheduledLabel:rH(e.displayTime.scheduledLabel),statusText:n.text,punctualityColor:kV(n.tone,t)}}let r=OV(e),i=MV(tH(e),n),a=MV(nH(e),n);return r.tone!==`on-time`&&i!==`—`&&a!==`—`&&i!==a?{timeLabel:a,scheduledLabel:i,statusText:r.text,punctualityColor:kV(r.tone,t)}:{timeLabel:MV(eH(e),n),statusText:r.text,punctualityColor:kV(r.tone,t)}}function sH(e){let t=[`minmax(0, 1.35fr)`];return e.showTerminalColumn&&t.push(`minmax(0, 1fr)`),t.push(`minmax(0, 1fr)`),e.showBaggage&&t.push(`minmax(0, 1fr)`),t.push(`minmax(0, 1.35fr)`,`max-content`),t.join(` `)}function cH(e){return e===`auto`?{flexShrink:0}:e===`flex`?{minWidth:0,flex:1}:{width:`100%`,maxWidth:`100%`,justifySelf:`stretch`}}function lH(e){let t=e.trim(),n=t.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i),r=t.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})/i),i,a,o;if(n){let e=n[1];if(!e)return`#ffffff`;let t=e.length===3?e.split(``).map(e=>`${e}${e}`).join(``):e;i=parseInt(t.slice(0,2),16),a=parseInt(t.slice(2,4),16),o=parseInt(t.slice(4,6),16)}else if(r){let[,e,t,n]=r;if(!e||!t||!n)return`#ffffff`;i=Number(e),a=Number(t),o=Number(n)}else return`#ffffff`;return(.2126*i+.7152*a+.0722*o)/255>.56?`#0f172a`:`#ffffff`}function uH(e){return e?{backgroundColor:`#e5e7eb`,marginTop:-14,marginLeft:-14,marginRight:-14,paddingTop:14,paddingLeft:14,paddingRight:14,paddingBottom:14,borderTopLeftRadius:17,borderTopRightRadius:17}:{backgroundColor:`#e5e7eb`,marginTop:-16,marginLeft:-18,marginRight:-18,paddingTop:16,paddingLeft:18,paddingRight:18,paddingBottom:14,borderTopLeftRadius:17,borderTopRightRadius:17}}function dH(e){return`repeat(${1+ +!!e.showTerminalColumn+1+ +!!e.showBaggage}, minmax(0, 1fr))`}function fH(e){let[t,n]=(0,G.useState)(`desktop`),r=(0,G.useRef)(`desktop`);return(0,G.useEffect)(()=>{let t=e.current;if(!t)return;let i=()=>{let e=t.getBoundingClientRect().width,i=r.current,a=i;i===`mobile`?e>=FV&&(a=e<IV?`compact`:`desktop`):i===`compact`?e<PV?a=`mobile`:e>=LV&&(a=`desktop`):e<PV?a=`mobile`:e<IV&&(a=`compact`),a!==i&&(r.current=a,n(a))};if(i(),typeof ResizeObserver>`u`)return globalThis.addEventListener(`resize`,i),()=>globalThis.removeEventListener(`resize`,i);let a=new ResizeObserver(()=>{i()});return a.observe(t),()=>a.disconnect()},[e]),t}function pH({label:e,value:t,theme:n,align:r=`start`,labelStyle:i}){return(0,K.jsxs)(`div`,{style:{display:`flex`,minWidth:0,width:`100%`,flexDirection:`column`,justifyContent:`flex-start`,alignSelf:`flex-start`,alignItems:r===`center`?`center`:void 0,textAlign:r===`center`?`center`:void 0},children:[(0,K.jsx)(`div`,{style:{...i,color:n.mutedTextColor},children:e}),(0,K.jsx)(`div`,{style:{display:`inline-flex`,maxWidth:`100%`,minHeight:24,alignItems:`center`,justifyContent:`center`,padding:`4px 10px`,borderRadius:6,backgroundColor:gV(n.primaryTextColor),color:n.primaryTextColor,fontSize:`0.78rem`,fontWeight:800,lineHeight:1,overflowWrap:`anywhere`,marginTop:6,marginLeft:r===`center`?`auto`:void 0,marginRight:r===`center`?`auto`:void 0},children:t})]})}function mH({label:e,scheduledLabel:t,timeLabel:n,theme:r,labelStyle:i,align:a=`start`}){let o=a===`end`,s=a===`center`;return(0,K.jsxs)(`div`,{part:`fids-board-row-time`,style:{display:`flex`,minHeight:`100%`,minWidth:0,width:`100%`,flexDirection:`column`,alignSelf:`stretch`},children:[(0,K.jsx)(`div`,{part:`fids-board-row-time-label`,style:{...i,color:r.mutedTextColor,width:`100%`,textAlign:s?`center`:o?`right`:`left`},children:e}),(0,K.jsx)(`div`,{style:{display:`flex`,minHeight:32,flex:1,alignItems:`center`,justifyContent:s?`center`:o?`flex-end`:`flex-start`},children:(0,K.jsxs)(`div`,{className:`aone:tabular-nums`,style:{display:`flex`,flexDirection:`column`,gap:2,color:r.primaryTextColor,fontWeight:700,fontSize:`1.05rem`,lineHeight:1.1,alignItems:s?`center`:o?`flex-end`:`flex-start`},children:[(0,K.jsx)(`span`,{children:n}),t?(0,K.jsx)(`span`,{style:{color:r.mutedTextColor,fontSize:`0.875rem`,fontWeight:500,textDecorationLine:`line-through`},children:t}):null]})})]})}function hH({value:e,color:t,align:n=`start`,wrap:r=!1}){let i=n===`end`,a=n===`center`;return(0,K.jsx)(`div`,{part:`fids-board-row-status-text`,style:{display:`flex`,minHeight:`100%`,minWidth:0,width:`100%`,alignItems:`center`,alignSelf:`stretch`,justifyContent:a?`center`:i?`flex-end`:`flex-start`},children:(0,K.jsx)(`div`,{className:`aone:tabular-nums`,style:{fontSize:`0.875rem`,fontWeight:600,lineHeight:1.1,color:t,textAlign:a?`center`:void 0,whiteSpace:r?`normal`:`nowrap`,overflowWrap:r?`anywhere`:void 0},children:e})})}function gH({status:e,fullWidth:t=!0}){let n=aH(e);return(0,K.jsx)(`span`,{part:`fids-board-row-status`,style:{boxSizing:`border-box`,display:`inline-flex`,minHeight:28,height:`auto`,width:t?`100%`:`auto`,maxWidth:t?`100%`:void 0,flexShrink:0,alignItems:`center`,justifyContent:`center`,overflow:t?`hidden`:void 0,textOverflow:t?`ellipsis`:void 0,whiteSpace:`nowrap`,borderRadius:999,padding:t?`6px 5px`:`6px 14px`,fontSize:`0.75rem`,fontWeight:400,lineHeight:1,textTransform:`uppercase`,backgroundColor:n.backgroundColor,color:n.color},children:n.label})}function _H({href:e,stretch:t,ariaLabel:n}){let r={...VV,...cH(t)};return e?(0,K.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,"aria-label":n,part:`fids-board-row-details`,style:r,children:`Flight Details`}):(0,K.jsx)(`span`,{"aria-hidden":!0,style:{...r,opacity:.4,pointerEvents:`none`},children:`Flight Details`})}function vH({href:e,stretch:t,theme:n}){let r=n.headerIconTileBackgroundColor,i={...VV,backgroundColor:r,color:lH(r),...cH(t)};return e?(0,K.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`Sign up for flight notifications`,title:`Sign up for flight notifications`,part:`fids-board-row-notifications`,style:i,children:`Flight Notifications`}):(0,K.jsx)(`span`,{"aria-hidden":!0,part:`fids-board-row-notifications`,style:{...i,opacity:.4,pointerEvents:`none`},children:`Flight Notifications`})}function yH({rows:e,airlines:t,airports:n,theme:r,boardAirportIata:i,tableSection:a}){let o=gV(r.primaryTextColor),s=(0,G.useRef)(null),[c,l]=(0,G.useState)(null),u=fH(s),d=u===`mobile`,f=u!==`desktop`,p={width:`100%`,maxWidth:`100%`,minWidth:0,paddingLeft:f?d?12:16:20,paddingRight:f?d?12:16:20,paddingBottom:16,boxSizing:`border-box`},m=a===`arrivals`,h=e.some(e=>QV(e,i)),g=a===`arrivals`?`Arrival`:`Departs`,_=sH({showTerminalColumn:h,showBaggage:m}),v=dH({showTerminalColumn:h,showBaggage:m}),y=BV;return(0,K.jsx)(`div`,{ref:s,part:`fids-board-card-list`,style:{width:`100%`,maxWidth:`100%`,minWidth:0,boxSizing:`border-box`},children:(0,K.jsx)(`div`,{style:p,children:e.length===0?(0,K.jsx)(`div`,{part:`fids-board-empty`,className:`aone:py-8 aone:text-center`,style:{color:r.mutedTextColor},children:`No flights in this view.`}):(0,K.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:d?20:12},children:e.map(e=>{let s=e.flightId,u=JV(e,t),p=YV(e,t),b=e.callsign?.trim()||``,x=KV(e),S=oH(e,r,$V(i,n)),C=OV(e).text||iH(e.status),w=ZV(e,i),T=UV(e,i,a),E=WV(e,i,a),D=c===s,O=T?`Flight Details for ${x} to ${Uf(e,n)}`:void 0,k={position:`relative`,boxSizing:`border-box`,width:`100%`,minWidth:0,maxWidth:`100%`,overflow:`hidden`,borderRadius:18,backgroundColor:r.panelBackgroundColor,borderWidth:1,borderStyle:`solid`,borderColor:D?r.accentTextColor:o,boxShadow:D?`0 6px 14px rgba(15, 23, 42, 0.06)`:`none`,transform:D?`translateY(-1px)`:void 0,transition:`box-shadow 160ms ease, border-color 160ms ease, transform 160ms ease`,...f?{display:`grid`,alignItems:`center`,gridTemplateColumns:`34px minmax(0, 1fr)`,gap:d?`14px 10px`:`14px 12px`,padding:d?`14px`:`16px 18px`}:{display:`grid`,alignItems:`center`,gridTemplateColumns:zV,columnGap:18,rowGap:12,padding:`16px 18px`}},A=(0,K.jsx)(`span`,{part:`fids-board-row-airline-icon`,"aria-hidden":!p,style:{display:`inline-flex`,width:34,height:34,flexShrink:0,alignItems:`center`,justifyContent:`center`,overflow:`hidden`},children:p?(0,K.jsx)(`img`,{src:p,alt:u?`${u} icon`:``,style:{display:`block`,maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`},loading:`lazy`,decoding:`async`}):null}),j=(0,K.jsxs)(`div`,{style:{display:`grid`,minWidth:0,alignItems:`start`,columnGap:14,rowGap:4,gridTemplateColumns:`34px minmax(0, 1fr)`,gridTemplateRows:`auto auto`,...f?{gridColumn:`1 / -1`,gridRow:1,...uH(d)}:{maxWidth:`100%`,flexShrink:0,flexBasis:RV,minWidth:RV}},children:[(0,K.jsx)(`div`,{style:{gridColumn:1,gridRow:`1 / -1`,alignSelf:`center`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:A}),(0,K.jsx)(`div`,{part:`fids-board-row-endpoint`,style:{gridColumn:2,gridRow:1,minWidth:0,color:r.primaryTextColor},children:(0,K.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,alignItems:`baseline`,justifyContent:`space-between`,width:`100%`,fontSize:`1.05rem`,fontWeight:700,lineHeight:1.1},children:[(0,K.jsx)(`span`,{children:Uf(e,n)}),(0,K.jsx)(`span`,{className:`aone:tabular-nums`,style:{whiteSpace:`nowrap`,paddingRight:20},children:x})]})}),(0,K.jsx)(`div`,{part:`fids-board-row-airline-line`,style:{gridColumn:2,gridRow:2,minWidth:0},children:u||b?(0,K.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,alignItems:`baseline`,columnGap:6,rowGap:2,fontSize:`0.78rem`,lineHeight:1.1,color:r.mutedTextColor},children:[u?(0,K.jsx)(`span`,{style:{fontWeight:700},children:u}):null,b?(0,K.jsx)(`span`,{part:`fids-board-row-callsign-inline`,className:`aone:tabular-nums`,title:`Callsign`,style:{fontWeight:500},children:b}):null]}):null})]}),M=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(mH,{label:g,timeLabel:S.timeLabel,scheduledLabel:S.scheduledLabel,theme:r,labelStyle:y}),h?(0,K.jsx)(pH,{label:`Terminal`,value:w.terminal,theme:r,labelStyle:y,align:`center`}):null,(0,K.jsx)(pH,{label:`Gate`,value:w.gate,theme:r,labelStyle:y,align:`center`}),m?(0,K.jsx)(pH,{label:`Baggage`,value:e.arrival?.baggage?.trim()||`—`,theme:r,labelStyle:y,align:`center`}):null,(0,K.jsx)(hH,{value:C,color:S.punctualityColor,align:`end`}),(0,K.jsx)(`div`,{style:{display:`flex`,minWidth:0,width:`100%`,alignItems:`center`,alignSelf:`stretch`},children:(0,K.jsx)(gH,{status:e.status,fullWidth:!1})})]}),N=(0,K.jsx)(`div`,{part:`fids-board-row-facts`,style:{display:`grid`,minWidth:0,width:`100%`,alignItems:`stretch`,columnGap:18,gridTemplateColumns:_},children:M}),P=(0,K.jsxs)(`div`,{style:{display:`flex`,minWidth:0,alignItems:`center`,justifyContent:`flex-end`,columnGap:8,...f?{gridColumn:`1 / -1`,gridRow:3,width:`100%`}:{flexShrink:0,flexGrow:0,justifySelf:`end`}},children:[(0,K.jsx)(_H,{href:T,stretch:f?`flex`:`auto`,ariaLabel:O}),(0,K.jsx)(vH,{href:E,stretch:f?`flex`:`auto`,theme:r})]});return(0,K.jsxs)(`article`,{part:`fids-board-row-card`,onMouseEnter:()=>l(s),onMouseLeave:()=>l(null),onFocus:()=>l(s),onBlur:()=>l(null),style:k,children:[j,f?(0,K.jsxs)(`div`,{style:{display:`grid`,gridColumn:`1 / -1`,gridRow:2,gridTemplateColumns:v,alignItems:`stretch`,columnGap:12,rowGap:12},children:[(0,K.jsx)(mH,{label:g,timeLabel:S.timeLabel,scheduledLabel:S.scheduledLabel,theme:r,labelStyle:y,align:f?`center`:`start`}),h?(0,K.jsx)(pH,{label:`Terminal`,value:w.terminal,theme:r,labelStyle:y,align:`center`}):null,(0,K.jsx)(pH,{label:`Gate`,value:w.gate,theme:r,labelStyle:y,align:`center`}),m?(0,K.jsx)(pH,{label:`Baggage`,value:e.arrival?.baggage?.trim()||`—`,theme:r,labelStyle:y,align:`center`}):null,(0,K.jsx)(`div`,{style:{gridColumn:`1 / -1`},children:(0,K.jsx)(hH,{value:C,color:S.punctualityColor,align:f?`center`:`start`,wrap:!0})}),(0,K.jsx)(`div`,{style:{gridColumn:`1 / -1`,display:`flex`,width:`100%`,alignItems:`flex-start`},children:(0,K.jsx)(gH,{status:e.status})})]}):N,P]},s)})})})})}function bH(e){if(!e)return`—`;try{let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}catch{return e}}function xH(e,t){let n=e.trim();if(n)return t[n]?.timezoneRegionName?.trim()||t[n.toUpperCase()]?.timezoneRegionName?.trim()||t[n.toLowerCase()]?.timezoneRegionName?.trim()||void 0}function SH(e,t){let n={hour:`numeric`,minute:`2-digit`};t&&(n.timeZone=t);try{return e.toLocaleTimeString(void 0,n)}catch{return e.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`})}}function CH(e,t){let n=Math.max(e.dueAtMs-e.intervalStartMs,1);return Math.min(Math.max(t-e.intervalStartMs,0),n)/n*100}function wH({title:e,headerPlaneIcon:t,theme:n,dataRefreshSchedule:r,timezoneRegionName:i,timezoneLabel:a}){let o=r===null?``:`${r.intervalStartMs}-${r.dueAtMs}`,[s,c]=(0,G.useState)(()=>new Date);(0,G.useEffect)(()=>{let e=o?250:15e3,t=globalThis.setInterval(()=>c(new Date),e);return()=>globalThis.clearInterval(t)},[o]);let l=s.getTime(),u=SH(s,i),d=r===null?null:CH(r,l);return(0,K.jsxs)(`header`,{part:`fids-board-header`,style:{display:`flex`,alignItems:`flex-start`,justifyContent:`space-between`,gap:12,paddingLeft:20,paddingRight:20,paddingTop:20,paddingBottom:16,boxSizing:`border-box`,width:`100%`},children:[(0,K.jsxs)(`div`,{part:`fids-board-meta`,style:{display:`flex`,alignItems:`center`,gap:16,minWidth:0,flex:1},children:[(0,K.jsx)(`div`,{style:{width:44,height:44,flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:8,backgroundColor:n.headerIconTileBackgroundColor},"aria-hidden":!0,children:(0,K.jsx)(iN,{icon:t===`departure`?vV:_V,style:{width:22,height:22,color:`#ffffff`}})}),(0,K.jsx)(`h2`,{part:`fids-board-title`,className:`aone:text-xl aone:font-bold aone:leading-tight aone:tracking-tight`,style:{color:n.accentTextColor,margin:0,minWidth:0},children:e})]}),(0,K.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`flex-end`,flexShrink:0,gap:6,minWidth:72},children:[(0,K.jsx)(`p`,{part:`fids-board-clock`,className:`aone:tabular-nums`,style:{margin:0,fontSize:`1.25rem`,fontWeight:600,color:n.accentTextColor,lineHeight:1},children:u}),d===null?null:(0,K.jsx)(`div`,{part:`fids-board-refresh-bar`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.min(100,Math.round(d)),"aria-label":`Progress until flights refresh`,style:{width:`100%`,maxWidth:96,height:3,borderRadius:2,backgroundColor:gV(n.primaryTextColor),overflow:`hidden`},children:(0,K.jsx)(`div`,{style:{width:`${d}%`,height:`100%`,borderRadius:2,backgroundColor:n.accentTextColor}})}),a?(0,K.jsxs)(`p`,{part:`fids-board-timezone`,style:{margin:0,fontSize:`0.75rem`,fontWeight:700,color:n.mutedTextColor,letterSpacing:`0.05em`,lineHeight:1},children:[`Time Zone: `,a]}):null]})]})}function TH({modeLabel:e,headerPlaneIcon:t,rows:n,airlines:r,airports:i,theme:a,dataRefreshSchedule:o,boardAirportIata:s,timezoneRegionName:c,timezoneLabel:l}){return(0,K.jsxs)(`section`,{part:`fids-board-section`,className:`aone:mb-4 aone:overflow-hidden aone:rounded-xl last:aone:mb-0`,style:{width:`100%`,boxSizing:`border-box`,backgroundColor:a.panelBackgroundColor,boxShadow:`inset 0 1px 0 rgba(255,255,255,0.06)`},children:[(0,K.jsx)(wH,{title:e,headerPlaneIcon:t,theme:a,dataRefreshSchedule:o,timezoneRegionName:c,timezoneLabel:l}),(0,K.jsx)(yH,{rows:n,airlines:r,airports:i,theme:a,boardAirportIata:s,tableSection:t===`arrival`?`arrivals`:`departures`})]})}function EH({payload:e,loading:t,error:n,consentAnalytics:r,theme:i=cV,dataRefreshSchedule:a}){let o=`aone:font-sans aone:text-[15px] aone:leading-normal`;if(t&&!e)return(0,K.jsxs)(`div`,{part:`fids-board-root`,role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`${o} aone:rounded-xl aone:p-8`,style:{backgroundColor:i.panelBackgroundColor,color:i.mutedTextColor,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:16},children:[(0,K.jsx)(`div`,{className:`aone:box-border aone:h-10 aone:w-10 aone:animate-spin aone:rounded-full aone:border-2 aone:border-solid`,style:{borderColor:gV(i.primaryTextColor),borderTopColor:i.accentTextColor},"aria-hidden":!0}),(0,K.jsx)(`p`,{className:`aone:m-0 aone:text-sm`,style:{color:i.mutedTextColor},children:`Loading flight information…`})]});if(n&&!e)return(0,K.jsx)(`div`,{part:`fids-board-root`,className:`${o} aone:rounded-xl aone:p-6 aone:text-center`,style:{backgroundColor:i.panelBackgroundColor,color:`#fdba74`},children:`Flight information is temporarily unavailable.`});if(!e)return(0,K.jsx)(`div`,{part:`fids-board-root`,className:`${o} aone:rounded-xl aone:p-6 aone:text-center`,style:{backgroundColor:i.panelBackgroundColor,color:i.mutedTextColor},children:`No flight data.`});let s=e.mode===`arrivals`||e.mode===`both`,c=e.mode===`departures`||e.mode===`both`,l=e.airlines,u=e.airports??{},d=xH(e.iata,u),f=yV(d);return(0,K.jsxs)(`div`,{part:`fids-board-root`,className:o,style:{color:i.primaryTextColor,width:`100%`,maxWidth:`100%`,boxSizing:`border-box`},children:[c&&(0,K.jsx)(TH,{modeLabel:`Flight Departures`,headerPlaneIcon:`departure`,rows:e.departures,airlines:l,airports:u,theme:i,dataRefreshSchedule:a,boardAirportIata:e.iata,timezoneRegionName:d,timezoneLabel:f}),s&&(0,K.jsx)(TH,{modeLabel:`Flight Arrivals`,headerPlaneIcon:`arrival`,rows:e.arrivals,airlines:l,airports:u,theme:i,dataRefreshSchedule:a,boardAirportIata:e.iata,timezoneRegionName:d,timezoneLabel:f}),(0,K.jsxs)(`p`,{part:`fids-board-updated`,className:`aone:mt-3 aone:text-center aone:text-xs`,style:{color:i.mutedTextColor},children:[`Updated `,bH(e.asOfUtc),` · `,e.iata]})]})}function DH(e){return(0,K.jsx)(EH,{...e})}var OH=[`consent-analytics`,`consent-advertising`,`consent-functional`,Pp,`id`],kH=12e4,AH=3e4;function jH(e){let t=e?.trim().toLowerCase();if(t===`true`)return!0;if(t===`false`)return!1}function MH(e){let t=e?.variables?.preview;if(!t?.variableOverridesEnabled||!t.variableOverrideValues)return{};let n=t.variableOverrideValues;return{consentAnalytics:jH(n.consentAnalytics),consentAdvertising:jH(n.consentAdvertising),consentFunctional:jH(n.consentFunctional)}}var NH=class extends HTMLElement{_shadow;_shadowStylesInjected=!1;_mount;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;_pollTimer;_dataRefreshSchedule=null;_activeInstanceId=null;_mountTelemetrySent=!1;_lastPublicConfigTelemetryKey=null;_flightsCache=null;_flightsLoading=!0;_flightsError=!1;_resolvedTheme=cV;_publicConsentAnalytics;static get observedAttributes(){return Array.from(OH)}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this._scheduleRender()}connectedCallback(){this.style.position=`relative`,this.style.zIndex=`10`,this.style.lineHeight=`1.5`,this.style.display=`flex`,this.style.flexDirection=`column`,this.style.width=`100%`,this.style.maxWidth=`100%`,this.style.minWidth=`0`,this.style.boxSizing=`border-box`,this._scheduleRender()}disconnectedCallback(){this._clearPoll(),this._reactRoot&&=(this._reactRoot.unmount(),void 0),this._mountTelemetrySent=!1,this._lastPublicConfigTelemetryKey=null,this._activeInstanceId=null}_clearPoll(){this._pollTimer!==void 0&&(globalThis.clearTimeout(this._pollTimer),this._pollTimer=void 0),this._dataRefreshSchedule=null}_schedulePoll(){this._clearPoll();let e=kH+Math.floor(Math.random()*AH),t=Date.now();this._dataRefreshSchedule={intervalStartMs:t,dueAtMs:t+e},this._pollTimer=globalThis.setTimeout(()=>{this._pollTick()},e)}async _pollTick(){if(!this.isConnected)return;if(typeof document<`u`&&document.visibilityState===`hidden`){this._schedulePoll();return}let e=cm(this);if(!e||e!==this._activeInstanceId)return;let t=await sV(e);this.isConnected&&e===this._activeInstanceId&&(t.data?(this._flightsCache=t.data,this._flightsError=!1):this._flightsError=!0,this._flightsLoading=!1,this._schedulePoll(),this._paint())}_scheduleRender(){this._renderScheduled||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&this._renderAsync()}))}async _renderAsync(){if(this._renderInProgress)this._renderQueued=!0;else{this._renderInProgress=!0;try{let e=cm(this),t=mm(),n=aV(),r=window[Ac],i={primaryColor:typeof r?.primaryColor==`string`?r.primaryColor:void 0,secondaryColor:typeof r?.secondaryColor==`string`?r.secondaryColor:void 0};e!==this._activeInstanceId&&(this._clearPoll(),this._activeInstanceId=e,this._flightsCache=null,this._flightsLoading=!0,this._flightsError=!1,this._resolvedTheme=hV(null,i)),this._paint();let a=null,o={attempted:!1,durationMs:0},s;if(e&&t){let t=await hm(e);o=t.metrics;let n=t.config;n?.widgetType&&n.widgetType!==`fids-board`&&(console.warn(`[airport-one-widgets] Widget instance type does not match fids-board:`,n.widgetType),s=`widget_type_mismatch`,n=null),a=n,this._resolvedTheme=hV(a,i),o.attempted&&a===null&&s===void 0&&o.failureKind&&(s=o.failureKind)}else this._resolvedTheme=hV(null,i);if(!this.isConnected)return;let c=MH(a);this._publicConsentAnalytics=c.consentAnalytics;let l=om(this,`consent-analytics`,c.consentAnalytics),u=!o.attempted&&(!t||!e)?t?`no_instance_id`:`no_api_base`:void 0;if(l){let n=o.attempted?`attempt:${t}|${e}|${a===null?`fail`:`ok`}|${s??``}`:`skip:${u??`none`}`;n!==this._lastPublicConfigTelemetryKey&&(this._lastPublicConfigTelemetryKey=n,Sh(!0,{widget_runtime:`fids-board`,widget_instance_id:Np(e)??void 0,attempted:o.attempted,duration_ms:o.durationMs,ok:o.attempted?a!==null:!1,error_kind:o.attempted&&a===null?s:void 0,skip_reason:u}))}if(a===null&&e&&t&&console.warn(`${um}: fids-board — managed instance config not applied or wrong type.`),e&&n){let t=await sV(e);if(!this.isConnected||e!==this._activeInstanceId)return;t.data?(this._flightsCache=t.data,this._flightsError=!1):this._flightsError=!0,this._flightsLoading=!1,this._schedulePoll()}else this._flightsLoading=!1,this._flightsError=!1,(!e||!n)&&(this._flightsCache=null);this._paint(),l&&!this._mountTelemetrySent&&(this._mountTelemetrySent=!0,Ch(!0,{widget_runtime:`fids-board`,widget_instance_id:Np(e)??void 0,public_config_unavailable:a===null&&!!t}))}finally{this._renderInProgress=!1,this._renderQueued&&(this._renderQueued=!1,queueMicrotask(()=>{this.isConnected&&this._renderAsync()}))}}}_paint(){let e=this._shadow??=this.attachShadow({mode:`closed`});if(!this._shadowStylesInjected){let t=document.createElement(`style`);t.textContent=l_,e.appendChild(t),this._shadowStylesInjected=!0}let t=this._mount??=document.createElement(`span`);t.style.display=`block`,t.style.width=`100%`,t.style.maxWidth=`100%`,t.style.minWidth=`0`,t.style.boxSizing=`border-box`,t.parentNode!==e&&e.appendChild(t);let n=om(this,`consent-analytics`,this._publicConsentAnalytics);(this._reactRoot??=rm.createRoot(t)).render((0,K.jsx)(DH,{payload:this._flightsCache,loading:this._flightsLoading,error:this._flightsError,consentAnalytics:n,theme:this._resolvedTheme,dataRefreshSchedule:this._dataRefreshSchedule}))}};customElements.get(`fma-fids-board`)||customElements.define(`fma-fids-board`,NH);var PH=[`plane`,`plane-departure`,`compass`,`earth-americas`,`location-dot`,`suitcase`];function FH(e){if(typeof e!=`string`)return;let t=e.trim().toUpperCase();return/^[A-Z]{3}$/.test(t)?t:void 0}function IH(e){let t=e?.trim().toLowerCase();if(t===`true`)return!0;if(t===`false`)return!1}function LH(e){let t=e?.trim().toLowerCase();if(t===`middle-right`)return`middle-right`;if(t===`bottom-right`)return`bottom-right`}function RH(e){let t=e?.trim().toLowerCase();if(t===`floating`||t===`attached`)return t}function zH(e){if(typeof e!=`string`)return;let t=e.trim();return/^#[0-9a-fA-F]{6}$/.test(t)?t:void 0}function BH(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function VH(e){let t=e?.trim().toLowerCase();if(t===`text`||t===`icon`||t===`both`)return t}function HH(e){let t=e?.trim().toLowerCase();if(t)return PH.includes(t)?t:void 0}function UH(e){if(!e||e.widgetType!==`flymyairport-fab`)return{};let t={},n=FH(e.iata);n&&(t.iata=n);let r=e.variables?.preview;if(r?.variableOverridesEnabled&&r.variableOverrideValues){let e=r.variableOverrideValues,n=FH(e.iata)??FH(e.sourceIata);n&&(t.iata=n);let i=IH(e.consentAnalytics);i!==void 0&&(t.consentAnalytics=i);let a=IH(e.consentAdvertising);a!==void 0&&(t.consentAdvertising=a);let o=IH(e.consentFunctional);o!==void 0&&(t.consentFunctional=o);let s=BH(e.label);s&&(t.label=s);let c=IH(e.enableCars);c!==void 0&&(t.enableCars=c);let l=IH(e.enableHotels);l!==void 0&&(t.enableHotels=l);let u=IH(e.enablePackages);u!==void 0&&(t.enablePackages=u);let d=LH(e.position);d&&(t.position=d);let f=RH(e.edgeStyle)??RH(e[`edge-style`]);f&&(t.edgeStyle=f);let p=zH(e.primaryColor);p&&(t.primaryColor=p);let m=zH(e.secondaryColor);m&&(t.secondaryColor=m);let h=BH(e.airfareSearchWidgetInstanceId)??BH(e[`airfare-search-widget-instance-id`]);h&&(t.airfareSearchWidgetInstanceId=h);let g=VH(e.primaryButtonContent)??VH(e[`primary-button-content`]);g&&(t.primaryButtonContent=g);let _=VH(e.secondaryButtonContent)??VH(e[`secondary-button-content`]);_&&(t.secondaryButtonContent=_);let v=HH(e.primaryIcon)??HH(e[`primary-icon`]);v&&(t.primaryIcon=v)}return r?.stylesEnabled&&r.customStyles?.trim()&&(t.userStyleBlock=r.customStyles),t}function WH(e){return FH(e.sourceIataAttribute)??FH(e.publicIata)??FH(e.globalIata??void 0)}function GH(e){return IH(e.consentAttribute??void 0)??e.publicConsent??!0}function KH(e){return BH(e.labelAttribute)??BH(e.publicLabel)??`Plan your trip`}function qH(e){return IH(e.rawAttribute??void 0)??e.publicToggle??!0}function JH(e){return BH(e.rawAttribute)??BH(e.publicAirfareSearchWidgetInstanceId)}function YH(e){return LH(e.rawAttribute)??e.publicPosition??`middle-right`}function XH(e){return RH(e.rawAttribute)??e.publicEdgeStyle??`floating`}function ZH(e){return VH(e.rawAttribute)??e.publicMode??`both`}function QH(e){return HH(e.rawAttribute)??e.publicIcon??`plane`}function $H(e){return zH(e.primaryColorAttribute)??zH(e.publicPrimaryColor)??zH(e.globalPrimaryColor)??`#b91c1c`}function eU(e){return zH(e.secondaryColorAttribute)??zH(e.publicSecondaryColor)??zH(e.globalSecondaryColor)??`#b91c1c`}function tU(e,t){let n=FH(e);if(!n)throw Error(`Invalid IATA code for vertical URL`);return`https://flymyairport.com/from/${encodeURIComponent(n)}/${t}`}function nU(e,t,n){if(!e||typeof window>`u`)return;let r=window.consentedAnalytics;try{r?.track?.(t,n)}catch{}}var rU=Gw(`aone:inline-flex aone:shrink-0 aone:items-center aone:justify-center aone:gap-2 aone:rounded-md aone:text-sm aone:font-medium aone:whitespace-nowrap aone:transition-all aone:outline-none aone:focus-visible:border-ring aone:focus-visible:ring-[3px] aone:focus-visible:ring-ring/50 aone:disabled:pointer-events-none aone:disabled:opacity-50 aone:aria-invalid:border-destructive aone:aria-invalid:ring-destructive/20 aone:dark:aria-invalid:ring-destructive/40 aone:[&_svg]:pointer-events-none aone:[&_svg]:shrink-0 aone:[&_svg:not([class*=size-])]:size-4`,{variants:{variant:{default:`aone:bg-primary aone:text-primary-foreground aone:hover:bg-primary/90`,destructive:`aone:bg-destructive aone:text-white aone:hover:bg-destructive/90 aone:focus-visible:ring-destructive/20 aone:dark:bg-destructive/60 aone:dark:focus-visible:ring-destructive/40`,outline:`aone:border aone:bg-background aone:shadow-xs aone:hover:bg-accent aone:hover:text-accent-foreground aone:dark:border-input aone:dark:bg-input/30 aone:dark:hover:bg-input/50`,secondary:`aone:bg-secondary aone:text-secondary-foreground aone:hover:bg-secondary/80`,ghost:`aone:hover:bg-accent aone:hover:text-accent-foreground aone:dark:hover:bg-accent/50`,link:`aone:text-primary aone:underline-offset-4 aone:hover:underline`,save:`aone:bg-save aone:text-save-foreground aone:hover:bg-save/90`,success:`aone:bg-success aone:text-success-foreground aone:hover:bg-success/90`},size:{default:`aone:h-9 aone:px-4 aone:py-2 aone:has-[>svg]:px-3`,xs:`aone:h-6 aone:gap-1 aone:rounded-md aone:px-2 aone:text-xs aone:has-[>svg]:px-1.5 aone:[&_svg:not([class*=size-])]:size-3`,sm:`aone:h-8 aone:gap-1.5 aone:rounded-md aone:px-3 aone:has-[>svg]:px-2.5`,lg:`aone:h-10 aone:rounded-md aone:px-6 aone:has-[>svg]:px-4`,icon:`aone:size-9`,"icon-xs":`aone:size-6 aone:rounded-md aone:[&_svg:not([class*=size-])]:size-3`,"icon-sm":`aone:size-8`,"icon-lg":`aone:size-10`}},defaultVariants:{variant:`default`,size:`default`}});function iU({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?J_:`button`;return(0,K.jsx)(a,{"data-slot":`button`,"data-variant":t,"data-size":n,className:vE(rU({variant:t,size:n,className:e})),...i})}var aU={plane:XE,"plane-departure":BE,compass:nD,"earth-americas":HE,"location-dot":rD,suitcase:UE};function oU({iata:e,consentAnalytics:t,consentAdvertising:n,consentFunctional:r,label:i,enableCars:a,enableHotels:o,enablePackages:s,primaryColor:c,secondaryColor:l,position:u,edgeStyle:d=`floating`,airfareSearchWidgetInstanceId:f,primaryButtonContent:p=`both`,secondaryButtonContent:m=`both`,primaryIcon:h=`plane`,dialogPortalContainer:g,layoutContained:_=!1}){let[v,y]=(0,G.useState)(!1),[b,x]=(0,G.useState)(!1),S=(0,G.useCallback)(()=>{y(!1),nU(t,`Widget FYF Closed`,{iata:e??null})},[t,e]),C=(0,G.useCallback)(()=>{y(!0),nU(t,`Widget FYF Opened`,{iata:e??null})},[t,e]),w=(0,G.useCallback)(()=>{v?S():C()},[S,v,C]);(0,G.useEffect)(()=>{if(!v||b)return;let e=e=>{e.key===`Escape`&&(e.stopPropagation(),S())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[S,v,b]);let T=n=>{e&&(nU(t,`Widget FYF Vertical Clicked`,{iata:e,vertical:n}),S())},E=()=>{e&&(x(!0),y(!1),nU(t,`Widget FYF Flight Modal Opened`,{iata:e}))},D=[{vertical:`cars`,label:`Cars`,Icon:F_},{vertical:`packages`,label:`Packages`,Icon:R_},{vertical:`hotels`,label:`Hotels`,Icon:P_}].filter(({vertical:e})=>e===`cars`?a:e===`hotels`?o:s),O=p!==`text`,k=p!==`icon`,A=m!==`text`,j=m!==`icon`,M=O&&k?`aone:gap-1.5 aone:sm:gap-2 aone:px-2.5 aone:sm:px-5`:O&&!k?`aone:gap-0 aone:justify-center aone:px-2 aone:sm:px-3`:`aone:gap-0 aone:justify-center aone:px-2.5 aone:sm:px-5`,N=d===`attached`?`aone:right-0`:`aone:right-4`,P=d===`attached`?`aone:rounded-l-full aone:rounded-r-none`:`aone:rounded-full`,ee=A&&j?`aone:justify-start aone:gap-2`:`aone:justify-center aone:gap-0`,F=u===`bottom-right`?`aone:top-auto aone:bottom-4`:`aone:top-0 aone:bottom-0`,te=u===`bottom-right`?`aone:flex aone:flex-col aone:items-end aone:gap-3`:`aone:flex aone:flex-row aone:items-center aone:gap-3`,ne=_?`aone:absolute`:`aone:fixed`,I=(0,G.useMemo)(()=>({right:d===`attached`?`0px`:`var(--fyf-fab-shell-right, 1rem)`,bottom:`var(--fyf-fab-shell-bottom, 1rem)`}),[d]),re=e=>{let t=[`aone:delay-0`,`aone:delay-75`,`aone:delay-100`,`aone:delay-150`,`aone:delay-200`];return[`aone:animate-in`,`aone:fade-in-0`,u===`bottom-right`?`aone:slide-in-from-bottom-4`:`aone:slide-in-from-right-4`,`aone:zoom-in-95`,`aone:duration-250`,`aone:ease-out`,`aone:fill-mode-both`,t[Math.min(e,t.length-1)]??`aone:delay-200`].join(` `)},L=(0,K.jsxs)(K.Fragment,{children:[v?(0,K.jsx)(`div`,{"aria-hidden":!0,className:`aone:pointer-events-auto ${ne} aone:inset-0 aone:z-90 aone:bg-black/5 aone:animate-in aone:fade-in-0 aone:duration-300 aone:ease-out`,onClick:S,onKeyDown:e=>{e.key===`Escape`&&S()}}):null,(0,K.jsxs)(`div`,{className:`aone:pointer-events-none ${ne} ${F} ${N} ${te} ${b?`aone:z-40`:`aone:z-100`}`,"data-fyf-speed-dial":!0,part:`fab-shell`,style:I,children:[v?(0,K.jsx)(`div`,{className:`aone:pointer-events-auto aone:flex aone:w-max aone:min-w-0 aone:flex-col aone:items-stretch aone:gap-2`,part:`fab-travel-menu`,role:`menu`,"aria-label":`Travel options`,children:e?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(iU,{"aria-label":j?void 0:`Flights`,className:`aone:h-11 aone:w-full aone:rounded-full aone:border-0 aone:px-4 aone:text-sm aone:text-white aone:sm:text-base aone:shadow-md aone:focus-visible:ring-offset-2 ${ee} ${re(0)}`,onClick:E,part:`fab-menu-item`,role:`menuitem`,style:{backgroundColor:l},type:`button`,variant:`default`,children:[A?(0,K.jsx)(L_,{"aria-hidden":!0,className:`aone:size-4 aone:shrink-0 aone:sm:size-5 aone:lg:size-6`}):null,j?`Flights`:null]}),D.map(({vertical:t,label:n,Icon:r},i)=>(0,K.jsx)(iU,{asChild:!0,className:`aone:h-11 aone:w-full aone:rounded-full aone:border-0 aone:px-4 aone:text-sm aone:text-white aone:sm:text-base aone:shadow-md aone:focus-visible:ring-offset-2 ${ee} ${re(i+1)}`,part:`fab-menu-item`,role:`menuitem`,style:{backgroundColor:l},variant:`default`,children:(0,K.jsxs)(`a`,{"aria-label":j?void 0:n,href:tU(e,t),onClick:()=>T(t),rel:`noopener noreferrer`,target:`_blank`,children:[A?(0,K.jsx)(r,{"aria-hidden":!0,className:`aone:size-4 aone:shrink-0 aone:sm:size-5 aone:lg:size-6`}):null,j?n:null]})},t))]}):(0,K.jsxs)(`div`,{className:`aone:w-full aone:max-w-[min(100vw-6rem,20rem)] aone:rounded-full aone:border aone:border-amber-200 aone:bg-amber-50 aone:px-4 aone:py-3 aone:text-sm aone:sm:text-base aone:text-amber-950 aone:shadow-md ${re(0)}`,role:`status`,children:[`Add a valid managed instance id or`,` `,(0,K.jsx)(`code`,{className:`aone:rounded aone:bg-white/80 aone:px-1`,children:`source-iata`}),`.`]})}):null,(0,K.jsxs)(iU,{"aria-expanded":v,"aria-haspopup":`menu`,"aria-label":v?`Close Plan your trip menu`:`Open Plan your trip menu`,className:`aone:pointer-events-auto aone:h-10 aone:sm:h-12 ${P} aone:border-0 aone:bg-[#b91c1c] aone:text-sm aone:text-white aone:sm:text-base aone:shadow-lg aone:transition-[transform,box-shadow] aone:duration-200 aone:ease-out aone:hover:bg-[#991b1b] aone:focus-visible:ring-[#b91c1c] ${M} ${v?`aone:scale-105 aone:shadow-xl`:`aone:scale-100`}`,onClick:w,part:`fab-toggle`,style:{backgroundColor:c},type:`button`,variant:`default`,children:[O?v?(0,K.jsx)(iN,{"aria-hidden":!0,className:`aone:size-4 aone:shrink-0 aone:sm:size-5 aone:lg:size-6`,icon:YE}):(0,K.jsx)(iN,{"aria-hidden":!0,className:`aone:size-4 aone:shrink-0 aone:sm:size-5 aone:lg:size-6`,icon:aU[h]}):null,k?(0,K.jsx)(`span`,{className:`aone:max-w-38 aone:truncate aone:text-sm aone:font-semibold aone:lg:text-base aone:sm:max-w-44`,children:v?`Close`:i}):null]})]}),(0,K.jsx)(sB,{onOpenChange:n=>{x(n),n||nU(t,`Widget FYF Flight Modal Closed`,{iata:e??null})},open:b,children:(0,K.jsxs)(uB,{"aria-describedby":void 0,className:`a1-visual-viewport-modal aone:top-0 aone:right-0 aone:bottom-0 aone:left-0 aone:m-auto aone:h-fit aone:w-[min(95vw,90rem)] aone:max-w-[min(95vw,90rem)] aone:translate-none aone:gap-0 aone:p-0 aone:sm:max-w-[min(95vw,90rem)]`,overlayClassName:`aone:backdrop-blur-md aone:bg-black/40`,portalContainer:g,children:[(0,K.jsx)(dB,{className:`aone:sr-only`,children:`Find Your Flight`}),(0,K.jsx)(`div`,{className:`aone:p-4`,children:e?(0,G.createElement)(`fma-airfare-search`,{key:`fyf-embed-airfare-${e}`,className:`aone:block aone:w-full`,"consent-analytics":String(t),"consent-advertising":String(n),"consent-functional":String(r),...f?{"data-widget-instance-id":f}:{origin:e}}):(0,K.jsx)(`p`,{className:`aone:p-4 aone:text-sm aone:sm:text-base aone:text-muted-foreground`,children:`Airport code unavailable; cannot load flights.`})})]})})]});return _?(0,K.jsx)(`div`,{className:`aone:relative aone:isolate aone:min-h-[min(20rem,50vh)] aone:w-full`,children:L}):L}function sU({shadowRoot:e,userStyleBlock:t,...n}){return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`style`,{children:l_}),t?(0,K.jsx)(`style`,{children:t}):null,(0,K.jsx)(oU,{dialogPortalContainer:e,...n})]})}var cU=[`source-iata`,`primary-color`,`secondary-color`,`consent-analytics`,`consent-advertising`,`consent-functional`,`label`,`enable-cars`,`enable-hotels`,`enable-packages`,`airfare-search-widget-instance-id`,`position`,`edge-style`,`primary-button-content`,`secondary-button-content`,`primary-icon`,Pp,`id`,`data-preview-contained`],lU=`--fyf-fab-shell-bottom`,uU=`--fyf-fab-shell-right`,dU=`fma-fab`;function fU(e){if(typeof e!=`string`)return null;let t=e.trim();return t?/^-?\d+(\.\d+)?$/.test(t)?`${t}px`:/^-?\d+(\.\d+)?(px|rem|em|vh|vw|%)$/.test(t)?t:null:null}function pU(e){if(typeof e!=`string`)return;let t=e.trim();if(t)return t.split(dU).join(`:host`)}var mU=class extends HTMLElement{_shadowRoot;_mountPoint;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;static get observedAttributes(){return Array.from(cU)}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this._scheduleRender()}connectedCallback(){this.style.position=`relative`,this.style.display=`contents`,this._scheduleRender()}disconnectedCallback(){this._reactRoot&&=(this._reactRoot.unmount(),void 0)}_scheduleRender(){this._renderScheduled||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&this._renderAsync()}))}_resolveInstanceId(){return this.getAttribute(Pp)?.trim()||this.id?.trim()||null}async _renderAsync(){if(this._renderInProgress)this._renderQueued=!0;else{this._renderInProgress=!0;try{let e=this._resolveInstanceId(),t=mm(),n=null,r={attempted:!1,durationMs:0};if(e&&t){let t=await hm(e);r=t.metrics,n=t.config}n?.widgetType&&n.widgetType!==`flymyairport-fab`&&(console.warn(`[airport-one-widgets] Widget instance type does not match flymyairport-fab:`,n.widgetType),n=null);let i=n?.variables?.preview?.stylesEnabled===!0?n.variables.preview.styleVariableValues:void 0,a=fU(i?.shellBottom),o=fU(i?.shellRight);a?this.style.setProperty(lU,a):this.style.removeProperty(lU),o?this.style.setProperty(uU,o):this.style.removeProperty(uU);let s=window[Ac],c=UH(n),l=pU(c.userStyleBlock),u=typeof s?.iata==`string`?s.iata:null,d=typeof s?.primaryColor==`string`?s.primaryColor:null,f=typeof s?.secondaryColor==`string`?s.secondaryColor:null,p=WH({sourceIataAttribute:this.getAttribute(`source-iata`),publicIata:c.iata,globalIata:u}),m=GH({consentAttribute:this.getAttribute(`consent-analytics`),publicConsent:c.consentAnalytics}),h=GH({consentAttribute:this.getAttribute(`consent-advertising`),publicConsent:c.consentAdvertising}),g=GH({consentAttribute:this.getAttribute(`consent-functional`),publicConsent:c.consentFunctional}),_=KH({labelAttribute:this.getAttribute(`label`),publicLabel:c.label}),v=qH({rawAttribute:this.getAttribute(`enable-cars`),publicToggle:c.enableCars}),y=qH({rawAttribute:this.getAttribute(`enable-hotels`),publicToggle:c.enableHotels}),b=qH({rawAttribute:this.getAttribute(`enable-packages`),publicToggle:c.enablePackages}),x=YH({rawAttribute:this.getAttribute(`position`),publicPosition:c.position}),S=XH({rawAttribute:this.getAttribute(`edge-style`),publicEdgeStyle:c.edgeStyle}),C=$H({primaryColorAttribute:this.getAttribute(`primary-color`),publicPrimaryColor:c.primaryColor,globalPrimaryColor:d}),w=eU({secondaryColorAttribute:this.getAttribute(`secondary-color`),publicSecondaryColor:c.secondaryColor,globalSecondaryColor:f}),T=JH({rawAttribute:this.getAttribute(`airfare-search-widget-instance-id`),publicAirfareSearchWidgetInstanceId:c.airfareSearchWidgetInstanceId}),E=ZH({rawAttribute:this.getAttribute(`primary-button-content`),publicMode:c.primaryButtonContent}),D=ZH({rawAttribute:this.getAttribute(`secondary-button-content`),publicMode:c.secondaryButtonContent}),O=QH({rawAttribute:this.getAttribute(`primary-icon`),publicIcon:c.primaryIcon});if(!r.attempted&&(!e||!t)&&n===null&&console.warn(`${um}: flymyairport-fab — managed config fetch skipped; using element attributes only.`),r.attempted&&n===null&&console.warn(`${um}: flymyairport-fab — managed config unavailable; using element attributes fallback.`),!this.isConnected)return;this._paint({iata:p,consentAnalytics:m,consentAdvertising:h,consentFunctional:g,label:_,enableCars:v,enableHotels:y,enablePackages:b,position:x,edgeStyle:S,primaryColor:C,secondaryColor:w,airfareSearchWidgetInstanceId:T,primaryButtonContent:E,secondaryButtonContent:D,primaryIcon:O,userStyleBlock:l,layoutContained:this.hasAttribute(`data-preview-contained`)})}finally{this._renderInProgress=!1,this._renderQueued&&(this._renderQueued=!1,queueMicrotask(()=>{this.isConnected&&this._renderAsync()}))}}}_paint(e){let t=this._shadowRoot??=this.attachShadow({mode:`closed`}),n=this._mountPoint??=document.createElement(`span`);n.parentNode!==t&&t.appendChild(n),(this._reactRoot??=rm.createRoot(n)).render((0,K.jsx)(sU,{consentAnalytics:e.consentAnalytics,consentAdvertising:e.consentAdvertising,consentFunctional:e.consentFunctional,enableCars:e.enableCars,enableHotels:e.enableHotels,enablePackages:e.enablePackages,airfareSearchWidgetInstanceId:e.airfareSearchWidgetInstanceId,iata:e.iata,label:e.label,layoutContained:e.layoutContained,position:e.position,edgeStyle:e.edgeStyle,primaryColor:e.primaryColor,secondaryColor:e.secondaryColor,primaryButtonContent:e.primaryButtonContent,secondaryButtonContent:e.secondaryButtonContent,primaryIcon:e.primaryIcon,userStyleBlock:e.userStyleBlock,shadowRoot:t}))}};customElements.get(`fma-fab`)||customElements.define(`fma-fab`,mU);var hU=B().regex(/^\d{4}-(0[1-9]|1[0-2])$/),gU=U({month:hU,days:Xs([H(),H(),H(),H(),H(),H(),H()])}),_U=U({iata:B(),name:B(),city:B(),latitude:V(),longitude:V()}),vU=U({code:B(),name:B(),shortName:B(),logoUrl:B()}),yU=U({iata:B(),city:B(),destinationCount:V().int().nonnegative()}),bU=U({airline:B(),via:B().nullable(),months:Vs(hU),operatingDays:V().int().nonnegative(),weekdaysByMonth:Vs(gU).optional(),seasonal:H()}),xU=U({iata:B(),name:B(),city:B(),region:B(),countryCode:B(),countryName:B(),latitude:V(),longitude:V(),distanceMiles:V().int().nonnegative(),imageUrl:B(),options:Vs(bU).min(1)}),SU=U({apiVersion:nc(1),origin:_U,months:Vs(hU),airlines:Vs(vU),hubs:Vs(yU),destinations:Vs(xU)}),CU={"north-america":[[-135,12],[-58,58]],world:[[-170,-48],[175,70]]},wU={light:`https://tiles.openfreemap.org/styles/liberty`,dark:`https://tiles.openfreemap.org/styles/dark`},TU=`#0b3d91`,EU=`#f26430`,DU=/^(-?\d+(?:\.\d+)?)\s+(\d+(?:\.\d+)?)%\s+(\d+(?:\.\d+)?)%$/;function OU(e,t){let n=e?.trim();if(!n)return t;if(Kp.test(n))return n;let r=DU.exec(n);return r?`hsl(${r[1]}, ${r[2]}%, ${r[3]}%)`:n}var kU=`route-map`;function AU(e,t,n){return e.hasAttribute(t)?e.getAttribute(t)?.trim().toLowerCase()!==`false`:n??!1}function jU(e){let t=e?.trim().toLowerCase();return t===`true`||t===`false`?t===`true`:void 0}function MU(e){let t=e?.trim().toLowerCase();return t===`world`||t===`north-america`?t:void 0}function NU(e){if(!e||e.widgetType!==`route-map`)return{};let t={},n=typeof e.iata==`string`?e.iata.trim():``;n.length===3&&(t.origin=n.toUpperCase());let r=e.variables?.preview;if(r?.variableOverridesEnabled&&r.variableOverrideValues){let e=r.variableOverrideValues;(e.theme===`light`||e.theme===`dark`)&&(t.theme=e.theme),e.primaryColor?.trim()&&(t.primaryColor=e.primaryColor.trim()),e.secondaryColor?.trim()&&(t.secondaryColor=e.secondaryColor.trim()),e.heading?.trim()&&(t.heading=e.heading.trim()),e.kicker?.trim()&&(t.kicker=e.kicker.trim()),e.description?.trim()&&(t.description=e.description.trim());let n=MU(e.defaultRegion);n&&(t.defaultRegion=n),e.defaultStops?.trim()&&(t.defaultStops=e.defaultStops.trim()),e.defaultAirline?.trim()&&(t.defaultAirline=e.defaultAirline.trim()),e.defaultMonths?.trim()&&(t.defaultMonths=e.defaultMonths.trim()),e.defaultHub?.trim()&&(t.defaultHub=e.defaultHub.trim()),e.defaultSort?.trim()&&(t.defaultSort=e.defaultSort.trim());let i=e.consentAnalytics?.trim().toLowerCase();(i===`true`||i===`false`)&&(t.consentAnalytics=i===`true`);let a=jU(e.mapOnly);a!==void 0&&(t.mapOnly=a);let o=jU(e.hideFilters);o!==void 0&&(t.hideFilters=o);let s=jU(e.hideHeader);s!==void 0&&(t.hideHeader=s)}return r?.stylesEnabled&&r.customStyles?.trim()&&(t.userStyleBlock=r.customStyles),t}function PU(e,t,n,r){let i=e.hasAttribute(`data-widget-preview`)?{origin:n.origin}:n,a=am(e)??i.theme??`light`;return{instanceId:r,origin:i.origin,kicker:e.getAttribute(`kicker`)??i.kicker??`Interactive route map`,heading:im(e,`heading`)??i.heading??`Where We Fly`,description:im(e,`description`)??i.description,hideHeader:AU(e,`hide-header`,i.hideHeader),mapOnly:AU(e,`map-only`,i.mapOnly),hideFilters:AU(e,`hide-filters`,i.hideFilters),primaryColor:OU(im(e,`primary-color`)??i.primaryColor??t?.primaryColor,TU),accentColor:OU(im(e,`secondary-color`)??i.secondaryColor??t?.secondaryColor,EU),theme:a,styleUrl:im(e,`map-style`)??(a===`dark`?wU.dark:wU.light),defaultRegion:MU(im(e,`default-region`))??i.defaultRegion??`north-america`,initialSettings:{stops:im(e,`default-stops`)??i.defaultStops,airline:im(e,`default-airline`)??i.defaultAirline,months:im(e,`default-months`)??i.defaultMonths,hub:im(e,`default-hub`)??i.defaultHub,sort:im(e,`default-sort`)??i.defaultSort},consentAnalytics:om(e,`consent-analytics`,i.consentAnalytics),userStyleBlock:i.userStyleBlock}}var FU=`5.24.0`,IU=[`https://unpkg.com/maplibre-gl@${FU}/dist`,`https://cdn.jsdelivr.net/npm/maplibre-gl@${FU}/dist`],LU=IU.map(e=>`${e}/maplibre-gl.css`);function RU(){return window.maplibregl}var zU=null;function BU(e){return new Promise((t,n)=>{let r=document.createElement(`script`);r.src=e,r.async=!0,r.crossOrigin=`anonymous`,r.onload=()=>t(),r.onerror=()=>{r.remove(),n(Error(`Failed to load ${e}`))},document.head.appendChild(r)})}function VU(){let e=RU();return e?Promise.resolve(e):zU||(zU=(async()=>{let e;for(let t of IU)try{await BU(`${t}/maplibre-gl.js`);let e=RU();if(e)return e}catch(t){e=t}throw zU=null,e??Error(`MapLibre failed to load`)})(),zU)}var HU=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],UU=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`];function WU(e){let t=/^(\d{4})-(\d{2})$/.exec(e);if(!t)return null;let n=Number(t[2])-1;return n<0||n>11?null:{year:Number(t[1]),index:n}}function GU(e){let t=WU(e);return t?HU[t.index]??e:e}function KU(e){let t=WU(e);return t?`${UU[t.index]} ${t.year}`:e}function qU(e,t){let n=WU(e);if(!n)return e;let r=HU[n.index];return t===0||n.index===0?`${r} '${String(n.year%100).padStart(2,`0`)}`:r??e}function JU(e,t){let n=new Set(e),r=[],i=[];for(let e of t)n.has(e)?i.push(e):i.length>0&&(r.push(i),i=[]);return i.length>0&&r.push(i),r.map(e=>{let t=GU(e[0]);return e.length===1?t:`${t}–${GU(e[e.length-1])}`}).join(`, `)}function YU(e,t){return e.length===0?`Traveling`:e.length>3?`${e.length} months`:e.map(e=>qU(e,t.indexOf(e))).join(`, `)}var XU=50;function ZU(e){return e>XU?`${XU}+`:String(e)}function QU(e){return`${Math.round(e).toLocaleString(`en-US`)} mi`}var $U={stops:`all`,airline:null,months:[],hub:null,seasonalOnly:!1};function eW(e){return{...e,months:[...e.months]}}function tW(e,t){return e.length===t.length&&e.every(e=>t.includes(e))}function nW(e,t){return{airline:e.airline!==t.airline,months:!tW(e.months,t.months),hub:e.hub!==t.hub}}function rW(e,t){return e.stops===t.stops&&e.airline===t.airline&&e.hub===t.hub&&e.seasonalOnly===t.seasonalOnly&&tW(e.months,t.months)}function iW(e){return[...new Set(e)]}function aW(e){return e.options.filter(e=>e.via===null).reduce((e,t)=>e+t.operatingDays,0)}function oW(e){return Math.max(...e.options.map(e=>e.operatingDays))}function sW(e,t){return e.nonstop===t.nonstop?e.nonstop?aW(t)-aW(e)||e.destination.iata.localeCompare(t.destination.iata):oW(t)-oW(e)||t.options.length-e.options.length||e.destination.distanceMiles-t.destination.distanceMiles||e.destination.iata.localeCompare(t.destination.iata):e.nonstop?-1:1}function cW(e,t){switch(t){case`nonstop`:return e.nonstop;case`one-stop`:return!e.nonstop;case`all`:return!0}}function lW(e,t,n,r,i){let a=t.filter(e=>e.via===null),o=a.length>0,s=o?a:t,c=s.every(e=>e.seasonal),l=iW(s.flatMap(e=>e.months));return{destination:e,options:t,nonstop:o,airlines:iW(s.map(e=>e.airline)),vias:o?[]:iW(t.flatMap(e=>e.via?[e.via]:[])),seasonal:c,seasonLabel:c?JU(l,r):null,faded:i,isHub:n.hub!==null&&e.iata===n.hub}}function uW(e,t){let n=[],r=new Map(e.hubs.map(e=>[e.iata,0]));for(let i of e.destinations){let a=t.airline?i.options.filter(e=>e.airline===t.airline):i.options;if(a.length===0)continue;let o=a,s=!1;if(t.months.length>0){let e=new Set(t.months),n=a.filter(t=>t.months.some(t=>e.has(t)));n.length>0?o=n:s=!0}let c=o.some(e=>e.via===null);if(!c)for(let e of iW(o.flatMap(e=>e.via?[e.via]:[])))r.has(e)&&r.set(e,(r.get(e)??0)+1);let l=o;if(t.hub){if(i.iata===t.hub)l=o.filter(e=>e.via===null);else if(c)continue;else l=o.filter(e=>e.via===t.hub);if(l.length===0)continue}n.push(lW(i,l,t,e.months,s))}let i=n.some(e=>e.seasonal),a=t.seasonalOnly?n.filter(e=>e.seasonal):n,o={all:a.length,nonstop:a.filter(e=>e.nonstop).length,oneStop:a.filter(e=>!e.nonstop).length},s=a.filter(e=>cW(e,t.stops)).sort(sW);return{destinations:[...s.filter(e=>!e.faded),...s.filter(e=>e.faded)],counts:o,hubCounts:r,hasSeasonal:i}}function dW(e){return e.normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).toLowerCase().trim()}function fW(e,t){let n=dW(t);return!n||[e.city,e.iata,e.name,e.countryName].some(e=>dW(e).includes(n))}function pW(e,t){if(t===`recommended`)return[...e];let n=(e,n)=>{if(t===`name`)return e.destination.city.localeCompare(n.destination.city);let r=e.destination.distanceMiles-n.destination.distanceMiles;return t===`nearest`?r:-r};return[...e.filter(e=>!e.faded).sort(n),...e.filter(e=>e.faded).sort(n)]}var mW=[`jan`,`feb`,`mar`,`apr`,`may`,`jun`,`jul`,`aug`,`sep`,`oct`,`nov`,`dec`],hW={all:`all`,any:`all`,nonstop:`nonstop`,"non-stop":`nonstop`,direct:`nonstop`,"one-stop":`one-stop`,"1-stop":`one-stop`,onestop:`one-stop`,connecting:`one-stop`},gW=[`recommended`,`nearest`,`farthest`,`name`];function _W(e){if(/^\d{1,2}$/.test(e)){let t=Number(e);return t>=1&&t<=12?t-1:null}let t=mW.indexOf(e.slice(0,3));return e.length>=3&&t>=0?t:null}function vW(e,t){if(!e?.trim())return[];let n=new Set;for(let r of e.toLowerCase().split(/[\s,]+/).filter(Boolean)){if(/^\d{4}-\d{2}$/.test(r)){t.includes(r)&&n.add(r);continue}let e=_W(r);if(e===null)continue;let i=`-${String(e+1).padStart(2,`0`)}`,a=t.find(e=>e.endsWith(i));a&&n.add(a)}return t.filter(e=>n.has(e))}function yW(e,t){let n=e?.trim().toLowerCase();return n?t.airlines.find(e=>e.code.toLowerCase()===n||e.shortName.toLowerCase()===n||e.name.toLowerCase()===n)?.code??null:null}function bW(e,t={}){let n=t.hub?.trim().toUpperCase(),r=t.sort?.trim().toLowerCase();return{filters:{...$U,stops:hW[t.stops?.trim().toLowerCase()??``]??$U.stops,airline:yW(t.airline,e),months:vW(t.months,e.months),hub:n&&e.hubs.some(e=>e.iata===n)?n:null},sort:r&&gW.includes(r)?r:`recommended`}}function xW(e){return[e.stops,e.airline,e.months,e.hub,e.sort].map(e=>e?.trim().toLowerCase()??``).join(`|`)}var SW=[{color:`#0B3D91`,width:3.5,dasharray:null},{color:`#C8102E`,width:2.9,dasharray:[1.6,1.3]},{color:`#00853E`,width:2.9,dasharray:[.4,1.4]},{color:`#E35205`,width:3.2,dasharray:[2.8,1.1]},{color:`#5C068C`,width:2.7,dasharray:[1.2,.55,.25,.55]}];function CW(e,t,n){let r=new Map,i=[];for(let t of e){if(t.via==null)continue;let e=r.get(t.via);e?e.includes(t.airline)||e.push(t.airline):(i.push(t.via),r.set(t.via,[t.airline]))}return i.map((e,i)=>{let a=r.get(e)??[],o=i%5;return{via:e,airlines:a,styleIndex:o,style:SW[o],label:`via ${t.get(e)??e} (${e}) on ${a.map(n).join(`, `)}`}})}function wW(e){let t=e.filter(e=>e.via===null);return t.length>0?t:[...e]}function TW(e,t){return t.map((t,n)=>t||!!e?.[n])}function EW(e,t){return e.every((e,n)=>e===t[n])}function DW(e,t,n){let r=wW(e);if(r.length===0||r.some(e=>!Array.isArray(e.weekdaysByMonth)))return null;let i=n.months.length>0?new Set(n.months):null,a=new Map;for(let e of r){let t=a.get(e.airline)??new Map;a.set(e.airline,t);for(let{month:n,days:r}of e.weekdaysByMonth??[])i&&!i.has(n)||!r.some(Boolean)||t.set(n,TW(t.get(n),r))}if([...a.values()].every(e=>e.size===0))return null;let o=n.onlyAirline&&a.has(n.onlyAirline)?[n.onlyAirline]:[...a.keys()],s=new Map;for(let e of o)for(let[t,n]of a.get(e)??[])s.set(t,TW(s.get(t),n));let c=[...s.values()],l=c.some(e=>!EW(e,c[0]??e)),u=Ip.map((e,r)=>{let i=o.flatMap(e=>{let i=a.get(e)??new Map,o=[...i].filter(([,e])=>e[r]).map(([e])=>e);return o.length===0?[]:o.length<i.size?[`${t(e)} (${JU(o,n.windowMonths)})`]:[t(e)]});return{letter:Fp[r]??``,flies:i.length>0,tip:i.length>0?`${e} · ${i.join(`, `)}`:`No flights ${e}`}});return{chips:u,daily:!l&&u.every(e=>e.flies),variesBySeason:l}}function OW({airline:e,className:t=`aone:size-5`}){let[n,r]=(0,G.useState)(!1);return n||!e.logoUrl?(0,K.jsx)(`span`,{title:e.name,className:`${t} aone:inline-flex aone:items-center aone:justify-center aone:rounded aone:bg-slate-100 aone:text-[0.55rem] aone:font-bold aone:text-slate-600`,children:e.code}):(0,K.jsx)(`img`,{src:e.logoUrl,alt:e.name,title:e.name,loading:`lazy`,onError:()=>r(!0),className:`${t} aone:object-contain`})}var kW=`(max-width: 639px)`;function AW(e){if(typeof window>`u`||typeof window.matchMedia!=`function`)return()=>void 0;let t=window.matchMedia(kW);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)}function jW(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(max-width: 639px)`).matches}var MW=(0,G.createContext)(null);function NW(){let e=(0,G.useContext)(MW),t=(0,G.useSyncExternalStore)(AW,jW,()=>!1);return e??t}function PW(e){let t=(0,G.useCallback)(t=>{if(!e||typeof ResizeObserver>`u`)return()=>void 0;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[e]);return(0,G.useSyncExternalStore)(t,()=>e&&typeof ResizeObserver<`u`?e.clientWidth<=640:null,()=>null)}var FW=(0,G.createContext)(null);function IW(){return(0,G.useContext)(FW)}function LW(e){let t=e.getBoundingClientRect();return{left:t.left+t.width/2,top:t.top<48?t.bottom:t.top,below:t.top<48}}function RW({chip:e,tipKey:t,activeTipKey:n,onTipShow:r,onTipHide:i}){let a=(0,G.useRef)(null),o=(0,G.useId)(),s=IW(),[c,l]=(0,G.useState)(null),u=n===t,d=()=>{let e=a.current;e&&(l(LW(e)),r(t))};(0,G.useEffect)(()=>{if(!u)return;let e=()=>i(t);return window.addEventListener(`scroll`,e,!0),()=>window.removeEventListener(`scroll`,e,!0)},[u,i,t]);let f=u&&c?(0,K.jsx)(`span`,{id:o,role:`tooltip`,className:c.below?`rm-weekday-tip rm-weekday-tip--below`:`rm-weekday-tip`,style:{left:c.left,top:c.top},children:e.tip}):null;return(0,K.jsxs)(`span`,{role:`listitem`,children:[(0,K.jsx)(`button`,{ref:a,type:`button`,className:`rm-weekday-chip`,"data-flies":e.flies,"aria-label":e.tip,"aria-describedby":u?o:void 0,onMouseEnter:d,onMouseLeave:()=>i(t),onFocus:d,onBlur:()=>i(t),children:e.letter}),f&&s?(0,cv.createPortal)(f,s):f]})}function zW({model:e}){let[t,n]=(0,G.useState)(null),r=e.daily?`Daily`:e.variesBySeason?`Varies by season`:null;return(0,K.jsxs)(`div`,{className:`rm-weekday-strip`,children:[(0,K.jsx)(`div`,{role:`list`,"aria-label":e.daily?`Flights every day`:e.variesBySeason?`Days with flights, varies by season`:`Days with flights`,className:`rm-weekday-days`,children:e.chips.map((e,r)=>{let i=String(r);return(0,K.jsx)(RW,{chip:e,tipKey:i,activeTipKey:t,onTipShow:n,onTipHide:e=>n(t=>t===e?null:t)},i)})}),r?(0,K.jsx)(`span`,{className:`rm-weekday-note`,children:r}):null]})}var BW=4;function VW({src:e,iata:t}){let[n,r]=(0,G.useState)(!1);return n?(0,K.jsx)(`span`,{"aria-hidden":!0,className:`aone:flex aone:size-[55px] aone:shrink-0 aone:items-center aone:justify-center aone:rounded-lg aone:bg-gradient-to-br aone:from-[var(--rm-primary)] aone:to-[var(--rm-accent)] aone:text-xs aone:font-bold aone:text-white`,children:t}):(0,K.jsx)(`img`,{src:e,alt:``,loading:`lazy`,onError:()=>r(!0),className:`aone:size-[55px] aone:shrink-0 aone:rounded-lg aone:object-cover aone:bg-slate-100`})}function HW({style:e}){let t=e.dasharray!=null;return(0,K.jsx)(`span`,{"aria-hidden":!0,className:`aone:mt-1.5 aone:inline-block aone:h-0.5 aone:w-3.5 aone:shrink-0 aone:rounded-full`,style:t?{backgroundImage:`repeating-linear-gradient(90deg, ${e.color} 0 4px, transparent 4px 7px)`}:{background:e.color,height:e.width>=3.3?3:2}})}function UW(e){return e.nonstop?`Nonstop`:e.vias.length===1?`VIA ${e.vias[0]}`:`One-stop`}function WW({view:e,airlinesByCode:t,cityByIata:n,months:r,selectedMonths:i}){let a=e=>t.get(e)?.shortName??e,{destination:o}=e,s=e.options.filter(e=>e.via===null).map(e=>a(e.airline)),c=e.nonstop?[]:CW(e.options,n,a);return(0,K.jsx)(`div`,{className:`aone:mt-2 aone:rounded-lg aone:bg-slate-50 aone:p-2.5`,children:(0,K.jsxs)(`div`,{className:`aone:min-w-0 aone:space-y-1 aone:text-xs aone:text-slate-600`,children:[s.length>0?(0,K.jsxs)(`p`,{children:[`Nonstop on `,s.join(`, `)]}):null,c.map(e=>(0,K.jsxs)(`p`,{className:`aone:flex aone:items-start aone:gap-1.5`,children:[(0,K.jsx)(HW,{style:e.style}),(0,K.jsxs)(`span`,{children:[`1 stop `,e.label]})]},e.via)),(0,K.jsxs)(`p`,{className:`aone:pt-0.5 aone:text-slate-500`,children:[QU(o.distanceMiles),e.faded&&i.length>0?(0,K.jsxs)(`span`,{className:`aone:ml-1 aone:text-slate-600`,children:[`· Not flying in `,JU(i,r)]}):null]})]})})}function GW({airlines:e,isolated:t,pinned:n,onHover:r,onTogglePin:i}){return(0,K.jsx)(`span`,{className:`aone:flex aone:shrink-0 aone:items-center aone:gap-1.5`,children:e.map(e=>(0,K.jsx)(`button`,{type:`button`,className:`rm-airline-isolate`,"aria-pressed":n===e.code,"aria-label":`Show only ${e.shortName} days`,"data-active":t===e.code,"data-dim":t!==null&&t!==e.code,onPointerEnter:t=>{t.pointerType===`mouse`&&r(e.code)},onPointerLeave:e=>{e.pointerType===`mouse`&&r(null)},onClick:t=>{t.stopPropagation(),i(e.code)},children:(0,K.jsx)(OW,{airline:e,className:`aone:size-[20px]`})},e.code))})}function KW({view:e,airlinesByCode:t,cityByIata:n,months:r,selectedMonths:i,selected:a,onSelect:o,href:s,onOpenDestination:c,ref:l}){let{destination:u}=e,[d,f]=(0,G.useState)(null),[p,m]=(0,G.useState)(null),h=e=>t.get(e)?.shortName??e,g=e.airlines.map(e=>t.get(e)).filter(e=>!!e),_=g.slice(0,BW),v={months:i,windowMonths:r},y=DW(e.options,h,v),b=y!==null&&_.length>1,x=e=>e!==null&&_.some(t=>t.code===e)?e:null,S=b?x(p)??x(d):null,C=S?DW(e.options,h,{...v,onlyAirline:S}):null,w=C&&y?{...C,chips:C.chips.map((e,t)=>({...e,tip:y.chips[t]?.tip??e.tip}))}:y,T=()=>o(a?null:u.iata),E=e=>m(t=>t===e?null:e),D=s?(0,K.jsxs)(`a`,{href:s,target:`_blank`,rel:`noopener noreferrer`,onClick:()=>c(u.iata),className:`aone:shrink-0 aone:rounded-full aone:bg-[var(--rm-primary)] aone:px-3 aone:py-1.5 aone:text-xs aone:font-semibold aone:whitespace-nowrap aone:text-white aone:hover:opacity-90`,children:[`View flights`,(0,K.jsxs)(`span`,{className:`aone:sr-only`,children:[` `,`to `,u.city,` (`,u.iata,`)`]})]}):null,O=(0,K.jsxs)(K.Fragment,{children:[b?null:_.map(e=>(0,K.jsx)(OW,{airline:e,className:`aone:size-[20px]`},e.code)),g.length>BW?(0,K.jsxs)(`span`,{className:`aone:font-normal aone:text-slate-500`,children:[`+`,g.length-BW]}):null,g.length>0?(0,K.jsx)(`span`,{"aria-hidden":!0,className:`aone:text-slate-300`,children:`|`}):null,(0,K.jsx)(`span`,{children:UW(e)}),e.seasonal?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{"aria-hidden":!0,className:`aone:text-slate-300`,children:`|`}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`span`,{className:`aone:font-bold aone:text-[var(--rm-accent)]`,children:`Seasonal`}),e.seasonLabel?(0,K.jsx)(`span`,{children:` · ${e.seasonLabel}`}):null]})]}):null]});return(0,K.jsxs)(`li`,{ref:l,className:[`aone:border-b aone:border-slate-100 aone:transition-opacity`,e.faded&&!a?`aone:opacity-45`:``,a?`aone:bg-[color-mix(in_srgb,var(--rm-primary)_6%,white)]`:``].join(` `),children:[(0,K.jsxs)(`div`,{className:[`aone:flex aone:flex-col aone:gap-1.5 aone:px-3 aone:py-2.5 aone:transition-colors`,a?``:`aone:hover:bg-slate-50`].join(` `),children:[(0,K.jsxs)(`div`,{className:`aone:flex aone:items-start aone:gap-3`,children:[(0,K.jsx)(`button`,{type:`button`,"aria-expanded":a,"aria-label":`${a?`Collapse`:`Expand`} ${u.city} (${u.iata})`,onClick:T,className:`aone:shrink-0 aone:cursor-pointer aone:rounded-lg aone:p-0`,children:(0,K.jsx)(VW,{src:u.imageUrl,iata:u.iata})}),(0,K.jsxs)(`div`,{className:`aone:flex aone:min-w-0 aone:flex-1 aone:flex-col`,children:[(0,K.jsx)(`button`,{type:`button`,"aria-expanded":a,onClick:T,className:`aone:w-full aone:text-left aone:cursor-pointer`,children:(0,K.jsxs)(`p`,{className:`aone:mb-1 aone:min-w-0 aone:truncate aone:leading-tight aone:text-slate-900`,children:[(0,K.jsx)(`span`,{className:`aone:text-[14px] aone:font-semibold`,children:u.city}),` `,(0,K.jsxs)(`span`,{className:`aone:text-[12px] aone:text-slate-500`,children:[`(`,u.iata,`)`]})]})}),(0,K.jsxs)(`div`,{className:`aone:flex aone:items-center aone:gap-1.5`,children:[b?(0,K.jsx)(GW,{airlines:_,isolated:S,pinned:x(p),onHover:f,onTogglePin:E}):null,b?(0,K.jsx)(`div`,{className:`aone:flex aone:min-w-0 aone:flex-1 aone:flex-wrap aone:items-center aone:gap-1.5 aone:text-[12px] aone:leading-tight aone:font-semibold aone:tracking-wide aone:text-slate-600`,children:O}):(0,K.jsx)(`button`,{type:`button`,"aria-expanded":a,onClick:T,className:`aone:flex aone:min-w-0 aone:flex-1 aone:flex-wrap aone:items-center aone:gap-1.5 aone:text-left aone:text-[12px] aone:leading-tight aone:font-semibold aone:tracking-wide aone:text-slate-600 aone:cursor-pointer`,children:O})]})]})]}),w||D?(0,K.jsxs)(`div`,{className:[`aone:flex aone:min-w-0 aone:items-center aone:gap-2`,w?`aone:justify-between`:`aone:justify-end`].join(` `),children:[w?(0,K.jsx)(`div`,{className:`aone:min-w-0 aone:overflow-hidden`,children:(0,K.jsx)(zW,{model:w})}):null,D]}):null]}),a?(0,K.jsx)(`div`,{className:`aone:px-3 aone:pb-2.5`,children:(0,K.jsx)(WW,{view:e,airlinesByCode:t,cityByIata:n,months:r,selectedMonths:i})}):null]})}var qW=[{value:`recommended`,label:`Recommended`},{value:`nearest`,label:`Nearest first`},{value:`farthest`,label:`Farthest first`},{value:`name`,label:`Name (A–Z)`}];function JW({views:e,search:t,onSearchChange:n,sort:r,onSortChange:i,airlinesByCode:a,cityByIata:o,months:s,selectedMonths:c,selectedIata:l,onSelect:u,destinationUrl:d,onOpenDestination:f}){let p=(0,G.useRef)(null),m=(0,G.useRef)(null),[h,g]=(0,G.useState)(!1),_=NW(),v=h||t.trim().length>0;return(0,G.useEffect)(()=>{p.current?.scrollIntoView({block:`nearest`,behavior:`smooth`})},[l]),(0,G.useEffect)(()=>{h&&m.current?.focus()},[h]),(0,K.jsxs)(`div`,{className:`aone:flex aone:h-full aone:min-h-0 aone:flex-col`,children:[(0,K.jsxs)(`div`,{className:`aone:space-y-3 aone:p-3 aone:pb-2`,children:[(0,K.jsxs)(`div`,{className:`aone:flex aone:items-center aone:justify-between aone:gap-2`,children:[(0,K.jsxs)(`label`,{children:[(0,K.jsx)(`span`,{className:`aone:sr-only`,children:`Sort destinations`}),(0,K.jsx)(`select`,{value:r,onChange:e=>i(e.target.value),className:`aone:rounded-lg aone:border aone:border-slate-200 aone:bg-white aone:px-2.5 aone:py-1.5 aone:text-sm aone:text-slate-800 aone:cursor-pointer`,children:qW.map(e=>(0,K.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),(0,K.jsxs)(`button`,{type:`button`,"aria-expanded":v,"aria-controls":`route-map-destination-search`,onClick:()=>g(e=>!e),className:`aone:inline-flex aone:shrink-0 aone:items-center aone:gap-1.5 aone:text-sm aone:font-medium aone:text-slate-700 aone:cursor-pointer`,children:[(0,K.jsx)(iN,{icon:LE,className:`aone:size-4`,"aria-hidden":!0}),`Search`]})]}),v?(0,K.jsxs)(`label`,{className:`aone:relative aone:block`,children:[(0,K.jsx)(`span`,{className:`aone:sr-only`,children:`Search destinations`}),(0,K.jsx)(iN,{icon:LE,className:`aone:pointer-events-none aone:absolute aone:top-1/2 aone:left-3.5 aone:size-4 aone:-translate-y-1/2 aone:text-slate-400`}),(0,K.jsx)(`input`,{id:`route-map-destination-search`,ref:m,type:`search`,value:t,onChange:e=>n(e.target.value),placeholder:_?`Search city, code or country`:`Search a city, airport code or country`,className:`aone:w-full aone:rounded-xl aone:border aone:border-slate-200 aone:bg-white aone:py-2.5 aone:pr-3 aone:pl-10 aone:text-sm aone:text-slate-900 aone:placeholder:text-slate-400 aone:outline-none aone:focus:border-slate-200 aone:focus:outline-none aone:focus:ring-0`})]}):null]}),e.length===0?(0,K.jsx)(`p`,{className:`aone:px-4 aone:py-10 aone:text-center aone:text-sm aone:text-slate-500`,children:`No destinations match. Try another search or clear a filter.`}):(0,K.jsx)(`ul`,{part:`route-map-destination-list`,className:`aone:min-h-0 aone:flex-1 aone:overflow-y-auto aone:border-t aone:border-slate-100`,children:e.map(e=>{let t=e.destination.iata===l;return(0,K.jsx)(KW,{ref:t?p:void 0,view:e,airlinesByCode:a,cityByIata:o,months:s,selectedMonths:c,selected:t,onSelect:u,href:d(e.destination.iata),onOpenDestination:f},e.destination.iata)})})]})}var YW=`rm-points`,XW=`rm-lines`,ZW=`rm-points`;function QW(e,t,n,r){let i=r??t,a=r??n;e.setPaintProperty(`rm-lines-connecting`,`line-color`,i),e.setPaintProperty(`rm-lines-nonstop`,`line-color`,a),e.setPaintProperty(`rm-lines-hub`,`line-color`,a),e.setPaintProperty(`rm-lines-selected-nonstop`,`line-color`,[`coalesce`,[`get`,`color`],`#0f172a`]);for(let t=0;t<5;t+=1){let n=SW[t];e.setPaintProperty(`rm-lines-selected-${t}`,`line-color`,[`coalesce`,[`get`,`color`],n.color])}e.setPaintProperty(ZW,`circle-color`,[`case`,[`get`,`seasonal`],`#ffffff`,[`get`,`nonstop`],n,t]),e.setPaintProperty(ZW,`circle-stroke-color`,[`case`,[`get`,`selected`],`#0f172a`,[`get`,`nonstop`],n,[`get`,`seasonal`],t,`#ffffff`])}function $W(e,t){e.addSource(XW,{type:`geojson`,data:t.lines}),e.addSource(YW,{type:`geojson`,data:t.points});let n=(t,n,r,i)=>e.addLayer({id:t,type:`line`,source:XW,filter:[`==`,[`get`,`kind`],n],layout:{"line-cap":`round`,"line-join":`round`},paint:{"line-width":r,"line-opacity":[`case`,[`get`,`faded`],i[0],i[1]]}});n(`rm-lines-connecting`,`connecting`,.65,[.03,.14]),n(`rm-lines-nonstop`,`nonstop`,1.4,[.15,.55]),n(`rm-lines-hub`,`hub`,2.4,[.25,.75]),e.addLayer({id:`rm-lines-selected-nonstop`,type:`line`,source:XW,filter:[`all`,[`==`,[`get`,`kind`],`selected`],[`==`,[`get`,`pathRole`],`nonstop`]],layout:{"line-cap":`round`,"line-join":`round`},paint:{"line-width":[`coalesce`,[`get`,`width`],3.25],"line-opacity":1,"line-offset":[`coalesce`,[`get`,`offset`],0],"line-color":[`coalesce`,[`get`,`color`],`#0f172a`]}});for(let t=0;t<5;t+=1){let n=SW[t],r={"line-width":[`coalesce`,[`get`,`width`],n.width],"line-opacity":1,"line-offset":[`coalesce`,[`get`,`offset`],0],"line-color":[`coalesce`,[`get`,`color`],n.color]};n.dasharray&&(r[`line-dasharray`]=[...n.dasharray]),e.addLayer({id:`rm-lines-selected-${t}`,type:`line`,source:XW,filter:[`all`,[`==`,[`get`,`kind`],`selected`],[`==`,[`get`,`pathRole`],`connecting`],[`==`,[`get`,`styleIndex`],t]],layout:{"line-cap":`round`,"line-join":`round`},paint:r})}e.addLayer({id:ZW,type:`circle`,source:YW,layout:{"circle-sort-key":[`case`,[`get`,`selected`],3,[`get`,`nonstop`],2,1]},paint:{"circle-radius":[`interpolate`,[`linear`],[`zoom`],2,[`case`,[`get`,`selected`],7,[`get`,`nonstop`],5,2.6],6,[`case`,[`get`,`selected`],10,[`get`,`nonstop`],8,4.5]],"circle-stroke-width":[`case`,[`get`,`selected`],3,[`get`,`seasonal`],1.8,1],"circle-opacity":[`case`,[`get`,`faded`],.25,1],"circle-stroke-opacity":[`case`,[`get`,`faded`],.3,1]}}),e.addLayer({id:`rm-labels`,type:`symbol`,source:YW,filter:[`all`,[`any`,[`get`,`labelled`],[`get`,`selected`]],[`!`,[`get`,`faded`]]],layout:{"text-field":[`get`,`label`],"text-font":[`Noto Sans Bold`],"text-size":11,"text-anchor":`left`,"text-offset":[.8,0],"text-optional":!0,"symbol-sort-key":[`case`,[`get`,`selected`],0,1]},paint:{"text-color":`#0f172a`,"text-halo-color":`#ffffff`,"text-halo-width":1.5}}),QW(e,t.primaryColor,t.accentColor)}function eG(e){let t=document.createElement(`div`);t.className=`rm-origin`;let n=document.createElement(`span`);n.className=`rm-origin__dot`;let r=document.createElement(`span`);return r.className=`rm-origin__label`,r.textContent=`${e.city||e.name} (${e.iata})`,t.append(n,r),t}function tG(e){let t=document.createElement(`div`),n=document.createElement(`strong`);n.textContent=`${e.label} (${e.iata})`;let r=document.createElement(`div`);return r.className=`rm-popup__meta`,r.textContent=[e.nonstop?`Nonstop`:`1 stop`,e.seasonal?`Seasonal`:null].filter(Boolean).join(` · `),t.append(n,r),t}function nG(e,t,n){e.getSource(YW)?.setData(t),e.getSource(XW)?.setData(n)}function rG(e){let t=(0,G.useRef)(null),n=(0,G.useRef)(null),r=(0,G.useRef)(e),[i,a]=(0,G.useState)(`loading`),o=`${e.origin.iata}:${e.origin.latitude}:${e.origin.longitude}`;(0,G.useEffect)(()=>{r.current=e}),(0,G.useEffect)(()=>{let e=!1,i=null,o=null;return VU().then(s=>{let c=t.current;if(e||!c)return;let l=r.current;i=new s.Map({container:c,style:l.styleUrl,bounds:CU[l.region],fitBoundsOptions:{padding:24},attributionControl:{compact:!0},cooperativeGestures:!0,dragRotate:!1,pitchWithRotate:!1,touchPitch:!1}),i.touchZoomRotate.disableRotation(),n.current=i,new s.Marker({element:eG(l.origin),anchor:`left`,offset:[-9,0]}).setLngLat([l.origin.longitude,l.origin.latitude]).addTo(i);let u=new s.Popup({closeButton:!1,closeOnClick:!1,offset:10,className:`rm-popup`}),d=i;d.on(`load`,()=>{e||($W(d,r.current),c.querySelector(`.maplibregl-ctrl-attrib`)?.classList.remove(`maplibregl-compact-show`),a(`ready`))}),d.on(`mouseenter`,ZW,e=>{let t=e.features?.[0];t&&t.geometry.type===`Point`&&(d.getCanvas().style.cursor=`pointer`,u.setLngLat(t.geometry.coordinates).setDOMContent(tG(t.properties)).addTo(d))}),d.on(`mouseleave`,ZW,()=>{d.getCanvas().style.cursor=``,u.remove()}),d.on(`click`,ZW,e=>{let t=e.features?.[0]?.properties?.iata;typeof t==`string`&&r.current.onSelect(t)}),o=new ResizeObserver(()=>d.resize()),o.observe(c)}).catch(t=>{console.warn(`[airport-one-widgets] route map unavailable:`,t),e||a(`error`)}),()=>{e=!0,o?.disconnect(),i?.remove(),n.current=null}},[e.styleUrl,o]),(0,G.useEffect)(()=>{let t=n.current;i===`ready`&&t&&nG(t,e.points,e.lines)},[i,e.points,e.lines]),(0,G.useEffect)(()=>{let t=n.current;i===`ready`&&t&&QW(t,e.primaryColor,e.accentColor,e.airlineHighlightColor)},[i,e.primaryColor,e.accentColor,e.airlineHighlightColor]),(0,G.useEffect)(()=>{let t=n.current;i===`ready`&&t&&t.fitBounds(CU[e.region],{padding:24,duration:800})},[i,e.region,e.regionToken]),(0,G.useEffect)(()=>{let t=n.current;i===`ready`&&t&&e.focusBounds&&t.fitBounds(e.focusBounds,{padding:{top:60,bottom:60,left:60,right:60},maxZoom:6,duration:900})},[i,e.focusBounds]);let s=`aone:flex aone:size-9 aone:items-center aone:justify-center aone:text-slate-700 aone:hover:bg-slate-50 aone:cursor-pointer aone:disabled:opacity-40`;return(0,K.jsxs)(`div`,{className:`aone:relative aone:h-full aone:w-full aone:overflow-hidden aone:bg-[#dfe8f2]`,children:[(0,K.jsx)(`div`,{className:`aone:absolute aone:inset-0`,children:(0,K.jsx)(`div`,{ref:t,part:`route-map-canvas`,style:{width:`100%`,height:`100%`}})}),i===`loading`?(0,K.jsx)(`div`,{className:`aone:absolute aone:inset-0 aone:flex aone:items-center aone:justify-center aone:text-sm aone:text-slate-500`,children:`Loading map…`}):null,i===`error`?(0,K.jsx)(`div`,{className:`aone:absolute aone:inset-0 aone:flex aone:items-center aone:justify-center aone:p-6 aone:text-center aone:text-sm aone:text-slate-600`,children:e.mapOnly?`The map couldn't load here.`:`The map couldn't load here. The destination list still works.`}):null,i===`ready`?(0,K.jsxs)(`div`,{className:`aone:absolute aone:top-3 aone:right-3 aone:flex aone:flex-col aone:divide-y aone:divide-slate-200 aone:overflow-hidden aone:rounded-xl aone:border aone:border-slate-200 aone:bg-white aone:shadow-sm`,children:[(0,K.jsx)(`button`,{type:`button`,"aria-label":`Zoom in`,className:s,onClick:()=>n.current?.zoomIn(),children:(0,K.jsx)(iN,{icon:$E,className:`aone:size-3.5`})}),(0,K.jsx)(`button`,{type:`button`,"aria-label":`Zoom out`,className:s,onClick:()=>n.current?.zoomOut(),children:(0,K.jsx)(iN,{icon:IE,className:`aone:size-3.5`})}),(0,K.jsx)(`button`,{type:`button`,"aria-label":`Reset map view`,className:s,onClick:()=>n.current?.fitBounds(CU[e.region],{padding:24,duration:800}),children:(0,K.jsx)(iN,{icon:KE,className:`aone:size-3.5`})})]}):null,(0,K.jsx)(`div`,{className:`rm-legend-slot aone:pointer-events-none aone:absolute aone:bottom-3 aone:left-3`,children:e.legend})]})}function iG({kicker:e,heading:t,description:n,originIata:r,mapOnly:i,hideFilters:a}){let o=`Every dot is somewhere you can fly from ${r}.`,s=n??(i?`${o} Tap a city to see flights.`:a?`${o} Tap a city or search the list.`:`${o} Pick a hub to see what it unlocks, or search the list.`);return(0,K.jsxs)(`header`,{part:`route-map-header`,className:`aone:mb-4`,children:[e?(0,K.jsx)(`p`,{className:`aone:text-xs aone:font-semibold aone:tracking-[0.12em] aone:text-[var(--rm-accent)] aone:uppercase`,children:e}):null,(0,K.jsx)(`h2`,{className:`aone:mt-1 aone:text-3xl aone:font-semibold aone:text-slate-900 aone:dark:text-white`,children:t}),s?(0,K.jsx)(`p`,{className:`aone:mt-2 aone:text-sm aone:text-slate-600 aone:dark:text-slate-300`,children:s}):null]})}function aG({color:e,hollow:t}){return(0,K.jsx)(`span`,{"aria-hidden":!0,className:`aone:inline-block aone:size-2.5 aone:rounded-full`,style:t?{border:`2px solid ${e}`,background:`#fff`}:{background:e}})}function oG({counts:e,showSeasonal:t}){let n=[{key:`nonstop`,label:`Nonstop (${ZU(e.nonstop)})`,swatch:(0,K.jsx)(aG,{color:`var(--rm-accent)`})},{key:`one-stop`,label:`1 Stop (${ZU(e.oneStop)})`,swatch:(0,K.jsx)(aG,{color:`var(--rm-primary)`})},...t?[{key:`seasonal-nonstop`,label:`Seasonal nonstop`,swatch:(0,K.jsx)(aG,{color:`var(--rm-accent)`,hollow:!0})},{key:`seasonal-one-stop`,label:`Seasonal 1 stop`,swatch:(0,K.jsx)(aG,{color:`var(--rm-primary)`,hollow:!0})}]:[]];return(0,K.jsx)(`ul`,{part:`route-map-legend`,className:`aone:space-y-1 aone:rounded-xl aone:bg-white/95 aone:px-3 aone:py-2 aone:text-xs aone:text-slate-700 aone:shadow-sm`,children:n.map(e=>(0,K.jsxs)(`li`,{className:`aone:flex aone:items-center aone:gap-2`,children:[e.swatch,e.label]},e.key))})}function sG({title:e,description:t,onClose:n,onReset:r,resetLabel:i}){return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`aone:flex aone:items-start aone:justify-between aone:gap-3`,children:[(0,K.jsx)(`h3`,{className:`aone:text-base aone:font-semibold aone:text-slate-900`,children:e}),(0,K.jsxs)(`div`,{className:`aone:-mt-1 aone:flex aone:shrink-0 aone:items-center aone:gap-1`,children:[r?(0,K.jsxs)(`button`,{type:`button`,part:`route-map-filter-reset`,"aria-label":i??`Reset`,onClick:r,className:`aone:inline-flex aone:h-8 aone:items-center aone:gap-1.5 aone:rounded-full aone:px-2.5 aone:text-sm aone:font-medium aone:text-[var(--rm-primary)] aone:hover:bg-[color-mix(in_srgb,var(--rm-primary)_8%,white)] aone:cursor-pointer`,children:[(0,K.jsx)(iN,{icon:tD,className:`aone:size-3.5`,"aria-hidden":!0}),`Reset`]}):null,(0,K.jsx)(`button`,{type:`button`,"aria-label":`Close`,onClick:n,className:`aone:inline-flex aone:size-8 aone:shrink-0 aone:items-center aone:justify-center aone:rounded-full aone:bg-slate-100 aone:text-slate-600 aone:hover:bg-slate-200 aone:cursor-pointer`,children:(0,K.jsx)(iN,{icon:YE,className:`aone:size-4`})})]})]}),(0,K.jsx)(`p`,{className:`aone:mt-1 aone:mb-3 aone:text-xs aone:text-slate-500`,children:t})]})}function cG({icon:e,label:t,active:n,open:r,onOpenChange:i,title:a,description:o,children:s,align:c=`start`,variant:l=`popover`,doneLabel:u=`Done`,onReset:d,resetLabel:f}){let p=(0,G.useRef)(null),m=(0,G.useRef)(null),h=(0,G.useRef)(null),g=IW(),_=(0,G.useId)(),v=l===`drawer`;(0,G.useEffect)(()=>{let e=p.current;if(!r||!e)return;let t=e=>{e.key===`Escape`&&i(!1)};if(document.addEventListener(`keydown`,t),v)return()=>document.removeEventListener(`keydown`,t);let n=e.getRootNode(),a=n instanceof ShadowRoot?n.host:null,o=t=>{t.composedPath().includes(e)||i(!1)},s=t=>{let n=t.composedPath();(a?!n.includes(a):!n.includes(e))&&i(!1)};return a&&n.addEventListener(`pointerdown`,o,!0),document.addEventListener(`pointerdown`,s,!0),()=>{a&&n.removeEventListener(`pointerdown`,o,!0),document.removeEventListener(`pointerdown`,s,!0),document.removeEventListener(`keydown`,t)}},[r,i,v]),(0,G.useEffect)(()=>{if(!r||!v)return;let e=m.current,t=document.documentElement.style.overflow;return document.documentElement.style.overflow=`hidden`,h.current?.focus(),()=>{document.documentElement.style.overflow=t,e?.focus()}},[r,v]);let y=()=>i(!1),b=(0,K.jsxs)(`div`,{className:`rm-drawer`,part:`route-map-filter-drawer`,children:[(0,K.jsx)(`div`,{className:`rm-drawer__backdrop`,"aria-hidden":!0,onClick:y}),(0,K.jsxs)(`div`,{ref:h,id:_,role:`dialog`,"aria-modal":`true`,"aria-label":a,tabIndex:-1,className:`rm-drawer__sheet`,children:[(0,K.jsx)(`div`,{className:`rm-drawer__handle`,"aria-hidden":!0}),(0,K.jsx)(sG,{title:a,description:o,onClose:y,onReset:d,resetLabel:f}),(0,K.jsx)(`div`,{className:`rm-drawer__chips aone:flex aone:flex-wrap aone:gap-2`,children:s}),(0,K.jsx)(`button`,{type:`button`,onClick:y,className:`aone:mt-4 aone:w-full aone:rounded-full aone:bg-[var(--rm-primary)] aone:px-4 aone:py-3 aone:text-sm aone:font-semibold aone:text-white aone:cursor-pointer`,children:u})]})]});return(0,K.jsxs)(`div`,{ref:p,className:`rm-filter aone:relative`,children:[(0,K.jsxs)(`button`,{ref:m,type:`button`,part:`route-map-filter-button`,"aria-expanded":r,"aria-controls":_,"aria-haspopup":`dialog`,onClick:()=>i(!r),className:[`rm-filter__button aone:inline-flex aone:h-9 aone:items-center aone:gap-2 aone:rounded-full aone:border aone:px-3.5 aone:text-sm aone:whitespace-nowrap aone:font-medium aone:transition-colors aone:cursor-pointer`,n?`aone:border-[var(--rm-primary)] aone:bg-[color-mix(in_srgb,var(--rm-primary)_8%,white)] aone:text-[var(--rm-primary)]`:`aone:border-slate-200 aone:bg-white aone:text-slate-800 aone:hover:border-slate-300`,r?`aone:ring-2 aone:ring-[var(--rm-primary)]/30`:``].join(` `),children:[(0,K.jsx)(iN,{icon:e,className:`rm-filter__icon aone:size-3.5`,"aria-hidden":!0}),(0,K.jsx)(`span`,{className:`rm-filter__label aone:max-w-36 aone:truncate`,children:t}),(0,K.jsx)(iN,{icon:ZE,className:`aone:size-3 aone:shrink-0 aone:transition-transform ${r?`aone:rotate-180`:``}`,"aria-hidden":!0})]}),r&&v?g?(0,cv.createPortal)(b,g):b:null,r&&!v?(0,K.jsxs)(`div`,{id:_,role:`dialog`,"aria-label":a,part:`route-map-filter-panel`,className:[`aone:absolute aone:top-full aone:z-30 aone:mt-2 aone:w-[min(26rem,calc(100vw-2rem))] aone:rounded-2xl aone:border aone:border-slate-200 aone:bg-white aone:p-4 aone:shadow-xl`,c===`end`?`aone:right-0`:`aone:left-0`].join(` `),children:[(0,K.jsx)(sG,{title:a,description:o,onClose:y,onReset:d,resetLabel:f}),(0,K.jsx)(`div`,{className:`aone:flex aone:flex-wrap aone:gap-2`,children:s})]}):null]})}function lG({selected:e,onClick:t,children:n}){return(0,K.jsx)(`button`,{type:`button`,"aria-pressed":e,onClick:t,className:[`aone:inline-flex aone:items-center aone:gap-2 aone:rounded-full aone:border aone:px-3.5 aone:py-1.5 aone:text-sm aone:font-medium aone:transition-colors aone:cursor-pointer`,e?`aone:border-slate-900 aone:bg-slate-900 aone:text-white`:`aone:border-slate-200 aone:bg-white aone:text-slate-800 aone:hover:border-slate-400`].join(` `),children:n})}function uG({hub:e,count:t,selected:n,onClick:r}){return(0,K.jsxs)(lG,{selected:n,onClick:r,children:[(0,K.jsx)(`span`,{className:`aone:font-semibold`,children:e.iata}),(0,K.jsx)(`span`,{className:n?`aone:text-white/80`:`aone:text-slate-500`,children:e.city}),(0,K.jsx)(`span`,{className:[`aone:rounded-full aone:px-2 aone:text-xs aone:font-semibold aone:tabular-nums`,n?`aone:bg-white/20 aone:text-white`:`aone:bg-[color-mix(in_srgb,var(--rm-primary)_10%,white)] aone:text-[var(--rm-primary)]`].join(` `),children:t})]})}function dG({className:e,onReset:t}){return(0,K.jsxs)(`button`,{type:`button`,part:`route-map-reset`,"aria-label":`Reset filters`,onClick:t,className:`${e} aone:inline-flex aone:h-9 aone:shrink-0 aone:items-center aone:gap-1.5 aone:rounded-full aone:px-3 aone:text-sm aone:whitespace-nowrap aone:font-medium aone:text-[var(--rm-primary)] aone:hover:bg-[color-mix(in_srgb,var(--rm-primary)_8%,white)] aone:cursor-pointer`,children:[(0,K.jsx)(iN,{icon:tD,className:`aone:size-3.5`,"aria-hidden":!0}),`Reset`]})}function fG({label:e,options:t,value:n,onChange:r,className:i}){return(0,K.jsx)(`div`,{role:`radiogroup`,"aria-label":e,className:[`aone:inline-flex aone:items-center aone:gap-1 aone:rounded-full aone:bg-slate-100 aone:p-1`,i??``].join(` `),children:t.map(e=>{let t=e.value===n;return(0,K.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":t,onClick:()=>r(e.value),className:[`rm-segment aone:rounded-full aone:px-3.5 aone:py-1.5 aone:text-sm aone:font-medium aone:whitespace-nowrap aone:transition-colors aone:cursor-pointer`,t?`aone:bg-[var(--rm-primary)] aone:text-white aone:shadow-sm`:`aone:text-slate-700 aone:hover:text-slate-950`].join(` `),children:e.content},e.value)})})}var pG=[{value:`all`,label:`All`,count:`all`},{value:`nonstop`,label:`Nonstop`,count:`nonstop`},{value:`one-stop`,label:`One-stop`,count:`oneStop`}];function mG(e,t){switch(t){case`nonstop`:return e.nonstop;case`one-stop`:return e.oneStop;case`all`:return e.all}}function hG({title:e,children:t}){return(0,K.jsxs)(`section`,{className:`rm-filters-sheet__section`,children:[(0,K.jsx)(`h4`,{className:`rm-filters-sheet__heading`,children:e}),(0,K.jsx)(`div`,{className:`aone:flex aone:flex-wrap aone:gap-2`,children:t})]})}function gG({open:e,onClose:t,doneLabel:n,onResetAll:r,triggerRef:i,children:a}){let o=(0,G.useRef)(null),s=IW(),c=(0,G.useId)();if((0,G.useEffect)(()=>{if(!e)return;let n=i.current,r=e=>{e.key===`Escape`&&t()};document.addEventListener(`keydown`,r);let a=document.documentElement.style.overflow;return document.documentElement.style.overflow=`hidden`,o.current?.focus(),()=>{document.removeEventListener(`keydown`,r),document.documentElement.style.overflow=a,n?.focus()}},[e,t,i]),!e)return null;let l=(0,K.jsxs)(`div`,{className:`rm-drawer`,part:`route-map-filter-drawer`,children:[(0,K.jsx)(`div`,{className:`rm-drawer__backdrop`,"aria-hidden":!0,onClick:t}),(0,K.jsxs)(`div`,{ref:o,id:c,role:`dialog`,"aria-modal":`true`,"aria-label":`Filters`,tabIndex:-1,className:`rm-drawer__sheet`,children:[(0,K.jsx)(`div`,{className:`rm-drawer__handle`,"aria-hidden":!0}),(0,K.jsxs)(`div`,{className:`aone:flex aone:items-start aone:justify-between aone:gap-3`,children:[(0,K.jsx)(`h3`,{className:`aone:text-base aone:font-semibold aone:text-slate-900`,children:`Filters`}),(0,K.jsxs)(`div`,{className:`aone:-mt-1 aone:flex aone:shrink-0 aone:items-center aone:gap-1`,children:[r?(0,K.jsx)(`button`,{type:`button`,part:`route-map-filter-reset`,"aria-label":`Reset filters`,onClick:r,className:`aone:inline-flex aone:h-8 aone:items-center aone:gap-1.5 aone:rounded-full aone:px-2.5 aone:text-sm aone:font-medium aone:text-[var(--rm-primary)] aone:hover:bg-[color-mix(in_srgb,var(--rm-primary)_8%,white)] aone:cursor-pointer`,children:`Reset`}):null,(0,K.jsx)(`button`,{type:`button`,"aria-label":`Close`,onClick:t,className:`aone:inline-flex aone:size-8 aone:shrink-0 aone:items-center aone:justify-center aone:rounded-full aone:bg-slate-100 aone:text-slate-600 aone:hover:bg-slate-200 aone:cursor-pointer`,children:(0,K.jsx)(iN,{icon:YE,className:`aone:size-4`})})]})]}),(0,K.jsx)(`p`,{className:`aone:mt-1 aone:mb-3 aone:text-xs aone:text-slate-500`,children:`Narrow destinations by airline, travel month, hub, or seasonality.`}),(0,K.jsx)(`div`,{className:`rm-filters-sheet__body`,children:a}),(0,K.jsx)(`button`,{type:`button`,onClick:t,className:`aone:mt-4 aone:w-full aone:rounded-full aone:bg-[var(--rm-primary)] aone:px-4 aone:py-3 aone:text-sm aone:font-semibold aone:text-white aone:cursor-pointer`,children:n})]})]});return s?(0,cv.createPortal)(l,s):l}function _G({filters:e,startingFilters:t,onFiltersChange:n,counts:r,airlines:i,months:a,hubs:o,hubCounts:s,hasSeasonal:c,fullscreen:l,onToggleFullscreen:u,onReset:d}){let[f,p]=(0,G.useState)(null),m=(0,G.useRef)(null),h=e=>t=>p(t?e:null),g=NW(),_=g?`drawer`:`popover`,v=e=>{n(e),g||p(null)},y=mG(r,e.stops),b=nW(e,t),x=e.seasonalOnly!==t.seasonalOnly,S=b.airline?()=>n({airline:t.airline}):void 0,C=b.months?()=>n({months:[...t.months]}):void 0,w=b.hub?()=>n({hub:t.hub}):void 0,T=b.airline||b.months||b.hub||x?()=>n({airline:t.airline,months:[...t.months],hub:t.hub,seasonalOnly:t.seasonalOnly}):void 0,E=`Show ${ZU(y)} ${y===1?`destination`:`destinations`}`,D=i.find(t=>t.code===e.airline),O=o.find(t=>t.iata===e.hub),k=[e.airline,e.months.length>0,e.hub,e.seasonalOnly].filter(Boolean).length,A=c||e.seasonalOnly,j=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(lG,{selected:!e.airline,onClick:()=>v({airline:null}),children:`All airlines`}),i.map(t=>(0,K.jsxs)(lG,{selected:e.airline===t.code,onClick:()=>v({airline:t.code}),children:[(0,K.jsx)(OW,{airline:t,className:`aone:size-4`}),t.shortName]},t.code))]}),M=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(lG,{selected:e.months.length===0,onClick:()=>n({months:[]}),children:`Any time`}),a.map((t,r)=>{let i=e.months.includes(t);return(0,K.jsx)(lG,{selected:i,onClick:()=>n({months:a.filter(n=>n===t?!i:e.months.includes(n))}),children:(0,K.jsx)(`span`,{title:KU(t),children:qU(t,r)})},t)})]}),N=o.length>0?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(lG,{selected:!e.hub,onClick:()=>v({hub:null}),children:`All hubs`}),o.map(t=>(0,K.jsx)(uG,{hub:t,count:s.get(t.iata)??0,selected:e.hub===t.iata,onClick:()=>v({hub:t.iata,stops:e.stops===`nonstop`?`all`:e.stops})},t.iata))]}):null,P=A?(0,K.jsxs)(`button`,{type:`button`,"aria-pressed":e.seasonalOnly,title:`Show only seasonal destinations`,onClick:()=>n({seasonalOnly:!e.seasonalOnly}),className:[`rm-seasonal-button aone:inline-flex aone:h-9 aone:shrink-0 aone:items-center aone:gap-1.5 aone:rounded-full aone:border aone:px-3 aone:text-sm aone:font-medium aone:whitespace-nowrap aone:cursor-pointer`,e.seasonalOnly?`aone:border-[var(--rm-primary)] aone:bg-[color-mix(in_srgb,var(--rm-primary)_8%,white)] aone:text-[var(--rm-primary)]`:`aone:border-slate-200 aone:bg-white aone:text-slate-800 aone:hover:border-slate-300`].join(` `),children:[(0,K.jsx)(iN,{icon:JE,className:`aone:size-3.5`}),`Seasonal`]}):null;return(0,K.jsxs)(`div`,{part:`route-map-toolbar`,className:`rm-toolbar aone:flex aone:flex-wrap aone:items-center aone:gap-2 aone:border-b aone:border-slate-200 aone:p-3`,children:[(0,K.jsx)(fG,{className:`rm-toolbar__stops`,label:`Stops`,value:e.stops,onChange:e=>n({stops:e}),options:pG.map(e=>({value:e.value,content:e.value===`one-stop`?e.label:(0,K.jsxs)(K.Fragment,{children:[e.label,` `,(0,K.jsx)(`span`,{className:`rm-segment__count aone:inline-block aone:min-w-[3ch] aone:text-left aone:tabular-nums`,children:e.value===`all`?r.all.toLocaleString(`en-US`):ZU(r[e.count])})]})}))}),(0,K.jsxs)(`div`,{className:`rm-toolbar__filters aone:flex aone:flex-wrap aone:items-center aone:gap-2`,children:[g?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`rm-filter aone:relative`,children:(0,K.jsxs)(`button`,{ref:m,type:`button`,part:`route-map-filter-button`,"aria-expanded":f===`filters`,"aria-haspopup":`dialog`,onClick:()=>p(e=>e===`filters`?null:`filters`),className:[`rm-filter__button aone:inline-flex aone:h-9 aone:items-center aone:gap-2 aone:rounded-full aone:border aone:px-3.5 aone:text-sm aone:whitespace-nowrap aone:font-medium aone:transition-colors aone:cursor-pointer`,k>0?`aone:border-[var(--rm-primary)] aone:bg-[color-mix(in_srgb,var(--rm-primary)_8%,white)] aone:text-[var(--rm-primary)]`:`aone:border-slate-200 aone:bg-white aone:text-slate-800 aone:hover:border-slate-300`,f===`filters`?`aone:ring-2 aone:ring-[var(--rm-primary)]/30`:``].join(` `),children:[(0,K.jsx)(iN,{icon:qE,className:`rm-filter__icon aone:size-3.5`,"aria-hidden":!0}),(0,K.jsxs)(`span`,{className:`rm-filter__label`,children:[`Filters`,k>0?` · ${k}`:``]})]})}),(0,K.jsxs)(gG,{open:f===`filters`,onClose:()=>p(null),doneLabel:E,onResetAll:T,triggerRef:m,children:[(0,K.jsx)(hG,{title:`Airline`,children:j}),(0,K.jsx)(hG,{title:`When are you traveling?`,children:M}),N?(0,K.jsx)(hG,{title:`Connect through a hub`,children:N}):null,P?(0,K.jsx)(hG,{title:`Seasonality`,children:P}):null]})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(cG,{variant:_,doneLabel:E,icon:BE,onReset:S,resetLabel:`Reset airline`,label:D?.shortName??`Airline`,active:!!D,open:f===`airline`,onOpenChange:h(`airline`),title:`Airline`,description:`Show only routes flown by one airline.`,children:j}),(0,K.jsx)(cG,{variant:_,doneLabel:E,icon:WE,onReset:C,resetLabel:`Reset travel months`,label:YU(e.months,a),active:e.months.length>0,open:f===`month`,onOpenChange:h(`month`),title:`When are you traveling?`,description:`Pick one or more months. Routes that don't fly then fade on the map and drop to the bottom of the list.`,children:M}),o.length>0?(0,K.jsx)(cG,{variant:_,doneLabel:E,icon:VE,onReset:w,resetLabel:`Reset connecting hub`,label:O?`Via ${O.iata}`:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`rm-label-long`,children:`Connect via`}),(0,K.jsx)(`span`,{className:`rm-label-short`,children:`Hub`})]}),active:!!O,open:f===`hub`,onOpenChange:h(`hub`),title:`Connect through a hub`,description:`See what a single connection through each hub unlocks.`,children:N}):null,P]}),d?(0,K.jsx)(dG,{className:`rm-toolbar__reset`,onReset:()=>{p(null),d()}}):null]}),(0,K.jsx)(`div`,{className:`rm-toolbar__view aone:ml-auto aone:flex aone:items-center aone:gap-2`,children:(0,K.jsx)(`button`,{type:`button`,onClick:u,"aria-label":l?`Exit full screen`:`Full screen`,"aria-pressed":l,className:`rm-fullscreen-button aone:inline-flex aone:size-10 aone:items-center aone:justify-center aone:rounded-xl aone:border aone:border-slate-200 aone:bg-white aone:text-slate-700 aone:hover:border-slate-300 aone:cursor-pointer`,children:(0,K.jsx)(iN,{icon:l?eD:zE,className:`aone:size-4`})})})]})}var vG=`Route Map - Destination Opened`,yG=`https://flymyairport.com`,bG=/^[A-Z]{3}$/;function xG(e){let t=e.originIata.trim().toUpperCase(),n=e.destinationIata.trim().toUpperCase();if(!bG.test(t)||!bG.test(n))return null;let r=new URL(`/from/${t}/to/${n}`,yG),i=Np(e.widgetInstanceId);i&&r.searchParams.set(Ap,i);let a=Np(e.widgetType);return a&&r.searchParams.set(jp,a),r.searchParams.set(`enc_lid`,yp({airport:t,channel:`EMB`,page:`DEST`,action:`WLFLIGHTS`,originIATA:t,destinationIATA:n})),r.searchParams.set(`consent_analytics`,e.consentAnalytics?`true`:`false`),e.clickId&&r.searchParams.set(`enc_cid`,e.clickId),e.fromUrl&&r.searchParams.set(`from_url`,e.fromUrl),r.toString()}function SG(e){if(!e.consentAnalytics||typeof window>`u`)return;let t=e.originIata.trim().toUpperCase(),n=e.destinationIata.trim().toUpperCase(),r=Np(e.widgetInstanceId);Am({name:vG,properties:{airport_iata:t,origin:t,destination:n,desination:n,href:e.href,widget_type:e.widgetType,...r?{widget_instance_id:r}:{}}})}function CG(e){let t=xG(e);t&&typeof window<`u`&&(SG({...e,href:t}),window.open(t,`_blank`,`noopener,noreferrer`))}var wG=[`#0B3D91`,`#C8102E`,`#00853E`,`#5C068C`,`#00A3E0`,`#E35205`,`#6B2D5B`,`#FFB81C`,`#0033A0`,`#007A33`,`#A6192E`,`#2D9CDB`];function TG(e){let t=0;for(let n=0;n<e.length;n+=1)t=t*31+e.charCodeAt(n)>>>0;return t}function EG(e){let t=e.trim().toUpperCase();return t?wG[TG(t)%wG.length]:wG[0]}var DG=e=>e*Math.PI/180,OG=e=>e*180/Math.PI;function kG(e,t,n=48){let[r,i]=[DG(e[0]),DG(e[1])],[a,o]=[DG(t[0]),DG(t[1])],s=2*Math.asin(Math.sqrt(Math.sin((o-i)/2)**2+Math.cos(i)*Math.cos(o)*Math.sin((a-r)/2)**2));if(!Number.isFinite(s)||s<1e-9)return[e,t];let c=[];for(let e=0;e<=n;e+=1){let t=e/n,l=Math.sin((1-t)*s)/Math.sin(s),u=Math.sin(t*s)/Math.sin(s),d=l*Math.cos(i)*Math.cos(r)+u*Math.cos(o)*Math.cos(a),f=l*Math.cos(i)*Math.sin(r)+u*Math.cos(o)*Math.sin(a),p=l*Math.sin(i)+u*Math.sin(o);c.push([OG(Math.atan2(f,d)),OG(Math.atan2(p,Math.sqrt(d*d+f*f)))])}for(let e=1;e<c.length;e+=1){let t=c[e-1][0],n=c[e][0];for(;n-t>180;)n-=360;for(;n-t<-180;)n+=360;c[e][0]=n}return c}var AG=e=>[e.longitude,e.latitude];function jG(e,t){return{type:`FeatureCollection`,features:e.map(e=>({type:`Feature`,geometry:{type:`Point`,coordinates:AG(e.destination)},properties:{iata:e.destination.iata,label:e.destination.city||e.destination.iata,nonstop:e.nonstop,seasonal:e.seasonal,faded:e.faded,selected:e.destination.iata===t.selectedIata,labelled:e.nonstop||e.isHub||t.hubIatas.has(e.destination.iata)}}))}}function MG(e){let t=new Map;if(e.length<=1){for(let n of e)t.set(n,0);return t}let n=(e.length-1)/2;return e.forEach((e,r)=>{t.set(e,(r-n)*2.5)}),t}function NG(e,t,n,r){e.push({type:`Feature`,geometry:{type:`LineString`,coordinates:kG(t,n)},properties:{kind:`selected`,faded:!1,color:r.color,dashed:r.dashed,offset:r.offset,styleIndex:r.styleIndex,width:r.width,airline:r.airline,via:r.via,pathRole:r.pathRole}})}function PG(e,t,n,r,i,a){let o=AG(n.destination),s=[...new Set(n.options.filter(e=>e.via===null).map(e=>e.airline))].sort((e,t)=>e.localeCompare(t)),c=MG(s);for(let n of s)NG(e,t,o,{color:`#0f172a`,dashed:!1,offset:c.get(n)??0,width:3.25,airline:n,via:null,pathRole:`nonstop`});let l=CW(n.options,i,a);for(let n of l){let i=r.get(n.via);if(!i)continue;let a=AG(i),s={color:n.style.color,dashed:n.style.dasharray!=null,offset:0,styleIndex:n.styleIndex,width:n.style.width,airline:n.airlines[0],via:n.via,pathRole:`connecting`};NG(e,t,a,s),NG(e,a,o,s)}}function FG(e){let t=AG(e.origin),n=[],r=(e,t,r,i=!1)=>{n.push({type:`Feature`,geometry:{type:`LineString`,coordinates:kG(e,t)},properties:{kind:r,faded:i}})},i=e.hub?e.destinationsByIata.get(e.hub):void 0;for(let n of e.views){let e=AG(n.destination);i?n.isHub?r(t,e,`hub`,n.faded):r(AG(i),e,`connecting`,n.faded):r(t,e,n.nonstop?`nonstop`:`connecting`,n.faded)}if(e.selected){let r=e.cityByIata??new Map([...e.destinationsByIata.values()].map(e=>[e.iata,e.city])),i=e.airlineLabel??(e=>e);PG(n,t,e.selected,e.destinationsByIata,r,i)}return{type:`FeatureCollection`,features:n}}function IG(e){let{originIata:t,instanceId:n,consentAnalytics:r}=e,{clickId:i}=fh(),a=(0,G.useCallback)(e=>({originIata:t,destinationIata:e,widgetInstanceId:n,widgetType:kU,consentAnalytics:r,clickId:i,fromUrl:window.location.href}),[t,n,r,i]);return{linkInput:a,destinationUrl:(0,G.useCallback)(e=>xG(a(e)),[a]),onOpenDestination:(0,G.useCallback)(e=>{let t=a(e),n=xG(t);n&&SG({...t,href:n})},[a])}}function LG(e){let[t,n]=(0,G.useState)(!1),[r,i]=(0,G.useState)(!1);(0,G.useEffect)(()=>{let t=()=>{let t=e.current?.getRootNode();n(!!(t&&t.fullscreenElement===e.current))};return document.addEventListener(`fullscreenchange`,t),()=>document.removeEventListener(`fullscreenchange`,t)},[e]),(0,G.useEffect)(()=>{if(!r)return;let e=e=>{e.key===`Escape`&&i(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]);let a=(0,G.useCallback)(async()=>{let n=e.current;if(n){if(t)await document.exitFullscreen().catch(()=>void 0);else if(r)i(!1);else{if(typeof n.requestFullscreen==`function`)try{await n.requestFullscreen();return}catch{}i(!0)}}},[t,r,e]);return{fullscreen:t||r,overlay:r,toggle:a}}function RG(e,t,n){let r=[e,t.destination];for(let e of t.vias){let t=n.get(e);t&&r.push(t)}let i=r.map(e=>e.longitude),a=r.map(e=>e.latitude);return[[Math.min(...i),Math.min(...a)],[Math.max(...i),Math.max(...a)]]}function zG({payload:e,settings:t}){let n=(0,G.useRef)(null),[r,i]=(0,G.useState)(null),[a,o]=(0,G.useState)(null),s=PW(a),[c]=(0,G.useState)(()=>{let n=bW(e,t.initialSettings);return{filters:eW(n.filters),sort:n.sort}}),[l,u]=(0,G.useState)(()=>eW(c.filters)),[d,f]=(0,G.useState)(``),[p,m]=(0,G.useState)(c.sort),[h,g]=(0,G.useState)(null),[_,v]=(0,G.useState)(0),{fullscreen:y,overlay:b,toggle:x}=LG(n),S=rW(l,c.filters)&&p===c.sort&&d===``&&h===null,C=(0,G.useCallback)(()=>{u(eW(c.filters)),m(c.sort),f(``),g(null),v(e=>e+1)},[c]),w=(0,G.useMemo)(()=>uW(e,l),[e,l]),T=(0,G.useMemo)(()=>new Map(e.airlines.map(e=>[e.code,e])),[e]),E=(0,G.useMemo)(()=>new Map(e.destinations.map(e=>[e.iata,e])),[e]),D=(0,G.useMemo)(()=>new Map(e.destinations.map(e=>[e.iata,e.city])),[e]),O=(0,G.useMemo)(()=>new Set(e.hubs.map(e=>e.iata)),[e]),k=w.destinations.find(e=>e.destination.iata===h)??null,A=k?h:null,j=(0,G.useMemo)(()=>pW(w.destinations.filter(e=>fW(e.destination,d)),p),[w,d,p]),M=(0,G.useMemo)(()=>jG(w.destinations,{selectedIata:A,hubIatas:O}),[w,A,O]),N=(0,G.useMemo)(()=>FG({origin:e.origin,views:w.destinations,destinationsByIata:E,cityByIata:D,airlineLabel:e=>T.get(e)?.shortName??e,hub:l.hub,selected:k}),[e.origin,w,E,D,T,l.hub,k]),P=k?`${k.destination.iata}|${k.vias.join(`,`)}`:null,ee=(0,G.useMemo)(()=>k?RG(e.origin,k,E):null,[P]),F=(0,G.useCallback)(e=>{u(t=>eW({...t,...e,months:e.months===void 0?t.months:e.months}))},[]),{linkInput:te,destinationUrl:ne,onOpenDestination:I}=IG({originIata:e.origin.iata,instanceId:t.instanceId,consentAnalytics:t.consentAnalytics}),re=(0,G.useCallback)(e=>{if(t.mapOnly)e&&CG(te(e));else if(g(e),e&&d){let t=E.get(e);t&&!fW(t,d)&&f(``)}},[E,d,t.mapOnly,te]),L=w.hasSeasonal||w.destinations.some(e=>e.seasonal),ie=l.airline?EG(l.airline):null;return(0,K.jsx)(FW.Provider,{value:r,children:(0,K.jsx)(MW.Provider,{value:s,children:(0,K.jsxs)(`div`,{ref:n,className:t.hideHeader?`rm-root rm-root--no-title`:`rm-root`,"data-fullscreen":y?`true`:void 0,"data-overlay":b?`true`:void 0,"data-hide-header":t.hideHeader?`true`:void 0,style:t.hideHeader?{background:`none`,padding:0,borderRadius:0}:void 0,children:[t.hideHeader?null:(0,K.jsx)(iG,{kicker:t.kicker,heading:t.heading,description:t.description,originIata:e.origin.iata,mapOnly:t.mapOnly,hideFilters:t.hideFilters}),(0,K.jsxs)(`div`,{ref:o,part:`route-map-panel`,className:`rm-panel${t.hideFilters?` rm-panel--no-filters`:``} aone:border aone:border-slate-200 aone:bg-white aone:shadow-sm`,children:[t.hideFilters?null:(0,K.jsx)(_G,{filters:l,startingFilters:c.filters,onFiltersChange:F,counts:w.counts,airlines:e.airlines,months:e.months,hubs:e.hubs,hubCounts:w.hubCounts,hasSeasonal:w.hasSeasonal,fullscreen:y,onToggleFullscreen:()=>void x(),onReset:S?void 0:C}),(0,K.jsxs)(`div`,{className:t.mapOnly?`rm-body rm-body--map-only`:`rm-body`,children:[(0,K.jsx)(`div`,{className:`rm-map`,children:(0,K.jsx)(rG,{origin:e.origin,points:M,lines:N,primaryColor:t.primaryColor,accentColor:t.accentColor,airlineHighlightColor:ie,styleUrl:t.styleUrl,region:t.defaultRegion,regionToken:_,focusBounds:t.mapOnly?null:ee,mapOnly:t.mapOnly,onSelect:re,legend:(0,K.jsx)(oG,{counts:w.counts,showSeasonal:L})})}),t.mapOnly?null:(0,K.jsx)(`aside`,{className:`rm-list`,"aria-label":`Destinations`,children:(0,K.jsx)(JW,{views:j,search:d,onSearchChange:f,sort:p,onSortChange:m,airlinesByCode:T,cityByIata:D,months:e.months,selectedMonths:l.months,selectedIata:A,onSelect:g,destinationUrl:ne,onOpenDestination:I})})]})]}),(0,K.jsx)(`div`,{ref:i,className:`rm-portal`})]})})})}function BG(e){if(e&&typeof e==`object`&&!Array.isArray(e)){let t=e.error;if(t&&typeof t==`object`){let e=t.message;if(typeof e==`string`&&e.trim())return e}}}function VG(e){if(!e||typeof e!=`object`||Array.isArray(e))return{success:!1,error:`Invalid response`};let t=e;if(t.success!==!0)return{success:!1,error:BG(e)??`Request failed`};let n=SU.safeParse(t.data);return n.success?{success:!0,data:n.data}:{success:!1,error:`Invalid payload shape`}}async function HG(e,t={}){let n=mm();if(!n)return{success:!1,error:`Route map API base URL is not configured`};let r=`${n}/v1/widget-instances/${encodeURIComponent(e)}/route-map`,i;try{i=await fetch(r,{method:`GET`,credentials:`omit`,mode:`cors`,signal:t.signal})}catch{return{success:!1,error:`Unable to reach the route map service`}}let a;try{a=await i.json()}catch{return{success:!1,error:`Unable to get route map data (${i.status})`}}return i.status===404?{success:!1,notFound:!0,error:BG(a)??`No routes found`}:i.ok?VG(a):{success:!1,error:`Unable to get route map data (${i.status})`}}function UG(e){return Zg({queryKey:[`route-map`,e],queryFn:({signal:t})=>HG(e??``,{signal:t}),enabled:!!e,staleTime:36e5,refetchOnWindowFocus:!1,retry:1})}function WG({children:e}){return(0,K.jsx)(`div`,{className:`aone:flex aone:h-64 aone:items-center aone:justify-center aone:rounded-2xl aone:border aone:border-slate-200 aone:bg-white aone:p-6 aone:text-center aone:text-sm aone:text-slate-600`,children:e})}function GG(e){let{data:t,isPending:n}=UG(e.previewPayload?void 0:e.instanceId),r=e.previewPayload??(t?.success?t.data:void 0);return r?(0,K.jsx)(zG,{payload:r,settings:e},xW(e.initialSettings)):n?(0,K.jsx)(WG,{children:(0,K.jsx)(`span`,{className:`aone:animate-pulse`,children:`Loading destinations…`})}):(0,K.jsx)(WG,{children:t&&`notFound`in t&&t.notFound?`We don't have scheduled routes from ${e.origin} yet.`:`We couldn't load destinations right now. Please try again later.`})}var KG=`:host{--rm-body-height:31rem}.rm-root{color:#0f172a;background:#f4f7fb;border-radius:1.25rem;flex-direction:column;padding:1.5rem;display:flex}.rm-root.rm-root--no-title,.rm-root[data-hide-header=true]{background:0 0;border-radius:0;padding:0}.rm-panel{border-radius:1rem;flex-direction:column;min-height:0;display:flex;overflow:hidden;container-type:inline-size}.rm-body{height:var(--rm-body-height);grid-template-columns:minmax(0,1fr) minmax(18rem,380px);min-height:0;display:grid}.rm-map{min-height:0;position:relative;overflow:hidden}.rm-list{border-left:1px solid #e2e8f0;min-height:0}@container (width<=760px){.rm-body{grid-template-rows:20rem 28rem;grid-template-columns:minmax(0,1fr);height:auto}.rm-list{border-top:1px solid #e2e8f0;border-left:none}.rm-legend-slot{bottom:.5rem;left:.5rem;right:2.75rem}.rm-legend-slot ul{-moz-column-gap:.75rem;flex-wrap:wrap;gap:.125rem .75rem;font-size:.6875rem;display:flex}.rm-legend-slot li{margin:0}}.rm-label-short{display:none}@media (max-width:639px){.rm-root:not(.rm-root--no-title):not([data-hide-header=true]){border-radius:1rem;padding:.75rem}}@container (width<=960px){.rm-toolbar{grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:.5rem;display:grid}.rm-toolbar__stops{grid-area:1/1;justify-self:start;max-width:100%}.rm-toolbar__view{grid-area:1/2;margin-left:0}.rm-toolbar__filters{grid-area:2/1/3/-1;min-width:0}.rm-filter__icon,.rm-label-long{display:none}.rm-label-short{display:inline}.rm-filter__label{max-width:8rem}}@container (width<=640px){.rm-toolbar{padding:.625rem}.rm-toolbar__stops{justify-self:stretch;display:flex}.rm-toolbar__stops .rm-segment{text-align:center;flex:1;padding-inline:.375rem}.rm-segment__count{min-width:0}.rm-toolbar__filters{flex-wrap:nowrap;align-items:stretch;gap:.5rem;width:100%}.rm-toolbar__filters>.rm-filter{flex:auto;width:100%}.rm-toolbar__filters .rm-filter__button{justify-content:center;width:100%;padding-inline:.875rem}.rm-toolbar__filters .rm-filter__icon{display:inline-block}}.rm-filters-sheet__body{flex-direction:column;gap:1.25rem;display:flex}.rm-filters-sheet__heading{color:#334155;margin:0 0 .5rem;font-size:.8125rem;font-weight:600}@container (width<=360px){.rm-toolbar__stops .rm-segment{padding-inline:.25rem;font-size:.8125rem}}.rm-drawer{color:#0f172a;z-index:2147483001;align-items:flex-end;display:flex;position:fixed;inset:0}.rm-drawer__backdrop{background:#0f172a66;animation:.16s ease-out rm-fade-in;position:absolute;inset:0}.rm-drawer__sheet{overscroll-behavior:contain;max-height:min(80vh,36rem);padding:.5rem 1.25rem calc(1rem + env(safe-area-inset-bottom));background:#fff;border-radius:1.25rem 1.25rem 0 0;outline:none;width:100%;animation:.22s cubic-bezier(.2,.8,.2,1) rm-sheet-in;position:relative;overflow-y:auto;box-shadow:0 -12px 32px #0f172a2e}.rm-drawer__handle{background:#cbd5e1;border-radius:9999px;width:2.5rem;height:.25rem;margin:.25rem auto .75rem}.rm-drawer__chips button{min-height:2.5rem;padding:.5rem .875rem}@keyframes rm-fade-in{0%{opacity:0}}@keyframes rm-sheet-in{0%{transform:translateY(100%)}}@media (prefers-reduced-motion:reduce){.rm-drawer__backdrop,.rm-drawer__sheet{animation:none}}.rm-root[data-fullscreen=true]:not(.rm-root--no-title):not([data-hide-header=true]){border-radius:0;width:100%;height:100%;padding:1rem}.rm-root[data-fullscreen=true].rm-root--no-title,.rm-root[data-fullscreen=true][data-hide-header=true]{background:0 0;border-radius:0;width:100%;height:100%;padding:0}.rm-root[data-overlay=true]{z-index:2147483000;position:fixed;inset:0;overflow:auto}.rm-root[data-fullscreen=true] .rm-panel{flex:1}.rm-root[data-fullscreen=true] .rm-body{flex:1;height:auto}.rm-body.rm-body--map-only{grid-template-rows:minmax(0,1fr);grid-template-columns:minmax(0,1fr)}@container (width<=760px){.rm-body.rm-body--map-only{grid-template-rows:minmax(20rem,1fr);height:20rem}}.rm-root[data-fullscreen=true] .rm-body.rm-body--map-only{height:auto}.rm-origin{pointer-events:none;align-items:center;gap:.375rem;display:flex}.rm-origin__dot{background:var(--rm-accent);box-shadow:0 0 0 4px color-mix(in srgb,var(--rm-accent) 30%,transparent);border:3px solid #fff;border-radius:9999px;width:1.125rem;height:1.125rem}.rm-origin__label{color:#fff;white-space:nowrap;background:#111827;border-radius:.375rem;padding:.375rem .5rem;font-size:.75rem;font-weight:600;line-height:1}.rm-popup .maplibregl-popup-content{color:#0f172a;border-radius:.5rem;padding:.5rem .625rem;font-size:.8125rem;box-shadow:0 6px 20px #0f172a26}.rm-popup__meta{color:#64748b;margin-top:.125rem;font-size:.75rem}.rm-weekday-strip{flex-wrap:wrap;align-items:center;gap:2px 4px;min-width:0;display:flex}.rm-weekday-days{align-items:center;gap:4px;display:flex}.rm-weekday-chip{color:#8b94a9;cursor:default;background:#fff;border:1.5px solid #cfd6e3;border-radius:5px;place-items:center;width:20px;height:20px;padding:0;font-family:inherit;font-size:10px;font-weight:800;line-height:1;transition:background .15s,color .15s,border-color .15s;display:grid}.rm-weekday-chip[data-flies=true]{background:var(--rm-primary);border-color:var(--rm-primary);color:#fff}.rm-airline-isolate{cursor:pointer;background:0 0;border:0;border-radius:5px;padding:0;transition:opacity .15s,outline-color .15s;display:inline-flex}.rm-airline-isolate[data-dim=true]{opacity:.55}.rm-airline-isolate:focus{outline:none}.rm-airline-isolate:focus-visible,.rm-weekday-chip:focus-visible{outline:2px solid var(--rm-primary);outline-offset:2px}.rm-weekday-note{color:#64748b;margin-left:4px}.rm-weekday-note,.rm-weekday-tip{white-space:nowrap;font-size:11px;font-weight:600}.rm-weekday-tip{color:#fff;pointer-events:none;z-index:2147483002;background:#14213d;border-radius:6px;padding:5px 8px;line-height:1.2;position:fixed;transform:translate(-50%,calc(-100% - 7px))}.rm-weekday-tip:after{content:"";border:5px solid #0000;border-top-color:#14213d;position:absolute;top:100%;left:50%;transform:translate(-50%)}.rm-weekday-tip--below{transform:translate(-50%,7px)}.rm-weekday-tip--below:after{border-top-color:#0000;border-bottom-color:#14213d;top:auto;bottom:100%}:host([data-mode=dark]) .rm-weekday-chip[data-flies=false]{color:#7e89a6;background:0 0;border-color:#3a4663}:host([data-mode=dark]) .rm-weekday-note{color:#9aa5c0}:host([data-mode=dark]) .rm-weekday-tip{color:#0f1524;background:#e8ecf5}:host([data-mode=dark]) .rm-weekday-tip:after{border-top-color:#e8ecf5}:host([data-mode=dark]) .rm-weekday-tip--below:after{border-top-color:#0000;border-bottom-color:#e8ecf5}@media (prefers-reduced-motion:reduce){.rm-airline-isolate,.rm-weekday-chip{transition:none}}`,qG=new Ig;function JG(){return(0,K.jsx)(`link`,{rel:`stylesheet`,href:LU[0],onError:e=>{let t=LU[1];t&&e.currentTarget.href!==t&&(e.currentTarget.href=t)}})}function YG(e){let t=e.origin?.trim().toUpperCase();return!t||!/^[A-Z]{3}$/.test(t)?(console.error(`[airport-one-widgets] route map: origin is not a valid IATA code, not rendering widget.`),null):(0,K.jsxs)(Oh,{client:qG,children:[(0,K.jsx)(`style`,{children:l_}),(0,K.jsx)(`style`,{children:KG}),(0,K.jsx)(JG,{}),e.userStyleBlock?(0,K.jsx)(`style`,{children:e.userStyleBlock}):null,(0,K.jsx)(`div`,{style:{"--rm-primary":e.primaryColor,"--rm-accent":e.accentColor},children:(0,K.jsx)($g,{componentName:`route map`,children:(0,K.jsx)(GG,{instanceId:e.instanceId,previewPayload:e.previewPayload,origin:t,kicker:e.kicker,heading:e.heading,description:e.description,hideHeader:e.hideHeader,mapOnly:e.mapOnly,hideFilters:e.hideFilters,consentAnalytics:e.consentAnalytics,primaryColor:e.primaryColor,accentColor:e.accentColor,styleUrl:e.styleUrl,defaultRegion:e.defaultRegion,initialSettings:e.initialSettings})})})]})}var XG=`fma-route-map`,ZG=[`primary-color`,`secondary-color`,`theme`,`heading`,`kicker`,`description`,`hide-header`,`map-only`,`hide-filters`,`map-style`,`default-region`,`default-stops`,`default-airline`,`default-months`,`default-hub`,`default-sort`,`consent-analytics`,Pp,`id`],QG=class extends HTMLElement{_shadowRoot;_mountPoint;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;_mountTelemetrySent=!1;_lastPublicConfigTelemetryKey=null;_previewPayload=null;static get observedAttributes(){return Array.from(ZG)}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this._scheduleRender()}get previewPayload(){return this._previewPayload}set previewPayload(e){if(e==null)this._previewPayload=null;else{let t=SU.safeParse(e);t.success||console.warn(`[airport-one-widgets] route-map: ignoring an invalid previewPayload.`),this._previewPayload=t.success?t.data:null}this.isConnected&&this._scheduleRender()}connectedCallback(){if(Object.prototype.hasOwnProperty.call(this,`previewPayload`)){let e=this,t=e.previewPayload;delete e.previewPayload,this.previewPayload=t}this.style.display=`block`,this.style.position=`relative`,this.style.lineHeight=`1.5`,this._scheduleRender()}disconnectedCallback(){this._reactRoot?.unmount(),this._reactRoot=void 0,this._mountTelemetrySent=!1,this._lastPublicConfigTelemetryKey=null}_scheduleRender(){this._renderScheduled||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&this._renderAsync()}))}async _renderAsync(){if(this._renderInProgress)this._renderQueued=!0;else{this._renderInProgress=!0;try{let e=cm(this),t=window[Ac],n=this._previewPayload;if(n){this._paint({...PU(this,t,{origin:n.origin.iata},e??void 0),previewPayload:n});return}let r=mm(),i=null,a={attempted:!1,durationMs:0},o;if(e&&r){let t=await hm(e);a=t.metrics;let n=t.config;n&&n.widgetType!==`route-map`&&(console.warn(`[airport-one-widgets] Widget instance type does not match route-map:`,n.widgetType),o=`widget_type_mismatch`,n=null),i=n,a.attempted&&i===null&&o===void 0&&(o=a.failureKind)}if(!this.isConnected)return;let s=a.attempted&&!i,c=Np(e)??void 0,l=e&&i?PU(this,t,NU(i),e):null,u=l?.consentAnalytics??om(this,`consent-analytics`,void 0);if(u){let t=a.attempted?void 0:r?`no_instance_id`:`no_api_base`,n=a.attempted?`attempt:${r}|${e}|${i?`ok`:`fail`}|${o??``}`:`skip:${t}`;n!==this._lastPublicConfigTelemetryKey&&(this._lastPublicConfigTelemetryKey=n,Sh(!0,{widget_runtime:kU,widget_instance_id:c,attempted:a.attempted,duration_ms:a.durationMs,ok:a.attempted?i!==null:!1,error_kind:s?o:void 0,skip_reason:t}))}if(!l){console.warn(`${um}: route-map — ${e?r?`instance is not registered for this site`:`widget API base URL not configured`:`no data-widget-instance-id`}; not rendering.`),this._clear();return}this._paint(l),u&&!this._mountTelemetrySent&&(this._mountTelemetrySent=!0,Ch(!0,{widget_runtime:kU,widget_instance_id:c,public_config_unavailable:s}))}finally{this._renderInProgress=!1,this._renderQueued&&(this._renderQueued=!1,queueMicrotask(()=>{this.isConnected&&this._renderAsync()}))}}}_clear(){this._reactRoot?.unmount(),this._reactRoot=void 0,this.removeAttribute(`data-mode`)}_paint(e){let t=this._shadowRoot??=this.attachShadow({mode:`closed`}),n=this._mountPoint??=document.createElement(`div`);n.parentNode!==t&&t.appendChild(n),e.theme===`dark`?this.setAttribute(`data-mode`,`dark`):this.removeAttribute(`data-mode`),(this._reactRoot??=rm.createRoot(n)).render((0,K.jsx)(YG,{...e}))}};return customElements.get(`fma-route-map`)||customElements.define(XG,QG),e.AirfareContent=C_,e.AirfareSearch=YB,e.CarfareSearch=_L,e.FidsBoardElement=NH,e.FlyMyAirportFabElement=mU,e.RouteMapElement=QG,e})({});
|
|
1183
|
+
If it declares any Font Awesome CSS pseudo-elements, they will not be rendered as SVG icons. Add crossorigin="anonymous" to the <link>, enable searchPseudoElementsFullScan for slower but more thorough DOM parsing, or suppress this warning by setting searchPseudoElementsWarnings to false.`)}}}catch(e){i.e(e)}finally{i.f()}if(!r.size)return;var p=Array.from(r).join(`, `);try{n=e.querySelectorAll(p)}catch{}}return new Promise(function(e,t){var r=Gk(n).filter(mM).map(pM),i=Cj.begin(`searchPseudoElements`);Lj(),Promise.all(r).then(function(){i(),Rj(),e()}).catch(function(){i(),Rj(),t()})})}}var vM={hooks:function(){return{mutationObserverCallbacks:function(e){return e.pseudoElementsCallback=_M,e}}},provides:function(e){e.pseudoElements2svg=function(e){var t=e.node,n=t===void 0?AD:t;Q.searchPseudoElements&&_M(n)}}},yM=!1,bM={mixout:function(){return{dom:{unwatch:function(){Lj(),yM=!0}}}},hooks:function(){return{bootstrap:function(){Bj($A(`mutationObserverCallbacks`,{}))},noAuto:function(){Vj()},watch:function(e){var t=e.observeMutationsRoot;yM?Rj():Bj($A(`mutationObserverCallbacks`,{observeMutationsRoot:t}))}}}},xM=function(e){return e.toLowerCase().split(` `).reduce(function(e,t){var n=t.toLowerCase().split(`-`),r=n[0],i=n.slice(1).join(`-`);if(r&&i===`h`)return e.flipX=!0,e;if(r&&i===`v`)return e.flipY=!0,e;if(i=parseFloat(i),isNaN(i))return e;switch(r){case`grow`:e.size+=i;break;case`shrink`:e.size-=i;break;case`left`:e.x-=i;break;case`right`:e.x+=i;break;case`up`:e.y-=i;break;case`down`:e.y+=i;break;case`rotate`:e.rotate+=i}return e},{size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0})},SM={mixout:function(){return{parse:{transform:function(e){return xM(e)}}}},hooks:function(){return{parseNodeAttributes:function(e,t){var n=t.getAttribute(`data-fa-transform`);return n&&(e.transform=xM(n)),e}}},provides:function(e){e.generateAbstractTransformGrouping=function(e){var t=e.main,n=e.transform,r=e.containerWidth,i=e.iconWidth,a={outer:{transform:`translate(${r/2} 256)`},inner:{transform:`${`translate(${n.x*32}, ${n.y*32}) `} ${`scale(${n.size/16*(n.flipX?-1:1)}, ${n.size/16*(n.flipY?-1:1)}) `} ${`rotate(${n.rotate} 0 0)`}`},path:{transform:`translate(${i/2*-1} -256)`}};return{tag:`g`,attributes:Z({},a.outer),children:[{tag:`g`,attributes:Z({},a.inner),children:[{tag:t.icon.tag,children:t.icon.children,attributes:Z(Z({},t.icon.attributes),a.path)}]}]}}}},CM={x:0,y:0,width:`100%`,height:`100%`};function wM(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e.attributes&&(e.attributes.fill||t)&&(e.attributes.fill=`black`),e}function TM(e){return e.tag===`g`?e.children:[e]}QA([rA,eM,tM,nM,rM,vM,bM,SM,{hooks:function(){return{parseNodeAttributes:function(e,t){var n=t.getAttribute(`data-fa-mask`),r=n?HA(n.split(` `).map(function(e){return e.trim()})):IA();return r.prefix||=FA(),e.mask=r,e.maskId=t.getAttribute(`data-fa-mask-id`),e}}},provides:function(e){e.generateAbstractMask=function(e){var t=e.children,n=e.attributes,r=e.main,i=e.mask,a=e.maskId,o=e.transform,s=r.width,c=r.icon,l=i.width,u=i.icon,d=Zk({transform:o,containerWidth:l,iconWidth:s}),f={tag:`rect`,attributes:Z(Z({},CM),{},{fill:`white`})},p=c.children?{children:c.children.map(wM)}:{},m={tag:`g`,attributes:Z({},d.inner),children:[wM(Z({tag:c.tag,attributes:Z(Z({},c.attributes),d.path)},p))]},h={tag:`g`,attributes:Z({},d.outer),children:[m]},g=`mask-${a||Wk()}`,_=`clip-${a||Wk()}`,v={tag:`mask`,attributes:Z(Z({},CM),{},{id:g,maskUnits:`userSpaceOnUse`,maskContentUnits:`userSpaceOnUse`}),children:[f,h]},y={tag:`defs`,children:[{tag:`clipPath`,attributes:{id:_},children:TM(u)},v]};return t.push(y,{tag:`rect`,attributes:Z({fill:`currentColor`,"clip-path":`url(#${_})`,mask:`url(#${g})`},CM)}),{children:t,attributes:n}}}},{provides:function(e){var t=!1;kD.matchMedia&&(t=kD.matchMedia(`(prefers-reduced-motion: reduce)`).matches),e.missingIconAbstract=function(){var e=[],n={fill:`currentColor`},r={attributeType:`XML`,repeatCount:`indefinite`,dur:`2s`};e.push({tag:`path`,attributes:Z(Z({},n),{},{d:`M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z`})});var i=Z(Z({},r),{},{attributeName:`opacity`}),a={tag:`circle`,attributes:Z(Z({},n),{},{cx:`256`,cy:`364`,r:`28`}),children:[]};return t||a.children.push({tag:`animate`,attributes:Z(Z({},r),{},{attributeName:`r`,values:`28;14;28;28;14;28;`})},{tag:`animate`,attributes:Z(Z({},i),{},{values:`1;0;1;1;0;1;`})}),e.push(a),e.push({tag:`path`,attributes:Z(Z({},n),{},{opacity:`1`,d:`M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z`}),children:t?[]:[{tag:`animate`,attributes:Z(Z({},i),{},{values:`1;0;0;0;0;1;`})}]}),t||e.push({tag:`path`,attributes:Z(Z({},n),{},{opacity:`0`,d:`M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z`}),children:[{tag:`animate`,attributes:Z(Z({},i),{},{values:`0;0;1;1;0;0;`})}]}),{tag:`g`,attributes:{class:`missing`},children:e}}}},{hooks:function(){return{parseNodeAttributes:function(e,t){var n=t.getAttribute(`data-fa-symbol`);return e.symbol=n===null?!1:n===``||n,e}}}}],{mixoutsTo:ij}),ij.noAuto;var EM=ij.config;ij.library,ij.dom;var DM=ij.parse;ij.findIconDefinition,ij.toHtml;var OM=ij.icon;ij.layer,ij.text,ij.counter;function kM(e){return e-=0,e===e}function AM(e){return kM(e)?e:(e=e.replace(/[_-]+(.)?/g,(e,t)=>t?t.toUpperCase():``),e.charAt(0).toLowerCase()+e.slice(1))}var jM=(e,t)=>G.createElement(`stop`,{key:`${t}-${e.offset}`,offset:e.offset,stopColor:e.color,...e.opacity!==void 0&&{stopOpacity:e.opacity}});function MM(e){return e.charAt(0).toUpperCase()+e.slice(1)}var NM=new Map,PM=1e3;function FM(e){if(NM.has(e))return NM.get(e);let t={},n=0,r=e.length;for(;n<r;){let i=e.indexOf(`;`,n),a=i===-1?r:i,o=e.slice(n,a).trim();if(o){let e=o.indexOf(`:`);if(e>0){let n=o.slice(0,e).trim(),r=o.slice(e+1).trim();if(n&&r){let e=AM(n);t[e.startsWith(`webkit`)?MM(e):e]=r}}}n=a+1}if(NM.size===PM){let e=NM.keys().next().value;e&&NM.delete(e)}return NM.set(e,t),t}function IM(e,t,n={}){if(typeof t==`string`)return t;let r=(t.children||[]).map(t=>{let r=t;return(`fill`in n||n.gradientFill)&&t.tag===`path`&&`fill`in t.attributes&&(r={...t,attributes:{...t.attributes,fill:void 0}}),IM(e,r)}),i=t.attributes||{},a={};for(let[e,t]of Object.entries(i))switch(!0){case e===`class`:a.className=t;break;case e===`style`:a.style=FM(String(t));break;case e.startsWith(`aria-`):case e.startsWith(`data-`):a[e.toLowerCase()]=t;break;default:a[AM(e)]=t}let{style:o,role:s,"aria-label":c,gradientFill:l,...u}=n;if(o&&(a.style=a.style?{...a.style,...o}:o),s&&(a.role=s),c&&(a[`aria-label`]=c,a[`aria-hidden`]=`false`),l){a.fill=`url(#${l.id})`;let{type:t,stops:n=[],...i}=l;r.unshift(e(t===`linear`?`linearGradient`:`radialGradient`,{...i,id:l.id},n.map(jM)))}return e(t.tag,{...a,...u},...r)}var LM=IM.bind(null,G.createElement),RM=(e,t)=>{let n=(0,G.useId)();return e||(t?n:void 0)},zM=class{constructor(e=`react-fontawesome`){this.enabled=!1;let t=!1;try{t=!1}catch{}this.scope=e,this.enabled=t}log(...e){this.enabled&&console.log(`[${this.scope}]`,...e)}warn(...e){this.enabled&&console.warn(`[${this.scope}]`,...e)}error(...e){this.enabled&&console.error(`[${this.scope}]`,...e)}};({env:{NODE_ENV:`production`}}).env?.FA_VERSION;var BM=`searchPseudoElementsFullScan`in EM&&typeof EM.searchPseudoElementsFullScan==`boolean`?`7.0.0`:`6.0.0`,VM=Number.parseInt(BM)>=7,HM=()=>VM,UM=`fa`,WM={beat:`fa-beat`,fade:`fa-fade`,beatFade:`fa-beat-fade`,bounce:`fa-bounce`,shake:`fa-shake`,spin:`fa-spin`,spinPulse:`fa-spin-pulse`,spinReverse:`fa-spin-reverse`,pulse:`fa-pulse`,flip360:`fa-flip-360`,buzz:`fa-buzz`,float:`fa-float`,jello:`fa-jello`,spinSnap:`fa-spin-snap`,spinSnap4:`fa-spin-snap-4`,spinSnap8:`fa-spin-snap-8`,swing:`fa-swing`,wag:`fa-wag`},GM={left:`fa-pull-left`,right:`fa-pull-right`},KM={90:`fa-rotate-90`,180:`fa-rotate-180`,270:`fa-rotate-270`},qM={"2xs":`fa-2xs`,xs:`fa-xs`,sm:`fa-sm`,lg:`fa-lg`,xl:`fa-xl`,"2xl":`fa-2xl`,"1x":`fa-1x`,"2x":`fa-2x`,"3x":`fa-3x`,"4x":`fa-4x`,"5x":`fa-5x`,"6x":`fa-6x`,"7x":`fa-7x`,"8x":`fa-8x`,"9x":`fa-9x`,"10x":`fa-10x`},JM={border:`fa-border`,fixedWidth:`fa-fw`,flip:`fa-flip`,flipHorizontal:`fa-flip-horizontal`,flipVertical:`fa-flip-vertical`,inverse:`fa-inverse`,rotateBy:`fa-rotate-by`,swapOpacity:`fa-swap-opacity`,widthAuto:`fa-width-auto`,canvasSquare:`fa-canvas-square`,canvasRoomy:`fa-canvas-roomy`},YM={default:`fa-layers`};function XM(e){let t=EM.cssPrefix||EM.familyPrefix||UM;return t===UM?e:e.replace(new RegExp(String.raw`(?<=^|\s)${UM}-`,`g`),`${t}-`)}function ZM(e){let{beat:t,fade:n,beatFade:r,bounce:i,shake:a,spin:o,spinPulse:s,spinReverse:c,pulse:l,fixedWidth:u,inverse:d,border:f,flip:p,size:m,rotation:h,pull:g,swapOpacity:_,rotateBy:v,widthAuto:y,canvasSquare:b,canvasRoomy:x,flip360:S,buzz:C,float:w,jello:T,spinSnap:E,spinSnap4:D,spinSnap8:O,swing:k,wag:A,className:j}=e,M=[];return j&&M.push(...j.split(` `)),t&&M.push(WM.beat),n&&M.push(WM.fade),r&&M.push(WM.beatFade),i&&M.push(WM.bounce),a&&M.push(WM.shake),o&&M.push(WM.spin),c&&M.push(WM.spinReverse),s&&M.push(WM.spinPulse),l&&M.push(WM.pulse),u&&M.push(JM.fixedWidth),d&&M.push(JM.inverse),f&&M.push(JM.border),p===!0&&M.push(JM.flip),(p===`horizontal`||p===`both`)&&M.push(JM.flipHorizontal),(p===`vertical`||p===`both`)&&M.push(JM.flipVertical),m!=null&&M.push(qM[m]),h!=null&&h!==0&&M.push(KM[h]),g!=null&&M.push(GM[g]),_&&M.push(JM.swapOpacity),HM()?(v&&M.push(JM.rotateBy),y&&M.push(JM.widthAuto),b&&M.push(JM.canvasSquare),x&&M.push(JM.canvasRoomy),S&&M.push(WM.flip360),C&&M.push(WM.buzz),w&&M.push(WM.float),T&&M.push(WM.jello),E&&M.push(WM.spinSnap),D&&M.push(WM.spinSnap4),O&&M.push(WM.spinSnap8),k&&M.push(WM.swing),A&&M.push(WM.wag),(EM.cssPrefix||EM.familyPrefix||UM)===UM?M:M.map(XM)):M}var QM=e=>typeof e==`object`&&`icon`in e&&!!e.icon;function $M(e){if(e)return QM(e)?e:DM.icon(e)}function eN(e){return Object.keys(e)}var tN=new zM(`FontAwesomeIcon`),nN={border:!1,className:``,mask:void 0,maskId:void 0,fixedWidth:!1,inverse:!1,flip:!1,icon:void 0,listItem:!1,pull:void 0,pulse:!1,rotation:void 0,rotateBy:!1,size:void 0,spin:!1,spinPulse:!1,spinReverse:!1,beat:!1,fade:!1,beatFade:!1,bounce:!1,shake:!1,symbol:!1,title:``,titleId:void 0,transform:void 0,swapOpacity:!1,widthAuto:!1,canvasSquare:!1,canvasRoomy:!1,flip360:!1,buzz:!1,float:!1,jello:!1,spinSnap:!1,spinSnap4:!1,spinSnap8:!1,swing:!1,wag:!1},rN=new Set(Object.keys(nN)),iN=G.forwardRef((e,t)=>{let n={...nN,...e},{icon:r,mask:i,symbol:a,title:o,titleId:s,maskId:c,transform:l}=n,u=RM(c,!!i),d=RM(s,!!o),f=$M(r);if(!f)return tN.error(`Icon lookup is undefined`,r),null;let p=ZM(n),m=typeof l==`string`?DM.transform(l):l,h=$M(i),g=OM(f,{...p.length>0&&{classes:p},...m&&{transform:m},...h&&{mask:h},symbol:a,title:o,titleId:d,maskId:u});if(!g)return tN.error(`Could not find icon`,f),null;let{abstract:_}=g,v={ref:t};for(let e of eN(n))rN.has(e)||(v[e]=n[e]);return LM(_[0],v)});iN.displayName=`FontAwesomeIcon`,`${YM.default}${JM.fixedWidth}`;function aN({message:e,className:t,buttonRef:n}){let r=(0,G.useId)(),[i,a]=(0,G.useState)(!1);return(0,K.jsxs)(`span`,{className:(0,q.default)(`aone:relative aone:inline-flex`,t),onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[(0,K.jsx)(`button`,{type:`button`,ref:n,className:`aone:inline-flex aone:items-center aone:justify-center aone:h-4 aone:w-4 aone:cursor-pointer aone:rounded-sm aone:text-red-500 aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-red-500 aone:focus:ring-offset-1`,"data-testid":`error-icon`,"aria-label":`Validation error: ${e}`,"aria-expanded":i,"aria-controls":r,"aria-describedby":i?r:void 0,onFocus:()=>a(!0),onBlur:()=>a(!1),onClick:()=>a(e=>!e),children:(0,K.jsx)(iN,{icon:QE,"aria-hidden":`true`,className:`aone:h-4 aone:w-4`})}),i&&(0,K.jsx)(`div`,{id:r,role:`tooltip`,className:`aone:absolute aone:z-20 aone:top-full aone:left-1/2 aone:-translate-x-1/2 aone:mt-2 aone:bg-red-600 aone:text-white aone:text-xs aone:rounded aone:px-2 aone:py-1 aone:whitespace-nowrap`,children:e})]})}var oN=e=>{let t=e.match(/\d+/g)??[];if(t.length===0)return null;let n=parseInt(t[0].slice(0,2),10);if(Number.isNaN(n)||n<1||n>12)return null;let r=t[1]?.slice(0,2),i=Number(r??`1`);(Number.isNaN(i)||i<1||i>31)&&(i=1);let a=new Date().getFullYear(),o=t[2],s=a;if(o){let e=parseInt(o,10);s=o.length<=2?2e3+e:e}let c=new Date(s,n-1,i);return Dl(c)?xl(c):null},sN=/^\d{2}\/\d{2}\/\d{2}$/,cN=e=>e.toLocaleDateString(`en-US`,{year:`2-digit`,month:`2-digit`,day:`2-digit`}),lN=(e,t=``)=>{let n=e.length<t.length,r=e.replace(/\D/g,``).slice(0,8);if(!n&&e.endsWith(`/`)){let t=e.slice(0,-1).split(`/`);if(t.length===1){let e=t[0];if(e&&e.length===1)return`0${e}/`}if(t.length===2){let e=t[0],n=t[1];if(n&&n.length===1)return`${(e??``).padStart(2,`0`)}/${`0${n}`}/`}}if(r.length===1&&t===``&&!n&&parseInt(r,10)>=3)return`0${r}/`;if(e.indexOf(`/`)===1&&r.length>=1){let e=r.slice(0,1).padStart(2,`0`),t=r.slice(1);switch(t.length){case 0:return n?e:`${e}/`;case 1:return`${e}/${t}`;case 2:return n?`${e}/${t}`:`${e}/${t}/`;default:return`${e}/${t.slice(0,2)}/${t.slice(2).slice(-2).padStart(2,`0`)}`}}switch(r.length){case 0:return``;case 1:return r;case 2:return n?e:`${r}/`;case 3:{let e=r.slice(0,2),i=r.slice(2);return!n&&t.replace(/\D/g,``).length===2&&/^\d{2}\/$/.test(t)&&parseInt(i,10)>=4?`${e}/0${i}/`:`${e}/${i}`}case 4:{let e=r.slice(0,2),t=r.slice(2,4);return n?`${e}/${t}`:`${e}/${t}/`}default:return`${r.slice(0,2)}/${r.slice(2,4)}/${r.slice(4).slice(-2)}`}},uN=e=>{let t=e.trim();if(t===``)return``;let n=(t.match(/\d+/g)??[]).slice(0,3);if(n.length===0)return``;let r=n[0].slice(-2).padStart(2,`0`);if(n.length===1)return r;let i=n[1].slice(-2).padStart(2,`0`);return n.length===2?`${r}/${i}`:`${r}/${i}/${n[2].slice(-2).padStart(2,`0`)}`},dN=e=>{if(!sN.test(e))return null;let t=Ad(e,`MM/dd/yy`,new Date);return Dl(t)&&cN(xl(t))===e?xl(t):null};function fN({origin:e,destination:t,onChange:n,onMonthViewChange:r,oneWay:i,className:a,primaryColor:o,secondaryColor:s,startDateLabel:c=`Start Date`,endDateLabel:l=`End Date`,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,initialStartDate:p,initialEndDate:m,referenceDates:h,minDate:g,showButtons:_=!0}){let v=(0,G.useRef)(null),[y,b]=(0,G.useState)(null);(0,G.useLayoutEffect)(()=>{if(!v.current)return;let e=v.current.getRootNode();if(!(e instanceof ShadowRoot))return;let t=document.createElement(`div`);return e.appendChild(t),queueMicrotask(()=>b(t)),()=>{t.parentNode&&t.parentNode.removeChild(t)}},[]);let[x,S]=(0,G.useState)(``),[C,w]=(0,G.useState)(``),[T,E]=(0,G.useState)(null),[D,O]=(0,G.useState)(null),[k,A]=(0,G.useState)(p||null),[j,M]=(0,G.useState)(m||null),[N,P]=(0,G.useState)(!1),[ee,F]=(0,G.useState)(p||null),[te,ne]=(0,G.useState)(!1),[I,re]=(0,G.useState)(!1),[L]=(0,G.useState)(()=>p||new Date),ie=(0,G.useRef)(n),ae=(0,G.useRef)(null),oe=(0,G.useRef)(null),se=(0,G.useRef)(null),ce=(0,G.useRef)(0),le=(0,G.useRef)(null),R=(0,G.useRef)(null),ue=()=>Date.now()<ce.current,de=()=>{ue()||P(!0)},fe=()=>{ce.current=Date.now()+250,P(!1)},pe=e=>{e?de():fe()};(0,G.useEffect)(()=>{ie.current=n},[n]),(0,G.useEffect)(()=>{i&&queueMicrotask(()=>{M(null),w(``),O(null)})},[i]),(0,G.useEffect)(()=>{queueMicrotask(()=>{!k&&p&&A(p),!j&&m&&M(m)})},[p,m,k,j]);let me=xl(new Date),he=fl(me,6),ge=e=>{S(e);let t=dN(e);return e===``||!e?(E(null),A(null),!0):t?xu(t,me)?(E(`Date cannot be in the past`),A(null),!1):bu(t,he)?(E(`Date must be within 6 months`),A(null),!1):g&&xu(t,g)?(E(`Date must be no earlier than `+g.toLocaleDateString()),A(null),!1):(E(null),A(t),F(t),j&&xu(j,t)&&(M(null),w(``)),!0):(E(`Enter a date in MM/DD/YY format`),A(null),!1)},_e=e=>{if(i)return!0;w(e);let t=dN(e);return e===``||!e?(O(null),M(null),!0):t?xu(t,me)?(O(`Date cannot be in the past`),M(null),!1):bu(t,he)?(O(`Date must be within 6 months`),M(null),!1):k?xu(t,k)?(O(`Return date must be after departure`),M(null),!1):g&&xu(t,g)?(O(`Date must be no earlier than `+g.toLocaleDateString()),M(null),!1):(O(null),M(t),F(t),!0):(O(`Enter departure date first`),M(null),!1):(O(`Enter a date in MM/DD/YY format`),M(null),!1)},ve=()=>ge(x),ye=()=>_e(C),be=e=>{let t=e.getTime()<(k?.getTime()||0);k?!j&&t?A(e):j?k&&j&&(Tl(e,k)&&Tl(e,j)?(A(e),M(null)):xu(e,j)&&xu(e,dl(k,3))?A(e):M(e)):i?A(e):M(e):A(e)},xe=()=>{A(null),M(null),S(``),w(``),E(null),O(null),F(null),ie.current(null,null)};(0,G.useEffect)(()=>{ie.current(k,j)},[k,j]),(0,G.useEffect)(()=>{queueMicrotask(()=>{k?(S(cN(k)),E(null)):T||S(``)})},[k]),(0,G.useEffect)(()=>{queueMicrotask(()=>{j?(w(cN(j)),O(null)):D||w(``)})},[j]);let Se={};o&&(Se[`--color-primary`]=o),s&&(Se[`--color-secondary`]=s);let Ce=DE(),we=(0,G.useId)(),Te=`${we}-description`,Ee=(0,K.jsxs)(`div`,{ref:se,onClick:de,className:(0,q.default)(`aone:relative aone:h-full aone:flex aone:flex-col aone:gap-4 aone:px-3 aone:py-2 aone:rounded-lg aone:bg-white aone:cursor-pointer`,`aone:@2xl:flex-row aone:@2xl:items-center`,{"aone:border-2 aone:border-primary":N,"aone:border-2 aone:border-gray-200":!N}),children:[(0,K.jsxs)(`fieldset`,{className:`aone:border-0 aone:p-0 aone:m-0 aone:@2xl:flex-1 aone:@2xl:pr-3`,children:[(0,K.jsx)(`legend`,{className:`aone:sr-only`,children:`Date range selection`}),(0,K.jsxs)(`div`,{className:`aone:flex aone:grow aone:items-center`,children:[(0,K.jsx)(`span`,{children:(0,K.jsx)(OE,{})}),(0,K.jsxs)(`div`,{className:`aone:relative aone:flex-grow`,children:[(0,K.jsx)(`input`,{type:`text`,name:`start-date`,value:x,"aria-label":c,"aria-invalid":T?`true`:void 0,placeholder:te?`mm/dd/yy`:c,autoComplete:`off`,className:(0,q.default)(`aone:ml-2 aone:all-initial aone:focus:outline-none aone:disabled:bg-white aone:text-black aone:text-base aone:w-full aone:pr-1`,{"aone:text-red-500 ":!!T}),onChange:e=>{let t=lN(e.target.value,x);S(t),E(null),F(oN(t)),ie.current(null,j)},onFocus:()=>{ne(!0),de()},onBlur:e=>{let t=uN(e.target.value);S(t);let n=ge(t);ne(!1),!n&&le.current===`forward`&&requestAnimationFrame(()=>ae.current?.focus()),le.current=null},onKeyDown:e=>{e.key===`Tab`&&(le.current=e.shiftKey?`backward`:`forward`),e.key===`Enter`&&(e.preventDefault(),ve(),e.target.blur())}}),T&&(0,K.jsx)(`span`,{className:`aone:absolute aone:right-2 aone:top-1/2 aone:-translate-y-1/2`,children:(0,K.jsx)(aN,{message:T,buttonRef:ae})})]})]})]}),!i&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`aone:absolute aone:left-2 aone:right-2 aone:top-1/2 aone:@2xl:top-2 aone:@2xl:bottom-2 aone:@2xl:left-1/2 aone:rounded-lg aone:h-[2px] aone:@2xl:h-[initial] aone:@2xl:w-[2px] aone:bg-gray-200`}),(0,K.jsxs)(`fieldset`,{className:`aone:border-0 aone:p-0 aone:m-0 aone:@2xl:flex-1 aone:@2xl:pl-3`,children:[(0,K.jsx)(`legend`,{className:`aone:sr-only`,children:`Return date selection`}),(0,K.jsxs)(`div`,{className:`aone:flex aone:grow aone:items-center`,children:[(0,K.jsx)(`span`,{className:`aone:@2xl:hidden`,children:(0,K.jsx)(OE,{})}),(0,K.jsxs)(`div`,{className:`aone:relative aone:flex-grow`,children:[(0,K.jsx)(`input`,{type:`text`,name:`end-date`,value:C,"aria-label":l,"aria-invalid":D?`true`:void 0,placeholder:I?`mm/dd/yy`:l,autoComplete:`off`,className:(0,q.default)(`aone:ml-2 aone:focus:outline-none aone:disabled:bg-white aone:text-black aone:text-base aone:w-full aone:pr-7`,{"aone:text-red-500":!!D}),onChange:e=>{let t=lN(e.target.value,C);w(t),O(null),F(oN(t)),ie.current(k,null)},onFocus:()=>{re(!0),de()},onBlur:e=>{let t=uN(e.target.value);w(t);let n=_e(t);re(!1),!n&&R.current===`forward`&&requestAnimationFrame(()=>oe.current?.focus()),R.current=null},onKeyDown:e=>{e.key===`Tab`&&(R.current=e.shiftKey?`backward`:`forward`),e.key===`Enter`&&(e.preventDefault(),ye(),e.target.blur())}}),D&&(0,K.jsx)(`span`,{className:`aone:absolute aone:right-2 aone:top-1/2 aone:-translate-y-1/2`,children:(0,K.jsx)(aN,{message:D,buttonRef:oe})})]})]})]})]})]});return(0,K.jsxs)(`div`,{id:`A1-DateRangePicker`,ref:v,className:a,style:Se,role:`group`,"aria-label":`Date range picker`,"aria-describedby":Te,children:[Ce?(0,K.jsxs)(bE,{open:N,onOpenChange:pe,children:[Ee,(0,K.jsxs)(yE,{className:`ao-dialog--calendar-light`,open:N,onOpenChange:pe,"aria-labelledby":we,"aria-describedby":void 0,children:[(0,K.jsx)(xE,{id:we,className:`aone:sr-only`,children:`Filter Options`}),(0,K.jsx)(PE,{origin:e,destination:t,initialDate:L,startDate:k,endDate:j,previewDate:ee,onChange:be,onMonthViewChange:r,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,referenceDates:h,minDate:g},L.toISOString()),_&&(0,K.jsxs)(`div`,{className:`aone:mt-3 aone:flex aone:justify-between aone:items-center aone:pt-0 aone:pb-1 aone:md:pb-2 aone:px-1`,children:[(0,K.jsx)(`button`,{type:`button`,className:`aone:bg-slate-400 aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-slate-500`,onClick:xe,"data-testid":`date-range-picker-reset-button`,children:`Reset`}),(0,K.jsx)(`button`,{type:`button`,className:`aone:bg-primary aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-primary`,onClick:fe,"data-testid":`date-range-picker-done-button`,children:`Done`})]})]})]}):(0,K.jsxs)(SE,{open:N,onOpenChange:pe,children:[(0,K.jsx)(TE,{asChild:!0,children:Ee}),(0,K.jsxs)(wE,{side:`bottom`,align:`center`,sticky:`always`,avoidCollisions:!1,onOpenAutoFocus:e=>e.preventDefault(),onInteractOutside:e=>{let t=e.target;t&&se.current?.contains(t)&&e.preventDefault()},sideOffset:4,portalContainer:y,role:`dialog`,"aria-label":`Calendar for date selection`,"aria-describedby":`calendar-instructions`,className:`aone:w-max aone:max-w-[100vw] aone:p-0 aone:bg-white aone:border aone:border-gray-300 aone:rounded-xl aone:shadow-lg aone:md:mt-2 aone:pb-2`,children:[(0,K.jsx)(`div`,{id:`calendar-instructions`,className:`aone:sr-only`,children:`Use arrow keys to navigate dates. Press Enter or Space to select a date. Press Escape to close the calendar.`}),(0,K.jsx)(PE,{origin:e,destination:t,initialDate:L,startDate:k,endDate:j,previewDate:ee,onChange:be,onMonthViewChange:r,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,referenceDates:h,minDate:g},L.toISOString()),_&&(0,K.jsxs)(`div`,{className:`aone:mt-3 aone:md:mt-0 aone:flex aone:justify-between aone:items-center aone:pt-0 aone:pb-1 aone:md:pb-2 aone:px-5`,children:[(0,K.jsx)(`button`,{type:`button`,className:`aone:bg-slate-400 aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-slate-500`,onClick:xe,"data-testid":`date-range-picker-popover-reset-button`,children:`Reset`}),(0,K.jsx)(`button`,{type:`button`,className:`aone:bg-primary aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-primary`,onClick:fe,"data-testid":`date-range-picker-popover-done-button`,children:`Done`})]})]})]}),(0,K.jsx)(`div`,{id:Te,className:`aone:sr-only`,children:i?`Departure date input. Enter a date manually or open the calendar to pick one.`:`Departure and return date inputs. Enter dates manually or open the calendar to pick a date range.`})]})}function pN(e){if(e===`00:00`)return`Midnight`;if(e===`12:00`)return`Noon`;let[t=`00`,n=`00`]=e.split(`:`),r=parseInt(t,10),i=r<12?`am`:`pm`;return r===0&&(r=12),r>12&&(r-=12),`${r}:${n.padStart(2,`0`)} ${i}`}var mN=Array.from({length:48},(e,t)=>{let n=Math.floor(t/2),r=t%2==0?`00`:`30`;return`${n.toString().padStart(2,`0`)}:${r}`}),hN=`00:00`,gN=`12:00`;function _N(e,t=!1){let n=`time-picker-option-${e.replace(`:`,`-`)}`;return t?`${n}-highlight`:n}function vN({label:e,time:t,isSelected:n,onSelect:r,testId:i}){return(0,K.jsx)(`button`,{type:`button`,className:`aone:w-full aone:rounded aone:px-3 aone:py-1 aone:text-center aone:text-xs aone:font-semibold aone:uppercase aone:tracking-wide aone:transition ${n?`aone:bg-primary aone:text-primary-foreground hover:aone:bg-primary/90`:`aone:bg-gray-200 aone:text-gray-700 hover:aone:bg-gray-300`}`,onClick:()=>r(t),"data-testid":i,children:e})}var yN=({value:e,onChange:t,label:n,header:r=`Select pick-up time`,portalContainer:i,hasError:a=!1,dataTestId:o=`time-picker-trigger`,minTime:s})=>{let[c,l]=(0,G.useState)(!1),u=(0,G.useRef)(null),d=(0,G.useMemo)(()=>s?mN.filter(e=>e>=s):mN,[s]),{beforeNoon:f,hasMidnight:p,hasNoon:m,afterNoon:h}=(0,G.useMemo)(()=>{let e=[],t=[],n=!1,r=!1;for(let i of d)i===hN?n=!0:i===gN?r=!0:i<gN?e.push(i):t.push(i);return{beforeNoon:e,hasMidnight:n,hasNoon:r,afterNoon:t}},[d]),g=(0,G.useCallback)(()=>{let t=u.current;if(!t||!e)return;let n=e===gN&&m?_N(gN,!0):e===hN&&p?_N(hN,!0):_N(e),r=t.querySelector(`[data-testid="${n}"]`)??t.querySelector(`[data-testid="${_N(e)}"]`);if(!r)return;let i=t.getBoundingClientRect(),a=r.getBoundingClientRect().top-i.top-t.clientHeight/2+r.clientHeight/2;t.scrollTop+=a,r.focus({preventScroll:!0})},[e,p,m]);(0,G.useEffect)(()=>{if(!c||!e)return;let t=window.setTimeout(()=>{g()},50);return()=>window.clearTimeout(t)},[c,e,g]);let _=e=>{t(e),l(!1)},v=e=>{e.preventDefault(),window.setTimeout(()=>{g()},50)},y=t=>(0,K.jsx)(`button`,{type:`button`,className:`aone:w-full aone:rounded-md aone:px-2 aone:py-2 aone:text-left aone:text-sm aone:transition ${e===t&&t!==gN&&t!==hN?`aone:bg-primary aone:text-primary-foreground hover:aone:bg-primary/90`:`aone:bg-transparent aone:text-foreground hover:aone:bg-muted`}`,onClick:()=>_(t),"data-testid":_N(t),children:pN(t)},t),b=e=>e.length>0?(0,K.jsx)(`div`,{className:`aone:grid aone:grid-cols-2 aone:gap-2`,children:e.map(y)}):null;return(0,K.jsxs)(SE,{open:c,onOpenChange:l,children:[(0,K.jsx)(CE,{asChild:!0,children:(0,K.jsxs)(`button`,{type:`button`,className:`aone:w-full aone:h-full aone:text-base aone:px-4 aone:py-2 aone:bg-white aone:dark:bg-gray-800 aone:rounded-md aone:text-left aone:shadow-sm aone:flex aone:items-center aone:justify-between aone:cursor-pointer aone:border-2 aone:dark:border-gray-600 aone:text-foreground ${a?`aone:border-red-500 aone:ring-2 aone:ring-red-200`:`aone:border-gray-200`}`,"data-testid":o,children:[(0,K.jsx)(`span`,{children:e?pN(e):n||`Select time`}),(0,K.jsx)(`div`,{className:`aone:pointer-events-none aone:flex aone:items-center`,children:(0,K.jsx)(iN,{icon:c?RE:ZE,className:`aone:h-4 aone:w-4 aone:text-muted-foreground`})})]})}),(0,K.jsxs)(wE,{className:`aone:p-0 aone:w-64 aone:shadow-lg aone:rounded-xl`,portalContainer:i,onOpenAutoFocus:v,children:[(0,K.jsx)(`div`,{className:`aone:border-b aone:px-4 aone:py-3 aone:font-semibold aone:text-base aone:text-foreground`,children:r}),(0,K.jsx)(`div`,{ref:u,className:`aone:max-h-72 aone:overflow-y-auto aone:p-2`,style:{WebkitOverflowScrolling:`touch`,overscrollBehavior:`contain`,touchAction:`pan-y`},onTouchStart:e=>e.stopPropagation(),onTouchMove:e=>e.stopPropagation(),children:(0,K.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:gap-2`,children:[b(p?[hN,...f]:f),m?(0,K.jsx)(vN,{label:`Noon`,time:gN,isSelected:e===gN,onSelect:_,testId:_N(gN,!0)}):null,b(m?[gN,...h]:h),p?(0,K.jsx)(vN,{label:`Midnight`,time:hN,isSelected:e===hN,onSelect:_,testId:_N(hN,!0)}):null]})})]})]})};function bN({label:e,dateValue:t,timeValue:n,onDateChange:r,onTimeChange:i,origin:a,destination:o,className:s,referenceDates:c,minDate:l,shadowRoot:u}){let d=(0,G.useRef)(null),[f,p]=(0,G.useState)(null);return(0,G.useLayoutEffect)(()=>{if(!u||!d.current)return;let e=document.createElement(`div`);return u.appendChild(e),queueMicrotask(()=>p(e)),()=>{e.parentNode&&e.parentNode.removeChild(e)}},[u]),(0,K.jsxs)(`div`,{ref:d,className:`w-full md:w-auto md:flex-1 md:min-w-[325px] ${s||``}`,children:[(0,K.jsx)(`label`,{className:`aone:block aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:e}),(0,K.jsxs)(`div`,{className:`aone:mt-1 aone:flex aone:bg-white aone:dark:bg-gray-800 aone:rounded-lg`,children:[(0,K.jsx)(`div`,{className:`aone:grow`,children:(0,K.jsx)(fN,{className:`aone:grow`,origin:a,destination:o,startDateLabel:e,endDateLabel:``,initialStartDate:t?new Date(t):null,initialEndDate:null,onChange:r,onMonthViewChange:()=>{},oneWay:!0,referenceDates:c,minDate:l,showButtons:!0,shadowRoot:u})}),(0,K.jsx)(`div`,{className:`aone:min-w-[150px] `,children:(0,K.jsx)(yN,{value:n,onChange:i,portalContainer:f})})]})]})}function xN(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function SN(){return SN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},SN.apply(null,arguments)}var CN=s(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),wN=s(((e,t)=>{var n=CN();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),TN=s(((e,t)=>{t.exports=wN()()})),EN=s((e=>{})),DN=s(((e,t)=>{t.exports=EN()})),$=l(TN(),1);DN();var ON=e=>typeof e==`object`&&!!e&&e.nodeType===1,kN=(e,t)=>(!t||e!==`hidden`)&&e!==`visible`&&e!==`clip`,AN=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return kN(n.overflowY,t)||kN(n.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch{return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},jN=(e,t,n,r,i,a,o,s)=>a<e&&o>t||a>e&&o<t?0:a<=e&&s<=n||o>=t&&s>=n?a-e-r:o>t&&s<n||a<e&&s>n?o-t+i:0,MN=e=>e.parentElement??(e.getRootNode().host||null),NN=(e,t)=>{if(typeof document>`u`)return[];let{scrollMode:n,block:r,inline:i,boundary:a,skipOverflowHiddenElements:o}=t,s=typeof a==`function`?a:e=>e!==a;if(!ON(e))throw TypeError(`Invalid target`);let c=document.scrollingElement||document.documentElement,l=[],u=e;for(;ON(u)&&s(u);){if(u=MN(u),u===c){l.push(u);break}u!=null&&u===document.body&&AN(u)&&!AN(document.documentElement)||u!=null&&AN(u,o)&&l.push(u)}let d=window.visualViewport?.width??innerWidth,f=window.visualViewport?.height??innerHeight,{scrollX:p,scrollY:m}=window,{height:h,width:g,top:_,right:v,bottom:y,left:b}=e.getBoundingClientRect(),{top:x,right:S,bottom:C,left:w}=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e),T=r===`start`||r===`nearest`?_-x:r===`end`?y+C:_+h/2-x+C,E=i===`center`?b+g/2-w+S:i===`end`?v+S:b-w,D=[];for(let e=0;e<l.length;e++){let t=l[e],{height:a,width:o,top:s,right:u,bottom:x,left:S}=t.getBoundingClientRect();if(n===`if-needed`&&_>=0&&b>=0&&y<=f&&v<=d&&(t===c&&!AN(t)||_>=s&&y<=x&&b>=S&&v<=u))return D;let C=getComputedStyle(t),w=parseInt(C.borderLeftWidth,10),O=parseInt(C.borderTopWidth,10),k=parseInt(C.borderRightWidth,10),A=parseInt(C.borderBottomWidth,10),j=0,M=0,N=`offsetWidth`in t?t.offsetWidth-t.clientWidth-w-k:0,P=`offsetHeight`in t?t.offsetHeight-t.clientHeight-O-A:0,ee=`offsetWidth`in t?t.offsetWidth===0?0:o/t.offsetWidth:0,F=`offsetHeight`in t?t.offsetHeight===0?0:a/t.offsetHeight:0;if(c===t)j=r===`start`?T:r===`end`?T-f:r===`nearest`?jN(m,m+f,f,O,A,m+T,m+T+h,h):T-f/2,M=i===`start`?E:i===`center`?E-d/2:i===`end`?E-d:jN(p,p+d,d,w,k,p+E,p+E+g,g),j=Math.max(0,j+m),M=Math.max(0,M+p);else{j=r===`start`?T-s-O:r===`end`?T-x+A+P:r===`nearest`?jN(s,x,a,O,A+P,T,T+h,h):T-(s+a/2)+P/2,M=i===`start`?E-S-w:i===`center`?E-(S+o/2)+N/2:i===`end`?E-u+k+N:jN(S,u,o,w,k+N,E,E+g,g);let{scrollLeft:e,scrollTop:n}=t;j=F===0?0:Math.max(0,Math.min(n+j/F,t.scrollHeight-a/F+P)),M=ee===0?0:Math.max(0,Math.min(e+M/ee,t.scrollWidth-o/ee+N)),T+=n-j,E+=e-M}D.push({el:t,top:j,left:M})}return D},PN=0;function FN(){return String(PN++)}var IN=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?G.useLayoutEffect:G.useEffect;function LN(e){var t=G.useRef(e);return IN(function(){t.current=e},[e]),t}function RN(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach(function(t){typeof t==`function`?t(e):t&&(t.current=e)})}}function zN(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.some(function(t){return t&&t.apply(void 0,[e].concat(r)),e.preventDownshiftDefault||e.hasOwnProperty(`nativeEvent`)&&e.nativeEvent.preventDownshiftDefault})}}function BN(e,t){var n;function r(){n&&clearTimeout(n)}function i(){for(var i=arguments.length,a=Array(i),o=0;o<i;o++)a[o]=arguments[o];r(),n=setTimeout(function(){n=null,e.apply(void 0,a)},t)}return i.cancel=r,i}var VN=BN(function(e){HN(e).textContent=``},500);function HN(e){var t=e.getElementById(`a11y-status-message`);return t||(t=e.createElement(`div`),t.setAttribute(`id`,`a11y-status-message`),t.setAttribute(`role`,`status`),t.setAttribute(`aria-live`,`polite`),t.setAttribute(`aria-relevant`,`additions text`),Object.assign(t.style,{border:`0`,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:`0`,position:`absolute`,width:`1px`}),e.body.appendChild(t),t)}function UN(e,t){if(e&&t){var n=HN(t);n.textContent=e,VN(t)}}function WN(e){var t=e?.getElementById(`a11y-status-message`);t&&t.remove()}function GN(){}var KN=GN;function qN(e,t){return t?Object.keys(e).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},SN({},e)):e}function JN(e,t){e&&NN(e,{boundary:t,block:`nearest`,scrollMode:`if-needed`}).forEach(function(e){var t=e.el,n=e.top,r=e.left;t.scrollTop=n,t.scrollLeft=r})}function YN(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&!t.startsWith(`Arrow`)?`Arrow`+t:t}function XN(e,t,n,r,i){i===void 0&&(i=!1);var a=n.length;if(t){for(var o=e;o>=0;o--)if(!r(n[o],o))return o}else for(var s=e;s<a;s++)if(!r(n[s],s))return s;return i?XN(t?a-1:0,t,n,r):-1}function ZN(e,t,n,r,i){i===void 0&&(i=!1);var a=n.length;if(a===0)return-1;var o=a-1;(typeof e!=`number`||e<0||e>o)&&(e=t>0?-1:o+1);var s=e+t;s<0?s=i?o:0:s>o&&(s=i?0:o);var c=XN(s,t<0,n,r,i);return c===-1?e>=a?-1:e:c}function QN(e,t,n,r){return r===void 0&&(r=!0),!!n&&t.some(function(t){return t&&($N(t,e,n)||r&&$N(t,n.document.activeElement,n))})}function $N(e,t,n){return e===t||t instanceof n.Node&&e.contains(t)}function eP(e){return``+e.slice(0,1).toUpperCase()+e.slice(1)}function tP(e,t,n,r){for(var i=e.type,a={},o=Object.keys(n),s=0,c=o;s<c.length;s++){var l=c[s];nP(l,e,t,n,r),r[l]!==n[l]&&(a[l]=r[l])}typeof t.onStateChange==`function`&&Object.keys(a).length&&t.onStateChange(SN({type:i},a))}function nP(e,t,n,r,i){if(i[e]!==r[e]){var a=n[`on`+eP(e)+`Change`];if(typeof a==`function`){var o=t.type;a(SN({type:o},i))}}}function rP(e,t,n,r){var i=G.useRef({}),a=G.useCallback(function(t,n){var r=t.state;r=qN(r,n.props);var i=e(r,n),a=n.props.stateReducer(r,SN({},n,{changes:i}));return{state:SN({},r,a),lastAction:n}},[e]),o=G.useReducer(a,t,function(e){return{state:n(e),lastAction:void 0}}),s=o[0],c=s.state,l=s.lastAction,u=o[1],d=LN(t),f=G.useCallback(function(e){return u(SN({},e,{props:d.current}))},[d]);return G.useEffect(function(){if(l){var e=qN(i.current,l.props);r(e,c)||tP(l,l.props,e,c)}i.current=c},[c,l,r]),[c,f]}function iP(e,t,n,r){var i=rP(e,t,n,r),a=i[0],o=i[1];return[qN(a,t),o]}function aP(e,t,n,r){if(e!==void 0&&t!==void 0)return[e,t];if(e!==void 0){if(n.indexOf(e)<0)throw Error(r);return[e,n.indexOf(e)]}if(t!==void 0){var i=n[t];if(i===void 0)throw Error(r);return[i,t]}throw Error(r)}function oP(){var e=G.useRef(!0);return G.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]),e.current}var sP={environment:$.default.shape({addEventListener:$.default.func.isRequired,removeEventListener:$.default.func.isRequired,document:$.default.shape({createElement:$.default.func.isRequired,getElementById:$.default.func.isRequired,activeElement:$.default.any.isRequired,body:$.default.any.isRequired}).isRequired,Node:$.default.func.isRequired}),itemToKey:$.default.func,stateReducer:$.default.func};function cP(e,t){return e===void 0?t:e}function lP(e,t,n,r){return e===void 0?t===void 0?n===void 0?r:n:t:e}var uP=BN(function(e,t){UN(e,t)},200);function dP(e,t,n,r){var i=r?.document,a=oP();G.useEffect(function(){e&&!a&&i&&uP(e(t),i)},n),G.useEffect(function(){return function(){uP.cancel(),WN(i)}},[i])}var fP=SN({},sP,{getA11yStatusMessage:$.default.func,highlightedIndex:$.default.number,defaultHighlightedIndex:$.default.number,initialHighlightedIndex:$.default.number,isOpen:$.default.bool,defaultIsOpen:$.default.bool,initialIsOpen:$.default.bool,selectedItem:$.default.any,initialSelectedItem:$.default.any,defaultSelectedItem:$.default.any,id:$.default.string,labelId:$.default.string,menuId:$.default.string,getItemId:$.default.func,toggleButtonId:$.default.string,onSelectedItemChange:$.default.func,onHighlightedIndexChange:$.default.func,onStateChange:$.default.func,onIsOpenChange:$.default.func,scrollIntoView:$.default.func}),pP={itemToString:function(e){return e?String(e):``},itemToKey:function(e){return e},isItemDisabled:function(e){return!1},stateReducer:function(e,t){return t.changes},scrollIntoView:JN,environment:typeof window>`u`?void 0:window},mP={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:``},hP=SN({},G).useId,gP=typeof hP==`function`?_P:vP;function _P(e){var t=e.id,n=e.labelId,r=e.menuId,i=e.getItemId,a=e.toggleButtonId,o=e.inputId,s=`downshift-`+hP();return t||=s,G.useMemo(function(){return{labelId:n??t+`-label`,menuId:r??t+`-menu`,getItemId:i??function(e){return t+`-item-`+e},toggleButtonId:a??t+`-toggle-button`,inputId:o??t+`-input`}},[i,t,o,n,r,a])}function vP(e){var t=e.id,n=e.labelId,r=e.menuId,i=e.getItemId,a=e.toggleButtonId,o=e.inputId,s=G.useState(function(){return t??`downshift-`+FN()})[0];return G.useMemo(function(){return{labelId:n??s+`-label`,menuId:r??s+`-menu`,getItemId:i??function(e){return s+`-item-`+e},toggleButtonId:a??s+`-toggle-button`,inputId:o??s+`-input`}},[i,o,n,r,a,s])}function yP(e,t,n){var r=cP(n,mP.highlightedIndex);return e[r]&&t(e[r],r)?-1:r}function bP(e,t,n,r,i,a){var o=e.length&&i>=0;return SN({isOpen:!1,highlightedIndex:-1},o&&SN({selectedItem:e[i],isOpen:cP(n,mP.isOpen),highlightedIndex:cP(r,mP.highlightedIndex)},a&&{inputValue:t(e[i])}))}function xP(e,t,n,r,i,a,o,s){return e.length===0?-1:t!==void 0&&o===t&&(t===-1||e[t]!==void 0&&!r(e[t],t))?t:n!==void 0&&(n===-1||e[n]!==void 0&&!r(e[n],n))?n:a?e.findIndex(function(e){return i(a)===i(e)}):s<0&&e[e.length-1]&&!r(e[e.length-1],e.length-1)?e.length-1:s>0&&e[0]&&!r(e[0],0)?0:-1}function SP(e){var t=lP(e.selectedItem,e.initialSelectedItem,e.defaultSelectedItem,mP.selectedItem),n=lP(e.isOpen,e.initialIsOpen,e.defaultIsOpen,mP.isOpen),r=CP(e),i=lP(e.inputValue,e.initialInputValue,e.defaultInputValue,mP.inputValue);return{highlightedIndex:r<0&&t&&n?e.items.findIndex(function(n){return e.itemToKey(n)===e.itemToKey(t)}):r,isOpen:n,selectedItem:t,inputValue:i}}function CP(e){var t=lP(e.highlightedIndex,e.initialHighlightedIndex,e.defaultHighlightedIndex,mP.highlightedIndex);return t>-1&&e.items[t]&&e.isItemDisabled(e.items[t],t)?-1:t}var wP=GN;function TP(e,t,n){var r=G.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1}),i=G.useCallback(function(){return n.map(function(e){return e.current})},[n]);return G.useEffect(function(){if(!e)return GN;function n(){r.current.isTouchEnd=!1,r.current.isMouseDown=!0}function a(n){r.current.isMouseDown=!1,QN(n.target,i(),e)||t()}function o(){r.current.isTouchEnd=!1,r.current.isTouchMove=!1}function s(){r.current.isTouchMove=!0}function c(n){r.current.isTouchEnd=!0,!r.current.isTouchMove&&!QN(n.target,i(),e,!1)&&t()}return e.addEventListener(`mousedown`,n),e.addEventListener(`mouseup`,a),e.addEventListener(`touchstart`,o),e.addEventListener(`touchmove`,s),e.addEventListener(`touchend`,c),function(){e.removeEventListener(`mousedown`,n),e.removeEventListener(`mouseup`,a),e.removeEventListener(`touchstart`,o),e.removeEventListener(`touchmove`,s),e.removeEventListener(`touchend`,c)}},[e,i,t]),r}var EP=function(){return GN};function DP(e,t,n,r,i,a){var o=G.useRef(!0);return IN(function(){if(!(t<0||!n||!Object.keys(i.current).length)){if(o.current){var s=i.current[a(t)];s&&r.current&&e(s,r.current)}else o.current=!0}},[t]),G.useCallback(function(){o.current=!1},[])}function OP(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function kP(e,t,n,r){var i=n.type,a;switch(i){case r.ItemMouseMove:a={highlightedIndex:n.disabled?-1:n.index};break;case r.MenuMouseLeave:a={highlightedIndex:-1};break;case r.ToggleButtonClick:case r.FunctionToggleMenu:a={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:xP(t.items,t.initialHighlightedIndex,t.defaultHighlightedIndex,t.isItemDisabled,t.itemToKey,e.selectedItem,e.highlightedIndex,0)};break;case r.FunctionOpenMenu:a={isOpen:!0,highlightedIndex:xP(t.items,t.initialHighlightedIndex,t.defaultHighlightedIndex,t.isItemDisabled,t.itemToKey,e.selectedItem,e.highlightedIndex,0)};break;case r.FunctionCloseMenu:a={isOpen:!1};break;case r.FunctionSetHighlightedIndex:var o=n.highlightedIndex;a={highlightedIndex:t.isItemDisabled(t.items[o],o)?-1:o};break;case r.FunctionSetInputValue:a={inputValue:n.inputValue};break;case r.FunctionReset:a={highlightedIndex:yP(t.items,t.isItemDisabled,t.defaultHighlightedIndex),isOpen:cP(t.defaultIsOpen,mP.isOpen),selectedItem:cP(t.defaultSelectedItem,mP.selectedItem),inputValue:cP(t.defaultInputValue,mP.inputValue)};break;default:throw Error(`Reducer called without proper action type.`)}return SN({},e,a)}var AP=SN({},fP,{items:$.default.array.isRequired,isItemDisabled:$.default.func});function jP(e){for(var t=e.keysSoFar,n=e.highlightedIndex,r=e.items,i=e.itemToString,a=e.isItemDisabled,o=t.toLowerCase(),s=0;s<r.length;s++){var c=(s+n+ +(t.length<2))%r.length,l=r[c];if(l!==void 0&&i(l).toLowerCase().startsWith(o)&&!a(l,c))return c}return n}var MP=0,NP=1,PP=2,FP=3,IP=4,LP=5,RP=6,zP=7,BP=8,VP=9,HP=10,UP=11,WP=12,GP=13,KP=14,qP=15,JP=16,YP=17,XP=18,ZP=19,QP=20,$P=21,eF=Object.freeze({__proto__:null,FunctionCloseMenu:YP,FunctionOpenMenu:JP,FunctionReset:$P,FunctionSelectItem:ZP,FunctionSetHighlightedIndex:XP,FunctionSetInputValue:QP,FunctionToggleMenu:qP,ItemClick:KP,ItemMouseMove:GP,MenuMouseLeave:WP,ToggleButtonBlur:UP,ToggleButtonClick:MP,ToggleButtonKeyDownArrowDown:NP,ToggleButtonKeyDownArrowUp:PP,ToggleButtonKeyDownCharacter:FP,ToggleButtonKeyDownEnd:RP,ToggleButtonKeyDownEnter:zP,ToggleButtonKeyDownEscape:IP,ToggleButtonKeyDownHome:LP,ToggleButtonKeyDownPageDown:HP,ToggleButtonKeyDownPageUp:VP,ToggleButtonKeyDownSpaceButton:BP});function tF(e,t){var n=t.type,r=t.props,i;switch(n){case KP:i={isOpen:cP(r.defaultIsOpen,mP.isOpen),highlightedIndex:yP(r.items,r.isItemDisabled,r.defaultHighlightedIndex),selectedItem:r.items[t.index]};break;case FP:var a=t.key,o=``+e.inputValue+a;i={inputValue:o,highlightedIndex:jP({keysSoFar:o,highlightedIndex:!e.isOpen&&e.selectedItem?r.items.findIndex(function(t){return r.itemToKey(t)===r.itemToKey(e.selectedItem)}):e.highlightedIndex,items:r.items,itemToString:r.itemToString,isItemDisabled:r.isItemDisabled}),isOpen:!0};break;case NP:var s=t.altKey;i={highlightedIndex:e.isOpen?ZN(e.highlightedIndex,1,r.items,r.isItemDisabled):s&&e.selectedItem==null?-1:xP(r.items,r.initialHighlightedIndex,r.defaultHighlightedIndex,r.isItemDisabled,r.itemToKey,e.selectedItem,e.highlightedIndex,1),isOpen:!0};break;case PP:var c=t.altKey;i=e.isOpen&&c?bP(r.items,r.itemToString,r.defaultIsOpen,r.defaultHighlightedIndex,e.highlightedIndex,!1):{highlightedIndex:e.isOpen?ZN(e.highlightedIndex,-1,r.items,r.isItemDisabled):xP(r.items,r.initialHighlightedIndex,r.defaultHighlightedIndex,r.isItemDisabled,r.itemToKey,e.selectedItem,e.highlightedIndex,-1),isOpen:!0};break;case zP:case BP:i=bP(r.items,r.itemToString,r.defaultIsOpen,r.defaultHighlightedIndex,e.highlightedIndex,!1);break;case LP:i={highlightedIndex:XN(0,!1,r.items,r.isItemDisabled),isOpen:!0};break;case RP:i={highlightedIndex:XN(r.items.length-1,!0,r.items,r.isItemDisabled),isOpen:!0};break;case VP:i={highlightedIndex:ZN(e.highlightedIndex,-10,r.items,r.isItemDisabled)};break;case HP:i={highlightedIndex:ZN(e.highlightedIndex,10,r.items,r.isItemDisabled)};break;case IP:i={isOpen:!1,highlightedIndex:-1};break;case UP:i=SN({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&r.items.length&&{selectedItem:r.items[e.highlightedIndex]});break;case ZP:i={selectedItem:t.selectedItem};break;default:return kP(e,r,t,eF)}return SN({},e,i)}var nF=[`onClick`],rF=[`onMouseLeave`,`refKey`,`ref`,`aria-label`],iF=[`onBlur`,`onClick`,`onPress`,`onKeyDown`,`refKey`,`ref`],aF=[`item`,`index`,`onMouseMove`,`onClick`,`onMouseDown`,`onPress`,`refKey`,`disabled`,`ref`];oF.stateChangeTypes=eF;function oF(e){e===void 0&&(e={}),KN(e,oF,AP);var t=SN({},pP,e),n=t.items,r=t.isItemDisabled,i=t.scrollIntoView,a=t.environment,o=t.getA11yStatusMessage,s=iP(tF,t,SP,OP),c=s[0],l=s[1],u=c.isOpen,d=c.highlightedIndex,f=c.selectedItem,p=c.inputValue,m=(0,G.useRef)(null),h=(0,G.useRef)(null),g=(0,G.useRef)({}),_=(0,G.useRef)(null),v=gP(t),y=LN(c);dP(o,c,[u,d,f,p],a);var b=DP(i,d,u,h,g,v.getItemId);(0,G.useEffect)(function(){return _.current=BN(function(e){e({type:QP,inputValue:``})},500),function(){var e;(e=_.current)==null||e.cancel()}},[]),(0,G.useEffect)(function(){p&&(_.current==null||_.current(l))},[l,p]),wP({props:t,state:c}),(0,G.useEffect)(function(){lP(t.isOpen,t.initialIsOpen,t.defaultIsOpen,mP.isOpen)&&m.current&&m.current.focus()},[]);var x=TP(a,(0,G.useCallback)(function(){y.current.isOpen&&l({type:UP})},[l,y]),(0,G.useMemo)(function(){return[h,m]},[])),S=EP(`getMenuProps`,`getToggleButtonProps`);(0,G.useEffect)(function(){u||(g.current={})},[u]);var C=(0,G.useMemo)(function(){return{ArrowDown:function(e){e.preventDefault(),l({type:NP,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),l({type:PP,altKey:e.altKey})},Home:function(e){e.preventDefault(),l({type:LP})},End:function(e){e.preventDefault(),l({type:RP})},Escape:function(){y.current.isOpen&&l({type:IP})},Enter:function(e){e.preventDefault(),l({type:y.current.isOpen?zP:MP})},PageUp:function(e){y.current.isOpen&&(e.preventDefault(),l({type:VP}))},PageDown:function(e){y.current.isOpen&&(e.preventDefault(),l({type:HP}))}," ":function(e){e.preventDefault();var t=y.current;t.isOpen?t.inputValue?l({type:FP,key:` `}):l({type:BP}):l({type:MP})}}},[l,y]),w=(0,G.useCallback)(function(e){var t=e??{},n=t.onClick,r=xN(t,nF);return SN({id:v.labelId,htmlFor:v.toggleButtonId,onClick:zN(n,function(){var e;(e=m.current)==null||e.focus()})},r)},[v]),T=(0,G.useCallback)(function(e,t){var n,r=e??{},i=r.onMouseLeave,a=r.refKey,o=a===void 0?`ref`:a,s=r.ref,c=r[`aria-label`],u=xN(r,rF),d=(t??{}).suppressRefError;return S(`getMenuProps`,d!==void 0&&d,o,h),SN((n={},n[o]=RN(s,function(e){h.current=e}),n.id=v.menuId,n.role=`listbox`,n[`aria-label`]=c,n[`aria-labelledby`]=c?void 0:``+v.labelId,n.onMouseLeave=zN(i,function(){l({type:WP})}),n),u)},[l,S,v]),E=(0,G.useCallback)(function(e,t){var n,r=e??{},i=r.onBlur,a=r.onClick;r.onPress;var o=r.onKeyDown,s=r.refKey,c=s===void 0?`ref`:s,f=r.ref,p=xN(r,iF),h=(t??{}).suppressRefError,g=h!==void 0&&h,_=function(){l({type:MP})},b=function(){y.current.isOpen&&!x.current.isMouseDown&&l({type:UP})},w=function(e){var t=YN(e);t&&t in C?C[t](e):/^\S{1}$/.test(t)&&l({type:FP,key:t})},T=SN((n={},n[c]=RN(f,function(e){m.current=e}),n[`aria-activedescendant`]=u&&d>-1?v.getItemId(d):``,n[`aria-controls`]=v.menuId,n[`aria-expanded`]=u,n[`aria-haspopup`]=`listbox`,n[`aria-labelledby`]=p[`aria-label`]?void 0:``+v.labelId,n.id=v.toggleButtonId,n.role=`combobox`,n.tabIndex=0,n.onBlur=zN(i,b),n),p);return p.disabled||Object.assign(T,{onClick:zN(a,_),onKeyDown:zN(o,w)}),S(`getToggleButtonProps`,g,c,m),T},[l,v,u,d,x,S,C,y]),D=(0,G.useCallback)(function(e){var t,i=e??{},a=i.item,o=i.index,s=i.onMouseMove,c=i.onClick,u=i.onMouseDown;i.onPress;var d=i.refKey,p=d===void 0?`ref`:d,m=i.disabled,h=i.ref,_=xN(i,aF);m!==void 0&&console.warn(`Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.`);var S=aP(a,o,n,`Pass either item or index to getItemProps!`),C=S[0],w=S[1],T=r(C,w),E=function(){x.current.isTouchEnd||w===y.current.highlightedIndex||(b(),l({type:GP,index:w,disabled:T}))},D=function(){l({type:KP,index:w})},O=SN((t={},t[p]=RN(h,function(e){e&&(g.current[v.getItemId(w)]=e)}),t[`aria-disabled`]=T,t[`aria-selected`]=C===f,t.id=v.getItemId(w),t.role=`option`,t.onMouseMove=zN(s,E),t.onMouseDown=zN(u,function(e){return e.preventDefault()}),t),_);return T||Object.assign(O,{onClick:zN(c,D)}),O},[n,r,f,v,x,b,l,y]),O=(0,G.useCallback)(function(){l({type:qP})},[l]),k=(0,G.useCallback)(function(){l({type:YP})},[l]);return{getToggleButtonProps:E,getLabelProps:w,getMenuProps:T,getItemProps:D,toggleMenu:O,openMenu:(0,G.useCallback)(function(){l({type:JP})},[l]),closeMenu:k,setHighlightedIndex:(0,G.useCallback)(function(e){l({type:XP,highlightedIndex:e})},[l]),selectItem:(0,G.useCallback)(function(e){l({type:ZP,selectedItem:e})},[l]),reset:(0,G.useCallback)(function(){l({type:$P})},[l]),setInputValue:(0,G.useCallback)(function(e){l({type:QP,inputValue:e})},[l]),highlightedIndex:d,isOpen:u,selectedItem:f,inputValue:p}}function sF(e){var t=SP(e),n=t.selectedItem,r=t.inputValue;return r===``&&n&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(r=e.itemToString(n)),SN({},t,{inputValue:r})}var cF=0,lF=1,uF=2,dF=3,fF=4,pF=5,mF=6,hF=7,gF=8,_F=9,vF=10,yF=11,bF=12,xF=13,SF=14,CF=15,wF=16,TF=17,EF=18,DF=19,OF=20,kF=21,AF=22,jF=Object.freeze({__proto__:null,ControlledPropUpdatedSelectedItem:AF,FunctionCloseMenu:TF,FunctionOpenMenu:wF,FunctionReset:kF,FunctionSelectItem:DF,FunctionSetHighlightedIndex:EF,FunctionSetInputValue:OF,FunctionToggleMenu:CF,InputBlur:_F,InputChange:gF,InputClick:vF,InputKeyDownArrowDown:cF,InputKeyDownArrowUp:lF,InputKeyDownEnd:fF,InputKeyDownEnter:hF,InputKeyDownEscape:uF,InputKeyDownHome:dF,InputKeyDownPageDown:mF,InputKeyDownPageUp:pF,ItemClick:xF,ItemMouseMove:bF,MenuMouseLeave:yF,ToggleButtonClick:SF});function MF(e,t,n,r){var i=(0,G.useRef)(null),a=rP(e,t,n,r),o=a[0],s=a[1],c=oP();return(0,G.useEffect)(function(){t.selectedItem!==void 0&&(c||t.itemToKey(t.selectedItem)!==t.itemToKey(i.current)&&s({type:AF,inputValue:t.itemToString(t.selectedItem)}),i.current=o.selectedItem===i.current?t.selectedItem:o.selectedItem)},[o.selectedItem,t.selectedItem]),[qN(o,t),s]}var NF=SN({},fP,{items:$.default.array.isRequired,isItemDisabled:$.default.func,inputValue:$.default.string,defaultInputValue:$.default.string,initialInputValue:$.default.string,inputId:$.default.string,onInputValueChange:$.default.func});function PF(e,t){var n=t.type,r=t.props,i;switch(n){case xF:i={isOpen:cP(r.defaultIsOpen,mP.isOpen),highlightedIndex:yP(r.items,r.isItemDisabled,r.defaultHighlightedIndex),selectedItem:r.items[t.index],inputValue:r.itemToString(r.items[t.index])};break;case cF:i=e.isOpen?{highlightedIndex:ZN(e.highlightedIndex,1,r.items,r.isItemDisabled,!0)}:{highlightedIndex:t.altKey&&e.selectedItem==null?-1:xP(r.items,r.initialHighlightedIndex,r.defaultHighlightedIndex,r.isItemDisabled,r.itemToKey,e.selectedItem,e.highlightedIndex,1),isOpen:r.items.length>=0};break;case lF:i=e.isOpen?t.altKey?bP(r.items,r.itemToString,r.defaultIsOpen,r.defaultHighlightedIndex,e.highlightedIndex,!0):{highlightedIndex:ZN(e.highlightedIndex,-1,r.items,r.isItemDisabled,!0)}:{highlightedIndex:xP(r.items,r.initialHighlightedIndex,r.defaultHighlightedIndex,r.isItemDisabled,r.itemToKey,e.selectedItem,e.highlightedIndex,-1),isOpen:r.items.length>=0};break;case hF:i=bP(r.items,r.itemToString,r.defaultIsOpen,r.defaultHighlightedIndex,e.highlightedIndex,!0);break;case uF:i=SN({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:``});break;case pF:i={highlightedIndex:ZN(e.highlightedIndex,-10,r.items,r.isItemDisabled,!0)};break;case mF:i={highlightedIndex:ZN(e.highlightedIndex,10,r.items,r.isItemDisabled,!0)};break;case dF:i={highlightedIndex:XN(0,!1,r.items,r.isItemDisabled)};break;case fF:i={highlightedIndex:XN(r.items.length-1,!0,r.items,r.isItemDisabled)};break;case _F:i=SN({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&r.items.length&&t.selectItem&&{selectedItem:r.items[e.highlightedIndex],inputValue:r.itemToString(r.items[e.highlightedIndex])});break;case gF:i={isOpen:!0,highlightedIndex:yP(r.items,r.isItemDisabled,r.defaultHighlightedIndex),inputValue:t.inputValue};break;case vF:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:xP(r.items,r.initialHighlightedIndex,r.defaultHighlightedIndex,r.isItemDisabled,r.itemToKey,e.selectedItem,e.highlightedIndex,0)};break;case DF:i={selectedItem:t.selectedItem,inputValue:r.itemToString(t.selectedItem)};break;case AF:i={inputValue:t.inputValue};break;default:return kP(e,r,t,jF)}return SN({},e,i)}var FF=[`onMouseLeave`,`refKey`,`ref`,`aria-label`],IF=[`item`,`index`,`refKey`,`ref`,`onMouseMove`,`onMouseDown`,`onClick`,`onPress`,`disabled`],LF=[`onClick`,`onPress`,`refKey`,`ref`],RF=[`aria-label`,`onKeyDown`,`onChange`,`onInput`,`onBlur`,`onChangeText`,`onClick`,`refKey`,`ref`];zF.stateChangeTypes=jF;function zF(e){e===void 0&&(e={}),KN(e,zF,NF);var t=SN({},pP,e),n=t.items,r=t.isItemDisabled,i=t.scrollIntoView,a=t.environment,o=t.getA11yStatusMessage,s=MF(PF,t,sF,OP),c=s[0],l=s[1],u=c.isOpen,d=c.highlightedIndex,f=c.selectedItem,p=c.inputValue,m=(0,G.useRef)(null),h=(0,G.useRef)({}),g=(0,G.useRef)(null),_=(0,G.useRef)(null),v=oP(),y=gP(t),b=(0,G.useRef)(),x=LN(c);dP(o,c,[u,d,f,p],a);var S=DP(i,d,u,m,h,y.getItemId);wP({state:c,props:t}),(0,G.useEffect)(function(){lP(t.isOpen,t.initialIsOpen,t.defaultIsOpen,mP.isOpen)&&g.current&&g.current.focus()},[]),(0,G.useEffect)(function(){v||(b.current=n.length)});var C=TP(a,(0,G.useCallback)(function(){x.current.isOpen&&l({type:_F})},[l,x]),(0,G.useMemo)(function(){return[m,_,g]},[])),w=EP(`getInputProps`,`getMenuProps`);(0,G.useEffect)(function(){u||(h.current={})},[u]),(0,G.useEffect)(function(){var e;u&&a!=null&&a.document&&(e=g.current)!=null&&e.focus&&a.document.activeElement!==g.current&&g.current.focus()},[u,a]);var T=(0,G.useMemo)(function(){return{ArrowDown:function(e){e.preventDefault(),l({type:cF,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),l({type:lF,altKey:e.altKey})},Home:function(e){x.current.isOpen&&(e.preventDefault(),l({type:dF}))},End:function(e){x.current.isOpen&&(e.preventDefault(),l({type:fF}))},Escape:function(e){var t=x.current;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),l({type:uF}))},Enter:function(e){x.current.isOpen&&e.which!==229&&(e.preventDefault(),l({type:hF}))},PageUp:function(e){x.current.isOpen&&(e.preventDefault(),l({type:pF}))},PageDown:function(e){x.current.isOpen&&(e.preventDefault(),l({type:mF}))}}},[l,x]),E=(0,G.useCallback)(function(e){return SN({id:y.labelId,htmlFor:y.inputId},e)},[y]),D=(0,G.useCallback)(function(e,t){var n,r=e??{},i=r.onMouseLeave,a=r.refKey,o=a===void 0?`ref`:a,s=r.ref,c=r[`aria-label`],u=xN(r,FF),d=(t??{}).suppressRefError;return w(`getMenuProps`,d!==void 0&&d,o,m),SN((n={},n[o]=RN(s,function(e){m.current=e}),n.id=y.menuId,n.role=`listbox`,n[`aria-label`]=c,n[`aria-labelledby`]=c?void 0:``+y.labelId,n.onMouseLeave=zN(i,function(){l({type:yF})}),n),u)},[l,w,y]),O=(0,G.useCallback)(function(e){var t,i,a=e??{},o=a.item,s=a.index,c=a.refKey,u=c===void 0?`ref`:c,f=a.ref,p=a.onMouseMove,m=a.onMouseDown,g=a.onClick;a.onPress;var _=a.disabled,v=xN(a,IF);_!==void 0&&console.warn(`Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.`);var b=aP(o,s,n,`Pass either item or index to getItemProps!`),w=b[0],T=b[1],E=r(w,T),D=`onClick`,O=g;return SN((t={},t[u]=RN(f,function(e){e&&(h.current[y.getItemId(T)]=e)}),t[`aria-disabled`]=E,t[`aria-selected`]=T===d,t.id=y.getItemId(T),t.role=`option`,t),!E&&(i={},i[D]=zN(O,function(){l({type:xF,index:T})}),i),{onMouseMove:zN(p,function(){C.current.isTouchEnd||T===x.current.highlightedIndex||(S(),l({type:bF,index:T,disabled:E}))}),onMouseDown:zN(m,function(e){return e.preventDefault()})},v)},[l,y,n,r,d,C,S,x]),k=(0,G.useCallback)(function(e){var t,n=e??{},r=n.onClick;n.onPress;var i=n.refKey,a=i===void 0?`ref`:i,o=n.ref,s=xN(n,LF);return SN((t={},t[a]=RN(o,function(e){_.current=e}),t[`aria-controls`]=y.menuId,t[`aria-expanded`]=u,t.id=y.toggleButtonId,t.tabIndex=-1,t),!s.disabled&&SN({},{onClick:zN(r,function(){l({type:SF})})}),s)},[l,u,y]),A=(0,G.useCallback)(function(e,t){var n,r=e??{},i=r[`aria-label`],o=r.onKeyDown,s=r.onChange,c=r.onInput,f=r.onBlur;r.onChangeText;var m=r.onClick,h=r.refKey,_=h===void 0?`ref`:h,v=r.ref,b=xN(r,RF),S=(t??{}).suppressRefError;w(`getInputProps`,S!==void 0&&S,_,g);var E=function(e){var t=YN(e);t&&t in T&&T[t](e)},D=function(e){l({type:gF,inputValue:e.target.value})},O=function(e){a!=null&&a.document&&x.current.isOpen&&!C.current.isMouseDown&&l({type:_F,selectItem:e.relatedTarget!==null||a.document.activeElement===a.document.body})},k=function(){l({type:vF})},A=`onChange`,j={};if(!b.disabled){var M;j=(M={},M[A]=zN(s,c,D),M.onKeyDown=zN(o,E),M.onBlur=zN(f,O),M.onClick=zN(m,k),M)}return SN((n={},n[_]=RN(v,function(e){g.current=e}),n[`aria-activedescendant`]=u&&d>-1?y.getItemId(d):``,n[`aria-autocomplete`]=`list`,n[`aria-controls`]=y.menuId,n[`aria-expanded`]=u,n[`aria-labelledby`]=i?void 0:y.labelId,n[`aria-label`]=i,n.autoComplete=`off`,n.id=y.inputId,n.role=`combobox`,n.value=p,n),j,b)},[l,y,a,T,u,d,p,C,w,x]),j=(0,G.useCallback)(function(){l({type:CF})},[l]),M=(0,G.useCallback)(function(){l({type:TF})},[l]),N=(0,G.useCallback)(function(){l({type:wF})},[l]),P=(0,G.useCallback)(function(e){l({type:EF,highlightedIndex:e})},[l]),ee=(0,G.useCallback)(function(e){l({type:DF,selectedItem:e})},[l]);return{getItemProps:O,getLabelProps:E,getMenuProps:D,getInputProps:A,getToggleButtonProps:k,toggleMenu:j,openMenu:N,closeMenu:M,setHighlightedIndex:P,setInputValue:(0,G.useCallback)(function(e){l({type:OF,inputValue:e})},[l]),selectItem:ee,reset:(0,G.useCallback)(function(){l({type:kF})},[l]),highlightedIndex:d,isOpen:u,selectedItem:f,inputValue:p}}var BF={activeIndex:-1,selectedItems:[]};function VF(e){return{activeIndex:lP(e.activeIndex,e.initialActiveIndex,e.defaultActiveIndex,BF.activeIndex),selectedItems:lP(e.selectedItems,e.initialSelectedItems,e.defaultSelectedItems,BF.selectedItems)}}function HF(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&t.value!==``&&(t.selectionStart!==0||t.selectionEnd!==0))}function UF(e,t){return e.selectedItems===t.selectedItems&&e.activeIndex===t.activeIndex}fP.stateReducer,fP.itemToKey,fP.environment,$.default.array,$.default.array,$.default.array,$.default.func,$.default.number,$.default.number,$.default.number,$.default.func,$.default.func,$.default.string,$.default.string;var WF={itemToKey:pP.itemToKey,stateReducer:pP.stateReducer,environment:pP.environment,keyNavigationNext:`ArrowRight`,keyNavigationPrevious:`ArrowLeft`},GF=GN,KF=0,qF=1,JF=2,YF=3,XF=4,ZF=5,QF=6,$F=7,eI=8,tI=9,nI=10,rI=11,iI=12,aI=Object.freeze({__proto__:null,DropdownClick:$F,DropdownKeyDownBackspace:QF,DropdownKeyDownNavigationPrevious:ZF,FunctionAddSelectedItem:eI,FunctionRemoveSelectedItem:tI,FunctionReset:iI,FunctionSetActiveIndex:rI,FunctionSetSelectedItems:nI,SelectedItemClick:KF,SelectedItemKeyDownBackspace:JF,SelectedItemKeyDownDelete:qF,SelectedItemKeyDownNavigationNext:YF,SelectedItemKeyDownNavigationPrevious:XF});function oI(e,t){var n=t.type,r=t.index,i=t.selectedItem,a=t.props,o=e.activeIndex,s=e.selectedItems,c;switch(n){case KF:c={activeIndex:r};break;case XF:c={activeIndex:o-1<0?0:o-1};break;case YF:c={activeIndex:o+1>=s.length?-1:o+1};break;case JF:case qF:if(o<0)break;var l=o;s.length===1?l=-1:o===s.length-1&&(l=s.length-2),c=SN({selectedItems:[].concat(s.slice(0,o),s.slice(o+1))},{activeIndex:l});break;case ZF:c={activeIndex:s.length-1};break;case QF:c={selectedItems:s.slice(0,s.length-1)};break;case eI:c={selectedItems:[].concat(s,[i])};break;case $F:c={activeIndex:-1};break;case tI:var u=o,d=s.findIndex(function(e){return a.itemToKey(e)===a.itemToKey(i)});if(d<0)break;s.length===1?u=-1:d===s.length-1&&(u=s.length-2),c={selectedItems:[].concat(s.slice(0,d),s.slice(d+1)),activeIndex:u};break;case nI:c={selectedItems:t.selectedItems};break;case rI:c={activeIndex:t.activeIndex};break;case iI:c={activeIndex:cP(a.defaultActiveIndex,BF.activeIndex),selectedItems:cP(a.defaultSelectedItems,BF.selectedItems)};break;default:throw Error(`Reducer called without proper action type.`)}return SN({},e,c)}var sI=[`refKey`,`ref`,`onClick`,`onKeyDown`,`selectedItem`,`index`],cI=[`refKey`,`ref`,`onKeyDown`,`onClick`,`preventKeyAction`];lI.stateChangeTypes=aI;function lI(e){e===void 0&&(e={}),GF(e,lI);var t=SN({},WF,e),n=t.getA11yStatusMessage,r=t.environment,i=t.keyNavigationNext,a=t.keyNavigationPrevious,o=iP(oI,t,VF,UF),s=o[0],c=o[1],l=s.activeIndex,u=s.selectedItems,d=oP(),f=(0,G.useRef)(null),p=(0,G.useRef)(null);p.current===null&&(p.current=new Map),dP(n,s,[l,u],r),(0,G.useEffect)(function(){if(!d){if(l===-1&&f.current)f.current.focus();else{var e;(e=p.current.get(l))==null||e.focus()}}},[l]),wP({props:t,state:s});var m=EP(`getDropdownProps`),h=(0,G.useMemo)(function(){var e={};return e[a]=function(){c({type:XF})},e[i]=function(){c({type:YF})},e.Delete=function(){c({type:qF})},e.Backspace=function(){c({type:JF})},e},[c,i,a]),g=(0,G.useMemo)(function(){var e={};return e[a]=function(e){HF(e)&&c({type:ZF})},e.Backspace=function(e){HF(e)&&c({type:QF})},e},[c,a]);return{getSelectedItemProps:(0,G.useCallback)(function(e){var t,n=e===void 0?{}:e,r=n.refKey,i=r===void 0?`ref`:r,a=n.ref,o=n.onClick,s=n.onKeyDown,d=n.selectedItem,f=n.index,m=xN(n,sI),g=aP(d,f,u,`Pass either item or index to getSelectedItemProps!`)[1],_=g>-1&&g===l;return SN((t={},t[i]=RN(a,function(e){e?p.current.set(g,e):p.current.delete(g)}),t.tabIndex=_?0:-1,t.onClick=zN(o,function(){c({type:KF,index:g})}),t.onKeyDown=zN(s,function(e){var t=YN(e);t&&h[t]&&h[t](e)}),t),m)},[c,u,l,h]),getDropdownProps:(0,G.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.refKey,a=i===void 0?`ref`:i,o=r.ref,s=r.onKeyDown,l=r.onClick,u=r.preventKeyAction,d=u!==void 0&&u,p=xN(r,cI),h=(t===void 0?{}:t).suppressRefError;return m(`getDropdownProps`,h!==void 0&&h,a,f),SN((n={},n[a]=RN(o,function(e){e&&(f.current=e)}),n),!d&&{onKeyDown:zN(s,function(e){var t=YN(e);t&&g[t]&&g[t](e)}),onClick:zN(l,function(){c({type:$F})})},p)},[c,g,m]),addSelectedItem:(0,G.useCallback)(function(e){c({type:eI,selectedItem:e})},[c]),removeSelectedItem:(0,G.useCallback)(function(e){c({type:tI,selectedItem:e})},[c]),setSelectedItems:(0,G.useCallback)(function(e){c({type:nI,selectedItems:e})},[c]),setActiveIndex:(0,G.useCallback)(function(e){c({type:rI,activeIndex:e})},[c]),reset:(0,G.useCallback)(function(){c({type:iI})},[c]),selectedItems:u,activeIndex:l}}var uI=0,dI=1,fI=2,pI=3,mI=4,hI=5,gI=6,_I=Object.freeze({__proto__:null,FunctionAddItem:gI,TagClick:uI,TagGroupKeyDownArrowLeft:dI,TagGroupKeyDownArrowRight:fI,TagGroupKeyDownBackspace:mI,TagGroupKeyDownDelete:pI,TagRemoveClick:hI});function vI(e,t){var n=t.type,r;switch(n){case uI:r={activeIndex:t.index};break;case dI:r={activeIndex:e.activeIndex===0?e.items.length-1:e.activeIndex-1};break;case fI:r={activeIndex:e.activeIndex===e.items.length-1?0:e.activeIndex+1};break;case mI:case pI:var i=[].concat(e.items.slice(0,e.activeIndex),e.items.slice(e.activeIndex+1)),a=i.length===0?-1:i.length===e.activeIndex?e.activeIndex-1:e.activeIndex;r={items:[].concat(e.items.slice(0,e.activeIndex),e.items.slice(e.activeIndex+1)),activeIndex:a};break;case hI:var o=[].concat(e.items.slice(0,t.index),e.items.slice(t.index+1));r={items:o,activeIndex:o.length===0?-1:o.length===t.index?t.index-1:t.index};break;case gI:var s=[];s=t.index===void 0?[].concat(e.items,[t.item]):[].concat(e.items.slice(0,t.index),[t.item],e.items.slice(t.index));var c=e.activeIndex===-1?s.length-1:e.activeIndex;r={items:s,activeIndex:c};break;default:throw Error(`Invalid useTagGroup reducer action.`)}return SN({},e,r)}var yI=SN({},G).useId,bI=typeof yI==`function`?xI:SI;function xI(e){var t=e.id,n=e.tagGroupId,r=e.getTagId,i=`downshift-`+yI();return t||=i,G.useMemo(function(){return{tagGroupId:n??t+`-tag-group`,getTagId:r??function(e){return t+`-tag-`+e}}},[r,t,n])}function SI(e){var t=e.id,n=e.getTagId,r=e.tagGroupId,i=G.useState(function(){return t??`downshift-`+FN()})[0];return G.useMemo(function(){return{tagGroupId:r??i+`-tag-group`,getTagId:n??function(e){return i+`-tag-`+e}}},[n,i,r])}function CI(e){var t=e.items??e.initialItems??[];return{activeIndex:e.activeIndex??e.initialActiveIndex??(t.length===0?-1:0),items:t}}function wI(e,t){return e.activeIndex===t.activeIndex&&e.items===t.items}var TI=`tag-group-a11y-description`;function EI(e,t){G.useEffect(function(){if(e){var n=e.createElement(`div`);return n.setAttribute(`id`,TI),n.style.display=`none`,n.textContent=t,e.body.appendChild(n),function(){n.remove()}}},[t,e])}function DI(e){return SN({stateReducer:function(e,t){return t.changes},environment:typeof window>`u`?void 0:window,removeElementDescription:`Press Delete or Backspace to remove tag.`},e)}function OI(e,t,n){var r=G.useRef({}),i=G.useRef(e),a=G.useRef(t);return G.useEffect(function(){if(e!==-1&&i.current!==-1&&e!==i.current||a.current===t+1){var o;(o=r.current[n(e)])==null||o.focus()}i.current=e,a.current=t},[e,n,t]),r}var kI={isItemDisabled:$.default.func},AI=[`onKeyDown`],jI=[`index`,`refKey`,`ref`,`onClick`],MI=[`index`,`onClick`],NI=function(e){e===void 0&&(e={}),KN(e,NI,kI);var t=DI(e),n=iP(vI,t,CI,wI),r=n[0],i=n[1],a=r.activeIndex,o=r.items,s=bI({getTagId:t.getTagId,id:t.id,tagGroupId:t.tagGroupId});EI(t.environment?.document,t.removeElementDescription);var c=OI(a,o.length,s.getTagId),l=(0,G.useCallback)(function(e){var t=e??{},n=t.onKeyDown,r=xN(t,AI);return SN({id:s.tagGroupId,"aria-live":`polite`,"aria-atomic":`false`,"aria-relevant":`additions`,role:`listbox`,onKeyDown:zN(n,function(e){switch(e.key){case`ArrowLeft`:i({type:dI});break;case`ArrowRight`:i({type:fI});break;case`Delete`:i({type:pI});break;case`Backspace`:i({type:mI})}})},r)},[i,s.tagGroupId]),u=(0,G.useCallback)(function(e){var t,n=e.index,r=e.refKey,o=r===void 0?`ref`:r,l=e.ref,u=e.onClick,d=xN(e,jI);if(!Number.isInteger(n)||n<0)throw Error(`Pass correct item index to getTagProps!`);var f=function(){i({type:uI,index:n})},p=s.getTagId(n);return SN((t={"aria-describedby":TI},t[o]=RN(l,function(e){e&&(c.current[p]=e)}),t[`aria-labelledby`]=p,t.role=`option`,t.id=p,t.onClick=zN(u,f),t.tabIndex=a===n?0:-1,t),d)},[i,s,a,c]),d=(0,G.useCallback)(function(e){var t=e.index,n=e.onClick,r=xN(e,MI);if(!Number.isInteger(t)||t<0)throw Error(`Pass correct item index to getTagRemoveProps!`);var a=function(e){e.stopPropagation(),i({type:hI,index:t})},o=s.getTagId(t),c=o+`-remove`;return SN({id:c,tabIndex:-1,"aria-labelledby":c+` `+o,onClick:zN(n,a)},r)},[s,i]);return{activeIndex:a,addItem:(0,G.useCallback)(function(e,t){i({type:gI,item:e,index:t})},[i]),getTagGroupProps:l,getTagProps:u,getTagRemoveProps:d,items:o}};NI.stateChangeTypes=_I;function PI({items:e,selectedItems:t,onInputChange:n,onSelectedItemsChange:r,fieldLabel:i,placeholder:a,icon:o,disabled:s,shadowRoot:c,dataTestId:l}){let[u,d]=(0,G.useState)(``),f=(0,G.useId)(),p=(0,G.useId)(),m=(0,G.useId)(),h=(0,G.useId)(),g=(0,G.useId)(),_=(0,G.useMemo)(()=>e.filter(e=>e.type===`airport`||e.type===`place`).reduce((e,t)=>{if(t.type===`airport`){let n=t,r=u.toLowerCase();if(n.iata_code.toLowerCase()===r||n.iata_display_list?.some(e=>e.toLowerCase()===r))return t.sectionIndex>=0?[...e,t]:[{...t,sectionIndex:-1},...e]}return[...e,t]},[]).reduce((e,t)=>t.type===`airport`?{items:[...e.items,t],airportCount:e.airportCount+1}:t.type===`place`?e.airportCount<20?{...e,items:[...e.items,t]}:e:e.airportCount<=20?{...e,items:[...e.items,t]}:e,{items:[],airportCount:0}).items,[u,e]);function v(e){return e.kayak?.stateCode&&e.kayak?.countryCode?`${e.name}, ${e.kayak.stateCode}, ${e.kayak.countryCode}`:e.kayak?.countryCode&&!e.kayak?.stateCode?`${e.name}, ${e.kayak.countryCode}`:e.formatted_address}function y(e){return e.state_code?`${e.city}, ${e.state_code}, ${e.country_code}`:e.location_display?e.location_display:`${e.city}, ${e.country_code}`}function b(e){return e.iata_display_list&&e.iata_display_list.length>0?e.iata_display_list.join(`, `):e.iata_code}function x(e){if(e.type===`airport`){let n=e;return t?.length>1?b(n):n.country_code===`US`?`${n.city} (${b(n)})`:`${n.city}, ${n.country_code} (${b(n)})`}if(e.type===`place`){let t=e;return t.formatted_address?.length<20?t.formatted_address:t.name}return``}let S=typeof Proxy==`function`&&!Object.isSealed(new Proxy({},{}));function C(e){let t=e.ownerDocument,n={document:t,addEventListener:t.addEventListener.bind(e),removeEventListener:t.removeEventListener.bind(e),Node:window.Node,Element:window.Element,HTMLElement:window.HTMLElement,SVGElement:window.SVGElement};return S?new Proxy(n,{get(e,t){return e[t]}}):n}let{getSelectedItemProps:w,getDropdownProps:T,removeSelectedItem:E}=lI({selectedItems:t,onStateChange({selectedItems:e,type:t}){t===lI.stateChangeTypes.FunctionRemoveSelectedItem&&r(e)}}),{isOpen:D,getMenuProps:O,getInputProps:k,getItemProps:A,highlightedIndex:j,setHighlightedIndex:M}=zF({environment:c?C(c):void 0,items:_,isItemDisabled(e){return!!e?.disabled},itemToKey(e){return e?.key??``},itemToString(e){return e?e.type===`airport`?x(e):e.name??``:``},defaultHighlightedIndex:0,selectedItem:null,inputValue:u,onInputValueChange({inputValue:e}){let t=e??``;d(t),n(t)},stateReducer(e,t){let{changes:n,type:r}=t;switch(r){case zF.stateChangeTypes.InputKeyDownEnter:case zF.stateChangeTypes.ItemClick:return n;case zF.stateChangeTypes.InputKeyDownArrowDown:case zF.stateChangeTypes.InputKeyDownArrowUp:return n;case zF.stateChangeTypes.InputBlur:return n;case zF.stateChangeTypes.FunctionCloseMenu:return{...n,isOpen:!0};case zF.stateChangeTypes.InputKeyDownEscape:return n;case zF.stateChangeTypes.ItemMouseMove:return e;default:return n}},onStateChange({type:e,selectedItem:t}){switch(e){case zF.stateChangeTypes.InputKeyDownEnter:case zF.stateChangeTypes.ItemClick:t&&(r([t]),d(``))}}}),N=(0,G.useMemo)(()=>{if(s)return`Field is locked.`;if(D&&_.length>0){let e=_.length;return`Suggestion list open, ${e} ${e===1?`option`:`options`}.`}return D&&_.length===0?u.trim()?`Suggestion list open, no matching options.`:`Suggestion list open, no options yet.`:`Suggestion list closed.`},[s,D,_.length,u]),P=(0,G.useMemo)(()=>`Type to search airports and places. When the list is open, use arrow keys to move through suggestions and Enter to choose. Tab to selected locations above to remove them, or press Backspace in this field when it is empty.`,[]),ee=i?`${i}, search airports and places`:`Search airports and places`,F=i?`${i} suggestions`:`Search results`,te=t.length===0?`No airport or place selected.`:(()=>{let e=t.map(e=>x(e));return`Selected ${t.length===1?`location`:`${t.length} locations`}: ${e.join(`, `)}.`})(),ne=[m,h,g].join(` `);(0,G.useEffect)(()=>{s&&queueMicrotask(()=>d(``))},[s]);let I=!!s;function re(){let e=k({...T(),id:p,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":D,"aria-controls":D?f:void 0,"aria-activedescendant":D&&j!=null&&j>-1?`${f}-${j}`:void 0,"aria-label":ee,onKeyDown:e=>{if(e.key===`Backspace`&&!u&&t.length>0&&!s){let e=t[t.length-1];E(e)}}});return(0,K.jsx)(`input`,{className:(0,q.default)(`aone:outline-none aone:disabled:bg-transparent aone:text-base aone:placeholder:text-gray-500`,{"aone:min-w-[120px] aone:max-w-[200px]":t.length>0,"aone:w-full":t.length===0}),placeholder:!I&&t.length===0?a:``,...e,value:e.value??``,"aria-describedby":ne,disabled:I})}return(0,K.jsxs)(`div`,{className:`aone:w-full aone:h-full aone:relative aone:z-10`,"data-testid":l,role:`group`,"aria-disabled":s?!0:void 0,children:[(0,K.jsxs)(`div`,{className:(0,q.default)({"aone:bg-white aone:rounded-lg aone:gap-2 aone:items-center aone:py-2 aone:px-3 aone:h-[44px] aone:box-border aone:w-full aone:overflow-hidden":!0,"aone:grid":!0,"aone:grid-cols-[24px_1fr]":t.length===0,"aone:grid-cols-[24px_auto_1fr]":t.length===1,"aone:grid-cols-[24px_auto_auto_1fr]":t.length===2,"aone:grid-cols-[24px_auto_auto_auto_1fr]":t.length===3,"aone:border-2 aone:border-gray-200 aone:focus-within:border-primary":!0,"aone:opacity-60 aone:cursor-not-allowed":!!s}),children:[o,t.map((e,n)=>(0,K.jsxs)(`span`,{...w({selectedItem:e,index:n}),"aria-label":`Selected location: ${x(e)}. Item ${n+1} of ${t.length}.`,className:(0,q.default)({"aone:bg-gray-200 aone:rounded aone:px-1 aone:focus:bg-gray-400 aone:whitespace-nowrap aone:text-ellipsis aone:shrink-0":!0,"aone:text-sm":t.length>0,"aone:flex aone:items-center":!0}),children:[(0,K.jsx)(`span`,{className:`aone:overflow-hidden aone:grow aone:font-medium`,children:x(e)}),!e.disabled&&(0,K.jsx)(`button`,{type:`button`,disabled:!!s||!!e.disabled,className:(0,q.default)(`aone:ml-2 aone:text-base aone:leading-[20px] aone:rounded aone:px-1 aone:transition-colors`,{"aone:hover:bg-gray-300 aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-offset-2 aone:focus-visible:ring-gray-400":!s&&!e.disabled,"aone:cursor-not-allowed aone:opacity-60":!!s}),"data-testid":`autocomplete-remove-item-button`,"aria-label":`Remove ${x(e)}`,onClick:t=>{t.stopPropagation(),!s&&E(e)},children:`×`})]},n)),(0,K.jsx)(`span`,{id:m,className:`aone:sr-only`,children:te}),(0,K.jsx)(`span`,{id:h,className:`aone:sr-only`,children:N}),(0,K.jsx)(`span`,{id:g,className:`aone:sr-only`,children:P}),re()]}),(0,K.jsx)(`div`,{className:(0,q.default)(`aone:absolute aone:z-10 aone:mt-2 aone:w-inherit aone:rounded-lg aone:bg-white aone:p-0 aone:shadow-md aone:overflow-hidden`,!(D&&_.length>0)&&`aone:hidden`),children:(0,K.jsx)(`ul`,{...O(),id:f,role:`listbox`,"aria-multiselectable":`true`,"aria-label":F,tabIndex:-1,className:`aone:overflow-y-auto aone:overflow-x-hidden aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2`,children:D&&_.length>0&&_.map((e,n)=>{if(e.type===`airport`){let r=e,i=(r.distance||0)*.621371,a=j===n,o=e.sectionIndex>-1&&!r.kayak_shimmed,s=!!t.find(t=>t.key===e.key),c=n+1;return(0,K.jsxs)(`li`,{...A({item:e,index:n,onMouseEnter:()=>M(n)}),id:`${f}-${n}`,role:`option`,tabIndex:-1,"aria-selected":s,"aria-label":`Option ${c} - ${r.name}, ${y(r)}, ${b(r)}${o?`, ${i.toFixed(+(i<1))} miles away`:``}, ${s?`selected`:`not selected`}`,className:(0,q.default)({"aone:hover:bg-blue-100":!0,"aone:bg-blue-100":a,"aone:font-bold":a,"aone:shadow-sm aone:py-2 aone:px-2 aone:cursor-pointer":!0,"aone:pl-5 aone:border-l-4 aone:border-gray-500":e.sectionIndex>-1,"aone:grid aone:grid-cols-[26px_1fr_30px] aone:gap-1 aone:justify-start aone:items-center":!0,"aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2":!0}),children:[(0,K.jsx)(iN,{className:`aone:w-6 aone:h-6 aone:-rotate-45`,icon:XE}),(0,K.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,K.jsxs)(`div`,{className:`aone:gap-2 aone:flex aone:items-center aone:w-full`,children:[(0,K.jsx)(`span`,{className:`aone:flex-1 aone:min-w-0 aone:font-medium aone:text-base aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:r.name}),(0,K.jsx)(`span`,{className:`aone:text-sm aone:uppercase aone:shrink-0 aone:text-gray-500`,children:b(r)})]}),(0,K.jsxs)(`span`,{className:`aone:text-sm aone:text-gray-500`,children:[y(r),o&&(0,K.jsxs)(K.Fragment,{children:[`\xA0•\xA0`,i.toFixed(+(i<1)),`mi`]})]})]}),(0,K.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-1`,"aria-hidden":`true`,children:(0,K.jsx)(`span`,{className:(0,q.default)(`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border`,{"aone:border-gray-400 aone:bg-white":!s,"aone:border-primary aone:bg-primary":s})})})]},`${e.key}-${n}`)}if(e.type===`place`){let r=e,i=j===n,a=_p(r.kayak?.apicode),o=v(r),s=!!t.find(t=>t.key===e.key);return(0,K.jsxs)(`li`,{...A({item:e,index:n,onMouseEnter:()=>M(n)}),id:`${f}-${n}`,role:`option`,tabIndex:-1,"aria-selected":s,"aria-label":`${a?`${r.name}, ${a}, ${o}`:`${r.name}, ${o}`}, ${s?`selected`:`not selected`}`,className:(0,q.default)({"aone:hover:bg-blue-100":!0,"aone:bg-blue-100":i,"aone:font-bold":i,"aone:shadow-sm aone:py-2 aone:px-2 aone:cursor-pointer":!0,"aone:grid aone:grid-cols-[26px_1fr_30px] aone:gap-1 aone:justify-start aone:items-center":!0,"aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2":!0}),children:[(0,K.jsx)(iN,{className:`aone:w-6 aone:h-6`,icon:rD}),(0,K.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,K.jsxs)(`div`,{className:`aone:gap-2 aone:flex aone:items-end aone:w-full`,children:[(0,K.jsx)(`span`,{className:`aone:flex-1 aone:min-w-0 aone:font-medium aone:text-base aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:r.name}),a&&(0,K.jsx)(`span`,{className:`aone:text-sm aone:uppercase aone:shrink-0 aone:text-gray-500`,children:a})]}),(0,K.jsx)(`span`,{className:`aone:text-sm aone:shrink-0 aone:text-gray-500`,children:o})]}),(0,K.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-1`,"aria-hidden":`true`,children:(0,K.jsx)(`span`,{className:(0,q.default)(`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border`,{"aone:border-gray-400 aone:bg-white":!s,"aone:border-primary aone:bg-primary":s})})})]},`${e.key}-${n}`)}return null})})})]})}function FI({hideByDefault:e=!0}){return(0,K.jsx)(`div`,{className:(0,q.default)({"aone:pb-0.5 aone:flex-col aone:items-center aone:@2xl:items-end aone:@2xl:w-[175px]":!0,"aone:hidden aone:@2xl:flex":e,flex:!e}),children:(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`aone:text-center aone:text-[12px] aone:text-black aone:dark:text-white`,children:`Powered by`}),(0,K.jsx)(`div`,{className:`aone:flex aone:justify-center aone:max-w-[95px]`,children:(0,K.jsx)(`img`,{src:`https://content.r9cdn.net/res/images/horizon/common/promo/powered-kayak-logo.png?v=5845dc09c6b1c19380844fe6157a3b640856624b&cluster=4`,alt:`Kayak`,width:95,height:21})})]})})}var II=s(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),LI=s(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),RI=s(((e,t)=>{var n=LI(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),zI=s(((e,t)=>{var n=RI();t.exports=function(){return n.Date.now()}})),BI=s(((e,t)=>{var n=/\s/;function r(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}t.exports=r})),VI=s(((e,t)=>{var n=BI(),r=/^\s+/;function i(e){return e&&e.slice(0,n(e)+1).replace(r,``)}t.exports=i})),HI=s(((e,t)=>{t.exports=RI().Symbol})),UI=s(((e,t)=>{var n=HI(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),WI=s(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),GI=s(((e,t)=>{var n=HI(),r=UI(),i=WI(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),KI=s(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),qI=s(((e,t)=>{var n=GI(),r=KI(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),JI=s(((e,t)=>{var n=VI(),r=II(),i=qI(),a=NaN,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function u(e){if(typeof e==`number`)return e;if(i(e))return a;if(r(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=r(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=n(e);var u=s.test(e);return u||c.test(e)?l(e.slice(2),u?2:8):o.test(e)?a:+e}t.exports=u})),YI=l(s(((e,t)=>{var n=II(),r=zI(),i=JI(),a=`Expected a function`,o=Math.max,s=Math.min;function c(e,t,c){var l,u,d,f,p,m,h=0,g=!1,_=!1,v=!0;if(typeof e!=`function`)throw TypeError(a);t=i(t)||0,n(c)&&(g=!!c.leading,_=`maxWait`in c,d=_?o(i(c.maxWait)||0,t):d,v=`trailing`in c?!!c.trailing:v);function y(t){var n=l,r=u;return l=u=void 0,h=t,f=e.apply(r,n),f}function b(e){return h=e,p=setTimeout(C,t),g?y(e):f}function x(e){var n=e-m,r=e-h,i=t-n;return _?s(i,d-r):i}function S(e){var n=e-m,r=e-h;return m===void 0||n>=t||n<0||_&&r>=d}function C(){var e=r();if(S(e))return w(e);p=setTimeout(C,x(e))}function w(e){return p=void 0,v&&l?y(e):(l=u=void 0,f)}function T(){p!==void 0&&clearTimeout(p),h=0,l=m=u=p=void 0}function E(){return p===void 0?f:w(r())}function D(){var e=r(),n=S(e);if(l=arguments,u=this,m=e,n){if(p===void 0)return b(m);if(_)return clearTimeout(p),p=setTimeout(C,t),y(m)}return p===void 0&&(p=setTimeout(C,t)),f}return D.cancel=T,D.flush=E,D}t.exports=c}))(),1);function XI(e,t,n,r){return n?`${n}/v1/${e}?${r}`:`${t}/api/${e}?${r}`}async function ZI({departureAirport:e,apiDomain:t,suggestApiBaseUrl:n,sessionId:r,clickId:i}){let a=new URLSearchParams({departureAirportIATA:e}).toString(),o={};r&&(o[d_]=r),i&&(o[f_]=i);let s=await fetch(XI(`iata-auto-complete`,t,n,a),{headers:o});if(!s.ok)throw console.error(`Unable to fetch airport suggestions`,{departureAirport:e,apiDomain:t,status:s.status,statusText:s.statusText}),Error(`Unable to fetch airport suggestions`);let c=await s.json();return Id.parse(c)}async function QI(e,t,n,r,i,a){if(!t)return[];let o=await ZI({query:e,departureAirport:t,apiDomain:n,suggestApiBaseUrl:a,sessionId:r,clickId:i});return o.success?o.data.map(e=>({itemType:W.AIRPORT,iata_code:e.airportIata,city:e.city,state:e.state,country:e.country,stops:e.stops||0,airlineCodes:e.airlineCodes||[],name:e.city+` (`+e.airportIata+`)`,type:`airport`,lat:0,lng:0,country_code:e.country||``,geometry:{location:{lat:0,lng:0}},formatted_address:``,cid:e.airportIata,types:[`airport`],nearbyAirports:[{name:e.airportIata+` (`+e.city+`)`,iata_code:e.airportIata,city:e.city,country_code:e.country,stops:e.stops||0,airlineCodes:e.airlineCodes||[],routeStart:e.routeStart,lat:0,lng:0}]})).map(e=>{let t={...e,airlineCodes:e.airlineCodes?.map(e=>e===`DWI`?`DW`:e)};return t.nearbyAirports=e.nearbyAirports.map(e=>({...e,airlineCodes:e.airlineCodes?.map(e=>e===`DWI`?`DW`:e)})),t}).sort((e,t)=>!e.city||!t.city?0:e.city.localeCompare(t.city)):[]}async function $I({query:e,departureAirport:t,marketingCarrierCodeIATA:n,apiDomain:r,suggestApiBaseUrl:i,sessionId:a,clickId:o}){let s=new URLSearchParams({query:e,departureAirportIATA:t,marketingCarrierCodeIATA:n}).toString(),c={};a&&(c[d_]=a),o&&(c[f_]=o);let l=await fetch(XI(`iata-directs`,r,i,s),{headers:c});if(!l.ok)throw console.error(`Unable to fetch airport suggestions`,{departureAirport:t,apiDomain:r,status:l.status,statusText:l.statusText}),Error(`Unable to fetch airport suggestions`);let u=await l.json();return Rc.parse(u)}async function eL(e,t,n,r,i,a,o){if(!t)return[];let s=await $I({query:e,departureAirport:t,marketingCarrierCodeIATA:n,apiDomain:r,suggestApiBaseUrl:o,sessionId:i,clickId:a});return s.success?s.data.map(e=>({itemType:W.AIRPORT,iata_code:e.airportIata,city:e.city,lat:0,lng:0,country_code:e.country,name:e.airportIata+` (`+e.city+`)`,geometry:{location:{lat:0,lng:0}},formatted_address:``,cid:e.airportIata,types:[`airport`],nearbyAirports:[{name:e.airportIata+` (`+e.city+`)`,iata_code:e.airportIata,city:e.city,country_code:e.country,lat:0,lng:0}]})):[]}function tL(e){return Math.PI/180*e}function nL(e){return e*.621371}function rL(e,t,n,r){let i=tL(n-e),a=tL(r-t),o=Math.sin(i/2)*Math.sin(i/2)+Math.cos(tL(e))*Math.cos(tL(n))*Math.sin(a/2)*Math.sin(a/2);return 6371*(2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)))}function iL(e,t){if(!Array.isArray(e.types)||!e.types.includes(`place`)||e.itemType!==W.METRO)return!1;let n=gp(e.kayak?.apicode);if(n.length>0&&n.includes(t.id.toUpperCase()))return!0;let r=e.kayak?.ctid;if(r!==void 0&&r===t.ctid)return!0;let i=e.kayak?.metroId?.toUpperCase(),a=t.cityCode?.toUpperCase();return!!(t.sub===!0&&i&&a===i)}function aL(e){let t=new Set;for(let n=0;n<e.length;n++){let r=e[n];if(!r||!Array.isArray(r.types)||!r.types.includes(`airport`))continue;let i=r.kayakAirport;if(!i)continue;let a=e.findIndex(e=>iL(e,i));if(a<0)continue;let o=e[a],s=r.nearbyAirports[0];if(s){if(!o.nearbyAirports.some(e=>e.iata_code.toUpperCase()===s.iata_code.toUpperCase())){let{lat:e,lng:t}=o.geometry.location;s.distance=nL(rL(e,t,s.lat,s.lng)),o.nearbyAirports.push(s)}t.add(n)}}return e.filter((e,n)=>!t.has(n))}function oL(e){if(!Array.isArray(e.types)||!e.types.includes(`place`))return;let t=e.kayak?.apicode;if(!t?.trim())return;let n=gp(t);if(n.length===0)return;let r=n.length>1,{lat:i,lng:a}=e.geometry.location,o=e.name,s=e.kayak?.stateCode,c=e.kayak?.countryCode;if(!c)return;let l=e.kayak?.metroId??``,u=t=>e.nearbyAirports.find(e=>e.iata_code.toUpperCase()===t.toUpperCase()),d=[],f=new Set;l.toUpperCase();for(let t of n){t.toUpperCase();let n=u(t);n?(d.push(n),f.add(t)):r&&(d.push({iata_code:t,city:o,lat:i,lng:a,country_code:c,name:`${o} (${t})`,state_code:s,location_display:s?void 0:e.formatted_address,kayak_shimmed:!0}),f.add(t))}for(let t of e.nearbyAirports){let e=t.iata_code.toUpperCase();f.has(e)||d.push(t)}let p=d.filter(e=>e.kayak_shimmed),m=d.filter(e=>!e.kayak_shimmed);m.sort((e,t)=>{let n=e.distance??1/0,r=t.distance??1/0;return n===r?e.iata_code.localeCompare(t.iata_code):n-r}),e.nearbyAirports=[...p,...m]}async function sL({query:e,searchType:t}){let n=await fetch(`https://www.kayak.com/mv/marvel?f=j&s=${t}&v=v1&where=${e}&lc=en&lc_cc=US`);if(!n.ok)throw Error(`Unable to get kayak suggestions`);return await n.json()}async function cL(e,t=vp.Hotels){if(!e?.length||e.length<3)return[];let n=aL((await sL({query:e,searchType:t})).reduce((e,t)=>{if(t.isMetroOnly){let n=t.rc?.trim();e.push({nearbyAirports:[],itemType:W.METRO,iata_code:t.displayType.type===`country`?void 0:t.id,formatted_address:t.cityname,geometry:{location:{lat:t.lat,lng:t.lng}},name:t.cityonly,cid:t.cid,kayak:{ctid:t.ctid,apicode:t.apicode,stateCode:n||void 0,countryCode:t.cc,metroId:t.id,metroAirportName:t.airportname},types:[`place`]})}else if(t.displayType.type===`country`)e.push({nearbyAirports:[],itemType:W.AIRPORT,formatted_address:t.displayname,geometry:{location:{lat:t.lat,lng:t.lng}},name:t.displayname,cid:t.cid,types:[`place`]});else if(t.displayType.type===`state`)e.push({nearbyAirports:[],itemType:W.AIRPORT,formatted_address:t.displayname,geometry:{location:{lat:t.lat,lng:t.lng}},name:t.displayname,cid:t.cid,types:[`place`]});else if(t.displayType.type===`airport`){let n=e.findIndex(e=>iL(e,t)),r=t.rc?.trim(),i={iata_code:t.id,city:t.cityonly,lat:t.lat,lng:t.lng,country_code:t.cc,name:t.displayname,state_code:r||void 0,location_display:r?void 0:t.cityname};if(n>-1){let{lat:r,lng:a}=e[n].geometry.location;i.distance=nL(rL(r,a,t.lat,t.lng)),e[n].nearbyAirports.push(i)}else e.push({nearbyAirports:[i],itemType:W.AIRPORT,formatted_address:t.cityname,geometry:{location:{lat:t.lat,lng:t.lng}},name:t.name,rid:t.rid,kayakAirport:{id:t.id,ctid:t.ctid,sub:t.sub,cityCode:t.cityCode},types:[`airport`]})}return e},[]));for(let e of n)oL(e);return n}function lL({key:e,apiDomain:t,suggestApiBaseUrl:n,airportIATA:r,providersArr:i,airlinesArr:a,debounceTime:o=500,autocompleteType:s=`kayak`}){let{sessionId:c}=a_(),{clickId:l}=fh(),[u,d]=(0,G.useState)(``),f=(0,G.useMemo)(()=>(0,YI.default)(d,o),[o]),{data:p,status:m}=Zg({queryKey:[e,r,i,a,u,s,n??`fma-app`,c].flat(),queryFn:()=>s===xp.schedule_data&&r?.length&&r?.length===3?QI(u,r,t,c,l,n):r?.length&&r?.length===3&&(i?.length||0)>0&&(a?.length||0)>0&&i?.every(e=>e===`G4`)&&a?.every(e=>e===`G4`)?eL(u,r,a[0],t,c,l,n):cL(u),enabled:!!c});return{data:p,status:m,setQuery:f}}function uL(){return(0,K.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,"aria-hidden":`true`,className:`aone:w-6 aone:h-6`,children:(0,K.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z`})})}function dL({value:e,onChange:t}){return(0,K.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:gap-2`,children:[(0,K.jsx)(`label`,{className:`aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Pick-up / Drop-off location`}),(0,K.jsxs)(`div`,{className:`aone:flex aone:items-center aone:gap-3`,children:[(0,K.jsx)(`span`,{className:`aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Same`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>t(e===`same-location`?`different-location`:`same-location`),className:`aone:relative aone:inline-flex aone:h-6 aone:w-11 aone:shrink-0 aone:cursor-pointer aone:items-center aone:rounded-full aone:border-2 aone:border-transparent aone:transition-colors aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-blue-500 aone:focus-visible:ring-offset-2 ${e===`different-location`?`aone:bg-blue-600 aone:dark:bg-blue-500`:`aone:bg-gray-200 aone:dark:bg-gray-600`}`,"aria-label":`Toggle to ${e===`same-location`?`different location`:`same location`}`,children:(0,K.jsx)(`span`,{className:`aone:pointer-events-none aone:block aone:h-5 aone:w-5 aone:rounded-full aone:bg-white aone:shadow-lg aone:ring-0 aone:transition-transform ${e===`different-location`?`aone:translate-x-5`:`aone:translate-x-0`}`})}),(0,K.jsx)(`span`,{className:`aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Different`})]})]})}function fL({shadowRoot:e,origin:t,theme:n}){let{apiDomain:r}=c_(),[i,a]=(0,G.useState)(`same-location`),[o,s]=(0,G.useState)(t.toUpperCase()),[c,l]=(0,G.useState)(t.toUpperCase()),[u,d]=(0,G.useState)(``),[f,p]=(0,G.useState)(`12:00`),[m,h]=(0,G.useState)(``),[g,_]=(0,G.useState)(`12:00`),v=(0,G.useMemo)(()=>u&&f?`${u}T${f}`:``,[u,f]),y=(0,G.useMemo)(()=>m&&g?`${m}T${g}`:``,[m,g]),b=i===`same-location`?o:c,{data:x,status:S,setQuery:C}=lL({key:`carfare-from-suggest`,apiDomain:r,airportIATA:b}),{data:w,status:T,setQuery:E}=lL({key:`carfare-to-suggest`,apiDomain:r,airportIATA:o}),[D,O]=(0,G.useState)([]),[k,A]=(0,G.useState)([]),[j,M]=(0,G.useState)(!1);(0,G.useEffect)(()=>{t&&t.length===3&&!j&&C(t)},[t,C,j]),(0,G.useEffect)(()=>{if(x&&x.length>0&&!D.length&&!j){let e=x.filter(e=>e.nearbyAirports?.length).flatMap(e=>e.nearbyAirports).find(e=>e.iata_code?.toUpperCase()===t.toUpperCase());if(e){let t={...e,sectionIndex:0,type:`airport`,key:e.iata_code},n=e.iata_code??``;queueMicrotask(()=>{O([t]),s(n),M(!0)})}}},[x,t,D.length,j]);let N=(0,G.useMemo)(()=>x?x.filter(e=>e.nearbyAirports?.length).map(e=>{let t=e.types.includes(`airport`);return[{...e,sectionIndex:0,type:t?`airport-place`:`place`,key:e.formatted_address},...e.nearbyAirports.map((e,n)=>({...e,sectionIndex:t?-1:n,type:`airport`,key:`${e.iata_code}`}))]}).flat().filter((e,t,n)=>{if(e.type===`place`){let e=n.at(t+1);if(!e||e.type!==`airport`)return!1}return!0}):[],[x]),P=(0,G.useMemo)(()=>w?w.filter(e=>e.nearbyAirports?.length).map(e=>{let t=e.types.includes(`airport`);return[{...e,sectionIndex:0,type:t?`airport-place`:`place`,key:e.formatted_address},...e.nearbyAirports.map((e,n)=>({...e,sectionIndex:t?-1:n,type:`airport`,key:`${e.iata_code}`}))]}).flat().filter((e,t,n)=>{if(e.type===`place`){let e=n.at(t+1);if(!e||e.type!==`airport`)return!1}return!0}):[],[w]),ee=(0,G.useCallback)(()=>{let e=/^[A-Za-z]{3}$/,t=e.test(o),n=e.test(b);if(!t||!n||!v||!y)return;let r=new URLSearchParams({fromAirport:o.toUpperCase(),toAirport:b.toUpperCase(),tripOption:i,fromDateTime:v,toDateTime:y}),a=`https://flymyairport.com/from/${o.toUpperCase()}/cars?${r.toString()}`,s=document.createElement(`a`);s.href=a,s.target=`_blank`,s.rel=`noopener noreferrer`,s.click(),s.remove()},[o,b,i,v,y]),F=(0,G.useMemo)(()=>{let e=/^[A-Za-z]{3}$/;if(!e.test(o)||!e.test(b)||!v||!y)return!1;try{let e=new Date(v),t=new Date(y),n=new Date;return n.setHours(0,0,0,0),e.getTime()<=t.getTime()&&e.getTime()>=n.getTime()}catch{return!1}},[o,b,v,y]);return(0,K.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:gap-3`,part:`carfare-search-container`,"data-mode":n,children:[(0,K.jsxs)(`div`,{className:`aone:flex aone:items-center aone:justify-between aone:gap-2`,children:[(0,K.jsx)(dL,{value:i,onChange:a}),(0,K.jsx)(`div`,{className:`aone:ml-2`,children:(0,K.jsx)(FI,{hideByDefault:!1})})]}),(0,K.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:md:flex-row aone:md:flex-wrap aone:gap-2 aone:md:gap-4 aone:md:items-end`,children:[(0,K.jsxs)(`div`,{className:`aone:w-full aone:md:w-auto aone:md:flex-1 aone:md:min-w-[200px] aone:h-[72px]`,children:[(0,K.jsx)(`label`,{className:`aone:block aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Pick-up Location`}),(0,K.jsx)(`div`,{className:`aone:mt-1 aone:md:mt-2`,children:(0,K.jsx)(PI,{shadowRoot:e,dataTestId:`carfare-from-airport`,icon:S===`pending`?(0,K.jsx)(Th,{}):(0,K.jsx)(uL,{}),placeholder:`From?`,items:N,selectedItems:D,onInputChange:C,onSelectedItemsChange:e=>{if(!e||e.length===0){O([]),s(``);return}let t=e[0];t.type===`airport`&&(O(e),s(t.iata_code??``))}})})]}),i===`different-location`&&(0,K.jsxs)(`div`,{className:`aone:w-full aone:md:w-auto aone:md:flex-1 aone:md:min-w-[200px]`,children:[(0,K.jsx)(`label`,{className:`aone:block aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Drop-off Location`}),(0,K.jsx)(`div`,{className:`aone:mt-1 aone:md:mt-2`,children:(0,K.jsx)(PI,{shadowRoot:e,dataTestId:`carfare-to-airport`,icon:T===`pending`?(0,K.jsx)(Th,{}):(0,K.jsx)(uL,{}),placeholder:`To?`,items:P,selectedItems:k,onInputChange:E,onSelectedItemsChange:e=>{if(!e||e.length===0){A([]),l(``);return}let t=e[0];t.type===`airport`&&(A(e),l(t.iata_code??``))}})})]}),(0,K.jsx)(bN,{label:`Pick-up Date`,dateValue:u,timeValue:f,onDateChange:e=>{let t=e?e.toISOString().split(`T`)[0]??``:``;d(t),t&&h(e=>{if(e)return e;let n=new Date(t);return n.setDate(n.getDate()+1),n.toISOString().split(`T`)[0]??``})},onTimeChange:e=>p(e),origin:o,destination:b,minDate:new Date,shadowRoot:e}),(0,K.jsx)(bN,{label:`Drop-off Date`,dateValue:m,timeValue:g,onDateChange:e=>{let t=e?e.toISOString().split(`T`)[0]??``:``;h(t)},onTimeChange:e=>_(e),origin:o,destination:b,minDate:u?new Date(u):new Date,shadowRoot:e,referenceDates:(()=>{let e=[];if(u){let t=u.split(`-`);if(t.length===3){let n=t[0],r=t[1],i=t[2],a=parseInt(n,10),o=parseInt(r,10),s=parseInt(i,10);!Number.isNaN(a)&&!Number.isNaN(o)&&!Number.isNaN(s)&&e.push({date:new Date(a,o-1,s,12,0,0),label:`Pick-up`})}}if(m){let t=m.split(`-`);if(t.length===3){let n=t[0],r=t[1],i=t[2],a=parseInt(n,10),o=parseInt(r,10),s=parseInt(i,10);!Number.isNaN(a)&&!Number.isNaN(o)&&!Number.isNaN(s)&&e.push({date:new Date(a,o-1,s,12,0,0),label:`Drop-off`})}}return e.length?e:void 0})()}),(0,K.jsx)(`button`,{type:`button`,disabled:!F,onClick:ee,"aria-label":`Search for car rentals`,className:`aone:w-full aone:md:w-auto aone:px-6 aone:py-2 aone:bg-green-500 aone:dark:bg-green-600 aone:text-white aone:rounded-lg aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-green-700 aone:focus:ring-offset-2 aone:h-[44px] aone:text-base aone:font-medium aone:enabled:hover:bg-green-700 aone:enabled:active:bg-green-700 aone:disabled:bg-gray-400 aone:dark:disabled:bg-gray-600 aone:disabled:text-white/70 aone:disabled:cursor-not-allowed`,children:(0,K.jsxs)(`div`,{className:`aone:flex aone:items-center aone:justify-center aone:gap-2`,children:[(0,K.jsx)(uL,{}),(0,K.jsx)(`span`,{children:`Search`})]})})]})]})}var pL=new Ig;function mL({children:e,props:t}){return(0,K.jsx)(Oh,{client:pL,children:(0,K.jsx)(s_,{apiDomain:t.apiDomain,consentAnalytics:t.consentAnalytics,consentAdvertising:t.consentAdvertising,consentFunctional:t.consentFunctional,children:e})})}function hL(e){return!e.origin||e.origin.length!==3?(console.error(`Origin is not a valid IATA code, not rendering widget.`),null):(0,K.jsxs)(mL,{props:e,children:[(0,K.jsx)(`style`,{children:l_}),e.userStyleBlock?(0,K.jsx)(`style`,{children:e.userStyleBlock}):null,(0,K.jsx)($g,{componentName:`carfare search`,children:(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(Th,{}),children:(0,K.jsx)(fL,{shadowRoot:e.shadowRoot,origin:e.origin,theme:e.theme})})})]})}var gL=[`origin`,`primary-color`,`secondary-color`,`consent-analytics`,`consent-advertising`,`consent-functional`,`theme`,Pp,`id`],_L=class extends HTMLElement{_shadowRoot;_mountPoint;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;_mountTelemetrySent=!1;_lastPublicConfigTelemetryKey=null;static get observedAttributes(){return Array.from(gL)}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this._scheduleRender()}connectedCallback(){this.style.position=`relative`,this.style.zIndex=`10`,this.style.lineHeight=`1.5`,this.style.display=`flex`,this.style.flexDirection=`column`,this._scheduleRender()}disconnectedCallback(){this._reactRoot&&=(this._reactRoot.unmount(),void 0),this._mountTelemetrySent=!1,this._lastPublicConfigTelemetryKey=null}_scheduleRender(){this._renderScheduled||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&this._renderAsync()}))}async _renderAsync(){if(this._renderInProgress)this._renderQueued=!0;else{this._renderInProgress=!0;try{let e=cm(this),t=mm(),n=null,r=!1,i={attempted:!1,durationMs:0},a;if(e&&t){let t=await hm(e);i=t.metrics;let o=t.config;o?.widgetType&&o.widgetType!==`carfare-search`&&(console.warn(`[airport-one-widgets] Widget instance type does not match carfare-search:`,o.widgetType),a=`widget_type_mismatch`,o=null),n=o,r=!n,i.attempted&&n===null&&a===void 0&&i.failureKind&&(a=i.failureKind)}if(!this.isConnected)return;let o=xm(n),s=window[Ac],c=w_(this,`https://flymyairport.vercel.app`,s,o),l=!i.attempted&&(!t||!e)?t?`no_instance_id`:`no_api_base`:void 0;if(c.consentAnalytics){let r=i.attempted?`attempt:${t}|${e}|${n===null?`fail`:`ok`}|${a??``}`:`skip:${l??`none`}`;r!==this._lastPublicConfigTelemetryKey&&(this._lastPublicConfigTelemetryKey=r,Sh(!0,{widget_runtime:`carfare-search`,widget_instance_id:Np(e)??void 0,attempted:i.attempted,duration_ms:i.durationMs,ok:i.attempted?n!==null:!1,error_kind:i.attempted&&n===null?a:void 0,skip_reason:l}))}r&&console.warn(`${um}: carfare-search — managed instance config not applied; using host attributes and window defaults.`),this._paintCarfare(c),c.consentAnalytics&&!this._mountTelemetrySent&&(this._mountTelemetrySent=!0,Ch(!0,{widget_runtime:`carfare-search`,widget_instance_id:Np(e)??void 0,public_config_unavailable:r}))}finally{this._renderInProgress=!1,this._renderQueued&&(this._renderQueued=!1,queueMicrotask(()=>{this.isConnected&&this._renderAsync()}))}}}_paintCarfare(e){let t=this._shadowRoot??=this.attachShadow({mode:`closed`}),n=this._mountPoint??=document.createElement(`span`);n.parentNode!==t&&t.appendChild(n);let r={...e,shadowRoot:t},i=r.primaryColor??`210 100% 50%`,a=r.secondaryColor??`210 100% 50%`,o=r.primaryColor!=null&&Kp.test(r.primaryColor),s=r.secondaryColor!=null&&Kp.test(r.secondaryColor);n.style.setProperty(`--primary`,o?Yp(i):i),n.style.setProperty(`--secondary`,s?Yp(a):a),r.theme===`dark`?this.setAttribute(`data-mode`,`dark`):this.removeAttribute(`data-mode`),(this._reactRoot??=rm.createRoot(n)).render((0,K.jsx)(hL,{...r}))}};customElements.get(`fma-carfare-search`)||customElements.define(`fma-carfare-search`,_L);function vL(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}function yL(e){return Array.from(new Set([e,e.toLowerCase(),vL(e)]))}function bL(e,t){if(e===void 0)return t;let n=e.trim().toLowerCase();return t?n!==`false`:n===`true`}function xL(e){let t=e.trim();return/^(?:\d+\.?\d*|\.\d+)$/.test(t)?`${t.endsWith(`.`)?t.slice(0,-1):t}px`:t}var SL=`80 64 646 101`,CL=646/101,wL={white:`#fff`,black:`#1f1f1f`},TL=[`M98.5,141.34h-11.27v-20l11.27-8.22v28.22Z`,`M137.06,81.95h-38.55v23.13h.52l16.22-.02c4.76,0,8.83,3.41,9.65,8.09l-57.38-.05-5.68-16.12h5.55l8.13,8.1h11.71v-34.1h49.83v10.97Z`,`M144.49,70.76h10.37v70.36h-10.37v-70.36Z`,`M205.29,91.5h11.58l-31.31,72.68h-11.47l10.27-23.76-19.83-48.92h12.08l8.56,23.45,4.93,14.09,5.33-13.89,9.86-23.66Z`,`M288.11,141.23v-54.05l-23.96,33.32h-2.42l-23.66-33.32v54.05h-11.27v-70.46h13.09l23.25,33.02,23.15-33.02h13.09v70.46h-11.27Z`,`M350.58,91.5h11.58l-31.31,72.68h-11.48l10.27-23.76-19.83-48.92h12.08l8.56,23.45,4.93,14.09,5.34-13.89,9.86-23.66Z`,`M421,141.13l-6.74-14.8h-38.15l-6.64,14.8h-11.98l31.61-70.46h12.28l31.61,70.46h-11.98ZM410.13,116.06l-14.9-33.52-14.9,33.52h29.8Z`,`M451.26,91.3v49.83h-10.37v-49.83h10.37ZM439.68,76.9c0,8.56,12.88,8.56,12.88,0s-12.88-8.46-12.88,0Z`,`M462.51,91.5h9.66l.7,6.54c3.62-6.34,9.26-7.65,14.6-7.65,4.83,0,9.46,1.71,12.28,4.23l-4.73,9.06c-2.52-2.01-4.93-3.02-8.76-3.02-7.15,0-13.39,4.43-13.39,13.59v26.88h-10.37v-49.63Z`,`M533.58,132.17c9.06,0,15.7-6.54,15.7-15.8s-6.24-15.8-15.7-15.8-15.6,6.95-15.6,15.8,6.54,15.8,15.6,15.8ZM517.07,164.18h-10.37v-72.68h9.76l.6,8.05c3.83-6.04,10.87-9.06,17.51-9.06,14.8.1,25.06,10.87,25.06,25.87s-9.66,25.87-25.06,25.87c-6.04,0-13.79-2.21-17.51-8.35v30.3Z`,`M592.15,90.49c15.3,0,25.77,11.27,25.77,25.87s-10.17,25.77-25.77,25.77-25.57-11.07-25.57-25.77,10.17-25.87,25.57-25.87ZM592.15,100.06c-9.46,0-15.2,7.55-15.2,16.31s5.74,16.11,15.2,16.11,15.3-7.25,15.3-16.11-6.24-16.31-15.3-16.31Z`,`M624.88,91.5h9.66l.71,6.54c3.62-6.34,9.26-7.65,14.6-7.65,4.83,0,9.46,1.71,12.28,4.23l-4.73,9.06c-2.52-2.01-4.93-3.02-8.76-3.02-7.15,0-13.39,4.43-13.39,13.59v26.88h-10.37v-49.63Z`,`M674.75,78.31l10.47-1.11v14.39h14.5v8.96h-14.6v23.66c0,5.23,2.32,8.15,7.15,8.15,2.01,0,4.33-.7,6.34-1.71l3.02,8.86c-3.42,1.51-6.44,2.21-9.97,2.21-10.77.3-16.91-5.84-16.91-17.51v-23.66h-9.56v-8.96h9.56v-13.29Z`,`M715.78,63.99c6.85,0,10.68,4.93,10.68,10.77s-3.83,10.77-10.68,10.77-10.65-4.93-10.65-10.77,3.84-10.77,10.65-10.77ZM707.84,74.76c.03,4.66,2.89,8.32,7.94,8.32s7.94-3.66,7.94-8.32-2.86-8.35-7.94-8.35-7.91,3.69-7.94,8.35ZM721,79.66l-2.89-3.48c4.07-.8,3.42-6.93-1.36-6.93h-5.13v10.95h2.48v-3.6h1.39l2.83,3.6h2.69v-.53ZM714.09,71.49h2.65c2.04,0,2.04,2.98-.03,2.98h-2.63v-2.98Z`];function EL({variant:e=`white`,className:t,height:n=28}){return(0,K.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:SL,width:Math.round(n*CL),height:n,className:t,role:`img`,"aria-label":`FlyMyAirport`,children:(0,K.jsx)(`g`,{fill:wL[e],children:TL.map(e=>(0,K.jsx)(`path`,{d:e},e))})})}function DL(e,t=500){let[n,r]=(0,G.useState)(e),i=(0,G.useRef)(e);return(0,G.useEffect)(()=>{if(i.current===e)return;let n=e,a=setTimeout(()=>{i.current!==n&&(i.current=n,r(n))},t);return()=>clearTimeout(a)},[e,t]),n}function OL(e){return(e.split(`,`)[0]??``).trim().toUpperCase()}function kL(e){let t=String(e.getMonth()+1).padStart(2,`0`);return`${e.getFullYear()}-${t}`}function AL(e){return new Date(e.getFullYear(),e.getMonth(),1)}function jL(e,t){let n=t??e,r=AL(e),i=AL(n),a=[],o=r;for(;o<=i;)a.push(kL(o)),o=new Date(o.getFullYear(),o.getMonth()+1,1);return a}function ML(e=new Date){let t=AL(e),n=new Date(t.getFullYear(),t.getMonth()+1,1);return[kL(t),kL(n)]}function NL({startDate:e,endDate:t,lookaheadMonths:n=1,referenceDate:r=new Date}){if(!e){let e=ML(r);return{visibleMonths:e,fetchMonths:e}}let i=jL(e,t),a=new Set([...ML(r),...i]),o=AL(t??e);for(let e=1;e<=n;e+=1)a.add(kL(new Date(o.getFullYear(),o.getMonth()+e,1)));return{visibleMonths:i,fetchMonths:Array.from(a).sort()}}function PL(e,t,n,r){let i={iata:OL(e),locationType:n},a={iata:OL(t),locationType:r},o=i.iata<=a.iata;return{canonicalFrom:o?i:a,canonicalTo:o?a:i,requestedDirectionInCanonicalEnvelope:o?`forward`:`reverse`}}function FL(e){if(typeof e!=`object`||!e||Array.isArray(e))throw Error(`Unable to get route calendar month`);let t=e;if(t.success!==!0)throw Error(`Unable to get route calendar month`);return t.data}async function IL(e){let t={};e.sessionId&&(t[d_]=e.sessionId),e.clickId&&(t[f_]=e.clickId);let n={departureAirport:e.departureAirport,arrivalAirport:e.arrivalAirport,month:e.month,departureLocationType:e.departureLocationType,arrivalLocationType:e.arrivalLocationType},r=!!e.calendarApiBaseUrl,i=r?await fetch(`${e.calendarApiBaseUrl}/v1/route-calendar-month?${new URLSearchParams(n).toString()}`,{method:`GET`,headers:t}):await fetch(`${e.apiDomain}/api/calendar-month`,{method:`POST`,headers:{...t,"Content-Type":`application/json`},body:JSON.stringify(n)});if(!i.ok)throw Error(`Unable to get route calendar month`);let a=await i.json();return Ic.parse(r?FL(a):a)}function LL(e){let t=new Date;return t.setDate(t.getDate()-1),t.setHours(0,0,0,0),Object.fromEntries(Object.entries(e).filter(([e])=>new Date(e)>=t))}function RL(e){return e.reduce((e,t)=>(Object.assign(e.forward,t.forward),Object.assign(e.reverse,t.reverse),e),{forward:{},reverse:{}})}function zL({selectedDirection:e,mergedDirections:t}){return e===`forward`?{selectedData:t.forward,oppositeData:t.reverse}:{selectedData:t.reverse,oppositeData:t.forward}}var BL=new Map;function VL({apiDomain:e,calendarApiBaseUrl:t,params:n,debounceTime:r=500}){let{sessionId:i}=a_(),{clickId:a}=fh(),o=DL((0,G.useMemo)(()=>({startDate:n.startDate,endDate:n.endDate}),[n.startDate,n.endDate]),r),s=n.departureLocationType??W.AIRPORT,c=n.arrivalLocationType??W.AIRPORT,l=PL(n.origin,n.destination,s,c),{visibleMonths:u,fetchMonths:d}=NL({startDate:o.startDate,endDate:o.endDate}),f=l.canonicalFrom.iata.length>0,p=l.canonicalTo.iata.length>0,m=f&&p,h=Yg({queries:d.map(n=>{let r=l.canonicalFrom.iata,o=l.canonicalTo.iata,s=l.canonicalFrom.locationType,c=l.canonicalTo.locationType;return{queryKey:[`route-calendar-month`,r,o,s,c,n,t??`fma-app`,i],enabled:m&&!!i,queryFn:async()=>{let l=Fc.safeParse({departureAirport:r,arrivalAirport:o,month:n,departureLocationType:s,arrivalLocationType:c});if(!l.success)throw Error(`Invalid route-calendar-month parameters`);return IL({apiDomain:e,calendarApiBaseUrl:t,departureAirport:l.data.departureAirport,arrivalAirport:l.data.arrivalAirport,month:l.data.month,departureLocationType:l.data.departureLocationType,arrivalLocationType:l.data.arrivalLocationType,sessionId:i,clickId:a})},staleTime:6e4}})}),g=(0,G.useMemo)(()=>[l.canonicalFrom.iata,l.canonicalTo.iata,l.canonicalFrom.locationType,l.canonicalTo.locationType,i??`no-session`].join(`|`),[l.canonicalFrom.iata,l.canonicalTo.iata,l.canonicalFrom.locationType,l.canonicalTo.locationType,i]),{forwardData:_,reverseData:v,data:y,oppositeData:b}=(0,G.useMemo)(()=>{let e=h.filter(e=>!!e.data);if(e.length===0)return BL.get(g)??{forwardData:void 0,reverseData:void 0,data:void 0,oppositeData:void 0};let t=RL(e.map(e=>e.data)),n=l.requestedDirectionInCanonicalEnvelope,{selectedData:r,oppositeData:i}=zL({selectedDirection:n,mergedDirections:t}),a={forwardData:LL(t.forward),reverseData:LL(t.reverse),data:LL(r),oppositeData:LL(i)};return BL.set(g,a),a},[h,g,l.requestedDirectionInCanonicalEnvelope]);return{forwardData:_,reverseData:v,data:y,oppositeData:b,status:(0,G.useMemo)(()=>{if(!m||!i)return`pending`;let e=new Set(u),t=h.filter((t,n)=>e.has(d[n]??``));return t.length===0?`pending`:t.some(e=>e.status===`error`)?`error`:t.some(e=>e.status===`pending`)?`pending`:`success`},[h,d,u,i,m])}}function HL(){return(0,K.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,className:`aone:w-6 aone:h-6`,children:(0,K.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M7.5 21L3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5`})})}var UL=s(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),WL=s(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),GL=s(((e,t)=>{var n=WL();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),KL=s(((e,t)=>{var n=GL(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),qL=s(((e,t)=>{var n=GL();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),JL=s(((e,t)=>{var n=GL();function r(e){return n(this.__data__,e)>-1}t.exports=r})),YL=s(((e,t)=>{var n=GL();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),XL=s(((e,t)=>{var n=UL(),r=KL(),i=qL(),a=JL(),o=YL();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),ZL=s(((e,t)=>{var n=XL();function r(){this.__data__=new n,this.size=0}t.exports=r})),QL=s(((e,t)=>{function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.exports=n})),$L=s(((e,t)=>{function n(e){return this.__data__.get(e)}t.exports=n})),eR=s(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),tR=s(((e,t)=>{var n=GI(),r=II(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),nR=s(((e,t)=>{t.exports=RI()[`__core-js_shared__`]})),rR=s(((e,t)=>{var n=nR(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),iR=s(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),aR=s(((e,t)=>{var n=tR(),r=rR(),i=II(),a=iR(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),oR=s(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),sR=s(((e,t)=>{var n=aR(),r=oR();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),cR=s(((e,t)=>{t.exports=sR()(RI(),`Map`)})),lR=s(((e,t)=>{t.exports=sR()(Object,`create`)})),uR=s(((e,t)=>{var n=lR();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),dR=s(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}t.exports=n})),fR=s(((e,t)=>{var n=lR(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),pR=s(((e,t)=>{var n=lR(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),mR=s(((e,t)=>{var n=lR(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=+!this.has(e),i[e]=n&&t===void 0?r:t,this}t.exports=i})),hR=s(((e,t)=>{var n=uR(),r=dR(),i=fR(),a=pR(),o=mR();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),gR=s(((e,t)=>{var n=hR(),r=XL(),i=cR();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),_R=s(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),vR=s(((e,t)=>{var n=_R();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),yR=s(((e,t)=>{var n=vR();function r(e){var t=n(this,e).delete(e);return this.size-=+!!t,t}t.exports=r})),bR=s(((e,t)=>{var n=vR();function r(e){return n(this,e).get(e)}t.exports=r})),xR=s(((e,t)=>{var n=vR();function r(e){return n(this,e).has(e)}t.exports=r})),SR=s(((e,t)=>{var n=vR();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),CR=s(((e,t)=>{var n=gR(),r=yR(),i=bR(),a=xR(),o=SR();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),wR=s(((e,t)=>{var n=XL(),r=cR(),i=CR(),a=200;function o(e,t){var o=this.__data__;if(o instanceof n){var s=o.__data__;if(!r||s.length<a-1)return s.push([e,t]),this.size=++o.size,this;o=this.__data__=new i(s)}return o.set(e,t),this.size=o.size,this}t.exports=o})),TR=s(((e,t)=>{var n=XL(),r=ZL(),i=QL(),a=$L(),o=eR(),s=wR();function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=o,c.prototype.set=s,t.exports=c})),ER=s(((e,t)=>{function n(e){return this.__data__.set(e,`__lodash_hash_undefined__`),this}t.exports=n})),DR=s(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),OR=s(((e,t)=>{var n=CR(),r=ER(),i=DR();function a(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}a.prototype.add=a.prototype.push=r,a.prototype.has=i,t.exports=a})),kR=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.exports=n})),AR=s(((e,t)=>{function n(e,t){return e.has(t)}t.exports=n})),jR=s(((e,t)=>{var n=OR(),r=kR(),i=AR(),a=1,o=2;function s(e,t,s,c,l,u){var d=s&a,f=e.length,p=t.length;if(f!=p&&!(d&&p>f))return!1;var m=u.get(e),h=u.get(t);if(m&&h)return m==t&&h==e;var g=-1,_=!0,v=s&o?new n:void 0;for(u.set(e,t),u.set(t,e);++g<f;){var y=e[g],b=t[g];if(c)var x=d?c(b,y,g,t,e,u):c(y,b,g,e,t,u);if(x!==void 0){if(x)continue;_=!1;break}if(v){if(!r(t,function(e,t){if(!i(v,t)&&(y===e||l(y,e,s,c,u)))return v.push(t)})){_=!1;break}}else if(!(y===b||l(y,b,s,c,u))){_=!1;break}}return u.delete(e),u.delete(t),_}t.exports=s})),MR=s(((e,t)=>{t.exports=RI().Uint8Array})),NR=s(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}t.exports=n})),PR=s(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}t.exports=n})),FR=s(((e,t)=>{var n=HI(),r=MR(),i=WL(),a=jR(),o=NR(),s=PR(),c=1,l=2,u=`[object Boolean]`,d=`[object Date]`,f=`[object Error]`,p=`[object Map]`,m=`[object Number]`,h=`[object RegExp]`,g=`[object Set]`,_=`[object String]`,v=`[object Symbol]`,y=`[object ArrayBuffer]`,b=`[object DataView]`,x=n?n.prototype:void 0,S=x?x.valueOf:void 0;function C(e,t,n,x,C,w,T){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y:return!(e.byteLength!=t.byteLength||!w(new r(e),new r(t)));case u:case d:case m:return i(+e,+t);case f:return e.name==t.name&&e.message==t.message;case h:case _:return e==t+``;case p:var E=o;case g:var D=x&c;if(E||=s,e.size!=t.size&&!D)return!1;var O=T.get(e);if(O)return O==t;x|=l,T.set(e,t);var k=a(E(e),E(t),x,C,w,T);return T.delete(e),k;case v:if(S)return S.call(e)==S.call(t)}return!1}t.exports=C})),IR=s(((e,t)=>{function n(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}t.exports=n})),LR=s(((e,t)=>{t.exports=Array.isArray})),RR=s(((e,t)=>{var n=IR(),r=LR();function i(e,t,i){var a=t(e);return r(e)?a:n(a,i(e))}t.exports=i})),zR=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}t.exports=n})),BR=s(((e,t)=>{function n(){return[]}t.exports=n})),VR=s(((e,t)=>{var n=zR(),r=BR(),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;t.exports=a?function(e){return e==null?[]:(e=Object(e),n(a(e),function(t){return i.call(e,t)}))}:r})),HR=s(((e,t)=>{function n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}t.exports=n})),UR=s(((e,t)=>{var n=GI(),r=KI(),i=`[object Arguments]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),WR=s(((e,t)=>{var n=UR(),r=KI(),i=Object.prototype,a=i.hasOwnProperty,o=i.propertyIsEnumerable;t.exports=n(function(){return arguments}())?n:function(e){return r(e)&&a.call(e,`callee`)&&!o.call(e,`callee`)}})),GR=s(((e,t)=>{function n(){return!1}t.exports=n})),KR=s(((e,t)=>{var n=RI(),r=GR(),i=typeof e==`object`&&e&&!e.nodeType&&e,a=i&&typeof t==`object`&&t&&!t.nodeType&&t,o=a&&a.exports===i?n.Buffer:void 0;t.exports=(o?o.isBuffer:void 0)||r})),qR=s(((e,t)=>{var n=/^(?:0|[1-9]\d*)$/;function r(e,t){var r=typeof e;return t??=9007199254740991,!!t&&(r==`number`||r!=`symbol`&&n.test(e))&&e>-1&&e%1==0&&e<t}t.exports=r})),JR=s(((e,t)=>{function n(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=9007199254740991}t.exports=n})),YR=s(((e,t)=>{var n=GI(),r=JR(),i=KI(),a=`[object Arguments]`,o=`[object Array]`,s=`[object Boolean]`,c=`[object Date]`,l=`[object Error]`,u=`[object Function]`,d=`[object Map]`,f=`[object Number]`,p=`[object Object]`,m=`[object RegExp]`,h=`[object Set]`,g=`[object String]`,_=`[object WeakMap]`,v=`[object ArrayBuffer]`,y=`[object DataView]`,b=`[object Float32Array]`,x=`[object Float64Array]`,S=`[object Int8Array]`,C=`[object Int16Array]`,w=`[object Int32Array]`,T=`[object Uint8Array]`,E=`[object Uint8ClampedArray]`,D=`[object Uint16Array]`,O=`[object Uint32Array]`,k={};k[b]=k[x]=k[S]=k[C]=k[w]=k[T]=k[E]=k[D]=k[O]=!0,k[a]=k[o]=k[v]=k[s]=k[y]=k[c]=k[l]=k[u]=k[d]=k[f]=k[p]=k[m]=k[h]=k[g]=k[_]=!1;function A(e){return i(e)&&r(e.length)&&!!k[n(e)]}t.exports=A})),XR=s(((e,t)=>{function n(e){return function(t){return e(t)}}t.exports=n})),ZR=s(((e,t)=>{var n=LI(),r=typeof e==`object`&&e&&!e.nodeType&&e,i=r&&typeof t==`object`&&t&&!t.nodeType&&t,a=i&&i.exports===r&&n.process;t.exports=function(){try{return i&&i.require&&i.require(`util`).types||a&&a.binding&&a.binding(`util`)}catch{}}()})),QR=s(((e,t)=>{var n=YR(),r=XR(),i=ZR(),a=i&&i.isTypedArray;t.exports=a?r(a):n})),$R=s(((e,t)=>{var n=HR(),r=WR(),i=LR(),a=KR(),o=qR(),s=QR(),c=Object.prototype.hasOwnProperty;function l(e,t){var l=i(e),u=!l&&r(e),d=!l&&!u&&a(e),f=!l&&!u&&!d&&s(e),p=l||u||d||f,m=p?n(e.length,String):[],h=m.length;for(var g in e)(t||c.call(e,g))&&!(p&&(g==`length`||d&&(g==`offset`||g==`parent`)||f&&(g==`buffer`||g==`byteLength`||g==`byteOffset`)||o(g,h)))&&m.push(g);return m}t.exports=l})),ez=s(((e,t)=>{var n=Object.prototype;function r(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||n)}t.exports=r})),tz=s(((e,t)=>{function n(e,t){return function(n){return e(t(n))}}t.exports=n})),nz=s(((e,t)=>{t.exports=tz()(Object.keys,Object)})),rz=s(((e,t)=>{var n=ez(),r=nz(),i=Object.prototype.hasOwnProperty;function a(e){if(!n(e))return r(e);var t=[];for(var a in Object(e))i.call(e,a)&&a!=`constructor`&&t.push(a);return t}t.exports=a})),iz=s(((e,t)=>{var n=tR(),r=JR();function i(e){return e!=null&&r(e.length)&&!n(e)}t.exports=i})),az=s(((e,t)=>{var n=$R(),r=rz(),i=iz();function a(e){return i(e)?n(e):r(e)}t.exports=a})),oz=s(((e,t)=>{var n=RR(),r=VR(),i=az();function a(e){return n(e,i,r)}t.exports=a})),sz=s(((e,t)=>{var n=oz(),r=1,i=Object.prototype.hasOwnProperty;function a(e,t,a,o,s,c){var l=a&r,u=n(e),d=u.length;if(d!=n(t).length&&!l)return!1;for(var f=d;f--;){var p=u[f];if(!(l?p in t:i.call(t,p)))return!1}var m=c.get(e),h=c.get(t);if(m&&h)return m==t&&h==e;var g=!0;c.set(e,t),c.set(t,e);for(var _=l;++f<d;){p=u[f];var v=e[p],y=t[p];if(o)var b=l?o(y,v,p,t,e,c):o(v,y,p,e,t,c);if(!(b===void 0?v===y||s(v,y,a,o,c):b)){g=!1;break}_||=p==`constructor`}if(g&&!_){var x=e.constructor,S=t.constructor;x!=S&&`constructor`in e&&`constructor`in t&&!(typeof x==`function`&&x instanceof x&&typeof S==`function`&&S instanceof S)&&(g=!1)}return c.delete(e),c.delete(t),g}t.exports=a})),cz=s(((e,t)=>{t.exports=sR()(RI(),`DataView`)})),lz=s(((e,t)=>{t.exports=sR()(RI(),`Promise`)})),uz=s(((e,t)=>{t.exports=sR()(RI(),`Set`)})),dz=s(((e,t)=>{t.exports=sR()(RI(),`WeakMap`)})),fz=s(((e,t)=>{var n=cz(),r=cR(),i=lz(),a=uz(),o=dz(),s=GI(),c=iR(),l=`[object Map]`,u=`[object Object]`,d=`[object Promise]`,f=`[object Set]`,p=`[object WeakMap]`,m=`[object DataView]`,h=c(n),g=c(r),_=c(i),v=c(a),y=c(o),b=s;(n&&b(new n(new ArrayBuffer(1)))!=m||r&&b(new r)!=l||i&&b(i.resolve())!=d||a&&b(new a)!=f||o&&b(new o)!=p)&&(b=function(e){var t=s(e),n=t==u?e.constructor:void 0,r=n?c(n):``;if(r)switch(r){case h:return m;case g:return l;case _:return d;case v:return f;case y:return p}return t}),t.exports=b})),pz=s(((e,t)=>{var n=TR(),r=jR(),i=FR(),a=sz(),o=fz(),s=LR(),c=KR(),l=QR(),u=1,d=`[object Arguments]`,f=`[object Array]`,p=`[object Object]`,m=Object.prototype.hasOwnProperty;function h(e,t,h,g,_,v){var y=s(e),b=s(t),x=y?f:o(e),S=b?f:o(t);x=x==d?p:x,S=S==d?p:S;var C=x==p,w=S==p,T=x==S;if(T&&c(e)){if(!c(t))return!1;y=!0,C=!1}if(T&&!C)return v||=new n,y||l(e)?r(e,t,h,g,_,v):i(e,t,x,h,g,_,v);if(!(h&u)){var E=C&&m.call(e,`__wrapped__`),D=w&&m.call(t,`__wrapped__`);if(E||D){var O=E?e.value():e,k=D?t.value():t;return v||=new n,_(O,k,h,g,v)}}return T?(v||=new n,a(e,t,h,g,_,v)):!1}t.exports=h})),mz=s(((e,t)=>{var n=pz(),r=KI();function i(e,t,a,o,s){return e===t?!0:e==null||t==null||!r(e)&&!r(t)?e!==e&&t!==t:n(e,t,a,o,i,s)}t.exports=i})),hz=s(((e,t)=>{var n=TR(),r=mz(),i=1,a=2;function o(e,t,o,s){var c=o.length,l=c,u=!s;if(e==null)return!l;for(e=Object(e);c--;){var d=o[c];if(u&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++c<l;){d=o[c];var f=d[0],p=e[f],m=d[1];if(u&&d[2]){if(p===void 0&&!(f in e))return!1}else{var h=new n;if(s)var g=s(p,m,f,e,t,h);if(!(g===void 0?r(m,p,i|a,s,h):g))return!1}}return!0}t.exports=o})),gz=s(((e,t)=>{var n=II();function r(e){return e===e&&!n(e)}t.exports=r})),_z=s(((e,t)=>{var n=gz(),r=az();function i(e){for(var t=r(e),i=t.length;i--;){var a=t[i],o=e[a];t[i]=[a,o,n(o)]}return t}t.exports=i})),vz=s(((e,t)=>{function n(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}}t.exports=n})),yz=s(((e,t)=>{var n=hz(),r=_z(),i=vz();function a(e){var t=r(e);return t.length==1&&t[0][2]?i(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}t.exports=a})),bz=s(((e,t)=>{var n=LR(),r=qI(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function o(e,t){if(n(e))return!1;var o=typeof e;return o==`number`||o==`symbol`||o==`boolean`||e==null||r(e)?!0:a.test(e)||!i.test(e)||t!=null&&e in Object(t)}t.exports=o})),xz=s(((e,t)=>{var n=CR(),r=`Expected a function`;function i(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(r);var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(i.Cache||n),a}i.Cache=n,t.exports=i})),Sz=s(((e,t)=>{var n=xz(),r=500;function i(e){var t=n(e,function(e){return i.size===r&&i.clear(),e}),i=t.cache;return t}t.exports=i})),Cz=s(((e,t)=>{var n=Sz(),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;t.exports=n(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,`$1`):n||e)}),t})})),wz=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=n})),Tz=s(((e,t)=>{var n=HI(),r=wz(),i=LR(),a=qI(),o=1/0,s=n?n.prototype:void 0,c=s?s.toString:void 0;function l(e){if(typeof e==`string`)return e;if(i(e))return r(e,l)+``;if(a(e))return c?c.call(e):``;var t=e+``;return t==`0`&&1/e==-o?`-0`:t}t.exports=l})),Ez=s(((e,t)=>{var n=Tz();function r(e){return e==null?``:n(e)}t.exports=r})),Dz=s(((e,t)=>{var n=LR(),r=bz(),i=Cz(),a=Ez();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),Oz=s(((e,t)=>{var n=qI(),r=1/0;function i(e){if(typeof e==`string`||n(e))return e;var t=e+``;return t==`0`&&1/e==-r?`-0`:t}t.exports=i})),kz=s(((e,t)=>{var n=Dz(),r=Oz();function i(e,t){t=n(t,e);for(var i=0,a=t.length;e!=null&&i<a;)e=e[r(t[i++])];return i&&i==a?e:void 0}t.exports=i})),Az=s(((e,t)=>{var n=kz();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r})),jz=s(((e,t)=>{function n(e,t){return e!=null&&t in Object(e)}t.exports=n})),Mz=s(((e,t)=>{var n=Dz(),r=WR(),i=LR(),a=qR(),o=JR(),s=Oz();function c(e,t,c){t=n(t,e);for(var l=-1,u=t.length,d=!1;++l<u;){var f=s(t[l]);if(!(d=e!=null&&c(e,f)))break;e=e[f]}return d||++l!=u?d:(u=e==null?0:e.length,!!u&&o(u)&&a(f,u)&&(i(e)||r(e)))}t.exports=c})),Nz=s(((e,t)=>{var n=jz(),r=Mz();function i(e,t){return e!=null&&r(e,t,n)}t.exports=i})),Pz=s(((e,t)=>{var n=mz(),r=Az(),i=Nz(),a=bz(),o=gz(),s=vz(),c=Oz(),l=1,u=2;function d(e,t){return a(e)&&o(t)?s(c(e),t):function(a){var o=r(a,e);return o===void 0&&o===t?i(a,e):n(t,o,l|u)}}t.exports=d})),Fz=s(((e,t)=>{function n(e){return e}t.exports=n})),Iz=s(((e,t)=>{function n(e){return function(t){return t?.[e]}}t.exports=n})),Lz=s(((e,t)=>{var n=kz();function r(e){return function(t){return n(t,e)}}t.exports=r})),Rz=s(((e,t)=>{var n=Iz(),r=Lz(),i=bz(),a=Oz();function o(e){return i(e)?n(a(e)):r(e)}t.exports=o})),zz=s(((e,t)=>{var n=yz(),r=Pz(),i=Fz(),a=LR(),o=Rz();function s(e){return typeof e==`function`?e:e==null?i:typeof e==`object`?a(e)?r(e[0],e[1]):n(e):o(e)}t.exports=s})),Bz=s(((e,t)=>{function n(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}t.exports=n})),Vz=s(((e,t)=>{function n(e){return e!==e}t.exports=n})),Hz=s(((e,t)=>{function n(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}t.exports=n})),Uz=s(((e,t)=>{var n=Bz(),r=Vz(),i=Hz();function a(e,t,a){return t===t?i(e,t,a):n(e,r,a)}t.exports=a})),Wz=s(((e,t)=>{var n=Uz();function r(e,t){return!!(e!=null&&e.length)&&n(e,t,0)>-1}t.exports=r})),Gz=s(((e,t)=>{function n(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}t.exports=n})),Kz=s(((e,t)=>{function n(){}t.exports=n})),qz=s(((e,t)=>{var n=uz(),r=Kz(),i=PR();t.exports=n&&1/i(new n([,-0]))[1]==1/0?function(e){return new n(e)}:r})),Jz=s(((e,t)=>{var n=OR(),r=Wz(),i=Gz(),a=AR(),o=qz(),s=PR(),c=200;function l(e,t,l){var u=-1,d=r,f=e.length,p=!0,m=[],h=m;if(l)p=!1,d=i;else if(f>=c){var g=t?null:o(e);if(g)return s(g);p=!1,d=a,h=new n}else h=t?[]:m;outer:for(;++u<f;){var _=e[u],v=t?t(_):_;if(_=l||_!==0?_:0,p&&v===v){for(var y=h.length;y--;)if(h[y]===v)continue outer;t&&h.push(v),m.push(_)}else d(h,v,l)||(h!==m&&h.push(v),m.push(_))}return m}t.exports=l})),Yz=l(s(((e,t)=>{var n=zz(),r=Jz();function i(e,t){return e&&e.length?r(e,n(t,2)):[]}t.exports=i}))(),1),Xz=new WeakMap,Zz=new WeakMap,Qz=`data-a1-flight-combobox-open`;function $z(e){let t=Zz.get(e);t!=null&&(clearTimeout(t),Zz.delete(e));let n=(Xz.get(e)??0)+1;Xz.set(e,n),e.setAttribute(Qz,``)}function eB(e){let t=Math.max(0,(Xz.get(e)??0)-1);if(t===0){Xz.delete(e);let t=Zz.get(e);t!=null&&clearTimeout(t);let n=window.setTimeout(()=>{Zz.delete(e),e.removeAttribute(Qz)},400);Zz.set(e,n)}else Xz.set(e,t)}function tB({items:e,selectedItems:t,onInputChange:n,onSelectedItemsChange:r,fieldLabel:i,inputId:a,required:o=!1,placeholder:s,icon:c,disabled:l,shadowRoot:u,dataTestId:d}){let[f,p]=(0,G.useState)(``),[m,h]=(0,G.useState)(``),g=(0,G.useRef)(null),_=(0,G.useRef)(null),v=(0,G.useId)(),y=(0,G.useId)(),b=a??y,x=(0,G.useId)(),S=(0,G.useId)(),C=(0,G.useId)(),[w,T]=(0,G.useState)({}),E=u??null,D=(0,G.useCallback)(()=>{let e=g.current;if(!e)return;let t=e.getBoundingClientRect(),n=window.innerHeight-t.bottom-8,r=Math.max(120,Math.min(320,n-8)),i=t.left,a=t.width;i+a>window.innerWidth-8&&(i=Math.max(8,window.innerWidth-a-8)),T({position:`fixed`,top:t.bottom+8,left:i,width:a,maxHeight:r,zIndex:1e4})},[]),O=(0,G.useMemo)(()=>e.filter(e=>e.type===`airport`||e.type===`place`).reduce((e,t)=>{if(t.type===`airport`){let n=t,r=f.toLowerCase();if(n.iata_code.toLowerCase()===r||n.iata_display_list?.some(e=>e.toLowerCase()===r))return t.sectionIndex>=0?[...e,t]:[{...t,sectionIndex:-1},...e]}return[...e,t]},[]).reduce((e,t)=>t.type===`airport`?{items:[...e.items,t],airportCount:e.airportCount+1}:t.type===`place`?e.airportCount<20?{...e,items:[...e.items,t]}:e:e.airportCount<=20?{...e,items:[...e.items,t]}:e,{items:[],airportCount:0}).items,[f,e]);function k(e){return e.kayak?.stateCode&&e.kayak?.countryCode?`${e.name}, ${e.kayak.stateCode}, ${e.kayak.countryCode}`:e.kayak?.countryCode&&!e.kayak?.stateCode?`${e.name}, ${e.kayak.countryCode}`:e.formatted_address}function A(e){return e.state_code?`${e.city}, ${e.state_code}, ${e.country_code}`:e.location_display?e.location_display:`${e.city}, ${e.country_code}`}function j(e){return e.iata_display_list&&e.iata_display_list.length>0?e.iata_display_list.join(`, `):e.iata_code}function M(e){if(e.type===`airport`){let n=e;return t?.length>1?j(n):n.country_code===`US`?`${n.city} (${j(n)})`:`${n.city}, ${n.country_code} (${j(n)})`}if(e.type===`place`){let t=e;return t.formatted_address?.length<20?t.formatted_address:t.name}return``}function N(){let e=i?.trim().toLowerCase();return e?e.endsWith(`s`)?e:e===`destination`?`destinations`:e===`origin`?`origins`:`${e}s`:`locations`}function P(e){let t=M(e)||`Selection`;h(``),queueMicrotask(()=>{h(`${t} has been removed from the selected ${N()}.`)})}let ee=typeof Proxy==`function`&&!Object.isSealed(new Proxy({},{}));function F(e){let t=e.ownerDocument,n={document:t,addEventListener:t.addEventListener.bind(e),removeEventListener:t.removeEventListener.bind(e),Node:window.Node,Element:window.Element,HTMLElement:window.HTMLElement,SVGElement:window.SVGElement};return ee?new Proxy(n,{get(e,t){return e[t]}}):n}let{getSelectedItemProps:te,getDropdownProps:ne,removeSelectedItem:I}=lI({selectedItems:t,onStateChange({selectedItems:e,type:t}){t===lI.stateChangeTypes.FunctionRemoveSelectedItem&&r(e)}});function re(e){P(e),I(e)}let{isOpen:L,getMenuProps:ie,getInputProps:ae,getItemProps:oe,highlightedIndex:se,setHighlightedIndex:ce}=zF({environment:u?F(u):void 0,items:O,isItemDisabled(e){return!!e?.disabled},itemToKey(e){return e?.key??``},itemToString(e){return e?e.type===`airport`?M(e):e.name??``:``},defaultHighlightedIndex:0,selectedItem:null,inputValue:f,stateReducer(e,t){let{changes:n,type:r}=t;switch(r){case zF.stateChangeTypes.InputKeyDownEnter:case zF.stateChangeTypes.ItemClick:case zF.stateChangeTypes.InputKeyDownArrowDown:case zF.stateChangeTypes.InputKeyDownArrowUp:case zF.stateChangeTypes.InputBlur:case zF.stateChangeTypes.InputKeyDownEscape:return n;case zF.stateChangeTypes.ItemMouseMove:return e;case zF.stateChangeTypes.FunctionCloseMenu:return{...n,isOpen:!0};default:return n}},onStateChange({inputValue:e,type:t,selectedItem:n}){switch(t){case zF.stateChangeTypes.InputKeyDownEnter:case zF.stateChangeTypes.ItemClick:n&&(r([n]),p(``));break;case zF.stateChangeTypes.MenuMouseLeave:case zF.stateChangeTypes.ItemMouseMove:case zF.stateChangeTypes.InputKeyDownArrowDown:case zF.stateChangeTypes.InputKeyDownArrowUp:case zF.stateChangeTypes.InputBlur:case zF.stateChangeTypes.ControlledPropUpdatedSelectedItem:}}}),le=(0,G.useMemo)(()=>{if(l)return`Field is locked.`;if(L&&O.length>0){let e=O.length;return`Suggestion list open, ${e} ${e===1?`option`:`options`}.`}return L&&O.length===0?f.trim()?`Suggestion list open, no matching options.`:`Suggestion list open, no options yet.`:`Suggestion list closed.`},[l,L,O.length,f]),R=(0,G.useMemo)(()=>`Type to search airports and places. When the list is open, use arrow keys to move through suggestions and Enter to choose. Tab to selected locations above to remove them, or press Backspace in this field when it is empty.`,[]),ue=i?`${i}, search airports and places`:`Search airports and places`,de=i?`${i} suggestions`:`Search results`,fe=t.length===0?`No airport or place selected.`:(()=>{let e=t.map(e=>M(e));return`Selected ${t.length===1?`location`:`${t.length} locations`}: ${e.join(`, `)}.`})(),pe=[x,S,C].join(` `);(0,G.useEffect)(()=>{l&&queueMicrotask(()=>p(``))},[l]),(0,G.useLayoutEffect)(()=>{if(!L||O.length===0||!E)return;D();let e=g.current,t=e&&typeof ResizeObserver<`u`?new ResizeObserver(D):null;return e&&t?.observe(e),window.addEventListener(`scroll`,D,!0),window.addEventListener(`resize`,D),()=>{t?.disconnect(),window.removeEventListener(`scroll`,D,!0),window.removeEventListener(`resize`,D)}},[L,O.length,E,D]);let me=L&&O.length>0;(0,G.useEffect)(()=>{let e=u?.host;if(e instanceof HTMLElement&&me&&E)return $z(e),()=>eB(e)},[me,u,E]);let he=!!l;function ge(e,t){e.pointerType===`touch`&&(e.preventDefault(),e.stopPropagation(),r([t]),p(``),n(``))}function _e(){let e=ae({...ne(),id:b,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":L,"aria-controls":L?v:void 0,"aria-activedescendant":L&&se!=null&&se>-1?`${v}-${se}`:void 0,"aria-label":ue,onChange:e=>{let t=e.currentTarget.value;p(t),n(t)},onKeyDown:e=>{if(e.key===`Backspace`&&!f&&t.length>0&&!l){let e=t[t.length-1];re(e)}}});return(0,K.jsx)(`input`,{className:(0,q.default)(`aone:outline-none aone:disabled:bg-transparent aone:text-base aone:placeholder:text-gray-700 aone:placeholder:opacity-100`,{"aone:min-w-[120px] aone:max-w-[200px]":t.length>0,"aone:w-full":t.length===0}),placeholder:!he&&t.length===0?s:``,...e,"aria-required":o||void 0,"aria-describedby":pe,disabled:he})}let ve=(0,K.jsx)(`ul`,{...ie(),ref:_,id:v,role:`listbox`,"aria-multiselectable":`true`,"aria-label":de,tabIndex:-1,className:`aone:text-gray-900 aone:max-h-full aone:overflow-y-auto aone:overflow-x-hidden aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2`,children:O.map((e,n)=>{if(e.type===`airport`){let r=e,i=(r.distance||0)*.621371,a=se===n,o=e.sectionIndex>-1&&!r.kayak_shimmed,s=!!t.find(t=>t.key===e.key),c=n+1;return(0,K.jsxs)(`li`,{...oe({item:e,index:n,onPointerDown:t=>ge(t,e),onMouseEnter:()=>ce(n)}),id:`${v}-${n}`,role:`option`,tabIndex:-1,"aria-selected":s,"aria-label":`Option ${c} - ${r.name}, ${A(r)}, ${j(r)}${o?`, ${i.toFixed(+(i<1))} miles away`:``}, ${s?`selected`:`not selected`}`,className:(0,q.default)({"aone:hover:bg-blue-100":!0,"aone:bg-blue-100":a,"aone:font-bold":a,"aone:shadow-sm aone:py-2 aone:px-2 aone:cursor-pointer":!0,"aone:pl-5 aone:border-l-4 aone:border-gray-500":e.sectionIndex>-1,"aone:grid aone:grid-cols-[26px_1fr_30px] aone:gap-1 aone:justify-start aone:items-center":!0,"aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2":!0}),children:[(0,K.jsx)(iN,{className:`aone:w-6 aone:h-6 aone:-rotate-45 aone:text-gray-600`,icon:XE}),(0,K.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,K.jsxs)(`div`,{className:`aone:gap-2 aone:flex aone:items-center aone:w-full`,children:[(0,K.jsx)(`span`,{className:`aone:flex-1 aone:min-w-0 aone:font-medium aone:text-base aone:text-gray-900 aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:r.name}),(0,K.jsx)(`span`,{className:`aone:text-sm aone:uppercase aone:shrink-0 aone:text-gray-600`,children:j(r)})]}),(0,K.jsxs)(`span`,{className:`aone:text-sm aone:text-gray-600`,children:[A(r),o&&(0,K.jsxs)(K.Fragment,{children:[`\xA0•\xA0`,i.toFixed(+(i<1)),`mi`]})]})]}),(0,K.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-1`,"aria-hidden":`true`,children:(0,K.jsx)(`span`,{className:(0,q.default)(`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border aone:flex aone:items-center aone:justify-center`,{"aone:border-gray-700 aone:bg-white":!s,"aone:border-primary aone:bg-primary":s}),children:s?(0,K.jsx)(iN,{icon:GE,className:`aone:h-2.5 aone:w-2.5 aone:text-white`}):null})})]},`${e.key}-${n}`)}if(e.type===`place`){let r=e,i=se===n,a=_p(r.kayak?.apicode),o=k(r),s=!!t.find(t=>t.key===e.key);return(0,K.jsxs)(`li`,{...oe({item:e,index:n,onPointerDown:t=>ge(t,e),onMouseEnter:()=>ce(n)}),id:`${v}-${n}`,role:`option`,tabIndex:-1,"aria-selected":s,"aria-label":`${a?`${r.name}, ${a}, ${o}`:`${r.name}, ${o}`}, ${s?`selected`:`not selected`}`,className:(0,q.default)({"aone:hover:bg-blue-100":!0,"aone:bg-blue-100":i,"aone:font-bold":i,"aone:shadow-sm aone:py-2 aone:px-2 aone:cursor-pointer":!0,"aone:grid aone:grid-cols-[26px_1fr_30px] aone:gap-1 aone:justify-start aone:items-center":!0,"aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2":!0}),children:[(0,K.jsx)(iN,{className:`aone:w-6 aone:h-6 aone:text-gray-600`,icon:rD}),(0,K.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,K.jsxs)(`div`,{className:`aone:gap-2 aone:flex aone:items-end aone:w-full`,children:[(0,K.jsx)(`span`,{className:`aone:flex-1 aone:min-w-0 aone:font-medium aone:text-base aone:text-gray-900 aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:r.name}),a&&(0,K.jsx)(`span`,{className:`aone:text-sm aone:uppercase aone:shrink-0 aone:text-gray-600`,children:a})]}),(0,K.jsx)(`span`,{className:`aone:text-sm aone:shrink-0 aone:text-gray-600`,children:o})]}),(0,K.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-1`,"aria-hidden":`true`,children:(0,K.jsx)(`span`,{className:(0,q.default)(`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border aone:flex aone:items-center aone:justify-center`,{"aone:border-gray-700 aone:bg-white":!s,"aone:border-primary aone:bg-primary":s}),children:s?(0,K.jsx)(iN,{icon:GE,className:`aone:h-2.5 aone:w-2.5 aone:text-white`}):null})})]},`${e.key}-${n}`)}return null})});return(0,K.jsxs)(`div`,{className:`aone:w-full aone:h-full aone:relative aone:z-10`,"data-testid":d,role:`group`,"aria-disabled":l?!0:void 0,children:[i?(0,K.jsxs)(`label`,{htmlFor:b,className:`aone:sr-only`,children:[i,o?` (required)`:``]}):null,(0,K.jsxs)(`div`,{ref:g,className:(0,q.default)({"aone:bg-white aone:text-gray-900 aone:rounded-lg aone:gap-2 aone:items-center aone:py-2 aone:px-3 aone:h-[44px] aone:box-border aone:w-full aone:overflow-hidden":!0,"aone:grid":!0,"aone:grid-cols-[24px_1fr]":t.length===0,"aone:grid-cols-[24px_auto_1fr]":t.length===1,"aone:grid-cols-[24px_auto_auto_1fr]":t.length===2,"aone:grid-cols-[24px_auto_auto_auto_1fr]":t.length===3,"aone:border-2 aone:border-gray-200 aone:focus-within:border-primary":!0,"aone:opacity-60 aone:cursor-not-allowed":!!l}),children:[c,t.map((e,n)=>(0,K.jsxs)(`span`,{...te({selectedItem:e,index:n}),"aria-label":`Selected location: ${M(e)}. Item ${n+1} of ${t.length}.`,className:(0,q.default)({"aone:bg-gray-200 aone:rounded aone:px-1 aone:focus:bg-gray-400 aone:whitespace-nowrap aone:text-ellipsis aone:shrink-0":!0,"aone:text-sm":t.length>0,"aone:flex aone:items-center":!0}),children:[(0,K.jsx)(`span`,{className:`aone:overflow-hidden aone:grow aone:font-medium`,children:M(e)}),!e.disabled&&(0,K.jsx)(`button`,{type:`button`,disabled:!!l||!!e.disabled,className:(0,q.default)(`aone:ml-2 aone:text-base aone:leading-[20px] aone:rounded aone:px-1 aone:transition-colors`,{"aone:hover:bg-gray-300 aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-offset-2 aone:focus-visible:ring-gray-700":!l&&!e.disabled,"aone:cursor-not-allowed aone:opacity-60":!!l}),"data-testid":`autocomplete-remove-item-button`,"aria-label":`Remove ${M(e)}`,onClick:t=>{t.stopPropagation(),!l&&re(e)},children:`×`})]},n)),(0,K.jsx)(`span`,{id:x,className:`aone:sr-only`,children:fe}),(0,K.jsx)(`span`,{id:S,className:`aone:sr-only`,children:le}),(0,K.jsx)(`span`,{id:C,className:`aone:sr-only`,children:R}),_e()]}),(0,K.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`aone:sr-only`,children:m}),L&&O.length>0&&(E?(0,cv.createPortal)((0,K.jsx)(`div`,{className:`aone:bg-white aone:text-gray-900 aone:rounded-lg aone:overflow-hidden aone:shadow-md aone:p-0 aone:box-border`,style:w,children:ve}),E):(0,K.jsx)(`div`,{className:`aone:absolute aone:w-inherit aone:bg-white aone:text-gray-900 aone:mt-2 aone:rounded-lg aone:overflow-hidden aone:shadow-md aone:p-0 aone:z-10`,children:ve}))]})}var nB=100;function rB({items:e,selectedItems:t,onInputChange:n,onSelectedItemsChange:r,fieldLabel:i,inputId:a,required:o=!1,placeholder:s,icon:c,disabled:l,shadowRoot:u}){let[d,f]=(0,G.useState)(``),[p,m]=(0,G.useState)(!1),[h,g]=(0,G.useState)(``),_=(0,G.useRef)(null),v=(0,G.useId)(),y=(0,G.useId)(),b=a??y,x=(0,G.useRef)(null),S=(0,G.useMemo)(()=>e=>{x.current&&clearTimeout(x.current),e.trim()&&m(!0),x.current=setTimeout(()=>{n(e),m(!1),x.current=null},300)},[n]),C=(0,G.useMemo)(()=>{if(!e||e.length===0)return[];let t=new Date(new Date().getTime()+2592e6),n=new Set,r=e.reduce((e,r)=>{if(n.has(r.key))return e;let i=`routeStart`in r&&r.routeStart&&r.routeStart>t?{...r,isNewRoute:!0}:r;return n.add(r.key),[...e,i]},[]);if(d?.trim()){let e=d.toLowerCase().trim();r=r.filter(t=>{let n=t;return!!(n.iata_code?.toLowerCase().includes(e)||n.city?.toLowerCase().includes(e)||n.name?.toLowerCase().includes(e)||n.country_code?.toLowerCase().includes(e)||n.state?.toLowerCase().includes(e))}),r.sort((t,n)=>{let r=t,i=n,a=r.iata_code?.toLowerCase()||``,o=i.iata_code?.toLowerCase()||``,s=r.city?.toLowerCase()||``,c=i.city?.toLowerCase()||``,l=e.toLowerCase();return a===l&&o!==l?-1:o===l&&a!==l?1:a.startsWith(l)&&!o.startsWith(l)?-1:o.startsWith(l)&&!a.startsWith(l)?1:s.startsWith(l)&&!c.startsWith(l)?-1:c.startsWith(l)&&!s.startsWith(l)?1:a.includes(l)&&!o.includes(l)?-1:o.includes(l)&&!a.includes(l)?1:0})}else r=r.slice(0,250);return r.sort((e,t)=>{let n=e,r=t,i=n.city?.toLowerCase()||``,a=r.city?.toLowerCase()||``;if(i===a){let e=n.iata_code?.toLowerCase()||``,t=r.iata_code?.toLowerCase()||``;return e.localeCompare(t)}return i.localeCompare(a)}),r.slice(0,nB)},[d,e]),w=(0,G.useMemo)(()=>{let e={};return C.forEach((t,n)=>{if(t.type===`airport`){let r=t.city?.charAt(0).toUpperCase();r&&!e[r]&&(e[r]=n)}}),e},[C]),T=e=>{let t=w[e];if(t===void 0||!_.current)return;let n=_.current.querySelector(`ul`);if(!n)return;let r=n.children[t];if(!r)return;let i=n.getBoundingClientRect(),a=r.getBoundingClientRect(),o=n.scrollTop,s=a.top-i.top+o;n.scrollTo({top:s,behavior:`smooth`})},E=(0,G.useMemo)(()=>Array.from({length:26},(e,t)=>String.fromCharCode(65+t)),[]),D=(e,t)=>{e.preventDefault(),e.stopPropagation(),T(t)},O=e=>{let n=e;if(t.length>1)return n.iata_code||``;let r=n.country===`US`&&n.state?`, ${n.state}`:``;return`${n.city}${r} (${n.iata_code})`},k=e=>{let t=e.ownerDocument,n=typeof Proxy==`function`&&!Object.isSealed(new Proxy({},{})),r={document:t,addEventListener:t.addEventListener.bind(e),removeEventListener:t.removeEventListener.bind(e),Node:window.Node,Element:window.Element,HTMLElement:window.HTMLElement,SVGElement:window.SVGElement};return n?new Proxy(r,{get(e,t){return e[t]}}):r},{getSelectedItemProps:A,getDropdownProps:j,removeSelectedItem:M}=lI({selectedItems:t,onStateChange({selectedItems:e,type:t}){t===lI.stateChangeTypes.FunctionRemoveSelectedItem&&r(e)}});function N(){let e=i?.trim().toLowerCase();return e?e.endsWith(`s`)?e:e===`destination`?`destinations`:e===`origin`?`origins`:`${e}s`:`locations`}function P(e){let t=O(e)||`Selection`;g(``),queueMicrotask(()=>{g(`${t} has been removed from the selected ${N()}.`)})}function ee(e){P(e),M(e)}let{isOpen:F,getMenuProps:te,getInputProps:ne,getItemProps:I,selectedItem:re}=zF({environment:u?k(u):void 0,items:C,itemToString:e=>e?O(e):``,defaultHighlightedIndex:0,selectedItem:null,inputValue:d,onStateChange({inputValue:e,type:t,selectedItem:n}){switch(t){case zF.stateChangeTypes.InputKeyDownEnter:case zF.stateChangeTypes.ItemClick:n&&(r([n]),f(``));break;case zF.stateChangeTypes.InputChange:{let t=e??``;f(t),S(t);break}case zF.stateChangeTypes.InputBlur:}}}),L=!!l,ie=t.length>0,ae=(F||d.trim()&&C.length>0)&&C.length>10&&Object.keys(w).length>3,oe=F||d.trim().length>0&&C.length>0;(0,G.useEffect)(()=>{let e=u?.host;if(e instanceof HTMLElement&&oe)return $z(e),()=>eB(e)},[oe,u]);let se=i?`${i}, search airports and places`:`Search airports and places`;return(0,K.jsxs)(`div`,{className:`aone:w-full aone:h-full aone:relative aone:z-10`,role:`group`,"aria-disabled":l?!0:void 0,children:[i?(0,K.jsxs)(`label`,{htmlFor:b,className:`aone:sr-only`,children:[i,o?` (required)`:``]}):null,(0,K.jsxs)(`div`,{className:(0,q.default)({"aone:bg-white aone:text-gray-700 aone:rounded-lg aone:gap-2 aone:items-center aone:py-2 aone:px-3 aone:h-[44px] aone:box-border aone:w-full aone:overflow-hidden aone:grid":!0,"aone:grid-cols-[24px_1fr]":t.length===0,"aone:grid-cols-[24px_auto_1fr]":t.length===1,"aone:grid-cols-[24px_auto_auto_1fr]":t.length===2,"aone:grid-cols-[24px_auto_auto_auto_1fr]":t.length===3,"aone:border-2 aone:border-gray-200 aone:focus-within:border-primary":!0,"aone:opacity-60 aone:cursor-not-allowed":!!l}),children:[c,t.map((e,t)=>(0,K.jsxs)(`span`,{...A({selectedItem:e,index:t}),className:`aone:bg-gray-200 aone:rounded aone:px-1 aone:focus:bg-gray-400 aone:whitespace-nowrap aone:text-ellipsis aone:shrink-0 aone:text-sm aone:flex aone:items-center`,children:[(0,K.jsx)(`span`,{className:`aone:overflow-hidden aone:grow`,children:O(e)}),!e.disabled&&(0,K.jsx)(`button`,{type:`button`,disabled:!!l||!!e.disabled,className:(0,q.default)(`aone:ml-2 aone:text-base aone:leading-[20px] aone:rounded aone:px-1 aone:transition-colors`,{"aone:hover:bg-gray-300 aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-offset-2 aone:focus-visible:ring-gray-700":!l&&!e.disabled,"aone:cursor-not-allowed aone:opacity-60":!!l}),"aria-label":`Remove ${O(e)}`,"data-testid":`schedule-autocomplete-remove-item-button`,onClick:t=>{t.stopPropagation(),!l&&ee(e)},children:`×`})]},t)),l&&(0,K.jsx)(`span`,{id:v,className:`aone:sr-only`,children:`Field is locked`}),(()=>{let e=ne({...j({preventKeyAction:F}),id:b,role:`combobox`,"aria-label":se,onKeyDown:e=>{if(e.key===`Backspace`&&!d&&t.length>0&&!l){let e=t[t.length-1];ee(e)}}});return(0,K.jsx)(`input`,{className:`aone:outline-none aone:disabled:bg-transparent aone:text-base aone:placeholder:text-gray-700 aone:placeholder:opacity-100`,placeholder:L?``:s,...e,"aria-required":o||void 0,"aria-describedby":l?v:void 0,readOnly:ie,disabled:L})})()]}),(0,K.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`aone:sr-only`,children:h}),(F||d.trim()&&C.length>0)&&(0,K.jsx)(`div`,{className:`aone:absolute aone:w-full aone:min-w-full aone:bg-white aone:text-gray-900 aone:mt-2 aone:rounded-lg aone:shadow-md aone:p-0 aone:z-10`,children:(0,K.jsx)(`div`,{className:`aone:relative aone:w-full aone:overflow-hidden`,children:(0,K.jsxs)(`div`,{...te({className:`aone:flex aone:flex-col aone:min-w-0 aone:overflow-hidden`}),children:[ae&&(0,K.jsx)(`div`,{className:`aone:flex aone:flex-wrap aone:gap-x-0.5 aone:gap-y-1 aone:justify-center aone:border-b aone:border-gray-200 aone:bg-gray-50 aone:px-2 aone:py-1.5`,role:`navigation`,"aria-label":`Jump to results by letter`,children:E.map(e=>{let t=w[e]!==void 0;return(0,K.jsx)(`button`,{type:`button`,onClick:n=>t?D(n,e):void 0,className:(0,q.default)({"aone:min-w-5 aone:text-xs aone:font-medium aone:px-0.5 aone:py-0.5 aone:rounded aone:transition-colors aone:cursor-pointer aone:text-center aone:shrink-0 aone:leading-none":!0,"aone:text-gray-600 aone:hover:text-blue-600 aone:hover:bg-blue-50":t,"aone:text-gray-300 aone:cursor-default":!t}),"data-testid":`schedule-autocomplete-letter-${e.toLowerCase()}`,title:t?`Jump to ${e}`:`No results for ${e}`,disabled:!t,children:e},e)})}),(0,K.jsx)(`div`,{className:`aone:min-w-0`,ref:_,children:(0,K.jsxs)(`ul`,{className:`aone:text-gray-900 aone:max-h-[600px] aone:overflow-y-auto aone:overflow-x-hidden aone:w-full`,children:[p&&(0,K.jsx)(`li`,{className:`aone:py-4 aone:px-3 aone:text-center aone:text-gray-500`,children:(0,K.jsxs)(`div`,{className:`aone:flex aone:items-center aone:justify-center aone:gap-2`,children:[(0,K.jsx)(`div`,{className:`aone:animate-spin aone:rounded-full aone:h-4 aone:w-4 aone:border-b-2 aone:border-primary`}),(0,K.jsx)(`span`,{children:`Searching airports...`})]})}),!p&&C.length>0&&C.map((e,n)=>{let r=e;return(0,K.jsxs)(`li`,{...I({item:e,index:n}),className:(0,q.default)({"aone:shadow-sm aone:py-2 aone:pl-3 aone:pr-2 aone:cursor-pointer aone:grid aone:grid-cols-[26px_1fr_40px] aone:gap-2 aone:justify-start aone:items-center aone:relative":!0,"aone:font-bold":re===e}),children:[(0,K.jsx)(`div`,{className:`aone:w-6 aone:h-6 aone:relative aone:flex aone:items-center aone:justify-center`,children:r.airlineCodes&&r.airlineCodes.length>0&&(0,K.jsx)(K.Fragment,{children:r.airlineCodes.length===1?(0,K.jsx)(`img`,{src:`https://content.r9cdn.net/rimg/provider-logos/airlines/v/${r.airlineCodes[0]}.png`,alt:r.airlineCodes[0],className:`aone:w-6 aone:h-6 aone:object-contain`},r.airlineCodes[0]):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(iN,{icon:BE,className:`aone:w-6 aone:h-6 aone:text-gray-600`,title:`${r.airlineCodes.length} airlines`}),(0,K.jsx)(`span`,{className:`aone:absolute aone:right-0 aone:bg-blue-600 aone:text-white aone:text-[9px] aone:font-semibold aone:leading-none aone:px-1 aone:py-0.5 aone:rounded-full aone:min-w-[16px] aone:h-[16px] aone:flex aone:items-center aone:justify-center aone:shadow-sm aone:border aone:border-white`,style:{bottom:`-8px`},title:`${r.airlineCodes.length} airlines`,children:r.airlineCodes.length})]})})}),(0,K.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,K.jsx)(`div`,{className:`aone:gap-2 aone:flex aone:items-end`,children:(0,K.jsxs)(`span`,{className:(0,q.default)({"aone:font-medium aone:text-sm aone:text-gray-900 aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis aone:shrink":!0}),children:[r.city,r.country_code===`US`&&r.state?`, ${r.state}`:``]})}),(0,K.jsxs)(`span`,{className:(0,q.default)({"aone:text-sm aone:text-gray-600":!0}),children:[r.iata_code,` -`,` `,r.stops===0?`Nonstop Flight`:`One Stop`,`routeStart`in r&&r.routeStart&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`br`,{}),(0,K.jsx)(`span`,{className:(0,q.default)({"aone:text-sm aone:font-bold aone:text-green-600 aone:whitespace-nowrap":!0}),children:e.isNewRoute?`Route Starts `+r.routeStart.toLocaleDateString(`en-US`,{month:`2-digit`,day:`2-digit`,year:`2-digit`}):``})]})]})]}),(0,K.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-4`,children:(0,K.jsx)(`input`,{type:`checkbox`,className:`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border aone:border-gray-700 aone:bg-white`,defaultChecked:!!t.find(t=>t.key===e.key)})})]},`${e.key}-${n}`)}),!p&&C.length===0&&d.trim()&&(0,K.jsxs)(`li`,{className:`aone:shadow-sm aone:py-2 aone:pl-3 aone:pr-2 aone:grid aone:grid-cols-[26px_1fr_40px] aone:gap-2 aone:justify-start aone:items-center`,children:[(0,K.jsx)(`div`,{className:`aone:w-6 aone:h-6 aone:relative aone:flex aone:items-center aone:justify-center`,children:(0,K.jsx)(iN,{icon:XE,className:`aone:w-5 aone:h-5 aone:text-gray-300`})}),(0,K.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,K.jsxs)(`span`,{className:`aone:font-medium aone:text-sm aone:text-gray-900 aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:[`No airports found for`,(0,K.jsx)(`span`,{className:`aone:ml-1 aone:font-semibold`,children:d})]}),(0,K.jsx)(`span`,{className:`aone:text-sm aone:text-gray-600`,children:`Try a different search term`})]}),(0,K.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-4`})]})]})})]})})})]})}function iB(...e){return _E(Hw(e))}function aB({className:e,...t}){return(0,K.jsx)(I_,{role:`status`,"aria-label":`Loading`,className:iB(`aone:size-4 aone:animate-spin`,e),...t})}var oB=G.forwardRef(({open:e,onOpenChange:t,children:n,title:r,className:i,...a},o)=>{let s=(0,G.useRef)(null);return(0,G.useImperativeHandle)(o,()=>s.current),(0,G.useEffect)(()=>{let n=s.current;if(!n)return;e&&!n.open&&n.showModal(),!e&&n.open&&n.close();let r=()=>document.documentElement.style.overflow=`hidden`,i=()=>document.documentElement.style.removeProperty(`overflow`);e?r():i();let a=()=>{i(),t(!1)},o=e=>{e.preventDefault(),t(!1)};return n.addEventListener(`close`,a),n.addEventListener(`cancel`,o),()=>{n.removeEventListener(`close`,a),n.removeEventListener(`cancel`,o),i()}},[e,t]),(0,K.jsxs)(`dialog`,{ref:s,className:`ao-dialog ${i??``}`,...a,children:[r&&(0,K.jsx)(`h2`,{id:`ao-title`,className:`aone:text-lg aone:font-semibold`,children:r}),(0,K.jsx)(`div`,{className:`ao-dialog__body`,children:n})]})});oB.displayName=`TopLayerDialog`;function sB({...e}){return(0,K.jsx)(vx,{"data-slot":`dialog`,...e})}function cB({...e}){return(0,K.jsx)(Sx,{"data-slot":`dialog-portal`,...e})}function lB({className:e,...t}){return(0,K.jsx)(wx,{"data-slot":`dialog-overlay`,className:vE(`aone:fixed aone:inset-0 aone:z-50 aone:bg-black/50 aone:data-[state=closed]:animate-out aone:data-[state=closed]:fade-out-0 aone:data-[state=open]:animate-in aone:data-[state=open]:fade-in-0`,e),...t})}function uB({className:e,children:t,showCloseButton:n=!0,portalContainer:r,overlayClassName:i,...a}){return(0,K.jsxs)(cB,{container:r??void 0,"data-slot":`dialog-portal`,children:[(0,K.jsx)(lB,{className:i}),(0,K.jsxs)(Ox,{"data-slot":`dialog-content`,className:vE(`aone:fixed aone:top-[50%] aone:left-[50%] aone:z-50 aone:grid aone:w-full aone:max-w-[calc(100%-2rem)] aone:translate-x-[-50%] aone:translate-y-[-50%] aone:gap-4 aone:rounded-lg aone:border aone:bg-background aone:p-6 aone:shadow-lg aone:duration-200 aone:outline-none aone:data-[state=closed]:animate-out aone:data-[state=closed]:fade-out-0 aone:data-[state=closed]:zoom-out-95 aone:data-[state=open]:animate-in aone:data-[state=open]:fade-in-0 aone:data-[state=open]:zoom-in-95 aone:sm:max-w-lg`,e),...a,children:[t,n&&(0,K.jsxs)(Px,{"data-slot":`dialog-close`,className:`aone:absolute aone:top-4 aone:right-4 aone:z-60 aone:pointer-events-auto aone:rounded-xs aone:bg-white/90 aone:opacity-70 aone:ring-offset-background aone:transition-opacity aone:hover:opacity-100 aone:focus:outline-hidden aone:disabled:pointer-events-none aone:data-[state=open]:bg-accent aone:data-[state=open]:text-muted-foreground aone:[&_svg]:pointer-events-none aone:[&_svg]:shrink-0 aone:[&_svg:not([class*=size-])]:size-4`,children:[(0,K.jsx)(z_,{}),(0,K.jsx)(`span`,{className:`aone:sr-only`,children:`Close`})]})]})]})}function dB({className:e,...t}){return(0,K.jsx)(Mx,{"data-slot":`dialog-title`,className:vE(`aone:text-lg aone:leading-none aone:font-semibold`,e),...t})}function fB({...e}){return(0,K.jsx)(ww,{"data-slot":`popover`,...e})}function pB({className:e,align:t=`center`,sideOffset:n=4,portalContainer:r,...i}){return(0,K.jsx)(Mw,{container:r,children:(0,K.jsx)(Pw,{"data-slot":`popover-content`,align:t,sideOffset:n,className:vE(`aone:z-50 aone:w-72 aone:origin-(--radix-popover-content-transform-origin) aone:rounded-md aone:border aone:bg-popover aone:p-4 aone:text-popover-foreground aone:shadow-md aone:outline-hidden aone:data-[side=bottom]:slide-in-from-top-2 aone:data-[side=left]:slide-in-from-right-2 aone:data-[side=right]:slide-in-from-left-2 aone:data-[side=top]:slide-in-from-bottom-2 aone:data-[state=closed]:animate-out aone:data-[state=closed]:fade-out-0 aone:data-[state=closed]:zoom-out-95 aone:data-[state=open]:animate-in aone:data-[state=open]:fade-in-0 aone:data-[state=open]:zoom-in-95`,e),...i})})}function mB({...e}){return(0,K.jsx)(Ew,{"data-slot":`popover-anchor`,...e})}var hB=768;function gB(){let[e,t]=G.useState(()=>typeof window<`u`&&window.innerWidth<hB);return G.useEffect(()=>{let e=window.matchMedia(`(max-width: 767px)`),n=()=>{t(window.innerWidth<hB)};return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}var _B=`aone:text-[#16A34A]`,vB=`aone:text-[#5895F7]`;function yB({date:e,startDate:t,endDate:n,onChange:r,onHover:i,stops:a,onlyDirects:o,previewDate:s,referenceDates:c,minDate:l}){let u=xl(new Date),d=l||u,f=t?Tl(e,t):!1,p=t&&n?bu(e,xl(t))&&xu(e,n):!1,m=n?Tl(e,n):!1,h=xu(e,d),g=s&&!f&&!m?Tl(e,s):!1,_=c?.filter(t=>Tl(xl(e),xl(t.date)))||[],v=!1,y=o&&a!==0?null:a;return o&&a!==0&&(v=!0),(0,K.jsx)(`div`,{className:(0,q.default)({"aone:w-14 aone:h-14 aone:flex aone:flex-col aone:items-center aone:justify-start aone:cursor-pointer":!0,"aone:text-white":f||m,"aone:bg-gray-600 aone:rounded-sm":f||m,"aone:bg-gray-200":p&&!!t&&!!n,"aone:text-[#565656]":!f&&!m,"aone:ring-2 aone:ring-primary":g,"aone:ring-2 aone:ring-blue-500 aone:ring-opacity-75 aone:bg-blue-50":_.length>0&&!f&&!m,"aone:cursor-not-allowed":h||v,"aone:relative aone:hover:ring-2 aone:hover:ring-blue-500 aone:hover:rounded-sm":!h&&!v,"aone:relative aone:after:absolute aone:after:bg-gray-600 aone:after:top-0 aone:after:bottom-0 aone:after:left-0 aone:after:right-0 aone:after:rounded-sm":f,"aone:before:absolute aone:before:left-1/2 aone:before:right-0 aone:before:top-0 aone:before:bottom-0 aone:before:bg-gray-200":f&&!!n,"aone:rounded-none":p,"aone:relative aone:after:absolute aone:after:bg-gray-600 aone:after:top-0 aone:after:bottom-0 aone:after:left-0 aone:after:right-0 aone:after:rounded-sm aone:before:absolute aone:before:left-0 aone:before:right-1/2 aone:before:top-0 aone:before:bottom-0 aone:before:bg-gray-200":m}),role:`gridcell`,tabIndex:!h&&!v?0:-1,"aria-label":(()=>{let t=`${e.toLocaleDateString(`en-US`,{weekday:`long`})}, ${e.toLocaleDateString(`en-US`,{month:`long`})} ${e.getDate()}, ${e.getFullYear()}`;if(f?t+=`, selected as start date`:m?t+=`, selected as end date`:p?t+=`, within selected date range`:g&&(t+=`, preview date`),h?t+=`, not available (before minimum date)`:v&&(t+=`, not available (no direct flights)`),y===0?t+=`, direct flights available`:y===1&&(t+=`, one-stop flights available`),_.length>0){let e=_.map(e=>e.label).join(`, `);t+=`, reference dates: ${e}`}return t})(),"aria-selected":f||m||p,"aria-disabled":h||v,"data-preview":g?`true`:void 0,onClick:()=>{!h&&!v&&r(new Date(e))},onMouseOver:()=>{!h&&!v&&i(new Date(e))},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&!h&&!v&&(t.preventDefault(),r(new Date(e)))},children:(0,K.jsxs)(`span`,{className:(0,q.default)({"aone:relative aone:z-20 aone:font-semibold aone:leading-[16px] aone:flex aone:flex-col aone:justify-start aone:items-center aone:gap-1 aone:pt-2":!0,"aone:opacity-50":h||v}),children:[(0,K.jsx)(`span`,{children:e.getDate()}),y===0&&(0,K.jsx)(`span`,{className:(0,q.default)({"aone:text-[9px] aone:font-light aone:leading-none aone:whitespace-nowrap":!0,[_B]:!0}),"aria-label":`Nonstop flights available`,children:`Nonstop`}),y===1&&(0,K.jsx)(`span`,{className:(0,q.default)({"aone:text-[9px] aone:font-light aone:leading-none aone:whitespace-nowrap":!0,[vB]:!0}),"aria-label":`One-stop flights available`,children:`1 Stop`}),_.map((e,t)=>(0,K.jsx)(`div`,{className:(0,q.default)({"aone:text-[10px] aone:font-light aone:text-blue-700 aone:leading-tight aone:bg-blue-100 aone:px-1 aone:rounded aone:whitespace-nowrap":!0}),"aria-label":`Reference date: ${e.label}`,children:e.label},`${e.label}-${t}`))]})})}function bB({origin:e,previewDate:t,initialDate:n,startDate:r,endDate:i,oneWay:a,onlyDirects:o,onMonthViewChange:s,onChange:c,flightCalendar:l,referenceDates:u,minDate:d}){let[f,p]=(0,G.useState)(Ol(n)),m=gu(f,`MMMM yyyy`),h=gl(f),g=a?null:i;(0,G.useEffect)(()=>{r&&queueMicrotask(()=>p(Ol(r)))},[r]),(0,G.useEffect)(()=>{t&&queueMicrotask(()=>p(Ol(t)))},[t]),(0,G.useEffect)(()=>{let e=gl(f);s(e,dl(e,42))},[f,s]);let _=Array(42).fill(0).map((e,t)=>dl(h,t));return(0,K.jsxs)(`div`,{className:`aone:w-max aone:max-[767px]:w-full aone:text-[14px] aone:max-w-[100vw] aone:md:px-2 aone:md:pt-2 aone:lg:m-2`,role:`application`,"aria-label":`Calendar`,children:[(0,K.jsx)(`div`,{className:`aone:px-3 aone:py-1 aone:md:px-4 aone:md:py-2 aone:flex aone:gap-4`,children:(0,K.jsxs)(`div`,{className:`aone:flex aone:flex-grow aone:justify-between aone:items-center aone:text-gray-700`,children:[(0,K.jsx)(`button`,{type:`button`,className:`aone:w-8 aone:h-8 aone:bg-white aone:rounded-full aone:flex aone:items-center aone:justify-center aone:text-gray-700 aone:p-0`,onClick:()=>p(Pd(f,{months:1})),"aria-label":`Previous month, go to ${gu(Pd(f,{months:1}),`MMMM yyyy`)}`,"data-testid":`calendar-previous-month-button`,children:(0,K.jsx)(kE,{})}),(0,K.jsx)(`div`,{className:`aone:text-base aone:font-bold aone:mx-2`,"aria-live":`polite`,"aria-label":`Current month: ${m}`,children:m}),(0,K.jsx)(`button`,{type:`button`,className:`aone:w-8 aone:h-8 aone:bg-white aone:rounded-full aone:flex aone:items-center aone:justify-center aone:text-gray-700 aone:p-0`,onClick:()=>p(pl(f,{months:1})),"aria-label":`Next month, go to ${gu(pl(f,{months:1}),`MMMM yyyy`)}`,"data-testid":`calendar-next-month-button`,children:(0,K.jsx)(AE,{})})]})}),(0,K.jsx)(`div`,{className:`aone:grid aone:grid-cols-7 aone:border-b`,role:`rowgroup`,"aria-label":`Weekday headers`,children:Fp.map((e,t)=>(0,K.jsx)(`div`,{className:`aone:min-w-0 aone:w-full aone:md:w-10 aone:h-7 aone:md:h-8 aone:flex aone:items-center aone:justify-center aone:text-black aone:font-bold aone:text-[#5b5b5b] aone:text-[13px] aone:md:text-[16px]`,"aria-hidden":`true`,children:e},`${e}-${t}`))}),(0,K.jsx)(`div`,{className:`aone:grid aone:grid-cols-7 aone:grid-rows-6 aone:pt-1 aone:md:pt-2 aone:pb-4 aone:md:pb-2 `,role:`grid`,"aria-label":`Calendar for ${m}`,children:_.map(n=>{let i=gu(n,`yyyy-MM-dd`),a=l?.[i];return(0,K.jsx)(yB,{date:n,startDate:r,endDate:g,previewDate:t,onChange:c,onHover:()=>{},origin:e,onlyDirects:o,stops:a?.stops,flightState:a?.flightsState,referenceDates:u,minDate:d},n.toISOString())})})]})}function xB({message:e,className:t,buttonRef:n}){let r=(0,G.useId)(),[i,a]=(0,G.useState)(!1);return(0,K.jsxs)(`span`,{className:(0,q.default)(`aone:relative aone:inline-flex`,t),onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[(0,K.jsx)(`button`,{type:`button`,ref:n,className:`aone:inline-flex aone:items-center aone:justify-center aone:h-4 aone:w-4 aone:cursor-pointer aone:rounded-sm aone:text-red-500 aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-red-500 aone:focus:ring-offset-1`,"data-testid":`error-icon`,"aria-label":`Validation error: ${e}`,"aria-expanded":i,"aria-controls":r,"aria-describedby":i?r:void 0,onFocus:()=>a(!0),onBlur:()=>a(!1),onClick:()=>a(e=>!e),children:(0,K.jsx)(iN,{icon:QE,"aria-hidden":`true`,className:`aone:h-4 aone:w-4`})}),i&&(0,K.jsx)(`div`,{id:r,role:`tooltip`,className:`aone:absolute aone:z-20 aone:top-full aone:left-1/2 aone:-translate-x-1/2 aone:mt-2 aone:bg-red-600 aone:text-white aone:text-xs aone:rounded aone:px-2 aone:py-1 aone:whitespace-nowrap`,children:e})]})}var SB=e=>{let t=e.match(/\d+/g)??[];if(t.length===0)return null;let n=parseInt(t[0].slice(0,2),10);if(Number.isNaN(n)||n<1||n>12)return null;let r=t[1]?.slice(0,2),i=Number(r??`1`);(Number.isNaN(i)||i<1||i>31)&&(i=1);let a=new Date().getFullYear(),o=t[2],s=a;if(o){let e=parseInt(o,10);s=o.length<=2?2e3+e:e}let c=new Date(s,n-1,i);return Dl(c)?xl(c):null},CB=/^\d{2}\/\d{2}\/\d{2}$/,wB=e=>e.toLocaleDateString(`en-US`,{year:`2-digit`,month:`2-digit`,day:`2-digit`}),TB=(e,t=``)=>{let n=e.length<t.length,r=e.replace(/\D/g,``).slice(0,8);if(!n&&e.endsWith(`/`)){let t=e.slice(0,-1).split(`/`);if(t.length===1){let e=t[0];if(e&&e.length===1)return`0${e}/`}if(t.length===2){let e=t[0],n=t[1];if(n&&n.length===1)return`${(e??``).padStart(2,`0`)}/${`0${n}`}/`}}if(r.length===1&&t===``&&!n&&parseInt(r,10)>=3)return`0${r}/`;if(e.indexOf(`/`)===1&&r.length>=1){let e=r.slice(0,1).padStart(2,`0`),t=r.slice(1);switch(t.length){case 0:return n?e:`${e}/`;case 1:return`${e}/${t}`;case 2:return n?`${e}/${t}`:`${e}/${t}/`;default:return`${e}/${t.slice(0,2)}/${t.slice(2).slice(-2).padStart(2,`0`)}`}}switch(r.length){case 0:return``;case 1:return r;case 2:return n?e:`${r}/`;case 3:{let e=r.slice(0,2),i=r.slice(2);return!n&&t.replace(/\D/g,``).length===2&&/^\d{2}\/$/.test(t)&&parseInt(i,10)>=4?`${e}/0${i}/`:`${e}/${i}`}case 4:{let e=r.slice(0,2),t=r.slice(2,4);return n?`${e}/${t}`:`${e}/${t}/`}default:return`${r.slice(0,2)}/${r.slice(2,4)}/${r.slice(4).slice(-2)}`}},EB=e=>{let t=e.trim();if(t===``)return``;let n=(t.match(/\d+/g)??[]).slice(0,3);if(n.length===0)return``;let r=n[0].slice(-2).padStart(2,`0`);if(n.length===1)return r;let i=n[1].slice(-2).padStart(2,`0`);return n.length===2?`${r}/${i}`:`${r}/${i}/${n[2].slice(-2).padStart(2,`0`)}`},DB=e=>{if(!CB.test(e))return null;let t=Ad(e,`MM/dd/yy`,new Date);return Dl(t)&&wB(xl(t))===e?xl(t):null};function OB({origin:e,destination:t,onChange:n,onMonthViewChange:r,oneWay:i,className:a,primaryColor:o,secondaryColor:s,startDateLabel:c=`Start Date`,endDateLabel:l=`End Date`,startDateRequired:u=!1,endDateRequired:d=!1,flightCalendar:f,flightCalendarStatus:p,onlyDirects:m,initialStartDate:h,initialEndDate:g,referenceDates:_,minDate:v,showButtons:y=!0}){let b=(0,G.useRef)(null),x=(0,G.useRef)(null),S=(0,G.useRef)(null),C=(0,G.useRef)(null),w=(0,G.useRef)(null),T=(0,G.useRef)(null),E=(0,G.useRef)(0),D=(0,G.useRef)(!1),O=gB(),[k,A]=(0,G.useState)(null);(0,G.useLayoutEffect)(()=>{if(!b.current)return;let e=b.current.getRootNode();if(!(e instanceof ShadowRoot))return;let t=document.createElement(`div`);return e.appendChild(t),queueMicrotask(()=>A(t)),()=>{t.parentNode&&t.parentNode.removeChild(t)}},[]);let[j,M]=(0,G.useState)(``),[N,P]=(0,G.useState)(``),[ee,F]=(0,G.useState)(null),[te,ne]=(0,G.useState)(null),[I,re]=(0,G.useState)(h||null),[L,ie]=(0,G.useState)(g||null),[ae,oe]=(0,G.useState)(!1),[se,ce]=(0,G.useState)(h||null),[le,R]=(0,G.useState)(``),[ue,de]=(0,G.useState)(``),[fe]=(0,G.useState)(()=>h||new Date),pe=(0,G.useRef)(n),me=(0,G.useRef)(!1),he=()=>Date.now()<E.current,ge=()=>{he()||D.current||(oe(!0),de(``),queueMicrotask(()=>{de(`Calendar for date selection opened. Use arrow keys to choose a date, or keep typing in the date field.`)}))},_e=()=>{let e=w.current;e&&(D.current=!0,requestAnimationFrame(()=>{e.focus(),requestAnimationFrame(()=>{D.current=!1})}))},ve=()=>{E.current=Date.now()+250,oe(!1),de(``)},ye=e=>{e?ge():ve()},be=()=>{let e=T.current;e&&e.querySelector(`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`)?.focus()},xe=e=>{if(e.key!==`Tab`)return;let t=T.current;if(!t)return;let n=Array.from(t.querySelectorAll(`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`)).filter(e=>e.offsetParent!==null||e===document.activeElement);if(n.length===0)return;let r=n[0],i=n[n.length-1],a=document.activeElement;e.shiftKey&&a===r?(e.preventDefault(),i.focus()):!e.shiftKey&&a===i&&(e.preventDefault(),r.focus())};(0,G.useEffect)(()=>{ae?me.current=!0:me.current&&(me.current=!1,O&&_e())},[ae,O]),(0,G.useEffect)(()=>{pe.current=n},[n]),(0,G.useEffect)(()=>{i&&queueMicrotask(()=>{ie(null),P(``),ne(null)})},[i]),(0,G.useEffect)(()=>{queueMicrotask(()=>{!I&&h&&re(h),!L&&g&&ie(g)})},[h,g,I,L]);let Se=xl(new Date),Ce=fl(Se,6),we=e=>{M(e);let t=DB(e);e===``||!e?(F(null),re(null)):t?xu(t,Se)?(F(`Date cannot be in the past`),re(null)):bu(t,Ce)?(F(`Date must be within 6 months`),re(null)):v&&xu(t,v)?(F(`Date must be no earlier than `+v.toLocaleDateString()),re(null)):(F(null),re(t),ce(t),L&&xu(L,t)&&(ie(null),P(``))):(F(`Enter a date in MM/DD/YY format`),re(null))},Te=e=>{if(i)return;P(e);let t=DB(e);e===``||!e?(ne(null),ie(null)):t?xu(t,Se)?(ne(`Date cannot be in the past`),ie(null)):bu(t,Ce)?(ne(`Date must be within 6 months`),ie(null)):I?xu(t,I)?(ne(`Return date must be after departure`),ie(null)):v&&xu(t,v)?(ne(`Date must be no earlier than `+v.toLocaleDateString()),ie(null)):(ne(null),ie(t),ce(t)):(ne(`Enter departure date first`),ie(null)):(ne(`Enter a date in MM/DD/YY format`),ie(null))},Ee=()=>we(j),De=()=>Te(N),Oe=e=>{let t=e.getTime()<(I?.getTime()||0);I?!L&&t?re(e):L?I&&L&&(Tl(e,I)&&Tl(e,L)?(re(e),ie(null)):xu(e,L)&&xu(e,dl(I,3))?re(e):ie(e)):i?re(e):ie(e):re(e)},ke=()=>{re(null),ie(null),M(``),P(``),F(null),ne(null),ce(null),pe.current(null,null),R(``),queueMicrotask(()=>{R(`Date selection has been reset.`)})};(0,G.useEffect)(()=>{pe.current(I,L)},[I,L]),(0,G.useEffect)(()=>{queueMicrotask(()=>{I?(M(wB(I)),F(null)):ee||M(``)})},[I]),(0,G.useEffect)(()=>{queueMicrotask(()=>{L?(P(wB(L)),ne(null)):te||P(``)})},[L]);let Ae={};o&&(Ae[`--color-primary`]=o),s&&(Ae[`--color-secondary`]=s);let je=(0,G.useId)(),Me=`${je}-description`,Ne=`${je}-calendar-instructions`,Pe=(0,K.jsxs)(`div`,{ref:x,onClick:()=>{w.current||=S.current,ge()},className:(0,q.default)(`aone:relative aone:h-full aone:flex aone:flex-col aone:gap-4 aone:px-3 aone:py-2 aone:rounded-lg aone:bg-white aone:text-gray-700 aone:cursor-pointer`,`aone:@2xl:flex-row aone:@2xl:items-center`,{"aone:border-2 aone:border-primary":ae,"aone:border-2 aone:border-gray-200":!ae}),children:[(0,K.jsxs)(`fieldset`,{className:`aone:border-0 aone:p-0 aone:m-0 aone:@2xl:flex-1 aone:@2xl:pr-3`,children:[(0,K.jsx)(`legend`,{className:`aone:sr-only`,children:`Date range selection`}),(0,K.jsxs)(`div`,{className:`aone:flex aone:grow aone:items-center`,children:[(0,K.jsx)(`span`,{children:(0,K.jsx)(OE,{})}),(0,K.jsxs)(`div`,{className:`aone:relative aone:grow aone:min-w-0`,children:[(0,K.jsxs)(`label`,{htmlFor:`departure-date`,className:`aone:sr-only`,children:[c,u?` (required)`:``]}),(0,K.jsxs)(`div`,{className:`aone:relative aone:w-full`,children:[(0,K.jsx)(`input`,{ref:S,id:`departure-date`,type:`text`,name:`start-date`,value:j,"aria-invalid":ee?`true`:void 0,"aria-required":u||void 0,"aria-haspopup":`dialog`,"aria-expanded":ae,placeholder:`mm/dd/yy`,autoComplete:`off`,className:(0,q.default)(`aone:ml-2 aone:all-initial aone:focus:outline-none aone:disabled:bg-white aone:text-black aone:text-base aone:w-full aone:pr-1 aone:placeholder:text-gray-700 aone:placeholder:opacity-100`,{"aone:text-red-500 ":!!ee}),onChange:e=>{let t=TB(e.target.value,j);M(t),F(null),ce(SB(t)),pe.current(null,L)},onFocus:()=>{w.current=S.current,ge()},onBlur:e=>{let t=EB(e.target.value);M(t),we(t)},onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),Ee(),e.target.blur()):e.key===`Tab`&&!e.shiftKey&&ae&&(e.preventDefault(),be())}}),ee&&(0,K.jsx)(`span`,{className:`aone:absolute aone:right-2 aone:top-1/2 aone:-translate-y-1/2`,children:(0,K.jsx)(xB,{message:ee})})]})]})]})]}),!i&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`aone:absolute aone:left-2 aone:right-2 aone:top-1/2 aone:@2xl:top-2 aone:@2xl:bottom-2 aone:@2xl:left-1/2 aone:rounded-lg aone:h-[2px] aone:@2xl:h-[initial] aone:@2xl:w-[2px] aone:bg-gray-200`}),(0,K.jsxs)(`fieldset`,{className:`aone:border-0 aone:p-0 aone:m-0 aone:@2xl:flex-1 aone:@2xl:pl-3`,children:[(0,K.jsx)(`legend`,{className:`aone:sr-only`,children:`Return date selection`}),(0,K.jsxs)(`div`,{className:`aone:flex aone:grow aone:items-center`,children:[(0,K.jsx)(`span`,{className:`aone:@2xl:hidden`,children:(0,K.jsx)(OE,{})}),(0,K.jsxs)(`div`,{className:`aone:relative aone:grow aone:min-w-0`,children:[(0,K.jsxs)(`label`,{htmlFor:`return-date`,className:`aone:sr-only`,children:[l,d?` (required)`:``]}),(0,K.jsxs)(`div`,{className:`aone:relative aone:w-full`,children:[(0,K.jsx)(`input`,{ref:C,id:`return-date`,type:`text`,name:`end-date`,value:N,"aria-invalid":te?`true`:void 0,"aria-required":d||void 0,"aria-haspopup":`dialog`,"aria-expanded":ae,placeholder:`mm/dd/yy`,autoComplete:`off`,className:(0,q.default)(`aone:ml-2 aone:focus:outline-none aone:disabled:bg-white aone:text-black aone:text-base aone:w-full aone:pr-7 aone:placeholder:text-gray-700 aone:placeholder:opacity-100`,{"aone:text-red-500":!!te}),onChange:e=>{let t=TB(e.target.value,N);P(t),ne(null),ce(SB(t)),pe.current(I,null)},onFocus:()=>{w.current=C.current,ge()},onBlur:e=>{let t=EB(e.target.value);P(t),Te(t)},onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),De(),e.target.blur()):e.key===`Tab`&&!e.shiftKey&&ae&&(e.preventDefault(),be())}}),te&&(0,K.jsx)(`span`,{className:`aone:absolute aone:right-2 aone:top-1/2 aone:-translate-y-1/2`,children:(0,K.jsx)(xB,{message:te})})]})]})]})]})]})]});return(0,K.jsxs)(`div`,{id:`A1-DateRangePicker`,ref:b,className:a,style:Ae,role:`group`,"aria-label":`Date range picker`,"aria-describedby":Me,children:[O?(0,K.jsxs)(sB,{open:ae,onOpenChange:ye,children:[Pe,(0,K.jsxs)(oB,{className:`ao-dialog--calendar-light`,open:ae,onOpenChange:ye,role:`dialog`,"aria-modal":`true`,"aria-labelledby":je,"aria-describedby":Ne,children:[(0,K.jsx)(dB,{id:je,className:`aone:sr-only`,children:`Calendar for date selection`}),(0,K.jsx)(`div`,{id:Ne,className:`aone:sr-only`,children:`Use arrow keys to navigate dates. Press Enter or Space to select a date. Press Escape to close the calendar.`}),(0,K.jsx)(bB,{origin:e,destination:t,initialDate:fe,startDate:I,endDate:L,previewDate:se,onChange:Oe,onMonthViewChange:r,flightCalendar:f,flightCalendarStatus:p,onlyDirects:m,referenceDates:_,minDate:v},fe.toISOString()),y&&(0,K.jsxs)(`div`,{className:`aone:mt-3 aone:flex aone:justify-between aone:items-center aone:pt-0 aone:pb-1 aone:md:pb-2 aone:px-1`,children:[(0,K.jsx)(`button`,{type:`button`,className:`aone:bg-slate-700 aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-slate-800`,onClick:ke,"data-testid":`date-range-picker-reset-button`,children:`Reset`}),(0,K.jsx)(`button`,{type:`button`,className:`aone:bg-primary aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-primary`,onClick:ve,"data-testid":`date-range-picker-done-button`,children:`Done`})]})]})]}):(0,K.jsxs)(fB,{open:ae,onOpenChange:ye,children:[(0,K.jsx)(mB,{asChild:!0,children:Pe}),(0,K.jsx)(pB,{side:`bottom`,align:`center`,sticky:`always`,avoidCollisions:!1,onOpenAutoFocus:e=>{e.preventDefault()},onCloseAutoFocus:e=>{e.preventDefault(),_e()},onInteractOutside:e=>{let t=e.target;t&&x.current?.contains(t)&&e.preventDefault()},onKeyDown:xe,sideOffset:4,portalContainer:k,role:`dialog`,"aria-modal":`true`,"aria-label":`Calendar for date selection`,"aria-describedby":Ne,className:`aone:w-max aone:max-w-[100vw] aone:max-h-[calc(100dvh-1.5rem)] aone:overflow-y-auto aone:p-0 aone:bg-white aone:border aone:border-gray-300 aone:rounded-xl aone:shadow-lg aone:md:mt-2 aone:pb-2`,children:(0,K.jsxs)(`div`,{ref:T,children:[(0,K.jsx)(`div`,{id:Ne,className:`aone:sr-only`,children:`Use arrow keys to navigate dates. Press Enter or Space to select a date. Press Escape to close the calendar. Press Tab from the date field to move into this calendar.`}),(0,K.jsx)(bB,{origin:e,destination:t,initialDate:fe,startDate:I,endDate:L,previewDate:se,onChange:Oe,onMonthViewChange:r,flightCalendar:f,flightCalendarStatus:p,onlyDirects:m,referenceDates:_,minDate:v},fe.toISOString()),y&&(0,K.jsxs)(`div`,{className:`aone:mt-3 aone:md:mt-0 aone:flex aone:justify-between aone:items-center aone:pt-0 aone:pb-1 aone:md:pb-2 aone:px-5`,children:[(0,K.jsx)(`button`,{type:`button`,className:`aone:bg-slate-700 aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-slate-800`,onClick:ke,"data-testid":`date-range-picker-popover-reset-button`,children:`Reset`}),(0,K.jsx)(`button`,{type:`button`,className:`aone:bg-primary aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-primary`,onClick:ve,"data-testid":`date-range-picker-popover-done-button`,children:`Done`})]})]})})]}),(0,K.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`aone:sr-only`,children:ue}),(0,K.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`aone:sr-only`,children:le}),(0,K.jsx)(`div`,{id:Me,className:`aone:sr-only`,children:i?`Departure date input. Enter a date manually or open the calendar to pick one.`:`Departure and return date inputs. Enter dates manually or open the calendar to pick a date range.`})]})}function kB(e){let t=e[0];if(!t)return`not set`;if(t.type===`airport`){let e=t;return e.city||e.iata_code||`not set`}if(t.type===`place`){let e=t;return e.city||e.name||e.iata_code||`not set`}return`not set`}var AB=U({apiDomain:B(),locationId:B().optional(),origin:B().nullable().optional(),destination:B().nullable().optional(),destinations:B().optional(),primaryColor:B().optional(),secondaryColor:B().optional(),airlines:B().nullable().optional(),providers:B().nullable().optional(),workerUrl:B().optional(),theme:ec([`dark`,`light`]).optional(),defaultNearbyDatesForLowerFares:H().optional(),shadowRoot:Tc(e=>typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot).optional(),subscribingAirport:B().optional(),consentDataSharing:H().optional(),consentAnalytics:H().optional(),consentAdvertising:H().optional(),consentFunctional:H().optional(),onOriginChange:Tc(e=>typeof e==`function`).optional(),onDestinationChange:Tc(e=>typeof e==`function`).optional(),fmaDomain:B().optional(),hideBranding:H().optional(),hideCarButton:H().optional(),disableOrigins:H().optional(),disableDestinations:H().optional(),experimentId:B().optional(),autocompleteType:ec(Cp).optional(),arrivalAirportLabel:B().optional(),departureAirportLabel:B().optional(),departureDateLabel:B().optional(),returnDateLabel:B().optional(),channel:ec(up).optional(),widgetInstanceId:B().optional(),widgetType:B().optional()});function jB(e,t){return e?void 0:t??void 0}var MB=new Ig,NB=m_()||void 0;function PB(e){let t=``;for(let n=0;n<e.length;++n){let r=e[n];if(r){if(r.type===`place`){let e=r;e.iata_code?t+=e.iata_code:e.nearbyAirports&&e.nearbyAirports.length>0&&(t+=e.nearbyAirports[0].iata_code+`,nearby`)}r.type===`airport`&&(t+=r.iata_code),n<e.length-1&&e.length>1&&(t+=`,`)}}return t}function FB({apiDomain:e,origin:t,destination:n,airlines:r,providers:i,destinations:a,locationId:o,experimentId:s,widgetInstanceId:c,widgetType:l,departureDateLabel:u=`Departure Date`,returnDateLabel:d=`Return Date`,departureAirportLabel:f=`Origin`,arrivalAirportLabel:p=`Destination`,workerUrl:m=`https://worker-v2.flymyairport.com`,theme:h=`light`,channel:g,defaultNearbyDatesForLowerFares:_,shadowRoot:v,subscribingAirport:y,consentDataSharing:b=!0,consentAnalytics:x=!0,consentAdvertising:S=!0,consentFunctional:C=!0,onOriginChange:w=()=>{},onDestinationChange:T=()=>{},fmaDomain:E=`https://flymyairport.com`,hideBranding:D=!1,hideCarButton:O=!1,disableOrigins:k=!0,disableDestinations:A=!0,autocompleteType:j=xp.kayak}){let[M,N]=(0,G.useState)({origins:[],destinations:[],startDate:null,endDate:null,oneWay:!1,defaultNearbyDatesForLowerFares:!!_}),[P,ee]=(0,G.useState)(``),F=(0,G.useId)(),{clickId:te}=fh(),ne=(0,G.useMemo)(()=>{let e=PB(M.origins);return w(e),e},[M.origins,w]),I=(0,G.useMemo)(()=>{let e=PB(M.destinations);return T(e),e},[M.destinations,T]),re=M.origins[0],L=M.destinations[0],ie=!!(re?.itemType===W.METRO&&re?.iata_code),ae=!!(L?.itemType===W.METRO&&L?.iata_code);if(!mp.safeParse(o).success)throw Error(`Unable to parse location id`);if(s&&s!==`0`&&s!==`1`)throw Error(`experimentId must be 0 or 1`);let oe=t?.toLocaleUpperCase(),se=n?.toLocaleUpperCase(),ce=r?.split(`,`).map(e=>e.toLocaleUpperCase().trim()).filter(e=>e!==``),le=i?.split(`,`).map(e=>e.toLocaleUpperCase().trim()).filter(e=>e!==``),R=i===r&&i?.length===2&&r?.length===2,[ue,de]=(0,G.useState)(!1),fe=ue?!!se:!!oe,pe=ue?!!oe:!!se,[me,he]=(0,G.useState)(null),[ge,_e]=(0,G.useState)(null),ve=(0,G.useMemo)(()=>M.origins?.length&&M.destinations?.length&&M.startDate?M.endDate&&M.oneWay===!1?!0:!(!M.endDate&&M.oneWay===!1):!1,[M]),ye=e=>j===xp.schedule_data?(0,K.jsx)(rB,{shadowRoot:v,fieldLabel:e.fieldLabel,inputId:e.inputId,required:e.required,icon:e.icon,placeholder:e.placeholder,disabled:e.disabled,items:e.items,selectedItems:e.selectedItems,onInputChange:e.onInputChange,onSelectedItemsChange:e.onSelectedItemsChange}):(0,K.jsx)(tB,{dataTestId:e.dataTestId,fieldLabel:e.fieldLabel,inputId:e.inputId,required:e.required,shadowRoot:v,icon:e.icon,placeholder:e.placeholder,disabled:e.disabled,items:e.items,selectedItems:e.selectedItems,onInputChange:e.onInputChange,onSelectedItemsChange:e.onSelectedItemsChange}),{data:be,status:xe,setQuery:Se}=lL({suggestApiBaseUrl:NB,key:`origin-suggest`,apiDomain:e,airportIATA:I,providersArr:le,airlinesArr:ce,autocompleteType:j}),Ce=(0,G.useMemo)(()=>j===xp.schedule_data?be?.map((e,t)=>({...e,sectionIndex:t,type:`airport`,key:e.iata_code||`airport-${t}`}))||[]:(0,Yz.default)(be?.filter(e=>!!e.nearbyAirports?.length||e.itemType===W.METRO).map(e=>{let t=e.types.includes(`airport`);return[{...e,sectionIndex:0,type:t?`airport-place`:`place`,key:e.formatted_address},...e.nearbyAirports.map((e,n)=>({...e,itemType:W.AIRPORT,sectionIndex:t?-1:n,type:`airport`,key:`${e.iata_code}`}))]}).flat(),e=>e.key).filter((e,t,n)=>{if(e.type===`place`){let r=e;if(r.itemType===W.METRO&&r.iata_code)return!0;let i=n.at(t+1);if(!i||i.type!==`airport`)return!1}return!0}),[be,j]),{data:we,status:Te,setQuery:Ee}=lL({suggestApiBaseUrl:NB,key:`destination-suggest`,apiDomain:e,airportIATA:ne,providersArr:le||[],airlinesArr:ce||[],autocompleteType:j}),De=(0,G.useMemo)(()=>j===xp.schedule_data?we?.map((e,t)=>({...e,sectionIndex:t,type:`airport`,key:e.iata_code||`airport-${t}`}))||[]:(0,Yz.default)(we?.filter(e=>!!e.nearbyAirports?.length||e.itemType===W.METRO).map(e=>{let t=e.types.includes(`airport`);return[{...e,sectionIndex:0,type:t?`airport-place`:`place`,key:e.formatted_address},...e.nearbyAirports.map((e,n)=>({...e,itemType:W.AIRPORT,sectionIndex:t?-1:n,type:`airport`,key:`${e.iata_code}`}))]}).flat(),e=>e.key).filter((e,t,n)=>{if(e.type===`place`){let r=e;if(r.itemType===W.METRO&&r.iata_code)return!0;let i=n.at(t+1);if(!i||i.type!==`airport`)return!1}return!0}),[we,j]),Oe=(0,G.useMemo)(()=>me?wl([me,new Date]):null,[me]),ke=(0,G.useMemo)(()=>M.startDate?dl(M.startDate,1):null,[M.startDate]),Ae=(0,G.useMemo)(()=>jB(M.oneWay,ke),[M.oneWay,ke]),je=(0,G.useMemo)(()=>Oe&&Ae?Oe<=Ae?Oe:Ae:Oe??Ae,[Oe,Ae]),{data:Me,oppositeData:Ne,status:Pe}=VL({apiDomain:e,calendarApiBaseUrl:NB,params:(0,G.useMemo)(()=>({origin:ne,destination:I,startDate:je||void 0,endDate:ge||void 0,departureLocationType:ie?W.METRO:W.AIRPORT,arrivalLocationType:ae?W.METRO:W.AIRPORT}),[ne,I,je,ge,ie,ae])}),Fe=Pe,Ie=Pe;(0,G.useEffect)(()=>{if(oe&&sL({query:oe,searchType:vp.Flights}).then(e=>{let t=e.find(e=>e.id.toLowerCase()===oe.toLowerCase());if(t){let e={iata_code:t.id,city:t.cityonly,lat:t.lat,lng:t.lng,country_code:t.cc,name:t.displayname,itemType:t.isMetroOnly?W.METRO:W.AIRPORT};N(n=>({...n,origins:[{...e,type:`airport`,key:t.id,sectionIndex:-1,disabled:k}]}))}}),se){let e=se.split(`,`).map(e=>sL({query:e,searchType:vp.Flights}).then(t=>{let n=t.find(t=>t.id.toLowerCase()===e?.toLowerCase());return n?{iata_code:n.id,city:n.cityonly,lat:n.lat,lng:n.lng,country_code:n.cc,name:n.displayname,itemType:n.isMetroOnly?W.METRO:W.AIRPORT,type:`airport`,key:n.id,sectionIndex:-1,disabled:A}:null}));Promise.all(e).then(e=>{let t=e.filter(e=>e!==null);t.length>0&&N(e=>({...e,destinations:t}))})}},[oe,se,k,A]);let Le=(0,G.useCallback)((e,n)=>{N({...M,startDate:e,endDate:n}),(e||n)&&Am({name:`Flight Search - Date Range Change`,properties:{airport_iata:t||``,origin:ne,desination:I,destination:I,departure_date:e?.toISOString(),return_date:n?.toISOString()}})},[M,t,ne,I]),Re=(0,G.useCallback)((e,t)=>{he(t=>t&&t.getTime()===e.getTime()?t:e),_e(e=>e&&e.getTime()===t.getTime()?e:t)},[]),ze=fe||pe,Be=[fe?f:null,pe?p:null].filter(Boolean),Ve=Be.length>0?`Activating Switch will also change the locked ${Be.join(` and `)} field${Be.length>1?`s`:``}.`:``,z=()=>{let{origins:e,destinations:t}=M,n=kB(t),r=kB(e);de(e=>!e),N({...M,origins:t,destinations:e}),ee(``),queueMicrotask(()=>{ee(`${f} and ${p} have been switched. ${f} is ${n}. ${p} is ${r}.`)})},He=e=>{e.preventDefault();let n=new FormData(e.currentTarget),r=Object.fromEntries(n.entries()),i=ne,a=I,s=M.startDate,u=M.endDate,d=M.oneWay;if(!i||!a||!s||!u&&!d)throw Error(`All fields must be filled out`);let f=s.toISOString().split(`T`)[0],p=u?.toISOString().split(`T`)[0];if(r[`flexible-dates`]&&!R){let e=`-flexible-3days`;f+=e,p+=e}let h=r.cabin,_=r.pax,v=Hp({worker_domain:m,airport_iata:y||t||i,dep_iata:i||``,arr_iata:a+``||``,departDate:f||``,returnDate:p||``,cabin:h||void 0,pax:_||void 0,filterState:{providers:le?.join(`,`),airlines:ce?.join(`,`)},params:{enc_cid:te||``,...c?{a1_wid:c}:{},...l?{a1_wtype:l}:{},enc_lid:yp({airport:y||t||i,channel:g||`EMB`,action:`SEARCH`,userDefinedPage:o||`UNDEF`,originIATA:i,destinationIATA:a}),consent_data_sharing:b,consent_analytics:x,consent_advertising:S,consent_functional:C,departure_location_type:ie?W.METRO:W.AIRPORT,arrival_location_type:ae?W.METRO:W.AIRPORT,from_url:encodeURIComponent(window?.location.href)}});Am({name:`Flight Search - Search Button Clicked`,properties:{airport_iata:t||``,origin:ne,desination:I,destination:I,departure_date:s?.toISOString(),return_date:M.endDate?.toISOString(),...c?{widget_instance_id:c}:{},...l?{widget_type:l}:{}}}),window.open(v,`_blank`)},Ue=[{display:`Roundtrip`,value:`roundtrip`},{display:`One-way`,value:`one-way`}],We=[{display:`Economy`,value:Lp.enum.economy},{display:`Premium Economy`,value:Lp.enum.premium},{display:`Business`,value:Lp.enum.business},{display:`First`,value:Lp.enum.first}],Ge=Array(9).fill(0).map((e,t)=>{let n=t+1;return{value:Rp.options[t],display:`${n} Traveler${n>1?`s`:``}`}}),Ke=[`Flights`,...O?[]:[`Cars`]],qe=(0,G.useMemo)(()=>y&&se?.includes(y)?`to`:`from`,[y,se]),Je=Ke.map((e,t)=>(0,K.jsx)(G.Fragment,{children:(0,K.jsx)(`a`,{href:t>0?`${E}/${qe}/${y}/${e.toLowerCase()}`:`#`,onClick:e=>{t===0&&e.preventDefault()},target:`_blank`,className:(0,q.default)({"aone:text-black aone:border-white aone:ring-1 aone:ring-white aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-white aone:dark:text-white aone:text-base aone:leading-tight aone:w-[96px] aone:text-center aone:px-4 aone:py-1":!0,"aone:@xl:hover:bg-secondary aone:grow-0":t>=1," aone:bg-transparent aone:rounded-lg aone:@xl:hover:text-black aone:dark:@xl:hover:text-white":t>=1,"aone:bg-primary aone:text-white aone:grow-0 aone:rounded-lg":t===0,"aone:justify-center aone:items-center":t===0}),children:e})},t)),Ye=(0,K.jsx)(`div`,{className:`aone:flex aone:rounded-md aone:items-center aone:justify-center aone:gap-2`,children:Je}),Xe=(0,K.jsx)(FI,{hideByDefault:!0}),Ze=(0,K.jsxs)(`div`,{className:`aone:@2xl:flex aone:@2xl:flex-row aone:pb-1 aone:items-center aone:justify-between`,children:[(0,K.jsx)(`div`,{className:`aone:flex aone:flex-col aone:@2xl:flex-row aone:items-center aone:@2xl:gap-2 aone:mb-2 aone:@2xl:mb-0`,children:(0,K.jsx)(`div`,{className:`aone:flex aone:justify-center aone:@2xl:justify-start`,children:(0,K.jsx)(EL,{variant:h===`dark`?`white`:`black`,height:25,className:`aone:block aone:h-[25px] aone:w-auto`})})}),(0,K.jsx)(`div`,{className:(0,q.default)({"aone:hidden":!0,"aone:@2xl:justify-start aone:@2xl:flex aone:@2xl:w-[190px]":E!==``}),children:Ye}),(0,K.jsx)(`div`,{className:`aone:block aone:@2xl:hidden`,children:Ye}),(0,K.jsx)(`div`,{className:(0,q.default)({"aone:pb-0.5":!0,"aone:hidden aone:@2xl:flex aone:flex-col aone:items-center aone:@2xl:items-end aone:@2xl:w-[190px]":!0}),children:ce&&ce.length>0?null:(0,K.jsx)(`div`,{children:Xe})})]});return(0,K.jsxs)(Oh,{client:MB,children:[(0,K.jsx)(`div`,{"data-mode":h,style:{"--primary":`var(--color-primary-hsl, 210 100% 50%)`,"--secondary":`var(--color-secondary-hsl, 210 100% 50%)`},className:`aone:w-full aone:@container aone:relative`,children:(0,K.jsxs)(`form`,{className:`aone:flex aone:flex-col aone:gap-2`,onSubmit:He,children:[!D&&Ze,(0,K.jsxs)(`div`,{className:`aone:flex aone:flex-wrap aone:justify-between aone:gap-4 aone:max-w-full aone:w-full`,children:[(0,K.jsxs)(`div`,{className:(0,q.default)({"aone:flex aone:gap-1 aone:@2xl:gap-4":!0}),children:[(0,K.jsx)(`label`,{htmlFor:`trip-option`,className:`aone:sr-only`,children:`Trip type`}),(0,K.jsx)(`select`,{id:`trip-option`,name:`trip-option`,className:`aone:text-foreground aone:text-base aone:bg-transparent aone:truncate aone:min-w-0 aone:w-full`,onChange:e=>{N(t=>({...t,oneWay:e.target.value===`one-way`}))},children:Ue.map((e,t)=>(0,K.jsx)(`option`,{className:`aone:dark:bg-black aone:dark:text-white aone:text-base`,value:e.value,children:e.display},`${e.value}-${t}`))}),(0,K.jsx)(`label`,{htmlFor:`pax`,className:`aone:sr-only`,children:`Travelers`}),(0,K.jsx)(`select`,{id:`pax`,name:`pax`,className:`aone:text-foreground aone:text-base aone:bg-transparent aone:truncate aone:min-w-0 aone:w-full`,children:Ge.map((e,t)=>(0,K.jsx)(`option`,{className:`aone:dark:bg-black aone:dark:text-white aone:text-base`,value:e.value,children:e.display},`${e.value}-${t}`))}),(0,K.jsx)(`label`,{htmlFor:`cabin`,className:`aone:sr-only`,children:`Cabin class`}),(0,K.jsx)(`select`,{id:`cabin`,name:`cabin`,className:`aone:text-foreground aone:text-base aone:bg-transparent aone:truncate aone:min-w-0 aone:w-full`,children:We.map((e,t)=>(0,K.jsx)(`option`,{className:`aone:dark:bg-black aone:dark:text-white aone:text-base`,value:e.value,children:e.display},`${e.value}-${t}`))})]}),!R&&(0,K.jsxs)(`label`,{className:`aone:hidden aone:@5xl:flex aone:text-foreground aone:items-center aone:text-base aone:gap-2`,children:[(0,K.jsx)(`input`,{type:`checkbox`,name:`flexible-dates`,defaultChecked:_,className:`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border-2 aone:border-gray-700 aone:bg-white aone:accent-blue-700`}),`Show nearby dates for lower fares`]})]}),(0,K.jsxs)(`div`,{className:(0,q.default)({"aone:flex aone:flex-col aone:gap-6":!0,"aone:@5xl:grid aone:@5xl:grid-cols-2":!M.oneWay,"aone:@5xl:grid aone:@5xl:grid-cols-[3fr_400px]":M.oneWay}),children:[(0,K.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:items-stretch aone:@xl:grid aone:@xl:grid-cols-[calc(50%-20px)_24px_calc(50%-20px)] aone:@xl:items-end aone:w-full aone:gap-2`,children:[(0,K.jsx)(`div`,{className:`aone:flex aone:items-center aone:w-full aone:relative aone:z-100`,children:ye({dataTestId:`flight-search-form-origin`,fieldLabel:f,inputId:`origin`,required:!0,icon:xe===`pending`?(0,K.jsx)(aB,{}):(0,K.jsx)(iN,{className:`aone:w-6 aone:h-6`,icon:BE,style:{width:`24px`,height:`24px`}}),placeholder:`From?`,disabled:fe,items:Ce||[],selectedItems:M.origins,onInputChange:e=>Se(e),onSelectedItemsChange:e=>{let n=k?e?.slice(0,1):e;Am({name:`Flight Search - Origin Changed`,properties:{airport_iata:t||``,origin:ne,desination:I,destination:I,departure_date:M.startDate?.toISOString(),return_date:M.endDate?.toISOString()}}),N(e=>({...e,origins:n||[]}))}})}),(0,K.jsx)(`button`,{type:`button`,className:`aone:w-6 aone:self-center aone:@xl:self-end aone:@xl:mb-2 aone:text-gray-900 aone:rotate-90 aone:@xl:rotate-0 aone:dark:text-gray-400`,onClick:z,"aria-label":`Switch Origin and Destination`,"aria-describedby":ze?F:void 0,title:ze?Ve:`Switch Origin and Destination`,"data-testid":`flight-search-switch-airports-button`,children:(0,K.jsx)(HL,{})}),(0,K.jsx)(`div`,{className:`aone:flex aone:items-center aone:w-full`,children:ye({dataTestId:`flight-search-form-destination-autocomplete`,fieldLabel:p,inputId:`destination`,required:!0,icon:Te===`pending`?(0,K.jsx)(aB,{}):(0,K.jsx)(iN,{className:`aone:w-6 aone:h-6`,icon:FE,style:{width:`24px`,height:`24px`}}),placeholder:`To?`,disabled:pe,items:De||[],selectedItems:M.destinations,onInputChange:e=>Ee(e),onSelectedItemsChange:e=>{let n=A?e?.slice(0,1):e;Am({name:`Flight Search - Destination Changed`,properties:{airport_iata:t||``,origin:ne,desination:I,destination:I,departure_date:M.startDate?.toISOString(),return_date:M.endDate?.toISOString()}}),N(e=>({...e,destinations:n||[]}))}})})]}),ze&&(0,K.jsx)(`span`,{id:F,className:`aone:sr-only`,children:Ve}),(0,K.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`aone:sr-only`,children:P}),(0,K.jsxs)(`div`,{className:(0,q.default)({"aone:flex aone:flex-col aone:items-center aone:gap-4":!0,"aone:@5xl:flex-row aone:@5xl:items-end aone:@5xl:gap-4":!0,grow:!0}),children:[(0,K.jsx)(`div`,{className:`aone:w-full aone:@5xl:flex-1 aone:@5xl:min-w-0`,children:(0,K.jsx)(OB,{origin:ne,destination:I,startDateLabel:u,endDateLabel:d,startDateRequired:!0,endDateRequired:!M.oneWay,onChange:Le,onMonthViewChange:Re,oneWay:M.oneWay,shadowRoot:v,onlyDirects:le&&ce&&le?.length>0&&ce?.length>0,flightCalendar:!M.startDate||M.oneWay?Me:Ne,flightCalendarStatus:!M.startDate||M.oneWay?Fe:Ie})}),(0,K.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:gap-6 aone:items-center aone:justify-center aone:@5xl:shrink-0`,children:[!R&&(0,K.jsxs)(`label`,{className:`aone:text-foreground aone:text-base aone:flex aone:items-center aone:@5xl:hidden aone:gap-3`,children:[(0,K.jsx)(`input`,{type:`checkbox`,name:`flexible-dates`,defaultChecked:_,className:`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border-2 aone:border-gray-700 aone:bg-white aone:accent-blue-700`}),(0,K.jsx)(`span`,{children:`Show nearby dates for lower fares`})]}),(0,K.jsxs)(`button`,{"aria-label":ve?`Search flights`:`Search flights - Please complete all required fields`,"aria-disabled":!ve,tabIndex:0,type:`submit`,"data-testid":`flight-search-submit-button`,onClick:e=>{ve||e.preventDefault()},className:`aone:h-[44px] aone:w-auto aone:min-w-[100px] aone:max-w-[200px] aone:rounded-lg aone:flex aone:align-center aone:items-center aone:gap-1 aone:px-4 aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-offset-2 aone:focus-visible:ring-offset-white aone:dark:focus-visible:ring-offset-black ${ve?`aone:bg-green-500 aone:text-white aone:hover:bg-green-700 aone:active:bg-green-700 aone:focus-visible:ring-green-700 aone:dark:bg-green-600 aone:dark:hover:bg-green-800 aone:dark:active:bg-green-800 aone:dark:focus-visible:ring-green-600`:`aone:bg-gray-300 aone:text-gray-700 aone:cursor-not-allowed aone:dark:bg-gray-600 aone:dark:text-gray-300`}`,children:[(0,K.jsx)(uL,{}),(0,K.jsx)(`span`,{className:`aone:text-base`,children:`Search`})]})]})]})]})]})}),(0,K.jsx)(`div`,{className:`aone:visible aone:@2xl:hidden`,children:!D&&Xe})]})}var IB=new Set([`widgetInstanceId`,`widgetType`]),LB=Object.keys(AB.shape).filter(e=>!IB.has(e)),RB={consentAdvertising:!0,consentAnalytics:!0,consentDataSharing:!0,consentFunctional:!0,defaultNearbyDatesForLowerFares:!1,hideCarButton:!1},zB=[`consentAdvertising`,`consentAnalytics`,`consentDataSharing`,`consentFunctional`];function BB(e){typeof e.destination!=`string`&&typeof e.destinations==`string`&&(e.destination=e.destinations),typeof e.destinations!=`string`&&typeof e.destination==`string`&&(e.destinations=e.destination)}function VB(e){return typeof e.destination==`string`&&e.destination.trim()!==``||typeof e.destinations==`string`&&e.destinations.trim()!==``}function HB(e,t,n){let r={...n};e.hasAttribute(`data-widget-preview`)&&(delete r.origin,delete r.destination,delete r.destinations),BB(r),r.primaryColor==null&&t?.primaryColor&&(r.primaryColor=t.primaryColor),r.secondaryColor==null&&t?.secondaryColor&&(r.secondaryColor=t.secondaryColor);for(let t of LB){let n=yL(t).map(t=>e.getAttribute(t)).find(e=>e!==null&&e.trim()!==``);n!==void 0&&(r[t]=n)}BB(r),r.origin==null&&!VB(r)&&t?.iata&&(r.origin=t.iata.toUpperCase()),(r.subscribingAirport==null||typeof r.subscribingAirport==`string`&&r.subscribingAirport.trim()===``)&&t?.iata?.trim()&&(r.subscribingAirport=t.iata.trim().toUpperCase());for(let[e,t]of Object.entries(RB)){let n=r[e];typeof n==`string`&&(r[e]=bL(n,t))}for(let e of zB)r[e]===void 0&&(r[e]=!0);return r}function UB(e,t,n,r,i={}){return{...HB(e,n,r),apiDomain:t,...i.widgetInstanceId?{widgetInstanceId:i.widgetInstanceId,widgetType:i.widgetType}:{},...r.userStyleBlock?.trim()?{userStyleBlock:r.userStyleBlock}:{}}}var WB=new Ig;function GB(e){let{userStyleBlock:t,...n}=e;return(0,K.jsx)(Oh,{client:WB,children:(0,K.jsxs)(i_,{useSessionStorageOnly:!0,children:[(0,K.jsx)(`style`,{children:l_}),(0,K.jsx)(`style`,{children:e_}),t?(0,K.jsx)(`style`,{children:t}):null,(0,K.jsx)(FB,{...n})]})})}function KB(e){if(!e||typeof e.iata!=`string`)return;let t=e.iata.trim().toUpperCase();return t.length===3?t:void 0}var qB=Object.keys(AB.shape),JB=[...new Set([...qB.flatMap(e=>yL(e)),`borderradius`,`border-radius`,`theme`,Pp,`id`])],YB=class extends HTMLElement{_shadowRoot;_mountPoint;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;_mountTelemetrySent=!1;_lastPublicConfigTelemetryKey=null;static get observedAttributes(){return Array.from(JB)}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this._scheduleRender()}connectedCallback(){this.style.position=`relative`,this.style.zIndex=`10`,this.style.lineHeight=`1.5`,this.style.display=`flex`,this.style.flexDirection=`column`,this._scheduleRender()}disconnectedCallback(){this._reactRoot&&=(this._reactRoot.unmount(),void 0),this._mountTelemetrySent=!1,this._lastPublicConfigTelemetryKey=null}_scheduleRender(){this._renderScheduled||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&this._renderAsync()}))}async _renderAsync(){if(this._renderInProgress)this._renderQueued=!0;else{this._renderInProgress=!0;try{let e=cm(this),t=mm(),n=null,r=!1,i={attempted:!1,durationMs:0},a;if(e&&t){let t=await hm(e);i=t.metrics;let o=t.config;o?.widgetType&&o.widgetType!==`airfare-search`&&(console.warn(`[airport-one-widgets] Widget instance type does not match airfare-search:`,o.widgetType),a=`widget_type_mismatch`,o=null),n=o,r=!n,i.attempted&&n===null&&a===void 0&&i.failureKind&&(a=i.failureKind)}if(!this.isConnected)return;let o=Cm(n),s=window[Ac],c=UB(this,`https://flymyairport.vercel.app`,s,o,{widgetInstanceId:Np(e)??void 0,widgetType:`airfare-search`}),l=KB(n);l&&(c.subscribingAirport=l);let u=!i.attempted&&(!t||!e)?t?`no_instance_id`:`no_api_base`:void 0;if(c.consentAnalytics){let r=i.attempted?`attempt:${t}|${e}|${n===null?`fail`:`ok`}|${a??``}`:`skip:${u??`none`}`;r!==this._lastPublicConfigTelemetryKey&&(this._lastPublicConfigTelemetryKey=r,Sh(!0,{widget_runtime:`airfare-search`,widget_instance_id:c.widgetInstanceId,attempted:i.attempted,duration_ms:i.durationMs,ok:i.attempted?n!==null:!1,error_kind:i.attempted&&n===null?a:void 0,skip_reason:u}))}r&&console.warn(`${um}: airfare-search — managed instance config not applied; using host attributes and window defaults.`),this._paintAirfareSearch(c),c.consentAnalytics&&!this._mountTelemetrySent&&(this._mountTelemetrySent=!0,Ch(!0,{widget_runtime:`airfare-search`,widget_instance_id:c.widgetInstanceId,public_config_unavailable:r}))}finally{this._renderInProgress=!1,this._renderQueued&&(this._renderQueued=!1,queueMicrotask(()=>{this.isConnected&&this._renderAsync()}))}}}_paintAirfareSearch(e){let t=this._shadowRoot??=this.attachShadow({mode:`closed`}),n=this._mountPoint??=document.createElement(`span`);n.style.background=`none`,n.style.backgroundColor=`transparent`,n.parentNode!==t&&t.appendChild(n);let r={...e,shadowRoot:t},i=r.primaryColor!=null&&Kp.test(r.primaryColor),a=r.secondaryColor!=null&&Kp.test(r.secondaryColor),o=r.primaryColor??`210 100% 50%`,s=r.secondaryColor??`210 100% 50%`,c=i?Yp(o):o,l=a?Yp(s):s;this.style.setProperty(`--primary`,c),this.style.setProperty(`--secondary`,l),this.style.setProperty(`--color-primary`,`hsl(${c})`),this.style.setProperty(`--color-secondary`,`hsl(${l})`),this.style.setProperty(`--color-primary-hsl`,c),this.style.setProperty(`--color-secondary-hsl`,l);let u=this.getAttribute(`borderradius`)??this.getAttribute(`border-radius`);u?.trim()&&this.style.setProperty(`--radius`,xL(u)),r.theme===`dark`?this.setAttribute(`data-mode`,`dark`):this.removeAttribute(`data-mode`),(this._reactRoot??=rm.createRoot(n)).render((0,K.jsx)(GB,{...r}))}};customElements.get(`fma-airfare-search`)||customElements.define(`fma-airfare-search`,YB);var XB=new Map,ZB=36e5,QB=432e5;function $B(){let e=Date.now(),t=e-ZB,n=e+QB;return{scheduleWindowStartUtc:new Date(t).toISOString(),scheduleWindowEndUtcExclusive:new Date(n).toISOString()}}function eV(e){let t=e?.scheduleWindowStartUtc?.trim(),n=e?.scheduleWindowEndUtcExclusive?.trim();return t&&n?{scheduleWindowStartUtc:t,scheduleWindowEndUtcExclusive:n}:$B()}function tV(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t={};for(let[n,r]of Object.entries(e)){if(!r||typeof r!=`object`||Array.isArray(r))return null;let e=r;if(typeof e.code!=`string`||typeof e.name!=`string`)return null;t[n]={code:e.code,name:e.name,iconUrl:typeof e.iconUrl==`string`?e.iconUrl:``,logoUrl:typeof e.logoUrl==`string`?e.logoUrl:``}}return t}function nV(e){if(e==null)return{};if(typeof e!=`object`||Array.isArray(e))return null;let t={};for(let[n,r]of Object.entries(e)){if(!r||typeof r!=`object`||Array.isArray(r))return null;let e=r.timezoneRegionName;if(typeof e!=`string`||!e.trim())return null;let i=r.name,a=r.cityName;t[n]={timezoneRegionName:e.trim(),...typeof i==`string`&&i.trim()?{name:i.trim()}:{},...typeof a==`string`&&a.trim()?{cityName:a.trim()}:{}}}return t}function rV(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t=e;if(t.success!==!0)return null;let n=t.data;return typeof n!=`object`||!n||Array.isArray(n)?null:iV(n)}function iV(e){if(e.apiVersion!==3||typeof e.instanceId!=`string`||typeof e.iata!=`string`||e.mode!==`arrivals`&&e.mode!==`departures`&&e.mode!==`both`&&e.mode!==`weather`||!Array.isArray(e.arrivals)||!Array.isArray(e.departures)||typeof e.asOfUtc!=`string`)return null;let t=tV(e.airlines);if(!t)return null;let n=nV(e.airports);if(!n||!e.meta||typeof e.meta!=`object`||Array.isArray(e.meta)||typeof e.meta.lookbackEventsCap!=`number`||typeof e.meta.limitPerDirection!=`number`)return null;let r=e.meta,i=r.scheduleWindow,a;if(i!=null){if(typeof i!=`object`||Array.isArray(i))return null;let e=i;if(e.source!==`client`||typeof e.startUtc!=`string`||typeof e.endUtcExclusive!=`string`)return null;a={source:`client`,startUtc:e.startUtc,endUtcExclusive:e.endUtcExclusive}}return{apiVersion:3,instanceId:e.instanceId,iata:e.iata,mode:e.mode,asOfUtc:e.asOfUtc,arrivals:e.arrivals,departures:e.departures,airlines:t,airports:n,meta:{lookbackEventsCap:r.lookbackEventsCap,limitPerDirection:r.limitPerDirection,...a?{scheduleWindow:a}:{}}}}function aV(){return`https://api.airportonellc.com`.replace(/\/+$/,``)}function oV(e,t){return`${e}\0${t.scheduleWindowStartUtc}\0${t.scheduleWindowEndUtcExclusive}`}function sV(e,t){let n=aV();if(!n||!e.trim())return Promise.resolve({data:null,metrics:{attempted:!1,durationMs:0}});let r=eV(t),i=oV(e,r),a=XB.get(i);if(a)return a;let o=`?${new URLSearchParams({scheduleWindowStartUtc:r.scheduleWindowStartUtc,scheduleWindowEndUtcExclusive:r.scheduleWindowEndUtcExclusive}).toString()}`,s=`${n}/widgets/v1/fids/widget-instances/${encodeURIComponent(e)}/flights${o}`,c=typeof performance<`u`&&typeof performance.now==`function`?performance.now():0,l=()=>typeof performance<`u`&&typeof performance.now==`function`?Math.round(performance.now()-c):0,u=(async()=>{try{let e=await fetch(s,{credentials:`omit`,mode:`cors`});if(!e.ok)return{data:null,metrics:{attempted:!0,durationMs:l(),failureKind:`http_error`}};let t;try{t=await e.json()}catch{return{data:null,metrics:{attempted:!0,durationMs:l(),failureKind:`invalid_json`}}}let n=rV(t);return n?{data:n,metrics:{attempted:!0,durationMs:l()}}:{data:null,metrics:{attempted:!0,durationMs:l(),failureKind:`parse_failed`}}}catch{return{data:null,metrics:{attempted:!0,durationMs:l(),failureKind:`network_error`}}}finally{XB.delete(i)}})();return XB.set(i,u),u}var cV={panelBackgroundColor:`#ffffff`,primaryTextColor:`#0f172a`,accentTextColor:`#0f766e`,mutedTextColor:`#64748b`,headerIconTileBackgroundColor:`#f1f5f9`},lV=[`panelBackgroundColor`,`primaryTextColor`,`accentTextColor`,`mutedTextColor`,`headerIconTileBackgroundColor`];function uV(e){return lV.some(t=>!!e[t]?.trim())}function dV(e){let t=e?.trim();return t&&t.length>0?t:void 0}function fV(e,t){let n=e[t];if(typeof n!=`string`)return;let r=n.trim();return r.length>0?r:void 0}function pV(e){let t={},n=e.mode;(n===`blue`||n===`standard`||n===`black`||n===`custom`)&&(t.mode=n);let r=fV(e,`preset`);r&&(t.preset=r);for(let n of[`panelBackgroundColor`,`primaryTextColor`,`accentTextColor`,`mutedTextColor`,`headerIconTileBackgroundColor`]){let r=fV(e,n);r&&(t[n]=r)}return t}function mV(e){let t={...cV};if(!e||typeof e!=`object`||Array.isArray(e))return t;let n=pV(e);if(n.mode===`blue`||n.mode===`standard`||n.mode===`black`||n.mode===`custom`)return nf(n);if(uV(n)){let e={...t};for(let t of lV){let r=n[t]?.trim();r&&(e[t]=r)}return e}return t}function hV(e,t={}){let n=e?.variables,r=dV(t.primaryColor),i=dV(t.secondaryColor),a=e=>({...e,accentTextColor:r??e.accentTextColor,headerIconTileBackgroundColor:i??e.headerIconTileBackgroundColor});if(!n||typeof n!=`object`||Array.isArray(n))return a({...cV});let o=n.fids;if(!o||typeof o!=`object`||Array.isArray(o))return a({...cV});let s=o.theme;return a(mV(s))}function gV(e){return`color-mix(in srgb, ${e.trim()} 18%, transparent)`}var _V={prefix:`fas`,iconName:`plane-landing-gear`,icon:[640,512,[],`e7bc`,`M249.8 74.4L401.7 240 552.3 240c30.9 0 56 25.1 56 56s-25.1 56-56 56l-450.6 0c-30.9 0-57.4-22.1-63-52.6l-19-104.6C18 185 25.5 176 35.5 176l17.3 0c7.3 0 14.2 3.3 18.7 9l44 55 103.5 0-51.6-154.9C163.9 74.7 171.6 64 182.5 64l43.7 0c9 0 17.5 3.8 23.6 10.4zM224.3 416a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z`]},vV={prefix:`fas`,iconName:`plane-departure`,icon:[576,512,[128747],`f5b0`,`M372 143.9L172.7 40.2c-8-4.1-17.3-4.8-25.7-1.7l-41.1 15c-10.3 3.7-13.8 16.4-7.1 25L200.3 206.4 100.1 242.8 40 206.2c-6.2-3.8-13.8-4.5-20.7-2.1L3 210.1c-9.4 3.4-13.4 14.5-8.3 23.1l53.6 91.8c15.6 26.7 48.1 38.4 77.1 27.8l12.9-4.7 0 0 398.4-145c29.1-10.6 44-42.7 33.5-71.8s-42.7-44-71.8-33.5L372 143.9zM32.2 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l512 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-512 0z`]};function yV(e,t=new Date){let n=e?.trim();if(n)try{return new Intl.DateTimeFormat(`en-US`,{timeZone:n,timeZoneName:`short`}).formatToParts(t).find(e=>e.type===`timeZoneName`)?.value?.trim()||n}catch{return n}}function bV(e){if(!e)return{gate:``,terminal:``};let t=e.gate,n=e.terminal;return{gate:typeof t==`string`?t.trim():typeof t==`number`&&Number.isFinite(t)?String(t).trim():``,terminal:typeof n==`string`?n.trim():typeof n==`number`&&Number.isFinite(n)?String(n).trim():``}}function xV(e,t){if(!t||!e?.airport)return!1;let n=e.airport.iata?.trim().toUpperCase()??``,r=e.airport.fs?.trim().toUpperCase()??``;return n===t||r===t}function SV(e){let{gate:t,terminal:n}=bV(e);return t.length>0||n.length>0}function CV(e,t){let n=t.trim().toUpperCase(),r=e.departure,i=e.arrival,a=xV(r,n),o=xV(i,n),s=!!(r?.airport&&i?.airport);if(e.direction===`departure`){if(a)return SV(r)?r:o&&SV(i)?i:r;if(!a&&o&&SV(i))return i;if(!s||!a&&!o&&!(r?.airport&&i?.airport)){if(SV(r))return r;if(SV(i))return i}return r??i}if(e.direction===`arrival`){if(o)return SV(i)?i:a&&SV(r)?r:i;if(!o&&a&&SV(r))return r;if(!s||!a&&!o&&!(r?.airport&&i?.airport)){if(SV(i))return i;if(SV(r))return r}return i??r}}function wV(e){let t=e.trim();if(!t)return null;let n=!(/z\s*$/i.test(t)||/[+-]\d{2}:\d{2}\s*$/.test(t))&&/^\d{4}-\d{2}-\d{2}T/.test(t)?`${t}Z`:t,r=Date.parse(n);return Number.isNaN(r)?null:new Date(r)}var TV={kind:`on-time`};function EV(e){return e.departureGatePunctuality??TV}function DV(e){return e.arrivalGatePunctuality??TV}function OV(e){let t=e.direction===`departure`?EV(e):DV(e),n=t.kind===`on-time`?`on-time`:t.kind===`early`?`early`:`delayed`;return{text:tp(t),tone:n}}function kV(e,t){return e===`on-time`||e===`early`?Ld.statusGreen:e===`delayed`?Ld.statusRed:t.accentTextColor}function AV(e,t){return new Intl.DateTimeFormat(`en-CA`,{year:`numeric`,month:`2-digit`,day:`2-digit`,...t?{timeZone:t}:{}}).format(e)}function jV(e,t){return new Intl.DateTimeFormat(`en-US`,{year:`numeric`,...t?{timeZone:t}:{}}).format(e)}function MV(e,t){if(!e)return`—`;try{let n=wV(e);if(!n)return e;let r=t?.trim()||void 0,i=new Date;if(AV(n,r)===AV(i,r))return n.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`,...r?{timeZone:r}:{}});let a={month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`,...r?{timeZone:r}:{}};return jV(n,r)!==jV(i,r)&&(a.year=`numeric`),n.toLocaleString(void 0,a)}catch{return e}}var NV=`https://flymyairport.com`,PV=760,FV=784,IV=960,LV=984,RV=`320px`,zV=`minmax(${RV}, max-content) minmax(0, 1fr) max-content`,BV={fontSize:`0.67rem`,fontWeight:700,letterSpacing:`0.05em`,textTransform:`uppercase`,whiteSpace:`nowrap`},VV={display:`inline-flex`,minHeight:28,maxWidth:`100%`,alignItems:`center`,justifyContent:`center`,borderRadius:8,padding:`6px 12px`,fontSize:`0.75rem`,fontWeight:400,lineHeight:1,textDecoration:`none`,whiteSpace:`nowrap`,boxSizing:`border-box`,backgroundColor:`#374151`,color:`#ffffff`,border:`none`,cursor:`pointer`};function HV(e){return e===`arrivals`?`arrival`:`departure`}function UV(e,t,n){let r=Xf(e,HV(n));if(!r)return null;let i=NV.replace(/\/$/,``),a=new URL(`${i}/${encodeURIComponent(t.trim().toUpperCase())}/fids/flight/${encodeURIComponent(r)}`);return a.searchParams.set(`fid`,e.flightId),a.toString()}function WV(e,t,n){let r=Xf(e,HV(n));return r?$f(NV,t,r,{rowFlightId:e.flightId}):null}function GV(e){let t=e.marketingCarrier??e.operatingCarrier;return t?.iata?t.iata:t?.fs?t.fs:``}function KV(e){let t=GV(e),n=e.flightNumber?.trim();return t&&n?`${t} ${n}`:n||e.flightId}function qV(e){let t=e.marketingCarrier??e.operatingCarrier;return t?.iata?.trim().toUpperCase()||(t?.fs?.trim().toUpperCase()??``)}function JV(e,t){let n=qV(e);return n&&t[n]?.name?.trim()||null}function YV(e,t){let n=qV(e);return n&&(t[n]?.iconUrl?.trim()||t[n]?.logoUrl?.trim())||null}function XV(e){return typeof e==`string`?e.trim():typeof e==`number`&&Number.isFinite(e)?String(e):``}function ZV(e,t){let n=CV(e,t);return{gate:XV(n?.gate)||`—`,terminal:XV(n?.terminal)||`—`}}function QV(e,t){return XV(CV(e,t)?.terminal).length>0}function $V(e,t){let n=e?.trim().toUpperCase();if(n)return t[n]?.timezoneRegionName?.trim()||void 0}function eH(e){return e.direction===`arrival`?e.arrival?.gateTime?.scheduled?.utc:e.departure?.gateTime?.scheduled?.utc}function tH(e){let t=e.direction===`departure`?e.departure:e.arrival;return t?.gateTime?.published?.utc??t?.gateTime?.scheduled?.utc}function nH(e){let t=e.direction===`departure`?e.departure:e.arrival;return t?.gateTime?.actual?.utc??t?.gateTime?.estimated?.utc}function rH(e){if(e)return e.replace(/\s+(?:[A-Z]{2,5}|GMT[+-]\d{1,2}(?::?\d{2})?)$/u,``).trim()}function iH(e){switch(e?.trim().toUpperCase()??``){case`CANCELLED`:return`Cancelled`;case`DIVERTED`:return`Diverted`;case`REDIRECTED`:return`Redirected`;case`LANDED`:return`Landed`;case`ACTIVE`:return`En route`;case`SCHEDULED`:return`Scheduled`;case`UNKNOWN`:return`Unknown`;default:return e?e.length<=20?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():e:`—`}}function aH(e){let t=e?.trim().toUpperCase()??``;switch(t){case`CANCELLED`:return{label:`Cancelled`,backgroundColor:`#ffedd5`,color:`#9a3412`};case`DIVERTED`:case`REDIRECTED`:return{label:t===`DIVERTED`?`Diverted`:`Redirected`,backgroundColor:`#fef3c7`,color:`#92400e`};case`LANDED`:return{label:`Landed`,backgroundColor:`#d1fae5`,color:`#065f46`};case`ACTIVE`:return{label:`In Flight`,backgroundColor:`#d1fae5`,color:`#065f46`};case`SCHEDULED`:return{label:`Scheduled`,backgroundColor:`#0f766e`,color:`#ffffff`};case`UNKNOWN`:return{label:`Unknown`,backgroundColor:`#f3f4f6`,color:`#4b5563`};default:return e?{label:e.length<=20?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():e,backgroundColor:`#0f766e`,color:`#ffffff`}:{label:`—`,backgroundColor:`#f3f4f6`,color:`#4b5563`}}}function oH(e,t,n){if(e.displayTime){let n=OV(e);return{timeLabel:rH(e.displayTime.label)??e.displayTime.label,scheduledLabel:rH(e.displayTime.scheduledLabel),statusText:n.text,punctualityColor:kV(n.tone,t)}}let r=OV(e),i=MV(tH(e),n),a=MV(nH(e),n);return r.tone!==`on-time`&&i!==`—`&&a!==`—`&&i!==a?{timeLabel:a,scheduledLabel:i,statusText:r.text,punctualityColor:kV(r.tone,t)}:{timeLabel:MV(eH(e),n),statusText:r.text,punctualityColor:kV(r.tone,t)}}function sH(e){let t=[`minmax(0, 1.35fr)`];return e.showTerminalColumn&&t.push(`minmax(0, 1fr)`),t.push(`minmax(0, 1fr)`),e.showBaggage&&t.push(`minmax(0, 1fr)`),t.push(`minmax(0, 1.35fr)`,`max-content`),t.join(` `)}function cH(e){return e===`auto`?{flexShrink:0}:e===`flex`?{minWidth:0,flex:1}:{width:`100%`,maxWidth:`100%`,justifySelf:`stretch`}}function lH(e){let t=e.trim(),n=t.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i),r=t.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})/i),i,a,o;if(n){let e=n[1];if(!e)return`#ffffff`;let t=e.length===3?e.split(``).map(e=>`${e}${e}`).join(``):e;i=parseInt(t.slice(0,2),16),a=parseInt(t.slice(2,4),16),o=parseInt(t.slice(4,6),16)}else if(r){let[,e,t,n]=r;if(!e||!t||!n)return`#ffffff`;i=Number(e),a=Number(t),o=Number(n)}else return`#ffffff`;return(.2126*i+.7152*a+.0722*o)/255>.56?`#0f172a`:`#ffffff`}function uH(e){return e?{backgroundColor:`#e5e7eb`,marginTop:-14,marginLeft:-14,marginRight:-14,paddingTop:14,paddingLeft:14,paddingRight:14,paddingBottom:14,borderTopLeftRadius:17,borderTopRightRadius:17}:{backgroundColor:`#e5e7eb`,marginTop:-16,marginLeft:-18,marginRight:-18,paddingTop:16,paddingLeft:18,paddingRight:18,paddingBottom:14,borderTopLeftRadius:17,borderTopRightRadius:17}}function dH(e){return`repeat(${1+ +!!e.showTerminalColumn+1+ +!!e.showBaggage}, minmax(0, 1fr))`}function fH(e){let[t,n]=(0,G.useState)(`desktop`),r=(0,G.useRef)(`desktop`);return(0,G.useEffect)(()=>{let t=e.current;if(!t)return;let i=()=>{let e=t.getBoundingClientRect().width,i=r.current,a=i;i===`mobile`?e>=FV&&(a=e<IV?`compact`:`desktop`):i===`compact`?e<PV?a=`mobile`:e>=LV&&(a=`desktop`):e<PV?a=`mobile`:e<IV&&(a=`compact`),a!==i&&(r.current=a,n(a))};if(i(),typeof ResizeObserver>`u`)return globalThis.addEventListener(`resize`,i),()=>globalThis.removeEventListener(`resize`,i);let a=new ResizeObserver(()=>{i()});return a.observe(t),()=>a.disconnect()},[e]),t}function pH({label:e,value:t,theme:n,align:r=`start`,labelStyle:i}){return(0,K.jsxs)(`div`,{style:{display:`flex`,minWidth:0,width:`100%`,flexDirection:`column`,justifyContent:`flex-start`,alignSelf:`flex-start`,alignItems:r===`center`?`center`:void 0,textAlign:r===`center`?`center`:void 0},children:[(0,K.jsx)(`div`,{style:{...i,color:n.mutedTextColor},children:e}),(0,K.jsx)(`div`,{style:{display:`inline-flex`,maxWidth:`100%`,minHeight:24,alignItems:`center`,justifyContent:`center`,padding:`4px 10px`,borderRadius:6,backgroundColor:gV(n.primaryTextColor),color:n.primaryTextColor,fontSize:`0.78rem`,fontWeight:800,lineHeight:1,overflowWrap:`anywhere`,marginTop:6,marginLeft:r===`center`?`auto`:void 0,marginRight:r===`center`?`auto`:void 0},children:t})]})}function mH({label:e,scheduledLabel:t,timeLabel:n,theme:r,labelStyle:i,align:a=`start`}){let o=a===`end`,s=a===`center`;return(0,K.jsxs)(`div`,{part:`fids-board-row-time`,style:{display:`flex`,minHeight:`100%`,minWidth:0,width:`100%`,flexDirection:`column`,alignSelf:`stretch`},children:[(0,K.jsx)(`div`,{part:`fids-board-row-time-label`,style:{...i,color:r.mutedTextColor,width:`100%`,textAlign:s?`center`:o?`right`:`left`},children:e}),(0,K.jsx)(`div`,{style:{display:`flex`,minHeight:32,flex:1,alignItems:`center`,justifyContent:s?`center`:o?`flex-end`:`flex-start`},children:(0,K.jsxs)(`div`,{className:`aone:tabular-nums`,style:{display:`flex`,flexDirection:`column`,gap:2,color:r.primaryTextColor,fontWeight:700,fontSize:`1.05rem`,lineHeight:1.1,alignItems:s?`center`:o?`flex-end`:`flex-start`},children:[(0,K.jsx)(`span`,{children:n}),t?(0,K.jsx)(`span`,{style:{color:r.mutedTextColor,fontSize:`0.875rem`,fontWeight:500,textDecorationLine:`line-through`},children:t}):null]})})]})}function hH({value:e,color:t,align:n=`start`,wrap:r=!1}){let i=n===`end`,a=n===`center`;return(0,K.jsx)(`div`,{part:`fids-board-row-status-text`,style:{display:`flex`,minHeight:`100%`,minWidth:0,width:`100%`,alignItems:`center`,alignSelf:`stretch`,justifyContent:a?`center`:i?`flex-end`:`flex-start`},children:(0,K.jsx)(`div`,{className:`aone:tabular-nums`,style:{fontSize:`0.875rem`,fontWeight:600,lineHeight:1.1,color:t,textAlign:a?`center`:void 0,whiteSpace:r?`normal`:`nowrap`,overflowWrap:r?`anywhere`:void 0},children:e})})}function gH({status:e,fullWidth:t=!0}){let n=aH(e);return(0,K.jsx)(`span`,{part:`fids-board-row-status`,style:{boxSizing:`border-box`,display:`inline-flex`,minHeight:28,height:`auto`,width:t?`100%`:`auto`,maxWidth:t?`100%`:void 0,flexShrink:0,alignItems:`center`,justifyContent:`center`,overflow:t?`hidden`:void 0,textOverflow:t?`ellipsis`:void 0,whiteSpace:`nowrap`,borderRadius:999,padding:t?`6px 5px`:`6px 14px`,fontSize:`0.75rem`,fontWeight:400,lineHeight:1,textTransform:`uppercase`,backgroundColor:n.backgroundColor,color:n.color},children:n.label})}function _H({href:e,stretch:t,ariaLabel:n}){let r={...VV,...cH(t)};return e?(0,K.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,"aria-label":n,part:`fids-board-row-details`,style:r,children:`Flight Details`}):(0,K.jsx)(`span`,{"aria-hidden":!0,style:{...r,opacity:.4,pointerEvents:`none`},children:`Flight Details`})}function vH({href:e,stretch:t,theme:n}){let r=n.headerIconTileBackgroundColor,i={...VV,backgroundColor:r,color:lH(r),...cH(t)};return e?(0,K.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`Sign up for flight notifications`,title:`Sign up for flight notifications`,part:`fids-board-row-notifications`,style:i,children:`Flight Notifications`}):(0,K.jsx)(`span`,{"aria-hidden":!0,part:`fids-board-row-notifications`,style:{...i,opacity:.4,pointerEvents:`none`},children:`Flight Notifications`})}function yH({rows:e,airlines:t,airports:n,theme:r,boardAirportIata:i,tableSection:a}){let o=gV(r.primaryTextColor),s=(0,G.useRef)(null),[c,l]=(0,G.useState)(null),u=fH(s),d=u===`mobile`,f=u!==`desktop`,p={width:`100%`,maxWidth:`100%`,minWidth:0,paddingLeft:f?d?12:16:20,paddingRight:f?d?12:16:20,paddingBottom:16,boxSizing:`border-box`},m=a===`arrivals`,h=e.some(e=>QV(e,i)),g=a===`arrivals`?`Arrival`:`Departs`,_=sH({showTerminalColumn:h,showBaggage:m}),v=dH({showTerminalColumn:h,showBaggage:m}),y=BV;return(0,K.jsx)(`div`,{ref:s,part:`fids-board-card-list`,style:{width:`100%`,maxWidth:`100%`,minWidth:0,boxSizing:`border-box`},children:(0,K.jsx)(`div`,{style:p,children:e.length===0?(0,K.jsx)(`div`,{part:`fids-board-empty`,className:`aone:py-8 aone:text-center`,style:{color:r.mutedTextColor},children:`No flights in this view.`}):(0,K.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:d?20:12},children:e.map(e=>{let s=e.flightId,u=JV(e,t),p=YV(e,t),b=e.callsign?.trim()||``,x=KV(e),S=oH(e,r,$V(i,n)),C=OV(e).text||iH(e.status),w=ZV(e,i),T=UV(e,i,a),E=WV(e,i,a),D=c===s,O=T?`Flight Details for ${x} to ${Uf(e,n)}`:void 0,k={position:`relative`,boxSizing:`border-box`,width:`100%`,minWidth:0,maxWidth:`100%`,overflow:`hidden`,borderRadius:18,backgroundColor:r.panelBackgroundColor,borderWidth:1,borderStyle:`solid`,borderColor:D?r.accentTextColor:o,boxShadow:D?`0 6px 14px rgba(15, 23, 42, 0.06)`:`none`,transform:D?`translateY(-1px)`:void 0,transition:`box-shadow 160ms ease, border-color 160ms ease, transform 160ms ease`,...f?{display:`grid`,alignItems:`center`,gridTemplateColumns:`34px minmax(0, 1fr)`,gap:d?`14px 10px`:`14px 12px`,padding:d?`14px`:`16px 18px`}:{display:`grid`,alignItems:`center`,gridTemplateColumns:zV,columnGap:18,rowGap:12,padding:`16px 18px`}},A=(0,K.jsx)(`span`,{part:`fids-board-row-airline-icon`,"aria-hidden":!p,style:{display:`inline-flex`,width:34,height:34,flexShrink:0,alignItems:`center`,justifyContent:`center`,overflow:`hidden`},children:p?(0,K.jsx)(`img`,{src:p,alt:u?`${u} icon`:``,style:{display:`block`,maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`},loading:`lazy`,decoding:`async`}):null}),j=(0,K.jsxs)(`div`,{style:{display:`grid`,minWidth:0,alignItems:`start`,columnGap:14,rowGap:4,gridTemplateColumns:`34px minmax(0, 1fr)`,gridTemplateRows:`auto auto`,...f?{gridColumn:`1 / -1`,gridRow:1,...uH(d)}:{maxWidth:`100%`,flexShrink:0,flexBasis:RV,minWidth:RV}},children:[(0,K.jsx)(`div`,{style:{gridColumn:1,gridRow:`1 / -1`,alignSelf:`center`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:A}),(0,K.jsx)(`div`,{part:`fids-board-row-endpoint`,style:{gridColumn:2,gridRow:1,minWidth:0,color:r.primaryTextColor},children:(0,K.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,alignItems:`baseline`,justifyContent:`space-between`,width:`100%`,fontSize:`1.05rem`,fontWeight:700,lineHeight:1.1},children:[(0,K.jsx)(`span`,{children:Uf(e,n)}),(0,K.jsx)(`span`,{className:`aone:tabular-nums`,style:{whiteSpace:`nowrap`,paddingRight:20},children:x})]})}),(0,K.jsx)(`div`,{part:`fids-board-row-airline-line`,style:{gridColumn:2,gridRow:2,minWidth:0},children:u||b?(0,K.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,alignItems:`baseline`,columnGap:6,rowGap:2,fontSize:`0.78rem`,lineHeight:1.1,color:r.mutedTextColor},children:[u?(0,K.jsx)(`span`,{style:{fontWeight:700},children:u}):null,b?(0,K.jsx)(`span`,{part:`fids-board-row-callsign-inline`,className:`aone:tabular-nums`,title:`Callsign`,style:{fontWeight:500},children:b}):null]}):null})]}),M=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(mH,{label:g,timeLabel:S.timeLabel,scheduledLabel:S.scheduledLabel,theme:r,labelStyle:y}),h?(0,K.jsx)(pH,{label:`Terminal`,value:w.terminal,theme:r,labelStyle:y,align:`center`}):null,(0,K.jsx)(pH,{label:`Gate`,value:w.gate,theme:r,labelStyle:y,align:`center`}),m?(0,K.jsx)(pH,{label:`Baggage`,value:e.arrival?.baggage?.trim()||`—`,theme:r,labelStyle:y,align:`center`}):null,(0,K.jsx)(hH,{value:C,color:S.punctualityColor,align:`end`}),(0,K.jsx)(`div`,{style:{display:`flex`,minWidth:0,width:`100%`,alignItems:`center`,alignSelf:`stretch`},children:(0,K.jsx)(gH,{status:e.status,fullWidth:!1})})]}),N=(0,K.jsx)(`div`,{part:`fids-board-row-facts`,style:{display:`grid`,minWidth:0,width:`100%`,alignItems:`stretch`,columnGap:18,gridTemplateColumns:_},children:M}),P=(0,K.jsxs)(`div`,{style:{display:`flex`,minWidth:0,alignItems:`center`,justifyContent:`flex-end`,columnGap:8,...f?{gridColumn:`1 / -1`,gridRow:3,width:`100%`}:{flexShrink:0,flexGrow:0,justifySelf:`end`}},children:[(0,K.jsx)(_H,{href:T,stretch:f?`flex`:`auto`,ariaLabel:O}),(0,K.jsx)(vH,{href:E,stretch:f?`flex`:`auto`,theme:r})]});return(0,K.jsxs)(`article`,{part:`fids-board-row-card`,onMouseEnter:()=>l(s),onMouseLeave:()=>l(null),onFocus:()=>l(s),onBlur:()=>l(null),style:k,children:[j,f?(0,K.jsxs)(`div`,{style:{display:`grid`,gridColumn:`1 / -1`,gridRow:2,gridTemplateColumns:v,alignItems:`stretch`,columnGap:12,rowGap:12},children:[(0,K.jsx)(mH,{label:g,timeLabel:S.timeLabel,scheduledLabel:S.scheduledLabel,theme:r,labelStyle:y,align:f?`center`:`start`}),h?(0,K.jsx)(pH,{label:`Terminal`,value:w.terminal,theme:r,labelStyle:y,align:`center`}):null,(0,K.jsx)(pH,{label:`Gate`,value:w.gate,theme:r,labelStyle:y,align:`center`}),m?(0,K.jsx)(pH,{label:`Baggage`,value:e.arrival?.baggage?.trim()||`—`,theme:r,labelStyle:y,align:`center`}):null,(0,K.jsx)(`div`,{style:{gridColumn:`1 / -1`},children:(0,K.jsx)(hH,{value:C,color:S.punctualityColor,align:f?`center`:`start`,wrap:!0})}),(0,K.jsx)(`div`,{style:{gridColumn:`1 / -1`,display:`flex`,width:`100%`,alignItems:`flex-start`},children:(0,K.jsx)(gH,{status:e.status})})]}):N,P]},s)})})})})}function bH(e){if(!e)return`—`;try{let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}catch{return e}}function xH(e,t){let n=e.trim();if(n)return t[n]?.timezoneRegionName?.trim()||t[n.toUpperCase()]?.timezoneRegionName?.trim()||t[n.toLowerCase()]?.timezoneRegionName?.trim()||void 0}function SH(e,t){let n={hour:`numeric`,minute:`2-digit`};t&&(n.timeZone=t);try{return e.toLocaleTimeString(void 0,n)}catch{return e.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`})}}function CH(e,t){let n=Math.max(e.dueAtMs-e.intervalStartMs,1);return Math.min(Math.max(t-e.intervalStartMs,0),n)/n*100}function wH({title:e,headerPlaneIcon:t,theme:n,dataRefreshSchedule:r,timezoneRegionName:i,timezoneLabel:a}){let o=r===null?``:`${r.intervalStartMs}-${r.dueAtMs}`,[s,c]=(0,G.useState)(()=>new Date);(0,G.useEffect)(()=>{let e=o?250:15e3,t=globalThis.setInterval(()=>c(new Date),e);return()=>globalThis.clearInterval(t)},[o]);let l=s.getTime(),u=SH(s,i),d=r===null?null:CH(r,l);return(0,K.jsxs)(`header`,{part:`fids-board-header`,style:{display:`flex`,alignItems:`flex-start`,justifyContent:`space-between`,gap:12,paddingLeft:20,paddingRight:20,paddingTop:20,paddingBottom:16,boxSizing:`border-box`,width:`100%`},children:[(0,K.jsxs)(`div`,{part:`fids-board-meta`,style:{display:`flex`,alignItems:`center`,gap:16,minWidth:0,flex:1},children:[(0,K.jsx)(`div`,{style:{width:44,height:44,flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:8,backgroundColor:n.headerIconTileBackgroundColor},"aria-hidden":!0,children:(0,K.jsx)(iN,{icon:t===`departure`?vV:_V,style:{width:22,height:22,color:`#ffffff`}})}),(0,K.jsx)(`h2`,{part:`fids-board-title`,className:`aone:text-xl aone:font-bold aone:leading-tight aone:tracking-tight`,style:{color:n.accentTextColor,margin:0,minWidth:0},children:e})]}),(0,K.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`flex-end`,flexShrink:0,gap:6,minWidth:72},children:[(0,K.jsx)(`p`,{part:`fids-board-clock`,className:`aone:tabular-nums`,style:{margin:0,fontSize:`1.25rem`,fontWeight:600,color:n.accentTextColor,lineHeight:1},children:u}),d===null?null:(0,K.jsx)(`div`,{part:`fids-board-refresh-bar`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.min(100,Math.round(d)),"aria-label":`Progress until flights refresh`,style:{width:`100%`,maxWidth:96,height:3,borderRadius:2,backgroundColor:gV(n.primaryTextColor),overflow:`hidden`},children:(0,K.jsx)(`div`,{style:{width:`${d}%`,height:`100%`,borderRadius:2,backgroundColor:n.accentTextColor}})}),a?(0,K.jsxs)(`p`,{part:`fids-board-timezone`,style:{margin:0,fontSize:`0.75rem`,fontWeight:700,color:n.mutedTextColor,letterSpacing:`0.05em`,lineHeight:1},children:[`Time Zone: `,a]}):null]})]})}function TH({modeLabel:e,headerPlaneIcon:t,rows:n,airlines:r,airports:i,theme:a,dataRefreshSchedule:o,boardAirportIata:s,timezoneRegionName:c,timezoneLabel:l}){return(0,K.jsxs)(`section`,{part:`fids-board-section`,className:`aone:mb-4 aone:overflow-hidden aone:rounded-xl last:aone:mb-0`,style:{width:`100%`,boxSizing:`border-box`,backgroundColor:a.panelBackgroundColor,boxShadow:`inset 0 1px 0 rgba(255,255,255,0.06)`},children:[(0,K.jsx)(wH,{title:e,headerPlaneIcon:t,theme:a,dataRefreshSchedule:o,timezoneRegionName:c,timezoneLabel:l}),(0,K.jsx)(yH,{rows:n,airlines:r,airports:i,theme:a,boardAirportIata:s,tableSection:t===`arrival`?`arrivals`:`departures`})]})}function EH({payload:e,loading:t,error:n,consentAnalytics:r,theme:i=cV,dataRefreshSchedule:a}){let o=`aone:font-sans aone:text-[15px] aone:leading-normal`;if(t&&!e)return(0,K.jsxs)(`div`,{part:`fids-board-root`,role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`${o} aone:rounded-xl aone:p-8`,style:{backgroundColor:i.panelBackgroundColor,color:i.mutedTextColor,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:16},children:[(0,K.jsx)(`div`,{className:`aone:box-border aone:h-10 aone:w-10 aone:animate-spin aone:rounded-full aone:border-2 aone:border-solid`,style:{borderColor:gV(i.primaryTextColor),borderTopColor:i.accentTextColor},"aria-hidden":!0}),(0,K.jsx)(`p`,{className:`aone:m-0 aone:text-sm`,style:{color:i.mutedTextColor},children:`Loading flight information…`})]});if(n&&!e)return(0,K.jsx)(`div`,{part:`fids-board-root`,className:`${o} aone:rounded-xl aone:p-6 aone:text-center`,style:{backgroundColor:i.panelBackgroundColor,color:`#fdba74`},children:`Flight information is temporarily unavailable.`});if(!e)return(0,K.jsx)(`div`,{part:`fids-board-root`,className:`${o} aone:rounded-xl aone:p-6 aone:text-center`,style:{backgroundColor:i.panelBackgroundColor,color:i.mutedTextColor},children:`No flight data.`});let s=e.mode===`arrivals`||e.mode===`both`,c=e.mode===`departures`||e.mode===`both`,l=e.airlines,u=e.airports??{},d=xH(e.iata,u),f=yV(d);return(0,K.jsxs)(`div`,{part:`fids-board-root`,className:o,style:{color:i.primaryTextColor,width:`100%`,maxWidth:`100%`,boxSizing:`border-box`},children:[c&&(0,K.jsx)(TH,{modeLabel:`Flight Departures`,headerPlaneIcon:`departure`,rows:e.departures,airlines:l,airports:u,theme:i,dataRefreshSchedule:a,boardAirportIata:e.iata,timezoneRegionName:d,timezoneLabel:f}),s&&(0,K.jsx)(TH,{modeLabel:`Flight Arrivals`,headerPlaneIcon:`arrival`,rows:e.arrivals,airlines:l,airports:u,theme:i,dataRefreshSchedule:a,boardAirportIata:e.iata,timezoneRegionName:d,timezoneLabel:f}),(0,K.jsxs)(`p`,{part:`fids-board-updated`,className:`aone:mt-3 aone:text-center aone:text-xs`,style:{color:i.mutedTextColor},children:[`Updated `,bH(e.asOfUtc),` · `,e.iata]})]})}function DH(e){return(0,K.jsx)(EH,{...e})}var OH=[`consent-analytics`,`consent-advertising`,`consent-functional`,Pp,`id`],kH=12e4,AH=3e4;function jH(e){let t=e?.trim().toLowerCase();if(t===`true`)return!0;if(t===`false`)return!1}function MH(e){let t=e?.variables?.preview;if(!t?.variableOverridesEnabled||!t.variableOverrideValues)return{};let n=t.variableOverrideValues;return{consentAnalytics:jH(n.consentAnalytics),consentAdvertising:jH(n.consentAdvertising),consentFunctional:jH(n.consentFunctional)}}var NH=class extends HTMLElement{_shadow;_shadowStylesInjected=!1;_mount;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;_pollTimer;_dataRefreshSchedule=null;_activeInstanceId=null;_mountTelemetrySent=!1;_lastPublicConfigTelemetryKey=null;_flightsCache=null;_flightsLoading=!0;_flightsError=!1;_resolvedTheme=cV;_publicConsentAnalytics;static get observedAttributes(){return Array.from(OH)}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this._scheduleRender()}connectedCallback(){this.style.position=`relative`,this.style.zIndex=`10`,this.style.lineHeight=`1.5`,this.style.display=`flex`,this.style.flexDirection=`column`,this.style.width=`100%`,this.style.maxWidth=`100%`,this.style.minWidth=`0`,this.style.boxSizing=`border-box`,this._scheduleRender()}disconnectedCallback(){this._clearPoll(),this._reactRoot&&=(this._reactRoot.unmount(),void 0),this._mountTelemetrySent=!1,this._lastPublicConfigTelemetryKey=null,this._activeInstanceId=null}_clearPoll(){this._pollTimer!==void 0&&(globalThis.clearTimeout(this._pollTimer),this._pollTimer=void 0),this._dataRefreshSchedule=null}_schedulePoll(){this._clearPoll();let e=kH+Math.floor(Math.random()*AH),t=Date.now();this._dataRefreshSchedule={intervalStartMs:t,dueAtMs:t+e},this._pollTimer=globalThis.setTimeout(()=>{this._pollTick()},e)}async _pollTick(){if(!this.isConnected)return;if(typeof document<`u`&&document.visibilityState===`hidden`){this._schedulePoll();return}let e=cm(this);if(!e||e!==this._activeInstanceId)return;let t=await sV(e);this.isConnected&&e===this._activeInstanceId&&(t.data?(this._flightsCache=t.data,this._flightsError=!1):this._flightsError=!0,this._flightsLoading=!1,this._schedulePoll(),this._paint())}_scheduleRender(){this._renderScheduled||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&this._renderAsync()}))}async _renderAsync(){if(this._renderInProgress)this._renderQueued=!0;else{this._renderInProgress=!0;try{let e=cm(this),t=mm(),n=aV(),r=window[Ac],i={primaryColor:typeof r?.primaryColor==`string`?r.primaryColor:void 0,secondaryColor:typeof r?.secondaryColor==`string`?r.secondaryColor:void 0};e!==this._activeInstanceId&&(this._clearPoll(),this._activeInstanceId=e,this._flightsCache=null,this._flightsLoading=!0,this._flightsError=!1,this._resolvedTheme=hV(null,i)),this._paint();let a=null,o={attempted:!1,durationMs:0},s;if(e&&t){let t=await hm(e);o=t.metrics;let n=t.config;n?.widgetType&&n.widgetType!==`fids-board`&&(console.warn(`[airport-one-widgets] Widget instance type does not match fids-board:`,n.widgetType),s=`widget_type_mismatch`,n=null),a=n,this._resolvedTheme=hV(a,i),o.attempted&&a===null&&s===void 0&&o.failureKind&&(s=o.failureKind)}else this._resolvedTheme=hV(null,i);if(!this.isConnected)return;let c=MH(a);this._publicConsentAnalytics=c.consentAnalytics;let l=om(this,`consent-analytics`,c.consentAnalytics),u=!o.attempted&&(!t||!e)?t?`no_instance_id`:`no_api_base`:void 0;if(l){let n=o.attempted?`attempt:${t}|${e}|${a===null?`fail`:`ok`}|${s??``}`:`skip:${u??`none`}`;n!==this._lastPublicConfigTelemetryKey&&(this._lastPublicConfigTelemetryKey=n,Sh(!0,{widget_runtime:`fids-board`,widget_instance_id:Np(e)??void 0,attempted:o.attempted,duration_ms:o.durationMs,ok:o.attempted?a!==null:!1,error_kind:o.attempted&&a===null?s:void 0,skip_reason:u}))}if(a===null&&e&&t&&console.warn(`${um}: fids-board — managed instance config not applied or wrong type.`),e&&n){let t=await sV(e);if(!this.isConnected||e!==this._activeInstanceId)return;t.data?(this._flightsCache=t.data,this._flightsError=!1):this._flightsError=!0,this._flightsLoading=!1,this._schedulePoll()}else this._flightsLoading=!1,this._flightsError=!1,(!e||!n)&&(this._flightsCache=null);this._paint(),l&&!this._mountTelemetrySent&&(this._mountTelemetrySent=!0,Ch(!0,{widget_runtime:`fids-board`,widget_instance_id:Np(e)??void 0,public_config_unavailable:a===null&&!!t}))}finally{this._renderInProgress=!1,this._renderQueued&&(this._renderQueued=!1,queueMicrotask(()=>{this.isConnected&&this._renderAsync()}))}}}_paint(){let e=this._shadow??=this.attachShadow({mode:`closed`});if(!this._shadowStylesInjected){let t=document.createElement(`style`);t.textContent=l_,e.appendChild(t),this._shadowStylesInjected=!0}let t=this._mount??=document.createElement(`span`);t.style.display=`block`,t.style.width=`100%`,t.style.maxWidth=`100%`,t.style.minWidth=`0`,t.style.boxSizing=`border-box`,t.parentNode!==e&&e.appendChild(t);let n=om(this,`consent-analytics`,this._publicConsentAnalytics);(this._reactRoot??=rm.createRoot(t)).render((0,K.jsx)(DH,{payload:this._flightsCache,loading:this._flightsLoading,error:this._flightsError,consentAnalytics:n,theme:this._resolvedTheme,dataRefreshSchedule:this._dataRefreshSchedule}))}};customElements.get(`fma-fids-board`)||customElements.define(`fma-fids-board`,NH);var PH=[`plane`,`plane-departure`,`compass`,`earth-americas`,`location-dot`,`suitcase`];function FH(e){if(typeof e!=`string`)return;let t=e.trim().toUpperCase();return/^[A-Z]{3}$/.test(t)?t:void 0}function IH(e){let t=e?.trim().toLowerCase();if(t===`true`)return!0;if(t===`false`)return!1}function LH(e){let t=e?.trim().toLowerCase();if(t===`middle-right`)return`middle-right`;if(t===`bottom-right`)return`bottom-right`}function RH(e){let t=e?.trim().toLowerCase();if(t===`floating`||t===`attached`)return t}function zH(e){if(typeof e!=`string`)return;let t=e.trim();return/^#[0-9a-fA-F]{6}$/.test(t)?t:void 0}function BH(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function VH(e){let t=e?.trim().toLowerCase();if(t===`text`||t===`icon`||t===`both`)return t}function HH(e){let t=e?.trim().toLowerCase();if(t)return PH.includes(t)?t:void 0}function UH(e){if(!e||e.widgetType!==`flymyairport-fab`)return{};let t={},n=FH(e.iata);n&&(t.iata=n);let r=e.variables?.preview;if(r?.variableOverridesEnabled&&r.variableOverrideValues){let e=r.variableOverrideValues,n=FH(e.iata)??FH(e.sourceIata);n&&(t.iata=n);let i=IH(e.consentAnalytics);i!==void 0&&(t.consentAnalytics=i);let a=IH(e.consentAdvertising);a!==void 0&&(t.consentAdvertising=a);let o=IH(e.consentFunctional);o!==void 0&&(t.consentFunctional=o);let s=BH(e.label);s&&(t.label=s);let c=IH(e.enableCars);c!==void 0&&(t.enableCars=c);let l=IH(e.enableHotels);l!==void 0&&(t.enableHotels=l);let u=IH(e.enablePackages);u!==void 0&&(t.enablePackages=u);let d=LH(e.position);d&&(t.position=d);let f=RH(e.edgeStyle)??RH(e[`edge-style`]);f&&(t.edgeStyle=f);let p=zH(e.primaryColor);p&&(t.primaryColor=p);let m=zH(e.secondaryColor);m&&(t.secondaryColor=m);let h=BH(e.airfareSearchWidgetInstanceId)??BH(e[`airfare-search-widget-instance-id`]);h&&(t.airfareSearchWidgetInstanceId=h);let g=VH(e.primaryButtonContent)??VH(e[`primary-button-content`]);g&&(t.primaryButtonContent=g);let _=VH(e.secondaryButtonContent)??VH(e[`secondary-button-content`]);_&&(t.secondaryButtonContent=_);let v=HH(e.primaryIcon)??HH(e[`primary-icon`]);v&&(t.primaryIcon=v)}return r?.stylesEnabled&&r.customStyles?.trim()&&(t.userStyleBlock=r.customStyles),t}function WH(e){return FH(e.sourceIataAttribute)??FH(e.publicIata)??FH(e.globalIata??void 0)}function GH(e){return IH(e.consentAttribute??void 0)??e.publicConsent??!0}function KH(e){return BH(e.labelAttribute)??BH(e.publicLabel)??`Plan your trip`}function qH(e){return IH(e.rawAttribute??void 0)??e.publicToggle??!0}function JH(e){return BH(e.rawAttribute)??BH(e.publicAirfareSearchWidgetInstanceId)}function YH(e){return LH(e.rawAttribute)??e.publicPosition??`middle-right`}function XH(e){return RH(e.rawAttribute)??e.publicEdgeStyle??`floating`}function ZH(e){return VH(e.rawAttribute)??e.publicMode??`both`}function QH(e){return HH(e.rawAttribute)??e.publicIcon??`plane`}function $H(e){return zH(e.primaryColorAttribute)??zH(e.publicPrimaryColor)??zH(e.globalPrimaryColor)??`#b91c1c`}function eU(e){return zH(e.secondaryColorAttribute)??zH(e.publicSecondaryColor)??zH(e.globalSecondaryColor)??`#b91c1c`}function tU(e,t){let n=FH(e);if(!n)throw Error(`Invalid IATA code for vertical URL`);return`https://flymyairport.com/from/${encodeURIComponent(n)}/${t}`}function nU(e,t,n){if(!e||typeof window>`u`)return;let r=window.consentedAnalytics;try{r?.track?.(t,n)}catch{}}var rU=Gw(`aone:inline-flex aone:shrink-0 aone:items-center aone:justify-center aone:gap-2 aone:rounded-md aone:text-sm aone:font-medium aone:whitespace-nowrap aone:transition-all aone:outline-none aone:focus-visible:border-ring aone:focus-visible:ring-[3px] aone:focus-visible:ring-ring/50 aone:disabled:pointer-events-none aone:disabled:opacity-50 aone:aria-invalid:border-destructive aone:aria-invalid:ring-destructive/20 aone:dark:aria-invalid:ring-destructive/40 aone:[&_svg]:pointer-events-none aone:[&_svg]:shrink-0 aone:[&_svg:not([class*=size-])]:size-4`,{variants:{variant:{default:`aone:bg-primary aone:text-primary-foreground aone:hover:bg-primary/90`,destructive:`aone:bg-destructive aone:text-white aone:hover:bg-destructive/90 aone:focus-visible:ring-destructive/20 aone:dark:bg-destructive/60 aone:dark:focus-visible:ring-destructive/40`,outline:`aone:border aone:bg-background aone:shadow-xs aone:hover:bg-accent aone:hover:text-accent-foreground aone:dark:border-input aone:dark:bg-input/30 aone:dark:hover:bg-input/50`,secondary:`aone:bg-secondary aone:text-secondary-foreground aone:hover:bg-secondary/80`,ghost:`aone:hover:bg-accent aone:hover:text-accent-foreground aone:dark:hover:bg-accent/50`,link:`aone:text-primary aone:underline-offset-4 aone:hover:underline`,save:`aone:bg-save aone:text-save-foreground aone:hover:bg-save/90`,success:`aone:bg-success aone:text-success-foreground aone:hover:bg-success/90`},size:{default:`aone:h-9 aone:px-4 aone:py-2 aone:has-[>svg]:px-3`,xs:`aone:h-6 aone:gap-1 aone:rounded-md aone:px-2 aone:text-xs aone:has-[>svg]:px-1.5 aone:[&_svg:not([class*=size-])]:size-3`,sm:`aone:h-8 aone:gap-1.5 aone:rounded-md aone:px-3 aone:has-[>svg]:px-2.5`,lg:`aone:h-10 aone:rounded-md aone:px-6 aone:has-[>svg]:px-4`,icon:`aone:size-9`,"icon-xs":`aone:size-6 aone:rounded-md aone:[&_svg:not([class*=size-])]:size-3`,"icon-sm":`aone:size-8`,"icon-lg":`aone:size-10`}},defaultVariants:{variant:`default`,size:`default`}});function iU({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?J_:`button`;return(0,K.jsx)(a,{"data-slot":`button`,"data-variant":t,"data-size":n,className:vE(rU({variant:t,size:n,className:e})),...i})}var aU={plane:XE,"plane-departure":BE,compass:nD,"earth-americas":HE,"location-dot":rD,suitcase:UE};function oU({iata:e,consentAnalytics:t,consentAdvertising:n,consentFunctional:r,label:i,enableCars:a,enableHotels:o,enablePackages:s,primaryColor:c,secondaryColor:l,position:u,edgeStyle:d=`floating`,airfareSearchWidgetInstanceId:f,primaryButtonContent:p=`both`,secondaryButtonContent:m=`both`,primaryIcon:h=`plane`,dialogPortalContainer:g,layoutContained:_=!1}){let[v,y]=(0,G.useState)(!1),[b,x]=(0,G.useState)(!1),S=(0,G.useCallback)(()=>{y(!1),nU(t,`Widget FYF Closed`,{iata:e??null})},[t,e]),C=(0,G.useCallback)(()=>{y(!0),nU(t,`Widget FYF Opened`,{iata:e??null})},[t,e]),w=(0,G.useCallback)(()=>{v?S():C()},[S,v,C]);(0,G.useEffect)(()=>{if(!v||b)return;let e=e=>{e.key===`Escape`&&(e.stopPropagation(),S())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[S,v,b]);let T=n=>{e&&(nU(t,`Widget FYF Vertical Clicked`,{iata:e,vertical:n}),S())},E=()=>{e&&(x(!0),y(!1),nU(t,`Widget FYF Flight Modal Opened`,{iata:e}))},D=[{vertical:`cars`,label:`Cars`,Icon:F_},{vertical:`packages`,label:`Packages`,Icon:R_},{vertical:`hotels`,label:`Hotels`,Icon:P_}].filter(({vertical:e})=>e===`cars`?a:e===`hotels`?o:s),O=p!==`text`,k=p!==`icon`,A=m!==`text`,j=m!==`icon`,M=O&&k?`aone:gap-1.5 aone:sm:gap-2 aone:px-2.5 aone:sm:px-5`:O&&!k?`aone:gap-0 aone:justify-center aone:px-2 aone:sm:px-3`:`aone:gap-0 aone:justify-center aone:px-2.5 aone:sm:px-5`,N=d===`attached`?`aone:right-0`:`aone:right-4`,P=d===`attached`?`aone:rounded-l-full aone:rounded-r-none`:`aone:rounded-full`,ee=A&&j?`aone:justify-start aone:gap-2`:`aone:justify-center aone:gap-0`,F=u===`bottom-right`?`aone:top-auto aone:bottom-4`:`aone:top-0 aone:bottom-0`,te=u===`bottom-right`?`aone:flex aone:flex-col aone:items-end aone:gap-3`:`aone:flex aone:flex-row aone:items-center aone:gap-3`,ne=_?`aone:absolute`:`aone:fixed`,I=(0,G.useMemo)(()=>({right:d===`attached`?`0px`:`var(--fyf-fab-shell-right, 1rem)`,bottom:`var(--fyf-fab-shell-bottom, 1rem)`}),[d]),re=e=>{let t=[`aone:delay-0`,`aone:delay-75`,`aone:delay-100`,`aone:delay-150`,`aone:delay-200`];return[`aone:animate-in`,`aone:fade-in-0`,u===`bottom-right`?`aone:slide-in-from-bottom-4`:`aone:slide-in-from-right-4`,`aone:zoom-in-95`,`aone:duration-250`,`aone:ease-out`,`aone:fill-mode-both`,t[Math.min(e,t.length-1)]??`aone:delay-200`].join(` `)},L=(0,K.jsxs)(K.Fragment,{children:[v?(0,K.jsx)(`div`,{"aria-hidden":!0,className:`aone:pointer-events-auto ${ne} aone:inset-0 aone:z-90 aone:bg-black/5 aone:animate-in aone:fade-in-0 aone:duration-300 aone:ease-out`,onClick:S,onKeyDown:e=>{e.key===`Escape`&&S()}}):null,(0,K.jsxs)(`div`,{className:`aone:pointer-events-none ${ne} ${F} ${N} ${te} ${b?`aone:z-40`:`aone:z-100`}`,"data-fyf-speed-dial":!0,part:`fab-shell`,style:I,children:[v?(0,K.jsx)(`div`,{className:`aone:pointer-events-auto aone:flex aone:w-max aone:min-w-0 aone:flex-col aone:items-stretch aone:gap-2`,part:`fab-travel-menu`,role:`menu`,"aria-label":`Travel options`,children:e?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(iU,{"aria-label":j?void 0:`Flights`,className:`aone:h-11 aone:w-full aone:rounded-full aone:border-0 aone:px-4 aone:text-sm aone:text-white aone:sm:text-base aone:shadow-md aone:focus-visible:ring-offset-2 ${ee} ${re(0)}`,onClick:E,part:`fab-menu-item`,role:`menuitem`,style:{backgroundColor:l},type:`button`,variant:`default`,children:[A?(0,K.jsx)(L_,{"aria-hidden":!0,className:`aone:size-4 aone:shrink-0 aone:sm:size-5 aone:lg:size-6`}):null,j?`Flights`:null]}),D.map(({vertical:t,label:n,Icon:r},i)=>(0,K.jsx)(iU,{asChild:!0,className:`aone:h-11 aone:w-full aone:rounded-full aone:border-0 aone:px-4 aone:text-sm aone:text-white aone:sm:text-base aone:shadow-md aone:focus-visible:ring-offset-2 ${ee} ${re(i+1)}`,part:`fab-menu-item`,role:`menuitem`,style:{backgroundColor:l},variant:`default`,children:(0,K.jsxs)(`a`,{"aria-label":j?void 0:n,href:tU(e,t),onClick:()=>T(t),rel:`noopener noreferrer`,target:`_blank`,children:[A?(0,K.jsx)(r,{"aria-hidden":!0,className:`aone:size-4 aone:shrink-0 aone:sm:size-5 aone:lg:size-6`}):null,j?n:null]})},t))]}):(0,K.jsxs)(`div`,{className:`aone:w-full aone:max-w-[min(100vw-6rem,20rem)] aone:rounded-full aone:border aone:border-amber-200 aone:bg-amber-50 aone:px-4 aone:py-3 aone:text-sm aone:sm:text-base aone:text-amber-950 aone:shadow-md ${re(0)}`,role:`status`,children:[`Add a valid managed instance id or`,` `,(0,K.jsx)(`code`,{className:`aone:rounded aone:bg-white/80 aone:px-1`,children:`source-iata`}),`.`]})}):null,(0,K.jsxs)(iU,{"aria-expanded":v,"aria-haspopup":`menu`,"aria-label":v?`Close Plan your trip menu`:`Open Plan your trip menu`,className:`aone:pointer-events-auto aone:h-10 aone:sm:h-12 ${P} aone:border-0 aone:bg-[#b91c1c] aone:text-sm aone:text-white aone:sm:text-base aone:shadow-lg aone:transition-[transform,box-shadow] aone:duration-200 aone:ease-out aone:hover:bg-[#991b1b] aone:focus-visible:ring-[#b91c1c] ${M} ${v?`aone:scale-105 aone:shadow-xl`:`aone:scale-100`}`,onClick:w,part:`fab-toggle`,style:{backgroundColor:c},type:`button`,variant:`default`,children:[O?v?(0,K.jsx)(iN,{"aria-hidden":!0,className:`aone:size-4 aone:shrink-0 aone:sm:size-5 aone:lg:size-6`,icon:YE}):(0,K.jsx)(iN,{"aria-hidden":!0,className:`aone:size-4 aone:shrink-0 aone:sm:size-5 aone:lg:size-6`,icon:aU[h]}):null,k?(0,K.jsx)(`span`,{className:`aone:max-w-38 aone:truncate aone:text-sm aone:font-semibold aone:lg:text-base aone:sm:max-w-44`,children:v?`Close`:i}):null]})]}),(0,K.jsx)(sB,{onOpenChange:n=>{x(n),n||nU(t,`Widget FYF Flight Modal Closed`,{iata:e??null})},open:b,children:(0,K.jsxs)(uB,{"aria-describedby":void 0,className:`a1-visual-viewport-modal aone:top-0 aone:right-0 aone:bottom-0 aone:left-0 aone:m-auto aone:h-fit aone:w-[min(95vw,90rem)] aone:max-w-[min(95vw,90rem)] aone:translate-none aone:gap-0 aone:p-0 aone:sm:max-w-[min(95vw,90rem)]`,overlayClassName:`aone:backdrop-blur-md aone:bg-black/40`,portalContainer:g,children:[(0,K.jsx)(dB,{className:`aone:sr-only`,children:`Find Your Flight`}),(0,K.jsx)(`div`,{className:`aone:p-4`,children:e?(0,G.createElement)(`fma-airfare-search`,{key:`fyf-embed-airfare-${e}`,className:`aone:block aone:w-full`,"consent-analytics":String(t),"consent-advertising":String(n),"consent-functional":String(r),...f?{"data-widget-instance-id":f}:{origin:e}}):(0,K.jsx)(`p`,{className:`aone:p-4 aone:text-sm aone:sm:text-base aone:text-muted-foreground`,children:`Airport code unavailable; cannot load flights.`})})]})})]});return _?(0,K.jsx)(`div`,{className:`aone:relative aone:isolate aone:min-h-[min(20rem,50vh)] aone:w-full`,children:L}):L}function sU({shadowRoot:e,userStyleBlock:t,...n}){return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`style`,{children:l_}),t?(0,K.jsx)(`style`,{children:t}):null,(0,K.jsx)(oU,{dialogPortalContainer:e,...n})]})}var cU=[`source-iata`,`primary-color`,`secondary-color`,`consent-analytics`,`consent-advertising`,`consent-functional`,`label`,`enable-cars`,`enable-hotels`,`enable-packages`,`airfare-search-widget-instance-id`,`position`,`edge-style`,`primary-button-content`,`secondary-button-content`,`primary-icon`,Pp,`id`,`data-preview-contained`],lU=`--fyf-fab-shell-bottom`,uU=`--fyf-fab-shell-right`,dU=`fma-fab`;function fU(e){if(typeof e!=`string`)return null;let t=e.trim();return t?/^-?\d+(\.\d+)?$/.test(t)?`${t}px`:/^-?\d+(\.\d+)?(px|rem|em|vh|vw|%)$/.test(t)?t:null:null}function pU(e){if(typeof e!=`string`)return;let t=e.trim();if(t)return t.split(dU).join(`:host`)}var mU=class extends HTMLElement{_shadowRoot;_mountPoint;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;static get observedAttributes(){return Array.from(cU)}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this._scheduleRender()}connectedCallback(){this.style.position=`relative`,this.style.display=`contents`,this._scheduleRender()}disconnectedCallback(){this._reactRoot&&=(this._reactRoot.unmount(),void 0)}_scheduleRender(){this._renderScheduled||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&this._renderAsync()}))}_resolveInstanceId(){return this.getAttribute(Pp)?.trim()||this.id?.trim()||null}async _renderAsync(){if(this._renderInProgress)this._renderQueued=!0;else{this._renderInProgress=!0;try{let e=this._resolveInstanceId(),t=mm(),n=null,r={attempted:!1,durationMs:0};if(e&&t){let t=await hm(e);r=t.metrics,n=t.config}n?.widgetType&&n.widgetType!==`flymyairport-fab`&&(console.warn(`[airport-one-widgets] Widget instance type does not match flymyairport-fab:`,n.widgetType),n=null);let i=n?.variables?.preview?.stylesEnabled===!0?n.variables.preview.styleVariableValues:void 0,a=fU(i?.shellBottom),o=fU(i?.shellRight);a?this.style.setProperty(lU,a):this.style.removeProperty(lU),o?this.style.setProperty(uU,o):this.style.removeProperty(uU);let s=window[Ac],c=UH(n),l=pU(c.userStyleBlock),u=typeof s?.iata==`string`?s.iata:null,d=typeof s?.primaryColor==`string`?s.primaryColor:null,f=typeof s?.secondaryColor==`string`?s.secondaryColor:null,p=WH({sourceIataAttribute:this.getAttribute(`source-iata`),publicIata:c.iata,globalIata:u}),m=GH({consentAttribute:this.getAttribute(`consent-analytics`),publicConsent:c.consentAnalytics}),h=GH({consentAttribute:this.getAttribute(`consent-advertising`),publicConsent:c.consentAdvertising}),g=GH({consentAttribute:this.getAttribute(`consent-functional`),publicConsent:c.consentFunctional}),_=KH({labelAttribute:this.getAttribute(`label`),publicLabel:c.label}),v=qH({rawAttribute:this.getAttribute(`enable-cars`),publicToggle:c.enableCars}),y=qH({rawAttribute:this.getAttribute(`enable-hotels`),publicToggle:c.enableHotels}),b=qH({rawAttribute:this.getAttribute(`enable-packages`),publicToggle:c.enablePackages}),x=YH({rawAttribute:this.getAttribute(`position`),publicPosition:c.position}),S=XH({rawAttribute:this.getAttribute(`edge-style`),publicEdgeStyle:c.edgeStyle}),C=$H({primaryColorAttribute:this.getAttribute(`primary-color`),publicPrimaryColor:c.primaryColor,globalPrimaryColor:d}),w=eU({secondaryColorAttribute:this.getAttribute(`secondary-color`),publicSecondaryColor:c.secondaryColor,globalSecondaryColor:f}),T=JH({rawAttribute:this.getAttribute(`airfare-search-widget-instance-id`),publicAirfareSearchWidgetInstanceId:c.airfareSearchWidgetInstanceId}),E=ZH({rawAttribute:this.getAttribute(`primary-button-content`),publicMode:c.primaryButtonContent}),D=ZH({rawAttribute:this.getAttribute(`secondary-button-content`),publicMode:c.secondaryButtonContent}),O=QH({rawAttribute:this.getAttribute(`primary-icon`),publicIcon:c.primaryIcon});if(!r.attempted&&(!e||!t)&&n===null&&console.warn(`${um}: flymyairport-fab — managed config fetch skipped; using element attributes only.`),r.attempted&&n===null&&console.warn(`${um}: flymyairport-fab — managed config unavailable; using element attributes fallback.`),!this.isConnected)return;this._paint({iata:p,consentAnalytics:m,consentAdvertising:h,consentFunctional:g,label:_,enableCars:v,enableHotels:y,enablePackages:b,position:x,edgeStyle:S,primaryColor:C,secondaryColor:w,airfareSearchWidgetInstanceId:T,primaryButtonContent:E,secondaryButtonContent:D,primaryIcon:O,userStyleBlock:l,layoutContained:this.hasAttribute(`data-preview-contained`)})}finally{this._renderInProgress=!1,this._renderQueued&&(this._renderQueued=!1,queueMicrotask(()=>{this.isConnected&&this._renderAsync()}))}}}_paint(e){let t=this._shadowRoot??=this.attachShadow({mode:`closed`}),n=this._mountPoint??=document.createElement(`span`);n.parentNode!==t&&t.appendChild(n),(this._reactRoot??=rm.createRoot(n)).render((0,K.jsx)(sU,{consentAnalytics:e.consentAnalytics,consentAdvertising:e.consentAdvertising,consentFunctional:e.consentFunctional,enableCars:e.enableCars,enableHotels:e.enableHotels,enablePackages:e.enablePackages,airfareSearchWidgetInstanceId:e.airfareSearchWidgetInstanceId,iata:e.iata,label:e.label,layoutContained:e.layoutContained,position:e.position,edgeStyle:e.edgeStyle,primaryColor:e.primaryColor,secondaryColor:e.secondaryColor,primaryButtonContent:e.primaryButtonContent,secondaryButtonContent:e.secondaryButtonContent,primaryIcon:e.primaryIcon,userStyleBlock:e.userStyleBlock,shadowRoot:t}))}};customElements.get(`fma-fab`)||customElements.define(`fma-fab`,mU);var hU=B().regex(/^\d{4}-(0[1-9]|1[0-2])$/),gU=U({month:hU,days:Xs([H(),H(),H(),H(),H(),H(),H()])}),_U=U({iata:B(),name:B(),city:B(),latitude:V(),longitude:V()}),vU=U({code:B(),name:B(),shortName:B(),logoUrl:B()}),yU=U({iata:B(),city:B(),destinationCount:V().int().nonnegative()}),bU=U({airline:B(),via:B().nullable(),months:Vs(hU),operatingDays:V().int().nonnegative(),weekdaysByMonth:Vs(gU).optional(),seasonal:H()}),xU=U({iata:B(),name:B(),city:B(),region:B(),countryCode:B(),countryName:B(),latitude:V(),longitude:V(),distanceMiles:V().int().nonnegative(),imageUrl:B(),options:Vs(bU).min(1)}),SU=U({apiVersion:nc(1),origin:_U,months:Vs(hU),airlines:Vs(vU),hubs:Vs(yU),destinations:Vs(xU)}),CU={"north-america":[[-135,12],[-58,58]],world:[[-170,-48],[175,70]]},wU={light:`https://tiles.openfreemap.org/styles/liberty`,dark:`https://tiles.openfreemap.org/styles/dark`},TU=`#0b3d91`,EU=`#f26430`,DU=/^(-?\d+(?:\.\d+)?)\s+(\d+(?:\.\d+)?)%\s+(\d+(?:\.\d+)?)%$/;function OU(e,t){let n=e?.trim();if(!n)return t;if(Kp.test(n))return n;let r=DU.exec(n);return r?`hsl(${r[1]}, ${r[2]}%, ${r[3]}%)`:n}var kU=`route-map`;function AU(e,t,n){return e.hasAttribute(t)?e.getAttribute(t)?.trim().toLowerCase()!==`false`:n??!1}function jU(e){let t=e?.trim().toLowerCase();return t===`true`||t===`false`?t===`true`:void 0}function MU(e){let t=e?.trim().toLowerCase();return t===`world`||t===`north-america`?t:void 0}function NU(e){if(!e||e.widgetType!==`route-map`)return{};let t={},n=typeof e.iata==`string`?e.iata.trim():``;n.length===3&&(t.origin=n.toUpperCase());let r=e.variables?.preview;if(r?.variableOverridesEnabled&&r.variableOverrideValues){let e=r.variableOverrideValues;(e.theme===`light`||e.theme===`dark`)&&(t.theme=e.theme),e.primaryColor?.trim()&&(t.primaryColor=e.primaryColor.trim()),e.secondaryColor?.trim()&&(t.secondaryColor=e.secondaryColor.trim()),e.heading?.trim()&&(t.heading=e.heading.trim()),e.kicker?.trim()&&(t.kicker=e.kicker.trim()),e.description?.trim()&&(t.description=e.description.trim());let n=MU(e.defaultRegion);n&&(t.defaultRegion=n),e.defaultStops?.trim()&&(t.defaultStops=e.defaultStops.trim()),e.defaultAirline?.trim()&&(t.defaultAirline=e.defaultAirline.trim()),e.defaultMonths?.trim()&&(t.defaultMonths=e.defaultMonths.trim()),e.defaultHub?.trim()&&(t.defaultHub=e.defaultHub.trim()),e.defaultSort?.trim()&&(t.defaultSort=e.defaultSort.trim());let i=e.consentAnalytics?.trim().toLowerCase();(i===`true`||i===`false`)&&(t.consentAnalytics=i===`true`);let a=jU(e.mapOnly);a!==void 0&&(t.mapOnly=a);let o=jU(e.hideFilters);o!==void 0&&(t.hideFilters=o);let s=jU(e.hideHeader);s!==void 0&&(t.hideHeader=s)}return r?.stylesEnabled&&r.customStyles?.trim()&&(t.userStyleBlock=r.customStyles),t}function PU(e,t,n,r){let i=e.hasAttribute(`data-widget-preview`)?{origin:n.origin}:n,a=am(e)??i.theme??`light`;return{instanceId:r,origin:i.origin,kicker:e.getAttribute(`kicker`)??i.kicker??`Interactive route map`,heading:im(e,`heading`)??i.heading??`Where We Fly`,description:im(e,`description`)??i.description,hideHeader:AU(e,`hide-header`,i.hideHeader),mapOnly:AU(e,`map-only`,i.mapOnly),hideFilters:AU(e,`hide-filters`,i.hideFilters),primaryColor:OU(im(e,`primary-color`)??i.primaryColor??t?.primaryColor,TU),accentColor:OU(im(e,`secondary-color`)??i.secondaryColor??t?.secondaryColor,EU),theme:a,styleUrl:im(e,`map-style`)??(a===`dark`?wU.dark:wU.light),defaultRegion:MU(im(e,`default-region`))??i.defaultRegion??`north-america`,initialSettings:{stops:im(e,`default-stops`)??i.defaultStops,airline:im(e,`default-airline`)??i.defaultAirline,months:im(e,`default-months`)??i.defaultMonths,hub:im(e,`default-hub`)??i.defaultHub,sort:im(e,`default-sort`)??i.defaultSort},consentAnalytics:om(e,`consent-analytics`,i.consentAnalytics),userStyleBlock:i.userStyleBlock}}var FU=`5.24.0`,IU=[`https://unpkg.com/maplibre-gl@${FU}/dist`,`https://cdn.jsdelivr.net/npm/maplibre-gl@${FU}/dist`],LU=IU.map(e=>`${e}/maplibre-gl.css`);function RU(){return window.maplibregl}var zU=null;function BU(e){return new Promise((t,n)=>{let r=document.createElement(`script`);r.src=e,r.async=!0,r.crossOrigin=`anonymous`,r.onload=()=>t(),r.onerror=()=>{r.remove(),n(Error(`Failed to load ${e}`))},document.head.appendChild(r)})}function VU(){let e=RU();return e?Promise.resolve(e):zU||(zU=(async()=>{let e;for(let t of IU)try{await BU(`${t}/maplibre-gl.js`);let e=RU();if(e)return e}catch(t){e=t}throw zU=null,e??Error(`MapLibre failed to load`)})(),zU)}var HU=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],UU=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`];function WU(e){let t=/^(\d{4})-(\d{2})$/.exec(e);if(!t)return null;let n=Number(t[2])-1;return n<0||n>11?null:{year:Number(t[1]),index:n}}function GU(e){let t=WU(e);return t?HU[t.index]??e:e}function KU(e){let t=WU(e);return t?`${UU[t.index]} ${t.year}`:e}function qU(e,t){let n=WU(e);if(!n)return e;let r=HU[n.index];return t===0||n.index===0?`${r} '${String(n.year%100).padStart(2,`0`)}`:r??e}function JU(e,t){let n=new Set(e),r=[],i=[];for(let e of t)n.has(e)?i.push(e):i.length>0&&(r.push(i),i=[]);return i.length>0&&r.push(i),r.map(e=>{let t=GU(e[0]);return e.length===1?t:`${t}–${GU(e[e.length-1])}`}).join(`, `)}function YU(e,t){return e.length===0?`Traveling`:e.length>3?`${e.length} months`:e.map(e=>qU(e,t.indexOf(e))).join(`, `)}var XU=50;function ZU(e){return e>XU?`${XU}+`:String(e)}function QU(e){return`${Math.round(e).toLocaleString(`en-US`)} mi`}var $U={stops:`all`,airline:null,months:[],hub:null,seasonalOnly:!1};function eW(e){return{...e,months:[...e.months]}}function tW(e,t){return e.length===t.length&&e.every(e=>t.includes(e))}function nW(e,t){return{airline:e.airline!==t.airline,months:!tW(e.months,t.months),hub:e.hub!==t.hub}}function rW(e,t){return e.stops===t.stops&&e.airline===t.airline&&e.hub===t.hub&&e.seasonalOnly===t.seasonalOnly&&tW(e.months,t.months)}function iW(e){return[...new Set(e)]}function aW(e){return e.options.filter(e=>e.via===null).reduce((e,t)=>e+t.operatingDays,0)}function oW(e){return Math.max(...e.options.map(e=>e.operatingDays))}function sW(e,t){return e.nonstop===t.nonstop?e.nonstop?aW(t)-aW(e)||e.destination.iata.localeCompare(t.destination.iata):oW(t)-oW(e)||t.options.length-e.options.length||e.destination.distanceMiles-t.destination.distanceMiles||e.destination.iata.localeCompare(t.destination.iata):e.nonstop?-1:1}function cW(e,t){switch(t){case`nonstop`:return e.nonstop;case`one-stop`:return!e.nonstop;case`all`:return!0}}function lW(e,t,n,r,i){let a=t.filter(e=>e.via===null),o=a.length>0,s=o?a:t,c=s.every(e=>e.seasonal),l=iW(s.flatMap(e=>e.months));return{destination:e,options:t,nonstop:o,airlines:iW(s.map(e=>e.airline)),vias:o?[]:iW(t.flatMap(e=>e.via?[e.via]:[])),seasonal:c,seasonLabel:c?JU(l,r):null,faded:i,isHub:n.hub!==null&&e.iata===n.hub}}function uW(e,t){return t!==null&&e.airlines.length>1&&e.airlines.slice(0,4).includes(t)?t:null}function dW(e,t){if(t===null)return e;let n=e.options.filter(e=>e.airline===t);return n.length>0?{...e,options:n,airlines:[t]}:e}function fW(e,t){let n=[],r=new Map(e.hubs.map(e=>[e.iata,0]));for(let i of e.destinations){let a=t.airline?i.options.filter(e=>e.airline===t.airline):i.options;if(a.length===0)continue;let o=a,s=!1;if(t.months.length>0){let e=new Set(t.months),n=a.filter(t=>t.months.some(t=>e.has(t)));n.length>0?o=n:s=!0}let c=o.some(e=>e.via===null);if(!c)for(let e of iW(o.flatMap(e=>e.via?[e.via]:[])))r.has(e)&&r.set(e,(r.get(e)??0)+1);let l=o;if(t.hub){if(i.iata===t.hub)l=o.filter(e=>e.via===null);else if(c)continue;else l=o.filter(e=>e.via===t.hub);if(l.length===0)continue}n.push(lW(i,l,t,e.months,s))}let i=n.some(e=>e.seasonal),a=t.seasonalOnly?n.filter(e=>e.seasonal):n,o={all:a.length,nonstop:a.filter(e=>e.nonstop).length,oneStop:a.filter(e=>!e.nonstop).length},s=a.filter(e=>cW(e,t.stops)).sort(sW);return{destinations:[...s.filter(e=>!e.faded),...s.filter(e=>e.faded)],counts:o,hubCounts:r,hasSeasonal:i}}function pW(e){return e.normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).toLowerCase().trim()}function mW(e,t){let n=pW(t);return!n||[e.city,e.iata,e.name,e.countryName].some(e=>pW(e).includes(n))}function hW(e,t){if(t===`recommended`)return[...e];let n=(e,n)=>{if(t===`name`)return e.destination.city.localeCompare(n.destination.city);let r=e.destination.distanceMiles-n.destination.distanceMiles;return t===`nearest`?r:-r};return[...e.filter(e=>!e.faded).sort(n),...e.filter(e=>e.faded).sort(n)]}var gW=[`jan`,`feb`,`mar`,`apr`,`may`,`jun`,`jul`,`aug`,`sep`,`oct`,`nov`,`dec`],_W={all:`all`,any:`all`,nonstop:`nonstop`,"non-stop":`nonstop`,direct:`nonstop`,"one-stop":`one-stop`,"1-stop":`one-stop`,onestop:`one-stop`,connecting:`one-stop`},vW=[`recommended`,`nearest`,`farthest`,`name`];function yW(e){if(/^\d{1,2}$/.test(e)){let t=Number(e);return t>=1&&t<=12?t-1:null}let t=gW.indexOf(e.slice(0,3));return e.length>=3&&t>=0?t:null}function bW(e,t){if(!e?.trim())return[];let n=new Set;for(let r of e.toLowerCase().split(/[\s,]+/).filter(Boolean)){if(/^\d{4}-\d{2}$/.test(r)){t.includes(r)&&n.add(r);continue}let e=yW(r);if(e===null)continue;let i=`-${String(e+1).padStart(2,`0`)}`,a=t.find(e=>e.endsWith(i));a&&n.add(a)}return t.filter(e=>n.has(e))}function xW(e,t){let n=e?.trim().toLowerCase();return n?t.airlines.find(e=>e.code.toLowerCase()===n||e.shortName.toLowerCase()===n||e.name.toLowerCase()===n)?.code??null:null}function SW(e,t={}){let n=t.hub?.trim().toUpperCase(),r=t.sort?.trim().toLowerCase();return{filters:{...$U,stops:_W[t.stops?.trim().toLowerCase()??``]??$U.stops,airline:xW(t.airline,e),months:bW(t.months,e.months),hub:n&&e.hubs.some(e=>e.iata===n)?n:null},sort:r&&vW.includes(r)?r:`recommended`}}function CW(e){return[e.stops,e.airline,e.months,e.hub,e.sort].map(e=>e?.trim().toLowerCase()??``).join(`|`)}var wW=[{color:`#0B3D91`,width:3.5,dasharray:null},{color:`#C8102E`,width:2.9,dasharray:[1.6,1.3]},{color:`#00853E`,width:2.9,dasharray:[.4,1.4]},{color:`#E35205`,width:3.2,dasharray:[2.8,1.1]},{color:`#5C068C`,width:2.7,dasharray:[1.2,.55,.25,.55]}];function TW(e,t,n){let r=new Map,i=[];for(let t of e){if(t.via==null)continue;let e=r.get(t.via);e?e.includes(t.airline)||e.push(t.airline):(i.push(t.via),r.set(t.via,[t.airline]))}return i.map((e,i)=>{let a=r.get(e)??[],o=i%5;return{via:e,airlines:a,styleIndex:o,style:wW[o],label:`via ${t.get(e)??e} (${e}) on ${a.map(n).join(`, `)}`}})}function EW(e){let t=e.filter(e=>e.via===null);return t.length>0?t:[...e]}function DW(e,t){return t.map((t,n)=>t||!!e?.[n])}function OW(e,t){return e.every((e,n)=>e===t[n])}function kW(e,t,n){let r=EW(e);if(r.length===0||r.some(e=>!Array.isArray(e.weekdaysByMonth)))return null;let i=n.months.length>0?new Set(n.months):null,a=new Map;for(let e of r){let t=a.get(e.airline)??new Map;a.set(e.airline,t);for(let{month:n,days:r}of e.weekdaysByMonth??[])i&&!i.has(n)||!r.some(Boolean)||t.set(n,DW(t.get(n),r))}if([...a.values()].every(e=>e.size===0))return null;let o=n.onlyAirline&&a.has(n.onlyAirline)?[n.onlyAirline]:[...a.keys()],s=new Map;for(let e of o)for(let[t,n]of a.get(e)??[])s.set(t,DW(s.get(t),n));let c=[...s.values()],l=c.some(e=>!OW(e,c[0]??e)),u=Ip.map((e,r)=>{let i=o.flatMap(e=>{let i=a.get(e)??new Map,o=[...i].filter(([,e])=>e[r]).map(([e])=>e);return o.length===0?[]:o.length<i.size?[`${t(e)} (${JU(o,n.windowMonths)})`]:[t(e)]});return{letter:Fp[r]??``,flies:i.length>0,tip:i.length>0?`${e} · ${i.join(`, `)}`:`No flights ${e}`}});return{chips:u,daily:!l&&u.every(e=>e.flies),variesBySeason:l}}function AW({airline:e,className:t=`aone:size-5`}){let[n,r]=(0,G.useState)(!1);return n||!e.logoUrl?(0,K.jsx)(`span`,{title:e.name,className:`${t} aone:inline-flex aone:items-center aone:justify-center aone:rounded aone:bg-slate-100 aone:text-[0.55rem] aone:font-bold aone:text-slate-600`,children:e.code}):(0,K.jsx)(`img`,{src:e.logoUrl,alt:e.name,title:e.name,loading:`lazy`,onError:()=>r(!0),className:`${t} aone:object-contain`})}var jW=`(max-width: 639px)`;function MW(e){if(typeof window>`u`||typeof window.matchMedia!=`function`)return()=>void 0;let t=window.matchMedia(jW);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)}function NW(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(max-width: 639px)`).matches}var PW=(0,G.createContext)(null);function FW(){let e=(0,G.useContext)(PW),t=(0,G.useSyncExternalStore)(MW,NW,()=>!1);return e??t}function IW(e){let t=(0,G.useCallback)(t=>{if(!e||typeof ResizeObserver>`u`)return()=>void 0;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[e]);return(0,G.useSyncExternalStore)(t,()=>e&&typeof ResizeObserver<`u`?e.clientWidth<=640:null,()=>null)}var LW=(0,G.createContext)(null);function RW(){return(0,G.useContext)(LW)}function zW(e){let t=e.getBoundingClientRect();return{left:t.left+t.width/2,top:t.top<48?t.bottom:t.top,below:t.top<48}}function BW({chip:e,tipKey:t,activeTipKey:n,onTipShow:r,onTipHide:i}){let a=(0,G.useRef)(null),o=(0,G.useId)(),s=RW(),[c,l]=(0,G.useState)(null),u=n===t,d=()=>{let e=a.current;e&&(l(zW(e)),r(t))};(0,G.useEffect)(()=>{if(!u)return;let e=()=>i(t);return window.addEventListener(`scroll`,e,!0),()=>window.removeEventListener(`scroll`,e,!0)},[u,i,t]);let f=u&&c?(0,K.jsx)(`span`,{id:o,role:`tooltip`,className:c.below?`rm-weekday-tip rm-weekday-tip--below`:`rm-weekday-tip`,style:{left:c.left,top:c.top},children:e.tip}):null;return(0,K.jsxs)(`span`,{role:`listitem`,children:[(0,K.jsx)(`button`,{ref:a,type:`button`,className:`rm-weekday-chip`,"data-flies":e.flies,"aria-label":e.tip,"aria-describedby":u?o:void 0,onMouseEnter:d,onMouseLeave:()=>i(t),onFocus:d,onBlur:()=>i(t),children:e.letter}),f&&s?(0,cv.createPortal)(f,s):f]})}function VW({model:e}){let[t,n]=(0,G.useState)(null),r=e.daily?`Daily`:e.variesBySeason?`Varies by season`:null;return(0,K.jsxs)(`div`,{className:`rm-weekday-strip`,children:[(0,K.jsx)(`div`,{role:`list`,"aria-label":e.daily?`Flights every day`:e.variesBySeason?`Days with flights, varies by season`:`Days with flights`,className:`rm-weekday-days`,children:e.chips.map((e,r)=>{let i=String(r);return(0,K.jsx)(BW,{chip:e,tipKey:i,activeTipKey:t,onTipShow:n,onTipHide:e=>n(t=>t===e?null:t)},i)})}),r?(0,K.jsx)(`span`,{className:`rm-weekday-note`,children:r}):null]})}function HW({src:e,iata:t}){let[n,r]=(0,G.useState)(!1);return n?(0,K.jsx)(`span`,{"aria-hidden":!0,className:`aone:flex aone:size-[55px] aone:shrink-0 aone:items-center aone:justify-center aone:rounded-lg aone:bg-gradient-to-br aone:from-[var(--rm-primary)] aone:to-[var(--rm-accent)] aone:text-xs aone:font-bold aone:text-white`,children:t}):(0,K.jsx)(`img`,{src:e,alt:``,loading:`lazy`,onError:()=>r(!0),className:`aone:size-[55px] aone:shrink-0 aone:rounded-lg aone:object-cover aone:bg-slate-100`})}function UW({style:e}){let t=e.dasharray!=null;return(0,K.jsx)(`span`,{"aria-hidden":!0,className:`aone:mt-1.5 aone:inline-block aone:h-0.5 aone:w-3.5 aone:shrink-0 aone:rounded-full`,style:t?{backgroundImage:`repeating-linear-gradient(90deg, ${e.color} 0 4px, transparent 4px 7px)`}:{background:e.color,height:e.width>=3.3?3:2}})}function WW(e){return e.nonstop?`Nonstop`:e.vias.length===1?`VIA ${e.vias[0]}`:`One-stop`}function GW({view:e,airlinesByCode:t,cityByIata:n,months:r,selectedMonths:i}){let a=e=>t.get(e)?.shortName??e,{destination:o}=e,s=e.options.filter(e=>e.via===null).map(e=>a(e.airline)),c=e.nonstop?[]:TW(e.options,n,a);return(0,K.jsx)(`div`,{className:`aone:mt-2 aone:rounded-lg aone:bg-slate-50 aone:p-2.5`,children:(0,K.jsxs)(`div`,{className:`aone:min-w-0 aone:space-y-1 aone:text-xs aone:text-slate-600`,children:[s.length>0?(0,K.jsxs)(`p`,{children:[`Nonstop on `,s.join(`, `)]}):null,c.map(e=>(0,K.jsxs)(`p`,{className:`aone:flex aone:items-start aone:gap-1.5`,children:[(0,K.jsx)(UW,{style:e.style}),(0,K.jsxs)(`span`,{children:[`1 stop `,e.label]})]},e.via)),(0,K.jsxs)(`p`,{className:`aone:pt-0.5 aone:text-slate-500`,children:[QU(o.distanceMiles),e.faded&&i.length>0?(0,K.jsxs)(`span`,{className:`aone:ml-1 aone:text-slate-600`,children:[`· Not flying in `,JU(i,r)]}):null]})]})})}function KW({airlines:e,isolated:t,pinned:n,onHover:r,onTogglePin:i}){return(0,K.jsx)(`span`,{className:`aone:flex aone:shrink-0 aone:items-center aone:gap-1.5`,children:e.map(e=>(0,K.jsx)(`button`,{type:`button`,className:`rm-airline-isolate`,"aria-pressed":n===e.code,"aria-label":`Show only ${e.shortName}`,"data-active":t===e.code,"data-dim":t!==null&&t!==e.code,onPointerEnter:t=>{t.pointerType===`mouse`&&r(e.code)},onPointerLeave:e=>{e.pointerType===`mouse`&&r(null)},onClick:t=>{t.stopPropagation(),i(e.code)},children:(0,K.jsx)(AW,{airline:e,className:`aone:size-[20px]`})},e.code))})}function qW({view:e,airlinesByCode:t,cityByIata:n,months:r,selectedMonths:i,selected:a,onSelect:o,pinned:s,onTogglePin:c,href:l,onOpenDestination:u,ref:d}){let{destination:f}=e,[p,m]=(0,G.useState)(null),h=e=>t.get(e)?.shortName??e,g=e.airlines.map(e=>t.get(e)).filter(e=>!!e),_=g.slice(0,4),v={months:i,windowMonths:r},y=kW(e.options,h,v),b=_.length>1,x=uW(e,s),S=b?x??(e=>e!==null&&_.some(t=>t.code===e)?e:null)(p):null,C=S?kW(e.options,h,{...v,onlyAirline:S}):null,w=C&&y?{...C,chips:C.chips.map((e,t)=>({...e,tip:y.chips[t]?.tip??e.tip}))}:y,T=()=>o(a?null:f.iata),E=l?(0,K.jsxs)(`a`,{href:l,target:`_blank`,rel:`noopener noreferrer`,onClick:()=>u(f.iata),className:`aone:shrink-0 aone:rounded-full aone:bg-[var(--rm-primary)] aone:px-3 aone:py-1.5 aone:text-xs aone:font-semibold aone:whitespace-nowrap aone:text-white aone:hover:opacity-90`,children:[`View flights`,(0,K.jsxs)(`span`,{className:`aone:sr-only`,children:[` `,`to `,f.city,` (`,f.iata,`)`]})]}):null,D=(0,K.jsxs)(K.Fragment,{children:[b?null:_.map(e=>(0,K.jsx)(AW,{airline:e,className:`aone:size-[20px]`},e.code)),g.length>4?(0,K.jsxs)(`span`,{className:`aone:font-normal aone:text-slate-500`,children:[`+`,g.length-4]}):null,g.length>0?(0,K.jsx)(`span`,{"aria-hidden":!0,className:`aone:text-slate-300`,children:`|`}):null,(0,K.jsx)(`span`,{children:WW(e)}),e.seasonal?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{"aria-hidden":!0,className:`aone:text-slate-300`,children:`|`}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`span`,{className:`aone:font-bold aone:text-[var(--rm-accent)]`,children:`Seasonal`}),e.seasonLabel?(0,K.jsx)(`span`,{children:` · ${e.seasonLabel}`}):null]})]}):null]});return(0,K.jsxs)(`li`,{ref:d,className:[`aone:border-b aone:border-slate-100 aone:transition-opacity`,e.faded&&!a?`aone:opacity-45`:``,a?`aone:bg-[color-mix(in_srgb,var(--rm-primary)_6%,white)]`:``].join(` `),children:[(0,K.jsxs)(`div`,{className:[`aone:flex aone:flex-col aone:gap-1.5 aone:px-3 aone:py-2.5 aone:transition-colors`,a?``:`aone:hover:bg-slate-50`].join(` `),children:[(0,K.jsxs)(`div`,{className:`aone:flex aone:items-start aone:gap-3`,children:[(0,K.jsx)(`button`,{type:`button`,"aria-expanded":a,"aria-label":`${a?`Collapse`:`Expand`} ${f.city} (${f.iata})`,onClick:T,className:`aone:shrink-0 aone:cursor-pointer aone:rounded-lg aone:p-0`,children:(0,K.jsx)(HW,{src:f.imageUrl,iata:f.iata})}),(0,K.jsxs)(`div`,{className:`aone:flex aone:min-w-0 aone:flex-1 aone:flex-col`,children:[(0,K.jsx)(`button`,{type:`button`,"aria-expanded":a,onClick:T,className:`aone:w-full aone:text-left aone:cursor-pointer`,children:(0,K.jsxs)(`p`,{className:`aone:mb-1 aone:min-w-0 aone:truncate aone:leading-tight aone:text-slate-900`,children:[(0,K.jsx)(`span`,{className:`aone:text-[14px] aone:font-semibold`,children:f.city}),` `,(0,K.jsxs)(`span`,{className:`aone:text-[12px] aone:text-slate-500`,children:[`(`,f.iata,`)`]})]})}),(0,K.jsxs)(`div`,{className:`aone:flex aone:items-center aone:gap-1.5`,children:[b?(0,K.jsx)(KW,{airlines:_,isolated:S,pinned:x,onHover:m,onTogglePin:c}):null,b?(0,K.jsx)(`div`,{className:`aone:flex aone:min-w-0 aone:flex-1 aone:flex-wrap aone:items-center aone:gap-1.5 aone:text-[12px] aone:leading-tight aone:font-semibold aone:tracking-wide aone:text-slate-600`,children:D}):(0,K.jsx)(`button`,{type:`button`,"aria-expanded":a,onClick:T,className:`aone:flex aone:min-w-0 aone:flex-1 aone:flex-wrap aone:items-center aone:gap-1.5 aone:text-left aone:text-[12px] aone:leading-tight aone:font-semibold aone:tracking-wide aone:text-slate-600 aone:cursor-pointer`,children:D})]})]})]}),w||E?(0,K.jsxs)(`div`,{className:[`aone:flex aone:min-w-0 aone:items-center aone:gap-2`,w?`aone:justify-between`:`aone:justify-end`].join(` `),children:[w?(0,K.jsx)(`div`,{className:`aone:min-w-0 aone:overflow-hidden`,children:(0,K.jsx)(VW,{model:w})}):null,E]}):null]}),a?(0,K.jsx)(`div`,{className:`aone:px-3 aone:pb-2.5`,children:(0,K.jsx)(GW,{view:dW(e,x),airlinesByCode:t,cityByIata:n,months:r,selectedMonths:i})}):null]})}var JW=[{value:`recommended`,label:`Recommended`},{value:`nearest`,label:`Nearest first`},{value:`farthest`,label:`Farthest first`},{value:`name`,label:`Name (A–Z)`}];function YW({views:e,search:t,onSearchChange:n,sort:r,onSortChange:i,airlinesByCode:a,cityByIata:o,months:s,selectedMonths:c,selectedIata:l,onSelect:u,pinnedAirlines:d,onTogglePin:f,destinationUrl:p,onOpenDestination:m}){let h=(0,G.useRef)(null),g=(0,G.useRef)(null),[_,v]=(0,G.useState)(!1),y=FW(),b=_||t.trim().length>0;return(0,G.useEffect)(()=>{h.current?.scrollIntoView({block:`nearest`,behavior:`smooth`})},[l]),(0,G.useEffect)(()=>{_&&g.current?.focus()},[_]),(0,K.jsxs)(`div`,{className:`aone:flex aone:h-full aone:min-h-0 aone:flex-col`,children:[(0,K.jsxs)(`div`,{className:`aone:space-y-3 aone:p-3 aone:pb-2`,children:[(0,K.jsxs)(`div`,{className:`aone:flex aone:items-center aone:justify-between aone:gap-2`,children:[(0,K.jsxs)(`label`,{children:[(0,K.jsx)(`span`,{className:`aone:sr-only`,children:`Sort destinations`}),(0,K.jsx)(`select`,{value:r,onChange:e=>i(e.target.value),className:`aone:rounded-lg aone:border aone:border-slate-200 aone:bg-white aone:px-2.5 aone:py-1.5 aone:text-sm aone:text-slate-800 aone:cursor-pointer`,children:JW.map(e=>(0,K.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),(0,K.jsxs)(`button`,{type:`button`,"aria-expanded":b,"aria-controls":`route-map-destination-search`,onClick:()=>v(e=>!e),className:`aone:inline-flex aone:shrink-0 aone:items-center aone:gap-1.5 aone:text-sm aone:font-medium aone:text-slate-700 aone:cursor-pointer`,children:[(0,K.jsx)(iN,{icon:LE,className:`aone:size-4`,"aria-hidden":!0}),`Search`]})]}),b?(0,K.jsxs)(`label`,{className:`aone:relative aone:block`,children:[(0,K.jsx)(`span`,{className:`aone:sr-only`,children:`Search destinations`}),(0,K.jsx)(iN,{icon:LE,className:`aone:pointer-events-none aone:absolute aone:top-1/2 aone:left-3.5 aone:size-4 aone:-translate-y-1/2 aone:text-slate-400`}),(0,K.jsx)(`input`,{id:`route-map-destination-search`,ref:g,type:`search`,value:t,onChange:e=>n(e.target.value),placeholder:y?`Search city, code or country`:`Search a city, airport code or country`,className:`aone:w-full aone:rounded-xl aone:border aone:border-slate-200 aone:bg-white aone:py-2.5 aone:pr-3 aone:pl-10 aone:text-sm aone:text-slate-900 aone:placeholder:text-slate-400 aone:outline-none aone:focus:border-slate-200 aone:focus:outline-none aone:focus:ring-0`})]}):null]}),e.length===0?(0,K.jsx)(`p`,{className:`aone:px-4 aone:py-10 aone:text-center aone:text-sm aone:text-slate-500`,children:`No destinations match. Try another search or clear a filter.`}):(0,K.jsx)(`ul`,{part:`route-map-destination-list`,className:`aone:min-h-0 aone:flex-1 aone:overflow-y-auto aone:border-t aone:border-slate-100`,children:e.map(e=>{let t=e.destination.iata===l;return(0,K.jsx)(qW,{ref:t?h:void 0,view:e,airlinesByCode:a,cityByIata:o,months:s,selectedMonths:c,selected:t,onSelect:u,pinned:d[e.destination.iata]??null,onTogglePin:t=>f(e.destination.iata,t),href:p(e.destination.iata),onOpenDestination:m},e.destination.iata)})})]})}var XW=`rm-points`,ZW=`rm-lines`,QW=`rm-points`;function $W(e,t,n,r){let i=r??t,a=r??n;e.setPaintProperty(`rm-lines-connecting`,`line-color`,i),e.setPaintProperty(`rm-lines-nonstop`,`line-color`,a),e.setPaintProperty(`rm-lines-hub`,`line-color`,a),e.setPaintProperty(`rm-lines-selected-nonstop`,`line-color`,[`coalesce`,[`get`,`color`],`#0f172a`]);for(let t=0;t<5;t+=1){let n=wW[t];e.setPaintProperty(`rm-lines-selected-${t}`,`line-color`,[`coalesce`,[`get`,`color`],n.color])}e.setPaintProperty(QW,`circle-color`,[`case`,[`get`,`seasonal`],`#ffffff`,[`get`,`nonstop`],n,t]),e.setPaintProperty(QW,`circle-stroke-color`,[`case`,[`get`,`selected`],`#0f172a`,[`get`,`nonstop`],n,[`get`,`seasonal`],t,`#ffffff`])}function eG(e,t){e.addSource(ZW,{type:`geojson`,data:t.lines}),e.addSource(XW,{type:`geojson`,data:t.points});let n=(t,n,r,i)=>e.addLayer({id:t,type:`line`,source:ZW,filter:[`==`,[`get`,`kind`],n],layout:{"line-cap":`round`,"line-join":`round`},paint:{"line-width":r,"line-opacity":[`case`,[`get`,`faded`],i[0],i[1]]}});n(`rm-lines-connecting`,`connecting`,.65,[.03,.14]),n(`rm-lines-nonstop`,`nonstop`,1.4,[.15,.55]),n(`rm-lines-hub`,`hub`,2.4,[.25,.75]),e.addLayer({id:`rm-lines-selected-nonstop`,type:`line`,source:ZW,filter:[`all`,[`==`,[`get`,`kind`],`selected`],[`==`,[`get`,`pathRole`],`nonstop`]],layout:{"line-cap":`round`,"line-join":`round`},paint:{"line-width":[`coalesce`,[`get`,`width`],3.25],"line-opacity":1,"line-offset":[`coalesce`,[`get`,`offset`],0],"line-color":[`coalesce`,[`get`,`color`],`#0f172a`]}});for(let t=0;t<5;t+=1){let n=wW[t],r={"line-width":[`coalesce`,[`get`,`width`],n.width],"line-opacity":1,"line-offset":[`coalesce`,[`get`,`offset`],0],"line-color":[`coalesce`,[`get`,`color`],n.color]};n.dasharray&&(r[`line-dasharray`]=[...n.dasharray]),e.addLayer({id:`rm-lines-selected-${t}`,type:`line`,source:ZW,filter:[`all`,[`==`,[`get`,`kind`],`selected`],[`==`,[`get`,`pathRole`],`connecting`],[`==`,[`get`,`styleIndex`],t]],layout:{"line-cap":`round`,"line-join":`round`},paint:r})}e.addLayer({id:QW,type:`circle`,source:XW,layout:{"circle-sort-key":[`case`,[`get`,`selected`],3,[`get`,`nonstop`],2,1]},paint:{"circle-radius":[`interpolate`,[`linear`],[`zoom`],2,[`case`,[`get`,`selected`],7,[`get`,`nonstop`],5,2.6],6,[`case`,[`get`,`selected`],10,[`get`,`nonstop`],8,4.5]],"circle-stroke-width":[`case`,[`get`,`selected`],3,[`get`,`seasonal`],1.8,1],"circle-opacity":[`case`,[`get`,`faded`],.25,1],"circle-stroke-opacity":[`case`,[`get`,`faded`],.3,1]}}),e.addLayer({id:`rm-labels`,type:`symbol`,source:XW,filter:[`all`,[`any`,[`get`,`labelled`],[`get`,`selected`]],[`!`,[`get`,`faded`]]],layout:{"text-field":[`get`,`label`],"text-font":[`Noto Sans Bold`],"text-size":11,"text-anchor":`left`,"text-offset":[.8,0],"text-optional":!0,"symbol-sort-key":[`case`,[`get`,`selected`],0,1]},paint:{"text-color":`#0f172a`,"text-halo-color":`#ffffff`,"text-halo-width":1.5}}),$W(e,t.primaryColor,t.accentColor)}function tG(e){let t=document.createElement(`div`);t.className=`rm-origin`;let n=document.createElement(`span`);n.className=`rm-origin__dot`;let r=document.createElement(`span`);return r.className=`rm-origin__label`,r.textContent=`${e.city||e.name} (${e.iata})`,t.append(n,r),t}function nG(e){let t=document.createElement(`div`),n=document.createElement(`strong`);n.textContent=`${e.label} (${e.iata})`;let r=document.createElement(`div`);return r.className=`rm-popup__meta`,r.textContent=[e.nonstop?`Nonstop`:`1 stop`,e.seasonal?`Seasonal`:null].filter(Boolean).join(` · `),t.append(n,r),t}function rG(e,t,n){e.getSource(XW)?.setData(t),e.getSource(ZW)?.setData(n)}function iG(e){let t=(0,G.useRef)(null),n=(0,G.useRef)(null),r=(0,G.useRef)(e),[i,a]=(0,G.useState)(`loading`),o=`${e.origin.iata}:${e.origin.latitude}:${e.origin.longitude}`;(0,G.useEffect)(()=>{r.current=e}),(0,G.useEffect)(()=>{let e=!1,i=null,o=null;return VU().then(s=>{let c=t.current;if(e||!c)return;let l=r.current;i=new s.Map({container:c,style:l.styleUrl,bounds:CU[l.region],fitBoundsOptions:{padding:24},attributionControl:{compact:!0},cooperativeGestures:!0,dragRotate:!1,pitchWithRotate:!1,touchPitch:!1}),i.touchZoomRotate.disableRotation(),n.current=i,new s.Marker({element:tG(l.origin),anchor:`left`,offset:[-9,0]}).setLngLat([l.origin.longitude,l.origin.latitude]).addTo(i);let u=new s.Popup({closeButton:!1,closeOnClick:!1,offset:10,className:`rm-popup`}),d=i;d.on(`load`,()=>{e||(eG(d,r.current),c.querySelector(`.maplibregl-ctrl-attrib`)?.classList.remove(`maplibregl-compact-show`),a(`ready`))}),d.on(`mouseenter`,QW,e=>{let t=e.features?.[0];t&&t.geometry.type===`Point`&&(d.getCanvas().style.cursor=`pointer`,u.setLngLat(t.geometry.coordinates).setDOMContent(nG(t.properties)).addTo(d))}),d.on(`mouseleave`,QW,()=>{d.getCanvas().style.cursor=``,u.remove()}),d.on(`click`,QW,e=>{let t=e.features?.[0]?.properties?.iata;typeof t==`string`&&r.current.onSelect(t)}),o=new ResizeObserver(()=>d.resize()),o.observe(c)}).catch(t=>{console.warn(`[airport-one-widgets] route map unavailable:`,t),e||a(`error`)}),()=>{e=!0,o?.disconnect(),i?.remove(),n.current=null}},[e.styleUrl,o]),(0,G.useEffect)(()=>{let t=n.current;i===`ready`&&t&&rG(t,e.points,e.lines)},[i,e.points,e.lines]),(0,G.useEffect)(()=>{let t=n.current;i===`ready`&&t&&$W(t,e.primaryColor,e.accentColor,e.airlineHighlightColor)},[i,e.primaryColor,e.accentColor,e.airlineHighlightColor]),(0,G.useEffect)(()=>{let t=n.current;i===`ready`&&t&&t.fitBounds(CU[e.region],{padding:24,duration:800})},[i,e.region,e.regionToken]),(0,G.useEffect)(()=>{let t=n.current;i===`ready`&&t&&e.focusBounds&&t.fitBounds(e.focusBounds,{padding:{top:60,bottom:60,left:60,right:60},maxZoom:6,duration:900})},[i,e.focusBounds]);let s=`aone:flex aone:size-9 aone:items-center aone:justify-center aone:text-slate-700 aone:hover:bg-slate-50 aone:cursor-pointer aone:disabled:opacity-40`;return(0,K.jsxs)(`div`,{className:`aone:relative aone:h-full aone:w-full aone:overflow-hidden aone:bg-[#dfe8f2]`,children:[(0,K.jsx)(`div`,{className:`aone:absolute aone:inset-0`,children:(0,K.jsx)(`div`,{ref:t,part:`route-map-canvas`,style:{width:`100%`,height:`100%`}})}),i===`loading`?(0,K.jsx)(`div`,{className:`aone:absolute aone:inset-0 aone:flex aone:items-center aone:justify-center aone:text-sm aone:text-slate-500`,children:`Loading map…`}):null,i===`error`?(0,K.jsx)(`div`,{className:`aone:absolute aone:inset-0 aone:flex aone:items-center aone:justify-center aone:p-6 aone:text-center aone:text-sm aone:text-slate-600`,children:e.mapOnly?`The map couldn't load here.`:`The map couldn't load here. The destination list still works.`}):null,i===`ready`?(0,K.jsxs)(`div`,{className:`aone:absolute aone:top-3 aone:right-3 aone:flex aone:flex-col aone:divide-y aone:divide-slate-200 aone:overflow-hidden aone:rounded-xl aone:border aone:border-slate-200 aone:bg-white aone:shadow-sm`,children:[(0,K.jsx)(`button`,{type:`button`,"aria-label":`Zoom in`,className:s,onClick:()=>n.current?.zoomIn(),children:(0,K.jsx)(iN,{icon:$E,className:`aone:size-3.5`})}),(0,K.jsx)(`button`,{type:`button`,"aria-label":`Zoom out`,className:s,onClick:()=>n.current?.zoomOut(),children:(0,K.jsx)(iN,{icon:IE,className:`aone:size-3.5`})}),(0,K.jsx)(`button`,{type:`button`,"aria-label":`Reset map view`,className:s,onClick:()=>n.current?.fitBounds(CU[e.region],{padding:24,duration:800}),children:(0,K.jsx)(iN,{icon:KE,className:`aone:size-3.5`})})]}):null,(0,K.jsx)(`div`,{className:`rm-legend-slot aone:pointer-events-none aone:absolute aone:bottom-3 aone:left-3`,children:e.legend})]})}function aG({kicker:e,heading:t,description:n,originIata:r,mapOnly:i,hideFilters:a}){let o=`Every dot is somewhere you can fly from ${r}.`,s=n??(i?`${o} Tap a city to see flights.`:a?`${o} Tap a city or search the list.`:`${o} Pick a hub to see what it unlocks, or search the list.`);return(0,K.jsxs)(`header`,{part:`route-map-header`,className:`aone:mb-4`,children:[e?(0,K.jsx)(`p`,{className:`aone:text-xs aone:font-semibold aone:tracking-[0.12em] aone:text-[var(--rm-accent)] aone:uppercase`,children:e}):null,(0,K.jsx)(`h2`,{className:`aone:mt-1 aone:text-3xl aone:font-semibold aone:text-slate-900 aone:dark:text-white`,children:t}),s?(0,K.jsx)(`p`,{className:`aone:mt-2 aone:text-sm aone:text-slate-600 aone:dark:text-slate-300`,children:s}):null]})}function oG({color:e,hollow:t}){return(0,K.jsx)(`span`,{"aria-hidden":!0,className:`aone:inline-block aone:size-2.5 aone:rounded-full`,style:t?{border:`2px solid ${e}`,background:`#fff`}:{background:e}})}function sG({counts:e,showSeasonal:t}){let n=[{key:`nonstop`,label:`Nonstop (${ZU(e.nonstop)})`,swatch:(0,K.jsx)(oG,{color:`var(--rm-accent)`})},{key:`one-stop`,label:`1 Stop (${ZU(e.oneStop)})`,swatch:(0,K.jsx)(oG,{color:`var(--rm-primary)`})},...t?[{key:`seasonal-nonstop`,label:`Seasonal nonstop`,swatch:(0,K.jsx)(oG,{color:`var(--rm-accent)`,hollow:!0})},{key:`seasonal-one-stop`,label:`Seasonal 1 stop`,swatch:(0,K.jsx)(oG,{color:`var(--rm-primary)`,hollow:!0})}]:[]];return(0,K.jsx)(`ul`,{part:`route-map-legend`,className:`aone:space-y-1 aone:rounded-xl aone:bg-white/95 aone:px-3 aone:py-2 aone:text-xs aone:text-slate-700 aone:shadow-sm`,children:n.map(e=>(0,K.jsxs)(`li`,{className:`aone:flex aone:items-center aone:gap-2`,children:[e.swatch,e.label]},e.key))})}function cG({title:e,description:t,onClose:n,onReset:r,resetLabel:i}){return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`aone:flex aone:items-start aone:justify-between aone:gap-3`,children:[(0,K.jsx)(`h3`,{className:`aone:text-base aone:font-semibold aone:text-slate-900`,children:e}),(0,K.jsxs)(`div`,{className:`aone:-mt-1 aone:flex aone:shrink-0 aone:items-center aone:gap-1`,children:[r?(0,K.jsxs)(`button`,{type:`button`,part:`route-map-filter-reset`,"aria-label":i??`Reset`,onClick:r,className:`aone:inline-flex aone:h-8 aone:items-center aone:gap-1.5 aone:rounded-full aone:px-2.5 aone:text-sm aone:font-medium aone:text-[var(--rm-primary)] aone:hover:bg-[color-mix(in_srgb,var(--rm-primary)_8%,white)] aone:cursor-pointer`,children:[(0,K.jsx)(iN,{icon:tD,className:`aone:size-3.5`,"aria-hidden":!0}),`Reset`]}):null,(0,K.jsx)(`button`,{type:`button`,"aria-label":`Close`,onClick:n,className:`aone:inline-flex aone:size-8 aone:shrink-0 aone:items-center aone:justify-center aone:rounded-full aone:bg-slate-100 aone:text-slate-600 aone:hover:bg-slate-200 aone:cursor-pointer`,children:(0,K.jsx)(iN,{icon:YE,className:`aone:size-4`})})]})]}),(0,K.jsx)(`p`,{className:`aone:mt-1 aone:mb-3 aone:text-xs aone:text-slate-500`,children:t})]})}function lG({icon:e,label:t,active:n,open:r,onOpenChange:i,title:a,description:o,children:s,align:c=`start`,variant:l=`popover`,doneLabel:u=`Done`,onReset:d,resetLabel:f}){let p=(0,G.useRef)(null),m=(0,G.useRef)(null),h=(0,G.useRef)(null),g=RW(),_=(0,G.useId)(),v=l===`drawer`;(0,G.useEffect)(()=>{let e=p.current;if(!r||!e)return;let t=e=>{e.key===`Escape`&&i(!1)};if(document.addEventListener(`keydown`,t),v)return()=>document.removeEventListener(`keydown`,t);let n=e.getRootNode(),a=n instanceof ShadowRoot?n.host:null,o=t=>{t.composedPath().includes(e)||i(!1)},s=t=>{let n=t.composedPath();(a?!n.includes(a):!n.includes(e))&&i(!1)};return a&&n.addEventListener(`pointerdown`,o,!0),document.addEventListener(`pointerdown`,s,!0),()=>{a&&n.removeEventListener(`pointerdown`,o,!0),document.removeEventListener(`pointerdown`,s,!0),document.removeEventListener(`keydown`,t)}},[r,i,v]),(0,G.useEffect)(()=>{if(!r||!v)return;let e=m.current,t=document.documentElement.style.overflow;return document.documentElement.style.overflow=`hidden`,h.current?.focus(),()=>{document.documentElement.style.overflow=t,e?.focus()}},[r,v]);let y=()=>i(!1),b=(0,K.jsxs)(`div`,{className:`rm-drawer`,part:`route-map-filter-drawer`,children:[(0,K.jsx)(`div`,{className:`rm-drawer__backdrop`,"aria-hidden":!0,onClick:y}),(0,K.jsxs)(`div`,{ref:h,id:_,role:`dialog`,"aria-modal":`true`,"aria-label":a,tabIndex:-1,className:`rm-drawer__sheet`,children:[(0,K.jsx)(`div`,{className:`rm-drawer__handle`,"aria-hidden":!0}),(0,K.jsx)(cG,{title:a,description:o,onClose:y,onReset:d,resetLabel:f}),(0,K.jsx)(`div`,{className:`rm-drawer__chips aone:flex aone:flex-wrap aone:gap-2`,children:s}),(0,K.jsx)(`button`,{type:`button`,onClick:y,className:`aone:mt-4 aone:w-full aone:rounded-full aone:bg-[var(--rm-primary)] aone:px-4 aone:py-3 aone:text-sm aone:font-semibold aone:text-white aone:cursor-pointer`,children:u})]})]});return(0,K.jsxs)(`div`,{ref:p,className:`rm-filter aone:relative`,children:[(0,K.jsxs)(`button`,{ref:m,type:`button`,part:`route-map-filter-button`,"aria-expanded":r,"aria-controls":_,"aria-haspopup":`dialog`,onClick:()=>i(!r),className:[`rm-filter__button aone:inline-flex aone:h-9 aone:items-center aone:gap-2 aone:rounded-full aone:border aone:px-3.5 aone:text-sm aone:whitespace-nowrap aone:font-medium aone:transition-colors aone:cursor-pointer`,n?`aone:border-[var(--rm-primary)] aone:bg-[color-mix(in_srgb,var(--rm-primary)_8%,white)] aone:text-[var(--rm-primary)]`:`aone:border-slate-200 aone:bg-white aone:text-slate-800 aone:hover:border-slate-300`,r?`aone:ring-2 aone:ring-[var(--rm-primary)]/30`:``].join(` `),children:[(0,K.jsx)(iN,{icon:e,className:`rm-filter__icon aone:size-3.5`,"aria-hidden":!0}),(0,K.jsx)(`span`,{className:`rm-filter__label aone:max-w-36 aone:truncate`,children:t}),(0,K.jsx)(iN,{icon:ZE,className:`aone:size-3 aone:shrink-0 aone:transition-transform ${r?`aone:rotate-180`:``}`,"aria-hidden":!0})]}),r&&v?g?(0,cv.createPortal)(b,g):b:null,r&&!v?(0,K.jsxs)(`div`,{id:_,role:`dialog`,"aria-label":a,part:`route-map-filter-panel`,className:[`aone:absolute aone:top-full aone:z-30 aone:mt-2 aone:w-[min(26rem,calc(100vw-2rem))] aone:rounded-2xl aone:border aone:border-slate-200 aone:bg-white aone:p-4 aone:shadow-xl`,c===`end`?`aone:right-0`:`aone:left-0`].join(` `),children:[(0,K.jsx)(cG,{title:a,description:o,onClose:y,onReset:d,resetLabel:f}),(0,K.jsx)(`div`,{className:`aone:flex aone:flex-wrap aone:gap-2`,children:s})]}):null]})}function uG({selected:e,onClick:t,children:n}){return(0,K.jsx)(`button`,{type:`button`,"aria-pressed":e,onClick:t,className:[`aone:inline-flex aone:items-center aone:gap-2 aone:rounded-full aone:border aone:px-3.5 aone:py-1.5 aone:text-sm aone:font-medium aone:transition-colors aone:cursor-pointer`,e?`aone:border-slate-900 aone:bg-slate-900 aone:text-white`:`aone:border-slate-200 aone:bg-white aone:text-slate-800 aone:hover:border-slate-400`].join(` `),children:n})}function dG({hub:e,count:t,selected:n,onClick:r}){return(0,K.jsxs)(uG,{selected:n,onClick:r,children:[(0,K.jsx)(`span`,{className:`aone:font-semibold`,children:e.iata}),(0,K.jsx)(`span`,{className:n?`aone:text-white/80`:`aone:text-slate-500`,children:e.city}),(0,K.jsx)(`span`,{className:[`aone:rounded-full aone:px-2 aone:text-xs aone:font-semibold aone:tabular-nums`,n?`aone:bg-white/20 aone:text-white`:`aone:bg-[color-mix(in_srgb,var(--rm-primary)_10%,white)] aone:text-[var(--rm-primary)]`].join(` `),children:t})]})}function fG({className:e,onReset:t}){return(0,K.jsxs)(`button`,{type:`button`,part:`route-map-reset`,"aria-label":`Reset filters`,onClick:t,className:`${e} aone:inline-flex aone:h-9 aone:shrink-0 aone:items-center aone:gap-1.5 aone:rounded-full aone:px-3 aone:text-sm aone:whitespace-nowrap aone:font-medium aone:text-[var(--rm-primary)] aone:hover:bg-[color-mix(in_srgb,var(--rm-primary)_8%,white)] aone:cursor-pointer`,children:[(0,K.jsx)(iN,{icon:tD,className:`aone:size-3.5`,"aria-hidden":!0}),`Reset`]})}function pG({label:e,options:t,value:n,onChange:r,className:i}){return(0,K.jsx)(`div`,{role:`radiogroup`,"aria-label":e,className:[`aone:inline-flex aone:items-center aone:gap-1 aone:rounded-full aone:bg-slate-100 aone:p-1`,i??``].join(` `),children:t.map(e=>{let t=e.value===n;return(0,K.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":t,onClick:()=>r(e.value),className:[`rm-segment aone:rounded-full aone:px-3.5 aone:py-1.5 aone:text-sm aone:font-medium aone:whitespace-nowrap aone:transition-colors aone:cursor-pointer`,t?`aone:bg-[var(--rm-primary)] aone:text-white aone:shadow-sm`:`aone:text-slate-700 aone:hover:text-slate-950`].join(` `),children:e.content},e.value)})})}var mG=[{value:`all`,label:`All`,count:`all`},{value:`nonstop`,label:`Nonstop`,count:`nonstop`},{value:`one-stop`,label:`One-stop`,count:`oneStop`}];function hG(e,t){switch(t){case`nonstop`:return e.nonstop;case`one-stop`:return e.oneStop;case`all`:return e.all}}function gG({title:e,children:t}){return(0,K.jsxs)(`section`,{className:`rm-filters-sheet__section`,children:[(0,K.jsx)(`h4`,{className:`rm-filters-sheet__heading`,children:e}),(0,K.jsx)(`div`,{className:`aone:flex aone:flex-wrap aone:gap-2`,children:t})]})}function _G({open:e,onClose:t,doneLabel:n,onResetAll:r,triggerRef:i,children:a}){let o=(0,G.useRef)(null),s=RW(),c=(0,G.useId)();if((0,G.useEffect)(()=>{if(!e)return;let n=i.current,r=e=>{e.key===`Escape`&&t()};document.addEventListener(`keydown`,r);let a=document.documentElement.style.overflow;return document.documentElement.style.overflow=`hidden`,o.current?.focus(),()=>{document.removeEventListener(`keydown`,r),document.documentElement.style.overflow=a,n?.focus()}},[e,t,i]),!e)return null;let l=(0,K.jsxs)(`div`,{className:`rm-drawer`,part:`route-map-filter-drawer`,children:[(0,K.jsx)(`div`,{className:`rm-drawer__backdrop`,"aria-hidden":!0,onClick:t}),(0,K.jsxs)(`div`,{ref:o,id:c,role:`dialog`,"aria-modal":`true`,"aria-label":`Filters`,tabIndex:-1,className:`rm-drawer__sheet`,children:[(0,K.jsx)(`div`,{className:`rm-drawer__handle`,"aria-hidden":!0}),(0,K.jsxs)(`div`,{className:`aone:flex aone:items-start aone:justify-between aone:gap-3`,children:[(0,K.jsx)(`h3`,{className:`aone:text-base aone:font-semibold aone:text-slate-900`,children:`Filters`}),(0,K.jsxs)(`div`,{className:`aone:-mt-1 aone:flex aone:shrink-0 aone:items-center aone:gap-1`,children:[r?(0,K.jsx)(`button`,{type:`button`,part:`route-map-filter-reset`,"aria-label":`Reset filters`,onClick:r,className:`aone:inline-flex aone:h-8 aone:items-center aone:gap-1.5 aone:rounded-full aone:px-2.5 aone:text-sm aone:font-medium aone:text-[var(--rm-primary)] aone:hover:bg-[color-mix(in_srgb,var(--rm-primary)_8%,white)] aone:cursor-pointer`,children:`Reset`}):null,(0,K.jsx)(`button`,{type:`button`,"aria-label":`Close`,onClick:t,className:`aone:inline-flex aone:size-8 aone:shrink-0 aone:items-center aone:justify-center aone:rounded-full aone:bg-slate-100 aone:text-slate-600 aone:hover:bg-slate-200 aone:cursor-pointer`,children:(0,K.jsx)(iN,{icon:YE,className:`aone:size-4`})})]})]}),(0,K.jsx)(`p`,{className:`aone:mt-1 aone:mb-3 aone:text-xs aone:text-slate-500`,children:`Narrow destinations by airline, travel month, hub, or seasonality.`}),(0,K.jsx)(`div`,{className:`rm-filters-sheet__body`,children:a}),(0,K.jsx)(`button`,{type:`button`,onClick:t,className:`aone:mt-4 aone:w-full aone:rounded-full aone:bg-[var(--rm-primary)] aone:px-4 aone:py-3 aone:text-sm aone:font-semibold aone:text-white aone:cursor-pointer`,children:n})]})]});return s?(0,cv.createPortal)(l,s):l}function vG({filters:e,startingFilters:t,onFiltersChange:n,counts:r,airlines:i,months:a,hubs:o,hubCounts:s,hasSeasonal:c,fullscreen:l,onToggleFullscreen:u,onReset:d}){let[f,p]=(0,G.useState)(null),m=(0,G.useRef)(null),h=e=>t=>p(t?e:null),g=FW(),_=g?`drawer`:`popover`,v=e=>{n(e),g||p(null)},y=hG(r,e.stops),b=nW(e,t),x=e.seasonalOnly!==t.seasonalOnly,S=b.airline?()=>n({airline:t.airline}):void 0,C=b.months?()=>n({months:[...t.months]}):void 0,w=b.hub?()=>n({hub:t.hub}):void 0,T=b.airline||b.months||b.hub||x?()=>n({airline:t.airline,months:[...t.months],hub:t.hub,seasonalOnly:t.seasonalOnly}):void 0,E=`Show ${ZU(y)} ${y===1?`destination`:`destinations`}`,D=i.find(t=>t.code===e.airline),O=o.find(t=>t.iata===e.hub),k=[e.airline,e.months.length>0,e.hub,e.seasonalOnly].filter(Boolean).length,A=c||e.seasonalOnly,j=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(uG,{selected:!e.airline,onClick:()=>v({airline:null}),children:`All airlines`}),i.map(t=>(0,K.jsxs)(uG,{selected:e.airline===t.code,onClick:()=>v({airline:t.code}),children:[(0,K.jsx)(AW,{airline:t,className:`aone:size-4`}),t.shortName]},t.code))]}),M=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(uG,{selected:e.months.length===0,onClick:()=>n({months:[]}),children:`Any time`}),a.map((t,r)=>{let i=e.months.includes(t);return(0,K.jsx)(uG,{selected:i,onClick:()=>n({months:a.filter(n=>n===t?!i:e.months.includes(n))}),children:(0,K.jsx)(`span`,{title:KU(t),children:qU(t,r)})},t)})]}),N=o.length>0?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(uG,{selected:!e.hub,onClick:()=>v({hub:null}),children:`All hubs`}),o.map(t=>(0,K.jsx)(dG,{hub:t,count:s.get(t.iata)??0,selected:e.hub===t.iata,onClick:()=>v({hub:t.iata,stops:e.stops===`nonstop`?`all`:e.stops})},t.iata))]}):null,P=A?(0,K.jsxs)(`button`,{type:`button`,"aria-pressed":e.seasonalOnly,title:`Show only seasonal destinations`,onClick:()=>n({seasonalOnly:!e.seasonalOnly}),className:[`rm-seasonal-button aone:inline-flex aone:h-9 aone:shrink-0 aone:items-center aone:gap-1.5 aone:rounded-full aone:border aone:px-3 aone:text-sm aone:font-medium aone:whitespace-nowrap aone:cursor-pointer`,e.seasonalOnly?`aone:border-[var(--rm-primary)] aone:bg-[color-mix(in_srgb,var(--rm-primary)_8%,white)] aone:text-[var(--rm-primary)]`:`aone:border-slate-200 aone:bg-white aone:text-slate-800 aone:hover:border-slate-300`].join(` `),children:[(0,K.jsx)(iN,{icon:JE,className:`aone:size-3.5`}),`Seasonal`]}):null;return(0,K.jsxs)(`div`,{part:`route-map-toolbar`,className:`rm-toolbar aone:flex aone:flex-wrap aone:items-center aone:gap-2 aone:border-b aone:border-slate-200 aone:p-3`,children:[(0,K.jsx)(pG,{className:`rm-toolbar__stops`,label:`Stops`,value:e.stops,onChange:e=>n({stops:e}),options:mG.map(e=>({value:e.value,content:e.value===`one-stop`?e.label:(0,K.jsxs)(K.Fragment,{children:[e.label,` `,(0,K.jsx)(`span`,{className:`rm-segment__count aone:inline-block aone:min-w-[3ch] aone:text-left aone:tabular-nums`,children:e.value===`all`?r.all.toLocaleString(`en-US`):ZU(r[e.count])})]})}))}),(0,K.jsxs)(`div`,{className:`rm-toolbar__filters aone:flex aone:flex-wrap aone:items-center aone:gap-2`,children:[g?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`rm-filter aone:relative`,children:(0,K.jsxs)(`button`,{ref:m,type:`button`,part:`route-map-filter-button`,"aria-expanded":f===`filters`,"aria-haspopup":`dialog`,onClick:()=>p(e=>e===`filters`?null:`filters`),className:[`rm-filter__button aone:inline-flex aone:h-9 aone:items-center aone:gap-2 aone:rounded-full aone:border aone:px-3.5 aone:text-sm aone:whitespace-nowrap aone:font-medium aone:transition-colors aone:cursor-pointer`,k>0?`aone:border-[var(--rm-primary)] aone:bg-[color-mix(in_srgb,var(--rm-primary)_8%,white)] aone:text-[var(--rm-primary)]`:`aone:border-slate-200 aone:bg-white aone:text-slate-800 aone:hover:border-slate-300`,f===`filters`?`aone:ring-2 aone:ring-[var(--rm-primary)]/30`:``].join(` `),children:[(0,K.jsx)(iN,{icon:qE,className:`rm-filter__icon aone:size-3.5`,"aria-hidden":!0}),(0,K.jsxs)(`span`,{className:`rm-filter__label`,children:[`Filters`,k>0?` · ${k}`:``]})]})}),(0,K.jsxs)(_G,{open:f===`filters`,onClose:()=>p(null),doneLabel:E,onResetAll:T,triggerRef:m,children:[(0,K.jsx)(gG,{title:`Airline`,children:j}),(0,K.jsx)(gG,{title:`When are you traveling?`,children:M}),N?(0,K.jsx)(gG,{title:`Connect through a hub`,children:N}):null,P?(0,K.jsx)(gG,{title:`Seasonality`,children:P}):null]})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(lG,{variant:_,doneLabel:E,icon:BE,onReset:S,resetLabel:`Reset airline`,label:D?.shortName??`Airline`,active:!!D,open:f===`airline`,onOpenChange:h(`airline`),title:`Airline`,description:`Show only routes flown by one airline.`,children:j}),(0,K.jsx)(lG,{variant:_,doneLabel:E,icon:WE,onReset:C,resetLabel:`Reset travel months`,label:YU(e.months,a),active:e.months.length>0,open:f===`month`,onOpenChange:h(`month`),title:`When are you traveling?`,description:`Pick one or more months. Routes that don't fly then fade on the map and drop to the bottom of the list.`,children:M}),o.length>0?(0,K.jsx)(lG,{variant:_,doneLabel:E,icon:VE,onReset:w,resetLabel:`Reset connecting hub`,label:O?`Via ${O.iata}`:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`rm-label-long`,children:`Connect via`}),(0,K.jsx)(`span`,{className:`rm-label-short`,children:`Hub`})]}),active:!!O,open:f===`hub`,onOpenChange:h(`hub`),title:`Connect through a hub`,description:`See what a single connection through each hub unlocks.`,children:N}):null,P]}),d?(0,K.jsx)(fG,{className:`rm-toolbar__reset`,onReset:()=>{p(null),d()}}):null]}),(0,K.jsx)(`div`,{className:`rm-toolbar__view aone:ml-auto aone:flex aone:items-center aone:gap-2`,children:(0,K.jsx)(`button`,{type:`button`,onClick:u,"aria-label":l?`Exit full screen`:`Full screen`,"aria-pressed":l,className:`rm-fullscreen-button aone:inline-flex aone:size-10 aone:items-center aone:justify-center aone:rounded-xl aone:border aone:border-slate-200 aone:bg-white aone:text-slate-700 aone:hover:border-slate-300 aone:cursor-pointer`,children:(0,K.jsx)(iN,{icon:l?eD:zE,className:`aone:size-4`})})})]})}var yG=`Route Map - Destination Opened`,bG=`https://flymyairport.com`,xG=/^[A-Z]{3}$/;function SG(e){let t=e.originIata.trim().toUpperCase(),n=e.destinationIata.trim().toUpperCase();if(!xG.test(t)||!xG.test(n))return null;let r=new URL(`/from/${t}/to/${n}`,bG),i=Np(e.widgetInstanceId);i&&r.searchParams.set(Ap,i);let a=Np(e.widgetType);return a&&r.searchParams.set(jp,a),r.searchParams.set(`enc_lid`,yp({airport:t,channel:`EMB`,page:`DEST`,action:`WLFLIGHTS`,originIATA:t,destinationIATA:n})),r.searchParams.set(`consent_analytics`,e.consentAnalytics?`true`:`false`),e.clickId&&r.searchParams.set(`enc_cid`,e.clickId),e.fromUrl&&r.searchParams.set(`from_url`,e.fromUrl),r.toString()}function CG(e){if(!e.consentAnalytics||typeof window>`u`)return;let t=e.originIata.trim().toUpperCase(),n=e.destinationIata.trim().toUpperCase(),r=Np(e.widgetInstanceId);Am({name:yG,properties:{airport_iata:t,origin:t,destination:n,desination:n,href:e.href,widget_type:e.widgetType,...r?{widget_instance_id:r}:{}}})}function wG(e){let t=SG(e);t&&typeof window<`u`&&(CG({...e,href:t}),window.open(t,`_blank`,`noopener,noreferrer`))}var TG=[`#0B3D91`,`#C8102E`,`#00853E`,`#5C068C`,`#00A3E0`,`#E35205`,`#6B2D5B`,`#FFB81C`,`#0033A0`,`#007A33`,`#A6192E`,`#2D9CDB`];function EG(e){let t=0;for(let n=0;n<e.length;n+=1)t=t*31+e.charCodeAt(n)>>>0;return t}function DG(e){let t=e.trim().toUpperCase();return t?TG[EG(t)%TG.length]:TG[0]}var OG=e=>e*Math.PI/180,kG=e=>e*180/Math.PI;function AG(e,t,n=48){let[r,i]=[OG(e[0]),OG(e[1])],[a,o]=[OG(t[0]),OG(t[1])],s=2*Math.asin(Math.sqrt(Math.sin((o-i)/2)**2+Math.cos(i)*Math.cos(o)*Math.sin((a-r)/2)**2));if(!Number.isFinite(s)||s<1e-9)return[e,t];let c=[];for(let e=0;e<=n;e+=1){let t=e/n,l=Math.sin((1-t)*s)/Math.sin(s),u=Math.sin(t*s)/Math.sin(s),d=l*Math.cos(i)*Math.cos(r)+u*Math.cos(o)*Math.cos(a),f=l*Math.cos(i)*Math.sin(r)+u*Math.cos(o)*Math.sin(a),p=l*Math.sin(i)+u*Math.sin(o);c.push([kG(Math.atan2(f,d)),kG(Math.atan2(p,Math.sqrt(d*d+f*f)))])}for(let e=1;e<c.length;e+=1){let t=c[e-1][0],n=c[e][0];for(;n-t>180;)n-=360;for(;n-t<-180;)n+=360;c[e][0]=n}return c}var jG=e=>[e.longitude,e.latitude];function MG(e,t){return{type:`FeatureCollection`,features:e.map(e=>({type:`Feature`,geometry:{type:`Point`,coordinates:jG(e.destination)},properties:{iata:e.destination.iata,label:e.destination.city||e.destination.iata,nonstop:e.nonstop,seasonal:e.seasonal,faded:e.faded,selected:e.destination.iata===t.selectedIata,labelled:e.nonstop||e.isHub||t.hubIatas.has(e.destination.iata)}}))}}function NG(e){let t=new Map;if(e.length<=1){for(let n of e)t.set(n,0);return t}let n=(e.length-1)/2;return e.forEach((e,r)=>{t.set(e,(r-n)*2.5)}),t}function PG(e,t,n,r){e.push({type:`Feature`,geometry:{type:`LineString`,coordinates:AG(t,n)},properties:{kind:`selected`,faded:!1,color:r.color,dashed:r.dashed,offset:r.offset,styleIndex:r.styleIndex,width:r.width,airline:r.airline,via:r.via,pathRole:r.pathRole}})}function FG(e,t,n,r,i,a){let o=jG(n.destination),s=[...new Set(n.options.filter(e=>e.via===null).map(e=>e.airline))].sort((e,t)=>e.localeCompare(t)),c=NG(s);for(let n of s)PG(e,t,o,{color:`#0f172a`,dashed:!1,offset:c.get(n)??0,width:3.25,airline:n,via:null,pathRole:`nonstop`});let l=TW(n.options,i,a);for(let n of l){let i=r.get(n.via);if(!i)continue;let a=jG(i),s={color:n.style.color,dashed:n.style.dasharray!=null,offset:0,styleIndex:n.styleIndex,width:n.style.width,airline:n.airlines[0],via:n.via,pathRole:`connecting`};PG(e,t,a,s),PG(e,a,o,s)}}function IG(e){let t=jG(e.origin),n=[],r=(e,t,r,i=!1)=>{n.push({type:`Feature`,geometry:{type:`LineString`,coordinates:AG(e,t)},properties:{kind:r,faded:i}})},i=e.hub?e.destinationsByIata.get(e.hub):void 0;for(let n of e.views){let e=jG(n.destination);i?n.isHub?r(t,e,`hub`,n.faded):r(jG(i),e,`connecting`,n.faded):r(t,e,n.nonstop?`nonstop`:`connecting`,n.faded)}if(e.selected){let r=e.cityByIata??new Map([...e.destinationsByIata.values()].map(e=>[e.iata,e.city])),i=e.airlineLabel??(e=>e);FG(n,t,e.selected,e.destinationsByIata,r,i)}return{type:`FeatureCollection`,features:n}}function LG(e){let{originIata:t,instanceId:n,consentAnalytics:r}=e,{clickId:i}=fh(),a=(0,G.useCallback)(e=>({originIata:t,destinationIata:e,widgetInstanceId:n,widgetType:kU,consentAnalytics:r,clickId:i,fromUrl:window.location.href}),[t,n,r,i]);return{linkInput:a,destinationUrl:(0,G.useCallback)(e=>SG(a(e)),[a]),onOpenDestination:(0,G.useCallback)(e=>{let t=a(e),n=SG(t);n&&CG({...t,href:n})},[a])}}function RG(e){let[t,n]=(0,G.useState)(!1),[r,i]=(0,G.useState)(!1);(0,G.useEffect)(()=>{let t=()=>{let t=e.current?.getRootNode();n(!!(t&&t.fullscreenElement===e.current))};return document.addEventListener(`fullscreenchange`,t),()=>document.removeEventListener(`fullscreenchange`,t)},[e]),(0,G.useEffect)(()=>{if(!r)return;let e=e=>{e.key===`Escape`&&i(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]);let a=(0,G.useCallback)(async()=>{let n=e.current;if(n){if(t)await document.exitFullscreen().catch(()=>void 0);else if(r)i(!1);else{if(typeof n.requestFullscreen==`function`)try{await n.requestFullscreen();return}catch{}i(!0)}}},[t,r,e]);return{fullscreen:t||r,overlay:r,toggle:a}}function zG(e,t,n){let r=[e,t.destination];for(let e of t.vias){let t=n.get(e);t&&r.push(t)}let i=r.map(e=>e.longitude),a=r.map(e=>e.latitude);return[[Math.min(...i),Math.min(...a)],[Math.max(...i),Math.max(...a)]]}function BG({payload:e,settings:t}){let n=(0,G.useRef)(null),[r,i]=(0,G.useState)(null),[a,o]=(0,G.useState)(null),s=IW(a),[c]=(0,G.useState)(()=>{let n=SW(e,t.initialSettings);return{filters:eW(n.filters),sort:n.sort}}),[l,u]=(0,G.useState)(()=>eW(c.filters)),[d,f]=(0,G.useState)(``),[p,m]=(0,G.useState)(c.sort),[h,g]=(0,G.useState)(null),[_,v]=(0,G.useState)({}),[y,b]=(0,G.useState)(0),{fullscreen:x,overlay:S,toggle:C}=RG(n),w=rW(l,c.filters)&&p===c.sort&&d===``&&h===null,T=(0,G.useCallback)(()=>{u(eW(c.filters)),m(c.sort),f(``),g(null),v({}),b(e=>e+1)},[c]),E=(0,G.useCallback)((e,t)=>{v(n=>{let r={...n};return r[e]===t?delete r[e]:r[e]=t,r})},[]),D=(0,G.useMemo)(()=>fW(e,l),[e,l]),O=(0,G.useMemo)(()=>new Map(e.airlines.map(e=>[e.code,e])),[e]),k=(0,G.useMemo)(()=>new Map(e.destinations.map(e=>[e.iata,e])),[e]),A=(0,G.useMemo)(()=>new Map(e.destinations.map(e=>[e.iata,e.city])),[e]),j=(0,G.useMemo)(()=>new Set(e.hubs.map(e=>e.iata)),[e]),M=D.destinations.find(e=>e.destination.iata===h)??null,N=M?h:null,P=M&&N?uW(M,_[N]??null):null,ee=(0,G.useMemo)(()=>M?dW(M,P):null,[M,P]),F=(0,G.useMemo)(()=>hW(D.destinations.filter(e=>mW(e.destination,d)),p),[D,d,p]),te=(0,G.useMemo)(()=>MG(D.destinations,{selectedIata:N,hubIatas:j}),[D,N,j]),ne=(0,G.useMemo)(()=>IG({origin:e.origin,views:D.destinations,destinationsByIata:k,cityByIata:A,airlineLabel:e=>O.get(e)?.shortName??e,hub:l.hub,selected:ee}),[e.origin,D,k,A,O,l.hub,ee]),I=M?`${M.destination.iata}|${M.vias.join(`,`)}`:null,re=(0,G.useMemo)(()=>M?zG(e.origin,M,k):null,[I]),L=(0,G.useCallback)(e=>{u(t=>eW({...t,...e,months:e.months===void 0?t.months:e.months}))},[]),{linkInput:ie,destinationUrl:ae,onOpenDestination:oe}=LG({originIata:e.origin.iata,instanceId:t.instanceId,consentAnalytics:t.consentAnalytics}),se=(0,G.useCallback)(e=>{if(t.mapOnly)e&&wG(ie(e));else if(g(e),e&&d){let t=k.get(e);t&&!mW(t,d)&&f(``)}},[k,d,t.mapOnly,ie]),ce=D.hasSeasonal||D.destinations.some(e=>e.seasonal),le=l.airline?DG(l.airline):null;return(0,K.jsx)(LW.Provider,{value:r,children:(0,K.jsx)(PW.Provider,{value:s,children:(0,K.jsxs)(`div`,{ref:n,className:t.hideHeader?`rm-root rm-root--no-title`:`rm-root`,"data-fullscreen":x?`true`:void 0,"data-overlay":S?`true`:void 0,"data-hide-header":t.hideHeader?`true`:void 0,style:t.hideHeader?{background:`none`,padding:0,borderRadius:0}:void 0,children:[t.hideHeader?null:(0,K.jsx)(aG,{kicker:t.kicker,heading:t.heading,description:t.description,originIata:e.origin.iata,mapOnly:t.mapOnly,hideFilters:t.hideFilters}),(0,K.jsxs)(`div`,{ref:o,part:`route-map-panel`,className:`rm-panel${t.hideFilters?` rm-panel--no-filters`:``} aone:border aone:border-slate-200 aone:bg-white aone:shadow-sm`,children:[t.hideFilters?null:(0,K.jsx)(vG,{filters:l,startingFilters:c.filters,onFiltersChange:L,counts:D.counts,airlines:e.airlines,months:e.months,hubs:e.hubs,hubCounts:D.hubCounts,hasSeasonal:D.hasSeasonal,fullscreen:x,onToggleFullscreen:()=>void C(),onReset:w?void 0:T}),(0,K.jsxs)(`div`,{className:t.mapOnly?`rm-body rm-body--map-only`:`rm-body`,children:[(0,K.jsx)(`div`,{className:`rm-map`,children:(0,K.jsx)(iG,{origin:e.origin,points:te,lines:ne,primaryColor:t.primaryColor,accentColor:t.accentColor,airlineHighlightColor:le,styleUrl:t.styleUrl,region:t.defaultRegion,regionToken:y,focusBounds:t.mapOnly?null:re,mapOnly:t.mapOnly,onSelect:se,legend:(0,K.jsx)(sG,{counts:D.counts,showSeasonal:ce})})}),t.mapOnly?null:(0,K.jsx)(`aside`,{className:`rm-list`,"aria-label":`Destinations`,children:(0,K.jsx)(YW,{views:F,search:d,onSearchChange:f,sort:p,onSortChange:m,airlinesByCode:O,cityByIata:A,months:e.months,selectedMonths:l.months,selectedIata:N,onSelect:g,pinnedAirlines:_,onTogglePin:E,destinationUrl:ae,onOpenDestination:oe})})]})]}),(0,K.jsx)(`div`,{ref:i,className:`rm-portal`})]})})})}function VG(e){if(e&&typeof e==`object`&&!Array.isArray(e)){let t=e.error;if(t&&typeof t==`object`){let e=t.message;if(typeof e==`string`&&e.trim())return e}}}function HG(e){if(!e||typeof e!=`object`||Array.isArray(e))return{success:!1,error:`Invalid response`};let t=e;if(t.success!==!0)return{success:!1,error:VG(e)??`Request failed`};let n=SU.safeParse(t.data);return n.success?{success:!0,data:n.data}:{success:!1,error:`Invalid payload shape`}}async function UG(e,t={}){let n=mm();if(!n)return{success:!1,error:`Route map API base URL is not configured`};let r=`${n}/v1/widget-instances/${encodeURIComponent(e)}/route-map`,i;try{i=await fetch(r,{method:`GET`,credentials:`omit`,mode:`cors`,signal:t.signal})}catch{return{success:!1,error:`Unable to reach the route map service`}}let a;try{a=await i.json()}catch{return{success:!1,error:`Unable to get route map data (${i.status})`}}return i.status===404?{success:!1,notFound:!0,error:VG(a)??`No routes found`}:i.ok?HG(a):{success:!1,error:`Unable to get route map data (${i.status})`}}function WG(e){return Zg({queryKey:[`route-map`,e],queryFn:({signal:t})=>UG(e??``,{signal:t}),enabled:!!e,staleTime:36e5,refetchOnWindowFocus:!1,retry:1})}function GG({children:e}){return(0,K.jsx)(`div`,{className:`aone:flex aone:h-64 aone:items-center aone:justify-center aone:rounded-2xl aone:border aone:border-slate-200 aone:bg-white aone:p-6 aone:text-center aone:text-sm aone:text-slate-600`,children:e})}function KG(e){let{data:t,isPending:n}=WG(e.previewPayload?void 0:e.instanceId),r=e.previewPayload??(t?.success?t.data:void 0);return r?(0,K.jsx)(BG,{payload:r,settings:e},CW(e.initialSettings)):n?(0,K.jsx)(GG,{children:(0,K.jsx)(`span`,{className:`aone:animate-pulse`,children:`Loading destinations…`})}):(0,K.jsx)(GG,{children:t&&`notFound`in t&&t.notFound?`We don't have scheduled routes from ${e.origin} yet.`:`We couldn't load destinations right now. Please try again later.`})}var qG=`:host{--rm-body-height:31rem}.rm-root{color:#0f172a;background:#f4f7fb;border-radius:1.25rem;flex-direction:column;padding:1.5rem;display:flex}.rm-root.rm-root--no-title,.rm-root[data-hide-header=true]{background:0 0;border-radius:0;padding:0}.rm-panel{border-radius:1rem;flex-direction:column;min-height:0;display:flex;overflow:hidden;container-type:inline-size}.rm-body{height:var(--rm-body-height);grid-template-columns:minmax(0,1fr) minmax(18rem,380px);min-height:0;display:grid}.rm-map{min-height:0;position:relative;overflow:hidden}.rm-list{border-left:1px solid #e2e8f0;min-height:0}@container (width<=760px){.rm-body{grid-template-rows:20rem 28rem;grid-template-columns:minmax(0,1fr);height:auto}.rm-list{border-top:1px solid #e2e8f0;border-left:none}.rm-legend-slot{bottom:.5rem;left:.5rem;right:2.75rem}.rm-legend-slot ul{-moz-column-gap:.75rem;flex-wrap:wrap;gap:.125rem .75rem;font-size:.6875rem;display:flex}.rm-legend-slot li{margin:0}}.rm-label-short{display:none}@media (max-width:639px){.rm-root:not(.rm-root--no-title):not([data-hide-header=true]){border-radius:1rem;padding:.75rem}}@container (width<=960px){.rm-toolbar{grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:.5rem;display:grid}.rm-toolbar__stops{grid-area:1/1;justify-self:start;max-width:100%}.rm-toolbar__view{grid-area:1/2;margin-left:0}.rm-toolbar__filters{grid-area:2/1/3/-1;min-width:0}.rm-filter__icon,.rm-label-long{display:none}.rm-label-short{display:inline}.rm-filter__label{max-width:8rem}}@container (width<=640px){.rm-toolbar{padding:.625rem}.rm-toolbar__stops{justify-self:stretch;display:flex}.rm-toolbar__stops .rm-segment{text-align:center;flex:1;padding-inline:.375rem}.rm-segment__count{min-width:0}.rm-toolbar__filters{flex-wrap:nowrap;align-items:stretch;gap:.5rem;width:100%}.rm-toolbar__filters>.rm-filter{flex:auto;width:100%}.rm-toolbar__filters .rm-filter__button{justify-content:center;width:100%;padding-inline:.875rem}.rm-toolbar__filters .rm-filter__icon{display:inline-block}}.rm-filters-sheet__body{flex-direction:column;gap:1.25rem;display:flex}.rm-filters-sheet__heading{color:#334155;margin:0 0 .5rem;font-size:.8125rem;font-weight:600}@container (width<=360px){.rm-toolbar__stops .rm-segment{padding-inline:.25rem;font-size:.8125rem}}.rm-drawer{color:#0f172a;z-index:2147483001;align-items:flex-end;display:flex;position:fixed;inset:0}.rm-drawer__backdrop{background:#0f172a66;animation:.16s ease-out rm-fade-in;position:absolute;inset:0}.rm-drawer__sheet{overscroll-behavior:contain;max-height:min(80vh,36rem);padding:.5rem 1.25rem calc(1rem + env(safe-area-inset-bottom));background:#fff;border-radius:1.25rem 1.25rem 0 0;outline:none;width:100%;animation:.22s cubic-bezier(.2,.8,.2,1) rm-sheet-in;position:relative;overflow-y:auto;box-shadow:0 -12px 32px #0f172a2e}.rm-drawer__handle{background:#cbd5e1;border-radius:9999px;width:2.5rem;height:.25rem;margin:.25rem auto .75rem}.rm-drawer__chips button{min-height:2.5rem;padding:.5rem .875rem}@keyframes rm-fade-in{0%{opacity:0}}@keyframes rm-sheet-in{0%{transform:translateY(100%)}}@media (prefers-reduced-motion:reduce){.rm-drawer__backdrop,.rm-drawer__sheet{animation:none}}.rm-root[data-fullscreen=true]:not(.rm-root--no-title):not([data-hide-header=true]){border-radius:0;width:100%;height:100%;padding:1rem}.rm-root[data-fullscreen=true].rm-root--no-title,.rm-root[data-fullscreen=true][data-hide-header=true]{background:0 0;border-radius:0;width:100%;height:100%;padding:0}.rm-root[data-overlay=true]{z-index:2147483000;position:fixed;inset:0;overflow:auto}.rm-root[data-fullscreen=true] .rm-panel{flex:1}.rm-root[data-fullscreen=true] .rm-body{flex:1;height:auto}.rm-body.rm-body--map-only{grid-template-rows:minmax(0,1fr);grid-template-columns:minmax(0,1fr)}@container (width<=760px){.rm-body.rm-body--map-only{grid-template-rows:minmax(20rem,1fr);height:20rem}}.rm-root[data-fullscreen=true] .rm-body.rm-body--map-only{height:auto}.rm-origin{pointer-events:none;align-items:center;gap:.375rem;display:flex}.rm-origin__dot{background:var(--rm-accent);box-shadow:0 0 0 4px color-mix(in srgb,var(--rm-accent) 30%,transparent);border:3px solid #fff;border-radius:9999px;width:1.125rem;height:1.125rem}.rm-origin__label{color:#fff;white-space:nowrap;background:#111827;border-radius:.375rem;padding:.375rem .5rem;font-size:.75rem;font-weight:600;line-height:1}.rm-popup .maplibregl-popup-content{color:#0f172a;border-radius:.5rem;padding:.5rem .625rem;font-size:.8125rem;box-shadow:0 6px 20px #0f172a26}.rm-popup__meta{color:#64748b;margin-top:.125rem;font-size:.75rem}.rm-weekday-strip{flex-wrap:wrap;align-items:center;gap:2px 4px;min-width:0;display:flex}.rm-weekday-days{align-items:center;gap:4px;display:flex}.rm-weekday-chip{color:#8b94a9;cursor:default;background:#fff;border:1.5px solid #cfd6e3;border-radius:5px;place-items:center;width:20px;height:20px;padding:0;font-family:inherit;font-size:10px;font-weight:800;line-height:1;transition:background .15s,color .15s,border-color .15s;display:grid}.rm-weekday-chip[data-flies=true]{background:var(--rm-primary);border-color:var(--rm-primary);color:#fff}.rm-airline-isolate{cursor:pointer;background:0 0;border:0;border-radius:5px;padding:0;transition:opacity .15s,outline-color .15s;display:inline-flex}.rm-airline-isolate[data-dim=true]{opacity:.55}.rm-airline-isolate:focus{outline:none}.rm-airline-isolate:focus-visible,.rm-weekday-chip:focus-visible{outline:2px solid var(--rm-primary);outline-offset:2px}.rm-weekday-note{color:#64748b;margin-left:4px}.rm-weekday-note,.rm-weekday-tip{white-space:nowrap;font-size:11px;font-weight:600}.rm-weekday-tip{color:#fff;pointer-events:none;z-index:2147483002;background:#14213d;border-radius:6px;padding:5px 8px;line-height:1.2;position:fixed;transform:translate(-50%,calc(-100% - 7px))}.rm-weekday-tip:after{content:"";border:5px solid #0000;border-top-color:#14213d;position:absolute;top:100%;left:50%;transform:translate(-50%)}.rm-weekday-tip--below{transform:translate(-50%,7px)}.rm-weekday-tip--below:after{border-top-color:#0000;border-bottom-color:#14213d;top:auto;bottom:100%}:host([data-mode=dark]) .rm-weekday-chip[data-flies=false]{color:#7e89a6;background:0 0;border-color:#3a4663}:host([data-mode=dark]) .rm-weekday-note{color:#9aa5c0}:host([data-mode=dark]) .rm-weekday-tip{color:#0f1524;background:#e8ecf5}:host([data-mode=dark]) .rm-weekday-tip:after{border-top-color:#e8ecf5}:host([data-mode=dark]) .rm-weekday-tip--below:after{border-top-color:#0000;border-bottom-color:#e8ecf5}@media (prefers-reduced-motion:reduce){.rm-airline-isolate,.rm-weekday-chip{transition:none}}`,JG=new Ig;function YG(){return(0,K.jsx)(`link`,{rel:`stylesheet`,href:LU[0],onError:e=>{let t=LU[1];t&&e.currentTarget.href!==t&&(e.currentTarget.href=t)}})}function XG(e){let t=e.origin?.trim().toUpperCase();return!t||!/^[A-Z]{3}$/.test(t)?(console.error(`[airport-one-widgets] route map: origin is not a valid IATA code, not rendering widget.`),null):(0,K.jsxs)(Oh,{client:JG,children:[(0,K.jsx)(`style`,{children:l_}),(0,K.jsx)(`style`,{children:qG}),(0,K.jsx)(YG,{}),e.userStyleBlock?(0,K.jsx)(`style`,{children:e.userStyleBlock}):null,(0,K.jsx)(`div`,{style:{"--rm-primary":e.primaryColor,"--rm-accent":e.accentColor},children:(0,K.jsx)($g,{componentName:`route map`,children:(0,K.jsx)(KG,{instanceId:e.instanceId,previewPayload:e.previewPayload,origin:t,kicker:e.kicker,heading:e.heading,description:e.description,hideHeader:e.hideHeader,mapOnly:e.mapOnly,hideFilters:e.hideFilters,consentAnalytics:e.consentAnalytics,primaryColor:e.primaryColor,accentColor:e.accentColor,styleUrl:e.styleUrl,defaultRegion:e.defaultRegion,initialSettings:e.initialSettings})})})]})}var ZG=`fma-route-map`,QG=[`primary-color`,`secondary-color`,`theme`,`heading`,`kicker`,`description`,`hide-header`,`map-only`,`hide-filters`,`map-style`,`default-region`,`default-stops`,`default-airline`,`default-months`,`default-hub`,`default-sort`,`consent-analytics`,Pp,`id`],$G=class extends HTMLElement{_shadowRoot;_mountPoint;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;_mountTelemetrySent=!1;_lastPublicConfigTelemetryKey=null;_previewPayload=null;static get observedAttributes(){return Array.from(QG)}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this._scheduleRender()}get previewPayload(){return this._previewPayload}set previewPayload(e){if(e==null)this._previewPayload=null;else{let t=SU.safeParse(e);t.success||console.warn(`[airport-one-widgets] route-map: ignoring an invalid previewPayload.`),this._previewPayload=t.success?t.data:null}this.isConnected&&this._scheduleRender()}connectedCallback(){if(Object.prototype.hasOwnProperty.call(this,`previewPayload`)){let e=this,t=e.previewPayload;delete e.previewPayload,this.previewPayload=t}this.style.display=`block`,this.style.position=`relative`,this.style.lineHeight=`1.5`,this._scheduleRender()}disconnectedCallback(){this._reactRoot?.unmount(),this._reactRoot=void 0,this._mountTelemetrySent=!1,this._lastPublicConfigTelemetryKey=null}_scheduleRender(){this._renderScheduled||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&this._renderAsync()}))}async _renderAsync(){if(this._renderInProgress)this._renderQueued=!0;else{this._renderInProgress=!0;try{let e=cm(this),t=window[Ac],n=this._previewPayload;if(n){this._paint({...PU(this,t,{origin:n.origin.iata},e??void 0),previewPayload:n});return}let r=mm(),i=null,a={attempted:!1,durationMs:0},o;if(e&&r){let t=await hm(e);a=t.metrics;let n=t.config;n&&n.widgetType!==`route-map`&&(console.warn(`[airport-one-widgets] Widget instance type does not match route-map:`,n.widgetType),o=`widget_type_mismatch`,n=null),i=n,a.attempted&&i===null&&o===void 0&&(o=a.failureKind)}if(!this.isConnected)return;let s=a.attempted&&!i,c=Np(e)??void 0,l=e&&i?PU(this,t,NU(i),e):null,u=l?.consentAnalytics??om(this,`consent-analytics`,void 0);if(u){let t=a.attempted?void 0:r?`no_instance_id`:`no_api_base`,n=a.attempted?`attempt:${r}|${e}|${i?`ok`:`fail`}|${o??``}`:`skip:${t}`;n!==this._lastPublicConfigTelemetryKey&&(this._lastPublicConfigTelemetryKey=n,Sh(!0,{widget_runtime:kU,widget_instance_id:c,attempted:a.attempted,duration_ms:a.durationMs,ok:a.attempted?i!==null:!1,error_kind:s?o:void 0,skip_reason:t}))}if(!l){console.warn(`${um}: route-map — ${e?r?`instance is not registered for this site`:`widget API base URL not configured`:`no data-widget-instance-id`}; not rendering.`),this._clear();return}this._paint(l),u&&!this._mountTelemetrySent&&(this._mountTelemetrySent=!0,Ch(!0,{widget_runtime:kU,widget_instance_id:c,public_config_unavailable:s}))}finally{this._renderInProgress=!1,this._renderQueued&&(this._renderQueued=!1,queueMicrotask(()=>{this.isConnected&&this._renderAsync()}))}}}_clear(){this._reactRoot?.unmount(),this._reactRoot=void 0,this.removeAttribute(`data-mode`)}_paint(e){let t=this._shadowRoot??=this.attachShadow({mode:`closed`}),n=this._mountPoint??=document.createElement(`div`);n.parentNode!==t&&t.appendChild(n),e.theme===`dark`?this.setAttribute(`data-mode`,`dark`):this.removeAttribute(`data-mode`),(this._reactRoot??=rm.createRoot(n)).render((0,K.jsx)(XG,{...e}))}};return customElements.get(`fma-route-map`)||customElements.define(ZG,$G),e.AirfareContent=C_,e.AirfareSearch=YB,e.CarfareSearch=_L,e.FidsBoardElement=NH,e.FlyMyAirportFabElement=mU,e.RouteMapElement=$G,e})({});
|