import{r as m,j as s,R as K,a as yo,c as Is}from"./react-BWinAwEK.js";import{f as Na,d as Es,i as Ee,o as ti,b as si,c as wo,e as Kt,h as Ne,j as Ta,l as Co,k as ai,m as ni,n as So,t as st,p as ii,q as No,r as To,s as qe,u as ea,v as nn}from"./lodash-BlWAFBKY.js";import{i as jo,a as ks,b as le,c as ri,d as Ro,P as a,u as Te,e as Fe,f as Yt,g as _s,h as kt,j as N,C as la,L as oi,M as Ye,k as ms,l as li,m as ja,n as ve,o as ca,D as Io,p as Eo,S as ko,q as _o,r as Ao,s as Mo,T as Oo,t as Po,v as ci,H as da,w as di,x as Ue,$ as As,y as Lo,z as $o,A as Do,B as Fo,E as at,F as Qe,G as ui,I as Bo,J as Vo,K as Ho,N as Uo,O as qo,Q as Go,R as Wo,U as zo,V as Ko,W as Yo,X as rn,Y as hi,Z as ft,_ as pi,a0 as Zo,a1 as Zt,a2 as Jo,a3 as mi,a4 as on,a5 as Xo,a6 as fi,a7 as gi,a8 as bi,a9 as vi,aa as Qo,ab as el,ac as tl,ad as sl,ae as al,af as _t,ag as nl,ah as il,ai as ln,aj as cn,ak as rl,al as ol,am as ll,an as cl,ao as dl,ap as ul,aq as hl,ar as pl,as as ml,at as fl,au as gl,av as bl,aw as vl,ax as xl,ay as yl,az as wl,aA as Cl,aB as Sl,aC as Nl,aD as xi,aE as Tl,aF as jl,aG as Jt,aH as Rl,aI as yi,aJ as wi,aK as Il,aL as Ra,aM as El,aN as Ci,aO as Ia,aP as kl,aQ as _l,aR as Al,aS as Ml,aT as Ol,aU as Pl,aV as Ll,aW as $l,aX as Dl,aY as Fl,aZ as Bl,a_ as Vl,a$ as Hl,b0 as Ul,b1 as ql,b2 as Gl,b3 as Wl,b4 as zl,b5 as Kl,b6 as Yl,b7 as Zl,b8 as Jl,b9 as Xl,ba as Ql,bb as ec,bc as tc,bd as sc,be as Si,bf as ac,bg as nc,bh as ic,bi as dn,bj as rc,bk as oc}from"./vendor-D1MdY6eg.js";const lc=t=>{const e="/api/accounts/login/v2/refresh",n=new XMLHttpRequest;if(n.open("POST",e,!1),n.setRequestHeader("Authorization",`Bearer ${t.access_token}`),n.send(JSON.stringify({account_id:t.account_id,refresh_id:t.refresh_id})),n.status===200){const i=JSON.parse(n.responseText);return window.localStorage.setItem("recaccount",JSON.stringify(i)),!0}return!1},cc=()=>{const t=window.localStorage.getItem("recaccount"),e=JSON.parse(t);if(t==null)return null;let n=null,i=null,r=null;return n=e?.account?.account_id,r=e.refresh_id,i=e.access_token,n&&r&&i?{account_id:n,refresh_id:r,access_token:i}:null};class Ht{constructor(){this.data={},this.keys=[]}createCookie(e,n,i){let r="";if(i){const o=new Date;o.setTime(o.getTime()+i*24*60*60*1e3),r=`;expires=${o.toUTCString()}`}document.cookie=`${e}=${n}${r};path=/;secure`}readCookie(e){const n=`${e}=`,i=decodeURIComponent(document.cookie).split(";");let r;for(let o=0;on!==e),this.setData()}clear(){this.data={},this.keys=[],this.clearData()}get length(){return this.getData(),this.keys.length}}let is=null,rs=null,os=null,ls=null;function Be(){const t=window.localStorage.getItem("recaccount");if(!t)return!1;const e=JSON.parse(t),n=e.expiration;if(!e.is_guest&&jo(n,new Date))return!0;if(ks(n,new Date)){const i=cc();if(i&&lc(i))return!0;window.localStorage.removeItem("recaccount")}return!1}function Ea(){const t=window.localStorage.getItem("recaccount");if(!t)return!1;const e=JSON.parse(t);return ks(e.expiration,new Date)?(window.localStorage.removeItem("recaccount"),!1):e.is_guest}function Ms(){const t=window.localStorage.getItem("csraccount");if(!t)return!1;const e=JSON.parse(t);return ks(e.expiration,new Date)?(window.localStorage.removeItem("csraccount"),!1):!0}function dc(){if(is===null){const t=new Ht().readCookie("X-Mobile-Auth"),e=new Ht().readCookie("X-Mobile-Guest-Auth"),n=window.sessionStorage.getItem("isMobileApp"),i=window.location.search.indexOf("src=mobileApp")>=0;t!==null||e!==null||n==="true"||i?(window.sessionStorage.setItem("isMobileApp","true"),is=!0):is=!1}return is}function pt(){if(rs===null){const t=window.sessionStorage.getItem("isEmbeddedWidget"),e=window.location.search.indexOf("src=widget")>=0;t==="true"||e?(window.sessionStorage.setItem("isEmbeddedWidget","true"),rs=!0):rs=!1}return rs}function uc(){if(os===null&&pt()){let t=window.sessionStorage.getItem("widgetLocation"),e=null;if(window.location.href.includes("src=widget")){const r=new URL(window.location.href).pathname.split("/").pop()||null;e=new URL(window.location.href).searchParams.get("widget_loc_id")||r,t!==e&&(t=null)}t?os=t:e&&(window.sessionStorage.setItem("widgetLocation",e),os=e)}return os}function ka(){if(ls===null&&pt()){let t=window.sessionStorage.getItem("widgetUrl");const e=window.location.href;e.includes("src=widget")&&t!==e&&(t=null),t?ls=t:e&&(window.sessionStorage.setItem("widgetUrl",e),ls=e)}return ls}function Os(){return Be()?JSON.parse(window.localStorage.getItem("recaccount")):{}}function Ni(){return Ea()?JSON.parse(window.localStorage.getItem("recaccount")):{}}function Ti(){return Ms()?JSON.parse(window.localStorage.getItem("csraccount")):{}}function hc(){return Be()?Os().account:{}}function pc(){const t=window.localStorage.getItem("internalaccount"),e=t?JSON.parse(t):null;return e?.user?e?.user?.user_id??"":""}function _e(){return Be()?`Bearer ${Os().access_token}`:Ea()?`Bearer ${Ni().access_token}`:""}function ji(){const t=window.localStorage.getItem("internalaccount"),e=t?JSON.parse(t):null;return e?`Bearer ${e.access_token}`:""}function xs(){return Ms()?`Bearer ${Ti().access_token}`:""}const mc=1,Ri="ALERTS_FETCHED",fc="FETCHING_ALERTS_FAILED",Ii="LOGIN_SUCCESS",Ei="LOGIN_FAILED",ki="LOCKOUT",_i="LOGIN_RESET_STATE",Ai="LOGIN_BAD_MAGIC",Mi="CSR_LOGIN_SUCCESS",gc="CSR_CLEAR_SELECTED",bc="RECAPTCHA_SUCCESS",vc="RECAPTCHA_ERROR",Oi="LOGOUT_SUCCESS",Pi="MFA_REQUIRED",Li="ACCOUNT_SERVICE_STATUS_UPDATED",$i="SHOW_LOGIN_MODAL",Di="HIDE_LOGIN_MODAL",Fi="SHOW_SIGN_IN_GUEST_MODAL",Bi="HIDE_SIGN_IN_GUEST_MODAL",xc="SHOW_CREATE_ACCOUNT_MODAL",yc="HIDE_CREATE_ACCOUNT_MODAL",wc="SHOW_RESET_MODAL",Cc="HIDE_RESET_MODAL",Sc="SHOW_CART_LIMIT_EXCEEDED_MODAL",Vi="HIDE_CART_LIMIT_EXCEEDED_MODAL",Hi="SHOW_MFA_SETUP_MODAL",Nc="HIDE_MFA_SETUP_MODAL",_a="SHOW_MFA_CODE_MODAL",Ui="HIDE_MFA_CODE_MODAL",Tc="SHOW_CONFIRM_MODAL",jc="HIDE_CONFIRM_MODAL",Aa="GET_CART",qi="GET_CART_HEADER",Rc="ADD_ITEM",Ma="CART_ERROR",Ic="EXTEND_EXPIRATION_ERROR",ua="EXTEND_CART_TIMER",Ec="REMOVE_RESERVATION_ERROR",kc="GET_SEARCH_SUGGESTIONS",_c="GET_SEARCH_SUGGESTIONS_ERROR",Ac="UPDATE_SEARCH_CRITERIA",Gi="UPDATE_SEARCH_CRITERIAS",Wi="ADD_SEARCH_FILTER",Mc="SET_SEARCH_FILTER",Oc="REMOVE_SEARCH_FILTER",zi="RESET_SEARCH_FILTERS",Pc="RESET_SEARCH_FILTERS_CAMPSITES",Lc="HIGHLIGHT_SEARCH_RESULT_ITEM",$c="UPDATE_CHECKIN_DATE",Dc="UPDATE_CHECKOUT_DATE",Fc="REPLACE_SEARCH_STATE",Bc="SHOW_SEARCH_INPUT",Vc="HIDE_SEARCH_INPUT",Ki="INVENTORY_FETCH_ASSET_START",Yi="INVENTORY_FETCH_ASSET_SUCCESS",Zi="INVENTORY_FETCH_ASSET_FAILURE";function Hc(){return t=>le.get("/api/cart/shoppingcart/header",{headers:{Authorization:_e()}}).then(e=>{t({type:qi,payload:e.data})}).catch(()=>{t({type:Ma,payload:"Error fetching cart",error:!0})})}function Ji(t){return t?Hc():e=>le.get("/api/cart/shoppingcart",{headers:{Authorization:_e()}}).then(n=>{e({type:Aa,payload:n.data})}).catch(()=>{e({type:Ma,payload:"Error fetching cart",error:!0})})}function Uc(){return t=>{t({type:ua,payload:!0}),le.patch("/api/cart/shoppingcart/expiration",{},{headers:{Authorization:_e()}}).then(e=>{t({type:Aa,payload:e.data})}).catch(()=>{t({type:Ic,payload:"Error extending expiration"})}).finally(()=>{t({type:ua,payload:!1})})}}function qc(){return{type:Vi}}const Ae=le.create();function un(t){window.sessionStorage.setItem("temporary-token",t)}function Gc(){return window.sessionStorage.getItem("temporary-token")}function Wc(){window.sessionStorage.removeItem("temporary-token")}const zc={async login(t){const e="/api/accounts/login/v2/",r=await(await ri.load({monitoring:!1})).get();t.fingerprint=r.visitorId,pt()&&(t.session_type="widget");const l=(await Ae.post(e,t)).data;return l?.mfa_login&&l?.access_token&&un(l.access_token),l},async magicLogin(t){const e=`/api/accounts/login/magic/${t}`,{data:n}=await Ae.get(e);return n},async resetPassword(t){const e=`/api/accounts/passwordreset/${t?.token}`,i=(await Ae.post(e,t)).data;return i?.mfa_login&&i?.access_token&&un(i.access_token),i},async completeRegistration(t){const e=`/api/accounts/registration/${t?.token}`;return(await Ae.post(e,t)).data},async status(){const t="/api/accounts/status",{data:e}=await Ae.get(t);return e}},Kc={async login(){const t="/api/accounts/guest/login",{data:e}=await Ae.post(t,{});return e}},Yc={async csrSession(t){const e="/api/accounts/internal/csr_session",{data:n}=await Ae.post(e,{token:t},{headers:{Authorization:`Bearer ${t}`}});return n},async csrAccount(t){const e=`/api/accounts/internal/csr_session/${t}`,{data:n}=await Ae.get(e,{headers:{Authorization:xs()}});return n}},Zc={async login(t){const e="/api/accounts/login/v2/mfa",r=await(await ri.load({monitoring:!1})).get();t.fingerprint=r.visitorId,pt()&&(t.session_type="widget");const o=Gc(),l=o?{Authorization:`Bearer ${o}`}:void 0,d=(await Ae.post(e,t,{headers:l})).data;return Wc(),d},async prompt(t=!1){await Ae.patch("/api/accounts/account/mfa/prompt",null,{headers:{Authorization:_e()},params:{show:t}})},async validateToken(t){const e="/api/accounts/account/mfa/validate",{data:n}=await Ae.post(e,{id:t?.id,token:t?.token});return n?.success}},Ve={...zc,guest:Kc,internal:Yc,mfa:Zc};function Xt(t){return Ro(t)&&t.response?.data?.error?String(t.response.data.error):t instanceof Error?t.message:"Unknown error"}const Jc=t=>{if(!(!t||typeof t!="string")&&!(t.includes("//")||t.includes(".")||t.toLowerCase().includes("http")||t.toLowerCase().includes("java")||t.toLowerCase().includes("\\n")||t.toLowerCase().includes("\\t")))return t},Xi=()=>{const t=new URL(window.location.href),n=new URLSearchParams(t.search).get("redirect");return Jc(n)},Qi=(t="/")=>{const e=new URL(window.location.href),n=new URLSearchParams(e.search);n.delete("redirect");const i=`${e.pathname}${n.size?`?${n.toString()}`:""}`;window.history.replaceState({},"",i),window.location.pathname=t},gt=t=>({type:Ii,profile:t}),bt=t=>({type:Ei,payload:t}),Xc=()=>({type:_i}),Oa=()=>({type:ki}),Qc=()=>({type:Ai}),ed=()=>({type:Oi}),td=()=>({type:Pi}),sd=t=>({type:Mi,profile:t}),ad=()=>t=>{t({type:Hi})},Pa=()=>t=>{t({type:_a})},hn=(t,e,n)=>({type:Li,enabled:t,announcement:e,loginNotice:n}),nd=t=>async e=>{try{window.localStorage.setItem("recaccount",JSON.stringify(t)),window.dataLayer&&window.dataLayer.push({event:"sign_up",user_id:t.account.account_id});const{redirectUrl:n}=t.account;e(gt(t)),n&&window.location.replace(window.encodeURIComponent(n))}catch{e(bt("error parsing profile data"))}},id=t=>e=>new Promise((n,i)=>{const r=t;Ve.mfa.login(r).then(o=>{window.localStorage.setItem("recaccount",JSON.stringify(o)),window.dataLayer&&window.dataLayer.push({event:"log_in",user_id:o.account.account_id,current_url:window.location.href}),e(gt(o)),n(o)}).catch(o=>{const l=Xt(o);l==="lockout"?(e(Oa()),i(o)):(e(bt(l)),i(o))})}),rd=t=>async(e,n)=>{const i=n().launchdarkly.ldClient;await i.waitUntilReady(),await i.identify({key:t.account.account_id}),await i.variation("useMFA",!1)&&e(ad())},od=()=>t=>{t(Pa())},ld=(t=async e=>{window.localStorage.setItem("recaccount",JSON.stringify(e))})=>e=>async(n,i)=>{try{const r=e,o=i().launchdarkly.ldClient;await o.waitUntilReady();const l=o.allFlags()["login-v2"],c=await Ve.login(r,l);if(c?.mfa_login){n(Pa());return}await t(c),window.dataLayer&&window.dataLayer.push({event:"log_in",user_id:c.account.account_id,current_url:window.location.href}),n(gt(c)),c?.prompt_mfa&&n(rd(c)),r?.redirectUrl&&Qi(r.redirectUrl)}catch(r){const o=Xt(r);n(o==="mfa"?td():o==="lockout"?Oa():bt(o))}},La=ld(),er=t=>e=>new Promise((n,i)=>{Ve.resetPassword(t).then(r=>{r?.mfa_login?(n(r),e(Pa())):(n(r),e(La({...t,username:r.account.email})))}).catch(r=>{i(r)})}),cd=t=>e=>new Promise((n,i)=>{Ve.completeRegistration(t).then(r=>{n(r),e(La({...t,username:r.account.email}))}).catch(r=>{i(r)})}),dd=t=>async e=>{try{const n=await Ve.magicLogin(t);localStorage.setItem("recaccount",JSON.stringify(n)),window.dataLayer&&window.dataLayer.push({userId:n.account.account_id}),e(gt(n))}catch(n){const i=Xt(n);e(i==="badmagic"?Qc():bt())}},ud=t=>e=>new Promise((n,i)=>{Ve.mfa.validateToken(t).then(r=>{r&&(e(dd(t?.id)),n(r))}).catch(r=>{const o=Xt(r);o==="lockout"?(e(Oa()),i(r)):(e(bt(o)),i(r))})}),hd=()=>async t=>{try{const e=await Ve.guest.login();window.localStorage.setItem("recaccount",JSON.stringify(e)),window.dataLayer&&window.dataLayer.push({userId:e.account.account_id}),t(gt(e))}catch{t(bt())}},pd=t=>e=>{e(sd(t))},md=t=>async e=>{try{const n=await Ve.internal.csrAccount(t);localStorage.setItem("recaccount",JSON.stringify(n)),window.dataLayer&&window.dataLayer.push({userId:n.account.account_id}),e(gt(n)),e(Ji())}catch{e(bt())}},fs=t=>e=>{e(gt(t))},tr=()=>t=>{window.localStorage.clear(),window.sessionStorage.clear(),t(ed()),window.location.assign(ka()??"/")},fd=()=>t=>{t({type:Di})},gd=()=>t=>{t({type:$i})},bd=()=>t=>{t({type:Fi})},vd=()=>({type:Ui}),xd=()=>t=>{t({type:Bi})},yd=()=>async t=>{try{const e=await Ve.status(),n=e.enabled,i=e.announcement,r=e.login_notice;t(hn(n,i,r))}catch{t(hn(!0,{banner_enabled:!1},{notice_enabled:!1}))}};function Cb(t,e){let n=e;n=new Error;const i=n?.stack;console.log(t),console.log(`${i}`)}function pn(t){return t===null||t.length===0}function $a(t,e={}){let n="";Object.keys(e).forEach(r=>{let o="";if(n!==""&&(o="&"),e[r]||e[r]===0||e[r]===!1){const l=e[r];(!pn(l)||l===0||l===!1)&&(Array.isArray(l)?l.forEach(c=>{n!==""&&(o="&"),n=`${n}${o}${r}=${encodeURIComponent(c)}`}):n=`${n}${o}${r}=${encodeURIComponent(l)}`)}});let i=t;return pn(n)||(i=`${i}?${n}`),i}function be(){return typeof window<"u"}function wd(){return be()?"ontouchend"in document||"ontouchstart"in window||navigator.maxTouchPoints&&navigator.maxTouchPoints>0||window.matchMedia&&window.matchMedia("(any-pointer:coarse)").matches:!1}function Cd(){return be()?/Macintosh|Mac|Mac OS|MacIntel|MacPPC|Mac68K/gi.test(navigator.userAgent):!1}function Sd(){return be()?Cd()&&wd()?!0:/iPad|iPhone|iPod/.test(window.navigator.userAgent)&&!window.MSStream:!1}function sr(){return be()?/android/i.test(navigator.userAgent):!1}function Nd(){return sr()||Sd()}const Td=[{key:"camping",value:"Camping/Lodging",filters:[{attribute:"campsite_type_of_use",filterValue:"Overnight,na"},{attribute:"entity_type",filterValue:"campground"}]},{key:"dayuse",value:"Day Use",filters:[{attribute:"campsite_type_of_use",filterValue:"Day"},{attribute:"entity_type",filterValue:"campground"}]},{key:"tours",value:"Tours",filters:[{attribute:"entity_type",filterValue:"ticketfacility,timedentry"},{attribute:"campsite_type_of_use",filterValue:"na"}]},{key:"tickettours",value:"Tickets",filters:[{attribute:"entity_type",filterValue:"ticketfacility,timedentry,tour,timedentry_tour"},{attribute:"campsite_type_of_use",filterValue:"na"}]},{key:"permits",value:"Permits",filters:[{attribute:"entity_type",filterValue:"permit,vehiclepermit"},{attribute:"campsite_type_of_use",filterValue:"na"}]},{key:"pass",value:"Pass",filters:[{attribute:"entity_type",filterValue:"pass,activitypass"},{attribute:"campsite_type_of_use",filterValue:"na"}]},{key:"activitypass",value:"Activity Pass",filters:[{attribute:"entity_type",filterValue:"activitypass"},{attribute:"campsite_type_of_use",filterValue:"na"}]},{key:"treepermit",value:"Tree Permits",filters:[{attribute:"entity_type",filterValue:"treepermit"},{attribute:"campsite_type_of_use",filterValue:"na"}]},{key:"venuereservations",value:"Venues",filters:[{attribute:"entity_type",filterValue:"venuereservations,venuereservations_venue"},{attribute:"campsite_type_of_use",filterValue:"na"}]},{key:"program",value:"Programs",filters:[{attribute:"entity_type",filterValue:"program,program_session"},{attribute:"campsite_type_of_use",filterValue:"na"}]},{key:"giftcard",value:"Gift Cards",filters:[{attribute:"entity_type",filterValue:"giftcard"},{attribute:"campsite_type_of_use",filterValue:"na"}]},{key:"poi",value:"Points of Interest",filters:[{attribute:"reservable",filterValue:"0"},{attribute:"campsite_type_of_use",filterValue:"na"}]},{key:"recarea",value:"Rec Area",filters:[{attribute:"entity_type",filterValue:"recarea"},{attribute:"campsite_type_of_use",filterValue:"na"}]}];function Ct(t){return e=>{const n={...t};return n.type=Gi,e(n)}}function ar(t,e){return{type:Wi,uiFilterName:t,uiFilterOption:e}}function jd(){return{type:zi}}function Rd(t,e){const n={q:e.search.what,entity_id:e.search.entity_id,entity_type:e.search.entity_type,lat:e.search.lat,lng:e.search.lng,lat_sw:e.search.lat_sw,lng_sw:e.search.lng_sw,lat_ne:e.search.lat_ne,lng_ne:e.search.lng_ne,radius:e.search.radius,checkin:e.search.checkin_time,checkout:e.search.checkout_time,avail_nights:e.search.avail_nights,avail_months:e.search.avail_months,inventory_type:e.search.inventory_type,parent_asset_id:e.search.parent_asset_id,sort:e.search.sort};return $a(t,n)}function Id(){return(t,e)=>{const n=e(),i=Rd("/search",n);window.location.assign(i)}}function Ed(t){return e=>{t&&t.forEach(i=>{const r=Na(Td,{key:i});r&&e(ar("inventoryTypes",r))})}}function Ge(t,e){try{if(window.dataLayer){let n=!1;const i={...t};i.event="eventTracking";let r=null;i.eventCallback=()=>{if(!n){if(n=!0,e)e();else throw Error(`searchCallback not passed, is ${typeof e}`);r&&clearTimeout(r)}},i.eventTimeout=1e3,r=setTimeout(()=>{n||(n=!0,e())},1500),window.dataLayer.push(i)}else e()}catch(n){console.error(n),e()}}function ha(t,e,n,i,r,o=!1,l=null,c=null){return d=>{d(jd()),d(Ed(e));let u,f,g,h,p,b,x,y;n&&!n.entity_type&&n.lat&&n.lng&&(u=n.lat,f=n.lng,g=200,h=n.text,n.lat_sw&&n.lat_ne&&n.lng_sw&&n.lng_ne&&(u=null,f=null,p=n.lat_sw,b=n.lng_sw,x=n.lat_ne,y=n.lng_ne));const v={what:t,headerTextQuery:t,entity_id:n!=null?n.entity_id:null,entity_type:n!=null?n.entity_type:null,inventory_type:e,parent_asset_id:i,highlighted_item:-1,exact:!1,lat:u,lng:f,radius:g,map_center_lat:u,map_center_lng:f,start:null,cursor_mark:null,location:h,placename:null,lat_sw:p,lng_sw:b,lat_ne:x,lng_ne:y};r&&Object.keys(r).forEach(w=>{Object.keys(r[w]).forEach(C=>{d(ar(w,r[w][C]))})}),o&&(v.lng_sw=-167.2815442995964,v.lat_sw=3.6722362889127,v.lng_ne=-51.637969429829155,v.lat_ne=60.77726184625004,v.sort="distance"),l&&(v.lat_sw=l?.lat_sw,v.lng_sw=l?.lng_sw,v.lat_ne=l?.lat_ne,v.lng_ne=l?.lng_ne),c&&(v.sort=c),d(Ct(v)),d(Id())}}const Se={history:[],lastFetched:0,isFetching:!1};async function kd(){let t=1;const e=async(n=750)=>new Promise(i=>{setTimeout(()=>{i()},n)});for(;Se.isFetching&&t<5;)await e(100*t),t+=1;return Promise.resolve()}async function _d(t){const e=Date.now()-Se.lastFetched<2e3;let n=[];if(Se.isFetching)return await kd(),t?.(),Promise.resolve(Se.history);if(Se.isFetching=!0,e)return t?.(),Se.isFetching=!1,Promise.resolve(Se.history);try{be()&&(n=JSON.parse(window.localStorage.getItem("search_history")||"[]"),n&&n.length>0&&(n=n.filter(i=>i.text.length>0).sort((i,r)=>i.last_used>r.last_used?-1:1).slice(0,5),Se.history=[...n],Se.lastFetched=Date.now()))}catch{n=[],window.localStorage.setItem("search_history",JSON.stringify([]))}if(Be()){const i=await le.get("/api/search/history",{headers:{Authorization:_e()}});if(i.data.items){let r=Object.assign([],i.data.items);r=r.map(c=>{const d=c;return d.synced=!0,d});let o=[];o=o.concat(n),o=o.concat(r),o=o.sort((c,d)=>c.last_used>d.last_used?-1:1).slice(0,5);const l=o.filter(c=>!c.synced);if(l&&l.length>0){try{await le.post("/api/search/history",{items:l},{headers:{Authorization:_e()}})}catch(c){console.log("could not save local history",c)}window.localStorage.setItem("search_history",JSON.stringify(r))}return Se.history=[...i.data.items],Se.lastFetched=Date.now(),Se.isFetching=!1,t?.(),i.data.items}}return t?.(),Se.isFetching=!1,Promise.resolve(n)}async function mn({searchHistory:t,rawSearchText:e,suggestion:n}){let i=t;i||(i=Se.history);const r=typeof e=="string"?e.trim():"";let o={};if(n){const l=i.filter(c=>c.entity_id===n.entity_id&&c.entity_type===n.entity_type&&c.name===n.name&&c.text===n.text);!l||l.length===0?(o={...n,last_used:new Date().toISOString()},i.push(o)):(l[0].last_used=new Date().toISOString(),o=l[0])}else if(r.length>0){const l=i.filter(c=>c.text===r);!l||l.length===0?(o.text=r,o.last_used=new Date().toISOString(),i.push(o)):(l[0].last_used=new Date().toISOString(),o=l[0])}else return Promise.resolve();if(Be())try{await le.post("/api/search/history",{items:[o]},{headers:{Authorization:_e()}}),o.synced=!0}catch(l){console.log("could not save local history",l)}return window.localStorage.setItem("search_history",JSON.stringify(i)),Promise.resolve()}async function Ad(){return window.localStorage.setItem("search_history",JSON.stringify([])),Be()&&await le.delete("/api/search/history",{headers:{Authorization:_e()}}),new Promise(t=>{t()})}async function Md(t){const e={fq:[`asset_id:${t}`]};return le.get($a("/api/search",e))}async function Od(t){const e={fq:[`park_pass_facility_id_s:${t}`]};return le.get($a("/api/search",e))}function ys(t){const e=t.reduce((i,r)=>i+r.quantity*r.price,0);return parseFloat(String(e))}const Da=({currency:t="USD",product_name:e,extended_product_price:n,items:i,isAdding:r,real_path:o})=>({event:r?"add_to_cart":"remove_from_cart",real_path:o,product_name:e,extended_product_price:n,ecommerce:{currency:t,items:i,value:ys(i)}}),Pd=["begin_checkout","view_cart","add_payment_info","purchase"],Ld=({currency:t="USD",step_number:e,items:n,id:i="",checkoutPaymentInfo:r})=>{const o=Pd[e-1];return o==="purchase"?{event:o,ecommerce:{transaction_id:i,currency:t,items:n,value:ys(n),payment_type:r?.paymentType,saved_card_on_purchase:r?.savedCardOnPurchase}}:{event:o,ecommerce:{currency:t,items:n,value:ys(n)}}},$d=({currency:t="USD",list_name:e,impressions:n})=>({event:"view_item_list",ecommerce:{item_list_name:e,currency:t,items:n}}),pa=({currency:t="USD",product_name:e,product_price:n,product_list_name:i,items:r})=>({event:"view_item_from_sarsa",product_name:e,product_price:n,product_list_name:i,ecommerce:{currency:t,value:ys(r),items:r}});function Fa({eventCallback:t=()=>{},promotion_name:e,promotions:n}){return{event:"select_promotion",ecommerce:{promotion_name:e,items:n},eventCallback:t}}Fa.propTypes={eventCallback:a.func,promotion_name:a.string.isRequired,promotions:a.arrayOf(a.shape({name:a.string.isRequired,position:a.string.isRequired,creative:a.string,id:a.string})).isRequired};const nr=({promotion_name:t,promotions:e})=>({event:"view_promotion",ecommerce:{promotion_name:t,items:e}}),Dd={skus:"dimension15"},Fd=({currency:t="USD",id:e,affiliation:n,revenue:i,tax:r,shipping:o,coupon:l,items:c,skus:d,paymentType:u,savedCardOnPurchase:f,isUpdate:g=!1})=>({event:g?"order_updated":"transactionComplete",ecommerce:{currency:t,items:c,transaction_id:e,affiliation:n,revenue:i,tax:r,shipping:o,coupon:l,[Dd.skus]:d?.length?d?.sort().join("|"):"",payment_type:u,saved_card_on_purchase:f}}),Bd=({name:t,id:e,list:n,brand:i,category:r,variant:o,position:l,price:c})=>({name:t,id:e,list:n,brand:i,category:r,variant:o,position:l,price:c}),Ps=({index:t,item_brand:e,item_id:n,item_name:i,agency_name:r,state_code:o,rec_area_id:l,rec_area_name:c,facility_id:d,facility_name:u,inventory_id:f,inventory_name:g,item_category:h,quantity:p,price:b,type_of_use:x})=>({index:t,item_brand:e,item_id:n,item_name:i,agency_name:r,state_code:o,rec_area_id:l,rec_area_name:c,facility_id:d,facility_name:u,inventory_id:f,inventory_name:g,item_category:h,quantity:p,price:b,type_of_use:x});Ps.displayName="gaProductObject";const ir=({name:t,id:e,creative:n,position:i})=>({name:t,id:e,creative:n,position:i});function rr({currency:t="USD",product_name:e,product_list_name:n,items:i}){return{event:"select_item",product_name:e,ecommerce:{currency:t,item_list_name:n,items:i}}}rr.propTypes={currency:a.string,product_name:a.string.isRequired,product_list_name:a.string,items:a.arrayOf(Ps).isRequired};function or({currency:t="USD",id:e,isPartial:n=!1}){return{event:n?"order_partial_refund":"order_refunded",ecommerce:{currency:t,transaction_id:e}}}or.propTypes={id:a.string.isRequired,isPartial:a.bool.isRequired};const Vd=1e3;let gs=[];const Hd=["view_item","view_item_list"],Ud=Es(()=>{try{if(!gs.length)return;const t={view_item:null,view_item_list:{}};gs.forEach(e=>{e?.event==="view_item"?t[e.event]?t[e.event]?.ecommerce?.detail?.products?.push(...e.ecommerce.detail.products):t[e.event]=e:e?.event==="view_item_list"&&(t[e.event]?.[e.list_name]?t[e.event]?.[e.list_name]?.ecommerce?.impressions?.push(...e.ecommerce.impressions):t[e.event][e.list_name]=e)}),window.dataLayer.push({ecommerce:null}),t?.view_item&&window.dataLayer.push(t.view_item),Ee(t?.view_item_list)||Object.values(t?.view_item_list).forEach(e=>{window.dataLayer.push(e)})}catch{console.error("Unable to process data layer pushing in debounced manner")}gs=[]},Vd);function Ze({event:t,shouldEnqueueWork:e=!1}){try{window.dataLayer&&(e&&Hd.includes(t?.event)?(gs.push(t),Promise.resolve().then(()=>Ud())):((t?.ecommerce||["view_item","view_item_list","add_to_cart","remove_from_cart","begin_checkout","purchase","refund","promotion_click","promotion_view","view_promotion"].includes(t?.event))&&window.dataLayer.push({ecommerce:null}),window.dataLayer.push(t)))}catch(n){console.error(n)}}const qd=a.oneOf([rr,pa,Da,Ld,Fd,or,nr,Fa]);Ze.displayName="gaReportEvent";Ze.propTypes={event:qd.isRequired};const Pe={sm:576,md:768,lg:992,xl:1240,xxl:1640},Gd=[{label:"United States",value:"USA"},{label:"Canada",value:"CAN"},{label:"Mexico",value:"MEX"}],Wd=[{label:"United States",value:"USA"},{label:"Canada",value:"CAN"},{label:"Afghanistan",value:"AFG"},{label:"Albania",value:"ALB"},{label:"Algeria",value:"DZA"},{label:"American Samoa",value:"ASM"},{label:"Andorra",value:"AND"},{label:"Angola",value:"AGO"},{label:"Anguilla",value:"AIA"},{label:"Antarctica",value:"ATA"},{label:"Antigua And Barbuda",value:"ATG"},{label:"Argentina",value:"ARG"},{label:"Armenia",value:"ARM"},{label:"Aruba",value:"ABW"},{label:"Australia",value:"AUS"},{label:"Austria",value:"AUT"},{label:"Azerbaijan",value:"AZE"},{label:"Bahamas",value:"BHS"},{label:"Bahrain",value:"BHR"},{label:"Bangladesh",value:"BGD"},{label:"Barbados",value:"BRB"},{label:"Belarus",value:"BLR"},{label:"Belgium",value:"BEL"},{label:"Belize",value:"BLZ"},{label:"Benin",value:"BEN"},{label:"Bermuda",value:"BMU"},{label:"Bhutan",value:"BTN"},{label:"Bolivia",value:"BOL"},{label:"Bosnia And Herzegowina",value:"BIH"},{label:"Botswana",value:"BWA"},{label:"Bouvet Island",value:"BVT"},{label:"Brazil",value:"BRA"},{label:"British Indian Ocean Territory",value:"IOT"},{label:"Brunei Darussalam",value:"BRN"},{label:"Bulgaria",value:"BGR"},{label:"Burkina Faso",value:"BFA"},{label:"Burundi",value:"BDI"},{label:"Cambodia",value:"KHM"},{label:"Cameroon",value:"CMR"},{label:"Cape Verde",value:"CPV"},{label:"Cayman Islands",value:"CYM"},{label:"Central African Republic",value:"CAF"},{label:"Chad",value:"TCD"},{label:"Chile",value:"CHL"},{label:"China",value:"CHN"},{label:"Christmas Island",value:"CXR"},{label:"Cocos (Keeling) Islands",value:"CCK"},{label:"Colombia",value:"COL"},{label:"Comoros",value:"COM"},{label:"Congo",value:"COG"},{label:"Congo, The Democratic Republic",value:"COD"},{label:"Cook Islands",value:"COK"},{label:"Costa Rica",value:"CRI"},{label:"Cote D'ivoire",value:"CIV"},{label:"Croatia (Local Name: Hrvatska)",value:"HRV"},{label:"Cuba",value:"CUB"},{label:"Cyprus",value:"CYP"},{label:"Czech Republic",value:"CZE"},{label:"Denmark",value:"DNK"},{label:"Djibouti",value:"DJI"},{label:"Dominica",value:"DMA"},{label:"Dominican Republic",value:"DOM"},{label:"East Timor",value:"TMP"},{label:"Ecuador",value:"ECU"},{label:"Egypt",value:"EGY"},{label:"El Salvador",value:"SLV"},{label:"England",value:"ENG"},{label:"Equatorial Guinea",value:"GNQ"},{label:"Eritrea",value:"ERI"},{label:"Estonia",value:"EST"},{label:"Ethiopia",value:"ETH"},{label:"Falkland Islands (Malvinas)",value:"FLK"},{label:"Faroe Islands",value:"FRO"},{label:"Fiji",value:"FJI"},{label:"Finland",value:"FIN"},{label:"France",value:"FRA"},{label:"France, Metropolitan",value:"FXX"},{label:"French Guiana",value:"GUF"},{label:"French Polynesia",value:"PYF"},{label:"French Southern Territories",value:"ATF"},{label:"Gabon",value:"GAB"},{label:"Gambia",value:"GMB"},{label:"Georgia",value:"GEO"},{label:"Germany",value:"DEU"},{label:"Ghana",value:"GHA"},{label:"Gibraltar",value:"GIB"},{label:"Greece",value:"GRC"},{label:"Greenland",value:"GRL"},{label:"Grenada",value:"GRD"},{label:"Guadeloupe",value:"GLP"},{label:"Guam",value:"GUM"},{label:"Guatemala",value:"GTM"},{label:"Guinea",value:"GIN"},{label:"Guinea-Bissau",value:"GNB"},{label:"Guyana",value:"GUY"},{label:"Haiti",value:"HTI"},{label:"Heard And Mc Donald Islands",value:"HMD"},{label:"Honduras",value:"HND"},{label:"Hong Kong",value:"HKG"},{label:"Hungary",value:"HUN"},{label:"Iceland",value:"ISL"},{label:"India",value:"IND"},{label:"Indonesia",value:"IDN"},{label:"Iran (Islamic Republic Of)",value:"IRN"},{label:"Iraq",value:"IRQ"},{label:"Ireland",value:"IRL"},{label:"Israel",value:"ISR"},{label:"Italy",value:"ITA"},{label:"Jamaica",value:"JAM"},{label:"Japan",value:"JPN"},{label:"Jordan",value:"JOR"},{label:"Kazakhstan",value:"KAZ"},{label:"Kenya",value:"KEN"},{label:"Kiribati",value:"KIR"},{label:"Korea, Democratic People's Rep",value:"PRK"},{label:"Korea, Republic Of",value:"KOR"},{label:"Kuwait",value:"KWT"},{label:"Kyrgyzstan",value:"KGZ"},{label:"Lao People's Democratic Republ",value:"LAO"},{label:"Latvia",value:"LVA"},{label:"Lebanon",value:"LBN"},{label:"Lesotho",value:"LSO"},{label:"Liberia",value:"LBR"},{label:"Libyan Arab Jamahiriya",value:"LBY"},{label:"Liechtenstein",value:"LIE"},{label:"Lithuania",value:"LTU"},{label:"Luxembourg",value:"LUX"},{label:"Macau",value:"MAC"},{label:"Macedonia, The Former Yugoslav",value:"MKD"},{label:"Madagascar",value:"MDG"},{label:"Malawi",value:"MWI"},{label:"Malaysia",value:"MYS"},{label:"Maldives",value:"MDV"},{label:"Mali",value:"MLI"},{label:"Malta",value:"MLT"},{label:"Marshall Islands",value:"MHL"},{label:"Martinique",value:"MTQ"},{label:"Mauritania",value:"MRT"},{label:"Mauritius",value:"MUS"},{label:"Mayotte",value:"MYT"},{label:"Mexico",value:"MEX"},{label:"Micronesia, Federated States Of",value:"FSM"},{label:"Moldova, Republic Of",value:"MDA"},{label:"Monaco",value:"MCO"},{label:"Mongolia",value:"MNG"},{label:"Montenegro",value:"MNE"},{label:"Montserrat",value:"MSR"},{label:"Morocco",value:"MAR"},{label:"Mozambique",value:"MOZ"},{label:"Myanmar",value:"MMR"},{label:"Namibia",value:"NAM"},{label:"Nauru",value:"NRU"},{label:"Nepal",value:"NPL"},{label:"Netherlands",value:"NLD"},{label:"Netherlands Antilles",value:"ANT"},{label:"New Caledonia",value:"NCL"},{label:"New Zealand",value:"NZL"},{label:"Nicaragua",value:"NIC"},{label:"Niger",value:"NER"},{label:"Nigeria",value:"NGA"},{label:"Niue",value:"NIU"},{label:"Norfolk Island",value:"NFK"},{label:"Northern Mariana Islands",value:"MNP"},{label:"Norway",value:"NOR"},{label:"Oman",value:"OMN"},{label:"Pakistan",value:"PAK"},{label:"Palau",value:"PLW"},{label:"Panama",value:"PAN"},{label:"Papua New Guinea",value:"PNG"},{label:"Paraguay",value:"PRY"},{label:"Peru",value:"PER"},{label:"Philippines",value:"PHL"},{label:"Pitcairn",value:"PCN"},{label:"Poland",value:"POL"},{label:"Portugal",value:"PRT"},{label:"Puerto Rico",value:"PRI"},{label:"Qatar",value:"QAT"},{label:"Reunion",value:"REU"},{label:"Romania",value:"ROM"},{label:"Russian Federation",value:"RUS"},{label:"Rwanda",value:"RWA"},{label:"Saint Kitts And Nevis",value:"KNA"},{label:"Saint Lucia",value:"LCA"},{label:"Saint Vincent And The Grenadin",value:"VCT"},{label:"Samoa",value:"WSM"},{label:"San Marino",value:"SMR"},{label:"Sao Tome And Principe",value:"STP"},{label:"Saudi Arabia",value:"SAU"},{label:"Scotland",value:"SCO"},{label:"Senegal",value:"SEN"},{label:"Serbia",value:"SRB"},{label:"Seychelles",value:"SYC"},{label:"Sierra Leone",value:"SLE"},{label:"Singapore",value:"SGP"},{label:"Slovakia (Slovak Republic)",value:"SVK"},{label:"Slovenia",value:"SVN"},{label:"Solomon Islands",value:"SLB"},{label:"Somalia",value:"SOM"},{label:"South Africa",value:"ZAF"},{label:"South Georgia And The South Sa",value:"SGS"},{label:"Spain",value:"ESP"},{label:"Sri Lanka",value:"LKA"},{label:"St. Helena",value:"SHN"},{label:"St. Pierre And Miquelon",value:"SPM"},{label:"Sudan",value:"SDN"},{label:"Suriname",value:"SUR"},{label:"Svalbard And Jan Mayen Islands",value:"SJM"},{label:"Swaziland",value:"SWZ"},{label:"Sweden",value:"SWE"},{label:"Switzerland",value:"CHE"},{label:"Syrian Arab Republic",value:"SYR"},{label:"Taiwan",value:"TWN"},{label:"Tajikistan",value:"TJK"},{label:"Tanzania, United Republic Of",value:"TZA"},{label:"Thailand",value:"THA"},{label:"Togo",value:"TGO"},{label:"Tokelau",value:"TKL"},{label:"Tonga",value:"TON"},{label:"Trinidad And Tobago",value:"TTO"},{label:"Tunisia",value:"TUN"},{label:"Turkey",value:"TUR"},{label:"Turkmenistan",value:"TKM"},{label:"Turks And Caicos Islands",value:"TCA"},{label:"Tuvalu",value:"TUV"},{label:"Uganda",value:"UGA"},{label:"Ukraine",value:"UKR"},{label:"United Arab Emirates",value:"ARE"},{label:"United Kingdom",value:"GBR"},{label:"United States Minor Outlying",value:"UMI"},{label:"Uruguay",value:"URY"},{label:"Uzbekistan",value:"UZB"},{label:"Vanuatu",value:"VUT"},{label:"Vatican City State (Holy See)",value:"VAT"},{label:"Venezuela",value:"VEN"},{label:"Viet Nam",value:"VNM"},{label:"Virgin Islands (British)",value:"VGB"},{label:"Virgin Islands (U.S.)",value:"VIR"},{label:"Wallis And Futuna Islands",value:"WLF"},{label:"Western Sahara",value:"ESH"},{label:"Yemen",value:"YEM"},{label:"Yugoslavia",value:"YUG"},{label:"Zaire",value:"ZAR"},{label:"Zambia",value:"ZMB"},{label:"Zimbabwe",value:"ZWE"}],zd=[{label:"Alabama",value:"AL"},{label:"Alaska",value:"AK"},{label:"Arizona",value:"AZ"},{label:"Arkansas",value:"AR"},{label:"California",value:"CA"},{label:"Colorado",value:"CO"},{label:"Connecticut",value:"CT"},{label:"Delaware",value:"DE"},{label:"District Of Columbia",value:"DC"},{label:"Florida",value:"FL"},{label:"Georgia",value:"GA"},{label:"Hawaii",value:"HI"},{label:"Idaho",value:"ID"},{label:"Illinois",value:"IL"},{label:"Indiana",value:"IN"},{label:"Iowa",value:"IA"},{label:"Kansas",value:"KS"},{label:"Kentucky",value:"KY"},{label:"Louisiana",value:"LA"},{label:"Maine",value:"ME"},{label:"Maryland",value:"MD"},{label:"Massachusetts",value:"MA"},{label:"Michigan",value:"MI"},{label:"Minnesota",value:"MN"},{label:"Mississippi",value:"MS"},{label:"Missouri",value:"MO"},{label:"Montana",value:"MT"},{label:"Nebraska",value:"NE"},{label:"Nevada",value:"NV"},{label:"New Hampshire",value:"NH"},{label:"New Jersey",value:"NJ"},{label:"New Mexico",value:"NM"},{label:"New York",value:"NY"},{label:"North Carolina",value:"NC"},{label:"North Dakota",value:"ND"},{label:"Ohio",value:"OH"},{label:"Oklahoma",value:"OK"},{label:"Oregon",value:"OR"},{label:"Pennsylvania",value:"PA"},{label:"Rhode Island",value:"RI"},{label:"South Carolina",value:"SC"},{label:"South Dakota",value:"SD"},{label:"Tennessee",value:"TN"},{label:"Texas",value:"TX"},{label:"Utah",value:"UT"},{label:"Vermont",value:"VT"},{label:"Virginia",value:"VA"},{label:"Washington",value:"WA"},{label:"West Virginia",value:"WV"},{label:"Wisconsin",value:"WI"},{label:"Wyoming",value:"WY"}],Kd=[{label:"American Samoa",value:"AS"},{label:"Federated States Of Micronesia",value:"FM"},{label:"Guam",value:"GU"},{label:"Marshall Islands",value:"MH"},{label:"Northern Mariana Islands",value:"MP"},{label:"Palau",value:"PW"},{label:"Puerto Rico",value:"PR"},{label:"U.S. Minor Outlying Islands",value:"UM"},{label:"U.S. Virgin Islands",value:"VI"}],Yd=[{label:"Armed Forced Other",value:"AE"},{label:"Armed Forces Americas",value:"AA"},{label:"Armed Forces Pacific",value:"AP"}];function xt(t){const[e,n]=m.useState(()=>be()?window.matchMedia(t).matches:!1);return m.useEffect(()=>{const i=window.matchMedia(t);function r(o){n(o.matches)}return i.addEventListener("change",r),()=>{i.removeEventListener("change",r)}},[t]),e}function Qt(){const t=xt(`only screen and (max-width: ${Pe.sm-1}px`),e=xt(`only screen and (min-width: ${Pe.sm}px) and (max-width: ${Pe.md-1}px`),n=xt(`only screen and (min-width: ${Pe.md}px) and (max-width: ${Pe.lg-1}px`),i=xt(`only screen and (min-width: ${Pe.lg}px) and (max-width: ${Pe.xl-1}px`),r=xt(`only screen and (min-width: ${Pe.xl}px) and (max-width: ${Pe.xxl-1}px`),o=xt(`only screen and (min-width: ${Pe.xxl}px)`);return{isXs:t,isSm:e,isMd:n,isLg:i,isXl:r,isXxl:o,isXsAndUp:!0,isSmAndUp:e||n||i||r||o,isMdAndUp:n||i||r||o,isLgAndUp:i||r||o,isXlAndUp:r||o,isXxlAndUp:o,isXsAndDown:t,isSmAndDown:e||t,isMdAndDown:n||e||t,isLgAndDown:i||n||e||t,isXlAndDown:r||i||n||e||t,isXxlAndDown:!0}}function Zd(t){return!!(t&&{}.toString.call(t)=="[object Function]")}function Jd(t,e){if(t!=null)if(Zd(t))t(e);else try{t.current=e}catch{throw new Error(`Cannot assign value "${e}" to ref "${t}"`)}}function Ls(...t){return m.useCallback(e=>{for(const n of t)Jd(n,e)},t)}const Xd=()=>({type:Ki}),Qd=t=>({type:Yi,payload:t}),eu=t=>({type:Zi,error:t}),tu=t=>async e=>{if(t){e(Xd());try{const n=`/api/external/inventory/asset/${t}`,i=await le.get(n);e(Qd(i?.data))}catch(n){e(eu(n))}}},su=t=>({type:Ri,alerts:t}),au=t=>async e=>{if(!(!t?.location_id||!t?.location_type||t?.location_id==="orders"&&t?.location_type==="Permit"))try{const i=`/api/communication/external/alert${`?location_id=${t.location_id}&location_type=${t.location_type}`}`,o=(await le.get(i)).data.alerts;e(su(o))}catch{}};function nu(t){if(t.pathname){const e=t.pathname.split("/");if(e[1]==="article"||e[1]==="articles")return null;if(e.length>2){if(e[1]==="ticket"&&e.length>4)return{location_id:e[2],location_type:"Ticket Facility",isGateway:!1,isSitePass:!1};if(e[1]==="ticket"&&e.length>3)return{location_id:e[3],location_type:"Ticket Facility",isGateway:!1,isSitePass:!1};if(e[1]==="camping"&&e.length>3)return{location_id:e[3],location_type:"Campground",isGateway:!1,isSitePass:!1};if(e[1]==="gateways"&&e[2])return{location_id:e[2],location_type:"Rec Area",isGateway:!0,isSitePass:!1};if(e[1]==="timed-entry"&&e.length>2)return{location_id:e[2],location_type:"Timed Entry",isGateway:!1,isSitePass:!1};if(e[1]==="tree-permits"&&e.length>2)return{location_id:e[2],location_type:"Tree Permit",isGateway:!1,isSitePass:!1};if(e[1]==="activitypass"&&e.length>2)return{location_id:e[2],location_type:"Activity Pass",isGateway:!1,isSitePass:!1};if(e[1]==="sitepass"&&e.length>2)return{location_id:e[2],location_type:"Rec Area",isGateway:!1,isSitePass:!0};if(e[1]==="vehiclepermits"&&e.length>2)return{location_id:e[2],location_type:"Vehicle Permit",isGateway:!1,isSitePass:!1};if(e[1]==="venues"&&e.length>2)return{location_id:e[2],location_type:"Venue Reservations",isGateway:!1,isSitePass:!1};if(e[1]==="permits"&&e.length>2)return{location_id:e[2],location_type:"Permit",isGateway:!1,isSitePass:!1}}}return null}const iu=t=>t?.asset;function ru(){const t=Te(u=>u?.alertsNotification?.alerts)||[],e=Te(iu),n=Fe(),i=Yt(),r=nu(i),o=!r?.isGateway||e?.loaded;if(m.useEffect(()=>{r?.isGateway&&n(tu(r?.location_id))},[r?.location_id,r?.isGateway,n]),r?.isGateway&&e?.loaded&&(r.location_id=e?.data?.internal_location_id),m.useEffect(()=>{o&&r?.location_id&&r?.location_type&&n(au({location_id:r.location_id,location_type:r.location_type}))},[r?.location_id,r?.location_type,o,n]),!r?.location_id)return[];const l=r.isGateway||r.isSitePass,c=t.filter(({canceled_at:u,location_display_rules:{display_at_gateway:f,display_at_pass:g,display_at_this_location_only:h}})=>{const p=l&&h,b=(!r.isGateway||f)&&(!r.isSitePass||g);return!u&&(!p||b)});return ti(c,["created_at"],["desc"])}const nt=t=>{const e=m.useId();return t??e};function Sb({root:t=null,rootMargin:e,threshold:n=0}={}){const[i,r]=m.useState({}),[o,l]=m.useState(null),c=([u])=>r(u),d=m.useRef(new IntersectionObserver(c,{root:t,rootMargin:e,threshold:n}));return m.useEffect(()=>{const{current:u}=d;return u.disconnect(),o&&u.observe(o),()=>u.disconnect()},[o]),[l,i]}const Ba=(t,e,n=.9)=>{const[i,r]=m.useState(!1);return m.useEffect(()=>{try{if(t&&e?.current){const o=new IntersectionObserver(([l])=>r(l.isIntersecting),{threshold:n});return o.observe(e.current),()=>{o.disconnect()}}}catch(o){console.error("useIntersectWithRefParameter failure",o)}return()=>{}},[t,e,n]),i};function lr({timeout:t=400}={}){const[e,n]=m.useState(!1);return m.useEffect(()=>{let i=!0;if(!be())return()=>{};const r=()=>{!e&&i&&n(!0)};return window.addEventListener("resize",r),()=>{i=!1,window.removeEventListener("resize",r)}},[e,t]),m.useEffect(()=>{e&&Es(()=>{n(!1)},t,{leading:!1,trailing:!0})()},[e,t]),e}const ou={loading:!1,loaded:!1,error:null},lu=_s({name:"slug",initialState:ou,reducers:{fetchSlugs:t=>{t.loading=!0},fetchSlugsSuccess:(t,e)=>{t.loading=!1,t.loaded=!0,t.data=e.payload},fetchSlugsError:(t,e)=>{t.loading=!1,t.error=e.payload}}}),cu=lu.reducer;function du(t=100){const e=be(),[n,i]=m.useState({width:e?window.innerWidth:void 0,height:e?window.innerHeight:void 0});return m.useEffect(()=>{let r=!0;if(!e)return()=>{};const o=Es(()=>{r&&i({width:window.innerWidth,height:window.innerHeight})},t);return window.addEventListener("resize",o),()=>{r=!1,o.cancel(),window.removeEventListener("resize",o)}},[t,e]),n}function uu({name:t,id:e,creative:n,refForIntersection:i=null,position:r}){const[o,l]=m.useState(!1),{enableGaForPromotionView:c}=kt(),d=Ba(!o,i),u=ir({name:t,id:e,creative:n,position:r});if(c&&!o&&si(u)&&d&&(t||e)){try{Ze({event:nr({promotion_name:t,promotions:[u]})})}catch(f){console.error(f)}l(!0)}return null}const hu={xs:16,sm:24,md:32,lg:48,xl:64};function ke({size:t="xl",isCentered:e=!0,isSpinning:n=!0,isFullscreen:i,onComplete:r,color:o="default",screenReaderText:l="Content is loading"}){const c=m.useRef(null),d=typeof t=="number"?t:hu[t],u=()=>{r&&r()},f=()=>d>=80?4/(d/80):d>=64?4/(d/64):d>=48?4.5/(d/48):d>=32?5.5/(d/32):d>=24?6/(d/24):6.5;return s.jsx("div",{"data-component":"Spinner","data-testid":"spinnerOuterContainer",className:N("sarsa-spinner-outer-container",{"is-centered":e,"is-fullscreen":i}),children:s.jsx(la,{classNames:"sarsa-spinner",appear:!0,in:n,mountOnEnter:!0,unmountOnExit:!0,timeout:{enter:600,exit:300},onExited:u,nodeRef:c,children:s.jsxs("div",{ref:c,"data-testid":"spinnerInnerContainer",className:"sarsa-spinner-inner-container",style:{width:`${d}px`,height:`${d}px`},children:[s.jsx("svg",{className:N("sarsa-spinner-svg",{"color-is-inverted":o==="inverted","color-is-brand":o==="brand","color-is-danger":o==="danger","color-is-subtle":o==="subtle"}),role:"img","aria-hidden":"true",viewBox:"25 25 50 50",children:s.jsx("circle",{strokeWidth:f(),strokeMiterlimit:f()*2,cx:"50",cy:"50",r:"20"})}),s.jsx("span",{className:"rec-sr-only",children:l})]})})})}ke.propTypes={size:a.oneOfType([a.oneOf(["xs","sm","md","lg","xl"]),a.number]),isCentered:a.bool,isSpinning:a.bool,onComplete:a.func,color:a.oneOf(["default","inverted","brand","subtle","danger"]),screenReaderText:a.string};const k=m.forwardRef((t,e)=>{const{children:n,type:i="button",appearance:r="primary",isUnstyled:o,size:l="md",isLoading:c,isDisabled:d,iconBeforeElement:u,iconAfterElement:f,screenReaderTextBefore:g,screenReaderTextAfter:h,shouldFitContainer:p,shouldFocusOnMount:b,onClick:x,className:y,innerRef:v,clickTagCategory:w,clickTagAction:C,clickTagLabel:T,gaReportName:I,gaReportCreative:R,gaReportPosition:S,shouldReportToGA:_,gaTrackingId:M,gaTrackingValue:O,...A}=t,$=m.useRef(null),U=Ls(e,$,v),P=m.useRef(null);m.useEffect(()=>{const z=setTimeout(()=>{b&&$.current?.focus()},0);return()=>{clearTimeout(z)}},[b]);const D=()=>{const{to:z,href:ie}=A;return typeof z=="string"&&z.length||typeof z=="object"&&Object.keys(z).length>0||typeof z=="function"?oi:typeof ie=="string"&&ie.length?"a":"button"},ne=()=>{const{to:z,href:ie}=A;return typeof z=="function"||typeof z=="string"&&z.length||typeof z=="object"&&Object.keys(z).length>0||typeof ie=="string"&&ie.length?null:i},W=z=>{w&&C&&T&&Ge({category:w,action:C,label:T},()=>{}),I&&R&&S&&Ze({event:Fa({promotion_name:I,promotions:[ir({name:I,creative:R,position:S})]})}),!(c||d)&&x&&x(z)},Y=D(),B=Y==="button",H=!!(u&&!f&&!n||!u&&f&&!n),V=H?null:" ",Q=N(`sarsa-button sarsa-button-${r} sarsa-button-${l}`,y,{"sarsa-button-fit-container":p,"sarsa-button-is-loading":c,"sarsa-button-disabled":d});let G;switch(r){case"tertiary":case"link":G="brand";break;case"tertiary-alt":case"subtle":case"pill":G="subtle";break;case"subtle-danger":case"tertiary-danger":G="danger";break;default:G="inverted"}let E;switch(l){case"lg":E=24;break;case"md":E=20;break;case"sm":case"xs":E=16;break;case"xxs":E=12;break;default:E=20}const L=s.jsxs(Y,{"data-component":"Button",ref:U,type:ne(),disabled:B?d:void 0,className:Q,onClick:W,"data-ga-tracking-id":M,"data-ga-tracking-value":O,...A,children:[c&&s.jsx("span",{className:"sarsa-button-spinner-wrapper",children:s.jsx(ke,{isSpinning:c,size:E,color:G})}),s.jsxs("span",{className:N("sarsa-button-inner-wrapper",{"is-loading":c}),children:[u&&s.jsx("span",{"aria-hidden":"true",className:N("sarsa-button-icon-content","left-icon",{"is-only-child":H}),children:u}),s.jsxs("span",{className:"sarsa-button-content",children:[g&&s.jsxs("span",{className:"rec-sr-only",children:[g,V]}),n,h&&s.jsxs("span",{className:"rec-sr-only",children:[V,h]})]}),f&&s.jsx("span",{"aria-hidden":"true",className:N("sarsa-button-icon-content","right-icon",{"is-only-child":H}),children:f})]})]}),Z=s.jsx(Y,{"data-component":"Button",className:y,ref:U,type:ne(),disabled:d,onClick:W,"data-ga-tracking-id":M,"data-ga-tracking-value":O,...A,children:s.jsxs(s.Fragment,{children:[g&&s.jsxs("span",{className:"rec-sr-only",children:[g,V]}),n,h&&s.jsxs("span",{className:"rec-sr-only",children:[V,h]})]})});return s.jsxs(s.Fragment,{children:[_&&I?s.jsx("div",{ref:P,children:s.jsx(uu,{name:I,creative:R,position:S,refForIntersection:P})}):null,o?Z:L]})});function jt({children:t,isFullWidthOnMobile:e=!0,align:n="left",isStretchedToFit:i,isStacked:r,isToggleStyle:o,buttonMargin:l=2,className:c,...d}){const u=N("sarsa-button-group",{"is-full-width-on-mobile":e,"align-right":n==="right","align-center":n==="center","is-stretched-to-fit":i,"is-stacked":r,"ml-1-buttons":l===1,"ml-3-buttons":l===3,"ml-4-buttons":l===4,"toggle-style-buttons":o,[`${c}`]:c});return s.jsx("div",{className:u,"data-component":"ButtonGroup",...d,children:t})}function Ut({children:t}){return s.jsx("div",{"data-component":"ModalActions",className:"sarsa-modal-actions",children:t})}function ae({appearance:t="h3",headingLevel:e=2,hasUnderline:n,underlineColor:i,headingAlign:r,children:o,className:l,...c}){const d=`h${e}`,u=N(l,{display:t==="display",h1:t==="h1",h2:t==="h2","sarsa-heading-title":t==="title",h3:t==="h3",h4:t==="h4","h5-normal":t==="h5",h5:t==="h5Caps",h6:t==="h6","sarsa-heading-small":t==="small","sarsa-heading-align-left":r==="left","sarsa-heading-align-center":r==="center","sarsa-heading-align-right":r==="right","sarsa-has-underline-left":n==="left","sarsa-has-underline-center":n==="center","sarsa-underline-color-brand-02":i==="brand-02","sarsa-underline-color-brand-03":i==="brand-03","sarsa-underline-color-secondary-02":i==="secondary-02"});return s.jsx(d,{"data-component":"Heading",className:u,...c,children:o})}ae.propTypes={appearance:a.oneOf(["display","title","h1","h2","h3","h4","h5","h5Caps","h6","small"]),headingLevel:a.oneOf([1,2,3,4,5,6]).isRequired,headingAlign:a.oneOf(["left","center","right"]),hasUnderline:a.oneOf(["left","center"]),underlineColor:a.oneOf(["brand-02","brand-03","secondary-02"]),children:a.node.isRequired,className:a.string};function j({iconName:t,size:e,className:n,width:i=24,height:r=24,"aria-label":o,...l}){return s.jsx("svg",{"data-component":"Icon",className:N("sarsa-icon",`rec-icon-${t}`,n,e),role:o?"img":"presentation","aria-label":o||void 0,focusable:"false",height:r,width:i,...l,children:s.jsx("use",{href:`/shared/graphics/icons.svg#rec-icon-${t}`,className:t})})}function es({isOpen:t=!1,heading:e,children:n,onRequestClose:i=()=>{},size:r="md",shouldCloseOnOverlayClick:o=!0,shouldShowCloseButton:l=!0,shouldCloseOnEsc:c=!0,shouldActionsStickInMobile:d=!1,overlayClassName:u,clickTagCategoryForCloseButton:f,clickTagActionForCloseButton:g,clickTagLabelForCloseButton:h,gaTrackingId:p,translateHeading:b="no",...x}){const y=()=>{const w=document.getElementById("recApp");w&&(w.style.height="",w.style.minHeight="",w.style.maxHeight="",w.style.overflow="")};m.useEffect(()=>{document.getElementById("recApp")&&Ye.setAppElement("#recApp")},[]),m.useEffect(()=>{const w=document.getElementById("recApp");return t&&w&&Nd()?(w.style.height="100vh",w.style.minHeight="100vh",w.style.maxHeight="100vh",w.style.overflow="hidden"):y(),()=>{y()}},[t]);const v=w=>{w?.preventDefault&&w.preventDefault(),i&&i()};return s.jsx(Ye,{isOpen:t,onRequestClose:i,shouldCloseOnOverlayClick:o,shouldCloseOnEsc:o===!1?!1:c,aria:{labelledby:"modal-heading"},overlayClassName:{base:N("sarsa-modal-overlay",u),afterOpen:"sarsa-modal-overlay-after-open",beforeClose:"sarsa-modal-overlay-before-close"},className:{base:"sarsa-modal",afterOpen:"sarsa-modal-after-open",beforeClose:"sarsa-modal-before-close"},...x,children:s.jsx("div",{className:"sarsa-modal-content-cell",children:s.jsx("div",{className:"sarsa-modal-content-cell-sizer",children:s.jsx("div",{className:N("sarsa-modal-content-sizer",{"sarsa-modal-size-sm":r==="sm","sarsa-modal-size-md":r==="md","sarsa-modal-size-lg":r==="lg","sarsa-modal-size-xl":r==="xl","sarsa-modal-size-xxl":r==="xxl","sarsa-modal-size-full":r==="full"}),children:s.jsx("div",{className:"sarsa-modal-content",children:s.jsxs("div",{className:N("sarsa-modal-content-body",{full:r==="full","sticky-actions":d}),children:[l&&s.jsx(k,{className:"sarsa-modal-close-button",appearance:"subtle",size:r==="full"?"lg":"md","aria-label":"Close modal",iconBeforeElement:s.jsx(j,{iconName:"close"}),onClick:v,clickTagCategory:f,clickTagAction:g,clickTagLabel:h,"data-ga-tracking-id":p}),e&&s.jsx(ae,{id:"modal-heading",headingLevel:1,appearance:"h4",className:"sarsa-modal-heading",translate:b,children:e}),n]})})})})})})}function pu(){const t=Fe(),e=Te(i=>i.modal.showCartLimitExceededModal),n=()=>{t(qc())};return s.jsxs(es,{heading:"Your Cart is Full",isOpen:e,onRequestClose:n,children:["You already have 10 items in your cart, which is the maximum number allowed. To add the new item, please remove another one from your cart, or just continue to checkout with the original 10 items.",s.jsx(Ut,{children:s.jsx(jt,{children:s.jsx(k,{type:"button",onClick:n,children:"Close"})})})]})}function qt(t){if(typeof t=="string")return t.trim();if(wo(t)){const e=[];return t.forEach(n=>{if(typeof n=="object")e.push(qt(n));else if(typeof n=="string"){const i=n.trim();i&&e.push(i)}}),e.join(" ")}if(m.isValidElement(t)){if(typeof t.props.children=="object")return qt(t.props.children);if(typeof t.props.children=="string")return t.props.children.trim()}return""}function oe(t,e="polite",n){const i=typeof t=="string"?t:qt(t);if(!i)return;const r=n?3e3+i.length*300:2e3+i.length*150;let o=null;n&&(o=document.getElementById(n),window.sarsaAnnounceTimeout&&clearTimeout(window.sarsaAnnounceTimeout)),o||(o=document.createElement("div"),o.setAttribute("aria-live",e),n&&o.setAttribute("id",n),o.style.cssText=` position: absolute !important; clip: rect(1px, 1px, 1px, 1px); clipPath: inset(50%); padding: 0; border: 0; height: 1px; width: 1px; overflow: hidden; whiteSpace: nowrap; `,document.body.appendChild(o)),o.innerText=i,window.sarsaAnnounceTimeout=setTimeout(()=>{o&&o.parentNode&&o.parentNode.removeChild(o)},r)}const mu=["a","an","the","and","but","de","la","or","for","nor","as","at","by","for","from","in","into","near","of","on","onto","to","with"],ma=mu.map(t=>new RegExp(`\\s${t}\\s`,"ig"));ma.push(new RegExp("\\'S","ig"));const fu=["USS","AK","AL","AR","AZ","CA","CO","CT","DC","\\(DE\\)","FL","GA","HI","IA","ID","IL","\\(IN\\)","KS","KY","\\(LA\\)","MA","MD","ME","MI","MN","MO","MS","MT","NC","ND","NE","NH","NJ","NM","NV","NY","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VA","VT","WA","WI","WV","WY","NWR","ORV","OSV","PCT","NP","NRC","MWR","NAS"],fn=fu.map(t=>t.indexOf("(")>=0?new RegExp(`(^|\\s)${t}(\\s|$)`,"ig"):new RegExp(`(^|\\s|\\()${t}(\\s|\\)|$)`,"ig")),gu=t=>t&&/^(M{1,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})|M{0,4}(CM|C?D|D?C{1,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})|M{0,4}(CM|CD|D?C{0,3})(XC|X?L|L?X{1,3})(IX|IV|V?I{0,3})|M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|I?V|V?I{1,3}))$/.test(t),bu=t=>t===t.toUpperCase()?t.toLowerCase():t;function ws(t){if(!t)return"";let e=t.replace(/[A-Za-zÀ-ÖØ-öø-ĿŁŃ-ƶ0-9_]*/g,n=>gu(n)?n.toUpperCase():n.charAt(0).toUpperCase()+bu(n.slice(1)));for(let n=0;ni.toLowerCase());for(let n=0;ni.toUpperCase());return e}function vu(t){const e="ÀÁÂÃÄÅĀàáâãäåāÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž",n="AAAAAAAaaaaaaaOOOOOOOooooooEEEEeeeeeCcDIIIIiiiiUUUUuuuuNnSsYyyZz",i=t.split("");return i.forEach((r,o)=>{const l=e.indexOf(r);l!==-1&&(i[o]=n[l])}),i.join("")}function gn(t){return typeof t!="string"?(console.error("Invalid type passed to sluggifyString. Must be a string. Received:",t),""):vu(t).toLowerCase().replace(/\s+/g,"-").replace(/--+/g,"-").replace(/[^\w-]+/g,"").replace(/^-+/,"").replace(/-+$/,"")}function bn(t){return typeof t=="string"?gn(t):Array.isArray(t)?t.map(e=>gn(e)).join("-"):(console.error("Invalid type passed to sluggify. Must be a string or an array of strings. Received: ",t),"")}const ze=(t,e,n)=>typeof t=="number"?t===1?e:n:Array.isArray(t)&&t.length===1?e:n,xu={extendTimer:a.func.isRequired,fetchCart:a.func.isRequired,expiration:a.string,expiresIn:a.number,onFinalCartWarningModal:a.func.isRequired,sessionWarning:a.bool,domainsTrustedOrigins:a.array,isExtendingTime:a.bool},yu={expiration:"",expiresIn:0,sessionWarning:!1,domainsTrustedOrigins:["http://localhost:9900","https://www.r1s-dev.com","https://www.r1s-test.com","https://www.recreation.gov","https://cdn.r1s-dev.com","https://cdn.r1s-test.com","https://cdn.recreation.gov","https://www.nps.gov","https://www.blm.gov","https://www.fs.usda.gov"]},fa="CONTINUE_SHOPPING_EVENT",wu={[fa]:{type:fa,description:"continue shopping event"}};class Cu extends m.Component{constructor(e){super(e),this.handlePlanYourTrip=()=>{this.notifyEvent(fa);let i="/";pt()&&(i=ka()??"/"),window.location.assign(i)},this.tick=()=>{if(!this.state.fetchingCart){if(this.timeRemainingRef.current=-1*ms(new Date,this.props.expiration),this.timeRemainingRef.current>0){this.openTimeRemainingModalIfNeeded();return}if(this.props.expiresIn<=0||this.timeRemainingRef.current<=0){this.showExpiredModal();return}if(this.state.lastFetchTime&&ms(new Date,this.state.lastFetchTime)/1e3{this.timeRemainingRef.current<=3e5&&!this.state.ignored&&!this.props.sessionWarning&&!this.props.isExtendingTime&&this.setState({modalOpen:!0})},this.fetchCartHandling=()=>{this.setState({fetchingCart:!0},async()=>{await this.props.fetchCart(!0),this.isStillMounted?this.setState({fetchingCart:!1,lastFetchTime:new Date}):this.props.onFinalCartWarningModal()})},this.formatTime=i=>i<=0?"00":i<10?`0${i}`:i.toString(),this.closeModal=()=>{this.setState({modalOpen:!1,ignored:!0}),window.sessionStorage.setItem("r1s_cart_ignored","true"),this.props.fetchCart()},this.extendTimer=async()=>{this.state.fetchingCart||(oe("You have extended your cart timer by five minutes."),await this.props.extendTimer(),await this.fetchCartHandling(),this.setState({modalOpen:!1,ignored:!1}),window.sessionStorage.removeItem("r1s_cart_ignored"))},this.notifyEvent=i=>{const r=i?wu[i]:null;if(!window.parent||!r)return;const o=window.location!==window.parent.location?document?.referrer:document?.location?.href,c=(this.props.domainsTrustedOrigins??[]).find(d=>o.includes(d));c&&window.parent.postMessage(r,c)},this.showExpiredModal=()=>{clearInterval(this.state.timer),this.setState({modalOpen:!0,expired:!0}),window.sessionStorage.removeItem("r1s_cart_ignored")},this.renderTime=()=>{const i=li({start:new Date,end:this.props.expiration}),r=this.formatTime(i.minutes||0),o=this.formatTime(i.seconds||0),l=s.jsx("span",{className:"rec-sr-only",children:ze(Number(r),"minute","minutes")}),c=s.jsx("span",{className:"rec-sr-only",children:ze(Number(o),"second","seconds")});return s.jsxs(s.Fragment,{children:[r,l,s.jsx("span",{"aria-hidden":"true",children:":"}),o,c]})},this.renderContent=()=>this.state.expired?s.jsxs("div",{children:[s.jsx("div",{className:"rec-modal-content-wrap",children:s.jsx("div",{children:s.jsx("p",{children:"The time ran out on your cart, and items have been removed. The good news is that we're still here, so let's retrace your steps or take a look for new adventures."})})}),s.jsx(Ut,{children:s.jsx(jt,{isFullWidthOnMobile:!1,isStretchedToFit:!0,children:s.jsx(k,{title:"Plan Your Trip","aria-label":"Plan Your Trip",onClick:this.handlePlanYourTrip,gaTrackingId:"016540857659",children:"Plan Your Trip"})})})]}):s.jsxs("div",{children:[s.jsxs("div",{className:"rec-modal-content-wrap",children:[s.jsxs("p",{children:["This is a friendly reminder that your cart will time out in"," ",s.jsx("b",{children:this.renderTime()}),". Once time is up, all items will be removed from your cart."]}),s.jsx("p",{children:"We can provide more time to finish this reservation, though! Would five more minutes be helpful?"})]}),s.jsx(Ut,{children:s.jsxs(jt,{isFullWidthOnMobile:!1,isStretchedToFit:!0,children:[s.jsx(k,{title:"Add Five Minutes","aria-label":"Add Five Minutes",onClick:this.extendTimer,gaTrackingId:"303011773358",children:"Add Five Minutes"}),s.jsx(k,{appearance:"tertiary",title:"Ignore","aria-label":"Ignore",onClick:this.closeModal,gaTrackingId:"920807948123",children:"Ignore"})]})})]});const n=window.sessionStorage.getItem("r1s_cart_ignored")==="true";this.state={timer:void 0,modalOpen:!1,expired:!1,fetchingCart:!1,lastFetchTime:void 0,ignored:n},this.timeRemainingRef={current:0}}static{this.propTypes=xu}static{this.defaultProps=yu}componentDidMount(){this.isStillMounted=!0;const e=setInterval(()=>this.tick(),1e3);this.setState({timer:e}),this.timeRemainingRef.current=-1*ms(new Date,this.props.expiration)}componentWillUnmount(){this.isStillMounted=!1,clearInterval(this.state.timer)}render(){return s.jsx(es,{isOpen:this.state.modalOpen,heading:this.state.expired?"Your cart has expired.":"Your cart is about to expire.",shouldShowCloseButton:!1,children:this.renderContent()})}}const cr=/^\/(sitepass|cart|account\/session|timed-entry|ticket|activitypass)/,At=a.shape({access_token:a.string,expiration:a.string,account:a.shape({account_id:a.string,cell_phone:a.string,email:a.string,emergency_content:a.shape({first_name:a.string,last_name:a.string}),favorites:a.array,first_name:a.string,home_address:a.shape({address1:a.string,address2:a.string,city:a.string,country:a.string,state:a.string}),home_phone:a.string,is_commercial_account:a.bool,last_name:a.string,legacy_account:a.bool,newsletter_alerts:a.bool,passes:a.array,phone_alerts:a.bool,profile_picture_id:a.string,sms_alerts:a.bool,trip_preferences:a.array})}),Va=a.shape({access_token:a.string,expiration:a.string,name:a.string});a.shape({account_id:a.string,discount:a.string,err_message:a.string,expiration:a.string,expiresIn:a.number,hasError:a.bool,reservations:a.array,showSessionWarning:a.bool,showTimer:a.bool,subtotal:a.string,tax:a.string,total:a.string});const dr=a.shape({expiration:a.string,expiresIn:a.number,showTimer:a.bool,reservation_count:a.number}),ur=a.shape({notice_body:a.string,notice_enabled:a.bool,notice_title:a.string});a.shape({banner_background_color:a.string,banner_body:a.string,banner_body_color:a.string,banner_enable_hiding:a.bool,banner_enabled:a.bool,banner_homepage_only:a.bool,banner_image:a.string,banner_key:a.string,banner_link:a.string,banner_link_button_title:a.string,banner_title:a.string,banner_photo_credit:a.string});a.shape({banner_background_color:null,banner_body:"",banner_body_color:"",banner_enable_hiding:!0,banner_enabled:!1,banner_homepage_only:!1,banner_image:"",banner_key:"default_banner_key",banner_link:"",banner_link_button_title:"",banner_title:"",banner_photo_credit:""});const Su="Email was successfully sent",Nu="Resend limit has reached, you need to wait 30 minutes to send it again. If you do not receive your password reset code email, please check your spam folder",vn="An error occurred. Try again later.",Tu="You need to strike a match! These passwords either don't match or don't meet our criteria. Passwords must have 8 characters including a capital letter, lower case letter, special character, and number. Please try again.",ju="Confirmation code cannot be empty",Ru="We do not recognize the code you have entered. Please double check the code and enter it again.",Iu="You need to strike a match! These passwords either don't match or don't meet our criteria. Passwords must have 8 characters including a capital letter, lower case letter, special character, and number. Please try again.";function Eu({isGuestAllowed:t=!1,toggleSignInModalOpen:e,toggleSignInGuestModalOpen:n}){const i=cr.test(window.location.pathname)&&t;return s.jsx("div",{className:"nav-user-sign-in",children:s.jsx(k,{id:"ga-global-nav-log-in-link",appearance:"link",className:"nav-link","aria-label":"Sign Up or Log In",onClick:i?n:e,children:"Sign Up / Log In"})})}function hr({date:t,onComplete:e}){const[n,i]=m.useState(),r=m.useRef(),o=m.useRef(),l=()=>{const f=-1*ms(new Date,t),g=li({start:new Date,end:t});i(g),f<=0&&(e&&e(),window.clearInterval(r.current))};o.current=l;const c=()=>{const f=n?.hours||0,g=n?.minutes||0,h=n?.seconds||0,p=f>0?`${f} ${ze(f,"hour","hours")}`:"",b=g>0?`${g} ${ze(g,"minute","minutes")}`:"",x=h>0?`${h} ${ze(h,"second","seconds")}`:"";return`Cart - ${p} ${b} ${x} remaining to complete transactions`};m.useEffect(()=>{l(),r.current=window.setInterval(()=>{o.current&&o.current()},1e3);const f=`You have ${c()}`;return oe(f),()=>{window.clearInterval(r.current)}},[]);const d=f=>f<=0?"00":f<10?`0${f}`:f.toString(),u=()=>{const f=d(n?.hours||0),g=d(n?.minutes||0),h=d(n?.seconds||0);let p=s.jsxs("time",{children:[f,":",g,":",h]});return f==="00"&&(p=s.jsxs("time",{children:[g,":",h]})),p};return s.jsxs("a",{href:"/cart",className:"sarsa-timer-link",children:[s.jsx("span",{className:"rec-sr-only",children:c()}),s.jsxs("span",{className:"rec-timer","aria-hidden":"true",children:[s.jsx(j,{iconName:"hourglass-half"}),u()]})]})}hr.propTypes={date:a.instanceOf(Date).isRequired,onComplete:a.func};function pr({cart:t={showTimer:!1,reservation_count:0}}){const e=t?.reservation_count??0,n=e>0?`Cart - ${e} ${ze(e,"item","items")} in cart.`:"Cart";return s.jsxs(s.Fragment,{children:[s.jsxs(k,{appearance:"link","aria-label":n,href:"/cart",className:"nav-link nav-interactions-link-cart",id:"ga-global-nav-account-cart-link",children:[s.jsx(j,{iconName:"cart",className:N({"has-badge":e>0})}),e>0&&s.jsx("span",{className:"cart-quantity",children:e})]}),t.showTimer&&s.jsx("div",{className:"rec-small-timer",children:t.expiration&&s.jsx(hr,{date:new Date(t.expiration)})})]})}pr.propTypes={cart:dr};const mr=m.memo(pr);function ge(t){switch(t){case"none":return"0";case"gutter":return"3";case"xxs":return"half";case"xs":return"1";case"sm":return"one-and-half";case"md":return"two-and-half";case"lg":return"4";case"xl":return"6";case"xxl":return"8";default:return"0"}}function Le(t){switch(t){case 0:return"";case 1:return"-md";case 2:return"-xl";default:return""}}function ut({tag:t="div",children:e,className:n,padding:i,paddingX:r,paddingY:o,margin:l,marginX:c,marginY:d,background:u,shadow:f,border:g,alignX:h,alignY:p,textAlign:b,innerRef:x,...y}){const v={};return Array.isArray(i)?i.forEach((w,C)=>{v[`p${Le(C)}-${ge(w)}`]=!0}):i&&(v[`p-${ge(i)}`]=!0),Array.isArray(r)?r.forEach((w,C)=>{v[`pl${Le(C)}-${ge(w)}`]=!0,v[`pr${Le(C)}-${ge(w)}`]=!0}):r&&(v[`pl-${ge(r)}`]=!0,v[`pr-${ge(r)}`]=!0),Array.isArray(o)?o.forEach((w,C)=>{v[`pt${Le(C)}-${ge(w)}`]=!0,v[`pb${Le(C)}-${ge(w)}`]=!0}):o&&(v[`pt-${ge(o)}`]=!0,v[`pb-${ge(o)}`]=!0),Array.isArray(l)?l.forEach((w,C)=>{v[`m${Le(C)}-${ge(w)}`]=!0}):l&&(v[`m-${ge(l)}`]=!0),Array.isArray(c)?c.forEach((w,C)=>{v[`ml${Le(C)}-${ge(w)}`]=!0,v[`mr${Le(C)}-${ge(w)}`]=!0}):c&&(v[`ml-${ge(c)}`]=!0,v[`mr-${ge(c)}`]=!0),Array.isArray(d)?d.forEach((w,C)=>{v[`mt${Le(C)}-${ge(w)}`]=!0,v[`mb${Le(C)}-${ge(w)}`]=!0}):d&&(v[`mt-${ge(d)}`]=!0,v[`mb-${ge(d)}`]=!0),u&&(v[u]=!0),g&&(v[`border-${g}`]=!0),f&&(v[`sarsa-shadow-${f}`]=!0),h&&(v["has-display-flex"]=!0,v[`align-x-${h}`]=!0),p&&(v["has-display-flex"]=!0,v[`align-y-${p}`]=!0),b&&(v[`text-align-${b}`]=!0),s.jsx(t,{"data-component":"Box",ref:x,className:N("sarsa-box",v,n),...y,children:e})}function Nb({children:t,className:e,...n}){return s.jsx("div",{"data-component":"ContentBlock",className:N("sarsa-content-block",e),...n,children:t})}function $s({color:t="gray",className:e,...n}){return s.jsx("div",{"data-component":"Divider",className:N("sarsa-divider",t,e),...n})}$s.propTypes={color:a.oneOf(["gray","blue","yellow","red","green"]),className:a.string};function Gt({children:t,space:e="md",alignY:n="center",alignX:i="left",noWrap:r=!1,shouldRenderInnerContainer:o=!0,className:l,...c}){const d={};return Array.isArray(e)?e.forEach((u,f)=>{d[`bp-${f}-${u}`]=!0,d[`bp-${f}`]=!0}):d[`${e}`]=!0,s.jsx("div",{"data-component":"Inline",className:N("sarsa-inline",{...d,"no-wrap":r,top:n==="top","y-center":n==="center",bottom:n==="bottom",left:i==="left",right:i==="right","x-center":i==="center"},l),...c,children:o?s.jsx("div",{children:t}):t})}function Rt({children:t,space:e="md",hasListRole:n,className:i,...r}){const o={};return Array.isArray(e)?e.forEach((l,c)=>{o[`bp-${c}-${l}`]=!0,o[`bp-${c}`]=!0}):o[`${e}`]=!0,s.jsx("div",{"data-component":"Stack",role:n?"list":void 0,className:N("sarsa-stack",o,i),...r,children:n?m.Children.map(t,l=>m.isValidElement(l)?m.cloneElement(l,{role:"listitem"}):null):t})}function Tb({width:t="lg",className:e,alignX:n="left",textAlign:i="left",children:r,...o}){return s.jsx("div",{"data-component":`TextBlock TextBlock-${t}`,className:N("sarsa-text-block",n,`text-align-${i}`,e,{sm:t==="sm",md:t==="md",lg:t==="lg",xl:t==="xl"}),...o,children:r})}const xn=a.oneOf(["none","gutter","xxs","xs","sm","md","lg","xl","xxl","xxxl"]),ku=a.oneOfType([a.arrayOf(xn),xn]),Ha=K.createContext(),_u=Ha.Provider;Ha.Consumer;class Au extends K.PureComponent{static contextType=Ha;static propTypes={account:At,isGuest:a.bool};static defaultProps={account:{}};constructor(e){super(e),this.state={profilePictureURL:""}}componentDidMount(){this.getProfilePicture()}componentDidUpdate(e){const{account:{account:{profile_picture_id:n}}}=this.props,{account:{account:{profile_picture_id:i}}}=e;n!==i&&this.getProfilePicture()}getProfilePicture=async()=>{const{account:{account:{profile_picture_id:e}}}=this.props;if(e)try{const n=`/api/media/external/${e}`,i={headers:{Authorization:_e()}},r=await le.get(n,i);this.setState({profilePictureURL:r.data.url})}catch{this.setState({profilePictureURL:""})}};render(){let e="";if(this.props.isGuest)e="Guest";else{const r=this.props.account.account.first_name,o=this.props.account.account.last_name[0];e=r,o&&o.length>0&&(e=`${r} ${o}.`)}let n="";(this.props.account.account.is_commercial_account||this.props.isGuest)&&(n="commercial-account-active");let i=s.jsx("div",{className:`rec-account-default-icon ${n}`,children:s.jsx(j,{iconName:"account-circle"})});return this.state.profilePictureURL&&(i=s.jsx("img",{src:this.state.profilePictureURL,alt:`Profile of ${e}`})),s.jsx("div",{className:"rec-select-holder nav-profile-dropdown",children:s.jsxs(k,{appearance:"link",className:"nav-link","aria-label":"My Account",onClick:this.context.clickedMobileMenuButton,children:[s.jsx("span",{className:"rec-select-profile-photo data-hj-suppress",children:i}),s.jsx("span",{className:"rec-select-label data-hj-suppress",children:e})]})})}}class Mu extends K.PureComponent{static propTypes={cart:dr,account:At,logout:a.func,isGuest:a.bool,openLoginModal:a.func};render(){return s.jsx("div",{className:"nav-user-actions",children:s.jsxs(Gt,{space:"sm",children:[s.jsx(mr,{cart:this.props.cart}),s.jsx(Au,{account:this.props.account,isGuest:this.props.isGuest,openLoginModal:this.props.openLoginModal,signOut:this.props.logout})]})})}}const J=m.forwardRef((t,e)=>{const{children:n,className:i,xs:r,sm:o,md:l,lg:c,xl:d,xxl:u,alignSelf:f,order:g,xsOrder:h,smOrder:p,mdOrder:b,lgOrder:x,xlOrder:y,xxlOrder:v,xsOffset:w,smOffset:C,mdOffset:T,lgOffset:I,xlOffset:R,xxlOffset:S,semanticColName:_="div",...M}=t,O=N({"flex-col":r==="auto"||!r&&!o&&!l&&!c&&!d&&!u,"flex-col-sm":o==="auto","flex-col-md":l==="auto","flex-col-lg":c==="auto","flex-col-xl":d==="auto","flex-col-1":r===1,"flex-col-2":r===2,"flex-col-3":r===3,"flex-col-4":r===4,"flex-col-5":r===5,"flex-col-6":r===6,"flex-col-7":r===7,"flex-col-8":r===8,"flex-col-9":r===9,"flex-col-10":r===10,"flex-col-11":r===11,"flex-col-12":r===12,"flex-col-sm-1":o===1,"flex-col-sm-2":o===2,"flex-col-sm-3":o===3,"flex-col-sm-4":o===4,"flex-col-sm-5":o===5,"flex-col-sm-6":o===6,"flex-col-sm-7":o===7,"flex-col-sm-8":o===8,"flex-col-sm-9":o===9,"flex-col-sm-10":o===10,"flex-col-sm-11":o===11,"flex-col-sm-12":o===12,"flex-col-md-1":l===1,"flex-col-md-2":l===2,"flex-col-md-3":l===3,"flex-col-md-4":l===4,"flex-col-md-5":l===5,"flex-col-md-6":l===6,"flex-col-md-7":l===7,"flex-col-md-8":l===8,"flex-col-md-9":l===9,"flex-col-md-10":l===10,"flex-col-md-11":l===11,"flex-col-md-12":l===12,"flex-col-lg-1":c===1,"flex-col-lg-2":c===2,"flex-col-lg-3":c===3,"flex-col-lg-4":c===4,"flex-col-lg-5":c===5,"flex-col-lg-6":c===6,"flex-col-lg-7":c===7,"flex-col-lg-8":c===8,"flex-col-lg-9":c===9,"flex-col-lg-10":c===10,"flex-col-lg-11":c===11,"flex-col-lg-12":c===12,"flex-col-xl-1":d===1,"flex-col-xl-2":d===2,"flex-col-xl-3":d===3,"flex-col-xl-4":d===4,"flex-col-xl-5":d===5,"flex-col-xl-6":d===6,"flex-col-xl-7":d===7,"flex-col-xl-8":d===8,"flex-col-xl-9":d===9,"flex-col-xl-10":d===10,"flex-col-xl-11":d===11,"flex-col-xl-12":d===12,"flex-col-xxl-1":u===1,"flex-col-xxl-2":u===2,"flex-col-xxl-3":u===3,"flex-col-xxl-4":u===4,"flex-col-xxl-5":u===5,"flex-col-xxl-6":u===6,"flex-col-xxl-7":u===7,"flex-col-xxl-8":u===8,"flex-col-xxl-9":u===9,"flex-col-xxl-10":u===10,"flex-col-xxl-11":u===11,"flex-col-xxl-12":u===12,"align-self-start":f==="start","align-self-center":f==="center","align-self-end":f==="end","align-self-baseline":f==="baseline","align-self-stretch":f==="stretch","order-first":g==="first"||h==="first","order-last":g==="last"||h==="last","order-1":g===1||h===1,"order-2":g===2||h===2,"order-3":g===3||h===3,"order-4":g===4||h===4,"order-5":g===5||h===5,"order-6":g===6||h===6,"order-7":g===7||h===7,"order-8":g===8||h===8,"order-9":g===9||h===9,"order-10":g===10||h===10,"order-11":g===11||h===11,"order-12":g===12||h===12,"order-sm-first":p==="first","order-sm-last":p==="last","order-sm-1":p===1,"order-sm-2":p===2,"order-sm-3":p===3,"order-sm-4":p===4,"order-sm-5":p===5,"order-sm-6":p===6,"order-sm-7":p===7,"order-sm-8":p===8,"order-sm-9":p===9,"order-sm-10":p===10,"order-sm-11":p===11,"order-sm-12":p===12,"order-md-first":b==="first","order-md-last":b==="last","order-md-1":b===1,"order-md-2":b===2,"order-md-3":b===3,"order-md-4":b===4,"order-md-5":b===5,"order-md-6":b===6,"order-md-7":b===7,"order-md-8":b===8,"order-md-9":b===9,"order-md-10":b===10,"order-md-11":b===11,"order-md-12":b===12,"order-lg-first":x==="first","order-lg-last":x==="last","order-lg-1":x===1,"order-lg-2":x===2,"order-lg-3":x===3,"order-lg-4":x===4,"order-lg-5":x===5,"order-lg-6":x===6,"order-lg-7":x===7,"order-lg-8":x===8,"order-lg-9":x===9,"order-lg-10":x===10,"order-lg-11":x===11,"order-lg-12":x===12,"order-xl-first":y==="first","order-xl-last":y==="last","order-xl-1":y===1,"order-xl-2":y===2,"order-xl-3":y===3,"order-xl-4":y===4,"order-xl-5":y===5,"order-xl-6":y===6,"order-xl-7":y===7,"order-xl-8":y===8,"order-xl-9":y===9,"order-xl-10":y===10,"order-xl-11":y===11,"order-xl-12":y===12,"order-xxl-first":v==="first","order-xxl-last":v==="last","order-xxl-1":v===1,"order-xxl-2":v===2,"order-xxl-3":v===3,"order-xxl-4":v===4,"order-xxl-5":v===5,"order-xxl-6":v===6,"order-xxl-7":v===7,"order-xxl-8":v===8,"order-xxl-9":v===9,"order-xxl-10":v===10,"order-xxl-11":v===11,"order-xxl-12":v===12,"offset-0":w===0,"offset-1":w===1,"offset-2":w===2,"offset-3":w===3,"offset-4":w===4,"offset-5":w===5,"offset-6":w===6,"offset-7":w===7,"offset-8":w===8,"offset-9":w===9,"offset-10":w===10,"offset-11":w===11,"offset-sm-0":C===0,"offset-sm-1":C===1,"offset-sm-2":C===2,"offset-sm-3":C===3,"offset-sm-4":C===4,"offset-sm-5":C===5,"offset-sm-6":C===6,"offset-sm-7":C===7,"offset-sm-8":C===8,"offset-sm-9":C===9,"offset-sm-10":C===10,"offset-sm-11":C===11,"offset-md-0":T===0,"offset-md-1":T===1,"offset-md-2":T===2,"offset-md-3":T===3,"offset-md-4":T===4,"offset-md-5":T===5,"offset-md-6":T===6,"offset-md-7":T===7,"offset-md-8":T===8,"offset-md-9":T===9,"offset-md-10":T===10,"offset-md-11":T===11,"offset-lg-0":I===0,"offset-lg-1":I===1,"offset-lg-2":I===2,"offset-lg-3":I===3,"offset-lg-4":I===4,"offset-lg-5":I===5,"offset-lg-6":I===6,"offset-lg-7":I===7,"offset-lg-8":I===8,"offset-lg-9":I===9,"offset-lg-10":I===10,"offset-lg-11":I===11,"offset-xl-0":R===0,"offset-xl-1":R===1,"offset-xl-2":R===2,"offset-xl-3":R===3,"offset-xl-4":R===4,"offset-xl-5":R===5,"offset-xl-6":R===6,"offset-xl-7":R===7,"offset-xl-8":R===8,"offset-xl-9":R===9,"offset-xl-10":R===10,"offset-xl-11":R===11,"offset-xxl-0":S===0,"offset-xxl-1":S===1,"offset-xxl-2":S===2,"offset-xxl-3":S===3,"offset-xxl-4":S===4,"offset-xxl-5":S===5,"offset-xxl-6":S===6,"offset-xxl-7":S===7,"offset-xxl-8":S===8,"offset-xxl-9":S===9,"offset-xxl-10":S===10,"offset-xxl-11":S===11,"flex-col-sm-auto":o==="variable","flex-col-md-auto":l==="variable","flex-col-lg-auto":c==="variable","flex-col-xl-auto":d==="variable","flex-col-xxl-auto":u==="variable"}),A=_;return s.jsx(A,{className:N(O,i),"data-component":"FlexCol",ref:e,...M,children:n})});J.propTypes={children:a.any,className:a.string,xs:a.oneOf(["auto","variable",1,2,3,4,5,6,7,8,9,10,11,12]),sm:a.oneOf(["auto","variable",1,2,3,4,5,6,7,8,9,10,11,12]),md:a.oneOf(["auto","variable",1,2,3,4,5,6,7,8,9,10,11,12]),lg:a.oneOf(["auto","variable",1,2,3,4,5,6,7,8,9,10,11,12]),xl:a.oneOf(["auto","variable",1,2,3,4,5,6,7,8,9,10,11,12]),xxl:a.oneOf(["auto","variable",1,2,3,4,5,6,7,8,9,10,11,12]),alignSelf:a.oneOf(["start","center","end","baseline","stretch"]),order:a.oneOf(["first","last",1,2,3,4,5,6,7,8,9,10,11,12]),xsOrder:a.oneOf(["first","last",1,2,3,4,5,6,7,8,9,10,11,12]),smOrder:a.oneOf(["first","last",1,2,3,4,5,6,7,8,9,10,11,12]),mdOrder:a.oneOf(["first","last",1,2,3,4,5,6,7,8,9,10,11,12]),lgOrder:a.oneOf(["first","last",1,2,3,4,5,6,7,8,9,10,11,12]),xlOrder:a.oneOf(["first","last",1,2,3,4,5,6,7,8,9,10,11,12]),xxlOrder:a.oneOf(["first","last",1,2,3,4,5,6,7,8,9,10,11,12]),xsOffset:a.oneOf([0,1,2,3,4,5,6,7,8,9,10,11]),smOffset:a.oneOf([0,1,2,3,4,5,6,7,8,9,10,11]),mdOffset:a.oneOf([0,1,2,3,4,5,6,7,8,9,10,11]),lgOffset:a.oneOf([0,1,2,3,4,5,6,7,8,9,10,11]),xlOffset:a.oneOf([0,1,2,3,4,5,6,7,8,9,10,11]),xxlOffset:a.oneOf([0,1,2,3,4,5,6,7,8,9,10,11]),semanticColName:a.any};const fe=m.forwardRef((t,e)=>{const{children:n,className:i,alignItems:r,justifyContent:o,flexDirection:l="row",hasGutters:c=!0,isOuterContainer:d=!1,isOuterContainerSingleColumn:u=!1,semanticRowName:f="div",...g}=t,h=N("flex-grid",{"align-items-start":r==="start","align-items-center":r==="center","align-items-end":r==="end","align-items-stretch":r==="stretch","align-items-baseline":r==="baseline","justify-content-start":o==="start","justify-content-end":o==="end","justify-content-center":o==="center","justify-content-between":o==="space-between","justify-content-around":o==="space-around","no-gutters":!c,"is-outer-container":d,"is-outer-container-single-column":u,"flex-row-reverse":l==="row-reverse","flex-column":l==="column","flex-column-reverse":l==="column-reverse"}),p=f;return s.jsx(p,{className:N(h,i),"data-component":"FlexRow",ref:e,...g,children:n})});fe.propTypes={children:a.any,className:a.string,alignItems:a.oneOf(["start","center","end","stretch","baseline"]),justifyContent:a.oneOf(["start","center","end","space-around","space-between"]),hasGutters:a.bool,isOuterContainer:a.bool,isOuterContainerSingleColumn:a.bool,flexDirection:a.oneOf(["row","row-reverse","column","column-reverse"]),semanticRowName:a.any};const Ou={label:a.string,message:a.string,email:a.string,closeModal:a.func};class Pu extends K.Component{static propTypes=Ou;componentDidMount(){this.header.focus()}render(){return s.jsx(fe,{justifyContent:"center",children:s.jsxs(J,{sm:8,className:"rec-acct-modal-confirm-password-confirmation-body",children:[s.jsx("div",{ref:e=>{this.header=e},tabIndex:"-1",className:"rec-hide-focus",children:s.jsx(ae,{headingLevel:1,appearance:"display",className:"rec-acct-modal-title",id:"confirmPasswordModalHeading",children:this.props.label})}),s.jsx("div",{className:"rec-acct-modal-media",children:s.jsx(j,{iconName:"check"})}),s.jsx("p",{children:this.props.message}),s.jsx("p",{children:s.jsx("strong",{children:this.props.email})}),s.jsx(k,{size:"lg",onClick:this.props.closeModal,title:"Close","aria-label":"Close",children:"Close"})]})})}}const Lu={warning:"light-yellow",info:"light-blue",error:"light-red",success:"light-green"},$u={warning:"yellow",info:"blue",error:"red",success:"green"},Du={warning:"warning",info:"info",error:"error",success:"check-circle"};function xe({children:t,heading:e,headingLevel:n=2,type:i="warning",shouldFocusOnMount:r=!1,className:o,hasBoxStyling:l=!0,showCloseButton:c=!1,onCloseButtonClick:d,hasAriaLive:u=!1,...f}){const g=m.useRef(null),h=i==="error"?"assertive":"polite";m.useEffect(()=>{let b;return r&&(b=setTimeout(()=>{g.current?.focus()},0)),()=>{clearTimeout(b)}},[r]);const p=Du[i];return s.jsx("div",{"data-component":"Alert",ref:g,tabIndex:r?-1:void 0,className:N("sarsa-alert",i,o),...f,children:s.jsxs(ut,{className:N({"show-close-button":c}),background:l?Lu[i]:void 0,border:l?$u[i]:void 0,padding:l?"sm":void 0,children:[s.jsx(j,{size:"md",iconName:p,className:i,"aria-label":i}),s.jsxs(Rt,{space:"xxs","aria-live":u?h:"off",children:[e&&s.jsx(ae,{headingLevel:n,appearance:"h6",children:e}),s.jsx("div",{className:"alert-body",children:t})]}),c&&s.jsx(k,{className:"sarsa-alert-close-button",size:"xs",appearance:"subtle","aria-label":"Dismiss alert",iconBeforeElement:s.jsx(j,{iconName:"close"}),onClick:d})]})})}xe.propTypes={children:a.node,heading:a.string,headingLevel:a.oneOf([1,2,3,4,5,6]),type:a.oneOf(["info","error","warning","success"]),shouldFocusOnMount:a.bool,hasBoxStyling:a.bool,className:a.string,showCloseButton:a.bool,onCloseButtonClick:a.func,hasAriaLive:a.bool};const yn=t=>{const e={},n=["!",'"',"#","%","&","'","(",")","*",",","-",".","/",":",";","?","@","[","\\","]","_","{","}","¡","§","«","¶","·","»","¿","$","+","<","=",">","^","`","|","~","¢","£","¤","¥","¦","¨","©","¬","®","¯","°","±","´","¸","×","÷"];return e.length=t.length>=8,e.lower=RegExp("[a-z]").test(t),e.upper=RegExp("[A-Z]").test(t),e.number=RegExp("[0-9]").test(t),e.symbol=RegExp(`[${n.join("")}]`).test(t),e.strength=0,(e.lower||e.upper||e.number)&&(e.strength=1),e.lower&&e.upper&&e.number&&e.length&&(e.strength=2,e.symbol&&(e.strength=3,t.length>=12&&(e.strength=4))),e};function Ua({password:t=""}){const[e,n]=m.useState({strength:0,criteria:yn(t)});m.useEffect(()=>{const c=yn(t);n({strength:c.strength,criteria:c})},[t]);const i=c=>N({"rec-criteria-check":!0,"rec-criteria-passed":c,"rec-criteria-failed":!c}),r=c=>c?s.jsx("span",{className:"rec-criteria-icon",children:s.jsx(j,{iconName:"check"})}):c?null:s.jsx("span",{className:"rec-criteria-icon",children:s.jsx(j,{iconName:"close"})}),o=c=>c?s.jsx("p",{children:"Pass"}):c?null:s.jsx("p",{children:"Fail"}),l=s.jsx("div",{className:"rec-criteria",children:s.jsxs(fe,{children:[s.jsx(J,{xs:"variable",children:s.jsxs("div",{className:i(e.criteria.lower),children:[r(e.criteria.lower),s.jsx("span",{className:"rec-sr-only",children:o(e.criteria.lower)}),"One lowercase letter"]})}),s.jsx(J,{xs:"variable",children:s.jsxs("div",{className:i(e.criteria.upper),children:[r(e.criteria.upper),s.jsx("span",{className:"rec-sr-only",children:o(e.criteria.upper)}),"One uppercase letter"]})}),s.jsx(J,{xs:"variable",children:s.jsxs("div",{className:i(e.criteria.number),children:[r(e.criteria.number),s.jsx("span",{className:"rec-sr-only",children:o(e.criteria.number)}),"One number"]})}),s.jsx(J,{xs:"variable",children:s.jsxs("div",{className:i(e.criteria.length),children:[r(e.criteria.length),s.jsx("span",{className:"rec-sr-only",children:o(e.criteria.length)}),"8 characters minimum"]})})]})});switch(e.strength){case 4:return s.jsxs("div",{className:"rec-strength-meter-wrapper",children:[s.jsxs("div",{className:"rec-strength-meter",children:[s.jsx("div",{className:"rec-strength-line bg-green"}),s.jsx("div",{className:"rec-strength-line bg-green"}),s.jsx("div",{className:"rec-strength-line bg-green"}),s.jsx("div",{className:"rec-strength-line bg-green"})]}),s.jsxs("div",{className:"rec-criteria-message",children:[s.jsx("strong",{children:"Password Strength: Strong."})," Now that's a strong password, nice job!"]}),l]});case 3:return s.jsxs("div",{className:"rec-strength-meter-wrapper",children:[s.jsxs("div",{className:"rec-strength-meter",children:[s.jsx("div",{className:"rec-strength-line bg-green"}),s.jsx("div",{className:"rec-strength-line bg-green"}),s.jsx("div",{className:"rec-strength-line bg-green"}),s.jsx("div",{className:"rec-strength-line bg-transparent"})]}),s.jsxs("div",{className:"rec-criteria-message",children:[s.jsx("strong",{children:"Password Strength: Good."})," This is a good password, but adding a few more symbols, numbers, and characters will make it a much stronger one."]}),l]});case 2:return s.jsxs("div",{className:"rec-strength-meter-wrapper",children:[s.jsxs("div",{className:"rec-strength-meter",children:[s.jsx("div",{className:"rec-strength-line bg-orange"}),s.jsx("div",{className:"rec-strength-line bg-orange"}),s.jsx("div",{className:"rec-strength-line bg-transparent"}),s.jsx("div",{className:"rec-strength-line bg-transparent"})]}),s.jsxs("div",{className:"rec-criteria-message",children:[s.jsx("strong",{children:"Password Strength: Moderate."})," This password is acceptable, but could be stronger. Try adding more symbols, numbers, and characters to make it better."]}),l]});case 1:return s.jsxs("div",{className:"rec-strength-meter-wrapper",children:[s.jsxs("div",{className:"rec-strength-meter",children:[s.jsx("div",{className:"rec-strength-line bg-red"}),s.jsx("div",{className:"rec-strength-line bg-transparent"}),s.jsx("div",{className:"rec-strength-line bg-transparent"}),s.jsx("div",{className:"rec-strength-line bg-transparent"})]}),s.jsxs("div",{className:"rec-criteria-message",children:[s.jsx("strong",{children:"Password Strength: Weak."})," This password needs some work. Use an uppercase letter, lowercase letter, number, and more characters so this password meets our minimum requirements."]}),l]});default:return s.jsxs("div",{className:"rec-strength-meter-wrapper",children:[s.jsxs("div",{className:"rec-strength-meter",children:[s.jsx("div",{className:"rec-strength-line bg-transparent"}),s.jsx("div",{className:"rec-strength-line bg-transparent"}),s.jsx("div",{className:"rec-strength-line bg-transparent"}),s.jsx("div",{className:"rec-strength-line bg-transparent"})]}),l]})}}Ua.propTypes={password:a.string.isRequired};function Ds({children:t,className:e,isRequired:n=!1,isVisible:i=!0,includeBottomMargin:r=!1,...o}){return s.jsxs("div",{"data-component":"FauxLabel",className:N("sarsa-label",e,{"rec-sr-only":!i,"sarsa-label-required":n,"bottom-margin":r&&i}),...o,children:[t,n&&s.jsxs("abbr",{className:"rec-label-required-indicator",children:[s.jsx("span",{"aria-hidden":"true",children:"*"}),s.jsx("span",{className:"rec-sr-only",children:" (Required) "})]})]})}const Fu={children:a.node.isRequired,htmlFor:a.string.isRequired,isRequired:a.bool,isVisible:a.bool,className:a.string};function it({children:t,htmlFor:e,className:n,isRequired:i=!1,isVisible:r=!0,id:o,...l}){const c=N("sarsa-label",n,{"rec-sr-only":!r,"sarsa-label-required":i});return s.jsxs("label",{"data-component":"Label",id:o||`${e}-label`,className:c,htmlFor:e,...l,children:[t,i&&s.jsxs("abbr",{className:"rec-label-required-indicator",children:[s.jsx("span",{"aria-hidden":"true",children:"*"}),s.jsx("span",{className:"rec-sr-only",children:" (Required) "})]})]})}it.propTypes=Fu;const Bu={children:a.node.isRequired,isRequired:a.bool,className:a.string,isAriaHidden:a.bool};function qa({children:t,className:e,isRequired:n=!1,isAriaHidden:i=!0,isVisible:r=!0,...o}){return r?s.jsxs("div",{"data-component":"VisualOnlyLabel","aria-hidden":i?"true":void 0,className:N("sarsa-label",e),...o,children:[t,n&&s.jsxs("abbr",{className:"sarsa-label-required-indicator",children:[s.jsx("span",{"aria-hidden":"true",children:"*"}),s.jsx("span",{className:"rec-sr-only",children:" (Required) "})]})]}):null}qa.propTypes=Bu;class Ga extends m.PureComponent{static{this.propTypes={id:a.string.isRequired,label:a.node.isRequired,isLabelVisible:a.bool,type:a.oneOf(["text","password","search","email","tel","hidden"]),placeholder:a.string,value:a.string,isDisabled:a.bool,isRequired:a.bool,isInvalid:a.bool,isInline:a.bool,enableShowPassword:a.bool,errorText:a.node,hintText:a.node,iconElement:a.element,innerRef:a.oneOfType([a.func,a.object,a.node]),hasClearButton:a.bool,handleClearButtonClick:a.func,shouldFocusOnMount:a.bool,className:a.string,unitBefore:a.string,unitAfter:a.string,srUnitDescription:a.string,ariaDescribedby:a.string,gaTrackingId:a.string,autoComplete:a.string}}static{this.defaultProps={isDisabled:!1,isLabelVisible:!0,value:void 0,type:"text",placeholder:void 0,isRequired:!1,isInvalid:!1,isInline:!1,enableShowPassword:!1,errorText:void 0,hintText:void 0,iconElement:void 0,innerRef:void 0,hasClearButton:!1,handleClearButtonClick:void 0,className:void 0,unitBefore:void 0,unitAfter:void 0,srUnitDescription:void 0}}constructor(e){super(e),this.state={type:e.type,showingPassword:!1},this.inputWrapperRef=m.createRef(),this.handlePasswordVisibilityToggle=this.handlePasswordVisibilityToggle.bind(this)}componentDidMount(){const{shouldFocusOnMount:e}=this.props;clearTimeout(this.timeout),this.timeout=setTimeout(()=>{e&&this.inputWrapperRef&&this.inputWrapperRef.current?.querySelector("input")?.focus()},0)}componentWillUnmount(){clearTimeout(this.timeout)}handlePasswordVisibilityToggle(){const e=this.state.showingPassword?"password":"text";this.setState(n=>({showingPassword:!n.showingPassword,type:e}))}render(){const{id:e,type:n,label:i,isDisabled:r,value:o,isLabelVisible:l,placeholder:c,isRequired:d,isInvalid:u,errorText:f,hintText:g,isInline:h,innerRef:p,iconElement:b,handleClearButtonClick:x,hasClearButton:y,className:v,unitBefore:w,unitAfter:C,srUnitDescription:T,ariaDescribedby:I,enableShowPassword:R,gaTrackingId:S,..._}=this.props,M=Kt(_,"shouldFocusOnMount"),O=b!==void 0,A=y&&typeof o=="string"&&o.length>0&&!R,$=R&&n==="password",U=l===!0&&n!=="hidden";return s.jsxs("div",{"data-component":"TextField",className:N(v,{"sarsa-field-outer-container":!h,"sarsa-field-outer-container-inline":h}),children:[s.jsx("div",{className:"sarsa-field-label-wrapper",children:s.jsx(it,{htmlFor:e,isVisible:U,isRequired:d,children:i})}),s.jsxs("div",{className:"sarsa-field-inner-container",children:[s.jsxs("div",{ref:this.inputWrapperRef,className:N("sarsa-field-input-wrapper sarsa-text-field-input-wrapper",{inline:h,"no-label":!U}),children:[O&&s.jsx("span",{className:"sarsa-field-icon-content left",children:b}),w&&!b&&s.jsx("span",{className:"sarsa-field-icon-content sarsa-text-field-unit-before",children:w}),s.jsx("input",{className:N("sarsa-text-field-input",{"is-invalid":u,"with-icon":O,"with-unit-before":!!w,"with-unit-after":!!C,"with-clear-button":A}),type:this.state.type,id:e,ref:p,disabled:r,value:o,placeholder:c,required:d,"aria-invalid":u,"aria-describedby":N({[`${e}-error`]:!!f,[`${e}-unit-description`]:!!T,[`${e}-hint`]:!!g,[I]:!!I}),"data-ga-tracking-id":S,...M}),C&&s.jsx("span",{className:"sarsa-field-icon-content sarsa-text-field-unit-after",children:C}),T&&s.jsx("span",{className:"rec-sr-only",id:`${e}-unit-description`,children:`Field contents are in ${T}`}),A&&s.jsx("span",{className:"sarsa-text-field-button-wrapper",children:s.jsx(k,{appearance:"subtle",size:"xs",iconBeforeElement:s.jsx(j,{iconName:"close-circle"}),screenReaderTextAfter:"Clear field contents",className:"sarsa-text-field-clear-button",onClick:x})}),$&&s.jsx("span",{className:"sarsa-text-field-button-wrapper",children:s.jsx(k,{appearance:"subtle",size:"xs",iconBeforeElement:this.state.showingPassword?s.jsx(j,{iconName:"visibility-off"}):s.jsx(j,{iconName:"visibility"}),screenReaderTextAfter:this.state.showingPassword?"Hide password value":"Show password value",className:"sarsa-text-field-toggle-password-button",onClick:this.handlePasswordVisibilityToggle})})]}),s.jsx("div",{id:`${e}-error`,className:"sarsa-field-error-message","aria-live":"assertive",children:f&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"req","aria-hidden":"true",children:"*"}),f]})}),s.jsx("div",{id:`${e}-hint`,className:"sarsa-field-hint-message","aria-live":"polite",children:!f&&g&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"hint","aria-hidden":"true",children:"*"}),g]})})]})]})}}class pe extends m.PureComponent{constructor(e){super(e),this.clearError=()=>{this.setState({isInvalid:!1,errorText:void 0})},this.handleNewErrorState=({isInvalid:i,errorText:r})=>{const{handleNewErrorState:o,id:l,name:c}=this.props;o&&(i!==this.errorState.isInvalid||r!==this.errorState.errorText)&&(o({id:l,name:c,isInvalid:i,errorText:r}),this.errorState={isInvalid:i,errorText:r})},this.handleClearButtonClick=i=>{i.preventDefault();const{onChange:r}=this.props;this.setState({value:"",isPristine:!0,isInvalid:!1,errorText:void 0}),r&&r({target:{value:""}}),this.handleNewErrorState({isValid:!1,errorText:void 0})},this.handleChange=i=>{i.persist();const r=i.target.value,{onChange:o}=this.props,{isPristine:l}=this.state;this.isControlled()?(o&&o(i),r&&l&&this.setState({isPristine:!1})):(this.setState({value:r},()=>{r&&l&&this.setState({isPristine:!1})}),o&&o(i))},this.handleBlur=i=>{const{isRequired:r,hinter:o,validator:l,onBlur:c}=this.props,{isPristine:d,isInvalid:u,errorText:f}=this.state,g=this.isControlled()?this.props.value:this.state.value;if(o&&this.hint(),(r||l)&&!d){const h=this.validate();c&&c(i,{value:g,...h}),h.isInvalid&&h.errorText&&oe(h.errorText,"assertive")}else c&&c(i,{value:g,isInvalid:u,errorText:f})},this.hint=()=>{const{hinter:i,hintText:r}=this.props,o=this.isControlled()?this.props.value:this.state.value;if(o&&i){let l=r;l=i(o),this.setState({hintText:l})}},this.validate=()=>{const{validator:i,isRequired:r,shouldReformatValue:o,id:l}=this.props,c=this.isControlled()?this.props.value:this.state.value,d={isInvalid:!1,errorText:null,id:l};if(!c)if(r){const u=typeof this.props.label=="string"?`${this.props.label} is required.`:"This field is required";d.isInvalid=!0,d.errorText=u}else this.clearError();if(c&&i){const u=i(c);if(u.isValid&&(d.isInvalid=!1,d.errorText=null,o&&u.formattedValue)){d.value=u.formattedValue;const g=document.getElementById(this.props.id)?.attributes,h={};if(g)for(let p=0;p{}})}u.isValid||(d.isInvalid=!0,d.errorText=u.errorText||null)}return this.setState(d),this.handleNewErrorState(d),d};const n=typeof e.errorText=="string"&&e.errorText.length>0;this.state={value:e.value||e.defaultValue,isPristine:!(e.value||e.defaultValue),isInvalid:e.isInvalid||n||!1,errorText:e.errorText||void 0,hintText:e.hintText||void 0},this.errorState={isInvalid:e.isInvalid,errorText:e.errorText}}static{this.propTypes={id:a.string.isRequired,name:a.string,label:a.node.isRequired,isLabelVisible:a.bool,type:a.oneOf(["text","password","search","email","tel","hidden"]),placeholder:a.string,value:a.string,isDisabled:a.bool,isRequired:a.bool,isInvalid:a.bool,isInline:a.bool,enableShowPassword:a.bool,errorText:a.node,hintText:a.node,iconElement:a.element,unitBefore:a.string,unitAfter:a.string,innerRef:a.oneOfType([a.func,a.object,a.node]),hasClearButton:a.bool,handleClearButtonClick:a.func,shouldFocusOnMount:a.bool,className:a.string,defaultValue:a.string,onChange:a.func,onBlur:a.func,validator:a.func,hinter:a.func,shouldValidateOnMount:a.bool,shouldValidateOnUpdate:a.bool,shouldHintOnUpdate:a.bool,shouldReformatValue:a.bool,handleNewErrorState:a.func,gaTrackingId:a.string}}static{this.defaultProps={isDisabled:!1,isLabelVisible:!0,value:void 0,type:"text",placeholder:void 0,isRequired:!1,isInvalid:!1,isInline:!1,enableShowPassword:!1,errorText:void 0,hintText:void 0,iconElement:void 0,innerRef:void 0,hasClearButton:!1,handleClearButtonClick:void 0,className:void 0,defaultValue:"",onChange:void 0,onBlur:void 0,shouldFocusOnMount:!1,validator:void 0,hinter:void 0,shouldValidateOnMount:!1,shouldValidateOnUpdate:!1,shouldHintOnUpdate:!1,shouldReformatValue:!0,handleNewErrorState:void 0}}componentDidMount(){const{shouldValidateOnMount:e}=this.props,{value:n}=this.state;n&&e&&(clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.validate()},0))}componentDidUpdate(e){const{shouldValidateOnUpdate:n,shouldHintOnUpdate:i,isInvalid:r,errorText:o}=this.props;if(i&&this.hint(),n)this.validate();else if(r!==e.isInvalid||o!==e.errorText){const l=typeof o=="string"&&o.length>0;this.setState({isInvalid:r||l,errorText:o})}}componentWillUnmount(){clearTimeout(this.timeout)}isControlled(){const{value:e,onChange:n}=this.props;return typeof e=="string"&&n!==void 0}render(){const{gaTrackingId:e,...n}=this.props,{isInvalid:i,errorText:r,hintText:o}=this.state,l=this.isControlled()?this.props.value:this.state.value,c=Kt(n,["defaultValue","shouldReformatValue","shouldValidateOnMount","shouldValidateOnUpdate","shouldHintOnUpdate","validator","hinter","handleNewErrorState"]);return s.jsx(Ga,{...c,onChange:this.handleChange,onBlur:this.handleBlur,handleClearButtonClick:this.handleClearButtonClick,isInvalid:i,errorText:r,hintText:o,value:l,"data-ga-tracking-id":e})}}const Vu={label:a.string,errorText:a.string,confirmPasswords:a.func};class Hu extends K.Component{static propTypes=Vu;constructor(e){super(e),this.state={password1:"",password2:"",disabled:!1}}componentDidMount(){this.password1.focus()}setPassword1Ref=e=>{this.password1=e};password1TextChange=e=>{this.setState({password1:e.target.value})};password2TextChange=e=>{this.setState({password2:e.target.value})};submitForm=e=>{e.preventDefault(),this.setState({disabled:!0},this.props.confirmPasswords({password1:this.state.password1,password2:this.state.password2}))};render(){let e=null,n=this.state.disabled;return this.props.errorText&&(n=!1,e=s.jsx(xe,{role:"alert",type:"error",className:"mb-2",children:this.props.errorText})),s.jsx(fe,{justifyContent:"center",children:s.jsxs(J,{sm:8,className:"rec-acct-modal-log-in-confirmation-body",children:[s.jsx(ae,{headingLevel:1,appearance:"display",className:"rec-acct-modal-title",id:"confirmPasswordModalHeading",children:this.props.label}),e,s.jsxs("form",{onSubmit:this.submitForm,children:[s.jsx("div",{className:"form-item-wrap",children:s.jsx(pe,{type:"password",label:"New Password",innerRef:this.setPassword1Ref,onChange:i=>this.password1TextChange(i),className:"rec-acct-password",id:"rec-acct-password",autoComplete:"off",enableShowPassword:!0})}),s.jsx("div",{className:"form-item-wrap",children:s.jsx(pe,{type:"password",label:"Re-Enter Password",onChange:i=>this.password2TextChange(i),className:"rec-acct-password",id:"rec-acct-password-confirm",autoComplete:"off",enableShowPassword:!0})}),s.jsx(Ua,{password:this.state.password1}),s.jsx(k,{shouldFitContainer:!0,size:"lg",type:"submit",className:"rec-acct-sign-in-btn",title:this.props.label,isDisabled:n,"aria-label":this.props.label,children:this.props.label})]})]})})}}const Uu={logoElement:a.element.isRequired,isOpen:a.bool,closeModal:a.func,resetPasswordWithCode:a.func,completeRegistration:a.func,confirmType:a.string,confirmToken:a.string},qu={isOpen:!1,closeModal:()=>{}};class Gu extends K.Component{static propTypes=Uu;static defaultProps=qu;constructor(e){super(e),this.state={password1:"",password2:"",passwordError:!1,tokenError:!1,serverError:!1,accountExists:!1,completed:!1,redirectURL:"",confirmType:this.props.confirmType||"",confirmToken:this.props.confirmToken||""},this.getConfirmationLabel=this.getConfirmationLabel.bind(this),this.afterOpenModal=this.afterOpenModal.bind(this),this.confirmToken=this.confirmToken.bind(this),this.confirmPasswords=this.confirmPasswords.bind(this),this.handleCloseModal=this.handleCloseModal.bind(this)}componentDidUpdate(e){!e.isOpen&&e.isOpen!==this.props.isOpen&&this.getConfirmType()}handleCloseModal(){this.state.redirectURL||window.history.replaceState({},"","/"),this.props.closeModal(this.state.redirectURL)}getConfirmType=()=>{const{confirmType:e,confirmToken:n}=this.props,i=window.location.pathname.split("/").pop(),r=window.location.href;r.includes("/reset/")?this.setState({confirmType:"Reset",confirmToken:i}):r.includes("/confirmation/")?this.setState({confirmType:"Account",confirmToken:i}):e&&n&&this.setState({confirmType:e,confirmToken:n})};getConfirmationLabel(){const{confirmType:e}=this.state;return e==="Account"?"Set Password":e==="Reset"?"Reset Password":""}afterOpenModal(){this.setState({password1:"",password2:"",passwordError:!1,serverError:!1,tokenError:!1,completed:!1,redirectURL:""})}confirmToken(){this.state.password1!==this.state.password2||this.state.password1.length<8||this.state.password1.length>64?this.setState({passwordError:!0,serverError:!1,tokenError:!1}):(window.location.href.includes("/confirmation/")?this.props.completeRegistration:this.props.resetPasswordWithCode)({password:this.state.password2,token:this.state.confirmToken}).then(()=>{this.props.closeModal()}).catch(i=>{const r=i?.response?.data?.error,o=r==="password must have mixed case";this.setState({passwordError:o,serverError:!o,tokenError:r&&r.toLowerCase()==="expired or not active yet",accountExists:r&&r.toLowerCase()==="an account already exists for this email address"})})}confirmPasswords(e){this.setState({password1:e.password1,password2:e.password2},()=>{this.confirmToken()})}render(){let e=null;this.state.passwordError&&(e="You need to strike a match! These passwords either don't match or don't meet our criteria. Passwords must have 8 characters including a capital letter, lower case letter, special character, and number. Please try again."),this.state.serverError&&(this.state.accountExists?e="This account has already been confirmed, please proceed to login.":this.state.tokenError?e="This link has expired, please request a new one.":e="An error has occurred, please try again later.");let n=null;const{confirmType:i}=this.state;i==="Account"?n="Your Account was successfully created.":n="Your password was successfully reset.";let r=null;return this.state.completed?r=s.jsx(Pu,{label:this.getConfirmationLabel(),message:n,email:this.state.email,closeModal:this.handleCloseModal}):r=s.jsx(Hu,{errorText:e,label:this.getConfirmationLabel(),confirmPasswords:this.confirmPasswords}),s.jsx(Ye,{role:"complementary",isOpen:this.props.isOpen,onAfterOpen:this.afterOpenModal,onRequestClose:this.handleCloseModal,className:{base:"rec-modal-dialog-base rec-acct-modal rec-acct-confirm-modal",afterOpen:"rec-modal-dialog-after-open-md ",beforeClose:"rec-modal-dialog-before-close"},overlayClassName:"rec-overlay-base",aria:{labelledby:"confirmPasswordModalHeading"},ariaHideApp:!1,children:s.jsxs("div",{className:"rec-modal-content-wrap",children:[s.jsxs("div",{className:"logo-close-wrap",children:[s.jsx("div",{className:"rec-modal-logo",children:this.props.logoElement}),s.jsx(k,{className:"modal-close-button",appearance:"subtle",size:"md","aria-label":"Close modal",iconBeforeElement:s.jsx(j,{iconName:"close"}),onClick:this.handleCloseModal})]}),r]})})}}function Wa({flag:t,flagValueToMatch:e=!0,fallback:n,children:i}){try{const r=kt();if(r[t]===e)return i;if(n&&(r[t]===null||r[t]===void 0))return null}catch(r){console.error(r)}return n||null}Wa.propTypes={flag:a.string.isRequired,children:a.node.isRequired,fallback:a.node,flagValueToMatch:a.any};const fr="rec-recaptcha",Wu=()=>window&&!!window.grecaptcha,zu=()=>!Ne(document.scripts.namedItem(fr)),Ku=(t,e,n)=>{try{return window.grecaptcha.ready(()=>window.grecaptcha.execute(t,{action:e}).then(i=>n({token:i})).catch(i=>n({error:i?.message})))}catch(i){return n({error:i.message})}},Yu=(t,e,n)=>{if(zu()){const i=setInterval(()=>{Wu()&&(Ku(t,e,n),clearInterval(i))},100)}else return n({error:"recaptcha script not detected."})},Zu=t=>{const e=document.createElement("script");e.src=`https://www.google.com/recaptcha/api.js?render=${t}`,e.async=!0,e.defer=!0,e.id=fr,document.body.appendChild(e)},Ju={email:a.string};class Xu extends K.Component{static propTypes=Ju;componentDidMount(){this.header.focus()}render(){return s.jsx(fe,{justifyContent:"center",children:s.jsxs(J,{sm:8,className:"rec-acct-modal-create-confirmation-body",children:[s.jsx("div",{ref:e=>{this.header=e},tabIndex:"-1",className:"rec-hide-focus",children:s.jsx(ae,{headingLevel:1,appearance:"display",className:"rec-acct-modal-title",id:"createAccountModalHeading",children:"Check Your Email"})}),s.jsxs("p",{children:["An email has been sent to ",s.jsx("strong",{children:this.props.email}),". Once you confirm your email, you will be able to set a password for your account. If you do not receive your activation email, please check your spam folder."]})]})})}}function Qu(){return be()&&window.recaptchaOptions||{}}function eh(t){if(!be())return;if(window.grecaptcha?.enterprise){t&&t();return}window.recaptchaEnterpriseOnloadCallback=()=>{t&&t()};const e=()=>{const n=document.createElement("script"),r=Qu().useRecaptchaNet?"recaptcha.net":"www.google.com";n.src=`https://${r}/recaptcha/enterprise.js?onload=recaptchaEnterpriseOnloadCallback&render=explicit`,n.id="grecaptcha.enterprise",document.body.appendChild(n),n.onerror=()=>{console.warn("Recaptcha script failed to load")}};document?.body?e():window.addEventListener("DOMContentLoaded",e,{once:!0})}class Fs extends m.Component{static propTypes={action:a.string,sitekey:a.string.isRequired,onChange:a.func,theme:a.oneOf(["dark","light"]),type:a.oneOf(["image","audio"]),tabindex:a.number,onExpired:a.func,onErrored:a.func,size:a.oneOf(["compact","normal","invisible"]),stoken:a.string,hl:a.string,badge:a.oneOf(["bottomright","bottomleft","inline"]),isolated:a.bool};static defaultProps={onChange:()=>{},theme:"light",type:"image",tabindex:0,size:"normal",badge:"bottomright"};constructor(){super(),this.handleExpired=this.handleExpired.bind(this),this.handleErrored=this.handleErrored.bind(this),this.handleChange=this.handleChange.bind(this),this.executeAsync=this.executeAsync.bind(this),this.captchaRef=m.createRef(),this.state={isPendingExplicitRender:!0}}componentDidMount(){eh(()=>{this.explicitRender()})}componentDidUpdate(){this.state.isPendingExplicitRender&&this.captchaRef.current&&(this.setState({isPendingExplicitRender:!1}),this.explicitRender())}componentWillUnmount(){this._widgetId!==void 0&&(this.delayOfCaptchaIframeRemoving(),this.reset())}handleExpired(){this.props.onExpired?this.props.onExpired():this.handleChange(null)}handleErrored(){this.props.onErrored&&this.props.onErrored(),this.executionReject&&(this.executionReject(),delete this.executionResolve,delete this.executionReject)}handleChange(e){return this.props.onChange?new Promise(n=>{n(),this.props.onChange(e)}):(this.executionResolve&&(this.executionResolve(e),delete this.executionReject,delete this.executionResolve),null)}getValue(){return be()&&window.grecaptcha&&this._widgetId!==void 0?window.grecaptcha.getResponse(this._widgetId):null}getWidgetId(){return be()&&window.grecaptcha&&this._widgetId!==void 0?this._widgetId:null}execute(){return be()&&window.grecaptcha&&this._widgetId!==void 0?this.props.action!==void 0?window.grecaptcha.execute(this._widgetId,{action:this.props.action}):window.grecaptcha.execute(this._widgetId):(this._executeRequested=!0,null)}executeAsync(){return new Promise((e,n)=>{(window.grecaptcha===void 0||window.grecaptcha.enterprise===void 0)&&n(),this.props.action!==void 0?window.grecaptcha.enterprise.execute(this._widgetId,{action:this.props.action}).then(i=>{i?e(i):n()}).catch(i=>{console.error("props.action fail",i),n(i)}):window.grecaptcha.enterprise.execute(this._widgetId).then(i=>{i?e(i):n()}).catch(i=>{console.error("!props.action fail",i),n(i)})})}explicitRender(){if(window.grecaptcha&&window.grecaptcha.enterprise&&window.grecaptcha.enterprise.render&&this._widgetId===void 0){if(!this.captchaRef.current){this.setState({isPendingExplicitRender:!0});return}const e=document.createElement("div");this._widgetId=window.grecaptcha.enterprise.render(e,{sitekey:this.props.sitekey,callback:this.handleChange,theme:this.props.theme,type:this.props.type,tabindex:this.props.tabindex,"expired-callback":this.handleExpired,"error-callback":this.handleErrored,size:this.props.size,stoken:this.props.stoken,hl:this.props.hl,badge:this.props.badge,isolated:this.props.isolated}),this.captchaRef.current.appendChild(e)}this._executeRequested&&window.grecaptcha&&this._widgetId!==void 0&&(this._executeRequested=!1,this.execute()),this._executeRequested=!1}delayOfCaptchaIframeRemoving(){const e=document.createElement("div");for(document.body.appendChild(e),e.style.display="none";this.captchaRef.current.firstChild;)e.appendChild(this.captchaRef.current.firstChild);setTimeout(()=>{document.body.removeChild(e)},5e3)}reset(){window.grecaptcha&&window.grecaptcha.enterprise&&this._widgetId!==void 0&&window.grecaptcha.enterprise.reset(this._widgetId)}render(){const{sitekey:e,onChange:n,theme:i,type:r,tabindex:o,onExpired:l,onErrored:c,size:d,stoken:u,badge:f,hl:g,isolated:h,...p}=this.props;return s.jsx("div",{...p,ref:this.captchaRef})}}function gr(t){const[e,n]=m.useState(!1);return m.useEffect(()=>{if(!be())return;const r=(be()&&window.recaptchaOptions||{}).useRecaptchaNet?"recaptcha.net":"www.google.com",o=document.createElement("script");o.src=`https://${r}/recaptcha/enterprise.js?onload=onloadcallback&render=explicit`,o.setAttribute("async",""),o.addEventListener("load",()=>{n(!0)}),document.body.appendChild(o)},[]),e?s.jsx(Fs,{...t}):null}function re({children:t,size:e="md",color:n="black",align:i="left",fontWeight:r="normal",fontStyle:o="normal",tag:l="p",className:c,hasMarginBetween:d=!1,isTruncated:u=!1,...f}){const g=l;return s.jsx(g,{className:N("sarsa-text",c,{"color-gray":n==="gray","color-white":n==="white","color-link":n==="link","color-danger":n==="danger","align-center":i==="center","align-right":i==="right","size-xl":e==="xl","size-lg":e==="lg","size-sm":e==="sm","size-xs":e==="xs","weight-bold":r==="bold","weight-semibold":r==="semibold","style-italic":o==="italic","margin-between":d,truncated:u}),...f,children:t})}function th({siteName:t,email:e,firstName:n,lastName:i,cellPhone:r,optIn:o,confirmAccount:l,additionalChallengeRequired:c,confirmPassword:d}){const[u,f]=m.useState(""),[g,h]=m.useState(""),[p,b]=m.useState(!1),[x,y]=m.useState(null),[v,w]=m.useState({message:"",status:void 0}),C=m.useRef(null),T=async()=>{h(""),f("");let M=null;if(!c)try{M=await C.current?.executeAsync()}catch{w({message:"An error occurred.Try again later.",status:"error"});return}b(!0);const O=await l({email:e,firstName:n,lastName:i,cellPhone:r,optIn:o,invisibleRecaptchaToken:M});O.success?w({message:"Email was successfully sent",status:"success"}):O.response?.data?.error==="lockout"?w({message:"Resend limit has reached, you need to wait 30 minutes to send it again. If you do not receive your registration code email, please check your spam folder",status:"error"}):w({message:"An error occurred.Try again later.",status:"error"}),b(!1)},I=M=>{y(M)},R=M=>{M?.response?.data?.error==="invalid registration confirmation code"?h("We do not recognize the code you have entered. Please double check the code and enter it again."):M?.response?.data?.error&&w({message:"An error occurred.Try again later.",status:"error"})},S=async()=>{if(u.length===0){h("Confirmation code cannot be empty");return}if(u.length<6){h("Confirmation code must be 6 digits number");return}b(!0);const M="/api/accounts/registration/validate";try{const{data:O}=await le.put(M,{code:u});O.token.length>0?d(O.token,"Account"):w({message:"An error occurred.Try again later.",status:"error"})}catch(O){R(O)}finally{b(!1)}},_=M=>{const O=M.target.value?.replace(/\D/g,"");if(/^\d{0,6}$/.test(O)){const $=O.slice(0,3)+(O.length>3?" ":"")+O.slice(3,6);h(""),w({message:"",status:void 0}),f($)}};return s.jsx(fe,{justifyContent:"center",className:"mt-8",children:s.jsxs(J,{sm:8,className:"mt-7",children:[s.jsx("div",{className:"rec-acc-create-code-modal__icon",children:s.jsx(j,{iconName:"email",size:"xxl"})}),s.jsx(ae,{headingLevel:1,appearance:"display",headingAlign:"center",className:"rec-acct-modal-title",id:"signInModalHeading",children:"Check Your Email"}),s.jsxs("p",{children:["An email from ",t," has been sent to ",s.jsx("strong",{children:e}),". Please enter the six digit code provided within that email to confirm your account. If you do not receive your activation email, please check your spam folder."]}),s.jsxs(fe,{justifyContent:"center",children:[s.jsx(J,{md:12,children:v.status!==void 0&&s.jsx(xe,{className:"mb-3",type:v.status,children:v.message})}),s.jsx(J,{md:8,children:s.jsx(pe,{autoComplete:"off",id:"code",label:"Confirm Email Code",isLabelVisible:!1,onChange:_,value:u,className:"rec-acc-create-code-modal__input",isInvalid:!!g,placeholder:"000 000"})}),s.jsxs(J,{className:"mb-2",md:12,children:[p&&s.jsx("div",{className:"rec-sign-loading p-2",children:s.jsx(ke,{})}),g&&s.jsxs(re,{className:"mb-2",align:"center",color:"gray",size:"sm",children:[s.jsx("abbr",{className:"rec-label-required-indicator",children:s.jsx("span",{"aria-hidden":"true",children:"*"})}),g]})]}),s.jsx(J,{children:s.jsx(k,{onClick:T,shouldFitContainer:!0,size:"lg",type:"submit",appearance:"tertiary",isDisabled:p||c&&!x,children:"Resend Email"})}),s.jsxs(J,{children:[c?s.jsx(gr,{action:"signup",size:"normal",onChange:I,sitekey:"6LfhXNoZAAAAAMTSVfpSlqoOeBBJmIoHwtI7Gm6v"}):s.jsx(J,{className:"rec-recaptcha-wrap",children:s.jsx(Fs,{ref:C,action:"signup",size:"invisible",sitekey:"6LdBIvUZAAAAAM02b8GWJew_1LffQJo9rNB5yVTU"})}),s.jsx(k,{onClick:S,shouldFitContainer:!0,size:"lg",type:"submit",className:"rec-acct-sign-in-btn",isDisabled:p,gaTrackingId:"938831200523",title:"Log In","aria-label":"Log In",children:"Submit"})]})]})]})})}const Cs=m.forwardRef((t,e)=>{const{id:n,label:i,value:r,name:o,isDisabled:l=!1,isChecked:c,isRequired:d=!1,isInvalid:u,innerRef:f,className:g,onChange:h,defaultChecked:p,isLabelVisible:b=!0,clickTagCategory:x,clickTagAction:y,clickTagLabel:v,gaTrackingId:w,...C}=t,T=nt(n),I=Ls(e,f),R=S=>{h&&h(S),x&&v&&y&&Ge({category:x,action:y,label:v},()=>{})};return s.jsxs("label",{htmlFor:T,className:N("rec-label-checkbox",g,{disabled:l}),children:[s.jsx("input",{ref:I,type:"checkbox",id:T,value:r,name:o,disabled:l,required:d,className:"rec-input-hide",checked:c,onChange:R,"aria-required":d,defaultChecked:p,"data-rectagcategory":x,"data-rectaglabel":v,"data-rectagaction":y,"data-ga-tracking-id":w,...C}),s.jsx("span",{className:N("rec-input-checkbox",{"is-invalid":u})}),b?i:s.jsx("span",{className:"rec-sr-only",children:i})]})}),wn=a.shape({errorText:a.string,inputId:a.string});function br({errors:t,headingLevel:e=3,className:n,...i}){const r=m.useRef(null),o=m.useRef(t),{role:l}=i,c=()=>{Co(t)>0&&r.current&&r.current.focus()};m.useEffect(()=>{c()},[]),m.useEffect(()=>{Ta(t,o.current)||(o.current=t,c())},[t]);const d=()=>{let y=0;return t&&!Array.isArray(t)&&Object.keys(t).forEach(w=>{y+=t[w].length}),y},u=y=>v=>{const w=document.getElementById(y);w&&w.focus&&(v.preventDefault(),w.focus())},f=()=>{if(Array.isArray(t)){const y=t.length===1?"ul":"ol";return s.jsx(y,{children:t.map(v=>{const w=v?.inputId??v.id??"";return s.jsx("li",{children:s.jsx("a",{onClick:u(w),href:`#${w}`,title:"Jump to the field with this error",children:v.errorText??"Invalid input"})},w)})})}return null},g=()=>{if(t&&!Array.isArray(t)){const y=Object.keys(t),v={};return y.forEach((w,C)=>{v[C]=t[w].length}),y.map((w,C)=>{let T=1;if(C>0)for(let R=0;R{const S=R?.inputId??R.id??"";return s.jsx("li",{children:s.jsx("a",{onClick:u(S),href:`#${S}`,title:"Jump to the field with this error",children:R.errorText??"Invalid input"})},S)})})]},w)})}return null};if(!t)return null;const h=Array.isArray(t),p=h?t.length:d();if(!p)return null;const b=p===1?"To continue, correct the error below":`To continue, correct the ${p} errors below`,x=h?f():g();return s.jsx("div",{"data-component":"FormValidationAlert","data-testid":"FormValidationAlert",tabIndex:-1,ref:r,className:N("sarsa-form-validation-alert",n),...i,children:s.jsx(xe,{type:"error",heading:b,headingLevel:e,children:s.jsx("div",{className:"inner-error-wrap",children:s.jsx(Rt,{children:x})})})})}br.propTypes={errors:a.oneOfType([a.arrayOf(wn),a.objectOf(a.arrayOf(wn))]),headingLevel:a.number,className:a.string,role:a.string};function sh(t){const e={isValid:!1,formattedValue:null,errorText:null};return ja(t)?e.isValid=!0:e.errorText="Email address does not have the right format (email@domain.com).",e}class za extends m.PureComponent{constructor(){super(...arguments),this.textFieldRef=m.createRef(),this.validate=()=>this.textFieldRef.current?.validate()}static{this.propTypes={id:a.string.isRequired,label:a.node,isInvalid:a.bool,gaTrackingId:a.string}}static{this.defaultProps={label:"Email"}}render(){const{id:e,label:n,isInvalid:i,gaTrackingId:r,...o}=this.props;return s.jsx(pe,{ref:this.textFieldRef,id:e,type:"email",label:n,isInvalid:i,validator:sh,gaTrackingId:r,...o})}}function ah(t){const l=[/^52(55)([0-9]{4})([0-9]{4})$/,/^52(56)([0-9]{4})([0-9]{4})$/,/^52(81)([0-9]{4})([0-9]{4})$/,/^52(33)([0-9]{4})([0-9]{4})$/,/^52([0-9]{3})([0-9]{3})([0-9]{4})$/];for(let c=0;c15)return n.errorText=i.invalidIntNumber,n;if(c.test(d)){switch(n.isValid=!0,d.substring(0,2)){case"44":n.formattedValue=nh(d);break;case"52":n.formattedValue=ah(d);break;default:n.formattedValue=`+${d}`}return n}return n.errorText=i.invalidIntNumber,n}return d[0]==="1"&&(d=d.substring(1)),d.length!==10?(n.errorText=i.invalidNumber,n):parseInt(d[0],10)<=1?(n.errorText=i.invalidAreaCode,n):parseInt(d[3],10)<=1?(n.errorText=i.invalidNumber,n):(n.isValid=!0,n.formattedValue=d.replace(l,"($1) $2-$3"),n)}class xr extends m.PureComponent{constructor(){super(...arguments),this.textFieldRef=m.createRef(),this.validate=()=>this.textFieldRef.current?.validate()}static{this.propTypes={id:a.string.isRequired,label:a.node}}static{this.defaultProps={label:"Phone"}}render(){const{id:e,label:n,...i}=this.props;return s.jsx(pe,{ref:this.textFieldRef,id:e,type:"tel",label:n,validator:vr,shouldReformatValue:!0,...i})}}function ih({errorText:t,signIn:e,confirmAccount:n,onRecaptchaValidation:i,additionalChallengeRequired:r,siteName:o,isLoading:l}){const[c,d]=m.useState(!1),[u,f]=m.useState(null),[g,h]=m.useState(null),p=m.useRef(null),b=m.useRef([]),x=w=>C=>{b.current[w]=C},y=w=>{f(w),i&&i(w)},v=async w=>{w.preventDefault();const C=w.currentTarget.elements;h(null);const T=[];if(b.current.forEach(R=>{const S=R?.validate();S?.isInvalid&&T.push(S)}),T.length){h(T);return}let I=null;if(!r)try{if(I=await p.current?.executeAsync(),!I){d(!0);return}}catch{d(!0);return}n({email:C.email.value,firstName:C.firstName.value,lastName:C.lastName.value,cellPhone:C.cellPhone.value,optIn:C.optIn.value==="checked",invisibleRecaptchaToken:I})};return s.jsx(fe,{justifyContent:"center",children:s.jsxs(J,{sm:8,className:"rec-acct-modal-sign-up-body",children:[s.jsx(ae,{headingLevel:1,appearance:"display",className:"rec-acct-modal-title",id:"createAccountModalHeading",children:"Sign Up"}),e?s.jsxs("div",{className:"rec-acct-modal-existing-account",children:[s.jsxs("p",{children:["Already have a ",s.jsx("span",{translate:"no",children:o})," account?"]}),s.jsx(k,{appearance:"link",onClick:e,children:"Log In"})]}):null,s.jsx(br,{errors:g,className:"mb-2"}),t&&!g&&!l?s.jsx(xe,{type:"error",className:"mb-2",children:t}):null,c&&!g&&!l?s.jsxs(xe,{type:"error",className:"mb-2",children:["There was error verifying you are human. Please ensure your ad blocker is turned off for ",o," and try submitting again."]}):null,s.jsx("form",{onSubmit:v,noValidate:!0,children:s.jsxs(Rt,{children:[s.jsx(pe,{id:"rec-acct-first",label:"First Name",name:"firstName",className:"rec-acct-first",isRequired:!0,ref:x(0),autoFocus:!0}),s.jsx(pe,{id:"rec-acct-last",label:"Last Name",name:"lastName",className:"rec-acct-last",isRequired:!0,ref:x(1)}),s.jsx(za,{id:"rec-acct-email",label:"Email",name:"email",className:"rec-acct-email",isRequired:!0,ref:x(2)}),s.jsx(xr,{id:"rec-acct-cell-phone",label:"Phone Number",name:"cellPhone",className:"rec-acct-cell-phone",isRequired:!0,hintText:"Mobile phone number preferred",ref:x(3)}),s.jsx(Cs,{label:"Yes, please share stories that will inspire my next adventure.",id:"rec-acct-newsletter-opt-in",name:"optIn",value:"checked",defaultChecked:!0}),r?s.jsx(gr,{action:"signup",size:"normal",onChange:y,sitekey:"6LfhXNoZAAAAAMTSVfpSlqoOeBBJmIoHwtI7Gm6v"}):s.jsx(J,{className:"rec-recaptcha-wrap",children:s.jsx(Fs,{ref:p,action:"signup",size:"invisible",sitekey:"6LdBIvUZAAAAAM02b8GWJew_1LffQJo9rNB5yVTU"})}),s.jsx(k,{size:"lg",shouldFitContainer:!0,isDisabled:r&&!u,type:"submit",isLoading:l,children:"Sign Up"})]})}),s.jsx(re,{size:"sm",color:"gray",className:"mt-5 mb-half",children:"Required fields are marked with an asterisk (*) and must be filled in to complete the form."}),s.jsxs(re,{size:"sm",color:"gray",children:["By creating an account, I accept ",o,"'s ",s.jsx("a",{href:"https://www.recreation.gov/disclaimers",children:"Terms of Use"})," and"," ",s.jsx("a",{href:"https://www.recreation.gov/privacy-policy",children:"Privacy Policy"}),"."]})]})})}const rh={logoElement:a.element,isOpen:a.bool,closeModal:a.func,signIn:a.func,verification:a.string,siteName:a.string,onConfirmModal:a.func},oh={logoElement:null,isOpen:!1,closeModal:()=>{},signIn:()=>{},onConfirmModal:()=>{},siteName:"Recreation.gov"},lh="An account already exists for this email address",ch="additional challenge required",dh="challenge failed";class uh extends K.Component{static propTypes=rh;static defaultProps=oh;constructor(e){super(e),this.state={firstName:"",lastName:"",email:"",cellPhone:"",errorMessage:"",completed:!1,invisibleRecaptchaToken:null,isLoading:!1},this.afterOpenModal=this.afterOpenModal.bind(this),this.getRecaptchaToken=this.getRecaptchaToken.bind(this),this.confirmAccount=this.confirmAccount.bind(this),this.signup=this.signup.bind(this),this.handleApiErrors=this.handleApiErrors.bind(this)}componentDidUpdate(e){this.props.verification!==e.verification&&this.setState({verification:this.props.verification})}handleApiErrors(e){const n=s.jsx(k,{appearance:"link",onClick:this.props.signIn,children:"Log In"});if(e?.response?.data?.error===ch)this.setState({additionalChallengeRequired:!0});else{let i="An error has occurred, please try again later.";e?.response?.data?.error==="invalid cellphone"&&(i="The phone number you provided does not appear to be valid."),e?.response?.data?.error===lh&&(i=s.jsxs(Gt,{space:"xs",children:[s.jsx("span",{children:"You look familiar! This email already has an account associated with it."}),n]})),e?.response?.data?.error===dh&&(i=s.jsxs(Gt,{space:"xs",children:[s.jsxs("span",{children:["There was error verifying you are human. Please ensure your ad blocker is turned off for ",this.props.siteName," and try submitting again."]}),n]})),this.setState({errorMessage:i})}}setStateAsync=e=>new Promise(n=>{this.setState(e,n)});getRecaptchaTokenV3=async(e,n)=>new Promise(i=>{Yu("6Ld0BogUAAAAAGDL0sfz1wVdmuae18krNNQS6vW5",e,r=>{const o={section:e,code:r.error?"":r.token,region:n};i(o)})});async getRecaptchaToken(){const e="EAST",n="WEST",i="invisible",r="initializeRegistration";let o={};return this.state.additionalChallengeRequired?o={section:r,code:this.state.verification,region:n}:this.state.invisibleRecaptchaToken?o={section:r,code:this.state.invisibleRecaptchaToken,region:i}:o=await this.getRecaptchaTokenV3(r,e),o}async signup(e){const n="/api/accounts/registration";this.setState({isLoading:!0});try{return await le.post(n,{email:this.state.email,first_name:this.state.firstName,last_name:this.state.lastName,cell_phone:this.state.cellPhone,opt_in:this.state.optIn,system:e}),this.setState({errorMessage:"",completed:!0}),{success:!0}}catch(i){return this.handleApiErrors(i),i}finally{this.setState({isLoading:!1})}}async confirmAccount(e){try{await this.setStateAsync({email:e.email,firstName:e.firstName,lastName:e.lastName,cellPhone:e.cellPhone,optIn:e.optIn,invisibleRecaptchaToken:e.invisibleRecaptchaToken});const n=await this.getRecaptchaToken();return await this.signup(n)}catch(n){return n}}afterOpenModal(){this.setState({firstName:"",lastName:"",email:"",cellPhone:"",optIn:!0,errorMessage:"",additionalChallengeRequired:!1,completed:!1,invisibleRecaptchaToken:null})}render(){let e=null;this.state.errorMessage&&(e=this.state.errorMessage);let n=null;return this.state.completed?n=s.jsx(Wa,{flag:"enableCreateAccountCode",fallback:s.jsx(Xu,{email:this.state.email}),children:s.jsx(th,{confirmPassword:this.props.onConfirmModal,siteName:this.props.siteName,email:this.state.email,firstName:this.state.firstName,lastName:this.state.lastName,cellPhone:this.state.cellPhone,optIn:this.state.optIn,confirmAccount:this.confirmAccount,additionalChallengeRequired:this.state.additionalChallengeRequired})}):n=s.jsx(ih,{errorText:e,signIn:this.props.signIn,confirmAccount:this.confirmAccount,additionalChallengeRequired:this.state.additionalChallengeRequired,siteName:this.props.siteName,isLoading:this.state.isLoading}),s.jsx(Ye,{role:"complementary",isOpen:this.props.isOpen,onAfterOpen:this.afterOpenModal,onRequestClose:this.props.closeModal,className:{base:"rec-modal-dialog-base rec-acct-modal rec-acct-create-modal",afterOpen:"rec-modal-dialog-after-open-md ",beforeClose:"rec-modal-dialog-before-close"},overlayClassName:"rec-overlay-base",aria:{labelledby:"createAccountModalHeading"},ariaHideApp:!1,children:s.jsxs("div",{className:"rec-modal-content-wrap",children:[s.jsxs("div",{className:"logo-close-wrap",children:[s.jsx("div",{className:"rec-modal-logo",children:this.props.logoElement}),s.jsx(k,{className:"modal-close-button",appearance:"subtle",size:"md","aria-label":"Close modal",iconBeforeElement:s.jsx(j,{iconName:"close"}),onClick:this.props.closeModal})]}),n]})})}}function Ka({id:t,triggerButtonElement:e,isDisabled:n=!1,size:i="md",applyButtonLabel:r="Apply",children:o,popupLeftActionElement:l,onApply:c,onClose:d,showPopupActions:u=!0,innerRef:f,className:g,dataComponent:h,render:p,clickTagCategory:b,clickTagAction:x,clickTagLabel:y,gaTrackingId:v,gaTrackingValue:w,dropdownAriaAttributes:C=!0,focusElement:T,applyButtonRef:I,baseTitle:R,isTitleVisible:S=!1}){const _=m.useRef(null),M=m.useRef(null),O=m.useRef(null),A=f||M,[$,U]=m.useState(!1),P=nt(t),D=m.useCallback(()=>{U(!1),d&&d()},[d]);m.useEffect(()=>{function V(G){$&&(G.key==="Escape"&&(G.preventDefault(),D(),A?.current?.focus&&A.current.focus()),G.key==="Tab"&&_?.current?.contains&&!_.current.contains(document.activeElement)&&D())}function Q(G){$&&_.current&&!_.current.contains(G.target)&&D()}return document.addEventListener("keyup",V),document.addEventListener("click",Q),()=>{document.removeEventListener("keyup",V),document.removeEventListener("click",Q)}},[A,D,$]);const ne=m.useCallback(V=>{V.preventDefault(),$?D():U(!0)},[D,$]),W=m.useCallback(V=>{V.preventDefault(),D(),T?T?.focus():A.current?.focus(),c&&c()},[A,D,T,c]),Y=()=>{const V=P||"trigger-button-id",Q=C?{"aria-haspopup":"dialog","aria-expanded":$,"aria-controls":`${P}-popup`}:"";return m.cloneElement(e,{id:V,isDisabled:n,isExpanded:$,...Q,innerRef:A,onClick:ne,"data-test-id":"dropdown-base-trigger",gaTrackingId:v,gaTrackingValue:$?"Close Dropdown":"Open Dropdown"})},B=()=>p?p($,D):o,H=C?"dialog":void 0;return s.jsxs("div",{"data-component":h||"DropdownBase",className:N("sarsa-dropdown-base",g),ref:_,children:[Y(),s.jsx("div",{id:`${P}-popup`,role:H,"aria-labelledby":`${P}-title`,children:$&&s.jsxs("div",{ref:O,"data-component":"DropdownBase-popup",className:N("sarsa-dropdown-base-popup",{"size-sm":i==="xs"||i==="sm","size-md":i==="md","size-lg":i==="lg"}),children:[s.jsx(ae,{headingLevel:2,appearance:"h6",className:S?"sarsa-dropdown-base-heading":"rec-sr-only",id:`${P}-title`,children:R}),B(),u&&s.jsx("div",{className:"sarsa-dropdown-base-popup-actions","data-component":"DropdownBase-actions",children:s.jsxs("div",{className:"sarsa-dropdown-base-popup-actions-content",children:[s.jsx("div",{children:l}),s.jsx(k,{appearance:"link",onClick:W,innerRef:I,clickTagCategory:b,clickTagAction:x,clickTagLabel:y,"data-ga-tracking-id":v,"data-ga-tracking-value":w,children:r})]})})]})})]})}Ka.propTypes={id:a.string,triggerButtonElement:a.element.isRequired,isDisabled:a.bool,size:a.oneOf(["xs","sm","md","lg"]),children:a.node,applyButtonLabel:a.string,popupLeftActionElement:a.node,onApply:a.func,onClose:a.func,showPopupActions:a.bool,innerRef:a.shape({current:a.node}),className:a.string,dataComponent:a.string,render:a.func,clickTagCategory:a.string,clickTagAction:a.string,clickTagLabel:a.string,gaTrackingId:a.string,dropdownAriaAttributes:a.bool,focusElement:a.node,applyButtonRef:a.shape({current:a.node}),baseTitle:a.node,isTitleVisible:a.bool};function yr(t){const{hasSelectedCustomer:e,fullName:n,innerRef:i,isDisabled:r,...o}=t;return s.jsxs("button",{type:"button",ref:i,disabled:r,className:N("rec-select",{"rec-csr-profile":!e,"rec-csr-customer-profile":e}),...o,children:[s.jsx("span",{className:"rec-csr-profile-icon-wrap",children:s.jsx(j,{iconName:"person"})}),s.jsx("span",{className:"rec-select-label",children:n}),s.jsx("span",{className:"rec-select-icon",children:s.jsx(j,{iconName:"arrow-down"})})]})}yr.propTypes={hasSelectedCustomer:a.bool,fullName:a.string,innerRef:a.any,isDisabled:a.bool,isExpanded:a.bool};class hh extends K.PureComponent{static propTypes={account:At,csrAccount:Va,openSelectCustomerModal:a.func,signOut:a.func};static defaultProps={account:{},signOut:()=>{}};render(){let e="";if(this.props.csrAccount&&(e=`(CSR) ${this.props.csrAccount.name}`),this.props.account){const i=this.props.account.account.first_name,r=this.props.account.account.last_name[0];e=i,r&&r.length>0&&(e=`(Customer) ${i} ${r}.`)}const n=s.jsx(yr,{fullName:e,hasSelectedCustomer:!!this.props.account});return s.jsx("div",{className:"nav-profile-dropdown",children:s.jsx(Ka,{id:"csr-options",triggerButtonElement:n,applyButtonLabel:"Close",children:s.jsxs("div",{className:"sarsa-csr-options-dropdown-inner",children:[s.jsx("div",{children:s.jsx(k,{appearance:"link",shouldFitContainer:!0,onClick:this.props.openSelectCustomerModal,children:"Select Customer"})}),s.jsx("div",{children:s.jsx(k,{appearance:"link",shouldFitContainer:!0,onClick:this.props.signOut,children:"Sign Out"})})]})})})}}class ph extends K.PureComponent{static propTypes={cart:a.shape({expiration:a.string,showTimer:a.bool,reservations:a.array}),account:At,csrAccount:Va,logout:a.func,openSelectCustomerModal:a.func};render(){return s.jsxs("div",{className:"nav-user-actions",children:[s.jsx(mr,{cart:this.props.cart}),s.jsx(hh,{account:this.props.account,csrAccount:this.props.csrAccount,openSelectCustomerModal:this.props.openSelectCustomerModal,signOut:this.props.logout})]})}}function Je({children:t,className:e,isFloating:n,...i}){return s.jsx("div",{"aria-live":"assertive",...i,children:t?s.jsx("div",{className:n?"sarsa-field-error-message-outer":void 0,children:s.jsxs("div",{className:N("sarsa-field-error-message",e,{floating:n}),children:[s.jsx("span",{className:"req","aria-hidden":"true",children:"*"})," ",t]})}):null})}function mh(t,e){const{label:n,isDisabled:i,className:r,length:o=6,value:l,defaultValue:c,validChars:d="0-9",onChange:u,onComplete:f,autoFocus:g,id:h,isRequired:p=!0,isInvalid:b,errorMessage:x,...y}=t,v=m.useRef(null),w=nt(h),[C,T]=m.useState(String(l??c??"")),[I,R]=m.useState(!1),[S,_]=m.useState({isInvalid:b||!!x||!1,errorText:x??"",inputId:w,id:w,label:n}),M=56,O=8;m.useLayoutEffect(()=>{g&&v.current?.focus()},[g]),m.useEffect(()=>{i&&R(!1)},[i]);const A=()=>String(l??C),$=B=>{const H=B??A(),V=H.length!==o,Q=RegExp(`[^${d}]`).test(H),E=p&&!H?`${n} is required`:V?`Code must be ${o} digits long`:Q?"Code has invalid characters":void 0,L={id:w,inputId:w,isInvalid:V||Q,errorText:E,label:n};return _(L),L},U=B=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(B.key)&&B.preventDefault()},P=B=>{const H=B.target.value.replace(/\s|-/g,"");RegExp(`^[${d}]{0,${o}}$`).test(H)&&(T(H),u?.(H),H.length===o&&f&&window.setTimeout(()=>{const V=$(H);f(H,V)},0))},D=B=>A().length{const H=A();return(H.length===B||H.length===B+1&&o===B+1)&&I};m.useImperativeHandle(e,()=>({validate:()=>$(),getValue:()=>A()}));const W=`${w}-error`,Y=b||S?.isInvalid||!!x;return s.jsxs("div",{"data-component":"VerificationCodeField","data-testid":"VerificationCodeField",className:r,style:{width:`${M*o+O*(o-1)}px`},children:[s.jsxs("div",{className:"input-wrap",children:[s.jsx("input",{ref:v,id:w,"aria-label":n,"aria-required":p,"aria-describedby":W,"aria-invalid":Y,spellCheck:!1,autoComplete:"off",className:"input",disabled:i,onKeyDown:U,value:A(),defaultValue:c,onChange:P,onSelect:B=>{const H=B.currentTarget.value;B.currentTarget.setSelectionRange(H.length,H.length)},onFocus:()=>{R(!0)},onBlur:()=>{R(!1)},type:"text",...y}),[...Array(o)].map((B,H)=>s.jsx("div",{role:"presentation",onClick:()=>{v.current?.focus()},style:{width:`${M}px`},className:N("char",{focus:ne(H),inactive:D(H),disabled:i,invalid:Y}),children:A()[H]?A()[H]:null},H))]}),s.jsx(Je,{id:W,children:x??S?.errorText})]})}const fh=m.forwardRef(mh);function gh({siteName:t,createAccount:e,errorMessage:n,onReset:i,confirmSignIn:r,setErrorText:o,processing:l,isResetPasswordFlow:c,children:d}){const[u,f]=m.useState("mfaCode"),[g,h]=m.useState(""),[p,b]=m.useState(""),x=m.useRef(),y=T=>{T.preventDefault(),r(u==="mfaCode"?p:g,u)},v=T=>{o(""),b(T)},w=T=>{const I=T.target.value;I.length<11&&(o(""),h(I))},C=T=>{f(T),h(""),b("")};return s.jsxs(s.Fragment,{children:[s.jsx(ae,{headingLevel:1,appearance:"display",className:"rec-acct-modal-title",id:"signInModalHeading",headingAlign:"center",children:"Log In"}),s.jsxs(fe,{justifyContent:"center",children:[s.jsxs(J,{md:12,children:[d,s.jsx(ut,{background:"light-blue",marginY:"md",children:s.jsxs(re,{className:"py-1",align:"center",children:["New to ",s.jsx("span",{translate:"no",children:t}),"?"," ",s.jsx(k,{appearance:"link",onClick:e,title:"Create an account.","aria-label":"Create an account",className:"pb-fourth",children:"Create an account."})]})}),n&&s.jsx(xe,{type:"error",className:"mb-2 rec-sign-error",shouldFocusOnMount:!0,children:n})]}),s.jsxs(J,{md:12,children:[s.jsxs("form",{onSubmit:y,children:[u==="mfaCode"&&s.jsxs(s.Fragment,{children:[s.jsx(ut,{textAlign:"center",children:s.jsx(it,{className:"pb-1 justify-content-center",htmlFor:"code",isRequired:!0,children:"6-digit Code from Authenticator App"})}),s.jsx(ut,{alignX:"center",children:s.jsx(fh,{id:"code",label:"6-digit Code from Authenticator App",onChange:v,value:p,autoFocus:!0,className:"mb-3"})})]}),u==="backupCode"&&s.jsx(pe,{isRequired:!0,id:"backupCode",autoComplete:"off",label:"One-time backup code",onChange:w,value:g,innerRef:x,className:"mb-3"}),s.jsxs(re,{className:"mb-2",align:"center",color:"gray",size:"sm",children:[s.jsx("b",{children:"Attention:"})," Required fields are marked with an asterisk (*) and must be filled in to complete the form."]}),u==="mfaCode"&&s.jsxs(re,{align:"center",size:"sm",className:"mb-3",children:["Don’t have access to 6-digit Code from Authenticator App? Use"," ",s.jsx(k,{size:"xs",className:"pb-fourth",appearance:"link",onClick:()=>C("backupCode"),children:"one-time backup code"})," ","instead."]}),u==="backupCode"&&s.jsxs(re,{align:"center",size:"sm",className:"mb-3",children:["Use"," ",s.jsx(k,{size:"xs",className:"pb-fourth",appearance:"link",onClick:()=>C("mfaCode"),children:"6-digit Code"})," ","from Authenticator App instead."]}),s.jsx(k,{shouldFitContainer:!0,size:"lg",type:"submit",className:"rec-acct-sign-in-btn my-1",isDisabled:l,isLoading:l,children:"Log In"})]}),!c&&s.jsx(k,{className:"mb-3",shouldFitContainer:!0,appearance:"link",onClick:i,children:"Forgot Your Password?"}),s.jsxs(re,{size:"sm",color:"gray",align:"center",className:"mb-4",children:["By logging in, I accept ",t,"'s ",s.jsx("a",{href:"https://www.recreation.gov/disclaimers",children:"Terms of Use"})," ","and"," ",s.jsx("a",{href:"https://www.recreation.gov/privacy-policy",children:"Privacy Policy"}),"."]})]})]})]})}function bh({isOpen:t,reset:e,onClose:n,onSubmit:i,create:r,siteName:o="",error:l,lockout:c,logoElement:d}){const[u,f]=m.useState(""),[g,h]=m.useState({type:"login",id:""}),[p,b]=m.useState(!1),x=()=>{const M=new URLSearchParams(window.location.search).get("magic");let O="login",A="";M&&(O="magic-link",A=M),h({type:O,id:A})};m.useEffect(()=>{t&&x()},[t]);const y=()=>{n()},v=async(_,M)=>{f("");try{const O=M==="mfaCode"?_?.replace(/\D/g,""):_,{type:A,id:$}=g;if(b(!0),M==="mfaCode"&&O.length!==6){f("unknown code"),b(!1);return}if(M==="backupCode"&&O.length!==10)f("unknown code"),b(!1);else{const U=Xi();await i({type:A,id:$,token:O}),U&&Qi(U)}b(!1),y()}catch(O){const A=Xt(O);f(A),b(!1)}},w=()=>{r(),y()},C=()=>{e(),y()},T=s.jsx(k,{appearance:"link",onClick:e,title:"Reset Password",className:"pb-fourth","aria-label":"Reset Password",children:"Reset Password"}),I=s.jsx(k,{appearance:"link",onClick:r,title:"Create an account.",className:"pb-fourth","aria-label":"Create an account",children:"Create an account"});let R=null;const S=window.location.href.includes("/reset/");return(l||u)&&(R=s.jsxs(s.Fragment,{children:["Are you sure you have the right code? Please double check your code, and try again. You can also ",I," or ",T,"."]}),S&&(R=s.jsxs(s.Fragment,{children:["Are you sure you have the right code? Please double check your code, and try again. You can also ",I,"."]}))),c&&(R=s.jsxs(s.Fragment,{children:["This account has been locked out for 30 minutes due to three or more failed login attempts. To access your account before then, check your e-mail for a magic login link or ",T,". If you do not receive your magic log in email, please check your spam folder."]})),s.jsx(Ye,{role:"complementary",isOpen:t,onRequestClose:y,className:{base:"rec-modal-dialog-base rec-acct-modal rec-acct-sign-in-modal",afterOpen:"rec-modal-dialog-after-open-md ",beforeClose:"rec-modal-dialog-before-close"},overlayClassName:"rec-overlay-base",aria:{labelledby:"signInModalHeading"},ariaHideApp:!1,children:s.jsxs("div",{className:"rec-modal-content-wrap",children:[s.jsxs("div",{className:"logo-close-wrap",children:[s.jsx("div",{className:"rec-modal-logo",children:d}),s.jsx(k,{className:"modal-close-button",appearance:"subtle",size:"md","aria-label":"Close modal",iconBeforeElement:s.jsx(j,{iconName:"close"}),onClick:y})]}),s.jsx(fe,{justifyContent:"center",children:s.jsx(J,{sm:8,children:s.jsx(gh,{errorMessage:R,setErrorText:f,processing:p,createAccount:w,onReset:C,confirmSignIn:v,siteName:o,isResetPasswordFlow:S})})}),s.jsxs("div",{className:"rec-captcha-notice",children:["This site is protected by reCAPTCHA and the Google ",s.jsx("a",{href:"https://policies.google.com/privacy",target:"_blank",rel:"noopener noreferrer",children:"Privacy Policy"})," and ",s.jsx("a",{href:"https://policies.google.com/terms",target:"_blank",rel:"noopener noreferrer",children:"Terms of Service"})," ","apply."]})]})})}const Cn=350;function Ya({id:t,children:e,isExpanded:n,hasIndentedBody:i=!0,className:r}){const o=m.useRef(null),l=m.useRef(null),c=m.useRef();return m.useEffect(()=>{o.current&&l.current&&(o.current.style.maxHeight=n?"none":"0",l.current.style.display=n?"block":"none")},[n]),m.useEffect(()=>{if(n){if(clearTimeout(c.current),l.current&&o.current){l.current.style.display="block",l.current.setAttribute("aria-hidden","false");const d=l.current.clientHeight?l.current.clientHeight:"none";o.current.style.maxHeight=`${d}px`}c.current=setTimeout(()=>{o.current&&(o.current.style.maxHeight="none")},Cn)}if(!n){if(clearTimeout(c.current),l.current&&o.current){l.current.setAttribute("aria-hidden","true");const d=l.current.clientHeight?l.current.clientHeight:"none";o.current.style.maxHeight=`${d}px`,setTimeout(()=>{o.current&&(o.current.style.maxHeight="0")},0)}c.current=setTimeout(()=>{l.current&&(l.current.style.display="none")},Cn)}return()=>{clearTimeout(c.current)}},[n]),s.jsx("div",{ref:o,id:t,className:N("sarsa-accordion-content-outer",r),children:s.jsx("div",{"data-component":"AccordionContent",ref:l,role:"region","aria-labelledby":`${t}-heading`,style:{boxSizing:"border-box"},className:N("sarsa-accordion-content-inner",{"has-indented-body":i}),children:e})})}Ya.propTypes={id:a.string,children:a.node,isExpanded:a.bool,hasIndentedBody:a.bool,className:a.string};function Bs({children:t,handleHeadingClick:e,headingAppearance:n="h6",headingLevel:i=3,id:r,isExpanded:o=!1,className:l,gaTrackingId:c}){return s.jsx("div",{className:N("sarsa-accordion-heading",l),"data-component":"AccordionHeading",children:s.jsx(ae,{headingLevel:i,appearance:n,children:s.jsxs(k,{isUnstyled:!0,id:`${r}-heading`,className:N("sarsa-accordion-heading-button",{expanded:o}),"aria-controls":r,"aria-expanded":o,onClick:e,gaTrackingId:c,...c&&{gaTrackingValue:`${t} - ${o?"Hidden":"Expanded"}`},children:[s.jsx("span",{className:`sarsa-accordion-heading-icon size-${n}`,children:o?s.jsx(j,{iconName:"chevron-down",size:"md"}):s.jsx(j,{iconName:"chevron-right",size:"md"})}),s.jsx("span",{children:t})]})})})}Bs.displayName="AccordionHeading";Bs.propTypes={children:a.node.isRequired,handleHeadingClick:a.func,headingAppearance:a.oneOf(["h4","h5","h5Caps","h6"]),headingLevel:a.oneOf([1,2,3,4,5,6]),id:a.string,isExpanded:a.bool,className:a.string,gaTrackingId:a.string};function Za({children:t,handleHeadingClick:e,hasIndentedBody:n=!0,headingAppearance:i="h6",headingLevel:r=3,id:o,isControlled:l=!1,isExpanded:c=!1,gaTrackingId:d,gaTrackingValue:u}){const[f,g]=m.useState(c||!1),h=b=>{b.preventDefault(),l&&e?e():g(x=>!x)},p=()=>m.Children.map(t,b=>{if(!m.isValidElement(b))return b;const x={handleHeadingClick:h,headingAppearance:i,headingLevel:r,id:o,isExpanded:l?c:f,...d&&!b.props.gaTrackingId&&{gaTrackingId:d},...u&&!b.props.gaTrackingValue&&{gaTrackingValue:u}},y={id:o,hasIndentedBody:n,isExpanded:l?c:f};return m.cloneElement(b,b.type.displayName==="AccordionHeading"?x:y)});return s.jsx("div",{className:"sarsa-accordion-item","data-component":"AccordionItem",children:p()})}Za.propTypes={children:a.node.isRequired,handleHeadingClick:a.func,hasIndentedBody:a.bool,headingAppearance:a.oneOf(["h4","h5","h5Caps","h6"]),headingLevel:a.oneOf([1,2,3,4,5,6]),id:a.string,isControlled:a.bool,isExpanded:a.bool,gaTrackingId:a.string,gaTrackingValue:a.string};function wr({id:t="accordion",children:e,items:n,defaultActiveIndex:i,shouldAllowMultipleOpen:r=!1,hasIndentedBody:o=!0,headingLevel:l=3,headingAppearance:c="h6",activeIndex:d,onChange:u,className:f,gaTrackingId:g}){const[h,p]=m.useState(i),b=d!==void 0,x=w=>{u&&b?u(w):p(w===h?void 0:w)},y=()=>m.Children.map(e,(w,C)=>w&&m.isValidElement(w)?m.cloneElement(w,{handleHeadingClick:()=>{x(C)},hasIndentedBody:o,headingAppearance:c,headingLevel:l,id:`${t}-item-${C}`,isControlled:!r,isExpanded:b?C===d:C===h}):null),v=()=>n?n.map((w,C)=>s.jsxs(Za,{handleHeadingClick:()=>x(C),hasIndentedBody:o,headingAppearance:c,headingLevel:l,id:`${t}-item-${C}`,isControlled:!r,isExpanded:b?C===d:C===h,gaTrackingId:g,children:[s.jsx(Bs,{children:w.heading}),s.jsx(Ya,{children:w.content})]},w.heading)):null;return s.jsx("div",{"data-component":"Accordion",className:f,id:t,children:n&&n.length>0?v():y()})}wr.propTypes={id:a.string,children:a.node,items:a.arrayOf(a.shape({heading:a.node,content:a.node})),defaultActiveIndex:a.number,shouldAllowMultipleOpen:a.bool,hasIndentedBody:a.bool,headingLevel:a.oneOf([1,2,3,4,5,6]),headingAppearance:a.oneOf(["h4","h5","h5Caps","h6"]),activeIndex:a.number,onChange:a.func,className:a.string,gaTrackingId:a.string};function vh({isOpen:t,onClose:e,onSetupMFA:n=()=>{window.location.assign("/account/security")}}){const i=m.useRef(),r=()=>{e()},o=()=>{n()},l=async()=>{try{await Ve.mfa.prompt(!1),r()}catch{r()}};return m.useEffect(()=>{!!i?.current?.focus&&requestAnimationFrame(()=>i.current?.focus())},[]),s.jsx(es,{isOpen:t,size:"xl",overlayClassName:"rec-acct-modal rec-mfa-modal__container",onRequestClose:r,contentRef:c=>{i.current=c},gaTrackingId:"798651617401",children:s.jsx(fe,{hasGutters:!1,className:"mt-5",justifyContent:"center",children:s.jsxs(J,{sm:10,className:"mt-3",children:[s.jsx(ae,{headingLevel:1,appearance:"h3",headingAlign:"center",children:"Set Up Multi-Factor Authentication"}),s.jsxs(re,{className:"mt-4 mb-2",children:["You are among a small percentage of ","Recreation.gov"," users selected to a beta test of a new security feature called Multi-Factor Authentication, or MFA for short. MFA is a common security technique used for online services to verify your identity to minimize the chance of an unauthorized user accessing your account."]}),s.jsx(re,{className:"my-2",children:"This is completely optional and adds a layer of security for your protection."}),s.jsx(re,{className:"my-2",children:"You may select to set up MFA now by selecting “Set Up Multi-Factor Authentication” below or activate MFA later through your Account settings."}),s.jsxs(re,{className:"my-2",children:[s.jsx("b",{children:"Before Proceeding: Download Authenticator App."})," Download and install a multi-factor authenticator app to your mobile device."]}),s.jsx("div",{children:s.jsx(wr,{id:"auth-apps",children:s.jsxs(Za,{children:[s.jsx(Bs,{children:"View list of suggested apps"}),s.jsxs(Ya,{children:[s.jsxs(re,{children:[s.jsx("b",{children:"Android options:"})," Google Authenticator, Microsoft Authenticator, Authy, LastPass, 1Password."]}),s.jsxs(re,{children:[s.jsx("b",{children:"iOS options:"})," Google Authenticator, Microsoft Authenticator, Authy, LastPass, 1Password."]}),s.jsxs(re,{children:[s.jsx("b",{children:"Windows apps:"})," 1Password, OTP Manager."]}),s.jsxs(re,{children:[s.jsx("b",{children:"Mac apps:"})," 1Password, OTP Manager."]}),s.jsxs(re,{children:[s.jsx("b",{children:"Chrome extensions:"})," Authenticator."]})]})]})})}),s.jsx(re,{className:"my-2",children:"Once you have installed the app, it will serve to provide a verification code, which will be needed to complete the login process. If you already have an authenticator app installed, click “Set Up Multi-Factor Authentication.”"}),s.jsx(fe,{justifyContent:"center",className:"mt-3",children:s.jsxs(jt,{isStacked:!0,children:[s.jsx(k,{appearance:"subtle",onClick:r,gaTrackingId:"831610554062",children:"Skip for now"}),s.jsx(k,{appearance:"tertiary",onClick:l,gaTrackingId:"831610554062",children:"Don’t show me this again"}),s.jsx(k,{onClick:o,gaTrackingId:"831610554062",children:"Set Up Multi-Factor Authentication"})]})})]})})})}const xh={email:a.string,sendResetPasswordEmail:a.func,disableResetLinkBtn:a.bool};class yh extends K.Component{static propTypes=xh;constructor(e){super(e),this.resendConfirmationEmail=this.resendConfirmationEmail.bind(this)}componentDidMount(){this.header.focus()}resendConfirmationEmail(e){e.preventDefault(),this.props.sendResetPasswordEmail()}render(){return s.jsx(fe,{justifyContent:"center",children:s.jsxs(J,{sm:8,className:"rec-acct-modal-reset-confirmation-body",children:[s.jsx("div",{ref:e=>{this.header=e},tabIndex:"-1",className:"rec-hide-focus",children:s.jsx(ae,{headingLevel:1,appearance:"display",className:"rec-acct-modal-title",id:"resetPasswordModalHeading",children:"Check Your Email"})}),s.jsxs("p",{children:["An email has been sent to ",s.jsx("strong",{children:this.props.email}),". Please click on the link in that email to reset the password for your account. If you do not receive the message, please check your spam folder."]}),s.jsx(k,{shouldFitContainer:!0,onClick:e=>this.resendConfirmationEmail(e),size:"lg",isDisabled:this.props.disableResetLinkBtn,children:"Resend Email"})]})})}}function wh({siteName:t,email:e,closeModal:n,sendResetPasswordEmail:i}){const r=Fe(),[o,l]=m.useState(""),[c,d]=m.useState(""),[u,f]=m.useState(""),[g,h]=m.useState(!1),[p,b]=m.useState({message:"",status:void 0}),x=async()=>{l(""),h(!0);const S=await i();S.success?b({message:Su,status:"success"}):S.response?.data?.error==="retry: Too many requests, try again later."?b({message:Nu,status:"error"}):b({message:vn,status:"error"}),h(!1)},y=()=>o.length===0?ju:c.length<8||c.length>64||c!==u?Tu:null,v=()=>{b({message:"",status:void 0}),d(""),f(""),f(""),n()},w=S=>{const _=S?.response?.data?.error;_==="invalid password reset confirmation code"?b({message:Ru,status:"error"}):_==="password must have mixed case"?b({message:Iu,status:"error"}):_&&b({message:vn,status:"error"})},C=async S=>{S.preventDefault(),h(!0);try{const _=y();if(_){b({message:_,status:"error"}),h(!1);return}await r(er({email:e,password:u,token:o})),v()}catch(_){w(_)}finally{h(!1)}},T=S=>{const M=S.target.value.toLowerCase().replace(/\d/g,"");l(M),b({message:"",status:void 0})},I=S=>{f(S.target.value),b({message:"",status:void 0})},R=S=>{d(S.target.value),b({message:"",status:void 0})};return s.jsx(fe,{justifyContent:"center",children:s.jsxs(J,{sm:8,children:[s.jsx(ae,{headingLevel:1,appearance:"display",headingAlign:"center",className:"rec-acct-modal-title",id:"signInModalHeading",children:"Reset Password"}),s.jsxs(re,{className:"mb-3",children:["An email has been sent from ",t," to ",s.jsx("strong",{children:e}),". Please enter the code provided in the email to confirm your account. If you do not receive an email to reset your password, please check your spam folder or select Resend Email."]}),s.jsxs(fe,{justifyContent:"center",children:[s.jsx(J,{md:12,children:p.status!==void 0&&s.jsx(xe,{className:"mb-3",type:p.status,children:p.message})}),s.jsxs("form",{onSubmit:C,children:[s.jsx("div",{className:"form-item-wrap",children:s.jsx(pe,{name:"rec-acct-reset-code",autoComplete:"off",id:"rec-acct-reset-code",placeholder:"",label:"Confirm Email Code",onChange:T,value:o,shouldFocusOnMount:!0})}),s.jsx("div",{className:"form-item-wrap",children:s.jsx(pe,{type:"password",label:"New Password",onChange:R,className:"rec-acct-password",id:"rec-acct-password",autoComplete:"new-password",name:"rec-acct-password",enableShowPassword:!0})}),s.jsx("div",{className:"form-item-wrap",children:s.jsx(pe,{type:"password",label:"Re-Enter Password",onChange:I,className:"rec-acct-password",id:"rec-acct-password-confirm",autoComplete:"new-password",name:"rec-acct-password-confirm",enableShowPassword:!0})}),s.jsx(Ua,{password:c}),s.jsxs(fe,{className:"mt-5",justifyContent:"end",children:[s.jsx(J,{xs:12,md:6,children:s.jsx(k,{onClick:x,shouldFitContainer:!0,size:"lg",appearance:"tertiary",isDisabled:g,children:"Resend Email"})}),s.jsx(J,{xs:12,md:6,children:s.jsx(k,{shouldFitContainer:!0,size:"lg",type:"submit",className:"rec-acct-sign-in-btn",title:"Save Password",isDisabled:g,"aria-label":"Save Password",children:"Save Password"})})]})]}),s.jsx(J,{className:"mb-2",md:12,children:g&&s.jsx("div",{className:"rec-sign-loading p-2",children:s.jsx(ke,{})})})]})]})})}const Ch={error:a.any,signIn:a.func,create:a.func,confirmEmail:a.func,disableResetLinkBtn:a.bool,siteName:a.string};class Sh extends K.Component{static propTypes=Ch;constructor(e){super(e),this.state={email:""},this.emailTextChange=this.emailTextChange.bind(this),this.submitForm=this.submitForm.bind(this)}componentDidMount(){this.email.focus()}emailTextChange(e){this.setState({email:e.target.value})}submitForm(e){e.preventDefault(),this.props.confirmEmail({email:this.state.email.trim()})}render(){let e=null;this.props.error&&(e=s.jsx(xe,{type:"error",className:"mb-2",children:this.props.error}));const n=s.jsxs("div",{className:"rec-acct-modal-existing-account",children:[s.jsxs("p",{children:["New to ",s.jsx("span",{translate:"no",children:this.props.siteName}),"?"]}),s.jsx(k,{appearance:"link",onClick:this.props.create,title:"Create an account.","aria-label":"Create an account",children:"Create an account."})]});return s.jsx(fe,{justifyContent:"center",children:s.jsxs(J,{sm:8,className:"rec-acct-modal-reset-password-body",children:[s.jsx(ae,{headingLevel:1,appearance:"display",className:"rec-acct-modal-title",id:"resetPasswordModalHeading",children:"Forgot Your Password?"}),n,s.jsx("p",{children:"Enter the email address associated with your account. We'll send a link to reset your password."}),e,s.jsxs("form",{onSubmit:this.submitForm,children:[s.jsxs("div",{className:"form-item-wrap",children:[s.jsx(it,{htmlFor:"rec-acct-email",children:"Email"}),s.jsx("input",{ref:i=>{this.email=i},onChange:i=>this.emailTextChange(i),id:"rec-acct-email",className:"rec-acct-email"})]}),s.jsx(k,{size:"lg",shouldFitContainer:!0,className:"rec-acct-reset-btn",type:"submit",title:"Send Reset Link","aria-label":"Send Reset Link",isDisabled:this.props.disableResetLinkBtn,children:"Send Reset Link"})]}),s.jsx("div",{className:"rec-acct-modal-footer",children:s.jsx(k,{appearance:"link",iconBeforeElement:s.jsx(j,{iconName:"chevron-left"}),onClick:this.props.signIn,title:"Back to Log In","aria-label":"Back to Log In",children:"Back to Log In"})})]})})}}class Nh extends K.Component{static propTypes={logoElement:a.element.isRequired,isOpen:a.bool,closeModal:a.func,signIn:a.func,create:a.func,siteName:a.string};static defaultProps={isOpen:!1,closeModal:()=>{},signIn:()=>{},create:()=>{},siteName:"Recreation.gov"};constructor(e){super(e),this.state={email:"",emailValidationError:!1,inputError:!1,serverError:!1,serverErrorText:null,completed:!1,disableResetLinkBtn:!1,recaptchaError:!1},this.afterOpenModal=this.afterOpenModal.bind(this),this.sendResetPasswordEmail=this.sendResetPasswordEmail.bind(this),this.confirmEmail=this.confirmEmail.bind(this)}afterOpenModal(){this.setState({email:"",inputError:!1,serverError:!1,serverErrorText:null,completed:!1,disableResetLinkBtn:!1,recaptchaError:!1})}emailTextChange(e){this.setState({email:e.target.value})}async sendResetPasswordEmail(){const{email:e}=this.state;if(e.length<1)return this.setState({inputError:!0,serverError:!1,serverErrorText:null,disableResetLinkBtn:!1,recaptchaError:!1}),{success:!1};if(!ja(e))return this.setState({emailValidationError:!0,disableResetLinkBtn:!1,recaptchaError:!1}),{success:!1};let n;try{if(n=await this.recaptchaRef?.executeAsync(),!n)return this.setState({recaptchaError:!0}),{success:!1}}catch(r){return this.setState({recaptchaError:!0}),r}this.setState({recaptchaError:!1,disableResetLinkBtn:!0});const i="/api/accounts/passwordreset";try{return await le.post(i,{email:e,recaptcha_token:n,recaptcha_type:"invisible"}),this.setState({emailValidationError:!1,inputError:!1,serverError:!1,serverErrorText:null,completed:!0,disableResetLinkBtn:!1}),{success:!0}}catch(r){return this.setState({inputError:!1,serverError:!0,serverErrorText:r?.response?.data?.error,disableResetLinkBtn:!1}),r}}confirmEmail(e){this.setState({email:e.email},()=>{this.sendResetPasswordEmail()})}render(){let e=null;this.state.inputError&&(e="All fields are required."),this.state.emailValidationError&&(e="That is not a valid email address."),this.state.recaptchaError&&(e=`There was error verifying you are human. Please ensure your ad blocker is turned off for ${this.props.siteName} and try submitting again.`);const n=s.jsx(k,{appearance:"link",onClick:this.props.create,title:"Create an account.","aria-label":"Create an account",children:"Create an account"});this.state.serverError&&(this.state.serverErrorText==="user not found"?e=s.jsxs(s.Fragment,{children:["Sorry, we couldn't find a ",this.props.siteName," account matching that email address. ",n]}):this.state.serverErrorText==="retry: Too many requests, try again later."?e=s.jsx(s.Fragment,{children:"You have exceeded the max amount of times to reset your password. You may attempt to reset again in one hour."}):e="An error has occurred, please try again later.");let i=null;return this.state.completed?i=s.jsx(Wa,{flag:"enablePasswordResetCode",fallback:s.jsx(yh,{email:this.state.email,sendResetPasswordEmail:this.sendResetPasswordEmail,disableResetLinkBtn:this.state.disableResetLinkBtn}),children:s.jsx(wh,{siteName:this.props.siteName,email:this.state.email,sendResetPasswordEmail:this.sendResetPasswordEmail,closeModal:this.props.closeModal})}):i=s.jsx(Sh,{error:e,signIn:this.props.signIn,create:this.props.create,confirmEmail:this.confirmEmail,disableResetLinkBtn:this.state.disableResetLinkBtn,siteName:this.props.siteName}),s.jsx(Ye,{role:"complementary",isOpen:this.props.isOpen,onAfterOpen:this.afterOpenModal,onRequestClose:this.props.closeModal,className:{base:"rec-modal-dialog-base rec-acct-modal rec-acct-reset-modal",afterOpen:"rec-modal-dialog-after-open-md ",beforeClose:"rec-modal-dialog-before-close"},overlayClassName:"rec-overlay-base",aria:{labelledby:"resetPasswordModalHeading"},ariaHideApp:!1,children:s.jsxs("div",{className:"rec-modal-content-wrap",children:[s.jsxs("div",{className:"logo-close-wrap",children:[s.jsx("div",{className:"rec-modal-logo",children:this.props.logoElement}),s.jsx(k,{className:"modal-close-button",appearance:"subtle",size:"md","aria-label":"Close modal",iconBeforeElement:s.jsx(j,{iconName:"close"}),onClick:this.props.closeModal})]}),i,s.jsx(J,{className:"rec-recaptcha-wrap",children:s.jsx(Fs,{ref:r=>{this.recaptchaRef=r},action:"passwordreset",size:"invisible",sitekey:"6LdBIvUZAAAAAM02b8GWJew_1LffQJo9rNB5yVTU"})})]})})}}function Sn({id:t,label:e,legend:n,value:i,isDisabled:r,isChecked:o,isRequired:l,innerRef:c,className:d,name:u,isInline:f,gaTrackingId:g,...h}){const p=nt(t);return s.jsxs("label",{htmlFor:p,className:N("rec-label-radio",d,{disabled:r,"rec-radio-inline":f}),children:[s.jsx("input",{type:"radio",id:p,value:i,disabled:r,required:l,ref:c,className:`rec-input-hide ${f}`,checked:o,name:u,"data-ga-tracking-id":g,...h}),s.jsx("span",{className:"rec-input-radio"}),!f&&n&&n!==""?s.jsxs(s.Fragment,{children:[s.jsx(re,{fontWeight:"semibold",tag:"span",children:e}),s.jsx(re,{className:"rec-radio-legend",children:n})]}):e]})}function Th({children:t,value:e,name:n,isRequired:i=!1,isDisabled:r=!1,onChange:o,isInline:l,className:c}){return s.jsx("div",{className:N(c,{"sarsa-radio-group-inline":l}),children:m.Children.map(t,d=>{if(!m.isValidElement(d))return d;const u={value:d.props.value,isChecked:o?e===d.props.value:void 0,name:n,isRequired:i,isDisabled:r||d.props.isDisabled,onChange:o};return m.cloneElement(d,u)})})}class jh extends K.PureComponent{static propTypes={results:a.array,select:a.func};render(){const e=this.props.results.map((n,i)=>{const r=i;return s.jsxs("tr",{children:[s.jsxs("td",{children:[n.first_name," ",n.last_name," ",n.is_commercial_account&&s.jsx("div",{className:"permit-text-less-emphasis",children:"(Commercial user)"})]}),s.jsx("td",{children:n.email}),s.jsx("td",{children:n.cell_phone}),s.jsx("td",{children:s.jsx(k,{onClick:()=>{this.props.select(n.account_id)},children:"Select"})})]},r)});return s.jsx("div",{children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{scope:"col",children:"Name"}),s.jsx("th",{scope:"col",children:"Email"}),s.jsx("th",{scope:"col",children:"Phone"}),s.jsx("th",{scope:"col",children:"Select"})]})}),s.jsx("tbody",{children:e})]})})}}const Rh={success:"check-circle",warning:"warning",error:"error",info:"info"};function Cr({type:t,title:e,headingLevel:n=3,children:i,dismissNotification:r,isBanner:o=!1,shouldFocusOnMount:l=!1,hasSolidBackground:c=!1,id:d,className:u,...f}){const g=m.useRef(null),h=`h${n}`,p=Rh[t],b=t==="error"?"assertive":"polite";m.useEffect(()=>{l&&g&&g.current?.focus()},[]);const x=()=>{r&&r(t)},y=()=>typeof i=="string"?s.jsx("p",{children:i}):s.jsx("div",{children:i});return o?s.jsxs("div",{tabIndex:-1,ref:g,className:N(`rec-${t}-full-banner`,"sarsa-no-focus-style",u),children:[s.jsxs("div",{id:d,className:"rec-msg","aria-live":b,"aria-atomic":"true",...f,children:[s.jsx(j,{iconName:p,className:`rec-icon-${t}`}),s.jsxs("div",{className:"rec-msg-text",children:[s.jsx(h,{className:"rec-msg-text-heading",children:e||`${ws(t)} Notification:`}),s.jsx("div",{children:i})]})]}),r&&s.jsx(k,{className:"rec-notification-close-new",appearance:"subtle",size:"xs",iconBeforeElement:s.jsx(j,{iconName:"close"}),onClick:x,screenReaderTextAfter:"Dismiss notification"})]}):s.jsxs("div",{tabIndex:-1,ref:g,className:N(`rec-notification-${t}`,"sarsa-no-focus-style",u,{"rec-has-solid-background":c}),children:[s.jsxs("div",{className:"rec-notification-content","aria-live":b,"aria-atomic":"true",children:[s.jsx("span",{className:"rec-notification-icon",children:s.jsx(j,{iconName:p,className:`rec-icon-${t}`})}),s.jsxs("div",{className:"rec-notification-body",children:[s.jsx(h,{className:"rec-notification-title",children:e||`${ws(t)} Notification:`}),y()]})]}),r&&s.jsx(k,{className:"rec-notification-close-new",appearance:"subtle",size:"xs",iconBeforeElement:s.jsx(j,{iconName:"close"}),onClick:x,screenReaderTextAfter:"Dismiss notification"})]})}Cr.propTypes={type:a.oneOf(["error","warning","success","info"]).isRequired,title:a.string,headingLevel:a.oneOf([1,2,3,4,5,6]),children:a.node,dismissNotification:a.func,isBanner:a.bool,shouldFocusOnMount:a.bool,hasSolidBackground:a.bool,id:a.string,className:a.string};const Sr=m.memo(Cr);function Wt({height:t,width:e,borderRadius:n,style:i,screenReaderText:r,...o}){return s.jsx("div",{"data-component":"Placeholder",style:{...i,height:t,borderRadius:n,width:e},...o,children:r&&s.jsx("span",{className:"rec-sr-only",children:r})})}Wt.propTypes={height:a.string,width:a.string,borderRadius:a.string,style:a.object,screenReaderText:a.string};const Ih=["94%","96%","93%","96%","93%","97%","94%","96%","98%","97%","94%"];function Eh({fontSize:t=14,lineHeight:e=24,lines:n=1,width:i,alignX:r="left"}){const o=t*.857,l=Math.floor(e)-o,c=Array.from(Array(n).keys());return s.jsx("div",{"data-component":"PlaceholderText",className:N({"align-center":r==="center","align-right":r==="right"}),children:c.map(d=>{let u=i||Ih[d]||"97%";return!i&&d===n-1&&(u="70%"),s.jsx("div",{style:{paddingTop:`${l/2}px`,paddingBottom:`${l/2}px`,width:u},children:s.jsx("div",{"data-component":"Placeholder",style:{height:o}})},d)})})}Eh.propTypes={fontSize:a.number,lineHeight:a.number,lines:a.number,width:a.string,alignX:a.oneOf(["left","center","right"])};function Ke({value:t,children:e,isDisabled:n,gaTrackingId:i}){return s.jsx("option",{value:t,disabled:n,"data-ga-tracking-id":i,children:e})}Ke.propTypes={value:a.string.isRequired,children:a.node.isRequired,isDisabled:a.bool,gaTrackingId:a.string};const Nn=(t,e,n)=>{if(t[e]!=null){const i=typeof t[e],r=!!t.multiple;if(r&&!Array.isArray(t[e]))return new Error(`Invalid prop \`${e}\` of type \`${i}\` supplied to \`${n}\`, expected \`array\``);if(!r&&i!=="string")return new Error(`Invalid prop \`${e}\` of type \`${i}\` supplied to \`${n}\`, expected \`string\``)}return null};class Vs extends m.PureComponent{constructor(e){super(e),this.getSelectSize=()=>{const{size:n,multiple:i}=this.props,r=parseInt(String(n),10);return r||r>=0?r:i?4:1},this.handleChangeForOnlyOption=()=>{const{options:n,onChange:i,id:r,name:o,shouldAutoSelectIfOnlyOneOption:l}=this.props;if(l&&i&&!this.singleOptionHasCalledOnChange&&n?.length){this.singleOptionHasCalledOnChange=!0;const c={target:{value:n[0].value,id:r,name:o}};i(c)}},this.handleChange=n=>{const{onChange:i}=this.props,{isInvalid:r}=this.state,o=n.target.selectedOptions[0],l=o.value,c=o.getAttribute("data-ga-tracking-id");c&&(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"selectChange",gaTrackingId:c,value:l})),r&&this.setState({isInvalid:!1}),i&&i(n)},this.validate=()=>{const{id:n,isRequired:i}=this.props,{errorText:r}=this.state;let o;const l={isInvalid:!1,errorText:null,id:n};return typeof this.selectRef=="object"?o=this.selectRef.current.value:o=this.selectRef.value,i&&!o?(l.isInvalid=!0,l.errorText=r,this.setState({isInvalid:!0})):this.setState({isInvalid:!1}),l},this.renderOptions=()=>{const{options:n,gaTrackingId:i}=this.props;return n?.map(r=>s.jsx(Ke,{value:r.value,gaTrackingId:i,children:r.label},r.value))},this.state={isInvalid:this.props.isInvalid||!1,errorText:e.errorText||`${e.label} is required.`},this.selectRef=e.innerRef||m.createRef(),this.singleOptionHasCalledOnChange=!1}static{this.propTypes={id:a.string.isRequired,label:a.node.isRequired,isLabelVisible:a.bool,isRequired:a.bool,isDisabled:a.bool,isInline:a.bool,placeholder:a.string,errorText:a.node,isInvalid:a.bool,value:Nn,onChange:a.func,defaultValue:Nn,children:a.node,innerRef:a.oneOfType([a.object,a.func]),name:a.string,options:a.arrayOf(a.shape({label:a.node,value:a.string})),className:a.string,multiple:a.bool,size:a.number,shouldAutoSelectIfOnlyOneOption:a.bool,shouldRenderTextIfOnlyOneOption:a.bool,isLoading:a.bool,gaTrackingId:a.string,translate:a.oneOf(["yes","no"])}}static{this.defaultProps={defaultValue:"",isLabelVisible:!0,isDisabled:!1,isRequired:!1,isInline:!1,isInvalid:!1,multiple:!1,shouldAutoSelectIfOnlyOneOption:!1,shouldRenderTextIfOnlyOneOption:!1,isLoading:!1}}componentDidMount(){const{options:e}=this.props;e?.length===1&&this.handleChangeForOnlyOption()}componentDidUpdate(e){const{isInvalid:n,errorText:i,label:r,options:o}=this.props;typeof n=="boolean"&&n!==e.isInvalid&&this.setState({isInvalid:n}),i!==e.errorText&&this.setState({errorText:i}),r!==e.label&&!i&&this.setState({errorText:`${r} is required.`}),o?.length===1&&this.handleChangeForOnlyOption()}render(){const{id:e,label:n,isLabelVisible:i,isRequired:r,isDisabled:o,isInline:l,placeholder:c,children:d,value:u,defaultValue:f,options:g,className:h,multiple:p,shouldRenderTextIfOnlyOneOption:b,isLoading:x,translate:y,...v}=this.props,w=Kt(v,["errorText","isInvalid","onChange","innerRef","size","shouldAutoSelectIfOnlyOneOption","gaTrackingId","translate"]),{errorText:C,isInvalid:T}=this.state,I=Array.isArray(g)&&g.length>0,R=typeof u=="string",S=this.getSelectSize();return x?s.jsx(Wt,{height:"4rem",width:"auto"}):s.jsxs("div",{"data-component":"Select",className:N(h,{"sarsa-field-outer-container":!l,"sarsa-field-outer-container-inline":l}),children:[s.jsx("div",{className:"sarsa-field-label-wrapper",children:s.jsx(it,{htmlFor:e,isVisible:i,isRequired:r,children:n})}),s.jsx("div",{className:"sarsa-field-inner-container",children:s.jsx("div",{className:N("sarsa-field-input-wrapper",{inline:l,"no-label":!i}),children:b&&g?.length===1?s.jsx(ut,{id:e,alignY:"center",padding:"xs",border:"gray",background:"gray-2",style:{height:"auto",opacity:"0.7"},translate:y,children:s.jsx(re,{children:g[0].label})}):s.jsxs("select",{className:N("sarsa-select",{"is-invalid":T}),id:e,defaultValue:R?void 0:f,value:u,onChange:this.handleChange,disabled:o,multiple:p,size:S,required:r,"aria-invalid":this.state.isInvalid,"aria-describedby":this.state.isInvalid&&C?`${e}-error`:void 0,ref:this.selectRef,translate:y,...w,children:[!p&&c&&s.jsx(Ke,{value:"",isDisabled:!0,children:c}),I&&this.renderOptions(),d]})})}),T&&C&&s.jsxs("div",{id:`${e}-error`,className:"sarsa-field-error-message",children:[s.jsx("span",{className:"req","aria-hidden":"true",children:"*"}),C]})]})}}class kh extends K.PureComponent{static propTypes={search:a.func,error:a.string};constructor(e){super(e),this.state={searchType:"email",searchTerm:""}}handleSearchTypeChange=e=>{const n=e.target.value;this.setState({searchType:n})};handleSearchTermChange=e=>{const n=e.target.value;this.setState({searchTerm:n})};search=e=>{e.preventDefault(),this.props.search(this.state.searchType,this.state.searchTerm)};render(){let e=null;return this.props.error&&(e=s.jsx("div",{className:"mb-2",children:s.jsx(Sr,{type:"error",children:this.props.error})})),s.jsxs("form",{onSubmit:this.search,children:[e,s.jsxs(fe,{alignItems:"end",children:[s.jsx(J,{children:s.jsxs(Vs,{id:"search-type",label:"Search Type",value:this.state.searchType,onChange:this.handleSearchTypeChange,placeholder:"Choose an option",children:[s.jsx(Ke,{value:"email",children:"Email"}),s.jsx(Ke,{value:"phone",children:"Phone"})]})}),s.jsx(J,{xs:8,children:s.jsx(pe,{id:"search-term",label:"Search Term",value:this.state.searchTerm,onChange:this.handleSearchTermChange,hasClearButton:!0})}),s.jsx(J,{children:s.jsx(k,{type:"submit",children:"Search"})})]})]})}}const ta=a.shape({xs:a.number,sm:a.number,md:a.number,lg:a.number,xl:a.number}),_h={width:a.oneOfType([a.number,ta]),push:a.oneOfType([a.number,ta]),shift:a.oneOfType([a.number,ta]),className:a.string,children:a.node},sa=["xs","sm","md","lg","xl"];function ga({width:t=12,push:e=null,shift:n=null,className:i="",children:r,...o}){const[l,c]=m.useState("");return m.useEffect(()=>{c((()=>{const u=["rec-grid-col"];i!==""&&u.push(i);let f=!1;if(typeof t=="object"&&sa.forEach(g=>{const h=t[g];typeof h=="number"&&h>=1&&h<=12&&(u.push(`rec-grid-${g}-${h}-12`),f=!0)}),typeof t=="number"||!f)switch(!0){case(typeof t=="number"&&t>=1&&t<=12):u.push(`rec-grid-xs-${t}-12`);break;default:u.push("rec-grid-xs-12-12");break}return e!==null&&(typeof e=="number"?e>=1&&e<=12?u.push(`rec-grid-push-xs-${e}-12`):e<=-1&&e>=-12&&u.push(`rec-grid-pull-xs-${-1*e}-12`):sa.forEach(g=>{const h=e[g];typeof h=="number"&&(h>=1&&h<=12?u.push(`rec-grid-push-${g}-${h}-12`):h<=-1&&h>=-12&&u.push(`rec-grid-pull-${g}-${-1*h}-12`))})),n!==null&&(typeof n=="number"?n>=1&&n<=12?u.push(`rec-grid-shift-xs-${n}-12`):n<=-1&&n>=-12&&u.push(`rec-grid-unshift-xs-${-1*n}-12`):sa.forEach(g=>{const h=n[g];typeof h=="number"&&(h>=1&&h<=12?u.push(`rec-grid-shift-${g}-${h}-12`):h<=-1&&h>=-12&&u.push(`rec-grid-unshift-${g}-${-1*h}-12`))})),u.join(" ")})())},[t,e,n,i]),s.jsx("div",{className:l,...o,children:r})}ga.propTypes=_h;function Nr({className:t,children:e,...n}){const i=["rec-nested-wrap",t].filter(r=>!!r).join(" ");return s.jsx("div",{className:i,...n,children:e})}Nr.propTypes={className:a.string,children:a.node};class Ah extends m.PureComponent{constructor(e){super(e),this.validate=()=>this.selectRef.current.validate(),this.countryOptions=Wd.sort((n,i)=>n.labeli.label?1:0),this.selectRef=m.createRef()}static{this.propTypes={id:a.string.isRequired,label:a.node,placeholder:a.string}}static{this.defaultProps={label:"Country",placeholder:"Choose a country ..."}}render(){const{label:e,id:n,placeholder:i,...r}=this.props,o=Kt(r,["ref"]);return s.jsxs(Vs,{ref:this.selectRef,label:e,id:n,placeholder:i,...o,children:[Gd.map(l=>s.jsx(Ke,{value:l.value,children:l.label},l.value)),s.jsx(Ke,{value:"divider",isDisabled:!0,children:"─────────"}),this.countryOptions.map(l=>s.jsx(Ke,{value:l.value,children:l.label},l.value))]})}}class Mh extends m.PureComponent{constructor(e){super(e),this.getStateOptions=()=>{const{hasTerritories:n,hasArmedForces:i}=this.props;let r=[...zd];return n&&(r=[...r,...Kd]),i&&(r=[...r,...Yd]),r.sort((o,l)=>o.labell.label?1:0)},this.validate=()=>this.selectRef.current.validate(),this.state={stateOptions:this.getStateOptions()},this.selectRef=m.createRef()}static{this.propTypes={id:a.string.isRequired,label:a.node,hasTerritories:a.bool,hasArmedForces:a.bool,placeholder:a.string,value:a.string,gaTrackingId:a.string}}static{this.defaultProps={label:"State",hasTerritories:!0,hasArmedForces:!0,placeholder:"Choose a state ...",value:void 0}}componentDidUpdate(e){const{hasTerritories:n,hasArmedForces:i}=this.props;(e.hasTerritories!==n||e.hasArmedForces!==i)&&this.setState({stateOptions:this.getStateOptions()})}render(){const{value:e,gaTrackingId:n,id:i,label:r,placeholder:o,...l}=this.props,{stateOptions:c}=this.state,d=Kt(l,["hasTerritories","hasArmedForces"]),f=e===void 0||e===""||c.some(g=>g.value===e)?e:void 0;return s.jsx(Vs,{id:i,label:r,ref:this.selectRef,value:f,gaTrackingId:n,placeholder:o,...d,children:c.map(g=>s.jsx(Ke,{value:g.value,children:g.label},g.value))})}}function Oh(t){const e={isValid:!1,formattedValue:null,errorText:null},n={invalidFormat:"Invalid ZIP/Postal code. ( US: 12345 or 12345-6789. Canada: A1A 1A1 )",invalidStartLetter:"First letter is not valid. Cannot be W or Z",invalidCanadianLetters:"Postal code cannot contain D, F, I, O, Q, or U",invalidChar:"One of these characters is not valid",invalidLength:"Invalid ZIP/Postal Code"};let i="";const r=/^\d{5}$/,o=/^(\d{5})-?(\d{4})$/,l=/^\d+$/,c=/[ABCEGHJ-NPR-TVW-Z]/i,d=/[DFIOQU]/i,u=/^[WZ]/i,f=/[\W\d]/,g=/([ABCEGHJ-NPRSTVXY]\d[ABCEGHJ-NPRSTV-Z]) ?(\d[ABCEGHJ-NPRSTV-Z]\d)/i;if(r.test(t)||o.test(t)||g.test(t))return e.isValid=!0,g.test(t)?t=t.replace(g,"$1 $2").toUpperCase():o.test(t)&&(t=t.replace(o,"$1-$2")),e.formattedValue=t,e;if(typeof t=="string"&&t.length){for(let h=0;hthis.textFieldRef.current?.validate()}static{this.propTypes={id:a.string.isRequired,label:a.node}}static{this.defaultProps={label:"ZIP Code"}}render(){const{id:e,label:n,...i}=this.props;return s.jsx(pe,{ref:this.textFieldRef,id:e,label:n,validator:Oh,shouldReformatValue:!0,maxLength:10,...i})}}class Lh extends K.PureComponent{static propTypes={createAndSelect:a.func,error:a.string};constructor(e){super(e),this.state={firstName:"",lastName:"",cellPhone:"",email:"",country:"USA",address1:"",address2:"",city:"",state:"",zip_code:"",hasNoEmail:!1,addAddress:!1}}handleChange=e=>{const n=e.target.name,i=e.target.value;this.setState({[n]:i})};handleCheckboxChange=e=>{const n=e.target.checked;this.setState({hasNoEmail:n,email:""})};handleAddressChange=e=>{const n=e.target.checked;n||this.setState({country:"USA",address1:"",address2:"",city:"",state:"",zip_code:""}),this.setState({addAddress:n})};create=e=>{e.preventDefault();const{addAddress:n,country:i,address1:r,address2:o,city:l,state:c,zip_code:d}=this.state;let u=!1;(ve(i)||ve(r)||ve(l)||ve(c)||ve(d)||!ve(l)&&!ca(l,/^[a-zA-Z\- ]+$|^$/)||!ve(c)&&!ca(c,/^[a-zA-Z\- ]+$|^$/))&&(u=!0),n&&u||this.props.createAndSelect(this.state.firstName,this.state.lastName,this.state.cellPhone,this.state.email,this.state.hasNoEmail,{country:i,address1:r,address2:o,city:l,state:c,zip_code:d},n)};render(){let e=null;this.props.error&&(e=s.jsx("div",{className:"mb-2",children:s.jsx(Sr,{type:"error",children:this.props.error})}));let n=s.jsx(pe,{id:"state",name:"state",label:"State/Province",value:this.state.state||"",isRequired:!0,placeholder:"Required",onChange:this.handleChange}),i=s.jsx(pe,{id:"zip-input",name:"zip_code",label:"ZIP/Postal Code",value:this.state.zip_code||"",isRequired:!0,placeholder:"Required",onChange:this.handleChange});return this.state.country==="USA"&&(n=s.jsx(Mh,{id:"state",name:"state",label:"State",value:this.state.state,isRequired:!0,placeholder:"Required",onChange:this.handleChange}),i=s.jsx(Ph,{id:"zip-input",name:"zip_code",label:"ZIP Code",value:this.state.zip_code||"",isRequired:!0,placeholder:"Required",onChange:this.handleChange})),s.jsxs("form",{onSubmit:this.create,children:[e,s.jsx("div",{className:"mb-2",children:s.jsx(pe,{id:"first-name",label:"First Name",name:"firstName",isRequired:!0,value:this.state.firstName,onChange:this.handleChange})}),s.jsx("div",{className:"mb-2",children:s.jsx(pe,{id:"last-name",label:"Last Name",name:"lastName",isRequired:!0,value:this.state.lastName,onChange:this.handleChange})}),s.jsx("div",{className:"mb-2",children:s.jsx(xr,{id:"cell-phone",label:"Phone Number",name:"cellPhone",isRequired:!0,value:this.state.cellPhone,onChange:this.handleChange})}),s.jsx("div",{className:"mb-2",children:s.jsx(za,{id:"email",label:"Email",name:"email",value:this.state.email,onChange:this.handleChange,isDisabled:this.state.hasNoEmail})}),this.state.addAddress&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mb-2",children:s.jsx(Ah,{id:"country",name:"country",isInvalid:ve(this.state.country),isRequired:!0,value:this.state.country,onChange:this.handleChange})}),s.jsx("div",{className:"mb-2",children:s.jsx(pe,{id:"street-input",name:"address1",label:"Street Address",value:this.state.address1||"",isRequired:!0,placeholder:"Required",onChange:this.handleChange})}),s.jsx("div",{className:"mb-2",children:s.jsx(pe,{id:"apt-input",name:"address2",label:"Apt or Suite Number",value:this.state.address2||"",maxLength:100,onChange:this.handleChange})}),s.jsx("div",{className:"mb-2",children:s.jsx(pe,{id:"city-input",name:"city",label:"City",maxLength:100,value:this.state.city||"",isRequired:!0,placeholder:"Required",onChange:this.handleChange})}),s.jsx("div",{className:"mb-2",children:s.jsxs(Nr,{children:[s.jsx(ga,{className:"acct-cell-auto",width:{xs:12,sm:6},children:n}),s.jsx(ga,{className:"acct-cell-auto",width:{xs:12,sm:6},children:i})]})})]}),s.jsx("div",{className:"mb-2",children:s.jsx(Cs,{id:"hasNoEmail",label:"Customer does not have an email address.",name:"hasNoEmail",value:"hasNoEmail",isChecked:this.state.hasNoEmail,onChange:this.handleCheckboxChange})}),s.jsx("div",{className:"mb-2",children:s.jsx(Cs,{id:"addAddress",label:"Add customer address.",name:"addAddress",value:"addAddress",isChecked:this.state.addAddress,onChange:this.handleAddressChange})}),s.jsx("div",{children:s.jsx(k,{type:"submit",children:"Create and Select"})})]})}}class $h extends K.PureComponent{static propTypes={isOpen:a.bool,onRequestClose:a.func,csrSelectCustomer:a.func};constructor(e){super(e),this.state={selectType:"existing",results:[],searchError:"",newCustomerError:""}}handleSelectTypeChange=e=>{const n=e.target.value;this.setState({selectType:n})};search=(e,n)=>{this.setState({searchError:""},()=>{const i={};e==="email"?i.email=n:i.phone=n,le.get("/api/accounts/internal/search",{headers:{Authorization:xs()},params:i}).then(o=>{let l=[],c="";if(o.data.account.account_id){const d=o.data.account;l.push(d)}else o.data.results.length>0?l=o.data.results:c="There are no results for this search term";this.setState({results:l,searchError:c,newCustomerError:""})}).catch(o=>{const l=o.response;let c="An unexpected error occurred, please try again later";l.status===400&&(c=l.data.error),this.setState({searchError:c})})})};createAndSelect=(e,n,i,r,o,l,c)=>{this.setState({newCustomerError:""},()=>{const d=i.replace(/[^\d+]/gi,"");let u=r;o&&(u=`${d}@recreation.gov`);const f={first_name:e,last_name:n,email:u,cell_phone:d};c&&(f.home_address=l),le.post("/api/accounts/internal/account",f,{headers:{Authorization:xs()}}).then(h=>{const p=h.data.account_id;this.select(p)}).catch(h=>{const p=h.response;let b="An unexpected error occurred, please try again later";p.status===400&&(b=p.data.error),this.setState({newCustomerError:b})})})};select=e=>{this.props.csrSelectCustomer(e),this.props.onRequestClose()};clear=()=>{this.setState({selectType:"existing",results:[],searchError:"",newCustomerError:""})};render(){let e=s.jsx(kh,{search:this.search,error:this.state.searchError});return this.state.selectType==="new"&&(e=s.jsx(Lh,{createAndSelect:this.createAndSelect,error:this.state.newCustomerError})),this.state.results.length>0&&(e=s.jsx(jh,{results:this.state.results,select:this.select})),s.jsxs(es,{size:"lg",isOpen:this.props.isOpen,heading:"Select Customer",onRequestClose:this.props.onRequestClose,children:[s.jsx("div",{className:"mb-2",children:s.jsxs(Th,{name:"select-type-group",value:this.state.selectType,onChange:this.handleSelectTypeChange,className:"nav-select-customer-modal-radio",isInline:!0,children:[s.jsx(Sn,{id:"existing",label:"Existing User",value:"existing"}),s.jsx(Sn,{id:"new",label:"New User",value:"new"})]})}),e,s.jsx(Ut,{children:s.jsxs(jt,{isFullWidthOnMobile:!1,isStretchedToFit:!0,children:[s.jsx(k,{appearance:"tertiary",onClick:this.props.onRequestClose,children:"Cancel"}),s.jsx(k,{appearance:"tertiary",onClick:this.clear,children:"Clear"})]})})]})}}class Tr extends m.Component{generateIcon(e){switch(e){case"warning":return s.jsx(j,{iconName:"warning"});case"info":return s.jsx(j,{iconName:"info"});case"success":return s.jsx(j,{iconName:"check-circle"});case"error":return s.jsx(j,{iconName:"error"});default:return s.jsx(j,{iconName:"info"})}}render(){const e=this.generateIcon(this.props.noticeType);let n="";this.props.showNotice||(n="hide");let i="";return this.props.showClose||(i="hide"),s.jsx("div",{"data-testid":"notice-wrapper",className:n,children:s.jsxs("div",{className:`rec-notification-${this.props.noticeType}`,children:[s.jsx("span",{className:"rec-notification-icon",children:e}),s.jsx("div",{className:"rec-notification-body",children:this.props.children}),s.jsx("button",{type:"button",className:`rec-notification-close ${i}`,onClick:this.props.closeNotice,"aria-label":"Close notification",children:s.jsx(j,{iconName:"close",className:"rec-icon-close"})})]})})}}const Dh=["allowfullScreen","async","autoplay","capture","checked","controls","default","defer","disabled","formnovalidate","hidden","loop","multiple","muted","novalidate","open","playsinline","readonly","required","reversed","scoped","seamless","selected","itemscope"],Fh={accept:"accept","accept-charset":"acceptCharset",accesskey:"accessKey",action:"action",allowfullscreen:"allowFullScreen",allowtransparency:"allowTransparency",alt:"alt",as:"as",async:"async",autocomplete:"autoComplete",autoplay:"autoPlay",capture:"capture",cellpadding:"cellPadding",cellspacing:"cellSpacing",charset:"charSet",challenge:"challenge",checked:"checked",cite:"cite",classid:"classID",class:"className",cols:"cols",colspan:"colSpan",content:"content",contenteditable:"contentEditable",contextmenu:"contextMenu",controls:"controls",controlsList:"controlsList",coords:"coords",crossorigin:"crossOrigin",data:"data",datetime:"dateTime",default:"default",defer:"defer",dir:"dir",disabled:"disabled",download:"download",draggable:"draggable",enctype:"encType",form:"form",formaction:"formAction",formenctype:"formEncType",formmethod:"formMethod",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",headers:"headers",height:"height",hidden:"hidden",high:"high",href:"href",hreflang:"hrefLang",for:"htmlFor","http-equiv":"httpEquiv",icon:"icon",id:"id",inputmode:"inputMode",integrity:"integrity",is:"is",keyparams:"keyParams",keytype:"keyType",kind:"kind",label:"label",lang:"lang",list:"list",loop:"loop",low:"low",manifest:"manifest",marginheight:"marginHeight",marginwidth:"marginWidth",max:"max",maxlength:"maxLength",media:"media",mediagroup:"mediaGroup",method:"method",min:"min",minlength:"minLength",multiple:"multiple",muted:"muted",name:"name",nonce:"nonce",novalidate:"noValidate",open:"open",optimum:"optimum",pattern:"pattern",placeholder:"placeholder",playsinline:"playsInline",poster:"poster",preload:"preload",profile:"profile",radiogroup:"radioGroup",readonly:"readOnly",referrerpolicy:"referrerPolicy",rel:"rel",required:"required",reversed:"reversed",role:"role",rows:"rows",rowspan:"rowSpan",sandbox:"sandbox",scope:"scope",scoped:"scoped",scrolling:"scrolling",seamless:"seamless",selected:"selected",shape:"shape",size:"size",sizes:"sizes",slot:"slot",span:"span",spellcheck:"spellCheck",src:"src",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",start:"start",step:"step",style:"style",summary:"summary",tabindex:"tabIndex",target:"target",title:"title",type:"type",usemap:"useMap",value:"value",width:"width",wmode:"wmode",wrap:"wrap",about:"about",datatype:"datatype",inlist:"inlist",prefix:"prefix",property:"property",resource:"resource",typeof:"typeof",vocab:"vocab",autocapitalize:"autoCapitalize",autocorrect:"autoCorrect",autosave:"autoSave",color:"color",itemprop:"itemProp",itemscope:"itemScope",itemtype:"itemType",itemid:"itemID",itemref:"itemRef",results:"results",security:"security",unselectable:"unselectable"},Bh=/^[a-zA-Z][a-zA-Z:_.\-\d]*$/,aa={};function jr(t){return Object.hasOwn(aa,t)||(aa[t]=Bh.test(t)),aa[t]}const Vh=(t,e)=>(Dh.map(i=>i.toLowerCase()).indexOf(t.toLowerCase())>=0&&(e=t),e);function Hh(t){return Object.keys(t).filter(e=>jr(e)).reduce((e,n)=>{const i=n.toLowerCase(),r=Fh[i]||i;return e[r]=Vh(r,t[n]),e},{})}function Uh(t=""){return t===""?{}:t.split(";").reduce((e,n)=>{let[i,r]=n.split(/^([^:]+):/).filter((o,l)=>l>0).map(o=>o.trim().toLowerCase());return r===void 0||(i=i.replace(/^-ms-/,"ms-").replace(/-(.)/g,(o,l)=>l.toUpperCase()),e[i]=r),e},{})}function Rr(t){const e=Object.assign({},Hh(t));return typeof e.style=="string"||e.style instanceof String?e.style=Uh(e.style):delete e.style,e}function qh(t,e){let n;t.children.length>0&&(n=t.children[0].data);const i=Rr(t.attribs);return K.createElement("style",i,n)}const Gh=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"];function Wh(t){return t.type==="text"&&/\r?\n/.test(t.data)&&t.data.trim()===""}function zh(t,e){return t.filter(n=>!Wh(n)).map((n,i)=>{let r;return typeof e=="function"&&(r=e(n,i),r===null||r)?r:We(n,i,e)})}function Kh(t,e,n){const i=t.name;if(!jr(i))return null;const r=Rr(t.attribs);let o=null;return Gh.indexOf(i)===-1&&(o=zh(t.children,n)),m.createElement(i,r,o)}function Yh(t){return t.data}function Pt(){return null}const Zh={[Po]:Yh,[Oo]:Kh,[Mo]:qh,[Ao]:Pt,[_o]:Pt,[ko]:Pt,[Eo]:Pt,[Io]:Pt};function We(t,e,n){return Zh[t.type](t,e,n)}function Jh({isOpen:t,onModalCancel:e,onModalContinue:n,gaTrackingIdCancelButton:i,gaTrackingIdContinueButton:r,parentSelector:o}){return s.jsxs(es,{size:"lg",isOpen:t,heading:"You are leaving Recreation.gov",onRequestClose:e,shouldShowCloseButton:!1,parentSelector:o,shouldActionsStickInMobile:!0,children:[s.jsxs("p",{children:["You are leaving the ","Recreation.gov"," website and entering an external or third-party site. This link has been provided because it contains relevant information that may be useful or interesting. This does not constitute endorsement, recommendation, or favoring by"," ","Recreation.gov",". These external links are for reference only, and"," ","Recreation.gov"," cannot attest to the accuracy of information provided by third-party sites or any other linked site outside its control."]}),s.jsx(Ut,{children:s.jsxs(jt,{isFullWidthOnMobile:!1,isStretchedToFit:!0,children:[s.jsx(k,{appearance:"tertiary",onClick:e,gaTrackingId:i,children:"Cancel"}),s.jsx(k,{onClick:n,gaTrackingId:r,children:"Continue to External Web Site"})]})})]})}function Ir({className:t,hasExternalIcon:e=!0,url:n,children:i,gtmDataId:r,clickTagCategory:o,clickTagAction:l,clickTagLabel:c,gaTrackingId:d,gaTrackingIdContinueButton:u,gaTrackingIdCancelButton:f,parentSelector:g,"aria-label":h,onClick:p}){const[b,x]=m.useState(!1),y=C=>{C.preventDefault(),x(!0),p&&p(C)},v=()=>{x(!1)},w=()=>{Object.assign(document.createElement("a"),{target:"_blank",href:n,rel:"noopener noreferrer"}).click(),o&&l&&c&&Ge({category:o,action:l,label:c},()=>{}),x(!1)};return s.jsxs(s.Fragment,{children:[s.jsx("a",{className:N(t,{"sarsa-button-external-link":!e}),href:n,target:"_blank",rel:"noopener noreferrer",onClick:y,"data-gtmclick":r,"aria-label":h,"data-ga-tracking-id":d,children:i}),s.jsx(Jh,{isOpen:b,onModalCancel:v,onModalContinue:w,gaTrackingIdCancelButton:f,gaTrackingIdContinueButton:u,parentSelector:g})]})}var Xh=["recreation.gov","help.recreation.gov","help.r1s-test.com","help.r1s-dev.com"];const Tn=Xh||[];let ht=0;function Er(t){if(!t||typeof t!="string")return!1;for(let e=0;e`https://cdn.recreation.gov/${c}.pdf`);const r=t;return r.attribs.rel="noopener noreferrer",r.attribs.target="_blank",r.attribs.target="_blank",r.attribs.href=n,We(r,e,bs)}return t.children&&t.children[0]?s.jsx(Ir,{url:n,children:We(t.children[0])}):null}if(t.type==="text"&&t.data===" ")return null;if(t.type==="tag"&&(t.name==="font"||t.attribs?.style||t.attribs?.color)){const n={...t};return t.name==="font"&&(n.name="span"),delete n.attribs.style,delete n.attribs.color,We(n,ht,bs)}}function vs(t){ht+=1;const e=ht;if(t.type==="text"&&!t.parent)return s.jsx("span",{children:We(t,e,vs)});if(t.type==="tag"&&t.name==="br")return" ";if(t.type==="tag"&&t.name==="a"){let n=t.attribs.href;if(Er(n)){const i=ai("recreation.gov");n=n.replace(new RegExp(`(.*?).${i}/(.*?).pdf`),(o,l,c)=>`https://cdn.recreation.gov/${c}.pdf`);const r=t;return r.attribs.rel="noopener noreferrer",r.attribs.target="_blank",r.attribs.href=n,We(r,e,vs)}return t.children&&t.children[0]?s.jsx(Ir,{url:n,children:We(t.children[0])}):null}if(t.type==="text"&&t.data===" ")return null;if(t.type==="tag"&&(t.name==="font"||t.attribs?.style||t.attribs?.color)){const n={...t};return t.name==="font"&&(n.name="span"),delete n.attribs.style,delete n.attribs.color,We(n,ht,vs)}}function Xe({html:t,shouldConvertImageSrcToHttps:e=!0,headingLevel:n,headingAppearance:i}){if(typeof t!="string")return null;ht=0;let r=ci.sanitize(t);return e&&(r=r.split('src="http://').join('src="https://')),n&&(r=r.replace(/(<\/?h)(\d)\b/g,`$1${n}`)),i&&(r=r.replace(/")||t.includes("
")?s.jsx("div",{"data-component":"DisplayHtmlContent",children:da(r,{replace:l=>l?.type?bs(l):null})}):s.jsx("div",{"data-component":"DisplayHtmlContent",className:"rec-display-html-content",children:da(r,{replace:l=>l?.type?vs(l):null})})}Xe.propTypes={html:a.string,shouldConvertImageSrcToHttps:a.bool,headingLevel:a.oneOf([1,2,3,4,5,6]),headingAppearance:a.oneOf(["display","h1","h2","h3","h4","h5","h6"])};class Qh extends K.Component{static propTypes={errorText:a.any,create:a.func,reset:a.func,confirmSignIn:a.func,mfaRequired:a.bool,mfaValidation:a.bool,loginNotice:ur,siteName:a.string,children:a.element};static defaultProps={siteName:"Recreation.gov"};constructor(e){super(e),this.state={email:"",password:"",processing:!1,noticedClosed:!1,focusAlertContainer:!1},this.emailTextChange=this.emailTextChange.bind(this),this.passwordTextChange=this.passwordTextChange.bind(this),this.submitForm=this.submitForm.bind(this)}componentDidUpdate(e){const{errorText:n}=this.props;Ta(n,e.errorText)||this.focusAlertContainer()}closeNotice=()=>{this.setState({noticedClosed:!0})};focusAlertContainer=()=>{this.setState({focusAlertContainer:!0})};async submitForm(e){e.preventDefault(),this.setState({processing:!0,focusAlertContainer:!1});try{this.props.confirmSignIn({email:this.state.email,password:this.state.password})}catch(n){console.error(n)}}passwordTextChange(e){this.setState({password:e.target.value})}emailTextChange(e){this.setState({email:e.target.value})}render(){let e=null,n=this.state.processing;(this.props.errorText||this.props.mfaRequired)&&(n=!1),this.props.errorText&&(e=s.jsx(xe,{role:"alert",type:"error",className:"mb-2 rec-sign-error",shouldFocusOnMount:this.state.focusAlertContainer,children:this.props.errorText}));let i=null;this.props.mfaRequired&&(i=s.jsx(xe,{type:"warning",className:"mb-2",shouldFocusOnMount:!0,children:"We don't recognize the device you're trying to login from. Please check your email to verify your identity and authorize this device."}));let r=null,o=null,l=null;this.props.mfaValidation?r=s.jsx(xe,{type:"success",className:"mb-2",shouldFocusOnMount:!0,children:"Your device has been successfully validated, please log in to complete this process."}):(o=s.jsx(k,{appearance:"link",onClick:this.props.reset,shouldFitContainer:!0,className:"mb-3",children:"Forgot Your Password?"}),l=s.jsx(ut,{background:"light-blue",marginY:"md",children:s.jsxs(re,{className:"py-1",align:"center",children:["New to ",s.jsx("span",{translate:"no",children:this.props.siteName}),"?"," ",s.jsx(k,{appearance:"link",onClick:this.props.create,className:"pb-fourth",children:"Create an account."})]})}));let c=null;if(this.props.loginNotice?.notice_enabled){let h="";try{h=decodeURIComponent(this.props.loginNotice.notice_body)}catch(p){console.error(p),h="",this.setState({noticedClosed:!0})}c=s.jsx("div",{className:"rec-legacy-users-message",children:s.jsxs(Tr,{noticeType:"warning",showNotice:!this.state.noticedClosed,closeNotice:this.closeNotice,showClose:!0,children:[s.jsx("div",{className:"h6",children:this.props.loginNotice.notice_title}),s.jsx(Xe,{html:h})]})})}let d={md:12,mdOffset:null,xsOrder:null,mdOrder:null},u={className:"hide"},f={className:"hide"},g={md:12,mdOffset:null};return!this.state.noticedClosed&&this.props.loginNotice?.notice_enabled&&(d={md:5,xsOrder:3,mdOrder:1},u={md:1,mdOrder:2,className:"rec-acct-modal-split-line-wrap"},f={md:6,alignSelf:"center",xsOrder:1,mdOrder:3},g={md:12,mdOffset:null}),s.jsxs(s.Fragment,{children:[s.jsx(ae,{headingLevel:1,appearance:"display",className:"rec-acct-modal-title",id:"signInModalHeading",headingAlign:"center",children:"Log In"}),this.props.children,s.jsxs(fe,{children:[s.jsxs(J,{...g,children:[l,e,i,r]}),s.jsxs(J,{...d,children:[s.jsxs("form",{noValidate:!0,onSubmit:this.submitForm,children:[s.jsx("div",{className:"form-item-wrap",children:s.jsx(za,{id:"email",label:"Email",name:"email",onChange:h=>this.emailTextChange(h),className:"rec-acct-email",isRequired:!0,shouldFocusOnMount:!0})}),s.jsx("div",{className:"form-item-wrap mb-1",children:s.jsx(pe,{id:"rec-acct-sign-in-password",label:"Password",type:"password",onChange:h=>this.passwordTextChange(h),className:"rec-acct-password",autoComplete:"off",enableShowPassword:!0,isRequired:!0})}),s.jsxs(re,{size:"sm",color:"gray",className:"mb-4",children:[s.jsx("strong",{children:"Attention:"})," Required fields are marked with an asterisk (*) and must be filled in to complete the form."]}),s.jsx(k,{shouldFitContainer:!0,size:"lg",type:"submit",className:"rec-acct-sign-in-btn my-1",disabled:n,isLoading:n,children:"Log In"})]}),o,s.jsxs(re,{size:"sm",color:"gray",align:"center",className:"mb-4",children:["By logging in, I accept ",this.props.siteName,"'s ",s.jsx("a",{href:"https://www.recreation.gov/disclaimers",children:"Terms of Use"})," ","and"," ",s.jsx("a",{href:"https://www.recreation.gov/privacy-policy",children:"Privacy Policy"}),"."]})]}),s.jsx(J,{...u,children:s.jsx("div",{className:"rec-acct-modal-split-line"})}),s.jsx(J,{...f,children:c})]})]})}}function ep({onCreateAccountClick:t,onResetPasswordClick:e,login:n,serverError:i,isLockedOut:r,isMfaRequired:o,isMfaValidated:l,loginNotice:c,siteName:d="Recreation.gov",hasError:u=!1,showCaptchaMessage:f=!0,redirectUrl:g=Xi(),children:h}){const[p,b]=m.useState(null),x=({email:T,password:I})=>{if(T.length<1||I.length<1)b("All fields are required.");else{b(null);const R={username:T,password:I,userAgent:navigator.userAgent,redirectUrl:g};n(R)}},y=s.jsx(k,{appearance:"link",onClick:e,title:"Reset Password","aria-label":"Reset Password",children:"Reset Password"}),v=s.jsx(k,{appearance:"link",onClick:t,title:"Create an account.","aria-label":"Create an account",children:"Create an account"}),w=u?i==="unknown username"?s.jsxs(s.Fragment,{children:["Sorry, we couldn’t find a ",d," account matching that email address."," ",v]}):s.jsxs(s.Fragment,{children:["Are you sure you have the right email and password? Please double check your email and password, and try again. You can also ",v," ","or ",y,"."]}):void 0,C=r?s.jsxs(s.Fragment,{children:["This account has been locked out for 30 minutes due to three or more failed login attempts. To access your account before then, check your e-mail for a magic login link or ",y,". If you do not receive your magic log in email, please check your spam folder."]}):void 0;return s.jsx(Qh,{errorText:C||w||p,create:t,reset:e,confirmSignIn:x,mfaValidation:l,mfaRequired:o,loginNotice:c,siteName:d,showCaptchaMessage:f,children:h})}function tp({isOpen:t,closeModal:e,account:n,logoElement:i,...r}){return m.useEffect(()=>{n?.access_token&&t&&e()},[n,e,t]),s.jsx(Ye,{role:"complementary",isOpen:t,onRequestClose:e,className:{base:"rec-modal-dialog-base rec-acct-modal rec-acct-sign-in-modal",afterOpen:"rec-modal-dialog-after-open-md",beforeClose:"rec-modal-dialog-before-close"},overlayClassName:"rec-overlay-base",aria:{labelledby:"signInModalHeading"},ariaHideApp:!1,children:s.jsxs("div",{className:"rec-modal-content-wrap",children:[s.jsxs("div",{className:"logo-close-wrap",children:[s.jsx("div",{className:"rec-modal-logo",children:i}),s.jsx(k,{className:"modal-close-button",appearance:"subtle",size:"md","aria-label":"Close modal",iconBeforeElement:s.jsx(j,{iconName:"close"}),onClick:e})]}),s.jsx(fe,{justifyContent:"center",children:s.jsx(J,{sm:8,className:"rec-acct-modal-log-in-body",children:s.jsx(ep,{...r})})}),s.jsxs("div",{className:"rec-captcha-notice",children:["This site is protected by reCAPTCHA and the Google ",s.jsx("a",{href:"https://policies.google.com/privacy",target:"_blank",rel:"noopener noreferrer",children:"Privacy Policy"})," and ",s.jsx("a",{href:"https://policies.google.com/terms",target:"_blank",rel:"noopener noreferrer",children:"Terms of Service"})," ","apply."]})]})})}const sp={errorText:a.string,error:a.any,create:a.func,reset:a.func,confirmSignIn:a.func,mfaRequired:a.bool,mfaValidation:a.bool,siteName:a.string,continueAsGuest:a.func,disableAccountFeatures:a.bool};class ap extends K.Component{static propTypes=sp;constructor(e){super(e),this.state={email:"",password:"",processing:!1},this.emailTextChange=this.emailTextChange.bind(this),this.passwordTextChange=this.passwordTextChange.bind(this),this.submitForm=this.submitForm.bind(this)}componentDidMount(){this.email.focus()}componentDidUpdate(){this.state.processing&&(this.props.error||this.props.errorText||this.props.mfaRequired)&&this.setState({processing:!1})}emailTextChange(e){this.setState({email:e.target.value})}passwordTextChange(e){this.setState({password:e.target.value})}submitForm(e){e.preventDefault(),this.setState({processing:!0}),this.props.confirmSignIn({email:this.state.email,password:this.state.password})}render(){let e=null;(this.props.errorText||this.props.error)&&(e=s.jsx(xe,{type:"error",className:"mb-2",children:this.props.errorText||this.props.error}));let n=null;this.props.mfaRequired&&(n=s.jsx(xe,{type:"warning",className:"mb-2",children:"We don't recognize the device you're trying to login from. Please check your email to verify your identity and authorize this device."}));let i=null,r=null;return this.props.mfaValidation?i=s.jsx(xe,{type:"success",className:"mb-2",children:"Your device has been successfully validated, please log in to complete this process."}):r=s.jsx(ut,{alignX:"center",children:s.jsx(k,{appearance:"link",onClick:this.props.reset,disabled:this.props.disableAccountFeatures,title:"Forgot Password?","aria-label":"Forgot Password",children:"Forgot Password?"})}),s.jsx(fe,{justifyContent:"center",className:"rec-acct-modal-log-in-guest-body",children:s.jsxs(J,{sm:7,children:[s.jsx(ae,{headingLevel:1,appearance:"h2",id:"signInGuestModalHeading",className:"log-in-heading mb-5",children:"Log In Options"}),e,n,i,s.jsxs("div",{children:[s.jsx(ae,{headingLevel:2,appearance:"h5",className:"mb-1",children:"Returning Visitors"}),s.jsxs(re,{align:"left",tag:"div",children:["Sign in to your ",this.props.siteName," account to access your information, see all your reservations, and check out faster."]}),s.jsx("form",{onSubmit:this.submitForm,className:"mt-2 mt-md-5",children:s.jsxs(Rt,{children:[s.jsx(pe,{label:"Email Address",id:"rec-acct-sign-in-email-address",disabled:this.props.disableAccountFeatures,innerRef:o=>{this.email=o},onChange:o=>this.emailTextChange(o),isRequired:!0}),s.jsx(pe,{type:"password",label:"Password",onChange:o=>this.passwordTextChange(o),id:"rec-acct-sign-in-password",autoComplete:"off",enableShowPassword:!0,isRequired:!0,disabled:this.props.disableAccountFeatures}),s.jsx(k,{shouldFitContainer:!0,type:"submit",disabled:this.state.processing||this.props.disableAccountFeatures,isLoading:this.state.processing,children:"Log In"}),s.jsx("div",{children:r})]})}),s.jsx($s,{className:"my-3 my-md-5"}),s.jsxs(ae,{headingLevel:2,appearance:"h5",className:"mb-1",children:["New to ",s.jsx("span",{translate:"no",children:this.props.siteName}),"?"]}),s.jsxs(re,{className:"mb-2",tag:"div",children:[s.jsx(k,{appearance:"link",onClick:this.props.create,disabled:this.props.disableAccountFeatures,className:"create-account-btn",children:"Create an account"}),", or check out as a guest, and sign up for an account later if you're interested."]}),s.jsx(k,{appearance:"secondary",shouldFitContainer:!0,onClick:this.props.continueAsGuest,clickTagCategory:"Guest Checkout",clickTagAction:"Continue as Guest Button",clickTagLabel:`Login Modal - ${window.location.pathname}`,children:"Continue as Guest"})]})]})})}}const np={logoElement:a.element.isRequired,isOpen:a.bool,closeModal:a.func,create:a.func,reset:a.func,login:a.func,guestLogin:a.func,error:a.bool,errorText:a.string,lockout:a.bool,mfaRequired:a.bool,mfaValidation:a.bool,account:At,siteName:a.string},ip={isOpen:!1,closeModal:()=>{},create:()=>{},reset:()=>{},login:()=>{},error:!1,account:null,siteName:"Recreation.gov"};class rp extends K.Component{static propTypes=np;static defaultProps=ip;constructor(e){super(e),this.state={email:"",password:"",error:null},this.afterOpenModal=this.afterOpenModal.bind(this),this.signIn=this.signIn.bind(this),this.confirmSignIn=this.confirmSignIn.bind(this)}componentDidMount(){Ye.setAppElement("body")}componentDidUpdate(e){const{account:n}=this.props;e.account===null&&n&&e.isOpen&&this.props.closeModal()}continueAsGuest=()=>{this.setState({error:null}),this.props.guestLogin()};afterOpenModal(){this.setState({email:"",password:"",error:null})}signIn(){if(this.state.email.length<1||this.state.password.length<1)this.setState({error:s.jsx(s.Fragment,{children:"All fields are required."})});else{this.setState({error:null});const e={username:this.state.email,password:this.state.password,userAgent:navigator.userAgent};this.props.login(e)}}confirmSignIn(e){this.setState({email:e.email,password:e.password,error:null},()=>{this.signIn()})}render(){let e=this.state.error;const n=s.jsx(k,{appearance:"link",onClick:this.props.create,title:"Create an account.","aria-label":"Create an account",children:"Create an account"}),i=s.jsx(k,{appearance:"link",onClick:this.props.reset,title:"Reset Password","aria-label":"Reset Password",children:"Reset Password"});return this.props.errorText==="unknown username"?e=s.jsxs(s.Fragment,{children:["Sorry, we couldn't find a ",this.props.siteName," account matching that email address. ",n]}):this.props.error&&(e=s.jsxs(s.Fragment,{children:["Are you sure you have the right email and password? Please double check your email and password, and try again. You can also"," ",n," or ",i,"."]})),this.props.lockout&&(e=s.jsxs(s.Fragment,{children:["The account has been locked out for 30 minutes due to three or more login attempts. To access your account before then, check your e-mail for a magic log in link or ",i,"."]})),s.jsx(Ye,{role:"complementary",isOpen:this.props.isOpen,onAfterOpen:this.afterOpenModal,onRequestClose:this.props.closeModal,className:{base:"rec-modal-dialog-base rec-acct-modal rec-acct-signin-guest-modal",afterOpen:"rec-modal-dialog-after-open-md ",beforeClose:"rec-modal-dialog-before-close"},overlayClassName:"rec-overlay-base",aria:{labelledby:"signInGuestModalHeading"},ariaHideApp:!1,children:s.jsxs("div",{className:"rec-modal-content-wrap",children:[s.jsxs("div",{className:"logo-close-wrap",children:[s.jsx("div",{className:"rec-modal-logo",children:this.props.logoElement}),s.jsx(k,{className:"modal-close-button",appearance:"subtle",size:"md","aria-label":"Close modal",iconBeforeElement:s.jsx(j,{iconName:"close"}),onClick:this.props.closeModal})]}),s.jsx(ap,{error:e,create:this.props.create,reset:this.props.reset,confirmSignIn:this.confirmSignIn,continueAsGuest:this.continueAsGuest,mfaValidation:this.props.mfaValidation,mfaRequired:this.props.mfaRequired,siteName:this.props.siteName})]})})}}class op extends K.Component{static propTypes={logoElement:a.element.isRequired,cart:a.shape({showSessionWarning:a.bool,expiration:a.string,showTimer:a.bool,reservation_count:a.number,expiresIn:a.number,isExtendingTime:a.bool}),account:At,csrAccount:Va,loginNotice:ur,loginError:a.bool,errorText:a.string,mfaRequired:a.bool,lockout:a.bool,fetchCart:a.func,guestLogin:a.func,login:a.func,resetPasswordWithCode:a.func,completeRegistration:a.func,loginResetState:a.func,logout:a.func,csrSelectCustomer:a.func,showLoginModal:a.bool,showMfaCodeModal:a.bool,showMfaSetupModal:a.bool,showCreateAccountModal:a.bool,showSignInGuestModal:a.bool,showResetModal:a.bool,clearShowLoginModal:a.func,clearShowSignInGuestModal:a.func,showConfirmModal:a.bool,loginAfterPasswordUpdated:a.func,extendTimer:a.func,isHero:a.bool,isGuest:a.bool,verification:a.string,siteName:a.string,isGuestAllowed:a.bool,mfaAfterResetPassword:a.func,onSubmitMfa:a.func,onCloseMfa:a.func};static defaultProps={fetchCart:()=>{},guestLogin:()=>{},login:()=>{},loginResetState:()=>{},logout:()=>{},extendTimer:()=>{},isHero:!1,siteName:"Recreation.gov",isGuestAllowed:!1,onSubmitMfa:async()=>{},onCloseMfa:()=>{}};constructor(e){super(e),this.state={createModalOpen:!1,signInModalOpen:!1,signInGuestModalOpen:!1,selectCustomerModalOpen:!1,resetModalOpen:!1,mfaSetupModalOpen:!1,mfaCodeModalOpen:!1,needsFinalCartWarningModal:!1,confirmModalOpen:!1,confirmToken:"",confirmType:""},this.toggleCreateModalOpen=this.toggleCreateModalOpen.bind(this),this.toggleSignInModalOpen=this.toggleSignInModalOpen.bind(this),this.toggleSignInGuestModalOpen=this.toggleSignInGuestModalOpen.bind(this),this.toggleResetModalOpen=this.toggleResetModalOpen.bind(this),this.toggleConfirmModalOpen=this.toggleConfirmModalOpen.bind(this),this.openLoginModal=this.openLoginModal.bind(this),this.openCreateAccountModal=this.openCreateAccountModal.bind(this),this.openResetModal=this.openResetModal.bind(this),this.openSelectCustomerModal=this.openSelectCustomerModal.bind(this),this.closeSelectCustomerModal=this.closeSelectCustomerModal.bind(this),this.onFinalCartWarningModal=this.onFinalCartWarningModal.bind(this)}componentDidMount(){Be()&&this.props.fetchCart(!0),this.props.showLoginModal&&!this.state.signInModalOpen&&this.openLoginModal(),this.props.showSignInGuestModal&&!this.state.signInGuestModalOpen&&this.openSignInGuestModal(),this.props.showCreateAccountModal&&!this.state.createModalOpen&&this.openCreateAccountModal(),this.props.showResetModal&&!this.state.resetModalOpen&&this.openResetModal(),this.props.showConfirmModal&&!this.state.confirmModalOpen&&this.openConfirmModal()}componentDidUpdate(e){const{showLoginModal:n,showSignInGuestModal:i,showCreateAccountModal:r,showResetModal:o,showMfaCodeModal:l,showMfaSetupModal:c,showConfirmModal:d}=this.props;n&&!e.showLoginModal&&!this.state.signInModalOpen&&this.openLoginModal(),l&&!e.showMfaCodeModal&&!this.state.mfaCodeModalOpen&&this.openMfaCodeModal(),c&&!e.showMfaSetupModal&&!this.state.mfaSetupModalOpen&&this.openMfaSetupModal(),i&&!e.showSignInGuestModal&&!this.state.signInGuestModalOpen&&this.openSignInGuestModal(),r&&!e.showCreateAccountModal&&!this.state.createModalOpen&&this.openCreateAccountModal(),o&&!e.showResetModal&&!this.state.resetModalOpen&&this.openResetModal(),d&&!e.showConfirmModal&&!this.state.confirmModalOpen&&this.openConfirmModal()}onFinalCartWarningModal(){this.setState({needsFinalCartWarningModal:!0})}getSignInHandler(){const{isGuestAllowed:e}=this.props;return e?this.toggleSignInGuestModalOpen:this.toggleSignInModalOpen}openMfaSetupModal=()=>{this.props.clearShowLoginModal(),this.setState({mfaSetupModalOpen:!0,signInModalOpen:!1})};openMfaCodeModal=()=>{this.state.mfaCodeModalOpen||this.props.loginResetState(),this.props.clearShowLoginModal(),this.setState({mfaCodeModalOpen:!0,signInModalOpen:!1})};closeMfaCodeModal=()=>{this.props.onCloseMfa(),this.setState({mfaCodeModalOpen:!1})};closeMfaSetupModal=()=>{this.setState({mfaSetupModalOpen:!1})};closeConfirmModal=()=>{this.setState({confirmModalOpen:!1})};openConfirmModal=()=>{this.setState({mfaCodeModalOpen:!1,confirmModalOpen:!0})};toggleSignInModalOpen(){this.state.signInModalOpen||this.props.loginResetState(),this.setState(e=>({createModalOpen:!1,signInModalOpen:!e.signInModalOpen,signInGuestModalOpen:!1,mfaSetupModalOpen:!1,mfaCodeModalOpen:!1,resetModalOpen:!1}))}toggleSignInGuestModalOpen(){this.state.signInGuestModalOpen||this.props.loginResetState(),this.setState(e=>({createModalOpen:!1,signInModalOpen:!1,mfaCodeModalOpen:!1,mfaSetupModalOpen:!1,signInGuestModalOpen:!e.signInGuestModalOpen,resetModalOpen:!1}))}toggleResetModalOpen(){this.setState(e=>({createModalOpen:!1,signInModalOpen:!1,signInGuestModalOpen:!1,mfaCodeModalOpen:!1,mfaSetupModalOpen:!1,resetModalOpen:!e.resetModalOpen}))}openSelectCustomerModal(){this.setState({selectCustomerModalOpen:!0})}closeSelectCustomerModal(){this.setState({selectCustomerModalOpen:!1})}toggleCreateModalOpen(){this.setState(e=>({createModalOpen:!e.createModalOpen,signInModalOpen:!1,signInGuestModalOpen:!1,mfaSetupModalOpen:!1,mfaCodeModalOpen:!1,resetModalOpen:!1}))}toggleConfirmModalOpen(e,n){this.setState(i=>({confirmModalOpen:!i.confirmModalOpen,signInModalOpen:!1,signInGuestModalOpen:!1,mfaSetupModalOpen:!1,mfaCodeModalOpen:!1,resetModalOpen:!1,createModalOpen:!1,confirmToken:e,confirmType:n}))}openResetModal(){this.setState({resetModalOpen:!0})}openCreateAccountModal(){this.setState({createModalOpen:!0})}openSignInGuestModal(){let e={};this.props.csrAccount?e={selectCustomerModalOpen:!0}:e={signInGuestModalOpen:!0},this.setState(e,this.props.clearShowSignInGuestModal)}openLoginModal(){this.props.csrAccount?this.setState({selectCustomerModalOpen:!0},()=>{this.props.clearShowLoginModal()}):this.setState({signInModalOpen:!0},()=>{this.props.clearShowLoginModal()})}render(){const{isGuestAllowed:e}=this.props,n=this.getSignInHandler();let i=s.jsx(Eu,{isGuestAllowed:e,toggleSignInModalOpen:this.toggleSignInModalOpen,toggleSignInGuestModalOpen:this.toggleSignInGuestModalOpen});(this.props.account||this.props.isGuest)&&(i=s.jsx(Mu,{account:this.props.account,cart:this.props.cart,isGuest:this.props.isGuest,openLoginModal:this.openLoginModal,logout:this.props.logout})),this.props.csrAccount&&(i=s.jsx(ph,{account:this.props.account,csrAccount:this.props.csrAccount,cart:this.props.cart,openSelectCustomerModal:this.openSelectCustomerModal,logout:this.props.logout}));let r=s.jsx(Cu,{sessionWarning:this.props.cart.showSessionWarning,expiration:this.props.cart.expiration,expiresIn:this.props.cart.expiresIn,isExtendingTime:this.props.cart.isExtendingTime,extendTimer:this.props.extendTimer,fetchCart:this.props.fetchCart,onFinalCartWarningModal:this.onFinalCartWarningModal});return(this.props.isHero||!this.props.cart.showTimer&&!this.state.needsFinalCartWarningModal)&&(r=null),s.jsxs("div",{className:"nav-account-panel",children:[i,s.jsx(uh,{isOpen:this.state.createModalOpen,closeModal:this.toggleCreateModalOpen,onConfirmModal:this.toggleConfirmModalOpen,signIn:n,verification:this.props.verification,siteName:this.props.siteName,logoElement:this.props.logoElement}),s.jsx(tp,{isOpen:this.state.signInModalOpen,closeModal:this.toggleSignInModalOpen,onCreateAccountClick:this.toggleCreateModalOpen,onResetPasswordClick:this.toggleResetModalOpen,login:this.props.login,account:this.props.account,hasError:this.props.loginError,serverError:this.props.errorText,isLockedOut:this.props.lockout,isMfaRequired:this.props.mfaRequired,loginNotice:this.props.loginNotice,siteName:this.props.siteName,logoElement:this.props.logoElement}),s.jsx(rp,{isOpen:this.state.signInGuestModalOpen,closeModal:this.toggleSignInGuestModalOpen,create:this.toggleCreateModalOpen,reset:this.toggleResetModalOpen,guestLogin:this.props.guestLogin,login:this.props.login,account:this.props.account,error:this.props.loginError,errorText:this.props.errorText,lockout:this.props.lockout,mfaRequired:this.props.mfaRequired,loginNotice:this.props.loginNotice,siteName:this.props.siteName,logoElement:this.props.logoElement}),s.jsx(Nh,{isOpen:this.state.resetModalOpen,create:this.toggleCreateModalOpen,closeModal:this.toggleResetModalOpen,signIn:n,siteName:this.props.siteName,logoElement:this.props.logoElement}),s.jsx($h,{isOpen:this.state.selectCustomerModalOpen,onRequestClose:this.closeSelectCustomerModal,csrSelectCustomer:this.props.csrSelectCustomer}),s.jsx(vh,{isOpen:this.state.mfaSetupModalOpen,onClose:this.closeMfaSetupModal}),s.jsx(bh,{isOpen:this.state.mfaCodeModalOpen,onSubmit:this.props.onSubmitMfa,onClose:this.closeMfaCodeModal,create:this.toggleCreateModalOpen,reset:this.toggleResetModalOpen,logoElement:this.props.logoElement,account:this.props.account,errorText:this.props.errorText,error:this.props.loginError,lockout:this.props.lockout,siteName:this.props.siteName}),s.jsx(Gu,{isOpen:this.state.confirmModalOpen,closeModal:this.closeConfirmModal,logoElement:this.props.logoElement,loginAfterPasswordUpdated:this.props.loginAfterPasswordUpdated,resetPasswordWithCode:this.props.resetPasswordWithCode,completeRegistration:this.props.completeRegistration,confirmToken:this.state.confirmToken,confirmType:this.state.confirmType,mfaAfterResetPassword:this.props.mfaAfterResetPassword}),s.jsx(pu,{}),r]})}}const Ss="product_view_ga_url",lp=t=>{switch(t){case"camping":return null;case"activitypass":return"ACTIVITYPASS";case"pass":return"PASS";case"permits":return"PERMIT";case"sitepass":return"PARKPASS";case"ticket":return"TICKET";case"timed-entry":return"TIMED_ENTRY";case"tree-permits":return"TREE_PERMIT";case"vehiclepermits":return"VEHICLE_PERMIT";default:return null}},cp=(t,e)=>{const n=e?.length?Number(e?.[e.length-1]?.split("?")?.[0]):void 0,i=Number(e?.[1]?.split("?")?.[0]);switch(t){case"ACTIVITYPASS":if(e?.length===2)return`${e[1]?.split("?")?.[0]}`;break;case"PARKPASS":if(e?.length===2)return`${e[1]?.split("?")?.[0]}`;break;case"PASS":if(e?.length===4&&e[1]==="order-details")return`${e[3]?.split("?")?.[0]}`;break;case"PERMIT":if(e?.length===2&&!Number.isNaN(n))return`${n}`;if(e?.length===4&&e[3].includes("detailed-availability")&&!Number.isNaN(i))return`${i}`;break;case"TICKET":if(e?.length===4&&!Number.isNaN(n)&&!Number.isNaN(i))return`${i}|${n}`;break;case"TIMED_ENTRY":if(e?.length===4&&!Number.isNaN(n)&&!Number.isNaN(i))return`${i}|${n}`;break;case"TREE_PERMIT":if(e?.length===2)return`${e?.[1]?.split("?")?.[0]}`;break;case"VEHICLE_PERMIT":if(e?.length===2&&!Number.isNaN(n))return`${n}`;break;default:return null}return null},jn=(t,e,n)=>{const i=t?.split("/");i.shift();const r=lp(i?.[0]);if(r){const o=cp(r,i);if(o){const c=[Ps({index:1,item_brand:"Recreation.gov",item_id:o,item_name:void 0,agency_name:void 0,state_code:void 0,rec_area_id:void 0,rec_area_name:void 0,facility_id:void 0,facility_name:void 0,inventory_id:void 0,inventory_name:void 0,item_category:r,quantity:void 0,price:void 0})||{}];Ze({event:pa({product_name:void 0,product_price:null,product_list_name:null,items:c}),shouldEnqueueWork:e})}sessionStorage.setItem(Ss,window?.location?.href||"")}else n?.length&&(Ze({event:pa({product_name:void 0,product_price:null,product_list_name:null,items:n}),shouldEnqueueWork:e}),sessionStorage.setItem(Ss,window?.location?.href||""))};function dp({checkForIntersection:t=!1,refForIntersection:e,productsToReportManually:n,shouldEnqueueWork:i=!1}){const[r,o]=m.useState(!1),c=Ba(t&&!o,e),{enableGaForProductView:d}=kt(),u=window.location?.pathname?.split("?")?.[0];if(d&&!r)try{const f=!!window?.dataLayer&&u&&!t,g=t&&e?.current&&c&&!!window?.dataLayer;(f||g)&&(jn(u,i,n),o(!0))}catch(f){console.error("Caught error that needs to be piped to error reporting mechanic",f),o(!0)}return null}const Hs="cart_ga_data",It="cart_ga_remove_from_cart",ba=()=>{localStorage.setItem(Hs,JSON.stringify({reservations:{}})),sessionStorage.removeItem(Ss),sessionStorage.removeItem(It)};function Rn(t="",e=0){const n=t.split("|");return n.length===1?t:n.length>0?e===1&&!n[e]?n[0]:n[e]:t}const up=t=>{let e=t?.order_details?.location_id;const n=t?.inventory_type;if(n)switch(n){case"TICKET":case"TIMED_ENTRY":e+=`|${t?.order_details?.tour_id}`;break;case"CAMPING":case"LOTTERY_CAMPING":e+=`|${t?.order_details?.campsite_id}`;break}return{productId:e,category:n}},hp=t=>{let e=parseInt(t?.quantity||0,10);e||(e=t?.cart_line_items?.filter(l=>So(l.quantity))?.reduce((l,c)=>({quantity:l.quantity+c.quantity}))?.quantity||1);const n=parseFloat(parseFloat(t.discount).toFixed(2)),i=parseFloat(parseFloat(t.subtotal).toFixed(2)),r=parseFloat(parseFloat(((i-n)/e).toFixed(2))),{productId:o}=up(t);return Ps({name:t?.inventory_type==="POS"?t?.order_details?.name:t?.order_details?.description,facility_id:Rn(o,0),location_id:Rn(o,1),quantity:e,price:r})},kr=(t,e,n)=>(n?delete e.reservations[t.reservation_id]:e.reservations[t.reservation_id]=ni(t),hp(t)),pp=(t,e,n)=>{if(Ee(n?.reservations)||Object.keys(n?.reservations).length!==e?.reservations?.length){const i=e?.reservations?.map(r=>n.reservations?.[r?.reservation_id]?null:kr(r,n,!1)).filter(r=>!Ee(r));i?.length&&(n.ttl=di(e.expiration,1),localStorage.setItem(Hs,JSON.stringify(n)),Ze({event:Da({product_name:i?.[0]?.name,items:i,real_path:t,isAdding:!0})}))}},mp=(t,e,n)=>{if((!Ee(n?.reservations)||Object.keys(n?.reservations).length!==e?.reservations?.length)&&sessionStorage.getItem(It)){const i=Object.fromEntries(e?.reservations?.map(o=>[o?.reservation_id,!0])),r=Object.values(n.reservations)?.map(o=>i?.[o?.reservation_id]?null:kr(o,n,!0)).filter(o=>!Ee(o));r?.length&&(e?.reservations?.length?(n.ttl=di(e.expiration,1),localStorage.setItem(Hs,JSON.stringify(n))):ba(),Ze({event:Da({product_name:r?.[0]?.name,items:r,real_path:t,isAdding:!1})}),sessionStorage.removeItem(It))}},fp=t=>!!(t?.endsWith("/cart/")||t?.endsWith("/cart")||t.includes("/permits/")&&t.includes("/registration/")||t.includes("/camping/reservations/orderdetails")||t.includes("/ticket/reservation")||t.includes("/timed-entry/reservation")),gp=t=>!!(t?.split("/")?.length===1||t?.endsWith("/cart/")||t?.endsWith("/cart")||t?.includes("/camping/campgrounds")),bp=t=>t?.includes("/cart/confirmation"),vp=t=>ks(t?.ttl,new Date),xp=()=>sessionStorage.getItem(Ss)||window?.location?.href||"",yp=()=>sessionStorage.getItem(It)||window?.location?.href||"";function wp(){const[t,e]=m.useState(!1),[n,i]=m.useState(!1),{enableGaForCartActions:r}=kt(),o=window.location?.pathname?.split("?")?.[0],l=Te(u=>u?.cart),c=l?.reservation_count===l?.reservations?.length;if(!r||!c)return null;let d=!1;if(sessionStorage.getItem(It)&&!n?(i(!0),e(!1),d=!0):sessionStorage.getItem(It)&&n&&ba(),!t||d)try{const u=JSON.parse(localStorage.getItem(Hs))||{reservations:{}},f=ni(l);if(!Ee(f)&&f?.reservations?.length||(Ee(f)||!f?.reservations?.length)&&!Ee(u?.reservations))if(bp(o)||u?.ttl&&vp(u))ba(),e(!0);else{let g=!1;f?.reservations?.length&&fp(o)&&(pp(xp(),f,u),g=!0),gp(o)&&(mp(yp(),f,u),g=!0),g&&e(!0)}}catch(u){console.error("Caught error that needs to be piped to error reporting mechanic",u),e(!0)}return null}function Cp(t){return new Promise(e=>{setTimeout(e,2**t*1e3)})}async function _r(t=0){if(t>4)return Promise.resolve(null);const e=document.querySelector("df-messenger");return e||(await Cp(t),_r(t+1))}function Sp({id:t="widgetIcon"}){const[e,n]=m.useState(null);m.useEffect(()=>{_r().then(r=>{n(r)})},[]);const i=()=>{if(e&&e){const r=e.shadowRoot;if(r&&r.children.length){const l=r.children[1].querySelector(`#${t}`);l&&l.focus()}}};return e?s.jsx("a",{"data-component":"SkipNavChat",href:`#${t}`,className:"skip-navigation",onClick:i,children:"Skip to help chatbot"}):null}function Ar({id:t="page-content",children:e="Skip to main content",...n}){return s.jsx("a",{"data-component":"SkipNavLink",href:`#${t}`,className:"skip-navigation",...n,children:e})}Ar.propTypes={id:a.string,children:a.node};const Np={type:"default",delay:6500,isColored:!0,disableAutoClose:!1},Mr={toasts:[]},Or=_s({name:"toast",initialState:Mr,reducers:{showToast:(t,e)=>{const n={...Np,...e.payload,id:Ue()};t.toasts=[...t.toasts,n]},dismissToast:(t,e)=>{t.toasts=t.toasts.filter(n=>n.id!==e.payload)}}}),{showToast:jb,dismissToast:Tp}=Or.actions,jp=t=>t?.toast?.toasts||Mr.toasts,Rp=Or.reducer;function Et({children:t,tag:e="div",rootId:n}){const i=m.useRef(document.createElement(e));return m.useLayoutEffect(()=>{const r=i.current,o=n?document.getElementById(n)??document.body:document.body;return r.setAttribute("data-component","Portal"),o.appendChild(r),()=>{o.removeChild(r)}},[n]),yo.createPortal(t,i.current)}Et.propTypes={children:a.node.isRequired,tag:a.string,rootId:a.string};const Ip=100,In="all 250ms cubic-bezier(.21,1.02,.73,1)",Ep="all 200ms ease-out";function En({element:t,transforms:e,transition:n,isRemove:i,callback:r}){const o=setTimeout(()=>{r&&r()},Ip);i&&t.classList.add("out"),e.forEach(({property:c,from:d=""})=>{t.style.setProperty(c,d)});const l=c=>{c.target===t&&(t.style.setProperty("transition",""),r&&r(),t.removeEventListener("transitionend",l),clearTimeout(o))};t.addEventListener("transitionend",l),window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{t.style.setProperty("transition",n),e.forEach(({property:c,to:d=""})=>{t.style.setProperty(c,d)})})})}const kp=()=>{const t=m.useMemo(()=>new Map,[]),e=m.useMemo(()=>new Map,[]);m.useEffect(()=>{const r=[];Array.from(t.entries()).forEach(([o,l])=>{if(l){const c=e.get(o),{top:d}=l.getBoundingClientRect();typeof c=="number"&&c!==d?r.push({element:l,transition:In,transforms:[{property:"transform",from:`translateY(${c-d}px)`}]}):typeof c!="number"&&r.push({element:l,transition:In,transforms:[{property:"transform",from:"translate3d(0,-120%,0) scale(0.4)"},{property:"opacity",from:"0"}]}),e.set(o,l.getBoundingClientRect().top)}else t.delete(o)}),r.forEach(o=>{En(o)})});const n=m.useCallback((r,o)=>{const l=t.get(r);l&&En({element:l,transforms:[{property:"opacity",to:"0"},{property:"transform",to:"translate3d(0,-100%,-1px) scale(0.7)"}],transition:Ep,isRemove:!0,callback:o})},[t]);return{itemRef:m.useCallback(r=>o=>{t.set(r,o)},[t]),remove:n}};function _p({onTimeout:t,duration:e,isEnabled:n=!0}){const[i,r]=m.useState(n),o=m.useRef(),l=m.useCallback(()=>{window.clearTimeout(o.current),r(!1)},[]);m.useEffect(()=>(i&&(o.current=window.setTimeout(()=>{t()},e)),()=>{window.clearTimeout(o.current)}),[t,i,e,l]);const c=m.useCallback(()=>{n&&r(!0)},[n]);return{stopTimeout:l,startTimeout:c}}const Ap={error:"error",info:"info",success:"check-circle",warning:"warning",default:"warning"},Mp=m.forwardRef((t,e)=>{const{id:n,onClose:i,shouldRemove:r,type:o="info",isColored:l,delay:c=6500,copy:d,disableAutoClose:u}=t,f=m.useRef(),g=Ls(f,e),[h,p]=m.useState(u!==!0),b=m.useCallback(()=>i(n),[n,i]),{stopTimeout:x,startTimeout:y}=_p({duration:c,onTimeout:b,isEnabled:h});return m.useEffect(()=>{r&&(x(),b())},[r,b,x,u]),m.useEffect(()=>{const v=f.current;if(!v)return;const w=()=>{x(),p(!1)},C=()=>{y(),u||p(!0)};return v.addEventListener("focusin",w),v.addEventListener("focusout",C),()=>{v.removeEventListener("focusin",w),v.removeEventListener("focusout",C)}},[u,y,x]),s.jsxs("div",{id:n,"data-component":"Toast",ref:g,role:"alertdialog","aria-labelledby":`${n}-label`,className:N(`sarsa-toast ${o}`,{[`${o}-colored`]:l}),onMouseEnter:x,onFocus:x,onMouseLeave:y,onBlur:y,"data-testid":"sarsaToast",children:[s.jsxs("div",{role:"alert",className:"toast-content",children:[o==="default"?null:s.jsx(j,{"data-testid":`${o}-icon`,iconName:Ap[o],className:`sarsa-toast-icon ${o}`}),s.jsx("div",{className:"text pr-1",id:`${n}-label`,children:d})]}),s.jsx("div",{className:"close-button-wrap",children:s.jsx(k,{onClick:b,size:"xs","aria-label":"Close notification",appearance:"subtle",className:"sarsa-toast-close",iconBeforeElement:s.jsx(j,{iconName:"close",size:"sm"}),"data-testid":"sarsaToastClose"})})]})}),kn=5;function Op({toasts:t,removeToast:e}){const{itemRef:n,remove:i}=kp(),r=m.useCallback(l=>{i(l,()=>{e(l)})},[i,e]),o=t.length-kn;return s.jsxs("div",{"data-testid":"Toaster","data-component":"Toaster",role:"region",tabIndex:-1,"aria-label":`Notifications: ${t.length}`,children:[t.map(({id:l,...c},d)=>d>=kn?null:s.jsx("div",{className:"toaster-item",children:s.jsx(Mp,{ref:n(l),id:l,onClose:r,...c})},l)),t.length>5?s.jsx("div",{className:"more-notifications",role:"alert","aria-live":"polite",children:`${o} Newer ${o===1?"Notification":"Notifications"}`}):null]})}function Pp(){const t=Fe(),e=Te(jp),n=m.useCallback(i=>{t(Tp(i))},[t]);return s.jsx(Et,{children:s.jsx(Op,{toasts:e,removeToast:n})})}function Lp({alertClassName:t,alertIcon:e,alertTitle:n,alerts:i,hideWarningMultiAlertBulletedStyle:r}){const[o,l]=m.useState(!1),c=m.useMemo(()=>i.length>1&&i[0].location_type?i[0].location_type:"area",[i]);return s.jsxs("div",{className:N("rec-mgs-is-multi-line",t),"aria-labelledby":"alertHeading",children:[s.jsxs("div",{className:"rec-msg",children:[s.jsxs("div",{className:"rec-msg-text",id:"alertHeading","data-testid":"alertHeading",children:[s.jsxs("div",{className:"rec-msg-text-type",children:[s.jsx("div",{className:"rec-alerts-notification-icon",children:e}),s.jsx("strong",{children:n})]}),s.jsxs("span",{children:["There ",ze(i,"is","are")," ",s.jsxs("strong",{children:[i.length," ",ze(i,"notification","notifications")]})," ","for this ",c]})]}),s.jsxs("button",{type:"button",onClick:()=>{l(d=>!d)},"aria-expanded":o,children:[o?s.jsx(j,{iconName:"chevron-up"}):s.jsx(j,{iconName:"chevron-down"}),s.jsxs("span",{className:"rec-msg-btn-text",children:[o?"Hide":"Show"," Notification",ze(i,"","s")]})]})]}),o&&s.jsx("div",{className:"rec-msg-multi-line-wrap",children:r?s.jsx("div",{className:"rec-msg-text-content-plain",children:s.jsx("div",{className:"rec-alert-items",children:i.map((d,u)=>s.jsx(Xe,{html:d.body},u))})}):s.jsx("div",{className:"rec-msg-text-content",children:s.jsx("ul",{children:i.map((d,u)=>s.jsx("li",{children:s.jsx(Xe,{html:d.body})},u))})})})]})}function $p({alertClassName:t,alertIcon:e,alertTitle:n,alert:i,closeAlert:r}){return s.jsx("div",{className:t,"aria-labelledby":"alertHeading",children:s.jsxs("div",{className:"rec-msg",children:[s.jsxs("div",{className:"rec-msg-text",children:[s.jsxs("div",{className:"rec-msg-text-type",id:"alertHeading","data-testid":"alertHeading",children:[s.jsx("div",{className:"rec-alerts-notification-icon",children:e}),s.jsx("strong",{children:n})]}),s.jsx("div",{className:"rec-msg-text-content",children:s.jsx("ul",{children:s.jsx("li",{children:s.jsx(Xe,{html:i.body})})})})]}),s.jsx("button",{type:"button",className:"rec-notification-close","aria-label":"Close notification",onClick:r,children:s.jsx(j,{iconName:"close"})})]})})}function Dp(t){switch(t){case"SUCCESS":return{className:"rec-success-full-banner",icon:s.jsx(j,{iconName:"info"}),title:"Success:",inlineTitle:"notifications"};case"ERROR":return{className:"rec-error-full-banner",icon:s.jsx(j,{iconName:"info"}),title:"Error:",inlineTitle:"errors"};case"INFO":return{className:"rec-info-full-banner",icon:s.jsx(j,{iconName:"info"}),title:"Info:",inlineTitle:"notifications"};case"WARNING":default:return{className:"rec-warning-full-banner",icon:s.jsx(j,{iconName:"warning"}),title:"Alert:",inlineTitle:"alerts"}}}function Fp(t){return(t.match(/

/g)||[]).length>1}function cs({alerts:t,level:e,hideWarningMultiAlertBulletedStyle:n}){const[i,r]=m.useState(!0),o=m.useMemo(()=>ti(t,["created_at"],["desc"]),[t]),l=Dp(e);return!i||!t||t.length===0?null:o.length===1&&o[0].body.length<=600&&!o[0].body.includes("

  • ")&&!Fp(o[0].body)?s.jsx($p,{alertClassName:l.className,alertIcon:l.icon,alertTitle:l.title,alert:o[0],closeAlert:()=>{r(!1)}}):s.jsx(Lp,{alertClassName:l.className,alertIcon:l.icon,alertTitle:l.title,alerts:o,hideWarningMultiAlertBulletedStyle:n})}function Bp({alerts:t=[],isInline:e=!1,hideWarningMultiAlertBulletedStyle:n=!1}){if(!t||t.length===0)return null;const i=t.filter(d=>!d.canceled_at),r=i.filter(d=>d.alert_level==="INFO"),o=i.filter(d=>d.alert_level==="WARNING"),l=i.filter(d=>d.alert_level==="SUCCESS"),c=i.filter(d=>d.alert_level==="ERROR");return s.jsxs("div",{className:N("nav-header-alerts",{"is-inline":e}),children:[s.jsx(cs,{alerts:c,level:"ERROR"}),s.jsx(cs,{alerts:o,level:"WARNING",hideWarningMultiAlertBulletedStyle:n}),s.jsx(cs,{alerts:r,level:"INFO"}),s.jsx(cs,{alerts:l,level:"SUCCESS"})]})}function Pr({isInline:t,hideWarningMultiAlertBulletedStyle:e}){const n=ru();return s.jsx(Bp,{alerts:n,isInline:t,hideWarningMultiAlertBulletedStyle:e})}function Us({className:t,"aria-label":e,isHidden:n,tabIndex:i,...r}){const o=m.useRef(null),{buttonProps:l}=As(r,o);return s.jsx("button",{"data-component":"InputClearButton",...l,type:"button",ref:o,className:N(t,{hidden:n}),"aria-label":e??"Clear input",tabIndex:i,children:s.jsx(j,{className:"button-icon x-icon",iconName:"close"})})}const Lr=m.createContext(void 0);function Vp({descriptionProps:t,labelProps:e,children:n}){const i=m.useMemo(()=>({descriptionProps:t,labelProps:e}),[t,e]);return s.jsx(Lr.Provider,{value:i,children:n})}function $r(){const t=m.useContext(Lr);if(t===void 0)throw new Error("ItemContext must be within ItemProvider");return t}function Hp(t){const e=m.useRef(null),{listBoxRef:n=e,state:i}=t,{listBoxProps:r}=Lo(t,i,n);return s.jsx("ul",{...r,ref:n,className:"sarsa--autosuggest-listbox",children:[...i.collection].map(o=>o.type==="section"?s.jsx(Up,{section:o,state:i,onSelect:t.onSelect},o.key):s.jsx(Dr,{item:o,state:i,onPressUp:()=>t?.onSelect?.(o.key)},o.key))})}function Up({section:t,state:e,onSelect:n}){const{itemProps:i,headingProps:r,groupProps:o}=$o({heading:t.rendered,"aria-label":t["aria-label"]});return s.jsxs("li",{...i,className:"sarsa--autosuggest-listbox-section",children:[t.rendered&&s.jsx("div",{...r,className:"section-title",children:t.rendered}),s.jsx("ul",{...o,children:[...t.childNodes].map(l=>s.jsx(Dr,{item:l,state:e,onPressUp:()=>n?.(l.key)},l.key))})]})}function Dr({item:t,state:e,onPressUp:n}){const i=m.useRef(null),{optionProps:r,isDisabled:o,isSelected:l,isFocused:c,labelProps:d,descriptionProps:u}=Do({key:t.key},e,i);m.useEffect(()=>{i.current?.addEventListener("touchend",h=>{typeof h.currentTarget?.getAttribute("href")!="string"&&h.cancelable&&h.preventDefault()},{passive:!1,once:!0})},[]);const f=t.props.href?"a":"div",{pressProps:g}=Fo({onPressUp:n});return s.jsx("li",{children:s.jsx(f,{...at(r,g),ref:i,className:N("sarsa--autosuggest-listbox-option",{focused:c,selected:l,disabled:o}),children:s.jsx(Vp,{descriptionProps:u,labelProps:d,children:t.rendered})})})}const Lt=new WeakMap,je=[];function qp(t,e=document.body){const n=new Set(t),i=new Set,r=d=>{for(const h of d.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))n.add(h);const u=h=>{if(n.has(h)||i.has(h.parentElement)&&h.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const p of n)if(h.contains(p))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},f=document.createTreeWalker(d,NodeFilter.SHOW_ELEMENT,{acceptNode:u}),g=u(d);if(g===NodeFilter.FILTER_ACCEPT&&o(d),g!==NodeFilter.FILTER_REJECT){let h=f.nextNode();for(;h!=null;)o(h),h=f.nextNode()}},o=d=>{const u=Lt.get(d)??0;d.getAttribute("aria-hidden")==="true"&&u===0||(u===0&&d.setAttribute("aria-hidden","true"),i.add(d),Lt.set(d,u+1))};je.length&&je[je.length-1].disconnect(),r(e);const l=new MutationObserver(d=>{for(const u of d)if(!(u.type!=="childList"||u.addedNodes.length===0)&&![...n,...i].some(f=>f.contains(u.target))){for(const f of u.removedNodes)f instanceof Element&&(n.delete(f),i.delete(f));for(const f of u.addedNodes)(f instanceof HTMLElement||f instanceof SVGElement)&&(f.dataset.liveAnnouncer==="true"||f.dataset.reactAriaTopLayer==="true")?n.add(f):f instanceof Element&&r(f)}});l.observe(e,{childList:!0,subtree:!0});const c={observe(){l.observe(e,{childList:!0,subtree:!0})},disconnect(){l.disconnect()}};return je.push(c),()=>{l.disconnect();for(const d of i){const u=Lt.get(d);u===1?(d.removeAttribute("aria-hidden"),Lt.delete(d)):typeof u=="number"&&Lt.set(d,u-1)}c===je[je.length-1]?(je.pop(),je.length&&je[je.length-1].observe()):je.splice(je.indexOf(c),1)}}function va(t,e=-1/0,n=1/0){return Math.min(Math.max(t,e),n)}function Fr(t){let e=null;return()=>(e==null&&(e=t()),e)}function Br(t){return typeof window>"u"||window.navigator==null?!1:window.navigator.userAgentData?.brands.some(e=>t.test(e.brand))||t.test(window.navigator.userAgent)}const Gp=Fr(()=>Br(/Chrome/i)),Wp=Fr(()=>Br(/AppleWebKit/i)&&!Gp()),St={top:"top",bottom:"top",left:"left",right:"left"},Ns={top:"bottom",bottom:"top",left:"right",right:"left"},zp={top:"left",left:"top"},xa={top:"height",left:"width"},Vr={width:"totalWidth",height:"totalHeight"},ds={},tt=typeof document<"u"&&window.visualViewport;function _n(t){let e=0,n=0,i=0,r=0,o=0,l=0;const c={},d=tt?.scale>1;if(t.tagName==="BODY"){const u=document.documentElement;i=u.clientWidth,r=u.clientHeight,e=tt?.width??i,n=tt?.height??r,c.top=u.scrollTop||t.scrollTop,c.left=u.scrollLeft||t.scrollLeft,tt&&(o=tt.offsetTop,l=tt.offsetLeft)}else({width:e,height:n,top:o,left:l}=Tt(t)),c.top=t.scrollTop,c.left=t.scrollLeft,i=e,r=n;return Wp()&&(t.tagName==="BODY"||t.tagName==="HTML")&&d&&(c.top=0,c.left=0,o=tt.pageTop,l=tt.pageLeft),{width:e,height:n,totalWidth:i,totalHeight:r,scroll:c,top:o,left:l}}function Kp(t){return{top:t.scrollTop,left:t.scrollLeft,width:t.scrollWidth,height:t.scrollHeight}}function An(t,e,n,i,r,o,l){const c=r.scroll[t],d=i[xa[t]],u=i.scroll[St[t]]+o,f=d+i.scroll[St[t]]-o,g=e-c+l[t]-i[St[t]],h=e-c+n+l[t]-i[St[t]];return gf?Math.max(f-h,u-g):0}function Yp(t){const e=window.getComputedStyle(t);return{top:parseInt(e.marginTop,10)||0,bottom:parseInt(e.marginBottom,10)||0,left:parseInt(e.marginLeft,10)||0,right:parseInt(e.marginRight,10)||0}}function Mn(t){if(ds[t])return ds[t];let[e,n]=t.split(" ");const i=St[e]||"right",r=zp[i];St[n]||(n="center");const o=xa[i],l=xa[r];return ds[t]={placement:e,crossPlacement:n,axis:i,crossAxis:r,size:o,crossSize:l},ds[t]}function na(t,e,n,i,r,o,l,c,d,u){const{placement:f,crossPlacement:g,axis:h,crossAxis:p,size:b,crossSize:x}=i,y={};y[p]=t[p],g==="center"?y[p]+=(t[x]-n[x])/2:g!==p&&(y[p]+=t[x]-n[x]),y[p]+=o;const v=t[p]-n[x]+d+u,w=t[p]+t[x]-d-u;if(y[p]=va(y[p],v,w),f===h){const C=c?l[b]:e[Vr[b]];y[Ns[h]]=Math.floor(C-t[h]+r)}else y[h]=Math.floor(t[h]+t[b]+r);return y}function Zp(t,e,n,i,r,o,l,c){const d=i?n.height:e[Vr.height],u=t.top!=null?n.top+t.top:n.top+(d-t.bottom-l),f=c!=="top"?Math.max(0,e.height+e.top+e.scroll.top-u-(r.top+r.bottom+o)):Math.max(0,u+l-(e.top+e.scroll.top)-(r.top+r.bottom+o));return Math.min(e.height-o*2,f)}function On(t,e,n,i,r,o){const{placement:l,axis:c,size:d}=o;return l===c?Math.max(0,n[c]-t[c]-t.scroll[c]+e[c]-i[c]-i[Ns[c]]-r):Math.max(0,t[d]+t[c]+t.scroll[c]-e[c]-n[c]-n[d]-i[c]-i[Ns[c]]-r)}function Jp(t,e,n,i,r,o,l,c,d,u,f,g,h,p,b,x){let y=Mn(t);const{size:v,crossAxis:w,crossSize:C,placement:T,crossPlacement:I}=y;let R=na(e,c,n,y,f,g,u,h,b,x),S=f;const _=On(c,u,e,r,o+f,y);if(l&&i[v]>_){const B=Mn(`${Ns[T]} ${I}`),H=na(e,c,n,B,f,g,u,h,b,x);On(c,u,e,r,o+f,B)>_&&(y=B,R=H,S=f)}let M="bottom";y.axis==="top"?y.placement==="top"?M="top":y.placement==="bottom"&&(M="bottom"):y.crossAxis==="top"&&(y.crossPlacement==="top"?M="bottom":y.crossPlacement==="bottom"&&(M="top"));let O=An(w,R[w],n[C],c,d,o,u);R[w]+=O;let A=Zp(R,c,u,h,r,o,n.height,M);p&&p{const r=e?.current;if(!r)return()=>{};if(!em())return window.addEventListener("resize",i,!1),()=>{window.removeEventListener("resize",i,!1)};const o=new window.ResizeObserver(Es(l=>{l.length&&i()},100));return o.observe(r,{box:n}),()=>{r&&o.unobserve(r)}},[i,e,n])}const dt=typeof document<"u"&&window.visualViewport;function tm(t){const{direction:e}=Qe(),{arrowSize:n=0,targetRef:i,overlayRef:r,scrollRef:o=r,placement:l="bottom",containerPadding:c=12,shouldFlip:d=!0,boundaryElement:u=typeof document<"u"?document.body:null,offset:f=0,crossOffset:g=0,shouldUpdatePosition:h=!0,isOpen:p=!0,maxHeight:b,arrowBoundaryOffset:x=0,updateOnScroll:y=!0}=t,[v,w]=m.useState({position:{},arrowOffsetLeft:void 0,arrowOffsetTop:void 0,maxHeight:void 0,placement:void 0}),C=[h,l,r.current,i.current,o.current,c,d,u,f,g,p,e,b,x,n],T=m.useRef(dt?.scale);m.useEffect(()=>{p&&(T.current=dt?.scale)},[p]);const I=m.useCallback(()=>{if(h===!1||!p||!r.current||!i.current||!u||dt?.scale!==T.current)return;let S=null;if(o.current&&o.current.contains(document.activeElement)){const O=document.activeElement?.getBoundingClientRect(),A=o.current.getBoundingClientRect();O&&(S={type:"top",offset:O.top-A.top},S.offset>A.height/2&&(S.type="bottom",S.offset=O.bottom-A.bottom))}const _=r.current;!b&&r.current&&(_.style.top="0px",_.style.bottom="",_.style.maxHeight=`${window.visualViewport?.height??window.innerHeight}px`);const M=Xp({placement:am(l,e),overlayNode:r.current,targetNode:i.current,scrollNode:o.current||r.current,padding:c,shouldFlip:d,boundaryElement:u,offset:f,crossOffset:g,maxHeight:b,arrowSize:n,arrowBoundaryOffset:x});if(_.style.top="",_.style.bottom="",_.style.left="",_.style.right="",Object.keys(M.position).forEach(O=>{_.style[O]=`${M.position[O]}px`}),_.style.maxHeight=M.maxHeight!=null?`${M.maxHeight}px`:void 0,S&&document.activeElement&&o.current){const O=document.activeElement.getBoundingClientRect(),A=o.current.getBoundingClientRect(),$=O[S.type]-A[S.type];o.current.scrollTop+=$-S.offset}w(M)},C);m.useEffect(()=>{const S=st(I,50);return y&&document.addEventListener("scroll",S),()=>{document.removeEventListener("scroll",S)}},[y,I]),m.useLayoutEffect(I,C),sm(I),$n({ref:r,onResize:I}),$n({ref:i,onResize:I});const R=m.useRef(!1);return m.useLayoutEffect(()=>{let S;const _=()=>{R.current=!0,clearTimeout(S),S=setTimeout(()=>{R.current=!1},500),I()},M=()=>{R.current&&_(),I()};return dt?.addEventListener("resize",_),dt?.addEventListener("scroll",M),()=>{dt?.removeEventListener("resize",_),dt?.removeEventListener("scroll",M)}},[I]),{overlayProps:{style:{position:"absolute",zIndex:1e5,...v.position,maxHeight:v.maxHeight??"100vh"}},placement:v.placement??"left",arrowProps:{"aria-hidden":"true",role:"presentation",style:{left:v.arrowOffsetLeft,top:v.arrowOffsetTop}},updatePosition:I}}function sm(t){m.useLayoutEffect(()=>(window.addEventListener("resize",t,!1),()=>{window.removeEventListener("resize",t,!1)}),[t])}function am(t,e){return e==="rtl"?t.replace("start","right").replace("end","left"):t.replace("start","left").replace("end","right")}function nm(t,e){const{triggerRef:n,popoverRef:i,isNonModal:r,isKeyboardDismissDisabled:o,shouldCloseOnInteractOutside:l,...c}=t,{overlayProps:d,underlayProps:u}=ui({isOpen:e.isOpen,onClose:e.close,shouldCloseOnBlur:!0,isDismissable:!r,isKeyboardDismissDisabled:o,shouldCloseOnInteractOutside:l},i),{overlayProps:f,arrowProps:g,placement:h}=tm({...c,targetRef:n,overlayRef:i,isOpen:e.isOpen,onClose:r?e.close:void 0});return m.useLayoutEffect(()=>e.isOpen&&!r&&i.current?qp([i.current]):()=>{},[r,e.isOpen,i]),{popoverProps:at(d,f),arrowProps:g,underlayProps:u,placement:h}}function im({children:t,state:e,className:n,...i}){const{popoverProps:r}=nm(i,e);return s.jsxs("div",{...r,ref:i.popoverRef,className:N("sarsa--autosuggest-popover",n),children:[t,s.jsx(Bo,{onDismiss:e.close})]})}function rm(t){const{iconBeforeElement:e=s.jsx(j,{iconName:"search"}),isLabelVisible:n=!0,size:i="md",onClear:r,allowsEmptyCollection:o,popupClassName:l,updateOnScroll:c,maxPopupHeight:d,onSelectionChange:u,onSelect:f,hasFloatingError:g,className:h,shouldPopoverFlip:p=!0,...b}=t,x=m.useRef(null),y=G=>{u?.(G),x.current=G},v=m.cloneElement(e,{"aria-hidden":"true",size:"md"}),{contains:w}=Vo({sensitivity:"base"}),C=Ho({...b,onSelectionChange:y,defaultFilter:w,allowsEmptyCollection:o}),T=m.useRef(null),I=m.useRef(null),R=m.useRef(null),S=G=>{if(G){const[...L]=t.defaultItems||t.items||[],Z=L.find(z=>z?.id===G||z?.key===G);f?.(G,Z),x.current=null;return}const E=T.current?.form;if(E&&b.allowsCustomValue&&C.isOpen){const L=new Event("submit",{cancelable:!0,bubbles:!0});E.dispatchEvent(L)}},_=()=>{r?r():C.setInputValue("")},M=G=>{(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),_(),T.current?.focus())},O=G=>{switch(t.onKeyDown?.(G),G.key){case"Enter":{S(x.current);break}case"Escape":{G.continuePropagation(),C.isOpen?C.close():(_(),T.current?.focus());break}}},{inputProps:A,listBoxProps:$,labelProps:U,isInvalid:P,validationErrors:D}=Uo({...b,onKeyDown:O,onSelectionChange:y,inputRef:T,listBoxRef:I,popoverRef:R},C),ne={label:t.label,value:C.inputValue,onChange:G=>C.setInputValue(G),onClear:_,id:t.id},W=qo(ne),{clearButtonProps:Y,labelProps:B}=Go(ne,W,T),H=m.useRef(null),V=P||!!t.errorMessage||D.length>0,Q=`${A.id}-error`;return s.jsxs("div",{"data-component":"Autosuggest",className:h,children:[s.jsx("div",{className:"sarsa-field-label-wrapper",children:s.jsx(it,{...at(U,B),htmlFor:A.id,isVisible:n,isRequired:t.isRequired,children:t.label})}),s.jsxs("div",{ref:H,className:N("autosuggest-input-wrapper",!n&&"no-label"),children:[s.jsx("span",{className:`autosuggest-search-icon search-icon-${i}`,children:v}),s.jsx("input",{...A,ref:T,className:N(`autosuggest-text-input autosuggest-text-input-${i}`,{"is-invalid":P}),"aria-describedby":V?"errorId":A["aria-describedby"]}),s.jsx("span",{className:`autosuggest-clear-btn-wrapper clear-btn-wrapper-${i}`,children:s.jsx(Us,{...Y,excludeFromTabOrder:!1,isHidden:!C.inputValue,onKeyDown:M})})]}),t.errorMessage||D.length>0?s.jsx(Je,{isFloating:g,id:Q,children:t.errorMessage||D[0]}):null,C.isOpen&&s.jsx(im,{shouldFlip:p,popoverRef:R,triggerRef:H,state:C,placement:"bottom left",isNonModal:!0,updateOnScroll:c,maxHeight:d,className:N(l,o&&t.items&&![...t.items].length&&"autosuggest-popup-border-none"),children:s.jsx(Hp,{...$,listBoxRef:I,state:C,onSelect:S})})]})}function qs(t){return t.parent_name!==void 0}function De(t){return t.is_inventory!==void 0}function Dn(t){return t.lat!==void 0}function mt(t){return t.last_used!==void 0}function Ja(t){return t.is_merchandise!==void 0}function Ts(t){return qs(t)||De(t)||Ja(t)||mt(t)}const om=t=>{const e={id:Ts(t)&&t?.entity_id?t.entity_id:"",name:t?.name||"",position:t?.idx||0};return Ts(t)&&(!t?.entity_type||!t?.entity_id)?{}:{suggestionItem:e}};function lm({refForIntersection:t=void 0,reportOnMount:e=!1,shouldEnqueueWork:n=!1,suggestion:i=void 0,id:r="",name:o="",list_name:l="",brand:c="Recreation.gov",position:d=0,variant:u,list:f=""}){const[g,h]=m.useState(!1),p=Ba(!h,t),{enableGaForImpressionView:b}=kt();if(b&&!g){let x;try{if(i&&(x=om(i)),x){const y=t?.current&&p&&!!window?.dataLayer;(e||y)&&(Ze({event:$d({list_name:l,impressions:[Bd({id:r,name:o,brand:c,position:d,variant:u,list:f})]}),shouldEnqueueWork:n}),h(!0))}}catch(y){console.error("Caught error that needs to be piped to error reporting mechanic",y),h(!0)}}return null}function cm({suggestion:t}){const{descriptionProps:e}=$r(),i=(qs(t)||De(t))&&t.parent_name,r=(mt(t)||De(t))&&t.entity_type&&t.city&&t.state_code;return s.jsxs("div",{className:"sarsa-location-suggestion-subtitle","data-testid":"suggestion-subtitle",...e,children:[i&&s.jsx("span",{children:t.parent_name}),r&&s.jsx("span",{children:`${i?" | ":""}Near ${t.city}, ${t.state_code}`})]})}function ye({name:t,tagIconName:e,iconClass:n,className:i,size:r="md",isSpanItem:o=!1,isInverse:l=!1,hasText:c=!1}){const d=N("rec-inventory-tag",i,{"rec-inventory-tag-sm":r==="sm","rec-inventory-tag-md":r==="md","rec-inventory-tag-lg":r==="lg","rec-inventory-tag-is-inverse":l}),u=o?"span":"li";return s.jsxs(u,{className:N(`${d} rec-${n}-tag${c?"-has-text":""}`),children:[e,c?t:""]},t)}ye.propTypes={name:a.string.isRequired,tagIconName:a.node.isRequired,iconClass:a.string.isRequired,hasText:a.bool,isSpanItem:a.bool,size:a.oneOf(["sm","md","lg"]),isInverse:a.bool,className:a.string};function dm(t){return s.jsx(ye,{tagIconName:s.jsx(j,{iconName:"tent"}),name:"Camping",iconClass:"camping",...t})}function um(t){return s.jsx(ye,{tagIconName:s.jsx(j,{iconName:"tree"}),name:"Recreation Area",iconClass:"rec-area",...t})}function hm(t){return s.jsx(ye,{tagIconName:s.jsx(j,{iconName:"ticket"}),name:"Tickets & Tours",iconClass:"tickets-tours",...t})}function pm(t){return s.jsx(ye,{tagIconName:s.jsx(j,{iconName:"card"}),name:"Site Pass",iconClass:"pass",...t})}function mm(t){return s.jsx(ye,{tagIconName:s.jsx(j,{iconName:"card"}),name:"Activity Pass",iconClass:"activity-pass",...t})}function fm(t){return s.jsx(ye,{tagIconName:s.jsx(j,{iconName:"permit"}),name:"Tree Permits",iconClass:"tree-permits",...t})}function Fn(t){return s.jsx(ye,{tagIconName:s.jsx(j,{iconName:"compass"}),name:"Point of Interest",iconClass:"poi",...t})}function gm(t){return s.jsx(ye,{tagIconName:s.jsx(j,{iconName:"picnic-table"}),name:"Day Use",iconClass:"day-use",...t})}function bm(t){return s.jsx(ye,{tagIconName:s.jsx(j,{iconName:"permit"}),name:"Permits",iconClass:"permit",...t})}function ia(t){return s.jsx(ye,{tagIconName:s.jsx(j,{iconName:"pin"}),name:"Map Pin",iconClass:"map-pin",...t})}function vm(t){return s.jsx(ye,{tagIconName:s.jsx(j,{iconName:"self-improvement"}),name:"Programs",iconClass:"venue",...t})}function xm(t){return s.jsx(ye,{tagIconName:s.jsx(j,{iconName:"gift-card"}),name:"Gift Card",iconClass:"gift-card",...t})}function ym(t){return s.jsx(ye,{tagIconName:s.jsx(j,{iconName:"celebration"}),name:"Venue",iconClass:"venue",...t})}function Rb(t){return s.jsx(ye,{tagIconName:s.jsx(j,{iconName:"celebration"}),name:"Other",iconClass:"venue",...t})}const wm="Search for places or activities near me";function Cm(t){let e=t.text;return De(t)&&(e=ws(e)),e}function Sm(t){if((Ja(t)||qs(t)||De(t)||mt(t))&&t.entity_type)switch(t.entity_type){case"campground":return De(t)&&t?.campsite_type_of_use?.length===1&&t?.campsite_type_of_use[0]==="Day"?s.jsx(gm,{isSpanItem:!0,isInverse:!0}):s.jsx(dm,{isSpanItem:!0,isInverse:!0});case"ticketfacility":case"tour":case"timedentry":case"timedentry_tour":return s.jsx(hm,{isSpanItem:!0,isInverse:!0,className:"tour-suggestion-icon"});case"permit":case"vehiclepermit":return s.jsx(bm,{isSpanItem:!0,isInverse:!0});case"recarea":return s.jsx(um,{isSpanItem:!0,isInverse:!0,className:"rec-area-suggestion-icon"});case"pass":return s.jsx(pm,{isSpanItem:!0,isInverse:!0,className:"rec-area-suggestion-icon"});case"activitypass":return s.jsx(mm,{isSpanItem:!0,isInverse:!0,className:"rec-area-suggestion-icon"});case"treepermit":return s.jsx(fm,{isSpanItem:!0,isInverse:!0,className:"rec-area-suggestion-icon"});case"venuereservations":case"venuereservations_venue":return s.jsx(ym,{isSpanItem:!0,isInverse:!0});case"program":case"program_session":return s.jsx(vm,{isSpanItem:!0,isInverse:!0});case"giftcard":return s.jsx(xm,{isSpanItem:!0,isInverse:!0});case"kb":return s.jsx("div",{className:"location-suggestion-icon location-suggestion-help-icon",children:s.jsx(j,{iconName:"help-outline"})});case"cms":case"page":return s.jsx("div",{className:"location-suggestion-icon location-suggestion-article-icon",children:s.jsx(j,{iconName:"description"})});case"merchandise":return s.jsx("div",{className:"location-suggestion-icon location-suggestion-offer-icon",children:s.jsx(j,{iconName:"offer"})});default:return s.jsx(Fn,{isSpanItem:!0,isInverse:!0})}return Dn(t)&&!De(t)?s.jsx(ia,{isSpanItem:!0,isInverse:!0}):mt(t)&&!t.entity_type&&t.country_code?s.jsx(ia,{isSpanItem:!0,isInverse:!0}):t.text===wm?s.jsx(ia,{isSpanItem:!0,isInverse:!0}):!Dn(t)&&!De(t)&&t.text?s.jsx("div",{className:"location-suggestion-icon location-suggestion-history-icon",children:s.jsx(j,{iconName:"history"})}):s.jsx(Fn,{className:"poi-suggestion-icon"})}function Nm({suggestion:t,searchText:e}){const{labelProps:n}=$r(),i=Cm(t),r=e.trim(),o=Wo(i,r),l=zo(i,o);return s.jsx("div",{"data-testid":"suggestion-title",...n,children:l.map((c,d)=>{const u=c.highlight?"highlight":void 0;return s.jsx("span",{className:u,children:c.text},d)})})}function Tm({suggestion:t,searchText:e,shouldEnableTracking:n=!1}){return s.jsxs("div",{className:"sarsa-location-suggestion-content",translate:"no",children:[n&&s.jsx(lm,{suggestion:t,list_name:"search-suggestion-container__search-suggestion-content",position:t?.idx||0,reportOnMount:!0,shouldEnqueueWork:!0}),s.jsx(Nm,{suggestion:t,searchText:e}),s.jsx(cm,{suggestion:t})]})}function jm({suggestion:t}){const e=m.useMemo(()=>Sm(t),[t.id]);return s.jsx("div",{className:"sarsa-location-suggestion-icon",children:e})}function Bn({suggestion:t,searchText:e,shouldEnableTracking:n=!1}){return s.jsx("div",{"data-component":"LocationSuggestion",className:"sarsa-location-suggestion-container",children:t.customRender?t.customRender:s.jsxs(s.Fragment,{children:[s.jsx(jm,{suggestion:t}),s.jsx(Tm,{suggestion:t,searchText:e,shouldEnableTracking:n})]})})}function Rm(t,e="https://www.recreation.gov",n="https://help.recreation.gov/external"){let i;if(t.entity_type==="campground"&&t.reservable)i=`/camping/campgrounds/${t.entity_id}`;else if(t.campsite_id)i=`/camping/campsites/${t.campsite_id}`;else if(t.entity_type==="permit")i=`/permits/${t.entity_id}`;else if(t.entity_type==="vehiclepermit")i=`/vehiclepermits/${t.entity_id}`;else if(t.entity_type==="tour")i=`/ticket/${t.parent_entity_id?t.parent_entity_id:t.parent_id}/ticket/${t.entity_id}`;else if(t.entity_type==="ticketfacility")i=`/ticket/facility/${t.entity_id}`;else if(t.entity_type==="timedentry_tour")i=`/timed-entry/${t.parent_entity_id?t.parent_entity_id:t.parent_id}/ticket/${t.entity_id}`;else if(t.entity_type==="timedentry")i=`/timed-entry/${t.entity_id}`;else if(t.entity_type==="recarea")i=`/gateways/${t.entity_id}`;else if(t.entity_type==="pass")i=`/sitepass/${t.park_pass_facility_id?t.park_pass_facility_id:t.entity_id}`;else if(t.entity_type==="activitypass")i=`/activitypass/${t.entity_id}`;else if(t.entity_type==="treepermit")i=`/tree-permits/${t.entity_id}`;else if(t.entity_type==="venuereservations")i=`/venues/${t.entity_id}`;else if(t.entity_type==="venuereservations_venue")i=`/venues/${t.parent_entity_id?t.parent_entity_id:t.parent_id}/details/${t.entity_id}`;else if(t.entity_type==="program")i=`/programs/${t.entity_id}`;else if(t.entity_type==="kb")i=`${n}?id=kb_article&sys_id=${t.entity_id}`;else if(t.entity_type==="cms"){const r=t.name.toLowerCase().split(" ").join("-"),o=t.content_type.toLowerCase().split("_").join("-");i=`${e}/articles/${o}/${r}/${t.entity_id}`}else t.entity_type==="page"||t.entity_type==="giftcard"||t.entity_type==="merchandise"?i=t.url:i=`/camping/poi/${t.entity_id}`;return i}const Hr=()=>Fe(),Im=Te;function Vn(t){return t.children!==void 0}function Em(t,e){let n;return(...i)=>new Promise((r,o)=>{clearTimeout(n),n=setTimeout(async()=>{try{const l=await t(...i);r(l)}catch(l){o(l)}},e)})}const us="Search for places or activities near me",$t="Clear Search History";function hs(t){let e=t.text;return(qs(t)||De(t)||Ja(t)||mt(t))&&t.entity_id&&t.entity_type&&(e=ws(e)),e}function km(t){return!t||typeof t!="string"||t.length>500?null:t?.match(/(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/)}const _m=Em(async(t,e)=>{try{const{data:n}=await le.get("/api/search/suggest",{signal:t,params:e,paramsSerializer:{indexes:null},headers:{Authorization:_e()}});return n}catch{return{content_suggestions:null,inventory_suggestions:null,merchandise_suggestions:null,suggestions:null}}},250);function Ur(t){const{contentTypes:e=null,disableSearchOnSelect:n=!1,defaultEventCategory:i="Global Navigation",geocoder:r=!0,inventoryTypes:o=null,placeholder:l="What are you looking for?",popupClassName:c="nav-search-bar-container-popup",queryCriteriaPropertyName:d="what",searchOnSelectTypes:u=[],size:f="md",buildGATrackingObject:g,clickTagAction:h,clickTagCategory:p,clickTagLabel:b,id:x,onRunSearch:y}=t,v=Hr(),[w,C]=m.useState(null),T=m.useRef(0),I=()=>{T.current=Date.now()},R=m.useRef(null),S=Im(E=>E.auth.account),_=h&&p&&b,M=()=>{const E={category:"Search",action:"Select Search Suggestion Near Me",label:"Near Me"};if(_&&(E.category=p,E.action=h,E.label=b),g){const L=g(null,!0);E.category=L.clickTagCategory,E.action=L.clickTagAction,E.label=L.clickTagLabel}Ge(E,()=>{v(ha())})},O={id:Ue(),idx:0,text:us,name:us},A=async(E,L)=>{let Z=i,z="Submit Search",ie=L;if(E&&(z="Select Search Suggestion",mt(E)&&E.last_used&&(z="Select Search History Suggestion"),ie=E.name||E.text),_&&(Z=p,z=h,ie=b),g){const te=g(E);te.clickTagCategory&&te.clickTagAction&&te.clickTagLabel&&(Z=te.clickTagCategory,z=te.clickTagAction,ie=te.clickTagLabel)}km(ie)&&(ie="[Redacted Email]");const we={category:Z,action:z,label:ie},F=E&&(mt(E)||De(E))&&E.reservable,q=E&&Ts(E)&&(E.entity_type==="recarea"||E.entity_type==="kb"||E.entity_type==="cms"||E.entity_type==="page"||E.entity_type==="merchandise"||E.entity_type==="pass");if(F||q){try{await mn({searchHistory:void 0,rawSearchText:L,suggestion:E})}catch(ee){console.log("error saving history",ee)}const te=Rm(E);Ge(we,()=>{window.location.assign(te)})}else if(y)Ge(we,()=>{y({searchText:L,suggestion:E,searchHistory:[]})});else{try{await mn({searchHistory:void 0,rawSearchText:L,suggestion:E})}catch(te){console.log("error saving history",te)}Ge(we,()=>{v(ha(L,null,E))})}},$=E=>{R.current=null;const L=hs(E);v(Ct({selectedSuggestionOption:E,[d]:L})),(!n||Ts(E)&&u.includes(E?.entity_type??""))&&A(E,L)},U=(E,L)=>({...E,id:Ue(),idx:L}),P=async()=>{try{const E=(await _d(I)).filter(Z=>!!Z.text),L=[O];if(E.length){const Z={id:Ue(),text:"Recent Searches",children:E.map(U)};Z.children.push({id:Ue(),idx:E.length+1,text:$t,name:$t,customRender:s.jsx("div",{className:"nav-search-suggestion",children:s.jsxs("div",{className:"search-suggestion-content search-suggestion-link clear-search-history",children:[s.jsx(j,{iconName:"loop",size:"sm"}),s.jsx("span",{children:$t})]})})}),L.push(Z)}return L}catch(E){return console.error("error loading history",E),[]}},D=Ko({async load({signal:E,filterText:L}){if(!L)return{items:await P()};const z=await _m(E,{q:L,geocoder:r,type:e,inventory_type:o});return{items:[{text:"Recreation Areas, Facilities, Tours, Trails",id:Ue(),children:(z?.inventory_suggestions??[]).map(U)},{text:"Merchandise Store",id:Ue(),children:(z?.merchandise_suggestions??[]).map(U)},{text:"Locations, City, State, Zip Code",id:Ue(),children:(z?.suggestions??[]).map(U)},{text:"Help Topics, Frequently Asked Questions, Articles",id:Ue(),children:(z?.content_suggestions??[]).map(U)}].filter(ie=>ie.children.length)}}});async function ne(){try{await Ad()}catch(L){console.log("error deleting history",L)}R.current=null,D.reload();const E={[d]:""};v(Ct(E))}m.useEffect(()=>{S?.account?.account_id&&T.current>0&&D.reload()},[S?.account?.account_id]);const W=E=>{for(let L=0;Lie.id===E);if(z)return z}else if(Z.id===E)return Z}return null},Y=()=>{D.setFilterText(""),C(null),R.current=null},B=async E=>{if(!E)return;const L=W(E);if(L&&(C(L.id),R.current=L,L.text!==$t&&L.text!==us)){const Z=hs(L);D.setFilterText(Z);const z={[d]:Z};v(Ct(z))}},H=E=>{const L=W(E);L&&(L.text===us?M():L.text===$t?ne():$(L))},V=E=>{E.key==="Enter"&&!R.current&&D.filterText&&A(null,D.filterText)},Q=()=>{Y();const E={[d]:""};v(Ct(E))},G=E=>{D.setFilterText(E),w&&(C(null),R.current=null);const L={[d]:E};v(Ct(L))};return s.jsx("div",{className:"nav-search-bar-container",children:s.jsx(rm,{id:x,label:"Search Recreation.gov",items:D.items,inputValue:D.filterText,isLabelVisible:!1,menuTrigger:"focus",placeholder:l,onClear:Q,onInputChange:G,onKeyDown:V,onSelectionChange:B,onSelect:H,popupClassName:c,selectedKey:w,size:f,allowsCustomValue:!0,allowsEmptyCollection:!0,updateOnScroll:!1,children:E=>Vn(E)?s.jsx(Yo,{title:E.text,items:E.children,children:L=>s.jsx(rn,{textValue:hs(L),children:s.jsx(Bn,{shouldEnableTracking:!0,suggestion:L,searchText:D.filterText})},L.id)},E.id):s.jsx(rn,{textValue:hs(E),children:s.jsx(Bn,{shouldEnableTracking:!0,suggestion:E,searchText:D.filterText})},E.id)})})}function Am(){const t=m.useRef(new Ht),[e,n]=m.useState(()=>!!t.current.readCookie("android-smartbanner-closed")),[i,r]=m.useState(()=>!!t.current.readCookie("android-smartbanner-installed")),o=()=>{t.current.createCookie("android-smartbanner-closed","true",15),n(!0)},l=()=>{t.current.createCookie("android-smartbanner-installed","true",30),r(!0)};return!sr()||e||i?null:s.jsxs("div",{className:"rec-app-smartbanner-container",children:[s.jsx("button",{type:"button",className:"rec-app-smartbanner-close",onClick:o,children:"×"}),s.jsx("span",{className:"rec-app-smartbanner-icon",style:{backgroundImage:'url("/shared/img/favicons/app_icon.png")'}}),s.jsxs("div",{className:"rec-app-smartbanner-info",children:[s.jsx("div",{className:"rec-app-smartbanner-title",children:"Recreation.gov"}),s.jsx("div",{className:"rec-app-smartbanner-subtext",children:"Booz Allen Hamilton, Inc."}),s.jsx("div",{className:"rec-app-smartbanner-subtext",children:"In Google Play"})]}),s.jsx("div",{className:"rec-app-smartbanner-open",children:s.jsx("a",{href:"https://play.google.com/store/apps/details?id=com.bah.r1smobile",target:"_blank",rel:"noopener noreferrer",onClick:l,children:s.jsx("span",{className:"rec-app-smartbanner-button-text",children:"OPEN"})})})]})}function Mm({isAlertContainerVisible:t}){const e=n=>{n.preventDefault();const r=document.getElementById("page-content")?.getBoundingClientRect().top??0;window.scrollTo(0,r)};return s.jsxs("div",{children:[s.jsx("a",{href:"#page-content",className:"skip-navigation",onClick:e,children:"Skip to main content"}),t&&s.jsx(Pr,{})]})}/*! * Adapted from jQuery UI core * * http://jqueryui.com * * Copyright 2014 jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * * http://api.jqueryui.com/category/ui-core/ */const Om=/input|select|textarea|button|object/;function Pm(t){const e=t.offsetWidth<=0&&t.offsetHeight<=0;if(e&&!t.innerHTML)return!0;const n=window.getComputedStyle(t);return e?n.getPropertyValue("overflow")!=="visible":n.getPropertyValue("display")==="none"}function Lm(t){let e=t;for(;e&&e!==document.body;){if(Pm(e))return!1;e=e.parentNode}return!0}function $m(t,e){const n=t.nodeName.toLowerCase();return(Om.test(n)&&!t.disabled||n==="a"&&t.href||e)&&Lm(t)}function Dm(t){let e=t.getAttribute("tabindex");e===null&&(e=void 0);const n=Number.isNaN(Number(e));return(n||e>=0)&&$m(t,!n)}function Fm(t){return[].slice.call(t.querySelectorAll("*"),0).filter(Dm)}function Bm(t,e){const n=Fm(t);if(!n.length){e.preventDefault();return}const i=e.shiftKey,r=n[0],o=n[n.length-1];let l;if(t===document.activeElement){if(!i)return;l=o}if(o===document.activeElement&&!i&&(l=r),r===document.activeElement&&i&&(l=o),l){e.preventDefault(),l.focus();return}const c=/(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent);if(!(c!=null&&c[1]!=="Chrome"&&/\biPod\b|\biPad\b/g.exec(navigator.userAgent)==null))return;let u=n.indexOf(document.activeElement);if(u>-1&&(u+=i?-1:1),typeof n[u]>"u"){e.preventDefault(),l=i?o:r,l.focus();return}e.preventDefault(),n[u].focus()}const Hn=250;function qr({logoElement:t,darkModeLogoElement:e,appearance:n="light",children:i,className:r,direction:o="left",hasOverlay:l=!0,isOpen:c=!1,isLabelVisible:d,label:u,onClose:f,onCloseComplete:g,shouldUnmountOnExit:h=!0,triggerId:p,hasRecLogo:b=!1,width:x="narrow"}){const y=m.useRef(null),v=m.useRef(null),w=m.useRef(document.getElementById("rec-app")||document.getElementById("recApp")),C=m.useRef(),T=m.useRef(c),I=n==="dark",R=m.useCallback(()=>{f&&(f(),C.current=setTimeout(()=>{const S=document.getElementById(p);S&&S.focus&&S.focus(),g&&g()},Hn)),w.current?.removeAttribute("aria-hidden"),document.body.classList.remove("sarsa-drawer-open")},[f,g,p]);return m.useEffect(()=>{const S=_=>{_.key==="Escape"&&T.current&&(_.preventDefault(),R()),_.key==="Tab"&&l&&T.current&&Bm(y.current,_)};return window.addEventListener("keydown",S),()=>{window.removeEventListener("keydown",S)}},[R,l]),m.useEffect(()=>{T.current=c,c&&(C.current=setTimeout(()=>{y.current?.focus(),l&&(w.current?.setAttribute("aria-hidden","true"),document.body.classList.add("sarsa-drawer-open"))},Hn)),c||(w.current?.removeAttribute("aria-hidden"),document.body.classList.remove("sarsa-drawer-open"))},[c,l]),s.jsxs(Et,{children:[l&&s.jsx(la,{in:c,timeout:{appear:0,enter:0,exit:200},classNames:"sarsa-drawer-overlay",mountOnEnter:!0,unmountOnExit:h,nodeRef:v,children:s.jsx("div",{ref:v,"data-testid":"overlay","data-component":"Overlay",className:N("sarsa-drawer-overlay",{"is-hidden":!c}),onClick:R,role:"presentation"})}),s.jsx(la,{in:c,timeout:{appear:0,enter:0,exit:200},classNames:"sarsa-drawer",mountOnEnter:!0,unmountOnExit:h,nodeRef:y,children:s.jsx("div",{"data-component":"Drawer",tabIndex:-1,"aria-label":u,role:"group",ref:y,className:N("sarsa-drawer",{"direction-left":o==="left","direction-right":o==="right","width-narrow":x==="narrow","width-wide":x==="wide","width-full":x==="full"}),children:s.jsxs("div",{className:N("sarsa-drawer-inner",r,{"sarsa-drawer-dark":I}),children:[s.jsxs("div",{"data-component":"DrawerTop",className:N("sarsa-drawer-top",{"has-heading":d}),children:[s.jsxs("div",{children:[d&&s.jsx(ae,{"data-testid":"heading",headingLevel:1,appearance:"h5",children:u}),b&&s.jsx("div",{className:"sarsa-drawer-rec-logo",children:n==="dark"?e:t})]}),s.jsx(k,{"data-testid":"close-button",size:"md",appearance:I?"icon-white":"subtle",iconBeforeElement:s.jsx(j,{iconName:"close"}),screenReaderTextAfter:`Close ${u}`,onClick:R,className:"sarsa-drawer-close-btn"})]}),s.jsx("div",{"data-component":"DrawerContent",className:"sarsa-drawer-content",children:i})]})})})]})}qr.propTypes={logoElement:a.element,darkModeLogoElement:a.element,appearance:a.oneOf(["light","dark"]),children:a.node.isRequired,className:a.string,direction:a.oneOf(["left","right"]),hasOverlay:a.bool,isOpen:a.bool,isLabelVisible:a.bool,label:a.string.isRequired,onClose:a.func.isRequired,onCloseComplete:a.func,shouldUnmountOnExit:a.bool,triggerId:a.string.isRequired,hasRecLogo:a.bool,width:a.oneOf(["narrow","wide","full"])};function Xa({appearance:t="default",max:e=99,children:n,className:i,size:r="md",...o}){let l=n,c=e;const d=()=>{let u=0,f="";return typeof l!="number"?u:(l<0&&(l=0),c<0&&(c=0),c&&ci.auth.account?.account?.profile_picture_id);return m.useEffect(()=>{let i=!0;if(Dt||!n)return()=>{};async function r(){if(!(Dt||!n))try{const o=`/api/media/external/${n}`,l={headers:{Authorization:_e()}},c=await le.get(o,l);i&&typeof c.data.url=="string"&&(Dt=c.data.url,e(c.data.url))}catch{i&&(Dt="",e(""))}}return r(),()=>{i=!1}},[n]),t?s.jsx("img",{src:t,alt:"Profile avatar"}):s.jsx("div",{className:"nav-mobile-user-icon",children:s.jsx(j,{iconName:"account-circle"})})}function Hm({fullName:t,isCommercialAccount:e,isGuest:n=!1,menuAccountItems:i,hideBottomSignOut:r=!1,isLogged:o=!1,isGuestAllowed:l}){const c=Fe(),d=Vm(),u=()=>c(tr()),f=()=>c(l?bd():gd()),g=()=>window.location.href,h=()=>i.map((p,b)=>p.shouldHide||!o&&p.title==="Availability Alerts"?null:s.jsx("li",{className:p.parentClasses,children:s.jsxs(k,{isUnstyled:!0,clickTagCategory:p.clickTagCategory,clickTagAction:p.clickTagAction,clickTagLabel:g(),className:"rec-select-option-button",title:p.title,"aria-label":p.ariaLabel,href:p.href,children:[p.text,p.badge>0&&s.jsx("span",{className:"rec-select-option-badge-wrapper",children:s.jsx(Xa,{appearance:"info",max:10,children:p.badge})})]})},b));return s.jsxs("div",{className:N("nav-mobile-menu-account-panel",{"is-guest":n}),children:[o?s.jsxs("div",{children:[s.jsxs("div",{className:"nav-mobile-user-profile-head",children:[s.jsx(k,{isUnstyled:!0,href:"/account/profile",className:"username-button",children:s.jsxs("div",{className:"nav-profile-info",children:[d,s.jsx("span",{className:"ml-1 data-hj-suppress",children:n?"Guest":t})]})}),s.jsx(k,{appearance:"link",className:"rec-close-dropdown-button",onClick:u,"aria-label":"Sign Out",type:"button",children:"Sign Out"})]}),s.jsx("div",{className:"nav-user-profile-divider-wrapper",children:s.jsx($s,{})})]}):s.jsx("div",{className:"sign-in-button mb-1",children:s.jsx(k,{shouldFitContainer:!0,appearance:"tertiary-white",type:"button",onClick:f,children:"Sign Up / Log In"})}),s.jsxs("ul",{children:[!n&&h(),e?s.jsx("li",{className:"rec-select-option",children:s.jsx(k,{isUnstyled:!0,clickTagCategory:"Global Navigation",clickTagAction:"Commercial Account",clickTagLabel:g(),className:"rec-select-option-button",href:"/account/facilities",children:"Commercial Account"})}):null,r?null:s.jsx("li",{className:"rec-select-option",children:s.jsx("button",{className:"rec-close-dropdown-button",onClick:u,type:"button",id:"ga-global-nav-account-sign-out-link",children:"Sign Out"})})]})]})}function Um({menuAccountItems:t,isGuestAllowed:e,isGuest:n}){const i=Te(o=>o.auth.account?.account);let r="";if(i){const o=i.first_name;i.last_name.length>0&&(r=`${o} ${i.last_name[0]}.`)}return s.jsx(Hm,{fullName:r,isCommercialAccount:i?i.is_commercial_account:!1,hideBottomSignOut:!0,menuAccountItems:t,isGuest:n,isLogged:!!i,isGuestAllowed:e})}const qm=t=>{t?.account?.account?.account_id&&Array.isArray(window.dataLayer)&&window.dataLayer.push({userId:t.account.account.account_id}),t?.account?.account?.account_id&&(window.medallia_data={userId:t.account.account.account_id})},Gr="mobile-menu-toggle-btn",Un=[/^\/sitepass\//,/^\/camping\/campgrounds\//,/^\/camping\/gateways\//,/^\/timed-entry\//,/^\/ticket\//,/^\/tree-permits\//,/^\/activitypass\//,/^\/venues\//,/^\/permits\//,/^\/vehiclepermits\//];function Gm(t){const e=Yt(),[n,i]=m.useState(!1);return m.useEffect(()=>{if(t){i(!1);return}let r=!0;for(let o=0;o{if(t.current)return;const n=e.analyticsTrackedFlags;try{if(window.dataLayer&&n&&n?.length){const i={event:"launch-darkly-set",identifier:"launch-darkly-flags"};n.forEach(r=>{i[`launch-darkly-flag-${r}`]=e?.[r]}),window.dataLayer.push(i),t.current=!0}}catch{console.error("Caught error that needs to be piped to error reporting"),t.current=!0}},[e])}function zm(){const t=Te(n=>n.auth),e=Yt();m.useEffect(()=>{t?.account?.account?.account_id&&qm(t)},[t,e])}function Km(t){const[e,n]=m.useState(!1);return m.useEffect(()=>{const i=new IntersectionObserver(([r])=>{n(r.intersectionRatio<1)},{threshold:[1]});return t&&i.observe(t),()=>{i.disconnect()}},[t]),e}var Ym={searchAcrossUS:!1};const Zm="headerTextQuery";function Jm({isOpen:t,onClose:e,shouldDisplaySearchBar:n=!0,menuAccountItems:i,menuSections:r,logoElement:o,darkModeLogoElement:l,isGuestAllowed:c,isGuest:d}){const u=Ym?.searchAcrossUS,f=null,g=Fe(),h=()=>window.location.href,p=(x,y)=>{x.preventDefault();const{clickTagCategory:v,clickTagAction:w,inventoryTypes:C,uiFilters:T}=y,I={category:v,action:w,label:h()};Ge(I,()=>{g(ha("",C,null,null,T,u,f,"available"))})},b=()=>r.map((x,y)=>s.jsxs("div",{className:"section-menu",children:[s.jsxs("div",{className:"section-menu-title-wrapper",children:[s.jsx(ae,{appearance:"h5Caps",headingLevel:4,className:"section-menu-title",children:x.title}),s.jsx($s,{})]}),x.links.map((v,w)=>{const{url:C,ariaLabel:T,title:I,target:R,clickTagCategory:S,clickTagAction:_,inventoryTypes:M}=v;return M?s.jsx(k,{isUnstyled:!0,className:"section-menu-link","aria-label":T,onClick:O=>p(O,v),children:I},w):s.jsx(k,{isUnstyled:!0,clickTagCategory:S,clickTagAction:_,clickTagLabel:h(),href:C,className:"section-menu-link","aria-label":T,target:R,rel:"noopener noreferrer",children:I},w)})]},y));return s.jsx(qr,{label:"Mobile menu",isLabelVisible:!1,isOpen:t,onClose:e,triggerId:Gr,direction:"right",appearance:"dark",hasRecLogo:!0,logoElement:o,darkModeLogoElement:l,children:s.jsxs("div",{className:"nav-mobile-menu-body",children:[n?s.jsx("div",{className:"form-item-wrap",children:s.jsx(Ur,{size:"lg",queryCriteriaPropertyName:Zm,id:"mobile-menu-search-input",popupClassName:"mobile-menu-search-popup"})}):null,s.jsx(Um,{menuAccountItems:i,isGuestAllowed:c,isGuest:d}),b()]})})}const Xm="navbar-search-input",Qm="headerTextQuery";function Ib({darkModeLogoElement:t,getMenuAccountItems:e,isGuestAllowed:n=!0,logoElement:i,menuSections:r,shouldHideAllAlerts:o=!1,hideWarningMultiAlertBulletedStyle:l,siteBannerElement:c}){const[d,u]=m.useState(!1),[f,g]=m.useState(null),[h,p]=m.useState(!1),b=m.useRef(null),x=Fe(),y=Te(P=>P.cart),v=Te(P=>P.auth),w=Te(P=>P.modal),C=Te(P=>P.recaptcha.verification),{isLgAndUp:T}=Qt(),I=Km(b.current),R=Gm(o);Wm(),zm();const S=pt();async function _(){const P=uc();if(P)try{let D=await Md(P);D.data.results?.length>0?g(D.data.results[0].name):(D=await Od(P),D.data.results?.length>0&&g(D.data.results[0].name))}catch{}p(!0)}if(m.useEffect(()=>{x(yd()),Be()?x(fs(Os())):Ea()&&x(fs(Ni())),Ms()&&x(pd(Ti())),Zu("6Ld0BogUAAAAAGDL0sfz1wVdmuae18krNNQS6vW5"),pt()&&_()},[x]),dc())return s.jsx(Mm,{isAlertContainerVisible:R});const M=e(y?.reservation_count||0),O=n&&cr.test(window.location.pathname),A=()=>{u(P=>!P)},$=async P=>{P.type==="magic-link"?await x(ud(P)):await x(id({...P,userAgent:navigator.userAgent}))};let U=null;return S&&h&&(U=s.jsx(J,{xs:"variable",children:s.jsxs(Gt,{className:"first-inline-group rec-powered-by",alignX:"right",space:"xxs",children:[s.jsx("span",{children:s.jsx(re,{className:"tag-line-italic-text style-italic mr-1",children:"Brought to you by"})}),s.jsx("span",{children:s.jsx("a",{href:"/",target:"_blank",rel:"noreferrer",children:i})})]})})),s.jsxs(s.Fragment,{children:[s.jsx(Pp,{}),s.jsx(dp,{}),s.jsx(wp,{}),s.jsx("div",{ref:b,style:{position:"absolute",height:"1px"},"aria-hidden":"true"}),s.jsxs("header",{id:"nav-header-container",className:N("nav-header-container sticky",{"has-shadow":I}),children:[s.jsx(Ar,{}),s.jsx(Sp,{}),s.jsx(Am,{}),null,c,s.jsxs("div",{className:"nav-header",children:[s.jsxs("div",{className:"nav-header-left",children:[!S&&s.jsxs("div",{className:"nav-logo-holder",children:[s.jsx("a",{href:"/","aria-label":"Recreation.gov Homepage",id:"ga-global-nav-logo-link",className:"nav-logo-link",children:i}),v?.account?.account?.is_commercial_account?s.jsx("div",{className:"commercial-account-title",children:"Commercial"}):null]}),S&&f&&s.jsx("div",{className:"nav-logo-holder",children:s.jsx("div",{className:"widget-location-title",children:s.jsx("a",{href:ka()??"#",children:f})})}),S&&!f&&s.jsx("div",{className:"nav-logo-holder",children:U})]}),s.jsxs("nav",{className:"nav-header-right",children:[s.jsxs("div",{className:"nav-interactions-holder",children:[!S&&s.jsx("div",{className:"nav-search-bar-wrap",children:s.jsx("div",{className:"nav-search-input-wrapper",children:s.jsx(Ur,{queryCriteriaPropertyName:Qm,size:"md",id:Xm})})}),S&&f&&U,s.jsxs("div",{className:"nav-links-wrap",children:[s.jsx(Gt,{className:"first-inline-group",space:"sm",children:s.jsx(k,{appearance:"link",href:"https://help.recreation.gov/external",target:"_blank",rel:"noopener noreferrer",className:"nav-link",id:"ga-global-nav-help-link",children:"Help"})}),s.jsx(_u,{value:{clickedMobileMenuButton:A},children:s.jsx(op,{logoElement:i,accountServiceEnabled:v.accountServiceEnabled,cart:y,account:v.account,csrAccount:v.csrAccount,isGuest:v.isGuest,verification:C,loginNotice:v.loginNotice,loginError:v.loginError,errorText:v.errorText,lockout:v.lockout,mfaRequired:v.mfaRequired,fetchCart:P=>{x(Ji(P))},guestLogin:()=>{x(hd())},login:P=>{x(La(P))},loginResetState:()=>{x(Xc)},loggedIn:P=>{x(fs(P))},logout:()=>{x(tr())},csrSelectCustomer:P=>{x(md(P))},showLoginModal:w.showLoginModal,clearShowLoginModal:()=>{x(fd())},showMfaCodeModal:w.showMfaCodeModal,showMfaSetupModal:w.showMfaSetupModal,showSignInGuestModal:w.showSignInGuestModal,clearShowSignInGuestModal:()=>{x(xd())},showCreateAccountModal:w.showCreateAccountModal,clearShowCreateAccountModal:w.clearShowCreateAccountModal,showResetModal:w.showResetModal,clearShowResetModal:w.clearShowResetModal,extendTimer:()=>{x(Uc())},siteName:"Recreation.gov",isGuestAllowed:O,loginAfterPasswordUpdated:P=>{x(nd(P))},showConfirmModal:w.showConfirmModal,mfaAfterResetPassword:()=>{x(od())},resetPasswordWithCode:P=>x(er({...P,userAgent:navigator.userAgent})),completeRegistration:P=>x(cd({...P,userAgent:navigator.userAgent})),onSubmitMfa:$,onCloseMfa:()=>{x(vd())}})})]})]}),s.jsx(k,{appearance:"link",id:Gr,className:N("nav-mobile-menu-button",{"nav-active":d}),"aria-label":"Navigation Menu",clickTagCategory:"Global Navigation",clickTagAction:"Open Navigation Menu",clickTagLabel:"Hamburger Menu Button","aria-owns":d?"nav-mobile-menu-id":void 0,"aria-expanded":d,onClick:A,children:d?s.jsx(j,{iconName:"close"}):T?s.jsx(j,{iconName:"menu"}):s.jsx(j,{iconName:"rec-menu"})}),s.jsx(Jm,{isOpen:d,onClose:A,shouldDisplaySearchBar:!T&&!S,menuSections:S?[]:r,logoElement:i,darkModeLogoElement:t,menuAccountItems:M,isGuestAllowed:O,isGuest:v.isGuest})]})]})]}),R?s.jsx(Pr,{hideWarningMultiAlertBulletedStyle:l}):null]})}class ya extends m.Component{static{this.defaultProps={closeButton:!0}}constructor(e){super(e),this.state={showNotice:!0},this.closeNotice=this.closeNotice.bind(this)}closeNotice(){this.setState({showNotice:!1})}render(){return s.jsx("div",{"aria-live":"polite",children:s.jsx(Tr,{showNotice:this.state.showNotice,showClose:this.props.closeButton,closeNotice:this.closeNotice,noticeType:this.props.noticeType,children:this.props.children})})}}const me={available:"Available",availableBridged:"Available only for check out",availableSelected:"Selected",blocked:"Unavailable",checkout:"Checkout",closure:"Closure",currentReservation:"Current Reservation",earlyAccess:"Early Access",loading:"Loading availability data ...",lottery:"Lottery",notYetReleased:"Not Yet Released",soldOut:"Sold Out",inStation:"In-Station",walkup:"Walkup",unavailable:"Unavailable",unavailableSelected:"Selected but unavailable",firstComeFirstServed:"First-come, First-served",noTicketRequired:"No Ticket Required","ftm-running":"Running","ftm-completed":"Completed","ftm-error":"Error","ftm-dataIssue":"Data Issue"};function ef(t){if(!t)return{dayType:null,dayTypeSymbol:"",dayTypeLabel:""};switch(t){case"walkup":return{dayType:t,dayTypeSymbol:"W",dayTypeLabel:me[t]};case"inStation":return{dayType:t,dayTypeSymbol:s.jsx("div",{className:"rec-availability-in-station-icon",children:s.jsx(j,{iconName:"ranger-station",size:"sm"})}),dayTypeLabel:me[t]};case"firstComeFirstServed":return{dayType:t,dayTypeSymbol:"FF",dayTypeLabel:me[t]};case"lottery":return{dayType:t,dayTypeSymbol:"L",dayTypeLabel:me[t]};case"earlyAccess":return{dayType:t,dayTypeSymbol:"EA",dayTypeLabel:me[t]};case"blocked":return{dayType:t,dayTypeSymbol:"",dayTypeLabel:me[t]};case"currentReservation":return{dayType:t,dayTypeSymbol:"R",dayTypeLabel:me[t]};case"availableBridged":return{dayType:t,dayTypeSymbol:"",dayTypeLabel:me[t]};case"loading":return{dayType:t,dayTypeSymbol:"",dayTypeLabel:me[t]};case"notYetReleased":return{dayType:t,dayTypeSymbol:"NR",dayTypeLabel:me[t]};case"closure":return{dayType:t,dayTypeSymbol:"C",dayTypeLabel:me[t]};case"availableSelected":return{dayType:t,dayTypeSymbol:s.jsx(j,{size:"sm",iconName:"check-circle"}),dayTypeLabel:me[t]};case"unavailable":return{dayType:t,dayTypeSymbol:"",dayTypeLabel:me[t]};case"soldOut":return{dayType:t,dayTypeSymbol:"S",dayTypeLabel:me[t]};case"unavailableSelected":return{dayType:t,dayTypeSymbol:s.jsx(j,{size:"sm",iconName:"error"}),dayTypeLabel:me[t]};case"ftm-running":return{dayType:t,dayTypeSymbol:"R",dayTypeLabel:me[t]};case"ftm-completed":return{dayType:t,dayTypeSymbol:s.jsx(j,{size:"sm",iconName:"check"}),dayTypeLabel:me[t]};case"ftm-error":return{dayType:t,dayTypeSymbol:"E",dayTypeLabel:me[t]};case"ftm-dataIssue":return{dayType:t,dayTypeSymbol:s.jsx(j,{size:"sm",iconName:"warning"}),dayTypeLabel:me[t]};case"checkout":return{dayType:"checkout",dayTypeSymbol:"A",dayTypeLabel:me[t]};case"noTicketRequired":return{dayType:t,dayTypeSymbol:"NT",dayTypeLabel:me[t]};case"available":default:return{dayType:"available",dayTypeSymbol:"A",dayTypeLabel:me.available}}}function Wr(t){const{isLgAndUp:e,isXxlAndUp:n}=Qt();let i=1;return e&&(i+=1),n&&(i+=1),i}const tf=hi(ft());pi(tf);const sf=Zo(ft());function Eb(t){return!t||!t?.toString?null:Jo(t,"UTC").toAbsoluteString()}function af(t,e){const n=t?.start?t.start.toString():"null",i=t?.end?t.end.toString():"null",r=e?.start?e.start.toString():"null",o=e?.end?e.end.toString():"null";return!(n===r&&i===o)}function nf(t,e){const n=t?t.toString():"null",i=e?e.toString():"null";return n!==i}function rf(t){return t instanceof Date&&!Number.isNaN(t?.valueOf())}function of(t){const e="timeZone"in t?t.timeZone:void 0,n=ft();return t.toDate(e??n)}function lf({format:t,timeZone:e,showTimeZone:n}){let i;switch(t){case"l":i={dateStyle:"short"};break;case"L":i={month:"2-digit",day:"2-digit",year:"numeric"};break;case"ll":i={month:"short",day:"numeric",year:"numeric"};break;case"LL":i={month:"long",day:"numeric",year:"numeric"};break;case"LLL":i={month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"numeric",timeZoneName:n?"short":void 0};break;case"lll":i={month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"numeric",timeZoneName:n?"short":void 0};break;case"LLLL":i={weekday:"long",month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"numeric",timeZoneName:n?"short":void 0};break;case"llll":i={weekday:"short",month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"numeric",timeZoneName:n?"short":void 0};break;case"LT":i={hour:"numeric",minute:"numeric",timeZoneName:n?"short":void 0};break;case"LTS":i={hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:n?"short":void 0};break;default:throw new Error("FormattedDate received an unknown format")}return e&&(i.timeZone=e),i}const ra={};function cf(t,e){const n=`${t}-${JSON.stringify(e)}`;if(ra[n])return ra[n];const i="format"in e?lf(e):e,r=new Zt(t,i);return ra[n]=r,r}const df=t=>(e,n)=>{const i=t||navigator.language||"en-US",r=rf(e)?e:of(e);return cf(i,n).format(r)};function uf(){const{locale:t}=Qe();return df(t)}function kb(){const t=Hr(),[e]=mi(),[n,i]=m.useState(!1),[r,o]=m.useState(""),l=u=>{if(!u)return!1;const f=document.createElement("a");return f.href=u,f.hostname===window.location.hostname},c=u=>{if(!u)return;const f=e.get("pathname");if(f){const g=`/${f.split("/")[0]}`,h=`/${u.split("/")[0]}`;if(g===h){t(fs(Os())),window.location.assign(u);return}}document.location=u},d=async()=>{const u=e.get("next"),f=e.get("guest");if(!l(u)){i(!0),o("Malformed request - invalid next");return}if(f==="true"){const g=new Ht().readCookie("X-Mobile-Guest-Auth");if(g===null){i(!0),o("Malformed request - missing authentication");return}try{const h=JSON.parse(atob(g));if(!h.is_guest||!h.access_token||!h.account||!h.account?.account_id||!h.expiration){i(!0),o("Malformed request - invalid guest authentication");return}window.localStorage.setItem("recaccount",JSON.stringify(h)),window.dataLayer&&window.dataLayer.push({userId:h.account.account_id}),c(u);return}catch(h){let p=`${h}`;h instanceof on&&h?.response?.data.error&&(p=`${h}: ${h.response.data.error}`),i(!0),o(p);return}}else if(!Be()){const g=new Ht().readCookie("X-Mobile-Auth");if(g===null){i(!0),o("Malformed request - missing authentication");return}try{const b=(await le.get("/api/accounts/account",{headers:{Authorization:`Bearer ${g}`}})).data,x=sf.add({hours:1}).toAbsoluteString();window.localStorage.setItem("recaccount",JSON.stringify({access_token:g,account:b,expiration:x})),window.dataLayer&&window.dataLayer.push({userId:b.account_id}),c(u);return}catch(h){let p=`${h}`;h instanceof on&&h?.response?.data.error&&(p=`${h}: ${h.response.data.error}`),i(!0),o(p);return}}c(u)};return m.useEffect(()=>{d()},[]),n?s.jsxs(ya,{noticeType:"error",closeButton:!1,children:[s.jsx("div",{className:"rec-notification-title-single-row",children:"Error loading your account:"}),s.jsx("p",{children:"There was an error logging into your account. Please go back and try again or log out and log back in again into the application."}),s.jsx("p",{children:r})]}):s.jsx(ke,{})}const qn={error:{display:!1,message:""},success:{display:!1,message:""},warning:{display:!1,message:""},info:{display:!1,message:""}},zr=_s({name:"notifications",initialState:qn,reducers:{dismissNotification:(t,e)=>{const n=e.payload;t[n]={display:!1,message:""}},setNotification:(t,e)=>{const{type:n,message:i}=e.payload;Object.assign(t,qn),t[n]={display:!0,message:i}}}}),{dismissNotification:_b,setNotification:Ab}=zr.actions,hf=zr.reducer;function Mb(){const t=be(),e=t?window.localStorage.getItem("r1s_search_session"):null;let n=null,i={};try{if(n=e?JSON.parse(e):null,n){const r=new Date(n.last_updated_datetime),o=new Date;o.setHours(o.getHours()-4),(rDate.now())&&(n=null,window.localStorage.removeItem("r1s_search_session"))}}catch{n=null,t&&window.localStorage.removeItem("r1s_search_session")}return n&&(i={...i,search:n}),i}const pf={ldClient:null},Kr=_s({name:"launchdarkly",initialState:pf,reducers:{setClient:(t,e)=>{t.ldClient=e.payload}}}),{setClient:Yr}=Kr.actions,mf=Kr.reducer,ff={loading:!1,loaded:!1,error:null,data:null};function gf(t=ff,e){switch(e.type){case Ki:return{loading:!0,loaded:!1,error:null,data:t.data};case Yi:return{loading:!1,loaded:!0,error:null,data:e.payload};case Zi:return{loading:!1,loaded:!0,error:e.error,data:t.data};default:return t}}const bf={expiration:"",expiresIn:0,reservations:[],showTimer:!1,hasError:!1,account_id:"",subtotal:"0",discount:"0",tax:"0",total:"0",reservation_count:0,showSessionWarning:!1,is_modification:!1,err_message:"",isExtendingTime:!1},vf=t=>{const e=t.replace(/\D/g," ").split(" "),n=e.length>2?parseInt(e[0],10):0,i=e.length>2?parseInt(e[1],10):parseInt(e[0],10);return(n*60+i)*1e3};function xf(t=bf,e){const n={...t},i=mc*60*60*1e3;switch(e.type){case Aa:{let r=[...e.payload.reservations,...e.payload.untimed_reservations];e.payload.modification&&(n.is_modification=!0,r=[e.payload.modification]),n.hasError=!1;for(const l of r)if(l.errors){n.hasError=!0;break}const o=new Date(Date.now()+e.payload.expires_in*1e3);return n.expiration=o.toISOString(),n.expiresIn=e.payload.expires_in,n.reservation_count=r.length,n.reservations=r,n.showTimer=e.payload.reservations.length>0||e.payload.modification,n.account_id=e.payload.account_id,n.subtotal=e.payload.subtotal,n.discount=e.payload.discount,n.tax=e.payload.tax,n.total=e.payload.total,n.session=e.payload.session,n.sessionDuration=vf(n.session),n.sessionLimit=n.sessionDuration+5*60*1e3,n.maxDuration=i,n.showSessionWarning=n.sessionLimit>=n.maxDuration,delete n.err,n}case qi:return n.expiration=e.payload.expiration,n.expiresIn=e.payload.expires_in,n.showTimer=e.payload.active_timer,n.reservation_count=e.payload.reservation_count,n;case Rc:return n;case Ma:return n.err_message=e.payload,delete n.err,n;case Ec:return n.err_message=e.payload,delete n.err,n;case ua:return n.isExtendingTime=e.payload,n;default:return n}}const yf={alerts:[],locationParams:null},wf=(t=yf,e)=>{switch(e.type){case Ri:return{...t,alerts:e.alerts};case fc:return{...t,alerts:[]};default:return t}},Cf={account:null,csrAccount:null,loginError:!1,mfaRequired:!1,accountServiceEnabled:!1,lockout:!1,isGuest:!1,announcement:{banner_enabled:!1},loginNotice:{notice_enabled:!1},accountServiceStatusUpdated:!1},Sf=(t=Cf,e)=>{switch(e.type){case Ii:return{...t,account:e.profile,isGuest:e.profile.is_guest,loginError:!1,mfaRequired:!1,lockout:!1};case _i:return{...t,account:null,isGuest:!1,loginError:!1,mfaRequired:!1,lockout:!1,errorText:null};case Ei:return{...t,account:null,loginError:!0,errorText:e.payload,mfaRequired:!1,lockout:!1};case Ai:return{...t,account:null,loginError:!0,mfaRequired:!1,lockout:!1};case ki:return{...t,account:null,loginError:!1,mfaRequired:!1,lockout:!0};case _a:return{...t,loginError:!1};case Pi:return{...t,account:null,loginError:!1,mfaRequired:!0,lockout:!1};case Oi:return{...t,account:null,csrAccount:null,loginError:!1,mfaRequired:!1,lockout:!1};case Li:return{...t,accountServiceEnabled:e.enabled,announcement:e.announcement,loginNotice:e.loginNotice,accountServiceStatusUpdated:!0};case Mi:return{...t,csrAccount:e.profile,loginError:!1,mfaRequired:!1,lockout:!1};case gc:return{...t,account:null};default:return t}},Gn={showSignInGuestModal:!1,showLoginModal:!1,showCreateAccountModal:!1,showResetModal:!1,showCartLimitExceededModal:!1,showMfaSetupModal:!1,showMfaCodeModal:!1,showConfirmModal:!1},Nf=(t=Gn,e)=>{if(typeof t>"u")return Gn;switch(e.type){case $i:return{...t,showLoginModal:!0};case Di:return{...t,showLoginModal:!1};case Fi:return{...t,showSignInGuestModal:!0};case Bi:return{...t,showSignInGuestModal:!1};case xc:return{...t,showCreateAccountModal:!0};case yc:return{...t,showCreateAccountModal:!1};case wc:return{...t,showResetModal:!0};case Cc:return{...t,showResetModal:!1};case Sc:return{...t,showCartLimitExceededModal:!0};case Vi:return{...t,showCartLimitExceededModal:!1};case Hi:return{...t,showMfaSetupModal:!0};case Nc:return{...t,showMfaSetupModal:!1};case _a:return{...t,showMfaCodeModal:!0};case Ui:return{...t,showMfaCodeModal:!1};case Tc:return{...t,showConfirmModal:!0};case jc:return{...t,showConfirmModal:!1};default:return t}},Tf={verification:""},jf=(t=Tf,e)=>{switch(e.type){case bc:return{...t,verification:e.verification};case vc:return{...t,verification:""};default:return t}};function Re(t){return JSON.parse(JSON.stringify(t))}const Rf={showSearchInput:!0,what:"",headerTextQuery:"",where:"",lat:null,lng:null,map_center_lat:null,map_center_lng:null,radius:null,placeid:null,placename:null,start:null,sort:null,size:null,checkin_time:null,checkout_time:null,highlighted_item:-1,uiFilters:{hasFilters:!1,accommodations:{},agencies:{},campsiteUseTypes:{},campsiteTypes:{},campsiteAmenities:{},campsiteElectricityHookup:{},campsiteVehicleLength:{},campsiteEquipment:{},activities:{},occupants:{},inventoryTypes:{},tourTypes:{},tourAccessible:{},tourDifficulty:{},tourDuration:{},tourPrice:{},tourTime:{},tourTimes:{},permitTypes:{},reservable:{},lastAppliedFilter:null,includeUnavailable:!0},inventoryTypeFiltersVisible:!1,filtersVisible:!1,filters:[],aggregations:[]};function If(t){for(const e in t.uiFilters)if(si(t.uiFilters[e])&&!Ee(t.uiFilters[e]))return!0;return!1}const Ie=t=>{let e=t;if(e||(e={}),e.last_updated_datetime=new Date().getTime(),window.localStorage)try{window.localStorage.setItem("r1s_search_session",JSON.stringify(e))}catch{}return e};function Ef(t=Rf,e){let n=t,i=null;switch(e.type){case $c:return n=Re(t),n.checkin_time=e.time,delete n.err,Ie(n);case Dc:return n=Re(t),n.checkout_time=e.time,delete n.err,Ie(n);case Ac:return n=Re(t),n[e.name]=e.value,Ie(n);case Gi:return n=Re(t),n={...n,...e},Ie(n);case Wi:return n=Re(t),i=new Map(Object.entries(n.uiFilters[e.uiFilterName]||{})),i.set(e.uiFilterOption.key,e.uiFilterOption),n.uiFilters[e.uiFilterName]=Object.fromEntries(i),n.uiFilters.hasFilters=!0,n.uiFilters.lastAppliedFilter=e.uiFilterName,n.start=0,Ie(n);case Mc:return n=Re(t),i=new Map,i.set(e.uiFilterOption.key,e.uiFilterOption),n.uiFilters[e.uiFilterName]=Object.fromEntries(i),n.uiFilters.hasFilters=!0,n.uiFilters.lastAppliedFilter=e.uiFilterName,n.start=0,Ie(n);case Oc:return n=Re(t),i=new Map(Object.entries(n.uiFilters[e.uiFilterName]||{})),i.delete(e.uiFilterOption.key),n.uiFilters[e.uiFilterName]=Object.fromEntries(i),n.uiFilters.hasFilters=If(n),n.uiFilters.lastAppliedFilter=e.uiFilterName,n.start=0,Ie(n);case zi:return n=Re(t),n.filters=[],n.include_unavailable=!0,n.include_notreservable=!0,n.include_partially_available=!0,n.start=0,n.uiFilters={hasFilters:!1,campsiteUseTypes:{},campsiteTypes:{},campsiteAmenities:{},campsiteElectricityHookup:{},campsiteVehicleLength:{},campsiteEquipment:{},activities:{},agencies:{},occupants:{},inventoryTypes:{},tourTypes:{},tourAccessible:{},tourDifficulty:{},tourDuration:{},tourPrice:{},tourTime:{},tourTimes:{},permitTypes:{},reservable:{},lastAppliedFilter:null},n.highlighted_item=-1,Ie(n);case Pc:return n=Re(t),n.include_unavailable=!0,n.include_notreservable=!0,n.include_partially_available=!0,n.start=0,n.uiFilters.campsiteUseTypes={},n.uiFilters.campsiteTypes={},n.uiFilters.campsiteAmenities={},n.uiFilters.campsiteElectricityHookup={},n.uiFilters.campsiteVehicleLength={},n.uiFilters.campsiteEquipment={},n.uiFilters.occupants={},n.uiFilters.reservable={},n.highlighted_item=-1,Ie(n);case Lc:return n=Re(t),n.highlighted_item=e.payload,delete n.err,Ie(n);case Vc:return n=Re(t),n.showSearchInput=!1,delete n.err,Ie(n);case Bc:return n=Re(t),n.showSearchInput=!0,delete n.err,Ie(n);case Fc:return e.payload;default:return n}}const kf={suggestions:[],inventory_suggestions:[]};function _f(t=kf,e){let n=t;switch(e.type){case kc:return n={...t},n.suggestions=e.suggestions,n.inventory_suggestions=e.inventory_suggestions,n.content_suggestions=e.content_suggestions,n.merchandise_suggestions=e.merchandise_suggestions,delete n.err,n;case _c:return n={...t},n.err=e.err,n;default:return n}}const Ob={alertsNotification:wf,modal:Nf,auth:Sf,search:Ef,searchSuggestions:_f,cart:xf,launchdarkly:mf,recaptcha:jf,notifications:hf,slugs:cu,asset:gf,toast:Rp};function Af({onSwipe:t,onTouchStart:e,onTouchEnd:n,onSwipeLeft:i,onSwipeRight:r,onSwipeUp:o,onSwipeDown:l,minDistance:c=50,maxDuration:d=750}){const u=m.useRef(null),f=m.useRef(null);return{onTouchStart:b=>{f.current=null,u.current={x:b.targetTouches[0].clientX,y:b.targetTouches[0].clientY,time:b.timeStamp},e&&e()},onTouchMove:b=>{f.current={x:b.targetTouches[0].clientX,y:b.targetTouches[0].clientY,time:b.timeStamp}},onTouchEnd:()=>{if(!f.current||!u.current||(n&&n(),f.current.time-u.current.time>d))return;const b=u.current.x-f.current.x,x=u.current.y-f.current.y,y=Math.abs(b)>c||Math.abs(x)>c,v=b>c,w=b<-c,C=x>c,T=x<-c;y&&t&&t(),v&&i&&i(),w&&r&&r(),C&&o&&o(),T&&l&&l(),u.current=null,f.current=null}}}function Mf(t,e,n,i){let r=t;return r/=i/2,r<1?n/2*r*r+e:(r-=1,-n/2*(r*(r-2)-1)+e)}const Wn=t=>{const{element:e,to:n,duration:i,scrollDirection:r}=t,o=e[r],l=n-o;let c=0;const d=16.6666,u=()=>{c+=d;const f=Mf(c,o,l,i);e[r]=f,c3?d.length%3:0,g=f?d.substr(0,f)+o:"",h=d.substr(f).replace(/(\d{3})(?=\d)/g,`$1${o}`);let p=l+g+h+u;return i&&(p=p.replace(/([0-9]+(\.[0-9]+[1-9])?)(\.?0+$)/,"$1")),p}function Zr(t){return new TextEncoder().encode(t)}Zr("er987452-e845e-obaUf-UzX94111253-736gaa");Zr("1234567891123456");function Jr({name:t,icon:e,colorSupport:n}){return s.jsxs("div",{className:"rec-availability-item",children:[s.jsx("div",{className:`rec-availability-block-icon rec-color-support-${n}`,children:e}),s.jsx("div",{className:"rec-availability-item-type",children:t})]})}Jr.propTypes={name:a.string.isRequired,icon:a.element.isRequired,colorSupport:a.oneOf(["01","02","03","04"]).isRequired};function Of({name:t,icon:e,colorSupport:n}){return s.jsx(Jr,{name:t,icon:e,colorSupport:n},t)}function Pf({...t}){return s.jsx(Of,{name:"Management Site",colorSupport:"02",icon:s.jsx(j,{iconName:"flag"}),...t})}const $e=8,Lf=100,$f={transition:"all 300ms ease-out",opacity:0},Df={bottom:{transform:"translate(0, 4px)"},top:{transform:"translate(0, -4px)"},right:{transform:"translate(4px, 0)"},left:{transform:"translate(-4px, 0)"},bottomLeft:{transform:"translate(0, 4px)"},bottomRight:{transform:"translate(0, 4px)"},topLeft:{transform:"translate(0, -4px)"},topRight:{transform:"translate(0, -4px)"}},Ff={entering:{opacity:0},entered:{opacity:1,transform:"translate(0, 0)"},exiting:{},exited:{},unmounted:{}};class Xr extends m.PureComponent{constructor(e){super(e),this.handleWindowResize=st(()=>{const{isVisible:n}=this.props;n&&this.setState({tooltipRect:null})},100),this.tooltipRef=m.createRef(),this.spanRef=m.createRef(),this.state={tooltipRect:null}}static{this.propTypes={id:a.string.isRequired,content:a.node.isRequired,position:a.oneOf(["top","bottom","right","left","topLeft","topRight"]),maxWidth:a.number,isVisible:a.bool,triggerRef:a.shape({current:a.any})}}static{this.defaultProps={position:"top",maxWidth:250}}componentDidMount(){window.addEventListener("resize",this.handleWindowResize)}componentDidUpdate(e){const{content:n}=this.props,{tooltipRect:i}=this.state;(!i||n!==e.content)&&this.tooltipRef.current&&this.setState({tooltipRect:this.tooltipRef.current.getBoundingClientRect()})}componentWillUnmount(){window.removeEventListener("resize",this.handleWindowResize)}render(){const{content:e,position:n,maxWidth:i,isVisible:r,triggerRef:o,id:l}=this.props,{tooltipRect:c}=this.state;if(!r)return null;if(!c)return s.jsx(Et,{children:s.jsx("div",{className:"sarsa-tooltip",style:{visibility:"hidden",maxWidth:i},ref:this.tooltipRef,children:e})});if(!o?.current||!o?.current.getBoundingClientRect)return console.warn("Tooltip requires a single child that can be assigned a ref. Supply either an html element or a React component with a innerRef prop that is passed to an html element."),null;const d=document.body.getBoundingClientRect(),u=o.current.getBoundingClientRect(),f=(u.width-c.width)/2,g=(u.height-c.height)/2,h={top:u.top-c.height<0,bottom:window.innerHeights.jsx("span",{ref:this.spanRef,className:N("sarsa-tooltip",p),"data-component":"Tooltip",role:"tooltip",style:{...y,...$f,...Df[p],...Ff[v]},id:l,children:e})})})}}let Bf=class extends m.PureComponent{constructor(e){super(e),this.onMouseEnter=n=>{const{onMouseEnter:i}=this.props;this.showTooltip(),i&&i(n)},this.onMouseLeave=n=>{const{onMouseLeave:i}=this.props;this.hideTooltip(),i&&i(n)},this.onFocus=n=>{const{onFocus:i}=this.props;this.showTooltip(),i&&i(n)},this.onBlur=n=>{const{onBlur:i}=this.props;this.hideTooltip(),i&&i(n)},this.showTooltip=()=>{this.props.content&&!this.triggerRef.current.disabled&&this.setState({isVisible:!0})},this.hideTooltip=()=>{this.setState({isVisible:!1})},this.triggerRef=e.triggerRef||m.createRef(),this.state={isVisible:!1}}static{this.propTypes={children:a.node.isRequired,content:a.node.isRequired,position:a.oneOf(["top","bottom","right","left","topLeft","topRight"]),maxWidth:a.number,id:a.string,triggerRef:a.shape({current:a.any}),onMouseEnter:a.func,onMouseLeave:a.func,onFocus:a.func,onBlur:a.func,isHidden:a.bool}}static{this.defaultProps={position:"top",maxWidth:250,id:"tooltip-component"}}render(){const{children:e,content:n,maxWidth:i,position:r,id:o,isHidden:l}=this.props,{isVisible:c}=this.state;return l?e:s.jsxs(s.Fragment,{children:[m.Children.map(e,d=>{if(!d||typeof d!="object")return null;const u=typeof d.type,f={"aria-describedby":c?o:void 0,onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onFocus:this.onFocus,onBlur:this.onBlur};return u==="string"?f.ref=this.triggerRef:f.innerRef=this.triggerRef,m.cloneElement(d,f)}),s.jsx(Xr,{id:o,content:n,position:r,maxWidth:i,isVisible:c,triggerRef:this.triggerRef})]})}};function ce({name:t,text:e,availClass:n,tooltipContent:i,"aria-label":r}){return s.jsxs("div",{className:"rec-availability-item",children:[s.jsx("div",{className:`rec-availability-block rec-${n}`,role:"img","aria-label":r,children:e},t),i?s.jsx(Bf,{content:i,children:s.jsx(k,{appearance:"subtle",size:"xxs",className:"rec-availability-item-type",children:t})}):s.jsx("div",{className:"rec-availability-item-type",children:t})]})}function Vf(){return s.jsx(ce,{text:"R",name:"Current Reservation",availClass:"available","aria-label":"Solid color background with letter R"})}function Hf(){return s.jsx(ce,{text:"A",name:"Available",availClass:"available","aria-label":"Solid color background with letter A"})}function Uf(){return s.jsx(ce,{text:"#",name:"Available",availClass:"available","aria-label":"Solid color background with number"})}function qf(){return s.jsx(ce,{text:"A",name:"Checkout",availClass:"available-checkout","aria-label":"Half shaded color with letter A"})}function Gf(){return s.jsx(ce,{text:"NR",name:"Not Yet Released",availClass:"not-yet-released","aria-label":"Solid color with letters NR"})}function Wf(){return s.jsx(ce,{text:"W",name:"Walk-up",availClass:"walk-up",tooltipContent:"Available only from the facility's office.","aria-label":"Solid color with letter W"})}function zf(){return s.jsx(ce,{text:s.jsx("div",{className:"rec-availability-in-station-icon",children:s.jsx(j,{iconName:"ranger-station",size:"sm"})}),name:"In-Station",availClass:"in-station",tooltipContent:"This date is not available to reserve. A permit for this date may only be obtained through the facility's issuing station.","aria-label":"Solid color with ranger station icon"})}function Kf(){return s.jsx(ce,{text:"L",name:"Lottery",availClass:"lottery",tooltipContent:"Allocated through lottery, see important dates for information.","aria-label":"solid color with letter L"})}function Yf(){return s.jsx(ce,{text:"EA",name:"Early Access",availClass:"early-access",tooltipContent:"Allocated through Early Access Lottery, see important dates for information.","aria-label":"half shaded color with letters EA"})}function Zf(){return s.jsx(ce,{text:"C",name:"Closure",availClass:"unavailable","aria-label":"Solid color with letter C"})}function Jf(){return s.jsx(ce,{text:"#",name:"Unavailable",availClass:"unavailable","aria-label":"Solid gray with symbol #"})}function Xf(){return s.jsx(ce,{text:"S",name:"Sold Out",availClass:"unavailable","aria-label":"Solid gray with letter S"})}function Qf(){return s.jsx(ce,{text:"R",name:"Reserved",availClass:"unavailable","aria-label":"Solid color with letter R"})}function eg(){return s.jsx(ce,{text:"X",name:"Unavailable",availClass:"unavailable","aria-label":"Solid color with letter X"})}function zn(){return s.jsx(ce,{text:" ",name:"Unavailable",availClass:"unavailable","aria-label":"Solid gray blank"})}function tg(){return s.jsx(ce,{text:" ",name:"Not Yet Released",availClass:"available-bridged",tooltipContent:"Reservable only when bridged from an available start date","aria-label":"Striped color blank"})}function sg(){return s.jsx(ce,{text:" ",name:"Check-Out Only",availClass:"available-bridged",tooltipContent:"Reservable only when bridged from an available start date","aria-label":"stripe color blank"})}function ag(){return s.jsx(ce,{text:"FF",name:"First-come, First-served",availClass:"first-come",tooltipContent:"This site is not available to reserve in advance online or by phone. You must physically arrive at the facility to see if the site is available. There is no guarantee this site will be available to purchase upon your arrival.","aria-label":"Solid color with letters FF"})}function ng(){return s.jsx(ce,{text:"NT",name:"No Ticket Required",availClass:"no-ticket-required",tooltipContent:"No ticket is required to visit location on this date","aria-label":"Solid color with letters NT"})}function ig(){return s.jsx(ce,{text:s.jsx("div",{className:"pt-fourth",children:s.jsx(j,{iconName:"check-circle",size:"sm",style:{color:"#5A8029"}})}),name:"Selected Available",availClass:"available-selected","aria-label":"Solid color with checkmark"})}function rg(){return s.jsx(ce,{text:s.jsx("div",{className:"pt-fourth",children:s.jsx(j,{iconName:"error",size:"sm",style:{color:"#D83933"}})}),name:"Selected Unavailable",availClass:"unavailable-selected","aria-label":"Solid color with error symbol"})}function og(){return s.jsx(ce,{text:s.jsx("div",{className:"pt-fourth",children:s.jsx(j,{iconName:"check",size:"sm"})}),name:"Completed",availClass:"ftm-completed","aria-label":"Solid color with checkmark"})}function lg(){return s.jsx(ce,{text:"R",name:"Running",availClass:"ftm-running","aria-label":"Solid color with letter R"})}function cg(){return s.jsx(ce,{text:"E",name:"Error",availClass:"ftm-error","aria-label":"Solid color with letter E"})}function dg(){return s.jsx(ce,{text:s.jsx("div",{className:"pt-fourth",children:s.jsx(j,{iconName:"warning",size:"sm"})}),name:"Data Issue",availClass:"ftm-data-issue","aria-label":"solid color with warning icon"})}function Qr({legendItems:t={}}){return s.jsxs("div",{className:"rec-availability-indicators",children:[t.currentReservation&&s.jsx(Vf,{}),t.loading&&null,t.available&&s.jsx(Hf,{}),t.checkout&&s.jsx(qf,{}),t.availableNumber&&s.jsx(Uf,{}),t.inStation&&s.jsx(zf,{}),t.walkup&&s.jsx(Wf,{}),t.firstComeFirstServed&&s.jsx(ag,{}),t.noTicketRequired&&s.jsx(ng,{}),t.lottery&&s.jsx(Kf,{}),t.earlyAccess&&s.jsx(Yf,{}),t["ftm-running"]&&s.jsx(lg,{}),t["ftm-completed"]&&s.jsx(og,{}),t["ftm-dataIssue"]&&s.jsx(dg,{}),t["ftm-error"]&&s.jsx(cg,{}),t.soldOut&&s.jsx(Xf,{}),t.unavailable&&s.jsx(Jf,{}),t.unavailableReserved&&s.jsx(Qf,{}),t.unavailableCross&&s.jsx(eg,{}),t.unavailableBlank&&s.jsx(zn,{}),t.blocked&&s.jsx(zn,{}),t.availableBridged&&s.jsx(tg,{}),t.slidingWindow&&s.jsx(sg,{}),t.notYetReleased&&s.jsx(Gf,{}),t.managementSite&&s.jsx(Pf,{}),t.availableSelected&&s.jsx(ig,{}),t.unavailableSelected&&s.jsx(rg,{}),t.closure&&s.jsx(Zf,{})]})}Qr.propTypes={legendItems:a.shape({available:a.bool,availableBridged:a.bool,availableNumber:a.bool,availableSelected:a.bool,blocked:a.bool,checkout:a.bool,closure:a.bool,currentReservation:a.bool,earlyAccess:a.bool,firstComeFirstServed:a.bool,lottery:a.bool,managementSite:a.bool,notYetReleased:a.bool,slidingWindow:a.bool,unavailable:a.bool,unavailableBlank:a.bool,unavailableCross:a.bool,unavailableReserved:a.bool,unavailableSelected:a.bool,walkup:a.bool,noTicketRequired:a.bool})};a.number,a.oneOfType([a.array,a.element]).isRequired,a.func,a.bool;function ug(t,e){const n=No(t.title,{length:e});if(t.to)return s.jsx(oi,{to:t.to,id:`breadcrumb-item-${bn(n)}`,children:n});const i=t.href||t.url;return i?s.jsx("a",{href:i,id:`breadcrumb-item-${bn(n)}`,children:n}):s.jsx("span",{children:n})}function Lb({path:t,maxLengthTitle:e=35}){return s.jsx("nav",{"aria-label":"Breadcrumbs","data-testid":"breadcrumbs",children:s.jsx("ul",{className:"rec-breadcrumb",children:t.map((n,i)=>{const r=i===t.length-1;return s.jsxs("li",{"aria-current":r?"location":void 0,translate:n.translate,children:[ug(n,e),r?null:s.jsx("div",{className:"breadcrumb-separator","aria-hidden":"true",children:"/"})]},n.title)})})})}function hg({boundaryCount:t=1,numPages:e=1,isDisabled:n=!1,activeIndex:i,onChange:r,siblingCount:o=1,...l}){const c=y=>{r(y)},d=(y,v)=>{const w=v-y+1;return Array.from({length:w},(C,T)=>y+T)},u=d(1,Math.min(t,e)),f=d(Math.max(e-t+1,t+1),e),g=Math.max(Math.min(i+1-o,e-t-o*2-1),t+2),h=Math.min(Math.max(i+1+o,t+o*2+2),f.length>0?f[0]-2:e-1),p=["previous",...u];g>t+2?p.push("ellipsis"):t+1t&&p.push(e-t),p.push(...f),p.push("next");const b=y=>{switch(y){case"first":return 1;case"previous":return i-1;case"next":return i+1;case"last":return e;default:return 1}};return{items:p.map(y=>typeof y=="number"?{onClick:()=>{c(y-1)},type:"page",page:y,isSelected:y-1===i,disabled:n,"aria-current":y-1===i?!0:void 0}:{onClick:()=>{c(b(y))},type:y,page:b(y),isSelected:!1,disabled:n||y.indexOf("ellipsis")===-1&&(y==="next"?i+1>=e:i<=0)}),...l}}function $b({pages:t=10,activePage:e,onChange:n,ariaLabel:i,"aria-label":r="Pagination",siblingCount:o=1,boundaryCount:l=1,gaTrackingId:c,...d}){const{items:u}=hg({numPages:t,activeIndex:e??0,onChange:n,siblingCount:o,boundaryCount:l});return s.jsx("nav",{"data-component":"Pagination","aria-label":i??r,...d,children:s.jsx("ul",{className:"rec-pagination",children:u.map(({page:f,type:g,isSelected:h,...p},b)=>{let x=null;if(g==="ellipsis")x=s.jsx("span",{className:"no-select","aria-hidden":"true",children:"..."});else if(g==="previous"){const y="Go to previous page";x=s.jsx(k,{isUnstyled:!0,"aria-label":y,"data-ga-tracking-id":c,"data-ga-tracking-value":y,...p,children:s.jsx(j,{iconName:"chevron-left"})})}else if(g==="next"){const y="Go to next Page";x=s.jsx(k,{isUnstyled:!0,"aria-label":y,"data-ga-tracking-id":c,"data-ga-tracking-value":y,...p,children:s.jsx(j,{iconName:"chevron-right"})})}else{const y=h?`Current page, page ${f}`:`Go to page ${f}`;x=s.jsx(k,{isUnstyled:!0,"data-ga-tracking-id":c,"data-ga-tracking-value":y,"data-selected":h,"aria-label":y,...p,children:f})}return s.jsx("li",{children:x},b)})})})}a.array,a.number,a.oneOfType([a.array,a.element]),a.func,a.bool;a.oneOf(["Available","First-come, First-served","Lottery","Partially Available","Unavailable","Not Yet Released","New","Enter Date","Enter Dates","View Availability","Registration Closed","Registration Open","Registration Coming Soon","Waitlist Only"]),a.string,a.bool;a.string.isRequired,a.oneOf(["status-closed","status-available","status-unreleased","status-reserved"]).isRequired;a.node;a.arrayOf(a.string).isRequired,a.object,a.bool,a.number;a.bool,a.bool.isRequired,a.func,a.func.isRequired,a.func.isRequired,a.func.isRequired,a.func.isRequired,a.node.isRequired,a.string,a.string.isRequired,a.bool,a.bool,a.string;class Db extends K.Component{static propTypes={children:a.node.isRequired,className:a.string,background:a.oneOf(["white","gray-1","gray-2"])};constructor(e){super(e),this.state={scrolledLeft:!0,scrolledRight:!0,doChildrenFit:!1},this.scrollWidth=0,this.handleLeftNavClick=this.handleLeftNavClick.bind(this),this.handleRightNavClick=this.handleRightNavClick.bind(this),this.throttledSetNavButtons=st(this.setNavButtons,150)}componentDidMount(){window.addEventListener("resize",this.throttledSetNavButtons),this.viewport.addEventListener("scroll",this.throttledSetNavButtons),this.setNavButtons()}componentDidUpdate(){this.setNavButtons()}componentWillUnmount(){this.throttledSetNavButtons.cancel(),window.removeEventListener("resize",this.throttledSetNavButtons),this.viewport.removeEventListener("scroll",this.throttledSetNavButtons)}handleLeftNavClick(e){e.preventDefault();const n=this.viewport.scrollLeft,i=this.viewport.offsetWidth,r=n-i,o=Math.abs(n-r)*.5;Wn({element:this.viewport,to:r,duration:o,scrollDirection:"scrollLeft"})}handleRightNavClick(e){e.preventDefault();const n=this.viewport.scrollLeft,i=this.viewport.offsetWidth,r=n+i,o=Math.abs(n-r)*.5;Wn({element:this.viewport,to:r,duration:o,scrollDirection:"scrollLeft"})}setNavButtons=()=>{if(typeof this.viewport!="object")return;const e=this.viewport.scrollWidth;e!==this.scrollWidth&&(this.scrollWidth=e);const n=this.viewport.scrollLeft,i=Math.ceil(this.viewport.getBoundingClientRect().width),r=e-i,o=16,l=e<=i||n<=o,c=e<=i||n+o>=r,d=i>=e;l!==this.state.scrolledLeft||c!==this.state.scrolledRight?this.setState({scrolledLeft:l,scrolledRight:c,doChildrenFit:d}):d!==this.state.doChildrenFit&&this.setState({doChildrenFit:d})};render(){const{children:e,className:n,background:i,...r}=this.props,{scrolledLeft:o,scrolledRight:l,doChildrenFit:c}=this.state,d=N("rec-slider-left-nav",{disabled:o,[i]:!!i}),u=N("rec-slider-right-nav",{disabled:l,[i]:!!i});return s.jsxs("div",{className:N("rec-slider-container",n),...r,children:[s.jsx("button",{className:d,type:"button",title:"Previous","aria-hidden":o,"aria-label":"Scroll left for previous options",onClick:this.handleLeftNavClick,children:s.jsx("span",{className:"rec-slider-icon-wrapper",children:s.jsx(j,{iconName:"chevron-left",size:"lg"})})}),s.jsx("div",{className:N("rec-slider-viewport",{"children-fit":c}),ref:f=>{this.viewport=f},children:e}),s.jsx("button",{className:u,type:"button",title:"More options","aria-hidden":l,"aria-label":"Scroll right for more options",onClick:this.handleRightNavClick,children:s.jsx("span",{className:"rec-slider-icon-wrapper",children:s.jsx(j,{iconName:"chevron-right",size:"lg"})})})]})}}a.node,a.number,a.string,a.oneOf(["underline","block","button"]),a.oneOf(["left","right"]),a.oneOf(["white","gray-1","gray-2"]),a.number,a.func,a.bool,a.string,a.string,a.bool,a.func,a.any;a.node,a.bool,a.bool,a.node,a.string,a.string,a.string,a.string;m.forwardRef((t,e)=>{const{controlsId:n,id:i,isDisabled:r,isHidden:o,isSelected:l,label:c,onSelect:d,onSelectFirst:u,onSelectLast:f,onSelectNext:g,onSelectPrevious:h,shouldFocus:p,buttonStatusElement:b,gaTrackingId:x}=t,y=m.useRef(),v=Ls(y,e);m.useEffect(()=>{l&&p&&y.current?.focus()},[l,p]);const w=C=>{switch(C.key){case"ArrowDown":case"ArrowRight":C.preventDefault(),g();break;case"ArrowUp":case"ArrowLeft":C.preventDefault(),h();break;case"Home":C.preventDefault(),u();break;case"End":C.preventDefault(),f();break}};return s.jsxs("button",{"data-vertical-tab-button":!0,"data-ga-tracking-id":x,type:"button",className:N({hidden:o,selected:l}),disabled:r||o,ref:v,role:"tab","aria-selected":l,tabIndex:l?void 0:-1,id:i,"aria-controls":n,onKeyDown:w,onClick:d,children:[s.jsx("span",{className:"label-wrap",children:c}),b||null]})});function Vt({role:t="img",src:e,className:n,altText:i="",style:r,...o}){const l={...r};return e&&(l.backgroundImage=`url(${e})`),s.jsx("div",{"data-component":"FauxImage",className:N("sarsa-faux-image",n),role:i?t:"none","aria-label":t==="img"&&i?i:void 0,style:l,...o})}function eo({aspectRatio:t="4:3",children:e,className:n,style:i,...r}){const[o,l]=t.split(":"),c={...i,paddingBottom:`calc(${l} / ${o} * 100%)`};return s.jsx("div",{"data-component":"Frame",className:N("sarsa-frame",n),style:c,...r,children:e})}function Kn({src:t,mobileSrc:e,className:n,altText:i,aspectRatio:r,style:o,isLoading:l,...c}){const{isSmAndDown:d}=Qt();return r?s.jsx(eo,{aspectRatio:r,className:n,style:o,children:l?s.jsx(Wt,{width:"",height:""}):s.jsx(Vt,{className:void 0,style:void 0,src:t,altText:i,...c})}):l?s.jsx(Wt,{style:o,width:"",height:""}):d&&e?s.jsx(Vt,{src:e,altText:i,style:o,className:n,...c}):s.jsx(Vt,{src:t,altText:i,style:o,className:n,...c})}const pg="/shared/img/global/unavailable/image-unavailable.webp";function Fb({src:t=pg,className:e,altText:n="Photo unavailable",aspectRatio:i,style:r,...o}){return i?s.jsx(eo,{"data-sarsa-faux-unavailable-image":!0,aspectRatio:i,className:e,style:r,children:s.jsxs("div",{children:[s.jsx(Vt,{src:t,altText:n,...o}),s.jsxs("figure",{children:[s.jsx(j,{iconName:"photo-unavailable",size:"lg"}),s.jsx("figcaption",{children:"Photo unavailable"})]})]})}):s.jsx("div",{"data-sarsa-faux-unavailable-image":!0,className:e,style:r,...o,children:s.jsxs("div",{children:[s.jsx(Vt,{src:t,altText:n,className:e}),s.jsxs("figure",{children:[s.jsx(j,{iconName:"photo-unavailable",size:"lg"}),s.jsx("figcaption",{children:"Photo Unavailable"})]})]})})}a.arrayOf(a.shape({url:a.string,altText:a.string,caption:a.string})).isRequired,a.bool,a.number,a.func;a.array,a.bool,a.func,a.number,a.bool;a.string,a.string,a.string,a.string;a.string,a.string,a.string,a.arrayOf(a.shape({altText:a.string,caption:a.string,url:a.string,credit:a.string})),a.number,a.string,a.bool,a.string;function to({isInternal:t=!1}={}){const e=t?"r1s-ld-user-bucket-int-100":"r1s-ld-user-bucket-ext-100";if(!be())return;let n=window.localStorage.getItem(e);if(n)try{n=String(parseInt(n,10))}catch{n=null}return n||(n=String(Math.floor(Math.random()*100)+1),window.localStorage.setItem(e,`${n}`)),n}const mg="588a570044b03e0b32112cfc",wa=to();function fg({children:t}){const e=Fe(),n=hc()?.account_id,i=bi();return m.useEffect(()=>{e(Yr(i))},[e,i]),m.useEffect(()=>{n&&i&&i.identify({kind:"user",key:n,anonymous:!1,user_bucket:wa,account_id:n,uri:window?.location?.pathname})},[n,i]),t}const gg={clientSideID:mg,context:{kind:"user",key:`bucket100_${wa}`,anonymous:!0,user_bucket:wa,uri:be()?window.location.pathname:void 0},options:{logger:fi({level:"error"})}},Bb=gi(gg)(fg),bg="588a570044b03e0b32112cfc",Ca=to({isInternal:!0});function vg({children:t}){const e=Fe();let n="";const i=pc();i!==""&&(n=i);const r=bi();return m.useEffect(()=>{e(Yr(r))},[e,r]),m.useEffect(()=>{n&&r&&r.identify({kind:"user",key:n,anonymous:!1,user_bucket:Ca,account_id:n,uri:window?.location?.pathname})},[n,r]),t}const xg={clientSideID:bg,context:{kind:"user",key:`bucket100_int_${Ca}`,anonymous:!0,user_bucket:Ca,uri:window?.location?.pathname},options:{logger:fi({level:"error"})}};gi(xg)(vg);function so({isStretchy:t=!1,className:e}){const n="/shared/img/global/unavailable/image-unavailable.webp";return s.jsxs("div",{className:N("rec-image-unavailable-wrap",e,{stretchy:t}),"data-testid":"rec-image-unavailable-wrap",children:[s.jsxs("figure",{children:[s.jsx(j,{iconName:"photo-unavailable"}),s.jsx("figcaption",{children:"Photo Unavailable"})]}),t&&s.jsx("div",{className:"img",role:"img","aria-label":"Unavailable",style:{backgroundImage:`url(${n})`}}),!t&&s.jsx("img",{src:n,alt:"Unavailable","aria-label":"Unavailable"})]})}so.propTypes={isStretchy:a.bool,className:a.string};const Ft=s.jsx("div",{className:"rec-inventory-image-wrap",children:s.jsx(so,{})});class Vb extends m.Component{static{this.propTypes={type:a.string,id:a.string,hasFauxImageRatio:a.string,hasFauxImageSize:a.string}}static{this.defaultProps={hasFauxImageRatio:"",hasFauxImageSize:""}}constructor(e){super(e),this.state={image:Ft,loaded:!1}}componentDidMount(){const{type:e,id:n}=this.props;e&&n&&this.loadMedia(e,n)}componentDidUpdate(e){const{id:n,type:i}=this.props;(n&&e.id!==n||i&&e.type!==i)&&this.loadMedia(i,n)}loadMedia(e,n){le.get(`/api/media/public/${e}/${n}`,{}).then(i=>{if(i&&!i.data.err)if(i.data.result){const r=i.data.result;let o=Na(r,{is_preview:!0});o===void 0&&(o=null);let l=null;!o&&r.length>0&&(o=r[0]),(this.props.hasFauxImageRatio||this.props.hasFauxImageSize)&&o?l=s.jsxs("div",{className:"rec-flex-card-image-wrap",children:[this.props.hasFauxImageRatio&&s.jsx(Kn,{aspectRatio:this.props.hasFauxImageRatio,src:o.url,altText:o.title}),this.props.hasFauxImageSize&&s.jsx(Kn,{style:{minHeight:this.props.hasFauxImageSize},src:o.url,altText:o.title})]}):o?l=s.jsx("div",{className:"rec-flex-card-image-wrap",children:s.jsx("img",{src:o.url,alt:o.title,"aria-label":o.title})}):l=Ft,this.setState({image:l,loaded:!0})}else this.setState({image:Ft,loaded:!0});else this.setState({image:Ft,loaded:!0})}).catch(()=>{this.setState({image:Ft,loaded:!0})})}render(){return this.state.loaded?this.state.image:null}}function yg({heroImageUrl:t,ariaLabel:e,style:n,className:i,...r}){return s.jsx("div",{className:`rec-hero-full-width-wrap ${i||""}`,style:{...n,backgroundImage:`url(${t})`},...r,children:s.jsx("div",{className:"rec-hero-body-outer-wrap",children:s.jsx("div",{className:"rec-hero-body",children:s.jsx("div",{className:"rec-hero-body-main",role:"img","aria-label":e})})})})}function wg({altText:t,ariaLabel:e,image:n="/shared/img/unavailable/image-unavailable.webp"}){return s.jsxs("div",{role:"presentation",className:"rec-hero-low-quality-wrap",children:[s.jsx("div",{className:"rec-hero-low-quality-background",style:{backgroundImage:`url(${n})`}}),s.jsx("img",{className:"rec-hero-low-quality-image",src:n,alt:t,"aria-label":e})]})}function ao({hasOverlayCopy:t=!0}){return s.jsx("div",{className:"rec-hero-image-unavailable-wrap",children:t&&s.jsxs("figure",{children:[s.jsx(j,{iconName:"photo-unavailable"}),s.jsx("figcaption",{children:"Photo Unavailable"})]})})}ao.propTypes={hasOverlayCopy:a.bool};const Bt={HERO_IMAGE:"heroImage",HERO_IMAGE_LOW_QUALITY:"heroImageLowQuality",HERO_IMAGE_UNDEFINED:"heroImageUndefined"};class Hb extends m.PureComponent{constructor(e){super(e),this.loadMedia=()=>{le.get(`/api/media/public/${this.props.type}/${this.props.id}`,{}).then(n=>{if(n&&!n.data.err&&n.data.result){const i=n.data.result;let r=Na(i,{is_primary:!0});r===void 0&&(r=null),!r&&i.length>0&&(r=i[0]),r&&(r.width&&To(r.width)>=1240?this._mounted&&this.setState({loaded:!0,heroImage:r.url,ariaLabel:r.title,type:Bt.HERO_IMAGE}):this._mounted&&this.setState({loaded:!0,heroImage:r.url,altText:r.title,ariaLabel:r.description?r.description:r.title,type:Bt.HERO_IMAGE_LOW_QUALITY}))}else this._mounted&&this.setState({loaded:!0})}).catch(()=>{if(this._mounted)try{this.setState({loaded:!0})}catch{}})},this.state={heroImage:"",altText:"",ariaLabel:"",type:Bt.HERO_IMAGE_UNDEFINED,loaded:!1},this._mounted=!1}static{this.propTypes={type:a.string,id:a.string,loadingType:a.string}}static{this.defaultProps={loadingType:"spinner",type:"asset",id:0}}componentDidMount(){this._mounted=!0,this.loadMedia()}componentWillUnmount(){this._mounted=!1}render(){let e=this.props.loadingType==="placeholder"?s.jsx("div",{className:"rec-image-loading-header-wrap",children:s.jsx(Wt,{width:"100%",height:"100%"})}):s.jsx(ke,{size:"xl"});return this.state.type===Bt.HERO_IMAGE?e=s.jsx(yg,{heroImageUrl:this.state.heroImage,ariaLabel:this.state.ariaLabel}):this.state.type===Bt.HERO_IMAGE_LOW_QUALITY?e=s.jsx(wg,{image:this.state.heroImage,altText:this.state.altText,ariaLabel:this.state.ariaLabel}):this.state.loaded&&(e=s.jsx("div",{className:"rec-image-unavailable-header-wrap",children:s.jsx(ao,{})})),e}}function Cg({html:t}){const e=ci.sanitize(t);return s.jsx(s.Fragment,{children:da(e)})}class Sg extends m.PureComponent{static{this.propTypes={imagePath:a.string,src:a.string,type:a.string,fallbackExtension:a.string,fallbackSrc:a.string,alt:a.string,imgHeight:a.oneOfType([a.string,a.number]),imgWidth:a.oneOfType([a.string,a.number]),altImageSizes:a.arrayOf(a.shape({viewportMaxWidth:a.number,path:a.string}))}}static{this.defaultProps={imagePath:"",type:"image/webp",fallbackExtension:"jpg",alt:"",imgHeight:"auto",imgWidth:"100%",altImageSizes:[]}}render(){const{imagePath:e,src:n,fallbackSrc:i,type:r,fallbackExtension:o,alt:l,imgHeight:c,imgWidth:d,altImageSizes:u}=this.props;return s.jsxs("picture",{children:[u&&u.map((f,g)=>s.jsxs(m.Fragment,{children:[s.jsx("source",{media:`(max-width: ${f.viewportMaxWidth}px)`,srcSet:`${f.path}.webp`,type:r}),s.jsx("source",{media:`(max-width: ${f.viewportMaxWidth}px)`,srcSet:`${f.path}.${o}`,type:r})]},g)),s.jsx("source",{srcSet:n||`${e}.webp`,type:r}),s.jsx("img",{src:i||`${e}.${o}`,alt:l,height:c,width:d})]})}}function Ng({title:t,text:e="",hasDarkText:n=!1,hasUnderline:i=!0,hasDarkUnderline:r=!1,hasButton:o=!1,isScroll:l=!1,buttonAppearance:c,buttonSize:d="lg",buttonText:u,buttonLink:f="#",className:g,semanticElementName:h="section",hasSelectElem:p=!1,selectID:b,selectLabel:x,render:y,selectPlaceholder:v,selectButtonText:w,selectOptions:C,selectButtonOnClick:T,buttonIconBeforeText:I,buttonIconAfterText:R,hideTitle:S,overlayImagePath:_,overlayImageFallbackExtension:M="png",overlayImageAltText:O,overlayImagePositionTop:A,overlayImagePositionBottom:$,overlayImagePositionRight:U,overlayImagePositionLeft:P,backgroundImagePath:D="",backgroundImageAltText:ne="",backgroundImageColorOverlay:W="#000000",backgroundImageColorOverlayOpacity:Y=.4,hasAvifImageFormat:B=!0,hasWebPImageFormat:H=!0,imageSrcConfig:V}){let Q;const G=h,E=A||U||$||P,L=[{size:"lg",width:"2000w"},{size:"md",width:"1440w"},{size:"sm",width:"768w"}],Z=F=>{const q=()=>L.map(te=>V?`${V[F][te.size]} ${te.width}`:`/shared${D}-${te.size}.${F} ${te.width}`);return F==="jpg"?s.jsx("img",{alt:ne,src:`/shared${D}-md.${F}`,srcSet:`${q()}`,className:"rec-section-hero-background-image"}):s.jsx("source",{type:`image/${F}`,sizes:"100vw",srcSet:`${q()}`})},z=()=>{if(Q){const F=Q.selectedIndex-1;F>=0&&T&&C?.length&&T(C[F])}},ie=F=>{if(l&&(F.preventDefault(),f)){const q=document.getElementById(f);q&&q.scrollIntoView({behavior:"smooth",block:"start"})}},we=()=>s.jsxs(s.Fragment,{children:[t&&s.jsx(ae,{headingLevel:1,appearance:"h1",className:N("rec-section-hero-title",{"rec-long-hero-title":t.length>30,"has-dark-text":n,"has-dark-underline":r,"has-no-underline":!i,"hide-title":S}),children:t}),_&&s.jsx("div",{className:N("rec-section-hero-overlay-image",{"image-has-set-position":E}),style:{top:A,bottom:$,right:U,left:P},children:s.jsx(Sg,{imagePath:_,fallbackExtension:M,alt:O})}),!!e&&s.jsx("p",{className:N("rec-section-hero-text",{"has-dark-text":n}),children:s.jsx(Cg,{html:e})}),p&&s.jsxs("div",{className:"rec-section-hero-select-wrap",children:[s.jsx(Vs,{id:b||"",label:x,isLabelVisible:!1,placeholder:v,options:C,innerRef:F=>{Q=F},isInline:!0}),s.jsx(k,{appearance:c,size:"lg",className:"hero-select-button",onClick:z,children:w})]}),o&&s.jsx(k,{appearance:c,href:l?`#${f}`:f,size:d,className:"mt-2",onClick:ie,iconBeforeElement:I||null,iconAfterElement:R||null,children:u}),y&&y()]});return s.jsx(G,{"aria-label":t,className:N("rec-section-hero-full-width-wrap",g,{"no-background-gradient":n}),children:s.jsxs("div",{className:"rec-section-hero-body-outer-wrap",children:[s.jsx("div",{className:"rec-section-hero-body",children:we()}),s.jsx("div",{className:"rec-section-hero-background-image-overlay",style:{background:W,opacity:Y}}),s.jsxs("picture",{children:[B&&Z("avif"),H&&Z("webp"),Z("jpg")]})]})})}Ng.propTypes={title:a.string,text:a.string,hasDarkText:a.bool,hasUnderline:a.bool,hasDarkUnderline:a.bool,hasButton:a.bool,isScroll:a.bool,buttonAppearance:a.oneOf(["primary","secondary","tertiary","tertiary-alt","tertiary-white","solid-white","subtle","link","danger","subtle-danger","pill"]),buttonSize:a.oneOf(["xxs","xs","sm","md","lg"]),buttonText:a.string,buttonLink:a.string,className:a.string,semanticElementName:a.oneOf(["nav","main","section","div"]),hasSelectElem:a.bool,selectID:a.string,selectLabel:a.string,render:a.func,selectPlaceholder:a.string,selectButtonText:a.string,selectOptions:a.arrayOf(a.shape({label:a.string,value:a.string})),selectButtonOnClick:a.func,buttonIconBeforeText:a.object,buttonIconAfterText:a.object,hideTitle:a.bool,overlayImagePath:a.string,overlayImageFallbackExtension:a.string,overlayImageAltText:a.string,overlayImagePositionTop:a.string,overlayImagePositionBottom:a.string,overlayImagePositionRight:a.string,overlayImagePositionLeft:a.string,backgroundImagePath:a.string,backgroundImageAltText:a.string,backgroundImageColorOverlay:a.string,backgroundImageColorOverlayOpacity:a.number,hasAvifImageFormat:a.bool,hasWebPImageFormat:a.bool,imageSrcConfig:a.shape({avif:a.shape({lg:a.string,md:a.string,sm:a.string}),webp:a.shape({lg:a.string,md:a.string,sm:a.string}),jpg:a.shape({lg:a.string,md:a.string,sm:a.string})})};class Ub extends m.PureComponent{constructor(e){super(e),this.handleDecreaseCountClick=()=>{const{min:n,count:i}=this.props;if(typeof i=="number"){const r=i-1;typeof n=="number"&&r>=n&&!this.props.disableDecreaseCount&&this.props.onCountChange(r)}},this.handleIncreaseCountClick=()=>{const{max:n,count:i}=this.props;if(typeof i=="number"){const r=i+1;typeof n=="number"&&r<=n&&!this.props.disableIncreaseCount&&this.props.onCountChange(r)}},this.state={count:e.count||0},this.handleInputChange=this.handleInputChange.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this)}static{this.propTypes={label:a.string.isRequired,onCountChange:a.func.isRequired,validationClass:a.string,disableDecreaseCount:a.bool,disableIncreaseCount:a.bool,disableTextInput:a.bool,max:a.number,min:a.number,count:a.number,iconClass:a.string,inputClass:a.string}}static{this.defaultProps={count:0,min:0,max:999,iconClass:"rec-increment-icon",inputClass:"rec-increment-quantity"}}componentDidUpdate(e){const{count:n}=this.props;typeof n=="number"&&n!==e.count&&n!==this.state.count&&this.setState({count:n})}handleInputChange(e){e.preventDefault();const n=e.target.value;/^\d+$/.test(n)?(this.setState({count:n}),this.props.onCountChange(parseInt(n,10))):n===""?this.setState({count:""}):oe("Error: Enter only numbers.")}handleInputBlur(){const{onCountChange:e,min:n,max:i}=this.props,{count:r}=this.state;if(r===""){let o=0;typeof n=="number"&&oi&&(o=i),o!==r&&e(o))}}render(){const{validationClass:e,disableDecreaseCount:n,disableIncreaseCount:i,disableTextInput:r,count:o,label:l,min:c,max:d,iconClass:u,inputClass:f}=this.props;let g="",h="",p=this.handleDecreaseCountClick,b=this.handleIncreaseCountClick;return(n||o===c)&&(g="disabled",p=void 0),(i||o===d)&&(h="disabled",b=void 0),s.jsxs("div",{className:"rec-increment-wrap",children:[s.jsx("button",{className:`${u} ${g}`,onClick:p,type:"button",disabled:o===c||n,"aria-label":`Decrease ${l} count by one`,children:s.jsx("span",{children:s.jsx(j,{iconName:"remove-circle-outline"})})}),s.jsxs("div",{className:f,children:[s.jsx(it,{htmlFor:`${l}-input`,isVisible:!1,children:`Number of ${l}s`}),s.jsx("input",{id:`${l}-input`,type:"text",pattern:"\\d*",className:e,autoComplete:"off",maxLength:3,readOnly:r,value:this.state.count,onChange:this.handleInputChange,onBlur:this.handleInputBlur})]}),s.jsx("button",{className:`${u} ${h}`,onClick:b,disabled:i,type:"button","aria-label":`Increase ${l} count by one`,children:s.jsx("span",{children:s.jsx(j,{iconName:"add-circle-outline"})})})]})}}function Tg({label:t,badgeCount:e,isExpanded:n=!1,isDisabled:i=!1,isInvalid:r=!1,gaTrackingId:o,innerRef:l,size:c="md",...d}){return s.jsxs("button",{type:"button",className:N("rec-select",c,{"is-invalid":r}),disabled:i,ref:l,"data-ga-tracking-id":o,...d,children:[s.jsxs("span",{className:"rec-select-label",children:[t,s.jsx("span",{className:"rec-select-badge",children:typeof e=="number"&&s.jsx(Xa,{appearance:"info",children:e})})]}),s.jsx("span",{className:"rec-select-icon",children:s.jsx(j,{iconName:n?"arrow-up":"arrow-down"})})]})}function no({isDisabled:t=!1,applyButtonLabel:e="Apply",showPopupActions:n=!0,children:i,badgeCount:r,label:o,className:l,isInvalid:c,id:d,gaTrackingId:u,"aria-label":f,size:g="md",menuTitle:h,isTitleVisible:p,...b}){function x(){return s.jsx("div",{className:"dropdown-menu-popup-content",children:i})}return s.jsx(Ka,{size:g,id:d,className:N("sarsa-dropdown-menu",l),"data-ga-tracking-id":u,triggerButtonElement:s.jsx(Tg,{size:g,badgeCount:r,label:o,isInvalid:c,"aria-label":f,"data-ga-tracking-id":u}),render:x,isDisabled:t,applyButtonLabel:e,showPopupActions:n,baseTitle:h,isTitleVisible:p,...b})}no.propTypes={id:a.string,label:a.node.isRequired,badgeCount:a.number,isDisabled:a.bool,children:a.node,applyButtonLabel:a.string,popupLeftActionElement:a.node,onApply:a.func,onClose:a.func,isInvalid:a.bool,showPopupActions:a.bool,className:a.string,clickTagCategory:a.string,clickTagAction:a.string,clickTagLabel:a.string,gaTrackingId:a.string,applyButtonRef:a.shape({current:a.node}),menuTitle:a.node,isTitleVisible:a.bool};function io({id:t,label:e,isDisabled:n=!1,placeholder:i,value:r,isRequired:o=!1,isInvalid:l=!1,errorText:c,innerRef:d,className:u,shouldFocusOnMount:f,ariaDescribedby:g,gaTrackingId:h,...p}){const b=m.useRef(null),x=m.useRef(),y=m.useRef(!1);m.useEffect(()=>(y.current||(x.current=window.setTimeout(()=>{if(f&&b){y.current=!0;const w=b.current?.querySelector("input");w&&w.focus()}},0)),()=>{clearTimeout(x.current)}),[]);let v=c||g?"":void 0;return c&&(v=`${t}-error ${v}`),g&&(v=`${g} ${v}`),s.jsx("div",{"data-component":"NumberFieldInput",className:N(u,"sarsa-number-field-input sarsa-field-outer-container"),children:s.jsx(Ga,{type:"text",id:t,innerRef:d,isDisabled:n,value:r,placeholder:i,ariaDescribedby:v,isLabelVisible:!1,label:e,isRequired:o,isInvalid:l,shouldFocusOnMount:f,"data-ga-tracking-id":h,...p})})}io.propTypes={id:a.string.isRequired,label:a.node.isRequired,placeholder:a.string,value:a.string,isDisabled:a.bool,isRequired:a.bool,isInvalid:a.bool,errorText:a.node,innerRef:a.oneOfType([a.func,a.object,a.node]),shouldFocusOnMount:a.bool,className:a.string,ariaDescribedby:a.string,unitBefore:a.string,unitAfter:a.string,srUnitDescription:a.string,gaTrackingId:a.string};const ro=m.forwardRef((t,e)=>{const{id:n,units:i,unitBefore:r,unitAfter:o,visualLabel:l,visualLabelPosition:c="left",isRequired:d=!1,isInvalid:u=!1,isDisabled:f=!1,errorText:g,shouldClamp:h=!0,isDecreaseDisabled:p=!1,isIncreaseDisabled:b=!1,max:x=9999,min:y=0,onChange:v,value:w,defaultValue:C=0,ariaDescribedby:T,className:I,shouldTriggerOnChange:R,inputFieldGaTrackingID:S,decreaseButtonGaTrackingID:_,increaseButtonGaTrackingID:M,name:O="numberField",shouldValidateOnChange:A=!1}=t,$=nt(n),U=typeof w=="number"?w.toString():C?.toString(),[P,D]=m.useState(U),ne=m.useRef(U),W=m.useRef(null),Y=l&&l.length,B=!!r||!!o,H=parseInt(P,10),V=N({"sarsa-number-field-with-label-wrap":Y,"position-left":c==="left","position-top":c==="top"}),[Q,G]=m.useState({isInvalid:u??!1,errorText:g??"",inputId:$,label:l??"Number Field"}),E=F=>{const q={isInvalid:!1,errorText:"",inputId:$,label:l??"Number Field"},te=F??P,ee=te?parseInt(te,10):0,Ce=u||!!g,rt=F===void 0;return Ce?(q.isInvalid=!0,q.errorText=g||`${q.label} is invalid`):d&&!ee?(q.isInvalid=!0,q.errorText=g||`${q.label} must be 1 or more`):eex&&(q.isInvalid=!0,q.errorText=g||`${q.label} must be ${x} or less`),(rt||A||!Ce&&Q.isInvalid===!0&&q.isInvalid===!1)&&G(q),q};m.useEffect(()=>{const F=typeof w=="number"?w:C;ne.current=F,D(F.toString())},[C,w]),m.useEffect(()=>{if(typeof w=="number"&&w!==ne.current&&w.toString()!==P){const F=Math.min(Math.max(w,y),x),q=h?F:w;D(q.toString()),w!==q&&v&&v(q),oe(`${q} ${i}`,"polite","sarsa-announce-count")}},[w,P]);const L=F=>{const q=Ce=>{R&&v&&v(Ce)};F.preventDefault();const te=F.target.value;/^\d+$/.test(te)?(D(te),q(parseInt(te,10))):te===""?(D(""),q(0)):oe("Error: Enter only numbers.")},Z=()=>{const F=parseInt(P,10);if(P===""){D("0"),v&&v(0);return}const q=Math.min(Math.max(F,y),x);let te=h?q:F;h&&te!==F&&(oe(`You entered a value outside of the min/max. Value changed to ${te}.`),F<1&&(te=0)),D(te.toString()),E(te.toString()),v&&v(te)},z=()=>{let F=parseInt(P,10)||0;F-=1,F{let F=parseInt(P,10)||0;F+=1,F>x&&(F=x),D(F.toString()),E(F.toString()),oe(`${F} ${i}`,"polite","sarsa-announce-count"),v&&v(F)},we=F=>{F.key==="ArrowUp"&&(F.preventDefault(),ie()),F.key==="ArrowDown"&&(F.preventDefault(),z())};return m.useImperativeHandle(e,()=>({validate:()=>E()})),s.jsxs("div",{"data-component":"NumberField",className:I,role:Y?"group":void 0,"aria-labelledby":Y?`group-label-${$}`:void 0,children:[s.jsxs("div",{className:V,children:[l&&s.jsx(qa,{id:`group-label-${$}`,isRequired:d,children:l}),s.jsxs("div",{"data-component":"NumberField",ref:W,className:"sarsa-number-field",children:[s.jsx(k,{appearance:"subtle",size:"sm",onClick:z,isDisabled:f||H<=y||p,"aria-label":`Remove ${i}`,iconBeforeElement:s.jsx(j,{iconName:"remove-circle-outline"}),gaTrackingId:_}),s.jsx(io,{className:N({"with-unitsBefore":!!r,"with-unitsAfter":!!o,"width-3-digits":x>99&&x<=999,"width-4-digits":x>999,"width-3-digits-and-units":x>99&&x<=999&&B,"width-4-digits-and-units":x>999&&B}),label:`Number of ${i}`,pattern:"\\d*",id:$,name:O,autoComplete:"off",maxLength:x<10?1:x<100?2:x<1e3?3:4,readOnly:f,isDisabled:f,isRequired:d,isInvalid:Q.isInvalid,errorText:Q.errorText,value:P,onChange:L,onBlur:Z,ariaDescribedby:T,unitBefore:r,unitAfter:o,srUnitDescription:i,gaTrackingId:S,onKeyDown:we}),s.jsx(k,{appearance:"subtle",size:"sm",onClick:ie,isDisabled:f||H===x||b,"aria-label":`Add ${i}`,iconBeforeElement:s.jsx(j,{iconName:"add-circle-outline"}),gaTrackingId:M})]})]}),Q.errorText&&s.jsxs("div",{id:`${$}-error`,className:"sarsa-field-error-message",children:[s.jsx("span",{className:"req","aria-hidden":"true",children:"*"}),Q.errorText]})]})});ro.propTypes={id:a.string,units:a.string.isRequired,unitBefore:a.string,unitAfter:a.string,visualLabel:a.string,visualLabelPosition:a.oneOf(["left","top"]),isRequired:a.bool,isInvalid:a.bool,isDisabled:a.bool,errorText:a.string,shouldClamp:a.bool,isDecreaseDisabled:a.bool,isIncreaseDisabled:a.bool,max:a.number,min:a.number,onChange:a.func,value:a.number,defaultValue:a.number,ariaDescribedby:a.string,className:a.string,shouldTriggerOnChange:a.bool,inputFieldGaTrackingID:a.string,decreaseButtonGaTrackingID:a.string,increaseButtonGaTrackingID:a.string};const jg={id:a.string,guestType:a.shape({key:a.string,type:a.string,label:a.string,description:a.string}),validationClass:a.string,count:a.number,disableTextInput:a.bool,minGuests:a.number,maxTotalGuests:a.number,maxTotalGuestsReached:a.bool,changeCount:a.func,isRequired:a.bool,isDecreaseDisabled:a.bool};function oo({id:t,guestType:{type:e,description:n,key:i,label:r},count:o=0,changeCount:l,disableTextInput:c=!1,minGuests:d,maxTotalGuests:u,maxTotalGuestsReached:f=!1,validationClass:g="",isRequired:h=!1,isDecreaseDisabled:p=!1}){const b=nt(t),x=`${b}-counter-row-${e}`?.replace(/ /g,"-"),y=`${b}-number-field-${e}`?.replace(/ /g,"-");return s.jsxs("div",{role:"group","aria-labelledby":x,className:"rec-guest-counter-row",children:[s.jsxs("div",{className:"rec-guest-counter-row-type",children:[s.jsxs("div",{className:"rec-guest-counter-row-title",id:x,children:[r||e,h&&s.jsx("mark",{title:"required",children:" *"})]}),s.jsx("div",{className:"rec-guest-counter-row-description",children:n})]}),s.jsx(ro,{id:y,className:g,isDecreaseDisabled:p||o===0,isIncreaseDisabled:f,isDisabled:c,min:d,max:u,onChange:v=>l(i,v),value:o,units:`${e}s`})]})}oo.propTypes=jg;const Rg=t=>typeof t.weight=="number"?t.weight:1;class qb extends m.Component{constructor(){super(...arguments),this.state={counts:{}},this.closeCounter=()=>{const{onClose:e}=this.props;e&&e(this.state.counts,this.sumCounts())},this.generateGuestCounterRows=e=>{const n=this.props.value||this.state.counts,{disableTextInput:i}=this.props;return this.props.guestTypes.map(r=>{let o={...r};const l=qe(this.props,`maximumCountByGuestType.${o.key}`,0),c=qe(this.props,`minimumCountByGuestType.${o.key}`,0),d=e||l!==0&&l<=n[o.key];return l>0&&c>0?o={...o,description:`${o.description} max. ${l}, min. ${c}`}:c>0?o={...o,description:`${o.description} min. ${c}`}:l>0&&(o={...o,description:`${o.description} max. ${l}`}),s.jsx(oo,{id:this.props.id,disableTextInput:i,guestType:o,count:n[o.key],maxTotalGuestsReached:d,changeCount:this.changeCount},`guest-counter-${o.key}`)})},this.changeCount=(e,n)=>{const{onCountChange:i,maximumCountByGuestType:r}=this.props,o=!this.props.value,l=this.props.maxTotalGuests||999,c=r[e]?r[e]:null;let d;o?d=this.state.counts:d={...this.props.value};const u=this.sumCounts()-d[e],f=l-u;!c&&n<=f||c&&n<=c&&n<=f?d[e]=n:c&&n>c?(d[e]=c,oe(`Error: Input changed to ${c} because there's a maximum of ${l} guests allowed for the selected guest type.`)):(d[e]=f,oe(`Error: Input changed to ${f} because there's a maximum of ${l} guests.`)),d[e]<0&&(d[e]=0),o&&this.setState({counts:d}),i&&i(d)},this.sumCounts=()=>{const e=this.props.value||this.state.counts;return this.props.guestTypes.reduce((n,i)=>n+e[i.key]*Rg(i),0)}}static{this.propTypes={id:a.string,disableTextInput:a.bool,title:a.string,minTotalTitle:a.string,maxTotalTitle:a.string,guestTypes:a.array,minTotalGuests:a.number,maxTotalGuests:a.number,onCountChange:a.func,onClose:a.func,value:a.shape({}),validationErrorClass:a.string,disabled:a.bool,isDisabled:a.bool,maxTotalMessage:a.string,minTotalMessage:a.string,minimumCountByGuestType:a.shape({}),maximumCountByGuestType:a.shape({}),className:a.string,isLabelVisible:a.bool,isRequired:a.bool,isInvalid:a.bool,errorText:a.string,placeholder:a.string,showInvalid:a.bool}}static{this.defaultProps={id:"guest-counter",isLabelVisible:!1,disableTextInput:!1,isRequired:!1,isInvalid:!1,showInvalid:!1,title:"Guests",minTotalTitle:"",maxTotalTitle:"",disabled:!1,isDisabled:!1,minTotalGuests:0,maxTotalGuests:999,validationErrorClass:"",guestTypes:[{key:"adult",type:"Adult",description:"ages 13+"},{key:"youth",type:"Youth",description:"ages 9 - 12"},{key:"access",type:"Access",description:"no age required"},{key:"senior",type:"Senior",description:"ages 65+"}],maximumCountByGuestType:{},minimumCountByGuestType:{},className:""}}componentDidMount(){this.setState({counts:this.props.value||this.populateCounters(this.props.guestTypes)})}componentDidUpdate(e){const{value:n,guestTypes:i}=this.props;(n!==e.value||i!==e.guestTypes)&&this.setState({counts:n||this.populateCounters(i)})}populateCounters(e){const n={};return e.length>0&&e.forEach(i=>{i.count?n[i.key]=i.count:n[i.key]=0}),n}determinePluralLabel(e){const n=this.props.title;return e===1&&n.charAt(n.length-1).toLowerCase()==="s"?n.toLowerCase().endsWith("passes")?n.slice(0,n.length-2):n.slice(0,n.length-1):n}render(){const{className:e,id:n,title:i,validationErrorClass:r,maxTotalGuests:o,isLabelVisible:l,isRequired:c,isInvalid:d,errorText:u,placeholder:f,showInvalid:g}=this.props;let h=f||`Add ${i}...`;const p=this.sumCounts();p>0&&(h=`${p} ${this.determinePluralLabel(p)}`);let b=!1,x=!1;o!==0&&p>=o&&(x=!0);const y=this.props.maxTotalTitle!==""?` ${this.props.maxTotalTitle}`:` ${ea(this.props.title)}`,{minTotalGuests:v}=this.props;let w=!1;v!==0&&p{t(-1)},clickTagCategory:"Not Found Error Page",clickTagAction:`error found on - ${window.location.pathname}`,clickTagLabel:"Go Back Button",children:"Go Back"})]})]})})})}a.number,a.bool,a.func;function co({children:t,content:e,id:n="screen-reader-tip-component"}){const[i,r]=m.useState(!1),o=m.useRef(null),l=()=>{o.current&&!o.current.disabled&&r(!0)},c=()=>{r(!1)};return s.jsxs(s.Fragment,{children:[m.Children.map(t,d=>{const u=typeof d.type,f={"aria-describedby":i?n:void 0,onFocus:l,onBlur:c};return u==="string"?f.ref=o:f.innerRef=o,m.cloneElement(d,f)}),i&&s.jsx(Et,{children:s.jsx("span",{className:"rec-sr-only",role:"tooltip",id:n,children:e})})]})}co.propTypes={children:a.node.isRequired,content:a.node.isRequired,id:a.string};class Wb extends K.PureComponent{static propTypes={name:a.string,id:a.string,isSorted:a.bool,isAsc:a.bool,onSortToggle:a.func,isDisabled:a.bool};static defaultProps={name:"",id:"",isSorted:!1,isAsc:null,isDisabled:!1};state={isSorted:this.props.isSorted,isAsc:this.props.isAsc};componentDidUpdate(e){e.isSorted!==this.state.isSorted&&this.setState({isSorted:e.isSorted}),e.isAsc!==this.state.isAsc&&this.setState({isAsc:e.isAsc})}onSortToggle=()=>{const e=!this.state.isAsc;oe(`Sorted by ${this.props.name}: ${e?"ascending":"descending"}`),this.state.isSorted?this.setState({isAsc:e},()=>{this.props.onSortToggle(this.state.isSorted,this.state.isAsc,this.props.id)}):this.setState({isSorted:!0,isAsc:!0},()=>{this.props.onSortToggle(this.state.isSorted,this.state.isAsc,this.props.id)})};render(){const{name:e,isDisabled:n}=this.props,{isSorted:i,isAsc:r}=this.state;let o=null;this.state.isSorted?this.state.isAsc?o=s.jsxs("div",{className:"sort",children:[s.jsx("div",{className:"disabled",children:s.jsx(j,{iconName:"arrow-up"})}),s.jsx("div",{className:"sorted",children:s.jsx(j,{iconName:"arrow-down"})})]}):o=s.jsxs("div",{className:"sort",children:[s.jsx("div",{className:"sorted",children:s.jsx(j,{iconName:"arrow-up"})}),s.jsx("div",{className:"disabled",children:s.jsx(j,{iconName:"arrow-down"})})]}):o=s.jsxs("div",{className:"sort",children:[s.jsx("div",{className:"enabled",children:s.jsx(j,{iconName:"arrow-up"})}),s.jsx("div",{className:"enabled",children:s.jsx(j,{iconName:"arrow-down"})})]});let l=null;return i&&(l=r?"ascending":"descending"),s.jsx("th",{className:"sortable-column-header","aria-sort":l,role:"columnheader",children:s.jsx(co,{content:"Click to sort the table by this column",children:s.jsxs("button",{onClick:this.onSortToggle,disabled:n,type:"button",children:[s.jsx("span",{className:"title",children:e}),o]})})})}}a.array.isRequired,a.bool,a.string,a.string,a.string,a.shape({user:a.string,date:a.string}),a.func,a.func;class zb extends K.PureComponent{render(){return null}}a.string,a.string,a.string,a.bool;a.bool,a.number,a.string,a.node,a.func,a.bool,a.bool;class Kb extends K.PureComponent{static propTypes={children:a.node.isRequired,scrollingContainerId:a.string.isRequired};constructor(e){super(e),this.state={isStuck:!1},this.container=void 0,this.wrapperHeight=void 0,this.windowHeight=void 0,this.initialBottom=void 0,this.hasPageSettled=!1,this.throttledHandleResize=st(this.handleResize,250)}componentDidMount(){this.wrapperHeight=this.getStickyHeight(),this.wrapper.style.height=`${this.wrapperHeight}px`,this.windowHeight=window.innerHeight,this.container=document.getElementById(this.props.scrollingContainerId),window.addEventListener("resize",this.throttledHandleResize),document.addEventListener("scroll",this.handleScroll),this.container.addEventListener("scroll",this.handleScroll),this.setInitialSticky()}componentDidUpdate(){this.hasPageSettled||this.setInitialSticky()}componentWillUnmount(){clearTimeout(this.timeout),this.container.removeEventListener("scroll",this.handleScroll),document.removeEventListener("scroll",this.handleScroll),window.removeEventListener("resize",this.throttledHandleResize)}getStickyHeight(){const e=this.sticky.offsetHeight,n=this.sticky.firstChild.offsetHeight;return e||n}setWrapperRef=e=>{this.wrapper=e};setStickyRef=e=>{this.sticky=e};setSticky=()=>{if(this.wrapper?.getBoundingClientRect){const e=this.wrapper.getBoundingClientRect().bottom;this.setState({isStuck:e>this.windowHeight})}};setInitialSticky=()=>{clearTimeout(this.timeout);const e=this.wrapper.getBoundingClientRect().bottom;e!==this.initialBottom?this.timeout=setTimeout(()=>{this.initialBottom=e,this.forceUpdate()},450):(this.hasPageSettled=!0,this.setSticky())};handleResize=()=>{this.windowHeight=window.innerHeight;const e=this.getStickyHeight();e!==this.wrapperHeight&&(this.wrapperHeight=e,this.wrapper.style.height=`${this.wrapperHeight}px`),this.setSticky()};handleScroll=()=>{this.setSticky()};render(){const e=this.state.isStuck?"rec-sticky-bottom sticky":"rec-sticky-bottom";return s.jsx("div",{ref:this.setWrapperRef,children:s.jsx("div",{ref:this.setStickyRef,className:e,children:this.props.children})})}}a.node;const Ag={image:a.shape({backgroundImage:a.string}),title:a.string,children:a.node,sticky:a.bool,textColor:a.string,background:a.string,name:a.string,closedAnnouncement:a.func};function Mg({image:t,title:e,children:n,sticky:i,textColor:r,background:o,name:l,closedAnnouncement:c}){const[d,u]=m.useState(!1),[f,g]=m.useState(!1),h=m.useRef(null),p=m.useRef(null),b=m.useRef(null),{isSmAndDown:x}=Qt();let y="rec-announcement-sticky",v="rec-announcement-sticky-body-shown";const C=st(()=>{const A=window.innerWidth;h.current&&p.current&&(p.current.style.height=`${h.current.clientHeight}px`),b.current!==A&&(b.current=A),A>768&&g(!0)},50);m.useEffect(()=>(window.addEventListener("resize",C),C(),Qo.get(l)||u(!0),()=>{window.removeEventListener("resize",C)}),[]),m.useEffect(()=>{d||(c(l),document.body.classList.remove("rec-announcement-no-body-scroll"))},[d]);const T=()=>{u(!1)},I=A=>{switch(A){case"dark":return"rec-announcement-text-dark";case"light":return"rec-announcement-text-light";default:return""}},R=A=>{switch(A){case"dark":return"rec-announcement-content-bg-dark";case"light":return"rec-announcement-content-bg-light";default:return""}},S=()=>{g(A=>!A)};if(!d)return null;i||(y=""),f||(v="rec-announcement-sticky-body-hidden"),x&&f?document.body.classList.add("rec-announcement-no-body-scroll"):document.body.classList.remove("rec-announcement-no-body-scroll");const _=I(r),M=R(o),O=o==="dark";return s.jsxs(s.Fragment,{children:[s.jsx("div",{"data-name":"placeholder",ref:p}),s.jsxs("div",{className:`rec-announcement px-md-3 ${_} ${y} ${v}`,style:t,"data-testid":"recAnnouncement",children:[s.jsxs("div",{ref:h,className:"rec-announcement-mobile-header",children:[s.jsx(k,{isUnstyled:!0,onClick:S,className:"rec-announcement-toggle","aria-label":f?"Hide Announcement":"Show Announcement",type:"button",children:f?s.jsx(j,{iconName:"chevron-down"}):s.jsx(j,{iconName:"chevron-up"})}),s.jsx("div",{className:"rec-announcement-mobile-title",children:e})]}),f&&s.jsxs("div",{className:`rec-announcement-content ${M}`,children:[s.jsx("div",{className:"rec-announcement-title",children:e}),s.jsx("div",{className:"rec-announcement-description",children:n}),x&&s.jsx(k,{shouldFitContainer:!0,appearance:O?"tertiary-white":"tertiary",onClick:T,"aria-label":"Close Announcement",type:"button",className:"mt-2",children:"Close Announcement"}),s.jsx(k,{className:O?"modal-close-button dark":"modal-close-button light",appearance:"subtle",size:"md","aria-label":"Dismiss Announcement",iconBeforeElement:s.jsx(j,{iconName:"close"}),onClick:T})]})]})]})}Mg.propTypes=Ag;function Qa(t){switch(t){case"gregory":return new el;default:throw new Error(`Unsupported calendar ${t}`)}}function Nt({segment:t,state:e,className:n,onClick:i}){const r=m.useRef(null),{segmentProps:o}=tl(t,e,r);return s.jsx("div",{...o,onClick:i,ref:r,style:{...o.style},className:N("date-segment",n,{slash:!t.isEditable,colon:t.text===":"}),children:t.isPlaceholder?t.placeholder:t.text})}function Sa({className:t,setAutoFocus:e,close:n,isOpen:i,open:r,hasCalendar:o=!0,timeZoneLabel:l,hideTimeZone:c,...d}){const{isDisabled:u}=d,{locale:f}=Qe(),g=sl({...d,locale:f,createCalendar:Qa}),h=m.useRef(null),{fieldProps:p}=al(d,g,h),{onKeyDown:b,...x}=p,y=m.useCallback(C=>{n&&i&&n(),b&&b(C)},[n,i,b]),v=g.segments.findIndex(C=>C.type==="hour"),w=f.includes("en");return s.jsxs("div",{...x,translate:"no",onKeyDown:y,ref:h,className:N("date-field",t),children:[g.segments.map((C,T)=>{if(w&&v>0&&T===v-1)return null;const I=C.type==="year"||C.type==="month"||C.type==="day";if(C.type==="timeZoneName")return c||l?null:s.jsx("div",{className:"time-zone",children:C.text},T);if(w&&C.type==="hour"){if(C.placeholder="hh",d.granularity==="hour")return s.jsxs(m.Fragment,{children:[s.jsx(Nt,{segment:C,state:g,className:"hour"}),s.jsx(Nt,{segment:{type:"literal",text:":",placeholder:"",isPlaceholder:!1,isEditable:!1},state:g}),s.jsx(Nt,{segment:{type:"literal",text:"00",placeholder:"00",isPlaceholder:!0,isEditable:!1},state:g})]},T)}else w&&C.type==="minute"&&(C.placeholder="mm");return s.jsx(Nt,{segment:C,state:g,onClick:R=>{R.currentTarget?.focus(),e(!1),I&&!u&&o&&r(),!I&&n&&n()},className:C.type==="hour"?"hour":void 0},T)}),l&&!c?s.jsx("div",{className:"time-zone",children:l}):null]})}function Og({startName:t,endName:e,value:n,startRef:i,endRef:r,id:o}){const l=n?.start?.toString()||"",c=n?.end?.toString()||"";return s.jsxs(s.Fragment,{children:[s.jsx("input",{name:t,type:"hidden",value:l,ref:i,id:`${o}-hidden-start`}),s.jsx("input",{name:e,type:"hidden",value:c,ref:r,id:`${o}-hidden-end`})]})}function uo({name:t,value:e,inputRef:n,id:i}){const r=typeof e=="string"?e:e?.toString()||"";return s.jsx("input",{name:t,type:"hidden",value:r,ref:n,id:`${i}-hidden`})}function en({children:t,className:e,...n}){return t?s.jsx("div",{"aria-live":"polite",...n,children:t?s.jsxs("div",{className:N("sarsa-field-hint-message",e),children:[s.jsx("span",{className:"hint","aria-hidden":"true",children:"*"})," ",t]}):null}):null}const Zn=be()?window.visualViewport:null;function Pg(t){const{top:e,height:n,left:i,width:r}=t.getBoundingClientRect(),{clientHeight:o,clientWidth:l}=document.documentElement;return{spaceAbove:e,spaceBelow:o-e-n,spaceRight:l-i-r,spaceLeft:i,width:r}}function Lg({popupRef:t,innerRef:e,isOpen:n,positionRightByDefault:i=!0}){const[o,l]=m.useState("below left"),{isXs:c}=Qt(),d=m.useCallback(()=>{const u=t.current,f=e.current;if(!n||!u||!f)return;const{spaceAbove:g,spaceBelow:h,spaceRight:p,spaceLeft:b,width:x}=Pg(u),y=f.clientHeight+10,v=f.clientWidth-x+10;if(y>h&&y<=g){if(c){l("above full-width");return}i&&v>p&&b>p||!i&&b>p?l("above right"):l("above left");return}if(c){l("below full-width");return}i&&v>p&&b>p||!i&&b>p?l("below right"):l("below left")},[e,n,t,i,c]);return m.useLayoutEffect(()=>{d();const u=st(d,150);return document?.addEventListener("scroll",u),Zn?.addEventListener("resize",u),()=>{u.cancel(),document?.removeEventListener("scroll",u),Zn?.removeEventListener("resize",u)}},[e,n,t,d]),o}function tn({children:t,isOpen:e,close:n,shouldTrapFocus:i=!0,inputSize:r,hideClose:o=!1,shouldCloseOnInteractOutside:l}){const c=m.useRef(null),d=m.useRef(null),{overlayProps:u,underlayProps:f}=ui({isOpen:e,onClose:n,shouldCloseOnBlur:!1,isDismissable:!0,shouldCloseOnInteractOutside:l},c),{focusProps:g,isFocusVisible:h}=_t(),p=Lg({popupRef:c,innerRef:d,isOpen:e}),b=v=>{v.style.removeProperty("left")},x=v=>{if(c.current){const{left:w}=c.current.getBoundingClientRect();v.style.left=`-${w}px`}},y=m.useCallback(()=>{if(c.current){const v=c.current.querySelector(".sarsa--inline-popup");v&&(p==="above full-width"||p==="below full-width"?x(v):b(v))}},[p]);return m.useLayoutEffect(()=>{const v=window.visualViewport,w=st(y,150);return e&&(y(),v?.addEventListener("resize",w)),()=>{v?.removeEventListener("resize",w)}},[e,y]),s.jsx("div",{ref:c,"data-component":"inline-popup",style:{position:"relative"},...f,children:e?s.jsx("div",{className:N("sarsa--inline-popup",r,p),children:s.jsx("div",{ref:d,className:"sarsa--inline-popup-children",...u,children:s.jsxs(nl,{contain:i,restoreFocus:!0,children:[t,i&&!o?s.jsx("button",{...g,type:"button",className:N("inline-popup-keyboard-close-btn",{visible:h}),onClick:n,children:s.jsx(j,{iconName:"close",size:"sm"})}):null]})})}):null})}function $g({state:t,triggerRef:e,...n}){const i=m.useRef(null),{overlayProps:r}=dl({placement:"top",targetRef:e,overlayRef:i,isOpen:t.isOpen}),{tooltipProps:o}=ul(n,t);return s.jsx("div",{ref:i,...at(n,o),style:{...r.style,pointerEvents:"none"},className:"react-aria-Tooltip",children:n.children})}function Dg({state:t,date:e,currentMonth:n,getDayType:i,getTooltipContent:r}){const o=m.useRef(null),{cellProps:l,buttonProps:c,isSelected:d,isOutsideVisibleRange:u,isDisabled:f,formattedDate:g,isInvalid:h,isUnavailable:p,isFocused:b}=il({date:e,isDisabled:!ln(e,n)},t,o),x=i?i(e):void 0,{dayType:y,dayTypeLabel:v,dayTypeSymbol:w}=ef(x),C=!ln(n,e),T="highlightedRange"in t&&t.highlightedRange,I=d&&T&&cn(e,T.start),R=d&&T&&cn(e,T.end),{focusProps:S,isFocusVisible:_}=_t(),M=C||u;y&&!M&&(c["aria-label"]+=` - ${v}`);const O=r?r(e):null,A=rl({delay:100,closeDelay:0}),{triggerProps:$,tooltipProps:U}=ol({},A,o),P=O?$:{};return s.jsxs("div",{...l,className:"calendar-cell-td",children:[s.jsx("div",{...at(c,S,P),ref:o,hidden:M,className:N("calendar-cell",{"is-today":ll(e,t.timeZone),"is-selected":d&&!h,"is-invalid":h,"is-selected-is-invalid":d&&h,"is-unavailable":p,"is-disabled":f&&!h,"is-focused":b&&_,"is-range-start":I&&!h,"is-range-end":R&&!h,"is-styled-day":!M&&!!y,[`${y}`]:!M&&!!y}),children:!M&&y?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"date",children:g}),w?s.jsx("span",{className:"symbol",children:w}):null]}):g}),O&&A.isOpen&&s.jsx(cl,{children:s.jsx($g,{state:t,...U,triggerRef:o,children:O})})]})}function ho({state:t,offset:e={},getDayType:n,getTooltipContent:i}){const{locale:r}=Qe(),o=t.visibleRange.start.add(e),l=hl(o),{gridProps:c,headerProps:d,weekDays:u}=pl({startDate:o,endDate:l},t),f=ml({month:"long",year:"numeric",era:o.calendar.identifier==="gregory"&&o.era==="BC"?"short":void 0,calendar:o.calendar.identifier,timeZone:t.timeZone}),g=fl(o,r);return s.jsxs("div",{className:"calendar-grid",children:[s.jsx(ae,{"aria-hidden":!0,appearance:"h5",headingLevel:2,className:"heading",children:f.format(o.toDate(t.timeZone))}),s.jsxs("div",{...c,className:"calendar-table",children:[s.jsx("div",{...d,children:s.jsx("div",{className:"tr",children:u.map((h,p)=>s.jsx("div",{className:"th",children:h},p))})}),s.jsx("div",{role:"rowgroup",children:[...new Array(g).keys()].map(h=>s.jsx("div",{role:"row",className:"tr",children:t.getDatesInWeek(h,o).map((p,b)=>p?s.jsx(Dg,{state:t,date:p,currentMonth:o,getDayType:n,getTooltipContent:i},b):s.jsx("div",{className:"td"},b))},h))})]})]})}function js(t){const e=m.useRef(null),{buttonProps:n}=As(t,e),{focusProps:i,isFocusVisible:r}=_t();return s.jsx("button",{type:"button",...at(n,i),ref:e,className:N("next-prev-button",{"focus-visible":r,disabled:t.isDisabled}),children:t.children})}function Fg(t,e){const n=[],r=t.add({months:e}).compare(t);for(let o=0;oe(l))),o={};return r.forEach(l=>{o[l]=!0}),s.jsx("div",{className:"sarsa--styled-days-legend mt-3",children:s.jsx(Qr,{legendItems:o})})}function Bg({getDayType:t,getTooltipContent:e,onVisibleRangeChange:n,numVisibleMonths:i=1,pageBehavior:r="single",...o}){const l=m.useRef(""),{locale:c}=Qe(),d=gl({...o,pageBehavior:r,visibleDuration:{months:i},locale:c,createCalendar:Qa}),u=m.useRef(null),{calendarProps:f,prevButtonProps:g,nextButtonProps:h,title:p}=bl({...o,pageBehavior:r},d,u),b=d.visibleRange.start.toString();return m.useEffect(()=>{l.current!==b&&(l.current=b,n&&n(d.visibleRange))},[b]),s.jsxs("div",{className:"sarsa--calendar",children:[s.jsxs("div",{...f,ref:u,className:"calendar",translate:"no",children:[s.jsxs("div",{className:"calendar-header-group",children:[s.jsx(js,{...g,children:s.jsx(j,{iconName:"chevron-left"})}),s.jsx("h2",{className:"rec-sr-only",children:p}),s.jsx(js,{...h,children:s.jsx(j,{iconName:"chevron-right"})})]}),s.jsx("div",{className:"calendar-grids-container",children:Array(i).fill(null).map((x,y)=>s.jsx(ho,{getDayType:t,getTooltipContent:e,state:d,offset:{months:y}},y))})]}),t?s.jsx(po,{startDate:d.visibleRange.start,getDayType:t,numVisibleMonths:i}):null]})}const sn=m.forwardRef(({icon:t="calendar",...e},n)=>{const{buttonProps:i}=As(e,n),{onClick:r,...o}=i,l=c=>{const d=new MouseEvent("mouseup",c.nativeEvent);r&&r(c),c.currentTarget.dispatchEvent(d)};return s.jsx("button",{...o,onClick:l,ref:n,className:"toggle-calendar-button",type:"button",children:s.jsx(j,{iconName:t,className:"button-icon calendar-icon"})})});function Vg(t,e){const{isLabelVisible:n=!0,startName:i="rangePickerStart",endName:r="rangePickerStartEnd",startRef:o,endRef:l,id:c,className:d,style:u,pageBehavior:f="single",size:g="md",getDayType:h,getTooltipContent:p,onVisibleRangeChange:b,onChange:x,minimumNights:y,maximumDays:v,validateOnChange:w=!0,validator:C,numVisibleMonths:T,showClearDates:I=!0,hasFloatingError:R,hasCalendar:S=!0,validateOnMount:_,timeZoneLabel:M,autoOpenCalendar:O=!0,maxRangeSizeToValidate:A=180,...$}=t,{label:U,errorMessage:P,isRequired:D,description:ne,minValue:W,maxValue:Y,isDateUnavailable:B,allowsNonContiguousRanges:H,isDisabled:V,isInvalid:Q}=$,G=m.useId(),E=c??G,L=`${E}-toggle`,[Z,z]=m.useState(!1),[ie,we]=m.useState(t.value),[F,q]=m.useState({isInvalid:$.isInvalid??!1,errorText:$.errorMessage??"",inputId:L,id:L,label:U}),te=m.useRef(null),ee=m.useRef(null),Ce=Wr(),{locale:rt}=Qe(),ot=he=>{const vt=new Zt(rt),lt=he?.start&&"timeZone"in he.start?he.start?.timeZone:void 0,et=ft(),X={isInvalid:!1,errorText:null,inputId:L,id:L,label:U};if(V)return q(null),null;if(Q===!1)return X;if(!he||!he.start||!he.end)return D&&(X.isInvalid=!0,X.errorText=`${U} is required`),q(X),X;const{start:se,end:Oe}=he;if(se.compare(Oe)>0)return X.isInvalid=!0,X.errorText="End date is before start date",q(X),X;if(W&&W.compare(se)>0)return X.isInvalid=!0,X.errorText=`Start date must be ${vt.format(W.toDate(lt||et))} or later`,q(X),X;if(Y&&Y.compare(Oe)<0)return X.isInvalid=!0,X.errorText=`End date must be ${vt.format(Y.toDate(lt||et))} or earlier`,q(X),X;if(v&&Oe.compare(se)+1>v)return X.isInvalid=!0,X.errorText=`Maximum length is ${v} ${v===1?"day":"days"}`,q(X),X;if(y&&Oe.compare(se)=2e3)for(let Qs=0;Qs{const vt=w?ot(he):null;x&&(we(he),x(he,vt))},isInvalid:$.isInvalid??F?.isInvalid}),{buttonProps:ts,calendarProps:Ot,descriptionProps:ss,dialogProps:Ws,endFieldProps:zs,errorMessageProps:as,groupProps:Ks,labelProps:He,startFieldProps:Ys}=xl($,de,ee);m.useEffect(()=>{_&&de.value?.start&&de.value?.end&&ot(de.value)},[]),m.useImperativeHandle(e,()=>({validate:()=>ot(de.value)}));function Zs(he){setTimeout(()=>{Ot.onChange&&he&&Ot.onChange(he)},0)}ts.onPress=()=>{z(!0),de.toggle()};const Js=de.value?.start&&de.value?.end?`${de?.value?.start.month}${de?.value?.start.year}`:void 0,ns=He.onClick,Xs=he=>te.current?.contains(he)?!0:!ee.current?.contains(he),ue=()=>{O&&de.open()};return s.jsxs("div",{"data-component":"DateRangePicker",className:N("sarsa--date-picker","date-range-picker",d,{"has-clear-button":I}),style:u,id:E,children:[s.jsx(Ds,{...He,isRequired:D,isVisible:n,includeBottomMargin:!0,children:U}),s.jsxs("div",{...Ks,ref:ee,className:N("inputs-group",g,{invalid:Q??F?.isInvalid}),children:[s.jsxs("div",{className:"inputs-group-left",children:[S?s.jsx(sn,{...ts,ref:te,id:L}):s.jsx(j,{iconName:"calendar",className:"no-popup-calendar-icon"}),s.jsx(Sa,{...Ys,open:ue,className:"start",autoFocus:Z,setAutoFocus:z,close:de.close,isOpen:de.isOpen,timeZoneLabel:M}),s.jsx("span",{"aria-hidden":"true",className:"arrow-wrap",children:s.jsx(j,{iconName:"arrow-forward"})}),s.jsx(Sa,{...zs,open:ue,className:"end",autoFocus:Z,setAutoFocus:z,close:de.close,isOpen:de.isOpen,hasCalendar:S,timeZoneLabel:M})]}),I&&de?.value?.start&&de?.value?.end&&!V?s.jsx(Us,{"aria-label":"Clear Dates",onPress:()=>{de.close(),de.setValue(null),w&&ot(null),ns&&ns()}}):null,s.jsx(Og,{startName:i,endName:r,value:de.value,startRef:o,endRef:l,id:E})]}),S?s.jsx(tn,{isOpen:de.isOpen,close:de.close,inputSize:g,shouldCloseOnInteractOutside:Xs,children:s.jsxs("div",{className:"popup",...Ws,children:[m.createElement(Bg,{...Ot,onChange:Zs,autoFocus:Z,key:Js,pageBehavior:f,getDayType:h,getTooltipContent:p,onVisibleRangeChange:b,numVisibleMonths:T||Ce}),s.jsx(Je,{className:"popup-error-message",children:P??F?.errorText})]})}):null,s.jsx(en,{...ss,children:ne}),s.jsx(Je,{...as,isFloating:R,children:P??F?.errorText})]})}const Yb=m.forwardRef(Vg);function Hg({getDayType:t,getTooltipContent:e,onVisibleRangeChange:n,numVisibleMonths:i=1,headingLevel:r=2,pageBehavior:o="single",...l}){const c=m.useRef(""),{locale:d}=Qe(),u=yl({...l,pageBehavior:o,visibleDuration:{months:i},locale:d,createCalendar:Qa}),{calendarProps:f,prevButtonProps:g,nextButtonProps:h,title:p}=wl({...l,pageBehavior:o},u),b=u.visibleRange.start.toString();m.useEffect(()=>{c.current!==b&&(c.current=b,n&&n(u.visibleRange))},[b]);const x=`h${r}`;return s.jsxs("div",{className:"sarsa--calendar",children:[s.jsxs("div",{...f,className:"calendar",translate:"no",children:[s.jsxs("div",{className:"calendar-header-group",children:[s.jsx(js,{...g,children:s.jsx(j,{iconName:"chevron-left"})}),s.jsx(x,{className:"rec-sr-only",children:p}),s.jsx(js,{...h,children:s.jsx(j,{iconName:"chevron-right"})})]}),s.jsx("div",{className:"calendar-grids-container",children:Array(i).fill(null).map((y,v)=>s.jsx(ho,{getDayType:t,getTooltipContent:e,state:u,offset:{months:v}},v))})]}),t?s.jsx(po,{startDate:u.visibleRange.start,getDayType:t,numVisibleMonths:i}):null]})}function Ug(t,e){const{isLabelVisible:n=!0,name:i="datePicker",inputRef:r,id:o,className:l,style:c,pageBehavior:d="single",size:u="md",getDayType:f,getTooltipContent:g,onVisibleRangeChange:h,onChange:p,validateOnChange:b=!0,validateOnMount:x,validator:y,numVisibleMonths:v,showClearDates:w=!0,hasFloatingError:C,hasCalendar:T=!0,timeZoneLabel:I,autoOpenCalendar:R=!0,...S}=t,{label:_,errorMessage:M,isDisabled:O,isRequired:A,description:$,minValue:U,maxValue:P,isDateUnavailable:D,isInvalid:ne,hideTimeZone:W}=S,Y=m.useId(),B=o??Y,H=`${B}-toggle`,[V,Q]=m.useState(!1),[G,E]=m.useState(t.value),[L,Z]=m.useState({isInvalid:S.isInvalid??!1,errorText:S.errorMessage??"",inputId:H,id:H,label:_}),z=m.useRef(null),ie=m.useRef(null),we=Wr(),{locale:F}=Qe(),q=ue=>{const he=ft(),vt=ue&&"hour"in ue&&typeof ue.hour=="number",lt=ue&&"timeZone"in ue?ue?.timeZone:void 0,et={year:"numeric",month:"numeric",day:"numeric"};vt&&(et.hour="numeric",et.minute="numeric",lt&&!W&&(et.timeZoneName="short",et.timeZone=lt));const X=new Zt(F,et),se={isInvalid:!1,errorText:null,inputId:H,id:H,label:_};if(O)return Z(null),null;if(ne===!1)return se;if(!ue)return A&&(se.isInvalid=!0,se.errorText=`${_} is required`),Z(se),se;if(U&&U.compare(ue)>0)return se.isInvalid=!0,se.errorText=`${_} must be ${X.format(U.toDate(lt||he))} or later`,Z(se),se;if(P&&P.compare(ue)<0)return se.isInvalid=!0,se.errorText=`${_} must be ${X.format(P.toDate(lt||he))} or earlier`,Z(se),se;if(D&&D(ue))return se.isInvalid=!0,se.errorText="Date is not available",Z(se),se;if(y){const Oe=y(ue,_);return se.isInvalid=Oe.isInvalid,se.errorText=Oe.errorMessage,Z(se),se}return Z(se),se};b&&t.onChange&&t.value!==void 0&&G!==void 0&&nf(t.value,G)&&(q(t.value),E(t.value));const ee=Cl({...S,onChange:ue=>{const he=b?q(ue):null;p&&(E(ue),p(ue,he))},isInvalid:S.isInvalid??L?.isInvalid}),{buttonProps:Ce,calendarProps:rt,descriptionProps:ot,dialogProps:an,fieldProps:de,errorMessageProps:ts,groupProps:Ot,labelProps:ss}=Sl(S,ee,ie);m.useEffect(()=>{!O&&x&&ee.value&&q(ee.value)},[]),m.useImperativeHandle(e,()=>({validate:()=>q(ee.value)}));function Ws(ue){setTimeout(()=>{rt.onChange&&rt.onChange(ue)},0)}Ce.onPress=()=>{Q(!0),ee.toggle()};const zs=ee.value?`${ee?.value?.month}${ee?.value?.year}`:void 0,as=ss.onClick,Ks=t.granularity==="hour"||t.granularity==="minute"||t.granularity==="second",He=ee.value||S.value||S.defaultValue||S.placeholderValue||S.minValue||S.maxValue,Ys=He&&"hour"in He&&typeof He.hour=="number",Zs=Ks||Ys,Js=He&&"timeZone"in He&&typeof He.timeZone=="string",ns=ue=>V?!0:!ie.current?.contains(ue),Xs=()=>{R&&ee.open()};return s.jsxs("div",{"data-component":"DatePicker",className:N("sarsa--date-picker","single-date-picker",l,{"has-clear-button":w,"has-time":Zs,"has-time-zone":Js&&!W}),style:c,id:B,children:[s.jsx(Ds,{...ss,isRequired:A,isVisible:n,includeBottomMargin:!0,children:_}),s.jsxs("div",{...Ot,ref:ie,className:N("inputs-group",u,{invalid:ne??L?.isInvalid}),children:[s.jsxs("div",{className:"inputs-group-left",children:[T?s.jsx(sn,{...Ce,ref:z,id:H}):s.jsx(j,{iconName:"calendar",className:"no-popup-calendar-icon"}),s.jsx(Sa,{...de,open:Xs,className:"start",autoFocus:V,setAutoFocus:Q,close:ee.close,isOpen:ee.isOpen,hasCalendar:T,timeZoneLabel:I,hideTimeZone:W})]}),w&&ee?.value&&!O?s.jsx(Us,{"aria-label":"Clear Date",onPress:()=>{ee.close(),ee.setValue(null),b&&q(null),as&&as()}}):null,s.jsx(uo,{name:i,value:ee.value,inputRef:r,id:B})]}),T?s.jsx(tn,{isOpen:ee.isOpen,close:ee.close,inputSize:u,shouldCloseOnInteractOutside:ns,children:s.jsxs("div",{className:"popup",...an,children:[m.createElement(Hg,{...rt,onChange:Ws,autoFocus:V,key:zs,pageBehavior:d,getDayType:f,getTooltipContent:g,onVisibleRangeChange:h,numVisibleMonths:v||we}),s.jsx(Je,{className:"popup-error-message",isFloating:C,children:M??L?.errorText})]})}):null,s.jsx(en,{...ot,children:$}),s.jsx(Je,{...ts,children:M??L?.errorText})]})}const Zb=m.forwardRef(Ug);function qg({state:t,timeZoneLabel:e,hideTimeZone:n}){const i=t.granularity;return s.jsxs("div",{className:"date-field",translate:"no",children:[t.segments.map((r,o)=>{if(r.type==="timeZoneName")return n||e?null:s.jsx("div",{className:"time-zone",children:r.text},o);if(r.type==="hour"){if(r.placeholder="hh",i==="hour")return s.jsx(m.Fragment,{children:s.jsx(Nt,{segment:r,state:t})},o)}else r.type==="minute"&&(r.placeholder="mm");return s.jsx(Nt,{segment:r,state:t},o)}),e&&!n?s.jsx("div",{className:"time-zone",children:e}):null]})}function oa(t,e=hi(ft())){return t?"day"in t?t:pi(e,t):null}const Gg=({inputId:t,isInvalid:e,errorMessage:n,label:i,isRequired:r,locale:o,hideTimeZone:l,value:c,validator:d,...u})=>{const f=c&&"day"in c?c:void 0,g=u.minValue?oa(u.minValue,f):void 0,h=u.maxValue?oa(u.maxValue,f):void 0,p=c&&"timeZone"in c?c?.timeZone:void 0,b=ft(),x=c&&"day"in c?Nl(c):c,y=c==null?null:oa(c),v={hour:"numeric",minute:"numeric"};p&&!l&&(v.timeZoneName="short",v.timeZone=p);const w=new Zt(o,v),C={isInvalid:!1,errorText:null,label:i,inputId:t,id:t};if(e===!1)return C;if(e)return C.isInvalid=!0,C.errorText=n??null,C;if(!x||!y)return r&&(C.isInvalid=!0,C.errorText=`${i} is required`),C;if(g&&g.compare(y)>0)return C.isInvalid=!0,C.errorText=`${i} must be ${w.format(g.toDate(p||b))} or later`,C;if(h&&h.compare(y)<0)return C.isInvalid=!0,C.errorText=`${i} must be ${w.format(h.toDate(p||b))} or earlier`,C;if(d){const T=d(y,i);C.isInvalid=T.isInvalid,C.errorText=T.errorMessage}return C};function ps({children:t,isSelected:e,...n}){const i=m.useRef(null),{buttonProps:r}=As(n,i),{isFocusVisible:o,focusProps:l}=_t();return s.jsx("button",{type:"button",...r,...l,className:N("time-picker-button",{selected:e,focus:o}),"data-selected":e?"true":void 0,children:t})}const Wg=[1,2,3,4,5,6,7,8,9,10,11,12],zg=[0,15,30,45];function Kg({state:t,close:e,errorMessage:n}){const i=m.useRef(null),r=m.useRef(null),o=m.useRef(null),l=Number(t.segments.find(p=>p.type==="hour")?.text),c=typeof l!="number"||Number.isNaN(l)?void 0:l>12?l-12:l,d=Number(t.segments.find(p=>p.type==="minute")?.text),u=[...zg];!Number.isNaN(d)&&!u.includes(d)&&(u.push(d),u.sort()),m.useEffect(()=>{const p=i.current;if(!p)return;const b=p.querySelector("button[data-selected]");b?b.focus():p.querySelector("button")?.focus()},[]);function f(p){const b=i.current,x=r.current;if(!b||!x)return;const y=Array.from(b?.querySelectorAll("button")),v=document.activeElement?y.indexOf(document.activeElement):0;switch(p.key){case"ArrowDown":{p.preventDefault();const w=v===y.length-1?0:v+1;y[w]?.focus();break}case"ArrowUp":{p.preventDefault();const w=v===0?y.length-1:v-1;y[w]?.focus();break}case"ArrowRight":{p.preventDefault(),(x.querySelector("[data-selected]")||x.querySelector("button"))?.focus();break}}}function g(p){const b=i.current,x=r.current,y=o.current;if(!b||!x||!y)return;const v=Array.prototype.slice.call(x?.querySelectorAll("button")),w=v.indexOf(document.activeElement);switch(p.key){case"ArrowDown":{p.preventDefault();const C=w===v.length-1?0:w+1;v[C]?.focus();break}case"ArrowUp":{p.preventDefault();const C=w===0?v.length-1:w-1;v[C]?.focus();break}case"ArrowLeft":{p.preventDefault(),(b.querySelector("[data-selected]")||b.querySelector("button"))?.focus();break}case"ArrowRight":{p.preventDefault();const C=y.querySelector("[data-selected]");y.querySelector("button"),C?.focus();break}}}function h(p){const b=r.current,x=o.current;if(!b||!x)return;const y=Array.prototype.slice.call(x?.querySelectorAll("button")),v=y.indexOf(document.activeElement);switch(p.key){case"ArrowDown":{p.preventDefault();const w=v===y.length-1?0:v+1;y[w]?.focus();break}case"ArrowUp":{p.preventDefault();const w=v===0?y.length-1:v-1;y[w]?.focus();break}case"ArrowLeft":{p.preventDefault(),(b.querySelector("[data-selected]")||b.querySelector("button"))?.focus();break}}}return s.jsxs("div",{className:"sarsa--time-picker-popup",children:[s.jsxs("div",{className:N("columns",{"is-hour-only":t.granularity==="hour"}),children:[s.jsx("div",{className:"column hour",ref:i,onKeyDown:f,children:Wg.map(p=>s.jsx(ps,{onPress:()=>{t.setSegment("hour",p)},isSelected:p===c,"aria-label":`Hour: ${p}`,children:p},p))}),t.granularity==="hour"?null:s.jsx("div",{className:"column minute",ref:r,onKeyDown:g,children:u.map(p=>{const b=p<10?`0${p}`:p;return s.jsx(ps,{onPress:()=>{t.setSegment("minute",p)},isSelected:d===p,"aria-label":`Minutes: ${b}`,isDisabled:t.granularity==="hour",children:b},p)})}),s.jsxs("div",{className:"column am-pm",ref:o,onKeyDown:h,children:[s.jsx(ps,{onPress:()=>{t.setSegment("dayPeriod",0)},isSelected:t.segments.find(p=>p.type==="dayPeriod")?.text==="AM",children:"AM"}),s.jsx(ps,{onPress:()=>{t.setSegment("dayPeriod",12)},isSelected:t.segments.find(p=>p.type==="dayPeriod")?.text==="PM",children:"PM"})]})]}),n?s.jsx("div",{className:"px-2 py-half",children:s.jsx(Je,{children:n})}):null,s.jsxs("div",{className:"popup-footer",children:[s.jsx(k,{size:"xxs",appearance:"subtle",onClick:()=>{const p=xi(new Date().toISOString()).set({second:0,millisecond:0});t.setSegment("hour",p.hour),t.setSegment("minute",p.minute),t.setSegment("dayPeriod",p.hour>12?12:0),t.setValue(p),e()},children:"Now"}),s.jsx(k,{size:"xxs",appearance:"primary",onClick:e,children:"Close"})]})]})}function Yg(t,e){const{label:n,isRequired:i,name:r="timePicker",inputRef:o,id:l,description:c,errorMessage:d,size:u="md",isLabelVisible:f,showClearButton:g=!0,isDisabled:h,timeZoneLabel:p,hideTimeZone:b,granularity:x="minute",className:y,style:v,onChange:w,minValue:C,maxValue:T,shouldValidateOnMount:I,hasFloatingError:R,validateOnChange:S=!0,validator:_}=t,M=m.useId(),O=l??M,A=`${O}-toggle`,[$,U]=m.useState(!1),P=m.useRef(null),D=m.useRef(null),[ne,W]=m.useState({isInvalid:t.isInvalid??!1,errorText:d??"",inputId:A,id:A,label:n}),{locale:Y}=Qe(),B=ee=>{const Ce=Gg({value:ee,inputId:A,isInvalid:t.isInvalid,errorMessage:d,isRequired:i,label:n,minValue:C,maxValue:T,locale:Y,hideTimeZone:b,validator:_});return W(Ce),Ce},V=Tl({...t,onChange:ee=>{const Ce=S?B(ee):null;w&&w(ee,Ce)},granularity:x,locale:Y}),{labelProps:Q,fieldProps:G,descriptionProps:E,errorMessageProps:L}=jl({...t,isInvalid:t.isInvalid??ne.isInvalid},V,D),Z=V.timeValue?.toString()??"",z=Q.onClick,ie=()=>{window.setTimeout(()=>{P.current?.focus()},0)},we=()=>{U(!1),ie()},F=()=>{U(!1)};m.useEffect(()=>{I&&V.timeValue&&B(V.timeValue)},[]),m.useImperativeHandle(e,()=>({validate:()=>B(V.timeValue)}));const q=m.useCallback(()=>{U(!1)},[]),te=Y.includes("US");return s.jsxs("div",{className:N("sarsa--date-picker",y,{"has-clear-button":g}),style:v,id:O,children:[s.jsx(Ds,{...Q,isRequired:i,isVisible:f,includeBottomMargin:!0,children:n}),s.jsxs("div",{...G,ref:D,className:N("inputs-group",u,{invalid:!h&&(t.isInvalid||ne.isInvalid)}),children:[s.jsxs("div",{className:"inputs-group-left",onKeyDown:q,children:[te?s.jsx(sn,{ref:P,id:A,icon:"clock",onPress:()=>{U(ee=>!ee)},isDisabled:V.isDisabled}):s.jsx(j,{iconName:"clock",className:"no-popup-calendar-icon"}),s.jsx(qg,{state:V,timeZoneLabel:p,hideTimeZone:b})]}),g&&V?.value&&!h?s.jsx("span",{onKeyDown:q,children:s.jsx(Us,{"aria-label":"Clear Time",onPress:()=>{V.setValue(null),F(),window.setTimeout(()=>{z&&z()},0)}})}):null,s.jsx(uo,{name:r,value:Z,inputRef:o,id:O})]}),s.jsx(tn,{isOpen:$,close:F,inputSize:u,hideClose:!0,children:s.jsx("div",{className:"popup time-picker",children:s.jsx(Kg,{state:V,close:we,errorMessage:h?null:d||ne.errorText})})}),s.jsx(en,{...E,children:c}),s.jsx(Je,{...L,isFloating:R,children:h?null:d||ne.errorText})]})}m.forwardRef(Yg);function Jn({date:t,format:e="l",timeZone:n,showTimeZone:i,options:r,timeZoneLabel:o}){const c=uf()(t,r??{format:e,timeZone:n,showTimeZone:i});return s.jsxs("span",{translate:"no",children:[c,o?` ${o}`:null]})}function Jb({children:t}){const e=Be(),{pathname:n,search:i}=Yt(),r=new URLSearchParams(i);return r.set("redirect",n),e?t:(window.location.assign(`/log-in?${r.toString()}`),s.jsx(ke,{isFullscreen:!0}))}a.oneOfType([a.arrayOf(a.any),a.string,a.node]),a.func.isRequired,a.bool,a.string;a.oneOfType([a.arrayOf(a.any),a.string,a.node]),a.element,a.element,a.func.isRequired,a.func.isRequired;const Zg=m.createContext(null),Gs=()=>{const t=m.useContext(Zg);if(t==null)throw new Error("Popover components must be wrapped in ");return t};m.forwardRef(({children:t,...e},n)=>{const i=Gs(),r=t.ref,o=Jt([i.refs.setReference,n,r]);return s.jsx(k,{ref:o,type:"button","data-state":i.open?"open":"closed",...i.getReferenceProps(e),children:t})});const Jg=m.forwardRef((t,e)=>{const{setOpen:n}=Gs();return s.jsx("button",{type:"button",ref:e,"aria-label":"Close popover",...t,className:"inline-popup-keyboard-close-btn",onClick:i=>{t.onClick?.(i),n(!1)},children:s.jsx(j,{size:"sm",iconName:"close"})})}),Xg=m.forwardRef((t,e)=>{const{setLabelId:n}=Gs(),i=Rl();return m.useLayoutEffect(()=>(n(i),()=>n(void 0)),[i,n]),s.jsx("h2",{...t,ref:e,id:i,className:"h6 mb-1",children:t.children})});m.forwardRef(({style:t,...e},n)=>{const{context:i,...r}=Gs(),o=Jt([r.refs.setFloating,n]);return i.open?s.jsx(yi,{children:s.jsx(wi,{context:i,modal:r.modal,initialFocus:1,children:s.jsxs("div",{ref:o,style:{...r.floatingStyles,...t},"aria-labelledby":r.labelId,"aria-describedby":r.descriptionId,...r.getFloatingProps(e),className:"sarsa--popover",children:[e.heading?s.jsx(Xg,{children:e.heading}):null,s.jsx("div",{children:e.children}),s.jsx(Jg,{}),s.jsx(Il,{ref:r.arrowRef,context:i,strokeWidth:1,className:"sarsa--popover-arrow",width:12,height:6})]})})}):null});const Rs=m.createContext({getItemProps:()=>({}),activeIndex:null,setActiveIndex:()=>{},setHasFocusInside:()=>{},isOpen:!1}),Xn=m.forwardRef((t,e)=>{const{children:n,label:i,size:r="md",isIconOnly:o,hasChevronIcon:l,hasBorder:c=!0,hasFill:d=!0,...u}=t,[f,g]=m.useState(!1),[h,p]=m.useState(!1),[b,x]=m.useState(null),y=m.useRef([]),v=m.useRef([]),w=m.useContext(Rs),C=Ra(),T=El(),I=Ci(),R=Ia(),S=I!=null,{floatingStyles:_,refs:M,context:O}=kl({nodeId:T,open:f,onOpenChange:g,placement:S?"right-start":"bottom-start",middleware:[Ul({mainAxis:S?8:4,alignmentAxis:S?-4:0}),ql(),Gl()],whileElementsMounted:Hl}),A=_l(O,{enabled:S,delay:{open:75},handleClose:Al({blockPointerEvents:!0})}),$=Ml(O,{event:"mousedown",toggle:!S,ignoreMouse:S}),U=Ol(O,{role:"menu"}),P=Pl(O,{bubbles:!0}),D=Ll(O,{listRef:y,activeIndex:b,nested:S,onNavigate:x}),ne=$l(O,{listRef:v,onMatch:f?x:void 0,activeIndex:b}),{getReferenceProps:W,getFloatingProps:Y,getItemProps:B}=Dl([A,$,U,P,D,ne]);m.useEffect(()=>{if(!C)return()=>{};function V(){g(!1)}function Q(G){G.nodeId!==T&&G.parentId===I&&g(!1)}return C.events.on("click",V),C.events.on("menuopen",Q),()=>{C.events.off("click",V),C.events.off("menuopen",Q)}},[C,T,I]),m.useEffect(()=>{f&&C&&C.events.emit("menuopen",{parentId:I,nodeId:T})},[C,f,T,I]);const H=m.useMemo(()=>({activeIndex:b,setActiveIndex:x,getItemProps:B,setHasFocusInside:p,isOpen:f}),[b,B,f]);return s.jsxs(Fl,{id:T,children:[s.jsxs("button",{type:"button",ref:Jt([M.setReference,R.ref,e]),tabIndex:S?w.activeIndex===R.index?0:-1:void 0,role:S?"menuitem":void 0,"data-open":f?"":void 0,"data-nested":S?"":void 0,"data-focus-inside":h?"":void 0,className:N(r,{"sarsa--menu-trigger":!S,"sarsa--menu-item":S,"is-nested-menu":S,"icon-only":o,"has-border":c,"has-fill":d}),...W({...u,onFocus(V){u.onFocus?.(V),p(!1)}}),children:[s.jsx("span",{className:"contents-wrap",children:i}),!S&&l?f?s.jsx(j,{iconName:"chevron-up",className:"chevron-icon"}):s.jsx(j,{iconName:"chevron-down",className:"chevron-icon"}):null,S&&s.jsx(j,{"aria-hidden":!0,iconName:"chevron-right",className:"nested-icon"})]}),s.jsx(Rs.Provider,{value:H,children:s.jsx(Bl,{elementsRef:y,labelsRef:v,children:f&&s.jsx(yi,{children:s.jsx(wi,{context:O,modal:!1,initialFocus:S?-1:0,returnFocus:!S,children:s.jsx("div",{ref:M.setFloating,className:"sarsa--menu-popup",style:_,...Y(),children:n})})})})})]})});m.forwardRef((t,e)=>{const{"aria-label":n,isDisabled:i,children:r,iconBeforeElement:o,appearance:l,...c}=t,d=n??qt(r),u=m.useContext(Rs),f=Ia({label:i?null:d}),g=Ra(),h=f.index===u.activeIndex;return s.jsx("button",{...c,ref:Jt([f.ref,e]),type:"button",role:"menuitem",className:N("sarsa--menu-item",{danger:l==="danger"}),tabIndex:h?0:-1,disabled:i,...u.getItemProps({onClick(p){g?.events.emit("click"),window.setTimeout(()=>{c.onClick?.(p)},0)},onFocus(p){c.onFocus?.(p),u.setHasFocusInside(!0)}}),children:s.jsxs("span",{className:"item-contents-wrap",children:[o?s.jsx("span",{className:"icon-wrap",children:o}):null,s.jsx("span",{children:r})]})})});m.forwardRef((t,e)=>{const{"aria-label":n,children:i,iconBeforeElement:r,...o}=t,l=n??qt(i),c=m.useContext(Rs),d=Ia({label:l}),u=Ra(),f=d.index===c.activeIndex;return s.jsx("a",{...o,ref:Jt([d.ref,e]),type:"button",role:"menuitem",className:"sarsa--menu-item",tabIndex:f?0:-1,...c.getItemProps({onClick(g){o.onClick?.(g),u?.events.emit("click")},onFocus(g){o.onFocus?.(g),c.setHasFocusInside(!0)}}),children:s.jsxs("span",{className:"item-contents-wrap",children:[r?s.jsx("span",{className:"icon-wrap",children:r}):null,s.jsx("span",{children:i})]})})});m.forwardRef((t,e)=>Ci()===null?s.jsx(Vl,{children:s.jsx(Xn,{...t,ref:e})}):s.jsx(Xn,{...t,ref:e}));function Xb({label:t,isLabelVisible:e=!0,labelPosition:n="right",description:i,className:r,size:o="md",srOnlyDescription:l=!1,id:c,clickTagCategory:d,clickTagLabel:u,clickTagAction:f,...g}){const h=Wl(g),p=m.useRef(null),{labelProps:b,inputProps:x,isSelected:y,isDisabled:v,isReadOnly:w,isPressed:C}=zl({...g,children:t},h,p),{isFocused:T,isFocusVisible:I,focusProps:R}=_t(),S=g.isDisabled||g.isReadOnly,_=m.useId(),M=c??_,{hoverProps:O,isHovered:A}=Kl({...g,isDisabled:S}),$=typeof i=="function"?i(h.isSelected):i;return m.useEffect(()=>{d&&u&&(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"switch_toggle",category:d,action:y?"Switch is on":"Switch is off",label:u}))},[y,d,u,f]),s.jsx("div",{...at(b,O),"data-component":"Switch","data-selected":y||void 0,"data-pressed":C||void 0,"data-hovered":A||void 0,"data-focused":T||void 0,"data-focus-visible":I||void 0,"data-disabled":v||w||void 0,"data-readonly":w||void 0,className:N(r,{"label-left":n==="left","label-right":n==="right","label-top":n==="top"}),children:s.jsxs("div",{className:N("inner",{"label-left":n==="left","label-right":n==="right","label-top":n==="top","label-hidden":e===!1}),children:[s.jsxs("div",{className:"label-description",children:[s.jsxs("label",{htmlFor:M,children:[s.jsx("span",{className:N({"rec-sr-only":!e}),children:t}),s.jsx("input",{...x,...R,ref:p,id:M,"aria-describedby":$?`${M}-description`:void 0,className:"rec-sr-only"})]}),$?s.jsx(re,{size:"sm",color:"gray",id:`${M}-description`,"data-description":!0,"aria-live":"polite",children:s.jsx("span",{className:N({"rec-sr-only":l}),children:$})}):null]}),s.jsx("div",{className:N("indicator",{sm:o==="sm",md:o==="md"})})]})})}class Qb extends K.Component{static propTypes={inventory:a.oneOf(["Campground","Permit","Vehicle Permit","Ticket Facility"]),facility_id:a.string};constructor(e){super(e),this.VEHICLE_PERMIT="Vehicle Permit",this.PERMIT="Permit",this.TICKET_FACILITY="Ticket Facility",this.CAMPGROUND="Campground",this.linkMap={[this.CAMPGROUND]:{facility:"https://www.recreation.gov/camping/campgrounds/:location_id",factType:"camping"},[this.PERMIT]:{facility:"https://www.recreation.gov/permits/:location_id",factType:"permits"},[this.TICKET_FACILITY]:{facility:"https://www.recreation.gov/ticket/facility/:location_id",factType:"ticket"},[this.VEHICLE_PERMIT]:{facility:"https://www.recreation.gov/vehiclepermits/:location_id",factType:"vehiclepermits"}},this.typedEnvironmentMap={[this.CAMPGROUND]:{path:"camps/internal/campgrounds",data:{additional:"campground.notices",seasons:"seasons"}},[this.PERMIT]:{path:"permits",data:{additional:"payload.description.need_to_know_permit"}},[this.TICKET_FACILITY]:{path:"ticket/facility",data:{additional:"notes"}},[this.VEHICLE_PERMIT]:{path:"vehiclepermits",data:{additional:"payload.description.need_to_know_permit"}}},this.state={isExternalCSRLoggedIn:!1,locationNotesData:null,locationNotesError:null,locationNotesLoading:!1,additionalData:null,additionalError:null,additionalLoading:!1,seasonsData:null,seasonsError:null,seasonsLoading:!1,bannerData:null,bannerError:null,bannerLoading:!1},this.fetchData=this.fetchData.bind(this),this.fetchAllData=this.fetchAllData.bind(this),this.renderBanners=this.renderBanners.bind(this),this.renderList=this.renderList.bind(this),this.renderSeasonTable=this.renderSeasonTable.bind(this),this.isValidLocation=this.isValidLocation.bind(this)}componentDidMount(){this.setState({isExternalCSRLoggedIn:Ms()}),this.fetchAllData()}componentDidUpdate(e,n){(e.inventory!==this.props.inventory||e.facility_id!==this.props.facility_id||!n.isExternalCSRLoggedIn&&this.state.isExternalCSRLoggedIn)&&this.fetchAllData()}fetchAllData(){if(!this.state.isExternalCSRLoggedIn||!this.isValidLocation())return;this.fetchData(`/api/inventory/location-notes/location/${this.props.facility_id}`,"locationNotesData","locationNotesError","locationNotesLoading","location_notes");const e=qe(this.typedEnvironmentMap,this.props.inventory,!1);if(e){this.fetchData(`/api/${e.path}/${this.props.facility_id}`,"additionalData","additionalError","additionalLoading",e.data.additional);const r=qe(e,"data.seasons",!1);r&&this.fetchData(`/api/${e.path}/${this.props.facility_id}/${r}`,"seasonsData","seasonsError","seasonsLoading",r)}const n="/api/communication/external/alert",i=`location_id=${encodeURIComponent(this.props.facility_id)}&location_type=${encodeURIComponent(this.props.inventory)}`;this.fetchData(`${n}?${i}`,"bannerData","bannerError","bannerLoading","alerts")}fetchData(e,n,i,r,o){const l={Authorization:xs()};this.setState({[r]:!0}),le.get(e,{headers:l}).then(c=>{this.setState({[r]:!1,[i]:null,[n]:qe(c.data,o,{})})}).catch(c=>{this.setState({[r]:!1,[i]:c})})}isValidLocation(){return Object.keys(this.linkMap).indexOf(this.props.inventory)>-1&&this.props.facility_id!==""}renderBanners(e){return this.state.bannerLoading?s.jsx(ke,{}):!e||e.length===0?s.jsx("span",{children:"No results."}):s.jsx("div",{children:e.map((n,i)=>s.jsxs("div",{className:n.alert_level==="WARNING"?"ia-block rec-notification-warning":"ia-block rec-notification-info",children:[s.jsx(Xe,{html:n.body}),n.notes!==void 0&&n.notes.length>0&&s.jsx("div",{children:s.jsxs("i",{children:["NOTE: ",n.notes]})})]},`banner-item_${i}`))})}renderList(e,n,i,r){if(i)return s.jsx(ke,{});if(!e||e.length===0||Ee(e))return s.jsx("span",{children:"No results."});const o=[];for(let l=0;ls.jsxs("tr",{children:[s.jsx("td",{children:e.season_type}),s.jsxs("td",{children:[s.jsx(Jn,{date:new Date(e.season_start),format:"LL"})," - ",s.jsx(Jn,{date:new Date(e.season_end),format:"LL"})]})]},`season-row_${n}`))})]}):s.jsx("span",{children:"No results."})}render(){if(!this.state.isExternalCSRLoggedIn||!this.isValidLocation())return null;let e=null;this.props.inventory===this.CAMPGROUND&&(e=s.jsxs("div",{children:[s.jsx(ae,{appearance:"h6",headingLevel:3,children:"Facility Seasons"}),this.state.seasonsError?s.jsx("span",{children:"Error retrieving season information."}):this.renderSeasonTable()]}));let n=null;this.props.inventory===this.CAMPGROUND?n=this.renderList(this.state.additionalData,"notice_text",this.state.additionalLoading,!0):this.props.inventory===this.TICKET_FACILITY?n=this.renderList(this.state.additionalData,"description",this.state.additionalLoading,!0):n=this.renderList(this.state.additionalData,"",this.state.additionalLoading);const i=qe(this.state,"locationNotesData",[]),r=Array.isArray(i)?i.filter(l=>!l.mandatory):[],o=Array.isArray(i)?i.filter(l=>l.mandatory):[];return s.jsxs("section",{className:N("rec-order-detail-need-to-know","rec-order-detail-section"),children:[s.jsx(ae,{className:"rec-section-header",appearance:"h4",headingLevel:2,children:"CSR Facility Information"}),s.jsxs("div",{className:"rec-order-detail-section-body",children:[s.jsx(ae,{appearance:"h6",headingLevel:3,children:"Mandatory Call Center Read"}),this.state.locationNotesError?s.jsx("span",{children:"Error retrieving call center notes."}):this.renderList(o,"note",this.state.locationNotesLoading,!0),s.jsx(ae,{appearance:"h6",headingLevel:3,children:"External Banners"}),this.state.bannerError?s.jsx("span",{children:"Error retrieving external banners."}):this.renderBanners(this.state.bannerData),s.jsx(ae,{appearance:"h6",headingLevel:3,children:"Call Center Notes"}),this.state.locationNotesError?s.jsx("span",{children:"Error retrieving call center notes."}):this.renderList(r,"note",this.state.locationNotesLoading,!0),s.jsx(ae,{appearance:"h6",headingLevel:3,children:"Additional Information"}),this.state.additionalError?s.jsx("span",{children:"Error retrieving additional information"}):n,e]})]})}}class ev extends m.Component{constructor(e){super(e),this.getInfo=()=>{const{siteInfo:n}=this.props;return n?s.jsx(Xe,{html:n}):null},this.handleScroll=n=>{const i=n.target.scrollTop>100;this.setState({showIndicator:!i})},this.createList=()=>{const{listItems:n}=this.props;if(n){const i=n.map((r,o)=>s.jsx("li",{children:s.jsx(Xe,{html:r.notice_text})},o));return s.jsx("ul",{children:i})}return null},this.toggleCheckBox=()=>{typeof this.props.handleChange=="function"&&this.props.handleChange(),this.setState(n=>({consentBoxChecked:!n.consentBoxChecked}))},this.validate=()=>{const{checkboxId:n,errorText:i}=this.props,r={isInvalid:!1,errorText:null,id:n};return this.state.consentBoxChecked?this.setState({isInvalid:!1}):(r.isInvalid=!0,r.errorText=i,this.setState({isInvalid:!0})),r},this.state={consentBoxChecked:this.props.isChecked||!!this.props.checked,showIndicator:!0,isInvalid:this.props.isInvalid,hasScrollableContent:!0},this.informationContentRef=m.createRef()}static{this.propTypes={headerText:a.string,headingLevel:a.oneOf([1,2,3,4,5,6]),introText:a.string,name:a.string,siteInfo:a.string,listItems:a.array,children:a.node,checkboxText:a.string,checkboxId:a.string,isChecked:a.bool,checked:a.bool,handleChange:a.func,showCheckbox:a.bool,className:a.string,isRequired:a.bool,isInvalid:a.bool,errorText:a.node}}static{this.defaultProps={checkboxId:"need-to-know-checkbox",checkboxText:"Yes, I have read and agree to the Need to Know information.",children:void 0,className:void 0,handleChange:void 0,headerText:"Need to Know",headingLevel:2,introText:void 0,isChecked:!1,name:"our site",showCheckbox:!0,siteInfo:void 0,isRequired:!0,isInvalid:!1,errorText:"Please read and agree to the important Need to Know information."}}componentDidMount(){const e=this.informationContentRef.current;e&&e.scrollHeight<320&&(e.parentElement?.classList.add("no-scrollable-content"),this.setState({hasScrollableContent:!1}))}componentDidUpdate({checked:e,isChecked:n,isInvalid:i}){typeof this.props.isChecked<"u"?n!==this.props.isChecked&&this.setState({consentBoxChecked:this.props.isChecked}):typeof this.props.checked<"u"&&e!==this.props.checked&&this.setState({consentBoxChecked:this.props.checked}),this.props.isInvalid!==i&&this.setState({isInvalid:this.props.isInvalid})}render(){const{children:e,className:n,name:i,showCheckbox:r,checkboxId:o,checkboxText:l,headerText:c,headingLevel:d,isRequired:u,introText:f=`Below you will find important information that regards your stay with us. Please carefully read the information and click the check box below to agree to our Rules and Regulations for ${i}.`,errorText:g}=this.props,h=u?s.jsxs(s.Fragment,{children:[l,s.jsxs("abbr",{className:"rec-label-required-indicator",children:[s.jsx("span",{"aria-hidden":"true",children:"*"}),s.jsx("span",{className:"rec-sr-only",children:" (Required) "})]})]}):l;return s.jsxs("section",{className:N("rec-order-detail-need-to-know","sarsa-need-to-know",{[n]:n}),children:[s.jsx(ae,{className:"rec-section-header",appearance:"h4",headingLevel:d,id:"needToKnowHeader",children:c}),s.jsxs("div",{className:"rec-notification-warning",children:[s.jsx("span",{className:"rec-notification-icon",children:s.jsx(j,{iconName:"warning"})}),s.jsxs("div",{className:"rec-notification-body",children:[s.jsx("div",{className:"rec-notification-title",children:"Important information"}),s.jsx("p",{children:f})]})]}),s.jsxs("div",{className:"information",children:[s.jsxs("div",{className:"information-content",ref:this.informationContentRef,onScroll:this.handleScroll,tabIndex:this.state.hasScrollableContent?0:void 0,role:"region","aria-labelledby":"needToKnowHeader",children:[!e&&s.jsx(ae,{className:"mb-1 mb-md-3",appearance:"h6",headingLevel:d?d+1:void 0,children:"Facility Information"}),this.getInfo(),this.createList(),e]}),s.jsx("div",{className:`information-scroll-indicator ${this.state.showIndicator?"":"hide-indicator"}`,"aria-hidden":"true",children:s.jsx("div",{className:"information-scroll-pill",children:"Scroll to Read More"})})]}),s.jsx("div",{className:N("rec-form-check-wrap",{"rec-form-no-checkbox":!r,"is-invalid":this.state.isInvalid&&!this.state.consentBoxChecked}),children:r&&s.jsx(Cs,{label:h,id:o,value:"checked",isRequired:u,isChecked:this.state.consentBoxChecked,onChange:this.toggleCheckBox,name:"needToKnowCheckbox","aria-describedby":this.state.isInvalid?`${o}-error`:void 0})}),this.state.isInvalid&&!this.state.consentBoxChecked&&s.jsxs("div",{id:`${o}-error`,className:"sarsa-field-error-message",children:[s.jsx("span",{className:"req","aria-hidden":"true",children:"*"}),g]})]})}}function Qg(t){return m.useMemo(()=>t?{format:t}:null,[t])}const wt=["var(--slider-out-range)","var(--slider-in-range)","var(--slider-out-range)"];function tv({label:t,isLabelVisible:e=!0,formatOptions:n={},maxValue:i=100,minValue:r=0,name:o="rangeSlider",defaultValue:l,showMinMaxLabels:c,showValue:d=!0,numberFormatter:u,className:f,valueLabelPosition:g="grouped",...h}){const p=m.useRef(null),b=Qg(u),x=Yl(n),y=b||x,w={label:t,defaultValue:l??[r,i],maxValue:i,minValue:r,numberFormatter:y,...h},C=Zl(w),{groupProps:T,trackProps:I,labelProps:R,outputProps:S}=Jl(w,C,p),_=C.isThumbDragging(0)||C.isThumbDragging(1);return s.jsxs("div",{...T,"data-component":"RangeSlider",className:N(f,{"is-dragging":_,"has-thumb-labels":g==="thumbs"}),children:[s.jsxs("div",{className:N("label-container",{"mb-half":e}),children:[s.jsx("label",{...R,children:s.jsx("span",{className:N({"rec-sr-only":!e}),children:t})}),s.jsx("output",{...S,children:s.jsx("span",{className:N({"rec-sr-only":!d||g!=="grouped"}),children:`${C.getThumbValueLabel(0)} – ${C.getThumbValueLabel(1)}`})})]}),s.jsxs("div",{...I,ref:p,className:N("range-slider-inner"),children:[s.jsx("div",{className:N("track",{"is-disabled":C.isDisabled}),style:{background:`linear-gradient(to right, ${wt[0]} 0%, ${wt[0]} ${C.getThumbPercent(0)*100}%, ${wt[1]} ${C.getThumbPercent(0)*100}%, ${wt[1]} ${C.getThumbPercent(1)*100}%, ${wt[2]} ${C.getThumbPercent(1)*100}%, ${wt[2]} 100%)`}}),s.jsx(Qn,{index:0,state:C,trackRef:p,showValueLabel:d&&g==="thumbs"}),s.jsx(Qn,{index:1,state:C,trackRef:p,showValueLabel:d&&g==="thumbs"})]}),c&&g!=="thumbs"?s.jsxs("div",{className:"min-max-labels",role:"presentation",children:[s.jsx("div",{className:N({hidden:C.isThumbDragging(0)&&C.values[0]<(i-r)/4.5+r}),children:y.format(r)}),s.jsx("div",{className:N({hidden:C.isThumbDragging(1)&&C.values[1]>i-(i-r)/4.5}),children:y.format(i)})]}):null,s.jsx("input",{type:"hidden",name:`${o}-min`,value:C.values[0]}),s.jsx("input",{type:"hidden",name:`${o}-max`,value:C.values[1]})]})}function Qn({state:t,trackRef:e,index:n,name:i,showValueLabel:r}){const o=m.useRef(null),{thumbProps:l,inputProps:c,isDragging:d}=Xl({index:n,trackRef:e,inputRef:o,name:i},t),{focusProps:u,isFocusVisible:f}=_t();return s.jsxs("div",{...l,className:N("thumb",{"is-focus-visible":f,"is-dragging":d}),children:[s.jsx(Ql,{children:s.jsx("input",{ref:o,...at(c,u)})}),r?s.jsx("div",{className:"thumb-value-label-wrap","aria-hidden":"true",children:s.jsx("div",{className:"thumb-value-label",children:t.getFormattedValue(Number(c.value))})}):s.jsx("div",{className:"tooltip-wrap",role:"presentation",children:s.jsx("div",{className:"tooltip",children:t.getFormattedValue(Number(c.value))})})]})}const zt=a.shape({altText:a.string,caption:a.string,url:a.string,credit:a.string});a.arrayOf(zt);a.bool,a.string,a.string,a.string;a.arrayOf(zt);a.arrayOf(zt),a.oneOf(["IDLE","PENDING","ERROR","SUCCESS"]),a.bool,a.string,a.string,a.string,a.string,a.string,a.bool;a.string,a.string,a.string,a.bool,a.string;const eb=[{label:"United States",value:"USA"},{label:"Canada",value:"CAN"},{label:"Afghanistan",value:"AFG"},{label:"Albania",value:"ALB"},{label:"Algeria",value:"DZA"},{label:"American Samoa",value:"ASM"},{label:"Andorra",value:"AND"},{label:"Angola",value:"AGO"},{label:"Anguilla",value:"AIA"},{label:"Antarctica",value:"ATA"},{label:"Antigua And Barbuda",value:"ATG"},{label:"Argentina",value:"ARG"},{label:"Armenia",value:"ARM"},{label:"Aruba",value:"ABW"},{label:"Australia",value:"AUS"},{label:"Austria",value:"AUT"},{label:"Azerbaijan",value:"AZE"},{label:"Bahamas",value:"BHS"},{label:"Bahrain",value:"BHR"},{label:"Bangladesh",value:"BGD"},{label:"Barbados",value:"BRB"},{label:"Belarus",value:"BLR"},{label:"Belgium",value:"BEL"},{label:"Belize",value:"BLZ"},{label:"Benin",value:"BEN"},{label:"Bermuda",value:"BMU"},{label:"Bhutan",value:"BTN"},{label:"Bolivia",value:"BOL"},{label:"Bosnia And Herzegovina",value:"BIH"},{label:"Botswana",value:"BWA"},{label:"Bouvet Island",value:"BVT"},{label:"Brazil",value:"BRA"},{label:"British Indian Ocean Territory",value:"IOT"},{label:"Brunei Darussalam",value:"BRN"},{label:"Bulgaria",value:"BGR"},{label:"Burkina Faso",value:"BFA"},{label:"Burundi",value:"BDI"},{label:"Cambodia",value:"KHM"},{label:"Cameroon",value:"CMR"},{label:"Cape Verde",value:"CPV"},{label:"Cayman Islands",value:"CYM"},{label:"Central African Republic",value:"CAF"},{label:"Chad",value:"TCD"},{label:"Chile",value:"CHL"},{label:"China",value:"CHN"},{label:"Christmas Island",value:"CXR"},{label:"Cocos (Keeling) Islands",value:"CCK"},{label:"Colombia",value:"COL"},{label:"Comoros",value:"COM"},{label:"Congo",value:"COG"},{label:"Congo, The Democratic Republic",value:"COD"},{label:"Cook Islands",value:"COK"},{label:"Costa Rica",value:"CRI"},{label:"Côte d'Ivoire",value:"CIV"},{label:"Croatia (Local Name: Hrvatska)",value:"HRV"},{label:"Cuba",value:"CUB"},{label:"Cyprus",value:"CYP"},{label:"Czech Republic",value:"CZE"},{label:"Denmark",value:"DNK"},{label:"Djibouti",value:"DJI"},{label:"Dominica",value:"DMA"},{label:"Dominican Republic",value:"DOM"},{label:"East Timor",value:"TMP"},{label:"Ecuador",value:"ECU"},{label:"Egypt",value:"EGY"},{label:"El Salvador",value:"SLV"},{label:"England",value:"ENG"},{label:"Equatorial Guinea",value:"GNQ"},{label:"Eritrea",value:"ERI"},{label:"Estonia",value:"EST"},{label:"Ethiopia",value:"ETH"},{label:"Falkland Islands (Malvinas)",value:"FLK"},{label:"Faroe Islands",value:"FRO"},{label:"Fiji",value:"FJI"},{label:"Finland",value:"FIN"},{label:"France",value:"FRA"},{label:"France, Metropolitan",value:"FXX"},{label:"French Guiana",value:"GUF"},{label:"French Polynesia",value:"PYF"},{label:"French Southern Territories",value:"ATF"},{label:"Gabon",value:"GAB"},{label:"Gambia",value:"GMB"},{label:"Georgia",value:"GEO"},{label:"Germany",value:"DEU"},{label:"Ghana",value:"GHA"},{label:"Gibraltar",value:"GIB"},{label:"Greece",value:"GRC"},{label:"Greenland",value:"GRL"},{label:"Grenada",value:"GRD"},{label:"Guadeloupe",value:"GLP"},{label:"Guam",value:"GUM"},{label:"Guatemala",value:"GTM"},{label:"Guinea",value:"GIN"},{label:"Guinea-Bissau",value:"GNB"},{label:"Guyana",value:"GUY"},{label:"Haiti",value:"HTI"},{label:"Heard And Mc Donald Islands",value:"HMD"},{label:"Honduras",value:"HND"},{label:"Hong Kong",value:"HKG"},{label:"Hungary",value:"HUN"},{label:"Iceland",value:"ISL"},{label:"India",value:"IND"},{label:"Indonesia",value:"IDN"},{label:"Iran (Islamic Republic Of)",value:"IRN"},{label:"Iraq",value:"IRQ"},{label:"Ireland",value:"IRL"},{label:"Israel",value:"ISR"},{label:"Italy",value:"ITA"},{label:"Jamaica",value:"JAM"},{label:"Japan",value:"JPN"},{label:"Jordan",value:"JOR"},{label:"Kazakhstan",value:"KAZ"},{label:"Kenya",value:"KEN"},{label:"Kiribati",value:"KIR"},{label:"Korea, Democratic People's Rep",value:"PRK"},{label:"Korea, Republic Of",value:"KOR"},{label:"Kuwait",value:"KWT"},{label:"Kyrgyzstan",value:"KGZ"},{label:"Lao People's Democratic Republic",value:"LAO"},{label:"Latvia",value:"LVA"},{label:"Lebanon",value:"LBN"},{label:"Lesotho",value:"LSO"},{label:"Liberia",value:"LBR"},{label:"Libyan Arab Jamahiriya",value:"LBY"},{label:"Liechtenstein",value:"LIE"},{label:"Lithuania",value:"LTU"},{label:"Luxembourg",value:"LUX"},{label:"Macau",value:"MAC"},{label:"Macedonia, The Former Yugoslav",value:"MKD"},{label:"Madagascar",value:"MDG"},{label:"Malawi",value:"MWI"},{label:"Malaysia",value:"MYS"},{label:"Maldives",value:"MDV"},{label:"Mali",value:"MLI"},{label:"Malta",value:"MLT"},{label:"Marshall Islands",value:"MHL"},{label:"Martinique",value:"MTQ"},{label:"Mauritania",value:"MRT"},{label:"Mauritius",value:"MUS"},{label:"Mayotte",value:"MYT"},{label:"Mexico",value:"MEX"},{label:"Micronesia, Federated States Of",value:"FSM"},{label:"Moldova, Republic Of",value:"MDA"},{label:"Monaco",value:"MCO"},{label:"Mongolia",value:"MNG"},{label:"Montenegro",value:"MNE"},{label:"Montserrat",value:"MSR"},{label:"Morocco",value:"MAR"},{label:"Mozambique",value:"MOZ"},{label:"Myanmar",value:"MMR"},{label:"Namibia",value:"NAM"},{label:"Nauru",value:"NRU"},{label:"Nepal",value:"NPL"},{label:"Netherlands",value:"NLD"},{label:"Netherlands Antilles",value:"ANT"},{label:"New Caledonia",value:"NCL"},{label:"New Zealand",value:"NZL"},{label:"Nicaragua",value:"NIC"},{label:"Niger",value:"NER"},{label:"Nigeria",value:"NGA"},{label:"Niue",value:"NIU"},{label:"Norfolk Island",value:"NFK"},{label:"Northern Mariana Islands",value:"MNP"},{label:"Norway",value:"NOR"},{label:"Oman",value:"OMN"},{label:"Pakistan",value:"PAK"},{label:"Palau",value:"PLW"},{label:"Panama",value:"PAN"},{label:"Papua New Guinea",value:"PNG"},{label:"Paraguay",value:"PRY"},{label:"Peru",value:"PER"},{label:"Philippines",value:"PHL"},{label:"Pitcairn",value:"PCN"},{label:"Poland",value:"POL"},{label:"Portugal",value:"PRT"},{label:"Puerto Rico",value:"PRI"},{label:"Qatar",value:"QAT"},{label:"Reunion",value:"REU"},{label:"Romania",value:"ROM"},{label:"Russian Federation",value:"RUS"},{label:"Rwanda",value:"RWA"},{label:"Saint Kitts And Nevis",value:"KNA"},{label:"Saint Lucia",value:"LCA"},{label:"Saint Vincent and the Grenadines",value:"VCT"},{label:"Samoa",value:"WSM"},{label:"San Marino",value:"SMR"},{label:"Sao Tome And Principe",value:"STP"},{label:"Saudi Arabia",value:"SAU"},{label:"Scotland",value:"SCO"},{label:"Senegal",value:"SEN"},{label:"Serbia",value:"SRB"},{label:"Seychelles",value:"SYC"},{label:"Sierra Leone",value:"SLE"},{label:"Singapore",value:"SGP"},{label:"Slovakia (Slovak Republic)",value:"SVK"},{label:"Slovenia",value:"SVN"},{label:"Solomon Islands",value:"SLB"},{label:"Somalia",value:"SOM"},{label:"South Africa",value:"ZAF"},{label:"South Georgia And The South Sa",value:"SGS"},{label:"Spain",value:"ESP"},{label:"Sri Lanka",value:"LKA"},{label:"St. Helena",value:"SHN"},{label:"St. Pierre And Miquelon",value:"SPM"},{label:"Sudan",value:"SDN"},{label:"Suriname",value:"SUR"},{label:"Svalbard And Jan Mayen Islands",value:"SJM"},{label:"Swaziland",value:"SWZ"},{label:"Sweden",value:"SWE"},{label:"Switzerland",value:"CHE"},{label:"Syrian Arab Republic",value:"SYR"},{label:"Taiwan",value:"TWN"},{label:"Tajikistan",value:"TJK"},{label:"Tanzania, United Republic Of",value:"TZA"},{label:"Thailand",value:"THA"},{label:"Togo",value:"TGO"},{label:"Tokelau",value:"TKL"},{label:"Tonga",value:"TON"},{label:"Trinidad And Tobago",value:"TTO"},{label:"Tunisia",value:"TUN"},{label:"Turkey",value:"TUR"},{label:"Turkmenistan",value:"TKM"},{label:"Turks And Caicos Islands",value:"TCA"},{label:"Tuvalu",value:"TUV"},{label:"Uganda",value:"UGA"},{label:"Ukraine",value:"UKR"},{label:"United Arab Emirates",value:"ARE"},{label:"United Kingdom",value:"GBR"},{label:"United States Minor Outlying",value:"UMI"},{label:"Uruguay",value:"URY"},{label:"Uzbekistan",value:"UZB"},{label:"Vanuatu",value:"VUT"},{label:"Vatican City State (Holy See)",value:"VAT"},{label:"Venezuela",value:"VEN"},{label:"Vietnam",value:"VNM"},{label:"Virgin Islands (British)",value:"VGB"},{label:"Virgin Islands (U.S.)",value:"VIR"},{label:"Wallis And Futuna Islands",value:"WLF"},{label:"Western Sahara",value:"ESH"},{label:"Yemen",value:"YEM"},{label:"Yugoslavia",value:"YUG"},{label:"Zaire",value:"ZAR"},{label:"Zambia",value:"ZMB"},{label:"Zimbabwe",value:"ZWE"}],tb=[{label:"",value:""},{label:"Alabama",value:"AL"},{label:"Alaska",value:"AK"},{label:"American Samoa",value:"AS"},{label:"Arizona",value:"AZ"},{label:"Arkansas",value:"AR"},{label:"Armed Forced Other",value:"AE"},{label:"Armed Forces Americas",value:"AA"},{label:"Armed Forces Pacific",value:"AP"},{label:"California",value:"CA"},{label:"Colorado",value:"CO"},{label:"Connecticut",value:"CT"},{label:"Delaware",value:"DE"},{label:"District Of Columbia",value:"DC"},{label:"Federated States Of Micronesia",value:"FM"},{label:"Florida",value:"FL"},{label:"Georgia",value:"GA"},{label:"Guam",value:"GU"},{label:"Hawaii",value:"HI"},{label:"Idaho",value:"ID"},{label:"Illinois",value:"IL"},{label:"Indiana",value:"IN"},{label:"Iowa",value:"IA"},{label:"Kansas",value:"KS"},{label:"Kentucky",value:"KY"},{label:"Louisiana",value:"LA"},{label:"Maine",value:"ME"},{label:"Marshall Islands",value:"MH"},{label:"Maryland",value:"MD"},{label:"Massachusetts",value:"MA"},{label:"Michigan",value:"MI"},{label:"Minnesota",value:"MN"},{label:"Mississippi",value:"MS"},{label:"Missouri",value:"MO"},{label:"Montana",value:"MT"},{label:"Nebraska",value:"NE"},{label:"Nevada",value:"NV"},{label:"New Hampshire",value:"NH"},{label:"New Jersey",value:"NJ"},{label:"New Mexico",value:"NM"},{label:"New York",value:"NY"},{label:"North Carolina",value:"NC"},{label:"North Dakota",value:"ND"},{label:"Northern Mariana Islands",value:"MP"},{label:"Ohio",value:"OH"},{label:"Oklahoma",value:"OK"},{label:"Oregon",value:"OR"},{label:"Palau",value:"PW"},{label:"Pennsylvania",value:"PA"},{label:"Puerto Rico",value:"PR"},{label:"Rhode Island",value:"RI"},{label:"South Carolina",value:"SC"},{label:"South Dakota",value:"SD"},{label:"Tennessee",value:"TN"},{label:"Texas",value:"TX"},{label:"U.S. Minor Outlying Islands",value:"UM"},{label:"U.S. Virgin Islands",value:"VI"},{label:"Utah",value:"UT"},{label:"Vermont",value:"VT"},{label:"Virginia",value:"VA"},{label:"Washington",value:"WA"},{label:"West Virginia",value:"WV"},{label:"Wisconsin",value:"WI"},{label:"Wyoming",value:"WY"}];class sv extends K.PureComponent{static propTypes={className:a.string,account:a.shape({account_id:a.string,first_name:a.string,home_address:a.shape({address1:a.string,address2:a.string,city:a.string,country:a.string,state:a.string,zip_code:a.string}),home_phone:a.string,last_name:a.string}).isRequired,handleChange:a.func};constructor(){super(),this.getCountries=this.getCountries.bind(this)}getCountries(){const e=[];return eb.map(n=>{const i=`state-${n.value}`,r=s.jsx("option",{value:n.value,children:n.label},i);return e.push(r)}),e}render(){return s.jsx("select",{id:"country",name:"country",className:this.props.className,defaultValue:this.props.account.home_address.country||"",onChange:this.props.handleChange,children:this.getCountries()})}}class av extends K.PureComponent{static propTypes={className:a.string,account:a.shape({account_id:a.string,email:a.string,first_name:a.string,home_address:a.shape({address1:a.string,address2:a.string,city:a.string,country:a.string,state:a.string,zip_code:a.string}),home_phone:a.string,last_name:a.string}),handleChange:a.func};constructor(){super(),this.getStates=this.getStates.bind(this)}getStates(){const e=[];return tb.map(n=>{const i=`state-${n.value}`,r=s.jsx("option",{value:n.value,children:n.label},i);return e.push(r)}),e}render(){return s.jsx("select",{id:"state",name:"state",className:this.props.className,defaultValue:this.props.account.home_address.state||"",onChange:this.props.handleChange,children:this.getStates()})}}a.shape({account_id:a.string,first_name:a.string,home_address:a.shape({address1:a.string,address2:a.string,city:a.string,country:a.string,state:a.string,zip_code:a.string}),home_phone:a.string,last_name:a.string}).isRequired,a.func.isRequired,a.func.isRequired,a.func.isRequired;a.func.isRequired,a.func.isRequired,a.func.isRequired,a.shape({address1:a.string,address2:a.string,city:a.string,state:a.string,zip_code:a.string,country:a.string}),a.shape({address1:a.string,address2:a.string,city:a.string,state:a.string,zip_code:a.string,country:a.string}).isRequired,a.bool,a.bool,a.bool;a.func,a.func,a.func,a.shape({account_id:a.string,first_name:a.string,home_address:a.shape({address1:a.string,address2:a.string,city:a.string,country:a.string,state:a.string,zip_code:a.string}),home_phone:a.string,last_name:a.string}),a.shape({address1:a.string,address2:a.string,city:a.string,state:a.string,zip_code:a.string}),a.bool,a.bool,a.string,a.string,a.bool,a.bool,a.func,a.string;a.string.isRequired,a.string,a.func;a.string.isRequired,a.func;a.string,a.oneOf(["xs","sm","md","lg","xl"]);function nv(){return s.jsx("div",{className:"no-mapboxgl-notice-backdrop",children:s.jsx("div",{className:"no-mapboxgl-notice-overlay",children:s.jsxs("p",{children:["WebGL support is required to display maps on ","Recreation.gov",". Please enable WebGL or use a browser that supports it to view the maps."]})})})}a.string.isRequired,a.bool.isRequired,a.func.isRequired,a.bool,a.string,a.string,a.string,a.string,a.string;function iv(){return m.useEffect(()=>{ec({required:{e:-3,f:-7,s:-2,c:-3,ios:-2,samsung:-2,i:999,o:999,o_a:999,y:999,v:999,uc:999},insecure:!1,url:"/unsupported-browser",reminder:0,text:'
    You are using an outdated browser not supported by Recreation.gov. This may prevent you from making purchases on the site. Updating will provide you with better security, speed, and the best experience on the site. Alternatively, you may switch to an up-to-date version of another browser (e.g. Firefox, Safari, or Edge).
    '})},[]),s.jsx("div",{className:"rec-incompatible-browser-notice"})}const sb=/^[-]?[0-9]?([0-9,]+)?([.][0-9]{0,2})?$/;class rv extends K.PureComponent{static propTypes={label:a.node.isRequired,id:a.string.isRequired,name:a.string,isLabelVisible:a.bool,type:a.oneOf(["text","password","search","email","tel"]),placeholder:a.string,value:a.number,defaultValue:a.number,isDisabled:a.bool,isRequired:a.bool,isInline:a.bool,innerRef:a.oneOfType([a.func,a.object,a.node]),hasClearButton:a.bool,shouldFocusOnMount:a.bool,className:a.string,maxLength:a.string,onChange:a.func,onBlur:a.func,min:a.number,max:a.number,shouldValidateOnMount:a.bool,shouldValidateOnUpdate:a.bool,handleNewErrorState:a.func,isInvalid:a.bool,errorText:a.node,unitBefore:a.string,srUnitDescription:a.string,gaTrackingId:a.string};static defaultProps={unitBefore:"$",maxLength:"20",isDisabled:!1,isLabelVisible:!0,value:void 0,type:"text",placeholder:void 0,isRequired:!1,isInvalid:!1,isInline:!1,errorText:void 0,innerRef:void 0,hasClearButton:!1,className:void 0,defaultValue:void 0,onChange:void 0,onBlur:void 0,shouldFocusOnMount:!1,shouldValidateOnMount:!1,shouldValidateOnUpdate:!1,handleNewErrorState:void 0,srUnitDescription:"dollars"};constructor(e){super(e);const n=typeof e.errorText=="string"&&e.errorText.length>0;let i="";Ne(e.value)?Ne(e.defaultValue)||(i=yt(e.defaultValue)):i=yt(e.value),this.state={value:i,isPristine:!(e.value||e.defaultValue),isInvalid:e.isInvalid||n||!1,errorText:e.errorText||void 0},this.errorState={isInvalid:e.isInvalid,errorText:e.errorText}}componentDidMount(){const{shouldValidateOnMount:e}=this.props;e&&(clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.validate()},0))}componentDidUpdate(e){const{shouldValidateOnUpdate:n,isInvalid:i,errorText:r,value:o}=this.props;if(n)this.validate();else if(i!==e.isInvalid||r!==e.errorText){const l=typeof r=="string"&&r.length>0;this.setState({isInvalid:i||l,errorText:r})}!Ne(o)&&this.isControlled()&&o!==parseFloat(this.state.value.replace(/,/g,""))&&(this.setState({value:yt(o)}),this.state.isInvalid&&this.validate())}componentWillUnmount(){clearTimeout(this.timeout)}getValue=()=>{if(this.isControlled())return this.props.value;const e=parseFloat(this.state.value.replace(/,/g,""),10);return ii(e)?null:e};clearError=()=>{this.setState({isInvalid:!1,errorText:void 0})};handleNewErrorState=({isInvalid:e,errorText:n})=>{const{handleNewErrorState:i,id:r,name:o}=this.props;i&&(e!==this.errorState.isInvalid||n!==this.errorState.errorText)&&(i({id:r,name:o,isInvalid:e,errorText:n}),this.errorState={isInvalid:e,errorText:n})};handleClearButtonClick=e=>{e.preventDefault();const{onChange:n}=this.props;this.setState({value:"",isPristine:!0,isInvalid:!1,errorText:void 0}),n&&n(null),this.handleNewErrorState({isValid:!1,errorText:void 0})};handleChange=e=>{e.preventDefault();const n=e.target.value;if(sb.test(n)){const r=n===""||n==="-"?null:parseFloat(n.replace(/,/g,""),10),{onChange:o}=this.props;this.setState({value:n,isPristine:!1}),o&&o(r)}else n===""?this.setState({value:""}):oe("Error: Enter only numbers with a maximum of 2 decimal places.")};handleBlur=e=>{const{isRequired:n,onBlur:i,onChange:r,min:o,max:l}=this.props,{isPristine:c,isInvalid:d,errorText:u}=this.state,f=this.isControlled(),g=f?this.props.value:parseFloat(this.state.value.replace(/,/g,""),10),h=yt(g);if(this.setState({value:h}),f&&r){const p=h===""?null:parseFloat(h.replace(/,/g,""),10);r(p)}if((n||!Ne(l)||!Ne(o))&&!c){const p=this.validate();i&&i(e,{value:h,...p}),p.isInvalid&&p.errorText&&oe(p.errorText,"assertive")}else i&&i(e,{value:h,isInvalid:d,errorText:u})};validate=()=>{const{isRequired:e,id:n,min:i,max:r}=this.props,o=this.isControlled()?this.props.value:parseFloat(this.state.value.replace(/,/g,""),10),l={isInvalid:!1,errorText:null,id:n};if(Ne(o))if(e){const c=typeof this.props.label=="string"?`${this.props.label} is required.`:"This field is required";l.isInvalid=!0,l.errorText=c}else this.clearError();return!Ne(o)&&(!Ne(i)||!Ne(r))&&(!Ne(r)&&o>r?(l.isInvalid=!0,l.errorText=`${this.props.label} must be $${yt(r)} or less.`):!Ne(i)&&o{const{value:n,validator:i,isRequired:r,id:o,name:l,label:c}=this.props,d=document.getElementsByName(l);let u=n;const f=[];for(let h=0;h{if(!m.isValidElement(b))return b;const x={name:i,isRequired:r,isDisabled:o||b.props.isDisabled,onChange:l,checked:l?n===b.props.value:void 0};return m.cloneElement(b,x)})})})}}function nb({id:t,name:e,value:n,className:i,isInvalid:r,isDisabled:o,isRequired:l,isChecked:c,children:d,onChange:u,innerRef:f,gaTrackingId:g,...h}){const p=nt(t),b=x=>{u&&!x.target.hasAttribute("aria-disabled")&&u(x)};return s.jsxs("label",{"data-component":"RadioPill",className:N(i,{invalid:r,disabled:o}),htmlFor:p,ref:f,children:[s.jsx("input",{type:"radio",id:p,name:e,required:l,disabled:o,"aria-disabled":o,value:n,checked:c,className:"rec-sr-only",onChange:b,"data-ga-tracking-id":g,...h}),s.jsx("span",{"data-radio-pill-contents":!0,children:d})]})}nb.propTypes={id:a.string,children:a.node,value:a.string,className:a.string,isInvalid:a.bool,isDisabled:a.bool,isRequired:a.bool,isChecked:a.bool,onChange:a.func,onBlur:a.func,innerRef:a.any,name:a.string,gaTrackingId:a.string};a.string,a.bool,a.string,a.arrayOf(a.shape({value:a.string,label:a.node,isDisabled:a.bool,tooltip:a.node,ariaLabel:a.string})),a.string,a.func,a.func,a.string,a.bool,a.bool,a.node,a.bool,a.bool,a.string;function ib({id:t,ariaLabel:e,options:n=[],value:i,onChange:r,className:o,isInvalid:l,isDisabled:c,isRequired:d,onBlur:u,clickTagCategory:f,clickTagLabel:g,gaTrackingId:h,...p}){let b=m.useId();const x=m.useRef(!1);t&&(b=t),m.useEffect(()=>{if(x.current){const v=n.find(w=>w.value===i);v&&f&&g&&Ge({category:f,action:v.label,label:g},()=>{}),x.current=!1}},[i,n,f,g]);const y=v=>{r(v),x.current=!0};return s.jsxs("div",{"data-component":"RadioToggle",className:N(o,{invalid:l,disabled:c}),...p,children:[e&&s.jsx("div",{className:"rec-sr-only",id:`${b}-ariaLabel`,children:e}),s.jsx("div",{"data-input-wrapper":!0,children:n.map((v,w)=>s.jsxs(m.Fragment,{children:[s.jsx("input",{type:"radio",id:`${b}-${w}`,name:`${b}-group-name`,required:d,disabled:c,value:v.value,checked:i?i===v.value:void 0,"aria-describedby":e?`${b}-ariaLabel`:void 0,onChange:y,onBlur:u,className:"rec-sr-only","data-ga-tracking-id":h}),s.jsx("label",{htmlFor:`${b}-${w}`,children:v.label})]},v.value))})]})}ib.propTypes={ariaLabel:a.string,id:a.string,options:a.arrayOf(a.shape({value:a.string,label:a.string})).isRequired,value:a.string.isRequired,onChange:a.func.isRequired,isInvalid:a.bool,isDisabled:a.bool,isRequired:a.bool,onBlur:a.func,className:a.string,clickTagCategory:a.string,clickTagLabel:a.string,gaTrackingId:a.string};a.node.isRequired;a.string,a.number,a.oneOf(["display","h1","h2","h3","h4","h5","h5Caps","h6"]),a.node,a.array,a.oneOfType([a.number,a.oneOf(["none"])]),a.oneOf(["ol","ul","none"]),a.number,a.string,a.string;const ei="sarsa-help-tip";m.forwardRef((t,e)=>{const{tipForDescriptor:n,content:i,maxWidth:r,appearance:o="help",customIcon:l,triggerRef:c}=t,[d,u]=m.useState(!1),f=m.useRef(null),g=c||f;m.useEffect(()=>{const y=v=>{v.key==="Escape"&&u(!1)};return window.addEventListener("keydown",y),()=>{window.removeEventListener("keydown",y)}});const h=()=>{u(!1)},p=()=>{u(!0)};m.useImperativeHandle(e,()=>({showHelpTip:p,hideHelpTip:h,toggleHelpTip:()=>{u(y=>!y)}}));const b=()=>{d?(h(),oe(`Help tip for ${n}`)):(p(),oe(i))};let x;return l!==void 0?x=l:x=o==="info"?s.jsx(j,{iconName:"info"}):s.jsx(j,{iconName:"help"}),s.jsxs(s.Fragment,{children:[s.jsx(k,{innerRef:g,size:"sm",appearance:"subtle",className:"sarsa-help-tip",iconBeforeElement:x,"aria-expanded":d,"aria-label":"Help Tip","aria-describedby":d?ei:void 0,onMouseEnter:p,onMouseLeave:h,onFocus:p,onBlur:h,onClick:b}),s.jsx(Xr,{id:ei,content:i,maxWidth:r,isVisible:d,triggerRef:g})]})});function rb(t,e){const n={...t};return e.forEach(i=>{delete n[i]}),n}class lv extends m.PureComponent{constructor(e){super(e),this.clearError=()=>{this.setState({isInvalid:!1,errorText:void 0})},this.handleNewErrorState=({isInvalid:i,errorText:r})=>{const{handleNewErrorState:o,id:l,name:c}=this.props;o&&(i!==this.errorState.isInvalid||r!==this.errorState.errorText)&&(o({id:l,name:c,isInvalid:i,errorText:r}),this.errorState={isInvalid:i,errorText:r})},this.handleChange=i=>{i.persist();const r=i.target.value,{onChange:o}=this.props,{isPristine:l}=this.state;this.isControlled()?r&&l&&this.setState({isPristine:!1}):this.setState({value:r},()=>{r&&l&&this.setState({isPristine:!1})}),o&&o(i)},this.handleBlur=i=>{const{isRequired:r,onBlur:o}=this.props,{isPristine:l}=this.state;if(r&&!l){const c=this.validate();o&&o(i),c.isInvalid&&c.errorText&&oe(c.errorText,"assertive")}else o&&o(i)},this.validate=()=>{const{isRequired:i,id:r,validator:o,label:l}=this.props,c=this.isControlled()?this.props.value:this.state.value,d={isInvalid:!1,errorText:null,id:r};if(!c)if(i){const u=typeof l=="string"?`${l} is required.`:"This field is required";d.isInvalid=!0,d.errorText=u}else this.clearError();if(c&&o){const u=o(c);u.isValid?(d.isInvalid=!1,d.errorText=null):(d.isInvalid=!0,d.errorText=u.errorText||null)}return this.setState(d),this.handleNewErrorState(d),d},this.isControlled=()=>{const{value:i,onChange:r}=this.props;return typeof i=="string"&&typeof r=="function"};const n=typeof e.errorText=="string"&&e.errorText.length>0;this.state={value:e.value||e.defaultValue,isPristine:!(e.value||e.defaultValue),isInvalid:e.isInvalid||n||!1,errorText:e.errorText||void 0},this.errorState={isInvalid:e.isInvalid,errorText:e.errorText},this.inputWrapperRef=m.createRef()}static{this.propTypes={id:a.string.isRequired,name:a.string,label:a.node.isRequired,isLabelVisible:a.bool,placeholder:a.string,value:a.string,defaultValue:a.string,onChange:a.func,onBlur:a.func,validator:a.func,isDisabled:a.bool,isRequired:a.bool,isInvalid:a.bool,errorText:a.node,innerRef:a.oneOfType([a.func,a.object,a.node]),shouldFocusOnMount:a.bool,shouldValidateOnUpdate:a.bool,className:a.string,handleNewErrorState:a.func,gaTrackingId:a.string}}static{this.defaultProps={isDisabled:!1,isLabelVisible:!0,isRequired:!1,isInvalid:!1,shouldValidateOnUpdate:!1}}componentDidMount(){const{shouldFocusOnMount:e}=this.props;this.timeout=setTimeout(()=>{if(e&&this.inputWrapperRef.current){const n=this.inputWrapperRef.current.querySelector("textarea");n&&n.focus()}},0)}componentDidUpdate(e){const{shouldValidateOnUpdate:n,isInvalid:i,errorText:r}=this.props;if(n)this.validate();else if(i!==e.isInvalid||r!==e.errorText){const o=typeof r=="string"&&r.length>0;this.setState({isInvalid:i||o,errorText:r})}}componentWillUnmount(){clearTimeout(this.timeout)}render(){const{id:e,label:n,isDisabled:i,value:r,isLabelVisible:o,placeholder:l,isRequired:c,innerRef:d,className:u,gaTrackingId:f,...g}=this.props,h=rb(g,["isInvalid","errorText","onBlur","onChange","validator","shouldFocusOnMount","shouldValidateOnUpdate","handleNewErrorState"]),{isInvalid:p,errorText:b}=this.state;return s.jsxs("div",{"data-component":"TextArea",className:N("sarsa-field-outer-container",u),children:[s.jsx(it,{htmlFor:e,isVisible:o,isRequired:c,children:n}),s.jsxs("div",{className:"sarsa-field-inner-container",ref:this.inputWrapperRef,children:[s.jsx("div",{className:"sarsa-field-input-wrapper",children:s.jsx("textarea",{className:N("sarsa-text-field-input",{"is-invalid":p}),onChange:this.handleChange,onBlur:this.handleBlur,id:e,ref:d,disabled:i,value:r,placeholder:l,required:c,"aria-invalid":p,"aria-describedby":b?`${e}-error`:void 0,"data-ga-tracking-id":f,...h})}),b&&s.jsxs("div",{id:`${e}-error`,className:"sarsa-field-error-message",children:[s.jsx("span",{className:"req","aria-hidden":"true",children:"*"}),b]})]})]})}}function ob({id:t="page-content",children:e,...n}){return s.jsx("div",{"data-component":"SkipNavContent",...n,id:t,children:e})}ob.propTypes={id:a.string,children:a.node.isRequired};const lb={ROLE_PMO:"PMO",ROLE_ATR:"APM",ROLE_FACILITY_MANAGER:"Facility Management",ROLE_FACILITY_OPERATOR:"Facility Operations",ROLE_ATTENDANT:"Attendant",ROLE_HOST:"Host",ROLE_COOPERATOR:"Cooperator",ROLE_USGS:"USGS",ROLE_FINANCE_ADMIN:"Finance Admin",ROLE_FINANCE_USER:"Finance User",ROLE_CSR:"Customer Service Representative",ROLE_SUPER_USER:"Super User",ROLE_BAH_FINANCE:"Booz Allen Finance",ROLE_PASS_OPERATOR:"Pass Operations"};function cb(t){return qe(lb,t,"")}function db(t,e){let n="";return t.roles.forEach(i=>{(i.location.location_id===e||i.location.location_id==="1")&&(n=i.role_type)}),n}class ub extends K.Component{static propTypes={rowData:a.object.isRequired,isInternal:a.bool.isRequired,location:a.string};constructor(e){super(e),this.state={iaLoading:qe(e.rowData,"internal_account_id","")!=="",internalAccount:""}}componentDidMount(){if(this.props.isInternal&&this.state.iaLoading){const e=`/api/internal/account/user/${this.props.rowData.internal_account_id}`,n=ji();le.get(e,{headers:{Authorization:n}}).then(i=>{const r=i.data.user;let o=db(r,this.props.location);o!==""&&(o=`(${cb(o)})`),this.setState({iaLoading:!1,internalAccount:`${r.first_name} ${r.last_name} ${o}`})}).catch(()=>{this.setState({iaLoading:!1,internalAccount:"Unable to retrieve IA"})})}else this.setState({iaLoading:!1,internalAccount:"N/A"})}render(){const e=new Zt("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"numeric",timeZoneName:"short"}),i=xi(this.props.rowData.action_time).toDate(),r=e.format(i);return s.jsxs("tr",{children:[s.jsx("td",{children:r}),s.jsx("td",{children:this.props.rowData.order_id}),s.jsx("td",{children:this.props.rowData.reservation_number}),s.jsxs("td",{children:[s.jsx(ke,{isSpinning:this.state.iaLoading,size:"xs"}),this.state.internalAccount]}),s.jsx("td",{children:this.props.rowData.action})]})}}class cv extends K.Component{static propTypes={reservationID:a.string.isRequired,isInternal:a.bool.isRequired};constructor(e){super(e),this.state={history:[],isLoading:!0,error:!1,location:""}}componentDidMount(){let e=`/api/orders/reservations/${this.props.reservationID}`,n=_e();this.props.isInternal&&(e=`/api/orders/internal/reservations/${this.props.reservationID}`,n=ji()),le.get(e,{headers:{Authorization:n}}).then(i=>{this.setState({history:i.data.reservation_history,location:i.data.location_id,isLoading:!1})}).catch(()=>{this.setState({error:!0,isLoading:!1})})}getRows=()=>this.state.history.map((i,r)=>s.jsx(ub,{rowData:i,location:this.state.location,isInternal:this.props.isInternal},r));render(){return this.state.isLoading?s.jsx(ke,{isSpinning:this.state.isLoading,size:"lg"}):this.state.error?s.jsxs(ya,{noticeType:"error",children:[s.jsx("div",{className:"rec-notification-title",children:"System Error"}),s.jsx("p",{children:"There was an error pulling the history for this reservation."})]}):!this.state.history||this.state.history.length===0?s.jsxs(ya,{noticeType:"info",children:[s.jsx("div",{className:"rec-notification-title",children:"Info"}),s.jsx("p",{children:"No history exists for this reservation."})]}):s.jsxs("div",{children:[s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Action Time"}),s.jsx("th",{children:"Order ID"}),s.jsx("th",{children:"Reservation Number"}),s.jsx("th",{children:"Internal Account"}),s.jsx("th",{children:"Action Performed"})]})}),s.jsx("tbody",{children:this.getRows()})]}),s.jsx("small",{children:"Reservation History is available for actions as of October 2019"})]})}}a.node.isRequired;a.node.isRequired,a.string;const hb=70,pb=48;class dv extends K.PureComponent{static propTypes={children:a.node.isRequired,scrollingContainerId:a.string.isRequired,navElement:a.node,extraClassName:a.string,shouldCompensateForScrollbars:a.bool,paddingRight:a.number,overrideTop:a.number};static defaultProps={navElement:void 0,extraClassName:void 0,shouldCompensateForScrollbars:!1,paddingRight:24};constructor(e){super(e),this.state={isStuck:!1,scrollPosition:0,bottom:0},this.header=void 0,this.container=void 0,this.stickyTableWrap=void 0,this.horizontalScroller=void 0,this.throttledSetSticky=st(this.setSticky,250),this.isDesktop=window.screen.width>767,this.timeout=null}componentDidMount(){this.stickyTableWrap=document.getElementById("sticky-table-wrap"),this.horizontalScroller=document.getElementById("sticky-table-horizontal-scroller"),this.container=document.getElementById(this.props.scrollingContainerId),this.header=document.querySelector("header.nav-header-container"),this.scrollbarWidth=0,window.addEventListener("resize",this.throttledSetSticky),document.addEventListener("scroll",this.setSticky),this.container&&this.isDesktop&&(this.scrollbarWidth=this.container.offsetWidth-this.container.clientWidth,this.container.addEventListener("scroll",this.setSticky)),this.horizontalScroller&&this.horizontalScroller.addEventListener("scroll",this.handleWrapperScroll),this.setSticky()}componentDidUpdate(){this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.setSticky()},300)}componentWillUnmount(){clearTimeout(this.timeout),document.removeEventListener("scroll",this.setSticky),window.removeEventListener("resize",this.throttledSetSticky),this.container&&this.isDesktop&&this.container.removeEventListener("scroll",this.setSticky),this.horizontalScroller&&this.horizontalScroller.removeEventListener("scroll",this.handleWrapperScroll)}setSticky=()=>{if(this.stickyTableWrap)if(this.isDesktop=window.screen.width>767,this.isDesktop){const e=this.header?this.header.getBoundingClientRect().bottom:0;let n=0;const i=document.querySelector(".nav-header-alerts");i&&(n=i.getBoundingClientRect().bottom);const r=this.stickyTableWrap.getBoundingClientRect(),o=n>e?n:e,l=r.topo;this.setState({isStuck:l,bottom:o})}else{const e=this.header?hb:0,n=this.stickyTableWrap.getBoundingClientRect(),i=n.top+pbe;this.setState({isStuck:i,bottom:e})}};handleWrapperScroll=()=>{const e=this.horizontalScroller.scrollLeft;this.setState({scrollPosition:e})};render(){const{navElement:e,children:n,extraClassName:i,shouldCompensateForScrollbars:r,paddingRight:o,overrideTop:l}=this.props,{scrollPosition:c,isStuck:d,bottom:u}=this.state,f={top:l||u};return r&&(f.paddingRight=`${o+this.scrollbarWidth}px`),s.jsxs("div",{className:N("sticky-table-header-helper",{sticky:d,[i]:i}),style:f,children:[e&&s.jsx("div",{className:"sticky-table-header-nav-wrapper",children:e}),s.jsx("div",{className:"sticky-table-header-helper-wrapper",children:s.jsx("div",{style:{transform:`translate3d(-${c}px, 0, 0)`},children:n})})]})}}function mb(t,e){return class extends m.Component{constructor(){super(...arguments),this.state={error:void 0}}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,i){}render(){return t(this.props,this.state.error)}}}function fb({isErrorForced:t,children:e}){return e}function fo({fallbackElement:t,isErrorForced:e=!1,hasDefaultWrapperClass:n=!0,children:i},r){return r?t?s.jsx("div",{className:n?"rec-has-error-wrap":"",children:t}):null:s.jsx(fb,{isErrorForced:e,children:i})}fo.propTypes={children:a.node.isRequired,fallbackElement:a.node,isErrorForced:a.bool,hasDefaultWrapperClass:a.bool};const gb=mb(fo);a.string,a.string,a.string,a.string.isRequired,a.string.isRequired,a.number,a.bool,a.string,a.string,a.number,a.string,a.number,a.string,a.number,a.bool,a.bool,a.oneOf(["available","partially available","not reservable","lottery","CAMPING_LOTTERY","unavailable","new","enter dates","enter date","view availability"]),a.number,a.number,a.number,a.string,a.bool,a.array,a.array,a.bool,a.node,a.bool,a.string,a.object,a.string,a.string,a.string,a.string,a.func,a.func;a.string.isRequired,a.string,a.string,a.string.isRequired,a.number,a.number,a.string,a.array,a.string,a.number,a.string,a.oneOf(["headingBottom","headingCenter","headingTop"]),a.string,a.func,a.bool,a.bool,a.string,a.node,a.string,a.string,a.string,a.string;function go(t){const{children:e,slides:n=[],slideTargetWidth:i,slidesPerPage:r=1,hasGutters:o=!1,className:l,hasNegativeMargins:c=!1,hasPaddingBelow:d=!1,...u}=t,[f,g]=m.useState(0),[h,p]=m.useState(0),[b,x]=m.useState(1),[y,v]=m.useState(0),[w,C]=m.useState(0),T=Array.isArray(e)?e:n,I=T&&T.length?T.length:1,R=m.useRef(null),S=lr();m.useLayoutEffect(()=>{let W=r;const Y=b*f-f+1,B=R.current?.offsetWidth;if(!B)return;if(i){const Q=Math.floor(B/i),G=B%i,E=i*(Q+1)-B;W=G{if(T.length){const W=T[b-1],Y=W?.props?.alt;r===1&&W?.type==="img"&&Y?oe(`${Y}. Page ${b} of ${h}`,"polite","current-page"):oe(`Page ${b} of ${h}`,"polite","current-page")}},[b,h,T,r]);function _(){x(W=>W>1?W-1:1)}function M(){h&&x(W=>W1&&s.jsx("div",{className:"sarsa-carousel-button-position",children:s.jsx(k,{appearance:"icon-circular",size:"md",iconBeforeElement:s.jsx(j,{iconName:"chevron-left"}),"aria-label":"Previous page",onClick:_,isDisabled:b===1})}),s.jsx("div",{className:"sarsa-carousel-mask",ref:R,...O,children:s.jsx("ul",{className:N("sarsa-carousel-list",{"has-gutters":o}),style:P,children:T.map((W,Y)=>{const B={...W.props.style},H={opacity:S?0:1,...B},V=Y$;return s.jsx("li",{"data-component":"CarouselItem","aria-setsize":I,"aria-posinset":(Y+1)*b,style:{...D,...ne},className:N("sarsa-carousel-item",{"has-gutters":o}),children:m.cloneElement(W,{"aria-hidden":V,tabIndex:V?-1:null,style:V?H:B})},Y)})})}),h>1&&s.jsx("div",{className:"sarsa-carousel-button-position right",children:s.jsx(k,{appearance:"icon-circular",size:"md",iconBeforeElement:s.jsx(j,{iconName:"chevron-right"}),"aria-label":"Next page",onClick:M,isDisabled:b===h})})]})}go.propTypes={children:a.array,slides:a.array,slideTargetWidth:a.number,slidesPerPage:a.number,hasGutters:a.bool,hasNegativeMargins:a.bool,hasPaddingBelow:a.bool,className:a.string};function bo({children:t,slides:e=[],slideTargetWidth:n,slidesPerPage:i=1,hasGutters:r=!1,className:o,hasPaddingBelow:l=!1,...c}){const[d,u]=m.useState(88),f=m.useRef(null),g=lr({timeout:100}),h=Array.isArray(t)?t:e;return m.useLayoutEffect(()=>{let p=i;const b=f?.current?.offsetWidth;if(n){const x=Math.floor(b/n),y=b%n,v=n*(x+1)-b;p=ys.jsx("li",{className:N("sarsa-mobile-carousel-li",{"padding-below":l}),style:{flex:`0 0 ${d}%`},children:s.jsx("div",{className:N("sarsa-mobile-carousel-li-inner",{"has-gutters":r}),children:s.jsx("div",{className:"li-item-wrap",children:p})})},b)),s.jsx("div",{"aria-hidden":"true",className:N("sarsa-mobile-carousel-spacer",{"has-gutters":r})})]})})}bo.propTypes={children:a.array,slides:a.array,slideTargetWidth:a.number,slidesPerPage:a.number,hasGutters:a.bool,hasPaddingBelow:a.bool,className:a.string};function uv({hasNegativeMargins:t,...e}){const{width:n}=du(100);return n&&n>768?s.jsx(go,{hasNegativeMargins:t,...e}):s.jsx(bo,{...e})}a.node.isRequired,a.bool,a.string;a.oneOfType([a.number]),a.number,a.oneOf(["default","important"]),a.oneOf(["sm","md","lg"]),a.bool,a.bool,a.string;a.string,a.string,a.string,a.string,a.string,a.bool,a.bool,a.bool,a.bool,a.string,a.string,a.string;a.string,a.string,a.string,a.string,a.string,a.bool,a.bool,a.bool,a.bool,a.bool,a.string,a.string,a.string;a.string,a.string,a.oneOf(["sm","md","lg"]),a.string,a.oneOf([1,2,3,4,5,6]),a.oneOf(["display","title","h1","h2","h3","h4","h5","h5Caps","h6","small"]),a.string,a.oneOf(["auto","variable",1,2,3,4,5,6,7,8,9,10,11,12]),a.bool,a.bool,a.bool,a.bool,a.string,a.string,a.oneOf(["","imageExtendsTopBottom","imageSetBottom"]),a.string,a.bool,a.arrayOf(a.shape({viewportMaxWidth:a.number,path:a.string})),a.string,a.string,a.node,a.string;a.string,a.string,a.string,a.string,a.string,a.bool;a.string,a.string,a.string,a.string,a.string,a.bool,a.string;a.string,a.string,a.string,a.string,a.string,a.bool,a.string;a.array.isRequired,a.bool,a.bool,a.bool,a.number,a.string,a.string;a.oneOf(["light","dark"]),a.oneOf(["large","medium","small","extra-small"]),a.string.isRequired,a.bool,a.bool,a.bool,a.bool,a.bool,a.bool,a.oneOf(["top","bottom"]),a.string,a.string,a.string,a.string,a.string,a.string,a.bool,a.func,a.bool,a.string,a.string,a.string,a.bool,a.bool,a.bool;a.node,a.string;a.node,a.string;a.node,a.string;a.node,a.string;a.node,a.string;class hv{constructor(e){this._onClickMapView=this._onClickMapView.bind(this),this._onClickSatelliteView=this._onClickSatelliteView.bind(this),this._onClickMapLayer=this._onClickMapLayer.bind(this),this._onClickMapLayerItem=this._onClickMapLayerItem.bind(this),this._mapLayers=e}onAdd(e){if(this._map=e,this._container=document.createElement("div"),this._mainContainer=document.createElement("div"),this._mainContainer.className="mapboxgl-ctrl mapboxgl-ctrl-text-group",this._mapViewButton=document.createElement("button"),this._mapViewButton.setAttribute("aria-label","Toggle Map View"),this._mapViewButton.setAttribute("data-ga-tracking-id","779621461344"),this._mapViewButton.type="button",this._mapViewButton.innerText="Map",this._mapViewButton.addEventListener("click",this._onClickMapView),this._mainContainer.appendChild(this._mapViewButton),this._sateliteViewButton=document.createElement("button"),this._sateliteViewButton.setAttribute("aria-label","Toggle Satellite View"),this._sateliteViewButton.setAttribute("data-ga-tracking-id","779621461344"),this._sateliteViewButton.type="button",this._sateliteViewButton.innerText="Satellite",this._sateliteViewButton.addEventListener("click",this._onClickSatelliteView),this._mainContainer.appendChild(this._sateliteViewButton),this._mapLayers&&this._mapLayers.length>0&&(this._mapLayerButton=document.createElement("button"),this._mapLayerButton.setAttribute("aria-label","Show Layer View Options"),this._mapLayerButton.setAttribute("data-ga-tracking-id","779621461344"),this._mapLayerButton.type="button",this._mapLayerButton.innerText="Layers",this._mapLayerButton.addEventListener("click",this._onClickMapLayer),this._mainContainer.appendChild(this._mapLayerButton)),this._container.appendChild(this._mainContainer),this._mapLayers&&this._mapLayers.length>0){this._supportContainer=document.createElement("div"),this._supportContainer.className="mapboxgl-ctrl mapboxgl-ctrl-text-group mapboxgl-ctrl-sub-group not-shown";for(let n=0;n{this._onClickMapLayerItem(this._mapLayers[n].layers,i.checked)});const r=document.createElement("label");r.htmlFor=`layer_checkbox_${n}`,r.innerText=this._mapLayers[n].name,this._supportContainer.appendChild(i),this._supportContainer.appendChild(r)}this._container.appendChild(this._supportContainer)}return this._container}_onClickMapView(){oe("Map button selected. Showing map view on the map widget"),this._map.setLayoutProperty("fixed-satellite","visibility","none")}_onClickSatelliteView(){oe("Satellite button selected. Showing satellite view on the map widget"),this._map.setLayoutProperty("fixed-satellite","visibility","visible")}_onClickMapLayer(){oe("Layers button selected. Showing layers list"),this._supportContainer.classList.toggle("not-shown")}_onClickMapLayerItem(e,n){let i="visible";n?i="visible":i="none",e.forEach(r=>{this._map.setLayoutProperty(r,"visibility",i)})}onRemove(){this._container.parentNode.removeChild(this._container),this._map=void 0}}class Mt{constructor(e){this.props=e,this.isControlHidden=!1,this.show=this.show.bind(this),this.hide=this.hide.bind(this)}onAdd(e){this._map=e,this._container=document.createElement("div")}onRemove(){this._container.parentNode.removeChild(this._container),this._map=void 0}show(){this._container.style.display="block",this.isControlHidden=!1}hide(){this._container.style.display="none",this.isControlHidden=!0}}class pv extends Mt{constructor(e={}){super(e),this.isExpanded=!1,this._options=e,this._onClickFullscreenView=this._onClickFullscreenView.bind(this),this._onExpandedScreen=this._onExpandedScreen.bind(this),this._onShrinkedScreen=this._onShrinkedScreen.bind(this),this._updateOptions=this._updateOptions.bind(this),this._isExpanded=this._isExpanded.bind(this)}onAdd(e){super.onAdd(e),this._container.className="mapboxgl-ctrl mapboxgl-ctrl-group",this._MapFullscreenButton=document.createElement("button"),this._MapFullscreenButton.className="mapboxgl-ctrl-fullscreen",this._MapFullscreenButton.type="button",this._MapFullscreenButton.addEventListener("click",this._onClickFullscreenView),this._MapFullscreenSpan=document.createElement("span"),this._MapFullscreenSpan.className="mapboxgl-ctrl-icon",this._MapFullscreenSpan.type="span",this._MapFullscreenSpan.setAttribute("role","button"),this._MapFullscreenSpan.setAttribute("aria-label","Toggle fullscreen"),this._MapFullscreenButton.appendChild(this._MapFullscreenSpan),this._container.appendChild(this._MapFullscreenButton);const n=this._map.getContainer(),i=n.parentElement,r=n?.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),o=r.length;if(o){const l=r[0],c=r[o-1],d=u=>{this.isExpanded&&u.key==="Tab"&&(u.shiftKey&&document.activeElement===l?(u.preventDefault(),c.focus()):!u.shiftKey&&document.activeElement===c&&(u.preventDefault(),l.focus()))};i.addEventListener("keydown",d),i.addEventListener("click",()=>{l.focus()})}return this._container}_onClickFullscreenView(){this._MapFullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._MapFullscreenButton.classList.toggle("mapboxgl-ctrl-shrink");const e=this._map.getContainer(),n=e.parentElement,i=document.getElementById("recApp");this.isExpanded?(e.classList.remove("map-modal"),n.classList.remove("map-modal-background"),oe("Full screen toggle selected. You have closed full screen map view.")):(e.classList.add("map-modal"),n.classList.add("map-modal-background"),oe("Full screen toggle selected. You are in a full screen map view.")),i&&this._options.useModalStyling&&(this.isExpanded?(i.style.height="",i.style.minHeight="",i.style.maxHeight="",i.style.overflow="",i.classList.remove("mapbox-map-open")):(i.style.height="100vh",i.style.minHeight="100vh",i.style.maxHeight="100vh",i.style.overflow="hidden",i.classList.add("mapbox-map-open"))),this.isExpanded=!this.isExpanded,this.isExpanded?this._onExpandedScreen():this._onShrinkedScreen(),this._map.resize()}_isExpanded(){return this.isExpanded}_onExpandedScreen(){this._options.onExpandedScreen&&this._options.onExpandedScreen()}_onShrinkedScreen(){this._options.onShrinkedScreen&&this._options.onShrinkedScreen()}_updateOptions(e={}){this._options=Object.assign(this._options,e)}}class mv{constructor(e=!1,n){this.is3D=e,this._onClick3DView=this._onClick3DView.bind(this),this._exageration=n}onAdd(e){return this._map=e,this._container=document.createElement("div"),this._container.className="mapboxgl-ctrl mapboxgl-ctrl-group",this._3DViewButton=document.createElement("button"),this._3DViewButton.className="mapboxgl-ctrl-pitchtoggle-3d mapboxgl-ctrl-icon",this._3DViewButton.setAttribute("id","map-elevation-button"),this._3DViewButton.setAttribute("arial-label","Toggle Pitch"),this._3DViewButton.type="button",this._3DViewButton.innerHTML="3D",this._3DViewButton.addEventListener("click",this._onClick3DView),this._container.appendChild(this._3DViewButton),this._container}_onClick3DView(){this.is3D?(oe("2D button selected. Showing 2D map."),this._3DViewButton.innerHTML="3D",this._map.setPitch(0),this._map.setBearing(0),this._map.setTerrain()):(oe("3D button selected. Showing 3D map"),this._3DViewButton.innerHTML="2D",this._map.setPitch(50),this._map.setTerrain({source:"mapbox-dem",exaggeration:this._exageration||["interpolate",["exponential",.2],["zoom"],0,.3,7,.8]})),this.is3D=!this.is3D}onRemove(){this._container.parentNode.removeChild(this._container),this._map=void 0}}class fv{onAdd(e){return this._map=e,this._container=document.createElement("div"),this._container.className="mapboxgl-ctrl mapboxgl-ctrl-attrib mapboxgl-ctrl-attrib-inner",this._container.innerHTML=` © Mapbox © OpenStreetMap Improve this map `,this._container}onRemove(){this._container.parentNode.removeChild(this._container),this._map=void 0}}a.node.isRequired,a.object.isRequired,a.object.isRequired;class gv extends Mt{constructor(e={}){super(e),this._onClickCustom=e.onClick,this._buttonText=e.buttonText||"Search",this._onClick=this._onClick.bind(this)}onAdd(e){return super.onAdd(e),this._container.className="mapboxgl-ctrl mapboxgl-ctrl-center-button-group",this._searchNearbyButton=document.createElement("button"),this._searchNearbyButton.className="map-search-nearby-button",this._searchNearbyButton.id="map-search-nearby-button",this._searchNearbyButton.name="map-search-nearby-button",this._searchNearbyButton.setAttribute("aria-label",this._buttonText),this._searchNearbyButton.type="button",this._searchNearbyButton.innerText=this._buttonText,this._searchNearbyButton.addEventListener("click",this._onClick),this._container.appendChild(this._searchNearbyButton),this._container}_onClick(){this._onClickCustom&&this._onClickCustom()}}class bv extends Mt{constructor(e){super(e),this.addElement=this.addElement.bind(this),this.updateElementById=this.updateElementById.bind(this),this.removeElementById=this.removeElementById.bind(this),this.getElementById=this.getElementById.bind(this),this.updateElementProps=this.updateElementProps.bind(this)}onAdd(e){return super.onAdd(e),this._container.className="mapboxgl-ctrl mapboxgl-ctrl-center-container-group",this._container}createElement(e,n){const i=document.createElement("div");return i.className="new-control-sub-container",n&&i.setAttribute("id",n),Is.createRoot(i).render(e),i}addElement(e,n){this._container&&this._container.appendChild(this.createElement(e,n))}updateElementById(e,n){const i=document.getElementById(n),r=this.createElement(e,n);i&&this._container.replaceChild(r,i)}removeElementById(e){const n=document.getElementById(e);n&&this._container.removeChild(n)}getElementById(e){return document.getElementById(e)}updateElementProps({element:e,key:n,value:i}){e[n]=i}}class vv extends Mt{constructor({features:e,bounds:n,params:i}){super({features:e,bounds:n}),this.features=e,this.bounds=n,this.params=i,this._onClick=this._onClick.bind(this),this._updateProps=this._updateProps.bind(this)}onAdd(e){return super.onAdd(e),this._container.className="mapboxgl-ctrl mapboxgl-ctrl-group",this._btn=document.createElement("button"),this._btn.className="mapboxgl-ctrl-reset-position mapboxgl-ctrl-icon",this._btn.setAttribute("id","map-reset-control"),this._btn.setAttribute("aria-label","Reset map position"),this._btn.type="button",this._btn.addEventListener("click",this._onClick),Is.createRoot(this._btn).render(s.jsx(j,{iconName:"replay"})),this._container.appendChild(this._btn),this._container}_onClick(){oe("Reset to map initial position"),this.features?.features?.length&&this.bounds&&this._map.fitBounds(this.bounds,this.params)}_updateProps(e){this.features=e.features||this.features,this.bounds=e.bounds||this.bounds,this.params=e.params||this.params}}a.objectOf(a.shape({instruction:a.string.isRequired,icon:a.node}));a.node.isRequired,a.objectOf(a.shape({handler:a.func.isRequired,instruction:a.string.isRequired,icon:a.node})),a.bool.isRequired;class xv extends Mt{constructor(e={}){super(e),this._buttonText=e.buttonText||"Show List",this._onClickCustom=e.onClick,this._onClick=this._onClick.bind(this)}onAdd(e){return super.onAdd(e),this._container.className="mapboxgl-ctrl mapbox-ctrl-show-list-button-container",this._buttonContainer=document.createElement("div"),this._buttonContainer.className="map-show-list-button-container",Is.createRoot(this._buttonContainer).render(s.jsx(gb,{children:s.jsx(k,{appearance:"tertiary",className:"map-show-list-button",shouldFitContainer:!0,iconBeforeElement:s.jsx(j,{iconName:"list",size:"sm"}),"aria-label":"Show List",onClick:this._onClick,children:s.jsx("span",{className:"map-show-list-text",children:"Show List"})})})),this._container.appendChild(this._buttonContainer),this._container}_onClick(){this._onClickCustom&&this._onClickCustom()}}class yv extends Mt{constructor(e){super(e),this.addElement=this.addElement.bind(this),this.updateElementById=this.updateElementById.bind(this),this.removeElementById=this.removeElementById.bind(this),this.getElementById=this.getElementById.bind(this),this.updateElementProps=this.updateElementProps.bind(this)}onAdd(e){return super.onAdd(e),this._container.className="mapboxgl-ctrl mapboxgl-ctrl-center-container-group",this._container}createElement(e,n){const i=document.createElement("div");return i.className="new-control-sub-container",n&&i.setAttribute("id",n),Is.createRoot(i).render(e),i}addElement(e,n){this._container&&this._container.appendChild(this.createElement(e,n))}updateElementById(e,n){const i=document.getElementById(n),r=this.createElement(e,n);i&&this._container.replaceChild(r,i)}removeElementById(e){const n=document.getElementById(e);n&&this._container.removeChild(n)}getElementById(e){return document.getElementById(e)}updateElementProps({element:e,key:n,value:i}){e[n]=i}}function Me({controlName:t="",message:e=null}){return s.jsx("div",{className:"rec-required",children:s.jsxs("p",{className:"rec-required-msg",children:[s.jsx("mark",{children:"*"})," ",s.jsx("strong",{children:t})," ",e]})})}Me.propTypes={controlName:a.string.isRequired,message:a.node.isRequired};class wv extends K.Component{static defaultProps={children:null,displayInSummary:!1,isCritical:!1};static propTypes={controlLabel:a.string.isRequired,value:a.oneOfType([a.string,a.number,a.bool]).isRequired,compareTo:a.oneOfType([a.string,a.number,a.bool]).isRequired,displayInSummary:a.bool,isCritical:a.bool,children:a.element,onValidated:a.func};constructor(e){super(e),this.state={isInvalid:!1}}componentDidMount(){this.validate()}componentDidUpdate(e){(e.value!==this.props.value||e.compareTo!==this.props.compareTo)&&this.validate()}componentWillUnmount(){this.props.onValidated&&this.props.onValidated(!1,null)}getDefaultMessage(){const e=s.jsx(Me,{controlName:this.props.controlLabel,message:"does not match with the required value."});return this.props.children||e}validate(){const e=this.props.value!==this.props.compareTo,n=this.getDefaultMessage(),i=this.props.isCritical;return this.setState({isInvalid:e}),this.props.onValidated&&this.props.onValidated(e,n),{isInvalid:e,message:n,isCritical:i}}render(){return this.props.displayInSummary||!this.state.isInvalid?null:this.getDefaultMessage()}}class Cv extends K.Component{static defaultProps={children:null,displayInSummary:!1,isCritical:!1};static propTypes={controlLabel:a.string.isRequired,value:a.oneOfType([a.string,a.number,a.bool,a.array,a.objectOf(a.oneOfType([a.string,a.number,a.bool,a.array]))]).isRequired,customValidator:a.func.isRequired,displayInSummary:a.bool,isCritical:a.bool,children:a.element,onValidated:a.func};constructor(e){super(e),this.state={isInvalid:!1}}componentDidMount(){this.validate()}componentDidUpdate(e){e.value!==this.props.value&&this.validate(e.value)}componentWillUnmount(){this.props.onValidated&&this.props.onValidated(!1,null)}getDefaultMessage(){const e=s.jsx(Me,{controlName:this.props.controlLabel,message:"The provided entry is invalid."});return this.props.children||e}validate(){const e=this.props.customValidator(this.props.value),n=this.getDefaultMessage(),i=this.props.isCritical;return this.setState({isInvalid:e}),this.props.onValidated&&this.props.onValidated(e,n),{isInvalid:e,message:n,isCritical:i}}render(){return this.props.displayInSummary||!this.state.isInvalid?null:this.getDefaultMessage()}}class Sv extends K.Component{static defaultProps={children:null,displayInSummary:!1,isCritical:!1};static propTypes={controlLabel:a.string.isRequired,value:a.oneOfType([a.string]).isRequired,displayInSummary:a.bool,isCritical:a.bool,children:a.element,onValidated:a.func};constructor(e){super(e),this.state={isInvalid:!1}}componentDidMount(){this.validate()}componentDidUpdate(e){e.value!==this.props.value&&this.validate()}componentWillUnmount(){this.props.onValidated&&this.props.onValidated(!1,null)}getDefaultMessage(){const e=s.jsx(Me,{controlName:this.props.controlLabel,message:" does not have the right Email format."});return this.props.children||e}validate(){const e=!ve(this.props.value)&&!ja(this.props.value),n=this.getDefaultMessage(),i=this.props.isCritical;return this.setState({isInvalid:e}),this.props.onValidated&&this.props.onValidated(e,n),{isInvalid:e,message:n,isCritical:i}}render(){return this.props.displayInSummary||!this.state.isInvalid?null:this.getDefaultMessage()}}class Nv extends K.Component{static defaultProps={children:null,displayInSummary:!1,isCritical:!1,isBefore:"",isAfter:""};static propTypes={controlLabel:a.string.isRequired,value:a.oneOfType([a.string,a.number,a.bool]).isRequired,displayInSummary:a.bool,isCritical:a.bool,isBefore:a.string,isAfter:a.string,children:a.element,onValidated:a.func};constructor(e){super(e),this.state={isInvalid:!1}}componentDidMount(){this.validate()}componentDidUpdate(e){e.value!==this.props.value&&this.validate()}componentWillUnmount(){this.props.onValidated&&this.props.onValidated(!1,null)}getDefaultMessage(){const e=s.jsx(Me,{controlName:this.props.controlLabel,message:" is not in specified date range."});return this.props.children||e}validate(){let e=!1,n=!1;ve(this.props.value)||(e=!ve(this.props.isBefore)&&!tc(this.props.value,this.props.isBefore),n=!ve(this.props.isAfter)&&!sc(this.props.value,this.props.isAfter));const i=e||n,r=this.getDefaultMessage(),o=this.props.isCritical;return this.setState({isInvalid:i}),this.props.onValidated&&this.props.onValidated(i,r),{isInvalid:i,message:r,isCritical:o}}render(){return this.props.displayInSummary||!this.state.isInvalid?null:this.getDefaultMessage()}}class Tv extends K.Component{static defaultProps={children:null,displayInSummary:!1,isCritical:!1};static propTypes={controlLabel:a.string.isRequired,value:a.oneOfType([a.number,a.string]).isRequired,displayInSummary:a.bool,isCritical:a.bool,children:a.element,onValidated:a.func};constructor(e){super(e),this.state={isInvalid:!1}}componentDidMount(){this.validate()}componentDidUpdate(e){e.value!==this.props.value&&this.validate()}componentWillUnmount(){this.props.onValidated&&this.props.onValidated(!1,null)}getDefaultMessage(){const e=s.jsx(Me,{controlName:this.props.controlLabel,message:" is not a valid Latitude."});return this.props.children||e}validate(){const e=!ve(this.props.value)&&!Si(`${this.props.value}, 0`),n=this.getDefaultMessage(),i=this.props.isCritical;return this.setState({isInvalid:e}),this.props.onValidated&&this.props.onValidated(e,n),{isInvalid:e,message:n,isCritical:i}}render(){return this.props.displayInSummary||!this.state.isInvalid?null:this.getDefaultMessage()}}class jv extends K.Component{static propTypes={controlLabel:a.string.isRequired,value:a.oneOfType([a.number,a.string]).isRequired,displayInSummary:a.bool,isCritical:a.bool,children:a.element,onValidated:a.func};static defaultProps={children:null,displayInSummary:!1,isCritical:!1};constructor(e){super(e),this.state={isInvalid:!1}}componentDidMount(){this.validate()}componentDidUpdate(e){e.value!==this.props.value&&this.validate()}componentWillUnmount(){this.props.onValidated&&this.props.onValidated(!1,null)}getDefaultMessage(){const e=s.jsx(Me,{controlName:this.props.controlLabel,message:" is not a valid Longitude."});return this.props.children||e}validate(){const e=!ve(this.props.value)&&!Si(`0, ${this.props.value}`),n=this.getDefaultMessage(),i=this.props.isCritical;return this.setState({isInvalid:e}),this.props.onValidated&&this.props.onValidated(e,n),{isInvalid:e,message:n,isCritical:i}}render(){return this.props.displayInSummary||!this.state.isInvalid?null:this.getDefaultMessage()}}class Rv extends K.Component{static propTypes={controlLabel:a.string.isRequired,value:a.oneOfType([a.string,a.number]).isRequired,displayInSummary:a.bool,isCritical:a.bool,children:a.element,onValidated:a.func,allowInternational:a.bool};static defaultProps={children:null,displayInSummary:!1,isCritical:!1,allowInternational:!1};constructor(e){super(e),this.state={isInvalid:!1}}componentDidMount(){this.validate()}componentDidUpdate(e){e.value!==this.props.value&&this.validate()}componentWillUnmount(){this.props.onValidated&&this.props.onValidated(!1,null)}getDefaultMessage(){const e=s.jsx(Me,{controlName:this.props.controlLabel,message:" does not have the right US phone number format."});return this.props.children||e}validate(){const e=!ve(this.props.value)&&(!this.props.allowInternational&&!ac(this.props.value,"en-US")||this.props.allowInternational&&!vr(this.props.value).isValid),n=this.getDefaultMessage(),i=this.props.isCritical;return this.setState({isInvalid:e}),this.props.onValidated&&this.props.onValidated(e,n),{isInvalid:e,message:n,isCritical:i}}render(){return this.props.displayInSummary||!this.state.isInvalid?null:this.getDefaultMessage()}}class Iv extends K.Component{static propTypes={controlLabel:a.string.isRequired,value:a.oneOfType([a.string,a.number,a.bool]).isRequired,displayInSummary:a.bool,isCritical:a.bool,min:a.oneOfType([a.string,a.number,a.bool]),max:a.oneOfType([a.string,a.number,a.bool]),children:a.element,onValidated:a.func};static defaultProps={children:null,displayInSummary:!1,isCritical:!1};constructor(e){super(e),this.state={isInvalid:!1}}componentDidMount(){this.validate()}componentDidUpdate(e){e.value!==this.props.value&&this.validate()}componentWillUnmount(){this.props.onValidated&&this.props.onValidated(!1,null)}getDefaultMessage(){const e=s.jsx(Me,{controlName:this.props.controlLabel,message:" is not in specified range."});return this.props.children||e}validate(){const e=!ve(this.props.value)&&!nc(this.props.value,{min:this.props.min,max:this.props.max})&&!ic(this.props.value,{min:dn(nn(this.props.min)),max:dn(nn(this.props.max))}),n=this.getDefaultMessage(),i=this.props.isCritical;return this.setState({isInvalid:e}),this.props.onValidated&&this.props.onValidated(e,n),{isInvalid:e,message:n,isCritical:i}}render(){return this.props.displayInSummary||!this.state.isInvalid?null:this.getDefaultMessage()}}class Ev extends K.Component{static propTypes={controlLabel:a.string.isRequired,value:a.oneOfType([a.string,a.number,a.bool]).isRequired,regex:a.objectOf(a.any).isRequired,displayInSummary:a.bool,isCritical:a.bool,children:a.element,onValidated:a.func,skipOnMountValidation:a.bool};static defaultProps={children:null,displayInSummary:!1,isCritical:!1};constructor(e){super(e),this.state={isInvalid:!1}}componentDidMount(){this.props.skipOnMountValidation||this.validate()}componentDidUpdate(e){e.value!==this.props.value&&this.validate()}componentWillUnmount(){this.props.onValidated&&this.props.onValidated(!1,null)}getDefaultMessage(){const e=s.jsx(Me,{controlName:this.props.controlLabel,message:" does not have the right format."});return this.props.children||e}validate(){const e=!ve(this.props.value)&&!ca(this.props.value,this.props.regex),n=this.getDefaultMessage(),i=this.props.isCritical;return this.setState({isInvalid:e}),this.props.onValidated&&this.props.onValidated(e,n),{isInvalid:e,message:n,isCritical:i}}render(){return this.props.displayInSummary||!this.state.isInvalid?null:this.getDefaultMessage()}}class kv extends K.Component{static propTypes={controlLabel:a.string.isRequired,value:a.oneOfType([a.string,a.number,a.bool]).isRequired,displayInSummary:a.bool,isCritical:a.bool,children:a.element,onValidated:a.func,dataIndices:a.array,skipOnMountValidation:a.bool};static defaultProps={children:null,displayInSummary:!1,isCritical:!1,dataIndices:[],skipOnMountValidation:!1};constructor(e){super(e),this.state={isInvalid:!1}}componentDidMount(){this.props.skipOnMountValidation||this.validate()}componentDidUpdate(e){(e.value!==this.props.value||!Ta(e.dataIndices,this.props.dataIndices))&&this.validate()}componentWillUnmount(){this.props.onValidated&&this.props.onValidated(!1,null)}getDefaultMessage(){const e=s.jsx(Me,{controlName:this.props.controlLabel,message:" is required."});return this.props.children||e}validate(){const e=ve(this.props.value),n=this.getDefaultMessage(),i=this.props.isCritical;return this.setState({isInvalid:e}),this.props.onValidated&&this.props.onValidated(e,n),{isInvalid:e,message:n,isCritical:i}}render(){return this.props.displayInSummary||!this.state.isInvalid?null:this.getDefaultMessage()}}const bb={type:"info",title:"",subtitle:"",caption:"",expirationTimeout:1e4};class _v extends m.Component{static{this.defaultProps=bb}constructor(e){super(e),this.state={hideComponent:!1},this.initInterval=null,this.handleClose=this.handleClose.bind(this)}componentDidMount(){this.initInterval=window.setTimeout(this.handleClose,this.props.expirationTimeout)}componentWillUnmount(){window.clearTimeout(this.initInterval)}handleClose(){this.setState({hideComponent:!0})}render(){return s.jsxs("div",{className:N(`rec-notification-toast-${this.props.type}`,{hide:this.state.hideComponent}),children:[s.jsx("div",{className:"rec-notification-title",children:this.props.title}),s.jsx("p",{children:this.props.subtitle}),s.jsx("p",{className:"rec-caption",children:this.props.caption}),s.jsx("button",{type:"button",className:"rec-notification-close",onClick:this.handleClose,"aria-label":"Close notification",children:s.jsx(j,{iconName:"close"})})]})}}function Av(t){function e(n){const i=Yt(),r=vi(),o=rc(),[l,c]=mi(),d=oc();return s.jsx(t,{...n,router:{location:i,navigate:r,params:o,searchParams:l,setSearchParams:c,navigationType:d}})}return e}const vb=a.shape({hash:a.string,key:a.string,pathname:a.string,search:a.string,state:a.object});a.shape({params:a.object,navigate:a.func,location:vb,searchParams:a.instanceOf(URLSearchParams),setSearchParams:a.func,navigationType:a.oneOf(["POP","PUSH","REPLACE"])});export{Bf as $,Mg as A,k as B,Nb as C,Xe as D,Ir as E,Wa as F,Zb as G,ae as H,j as I,tf as J,Ds as K,Bn as L,qb as M,Cs as N,zb as O,Lb as P,Av as Q,Rm as R,Rt as S,re as T,bn as U,df as V,qa as W,tv as X,Cb as Y,Eh as Z,$s as _,Ms as a,ro as a0,es as a1,Ut as a2,du as a3,Za as a4,Bs as a5,Ya as a6,jt as a7,Eb as a8,Xa as a9,tn as aA,Ge as aB,Xb as aC,$b as aD,Jb as aE,kb as aF,Gb as aG,Ib as aH,ob as aI,Mb as aJ,Ob as aK,Bb as aL,ws as aa,so as ab,Kn as ac,Fb as ad,gb as ae,fv as af,yv as ag,pv as ah,hv as ai,mv as aj,oe as ak,xv as al,vv as am,gv as an,bv as ao,ke as ap,nv as aq,Sb as ar,Vs as as,uv as at,ze as au,Yb as av,Bg as aw,Gt as ax,nb as ay,ib as az,dc as b,pt as c,ut as d,fe as e,J as f,wr as g,Nd as h,Be as i,iv as j,Tb as k,dm as l,gm as m,hm as n,bm as o,Fn as p,mm as q,fm as r,Rb as s,um as t,Qt as u,Ng as v,xe as w,hc as x,_e as y,rm as z}; //# sourceMappingURL=sarsaparilla-D3YC5DnF.js.map