import{j as s,R as ie,r as p,a as Oo,c as $o}from"./react-BeBbOMLB.js";import{c as R,D as Do,C as Fo,S as Vo,a as Bo,b as Ho,d as Uo,T as qo,e as Go,i as zo,f as Pa,g as oe,P as n,u as pe,h as Ie,j as Ma,o as Wo,k as _s,l as es,m as ma,L as xr,M as Fe,$ as Oa,p as yr,H as fa,n as As,q as Ko,r as Yo,s as Zo,t as Jo,v as Mt,w as tt,x as wr,y as Xo,z as Qo,A as el,B as tl,E as sl,F as al,G as Cr,I as nl,J as rl,K as Ge,N as il,O as ol,Q as wn,R as Sr,U as ll,V as Nr,W as xt,X as jr,Y as cl,Z as ts,_ as dl,a0 as Tr,a1 as Cn,a2 as ul,a3 as xs,a4 as Rr,a5 as Ls,a6 as Ir,a7 as Er,a8 as kr,a9 as hl,aa as pl,ab as ml,ac as fl,ad as gl,ae as Ps,af as bl,ag as vl,ah as Sn,ai as Nn,aj as xl,ak as yl,al as wl,am as Cl,an as Sl,ao as Nl,ap as jl,aq as Tl,ar as Rl,as as Il,at as El,au as kl,av as _l,aw as Al,ax as Ll,ay as Pl,az as Ml,aA as Ol,aB as $l,aC as _r,aD as Dl,aE as Fl,aF as ss,aG as Vl,aH as Ar,aI as Lr,aJ as Bl,aK as $a,aL as Hl,aM as Pr,aN as Da,aO as Ul,aP as ql,aQ as Gl,aR as zl,aS as Wl,aT as Kl,aU as Yl,aV as Zl,aW as Jl,aX as Xl,aY as Ql,aZ as ec,a_ as tc,a$ as sc,b0 as ac,b1 as nc,b2 as rc,b3 as Fa,b4 as Ne,b5 as ic,b6 as oc,b7 as Mr,b8 as lc,b9 as cc,ba as dc,bb as jn,bc as ga,bd as uc,be as hc}from"./vendor-IkqcCFNs.js";import{f as Va,d as Ot,i as _e,o as pc,b as Se,c as Ba,e as Or,t as st,h as $r,j as mc,k as fc,l as Dr,m as gc,n as $t,p as bc,q as Je,r as ia,s as Ha,u as vc,v as Tn}from"./lodash-T_A-3Zjk.js";function A({iconName:t,size:e,className:a,width:r=24,height:i=24,"aria-label":o,...l}){return s.jsx("svg",{"data-component":"Icon",className:R("sarsa-icon",`rec-icon-${t}`,a,e),role:o?"img":"presentation","aria-label":o||void 0,focusable:"false",height:i,width:r,...l,children:s.jsx("use",{href:`/shared/graphics/icons.svg#rec-icon-${t}`,className:t})})}const xc=["a","an","the","and","but","de","la","or","for","nor","as","at","by","for","from","in","into","near","of","on","onto","to","with"],ba=xc.map(t=>new RegExp(`\\s${t}\\s`,"ig"));ba.push(new RegExp("\\'S","ig"));const yc=["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"],Rn=yc.map(t=>t.indexOf("(")>=0?new RegExp(`(^|\\s)${t}(\\s|$)`,"ig"):new RegExp(`(^|\\s|\\()${t}(\\s|\\)|$)`,"ig")),wc=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),Cc=t=>t===t.toUpperCase()?t.toLowerCase():t;function Ss(t){if(!t)return"";let e=t.replace(/[A-Za-zÀ-ÖØ-öø-ĿŁŃ-ƶ0-9_]*/g,a=>wc(a)?a.toUpperCase():a.charAt(0).toUpperCase()+Cc(a.slice(1)));for(let a=0;ar.toLowerCase());for(let a=0;ar.toUpperCase());return e}function Sc(t){const e="ÀÁÂÃÄÅĀàáâãäåāÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž",a="AAAAAAAaaaaaaaOOOOOOOooooooEEEEeeeeeCcDIIIIiiiiUUUUuuuuNnSsYyyZz",r=t.split("");return r.forEach((i,o)=>{const l=e.indexOf(i);l!==-1&&(r[o]=a[l])}),r.join("")}function In(t){return typeof t!="string"?(console.error("Invalid type passed to sluggifyString. Must be a string. Received:",t),""):Sc(t).toLowerCase().replace(/\s+/g,"-").replace(/--+/g,"-").replace(/[^\w-]+/g,"").replace(/^-+/,"").replace(/-+$/,"")}function va(t){return typeof t=="string"?In(t):Array.isArray(t)?t.map(e=>In(e)).join("-"):(console.error("Invalid type passed to sluggify. Must be a string or an array of strings. Received: ",t),"")}const rt=(t,e,a)=>typeof t=="number"?t===1?e:a:Array.isArray(t)&&t.length===1?e:a,Nc=["allowfullScreen","async","autoplay","capture","checked","controls","default","defer","disabled","formnovalidate","hidden","loop","multiple","muted","novalidate","open","playsinline","readonly","required","reversed","scoped","seamless","selected","itemscope"],jc={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"},Tc=/^[a-zA-Z][a-zA-Z:_.\-\d]*$/,oa={};function Fr(t){return Object.hasOwn(oa,t)||(oa[t]=Tc.test(t)),oa[t]}const Rc=(t,e)=>(Nc.map(r=>r.toLowerCase()).indexOf(t.toLowerCase())>=0&&(e=t),e);function Ic(t){return Object.keys(t).filter(e=>Fr(e)).reduce((e,a)=>{const r=a.toLowerCase(),i=jc[r]||r;return e[i]=Rc(i,t[a]),e},{})}function Ec(t=""){return t===""?{}:t.split(";").reduce((e,a)=>{let[r,i]=a.split(/^([^:]+):/).filter((o,l)=>l>0).map(o=>o.trim().toLowerCase());return i===void 0||(r=r.replace(/^-ms-/,"ms-").replace(/-(.)/g,(o,l)=>l.toUpperCase()),e[r]=i),e},{})}function Vr(t){const e=Object.assign({},Ic(t));return typeof e.style=="string"||e.style instanceof String?e.style=Ec(e.style):delete e.style,e}function kc(t,e){let a;t.children.length>0&&(a=t.children[0].data);const r=Vr(t.attribs);return ie.createElement("style",r,a)}const _c=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"];function Ac(t){return t.type==="text"&&/\r?\n/.test(t.data)&&t.data.trim()===""}function Lc(t,e){return t.filter(a=>!Ac(a)).map((a,r)=>{let i;return typeof e=="function"&&(i=e(a,r),i===null||i)?i:Xe(a,r,e)})}function Pc(t,e,a){const r=t.name;if(!Fr(r))return null;const i=Vr(t.attribs);let o=null;return _c.indexOf(r)===-1&&(o=Lc(t.children,a)),p.createElement(r,i,o)}function Mc(t){return t.data}function Vt(){return null}const Oc={[Go]:Mc,[qo]:Pc,[Uo]:kc,[Ho]:Vt,[Bo]:Vt,[Vo]:Vt,[Fo]:Vt,[Do]:Vt};function Xe(t,e,a){return Oc[t.type](t,e,a)}const $c=t=>{const e="/api/accounts/login/v2/refresh",a=new XMLHttpRequest;if(a.open("POST",e,!1),a.setRequestHeader("Authorization",`Bearer ${t.access_token}`),a.send(JSON.stringify({account_id:t.account_id,refresh_id:t.refresh_id})),a.status===200){const r=JSON.parse(a.responseText);return window.localStorage.setItem("recaccount",JSON.stringify(r)),!0}return!1},Dc=()=>{const t=window.localStorage.getItem("recaccount"),e=JSON.parse(t);if(t==null)return null;let a=null,r=null,i=null;return a=e?.account?.account_id,i=e.refresh_id,r=e.access_token,a&&i&&r?{account_id:a,refresh_id:i,access_token:r}:null};class it{constructor(){this.data={},this.keys=[]}createCookie(e,a,r){let i="";if(r){const o=new Date;o.setTime(o.getTime()+r*24*60*60*1e3),i=`;expires=${o.toUTCString()}`}document.cookie=`${e}=${a}${i};path=/;secure`}readCookie(e){const a=`${e}=`,r=decodeURIComponent(document.cookie).split(";");let i;for(let o=0;oa!==e),this.setData()}clear(){this.data={},this.keys=[],this.clearData()}get length(){return this.getData(),this.keys.length}}let ds=null,us=null,hs=null,ps=null,ms=null;function $e(){const t=window.localStorage.getItem("recaccount");if(!t)return!1;const e=JSON.parse(t),a=e.expiration;if(zo(a,new Date))return!0;if(!e.is_guest){const r=Dc();if(r&&$c(r))return!0}return window.localStorage.removeItem("recaccount"),!1}function Fc(){return window.localStorage.getItem("internalaccount")!==null}function as(){const t=window.localStorage.getItem("recaccount");if(!t)return!1;const e=JSON.parse(t);return Pa(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 Pa(e.expiration,new Date)?(window.localStorage.removeItem("csraccount"),!1):!0}function Os(){if(ds===null){const t=new it().readCookie("X-Mobile-Auth"),e=new it().readCookie("X-Mobile-Guest-Auth"),a=window.sessionStorage.getItem("isMobileApp"),r=window.location.search.indexOf("src=mobileApp")>=0;t!==null||e!==null||a==="true"||r?(window.sessionStorage.setItem("isMobileApp","true"),ds=!0):ds=!1}return ds}function Vc(){if(us===null){const t=new it().readCookie("X-Mobile-Native-Cart"),e=window.sessionStorage.getItem("isMobileNativeCartEnabled"),a=window.location.search.indexOf("mobileNativeCart=true")>=0;t!==null||e==="true"||a?(window.sessionStorage.setItem("isMobileNativeCartEnabled","true"),us=!0):us=!1}return us}function Bc(){if(Os()){const t=new it().readCookie("X-Mobile-Recaptcha");if(t!==null)return t}return null}function Hc(){if(Os()){const t=new it().readCookie("X-Mobile-Recaptcha-Type");if(t!==null)return t}return null}function Uc(){if(Os()){const t=new it().readCookie("X-Mobile-Location");if(t!==null)return t}return null}function lt(){if(hs===null){const t=window.sessionStorage.getItem("isEmbeddedWidget"),e=window.location.search.indexOf("src=widget")>=0;t==="true"||e?(window.sessionStorage.setItem("isEmbeddedWidget","true"),hs=!0):hs=!1}return hs}function Br(){if(ps===null&<()){let t=window.sessionStorage.getItem("widgetLocation"),e=null;if(window.location.href.includes("src=widget")){const i=new URL(window.location.href).pathname.split("/").pop()||null;e=new URL(window.location.href).searchParams.get("widget_loc_id")||i,t!==e&&(t=null)}t?ps=t:e&&(window.sessionStorage.setItem("widgetLocation",e),ps=e)}return ps}function $s(){if(ms===null&<()){let t=window.sessionStorage.getItem("widgetUrl");const e=window.location.href;e.includes("src=widget")&&t!==e&&(t=null),t?ms=t:e&&(window.sessionStorage.setItem("widgetUrl",e),ms=e)}return ms}function Hr(){Ua()||window.sessionStorage.setItem("widgetDocumentReferrer",document.referrer||"unknown")}function Ua(){return window.sessionStorage.getItem("widgetDocumentReferrer")||null}function Ur(t){if(lt()){t.includes("?")?t=`${t}&`:t=`${t}?`;const e=Ua()||"unknown";return`${t}widget_referrer=${encodeURIComponent(e)}`}return t}function qr(){const t=document.location.href;if(t.includes("widget_referrer=")){const e=new URL(t).searchParams.get("widget_referrer");window.sessionStorage.setItem("widgetReferrer",e||"unknown")}}function Wt(){return window.sessionStorage.getItem("widgetReferrer")||null}function Ds(){return $e()?JSON.parse(window.localStorage.getItem("recaccount")):{}}function Gr(){return as()?JSON.parse(window.localStorage.getItem("recaccount")):{}}function zr(){return Ms()?JSON.parse(window.localStorage.getItem("csraccount")):{}}function qa(){return $e()?Ds().account:{}}function Wr(){const t=window.localStorage.getItem("internalaccount"),e=t?JSON.parse(t):null;return e?.user?e?.user?.user_id??"":""}function qc(){const t=window.localStorage.getItem("internalaccount");return t?JSON.parse(t):null}function Gc(){const t=qa();return Object.keys(t).length>0&&Object.hasOwn(t,"is_commercial_account")?t.is_commercial_account:!1}function Te(){return $e()?`Bearer ${Ds().access_token}`:as()?`Bearer ${Gr().access_token}`:""}function Ga(){const t=window.localStorage.getItem("internalaccount"),e=t?JSON.parse(t):null;return e?`Bearer ${e.access_token}`:""}function Kt(){return Ms()?`Bearer ${zr().access_token}`:""}const Wb=Object.freeze(Object.defineProperty({__proto__:null,appendWidgetReferrer:Ur,getAccount:qa,getAuthHeader:Te,getExternalCSRAccount:zr,getExternalCSRAuthHeader:Kt,getGuestAccount:Gr,getInternalAccount:qc,getInternalAccountId:Wr,getInternalAuthHeader:Ga,getMobileNativeLocation:Uc,getMobileNativeRecaptchaToken:Bc,getMobileNativeRecaptchaType:Hc,getRecAccount:Ds,getWidgetDocumentReferrer:Ua,getWidgetHomeUrl:$s,getWidgetLocation:Br,getWidgetReferrer:Wt,isCommercialAccount:Gc,isExternalCSRLoggedIn:Ms,isGuest:as,isInternalUserLoggedIn:Fc,isLoggedIn:$e,isMobileApp:Os,isMobileNativeCartEnabled:Vc,isWidgetSession:lt,storeWidgetDocumentReferrer:Hr,storeWidgetReferrer:qr},Symbol.toStringTag,{value:"Module"}));function Kb(t,e){let a=e;a=new Error;const r=a?.stack;console.log(t),console.log(`${r}`)}function En(t){return t===null||t.length===0}function ft(t,e={}){let a="";Object.keys(e).forEach(i=>{let o="";if(a!==""&&(o="&"),e[i]||e[i]===0||e[i]===!1){const l=e[i];(!En(l)||l===0||l===!1)&&(Array.isArray(l)?l.forEach(c=>{a!==""&&(o="&"),a=`${a}${o}${i}=${encodeURIComponent(c)}`}):a=`${a}${o}${i}=${encodeURIComponent(l)}`)}});let r=t;return En(a)||(r=`${r}?${a}`),r}const zc=1,Kr="ALERTS_FETCHED",Wc="FETCHING_ALERTS_FAILED",Yr="LOGIN_SUCCESS",Zr="LOGIN_FAILED",Jr="LOCKOUT",Xr="LOGIN_RESET_STATE",Qr="LOGIN_BAD_MAGIC",ei="CSR_LOGIN_SUCCESS",Kc="CSR_CLEAR_SELECTED",Yc="RECAPTCHA_SUCCESS",Zc="RECAPTCHA_ERROR",ti="LOGOUT_SUCCESS",si="MFA_REQUIRED",ai="ACCOUNT_SERVICE_STATUS_UPDATED",ni="SHOW_LOGIN_MODAL",Jc="HIDE_LOGIN_MODAL",ri="SHOW_SIGN_IN_GUEST_MODAL",Xc="HIDE_SIGN_IN_GUEST_MODAL",ii="SHOW_CREATE_ACCOUNT_MODAL",Qc="HIDE_CREATE_ACCOUNT_MODAL",oi="SHOW_RESET_MODAL",ed="HIDE_RESET_MODAL",td="SHOW_CART_LIMIT_EXCEEDED_MODAL",li="HIDE_CART_LIMIT_EXCEEDED_MODAL",ci="SHOW_MFA_SETUP_MODAL",sd="HIDE_MFA_SETUP_MODAL",za="SHOW_MFA_CODE_MODAL",ad="HIDE_MFA_CODE_MODAL",di="SHOW_CONFIRM_MODAL",nd="HIDE_CONFIRM_MODAL",ui="HIDE_ALL_MODALS",Wa="GET_CART",hi="GET_CART_HEADER",rd="ADD_ITEM",Ka="CART_ERROR",id="EXTEND_EXPIRATION_ERROR",xa="EXTEND_CART_TIMER",od="REMOVE_RESERVATION_ERROR",ld="GET_SEARCH_SUGGESTIONS",cd="GET_SEARCH_SUGGESTIONS_ERROR",dd="UPDATE_SEARCH_CRITERIA",pi="UPDATE_SEARCH_CRITERIAS",mi="ADD_SEARCH_FILTER",ud="SET_SEARCH_FILTER",hd="REMOVE_SEARCH_FILTER",fi="RESET_SEARCH_FILTERS",pd="RESET_SEARCH_FILTERS_CAMPSITES",md="HIGHLIGHT_SEARCH_RESULT_ITEM",fd="UPDATE_CHECKIN_DATE",gd="UPDATE_CHECKOUT_DATE",bd="REPLACE_SEARCH_STATE",vd="SHOW_SEARCH_INPUT",xd="HIDE_SEARCH_INPUT",gi="INVENTORY_FETCH_ASSET_START",bi="INVENTORY_FETCH_ASSET_SUCCESS",vi="INVENTORY_FETCH_ASSET_FAILURE";function Ce(){return typeof window<"u"}function yd(){return Ce()?"ontouchend"in document||"ontouchstart"in window||navigator.maxTouchPoints&&navigator.maxTouchPoints>0||window.matchMedia&&window.matchMedia("(any-pointer:coarse)").matches:!1}function wd(){return Ce()?/Macintosh|Mac|Mac OS|MacIntel|MacPPC|Mac68K/gi.test(navigator.userAgent):!1}function Cd(){return Ce()?wd()&&yd()?!0:/iPad|iPhone|iPod/.test(window.navigator.userAgent)&&!window.MSStream:!1}function Sd(){return Ce()?/android/i.test(navigator.userAgent):!1}function Yb(){return Sd()||Cd()}const Nd=[{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 Tt(t){return e=>{const a={...t};return a.type=pi,e(a)}}function xi(t,e){return{type:mi,uiFilterName:t,uiFilterOption:e}}function jd(){return{type:fi}}function Td(t,e){const a={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 ft(t,a)}function Rd(){return(t,e)=>{const a=e(),r=Td("/search",a);window.location.assign(r)}}function Id(t){return e=>{t&&t.forEach(r=>{const i=Va(Nd,{key:r});i&&e(xi("inventoryTypes",i))})}}function ze(t,e){try{if(window.dataLayer){let a=!1;const r={...t};r.event="eventTracking";let i=null;r.eventCallback=()=>{if(!a){if(a=!0,e)e();else throw Error(`searchCallback not passed, is ${typeof e}`);i&&clearTimeout(i)}},r.eventTimeout=1e3,i=setTimeout(()=>{a||(a=!0,e())},1500),window.dataLayer.push(r)}else e()}catch(a){console.error(a),e()}}function ya(t,e,a,r,i,o=!1,l=null,c=null){return d=>{d(jd()),d(Id(e));let u,f,g,h,m,b,x,w;a&&!a.entity_type&&a.lat&&a.lng&&(u=a.lat,f=a.lng,g=200,h=a.text,a.lat_sw&&a.lat_ne&&a.lng_sw&&a.lng_ne&&(u=null,f=null,m=a.lat_sw,b=a.lng_sw,x=a.lat_ne,w=a.lng_ne));const v={what:t,headerTextQuery:t,entity_id:a!=null?a.entity_id:null,entity_type:a!=null?a.entity_type:null,inventory_type:e,parent_asset_id:r,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:m,lng_sw:b,lat_ne:x,lng_ne:w};i&&Object.keys(i).forEach(C=>{Object.keys(i[C]).forEach(y=>{d(xi(C,i[C][y]))})}),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(Tt(v)),d(Rd())}}const ke={history:[],lastFetched:0,isFetching:!1};async function Ed(){let t=1;const e=async(a=750)=>new Promise(r=>{setTimeout(()=>{r()},a)});for(;ke.isFetching&&t<5;)await e(100*t),t+=1;return Promise.resolve()}async function kd(t){const e=Date.now()-ke.lastFetched<2e3;let a=[];if(ke.isFetching)return await Ed(),t?.(),Promise.resolve(ke.history);if(ke.isFetching=!0,e)return t?.(),ke.isFetching=!1,Promise.resolve(ke.history);try{Ce()&&(a=JSON.parse(window.localStorage.getItem("search_history")||"[]"),a&&a.length>0&&(a=a.filter(r=>r.text.length>0).sort((r,i)=>r.last_used>i.last_used?-1:1).slice(0,5),ke.history=[...a],ke.lastFetched=Date.now()))}catch{a=[],window.localStorage.setItem("search_history",JSON.stringify([]))}if($e()){const r=await oe.get("/api/search/history",{headers:{Authorization:Te()}});if(r.data.items){let i=Object.assign([],r.data.items);i=i.map(c=>{const d=c;return d.synced=!0,d});let o=[];o=o.concat(a),o=o.concat(i),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 oe.post("/api/search/history",{items:l},{headers:{Authorization:Te()}})}catch(c){console.log("could not save local history",c)}window.localStorage.setItem("search_history",JSON.stringify(i))}return ke.history=[...r.data.items],ke.lastFetched=Date.now(),ke.isFetching=!1,t?.(),r.data.items}}return t?.(),ke.isFetching=!1,Promise.resolve(a)}async function kn({searchHistory:t,rawSearchText:e,suggestion:a}){let r=t;r||(r=ke.history);const i=typeof e=="string"?e.trim():"";let o={};if(a){const l=r.filter(c=>c.entity_id===a.entity_id&&c.entity_type===a.entity_type&&c.name===a.name&&c.text===a.text);!l||l.length===0?(o={...a,last_used:new Date().toISOString()},r.push(o)):(l[0].last_used=new Date().toISOString(),o=l[0])}else if(i.length>0){const l=r.filter(c=>c.text===i);!l||l.length===0?(o.text=i,o.last_used=new Date().toISOString(),r.push(o)):(l[0].last_used=new Date().toISOString(),o=l[0])}else return Promise.resolve();if($e())try{await oe.post("/api/search/history",{items:[o]},{headers:{Authorization:Te()}}),o.synced=!0}catch(l){console.log("could not save local history",l)}return window.localStorage.setItem("search_history",JSON.stringify(r)),Promise.resolve()}async function _d(){return window.localStorage.setItem("search_history",JSON.stringify([])),$e()&&await oe.delete("/api/search/history",{headers:{Authorization:Te()}}),new Promise(t=>{t()})}async function Ad(t){const e={fq:[`asset_id:${t}`]};return oe.get(ft("/api/search",e))}async function Ld(t){const e={fq:[`park_pass_facility_id_s:${t}`]};return oe.get(ft("/api/search",e))}function Ns(t){const e=t.reduce((r,i)=>r+i.quantity*i.price,0);return parseFloat(String(e))}const Ya=({currency:t="USD",product_name:e,extended_product_price:a,items:r,isAdding:i,real_path:o})=>({event:i?"add_to_cart":"remove_from_cart",real_path:o,product_name:e,extended_product_price:a,ecommerce:{currency:t,items:r,value:Ns(r),widget_referrer:Wt()}}),Pd=["begin_checkout","view_cart","add_payment_info","purchase"],Md=({currency:t="USD",step_number:e,items:a,id:r="",checkoutPaymentInfo:i})=>{const o=Pd[e-1];return o==="purchase"?{event:o,ecommerce:{transaction_id:r,currency:t,items:a,value:Ns(a),payment_type:i?.paymentType,saved_card_on_purchase:i?.savedCardOnPurchase,widget_referrer:Wt()}}:{event:o,ecommerce:{currency:t,items:a,value:Ns(a),widget_referrer:Wt()}}},Od=({currency:t="USD",list_name:e,impressions:a})=>({event:"view_item_list",ecommerce:{item_list_name:e,currency:t,items:a}}),wa=({currency:t="USD",product_name:e,product_price:a,product_list_name:r,items:i})=>({event:"view_item_from_sarsa",product_name:e,product_price:a,product_list_name:r,ecommerce:{currency:t,value:Ns(i),items:i}});function Za({eventCallback:t=()=>{},promotion_name:e,promotions:a}){return{event:"select_promotion",ecommerce:{promotion_name:e,items:a},eventCallback:t}}Za.propTypes={eventCallback:n.func,promotion_name:n.string.isRequired,promotions:n.arrayOf(n.shape({name:n.string.isRequired,position:n.string.isRequired,creative:n.string,id:n.string})).isRequired};const yi=({promotion_name:t,promotions:e})=>({event:"view_promotion",ecommerce:{promotion_name:t,items:e}}),$d={skus:"dimension15"},Dd=({currency:t="USD",id:e,affiliation:a,revenue:r,tax:i,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:a,revenue:r,tax:i,shipping:o,coupon:l,[$d.skus]:d?.length?d?.sort().join("|"):"",payment_type:u,saved_card_on_purchase:f,widget_referrer:Wt()}}),Fd=({name:t,id:e,list:a,brand:r,category:i,variant:o,position:l,price:c})=>({name:t,id:e,list:a,brand:r,category:i,variant:o,position:l,price:c}),Fs=({index:t,item_brand:e,item_id:a,item_name:r,agency_name:i,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:m,price:b,type_of_use:x})=>({index:t,item_brand:e,item_id:a,item_name:r,agency_name:i,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:m,price:b,type_of_use:x});Fs.displayName="gaProductObject";const wi=({name:t,id:e,creative:a,position:r})=>({name:t,id:e,creative:a,position:r});function Ci({currency:t="USD",product_name:e,product_list_name:a,items:r}){return{event:"select_item",product_name:e,ecommerce:{currency:t,item_list_name:a,items:r}}}Ci.propTypes={currency:n.string,product_name:n.string.isRequired,product_list_name:n.string,items:n.arrayOf(Fs).isRequired};function Si({currency:t="USD",id:e,isPartial:a=!1}){return{event:a?"order_partial_refund":"order_refunded",ecommerce:{currency:t,transaction_id:e}}}Si.propTypes={id:n.string.isRequired,isPartial:n.bool.isRequired};const Vd=1e3;let ys=[];const Bd=["view_item","view_item_list"],Hd=Ot(()=>{try{if(!ys.length)return;const t={view_item:null,view_item_list:{}};ys.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),_e(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")}ys=[]},Vd);function Ke({event:t,shouldEnqueueWork:e=!1}){try{window.dataLayer&&(e&&Bd.includes(t?.event)?(ys.push(t),Promise.resolve().then(()=>Hd())):((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(a){console.error(a)}}const Ud=n.oneOf([Ci,wa,Ya,Md,Dd,Si,yi,Za]);Ke.displayName="gaReportEvent";Ke.propTypes={event:Ud.isRequired};const Ni={IDLE:"IDLE",PENDING:"PENDING",SUCCESS:"SUCCESS",ERROR:"ERROR"},Ee={sm:576,md:768,lg:992,xl:1240,xxl:1640},qd=[{label:"United States",value:"USA"},{label:"Canada",value:"CAN"},{label:"Mexico",value:"MEX"}],Gd=[{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"}],Wd=[{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"}],Kd=[{label:"Armed Forced Other",value:"AE"},{label:"Armed Forces Americas",value:"AA"},{label:"Armed Forces Pacific",value:"AP"}],{IDLE:Yd,PENDING:Zd,SUCCESS:_n,ERROR:Jd}=Ni;function Xd({assetId:t,campsiteId:e,tourId:a,timedEntryTourId:r,venueId:i}){const o={galleryImages:[]},[l,c]=p.useState(o),[d,u]=p.useState(Yd);return p.useEffect(()=>{let f=!0;const g=new AbortController;let h,m;const b=[],x=[],w=[];return a?(h="tour",m=a):r?(h="timedentry_tour",m=r):e?(h="campsite",m=e):t?(h="asset",m=t):i&&(h="vr-venue",m=i),h&&m&&(u(Zd),(async()=>{try{const{data:C}=await oe.get(`/api/media/public/${h}/${m}`,{signal:g.signal});if(!C||C.error)u(Jd);else{const y=C?.result;f&&Array.isArray(y)?(y.forEach(N=>{const{media_id:T,is_gallery:j,is_primary:S,is_preview:k,title:_,description:I,url:P,credits:B,position:W,created_date:D,updated_date:E}=N,V=_&&_!==""?_:null;(j||!S&&!k)&&V&&P&&b.push({media_id:T,altText:V,caption:I,url:P,credit:B,position:W,created_date:D,updated_date:E}),S&&V&&P&&x.push({media_id:T,altText:V,caption:I,url:P,credit:B,position:W,created_date:D,updated_date:E}),k&&V&&P&&w.push({media_id:T,altText:V,caption:I,url:P,credit:B,position:W,created_date:D,updated_date:E})}),b.sort((N,T)=>{if(N.positionS?1:0}),c({galleryImages:b,heroImage:x[0],previewImage:w[0]}),u(_n)):f&&(c({galleryImages:[]}),u(_n))}}catch(C){oe.isCancel(C)||console.error("useAssetImages failure",C)}})()),()=>{f=!1,g.abort()}},[t,a,e,i,r]),{...l,status:d}}function Nt(t){const[e,a]=p.useState(()=>Ce()?window.matchMedia(t).matches:!1);return p.useEffect(()=>{const r=window.matchMedia(t);function i(o){a(o.matches)}return r.addEventListener("change",i),()=>{r.removeEventListener("change",i)}},[t]),e}function Dt(){const t=Nt(`only screen and (max-width: ${Ee.sm-1}px`),e=Nt(`only screen and (min-width: ${Ee.sm}px) and (max-width: ${Ee.md-1}px`),a=Nt(`only screen and (min-width: ${Ee.md}px) and (max-width: ${Ee.lg-1}px`),r=Nt(`only screen and (min-width: ${Ee.lg}px) and (max-width: ${Ee.xl-1}px`),i=Nt(`only screen and (min-width: ${Ee.xl}px) and (max-width: ${Ee.xxl-1}px`),o=Nt(`only screen and (min-width: ${Ee.xxl}px)`);return{isXs:t,isSm:e,isMd:a,isLg:r,isXl:i,isXxl:o,isXsAndUp:!0,isSmAndUp:e||a||r||i||o,isMdAndUp:a||r||i||o,isLgAndUp:r||i||o,isXlAndUp:i||o,isXxlAndUp:o,isXsAndDown:t,isSmAndDown:e||t,isMdAndDown:a||e||t,isLgAndDown:r||a||e||t,isXlAndDown:i||r||a||e||t,isXxlAndDown:!0}}function Qd(t){return!!(t&&{}.toString.call(t)=="[object Function]")}function eu(t,e){if(t!=null)if(Qd(t))t(e);else try{t.current=e}catch{throw new Error(`Cannot assign value "${e}" to ref "${t}"`)}}function Vs(...t){return p.useCallback(e=>{for(const a of t)eu(a,e)},t)}const tu=()=>({type:gi}),su=t=>({type:bi,payload:t}),au=t=>({type:vi,error:t}),nu=t=>async e=>{if(t){e(tu());try{const a=`/api/external/inventory/asset/${t}`,r=await oe.get(a);e(su(r?.data))}catch(a){e(au(a))}}},ru=t=>({type:Kr,alerts:t}),iu=t=>async e=>{if(!(!t?.location_id||!t?.location_type||t?.location_id==="orders"&&t?.location_type==="Permit"))try{const r=`/api/communication/external/alert${`?location_id=${t.location_id}&location_type=${t.location_type}`}`,o=(await oe.get(r)).data.alerts;e(ru(o))}catch{}};function ou(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 lu=t=>t?.asset;function Zb(){const t=pe(u=>u?.alertsNotification?.alerts)||[],e=pe(lu),a=Ie(),r=Ma(),i=ou(r),o=!i?.isGateway||e?.loaded;if(p.useEffect(()=>{i?.isGateway&&a(nu(i?.location_id))},[i?.location_id,i?.isGateway,a]),i?.isGateway&&e?.loaded&&(i.location_id=e?.data?.internal_location_id),p.useEffect(()=>{o&&i?.location_id&&i?.location_type&&a(iu({location_id:i.location_id,location_type:i.location_type}))},[i?.location_id,i?.location_type,o,a]),!i?.location_id)return[];const l=i.isGateway||i.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 m=l&&h,b=(!i.isGateway||f)&&(!i.isSitePass||g);return!u&&(!m||b)});return pc(c,["created_at"],["desc"])}const ct=t=>{const e=p.useId();return t??e};function Jb({root:t=null,rootMargin:e,threshold:a=0}={}){const[r,i]=p.useState({}),[o,l]=p.useState(null),c=([u])=>i(u),d=p.useRef(new IntersectionObserver(c,{root:t,rootMargin:e,threshold:a}));return p.useEffect(()=>{const{current:u}=d;return u.disconnect(),o&&u.observe(o),()=>u.disconnect()},[o]),[l,r]}const Ja=(t,e,a=.9)=>{const[r,i]=p.useState(!1);return p.useEffect(()=>{try{if(t&&e?.current){const o=new IntersectionObserver(([l])=>i(l.isIntersecting),{threshold:a});return o.observe(e.current),()=>{o.disconnect()}}}catch(o){console.error("useIntersectWithRefParameter failure",o)}return()=>{}},[t,e,a]),r};function cu(t){const[e,a]=p.useState({width:0,height:0});return p.useEffect(()=>{let r=!0;const i=Ot(()=>{t?.current&&r&&a({width:t.current.offsetWidth,height:t.current.offsetHeight})},100);return i(),window.addEventListener("resize",i),()=>{r=!1,window.removeEventListener("resize",i),i.cancel()}},[t]),e}function ji(t,e){let a,r;typeof e=="boolean"?a=e:(a=e?.observe??!0,r=e?.onChange);const[i,o]=p.useState(t.current),l=p.useRef(!1),c=p.useRef(!1),[d,u]=p.useState(null),f=p.useRef(r);return p.useLayoutEffect(()=>{f.current=r,t.current!==i&&o(t.current)}),p.useLayoutEffect(()=>{i&&!l.current&&(l.current=!0,u(i.getBoundingClientRect()))},[i]),p.useLayoutEffect(()=>{if(!a)return;let g=i;if(c.current||(c.current=!0,g=t.current),!g)return;const h=Wo(g,m=>{f.current?.(m),u(m)});return h.observe(),()=>{h.unobserve()}},[a,i,t]),d}function du({timeout:t=400}={}){const[e,a]=p.useState(!1);return p.useEffect(()=>{let r=!0;if(!Ce())return()=>{};const i=()=>{!e&&r&&a(!0)};return window.addEventListener("resize",i),()=>{r=!1,window.removeEventListener("resize",i)}},[e,t]),p.useEffect(()=>{e&&Ot(()=>{a(!1)},t,{leading:!1,trailing:!0})()},[e,t]),e}const uu={loading:!1,loaded:!1,error:null},hu=_s({name:"slug",initialState:uu,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}}}),pu=hu.reducer;function Xb(t=80,e=!0){const a=p.useRef(null),[r,i]=p.useState("none"),[o,l]=p.useState(null),c=ji(a,e),d=c?.top,u=c?.bottom,f=c?.width,g=a.current?.children?.[0]?.clientHeight;return p.useEffect(()=>{!Se(d)&&!Se(u)&&!Se(g)?u-g<=t?i("bottom"):d<=t?i("top"):i("none"):i("none")},[d,u,g,t]),p.useEffect(()=>{f&&l(f)},[f]),{containerRef:a,stuckStatus:r,containerWidth:o}}function Ti(t=100){const e=Ce(),[a,r]=p.useState({width:e?window.innerWidth:void 0,height:e?window.innerHeight:void 0});return p.useEffect(()=>{let i=!0;if(!e)return()=>{};const o=Ot(()=>{i&&r({width:window.innerWidth,height:window.innerHeight})},t);return window.addEventListener("resize",o),()=>{i=!1,o.cancel(),window.removeEventListener("resize",o)}},[t,e]),a}function mu({name:t,id:e,creative:a,refForIntersection:r=null,position:i}){const[o,l]=p.useState(!1),{enableGaForPromotionView:c}=es(),d=Ja(!o,r),u=wi({name:t,id:e,creative:a,position:i});if(c&&!o&&Ba(u)&&d&&(t||e)){try{Ke({event:yi({promotion_name:t,promotions:[u]})})}catch(f){console.error(f)}l(!0)}return null}const fu={xs:16,sm:24,md:32,lg:48,xl:64};function Le({size:t="xl",isCentered:e=!0,isSpinning:a=!0,isFullscreen:r,onComplete:i,color:o="default",screenReaderText:l="Content is loading"}){const c=p.useRef(null),d=typeof t=="number"?t:fu[t],u=()=>{i&&i()},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:R("sarsa-spinner-outer-container",{"is-centered":e,"is-fullscreen":r}),children:s.jsx(ma,{classNames:"sarsa-spinner",appear:!0,in:a,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:R("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})]})})})}Le.propTypes={size:n.oneOfType([n.oneOf(["xs","sm","md","lg","xl"]),n.number]),isCentered:n.bool,isSpinning:n.bool,onComplete:n.func,color:n.oneOf(["default","inverted","brand","subtle","danger"]),screenReaderText:n.string};const M=p.forwardRef((t,e)=>{const{children:a,type:r="button",appearance:i="primary",isUnstyled:o,size:l="md",isLoading:c,isDisabled:d,iconBeforeElement:u,iconAfterElement:f,screenReaderTextBefore:g,screenReaderTextAfter:h,shouldFitContainer:m,shouldFocusOnMount:b,onClick:x,className:w,innerRef:v,clickTagCategory:C,clickTagAction:y,clickTagLabel:N,gaReportName:T,gaReportCreative:j,gaReportPosition:S,shouldReportToGA:k,gaTrackingId:_,gaTrackingValue:I,...P}=t,B=p.useRef(null),W=Vs(e,B,v),D=p.useRef(null);p.useEffect(()=>{const K=setTimeout(()=>{b&&B.current?.focus()},0);return()=>{clearTimeout(K)}},[b]);const E=()=>{const{to:K,href:F}=P;return typeof K=="string"&&K.length||typeof K=="object"&&Object.keys(K).length>0||typeof K=="function"?xr:typeof F=="string"&&F.length?"a":"button"},V=()=>{const{to:K,href:F}=P;return typeof K=="function"||typeof K=="string"&&K.length||typeof K=="object"&&Object.keys(K).length>0||typeof F=="string"&&F.length?null:r},X=K=>{C&&y&&N&&ze({category:C,action:y,label:N},()=>{}),T&&j&&S&&Ke({event:Za({promotion_name:T,promotions:[wi({name:T,creative:j,position:S})]})}),!(c||d)&&x&&x(K)},Z=E(),G=Z==="button",J=!!(u&&!f&&!a||!u&&f&&!a),z=J?null:" ",se=R(`sarsa-button sarsa-button-${i} sarsa-button-${l}`,w,{"sarsa-button-fit-container":m,"sarsa-button-is-loading":c,"sarsa-button-disabled":d});let q;switch(i){case"tertiary":case"link":q="brand";break;case"tertiary-alt":case"subtle":case"pill":q="subtle";break;case"subtle-danger":case"tertiary-danger":q="danger";break;default:q="inverted"}let L;switch(l){case"lg":L=24;break;case"md":L=20;break;case"sm":case"xs":L=16;break;case"xxs":L=12;break;default:L=20}const H=s.jsxs(Z,{"data-component":"Button",ref:W,type:V(),disabled:G?d:void 0,className:se,onClick:X,"data-ga-tracking-id":_,"data-ga-tracking-value":I,...P,children:[c&&s.jsx("span",{className:"sarsa-button-spinner-wrapper",children:s.jsx(Le,{isSpinning:c,size:L,color:q})}),s.jsxs("span",{className:R("sarsa-button-inner-wrapper",{"is-loading":c}),children:[u&&s.jsx("span",{"aria-hidden":"true",className:R("sarsa-button-icon-content","left-icon",{"is-only-child":J}),children:u}),s.jsxs("span",{className:"sarsa-button-content",children:[g&&s.jsxs("span",{className:"rec-sr-only",children:[g,z]}),a,h&&s.jsxs("span",{className:"rec-sr-only",children:[z,h]})]}),f&&s.jsx("span",{"aria-hidden":"true",className:R("sarsa-button-icon-content","right-icon",{"is-only-child":J}),children:f})]})]}),Q=s.jsx(Z,{"data-component":"Button",className:w,ref:W,type:V(),disabled:d,onClick:X,"data-ga-tracking-id":_,"data-ga-tracking-value":I,...P,children:s.jsxs(s.Fragment,{children:[g&&s.jsxs("span",{className:"rec-sr-only",children:[g,z]}),a,h&&s.jsxs("span",{className:"rec-sr-only",children:[z,h]})]})});return s.jsxs(s.Fragment,{children:[k&&T?s.jsx("div",{ref:D,children:s.jsx(mu,{name:T,creative:j,position:S,refForIntersection:D})}):null,o?Q:H]})});function et({children:t,isFullWidthOnMobile:e=!0,align:a="left",isStretchedToFit:r,isStacked:i,isToggleStyle:o,buttonMargin:l=2,className:c,...d}){const u=R("sarsa-button-group",{"is-full-width-on-mobile":e,"align-right":a==="right","align-center":a==="center","is-stretched-to-fit":r,"is-stacked":i,"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 re({appearance:t="h3",headingLevel:e=2,hasUnderline:a,underlineColor:r,headingAlign:i,children:o,className:l,...c}){const d=`h${e}`,u=R(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":i==="left","sarsa-heading-align-center":i==="center","sarsa-heading-align-right":i==="right","sarsa-has-underline-left":a==="left","sarsa-has-underline-center":a==="center","sarsa-underline-color-brand-02":r==="brand-02","sarsa-underline-color-brand-03":r==="brand-03","sarsa-underline-color-secondary-02":r==="secondary-02"});return s.jsx(d,{"data-component":"Heading",className:u,...c,children:o})}re.propTypes={appearance:n.oneOf(["display","title","h1","h2","h3","h4","h5","h5Caps","h6","small"]),headingLevel:n.oneOf([1,2,3,4,5,6]).isRequired,headingAlign:n.oneOf(["left","center","right"]),hasUnderline:n.oneOf(["left","center"]),underlineColor:n.oneOf(["brand-02","brand-03","secondary-02"]),children:n.node.isRequired,className:n.string};function dt({isOpen:t=!1,heading:e,children:a,onRequestClose:r=()=>{},size:i="md",shouldCloseOnOverlayClick:o=!0,shouldShowCloseButton:l=!0,shouldCloseOnEsc:c=!0,shouldActionsStickInMobile:d=!1,overlayClassName:u,clickTagCategoryForCloseButton:f,clickTagActionForCloseButton:g,clickTagLabelForCloseButton:h,gaTrackingId:m,translateHeading:b="no",...x}){p.useLayoutEffect(()=>{document.getElementById("recApp")&&Fe.setAppElement("#recApp")},[]),Oa({isDisabled:!t});const w=v=>{v?.preventDefault&&v.preventDefault(),r&&r()};return s.jsx(Fe,{isOpen:t,onRequestClose:r,shouldCloseOnOverlayClick:o,shouldCloseOnEsc:o===!1?!1:c,aria:{labelledby:"modal-heading"},overlayClassName:{base:R("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:R("sarsa-modal-content-sizer",{"sarsa-modal-size-sm":i==="sm","sarsa-modal-size-md":i==="md","sarsa-modal-size-lg":i==="lg","sarsa-modal-size-xl":i==="xl","sarsa-modal-size-xxl":i==="xxl","sarsa-modal-size-full":i==="full"}),children:s.jsx("div",{className:"sarsa-modal-content",children:s.jsxs("div",{className:R("sarsa-modal-content-body",{full:i==="full","sticky-actions":d}),children:[l&&s.jsx(M,{className:"sarsa-modal-close-button",appearance:"subtle",size:i==="full"?"lg":"md","aria-label":"Close modal",iconBeforeElement:s.jsx(A,{iconName:"close"}),onClick:w,clickTagCategory:f,clickTagAction:g,clickTagLabel:h,"data-ga-tracking-id":m}),e&&s.jsx(re,{id:"modal-heading",headingLevel:1,appearance:"h4",className:"sarsa-modal-heading",translate:b,children:e}),a]})})})})})})}function ot({children:t}){return s.jsx("div",{"data-component":"ModalActions",className:"sarsa-modal-actions",children:t})}function gu({isOpen:t,onModalCancel:e,onModalContinue:a,gaTrackingIdCancelButton:r,gaTrackingIdContinueButton:i,parentSelector:o}){return s.jsxs(dt,{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(ot,{children:s.jsxs(et,{isFullWidthOnMobile:!1,isStretchedToFit:!0,children:[s.jsx(M,{appearance:"tertiary",onClick:e,gaTrackingId:r,children:"Cancel"}),s.jsx(M,{onClick:a,gaTrackingId:i,children:"Continue to External Web Site"})]})})]})}function Xa({className:t,hasExternalIcon:e=!0,url:a,children:r,gtmDataId:i,clickTagCategory:o,clickTagAction:l,clickTagLabel:c,gaTrackingId:d,gaTrackingIdContinueButton:u,gaTrackingIdCancelButton:f,parentSelector:g,"aria-label":h,onClick:m}){const[b,x]=p.useState(!1),w=y=>{y.preventDefault(),x(!0),m&&m(y)},v=()=>{x(!1)},C=()=>{Object.assign(document.createElement("a"),{target:"_blank",href:a,rel:"noopener noreferrer"}).click(),o&&l&&c&&ze({category:o,action:l,label:c},()=>{}),x(!1)};return s.jsxs(s.Fragment,{children:[s.jsx("a",{className:R(t,{"sarsa-button-external-link":!e}),href:a,target:"_blank",rel:"noopener noreferrer",onClick:w,"data-gtmclick":i,"aria-label":h,"data-ga-tracking-id":d,children:r}),s.jsx(gu,{isOpen:b,onModalCancel:v,onModalContinue:C,gaTrackingIdCancelButton:f,gaTrackingIdContinueButton:u,parentSelector:g})]})}var bu=["recreation.gov","help.recreation.gov","help.r1s-test.com","help.r1s-dev.com"];const An=bu||[];let gt=0;function Ri(t){if(!t||typeof t!="string")return!1;for(let e=0;e`https://cdn.recreation.gov/${c}.pdf`);const i=t;return i.attribs.rel="noopener noreferrer",i.attribs.target="_blank",i.attribs.target="_blank",i.attribs.href=a,Xe(i,e,ws)}return t.children&&t.children[0]?s.jsx(Xa,{url:a,children:Xe(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 a={...t};return t.name==="font"&&(a.name="span"),delete a.attribs.style,delete a.attribs.color,Xe(a,gt,ws)}}function Cs(t){gt+=1;const e=gt;if(t.type==="text"&&!t.parent)return s.jsx("span",{children:Xe(t,e,Cs)});if(t.type==="tag"&&t.name==="br")return" ";if(t.type==="tag"&&t.name==="a"){let a=t.attribs.href;if(Ri(a)){const r=Or("recreation.gov");a=a.replace(new RegExp(`(.*?).${r}/(.*?).pdf`),(o,l,c)=>`https://cdn.recreation.gov/${c}.pdf`);const i=t;return i.attribs.rel="noopener noreferrer",i.attribs.target="_blank",i.attribs.href=a,Xe(i,e,Cs)}return t.children&&t.children[0]?s.jsx(Xa,{url:a,children:Xe(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 a={...t};return t.name==="font"&&(a.name="span"),delete a.attribs.style,delete a.attribs.color,Xe(a,gt,Cs)}}function kt({html:t,shouldConvertImageSrcToHttps:e=!0,headingLevel:a,headingAppearance:r}){if(typeof t!="string")return null;gt=0;let i=yr.sanitize(t);return e&&(i=i.split('src="http://').join('src="https://')),a&&(i=i.replace(/(<\/?h)(\d)\b/g,`$1${a}`)),r&&(i=i.replace(/")||t.includes("
")?s.jsx("div",{"data-component":"DisplayHtmlContent",children:fa(i,{replace:l=>l?.type?ws(l):null})}):s.jsx("div",{"data-component":"DisplayHtmlContent",className:"rec-display-html-content",children:fa(i,{replace:l=>l?.type?Cs(l):null})})}kt.propTypes={html:n.string,shouldConvertImageSrcToHttps:n.bool,headingLevel:n.oneOf([1,2,3,4,5,6]),headingAppearance:n.oneOf(["display","h1","h2","h3","h4","h5","h6"])};function Bs({className:t,"aria-label":e,isHidden:a,tabIndex:r,...i}){const o=p.useRef(null),{buttonProps:l}=As(i,o);return s.jsx("button",{"data-component":"InputClearButton",...l,type:"button",ref:o,className:R(t,{hidden:a}),"aria-label":e??"Clear input",tabIndex:r,children:s.jsx(A,{className:"button-icon x-icon",iconName:"close"})})}function Ve({children:t,className:e,isFloating:a,...r}){return s.jsx("div",{"aria-live":"polite",...r,children:t?s.jsx("div",{className:a?"sarsa-field-error-message-outer":void 0,children:s.jsxs("div",{className:R("sarsa-field-error-message",e,{floating:a}),children:[s.jsx("span",{className:"req","aria-hidden":"true",children:"*"})," ",t]})}):null})}function Hs({children:t,className:e,isRequired:a=!1,isVisible:r=!0,includeBottomMargin:i=!1,...o}){return s.jsxs("div",{"data-component":"FauxLabel",className:R("sarsa-label",e,{"rec-sr-only":!r,"sarsa-label-required":a,"bottom-margin":i&&r}),...o,children:[t,a&&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 vu={children:n.node.isRequired,htmlFor:n.string.isRequired,isRequired:n.bool,isVisible:n.bool,className:n.string};function ut({children:t,htmlFor:e,className:a,isRequired:r=!1,isVisible:i=!0,id:o,...l}){const c=R("sarsa-label",a,{"rec-sr-only":!i,"sarsa-label-required":r});return s.jsxs("label",{"data-component":"Label",id:o||`${e}-label`,className:c,htmlFor:e,...l,children:[t,r&&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) "})]})]})}ut.propTypes=vu;const xu={children:n.node.isRequired,isRequired:n.bool,className:n.string,isAriaHidden:n.bool};function Qa({children:t,className:e,isRequired:a=!1,isAriaHidden:r=!0,isVisible:i=!0,...o}){return i?s.jsxs("div",{"data-component":"VisualOnlyLabel","aria-hidden":r?"true":void 0,className:R("sarsa-label",e),...o,children:[t,a&&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=xu;const Ii=p.createContext(void 0);function yu({descriptionProps:t,labelProps:e,children:a}){const r=p.useMemo(()=>({descriptionProps:t,labelProps:e}),[t,e]);return s.jsx(Ii.Provider,{value:r,children:a})}function Ei(){const t=p.useContext(Ii);if(t===void 0)throw new Error("ItemContext must be within ItemProvider");return t}function wu(t){const e=p.useRef(null),{listBoxRef:a=e,state:r}=t,{listBoxProps:i}=Ko(t,r,a);return s.jsx("ul",{...i,ref:a,className:"sarsa--autosuggest-listbox",children:[...r.collection].map(o=>o.type==="section"?s.jsx(Cu,{section:o,state:r,onSelect:t.onSelect},o.key):s.jsx(ki,{item:o,state:r,onPressUp:()=>t?.onSelect?.(o.key)},o.key))})}function Cu({section:t,state:e,onSelect:a}){const{itemProps:r,headingProps:i,groupProps:o}=Yo({heading:t.rendered,"aria-label":t["aria-label"]});return s.jsxs("li",{...r,className:"sarsa--autosuggest-listbox-section",children:[t.rendered&&s.jsx("div",{...i,className:"section-title",children:t.rendered}),s.jsx("ul",{...o,children:[...t.childNodes].map(l=>s.jsx(ki,{item:l,state:e,onPressUp:()=>a?.(l.key)},l.key))})]})}function ki({item:t,state:e,onPressUp:a}){const r=p.useRef(null),{optionProps:i,isDisabled:o,isSelected:l,isFocused:c,labelProps:d,descriptionProps:u}=Zo({key:t.key},e,r);p.useEffect(()=>{r.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}=Jo({onPressUp:a});return s.jsx("li",{children:s.jsx(f,{...Mt(i,g),ref:r,className:R("sarsa--autosuggest-listbox-option",{focused:c,selected:l,disabled:o}),children:s.jsx(yu,{descriptionProps:u,labelProps:d,children:t.rendered})})})}const Bt=new WeakMap,Pe=[];function Su(t,e=document.body){const a=new Set(t),r=new Set,i=d=>{for(const h of d.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))a.add(h);const u=h=>{if(a.has(h)||r.has(h.parentElement)&&h.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const m of a)if(h.contains(m))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=Bt.get(d)??0;d.getAttribute("aria-hidden")==="true"&&u===0||(u===0&&d.setAttribute("aria-hidden","true"),r.add(d),Bt.set(d,u+1))};Pe.length&&Pe[Pe.length-1].disconnect(),i(e);const l=new MutationObserver(d=>{for(const u of d)if(!(u.type!=="childList"||u.addedNodes.length===0)&&![...a,...r].some(f=>f.contains(u.target))){for(const f of u.removedNodes)f instanceof Element&&(a.delete(f),r.delete(f));for(const f of u.addedNodes)(f instanceof HTMLElement||f instanceof SVGElement)&&(f.dataset.liveAnnouncer==="true"||f.dataset.reactAriaTopLayer==="true")?a.add(f):f instanceof Element&&i(f)}});l.observe(e,{childList:!0,subtree:!0});const c={observe(){l.observe(e,{childList:!0,subtree:!0})},disconnect(){l.disconnect()}};return Pe.push(c),()=>{l.disconnect();for(const d of r){const u=Bt.get(d);u===1?(d.removeAttribute("aria-hidden"),Bt.delete(d)):typeof u=="number"&&Bt.set(d,u-1)}c===Pe[Pe.length-1]?(Pe.pop(),Pe.length&&Pe[Pe.length-1].observe()):Pe.splice(Pe.indexOf(c),1)}}function Ca(t,e=-1/0,a=1/0){return Math.min(Math.max(t,e),a)}function _i(t){let e=null;return()=>(e==null&&(e=t()),e)}function Ai(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 Nu=_i(()=>Ai(/Chrome/i)),ju=_i(()=>Ai(/AppleWebKit/i)&&!Nu()),Rt={top:"top",bottom:"top",left:"left",right:"left"},js={top:"bottom",bottom:"top",left:"right",right:"left"},Tu={top:"left",left:"top"},Sa={top:"height",left:"width"},Li={width:"totalWidth",height:"totalHeight"},fs={},nt=typeof document<"u"&&window.visualViewport;function Ln(t){let e=0,a=0,r=0,i=0,o=0,l=0;const c={},d=nt?.scale>1;if(t.tagName==="BODY"){const u=document.documentElement;r=u.clientWidth,i=u.clientHeight,e=nt?.width??r,a=nt?.height??i,c.top=u.scrollTop||t.scrollTop,c.left=u.scrollLeft||t.scrollLeft,nt&&(o=nt.offsetTop,l=nt.offsetLeft)}else({width:e,height:a,top:o,left:l}=Et(t)),c.top=t.scrollTop,c.left=t.scrollLeft,r=e,i=a;return ju()&&(t.tagName==="BODY"||t.tagName==="HTML")&&d&&(c.top=0,c.left=0,o=nt.pageTop,l=nt.pageLeft),{width:e,height:a,totalWidth:r,totalHeight:i,scroll:c,top:o,left:l}}function Ru(t){return{top:t.scrollTop,left:t.scrollLeft,width:t.scrollWidth,height:t.scrollHeight}}function Pn(t,e,a,r,i,o,l){const c=i.scroll[t],d=r[Sa[t]],u=r.scroll[Rt[t]]+o,f=d+r.scroll[Rt[t]]-o,g=e-c+l[t]-r[Rt[t]],h=e-c+a+l[t]-r[Rt[t]];return gf?Math.max(f-h,u-g):0}function Iu(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(fs[t])return fs[t];let[e,a]=t.split(" ");const r=Rt[e]||"right",i=Tu[r];Rt[a]||(a="center");const o=Sa[r],l=Sa[i];return fs[t]={placement:e,crossPlacement:a,axis:r,crossAxis:i,size:o,crossSize:l},fs[t]}function la(t,e,a,r,i,o,l,c,d,u){const{placement:f,crossPlacement:g,axis:h,crossAxis:m,size:b,crossSize:x}=r,w={};w[m]=t[m],g==="center"?w[m]+=(t[x]-a[x])/2:g!==m&&(w[m]+=t[x]-a[x]),w[m]+=o;const v=t[m]-a[x]+d+u,C=t[m]+t[x]-d-u;if(w[m]=Ca(w[m],v,C),f===h){const y=c?l[b]:e[Li[b]];w[js[h]]=Math.floor(y-t[h]+i)}else w[h]=Math.floor(t[h]+t[b]+i);return w}function Eu(t,e,a,r,i,o,l,c){const d=r?a.height:e[Li.height],u=t.top!=null?a.top+t.top:a.top+(d-t.bottom-l),f=c!=="top"?Math.max(0,e.height+e.top+e.scroll.top-u-(i.top+i.bottom+o)):Math.max(0,u+l-(e.top+e.scroll.top)-(i.top+i.bottom+o));return Math.min(e.height-o*2,f)}function On(t,e,a,r,i,o){const{placement:l,axis:c,size:d}=o;return l===c?Math.max(0,a[c]-t[c]-t.scroll[c]+e[c]-r[c]-r[js[c]]-i):Math.max(0,t[d]+t[c]+t.scroll[c]-e[c]-a[c]-a[d]-r[c]-r[js[c]]-i)}function ku(t,e,a,r,i,o,l,c,d,u,f,g,h,m,b,x){let w=Mn(t);const{size:v,crossAxis:C,crossSize:y,placement:N,crossPlacement:T}=w;let j=la(e,c,a,w,f,g,u,h,b,x),S=f;const k=On(c,u,e,i,o+f,w);if(l&&r[v]>k){const G=Mn(`${js[N]} ${T}`),J=la(e,c,a,G,f,g,u,h,b,x);On(c,u,e,i,o+f,G)>k&&(w=G,j=J,S=f)}let _="bottom";w.axis==="top"?w.placement==="top"?_="top":w.placement==="bottom"&&(_="bottom"):w.crossAxis==="top"&&(w.crossPlacement==="top"?_="bottom":w.crossPlacement==="bottom"&&(_="top"));let I=Pn(C,j[C],a[y],c,d,o,u);j[C]+=I;let P=Eu(j,c,u,h,i,o,a.height,_);m&&m{const i=e?.current;if(!i)return()=>{};if(!Lu())return window.addEventListener("resize",r,!1),()=>{window.removeEventListener("resize",r,!1)};const o=new window.ResizeObserver(Ot(l=>{l.length&&r()},100));return o.observe(i,{box:a}),()=>{i&&o.unobserve(i)}},[r,e,a])}const mt=typeof document<"u"&&window.visualViewport;function Pu(t){const{direction:e}=tt(),{arrowSize:a=0,targetRef:r,overlayRef:i,scrollRef:o=i,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:m=!0,maxHeight:b,arrowBoundaryOffset:x=0,updateOnScroll:w=!0}=t,[v,C]=p.useState({position:{},arrowOffsetLeft:void 0,arrowOffsetTop:void 0,maxHeight:void 0,placement:void 0}),y=[h,l,i.current,r.current,o.current,c,d,u,f,g,m,e,b,x,a],N=p.useRef(mt?.scale);p.useEffect(()=>{m&&(N.current=mt?.scale)},[m]);const T=p.useCallback(()=>{if(h===!1||!m||!i.current||!r.current||!u||mt?.scale!==N.current)return;let S=null;if(o.current&&o.current.contains(document.activeElement)){const I=document.activeElement?.getBoundingClientRect(),P=o.current.getBoundingClientRect();I&&(S={type:"top",offset:I.top-P.top},S.offset>P.height/2&&(S.type="bottom",S.offset=I.bottom-P.bottom))}const k=i.current;!b&&i.current&&(k.style.top="0px",k.style.bottom="",k.style.maxHeight=`${window.visualViewport?.height??window.innerHeight}px`);const _=_u({placement:Ou(l,e),overlayNode:i.current,targetNode:r.current,scrollNode:o.current||i.current,padding:c,shouldFlip:d,boundaryElement:u,offset:f,crossOffset:g,maxHeight:b,arrowSize:a,arrowBoundaryOffset:x});if(k.style.top="",k.style.bottom="",k.style.left="",k.style.right="",Object.keys(_.position).forEach(I=>{k.style[I]=`${_.position[I]}px`}),k.style.maxHeight=_.maxHeight!=null?`${_.maxHeight}px`:void 0,S&&document.activeElement&&o.current){const I=document.activeElement.getBoundingClientRect(),P=o.current.getBoundingClientRect(),B=I[S.type]-P[S.type];o.current.scrollTop+=B-S.offset}C(_)},y);p.useEffect(()=>{const S=st(T,50);return w&&document.addEventListener("scroll",S),()=>{document.removeEventListener("scroll",S)}},[w,T]),p.useLayoutEffect(T,y),Mu(T),Fn({ref:i,onResize:T}),Fn({ref:r,onResize:T});const j=p.useRef(!1);return p.useLayoutEffect(()=>{let S;const k=()=>{j.current=!0,clearTimeout(S),S=setTimeout(()=>{j.current=!1},500),T()},_=()=>{j.current&&k(),T()};return mt?.addEventListener("resize",k),mt?.addEventListener("scroll",_),()=>{mt?.removeEventListener("resize",k),mt?.removeEventListener("scroll",_)}},[T]),{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:T}}function Mu(t){p.useLayoutEffect(()=>(window.addEventListener("resize",t,!1),()=>{window.removeEventListener("resize",t,!1)}),[t])}function Ou(t,e){return e==="rtl"?t.replace("start","right").replace("end","left"):t.replace("start","left").replace("end","right")}function $u(t,e){const{triggerRef:a,popoverRef:r,isNonModal:i,isKeyboardDismissDisabled:o,shouldCloseOnInteractOutside:l,...c}=t,{overlayProps:d,underlayProps:u}=wr({isOpen:e.isOpen,onClose:e.close,shouldCloseOnBlur:!0,isDismissable:!i,isKeyboardDismissDisabled:o,shouldCloseOnInteractOutside:l},r),{overlayProps:f,arrowProps:g,placement:h}=Pu({...c,targetRef:a,overlayRef:r,isOpen:e.isOpen,onClose:i?e.close:void 0});return p.useLayoutEffect(()=>e.isOpen&&!i&&r.current?Su([r.current]):()=>{},[i,e.isOpen,r]),{popoverProps:Mt(d,f),arrowProps:g,underlayProps:u,placement:h}}function Du({children:t,state:e,className:a,...r}){const{popoverProps:i}=$u(r,e);return s.jsxs("div",{...i,ref:r.popoverRef,className:R("sarsa--autosuggest-popover",a),children:[t,s.jsx(Xo,{onDismiss:e.close})]})}function Fu(t){const{iconBeforeElement:e=s.jsx(A,{iconName:"search"}),isLabelVisible:a=!0,size:r="md",onClear:i,allowsEmptyCollection:o,popupClassName:l,updateOnScroll:c,maxPopupHeight:d,onSelectionChange:u,onSelect:f,hasFloatingError:g,className:h,shouldPopoverFlip:m=!0,...b}=t,x=p.useRef(null),w=q=>{u?.(q),x.current=q},v=p.cloneElement(e,{"aria-hidden":"true",size:"md"}),{contains:C}=Qo({sensitivity:"base"}),y=el({...b,onSelectionChange:w,defaultFilter:C,allowsEmptyCollection:o}),N=p.useRef(null),T=p.useRef(null),j=p.useRef(null),S=q=>{if(q){const[...H]=t.defaultItems||t.items||[],Q=H.find(K=>K?.id===q||K?.key===q);f?.(q,Q),x.current=null;return}const L=N.current?.form;if(L&&b.allowsCustomValue&&y.isOpen){const H=new Event("submit",{cancelable:!0,bubbles:!0});L.dispatchEvent(H)}},k=()=>{i?i():y.setInputValue("")},_=q=>{(q.key==="Enter"||q.key===" ")&&(q.preventDefault(),k(),N.current?.focus())},I=q=>{switch(t.onKeyDown?.(q),q.key){case"Enter":{S(x.current);break}case"Escape":{q.continuePropagation(),y.isOpen?y.close():(k(),N.current?.focus());break}}},{inputProps:P,listBoxProps:B,labelProps:W,isInvalid:D,validationErrors:E}=tl({...b,onKeyDown:I,onSelectionChange:w,inputRef:N,listBoxRef:T,popoverRef:j},y),V={label:t.label,value:y.inputValue,onChange:q=>y.setInputValue(q),onClear:k,id:t.id},X=sl(V),{clearButtonProps:Z,labelProps:G}=al(V,X,N),J=p.useRef(null),z=D||!!t.errorMessage||E.length>0,se=`${P.id}-error`;return s.jsxs("div",{"data-component":"Autosuggest",className:h,children:[s.jsx("div",{className:"sarsa-field-label-wrapper",children:s.jsx(ut,{...Mt(W,G),htmlFor:P.id,isVisible:a,isRequired:t.isRequired,children:t.label})}),s.jsxs("div",{ref:J,className:R("autosuggest-input-wrapper",!a&&"no-label"),children:[s.jsx("span",{className:`autosuggest-search-icon search-icon-${r}`,children:v}),s.jsx("input",{...P,ref:N,className:R(`autosuggest-text-input autosuggest-text-input-${r}`,{"is-invalid":D}),"aria-describedby":z?"errorId":P["aria-describedby"]}),s.jsx("span",{className:`autosuggest-clear-btn-wrapper clear-btn-wrapper-${r}`,children:s.jsx(Bs,{...Z,excludeFromTabOrder:!1,isHidden:!y.inputValue,onKeyDown:_})})]}),t.errorMessage||E.length>0?s.jsx(Ve,{isFloating:g,id:se,children:t.errorMessage||E[0]}):null,y.isOpen&&s.jsx(Du,{shouldFlip:m,popoverRef:j,triggerRef:J,state:y,placement:"bottom left",isNonModal:!0,updateOnScroll:c,maxHeight:d,className:R(l,o&&t.items&&![...t.items].length&&"autosuggest-popup-border-none"),children:s.jsx(wu,{...B,listBoxRef:T,state:y,onSelect:S})})]})}const Ts="product_view_ga_url",Vu=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}},Bu=(t,e)=>{const a=e?.length?Number(e?.[e.length-1]?.split("?")?.[0]):void 0,r=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(a))return`${a}`;if(e?.length===4&&e[3].includes("detailed-availability")&&!Number.isNaN(r))return`${r}`;break;case"TICKET":if(e?.length===4&&!Number.isNaN(a)&&!Number.isNaN(r))return`${r}|${a}`;break;case"TIMED_ENTRY":if(e?.length===4&&!Number.isNaN(a)&&!Number.isNaN(r))return`${r}|${a}`;break;case"TREE_PERMIT":if(e?.length===2)return`${e?.[1]?.split("?")?.[0]}`;break;case"VEHICLE_PERMIT":if(e?.length===2&&!Number.isNaN(a))return`${a}`;break;default:return null}return null},Vn=(t,e,a)=>{const r=t?.split("/");r.shift();const i=Vu(r?.[0]);if(i){const o=Bu(i,r);if(o){const c=[Fs({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:i,quantity:void 0,price:void 0})||{}];Ke({event:wa({product_name:void 0,product_price:null,product_list_name:null,items:c}),shouldEnqueueWork:e})}sessionStorage.setItem(Ts,window?.location?.href||"")}else a?.length&&(Ke({event:wa({product_name:void 0,product_price:null,product_list_name:null,items:a}),shouldEnqueueWork:e}),sessionStorage.setItem(Ts,window?.location?.href||""))};function Qb({checkForIntersection:t=!1,refForIntersection:e,productsToReportManually:a,shouldEnqueueWork:r=!1}){const[i,o]=p.useState(!1),c=Ja(t&&!o,e),{enableGaForProductView:d}=es(),u=window.location?.pathname?.split("?")?.[0];if(d&&!i)try{const f=!!window?.dataLayer&&u&&!t,g=t&&e?.current&&c&&!!window?.dataLayer;(f||g)&&(Vn(u,r,a),o(!0))}catch(f){console.error("Caught error that needs to be piped to error reporting mechanic",f),o(!0)}return null}const Us="cart_ga_data",_t="cart_ga_remove_from_cart",Na=()=>{localStorage.setItem(Us,JSON.stringify({reservations:{}})),sessionStorage.removeItem(Ts),sessionStorage.removeItem(_t)};function Bn(t="",e=0){const a=t.split("|");return a.length===1?t:a.length>0?e===1&&!a[e]?a[0]:a[e]:t}const Hu=t=>{let e=t?.order_details?.location_id;const a=t?.inventory_type;if(a)switch(a){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:a}},Uu=t=>{let e=parseInt(t?.quantity||0,10);e||(e=t?.cart_line_items?.filter(l=>mc(l.quantity))?.reduce((l,c)=>({quantity:l.quantity+c.quantity}))?.quantity||1);const a=parseFloat(parseFloat(t.discount).toFixed(2)),r=parseFloat(parseFloat(t.subtotal).toFixed(2)),i=parseFloat(parseFloat(((r-a)/e).toFixed(2))),{productId:o}=Hu(t);return Fs({name:t?.inventory_type==="POS"?t?.order_details?.name:t?.order_details?.description,facility_id:Bn(o,0),location_id:Bn(o,1),quantity:e,price:i})},Pi=(t,e,a)=>(a?delete e.reservations[t.reservation_id]:e.reservations[t.reservation_id]=$r(t),Uu(t)),qu=(t,e,a)=>{if(_e(a?.reservations)||Object.keys(a?.reservations).length!==e?.reservations?.length){const r=e?.reservations?.map(i=>a.reservations?.[i?.reservation_id]?null:Pi(i,a,!1)).filter(i=>!_e(i));r?.length&&(a.ttl=Cr(e.expiration,1),localStorage.setItem(Us,JSON.stringify(a)),Ke({event:Ya({product_name:r?.[0]?.name,items:r,real_path:t,isAdding:!0})}))}},Gu=(t,e,a)=>{if((!_e(a?.reservations)||Object.keys(a?.reservations).length!==e?.reservations?.length)&&sessionStorage.getItem(_t)){const r=Object.fromEntries(e?.reservations?.map(o=>[o?.reservation_id,!0])),i=Object.values(a.reservations)?.map(o=>r?.[o?.reservation_id]?null:Pi(o,a,!0)).filter(o=>!_e(o));i?.length&&(e?.reservations?.length?(a.ttl=Cr(e.expiration,1),localStorage.setItem(Us,JSON.stringify(a))):Na(),Ke({event:Ya({product_name:i?.[0]?.name,items:i,real_path:t,isAdding:!1})}),sessionStorage.removeItem(_t))}},zu=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")),Wu=t=>!!(t?.split("/")?.length===1||t?.endsWith("/cart/")||t?.endsWith("/cart")||t?.includes("/camping/campgrounds")),Ku=t=>t?.includes("/cart/confirmation"),Yu=t=>Pa(t?.ttl,new Date),Zu=()=>sessionStorage.getItem(Ts)||window?.location?.href||"",Ju=()=>sessionStorage.getItem(_t)||window?.location?.href||"";function ev(){const[t,e]=p.useState(!1),[a,r]=p.useState(!1),{enableGaForCartActions:i}=es(),o=window.location?.pathname?.split("?")?.[0],l=pe(u=>u?.cart),c=l?.reservation_count===l?.reservations?.length;if(!i||!c)return null;let d=!1;if(sessionStorage.getItem(_t)&&!a?(r(!0),e(!1),d=!0):sessionStorage.getItem(_t)&&a&&Na(),!t||d)try{const u=JSON.parse(localStorage.getItem(Us))||{reservations:{}},f=$r(l);if(!_e(f)&&f?.reservations?.length||(_e(f)||!f?.reservations?.length)&&!_e(u?.reservations))if(Ku(o)||u?.ttl&&Yu(u))Na(),e(!0);else{let g=!1;f?.reservations?.length&&zu(o)&&(qu(Zu(),f,u),g=!0),Wu(o)&&(Gu(Ju(),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 qs(t){return t.parent_name!==void 0}function We(t){return t.is_inventory!==void 0}function Hn(t){return t.lat!==void 0}function vt(t){return t.last_used!==void 0}function en(t){return t.is_merchandise!==void 0}function Rs(t){return qs(t)||We(t)||en(t)||vt(t)}const Xu=t=>{const e={id:Rs(t)&&t?.entity_id?t.entity_id:"",name:t?.name||"",position:t?.idx||0};return Rs(t)&&(!t?.entity_type||!t?.entity_id)?{}:{suggestionItem:e}};function Qu({refForIntersection:t=void 0,reportOnMount:e=!1,shouldEnqueueWork:a=!1,suggestion:r=void 0,id:i="",name:o="",list_name:l="",brand:c="Recreation.gov",position:d=0,variant:u,list:f=""}){const[g,h]=p.useState(!1),m=Ja(!h,t),{enableGaForImpressionView:b}=es();if(b&&!g){let x;try{if(r&&(x=Xu(r)),x){const w=t?.current&&m&&!!window?.dataLayer;(e||w)&&(Ke({event:Od({list_name:l,impressions:[Fd({id:i,name:o,brand:c,position:d,variant:u,list:f})]}),shouldEnqueueWork:a}),h(!0))}}catch(w){console.error("Caught error that needs to be piped to error reporting mechanic",w),h(!0)}}return null}function eh({suggestion:t}){const{descriptionProps:e}=Ei(),r=(qs(t)||We(t))&&t.parent_name,i=(vt(t)||We(t))&&t.entity_type&&t.city&&t.state_code;return s.jsxs("div",{className:"sarsa-location-suggestion-subtitle","data-testid":"suggestion-subtitle",...e,children:[r&&s.jsx("span",{children:t.parent_name}),i&&s.jsx("span",{children:`${r?" | ":""}Near ${t.city}, ${t.state_code}`})]})}function Ae({name:t,tagIconName:e,iconClass:a,className:r,size:i="md",isSpanItem:o=!1,isInverse:l=!1,hasText:c=!1}){const d=R("rec-inventory-tag",r,{"rec-inventory-tag-sm":i==="sm","rec-inventory-tag-md":i==="md","rec-inventory-tag-lg":i==="lg","rec-inventory-tag-is-inverse":l}),u=o?"span":"li";return s.jsxs(u,{className:R(`${d} rec-${a}-tag${c?"-has-text":""}`),children:[e,c?t:""]},t)}Ae.propTypes={name:n.string.isRequired,tagIconName:n.node.isRequired,iconClass:n.string.isRequired,hasText:n.bool,isSpanItem:n.bool,size:n.oneOf(["sm","md","lg"]),isInverse:n.bool,className:n.string};function th(t){return s.jsx(Ae,{tagIconName:s.jsx(A,{iconName:"tent"}),name:"Camping",iconClass:"camping",...t})}function sh(t){return s.jsx(Ae,{tagIconName:s.jsx(A,{iconName:"tree"}),name:"Recreation Area",iconClass:"rec-area",...t})}function ah(t){return s.jsx(Ae,{tagIconName:s.jsx(A,{iconName:"ticket"}),name:"Tickets & Tours",iconClass:"tickets-tours",...t})}function nh(t){return s.jsx(Ae,{tagIconName:s.jsx(A,{iconName:"card"}),name:"Site Pass",iconClass:"pass",...t})}function rh(t){return s.jsx(Ae,{tagIconName:s.jsx(A,{iconName:"card"}),name:"Activity Pass",iconClass:"activity-pass",...t})}function ih(t){return s.jsx(Ae,{tagIconName:s.jsx(A,{iconName:"permit"}),name:"Tree Permits",iconClass:"tree-permits",...t})}function Un(t){return s.jsx(Ae,{tagIconName:s.jsx(A,{iconName:"compass"}),name:"Point of Interest",iconClass:"poi",...t})}function oh(t){return s.jsx(Ae,{tagIconName:s.jsx(A,{iconName:"picnic-table"}),name:"Day Use",iconClass:"day-use",...t})}function lh(t){return s.jsx(Ae,{tagIconName:s.jsx(A,{iconName:"permit"}),name:"Permits",iconClass:"permit",...t})}function ca(t){return s.jsx(Ae,{tagIconName:s.jsx(A,{iconName:"pin"}),name:"Map Pin",iconClass:"map-pin",...t})}function ch(t){return s.jsx(Ae,{tagIconName:s.jsx(A,{iconName:"self-improvement"}),name:"Programs",iconClass:"venue",...t})}function dh(t){return s.jsx(Ae,{tagIconName:s.jsx(A,{iconName:"gift-card"}),name:"Gift Card",iconClass:"gift-card",...t})}function uh(t){return s.jsx(Ae,{tagIconName:s.jsx(A,{iconName:"celebration"}),name:"Venue",iconClass:"venue",...t})}const hh="Search for places or activities near me";function ph(t){let e=t.text;return We(t)&&(e=Ss(e)),e}function mh(t){if((en(t)||qs(t)||We(t)||vt(t))&&t.entity_type)switch(t.entity_type){case"campground":return We(t)&&t?.campsite_type_of_use?.length===1&&t?.campsite_type_of_use[0]==="Day"?s.jsx(oh,{isSpanItem:!0,isInverse:!0}):s.jsx(th,{isSpanItem:!0,isInverse:!0});case"ticketfacility":case"tour":case"timedentry":case"timedentry_tour":return s.jsx(ah,{isSpanItem:!0,isInverse:!0,className:"tour-suggestion-icon"});case"permit":case"vehiclepermit":return s.jsx(lh,{isSpanItem:!0,isInverse:!0});case"recarea":return s.jsx(sh,{isSpanItem:!0,isInverse:!0,className:"rec-area-suggestion-icon"});case"pass":return s.jsx(nh,{isSpanItem:!0,isInverse:!0,className:"rec-area-suggestion-icon"});case"activitypass":return s.jsx(rh,{isSpanItem:!0,isInverse:!0,className:"rec-area-suggestion-icon"});case"treepermit":return s.jsx(ih,{isSpanItem:!0,isInverse:!0,className:"rec-area-suggestion-icon"});case"venuereservations":case"venuereservations_venue":return s.jsx(uh,{isSpanItem:!0,isInverse:!0});case"program":case"program_session":return s.jsx(ch,{isSpanItem:!0,isInverse:!0});case"giftcard":return s.jsx(dh,{isSpanItem:!0,isInverse:!0});case"kb":return s.jsx("div",{className:"location-suggestion-icon location-suggestion-help-icon",children:s.jsx(A,{iconName:"help-outline"})});case"cms":case"page":return s.jsx("div",{className:"location-suggestion-icon location-suggestion-article-icon",children:s.jsx(A,{iconName:"description"})});case"merchandise":return s.jsx("div",{className:"location-suggestion-icon location-suggestion-offer-icon",children:s.jsx(A,{iconName:"offer"})});default:return s.jsx(Un,{isSpanItem:!0,isInverse:!0})}return Hn(t)&&!We(t)?s.jsx(ca,{isSpanItem:!0,isInverse:!0}):vt(t)&&!t.entity_type&&t.country_code?s.jsx(ca,{isSpanItem:!0,isInverse:!0}):t.text===hh?s.jsx(ca,{isSpanItem:!0,isInverse:!0}):!Hn(t)&&!We(t)&&t.text?s.jsx("div",{className:"location-suggestion-icon location-suggestion-history-icon",children:s.jsx(A,{iconName:"history"})}):s.jsx(Un,{className:"poi-suggestion-icon"})}function fh({suggestion:t,searchText:e}){const{labelProps:a}=Ei(),r=ph(t),i=e.trim(),o=nl(r,i),l=rl(r,o);return s.jsx("div",{"data-testid":"suggestion-title",...a,children:l.map((c,d)=>{const u=c.highlight?"highlight":void 0;return s.jsx("span",{className:u,children:c.text},d)})})}function gh({suggestion:t,searchText:e,shouldEnableTracking:a=!1}){return s.jsxs("div",{className:"sarsa-location-suggestion-content",translate:"no",children:[a&&s.jsx(Qu,{suggestion:t,list_name:"search-suggestion-container__search-suggestion-content",position:t?.idx||0,reportOnMount:!0,shouldEnqueueWork:!0}),s.jsx(fh,{suggestion:t,searchText:e}),s.jsx(eh,{suggestion:t})]})}function bh({suggestion:t}){const e=p.useMemo(()=>mh(t),[t.id]);return s.jsx("div",{className:"sarsa-location-suggestion-icon",children:e})}function qn({suggestion:t,searchText:e,shouldEnableTracking:a=!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(bh,{suggestion:t}),s.jsx(gh,{suggestion:t,searchText:e,shouldEnableTracking:a})]})})}function vh(t,e="https://www.recreation.gov",a="https://help.recreation.gov/external"){let r;if(t.entity_type==="campground"&&t.reservable)r=`/camping/campgrounds/${t.entity_id}`;else if(t.campsite_id)r=`/camping/campsites/${t.campsite_id}`;else if(t.entity_type==="permit")r=`/permits/${t.entity_id}`;else if(t.entity_type==="vehiclepermit")r=`/vehiclepermits/${t.entity_id}`;else if(t.entity_type==="tour")r=`/ticket/${t.parent_entity_id?t.parent_entity_id:t.parent_id}/ticket/${t.entity_id}`;else if(t.entity_type==="ticketfacility")r=`/ticket/facility/${t.entity_id}`;else if(t.entity_type==="timedentry_tour")r=`/timed-entry/${t.parent_entity_id?t.parent_entity_id:t.parent_id}/ticket/${t.entity_id}`;else if(t.entity_type==="timedentry")r=`/timed-entry/${t.entity_id}`;else if(t.entity_type==="recarea")r=`/gateways/${t.entity_id}`;else if(t.entity_type==="pass")r=`/sitepass/${t.park_pass_facility_id?t.park_pass_facility_id:t.entity_id}`;else if(t.entity_type==="activitypass")r=`/activitypass/${t.entity_id}`;else if(t.entity_type==="treepermit")r=`/tree-permits/${t.entity_id}`;else if(t.entity_type==="venuereservations")r=`/venues/${t.entity_id}`;else if(t.entity_type==="venuereservations_venue")r=`/venues/${t.parent_entity_id?t.parent_entity_id:t.parent_id}/details/${t.entity_id}`;else if(t.entity_type==="program")r=`/programs/${t.entity_id}`;else if(t.entity_type==="kb")r=`${a}?id=kb_article&sys_id=${t.entity_id}`;else if(t.entity_type==="cms"){const i=t.name.toLowerCase().split(" ").join("-"),o=t.content_type.toLowerCase().split("_").join("-");r=`${e}/articles/${o}/${i}/${t.entity_id}`}else t.entity_type==="page"||t.entity_type==="giftcard"||t.entity_type==="merchandise"?r=t.url:r=`/camping/poi/${t.entity_id}`;return r}const Mi=()=>Ie(),xh=pe;function Gn(t){return t.children!==void 0}function yh(t,e){let a;return(...r)=>new Promise((i,o)=>{clearTimeout(a),a=setTimeout(async()=>{try{const l=await t(...r);i(l)}catch(l){o(l)}},e)})}const gs="Search for places or activities near me",Ht="Clear Search History";function bs(t){let e=t.text;return(qs(t)||We(t)||en(t)||vt(t))&&t.entity_id&&t.entity_type&&(e=Ss(e)),e}function wh(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 Ch=yh(async(t,e)=>{try{const{data:a}=await oe.get("/api/search/suggest",{signal:t,params:e,paramsSerializer:{indexes:null},headers:{Authorization:Te()}});return a}catch{return{content_suggestions:null,inventory_suggestions:null,merchandise_suggestions:null,suggestions:null}}},250);function Oi(t){const{contentTypes:e=null,disableSearchOnSelect:a=!1,defaultEventCategory:r="Global Navigation",geocoder:i=!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:m,clickTagLabel:b,id:x,onRunSearch:w}=t,v=Mi(),[C,y]=p.useState(null),N=p.useRef(0),T=()=>{N.current=Date.now()},j=p.useRef(null),S=xh(L=>L.auth.account),k=h&&m&&b,_=()=>{const L={category:"Search",action:"Select Search Suggestion Near Me",label:"Near Me"};if(k&&(L.category=m,L.action=h,L.label=b),g){const H=g(null,!0);L.category=H.clickTagCategory,L.action=H.clickTagAction,L.label=H.clickTagLabel}ze(L,()=>{v(ya())})},I={id:Ge(),idx:0,text:gs,name:gs},P=async(L,H)=>{let Q=r,K="Submit Search",F=H;if(L&&(K="Select Search Suggestion",vt(L)&&L.last_used&&(K="Select Search History Suggestion"),F=L.name||L.text),k&&(Q=m,K=h,F=b),g){const Y=g(L);Y.clickTagCategory&&Y.clickTagAction&&Y.clickTagLabel&&(Q=Y.clickTagCategory,K=Y.clickTagAction,F=Y.clickTagLabel)}wh(F)&&(F="[Redacted Email]");const ee={category:Q,action:K,label:F},O=L&&(vt(L)||We(L))&&L.reservable,$=L&&Rs(L)&&(L.entity_type==="recarea"||L.entity_type==="kb"||L.entity_type==="cms"||L.entity_type==="page"||L.entity_type==="merchandise"||L.entity_type==="pass");if(O||$){try{await kn({searchHistory:void 0,rawSearchText:H,suggestion:L})}catch(U){console.log("error saving history",U)}const Y=vh(L);ze(ee,()=>{window.location.assign(Y)})}else if(w)ze(ee,()=>{w({searchText:H,suggestion:L,searchHistory:[]})});else{try{await kn({searchHistory:void 0,rawSearchText:H,suggestion:L})}catch(Y){console.log("error saving history",Y)}ze(ee,()=>{v(ya(H,null,L))})}},B=L=>{j.current=null;const H=bs(L);v(Tt({selectedSuggestionOption:L,[d]:H})),(!a||Rs(L)&&u.includes(L?.entity_type??""))&&P(L,H)},W=(L,H)=>({...L,id:Ge(),idx:H}),D=async()=>{try{const L=(await kd(T)).filter(Q=>!!Q.text),H=[I];if(L.length){const Q={id:Ge(),text:"Recent Searches",children:L.map(W)};Q.children.push({id:Ge(),idx:L.length+1,text:Ht,name:Ht,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(A,{iconName:"loop",size:"sm"}),s.jsx("span",{children:Ht})]})})}),H.push(Q)}return H}catch(L){return console.error("error loading history",L),[]}},E=il({async load({signal:L,filterText:H}){if(!H)return{items:await D()};const K=await Ch(L,{q:H,geocoder:i,type:e,inventory_type:o});return{items:[{text:"Recreation Areas, Facilities, Tours, Trails",id:Ge(),children:(K?.inventory_suggestions??[]).map(W)},{text:"Merchandise Store",id:Ge(),children:(K?.merchandise_suggestions??[]).map(W)},{text:"Locations, City, State, Zip Code",id:Ge(),children:(K?.suggestions??[]).map(W)},{text:"Help Topics, Frequently Asked Questions, Articles",id:Ge(),children:(K?.content_suggestions??[]).map(W)}].filter(F=>F.children.length)}}});async function V(){try{await _d()}catch(H){console.log("error deleting history",H)}j.current=null,E.reload();const L={[d]:""};v(Tt(L))}p.useEffect(()=>{S?.account?.account_id&&N.current>0&&E.reload()},[S?.account?.account_id]);const X=L=>{for(let H=0;HF.id===L);if(K)return K}else if(Q.id===L)return Q}return null},Z=()=>{E.setFilterText(""),y(null),j.current=null},G=async L=>{if(!L)return;const H=X(L);if(H&&(y(H.id),j.current=H,H.text!==Ht&&H.text!==gs)){const Q=bs(H);E.setFilterText(Q);const K={[d]:Q};v(Tt(K))}},J=L=>{const H=X(L);H&&(H.text===gs?_():H.text===Ht?V():B(H))},z=L=>{L.key==="Enter"&&!j.current&&E.filterText&&P(null,E.filterText)},se=()=>{Z();const L={[d]:""};v(Tt(L))},q=L=>{E.setFilterText(L),C&&(y(null),j.current=null);const H={[d]:L};v(Tt(H))};return s.jsx("div",{className:"nav-search-bar-container",children:s.jsx(Fu,{id:x,label:"Search Recreation.gov",items:E.items,inputValue:E.filterText,isLabelVisible:!1,menuTrigger:"focus",placeholder:l,onClear:se,onInputChange:q,onKeyDown:z,onSelectionChange:G,onSelect:J,popupClassName:c,selectedKey:C,size:f,allowsCustomValue:!0,allowsEmptyCollection:!0,updateOnScroll:!1,children:L=>Gn(L)?s.jsx(ol,{title:L.text,items:L.children,children:H=>s.jsx(wn,{textValue:bs(H),children:s.jsx(qn,{shouldEnableTracking:!0,suggestion:H,searchText:E.filterText})},H.id)},L.id):s.jsx(wn,{textValue:bs(L),children:s.jsx(qn,{shouldEnableTracking:!0,suggestion:L,searchText:E.filterText})},L.id)})})}const De=oe.create();function zn(t){window.sessionStorage.setItem("temporary-token",t)}function Sh(){return window.sessionStorage.getItem("temporary-token")}function Nh(){window.sessionStorage.removeItem("temporary-token")}const jh={async login(t){const e="/api/accounts/login/v2/",i=await(await Sr.load({monitoring:!1})).get();t.fingerprint=i.visitorId,lt()&&(t.session_type="widget");const l=(await De.post(e,t)).data;return l?.mfa_login&&l?.access_token&&zn(l.access_token),l},async magicLogin(t){const e=`/api/accounts/login/magic/${t}`,{data:a}=await De.get(e);return a},async resetPassword(t){const e=`/api/accounts/passwordreset/${t?.token}`,r=(await De.post(e,t)).data;return r?.mfa_login&&r?.access_token&&zn(r.access_token),r},async completeRegistration(t){const e=`/api/accounts/registration/${t?.token}`;return(await De.post(e,t)).data},async status(){const t="/api/accounts/status",{data:e}=await De.get(t);return e}},Th={async login(){const t="/api/accounts/guest/login",{data:e}=await De.post(t,{});return e}},Rh={async csrSession(t){const e="/api/accounts/internal/csr_session",{data:a}=await De.post(e,{token:t},{headers:{Authorization:`Bearer ${t}`}});return a},async csrAccount(t){const e=`/api/accounts/internal/csr_session/${t}`,{data:a}=await De.get(e,{headers:{Authorization:Kt()}});return a}},Ih={async login(t){const e="/api/accounts/login/v2/mfa",i=await(await Sr.load({monitoring:!1})).get();t.fingerprint=i.visitorId,lt()&&(t.session_type="widget");const o=Sh(),l=o?{Authorization:`Bearer ${o}`}:void 0,d=(await De.post(e,t,{headers:l})).data;return Nh(),d},async prompt(t=!1){await De.patch("/api/accounts/account/mfa/prompt",null,{headers:{Authorization:Te()},params:{show:t}})},async validateToken(t){const e="/api/accounts/account/mfa/validate",{data:a}=await De.post(e,{id:t?.id,token:t?.token});return a?.success}},Ye={...jh,guest:Th,internal:Rh,mfa:Ih};function ns(t){return ll(t)&&t.response?.data?.error?String(t.response.data.error):t instanceof Error?t.message:"Unknown error"}const Eh=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},$i=()=>{const t=new URL(window.location.href),a=new URLSearchParams(t.search).get("redirect");return Eh(a)},Di=(t="/")=>{const e=new URL(window.location.href),a=new URLSearchParams(e.search);a.delete("redirect");const r=`${e.pathname}${a.size?`?${a.toString()}`:""}`;window.history.replaceState({},"",r),window.location.pathname=t};function kh(){return t=>oe.get("/api/cart/shoppingcart/header",{headers:{Authorization:Te()}}).then(e=>{t({type:hi,payload:e.data})}).catch(()=>{t({type:Ka,payload:"Error fetching cart",error:!0})})}function ja(t){return t?kh():e=>oe.get("/api/cart/shoppingcart",{headers:{Authorization:Te()}}).then(a=>{e({type:Wa,payload:a.data})}).catch(()=>{e({type:Ka,payload:"Error fetching cart",error:!0})})}function _h(){return t=>{t({type:xa,payload:!0}),oe.patch("/api/cart/shoppingcart/expiration",{},{headers:{Authorization:Te()}}).then(e=>{t({type:Wa,payload:e.data})}).catch(()=>{t({type:id,payload:"Error extending expiration"})}).finally(()=>{t({type:xa,payload:!1})})}}function Ah(){return{type:li}}const yt=t=>({type:Yr,profile:t}),wt=t=>({type:Zr,payload:t}),Wn=()=>({type:Xr}),tn=()=>({type:Jr}),Lh=()=>({type:Qr}),Ph=()=>({type:ti}),Mh=()=>({type:si}),Oh=t=>({type:ei,profile:t}),$h=()=>t=>{t({type:ci})},Gs=()=>t=>{t({type:za})},Dh=()=>t=>{t({type:di})},Fh=()=>t=>{t({type:ui})},Kn=(t,e,a)=>({type:ai,enabled:t,announcement:e,loginNotice:a}),Vh=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:a}=t.account;e(yt(t)),a&&window.location.replace(window.encodeURIComponent(a))}catch{e(wt("error parsing profile data"))}},Bh=t=>e=>new Promise((a,r)=>{const i=t;Ye.mfa.login(i).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(yt(o)),a(o)}).catch(o=>{const l=ns(o);l==="lockout"?(e(tn()),r(o)):(e(wt(l)),r(o))})}),Hh=t=>async(e,a)=>{const r=a().launchdarkly.ldClient;await r.waitUntilReady(),await r.identify({key:t.account.account_id}),await r.variation("useMFA",!1)&&e($h())},Uh=()=>t=>{t(Gs())},qh=(t=async e=>{window.localStorage.setItem("recaccount",JSON.stringify(e))})=>e=>async(a,r)=>{try{const i=e,o=r().launchdarkly.ldClient;await o.waitUntilReady();const l=o.allFlags()["login-v2"],c=await Ye.login(i,l);if(c?.mfa_login){a(Gs());return}await t(c),window.dataLayer&&window.dataLayer.push({event:"log_in",user_id:c.account.account_id,current_url:window.location.href}),a(yt(c)),c?.prompt_mfa&&a(Hh(c)),i?.redirectUrl&&Di(i.redirectUrl)}catch(i){const o=ns(i);a(o==="mfa"?Mh():o==="lockout"?tn():wt(o))}},sn=qh(),Fi=t=>e=>new Promise((a,r)=>{Ye.resetPassword(t).then(i=>{i?.mfa_login?a(i):(a(i),e(sn({...t,username:i.account.email})))}).catch(i=>{r(i)})}),Gh=t=>e=>new Promise((a,r)=>{Ye.completeRegistration(t).then(i=>{a(i),e(sn({...t,username:i.account.email}))}).catch(i=>{r(i)})}),zh=t=>async e=>{try{const a=await Ye.magicLogin(t);localStorage.setItem("recaccount",JSON.stringify(a)),window.dataLayer&&window.dataLayer.push({userId:a.account.account_id}),e(yt(a))}catch(a){const r=ns(a);e(r==="badmagic"?Lh():wt())}},Wh=t=>e=>new Promise((a,r)=>{Ye.mfa.validateToken(t).then(i=>{i&&(e(zh(t?.id)),a(i))}).catch(i=>{const o=ns(i);o==="lockout"?(e(tn()),r(i)):(e(wt(o)),r(i))})}),Kh=()=>async t=>{try{const e=await Ye.guest.login();window.localStorage.setItem("recaccount",JSON.stringify(e)),window.dataLayer&&window.dataLayer.push({userId:e.account.account_id}),t(yt(e))}catch{t(wt())}},tv=t=>e=>{e(Oh(t))},Yh=t=>async e=>{try{const a=await Ye.internal.csrAccount(t);localStorage.setItem("recaccount",JSON.stringify(a)),window.dataLayer&&window.dataLayer.push({userId:a.account.account_id}),e(yt(a)),e(ja())}catch{e(wt())}},Zh=t=>e=>{e(yt(t))},Vi=()=>t=>{window.localStorage.clear(),window.sessionStorage.clear(),t(Ph()),window.location.assign($s()??"/")},zs=()=>t=>{t({type:ni})},an=()=>t=>{t({type:ri})},Jh=()=>t=>{t({type:ii})},Xh=()=>t=>{t({type:oi})},sv=()=>async t=>{try{const e=await Ye.status(),a=e.enabled,r=e.announcement,i=e.login_notice;t(Kn(a,r,i))}catch{t(Kn(!0,{banner_enabled:!1},{notice_enabled:!1}))}};class Bi extends p.Component{generateIcon(e){switch(e){case"warning":return s.jsx(A,{iconName:"warning"});case"info":return s.jsx(A,{iconName:"info"});case"success":return s.jsx(A,{iconName:"check-circle"});case"error":return s.jsx(A,{iconName:"error"});default:return s.jsx(A,{iconName:"info"})}}render(){const e=this.generateIcon(this.props.noticeType);let a="";this.props.showNotice||(a="hide");let r="";return this.props.showClose||(r="hide"),s.jsx("div",{"data-testid":"notice-wrapper",className:a,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 ${r}`,onClick:this.props.closeNotice,"aria-label":"Close notification",children:s.jsx(A,{iconName:"close",className:"rec-icon-close"})})]})})}}class Ta extends p.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(Bi,{showNotice:this.state.showNotice,showClose:this.props.closeButton,closeNotice:this.closeNotice,noticeType:this.props.noticeType,children:this.props.children})})}}const xe={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 Qh(t){if(!t)return{dayType:null,dayTypeSymbol:"",dayTypeLabel:""};switch(t){case"walkup":return{dayType:t,dayTypeSymbol:"W",dayTypeLabel:xe[t]};case"inStation":return{dayType:t,dayTypeSymbol:s.jsx("div",{className:"rec-availability-in-station-icon",children:s.jsx(A,{iconName:"ranger-station",size:"sm"})}),dayTypeLabel:xe[t]};case"firstComeFirstServed":return{dayType:t,dayTypeSymbol:"FF",dayTypeLabel:xe[t]};case"lottery":return{dayType:t,dayTypeSymbol:"L",dayTypeLabel:xe[t]};case"earlyAccess":return{dayType:t,dayTypeSymbol:"EA",dayTypeLabel:xe[t]};case"blocked":return{dayType:t,dayTypeSymbol:"",dayTypeLabel:xe[t]};case"currentReservation":return{dayType:t,dayTypeSymbol:"R",dayTypeLabel:xe[t]};case"availableBridged":return{dayType:t,dayTypeSymbol:"",dayTypeLabel:xe[t]};case"loading":return{dayType:t,dayTypeSymbol:"",dayTypeLabel:xe[t]};case"notYetReleased":return{dayType:t,dayTypeSymbol:"NR",dayTypeLabel:xe[t]};case"closure":return{dayType:t,dayTypeSymbol:"C",dayTypeLabel:xe[t]};case"availableSelected":return{dayType:t,dayTypeSymbol:s.jsx(A,{size:"sm",iconName:"check-circle"}),dayTypeLabel:xe[t]};case"unavailable":return{dayType:t,dayTypeSymbol:"",dayTypeLabel:xe[t]};case"soldOut":return{dayType:t,dayTypeSymbol:"S",dayTypeLabel:xe[t]};case"unavailableSelected":return{dayType:t,dayTypeSymbol:s.jsx(A,{size:"sm",iconName:"error"}),dayTypeLabel:xe[t]};case"ftm-running":return{dayType:t,dayTypeSymbol:"R",dayTypeLabel:xe[t]};case"ftm-completed":return{dayType:t,dayTypeSymbol:s.jsx(A,{size:"sm",iconName:"check"}),dayTypeLabel:xe[t]};case"ftm-error":return{dayType:t,dayTypeSymbol:"E",dayTypeLabel:xe[t]};case"ftm-dataIssue":return{dayType:t,dayTypeSymbol:s.jsx(A,{size:"sm",iconName:"warning"}),dayTypeLabel:xe[t]};case"checkout":return{dayType:"checkout",dayTypeSymbol:"A",dayTypeLabel:xe[t]};case"noTicketRequired":return{dayType:t,dayTypeSymbol:"NT",dayTypeLabel:xe[t]};case"available":default:return{dayType:"available",dayTypeSymbol:"A",dayTypeLabel:xe.available}}}function Hi(t){const{isLgAndUp:e,isXxlAndUp:a}=Dt();let r=1;return e&&(r+=1),a&&(r+=1),r}const ep=Nr(xt());jr(ep);const tp=cl(xt());function av(t){return!t||!t?.toString?null:dl(t,"UTC").toAbsoluteString()}function sp(t,e){const a=t?.start?t.start.toString():"null",r=t?.end?t.end.toString():"null",i=e?.start?e.start.toString():"null",o=e?.end?e.end.toString():"null";return!(a===i&&r===o)}function ap(t,e){const a=t?t.toString():"null",r=e?e.toString():"null";return a!==r}function np(t){return t instanceof Date&&!Number.isNaN(t?.valueOf())}function rp(t){const e="timeZone"in t?t.timeZone:void 0,a=xt();return t.toDate(e??a)}function ip({format:t,timeZone:e,showTimeZone:a}){let r;switch(t){case"l":r={dateStyle:"short"};break;case"L":r={month:"2-digit",day:"2-digit",year:"numeric"};break;case"ll":r={month:"short",day:"numeric",year:"numeric"};break;case"LL":r={month:"long",day:"numeric",year:"numeric"};break;case"LLL":r={month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"numeric",timeZoneName:a?"short":void 0};break;case"lll":r={month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"numeric",timeZoneName:a?"short":void 0};break;case"LLLL":r={weekday:"long",month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"numeric",timeZoneName:a?"short":void 0};break;case"llll":r={weekday:"short",month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"numeric",timeZoneName:a?"short":void 0};break;case"LT":r={hour:"numeric",minute:"numeric",timeZoneName:a?"short":void 0};break;case"LTS":r={hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:a?"short":void 0};break;default:throw new Error("FormattedDate received an unknown format")}return e&&(r.timeZone=e),r}const da={};function op(t,e){const a=`${t}-${JSON.stringify(e)}`;if(da[a])return da[a];const r="format"in e?ip(e):e,i=new ts(t,r);return da[a]=i,i}const lp=t=>(e,a)=>{const r=t||navigator.language||"en-US",i=np(e)?e:rp(e);return op(r,a).format(i)};function cp(){const{locale:t}=tt();return lp(t)}function nv(){const t=Mi(),[e]=Tr(),[a,r]=p.useState(!1),[i,o]=p.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(Zh(Ds())),window.location.assign(u);return}}document.location=u},d=async()=>{const u=e.get("next"),f=e.get("guest");if(!l(u)){r(!0),o("Malformed request - invalid next");return}if(f==="true"){const g=new it().readCookie("X-Mobile-Guest-Auth");if(g===null){r(!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){r(!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 m=`${h}`;h instanceof Cn&&h?.response?.data.error&&(m=`${h}: ${h.response.data.error}`),r(!0),o(m);return}}else if(!$e()){const g=new it().readCookie("X-Mobile-Auth");if(g===null){r(!0),o("Malformed request - missing authentication");return}try{const b=(await oe.get("/api/accounts/account",{headers:{Authorization:`Bearer ${g}`}})).data,x=tp.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 m=`${h}`;h instanceof Cn&&h?.response?.data.error&&(m=`${h}: ${h.response.data.error}`),r(!0),o(m);return}}c(u)};return p.useEffect(()=>{d()},[]),a?s.jsxs(Ta,{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:i})]}):s.jsx(Le,{})}const Yn={error:{display:!1,message:""},success:{display:!1,message:""},warning:{display:!1,message:""},info:{display:!1,message:""}},Ui=_s({name:"notifications",initialState:Yn,reducers:{dismissNotification:(t,e)=>{const a=e.payload;t[a]={display:!1,message:""}},setNotification:(t,e)=>{const{type:a,message:r}=e.payload;Object.assign(t,Yn),t[a]={display:!0,message:r}}}}),{dismissNotification:rv,setNotification:iv}=Ui.actions,dp=Ui.reducer;function ov(){const t=Ce(),e=t?window.localStorage.getItem("r1s_search_session"):null;let a=null,r={};try{if(a=e?JSON.parse(e):null,a){const i=new Date(a.last_updated_datetime),o=new Date;o.setHours(o.getHours()-4),(iDate.now())&&(a=null,window.localStorage.removeItem("r1s_search_session"))}}catch{a=null,t&&window.localStorage.removeItem("r1s_search_session")}return a&&(r={...r,search:a}),r}const up={ldClient:null},qi=_s({name:"launchdarkly",initialState:up,reducers:{setClient:(t,e)=>{t.ldClient=e.payload}}}),{setClient:Gi}=qi.actions,hp=qi.reducer,Ra={type:"default",delay:6500,isColored:!0,disableAutoClose:!1},zi={toasts:[]},Wi=_s({name:"toast",initialState:zi,reducers:{showToast:(t,e)=>{const a={...Ra,...e.payload,id:Ge()};t.toasts=[...t.toasts,a]},dismissToast:(t,e)=>{t.toasts=t.toasts.filter(a=>a.id!==e.payload)}}}),{showToast:pp,dismissToast:mp}=Wi.actions,fp=t=>t?.toast?.toasts||zi.toasts,gp=Wi.reducer,bp={loading:!1,loaded:!1,error:null,data:null};function vp(t=bp,e){switch(e.type){case gi:return{loading:!0,loaded:!1,error:null,data:t.data};case bi:return{loading:!1,loaded:!0,error:null,data:e.payload};case vi:return{loading:!1,loaded:!0,error:e.error,data:t.data};default:return t}}const xp={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},yp=t=>{const e=t.replace(/\D/g," ").split(" "),a=e.length>2?parseInt(e[0],10):0,r=e.length>2?parseInt(e[1],10):parseInt(e[0],10);return(a*60+r)*1e3};function wp(t=xp,e){const a={...t},r=zc*60*60*1e3;switch(e.type){case Wa:{let i=[...e.payload.reservations,...e.payload.untimed_reservations];e.payload.modification&&(a.is_modification=!0,i=[e.payload.modification]),a.hasError=!1;for(const l of i)if(l.errors){a.hasError=!0;break}const o=new Date(Date.now()+e.payload.expires_in*1e3);return a.expiration=o.toISOString(),a.expiresIn=e.payload.expires_in,a.reservation_count=i.length,a.reservations=i,a.showTimer=e.payload.reservations.length>0||e.payload.modification,a.account_id=e.payload.account_id,a.subtotal=e.payload.subtotal,a.discount=e.payload.discount,a.tax=e.payload.tax,a.total=e.payload.total,a.session=e.payload.session,a.sessionDuration=yp(a.session),a.sessionLimit=a.sessionDuration+5*60*1e3,a.maxDuration=r,a.showSessionWarning=a.sessionLimit>=a.maxDuration,delete a.err,a}case hi:return a.expiration=e.payload.expiration,a.expiresIn=e.payload.expires_in,a.showTimer=e.payload.active_timer,a.reservation_count=e.payload.reservation_count,a;case rd:return a;case Ka:return a.err_message=e.payload,delete a.err,a;case od:return a.err_message=e.payload,delete a.err,a;case xa:return a.isExtendingTime=e.payload,a;default:return a}}const Cp={alerts:[],locationParams:null},Sp=(t=Cp,e)=>{switch(e.type){case Kr:return{...t,alerts:e.alerts};case Wc:return{...t,alerts:[]};default:return t}},Np={account:null,csrAccount:null,loginError:!1,mfaRequired:!1,accountServiceEnabled:!1,lockout:!1,isGuest:!1,announcement:{banner_enabled:!1},loginNotice:{notice_enabled:!1},accountServiceStatusUpdated:!1},jp=(t=Np,e)=>{switch(e.type){case Yr:return{...t,account:e.profile,isGuest:e.profile.is_guest,loginError:!1,mfaRequired:!1,lockout:!1};case Xr:return{...t,account:null,isGuest:!1,loginError:!1,mfaRequired:!1,lockout:!1,errorText:null};case Zr:return{...t,account:null,loginError:!0,errorText:e.payload,mfaRequired:!1,lockout:!1};case Qr:return{...t,account:null,loginError:!0,mfaRequired:!1,lockout:!1};case Jr:return{...t,account:null,loginError:!1,mfaRequired:!1,lockout:!0};case za:return{...t,loginError:!1};case si:return{...t,account:null,loginError:!1,mfaRequired:!0,lockout:!1};case ti:return{...t,account:null,csrAccount:null,loginError:!1,mfaRequired:!1,lockout:!1};case ai:return{...t,accountServiceEnabled:e.enabled,announcement:e.announcement,loginNotice:e.loginNotice,accountServiceStatusUpdated:!0};case ei:return{...t,csrAccount:e.profile,loginError:!1,mfaRequired:!1,lockout:!1};case Kc:return{...t,account:null};default:return t}},we={showSignInGuestModal:!1,showLoginModal:!1,showCreateAccountModal:!1,showResetModal:!1,showCartLimitExceededModal:!1,showMfaSetupModal:!1,showMfaCodeModal:!1,showConfirmModal:!1},Tp=(t=we,e)=>{if(typeof t>"u")return we;switch(e.type){case ni:return{...t,...we,showLoginModal:!0};case Jc:return{...t,...we,showLoginModal:!1};case ri:return{...t,...we,showSignInGuestModal:!0};case Xc:return{...t,...we,showSignInGuestModal:!1};case ii:return{...t,...we,showCreateAccountModal:!0};case Qc:return{...t,...we,showCreateAccountModal:!1};case oi:return{...t,...we,showResetModal:!0};case ed:return{...t,...we,showResetModal:!1};case td:return{...t,...we,showCartLimitExceededModal:!0};case li:return{...t,...we,showCartLimitExceededModal:!1};case ci:return{...t,...we,showMfaSetupModal:!0};case sd:return{...t,...we,showMfaSetupModal:!1};case za:return{...t,...we,showMfaCodeModal:!0};case ad:return{...t,...we,showMfaCodeModal:!1};case di:return{...t,...we,showConfirmModal:!0};case nd:return{...t,...we,showConfirmModal:!1};case ui:return{...t,...we};default:return t}},Rp={verification:""},Ip=(t=Rp,e)=>{switch(e.type){case Yc:return{...t,verification:e.verification};case Zc:return{...t,verification:""};default:return t}};function Me(t){return JSON.parse(JSON.stringify(t))}const Ep={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 kp(t){for(const e in t.uiFilters)if(Ba(t.uiFilters[e])&&!_e(t.uiFilters[e]))return!0;return!1}const Oe=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 _p(t=Ep,e){let a=t,r=null;switch(e.type){case fd:return a=Me(t),a.checkin_time=e.time,delete a.err,Oe(a);case gd:return a=Me(t),a.checkout_time=e.time,delete a.err,Oe(a);case dd:return a=Me(t),a[e.name]=e.value,Oe(a);case pi:return a=Me(t),a={...a,...e},Oe(a);case mi:return a=Me(t),r=new Map(Object.entries(a.uiFilters[e.uiFilterName]||{})),r.set(e.uiFilterOption.key,e.uiFilterOption),a.uiFilters[e.uiFilterName]=Object.fromEntries(r),a.uiFilters.hasFilters=!0,a.uiFilters.lastAppliedFilter=e.uiFilterName,a.start=0,Oe(a);case ud:return a=Me(t),r=new Map,r.set(e.uiFilterOption.key,e.uiFilterOption),a.uiFilters[e.uiFilterName]=Object.fromEntries(r),a.uiFilters.hasFilters=!0,a.uiFilters.lastAppliedFilter=e.uiFilterName,a.start=0,Oe(a);case hd:return a=Me(t),r=new Map(Object.entries(a.uiFilters[e.uiFilterName]||{})),r.delete(e.uiFilterOption.key),a.uiFilters[e.uiFilterName]=Object.fromEntries(r),a.uiFilters.hasFilters=kp(a),a.uiFilters.lastAppliedFilter=e.uiFilterName,a.start=0,Oe(a);case fi:return a=Me(t),a.filters=[],a.include_unavailable=!0,a.include_notreservable=!0,a.include_partially_available=!0,a.start=0,a.uiFilters={hasFilters:!1,campsiteUseTypes:{},campsiteTypes:{},campsiteAmenities:{},campsiteElectricityHookup:{},campsiteVehicleLength:{},campsiteEquipment:{},activities:{},agencies:{},occupants:{},inventoryTypes:{},tourTypes:{},tourAccessible:{},tourDifficulty:{},tourDuration:{},tourPrice:{},tourTime:{},tourTimes:{},permitTypes:{},reservable:{},lastAppliedFilter:null},a.highlighted_item=-1,Oe(a);case pd:return a=Me(t),a.include_unavailable=!0,a.include_notreservable=!0,a.include_partially_available=!0,a.start=0,a.uiFilters.campsiteUseTypes={},a.uiFilters.campsiteTypes={},a.uiFilters.campsiteAmenities={},a.uiFilters.campsiteElectricityHookup={},a.uiFilters.campsiteVehicleLength={},a.uiFilters.campsiteEquipment={},a.uiFilters.occupants={},a.uiFilters.reservable={},a.highlighted_item=-1,Oe(a);case md:return a=Me(t),a.highlighted_item=e.payload,delete a.err,Oe(a);case xd:return a=Me(t),a.showSearchInput=!1,delete a.err,Oe(a);case vd:return a=Me(t),a.showSearchInput=!0,delete a.err,Oe(a);case bd:return e.payload;default:return a}}const Ap={suggestions:[],inventory_suggestions:[]};function Lp(t=Ap,e){let a=t;switch(e.type){case ld:return a={...t},a.suggestions=e.suggestions,a.inventory_suggestions=e.inventory_suggestions,a.content_suggestions=e.content_suggestions,a.merchandise_suggestions=e.merchandise_suggestions,delete a.err,a;case cd:return a={...t},a.err=e.err,a;default:return a}}const lv={alertsNotification:Sp,modal:Tp,auth:jp,search:_p,searchSuggestions:Lp,cart:wp,launchdarkly:hp,recaptcha:Ip,notifications:dp,slugs:pu,asset:vp,toast:gp};function Yt(t){if(typeof t=="string")return t.trim();if(fc(t)){const e=[];return t.forEach(a=>{if(typeof a=="object")e.push(Yt(a));else if(typeof a=="string"){const r=a.trim();r&&e.push(r)}}),e.join(" ")}if(p.isValidElement(t)){if(typeof t.props.children=="object")return Yt(t.props.children);if(typeof t.props.children=="string")return t.props.children.trim()}return""}function Zn(t,e,a,r){const i=a-e,o=t/(r/2);return o<1?i/2*o*o+e:-i/2*((o-1)*(o-3)-1)+e}function Pp(t,e,a,r){let i=t;return i/=r/2,i<1?a/2*i*i+e:(i-=1,-a/2*(i*(i-2)-1)+e)}const Ki=(t,e)=>{const a=t.xPos[e],r=t.yPos[e];window.scrollTo(a,r),t.yPos.length-e>1&&window.requestAnimationFrame(()=>{Ki(t,e+1)})},cv=(t=0,e=0,a=150)=>{const r=window.scrollY||window.pageYOffset,i=window.scrollX||window.pageXOffset,o=1e3/60,l=Math.round(a/o),c=[],d=[];for(let u=0;u{Ki({yPos:c,xPos:d},0)})},Is=t=>{const{element:e,to:a,duration:r,scrollDirection:i}=t,o=e[i],l=a-o;let c=0;const d=16.6666,u=()=>{c+=d;const f=Pp(c,o,l,r);e[i]=f,c{let e=typeof t=="string"?parseFloat(t):t;return(typeof e!="number"||Number.isNaN(e)||Object.is(e,-0))&&(e=0),e<0?`(${Math.abs(e).toLocaleString("en-US",{style:"currency",currency:"USD"})})`:e.toLocaleString("en-US",{style:"currency",currency:"USD"})};function ue(t,e="polite",a){const r=typeof t=="string"?t:Yt(t);if(!r)return;const i=a?3e3+r.length*300:2e3+r.length*150;let o=null;a&&(o=document.getElementById(a),window.sarsaAnnounceTimeout&&clearTimeout(window.sarsaAnnounceTimeout)),o||(o=document.createElement("div"),o.setAttribute("aria-live",e),a&&o.setAttribute("id",a),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=r,window.sarsaAnnounceTimeout=setTimeout(()=>{o&&o.parentNode&&o.parentNode.removeChild(o)},i)}function jt(t,e=2,a=!0,r=!1){if(t==null||Dr(Number(t)))return"";const i=Number(t)||0,o=a?",":"",l=i<0?"-":"";let c=Math.abs(i).toFixed(e);if(!a)return r&&(c=c.replace(/([0-9]+(\.[0-9]+[1-9])?)(\.?0+$)/,"$1")),l+c;const d=parseInt(c,10).toString(),u=e?c.slice((e+1)*-1):"",f=d.length>3?d.length%3:0,g=f?d.substr(0,f)+o:"",h=d.substr(f).replace(/(\d{3})(?=\d)/g,`$1${o}`);let m=l+g+h+u;return r&&(m=m.replace(/([0-9]+(\.[0-9]+[1-9])?)(\.?0+$)/,"$1")),m}function Yi(t){return new TextEncoder().encode(t)}Yi("er987452-e845e-obaUf-UzX94111253-736gaa");Yi("1234567891123456");function Zi({name:t,icon:e,colorSupport:a}){return s.jsxs("div",{className:"rec-availability-item",children:[s.jsx("div",{className:`rec-availability-block-icon rec-color-support-${a}`,children:e}),s.jsx("div",{className:"rec-availability-item-type",children:t})]})}Zi.propTypes={name:n.string.isRequired,icon:n.element.isRequired,colorSupport:n.oneOf(["01","02","03","04"]).isRequired};function Mp({name:t,icon:e,colorSupport:a}){return s.jsx(Zi,{name:t,icon:e,colorSupport:a},t)}function Op({...t}){return s.jsx(Mp,{name:"Management Site",colorSupport:"02",icon:s.jsx(A,{iconName:"flag"}),...t})}function At({children:t,tag:e="div",rootId:a}){const r=p.useRef(document.createElement(e));return p.useLayoutEffect(()=>{const i=r.current,o=a?document.getElementById(a)??document.body:document.body;return i.setAttribute("data-component","Portal"),o.appendChild(i),()=>{o.removeChild(i)}},[a]),Oo.createPortal(t,r.current)}At.propTypes={children:n.node.isRequired,tag:n.string,rootId:n.string};const Ue=8,$p=100,Dp={transition:"all 300ms ease-out",opacity:0},Fp={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)"}},Vp={entering:{opacity:0},entered:{opacity:1,transform:"translate(0, 0)"},exiting:{},exited:{},unmounted:{}};class Ji extends p.PureComponent{constructor(e){super(e),this.handleWindowResize=st(()=>{const{isVisible:a}=this.props;a&&this.setState({tooltipRect:null})},100),this.tooltipRef=p.createRef(),this.spanRef=p.createRef(),this.state={tooltipRect:null}}static{this.propTypes={id:n.string.isRequired,content:n.node.isRequired,position:n.oneOf(["top","bottom","right","left","topLeft","topRight"]),maxWidth:n.number,isVisible:n.bool,triggerRef:n.shape({current:n.any})}}static{this.defaultProps={position:"top",maxWidth:250}}componentDidMount(){window.addEventListener("resize",this.handleWindowResize)}componentDidUpdate(e){const{content:a}=this.props,{tooltipRect:r}=this.state;(!r||a!==e.content)&&this.tooltipRef.current&&this.setState({tooltipRect:this.tooltipRef.current.getBoundingClientRect()})}componentWillUnmount(){window.removeEventListener("resize",this.handleWindowResize)}render(){const{content:e,position:a,maxWidth:r,isVisible:i,triggerRef:o,id:l}=this.props,{tooltipRect:c}=this.state;if(!i)return null;if(!c)return s.jsx(At,{children:s.jsx("div",{className:"sarsa-tooltip",style:{visibility:"hidden",maxWidth:r},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:R("sarsa-tooltip",m),"data-component":"Tooltip",role:"tooltip",style:{...w,...Dp,...Fp[m],...Vp[v]},id:l,children:e})})})}}let Bp=class extends p.PureComponent{constructor(e){super(e),this.onMouseEnter=a=>{const{onMouseEnter:r}=this.props;this.showTooltip(),r&&r(a)},this.onMouseLeave=a=>{const{onMouseLeave:r}=this.props;this.hideTooltip(),r&&r(a)},this.onFocus=a=>{const{onFocus:r}=this.props;this.showTooltip(),r&&r(a)},this.onBlur=a=>{const{onBlur:r}=this.props;this.hideTooltip(),r&&r(a)},this.showTooltip=()=>{this.props.content&&!this.triggerRef.current.disabled&&this.setState({isVisible:!0})},this.hideTooltip=()=>{this.setState({isVisible:!1})},this.triggerRef=e.triggerRef||p.createRef(),this.state={isVisible:!1}}static{this.propTypes={children:n.node.isRequired,content:n.node.isRequired,position:n.oneOf(["top","bottom","right","left","topLeft","topRight"]),maxWidth:n.number,id:n.string,triggerRef:n.shape({current:n.any}),onMouseEnter:n.func,onMouseLeave:n.func,onFocus:n.func,onBlur:n.func,isHidden:n.bool}}static{this.defaultProps={position:"top",maxWidth:250,id:"tooltip-component"}}render(){const{children:e,content:a,maxWidth:r,position:i,id:o,isHidden:l}=this.props,{isVisible:c}=this.state;return l?e:s.jsxs(s.Fragment,{children:[p.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,p.cloneElement(d,f)}),s.jsx(Ji,{id:o,content:a,position:i,maxWidth:r,isVisible:c,triggerRef:this.triggerRef})]})}};function me({name:t,text:e,availClass:a,tooltipContent:r,"aria-label":i}){return s.jsxs("div",{className:"rec-availability-item",children:[s.jsx("div",{className:`rec-availability-block rec-${a}`,role:"img","aria-label":i,children:e},t),r?s.jsx(Bp,{content:r,children:s.jsx(M,{appearance:"subtle",size:"xxs",className:"rec-availability-item-type",children:t})}):s.jsx("div",{className:"rec-availability-item-type",children:t})]})}function Hp(){return s.jsx(me,{text:"R",name:"Current Reservation",availClass:"available","aria-label":"Solid color background with letter R"})}function Up(){return s.jsx(me,{text:"A",name:"Available",availClass:"available","aria-label":"Solid color background with letter A"})}function qp(){return s.jsx(me,{text:"#",name:"Available",availClass:"available","aria-label":"Solid color background with number"})}function Gp(){return s.jsx(me,{text:"A",name:"Checkout",availClass:"available-checkout","aria-label":"Half shaded color with letter A"})}function zp(){return s.jsx(me,{text:"NR",name:"Not Yet Released",availClass:"not-yet-released","aria-label":"Solid color with letters NR"})}function Wp(){return s.jsx(me,{text:"W",name:"Walk-up",availClass:"walk-up",tooltipContent:"Available only from the facility's office.","aria-label":"Solid color with letter W"})}function Kp(){return s.jsx(me,{text:s.jsx("div",{className:"rec-availability-in-station-icon",children:s.jsx(A,{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 Yp(){return s.jsx(me,{text:"L",name:"Lottery",availClass:"lottery",tooltipContent:"Allocated through lottery, see important dates for information.","aria-label":"solid color with letter L"})}function Zp(){return s.jsx(me,{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 Jp(){return s.jsx(me,{text:"C",name:"Closure",availClass:"unavailable","aria-label":"Solid color with letter C"})}function Xp(){return s.jsx(me,{text:"#",name:"Unavailable",availClass:"unavailable","aria-label":"Solid gray with symbol #"})}function Qp(){return s.jsx(me,{text:"S",name:"Sold Out",availClass:"unavailable","aria-label":"Solid gray with letter S"})}function em(){return s.jsx(me,{text:"R",name:"Reserved",availClass:"unavailable","aria-label":"Solid color with letter R"})}function tm(){return s.jsx(me,{text:"X",name:"Unavailable",availClass:"unavailable","aria-label":"Solid color with letter X"})}function Jn(){return s.jsx(me,{text:" ",name:"Unavailable",availClass:"unavailable","aria-label":"Solid gray blank"})}function sm(){return s.jsx(me,{text:" ",name:"Not Yet Released",availClass:"available-bridged",tooltipContent:"Reservable only when bridged from an available start date","aria-label":"Striped color blank"})}function am(){return s.jsx(me,{text:" ",name:"Check-Out Only",availClass:"available-bridged",tooltipContent:"Reservable only when bridged from an available start date","aria-label":"stripe color blank"})}function nm(){return s.jsx(me,{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 rm(){return s.jsx(me,{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 im(){return s.jsx(me,{text:s.jsx("div",{className:"pt-fourth",children:s.jsx(A,{iconName:"check-circle",size:"sm",style:{color:"#5A8029"}})}),name:"Selected Available",availClass:"available-selected","aria-label":"Solid color with checkmark"})}function om(){return s.jsx(me,{text:s.jsx("div",{className:"pt-fourth",children:s.jsx(A,{iconName:"error",size:"sm",style:{color:"#D83933"}})}),name:"Selected Unavailable",availClass:"unavailable-selected","aria-label":"Solid color with error symbol"})}function lm(){return s.jsx(me,{text:s.jsx("div",{className:"pt-fourth",children:s.jsx(A,{iconName:"check",size:"sm"})}),name:"Completed",availClass:"ftm-completed","aria-label":"Solid color with checkmark"})}function cm(){return s.jsx(me,{text:"R",name:"Running",availClass:"ftm-running","aria-label":"Solid color with letter R"})}function dm(){return s.jsx(me,{text:"E",name:"Error",availClass:"ftm-error","aria-label":"Solid color with letter E"})}function um(){return s.jsx(me,{text:s.jsx("div",{className:"pt-fourth",children:s.jsx(A,{iconName:"warning",size:"sm"})}),name:"Data Issue",availClass:"ftm-data-issue","aria-label":"solid color with warning icon"})}function Xi({legendItems:t={}}){return s.jsxs("div",{className:"rec-availability-indicators",children:[t.currentReservation&&s.jsx(Hp,{}),t.loading&&null,t.available&&s.jsx(Up,{}),t.checkout&&s.jsx(Gp,{}),t.availableNumber&&s.jsx(qp,{}),t.inStation&&s.jsx(Kp,{}),t.walkup&&s.jsx(Wp,{}),t.firstComeFirstServed&&s.jsx(nm,{}),t.noTicketRequired&&s.jsx(rm,{}),t.lottery&&s.jsx(Yp,{}),t.earlyAccess&&s.jsx(Zp,{}),t["ftm-running"]&&s.jsx(cm,{}),t["ftm-completed"]&&s.jsx(lm,{}),t["ftm-dataIssue"]&&s.jsx(um,{}),t["ftm-error"]&&s.jsx(dm,{}),t.soldOut&&s.jsx(Qp,{}),t.unavailable&&s.jsx(Xp,{}),t.unavailableReserved&&s.jsx(em,{}),t.unavailableCross&&s.jsx(tm,{}),t.unavailableBlank&&s.jsx(Jn,{}),t.blocked&&s.jsx(Jn,{}),t.availableBridged&&s.jsx(sm,{}),t.slidingWindow&&s.jsx(am,{}),t.notYetReleased&&s.jsx(zp,{}),t.managementSite&&s.jsx(Op,{}),t.availableSelected&&s.jsx(im,{}),t.unavailableSelected&&s.jsx(om,{}),t.closure&&s.jsx(Jp,{})]})}Xi.propTypes={legendItems:n.shape({available:n.bool,availableBridged:n.bool,availableNumber:n.bool,availableSelected:n.bool,blocked:n.bool,checkout:n.bool,closure:n.bool,currentReservation:n.bool,earlyAccess:n.bool,firstComeFirstServed:n.bool,lottery:n.bool,managementSite:n.bool,notYetReleased:n.bool,slidingWindow:n.bool,unavailable:n.bool,unavailableBlank:n.bool,unavailableCross:n.bool,unavailableReserved:n.bool,unavailableSelected:n.bool,walkup:n.bool,noTicketRequired:n.bool})};function Ws({src:t,alt:e,className:a,size:r="md",...i}){return s.jsx("div",{"data-component":"Avatar",className:R(a,`size-${r}`),...i,role:e?"img":"presentation","aria-label":e,children:t?s.jsx("img",{src:t,alt:""}):s.jsx(A,{iconName:"account-circle"})})}n.number,n.oneOfType([n.array,n.element]).isRequired,n.func,n.bool;function hm(t,e){const a=gc(t.title,{length:e});if(t.to)return s.jsx(xr,{to:t.to,id:`breadcrumb-item-${va(a)}`,children:a});const r=t.href||t.url;return r?s.jsx("a",{href:r,id:`breadcrumb-item-${va(a)}`,children:a}):s.jsx("span",{children:a})}function hv({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((a,r)=>{const i=r===t.length-1;return s.jsxs("li",{"aria-current":i?"location":void 0,translate:a.translate,children:[hm(a,e),i?null:s.jsx("div",{className:"breadcrumb-separator","aria-hidden":"true",children:"/"})]},a.title)})})})}function pm({date:t,onComplete:e}){const[a,r]=p.useState(),i=p.useRef(),o=p.useRef(),l=()=>{const f=-1*xs(new Date,t),g=Rr({start:new Date,end:t});r(g),f<=0&&(e&&e(),window.clearInterval(i.current))};o.current=l;const c=()=>{const f=a?.hours||0,g=a?.minutes||0,h=a?.seconds||0,m=f>0?`${f} ${rt(f,"hour","hours")}`:"",b=g>0?`${g} ${rt(g,"minute","minutes")}`:"",x=h>0?`${h} ${rt(h,"second","seconds")}`:"";return`Cart - ${m} ${b} ${x} remaining to complete transactions`};p.useEffect(()=>{l(),i.current=window.setInterval(()=>{o.current&&o.current()},1e3);const f=`You have ${c()}`;return ue(f),()=>{window.clearInterval(i.current)}},[]);const d=f=>f<=0?"00":f<10?`0${f}`:f.toString(),u=()=>{const f=d(a?.hours||0),g=d(a?.minutes||0),h=d(a?.seconds||0);let m=s.jsxs("time",{children:[f,":",g,":",h]});return f==="00"&&(m=s.jsxs("time",{children:[g,":",h]})),m};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(A,{iconName:"hourglass-half"}),u()]})]})}n.array,n.number,n.oneOfType([n.array,n.element]),n.func,n.bool;n.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"]),n.string,n.bool;n.string.isRequired,n.oneOf(["status-closed","status-available","status-unreleased","status-reserved"]).isRequired;n.node;function mm({steps:t,eventToReportToGA:e,shouldReportToGA:a=!1,activeStep:r=0,"aria-label":i="Transaction progress"}){const[o,l]=p.useState(!1),c=r<1?0:r-1;return p.useEffect(()=>{if(!o&&a&&Ba(e))try{Promise.resolve(e).then(d=>{d&&l(u=>(u||Ke({event:d}),!0))})}catch(d){console.error(d)}}),s.jsxs(s.Fragment,{children:[s.jsx("ol",{className:"rec-progress-bar","aria-label":i,children:t.map((d,u)=>u{v[`p${qe(y)}-${ye(C)}`]=!0}):r&&(v[`p-${ye(r)}`]=!0),Array.isArray(i)?i.forEach((C,y)=>{v[`pl${qe(y)}-${ye(C)}`]=!0,v[`pr${qe(y)}-${ye(C)}`]=!0}):i&&(v[`pl-${ye(i)}`]=!0,v[`pr-${ye(i)}`]=!0),Array.isArray(o)?o.forEach((C,y)=>{v[`pt${qe(y)}-${ye(C)}`]=!0,v[`pb${qe(y)}-${ye(C)}`]=!0}):o&&(v[`pt-${ye(o)}`]=!0,v[`pb-${ye(o)}`]=!0),Array.isArray(l)?l.forEach((C,y)=>{v[`m${qe(y)}-${ye(C)}`]=!0}):l&&(v[`m-${ye(l)}`]=!0),Array.isArray(c)?c.forEach((C,y)=>{v[`ml${qe(y)}-${ye(C)}`]=!0,v[`mr${qe(y)}-${ye(C)}`]=!0}):c&&(v[`ml-${ye(c)}`]=!0,v[`mr-${ye(c)}`]=!0),Array.isArray(d)?d.forEach((C,y)=>{v[`mt${qe(y)}-${ye(C)}`]=!0,v[`mb${qe(y)}-${ye(C)}`]=!0}):d&&(v[`mt-${ye(d)}`]=!0,v[`mb-${ye(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),m&&(v["has-display-flex"]=!0,v[`align-y-${m}`]=!0),b&&(v[`text-align-${b}`]=!0),s.jsx(t,{"data-component":"Box",ref:x,className:R("sarsa-box",v,a),...w,children:e})}function Ia({children:t,className:e,...a}){return s.jsx("div",{"data-component":"ContentBlock",className:R("sarsa-content-block",e),...a,children:t})}function rs({color:t="gray",className:e,...a}){return s.jsx("div",{"data-component":"Divider",className:R("sarsa-divider",t,e),...a})}rs.propTypes={color:n.oneOf(["gray","blue","yellow","red","green"]),className:n.string};function Zt({children:t,space:e="md",alignY:a="center",alignX:r="left",noWrap:i=!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:R("sarsa-inline",{...d,"no-wrap":i,top:a==="top","y-center":a==="center",bottom:a==="bottom",left:r==="left",right:r==="right","x-center":r==="center"},l),...c,children:o?s.jsx("div",{children:t}):t})}function pv({size:t="md",className:e}){const a={};return Array.isArray(t)?t.forEach((r,i)=>{a[`bp-${i}-${r}`]=!0,a[`bp-${i}`]=!0}):a[`${t}`]=!0,s.jsx("div",{"data-component":"Spacer",className:R("sarsa-spacer",a,e)})}function Lt({children:t,space:e="md",hasListRole:a,className:r,...i}){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:a?"list":void 0,className:R("sarsa-stack",o,r),...i,children:a?p.Children.map(t,l=>p.isValidElement(l)?p.cloneElement(l,{role:"listitem"}):null):t})}function mv({width:t="lg",className:e,alignX:a="left",textAlign:r="left",children:i,...o}){return s.jsx("div",{"data-component":`TextBlock TextBlock-${t}`,className:R("sarsa-text-block",a,`text-align-${r}`,e,{sm:t==="sm",md:t==="md",lg:t==="lg",xl:t==="xl"}),...o,children:i})}const Xn=n.oneOf(["none","gutter","xxs","xs","sm","md","lg","xl","xxl","xxxl"]),fm=n.oneOfType([n.arrayOf(Xn),Xn]);function gm({className:t,height:e,...a}){const r=a.style,i=e?{height:e}:void 0,o={...a};return delete o.style,s.jsx("div",{"data-component":"VerticalDivider",className:R("sarsa-vertical-divider",t),style:i&&r?{...r,...i}:i,...o})}function Qi({label:t,isSelected:e,shouldFocus:a,onSelect:r,onSelectNext:i,onSelectPrevious:o,onSelectFirst:l,onSelectLast:c,controlsId:d,id:u,isDisabled:f,isHidden:g,gaTrackingId:h}){const m=p.useRef(null);p.useEffect(()=>{e&&a&&m.current?.focus()},[e,a]);const b=x=>{x.key==="ArrowRight"?(x.preventDefault(),i()):x.key==="ArrowLeft"?(x.preventDefault(),o()):x.key==="Home"?(x.preventDefault(),l()):x.key==="End"&&(x.preventDefault(),c())};return s.jsx("button",{type:"button","data-component":"TabButton",className:R({hidden:g,selected:e}),disabled:f||g,ref:m,role:"tab","aria-selected":e,tabIndex:e?void 0:-1,id:u,"aria-controls":d,onKeyDown:b,onClick:r,children:s.jsx("div",{"data-ga-tracking-id":h,children:t})})}Qi.propTypes={isSelected:n.bool,shouldFocus:n.bool.isRequired,onSelect:n.func,onSelectNext:n.func.isRequired,onSelectPrevious:n.func.isRequired,onSelectFirst:n.func.isRequired,onSelectLast:n.func.isRequired,label:n.node.isRequired,controlsId:n.string,id:n.string.isRequired,isDisabled:n.bool,isHidden:n.bool,gaTrackingId:n.string};class bm extends ie.Component{static propTypes={children:n.node.isRequired,className:n.string,background:n.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 a=this.viewport.scrollLeft,r=this.viewport.offsetWidth,i=a-r,o=Math.abs(a-i)*.5;Is({element:this.viewport,to:i,duration:o,scrollDirection:"scrollLeft"})}handleRightNavClick(e){e.preventDefault();const a=this.viewport.scrollLeft,r=this.viewport.offsetWidth,i=a+r,o=Math.abs(a-i)*.5;Is({element:this.viewport,to:i,duration:o,scrollDirection:"scrollLeft"})}setNavButtons=()=>{if(typeof this.viewport!="object")return;const e=this.viewport.scrollWidth;e!==this.scrollWidth&&(this.scrollWidth=e);const a=this.viewport.scrollLeft,r=Math.ceil(this.viewport.getBoundingClientRect().width),i=e-r,o=16,l=e<=r||a<=o,c=e<=r||a+o>=i,d=r>=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:a,background:r,...i}=this.props,{scrolledLeft:o,scrolledRight:l,doChildrenFit:c}=this.state,d=R("rec-slider-left-nav",{disabled:o,[r]:!!r}),u=R("rec-slider-right-nav",{disabled:l,[r]:!!r});return s.jsxs("div",{className:R("rec-slider-container",a),...i,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(A,{iconName:"chevron-left",size:"lg"})})}),s.jsx("div",{className:R("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(A,{iconName:"chevron-right",size:"lg"})})})]})}}function vm({children:t,defaultActiveIndex:e=0,activeIndex:a,alignButtonTabs:r="left",selectedIndexChanged:i,onChange:o,className:l,ariaLabel:c,id:d="",appearance:u="underline",tabListBackground:f,useContentBlocks:g=!1,stretchTabsToFit:h=!0,tabsAccessoryComponent:m}){const b=p.Children.map(t,E=>!!(E.props.isHidden||E.props.isDisabled)),x=E=>{let V=null,X=E;for(;V===null;)X+=1,X===b.length&&(X=0),b[X]===!1&&(V=X);return V},w=E=>{let V=null,X=E;for(;V===null;)X-=1,X===-1&&(X=b.length-1),b[X]===!1&&(V=X);return V},v=b[e]?x(e):e,[C,y]=p.useState(!1),[N,T]=p.useState(v),j=!Se(a)&&!Se(o),S=E=>`${d||"tabs"}-button-${E}`,k=E=>`${d||"tabs"}-panel-${E}`,_=(E,V,X,Z,G=!1)=>{j||T(E),o&&o(E),y(G),i&&i(E),V&&X&&Z&&ze({category:V,action:X,label:Z},()=>{})},I=p.Children.map(t,(E,V)=>{const X=j?V===a:V===N,{label:Z,isDisabled:G,isHidden:J,clickTagCategory:z,clickTagAction:se,clickTagLabel:q,gaTrackingId:L}=E.props;return s.jsx(Qi,{label:Z,isHidden:J,isDisabled:G,isSelected:X,shouldFocus:C,id:S(V),controlsId:X?k(V):void 0,gaTrackingId:L,onSelect:()=>_(V,z,se,q),onSelectFirst:()=>_(x(-1),z,se,q,!0),onSelectLast:()=>_(x(t.length-2),z,se,q,!0),onSelectNext:()=>_(x(V),z,se,q,!0),onSelectPrevious:()=>_(w(V),z,se,q,!0)},V)}),P=j?t[a]:t[N],B=p.cloneElement(P,{id:k(j?a:N),"aria-labelledby":S(j?a:N)}),W=g?Ia:"div",D=g?Ia:"div";return s.jsxs("div",{"data-component":`Tabs Tabs-${u}`,className:R(l,{"sarsa-tabs-underline":u==="underline","sarsa-tabs-block":u==="block","sarsa-tabs-button":u==="button","stretch-tabs":h,"no-stretch-tabs":!h,"sarsa-tabs-align-left":r==="left","sarsa-tabs-align-right":r==="right"}),children:[s.jsxs("div",{className:"rec-slider-wrapper",children:[s.jsx(bm,{background:f,role:"tablist","aria-label":c,children:s.jsx(W,{children:I})}),m&&s.jsx("div",{className:"tabs-accessory-component",children:m})]}),s.jsx("div",{"data-component":"TabPanels",children:s.jsx(D,{children:B})})]})}vm.propTypes={children:n.node,defaultActiveIndex:n.number,id:n.string,appearance:n.oneOf(["underline","block","button"]),alignButtonTabs:n.oneOf(["left","right"]),tabListBackground:n.oneOf(["white","gray-1","gray-2"]),activeIndex:n.number,onChange:n.func,stretchTabsToFit:n.bool,className:n.string,ariaLabel:n.string,useContentBlocks:n.bool,selectedIndexChanged:n.func,tabsAccessoryComponent:n.any};function xm({children:t,gaTrackingId:e,...a}){const r=$t(a,["isDisabled","isHidden","label","buttonStatusElement","searchParamValue","clickTagCategory","clickTagAction","clickTagLabel"]);return s.jsx("div",{"data-component":"TabPanel",role:"tabpanel","data-ga-tracking-id":e,...r,children:t})}xm.propTypes={children:n.node,isDisabled:n.bool,isHidden:n.bool,label:n.node,clickTagCategory:n.string,clickTagAction:n.string,clickTagLabel:n.string,gaTrackingId:n.string};p.forwardRef((t,e)=>{const{controlsId:a,id:r,isDisabled:i,isHidden:o,isSelected:l,label:c,onSelect:d,onSelectFirst:u,onSelectLast:f,onSelectNext:g,onSelectPrevious:h,shouldFocus:m,buttonStatusElement:b,gaTrackingId:x}=t,w=p.useRef(),v=Vs(w,e);p.useEffect(()=>{l&&m&&w.current?.focus()},[l,m]);const C=y=>{switch(y.key){case"ArrowDown":case"ArrowRight":y.preventDefault(),g();break;case"ArrowUp":case"ArrowLeft":y.preventDefault(),h();break;case"Home":y.preventDefault(),u();break;case"End":y.preventDefault(),f();break}};return s.jsxs("button",{"data-vertical-tab-button":!0,"data-ga-tracking-id":x,type:"button",className:R({hidden:o,selected:l}),disabled:i||o,ref:v,role:"tab","aria-selected":l,tabIndex:l?void 0:-1,id:r,"aria-controls":a,onKeyDown:C,onClick:d,children:[s.jsx("span",{className:"label-wrap",children:c}),b||null]})});function Pt({height:t,width:e,borderRadius:a,style:r,screenReaderText:i,...o}){return s.jsx("div",{"data-component":"Placeholder",style:{...r,height:t,borderRadius:a,width:e},...o,children:i&&s.jsx("span",{className:"rec-sr-only",children:i})})}Pt.propTypes={height:n.string,width:n.string,borderRadius:n.string,style:n.object,screenReaderText:n.string};const ym=["94%","96%","93%","96%","93%","97%","94%","96%","98%","97%","94%"];function Ea({fontSize:t=14,lineHeight:e=24,lines:a=1,width:r,alignX:i="left"}){const o=t*.857,l=Math.floor(e)-o,c=Array.from(Array(a).keys());return s.jsx("div",{"data-component":"PlaceholderText",className:R({"align-center":i==="center","align-right":i==="right"}),children:c.map(d=>{let u=r||ym[d]||"97%";return!r&&d===a-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)})})}Ea.propTypes={fontSize:n.number,lineHeight:n.number,lines:n.number,width:n.string,alignX:n.oneOf(["left","center","right"])};function zt({role:t="img",src:e,className:a,altText:r="",style:i,...o}){const l={...i};return e&&(l.backgroundImage=`url(${e})`),s.jsx("div",{"data-component":"FauxImage",className:R("sarsa-faux-image",a),role:r?t:"none","aria-label":t==="img"&&r?r:void 0,style:l,...o})}function eo({aspectRatio:t="4:3",children:e,className:a,style:r,...i}){const[o,l]=t.split(":"),c={...r,paddingBottom:`calc(${l} / ${o} * 100%)`};return s.jsx("div",{"data-component":"Frame",className:R("sarsa-frame",a),style:c,...i,children:e})}function Jt({src:t,mobileSrc:e,className:a,altText:r,aspectRatio:i,style:o,isLoading:l,...c}){const{isSmAndDown:d}=Dt();return i?s.jsx(eo,{aspectRatio:i,className:a,style:o,children:l?s.jsx(Pt,{width:"",height:""}):s.jsx(zt,{className:void 0,style:void 0,src:t,altText:r,...c})}):l?s.jsx(Pt,{style:o,width:"",height:""}):d&&e?s.jsx(zt,{src:e,altText:r,style:o,className:a,...c}):s.jsx(zt,{src:t,altText:r,style:o,className:a,...c})}const wm="/shared/img/global/unavailable/image-unavailable.webp";function fv({src:t=wm,className:e,altText:a="Photo unavailable",aspectRatio:r,style:i,...o}){return r?s.jsx(eo,{"data-sarsa-faux-unavailable-image":!0,aspectRatio:r,className:e,style:i,children:s.jsxs("div",{children:[s.jsx(zt,{src:t,altText:a,...o}),s.jsxs("figure",{children:[s.jsx(A,{iconName:"photo-unavailable",size:"lg"}),s.jsx("figcaption",{children:"Photo unavailable"})]})]})}):s.jsx("div",{"data-sarsa-faux-unavailable-image":!0,className:e,style:i,...o,children:s.jsxs("div",{children:[s.jsx(zt,{src:t,altText:a,className:e}),s.jsxs("figure",{children:[s.jsx(A,{iconName:"photo-unavailable",size:"lg"}),s.jsx("figcaption",{children:"Photo Unavailable"})]})]})})}function to({images:t,hasThumbnailStrip:e=!0,activeIndex:a=0,onActiveIndexChange:r,handleClick:i}){const[o,l]=p.useState(a),c=p.useRef(null),d=p.useRef(null),u=p.useRef(null),f=p.useRef(a),g=p.useRef([]),h=t[o],{isSmAndDown:m}=Dt(),b=h.caption||h.altText,x=150,w=16,v=t.length*x,C=t.length*w,N={width:v+C},T=D=>{f.current=D,l(D),r&&r(D)},j=(D=!0)=>{let E=f.current+1;E>=t.length&&(E=0),T(E);const V=t[E].caption||t[E].altText;D?ue(`${V} (Image ${E+1} of ${t.length})`):window.setTimeout(()=>{g.current[E]?.focus(),ue(V)},0)},S=(D=!0)=>{let E=f.current-1;E<0&&(E=t.length-1),T(E);const V=t[E].caption||t[E].altText;D?ue(`${V} (Image ${E+1} of ${t.length})`):setTimeout(()=>{g.current[E]?.focus(),ue(V)},0)},k=D=>{if(D.defaultPrevented)return;const E=D.key||D.keyCode;(E==="ArrowRight"||E==="39"||E==="ArrowDown"||E==="40")&&(D.preventDefault(),j(!1)),(E==="ArrowLeft"||E==="37"||E==="ArrowUp"||E==="38")&&(D.preventDefault(),S(!1))},_=()=>{if(!e||m||!c.current)return;const D=c.current.offsetWidth,E=c.current.scrollLeft,V=g.current[0]?.offsetWidth??0,X=g.current[0]?.offsetLeft??0,Z=g.current[o]?.offsetLeft??0;if(Z+V>D+E){const G=Z+V+X-D;Is({element:c.current,to:G,duration:250,scrollDirection:"scrollLeft"})}if(Z-E<0){const G=Z-X;Is({element:c.current,to:G,duration:250,scrollDirection:"scrollLeft"})}},P=st(()=>{_()},400);p.useEffect(()=>(window.addEventListener("keydown",k),window.addEventListener("resize",P),_(),g.current[o]&&setTimeout(()=>{g.current[o]?.focus()},70),()=>{window.removeEventListener("keydown",k),window.removeEventListener("resize",P)}),[]),p.useEffect(()=>{T(a),_()},[a]);const B=D=>E=>{E.preventDefault(),T(D),i&&i(D)},W=()=>t.map((D,E)=>s.jsx("button",{type:"button","data-testid":"galleryThumbnail",ref:V=>{g.current[E]=V},className:R("rec-gallery-thumbnail",{active:E===o}),onClick:B(E),"aria-label":`Image ${E+1} of ${t.length}: ${D.altText}`,children:s.jsx("span",{children:s.jsx("img",{src:D.url,alt:D.altText,"data-index":E})})},`${va(D.url)}`));return!t||t.length===0?null:s.jsxs("div",{className:"rec-gallery",children:[s.jsx("div",{className:"rec-gallery-main-wrap",children:s.jsxs("div",{className:"rec-gallery-slide",children:[s.jsx("img",{className:"rec-gallery-current-image","aria-label":`${b}, Image ${o+1} of ${t.length}`,src:h.url,alt:h.altText,ref:d,"data-testid":"galleryCurrentImage"}),s.jsx("button",{type:"button",onClick:()=>{S()},className:"rec-gallery-arrow rec-gallery-prev","aria-label":"Previous Image","data-testid":"galleryPrev",children:s.jsx(A,{iconName:"chevron-left"})}),s.jsx("button",{type:"button",onClick:()=>{j()},className:"rec-gallery-arrow rec-gallery-next","aria-label":"Next Image","data-testid":"galleryNext",children:s.jsx(A,{iconName:"chevron-right"})})]})}),s.jsxs("div",{id:"rec-media-gallery-caption",className:"rec-gallery-caption-group","aria-hidden":"true",children:[s.jsxs("div",{children:[s.jsx("p",{children:b}),h.credit&&s.jsx("p",{className:"rec-gallery-credit",children:h.credit})]}),s.jsxs("div",{className:"rec-current-image-index",children:[o+1," of ",t.length]})]}),s.jsx("div",{ref:c,className:R("rec-gallery-track",{hide:!e}),"data-testid":"galleryTrack",children:s.jsx("div",{ref:u,id:"rec-gallery-track-list",className:"rec-gallery-track-list",style:N,children:W()})})]})}to.propTypes={images:n.arrayOf(n.shape({url:n.string,altText:n.string,caption:n.string})).isRequired,hasThumbnailStrip:n.bool,activeIndex:n.number,handleClick:n.func};function nn({images:t=[],isOpen:e=!1,onRequestClose:a,activeIndex:r=0,onActiveIndexChange:i,hasThumbnailStrip:o=!0}){return p.useEffect(()=>{document.getElementById("recApp")&&Fe.setAppElement("#recApp")},[]),s.jsx(Fe,{isOpen:e,onRequestClose:a,role:"complementary",className:{base:"rec-modal-dialog-base",afterOpen:"rec-modal-dialog-after-open-md rec-modal-image-gallery",beforeClose:"rec-modal-dialog-before-close"},overlayClassName:{base:"rec-overlay-base",afterOpen:"rec-overlay-after-open rec-modal-image-gallery",beforeClose:"rec-overlay-before-close"},contentLabel:"Media Gallery",children:s.jsxs("div",{className:"rec-modal-content-wrap",children:[s.jsx("button",{type:"button",className:"rec-gallery-close-modal-button",onClick:a,"aria-label":"Close media gallery",children:s.jsx(A,{iconName:"close",size:"lg"})}),s.jsx(to,{images:t,activeIndex:r,onActiveIndexChange:i,hasThumbnailStrip:o})]})})}nn.propTypes={images:n.array,isOpen:n.bool,onRequestClose:n.func,activeIndex:n.number,hasThumbnailStrip:n.bool};n.string,n.string,n.string,n.string;const te=p.forwardRef((t,e)=>{const{children:a,className:r,xs:i,sm:o,md:l,lg:c,xl:d,xxl:u,alignSelf:f,order:g,xsOrder:h,smOrder:m,mdOrder:b,lgOrder:x,xlOrder:w,xxlOrder:v,xsOffset:C,smOffset:y,mdOffset:N,lgOffset:T,xlOffset:j,xxlOffset:S,semanticColName:k="div",..._}=t,I=R({"flex-col":i==="auto"||!i&&!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":i===1,"flex-col-2":i===2,"flex-col-3":i===3,"flex-col-4":i===4,"flex-col-5":i===5,"flex-col-6":i===6,"flex-col-7":i===7,"flex-col-8":i===8,"flex-col-9":i===9,"flex-col-10":i===10,"flex-col-11":i===11,"flex-col-12":i===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":m==="first","order-sm-last":m==="last","order-sm-1":m===1,"order-sm-2":m===2,"order-sm-3":m===3,"order-sm-4":m===4,"order-sm-5":m===5,"order-sm-6":m===6,"order-sm-7":m===7,"order-sm-8":m===8,"order-sm-9":m===9,"order-sm-10":m===10,"order-sm-11":m===11,"order-sm-12":m===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":w==="first","order-xl-last":w==="last","order-xl-1":w===1,"order-xl-2":w===2,"order-xl-3":w===3,"order-xl-4":w===4,"order-xl-5":w===5,"order-xl-6":w===6,"order-xl-7":w===7,"order-xl-8":w===8,"order-xl-9":w===9,"order-xl-10":w===10,"order-xl-11":w===11,"order-xl-12":w===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":C===0,"offset-1":C===1,"offset-2":C===2,"offset-3":C===3,"offset-4":C===4,"offset-5":C===5,"offset-6":C===6,"offset-7":C===7,"offset-8":C===8,"offset-9":C===9,"offset-10":C===10,"offset-11":C===11,"offset-sm-0":y===0,"offset-sm-1":y===1,"offset-sm-2":y===2,"offset-sm-3":y===3,"offset-sm-4":y===4,"offset-sm-5":y===5,"offset-sm-6":y===6,"offset-sm-7":y===7,"offset-sm-8":y===8,"offset-sm-9":y===9,"offset-sm-10":y===10,"offset-sm-11":y===11,"offset-md-0":N===0,"offset-md-1":N===1,"offset-md-2":N===2,"offset-md-3":N===3,"offset-md-4":N===4,"offset-md-5":N===5,"offset-md-6":N===6,"offset-md-7":N===7,"offset-md-8":N===8,"offset-md-9":N===9,"offset-md-10":N===10,"offset-md-11":N===11,"offset-lg-0":T===0,"offset-lg-1":T===1,"offset-lg-2":T===2,"offset-lg-3":T===3,"offset-lg-4":T===4,"offset-lg-5":T===5,"offset-lg-6":T===6,"offset-lg-7":T===7,"offset-lg-8":T===8,"offset-lg-9":T===9,"offset-lg-10":T===10,"offset-lg-11":T===11,"offset-xl-0":j===0,"offset-xl-1":j===1,"offset-xl-2":j===2,"offset-xl-3":j===3,"offset-xl-4":j===4,"offset-xl-5":j===5,"offset-xl-6":j===6,"offset-xl-7":j===7,"offset-xl-8":j===8,"offset-xl-9":j===9,"offset-xl-10":j===10,"offset-xl-11":j===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"}),P=k;return s.jsx(P,{className:R(I,r),"data-component":"FlexCol",ref:e,..._,children:a})});te.propTypes={children:n.any,className:n.string,xs:n.oneOf(["auto","variable",1,2,3,4,5,6,7,8,9,10,11,12]),sm:n.oneOf(["auto","variable",1,2,3,4,5,6,7,8,9,10,11,12]),md:n.oneOf(["auto","variable",1,2,3,4,5,6,7,8,9,10,11,12]),lg:n.oneOf(["auto","variable",1,2,3,4,5,6,7,8,9,10,11,12]),xl:n.oneOf(["auto","variable",1,2,3,4,5,6,7,8,9,10,11,12]),xxl:n.oneOf(["auto","variable",1,2,3,4,5,6,7,8,9,10,11,12]),alignSelf:n.oneOf(["start","center","end","baseline","stretch"]),order:n.oneOf(["first","last",1,2,3,4,5,6,7,8,9,10,11,12]),xsOrder:n.oneOf(["first","last",1,2,3,4,5,6,7,8,9,10,11,12]),smOrder:n.oneOf(["first","last",1,2,3,4,5,6,7,8,9,10,11,12]),mdOrder:n.oneOf(["first","last",1,2,3,4,5,6,7,8,9,10,11,12]),lgOrder:n.oneOf(["first","last",1,2,3,4,5,6,7,8,9,10,11,12]),xlOrder:n.oneOf(["first","last",1,2,3,4,5,6,7,8,9,10,11,12]),xxlOrder:n.oneOf(["first","last",1,2,3,4,5,6,7,8,9,10,11,12]),xsOffset:n.oneOf([0,1,2,3,4,5,6,7,8,9,10,11]),smOffset:n.oneOf([0,1,2,3,4,5,6,7,8,9,10,11]),mdOffset:n.oneOf([0,1,2,3,4,5,6,7,8,9,10,11]),lgOffset:n.oneOf([0,1,2,3,4,5,6,7,8,9,10,11]),xlOffset:n.oneOf([0,1,2,3,4,5,6,7,8,9,10,11]),xxlOffset:n.oneOf([0,1,2,3,4,5,6,7,8,9,10,11]),semanticColName:n.any};const he=p.forwardRef((t,e)=>{const{children:a,className:r,alignItems:i,justifyContent:o,flexDirection:l="row",hasGutters:c=!0,isOuterContainer:d=!1,isOuterContainerSingleColumn:u=!1,semanticRowName:f="div",...g}=t,h=R("flex-grid",{"align-items-start":i==="start","align-items-center":i==="center","align-items-end":i==="end","align-items-stretch":i==="stretch","align-items-baseline":i==="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"}),m=f;return s.jsx(m,{className:R(h,r),"data-component":"FlexRow",ref:e,...g,children:a})});he.propTypes={children:n.any,className:n.string,alignItems:n.oneOf(["start","center","end","stretch","baseline"]),justifyContent:n.oneOf(["start","center","end","space-around","space-between"]),hasGutters:n.bool,isOuterContainer:n.bool,isOuterContainerSingleColumn:n.bool,flexDirection:n.oneOf(["row","row-reverse","column","column-reverse"]),semanticRowName:n.any};function Cm({assetId:t,campsiteId:e,tourId:a,images:r,headingLevel:i=2,headingAppearance:o="h5",hasThumbnailStrip:l=!0,className:c}){const[d,u]=p.useState(!1),[f,g]=p.useState(0),[h,m]=p.useState(""),[b,x]=p.useState(r||[]),w=p.useRef(!1);p.useEffect(()=>{let N,T;return w.current=!0,t?(N="asset",T=t):a?(N="tour",T=a):e&&(N="campsite",T=e),N&&T&&!r&&oe.get(`/api/media/public/${N}/${T}`,{}).then(j=>{if(j&&!j.data.err&&j.data.result){const S=j.data.result.filter(_=>{const{is_gallery:I,title:P,url:B}=_;return!(!I||!P||!B)});S.sort((_,I)=>_.position-I.position);const k=S.map(_=>({altText:_.title||_.description,caption:_.description,url:_.url,credit:_.credits}));w.current&&x(k)}}).catch(j=>{throw j}),()=>{w.current=!1}},[]),p.useEffect(()=>{r&&x(r)},[r]);const v=(N,T)=>{g(N),m(`media-block-${T}`),u(!0)},C=()=>{u(!1),window.setTimeout(()=>{document.getElementById(h)?.focus()},0)},y=()=>{let N=b.slice(0);const T=b.length;T>6&&(N=b.slice(0,5));const j=N.map((S,k)=>s.jsx(te,{sm:6,lg:4,children:s.jsxs("button",{type:"button",id:`media-block-${k}`,className:"rec-media-gallery-item-button",onClick:()=>v(k,k),children:[s.jsx("span",{className:"rec-media-gallery-item-button-inner",style:{backgroundImage:`url(${S.url})`}}),s.jsx("span",{className:"rec-sr-only",children:`Image ${k+1} of ${T}: ${S.altText}. Open this image in the gallery`})]})},S.url));return T>6&&j.push(s.jsx(te,{sm:6,lg:4,children:s.jsx("button",{type:"button",className:"rec-media-gallery-item-button rec-media-gallery-more",id:"media-block-all",onClick:()=>v(0,"all"),children:s.jsxs("span",{className:"rec-media-gallery-more-inner",children:[s.jsx(A,{iconName:"camera"}),s.jsxs("span",{children:["View all ",T," photos"]})]})})},"rec-media-gallery-more")),j};return!b||!b.length?null:s.jsxs("div",{className:R("rec-media-gallery",c),"data-component":"MediaGallery",children:[s.jsx(re,{headingLevel:i,appearance:o,children:"Media Gallery"}),s.jsx(he,{children:y()}),s.jsx(nn,{images:b,isOpen:d,onRequestClose:C,activeIndex:f,hasThumbnailStrip:l})]})}Cm.propTypes={assetId:n.string,campsiteId:n.string,tourId:n.string,images:n.arrayOf(n.shape({altText:n.string,caption:n.string,url:n.string,credit:n.string})),headingLevel:n.number,headingAppearance:n.string,hasThumbnailStrip:n.bool,className:n.string};function rn({flag:t,flagValueToMatch:e=!0,fallback:a,children:r}){try{const i=es();if(i[t]===e)return r;if(a&&(i[t]===null||i[t]===void 0))return null}catch(i){console.error(i)}return a||null}rn.propTypes={flag:n.string.isRequired,children:n.node.isRequired,fallback:n.node,flagValueToMatch:n.any};function on({isInternal:t=!1}={}){const e=t?"r1s-ld-user-bucket-int-100":"r1s-ld-user-bucket-ext-100";if(!Ce())return;let a=window.localStorage.getItem(e);if(a)try{a=String(parseInt(a,10))}catch{a=null}return a||(a=String(Math.floor(Math.random()*100)+1),window.localStorage.setItem(e,`${a}`)),a}function Sm(t){const e=Ie(),a=Ls();p.useEffect(()=>{a&&t&&e(Gi(a))},[e,a,t])}function Nm(){const t=p.useRef(!1),e=Ls(),a=qa()?.account_id;p.useEffect(()=>{if(t.current||!e||!a)return;const r=on();t.current=!0,e.identify({kind:"user",key:a,anonymous:!1,user_bucket:r,account_id:a,uri:window?.location?.pathname})},[a,e])}const jm="588a570044b03e0b32112cfc",Qn=on();function Tm({children:t,waitUntilReady:e=!1,addToRedux:a=!0}){const[r,i]=p.useState(!1),o=Ls();return Sm(a),Nm(),p.useEffect(()=>{o&&e&&o.waitForInitialization(2).then(()=>{i(!0)}).catch(()=>{i(!0)})},[e,o]),e&&!r?null:t}const Rm={clientSideID:jm,context:{kind:"user",key:`bucket100_${Qn}`,anonymous:!0,user_bucket:Qn,uri:Ce()?window.location.pathname:void 0},options:{logger:Ir({level:"error"})}},gv=Er(Rm)(Tm),Im="588a570044b03e0b32112cfc",ka=on({isInternal:!0});function Em({children:t}){const e=Ie();let a="";const r=Wr();r!==""&&(a=r);const i=Ls();return p.useEffect(()=>{e(Gi(i))},[e,i]),p.useEffect(()=>{a&&i&&i.identify({kind:"user",key:a,anonymous:!1,user_bucket:ka,account_id:a,uri:window?.location?.pathname})},[a,i]),t}const km={clientSideID:Im,context:{kind:"user",key:`bucket100_int_${ka}`,anonymous:!0,user_bucket:ka,uri:window?.location?.pathname},options:{logger:Ir({level:"error"})}};Er(km)(Em);function so({isStretchy:t=!1,className:e}){const a="/shared/img/global/unavailable/image-unavailable.webp";return s.jsxs("div",{className:R("rec-image-unavailable-wrap",e,{stretchy:t}),"data-testid":"rec-image-unavailable-wrap",children:[s.jsxs("figure",{children:[s.jsx(A,{iconName:"photo-unavailable"}),s.jsx("figcaption",{children:"Photo Unavailable"})]}),t&&s.jsx("div",{className:"img",role:"img","aria-label":"Unavailable",style:{backgroundImage:`url(${a})`}}),!t&&s.jsx("img",{src:a,alt:"Unavailable","aria-label":"Unavailable"})]})}so.propTypes={isStretchy:n.bool,className:n.string};const Ut=s.jsx("div",{className:"rec-inventory-image-wrap",children:s.jsx(so,{})});class bv extends p.Component{static{this.propTypes={type:n.string,id:n.string,hasFauxImageRatio:n.string,hasFauxImageSize:n.string}}static{this.defaultProps={hasFauxImageRatio:"",hasFauxImageSize:""}}constructor(e){super(e),this.state={image:Ut,loaded:!1}}componentDidMount(){const{type:e,id:a}=this.props;e&&a&&this.loadMedia(e,a)}componentDidUpdate(e){const{id:a,type:r}=this.props;(a&&e.id!==a||r&&e.type!==r)&&this.loadMedia(r,a)}loadMedia(e,a){oe.get(`/api/media/public/${e}/${a}`,{}).then(r=>{if(r&&!r.data.err)if(r.data.result){const i=r.data.result;let o=Va(i,{is_preview:!0});o===void 0&&(o=null);let l=null;!o&&i.length>0&&(o=i[0]),(this.props.hasFauxImageRatio||this.props.hasFauxImageSize)&&o?l=s.jsxs("div",{className:"rec-flex-card-image-wrap",children:[this.props.hasFauxImageRatio&&s.jsx(Jt,{aspectRatio:this.props.hasFauxImageRatio,src:o.url,altText:o.title}),this.props.hasFauxImageSize&&s.jsx(Jt,{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=Ut,this.setState({image:l,loaded:!0})}else this.setState({image:Ut,loaded:!0});else this.setState({image:Ut,loaded:!0})}).catch(()=>{this.setState({image:Ut,loaded:!0})})}render(){return this.state.loaded?this.state.image:null}}function _m({heroImageUrl:t,ariaLabel:e,style:a,className:r,...i}){return s.jsx("div",{className:`rec-hero-full-width-wrap ${r||""}`,style:{...a,backgroundImage:`url(${t})`},...i,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 Am({altText:t,ariaLabel:e,image:a="/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(${a})`}}),s.jsx("img",{className:"rec-hero-low-quality-image",src:a,alt:t,"aria-label":e})]})}function ln({hasOverlayCopy:t=!0}){return s.jsx("div",{className:"rec-hero-image-unavailable-wrap",children:t&&s.jsxs("figure",{children:[s.jsx(A,{iconName:"photo-unavailable"}),s.jsx("figcaption",{children:"Photo Unavailable"})]})})}ln.propTypes={hasOverlayCopy:n.bool};const qt={HERO_IMAGE:"heroImage",HERO_IMAGE_LOW_QUALITY:"heroImageLowQuality",HERO_IMAGE_UNDEFINED:"heroImageUndefined"};class vv extends p.PureComponent{constructor(e){super(e),this.loadMedia=()=>{oe.get(`/api/media/public/${this.props.type}/${this.props.id}`,{}).then(a=>{if(a&&!a.data.err&&a.data.result){const r=a.data.result;let i=Va(r,{is_primary:!0});i===void 0&&(i=null),!i&&r.length>0&&(i=r[0]),i&&(i.width&&bc(i.width)>=1240?this._mounted&&this.setState({loaded:!0,heroImage:i.url,ariaLabel:i.title,type:qt.HERO_IMAGE}):this._mounted&&this.setState({loaded:!0,heroImage:i.url,altText:i.title,ariaLabel:i.description?i.description:i.title,type:qt.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:qt.HERO_IMAGE_UNDEFINED,loaded:!1},this._mounted=!1}static{this.propTypes={type:n.string,id:n.string,loadingType:n.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(Pt,{width:"100%",height:"100%"})}):s.jsx(Le,{size:"xl"});return this.state.type===qt.HERO_IMAGE?e=s.jsx(_m,{heroImageUrl:this.state.heroImage,ariaLabel:this.state.ariaLabel}):this.state.type===qt.HERO_IMAGE_LOW_QUALITY?e=s.jsx(Am,{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(ln,{})})),e}}function Lm({html:t}){const e=yr.sanitize(t);return s.jsx(s.Fragment,{children:fa(e)})}class Pm extends p.PureComponent{static{this.propTypes={imagePath:n.string,src:n.string,type:n.string,fallbackExtension:n.string,fallbackSrc:n.string,alt:n.string,imgHeight:n.oneOfType([n.string,n.number]),imgWidth:n.oneOfType([n.string,n.number]),altImageSizes:n.arrayOf(n.shape({viewportMaxWidth:n.number,path:n.string}))}}static{this.defaultProps={imagePath:"",type:"image/webp",fallbackExtension:"jpg",alt:"",imgHeight:"auto",imgWidth:"100%",altImageSizes:[]}}render(){const{imagePath:e,src:a,fallbackSrc:r,type:i,fallbackExtension:o,alt:l,imgHeight:c,imgWidth:d,altImageSizes:u}=this.props;return s.jsxs("picture",{children:[u&&u.map((f,g)=>s.jsxs(p.Fragment,{children:[s.jsx("source",{media:`(max-width: ${f.viewportMaxWidth}px)`,srcSet:`${f.path}.webp`,type:i}),s.jsx("source",{media:`(max-width: ${f.viewportMaxWidth}px)`,srcSet:`${f.path}.${o}`,type:i})]},g)),s.jsx("source",{srcSet:a||`${e}.webp`,type:i}),s.jsx("img",{src:r||`${e}.${o}`,alt:l,height:c,width:d})]})}}function ce({children:t,size:e="md",color:a="black",align:r="left",fontWeight:i="normal",fontStyle:o="normal",tag:l="p",className:c,hasMarginBetween:d=!1,isTruncated:u=!1,...f}){const g=l;return s.jsx(g,{className:R("sarsa-text",c,{"color-gray":a==="gray","color-white":a==="white","color-link":a==="link","color-danger":a==="danger","align-center":r==="center","align-right":r==="right","size-xl":e==="xl","size-lg":e==="lg","size-sm":e==="sm","size-xs":e==="xs","weight-bold":i==="bold","weight-semibold":i==="semibold","style-italic":o==="italic","margin-between":d,truncated:u}),...f,children:t})}function Qe({value:t,children:e,isDisabled:a,gaTrackingId:r}){return s.jsx("option",{value:t,disabled:a,"data-ga-tracking-id":r,children:e})}Qe.propTypes={value:n.string.isRequired,children:n.node.isRequired,isDisabled:n.bool,gaTrackingId:n.string};const er=(t,e,a)=>{if(t[e]!=null){const r=typeof t[e],i=!!t.multiple;if(i&&!Array.isArray(t[e]))return new Error(`Invalid prop \`${e}\` of type \`${r}\` supplied to \`${a}\`, expected \`array\``);if(!i&&r!=="string")return new Error(`Invalid prop \`${e}\` of type \`${r}\` supplied to \`${a}\`, expected \`string\``)}return null};class Ks extends p.PureComponent{constructor(e){super(e),this.getSelectSize=()=>{const{size:a,multiple:r}=this.props,i=parseInt(String(a),10);return i||i>=0?i:r?4:1},this.handleChangeForOnlyOption=()=>{const{options:a,onChange:r,id:i,name:o,shouldAutoSelectIfOnlyOneOption:l}=this.props;if(l&&r&&!this.singleOptionHasCalledOnChange&&a?.length){this.singleOptionHasCalledOnChange=!0;const c={target:{value:a[0].value,id:i,name:o}};r(c)}},this.handleChange=a=>{const{onChange:r}=this.props,{isInvalid:i}=this.state,o=a.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})),i&&this.setState({isInvalid:!1}),r&&r(a)},this.validate=()=>{const{id:a,isRequired:r}=this.props,{errorText:i}=this.state;let o;const l={isInvalid:!1,errorText:null,id:a};return typeof this.selectRef=="object"?o=this.selectRef.current.value:o=this.selectRef.value,r&&!o?(l.isInvalid=!0,l.errorText=i,this.setState({isInvalid:!0})):this.setState({isInvalid:!1}),l},this.renderOptions=()=>{const{options:a,gaTrackingId:r}=this.props;return a?.map(i=>s.jsx(Qe,{value:i.value,gaTrackingId:r,children:i.label},i.value))},this.state={isInvalid:this.props.isInvalid||!1,errorText:e.errorText||`${e.label} is required.`},this.selectRef=e.innerRef||p.createRef(),this.singleOptionHasCalledOnChange=!1}static{this.propTypes={id:n.string.isRequired,label:n.node.isRequired,isLabelVisible:n.bool,isRequired:n.bool,isDisabled:n.bool,isInline:n.bool,placeholder:n.string,errorText:n.node,isInvalid:n.bool,value:er,onChange:n.func,defaultValue:er,children:n.node,innerRef:n.oneOfType([n.object,n.func]),name:n.string,options:n.arrayOf(n.shape({label:n.node,value:n.string})),className:n.string,multiple:n.bool,size:n.number,shouldAutoSelectIfOnlyOneOption:n.bool,shouldRenderTextIfOnlyOneOption:n.bool,isLoading:n.bool,gaTrackingId:n.string,translate:n.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:a,errorText:r,label:i,options:o}=this.props;typeof a=="boolean"&&a!==e.isInvalid&&this.setState({isInvalid:a}),r!==e.errorText&&this.setState({errorText:r}),i!==e.label&&!r&&this.setState({errorText:`${i} is required.`}),o?.length===1&&this.handleChangeForOnlyOption()}render(){const{id:e,label:a,isLabelVisible:r,isRequired:i,isDisabled:o,isInline:l,placeholder:c,children:d,value:u,defaultValue:f,options:g,className:h,multiple:m,shouldRenderTextIfOnlyOneOption:b,isLoading:x,translate:w,...v}=this.props,C=$t(v,["errorText","isInvalid","onChange","innerRef","size","shouldAutoSelectIfOnlyOneOption","gaTrackingId","translate"]),{errorText:y,isInvalid:N}=this.state,T=Array.isArray(g)&&g.length>0,j=typeof u=="string",S=this.getSelectSize();return x?s.jsx(Pt,{height:"4rem",width:"auto"}):s.jsxs("div",{"data-component":"Select",className:R(h,{"sarsa-field-outer-container":!l,"sarsa-field-outer-container-inline":l}),children:[s.jsx("div",{className:"sarsa-field-label-wrapper",children:s.jsx(ut,{htmlFor:e,isVisible:r,isRequired:i,children:a})}),s.jsx("div",{className:"sarsa-field-inner-container",children:s.jsx("div",{className:R("sarsa-field-input-wrapper",{inline:l,"no-label":!r}),children:b&&g?.length===1?s.jsx(bt,{id:e,alignY:"center",padding:"xs",border:"gray",background:"gray-2",style:{height:"auto",opacity:"0.7"},translate:w,children:s.jsx(ce,{children:g[0].label})}):s.jsxs("select",{className:R("sarsa-select",{"is-invalid":N}),id:e,defaultValue:j?void 0:f,value:u,onChange:this.handleChange,disabled:o,multiple:m,size:S,required:i,"aria-invalid":this.state.isInvalid,"aria-describedby":this.state.isInvalid&&y?`${e}-error`:void 0,ref:this.selectRef,translate:w,...C,children:[!m&&c&&s.jsx(Qe,{value:"",isDisabled:!0,children:c}),T&&this.renderOptions(),d]})})}),N&&y&&s.jsxs("div",{id:`${e}-error`,className:"sarsa-field-error-message",children:[s.jsx("span",{className:"req","aria-hidden":"true",children:"*"}),y]})]})}}class Mm extends p.PureComponent{constructor(e){super(e),this.validate=()=>this.selectRef.current.validate(),this.countryOptions=Gd.sort((a,r)=>a.labelr.label?1:0),this.selectRef=p.createRef()}static{this.propTypes={id:n.string.isRequired,label:n.node,placeholder:n.string}}static{this.defaultProps={label:"Country",placeholder:"Choose a country ..."}}render(){const{label:e,id:a,placeholder:r,...i}=this.props,o=$t(i,["ref"]);return s.jsxs(Ks,{ref:this.selectRef,label:e,id:a,placeholder:r,...o,children:[qd.map(l=>s.jsx(Qe,{value:l.value,children:l.label},l.value)),s.jsx(Qe,{value:"divider",isDisabled:!0,children:"─────────"}),this.countryOptions.map(l=>s.jsx(Qe,{value:l.value,children:l.label},l.value))]})}}class Om extends p.PureComponent{constructor(e){super(e),this.getStateOptions=()=>{const{hasTerritories:a,hasArmedForces:r}=this.props;let i=[...zd];return a&&(i=[...i,...Wd]),r&&(i=[...i,...Kd]),i.sort((o,l)=>o.labell.label?1:0)},this.validate=()=>this.selectRef.current.validate(),this.state={stateOptions:this.getStateOptions()},this.selectRef=p.createRef()}static{this.propTypes={id:n.string.isRequired,label:n.node,hasTerritories:n.bool,hasArmedForces:n.bool,placeholder:n.string,value:n.string,gaTrackingId:n.string}}static{this.defaultProps={label:"State",hasTerritories:!0,hasArmedForces:!0,placeholder:"Choose a state ...",value:void 0}}componentDidUpdate(e){const{hasTerritories:a,hasArmedForces:r}=this.props;(e.hasTerritories!==a||e.hasArmedForces!==r)&&this.setState({stateOptions:this.getStateOptions()})}render(){const{value:e,gaTrackingId:a,id:r,label:i,placeholder:o,...l}=this.props,{stateOptions:c}=this.state,d=$t(l,["hasTerritories","hasArmedForces"]),f=e===void 0||e===""||c.some(g=>g.value===e)?e:void 0;return s.jsx(Ks,{id:r,label:i,ref:this.selectRef,value:f,gaTrackingId:a,placeholder:o,...d,children:c.map(g=>s.jsx(Qe,{value:g.value,children:g.label},g.value))})}}function $m({title:t,text:e="",hasDarkText:a=!1,hasUnderline:r=!0,hasDarkUnderline:i=!1,hasButton:o=!1,isScroll:l=!1,buttonAppearance:c,buttonSize:d="lg",buttonText:u,buttonLink:f="#",className:g,semanticElementName:h="section",hasSelectElem:m=!1,selectID:b,selectLabel:x,render:w,selectPlaceholder:v,selectButtonText:C,selectOptions:y,selectButtonOnClick:N,buttonIconBeforeText:T,buttonIconAfterText:j,hideTitle:S,overlayImagePath:k,overlayImageFallbackExtension:_="png",overlayImageAltText:I,overlayImagePositionTop:P,overlayImagePositionBottom:B,overlayImagePositionRight:W,overlayImagePositionLeft:D,backgroundImagePath:E="",backgroundImageAltText:V="",backgroundImageColorOverlay:X="#000000",backgroundImageColorOverlayOpacity:Z=.4,hasAvifImageFormat:G=!0,hasWebPImageFormat:J=!0,imageSrcConfig:z}){let se;const q=h,L=P||W||B||D,H=[{size:"lg",width:"2000w"},{size:"md",width:"1440w"},{size:"sm",width:"768w"}],Q=O=>{const $=()=>H.map(Y=>z?`${z[O][Y.size]} ${Y.width}`:`/shared${E}-${Y.size}.${O} ${Y.width}`);return O==="jpg"?s.jsx("img",{alt:V,src:`/shared${E}-md.${O}`,srcSet:`${$()}`,className:"rec-section-hero-background-image"}):s.jsx("source",{type:`image/${O}`,sizes:"100vw",srcSet:`${$()}`})},K=()=>{if(se){const O=se.selectedIndex-1;O>=0&&N&&y?.length&&N(y[O])}},F=O=>{if(l&&(O.preventDefault(),f)){const $=document.getElementById(f);$&&$.scrollIntoView({behavior:"smooth",block:"start"})}},ee=()=>s.jsxs(s.Fragment,{children:[t&&s.jsx(re,{headingLevel:1,appearance:"h1",className:R("rec-section-hero-title",{"rec-long-hero-title":t.length>30,"has-dark-text":a,"has-dark-underline":i,"has-no-underline":!r,"hide-title":S}),children:t}),k&&s.jsx("div",{className:R("rec-section-hero-overlay-image",{"image-has-set-position":L}),style:{top:P,bottom:B,right:W,left:D},children:s.jsx(Pm,{imagePath:k,fallbackExtension:_,alt:I})}),!!e&&s.jsx("p",{className:R("rec-section-hero-text",{"has-dark-text":a}),children:s.jsx(Lm,{html:e})}),m&&s.jsxs("div",{className:"rec-section-hero-select-wrap",children:[s.jsx(Ks,{id:b||"",label:x,isLabelVisible:!1,placeholder:v,options:y,innerRef:O=>{se=O},isInline:!0}),s.jsx(M,{appearance:c,size:"lg",className:"hero-select-button",onClick:K,children:C})]}),o&&s.jsx(M,{appearance:c,href:l?`#${f}`:f,size:d,className:"mt-2",onClick:F,iconBeforeElement:T||null,iconAfterElement:j||null,children:u}),w&&w()]});return s.jsx(q,{"aria-label":t,className:R("rec-section-hero-full-width-wrap",g,{"no-background-gradient":a}),children:s.jsxs("div",{className:"rec-section-hero-body-outer-wrap",children:[s.jsx("div",{className:"rec-section-hero-body",children:ee()}),s.jsx("div",{className:"rec-section-hero-background-image-overlay",style:{background:X,opacity:Z}}),s.jsxs("picture",{children:[G&&Q("avif"),J&&Q("webp"),Q("jpg")]})]})})}$m.propTypes={title:n.string,text:n.string,hasDarkText:n.bool,hasUnderline:n.bool,hasDarkUnderline:n.bool,hasButton:n.bool,isScroll:n.bool,buttonAppearance:n.oneOf(["primary","secondary","tertiary","tertiary-alt","tertiary-white","solid-white","subtle","link","danger","subtle-danger","pill"]),buttonSize:n.oneOf(["xxs","xs","sm","md","lg"]),buttonText:n.string,buttonLink:n.string,className:n.string,semanticElementName:n.oneOf(["nav","main","section","div"]),hasSelectElem:n.bool,selectID:n.string,selectLabel:n.string,render:n.func,selectPlaceholder:n.string,selectButtonText:n.string,selectOptions:n.arrayOf(n.shape({label:n.string,value:n.string})),selectButtonOnClick:n.func,buttonIconBeforeText:n.object,buttonIconAfterText:n.object,hideTitle:n.bool,overlayImagePath:n.string,overlayImageFallbackExtension:n.string,overlayImageAltText:n.string,overlayImagePositionTop:n.string,overlayImagePositionBottom:n.string,overlayImagePositionRight:n.string,overlayImagePositionLeft:n.string,backgroundImagePath:n.string,backgroundImageAltText:n.string,backgroundImageColorOverlay:n.string,backgroundImageColorOverlayOpacity:n.number,hasAvifImageFormat:n.bool,hasWebPImageFormat:n.bool,imageSrcConfig:n.shape({avif:n.shape({lg:n.string,md:n.string,sm:n.string}),webp:n.shape({lg:n.string,md:n.string,sm:n.string}),jpg:n.shape({lg:n.string,md:n.string,sm:n.string})})};const Dm={warning:"light-yellow",info:"light-blue",error:"light-red",success:"light-green"},Fm={warning:"yellow",info:"blue",error:"red",success:"green"},Vm={warning:"warning",info:"info",error:"error",success:"check-circle"};function je({children:t,heading:e,headingLevel:a=2,type:r="warning",shouldFocusOnMount:i=!1,className:o,hasBoxStyling:l=!0,showCloseButton:c=!1,onCloseButtonClick:d,hasAriaLive:u=!1,...f}){const g=p.useRef(null),h=r==="error"?"assertive":"polite";p.useEffect(()=>{let b;return i&&(b=setTimeout(()=>{g.current?.focus()},0)),()=>{clearTimeout(b)}},[i]);const m=Vm[r];return s.jsx("div",{"data-component":"Alert",ref:g,tabIndex:i?-1:void 0,className:R("sarsa-alert",r,o),...f,children:s.jsxs(bt,{className:R({"show-close-button":c}),background:l?Dm[r]:void 0,border:l?Fm[r]:void 0,padding:l?"sm":void 0,children:[s.jsx(A,{size:"md",iconName:m,className:r,"aria-label":r}),s.jsxs(Lt,{space:"xxs","aria-live":u?h:"off",children:[e&&s.jsx(re,{headingLevel:a,appearance:"h6",children:e}),s.jsx("div",{className:"alert-body",children:t})]}),c&&s.jsx(M,{className:"sarsa-alert-close-button",size:"xs",appearance:"subtle","aria-label":"Dismiss alert",iconBeforeElement:s.jsx(A,{iconName:"close"}),onClick:d})]})})}je.propTypes={children:n.node,heading:n.string,headingLevel:n.oneOf([1,2,3,4,5,6]),type:n.oneOf(["info","error","warning","success"]),shouldFocusOnMount:n.bool,hasBoxStyling:n.bool,className:n.string,showCloseButton:n.bool,onCloseButtonClick:n.func,hasAriaLive:n.bool};class xv extends p.PureComponent{constructor(e){super(e),this.handleDecreaseCountClick=()=>{const{min:a,count:r}=this.props;if(typeof r=="number"){const i=r-1;typeof a=="number"&&i>=a&&!this.props.disableDecreaseCount&&this.props.onCountChange(i)}},this.handleIncreaseCountClick=()=>{const{max:a,count:r}=this.props;if(typeof r=="number"){const i=r+1;typeof a=="number"&&i<=a&&!this.props.disableIncreaseCount&&this.props.onCountChange(i)}},this.state={count:e.count||0},this.handleInputChange=this.handleInputChange.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this)}static{this.propTypes={label:n.string.isRequired,onCountChange:n.func.isRequired,validationClass:n.string,disableDecreaseCount:n.bool,disableIncreaseCount:n.bool,disableTextInput:n.bool,max:n.number,min:n.number,count:n.number,iconClass:n.string,inputClass:n.string}}static{this.defaultProps={count:0,min:0,max:999,iconClass:"rec-increment-icon",inputClass:"rec-increment-quantity"}}componentDidUpdate(e){const{count:a}=this.props;typeof a=="number"&&a!==e.count&&a!==this.state.count&&this.setState({count:a})}handleInputChange(e){e.preventDefault();const a=e.target.value;/^\d+$/.test(a)?(this.setState({count:a}),this.props.onCountChange(parseInt(a,10))):a===""?this.setState({count:""}):ue("Error: Enter only numbers.")}handleInputBlur(){const{onCountChange:e,min:a,max:r}=this.props,{count:i}=this.state;if(i===""){let o=0;typeof a=="number"&&or&&(o=r),o!==i&&e(o))}}render(){const{validationClass:e,disableDecreaseCount:a,disableIncreaseCount:r,disableTextInput:i,count:o,label:l,min:c,max:d,iconClass:u,inputClass:f}=this.props;let g="",h="",m=this.handleDecreaseCountClick,b=this.handleIncreaseCountClick;return(a||o===c)&&(g="disabled",m=void 0),(r||o===d)&&(h="disabled",b=void 0),s.jsxs("div",{className:"rec-increment-wrap",children:[s.jsx("button",{className:`${u} ${g}`,onClick:m,type:"button",disabled:o===c||a,"aria-label":`Decrease ${l} count by one`,children:s.jsx("span",{children:s.jsx(A,{iconName:"remove-circle-outline"})})}),s.jsxs("div",{className:f,children:[s.jsx(ut,{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:i,value:this.state.count,onChange:this.handleInputChange,onBlur:this.handleInputBlur})]}),s.jsx("button",{className:`${u} ${h}`,onClick:b,disabled:r,type:"button","aria-label":`Increase ${l} count by one`,children:s.jsx("span",{children:s.jsx(A,{iconName:"add-circle-outline"})})})]})}}function ao({id:t,triggerButtonElement:e,isDisabled:a=!1,size:r="md",applyButtonLabel:i="Apply",children:o,popupLeftActionElement:l,onApply:c,onClose:d,showPopupActions:u=!0,innerRef:f,className:g,dataComponent:h,render:m,clickTagCategory:b,clickTagAction:x,clickTagLabel:w,gaTrackingId:v,gaTrackingValue:C,dropdownAriaAttributes:y=!0,focusElement:N,applyButtonRef:T,baseTitle:j,isTitleVisible:S=!1}){const k=p.useRef(null),_=p.useRef(null),I=p.useRef(null),P=f||_,[B,W]=p.useState(!1),D=ct(t),E=p.useCallback(()=>{W(!1),d&&d()},[d]);p.useEffect(()=>{function z(q){B&&(q.key==="Escape"&&(q.preventDefault(),E(),P?.current?.focus&&P.current.focus()),q.key==="Tab"&&k?.current?.contains&&!k.current.contains(document.activeElement)&&E())}function se(q){B&&k.current&&!k.current.contains(q.target)&&E()}return document.addEventListener("keyup",z),document.addEventListener("click",se),()=>{document.removeEventListener("keyup",z),document.removeEventListener("click",se)}},[P,E,B]);const V=p.useCallback(z=>{z.preventDefault(),B?E():W(!0)},[E,B]),X=p.useCallback(z=>{z.preventDefault(),E(),N?N?.focus():P.current?.focus(),c&&c()},[P,E,N,c]),Z=()=>{const z=D||"trigger-button-id",se=y?{"aria-haspopup":"dialog","aria-expanded":B,"aria-controls":`${D}-popup`}:"";return p.cloneElement(e,{id:z,isDisabled:a,isExpanded:B,...se,innerRef:P,onClick:V,"data-test-id":"dropdown-base-trigger",gaTrackingId:v,gaTrackingValue:B?"Close Dropdown":"Open Dropdown"})},G=()=>m?m(B,E):o,J=y?"dialog":void 0;return s.jsxs("div",{"data-component":h||"DropdownBase",className:R("sarsa-dropdown-base",g),ref:k,children:[Z(),s.jsx("div",{id:`${D}-popup`,role:J,"aria-labelledby":`${D}-title`,children:B&&s.jsxs("div",{ref:I,"data-component":"DropdownBase-popup",className:R("sarsa-dropdown-base-popup",{"size-sm":r==="xs"||r==="sm","size-md":r==="md","size-lg":r==="lg"}),children:[s.jsx(re,{headingLevel:2,appearance:"h6",className:S?"sarsa-dropdown-base-heading":"rec-sr-only",id:`${D}-title`,children:j}),G(),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(M,{appearance:"link",onClick:X,innerRef:T,clickTagCategory:b,clickTagAction:x,clickTagLabel:w,"data-ga-tracking-id":v,"data-ga-tracking-value":C,children:i})]})})]})})]})}ao.propTypes={id:n.string,triggerButtonElement:n.element.isRequired,isDisabled:n.bool,size:n.oneOf(["xs","sm","md","lg"]),children:n.node,applyButtonLabel:n.string,popupLeftActionElement:n.node,onApply:n.func,onClose:n.func,showPopupActions:n.bool,innerRef:n.shape({current:n.node}),className:n.string,dataComponent:n.string,render:n.func,clickTagCategory:n.string,clickTagAction:n.string,clickTagLabel:n.string,gaTrackingId:n.string,dropdownAriaAttributes:n.bool,focusElement:n.node,applyButtonRef:n.shape({current:n.node}),baseTitle:n.node,isTitleVisible:n.bool};function cn({appearance:t="default",max:e=99,children:a,className:r,size:i="md",...o}){let l=a,c=e;const d=()=>{let u=0,f="";return typeof l!="number"?u:(l<0&&(l=0),c<0&&(c=0),c&&c{e&&this.inputWrapperRef&&this.inputWrapperRef.current?.querySelector("input")?.focus()},0)}componentWillUnmount(){clearTimeout(this.timeout)}handlePasswordVisibilityToggle(){const e=this.state.showingPassword?"password":"text";this.setState(a=>({showingPassword:!a.showingPassword,type:e}))}render(){const{id:e,type:a,label:r,isDisabled:i,value:o,isLabelVisible:l,placeholder:c,isRequired:d,isInvalid:u,errorText:f,hintText:g,isInline:h,innerRef:m,iconElement:b,handleClearButtonClick:x,hasClearButton:w,className:v,unitBefore:C,unitAfter:y,srUnitDescription:N,ariaDescribedby:T,enableShowPassword:j,gaTrackingId:S,hasFloatingError:k,..._}=this.props,I=$t(_,"shouldFocusOnMount"),P=b!==void 0,B=w&&typeof o=="string"&&o.length>0&&!j,W=j&&a==="password",D=l===!0&&a!=="hidden";return s.jsxs("div",{"data-component":"TextField",className:R(v,{"sarsa-field-outer-container":!h,"sarsa-field-outer-container-inline":h}),children:[s.jsx("div",{className:"sarsa-field-label-wrapper",children:s.jsx(ut,{htmlFor:e,isVisible:D,isRequired:d,children:r})}),s.jsxs("div",{className:"sarsa-field-inner-container",children:[s.jsxs("div",{ref:this.inputWrapperRef,className:R("sarsa-field-input-wrapper sarsa-text-field-input-wrapper",{inline:h,"no-label":!D}),children:[P&&s.jsx("span",{className:"sarsa-field-icon-content left",children:b}),C&&!b&&s.jsx("span",{className:"sarsa-field-icon-content sarsa-text-field-unit-before",children:C}),s.jsx("input",{className:R("sarsa-text-field-input",{"is-invalid":u,"with-icon":P,"with-unit-before":!!C,"with-unit-after":!!y,"with-clear-button":B}),type:this.state.type,id:e,ref:m,disabled:i,value:o,placeholder:c,required:d,"aria-invalid":u,"aria-describedby":R({[`${e}-error`]:!!f,[`${e}-unit-description`]:!!N,[`${e}-hint`]:!!g,[T]:!!T}),"data-ga-tracking-id":S,...I}),y&&s.jsx("span",{className:"sarsa-field-icon-content sarsa-text-field-unit-after",children:y}),N&&s.jsx("span",{className:"rec-sr-only",id:`${e}-unit-description`,children:`Field contents are in ${N}`}),B&&s.jsx("span",{className:"sarsa-text-field-button-wrapper",children:s.jsx(M,{appearance:"subtle",size:"xs",iconBeforeElement:s.jsx(A,{iconName:"close-circle"}),screenReaderTextAfter:"Clear field contents",className:"sarsa-text-field-clear-button",onClick:x})}),W&&s.jsx("span",{className:"sarsa-text-field-button-wrapper",children:s.jsx(M,{appearance:"subtle",size:"xs",iconBeforeElement:this.state.showingPassword?s.jsx(A,{iconName:"visibility-off"}):s.jsx(A,{iconName:"visibility"}),screenReaderTextAfter:this.state.showingPassword?"Hide password value":"Show password value",className:"sarsa-text-field-toggle-password-button",onClick:this.handlePasswordVisibilityToggle})})]}),f&&s.jsx(Ve,{isFloating:k,id:`${e}-error`,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]})})]})]})}}function ro({id:t,label:e,isDisabled:a=!1,placeholder:r,value:i,isRequired:o=!1,isInvalid:l=!1,errorText:c,innerRef:d,className:u,shouldFocusOnMount:f,ariaDescribedby:g,gaTrackingId:h,...m}){const b=p.useRef(null),x=p.useRef(),w=p.useRef(!1);p.useEffect(()=>(w.current||(x.current=window.setTimeout(()=>{if(f&&b){w.current=!0;const C=b.current?.querySelector("input");C&&C.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:R(u,"sarsa-number-field-input sarsa-field-outer-container"),children:s.jsx(dn,{type:"text",id:t,innerRef:d,isDisabled:a,value:i,placeholder:r,ariaDescribedby:v,isLabelVisible:!1,label:e,isRequired:o,isInvalid:l,shouldFocusOnMount:f,"data-ga-tracking-id":h,...m})})}ro.propTypes={id:n.string.isRequired,label:n.node.isRequired,placeholder:n.string,value:n.string,isDisabled:n.bool,isRequired:n.bool,isInvalid:n.bool,errorText:n.node,innerRef:n.oneOfType([n.func,n.object,n.node]),shouldFocusOnMount:n.bool,className:n.string,ariaDescribedby:n.string,unitBefore:n.string,unitAfter:n.string,srUnitDescription:n.string,gaTrackingId:n.string};const io=p.forwardRef((t,e)=>{const{id:a,units:r,unitBefore:i,unitAfter:o,visualLabel:l,visualLabelPosition:c="left",isRequired:d=!1,isInvalid:u=!1,isDisabled:f=!1,errorText:g,shouldClamp:h=!0,isDecreaseDisabled:m=!1,isIncreaseDisabled:b=!1,max:x=9999,min:w=0,onChange:v,value:C,defaultValue:y=0,ariaDescribedby:N,className:T,shouldTriggerOnChange:j,inputFieldGaTrackingID:S,decreaseButtonGaTrackingID:k,increaseButtonGaTrackingID:_,name:I="numberField",shouldValidateOnChange:P=!1}=t,B=ct(a),W=typeof C=="number"?C.toString():y?.toString(),[D,E]=p.useState(W),V=p.useRef(W),X=p.useRef(null),Z=l&&l.length,G=!!i||!!o,J=parseInt(D,10),z=R({"sarsa-number-field-with-label-wrap":Z,"position-left":c==="left","position-top":c==="top"}),[se,q]=p.useState({isInvalid:u??!1,errorText:g??"",inputId:B,label:l??"Number Field"}),L=O=>{const $={isInvalid:!1,errorText:"",inputId:B,label:l??"Number Field"},Y=O??D,U=Y?parseInt(Y,10):0,ne=u||!!g,Re=O===void 0;return ne?($.isInvalid=!0,$.errorText=g||`${$.label} is invalid`):d&&!U?($.isInvalid=!0,$.errorText=g||`${$.label} must be 1 or more`):Ux&&($.isInvalid=!0,$.errorText=g||`${$.label} must be ${x} or less`),(Re||P||!ne&&se.isInvalid===!0&&$.isInvalid===!1)&&q($),$};p.useEffect(()=>{const O=typeof C=="number"?C:y;V.current=O,E(O.toString())},[y,C]),p.useEffect(()=>{if(typeof C=="number"&&C!==V.current&&C.toString()!==D){const O=Math.min(Math.max(C,w),x),$=h?O:C;E($.toString()),C!==$&&v&&v($),ue(`${$} ${r}`,"polite","sarsa-announce-count")}},[C,D]);const H=O=>{const $=ne=>{j&&v&&v(ne)};O.preventDefault();const Y=O.target.value;/^\d+$/.test(Y)?(E(Y),$(parseInt(Y,10))):Y===""?(E(""),$(0)):ue("Error: Enter only numbers.")},Q=()=>{const O=parseInt(D,10);if(D===""){E("0"),v&&v(0);return}const $=Math.min(Math.max(O,w),x);let Y=h?$:O;h&&Y!==O&&(ue(`You entered a value outside of the min/max. Value changed to ${Y}.`),O<1&&(Y=0)),E(Y.toString()),L(Y.toString()),v&&v(Y)},K=()=>{let O=parseInt(D,10)||0;O-=1,O{let O=parseInt(D,10)||0;O+=1,O>x&&(O=x),E(O.toString()),L(O.toString()),ue(`${O} ${r}`,"polite","sarsa-announce-count"),v&&v(O)},ee=O=>{O.key==="ArrowUp"&&(O.preventDefault(),F()),O.key==="ArrowDown"&&(O.preventDefault(),K())};return p.useImperativeHandle(e,()=>({validate:()=>L()})),s.jsxs("div",{"data-component":"NumberField",className:T,role:Z?"group":void 0,"aria-labelledby":Z?`group-label-${B}`:void 0,children:[s.jsxs("div",{className:z,children:[l&&s.jsx(Qa,{id:`group-label-${B}`,isRequired:d,children:l}),s.jsxs("div",{"data-component":"NumberField",ref:X,className:"sarsa-number-field",children:[s.jsx(M,{appearance:"subtle",size:"sm",onClick:K,isDisabled:f||J<=w||m,"aria-label":`Remove ${r}`,iconBeforeElement:s.jsx(A,{iconName:"remove-circle-outline"}),gaTrackingId:k}),s.jsx(ro,{className:R({"with-unitsBefore":!!i,"with-unitsAfter":!!o,"width-3-digits":x>99&&x<=999,"width-4-digits":x>999,"width-3-digits-and-units":x>99&&x<=999&&G,"width-4-digits-and-units":x>999&&G}),label:`Number of ${r}`,pattern:"\\d*",id:B,name:I,autoComplete:"off",maxLength:x<10?1:x<100?2:x<1e3?3:4,readOnly:f,isDisabled:f,isRequired:d,isInvalid:se.isInvalid,errorText:se.errorText,value:D,onChange:H,onBlur:Q,ariaDescribedby:N,unitBefore:i,unitAfter:o,srUnitDescription:r,gaTrackingId:S,onKeyDown:ee}),s.jsx(M,{appearance:"subtle",size:"sm",onClick:F,isDisabled:f||J===x||b,"aria-label":`Add ${r}`,iconBeforeElement:s.jsx(A,{iconName:"add-circle-outline"}),gaTrackingId:_})]})]}),se.errorText&&s.jsxs("div",{id:`${B}-error`,className:"sarsa-field-error-message",children:[s.jsx("span",{className:"req","aria-hidden":"true",children:"*"}),se.errorText]})]})});io.propTypes={id:n.string,units:n.string.isRequired,unitBefore:n.string,unitAfter:n.string,visualLabel:n.string,visualLabelPosition:n.oneOf(["left","top"]),isRequired:n.bool,isInvalid:n.bool,isDisabled:n.bool,errorText:n.string,shouldClamp:n.bool,isDecreaseDisabled:n.bool,isIncreaseDisabled:n.bool,max:n.number,min:n.number,onChange:n.func,value:n.number,defaultValue:n.number,ariaDescribedby:n.string,className:n.string,shouldTriggerOnChange:n.bool,inputFieldGaTrackingID:n.string,decreaseButtonGaTrackingID:n.string,increaseButtonGaTrackingID:n.string};const Hm={id:n.string,guestType:n.shape({key:n.string,type:n.string,label:n.string,description:n.string}),validationClass:n.string,count:n.number,disableTextInput:n.bool,minGuests:n.number,maxTotalGuests:n.number,maxTotalGuestsReached:n.bool,changeCount:n.func,isRequired:n.bool,isDecreaseDisabled:n.bool};function oo({id:t,guestType:{type:e,description:a,key:r,label:i},count:o=0,changeCount:l,disableTextInput:c=!1,minGuests:d,maxTotalGuests:u,maxTotalGuestsReached:f=!1,validationClass:g="",isRequired:h=!1,isDecreaseDisabled:m=!1}){const b=ct(t),x=`${b}-counter-row-${e}`?.replace(/ /g,"-"),w=`${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:[i||e,h&&s.jsx("mark",{title:"required",children:" *"})]}),s.jsx("div",{className:"rec-guest-counter-row-description",children:a})]}),s.jsx(io,{id:w,className:g,isDecreaseDisabled:m||o===0,isIncreaseDisabled:f,isDisabled:c,min:d,max:u,onChange:v=>l(r,v),value:o,units:`${e}s`})]})}oo.propTypes=Hm;const Um=t=>typeof t.weight=="number"?t.weight:1;class yv extends p.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 a=this.props.value||this.state.counts,{disableTextInput:r}=this.props;return this.props.guestTypes.map(i=>{let o={...i};const l=Je(this.props,`maximumCountByGuestType.${o.key}`,0),c=Je(this.props,`minimumCountByGuestType.${o.key}`,0),d=e||l!==0&&l<=a[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:r,guestType:o,count:a[o.key],maxTotalGuestsReached:d,changeCount:this.changeCount},`guest-counter-${o.key}`)})},this.changeCount=(e,a)=>{const{onCountChange:r,maximumCountByGuestType:i}=this.props,o=!this.props.value,l=this.props.maxTotalGuests||999,c=i[e]?i[e]:null;let d;o?d=this.state.counts:d={...this.props.value};const u=this.sumCounts()-d[e],f=l-u;!c&&a<=f||c&&a<=c&&a<=f?d[e]=a:c&&a>c?(d[e]=c,ue(`Error: Input changed to ${c} because there's a maximum of ${l} guests allowed for the selected guest type.`)):(d[e]=f,ue(`Error: Input changed to ${f} because there's a maximum of ${l} guests.`)),d[e]<0&&(d[e]=0),o&&this.setState({counts:d}),r&&r(d)},this.sumCounts=()=>{const e=this.props.value||this.state.counts;return this.props.guestTypes.reduce((a,r)=>a+e[r.key]*Um(r),0)}}static{this.propTypes={id:n.string,disableTextInput:n.bool,title:n.string,minTotalTitle:n.string,maxTotalTitle:n.string,guestTypes:n.array,minTotalGuests:n.number,maxTotalGuests:n.number,onCountChange:n.func,onClose:n.func,value:n.shape({}),validationErrorClass:n.string,disabled:n.bool,isDisabled:n.bool,maxTotalMessage:n.string,minTotalMessage:n.string,minimumCountByGuestType:n.shape({}),maximumCountByGuestType:n.shape({}),className:n.string,isLabelVisible:n.bool,isRequired:n.bool,isInvalid:n.bool,errorText:n.string,placeholder:n.string,showInvalid:n.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:a,guestTypes:r}=this.props;(a!==e.value||r!==e.guestTypes)&&this.setState({counts:a||this.populateCounters(r)})}populateCounters(e){const a={};return e.length>0&&e.forEach(r=>{r.count?a[r.key]=r.count:a[r.key]=0}),a}determinePluralLabel(e){const a=this.props.title;return e===1&&a.charAt(a.length-1).toLowerCase()==="s"?a.toLowerCase().endsWith("passes")?a.slice(0,a.length-2):a.slice(0,a.length-1):a}render(){const{className:e,id:a,title:r,validationErrorClass:i,maxTotalGuests:o,isLabelVisible:l,isRequired:c,isInvalid:d,errorText:u,placeholder:f,showInvalid:g}=this.props;let h=f||`Add ${r}...`;const m=this.sumCounts();m>0&&(h=`${m} ${this.determinePluralLabel(m)}`);let b=!1,x=!1;o!==0&&m>=o&&(x=!0);const w=this.props.maxTotalTitle!==""?` ${this.props.maxTotalTitle}`:` ${ia(this.props.title)}`,{minTotalGuests:v}=this.props;let C=!1;v!==0&&m{t(-1)},clickTagCategory:"Not Found Error Page",clickTagAction:`error found on - ${window.location.pathname}`,clickTagLabel:"Go Back Button",children:"Go Back"})]})]})})})}n.number,n.bool,n.func;function co({children:t,content:e,id:a="screen-reader-tip-component"}){const[r,i]=p.useState(!1),o=p.useRef(null),l=()=>{o.current&&!o.current.disabled&&i(!0)},c=()=>{i(!1)};return s.jsxs(s.Fragment,{children:[p.Children.map(t,d=>{const u=typeof d.type,f={"aria-describedby":r?a:void 0,onFocus:l,onBlur:c};return u==="string"?f.ref=o:f.innerRef=o,p.cloneElement(d,f)}),r&&s.jsx(At,{children:s.jsx("span",{className:"rec-sr-only",role:"tooltip",id:a,children:e})})]})}co.propTypes={children:n.node.isRequired,content:n.node.isRequired,id:n.string};class Cv extends ie.PureComponent{static propTypes={name:n.string,id:n.string,isSorted:n.bool,isAsc:n.bool,onSortToggle:n.func,isDisabled:n.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;ue(`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:a}=this.props,{isSorted:r,isAsc:i}=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(A,{iconName:"arrow-up"})}),s.jsx("div",{className:"sorted",children:s.jsx(A,{iconName:"arrow-down"})})]}):o=s.jsxs("div",{className:"sort",children:[s.jsx("div",{className:"sorted",children:s.jsx(A,{iconName:"arrow-up"})}),s.jsx("div",{className:"disabled",children:s.jsx(A,{iconName:"arrow-down"})})]}):o=s.jsxs("div",{className:"sort",children:[s.jsx("div",{className:"enabled",children:s.jsx(A,{iconName:"arrow-up"})}),s.jsx("div",{className:"enabled",children:s.jsx(A,{iconName:"arrow-down"})})]});let l=null;return r&&(l=i?"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:a,type:"button",children:[s.jsx("span",{className:"title",children:e}),o]})})})}}const sr=t=>{const e={},a=["!",'"',"#","%","&","'","(",")","*",",","-",".","/",":",";","?","@","[","\\","]","_","{","}","¡","§","«","¶","·","»","¿","$","+","<","=",">","^","`","|","~","¢","£","¤","¥","¦","¨","©","¬","®","¯","°","±","´","¸","×","÷"];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(`[${a.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 un({password:t=""}){const[e,a]=p.useState({strength:0,criteria:sr(t)});p.useEffect(()=>{const c=sr(t);a({strength:c.strength,criteria:c})},[t]);const r=c=>R({"rec-criteria-check":!0,"rec-criteria-passed":c,"rec-criteria-failed":!c}),i=c=>c?s.jsx("span",{className:"rec-criteria-icon",children:s.jsx(A,{iconName:"check"})}):c?null:s.jsx("span",{className:"rec-criteria-icon",children:s.jsx(A,{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(he,{children:[s.jsx(te,{xs:"variable",children:s.jsxs("div",{className:r(e.criteria.lower),children:[i(e.criteria.lower),s.jsx("span",{className:"rec-sr-only",children:o(e.criteria.lower)}),"One lowercase letter"]})}),s.jsx(te,{xs:"variable",children:s.jsxs("div",{className:r(e.criteria.upper),children:[i(e.criteria.upper),s.jsx("span",{className:"rec-sr-only",children:o(e.criteria.upper)}),"One uppercase letter"]})}),s.jsx(te,{xs:"variable",children:s.jsxs("div",{className:r(e.criteria.number),children:[i(e.criteria.number),s.jsx("span",{className:"rec-sr-only",children:o(e.criteria.number)}),"One number"]})}),s.jsx(te,{xs:"variable",children:s.jsxs("div",{className:r(e.criteria.length),children:[i(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]})}}un.propTypes={password:n.string.isRequired};n.array.isRequired,n.bool,n.string,n.string,n.string,n.shape({user:n.string,date:n.string}),n.func,n.func;class Sv extends ie.PureComponent{render(){return null}}n.string,n.string,n.string,n.bool;n.bool,n.number,n.string,n.node,n.func,n.bool,n.bool;class Nv extends ie.PureComponent{static propTypes={children:n.node.isRequired,scrollingContainerId:n.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,a=this.sticky.firstChild.offsetHeight;return e||a}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})})}}function Km({children:t}){const e=p.useRef(),a=p.useRef(),i=ji(e)?.bottom||0,o=a.current?.firstChild.offsetHeight,l=i>window.innerHeight;return s.jsx("div",{ref:e,children:s.jsx("div",{ref:a,style:o?{height:o}:void 0,className:R("rec-sticky-bottom",{sticky:l}),children:t})})}Km.propTypes={children:n.node};const Ym={image:n.shape({backgroundImage:n.string}),title:n.string,children:n.node,sticky:n.bool,textColor:n.string,background:n.string,name:n.string,closedAnnouncement:n.func};function Zm({image:t,title:e,children:a,sticky:r,textColor:i,background:o,name:l,closedAnnouncement:c}){const[d,u]=p.useState(!1),[f,g]=p.useState(!1),h=p.useRef(null),m=p.useRef(null),b=p.useRef(null),{isSmAndDown:x}=Dt();let w="rec-announcement-sticky",v="rec-announcement-sticky-body-shown";const y=st(()=>{const P=window.innerWidth;h.current&&m.current&&(m.current.style.height=`${h.current.clientHeight}px`),b.current!==P&&(b.current=P),P>768&&g(!0)},50);p.useEffect(()=>(window.addEventListener("resize",y),y(),hl.get(l)||u(!0),()=>{window.removeEventListener("resize",y)}),[]),p.useEffect(()=>{d||(c(l),document.body.classList.remove("rec-announcement-no-body-scroll"))},[d]);const N=()=>{u(!1)},T=P=>{switch(P){case"dark":return"rec-announcement-text-dark";case"light":return"rec-announcement-text-light";default:return""}},j=P=>{switch(P){case"dark":return"rec-announcement-content-bg-dark";case"light":return"rec-announcement-content-bg-light";default:return""}},S=()=>{g(P=>!P)};if(!d)return null;r||(w=""),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 k=T(i),_=j(o),I=o==="dark";return s.jsxs(s.Fragment,{children:[s.jsx("div",{"data-name":"placeholder",ref:m}),s.jsxs("div",{className:`rec-announcement px-md-3 ${k} ${w} ${v}`,style:t,"data-testid":"recAnnouncement",children:[s.jsxs("div",{ref:h,className:"rec-announcement-mobile-header",children:[s.jsx(M,{isUnstyled:!0,onClick:S,className:"rec-announcement-toggle","aria-label":f?"Hide Announcement":"Show Announcement",type:"button",children:f?s.jsx(A,{iconName:"chevron-down"}):s.jsx(A,{iconName:"chevron-up"})}),s.jsx("div",{className:"rec-announcement-mobile-title",children:e})]}),f&&s.jsxs("div",{className:`rec-announcement-content ${_}`,children:[s.jsx("div",{className:"rec-announcement-title",children:e}),s.jsx("div",{className:"rec-announcement-description",children:a}),x&&s.jsx(M,{shouldFitContainer:!0,appearance:I?"tertiary-white":"tertiary",onClick:N,"aria-label":"Close Announcement",type:"button",className:"mt-2",children:"Close Announcement"}),s.jsx(M,{className:I?"modal-close-button dark":"modal-close-button light",appearance:"subtle",size:"md","aria-label":"Dismiss Announcement",iconBeforeElement:s.jsx(A,{iconName:"close"}),onClick:N})]})]})]})}Zm.propTypes=Ym;const Jm=100,ar="all 250ms cubic-bezier(.21,1.02,.73,1)",Xm="all 200ms ease-out";function nr({element:t,transforms:e,transition:a,isRemove:r,callback:i}){const o=setTimeout(()=>{i&&i()},Jm);r&&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",""),i&&i(),t.removeEventListener("transitionend",l),clearTimeout(o))};t.addEventListener("transitionend",l),window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{t.style.setProperty("transition",a),e.forEach(({property:c,to:d=""})=>{t.style.setProperty(c,d)})})})}const Qm=()=>{const t=p.useMemo(()=>new Map,[]),e=p.useMemo(()=>new Map,[]);p.useEffect(()=>{const i=[];Array.from(t.entries()).forEach(([o,l])=>{if(l){const c=e.get(o),{top:d}=l.getBoundingClientRect();typeof c=="number"&&c!==d?i.push({element:l,transition:ar,transforms:[{property:"transform",from:`translateY(${c-d}px)`}]}):typeof c!="number"&&i.push({element:l,transition:ar,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)}),i.forEach(o=>{nr(o)})});const a=p.useCallback((i,o)=>{const l=t.get(i);l&&nr({element:l,transforms:[{property:"opacity",to:"0"},{property:"transform",to:"translate3d(0,-100%,-1px) scale(0.7)"}],transition:Xm,isRemove:!0,callback:o})},[t]);return{itemRef:p.useCallback(i=>o=>{t.set(i,o)},[t]),remove:a}};function ef({onTimeout:t,duration:e,isEnabled:a=!0}){const[r,i]=p.useState(a),o=p.useRef(),l=p.useCallback(()=>{window.clearTimeout(o.current),i(!1)},[]);p.useEffect(()=>(r&&(o.current=window.setTimeout(()=>{t()},e)),()=>{window.clearTimeout(o.current)}),[t,r,e,l]);const c=p.useCallback(()=>{a&&i(!0)},[a]);return{stopTimeout:l,startTimeout:c}}const tf={error:"error",info:"info",success:"check-circle",warning:"warning",default:"warning"},sf=p.forwardRef((t,e)=>{const{id:a,onClose:r,shouldRemove:i,type:o="info",isColored:l,delay:c=6500,copy:d,disableAutoClose:u}=t,f=p.useRef(),g=Vs(f,e),[h,m]=p.useState(u!==!0),b=p.useCallback(()=>r(a),[a,r]),{stopTimeout:x,startTimeout:w}=ef({duration:c,onTimeout:b,isEnabled:h});return p.useEffect(()=>{i&&(x(),b())},[i,b,x,u]),p.useEffect(()=>{const v=f.current;if(!v)return;const C=()=>{x(),m(!1)},y=()=>{w(),u||m(!0)};return v.addEventListener("focusin",C),v.addEventListener("focusout",y),()=>{v.removeEventListener("focusin",C),v.removeEventListener("focusout",y)}},[u,w,x]),s.jsxs("div",{id:a,"data-component":"Toast",ref:g,role:"alertdialog","aria-labelledby":`${a}-label`,className:R(`sarsa-toast ${o}`,{[`${o}-colored`]:l}),onMouseEnter:x,onFocus:x,onMouseLeave:w,onBlur:w,"data-testid":"sarsaToast",children:[s.jsxs("div",{role:"alert",className:"toast-content",children:[o==="default"?null:s.jsx(A,{"data-testid":`${o}-icon`,iconName:tf[o],className:`sarsa-toast-icon ${o}`}),s.jsx("div",{className:"text pr-1",id:`${a}-label`,children:d})]}),s.jsx("div",{className:"close-button-wrap",children:s.jsx(M,{onClick:b,size:"xs","aria-label":"Close notification",appearance:"subtle",className:"sarsa-toast-close",iconBeforeElement:s.jsx(A,{iconName:"close",size:"sm"}),"data-testid":"sarsaToastClose"})})]})}),rr=5;function af({toasts:t,removeToast:e}){const{itemRef:a,remove:r}=Qm(),i=p.useCallback(l=>{r(l,()=>{e(l)})},[r,e]),o=t.length-rr;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>=rr?null:s.jsx("div",{className:"toaster-item",children:s.jsx(sf,{ref:a(l),id:l,onClose:i,...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 jv(){const t=Ie(),e=pe(fp),a=p.useCallback(r=>{t(mp(r))},[t]);return s.jsx(At,{children:s.jsx(af,{toasts:e,removeToast:a})})}function uo(){const t=Ie();return p.useCallback((a,r=Ra)=>{const i={...Ra,...r},o={copy:a,...i,id:Ge()};t(pp(o))},[t])}function hn(t){switch(t){case"gregory":return new pl;default:throw new Error(`Unsupported calendar ${t}`)}}function It({segment:t,state:e,className:a,onClick:r}){const i=p.useRef(null),{segmentProps:o}=ml(t,e,i);return s.jsx("div",{...o,onClick:r,ref:i,style:{...o.style},className:R("date-segment",a,{slash:!t.isEditable,colon:t.text===":"}),children:t.isPlaceholder?t.placeholder:t.text})}function _a({className:t,setAutoFocus:e,close:a,isOpen:r,open:i,hasCalendar:o=!0,timeZoneLabel:l,hideTimeZone:c,...d}){const{isDisabled:u}=d,{locale:f}=tt(),g=fl({...d,locale:f,createCalendar:hn}),h=p.useRef(null),{fieldProps:m}=gl(d,g,h),{onKeyDown:b,...x}=m,w=p.useCallback(y=>{a&&r&&a(),b&&b(y)},[a,r,b]),v=g.segments.findIndex(y=>y.type==="hour"),C=f.includes("en");return s.jsxs("div",{...x,translate:"no",onKeyDown:w,ref:h,className:R("date-field",t),children:[g.segments.map((y,N)=>{if(C&&v>0&&N===v-1)return null;const T=y.type==="year"||y.type==="month"||y.type==="day";if(y.type==="timeZoneName")return c||l?null:s.jsx("div",{className:"time-zone",children:y.text},N);if(C&&y.type==="hour"){if(y.placeholder="hh",d.granularity==="hour")return s.jsxs(p.Fragment,{children:[s.jsx(It,{segment:y,state:g,className:"hour"}),s.jsx(It,{segment:{type:"literal",text:":",placeholder:"",isPlaceholder:!1,isEditable:!1},state:g}),s.jsx(It,{segment:{type:"literal",text:"00",placeholder:"00",isPlaceholder:!0,isEditable:!1},state:g})]},N)}else C&&y.type==="minute"&&(y.placeholder="mm");return s.jsx(It,{segment:y,state:g,onClick:j=>{j.currentTarget?.focus(),e(!1),T&&!u&&o&&i(),!T&&a&&a()},className:y.type==="hour"?"hour":void 0},N)}),l&&!c?s.jsx("div",{className:"time-zone",children:l}):null]})}function nf({startName:t,endName:e,value:a,startRef:r,endRef:i,id:o}){const l=a?.start?.toString()||"",c=a?.end?.toString()||"";return s.jsxs(s.Fragment,{children:[s.jsx("input",{name:t,type:"hidden",value:l,ref:r,id:`${o}-hidden-start`}),s.jsx("input",{name:e,type:"hidden",value:c,ref:i,id:`${o}-hidden-end`})]})}function ho({name:t,value:e,inputRef:a,id:r}){const i=typeof e=="string"?e:e?.toString()||"";return s.jsx("input",{name:t,type:"hidden",value:i,ref:a,id:`${r}-hidden`})}function pn({children:t,className:e,...a}){return t?s.jsx("div",{"aria-live":"polite",...a,children:t?s.jsxs("div",{className:R("sarsa-field-hint-message",e),children:[s.jsx("span",{className:"hint","aria-hidden":"true",children:"*"})," ",t]}):null}):null}const ir=Ce()?window.visualViewport:null;function rf(t){const{top:e,height:a,left:r,width:i}=t.getBoundingClientRect(),{clientHeight:o,clientWidth:l}=document.documentElement;return{spaceAbove:e,spaceBelow:o-e-a,spaceRight:l-r-i,spaceLeft:r,width:i}}function of({popupRef:t,innerRef:e,isOpen:a,positionRightByDefault:r=!0}){const[o,l]=p.useState("below left"),{isXs:c}=Dt(),d=p.useCallback(()=>{const u=t.current,f=e.current;if(!a||!u||!f)return;const{spaceAbove:g,spaceBelow:h,spaceRight:m,spaceLeft:b,width:x}=rf(u),w=f.clientHeight+10,v=f.clientWidth-x+10;if(w>h&&w<=g){if(c){l("above full-width");return}r&&v>m&&b>m||!r&&b>m?l("above right"):l("above left");return}if(c){l("below full-width");return}r&&v>m&&b>m||!r&&b>m?l("below right"):l("below left")},[e,a,t,r,c]);return p.useLayoutEffect(()=>{d();const u=st(d,150);return document?.addEventListener("scroll",u),ir?.addEventListener("resize",u),()=>{u.cancel(),document?.removeEventListener("scroll",u),ir?.removeEventListener("resize",u)}},[e,a,t,d]),o}function mn({children:t,isOpen:e,close:a,shouldTrapFocus:r=!0,inputSize:i,hideClose:o=!1,shouldCloseOnInteractOutside:l}){const c=p.useRef(null),d=p.useRef(null),{overlayProps:u,underlayProps:f}=wr({isOpen:e,onClose:a,shouldCloseOnBlur:!1,isDismissable:!0,shouldCloseOnInteractOutside:l},c),{focusProps:g,isFocusVisible:h}=Ps(),m=of({popupRef:c,innerRef:d,isOpen:e}),b=v=>{v.style.removeProperty("left")},x=v=>{if(c.current){const{left:C}=c.current.getBoundingClientRect();v.style.left=`-${C}px`}},w=p.useCallback(()=>{if(c.current){const v=c.current.querySelector(".sarsa--inline-popup");v&&(m==="above full-width"||m==="below full-width"?x(v):b(v))}},[m]);return p.useLayoutEffect(()=>{const v=window.visualViewport,C=st(w,150);return e&&(w(),v?.addEventListener("resize",C)),()=>{v?.removeEventListener("resize",C)}},[e,w]),s.jsx("div",{ref:c,"data-component":"inline-popup",style:{position:"relative"},...f,children:e?s.jsx("div",{className:R("sarsa--inline-popup",i,m),children:s.jsx("div",{ref:d,className:"sarsa--inline-popup-children",...u,children:s.jsxs(bl,{contain:r,restoreFocus:!0,children:[t,r&&!o?s.jsx("button",{...g,type:"button",className:R("inline-popup-keyboard-close-btn",{visible:h}),onClick:a,children:s.jsx(A,{iconName:"close",size:"sm"})}):null]})})}):null})}function lf({state:t,triggerRef:e,...a}){const r=p.useRef(null),{overlayProps:i}=Sl({placement:"top",targetRef:e,overlayRef:r,isOpen:t.isOpen}),{tooltipProps:o}=Nl(a,t);return s.jsx("div",{ref:r,...Mt(a,o),style:{...i.style,pointerEvents:"none"},className:"react-aria-Tooltip",children:a.children})}function cf({state:t,date:e,currentMonth:a,getDayType:r,getTooltipContent:i}){const o=p.useRef(null),{cellProps:l,buttonProps:c,isSelected:d,isOutsideVisibleRange:u,isDisabled:f,formattedDate:g,isInvalid:h,isUnavailable:m,isFocused:b}=vl({date:e,isDisabled:!Sn(e,a)},t,o),x=r?r(e):void 0,{dayType:w,dayTypeLabel:v,dayTypeSymbol:C}=Qh(x),y=!Sn(a,e),N="highlightedRange"in t&&t.highlightedRange,T=d&&N&&Nn(e,N.start),j=d&&N&&Nn(e,N.end),{focusProps:S,isFocusVisible:k}=Ps(),_=y||u;w&&!_&&(c["aria-label"]+=` - ${v}`);const I=i?i(e):null,P=xl({delay:100,closeDelay:0}),{triggerProps:B,tooltipProps:W}=yl({},P,o),D=I?B:{};return s.jsxs("div",{...l,className:"calendar-cell-td",children:[s.jsx("div",{...Mt(c,S,D),ref:o,hidden:_,className:R("calendar-cell",{"is-today":wl(e,t.timeZone),"is-selected":d&&!h,"is-invalid":h,"is-selected-is-invalid":d&&h,"is-unavailable":m,"is-disabled":f&&!h,"is-focused":b&&k,"is-range-start":T&&!h,"is-range-end":j&&!h,"is-styled-day":!_&&!!w,[`${w}`]:!_&&!!w}),children:!_&&w?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"date",children:g}),C?s.jsx("span",{className:"symbol",children:C}):null]}):g}),I&&P.isOpen&&s.jsx(Cl,{children:s.jsx(lf,{state:t,...W,triggerRef:o,children:I})})]})}function po({state:t,offset:e={},getDayType:a,getTooltipContent:r}){const{locale:i}=tt(),o=t.visibleRange.start.add(e),l=jl(o),{gridProps:c,headerProps:d,weekDays:u}=Tl({startDate:o,endDate:l},t),f=Rl({month:"long",year:"numeric",era:o.calendar.identifier==="gregory"&&o.era==="BC"?"short":void 0,calendar:o.calendar.identifier,timeZone:t.timeZone}),g=Il(o,i);return s.jsxs("div",{className:"calendar-grid",children:[s.jsx(re,{"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,m)=>s.jsx("div",{className:"th",children:h},m))})}),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((m,b)=>m?s.jsx(cf,{state:t,date:m,currentMonth:o,getDayType:a,getTooltipContent:r},b):s.jsx("div",{className:"td"},b))},h))})]})]})}function Es(t){const e=p.useRef(null),{buttonProps:a}=As(t,e),{focusProps:r,isFocusVisible:i}=Ps();return s.jsx("button",{type:"button",...Mt(a,r),ref:e,className:R("next-prev-button",{"focus-visible":i,disabled:t.isDisabled}),children:t.children})}function df(t,e){const a=[],i=t.add({months:e}).compare(t);for(let o=0;oe(l))),o={};return i.forEach(l=>{o[l]=!0}),s.jsx("div",{className:"sarsa--styled-days-legend mt-3",children:s.jsx(Xi,{legendItems:o})})}function uf({getDayType:t,getTooltipContent:e,onVisibleRangeChange:a,numVisibleMonths:r=1,pageBehavior:i="single",...o}){const l=p.useRef(""),{locale:c}=tt(),d=El({...o,pageBehavior:i,visibleDuration:{months:r},locale:c,createCalendar:hn}),u=p.useRef(null),{calendarProps:f,prevButtonProps:g,nextButtonProps:h,title:m}=kl({...o,pageBehavior:i},d,u),b=d.visibleRange.start.toString();return p.useEffect(()=>{l.current!==b&&(l.current=b,a&&a(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(Es,{...g,children:s.jsx(A,{iconName:"chevron-left"})}),s.jsx("h2",{className:"rec-sr-only",children:m}),s.jsx(Es,{...h,children:s.jsx(A,{iconName:"chevron-right"})})]}),s.jsx("div",{className:"calendar-grids-container",children:Array(r).fill(null).map((x,w)=>s.jsx(po,{getDayType:t,getTooltipContent:e,state:d,offset:{months:w}},w))})]}),t?s.jsx(mo,{startDate:d.visibleRange.start,getDayType:t,numVisibleMonths:r}):null]})}const fn=p.forwardRef(({icon:t="calendar",...e},a)=>{const{buttonProps:r}=As(e,a),{onClick:i,...o}=r,l=c=>{const d=new MouseEvent("mouseup",c.nativeEvent);i&&i(c),c.currentTarget.dispatchEvent(d)};return s.jsx("button",{...o,onClick:l,ref:a,className:"toggle-calendar-button",type:"button",children:s.jsx(A,{iconName:t,className:"button-icon calendar-icon"})})});function hf(t,e){const{isLabelVisible:a=!0,startName:r="rangePickerStart",endName:i="rangePickerStartEnd",startRef:o,endRef:l,id:c,className:d,style:u,pageBehavior:f="single",size:g="md",getDayType:h,getTooltipContent:m,onVisibleRangeChange:b,onChange:x,minimumNights:w,maximumDays:v,validateOnChange:C=!0,validator:y,numVisibleMonths:N,showClearDates:T=!0,hasFloatingError:j,hasCalendar:S=!0,validateOnMount:k,timeZoneLabel:_,autoOpenCalendar:I=!0,maxRangeSizeToValidate:P=180,...B}=t,{label:W,errorMessage:D,isRequired:E,description:V,minValue:X,maxValue:Z,isDateUnavailable:G,allowsNonContiguousRanges:J,isDisabled:z,isInvalid:se}=B,q=p.useId(),L=c??q,H=`${L}-toggle`,[Q,K]=p.useState(!1),[F,ee]=p.useState(t.value),[O,$]=p.useState({isInvalid:B.isInvalid??!1,errorText:B.errorMessage??"",inputId:H,id:H,label:W}),Y=p.useRef(null),U=p.useRef(null),ne=Hi(),{locale:Re}=tt(),fe=ve=>{const St=new ts(Re),ht=ve?.start&&"timeZone"in ve.start?ve.start?.timeZone:void 0,at=xt(),ae={isInvalid:!1,errorText:null,inputId:H,id:H,label:W};if(z)return $(null),null;if(se===!1)return ae;if(!ve||!ve.start||!ve.end)return E&&(ae.isInvalid=!0,ae.errorText=`${W} is required`),$(ae),ae;const{start:le,end:He}=ve;if(le.compare(He)>0)return ae.isInvalid=!0,ae.errorText="End date is before start date",$(ae),ae;if(X&&X.compare(le)>0)return ae.isInvalid=!0,ae.errorText=`Start date must be ${St.format(X.toDate(ht||at))} or later`,$(ae),ae;if(Z&&Z.compare(He)<0)return ae.isInvalid=!0,ae.errorText=`End date must be ${St.format(Z.toDate(ht||at))} or earlier`,$(ae),ae;if(v&&He.compare(le)+1>v)return ae.isInvalid=!0,ae.errorText=`Maximum length is ${v} ${v===1?"day":"days"}`,$(ae),ae;if(w&&He.compare(le)=2e3)for(let ra=0;ra{const St=C?fe(ve):null;x&&(ee(ve),x(ve,St))},isInvalid:B.isInvalid??O?.isInvalid}),{buttonProps:is,calendarProps:Ft,descriptionProps:os,dialogProps:Xs,endFieldProps:Qs,errorMessageProps:ls,groupProps:ea,labelProps:Ze,startFieldProps:ta}=Al(B,de,U);p.useEffect(()=>{k&&de.value?.start&&de.value?.end&&fe(de.value)},[]),p.useImperativeHandle(e,()=>({validate:()=>fe(de.value)}));function sa(ve){setTimeout(()=>{Ft.onChange&&ve&&Ft.onChange(ve)},0)}is.onPress=()=>{K(!0),de.toggle()};const aa=de.value?.start&&de.value?.end?`${de?.value?.start.month}${de?.value?.start.year}`:void 0,cs=Ze.onClick,na=ve=>Y.current?.contains(ve)?!0:!U.current?.contains(ve),be=()=>{I&&de.open()};return s.jsxs("div",{"data-component":"DateRangePicker",className:R("sarsa--date-picker","date-range-picker",d,{"has-clear-button":T}),style:u,id:L,children:[s.jsx(Hs,{...Ze,isRequired:E,isVisible:a,includeBottomMargin:!0,children:W}),s.jsxs("div",{...ea,ref:U,className:R("inputs-group",g,{invalid:se??O?.isInvalid}),children:[s.jsxs("div",{className:"inputs-group-left",children:[S?s.jsx(fn,{...is,ref:Y,id:H}):s.jsx(A,{iconName:"calendar",className:"no-popup-calendar-icon"}),s.jsx(_a,{...ta,open:be,className:"start",autoFocus:Q,setAutoFocus:K,close:de.close,isOpen:de.isOpen,timeZoneLabel:_}),s.jsx("span",{"aria-hidden":"true",className:"arrow-wrap",children:s.jsx(A,{iconName:"arrow-forward"})}),s.jsx(_a,{...Qs,open:be,className:"end",autoFocus:Q,setAutoFocus:K,close:de.close,isOpen:de.isOpen,hasCalendar:S,timeZoneLabel:_})]}),T&&de?.value?.start&&de?.value?.end&&!z?s.jsx(Bs,{"aria-label":"Clear Dates",onPress:()=>{de.close(),de.setValue(null),C&&fe(null),cs&&cs()}}):null,s.jsx(nf,{startName:r,endName:i,value:de.value,startRef:o,endRef:l,id:L})]}),S?s.jsx(mn,{isOpen:de.isOpen,close:de.close,inputSize:g,shouldCloseOnInteractOutside:na,children:s.jsxs("div",{className:"popup",...Xs,children:[p.createElement(uf,{...Ft,onChange:sa,autoFocus:Q,key:aa,pageBehavior:f,getDayType:h,getTooltipContent:m,onVisibleRangeChange:b,numVisibleMonths:N||ne}),s.jsx(Ve,{className:"popup-error-message",children:D??O?.errorText})]})}):null,s.jsx(pn,{...os,children:V}),s.jsx(Ve,{...ls,isFloating:j,children:D??O?.errorText})]})}p.forwardRef(hf);function pf({getDayType:t,getTooltipContent:e,onVisibleRangeChange:a,numVisibleMonths:r=1,headingLevel:i=2,pageBehavior:o="single",...l}){const c=p.useRef(""),{locale:d}=tt(),u=Ll({...l,pageBehavior:o,visibleDuration:{months:r},locale:d,createCalendar:hn}),{calendarProps:f,prevButtonProps:g,nextButtonProps:h,title:m}=Pl({...l,pageBehavior:o},u),b=u.visibleRange.start.toString();p.useEffect(()=>{c.current!==b&&(c.current=b,a&&a(u.visibleRange))},[b]);const x=`h${i}`;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(Es,{...g,children:s.jsx(A,{iconName:"chevron-left"})}),s.jsx(x,{className:"rec-sr-only",children:m}),s.jsx(Es,{...h,children:s.jsx(A,{iconName:"chevron-right"})})]}),s.jsx("div",{className:"calendar-grids-container",children:Array(r).fill(null).map((w,v)=>s.jsx(po,{getDayType:t,getTooltipContent:e,state:u,offset:{months:v}},v))})]}),t?s.jsx(mo,{startDate:u.visibleRange.start,getDayType:t,numVisibleMonths:r}):null]})}function mf(t,e){const{isLabelVisible:a=!0,name:r="datePicker",inputRef:i,id:o,className:l,style:c,pageBehavior:d="single",size:u="md",getDayType:f,getTooltipContent:g,onVisibleRangeChange:h,onChange:m,validateOnChange:b=!0,validateOnMount:x,validator:w,numVisibleMonths:v,showClearDates:C=!0,hasFloatingError:y,hasCalendar:N=!0,timeZoneLabel:T,autoOpenCalendar:j=!0,...S}=t,{label:k,errorMessage:_,isDisabled:I,isRequired:P,description:B,minValue:W,maxValue:D,isDateUnavailable:E,isInvalid:V,hideTimeZone:X}=S,Z=p.useId(),G=o??Z,J=`${G}-toggle`,[z,se]=p.useState(!1),[q,L]=p.useState(t.value),[H,Q]=p.useState({isInvalid:S.isInvalid??!1,errorText:S.errorMessage??"",inputId:J,id:J,label:k}),K=p.useRef(null),F=p.useRef(null),ee=Hi(),{locale:O}=tt(),$=be=>{const ve=xt(),St=be&&"hour"in be&&typeof be.hour=="number",ht=be&&"timeZone"in be?be?.timeZone:void 0,at={year:"numeric",month:"numeric",day:"numeric"};St&&(at.hour="numeric",at.minute="numeric",ht&&!X&&(at.timeZoneName="short",at.timeZone=ht));const ae=new ts(O,at),le={isInvalid:!1,errorText:null,inputId:J,id:J,label:k};if(I)return Q(null),null;if(V===!1)return le;if(!be)return P&&(le.isInvalid=!0,le.errorText=`${k} is required`),Q(le),le;if(W&&W.compare(be)>0)return le.isInvalid=!0,le.errorText=`${k} must be ${ae.format(W.toDate(ht||ve))} or later`,Q(le),le;if(D&&D.compare(be)<0)return le.isInvalid=!0,le.errorText=`${k} must be ${ae.format(D.toDate(ht||ve))} or earlier`,Q(le),le;if(E&&E(be))return le.isInvalid=!0,le.errorText="Date is not available",Q(le),le;if(w){const He=w(be,k);return le.isInvalid=He.isInvalid,le.errorText=He.errorMessage,Q(le),le}return Q(le),le};b&&t.onChange&&t.value!==void 0&&q!==void 0&&ap(t.value,q)&&($(t.value),L(t.value));const U=Ml({...S,onChange:be=>{const ve=b?$(be):null;m&&(L(be),m(be,ve))},isInvalid:S.isInvalid??H?.isInvalid}),{buttonProps:ne,calendarProps:Re,descriptionProps:fe,dialogProps:Ct,fieldProps:de,errorMessageProps:is,groupProps:Ft,labelProps:os}=Ol(S,U,F);p.useEffect(()=>{!I&&x&&U.value&&$(U.value)},[]),p.useImperativeHandle(e,()=>({validate:()=>$(U.value)}));function Xs(be){setTimeout(()=>{Re.onChange&&Re.onChange(be)},0)}ne.onPress=()=>{se(!0),U.toggle()};const Qs=U.value?`${U?.value?.month}${U?.value?.year}`:void 0,ls=os.onClick,ea=t.granularity==="hour"||t.granularity==="minute"||t.granularity==="second",Ze=U.value||S.value||S.defaultValue||S.placeholderValue||S.minValue||S.maxValue,ta=Ze&&"hour"in Ze&&typeof Ze.hour=="number",sa=ea||ta,aa=Ze&&"timeZone"in Ze&&typeof Ze.timeZone=="string",cs=be=>z?!0:!F.current?.contains(be),na=()=>{j&&U.open()};return s.jsxs("div",{"data-component":"DatePicker",className:R("sarsa--date-picker","single-date-picker",l,{"has-clear-button":C,"has-time":sa,"has-time-zone":aa&&!X}),style:c,id:G,children:[s.jsx(Hs,{...os,isRequired:P,isVisible:a,includeBottomMargin:!0,children:k}),s.jsxs("div",{...Ft,ref:F,className:R("inputs-group",u,{invalid:V??H?.isInvalid}),children:[s.jsxs("div",{className:"inputs-group-left",children:[N?s.jsx(fn,{...ne,ref:K,id:J}):s.jsx(A,{iconName:"calendar",className:"no-popup-calendar-icon"}),s.jsx(_a,{...de,open:na,className:"start",autoFocus:z,setAutoFocus:se,close:U.close,isOpen:U.isOpen,hasCalendar:N,timeZoneLabel:T,hideTimeZone:X})]}),C&&U?.value&&!I?s.jsx(Bs,{"aria-label":"Clear Date",onPress:()=>{U.close(),U.setValue(null),b&&$(null),ls&&ls()}}):null,s.jsx(ho,{name:r,value:U.value,inputRef:i,id:G})]}),N?s.jsx(mn,{isOpen:U.isOpen,close:U.close,inputSize:u,shouldCloseOnInteractOutside:cs,children:s.jsxs("div",{className:"popup",...Ct,children:[p.createElement(pf,{...Re,onChange:Xs,autoFocus:z,key:Qs,pageBehavior:d,getDayType:f,getTooltipContent:g,onVisibleRangeChange:h,numVisibleMonths:v||ee}),s.jsx(Ve,{className:"popup-error-message",isFloating:y,children:_??H?.errorText})]})}):null,s.jsx(pn,{...fe,children:B}),s.jsx(Ve,{...is,children:_??H?.errorText})]})}const Tv=p.forwardRef(mf);function ff({state:t,timeZoneLabel:e,hideTimeZone:a}){const r=t.granularity;return s.jsxs("div",{className:"date-field",translate:"no",children:[t.segments.map((i,o)=>{if(i.type==="timeZoneName")return a||e?null:s.jsx("div",{className:"time-zone",children:i.text},o);if(i.type==="hour"){if(i.placeholder="hh",r==="hour")return s.jsx(p.Fragment,{children:s.jsx(It,{segment:i,state:t})},o)}else i.type==="minute"&&(i.placeholder="mm");return s.jsx(It,{segment:i,state:t},o)}),e&&!a?s.jsx("div",{className:"time-zone",children:e}):null]})}function ua(t,e=Nr(xt())){return t?"day"in t?t:jr(e,t):null}const gf=({inputId:t,isInvalid:e,errorMessage:a,label:r,isRequired:i,locale:o,hideTimeZone:l,value:c,validator:d,...u})=>{const f=c&&"day"in c?c:void 0,g=u.minValue?ua(u.minValue,f):void 0,h=u.maxValue?ua(u.maxValue,f):void 0,m=c&&"timeZone"in c?c?.timeZone:void 0,b=xt(),x=c&&"day"in c?$l(c):c,w=c==null?null:ua(c),v={hour:"numeric",minute:"numeric"};m&&!l&&(v.timeZoneName="short",v.timeZone=m);const C=new ts(o,v),y={isInvalid:!1,errorText:null,label:r,inputId:t,id:t};if(e===!1)return y;if(e)return y.isInvalid=!0,y.errorText=a??null,y;if(!x||!w)return i&&(y.isInvalid=!0,y.errorText=`${r} is required`),y;if(g&&g.compare(w)>0)return y.isInvalid=!0,y.errorText=`${r} must be ${C.format(g.toDate(m||b))} or later`,y;if(h&&h.compare(w)<0)return y.isInvalid=!0,y.errorText=`${r} must be ${C.format(h.toDate(m||b))} or earlier`,y;if(d){const N=d(w,r);y.isInvalid=N.isInvalid,y.errorText=N.errorMessage}return y};function vs({children:t,isSelected:e,...a}){const r=p.useRef(null),{buttonProps:i}=As(a,r),{isFocusVisible:o,focusProps:l}=Ps();return s.jsx("button",{type:"button",...i,...l,className:R("time-picker-button",{selected:e,focus:o}),"data-selected":e?"true":void 0,children:t})}const bf=[1,2,3,4,5,6,7,8,9,10,11,12],vf=[0,15,30,45];function xf({state:t,close:e,errorMessage:a}){const r=p.useRef(null),i=p.useRef(null),o=p.useRef(null),l=Number(t.segments.find(m=>m.type==="hour")?.text),c=typeof l!="number"||Number.isNaN(l)?void 0:l>12?l-12:l,d=Number(t.segments.find(m=>m.type==="minute")?.text),u=[...vf];!Number.isNaN(d)&&!u.includes(d)&&(u.push(d),u.sort()),p.useEffect(()=>{const m=r.current;if(!m)return;const b=m.querySelector("button[data-selected]");b?b.focus():m.querySelector("button")?.focus()},[]);function f(m){const b=r.current,x=i.current;if(!b||!x)return;const w=Array.from(b?.querySelectorAll("button")),v=document.activeElement?w.indexOf(document.activeElement):0;switch(m.key){case"ArrowDown":{m.preventDefault();const C=v===w.length-1?0:v+1;w[C]?.focus();break}case"ArrowUp":{m.preventDefault();const C=v===0?w.length-1:v-1;w[C]?.focus();break}case"ArrowRight":{m.preventDefault(),(x.querySelector("[data-selected]")||x.querySelector("button"))?.focus();break}}}function g(m){const b=r.current,x=i.current,w=o.current;if(!b||!x||!w)return;const v=Array.prototype.slice.call(x?.querySelectorAll("button")),C=v.indexOf(document.activeElement);switch(m.key){case"ArrowDown":{m.preventDefault();const y=C===v.length-1?0:C+1;v[y]?.focus();break}case"ArrowUp":{m.preventDefault();const y=C===0?v.length-1:C-1;v[y]?.focus();break}case"ArrowLeft":{m.preventDefault(),(b.querySelector("[data-selected]")||b.querySelector("button"))?.focus();break}case"ArrowRight":{m.preventDefault();const y=w.querySelector("[data-selected]");w.querySelector("button"),y?.focus();break}}}function h(m){const b=i.current,x=o.current;if(!b||!x)return;const w=Array.prototype.slice.call(x?.querySelectorAll("button")),v=w.indexOf(document.activeElement);switch(m.key){case"ArrowDown":{m.preventDefault();const C=v===w.length-1?0:v+1;w[C]?.focus();break}case"ArrowUp":{m.preventDefault();const C=v===0?w.length-1:v-1;w[C]?.focus();break}case"ArrowLeft":{m.preventDefault(),(b.querySelector("[data-selected]")||b.querySelector("button"))?.focus();break}}}return s.jsxs("div",{className:"sarsa--time-picker-popup",children:[s.jsxs("div",{className:R("columns",{"is-hour-only":t.granularity==="hour"}),children:[s.jsx("div",{className:"column hour",ref:r,onKeyDown:f,children:bf.map(m=>s.jsx(vs,{onPress:()=>{t.setSegment("hour",m)},isSelected:m===c,"aria-label":`Hour: ${m}`,children:m},m))}),t.granularity==="hour"?null:s.jsx("div",{className:"column minute",ref:i,onKeyDown:g,children:u.map(m=>{const b=m<10?`0${m}`:m;return s.jsx(vs,{onPress:()=>{t.setSegment("minute",m)},isSelected:d===m,"aria-label":`Minutes: ${b}`,isDisabled:t.granularity==="hour",children:b},m)})}),s.jsxs("div",{className:"column am-pm",ref:o,onKeyDown:h,children:[s.jsx(vs,{onPress:()=>{t.setSegment("dayPeriod",0)},isSelected:t.segments.find(m=>m.type==="dayPeriod")?.text==="AM",children:"AM"}),s.jsx(vs,{onPress:()=>{t.setSegment("dayPeriod",12)},isSelected:t.segments.find(m=>m.type==="dayPeriod")?.text==="PM",children:"PM"})]})]}),a?s.jsx("div",{className:"px-2 py-half",children:s.jsx(Ve,{children:a})}):null,s.jsxs("div",{className:"popup-footer",children:[s.jsx(M,{size:"xxs",appearance:"subtle",onClick:()=>{const m=_r(new Date().toISOString()).set({second:0,millisecond:0});t.setSegment("hour",m.hour),t.setSegment("minute",m.minute),t.setSegment("dayPeriod",m.hour>12?12:0),t.setValue(m),e()},children:"Now"}),s.jsx(M,{size:"xxs",appearance:"primary",onClick:e,children:"Close"})]})]})}function yf(t,e){const{label:a,isRequired:r,name:i="timePicker",inputRef:o,id:l,description:c,errorMessage:d,size:u="md",isLabelVisible:f,showClearButton:g=!0,isDisabled:h,timeZoneLabel:m,hideTimeZone:b,granularity:x="minute",className:w,style:v,onChange:C,minValue:y,maxValue:N,shouldValidateOnMount:T,hasFloatingError:j,validateOnChange:S=!0,validator:k}=t,_=p.useId(),I=l??_,P=`${I}-toggle`,[B,W]=p.useState(!1),D=p.useRef(null),E=p.useRef(null),[V,X]=p.useState({isInvalid:t.isInvalid??!1,errorText:d??"",inputId:P,id:P,label:a}),{locale:Z}=tt(),G=U=>{const ne=gf({value:U,inputId:P,isInvalid:t.isInvalid,errorMessage:d,isRequired:r,label:a,minValue:y,maxValue:N,locale:Z,hideTimeZone:b,validator:k});return X(ne),ne},z=Dl({...t,onChange:U=>{const ne=S?G(U):null;C&&C(U,ne)},granularity:x,locale:Z}),{labelProps:se,fieldProps:q,descriptionProps:L,errorMessageProps:H}=Fl({...t,isInvalid:t.isInvalid??V.isInvalid},z,E),Q=z.timeValue?.toString()??"",K=se.onClick,F=()=>{window.setTimeout(()=>{D.current?.focus()},0)},ee=()=>{W(!1),F()},O=()=>{W(!1)};p.useEffect(()=>{T&&z.timeValue&&G(z.timeValue)},[]),p.useImperativeHandle(e,()=>({validate:()=>G(z.timeValue)}));const $=p.useCallback(()=>{W(!1)},[]),Y=Z.includes("US");return s.jsxs("div",{className:R("sarsa--date-picker",w,{"has-clear-button":g}),style:v,id:I,children:[s.jsx(Hs,{...se,isRequired:r,isVisible:f,includeBottomMargin:!0,children:a}),s.jsxs("div",{...q,ref:E,className:R("inputs-group",u,{invalid:!h&&(t.isInvalid||V.isInvalid)}),children:[s.jsxs("div",{className:"inputs-group-left",onKeyDown:$,children:[Y?s.jsx(fn,{ref:D,id:P,icon:"clock",onPress:()=>{W(U=>!U)},isDisabled:z.isDisabled}):s.jsx(A,{iconName:"clock",className:"no-popup-calendar-icon"}),s.jsx(ff,{state:z,timeZoneLabel:m,hideTimeZone:b})]}),g&&z?.value&&!h?s.jsx("span",{onKeyDown:$,children:s.jsx(Bs,{"aria-label":"Clear Time",onPress:()=>{z.setValue(null),O(),window.setTimeout(()=>{K&&K()},0)}})}):null,s.jsx(ho,{name:i,value:Q,inputRef:o,id:I})]}),s.jsx(mn,{isOpen:B,close:O,inputSize:u,hideClose:!0,children:s.jsx("div",{className:"popup time-picker",children:s.jsx(xf,{state:z,close:ee,errorMessage:h?null:d||V.errorText})})}),s.jsx(pn,{...L,children:c}),s.jsx(Ve,{...H,isFloating:j,children:h?null:d||V.errorText})]})}p.forwardRef(yf);function or({date:t,format:e="l",timeZone:a,showTimeZone:r,options:i,timeZoneLabel:o}){const c=cp()(t,i??{format:e,timeZone:a,showTimeZone:r});return s.jsxs("span",{translate:"no",children:[c,o?` ${o}`:null]})}function Rv({children:t}){const e=$e(),{pathname:a,search:r}=Ma(),i=new URLSearchParams(r);return i.set("redirect",a),e?t:(window.location.assign(`/log-in?${i.toString()}`),s.jsx(Le,{isFullscreen:!0}))}n.oneOfType([n.arrayOf(n.any),n.string,n.node]),n.func.isRequired,n.bool,n.string;n.oneOfType([n.arrayOf(n.any),n.string,n.node]),n.element,n.element,n.func.isRequired,n.func.isRequired;const wf=p.createContext(null),Ys=()=>{const t=p.useContext(wf);if(t==null)throw new Error("Popover components must be wrapped in ");return t};p.forwardRef(({children:t,...e},a)=>{const r=Ys(),i=t.ref,o=ss([r.refs.setReference,a,i]);return s.jsx(M,{ref:o,type:"button","data-state":r.open?"open":"closed",...r.getReferenceProps(e),children:t})});const Cf=p.forwardRef((t,e)=>{const{setOpen:a}=Ys();return s.jsx("button",{type:"button",ref:e,"aria-label":"Close popover",...t,className:"inline-popup-keyboard-close-btn",onClick:r=>{t.onClick?.(r),a(!1)},children:s.jsx(A,{size:"sm",iconName:"close"})})}),Sf=p.forwardRef((t,e)=>{const{setLabelId:a}=Ys(),r=Vl();return p.useLayoutEffect(()=>(a(r),()=>a(void 0)),[r,a]),s.jsx("h2",{...t,ref:e,id:r,className:"h6 mb-1",children:t.children})});p.forwardRef(({style:t,...e},a)=>{const{context:r,...i}=Ys(),o=ss([i.refs.setFloating,a]);return r.open?s.jsx(Ar,{children:s.jsx(Lr,{context:r,modal:i.modal,initialFocus:1,children:s.jsxs("div",{ref:o,style:{...i.floatingStyles,...t},"aria-labelledby":i.labelId,"aria-describedby":i.descriptionId,...i.getFloatingProps(e),className:"sarsa--popover",children:[e.heading?s.jsx(Sf,{children:e.heading}):null,s.jsx("div",{children:e.children}),s.jsx(Cf,{}),s.jsx(Bl,{ref:i.arrowRef,context:r,strokeWidth:1,className:"sarsa--popover-arrow",width:12,height:6})]})})}):null});const ks=p.createContext({getItemProps:()=>({}),activeIndex:null,setActiveIndex:()=>{},setHasFocusInside:()=>{},isOpen:!1}),lr=p.forwardRef((t,e)=>{const{children:a,label:r,size:i="md",isIconOnly:o,hasChevronIcon:l,hasBorder:c=!0,hasFill:d=!0,...u}=t,[f,g]=p.useState(!1),[h,m]=p.useState(!1),[b,x]=p.useState(null),w=p.useRef([]),v=p.useRef([]),C=p.useContext(ks),y=$a(),N=Hl(),T=Pr(),j=Da(),S=T!=null,{floatingStyles:k,refs:_,context:I}=Ul({nodeId:N,open:f,onOpenChange:g,placement:S?"right-start":"bottom-start",middleware:[sc({mainAxis:S?8:4,alignmentAxis:S?-4:0}),ac(),nc()],whileElementsMounted:tc}),P=ql(I,{enabled:S,delay:{open:75},handleClose:Gl({blockPointerEvents:!0})}),B=zl(I,{event:"mousedown",toggle:!S,ignoreMouse:S}),W=Wl(I,{role:"menu"}),D=Kl(I,{bubbles:!0}),E=Yl(I,{listRef:w,activeIndex:b,nested:S,onNavigate:x}),V=Zl(I,{listRef:v,onMatch:f?x:void 0,activeIndex:b}),{getReferenceProps:X,getFloatingProps:Z,getItemProps:G}=Jl([P,B,W,D,E,V]);p.useEffect(()=>{if(!y)return()=>{};function z(){g(!1)}function se(q){q.nodeId!==N&&q.parentId===T&&g(!1)}return y.events.on("click",z),y.events.on("menuopen",se),()=>{y.events.off("click",z),y.events.off("menuopen",se)}},[y,N,T]),p.useEffect(()=>{f&&y&&y.events.emit("menuopen",{parentId:T,nodeId:N})},[y,f,N,T]);const J=p.useMemo(()=>({activeIndex:b,setActiveIndex:x,getItemProps:G,setHasFocusInside:m,isOpen:f}),[b,G,f]);return s.jsxs(Xl,{id:N,children:[s.jsxs("button",{type:"button",ref:ss([_.setReference,j.ref,e]),tabIndex:S?C.activeIndex===j.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:R(i,{"sarsa--menu-trigger":!S,"sarsa--menu-item":S,"is-nested-menu":S,"icon-only":o,"has-border":c,"has-fill":d}),...X({...u,onFocus(z){u.onFocus?.(z),m(!1)}}),children:[s.jsx("span",{className:"contents-wrap",children:r}),!S&&l?f?s.jsx(A,{iconName:"chevron-up",className:"chevron-icon"}):s.jsx(A,{iconName:"chevron-down",className:"chevron-icon"}):null,S&&s.jsx(A,{"aria-hidden":!0,iconName:"chevron-right",className:"nested-icon"})]}),s.jsx(ks.Provider,{value:J,children:s.jsx(Ql,{elementsRef:w,labelsRef:v,children:f&&s.jsx(Ar,{children:s.jsx(Lr,{context:I,modal:!1,initialFocus:S?-1:0,returnFocus:!S,children:s.jsx("div",{ref:_.setFloating,className:"sarsa--menu-popup",style:k,...Z(),children:a})})})})})]})}),cr=p.forwardRef((t,e)=>{const{"aria-label":a,isDisabled:r,children:i,iconBeforeElement:o,appearance:l,...c}=t,d=a??Yt(i),u=p.useContext(ks),f=Da({label:r?null:d}),g=$a(),h=f.index===u.activeIndex;return s.jsx("button",{...c,ref:ss([f.ref,e]),type:"button",role:"menuitem",className:R("sarsa--menu-item",{danger:l==="danger"}),tabIndex:h?0:-1,disabled:r,...u.getItemProps({onClick(m){g?.events.emit("click"),window.setTimeout(()=>{c.onClick?.(m)},0)},onFocus(m){c.onFocus?.(m),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:i})]})})});p.forwardRef((t,e)=>{const{"aria-label":a,children:r,iconBeforeElement:i,...o}=t,l=a??Yt(r),c=p.useContext(ks),d=Da({label:l}),u=$a(),f=d.index===c.activeIndex;return s.jsx("a",{...o,ref:ss([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:[i?s.jsx("span",{className:"icon-wrap",children:i}):null,s.jsx("span",{children:r})]})})});const Nf=p.forwardRef((t,e)=>Pr()===null?s.jsx(ec,{children:s.jsx(lr,{...t,ref:e})}):s.jsx(lr,{...t,ref:e}));class Iv extends ie.Component{static propTypes={inventory:n.oneOf(["Campground","Permit","Vehicle Permit","Ticket Facility"]),facility_id:n.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,a){(e.inventory!==this.props.inventory||e.facility_id!==this.props.facility_id||!a.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=Je(this.typedEnvironmentMap,this.props.inventory,!1);if(e){this.fetchData(`/api/${e.path}/${this.props.facility_id}`,"additionalData","additionalError","additionalLoading",e.data.additional);const i=Je(e,"data.seasons",!1);i&&this.fetchData(`/api/${e.path}/${this.props.facility_id}/${i}`,"seasonsData","seasonsError","seasonsLoading",i)}const a="/api/communication/external/alert",r=`location_id=${encodeURIComponent(this.props.facility_id)}&location_type=${encodeURIComponent(this.props.inventory)}`;this.fetchData(`${a}?${r}`,"bannerData","bannerError","bannerLoading","alerts")}fetchData(e,a,r,i,o){const l={Authorization:Kt()};this.setState({[i]:!0}),oe.get(e,{headers:l}).then(c=>{this.setState({[i]:!1,[r]:null,[a]:Je(c.data,o,{})})}).catch(c=>{this.setState({[i]:!1,[r]:c})})}isValidLocation(){return Object.keys(this.linkMap).indexOf(this.props.inventory)>-1&&this.props.facility_id!==""}renderBanners(e){return this.state.bannerLoading?s.jsx(Le,{}):!e||e.length===0?s.jsx("span",{children:"No results."}):s.jsx("div",{children:e.map((a,r)=>s.jsxs("div",{className:a.alert_level==="WARNING"?"ia-block rec-notification-warning":"ia-block rec-notification-info",children:[s.jsx(kt,{html:a.body}),a.notes!==void 0&&a.notes.length>0&&s.jsx("div",{children:s.jsxs("i",{children:["NOTE: ",a.notes]})})]},`banner-item_${r}`))})}renderList(e,a,r,i){if(r)return s.jsx(Le,{});if(!e||e.length===0||_e(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(or,{date:new Date(e.season_start),format:"LL"})," - ",s.jsx(or,{date:new Date(e.season_end),format:"LL"})]})]},`season-row_${a}`))})]}):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(re,{appearance:"h6",headingLevel:3,children:"Facility Seasons"}),this.state.seasonsError?s.jsx("span",{children:"Error retrieving season information."}):this.renderSeasonTable()]}));let a=null;this.props.inventory===this.CAMPGROUND?a=this.renderList(this.state.additionalData,"notice_text",this.state.additionalLoading,!0):this.props.inventory===this.TICKET_FACILITY?a=this.renderList(this.state.additionalData,"description",this.state.additionalLoading,!0):a=this.renderList(this.state.additionalData,"",this.state.additionalLoading);const r=Je(this.state,"locationNotesData",[]),i=Array.isArray(r)?r.filter(l=>!l.mandatory):[],o=Array.isArray(r)?r.filter(l=>l.mandatory):[];return s.jsxs("section",{className:R("rec-order-detail-need-to-know","rec-order-detail-section"),children:[s.jsx(re,{className:"rec-section-header",appearance:"h4",headingLevel:2,children:"CSR Facility Information"}),s.jsxs("div",{className:"rec-order-detail-section-body",children:[s.jsx(re,{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(re,{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(re,{appearance:"h6",headingLevel:3,children:"Call Center Notes"}),this.state.locationNotesError?s.jsx("span",{children:"Error retrieving call center notes."}):this.renderList(i,"note",this.state.locationNotesLoading,!0),s.jsx(re,{appearance:"h6",headingLevel:3,children:"Additional Information"}),this.state.additionalError?s.jsx("span",{children:"Error retrieving additional information"}):a,e]})]})}}const Xt=p.forwardRef((t,e)=>{const{id:a,label:r,value:i,name:o,isDisabled:l=!1,isChecked:c,isRequired:d=!1,isInvalid:u,innerRef:f,className:g,onChange:h,defaultChecked:m,isLabelVisible:b=!0,clickTagCategory:x,clickTagAction:w,clickTagLabel:v,gaTrackingId:C,...y}=t,N=ct(a),T=Vs(e,f),j=S=>{h&&h(S),x&&v&&w&&ze({category:x,action:w,label:v},()=>{})};return s.jsxs("label",{htmlFor:N,className:R("rec-label-checkbox",g,{disabled:l}),children:[s.jsx("input",{ref:T,type:"checkbox",id:N,value:i,name:o,disabled:l,required:d,className:"rec-input-hide",checked:c,onChange:j,"aria-required":d,defaultChecked:m,"data-rectagcategory":x,"data-rectaglabel":v,"data-rectagaction":w,"data-ga-tracking-id":C,...y}),s.jsx("span",{className:R("rec-input-checkbox",{"is-invalid":u})}),b?r:s.jsx("span",{className:"rec-sr-only",children:r}),d&&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) "})]})]})});function jf(t,e){const{checkboxId:a="need-to-know-checkbox",checkboxText:r="Yes, I have read and agree to the Need to Know information.",children:i,className:o,errorText:l="Please read and agree to the important Need to Know information.",onChange:c,headerText:d="Need to Know",headingLevel:u=2,introText:f,isChecked:g,isInvalid:h,isRequired:m=!0,listItems:b,name:x="needToKnowCheckbox",showCheckbox:w=!0,siteInfo:v,siteName:C="our site"}=t,y=p.useRef(null),[N,T]=p.useState(g??!1),[j,S]=p.useState(!1),[k,_]=p.useState(!1),[I,P]=p.useState(h),B=f||Tf(C),W=typeof g=="boolean"&&c,D=W?g:N,E=!D&&(h??I);p.useImperativeHandle(e,()=>({validate:()=>{const Z=m?!D:!1;return P(Z),{isInvalid:Z,errorText:Z?l:"",inputId:a,id:a,label:d}}}));const V=p.useCallback(()=>{const Z=y.current;if(!Z)return;const{scrollTop:G,scrollHeight:J,clientHeight:z}=Z,se=J>z;S(se),se?G+z>=J?_(!1):G===0?_(!0):G>=50&&_(!1):_(!1)},[]);p.useEffect(()=>{const Z=Ot(()=>{V()},100);return window.addEventListener("resize",Z),()=>{window.removeEventListener("resize",Z)}},[V]),p.useEffect(()=>{V()},[V,i,v,b]);const X=Z=>{W?c?.(Z.target.checked):T(Z.target.checked)};return s.jsxs("section",{className:R("rec-order-detail-need-to-know","sarsa-need-to-know",o),children:[s.jsx(re,{className:"rec-section-header",appearance:"h4",headingLevel:u,id:"needToKnowHeader",children:d}),s.jsxs("div",{className:"rec-notification-warning",children:[s.jsx("span",{className:"rec-notification-icon",children:s.jsx(A,{iconName:"warning"})}),s.jsxs("div",{className:"rec-notification-body",children:[s.jsx("div",{className:"rec-notification-title",children:"Important information"}),s.jsx("p",{children:B})]})]}),s.jsxs("div",{className:"information",children:[s.jsxs("div",{className:"information-content",ref:y,onScroll:V,tabIndex:j?0:void 0,role:"region","aria-labelledby":"needToKnowHeader",children:[i?null:s.jsx(re,{className:"mb-1 mb-md-3",appearance:"h6",headingLevel:u+1,children:"Facility Information"}),v?s.jsx(kt,{html:v}):null,b?s.jsx("ul",{children:b.map((Z,G)=>s.jsx("li",{children:s.jsx(kt,{html:Z.notice_text})},G))}):null,i]}),s.jsx("div",{className:R("information-scroll-indicator",{"hide-indicator":!k}),"aria-hidden":"true",children:s.jsx("div",{className:"information-scroll-pill",children:"Scroll to Read More"})})]}),s.jsx("div",{className:R("rec-form-check-wrap",{"rec-form-no-checkbox":!w,"is-invalid":E}),children:w&&s.jsx(Xt,{label:r,id:a,value:"checked",isRequired:m,isChecked:D,onChange:X,name:x,"aria-describedby":E?`${a}-error`:void 0})}),E&&s.jsx(Ve,{id:`${a}-error`,children:l})]})}const Ev=p.forwardRef(jf);function Tf(t){return`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 ${t}.`}class ge extends p.PureComponent{constructor(e){super(e),this.clearError=()=>{this.setState({isInvalid:!1,errorText:void 0})},this.handleNewErrorState=({isInvalid:r,errorText:i})=>{const{handleNewErrorState:o,id:l,name:c}=this.props;o&&(r!==this.errorState.isInvalid||i!==this.errorState.errorText)&&(o({id:l,name:c,isInvalid:r,errorText:i}),this.errorState={isInvalid:r,errorText:i})},this.handleClearButtonClick=r=>{r.preventDefault();const{onChange:i}=this.props;this.setState({value:"",isPristine:!0,isInvalid:!1,errorText:void 0}),i&&i({target:{value:""}}),this.handleNewErrorState({isValid:!1,errorText:void 0})},this.handleChange=r=>{r.persist();const i=r.target.value,{onChange:o}=this.props,{isPristine:l}=this.state;this.isControlled()?(o&&o(r),i&&l&&this.setState({isPristine:!1})):(this.setState({value:i},()=>{i&&l&&this.setState({isPristine:!1})}),o&&o(r))},this.handleBlur=r=>{const{isRequired:i,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(),(i||l)&&!d){const h=this.validate();c&&c(r,{value:g,...h}),h.isInvalid&&h.errorText&&ue(h.errorText,"assertive")}else c&&c(r,{value:g,isInvalid:u,errorText:f})},this.hint=()=>{const{hinter:r,hintText:i}=this.props,o=this.isControlled()?this.props.value:this.state.value;if(o&&r){let l=i;l=r(o),this.setState({hintText:l})}},this.validate=()=>{const{validator:r,isRequired:i,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(i){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&&r){const u=r(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 m=0;m{}})}u.isValid||(d.isInvalid=!0,d.errorText=u.errorText||null)}return this.setState(d),this.handleNewErrorState(d),d};const a=typeof e.errorText=="string"&&e.errorText.length>0;this.state={value:e.value||e.defaultValue,isPristine:!(e.value||e.defaultValue),isInvalid:e.isInvalid||a||!1,errorText:e.errorText||void 0,hintText:e.hintText||void 0},this.errorState={isInvalid:e.isInvalid,errorText:e.errorText}}static{this.propTypes={id:n.string.isRequired,name:n.string,label:n.node.isRequired,isLabelVisible:n.bool,type:n.oneOf(["text","password","search","email","tel","hidden"]),placeholder:n.string,value:n.string,isDisabled:n.bool,isRequired:n.bool,isInvalid:n.bool,isInline:n.bool,enableShowPassword:n.bool,errorText:n.node,hintText:n.node,iconElement:n.element,unitBefore:n.string,unitAfter:n.string,innerRef:n.oneOfType([n.func,n.object,n.node]),hasClearButton:n.bool,handleClearButtonClick:n.func,shouldFocusOnMount:n.bool,className:n.string,defaultValue:n.string,onChange:n.func,onBlur:n.func,validator:n.func,hinter:n.func,shouldValidateOnMount:n.bool,shouldValidateOnUpdate:n.bool,shouldHintOnUpdate:n.bool,shouldReformatValue:n.bool,handleNewErrorState:n.func,gaTrackingId:n.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:a}=this.state;a&&e&&(clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.validate()},0))}componentDidUpdate(e){const{shouldValidateOnUpdate:a,shouldHintOnUpdate:r,isInvalid:i,errorText:o}=this.props;if(r&&this.hint(),a)this.validate();else if(i!==e.isInvalid||o!==e.errorText){const l=typeof o=="string"&&o.length>0;this.setState({isInvalid:i||l,errorText:o})}}componentWillUnmount(){clearTimeout(this.timeout)}isControlled(){const{value:e,onChange:a}=this.props;return typeof e=="string"&&a!==void 0}render(){const{gaTrackingId:e,...a}=this.props,{isInvalid:r,errorText:i,hintText:o}=this.state,l=this.isControlled()?this.props.value:this.state.value,c=$t(a,["defaultValue","shouldReformatValue","shouldValidateOnMount","shouldValidateOnUpdate","shouldHintOnUpdate","validator","hinter","handleNewErrorState"]);return s.jsx(dn,{...c,onChange:this.handleChange,onBlur:this.handleBlur,handleClearButtonClick:this.handleClearButtonClick,isInvalid:r,errorText:i,hintText:o,value:l,"data-ga-tracking-id":e})}}function Rf({isRemoveAllModalOpen:t,setIsRemoveAllModalOpen:e,dismissModal:a,loading:r,removeFromFavorites:i}){return s.jsxs(dt,{heading:"",size:"md",isOpen:t,overlayClassName:"sarsa-favorites-modal-wrap",onRequestClose:a,shouldActionsStickInMobile:!0,children:[s.jsx("div",{style:{display:"grid",placeItems:"center"},className:"my-10",children:s.jsx(ce,{size:"xl",fontWeight:"semibold",children:"Are you sure you want to remove this item from all lists?"})}),s.jsx(ot,{children:s.jsxs(et,{children:[s.jsx(M,{appearance:"tertiary",onClick:()=>{e(!1)},children:"Back"}),s.jsx(M,{onClick:()=>{i()},appearance:"danger",isLoading:r,isDisabled:r,children:"Remove"})]})})]})}function If({mode:t,entityId:e,entityType:a,parentId:r,parentType:i,onSave:o,onCancel:l}){const[c,d]=p.useState([]),[u,f]=p.useState(!1),[g,h]=p.useState([]),[m,b]=p.useState(),[x,w]=p.useState({}),[v,C]=p.useState(!1),[y,N]=p.useState(!1),[T,j]=p.useState(!1),[S,k]=p.useState({}),[_,I]=p.useState(null),[P,B]=p.useState(!1),W=uo(),D=async F=>{try{const ee=new Set;for(let U=0;U3)break}}if(ee.size===0)return;const O=ft("/api/search/geo",{fq:[...ee].map(U=>`id:${U}`),size:50}),$=await oe.get(O),Y={};for(let U=0;U{f(!0),h([]);try{const O=(await oe.get("/api/trips/favorites/groups",{headers:{Authorization:Te()}}))?.data?.result||[];O.sort(($,Y)=>$.group_name?.toLowerCase().localeCompare(Y.group_name?.toLowerCase())),d(O),D(O)}catch{h(["There were errors loading favorites"])}f(!1)},V=async()=>{const F=new Set,ee=new Set;a==="campsite"?ee.add(`${e}_${a}`):a==="campground"?F.add(`${e}_asset`):a==="sitepass"?F.add(`${e}_asset`):a==="recarea"?F.add(`${e}_asset`):a==="facility"?F.add(`${e}_asset`):F.add(`${e}_${a}`);const O={};try{const $=ft("/api/search/geo",{fq:[...F].map(U=>`id:${U}`),size:500});(await oe.get($))?.data?.results?.forEach(U=>{O[`asset_${U.entity_id}`]=U})}catch($){h(["There were errors loading favorites",`${$}`])}if(ee.size>0)try{const $=ft("/api/search/campsites",{fq:[...ee].map(U=>`id:${U}`),size:500});(await oe.get($))?.data?.campsites?.forEach(U=>{O[`campsite_${U.campsite_id}`]=U})}catch($){h(["There were errors loading favorites",`${$}`])}I(O)},X=c.length===1&&c[0]?.group_name==="All Favorites";p.useEffect(()=>{C(!0),E(),V()},[e,a]),p.useEffect(()=>{const F={};for(let ee=0;ee<(c||[]).length;ee+=1)for(let O=0;O<(c[ee]?.favorites||[]).length;O+=1){const $=c[ee]?.favorites[O]?.entity_id===e&&c[ee]?.favorites[O]?.entity_type===a;$&&(F[c[ee].group_id]=$)}F.all=!0,w(F)},[c,e,a]);const Z=F=>{b(F.target.value),F.target.value&&F.target.value.trim()!==""?(x.new=!0,j(!0)):(x.new=!1,j(!1)),w(x)},G=()=>{const F=[],ee=Object.assign([],c);return ee.forEach(O=>{const $=O,Y=$.favorites?.filter(U=>U.entity_id===e&&U.entity_type===a);if(x[$.group_id]===!0){if(!Y||Y.length===0){const U=$.favorites||[];U.push({entity_id:e,entity_type:a,parent_id:r,parent_type:i}),$.favorites=U,F.push($)}}else Y?.length>0&&($.favorites=$.favorites?.map(U=>{const ne=U;return ne.entity_id===e&&ne.entity_type===a&&(ne.is_active=!1),ne}),F.push($))}),Object.keys(x).forEach(O=>{if(O==="new"&&x[O]&&F.push({group_name:m,favorites:[{entity_id:e,entity_type:a,parent_id:r,parent_type:i}],is_active:!0}),O==="all"&&x[O]){const $=c.filter(Y=>Y.group_name==="All Favorites");if($.length===0)F.push({group_name:"All Favorites",favorites:[{entity_id:e,entity_type:a,parent_id:r,parent_type:i}],is_active:!0});else{const Y=$[0],U=Y.favorites?.filter(ne=>ne.entity_id===e&&ne.entity_type===a);if(!U||U.length===0){const ne=Y.favorites||[];ne.push({entity_id:e,entity_type:a,parent_id:r,parent_type:i}),Y.favorites=ne,F.push(Y)}}}}),d(ee),F},J=async F=>{if(_){f(!0),h([]);try{const ee="/api/trips/favorites/group";for(let Y=0;Y{const ee=c.filter(O=>O.favorites?.filter(Y=>Y.entity_id===e&&Y.entity_type===a)?.length>0).map(O=>{const $={...O},Y=$.favorites?.map(U=>{const ne={...U};return ne.entity_id===e&&ne.entity_type===a&&(ne.is_active=!1),ne});return $.favorites=Y,$});await J(ee),B(!1)},se=()=>{C(!1),l&&l()},q="199951850105",L=()=>u?null:s.jsxs(s.Fragment,{children:[s.jsxs(he,{alignItems:"center",hasGutters:!1,className:"group-item",children:[s.jsx(te,{xs:"variable",children:s.jsx("div",{className:"heart-icon-block",children:s.jsx(A,{iconName:"favorite"})})}),s.jsx(te,{xs:"auto",children:s.jsx(re,{headingLevel:2,appearance:"h6",children:"All Favorites"})}),s.jsx(te,{xs:"variable",children:t==="edit"?s.jsx(M,{appearance:"tertiary",gaTrackingId:q,onClick:()=>{B(!0)},children:"Remove Item from All Lists"}):s.jsx(ce,{fontWeight:"bold",children:"Automatically Added to All Favorites"})})]}),X&&s.jsx(je,{type:"info",className:"mt-2 mb-6",children:"By default, all favorites are automatically added to the All Favorites list. You can also create a custom list by clicking on the “Create New List” button below to add this item to a new custom list as well."}),c.map((F,ee)=>{const O=x[F.group_id]||!1;return F.group_name==="All Favorites"?null:s.jsxs("div",{className:"group-item",children:[s.jsx(rs,{}),s.jsxs(he,{alignItems:"center",hasGutters:!1,children:[s.jsx(te,{xs:"variable",children:s.jsx(Jt,{className:"faux-image-block",src:S[F.group_id]})}),s.jsx(te,{xs:"auto",children:s.jsx(re,{headingLevel:2,appearance:"h6",children:F.group_name})}),s.jsx(te,{xs:"variable",children:s.jsx(Xt,{id:`l_id-${F.group_id}`,className:"mr-1",value:F.group_id,label:"Add to List","aria-label":`Add to ${F.group_name} list`,isChecked:O,onChange:()=>{const $={...x};$[F.group_id]=!$[F.group_id],w($),j(!0)}},`l-ch-${F.group_id}`)})]})]},`fav_${ee}_${F.group_id}`)})]}),H=()=>s.jsx(he,{children:s.jsx(te,{className:"mb-2",children:s.jsx(ge,{id:"new-list-name",label:"enter list name",isLabelVisible:!1,placeholder:"Enter List Name",onChange:Z,value:m,shouldFocusOnMount:!0,hasClearButton:!0})})}),Q=()=>s.jsxs(ot,{children:[!y&&s.jsx("div",{className:"create-new-list-btn",children:s.jsx(M,{appearance:"link",iconBeforeElement:s.jsx(A,{iconName:"add-circle"}),gaTrackingId:q,onClick:()=>{N(!0)},children:"Create New List"})}),s.jsxs(et,{children:[s.jsx(M,{appearance:"tertiary",gaTrackingId:q,onClick:()=>{C(!1),l&&l()},children:"Cancel"}),s.jsx(M,{gaTrackingId:q,onClick:()=>{J(G())},isDisabled:t==="add"&&Object.keys(x).length===0||t==="edit"&&!T,children:"Save"})]})]});let K;switch(!0){case y:K="Create New List";break;case t==="add":K="Add to Favorites";break;case t==="edit":K="Edit Favorites";break;default:K=""}return P?s.jsx(Rf,{isRemoveAllModalOpen:P,setIsRemoveAllModalOpen:B,dismissModal:se,loading:u,removeFromFavorites:z}):s.jsxs(dt,{heading:K,size:"md",isOpen:v,overlayClassName:"sarsa-favorites-modal-wrap",onRequestClose:se,shouldActionsStickInMobile:!0,children:[u&&s.jsx(Le,{}),g.length>0&&s.jsx(je,{type:"error",heading:"There were errors:",className:"mb-3",children:s.jsx("ul",{children:g.map((F,ee)=>s.jsx("li",{children:`${F}`},`err-${ee}`))})}),!y&&L(),y&&H(),Q()]})}function Ef({closeModal:t,onConfirmClick:e,isOpen:a}){return s.jsxs(dt,{heading:"Remove favorite?",size:"sm",isOpen:a,overlayClassName:"sarsa-favorites-modal-wrap",onRequestClose:t,shouldActionsStickInMobile:!0,shouldShowCloseButton:!1,children:[s.jsx("p",{children:"Are you sure you want to remove this favorite?"}),s.jsx(ot,{children:s.jsxs(et,{isFullWidthOnMobile:!1,isStretchedToFit:!0,children:[s.jsx(M,{appearance:"tertiary",onClick:t,gaTrackingId:"445887874628",children:"Cancel"}),s.jsx(M,{onClick:e,gaTrackingId:"445887874628",children:"Remove Favorite"})]})})]})}function kf({entityId:t,entityType:e,parentId:a,parentType:r,showFavoriteText:i,onSave:o,onCancel:l,editable:c,favAriaLabel:d}){const[u,f]=p.useState(!1),[g,h]=p.useState(!1),[m,b]=p.useState(!1),[x,w]=p.useState(!1),[v,C]=p.useState(!1),[y,N]=p.useState(!1),[T,j]=p.useState(!1),S=Ie(),k=pe(q=>q?.auth),_=uo(),[I,P]=p.useState(!1),B=()=>P(!0),W=()=>P(!1),D=p.useCallback(async()=>{if(!(!m||!t)){try{const q=ft("/api/trips/favorites/entity",{entity_id:t,entity_type:e||"asset"}),L=await oe.get(q,{headers:{Authorization:Te()}});h((L.data.result?.length||0)>0),j(!1)}catch{j(!0)}f(!0)}},[t,e,m]);p.useEffect(()=>{b($e()),$e()||f(!0)},[k]),p.useEffect(()=>{D()},[t,e,D,m]);const E=()=>{C(!0)},V=()=>{D(),C(!1),N(!1),o&&o()},X=()=>{C(!1),N(!1),l&&l()},Z=async()=>{w(!0);let q=[];try{q=(await oe.get("/api/trips/favorites/groups",{headers:{Authorization:Te()}}))?.data?.result||[]}catch{w(!1),X();return}const H=q.filter(Q=>Q.favorites?.filter(F=>F.entity_id===t&&F.entity_type===e)?.length>0).map(Q=>{const K=Q,F=Q.favorites?.map(ee=>{const O=ee;return ee.entity_id===t&&ee.entity_type===e&&(O.is_active=!1),O});return K.favorites=F,K});try{const Q="/api/trips/favorites/group";for(let K=0;K{W(),Z()},J=q=>{if(q.preventDefault(),!$e()){S(zs());return}g?c?N(!0):B():E()},z=g?"rec-favorite-heart-liked":"rec-favorite-heart-unliked",se=()=>{let q=g?"Remove From Favorites":"Add To Favorites";return d&&(q+=`: ${d}`),q};return T?null:s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rec-favorite-heart-wrapper",children:s.jsx(M,{appearance:"subtle",size:"lg",className:`rec-favorite-heart ${z} p-0`,iconBeforeElement:s.jsx(_f,{}),"aria-label":se(),onClick:J,isLoading:x,isDisabled:!u,children:i?s.jsx("span",{className:"rec-favorite-text",children:"Favorite"}):null})}),(v||y)&&s.jsx(If,{entityId:t,entityType:e||"asset",parentId:a,parentType:r,mode:`${v?"add":"edit"}`,onSave:V,onCancel:X}),s.jsx(Ef,{closeModal:W,onConfirmClick:G,isOpen:I})]})}function _f(){return s.jsxs("svg",{id:"rec-icon-favorite-border",viewBox:"0 0 24 24",role:"presentation",focusable:"false",width:24,height:24,children:[s.jsx("path",{fill:"none",d:"M12 24l-2.8-2.5C3.8 16.7 0 13.2 0 8.5 0 4.3 3.3 1 7.5 1c1.6 0 3.2.5 4.5 1.4 1.3-.9 2.9-1.4 4.5-1.4C20.7 1 24 4.3 24 8.5c0 4.7-3.9 8.2-9.2 13L12 24z"}),s.jsx("path",{fill:"none",d:"M16.5 3c-1.7 0-3.4.8-4.5 2.1C10.9 3.8 9.2 3 7.5 3 4.4 3 2 5.4 2 8.5c0 3.8 3.4 6.9 8.6 11.5l1.4 1.3 1.4-1.3c5.2-4.7 8.6-7.8 8.6-11.5C22 5.4 19.6 3 16.5 3z"}),s.jsx("path",{d:"M16.5 3c-1.7 0-3.4.8-4.5 2.1C10.9 3.8 9.2 3 7.5 3 4.4 3 2 5.4 2 8.5c0 3.8 3.4 6.9 8.6 11.5l1.4 1.3 1.4-1.3c5.2-4.7 8.6-7.8 8.6-11.5C22 5.4 19.6 3 16.5 3zm-4.4 15.5l-.1.1-.1-.1C7.1 14.2 4 11.4 4 8.5 4 6.5 5.5 5 7.5 5c1.5 0 3 1 3.6 2.4H13C13.5 6 15 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.9-3.1 5.7-7.9 10z"})]})}const Qt=n.shape({altText:n.string,caption:n.string,url:n.string,credit:n.string});function fo({images:t=[]}){const e=t[0]||{},a=t[1]||{},r=t[2]||{},i=e.url?{backgroundImage:`url(${e.url})`}:void 0,o=a.url?{backgroundImage:`url(${a.url})`}:void 0,l=r.url?{backgroundImage:`url(${r.url})`}:void 0;return s.jsxs("div",{className:"sarsa-hero-image-gallery-layout md",children:[s.jsx("div",{className:"photo hero",style:i,role:"img","aria-label":e.altText}),s.jsx("div",{className:"gallery-wrapper",children:s.jsxs("div",{className:"stack",children:[s.jsx("div",{className:"photo gallery one",style:o,role:"img","aria-label":a.altText}),s.jsx("div",{className:"photo gallery two",style:l,role:"img","aria-label":r.altText})]})})]})}fo.propTypes={images:n.arrayOf(Qt)};function Gt({image:t,showUnavailableImage:e=!1,nearText:a,assetName:r,parentText:i}){const{width:o=0}=Ti();let l=null;if((r||i||a)&&o{if(a===Mf&&!x.current){const y=!!e,N=t.length>0,T={category:"Hero Image Gallery Audit",action:"",label:window.location.href};y&&(T.action="Has Hero Image"),y&&N&&(T.action=`Has Hero Image & ${t.length} ${rt(t.length,"Gallery Image","Gallery Images")}`),!y&&N&&(T.action=`No Hero Image - Has ${t.length} ${rt(t.length,"Gallery Image","Gallery Images")}`),!y&&!N&&(T.action="No Hero Image or Gallery Images"),ze(T,()=>{x.current=!0})}},[a,e,t]),p.useEffect(()=>{let y=[];y=y.concat(Array.isArray(t)?[...t]:[]),_e(e)?t.length>2&&b(y):(y.unshift(e),b(y))},[e,t]);const w=()=>{g(!0)},v=()=>{g(!1)};let C=null;return u&&(C=s.jsxs(Zt,{space:"xs",className:"action-buttons",children:[s.jsx(M,{className:"view-more-photos",appearance:"pill",iconAfterElement:s.jsx(A,{iconName:"photo-gallery"}),onClick:w,size:"xs",children:m.length>10?"10+":m.length}),s.jsx(kf,{entityId:d??""})]})),a===Lf||a===Af?s.jsx("div",{className:R("sarsa-hero-image-gallery",i),children:s.jsx(Gt,{})}):a===Pf||!m||m.length===0?s.jsxs("div",{className:R("sarsa-hero-image-gallery",i),children:[s.jsx(Gt,{showUnavailableImage:!0,nearText:o,assetName:l,parentText:c}),C]}):m.length<3?s.jsxs("div",{className:R("sarsa-hero-image-gallery",i),children:[C,s.jsx(Gt,{image:m[0],nearText:o,assetName:l,parentText:c})]}):s.jsxs("div",{children:[s.jsxs("div",{className:R("sarsa-hero-image-gallery",i),children:[h>=Ee.xl&&s.jsx(go,{images:m}),h=Ee.md&&s.jsx(fo,{images:m}),h{const r=`state-${a.value}`,i=s.jsx("option",{value:a.value,children:a.label},r);return e.push(i)}),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 _v extends ie.PureComponent{static propTypes={className:n.string,account:n.shape({account_id:n.string,email:n.string,first_name:n.string,home_address:n.shape({address1:n.string,address2:n.string,city:n.string,country:n.string,state:n.string,zip_code:n.string}),home_phone:n.string,last_name:n.string}),handleChange:n.func};constructor(){super(),this.getStates=this.getStates.bind(this)}getStates(){const e=[];return Df.map(a=>{const r=`state-${a.value}`,i=s.jsx("option",{value:a.value,children:a.label},r);return e.push(i)}),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()})}}n.shape({account_id:n.string,first_name:n.string,home_address:n.shape({address1:n.string,address2:n.string,city:n.string,country:n.string,state:n.string,zip_code:n.string}),home_phone:n.string,last_name:n.string}).isRequired,n.func.isRequired,n.func.isRequired,n.func.isRequired;n.func.isRequired,n.func.isRequired,n.func.isRequired,n.shape({address1:n.string,address2:n.string,city:n.string,state:n.string,zip_code:n.string,country:n.string}),n.shape({address1:n.string,address2:n.string,city:n.string,state:n.string,zip_code:n.string,country:n.string}).isRequired,n.bool,n.bool,n.bool;n.func,n.func,n.func,n.shape({account_id:n.string,first_name:n.string,home_address:n.shape({address1:n.string,address2:n.string,city:n.string,country:n.string,state:n.string,zip_code:n.string}),home_phone:n.string,last_name:n.string}),n.shape({address1:n.string,address2:n.string,city:n.string,state:n.string,zip_code:n.string}),n.bool,n.bool,n.string,n.string,n.bool,n.bool,n.func,n.string;n.string.isRequired,n.string,n.func;n.string.isRequired,n.func;n.string,n.oneOf(["xs","sm","md","lg","xl"]);function Av(){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."]})})})}n.string.isRequired,n.bool.isRequired,n.func.isRequired,n.bool,n.string,n.string,n.string,n.string,n.string;const vo="rec-recaptcha",Ff=()=>window&&!!window.grecaptcha,Vf=()=>!Se(document.scripts.namedItem(vo)),Bf=(t,e,a)=>{try{return window.grecaptcha.ready(()=>window.grecaptcha.execute(t,{action:e}).then(r=>a({token:r})).catch(r=>a({error:r?.message})))}catch(r){return a({error:r.message})}},Hf=(t,e,a)=>{if(Vf()){const r=setInterval(()=>{Ff()&&(Bf(t,e,a),clearInterval(r))},100)}else return a({error:"recaptcha script not detected."})},Lv=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=vo,document.body.appendChild(e)};function Pv(){return p.useEffect(()=>{rc({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 Uf=/^[-]?[0-9]?([0-9,]+)?([.][0-9]{0,2})?$/;class Mv extends ie.PureComponent{static propTypes={label:n.node.isRequired,id:n.string.isRequired,name:n.string,isLabelVisible:n.bool,type:n.oneOf(["text","password","search","email","tel"]),placeholder:n.string,value:n.number,defaultValue:n.number,isDisabled:n.bool,isRequired:n.bool,isInline:n.bool,innerRef:n.oneOfType([n.func,n.object,n.node]),hasClearButton:n.bool,shouldFocusOnMount:n.bool,className:n.string,maxLength:n.string,onChange:n.func,onBlur:n.func,min:n.number,max:n.number,shouldValidateOnMount:n.bool,shouldValidateOnUpdate:n.bool,handleNewErrorState:n.func,isInvalid:n.bool,errorText:n.node,unitBefore:n.string,srUnitDescription:n.string,gaTrackingId:n.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 a=typeof e.errorText=="string"&&e.errorText.length>0;let r="";Se(e.value)?Se(e.defaultValue)||(r=jt(e.defaultValue)):r=jt(e.value),this.state={value:r,isPristine:!(e.value||e.defaultValue),isInvalid:e.isInvalid||a||!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:a,isInvalid:r,errorText:i,value:o}=this.props;if(a)this.validate();else if(r!==e.isInvalid||i!==e.errorText){const l=typeof i=="string"&&i.length>0;this.setState({isInvalid:r||l,errorText:i})}!Se(o)&&this.isControlled()&&o!==parseFloat(this.state.value.replace(/,/g,""))&&(this.setState({value:jt(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 Dr(e)?null:e};clearError=()=>{this.setState({isInvalid:!1,errorText:void 0})};handleNewErrorState=({isInvalid:e,errorText:a})=>{const{handleNewErrorState:r,id:i,name:o}=this.props;r&&(e!==this.errorState.isInvalid||a!==this.errorState.errorText)&&(r({id:i,name:o,isInvalid:e,errorText:a}),this.errorState={isInvalid:e,errorText:a})};handleClearButtonClick=e=>{e.preventDefault();const{onChange:a}=this.props;this.setState({value:"",isPristine:!0,isInvalid:!1,errorText:void 0}),a&&a(null),this.handleNewErrorState({isValid:!1,errorText:void 0})};handleChange=e=>{e.preventDefault();const a=e.target.value;if(Uf.test(a)){const i=a===""||a==="-"?null:parseFloat(a.replace(/,/g,""),10),{onChange:o}=this.props;this.setState({value:a,isPristine:!1}),o&&o(i)}else a===""?this.setState({value:""}):ue("Error: Enter only numbers with a maximum of 2 decimal places.")};handleBlur=e=>{const{isRequired:a,onBlur:r,onChange:i,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=jt(g);if(this.setState({value:h}),f&&i){const m=h===""?null:parseFloat(h.replace(/,/g,""),10);i(m)}if((a||!Se(l)||!Se(o))&&!c){const m=this.validate();r&&r(e,{value:h,...m}),m.isInvalid&&m.errorText&&ue(m.errorText,"assertive")}else r&&r(e,{value:h,isInvalid:d,errorText:u})};validate=()=>{const{isRequired:e,id:a,min:r,max:i}=this.props,o=this.isControlled()?this.props.value:parseFloat(this.state.value.replace(/,/g,""),10),l={isInvalid:!1,errorText:null,id:a};if(Se(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!Se(o)&&(!Se(r)||!Se(i))&&(!Se(i)&&o>i?(l.isInvalid=!0,l.errorText=`${this.props.label} must be $${jt(i)} or less.`):!Se(r)&&othis.textFieldRef.current?.validate()}static{this.propTypes={id:n.string.isRequired,label:n.node,isInvalid:n.bool,gaTrackingId:n.string}}static{this.defaultProps={label:"Email"}}render(){const{id:e,label:a,isInvalid:r,gaTrackingId:i,...o}=this.props;return s.jsx(ge,{ref:this.textFieldRef,id:e,type:"email",label:a,isInvalid:r,validator:qf,gaTrackingId:i,...o})}}function Gf(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 a.errorText=r.invalidIntNumber,a;if(c.test(d)){switch(a.isValid=!0,d.substring(0,2)){case"44":a.formattedValue=zf(d);break;case"52":a.formattedValue=Gf(d);break;default:a.formattedValue=`+${d}`}return a}return a.errorText=r.invalidIntNumber,a}return d[0]==="1"&&(d=d.substring(1)),d.length!==10?(a.errorText=r.invalidNumber,a):parseInt(d[0],10)<=1?(a.errorText=r.invalidAreaCode,a):parseInt(d[3],10)<=1?(a.errorText=r.invalidNumber,a):(a.isValid=!0,a.formattedValue=d.replace(l,"($1) $2-$3"),a)}class yo extends p.PureComponent{constructor(){super(...arguments),this.textFieldRef=p.createRef(),this.validate=()=>this.textFieldRef.current?.validate()}static{this.propTypes={id:n.string.isRequired,label:n.node}}static{this.defaultProps={label:"Phone"}}render(){const{id:e,label:a,...r}=this.props;return s.jsx(ge,{ref:this.textFieldRef,id:e,type:"tel",label:a,validator:xo,shouldReformatValue:!0,...r})}}function Wf(t){const e={isValid:!1,formattedValue:null,errorText:null},a={invalidFormat:"Invalid ZIP/Postal code",invalidStartLetter:"First letter is not valid. Cannot be W or Z",invalidCanadianLetters:"Postal code cannot contain D, F, I, O, Q, or U",invalidChar:"Invalid ZIP/Postal Code",invalidLength:"Invalid ZIP/Postal Code"};let r="";const i=/^\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(i.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:n.string.isRequired,label:n.node}}static{this.defaultProps={label:"ZIP Code"}}render(){const{id:e,label:a,...r}=this.props;return s.jsx(ge,{ref:this.textFieldRef,id:e,label:a,validator:Wf,shouldReformatValue:!0,maxLength:10,...r})}}const Yf=350;function Zf({isLoading:t,id:e,children:a,className:r,linesToShow:i=3,lineHeight:o=24,buttonAriaLabel:l="Read more",onChange:c=void 0,readMoreLabel:d="Read More",readLessLabel:u="Read Less"}){const f=p.useRef(null),g=p.useRef(null),h=p.useRef(!0),[m,b]=p.useState(!1),[x,w]=p.useState(!0),v=ct(e),C=du(),y=`${i*o-2}px`,N=j=>{f.current&&(f.current.style.maxHeight=j)};p.useEffect(()=>{let j;if(!t){const S=g.current?.clientHeight,k=S?`${S}px`:"none";x&&m&&(clearTimeout(j),N(k),j=setTimeout(()=>{N("none")},Yf+100)),x&&!m&&(clearTimeout(j),N(k),h?(N(y),h.current=!1):j=setTimeout(()=>{N(y)},10))}return()=>{clearTimeout(j)}},[t,m,y,x]),p.useEffect(()=>{if(!t){const j=g.current?.clientHeight,S=Math.ceil(i*o);j&&j<=S?(w(!1),b(!1),N("none")):w(!0)}},[o,i,C,t]);const T=()=>{c&&c(!m),b(!m)};return t?s.jsxs("div",{children:[s.jsx(Ea,{lines:i}),s.jsx(Ea,{fontSize:12,lineHeight:24,lines:1,width:"80px"})]}):s.jsxs("div",{"data-component":"ReadMoreBlock",className:R("sarsa-read-more-block-wrapper",r,{collapsed:!m}),children:[s.jsx("div",{id:v,ref:f,className:"sarsa-read-more-block",style:{maxHeight:y},onFocus:()=>{setTimeout(()=>{b(!0)},0)},children:s.jsx("div",{className:"sarsa-read-more-block-inner",ref:g,children:a})}),x&&s.jsx("div",{className:"button-wrap",children:s.jsx(M,{size:"xs",appearance:"link","aria-controls":v,"aria-label":l,"aria-expanded":m,onClick:T,children:m?s.jsxs("span",{className:"read-more-with-icon",children:[s.jsx(A,{size:"sm",iconName:"chevron-up"}),s.jsx("span",{children:u})]}):s.jsxs("span",{className:"read-more-with-icon",children:[s.jsx(A,{size:"sm",iconName:"chevron-down"}),s.jsx("span",{children:d})]})})})]})}Zf.propTypes={isLoading:n.bool,id:n.string,children:n.node,linesToShow:n.number,lineHeight:n.number,buttonAriaLabel:n.string,className:n.string,onChange:n.func,readMoreLabel:n.string,readLessLabel:n.string};n.number,n.string,n.bool,n.bool;n.node,n.string,n.string;const Jf={success:"check-circle",warning:"warning",error:"error",info:"info"};function wo({type:t,title:e,headingLevel:a=3,children:r,dismissNotification:i,isBanner:o=!1,shouldFocusOnMount:l=!1,hasSolidBackground:c=!1,id:d,className:u,...f}){const g=p.useRef(null),h=`h${a}`,m=Jf[t],b=t==="error"?"assertive":"polite";p.useEffect(()=>{l&&g&&g.current?.focus()},[]);const x=()=>{i&&i(t)},w=()=>typeof r=="string"?s.jsx("p",{children:r}):s.jsx("div",{children:r});return o?s.jsxs("div",{tabIndex:-1,ref:g,className:R(`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(A,{iconName:m,className:`rec-icon-${t}`}),s.jsxs("div",{className:"rec-msg-text",children:[s.jsx(h,{className:"rec-msg-text-heading",children:e||`${Ss(t)} Notification:`}),s.jsx("div",{children:r})]})]}),i&&s.jsx(M,{className:"rec-notification-close-new",appearance:"subtle",size:"xs",iconBeforeElement:s.jsx(A,{iconName:"close"}),onClick:x,screenReaderTextAfter:"Dismiss notification"})]}):s.jsxs("div",{tabIndex:-1,ref:g,className:R(`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(A,{iconName:m,className:`rec-icon-${t}`})}),s.jsxs("div",{className:"rec-notification-body",children:[s.jsx(h,{className:"rec-notification-title",children:e||`${Ss(t)} Notification:`}),w()]})]}),i&&s.jsx(M,{className:"rec-notification-close-new",appearance:"subtle",size:"xs",iconBeforeElement:s.jsx(A,{iconName:"close"}),onClick:x,screenReaderTextAfter:"Dismiss notification"})]})}wo.propTypes={type:n.oneOf(["error","warning","success","info"]).isRequired,title:n.string,headingLevel:n.oneOf([1,2,3,4,5,6]),children:n.node,dismissNotification:n.func,isBanner:n.bool,shouldFocusOnMount:n.bool,hasSolidBackground:n.bool,id:n.string,className:n.string};const Co=p.memo(wo);function dr({id:t,label:e,legend:a,value:r,isDisabled:i,isChecked:o,isRequired:l,innerRef:c,className:d,name:u,isInline:f,gaTrackingId:g,...h}){const m=ct(t);return s.jsxs("label",{htmlFor:m,className:R("rec-label-radio",d,{disabled:i,"rec-radio-inline":f}),children:[s.jsx("input",{type:"radio",id:m,value:r,disabled:i,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&&a&&a!==""?s.jsxs(s.Fragment,{children:[s.jsx(ce,{fontWeight:"semibold",tag:"span",children:e}),s.jsx(ce,{className:"rec-radio-legend",children:a})]}):e]})}function Xf({children:t,value:e,name:a,isRequired:r=!1,isDisabled:i=!1,onChange:o,isInline:l,className:c}){return s.jsx("div",{className:R(c,{"sarsa-radio-group-inline":l}),children:p.Children.map(t,d=>{if(!p.isValidElement(d))return d;const u={value:d.props.value,isChecked:o?e===d.props.value:void 0,name:a,isRequired:r,isDisabled:i||d.props.isDisabled,onChange:o};return p.cloneElement(d,u)})})}function So({children:t,label:e,id:a,isLabelVisible:r=!1,isRequired:i,isInvalid:o,errorText:l,className:c,...d}){const u=ct(a);let f=i?`${e} (Required)`:e;return o&&(f+=" (Invalid)"),s.jsxs("div",{"data-component":"Fieldset",className:R("sarsa-fieldset",c),role:"group","aria-label":f,"aria-describedby":l?`${u}-error`:void 0,...d,children:[r&&s.jsx(Hs,{isRequired:i,children:e}),s.jsx("div",{id:u,tabIndex:-1,className:R("sarsa-fieldset-children",{"is-invalid":o,"has-top-margin":r||l}),children:t}),s.jsx("div",{"aria-live":"assertive",children:l&&s.jsxs("div",{id:`${u}-error`,className:"sarsa-field-error-message",children:[s.jsx("span",{className:"req","aria-hidden":"true",children:"*"}),l]})})]})}So.propTypes={children:n.node.isRequired,label:n.string.isRequired,id:n.string,isLabelVisible:n.bool,isRequired:n.bool,isInvalid:n.bool,errorText:n.string,className:n.string};const Qf=p.memo(So);class Ov extends p.PureComponent{constructor(e){super(e),this.validate=()=>{const{value:a,validator:r,isRequired:i,id:o,name:l,label:c}=this.props,d=document.getElementsByName(l);let u=a;const f=[];for(let h=0;h{if(!p.isValidElement(b))return b;const x={name:r,isRequired:i,isDisabled:o||b.props.isDisabled,onChange:l,checked:l?a===b.props.value:void 0};return p.cloneElement(b,x)})})})}}n.string,n.node,n.string,n.string,n.bool,n.bool,n.bool,n.bool,n.func,n.func,n.any,n.string,n.string;n.string,n.bool,n.string,n.arrayOf(n.shape({value:n.string,label:n.node,isDisabled:n.bool,tooltip:n.node,ariaLabel:n.string})),n.string,n.func,n.func,n.string,n.bool,n.bool,n.node,n.bool,n.bool,n.string;n.string,n.string,n.arrayOf(n.shape({value:n.string,label:n.string})).isRequired,n.string.isRequired,n.func.isRequired,n.bool,n.bool,n.bool,n.func,n.string,n.string,n.string,n.string;n.node.isRequired;n.string,n.number,n.oneOf(["display","h1","h2","h3","h4","h5","h5Caps","h6"]),n.node,n.array,n.oneOfType([n.number,n.oneOf(["none"])]),n.oneOf(["ol","ul","none"]),n.number,n.string,n.string;const ur="sarsa-help-tip",$v=p.forwardRef((t,e)=>{const{tipForDescriptor:a,content:r,maxWidth:i,appearance:o="help",customIcon:l,triggerRef:c}=t,[d,u]=p.useState(!1),f=p.useRef(null),g=c||f;p.useEffect(()=>{const w=v=>{v.key==="Escape"&&u(!1)};return window.addEventListener("keydown",w),()=>{window.removeEventListener("keydown",w)}});const h=()=>{u(!1)},m=()=>{u(!0)};p.useImperativeHandle(e,()=>({showHelpTip:m,hideHelpTip:h,toggleHelpTip:()=>{u(w=>!w)}}));const b=()=>{d?(h(),ue(`Help tip for ${a}`)):(m(),ue(r))};let x;return l!==void 0?x=l:x=o==="info"?s.jsx(A,{iconName:"info"}):s.jsx(A,{iconName:"help"}),s.jsxs(s.Fragment,{children:[s.jsx(M,{innerRef:g,size:"sm",appearance:"subtle",className:"sarsa-help-tip",iconBeforeElement:x,"aria-expanded":d,"aria-label":"Help Tip","aria-describedby":d?ur:void 0,onMouseEnter:m,onMouseLeave:h,onFocus:m,onBlur:h,onClick:b}),s.jsx(Ji,{id:ur,content:r,maxWidth:i,isVisible:d,triggerRef:g})]})}),hr=350;function bn({id:t,children:e,isExpanded:a,hasIndentedBody:r=!0,className:i}){const o=p.useRef(null),l=p.useRef(null),c=p.useRef();return p.useEffect(()=>{o.current&&l.current&&(o.current.style.maxHeight=a?"none":"0",l.current.style.display=a?"block":"none")},[a]),p.useEffect(()=>{if(a){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")},hr)}if(!a){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")},hr)}return()=>{clearTimeout(c.current)}},[a]),s.jsx("div",{ref:o,id:t,className:R("sarsa-accordion-content-outer",i),children:s.jsx("div",{"data-component":"AccordionContent",ref:l,role:"region","aria-labelledby":`${t}-heading`,style:{boxSizing:"border-box"},className:R("sarsa-accordion-content-inner",{"has-indented-body":r}),children:e})})}bn.propTypes={id:n.string,children:n.node,isExpanded:n.bool,hasIndentedBody:n.bool,className:n.string};function Zs({children:t,handleHeadingClick:e,headingAppearance:a="h6",headingLevel:r=3,id:i,isExpanded:o=!1,className:l,gaTrackingId:c}){return s.jsx("div",{className:R("sarsa-accordion-heading",l),"data-component":"AccordionHeading",children:s.jsx(re,{headingLevel:r,appearance:a,children:s.jsxs(M,{isUnstyled:!0,id:`${i}-heading`,className:R("sarsa-accordion-heading-button",{expanded:o}),"aria-controls":i,"aria-expanded":o,onClick:e,gaTrackingId:c,...c&&{gaTrackingValue:`${t} - ${o?"Hidden":"Expanded"}`},children:[s.jsx("span",{className:`sarsa-accordion-heading-icon size-${a}`,children:o?s.jsx(A,{iconName:"chevron-down",size:"md"}):s.jsx(A,{iconName:"chevron-right",size:"md"})}),s.jsx("span",{children:t})]})})})}Zs.displayName="AccordionHeading";Zs.propTypes={children:n.node.isRequired,handleHeadingClick:n.func,headingAppearance:n.oneOf(["h4","h5","h5Caps","h6"]),headingLevel:n.oneOf([1,2,3,4,5,6]),id:n.string,isExpanded:n.bool,className:n.string,gaTrackingId:n.string};function vn({children:t,handleHeadingClick:e,hasIndentedBody:a=!0,headingAppearance:r="h6",headingLevel:i=3,id:o,isControlled:l=!1,isExpanded:c=!1,gaTrackingId:d,gaTrackingValue:u}){const[f,g]=p.useState(c||!1),h=b=>{b.preventDefault(),l&&e?e():g(x=>!x)},m=()=>p.Children.map(t,b=>{if(!p.isValidElement(b))return b;const x={handleHeadingClick:h,headingAppearance:r,headingLevel:i,id:o,isExpanded:l?c:f,...d&&!b.props.gaTrackingId&&{gaTrackingId:d},...u&&!b.props.gaTrackingValue&&{gaTrackingValue:u}},w={id:o,hasIndentedBody:a,isExpanded:l?c:f};return p.cloneElement(b,b.type.displayName==="AccordionHeading"?x:w)});return s.jsx("div",{className:"sarsa-accordion-item","data-component":"AccordionItem",children:m()})}vn.propTypes={children:n.node.isRequired,handleHeadingClick:n.func,hasIndentedBody:n.bool,headingAppearance:n.oneOf(["h4","h5","h5Caps","h6"]),headingLevel:n.oneOf([1,2,3,4,5,6]),id:n.string,isControlled:n.bool,isExpanded:n.bool,gaTrackingId:n.string,gaTrackingValue:n.string};function No({id:t="accordion",children:e,items:a,defaultActiveIndex:r,shouldAllowMultipleOpen:i=!1,hasIndentedBody:o=!0,headingLevel:l=3,headingAppearance:c="h6",activeIndex:d,onChange:u,className:f,gaTrackingId:g}){const[h,m]=p.useState(r),b=d!==void 0,x=C=>{u&&b?u(C):m(C===h?void 0:C)},w=()=>p.Children.map(e,(C,y)=>C&&p.isValidElement(C)?p.cloneElement(C,{handleHeadingClick:()=>{x(y)},hasIndentedBody:o,headingAppearance:c,headingLevel:l,id:`${t}-item-${y}`,isControlled:!i,isExpanded:b?y===d:y===h}):null),v=()=>a?a.map((C,y)=>s.jsxs(vn,{handleHeadingClick:()=>x(y),hasIndentedBody:o,headingAppearance:c,headingLevel:l,id:`${t}-item-${y}`,isControlled:!i,isExpanded:b?y===d:y===h,gaTrackingId:g,children:[s.jsx(Zs,{children:C.heading}),s.jsx(bn,{children:C.content})]},C.heading)):null;return s.jsx("div",{"data-component":"Accordion",className:f,id:t,children:a&&a.length>0?v():w()})}No.propTypes={id:n.string,children:n.node,items:n.arrayOf(n.shape({heading:n.node,content:n.node})),defaultActiveIndex:n.number,shouldAllowMultipleOpen:n.bool,hasIndentedBody:n.bool,headingLevel:n.oneOf([1,2,3,4,5,6]),headingAppearance:n.oneOf(["h4","h5","h5Caps","h6"]),activeIndex:n.number,onChange:n.func,className:n.string,gaTrackingId:n.string};function eg(t,e){const a={...t};return e.forEach(r=>{delete a[r]}),a}class Dv extends p.PureComponent{constructor(e){super(e),this.clearError=()=>{this.setState({isInvalid:!1,errorText:void 0})},this.handleNewErrorState=({isInvalid:r,errorText:i})=>{const{handleNewErrorState:o,id:l,name:c}=this.props;o&&(r!==this.errorState.isInvalid||i!==this.errorState.errorText)&&(o({id:l,name:c,isInvalid:r,errorText:i}),this.errorState={isInvalid:r,errorText:i})},this.handleChange=r=>{r.persist();const i=r.target.value,{onChange:o}=this.props,{isPristine:l}=this.state;this.isControlled()?i&&l&&this.setState({isPristine:!1}):this.setState({value:i},()=>{i&&l&&this.setState({isPristine:!1})}),o&&o(r)},this.handleBlur=r=>{const{isRequired:i,onBlur:o}=this.props,{isPristine:l}=this.state;if(i&&!l){const c=this.validate();o&&o(r),c.isInvalid&&c.errorText&&ue(c.errorText,"assertive")}else o&&o(r)},this.validate=()=>{const{isRequired:r,id:i,validator:o,label:l}=this.props,c=this.isControlled()?this.props.value:this.state.value,d={isInvalid:!1,errorText:null,id:i};if(!c)if(r){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:r,onChange:i}=this.props;return typeof r=="string"&&typeof i=="function"};const a=typeof e.errorText=="string"&&e.errorText.length>0;this.state={value:e.value||e.defaultValue,isPristine:!(e.value||e.defaultValue),isInvalid:e.isInvalid||a||!1,errorText:e.errorText||void 0},this.errorState={isInvalid:e.isInvalid,errorText:e.errorText},this.inputWrapperRef=p.createRef()}static{this.propTypes={id:n.string.isRequired,name:n.string,label:n.node.isRequired,isLabelVisible:n.bool,placeholder:n.string,value:n.string,defaultValue:n.string,onChange:n.func,onBlur:n.func,validator:n.func,isDisabled:n.bool,isRequired:n.bool,isInvalid:n.bool,errorText:n.node,innerRef:n.oneOfType([n.func,n.object,n.node]),shouldFocusOnMount:n.bool,shouldValidateOnUpdate:n.bool,className:n.string,handleNewErrorState:n.func,gaTrackingId:n.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 a=this.inputWrapperRef.current.querySelector("textarea");a&&a.focus()}},0)}componentDidUpdate(e){const{shouldValidateOnUpdate:a,isInvalid:r,errorText:i}=this.props;if(a)this.validate();else if(r!==e.isInvalid||i!==e.errorText){const o=typeof i=="string"&&i.length>0;this.setState({isInvalid:r||o,errorText:i})}}componentWillUnmount(){clearTimeout(this.timeout)}render(){const{id:e,label:a,isDisabled:r,value:i,isLabelVisible:o,placeholder:l,isRequired:c,innerRef:d,className:u,gaTrackingId:f,...g}=this.props,h=eg(g,["isInvalid","errorText","onBlur","onChange","validator","shouldFocusOnMount","shouldValidateOnUpdate","handleNewErrorState"]),{isInvalid:m,errorText:b}=this.state;return s.jsxs("div",{"data-component":"TextArea",className:R("sarsa-field-outer-container",u),children:[s.jsx(ut,{htmlFor:e,isVisible:o,isRequired:c,children:a}),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:R("sarsa-text-field-input",{"is-invalid":m}),onChange:this.handleChange,onBlur:this.handleBlur,id:e,ref:d,disabled:r,value:i,placeholder:l,required:c,"aria-invalid":m,"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 tg({id:t="page-content",children:e,...a}){return s.jsx("div",{"data-component":"SkipNavContent",...a,id:t,children:e})}tg.propTypes={id:n.string,children:n.node.isRequired};function sg({id:t="page-content",children:e="Skip to main content",...a}){return s.jsx("a",{"data-component":"SkipNavLink",href:`#${t}`,className:"skip-navigation",...a,children:e})}sg.propTypes={id:n.string,children:n.node};/*! * 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 ag=/input|select|textarea|button|object/;function ng(t){const e=t.offsetWidth<=0&&t.offsetHeight<=0;if(e&&!t.innerHTML)return!0;const a=window.getComputedStyle(t);return e?a.getPropertyValue("overflow")!=="visible":a.getPropertyValue("display")==="none"}function rg(t){let e=t;for(;e&&e!==document.body;){if(ng(e))return!1;e=e.parentNode}return!0}function ig(t,e){const a=t.nodeName.toLowerCase();return(ag.test(a)&&!t.disabled||a==="a"&&t.href||e)&&rg(t)}function og(t){let e=t.getAttribute("tabindex");e===null&&(e=void 0);const a=Number.isNaN(Number(e));return(a||e>=0)&&ig(t,!a)}function lg(t){return[].slice.call(t.querySelectorAll("*"),0).filter(og)}function cg(t,e){const a=lg(t);if(!a.length){e.preventDefault();return}const r=e.shiftKey,i=a[0],o=a[a.length-1];let l;if(t===document.activeElement){if(!r)return;l=o}if(o===document.activeElement&&!r&&(l=i),i===document.activeElement&&r&&(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=a.indexOf(document.activeElement);if(u>-1&&(u+=r?-1:1),typeof a[u]>"u"){e.preventDefault(),l=r?o:i,l.focus();return}e.preventDefault(),a[u].focus()}const pr=250;function jo({logoElement:t,darkModeLogoElement:e,appearance:a="light",children:r,className:i,direction:o="left",hasOverlay:l=!0,isOpen:c=!1,isLabelVisible:d,label:u,onClose:f,onCloseComplete:g,shouldUnmountOnExit:h=!0,triggerId:m,hasRecLogo:b=!1,width:x="narrow"}){const w=p.useRef(null),v=p.useRef(null),C=p.useRef(document.getElementById("rec-app")||document.getElementById("recApp")),y=p.useRef(),N=p.useRef(c),T=a==="dark",j=p.useCallback(()=>{f&&(f(),y.current=setTimeout(()=>{const S=document.getElementById(m);S&&S.focus&&S.focus(),g&&g()},pr)),C.current?.removeAttribute("aria-hidden"),document.body.classList.remove("sarsa-drawer-open")},[f,g,m]);return p.useEffect(()=>{const S=k=>{k.key==="Escape"&&N.current&&(k.preventDefault(),j()),k.key==="Tab"&&l&&N.current&&cg(w.current,k)};return window.addEventListener("keydown",S),()=>{window.removeEventListener("keydown",S)}},[j,l]),p.useEffect(()=>{N.current=c,c&&(y.current=setTimeout(()=>{w.current?.focus(),l&&(C.current?.setAttribute("aria-hidden","true"),document.body.classList.add("sarsa-drawer-open"))},pr)),c||(C.current?.removeAttribute("aria-hidden"),document.body.classList.remove("sarsa-drawer-open"))},[c,l]),s.jsxs(At,{children:[l&&s.jsx(ma,{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:R("sarsa-drawer-overlay",{"is-hidden":!c}),onClick:j,role:"presentation"})}),s.jsx(ma,{in:c,timeout:{appear:0,enter:0,exit:200},classNames:"sarsa-drawer",mountOnEnter:!0,unmountOnExit:h,nodeRef:w,children:s.jsx("div",{"data-component":"Drawer",tabIndex:-1,"aria-label":u,role:"group",ref:w,className:R("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:R("sarsa-drawer-inner",i,{"sarsa-drawer-dark":T}),children:[s.jsxs("div",{"data-component":"DrawerTop",className:R("sarsa-drawer-top",{"has-heading":d}),children:[s.jsxs("div",{children:[d&&s.jsx(re,{"data-testid":"heading",headingLevel:1,appearance:"h5",children:u}),b&&s.jsx("div",{className:"sarsa-drawer-rec-logo",children:a==="dark"?e:t})]}),s.jsx(M,{"data-testid":"close-button",size:"md",appearance:T?"icon-white":"subtle",iconBeforeElement:s.jsx(A,{iconName:"close"}),screenReaderTextAfter:`Close ${u}`,onClick:j,className:"sarsa-drawer-close-btn"})]}),s.jsx("div",{"data-component":"DrawerContent",className:"sarsa-drawer-content",children:r})]})})})]})}jo.propTypes={logoElement:n.element,darkModeLogoElement:n.element,appearance:n.oneOf(["light","dark"]),children:n.node.isRequired,className:n.string,direction:n.oneOf(["left","right"]),hasOverlay:n.bool,isOpen:n.bool,isLabelVisible:n.bool,label:n.string.isRequired,onClose:n.func.isRequired,onCloseComplete:n.func,shouldUnmountOnExit:n.bool,triggerId:n.string.isRequired,hasRecLogo:n.bool,width:n.oneOf(["narrow","wide","full"])};const mr=n.shape({errorText:n.string,inputId:n.string});function To({errors:t,headingLevel:e=3,className:a,...r}){const i=p.useRef(null),o=p.useRef(t),{role:l}=r,c=()=>{vc(t)>0&&i.current&&i.current.focus()};p.useEffect(()=>{c()},[]),p.useEffect(()=>{Ha(t,o.current)||(o.current=t,c())},[t]);const d=()=>{let w=0;return t&&!Array.isArray(t)&&Object.keys(t).forEach(C=>{w+=t[C].length}),w},u=w=>v=>{const C=document.getElementById(w);C&&C.focus&&(v.preventDefault(),C.focus())},f=()=>{if(Array.isArray(t)){const w=t.length===1?"ul":"ol";return s.jsx(w,{children:t.map(v=>{const C=v?.inputId??v.id??"";return s.jsx("li",{children:s.jsx("a",{onClick:u(C),href:`#${C}`,title:"Jump to the field with this error",children:v.errorText??"Invalid input"})},C)})})}return null},g=()=>{if(t&&!Array.isArray(t)){const w=Object.keys(t),v={};return w.forEach((C,y)=>{v[y]=t[C].length}),w.map((C,y)=>{let N=1;if(y>0)for(let j=0;j{const S=j?.inputId??j.id??"";return s.jsx("li",{children:s.jsx("a",{onClick:u(S),href:`#${S}`,title:"Jump to the field with this error",children:j.errorText??"Invalid input"})},S)})})]},C)})}return null};if(!t)return null;const h=Array.isArray(t),m=h?t.length:d();if(!m)return null;const b=m===1?"To continue, correct the error below":`To continue, correct the ${m} errors below`,x=h?f():g();return s.jsx("div",{"data-component":"FormValidationAlert","data-testid":"FormValidationAlert",tabIndex:-1,ref:i,className:R("sarsa-form-validation-alert",a),...r,children:s.jsx(je,{type:"error",heading:b,headingLevel:e,children:s.jsx("div",{className:"inner-error-wrap",children:s.jsx(Lt,{children:x})})})})}To.propTypes={errors:n.oneOfType([n.arrayOf(mr),n.objectOf(n.arrayOf(mr))]),headingLevel:n.number,className:n.string,role:n.string};const dg={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 ug(t){return Je(dg,t,"")}function hg(t,e){let a="";return t.roles.forEach(r=>{(r.location.location_id===e||r.location.location_id==="1")&&(a=r.role_type)}),a}class pg extends ie.Component{static propTypes={rowData:n.object.isRequired,isInternal:n.bool.isRequired,location:n.string};constructor(e){super(e),this.state={iaLoading:Je(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}`,a=Ga();oe.get(e,{headers:{Authorization:a}}).then(r=>{const i=r.data.user;let o=hg(i,this.props.location);o!==""&&(o=`(${ug(o)})`),this.setState({iaLoading:!1,internalAccount:`${i.first_name} ${i.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 ts("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"numeric",timeZoneName:"short"}),r=_r(this.props.rowData.action_time).toDate(),i=e.format(r);return s.jsxs("tr",{children:[s.jsx("td",{children:i}),s.jsx("td",{children:this.props.rowData.order_id}),s.jsx("td",{children:this.props.rowData.reservation_number}),s.jsxs("td",{children:[s.jsx(Le,{isSpinning:this.state.iaLoading,size:"xs"}),this.state.internalAccount]}),s.jsx("td",{children:this.props.rowData.action})]})}}class Fv extends ie.Component{static propTypes={reservationID:n.string.isRequired,isInternal:n.bool.isRequired};constructor(e){super(e),this.state={history:[],isLoading:!0,error:!1,location:""}}componentDidMount(){let e=`/api/orders/reservations/${this.props.reservationID}`,a=Te();this.props.isInternal&&(e=`/api/orders/internal/reservations/${this.props.reservationID}`,a=Ga()),oe.get(e,{headers:{Authorization:a}}).then(r=>{this.setState({history:r.data.reservation_history,location:r.data.location_id,isLoading:!1})}).catch(()=>{this.setState({error:!0,isLoading:!1})})}getRows=()=>this.state.history.map((r,i)=>s.jsx(pg,{rowData:r,location:this.state.location,isInternal:this.props.isInternal},i));render(){return this.state.isLoading?s.jsx(Le,{isSpinning:this.state.isLoading,size:"lg"}):this.state.error?s.jsxs(Ta,{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(Ta,{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"})]})}}n.node.isRequired;n.node.isRequired,n.string;const mg=70,fg=48;class Vv extends ie.PureComponent{static propTypes={children:n.node.isRequired,scrollingContainerId:n.string.isRequired,navElement:n.node,extraClassName:n.string,shouldCompensateForScrollbars:n.bool,paddingRight:n.number,overrideTop:n.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 a=0;const r=document.querySelector(".nav-header-alerts");r&&(a=r.getBoundingClientRect().bottom);const i=this.stickyTableWrap.getBoundingClientRect(),o=a>e?a:e,l=i.topo;this.setState({isStuck:l,bottom:o})}else{const e=this.header?mg:0,a=this.stickyTableWrap.getBoundingClientRect(),r=a.top+fge;this.setState({isStuck:r,bottom:e})}};handleWrapperScroll=()=>{const e=this.horizontalScroller.scrollLeft;this.setState({scrollPosition:e})};render(){const{navElement:e,children:a,extraClassName:r,shouldCompensateForScrollbars:i,paddingRight:o,overrideTop:l}=this.props,{scrollPosition:c,isStuck:d,bottom:u}=this.state,f={top:l||u};return i&&(f.paddingRight=`${o+this.scrollbarWidth}px`),s.jsxs("div",{className:R("sticky-table-header-helper",{sticky:d,[r]:r}),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:a})})]})}}function gg(t,e){return class extends p.Component{constructor(){super(...arguments),this.state={error:void 0}}static getDerivedStateFromError(a){return{error:a}}componentDidCatch(a,r){}render(){return t(this.props,this.state.error)}}}function bg({isErrorForced:t,children:e}){return e}function Ro({fallbackElement:t,isErrorForced:e=!1,hasDefaultWrapperClass:a=!0,children:r},i){return i?t?s.jsx("div",{className:a?"rec-has-error-wrap":"",children:t}):null:s.jsx(bg,{isErrorForced:e,children:r})}Ro.propTypes={children:n.node.isRequired,fallbackElement:n.node,isErrorForced:n.bool,hasDefaultWrapperClass:n.bool};const Bv=gg(Ro);n.string,n.string,n.string,n.string.isRequired,n.string.isRequired,n.number,n.bool,n.string,n.string,n.number,n.string,n.number,n.string,n.number,n.bool,n.bool,n.oneOf(["available","partially available","not reservable","lottery","CAMPING_LOTTERY","unavailable","new","enter dates","enter date","view availability"]),n.number,n.number,n.number,n.string,n.bool,n.array,n.array,n.bool,n.node,n.bool,n.string,n.object,n.string,n.string,n.string,n.string,n.func,n.func;n.string.isRequired,n.string,n.string,n.string.isRequired,n.number,n.number,n.string,n.array,n.string,n.number,n.string,n.oneOf(["headingBottom","headingCenter","headingTop"]),n.string,n.func,n.bool,n.bool,n.string,n.node,n.string,n.string,n.string,n.string;n.array,n.array,n.number,n.number,n.bool,n.bool,n.bool,n.string;n.array,n.array,n.number,n.number,n.bool,n.bool,n.string;n.node.isRequired,n.bool,n.string;n.oneOfType([n.number]),n.number,n.oneOf(["default","important"]),n.oneOf(["sm","md","lg"]),n.bool,n.bool,n.string;n.string,n.string,n.string,n.string,n.string,n.bool,n.bool,n.bool,n.bool,n.string,n.string,n.string;const fr="rv-rental-background",gr="gear-rental-background";function vg({ariaLabel:t="Gear and RV rental options.",buttonCopy:e="",className:a,copy:r,href:i="/rentals",isGearPromo:o,isInternalLink:l=!0,isRvPromo:c,isTall:d=!1,showArrow:u=!0,gaReportName:f,gaReportCreative:g,gaReportPosition:h}){const m=p.useRef(null),{height:b,width:x}=cu(m),w=410,v=85;let C;o?C=gr:c&&(C=fr);const y=p.useRef([fr,gr][Math.floor(Math.random()*2)]),N=s.jsx("span",{className:"rec-rentals-promo-single-icon-wrap",children:s.jsx(A,{iconName:"arrow-forward"})}),T=()=>e.length>=1?s.jsxs("span",{className:"rec-rentals-promo-single-button-text",children:[" ",e,N]}):s.jsx("span",{className:"rec-rentals-promo-single-button-text",children:u&&N}),j=()=>o||c?s.jsx(Jt,{src:`/shared/img/global/rentals/${C}.jpg`,altText:"Example",style:{minHeight:`${b}px`}}):s.jsx(Jt,{src:`/shared/img/global/rentals/${y.current}.jpg`,altText:"Example",style:{minHeight:`${b}px`}});return s.jsx("div",{ref:m,className:R(a,"rec-rentals-promo-single-wrap"),children:l?s.jsxs(M,{href:i,"aria-label":t,target:"_blank",rel:"noopener noreferrer",isUnstyled:!0,gaReportName:f,gaReportCreative:g,gaReportPosition:h,shouldReportToGA:!0,children:[s.jsx("div",{className:R("rec-rentals-promo-single-inner-wrap",{"rec-rentals-promo-single-tall":d}),children:s.jsxs("p",{className:R({"rec-rentals-promo-single-reduced-font-size":r.length>=v,"rec-rentals-promo-single-set-max-text-width":x>=w}),children:[r,T()]})}),j()]}):s.jsxs(Xa,{url:i,"aria-label":t,children:[s.jsx("div",{className:R("rec-rentals-promo-single-inner-wrap",{"rec-rentals-promo-single-tall":d}),children:s.jsxs("p",{className:R({"rec-rentals-promo-single-reduced-font-size":r.length>=v,"rec-rentals-promo-single-set-max-text-width":x>=w}),children:[r,T()]})}),j()]})})}vg.propTypes={ariaLabel:n.string,buttonCopy:n.string,className:n.string,copy:n.string,href:n.string,isGearPromo:n.bool,isInternalLink:n.bool,isRvPromo:n.bool,isTall:n.bool,showArrow:n.bool,gaReportName:n.string,gaReportCreative:n.string,gaReportPosition:n.string};n.string,n.string,n.oneOf(["sm","md","lg"]),n.string,n.oneOf([1,2,3,4,5,6]),n.oneOf(["display","title","h1","h2","h3","h4","h5","h5Caps","h6","small"]),n.string,n.oneOf(["auto","variable",1,2,3,4,5,6,7,8,9,10,11,12]),n.bool,n.bool,n.bool,n.bool,n.string,n.string,n.oneOf(["","imageExtendsTopBottom","imageSetBottom"]),n.string,n.bool,n.arrayOf(n.shape({viewportMaxWidth:n.number,path:n.string})),n.string,n.string,n.node,n.string;n.string,n.string,n.string,n.string,n.string,n.bool;n.string,n.string,n.string,n.string,n.string,n.bool,n.string;n.string,n.string,n.string,n.string,n.string,n.bool,n.string;function xg(t,e){const{label:a,isDisabled:r,className:i,length:o=6,value:l,defaultValue:c,validChars:d="0-9",onChange:u,onComplete:f,autoFocus:g,id:h,isRequired:m=!0,isInvalid:b,errorMessage:x,...w}=t,v=p.useRef(null),C=ct(h),[y,N]=p.useState(String(l??c??"")),[T,j]=p.useState(!1),[S,k]=p.useState({isInvalid:b||!!x||!1,errorText:x??"",inputId:C,id:C,label:a}),_=56,I=8;p.useLayoutEffect(()=>{g&&v.current?.focus()},[g]),p.useEffect(()=>{r&&j(!1)},[r]);const P=()=>String(l??y),B=G=>{const J=G??P(),z=J.length!==o,se=RegExp(`[^${d}]`).test(J),L=m&&!J?`${a} is required`:z?`Code must be ${o} digits long`:se?"Code has invalid characters":void 0,H={id:C,inputId:C,isInvalid:z||se,errorText:L,label:a};return k(H),H},W=G=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(G.key)&&G.preventDefault()},D=G=>{const J=G.target.value.replace(/\s|-/g,"");RegExp(`^[${d}]{0,${o}}$`).test(J)&&(N(J),u?.(J),J.length===o&&f&&window.setTimeout(()=>{const z=B(J);f(J,z)},0))},E=G=>P().length{const J=P();return(J.length===G||J.length===G+1&&o===G+1)&&T};p.useImperativeHandle(e,()=>({validate:()=>B(),getValue:()=>P()}));const X=`${C}-error`,Z=b||S?.isInvalid||!!x;return s.jsxs("div",{"data-component":"VerificationCodeField","data-testid":"VerificationCodeField",className:i,style:{width:`${_*o+I*(o-1)}px`},children:[s.jsxs("div",{className:"input-wrap",children:[s.jsx("input",{ref:v,id:C,"aria-label":a,"aria-required":m,"aria-describedby":X,"aria-invalid":Z,spellCheck:!1,autoComplete:"off",className:"input",disabled:r,onKeyDown:W,value:P(),defaultValue:c,onChange:D,onSelect:G=>{const J=G.currentTarget.value;G.currentTarget.setSelectionRange(J.length,J.length)},onFocus:()=>{j(!0)},onBlur:()=>{j(!1)},type:"text",...w}),[...Array(o)].map((G,J)=>s.jsx("div",{role:"presentation",onClick:()=>{v.current?.focus()},style:{width:`${_}px`},className:R("char",{focus:V(J),inactive:E(J),disabled:r,invalid:Z}),children:P()[J]?P()[J]:null},J))]}),s.jsx(Ve,{id:X,children:x??S?.errorText})]})}const yg=p.forwardRef(xg);n.array.isRequired,n.bool,n.bool,n.bool,n.number,n.string,n.string;n.oneOf(["light","dark"]),n.oneOf(["large","medium","small","extra-small"]),n.string.isRequired,n.bool,n.bool,n.bool,n.bool,n.bool,n.bool,n.oneOf(["top","bottom"]),n.string,n.string,n.string,n.string,n.string,n.string,n.bool,n.func,n.bool,n.string,n.string,n.string,n.bool,n.bool,n.bool;function wg(){return Ce()&&window.recaptchaOptions||{}}function Cg(t){if(!Ce())return;if(window.grecaptcha?.enterprise){t&&t();return}window.recaptchaEnterpriseOnloadCallback=()=>{t&&t()};const e=()=>{const a=document.createElement("script"),i=wg().useRecaptchaNet?"recaptcha.net":"www.google.com";a.src=`https://${i}/recaptcha/enterprise.js?onload=recaptchaEnterpriseOnloadCallback&render=explicit`,a.id="grecaptcha.enterprise",document.body.appendChild(a),a.onerror=()=>{console.warn("Recaptcha script failed to load")}};document?.body?e():window.addEventListener("DOMContentLoaded",e,{once:!0})}class Js extends p.Component{static propTypes={action:n.string,sitekey:n.string.isRequired,onChange:n.func,theme:n.oneOf(["dark","light"]),type:n.oneOf(["image","audio"]),tabindex:n.number,onExpired:n.func,onErrored:n.func,size:n.oneOf(["compact","normal","invisible"]),stoken:n.string,hl:n.string,badge:n.oneOf(["bottomright","bottomleft","inline"]),isolated:n.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=p.createRef(),this.state={isPendingExplicitRender:!0}}componentDidMount(){Cg(()=>{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(a=>{a(),this.props.onChange(e)}):(this.executionResolve&&(this.executionResolve(e),delete this.executionReject,delete this.executionResolve),null)}getValue(){return Ce()&&window.grecaptcha&&this._widgetId!==void 0?window.grecaptcha.getResponse(this._widgetId):null}getWidgetId(){return Ce()&&window.grecaptcha&&this._widgetId!==void 0?this._widgetId:null}execute(){return Ce()&&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,a)=>{(window.grecaptcha===void 0||window.grecaptcha.enterprise===void 0)&&a(),this.props.action!==void 0?window.grecaptcha.enterprise.execute(this._widgetId,{action:this.props.action}).then(r=>{r?e(r):a()}).catch(r=>{console.error("props.action fail",r),a(r)}):window.grecaptcha.enterprise.execute(this._widgetId).then(r=>{r?e(r):a()}).catch(r=>{console.error("!props.action fail",r),a(r)})})}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:a,theme:r,type:i,tabindex:o,onExpired:l,onErrored:c,size:d,stoken:u,badge:f,hl:g,isolated:h,...m}=this.props;return s.jsx("div",{...m,ref:this.captchaRef})}}function Io(t){const[e,a]=p.useState(!1);return p.useEffect(()=>{if(!Ce())return;const i=(Ce()&&window.recaptchaOptions||{}).useRecaptchaNet?"recaptcha.net":"www.google.com",o=document.createElement("script");o.src=`https://${i}/recaptcha/enterprise.js?onload=onloadcallback&render=explicit`,o.setAttribute("async",""),o.addEventListener("load",()=>{a(!0)}),document.body.appendChild(o)},[]),e?s.jsx(Js,{...t}):null}const ha=n.shape({xs:n.number,sm:n.number,md:n.number,lg:n.number,xl:n.number}),Sg={width:n.oneOfType([n.number,ha]),push:n.oneOfType([n.number,ha]),shift:n.oneOfType([n.number,ha]),className:n.string,children:n.node},pa=["xs","sm","md","lg","xl"];function Aa({width:t=12,push:e=null,shift:a=null,className:r="",children:i,...o}){const[l,c]=p.useState("");return p.useEffect(()=>{c((()=>{const u=["rec-grid-col"];r!==""&&u.push(r);let f=!1;if(typeof t=="object"&&pa.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`):pa.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`))})),a!==null&&(typeof a=="number"?a>=1&&a<=12?u.push(`rec-grid-shift-xs-${a}-12`):a<=-1&&a>=-12&&u.push(`rec-grid-unshift-xs-${-1*a}-12`):pa.forEach(g=>{const h=a[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,a,r]),s.jsx("div",{className:l,...o,children:i})}Aa.propTypes=Sg;function Hv(){return s.jsx("hr",{className:"rec-divider"})}n.node,n.string;n.node,n.string;n.node,n.string;n.node,n.string;n.node,n.string;function Eo({className:t,children:e,...a}){const r=["rec-nested-wrap",t].filter(i=>!!i).join(" ");return s.jsx("div",{className:r,...a,children:e})}Eo.propTypes={className:n.string,children:n.node};class Uv{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 a=0;a{this._onClickMapLayerItem(this._mapLayers[a].layers,r.checked)});const i=document.createElement("label");i.htmlFor=`layer_checkbox_${a}`,i.innerText=this._mapLayers[a].name,this._supportContainer.appendChild(r),this._supportContainer.appendChild(i)}this._container.appendChild(this._supportContainer)}return this._container}_onClickMapView(){ue("Map button selected. Showing map view on the map widget"),this._map.setLayoutProperty("fixed-satellite","visibility","none")}_onClickSatelliteView(){ue("Satellite button selected. Showing satellite view on the map widget"),this._map.setLayoutProperty("fixed-satellite","visibility","visible")}_onClickMapLayer(){ue("Layers button selected. Showing layers list"),this._supportContainer.classList.toggle("not-shown")}_onClickMapLayerItem(e,a){let r="visible";a?r="visible":r="none",e.forEach(i=>{this._map.setLayoutProperty(i,"visibility",r)})}onRemove(){this._container.parentNode.removeChild(this._container),this._map=void 0}}class ko{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 qv extends ko{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 a=this._map.getContainer(),r=a.parentElement,i=a?.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),o=i.length;if(o){const l=i[0],c=i[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()))};r.addEventListener("keydown",d),r.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(),a=e.parentElement,r=document.getElementById("recApp");this.isExpanded?(e.classList.remove("map-modal"),a.classList.remove("map-modal-background"),ue("Full screen toggle selected. You have closed full screen map view.")):(e.classList.add("map-modal"),a.classList.add("map-modal-background"),ue("Full screen toggle selected. You are in a full screen map view.")),r&&this._options.useModalStyling&&(this.isExpanded?(r.style.height="",r.style.minHeight="",r.style.maxHeight="",r.style.overflow="",r.classList.remove("mapbox-map-open")):(r.style.height="100vh",r.style.minHeight="100vh",r.style.maxHeight="100vh",r.style.overflow="hidden",r.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 Gv{constructor(e=!1,a){this.is3D=e,this._onClick3DView=this._onClick3DView.bind(this),this._exageration=a}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?(ue("2D button selected. Showing 2D map."),this._3DViewButton.innerHTML="3D",this._map.setPitch(0),this._map.setBearing(0),this._map.setTerrain()):(ue("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 zv{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}}n.node.isRequired,n.object.isRequired,n.object.isRequired;n.objectOf(n.shape({instruction:n.string.isRequired,icon:n.node}));n.node.isRequired,n.objectOf(n.shape({handler:n.func.isRequired,instruction:n.string.isRequired,icon:n.node})),n.bool.isRequired;class Wv extends ko{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,a){const r=document.createElement("div");return r.className="new-control-sub-container",a&&r.setAttribute("id",a),$o.createRoot(r).render(e),r}addElement(e,a){this._container&&this._container.appendChild(this.createElement(e,a))}updateElementById(e,a){const r=document.getElementById(a),i=this.createElement(e,a);r&&this._container.replaceChild(i,r)}removeElementById(e){const a=document.getElementById(e);a&&this._container.removeChild(a)}getElementById(e){return document.getElementById(e)}updateElementProps({element:e,key:a,value:r}){e[a]=r}}function Be({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]})})}Be.propTypes={controlName:n.string.isRequired,message:n.node.isRequired};class Kv extends ie.Component{static defaultProps={children:null,displayInSummary:!1,isCritical:!1};static propTypes={controlLabel:n.string.isRequired,value:n.oneOfType([n.string,n.number,n.bool]).isRequired,compareTo:n.oneOfType([n.string,n.number,n.bool]).isRequired,displayInSummary:n.bool,isCritical:n.bool,children:n.element,onValidated:n.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(Be,{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,a=this.getDefaultMessage(),r=this.props.isCritical;return this.setState({isInvalid:e}),this.props.onValidated&&this.props.onValidated(e,a),{isInvalid:e,message:a,isCritical:r}}render(){return this.props.displayInSummary||!this.state.isInvalid?null:this.getDefaultMessage()}}class Yv extends ie.Component{static defaultProps={children:null,displayInSummary:!1,isCritical:!1};static propTypes={controlLabel:n.string.isRequired,value:n.oneOfType([n.string,n.number,n.bool,n.array,n.objectOf(n.oneOfType([n.string,n.number,n.bool,n.array]))]).isRequired,customValidator:n.func.isRequired,displayInSummary:n.bool,isCritical:n.bool,children:n.element,onValidated:n.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(Be,{controlName:this.props.controlLabel,message:"The provided entry is invalid."});return this.props.children||e}validate(){const e=this.props.customValidator(this.props.value),a=this.getDefaultMessage(),r=this.props.isCritical;return this.setState({isInvalid:e}),this.props.onValidated&&this.props.onValidated(e,a),{isInvalid:e,message:a,isCritical:r}}render(){return this.props.displayInSummary||!this.state.isInvalid?null:this.getDefaultMessage()}}class Zv extends ie.Component{static defaultProps={children:null,displayInSummary:!1,isCritical:!1};static propTypes={controlLabel:n.string.isRequired,value:n.oneOfType([n.string]).isRequired,displayInSummary:n.bool,isCritical:n.bool,children:n.element,onValidated:n.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(Be,{controlName:this.props.controlLabel,message:" does not have the right Email format."});return this.props.children||e}validate(){const e=!Ne(this.props.value)&&!Fa(this.props.value),a=this.getDefaultMessage(),r=this.props.isCritical;return this.setState({isInvalid:e}),this.props.onValidated&&this.props.onValidated(e,a),{isInvalid:e,message:a,isCritical:r}}render(){return this.props.displayInSummary||!this.state.isInvalid?null:this.getDefaultMessage()}}class Jv extends ie.Component{static defaultProps={children:null,displayInSummary:!1,isCritical:!1,isBefore:"",isAfter:""};static propTypes={controlLabel:n.string.isRequired,value:n.oneOfType([n.string,n.number,n.bool]).isRequired,displayInSummary:n.bool,isCritical:n.bool,isBefore:n.string,isAfter:n.string,children:n.element,onValidated:n.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(Be,{controlName:this.props.controlLabel,message:" is not in specified date range."});return this.props.children||e}validate(){let e=!1,a=!1;Ne(this.props.value)||(e=!Ne(this.props.isBefore)&&!ic(this.props.value,this.props.isBefore),a=!Ne(this.props.isAfter)&&!oc(this.props.value,this.props.isAfter));const r=e||a,i=this.getDefaultMessage(),o=this.props.isCritical;return this.setState({isInvalid:r}),this.props.onValidated&&this.props.onValidated(r,i),{isInvalid:r,message:i,isCritical:o}}render(){return this.props.displayInSummary||!this.state.isInvalid?null:this.getDefaultMessage()}}class Xv extends ie.Component{static defaultProps={children:null,displayInSummary:!1,isCritical:!1};static propTypes={controlLabel:n.string.isRequired,value:n.oneOfType([n.number,n.string]).isRequired,displayInSummary:n.bool,isCritical:n.bool,children:n.element,onValidated:n.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(Be,{controlName:this.props.controlLabel,message:" is not a valid Latitude."});return this.props.children||e}validate(){const e=!Ne(this.props.value)&&!Mr(`${this.props.value}, 0`),a=this.getDefaultMessage(),r=this.props.isCritical;return this.setState({isInvalid:e}),this.props.onValidated&&this.props.onValidated(e,a),{isInvalid:e,message:a,isCritical:r}}render(){return this.props.displayInSummary||!this.state.isInvalid?null:this.getDefaultMessage()}}class Qv extends ie.Component{static propTypes={controlLabel:n.string.isRequired,value:n.oneOfType([n.number,n.string]).isRequired,displayInSummary:n.bool,isCritical:n.bool,children:n.element,onValidated:n.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(Be,{controlName:this.props.controlLabel,message:" is not a valid Longitude."});return this.props.children||e}validate(){const e=!Ne(this.props.value)&&!Mr(`0, ${this.props.value}`),a=this.getDefaultMessage(),r=this.props.isCritical;return this.setState({isInvalid:e}),this.props.onValidated&&this.props.onValidated(e,a),{isInvalid:e,message:a,isCritical:r}}render(){return this.props.displayInSummary||!this.state.isInvalid?null:this.getDefaultMessage()}}class ex extends ie.Component{static propTypes={controlLabel:n.string.isRequired,value:n.oneOfType([n.string,n.number]).isRequired,displayInSummary:n.bool,isCritical:n.bool,children:n.element,onValidated:n.func,allowInternational:n.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(Be,{controlName:this.props.controlLabel,message:" does not have the right US phone number format."});return this.props.children||e}validate(){const e=!Ne(this.props.value)&&(!this.props.allowInternational&&!lc(this.props.value,"en-US")||this.props.allowInternational&&!xo(this.props.value).isValid),a=this.getDefaultMessage(),r=this.props.isCritical;return this.setState({isInvalid:e}),this.props.onValidated&&this.props.onValidated(e,a),{isInvalid:e,message:a,isCritical:r}}render(){return this.props.displayInSummary||!this.state.isInvalid?null:this.getDefaultMessage()}}class tx extends ie.Component{static propTypes={controlLabel:n.string.isRequired,value:n.oneOfType([n.string,n.number,n.bool]).isRequired,displayInSummary:n.bool,isCritical:n.bool,min:n.oneOfType([n.string,n.number,n.bool]),max:n.oneOfType([n.string,n.number,n.bool]),children:n.element,onValidated:n.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(Be,{controlName:this.props.controlLabel,message:" is not in specified range."});return this.props.children||e}validate(){const e=!Ne(this.props.value)&&!cc(this.props.value,{min:this.props.min,max:this.props.max})&&!dc(this.props.value,{min:jn(Tn(this.props.min)),max:jn(Tn(this.props.max))}),a=this.getDefaultMessage(),r=this.props.isCritical;return this.setState({isInvalid:e}),this.props.onValidated&&this.props.onValidated(e,a),{isInvalid:e,message:a,isCritical:r}}render(){return this.props.displayInSummary||!this.state.isInvalid?null:this.getDefaultMessage()}}class sx extends ie.Component{static propTypes={controlLabel:n.string.isRequired,value:n.oneOfType([n.string,n.number,n.bool]).isRequired,regex:n.objectOf(n.any).isRequired,displayInSummary:n.bool,isCritical:n.bool,children:n.element,onValidated:n.func,skipOnMountValidation:n.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(Be,{controlName:this.props.controlLabel,message:" does not have the right format."});return this.props.children||e}validate(){const e=!Ne(this.props.value)&&!ga(this.props.value,this.props.regex),a=this.getDefaultMessage(),r=this.props.isCritical;return this.setState({isInvalid:e}),this.props.onValidated&&this.props.onValidated(e,a),{isInvalid:e,message:a,isCritical:r}}render(){return this.props.displayInSummary||!this.state.isInvalid?null:this.getDefaultMessage()}}class ax extends ie.Component{static propTypes={controlLabel:n.string.isRequired,value:n.oneOfType([n.string,n.number,n.bool]).isRequired,displayInSummary:n.bool,isCritical:n.bool,children:n.element,onValidated:n.func,dataIndices:n.array,skipOnMountValidation:n.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||!Ha(e.dataIndices,this.props.dataIndices))&&this.validate()}componentWillUnmount(){this.props.onValidated&&this.props.onValidated(!1,null)}getDefaultMessage(){const e=s.jsx(Be,{controlName:this.props.controlLabel,message:" is required."});return this.props.children||e}validate(){const e=Ne(this.props.value),a=this.getDefaultMessage(),r=this.props.isCritical;return this.setState({isInvalid:e}),this.props.onValidated&&this.props.onValidated(e,a),{isInvalid:e,message:a,isCritical:r}}render(){return this.props.displayInSummary||!this.state.isInvalid?null:this.getDefaultMessage()}}const Ng={type:"info",title:"",subtitle:"",caption:"",expirationTimeout:1e4};class nx extends p.Component{static{this.defaultProps=Ng}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:R(`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(A,{iconName:"close"})})]})}}function rx(){return null}function jg(t){return new Promise(e=>{setTimeout(e,2**t*1e3)})}async function _o(t=0){if(t>4)return Promise.resolve(null);const e=document.querySelector("df-messenger");return e||(await jg(t),_o(t+1))}function ix({id:t="widgetIcon"}){const[e,a]=p.useState(null);p.useEffect(()=>{_o().then(i=>{a(i)})},[]);const r=()=>{if(e&&e){const i=e.shadowRoot;if(i&&i.children.length){const l=i.children[1].querySelector(`#${t}`);l&&l.focus()}}};return e?s.jsx("a",{"data-component":"SkipNavChat",href:`#${t}`,className:"skip-navigation",onClick:r,children:"Skip to help chatbot"}):null}const Ao=/^\/(sitepass|cart|account\/session|timed-entry|ticket|activitypass)/,Tg=n.shape({access_token:n.string,expiration:n.string,account:n.shape({account_id:n.string,cell_phone:n.string,email:n.string,emergency_content:n.shape({first_name:n.string,last_name:n.string}),favorites:n.array,first_name:n.string,home_address:n.shape({address1:n.string,address2:n.string,city:n.string,country:n.string,state:n.string}),home_phone:n.string,is_commercial_account:n.bool,last_name:n.string,legacy_account:n.bool,newsletter_alerts:n.bool,passes:n.array,phone_alerts:n.bool,profile_picture_id:n.string,sms_alerts:n.bool,trip_preferences:n.array})}),Rg=n.shape({notice_body:n.string,notice_enabled:n.bool,notice_title:n.string}),Ig="Email was successfully sent",Eg="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",br="An error occurred. Try again later.",kg="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.",_g="Confirmation code cannot be empty",Ag="We do not recognize the code you have entered. Please double check the code and enter it again.",Lg="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.",Lo="mobile-menu-toggle-btn";function Pg(t){const[e,a]=p.useState(!1);return p.useEffect(()=>{const r=new IntersectionObserver(([i])=>{a(i.intersectionRatio<1)},{threshold:[1]});return t&&r.observe(t),()=>{r.disconnect()}},[t]),e}function xn(){const[t,e]=p.useState(()=>Mg()),a=pe(r=>r.auth?.account?.account?.profile_picture_id);return p.useEffect(()=>{if(as()||!a){e(void 0),vr();return}oe.get(`/api/media/external/${a}`,{headers:{Authorization:Te()}}).then(({data:r})=>{e(r.url),Og(r.url)}).catch(()=>{vr(),e(void 0)})},[a]),t}function yn(){const t=pe(i=>i.auth?.account?.account);if(as())return"Guest";let e=t?.first_name;const a=t?.last_name?.toUpperCase();if(!e)return;e=e.charAt(0).toUpperCase()+e.slice(1);const r=a?.[0]?`${a[0]}.`:"";return`${e.trim()} ${r}`.trim()}function Mg(){try{return window.sessionStorage.getItem("avatarUrl")||void 0}catch{return}}function Og(t){try{window.sessionStorage.setItem("avatarUrl",t)}catch{}}function vr(){try{window.sessionStorage.removeItem("avatarUrl")}catch{}}function $g({isCommercialAccount:t,isGuest:e=!1,menuAccountItems:a,hideBottomSignOut:r=!1,isLogged:i=!1,isGuestAllowed:o}){const l=Ie(),c=xn(),d=yn(),u=()=>l(Vi()),f=()=>l(o?an():zs()),g=()=>window.location.href,h=()=>a.map((m,b)=>m.shouldHide||!i&&m.title==="Availability Alerts"?null:s.jsx("li",{className:m.parentClasses,children:s.jsxs(M,{isUnstyled:!0,clickTagCategory:m.clickTagCategory,clickTagAction:m.clickTagAction,clickTagLabel:g(),className:"rec-select-option-button",title:m.title,"aria-label":m.ariaLabel,href:m.href,children:[m.text,m.badge>0&&s.jsx("span",{className:"rec-select-option-badge-wrapper",children:s.jsx(cn,{appearance:"info",max:10,children:m.badge})})]})},b));return s.jsxs("div",{className:R("nav-mobile-menu-account-panel",{"is-guest":e}),children:[i?s.jsxs("div",{children:[s.jsxs("div",{className:"nav-mobile-user-profile-head",children:[s.jsx(M,{isUnstyled:!0,href:"/account/profile",className:"username-button",children:s.jsxs("div",{className:"nav-profile-info",children:[s.jsx(Ws,{src:c,alt:d,size:"md",className:"data-hj-suppress dark-avatar"}),s.jsx("span",{className:"ml-1 data-hj-suppress",children:d})]})}),s.jsx(M,{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(rs,{})})]}):s.jsx("div",{className:"sign-in-button mb-1",children:s.jsx(M,{shouldFitContainer:!0,appearance:"tertiary-white",type:"button",onClick:f,children:"Sign Up / Log In"})}),s.jsxs("ul",{children:[!e&&h(),t?s.jsx("li",{className:"rec-select-option",children:s.jsx(M,{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 Dg({menuAccountItems:t,isGuestAllowed:e,isGuest:a}){const r=pe(i=>i.auth.account?.account);return s.jsx($g,{isCommercialAccount:r?r.is_commercial_account:!1,hideBottomSignOut:!0,menuAccountItems:t,isGuest:a,isLogged:!!r,isGuestAllowed:e})}var Fg={searchAcrossUS:!1};const Vg="headerTextQuery";function Bg({isOpen:t,onClose:e,shouldDisplaySearchBar:a=!0,menuAccountItems:r,menuSections:i,logoElement:o,darkModeLogoElement:l,isGuestAllowed:c,isGuest:d}){const u=Fg?.searchAcrossUS,f=null,g=Ie(),h=()=>window.location.href,m=(x,w)=>{x.preventDefault();const{clickTagCategory:v,clickTagAction:C,inventoryTypes:y,uiFilters:N}=w,T={category:v,action:C,label:h()};ze(T,()=>{g(ya("",y,null,null,N,u,f,"available"))})},b=()=>i.map((x,w)=>s.jsxs("div",{className:"section-menu",children:[s.jsxs("div",{className:"section-menu-title-wrapper",children:[s.jsx(re,{appearance:"h5Caps",headingLevel:4,className:"section-menu-title",children:x.title}),s.jsx(rs,{})]}),x.links.map((v,C)=>{const{url:y,ariaLabel:N,title:T,target:j,clickTagCategory:S,clickTagAction:k,inventoryTypes:_}=v;return _?s.jsx(M,{isUnstyled:!0,className:"section-menu-link","aria-label":N,onClick:I=>m(I,v),children:T},C):s.jsx(M,{isUnstyled:!0,clickTagCategory:S,clickTagAction:k,clickTagLabel:h(),href:y,className:"section-menu-link","aria-label":N,target:j,rel:"noopener noreferrer",children:T},C)})]},w));return s.jsx(jo,{label:"Mobile menu",isLabelVisible:!1,isOpen:t,onClose:e,triggerId:Lo,direction:"right",appearance:"dark",hasRecLogo:!0,logoElement:o,darkModeLogoElement:l,children:s.jsxs("div",{className:"nav-mobile-menu-body",children:[a?s.jsx("div",{className:"form-item-wrap",children:s.jsx(Oi,{size:"lg",queryCriteriaPropertyName:Vg,id:"mobile-menu-search-input",popupClassName:"mobile-menu-search-popup"})}):null,s.jsx(Dg,{menuAccountItems:r,isGuestAllowed:c,isGuest:d}),b()]})})}function Hg(){const t=Ie(),e=pe(r=>r.modal.showCartLimitExceededModal),a=()=>{t(Ah())};return s.jsxs(dt,{heading:"Your Cart is Full",isOpen:e,onRequestClose:a,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(ot,{children:s.jsx(et,{children:s.jsx(M,{type:"button",onClick:a,children:"Close"})})})]})}const Ug={extendTimer:n.func.isRequired,fetchCart:n.func.isRequired,expiration:n.string,expiresIn:n.number,onFinalCartWarningModal:n.func.isRequired,sessionWarning:n.bool,domainsTrustedOrigins:n.array,isExtendingTime:n.bool},qg={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"]},La="CONTINUE_SHOPPING_EVENT",Gg={[La]:{type:La,description:"continue shopping event"}};class zg extends p.Component{constructor(e){super(e),this.handlePlanYourTrip=()=>{this.notifyEvent(La);let r="/";lt()&&(r=$s()??"/"),window.location.assign(r)},this.tick=()=>{if(!this.state.fetchingCart){if(this.timeRemainingRef.current=-1*xs(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&&xs(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=r=>r<=0?"00":r<10?`0${r}`:r.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||(ue("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=r=>{const i=r?Gg[r]:null;if(!window.parent||!i)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(i,c)},this.showExpiredModal=()=>{clearInterval(this.state.timer),this.setState({modalOpen:!0,expired:!0}),window.sessionStorage.removeItem("r1s_cart_ignored")},this.renderTime=()=>{const r=Rr({start:new Date,end:this.props.expiration}),i=this.formatTime(r.minutes||0),o=this.formatTime(r.seconds||0),l=s.jsx("span",{className:"rec-sr-only",children:rt(Number(i),"minute","minutes")}),c=s.jsx("span",{className:"rec-sr-only",children:rt(Number(o),"second","seconds")});return s.jsxs(s.Fragment,{children:[i,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(ot,{children:s.jsx(et,{isFullWidthOnMobile:!1,isStretchedToFit:!0,children:s.jsx(M,{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(ot,{children:s.jsxs(et,{isFullWidthOnMobile:!1,isStretchedToFit:!0,children:[s.jsx(M,{title:"Add Five Minutes","aria-label":"Add Five Minutes",onClick:this.extendTimer,gaTrackingId:"303011773358",children:"Add Five Minutes"}),s.jsx(M,{appearance:"tertiary",title:"Ignore","aria-label":"Ignore",onClick:this.closeModal,gaTrackingId:"920807948123",children:"Ignore"})]})})]});const a=window.sessionStorage.getItem("r1s_cart_ignored")==="true";this.state={timer:void 0,modalOpen:!1,expired:!1,fetchingCart:!1,lastFetchTime:void 0,ignored:a},this.timeRemainingRef={current:0}}static{this.propTypes=Ug}static{this.defaultProps=qg}componentDidMount(){this.isStillMounted=!0;const e=setInterval(()=>this.tick(),1e3);this.setState({timer:e}),this.timeRemainingRef.current=-1*xs(new Date,this.props.expiration)}componentWillUnmount(){this.isStillMounted=!1,clearInterval(this.state.timer)}render(){return s.jsx(dt,{isOpen:this.state.modalOpen,heading:this.state.expired?"Your cart has expired.":"Your cart is about to expire.",shouldShowCloseButton:!1,children:this.renderContent()})}}function Wg({expiration:t,showTimer:e=!1,reservationCount:a=0}){const r=a,i=r>0?`Cart - ${r} ${rt(r,"item","items")} in cart.`:"Cart";return s.jsxs("div",{className:"cart-indicator-group",children:[s.jsxs(M,{appearance:"link","aria-label":i,href:"/cart",className:"nav-link nav-interactions-link-cart",id:"ga-global-nav-account-cart-link",children:[s.jsx(A,{iconName:"cart",className:R({"has-badge":r>0})}),r>0&&s.jsx("span",{className:"cart-quantity",children:r})]}),e&&s.jsx("div",{className:"rec-small-timer",children:t&&s.jsx(pm,{date:new Date(t)})})]})}function Kg(){const[t,e]=p.useState(!1),a=Ie(),r=pe(o=>o.cart),i=pe(o=>!!o.auth?.account);return p.useEffect(()=>{i&&a(ja(!0))},[a,i]),i?s.jsxs(s.Fragment,{children:[s.jsx(Wg,{expiration:r?.expiration,showTimer:r?.showTimer,reservationCount:r?.reservation_count}),s.jsx(Hg,{}),r.showTimer||t?s.jsx(zg,{sessionWarning:r.showSessionWarning,expiration:r.expiration,expiresIn:r.expiresIn,isExtendingTime:r.isExtendingTime,extendTimer:()=>{a(_h())},fetchCart:o=>{a(ja(o))},onFinalCartWarningModal:()=>{e(!0)}}):null]}):null}function Yg({onClick:t}){const e=xn(),a=yn();return s.jsx("div",{children:s.jsxs(M,{appearance:"link",className:"nav-link pl-1 pr-1","aria-label":`User: ${a}`,onClick:t,children:[s.jsx(Ws,{src:e,alt:a,size:"sm",className:"data-hj-suppress mr-1"}),s.jsx("span",{className:"data-hj-suppress",children:a})]})})}function Zg({isGuestLoginAllowed:t}){const e=Ie();return s.jsx(M,{id:"ga-global-nav-log-in-link",appearance:"link",className:"nav-link pl-1 pr-1","aria-label":"Sign Up or Log In",onClick:()=>{e(t?an():zs())},children:"Sign Up / Log In"})}class Jg extends ie.PureComponent{static propTypes={results:n.array,select:n.func};render(){const e=this.props.results.map((a,r)=>{const i=r;return s.jsxs("tr",{children:[s.jsxs("td",{children:[a.first_name," ",a.last_name," ",a.is_commercial_account&&s.jsx("div",{className:"permit-text-less-emphasis",children:"(Commercial user)"})]}),s.jsx("td",{children:a.email}),s.jsx("td",{children:a.cell_phone}),s.jsx("td",{children:s.jsx(M,{onClick:()=>{this.props.select(a.account_id)},children:"Select"})})]},i)});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})]})})}}class Xg extends ie.PureComponent{static propTypes={search:n.func,error:n.string};constructor(e){super(e),this.state={searchType:"email",searchTerm:""}}handleSearchTypeChange=e=>{const a=e.target.value;this.setState({searchType:a})};handleSearchTermChange=e=>{const a=e.target.value;this.setState({searchTerm:a})};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(Co,{type:"error",children:this.props.error})})),s.jsxs("form",{onSubmit:this.search,children:[e,s.jsxs(he,{alignItems:"end",children:[s.jsx(te,{children:s.jsxs(Ks,{id:"search-type",label:"Search Type",value:this.state.searchType,onChange:this.handleSearchTypeChange,placeholder:"Choose an option",children:[s.jsx(Qe,{value:"email",children:"Email"}),s.jsx(Qe,{value:"phone",children:"Phone"})]})}),s.jsx(te,{xs:8,children:s.jsx(ge,{id:"search-term",label:"Search Term",value:this.state.searchTerm,onChange:this.handleSearchTermChange,hasClearButton:!0})}),s.jsx(te,{children:s.jsx(M,{type:"submit",children:"Search"})})]})]})}}class Qg extends ie.PureComponent{static propTypes={createAndSelect:n.func,error:n.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 a=e.target.name,r=e.target.value;this.setState({[a]:r})};handleCheckboxChange=e=>{const a=e.target.checked;this.setState({hasNoEmail:a,email:""})};handleAddressChange=e=>{const a=e.target.checked;a||this.setState({country:"USA",address1:"",address2:"",city:"",state:"",zip_code:""}),this.setState({addAddress:a})};create=e=>{e.preventDefault();const{addAddress:a,country:r,address1:i,address2:o,city:l,state:c,zip_code:d}=this.state;let u=!1;(Ne(r)||Ne(i)||Ne(l)||Ne(c)||Ne(d)||!Ne(l)&&!ga(l,/^[a-zA-Z\- ]+$|^$/)||!Ne(c)&&!ga(c,/^[a-zA-Z\- ]+$|^$/))&&(u=!0),a&&u||this.props.createAndSelect(this.state.firstName,this.state.lastName,this.state.cellPhone,this.state.email,this.state.hasNoEmail,{country:r,address1:i,address2:o,city:l,state:c,zip_code:d},a)};render(){let e=null;this.props.error&&(e=s.jsx("div",{className:"mb-2",children:s.jsx(Co,{type:"error",children:this.props.error})}));let a=s.jsx(ge,{id:"state",name:"state",label:"State/Province",value:this.state.state||"",isRequired:!0,placeholder:"Required",onChange:this.handleChange}),r=s.jsx(ge,{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"&&(a=s.jsx(Om,{id:"state",name:"state",label:"State",value:this.state.state,isRequired:!0,placeholder:"Required",onChange:this.handleChange}),r=s.jsx(Kf,{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(ge,{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(ge,{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(yo,{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(gn,{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(Mm,{id:"country",name:"country",isInvalid:Ne(this.state.country),isRequired:!0,value:this.state.country,onChange:this.handleChange})}),s.jsx("div",{className:"mb-2",children:s.jsx(ge,{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(ge,{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(ge,{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(Eo,{children:[s.jsx(Aa,{className:"acct-cell-auto",width:{xs:12,sm:6},children:a}),s.jsx(Aa,{className:"acct-cell-auto",width:{xs:12,sm:6},children:r})]})})]}),s.jsx("div",{className:"mb-2",children:s.jsx(Xt,{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(Xt,{id:"addAddress",label:"Add customer address.",name:"addAddress",value:"addAddress",isChecked:this.state.addAddress,onChange:this.handleAddressChange})}),s.jsx("div",{children:s.jsx(M,{type:"submit",children:"Create and Select"})})]})}}class eb extends ie.PureComponent{static propTypes={isOpen:n.bool,onRequestClose:n.func,csrSelectCustomer:n.func};constructor(e){super(e),this.state={selectType:"existing",results:[],searchError:"",newCustomerError:""}}handleSelectTypeChange=e=>{const a=e.target.value;this.setState({selectType:a})};search=(e,a)=>{this.setState({searchError:""},()=>{const r={};e==="email"?r.email=a:r.phone=a,oe.get("/api/accounts/internal/search",{headers:{Authorization:Kt()},params:r}).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,a,r,i,o,l,c)=>{this.setState({newCustomerError:""},()=>{const d=r.replace(/[^\d+]/gi,"");let u=i;o&&(u=`${d}@recreation.gov`);const f={first_name:e,last_name:a,email:u,cell_phone:d};c&&(f.home_address=l),oe.post("/api/accounts/internal/account",f,{headers:{Authorization:Kt()}}).then(h=>{const m=h.data.account_id;this.select(m)}).catch(h=>{const m=h.response;let b="An unexpected error occurred, please try again later";m.status===400&&(b=m.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(Xg,{search:this.search,error:this.state.searchError});return this.state.selectType==="new"&&(e=s.jsx(Qg,{createAndSelect:this.createAndSelect,error:this.state.newCustomerError})),this.state.results.length>0&&(e=s.jsx(Jg,{results:this.state.results,select:this.select})),s.jsxs(dt,{size:"lg",isOpen:this.props.isOpen,heading:"Select Customer",onRequestClose:this.props.onRequestClose,children:[s.jsx("div",{className:"mb-2",children:s.jsxs(Xf,{name:"select-type-group",value:this.state.selectType,onChange:this.handleSelectTypeChange,className:"nav-select-customer-modal-radio",isInline:!0,children:[s.jsx(dr,{id:"existing",label:"Existing User",value:"existing"}),s.jsx(dr,{id:"new",label:"New User",value:"new"})]})}),e,s.jsx(ot,{children:s.jsxs(et,{isFullWidthOnMobile:!1,isStretchedToFit:!0,children:[s.jsx(M,{appearance:"tertiary",onClick:this.props.onRequestClose,children:"Cancel"}),s.jsx(M,{appearance:"tertiary",onClick:this.clear,children:"Clear"})]})})]})}}function tb(){const t=Ie(),[e,a]=p.useState(!1),i=!!pe(o=>o.auth).account;return s.jsxs(s.Fragment,{children:[s.jsxs(Nf,{label:i?s.jsx(sb,{}):s.jsx(ab,{}),hasBorder:!1,hasChevronIcon:!0,children:[s.jsx(cr,{iconBeforeElement:s.jsx(A,{iconName:"person-add"}),onClick:()=>{a(!0)},children:i?"Select A Different Customer":"Select Customer"}),s.jsx(cr,{appearance:"danger",onClick:()=>{t(Vi())},children:"CSR Sign Out"})]}),s.jsx(eb,{isOpen:e,onRequestClose:()=>{a(!1)},csrSelectCustomer:o=>{t(Yh(o))}})]})}function sb(){const t=yn(),e=xn();return s.jsxs("div",{className:"sarsa--csr-menu",children:[s.jsx(Ws,{src:e,alt:t,size:"sm"}),s.jsxs("span",{children:[t," (Customer)"]})]})}function ab(){const e=pe(a=>a.auth).csrAccount?.name||"CSR Options";return s.jsxs("div",{className:"sarsa--csr-menu",children:[s.jsx(Ws,{size:"sm",className:"csr-avatar"}),s.jsxs("span",{children:[e," (CSR)"]})]})}const nb="navbar-search-input",rb="headerTextQuery";function ox({darkModeLogoElement:t,getMenuAccountItems:e,isGuestAllowed:a,logoElement:r,menuSections:i}){const[o,l]=p.useState(!1),[c,d]=p.useState(null),[u,f]=p.useState(!1),g=p.useRef(null),h=Ie(),m=pe(S=>S.cart?.reservation_count||0),b=pe(S=>S.auth),{isLgAndUp:x}=Dt(),w=Pg(g.current),v=lt(),C=async()=>{const S=Br();if(S)try{let k=await Ad(S);k.data.results?.length>0?d(k.data.results[0].name):(k=await Ld(S),k.data.results?.length>0&&d(k.data.results[0].name))}catch{}f(!0)};p.useEffect(()=>{qr(),v&&(Hr(),C())},[h,v]);const y=e(m),N=a&&Ao.test(window.location.pathname),T=()=>{l(S=>!S)},j=v&&u?s.jsx(te,{xs:"variable",children:s.jsxs(Zt,{className:"first-inline-group rec-powered-by",alignX:"right",space:"xxs",children:[s.jsx("span",{children:s.jsx(ce,{className:"tag-line-italic-text style-italic mr-1",children:"Brought to you by"})}),s.jsx("span",{children:s.jsx("a",{href:Ur("/"),target:"_blank",rel:"noreferrer",children:r})})]})}):null;return s.jsxs(s.Fragment,{children:[s.jsx("div",{ref:g,style:{position:"absolute",height:"1px"},"aria-hidden":"true"}),s.jsx("header",{id:"nav-header-container",className:R("nav-header-container sticky",{"has-shadow":w}),children:s.jsxs("div",{className:"nav-header",children:[s.jsxs("div",{className:"nav-header-left",children:[!v&&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:r}),b?.account?.account?.is_commercial_account?s.jsx("div",{className:"commercial-account-title",children:"Commercial"}):null]}),v&&c&&s.jsx("div",{className:"nav-logo-holder",children:s.jsx("div",{className:"widget-location-title",children:s.jsx("a",{href:$s()??"#",children:c})})}),v&&!c&&s.jsx("div",{className:"nav-logo-holder",children:j})]}),s.jsx("nav",{className:"nav-header-right",children:s.jsxs("div",{className:"nav-interactions-holder",children:[!v&&s.jsx("div",{className:"nav-search-bar-wrap",children:s.jsx("div",{className:"nav-search-input-wrapper",children:s.jsx(Oi,{queryCriteriaPropertyName:rb,size:"md",id:nb})})}),v&&c&&j,s.jsxs("div",{className:"nav-links-wrap",children:[s.jsx(M,{appearance:"link",href:"https://help.recreation.gov/external",target:"_blank",rel:"noopener noreferrer",className:"nav-link pl-1 pr-1",id:"ga-global-nav-help-link",children:"Help"}),s.jsx(Kg,{}),b.csrAccount?s.jsx(tb,{}):b.isGuest||b.account?s.jsx(Yg,{onClick:T}):s.jsx(Zg,{isGuestLoginAllowed:N}),s.jsx(M,{appearance:"subtle",id:Lo,className:R("nav-mobile-menu-button",{"nav-active":o}),"aria-label":"Navigation Menu",clickTagCategory:"Global Navigation",clickTagAction:"Open Navigation Menu",clickTagLabel:"Hamburger Menu Button","aria-owns":o?"nav-mobile-menu-id":void 0,"aria-expanded":o,onClick:T,children:s.jsx(A,{iconName:o?"close":x?"menu":"rec-menu",size:"lg"})})]})]})})]})}),s.jsx(Bg,{isOpen:o,onClose:T,shouldDisplaySearchBar:!x&&!v,menuSections:v?[]:i,logoElement:r,darkModeLogoElement:t,menuAccountItems:y,isGuestAllowed:N,isGuest:b.isGuest})]})}class ib extends ie.Component{static propTypes={errorText:n.any,create:n.func,reset:n.func,confirmSignIn:n.func,mfaRequired:n.bool,mfaValidation:n.bool,loginNotice:Rg,siteName:n.string,children:n.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:a}=this.props;Ha(a,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(a){console.error(a)}}passwordTextChange(e){this.setState({password:e.target.value})}emailTextChange(e){this.setState({email:e.target.value})}render(){let e=null,a=this.state.processing;(this.props.errorText||this.props.mfaRequired)&&(a=!1),this.props.errorText&&(e=s.jsx(je,{role:"alert",type:"error",className:"mb-2 rec-sign-error",shouldFocusOnMount:this.state.focusAlertContainer,children:this.props.errorText}));let r=null;this.props.mfaRequired&&(r=s.jsx(je,{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 i=null,o=null,l=null;this.props.mfaValidation?i=s.jsx(je,{type:"success",className:"mb-2",shouldFocusOnMount:!0,children:"Your device has been successfully validated, please log in to complete this process."}):(o=s.jsx(M,{appearance:"link",onClick:this.props.reset,shouldFitContainer:!0,className:"mb-3",children:"Forgot Your Password?"}),l=s.jsx(bt,{background:"light-blue",marginY:"md",children:s.jsxs(ce,{className:"py-1",align:"center",children:["New to ",s.jsx("span",{translate:"no",children:this.props.siteName}),"?"," ",s.jsx(M,{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(m){console.error(m),h="",this.setState({noticedClosed:!0})}c=s.jsx("div",{className:"rec-legacy-users-message",children:s.jsxs(Bi,{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(kt,{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(re,{headingLevel:1,appearance:"display",className:"rec-acct-modal-title",id:"signInModalHeading",headingAlign:"center",children:"Log In"}),this.props.children,s.jsxs(he,{children:[s.jsxs(te,{...g,children:[l,e,r,i]}),s.jsxs(te,{...d,children:[s.jsxs("form",{noValidate:!0,onSubmit:this.submitForm,children:[s.jsx("div",{className:"form-item-wrap",children:s.jsx(gn,{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(ge,{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(ce,{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(M,{shouldFitContainer:!0,size:"lg",type:"submit",className:"rec-acct-sign-in-btn my-1",disabled:a,isLoading:a,children:"Log In"})]}),o,s.jsxs(ce,{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(te,{...u,children:s.jsx("div",{className:"rec-acct-modal-split-line"})}),s.jsx(te,{...f,children:c})]})]})}}function ob({onCreateAccountClick:t,onResetPasswordClick:e,login:a,serverError:r,isLockedOut:i,isMfaRequired:o,isMfaValidated:l,loginNotice:c,siteName:d="Recreation.gov",hasError:u=!1,showCaptchaMessage:f=!0,redirectUrl:g=$i(),children:h}){const[m,b]=p.useState(null),x=({email:N,password:T})=>{if(N.length<1||T.length<1)b("All fields are required.");else{b(null);const j={username:N,password:T,userAgent:navigator.userAgent,redirectUrl:g};a(j)}},w=s.jsx(M,{appearance:"link",onClick:e,title:"Reset Password","aria-label":"Reset Password",children:"Reset Password"}),v=s.jsx(M,{appearance:"link",onClick:t,title:"Create an account.","aria-label":"Create an account",children:"Create an account"}),C=u?r==="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 ",w,"."]}):void 0,y=i?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 ",w,". If you do not receive your magic log in email, please check your spam folder."]}):void 0;return s.jsx(ib,{errorText:y||C||m,create:t,reset:e,confirmSignIn:x,mfaValidation:l,mfaRequired:o,loginNotice:c,siteName:d,showCaptchaMessage:f,children:h})}function lb({isOpen:t,closeModal:e,account:a,logoElement:r,...i}){return p.useEffect(()=>{a?.access_token&&t&&e()},[a,e,t]),Oa({isDisabled:!t}),s.jsx(Fe,{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:r}),s.jsx(M,{className:"modal-close-button",appearance:"subtle",size:"md","aria-label":"Close modal",iconBeforeElement:s.jsx(A,{iconName:"close"}),onClick:e})]}),s.jsx(he,{justifyContent:"center",children:s.jsx(te,{sm:8,className:"rec-acct-modal-log-in-body",children:s.jsx(ob,{...i})})}),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."]})]})})}function cb({isOpen:t,onClose:e,onSetupMFA:a=()=>{window.location.assign("/account/security")}}){const r=p.useRef(),i=()=>{e()},o=()=>{a()},l=async()=>{try{await Ye.mfa.prompt(!1),i()}catch{i()}};return p.useEffect(()=>{!!r?.current?.focus&&requestAnimationFrame(()=>r.current?.focus())},[]),s.jsx(dt,{isOpen:t,size:"xl",overlayClassName:"rec-acct-modal rec-mfa-modal__container",onRequestClose:i,contentRef:c=>{r.current=c},gaTrackingId:"798651617401",children:s.jsx(he,{hasGutters:!1,className:"mt-5",justifyContent:"center",children:s.jsxs(te,{sm:10,className:"mt-3",children:[s.jsx(re,{headingLevel:1,appearance:"h3",headingAlign:"center",children:"Set Up Multi-Factor Authentication"}),s.jsxs(ce,{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(ce,{className:"my-2",children:"This is completely optional and adds a layer of security for your protection."}),s.jsx(ce,{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(ce,{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(No,{id:"auth-apps",children:s.jsxs(vn,{children:[s.jsx(Zs,{children:"View list of suggested apps"}),s.jsxs(bn,{children:[s.jsxs(ce,{children:[s.jsx("b",{children:"Android options:"})," Google Authenticator, Microsoft Authenticator, Authy, LastPass, 1Password."]}),s.jsxs(ce,{children:[s.jsx("b",{children:"iOS options:"})," Google Authenticator, Microsoft Authenticator, Authy, LastPass, 1Password."]}),s.jsxs(ce,{children:[s.jsx("b",{children:"Windows apps:"})," 1Password, OTP Manager."]}),s.jsxs(ce,{children:[s.jsx("b",{children:"Mac apps:"})," 1Password, OTP Manager."]}),s.jsxs(ce,{children:[s.jsx("b",{children:"Chrome extensions:"})," Authenticator."]})]})]})})}),s.jsx(ce,{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(he,{justifyContent:"center",className:"mt-3",children:s.jsxs(et,{isStacked:!0,children:[s.jsx(M,{appearance:"subtle",onClick:i,gaTrackingId:"831610554062",children:"Skip for now"}),s.jsx(M,{appearance:"tertiary",onClick:l,gaTrackingId:"831610554062",children:"Don’t show me this again"}),s.jsx(M,{onClick:o,gaTrackingId:"831610554062",children:"Set Up Multi-Factor Authentication"})]})})]})})})}function db({siteName:t,createAccount:e,errorMessage:a,onReset:r,confirmSignIn:i,setErrorText:o,processing:l,isResetPasswordFlow:c,children:d}){const[u,f]=p.useState("mfaCode"),[g,h]=p.useState(""),[m,b]=p.useState(""),x=p.useRef(),w=N=>{N.preventDefault(),i(u==="mfaCode"?m:g,u)},v=N=>{o(""),b(N)},C=N=>{const T=N.target.value;T.length<11&&(o(""),h(T))},y=N=>{f(N),h(""),b("")};return s.jsxs(s.Fragment,{children:[s.jsx(re,{headingLevel:1,appearance:"display",className:"rec-acct-modal-title",id:"signInModalHeading",headingAlign:"center",children:"Log In"}),s.jsxs(he,{justifyContent:"center",children:[s.jsxs(te,{md:12,children:[d,s.jsx(bt,{background:"light-blue",marginY:"md",children:s.jsxs(ce,{className:"py-1",align:"center",children:["New to ",s.jsx("span",{translate:"no",children:t}),"?"," ",s.jsx(M,{appearance:"link",onClick:e,title:"Create an account.","aria-label":"Create an account",className:"pb-fourth",children:"Create an account."})]})}),a&&s.jsx(je,{type:"error",className:"mb-2 rec-sign-error",shouldFocusOnMount:!0,children:a})]}),s.jsxs(te,{md:12,children:[s.jsxs("form",{onSubmit:w,children:[u==="mfaCode"&&s.jsxs(s.Fragment,{children:[s.jsx(bt,{textAlign:"center",children:s.jsx(ut,{className:"pb-1 justify-content-center",htmlFor:"code",isRequired:!0,children:"6-digit Code from Authenticator App"})}),s.jsx(bt,{alignX:"center",children:s.jsx(yg,{id:"code",label:"6-digit Code from Authenticator App",onChange:v,value:m,autoFocus:!0,className:"mb-3"})})]}),u==="backupCode"&&s.jsx(ge,{isRequired:!0,id:"backupCode",autoComplete:"off",label:"One-time backup code",onChange:C,value:g,innerRef:x,className:"mb-3"}),s.jsxs(ce,{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(ce,{align:"center",size:"sm",className:"mb-3",children:["Don’t have access to 6-digit Code from Authenticator App? Use"," ",s.jsx(M,{size:"xs",className:"pb-fourth",appearance:"link",onClick:()=>y("backupCode"),children:"one-time backup code"})," ","instead."]}),u==="backupCode"&&s.jsxs(ce,{align:"center",size:"sm",className:"mb-3",children:["Use"," ",s.jsx(M,{size:"xs",className:"pb-fourth",appearance:"link",onClick:()=>y("mfaCode"),children:"6-digit Code"})," ","from Authenticator App instead."]}),s.jsx(M,{shouldFitContainer:!0,size:"lg",type:"submit",className:"rec-acct-sign-in-btn my-1",isDisabled:l,isLoading:l,children:"Log In"})]}),!c&&s.jsx(M,{className:"mb-3",shouldFitContainer:!0,appearance:"link",onClick:r,children:"Forgot Your Password?"}),s.jsxs(ce,{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 ub({isOpen:t,reset:e,onClose:a,onSubmit:r,create:i,siteName:o="",error:l,lockout:c,logoElement:d}){const[u,f]=p.useState(""),[g,h]=p.useState({type:"login",id:""}),[m,b]=p.useState(!1);Oa({isDisabled:!t});const x=()=>{const _=new URLSearchParams(window.location.search).get("magic");let I="login",P="";_&&(I="magic-link",P=_),h({type:I,id:P})};p.useEffect(()=>{t&&x()},[t]);const w=()=>{a()},v=async(k,_)=>{f("");try{const I=_==="mfaCode"?k?.replace(/\D/g,""):k,{type:P,id:B}=g;if(b(!0),_==="mfaCode"&&I.length!==6){f("unknown code"),b(!1);return}if(_==="backupCode"&&I.length!==10)f("unknown code"),b(!1);else{const W=$i();await r({type:P,id:B,token:I}),W&&Di(W)}b(!1),w()}catch(I){const P=ns(I);f(P),b(!1)}},C=()=>{i(),w()},y=()=>{e(),w()},N=s.jsx(M,{appearance:"link",onClick:e,title:"Reset Password",className:"pb-fourth","aria-label":"Reset Password",children:"Reset Password"}),T=s.jsx(M,{appearance:"link",onClick:i,title:"Create an account.",className:"pb-fourth","aria-label":"Create an account",children:"Create an account"});let j=null;const S=window.location.href.includes("/reset/");return(l||u)&&(j=s.jsxs(s.Fragment,{children:["Are you sure you have the right code? Please double check your code, and try again. You can also ",T," or ",N,"."]}),S&&(j=s.jsxs(s.Fragment,{children:["Are you sure you have the right code? Please double check your code, and try again. You can also ",T,"."]}))),c&&(j=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 ",N,". If you do not receive your magic log in email, please check your spam folder."]})),s.jsx(Fe,{role:"complementary",isOpen:t,onRequestClose:w,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(M,{className:"modal-close-button",appearance:"subtle",size:"md","aria-label":"Close modal",iconBeforeElement:s.jsx(A,{iconName:"close"}),onClick:w})]}),s.jsx(he,{justifyContent:"center",children:s.jsx(te,{sm:8,children:s.jsx(db,{errorMessage:j,setErrorText:f,processing:m,createAccount:C,onReset:y,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 hb={email:n.string};class pb extends ie.Component{static propTypes=hb;componentDidMount(){this.header.focus()}render(){return s.jsx(he,{justifyContent:"center",children:s.jsxs(te,{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(re,{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 mb({siteName:t,email:e,firstName:a,lastName:r,cellPhone:i,optIn:o,confirmAccount:l,additionalChallengeRequired:c,confirmPassword:d}){const[u,f]=p.useState(""),[g,h]=p.useState(""),[m,b]=p.useState(!1),[x,w]=p.useState(null),[v,C]=p.useState({message:"",status:void 0}),y=p.useRef(null),N=async()=>{h(""),f("");let _=null;if(!c)try{_=await y.current?.executeAsync()}catch{C({message:"An error occurred.Try again later.",status:"error"});return}b(!0);const I=await l({email:e,firstName:a,lastName:r,cellPhone:i,optIn:o,invisibleRecaptchaToken:_});I.success?C({message:"Email was successfully sent",status:"success"}):I.response?.data?.error==="lockout"?C({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"}):C({message:"An error occurred.Try again later.",status:"error"}),b(!1)},T=_=>{w(_)},j=_=>{_?.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."):_?.response?.data?.error&&C({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 _="/api/accounts/registration/validate";try{const{data:I}=await oe.put(_,{code:u});I.token.length>0?d(I.token,"Account"):C({message:"An error occurred.Try again later.",status:"error"})}catch(I){j(I)}finally{b(!1)}},k=_=>{const I=_.target.value?.replace(/\D/g,"");if(/^\d{0,6}$/.test(I)){const B=I.slice(0,3)+(I.length>3?" ":"")+I.slice(3,6);h(""),C({message:"",status:void 0}),f(B)}};return s.jsx(he,{justifyContent:"center",className:"mt-8",children:s.jsxs(te,{sm:8,className:"mt-7",children:[s.jsx("div",{className:"rec-acc-create-code-modal__icon",children:s.jsx(A,{iconName:"email",size:"xxl"})}),s.jsx(re,{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(he,{justifyContent:"center",children:[s.jsx(te,{md:12,children:v.status!==void 0&&s.jsx(je,{className:"mb-3",type:v.status,children:v.message})}),s.jsx(te,{md:8,children:s.jsx(ge,{autoComplete:"off",id:"code",label:"Confirm Email Code",isLabelVisible:!1,onChange:k,value:u,className:"rec-acc-create-code-modal__input",isInvalid:!!g,placeholder:"000 000"})}),s.jsxs(te,{className:"mb-2",md:12,children:[m&&s.jsx("div",{className:"rec-sign-loading p-2",children:s.jsx(Le,{})}),g&&s.jsxs(ce,{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(te,{children:s.jsx(M,{onClick:N,shouldFitContainer:!0,size:"lg",type:"submit",appearance:"tertiary",isDisabled:m||c&&!x,children:"Resend Email"})}),s.jsxs(te,{children:[c?s.jsx(Io,{action:"signup",size:"normal",onChange:T,sitekey:"6LfhXNoZAAAAAMTSVfpSlqoOeBBJmIoHwtI7Gm6v"}):s.jsx(te,{className:"rec-recaptcha-wrap",children:s.jsx(Js,{ref:y,action:"signup",size:"invisible",sitekey:"6LdBIvUZAAAAAM02b8GWJew_1LffQJo9rNB5yVTU"})}),s.jsx(M,{onClick:S,shouldFitContainer:!0,size:"lg",type:"submit",className:"rec-acct-sign-in-btn",isDisabled:m,gaTrackingId:"938831200523",title:"Log In","aria-label":"Log In",children:"Submit"})]})]})]})})}function fb({errorText:t,signIn:e,confirmAccount:a,onRecaptchaValidation:r,additionalChallengeRequired:i,siteName:o,isLoading:l}){const[c,d]=p.useState(!1),[u,f]=p.useState(null),[g,h]=p.useState(null),m=p.useRef(null),b=p.useRef([]),x=C=>y=>{b.current[C]=y},w=C=>{f(C),r&&r(C)},v=async C=>{C.preventDefault();const y=C.currentTarget.elements;h(null);const N=[];if(b.current.forEach(j=>{const S=j?.validate();S?.isInvalid&&N.push(S)}),N.length){h(N);return}let T=null;if(!i)try{if(T=await m.current?.executeAsync(),!T){d(!0);return}}catch{d(!0);return}a({email:y.email.value,firstName:y.firstName.value,lastName:y.lastName.value,cellPhone:y.cellPhone.value,optIn:y.optIn.value==="checked",invisibleRecaptchaToken:T})};return s.jsx(he,{justifyContent:"center",children:s.jsxs(te,{sm:8,className:"rec-acct-modal-sign-up-body",children:[s.jsx(re,{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(M,{appearance:"link",onClick:e,children:"Log In"})]}):null,s.jsx(To,{errors:g,className:"mb-2"}),t&&!g&&!l?s.jsx(je,{type:"error",className:"mb-2",children:t}):null,c&&!g&&!l?s.jsxs(je,{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(Lt,{children:[s.jsx(ge,{id:"rec-acct-first",label:"First Name",name:"firstName",className:"rec-acct-first",isRequired:!0,ref:x(0),autoFocus:!0}),s.jsx(ge,{id:"rec-acct-last",label:"Last Name",name:"lastName",className:"rec-acct-last",isRequired:!0,ref:x(1)}),s.jsx(gn,{id:"rec-acct-email",label:"Email",name:"email",className:"rec-acct-email",isRequired:!0,ref:x(2)}),s.jsx(yo,{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(Xt,{label:"Yes, please share stories that will inspire my next adventure.",id:"rec-acct-newsletter-opt-in",name:"optIn",value:"checked",defaultChecked:!0}),i?s.jsx(Io,{action:"signup",size:"normal",onChange:w,sitekey:"6LfhXNoZAAAAAMTSVfpSlqoOeBBJmIoHwtI7Gm6v"}):s.jsx(te,{className:"rec-recaptcha-wrap",children:s.jsx(Js,{ref:m,action:"signup",size:"invisible",sitekey:"6LdBIvUZAAAAAM02b8GWJew_1LffQJo9rNB5yVTU"})}),s.jsx(M,{size:"lg",shouldFitContainer:!0,isDisabled:i&&!u,type:"submit",isLoading:l,children:"Sign Up"})]})}),s.jsx(ce,{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(ce,{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 gb={logoElement:n.element,isOpen:n.bool,closeModal:n.func,signIn:n.func,verification:n.string,siteName:n.string,onConfirmModal:n.func},bb={logoElement:null,isOpen:!1,closeModal:()=>{},signIn:()=>{},onConfirmModal:()=>{},siteName:"Recreation.gov"},vb="An account already exists for this email address",xb="additional challenge required",yb="challenge failed";class wb extends ie.Component{static propTypes=gb;static defaultProps=bb;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 a=s.jsx(M,{appearance:"link",onClick:this.props.signIn,children:"Log In"});if(e?.response?.data?.error===xb)this.setState({additionalChallengeRequired:!0});else{let r="An error has occurred, please try again later.";e?.response?.data?.error==="invalid cellphone"&&(r="The phone number you provided does not appear to be valid."),e?.response?.data?.error===vb&&(r=s.jsxs(Zt,{space:"xs",children:[s.jsx("span",{children:"You look familiar! This email already has an account associated with it."}),a]})),e?.response?.data?.error===yb&&(r=s.jsxs(Zt,{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."]}),a]})),this.setState({errorMessage:r})}}setStateAsync=e=>new Promise(a=>{this.setState(e,a)});getRecaptchaTokenV3=async(e,a)=>new Promise(r=>{Hf("6Ld0BogUAAAAAGDL0sfz1wVdmuae18krNNQS6vW5",e,i=>{const o={section:e,code:i.error?"":i.token,region:a};r(o)})});async getRecaptchaToken(){const e="EAST",a="WEST",r="invisible",i="initializeRegistration";let o={};return this.state.additionalChallengeRequired?o={section:i,code:this.state.verification,region:a}:this.state.invisibleRecaptchaToken?o={section:i,code:this.state.invisibleRecaptchaToken,region:r}:o=await this.getRecaptchaTokenV3(i,e),o}async signup(e){const a="/api/accounts/registration";this.setState({isLoading:!0});try{return await oe.post(a,{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(r){return this.handleApiErrors(r),r}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 a=await this.getRecaptchaToken();return await this.signup(a)}catch(a){return a}}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 a=null;return this.state.completed?a=s.jsx(rn,{flag:"enableCreateAccountCode",fallback:s.jsx(pb,{email:this.state.email}),children:s.jsx(mb,{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})}):a=s.jsx(fb,{errorText:e,signIn:this.props.signIn,confirmAccount:this.confirmAccount,additionalChallengeRequired:this.state.additionalChallengeRequired,siteName:this.props.siteName,isLoading:this.state.isLoading}),s.jsx(Fe,{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(M,{className:"modal-close-button",appearance:"subtle",size:"md","aria-label":"Close modal",iconBeforeElement:s.jsx(A,{iconName:"close"}),onClick:this.props.closeModal})]}),a]})})}}const Cb={errorText:n.string,error:n.any,create:n.func,reset:n.func,confirmSignIn:n.func,mfaRequired:n.bool,mfaValidation:n.bool,siteName:n.string,continueAsGuest:n.func,disableAccountFeatures:n.bool};class Sb extends ie.Component{static propTypes=Cb;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(je,{type:"error",className:"mb-2",children:this.props.errorText||this.props.error}));let a=null;this.props.mfaRequired&&(a=s.jsx(je,{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 r=null,i=null;return this.props.mfaValidation?r=s.jsx(je,{type:"success",className:"mb-2",children:"Your device has been successfully validated, please log in to complete this process."}):i=s.jsx(bt,{alignX:"center",children:s.jsx(M,{appearance:"link",onClick:this.props.reset,disabled:this.props.disableAccountFeatures,title:"Forgot Password?","aria-label":"Forgot Password",children:"Forgot Password?"})}),s.jsx(he,{justifyContent:"center",className:"rec-acct-modal-log-in-guest-body",children:s.jsxs(te,{sm:7,children:[s.jsx(re,{headingLevel:1,appearance:"h2",id:"signInGuestModalHeading",className:"log-in-heading mb-5",children:"Log In Options"}),e,a,r,s.jsxs("div",{children:[s.jsx(re,{headingLevel:2,appearance:"h5",className:"mb-1",children:"Returning Visitors"}),s.jsxs(ce,{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(Lt,{children:[s.jsx(ge,{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(ge,{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(M,{shouldFitContainer:!0,type:"submit",disabled:this.state.processing||this.props.disableAccountFeatures,isLoading:this.state.processing,children:"Log In"}),s.jsx("div",{children:i})]})}),s.jsx(rs,{className:"my-3 my-md-5"}),s.jsxs(re,{headingLevel:2,appearance:"h5",className:"mb-1",children:["New to ",s.jsx("span",{translate:"no",children:this.props.siteName}),"?"]}),s.jsxs(ce,{className:"mb-2",tag:"div",children:[s.jsx(M,{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(M,{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 Nb={logoElement:n.element.isRequired,isOpen:n.bool,closeModal:n.func,create:n.func,reset:n.func,login:n.func,guestLogin:n.func,error:n.bool,errorText:n.string,lockout:n.bool,mfaRequired:n.bool,mfaValidation:n.bool,account:Tg,siteName:n.string},jb={isOpen:!1,closeModal:()=>{},create:()=>{},reset:()=>{},login:()=>{},error:!1,account:null,siteName:"Recreation.gov"};class Tb extends ie.Component{static propTypes=Nb;static defaultProps=jb;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(){Fe.setAppElement("body")}componentDidUpdate(e){const{account:a}=this.props;e.account===null&&a&&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 a=s.jsx(M,{appearance:"link",onClick:this.props.create,title:"Create an account.","aria-label":"Create an account",children:"Create an account"}),r=s.jsx(M,{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. ",a]}):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"," ",a," or ",r,"."]})),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 ",r,"."]})),s.jsx(Fe,{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(M,{className:"modal-close-button",appearance:"subtle",size:"md","aria-label":"Close modal",iconBeforeElement:s.jsx(A,{iconName:"close"}),onClick:this.props.closeModal})]}),s.jsx(Sb,{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})]})})}}const Rb={email:n.string,sendResetPasswordEmail:n.func,disableResetLinkBtn:n.bool};class Ib extends ie.Component{static propTypes=Rb;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(he,{justifyContent:"center",children:s.jsxs(te,{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(re,{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(M,{shouldFitContainer:!0,onClick:e=>this.resendConfirmationEmail(e),size:"lg",isDisabled:this.props.disableResetLinkBtn,children:"Resend Email"})]})})}}function Eb({siteName:t,email:e,closeModal:a,sendResetPasswordEmail:r}){const i=Ie(),[o,l]=p.useState(""),[c,d]=p.useState(""),[u,f]=p.useState(""),[g,h]=p.useState(!1),[m,b]=p.useState({message:"",status:void 0}),x=async()=>{l(""),h(!0);const S=await r();S.success?b({message:Ig,status:"success"}):S.response?.data?.error==="retry: Too many requests, try again later."?b({message:Eg,status:"error"}):b({message:br,status:"error"}),h(!1)},w=()=>o.length===0?_g:c.length<8||c.length>64||c!==u?kg:null,v=S=>{b({message:"",status:void 0}),d(""),f(""),f(""),S?i(Gs()):a()},C=S=>{const k=S?.response?.data?.error;k==="invalid password reset confirmation code"?b({message:Ag,status:"error"}):k==="password must have mixed case"?b({message:Lg,status:"error"}):k&&b({message:br,status:"error"})},y=async S=>{S.preventDefault(),h(!0);try{const k=w();if(k){b({message:k,status:"error"}),h(!1);return}const I=await i(Fi({email:e,password:u,token:o}));v(!!I?.mfa_login)}catch(k){C(k)}finally{h(!1)}},N=S=>{const _=S.target.value.toLowerCase().replace(/\d/g,"");l(_),b({message:"",status:void 0})},T=S=>{f(S.target.value),b({message:"",status:void 0})},j=S=>{d(S.target.value),b({message:"",status:void 0})};return s.jsx(he,{justifyContent:"center",children:s.jsxs(te,{sm:8,children:[s.jsx(re,{headingLevel:1,appearance:"display",headingAlign:"center",className:"rec-acct-modal-title",id:"signInModalHeading",children:"Reset Password"}),s.jsxs(ce,{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(he,{justifyContent:"center",children:[s.jsx(te,{md:12,children:m.status!==void 0&&s.jsx(je,{className:"mb-3",type:m.status,children:m.message})}),s.jsxs("form",{onSubmit:y,children:[s.jsx("div",{className:"form-item-wrap",children:s.jsx(ge,{name:"rec-acct-reset-code",autoComplete:"off",id:"rec-acct-reset-code",placeholder:"",label:"Confirm Email Code",onChange:N,value:o,shouldFocusOnMount:!0})}),s.jsx("div",{className:"form-item-wrap",children:s.jsx(ge,{type:"password",label:"New Password",onChange:j,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(ge,{type:"password",label:"Re-Enter Password",onChange:T,className:"rec-acct-password",id:"rec-acct-password-confirm",autoComplete:"new-password",name:"rec-acct-password-confirm",enableShowPassword:!0})}),s.jsx(un,{password:c}),s.jsxs(he,{className:"mt-5",justifyContent:"end",children:[s.jsx(te,{xs:12,md:6,children:s.jsx(M,{onClick:x,shouldFitContainer:!0,size:"lg",appearance:"tertiary",isDisabled:g,children:"Resend Email"})}),s.jsx(te,{xs:12,md:6,children:s.jsx(M,{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(te,{className:"mb-2",md:12,children:g&&s.jsx("div",{className:"rec-sign-loading p-2",children:s.jsx(Le,{})})})]})]})})}const kb={error:n.any,signIn:n.func,create:n.func,confirmEmail:n.func,disableResetLinkBtn:n.bool,siteName:n.string};class _b extends ie.Component{static propTypes=kb;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(je,{type:"error",className:"mb-2",children:this.props.error}));const a=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(M,{appearance:"link",onClick:this.props.create,title:"Create an account.","aria-label":"Create an account",children:"Create an account."})]});return s.jsx(he,{justifyContent:"center",children:s.jsxs(te,{sm:8,className:"rec-acct-modal-reset-password-body",children:[s.jsx(re,{headingLevel:1,appearance:"display",className:"rec-acct-modal-title",id:"resetPasswordModalHeading",children:"Forgot Your Password?"}),a,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(ut,{htmlFor:"rec-acct-email",children:"Email"}),s.jsx("input",{ref:r=>{this.email=r},onChange:r=>this.emailTextChange(r),id:"rec-acct-email",className:"rec-acct-email"})]}),s.jsx(M,{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(M,{appearance:"link",iconBeforeElement:s.jsx(A,{iconName:"chevron-left"}),onClick:this.props.signIn,title:"Back to Log In","aria-label":"Back to Log In",children:"Back to Log In"})})]})})}}class Ab extends ie.Component{static propTypes={logoElement:n.element.isRequired,isOpen:n.bool,closeModal:n.func,signIn:n.func,create:n.func,siteName:n.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(!Fa(e))return this.setState({emailValidationError:!0,disableResetLinkBtn:!1,recaptchaError:!1}),{success:!1};let a;try{if(a=await this.recaptchaRef?.executeAsync(),!a)return this.setState({recaptchaError:!0}),{success:!1}}catch(i){return this.setState({recaptchaError:!0}),i}this.setState({recaptchaError:!1,disableResetLinkBtn:!0});const r="/api/accounts/passwordreset";try{return await oe.post(r,{email:e,recaptcha_token:a,recaptcha_type:"invisible"}),this.setState({emailValidationError:!1,inputError:!1,serverError:!1,serverErrorText:null,completed:!0,disableResetLinkBtn:!1}),{success:!0}}catch(i){return this.setState({inputError:!1,serverError:!0,serverErrorText:i?.response?.data?.error,disableResetLinkBtn:!1}),i}}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 a=s.jsx(M,{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. ",a]}):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 r=null;return this.state.completed?r=s.jsx(rn,{flag:"enablePasswordResetCode",fallback:s.jsx(Ib,{email:this.state.email,sendResetPasswordEmail:this.sendResetPasswordEmail,disableResetLinkBtn:this.state.disableResetLinkBtn}),children:s.jsx(Eb,{siteName:this.props.siteName,email:this.state.email,sendResetPasswordEmail:this.sendResetPasswordEmail,closeModal:this.props.closeModal})}):r=s.jsx(_b,{error:e,signIn:this.props.signIn,create:this.props.create,confirmEmail:this.confirmEmail,disableResetLinkBtn:this.state.disableResetLinkBtn,siteName:this.props.siteName}),s.jsx(Fe,{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(M,{className:"modal-close-button",appearance:"subtle",size:"md","aria-label":"Close modal",iconBeforeElement:s.jsx(A,{iconName:"close"}),onClick:this.props.closeModal})]}),r,s.jsx(te,{className:"rec-recaptcha-wrap",children:s.jsx(Js,{ref:i=>{this.recaptchaRef=i},action:"passwordreset",size:"invisible",sitekey:"6LdBIvUZAAAAAM02b8GWJew_1LffQJo9rNB5yVTU"})})]})})}}function Lb(t){function e(a){const r=Ma(),i=kr(),o=uc(),[l,c]=Tr(),d=hc();return s.jsx(t,{...a,router:{location:r,navigate:i,params:o,searchParams:l,setSearchParams:c,navigationType:d}})}return e}const Pb=n.shape({hash:n.string,key:n.string,pathname:n.string,search:n.string,state:n.object}),Mb=n.shape({params:n.object,navigate:n.func,location:Pb,searchParams:n.instanceOf(URLSearchParams),setSearchParams:n.func,navigationType:n.oneOf(["POP","PUSH","REPLACE"])}),Ob={label:n.string,message:n.string,email:n.string,closeModal:n.func};class $b extends ie.Component{static propTypes=Ob;componentDidMount(){this.header.focus()}render(){return s.jsx(he,{justifyContent:"center",children:s.jsxs(te,{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(re,{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(A,{iconName:"check"})}),s.jsx("p",{children:this.props.message}),s.jsx("p",{children:s.jsx("strong",{children:this.props.email})}),s.jsx(M,{size:"lg",onClick:this.props.closeModal,title:"Close","aria-label":"Close",children:"Close"})]})})}}const Db={label:n.string,errorText:n.string,confirmPasswords:n.func};class Fb extends ie.Component{static propTypes=Db;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,a=this.state.disabled;return this.props.errorText&&(a=!1,e=s.jsx(je,{role:"alert",type:"error",className:"mb-2",children:this.props.errorText})),s.jsx(he,{justifyContent:"center",children:s.jsxs(te,{sm:8,className:"rec-acct-modal-log-in-confirmation-body",children:[s.jsx(re,{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(ge,{type:"password",label:"New Password",innerRef:this.setPassword1Ref,onChange:r=>this.password1TextChange(r),className:"rec-acct-password",id:"rec-acct-password",autoComplete:"off",enableShowPassword:!0})}),s.jsx("div",{className:"form-item-wrap",children:s.jsx(ge,{type:"password",label:"Re-Enter Password",onChange:r=>this.password2TextChange(r),className:"rec-acct-password",id:"rec-acct-password-confirm",autoComplete:"off",enableShowPassword:!0})}),s.jsx(un,{password:this.state.password1}),s.jsx(M,{shouldFitContainer:!0,size:"lg",type:"submit",className:"rec-acct-sign-in-btn",title:this.props.label,isDisabled:a,"aria-label":this.props.label,children:this.props.label})]})]})})}}const Vb={router:Mb,logoElement:n.element.isRequired,isOpen:n.bool,closeModal:n.func,resetPasswordWithCode:n.func,completeRegistration:n.func,openMfaCodeModal:n.func,confirmType:n.string,confirmToken:n.string},Bb={isOpen:!1,closeModal:()=>{}};class Hb extends ie.Component{static propTypes=Vb;static defaultProps=Bb;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.props.confirmType&&this.props.confirmType!==this.state.confirmType)&&this.getConfirmType()}handleCloseModal(){this.state.redirectURL||window.history.replaceState({},"","/"),this.props.closeModal(this.state.redirectURL)}getConfirmType=()=>{const{confirmType:e,confirmToken:a}=this.props,r=window.location.pathname.split("/").pop(),i=window.location.href;i.includes("/reset/")?this.setState({confirmType:"Reset",confirmToken:r}):i.includes("/confirmation/")?this.setState({confirmType:"Account",confirmToken:r}):e&&a&&this.setState({confirmType:e,confirmToken:a})};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(){if(this.state.password1!==this.state.password2||this.state.password1.length<8||this.state.password1.length>64)this.setState({passwordError:!0,serverError:!1,tokenError:!1});else{const{confirmType:e}=this.state;(e==="Account"?this.props.completeRegistration:this.props.resetPasswordWithCode)({password:this.state.password2,token:this.state.confirmToken}).then(r=>{r?.mfa_login?(this.props.openMfaCodeModal(),this.props.router.navigate("/",{replace:!0})):(this.props.closeModal(),this.props.router.navigate("/",{replace:!0}))}).catch(r=>{const i=r?.response?.data?.error,o=i==="password must have mixed case";this.setState({passwordError:o,serverError:!o,tokenError:i&&i.toLowerCase()==="expired or not active yet",accountExists:i&&i.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 a=null;const{confirmType:r}=this.state;r==="Account"?a="Your Account was successfully created.":a="Your password was successfully reset.";let i=null;return this.state.completed?i=s.jsx($b,{label:this.getConfirmationLabel(),message:a,email:this.state.email,closeModal:this.handleCloseModal}):i=s.jsx(Fb,{errorText:e,label:this.getConfirmationLabel(),confirmPasswords:this.confirmPasswords}),s.jsx(Fe,{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(M,{className:"modal-close-button",appearance:"subtle",size:"md","aria-label":"Close modal",iconBeforeElement:s.jsx(A,{iconName:"close"}),onClick:this.handleCloseModal})]}),i]})})}}const Ub=Lb(Hb);function lx({logoElement:t,isGuestAllowed:e}){const a=Ie(),[r,i]=p.useState(""),[o,l]=p.useState(""),c=pe(I=>I.auth),d=pe(I=>I.recaptcha.verification),u=pe(I=>I.modal?.showSignInGuestModal),f=pe(I=>I.modal?.showLoginModal),g=pe(I=>I.modal?.showCreateAccountModal),h=pe(I=>I.modal?.showResetModal),m=pe(I=>I.modal?.showMfaSetupModal),b=pe(I=>I.modal?.showMfaCodeModal),x=pe(I=>I.modal?.showConfirmModal),w=()=>{a(Fh())},v=()=>{g?w():a(Jh())},C=(I,P)=>{i(I),l(P),x?w():a(Dh())},y=()=>{a(Wn),f?w():a(zs())},N=()=>{a(Wn),u?w():a(an())},T=()=>{h?w():a(Xh())},j=I=>{a(sn(I))},S=async I=>{I.type==="magic-link"?await a(Wh(I)):await a(Bh({...I,userAgent:navigator.userAgent}))},_=e&&Ao.test(window.location.pathname)?N:y;return s.jsxs(s.Fragment,{children:[s.jsx(wb,{isOpen:g,closeModal:w,onConfirmModal:C,signIn:_,verification:d,siteName:"Recreation.gov",logoElement:t}),s.jsx(lb,{isOpen:f,closeModal:w,onCreateAccountClick:v,onResetPasswordClick:T,login:j,account:c.account,hasError:c.loginError,serverError:c.errorText,isLockedOut:c.lockout,isMfaRequired:c.mfaRequired,loginNotice:c.loginNotice,siteName:"Recreation.gov",logoElement:t}),s.jsx(Tb,{isOpen:u,closeModal:w,create:v,reset:T,guestLogin:()=>{a(Kh())},login:j,account:c.account,error:c.loginError,errorText:c.errorText,lockout:c.lockout,mfaRequired:c.mfaRequired,loginNotice:c.loginNotice,siteName:"Recreation.gov",logoElement:t}),s.jsx(Ab,{isOpen:h,create:v,closeModal:w,signIn:_,siteName:"Recreation.gov",logoElement:t}),s.jsx(cb,{isOpen:m,onClose:w}),s.jsx(ub,{isOpen:b,onSubmit:S,onClose:w,create:v,reset:T,logoElement:t,error:c.loginError,lockout:c.lockout,siteName:"Recreation.gov"}),s.jsx(Ub,{isOpen:x,closeModal:w,logoElement:t,loginAfterPasswordUpdated:I=>{a(Vh(I))},resetPasswordWithCode:I=>a(Fi({...I,userAgent:navigator.userAgent})),completeRegistration:I=>a(Gh({...I,userAgent:navigator.userAgent})),confirmToken:r,confirmType:o,mfaAfterResetPassword:()=>{a(Uh())},openMfaCodeModal:()=>{a(Gs())}})]})}export{Zb as $,Zm as A,M as B,Ia as C,kt as D,Xa as E,rn as F,Qb as G,re as H,A as I,rx as J,Bn as K,lx as L,Md as M,ox as N,Fs as O,Zt as P,Ea as Q,hv as R,Lt as S,ce as T,Co as U,kf as V,vg as W,vm as X,xm as Y,rs as Z,cn as _,Ms as a,Mm as a$,lo as a0,Of as a1,vv as a2,Ss as a3,dt as a4,et as a5,Dv as a6,ot as a7,Le as a8,Te as a9,Cm as aA,Pt as aB,wv as aC,bv as aD,mm as aE,Iv as aF,Km as aG,jo as aH,Ti as aI,Xb as aJ,pv as aK,eo as aL,ct as aM,Xd as aN,Sv as aO,To as aP,Ev as aQ,Yv as aR,Tv as aS,ep as aT,ge as aU,io as aV,yo as aW,ax as aX,Xt as aY,gn as aZ,Zv as a_,ue as aa,Ks as ab,Qe as ac,zs as ad,zv as ae,Wv as af,qv as ag,Uv as ah,Gv as ai,av as aj,Bp as ak,vh as al,so as am,Jt as an,fv as ao,Av as ap,Jb as aq,$v as ar,qa as as,Hv as at,Mb as au,Lb as av,dv as aw,cv as ax,Lm as ay,Zf as az,Os as b,Om as b0,Rv as b1,nv as b2,Bv as b3,tg as b4,Ni as b5,ov as b6,lv as b7,gv as b8,Kb as b9,lt as c,bt as d,he as e,te as f,No as g,Yb as h,$e as i,Pv as j,mv as k,it as l,Sd as m,$m as n,je as o,Wb as p,Zh as q,tv as r,va as s,Lv as t,Dt as u,sv as v,jv as w,ev as x,sg as y,ix as z}; //# sourceMappingURL=sarsaparilla-DEXmTRf1.js.map