PageSourceSearch

https://captainstarlight.org.au/_next/static/chunks/pages/live-9fb72a166b9ff744.js

js captainstarlight.org.au collected 2026-10-09 22:42:16 UTC 25,851 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[154],{6580:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/live",function(){return a(1579)}])},6417:function(e,t,a){"use strict";var l=a(2676),s=a(2187),o=a.n(s);t.Z=e=>{let{noMargin:t=!1,noPadding:a=!1,className:s="",children:n,...i}=e,r=o()("container",{"mx-auto":!t,"px-6 md:px-8 lg:px-12":!a},s);return(0,l.jsx)("div",{className:r,...i,children:n})}},366:function(e,t,a){"use strict";var l=a(2676);let s=Object.freeze({sm:"h-4 w-4",md:"h-8 w-8",lg:"h-12 w-12",xl:"h-16 w-16"}),o=Object.freeze({white:"text-white",purple:"text-purple"});t.Z=e=>{let{size:t="md",color:a="white"}=e;return(0,l.jsxs)("svg",{className:"motion-safe:animate-spin ".concat(s[t]," ").concat(o[a]),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,l.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,l.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}},2940:function(e,t,a){"use strict";var l=a(2676),s=a(7310),o=a(9399),n=a(2384),i=a(1548),r=a(8919);t.Z=e=>{let{children:t}=e;return(0,l.jsx)(s.vQ,{loadOptions:{apiKey:"".concat("DFQ6x3272vQXgTCvYXYg"),region:"".concat("AP")},cacheLocation:o.Xd.LocalStorage,cacheTimeInSeconds:86400,children:(0,l.jsx)(i.Z,{children:(0,l.jsx)(n.Z,{children:(0,l.jsx)(r.Z,{children:t})})})})}},6308:function(e,t,a){"use strict";a.d(t,{KM:function(){return i},hW:function(){return n},px:function(){return l},vP:function(){return o},wJ:function(){return s}});let l="Captain Starlight",s="/img/share.png",o="online-users",n="latest-reactions",i="Captain Starlight presents live and interactive fun for kids in hospital Australia wide that is out of this world. Powered By The Starlight Children's Foundation."},5414:function(e,t,a){"use strict";var l=a(5271);t.Z=(0,l.createContext)({streamId:void 0,isLoaded:!1,isUpdating:!1,isStreamLive:!1,isGameLive:!1,isChatActive:!1,chatReactions:{},reactions:{},reactionsSet:[],reactionTypes:{},updateReactionSet:e=>{},toggleIsStreamLive:()=>{},toggleIsGameLive:()=>{},toggleIsChatActive:()=>{}})},2384:function(e,t,a){"use strict";var l=a(2676),s=a(5271),o=a(5414),n=a(2036),i=a(6211);t.Z=e=>{let{children:t}=e,[a,r]=(0,s.useState)(),[c,u]=(0,s.useState)(!1),[d,p]=(0,s.use
1State)();(0,i.Z)(async()=>{if(void 0!==d)return;p(null);let{id:e}=await (0,n.O)("stream/get/active");p(e)},[]);let m=(0,s.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";try{let t=await (0,n.O)("options/get",{name:e});if(t&&(null==t?void 0:t.value)){let e=JSON.parse(t.value);r(e)}}catch(e){console.error("Error - 19")}},[r]);(0,s.useEffect)(()=>{a||m()},[m,a]),(0,s.useEffect)(()=>{let e=n.V.channel("Options_Public").on("postgres_changes",{event:"UPDATE",schema:"public",table:"Options_Public"},e=>{var t;m(null==e?void 0:null===(t=e.new)||void 0===t?void 0:t.name)}).subscribe();return()=>{e.unsubscribe()}},[m]);let h=(0,s.useMemo)(()=>(null==a?void 0:a.chatReactions)||{},[a]),g=(0,s.useMemo)(()=>(null==a?void 0:a.reactions)||{},[a]),x=(0,s.useMemo)(()=>(null==a?void 0:a.isStreamLive)||!1,[a]),v=(0,s.useMemo)(()=>(null==a?void 0:a.isGameLive)||!1,[a]),b=(0,s.useMemo)(()=>(null==a?void 0:a.isChatActive)||!1,[a]),f=(0,s.useMemo)(()=>(null==a?void 0:a.reactionsSet)||[],[a]),y=(0,s.useMemo)(()=>Object.fromEntries(null==f?void 0:f.map(e=>{let{reactionSet:t}=e;return Object.entries(t)}).flat()),[f]),k=(0,s.useCallback)(async e=>{u(!0);let t=await (0,n.O)("options/save",{name:"default",value:JSON.stringify({...a,...e})});return u(!1),t},[a]),w=(0,s.useCallback)(async e=>{var t;let a=null===(t=f.find(t=>{let{name:a}=t;return a===e}))||void 0===t?void 0:t.reactionSet;if(a)return await k({reactions:a})},[f,k]),j=(0,s.useCallback)(async()=>v?await k({isGameLive:!1}):await k({isGameLive:!0,isStreamLive:!1}),[v,k]),S=(0,s.useCallback)(async()=>x?await k({isStreamLive:!1}):await k({isStreamLive:!0,isGameLive:!1}),[x,k]),N=(0,s.useCallback)(async()=>await k({isChatActive:!b}),[b,k]),_=(0,s.useMemo)(()=>!!a,[a]);return(0,l.jsx)(o.Z.Provider,{value:{streamId:d,isLoaded:_,isUpdating:c,isStreamLive:x,isGameLive:v,isChatActive:b,chatReactions:h,reactions:g,reactionsSet:f,reactionTypes:y,updateReactionSet:w,toggleIsGameLive:j,toggleIsStreamLive:S,toggleIsChatActive:N},children:t})}},8775:function(e,t,a){"use strict";var l=a(5271);t.Z=(0,l.createContext)({streamSubscribe:()=>null,isSubscribed:!1})},8919:function(e,t,a){"use strict";var l=a(2676),s=a(5271),o=a(8775),n=a(2036);t.Z=e=>{let{children:t}=e,[a,i]=(0,s.useState)(!1),r=(0,s.useCallback)(e=>{let{streamId:t,callback:a}=e;a&&n.V.channel("reactions:".concat(t)).on("postgres_changes",{event:"INSERT",schema:"public",table:"Reactions",filter:"streamId=eq.".concat(t)},e=>{a(e)}).subscribe(async e=>{i("SUBSCRIBED"===e)})},[i]);return(0,l.jsx)(o.Z.Provider,{value:{isSubscribed:a,streamSubscribe:r},children:t})}},4983:function(e,t,a){"use strict";var l=a(5271);t.Z=(0,l.createContext)({user:null,setUser:async e=>{},session:null,setSession:async e=>{},error:null,setError:async e=>{},timeout:null,setTimeout:async e=>{}})},1548:function(e,t,a){"use strict";var l=a(2676),s=a(5271),o=a(4983);t.Z=e=>{let{children:t}=e,[a,n]=(0,s.useState)(null),[i,r]=(0,s.useState)(),[c,u]=(0,s.useState)(),[d,p]=(0,s.use
1State)();return(0,l.jsx)(o.Z.Provider,{value:{user:a,setUser:n,session:i,setSession:r,error:c,setError:u,timeout:d,setTimeout:p},children:t})}},2036:function(e,t,a){"use strict";a.d(t,{O:function(){return s},V:function(){return l}});let l=(0,a(3491).eI)("https://ujovkqlizfepuqnehdak.supabase.co","sb_publishable_Y0kx8_S2Zw4z91-pgnoa7A_CgvP24Sf"),s=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,{data:a,error:s}=await l.functions.invoke("virtual-starlight",{headers:{"x-starlight-path":e},body:t});if(s)throw s;return a}},6211:function(e,t,a){"use strict";var l=a(5271);t.Z=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0;(0,l.useEffect)(()=>(e(),()=>{a&&a()}),t)}},706:function(e,t,a){"use strict";var l=a(5271),s=a(2036),o=a(4983);t.Z=()=>{let{user:e,setUser:t}=(0,l.useContext)(o.Z),a=(0,l.useCallback)(async(e,a,l)=>{try{let l=await (0,s.O)("user/register",e);t(l),a&&a()}catch(e){console.error(e),l&&l()}},[t]),n=(0,l.useCallback)(()=>{t(null)},[t]),i=(0,l.useMemo)(()=>(null==e?void 0:e.userId)?null==e?void 0:e.userId:null,[e]);return{userId:i,nickname:(0,l.useMemo)(()=>(null==e?void 0:e.nickname)?null==e?void 0:e.nickname:null,[e]),location:(0,l.useMemo)(()=>(null==e?void 0:e.location)?null==e?void 0:e.location:null,[e]),age:(0,l.useMemo)(()=>(null==e?void 0:e.age)?null==e?void 0:e.age:null,[e]),upsertUser:a,clearUser:n}}},1579:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return G}});var l=a(2676),s=a(5271),o=a(1518),n=a.n(o),i=a(3288),r=a(7310),c=a(7600),u=a(2187),d=a.n(u),p=a(706);function m(e){let{name:t,value:a,...s}=e;return(0,l.jsxs)("span",{className:"inline-block -mx-2 md:mx-0",children:[(0,l.jsx)("input",{type:"radio",className:"peer w-16 h-16 md:w-24 md:h-24 absolute pin-0 opacity-0",name:t,value:a,...s}),(0,l.jsx)("label",{htmlFor:t,className:"bg-purple-light peer-focus:ring-4 ring-grape-light peer-checked:bg-purple border-4 border-purple-light peer-checked:border-purple font-extrabold text-4xl md:text-5xl text-purple peer-checked:text-white flex items-center justify-center w-16 h-16 md:w-24 md:h-24 rounded-full",children:a})]})}var h=a(8133),g=a(5778),x=a(6763),v=a.n(x),b=a(2068),f=a(4785);let y=e=>{let t=(0,f.kY)("geocoding");return(0,s.useEffect)(()=>{if(!t)return;let a=new t.Geocoder;a&&a.geocode({placeId:e.placeId},function(t,a){"OK"==a?e.setZipCode(t[0].address_components.find(e=>"postal_code"===e.types[0]).short_name||void 0):window.alert("Geocode was not successful for the following reason: "+a)})},[t,e.placeId]),(0,l.jsx)(l.Fragment,{children:e.place_id&&(0,l.jsx)("input",{type:"hidden",id:"place_id",className:"hidden",value:e.placeId})})},k=e=>{let t=(0,f.kY)("places");return(0,s.useEffect)(()=>{if(!t)return;let{SearchNearbyRankPreference:a}=t,l={location:new google.maps.LatLng(parseFloat(e.location.lat),parseFloat(e.location.lng)),radius:5e3,type:"hospital"};new google.maps.places.PlacesService(document.createElement("div")).nearbySearch(l,t=>{if(!t.length){e.setNoResultsFound(!0);return}e.setSelectedLocation(t[0].name),e.setPlaceId(t[0].place_id)})},[t]),(0,l.jsx)(l.Fragment,{})};var w=a(2940),j=a(6417),S=a(3574),N=a(366),_=a(6308),C=a(874),E=a.n(C),T=a(4849),L=a(4125);let Z=e=>{let{text:t,direction:a="top",id:s,showTooltip:o,setShowTooltip:n,tooltipCoords:i}=e;return(0,l.jsx)(l.Fragment,{children:o&&(0,l.jsxs)("div",{id:s,"data-type":"tooltip",style:{top:i.y,left:i.x},className:"left-1/2 bg-white -mt-8 text-black text-left rounded-lg p-3 absolute z-10 transition-opacity shadow-xl duration-300 min-w-40 max-w-80 w-max ease-in-out  \n        ".concat("before:block before:absolute before:border-t-[12px] before:border-x-[12px] before:border-x-transparent before:border-t-white before:shadow-xl before:top-full before:left-1/2 before:-translate-x-1/2 before:-mt-1","\n        ").concat("top"===a?"translate-x-[-50%] translate-y-[-100%] mb-2":""),role:"tooltip",children:[(0,l.jsx)("div",{className:"text-right",children:(0,l.jsx)("button",{onClick:()=>{n(!1)},"aria-controls":s,"aria-label":"Close toggletip",children:(0,l.jsx)(T.Z,{className:"size-6 text-purple"})})}),(0,l.jsx)("div",{dangerouslySetInnerHTML:{__html:t}})]})})},I=e=>{let{id:t,title:a,showTooltip:o,setShowTooltip:n,setTooltipCoords:i}=e,r=e=>{"Escape"===e.key&&n(!1)},c=e=>{let t=e.target;"BUTTON"!==t.nodeName&&(t=t.closest("button")),e.cancelBubble=!0,e.preventDefault(),n(!o),i({x:e.clientX,y:e.clientY})};return(0,s.useEffect)(()=>(document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)})),(0,l.jsx)("span",{className:"inline-block relative",children:(0,l.jsxs)("span",{className:"text-nowrap",children:[a,"\xa0",(0,l.jsx)("button",{className:"inline relative",onClick:c,onTouchEnd:c,"aria-controls":t,"data-type":"tooltip-trigger",children:(0,l.jsx)(L.Z,{className:"size-6 text-purple"})})]})})},A=[{link:"https://planetstarlight.org.au/faqs",text:"FAQs",target:"_self"},{link:"https://planetstarlight.org.au/privacy-policy",text:"Privacy Policy",target:"_self"},{link:"https://planetstarlight.org.au/safety-policy",text:"Safety Policy",target:"_self"}];function F(){return(0,l.jsx)("footer",{className:"place-self-end w-full mx-auto bottom-0  pb-4 pr-4 bg-yellow p-0 pt-4 pl-4 row-span-1 row-start-3",children:(0,l.jsx)(j.Z,{children:(0,l.jsx)("ul",{role:"menu",className:"flex items-center justify-center flex-col md:flex-row gap-0",children:A.length>0&&A.map((e,t)=>(0,l.jsxs)("li",{className:"basis-full md:basis-auto  p-0 m-0",role:"none",children:[(0,l.jsx)(E(),{rel:"noreferrer noopener",role:"menuitem",href:e.link,target:e.target,className:"text-purple font-bold text-nowrap hover:underline hover:underline-purple",children:e.text}),t+1<A.length?(0,l.jsx)("span",{className:"hidden md:inline-block mx-4 text-purple",children:"|"}):""]},"liveFooter-".concat(t)))})})})}var B=a(6698),O=a.n(B);function U(){return(0,l.jsx)("header",{className:"absolute w-full max-w-[75rem] left-1/2 -translate-x-1/2 m-auto top-0 pt-4 pl-4",children:(0,l.jsx)(E(),{rel:"noreferrer noopener",href:"/",target:"_self",children:(0,l.jsx)(O(),{src:"/img/starlight-logo-colour.svg",alt:"The Starlight foundation logo",width:176,height:51})})})}var P=a(3233);let V=e=>e.replace(" ","").toLowerCase();function z(e){let{name:t,value:a,desc:s,...o}=e;return(0,l.jsxs)("li",{className:"mb-4",children:[(0,l.jsx)("input",{type:"radio",name:t,value:a,id:"".concat(V(t),"-").concat(V(a)),className:"opacity-0 absolute peer",...o}),(0,l.jsx)("label",{htmlFor:"".concat(V(t),"-").concat(V(a)),className:"inline-flex items-center justify-between w-full p-5 text-purple bg-white border-4 border-grape-light rounded-lg cursor-pointer peer-checked:border-purple peer-checked:text-purple peer-checked:bg-[#F1ECF6] hover:text-gray-600 hover:bg-gray-100",children:(0,l.jsxs)("div",{className:"flex gap-4 justify-start items-center",children:[(0,l.jsx)("div",{className:"text-2xl basis-auto font-semibold flex-shrink ",children:"".concat(a.charAt(0).toUpperCase()).concat(a.substring(1).toLowerCase())}),(0,l.jsx)("div",{className:"basis-auto flex-grow",children:s})]})})]})}let M=(0,S.kP)("1234567890ABCDEF",4),R=[{id:"name",title:"Tell Captain Starlight your nickname!",input:(0,l.jsx)("input",{type:"text",name:"name",className:"p-4 rounded w-full border border-purple-light focus:border-purple focus:ring-4",autoFocus:!0,placeholder:"Enter your nickname"}),tooltip:"Why are we asking this? Letting us know your name, helps Captain Starlight connect with your child. This information is not stored on our website. ",isSkippable:!0,isUsed:!0,skipValue:()=>"Cadet ".concat(M()),dl:{sub:{name:"form_name_submit",values:[{key:"content",val:"Chat To A Captain"}]},skip:{name:"form_name_skip",values:[{key:"content",val:"Chat To A Captain"}]}}},{id:"age",title:"Tell Captain Starlight how old you are!",input:(0,l.jsxs)("div",{className:"grid gap-8 grid-cols-4",children:[(0,l.jsx)(m,{name:"age",value:"3",autoFocus:!0}),(0,l.jsx)(m,{name:"age",value:"4"}),(0,l.jsx)(m,{name:"age",value:"5"}),(0,l.jsx)(m,{name:"age",value:"6"}),(0,l.jsx)(m,{name:"age",value:"7"}),(0,l.jsx)(m,{name:"age",value:"8"}),(0,l.jsx)(m,{name:"age",value:"9"}),(0,l.jsx)(m,{name:"age",value:"10"}),(0,l.jsx)(m,{name:"age",value:"11"}),(0,l.jsx)(m,{name:"age",value:"12+"})]}),tooltip:"Why are we asking this? We ask for a child’s age to ensure we are creating the best experience for your child.",isUsed:!0,isSkippable:!0,skipValue:()=>"???",dl:{sub:{name:"form_age_submit",values:[{key:"content",val:"Chat To A Captain"},{key:"audience_age",val:!0}]},skip:{name:"form_age_skip",values:[{key:"content",val:"Chat To A Captain"}]}}},{id:"admitted",title:"Are you in a hospital now?",input:(0,l.jsx)("fieldset",{children:(0,l.jsxs)("ul",{className:"w-full",children:[(0,l.jsx)(z,{name:"admitted",value:"yes",desc:"I am in a hospital. A ward, clinic or Starlight Express Room.",autoFocus:!0,required:!0}),(0,l.jsx)(z,{name:"admitted",value:"no",desc:"I am somewhere else"})]})}),tooltip:"Why are we asking this? Letting us know where you are allows us to continue to improve our programs, supporting kids in hospitals.",isUsed:!0,isSkippable:!1,skipValue:()=>
1"no",dl:{sub:{name:"form_hospital_yn",values:[{key:"content",val:"Chat To A Captain"},{key:"answer",val:!0}]}}},{id:"location",title:"Which hospital are you in?",input:(0,l.jsx)(e=>{let{name:t,...a}=e,[o,n]=(0,s.useState)([]),[i,r]=(0,s.useState)({lat:void 0,lng:void 0}),[c,u]=(0,s.useState)(!1),[d,p]=(0,s.useState)(!1),[m,h]=(0,s.useState)(""),[g,x]=(0,s.useState)(void 0),[w,j]=(0,s.useState)(void 0),S=()=>{r({lat:void 0,lng:void 0})};(0,s.useEffect)(()=>{"geolocation"in navigator&&c&&navigator.geolocation.getCurrentPosition(e=>{let{latitude:t,longitude:a}=e.coords;r({lat:t,lng:a})})},[c]);let N=(0,s.useMemo)(()=>v()(e=>{var t;let a=null==e?void 0:null===(t=e.target)||void 0===t?void 0:t.value;if(a.length<3){try{n([])}catch(e){}return}fetch("".concat("/api/hospitals","?search=").concat(a)).then(e=>e.json()).then(e=>{try{n(e)}catch(e){}})},500),[n]);return(0,l.jsxs)(f.un,{apiKey:"AIzaSyD4YbV7_2KRO5qveoOHKfFty7zApoqZDiY",children:[(0,l.jsxs)("div",{className:"flex flex-col content-stretch align-center",children:[(0,l.jsx)("input",{type:"text",name:t,list:"hospitals_".concat(t),...a,defaultValue:m,className:"peer text-xl font-bold  p-4 border border-purple-light focus:border-purple focus:border-4 focus:border-b-0 focus:ring-0",placeholder:"Search for a hospital",onSelect:e=>{let{target:a}=e;if(!a.value)return;let l=document.getElementById("hospitals_".concat(t)).options.namedItem(a.value);h(a.value),u(!1),S(),l&&j(l.dataset.pcode)},onKeyDown:N}),(0,l.jsxs)("button",{type:"button",disabled:d,onClick:()=>{u(!0)},className:"flex items-center bg-mint-lighter justify-start px-4 border-4 border-t-0 border-transparent transition-all opacity-0 peer-focus:opacity-100 h-0 peer-focus:h-fit peer-focus:min-h-12 peer-focus:border-purple peer-focus:disabled:min-h-0 disabled:overflow-hidden disabled:max-h-0 peer-focus:disabled:h-0 disabled:bg-gray-300 disabled:cursor-not-allowed",children:[d?"No results found, please search manually":"Find my hospital using current location"," ",(0,l.jsx)(b.Z,{className:"size-6 inline-block ml-4 color-purple"})]}),d?"No results found, please search manually":"",(0,l.jsx)("input",{type:"hidden",id:"place_postal_code",className:"hidden",defaultValue:w}),(0,l.jsx)("datalist",{id:"hospitals_".concat(t),children:o.map(e=>{let t=e.split("||");return(0,l.jsx)("option",{"data-pcode":t[1],id:t[0],value:t[0]},t[0])})})]}),i.lat&&(0,l.jsx)(k,{setSelectedLocation:h,setPlaceId:x,setNoResultsFound:p,location:i}),g&&(0,l.jsx)(y,{placeId:g,setZipCode:j})]})},{name:"location",className:"p-4 text-xl font-bold rounded w-full border border-purple-light focus:border-purple focus:ring-4",autoFocus:!0}),tooltip:"Why are we asking this? Letting us know where you are allows us to continue to improve our programs, supporting kids in hospitals.",isUsed:!0,isSkippable:!0,skipValue:()=>"Somewhere in space",isLastStep:!0,dl:{sub:{name:"form_hospital_location_submit",values:[{key:"content",val:"Chat To A Captain"},{key:"hospital_location",val:!0},{key:"hospital_postcode",val:!0}]},skip:{name:"form_hospital_location_skip",values:[{key:"content",val:"Chat To A Captain"}]}}}],D="fpVisitorCache";function G(){let{wizard:e,step:t}=(0,c.Z)({steps:R}),{upsertUser:a}=(0,p.Z)(),{isLoading:o,data:u}=(0,r.qG)({extendedResult:!0}
1),d=(0,i.useRouter)(),[m,x]=(0,s.useState)(),[v,b]=(0,s.useState)(!1),f=(0,s.useCallback)(e=>{let{nickname:t,location:l,age:s,updateUser:n}=e;b(!0);try{console.log("visitorData",u,o);let{visitorId:e,ip:i,ipLocation:r}=u||{visitorId:""},{latitude:c,longitude:p,postalCode:m}=r||{},h=g.AES.encrypt(JSON.stringify({nickname:t,location:l,age:s}),e).toString();localStorage.setItem(D,h),a({nickname:t,location:l,age:s,ipAddress:i,latitude:c,longitude:p,postalCode:m,visitorId:e,updateUser:n},()=>{d.push("/live/stream")})}catch(e){console.error(e),b(!1)}},[u,a,d,b]),y=(0,s.useCallback)(()=>{x(void 0)},[x]);(0,s.useEffect)(()=>{if(!o){var e;u&&(null==u?void 0:null===(e=u.confidence)||void 0===e?void 0:e.score)>.5?(e=>{try{let t=localStorage.getItem(D);if(t){let a=g.AES.decrypt(t,e).toString(g.enc.Utf8);if(a){let e=JSON.parse(a);e&&x(e)}}}catch(e){console.error(e)}})(u.visitorId):y()}},[o,u,y]),(0,s.useEffect)(()=>{},[]);let k=[{name:"the rocket launch",class:"bg-rocket-launch",img:"bg-rocket-launch"},{name:"waving",class:"bg-header-satellite",img:""}],w=o||m?0:e.stepNum/e.stepTotal*95,j=k[e.stepTotal-e.stepNum]?k[e.stepTotal-e.stepNum].class:"bg-entry";return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n(),{children:(0,l.jsx)("title",{children:_.px})}),(0,l.jsxs)("div",{className:"grid grid-rows-[75px_auto] place-items-start md:place-items-center min-h-screen bg-image ".concat(j," bg-no-repeat bg-fixed bg-center bg-cover ease-in-out-back duration-1000 transition-bg-pos motion-reduce:transition-none"),style:{"--bg-pos-x":"".concat(w,"%")},children:[(o||v)&&(0,l.jsx)("div",{children:(0,l.jsx)(N.Z,{size:"xl",color:"purple"})}),!o&&!m&&!v&&(0,l.jsx)(q,{wizard:e,step:t,submitUser:f}),!o&&m&&!v&&(0,l.jsx)(W,{cachedUser:m,submitUser:f,clearCachedUser:()=>{(0,h.B)("login",{category:"engagement",label:"change_user"}),y()}})]})]})}G.getLayout=e=>(0,l.jsx)(w.Z,{children:e});let W=e=>{let{cachedUser:t,submitUser:a,clearCachedUser:o}=e,n=(0,s.useCallback)(()=>{(0,h.B)("login",{category:"engagement",label:"return"}),(null==t?void 0:t.location)&&(0,h.B)("user_location",{label:t.location,starlight_location:t.location}),(null==t?void 0:t.age)&&(0,h.B)("user_age",{label:t.age,starlight_age:t.age}),(null==t?void 0:t.admitted)&&(0,h.B)("form_hospital_yn",{label:t.admitted,starlight_admitted:t.admitted}),a({...t,updateUser:!0})},[a,t]);return(0,l.jsxs)(j.Z,{className:"max-w-3xl ",children:[(0,l.jsx)("div",{className:"pb-6 flex items-center leading-none",children:(0,l.jsxs)(E(),{href:"/",className:"mt-8 text-base underline font-bold text-purple rounded-full focus:text-mint hover:text-mint hover:cursor-pointer",children:[(0,l.jsx)(P.Z,{className:"size-6 text-purple-500 inline-block mr-4"}),"Back to all the fun of Captain Starlight"]})}),(0,l.jsx)("h1",{className:"text-4xl font-extrabold text-purple",children:"Welcome back"}),(0,l.jsx)("p",{className:"font-extrabold text-lg mt-4 mb-8",children:"Is this you?"}),(0,l.jsxs)("button",{type:"button",onClick:n,className:"bg-yellow hover:bg-yellow-light w-full pl-6 pr-12 pt-6 pb-5 text-left rounded-lg shadow-lg bg-no-repeat bg-icon-chevron bg-right-4 bg-2",children:[(0,l.jsx)("div",{className:"font-extrabold text-4xl leading-tight",children:t.nickname}),(0,l.jsxs)("div",{className:"font-extrabold my-2",children:["Age ",t.age]}),(0,l.jsx)("div",{className:"font-extrabold",children:t.location})]}),(0,l.jsx)("button",{type:"button",className:"font-extrabold text-purple hover:text-mint underline mt-8",onClick:o,children:"Join as someone else"})]})},q=e=>{let{wizard:t,step:a,submitUser:o}=e,[n,i]=(0,s.useState)(void 0),[r,c]=(0,s.useState)(!1),[u,p]=(0,s.useState)({x:0,y:0}),[m,g]=(0,s.useState)(!1),x=e=>{let t=e.target;"A"===t.nodeName&&(0,h.B)("form_details_click",{content:e.target.innerText}),"BUTTON"!==t.nodeName&&(t=t.closest("button")||t),null===t.closest('[data-type="tooltip"]')&&"BUTTON"!==t.nodeName&&"tooltip-trigger"!==t.dataset.type&&c(!1)};(0,s.useEffect)(()=>(document.addEventListener("click",x),()=>{document.removeEventListener("click",x)}),[]);let v=(0,s.useCallback)(e=>{var a,l,s;if(e.preventDefault(),(null==e?void 0:null===(l=e.nativeEvent)||void 0===l?void 0:null===(a=l.submitter)||void 0===a?void 0:a.name)==="skip")t.responses.set(t.activeStep.id,t.activeStep.skipValue()),(0,h.B)("skip_demographics",{category:"engagement",label:t.activeStep.id}
1),(0,h.B)(t.activeStep.dl.skip.name,{content:t.activeStep.skipValue()});else{t.responsesFromForm(e.target);let a=null===(s=t.responses.get(t.activeStep.id)||"")||void 0===s?void 0:s.replace(/\s/g,"");""===a&&t.responses.set(t.activeStep.id,t.activeStep.skipValue());let l={};t.activeStep.dl.sub.values.forEach(e=>{if("hospital_postcode"===e.key){let t=document.getElementById("place_postal_code");l[e.key]=t?t.value:void 0}else l[e.key]=!0!==e.val?e.val:""!==a?a:t.activeStep.skipValue()}),(0,h.B)(t.activeStep.dl.sub.name,l),(0,h.B)("submit_demographics",{category:"engagement",label:t.activeStep.id})}if(t.activeStep.isLastStep||m){(0,h.B)("login",{category:"engagement",label:"new"});let e=t.responses.get("location");e||(e=t.nextStep.skipValue()),(0,h.B)("user_location",{label:e,starlight_location:e});let a=t.responses.get("age");(0,h.B)("user_age",{label:a,starlight_age:a}),o({nickname:t.responses.get("name"),location:e,age:a,updateUser:!1});return}t.next()},[t,o]);(0,s.useEffect)(()=>{let e=a.title.split(" "),t="".concat(e.splice(-1).toString());i(()=>({stem:e.join(" "),leaf:t}))},[a.title]);let b=()=>{c(!1),g(!1)};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(U,{}),(0,l.jsxs)("form",{onChange:e=>{let t=e.target;(null==t?void 0:t.id)==="admitted-no"?(g(!0),a.isLastStep=!0,R[R.length-1].isUsed=!1):(null==t?void 0:t.id)==="admitted-yes"&&(g(!1),a.isLastStep=!1,R[R.length-1].isUsed=!0)},onSubmit:v,className:"px-4 md:px-8 py-12 w-full max-w-[50rem] rounded-lg bg-white/50 row-start-2 row-span-1",children:[(0,l.jsx)("div",{className:"pb-6",children:(0,l.jsxs)(E(),{href:"/",onClick:()=>{b()},className:"mt-8 text-base underline font-bold text-purple rounded-full focus:text-mint hover:text-mint hover:cursor-pointer",children:[(0,l.jsx)(P.Z,{className:"size-6 text-purple-500 inline-block mr-4"}),"Back to all the fun of Captain Starlight"]})}),(0,l.jsx)("div",{className:"pb-12",children:[...t.steps()].map((e,a)=>(0,l.jsx)("button",{type:"button","aria-label":"Go to step ".concat(a+1),"aria-current":a===t.stepNum-1?"step":void 0,className:d()("h-3 w-3 mr-4 rounded-full border border-purple",{"bg-purple":a<=t.stepNum-1,"bg-white":a>t.stepNum-1},"hover:bg-grape-light"),onClick:()=>{b(),t.goToStepId(e.id)}},e.id))}),(0,l.jsxs)("h1",{className:"font-extrabold text-4xl text-purple inline",children:[!a.tooltip&&a.title,a.tooltip&&n&&(0,l.jsxs)(l.Fragment,{children:[n.stem,"\xa0",(0,l.jsx)("wbr",{}),(0,l.jsx)(I,{setTooltipCoords:p,showTooltip:r,setShowTooltip:c,title:n.leaf,id:"tooltip-".concat(a.id)})]})]}),a.tooltip&&(0,l.jsx)(Z,{tooltipCoords:u,showTooltip:r,setShowTooltip:c,text:a.tooltip,direction:"top",id:"tooltip-".concat(a.id)}),(null==a?void 0:a.label)&&(0,l.jsx)("p",{className:"font-bold text-lg",children:a.label}),(0,l.jsx)("div",{className:"mt-8 mb-10",children:a.input}),(0,l.jsx)("button",{type:"submit",onClick:()=>{b()},className:"pl-6 pr-12 py-2 text-base bg-icon-arrow bg-no-repeat bg-1 bg-right-5 bg-yellow font-bold text-purple rounded-full border-4 border-yellow focus:border-purple hover:border-purple",children:a.isLastStep||m?"Watch live stream!":"Next"}),a.isSkippable&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("br",{}),(0,l.jsx)("button",{type:"submit",name:"skip",onClick:()=>{b()},className:"mt-8 px-6 py-2 text-base underline font-bold text-purple border-4 border-transparent rounded-full focus:border-purple hover:border-purple",children:"Skip"})]})]},a.id),(0,l.jsx)(F,{})]})}},1054:function(){}},function(e){e.O(0,[395,698,491,310,135,888,774,179],function(){return e(e.s=6580)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.