import{r as y,j as e,R as Mt,f as Vr}from"./react-RmqNV1Mj.js";import{f as Ft,P as i,h as _e,ab as Ua,y as Gr,j as Be,a0 as Us,be as Yt,bf as Ct,a2 as It,a1 as ys,bg as re,bh as ts,bi as Hr,bj as Ta,bk as _a,bl as qr,bm as Wr,bn as Kr,bo as Zr,bp as Qr,bq as Xr,br as Jr,bs as ei,k as si,bt as ti,bu as ai,bv as ni,ar as ri,$ as Ts,bw as ii,bx as oi,b as ss,m as li,by as ci,bz as za,bA as di,bB as hi,bC as ui,bD as pi,bE as mi,bF as fi,L as xa,e as Va,bc as Ga,a4 as Ha,aa as qa,u as fe,bG as _t,bH as gi,bI as yi,bJ as Ti,bK as _i,bL as xi}from"./vendor-BRY3vAz4.js";import{u as ls,A as vi,D as Ue,B as E,F as $t,i as Bt,E as Ie,a as Wa,b as Ei,c as Ka,d as Z,C as $e,e as O,f as S,H as Q,T as D,S as H,g as Ut,I as k,h as bi,j as ji,k as At,l as Si,m as ke,n as is,o as Ri,p as Ci,q as Ii,r as Ai,s as va,t as Di,v as Ni,w as bs,x as Za,y as Qa,z as Xa,M as zt,G as ge,J as Pi,K as Ja,N as en,R as sn,L as wi,O as Oi,P as tn,Q as ki,U as Li,V as Mi,W as Fi,X as Yi,Y as as,Z as ve,_ as $i,$ as vs,a0 as Ea,a1 as Oe,a2 as Bi,a3 as ns,a4 as Ae,a5 as ba,a6 as js,a7 as Ui,a8 as Vt,a9 as zi,aa as an,ab as zs,ac as nn,ad as rn,ae as on,af as Vi,ag as Gi,ah as ln,ai as Hi,aj as Ms,ak as cn,al as qi,am as Dt,an as Wi,ao as Ki,ap as Zi,aq as ja,ar as Nt,as as Qi,at as Xi,au as Ji,av as dn,aw as eo,ax as so,ay as to,az as ao,aA as no,aB as ro,aC as io}from"./sarsaparilla-Cm7AHsNX.js";import{m as oo,a as se,q as I,w as hn,x as lo,d as co,i as he,y as Sa,h as Es,z as ho,A as uo,B as xt,k as de,C as po,D as mo,E as fo}from"./lodash-DdIxDgD1.js";import{h as _,c as Ds,m as vt}from"./moment-BGXOxyaW.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&n(l)}).observe(document,{childList:!0,subtree:!0});function t(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(r){if(r.ep)return;r.ep=!0;const o=t(r);fetch(r.href,o)}})();function go(){const{pathname:a}=Ft();return y.useEffect(()=>{window.scrollTo(0,0)},[a]),null}function un({setAnnouncementClose:a}){const[s,t]=y.useState(!1),{announcementsSiteWide:n}=_e(),{isSmAndDown:r}=ls();if(!n)return null;const[o,l,c,d,h,u,p,m,f,g]=n,T=!Array.isArray(n)||n.length===0,x=g==="homepageOnly",b=()=>{s&&Ua.set(o,"hide",{expires:730,secure:!0}),a()},A=()=>{t(!s)};if(T||x&&window?.location?.pathname!=="/"||window?.location?.pathname===h)return null;const C=m==="lightTheme",N=C?"dark":"light",L=C?"light":"dark",V=f==="hidingEnabled";let P="";try{P=decodeURIComponent(c)}catch(z){console.error(z),P=""}return e.jsxs(vi,{image:{backgroundImage:`url(/shared${u})`},title:l,sticky:!0,textColor:N,background:L,name:o,closedAnnouncement:b,children:[e.jsx(Ue,{html:P}),(d&&h||V)&&e.jsxs("div",{className:"rec-announcement-link-btn-input-wrap",children:[d&&h&&e.jsx(E,{shouldFitContainer:r,href:h,className:"rec-announcement-link-btn",children:d}),V&&e.jsx("div",{className:"rec-form-check-wrap",children:e.jsxs("label",{htmlFor:o,className:"rec-label-checkbox",children:[e.jsx("input",{className:"rec-input-hide",type:"checkbox",id:o,name:o,onChange:A}),e.jsx("span",{className:"rec-input-checkbox"}),"Don't show me this again"]})})]}),p&&e.jsx("div",{className:"rec-announcement-photo-credit",children:p})]})}un.propTypes={setAnnouncementClose:i.func};const yo="252dc806-0406-4947-88ce-5c0b67f29aea";let Ra=!1,_s=null,Ns=null;const To=a=>{if(Ra){a&&a();return}const s=document.createElement("script");s.src="https://www.gstatic.com/dialogflow-console/fast/messenger/bootstrap.js?v=1",s.id="dialogflow-messenger",document.body.appendChild(s),s.onload=()=>{Ra=!0,a&&a()}};function _o(){const[a,s]=y.useState(!1),t=y.useRef(!1);return y.useEffect(()=>{t.current||(t.current=!0,To(()=>{_s=window.localStorage.getItem("df-session-id"),_s||(_s=Gr(),window.localStorage.setItem("df-session-id",_s)),Ns=window.location.pathname;const r=Ua.get("_ga");r&&(Ns+=",",Ns+=r),s(!0)}))},[]),e.jsx("div",{className:"df-messenger-rec-wrapper",children:a&&e.jsx("df-messenger",{alt:"Chat icon",intent:"WELCOME","chat-icon":"/shared/graphics/chat_icon.png","chat-title":"Recreation.gov","agent-id":yo,"session-id":_s,"user-id":Ns,"wait-open":"true","language-code":"en"})})}const xo=new Date().getFullYear(),Et=`© ${xo} Recreation.gov. All rights reserved.`,vo="https://www.facebook.com/Recreation.gov",Eo="https://www.instagram.com/recreation_gov",bo="https://www.pinterest.com/recreationgov";function Ca(){const a="Footer",s="Get to Know Us List";return e.jsxs("ul",{className:"nav-footer-list",children:[e.jsx("li",{children:e.jsx(E,{appearance:"link",href:"/about-us",clickTagCategory:a,clickTagAction:"About Us link",clickTagLabel:s,children:"About Recreation.gov"})}),e.jsx("li",{children:e.jsx(E,{appearance:"link",href:"/rules-reservation-policies",clickTagCategory:a,clickTagAction:"Rules & Reservation Policies link",clickTagLabel:s,children:"Rules & Reservation Policies"})}),e.jsx($t,{flag:"programAndContractFaqFooterLink",children:e.jsx("li",{children:e.jsx(E,{appearance:"link",href:"/faq",clickTagCategory:a,clickTagAction:"FAQs link",clickTagLabel:s,children:"Program & Contract FAQs"})})}),e.jsx("li",{children:e.jsx(E,{appearance:"link",href:"/accessibility",clickTagCategory:a,clickTagAction:"Accessibility link",clickTagLabel:s,children:"Accessibility"})}),e.jsx("li",{children:e.jsx(E,{appearance:"link",href:"/media-center",clickTagCategory:a,clickTagAction:"Media Center link",clickTagLabel:s,children:"Media Center"})}),e.jsx("li",{children:e.jsx(E,{appearance:"link",href:"/site-map",clickTagCategory:a,clickTagAction:"Site Map link",clickTagLabel:s,children:"Site Map"})})]})}function Ia(){const a="Footer",s="Plan With Us List";return e.jsxs("ul",{className:"nav-footer-list",children:[e.jsx("li",{children:e.jsx(E,{appearance:"link",href:"/articles",clickTagCategory:a,clickTagAction:"Find Trip Inspiration link",clickTagLabel:s,children:"Find Trip Inspiration"})}),e.jsx("li",{children:e.jsx(E,{appearance:"link",href:"/trips/new",clickTagCategory:a,clickTagAction:"Build a Trip link",clickTagLabel:s,children:"Build a Trip"})}),e.jsx("li",{children:e.jsx(E,{appearance:"link",href:"/pass/",clickTagCategory:a,clickTagAction:"Buy a Pass link",clickTagLabel:s,children:"Buy a Pass"})}),e.jsx("li",{children:e.jsx(E,{appearance:"link",href:"/lottery/available",clickTagCategory:a,clickTagAction:"Enter a Lottery link",clickTagLabel:s,children:"Enter a Lottery"})}),e.jsx("li",{children:e.jsx(E,{appearance:"link",href:"/mobile-app",clickTagCategory:a,clickTagAction:"Checkout our Mobile App link",clickTagLabel:s,children:"Get the App"})}),e.jsx($t,{flag:"gearRentalFooterLink",children:e.jsx("li",{children:e.jsx(E,{appearance:"link",href:"/rentals",clickTagCategory:a,clickTagAction:"RV Rentals link",clickTagLabel:s,children:"RV Rentals"})})})]})}function Aa(){const a="Footer",s="Join Us List";return e.jsxs("ul",{className:"nav-footer-list",children:[e.jsx("li",{children:e.jsx(E,{appearance:"link",href:"/get-involved",clickTagCategory:a,clickTagAction:"Get Involved link",clickTagLabel:s,children:"Volunteer"})}),e.jsx("li",{children:e.jsx(E,{appearance:"link",href:"/use-our-data",clickTagCategory:a,clickTagAction:"Use Our Data link",clickTagLabel:s,children:"Data Access"})}),e.jsx("li",{children:e.jsx(E,{appearance:"link",href:"/new-implementations",clickTagCategory:a,clickTagAction:"Add Your Facility link",clickTagLabel:s,children:"Add Your Facility"})})]})}function Da({isExternalCSR:a=!1}){const s="Footer",t="Let Us Help You List",n=Bt(),r="https://help.recreation.gov/external";return e.jsxs("ul",{className:"nav-footer-list",children:[!a&&n&&e.jsx("li",{children:e.jsx(E,{appearance:"link",href:"/account/profile",clickTagCategory:s,clickTagAction:"Your Account link",clickTagLabel:t,children:"Your Account"})}),!a&&n&&e.jsx("li",{children:e.jsx(E,{appearance:"link",href:"/account/reservations",clickTagCategory:s,clickTagAction:"Your Reservations link",clickTagLabel:t,children:"Your Reservations"})}),e.jsx("li",{children:e.jsx(E,{appearance:"link",target:"_blank",rel:"noopener noreferrer",href:r,"aria-label":"Visit the help center",clickTagCategory:s,clickTagAction:"Help Center link",clickTagLabel:t,children:"Help Center"})}),e.jsx("li",{children:e.jsx(E,{appearance:"link",href:r,target:"_blank",rel:"noopener noreferrer","aria-label":"Contact us for support",clickTagCategory:s,clickTagAction:"Contact Us link",clickTagLabel:t,children:"Contact"})}),e.jsx("li",{children:e.jsx(E,{appearance:"link",href:"/feedback",target:"_blank",rel:"noopener noreferrer",clickTagCategory:s,clickTagAction:"Submit Feedback link",clickTagLabel:t,children:"Submit Feedback"})}),e.jsx("li",{children:e.jsx(E,{appearance:"link",href:"/vulnerability-disclosure-policy",clickTagCategory:s,clickTagAction:"Vulnerability Disclosure Policy link",clickTagLabel:t,children:"Vulnerability Disclosure Policy"})})]})}const jo="/shared/sitepass/img/partner-icons-white@2x.webp",Na={BLM:{title:"Bureau of Land Management",offset:0},DOT:{title:"Department of Transportation",offset:-50},NOAA:{title:"National Oceanic and Atmospheric Administration",offset:-100},Smithsonian:{title:"Smithsonian Institution",offset:-150},ForestService:{title:"USDA Forest Service",offset:-200},USACE:{title:"US Army Corps of Engineers",offset:-250},FWS:{title:"US Fish and Wildlife Service",offset:-300},NPS:{title:"National Park Service",offset:-350},TRE:{title:"Bureau of Engraving and Printing",offset:-400},BEP:{title:"Bureau of Engraving and Printing",offset:-400},PT:{title:"Presidio Trust",offset:-450},TVA:{title:"Tennessee Valley Authority",offset:-500},DOI:{title:"Bureau of Reclamation",offset:-550},NationalArchives:{title:"National Archives",offset:-600},NDW:{title:"Naval District Washington",offset:-650}};function So({iconName:a,size:s="md",showTitle:t=!1,...n}){if(!a||!Na?.[a])return null;const{title:r,offset:o}=Na[a];return e.jsx("div",{"data-component":"r1s-partner-icon","data-size":s,title:t?r:void 0,role:"img","aria-label":r,...n,children:e.jsx("div",{className:"sprite",style:{backgroundImage:`url(${jo})`,backgroundPosition:`${o}px ${s==="md"?0:-34}px`,backgroundSize:"698px"}})})}const Pa=[{iconName:"BLM",linkUrl:"https://www.blm.gov/",title:"Bureau of Land Management"},{iconName:"DOT",linkUrl:"https://www.fhwa.dot.gov/",title:"Federal Highway Administration"},{iconName:"NOAA",linkUrl:"https://www.noaa.gov/",title:"National Oceanic Atmosphere Administration"},{iconName:"Smithsonian",linkUrl:"https://www.si.edu/",title:"Smithsonian Institution"},{iconName:"ForestService",linkUrl:"https://www.fs.usda.gov/",title:"USDA Forest Service"},{iconName:"USACE",linkUrl:"https://www.usace.army.mil/Missions/Civil-Works/Recreation/",title:"US Army Corps of Engineers"},{iconName:"FWS",linkUrl:"https://www.fws.gov",title:"US Fish and Wildlife Service"},{iconName:"NPS",linkUrl:"https://www.nps.gov/index.htm",title:"National Park Service"},{iconName:"TRE",linkUrl:"https://www.moneyfactory.gov",title:"Bureau of Engraving and Printing"},{iconName:"PT",linkUrl:"https://presidio.gov/about/presidio-trust",title:"Presidio Trust"},{iconName:"TVA",linkUrl:"https://www.tva.gov",title:"Tennessee Valley Authority"},{iconName:"DOI",linkUrl:"https://www.usbr.gov",title:"Bureau of Reclamation"},{iconName:"NationalArchives",linkUrl:"https://www.archives.gov",title:"National Archives"},{iconName:"NDW",linkUrl:"https://www.navyregionmwrndw.com",title:"Naval District Washington"}];function wa({isFooterInline:a}){const{isSmAndDown:s,isLgAndUp:t}=ls(),{ndwContent:n}=_e(),r=Pa.filter(l=>l.title!=="Naval District Washington"),o=n?r:Pa;return e.jsx("ul",{className:"nav-footer-list",children:o.map(({title:l,linkUrl:c,iconName:d})=>e.jsx("li",{children:a||s?e.jsx(Ie,{url:c,children:l}):e.jsx(Ie,{url:c,children:e.jsx(So,{iconName:d,size:t?"lg":"md",showTitle:!0,className:"r1s-partner-icon"})})},l))})}const Oa=[/^\/search.*/,/^\/trips.*/,/^\/campgrounds\/(.+)\/campsites/,/^\/camping\/campgrounds\/(.+)\/campsites/,/^\/camping\/campgrounds\/(.+)\/availability/,/^\/camping\/campgrounds\/(.+)\/itinerary/,/^\/ticket\/(.+)\/tours/,/\/availability\//,/^\/vehiclepermits\/(.+)\/availability/],ka=[/^\/trips\/new/];function Ro(a){const s={};let t=!0;if(a&&(t=s[a],!t)){t=!0;let n=!1;for(let r=0,o=ka.length;r{const d=setInterval(()=>{const h=document.querySelector("df-messenger")?.shadowRoot;if(h?.appendChild){clearInterval(d);const u=h?.children[1]?.children[0]?.shadowRoot?.children[1]?.children[2]?.shadowRoot?.children[1].children[1].children[0],p=h?.children[1].children[1],m=Array.from(p?.children).filter(f=>f.tagName==="IMG")[0];p.onfocus=()=>{p?.style.setProperty("outline","#000000 solid 3px")},p.onblur=()=>{p?.style.setProperty("outline","#000000 solid 0px")},m?.setAttribute("alt","Ask a Question"),u?.setAttribute("tabindex","-1"),p?.setAttribute("aria-label","Click here to Ask a Question"),u?.setAttribute("aria-label","Search something"),p?.addEventListener("focus",()=>{u?.getAttribute("tabindex")==="-1"?(u?.setAttribute("tabindex","2"),p?.setAttribute("tabIndex","1")):u?.setAttribute("tabindex","-1")})}},1e3)};y.useEffect(()=>{o()},[]);const l=()=>{};if(!n)return null;if(Ei())return e.jsx("footer",{});if(Ka()){const d=[{linkCopy:"Rules & Reservation Policies",path:"https://www.recreation.gov/rules-reservation-policies",altText:"Rules & Reservation Policies for Recreation.gov"},{linkCopy:"Accessibility",path:"https://www.recreation.gov/accessibility",altText:"Accessibility for Recreation.gov"},{linkCopy:"FOIA",path:"https://www.recreation.gov/foia",altText:"Freedom of Information Act"},{linkCopy:"Privacy Policy",path:"https://www.recreation.gov/privacy-policy",altText:"Privacy Policy for Recreation.gov"},{linkCopy:"Disclaimers",path:"https://www.recreation.gov/disclaimers",altText:"Disclaimers for Recreation.gov"},{linkCopy:"Mobile App",path:"https://www.recreation.gov/mobile-app",altText:"Recreation.gov Mobile App"},{linkCopy:"Contact Us",path:"https://help.recreation.gov/external?id=external_contact_us",altText:"Contact Recreation.gov",pathIsExternal:!0},{linkCopy:"Help Center",path:"https://help.recreation.gov/external",altText:"Find Help on Recreation.gov",pathIsExternal:!0}];return e.jsx("footer",{role:a?void 0:"contentinfo","aria-label":"Footer",className:Be("r1s-nav-footer",{inline:a}),id:"footer",children:e.jsxs("div",{children:[e.jsxs("ul",{className:"rec-primary-color-blocks",children:[e.jsx("li",{}),e.jsx("li",{}),e.jsx("li",{}),e.jsx("li",{}),e.jsx("li",{})]}),e.jsx(Z,{background:"dark-blue",className:"pb-1 pb-md-1 pt-3",children:e.jsxs($e,{children:[e.jsx(O,{children:e.jsx(S,{className:"mb-lg-3 mb-xl-0",children:e.jsx(Q,{headingLevel:3,appearance:"h5",className:"mb-1",children:"Additional Resources"})})}),e.jsx(O,{className:"nav-footer-bottom-wrapper",children:e.jsx(S,{className:"nav-footer-list-wrap",children:e.jsx("ul",{className:"nav-footer-inline-list",children:d.map((h,u)=>e.jsx("li",{className:u>0?"ml-2":"",children:e.jsx(Ie,{url:h.path,children:h.linkCopy})},u))})})}),e.jsx(O,{children:e.jsx(S,{children:e.jsx("div",{className:"recaptcha-message mt-2",children:e.jsxs("span",{children:["This site is protected by reCAPTCHA and the Google"," ",e.jsx(Ie,{url:"https://policies.google.com/privacy",children:"Privacy Policy"})," ","and"," ",e.jsx(Ie,{url:"https://policies.google.com/terms",children:"Terms of Service"})," ","apply."]})})})})]})}),e.jsx(Z,{background:"dark-blue",paddingY:"md",children:e.jsx($e,{children:e.jsx(O,{className:"nav-footer-bottom-wrapper",children:e.jsx(S,{lgOrder:1,className:"nav-copyright",children:e.jsx(D,{color:"white",size:"sm",children:Et})})})})})]})})}const c=[{heading:"About",content:e.jsx(Ca,{})},{heading:"Plan a Trip",content:e.jsx(Ia,{})},{heading:"Get Involved",content:e.jsx(Aa,{})},{heading:"Help & Support",content:e.jsx(Da,{isExternalCSR:r})},{heading:"Our Partners",content:e.jsx(wa,{isFooterInline:a})}];return e.jsxs("footer",{role:a?void 0:"contentinfo","aria-label":"Footer",className:Be("r1s-nav-footer",{inline:a}),id:"footer",children:[e.jsxs("div",{children:[e.jsxs("ul",{className:"rec-primary-color-blocks",children:[e.jsx("li",{}),e.jsx("li",{}),e.jsx("li",{}),e.jsx("li",{}),e.jsx("li",{})]}),e.jsx(Z,{background:"dark-blue",className:"pb-1 pb-md-6 pt-6",children:e.jsxs($e,{children:[e.jsxs(O,{children:[e.jsx(S,{md:12,lg:5,className:"nav-footer-copy-wrap",children:e.jsxs(H,{space:"sm",children:[e.jsx(Q,{headingLevel:2,appearance:"h5",children:"Bring Home a Story!"}),e.jsx(D,{color:"white",className:"mb-4 mb-lg-0",children:"Recreation.gov is the government's centralized travel planning platform and reservation system for 14 federal agencies, offering the tools, tips, and information needed for you to discover destinations and activities, plan a trip, and explore outdoor and cultural destinations in your zip code and across the country. Find and reserve incredible experiences that help you bring home a story through Recreation.gov!"})]})}),e.jsx(S,{sm:12,lg:7,xxl:6,xxlOffset:1,className:"nav-footer-list-wrap",children:e.jsxs(O,{children:[e.jsxs(S,{md:3,lg:12,xl:3,className:"mb-lg-3 mb-xl-0",children:[e.jsx(Q,{headingLevel:3,appearance:"h5",className:"mb-1",children:c[0].heading}),e.jsx(Ca,{})]}),e.jsxs(S,{md:3,lg:12,xl:3,className:"mb-lg-3 mb-xl-0",children:[e.jsx(Q,{headingLevel:3,appearance:"h5",className:"mb-1",children:c[1].heading}),e.jsx(Ia,{})]}),e.jsxs(S,{md:3,lg:12,xl:3,className:"mb-lg-3 mb-xl-0",children:[e.jsx(Q,{headingLevel:3,appearance:"h5",className:"mb-1",children:c[2].heading}),e.jsx(Aa,{})]}),e.jsxs(S,{md:3,lg:12,xl:3,children:[e.jsx(Q,{headingLevel:3,appearance:"h5",className:"mb-1",children:c[3].heading}),e.jsx(Da,{isExternalCSR:r})]})]})})]}),e.jsx("div",{className:"nav-footer-links-accordion",children:e.jsx(Ut,{items:c})})]})}),e.jsx(Z,{background:"blue-gray",paddingY:"md",className:"nav-partners-wrap",children:e.jsx($e,{children:t&&e.jsx(wa,{isFooterInline:a})})}),e.jsx(Z,{background:"dark-blue",paddingY:"md",children:e.jsx($e,{children:e.jsxs(O,{className:"nav-footer-bottom-wrapper",children:[e.jsxs(S,{sm:12,lg:"variable",lgOrder:2,className:"nav-list-social-wrap",children:[e.jsxs("ul",{className:"nav-footer-inline-list",children:[e.jsx("li",{children:e.jsx(Ie,{url:"https://www.usa.gov/",children:"USA.gov"})}),e.jsx("li",{children:e.jsx(Ie,{url:"https://www.usda.gov/non-discrimination-statement",children:"Non-Discrimination Statement"})}),e.jsx("li",{children:e.jsx("a",{href:"/foia",children:"FOIA"})}),e.jsx("li",{children:e.jsx("a",{href:"/privacy-policy",children:"Privacy Policy"})}),e.jsx("li",{children:e.jsx("a",{href:"/disclaimers",children:"Disclaimers"})})]}),e.jsxs("ul",{className:"nav-footer-social-links",children:[e.jsx("li",{className:"social-media",children:e.jsxs(Ie,{url:vo,children:[e.jsx(k,{iconName:"facebook"}),e.jsx("span",{className:"rec-sr-only",children:"Facebook"})]})}),e.jsx("li",{className:"social-media",children:e.jsxs(Ie,{url:Eo,children:[e.jsx(k,{iconName:"instagram"}),e.jsx("span",{className:"rec-sr-only",children:"Instagram"})]})}),e.jsx("li",{className:"social-media",children:e.jsxs(Ie,{url:bo,children:[e.jsx(k,{iconName:"pinterest"}),e.jsx("span",{className:"rec-sr-only",children:"Pinterest"})]})})]})]}),e.jsx(S,{lgOrder:1,className:"nav-copyright",children:e.jsx(D,{color:"white",size:"sm",children:Et})})]})})})]}),e.jsx(un,{setAnnouncementClose:l}),e.jsx($t,{flag:"dialogflowMessengerExternal",children:!bi()&&e.jsx(_o,{})}),e.jsx(ji,{}),e.jsx(O,{justifyContent:"center",children:e.jsx(S,{className:"nav-print-only-copyright",children:e.jsx(D,{color:"black",size:"sm",children:Et})})})]})}const Io=(a=0)=>[{parentClasses:"rec-select-option",clickTagCategory:"Global Navigation",clickTagAction:"Account",text:"Account",title:"Account",ariaLabel:"Account",href:"/account/profile",badge:0,shouldHide:!1},{parentClasses:"rec-select-option rec-menu-cart",clickTagCategory:"Global Navigation",clickTagAction:"Cart",text:"Cart",title:"Cart",ariaLabel:"Cart",href:"/cart",badge:a,shouldHide:a===0},{parentClasses:"rec-select-option",clickTagCategory:"Global Navigation",clickTagAction:"Reservations",text:"Reservations",title:"Reservations",ariaLabel:"Reservations",href:"/account/reservations/upcoming",badge:0,shouldHide:!1},{parentClasses:"rec-select-option",clickTagCategory:"Global Navigation",clickTagAction:"Favorites",text:"Favorites",title:"Favorites",ariaLabel:"Favorites",href:"/account/favorites",badge:0,shouldHide:!1},{parentClasses:"rec-select-option",clickTagCategory:"Global Navigation",clickTagAction:"Passes",text:"Passes",title:"Passes",ariaLabel:"Passes",href:"/account/passes",badge:0,shouldHide:!1},{parentClasses:"rec-select-option",clickTagCategory:"Global Navigation",clickTagAction:"Availability Alerts",text:"Availability Alerts",title:"Availability Alerts",ariaLabel:"Availability Alerts",href:"/account/alerts",badge:0,shouldHide:!1}];function La({isLight:a,...s}){const t=a?"#fff":"#4e4e4f",n=a?"#77A145":"#64873a";return e.jsx("svg",{"data-component":"Icon",className:"sarsa-icon rec-icon-logo",viewBox:"0 0 355.1765 45.3194",height:"35",width:"240",...s,children:e.jsxs("g",{children:[e.jsx("path",{fill:t,d:"M310.0018 36.7862a1.1011 1.1011 0 1 1-1.1016 1.1016 1.1045 1.1045 0 0 1 1.1016-1.1016zm16.1035-10.6807V38.961c0 3.9365-2.4775 6.3584-6.1387 6.3584a7.7786 7.7786 0 0 1-5.7529-2.56l.9629-1.0186a6.132 6.132 0 0 0 4.79 2.1748c3.2207 0 4.707-2.0918 4.707-4.9v-2.4491a5.405 5.405 0 0 1-4.542 2.4219 6.2441 6.2441 0 0 1-6.2207-6.6064 6.2447 6.2447 0 0 1 6.2207-6.6064 5.3852 5.3852 0 0 1 4.68 2.6426v-2.3127zm-1.4316 3.9922a5.1678 5.1678 0 0 0-4.542-2.918c-2.8076 0-4.7344 2.2842-4.7344 5.2021s1.9268 5.2031 4.7344 5.2031a5.1678 5.1678 0 0 0 4.542-2.918zm17.1786 2.2842a6.39 6.39 0 1 1-12.7725 0 6.39 6.39 0 1 1 12.7725 0zm-1.4863 0c0-2.835-1.7617-5.2021-4.9-5.2021s-4.8994 2.3672-4.8994 5.2021 1.7617 5.2031 4.8994 5.2031 4.9-2.3672 4.9-5.2031zm3.7998-6.2764l4.7617 10.1025 4.7627-10.1025h1.4863l-6.2763 13.1035-6.2754-13.1035zM0 2.2012h9.1436c7.792 0 12.2832 4.49 12.2832 10.7129 0 8.17-7.1426 10.28-9.7939 10.5508l10.8212 16.6113h-3.4082L8.4405 23.627h-5.627v16.4492H0zm9.3067 18.7207c5.6807 0 9.1982-3.03 9.1982-8.0078s-3.5713-8.0078-9.1982-8.0078H2.8135v16.0156zm22.5596-1.5694h16.882V21.95h-16.882v15.5285h18.5048v2.5977H29.0528V2.2012h20.9931v2.5967H31.8663zM86.5664 32.501l1.9482 1.9482A18.2882 18.2882 0 0 1 74.5 40.7256c-10.93 0-18.7207-8.6572-18.7207-19.5869S63.5704 1.5518 74.5 1.5518a18.0068 18.0068 0 0 1 13.4737 5.789l-2.002 1.84A15.229 15.229 0 0 0 74.5 4.3108c-9.4141 0-15.7988 7.5215-15.7988 16.8281S65.086 37.966 74.5 37.966a15.6363 15.6363 0 0 0 12.0664-5.465zm8.0049-30.2998h9.1436c7.792 0 12.2832 4.49 12.2832 10.7129 0 8.17-7.1426 10.28-9.7939 10.5508l10.8213 16.6113h-3.4082L103.0118 23.627h-5.627v16.4492h-2.8135zm9.307 18.7207c5.6807 0 9.1982-3.03 9.1982-8.0078s-3.5713-8.0078-9.1982-8.0078h-6.4935v16.0156zm22.5592-1.5694h16.8818V21.95h-16.8818v15.5285h18.5049v2.5977h-21.3183V2.2012h20.9932v2.5967h-18.18zm66.9248-14.5546h-11.417V2.2012h25.6475v2.5967h-11.417v35.2783h-2.8135z"}),e.jsx("path",{fill:n,d:"M152.746 40.077h-3l19.029-38.28 18.888 38.28h-2.991l-15.917-32.26-16.009 32.26m70.699-20.252l1.592-1.23-5.542-7.17V5.068l3.95 5.111 1.592-1.231L218.12 0l-6.917 8.948 1.592 1.231 3.886-5.028v6.358l-5.478 7.086 1.592 1.23 3.886-5.027v6.356l-5.478 7.087 1.592 1.231 3.886-5.028v15.632h2.814V24.36l3.95 5.112 1.592-1.231-5.542-7.17v-6.357l3.95 5.111"}),e.jsx("path",{fill:t,d:"M277.4932 2.2012l23.2666 33.0049V2.2012h2.8135v37.875h-2.8135L277.4932 6.9619v33.1143h-2.8135V2.2012z"}),e.jsx("path",{fill:n,d:"M249.6524 16.9594a4.2876 4.2876 0 0 0-.8349-.0821 4.2611 4.2611 0 0 0-4.1488 5.2321l-4.4192 7.5987 7.5989-4.4192a4.2614 4.2614 0 0 0 5.15-4.9835l4.39-7.736zm.3923 5.4051a1.7335 1.7335 0 1 1 0-2.4516 1.7335 1.7335 0 0 1 0 2.4516z"}),e.jsx("path",{fill:t,d:"M246.3183 4.5142V1.7308c-8.6708 1.1242-15.0434 8.0292-16.0614 16.9079h2.9336c.9267-7.2966 5.8791-13.0423 13.1278-14.1245zm.0008 36.0341v-2.7861c-7.25-1.0818-12.2019-6.827-13.1287-14.1236h-2.9346c1.0125 8.8828 7.3541 15.7902 16.0633 16.9097zm5-2.7862v2.786c8.7092-1.12 15.0505-8.0272 16.0627-16.9094h-2.9345c-.9268 7.2962-5.879 13.0413-13.1282 14.1234zm-.0008-36.0313v2.7834c7.25 1.0823 12.2019 6.8279 13.1287 14.1245h2.9336C266.3628 9.76 259.9903 2.855 251.3183 1.7308z"})]})})}function Ao(a){return e.jsx("svg",{viewBox:"0 0 64 44",width:"64",height:"44",xmlns:"http://www.w3.org/2000/svg",...a,children:e.jsxs("g",{children:[e.jsx("path",{d:"m0 0h64v44h-64z",fill:"#fff"}),e.jsx("path",{d:"m0 0h32v28h-32z",fill:"#1e34b2"}),e.jsxs("g",{fill:"#fff",children:[e.jsx("path",{d:"m4 4h4v4h-4z"}),e.jsx("path",{d:"m12 4h4v4h-4z"}),e.jsx("path",{d:"m20 4h4v4h-4z"}),e.jsx("path",{d:"m8 12h4v4h-4z"}),e.jsx("path",{d:"m16 12h4v4h-4z"}),e.jsx("path",{d:"m24 12h4v4h-4z"}),e.jsx("path",{d:"m4 20h4v4h-4z"}),e.jsx("path",{d:"m12 20h4v4h-4z"}),e.jsx("path",{d:"m20 20h4v4h-4z"})]}),e.jsx("path",{d:"m32 0h32v4h-32z",fill:"#db3f1f"}),e.jsx("path",{d:"m32 8h32v4h-32z",fill:"#db3f1f"}),e.jsx("path",{d:"m32 16h32v4h-32z",fill:"#db3f1f"}),e.jsx("path",{d:"m32 24h32v4h-32z",fill:"#db3f1f"}),e.jsx("path",{d:"m0 32h64v4h-64z",fill:"#db3f1f"}),e.jsx("path",{d:"m0 40h64v4h-64z",fill:"#db3f1f"})]})})}function Do(a){return e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a,children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22.1951 20.6943C22.6423 20.6943 23 21.0786 23 21.4629V23H1V21.4629C1 20.9825 1.35772 20.6943 1.80488 20.6943H22.1951ZM6.90244 8.87772V18.2926H8.33334V8.87772H11.2846V18.2926H12.7154V8.87772H15.6666V18.2926H17.0975V8.87772H20.0488V18.2926H20.7643C21.2114 18.2926 21.5691 18.6769 21.5691 19.0612V19.8297H2.43089V19.0612C2.43089 18.5808 2.78862 18.2926 3.23577 18.2926H3.95122V8.87772H6.90244ZM12 1L23 5.70742V7.24454H21.5691C21.5691 7.72489 21.2114 8.0131 20.7643 8.0131H3.23577C2.78862 8.0131 2.43089 7.62882 2.43089 7.24454H1V5.70742L12 1Z",fill:"currentColor"})})}function No(){const[a,s]=y.useState(!1),{officialGovernmentWebsiteBanner:t}=_e();return t?e.jsx("section",{className:"r1s--site-banner","aria-label":"Official website of the United States government,,,,,,",children:e.jsxs("div",{className:"accordion",children:[e.jsx("header",{className:"header",children:e.jsxs("div",{className:"header-inner",children:[e.jsx(Ao,{width:16,height:11,"aria-hidden":"true",className:"flag"}),e.jsxs("div",{className:"text-group","aria-hidden":"true",children:[e.jsx("div",{children:"An official website of the United States government"}),e.jsx("div",{className:"faux-button",children:e.jsxs("div",{className:"faux-button-inner",children:[e.jsx("span",{children:"Here’s how you know"}),e.jsx(k,{iconName:a?"chevron-down":"chevron-right",size:"sm"})]})})]}),e.jsx("button",{type:"button",className:"button","aria-expanded":a,"aria-controls":"gov-banner",onClick:()=>{s(n=>!n)},children:e.jsxs("span",{className:"button-text",children:[e.jsx("span",{children:"Here’s how you know"}),e.jsx(k,{iconName:a?"chevron-down":"chevron-right",size:"sm"})]})})]})}),e.jsx("div",{className:Be("accordion-content",{"is-open":a}),id:"gov-banner",children:e.jsx(Po,{})})]})}):null}function Po(){return e.jsx("div",{className:"how-you-know",children:e.jsxs("div",{className:"inner",children:[e.jsxs("div",{className:"item",children:[e.jsx("div",{className:"icon-wrap gov",children:e.jsx(Do,{"aria-hidden":"true"})}),e.jsxs(At,{children:[e.jsx(D,{tag:"div",fontWeight:"semibold",size:"lg",children:"Official websites use .gov"}),e.jsxs("p",{className:"explainer mb-0",children:["A ",e.jsx("strong",{children:".gov"})," website belongs to an official government organization in the United States."]})]})]}),e.jsxs("div",{className:"item",children:[e.jsx("div",{className:"icon-wrap lock",children:e.jsx(k,{iconName:"lock",size:"lg","aria-hidden":"true"})}),e.jsxs(At,{children:[e.jsx(D,{tag:"div",fontWeight:"semibold",size:"lg",children:"Secure .gov websites use HTTPS"}),e.jsxs("p",{className:"explainer mb-0",children:["A ",e.jsx("strong",{children:"lock icon"})," or ",e.jsx("strong",{children:"https://"})," ","means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites."]})]})]})]})})}const ce="Global Navigation",wo=[{title:"Camping & Lodging",links:[{ariaLabel:"RV/Motorhome/Trailer Camping",title:"RV/Motorhome/Trailer Camping",clickTagCategory:ce,clickTagAction:"RV/Motorhome/Trailer Camping",inventoryTypes:["camping"],uiFilters:{campsiteEquipment:{"campsite-equipment-rv":{key:"campsite-equipment-rv",value:"RV/Motorhome",filters:[{attribute:"campsite_equipment_name",filterValue:"RV,RV/Motorhome"}]},"campsite-equipment-trailer":{key:"campsite-equipment-trailer",value:"Trailer",filters:[{attribute:"campsite_equipment_name",filterValue:"Trailer"}]}}}},{ariaLabel:"Tent Camping",title:"Tent Camping",clickTagCategory:ce,clickTagAction:"Tent Camping",inventoryTypes:["camping"],uiFilters:{campsiteTypes:{"campsite-type-standard":{key:"campsite-type-standard",value:"Standard",filters:[{attribute:"campsite_type",filterValue:"STANDARD ELECTRIC,STANDARD NONELECTRIC"}]},"campsite-type-tent-only":{key:"campsite-type-tent-only",value:"Tent Only",filters:[{attribute:"campsite_type",filterValue:"TENT ONLY ELECTRIC,TENT ONLY NONELECTRIC,GROUP TENT ONLY AREA NONELECTRIC"}]}}}},{ariaLabel:"Lodging (Cabins/Yurts/Lookouts)",title:"Lodging (Cabins/Yurts/Lookouts)",clickTagCategory:ce,clickTagAction:"Lodging (Cabins/Yurts/Lookouts)",inventoryTypes:["camping"],uiFilters:{campsiteTypes:{"campsite-type-cabin":{key:"campsite-type-cabin",value:"Cabin",filters:[{attribute:"campsite_type",filterValue:"CABIN ELECTRIC,CABIN NONELECTRIC"}]},"campsite-type-lookout":{key:"campsite-type-lookout",value:"Lookout",filters:[{attribute:"campsite_type",filterValue:"LOOKOUT"}]},"campsite-type-yurts":{key:"campsite-type-yurts",value:"Yurts",filters:[{attribute:"campsite_type",filterValue:"YURT"}]}}}}]},{title:"Activities",links:[{ariaLabel:"Permits",title:"Permits",clickTagCategory:ce,clickTagAction:"Permits",inventoryTypes:["permits"],uiFilters:void 0},{ariaLabel:"Activity Passes",title:"Activity Passes",clickTagCategory:ce,clickTagAction:"Activity Passes",inventoryTypes:["activitypass"],uiFilters:void 0},{ariaLabel:"Tickets and Tours",title:"Tickets and Tours",clickTagCategory:ce,clickTagAction:"Tickets and Tours",inventoryTypes:["tours"],uiFilters:void 0},{ariaLabel:"Lotteries",title:"Lotteries",clickTagCategory:ce,clickTagAction:"Lotteries",url:"/lottery/available",uiFilters:void 0},{ariaLabel:"Christmas Trees (Seasonal)",title:"Christmas Trees (Seasonal)",clickTagCategory:ce,clickTagAction:"Christmas Trees (Seasonal)",inventoryTypes:["treepermit"],uiFilters:void 0}]},{title:"Visit for the Day",links:[{url:"/pass",ariaLabel:"Passes",title:"Passes",target:"_self",clickTagCategory:ce,clickTagAction:"Passes"},{ariaLabel:"Timed Entry / Vehicle Reservations",title:"Timed Entry / Vehicle Reservations",clickTagCategory:ce,clickTagAction:"Timed Entry / Vehicle Reservations",inventoryTypes:["tours"],uiFilters:void 0},{ariaLabel:"Day Use",title:"Day Use",clickTagCategory:ce,clickTagAction:"Day Use",inventoryTypes:["dayuse","venuereservations"],uiFilters:void 0}]},{title:"Get Help",links:[{url:"https://help.recreation.gov/external",ariaLabel:"Help Center",title:"Help Center",target:"_blank",clickTagCategory:ce,clickTagAction:"Help Center"},{url:"/articles",ariaLabel:"Tips and Tricks",title:"Tips and Tricks",target:"_self",clickTagCategory:ce,clickTagAction:"Tips and Tricks"},{url:"/trips/new",ariaLabel:"Trip Builder",title:"Trip Builder",target:"_self",clickTagCategory:ce,clickTagAction:"Trip Builder"},{url:"/rules-reservation-policies",ariaLabel:"Rules and Reservation Policies Center",title:"Rules and Reservation Policies Center",target:"_self",clickTagCategory:ce,clickTagAction:"Rules and Reservation Policies Center"},{url:"https://help.recreation.gov/external?id=external_contact_us",ariaLabel:"Contact Us",title:"Contact Us",target:"_blank",clickTagCategory:ce,clickTagAction:"Contact Us"}]},{title:"About Us",links:[{url:"/about-us",ariaLabel:"About Recreation.gov",title:"About Recreation.gov",target:"_self",clickTagCategory:ce,clickTagAction:"About Recreation.gov"},{url:"/accessibility",ariaLabel:"Accessibility",title:"Accessibility",target:"_self",clickTagCategory:ce,clickTagAction:"Accessibility"}]}];function Oo(){return wo}i.node,i.number,i.bool,i.func;i.string,i.node,i.number,i.string,i.string,i.string;i.string,i.string;i.shape({caseStudies:i.array,topKBAs:i.array});const ko="/shared/sitepass/img/media-center-hero-lg.avif",Lo="/shared/sitepass/img/media-center-hero-lg.jpg",Mo="/shared/sitepass/img/media-center-hero-lg.webp",Fo="/shared/sitepass/img/media-center-hero-md.avif",Yo="/shared/sitepass/img/media-center-hero-md.jpg",$o="/shared/sitepass/img/media-center-hero-md.webp",Bo="/shared/sitepass/img/media-center-hero-sm.avif",Uo="/shared/sitepass/img/media-center-hero-sm.jpg",zo="/shared/sitepass/img/media-center-hero-sm.webp",Vo={avif:{lg:ko,md:Fo,sm:Bo},webp:{lg:Mo,md:$o,sm:zo},jpg:{lg:Lo,md:Yo,sm:Uo}},Go=[{className:"promise",title:"Our Promise",text:"Recreation.gov empowers people to dream, plan, experience and share our National treasures, as well as share their memorable experiences to inspire others. Our promise is that you'll bring home a story.",linkText:"Learn More",linkUrl:"/about-us",target:"_top",rel:"noopener noreferrer",aria:"Learn more about Recreation.gov"},{className:"contact",title:"Get in Touch",text:"Our team loves working with journalists to share compelling, unique stories. If you're a member of the media and would like to talk, please send an email to mediacenter@recreation.gov.",linkText:"Contact Us",linkUrl:"mailto:mediacenter@recreation.gov",target:"_blank",rel:"noopener noreferrer",aria:"Contact the Recreation.gov media team"}];class Hm extends Mt.PureComponent{render(){return e.jsxs(e.Fragment,{children:[e.jsx(Si,{title:"Media Center",imageSrcConfig:Vo,backgroundImageAltText:"A lake surrounded by trees",backgroundImageColorOverlay:"#2F4668"}),e.jsx("section",{className:"nav-media-center-call-outs mb-5",children:e.jsx(O,{justifyContent:"center",children:e.jsx(S,{xl:10,lg:12,children:e.jsx(O,{children:Go.map((s,t)=>e.jsx(S,{md:6,children:e.jsxs("div",{className:`nav-media-center-call-out-${s.className} p-3 p-md-5`,children:[e.jsx(Q,{headingLevel:2,appearance:"h4",className:"mb-2",children:s.title}),e.jsx("p",{children:s.text}),e.jsx(E,{appearance:"tertiary-white",href:s.linkUrl,target:s.target,rel:s.rel,iconAfterElement:e.jsx(k,{iconName:"arrow-forward"}),"aria-label":s.aria,children:s.linkText})]})},t))})})})})]})}}function Ho({children:a,className:s,...t}){return e.jsx("div",{"data-component":"AppBase",className:Be("shared-app-base",s),...t,children:a})}function qo(a){return e.jsx($e,{...a,children:e.jsx(Z,{alignX:"center",children:e.jsx(ke,{type:"error",heading:"Something went wrong",headingLevel:1,children:"Sorry, an unexpected error occurred. Refresh the page and try again."})})})}function Wo({alerts:a,className:s,...t}){const n=Ft(),r=y.useRef(null),o=y.useRef(null),[l,c]=y.useState(!1),[d,h]=y.useState(!1),[u,p]=y.useState(!1);if(y.useLayoutEffect(()=>{const T=r.current;if(!T)return()=>{};u||c(T?.scrollHeight>T?.clientHeight),h(T?.scrollHeight>T?.clientHeight);const x=new ResizeObserver(()=>{u||c(T?.scrollHeight>T?.clientHeight),h(T?.scrollHeight>T?.clientHeight)});return x.observe(T),()=>{x.disconnect()}},[u,a?.length]),y.useEffect(()=>{const T=r.current;if(!T)return()=>{};const x=()=>{T.scrollTop=0},b=()=>{T.scrollTop=0;const A=document.activeElement;!u&&A.offsetTop>24&&p(!0)};return T.addEventListener("focusin",b),T.addEventListener("focusout",x),()=>{T?.removeEventListener("focusin",b),T?.removeEventListener("focusout",x)}}),!a||!a?.[0]?.body)return null;const[m,...f]=a,g=a.length>1||d||l;return e.jsx("div",{className:Be("shared--facility-alert-banner",s,{"has-toggle-button":g}),...t,children:e.jsx($e,{children:e.jsxs("div",{className:"content",children:[e.jsxs(At,{width:"lg",className:"content-alerts",id:"facility-alert-banner-alerts",children:[e.jsx(ke,{hasBoxStyling:!1,children:e.jsx("div",{ref:r,className:u?void 0:"is-collapsed",children:e.jsx(Ue,{html:`
${m.body}
`})})}),u?f.map(T=>e.jsxs(y.Fragment,{children:[e.jsx(is,{color:"yellow",className:"my-2"}),e.jsx(ke,{hasBoxStyling:!1,children:e.jsx(Ue,{html:T.body},T.id)},T.id)]},T.id)):null]}),e.jsx("div",{className:"toggle-button-wrap",children:g?e.jsx(E,{isUnstyled:!0,"aria-expanded":u,"aria-controls":"facility-alert-banner-alerts",className:"toggle-button",onClick:()=>p(T=>!T),clickTagCategory:"Facility Alert Banner Toggle",clickTagAction:u?"Close Expanded Alert":"Expand Alert",clickTagLabel:`Facility Alert Banner on ${n.pathname}`,"aria-label":u?"Facility Alerts: Show Less":"Facility Alerts: Show More",innerRef:o,children:e.jsxs("span",{className:"inner",children:[e.jsx(Ri,{className:"alert-badge-total-items",children:a.length}),e.jsx("span",{children:d?"Show More":"Show Less"})]})}):null})]})})})}function pn(){const a=Ci();return e.jsx(Wo,{alerts:a})}const mn="CAMPING",Ko="TICKET",Zo="TIMED_ENTRY",Qo="LOTTERY_CAMPING",Xo="PARKPASS",Jo="POS",Ma={agencyName:"Not Found",facilityId:"Not Found",facilityName:"Not Found",recAreaId:"Not Found",recAreaName:"Not Found",stateCode:"Not Found"},el=(a,s)=>{let t=null;switch(a){case mn:t=`Site: ${s.product_description} - Loop: ${s.product_name}`;break;default:t=`${s.product_description} - ${s.product_name}`}return t},sl=a=>{let s=a?.order_details?.location_id;const t=a?.inventory_type;if(t)switch(t){case Ko:case Zo:s+=`|${a?.order_details?.tour_id}`;break;case mn:case Qo:s+=`|${a?.order_details?.campsite_id}`;break}return{productId:s,category:t}},bt=new Map,fn=async a=>{if(bt.has(a))return bt.get(a);try{const s=await fetch(`/api/search?fq=entity_id:${a}`),{results:t}=await s.json();if(!t?.length)return console.warn("Couldn't find rec area info for facilityId:",a,` Not sending Analytics event.`),Ma;const n=t[0].entity_type==="recarea",r={agencyName:t[0].org_name,facilityId:a,facilityName:t[0].name,recAreaId:n?t[0].entity_id:t[0].parent_id,recAreaName:n?t[0].name:t[0].parent_name,stateCode:t[0].state_code};return bt.set(a,r),r}catch(s){return console.error("Error fetching rec area info:",s),Ma}},tl=async a=>{const s=a.map(async(t,n)=>{const r=await fn(t?.order_details?.facility_id||t?.order_details?.location_id),{recAreaId:o,recAreaName:l,stateCode:c,agencyName:d,facilityName:h}=r,u={...t,rec_area_id:o,rec_area_name:l,state_code:c,agency_name:d,facility_name:h};let p=u?.quantity??1;p||(p=u?.cart_line_items?.length?u.cart_line_items.filter(N=>oo(N.quantity)).reduce((N,L)=>N+L.quantity,0):1);const m=u.inventory_type===Jo?u.order_details.name:u.order_details.description,f=parseFloat(parseFloat(u.discount).toFixed(2)),g=parseFloat(parseFloat(u.subtotal).toFixed(2)),T=parseFloat(((g-f)/p).toFixed(2)),{productId:x,category:b}=sl(u),A=el(b,u.order_details);let C;return u.order_details?.camping_type_of_use&&(C=Array.isArray(u.order_details?.camping_type_of_use)?u.order_details?.camping_type_of_use.join(", "):u.order_details?.camping_type_of_use),Ai({index:n+1,item_brand:"Recreation.gov",item_id:x,item_name:m,agency_name:u.agency_name,state_code:u.state_code,rec_area_id:u.rec_area_id,rec_area_name:u.rec_area_name,facility_id:va(x,0),facility_name:u.facility_name,inventory_id:va(x,1),inventory_name:A,item_category:b,quantity:p,price:T,...typeof C<"u"&&{type_of_use:C}})});return Promise.all(s)},gn=async(a,s,t,n)=>{if(!a?.length)return null;try{const r=a?.[0]?.order_id,o=await tl(a);return Ii({id:r,step_number:t+1,items:o,checkoutPaymentInfo:n})}catch(r){return console.error(r),null}},al=()=>{try{sessionStorage.setItem(Di,window?.location?.href)}catch(a){console.error(a)}},nl=({itemLevel:a,facilityId:s,itemCategory:t,itemId:n,itemName:r,inventoryId:o,inventoryName:l,price:c,eventType:d="view_item",isDataLoading:h=!1,typeOfUse:u})=>{const p=y.useRef(!1);y.useEffect(()=>{if(!(!s||p.current||h)&&!p.current)try{fn(s).then(m=>{const{agencyName:f,facilityName:g,recAreaId:T,recAreaName:x,stateCode:b}=m;let A;u&&(A=Array.isArray(u)?u.join(", "):u);const C={index:1,item_brand:"Recreation.gov",item_id:n||o||s,item_name:r||l||g,item_level:a,agency_name:f,state_code:b,rec_area_id:T,rec_area_name:x,...typeof A<"u"&&{type_of_use:A}};(a==="Facility"||a==="Registration Detail"||a==="Pass Selection")&&(C.facility_id=s,C.facility_name=g,C.item_category=t),window.dataLayer&&window.dataLayer.push({event:d,ecommerce:{items:[C]}})}).then(()=>{p.current=!0})}catch(m){console.error(m)}},[d,s,o,l,t,n,a,r,c,h,u])},yn="GET_CART",rl="CART_ERROR",il="GET_CHECKOUT",ol="UPDATE_CHECKOUT_PAYMENT_TYPE",ll="FINALIZE_CHECKOUT",cl="FINALIZE_NOFEE",dl="FETCH_CHECKOUT_ERROR",jt="FINALIZE_CHECKOUT_ERROR",hl="INITIATE_ALREADY_PAID",ul="RATE_LIMIT_EXCEEDED",pl="REMOVE_RESERVATION_ERROR",ml="PARKPASS",ie="PARKPASS_",Tn=`${ie}FETCH_FACILITIES`,_n=`${ie}FETCH_FACILITY`,xn=`${ie}FETCH_FACILITY_BY_ID_OR_SLUG`,vn=`${ie}FETCH_PASS_TYPES`,En=`${ie}FETCH_PASS_TYPE`,bn=`${ie}FETCH_RESERVATIONS`,jn=`${ie}CREATE_RESERVATIONS`,Sn=`${ie}UPDATE_RESERVATION`,fl=`${ie}RESET_RESERVATIONS`,gl=`${ie}GET_QR_CODES_SUCCESS`,rs=`${ie}VALIDATE_RESERVATIONS`,Rn=`${ie}VALIDATE_RESERVATIONS_CLEAR`,yl="SHOW_SIGN_IN_GUEST_MODAL",Cn=`${ie}ADD_RESERVATION`,In=`${ie}DELETE_LOCAL_RESERVATION`,cs="/api/parkpass",Tl="/sitepass",_l=10,xl={"personal-vehicle":"Personal Vehicle","rental-vehicle":"Rental Vehicle","no-vehicle":"No Vehicle",camper:"Camper"},vl={"motorized-boat":"Motorized Boat","non-motorized-boat":"Non-Motorized Boat","rental-boat":"Rental Boat","no-boat":"No Boat"},Gt={annual:{name:"Annual",validLength:"12 months",days:365,endEndOfMonth:!0},"12-month":{name:"Twelve Month",validLength:"12 Months",days:365,endEndOfMonth:!1},semiannual:{name:"Semiannual",validLength:"6 Months",days:180,endEndOfMonth:!0},"6-month":{name:"Six Month",validLength:"6 Months",days:180,endEndOfMonth:!1},segment:{name:"Segment",validLength:"Flexible",days:-1,endEndOfMonth:!1},seasonal:{name:"Seasonal",validLength:"Seasonal",days:-1,endEndOfMonth:!1},season:{name:"Seasonal",validLength:"Seasonal",days:-1,endEndOfMonth:!1},"14-day":{name:"Fourteen day",validLength:"14 Days",days:14,endEndOfMonth:!1},"13-day":{name:"Thirteen day",validLength:"13 Days",days:13,endEndOfMonth:!1},"12-day":{name:"Twelve day",validLength:"12 Days",days:12,endEndOfMonth:!1},"11-day":{name:"Eleven day",validLength:"11 Days",days:11,endEndOfMonth:!1},"10-day":{name:"Ten day",validLength:"10 Days",days:10,endEndOfMonth:!1},"9-day":{name:"Nine day",validLength:"9 Days",days:9,endEndOfMonth:!1},"8-day":{name:"Eight day",validLength:"8 Days",days:8,endEndOfMonth:!1},"7-day":{name:"Week",validLength:"7 Days",days:7,endEndOfMonth:!1},"6-day":{name:"Six day",validLength:"6 Days",days:6,endEndOfMonth:!1},"5-day":{name:"Five day",validLength:"5 Days",days:5,endEndOfMonth:!1},"4-day":{name:"Four day",validLength:"4 Days",days:4,endEndOfMonth:!1},"3-day":{name:"Three day",validLength:"3 Days",days:3,endEndOfMonth:!1},"2-day":{name:"Two day",validLength:"2 Days",days:2,endEndOfMonth:!1},"1-day":{name:"One day",validLength:"1 Day",days:1,endEndOfMonth:!1},"14-day-offline":{name:"Fourteen day",validLength:"14 Days",days:14,endEndOfMonth:!1},"13-day-offline":{name:"Thirteen day",validLength:"13 Days",days:13,endEndOfMonth:!1},"12-day-offline":{name:"Twelve day",validLength:"12 Days",days:12,endEndOfMonth:!1},"11-day-offline":{name:"Eleven day",validLength:"11 Days",days:11,endEndOfMonth:!1},"10-day-offline":{name:"Ten day",validLength:"10 Days",days:10,endEndOfMonth:!1},"9-day-offline":{name:"Nine day",validLength:"9 Days",days:9,endEndOfMonth:!1},"8-day-offline":{name:"Eight day",validLength:"8 Days",days:8,endEndOfMonth:!1},"7-day-offline":{name:"Week",validLength:"7 Days",days:7,endEndOfMonth:!1},"6-day-offline":{name:"Six day",validLength:"6 Days",days:6,endEndOfMonth:!1},"5-day-offline":{name:"Five day",validLength:"5 Days",days:5,endEndOfMonth:!1},"4-day-offline":{name:"Four day",validLength:"4 Days",days:4,endEndOfMonth:!1},"3-day-offline":{name:"Three day",validLength:"3 Days",days:3,endEndOfMonth:!1},"2-day-offline":{name:"Two day",validLength:"2 Days",days:2,endEndOfMonth:!1},"1-day-offline":{name:"One day",validLength:"1 Day",days:1,endEndOfMonth:!1}},El=["web","field"],bl=["pending","deleted","completed"],jl=["expired","refunded","voided"],Fa="MM/DD/YYYY",Sl=1e5,Ps=999,Rl=["Interagency Access Pass","Interagency Annual Senior Pass","Interagency Lifetime Senior Pass","Golden Access Pass","Golden Age Pass"],Cl=["74396"],Il=["74396"],Al="400000",Dl="10087086",Nl="10086910",Pl="10088426",wl="10089508",An="74280",Dn="74291",Ol="74418",Nn="74271",Pn="74330",Ht={[Dn]:{title:"Book your timed entry reservation before you buy a pass!",description:"Vehicle Reservations are required May 24 through Mid-October.",areaListTitle:" ",areasWithReservation:[{name:"Timed entry permit reservations for most areas of RMNP will be in place through October 14, 2024.",dates:""},{name:"Timed Entry + Bear Lake Road Road permits will continue through October 20, 2024.",dates:""}],hideBookReservationButton:!1,hideShowAvailablePassesButton:!1,timedEntryFacilityId:Nl,showPassesByDefault:!0},[An]:{title:"Book your vehicle reservation before you buy a pass!",description:"Vehicle Reservations are required May 24 through September 8th.",areaListTitle:"Areas that require a vehicle reservation:",areasWithReservation:[{name:"Going-to-the-Sun Road (West)",dates:"May 24th - September 8th"},{name:"North Fork",dates:"May 24th - September 8th"},{name:"Many Glacier",dates:"July 1st - September 8th"}],hideBookReservationButton:!1,hideShowAvailablePassesButton:!1,timedEntryFacilityId:Dl,showPassesByDefault:!1},[Nn]:{title:"Book your vehicle reservation with your pass!",description:"A vehicle reservation is required to drive Cadillac Summit Road through October 22, 2023.",areasWithReservation:[],hideBookReservationButton:!1,hideShowAvailablePassesButton:!0,timedEntryFacilityId:Al,showPassesByDefault:!0},[Pn]:{title:"Book your timed entry reservation before you buy a pass!",description:"A timed entry reservation is required to visit Arches National Park from 7 AM to 4 PM MT during peak visitation hours",areaListTitle:"Areas that require a timed entry reservation:",areasWithReservation:[{name:"Reservation required for the whole park",dates:"April 1 - October 31, 2024"}],hideBookReservationButton:!1,hideShowAvailablePassesButton:!1,timedEntryFacilityId:Pl,showPassesByDefault:!1},[Ol]:{title:"Book your timed reservation tickets with your pass!",description:"A timed reservation ticket is required to visit Lava River Cave between June 1st and September 15th",areasWithReservation:[],hideBookReservationButton:!1,hideShowAvailablePassesButton:!0,timedEntryFacilityId:wl,showPassesByDefault:!0}},kl=[Nn,Pn,Dn,An],wn="INTERAGENCY_ANNUAL_PASS",On="INTERAGENCY_ANNUAL_SENIOR_PASS",kn="INTERAGENCY_LIFETIME_SENIOR_PASS",Ln="INTERAGENCY_ACCESS_PASS",Mn="INTERAGENCY_VOLUNTEER_PASS",Fn="INTERAGENCY_MILITARY_PASS",Yn="INTERAGENCY_LIFETIME_MILITARY_PASS",$n="INTERAGENCY_GOLDEN_AGE_PASS",Bn="INTERAGENCY_GOLDEN_ACCESS_PASS",Ll={[wn]:{altText:"annual pass",fileName:"annual-pass",fallbackExtension:"png"},[On]:{altText:"annual senior pass",fileName:"senior-annual-pass",fallbackExtension:"png"},[kn]:{altText:"lifetime senior pass",fileName:"senior-lifetime-pass",fallbackExtension:"jpg"},[Ln]:{altText:"access pass",fileName:"access-pass",fallbackExtension:"jpg"},[Mn]:{altText:"volunteer pass",fileName:"volunteer-pass",fallbackExtension:"png"},[Fn]:{altText:"military pass",fileName:"military-pass",fallbackExtension:"png"},[Yn]:{altText:"lifetime military pass",fileName:"military-lifetime",fallbackExtension:"png"},[$n]:{altText:"golden age pass",fileName:"golden-age-pass",fallbackExtension:"jpg"},[Bn]:{altText:"golden access pass",fileName:"golden-access-pass",fallbackExtension:"jpg"}},Ml=[wn,On,kn,Ln,Mn,Fn,Yn,$n,Bn],Fl={vehicle:{order:1},motorcycle:{order:2},individual:{order:3},all:{order:9999}},Yl=/\[([^\]]+)\]|YYYY|YY|MMMM|MMM|MM|M|DD|Do|D|dddd|ddd|HH|H|hh|h|mm|m|ss|s|sss|SSS|A|a|ZZ|Z|z/g,Un=/^\d{13}$/,zn=/.*([+-]\d{2}:?\d{2})/,$l=/^\d{1,2}\/\d{1,2}\/\d{1,4}$/,Bl=/^\d{4}-\d{2}-\d{2}$/,Ul=/^\d{4}-\d{2}$/,zl=/^\d{2}:\d{2}:\d{2}$/,Vl=/^\d{4}$/,Gl=/^[A-Za-z]+ \d{1,2}(?:, \d{4})?$/,Hl=/^[A-Za-z]{3,4}\s[A-Za-z]{3}\s\d{2}\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT[+-]\d{4}$/,Vn=(a,s="UTC")=>{let t,n=!1;if(typeof a=="number"&&String(a).match(Un))t=Yt(a,s);else if(a.match(Gl)){let r=a.trim();if(!r.includes(",")){const d=s==="UTC"?new Date().getUTCFullYear():new Date().getFullYear();r=`${r}, ${d}`}const l=new Date(r).toISOString().slice(0,10);let c=Ts(l);c=re(c,s),c=c.set({hour:0,minute:0,second:0,millisecond:0}),t=c}else if(a.match(Hl)){const r=a.split(" "),o={Jan:1,Feb:2,Mar:3,Apr:4,May:5,Jun:6,Jul:7,Aug:8,Sep:9,Oct:10,Nov:11,Dec:12}[r[1]],l=parseInt(r[2],10),c=parseInt(r[3],10),[d,h,u]=r[4].split(":").map(f=>parseInt(f,10)),p=new ts(c,o,l,d,h,u),m=re(p,"UTC");t=s==="UTC"?m:re(m,s)}else if(a.match(Bl)){n=!0;let r=Ts(a);r=re(r,s),r=r.set({hour:0,minute:0,second:0,millisecond:0}),t=r}else if(a.match(Ul)){n=!0;const r=`${a}-01`;let o=Ts(r);o=re(o,s),o=o.set({hour:0,minute:0,second:0,millisecond:0}),t=o}else if(a.match($l)){n=!0;const r=a.split("/"),o=r[0].padStart(2,"0"),l=r[1].padStart(2,"0");let c=r[2];const d=parseInt(c,10);c?.length===1||c?.length===2?d>=0&&d<=68?c=`20${c.padStart(2,"0")}`:c=`19${c.padStart(2,"0")}`:c?.length===3&&(c=c.padStart(4,"0"));const h=`${c}-${o}-${l}`;let u=Ts(h);s!==Us()&&(u=re(u,"UTC")),u=re(u,s),t=u}else if(a.match(Vl)){n=!0;const r=`${a}-01-01`;let o=Ts(r);o=re(o,s),o=o.set({hour:0,minute:0,second:0,millisecond:0}),t=o}else if(a.match(zl)){const r=ii(a),o=It(s),l=new ts(o.year,o.month,o.day,r.hour,r.minute,r.second);t=re(l,s)}else if(a.includes("Z")||a.match(zn))t=Ct(a,s);else{let r=a;a.length>11&&a[10]===" "&&(r=`${a.substring(0,10)}T${a.substring(11)}`);const o=oi(r);t=re(o,s)}return{zoned:t,hasNoTime:n}};v.tz=(...a)=>{let s;if(a.length===2){if(a[0]===void 0)s=v(void 0).tz(a[1]||"UTC");else if(a[0]===null||typeof a[0]=="string"&&a[0]?.trim()==="")s=v(null).tz(a[1]||"UTC");else if(Array.isArray(a[0])){const t=a[0],n=t[0],r=t[1],o=t[2],l=t[3],c=t[4],d=new ts(n,r+1,o,l,c);s=re(d,a[1]||"UTC")}else if(typeof a[0]=="string"){const{zoned:t,hasNoTime:n}=Vn(a[0],a[1]||"UTC");s=t;const r=v(s);return r.hasNoTime=n,r}else{const t=a[1]!==""?a[1]:"UTC";return v(a[0]).tz(t)}return v(s)}return a.length===1?v().tz(a[0]||"UTC"):v(null)};let Te=Us();v.tz.setDefault=a=>{Te=a};v.utc=a=>{const s=v(a).utc();return s.hasNoTime&&s.set({hour:0,minute:0,second:0}),s};v.invalid=()=>v(null);class me{static formatterCache={};constructor(s){try{if(this.zonedDateTime=null,s===void 0)this.zonedDateTime=It(Te);else if(typeof s=="string"&&s!==""){const{zoned:t,hasNoTime:n}=Vn(s,Te);this.hasNoTime=n,t&&(this.zonedDateTime=ys(t),this.zonedDateTime=re(this.zonedDateTime,Te))}else if(typeof s=="number"&&String(s).match(Un))this.zonedDateTime=Yt(s,Te);else if(s instanceof Date){if(!Number.isNaN(s.getFullYear())){const t=new ts(s.getFullYear(),s.getMonth()+1,s.getDate(),s.getHours(),s.getMinutes(),s.getSeconds());this.zonedDateTime=re(t,Te)}}else if(s instanceof Hr)this.zonedDateTime=s;else if(s instanceof Ta)this.zonedDateTime=re(s,Te);else if(s instanceof me)this.zonedDateTime=s.zonedDateTime;else if(typeof s=="object"&&!Array.isArray(s)&&!se(s))if(Object.keys(s).length===1&&"seconds"in s&&(Number(s?.seconds)<0||Number(s?.seconds)>59))this.zonedDateTime=null;else{const t=ys(It(Te)),n=!se(s?.year)||!se(s?.years)?Number(s.year||s.years):t.year,r=!se(s?.month)||!se(s?.months)?Number(s.month||s.months)+1:t.month,o=!se(s?.date)||!se(s?.day)?Number(s.date||s.day):t.day,l=!se(s?.hour)||!se(s?.hours)?Number(s.hour||s.hours):0,c=!se(s?.minute)||!se(s?.minutes)?Number(s.minute||s.minutes):0,d=!se(s?.second)||!se(s?.seconds)?Number(s.second||s.seconds):0,h=new ts(n,r,o,l,c,d);this.zonedDateTime=re(h,Te)}this.inUTCMode=!1}catch(t){console.log("exception creating gnoment: ",t),this.zonedDateTime=null}}toCalendarDate(){return this.isValid()?_a(this.zonedDateTime):null}toCalendarDateTime(){return ys(this.zonedDateTime)}toZonedDateTime(){return this.zonedDateTime}getCalendarDateTime(){return this.zonedDateTime}utc(s=!1){if(!this.isValid())return this;let t;if(s){const n=new Ta(this.zonedDateTime.year,this.zonedDateTime.month,this.zonedDateTime.day),r=new qr(this.zonedDateTime.hour,this.zonedDateTime.minute),o=ys(n,r);t=re(o,"UTC")}else t=re(this.zonedDateTime,"UTC");return this.zonedDateTime=t,this.inUTCMode=!0,this}local=()=>{const s=Us();return v(this).tz(s)};unix(){return Math.floor(this.zonedDateTime.toDate().getTime()/1e3)}valueOf(){return v(this.zonedDateTime).unix()*1e3}utcOffset(s,t=!1){if(s===0)return t?v(re(ys(this.zonedDateTime),"UTC")):v(this.zonedDateTime).utc()}normalize(s){let t=s;return t=s.replace(/\+00:00\[UTC\]/g,"Z"),t=s.replace(/\[.*?\]/g,""),t}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid()?`Gnoment<${this.format()}>`:"Gnoment"}toString(){return this.isValid()?this.format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ",this.zonedDateTime.timeZone):"Invalid date"}convertOffsetToHoursMinutes=s=>{const t=Math.trunc(s/6e4),n=t>=0?"+":"-",r=Math.floor(Math.abs(t)/60),o=Math.abs(t)%60;return`${n}${String(r).padStart(2,"0")}:${String(o).padStart(2,"0")}`};getOffset=()=>this.convertOffsetToHoursMinutes(this.zonedDateTime.offset);clone=()=>new me(this.zonedDateTime);isValid(){return!!this.zonedDateTime}isSame=(s,t)=>{if(!this.isValid()||s===null)return!1;if(t){const r=this.clone().startOf(t);let o;return typeof s=="string"?o=v(s).tz(this.zonedDateTime?.timeZone).startOf(t):o=s===void 0?v(void 0).startOf(t):v(s).startOf(t),o.zonedDateTime?r.zonedDateTime.compare(o.zonedDateTime)===0:!1}if(typeof s=="string")return this.zonedDateTime.compare(v(s).tz(this.zonedDateTime?.timeZone).zonedDateTime)===0;const n=s===void 0?v(void 0).zonedDateTime:s.zonedDateTime;return n?this.zonedDateTime.compare(n)===0:!1};isSameOrBefore=(s,t)=>{if(!this.isValid()||s===null)return!1;if(t){const r=this.clone().startOf(t);let o;return typeof s=="string"?o=v(s).tz(this.zonedDateTime?.timeZone).startOf(t):o=s===void 0?v(void 0).startOf(t):v(s).startOf(t),o.zonedDateTime?r.zonedDateTime.compare(o.zonedDateTime)<=0:!1}if(typeof s=="string")return this.zonedDateTime.compare(v(s).tz(this.zonedDateTime?.timeZone).zonedDateTime)<=0;const n=s===void 0?v(void 0).zonedDateTime:s.zonedDateTime;return n?this.zonedDateTime.compare(n)<=0:!1};isBefore=(s,t)=>{if(!this.isValid()||s===null)return!1;if(t){const r=this.clone().startOf(t);let o;return typeof s=="string"?o=v(s).tz(this.zonedDateTime?.timeZone).startOf(t):o=s===void 0?v(void 0).startOf(t):v(s).startOf(t),o.zonedDateTime?r.zonedDateTime.compare(o.zonedDateTime)<0:!1}if(typeof s=="string")return this.zonedDateTime.compare(v(s).tz(this.zonedDateTime?.timeZone).zonedDateTime)<0;const n=s===void 0?v(void 0).zonedDateTime:s.zonedDateTime;return n?this.zonedDateTime.compare(n)<0:!1};isSameOrAfter=(s,t)=>{if(!this.isValid()||s===null)return!1;if(t){const r=this.clone().startOf(t);let o;return typeof s=="string"?o=v(s).tz(this.zonedDateTime?.timeZone).startOf(t):o=s===void 0?v(void 0).startOf(t):v(s).startOf(t),o.zonedDateTime?r.zonedDateTime.compare(o.zonedDateTime)>=0:!1}if(typeof s=="string")return this.zonedDateTime.compare(v(s).tz(this.zonedDateTime?.timeZone).zonedDateTime)>=0;const n=s===void 0?v(void 0).zonedDateTime:s.zonedDateTime;return n?this.zonedDateTime.compare(n)>=0:!1};isAfter=(s,t)=>{if(!this.isValid()||s===null)return!1;if(t){const r=this.clone().startOf(t);let o;return typeof s=="string"?o=v(s).tz(this.zonedDateTime?.timeZone).startOf(t):o=s===void 0?v(void 0).startOf(t):v(s).startOf(t),o.zonedDateTime?r.zonedDateTime.compare(o.zonedDateTime)>0:!1}if(typeof s=="string")return this.zonedDateTime.compare(v(s).tz(this.zonedDateTime?.timeZone).zonedDateTime)>0;const n=s===void 0?v(void 0).zonedDateTime:s.zonedDateTime;return n?this.zonedDateTime.compare(n)>0:!1};isBetween=(s,t,n,r="()")=>{if(!this.isValid())return!1;let o=this;const l=this.zonedDateTime?.timeZone||Te;let c=v(s).tz(l),d=v(t).tz(l);n&&(o=this.startOf(n),c=c.startOf(n),d=d.startOf(n));const h=r[0]==="["?o.isSameOrAfter(c):o.isAfter(c),u=r[1]==="]"?o.isSameOrBefore(d):o.isBefore(d);return h&&u};diff=(s,t="milliseconds")=>{if(!this.isValid())return NaN;let n;return t==="years"?n=Wr(this.zonedDateTime.toDate(),new Date(s)):t==="months"?n=Kr(this.zonedDateTime.toDate(),new Date(s)):t==="weeks"?n=Zr(this.zonedDateTime.toDate(),new Date(s)):t==="days"?n=Qr(this.zonedDateTime.toDate(),new Date(s)):t==="hours"?n=Xr(this.zonedDateTime.toDate(),new Date(s)):t==="minutes"?n=Jr(this.zonedDateTime.toDate(),new Date(s)):t==="seconds"?n=ei(this.zonedDateTime.toDate(),new Date(s)):t==="milliseconds"&&(n=si(this.zonedDateTime.toDate(),new Date(s))),se(n)&&(n=0),n};unitLookupTable={month:"months",day:"days",d:"days",year:"years",y:"years",week:"weeks",hour:"hours",minute:"minutes",second:"seconds"};unitLookup=s=>s in this.unitLookupTable?this.unitLookupTable[s]:s;set=(...s)=>{if(s.length===1&&typeof s[0]=="object"&&s[0]!==null){const o={};return Object.entries(s[0]).forEach(([l,c])=>{const d=l==="date"?"day":l;d==="month"||d==="months"?o[d]=c+1:o[d]=c}),this.zonedDateTime=this.zonedDateTime.set(o),this}const[t,n]=s,r=t==="date"?"day":t;return r&&n!==void 0&&(r==="month"||r==="months"?this.zonedDateTime=this.zonedDateTime.set({[r]:n+1}):this.zonedDateTime=this.zonedDateTime.set({[r]:n})),this};day=s=>{const t=this.zonedDateTime.timeZone==="UTC",n=this.zonedDateTime.toDate(),r=t?n.getUTCDay():n.getDay();if(s===void 0)return r;const o=s-r;return this.add(o,"day")};year=s=>(s&&(this.zonedDateTime=this.zonedDateTime.set({year:s})),Number(this.format("YYYY")));month=s=>(s&&(this.zonedDateTime=this.zonedDateTime.set({month:s+1})),Number(this.format("MM"))-1);date=s=>(s&&(this.zonedDateTime=this.zonedDateTime.set({day:s})),Number(this.format("DD")));hour=s=>(s&&(this.zonedDateTime=this.zonedDateTime.set({hour:s})),Number(this.format("HH")));minute=s=>(s&&(this.zonedDateTime=this.zonedDateTime.set({minute:s})),Number(this.format("mm")));isoWeekday=s=>{if(!this.isValid())return new me(null);const t=_a(this.zonedDateTime),n=new Date(t.year,t.month-1,t.day),r=n.getDay()===0?7:n.getDay();if(s===void 0)return r};weekday=s=>{if(!this.isValid())return new me(null);const t=this.zonedDateTime.timeZone==="UTC",n=this.zonedDateTime.toDate();if(s===void 0)return t?n.getUTCDay():n.getDay()};add=(s,t)=>{if(!this.isValid())return new me(null);const n=this.unitLookup(t);return this.zonedDateTime=this.zonedDateTime.add({[n]:s}),this};subtract=(s,t)=>{if(!this.isValid())return new me(null);const n=this.unitLookup(t);return this.zonedDateTime=this.zonedDateTime.subtract({[n]:s}),this};startOf=s=>{if(!this.isValid())return new me(null);let t;const n=this.zonedDateTime.timeZone==="UTC"||this.inUTCMode;if(s==="year"||s==="years"){let r=ti(this.zonedDateTime);r=r.set({hour:0,minute:0,second:0,millisecond:0}),t=v(r)}else if(s==="month"||s==="months"){let r=ai(this.zonedDateTime);r=r.set({hour:0,minute:0,second:0,millisecond:0}),t=v(r)}else if(s==="isoWeek"){let r=this.zonedDateTime;const o=n?r.toDate().getUTCDay():r.toDate().getDay(),l=o===0?6:o-1;r=r.subtract({days:l}),r=r.set({hour:0,minute:0,second:0,millisecond:0}),t=v(r)}else if(s==="week"){let r=this.zonedDateTime;const o=n?r.toDate().getUTCDay():r.toDate().getDay();r=r.subtract({days:o}),r=r.set({hour:0,minute:0,second:0,millisecond:0}),t=v(r)}else if(s==="day"||s==="days"){let r=this.zonedDateTime;r=r.set({hour:0,minute:0,second:0,millisecond:0}),t=v(r),this.inUTCMode&&(t.inUTCMode=!0)}else if(s==="hour"||s==="hours"){let r=this.zonedDateTime;r=r.set({minute:0,second:0,millisecond:0}),t=v(r)}else if(s==="minute"||s==="minutes"){let r=this.zonedDateTime;r=r.set({second:0,millisecond:0}),t=v(r)}else if(s==="seconds"||s==="second"){let r=this.zonedDateTime;r=r.set({millisecond:0}),t=v(r)}return t};endOf=s=>{if(!this.isValid())return new me(null);let t;if(s==="year"){let n=ni(this.zonedDateTime);n=n.set({hour:23,minute:59,second:59,millisecond:999}),t=v(n)}else if(s==="month"){let n=ri(this.zonedDateTime);n=n.set({hour:23,minute:59,second:59,millisecond:999}),t=v(n)}else if(s==="day"){let n=this.zonedDateTime;n=n.set({hour:23,minute:59,second:59,millisecond:999}),t=v(n)}return t};tz=(s,t=!1)=>{if(!this.isValid())return this;if(s?.trim()){if(this.inUTCMode&&s!=="UTC"&&(this.inUTCMode=!1),t){const n=this.zonedDateTime,r=new ts(n.year,n.month,n.day,n.hour,n.minute,n.second,n.millisecond);this.zonedDateTime=re(r,s)}else this.zonedDateTime=re(this.zonedDateTime,s);return this}};toISOString(){return v(this.zonedDateTime).utc().format("YYYY-MM-DDTHH:mm:ss.sss[Z]")}format=(s,t)=>{if(!this.isValid())return"Invalid date";let n=t,r=s;r||(r=this.inUTCMode?"YYYY-MM-DDTHH:mm:ss[Z]":"YYYY-MM-DDTHH:mm:ssZ"),n||(n=this.zonedDateTime.timeZone);const o=this.zonedDateTime.toDate(n),l=new Date(o);let c="";const d=T=>{if(T%100>=11&&T%100<=13)return"th";switch(T%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},h=()=>this.convertOffsetToHoursMinutes(this.zonedDateTime.offset),u=T=>{const x=JSON.stringify({locale:"en-US",timeZone:n,...T});return me.formatterCache[x]||(me.formatterCache[x]=new Intl.DateTimeFormat("en-US",{...T,timeZone:n})),me.formatterCache[x]},p=T=>u(T).format(l),m=()=>{const x=new Intl.DateTimeFormat("en-US",{timeZone:n,timeZoneName:"short"}).formatToParts(o).find(b=>b.type==="timeZoneName");return c=x?x.value:"",c},f=p({year:"numeric"}),g={YYYY:()=>f.padStart(4,"0"),YY:()=>p({year:"2-digit"}),MM:()=>p({month:"2-digit"}),M:()=>p({month:"numeric"}),MMMM:()=>p({month:"long"}),MMM:()=>p({month:"short"}),DD:()=>p({day:"2-digit"}),Do:()=>{const T=p({day:"numeric"});return T.concat(d(Number(T)))},D:()=>p({day:"numeric"}),dddd:()=>p({weekday:"long"}),ddd:()=>p({weekday:"short"}),HH:()=>p({hour:"2-digit",hour12:!1}).replace(/24/g,"00"),H:()=>p({hour:"numeric",hour12:!1}).replace(/24/g,"0"),hh:()=>p({hour:"2-digit",hour12:!0}).replace(/ AM| PM/g,""),h:()=>p({hour:"numeric",hour12:!0}).replace(/ AM| PM/g,""),mm:()=>p({minute:"2-digit"}).padStart(2,"0"),m:()=>p({minute:"numeric"}),ss:()=>p({second:"2-digit"}).padStart(2,"0"),s:()=>p({second:"numeric"}),sss:()=>p({millisecond:"short"}),SSS:()=>p({fractionalSecondDigits:3}).split(".")[1]||"000",A:()=>p({hour12:!0,hour:"numeric"}).split(" ")[1],a:()=>p({hour12:!0,hour:"numeric"}).split(" ")[1].toLowerCase(),ZZ:()=>h().replace(":",""),Z:()=>h(),z:()=>m()||Te};return r.includes("LTS")&&(r=r.replace("LTS","h:mm:ss A")),r.includes("LT")&&(r=r.replace("LT","h:mm A")),r.includes("LLLL")&&(r=r.replace("LLLL","dddd, MMMM D, YYYY h:mm A")),r.includes("LLL")&&(r=r.replace("LLL","MMMM D, YYYY h:mm A")),r.includes("LL")&&(r=r.replace("LL","MMMM D, YYYY")),r.includes("L")&&(r=r.replace("L","MM/DD/YYYY")),r.includes("llll")&&(r=r.replace("llll","ddd, MMM D, YYYY h:mm A")),r.includes("lll")&&(r=r.replace("lll","MMM D, YYYY h:mm A")),r.includes("ll")&&(r=r.replace("ll","MMM D, YYYY")),r.includes("l")&&(r=r.replace("l","M/D/YYYY")),r.includes("x")&&(r=r.replace("x",String(v(l).unix()*1e3))),r.replace(Yl,(T,x)=>x||g[T]())};toJSON(){return this.isValid()?(this.inUTCMode?this:this.utc()).format("YYYY-MM-DDTHH:mm:ss.SSS[Z]"):null}toDate(){return new Date(this)}}function v(a){return new me(a)}v.unix=a=>{let s=a;if(s===void 0||typeof s!="number"&&s!==null)return new me(null);s===null&&(s=0);const t=Yt(s*1e3,Te);return v(t)};v.isGnoment=a=>a instanceof me;v.parseZone=a=>{let s;const t=a.match(zn);if(a.includes("Z"))s=Ct(a,"UTC");else if(t)s=Ct(a,t[1]);else return v(a);return v(s)};v.min=(...a)=>{if(a.length===1&&(a=a[0]),a.length===0)return v();const s=a.map(n=>v(n));let t=s[0];for(let n=1;n{if(a.length===1&&(a=a[0]),a.length===0)return v();const s=a.map(n=>v(n));let t=s[0];for(let n=1;nUs();const Vs="PermitPreliminary",Gs="PermitInProgress",Hs="In Progress",qs="Applied",Ws="Awarded",Ks="Awarded In Progress",Zs="Unsuccessful",Qs="Declined",Xs="Accepted",Js="No Response",et="PermitComplete",st="PermitIssued",tt="CancelledNoRelease",at="PermitCancelledByUser",nt="Cancelled",rt="PermitRefunded",it="Voided",ot="Disqualified",lt="PermitNoShow",ct="Pending",qt="PermitInReview",Wt="PermitReviewed",ne=new Map;ne.set(Vs,0);ne.set(Gs,1);ne.set(Hs,2);ne.set(qs,3);ne.set(Ws,4);ne.set(Ks,5);ne.set(Zs,6);ne.set(Qs,7);ne.set(Xs,8);ne.set(Js,9);ne.set(et,10);ne.set(st,11);ne.set(tt,12);ne.set(at,13);ne.set(nt,14);ne.set(rt,15);ne.set(it,16);ne.set(ot,17);ne.set(lt,18);ne.set(ct,19);const ql=a=>{const s=new Map;return a.forEach((t,n)=>{s.set(t,n),s.set(n,t)}),s};ql(ne);const Wl=1,Kl=2,Zl=3,Ql=4,Xl=5,Jl=6,ec=7,sc=8,tc="PERMIT_CATEGORY_RIVER",ac="PERMIT_CATEGORY_HIKING",nc="PERMIT_CATEGORY_CAMPING",rc="PERMIT_CATEGORY_CLIMBING",ic="PERMIT_CATEGORY_WILDLIFE",oc="PERMIT_CATEGORY_ROADENTRY",lc="PERMIT_CATEGORY_EVENT",cc="PERMIT_CATEGORY_BOAT",dc="PERMIT_CATEGORY_SNOWMOBILE",hc="PERMIT_CATEGORY_WILDERNESS",uc=1,pc=2,mc=3,fc=7,gc=8,yc=void 0,Tc=void 0,Ke={LOTTERY_AVAILABLE:0,USER_RESTRICTED:1,LOTTERY_NOT_ACTIVE:2,LOTTERY_NOT_OPEN:3,EXISTING_LOTTERY:4,EXISTING_HIGH_RESERVATION:5,COMMERCIAL_NOT_ALLOWED:6},_c="None",xc="OneFee",vc="AddOnFee",Ec="ByDayFee",bc="NoUseFee",jc="FlatUseFee",Sc="PerGroupPerNight",Rc="PerGroupPerDay",Cc="PerMember",Ic="PerMemberPerNight",Ac="PerMemberPerDay",Dc="PerGroupSizePerDay",Nc="PerWatercraft",Pc="PerGroupPerNightCustomRangeHighUseOnly",wc="PerGroupPerNightExcludeFirstNight",Oc="PerWatercraftPerDay",kc="PerMemberInyo",Lc="PerGroupSizePerNightPartialFirstNight",Mc="PerMemberHighUseOnly",Fc="PerMemberPerDayBySeason",Yc="ReservationFee",$c="PercentDiscountFee",Bc="CLIN",Uc="TransactionFee",zc="UseFee",Vc="TicketFee",Gc="AttributeFee",Hc="POSFee",qc="TaxFee",Wc="NonRefundable",Kc="AdjustmentFee",Zc="Preliminary",Qc="In Progress",Xc="Reserved",Jc="Issued",ed="No Show",Gn="Cancelled",sd="Refunded",td="In Progress",ad="Applied",nd="Awarded",rd="Awarded And Being Booked",id="Unsuccessful",od="Declined",ld="Accepted",cd="No Response",dd="Cancelled",hd="Voided",ud="Disqualified",pd="Pending",md="Reserved - In Review",fd="Reserved - Reviewed",gd="",yd="",Td="",_d="",xd="",vd="",Ed="",bd="",jd="",Sd="",Rd="",Cd="",Hn="Reservation has been cancelled.",Id="Reservation complete; payment processed.",Ad="",Dd="Permit has been printed/issued.",Nd='Internal user has marked reservation as "no show".',Pd="Reservation is in customer's cart, not yet purchased.",wd='Internal user has refunded the reservation via the "refund" button, where available',Od="Permit is in review by the facility",kd="Permit has been reviewed by the facility",Ld="Non-Commercial",Md="Commercial",Fd="Advanced",Yd="Walkup",$d="entryPoint",Bd="exitPoint",Ud="issueStation",zd="groupMembers",Vd="watercrafts",Gd="exitDate",Hd="lotteryOpenDate",qd="lotteryCloseDate",Wd="lotteryRunDate",Kd="lotteryDeadlineDate",Zd="lotteryInfoDisplayDate",Qd="lotteryNotifyDate",Xd="lotterySeasonStartDate",Jd="lotterySeasonEndDate",eh="needToKnowChecked",sh="divisionId",th="selectedDates",ah="preferred_date",nh="preferred_range_start",rh="preferred_range_end",ih="division_id",oh="length_of_stay",lh="group_max_size",ch="group_min_size",dh="houseboat",hh="emergencyContactFirstName",uh="emergencyContactLastName",ph="emergencyContactPhone",mh="isVisitingMtWhitney",fh="isBringingAnimals",gh="animalList",yh="travelMethodEmpty",Th="priorExperience",_h="snowmobile",xh="launchTime",vh="birthdate",Eh="groupMemberFirstName",bh="groupMemberLastName",jh="groupMemberAge",Sh="groupMemberStartDate",Rh="groupMemberEndDate",Ch="permitHolderBirthdate",Ih="watercraftDetails",Ah="isCommerciallyGuided",Dh="groupMemberList",Nh="comment",Ph="vehicleDescription",wh="licensePlate",Oh="licenseState",kh="vehicle",Lh="permitHolderFirstNameEmpty",Mh="permitHolderLastNameEmpty",Fh="permitHolderEmailEmpty",Yh="permitHolderPhoneEmpty",$h="permitHolderStreetAddress",Bh="permitHolderCity",Uh="permitHolderCountry",zh="permitHolderStateCode",Vh="permitHolderPostalCode",Gh="REQUIRED_BOOLEAN_FIELD",Hh="REQUIRED_STRING_FIELD",qh="REQUIRED_DATE_FIELD",Wh="REQUIRED_NUM_FIELD",Kh="REQUIRED_SELECTED_BOOLEAN_FIELD",Zh="REQUIRED_STRING_FIELD_IN_ARRAY",Qh="REQUIRED_NUM_FIELD_IN_ARRAY",Xh="REQUIRED_DATE_FIELD_IN_ARRAY",Jh="ONLINE",eu="FIELD_SALES",su="CALL_CENTER";function ds(a){const s=new Map;return a.forEach((t,n)=>{s.set(t,n),s.set(n,t)}),s}const q=new Map;q.set(1,"Kayak");q.set(2,"Double Kayak");q.set(3,"Hard Shell Kayak");q.set(4,"Inflatable Kayak");q.set(5,"Tandem Kayak");q.set(6,"Cataraft");q.set(7,"Canoe");q.set(8,"Solo Canoe");q.set(9,"Drift");q.set(10,"Raft");q.set(11,"Sweep");q.set(12,"SUP");q.set(13,"Kicker Motor");q.set(14,"Paddle Board");q.set(15,"Tube");q.set(16,"Dory");q.set(17,"Standing Paddle Board");q.set(18,"Motorboat");q.set(19,"Sand Stakes");q.set(20,"Motorized");q.set(21,"Non-Motorized");q.set(22,"Packraft");q.set(1001,"Snowmobile");q.set(2001,"Vehicle");q.set(999999,"Other");q.set(9999999,"Unknown");ds(q);const be=new Map;be.set(1,"Goat");be.set(2,"Horse / Pack Mule");be.set(3,"Llama");be.set(4,"Dog");be.set(5,"Horse/Mule Riding Stock");be.set(6,"Dogs or other pets");be.set(7,"Burro");be.set(8,"Mule");be.set(9,"Riding Horse");be.set(10,"Stock Horse");be.set(999999,"Other");const dt=new Map;dt.set(Ld,0);dt.set(Md,1);ds(dt);ds(dt);const Kt=new Map;Kt.set(Fd,0);Kt.set(Yd,1);ds(Kt);let X=new Map;X.set(Vs,0);X.set(Gs,1);X.set(Hs,2);X.set(qs,3);X.set(Ws,4);X.set(Ks,5);X.set(Zs,6);X.set(Qs,7);X.set(Xs,8);X.set(Js,9);X.set(et,10);X.set(st,11);X.set(tt,12);X.set(at,13);X.set(nt,14);X.set(rt,15);X.set(it,16);X.set(ot,17);X.set(lt,18);X.set(ct,19);X.set(qt,20);X.set(Wt,21);const te=new Map;te.set(Vs,Zc);te.set(Gs,Qc);te.set(et,Xc);te.set(st,Jc);te.set(tt,Gn);te.set(at,Gn);te.set(rt,sd);te.set(lt,ed);te.set(qt,md);te.set(Wt,fd);te.set(Hs,td);te.set(qs,ad);te.set(Ws,nd);te.set(Ks,rd);te.set(Zs,id);te.set(Qs,od);te.set(Xs,ld);te.set(Js,cd);te.set(nt,dd);te.set(it,hd);te.set(ot,ud);te.set(ct,pd);const ae=new Map;ae.set(Xs,gd);ae.set(qs,yd);ae.set(Ws,_d);ae.set(Ks,Td);ae.set(nt,xd);ae.set(Qs,vd);ae.set(ot,Ed);ae.set(Hs,bd);ae.set(Zs,jd);ae.set(Js,Sd);ae.set(ct,Rd);ae.set(it,Cd);ae.set(tt,Hn);ae.set(at,Hn);ae.set(et,Id);ae.set(Gs,Ad);ae.set(st,Dd);ae.set(lt,Nd);ae.set(Vs,Pd);ae.set(rt,wd);ae.set(qt,Od);ae.set(Wt,kd);X=ds(X);const hs=(a,s,t)=>a===1?s:t,Zt=a=>hs(a,"day","days"),$=new Map;$.set("Rule violated: SeasonStart",{text:()=>'We appreciate your eagerness and enthusiasm! However, the season has not started and there are no online reservations available at this time. Please check the "Important Dates" section for more information.',formatValue:a=>v.unix(a).utc().format("MMMM Do, YYYY")});$.set("Rule violated: SeasonEnd",{text:()=>'We applaud your good taste! However, the season has ended and there are no online reservations available at this time. Please check the "Important Dates" section for more information.',formatValue:a=>v.unix(a).utc().format("MMMM Do, YYYY")});$.set("Rule violated: QuotaPerDay",{text:()=>"This is a popular activity and, unfortunately, there is not enough quota available for the date(s) you selected.",formatValue:a=>a});$.set("Rule violated: RegistrationEnd",{text:a=>`Advanced registration for this permit ended on ${a}.`,formatValue:a=>v.unix(a).utc().format("MMMM Do, YYYY")});$.set("Rule violated: HighUseSeasonStart",{text:a=>`We appreciate your eagerness and enthusiasm! Unfortunately, the lottery season doesn't begin until ${a}. Please refer to the "Important Dates" section and try again when the lottery opens.`,formatValue:a=>v.unix(a).utc().format("MMMM Do, YYYY")});$.set("Rule violated: HighUseSeasonEnd",{text:a=>`You made a great selection! However, the lottery season closed on ${a}. Please refer to the "Important Dates" section and try again when the lottery reopens.`,formatValue:a=>v.unix(a).utc().format("MMMM Do, YYYY")});$.set("Rule violated: MaxGroupSize",{text:(a,s)=>s?`You cannot have more than ${a} group members to complete a reservation at ${s}.`:`You've got a full house! Please adjust your group so that it doesn't exceed the max group size of ${a}.`,formatValue:a=>a});$.set("Rule violated: MaxGroupSizeCommercial",{text:a=>`You've got a full house! Please adjust your group so that it doesn't exceed the max commercial group size of ${a}.`,formatValue:a=>a});$.set("Rule violated: StayLimit",{text:a=>`This a popular permit activity and, unfortunately, the maximum length of stay is ${a} ${Zt(a)}. Please adjust your dates.`,formatValue:a=>a/(24*60*60)});$.set("Rule violated: StayMinimum",{text:a=>`Can you visit for just a little longer? The minimum length of stay is ${a} ${Zt(a)}. Please adjust your dates.`,formatValue:a=>a/(24*60*60)});$.set("Rule violated: MaxReservationsHighUseSeason",{text:a=>`You have excellent taste! However, you can only register ${a} ${hs(a,"time","times")} this season and have exceeded the max number of applications.`,formatValue:a=>a});$.set("Rule violated: MaxAccountReservationsOnDay",{text:a=>`You must really like this location! However, you can only register for ${a} ${hs(a,"permit","permits")} per day.`,formatValue:a=>a});$.set("Rule violated: MaxAccountNotIssuedReservationsPerSeason",{text:a=>`You can only have ${a} ${hs(a,"permit","permits")} at a time, and you'll need to use a permit before you can reserve another one.`,formatValue:a=>a});$.set("Rule violated: HighUseRegistrationStart",{text:a=>`You made a great selection! However, the lottery season closed on ${a}. Please refer to the "Important Dates" section and try again when the lottery reopens.`,formatValue:a=>v.unix(a).utc().format("MMMM Do, YYYY")});$.set("Rule violated: HighUseRegistrationEnd",{text:a=>`You made a great selection! However, lottery registration closed on ${a}. Please refer to the "Important Dates" section and try again when the lottery reopens.`,formatValue:a=>v.unix(a).utc().format("MMMM Do, YYYY")});$.set("Rule violated: LotteryDeadlineToConfirm",{text:a=>`Unfortunately, the deadline to confirm this lottery award has passed. Confirmation for the lottery was required by ${a}.`,formatValue:a=>v.unix(a).utc().format("MMMM Do, YYYY")});$.set("Rule violated: IsLeaderTransferable",{text:()=>"Trust your first instinct and stick with this leader. The leader cannot be changed once a reservation is booked.",formatValue:a=>a});$.set("Rule violated: IsCustomerTransferable",{text:()=>"We understand plans can change, but group members can't be updated once a reservation is booked.",formatValue:a=>a});$.set("Rule violated: CancellationDeadline",{text:()=>"Unfortunately, the cancellation window for this reservation has passed. If you choose to cancel this reservation, you may not receive a refund or the cancellation could result in a penalty based on permit regulations.",formatValue:a=>a});$.set("Rule violated: DisallowOvernightStock",{text:()=>"Horses and other stock animals are not permitted for overnight trips.",formatValue:a=>a});$.set("Rule violated: MaxPartySize",{text:a=>`You've got quite the entourage! Please adjust the total number of people and stock animals so that it doesn’t' exceed the max of ${a}.`,formatValue:a=>a});$.set("Rule violated: MaxEquipmentPerReservation",{text:a=>`You might be packing more gear than you'll need. The max amount of equipment allowed is ${a}.`,formatValue:a=>a});$.set("Rule violated: MaxOverlappingReservations",{text:()=>"You have an overlapping reservation.",formatValue:a=>a});$.set("Rule violated: ModificationDeadline",{text:a=>`The modification deadline has passed. You must modify at least ${a} days before your reservation.`,formatValue:a=>a});$.set("Rule violated: CheckGapDays",{text:a=>`You must have a minimum of ${a} ${Zt(a)} between your reservations.`,formatValue:a=>a-1});$.set("Rule violated: MaxReservationsCalendarYear",{text:a=>`You may only have ${a} reservations per calendar year.`,formatValue:a=>a});$.set("Rule violated: ActiveIssuances",{text:a=>`You may only have ${a} active reservations at this location.`,formatValue:a=>a});$.set("Rule violated: MinGroupSize",{text:(a,s)=>s?`You must have a minimum of at least ${a} group members to complete a reservation at ${s}.`:`You must have at least ${a} group members to complete this reservation.`,formatValue:a=>a});$.set("Rule violated: MaxHolidayWeekendReservationsPerSeason",{text:a=>`You cannot reserve for more than ${a} holiday weekend this season.`,formatValue:a=>a});$.set("Rule violated: MaxStock",{text:a=>`Please adjust the total number of stock animals so that it doesn't exceed the maximum total allowed of ${a}`,formatValue:a=>a});$.set("Rule violated: DisableExternalModifications",{text:()=>"Modifications are unavailable for your reservation.",formatValue:a=>a});$.set("Rule violated: GroupMemberDatesInRange",{text:()=>"The first group member's trip dates must match the Entry & Exit Dates on the reservation. Please review the information provided for the overall reservation and each group member's trip dates.",formatValue:a=>a});$.set("Rule violated: MaxLotteryAwardsPerCalendarYear",{text:()=>"You may not apply to this lottery because you have already been successful in a previous lottery for this permit this year.",formatValue:a=>a});const ht=new Map;ht.set(_c,2);ht.set(xc,0);ht.set(vc,1);ht.set(Ec,3);const ue=new Map;ue.set(bc,0);ue.set(jc,1);ue.set(Sc,2);ue.set(Cc,3);ue.set(Ic,4);ue.set(Ac,5);ue.set(Nc,6);ue.set(Rc,7);ue.set(Pc,8);ue.set(Dc,9);ue.set(wc,10);ue.set(Oc,11);ue.set(kc,12);ue.set(Lc,13);ue.set(Mc,14);ue.set(Fc,15);const je=new Map;je.set(Bc,0);je.set(Uc,1);je.set(zc,2);je.set(Vc,3);je.set(Gc,4);je.set(Hc,5);je.set(qc,6);je.set($c,7);je.set(Kc,8);je.set(Yc,1e3);je.set(Wc,1001);const Ne=new Map;Ne.set(Gh,0);Ne.set(Hh,1);Ne.set(qh,2);Ne.set(Wh,3);Ne.set(yc,4);Ne.set(Kh,5);Ne.set(Zh,6);Ne.set(Qh,7);Ne.set(Tc,8);Ne.set(Xh,9);const R=new Map;R.set($d,"launchDetail.entryLocationId");R.set(Bd,"launchDetail.exitLocationId");R.set(Gd,"launchDetail.exitDate");R.set(xh,"launchDetail.launchTime");R.set(Ud,"issueStationDetail.selectedStationId");R.set(zd,"groupMembers");R.set(Vd,"watercraftsCount");R.set(Hd,"lotteryOpenDate");R.set(qd,"lotteryCloseDate");R.set(Wd,"lotteryRunDate");R.set(Kd,"lotteryDeadlineDate");R.set(Zd,"lotteryInfoDisplayDate");R.set(Qd,"lotteryNotifyDate");R.set(Xd,"lotterySeasonStartDate");R.set(Jd,"lotterySeasonEndDate");R.set(eh,"needToKnowChecked");R.set(sh,"division.id");R.set(th,"selectedDates");R.set(ah,"preferred_date");R.set(nh,"preferred_range_start");R.set(rh,"preferred_range_end");R.set(ih,"division_id");R.set(oh,"length_of_stay");R.set(lh,"group_max_size");R.set(ch,"group_min_size");R.set(dh,"houseboat.type");R.set(hh,"emergencyContact.first_name");R.set(uh,"emergencyContact.last_name");R.set(ph,"emergencyContact.phone");R.set(Lh,"groupDetail.groupLeader.first_name");R.set(Mh,"groupDetail.groupLeader.last_name");R.set(Fh,"groupDetail.groupLeader.email");R.set(Yh,"groupDetail.groupLeader.cell_phone");R.set($h,"groupDetail.groupLeader.home_address.address1");R.set(Bh,"groupDetail.groupLeader.home_address.city");R.set(Uh,"groupDetail.groupLeader.home_address.country");R.set(zh,"groupDetail.groupLeader.home_address.state");R.set(Vh,"groupDetail.groupLeader.home_address.zip_code");R.set(mh,"isVisitingMtWhitney");R.set(fh,"isBringingAnimals");R.set(gh,"animals");R.set(yh,"travelMethodType");R.set(Th,"priorExperience");R.set(_h,"snowmobiles");R.set(vh,"groupMembers|birthdate");R.set(Eh,"groupMembers|fName");R.set(bh,"groupMembers|lName");R.set(jh,"groupMembers|age");R.set(Sh,"groupMembers|startDate");R.set(Rh,"groupMembers|endDate");R.set(Ch,"groupMembers[0].birthdate");R.set(Ih,"watercraftDetails");R.set(Ah,"isCommerciallyGuided");R.set(Dh,"groupMemberList");R.set(Nh,"comment");R.set(Ph,"vehicles|description");R.set(wh,"vehicles|license_plate");R.set(Oh,"vehicles|license_state");R.set(kh,"vehicles");R.set("commercialClientInfo","clientInfo");R.set("commercialServiceType","serviceType");const Qt=new Map;Qt.set(Jh,0);Qt.set(eu,1);Qt.set(su,2);const Xt=new Map;Xt.set(0,"Online");Xt.set(1,"Field Sales");Xt.set(2,"Call Center");const Pe=new Map;Pe.set(tc,0);Pe.set(ac,1);Pe.set(nc,2);Pe.set(rc,3);Pe.set(ic,4);Pe.set(oc,5);Pe.set(lc,6);Pe.set(cc,7);Pe.set(dc,8);Pe.set(hc,9);const Me=new Map;Me.set(0,"River");Me.set(1,"Hiking");Me.set(2,"Camping");Me.set(3,"Climbing");Me.set(4,"Wildlife");Me.set(5,"Road Entry");Me.set(6,"Event");Me.set(7,"Boat");Me.set(8,"Snowmobile");const we=new Map;we.set(0,"Standard / No Pass");we.set(Wl,"Adult/Youth");we.set(Kl,"Interagency Access Pass");we.set(Zl,"Interagency Senior Pass");we.set(Ql,"Local Pass");we.set(Xl,"Adult");we.set(Jl,"Youth");we.set(ec,"Visitor Day Use Permit");we.set(sc,"Commercial Guide Permit Reservation");ds(we);const ut=new Map;ut.set(0,"Standard / No Fee");ut.set(uc,"Adult (16 to 61)");ut.set(pc,"Junior (below 16)");ut.set(mc,"Senior (above 61)");const qn=new Map;qn.set(fc,"Visitor Day Use Permit");qn.set(gc,"Commercial Guide Permit Reservation");const Ze=new Map;Ze.set(Ke.LOTTERY_AVAILABLE,"Lottery is Available!");Ze.set(Ke.USER_RESTRICTED,"Based on this facility's use restrictions, you have been disqualified for further reservations at this facility. If you feel you have received this message in error or require information about these restrictions, please call the facility.");Ze.set(Ke.LOTTERY_NOT_ACTIVE,"There is no active lottery for this location.");Ze.set(Ke.LOTTERY_NOT_OPEN,"This lottery is currently not open for user registration.");Ze.set(Ke.EXISTING_LOTTERY,"A lottery application for this season already exists. If you have not yet paid for your lottery application, please check the shopping cart for an in-progress application.");Ze.set(Ke.EXISTING_HIGH_RESERVATION,"You cannot register multiple times for the same lottery.");Ze.set(Ke.COMMERCIAL_NOT_ALLOWED,"Unfortunately, this lottery doesn't allow for commercial permit applications.");const De=(a="")=>typeof a=="string"?a.replace(/T.*/,""):a;function Wn(a,s){const t=_(De(a.start_date)).startOf("day"),n=_(De(a.end_date)).startOf("day"),r=_(De(s)).startOf("day");return t.isSameOrBefore(r)&&n.isSameOrAfter(r)}function tu(a,s){const t=_(De(a.date)).startOf("day"),n=_(De(s)).startOf("day");return t.isSame(De(n))}function Jt(a,s){const t=_(De(s)).startOf("day");if(_(De(a.start_date)).startOf("day").isAfter(t))return!1;const r=t.format("MM-DD");for(const o of a.divisions)if(o.starts_at<=r&&o.ends_at>=r)return o;return!1}function pt(a,s){const t=_(De(s)).startOf("day");let n=!1,r=_("0001-01-01T00:00:00Z");for(const o of a){const l=_(De(o.start_date)).startOf("day");l.isSameOrBefore(t)&&l.isAfter(r)&&(n=o,r=l)}return n}function Kn(a,s){return(I(a,"free_days")||[]).reduce((n,r)=>n||(r.end?Wn({start_date:r.date,end_date:r.end},s):tu(r,s)),!1)}function Zn(a,s){return(I(a,"blackout_periods")||[]).reduce((n,r)=>n||Wn(r,s),!1)}function xs(a,s){return t=>{const n=pt(s.periods,t);return!n||!Jt(n,t)?!0:Zn(a,t)||Kn(a,t)}}function au(a,s){try{return Jt(pt(a,s),s)}catch{return{}}}function Qn(a,s){try{const t=hn(a,"start_date");let n=Jt(pt(t,s),s);return n||(n=t[t.length-1].divisions[0]),n.display_price}catch{return{}}}function St(a,s,t){if(s.starts_at==="01-01"&&s.ends_at!=="12-31"){for(const n of a)if(n.ends_at==="12-31"&&n.starts_at!=="01-01"&&s.name===n.name&&s.price===n.price)return[n,!0]}return s.starts_at>s.ends_at&&t!==void 0&&t<=s.ends_at?[s,!0]:[s,!1]}function Rt(a,s,t){if(s.starts_at!=="01-01"&&s.ends_at==="12-31"){for(const n of a)if(n.starts_at==="01-01"&&n.ends_at!=="12-31"&&n.name===s.name&&n.price===s.price)return[n,!0]}return s.starts_at>s.ends_at&&t!==void 0&&t>s.ends_at?[s,!0]:[s,!1]}const Ee=(a="")=>a?.includes("day");function nu(a,s){if(!a)return;let t=`/camping/gateways/${a}`;return s&&(t=`${s}${t}`),t}function ru(a,s=0,t={}){const n=lo(()=>co(a,s,t),t.resolver);return(...r)=>{n.apply(this,r).apply(this,r)}}const ws=(a=[],s,t=!1)=>{const n=hn(a,"start_date"),r=_(s).isBefore()?_().format():s,o=t?n:n.filter(c=>_(c.start_date).format("YYYY")>=_().format("YYYY"));let l=I(o.find(({start_date:c})=>c<=_(r).format()),"divisions",[]).find(({starts_at:c,ends_at:d})=>_(c,"MM-DD").isSameOrBefore(_(r))&&_(d,"MM-DD").add(1,"day").isSameOrAfter(_(r)));return!l&&I(n,"[0].divisions.length")&&(l=n[0].divisions[0]),l},us=(a=0)=>`$${(a/Sl).toFixed(2)}`,We=(a,s,t=!1)=>I(ws(a,s,t),"display_price",0)||I(ws(a,"2010-01-01",!0),"display_price",0)||us(I(ws(a,s,t),"price",0)||I(ws(a,"2010-01-01",!0),"price",0)),os=(a,s)=>{const t=pt(a,_().startOf("day").format());if(!t)return["",""];const n=_(void 0),r=n.format("MM-DD"),o=n.year();let l=null,c=null;for(const d of t.divisions){if(r>=d.starts_at&&r<=d.ends_at){if(d.starts_at==="01-01"){const[h,u]=St(t.divisions,d);let p=o;return u&&(p=o-1),[`${p}-${h.starts_at}`,`${o}-${d.ends_at}`]}if(d.ends_at==="12-31"){const[h,u]=Rt(t.divisions,d);let p=o;return u&&(p=o+1),[`${o}-${d.starts_at}`,`${p}-${h.ends_at}`]}return[`${o}-${d.starts_at}`,`${o}-${d.ends_at}`]}r<=d.starts_at&&(l===null||d.starts_atd.starts_at)&&(c=d)}if(l!==null){const[d,h]=St(t.divisions,l,r);let u=o,p=o;h&&(u=o-1);const[m,f]=Rt(t.divisions,l,r);return f&&(p=o+1),[`${u}-${d.starts_at}`,`${p}-${m.ends_at}`]}if(c!==null){const[d,h]=St(t.divisions,c,r);let u=o,p=o;h&&(u=o-1);const[m,f]=Rt(t.divisions,c,r);return f&&(p=o+1),[`${u}-${d.starts_at}`,`${p}-${m.ends_at}`]}return["",""]},iu=a=>`${a?.[0]?.toUpperCase()}${a?.slice(1)}`,Ye={headers:{}};function Os(a,s={}){return{...s,Authorization:a.getAuthHeader()}}const ou=a=>{const s=(o,l=Ye)=>ss.get(o,l),t=(o,l,c=Ye)=>ss.post(o,l,c),n=(o,l,c=Ye)=>ss.put(o,l,c),r=(o,l=Ye)=>ss.delete(o,l);return{get:s,post:t,put:n,remove:r,getWithAuth(o,l=Ye){return s(o,{...l,headers:Os(a,l.headers)})},postWithAuth(o,l,c=Ye){return t(o,l,{...c,headers:Os(a,c.headers)})},putWithAuth(o,l,c=Ye){return n(o,l,{...c,headers:Os(a,c.headers)})},removeWithAuth(o,l=Ye){return r(o,{...l,headers:Os(a,l.headers)})}}},Rs=(a=[])=>`${cs}/reservations${a.length?`?id=${a.join("&id=")}`:""}`,lu=()=>`${Rs()}/price`,cu=()=>`${Rs()}/validate`,du=a=>`${cs}/passtypes/${a}`,hu=a=>`${cs}/passtypes/facility/${a}`,uu=()=>`${cs}/facilities`,pu=a=>`${cs}/facilities/${a}`,mu=a=>`${cs}/facilities/${a}`,fu=a=>`/api/search?fq=entity_type%3Arecarea&fq=entity_id%3A${a}`,{get:Xn,getWithAuth:Cs,postWithAuth:ea,post:gu}=ou(Ni),yu=a=>ea(Rs(),a),Tu=a=>Cs(Rs(a)),_u=a=>ea(Rs(),a),Jn=a=>ea(lu(),a),xu=a=>gu(cu(),a),vu=a=>Xn(hu(a)),Eu=a=>Xn(du(a)),bu=()=>Cs(uu()),ju=a=>Cs(pu(a)),Su=a=>Cs(mu(a)),sa=a=>Cs(fu(a));function Ru(a){return s=>s({type:se(a)?yl:a})}const Cu=i.shape({name:i.string,description:i.string,attendee_min:i.number,attendee_max:i.number,price_per_attendee:i.number,price_min:i.number,price_max:i.number}),er=i.objectOf(Cu),Iu={},ps=i.shape({title:i.string,paragraphs:i.arrayOf(i.string)}),sr=i.objectOf(i.arrayOf(ps)),tr={},Au=i.shape({name:i.string,description:i.string,start_date:i.string,end_date:i.string}),Du=i.arrayOf(Au),Nu=[],Pu=i.shape({name:i.string,date:i.string}),ar=i.arrayOf(Pu),wu=[],Qe=i.shape({id:i.string,name:i.string,agency:i.string,lat_long:i.shape({lat:i.string,long:i.string}),state:i.string,blackout_periods:Du,no_fee_periods:ar,contents:sr,is_upgradable:i.bool,is_external_search_disabled:i.bool}),mt={id:null,name:"",agency:"",lat_long:{lat:"0",long:"0"},state:"",blackout_periods:Nu,no_fee_periods:wu,contents:tr,is_upgradable:!1},nr=i.shape({first_name:i.string,last_name:i.string,email:i.string}),Pt={first_name:"",last_name:"",email:""},rr=i.shape({type:i.oneOf(Object.keys(xl)),fields:i.shape({license:i.string})}),ir={type:"personal-vehicle",fields:{license:""}},or=i.shape({type:i.oneOf(Object.keys(vl)),fields:i.shape({license:i.string})}),lr={type:"motorized-boat",fields:{license:""}},ta=i.shape({duration:i.oneOf(Object.keys(Gt)),facility_name:i.string,features:i.shape({"attendee-info":i.objectOf(i.number),"equipment-info":i.shape({vehicle:rr,watercraft:or}),"start-date":i.string}),holder_info:nr,pass_image:i.string,pass_name:i.string,end_date:i.string,start_date:i.string}),Ou={duration:"annual",facility_name:"",features:{"attendee-info":{adults:1,visitors:1},"equipment-info":{vehicle:ir,watercraft:lr},"start-date":_().startOf("day").format()},holder_info:Pt,pass_image:"",pass_name:"",end_date:null,start_date:null},cr={id:i.string,account_id:i.string,order_id:i.string,pass_type_id:i.string,facility_id:i.string,pass_info:ta,valid_from:i.string,valid_to:i.string,sale_date:i.string,reservation_number:i.string,created_at:i.string};i.shape(cr);i.shape({...cr,type:i.oneOf(jl),message:i.string});const ku=i.shape({starts_at:i.string,ends_at:i.string,price:i.number,display_price:i.string,name:i.string}),Lu=i.shape({start_date:i.string,divisions:i.arrayOf(ku)}),Mu=[{start_date:"",divisions:[]}],Fu=i.shape({description:i.string,groups:i.shape({}),segments:i.arrayOf(i.objectOf(i.string)),name:i.string}),ks=i.shape({description:i.string,fields:i.shape({}),license_required:i.bool,name:i.string}),Yu={description:"",fields:{},license_required:!1,name:""},Ls=i.shape({description:i.string,fields:i.shape({}),license_required:i.bool,name:i.string}),$u={description:"",fields:{},license_required:!1,name:""},J=i.shape({contents:sr,created_at:i.string,duration:i.oneOf(Object.keys(Gt)),facility_id:i.string,facility_type:i.string,features:i.shape({"attendee-info":er,"day-segment":Fu,"equipment-info":i.shape({vehicle:i.shape({"no-vehicle":ks,"personal-vehicle":ks,"rental-vehicle":ks,camper:ks}),watercraft:i.shape({"no-boat":Ls,"motorized-boat":Ls,"non-motorized-boat":Ls,"rental-boat":Ls})}),"start-date":i.bool}),id:i.string,image:i.string,name:i.string,periods:i.arrayOf(Lu),sales_available_end:i.string,sales_available_start:i.string,sku:i.string,updated_at:i.string,used_for:i.string}),dr={contents:tr,created_at:"",duration:"annual",facility_id:null,facility_type:null,features:{"attendee-info":Iu,"equipment-info":{vehicle:{"no-vehicle":Yu},watercraft:{"no-boat":$u}},"start-date":!1,is_field_sales:!1},id:null,image:"",name:"",periods:Mu,sales_available_end:"",sales_available_start:"",sku:"",updated_at:"",used_for:""},ze=i.shape({id:i.string,account_id:i.string,order_id:i.string,facility_id:i.string,features:i.shape({}),pass_type_id:i.string,reservation_number:i.string,pass_info:ta,price:i.number,clin:i.number,sku:i.string,quantity:i.number,point_of_sale:i.oneOf(El),status:i.oneOf(bl),created_at:i.string,updated_at:i.string}),Fs={id:null,account_id:null,order_id:null,facility_id:null,features:{},pass_type_id:null,reservation_number:null,pass_info:Ou,price:0,clin:0,sku:"",quantity:0,point_of_sale:"web",status:"pending",created_at:null,updated_at:null};i.shape({id:i.string,scanned_at:i.string});class Bu extends y.Component{static defaultProps={faqs:[]};static propTypes={faqs:i.arrayOf(ps)};state={isOpen:!1};toggleModal=()=>this.setState(({isOpen:s})=>({isOpen:!s}));render(){const{isOpen:s}=this.state,{faqs:t}=this.props;return t.length?e.jsxs("section",{children:[e.jsx(E,{appearance:"link",onClick:this.toggleModal,iconBeforeElement:e.jsx(k,{iconName:"help-outline"}),className:"parkpass-faq-button-wrap",gaTrackingId:"251930737215",children:"Frequently Asked Questions"}),e.jsxs(bs,{isOpen:s,onRequestClose:this.toggleModal,role:"complementary",heading:"Frequently Asked Questions",children:[e.jsx("div",{className:"rec-modal-content-wrap",children:e.jsx("div",{className:"parkpass-contents-wrapper",children:e.jsx(Ut,{headingLevel:2,appearance:"h1",id:"with-children",children:t.map(({title:n,paragraphs:r=[]},o)=>e.jsxs(Za,{className:"parkpass-faq",children:[!!n&&e.jsx(Qa,{children:n}),e.jsx(Xa,{children:r.map((l,c)=>e.jsx("div",{children:e.jsx(Ue,{html:l})},`paragraph-${c}`))})]},`section-${o}`))})})}),e.jsx(zt,{children:e.jsx(ge,{isFullWidthOnMobile:!1,isStretchedToFit:!0,children:e.jsx(E,{onClick:this.toggleModal,gaTrackingId:"528333978988",children:"Close"})})})]})]}):null}}function Uu(a){if(a)return`/gateways/${a}`}const zu={loading:i.bool.isRequired,size:i.oneOf(["lg","sm"]).isRequired,className:i.string,children:i.node},Vu={loading:!1,className:""};function aa(a){const{className:s,loading:t,size:n,children:r}=a;return t?e.jsx("div",{className:`${s} loading-wrapper is-not-loaded rec-lottery-loading`,children:e.jsx(Pi,{size:n})}):e.jsx("div",{className:`${s} loading-wrapper is-loaded`,children:r})}aa.propTypes=zu;aa.defaultProps=Vu;const Gu=a=>typeof a=="function";function wt(a){return s=>a?Gu(s)?s():s:null}class Ys extends y.Component{static propTypes={id:i.string.isRequired,label:i.string,value:i.oneOfType([i.string,i.number]).isRequired,placeholder:i.string,className:i.string,password:i.bool,inline:i.bool,disabled:i.bool,required:i.bool,readOnly:i.bool,selectAllOnFocus:i.bool,validator:i.func,isValid:i.bool,error:i.oneOfType([i.bool,i.string]),showError:i.oneOfType([i.bool,i.func]),iconLeft:i.func,iconRight:i.func,onChange:i.func,onFocus:i.func,onBlur:i.func,onKeyDown:i.func,onKeyUp:i.func,onKeyPress:i.func};static defaultProps={className:"",placeholder:"",password:!1,inline:!1,disabled:!1,required:!1,readOnly:!1,selectAllOnFocus:!1,validator:()=>!1,isValid:!0,error:!1,showError:({blurred:s})=>s};constructor(s){super(s);const{error:t,isValid:n}=this.validate(this.props.value),r={focused:!1,changed:!1,blurred:!1},o=this.showError(this.props.showError,r);this.state={...r,showError:o,isValid:n,error:t,value:s.value},this.onFocus=this.onFocus.bind(this),this.onChange=this.onChange.bind(this),this.onBlur=this.onBlur.bind(this)}UNSAFE_componentWillReceiveProps(s){s.isValid!==this.props.isValid?this.setState(t=>({...t,isValid:s.isValid,error:s.error,value:s.value})):s.value!==this.state.value&&this.setState({value:s.value})}onFocus(s){const{selectAllOnFocus:t}=this.props,{value:n}=s.target,{error:r,isValid:o}=this.validate(n),l=!0,c=this.showError(this.props.showError,{focused:l});t&&s.target.select(),this.setState(d=>({...d,focused:l,showError:c,isValid:o,error:r,value:n}),()=>{this.props.onFocus&&this.props.onFocus(n,o,r)})}onChange(s){const{value:t}=s.target,{error:n,isValid:r}=this.validate(t),o=!0,l=this.showError(this.props.showError,{changed:o});this.setState(c=>({...c,changed:o,showError:l,isValid:r,error:n,value:t}),()=>{this.props.onChange&&this.props.onChange(t,r,n)})}onBlur(s){const{value:t}=s.target,{error:n,isValid:r}=this.validate(t),o=!0,l=this.showError(this.props.showError,{blurred:o});this.setState(c=>({...c,blurred:o,showError:l,isValid:r,error:n,value:t}),()=>{this.props.onBlur&&this.props.onBlur(t,r,n)})}validate(s){const t=this.props.validator(s);return{error:t,isValid:!t}}showError(s,t={}){const{focused:n,changed:r,blurred:o}={...this.state,...t};return typeof s=="function"?s({focused:n,changed:r,blurred:o}):s}render(){const{id:s,label:t,inline:n,password:r,placeholder:o,className:l,required:c,readOnly:d,disabled:h}=this.props,{onKeyDown:u,onKeyUp:p,onKeyPress:m}=this.props,{iconLeft:f,iconRight:g}=this.props,{showError:T,isValid:x,error:b,value:A}=this.state,C=r?"password":"text",L=`${n?"rec-form-inline-item":"rec-form-item-wrap"} ${l} ${f?"with-left-icon":""} ${g?"with-right-icon":""}`;return e.jsxs("div",{className:L,children:[wt(t)(e.jsxs("label",{htmlFor:s,children:[t,c?e.jsx("mark",{title:"required",children:"*"}):null]})),f?e.jsx(f,{}):null,e.jsx("input",{id:s,value:A,placeholder:o,readOnly:d,disabled:h,className:T&&!x?"rec-error":"",type:C,onFocus:this.onFocus,onChange:this.onChange,onBlur:this.onBlur,onKeyDown:u,onKeyUp:p,onKeyPress:m}),g?e.jsx(g,{}):null,wt(T&&!x)(e.jsx("div",{children:b}))]})}}class qm extends y.PureComponent{static propTypes={id:i.string.isRequired,label:i.string.isRequired,placeholder:i.string,value:i.oneOfType([i.string,i.number,i.bool]).isRequired,className:i.string,inline:i.bool,defaultChecked:i.bool};static defaultProps={placeholder:"",inline:!1,className:""};render(){const{id:s,label:t,inline:n,placeholder:r,value:o,className:l,...c}=this.props,h=`${n?"rec-form-inline-item":"rec-form-check-wrap"} ${l}`,u=`rec-label-checkbox ${c.disabled&&"disabled"}`;return e.jsx("div",{className:h,children:e.jsxs("label",{className:u,htmlFor:s,children:[e.jsx("input",{type:"checkbox",id:s,className:"rec-input-hide",placeholder:r||t,value:o,...c}),e.jsx("span",{className:"rec-input-checkbox"}),t]})})}}class na extends y.PureComponent{static propTypes={id:i.string.isRequired,label:i.string,value:i.string.isRequired,options:i.arrayOf(i.shape({label:i.string.isRequired,value:i.string.isRequired})).isRequired,className:i.string,disabled:i.bool,required:i.bool,validator:i.func,isValid:i.bool,error:i.oneOfType([i.bool,i.string]),showError:i.bool,onChange:i.func.isRequired};static defaultProps={disabled:!1,validator:()=>!1,isValid:!0,error:!1,showError:!0,required:!1,label:"Select an option"};constructor(s){super(s),this.state={isValid:this.props.isValid,error:this.props.error},this.onChange=this.onChange.bind(this)}UNSAFE_componentWillReceiveProps(s){s.isValid!==this.props.isValid&&this.setState(t=>({...t,isValid:s.isValid,error:s.error}))}onChange(s){const t=s.target.value,n=this.props.validator(t),r=!n;this.setState(o=>({...o,isValid:r,error:n}),()=>{this.props.onChange&&this.props.onChange(t,r,n)})}render(){const{id:s,label:t,value:n,options:r,className:o,disabled:l,required:c,showError:d}=this.props,{isValid:h,error:u}=this.state,p=`rec-form-item-wrap ${o}`;return e.jsxs("div",{className:p,children:[e.jsx(Ja,{label:t,isRequired:c,id:s,options:r,onChange:this.onChange,value:n,isInvalid:!h,isDisabled:l}),wt(d&&!h)(e.jsx("div",{children:u}))]})}}const Hu=new RegExp("^(?:(?:\\+?1\\s*(?:[.-]\\s*)?)?(?:\\(\\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\\s*\\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\\s*(?:[.-]\\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\\s*(?:[.-]\\s*)?([0-9]{4})(?:\\s*(?:#|x\\.?|ext\\.?|extension)\\s*(\\d+))?$");class qu extends Ys{}qu.defaultProps={...Ys.defaultProps,placeholder:"(555) 555-1212",validator:a=>!Hu.test(a)&&"Please enter a valid phone number."};i.node;function Xe(a){return{loading:!1,loaded:!1,error:null,data:a}}const Wu=(a,{type:s})=>a({type:s}),Ku=(a,{payload:s,type:t})=>a({type:t,payload:s}),Zu=(a,{message:s,type:t})=>a({type:t,error:s});function Is(a,s,t=void 0,{start:n=Wu,success:r=Ku,failure:o=Zu}={}){return(...l)=>{const c=s(...l);return async(d,h)=>{n(d,{getState:h,type:`${a}_START`,key:t});try{const u=await c(),p=t!==void 0?I(u,`data.${t}`):u.data;if(p===void 0)throw new Error("Did not receive data from the server.");return r(d,{getState:h,payload:p,type:`${a}_SUCCESS`,key:t}),p}catch(u){let p;if(u.response){const m=u.response;if(m.status>=500)switch(m.status){case 500:m.data&&m.data.err?p=m.data.err:p="The server encountered an error processing the request. Try again later.";break;case 501:m.data&&m.data.err?p=m.data.err:p="The server does not know how to respond to that request.";break;case 502:case 503:case 504:m.data&&m.data.err?p=m.data.err:p="The server could not be reached or is not responding. Try again later.";break;default:m.data&&m.data.err?p=m.data.err:p="Something went wrong while talking with the server. Try again later."}else if(m.status>=400)switch(m.status){case 401:m.data&&m.data.err?p=m.data.err:p="You must be logged in to do that action.";break;case 403:m.data&&m.data.err?p=m.data.err:p="Your permissions do not permit you to do that action.";break;case 404:m.data&&m.data.err?p=m.data.err:p="No data for that resource was found.";break;case 422:m.data&&m.data.err?p=m.data.err:p="There are errors in your request, check your inputs and try again.";break;default:m.data&&m.data.err?p=m.data.err:p="A problem with your request has occurred. Try again later."}else m.data&&m.data.err?p=m.data.err:p="A temporary problem has caused your request to fail. Try again later."}else u.request?p="Something went wrong while talking to the server":p=u.message||"Something went wrong unexpectedly";throw o(d,{getState:h,error:u,message:p,type:`${a}_FAILURE`,key:t}),new Error(p)}}}}const Qu=a=>({loading:!0,loaded:!1,error:null,data:a.data}),Xu=(a,s)=>({loading:!1,loaded:!0,error:null,data:s.payload}),Ju=(a,s)=>({loading:!1,loaded:!0,error:s.error,data:a.data});function Ve(a,{initialData:s=null,start:t=Qu,success:n=Xu,failure:r=Ju}={}){const o={loading:!1,loaded:!1,error:null,data:s};return(l=o,c)=>{switch(c.type){case`${a}_START`:return t(l,c,s);case`${a}_SUCCESS`:return n(l,c,s);case`${a}_FAILURE`:return r(l,c,s);default:return l}}}function ep(a,s=null){return(t,n)=>n.type===a?Xe(s):t}function ms(a,s,...t){return(n=a,r)=>typeof r.type>"u"||!r.type.startsWith(s)?n:t.reduce((o,l)=>l(o,r),n)}const sp=-1,tp=0,ap=1,np=2,rp=3;function ip(a){return{isLoading(s,...t){const n={};let r=!0,o=!1;return t.forEach(l=>{r=r&&s[a]&&s[a][l]&&s[a][l].loading,o=o||s[a]&&s[a][l]&&s[a][l].loading,n[l]=s[a]&&s[a][l]&&s[a][l].loading}),n.all=r,n.any=o,n},isLoaded(s,...t){const n={};let r=!0,o=!1;return t.forEach(l=>{r=r&&s[a]&&s[a][l]&&s[a][l].loaded,o=o||s[a]&&s[a][l]&&s[a][l].loaded,n[l]=s[a]&&s[a][l]&&s[a][l].loaded}),n.all=r,n.any=o,n},getState(s,...t){const n={};return t.forEach(r=>{if(!s[a]||!s[a][r])n[r]=sp;else{const o=s[a][r];o.error?n[r]=rp:o.loading?n[r]=ap:o.loaded?n[r]=np:n[r]=tp}}),n},hasErrors(s,...t){const n={};let r=!0,o=!1;return t.forEach(l=>{r=r&&s[a]&&s[a][l]&&s[a][l].error!==null,o=o||s[a]&&s[a][l]&&s[a][l].error!==null,n[l]=s[a]&&s[a][l]&&s[a][l].error!==null}),n.all=r,n.any=o,n},getErrors(s,...t){const n={};return t.forEach(r=>{s[a][r].error!==null&&(n[r]=s[a]&&s[a][r]&&s[a][r].error)}),n}}}function hr({flag:a,flagValueToMatch:s="",fallback:t,children:n}){const o=_e()[a];return typeof o<"u"&&o.includes(s)?e.jsx(e.Fragment,{children:n}):e.jsx(e.Fragment,{children:t})||null}hr.propTypes={flag:i.string.isRequired,children:i.node.isRequired,fallback:i.node,flagValueToMatch:i.string.isRequired};const Le=[],ur=a=>`${Tl}/${a}`,op=(a,s)=>`${ur(a)}/reservation/${s}`;Le[Le.length]={path:"/sitepass/:siteId/create/reservation",componentName:"PassOrderDetailsPage",title:"Order Details"};Le[Le.length]={path:"/sitepass/:siteId/reservation/:resId",componentName:"PassOrderDetailsPage",title:"Order Details"};Le[Le.length]={path:"/sitepass/:siteId/:passTypeId",componentName:"PassSelectionPage",title:"Pass Selection"};Le[Le.length]={path:"/sitepass/:siteId",componentName:"PassSelectionPage",title:"Pass Selection"};function ra({noFeePeriods:a=[],siteName:s}){if(!a)return null;const t=a.sort((n,r)=>_(n.date).diff(r.date));return a&&a.length?e.jsxs("section",{className:"rec-order-detail-need-help",children:[e.jsx("h4",{className:"parkpass-section-heading h6",children:"Fee Free Days"}),e.jsxs("div",{className:"pp-parkpasses-fees",children:[e.jsxs("p",{children:["Fees are waived at ",s," on the following days:"]}),e.jsx("ul",{className:"pp-parkpasses-fee-list",children:t.map(({date:n,end:r,name:o})=>e.jsxs("li",{className:"pp-parkpasses-fee-list-item",children:[_(n.replace(/T.*/,"")).format("ll"),r?` – ${_(r.replace(/T.*/,"")).format("ll")}`:"",": ",o]},o))})]})]}):null}ra.propTypes={noFeePeriods:ar,siteName:i.string};class lp extends y.PureComponent{static defaultProps={checked:!1,className:"",onChange:()=>{},siteName:"our site",siteDomain:"Recreation.gov",needToKnow:[],showCheckbox:!0,noFeePeriods:[]};static propTypes={className:i.string,checked:i.bool,onChange:i.func,needToKnow:i.arrayOf(ps),noFeePeriods:i.arrayOf(i.object),showCheckbox:i.bool,siteName:i.string,siteDomain:i.string};informationRef=Mt.createRef();componentDidMount(){const s=this.informationRef.current;s&&s.scrollHeight-s.clientHeight<=0&&(s.parentElement.classList=`${s.parentElement.classList} no-scrollable-content`)}render(){const{checked:s,className:t,showCheckbox:n,onChange:r,siteName:o,noFeePeriods:l,needToKnow:c,siteDomain:d}=this.props,h=`Please carefully review the important information below ${n?"and click the check box to agree to the rules and regulations":""}. The information in this section only pertains to this pass. Other important visitation policies and details can be found on the ${d} page for ${o}.`;return e.jsxs(en,{introText:h,className:t,isChecked:s,showCheckbox:n,handleChange:()=>r(!s),children:[c.map(({title:u,paragraphs:p=[]},m)=>e.jsxs("section",{className:"rec-order-detail-need-help",children:[!!u&&e.jsx("h3",{className:"parkpass-section-heading h6",children:u}),p.map((f,g)=>e.jsx(Ue,{html:`

${f}

`},`html-${g}`))]},`section-${m}`)),e.jsx(ra,{siteName:o,noFeePeriods:l})]})}}class cp extends y.PureComponent{static defaultProps={overview:[]};static propTypes={overview:i.arrayOf(ps)};render(){const{overview:s}=this.props,[t]=s,n=t?.paragraphs;return e.jsx("div",{className:"parkpass-pass-overview",children:e.jsx(sn,{className:"parkpass-pass-overview-container",id:"parkpass-pass-overview",lineHeight:23,linesToShow:5,children:n?.map((r,o)=>e.jsx(Ue,{html:`

${r}

`},`overview-paragraph-${o}`))})})}}const dp={children:i.node,className:i.string},hp={className:""};class $s extends y.Component{render(){const s=`rec-region-outer-wrap ${this.props.className}`;return e.jsx("div",{className:s,children:this.props.children})}}$s.propTypes=dp;$s.defaultProps=hp;class up extends y.PureComponent{static propTypes={proceedButton:i.node.isRequired};render(){const{proceedButton:s}=this.props;return e.jsx("div",{className:"parkpass-bottom-nav",children:e.jsx("div",{className:"proceed-button",children:s})})}}function pr({onProceedToCartClick:a,heading:s,parentName:t,children:n,imageUrl:r,proceedToCartButtonText:o,isProceedToCartDisabled:l,isWaitingForServerResponse:c,isDrawerWrapFullWidth:d}){const[h,u]=y.useState(!1),p=d?"--full-width":"";return e.jsx("div",{"data-shared-summary-mobile-wrapper":!0,children:e.jsx(wi,{children:e.jsx("div",{"data-component":"MobileProceedToCart",children:e.jsx("div",{className:"shared-ods-m-inner",children:e.jsxs(Z,{className:"shared-bottom-box",padding:"sm",background:"white",children:[e.jsx(Oi,{isOpen:h,onClose:()=>{u(!1)},triggerId:"show-summary-button",label:"Order summary",children:e.jsx("div",{className:`shared-mobile-proceed-to-cart-drawer-wrap${p}`,children:e.jsxs(H,{children:[e.jsx(tn,{aspectRatio:"21:9",src:r,altText:s}),e.jsxs(H,{space:"xxs",children:[e.jsxs(Q,{headingLevel:1,appearance:"h6",children:[s,e.jsxs("span",{className:"rec-sr-only",children:[" ","Order Details Summary"]})]}),e.jsxs(D,{size:"sm",color:"gray",children:["Part of ",t]})]}),e.jsx(is,{}),n]})})}),e.jsxs(ge,{isStretchedToFit:!0,isFullWidthOnMobile:!1,children:[e.jsx(E,{size:"lg",appearance:"link",onClick:()=>{u(m=>!m)},id:"show-summary-button",children:h?"Hide Summary":"Show Summary"}),e.jsx(E,{isLoading:c,size:"lg",isDisabled:l,onClick:()=>{u(!1),a()},children:o})]})]})})})})})}pr.propTypes={onProceedToCartClick:i.func,heading:i.node,parentName:i.node,children:i.node,imageUrl:i.string,isWaitingForServerResponse:i.bool,proceedToCartButtonText:i.string,isProceedToCartDisabled:i.bool,isDrawerWrapFullWidth:i.bool};function mr({children:a,summaryElement:s,...t}){const r=ki().width>=768,{containerRef:o,stuckStatus:l}=Li(100,r);return e.jsxs(e.Fragment,{children:[e.jsx("div",{...t,"data-component":"OrderDetailsLayout",children:e.jsxs("div",{children:[e.jsx("div",{"data-shared-odl-children":!0,children:e.jsx(H,{space:"lg",children:a})}),e.jsx("div",{"data-shared-summary-el-wrapper":!0,ref:o,children:e.jsx("div",{"data-shared-summary-el-wrapper-inner":!0,className:Be({"stuck-top":l==="top","stuck-bottom":l==="bottom"}),children:s})})]})}),e.jsx(Mi,{size:"lg"}),!he(s?.props)&&e.jsx(pr,{...s.props})]})}mr.propTypes={summaryElement:i.node,children:i.node};function fr({imageUrl:a,heading:s,parentName:t,children:n,onProceedToCartClick:r,isProceedToCartDisabled:o,isLoading:l,proceedToCartButtonText:c="Proceed to Cart",secondaryButtonText:d="Continue Shopping",onSecondaryButtonClick:h,isWaitingForServerResponse:u,secondaryButtonIsDisabled:p}){return l?e.jsx(pp,{}):e.jsx("div",{"data-component":"OrderDetailsSummary",children:e.jsxs(Z,{border:"gray",background:"white",children:[!a&&e.jsx(Fi,{aspectRatio:"21:9"}),!!a&&e.jsx(tn,{aspectRatio:"21:9",src:a,altText:s}),e.jsx("div",{className:"inner-padded",children:e.jsxs(H,{children:[e.jsxs(H,{space:"xxs",children:[e.jsxs(Q,{headingLevel:2,appearance:"h6",children:[s,e.jsx("span",{className:"rec-sr-only",children:"Order Details Summary"})]}),t&&e.jsxs(D,{size:"sm",color:"gray",children:["Part of ",t]})]}),e.jsx(is,{}),n,e.jsxs(H,{space:"xs",children:[e.jsx(E,{isLoading:u,onClick:r,isDisabled:o,"data-testid":"OrderDetailsSummary-cart-btn",children:c}),!!h&&e.jsx(E,{onClick:h,isDisabled:p,appearance:"link",children:d})]})]})})]})})}fr.propTypes={onProceedToCartClick:i.func,onSecondaryButtonClick:i.func,heading:i.node,parentName:i.node,children:i.node,imageUrl:i.string,secondaryButtonText:i.string,isProceedToCartDisabled:i.bool,isLoading:i.bool,isWaitingForServerResponse:i.bool,proceedToCartButtonText:i.string,secondaryButtonIsDisabled:i.bool};function pp(){return e.jsx("div",{"data-component":"OrderDetailsSummary",children:e.jsxs(Z,{border:"gray",background:"white",children:[e.jsx(Yi,{aspectRatio:"21:9",children:e.jsx(as,{})}),e.jsx("div",{className:"inner-padded",children:e.jsxs(H,{children:[e.jsxs(H,{space:"xxs",children:[e.jsx(ve,{fontSize:16,width:"80%"}),e.jsx(ve,{fontSize:11,width:"50%"})]}),e.jsx(is,{}),e.jsx(ve,{lines:4}),e.jsxs(H,{space:"xs",children:[e.jsx(as,{height:"4rem"}),e.jsx(as,{height:"4rem"})]})]})})]})})}function gr({isOpen:a,onClose:s,onRemoveClick:t,parentSelector:n}){return a?e.jsxs(bs,{size:"sm",shouldShowCloseButton:!1,shouldActionsStickInMobile:!0,isOpen:a,heading:"Remove from cart?",parentSelector:n||void 0,onRequestClose:s,children:[e.jsx(H,{children:e.jsx(D,{children:"Are you sure you want to remove this item from your cart?"})}),e.jsx(zt,{children:e.jsxs(ge,{isStretchedToFit:!0,children:[e.jsx(E,{appearance:"tertiary",onClick:s,children:"Cancel"}),e.jsx(E,{onClick:t,children:"Remove from Cart"})]})})]}):null}gr.propTypes={isOpen:i.bool,onClose:i.func,onRemoveClick:i.func,parentSelector:i.func};function yr({children:a,heading:s,isOpen:t=!0,onModifyClick:n,onRemoveClick:r,isLoading:o,modifyText:l="Modify",useRemoveConfirmationModal:c=!0,parentSelector:d}){const[h,u]=y.useState(t),[p,m]=y.useState(!1),f=$i(),{isMdAndDown:g}=ls();y.useEffect(()=>{u(t)},[t]);const T=!!n||!!r;if(o)return e.jsx(mp,{});const x=()=>{m(!0)};return e.jsxs("section",{"data-component":"OrderDetailsSection",children:[e.jsxs(Z,{background:"light-blue",border:"blue",padding:"sm",alignX:"space-between",alignY:"flex-start",className:Be({"remove-flex":g}),children:[e.jsx(Q,{headingLevel:2,appearance:"h5",className:"order-details-section-heading",children:e.jsx("button",{"aria-controls":f,type:"button","aria-expanded":h,"data-shared-ods-accordion-trigger":!0,onClick:()=>u(b=>!b),children:e.jsxs("span",{children:[e.jsx(k,{iconName:h?"chevron-down":"chevron-right",size:"md"}),e.jsx("span",{children:s})]})})}),e.jsx(O,{className:Be({"pl-one-and-half pr-1":g}),children:T&&e.jsxs(vs,{noWrap:!0,space:["sm","sm","lg"],className:"OrderDetailsSection-button-wrap mr-1",children:[!!n&&e.jsx(E,{"aria-label":`${l}: ${s}`,size:"md",iconBeforeElement:e.jsx(k,{iconName:"edit"}),appearance:"link",onClick:n,children:e.jsx("span",{children:l})}),!!r&&e.jsx(E,{"aria-label":`Remove ${s}`,size:"md",iconBeforeElement:e.jsx(k,{iconName:"delete"}),appearance:"link",onClick:c?x:r,children:e.jsx("span",{children:"Remove"})})]})})]}),h&&e.jsx(Z,{id:f,padding:"md",border:"gray",className:"shared-expand-section",children:e.jsx(H,{children:a})}),e.jsx(gr,{isOpen:p,parentSelector:d,onClose:()=>{m(!1)},onRemoveClick:r})]})}yr.propTypes={children:i.node,heading:i.node,isOpen:i.bool,isLoading:i.bool,onRemoveClick:i.func,onModifyClick:i.func,modifyText:i.node,useRemoveConfirmationModal:i.bool,parentSelector:i.func};function mp(){return e.jsxs("section",{"data-component":"OrderDetailsSection",children:[e.jsx(Z,{border:"gray",children:e.jsx(as,{height:"5rem"})}),e.jsx(Z,{padding:"md",border:"gray",className:"shared-expand-section",children:e.jsxs(H,{children:[e.jsx(ve,{lines:3}),e.jsx(ve,{lines:2})]})})]})}const As=(a="")=>Gt[a.replace(/,.*/,"")],fp=(a="")=>a.replace(/^.*?,/,"").split(","),Tr=(a="")=>As(a).validLength,ft=(a,s)=>{const t=As(s.duration),n=fp(s.duration),r=au(s.periods,_(a)),o=t.days===365?1:s.duration==="6-month"?t.days/30:t.days>0?t.days-1:t.days,l=t.days===365?"year":s.duration==="6-month"?"month":"days",c=_(a).add(o,l).format("YYYY-MM-DD"),d=_(c);if(!t.endEndOfMonth){const p=_(r.ends_at,"MM-DD");return n.includes("limit-to-season")&&d.isAfter(p)?p:d}const h=d.endOf("month").format();return _(h)},xe="YYYY-MM-DD",gp=(a,s,t,n)=>{let r=!1,o;a.features["day-segment"]?o=_(t||void 0):o=ft(s,a);let c=o?_(o):_();if(a.features["start-date"]&&c.isBefore(s)&&(c=s.clone()),["season","seasonal"].includes(a.duration)&&(o=_(n,xe),!o.isValid())){const[d,h,u]=n?.split("-")??[],p=parseInt(d,10)+1;o=_(`${p}-${h}-${u}`,xe)}if(a.duration.indexOf("limit-to-season")!==-1){const d=As(a.duration).days-1,h=_(s).add(d,"d"),u=h.isAfter(n,"day");o=h,c=h,u&&(o=_(n,xe),c=_(n,xe))}return Ee(a?.duration)&&(!s||he(s))&&(o="",c="",r=!0),{validEndDate:o,endDateMoment:c,isEmptyStartDate:r}};class yp extends y.PureComponent{static defaultProps={number:1,startDate:_().format(xe),endDate:_().format(xe),facility:mt};static propTypes={isScannedPass:i.bool,isInternal:i.bool,endDate:i.string,facility:Qe,isExistingReservation:i.bool,number:i.number,onChangeDaySegments:i.func,onChangeEnd:i.func,onChangeStart:i.func,passType:J,segments:i.object,startDate:i.string,dateInfoText:i.string,renderDateInfoContent:i.func,overrideStartDate:i.bool};daySegmentsTimeout;constructor(s){super(s),this.state={isInclusionsModified:s.isExistingReservation,included:{}},this.state.included=s.segments||this.generateDates(_(this.props.startDate),_(this.props.endDate)).reduce((t,{day:n,key:r,included:o})=>({...t,[n]:{...t[n],[r]:o}}),{})}componentDidMount(){this.props.onChangeStart(this.props.startDate,!0),this.props.onChangeEnd(this.props.endDate,!0),this.daySegmentsTimeout=setTimeout(this.handleChangeDaySegments,250)}componentDidUpdate(s){(s.startDate!==this.props.startDate||s.endDate!==this.props.endDate)&&this.setState({included:this.generateDates(_(this.props.startDate),_(this.props.endDate)).reduce((t,{day:n,key:r,included:o})=>({...t,[n]:{...t[n],[r]:o}}),{})},this.handleChangeDaySegments)}componentWillUnmount(){clearTimeout(this.daySegmentsTimeout)}onStartDateChangedNew=(s,t)=>{if(!s||t?.isInvalid){this.props.onChangeStart("");return}this.props.onChangeStart(s.toString(),!0)};onStartDateChanged=s=>{const t=s&&!_?.isMoment(s)?Ds(s):s;this.props.onChangeStart(t?.clone()?.startOf("day")?.format(xe),!0)};onEndDateChangedNew=(s,t)=>{if(!s||t?.isInvalid){this.props.onChangeEnd("");return}this.props.onChangeEnd(s.toString(),!0)};getTooltipContent=s=>{const t=s&&!_?.isMoment(s)?Ds(s):s,{facility:n,passType:r}=this.props;if(xs(n,r)(t)){if(Kn(n,t))return"Fee-Free Day";if(Zn(n,t)){const o=I(n,"blackout_periods");let l="";return o?.map(d=>{t?.isBetween(d.start_date,_.utc(d.end_date).endOf("day").format(),void 0,[])&&(l=d.name)}),l}return"Unavailable"}return!1};addToInclusion=(s,t,n)=>{this.setState(r=>({isInclusionsModified:!0,included:{...r.included,[t]:{...r.included[t],[n]:s}}}),this.handleChangeDaySegments)};handleChangeDaySegments=()=>{this.props.onChangeDaySegments(this.state.included)};generateDates=(s,t)=>{const{passType:n}=this.props,{isInclusionsModified:r,included:o}=this.state,l=n.features["day-segment"];if(!l)return[];const c=[],d="ddd, ll",h=s.clone().startOf("day"),u=t.clone().add(1,"day").startOf("day"),p=l.segments.length,m=24/p;do for(let f=0;f2&&c.pop(),r||(c[c.length-1].included=!1),c};isBefore=s=>{const t=_().startOf("day");return s.isBefore(t)};isAfter=s=>{const t=_().add(6,"months");return s.isAfter(t)};isOutsideRange=s=>this.isBefore(s)||this.isAfter(s);isDateUnavailable=s=>{const{facility:t,passType:n}=this.props,r=s&&Ds(s);return xs(t,n)(r)||this.isOutsideRange(r)};renderDaySegments=(s,t)=>{const{isInternal:n,passType:r}=this.props;if(!I(r,["features","day-segment"])||n)return null;const o=this.generateDates(s,t),l=o.length===2&&s.clone().startOf("day").isSame(t.clone().startOf("day")),c=o.length>=1&&!l;return e.jsxs("table",{className:"parkpass-pass-day-segment-table",children:[e.jsx("caption",{className:"rec-sr-only",children:"Pass type and date"}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Pass Type"}),e.jsx("th",{children:"Start Date"}),e.jsx("th",{children:"End Date"}),c&&e.jsx("th",{children:"Actions"})]})}),e.jsx("tbody",{children:o.map(({id:d,day:h,start:u,end:p,key:m,label:f,included:g},T)=>l&&T===1?null:e.jsxs("tr",{className:g?"":"parkpass-day-segment-excluded",children:[e.jsx("td",{className:`parkpass-day-segment parkpass-day-segment-${m}`,children:f}),e.jsx("td",{children:u}),e.jsx("td",{children:p}),c&&e.jsx("td",{children:e.jsx("span",{children:g?e.jsx(E,{appearance:"link",gaTrackingId:"393714778882",onClick:this.addToInclusion.bind(this,!1,h,m),"aria-label":"Exclude Pass",iconBeforeElement:e.jsx(k,{iconName:"remove-circle",title:"Exclude Pass"}),children:"Exclude"}):e.jsx(E,{appearance:"link",gaTrackingId:"755075802251",onClick:this.addToInclusion.bind(this,!0,h,m),"aria-label":"Include Pass",iconBeforeElement:e.jsx(k,{iconName:"add-circle",title:"Include Pass"}),children:"Include"})})})]},d))})]})};getDayType=s=>{const{facility:t,passType:n}=this.props,r=s&&!_?.isMoment(s)?Ds(s):s;return xs(t,n)(r)||this.isBefore(r)?"blocked":this.isAfter(r)?"notYetReleased":"available"};renderInitialVisibleMonth=()=>{const{facility:s,passType:t}=this.props,n=_(),r=xs(s,t);for(;r(n)&&n?.isBefore(_().add(1,"year"));)n?.add(1,"day");return n};renderDateInfoContent=()=>{const{dateInfoText:s,renderDateInfoContent:t}=this.props;return t||s?e.jsx(ke,{className:"mb-2",type:"info",children:t?.()||s}):null};render(){const{isScannedPass:s,isInternal:t,number:n,passType:r,startDate:o,endDate:l,facility:c,overrideStartDate:d}=this.props,h=xs(c,r),u=r.features["day-segment"],p=vt(this.renderInitialVisibleMonth());let m,f;const[g,T]=os(r.periods),x=u?"Arrival Date":"Start Date",b=u?"Departure Date":"End Date";if(r.features["start-date"]){if(m=o?_(o):_(),Ee(r.duration)&&(m=o?_(o):""),!he(m)&&!d&&h(m)){for(;h(m)&&m?.isBefore(_().add(1,"year"));)m?.add(1,"day");this.onStartDateChanged(m)}const V=r.duration==="12-month";f=e.jsx("div",{className:"simple-date-picker rec-form-item-wrap",children:e.jsx(Ea,{label:x,isDisabled:s||t&&(!!u||V),isRequired:Ee(r?.duration),defaultValue:m?vt(m):void 0,placeholderValue:p,getDayType:this.getDayType,getTooltipContent:this.getTooltipContent,isDateUnavailable:this.isDateUnavailable,onChange:this.onStartDateChangedNew})})}else["season","seasonal"].includes(r.duration)?m=_(g,xe):Ee(r.duration)?m=o?_(o):"":m=o?_(o):_(),f=e.jsx(Oe,{id:`start-date-${n}`,value:m?.format(Fa),label:x,disabled:!0});const{validEndDate:A,endDateMoment:C,isEmptyStartDate:N}=gp(r,m,l,T),L=e.jsx("div",{className:"simple-date-picker rec-form-item-wrap sitepass-end-date",children:e.jsx(Ea,{label:b,defaultValue:C?vt(C):void 0,getDayType:this.getDayType,getTooltipContent:this.getTooltipContent,isDateUnavailable:this.isDateUnavailable,onChange:this.onEndDateChangedNew,isDisabled:s})});return e.jsxs("div",{children:[e.jsxs(O,{children:[e.jsx(S,{xl:"auto",className:"rec-form-item-wrap",children:f}),e.jsx(S,{xl:"auto",children:u?L:e.jsx(Bi,{id:`through-date-${n}`,className:"rec-form-item-wrap",value:N?"Date":_(A,xe).format(Fa),label:"Valid Through",isDisabled:!0})})]}),this.renderDateInfoContent(),this.renderDaySegments(m,C)]})}}class Tp extends y.Component{static defaultProps={isInternal:!1,number:1,holderInfo:Pt,isMandatory:!0};static propTypes={holderInfo:nr,isInternal:i.bool,isFieldSales:i.bool,submitAttempted:i.bool,number:i.number,isMandatory:i.bool,onChange:i.func};constructor(s){super(s);const{holderInfo:{email:t}}=this.props;this.state={confirmation:t}}componentDidMount(){this.props.onChange(this.props.holderInfo,this.formIsValid(this.props.holderInfo))}handleFieldChange=(s,{target:{value:t}})=>{const n={...this.props.holderInfo,[s]:t};this.props.onChange(n,this.formIsValid(n))};handleEmailConfirmationChange=({target:{value:s}})=>{const t={...this.props.holderInfo,email_confirmation:s};this.props.onChange(t,this.formIsValid(t)),this.setState({confirmation:s})};validateEmail=s=>({isValid:li(s),formattedValue:null,errorText:"Please provide a valid email address"});validateConfirmationEmail=s=>({isValid:this.emailsMatch(this.props.holderInfo.email,s),formattedValue:null,errorText:"Email and confirmation do not match."});emailsMatch=(s,t)=>s&&s===t;formIsValid(s=Pt){const{confirmation:t}=this.state,{first_name:n,last_name:r,email:o}=s;return!!(n&&r&&o&&this.validateEmail(o).isValid&&this.emailsMatch(o,t))}render(){const{isInternal:s,holderInfo:t,submitAttempted:n,number:r,isFieldSales:o,isMandatory:l}=this.props,{confirmation:c}=this.state;return e.jsxs("div",{children:[e.jsxs(O,{children:[e.jsx(S,{xl:"auto",children:e.jsx("div",{className:"rec-form-item-wrap",children:e.jsx(Oe,{label:"First Name",id:`holder-first-name-${r}`,"data-testid":`holder-first-name-${r}`,value:t.first_name,isRequired:l,isDisabled:!!(o&&t.first_name),shouldValidateOnUpdate:n,onChange:this.handleFieldChange.bind(this,"first_name")})})}),e.jsx(S,{xl:"auto",children:e.jsx("div",{className:"rec-form-item-wrap",children:e.jsx(Oe,{label:"Last Name",id:`holder-last-name-${r}`,"data-testid":`holder-last-name-${r}`,value:t.last_name,isRequired:l,isDisabled:!!(o&&t.last_name),shouldValidateOnUpdate:n,onChange:this.handleFieldChange.bind(this,"last_name")})})})]}),e.jsxs(O,{children:[e.jsx(S,{xl:"auto",children:e.jsx("div",{className:"rec-form-item-wrap",children:e.jsx(Oe,{type:"email",label:"Email Address",id:`holder-email-${r}`,value:t.email,isRequired:l,isDisabled:!!(o&&t.email),validator:this.validateEmail,shouldValidateOnUpdate:n,onChange:this.handleFieldChange.bind(this,"email")})})}),e.jsxs(S,{xl:"auto",className:"parkpass-email-confirmation",children:[e.jsx("div",{className:"rec-form-item-wrap",children:!s&&e.jsx(Oe,{type:"email",label:"Re-Enter Email Address",id:`holder-email-confirmation-${r}`,"data-testid":`holder-email-confirmation-${r}`,value:c,isRequired:l,isDisabled:!!(o&&t.email),validator:this.validateConfirmationEmail,shouldValidateOnUpdate:n,onChange:this.handleEmailConfirmationChange})}),!s&&this.emailsMatch(t.email,c)&&e.jsx("span",{className:"parkpass-email-confirmed",children:e.jsx(k,{iconName:"check"})})]})]}),e.jsx(O,{children:e.jsx(S,{xl:"auto",children:e.jsx("div",{className:"rec-form-item-wrap",children:e.jsx(Oe,{id:`holder-zip-code-${r}`,value:t?.zip_code,label:"Zip Code",isRequired:l,onChange:this.handleFieldChange.bind(this,"zip_code")})})})})]})}}class _p extends y.Component{static defaultProps={vehicleInfo:ir};static propTypes={isScannedPass:i.bool,number:i.number,submitAttempted:i.bool,vehicleInfo:rr,passType:J,onChange:i.func.isRequired};constructor(s){super(s),this.state={vehicleType:this.props.vehicleInfo.type,licenseNumber:I(this.props,"vehicleInfo.fields.license","")}}componentDidMount(){this.props.onChange({...this.props.vehicleInfo,fields:{license:this.state.licenseNumber}},this.formIsValid())}componentWillUnmount(){this.props.onChange(this.props.vehicleInfo,!0)}onVehicleTypeChanged=s=>{const{vehicleInfo:t}=this.props,{vehicleType:n}=this.state;if(s!==n){const r=this.getDefaultLicenseNumber(s);this.setState(o=>({...o,vehicleType:s,licenseNumber:r}),()=>{this.props.onChange({...t,type:s,fields:{license:r}},this.formIsValid())})}};onLicenseNumberChanged=s=>{const{vehicleInfo:t}=this.props;this.setState(n=>({...n,licenseNumber:s}),()=>{this.props.onChange({...t,fields:{license:s}},this.formIsValid())})};getDefaultLicenseNumber=s=>{const{license_required:t}=I(this.props,`passType.features['equipment-info']['vehicle']['${s}']`,{});return t?"":"N/A"};isMissingLicenseNumber(s,t){return I(this.props.passType,["features","equipment-info","vehicle",t,"license_required"])?s==="":!1}formIsValid(){const{vehicleType:s,licenseNumber:t}=this.state;return!this.isMissingLicenseNumber(t,s)}render(){const{isScannedPass:s,number:t,passType:n,submitAttempted:r}=this.props;let{vehicleType:o}=this.state,{licenseNumber:l}=this.state;const c=I(n,["features","equipment-info","vehicle"]);if(!c)return null;(!o||!c[o])&&(o=Object.keys(c)[0],this.onVehicleTypeChanged(o)),l||(l=this.getDefaultLicenseNumber(o));const d=c[o]||{},h=I(d,"license_required");return e.jsxs(O,{className:s?"scanned-pass":"",children:[e.jsx(S,{xl:"auto",children:e.jsx(na,{required:!0,label:"Vehicle Type",id:`vehicle-type-${t}`,value:o,options:[...Object.entries(c).map(([u,{name:p}])=>({label:p,value:u}))],onChange:this.onVehicleTypeChanged,disabled:s})}),e.jsx(S,{xl:"auto",children:e.jsx(Oe,{isRequired:h,label:"License Plate Number",id:`vehicle-license-${t}`,"data-testid":`vehicle-license-${t}`,value:l,disabled:s||!h,shouldValidateOnUpdate:r,onChange:u=>this.onLicenseNumberChanged(u.target.value)})})]})}}class xp extends y.Component{static defaultProps={watercraftInfo:lr};static propTypes={isScannedPass:i.bool,number:i.number,submitAttempted:i.bool,watercraftInfo:or,passType:J,onChange:i.func.isRequired};constructor(s){super(s),this.state={watercraftType:this.props.watercraftInfo.type,licenseNumber:I(this.props,"watercraftInfo.fields.license","")}}componentDidMount(){this.props.onChange({...this.props.watercraftInfo,fields:{license:this.state.licenseNumber}},this.formIsValid())}componentWillUnmount(){this.props.onChange(this.props.watercraftInfo,!0)}onWatercraftTypeChanged=s=>{const{watercraftInfo:t,watercraftType:n,licenseNumber:r}=this.state;if(s!==n){const o=this.getDefaultLicenseNumber(s),l=o!==r?o:r;this.setState({watercraftType:s,licenseNumber:l},()=>{this.props.onChange({...t,type:s,fields:{license:l}},this.formIsValid())})}};onLicenseNumberChanged=s=>{const{watercraftInfo:t}=this.props;this.setState(n=>({...n,licenseNumber:s}),()=>{this.props.onChange({...t,fields:{license:s}},this.formIsValid())})};getDefaultLicenseNumber=s=>{const{license_required:t}=I(this.props,`passType.features['equipment-info']['watercraft']['${s}']`,{});return t?"":"N/A"};isMissingLicenseNumber(s,t){return I(this.props.passType,["features","equipment-info","watercraft",t,"license_required"])?s==="":!1}formIsValid(){const{watercraftType:s,licenseNumber:t}=this.state;return!this.isMissingLicenseNumber(t,s)}render(){const{isScannedPass:s,number:t,passType:n,submitAttempted:r}=this.props,o=I(n,["features","equipment-info","watercraft"]);if(!o)return null;let{watercraftType:l}=this.state;(!l||!o[l])&&(l=Object.keys(o)[0]),this.onWatercraftTypeChanged(l);const{licenseNumber:c}=this.state,d=I(o,`${l}.license_required`);return e.jsxs(ns,{className:s?"scanned-pass":"",children:[e.jsx(Ae,{width:6,children:e.jsx(na,{required:!0,label:"Boat Type",id:`watercraft-type-${t}`,value:l,options:Object.entries(o).map(([h,{name:u}])=>({label:u,value:h})),onChange:this.onWatercraftTypeChanged})}),e.jsx(Ae,{width:6,children:e.jsx(Oe,{isRequired:d,label:"Boat Registration Number",id:`watercraft-license-${t}`,value:c,disabled:!d,shouldValidateOnUpdate:r,onChange:h=>this.onLicenseNumberChanged(h.target.value)})})]})}}class vp extends y.PureComponent{static defaultProps={groups:{},isDisabled:!1};static propTypes={groups:er,attendeeInfo:i.shape({adults:i.number,visitors:i.number}),isRequired:i.bool,onChange:i.func,facilityId:i.string,isDisabled:i.bool};state={currentGuestsCount:{},validOverallGuestCount:!0};componentDidMount(){this.props.onChange(this.props.attendeeInfo,!0),this.setState(()=>({currentGuestsCount:this.getCounts()}),()=>{this.setState(s=>({validOverallGuestCount:!this.invalidGuestSelection(s.currentGuestsCount)}))})}getCounts=()=>{const{groups:s={},attendeeInfo:t={}}=this.props,n={};if(s===null||t===null)return n;for(const r of Object.keys(s)){const o=this.getMin(r);n[r]=t[r]||o}return n};useOverallCount=()=>Cl.includes(this.props.facilityId);handleChangeCount=(s,t)=>{const n=this.getMin(s),r=this.getCounts();r[s]=t>=n?t:n,this.props.onChange(r,!0)};handleChangeCountOverall=(s,t)=>{let{currentGuestsCount:n}=this.state;he(n)&&(n=this.getCounts()),n[s]=t;const r=this.invalidGuestSelection(n);this.setState(()=>({currentGuestsCount:n,validOverallGuestCount:!r})),this.props.onChange(n,!r)};getMinOverall=()=>{if(!this.useOverallCount())return-1;const{groups:s}=this.props,t=Object.keys(s),n=s[t[0]];return n?.attendee_min?n.attendee_min:n?.min_count?n.min_count:n&&n.is_required?1:0};getMaxOverall=()=>{if(!this.useOverallCount())return-1;const{groups:s}=this.props,t=Object.keys(s);if(!he(t)){const n=s[t[0]];if(n?.attendee_max)return n.attendee_max}return Ps};getOverallValue=s=>{if(he(s))return 2;let t=0;for(const n of Object.keys(s))t+=s[n];return t};invalidGuestSelection=s=>{const t=this.getOverallValue(s),n=this.getMinOverall(),r=this.getMaxOverall();return tr};getMin=s=>{if(this.useOverallCount())return 1;const{groups:t}=this.props,n=t[s]||{};return n?.attendee_min?n.attendee_min:n?.min_count?n.min_count:n&&n.is_required?1:0};render(){const{groups:s,isDisabled:t}=this.props;if(!s||Object.keys(s).length===0&&s.constructor===Object)return null;if(this.useOverallCount())return e.jsxs(e.Fragment,{children:[e.jsx(O,{className:"attendee-info-form",children:Object.values(s).map(r=>{const o=r.name||r.key,l=`Number of ${Sa(o)}`;return e.jsx(S,{lg:6,children:e.jsx("div",{className:"rec-form-item-wrap",children:e.jsx("ul",{className:"rec-guest-counter-wrap",children:e.jsx(ba,{id:r.key,guestType:{key:o,type:o,label:l,...r},isRequired:r.is_required||this.props.isRequired,count:this.state.currentGuestsCount[o],changeCount:this.handleChangeCountOverall,isDecreaseDisabled:t,maxTotalGuestsReached:t},o)})})},o)})}),!this.state.validOverallGuestCount&&e.jsx(ke,{type:"info",children:`The total number of Adults and Children should be a minimum of ${this.getMinOverall()} and maximum of ${this.getMaxOverall()}`})]});const n=this.getCounts();return e.jsx(O,{className:"attendee-info-form",children:Object.values(s).map(r=>{const o=r.name||r.key,l=`Number of ${Sa(o)}`,c=this.getMin(o);return e.jsx(S,{lg:6,children:e.jsx("div",{className:"rec-form-item-wrap",children:e.jsx("ul",{className:"rec-guest-counter-wrap",children:e.jsx(ba,{id:r.key,guestType:{key:o,type:o,label:l,...r},isRequired:r.is_required||this.props.isRequired,isDecreaseDisabled:r.is_required&&n[o]<=c||t,count:n[o],maxTotalGuestsReached:r.attendee_max>=Ps||r.max_count>=Ps||n[o]>=Ps||t,changeCount:this.handleChangeCount},o)})})},o)})})}}function _r(a){const{options:s,selectedOptions:t,isScannedPass:n,reservationPosition:r,submitAttempted:o,onChange:l}=a;if(!s)return null;let c={};t&&(c=t.reduce((h,u)=>({...h,[u.type]:u.value}),{}));const d=(h,u)=>{const m=s.filter(f=>f.is_required).reduce((f,g)=>f&&(g.type===h||!!c[g.type]&&c[g.type]!==""),!0);l({type:h,value:u.target.value},m)};return e.jsx(O,{className:`option-select-form ${n?"scanned-pass":""}`,children:s.map(h=>e.jsx(S,{lg:6,children:e.jsx(Ja,{id:`option-select-${h.type}-${r}`,label:h.label,isRequired:h.is_required,placeholder:h.label,errorText:`${h.label} is required`,isInvalid:o&&h.is_required&&!c[h.type],options:h.values,value:c[h.type],onChange:u=>d(h.type,u)})},h.type))})}_r.propTypes={options:i.any,selectedOptions:i.any,reservationPosition:i.any,submitAttempted:i.bool,onChange:i.func,isScannedPass:i.bool};class xr extends y.Component{static defaultProps={number:1,onChange:()=>{},onRemove:()=>{},submitAttempted:!1,facility:mt,passType:dr,isHolderInfoMandatory:!0};static propTypes={disabled:i.bool,facility:Qe,isInternal:i.bool,isLegacy:i.bool,isPending:i.bool,isScannedPass:i.bool,number:i.number,onChange:i.func,onRemove:i.func,passInfo:ta,passType:J,renderModify:i.bool,renderRemove:i.bool,submitAttempted:i.bool,reservationId:i.string,reset:i.bool,isFieldSales:i.bool,dateInfoText:i.string,renderDateInfoContent:i.func,isHolderInfoMandatory:i.bool,parentSelector:i.func,isRequired:i.bool};state={attendeeInfoIsValid:!0,endDate:void 0,endDateIsValid:!0,features:{},holderInfoIsValid:!0,interagencyType:"",isAddingDiscount:!!I(this.props.passInfo,"features.discount.pass_number",!1),passInfo:this.props.passInfo,startDateIsValid:!0,vehicleInfoIsValid:!0,watercraftInfoIsValid:!0,optionSelectIsValid:!0,isRemoving:!1};passInfoFormRef=null;componentDidMount(){this.props.isInternal&&this.passInfoFormRef&&this.passInfoFormRef.querySelectorAll("input, textarea, button, select, .rec-select, .rec-dropdown").forEach(s=>s.tabIndex=-1)}componentDidUpdate(s,t){Es(this.state.passInfo,t.passInfo)||this.props.onChange(this.props.passType.id,this.state.passInfo,this.formIsValid());const{reset:n,passInfo:r}=this.props;n&&this.setState(()=>({passInfo:r}))}onRemove=()=>{this.setState({isRemoving:!0},()=>{const{reservationId:s}=this.props;this.props.onRemove(s)})};onModify=()=>{const{passType:s,reservationId:t}=this.props;window.location.assign(op(s.facility_id,t))};onStartDateChanged=(s,t)=>{this.setState(n=>({...n,passInfo:{...n.passInfo,start_date:s,features:{...n.passInfo.features,"start-date":s}},startDateIsValid:t}))};onEndDateChanged=(s,t)=>{const{passType:n}=this.props,r=this.props?.passInfo?.duration,o=this.props?.passInfo?.start_date;let l=ft(o,n);const[,c]=os(this.props?.passType?.periods),[d,h,u]=c?.split("-")??[void 0,void 0,void 0],p=parseInt(d,10)+1;l.isValid()||(l=_(`${p}-${h}-${u}`));const m=r==="season"||r==="seasonal"?l:s;this.setState(f=>({...f,endDate:m,passInfo:{...f.passInfo,endDate:m,features:{...f.passInfo.features,"end-date":m}},endDateIsValid:t}))};onDaySegmentsChanged=s=>{this.setState(t=>({...t,passInfo:{...t.passInfo,features:{...t.passInfo.features,"day-segment":{...t.passInfo.features["day-segment"],segments:s}}}}))};onVehicleInfoChanged=(s,t)=>{this.setState(n=>({...n,passInfo:{...n.passInfo,vehicle_info:s,features:{...n.passInfo.features,"equipment-info":{...n.passInfo.features["equipment-info"],vehicle:s}}},vehicleInfoIsValid:t}))};onWatercraftInfoChanged=(s,t)=>{this.setState(n=>({...n,passInfo:{...n.passInfo,watercraft_info:s,features:{...n.passInfo.features,"equipment-info":{...n.passInfo.features["equipment-info"],watercraft:s}}},watercraftInfoIsValid:t}))};onOptionSelectChange=(s,t)=>{const{type:n}=s;this.setState(r=>{let o=I(r,["passInfo","features","option-select"]);return o||(o=[]),{...r,passInfo:{...r.passInfo,features:{...r.passInfo.features,"option-select":o.filter(l=>l.type!==n).concat([s])}},optionSelectIsValid:t}})};onHolderInfoChanged=(s,t)=>{this.setState(n=>({...n,passInfo:{...n.passInfo,holder_info:s},holderInfoIsValid:t}))};onAttendeeInfoChanged=(s,t)=>{const n=this.props.passType.features["day-segment"]?{"day-segment":{...this.state.passInfo.features["day-segment"],groups:s}}:{};this.setState(r=>({...r,passInfo:{...r.passInfo,attendee_info:s,features:{...r.passInfo.features,"attendee-info":s,...n}},attendeeInfoIsValid:t}))};handleDiscountChange=s=>{this.setState(t=>({...t,passInfo:{...t.passInfo,features:{...t.passInfo.features,discount:{pass_number:s}}}}))};handleInteragencyTypeChange=s=>{this.setState({interagencyType:s})};formIsValid(){const{endDateIsValid:s,startDateIsValid:t,vehicleInfoIsValid:n,watercraftInfoIsValid:r,optionSelectIsValid:o,holderInfoIsValid:l,attendeeInfoIsValid:c}=this.state,{passType:{features:d}}=this.props;let h=!0;return d["end-date"]&&(h=h&&s),d["start-date"]&&(h=h&&t),I(d,["equipment-info","vehicle"])&&(h=h&&n),I(d,["equipment-info","watercraft"])&&(h=h&&r),I(d,["option-select"])&&(h=h&&o),d["attendee-info"]&&(h=h&&c),h=h&&l,h}renderAttendeeInfo=()=>{const{facility:s,isInternal:t,passType:n,number:r,submitAttempted:o,isPending:l,reservationId:c,isFieldSales:d,dateInfoText:h,renderDateInfoContent:u,isHolderInfoMandatory:p}=this.props,{passInfo:m,endDate:f}=this.state,g=ho(Object.keys(I(m,["features","day-segment","segments"],{}))),T=_(g).format();return e.jsxs("div",{children:[t&&e.jsx("h3",{children:"Pass Holder Details"}),e.jsx(Tp,{number:r,isInternal:t,submitAttempted:o,holderInfo:m?.holder_info,passType:n,onChange:this.onHolderInfoChanged,isFieldSales:d,isMandatory:p}),t&&e.jsxs("div",{children:[e.jsx("h3",{children:"Pass Details"}),e.jsxs(ns,{children:[e.jsx(Ae,{width:6,children:e.jsx(Ys,{id:`facility_name_${r}`,value:m?.facility_name,label:"Facility Name"})}),e.jsx(Ae,{width:6,children:e.jsx(Ys,{id:`pass_name_${r}`,value:m?.pass_name,label:"Pass Name"})})]})]}),e.jsx(yp,{isInternal:t,startDateDisabled:!1,number:r,isExistingReservation:!!c&&!l,startDate:m?.features["start-date"],endDate:f||T,segments:I(m,["features","day-segment","segments"]),passType:n,dateInfoText:h,renderDateInfoContent:u,onChangeStart:this.onStartDateChanged,onChangeEnd:this.onEndDateChanged,onChangeDaySegments:this.onDaySegmentsChanged,facility:s})]})};renderFeatureAttendeeInfo=()=>{const{passType:s,number:t}=this.props,{passInfo:n}=this.state;return e.jsx(vp,{number:t,isRequired:this.props.isRequired,facilityId:this.props.facility?.id,groups:s?.features["attendee-info"]||I(s,["features","day-segment","groups"]),attendeeInfo:n?.features["attendee-info"]||I(n,["features","day-segment","groups"]),passType:s,onChange:this.onAttendeeInfoChanged})};renderVehicleInfo=()=>{const{isScannedPass:s,passType:t,submitAttempted:n,number:r}=this.props,{passInfo:o}=this.state;return I(t,["features","equipment-info","vehicle"])?e.jsx(_p,{isScannedPass:s,number:r,submitAttempted:n,vehicleInfo:o?.features["equipment-info"].vehicle,passType:t,onChange:this.onVehicleInfoChanged}):null};renderWatercraftInfo=()=>{const{isScannedPass:s,passType:t,submitAttempted:n,number:r}=this.props,{passInfo:o}=this.state;return I(t,["features","equipment-info","watercraft"])?e.jsx(xp,{isScannedPass:s,number:r,submitAttempted:n,watercraftInfo:o.features["equipment-info"].watercraft,passType:t,onChange:this.onWatercraftInfoChanged}):null};renderOptionSelectInfo=()=>{const{passType:s,submitAttempted:t,number:n}=this.props,{passInfo:r}=this.state,o=I(s,["features","option-select"]);return o?e.jsx(_r,{options:o,selectedOptions:r?.features["option-select"],reservationPosition:n,submitAttempted:t,onChange:this.onOptionSelectChange}):null};renderDiscount=()=>{const{isInternal:s,number:t,submitAttempted:n,passType:r}=this.props,{passInfo:o,isAddingDiscount:l,interagencyType:c}=this.state;return!I(r,["features","discount"])||s?null:e.jsxs(ns,{children:[e.jsx(Ae,{width:6,children:l?e.jsx("div",{children:e.jsx(na,{required:!0,id:`discount_pass_type_${t}`,label:"Pass Type",value:c||I(o?.features,["discount","pass_type"],""),options:Rl.map(d=>({label:d,value:d})),onChange:this.handleInteragencyTypeChange})}):e.jsx(E,{appearance:"secondary",onClick:()=>this.setState({isAddingDiscount:!0}),iconBeforeElement:e.jsx(k,{iconName:"cart-add"}),gaTrackingId:"514881135263",children:"Add a Pass Discount"})}),l&&e.jsx(Ae,{width:6,children:e.jsx("div",{children:e.jsx(Oe,{isRequired:!0,id:`discount_pass_type_${t}`,label:"Pass ID",shouldValidateOnUpdate:n,value:I(o?.features,["discount","pass_number"],""),onChange:d=>this.handleDiscountChange(d.target.value)})})})]})};renderPassHolderName(){const{passInfo:s}=this.state;return s?.holder_info&&s?.holder_info?.first_name?e.jsx("span",{className:"parkpass-pass-info-form-heading-passholder",children:`: ${s?.holder_info.first_name} ${s?.holder_info.last_name}`}):null}render(){const{disabled:s,isInternal:t,isLegacy:n,isPending:r,number:o,passType:l,renderModify:c,renderRemove:d,reservationId:h,parentSelector:u}=this.props,p=!!h&&!r;return e.jsx("div",{id:`parkpass-pass-info-form-${o}`,className:`parkpass-pass-info-form ${s?"parkpass-pass-info-form--disabled":""}`,ref:m=>(this.passInfoFormRef=m,null),children:e.jsx(yr,{heading:!t&&e.jsxs("span",{className:"parkpass-pass-info-form-heading",children:[e.jsxs("span",{children:[o,". "]}),l.name,this.renderPassHolderName()]}),onModifyClick:!t&&c&&this.onModify,onRemoveClick:!t&&d&&this.onRemove,useRemoveConfirmationModal:p,parentSelector:u,children:e.jsxs("div",{className:"parkpass-pass-info-form-form",children:[n&&e.jsx(js,{noticeType:"warning",closeButton:!1,children:e.jsxs("p",{children:["This pass was purchased through YourPassNow before Site Pass were offered on","Recreation.gov",". A refund cannot be issued for this pass as it is a legacy purchase prior to integration with ","Recreation.gov","."]})}),this.renderAttendeeInfo(),this.renderVehicleInfo(),this.renderWatercraftInfo(),this.renderFeatureAttendeeInfo(),this.renderOptionSelectInfo(),this.renderDiscount()]})})})}}const Ep="MM/DD/YYYY";class bp extends y.Component{static defaultProps={passTypes:[],sortFn:(s,t)=>parseFloat(We(t.periods).replace(/\/.*|\D/g," "))-parseFloat(We(s.periods).replace(/\/.*|\D/g," "))};static propTypes={passTypes:i.arrayOf(J),sortFn:i.func};state={isOpen:!1};toggleOpen=()=>this.setState(({isOpen:s})=>({isOpen:!s}));render(){const{passTypes:s}=this.props,{isOpen:t}=this.state,n=s.flatMap(l=>l.periods).filter(l=>l).filter(l=>_().isBefore(l.start_date)),r=uo(n,"start_date").map(({start_date:l})=>l).sort(),o=s.filter(l=>l.periods.some(c=>_().isBefore(c.start_date)));return r.length<1?null:e.jsxs("div",{className:"parkpass-pass-rates",children:[e.jsxs("div",{className:"parkpass-pass-rates-increases",role:"button",tabIndex:"0",onClick:this.toggleOpen,onKeyDown:l=>{(l.code==="Space"||l.code==="Enter"||l.which==="32"||l.which==="13")&&(l.preventDefault(),this.toggleOpen())},children:[t?e.jsx(k,{iconName:"chevron-up"}):e.jsx(k,{iconName:"chevron-down"}),"Pass Rates - See upcoming price increases"]}),t&&e.jsx("div",{className:"parkpass-pass-types-table-wrapper",children:e.jsxs("table",{className:"parkpass-pass-types-table parkpass-pass-rates-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:" YEARLY RATES"}),r.map(l=>e.jsx("th",{children:_(l).format(Ep).replace(/^01\/01\//,"")},l))]})}),e.jsx("tbody",{children:o.sort(this.props.sortFn).map(l=>{let c="";return e.jsxs("tr",{children:[e.jsx("td",{children:l.name}),r.map((d,h)=>{const u=l.periods.find(({start_date:f})=>f===d),p=u?We([u],d,!0):c;c=p;const m=u?p:c;return e.jsx("td",{children:m},`pass-rate-col-${l.id}-${h}`)})]},`pass-rate-row-${l.id}`)})})]})})]})}}const vr=(a,s={})=>{if(!a)return!1;const t=!!s?.default;return!s?.hasOwnProperty(a)?t:!!s?.[a]},ia=(a,s={})=>kl?.indexOf(a)>=0?!1:vr(a,s),oa=(a,s={})=>vr(a,s),Er=(a=!1)=>!!a;function br({facilityId:a="",onToggleShowPasses:s=()=>{}}){const{facilitiesUsingSitePassIntegration:t}=_e(),n=y.useMemo(()=>Ht?.[a]??null,[a]),r=y.useMemo(()=>ia(a,t),[t,a]),o=y.useCallback(()=>{window.location.href=`/timed-entry/${n?.timedEntryFacilityId}`},[n?.timedEntryFacilityId]),l=()=>n?.areasWithReservation?.length?e.jsxs("div",{className:"LEGACY_site-pass-banner__list-container LEGACY_site-pass-banner__info-content-item",children:[e.jsx(D,{id:"LEGACY_site-pass-banner-list-title",className:"LEGACY_site-pass-banner__list-title","aria-hidden":"true",children:n?.areaListTitle||"Areas that require a reservation:"}),e.jsx("ul",{className:"LEGACY_site-pass-banner__list","aria-labelledby":"LEGACY_site-pass-banner-list-title",children:n?.areasWithReservation?.map((d,h)=>e.jsx("li",{className:"LEGACY_site-pass-banner__list-item","aria-label":`${d?.name} ${d?.dates}`,children:e.jsxs("div",{className:"LEGACY_site-pass-banner__list-content","aria-hidden":"true",children:[e.jsx(D,{id:"LEGACY_site-pass-banner__list-name",className:"LEGACY_site-pass-banner__list-name",tag:"span",children:d?.name}),d?.dates&&e.jsxs(e.Fragment,{children:[e.jsx(k,{iconName:"calendar",className:"LEGACY_site-pass-banner__list-date-icon",size:"sm"}),e.jsx(D,{id:"LEGACY_site-pass-banner__list-date-text",className:"LEGACY_site-pass-banner__list-date-text",fontStyle:"italic",tag:"span",size:"sm",children:d?.dates})]})]})},h))})]}):null,c=()=>n?.hideBookReservationButton&&n?.hideShowAvailablePassesButton?null:e.jsxs(ge,{className:"LEGACY_site-pass-banner__buttons-container",isStacked:!0,children:[!n?.hideBookReservationButton&&e.jsx(E,{id:"LEGACY_site-pass-banner-button-reservation",className:"LEGACY_site-pass-banner__button-reservation",appearance:"solid-white",clickTagAction:`Location ID - ${a}`,clickTagCategory:"Site Pass",clickTagLabel:"Pass Upsell Promo - Book Reservation Now Button",iconBeforeElement:e.jsx(k,{iconName:"car",id:"LEGACY_site-pass-banner-button-reservation-icon",className:"LEGACY_site-pass-banner__button-icon"}),onClick:o,children:"Book Reservation Now"}),!n?.hideShowAvailablePassesButton&&e.jsx(E,{id:"LEGACY_site-pass-banner-button-show-passes",className:"LEGACY_site-pass-banner__button-show-passes",appearance:"tertiary-white",clickTagAction:`Location ID - ${a}`,clickTagCategory:"Site Pass",clickTagLabel:"Pass Upsell Promo - Show Available Passes Button",iconBeforeElement:e.jsx(k,{iconName:"card",id:"LEGACY_site-pass-banner-button-show-passes-icon",className:"LEGACY_site-pass-banner__button-icon"}),onClick:s,children:"Show Available Passes"})]});return!n||!r?null:e.jsxs("div",{className:"LEGACY_site-pass-banner",children:[e.jsx("div",{className:"LEGACY_site-pass-banner__img-background"}),e.jsxs("div",{className:"LEGACY_site-pass-banner__content",children:[e.jsxs("div",{className:"LEGACY_site-pass-banner__left-content",children:[e.jsxs("div",{className:"LEGACY_site-pass-banner__content-header",children:[e.jsx(k,{iconName:"info",className:"LEGACY_site-pass-banner__content-header-icon",size:"sm"}),e.jsx(Q,{id:"LEGACY_site-pass-banner-title",className:"LEGACY_site-pass-banner__title",headingLevel:2,appearance:"h4",children:n?.title})]}),e.jsxs("div",{className:"LEGACY_site-pass-banner__content-body",children:[e.jsx(Q,{id:"LEGACY_site-pass-banner-description",className:"LEGACY_site-pass-banner__description",headingLevel:2,appearance:"h6",children:n?.description}),e.jsx("div",{className:"LEGACY_site-pass-banner__info-content",children:l()})]})]}),e.jsx("div",{className:"LEGACY_site-pass-banner__right-content",children:c()})]})]})}br.propTypes={facilityId:i.string,onToggleShowPasses:i.func};const jp=Ve(Tn),Sp=ms(Xe([]),ie,jp),Rp=Ve(_n),Cp=ms(Xe(mt),ie,Rp),Ip=Ve(vn,{initialData:[]}),Ap=ms(Xe([]),ie,Ip),gt={getPassTypes:a=>a.parkpass.passTypes.data},Dp=Ve(xn),Np=ms(Xe(mt),ie,Dp),la={getFacilityByIdOrSlug:a=>I(a,"parkpass.facilityByIdOrSlug.data",[])},Pp=Ve(En),wp=ms(Xe(dr),ie,Pp),Op=Ve(bn),kp=Ve(jn),Lp=Ve(Sn),Mp=ep(fl,[]),Fp=ms(Xe([]),ie,Op,kp,Lp,Mp),jr={getReservations:a=>a.parkpass.reservations.data},Yp={qrCode:""},$p=(a=Yp,s)=>{switch(s.type){case gl:return{...a,qrCode:s.payload.qr_code};default:return a}},Bp={reservation:null},Up=(a=Bp,s)=>{switch(s?.type){case Cn:return{...a,reservation:s?.payload};case In:return{...a,reservation:null};default:return a}};function zp(a=[],s){const t=a.slice();switch(s.type){case`${rs}_START`:return xt(t,`[${s.number}]`,{loading:!0,loaded:!1,error:null,data:[]}),t;case`${rs}_SUCCESS`:return xt(t,`[${s.number}]`,{loading:!1,loaded:!0,error:null,data:s.payload}),t;case`${rs}_FAILURE`:return xt(t,`[${s.number}]`,{loading:!1,loaded:!0,error:s.error||s.message,data:I(a,`[${s.number}].data`)}),t;case Rn:return t.splice(s.number,1),t;default:return a}}const Ot={getValidationProblems:a=>a.parkpass.validation.map(({data:s})=>s),getValidationErrors:a=>a.parkpass.validation.map(({error:s})=>s)},{isLoaded:ca,isLoading:da,getErrors:Sr}=ip("parkpass"),Vp=ci({facilities:Sp,facility:Cp,passType:wp,passTypes:Ap,facilityByIdOrSlug:Np,validation:zp,reservations:Fp,passes:$p,localReservation:Up}),Gp=a=>typeof a=="function";function ee(a){return s=>a?Gp(s)?s():s:null}function Hp(a,s){if(!s)return null;if(a.includes("Missing feature")){const t=s.features["option-select"];let n="",r=!0;for(const o of t)r||(n=`${n}, `),n=`${n}${o.label}`,r=!1;return a.includes("start-date")&&(n="Start date"),`${n}: Must not be empty.`}return null}function qp(a,s,t){if(!t)return`option-select-${a}`;const n=t.features["option-select"];return n.length<1?`${a}`:`option-select-${n[0].type}-${a}`}let Wp=class extends Mt.PureComponent{static propTypes={validationErrors:i.arrayOf(i.arrayOf(i.string)).isRequired,submitAttempted:i.bool.isRequired,needToKnowChecked:i.bool.isRequired,errors:i.shape({reservations:i.arrayOf(i.shape({error_code:i.string,error_message:i.string}))}).isRequired,passTypes:i.arrayOf(J).isRequired,reservations:i.arrayOf(ze).isRequired};hasErrorMessage=(s={})=>{const t=Object.entries(s).filter(([,n])=>!he(n)&&!se(n));return!he(t)};hasValidationErrors=()=>{const{errors:s,submitAttempted:t,needToKnowChecked:n}=this.props,o=(Array.isArray(s.reservations)?s.reservations:[]).filter(({error_code:l})=>l!==void 0);return t&&!n||o.length};formatError(s,t){const n=s.split(": ");let r="",o=s;if(n.length===3&&(r=n[1],o=`: ${n[2]}`),n.length===2&&(o=n[1]),o.includes("option-select")){const l=Hp(s,t);if(l!==null)return l}return`${r}${o}`}errorObject(s,t,n){return{inputId:this.inputId(t,s,n),errorText:this.formatError(s,n)}}errorSectionHeader(s,t){return`${s}. ${t.toUpperCase()}`}inputId(s,t,n){return t.includes("First Name")?`holder-first-name-${s}`:t.includes("Last Name")?`holder-last-name-${s}`:t.includes("Email Confirmation")?`holder-email-confirmation-${s}`:t.includes("Email")?`holder-email-${s}`:t.includes("personal-vehicle")?`vehicle-license-${s}`:t.includes("motorized-boat")?`watercraft-license-${s}`:t.includes("start-date")?`start-date-${s}`:t.includes("option-select")?qp(s,t,n):`${s}`}renderReservationErrors(){const{validationErrors:s,submitAttempted:t,needToKnowChecked:n,reservations:r,passTypes:o}=this.props,l={};return s.forEach((c,d)=>{if(!c||c.length===0)return;let h="",u=null;o&&(u=o.find(({id:p})=>p===r[d]?.pass_type_id),u&&u.name&&(h=u.name)),l[this.errorSectionHeader(d+1,h)]=c.map(p=>this.errorObject(p,d+1,u))}),t&&(r.forEach((c,d)=>{const h=o.find(({id:u})=>u===r[d]?.pass_type_id);c?.holder_info?.email_confirmation&&c?.holder_info?.email!==c?.holder_info?.email_confirmation&&(l[this.errorSectionHeader(d+1,h?.name)]=[this.errorObject("Email Confirmation: Email and confirmation do not match.",d+1,h?.name)])}),n||(l.GENERAL=[{inputId:"need-to-know-checkbox",errorText:"Consent Checkbox: Please read and agree to the important information below."}])),l}render(){const{errors:s}=this.props;return e.jsxs("div",{className:"pass-selection-error-wrapper",children:[e.jsx("div",{className:"rec-order-details-error",children:e.jsx(Ui,{errors:this.renderReservationErrors()})}),ee(!this.hasValidationErrors()&&Object.keys(s).length&&this.hasErrorMessage())(e.jsxs(js,{noticeType:"error",closeButton:!1,children:[e.jsx("div",{className:"rec-notification-title",children:"Error:"}),e.jsx("ul",{children:Object.entries(s).map(([t,n])=>e.jsx("li",{children:n},t))})]}))]})}};function Kp(a){const s=Sr(a,"reservations","facilities","passTypes"),t=Ot.getValidationErrors(a);return t.length&&(s.validation=t),{validationErrors:Ot.getValidationProblems(a),passTypes:gt.getPassTypes(a),errors:s}}const Rr=za(Kp)(Wp);class Zp extends y.PureComponent{static defaultProps={pricing:null,passCounts:{},sortFn:(s,t)=>parseFloat(We(t.periods).replace(/\/.*|\D/g," "))-parseFloat(We(s.periods).replace(/\/.*|\D/g," "))};static propTypes={maxTotalGuestsReached:i.bool.isRequired,onChange:i.func.isRequired,passCounts:i.object,passTypeId:i.string,passTypes:i.arrayOf(J).isRequired,passTypesRaw:i.arrayOf(J).isRequired,pricing:i.node,sortFn:i.func,facilityId:i.string,reservations:i.arrayOf(ze)};getPriceFromPeriods=s=>{const t=Qn(s,_());return he(t)?"0":t};filterPassTypes=s=>s.filter(t=>{const n=_().startOf("day");return t.periods.some(o=>n.isSameOrAfter(_(o.start_date).startOf("day")))});useButtonInsteadOfCounter=()=>Il.includes(this.props.facilityId);renderRow=({id:s,name:t,periods:n,used_for:r,duration:o})=>{const{maxTotalGuestsReached:l,passCounts:c,onChange:d}=this.props,h=this.getPriceFromPeriods(n);return e.jsxs("tr",{className:this.props.passTypeId===s?"highlight":"",children:[e.jsxs("td",{children:[t,e.jsx(Vt,{content:`${t} - ${r}`,children:e.jsx(E,{"aria-label":t,appearance:"subtle",size:"small",iconBeforeElement:e.jsx(k,{iconName:"info",size:"xs"})})}),e.jsx("small",{className:"mobile-only",children:h})]}),e.jsx("td",{children:Tr(o)}),e.jsx("td",{children:h}),e.jsx("td",{children:this.useButtonInsteadOfCounter()?e.jsx(E,{className:"pass-types-table__content-item pass-types-table__button",appearance:"tertiary",disabled:!he(this.props.reservations),onClick:()=>{d(s,1)},children:"Add Pass"}):e.jsx("div",{className:"rec-guest-counter-wrap",children:e.jsx("div",{className:"rec-guest-counter-row",children:e.jsx(zi,{label:t,disableDecreaseCount:c[s]<=0,disableIncreaseCount:l,disableTextInput:!0,onCountChange:u=>d(s,u),count:c[s],iconClass:"guest-counter-row-icon",inputClass:"rec-guest-counter-row-quantity"})})})})]},`pass-type-${s}`)};onClick=s=>{this.props.onChange(s,1)};renderReducedRow=({id:s,name:t})=>e.jsxs("tr",{children:[e.jsxs("td",{children:[t,e.jsx("small",{className:"mobile-only",children:"Must be purchased on site"})]}),e.jsx("td",{children:"Must be purchased on site"})]},`pass-type-${s}`);render(){const{pricing:s,sortFn:t}=this.props;let{passTypes:n,passTypesRaw:r}=this.props,o=!!n?.length,l=!!r?.length;return o&&(n=this.filterPassTypes(n),o=!!n?.length),l&&(r=this.filterPassTypes(r),l=!!r?.length),!o&&l?e.jsxs("div",{className:"parkpass-pass-types-table-wrapper",children:[e.jsxs("table",{className:"parkpass-pass-types-table",children:[e.jsx("caption",{children:e.jsx("span",{className:"rec-sr-only",children:"Site pass type"})}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",children:"Pass Type"}),e.jsx("th",{scope:"col"})]})}),e.jsx("tbody",{children:r.sort(t).map(this.renderReducedRow)})]}),s]}):e.jsxs("div",{className:"parkpass-pass-types-table-wrapper",children:[e.jsxs("table",{className:"parkpass-pass-types-table",children:[e.jsx("caption",{children:e.jsx("span",{className:"rec-sr-only",children:"Site pass selection"})}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",children:"Pass Type"}),e.jsx("th",{scope:"col",children:"Duration"}),e.jsx("th",{scope:"col",children:"Price"}),this.useButtonInsteadOfCounter()?e.jsx("th",{scope:"col",children:"Add"}):e.jsx("th",{scope:"col",children:"Quantity"})]})}),e.jsx("tbody",{children:n.sort(t).map(this.renderRow)})]}),s]})}}const Ya={description:i.string,quantity:i.string,title:i.string,value:i.number};class Ss extends y.PureComponent{static defaultProps={showNoLinesText:!1};static propTypes={attendeeInfo:i.node,lines:i.arrayOf(i.shape(Ya)).isRequired,total:i.shape(Ya).isRequired,ariaLabel:i.string,showNoLinesText:i.bool};static renderLine=(s,t,n)=>{const{title:r,description:o,value:l}=s;if(!l)return null;const c=us(l),d=r==="Total Cost",h=r==="Subtotal";let u=d?"parkpass-costs-table-total-cost":"";h&&(u="parkpass-costs-table-subtotal");let p=`${r}: ${c}`;return n&&(p=`${n} ${p}`),e.jsxs(O,{hasGutters:!1,className:`parkpass-costs-table-item-wrap ${u}`,children:[e.jsxs(S,{xs:6,md:8,xl:6,className:"parkpass-costs-table-name",children:[r,ee(o)(e.jsx("span",{children:o})),t&&e.jsx("div",{className:"parkpass-reservation-summary-attendee-info-wrap",children:t})]}),e.jsx(S,{"aria-label":p,role:"complementary",xs:6,md:4,xl:6,className:"parkpass-costs-table-cost",children:c})]},r)};render(){const{attendeeInfo:s,lines:t,total:n,showNoLinesText:r,ariaLabel:o}=this.props;return e.jsxs("div",{className:"parkpass-costs-table",children:[t.map((l,c)=>Ss.renderLine(l,c?null:s)),r&&e.jsx("p",{children:"No passes have been selected. Please choose how many passes you will need for this trip."}),Ss.renderLine(n,null,o)]})}}class Bs extends y.Component{static propTypes={children:i.node,facility:Qe.isRequired,passTypes:i.arrayOf(J).isRequired,reservations:i.arrayOf(ze).isRequired};static total="$0.00";static buildCosts(s,t){const n=I(s,["features","day-segment","groups"],{}),r=I(t,["features","day-segment","groups"],{}),o=I(s,["features","attendee-info"],n),l=I(t,["features","attendee-info"],r),c=[],d=[{title:`${s.name}`,quantity:"x 1",value:t.price}];t.fees&&d.push({title:"Service Fee",quantity:"x 1",value:t.fees});const h={title:"Subtotal",value:t.total};let u=!0;return Object.entries(o).forEach(([p,m])=>{const f=l[p];if(!f){m.attendee_min>0&&(u=!1);return}m.attendee_max>-1&&m.price_per_attendee&&f>m.attendee_max&&(u=!1),c.push(e.jsx("span",{className:"parkpass-reservation-summary-attendee-info",children:`${f} ${hs(f,p.replace(/s$|ren$/,""),p)}`},p));let g;g=Math.max(m.price_min,f*m.price_per_attendee),m.price_max>0&&(g=Math.min(m.price_max,g)),g&&(d.push({title:s.name,quantity:"x 1",description:s.description,value:g}),h.value+=g)}),{allowedToBuy:u,attendeeInfo:c,costs:d,total:h}}shouldComponentUpdate(s){return s.reservations.every(t=>t.has_price||Ee(t?.pass_info?.duration))}render(){const{facility:s,passTypes:t,reservations:n,children:r}=this.props,o={title:"Total Cost",value:0};let l=!1;return e.jsxs("div",{className:"aside parkpass-reservation-summary",children:[e.jsx("div",{className:"parkpass-reservation-image-wrap",children:e.jsx(an,{id:s.asset_id||s.id,type:"asset"})}),e.jsxs("div",{className:"parkpass-reservation-summary-body-wrap",children:[e.jsx(Q,{className:"rec-sr-only",headingLevel:2,children:"Cost Summary"}),!n.length&&e.jsx(O,{hasGutters:!1,className:"parkpass-reservation-summary-subhead-wrap",children:e.jsxs(S,{children:[e.jsx("div",{className:"parkpass-reservation-summary-title",children:"Site Pass"}),e.jsx("div",{className:"parkpass-reservation-summary-name",children:s.name})]})}),n.map((c,d)=>{const h=t.find(({id:M})=>M===c.pass_type_id);if(!h)return null;const{allowedToBuy:u,attendeeInfo:p,costs:m,total:f}=Bs.buildCosts(h,c);o.value+=f.value,Bs.total=us(o.value);const g=["season","seasonal"].includes(h.duration),T="ddd, ll",[x]=os(h.periods);let[,b]=os(h.periods);const A=_(g?x:c?.pass_info?.features["start-date"]);let C=A.format(T),N=ft(A,h).format(T);const L=As(h.duration);if(h.features["end-date"]||h.features["day-segment"]||h.duration==="segment"){const M=c.pass_info.features["end-date"];L.days=_(M).add(2,"days").diff(_(),"days")}if(g&&(L.days=_(b).add(2,"days").diff(_(),"days"),N=_(b).format(T)),!_(b).isValid()){const[M,Y,oe]=b?.split("-")??[void 0,void 0,void 0];b=`${parseInt(M,10)+1}-${Y}-${oe}`,N=_(b).format(T)}if(h.duration.indexOf("limit-to-season")!==-1){const M=L.days-1,Y=_(A).add(M,"d"),oe=Y.isAfter(b,"day");N=Y.format(T),oe&&(N=_(b).format(T))}return Ee(h?.duration)&&he(c?.pass_info?.features["start-date"])&&(C="Select Start date",N="Select Start date"),l=l||!u,e.jsxs("div",{className:"parkpass-reservation-summary-item",children:[e.jsx(O,{hasGutters:!1,className:"parkpass-reservation-summary-subhead-wrap",children:e.jsxs(S,{children:[e.jsxs(Q,{headingLevel:3,appearance:"h6",className:"parkpass-reservation-summary-title",children:[d+1,". ",h.name]}),e.jsx("div",{className:"parkpass-reservation-summary-name",children:s.name})]})}),e.jsxs(O,{hasGutters:!1,className:"parkpass-reservation-summary-item-body",children:[e.jsx(S,{xs:6,md:12,xl:6,className:"parkpass-reservation-summary-dates",children:e.jsxs(O,{xs:12,children:[e.jsx(S,{children:"Start Date"}),e.jsx(S,{xs:12,children:e.jsx("strong",{children:C})})]})}),e.jsx(S,{xs:6,md:12,xl:6,children:e.jsxs(O,{children:[e.jsx(S,{xs:12,children:"Valid Through"}),e.jsx(S,{xs:12,children:e.jsx("strong",{children:N})})]})})]}),u?e.jsx("div",{children:e.jsx(Ss,{lines:m,total:f,attendeeInfo:p})}):e.jsx("strong",{className:"rec-text-danger",children:"Your selections are outside the bounds for this pass type. Please make a different selection."})]},c.id)}),e.jsx(Ss,{lines:[],total:o,showNoLinesText:!n.length}),!l&&r]})]})}}function Qp(){return e.jsx("div",{className:"ia-header-placeholder",children:e.jsxs(H,{space:"xs",children:[e.jsx("div",{className:"ia-header-placeholder-title",children:e.jsx(ve,{fontSize:33,lineHeight:33*1.2,lines:1,width:"30%"})}),e.jsx("div",{className:"ia-header-placeholder-subtitle",children:e.jsx(ve,{fontSize:16,lineHeight:16*1.2,lines:1,width:"60%"})}),e.jsx("div",{className:"ia-header-placeholder-description",children:e.jsx(ve,{fontSize:14,lineHeight:14*1.7,lines:3})})]})})}function Xp(){return e.jsxs("div",{className:"ia-summary-placeholder",children:[e.jsx("div",{className:"ia-summary-placeholder-header",children:e.jsx(as,{className:"ia-summary-placeholder-image"})}),e.jsx("div",{className:"ia-summary-placeholder-body",children:e.jsx("div",{className:"ia-summary-placeholder-message",children:e.jsx(ve,{fontSize:14,lineHeight:14*1.2,lines:1})})}),e.jsx("div",{className:"ia-summary-placeholder-footer",children:e.jsx("div",{className:"ia-summary-placeholder-controls",children:e.jsx(as,{className:"ia-summary-placeholder-cta"})})})]})}function ha(){return e.jsxs("main",{id:"page-body",className:"ia-order-details-page",children:[e.jsx(zs,{title:"Pass Selection"}),e.jsx($e,{className:"mt-5 mb-5",children:e.jsx(H,{children:e.jsxs(O,{children:[e.jsx(S,{lg:8,children:e.jsx(Qp,{})}),e.jsx(S,{lg:4,className:"ia-order-details-summary",children:e.jsx(Xp,{})})]})})})]})}function Cr({type:a}){const s=Ll[a],t=s?.fileName??"",n=s?.fallbackExtension??"jpg",r=s?.altText??"pass card";return s?e.jsx(nn,{alt:r,imagePath:`/shared/img/interagencyPass/${t}`,fallbackExtension:n}):null}Cr.propTypes={type:i.string};function Ir(a){const{facilitiesUsingSitePassIntegration:s}=_e(),t=y.useMemo(()=>oa(a.facilityId,s),[s,a.facilityId]),n=y.useMemo(()=>{const r=ia(a.facilityId,s),o=Ht[a?.facilityId];return r&&!o?.showPassesByDefault},[s,a.facilityId]);return e.jsx(Jp,{...a,showSitePassAlert:t,showSitePassesTable:n})}Ir.propTypes={facilityId:i.string};class Jp extends y.PureComponent{static defaultProps={loading:{},facility:{},passCounts:{},passTypes:[]};static propTypes={children:i.node,facility:Qe,facilityId:i.string,handleNeedToKnowChecked:i.func.isRequired,loaded:i.shape({facilityByIdOrSlug:i.bool,reservations:i.bool,passTypes:i.bool}),loading:i.shape({facilities:i.bool,passTypes:i.bool}),maxTotalGuestsReached:i.bool,needToKnowChecked:i.bool,onPassCountChange:i.func.isRequired,onRemoveReservation:i.func.isRequired,onReservationChange:i.func.isRequired,passCounts:i.object,passTypes:i.arrayOf(J),passTypeId:i.string,passTypesRaw:i.arrayOf(J),proceedButton:i.node.isRequired,reservationId:i.string,reservations:i.arrayOf(ze),submitAttempted:i.bool,parentAsset:i.array,isCsrAccount:i.bool,showSitePassAlert:i.bool,showSitePassesTable:i.bool};state={isSummaryModalOpen:!1,showPassesTable:!1,interagencyPassModalStatus:"IDLE"};componentDidMount(){this.setState(s=>({...s,showPassesTable:!this.props?.showSitePassesTable}))}componentDidUpdate(s){s.showSitePassesTable!==this.props.showSitePassesTable&&this.setState(t=>({...t,showPassesTable:!this.props.showSitePassesTable}))}handlePassInfoChange=(s,t,n,r)=>{const o=this.props.reservations.find(({id:l})=>l===s);if(o){const l={},c=this.props.passTypes.find(({id:u})=>u===o.pass_type_id),d={};c&&c.features.accepted&&(d.accepted=c.features.accepted.reduce((u,p)=>({...u,[p]:!0}),{}));const h={...o,pass_info:n,pass_type_id:t||o.pass_type_id,holder_info:n.holder_info,features:{discount:l,...n.features,...d}};this.props.onReservationChange(h,r)}};toggleSummaryModal=()=>this.setState(s=>({isSummaryModalOpen:!s.isSummaryModalOpen}));scrollToPassTypesTable=()=>{setTimeout(()=>{const t=document?.getElementsByClassName("parkpass-pass-types-table-wrapper")?.[0],n=t?.offsetTop??0,r=t?.offsetParent?.offsetTop??0,o=n+r-100;t&&window.scrollTo({top:o,behavior:"smooth"})},0)};handleToggleShowPassesTable=()=>{this.setState(s=>({...s,showPassesTable:!0}),this.scrollToPassTypesTable)};handleToggleInteragencyPassModal=(s="IDLE")=>()=>{this.setState(t=>({...t,interagencyPassModalStatus:s}))};handleGoToInterAgencyPassPage=()=>{this.handleToggleInteragencyPassModal()(),window.location.href="/pass"};renderInterAgencyPassListItems=()=>Ml?.map(s=>e.jsx("li",{className:"parkpass-order-details__interagency_pass_list-item",children:e.jsx(Cr,{"aria-hidden":"true",type:s})},s));render(){const{children:s,facility:t,facilityId:n,parentAsset:r,loaded:o,loading:l,maxTotalGuestsReached:c,needToKnowChecked:d,isCsrAccount:h,passCounts:u,passTypes:p,passTypesRaw:m,proceedButton:f,reservationId:g,reservations:T,submitAttempted:x,showSitePassAlert:b}=this.props;if(!n)return null;let A=null;if(t.id&&Array.isArray(I(t,"contents.pricing"))){const P=t.contents.pricing.flatMap(({paragraphs:z=[]},M)=>z.map((Y,oe)=>e.jsx("p",{children:e.jsx(rn,{html:Y})},`html-${M}-${oe}`)));A=e.jsx(js,{noticeType:"info",closeButton:!1,children:P})}const{isSummaryModalOpen:C}=this.state,N=e.jsx(Bs,{passTypes:p,reservations:T,facility:t,children:s}),L=r?.find(P=>P.entity_id===t.asset_id);if(!o?.facilityByIdOrSlug||!o.passTypes)return e.jsx(ha,{});const V=e.jsxs("ul",{className:"rec-subhead-wrap",children:[!se(L)&&e.jsxs("li",{children:["Part of"," ",e.jsx("a",{href:Uu(t.asset_id),rel:"noreferrer",target:"_blank",children:L?.name})]}),e.jsx("li",{children:e.jsx(on,{entityId:t.asset_id,entityType:"sitepass",showFavoriteText:!0},"favorite-button")})]});return e.jsx("div",{className:"parkpass-order-details",children:e.jsxs("div",{className:"rec-nested-wrap",children:[e.jsxs("div",{id:"page-body",className:"rec-parkpass-left-rail",children:[e.jsxs("div",{className:"mobile-only",children:[e.jsx("h2",{children:t.name}),V]}),e.jsxs("div",{className:"non-mobile-only",children:[e.jsx("h1",{children:"Site Pass Selection"}),e.jsx("h2",{children:t.name}),V]}),e.jsx(Rr,{reservations:T,submitAttempted:x,needToKnowChecked:d}),ee(l.passTypes||o.passTypes&&!g)(e.jsx(br,{facilityId:n,showPasses:this.state?.showPassesTable,onToggleShowPasses:this.handleToggleShowPassesTable})),ee(h)(e.jsx("div",{className:"mb-4",children:e.jsxs(js,{noticeType:"error",closeButton:!1,children:[e.jsx("div",{className:"rec-notification-title",children:"Error Notification:"}),e.jsx("p",{children:"Please select a customer to continue with the reservation."})]})})),ee(t?.contents?.overview)(()=>e.jsx(cp,{overview:I(t,"contents.overview",[])})),ee(l.passTypes||o.passTypes&&!g)(e.jsx(aa,{loading:l.passTypes,size:"lg",children:e.jsx(hr,{flag:"disableNpsParkpasses",skeleton:!0,flagValueToMatch:t?.id,fallback:e.jsxs($s,{children:[e.jsx(ns,{children:e.jsx(Ae,{children:e.jsx(bp,{passTypes:p})})}),e.jsxs(ns,{children:[b&&e.jsx(Ae,{children:e.jsxs(ke,{className:"mb-2",type:"warning",children:[e.jsx(D,{className:"mr-1",tag:"span",children:"If you already have an Interagency Pass, you don't need a Site Pass to enter this facility."}),e.jsx(E,{appearance:"link",iconAfterElement:e.jsx(k,{iconName:"arrow-forward"}),onClick:this.handleToggleInteragencyPassModal("OPEN"),children:"Learn More"})]})}),e.jsxs(Ae,{children:[g&&e.jsx("h4",{className:"parkpass-section-heading",children:"Modify"}),this.state?.showPassesTable&&e.jsxs(e.Fragment,{children:[e.jsx("p",{children:"Enter the number of passes you would like to purchase from the available choices below:"}),e.jsx(Zp,{maxTotalGuestsReached:c,reservations:T,passCounts:u,passTypeId:this.props.passTypeId,passTypes:p,passTypesRaw:m,pricing:A,onChange:this.props.onPassCountChange,facilityId:n})]})]})]})]}),children:e.jsx($s,{children:e.jsx(Vi,{type:"warning",title:"Coronavirus (COVID-19) Update",headingLevel:3,className:"sitepass-covid19-notification",id:"sitepass-corona-virus-notification",children:e.jsx("p",{children:"Please be aware that sales are currently suspended for the Site Pass at this location due to impacts from the coronavirus (COVID-19). We will provide updates as the situation evolves. We appreciate your patience and understanding."})})})})})),ee(T.length)(()=>e.jsxs("div",{children:[e.jsx("h3",{className:"parkpass-section-heading h4",children:g?"Modify":"Pass Details"}),e.jsx("p",{children:g?"Please modify the pass information below:":"Please provide the required information below:"}),T.map((P,z)=>{const M=p.find(({id:Y})=>Y===P.pass_type_id);return M?e.jsx(ns,{children:e.jsx(Ae,{children:e.jsx(xr,{submitAttempted:x,facility:t,number:z+1,passInfo:P.pass_info,passType:M,price:us(P.price),renderRemove:!0,isPending:P.is_pending,reservationId:P.id,onChange:this.handlePassInfoChange.bind(this,P.id),onRemove:this.props.onRemoveReservation})})},`${P.id}`):null})]})),ee(g)(()=>e.jsx(E,{appearance:"secondary",size:"sm","data-testid":"parkpass-add-another-pass",className:"parkpass-add-another-pass",onClick:()=>(window.location=ur(t.id),null),iconBeforeElement:e.jsx(k,{iconName:"add-circle"}),children:"ADD ANOTHER PASS"})),ee(t.id)(()=>e.jsx("div",{className:"parkpass-info-box",children:e.jsx(lp,{needToKnow:I(t,"contents.need_to_know",[]),className:x&&!d?"rec-error":"",siteName:t.name,noFeePeriods:t.free_days,checked:d,onChange:this.props.handleNeedToKnowChecked})})),t.id&&!!T.length&&e.jsx(Gi,{scrollingContainerId:"page-body",children:e.jsx("div",{className:"rec-order-detail-page-actions",children:e.jsxs(O,{hasGutters:!1,children:[e.jsx(S,{xs:6,md:8,alignSelf:"center",children:e.jsx("button",{onClick:()=>this.toggleSummaryModal(),className:"rec-button-link display-sm-block",type:"button",children:"Show Summary"})}),e.jsx(S,{xs:6,md:4,children:e.jsx(up,{proceedButton:f})})]})})}),e.jsx(bs,{isOpen:C,onRequestClose:this.toggleSummaryModal,role:"complementary",contentLabel:"Order Summary",heading:"Summary",size:"md",className:"rec-modal-order-summary",children:e.jsx("div",{className:"rec-modal-content-wrap",children:N})}),e.jsx(bs,{isOpen:this.state?.interagencyPassModalStatus==="OPEN",size:"md",onRequestClose:this.handleToggleInteragencyPassModal(),heading:"Do you have a physical Interagency Pass?",children:e.jsxs("div",{children:[e.jsx(D,{className:"mb-3",children:"If you already have one, you don't need a digital Site Pass to enter this facility. Be sure your Interagency Pass is valid for your trip dates and bring it with you -- you will be asked to show the pass once you arrive."}),e.jsx(Q,{className:"mb-2",headingLevel:6,appearance:"h6",children:"Valid Interagency Passes:"}),e.jsx("ul",{className:"parkpass-order-details__interagency_pass_list",children:this.renderInterAgencyPassListItems()}),e.jsx(E,{className:"mt-3",appearance:"link",iconAfterElement:e.jsx(k,{iconName:"arrow-forward"}),onClick:this.handleGoToInterAgencyPassPage,children:"Learn More About Interagency Passes"})]})})]}),e.jsx("div",{className:"rec-parkpass-right-rail",children:t.id&&N})]})})}}function em(){return a=>ss.get("/api/cart/shoppingcart",{headers:{Authorization:ln()}}).then(s=>{a({type:yn,payload:s.data})}).catch(()=>{a({type:rl,payload:"Error fetching cart",error:!0})})}function sm(a){return s=>ss.delete(`/api/cart/shoppingcart/${a}`,{headers:{Authorization:ln()}}).then(t=>{al(),s({type:yn,payload:t.data})}).catch(()=>{s({type:pl,payload:"Error removing item from cart"})})}const tm="1",am="2",nm="3",rm="4",im="5",om="7",fs=new Map;fs.set(tm,"Adult");fs.set(am,"Child/Youth");fs.set(om,"Treaty Card Holder");fs.set(rm,"Interagency Access");fs.set(nm,"Interagency Senior");fs.set(im,"Interagency Youth Access");var lm={lotteries:!0};[{url:"/account/reservations/upcoming",title:"Upcoming"},{url:"/account/reservations/past",title:"Past"},{url:"/account/reservations/cancelled",title:"Cancelled"},{url:"/account/lotteries",title:"Lotteries"},{url:"/account/donations",title:"Donations"}].filter(a=>a.url==="/account/lotteries"?lm?.lotteries:!0);const cm="GET_TICKET_PDF_ERROR",dm="GET_TICKET_PDF_REQUEST",hm="GET_TICKET_PDF_SUCCESS",yt=new Map;yt.set(1,"UseFeeAlways");yt.set(2,"UseFeeOutsideWindowNoneInside");yt.set(3,"NoRefund");yt.set(4,"UseFeeUntilPrintingNoneAfter");const um={checkout:{},confirmation:{},printing:{loading:!1}};function pm(a=um,s){const t=de(a);switch(s.type){case il:return t.checkout=s.payload,delete t.err,t;case ol:return t.checkout.payment_type=s.payload.payment_type,t.checkout.saved_card_on_purchase=s.payload.saved_card_on_purchase,delete t.err,t;case ll:const n={orderID:s.payload.order.order_id,orderTime:s.payload.order.order_date,completedReservations:s.payload.order.reservations,subtotal:s.payload.order.subtotal,discount:s.payload.order.discount,tax:s.payload.order.tax,total:s.payload.order.total,transactions:s.payload.order.transactions,modification:s.payload.modification};return t.confirmation=n,delete t.err,t;case cl:let r=!1;s.payload.modification&&(r=!0);const o={orderID:s.payload.order_id,orderTime:s.payload.order_date,completedReservations:s.payload.reservations,subtotal:s.payload.subtotal,discount:s.payload.discount,tax:s.payload.tax,total:s.payload.total,modification:r};return t.confirmation=o,delete t.err,t;case jt:return t.err=jt,t;case dl:const l=I(s,"payload.response.data.error");return l&&l.includes("already paid")?t.err=hl:l&&l.includes("rate limit exceeded")?t.err=ul:t.err=jt,t;case dm:return t.printing.loading=!0,t;case hm:return t.printing.loading=!1,t;case cm:return t.printing.loading=!1,t.printing.printTicketError=s.payload,t;default:return t}}const mm=em,Ar=sm;Is(Tn,()=>()=>bu(),"facilities");Is(_n,a=>()=>ju(a),"facility");const ua=Is(xn,a=>()=>Su(a),"facility"),pa=Is(vn,a=>()=>vu(a),"pass_types");Is(En,a=>()=>Eu(a),"pass_type");const fm=(a,{type:s})=>a({type:s}),gm=(a,{payload:s,type:t})=>a({type:t,payload:s}),ym=(a,{message:s,type:t})=>a({type:t,error:s});function ma(a,s,t=void 0,{start:n=fm,success:r=gm,failure:o=ym}={}){return(...l)=>{const c=s(...l);return async(d,h)=>{n(d,{getState:h,type:`${a}_START`,key:t});try{const u=await c(),p=t!==void 0?I(u,`data.${t}`):u.data;if(p===void 0)throw new Error("Did not receive data from the server.");return r(d,{getState:h,payload:p,type:`${a}_SUCCESS`,key:t}),p}catch(u){let p;if(u.response){const m=u.response;if(m.status>=500)switch(m.status){case 500:m.data&&m.data.err?p=m.data.err:p="The server encountered an error processing the request. Try again later.";break;case 501:m.data&&m.data.err?p=m.data.err:p="The server does not know how to respond to that request.";break;case 502:case 503:case 504:m.data&&m.data.err?p=m.data.err:p="The server could not be reached or is not responding. Try again later.";break;default:m.data&&m.data.err?p=m.data.err:p="Something went wrong while talking with the server. Try again later."}else if(m.status>=400)switch(m.status){case 401:m.data&&m.data.err?p=m.data.err:p="You must be logged in to do that action.";break;case 403:m.data&&m.data.err?p=m.data.err:p="Your permissions do not permit you to do that action.";break;case 404:m.data&&m.data.err?p=m.data.err:p="No data for that resource was found.";break;case 422:m.data&&m.data.err?p=m.data.err:m.data&&m.data.reservations?p=m.data.reservations:p="There are errors in your request, check your inputs and try again.";break;default:m.data&&m.data.err?p=m.data.err:p="A problem with your request has occurred. Try again later."}else m.data&&m.data.err?p=m.data.err:p="A temporary problem has caused your request to fail. Try again later."}else u.request?p="Something went wrong while talking to the server":p=u.message||"Something went wrong unexpectedly";throw o(d,{getState:h,error:u,message:p,type:`${a}_FAILURE`,key:t}),new Error(p)}}}}const Dr=ma(bn,a=>()=>Tu(a),"reservations"),Nr=ma(jn,a=>()=>_u(a),"reservations");ma(Sn,a=>()=>yu(a),"reservations");function Tm(a){let s=a.message||"Something went wrong unexpectedly";if(a.response){s="A temporary problem has caused your request to fail. Try again later.";const t=a.response;if(t.data&&t.data.err)s=t.data.err;else if(t.data&&t.data.error)s=t.data.error;else if(t.err||t.error)s=t.err||t.error;else if(typeof t.status=="number"&&t.status>=400)switch(t.status){case 500:s="The server encountered an error processing the request. Try again later.";break;case 501:s="The server does not know how to respond to that request.";break;case 502:case 503:case 504:s="The server could not be reached or is not responding. Try again later.";break;case 401:s="You must be logged in to do that action.";break;case 403:s="Your permissions do not permit you to do that action.";break;case 404:s="No data for that resource was found.";break;case 422:s="There are errors in your request, check your inputs and try again.";break;default:s="A problem with your request has occurred. Try again later.",t.status>=500&&(s="Something went wrong while talking with the server. Try again later.")}}else a.request&&(s="Something went wrong while talking to the server");return s}const Pr=(a,s)=>{const t=()=>xu(s);return async n=>{n({type:`${rs}_START`,number:a});try{const r=await t(),o=I(r,"data.errors");if(o===void 0)throw new Error("Did not receive data from server.");return n({type:`${rs}_SUCCESS`,payload:o,number:a}),o}catch(r){const o=Tm(r);throw n({error:r,message:o,type:`${rs}_FAILURE`,number:a}),new Error(o)}}},wr=a=>({type:Rn,number:a});function _m(a){return{type:Cn,payload:a}}function xm(){return{type:In}}const $a=i.shape({facility:i.bool,passTypes:i.bool,reservations:i.bool,facilityByIdOrSlug:i.bool});class vm extends y.Component{static defaultProps={fetchCart:()=>{},fetchFacilityByIdOrSlug:()=>{},loaded:{},loading:{},reservations:[]};static propTypes={router:Hi,account:i.shape({first_name:i.string,last_name:i.string,email:i.string}),cartReservations:i.arrayOf(i.object),cartReservationIds:i.arrayOf(i.string),createReservations:i.func,validateReservation:i.func,facility:Qe,fetchCart:i.func,fetchFacilityByIdOrSlug:i.func,fetchPassTypes:i.func,fetchReservations:i.func,loaded:$a,loading:$a,passTypes:i.arrayOf(J),removeReservation:i.func,clearValidationErrors:i.func,reservations:i.arrayOf(ze),showLoginModal:i.func,auth:i.object,csrAccount:i.any};constructor(s){super(s),this.priceSubject=new di,this.removedReservationIds=[],this.state={hasSaveReservationIntent:!1,parentAsset:[],isCsrAccount:!1,isSubmitting:!1,needToKnowChecked:!1,passCounts:{},submitAttempted:!1,reservationValidStatuses:{},reservations:s.reservations.filter(({facility_id:t})=>t===s.router.params.siteId)}}componentDidMount(){const{loading:s,loaded:t}=this.props,{siteId:n,resId:r}=this.props.router.params,o=this.props.router.searchParams;this.loadPageData(s,t,{...Object.fromEntries(o.entries()),fid:n||o.get("fid"),rid:r||o.get("rid")}),this.priceSubject.asObservable().pipe(hi(l=>mi(this.getReservationPrice(l))),ui(5),pi(({data:l})=>l)).subscribe(l=>{const c=de(this.state.reservations),{id:d,fees:h,price:u,total:p}=l,m=c.findIndex(({id:f})=>f===d);m>-1&&(Object.assign(c[m],{has_price:!0,fees:h,price:u,total:p}),Es(this.state.reservations,c)||this.setState({reservations:c}))})}componentDidUpdate(s){const{account:t}=this.props,{hasSaveReservationIntent:n,isCsrAccount:r}=this.state,o={};r&&t!==s.account&&this.setState({isCsrAccount:!1}),!s.account&&t&&n&&this.setState({hasSaveReservationIntent:!1},this.saveReservation),this.props.reservations.length&&!Es(this.props.reservations,s.reservations)&&(o.reservations=this.props.reservations.filter(({facility_id:l})=>l===this.props.router.params.siteId),o.passCounts=po(this.props.reservations,"pass_type_id"),o.needToKnowChecked=!0,this.setState(l=>({...l,...o})))}onPassCountChange=(s,t)=>{const{passTypes:n}=this.props,r=t>(this.state.passCounts[s]||0);let o=de(this.state.reservations);const l=de(this.state.reservationValidStatuses);let c={};if(se(this.props.account)||(c={pass_info:{...Fs.pass_info,holder_info:{first_name:this.props.account?.first_name,last_name:this.props.account?.last_name,email:this.props.account?.email}}}),r){const d={...Fs,id:mo(),is_pending:!0,facility_id:this.getSiteId(),pass_type_id:s,...c};d.pass_info.start_date=_().startOf("day").format(),d.pass_info.features["start-date"]=_().startOf("day").format();const h=n?.find(u=>u.id===s);d.pass_info.duration=h?.duration,h&&Ee(h?.duration)&&(d.pass_info.start_date="",d.pass_info.features["start-date"]=""),o.push(d)}else{const d=o.concat().reverse().find(({pass_type_id:h})=>h===s);d&&!d.is_pending&&this.removedReservationIds.push(d.id),l[d?.id]=!0,o=o.filter(({id:h})=>h!==d.id)}this.setState(d=>({...d,passCounts:{...d.passCounts,[s]:t},reservations:o,reservationValidStatuses:l}))};onReservationChange=ru((s,t)=>{const n=de(this.state.reservations),r=de(this.state.reservationValidStatuses),o=n.findIndex(({id:d})=>d===s.id);let l=de(s.pass_info.features);const c=de(s.pass_info.features);o>-1&&(l=n[o].pass_info.features,n[o]=s,Es(l,c)||this.priceSubject.next(s)),this.setState({reservations:n,reservationValidStatuses:{...r,[s.id]:t}})},200,{resolver:s=>s.id});getReservationPrice=({id:s,pass_type_id:t,features:n,pass_info:{start_date:r}})=>{const{passTypes:o}=this.props,l=o?.find(c=>c.id===t);return Ee(l?.duration)&&he(r)?"":Jn({pass_type_id:t,features:{...n,"start-date":r}}).then(({data:c})=>({data:{...c,id:s}}))};getSiteId=()=>this.props.router.params.siteId||this.props.router.searchParams.get("fid");getResId=()=>this.props.router.params.resId||this.props.router.searchParams.get("rid");getPassTypes=()=>!this.props.passTypes?.length?this.props.passTypes:this.props.passTypes.filter(n=>!!!n?.features?.is_field_sales);handleNeedToKnowChecked=s=>{this.setState({needToKnowChecked:s})};loadPageData=(s,t,n)=>{if(!s.facility&&!t.facility){const o=this.getSiteId();this.props.fetchFacilityByIdOrSlug(o).then(l=>{sa(l.asset_id).then(({data:c})=>this.setState({parentAsset:c?.results})),l.id&&!s.passTypes&&!t.passTypes&&this.props.fetchPassTypes(l.id)})}if(t.facility){const{facility:o}=this.props;if(this.getSiteId()&&!o)return}this.props.fetchCart();const{rid:r}=n;(r||this.props.cartReservationIds.length)&&!s.reservations&&!t.reservations&&this.props.fetchReservations(n.rid?[n.rid]:this.props.cartReservationIds)};handleCheckErrors=async s=>{const t=se(s)?[]:s;return(await Promise.all(t.map(async(o,l)=>await this.props.validateReservation(l,o)))).filter(o=>!se(o))};hasErrors=()=>{const{needToKnowChecked:s,reservations:t}=this.state;let n=!1;return t.forEach(r=>{r?.holder_info?.email_confirmation&&r?.holder_info?.email!==r?.holder_info?.email_confirmation&&(n=!0)}),s||(n=!0),n};saveReservation=async()=>{this.setState({isSubmitting:!0});const{account:s,csrAccount:t,auth:n}=this.props,r=this.getPassTypes(),{needToKnowChecked:o}=this.state,{reservations:l}=de(this.state);if((await this.handleCheckErrors(l)).length>0){this.setState({submitAttempted:!1,isSubmitting:!1}),window.scrollTo(0,0);return}const d=s!=null;if(!d&&se(t)){this.props.showLoginModal(),this.setState({hasSaveReservationIntent:!0,isSubmitting:!1});return}if(!se(t)&&(!d||n.isGuest)){window.scrollTo(0,0),this.props.showLoginModal("SHOW_LOGIN_MODAL"),this.setState({isCsrAccount:!0,isSubmitting:!1});return}l.filter(({is_pending:h})=>h).forEach(h=>delete h.id),o&&l.forEach(h=>{const u=r.find(({id:p})=>p===h.pass_type_id);I(u,"features.accepted",[]).includes("need_to_know")&&Object.assign(h.features,{accepted:{need_to_know:!0}})});try{if(this.hasErrors())throw this.setState({isSubmitting:!1}),new Error;await this.props.createReservations(l),this.removedReservationIds.reduce(async(h,u)=>(await h,this.props.removeReservation(u)),Promise.resolve()),setTimeout(()=>window.location.assign("/cart"),1e3*this.removedReservationIds.length)}catch{this.setState({submitAttempted:!0,isSubmitting:!1}),this.handleCheckErrors(),window.scrollTo(0,0)}};removeReservation=async s=>{let t=de(this.state.reservations);const n=de(this.state.reservationValidStatuses),r=t.findIndex(({id:o})=>s===o);if(r>-1){this.props.clearValidationErrors(r);try{await this.props.removeReservation(s);const o=t[r],l=o.pass_type_id;n[o.id]=!0,delete t[r],t=fo(t),this.setState(c=>({passCounts:{...c.passCounts,[l]:c.passCounts[l]-1},reservations:t,reservationValidStatuses:n}),()=>{this.getResId()&&window.location.assign("/cart")})}catch{window.scrollTo(0,0)}}};renderProceedButton=()=>{const{reservations:s,isSubmitting:t}=this.state,r=this.getResId()||this.props.reservations.length,o=s.length,l=r?"Save Changes":"Add to Cart";return e.jsx(E,{shouldFitContainer:!0,size:"lg",className:"parkpass-proceed-button",isDisabled:t||!(r||o),onClick:this.saveReservation,children:l})};renderPassSelection=()=>{const{account:s,cartReservationIds:t,facility:n,loading:r,loaded:o,passTypes:l}=this.props,{needToKnowChecked:c,passCounts:d,reservations:h,isCsrAccount:u,parentAsset:p,isSubmitting:m}=this.state,f=this.getSiteId(),g=this.getResId(),T=[n],x=I(n,"contents.faq",[]),b=t.length+h.length>=_l,A=this.getPassTypes();return e.jsx(Ir,{facilities:T,facility:n,facilityId:f,handleNeedToKnowChecked:this.handleNeedToKnowChecked,parentAsset:p,loaded:o,loading:r,loggedIn:s!=null,maxTotalGuestsReached:b,needToKnowChecked:c,isCsrAccount:u,passCounts:d,passTypeId:this.props.router.params.siteId,passTypes:A,passTypesRaw:l,proceedButton:this.renderProceedButton(),isSubmitting:m,reservationId:g,reservations:h,showLoginModal:this.props.showLoginModal,submitAttempted:this.state.submitAttempted,onPassCountChange:this.onPassCountChange,onRemoveReservation:this.removeReservation,onReservationChange:this.onReservationChange,children:e.jsxs("div",{children:[e.jsx(O,{hasGutters:!1,className:"parkpass-proceed-button-wrap",children:e.jsx(S,{children:e.jsxs(ge,{children:[this.renderProceedButton(),g&&e.jsx(E,{className:"mt-1",shouldFitContainer:!0,size:"lg",appearance:"tertiary",onClick:()=>(window.location="/cart",null),children:g?"Cancel Changes":"Cancel"})]})})}),e.jsx(O,{children:e.jsx(S,{children:e.jsx(Bu,{faqs:x})})})]})})};render(){const{cartReservations:s,facility:t,loading:n,loaded:r}=this.props,o=["Pass Selection","Shopping Cart","Payment","Confirmation"];return r.facilityByIdOrSlug&&!n.facilityByIdOrSlug&&!t?.id?e.jsx(Ms,{}):t.is_external_search_disabled&&he(this.getResId())?e.jsx(Ms,{}):e.jsxs("div",{className:"rec-parkpass-page",children:[e.jsx(zs,{title:"Pass Selection"}),e.jsx("div",{className:"parkpass-order-details-heading",children:e.jsx(cn,{eventToReportToGA:gn(s,o,0),shouldReportToGA:!0,steps:o,activeStep:1})}),e.jsx(pn,{}),e.jsxs("div",{className:"rec-parkpass-section-outer-wrap",children:[e.jsx("div",{className:"rec-parkpass-wrap",children:this.renderPassSelection()}),e.jsx("div",{className:"rec-parkpass-bottom"})]})]})}}const Em=a=>{const s=Sr(a,"reservations","facilityByIdOrSlug","passTypes"),t=Ot.getValidationErrors(a);t.length&&(s.validation=t);const n=jr.getReservations(a);return{account:a.auth&&a.auth.account&&a.auth.account.account,csrAccount:I(a,"auth.csrAccount",{}),auth:I(a,"auth",{}),cartReservations:a.cart.reservations,cartReservationIds:a.cart.reservations.filter(({inventory_type:r})=>r===ml).map(({reservation_id:r})=>r),facility:la.getFacilityByIdOrSlug(a),loaded:ca(a,"reservations","facilityByIdOrSlug","passTypes"),loading:da(a,"reservations","facilityByIdOrSlug","passTypes"),passTypes:gt.getPassTypes(a),reservations:Array.isArray(n)?n:[n]}},bm=a=>fi({createReservations:Nr,fetchCart:mm,fetchFacilityByIdOrSlug:ua,fetchPassTypes:pa,fetchReservations:Dr,removeReservation:Ar,validateReservation:Pr,clearValidationErrors:wr,showLoginModal:Ru},a),Tt=za(Em,bm)(qi(vm)),jm=(a,s)=>parseFloat(We(s.periods).replace(/\/.*|\D/g," "))-parseFloat(We(a.periods).replace(/\/.*|\D/g," "));function Sm(a,s,t,n,r,o,l=jm){const c=y.useCallback(f=>f?.filter(g=>{const T=_().startOf("day");return g.periods.some(b=>T.isSameOrAfter(_(b.start_date).startOf("day")))}),[]),d=y.useMemo(()=>c(s)?.sort(l),[c,s,l]),h=y.useMemo(()=>c(t)?.sort(l),[c,t,l]),u=y.useMemo(()=>n==="LOADING",[n]),p=f=>{const g=Qn(f,_());return he(g)?"0":g},m=y.useCallback(({id:f,name:g,periods:T,used_for:x,duration:b})=>{const A=p(T),C=a===f,N=Tr(b);return{id:f,name:g,usedFor:x,duration:b,durationText:N,price:A,selectedPass:C,handleAddPass:()=>{r(f)},handleRemoveAllPasses:()=>{o(f)}}},[o,r,a]);return{filteredPassTypes:d,filteredPassTypesRaw:h,isLoading:u,getRowData:m}}function fa({selectedPassTypeId:a,passTypes:s,passTypesRaw:t,status:n,showDescription:r=!0,pricing:o=null,onSelectPass:l,onRemovePass:c,sortFn:d}){const{isSmAndDown:h}=ls(),{filteredPassTypes:u,filteredPassTypesRaw:p,isLoading:m,getRowData:f}=Sm(a,s,t,n,l,c,d),g=x=>{const{id:b,name:A,usedFor:C,durationText:N,price:L,selectedPass:V,handleAddPass:P,handleRemoveAllPasses:z}=f(x);return e.jsxs("tr",{className:V?"highlight":"",children:[e.jsxs("td",{children:[e.jsxs(D,{fontWeight:"semibold",children:[A,!r&&C&&e.jsx(Vt,{content:`${A} - ${C}`,children:e.jsx(E,{className:"ml-half","aria-label":A,appearance:"subtle",size:"small",iconBeforeElement:e.jsx(k,{iconName:"info",size:"xs"}),gaTrackingId:"565782524973"})})]}),r&&C&&e.jsx(D,{className:"pass-types-table__content-item",size:"sm",children:C})]}),e.jsx("td",{children:e.jsx(D,{children:N})}),e.jsx("td",{children:e.jsx(D,{children:L})}),e.jsx("td",{children:V?e.jsx(E,{className:"pass-types-table__content-item pass-types-table__button pass-types-table__button-selected-pass",appearance:"tertiary",iconBeforeElement:e.jsx(k,{iconName:"check-circle",size:"md"}),isDisabled:m,onClick:z,gaTrackingId:"262175325497",children:"Pass Selected"}):e.jsx(E,{className:"pass-types-table__content-item pass-types-table__button",appearance:"tertiary",isDisabled:m,onClick:P,gaTrackingId:"388776844585",gaTrackingValue:A,"aria-label":`Add Pass - ${A}`,children:"Add Pass"})})]},`pass-type-${b}`)},T=({id:x,name:b})=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx(D,{fontWeight:"semibold",children:b})}),e.jsx("td",{children:e.jsx(D,{size:"sm",children:"Must be purchased on site"})})]},`pass-type-${x}`);return h?e.jsx(Or,{passTypes:u,passTypesRaw:p,isLoading:m,showDescription:r,pricing:o,getRowData:f}):!u?.length&&p?.length?e.jsxs("div",{className:"pass-types-table-container",children:[e.jsxs("table",{className:"table-no-border pass-types-table",children:[e.jsx("caption",{children:e.jsx("span",{className:"rec-sr-only",children:"Site passes table"})}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",children:"Pass Type"}),e.jsx("th",{scope:"col"})]})}),e.jsx("tbody",{children:p?.map(T)})]}),o]}):e.jsxs("div",{className:"pass-types-table-container",children:[e.jsxs("table",{className:"table-no-border pass-types-table",children:[e.jsx("caption",{children:e.jsx("span",{className:"rec-sr-only",children:"Site pass types"})}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",children:"Pass Type"}),e.jsx("th",{scope:"col",children:"Duration"}),e.jsx("th",{scope:"col",children:"Price"}),e.jsx("th",{scope:"col",children:"Add"})]})}),e.jsx("tbody",{children:u?.map(g)})]}),o]})}fa.propTypes={selectedPassTypeId:i.string,passTypes:i.arrayOf(J).isRequired,passTypesRaw:i.arrayOf(J).isRequired,status:i.string,showDescription:i.bool,pricing:i.node,onSelectPass:i.func.isRequired,onRemovePass:i.func.isRequired,sortFn:i.func};function Or({passTypes:a,passTypesRaw:s,isLoading:t,showDescription:n=!0,pricing:r=null,getRowData:o}){const l=d=>{const{id:h,name:u,usedFor:p,durationText:m,price:f,selectedPass:g,handleAddPass:T,handleRemoveAllPasses:x}=o(d);return e.jsx("tr",{className:g?"highlight":"",children:e.jsxs("td",{children:[u&&e.jsxs(D,{className:"pass-types-table__content-title",fontWeight:"semibold",children:[u,!n&&p&&e.jsx(Vt,{content:`${u} - ${p}`,children:e.jsx(E,{className:"ml-half","aria-label":u,appearance:"subtle",size:"small",iconBeforeElement:e.jsx(k,{iconName:"info",size:"xs"}),gaTrackingId:"007146399743"})})]}),p&&n&&e.jsx(D,{className:"pass-types-table__content-item",size:"sm",children:p}),e.jsxs("div",{className:"mb-2",children:[e.jsxs("span",{className:"mr-2",children:[e.jsx(D,{className:"mr-half",fontWeight:"semibold",tag:"span",children:"Duration:"}),e.jsx(D,{tag:"span",children:m})]}),e.jsxs("span",{children:[e.jsx(D,{className:"mr-half",fontWeight:"semibold",tag:"span",children:"Price:"}),e.jsx(D,{tag:"span",children:f})]})]}),g?e.jsx(E,{className:"pass-types-table__content-item pass-types-table__button pass-types-table__button-selected-pass",appearance:"tertiary",shouldFitContainer:!0,iconBeforeElement:e.jsx(k,{iconName:"check-circle",size:"md"}),isDisabled:t,onClick:x,gaTrackingId:"279553950679",children:"Pass Selected"}):e.jsx(E,{className:"pass-types-table__content-item pass-types-table__button",appearance:"tertiary",shouldFitContainer:!0,isDisabled:t,onClick:T,gaTrackingId:"986199505124","aria-label":`Add Pass - ${u}`,children:"Add Pass"})]})},`pass-type-${h}`)},c=({id:d,name:h})=>e.jsx("tr",{children:e.jsxs("td",{children:[e.jsx(D,{fontWeight:"semibold",children:h}),e.jsx(D,{size:"sm",children:"Must be purchased on site"})]})},`pass-type-${d}`);return!a?.length&&s?.length?e.jsxs("div",{className:"pass-types-table-container",children:[e.jsxs("table",{className:"table-no-border pass-types-table",children:[e.jsx("caption",{children:e.jsx("span",{className:"rec-sr-only",children:"Site passes table"})}),e.jsx("thead",{children:e.jsx("tr",{children:e.jsx("th",{scope:"col",children:"Pass Type"})})}),e.jsx("tbody",{children:s?.map(c)})]}),r]}):e.jsxs("div",{className:"pass-types-table-container",children:[e.jsxs("table",{className:"table-no-border pass-types-table",children:[e.jsx("caption",{children:e.jsx("span",{className:"rec-sr-only",children:"Site passes table"})}),e.jsx("thead",{children:e.jsx("tr",{children:e.jsx("th",{scope:"col",children:"Pass Type"})})}),e.jsx("tbody",{children:a?.map(l)})]}),r]})}Or.propTypes={passTypes:i.arrayOf(J).isRequired,passTypesRaw:i.arrayOf(J).isRequired,isLoading:i.bool,showDescription:i.bool,pricing:i.node,getRowData:i.func};function kr({facilityId:a="",facilityName:s="",facilityAgency:t="",initialStep:n=0,selectedPassTypeId:r,passTypes:o,passTypesRaw:l,pricing:c,passTypesOptions:d=[],status:h,showDescription:u=!0,isInWidget:p=!1,onSelectPass:m,onRemovePass:f,onReviewOptionsClick:g=()=>{},onViewAllPassesClick:T=()=>{},onSaveReservation:x=()=>{},renderInfoAlert:b=()=>{}}){const[A,C]=y.useState({step:0,passType:""}),N=y.useRef(),L=ls(),{facilitiesUsingSitePassIntegration:V}=_e(),P="View All Site Passes",z="Help Me Choose a Site Pass",M=t==="NPS",Y=y.useMemo(()=>oa(a,V)||M||p,[V,a,p,M]),oe=y.useMemo(()=>{const K=A?.passType;return K?o.filter(ye=>ye?.transportation_type===K||ye?.transportation_type==="all"&&K!=="individual"):o},[A?.passType,o]),j=y.useMemo(()=>h==="LOADING",[h]);y.useEffect(()=>{n>=0&&C(K=>({...K,step:n}))},[]);const B=K=>{const Re=K.target.value;C(ye=>({...ye,passType:Re}))},F=()=>{const K=(A?.step||0)-1,Re=K>=0?K:0;C(ye=>({...ye,step:Re}))},G=(K=!1)=>async()=>{if(K&&!await x())return;const Re=K?0:2,ye=Math.min((A?.step||0)+1,Re);C(He=>({...He,step:ye}))},pe=()=>{N.current.validate()?.isInvalid||G()()},Je=()=>e.jsxs(e.Fragment,{children:[e.jsx(Q,{appearance:"h4",headingLevel:2,children:"An entrance pass is required at this location"}),e.jsx(Z,{children:e.jsxs(H,{space:"xs",children:[e.jsx(D,{children:"A digital Site Pass:"}),e.jsxs("ul",{className:"site-pass-helper-wizard__list",children:[e.jsx("li",{className:"site-pass-helper-wizard__list-item",children:e.jsxs(vs,{space:"xs",children:[e.jsx(k,{iconName:"check-circle","aria-hidden":!0,className:"site-pass-helper-wizard__list-item-icon",size:"sm"}),e.jsx(D,{children:`Covers the entrance fee for ${s}`})]})}),e.jsx("li",{className:"site-pass-helper-wizard__list-item",children:e.jsxs(vs,{space:"xs",children:[e.jsx(k,{iconName:"check-circle","aria-hidden":!0,className:"site-pass-helper-wizard__list-item-icon",size:"sm"}),e.jsx(D,{children:"Is available for download on a phone or tablet"})]})})]}),ee(Y)(e.jsxs(vs,{space:"xxs",children:[p&&e.jsx(D,{fontWeight:"semibold",children:"Site Passes are non-refundable. Before purchasing, review additional options you might be eligible for below."}),!p&&e.jsxs(e.Fragment,{children:[e.jsx(D,{fontWeight:"semibold",children:"Site Passes are non-refundable. Before purchasing,"}),e.jsx(E,{appearance:"link",onClick:g,gaTrackingId:"488535759505",children:"review these additional options"}),e.jsx(D,{fontWeight:"semibold",children:"you might be eligible for."})]})]}))]})}),L?.isMdAndUp&&e.jsxs(ge,{align:"right",children:[e.jsx(E,{appearance:"tertiary",isDisabled:j,onClick:T,gaTrackingId:"244418425849",children:P}),ee(d?.length)(e.jsx(E,{isDisabled:j,onClick:G(),gaTrackingId:"870820134122",children:z}))]}),L?.isSmAndDown&&e.jsxs(ge,{align:"right",children:[ee(d?.length)(e.jsx(E,{isDisabled:j,onClick:G(),gaTrackingId:"412643661022",children:z})),e.jsx(E,{appearance:"tertiary",isDisabled:j,onClick:T,gaTrackingId:"268831340281",children:P})]})]}),Ge=()=>e.jsxs(e.Fragment,{children:[e.jsx(Dt,{children:e.jsx(Q,{appearance:"h4",headingLevel:2,children:"Which pass do I need?"})}),e.jsx(Z,{children:e.jsxs(H,{space:"xs",children:[e.jsxs(D,{children:['Answer this question to get your recommended pass or view all your options by clicking "',P,'".']}),e.jsx(Wi,{id:"pass-type",name:"pass-type",ref:N,label:"What transportation will you use to enter the park?",isLabelVisible:!0,isRequired:!0,value:A?.passType,onChange:B,children:d?.map(K=>e.jsx(Ki,{id:K?.transportationType,label:K?.transportationTypeName,value:K?.transportationType},K?.transportationType))})]})}),e.jsxs(O,{alignItems:"center",justifyContent:"space-between",children:[e.jsx(S,{md:"variable",xsOrder:"last",mdOrder:"first",children:e.jsx(ge,{className:"mt-2 mt-md-0",align:"left",children:e.jsx(E,{appearance:"link",isDisabled:j,onClick:T,gaTrackingId:"610536664070",children:P})})}),e.jsxs(S,{md:"variable",xsOrder:"first",mdOrder:"last",children:[L?.isMdAndUp&&e.jsxs(ge,{align:"right",children:[e.jsx(E,{appearance:"tertiary",isDisabled:j,onClick:F,gaTrackingId:"098583808998",children:"Back"}),e.jsx(E,{isLoading:j,onClick:pe,gaTrackingId:"726837309223",children:"Continue"})]}),L?.isSmAndDown&&e.jsxs(ge,{align:"right",children:[e.jsx(E,{isLoading:j,onClick:pe,gaTrackingId:"357036109898",children:"Continue"}),e.jsx(E,{appearance:"tertiary",isDisabled:j,onClick:F,gaTrackingId:"437389057005",children:"Back"})]})]})]})]}),es=()=>e.jsxs(e.Fragment,{children:[b(),e.jsx(Dt,{children:e.jsx(Q,{appearance:"h4",headingLevel:2,children:"Based on your selection, we recommend choosing one of the passes below"})}),e.jsx(Z,{children:e.jsx(fa,{selectedPassTypeId:r,passTypes:oe,passTypesRaw:l,status:h,showDescription:u,pricing:c,onSelectPass:m,onRemovePass:f})}),e.jsxs(O,{alignItems:"center",justifyContent:"space-between",children:[e.jsx(S,{md:"variable",xsOrder:"last",mdOrder:"first",children:e.jsx(ge,{align:"left",children:e.jsx(E,{appearance:"link",isDisabled:j,onClick:T,gaTrackingId:"738900336498",children:P})})}),L?.isMdAndUp&&e.jsx(S,{md:"variable",xsOrder:"first",mdOrder:"last"})]})]}),Se=()=>{switch(A?.step){case 1:return Ge();case 2:return es();default:return Je()}};return e.jsx(H,{className:"site-pass-helper-wizard",children:Se()})}kr.propTypes={facilityId:i.string,facilityName:i.string,facilityAgency:i.string,initialStep:i.number,selectedPassTypeId:i.string,passTypes:i.arrayOf(J).isRequired,passTypesRaw:i.arrayOf(J).isRequired,pricing:i.node,passTypesOptions:i.array,status:i.string,showDescription:i.bool,isInWidget:i.bool,onSelectPass:i.func.isRequired,onRemovePass:i.func.isRequired,onReviewOptionsClick:i.func,onViewAllPassesClick:i.func,onSaveReservation:i.func,renderInfoAlert:i.func};function Lr({facilityId:a="",isInWidget:s=!1,baseDomain:t=""}){const[n,r]=y.useState({activeIndex:0}),{facilitiesUsingSitePassIntegration:o}=_e(),l=y.useMemo(()=>Ht?.[a]??null,[a]),c=y.useMemo(()=>s?!1:ia(a,o),[o,a,s]),d=y.useCallback(()=>{let f=`/timed-entry/${l?.timedEntryFacilityId}`;return t&&(f=`${t}${f}`),f},[t,l?.timedEntryFacilityId]),h=y.useCallback(()=>{window.location.href=d()},[d]),u=y.useCallback(f=>{r(g=>{const T=g?.activeIndex||g?.activeIndex===0?null:f;return{...g,activeIndex:T}})},[]),p=()=>l?.areasWithReservation?.length?e.jsxs(O,{children:[e.jsx(S,{md:"variable",children:e.jsx(D,{id:"site-pass-banner-list-title",className:"site-pass-banner__list-title mb-1 mb-md-0",color:"white","aria-hidden":"true",children:l?.areaListTitle||"Areas that require a reservation:"})}),e.jsx(S,{children:e.jsx("ul",{className:"site-pass-banner__list","aria-labelledby":"site-pass-banner-list-title",children:l?.areasWithReservation?.map((f,g)=>e.jsx("li",{className:"site-pass-banner__list-item","aria-label":`${f?.name} ${f?.dates}`,children:e.jsxs("div",{className:"site-pass-banner__list-content","aria-hidden":"true",children:[e.jsx(D,{id:"site-pass-banner__list-name",className:"site-pass-banner__list-name",color:"white",tag:"span",children:f?.name}),f?.dates&&e.jsxs(e.Fragment,{children:[e.jsx(k,{iconName:"calendar",className:"site-pass-banner__list-date-icon",size:"sm"}),e.jsx(D,{id:"site-pass-banner__list-date-text",className:"site-pass-banner__list-date-text",color:"white",fontStyle:"italic",tag:"span",size:"sm",children:f?.dates})]})]})},g))})})]}):null,m=()=>l?.hideBookReservationButton?null:s?e.jsx(ge,{className:"site-pass-banner__buttons-container mt-2 mt-sm-0",children:e.jsx(E,{appearance:"tertiary-white",clickTagAction:`Location ID - ${a}`,clickTagCategory:"Site Pass",clickTagLabel:"Pass Upsell Promo - Book Reservation Now Button",iconBeforeElement:e.jsx(k,{iconName:"car",className:"site-pass-banner__button-icon"}),target:"_blank",rel:"noopener noreferrer",href:d(),gaTrackingId:"775753010796",children:"Book Reservation Now"})}):e.jsx(ge,{className:"site-pass-banner__buttons-container mt-2 mt-sm-0",children:e.jsx(E,{appearance:"tertiary-white",clickTagAction:`Location ID - ${a}`,clickTagCategory:"Site Pass",clickTagLabel:"Pass Upsell Promo - Book Reservation Now Button",iconBeforeElement:e.jsx(k,{iconName:"car",className:"site-pass-banner__button-icon"}),onClick:h,gaTrackingId:"637104568639",children:"Book Reservation Now"})});return!l||!l?.title||!c?null:e.jsxs("div",{className:"site-pass-banner",children:[e.jsx("div",{className:"site-pass-banner__img-background"}),e.jsx(Ut,{className:"site-pass-banner__accordion",headingAppearance:"h5",activeIndex:n?.activeIndex,onChange:u,children:e.jsxs(Za,{children:[e.jsx(Qa,{className:"site-pass-banner__accordion-heading",headingLevel:2,children:l?.title}),e.jsx(Xa,{className:"site-pass-banner__accordion-content",children:e.jsxs(H,{space:"sm",children:[l?.description&&e.jsx(D,{className:"site-pass-banner__description ",color:"white",fontWeight:"semibold",children:l?.description}),(l?.areasWithReservation?.length||!l?.hideBookReservationButton)&&e.jsxs(O,{alignItems:"end",children:[e.jsx(S,{children:p()}),e.jsx(S,{sm:"variable",children:m()})]})]})})]})})]})}Lr.propTypes={facilityId:i.string,isInWidget:i.bool,baseDomain:i.string};function Rm(){return e.jsxs("div",{children:[e.jsx(ve,{lines:1,lineHeight:36,fontSize:30}),e.jsx("div",{className:"mt-1 mb-1",children:e.jsx(ve,{lines:1,lineHeight:20,fontSize:12,width:"170px"})})]})}function ga({isLoading:a=!1,heading:s,facilityName:t,isPartOfParent:n=!1,parentLinkText:r,parentLinkUrl:o,isParentLinkSameService:l=!1,favoriteFacilityId:c,favoriteEntityId:d,favoriteEntityType:h,favoriteParentId:u,favoriteParentType:p,className:m,isInWidget:f=!1}){if(a)return e.jsx(Rm,{});const g=[],T=r&&o,x=(c||d)&&!f,b=T||x;return T&&!n&&(l?g.push(e.jsx(xa,{to:o,translate:"no",children:r},"link")):g.push(e.jsx("a",{href:o,rel:"noreferrer",target:"_blank",translate:"no",children:r},"link"))),!f&&T&&n&&(l?g.push(e.jsxs("span",{children:["Part of  ",e.jsx(xa,{to:o,translate:"no",children:r},"link")]},"partOf")):g.push(e.jsxs("span",{children:["Part of  ",e.jsx("a",{href:o,rel:"noreferrer",target:"_blank",translate:"no",children:r},"link")]},"partOf"))),g?.length&&x&&g.push(e.jsx(Zi,{},"mobile-favorite-divider")),x&&g.push(e.jsx(on,{id:c,entityId:d,entityType:h,parentId:u,parentType:p,showFavoriteText:!0},"favorite-button")),e.jsx("div",{"data-component":"SitePassPageHeader",className:m,children:e.jsxs("div",{children:[e.jsx(Q,{headingLevel:1,appearance:"title",translate:"no",children:s}),e.jsx(D,{color:"gray",size:"lg",children:t}),b&&e.jsx("div",{className:"location-chain mt-1 mb-1",children:e.jsx(vs,{space:["none","sm","md"],children:g})})]})})}ga.propTypes={heading:i.string,facilityName:i.string,parentLinkText:i.string,parentLinkUrl:i.string,isPartOfParent:i.bool,favoriteFacilityId:i.string,favoriteEntityId:i.string,favoriteEntityType:i.string,favoriteParentId:i.string,favoriteParentType:i.string,className:i.string,isLoading:i.bool,isParentLinkSameService:i.bool,isInWidget:i.bool};function Mr({overview:a=[]}){const[s]=a,t=s?.paragraphs;return e.jsx(sn,{id:"parkpass-pass-overview",lineHeight:23,linesToShow:5,children:t?.map((n,r)=>e.jsx(Ue,{html:`
${n}
`},`overview-paragraph-${r}`))})}Mr.propTypes={overview:i.arrayOf(ps)};function kt({title:a="",overview:s=[]}){return e.jsxs(Z,{className:"pass-selection-panel",border:"gray",children:[e.jsx(Z,{className:"pass-selection-panel__header",children:e.jsx(Q,{headingLevel:2,appearance:"h6",children:`About ${a}`})}),e.jsx(Z,{className:"pass-selection-panel__content",children:e.jsx(Mr,{overview:s})})]})}kt.propTypes={title:i.string,overview:i.arrayOf(ps)};function Fr({facility:a={},facilityId:s,loading:t={},loaded:n,reservationId:r,selectedPassTypeId:o,selectedPass:l,passTypes:c=[],parentAsset:d,passTypesRaw:h,errorMessage:u,status:p,passTypesOptions:m,isInWidget:f=!1,baseDomain:g="",onSelectPass:T,onRemovePass:x,onSaveReservation:b,parentSelector:A}){const[C,N]=y.useState({status:"SHOW_HELPER",wizardStep:0,isModalOpen:!1}),{facilitiesUsingSitePassIntegration:L,releaseDigitalIapFeatures:V}=_e(),P=ls(),z=y.useMemo(()=>a?.agency==="NPS",[a?.agency]),M=Ka(),Y=y.useMemo(()=>oa(s,L)||z||f||M,[L,s,f,z]),oe=y.useMemo(()=>p==="LOADING",[p]),j=d?.find(U=>U?.entity_id===a?.asset_id),B=()=>{let U="/pass";return V?.passLandingPage?U=`${U}#digital-interagency-passes`:U=`${U}?section_id=interagency-annual-pass`,g&&(U=`${g}${U}`),U},F=()=>{window.location.href=B()},G=()=>{const U=document.getElementById("interAgencyPassesInfo");if(U){const Ce=Math.floor(U.getBoundingClientRect().top);window.scrollBy({top:Ce-100,left:0,behavior:"smooth"})}},pe=()=>{N(U=>({...U,status:"SHOW_ALL_PASSES",wizardStep:0}))},Je=()=>{N(U=>({...U,status:"SHOW_HELPER",wizardStep:1}))},Ge=()=>{x(),N(U=>({...U,isModalOpen:!1}))},es=U=>{T(U),N(Ce=>({...Ce,isModalOpen:!0}))},Se=()=>{b(),N(U=>({...U,isModalOpen:!1}))},K=()=>{let U=null;if(a.id&&Array.isArray(a?.contents?.pricing)){const Ce=a.contents.pricing.flatMap(({paragraphs:gs=[]},w)=>gs.map((W,le)=>e.jsx("p",{children:e.jsx(rn,{html:W})},`html-${w}-${le}`)));U=e.jsx(js,{noticeType:"info",closeButton:!1,children:Ce})}return U},Re=()=>f||M?e.jsx(E,{appearance:"link",iconBeforeElement:e.jsx(k,{iconName:"help-outline"}),target:"_blank",rel:"noopener noreferrer",href:B(),gaTrackingId:"662752139445",children:"Learn More About Interagency Passes"}):e.jsx(E,{appearance:"link",iconBeforeElement:e.jsx(k,{iconName:"help-outline"}),onClick:F,gaTrackingId:"711847152892",children:"Learn More About Interagency Passes"}),ye=()=>{const U=(f||M)&&g?`${g}/shared`:"/shared",Ce=z?"lifetime or annual":"free",gs=z?"Interagency Passes":"interagency passes";return e.jsxs("div",{id:"interAgencyPassesInfo",className:"parkpass-order-details__passes-info mb-2",children:[e.jsx(Q,{className:"mb-half",headingLevel:2,appearance:"h6",children:`This location accepts and offers ${gs} to cover the entrance fee.`}),e.jsx(D,{className:"mb-2",children:`If you already have a pass, bring it with you. To learn if you qualify for one of the ${Ce} passes, click the link below then get your pass when you arrive.`}),e.jsx("div",{className:"parkpass-order-details__passes-info-image-container mb-2",children:e.jsx(nn,{imagePath:`${U}/img/interagencyPass/inter-agency-passes-info`,fallbackExtension:"png",alt:"Multiple interagency passes"})}),Re()]})},He=()=>e.jsx(ke,{type:"info",children:"You have the option to purchase a pass when you visit the park."});return!n?.facilityByIdOrSlug||!n?.passTypes?e.jsx(ha,{}):e.jsxs("section",{className:"pass-selection",children:[e.jsxs(H,{space:"md",children:[ee(t.passTypes||n.passTypes&&!r)(e.jsx(Lr,{facilityId:s,isInWidget:f||M,baseDomain:g})),e.jsxs(O,{children:[e.jsx(S,{md:8,xsOrder:"last",mdOrder:"first",children:e.jsxs(H,{space:"md",children:[e.jsx(ga,{isLoading:!1,heading:"Site Pass Selection",facilityName:a?.name,parentLinkText:j?.name,parentLinkUrl:a?.asset_id?nu(a?.asset_id,g):null,isPartOfParent:!0,favoriteFacilityId:s,favoriteEntityId:a.asset_id,favoriteEntityType:"sitepass",isInWidget:f||M}),ee(!!u)(e.jsx(ke,{type:"error",children:u})),ee(C?.status==="SHOW_HELPER")(e.jsx(kr,{facilityId:s,facilityName:a?.name,facilityAgency:a?.agency,initialStep:C?.wizardStep,selectedPassTypeId:o,passTypes:c,passTypesRaw:h,pricing:K(),passTypesOptions:m,status:p,showDescription:!1,isInWidget:f||M,onSelectPass:es,onRemovePass:x,onReviewOptionsClick:G,onViewAllPassesClick:pe,onSaveReservation:b,renderInfoAlert:He})),ee(C?.status==="SHOW_ALL_PASSES")(e.jsxs(e.Fragment,{children:[He(),e.jsxs(O,{alignItems:"center",justifyContent:"space-between",children:[e.jsx(S,{children:e.jsx(Dt,{children:e.jsx(Q,{appearance:"h5",headingLevel:2,children:`All Site Passes available at ${a?.name}`})})}),e.jsx(S,{md:"variable",children:ee(m?.length)(e.jsx(E,{appearance:"link",iconBeforeElement:e.jsx(k,{iconName:"help-outline"}),isDisabled:oe,onClick:Je,gaTrackingId:"340878007548",children:"Help Me Choose a Pass"}))})]}),e.jsx(Z,{children:e.jsx(H,{children:e.jsx(fa,{selectedPassTypeId:o,passTypes:c,passTypesRaw:h,status:p,showDescription:!1,pricing:K(),onSelectPass:es,onRemovePass:x})})})]})),ee(P?.isSmAndDown)(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"pass-selection__divider",children:e.jsx(ja,{})}),e.jsx(kt,{title:a?.name,overview:a?.contents?.overview})]})),ee(Y||Y&&P?.isSmAndDown)(e.jsx("div",{className:"pass-selection__divider",children:e.jsx(ja,{})})),ee(Y)(e.jsx(Z,{children:ye()}))]})}),e.jsx(S,{md:4,xsOrder:"first",mdOrder:"last",children:e.jsxs(H,{space:"md",children:[ee(a?.id&&P.isSmAndUp&&!f&&!M)(e.jsx("div",{className:"pass-selection__image-container mb-sm-3 mb-md-0",children:e.jsx(an,{id:a?.asset_id||a?.id,type:"asset"})})),ee(P.isMdAndUp)(e.jsx(kt,{title:a?.name,overview:a?.contents?.overview}))]})})]})]}),e.jsxs(bs,{isOpen:C?.isModalOpen,onRequestClose:Ge,heading:`You selected the ${l?.name}`,parentSelector:A||void 0,children:[l?.used_for&&e.jsx(D,{children:`${iu(l?.used_for)}`}),e.jsx(zt,{children:e.jsxs(ge,{children:[e.jsx(E,{appearance:"tertiary",onClick:Ge,gaTrackingId:"196887984833",children:"Keep Exploring Passes"}),e.jsx(E,{appearance:"primary",onClick:Se,gaTrackingId:"047964645829",children:"Continue to Order Details"})]})})]})]})}Fr.propTypes={facility:Qe,facilityId:i.string,loaded:i.shape({facilityByIdOrSlug:i.bool,reservations:i.bool,passTypes:i.bool}),loading:i.shape({facilities:i.bool,passTypes:i.bool}),errorMessage:i.string,status:i.string,passTypesOptions:i.array,isInWidget:i.bool,baseDomain:i.string,passTypes:i.arrayOf(J),selectedPassTypeId:i.string,selectedPass:i.object,passTypesRaw:i.arrayOf(J),reservationId:i.string,parentAsset:i.array,onSelectPass:i.func.isRequired,onRemovePass:i.func.isRequired,onSaveReservation:i.func.isRequired,parentSelector:i.func};function Cm(a,s){const t=y.useRef();y.useEffect(()=>{t.current=a}),y.useEffect(()=>{function n(){t.current()}const r=setInterval(n,s);return()=>clearInterval(r)},[s])}function Im(){const a=Va(),[s,t]=y.useState({selectedPassTypeId:"",selectedPass:null,parentAsset:null,reservation:null,submitAttempted:!1,errorMessage:"",status:"IDLE"}),n=Ga(),{siteId:r}=n,[o]=Ha(),l=o.get("fid"),c=qa(),d=y.useRef({didAttemptBuy:!1,intervalId:null}),h=fe(j=>!!j.auth?.account?.access_token),u=fe(j=>j.auth?.account?.account),p=fe(j=>!!j.auth?.csrAccount),m=fe(la.getFacilityByIdOrSlug),f=fe(j=>j.parkpass.reservations.error),g=fe(j=>ca(j,"reservations","facilityByIdOrSlug","passTypes")),T=fe(j=>da(j,"reservations","facilityByIdOrSlug","passTypes")),x=fe(j=>gt.getPassTypes(j)),b=y.useMemo(()=>r||l,[l,r]),A=y.useMemo(()=>m?.agency==="NPS",[m?.agency]),C=y.useMemo(()=>!x?.length?x:x.filter(F=>!!!F?.features?.is_field_sales),[x]),N=y.useMemo(()=>{let j={};for(let F=0;FF.order-G.order)},[C]),L=y.useCallback(()=>{!T.facility&&!g.facility&&a(ua(b)).then(j=>{sa(j.asset_id).then(({data:B})=>t(F=>({...F,parentAsset:B?.results}))),j.id&&!T.passTypes&&!g.passTypes&&a(pa(j.id))})},[b,g.facility,g.passTypes,T.facility,T.passTypes]),V=y.useCallback(()=>Bt()||Nt()||Wa(),[]),P=y.useCallback(()=>{const j=V(),B=!p||h&&!Nt();return{loggedIn:j,validUser:B}},[p,V,h]),z=y.useCallback(async()=>{try{let j="";if(t(G=>({...G,isSubmitting:!0,submitAttempted:!1,errorMessage:"",status:"LOADING"})),!s?.reservation)throw j="You must select a pass",d.current.didAttemptBuy=!1,new Error(j);const{loggedIn:B,validUser:F}=P();if(B||a(Qi()),F||(j="Please select a customer to continue with the reservation.",Xi()),!B||!F)throw d.current.didAttemptBuy=!0,new Error(j);try{return a(_m(s?.reservation)),t(G=>({...G,status:"IDLE"})),d.current.didAttemptBuy=!1,c(`/sitepass/${b}/create/reservation`),!0}catch{return t(pe=>({...pe,isSubmitting:!1,submitAttempted:!0,status:"IDLE"})),d.current.didAttemptBuy=!1,window.scrollTo(0,0),!1}}catch(j){const B={isSubmitting:!1,status:"IDLE"};return j?.message&&(B.errorMessage=j?.message,Ji(j?.message)),t(F=>({...F,...B})),!1}},[b,s?.reservation,P]),M=y.useCallback(()=>{t(j=>({...j,selectedPassTypeId:"",selectedPass:null,reservation:null,errorMessage:"",submitAttempted:!1})),d.current.didAttemptBuy=!1},[]),Y=y.useCallback(()=>{const j=document.getElementsByClassName("ReactModal__Body--open");d?.current?.didAttemptBuy&&!j?.length&&M()},[M]);Cm(Y,500),y.useEffect(()=>{L()},[]),y.useEffect(()=>{const j=f?.[0]?.error_message;j&&t(B=>({...B,errorMessage:j}))},[f]),y.useEffect(()=>{const{loggedIn:j,validUser:B}=P();j&&B&&d?.current?.didAttemptBuy&&z()},[z,p,V,h,P]);const oe=y.useCallback(j=>{let B={};u&&(B={pass_info:{...Fs.pass_info,holder_info:{first_name:u?.first_name,last_name:u?.last_name,email:u?.email}}});let F={...Fs,is_pending:!0,facility_id:b,pass_type_id:j,...B};F.pass_info.start_date=_().startOf("day").format(),F.pass_info.features["start-date"]=_().startOf("day").format();const G=C?.find(pe=>pe?.id===j);F.pass_info.duration=G?.duration,G&&Ee(G?.duration)&&(F.pass_info.start_date="",F.pass_info.features["start-date"]=""),F={...F,holder_info:F?.pass_info?.holder_info,features:{discount:{},...F?.pass_info?.features}},t(pe=>({...pe,selectedPassTypeId:j,selectedPass:G,reservation:F,errorMessage:"",submitAttempted:!1}))},[b,C,u]);return nl({itemLevel:"Pass Selection",facilityId:m?.asset_id,itemCategory:Xo}),g?.facilityByIdOrSlug&&!T?.facilityByIdOrSlug&&!m?.id||m?.is_external_search_disabled?e.jsx(Ms,{}):A?e.jsxs(dn,{className:"pass-selection-page",children:[e.jsx(zs,{title:"Pass Selection"}),e.jsx(pn,{}),e.jsx(Fr,{facility:m,facilityId:b,parentAsset:s?.parentAsset,loaded:g,loading:T,selectedPassTypeId:s?.selectedPassTypeId,selectedPass:s?.selectedPass,passTypes:C,passTypesRaw:x,errorMessage:s?.errorMessage,status:s?.status,passTypesOptions:N,onSelectPass:oe,onRemovePass:M,onSaveReservation:z})]}):e.jsx(Tt,{})}function Am(a){const{sitePassUiRevamp:s}=_e();return y.useMemo(()=>Er(s),[s])?e.jsx(Im,{}):e.jsx(Tt,{...a})}const Ba={description:i.string,quantity:i.string,title:i.string,value:i.number};function Lt({attendeeInfo:a,lines:s,total:t,ariaLabel:n,showNoLinesText:r=!1}){const o=(l,c,d)=>{const{title:h,description:u,value:p}=l;if(!p)return null;const m=us(p),f=h==="Total Cost",g=h==="Subtotal";let T=f?"parkpass-costs-table-total-cost":"";g&&(T="parkpass-costs-table-subtotal");let x=`${h}: ${m}`;return d&&(x=`${d} ${x}`),e.jsxs(O,{className:`parkpass-costs-table-item-wrap ${T}`,children:[e.jsxs(S,{xs:6,md:8,xl:6,children:[e.jsx(D,{size:"sm",children:h}),ee(u)(e.jsx(D,{size:"sm",tag:"span",children:u})),c&&e.jsx(D,{size:"sm",children:c})]}),e.jsx(S,{"aria-label":x,role:"complementary",tabIndex:h==="Total Cost"||h==="Subtotal"?0:-1,xs:6,md:4,xl:6,className:"parkpass-costs-table-cost",children:e.jsx(D,{align:"right",size:"sm",children:m})})]},h)};return e.jsxs(Z,{children:[s.map((l,c)=>o(l,c?null:a)),r&&e.jsx(D,{children:"No passes have been selected. Please choose how many passes you will need for this trip."}),o(t,null,n)]})}Lt.propTypes={attendeeInfo:i.node,lines:i.arrayOf(i.shape(Ba)).isRequired,total:i.shape(Ba).isRequired,ariaLabel:i.string,showNoLinesText:i.bool};function ya({passType:a,reservation:s}){const t=y.useMemo(()=>{const o=a?.features?.["day-segment"]?.groups||[],l=s?.features?.["day-segment"]?.groups||[],c=a?.features?.["attendee-info"]||o,d=s?.features?.["attendee-info"]||l,h=[],u=[{title:`${a?.name}`,quantity:"x 1",value:s?.price}];s?.fees&&u.push({title:"Service Fee",quantity:"x 1",value:s?.fees});const p={title:"Subtotal",value:s?.total};let m=!0;return Object.entries(c).forEach(([f,g])=>{const T=d[f];if(!T){g?.attendee_min>0&&(m=!1);return}g?.attendee_max>-1&&g?.price_per_attendee&&T>g?.attendee_max&&(m=!1),h.push(e.jsx("span",{className:"parkpass-reservation-summary-attendee-info",children:`${T} ${hs(T,f.replace(/s$|ren$/,""),f)}`},f));let x;x=Math.max(g.price_min,T*g.price_per_attendee),g.price_max>0&&(x=Math.min(g.price_max,x)),x&&(u.push({title:a?.name,quantity:"x 1",description:a?.description,value:x}),p.value+=x)}),{allowedToBuy:m,attendeeInfo:h,costs:u,total:p}},[a?.description,a?.features,a?.name,s?.features,s?.fees,s?.price,s?.total]),n=y.useMemo(()=>{const o={title:"Total Cost",value:0},{total:l}=t;o.value+=l?.value||0;const c=["season","seasonal"].includes(a.duration),d="ddd, ll",[h]=os(a.periods);let[,u]=os(a.periods);const p=_(c?h:s?.pass_info?.features["start-date"]);let m=p.format(d),f=ft(p,a).format(d);const g=As(a.duration);if(a.features["end-date"]||a.features["day-segment"]||a.duration==="segment"){const A=s.pass_info.features["end-date"];g.days=_(A).add(2,"days").diff(_(),"days")}if(c&&(g.days=_(u).add(2,"days").diff(_(),"days"),f=_(u).format(d)),!_(u).isValid()){const[A,C,N]=u?.split("-")??[void 0,void 0,void 0];u=`${parseInt(A,10)+1}-${C}-${N}`,f=_(u).format(d)}if(a.duration.indexOf("limit-to-season")!==-1){const A=g.days-1,C=_(p).add(A,"d"),N=C.isAfter(u,"day");f=C.format(d),N&&(f=_(u).format(d))}return Ee(a?.duration)&&he(s?.pass_info?.features["start-date"])&&(m="Select Start date",f="Select Start date"),{startDate:m,endDate:f,totalCost:o}},[t,a,s.pass_info.features]),r=y.useMemo(()=>n?.startDate==="Select Start date"||n?.endDate==="Select Start date",[n?.endDate,n?.startDate]);return a?e.jsxs(H,{children:[e.jsxs(O,{children:[e.jsx(S,{xs:6,md:12,xl:6,children:e.jsxs(O,{xs:12,children:[e.jsx(S,{children:e.jsx(D,{color:"gray",size:"sm",children:"Start Date"})}),e.jsx(S,{xs:12,children:e.jsx(D,{fontWeight:"semibold",children:n?.startDate})})]})}),e.jsx(S,{xs:6,md:12,xl:6,children:e.jsxs(O,{children:[e.jsx(S,{xs:12,children:e.jsx(D,{color:"gray",size:"sm",children:"Valid Through"})}),e.jsx(S,{xs:12,children:e.jsx(D,{fontWeight:"semibold",children:n?.endDate})})]})})]}),!r&&e.jsxs(e.Fragment,{children:[e.jsx(is,{}),t?.allowedToBuy?e.jsx("div",{children:e.jsx(Lt,{lines:t?.costs,total:t?.total,ariaLabel:`Pass Summary: 1 ${a.name}, The start date is ${n?.startDate} and is valid through ${n?.endDate}`,attendeeInfo:t?.attendeeInfo})}):e.jsx(ke,{type:"error",children:"Your selections are outside the bounds for this pass type. Please make a different selection."}),e.jsx(is,{}),e.jsx(Lt,{lines:[],total:n?.totalCost,showNoLinesText:!s})]})]}):null}ya.propTypes={passType:J,reservation:ze};function Yr({isLoading:a,heading:s,imageUrl:t,parentName:n,proceedToCartButtonText:r,secondaryButtonText:o,isDrawerWrapFullWidth:l,passType:c,reservation:d,onProceedToCartClick:h,onSecondaryButtonClick:u}){return e.jsx(fr,{isLoading:a,heading:s,imageUrl:t,parentName:n,proceedToCartButtonText:r,secondaryButtonText:o,isDrawerWrapFullWidth:l,onProceedToCartClick:h,onSecondaryButtonClick:u,children:e.jsx(ya,{facilityName:s,passType:c,reservation:d})})}Yr.propTypes={isLoading:i.bool,heading:i.string,imageUrl:i.string,parentName:i.string,proceedToCartButtonText:i.string,secondaryButtonText:i.string,isDrawerWrapFullWidth:i.bool,passType:J,reservation:ze,onProceedToCartClick:i.func,onSecondaryButtonClick:i.func};function $r({facility:a={},sitePassImage:s,reservation:t=null,passTypes:n=[],passType:r=null,submitAttempted:o=!1,isLoading:l=!0,isNewReservation:c=!1,isInWidget:d=!1,onNeedToKnowChange:h=()=>{},onReservationChange:u=()=>{},onRemoveReservation:p=()=>{},onSaveReservation:m=()=>{},renderValidationErrors:f=()=>{},parentSelector:g}){const T=y.useMemo(()=>!!t?.pass_info?.features?.accepted?.need_to_know,[t?.pass_info?.features?.accepted?.need_to_know]),x=y.useMemo(()=>`Please carefully review the important information below and click the check box to agree to the rules and regulations. The information in this section only pertains to this pass. Other important visitation policies and details can be found on the Recreation.gov page for ${a?.name}.`,[a?.name]),b=y.useCallback((V,P,z)=>{if(t&&r){const M={},Y={};r&&r.features.accepted&&(Y.accepted=r.features.accepted.reduce((j,B)=>{const F=t?.pass_info?.features?.accepted?.[B]??!1;return{...j,[B]:F}},{}));const oe={...t,pass_info:P,pass_type_id:V||t.pass_type_id,holder_info:P.holder_info,features:{discount:M,...P.features,...Y}};u(oe,z)}},[u,r,t]),A=()=>(window.location="/cart",null),C=e.jsx(Yr,{isLoading:l,heading:r?.name,imageUrl:s,parentName:a?.name,passType:r,reservation:t,facility:a,proceedToCartButtonText:c?"Add to Cart":"Save Changes",secondaryButtonText:c?void 0:"Cancel Changes",isDrawerWrapFullWidth:!0,onProceedToCartClick:m,onSecondaryButtonClick:c?void 0:A,children:e.jsx(ya,{facilityName:a?.name,passType:r,reservation:t})}),N=()=>{const V=a?.contents?.need_to_know??[];return e.jsxs(en,{introText:x,isChecked:T,isInvalid:!T&&o,handleChange:h,children:[V.map(({title:P,paragraphs:z=[]},M)=>e.jsxs("section",{className:"rec-order-detail-need-help",children:[!!P&&e.jsx(Q,{className:"mb-1",headingLevel:3,appearance:"h6",children:P}),z.map((Y,oe)=>e.jsx(Ue,{html:`

${Y}

`},`html-${oe}`))]},`section-${M}`)),e.jsx(ra,{siteName:a?.name,noFeePeriods:a?.free_days})]})};if(l)return e.jsx(ha,{});if(!t||!r)return null;const L=()=>d?f():e.jsx(Rr,{reservations:[t],submitAttempted:o,passTypes:n,needToKnowChecked:T});return e.jsx(dn,{className:"pass-order-details",children:e.jsx(mr,{summaryElement:C,children:e.jsxs(H,{space:"lg",children:[e.jsx(ga,{isLoading:!1,heading:"Site Pass Order Details",facilityName:a?.name,isInWidget:d}),e.jsx(Z,{children:e.jsxs(H,{children:[e.jsxs(Z,{children:[e.jsx(Q,{className:"mb-1",headingLevel:3,appearance:"h5",children:c?"Pass Details":"Modify"}),e.jsx(D,{children:c?"Please provide the required information below:":"Please modify the pass information below:"})]}),L(),e.jsx("div",{className:"rec-internal-reservation-details-parkpass",children:e.jsx(xr,{submitAttempted:o,facility:a,number:1,passInfo:t?.pass_info,passType:r,price:us(t?.price),renderRemove:!0,isPending:t?.is_pending,reservationId:t?.id,onChange:b,onRemove:p,parentSelector:g})})]})}),N()]})})})}$r.propTypes={facility:Qe,sitePassImage:i.string,reservation:ze,passTypes:i.arrayOf(J),passType:J,submitAttempted:i.bool,isLoading:i.bool,isNewReservation:i.bool,isInWidget:i.bool,onNeedToKnowChange:i.func,onReservationChange:i.func,onRemoveReservation:i.func,onSaveReservation:i.func,renderValidationErrors:i.func,parentSelector:i.func};function Dm(){const a=qa(),[s]=Ha(),t=s.get("fid"),n=s.get("rid"),r=Va(),[o,l]=y.useState({reservation:null,parentAsset:null,submitAttempted:!1,isSubmitting:!1}),c=fe(w=>w.cart.reservations),d=fe(jr.getReservations),h=Ga(),{siteId:u,resId:p}=h,m=fe(la.getFacilityByIdOrSlug),f=fe(w=>ca(w,"reservations","facilityByIdOrSlug","passTypes")),g=fe(w=>da(w,"reservations","facilityByIdOrSlug","passTypes")),T=fe(w=>gt.getPassTypes(w)),x=fe(w=>w.parkpass.localReservation.reservation),b=eo({assetId:m?.asset_id}),A=["Order Details","Shopping Cart","Payment","Confirmation"],C=y.useMemo(()=>m?.agency==="NPS",[m?.agency]),N=y.useMemo(()=>window.location.pathname.includes("/create/reservation"),[]),L=y.useMemo(()=>Bt()||Nt(),[]),V=y.useMemo(()=>o?.parentAsset?.find(w=>w?.entity_id===m?.asset_id),[m?.asset_id,o?.parentAsset]),P=y.useMemo(()=>u||t,[t,u]),z=y.useMemo(()=>p||n,[n,p]),M=y.useMemo(()=>!T?.length?T:T.filter(le=>!!!le?.features?.is_field_sales),[T]),Y=y.useMemo(()=>N?x:d?.[0],[N,x,d]),oe=y.useMemo(()=>M?.find(({id:w})=>w===Y?.pass_type_id),[M,Y?.pass_type_id]),j=y.useMemo(()=>b?.heroImage?.url||b?.previewImage?.url||b?.galleryImages?.[0]?.url,[b?.galleryImages,b?.heroImage?.url,b?.previewImage?.url]),B=y.useMemo(()=>!!o?.reservation?.pass_info?.features?.accepted?.need_to_know,[o?.reservation?.pass_info?.features?.accepted?.need_to_know]),F=y.useMemo(()=>g.facility||g.passTypes||g.reservations,[g.facility,g.passTypes,g.reservations]),G=y.useCallback(()=>{!g.facility&&!f.facility&&r(ua(P))},[P,f.facility,g.facility]),pe=y.useCallback(async()=>{if(m?.asset_id){const{data:w}=await sa(m?.asset_id);l(W=>({...W,parentAsset:w?.results}))}},[m?.asset_id]),Je=y.useCallback(()=>{m?.id&&!g.passTypes&&!f.passTypes&&r(pa(m?.id))},[m?.id,f.passTypes,g.passTypes]),Ge=y.useCallback(()=>{!N&&z&&!g.reservations&&!f.reservations&&r(Dr([z]))},[N,f.reservations,g.reservations,z]),es=y.useCallback(()=>{G(),Ge()},[G,Ge]),Se=y.useCallback(()=>{a(`/sitepass/${P}`)},[P]);y.useEffect(()=>{L||Se()},[L,Se]),y.useEffect(()=>(L&&es(),()=>{r(xm())}),[]),y.useEffect(()=>{pe()},[pe]),y.useEffect(()=>{Je()},[Je]),y.useEffect(()=>{(N&&!x||!N&&f?.reservations&&(!Y?.id||Y?.error))&&Se()},[N,f?.reservations,x,Se,Y?.error,Y?.id]),y.useEffect(()=>{if(Y){const w=de(Y);w?.pass_info?.holder_info?.email&&(w.pass_info.holder_info.email_confirmation=w?.pass_info?.holder_info?.email),l(W=>({...W,reservation:w}))}},[Y]);const K=y.useCallback(async({pass_type_id:w,features:W,pass_info:{start_date:le}})=>{let Fe=null;try{if(!Ee(oe?.duration)||!he(le)){const{data:qe}=await Jn({pass_type_id:w,features:{...W,"start-date":le}});Fe=qe}return Fe}catch{return Fe}},[oe?.duration]),Re=y.useCallback(()=>{if(o?.reservation){const w=de(o?.reservation);w.pass_info.features.accepted.need_to_know=!B,l(W=>({...W,reservation:w}))}},[B,o?.reservation]),ye=y.useCallback(async w=>{const W=de(w),le=de(o?.reservation);delete le?.pass_info?.features?.discount;let Fe={};if(!Es(le?.pass_info?.features,W?.pass_info?.features)){const qe=await K(W);if(qe){const{fees:Br,price:Ur,total:zr}=qe;Fe={has_price:!0,fees:Br,price:Ur,total:zr}}}l(qe=>({...qe,reservation:{...W,...Fe,pass_info:{...W?.pass_info,holder_info:W?.holder_info,features:W?.features}}}))},[K,o?.reservation]),He=y.useCallback(async w=>{if(Y?.id===w){if(r(wr(0)),N){Se();return}try{await r(Ar(w)),window.location.assign("/cart")}catch{window.scrollTo(0,0)}}},[N,Se,Y?.id]),U=y.useCallback(async()=>{let w=!1;const W=o?.reservation;if(W)try{const le=de(W);le.holder_info=le?.pass_info?.holder_info,le.features=le?.pass_info?.features,le.features.accepted.need_to_know=!0,w=!await r(Pr(0,le))}catch{return w}return w},[o?.reservation]),Ce=y.useCallback(()=>{const w=o?.reservation;return!!(w?.holder_info?.email_confirmation&&w?.holder_info?.email===w?.holder_info?.email_confirmation&&B)},[B,o?.reservation]),gs=y.useCallback(async()=>{if(!await U()){l(W=>({...W,submitAttempted:!1,isSubmitting:!1})),window.scrollTo(0,0);return}try{if(!Ce())throw l(W=>({...W,isSubmitting:!1})),new Error;await r(Nr([o?.reservation])),window.location.assign("/cart")}catch{l(le=>({...le,submitAttempted:!0,isSubmitting:!1})),U(),window.scrollTo(0,0)}},[o?.reservation,Ce,U]);return C?e.jsxs("main",{className:"pass-order-details-page",children:[e.jsx(zs,{title:"Order Details"}),e.jsxs(H,{space:"lg",children:[e.jsx(Z,{background:"gray-2",paddingY:"sm",children:e.jsx(cn,{eventToReportToGA:gn(c,A,0),shouldReportToGA:!0,steps:A,activeStep:1})}),e.jsx($r,{facility:m,facilityId:P,reservation:o?.reservation,recArea:V,sitePassImage:j,passTypes:M,passType:oe,submitAttempted:o?.submitAttempted,isLoading:F,isNewReservation:N,onNeedToKnowChange:Re,onReservationChange:ye,onRemoveReservation:He,onSaveReservation:gs})]})]}):e.jsx(Tt,{})}function Nm(a){const{sitePassUiRevamp:s}=_e();return y.useMemo(()=>Er(s),[s])?e.jsx(Dm,{}):e.jsx(Tt,{...a})}const Pm={PassSelectionPage:Am,PassOrderDetailsPage:Nm};function wm(){const a=Le.map(s=>{const t=Pm[s.componentName];return e.jsx(_t,{path:s.path,element:e.jsx(t,{})},s.path)});return a.push(e.jsx(_t,{path:"/camping/mobile/session",element:e.jsx(so,{})},"mobileSession")),a.push(e.jsx(_t,{path:"*",element:e.jsx(Ms,{})},"notFound")),a}function Om(){const{useNewCampingFilters:a}=_e(),s=Oo();return e.jsxs(Ho,{children:[e.jsx(No,{}),e.jsx(to,{getMenuAccountItems:Io,menuSections:s,logoElement:e.jsx(La,{}),darkModeLogoElement:e.jsx(La,{isLight:!0})}),e.jsx(ao,{fallbackElement:e.jsx(qo,{}),children:e.jsx(no,{className:"rec-page",children:e.jsx(gi,{children:wm()})})}),e.jsx(Co,{})]})}function km(){return{}}const Lm={...km()},Mm=yi({checkout:pm,parkpass:Vp,...ro});function Fm(a){return Ti({preloadedState:a,reducer:Mm,middleware:t=>t({serializableCheck:{ignoredActions:["launchdarkly/setClient"],ignoredPaths:["launchdarkly"]},immutableCheck:{ignoredPaths:["parkpass"]}}),devTools:!1})}const Ym=Fm(Lm),$m=Vr.createRoot(document.getElementById("recApp"));$m.render(e.jsx(_i,{store:Ym,children:e.jsxs(xi,{children:[e.jsx(go,{}),e.jsx(io,{children:e.jsx(Om,{})})]})})); //# sourceMappingURL=index-BRUakueW.js.map