(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,75430,77323,e=>{"use strict";var t=e.i(546446),n=e.i(579310),r=e.i(528600),l=e.i(935807),i=e.i(335355),a=e.i(206507),o=e.i(919101),s=e.i(310847);function u(){let e=(0,t.useAtomValue)(n.userLocationsGetAtom),u=(0,t.useAtomValue)(i.userLocaleAtom),c=u?.slice(3)||"US",{user:d}=(0,r.useUser)(),f=d.isUserLoggedIn,h=(0,t.useAtomValue)(s.wxuUserRecentAddressesAtom);return(0,a.useMemo)(()=>({getLocationName:(t,n)=>(0,l.getLocationName)((0,o.getAddressForLocationData)(t,h),e,f,c,n),getLocationContext:(t,n)=>(0,l.getLocationContext)((0,o.getAddressForLocationData)(t,h),e,f,c,n),getLocationPresentationName:t=>(0,l.getLocationPresentationName)((0,o.getAddressForLocationData)(t,h),e,f,c)}),[e,f,c,h])}e.s(["usePresentationName",0,u],77323),e.s(["useBuildSearchItem",0,()=>{let{getLocationName:e,getLocationContext:n,getLocationPresentationName:r}=u(),l=(0,t.useAtomValue)(s.wxuUserRecentAddressesAtom);return{buildSearchItem:(0,a.useCallback)(t=>{let i=(0,o.getAddressForLocationData)(t,l);return{placeId:i.placeId,featureId:i.featureId,temperature:0,iconCode:44,geocode:`${i.latitude},${i.longitude}`,presentationName:r(i),name:e(i),nameContext:n(i),displayName:i.displayName,address:i.address,type:i.type}},[n,e,r,l])}}],75430)},879499,189816,929776,e=>{"use strict";let t;var n,r,l,i,a,o,s,u,c,d,f,h,g,p,m,v,b,y,x,w=e.i(206507),C=e.i(926045);function D(){for(var e=arguments.length,t=Array(e),n=0;ne=>{t.forEach(t=>t(e))},t)}let S="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function I(e){let t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function E(e){return"nodeType"in e}function R(e){var t,n;return e?I(e)?e:E(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function L(e){let{Document:t}=R(e);return e instanceof t}function M(e){return!I(e)&&e instanceof R(e).HTMLElement}function N(e){return e instanceof R(e).SVGElement}function j(e){return e?I(e)?e.document:E(e)?L(e)?e:M(e)||N(e)?e.ownerDocument:document:document:document}let k=S?w.useLayoutEffect:w.useEffect;function T(e){let t=(0,w.useRef)(e);return k(()=>{t.current=e}),(0,w.useCallback)(function(){for(var e=arguments.length,n=Array(e),r=0;r{e.current=setInterval(t,n)},[]),(0,w.useCallback)(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}function O(e,t){void 0===t&&(t=[e]);let n=(0,w.useRef)(e);return k(()=>{n.current!==e&&(n.current=e)},t),n}function B(e,t){let n=(0,w.useRef)();return(0,w.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function F(e){let t=T(e),n=(0,w.useRef)(null),r=(0,w.useCallback)(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function P(e){let t=(0,w.useRef)();return(0,w.useEffect)(()=>{t.current=e},[e]),t.current}let U={};function z(e,t){return(0,w.useMemo)(()=>{if(t)return t;let n=null==U[e]?0:U[e]+1;return U[e]=n,e+"-"+n},[e,t])}function K(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),l=1;l{for(let[r,l]of Object.entries(n)){let n=t[r];null!=n&&(t[r]=n+e*l)}return t},{...t})}}let _=K(1),W=K(-1);function X(e){if(!e)return!1;let{KeyboardEvent:t}=R(e.target);return t&&e instanceof t}function Y(e){if(function(e){if(!e)return!1;let{TouchEvent:t}=R(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return"clientX"in e&&"clientY"in e?{x:e.clientX,y:e.clientY}:null}let H=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[H.Translate.toString(e),H.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),V="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function G(e){return e.matches(V)?e:e.querySelector(V)}e.s(["CSS",0,H,"add",0,_,"canUseDOM",0,S,"findFirstFocusableNode",0,G,"getEventCoordinates",0,Y,"getOwnerDocument",0,j,"getWindow",0,R,"isDocument",0,L,"isHTMLElement",0,M,"isKeyboardEvent",0,X,"isNode",0,E,"isSVGElement",0,N,"isWindow",0,I,"subtract",0,W,"useCombinedRefs",0,D,"useEvent",0,T,"useInterval",0,A,"useIsomorphicLayoutEffect",0,k,"useLatestValue",0,O,"useLazyMemo",0,B,"useNodeRef",0,F,"usePrevious",0,P,"useUniqueId",0,z],189816);let q={display:"none"};function J(e){let{id:t,value:n}=e;return w.default.createElement("div",{id:t,style:q},n)}function $(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return w.default.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},n)}let Q=(0,w.createContext)(null),Z={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},ee={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function et(e){var t;let n,{announcements:r=ee,container:l,hiddenTextDescribedById:i,screenReaderInstructions:a=Z}=e,{announce:o,announcement:s}=function(){let[e,t]=(0,w.useState)("");return{announce:(0,w.useCallback)(e=>{null!=e&&t(e)},[]),announcement:e}}(),u=z("DndLiveRegion"),[c,d]=(0,w.useState)(!1);if((0,w.useEffect)(()=>{d(!0)},[]),t=(0,w.useMemo)(()=>({onDragStart(e){let{active:t}=e;o(r.onDragStart({active:t}))},onDragMove(e){let{active:t,over:n}=e;r.onDragMove&&o(r.onDragMove({active:t,over:n}))},onDragOver(e){let{active:t,over:n}=e;o(r.onDragOver({active:t,over:n}))},onDragEnd(e){let{active:t,over:n}=e;o(r.onDragEnd({active:t,over:n}))},onDragCancel(e){let{active:t,over:n}=e;o(r.onDragCancel({active:t,over:n}))}}),[o,r]),n=(0,w.useContext)(Q),(0,w.useEffect)(()=>{if(!n)throw Error("useDndMonitor must be used within a children of ");return n(t)},[t,n]),!c)return null;let f=w.default.createElement(w.default.Fragment,null,w.default.createElement(J,{id:i,value:a.draggable}),w.default.createElement($,{id:u,announcement:s}));return l?(0,C.createPortal)(f,l):f}function en(){}(n=d||(d={})).DragStart="dragStart",n.DragMove="dragMove",n.DragEnd="dragEnd",n.DragCancel="dragCancel",n.DragOver="dragOver",n.RegisterDroppable="registerDroppable",n.SetDroppableDisabled="setDroppableDisabled",n.UnregisterDroppable="unregisterDroppable";let er=Object.freeze({x:0,y:0});function el(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ei(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function ea(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function eo(e){let{left:t,top:n,height:r,width:l}=e;return[{x:t,y:n},{x:t+l,y:n},{x:t,y:n+r},{x:t+l,y:n+r}]}function es(e,t){if(!e||0===e.length)return null;let[n]=e;return t?n[t]:n}function eu(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}let ec=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,l=eo(t),i=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=eo(r),a=Number((l.reduce((e,t,r)=>e+el(n[r],t),0)/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:a}})}}return i.sort(ei)},ed=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,l=[];for(let e of r){let{id:r}=e,i=n.get(r);if(i){let n=function(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),l=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height);if(r0&&l.push({id:r,data:{droppableContainer:e,value:n}})}}return l.sort(ea)};function ef(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:er}let eh=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r({...e,top:e.top+ +t.y,bottom:e.bottom+ +t.y,left:e.left+ +t.x,right:e.right+ +t.x}),{...e})},eg={ignoreTransform:!1};function ep(e,t){void 0===t&&(t=eg);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=R(e).getComputedStyle(e);t&&(n=function(e,t,n){let r=function(e){if(e.startsWith("matrix3d(")){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!r)return e;let{scaleX:l,scaleY:i,x:a,y:o}=r,s=e.left-a-(1-l)*parseFloat(n),u=e.top-o-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),c=l?e.width/l:e.width,d=i?e.height/i:e.height;return{width:c,height:d,top:u,right:s+c,bottom:u+d,left:s}}(n,t,r))}let{top:r,left:l,width:i,height:a,bottom:o,right:s}=n;return{top:r,left:l,width:i,height:a,bottom:o,right:s}}function em(e){return ep(e,{ignoreTransform:!0})}function ev(e,t){let n=[];return e?function r(l){var i,a;let o;if(null!=t&&n.length>=t||!l)return n;if(L(l)&&null!=l.scrollingElement&&!n.includes(l.scrollingElement))return n.push(l.scrollingElement),n;if(!M(l)||N(l)||n.includes(l))return n;let s=R(e).getComputedStyle(l);return(l!==e&&(void 0===(i=s)&&(i=R(l).getComputedStyle(l)),o=/(auto|scroll|overlay)/,["overflow","overflowX","overflowY"].some(e=>{let t=i[e];return"string"==typeof t&&o.test(t)}))&&n.push(l),void 0===(a=s)&&(a=R(l).getComputedStyle(l)),"fixed"===a.position)?n:r(l.parentNode)}(e):n}function eb(e){let[t]=ev(e,1);return null!=t?t:null}function ey(e){return S&&e?I(e)?e:E(e)?L(e)||e===j(e).scrollingElement?window:M(e)?e:null:null:null}function ex(e){return I(e)?e.scrollX:e.scrollLeft}function ew(e){return I(e)?e.scrollY:e.scrollTop}function eC(e){return{x:ex(e),y:ew(e)}}function eD(e){return!!S&&!!e&&e===document.scrollingElement}function eS(e){let t={x:0,y:0},n=eD(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},l=e.scrollTop=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}(r=f||(f={}))[r.Forward=1]="Forward",r[r.Backward=-1]="Backward";let eI={x:.2,y:.2};function eE(e){return e.reduce((e,t)=>_(e,eC(t)),er)}let eR=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+ex(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+ew(t),0)}]];class eL{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=ev(t),r=eE(n);for(const[t,l,i]of(this.rect={...e},this.width=e.width,this.height=e.height,eR))for(const e of l)Object.defineProperty(this,e,{get:()=>{let l=i(n),a=r[t]-l;return this.rect[e]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class eM{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function eN(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}function ej(e){e.preventDefault()}function ek(e){e.stopPropagation()}(l=h||(h={})).Click="click",l.DragStart="dragstart",l.Keydown="keydown",l.ContextMenu="contextmenu",l.Resize="resize",l.SelectionChange="selectionchange",l.VisibilityChange="visibilitychange",(i=g||(g={})).Space="Space",i.Down="ArrowDown",i.Right="ArrowRight",i.Left="ArrowLeft",i.Up="ArrowUp",i.Esc="Escape",i.Enter="Enter",i.Tab="Tab";let eT={start:[g.Space,g.Enter],cancel:[g.Esc],end:[g.Space,g.Enter,g.Tab]},eA=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case g.Right:return{...n,x:n.x+25};case g.Left:return{...n,x:n.x-25};case g.Down:return{...n,y:n.y+25};case g.Up:return{...n,y:n.y-25}}};class eO{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new eM(j(t)),this.windowListeners=new eM(R(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(h.Resize,this.handleCancel),this.windowListeners.add(h.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(h.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=ep),!e)return;let{top:n,left:r,bottom:l,right:i}=t(e);eb(e)&&(l=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(er)}handleKeyDown(e){if(X(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:l=eT,coordinateGetter:i=eA,scrollBehavior:a="smooth"}=r,{code:o}=e;if(l.end.includes(o))return void this.handleEnd(e);if(l.cancel.includes(o))return void this.handleCancel(e);let{collisionRect:s}=n.current,u=s?{x:s.left,y:s.top}:er;this.referenceCoordinates||(this.referenceCoordinates=u);let c=i(e,{active:t,context:n.current,currentCoordinates:u});if(c){let t=W(c,u),r={x:0,y:0},{scrollableAncestors:l}=n.current;for(let n of l){let l=e.code,{isTop:i,isRight:o,isLeft:s,isBottom:u,maxScroll:d,minScroll:f}=eS(n),h=function(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:l}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:l,width:e.clientWidth,height:e.clientHeight}}(n),p={x:Math.min(l===g.Right?h.right-h.width/2:h.right,Math.max(l===g.Right?h.left:h.left+h.width/2,c.x)),y:Math.min(l===g.Down?h.bottom-h.height/2:h.bottom,Math.max(l===g.Down?h.top:h.top+h.height/2,c.y))},m=l===g.Right&&!o||l===g.Left&&!s,v=l===g.Down&&!u||l===g.Up&&!i;if(m&&p.x!==c.x){let e=n.scrollLeft+t.x,i=l===g.Right&&e=f.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});i?r.x=n.scrollLeft-e:r.x=l===g.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(v&&p.y!==c.y){let e=n.scrollTop+t.y,i=l===g.Down&&e=f.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});i?r.y=n.scrollTop-e:r.y=l===g.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,_(W(c,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function eB(e){return!!(e&&"distance"in e)}function eF(e){return!!(e&&"delay"in e)}eO.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=eT,onActivation:l}=t,{active:i}=n,{code:a}=e.nativeEvent;if(r.start.includes(a)){let t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==l||l({event:e.nativeEvent}),!0)}return!1}}];class eP{constructor(e,t,n){var r;void 0===n&&(n=function(e){let{EventTarget:t}=R(e);return e instanceof t?e:j(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:l}=e,{target:i}=l;this.props=e,this.events=t,this.document=j(i),this.documentListeners=new eM(this.document),this.listeners=new eM(n),this.windowListeners=new eM(R(i)),this.initialCoordinates=null!=(r=Y(l))?r:er,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(h.Resize,this.handleCancel),this.windowListeners.add(h.DragStart,ej),this.windowListeners.add(h.VisibilityChange,this.handleCancel),this.windowListeners.add(h.ContextMenu,ej),this.documentListeners.add(h.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(eF(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(eB(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(h.Click,ek,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(h.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;let{activated:n,initialCoordinates:r,props:l}=this,{onMove:i,options:{activationConstraint:a}}=l;if(!r)return;let o=null!=(t=Y(e))?t:er,s=W(r,o);if(!n&&a){if(eB(a)){if(null!=a.tolerance&&eN(s,a.tolerance))return this.handleCancel();if(eN(s,a.distance))return this.handleStart()}return eF(a)&&eN(s,a.tolerance)?this.handleCancel():void this.handlePending(a,s)}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===g.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}let eU={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ez extends eP{constructor(e){const{event:t}=e;super(e,eU,j(t.target))}}ez.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!!n.isPrimary&&0===n.button&&(null==r||r({event:n}),!0)}}];(a=p||(p={}))[a.RightClick=2]="RightClick";(o=m||(m={}))[o.Pointer=0]="Pointer",o[o.DraggableRect=1]="DraggableRect",(s=v||(v={}))[s.TreeOrder=0]="TreeOrder",s[s.ReversedTreeOrder=1]="ReversedTreeOrder";let eK={x:{[f.Backward]:!1,[f.Forward]:!1},y:{[f.Backward]:!1,[f.Forward]:!1}};(u=b||(b={}))[u.Always=0]="Always",u[u.BeforeDragging=1]="BeforeDragging",u[u.WhileDragging=2]="WhileDragging",(y||(y={})).Optimized="optimized";let e_=new Map;function eW(e,t){return B(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function eX(e){let{callback:t,disabled:n}=e,r=T(t),l=(0,w.useMemo)(()=>{if(n||"u"()=>null==l?void 0:l.disconnect(),[l]),l}function eY(e){return new eL(ep(e),e)}function eH(e,t,n){void 0===t&&(t=eY);let[r,l]=(0,w.useState)(null);function i(){l(r=>{if(!e)return null;if(!1===e.isConnected){var l;return null!=(l=null!=r?r:n)?l:null}let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let a=function(e){let{callback:t,disabled:n}=e,r=T(t),l=(0,w.useMemo)(()=>{if(n||"u"()=>null==l?void 0:l.disconnect(),[l]),l}({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){i();break}}}}),o=eX({callback:i});return k(()=>{i(),e?(null==o||o.observe(e),null==a||a.observe(document.body,{childList:!0,subtree:!0})):(null==o||o.disconnect(),null==a||a.disconnect())},[e]),r}let eV=[];function eG(e,t){void 0===t&&(t=[]);let n=(0,w.useRef)(null);return(0,w.useEffect)(()=>{n.current=null},t),(0,w.useEffect)(()=>{let t=e!==er;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?W(e,n.current):er}function eq(e){return(0,w.useMemo)(()=>{let t,n;return e?(t=e.innerWidth,{top:0,left:0,right:t,bottom:n=e.innerHeight,width:t,height:n}):null},[e])}let eJ=[],e$=[{sensor:ez,options:{}},{sensor:eO,options:{}}],eQ={current:{}},eZ={draggable:{measure:em},droppable:{measure:em,strategy:b.WhileDragging,frequency:y.Optimized},dragOverlay:{measure:ep}};class e0 extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}let e1={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new e0,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:en},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:eZ,measureDroppableContainers:en,windowRect:null,measuringScheduled:!1},e5={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:en,draggableNodes:new Map,over:null,measureDroppableContainers:en},e2=(0,w.createContext)(e5),e7=(0,w.createContext)(e1);function e4(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new e0}}}function e3(e,t){switch(t.type){case d.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case d.DragMove:if(null==e.draggable.active)return e;return{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case d.DragEnd:case d.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case d.RegisterDroppable:{let{element:n}=t,{id:r}=n,l=new e0(e.droppable.containers);return l.set(r,n),{...e,droppable:{...e.droppable,containers:l}}}case d.SetDroppableDisabled:{let{id:n,key:r,disabled:l}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new e0(e.droppable.containers);return a.set(n,{...i,disabled:l}),{...e,droppable:{...e.droppable,containers:a}}}case d.UnregisterDroppable:{let{id:n,key:r}=t,l=e.droppable.containers.get(n);if(!l||r!==l.key)return e;let i=new e0(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function e6(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:l}=(0,w.useContext)(e2),i=P(r),a=P(null==n?void 0:n.id);return(0,w.useEffect)(()=>{if(!t&&!r&&i&&null!=a){if(!X(i)||document.activeElement===i.target)return;let e=l.get(a);if(!e)return;let{activatorNode:t,node:n}=e;(t.current||n.current)&&requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=G(e);if(t){t.focus();break}}})}},[r,t,l,a,i]),null}let e8=(0,w.createContext)({...er,scaleX:1,scaleY:1});(c=x||(x={}))[c.Uninitialized=0]="Uninitialized",c[c.Initializing=1]="Initializing",c[c.Initialized=2]="Initialized";let e9=(0,w.memo)(function(e){var t,n,r,l,i,a,o,s;let u,c,h,g,p,y,D,I,{id:E,accessibility:L,autoScroll:N=!0,children:j,sensors:T=e$,collisionDetection:U=ed,measuring:K,modifiers:W,...X}=e,[H,V]=(0,w.useReducer)(e3,void 0,e4),[G,q]=function(){let[e]=(0,w.useState)(()=>new Set),t=(0,w.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,w.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]),t]}(),[J,$]=(0,w.useState)(x.Uninitialized),Z=J===x.Initialized,{draggable:{active:ee,nodes:en,translate:el},droppable:{containers:ei}}=H,ea=null!=ee?en.get(ee):null,eo=(0,w.useRef)({initial:null,translated:null}),eu=(0,w.useMemo)(()=>{var e;return null!=ee?{id:ee,data:null!=(e=null==ea?void 0:ea.data)?e:eQ,rect:eo}:null},[ee,ea]),ec=(0,w.useRef)(null),[eg,em]=(0,w.useState)(null),[ex,ew]=(0,w.useState)(null),eR=O(X,Object.values(X)),eM=z("DndDescribedBy",E),eN=(0,w.useMemo)(()=>ei.getEnabled(),[ei]),ej=(0,w.useMemo)(()=>({draggable:{...eZ.draggable,...null==K?void 0:K.draggable},droppable:{...eZ.droppable,...null==K?void 0:K.droppable},dragOverlay:{...eZ.dragOverlay,...null==K?void 0:K.dragOverlay}}),[null==K?void 0:K.draggable,null==K?void 0:K.droppable,null==K?void 0:K.dragOverlay]),{droppableRects:ek,measureDroppableContainers:eT,measuringScheduled:eA}=function(e,t){let{dragging:n,dependencies:r,config:l}=t,[i,a]=(0,w.useState)(null),{frequency:o,measure:s,strategy:u}=l,c=(0,w.useRef)(e),d=function(){switch(u){case b.Always:return!1;case b.BeforeDragging:return n;default:return!n}}(),f=O(d),h=(0,w.useCallback)(function(e){void 0===e&&(e=[]),f.current||a(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),g=(0,w.useRef)(null),p=B(t=>{if(d&&!n)return e_;if(!t||t===e_||c.current!==e||null!=i){let t=new Map;for(let n of e){if(!n)continue;if(i&&i.length>0&&!i.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new eL(s(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,i,n,d,s]);return(0,w.useEffect)(()=>{c.current=e},[e]),(0,w.useEffect)(()=>{d||h()},[n,d]),(0,w.useEffect)(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),(0,w.useEffect)(()=>{d||"number"!=typeof o||null!==g.current||(g.current=setTimeout(()=>{h(),g.current=null},o))},[o,d,h,...r]),{droppableRects:p,measureDroppableContainers:h,measuringScheduled:null!=i}}(eN,{dragging:Z,dependencies:[el.x,el.y],config:ej.droppable}),eO=B(e=>{var t;return null==ee?null:null!=(t=null!=p?p:e)?t:null},[p=(g=null!=ee?en.get(ee):void 0)?g.node.current:null,ee]),eB=(0,w.useMemo)(()=>ex?Y(ex):null,[ex]),eF=(u=(null==eg?void 0:eg.autoScrollEnabled)===!1,c="object"==typeof N?!1===N.enabled:!1===N,h=Z&&!u&&!c,"object"==typeof N?{...N,enabled:h}:{enabled:h}),eP=eW(eO,ej.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:l=!0}=e,i=(0,w.useRef)(!1),{x:a,y:o}="boolean"==typeof l?{x:l,y:l}:l;k(()=>{if(!a&&!o||!t){i.current=!1;return}if(i.current||!r)return;let e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;let l=ef(n(e),r);if(a||(l.x=0),o||(l.y=0),i.current=!0,Math.abs(l.x)>0||Math.abs(l.y)>0){let t=eb(e);t&&t.scrollBy({top:l.y,left:l.x})}},[t,a,o,r,n])}({activeNode:null!=ee?en.get(ee):null,config:eF.layoutShiftCompensation,initialRect:eP,measure:ej.draggable.measure});let eU=eH(eO,ej.draggable.measure,eP),ez=eH(eO?eO.parentElement:null),eY=(0,w.useRef)({activatorEvent:null,active:null,activeNode:eO,collisionRect:null,collisions:null,droppableRects:ek,draggableNodes:en,draggingNode:null,draggingNodeRect:null,droppableContainers:ei,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),e0=ei.getNodeFor(null==(t=eY.current.over)?void 0:t.id),e1=function(e){let{measure:t}=e,[n,r]=(0,w.useState)(null),l=eX({callback:(0,w.useCallback)(e=>{for(let{target:n}of e)if(M(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[i,a]=F((0,w.useCallback)(e=>{let n=function(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return M(t)?t:e}(e);null==l||l.disconnect(),n&&(null==l||l.observe(n)),r(n?t(n):null)},[t,l]));return(0,w.useMemo)(()=>({nodeRef:i,rect:n,setRef:a}),[n,i,a])}({measure:ej.dragOverlay.measure}),e5=null!=(n=e1.nodeRef.current)?n:eO,e9=Z?null!=(r=e1.rect)?r:eU:null,te=!!(e1.nodeRef.current&&e1.rect),tt=(y=eW(i=te?null:eU),ef(i,y)),tn=eq(e5?R(e5):null),tr=(a=Z?null!=e0?e0:eO:null,D=(0,w.useRef)(a),I=B(e=>a?e&&e!==eV&&a&&D.current&&a.parentNode===D.current.parentNode?e:ev(a):eV,[a]),(0,w.useEffect)(()=>{D.current=a},[a]),I),tl=function(e,t){void 0===t&&(t=ep);let[n]=e,r=eq(n?R(n):null),[l,i]=(0,w.useState)(eJ);function a(){i(()=>e.length?e.map(e=>eD(e)?r:new eL(t(e),e)):eJ)}let o=eX({callback:a});return k(()=>{null==o||o.disconnect(),a(),e.forEach(e=>null==o?void 0:o.observe(e))},[e]),l}(tr),ti=function(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}(W,{transform:{x:el.x-tt.x,y:el.y-tt.y,scaleX:1,scaleY:1},activatorEvent:ex,active:eu,activeNodeRect:eU,containerNodeRect:ez,draggingNodeRect:e9,over:eY.current.over,overlayNodeRect:e1.rect,scrollableAncestors:tr,scrollableAncestorRects:tl,windowRect:tn}),ta=eB?_(eB,el):null,to=function(e){let[t,n]=(0,w.useState)(null),r=(0,w.useRef)(e),l=(0,w.useCallback)(e=>{let t=ey(e.target);t&&n(e=>e?(e.set(t,eC(t)),new Map(e)):null)},[]);return(0,w.useEffect)(()=>{let t=r.current;if(e!==t){i(t);let a=e.map(e=>{let t=ey(e);return t?(t.addEventListener("scroll",l,{passive:!0}),[t,eC(t)]):null}).filter(e=>null!=e);n(a.length?new Map(a):null),r.current=e}return()=>{i(e),i(t)};function i(e){e.forEach(e=>{let t=ey(e);null==t||t.removeEventListener("scroll",l)})}},[l,e]),(0,w.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>_(e,t),er):eE(e):er,[e,t])}(tr),ts=eG(to),tu=eG(to,[eU]),tc=_(ti,ts),td=e9?eh(e9,ti):null,tf=eu&&td?U({active:eu,collisionRect:td,droppableRects:ek,droppableContainers:eN,pointerCoordinates:ta}):null,th=es(tf,"id"),[tg,tp]=(0,w.useState)(null),tm=(o=te?ti:_(ti,tu),s=null!=(l=null==tg?void 0:tg.rect)?l:null,{...o,scaleX:s&&eU?s.width/eU.width:1,scaleY:s&&eU?s.height/eU.height:1}),tv=(0,w.useRef)(null),tb=(0,w.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(null==ec.current)return;let l=en.get(ec.current);if(!l)return;let i=e.nativeEvent,a=new n({active:ec.current,activeNode:l,event:i,options:r,context:eY,onAbort(e){if(!en.get(e))return;let{onDragAbort:t}=eR.current,n={id:e};null==t||t(n),G({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!en.get(e))return;let{onDragPending:l}=eR.current,i={id:e,constraint:t,initialCoordinates:n,offset:r};null==l||l(i),G({type:"onDragPending",event:i})},onStart(e){let t=ec.current;if(null==t)return;let n=en.get(t);if(!n)return;let{onDragStart:r}=eR.current,l={activatorEvent:i,active:{id:t,data:n.data,rect:eo}};(0,C.unstable_batchedUpdates)(()=>{null==r||r(l),$(x.Initializing),V({type:d.DragStart,initialCoordinates:e,active:t}),G({type:"onDragStart",event:l}),em(tv.current),ew(i)})},onMove(e){V({type:d.DragMove,coordinates:e})},onEnd:o(d.DragEnd),onCancel:o(d.DragCancel)});function o(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:l}=eY.current,a=null;if(t&&l){let{cancelDrop:o}=eR.current;a={activatorEvent:i,active:t,collisions:n,delta:l,over:r},e===d.DragEnd&&"function"==typeof o&&await Promise.resolve(o(a))&&(e=d.DragCancel)}ec.current=null,(0,C.unstable_batchedUpdates)(()=>{V({type:e}),$(x.Uninitialized),tp(null),em(null),ew(null),tv.current=null;let t=e===d.DragEnd?"onDragEnd":"onDragCancel";if(a){let e=eR.current[t];null==e||e(a),G({type:t,event:a})}})}}tv.current=a},[en]),ty=(0,w.useCallback)((e,t)=>(n,r)=>{let l=n.nativeEvent,i=en.get(r);null!==ec.current||!i||l.dndKit||l.defaultPrevented||!0===e(n,t.options,{active:i})&&(l.dndKit={capturedBy:t.sensor},ec.current=r,tb(n,t))},[en,tb]),tx=(0,w.useMemo)(()=>T.reduce((e,t)=>{let{sensor:n}=t;return[...e,...n.activators.map(e=>({eventName:e.eventName,handler:ty(e.handler,t)}))]},[]),[T,ty]);(0,w.useEffect)(()=>{if(!S)return;let e=T.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(let t of e)null==t||t()}},T.map(e=>{let{sensor:t}=e;return t})),k(()=>{eU&&J===x.Initializing&&$(x.Initialized)},[eU,J]),(0,w.useEffect)(()=>{let{onDragMove:e}=eR.current,{active:t,activatorEvent:n,collisions:r,over:l}=eY.current;if(!t||!n)return;let i={active:t,activatorEvent:n,collisions:r,delta:{x:tc.x,y:tc.y},over:l};(0,C.unstable_batchedUpdates)(()=>{null==e||e(i),G({type:"onDragMove",event:i})})},[tc.x,tc.y]),(0,w.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:l}=eY.current;if(!e||null==ec.current||!t||!l)return;let{onDragOver:i}=eR.current,a=r.get(th),o=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,s={active:e,activatorEvent:t,collisions:n,delta:{x:l.x,y:l.y},over:o};(0,C.unstable_batchedUpdates)(()=>{tp(o),null==i||i(s),G({type:"onDragOver",event:s})})},[th]),k(()=>{eY.current={activatorEvent:ex,active:eu,activeNode:eO,collisionRect:td,collisions:tf,droppableRects:ek,draggableNodes:en,draggingNode:e5,draggingNodeRect:e9,droppableContainers:ei,over:tg,scrollableAncestors:tr,scrollAdjustedTranslate:tc},eo.current={initial:e9,translated:td}},[eu,eO,tf,td,en,e5,e9,ek,ei,tg,tr,tc]),function(e){let{acceleration:t,activator:n=m.Pointer,canScroll:r,draggingRect:l,enabled:i,interval:a=5,order:o=v.TreeOrder,pointerCoordinates:s,scrollableAncestors:u,scrollableAncestorRects:c,delta:d,threshold:h}=e,g=function(e){let{delta:t,disabled:n}=e,r=P(t);return B(e=>{if(n||!r||!e)return eK;let l={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[f.Backward]:e.x[f.Backward]||-1===l.x,[f.Forward]:e.x[f.Forward]||1===l.x},y:{[f.Backward]:e.y[f.Backward]||-1===l.y,[f.Forward]:e.y[f.Forward]||1===l.y}}},[n,t,r])}({delta:d,disabled:!i}),[p,b]=A(),y=(0,w.useRef)({x:0,y:0}),x=(0,w.useRef)({x:0,y:0}),C=(0,w.useMemo)(()=>{switch(n){case m.Pointer:return s?{top:s.y,bottom:s.y,left:s.x,right:s.x}:null;case m.DraggableRect:return l}},[n,l,s]),D=(0,w.useRef)(null),S=(0,w.useCallback)(()=>{let e=D.current;if(!e)return;let t=y.current.x*x.current.x,n=y.current.y*x.current.y;e.scrollBy(t,n)},[]),I=(0,w.useMemo)(()=>o===v.TreeOrder?[...u].reverse():u,[o,u]);(0,w.useEffect)(()=>{if(!i||!u.length||!C)return void b();for(let e of I){if((null==r?void 0:r(e))===!1)continue;let n=c[u.indexOf(e)];if(!n)continue;let{direction:l,speed:i}=function(e,t,n,r,l){let{top:i,left:a,right:o,bottom:s}=n;void 0===r&&(r=10),void 0===l&&(l=eI);let{isTop:u,isBottom:c,isLeft:d,isRight:h}=eS(e),g={x:0,y:0},p={x:0,y:0},m={height:t.height*l.y,width:t.width*l.x};return!u&&i=t.bottom-m.height&&(g.y=f.Forward,p.y=r*Math.abs((t.bottom-m.height-s)/m.height)),!h&&o>=t.right-m.width?(g.x=f.Forward,p.x=r*Math.abs((t.right-m.width-o)/m.width)):!d&&a0||i.y>0){b(),D.current=e,p(S,a),y.current=i,x.current=l;return}}y.current={x:0,y:0},x.current={x:0,y:0},b()},[t,S,r,b,i,a,JSON.stringify(C),JSON.stringify(g),p,u,I,c,JSON.stringify(h)])}({...eF,delta:el,draggingRect:td,pointerCoordinates:ta,scrollableAncestors:tr,scrollableAncestorRects:tl});let tw=(0,w.useMemo)(()=>({active:eu,activeNode:eO,activeNodeRect:eU,activatorEvent:ex,collisions:tf,containerNodeRect:ez,dragOverlay:e1,draggableNodes:en,droppableContainers:ei,droppableRects:ek,over:tg,measureDroppableContainers:eT,scrollableAncestors:tr,scrollableAncestorRects:tl,measuringConfiguration:ej,measuringScheduled:eA,windowRect:tn}),[eu,eO,eU,ex,tf,ez,e1,en,ei,ek,tg,eT,tr,tl,ej,eA,tn]),tC=(0,w.useMemo)(()=>({activatorEvent:ex,activators:tx,active:eu,activeNodeRect:eU,ariaDescribedById:{draggable:eM},dispatch:V,draggableNodes:en,over:tg,measureDroppableContainers:eT}),[ex,tx,eu,eU,V,eM,en,tg,eT]);return w.default.createElement(Q.Provider,{value:q},w.default.createElement(e2.Provider,{value:tC},w.default.createElement(e7.Provider,{value:tw},w.default.createElement(e8.Provider,{value:tm},j)),w.default.createElement(e6,{disabled:(null==L?void 0:L.restoreFocus)===!1})),w.default.createElement(et,{...L,hiddenTextDescribedById:eM}))}),te=(0,w.createContext)(null),tt="button";function tn(e){let{id:t,data:n,disabled:r=!1,attributes:l}=e,i=z("Draggable"),{activators:a,activatorEvent:o,active:s,activeNodeRect:u,ariaDescribedById:c,draggableNodes:d,over:f}=(0,w.useContext)(e2),{role:h=tt,roleDescription:g="draggable",tabIndex:p=0}=null!=l?l:{},m=(null==s?void 0:s.id)===t,v=(0,w.useContext)(m?e8:te),[b,y]=F(),[x,C]=F(),D=(0,w.useMemo)(()=>a.reduce((e,n)=>{let{eventName:r,handler:l}=n;return e[r]=e=>{l(e,t)},e},{}),[a,t]),S=O(n);return k(()=>(d.set(t,{id:t,key:i,node:b,activatorNode:x,data:S}),()=>{let e=d.get(t);e&&e.key===i&&d.delete(t)}),[d,t]),{active:s,activatorEvent:o,activeNodeRect:u,attributes:(0,w.useMemo)(()=>({role:h,tabIndex:p,"aria-disabled":r,"aria-pressed":!!m&&h===tt||void 0,"aria-roledescription":g,"aria-describedby":c.draggable}),[r,h,p,m,g,c.draggable]),isDragging:m,listeners:r?void 0:D,node:b,over:f,setNodeRef:y,setActivatorNodeRef:C,transform:v}}function tr(){return(0,w.useContext)(e7)}let tl={timeout:25};function ti(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:l}=e,i=z("Droppable"),{active:a,dispatch:o,over:s,measureDroppableContainers:u}=(0,w.useContext)(e2),c=(0,w.useRef)({disabled:n}),f=(0,w.useRef)(!1),h=(0,w.useRef)(null),g=(0,w.useRef)(null),{disabled:p,updateMeasurementsFor:m,timeout:v}={...tl,...l},b=O(null!=m?m:r),y=eX({callback:(0,w.useCallback)(()=>{if(!f.current){f.current=!0;return}null!=g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{u(Array.isArray(b.current)?b.current:[b.current]),g.current=null},v)},[v]),disabled:p||!a}),[x,C]=F((0,w.useCallback)((e,t)=>{y&&(t&&(y.unobserve(t),f.current=!1),e&&y.observe(e))},[y])),D=O(t);return(0,w.useEffect)(()=>{y&&x.current&&(y.disconnect(),f.current=!1,y.observe(x.current))},[x,y]),(0,w.useEffect)(()=>(o({type:d.RegisterDroppable,element:{id:r,key:i,disabled:n,node:x,rect:h,data:D}}),()=>o({type:d.UnregisterDroppable,key:i,id:r})),[r]),(0,w.useEffect)(()=>{n!==c.current.disabled&&(o({type:d.SetDroppableDisabled,id:r,key:i,disabled:n}),c.current.disabled=n)},[r,i,n,o]),{active:a,rect:h,isOver:(null==s?void 0:s.id)===r,node:x,over:s,setNodeRef:C}}let ta={position:"fixed",touchAction:"none"},to=e=>X(e)?"transform 250ms ease":void 0;function ts(e,t,n){let r=e.slice();return r.splice(n=0}t={styles:{active:{opacity:"0"}}},e.s(["DndContext",0,e9,"KeyboardCode",0,g,"KeyboardSensor",0,eO,"PointerSensor",0,ez,"closestCenter",0,e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,l=eu(t,t.left,t.top),i=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=el(eu(r),l);i.push({id:t,data:{droppableContainer:e,value:n}})}}return i.sort(ei)},"closestCorners",0,ec,"getClientRect",0,ep,"getFirstCollision",0,es,"getScrollableAncestors",0,ev,"useDndContext",0,tr,"useDraggable",0,tn,"useDroppable",0,ti,"useSensor",0,function(e,t){return(0,w.useMemo)(()=>({sensor:e,options:null!=t?t:{}}),[e,t])},"useSensors",0,function(){for(var e=arguments.length,t=Array(e),n=0;n[...t].filter(e=>null!=e),[...t])}],879499);let tc=e=>{let{rects:t,activeIndex:n,overIndex:r,index:l}=e,i=ts(t,r,n),a=t[l],o=i[l];return o&&a?{x:o.left-a.left,y:o.top-a.top,scaleX:o.width/a.width,scaleY:o.height/a.height}:null},td={scaleX:1,scaleY:1},tf="Sortable",th=w.default.createContext({activeIndex:-1,containerId:tf,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:tc,disabled:{draggable:!1,droppable:!1}}),tg=e=>{let{id:t,items:n,activeIndex:r,overIndex:l}=e;return ts(n,r,l).indexOf(t)},tp=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:l,items:i,newIndex:a,previousItems:o,previousContainerId:s,transition:u}=e;return!!u&&!!r&&(o===i||l!==a)&&(!!n||a!==l&&t===s)},tm={duration:200,easing:"ease"},tv="transform",tb=H.Transition.toString({property:tv,duration:0,easing:"linear"}),ty={roleDescription:"sortable"};function tx(e){if(!e)return!1;let t=e.data.current;return!!t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable}let tw=[g.Down,g.Right,g.Up,g.Left];function tC(e,t){return!!tx(e)&&!!tx(t)&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}e.s(["SortableContext",0,function(e){let{children:t,id:n,items:r,strategy:l=tc,disabled:i=!1}=e,{active:a,dragOverlay:o,droppableRects:s,over:u,measureDroppableContainers:c}=tr(),d=z(tf,n),f=null!==o.rect,h=(0,w.useMemo)(()=>r.map(e=>"object"==typeof e&&"id"in e?e.id:e),[r]),g=null!=a,p=a?h.indexOf(a.id):-1,m=u?h.indexOf(u.id):-1,v=(0,w.useRef)(h),b=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{b&&g&&c(h)},[b,h,g,c]),(0,w.useEffect)(()=>{v.current=h},[h]);let C=(0,w.useMemo)(()=>({activeIndex:p,containerId:d,disabled:x,disableTransforms:y,items:h,overIndex:m,useDragOverlay:f,sortedRects:h.reduce((e,t,n)=>{let r=s.get(t);return r&&(e[n]=r),e},Array(h.length)),strategy:l}),[p,d,x.draggable,x.droppable,y,h,m,s,f,l]);return w.default.createElement(th.Provider,{value:C},t)},"arrayMove",0,ts,"sortableKeyboardCoordinates",0,(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:l,droppableContainers:i,over:a,scrollableAncestors:o}}=t;if(tw.includes(e.code)){if(e.preventDefault(),!n||!r)return;let t=[];i.getEnabled().forEach(n=>{if(!n||null!=n&&n.disabled)return;let i=l.get(n.id);if(i)switch(e.code){case g.Down:r.topi.top&&t.push(n);break;case g.Left:r.left>i.left&&t.push(n);break;case g.Right:r.left1&&(d=c[1].id),null!=d){let e=i.get(n.id),t=i.get(d),a=t?l.get(t.id):null,c=null==t?void 0:t.node.current;if(c&&a&&e&&t){var s,u;let n=ev(c).some((e,t)=>o[t]!==e),l=tC(e,t),i=(s=e,u=t,!!tx(s)&&!!tx(u)&&!!tC(s,u)&&s.data.current.sortable.index({sortable:{containerId:p,index:E,items:g},...s}),[p,s,E,g]),L=(0,w.useMemo)(()=>g.slice(g.indexOf(c)),[g,c]),{rect:M,node:N,isOver:j,setNodeRef:T}=ti({id:c,data:R,disabled:I.droppable,resizeObserverConfig:{updateMeasurementsFor:L,...f}}),{active:A,activatorEvent:O,activeNodeRect:B,attributes:F,setNodeRef:P,listeners:U,isDragging:z,over:K,setActivatorNodeRef:_,transform:W}=tn({id:c,data:R,attributes:{...ty,...a},disabled:I.draggable}),Y=D(T,P),V=!!A,G=V&&!b&&tu(m)&&tu(x),q=!C&&z,J=q&&G?W:null,$=G?null!=J?J:(null!=d?d:S)({rects:y,activeNodeRect:B,activeIndex:m,overIndex:x,index:E}):null,Q=tu(m)&&tu(x)?u({id:c,items:g,activeIndex:m,overIndex:x}):E,Z=null==A?void 0:A.id,ee=(0,w.useRef)({activeId:Z,items:g,newIndex:Q,containerId:p}),et=g!==ee.current.items,en=i({active:A,containerId:p,isDragging:z,isSorting:V,id:c,index:E,items:g,newIndex:ee.current.newIndex,previousItems:ee.current.items,previousContainerId:ee.current.containerId,transition:h,wasDragging:null!=ee.current.activeId}),er=function(e){let{disabled:t,index:n,node:r,rect:l}=e,[i,a]=(0,w.useState)(null),o=(0,w.useRef)(n);return k(()=>{if(!t&&n!==o.current&&r.current){let e=l.current;if(e){let t=ep(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&a(n)}}n!==o.current&&(o.current=n)},[t,n,r,l]),(0,w.useEffect)(()=>{i&&a(null)},[i]),i}({disabled:!en,index:E,node:N,rect:M});return(0,w.useEffect)(()=>{V&&ee.current.newIndex!==Q&&(ee.current.newIndex=Q),p!==ee.current.containerId&&(ee.current.containerId=p),g!==ee.current.items&&(ee.current.items=g)},[V,Q,p,g]),(0,w.useEffect)(()=>{if(Z===ee.current.activeId)return;if(null!=Z&&null==ee.current.activeId){ee.current.activeId=Z;return}let e=setTimeout(()=>{ee.current.activeId=Z},50);return()=>clearTimeout(e)},[Z]),{active:A,activeIndex:m,attributes:F,data:R,rect:M,index:E,newIndex:Q,items:g,isOver:j,isSorting:V,isDragging:z,listeners:U,node:N,overIndex:x,over:K,setNodeRef:Y,setActivatorNodeRef:_,setDroppableNodeRef:T,setDraggableNodeRef:P,transform:null!=er?er:$,transition:er||et&&ee.current.newIndex===E?tb:(!q||X(O))&&h&&(V||en)?H.Transition.toString({...h,property:tv}):void 0}},"verticalListSortingStrategy",0,e=>{var t,n,r,l;let i,a,o,{activeIndex:s,activeNodeRect:u,index:c,rects:d,overIndex:f}=e,h=null!=(t=d[s])?t:u;if(!h)return null;if(c===s){let e=d[f];return e?{x:0,y:ss&&c=f?{x:0,y:h.height+g,...td}:{x:0,y:0,...td}}],929776)},24959,441667,686557,e=>{"use strict";var t=e.i(155252),n=e.i(206507),r=e.i(659334),l=e.i(985542),i=e.i(381477),a=e.i(612977),o=e.i(75430),s=e.i(498076),u=e.i(935331),c=e.i(879499),d=e.i(929776),f=e.i(776169),h=e.i(343277),g=e.i(189816),p=e.i(925209),m=e.i(226602),v=e.i(368847),b=e.i(632137),y=e.i(747961);let x=(0,n.forwardRef)(({title:e,titleId:n,desc:r,descId:l,...i},a)=>(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",ref:a,"aria-labelledby":n,"aria-describedby":l,...i,children:[r?(0,t.jsx)("desc",{id:l,children:r}):null,void 0===e?(0,t.jsx)("title",{id:n,children:"Star"}):e?(0,t.jsx)("title",{id:n,children:e}):null,(0,t.jsx)("path",{fill:"currentColor",d:"m8 3.26 1.38 2.79.23.5.5.075 3.08.445L11 9.22l-.374.365.09.5.525 3.065-2.755-1.445L8 11.5l-.465.245L4.78 13.17l.5-3.065.09-.5L5 9.22 2.79 7.045 5.87 6.6l.5-.075.23-.5zM8 1 5.727 5.61.64 6.345l3.68 3.59L3.45 15 8 12.61 12.55 15l-.87-5.065 3.68-3.585-5.085-.74z"})]})),w=n.default.forwardRef((e,n)=>(0,t.jsx)(y.BaseIcon,{ref:n,icon:x,...e}));w.displayName="Star";let C=(0,n.forwardRef)(({title:e,titleId:n,desc:r,descId:l,...i},a)=>(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",ref:a,"aria-labelledby":n,"aria-describedby":l,...i,children:[r?(0,t.jsx)("desc",{id:l,children:r}):null,void 0===e?(0,t.jsx)("title",{id:n,children:"Star"}):e?(0,t.jsx)("title",{id:n,children:e}):null,(0,t.jsx)("path",{fill:"currentColor",d:"M8 1 5.727 5.61.64 6.345l3.68 3.59L3.45 15 8 12.61 12.55 15l-.87-5.065 3.68-3.585-5.085-.74z"})]})),D=n.default.forwardRef((e,n)=>(0,t.jsx)(y.BaseIcon,{ref:n,icon:C,...e}));function S({isFavorite:e,onClick:n}){let l=(0,r.useTranslations)("Header");return(0,t.jsxs)("div",{className:"group/favorite flex shrink-0 items-center",children:[(0,t.jsx)("span",{className:(0,b.cn)("w-0 overflow-hidden pl-2 text-xs text-nowrap capitalize opacity-0 transition-all group-hover/favorite:opacity-100",{"group-hover/favorite:w-22":!e,"group-hover/favorite:w-26.5":e}),children:l(e?"removeLocation":"saveLocation")}),(0,t.jsx)("button",{onClick:n,className:"flex cursor-pointer items-center justify-center p-1",children:e?(0,t.jsx)(D,{className:"size-6 text-[#fdc107]",title:l("removeLocation")}):(0,t.jsx)(w,{className:"size-6 text-inherit hover:text-[#fdc107]",title:"Favorite"})})]})}D.displayName="StarFilled";var I=e.i(316078),E=e.i(180193),R=e.i(546446),L=e.i(889951),M=e.i(726249),N=e.i(674885),j=e.i(617874),k=e.i(942400);let T=e=>{let t=(0,R.useAtomValue)(N.userUnitPreferenceAtom),n=(0,j.unitsSystemByName)(t)?.code,r=(0,k.usePageLocale)(),l=e?(0,M.formatGeocode)(e):null,{data:a}=(0,i.default)(l?["currentObservations",l,n,r]:null,async([,e,t,n])=>(0,L.getCurrentObservations)({geocode:e,units:t,language:n}),{revalidateIfStale:!0,revalidateOnFocus:!0,dedupingInterval:3e5});return a};function A({search:e}){let n=T(e.geocode),r=n?.iconCode??e.iconCode,l=n?n.temperature:e.temperature;return(0,t.jsxs)("div",{className:"flex items-center gap-1","data-testid":"location-search-weather",children:[(0,t.jsx)("div",{className:"flex items-center justify-center text-gray-400",children:(0,t.jsx)(I.WxIcon,{iconCode:r,className:"lightBG h-5 w-5",iconTheme:"lightBG"})}),(0,t.jsx)("div",{className:"text-l min-w-9 text-inherit",children:(0,t.jsx)(E.Temperature,{value:l})})]})}e.s(["useLocationWeather",0,T],441667);var O=e.i(586754),B=e.i(525936),F=e.i(671525),P=e.i(145651),U=e.i(249725),z=e.i(292980),K=e.i(310847);function _({placeId:e,locationData:l,featureId:i,onSelect:a,onToggleSave:s,onRemove:u,disabledFavorites:c,isFavorite:d,showWeather:f,attributes:h,isFocused:g,isSortable:y,firstItemActionRef:x}){let w=(0,r.useTranslations)("Header"),C=(0,k.usePageLocale)(),{addRecentLocation:D}=(0,P.default)(),{recordFeatureId:I}=(0,U.useLocationFeatureIds)(),{recordDetails:E}=(0,z.useRecentLocationDetails)(),{navigate:L}=(0,F.default)(),M=l?.featureId??i,N=(0,O.useGetLocationById)(l?.nameContext?null:e,C),{isGeolocationLoading:j,resolvePath:T}=(0,B.default)(e,{defer:!0,featureId:M}),[W,X]=(0,n.useState)(!1),{buildSearchItem:Y}=(0,o.useBuildSearchItem)(),H=(0,n.useRef)(null),[,V]=(0,R.useAtom)(K.wxuUserRecentAddressesAtom),G=(0,n.useCallback)(e=>{"address"===e.type&&V(t=>{let n={address:e?.address?.split(",")[0]?.trim()||e.displayName,placeId:e?.placeId,type:e?.type},r=t?.filter(e=>e.placeId!==n.placeId)||[];return[n,...r].slice(0,5)})},[V]),q=(0,n.useMemo)(()=>l||(N?Y(N):null),[Y,N,l]);(0,n.useEffect)(()=>{let e=H.current;return g&&e?.focus(),()=>e?.blur()},[g]);let J=(0,n.useCallback)(async()=>{q&&(D(e),G(q),l&&(E(e,{name:l.name,nameContext:l.nameContext,geocode:l.geocode,featureId:l.featureId,type:l.type,presentationName:l.presentationName,displayName:l.displayName,address:l.address}),l.featureId&&I({placeId:e,geocode:l.geocode},l.featureId)),L(await T()),a?.())},[q,D,G,e,l,E,I,T,L,a]);(0,n.useEffect)(()=>{W&&!j&&q&&(X(!1),J())},[W,j,q,J]);let $=(0,n.useCallback)(()=>{if(q){if(j)return void X(!0);J()}},[q,j,J]);return((0,n.useEffect)(()=>{if(x)return x.current=$,()=>{x.current=null}},[x,$]),q)?(0,t.jsxs)("div",{className:(0,b.cn)("group flex h-16 w-full flex-1 items-center rounded-2xl px-4 transition-colors","hover:bg-gray-100",g&&"bg-gray-100"),children:[(0,t.jsxs)("div",{role:"button",tabIndex:0,...h,"data-testid":"location-search-result",ref:H,className:(0,b.cn)("flex min-w-0 flex-1 shrink-1 cursor-pointer items-center gap-3 md:gap-4",g&&"outline-0",h?.className),onClick:$,onKeyDown:e=>{h?.onKeyDown?.(e),("Enter"===e.key||" "===e.key)&&(" "!==e.key||!y)&&q&&(e.preventDefault(),$())},children:[f?(0,t.jsx)(A,{search:q}):(0,t.jsx)(p.Location,{className:"size-4 shrink-0 text-current md:size-6"}),(0,t.jsxs)("div",{className:"text-left",children:[(0,t.jsx)(v.default,{variant:"Body.M",className:"text-inherit",lineClamp:1,children:q.name}),(0,t.jsx)(v.default,{variant:"Body.S",color:"secondary",className:"pb-0",lineClamp:1,children:q.nameContext})]})]}),!c&&(0,t.jsx)(S,{isFavorite:d,onClick:()=>s?.(q)}),u&&(0,t.jsx)("button",{type:"button","aria-label":w("removeLocation"),"data-testid":"location-search-remove",onClick:t=>{t.stopPropagation(),u(e)},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&e.stopPropagation()},className:"flex shrink-0 cursor-pointer items-center justify-center rounded-full p-1 text-gray-400 transition-colors hover:text-gray-700 focus-visible:ring-2 focus-visible:ring-gray-400 focus-visible:ring-offset-2 focus-visible:outline-none",children:(0,t.jsx)(m.Close,{className:"size-5","aria-hidden":"true"})})]}):null}function W({location:e,onSelect:r,onToggleSave:l,isFocused:i=!1,firstItemActionRef:a}){let s=(0,k.usePageLocale)(),{buildSearchItem:u}=(0,o.useBuildSearchItem)(),c=(0,O.useGetLocationById)(e.placeID||null,s),f=(0,n.useMemo)(()=>c?u(c):null,[u,c]),{attributes:h,listeners:p,setNodeRef:m,transform:v,transition:b,isDragging:y}=(0,d.useSortable)({id:e.placeID||""}),x={transform:g.CSS.Transform.toString(v),transition:b};return f?(0,t.jsx)("div",{ref:m,style:x,className:y?"relative z-10 bg-gray-50 opacity-50 shadow-lg":void 0,children:(0,t.jsx)(_,{placeId:e.placeID,locationData:f,disabledFavorites:!1,onSelect:r,onToggleSave:l,showWeather:!0,isFavorite:!0,attributes:{...h,...p},isFocused:i,firstItemActionRef:a,isSortable:!0})}):null}var X=e.i(611540),Y=e.i(919101),H=e.i(77323),V=e.i(439766);function G({title:e,onClearAll:n,testId:l}){let i=(0,r.useTranslations)("Header");return(0,t.jsxs)("div",{className:"flex h-10 items-center justify-between px-4","data-testid":l,children:[(0,t.jsx)(v.default,{elementType:"h2",variant:"Body.S.Bold",children:e}),n&&(0,t.jsx)("button",{onClick:n,className:"cursor-pointer text-sm font-medium",children:i("clearEntries")})]})}function q({searches:e,searching:l,onSelectSearch:i,showFavorites:a=!0,recentLocations:o=[],favoriteLocations:s,isUserLoggedIn:u,firstItemActionRef:g,onClearRecentLocations:p,onRemoveRecentSearchLocation:m,focusedIndex:b=-1}){let y=(0,r.useTranslations)("Header"),{updatePreferences:x}=(0,f.usePreferences)(),{navigate:w}=(0,F.default)(),{addFavoriteLocation:C,deleteLocation:D}=(0,P.default)(),{resolveFeatureId:S,recordFeatureId:I}=(0,U.useLocationFeatureIds)(),{resolveDetails:E,recordDetails:L}=(0,z.useRecentLocationDetails)(),M=(0,R.useAtomValue)(V.activeLocationAtom),N=(0,R.useSetAtom)(V.activeLocationAtom),{getLocationName:j}=(0,H.usePresentationName)(),T=(0,k.usePageLocale)(),A=(0,X.interpolateUrl)(X.URLS.memberSignup,{locale:T}),[O,B]=(0,R.useAtom)(K.wxuUserRecentAddressesAtom),J=(0,n.useMemo)(()=>u&&s?.map(e=>({...e,geocode:e.coordinate,placeId:e.placeID})).sort((e,t)=>(e.position||0)-(t.position||0))||[],[u,s]),$=(0,n.useMemo)(()=>o.filter(e=>!J.some(t=>t.placeID===e)),[o,J]),Q=(0,c.useSensors)((0,c.useSensor)(c.PointerSensor,{activationConstraint:{distance:8}}),(0,c.useSensor)(c.KeyboardSensor,{coordinateGetter:d.sortableKeyboardCoordinates})),Z=async e=>{if(!u)return void w(A);if(J.some(t=>t.placeID===e.placeId))D(e.placeId),M?.placeId===e.placeId&&N(null);else{let t=e.geocode,n=e.name;if(!t)try{let r=e.featureId?await (0,h.getLocationPointByFeatureId)(e.featureId,"en-US"):e.placeId?await (0,h.getLocationPointByPlaceId)(e.placeId,"en-US"):null;if(r?.location){let e=(0,Y.getAddressForLocationData)(r.location,O);t=`${e.latitude},${e.longitude}`,n=j(e)}}catch(e){console.error("Failed to fetch location data for favoriting:",e)}if(t)C({placeID:e.placeId,coordinate:t,name:n,..."address"===e.type&&e.address?{streetAddress:e.address}:{}}),e.featureId&&(I({placeId:e.placeId,geocode:t},e.featureId),L(e.placeId,{name:n,nameContext:e.nameContext,geocode:t,featureId:e.featureId,type:e.type,presentationName:e.presentationName,displayName:e.displayName,address:e.address})),"address"===e.type&&"address"===e.type&&B(t=>{let n={address:e?.address?.split(",")[0]?.trim()||e.displayName,placeId:e?.placeId,type:e?.type},r=t?.filter(e=>e.placeId!==n.placeId)||[];return[n,...r].slice(0,5)});else console.debug("Unable to get geocode for location:",e.name||e.placeId)}};return(0,t.jsx)("div",{"data-testid":"location-search-results-dropdown",className:"overflow-x-hidden",children:l?(0,t.jsx)(v.default,{className:"p-6 text-center",children:y("loadingResults")}):a&&0===o.length&&0===J.length?(0,t.jsx)("div",{className:"p-6 text-center text-gray-500","data-testid":"location-search-empty-message",children:y("noRecentLocations")}):a?(0,t.jsxs)(t.Fragment,{children:[J.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(G,{title:y("favoritesTitle"),testId:"location-search-favorites-header"}),(0,t.jsx)(c.DndContext,{sensors:Q,collisionDetection:c.closestCenter,onDragEnd:e=>{let{active:t,over:n}=e;if(n&&t.id!==n.id){let e=J.findIndex(e=>e.placeID===t.id),r=J.findIndex(e=>e.placeID===n.id);x({locations:(0,d.arrayMove)([...J],e,r)})}},children:(0,t.jsx)(d.SortableContext,{items:J.map(e=>e.placeID||""),children:(0,t.jsx)("div",{"data-testid":"location-search-favorites-list",children:J.map((e,n)=>(0,t.jsx)(W,{location:e,onToggleSave:Z,onSelect:i,isFocused:n===b,firstItemActionRef:0===n?g:void 0},e.placeID))})})})]}),$.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(G,{title:y("recentLocationsTitle"),onClearAll:p,testId:"location-search-recent-header"}),(0,t.jsx)("div",{"data-testid":"location-search-recent-list",children:$.map((e,n)=>{let r=J.length+n,l=E(e),a=l?{placeId:e,featureId:l.featureId,geocode:l.geocode,presentationName:l.presentationName,name:l.name,nameContext:l.nameContext,displayName:l.displayName??l.name,type:l.type,address:l.address??""}:void 0;return(0,t.jsx)(_,{placeId:e,locationData:a,featureId:S({placeId:e}),onSelect:i,onToggleSave:Z,onRemove:m,isFocused:r===b,firstItemActionRef:0===r?g:void 0},e)})})]})]}):0===e.length?(0,t.jsx)(v.default,{children:y("noResults")}):(0,t.jsx)("div",{"data-testid":"location-search-results-list",children:e.map((e,n)=>{let r=J.some(t=>t.placeID===e.placeId);return(0,t.jsx)(_,{placeId:e.placeId,locationData:e,onSelect:i,onToggleSave:Z,isFavorite:r,isFocused:n===b,firstItemActionRef:0===n?g:void 0},e.placeId)})})})}var J=e.i(274432),$=e.i(877957),Q=e.i(523084);let Z=(0,n.forwardRef)(({title:e,titleId:n,desc:r,descId:l,...i},a)=>(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",ref:a,"aria-labelledby":n,"aria-describedby":l,...i,children:[r?(0,t.jsx)("desc",{id:l,children:r}):null,void 0===e?(0,t.jsx)("title",{id:n,children:"Close"}):e?(0,t.jsx)("title",{id:n,children:e}):null,(0,t.jsx)("path",{fill:"currentColor",d:"M8 1C4.1 1 1 4.1 1 8s3.1 7 7 7 7-3.1 7-7-3.1-7-7-7m2.7 10.5L8 8.8l-2.7 2.7-.8-.8L7.2 8 4.5 5.3l.8-.8L8 7.2l2.7-2.7.8.8L8.8 8l2.7 2.7z"})]})),ee=n.default.forwardRef((e,n)=>(0,t.jsx)(y.BaseIcon,{ref:n,icon:Z,...e}));ee.displayName="CloseFilled";var et=e.i(528600),en=e.i(909232),er=e.i(870393);let el=(0,n.memo)(({recentLocationsLength:e})=>{let n=(0,r.useTranslations)("Header"),{navigate:l}=(0,F.default)(),i=(0,k.usePageLocale)(),a=((0,en.useClientMobileMedia)(),(0,X.interpolateUrl)(X.URLS.memberSignup,{locale:i})),{user:{isUserLoggedIn:o}}=(0,et.useUser)();return o||e{l(a)},children:[(0,t.jsxs)("div",{className:"items-center justify-between",children:[(0,t.jsx)(v.Text,{variant:"Body.M.Bold",children:n(`upsellTitle${e>=4?"2":"1"}`)}),(0,t.jsx)(v.Text,{variant:"Body.S",children:n(`upsellSubtitle${e>=4?"2":"1"}`)})]}),(0,t.jsx)(er.ChevronRight,{className:"size-5"})]})});function ei({className:e,searchContainerRef:r,searchInputRef:l,searchQuery:i,placeholderText:a,searchOpen:o,isMobile:s,canSearch:c,showFavorites:d,searching:f,recentSearches:h,recentLocations:g,favoriteLocations:p,isUserLoggedIn:m=!1,setSearchQuery:v,onSearchOpen:y,onSelectSearch:x,onClearRecentLocations:w,onRemoveRecentSearchLocation:C}){let[D,S]=(0,n.useState)(-1),[I,E]=(0,n.useState)(!1),R=(0,n.useRef)(null),L=(0,n.useMemo)(()=>{if(!d)return h.length;let e=m&&p?.length||0,t=new Set(p?.map(e=>e.placeID));return e+(g?.filter(e=>!t.has(e)).length||0)},[d,h.length,m,p,g]);(0,n.useEffect)(()=>{S(-1)},[i,o,L]);let M=(0,n.useCallback)(e=>{o&&0!==L&&("ArrowDown"===e.key?(e.preventDefault(),S(e=>{if(-1===e)return 0;let t=e+1;return t>=L?L-1:t})):"ArrowUp"===e.key&&(e.preventDefault(),S(e=>{let t=e-1;return t{v(""),y(!1),S(-1)},[y,v]),j=(0,n.useCallback)(e=>{"Enter"===e.key&&o&&R.current?(e.preventDefault(),R.current()):"Escape"===e.key&&(e.stopPropagation(),N())},[o,N]);return((0,n.useEffect)(()=>{o&&!s&&l?.current?.focus()},[o,s,l]),(0,n.useEffect)(()=>{if(!o)return;let e=e=>{"ArrowDown"===e.key||"ArrowUp"===e.key?(E(!1),M(e)):"Tab"===e.key?E(!0):"Escape"===e.key&&N()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[o,M,N]),o)?(0,t.jsxs)("div",{ref:r,className:(0,b.cn)("z-110 w-full bg-white text-gray-800",s&&"fixed top-0 right-0 bottom-0 left-0 h-full overflow-auto",!s&&"rounded-3xl shadow-[0_4px_16px_0_rgba(0,0,0,0.10),0_0_32px_0_rgba(0,0,0,0.10)]",e),"data-testid":"header-search",children:[(0,t.jsxs)("div",{className:(0,b.cn)("flex w-full items-center gap-2",s?"p-3 pt-4":"p-2"),children:[s&&(0,t.jsx)($.Button,{variant:"ghostUI",className:"m-0 p-1",onClick:()=>y(!1),"aria-label":"Close search",children:(0,t.jsx)(Q.ChevronLeft,{className:"size-6"})}),(0,t.jsxs)("div",{className:"relative grow",children:[(0,t.jsx)(u.Input,{ref:l,value:i,placeholder:a,"data-testid":"location-search-input",onChange:e=>v(e.target.value),onKeyDown:j,className:(0,b.cn)("relative box-border h-12 rounded-3xl border-2 border-transparent bg-white! ps-9.5 pe-10 shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_0_32px_0_rgba(0,0,0,0.12)] transition-all placeholder:text-gray-900 placeholder:transition-all hover:border-blue-500 focus:placeholder:text-gray-400 focus-visible:border-blue-500")}),(0,t.jsx)(J.Search,{className:"pointer-events-none absolute start-4 top-1/2 flex size-4 -translate-y-1/2 transform items-center text-gray-900"}),(0,t.jsx)("button",{className:(0,b.cn)("absolute end-3.5 top-1/2 flex -translate-y-1/2 transform items-center opacity-0 transition-all",{"cursor-pointer opacity-100":!!i}),onClick:()=>v(""),disabled:!i,"aria-label":"Clear search",children:(0,t.jsx)(ee,{className:"size-5 text-gray-900"})})]})]}),(c||d)&&(0,t.jsxs)("div",{className:(0,b.cn)("px-2 pb-2",s?"overflow-auto":"max-h-130 overflow-y-auto"),children:[(0,t.jsx)(q,{searches:h,searching:f,showFavorites:d,recentLocations:g,onClearAll:()=>v(""),favoriteLocations:p||[],isUserLoggedIn:m,firstItemActionRef:R,onSelectSearch:x,onClearRecentLocations:w,onRemoveRecentSearchLocation:C,focusedIndex:I?-1:D}),d&&(0,t.jsx)(el,{recentLocationsLength:g?.length??0})]})]}):null}var ea=e.i(800462);e.s([],24959),e.s(["Search",0,function({locale:e,className:u,open:c,onOpenChange:d}){let[f,h]=(0,n.useState)(""),g=(0,a.useDebounce)(f,300),p=(0,s.useIsMobile)(),m=(0,n.useRef)(null),v=(0,n.useRef)(null),b=(0,r.useTranslations)("Header"),{recentLocations:y,favoriteLocations:x,clearRecentLocations:w,removeRecentLocation:C,removeRecentAddress:D}=(0,P.default)(),{user:S}=(0,et.useUser)(),{isUserLoggedIn:I}=S,E=(0,R.useSetAtom)(ea.fromSearchResultAtom),L=b("searchPlaceholderText"),M=g.length>=3,N=!g,{data:j,isLoading:k}=(0,i.default)(M?["locations",g,"city,locality,neighborhood,postal,airport,address",e]:null,([e,t,n,r])=>(0,l.getLocationsByQueryAndType)(t,n,r),{revalidateOnFocus:!1,dedupingInterval:2e3}),{buildSearchItem:T}=(0,o.useBuildSearchItem)(),A=(0,n.useMemo)(()=>j?j.map(e=>T(e)):[],[T,j]);(0,n.useEffect)(()=>(document.body.style.overflow=p&&c?"hidden":"",p&&c&&v.current?.focus(),()=>{document.body.style.overflow=""}),[p,c]),(0,n.useEffect)(()=>{c||h("")},[c]);let O=(0,n.useCallback)(e=>{C(e),D(e)},[C,D]),B=(0,n.useCallback)(()=>{d(!1),E(f)},[d,E,f]);return(0,t.jsx)(ei,{className:u,searchContainerRef:m,searchInputRef:v,searchQuery:f,placeholderText:L,searchOpen:c,isMobile:p,canSearch:M,showFavorites:N,searching:k,recentSearches:A,recentLocations:y,favoriteLocations:x,isUserLoggedIn:I,setSearchQuery:h,onSearchOpen:d,onSelectSearch:B,onClearRecentLocations:w,onRemoveRecentSearchLocation:O})}],686557)}]);