@clickview/auth 0.60.1-dev.0 → 0.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -58,11 +58,11 @@ __p+='`),h}),s+=`';
58
58
  (`+I+": "+m+")",R.name="ChunkLoadError",R.type=I,R.request=m,E[1](R)}}),"chunk-"+c,c)}};var h=(c,_)=>{var E,S,[w,R,b]=_,I=0;if(w.some((m=>d[m]!==0))){for(E in R)u.o(R,E)&&(u.m[E]=R[E]);b&&b(u)}for(c&&c(_);I<w.length;I++)S=w[I],u.o(d,S)&&d[S]&&d[S][0](),d[S]=0},f=self.webpackChunk_clickview_braze_client=self.webpackChunk_clickview_braze_client||[];f.forEach(h.bind(null,0)),f.push=h.bind(null,f.push.bind(f))})();var p={};return(()=>{u.r(p),u.d(p,{BrazeClient:()=>Hf,ClassHookMarketingFormEvent:()=>hu,CountryCode:()=>cu,CustomUserAttributes:()=>en,DefaultUserAttributes:()=>oi,EventUserAttributes:()=>bn,MarketingFormEvent:()=>Wi,MarketingUserEvent:()=>du,PageEvent:()=>fu,ProductEvent:()=>vu,ProductFormEvent:()=>Ki,StreamableFormEvent:()=>wi,StreamableMarketingFormEvent:()=>Yi,getInstance:()=>xo});var d=u(5825),h=u(1087),f=u(5333),c=u(6524);function _(){(0,f.e)(void 0,"iam",".ab-pause-scrolling,body.ab-pause-scrolling,html.ab-pause-scrolling{overflow:hidden;touch-action:none}.ab-iam-root.v3{position:fixed;top:0;right:0;bottom:0;left:0;pointer-events:none;z-index:9011;-webkit-tap-highlight-color:transparent}.ab-iam-root.v3:focus{outline:0}.ab-iam-root.v3.ab-effect-fullscreen,.ab-iam-root.v3.ab-effect-html,.ab-iam-root.v3.ab-effect-modal{opacity:0}.ab-iam-root.v3.ab-effect-fullscreen.ab-show,.ab-iam-root.v3.ab-effect-html.ab-show,.ab-iam-root.v3.ab-effect-modal.ab-show{opacity:1}.ab-iam-root.v3.ab-effect-fullscreen.ab-show.ab-animate-in,.ab-iam-root.v3.ab-effect-html.ab-show.ab-animate-in,.ab-iam-root.v3.ab-effect-modal.ab-show.ab-animate-in{-webkit-transition:opacity .5s;-moz-transition:opacity .5s;-o-transition:opacity .5s;transition:opacity .5s}.ab-iam-root.v3.ab-effect-fullscreen.ab-hide,.ab-iam-root.v3.ab-effect-html.ab-hide,.ab-iam-root.v3.ab-effect-modal.ab-hide{opacity:0}.ab-iam-root.v3.ab-effect-fullscreen.ab-hide.ab-animate-out,.ab-iam-root.v3.ab-effect-html.ab-hide.ab-animate-out,.ab-iam-root.v3.ab-effect-modal.ab-hide.ab-animate-out{-webkit-transition:opacity .5s;-moz-transition:opacity .5s;-o-transition:opacity .5s;transition:opacity .5s}.ab-iam-root.v3.ab-effect-slide .ab-in-app-message{-webkit-transform:translateX(535px);-moz-transform:translateX(535px);-ms-transform:translateX(535px);transform:translateX(535px)}.ab-iam-root.v3.ab-effect-slide.ab-show .ab-in-app-message{-webkit-transform:translateX(0);-moz-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}.ab-iam-root.v3.ab-effect-slide.ab-show.ab-animate-in .ab-in-app-message{-webkit-transition:transform .5s ease-in-out;-moz-transition:transform .5s ease-in-out;-o-transition:transform .5s ease-in-out;transition:transform .5s ease-in-out}.ab-iam-root.v3.ab-effect-slide.ab-hide .ab-in-app-message{-webkit-transform:translateX(535px);-moz-transform:translateX(535px);-ms-transform:translateX(535px);transform:translateX(535px)}.ab-iam-root.v3.ab-effect-slide.ab-hide .ab-in-app-message.ab-swiped-left{-webkit-transform:translateX(-535px);-moz-transform:translateX(-535px);-ms-transform:translateX(-535px);transform:translateX(-535px)}.ab-iam-root.v3.ab-effect-slide.ab-hide .ab-in-app-message.ab-swiped-up{-webkit-transform:translateY(-535px);-moz-transform:translateY(-535px);-ms-transform:translateY(-535px);transform:translateY(-535px)}.ab-iam-root.v3.ab-effect-slide.ab-hide .ab-in-app-message.ab-swiped-down{-webkit-transform:translateY(535px);-moz-transform:translateY(535px);-ms-transform:translateY(535px);transform:translateY(535px)}.ab-iam-root.v3.ab-effect-slide.ab-hide.ab-animate-out .ab-in-app-message{-webkit-transition:transform .5s ease-in-out;-moz-transition:transform .5s ease-in-out;-o-transition:transform .5s ease-in-out;transition:transform .5s ease-in-out}.ab-iam-root.v3 .ab-ios-scroll-wrapper{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto;pointer-events:all;touch-action:auto;-webkit-overflow-scrolling:touch}.ab-iam-root.v3 .ab-in-app-message{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:fixed;text-align:center;-webkit-box-shadow:0 0 4px rgba(0,0,0,.3);-moz-box-shadow:0 0 4px rgba(0,0,0,.3);box-shadow:0 0 4px rgba(0,0,0,.3);line-height:normal;letter-spacing:normal;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;z-index:9011;max-width:100%;overflow:hidden;display:inline-block;pointer-events:all;color:#333;color-scheme:normal}.ab-iam-root.v3 .ab-in-app-message.ab-no-shadow{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.ab-iam-root.v3 .ab-in-app-message :focus,.ab-iam-root.v3 .ab-in-app-message:focus{outline:0}.ab-iam-root.v3 .ab-in-app-message.ab-clickable{cursor:pointer}.ab-iam-root.v3 .ab-in-app-message.ab-background{background-color:#fff}.ab-iam-root.v3 .ab-in-app-message .ab-close-button{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;background-color:transparent;background-size:15px;border:none;width:15px;min-width:15px;height:15px;cursor:pointer;display:block;font-size:15px;line-height:0;padding-top:15px;padding-right:15px;padding-left:15px;padding-bottom:15px;position:absolute;right:0;top:0;z-index:9021}.ab-iam-root.v3 .ab-in-app-message .ab-close-button svg{-webkit-transition:.2s ease;-moz-transition:.2s ease;-o-transition:.2s ease;transition:.2s ease;fill:#9b9b9b;height:auto;width:100%}.ab-iam-root.v3 .ab-in-app-message .ab-close-button svg.ab-chevron{display:none}.ab-iam-root.v3 .ab-in-app-message .ab-close-button:active{background-color:transparent}.ab-iam-root.v3 .ab-in-app-message .ab-close-button:focus{background-color:transparent}.ab-iam-root.v3 .ab-in-app-message .ab-close-button:hover{background-color:transparent}.ab-iam-root.v3 .ab-in-app-message .ab-close-button:hover svg{fill-opacity:.8}.ab-iam-root.v3 .ab-in-app-message .ab-message-text{float:none;line-height:1.5;margin:20px 25px;max-width:100%;overflow:hidden;overflow-y:auto;vertical-align:text-bottom;word-wrap:break-word;white-space:pre-wrap;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif}.ab-iam-root.v3 .ab-in-app-message .ab-message-text.start-aligned{text-align:start}.ab-iam-root.v3 .ab-in-app-message .ab-message-text.end-aligned{text-align:end}.ab-iam-root.v3 .ab-in-app-message .ab-message-text.center-aligned{text-align:center}.ab-iam-root.v3 .ab-in-app-message .ab-message-text::-webkit-scrollbar{-webkit-appearance:none;width:14px}.ab-iam-root.v3 .ab-in-app-message .ab-message-text::-webkit-scrollbar-thumb{-webkit-appearance:none;border:4px solid transparent;background-clip:padding-box;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px;background-color:rgba(0,0,0,.2)}.ab-iam-root.v3 .ab-in-app-message .ab-message-text::-webkit-scrollbar-button{width:0;height:0;display:none}.ab-iam-root.v3 .ab-in-app-message .ab-message-text::-webkit-scrollbar-corner{background-color:transparent}.ab-iam-root.v3 .ab-in-app-message .ab-message-header{float:none;letter-spacing:0;margin:0;font-weight:700;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;display:block;font-size:20px;margin-bottom:10px;line-height:1.3}.ab-iam-root.v3 .ab-in-app-message .ab-message-header.start-aligned{text-align:start}.ab-iam-root.v3 .ab-in-app-message .ab-message-header.end-aligned{text-align:end}.ab-iam-root.v3 .ab-in-app-message .ab-message-header.center-aligned{text-align:center}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen,.ab-iam-root.v3 .ab-in-app-message.ab-modal,.ab-iam-root.v3 .ab-in-app-message.ab-slideup{-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px}.ab-iam-root.v3 .ab-in-app-message.ab-slideup{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;cursor:pointer;overflow:hidden;word-wrap:break-word;text-overflow:ellipsis;font-size:14px;font-weight:700;margin:20px;margin-top:calc(constant(safe-area-inset-top,0) + 20px);margin-right:calc(constant(safe-area-inset-right,0) + 20px);margin-bottom:calc(constant(safe-area-inset-bottom,0) + 20px);margin-left:calc(constant(safe-area-inset-left,0) + 20px);margin-top:calc(env(safe-area-inset-top,0) + 20px);margin-right:calc(env(safe-area-inset-right,0) + 20px);margin-bottom:calc(env(safe-area-inset-bottom,0) + 20px);margin-left:calc(env(safe-area-inset-left,0) + 20px);max-height:150px;padding:10px;right:0;background-color:#efefef}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone{max-height:66px;margin:10px;margin-top:calc(constant(safe-area-inset-top,0) + 10px);margin-right:calc(constant(safe-area-inset-right,0) + 10px);margin-bottom:calc(constant(safe-area-inset-bottom,0) + 10px);margin-left:calc(constant(safe-area-inset-left,0) + 10px);margin-top:calc(env(safe-area-inset-top,0) + 10px);margin-right:calc(env(safe-area-inset-right,0) + 10px);margin-bottom:calc(env(safe-area-inset-bottom,0) + 10px);margin-left:calc(env(safe-area-inset-left,0) + 10px);max-width:90%;max-width:calc(100% - 40px);min-width:90%;min-width:calc(100% - 40px)}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone .ab-close-button{display:none}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone .ab-close-button svg:not(.ab-chevron){display:none}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone.ab-clickable .ab-close-button{display:block;height:20px;padding:0 20px 0 18px;pointer-events:none;top:50%;-webkit-transform:translateY(-50%);-moz-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);width:12px}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone.ab-clickable .ab-close-button svg.ab-chevron{display:inline}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone.ab-clickable .ab-message-text{border-right-width:40px}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone .ab-message-text{max-width:100%;border-right-width:10px}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone .ab-message-text span{max-height:66px}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone .ab-message-text.ab-with-icon,.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone .ab-message-text.ab-with-image{max-width:80%;max-width:calc(100% - 50px - 5px - 10px - 25px)}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone .ab-image-area{width:50px;height:50px}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone .ab-image-area img{max-width:100%;max-height:100%;width:auto;height:auto}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.ab-clickable:active .ab-message-text,.ab-iam-root.v3 .ab-in-app-message.ab-slideup.ab-clickable:focus .ab-message-text,.ab-iam-root.v3 .ab-in-app-message.ab-slideup.ab-clickable:hover .ab-message-text{opacity:.8}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.ab-clickable:active .ab-close-button svg.ab-chevron,.ab-iam-root.v3 .ab-in-app-message.ab-slideup.ab-clickable:focus .ab-close-button svg.ab-chevron,.ab-iam-root.v3 .ab-in-app-message.ab-slideup.ab-clickable:hover .ab-close-button svg.ab-chevron{fill-opacity:.8}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-message-text{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:table-cell;border-color:transparent;border-style:solid;border-width:5px 25px 5px 10px;max-width:430px;vertical-align:middle;margin:0}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-message-text span{display:block;max-height:150px;overflow:auto}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-message-text.ab-with-icon,.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-message-text.ab-with-image{max-width:365px;border-top:0;border-bottom:0}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-close-button{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;background-color:transparent;background-size:15px;border:none;width:15px;min-width:15px;height:15px;cursor:pointer;display:block;font-size:15px;line-height:0;padding-top:15px;padding-right:15px;padding-left:15px;padding-bottom:15px;position:absolute;right:0;top:0;z-index:9021}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-close-button svg{-webkit-transition:.2s ease;-moz-transition:.2s ease;-o-transition:.2s ease;transition:.2s ease;fill:#9b9b9b;height:auto;width:100%}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-close-button svg.ab-chevron{display:none}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-close-button:active{background-color:transparent}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-close-button:focus{background-color:transparent}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-close-button:hover{background-color:transparent}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-close-button:hover svg{fill-opacity:.8}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-image-area{float:none;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:table-cell;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;vertical-align:top;width:60px;margin:0}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-image-area.ab-icon-area{width:auto}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-image-area img{float:none;width:100%}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen,.ab-iam-root.v3 .ab-in-app-message.ab-modal{font-size:14px}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-image-area{float:none;position:relative;display:block;overflow:hidden}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen .ab-image-area .ab-center-cropped-img,.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-image-area .ab-center-cropped-img{background-size:cover;background-repeat:no-repeat;background-position:50% 50%;position:absolute;top:0;right:0;bottom:0;left:0}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen .ab-icon,.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-icon{margin-top:20px}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.graphic,.ab-iam-root.v3 .ab-in-app-message.ab-modal.graphic{padding:0}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.graphic .ab-message-text,.ab-iam-root.v3 .ab-in-app-message.ab-modal.graphic .ab-message-text{display:none}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.graphic .ab-message-buttons,.ab-iam-root.v3 .ab-in-app-message.ab-modal.graphic .ab-message-buttons{bottom:0;left:0}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.graphic .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-modal.graphic .ab-image-area{float:none;height:auto;margin:0}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.graphic .ab-image-area img,.ab-iam-root.v3 .ab-in-app-message.ab-modal.graphic .ab-image-area img{display:block;top:0;-webkit-transform:none;-moz-transform:none;-ms-transform:none;transform:none}.ab-iam-root.v3 .ab-in-app-message.ab-modal{padding-top:20px;width:450px;max-width:450px;max-height:720px}.ab-iam-root.v3 .ab-in-app-message.ab-modal.simulate-phone{max-width:91%;max-width:calc(100% - 30px)}.ab-iam-root.v3 .ab-in-app-message.ab-modal.simulate-phone.graphic .ab-image-area img{max-width:91vw;max-width:calc(100vw - 30px)}.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-message-text{max-height:660px}.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-message-text.ab-with-image{max-height:524.82758621px}.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-message-text.ab-with-icon{max-height:610px}.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-message-text.ab-with-buttons{margin-bottom:93px;max-height:587px}.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-message-text.ab-with-buttons.ab-with-image{max-height:451.82758621px}.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-message-text.ab-with-buttons.ab-with-icon{max-height:537px}.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-image-area{margin-top:-20px;max-height:155.17241379px}.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-image-area img{max-width:100%;max-height:155.17241379px}.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-image-area.ab-icon-area{height:auto}.ab-iam-root.v3 .ab-in-app-message.ab-modal.graphic{width:auto;overflow:hidden}.ab-iam-root.v3 .ab-in-app-message.ab-modal.graphic .ab-image-area{display:inline}.ab-iam-root.v3 .ab-in-app-message.ab-modal.graphic .ab-image-area img{width:auto;max-height:720px;max-width:450px}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen{width:450px;max-height:720px}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape{width:720px;max-height:450px}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape .ab-image-area{height:225px}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape.graphic .ab-image-area{height:450px}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape .ab-message-text{max-height:112px}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen .ab-message-text{max-height:247px}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen .ab-message-text.ab-with-buttons{margin-bottom:93px}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen .ab-image-area{height:360px}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.graphic .ab-image-area{height:720px}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone{-webkit-transition:top none;-moz-transition:top none;-o-transition:top none;transition:top none;top:0;right:0;bottom:0;left:0;height:100%;width:100%;max-height:none;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-transform:none;-moz-transform:none;-ms-transform:none;transform:none;height:auto!important}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone.landscape .ab-close-button{margin-right:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-right:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0));margin-left:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-left:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0))}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone.landscape .ab-image-area{height:50%}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone .ab-message-text{max-height:48%;max-height:calc(50% - 20px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone .ab-message-text.ab-with-buttons{margin-bottom:20px;max-height:30%;max-height:calc(50% - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone.landscape .ab-message-text.ab-with-buttons{max-height:20%;max-height:calc(50% - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone:not(.graphic){padding-bottom:0;padding-bottom:constant(safe-area-inset-bottom,0);padding-bottom:env(safe-area-inset-bottom,0)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone:not(.graphic) .ab-message-buttons{padding-top:0;position:relative}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone.graphic{display:block}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone.graphic .ab-image-area{height:100%}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone.graphic .ab-message-button{margin-bottom:0;margin-bottom:constant(safe-area-inset-bottom,0);margin-bottom:env(safe-area-inset-bottom,0)}.ab-iam-root.v3 .ab-in-app-message.ab-html-message{background-color:transparent;border:none;height:100%;overflow:auto;position:relative;touch-action:auto;width:100%}.ab-iam-root.v3 .ab-in-app-message .ab-message-buttons{position:absolute;bottom:0;width:100%;padding:17px 25px 30px 25px;z-index:inherit;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ab-iam-root.v3 .ab-in-app-message .ab-message-button{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;cursor:pointer;display:inline-block;font-size:14px;font-weight:700;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;height:44px;line-height:normal;letter-spacing:normal;margin:0;max-width:100%;min-width:80px;padding:0 12px;position:relative;text-transform:none;width:48%;width:calc(50% - 5px);border:1px solid #1b78cf;-webkit-transition:.2s ease;-moz-transition:.2s ease;-o-transition:.2s ease;transition:.2s ease;overflow:hidden;word-wrap:break-word;text-overflow:ellipsis;word-wrap:normal;white-space:nowrap}.ab-iam-root.v3 .ab-in-app-message .ab-message-button:first-of-type{float:left;background-color:#fff;color:#1b78cf}.ab-iam-root.v3 .ab-in-app-message .ab-message-button:last-of-type{float:right;background-color:#1b78cf;color:#fff}.ab-iam-root.v3 .ab-in-app-message .ab-message-button:first-of-type:last-of-type{float:none;width:auto}.ab-iam-root.v3 .ab-in-app-message .ab-message-button:after{content:'';position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent}.ab-iam-root.v3 .ab-in-app-message .ab-message-button:after{-webkit-transition:.2s ease;-moz-transition:.2s ease;-o-transition:.2s ease;transition:.2s ease}.ab-iam-root.v3 .ab-in-app-message .ab-message-button:hover{opacity:.8}.ab-iam-root.v3 .ab-in-app-message .ab-message-button:active:after{content:'';position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.08)}.ab-iam-root.v3 .ab-in-app-message .ab-message-button:focus:after{content:'';position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.15)}.ab-iam-root.v3 .ab-in-app-message .ab-message-button a{color:inherit;text-decoration:inherit}.ab-iam-root.v3 .ab-in-app-message img{float:none;display:inline-block}.ab-iam-root.v3 .ab-in-app-message .ab-icon{float:none;display:inline-block;padding:10px;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px}.ab-iam-root.v3 .ab-in-app-message .ab-icon .fa{float:none;font-size:30px;width:30px}.ab-iam-root.v3 .ab-start-hidden{visibility:hidden}.ab-iam-root.v3 .ab-centered{margin:auto;position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);-moz-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.ab-iam-root.v3{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.ab-iam-root.v3 .ab-page-blocker{position:fixed;top:0;left:0;width:100%;height:100%;z-index:9001;pointer-events:all;background-color:rgba(51,51,51,.75)}@media (max-width:600px){.ab-iam-root.v3 .ab-in-app-message.ab-slideup{max-height:66px;margin:10px;margin-top:calc(constant(safe-area-inset-top,0) + 10px);margin-right:calc(constant(safe-area-inset-right,0) + 10px);margin-bottom:calc(constant(safe-area-inset-bottom,0) + 10px);margin-left:calc(constant(safe-area-inset-left,0) + 10px);margin-top:calc(env(safe-area-inset-top,0) + 10px);margin-right:calc(env(safe-area-inset-right,0) + 10px);margin-bottom:calc(env(safe-area-inset-bottom,0) + 10px);margin-left:calc(env(safe-area-inset-left,0) + 10px);max-width:90%;max-width:calc(100% - 40px);min-width:90%;min-width:calc(100% - 40px)}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-close-button{display:none}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-close-button svg:not(.ab-chevron){display:none}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.ab-clickable .ab-close-button{display:block;height:20px;padding:0 20px 0 18px;pointer-events:none;top:50%;-webkit-transform:translateY(-50%);-moz-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);width:12px}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.ab-clickable .ab-close-button svg.ab-chevron{display:inline}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.ab-clickable .ab-message-text{border-right-width:40px}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-message-text{max-width:100%;border-right-width:10px}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-message-text span{max-height:66px}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-message-text.ab-with-icon,.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-message-text.ab-with-image{max-width:80%;max-width:calc(100% - 50px - 5px - 10px - 25px)}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-image-area{width:50px;height:50px}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-image-area img{max-width:100%;max-height:100%;width:auto;height:auto}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape{-webkit-transition:top none;-moz-transition:top none;-o-transition:top none;transition:top none;top:0;right:0;bottom:0;left:0;height:100%;width:100%;max-height:none;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-transform:none;-moz-transform:none;-ms-transform:none;transform:none;height:auto!important}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape .ab-close-button,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape.landscape .ab-close-button{margin-right:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-right:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0));margin-left:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-left:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0))}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen .ab-image-area,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape .ab-image-area,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape.landscape .ab-image-area{height:50%}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen .ab-message-text,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape .ab-message-text{max-height:48%;max-height:calc(50% - 20px - 20px)}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen .ab-message-text.ab-with-buttons,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape .ab-message-text.ab-with-buttons{margin-bottom:20px;max-height:30%;max-height:calc(50% - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape .ab-message-text.ab-with-buttons,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape.landscape .ab-message-text.ab-with-buttons{max-height:20%;max-height:calc(50% - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape:not(.graphic),.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen:not(.graphic){padding-bottom:0;padding-bottom:constant(safe-area-inset-bottom,0);padding-bottom:env(safe-area-inset-bottom,0)}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape:not(.graphic) .ab-message-buttons,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen:not(.graphic) .ab-message-buttons{padding-top:0;position:relative}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.graphic,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape.graphic{display:block}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.graphic .ab-image-area,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape.graphic .ab-image-area{height:100%}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.graphic .ab-message-button,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape.graphic .ab-message-button{margin-bottom:0;margin-bottom:constant(safe-area-inset-bottom,0);margin-bottom:env(safe-area-inset-bottom,0)}}@media (max-width:480px){.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop){max-width:91%;max-width:calc(100% - 30px)}.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop).graphic .ab-image-area img{max-width:91vw;max-width:calc(100vw - 30px)}}@media (max-height:750px){.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop){max-height:91%;max-height:calc(100% - 30px)}.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop).graphic .ab-image-area img{max-height:91vh;max-height:calc(100vh - 30px)}.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop) .ab-message-text{max-height:65vh;max-height:calc(100vh - 30px - 60px)}.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop) .ab-message-text.ab-with-image{max-height:45vh;max-height:calc(100vh - 30px - 155.17241379310346px - 40px)}.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop) .ab-message-text.ab-with-icon{max-height:45vh;max-height:calc(100vh - 30px - 70px - 40px)}.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop) .ab-message-text.ab-with-buttons{max-height:50vh;max-height:calc(100vh - 30px - 93px - 40px)}.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop) .ab-message-text.ab-with-buttons.ab-with-image{max-height:30vh;max-height:calc(100vh - 30px - 155.17241379310346px - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop) .ab-message-text.ab-with-buttons.ab-with-icon{max-height:30vh;max-height:calc(100vh - 30px - 70px - 93px - 20px)}}@media (min-width:601px){.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen .ab-image-area img{max-height:100%;max-width:100%}}@media (max-height:750px) and (min-width:601px){.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop){-webkit-transition:top none;-moz-transition:top none;-o-transition:top none;transition:top none;top:0;right:0;bottom:0;left:0;height:100%;width:100%;max-height:none;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-transform:none;-moz-transform:none;-ms-transform:none;transform:none;height:auto!important;width:450px}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop).landscape .ab-close-button{margin-right:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-right:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0));margin-left:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-left:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0))}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop) .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop).landscape .ab-image-area{height:50%}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop) .ab-message-text{max-height:48%;max-height:calc(50% - 20px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop) .ab-message-text.ab-with-buttons{margin-bottom:20px;max-height:30%;max-height:calc(50% - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop).landscape .ab-message-text.ab-with-buttons{max-height:20%;max-height:calc(50% - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop):not(.graphic){padding-bottom:0;padding-bottom:constant(safe-area-inset-bottom,0);padding-bottom:env(safe-area-inset-bottom,0)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop):not(.graphic) .ab-message-buttons{padding-top:0;position:relative}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop).graphic{display:block}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop).graphic .ab-image-area{height:100%}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop).graphic .ab-message-button{margin-bottom:0;margin-bottom:constant(safe-area-inset-bottom,0);margin-bottom:env(safe-area-inset-bottom,0)}}@media (max-height:480px){.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop){-webkit-transition:top none;-moz-transition:top none;-o-transition:top none;transition:top none;top:0;right:0;bottom:0;left:0;height:100%;width:100%;max-height:none;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-transform:none;-moz-transform:none;-ms-transform:none;transform:none;height:auto!important}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).landscape .ab-close-button{margin-right:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-right:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0));margin-left:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-left:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0))}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop) .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).landscape .ab-image-area{height:50%}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop) .ab-message-text{max-height:48%;max-height:calc(50% - 20px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop) .ab-message-text.ab-with-buttons{margin-bottom:20px;max-height:30%;max-height:calc(50% - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).landscape .ab-message-text.ab-with-buttons{max-height:20%;max-height:calc(50% - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop):not(.graphic){padding-bottom:0;padding-bottom:constant(safe-area-inset-bottom,0);padding-bottom:env(safe-area-inset-bottom,0)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop):not(.graphic) .ab-message-buttons{padding-top:0;position:relative}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).graphic{display:block}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).graphic .ab-image-area{height:100%}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).graphic .ab-message-button{margin-bottom:0;margin-bottom:constant(safe-area-inset-bottom,0);margin-bottom:env(safe-area-inset-bottom,0)}}@media (max-width:750px){.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop){-webkit-transition:top none;-moz-transition:top none;-o-transition:top none;transition:top none;top:0;right:0;bottom:0;left:0;height:100%;width:100%;max-height:none;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-transform:none;-moz-transform:none;-ms-transform:none;transform:none;height:auto!important}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).landscape .ab-close-button{margin-right:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-right:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0));margin-left:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-left:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0))}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop) .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).landscape .ab-image-area{height:50%}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop) .ab-message-text{max-height:48%;max-height:calc(50% - 20px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop) .ab-message-text.ab-with-buttons{margin-bottom:20px;max-height:30%;max-height:calc(50% - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).landscape .ab-message-text.ab-with-buttons{max-height:20%;max-height:calc(50% - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop):not(.graphic){padding-bottom:0;padding-bottom:constant(safe-area-inset-bottom,0);padding-bottom:env(safe-area-inset-bottom,0)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop):not(.graphic) .ab-message-buttons{padding-top:0;position:relative}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).graphic{display:block}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).graphic .ab-image-area{height:100%}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).graphic .ab-message-button{margin-bottom:0;margin-bottom:constant(safe-area-inset-bottom,0);margin-bottom:env(safe-area-inset-bottom,0)}}"),(0,c.N)()}var E=u(8376),S=u(1090),w=u(1792),R=u(6616),b=u(4410),I=u(3811),m=u(1507),v=u(5242);function y(z,Z){return z==null?"":(z=parseInt(z.toString()),isNaN(z)?"":(Z&&!isNaN(parseFloat(Z.toString()))||(Z=1),"rgba("+[(16711680&(z>>>=0))>>>16,(65280&z)>>>8,255&z,((4278190080&z)>>>24)/255*Z].join(",")+")"))}var g=u(7671),x=u(335),T=u(2730);function O(z){if(!d.ZP.X())return!1;if(!(z instanceof w.Z||z instanceof E.Z))return x.Z.error(g.De),!1;const Z=z instanceof E.Z?T.G.mo:T.G.Oi;return h.Z.m().q(z,Z).L}var j=u(4365),k=u(9342);function N(z){if(!d.ZP.X())return!1;if(!(z instanceof w.Z))return x.Z.error(g.De),!1;const Z=h.Z.m().q(z,T.G.Ei);if(Z){z.Ur()||O(z);for(let X=0;X<Z.ge.length;X++)k.n.rr().fe(j.Z.Qr,[z.triggerId],Z.ge[X])}return Z.L}var L=u(420),U=u(3695);function B(z,Z,X){if(!d.ZP.X())return!1;if(!(z instanceof S.Z))return x.Z.error("inAppMessage argument to logInAppMessageHtmlClick must be an HtmlMessage object."),!1;let te=T.G.Ei;Z!=null&&(te=T.G.Gi);const J=h.Z.m().q(z,te,Z,X);if(J.L)for(let ne=0;ne<J.ge.length;ne++)k.n.rr().fe(j.Z.Qr,[z.triggerId,Z],J.ge[ne]);return J.L}var H=u(6243),G=u(2893),$=u(5806),M=u(1148),D=u(5319),F=u(7048),V=u(4072);function ae(z,Z){var X;if(!d.ZP.X())return!1;if(!(z instanceof V.Z))return x.Z.error("button must be an InAppMessageButton object"),!1;if(!(Z instanceof w.Z))return x.Z.error(g.De),!1;const te=h.Z.m().Hi(z,Z);if(te.L)for(let J=0;J<te.ge.length;J++)k.n.rr().fe(j.Z.Qr,[Z.triggerId,(X=z.id)===null||X===void 0?void 0:X.toString()],te.ge[J]);return te.L}var oe=u(7429);const _e=z=>{const Z=z.querySelectorAll(".ab-close-button, .ab-message-text, .ab-message-button");let X;for(let te=0;te<Z.length;te++)X=Z[te],X.tabIndex=0;if(Z.length>0){const te=Z[0],J=Z[Z.length-1];z.addEventListener("keydown",(ne=>{const ce=document.activeElement;ne.keyCode===oe.m.lo&&(ne.shiftKey||ce!==J&&ce!==z?!ne.shiftKey||ce!==te&&ce!==z||(ne.preventDefault(),J.focus()):(ne.preventDefault(),te.focus()))}))}},he=(z,Z)=>{Z.setAttribute("role","dialog"),Z.setAttribute("aria-modal","true"),Z.setAttribute("aria-label","Modal Message"),z&&Z.setAttribute("aria-labelledby",z)},ye=(z,Z,X,te)=>{if(z.buttons&&z.buttons.length>0){const J=document.createElement("div");J.className="ab-message-buttons",X.appendChild(J);const ne=X.getElementsByClassName("ab-message-text")[0];ne!=null&&(ne.className+=" ab-with-buttons");const ce=ve=>Ie=>(z.Ae(X,(()=>{ae(ve,z),ve.clickAction===w.Z.ClickAction.URI?(0,L.S)(ve.uri||"",te||z.openTarget===w.Z.OpenTarget.BLANK,Ie):ve.clickAction===w.Z.ClickAction.NEWS_FEED&&Z()})),Ie.stopPropagation(),!1);for(let ve=0;ve<z.buttons.length;ve++){const Ie=z.buttons[ve],ke=document.createElement("button");ke.className="ab-message-button",ke.setAttribute("type","button"),(0,m.lj)(ke,"touchstart");let sr=Ie.text;Ie.text===""&&(sr=" "),ke.appendChild(document.createTextNode(sr)),z.Ce()||(ke.style.backgroundColor=y(Ie.backgroundColor),ke.style.color=y(Ie.textColor),ke.style.borderColor=y(Ie.borderColor)),ke.onclick=ce(Ie),J.appendChild(ke)}}};var ge=u(7070);function Re(z,Z,X){if(!d.ZP.X())return;if(_(),z==null)return!1;if(z instanceof E.Z)return x.Z.info("User received control for a multivariate test, logging to Braze servers."),O(z),!0;if(!(z instanceof w.Z)||z.constructor===w.Z)return!1;z.Nh();const te=z instanceof S.Z;if(te&&!z.trusted&&!d.ZP.tr())return x.Z.error('HTML in-app messages are disabled. Use the "allowUserSuppliedJavascript" option for braze.initialize to enable these messages.'),!1;if(Z==null&&(Z=document.body),z.ze()&&Z.querySelectorAll(".ab-modal-interactions").length>0)return x.Z.info(`Cannot show in-app message ${z.message} because another message is being shown.`),!1;if(D.SD.fo()){const ve=D.SD.co();if(ve===D.eh.PORTRAIT&&z.orientation===w.Z.Orientation.LANDSCAPE||ve===D.eh.LANDSCAPE&&z.orientation===w.Z.Orientation.PORTRAIT){const Ie=ve===D.eh.PORTRAIT?"portrait":"landscape",ke=z.orientation===w.Z.Orientation.PORTRAIT?"portrait":"landscape";return x.Z.info(`Not showing ${ke} in-app message ${z.message} because the screen is currently ${Ie}`),!1}}if(!d.ZP.tr()){let ve=!1;if(z.buttons&&z.buttons.length>0){const Ie=z.buttons;for(let ke=0;ke<Ie.length;ke++)if(Ie[ke].clickAction===w.Z.ClickAction.URI){const sr=Ie[ke].uri;ve=(0,M.o)(sr)}}else z.clickAction===w.Z.ClickAction.URI&&(ve=(0,M.o)(z.uri));if(ve)return x.Z.error('Javascript click actions are disabled. Use the "allowUserSuppliedJavascript" option for braze.initialize to enable these actions.'),!1}const J=document.createElement("div");if(J.className="ab-iam-root v3",J.className+=(function(ve){let Ie="";return ve.animateIn&&(Ie+=" ab-animate-in"),ve.animateOut&&(Ie+=" ab-animate-out"),ve instanceof b.Z?Ie+=" ab-effect-fullscreen":ve instanceof S.Z?Ie+=" ab-effect-html":ve instanceof I.Z?Ie+=" ab-effect-modal":ve instanceof R.Z&&(Ie+=" ab-effect-slide"),Ie})(z),J.setAttribute("role","complementary"),z.xe()&&(J.id=z.htmlId),d.ZP.nn(d.JY.jo)&&(J.style.zIndex=(d.ZP.nn(d.JY.jo)+1).toString()),Z.appendChild(J),z.Ce()){const ve=document.createElement("style");ve.innerHTML=z.css,ve.id=z.ve(),d.ZP.nn(d.JY.bo)!=null&&ve.setAttribute("nonce",d.ZP.nn(d.JY.bo)),document.getElementsByTagName("head")[0].appendChild(ve)}const ne=z instanceof R.Z,ce=(function(ve,Ie,ke,sr,jr,wr,Lr,Ar=document.body){if(ve.ke=document.activeElement,ve instanceof S.Z)return(function(Le,ot,rn,Ft,ci,Bt){const ft=document.createElement("iframe");ft.setAttribute("title","Modal Message"),ci&&(ft.style.zIndex=(ci+1).toString());const Ln=st=>{const gt=st.getAttribute("href"),_n=st.onclick;return dn=>{if(_n!=null&&typeof _n=="function"&&_n.bind(st)(dn)===!1)return;let tt=(0,M.L)(gt).abButtonId;if(tt!=null&&tt!==""||(tt=st.getAttribute("id")||void 0),gt!=null&&gt!==""&&gt.indexOf("#")!==0){const tn=(st.getAttribute("target")||"").toLowerCase().replace("_","")==="blank",Ye=Ft||Le.openTarget===w.Z.OpenTarget.BLANK||tn,Fe=()=>{B(Le,tt,gt),D.SD.openUri(gt,Ye,dn)};Ye?Fe():Le.Ae(ft,Fe)}else B(Le,tt,gt||void 0);return dn.stopPropagation(),!1}},Yr=(st,gt,_n)=>{const dn=`([\\w]+)\\s*=\\s*document.createElement\\(['"]${_n}['"]\\)`,tt=st.match(new RegExp(dn));if(tt){const tn=`${tt[1]}.setAttribute("nonce", "${gt}")`;return`${st.slice(0,tt.index+tt[0].length)};${tn};${st.slice(tt.index+tt[0].length)}`}return null};if(ft.onload=()=>{let st=null;if(Bt!=null){st=document.createElement("html"),st.innerHTML=Le.message||"";const Pr=st.getElementsByTagName("style");for(let Ct=0;Ct<Pr.length;Ct++)Pr[Ct].setAttribute("nonce",Bt);const Jr=st.getElementsByTagName("script");for(let Ct=0;Ct<Jr.length;Ct++){Jr[Ct].setAttribute("nonce",Bt),Jr[Ct].innerHTML=Jr[Ct].innerHTML.replace(/<style>/g,`<style nonce='${Bt}'>`);const ql=Yr(Jr[Ct].innerHTML,Bt,"script");ql&&(Jr[Ct].innerHTML=ql);const Dl=Yr(Jr[Ct].innerHTML,Bt,"style");Dl&&(Jr[Ct].innerHTML=Dl)}}const gt=ft.contentWindow;gt.focus();const _n=gt.document.querySelector("html");_n&&(_n.innerHTML=st?st.innerHTML:Le.message||"",(0,F.E)(_n));const dn=gt.document.getElementsByTagName("head")[0];if(dn!=null){if(Le.Ce()){const Jr=document.createElement("style");Jr.innerHTML=Le.css||"",Jr.id=Le.ve()||"",Bt!=null&&Jr.setAttribute("nonce",Bt),dn.appendChild(Jr)}const Pr=gt.document.createElement("base");Pr!=null&&(Pr.setAttribute("target","_parent"),dn.appendChild(Pr))}const tt=gt.document.getElementsByTagName("title");tt&&tt.length>0&&ft.setAttribute("title",tt[0].textContent||"");const tn={closeMessage:function(){Le.Ae(ft)},logClick:function(){B(Le,...arguments)},display:{},web:{}},Ye=function(){return function(){const Pr=arguments;Promise.resolve().then(u.bind(u,2261)).then((Jr=>{d.ZP.so()?Jr.requestPushPermission(...Array.prototype.slice.call(Pr)):x.Z.error(g.Go)}))}},Fe={requestImmediateDataFlush:function(){const Pr=arguments;Promise.resolve().then(u.bind(u,4650)).then((({requestImmediateDataFlush:Jr})=>{d.ZP.so()?Jr(...Array.prototype.slice.call(Pr)):x.Z.error(g.Go)}))},logCustomEvent:function(){const Pr=arguments;Promise.resolve().then(u.bind(u,1454)).then((({logCustomEvent:Jr})=>{d.ZP.so()?Jr(...Array.prototype.slice.call(Pr)):x.Z.error(g.Go)}))},logPurchase:function(){const Pr=arguments;u.e(364).then(u.bind(u,1364)).then((({logPurchase:Jr})=>{d.ZP.so()?Jr(...Array.prototype.slice.call(Pr)):x.Z.error(g.Go)}))},unregisterPush:function(){const Pr=arguments;Promise.resolve().then(u.bind(u,7824)).then((({unregisterPush:Jr})=>{d.ZP.so()?Jr(...Array.prototype.slice.call(Pr)):x.Z.error(g.Go)}))},requestPushPermission:Ye(),changeUser:function(){const Pr=arguments;Promise.resolve().then(u.bind(u,4790)).then((({changeUser:Jr})=>{d.ZP.so()?Jr(...Array.prototype.slice.call(Pr)):x.Z.error(g.Go)}))}},Ue=function(Pr){return function(){Fe[Pr](...Array.prototype.slice.call(arguments))}};for(const Pr of(0,G.XP)(Fe))tn[Pr]=Ue(Pr);const _r=["setFirstName","setLastName","setEmail","setGender","setDateOfBirth","setCountry","setHomeCity","setEmailNotificationSubscriptionType","setLanguage","addAlias","setPushNotificationSubscriptionType","setPhoneNumber","setCustomUserAttribute","addToCustomAttributeArray","removeFromCustomAttributeArray","incrementCustomUserAttribute","setCustomLocationAttribute","addToSubscriptionGroup","removeFromSubscriptionGroup"],Cr=function(Pr){return function(){const Jr=(0,H.P)();Jr&&Jr[Pr](...Array.prototype.slice.call(arguments))}},nt={};for(let Pr=0;Pr<_r.length;Pr++)nt[_r[Pr]]=Cr(_r[Pr]);tn.getUser=function(){return nt};const Ot={showFeed:ot},Sn=function(Pr){return function(){const Jr=arguments;Le.Ae(ft,(function(){Ot[Pr](...Array.prototype.slice.call(Jr))}))}},wn=tn.display;for(const Pr of(0,G.XP)(Ot))wn[Pr]=Sn(Pr);const pa={registerAppboyPushMessages:Ye()},Ii=function(Pr){return function(){pa[Pr](...Array.prototype.slice.call(arguments))}},Ga=tn.web;for(const Pr of(0,G.XP)(pa))Ga[Pr]=Ii(Pr);if(gt.appboyBridge=tn,gt.brazeBridge=tn,Le.we!==w.Z.qe.$e){const Pr=gt.document.getElementsByTagName("a");for(let Ct=0;Ct<Pr.length;Ct++)Pr[Ct].onclick=Ln(Pr[Ct]);const Jr=gt.document.getElementsByTagName("button");for(let Ct=0;Ct<Jr.length;Ct++)Jr[Ct].onclick=Ln(Jr[Ct])}const mu=gt.document.body;if(mu!=null){Le.xe()&&(mu.id=Le.htmlId||"");const Pr=document.createElement("hidden");Pr.onclick=tn.closeMessage,Pr.className="ab-programmatic-close-button",mu.appendChild(Pr)}gt.dispatchEvent(new CustomEvent("ab.BridgeReady")),ft.className.indexOf("ab-start-hidden")!==-1&&(ft.className=ft.className.replace("ab-start-hidden",""),rn(ft)),document.activeElement!==ft&&ft.focus()},ft.className="ab-in-app-message ab-start-hidden ab-html-message ab-modal-interactions",U.Z.OS===$.T.io){const st=document.createElement("div");return st.className="ab-ios-scroll-wrapper",st.appendChild(ft),Le.Me=st,st}return Le.Me=ft,ft})(ve,Ie,ke,jr,wr,Lr);const br=(function(Le,ot,rn,Ft,ci,Bt,ft=document.body){let Ln=null;const Yr=document.createElement("div");var st;Yr.className="ab-in-app-message ab-start-hidden ab-background",Bt&&(Yr.style.zIndex=(Bt+1).toString()),Le.ze()&&(Yr.className+=" ab-modal-interactions",Yr.setAttribute("tabindex","-1")),Le.Ce()||(Yr.style.color=y(Le.textColor),Yr.style.backgroundColor=y(Le.backgroundColor),(st=Le.backgroundColor)!=null&&(st=parseInt(st.toString()),!isNaN(st)&&(4278190080&st)>>>24==0)&&(Yr.className+=" ab-no-shadow"));const gt=()=>{Yr.className.indexOf("ab-start-hidden")!==-1&&(Yr.className=Yr.className.replace("ab-start-hidden",""),document.querySelectorAll(".ab-iam-img-loading").length>0?Ft(`Cannot show in-app message ${Le.message} because another message is being shown.`,w.Z.Be.Le):rn(Yr))},_n=(Ue=!0)=>{let _r=document.querySelectorAll(".ab-iam-root");_r&&_r.length!==0||(_r=ft.querySelectorAll(".ab-iam-root")),_r&&_r.length>0&&(_r[0].classList.remove("ab-iam-img-loading"),Ln&&(clearTimeout(Ln),Ln=null),Ue?gt():x.Z.error(`Cannot show in-app message ${Le.message} because the image failed to load.`))};Le.imageStyle===w.Z.ImageStyle.GRAPHIC&&(Yr.className+=" graphic"),Le.orientation===w.Z.Orientation.LANDSCAPE&&(Yr.className+=" landscape"),Le.buttons!=null&&Le.buttons.length===0&&(Le.clickAction!==w.Z.ClickAction.NONE&&(Yr.className+=" ab-clickable"),Yr.onclick=Ue=>(Le.Ae(Yr,(()=>{N(Le),Le.clickAction===w.Z.ClickAction.URI?(0,L.S)(Le.uri||"",ci||Le.openTarget===w.Z.OpenTarget.BLANK,Ue):Le.clickAction===w.Z.ClickAction.NEWS_FEED&&ot()})),Ue.stopPropagation(),!1));const dn=(0,v.B)("Close Message",Le.Ce()?void 0:y(Le.closeButtonColor),(()=>{Le.Ae(Yr)}));Yr.appendChild(dn),Bt&&(dn.style.zIndex=(Bt+2).toString());const tt=document.createElement("div");tt.className="ab-message-text";const tn=(Le.messageAlignment||Le.De).toLowerCase();tt.className+=" "+tn+"-aligned";let Ye=!1;const Fe=document.createElement("div");if(Fe.className="ab-image-area",Le.imageUrl){if(Le.cropType===w.Z.CropType.CENTER_CROP){const Ue=document.createElement("span");Ue.className="ab-center-cropped-img",Ue.style.backgroundImage="url("+Le.imageUrl+")",Ue.setAttribute("role","img"),Ue.setAttribute("aria-label","Modal Image"),Le.Ge(Ue),Fe.appendChild(Ue)}else{const Ue=document.createElement("img");if(Ue.setAttribute("src",Le.imageUrl),Le.Ge(Ue),document.querySelectorAll(".ab-iam-img-loading").length===0){Ye=!0;const _r=document.querySelectorAll(".ab-iam-root");_r&&_r.length>0&&_r[0].classList.add("ab-iam-img-loading"),Ln=window.setTimeout((()=>{_n(!1)}),6e4),Ue.onload=()=>{_n()},Ue.onerror=()=>{_n(!1)}}Fe.appendChild(Ue)}Yr.appendChild(Fe),tt.className+=" ab-with-image"}else if(Le.icon){Fe.className+=" ab-icon-area";const Ue=document.createElement("span");Ue.className="ab-icon",Le.Ce()||(Ue.style.backgroundColor=y(Le.iconBackgroundColor),Ue.style.color=y(Le.iconColor));const _r=document.createElement("i");_r.className="fa",_r.appendChild(document.createTextNode(Le.icon)),_r.setAttribute("aria-hidden","true"),Ue.appendChild(_r),Fe.appendChild(Ue),Yr.appendChild(Fe),tt.className+=" ab-with-icon"}if((0,m.lj)(tt,"touchstart"),Le.header&&Le.header.length>0){const Ue=document.createElement("h1");Ue.className="ab-message-header",Le.He=ge.Z.W(),Ue.id=Le.He;const _r=(Le.headerAlignment||w.Z.TextAlignment.CENTER).toLowerCase();Ue.className+=" "+_r+"-aligned",Le.Ce()||(Ue.style.color=y(Le.headerTextColor)),Ue.appendChild(document.createTextNode(Le.header)),tt.appendChild(Ue)}return tt.appendChild(Le.Je()),Yr.appendChild(tt),Ye||gt(),Le.Me=Yr,Yr})(ve,Ie,ke,sr,jr,wr,Ar);if(ve instanceof b.Z||ve instanceof I.Z){const Le=ve instanceof b.Z?"ab-fullscreen":"ab-modal";br.className+=` ${Le} ab-centered`,ye(ve,Ie,br,jr),_e(br),he(ve.He,br)}else if(ve instanceof R.Z){br.className+=" ab-slideup";const Le=br.getElementsByClassName("ab-close-button")[0];if(Le!=null){const Ft=(0,m.MK)("0 0 11.38 19.44","M11.38 9.72l-9.33 9.72L0 17.3l7.27-7.58L0 2.14 2.05 0l9.33 9.72z",ve.Ce()?void 0:y(ve.closeButtonColor));Ft.setAttribute("class","ab-chevron"),Le.appendChild(Ft)}let ot,rn;(0,m.FZ)(br,m.mQ.U,(Ft=>{br.className+=" ab-swiped-left",Le!=null&&Le.onclick!=null&&Le.onclick(Ft)})),(0,m.FZ)(br,m.mQ.V,(Ft=>{br.className+=" ab-swiped-right",Le!=null&&Le.onclick!=null&&Le.onclick(Ft)})),ve.slideFrom===w.Z.SlideFrom.TOP?(ot=m.mQ.Re,rn=" ab-swiped-up"):(ot=m.mQ.Se,rn=" ab-swiped-down"),(0,m.FZ)(br,ot,(Ft=>{br.className+=rn,Le!=null&&Le.onclick!=null&&Le.onclick(Ft)}))}return br})(z,(()=>{u.e(864).then(u.bind(u,4864)).then((ve=>{d.ZP.so()?ve.showFeed():x.Z.error(g.Go)}))}),(ve=>{if(z.ze()&&z.do()){const Ie=document.createElement("div");if(Ie.className="ab-page-blocker",z.Ce()||(Ie.style.backgroundColor=y(z.frameColor)),d.ZP.nn(d.JY.jo)&&(Ie.style.zIndex=d.ZP.nn(d.JY.jo).toString()),J.appendChild(Ie),!d.ZP.nn(d.JY.Lh)){const ke=new Date().valueOf();Ie.onclick=sr=>{new Date().valueOf()-ke>w.Z.fh&&(z.Ae(ve),sr.stopPropagation())}}J.appendChild(ve),ve.focus(),z.Oh(J)}else if(ne){const Ie=document.querySelectorAll(".ab-slideup");let ke=null;for(let sr=Ie.length-1;sr>=0;sr--)if(Ie[sr]!==ve){ke=Ie[sr];break}if(z.slideFrom===w.Z.SlideFrom.TOP){let sr=0;ke!=null&&(sr=ke.offsetTop+ke.offsetHeight),ve.style.top=Math.max(sr,0)+"px"}else{let sr=0;ke!=null&&(sr=(window.innerHeight||document.documentElement.clientHeight)-ke.offsetTop),ve.style.bottom=Math.max(sr,0)+"px"}}else if(te&&!d.ZP.nn(d.JY.Lh)){const Ie=z;(0,F.f)(ve)&&ve.contentWindow&&ve.contentWindow.addEventListener("keydown",(function(ke){ke.keyCode===oe.m.mh&&Ie.closeMessage()}))}O(z),z.dismissType===w.Z.DismissType.AUTO_DISMISS&&setTimeout((()=>{J.contains(ve)&&z.Ae(ve)}),z.duration),typeof X=="function"&&X()}),(ve=>{x.Z.info(ve)}),d.ZP.nn(d.JY.ho),d.ZP.nn(d.JY.jo),d.ZP.nn(d.JY.bo),Z);return(te||ne)&&(J.appendChild(ce),z.Oh(J)),!0}function We(z){if(d.ZP.X())return typeof z!="function"?null:h.Z.m()._i((function(Z){return z(Z[0]),Z.slice(1)}))}var He=u(5522),nr=u(1454),ar=u(2261),xr=u(7824),or=u(4790),lr=u(4650),Ve=u(1843),Ge=u(158),W=u(67),Y=u(1066),Q=u(1280);function re(z,Z){if(d.ZP.X())return Oe.rr().xs(z,Z)}class pe extends W.Z{constructor(Z,X){super(Z,X)}getUnviewedCardCount(){return super.getUnreadCardCount()}logCardImpressions(Z){(0,Y.p)(Z,!0)}logCardClick(Z){return(0,Q.d)(Z,!0)}sr(){re()}dr(){return!0}}pe.ur=6e4;var le=u(7750),Ee=u(5899),fe=u(5966),Pe=u(4663),ur=u(9179),cr=u(6870),de=u(6504);class Ae extends Ge.Z{constructor(Z,X,te,J,ne){super(),this.wt=Z,this.u=X,this.yt=te,this.Ft=J,this.qt=ne,this.wt=Z,this.u=X,this.yt=te,this.Ft=J,this.qt=ne,this.Jt=new Pe.Z,d.ZP.$t(this.Jt),this.Bt=0,this.Ht=0,this.cards=[],this.Kt();const ce=He.Z.Yt.Qt;new He.Z(ce,x.Z).Zt(ce.ss.ts,(ve=>{this.es(ve)})),this.hs=null,this.rs=null,this.ns=null,this.os=null,this.ls=null,this.us=10,this.cs=0}fs(){return this.hs}ds(Z){this.hs=Z}ps(){return this.rs}vs(Z){this.rs=Z}Kt(){if(!this.u)return;const Z=this.u.j(fe.I.C.ws)||[],X=[];for(let te=0;te<Z.length;te++){const J=(0,Ee.rN)(Z[te]);J!=null&&X.push(J)}this.cards=this.Cs(this.bs(X,!1)),this.Bt=this.u.j(fe.I.C.gs)||this.Bt,this.Ht=this.u.j(fe.I.C.ys)||this.Ht}js(Z,X=!1,te=0,J=0){let ne;if(X){ne=[];for(const ce of this.cards)ce.test&&ne.push(ce)}else ne=this.cards.slice();for(let ce=0;ce<Z.length;ce++){const ve=Z[ce];let Ie=null;for(let ke=0;ke<this.cards.length;ke++)if(ve.id===this.cards[ke].id){Ie=this.cards[ke];break}if(X){const ke=(0,Ee.xA)(ve);Ie!=null&&Ie.viewed&&ke&&(ke.viewed=!0),ke!=null&&ne.push(ke)}else if(Ie==null){const ke=(0,Ee.xA)(ve);ke!=null&&ne.push(ke)}else if(!Ie.Ct(ve)){for(let ke=0;ke<ne.length;ke++)if(ve.id===ne[ke].id){ne.splice(ke,1);break}}}this.cards=this.Cs(this.bs(ne,X)),this.Rs(),this.Bt=te,this.Ht=J,this.u&&(this.u.k(fe.I.C.gs,this.Bt),this.u.k(fe.I.C.ys,this.Ht))}Ns(Z){if(this.Ts()&&Z!=null&&Z.cards){this.u&&this.u.k(fe.I.C.Ss,d.ZP.Ds());const X=Z.full_sync;X||this.Kt(),this.js(Z.cards,X,Z.last_full_sync_at,Z.last_card_updated_at),this.Jt.Dt(this.Us(!0))}}ks(Z){this.u&&this.u.k(fe.I.C.As,Z)}Fs(Z,X,te){const J=()=>{this.xs(X,te,!0)},ne=Z?(0,Ve.D)(Z):null;let ce;if(this.zs(),!ne||!ne["retry-after"])return void this.ks(0);const ve=ne["retry-after"];if(isNaN(ve)&&!isNaN(Date.parse(ve)))ce=Date.parse(ve)-new Date().getTime(),ce<0&&J();else{if(isNaN(parseFloat(ve.toString())))return ur.Z.q(T.G.qs,{e:"Received unexpected value for retry-after header in /sync response"+": "+ve}),void this.ks(0);ce=1e3*parseFloat(ve.toString())}this.ns=window.setTimeout((()=>{J()}),ce);let Ie=0;this.u&&(Ie=this.u.j(fe.I.C.As)),(Ie==null||isNaN(parseInt(Ie.toString())))&&(Ie=0),this.ks(parseInt(Ie.toString())+1)}es(Z){var X;if(!this.Ts())return;this.Kt();const te=this.cards.slice();let J=null;J=(X=this.wt)===null||X===void 0?void 0:X.getUserId();for(let ne=0;ne<Z.length;ne++)if(J===Z[ne].userId||J==null&&Z[ne].userId==null){const ce=Z[ne].card;let ve=null;for(let Ie=0;Ie<this.cards.length;Ie++)if(ce.id===this.cards[Ie].id){ve=this.cards[Ie];break}if(ve==null){const Ie=(0,Ee.xA)(ce);Ie!=null&&te.push(Ie)}else if(!ve.Ct(ce)){for(let Ie=0;Ie<te.length;Ie++)if(ce.id===te[Ie].id){te.splice(Ie,1);break}}}this.cards=this.Cs(this.bs(te,!1)),this.Rs(),this.Jt.Dt(this.Us(!0))}bs(Z,X){let te={},J={},ne={};this.u&&(te=this.u.j(fe.I.C.v)||{},J=this.u.j(fe.I.C.H)||{},ne=this.u.j(fe.I.C.A)||{});const ce={},ve={},Ie={};for(let ke=0;ke<Z.length;ke++){const sr=Z[ke].id;sr&&(te[sr]&&(Z[ke].clicked=!0,ce[sr]=!0),J[sr]&&(Z[ke].viewed=!0,ve[sr]=!0),ne[sr]&&(Z[ke].dismissed=!0,Ie[sr]=!0))}return X&&this.u&&(this.u.k(fe.I.C.v,ce),this.u.k(fe.I.C.H,ve),this.u.k(fe.I.C.A,Ie)),Z}Cs(Z){const X=[],te=new Date;let J={};this.u&&(J=this.u.j(fe.I.C.A)||{});let ne=!1;for(let ce=0;ce<Z.length;ce++){const ve=Z[ce].url;if(!this.Ft&&ve&&(0,M.o)(ve)){x.Z.error(`Card with url ${ve} will not be displayed because Javascript URLs are disabled. Use the "allowUserSuppliedJavascript" option for braze.initialize to enable this card.`);continue}const Ie=Z[ce].expiresAt;let ke=!0;if(Ie!=null&&(ke=Ie>=te),ke=ke&&!Z[ce].dismissed,ke)X.push(Z[ce]);else{const sr=Z[ce].id;sr&&(J[sr]=!0),ne=!0}}return ne&&this.u&&this.u.k(fe.I.C.A,J),X}Rs(){var Z;const X=[];for(let te=0;te<this.cards.length;te++)X.push(this.cards[te].Y());(Z=this.u)===null||Z===void 0||Z.k(fe.I.C.ws,X)}zs(){this.ns&&(clearTimeout(this.ns),this.ns=null)}Es(){this.os!=null&&(clearTimeout(this.os),this.os=null)}Ls(Z=1e3*this.us,X,te){this.Es(),this.os=window.setTimeout((()=>{this.xs(X,te,!0)}),Z),this.ls=Z}xs(Z,X,te=!1,J=!0){var ne;const ce=this.qt,ve=this.u;if(!ce||!ve)return void(typeof X=="function"&&X());if(!te&&(this.zs(),this.ks(0)),!this.Ts())return void((ne=this.yt)===null||ne===void 0||ne.Is((()=>{this.xs(Z,X)})));J&&this.Es();const Ie=ce.Js({},!0);ve.j(fe.I.C.Ss)!==d.ZP.Ds()&&this.Ms(),Ie.last_full_sync_at=this.Bt,Ie.last_card_updated_at=this.Ht;const ke=ce.$s(Ie,cr.Z.Ps.Bs,te);let sr=!1;ce.Xs(Ie,((jr=-1)=>{if(this.u){const wr=new Date().valueOf();cr.Z._s(this.u,cr.Z.Ps.Bs,wr)}jr!==-1&&ke.push(["X-Braze-Req-Tokens-Remaining",jr.toString()]),Ve.Z.Gs({url:`${ce.Hs()}/content_cards/sync`,data:Ie,headers:ke,L:(wr,Lr)=>{if(!ce.Ks(Ie,wr,ke))return sr=!0,void(typeof X=="function"&&X());ce.Os(),this.Fs(Lr,Z,X),this.Ns(wr),sr=!1,cr.Z.Qs(this.u,cr.Z.Ps.Bs,1),typeof Z=="function"&&Z()},error:wr=>{ce.Vs(wr,"retrieving content cards"),sr=!0,typeof X=="function"&&X()},Ws:()=>{if(sr&&J&&!this.os&&this.cs+1<g.Tt){cr.Z.Ys(this.u,cr.Z.Ps.Bs);let wr=this.ls;(wr==null||wr<1e3*this.us)&&(wr=1e3*this.us),this.Ls(Math.min(3e5,(0,de.R)(1e3*this.us,3*wr)),Z,X),this.cs=this.cs+1}}})}),cr.Z.Ps.Bs,X)}Us(Z){Z||this.Kt();const X=this.Cs(this.cards);X.sort(((J,ne)=>J.pinned&&!ne.pinned?-1:ne.pinned&&!J.pinned?1:J.updated&&ne.updated&&J.updated>ne.updated?-1:J.updated&&ne.updated&&ne.updated>J.updated?1:0));let te=Math.max(this.Ht||0,this.Bt||0);return te===0&&(te=void 0),this.u&&this.u.j(fe.I.C.ys)===this.Ht&&te===void 0&&(te=this.Ht),new pe(X,(0,le.X2)(te))}Zs(Z){return this.Jt.It(Z)}Ms(){this.Bt=0,this.Ht=0,this.u&&(this.u.ti(fe.I.C.gs),this.u.ti(fe.I.C.ys))}changeUser(Z){Z||(this.cards=[],this.Jt.Dt(new pe(this.cards.slice(),null)),this.u&&(this.u.ti(fe.I.C.ws),this.u.ti(fe.I.C.v),this.u.ti(fe.I.C.H),this.u.ti(fe.I.C.A))),this.Ms()}clearData(Z){this.Bt=0,this.Ht=0,this.cards=[],this.Jt.Dt(new pe(this.cards.slice(),null)),Z&&this.u&&(this.u.ti(fe.I.C.ws),this.u.ti(fe.I.C.v),this.u.ti(fe.I.C.H),this.u.ti(fe.I.C.A),this.u.ti(fe.I.C.gs),this.u.ti(fe.I.C.ys))}Ts(){return!(!this.yt||!this.yt.si()&&(this.yt.ii()!==0&&this.ei(),1))}ei(){this.Jt.Dt(new pe([],new Date)),this.u&&this.u.ti(fe.I.C.ws)}}const Ne={t:!1,provider:null,rr:()=>(Ne.o(),Ne.provider||(Ne.provider=new Ae(d.ZP.er(),d.ZP.l(),d.ZP.ir(),d.ZP.tr(),d.ZP.nr()),d.ZP.ar(Ne.provider)),Ne.provider),o:()=>{Ne.t||(d.ZP.g(Ne),Ne.t=!0)},destroy:()=>{Ne.provider=null,Ne.t=!1}},Oe=Ne;function De(z){if(!d.ZP.X())return;const Z=Oe.rr(),X=Z.Zs(z);if(!Z.ps()){const te=d.ZP.cr();if(te){const J=te.mr((()=>{Z.xs()}));J&&Z.vs(J)}}return X}var Te=u(1311),vr=u(5608),$r=u(6959);function Me(z,Z){if(!d.ZP.X())return;(0,$r.B)();let X=!1;z==null&&(z=document.body,X=!0);const te=d.ZP.nn(d.JY.tn)||d.ZP.nn(d.JY.en)||!1,J=Oe.rr().Us(!1);typeof Z=="function"&&(0,Te.Of)(J,Z(J.cards.slice()),J.lastUpdated,null,te);const ne=(0,Te.Yz)(J,te,X),ce=Oe.rr(),ve=ce.fs();(J.lastUpdated==null||new Date().valueOf()-J.lastUpdated.valueOf()>pe.ur)&&(ve==null||new Date().valueOf()-ve>pe.ur)&&(x.Z.info(`Cached content cards were older than max TTL of ${pe.ur} ms, requesting an update from the server.`),(0,Te.cV)(J,ne),ce.ds(new Date().valueOf()));const Ie=new Date().valueOf(),ke=De((function(wr){const Lr=ne.querySelectorAll(".ab-refresh-button")[0];if(Lr!=null){let br=500,Le=br-=new Date().valueOf()-Ie;const ot=ne.getAttribute(Te.cP);ot&&(Le=parseInt(ot),isNaN(Le)||(br-=new Date().valueOf()-Le)),setTimeout((function(){Lr.className=Lr.className.replace(/fa-spin/g,"")}),Math.max(br,0))}let Ar=wr.cards;typeof Z=="function"&&(Ar=Z(Ar.slice())),(0,Te.Of)(J,Ar,wr.lastUpdated,ne,te)}));(0,Te.GB)(ke,ne);const sr=function(wr){const Lr=wr.querySelectorAll(".ab-feed");let Ar=null;for(let br=0;br<Lr.length;br++)Lr[br].parentNode===wr&&(Ar=Lr[br]);Ar!=null?((0,Te.tQ)(Ar),Ar.parentNode!=null&&Ar.parentNode.replaceChild(ne,Ar)):wr.appendChild(ne),setTimeout((function(){ne.className=ne.className.replace("ab-hide","ab-show")}),0),X&&ne.focus(),(0,Te.cz)(J,ne),(0,vr.CG)(J.cards,wr)};var jr;z!=null?sr(z):window.onload=(jr=window.onload,function(){typeof jr=="function"&&jr(new Event("oldLoad")),sr(document.body)})}var rr=u(2080);function Xe(z,Z){(Z==null||Z>z.length)&&(Z=z.length);for(var X=0,te=Array(Z);X<Z;X++)te[X]=z[X];return te}var Qe={get screenWidth(){return window.screen.width},get screenHeight(){return window.screen.height},get queryString(){return window.location.search},get queryParams(){var z,Z=Qe.queryString,X=new URLSearchParams(Z),te={},J=(function(ve,Ie){var ke=typeof Symbol<"u"&&ve[Symbol.iterator]||ve["@@iterator"];if(!ke){if(Array.isArray(ve)||(ke=(function(br,Le){if(br){if(typeof br=="string")return Xe(br,Le);var ot={}.toString.call(br).slice(8,-1);return ot==="Object"&&br.constructor&&(ot=br.constructor.name),ot==="Map"||ot==="Set"?Array.from(br):ot==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ot)?Xe(br,Le):void 0}})(ve))||Ie){ke&&(ve=ke);var sr=0,jr=function(){};return{s:jr,n:function(){return sr>=ve.length?{done:!0}:{done:!1,value:ve[sr++]}},e:function(br){throw br},f:jr}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
59
59
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var wr,Lr=!0,Ar=!1;return{s:function(){ke=ke.call(ve)},n:function(){var br=ke.next();return Lr=br.done,br},e:function(br){Ar=!0,wr=br},f:function(){try{Lr||ke.return==null||ke.return()}finally{if(Ar)throw wr}}}})(X.keys());try{for(J.s();!(z=J.n()).done;){var ne=z.value;if(!(ne in te)){var ce=X.getAll(ne);ce.length>1?te[ne]=ce:te[ne]=ce[0]}}}catch(ve){J.e(ve)}finally{J.f()}return te&&Object.keys(te).length?JSON.stringify(te):Z},get referrer(){return window.document.referrer},get title(){return window.document.title},get pathname(){return window.location.pathname},get hostname(){return window.location.hostname},get requestUrl(){return Qe.hostname+Qe.pathname},decodeURIComponent:function(z){return window.decodeURIComponent(z)}},hr=Qe,gr={mobileDevice:/Mobi/i,iphone:/iphone/i,ipad:/ipad/i,android:/android/i,blackberry:/blackberry/i,windowsPhone:/windows phone/i,iosVersion:/OS\s+([\d_.-:]+)\s/i,androidVersion:/android\s+([\d_.-\/]+)[\s;:,\)]/i,blackberryVersion:/(blackberry|version)\s?\d*\/([\d.]+)/i,windowsPhoneVersion:/windows\sphone.*?([\d_.-\/]+)[\s;:,\)]/i,mac:/Mac/i,unix:/X11/i,linux:/Linux/i,windows:/Win/i,win2000:/nt 5.0/i,winXP:/nt 5.1/i,winVista:/nt 6.0/i,win7:/nt 6.1/i,win8:/nt 6.2/i,win81:/nt 6.3/i,win10:/nt 10.0/i,osxVersion:/OS\sX\s([\d_.]+)/i},Kr="Unknown";function et(z,Z,X){if(!Z)return{name:z,version:Kr};var te=Z.exec(X);return{name:z,version:te&&te.length?te[0].trim():Kr}}var St=function(){var z=window.navigator.userAgent;return gr.mobileDevice.test(z)?gr.iphone.test(z)?"iPhone":gr.ipad.test(z)?"iPad":gr.android.test(z)?"Android":gr.blackberry.test(z)?"Blackberry":gr.windowsPhone.test(z)?"Windows Phone":Kr:"Desktop"},Gt={getEventDataPayload:function(z,Z){var X={product:this.getProductData(Z),client:this.getClientData(),request:this.getRequestData()};z.data&&Object.keys(z.data).length&&(X.data=z.data),z.actionType&&(X.action_type=z.actionType);var te=hr.requestUrl;return te&&(X.request_url=te),X},getProductData:function(z){var Z={name:z.name,version:z.version};return z.locale&&(Z.locale=z.locale),Z},getClientData:function(){return{os:(z=window.navigator.userAgent,gr.android.test(z)?et("Android",gr.androidVersion,z):gr.iphone.test(z)||gr.ipad.test(z)?et("iOS",gr.iosVersion,z):gr.linux.test(z)?et("Linux",null,z):gr.unix.test(z)?et("Unix",null,z):gr.mac.test(z)?et("Macintosh",gr.osxVersion,z):gr.windows.test(z)?(function(Z,X){var te={name:"Windows",version:null};return gr.win2000.test(X)&&(te.version="2000"),gr.winXP.test(X)&&(te.version="XP"),gr.winVista.test(X)&&(te.version="Vista"),gr.win7.test(X)&&(te.version="7"),gr.win8.test(X)&&(te.version="8"),gr.win81.test(X)&&(te.version="8.1"),gr.win10.test(X)&&(te.version="10"),te.version||(te.version=Kr),te})(0,z):gr.blackberry.test(z)?et("BlackBerry",gr.blackberryVersion,z):gr.windowsPhone.test(z)?et("Windows Phone",gr.windowsPhoneVersion,z):{name:Kr,version:Kr}),device:{type:St(),resolution:"".concat(hr.screenWidth,"x").concat(hr.screenHeight)}};var z},getRequestData:function(){var z=hr.queryParams,Z=hr.referrer,X=(function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"&",ne=hr.queryString;if(ne.length){var ce=hr.decodeURIComponent(ne.substring(1)),ve=new RegExp("((utm_[^=]+)=([^\\"+J+"]+))","gi"),Ie=ce.match(ve);if(Ie&&Ie.length){var ke=Ie.reduce((function(sr,jr){var wr=jr.split("=");return sr[wr[0].split("_")[1]]=wr[1],sr}),{});if(Object.keys(ke).length)return ke}}})(),te={page_name:hr.title,host_name:hr.hostname,path_name:hr.pathname};return z.length&&(te.query_params=z),Z.length&&(te.referrer=Z),X&&(te.utms=X),te}},it=function(z){throw new Error(z)},cn=function(z){for(var Z=arguments.length,X=new Array(Z>1?Z-1:0),te=1;te<Z;te++)X[te-1]=arguments[te];console.error(z,X)};function za(z,Z){(Z==null||Z>z.length)&&(Z=z.length);for(var X=0,te=Array(Z);X<Z;X++)te[X]=z[X];return te}function ha(z){return ha=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Z){return typeof Z}:function(Z){return Z&&typeof Symbol=="function"&&Z.constructor===Symbol&&Z!==Symbol.prototype?"symbol":typeof Z},ha(z)}var Xn=new RegExp(`[A-Za-z0-9 _.,!"'/$]*`),Qn=new RegExp("^[a-z]+(?:_[a-z]+)*$"),ai=["productName","productVersion","apiKey","baseUrl"],Mt={clientUserAttributeValue:function(z){return typeof z=="boolean"?!0:!(!z||typeof z=="string"&&(!z.length||!(z.length<=255)||z[0]==="$"||!Xn.test(z)))},isSnakeCase:function(z){return Qn.test(z)},additionalData:function(z){if(ha(z)!=="object"||z===null)return!0;if(Array.isArray(z)){var Z,X=(function(ce,ve){var Ie=typeof Symbol<"u"&&ce[Symbol.iterator]||ce["@@iterator"];if(!Ie){if(Array.isArray(ce)||(Ie=(function(Ar,br){if(Ar){if(typeof Ar=="string")return za(Ar,br);var Le={}.toString.call(Ar).slice(8,-1);return Le==="Object"&&Ar.constructor&&(Le=Ar.constructor.name),Le==="Map"||Le==="Set"?Array.from(Ar):Le==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Le)?za(Ar,br):void 0}})(ce))||ve){Ie&&(ce=Ie);var ke=0,sr=function(){};return{s:sr,n:function(){return ke>=ce.length?{done:!0}:{done:!1,value:ce[ke++]}},e:function(Ar){throw Ar},f:sr}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
60
60
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var jr,wr=!0,Lr=!1;return{s:function(){Ie=Ie.call(ce)},n:function(){var Ar=Ie.next();return wr=Ar.done,Ar},e:function(Ar){Lr=!0,jr=Ar},f:function(){try{wr||Ie.return==null||Ie.return()}finally{if(Lr)throw jr}}}})(z);try{for(X.s();!(Z=X.n()).done;){var te=Z.value;if(!Mt.additionalData(te))return!1}}catch(ce){X.e(ce)}finally{X.f()}}else for(var J in z){if(!Mt.isSnakeCase(J))return cn("'".concat(J,"' in additional data provided does not follow 'snake_case' naming convention.")),!1;var ne=z[J];if(ha(ne)==="object"&&ne!==null&&!Mt.additionalData(ne))return!1}return!0},accountAddress:function(z){if(!z||ha(z)!=="object")return!1;var Z=Object.keys(z);return!(Z.length===0||Z.length>2||Z.length===1&&!Z.includes("country_code")||Z.length===2&&!Z.includes("country_code")&&!Z.includes("province")||typeof z.country_code!="string"||Z.includes("province")&&typeof z.province!="string")},brazeClientOptions:function(z){z||it("No Client options provided."),ai.forEach((function(Z){z.hasOwnProperty(Z)||it('Cannot find the required "'.concat(Z,'" attribute in client options.'))}))}};function Ut(z){return Ut=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Z){return typeof Z}:function(Z){return Z&&typeof Symbol=="function"&&Z.constructor===Symbol&&Z!==Symbol.prototype?"symbol":typeof Z},Ut(z)}function Za(){Za=function(){return Z};var z,Z={},X=Object.prototype,te=X.hasOwnProperty,J=Object.defineProperty||function(Ye,Fe,Ue){Ye[Fe]=Ue.value},ne=typeof Symbol=="function"?Symbol:{},ce=ne.iterator||"@@iterator",ve=ne.asyncIterator||"@@asyncIterator",Ie=ne.toStringTag||"@@toStringTag";function ke(Ye,Fe,Ue){return Object.defineProperty(Ye,Fe,{value:Ue,enumerable:!0,configurable:!0,writable:!0}),Ye[Fe]}try{ke({},"")}catch{ke=function(Fe,Ue,_r){return Fe[Ue]=_r}}function sr(Ye,Fe,Ue,_r){var Cr=Fe&&Fe.prototype instanceof Le?Fe:Le,nt=Object.create(Cr.prototype),Ot=new tt(_r||[]);return J(nt,"_invoke",{value:st(Ye,Ue,Ot)}),nt}function jr(Ye,Fe,Ue){try{return{type:"normal",arg:Ye.call(Fe,Ue)}}catch(_r){return{type:"throw",arg:_r}}}Z.wrap=sr;var wr="suspendedStart",Lr="executing",Ar="completed",br={};function Le(){}function ot(){}function rn(){}var Ft={};ke(Ft,ce,(function(){return this}));var ci=Object.getPrototypeOf,Bt=ci&&ci(ci(tn([])));Bt&&Bt!==X&&te.call(Bt,ce)&&(Ft=Bt);var ft=rn.prototype=Le.prototype=Object.create(Ft);function Ln(Ye){["next","throw","return"].forEach((function(Fe){ke(Ye,Fe,(function(Ue){return this._invoke(Fe,Ue)}))}))}function Yr(Ye,Fe){function Ue(Cr,nt,Ot,Sn){var wn=jr(Ye[Cr],Ye,nt);if(wn.type!=="throw"){var pa=wn.arg,Ii=pa.value;return Ii&&Ut(Ii)=="object"&&te.call(Ii,"__await")?Fe.resolve(Ii.__await).then((function(Ga){Ue("next",Ga,Ot,Sn)}),(function(Ga){Ue("throw",Ga,Ot,Sn)})):Fe.resolve(Ii).then((function(Ga){pa.value=Ga,Ot(pa)}),(function(Ga){return Ue("throw",Ga,Ot,Sn)}))}Sn(wn.arg)}var _r;J(this,"_invoke",{value:function(Cr,nt){function Ot(){return new Fe((function(Sn,wn){Ue(Cr,nt,Sn,wn)}))}return _r=_r?_r.then(Ot,Ot):Ot()}})}function st(Ye,Fe,Ue){var _r=wr;return function(Cr,nt){if(_r===Lr)throw Error("Generator is already running");if(_r===Ar){if(Cr==="throw")throw nt;return{value:z,done:!0}}for(Ue.method=Cr,Ue.arg=nt;;){var Ot=Ue.delegate;if(Ot){var Sn=gt(Ot,Ue);if(Sn){if(Sn===br)continue;return Sn}}if(Ue.method==="next")Ue.sent=Ue._sent=Ue.arg;else if(Ue.method==="throw"){if(_r===wr)throw _r=Ar,Ue.arg;Ue.dispatchException(Ue.arg)}else Ue.method==="return"&&Ue.abrupt("return",Ue.arg);_r=Lr;var wn=jr(Ye,Fe,Ue);if(wn.type==="normal"){if(_r=Ue.done?Ar:"suspendedYield",wn.arg===br)continue;return{value:wn.arg,done:Ue.done}}wn.type==="throw"&&(_r=Ar,Ue.method="throw",Ue.arg=wn.arg)}}}function gt(Ye,Fe){var Ue=Fe.method,_r=Ye.iterator[Ue];if(_r===z)return Fe.delegate=null,Ue==="throw"&&Ye.iterator.return&&(Fe.method="return",Fe.arg=z,gt(Ye,Fe),Fe.method==="throw")||Ue!=="return"&&(Fe.method="throw",Fe.arg=new TypeError("The iterator does not provide a '"+Ue+"' method")),br;var Cr=jr(_r,Ye.iterator,Fe.arg);if(Cr.type==="throw")return Fe.method="throw",Fe.arg=Cr.arg,Fe.delegate=null,br;var nt=Cr.arg;return nt?nt.done?(Fe[Ye.resultName]=nt.value,Fe.next=Ye.nextLoc,Fe.method!=="return"&&(Fe.method="next",Fe.arg=z),Fe.delegate=null,br):nt:(Fe.method="throw",Fe.arg=new TypeError("iterator result is not an object"),Fe.delegate=null,br)}function _n(Ye){var Fe={tryLoc:Ye[0]};1 in Ye&&(Fe.catchLoc=Ye[1]),2 in Ye&&(Fe.finallyLoc=Ye[2],Fe.afterLoc=Ye[3]),this.tryEntries.push(Fe)}function dn(Ye){var Fe=Ye.completion||{};Fe.type="normal",delete Fe.arg,Ye.completion=Fe}function tt(Ye){this.tryEntries=[{tryLoc:"root"}],Ye.forEach(_n,this),this.reset(!0)}function tn(Ye){if(Ye||Ye===""){var Fe=Ye[ce];if(Fe)return Fe.call(Ye);if(typeof Ye.next=="function")return Ye;if(!isNaN(Ye.length)){var Ue=-1,_r=function Cr(){for(;++Ue<Ye.length;)if(te.call(Ye,Ue))return Cr.value=Ye[Ue],Cr.done=!1,Cr;return Cr.value=z,Cr.done=!0,Cr};return _r.next=_r}}throw new TypeError(Ut(Ye)+" is not iterable")}return ot.prototype=rn,J(ft,"constructor",{value:rn,configurable:!0}),J(rn,"constructor",{value:ot,configurable:!0}),ot.displayName=ke(rn,Ie,"GeneratorFunction"),Z.isGeneratorFunction=function(Ye){var Fe=typeof Ye=="function"&&Ye.constructor;return!!Fe&&(Fe===ot||(Fe.displayName||Fe.name)==="GeneratorFunction")},Z.mark=function(Ye){return Object.setPrototypeOf?Object.setPrototypeOf(Ye,rn):(Ye.__proto__=rn,ke(Ye,Ie,"GeneratorFunction")),Ye.prototype=Object.create(ft),Ye},Z.awrap=function(Ye){return{__await:Ye}},Ln(Yr.prototype),ke(Yr.prototype,ve,(function(){return this})),Z.AsyncIterator=Yr,Z.async=function(Ye,Fe,Ue,_r,Cr){Cr===void 0&&(Cr=Promise);var nt=new Yr(sr(Ye,Fe,Ue,_r),Cr);return Z.isGeneratorFunction(Fe)?nt:nt.next().then((function(Ot){return Ot.done?Ot.value:nt.next()}))},Ln(ft),ke(ft,Ie,"Generator"),ke(ft,ce,(function(){return this})),ke(ft,"toString",(function(){return"[object Generator]"})),Z.keys=function(Ye){var Fe=Object(Ye),Ue=[];for(var _r in Fe)Ue.push(_r);return Ue.reverse(),function Cr(){for(;Ue.length;){var nt=Ue.pop();if(nt in Fe)return Cr.value=nt,Cr.done=!1,Cr}return Cr.done=!0,Cr}},Z.values=tn,tt.prototype={constructor:tt,reset:function(Ye){if(this.prev=0,this.next=0,this.sent=this._sent=z,this.done=!1,this.delegate=null,this.method="next",this.arg=z,this.tryEntries.forEach(dn),!Ye)for(var Fe in this)Fe.charAt(0)==="t"&&te.call(this,Fe)&&!isNaN(+Fe.slice(1))&&(this[Fe]=z)},stop:function(){this.done=!0;var Ye=this.tryEntries[0].completion;if(Ye.type==="throw")throw Ye.arg;return this.rval},dispatchException:function(Ye){if(this.done)throw Ye;var Fe=this;function Ue(wn,pa){return nt.type="throw",nt.arg=Ye,Fe.next=wn,pa&&(Fe.method="next",Fe.arg=z),!!pa}for(var _r=this.tryEntries.length-1;_r>=0;--_r){var Cr=this.tryEntries[_r],nt=Cr.completion;if(Cr.tryLoc==="root")return Ue("end");if(Cr.tryLoc<=this.prev){var Ot=te.call(Cr,"catchLoc"),Sn=te.call(Cr,"finallyLoc");if(Ot&&Sn){if(this.prev<Cr.catchLoc)return Ue(Cr.catchLoc,!0);if(this.prev<Cr.finallyLoc)return Ue(Cr.finallyLoc)}else if(Ot){if(this.prev<Cr.catchLoc)return Ue(Cr.catchLoc,!0)}else{if(!Sn)throw Error("try statement without catch or finally");if(this.prev<Cr.finallyLoc)return Ue(Cr.finallyLoc)}}}},abrupt:function(Ye,Fe){for(var Ue=this.tryEntries.length-1;Ue>=0;--Ue){var _r=this.tryEntries[Ue];if(_r.tryLoc<=this.prev&&te.call(_r,"finallyLoc")&&this.prev<_r.finallyLoc){var Cr=_r;break}}Cr&&(Ye==="break"||Ye==="continue")&&Cr.tryLoc<=Fe&&Fe<=Cr.finallyLoc&&(Cr=null);var nt=Cr?Cr.completion:{};return nt.type=Ye,nt.arg=Fe,Cr?(this.method="next",this.next=Cr.finallyLoc,br):this.complete(nt)},complete:function(Ye,Fe){if(Ye.type==="throw")throw Ye.arg;return Ye.type==="break"||Ye.type==="continue"?this.next=Ye.arg:Ye.type==="return"?(this.rval=this.arg=Ye.arg,this.method="return",this.next="end"):Ye.type==="normal"&&Fe&&(this.next=Fe),br},finish:function(Ye){for(var Fe=this.tryEntries.length-1;Fe>=0;--Fe){var Ue=this.tryEntries[Fe];if(Ue.finallyLoc===Ye)return this.complete(Ue.completion,Ue.afterLoc),dn(Ue),br}},catch:function(Ye){for(var Fe=this.tryEntries.length-1;Fe>=0;--Fe){var Ue=this.tryEntries[Fe];if(Ue.tryLoc===Ye){var _r=Ue.completion;if(_r.type==="throw"){var Cr=_r.arg;dn(Ue)}return Cr}}throw Error("illegal catch attempt")},delegateYield:function(Ye,Fe,Ue){return this.delegate={iterator:tn(Ye),resultName:Fe,nextLoc:Ue},this.method==="next"&&(this.arg=z),br}},Z}function Ha(z,Z){for(var X=0;X<Z.length;X++){var te=Z[X];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(z,Qt(te.key),te)}}function Qt(z){var Z=(function(X,te){if(Ut(X)!="object"||!X)return X;var J=X[Symbol.toPrimitive];if(J!==void 0){var ne=J.call(X,"string");if(Ut(ne)!="object")return ne;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(X)})(z);return Ut(Z)=="symbol"?Z:Z+""}var yn=(function(){function z(J){(function(ne,ce){if(!(ne instanceof ce))throw new TypeError("Cannot call a class as a function")})(this,z),Mt.brazeClientOptions(J),this.options=J,this.initialize()}var Z,X,te;return Z=z,X=[{key:"initialize",value:function(){var J,ne;J=this.options.apiKey,ne={baseUrl:this.options.baseUrl,enableLogging:this.options.enableLogging,allowUserSuppliedJavascript:this.options.allowUserSuppliedJavascript,minimumIntervalBetweenTriggerActionsInSeconds:this.options.minimumIntervalBetweenTriggerActionsInSeconds,doNotLoadFontAwesome:!0},d.ZP.initialize(J,ne)||it('Cannot initialize client. Please make sure your "apiKey" and "baseUrl" is valid.'),this.options.automaticallyShowInAppMessages&&(function(){if(!d.ZP.X())return;_();const ce=h.Z.m();if(ce.Pi()==null){const ve=We((Ie=>Re(Ie)));ce.$i(ve)}ce.Pi()})()}},{key:"openSession",value:function(){(function(){if(!d.ZP.X())return;const J=d.ZP.cr();if(!J)return;J.openSession();const ne=He.Z.Yt.Qt,ce=new He.Z(ne,x.Z);ce.jr(ne.ss.hr,((ve,Ie)=>{const ke=Ie.lastClick,sr=Ie.trackingString;x.Z.info(`Firing push click trigger from ${sr} push click at ${ke}`);const jr=J.kr(ke,sr),wr=function(){k.n.rr().fe(j.Z.vr,[sr],jr)};J.$r(wr,wr),ce.re(ne.ss.hr,ve)})),ce.Zt(ne.ss.wr,(function(ve){J.yr(ve)}))})()}},{key:"logEvent",value:function(J){var ne,ce=Gt.getEventDataPayload(J,{name:this.options.productName,version:this.options.productVersion,locale:(ne=this.options)===null||ne===void 0?void 0:ne.locale});return nr.logCustomEvent(J.type,ce)}},{key:"getUserId",value:function(){return this.getBrazeUser().getUserId()}},{key:"setCustomUserAttribute",value:function(J,ne){var ce=this.getBrazeUser();return Mt.clientUserAttributeValue(ne)||it("Invalid custom user attribute value: '".concat(ne,"' for key: '").concat(J,"'")),ce.setCustomUserAttribute(J,ne)}},{key:"bulkSetCustomUserAttributes",value:function(J){var ne=this;Object.keys(J).length||it("Cannot bulk set emptry object for custom user attributes"),Object.keys(J).forEach((function(ce){var ve=J[ce];ne.setCustomUserAttribute(ce,ve)}))}},{key:"requestPushPermission",value:function(J,ne){ar.requestPushPermission(J,ne)}},{key:"unregisterPush",value:function(J,ne){xr.unregisterPush(J,ne)}},{key:"setAlias",value:function(J,ne){this.getBrazeUser().addAlias(ne,J)}},{key:"setUser",value:function(J){or.changeUser(J)}},{key:"setUserFirstName",value:function(J){this.getBrazeUser().setFirstName(J)}},{key:"setUserLastName",value:function(J){this.getBrazeUser().setLastName(J)}},{key:"setUserEmail",value:function(J){this.getBrazeUser().setEmail(J)}},{key:"setUserCountry",value:function(J){this.getBrazeUser().setCountry(J)}},{key:"setUserPhone",value:function(J){this.getBrazeUser().setPhoneNumber(J)}},{key:"setUserGender",value:function(J){this.getBrazeUser().setGender(J)}},{key:"setUserEmailNotificationSubscriptionType",value:function(J){return this.getBrazeUser().setEmailNotificationSubscriptionType(J)}},{key:"sendData",value:function(J){J&&typeof J=="function"?lr.requestImmediateDataFlush(J):lr.requestImmediateDataFlush()}},{key:"hasUser",value:function(){try{if(this.getBrazeUser())return!0}catch{return!1}finally{return!1}}},{key:"getBrazeUser",value:function(){var J=H.P();return J||it("No valid user found!"),J}},{key:"getContentCardsV2",value:function(){return(function(){if(d.ZP.X())return Oe.rr().Us(!1)})()}},{key:"showContentCards",value:function(J,ne){return Me(J,ne)}},{key:"getContentCards",value:function(){return J=this,ne=void 0,ce=void 0,ve=Za().mark((function Ie(){return Za().wrap((function(ke){for(;;)switch(ke.prev=ke.next){case 0:return ke.abrupt("return",new Promise((function(sr,jr){Me(null,(function(wr){return wr?sr(wr):jr(new Error("No content cards found.")),wr}))})));case 1:case"end":return ke.stop()}}),Ie)})),new(ce||(ce=Promise))((function(Ie,ke){function sr(Lr){try{wr(ve.next(Lr))}catch(Ar){ke(Ar)}}function jr(Lr){try{wr(ve.throw(Lr))}catch(Ar){ke(Ar)}}function wr(Lr){var Ar;Lr.done?Ie(Lr.value):(Ar=Lr.value,Ar instanceof ce?Ar:new ce((function(br){br(Ar)}))).then(sr,jr)}wr((ve=ve.apply(J,ne||[])).next())}));var J,ne,ce,ve}},{key:"hideCards",value:function(J){(function(ne){if(!d.ZP.X())return;const ce=document.querySelectorAll(".ab-feed");for(let ve=0;ve<ce.length;ve++)(ne==null||ne!=null&&ce[ve].parentNode===ne)&&(0,Te.tQ)(ce[ve])})(J)}},{key:"logContentCardDismissal",value:function(J){J||it('No "card" provided in "logContentCardDismissal"'),rr.K(J)}},{key:"logContentCardClick",value:function(J){J||it('No "card" provided in "logContentCardClick"'),Q.d(J,!0)}},{key:"logContentCardImpressions",value:function(J){var ne;J&&J.length||it('No "cards" provided in "logContentCardImpressions"'),ne=J,(0,Y.p)(ne,!0)}},{key:"requestContentCardRefresh",value:function(J,ne){return re(J,ne)}},{key:"subscribeToContentCardUpdate",value:function(J){return J||it('No "subscriber" provided in "subscribeToContentCardUpdate"'),De(J)}},{key:"subscribeToInAppMessage",value:function(J){return J||it('No "callback" provided in "subscribeToInAppMessage".'),We(J)}},{key:"showInAppMessage",value:function(J,ne,ce){return J||it('Invalid "inAppMessage" provided in "showInAppMessage".'),Re(J,ne,ce)}},{key:"logInAppMessageClick",value:function(J){return J||it('Invalid "inAppMessage" provided in "logInAppMessageClick".'),N(J)}},{key:"logInAppMessageButtonClick",value:function(J,ne){return J&&ne||it('Invalid params supplied in "logInAppMessageButtonClick".'),ae(J,ne)}},{key:"logInAppMessageHtmlClick",value:function(J,ne,ce){return J||it('Invalid "inAppMessage" provided in "logInAppMessageHtmlClick".'),B(J,ne,ce)}},{key:"logInAppMessageImpression",value:function(J){return J||it('Invalid "inAppMessage" provided in "logInAppMessageImpression".'),O(J)}}],te=[{key:"getInstance",value:function(J){return this._instance||(this._instance=new this(J))}}],X&&Ha(Z.prototype,X),te&&Ha(Z,te),Object.defineProperty(Z,"prototype",{writable:!1}),z})();function qn(z){return qn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Z){return typeof Z}:function(Z){return Z&&typeof Symbol=="function"&&Z.constructor===Symbol&&Z!==Symbol.prototype?"symbol":typeof Z},qn(z)}function Eo(z,Z){for(var X=0;X<Z.length;X++){var te=Z[X];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(z,Ce(te.key),te)}}function Ce(z){var Z=(function(X,te){if(qn(X)!="object"||!X)return X;var J=X[Symbol.toPrimitive];if(J!==void 0){var ne=J.call(X,"string");if(qn(ne)!="object")return ne;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(X)})(z);return qn(Z)=="symbol"?Z:Z+""}var Ke=(function(){function z(te){(function(J,ne){if(!(J instanceof ne))throw new TypeError("Cannot call a class as a function")})(this,z),this.options=te,this.apiClient=te.apiClient}var Z,X;return Z=z,(X=[{key:"safelyExecute",value:function(te){try{return te()}catch(J){J instanceof Error&&cn(J.message),typeof J=="string"&&cn(J)}}}])&&Eo(Z.prototype,X),Object.defineProperty(Z,"prototype",{writable:!1}),z})();function xe(z){return xe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Z){return typeof Z}:function(Z){return Z&&typeof Symbol=="function"&&Z.constructor===Symbol&&Z!==Symbol.prototype?"symbol":typeof Z},xe(z)}function me(z,Z){for(var X=0;X<Z.length;X++){var te=Z[X];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(z,Be(te.key),te)}}function Be(z){var Z=(function(X,te){if(xe(X)!="object"||!X)return X;var J=X[Symbol.toPrimitive];if(J!==void 0){var ne=J.call(X,"string");if(xe(ne)!="object")return ne;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(X)})(z);return xe(Z)=="symbol"?Z:Z+""}function kr(z,Z){return kr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(X,te){return X.__proto__=te,X},kr(z,Z)}function mr(z){var Z=Fr();return function(){var X,te=Rt(z);if(Z){var J=Rt(this).constructor;X=Reflect.construct(te,arguments,J)}else X=te.apply(this,arguments);return wt(this,X)}}function wt(z,Z){if(Z&&(xe(Z)=="object"||typeof Z=="function"))return Z;if(Z!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(X){if(X===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return X})(z)}function Fr(){try{var z=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch{}return(Fr=function(){return!!z})()}function Rt(z){return Rt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Z){return Z.__proto__||Object.getPrototypeOf(Z)},Rt(z)}var fn=(function(z){(function(ne,ce){if(typeof ce!="function"&&ce!==null)throw new TypeError("Super expression must either be null or a function");ne.prototype=Object.create(ce&&ce.prototype,{constructor:{value:ne,writable:!0,configurable:!0}}),Object.defineProperty(ne,"prototype",{writable:!1}),ce&&kr(ne,ce)})(J,z);var Z,X,te=mr(J);function J(ne){return(function(ce,ve){if(!(ce instanceof ve))throw new TypeError("Cannot call a class as a function")})(this,J),te.call(this,ne)}return Z=J,(X=[{key:"getAll",value:function(){return this.apiClient.getContentCardsV2()}},{key:"getContentCards",value:function(){return this.apiClient.getContentCards()}},{key:"show",value:function(ne,ce){return this.apiClient.showContentCards(ne,ce)}},{key:"hide",value:function(ne){return this.apiClient.hideCards(ne)}},{key:"logDismissal",value:function(ne){return this.apiClient.logContentCardDismissal(ne)}},{key:"logClick",value:function(ne){return this.apiClient.logContentCardClick(ne)}},{key:"logImpressions",value:function(ne){return this.apiClient.logContentCardImpressions(ne)}},{key:"requestRefresh",value:function(ne,ce){return this.apiClient.requestContentCardRefresh(ne,ce)}},{key:"subscribe",value:function(ne){return this.apiClient.subscribeToContentCardUpdate(ne)}}])&&me(Z.prototype,X),Object.defineProperty(Z,"prototype",{writable:!1}),J})(Ke);function ze(z){return ze=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Z){return typeof Z}:function(Z){return Z&&typeof Symbol=="function"&&Z.constructor===Symbol&&Z!==Symbol.prototype?"symbol":typeof Z},ze(z)}function Et(z,Z){for(var X=0;X<Z.length;X++){var te=Z[X];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(z,va(te.key),te)}}function va(z){var Z=(function(X,te){if(ze(X)!="object"||!X)return X;var J=X[Symbol.toPrimitive];if(J!==void 0){var ne=J.call(X,"string");if(ze(ne)!="object")return ne;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(X)})(z);return ze(Z)=="symbol"?Z:Z+""}function ii(z,Z){return ii=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(X,te){return X.__proto__=te,X},ii(z,Z)}function Si(z){var Z=Gi();return function(){var X,te=Dn(z);if(Z){var J=Dn(this).constructor;X=Reflect.construct(te,arguments,J)}else X=te.apply(this,arguments);return Vn(this,X)}}function Vn(z,Z){if(Z&&(ze(Z)=="object"||typeof Z=="function"))return Z;if(Z!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(X){if(X===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return X})(z)}function Gi(){try{var z=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch{}return(Gi=function(){return!!z})()}function Dn(z){return Dn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Z){return Z.__proto__||Object.getPrototypeOf(Z)},Dn(z)}var cu,fu,du,Wi,Ki,wi,Yi,hu,vu,Co,oi,en,bn,Ol,pu=(function(z){(function(ne,ce){if(typeof ce!="function"&&ce!==null)throw new TypeError("Super expression must either be null or a function");ne.prototype=Object.create(ce&&ce.prototype,{constructor:{value:ne,writable:!0,configurable:!0}}),Object.defineProperty(ne,"prototype",{writable:!1}),ce&&ii(ne,ce)})(J,z);var Z,X,te=Si(J);function J(ne){return(function(ce,ve){if(!(ce instanceof ve))throw new TypeError("Cannot call a class as a function")})(this,J),te.call(this,ne)}return Z=J,(X=[{key:"show",value:function(ne,ce,ve){return this.apiClient.showInAppMessage(ne,ce,ve)}},{key:"logMessageClick",value:function(ne){return this.apiClient.logInAppMessageClick(ne)}},{key:"logButtonClick",value:function(ne,ce){return this.apiClient.logInAppMessageButtonClick(ne,ce)}},{key:"logHtmlMessageClick",value:function(ne,ce,ve){return this.apiClient.logInAppMessageHtmlClick(ne,ce,ve)}},{key:"logImpression",value:function(ne){return this.apiClient.logInAppMessageImpression(ne)}},{key:"subscribe",value:function(ne){return this.apiClient.subscribeToInAppMessage(ne)}}])&&Et(Z.prototype,X),Object.defineProperty(Z,"prototype",{writable:!1}),J})(Ke),ct={all:["streamable","clickview"],cv:["clickview"],sl:["streamable"],none:[]};(function(z){z.AU="au",z.NZ="nz",z.UK="uk",z.US="us"})(cu||(cu={})),(function(z){z.PageView="page_view"})(fu||(fu={})),(function(z){z.ButtonClick="marketing_button_click",z.LinkClick="marketing_link_click"})(du||(du={})),(function(z){z.FreeTrialSignup="marketing_free_trial_signup",z.DemoSignup="marketing_demo_signup",z.PostFreeTrialSubmission="marketing_post_free_trial_submission",z.FormSubmission="marketing_form_submission",z.ContactFormSubmission="marketing_contact_us_submission",z.CallBooked="marketing_call_booked",z.NewsletterSignup="cv_marketing_newsletter_sign_up",z.MarketingTradeshowSubmission="marketing_tradeshow_submission",z.LandingPageFormSubmission="cv_marketing_lp_form_submission"})(Wi||(Wi={})),(function(z){z.ProductTrailRequested="product_trial_requested",z.FormSubmission="product_form_submission",z.TrialUpgradeRequested="product_trial_upgrade_requested",z.OlympicsOfferSubmission="product_olympics_offer_submission",z.BdmTrialRequested="cv_product_bdm_trial_requested"})(Ki||(Ki={})),(function(z){z.ContactUsFormSubmit="streamable_contact_us_submission",z.LivestreamBookingFormSubmit="streamable_livestream_booking_submission"})(wi||(wi={})),(function(z){z.TrialRequested="sl_marketing_trial_requested",z.HalloweenFormSubmission="sl_marketing_halloween_submission",z.NewsletterSignup="sl_marketing_newsletter_sign_up",z.RequestPricing="sl_marketing_pricing_requested",z.LandingPageFormSubmission="sl_marketing_lp_form_submission",z.ContactUsFormSubmit="sl_marketing_contact_us_submission"})(Yi||(Yi={})),(function(z){z.ContactUsFormSubmit="ch_marketing_contact_us_submission"})(hu||(hu={})),(function(z){z.ExploreTopics="product_explore_topics",z.Stream="product_stream",z.Search="product_search",z.SearchClickthrough="product_search_clickthrough",z.ClickBookACall="product_book_a_call_clicked",z.Share="product_share",z.DownloadResource="product_download_resource",z.Invite="product_invite_send",z.PlayerDeviceCta="product_player_devices_cta",z.SettingsIntegrations="product_settings_integrations"})(vu||(vu={})),(function(z){z.AddToSubscriptionGroups="add_to_subscription_groups"})(Co||(Co={})),(function(z){z.FirstName="first_name",z.LastName="last_name",z.Email="email",z.Phone="phone_number"})(oi||(oi={})),(function(z){z.CrmId="cvc_id",z.JobTitle="job_title",z.AccountOwner="account_owner",z.Department="department",z.AccountName="account_name",z.AccountType="account_type",z.OrgType="organisation_type",z.OrgSubType="organisation_sub_type",z.SyncToCrm="sync_to_crm",z.MasterId="master_id",z.AccountAddress="account_address",z.Topic="topic",z.Source="source"})(en||(en={})),(function(z){z.AccountCity="account_city",z.AccountState="account_state",z.AccountPostCode="account_post_code",z.AccountCountry="account_country",z.HowCanWeHelp="how_can_we_help",z.ReasonForInterest="reason_for_interest",z.EventTopic="event_topic",z.ContactUsComment="contact_us_comment"})(bn||(bn={})),(function(z){z.Marketing="marketing_id",z.Product="master_id",z.Email="email"})(Ol||(Ol={}));function Ei(z){return Ei=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Z){return typeof Z}:function(Z){return Z&&typeof Symbol=="function"&&Z.constructor===Symbol&&Z!==Symbol.prototype?"symbol":typeof Z},Ei(z)}function kl(z,Z){for(var X=0;X<Z.length;X++){var te=Z[X];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(z,gu(te.key),te)}}function gu(z){var Z=(function(X,te){if(Ei(X)!="object"||!X)return X;var J=X[Symbol.toPrimitive];if(J!==void 0){var ne=J.call(X,"string");if(Ei(ne)!="object")return ne;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(X)})(z);return Ei(Z)=="symbol"?Z:Z+""}function ds(z,Z){return ds=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(X,te){return X.__proto__=te,X},ds(z,Z)}function Pl(z){var Z=hs();return function(){var X,te=Ci(z);if(Z){var J=Ci(this).constructor;X=Reflect.construct(te,arguments,J)}else X=te.apply(this,arguments);return Nl(this,X)}}function Nl(z,Z){if(Z&&(Ei(Z)=="object"||typeof Z=="function"))return Z;if(Z!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(X){if(X===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return X})(z)}function hs(){try{var z=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch{}return(hs=function(){return!!z})()}function Ci(z){return Ci=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Z){return Z.__proto__||Object.getPrototypeOf(Z)},Ci(z)}var si=(function(z){(function(ne,ce){if(typeof ce!="function"&&ce!==null)throw new TypeError("Super expression must either be null or a function");ne.prototype=Object.create(ce&&ce.prototype,{constructor:{value:ne,writable:!0,configurable:!0}}),Object.defineProperty(ne,"prototype",{writable:!1}),ce&&ds(ne,ce)})(J,z);var Z,X,te=Pl(J);function J(ne){return(function(ce,ve){if(!(ce instanceof ve))throw new TypeError("Cannot call a class as a function")})(this,J),te.call(this,ne)}return Z=J,X=[{key:"logForm",value:function(ne){var ce;this.log(ne),(function(ve){var Ie;switch((Ie=ve==null?void 0:ve.internalOptions)===null||Ie===void 0?void 0:Ie.subscriptionGroups){case"all":case"cv":case"sl":return!0;default:return!1}})(ne)&&this.logInternal({eventType:Co.AddToSubscriptionGroups,additionalData:{products:ct[(ce=ne.internalOptions)===null||ce===void 0?void 0:ce.subscriptionGroups]}})}},{key:"logAnalytics",value:function(ne){this.log(ne,!1)}},{key:"logInternal",value:function(ne){var ce=ne.eventType,ve=ne.additionalData,Ie={type:ce,data:{}};Mt.additionalData(ve)&&(Ie.data=Object.assign({},ve)),this.apiClient.logEvent(Ie),this.apiClient.sendData()}},{key:"log",value:function(ne){var ce=ne.eventType,ve=ne.actionType,Ie=ne.additionalData,ke=ne.callback,sr=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],jr=this.options.getPayload();Mt.additionalData(Ie)&&(jr=Object.assign(Object.assign({},jr),Ie));var wr={type:ce,data:jr};ve&&(wr.actionType=ve);var Lr=this.apiClient.logEvent(wr);sr?this.apiClient.sendData(ke):typeof ke!="function"||ke(Lr)}}],X&&kl(Z.prototype,X),Object.defineProperty(Z,"prototype",{writable:!1}),J})(Ke),ui=u(8322),li=u.n(ui);function Ta(z){return Ta=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Z){return typeof Z}:function(Z){return Z&&typeof Symbol=="function"&&Z.constructor===Symbol&&Z!==Symbol.prototype?"symbol":typeof Z},Ta(z)}function Ji(z,Z){return(function(X){if(Array.isArray(X))return X})(z)||(function(X,te){var J=X==null?null:typeof Symbol<"u"&&X[Symbol.iterator]||X["@@iterator"];if(J!=null){var ne,ce,ve,Ie,ke=[],sr=!0,jr=!1;try{if(ve=(J=J.call(X)).next,te!==0)for(;!(sr=(ne=ve.call(J)).done)&&(ke.push(ne.value),ke.length!==te);sr=!0);}catch(wr){jr=!0,ce=wr}finally{try{if(!sr&&J.return!=null&&(Ie=J.return(),Object(Ie)!==Ie))return}finally{if(jr)throw ce}}return ke}})(z,Z)||(function(X,te){if(X){if(typeof X=="string")return Va(X,te);var J={}.toString.call(X).slice(8,-1);return J==="Object"&&X.constructor&&(J=X.constructor.name),J==="Map"||J==="Set"?Array.from(X):J==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(J)?Va(X,te):void 0}})(z,Z)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
61
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Va(z,Z){(Z==null||Z>z.length)&&(Z=z.length);for(var X=0,te=Array(Z);X<Z;X++)te[X]=z[X];return te}var Xi={removeEmptyKeys:function(z){var Z=this;if(Array.isArray(z))return z;var X=Object.assign({},z);return Object.entries(X).filter((function(te){var J=Ji(te,2)[1];return!(J==null||typeof J=="string"&&!J.length||Ta(J)==="object"&&Object.keys(J).length===0)})).reduce((function(te,J){var ne,ce,ve,Ie=Ji(J,2),ke=Ie[0],sr=Ie[1];return Object.assign(Object.assign({},te),(ne={},ce=ke,ve=sr===Object(sr)?Z.removeEmptyKeys(sr):sr,(ce=(function(jr){var wr=(function(Lr,Ar){if(Ta(Lr)!="object"||!Lr)return Lr;var br=Lr[Symbol.toPrimitive];if(br!==void 0){var Le=br.call(Lr,"string");if(Ta(Le)!="object")return Le;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(Lr)})(jr);return Ta(wr)=="symbol"?wr:wr+""})(ce))in ne?Object.defineProperty(ne,ce,{value:ve,enumerable:!0,configurable:!0,writable:!0}):ne[ce]=ve,ne))}),{})}};function xi(z){return xi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Z){return typeof Z}:function(Z){return Z&&typeof Symbol=="function"&&Z.constructor===Symbol&&Z!==Symbol.prototype?"symbol":typeof Z},xi(z)}function pt(z,Z,X){return(Z=(function(te){var J=(function(ne,ce){if(xi(ne)!="object"||!ne)return ne;var ve=ne[Symbol.toPrimitive];if(ve!==void 0){var Ie=ve.call(ne,"string");if(xi(Ie)!="object")return Ie;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(ne)})(te);return xi(J)=="symbol"?J:J+""})(Z))in z?Object.defineProperty(z,Z,{value:X,enumerable:!0,configurable:!0,writable:!0}):z[Z]=X,z}var Ra={getDefaultUserAttributes:function(z){var Z;return Xi.removeEmptyKeys((pt(Z={},oi.Email,z.email),pt(Z,oi.FirstName,z==null?void 0:z.firstName),pt(Z,oi.LastName,z==null?void 0:z.lastName),pt(Z,oi.Phone,z==null?void 0:z.phone),Z))},getCustomUserAttributesWithoutSource:function(z){var Z,X,te,J,ne,ce,ve,Ie,ke,sr,jr,wr,Lr,Ar,br,Le=Xi.removeEmptyKeys({province:(te=(X=z==null?void 0:z.custom)===null||X===void 0?void 0:X.accountAddress)===null||te===void 0?void 0:te.province,country_code:(ne=(J=z==null?void 0:z.custom)===null||J===void 0?void 0:J.accountAddress)===null||ne===void 0?void 0:ne.countryCode}),ot=(pt(Z={},en.AccountName,(ce=z==null?void 0:z.custom)===null||ce===void 0?void 0:ce.accountName),pt(Z,en.AccountType,(ve=z==null?void 0:z.custom)===null||ve===void 0?void 0:ve.accountType),pt(Z,en.CrmId,(Ie=z==null?void 0:z.custom)===null||Ie===void 0?void 0:Ie.crmId),pt(Z,en.Department,(ke=z==null?void 0:z.custom)===null||ke===void 0?void 0:ke.department),pt(Z,en.JobTitle,(sr=z==null?void 0:z.custom)===null||sr===void 0?void 0:sr.jobTitle),pt(Z,en.MasterId,(jr=z==null?void 0:z.custom)===null||jr===void 0?void 0:jr.masterId),pt(Z,en.OrgSubType,(wr=z==null?void 0:z.custom)===null||wr===void 0?void 0:wr.orgSubType),pt(Z,en.OrgType,(Lr=z==null?void 0:z.custom)===null||Lr===void 0?void 0:Lr.orgType),pt(Z,en.SyncToCrm,(Ar=z==null?void 0:z.custom)===null||Ar===void 0?void 0:Ar.syncToCrm),pt(Z,en.Topic,(br=z==null?void 0:z.custom)===null||br===void 0?void 0:br.topic),Z);return Mt.accountAddress(Le)&&(ot[en.AccountAddress]=Le),Xi.removeEmptyKeys(ot)},getCustomUserAttributes:function(z){var Z=Ra.getCustomUserAttributesWithoutSource(z),X=Xi.removeEmptyKeys(Object.assign(Object.assign({},Z),pt({},en.Source,(function(te){var J;if(!((J=te.custom)===null||J===void 0)&&J.source&&te.custom.source.length){var ne=Object.keys(Ra.getDefaultUserAttributes(te)),ce=Object.keys(Ra.getCustomUserAttributesWithoutSource(te));return{$add:[{name:te.custom.source,attributes:[].concat(ne,ce)}]}}it("No source provided for braze user.")})(z))));return X},getEventUserAttributes:function(z){var Z,X,te,J,ne,ce,ve,Ie,ke;return Xi.removeEmptyKeys((pt(Z={},bn.AccountCity,(X=z==null?void 0:z.event)===null||X===void 0?void 0:X.accountCity),pt(Z,bn.AccountCountry,(te=z==null?void 0:z.event)===null||te===void 0?void 0:te.accountCity),pt(Z,bn.AccountPostCode,(J=z==null?void 0:z.event)===null||J===void 0?void 0:J.accountPostCode),pt(Z,bn.AccountState,(ne=z==null?void 0:z.event)===null||ne===void 0?void 0:ne.accountState),pt(Z,bn.ContactUsComment,(ce=z==null?void 0:z.event)===null||ce===void 0?void 0:ce.contactUsComment),pt(Z,bn.EventTopic,(ve=z==null?void 0:z.event)===null||ve===void 0?void 0:ve.eventTopic),pt(Z,bn.HowCanWeHelp,(Ie=z==null?void 0:z.event)===null||Ie===void 0?void 0:Ie.howCanWeHelp),pt(Z,bn.ReasonForInterest,(ke=z==null?void 0:z.event)===null||ke===void 0?void 0:ke.reasonForInterest),Z))},getExtraUserAttributes:function(z){return xi(z.extra)!=="object"?{}:Xi.removeEmptyKeys(z.extra)},getPayload:function(z){if(!z)return{};var Z=Ra.getDefaultUserAttributes(z),X=Ra.getCustomUserAttributes(z),te=Ra.getEventUserAttributes(z),J=Ra.getExtraUserAttributes(z),ne=Mt.additionalData(J),ce=Object.assign(Object.assign(Object.assign({},Z),X),te);return ne?Object.assign(Object.assign({},ce),J):ce},getEmailHash:function(z){var Z=z.trim().toLowerCase();return li().hash(Z)}};function Qi(z){return Qi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Z){return typeof Z}:function(Z){return Z&&typeof Symbol=="function"&&Z.constructor===Symbol&&Z!==Symbol.prototype?"symbol":typeof Z},Qi(z)}function vs(z,Z){for(var X=0;X<Z.length;X++){var te=Z[X];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(z,jl(te.key),te)}}function jl(z){var Z=(function(X,te){if(Qi(X)!="object"||!X)return X;var J=X[Symbol.toPrimitive];if(J!==void 0){var ne=J.call(X,"string");if(Qi(ne)!="object")return ne;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(X)})(z);return Qi(Z)=="symbol"?Z:Z+""}var Hf=(function(){function z(te){var J=te.apiOptions,ne=te.shouldInitialize,ce=ne===void 0||ne,ve=te.allowAnonymous,Ie=ve!==void 0&&ve,ke=te.subscriptions;(function(sr,jr){if(!(sr instanceof jr))throw new TypeError("Cannot call a class as a function")})(this,z),this.initialized=!1,this.apiOptions=J,this.subscriptions=ke,this.allowAnonymous=Ie,ce&&this.initialize()}var Z,X;return Z=z,(X=[{key:"initialize",value:function(){var te=this;this.isInitialized()?(function(J){for(var ne=arguments.length,ce=new Array(ne>1?ne-1:0),ve=1;ve<ne;ve++)ce[ve-1]=arguments[ve];console.warn(J,ce)})("BrazeClient has already been initialized!"):(this.apiClient=yn.getInstance(this.apiOptions),this.cardsModule=new fn({apiClient:this.apiClient}),this.bamModule=new pu({apiClient:this.apiClient}),this.eventModule=new si({apiClient:this.apiClient,getPayload:function(){return Ra.getPayload(te.user)}}),this.initialized=!0)}},{key:"isInitialized",value:function(){return this.initialized}},{key:"getUser",value:function(){return this.isInitialized()?this.validateUser()?this.user:null:(cn("BrazeClient has not been initialized."),null)}},{key:"card",get:function(){return this.isInitialized()?this.cardsModule:(cn("BrazeClient has not been initialized."),null)}},{key:"bam",get:function(){return this.isInitialized()?this.bamModule:(cn("BrazeClient has not been initialized."),null)}},{key:"event",get:function(){return this.isInitialized()?this.allowAnonymous||this.validateUser()?this.eventModule:(cn("Anon events are disabled! Please invoke `setUser` before logging events!"),null):(cn("BrazeClient has not been initialized."),null)}},{key:"setUser",value:function(te){this.isInitialized()?(this.user=te,this.startSession(),this.logUserAttributes()):cn("Trying to `setUser` but the client has not been initialized")}},{key:"setUserInit",value:function(te){this.isInitialized()||this.initialize(),this.setUser(te)}},{key:"allowAnonymousSessions",value:function(){this.allowAnonymous=!0}},{key:"api",value:function(){return this.isInitialized()?this.apiClient:null}},{key:"setEmailNotificationSubscriptionType",value:function(te){return this.isInitialized()&&this.validateUser()?this.apiClient.setUserEmailNotificationSubscriptionType(te):null}},{key:"validateUser",value:function(){return!!this.user||(cn("No user has been set!"),!1)}},{key:"startSession",value:function(){this.allowAnonymous||this.validateUser()?(this.enableSubscriptions(),this.user?(this.apiClient.setUser(Ra.getEmailHash(this.user.email)),this.apiClient.openSession()):this.apiClient.openSession()):cn("No user provided and cannot start anonymous sessions!")}},{key:"enableSubscriptions",value:function(){var te,J;!((te=this.subscriptions)===null||te===void 0)&&te.subscribeToInAppMessage&&typeof this.subscriptions.subscribeToInAppMessage=="function"&&this.apiClient.subscribeToInAppMessage(this.subscriptions.subscribeToInAppMessage),!((J=this.subscriptions)===null||J===void 0)&&J.subscribeToContentCards&&typeof this.subscriptions.subscribeToContentCards=="function"&&this.apiClient.subscribeToContentCardUpdate(this.subscriptions.subscribeToContentCards)}},{key:"logUserAttributes",value:function(){if(this.validateUser()){this.apiClient.setUserEmail(this.user.email),this.user.firstName&&this.apiClient.setUserFirstName(this.user.firstName),this.user.lastName&&this.apiClient.setUserLastName(this.user.lastName),this.user.phone&&this.apiClient.setUserPhone(this.user.phone),this.user.country&&this.apiClient.setUserCountry(this.user.country);var te=Ra.getCustomUserAttributes(this.user);this.apiClient.bulkSetCustomUserAttributes(te)}}}])&&vs(Z.prototype,X),Object.defineProperty(Z,"prototype",{writable:!1}),z})();function xo(z){return yn.getInstance(z)}})(),p})()))})(nb)),nb.exports}var Tl=Iee();function Aee(e){Nr.useEffect(()=>{const r=Tee(e==null?void 0:e.additionalData);r!=null&&r.attributionData&&bi.setAttributionData(r.attributionData),r!=null&&r.utms&&ss.setUtmParameters(r.utms)},[])}function Tee(e){var r;if(!((r=e==null?void 0:e.attribution)!=null&&r.length))return null;try{const{r:t,utms:a}=JSON.parse(e.attribution);return{attributionData:bi.decodeRValue(t),utms:a}}catch(t){const a=t instanceof Error?t.message:t==null?void 0:t.toString();console.error(a)}}var La=(e=>(e.Lite="lite",e.Auth="auth",e))(La||{});function Ree(e){return{productName:La.Auth,prospectStatus:r=>`${e}/v1/prospects/${r}/trial-status`,createTrial:"/ajax/trials/new",searchProspect:`${e}/v1/search/prospects`,createProspect:"/ajax/trials/prospects",prospectLookups:r=>`${e}/v1/prospects/${r}/lookups`,joinRequest:"/ajax/trials/join-request"}}const QU="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function iD(e,r,t,a){let o,s,u;const p=r||[0],d=(t=t||0)>>>3,h=a===-1?3:0;for(o=0;o<e.length;o+=1)u=o+d,s=u>>>2,p.length<=s&&p.push(0),p[s]|=e[o]<<8*(h+a*(u%4));return{value:p,binLen:8*e.length+t}}function ab(e,r,t){switch(r){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(e){case"HEX":return function(a,o,s){return(function(u,p,d,h){let f,c,_,E;if(u.length%2!=0)throw new Error("String of HEX type must be in byte increments");const S=p||[0],w=(d=d||0)>>>3,R=h===-1?3:0;for(f=0;f<u.length;f+=2){if(c=parseInt(u.substr(f,2),16),isNaN(c))throw new Error("String of HEX type contains invalid characters");for(E=(f>>>1)+w,_=E>>>2;S.length<=_;)S.push(0);S[_]|=c<<8*(R+h*(E%4))}return{value:S,binLen:4*u.length+d}})(a,o,s,t)};case"TEXT":return function(a,o,s){return(function(u,p,d,h,f){let c,_,E,S,w,R,b,I,m=0;const v=d||[0],y=(h=h||0)>>>3;if(p==="UTF8")for(b=f===-1?3:0,E=0;E<u.length;E+=1)for(c=u.charCodeAt(E),_=[],128>c?_.push(c):2048>c?(_.push(192|c>>>6),_.push(128|63&c)):55296>c||57344<=c?_.push(224|c>>>12,128|c>>>6&63,128|63&c):(E+=1,c=65536+((1023&c)<<10|1023&u.charCodeAt(E)),_.push(240|c>>>18,128|c>>>12&63,128|c>>>6&63,128|63&c)),S=0;S<_.length;S+=1){for(R=m+y,w=R>>>2;v.length<=w;)v.push(0);v[w]|=_[S]<<8*(b+f*(R%4)),m+=1}else for(b=f===-1?2:0,I=p==="UTF16LE"&&f!==1||p!=="UTF16LE"&&f===1,E=0;E<u.length;E+=1){for(c=u.charCodeAt(E),I===!0&&(S=255&c,c=S<<8|c>>>8),R=m+y,w=R>>>2;v.length<=w;)v.push(0);v[w]|=c<<8*(b+f*(R%4)),m+=2}return{value:v,binLen:8*m+h}})(a,r,o,s,t)};case"B64":return function(a,o,s){return(function(u,p,d,h){let f,c,_,E,S,w,R,b=0;const I=p||[0],m=(d=d||0)>>>3,v=h===-1?3:0,y=u.indexOf("=");if(u.search(/^[a-zA-Z0-9=+/]+$/)===-1)throw new Error("Invalid character in base-64 string");if(u=u.replace(/=/g,""),y!==-1&&y<u.length)throw new Error("Invalid '=' found in base-64 string");for(c=0;c<u.length;c+=4){for(S=u.substr(c,4),E=0,_=0;_<S.length;_+=1)f=QU.indexOf(S.charAt(_)),E|=f<<18-6*_;for(_=0;_<S.length-1;_+=1){for(R=b+m,w=R>>>2;I.length<=w;)I.push(0);I[w]|=(E>>>16-8*_&255)<<8*(v+h*(R%4)),b+=1}}return{value:I,binLen:8*b+d}})(a,o,s,t)};case"BYTES":return function(a,o,s){return(function(u,p,d,h){let f,c,_,E;const S=p||[0],w=(d=d||0)>>>3,R=h===-1?3:0;for(c=0;c<u.length;c+=1)f=u.charCodeAt(c),E=c+w,_=E>>>2,S.length<=_&&S.push(0),S[_]|=f<<8*(R+h*(E%4));return{value:S,binLen:8*u.length+d}})(a,o,s,t)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch{throw new Error("ARRAYBUFFER not supported by this environment")}return function(a,o,s){return(function(u,p,d,h){return iD(new Uint8Array(u),p,d,h)})(a,o,s,t)};case"UINT8ARRAY":try{new Uint8Array(0)}catch{throw new Error("UINT8ARRAY not supported by this environment")}return function(a,o,s){return iD(a,o,s,t)};default:throw new Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function oD(e,r,t,a){switch(e){case"HEX":return function(o){return(function(s,u,p,d){let h,f,c="";const _=u/8,E=p===-1?3:0;for(h=0;h<_;h+=1)f=s[h>>>2]>>>8*(E+p*(h%4)),c+="0123456789abcdef".charAt(f>>>4&15)+"0123456789abcdef".charAt(15&f);return d.outputUpper?c.toUpperCase():c})(o,r,t,a)};case"B64":return function(o){return(function(s,u,p,d){let h,f,c,_,E,S="";const w=u/8,R=p===-1?3:0;for(h=0;h<w;h+=3)for(_=h+1<w?s[h+1>>>2]:0,E=h+2<w?s[h+2>>>2]:0,c=(s[h>>>2]>>>8*(R+p*(h%4))&255)<<16|(_>>>8*(R+p*((h+1)%4))&255)<<8|E>>>8*(R+p*((h+2)%4))&255,f=0;f<4;f+=1)S+=8*h+6*f<=u?QU.charAt(c>>>6*(3-f)&63):d.b64Pad;return S})(o,r,t,a)};case"BYTES":return function(o){return(function(s,u,p){let d,h,f="";const c=u/8,_=p===-1?3:0;for(d=0;d<c;d+=1)h=s[d>>>2]>>>8*(_+p*(d%4))&255,f+=String.fromCharCode(h);return f})(o,r,t)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch{throw new Error("ARRAYBUFFER not supported by this environment")}return function(o){return(function(s,u,p){let d;const h=u/8,f=new ArrayBuffer(h),c=new Uint8Array(f),_=p===-1?3:0;for(d=0;d<h;d+=1)c[d]=s[d>>>2]>>>8*(_+p*(d%4))&255;return f})(o,r,t)};case"UINT8ARRAY":try{new Uint8Array(0)}catch{throw new Error("UINT8ARRAY not supported by this environment")}return function(o){return(function(s,u,p){let d;const h=u/8,f=p===-1?3:0,c=new Uint8Array(h);for(d=0;d<h;d+=1)c[d]=s[d>>>2]>>>8*(f+p*(d%4))&255;return c})(o,r,t)};default:throw new Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function sD(e){const r={outputUpper:!1,b64Pad:"=",outputLen:-1},t=e||{},a="Output length must be a multiple of 8";if(r.outputUpper=t.outputUpper||!1,t.b64Pad&&(r.b64Pad=t.b64Pad),t.outputLen){if(t.outputLen%8!=0)throw new Error(a);r.outputLen=t.outputLen}else if(t.shakeLen){if(t.shakeLen%8!=0)throw new Error(a);r.outputLen=t.shakeLen}if(typeof r.outputUpper!="boolean")throw new Error("Invalid outputUpper formatting option");if(typeof r.b64Pad!="string")throw new Error("Invalid b64Pad formatting option");return r}function qs(e,r){return e<<r|e>>>32-r}function uD(e,r,t){return e^r^t}function Oee(e,r,t){return e&r^e&t^r&t}function Wu(e,r){const t=(65535&e)+(65535&r);return(65535&(e>>>16)+(r>>>16)+(t>>>16))<<16|65535&t}function jc(e,r,t,a,o){const s=(65535&e)+(65535&r)+(65535&t)+(65535&a)+(65535&o);return(65535&(e>>>16)+(r>>>16)+(t>>>16)+(a>>>16)+(o>>>16)+(s>>>16))<<16|65535&s}function kee(e){return[1732584193,4023233417,2562383102,271733878,3285377520]}function eF(e,r){let t,a,o,s,u,p,d;const h=[];for(t=r[0],a=r[1],o=r[2],s=r[3],u=r[4],d=0;d<80;d+=1)h[d]=d<16?e[d]:qs(h[d-3]^h[d-8]^h[d-14]^h[d-16],1),p=d<20?jc(qs(t,5),(f=a)&o^~f&s,u,1518500249,h[d]):d<40?jc(qs(t,5),uD(a,o,s),u,1859775393,h[d]):d<60?jc(qs(t,5),Oee(a,o,s),u,2400959708,h[d]):jc(qs(t,5),uD(a,o,s),u,3395469782,h[d]),u=s,s=o,o=qs(a,30),a=t,t=p;var f;return r[0]=Wu(t,r[0]),r[1]=Wu(a,r[1]),r[2]=Wu(o,r[2]),r[3]=Wu(s,r[3]),r[4]=Wu(u,r[4]),r}function Pee(e,r,t,a){let o;const s=15+(r+65>>>9<<4),u=r+t;for(;e.length<=s;)e.push(0);for(e[r>>>5]|=128<<24-r%32,e[s]=4294967295&u,e[s-1]=u/4294967296|0,o=0;o<e.length;o+=16)a=eF(e.slice(o,o+16),a);return a}class Nee extends class{constructor(r,t,a){const o=a||{};if(this.t=t,this.i=o.encoding||"UTF8",this.numRounds=o.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw new Error("numRounds must a integer >= 1");this.s=r,this.o=[],this.h=0,this.u=!1,this.l=0,this.A=!1,this.p=[],this.R=[]}update(r){let t,a=0;const o=this.U>>>5,s=this.T(r,this.o,this.h),u=s.binLen,p=s.value,d=u>>>5;for(t=0;t<d;t+=o)a+this.U<=u&&(this.F=this.m(p.slice(t,t+o),this.F),a+=this.U);this.l+=a,this.o=p.slice(a>>>5),this.h=u%this.U,this.u=!0}getHash(r,t){let a,o,s=this.g;const u=sD(t);if(this.B){if(u.outputLen===-1)throw new Error("Output length must be specified in options");s=u.outputLen}const p=oD(r,s,this.v,u);if(this.A&&this.Y)return p(this.Y(u));for(o=this.H(this.o.slice(),this.h,this.l,this.C(this.F),s),a=1;a<this.numRounds;a+=1)this.B&&s%32!=0&&(o[o.length-1]&=16777215>>>24-s%32),o=this.H(o,s,0,this.I(this.s),s);return p(o)}setHMACKey(r,t,a){if(!this.L)throw new Error("Variant does not support HMAC");if(this.u)throw new Error("Cannot set MAC key after calling update");const o=ab(t,(a||{}).encoding||"UTF8",this.v);this.M(o(r))}M(r){const t=this.U>>>3,a=t/4-1;let o;if(this.numRounds!==1)throw new Error("Cannot set numRounds with MAC");if(this.A)throw new Error("MAC key already set");for(t<r.binLen/8&&(r.value=this.H(r.value,r.binLen,0,this.I(this.s),this.g));r.value.length<=a;)r.value.push(0);for(o=0;o<=a;o+=1)this.p[o]=909522486^r.value[o],this.R[o]=1549556828^r.value[o];this.F=this.m(this.p,this.F),this.l=this.U,this.A=!0}getHMAC(r,t){const a=sD(t);return oD(r,this.g,this.v,a)(this.N())}N(){let r;if(!this.A)throw new Error("Cannot call getHMAC without first setting MAC key");const t=this.H(this.o.slice(),this.h,this.l,this.C(this.F),this.g);return r=this.m(this.R,this.I(this.s)),r=this.H(t,this.g,this.U,r,this.g),r}}{constructor(r,t,a){if(r!=="SHA-1")throw new Error("Chosen SHA variant is not supported");super(r,t,a);const o=a||{};this.L=!0,this.Y=this.N,this.v=-1,this.T=ab(this.t,this.i,this.v),this.m=eF,this.C=function(s){return s.slice()},this.I=kee,this.H=Pee,this.F=[1732584193,4023233417,2562383102,271733878,3285377520],this.U=512,this.g=160,this.B=!1,o.hmacKey&&this.M((function(s,u,p,d){const h=s+" must include a value and format";if(!u)throw new Error(h);if(u.value===void 0||!u.format)throw new Error(h);return ab(u.format,u.encoding||"UTF8",p)(u.value)})("hmacKey",o.hmacKey,this.v))}}var pn=(e=>(e.CvApSoutheast1="cv-ap-southeast-1",e.CvApSoutheast2="cv-ap-southeast-2",e.CvEuWest1="cv-eu-west-1",e.CvNaWest1="cv-na-west-1",e))(pn||{});const jee={systemName:pn.CvApSoutheast1},qee={systemName:pn.CvApSoutheast2},Dee={systemName:pn.CvEuWest1},Lee={systemName:pn.CvNaWest1},Mee={CvApSoutheast1:jee,CvApSoutheast2:qee,CvEuWest1:Dee,CvNaWest1:Lee};var rF=(e=>(e.Staff="Staff",e.Learner="Learner",e.Unknown="Unknown",e.System="System",e))(rF||{});const lD=3,Uee=5e3,Fee=6,ib={};class Bee{constructor(r){this.key=r.toString()}getCount(){return ib[this.key]||0}increment(){ib[this.key]=this.getCount()+1}reset(){delete ib[this.key]}shouldBreak(){return this.getCount()>=Fee}}class $ee{constructor(){this.attempt=0}async wait(){await new Promise(r=>setTimeout(r,Uee*Math.pow(2,this.attempt))),this.attempt++}}async function zee(e,r){const t=new $ee,a=new Bee(e);async function o(){const s=await fetch(e,r);if(s.status>=500&&!a.shouldBreak())throw new Error(`Server error: ${s.status}`);return s.ok&&a.reset(),s}for(let s=1;s<=lD;s++)try{return await o()}catch(u){if(s>=lD||a.shouldBreak())throw u;a.increment(),await t.wait()}}var qc,Zee=new Uint8Array(16);function Hee(){if(!qc&&(qc=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!qc))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return qc(Zee)}const Vee=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function H_(e){return typeof e=="string"&&Vee.test(e)}var xn=[];for(var ob=0;ob<256;++ob)xn.push((ob+256).toString(16).substr(1));function Gee(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=(xn[e[r+0]]+xn[e[r+1]]+xn[e[r+2]]+xn[e[r+3]]+"-"+xn[e[r+4]]+xn[e[r+5]]+"-"+xn[e[r+6]]+xn[e[r+7]]+"-"+xn[e[r+8]]+xn[e[r+9]]+"-"+xn[e[r+10]]+xn[e[r+11]]+xn[e[r+12]]+xn[e[r+13]]+xn[e[r+14]]+xn[e[r+15]]).toLowerCase();if(!H_(t))throw TypeError("Stringified UUID is invalid");return t}function Wee(e,r,t){e=e||{};var a=e.random||(e.rng||Hee)();return a[6]=a[6]&15|64,a[8]=a[8]&63|128,Gee(a)}function Kee(e){if(!H_(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}const cD="cv:session:",fD="cv:window:",Yee=new Date(864e13).getTime(),dD=18e5,Jee=4;function tF(e){if(e===zo.LocalStorage)return Tn.isAvailable()?Tn:Y9;if(e===zo.SessionStorage)return K9.isAvailable()?K9:Y9}function hD(e){return e===!1?Yee:new Date().getTime()+e}function Xee(){return Wee()}function Qee(e){return e?new Date().getTime()>e:!1}function ere(e){return!(typeof e!="object"||typeof(e==null?void 0:e.id)!="string"||!H_(e.id)||Kee(e.id)!==Jee||typeof(e==null?void 0:e.ttl)!="number"||(e==null?void 0:e.ttl)<=0||isNaN(e==null?void 0:e.ttl))}function vD(e,r,t){const a=tF(t);if(!(a!=null&&a.isAvailable()))return;const o=e+(r||"0");a.remove(o)}function pD(e,r,t,a){const o=tF(t),s=e+(r||"0"),u=o.get(s);if(!ere(u)||Qee(u==null?void 0:u.ttl)){const d={id:Xee(),ttl:hD(a)};return o.set(s,d),d.id}const p={id:u.id,ttl:hD(a)};return o.set(s,p),u.id}let sb=!1;const gD={getClientSessionData(e){const r=pD(cD,e,zo.LocalStorage,dD),t=pD(fD,e,zo.SessionStorage,sb?!1:dD);return!r&&!t?null:{id:r,windowId:t}},resetClientSession(e){vD(cD,e,zo.LocalStorage),vD(fD,e,zo.SessionStorage)},lockWindowSession(){sb=!0},unlockWindowSession(){sb=!1}},Dc={isObject(e){const r=typeof e;return r==="function"||r==="object"&&!!e},isFunction(e){return typeof e=="function"}},mD={safeUrlConcat(e,r){if(!e)return;let t=e;return e.endsWith("/")||(t+="/"),r&&(t+=r.startsWith("/")?r.slice(1):r),t}},Zr={mobileDevice:/Mobi/i,iphone:/iphone/i,ipad:/ipad/i,android:/android/i,blackberry:/blackberry/i,windowsPhone:/windows phone/i,iosVersion:/OS\s+([\d_.-:]+)\s/i,androidVersion:/android\s+([\d_.-\/]+)[\s;:,\)]/i,blackberryVersion:/(blackberry|version)\s?\d*\/([\d.]+)/i,windowsPhoneVersion:/windows\sphone.*?([\d_.-\/]+)[\s;:,\)]/i,mac:/Mac/i,unix:/X11/i,linux:/Linux/i,windows:/Win/i,win2000:/nt 5.0/i,winXP:/nt 5.1/i,winVista:/nt 6.0/i,win7:/nt 6.1/i,win8:/nt 6.2/i,win81:/nt 6.3/i,win10:/nt 10.0/i,osxVersion:/OS\sX\s([\d_.]+)/i,chrome:/^(?!.*Edge).*Chrome/i,safari:/^(?!.*(?:Chrome|Edge)).*Safari/i,edge:/edge/i,ie:/(msie|trident)/i,opera:/(opr|opera)/i,firefox:/firefox/i,generalVersion:/(chrome|firefox|version)\/(\d+.*?)(\s|$)/i,operaVersion:/(opr|opera)\/(\d+).*?(\s|$)/i,ieVersion:/MSIE\s+(\d+).*?/i,edgeVersion:/(edge)\/(\d+).*?(\s|$)/i},Di="Unknown";function Ds(e,r,t){const a=r.exec(t)||[];let[o]=a;return o||(o=Di),{name:e,version:o}}function Mo(e,r,t){if(!r)return{name:e,version:Di};const a=r.exec(t),o=a&&a.length?a[0].trim():Di;return{name:e,version:o}}function rre(e,r){const t={name:e,version:null};return Zr.win2000.test(r)&&(t.version="2000"),Zr.winXP.test(r)&&(t.version="XP"),Zr.winVista.test(r)&&(t.version="Vista"),Zr.win7.test(r)&&(t.version="7"),Zr.win8.test(r)&&(t.version="8"),Zr.win81.test(r)&&(t.version="8.1"),Zr.win10.test(r)&&(t.version="10"),t.version||(t.version=Di),t}const yD={getDeviceType(){const e=window.navigator.userAgent;return Zr.mobileDevice.test(e)?Zr.iphone.test(e)?"iPhone":Zr.ipad.test(e)?"iPad":Zr.android.test(e)?"Android":Zr.blackberry.test(e)?"Blackberry":Zr.windowsPhone.test(e)?"Windows Phone":Di:"Desktop"},getOperatingSystem(){const e=window.navigator.userAgent;return Zr.android.test(e)?Mo("Android",Zr.androidVersion,e):Zr.iphone.test(e)||Zr.ipad.test(e)?Mo("iOS",Zr.iosVersion,e):Zr.linux.test(e)?Mo("Linux",null,e):Zr.unix.test(e)?Mo("Unix",null,e):Zr.mac.test(e)?Mo("Macintosh",Zr.osxVersion,e):Zr.windows.test(e)?rre("Windows",e):Zr.blackberry.test(e)?Mo("BlackBerry",Zr.blackberryVersion,e):Zr.windowsPhone.test(e)?Mo("Windows Phone",Zr.windowsPhoneVersion,e):{name:Di,version:Di}},getBrowser(){const e=window.navigator.userAgent;return Zr.chrome.test(e)?Ds("Chrome",Zr.generalVersion,e):Zr.firefox.test(e)?Ds("Firefox",Zr.generalVersion,e):Zr.safari.test(e)?Ds("Safari",Zr.generalVersion,e):Zr.ie.test(e)?Ds("Internet Explorer",Zr.ieVersion,e):Zr.edge.test(e)?Ds("Edge",Zr.edgeVersion,e):Zr.opera.test(e)?Ds("Opera",Zr.operaVersion,e):{name:Di,version:Di}},isTouchScreen(){return!!("ontouchstart"in window||navigator.maxTouchPoints)}},tre="2.3.0",nre={version:tre},are="zXJL9nOHxzDlMUDjiP41",bD="unknown";class ire{constructor(r){this.options=r,this.initialize()}initialize(){this.validateOptions(),this.options.logUtmParameters&&(this.utmParameters=ss.getUtmParameters()),this.options.logAttributionData&&(this.attributionData=bi.getDecodedAttributionData())}get name(){return"CollectionApiClient"}async log(r){if(Array.isArray(r))return this.logBulk(r);this.shouldLog(r)&&(this.validateEvent(r),await this.postData(await this.formatData(r)))}async logBulk(r){const t=r.filter(o=>this.shouldLog(o));if(!t.length)return;t.forEach(o=>this.validateEvent(o));const a=await Promise.all(t.map(o=>this.formatData(o)));await this.postData(a)}validateOptions(){if(!Dc.isFunction(this.options.getUser))throw new Error("getUser option is required.")}shouldLog(r){return Dc.isFunction(this.options.shouldLog)?this.options.shouldLog(r):!0}async postData(r){const t=await this.getRegionalUrl(this.options.collectionApiUrls),a=JSON.stringify(r),o={"Content-Type":"application/json",...this.getSignatureHeader(a)};let s=mD.safeUrlConcat(t,"/v1/ingest");Array.isArray(r)&&(s=mD.safeUrlConcat(s,"/bulk"));try{const u=await zee(s,{method:"POST",mode:"cors",headers:o,body:a});u.ok||this.logError(new Error(`CollectionApiClient failed to log event. Status: ${u.status} ${u.statusText}`),!1,this.getResponseAsObject(u))}catch(u){this.logError(u)}}getResponseAsObject(r){return{headers:r.headers,ok:r.ok,redirected:r.redirected,status:r.status,statusText:r.statusText,type:r.type,url:r.url,body:r.text()}}getSignatureHeader(r){const t=new Nee("SHA-1","TEXT",{hmacKey:{value:are,format:"TEXT",encoding:"UTF8"}});return t.update(r),{"cv-analytics-signature":`${this.options.collectionApiClientId}.${t.getHash("B64")}`}}async getRegionalUrl(r){switch((await this.getRegion()).systemName){case pn.CvEuWest1:return r.cvEuWest1;case pn.CvApSoutheast2:return r.cvApSoutheast2;case pn.CvNaWest1:return r.cvNaWest1;case pn.CvApSoutheast1:default:return r.cvApSoutheast1}}validateEvent(r){typeof r.type!="string"&&this.logError(new Error("Event type is required."),!0),Dc.isObject(r.actionContext)||this.logError(new Error("Event actionContext is required."),!0),r.actionContext.entity||this.logError(new Error("Event actionContext entity is required."),!0)}async formatData(r){return{type:r.type,data:await this.getEventData(r),metadata:this.getEventMetadata(r)}}async getEventData(r){const t=r.actionContext,a=this.getPlatformMetadata(),o=await this.getUserData(),s=await this.getSessionData(),u={name:this.options.productName,version:this.options.productVersion};this.options.productVariant&&(u.variant=this.options.productVariant);const p={user:o,action:t,platform:a,product:u,session:s};this.utmParameters&&(p.utm=this.utmParameters);const d=this.extractData(r),h=Object.keys(p).map(c=>c.toLowerCase()),f=Object.keys(d).map(c=>c.toLowerCase());return h.forEach(c=>{f.includes(c)&&this.logError(new Error(`${c} is a reserved key.`),!0)}),{...p,...d}}extractData(r){return Dc.isFunction(this.options.formatData)?this.options.formatData(r):{[r.actionContext.entity]:r.data}}async getUserData(){var t,a,o;let r;try{r=await((a=(t=this.options).getProfileId)==null?void 0:a.call(t))}catch(s){this.logError(s)}try{const s=await this.options.getUser();return s!=null&&s.id?{id:s.id,role:((o=s.role)==null?void 0:o.toLowerCase())||bD,userGroup:(s.userGroup??rF.Unknown).toLowerCase(),yearGroup:this.normalizeYearGroup(s.yearGroup),profileId:r,customer:{id:s.customerId,name:s.customerName,customerGuid:s.customerGuid,crmId:s.crmId,country:s.countryCode,region:await this.getRegion(),openCustomer:!1,accessPolicy:s.accessPolicy}}:r?{profileId:r}:void 0}catch(s){this.logError(s)}}async getRegion(){let r=this.options.regionName;try{const t=await this.options.getUser();t!=null&&t.instanceRegion&&(r=t.instanceRegion)}catch(t){this.logError(t)}return r||this.logError(new Error("RegionName is not set."),!0),this.getRegionByName(r.toLowerCase())}async getSessionData(){try{const r=await this.options.getUser();return{...gD.getClientSessionData(r==null?void 0:r.id),authSessionId:r==null?void 0:r.sessionId}}catch(r){return console.error(r),gD.getClientSessionData(null)}}getPlatformMetadata(){var t,a;const r={url:window.location.href,referrer:document.referrer};return(t=this.attributionData)!=null&&t.internalReferrer&&(r.internalReferrer=this.attributionData.internalReferrer),(a=this.attributionData)!=null&&a.originalReferrer&&(r.originalReferrer=this.attributionData.originalReferrer),{browser:yD.getBrowser(),os:yD.getOperatingSystem(),request:r,screenResolution:`${window.screen.width}x${window.screen.height}`,viewportResolution:`${window.innerWidth}x${window.innerHeight}`}}getEventMetadata(r){return{client:{name:`${this.name}.ts`,version:nre.version,region:this.getRegionByName(this.options.regionName)},timestamp:new Date().toISOString(),eventVersion:r.eventVersion}}getRegionByName(r){let t;return Object.values(Mee).forEach(a=>{a.systemName===r&&(t=a)}),t}normalizeYearGroup(r){return r?r.toLowerCase().split(" ").join("_"):bD}logError(r,t,...a){if(this.options.logError&&this.options.logError(r,...a),t)throw r}}var sn=(e=>(e.Stream="cv_product_stream",e.WebPlayerStream="cv_product_webplayer_stream",e.StreamProgress="cv_product_stream_progress",e.PreviewStreamProgress="cv_product_preview_stream_progress",e.StreamBuffering="cv_product_stream_buffering",e.Login="cv_product_login",e.LoginSsoRedirect="cv_product_login_sso_redirect",e.LoginFailed="cv_product_login_failed",e.Search="cv_product_search",e.InstantSearch="cv_product_instant_search",e.SearchEmptyResult="cv_product_search_empty_result",e.Filter="cv_product_search_filter",e.SearchLanding="cv_product_search_landing",e.Share="cv_product_share",e.Unshare="cv_product_unshare",e.WorkspaceAdd="cv_product_tv_add",e.Rename="cv_product_rename",e.Move="cv_product_move",e.Sort="cv_product_sort",e.Create="cv_product_create",e.Delete="cv_product_delete",e.Associate="cv_product_associate",e.Dissociate="cv_product_dissociate",e.Edit="cv_product_edit",e.Approve="cv_product_approve",e.Reject="cv_product_reject",e.Disable="cv_product_disable",e.Upload="cv_product_upload",e.Download="cv_product_download",e.Navigate="cv_product_navigate",e.Click="cv_product_click",e.Suggest="cv_product_suggest",e.EditAssoc="cv_product_edit_assoc",e.Play="cv_product_play",e.Favourite="cv_product_favourite",e.Follow="cv_product_follow",e.Prefer="cv_product_prefer",e.Print="cv_product_print",e.Copy="cv_product_copy",e.Activate="cv_product_activate",e.VerifyEmail="cv_product_verify_email",e.ChangePassword="cv_product_change_password",e.ManageGroup="cv_product_manage_group",e.Export="cv_product_export",e.SendEmail="cv_product_send_email",e.Publish="cv_product_publish",e.Submit="cv_product_submit",e.Complete="cv_product_complete",e.Archive="cv_product_archive",e.Promote="cv_product_promote",e.Demote="cv_product_demote",e.BulkAction="cv_product_bulk_action",e.Remove="cv_product_remove",e.Dismiss="cv_product_dismiss",e.Open="cv_product_open",e.Hide="cv_product_hide",e.PageView="cv_product_page_view",e.Select="cv_product_select",e.SwitchCustomer="cv_product_switch_customer",e.Focus="cv_product_focus",e.Blur="cv_product_blur",e.Hover="cv_product_hover",e.Unhover="cv_product_unhover",e.SetAccess="cv_product_set_access",e.AddToLocalCache="cv_product_add_to_lc",e.ResolveWarning="cv_product_resolve_warning",e.DismissWarning="cv_product_dismiss_warning",e))(sn||{}),nF=(e=>(e.Folder="folder",e.Video="video",e.Rating="rating",e.Series="series",e.Library="library",e.Resource="resource",e.Tag="tag",e.Subtitle="subtitle",e.Chapter="chapter",e.Resolution="resolution",e.PlaybackSpeed="playback_speed",e.Device="device",e.Restriction="restriction",e.Interactive="interactive",e.Interaction="interaction",e.PDF="pdf",e.CustomerSetting="customer_setting",e.UserSetting="user_setting",e.LibraryRequest="staff_request",e.Logo="logo",e.Pagination="pagination",e.Thumbnail="thumbnail",e.Banner="banner",e.Link="link",e.Playlist="playlist",e.Playlists="playlists",e.Person="person",e.Company="company",e.Classroom="classroom",e.ClassroomGroup="classroom_group",e.Classification="classification",e.ShareLink="share_link",e.DirectShare="direct_share",e.Upload="upload",e.SearchResults="search_results",e.SearchSuggestion="search_suggestion",e.Audience="audience",e.User="user",e.Clip="clip",e.UserChannel="user_channel",e.Widget="widget",e.Url="url",e.SocialShare="social_share",e.Presentation="presentation",e.BatchJob="batch_job",e.DeepLink="deep_link",e.Feedback="feedback",e.AppLink="app_link",e.SignUp="sign_up",e.FileGeneratorJob="file_generator_job",e.ExportLibraries="export_libraries",e.Product="product",e.Customer="customer",e.SpecialEvent="special_event",e.Region="region",e.ProductTip="product_tip",e.Livestream="livestream",e.DevicesCta="devices_cta",e.Integration="integration",e.Faq="faq",e.MixedMedia="mixed_media",e.TableOfContents="table_of_contents",e.Author="author",e.Glance="glance",e.Filter="filter",e.NotificationSetting="notification_setting",e.Transcript="transcript",e.CurriculumCode="curriculum_code",e.Assign="assign",e.PartnerProfile="partner_profile",e))(nF||{}),aF=(e=>(e.TopNav="top_nav",e.LeftNav="left_nav",e.Footer="footer",e.Popup="popup",e.Banner="banner",e.VideoList="video_list",e.VideoListItem="video_list_item",e.VideoListHeader="video_header",e.VideoThumbnail="video_thumbnail",e.ExpandableVideoThumbnail="expandable_video_thumbnail",e.VideoItemPreview="video_item_preview",e.InteractiveItemPreview="interactive_item_preview",e.ClipItemPreview="clip_item_preview",e.VideoDetails="video_details",e.InteractiveDetails="interactive_details",e.ClipDetails="clip_details",e.VideoDetailsHeader="video_details_header",e.EditVideoDetails="edit_video_details",e.EditInteractiveVideoDetails="edit_interactive_video_details",e.EditClipDetails="edit_clip_details",e.EditVideoChapters="edit_video_chapters",e.EditVideoResources="edit_video_resources",e.PreviewVideoResources="preview_video_resources",e.VideoUpload="video_upload",e.VideoRequest="video_request",e.Pagination="pagination",e.LibraryHeader="library_header",e.LibraryTiles="library_tiles",e.LibraryRequestDetails="staff_request_details",e.Libraries="libraries",e.SubFolderList="sub_folder_list",e.AwaitingReviewVideoListHeader="awaiting_review_video_list_header",e.AwaitingReviewVideoItem="awaiting_review_video_item",e.PastReleasesHeader="past_releases_header",e.MigrationWarnings="migration_warnings",e.PlaylistListHeader="playlist_list_header",e.PlaylistListItem="playlist_list_item",e.SeriesListItem="series_list_item",e.SeriesWithVideos="series_with_videos",e.PlaylistWithVideos="playlist_with_videos",e.Dropdown="dropdown",e.ViewCurriculumLinks="view_curriculum_links",e.SearchBar="search_bar",e.InstantSearch="instant_search",e.SearchFilters="search_filters",e.FeaturedSeriesSearchResult="featured_series_search_result",e.ExchangeSearchGroupItem="exchange_search_group_item",e.StaffManager="staff_manager",e.StaffManagerListItem="staff_manager_list_item",e.StudentManager="student_manager",e.ViewStudentVideos="view_student_videos",e.StudentManagerListItem="student_manager_list_item",e.EditUser="edit_user",e.UserAuditLog="user_audit_log",e.BulkUserActionsWizard="bulk_user_actions_wizard",e.BulkUserUploadWizard="bulk_user_upload_wizard",e.Classroom="classroom",e.ClassroomsList="classrooms_list",e.ClassroomsListItem="classrooms_list_item",e.ManageClassroomStudents="manage_classroom_students",e.ManageClassroomStudentListItem="manage_classroom_student_list_item",e.ManageClassroomGroups="manage_classroom_groups",e.ManageClassroomGroupListItem="manage_classroom_group_list_item",e.ManageClassroomTeachers="manage_classroom_teachers",e.ManageClassroomTeacherListItem="manage_classroom_teachers_list_item",e.ArchivedClassrooms="archived_classrooms",e.PreviewInteractive="preview_interactive",e.PreviewSharedInteractive="preview_shared_interactive",e.PreviewInteractiveQuestions="preview_interactive_questions",e.EditInteractive="edit_interactive",e.EditInteractiveDetails="edit_interactive_details",e.PlaySharedInteractive="play_shared_interactive",e.PlayInteractive="play_interactive",e.InteractiveListItem="interactive_list_item",e.DeleteInteractive="delete_interactive",e.NewInteractive="new_interactive",e.CopyInteractive="copy_interactive",e.UnpublishInteractive="unpublish_interactive",e.ShareInteractive="share_interactive",e.PlayPage="play_page",e.Player="player",e.FloatingPlayer="floating_player",e.InteractivePlayer="interactive_player",e.EmbeddedPlayer="embedded_player",e.CreateClipPlayer="create_clip_player",e.PlayClip="play_clip",e.PlaySharedClip="play_shared_clip",e.ClipListItem="clip_list_item",e.ContentUpdatesBanner="content_updates_banner",e.ContentUpdatesClassificationBanner="content_updates_classification_banner",e.PreferencesSettings="preferences_settings",e.NotificationSettings="notification_settings",e.TopicsOnboarding="topics_onboarding",e.MyUploads="my_uploads",e.MyVideos="my_videos",e.SlidingList="sliding_list",e.HeroBannerItem="hero_banner_item",e.SlidingListItem="sliding_list_item",e.ClassificationListItem="classification_list_item",e.ClassificationComingSoon="classification_coming_soon",e.ClassificationHero="classification_hero",e.ClassificationFooter="classification_footer",e.Classification="classification",e.PresentationClassifications="presentation_classifications",e.Dashboard="dashboard",e.DiscoverFooter="discover_footer",e.ProductBanner="product_banner",e.UserOptions="user_options",e.MagicTabs="magic_tabs",e.Settings="settings",e.StudentFeed="student_feed",e.MyShares="my_shares",e.SharedByMe="shared_by_me",e.SharedWithMe="shared_with_me",e.Insights="insights",e.Error="error_view",e.UpgradeForm="upgrade_form",e.ClassroomGuide="classroom_guide",e.TeachingResources="teaching_resources",e.ResourcesGuidancePopup="resources_guidance_popup",e.InteractivesGuidancePopup="interactives_guidance_popup",e.CurriculumGuidancePopup="curriculum_guidance_popup",e.TopVideos="top_videos",e.VideoViewsList="video_views_list",e.VideoOverview="video_overview",e.StudentReachPopup="student_reach_popup",e.LiteUpgradeFeedbackPopup="lite_upgrade_feedback_popup",e.LiteUpgradeBanner="lite_upgrade_banner",e.LiteUpgradeOnboarding="lite_upgrade_onboarding",e.GiveFeedbackPopup="give_feedback_popup",e.LibraryRequestSettings="library_request_settings",e.OpenInAppPrompt="open_in_app_prompt",e.UseAppButton="use_app_button",e.Launchpad="launchpad",e.EditableSubjectPreferencesWidget="editable_subject_preferences_widget",e.ThumbnailHeroMediaWidget="thumbnail_hero_media_widget",e.ThumbnailFixedListMediaLargeWidget="thumbnail_fixed_list_media_large",e.FilterSlidingPillListSmallWidget="filter_sliding_pill_list_small",e.CircleLogoSlidingListWidget="circle_logo_sliding_list_widget",e.RectangularLogoSlidingListWidget="rectangular_logo_sliding_list_widget",e.HeroBannerSmallWidget="hero_banner_small",e.EventIconSlidingListWidget="event_icon_sliding_list_widget",e.OnboardingStepsWidget="onboarding_steps_widget",e.FaqQuestionWidget="faq_question_widget",e.FaqQuestionAccordionWidget="faq_question_accordion_widget",e.SubjectStatsWidgetItem="subject_stats_widget_item",e.AuthorReviewerWidget="author_reviewer_widget",e.ThumbnailFixedListMediaSmallWidget="thumbnail_fixed_list_media_small_widget",e.ThumbnailFixedListFolderSmallWidget="thumbnail_fixed_list_folder_small_widget",e.ThumbnailVerticalListWidget="thumbnail_vertical_list_widget",e.ThumbnailFixedListSmallWidget="thumbnail_fixed_list_small_widget",e.PosterFixedListLargeWidget="poster_fixed_list_large_widget",e.CurriculumResourcesAccordionWidget="curriculum_resources_accordion_widget",e.SearchCurriculumCodeWidget="search_curriculum_code_widget",e.ExchangeLinksWidget="exchange_links_widget",e.TableOfContents="table_of_contents",e.SignUpPopup="sign_up_popup",e.SignUpPage="sign_up_page",e.TrialBanner="trial_banner",e.InviteColleaguePopup="invite_colleague_popup",e.AuthProspectSelect="auth_prospect_select",e.GatedBanner="gated_banner",e.GatedEmptyState="gated_empty_state",e.GatedPopup="gated_popup",e.WelcomePopup="welcome_popup",e.WatchHistoryLanding="watch_history_landing",e.MyFavouritesLanding="my_favourites_landing",e.MyVideoLanding="my_videos_landing",e.PlaylistsLanding="playlists_landing",e.MySharesLanding="myshares_landing",e.PremiumFeatures="premium_features",e.NotificationsDropdown="notifications_dropdown",e.CalendarNav="calendar_nav",e.CalendarDay="calendar_day",e.CalendarPopup="calendar_popup",e.RegionMap="region_map",e.OnboardingWelcomeVideoScreen="onboarding_welcome_video_screen",e.OnboardingSelectRoleScreen="onboarding_select_role_screen",e.OnboardingUsageIntentionScreen="onboarding_usage_intention_screen",e.OnboardingSchoolLevelScreen="onboarding_school_level_screen",e.OnboardingSelectCurriculumScreen="onboarding_select_curriculum_screen",e.OnboardingSubjectsScreen="onboarding_subjects_screen",e.OnboardingSelectVideosScreen="onboarding_select_videos_screen",e.OnboardingCreatePlaylistScreen="onboarding_create_playlist_screen",e.OnboardingSubjectsSummaryScreen="onboarding_subjects_summary_screen",e.ProductTips="product_tips",e.LivestreamBookingForm="booking_form",e.DateRangeFilter="date_range_selector",e.AudienceFilter="audience_filter",e.AssignFlowView="assign_flow_view",e.Global="global",e))(aF||{}),Ua=(e=>(e.Start="start",e.Complete="complete",e.Save="save",e.Discard="discard",e.Next="next",e.Back="back",e))(Ua||{}),Yt=(e=>(e.SignIn="sign_in",e.SignUp="sign_up",e.SignOut="sign_out",e.SwitchAccount="switch_account",e.TopNavButton="top_nav_button",e.Educator="educator",e.Student="student",e.TermsAndConditions="terms_and_conditions",e.PrivacyPolicy="privacy_policy",e.EnterEmail="enter_email",e.ClosePopup="close_popup",e.Back="back",e.UseMyLocation="use_my_location",e.TrialCreated="trial_created",e.TrialRequested="trial_requested",e.DeadEnd="dead_end",e.CantFindSchool="cant_find_school",e.ResendEmail="resend_email",e.ContactUs="contact_us",e.InviteColleague="invite_colleague",e.PremiumFeatures="premium_features",e.Upgrade="upgrade",e.FindSchool="find_school",e.AddToBraze="add_to_braze",e.RequestAccess="request_access",e.AutoJoin="auto_join",e.WrongEmail="wrong_email",e.RequestBdmTrial="request_bdm_trial",e.SkipIdpSelect="skip_idp_select",e))(Yt||{}),iF=(e=>(e[e.V1=1]="V1",e[e.V2=2]="V2",e[e.V3=3]="V3",e[e.V4=4]="V4",e[e.V5=5]="V5",e))(iF||{});const ore={first(e){return Qu(e)},firstFew(e,r){return Qu(e,r)},last(e){return Sb(e)},lastFew(e,r){return Sb(e,r)},max(e,r){return $_(e,r)},cloneAndReplaceAtIdx(e,r,t,a=null){let o=e&&e.length?e.slice():[];return r+1>o.length&&(o=[...o,...Array(r+1-o.length).fill(a)]),o.splice(r,1,t),o},moveItem(e,r,t){const a=e.slice();return a.splice(t,0,a.splice(r,1)[0]),a},isEmpty(e){return e&&!e.length},findIndex(e,r){return Bf(e,r)},findWhere(e,r){return PU(e,r)},where(e,r){return jU(e,r)},groupBy(e,r){return UU(e,r)},countBy(e,r){return FU(e,r)},flatten(e,r){return zU(e,r)},intersection(...e){return HU(...e)},addOrRemove(e,r){const t=e.indexOf(r);return t===-1?e.push(r):e.splice(t,1),e},addOrRemoveImmutable(e,r){const t=e.indexOf(r),a=nl.deepClone(e);return t===-1?[...a,r]:[...a.slice(0,t),...a.slice(t+1)]},sortBy(e,r){return MU(e,r)},chunk(e,r){return VU(e,r)},uniq(e,r){return Gc(e,r)},toObject(e,r){return e.reduce((t,a)=>Object.assign(t,nl.isObject(a)?{[a[r]]:a}:{[r]:a}),{})},findIndexById(e,r){return e.findIndex(t=>t.id===r.id)},removeItem(e,r){const t=this.findIndex(e,r);return t===-1?e:this.removeItemFromIndex(e,t)},removeItemFromIndex(e,r){return[...e.slice(0,r),...e.slice(r+1)]},findMatchedIdIndex(e,r){return e.findIndex(t=>{var a;return((a=t.id)==null?void 0:a.toString())===r.toString()})},shuffle(e){return LU(e)},findLast(e,r){for(let t=e.length-1;t>=0;t--)if(r(e[t]))return e[t]}},Xu="OTHER";function _D(e,r){return r.includes(e)?e:e?Xu:""}function sre(e){const{error:r,onChange:t,countryCode:a,isTertiary:o}=e,s=wM({countryCode:a,isTertiary:o}),u=_D(e.initialValue,s),[p,d]=je.useState(u),[h,f]=je.useState(u===Xu?e.initialValue:"");je.useEffect(()=>{d(_D(e.initialValue,s))},[e.initialValue]);function c(S){d(S.target.value),f(""),t(S.target.value===Xu?"":S.target.value)}function _(S){f(S.target.value),t(S.target.value)}const E=p===Xu;return A.jsxs("div",{className:"form-group",children:[A.jsxs("label",{htmlFor:e.id,className:e.labelClassName,children:["Job title",e.required&&A.jsx("span",{className:"text-danger",children:"*"})]}),A.jsxs("div",{className:"mb-2",children:[A.jsxs("select",{id:e.id,name:e.id,className:`form-select ${e.size==="lg"?"form-select-lg":""} ${p.length?"text-dark":"text-secondary"} ${!!r&&"is-invalid"}`,value:p,placeholder:"Role",onChange:c,children:[A.jsx("option",{value:"",disabled:!0,className:"text-secondary",children:e.placeholder?e.placeholder:A.jsx(A.Fragment,{children:"What do you do?"})}),s.map((S,w)=>A.jsx("option",{value:S,className:"text-dark",children:S},w)),A.jsx("option",{value:Xu,className:"text-dark",children:"Other"})]}),!!r&&!E&&A.jsx(Ht,{name:e.id,children:r})]}),E&&A.jsxs("div",{className:"mb-3",children:[A.jsx("input",{className:`form-control ${e.size==="lg"?"form-select-lg":""} ${!!r&&"is-invalid"}`,type:"text",value:h,placeholder:"What do you do?",autoFocus:!0,onChange:_}),!!r&&A.jsx(Ht,{name:e.id,children:r})]})]})}var Ls=(e=>(e.AU="cv-ap-southeast-1",e.NZ="cv-ap-southeast-2",e.UK="cv-eu-west-1",e.US="cv-na-west-1",e))(Ls||{});const ure=["uk","gb","gg","im","je","ie"],SD={au:Ze.AU,nz:Ze.NZ,us:Ze.US,uk:Ze.UK,ca:Ze.CA,gb:Ze.UK,gg:Ze.UK,im:Ze.UK,je:Ze.UK,ie:Ze.UK,al:Ze.UK,ad:Ze.UK,am:Ze.UK,at:Ze.UK,az:Ze.UK,by:Ze.UK,be:Ze.UK,ba:Ze.UK,bg:Ze.UK,hr:Ze.UK,cy:Ze.UK,cz:Ze.UK,dk:Ze.UK,ee:Ze.UK,fi:Ze.UK,fr:Ze.UK,de:Ze.UK,ge:Ze.UK,gr:Ze.UK,hu:Ze.UK,is:Ze.UK,it:Ze.UK,lv:Ze.UK,li:Ze.UK,lt:Ze.UK,lu:Ze.UK,mt:Ze.UK,md:Ze.UK,mc:Ze.UK,me:Ze.UK,nl:Ze.UK,mk:Ze.UK,no:Ze.UK,pl:Ze.UK,pt:Ze.UK,ro:Ze.UK,ru:Ze.UK,sm:Ze.UK,rs:Ze.UK,sk:Ze.UK,si:Ze.UK,es:Ze.UK,se:Ze.UK,ch:Ze.UK,tr:Ze.UK,ua:Ze.UK,va:Ze.UK},lre={au:pn.CvApSoutheast1,uk:pn.CvEuWest1,us:pn.CvNaWest1,nz:pn.CvApSoutheast2,ca:pn.CvNaWest1},cre={au:Ls.AU,uk:Ls.UK,us:Ls.US,nz:Ls.NZ,ca:Ls.US},Zt={getRegionName(e){const r=Zt.getCountryCode(e);return lre[r]},getInstanceRegion(e){const r=Zt.getCountryCode(e);return cre[r]},getCountryCode(e){const r=SD[e==null?void 0:e.toLowerCase()];return r||Ze.US},isCountryCodeUK(e){return ure.includes(e.toLowerCase())},isCountryCodeAU(e){return(e==null?void 0:e.toLowerCase())===Ze.AU},isCountryCodeUS(e){return(e==null?void 0:e.toLowerCase())===Ze.US},isCountryCodeNZ(e){return(e==null?void 0:e.toLowerCase())===Ze.NZ},isSupportedCountryCode(e){return Object.keys(SD).includes(e==null?void 0:e.toLowerCase())},getLocalizedLocalityPlaceholderPhrase(e){if(e){if(Zt.isCountryCodeUK(e))return"E.g. CR0 3RL or 36 Factory Lane";if(Zt.isCountryCodeAU(e)||Zt.isCountryCodeNZ(e))return"E.g. 2212 or Revesby";if(Zt.isCountryCodeUS(e))return"E.g. 95826 or Sacramento"}},getLocalizedLocalityPlaceholderText(e){if(!e)return;const r=Zt.getLocalizedLocalityPlaceholderPhrase(e);if(r)return r}};function V_(e){if(!e)return{firstName:"",surname:""};const[r,...t]=e.split(" ").filter(a=>a.length);return{firstName:r,surname:t==null?void 0:t.join(" ")}}var ub={exports:{}};/*!
61
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Va(z,Z){(Z==null||Z>z.length)&&(Z=z.length);for(var X=0,te=Array(Z);X<Z;X++)te[X]=z[X];return te}var Xi={removeEmptyKeys:function(z){var Z=this;if(Array.isArray(z))return z;var X=Object.assign({},z);return Object.entries(X).filter((function(te){var J=Ji(te,2)[1];return!(J==null||typeof J=="string"&&!J.length||Ta(J)==="object"&&Object.keys(J).length===0)})).reduce((function(te,J){var ne,ce,ve,Ie=Ji(J,2),ke=Ie[0],sr=Ie[1];return Object.assign(Object.assign({},te),(ne={},ce=ke,ve=sr===Object(sr)?Z.removeEmptyKeys(sr):sr,(ce=(function(jr){var wr=(function(Lr,Ar){if(Ta(Lr)!="object"||!Lr)return Lr;var br=Lr[Symbol.toPrimitive];if(br!==void 0){var Le=br.call(Lr,"string");if(Ta(Le)!="object")return Le;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(Lr)})(jr);return Ta(wr)=="symbol"?wr:wr+""})(ce))in ne?Object.defineProperty(ne,ce,{value:ve,enumerable:!0,configurable:!0,writable:!0}):ne[ce]=ve,ne))}),{})}};function xi(z){return xi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Z){return typeof Z}:function(Z){return Z&&typeof Symbol=="function"&&Z.constructor===Symbol&&Z!==Symbol.prototype?"symbol":typeof Z},xi(z)}function pt(z,Z,X){return(Z=(function(te){var J=(function(ne,ce){if(xi(ne)!="object"||!ne)return ne;var ve=ne[Symbol.toPrimitive];if(ve!==void 0){var Ie=ve.call(ne,"string");if(xi(Ie)!="object")return Ie;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(ne)})(te);return xi(J)=="symbol"?J:J+""})(Z))in z?Object.defineProperty(z,Z,{value:X,enumerable:!0,configurable:!0,writable:!0}):z[Z]=X,z}var Ra={getDefaultUserAttributes:function(z){var Z;return Xi.removeEmptyKeys((pt(Z={},oi.Email,z.email),pt(Z,oi.FirstName,z==null?void 0:z.firstName),pt(Z,oi.LastName,z==null?void 0:z.lastName),pt(Z,oi.Phone,z==null?void 0:z.phone),Z))},getCustomUserAttributesWithoutSource:function(z){var Z,X,te,J,ne,ce,ve,Ie,ke,sr,jr,wr,Lr,Ar,br,Le=Xi.removeEmptyKeys({province:(te=(X=z==null?void 0:z.custom)===null||X===void 0?void 0:X.accountAddress)===null||te===void 0?void 0:te.province,country_code:(ne=(J=z==null?void 0:z.custom)===null||J===void 0?void 0:J.accountAddress)===null||ne===void 0?void 0:ne.countryCode}),ot=(pt(Z={},en.AccountName,(ce=z==null?void 0:z.custom)===null||ce===void 0?void 0:ce.accountName),pt(Z,en.AccountType,(ve=z==null?void 0:z.custom)===null||ve===void 0?void 0:ve.accountType),pt(Z,en.CrmId,(Ie=z==null?void 0:z.custom)===null||Ie===void 0?void 0:Ie.crmId),pt(Z,en.Department,(ke=z==null?void 0:z.custom)===null||ke===void 0?void 0:ke.department),pt(Z,en.JobTitle,(sr=z==null?void 0:z.custom)===null||sr===void 0?void 0:sr.jobTitle),pt(Z,en.MasterId,(jr=z==null?void 0:z.custom)===null||jr===void 0?void 0:jr.masterId),pt(Z,en.OrgSubType,(wr=z==null?void 0:z.custom)===null||wr===void 0?void 0:wr.orgSubType),pt(Z,en.OrgType,(Lr=z==null?void 0:z.custom)===null||Lr===void 0?void 0:Lr.orgType),pt(Z,en.SyncToCrm,(Ar=z==null?void 0:z.custom)===null||Ar===void 0?void 0:Ar.syncToCrm),pt(Z,en.Topic,(br=z==null?void 0:z.custom)===null||br===void 0?void 0:br.topic),Z);return Mt.accountAddress(Le)&&(ot[en.AccountAddress]=Le),Xi.removeEmptyKeys(ot)},getCustomUserAttributes:function(z){var Z=Ra.getCustomUserAttributesWithoutSource(z),X=Xi.removeEmptyKeys(Object.assign(Object.assign({},Z),pt({},en.Source,(function(te){var J;if(!((J=te.custom)===null||J===void 0)&&J.source&&te.custom.source.length){var ne=Object.keys(Ra.getDefaultUserAttributes(te)),ce=Object.keys(Ra.getCustomUserAttributesWithoutSource(te));return{$add:[{name:te.custom.source,attributes:[].concat(ne,ce)}]}}it("No source provided for braze user.")})(z))));return X},getEventUserAttributes:function(z){var Z,X,te,J,ne,ce,ve,Ie,ke;return Xi.removeEmptyKeys((pt(Z={},bn.AccountCity,(X=z==null?void 0:z.event)===null||X===void 0?void 0:X.accountCity),pt(Z,bn.AccountCountry,(te=z==null?void 0:z.event)===null||te===void 0?void 0:te.accountCity),pt(Z,bn.AccountPostCode,(J=z==null?void 0:z.event)===null||J===void 0?void 0:J.accountPostCode),pt(Z,bn.AccountState,(ne=z==null?void 0:z.event)===null||ne===void 0?void 0:ne.accountState),pt(Z,bn.ContactUsComment,(ce=z==null?void 0:z.event)===null||ce===void 0?void 0:ce.contactUsComment),pt(Z,bn.EventTopic,(ve=z==null?void 0:z.event)===null||ve===void 0?void 0:ve.eventTopic),pt(Z,bn.HowCanWeHelp,(Ie=z==null?void 0:z.event)===null||Ie===void 0?void 0:Ie.howCanWeHelp),pt(Z,bn.ReasonForInterest,(ke=z==null?void 0:z.event)===null||ke===void 0?void 0:ke.reasonForInterest),Z))},getExtraUserAttributes:function(z){return xi(z.extra)!=="object"?{}:Xi.removeEmptyKeys(z.extra)},getPayload:function(z){if(!z)return{};var Z=Ra.getDefaultUserAttributes(z),X=Ra.getCustomUserAttributes(z),te=Ra.getEventUserAttributes(z),J=Ra.getExtraUserAttributes(z),ne=Mt.additionalData(J),ce=Object.assign(Object.assign(Object.assign({},Z),X),te);return ne?Object.assign(Object.assign({},ce),J):ce},getEmailHash:function(z){var Z=z.trim().toLowerCase();return li().hash(Z)}};function Qi(z){return Qi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Z){return typeof Z}:function(Z){return Z&&typeof Symbol=="function"&&Z.constructor===Symbol&&Z!==Symbol.prototype?"symbol":typeof Z},Qi(z)}function vs(z,Z){for(var X=0;X<Z.length;X++){var te=Z[X];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(z,jl(te.key),te)}}function jl(z){var Z=(function(X,te){if(Qi(X)!="object"||!X)return X;var J=X[Symbol.toPrimitive];if(J!==void 0){var ne=J.call(X,"string");if(Qi(ne)!="object")return ne;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(X)})(z);return Qi(Z)=="symbol"?Z:Z+""}var Hf=(function(){function z(te){var J=te.apiOptions,ne=te.shouldInitialize,ce=ne===void 0||ne,ve=te.allowAnonymous,Ie=ve!==void 0&&ve,ke=te.subscriptions;(function(sr,jr){if(!(sr instanceof jr))throw new TypeError("Cannot call a class as a function")})(this,z),this.initialized=!1,this.apiOptions=J,this.subscriptions=ke,this.allowAnonymous=Ie,ce&&this.initialize()}var Z,X;return Z=z,(X=[{key:"initialize",value:function(){var te=this;this.isInitialized()?(function(J){for(var ne=arguments.length,ce=new Array(ne>1?ne-1:0),ve=1;ve<ne;ve++)ce[ve-1]=arguments[ve];console.warn(J,ce)})("BrazeClient has already been initialized!"):(this.apiClient=yn.getInstance(this.apiOptions),this.cardsModule=new fn({apiClient:this.apiClient}),this.bamModule=new pu({apiClient:this.apiClient}),this.eventModule=new si({apiClient:this.apiClient,getPayload:function(){return Ra.getPayload(te.user)}}),this.initialized=!0)}},{key:"isInitialized",value:function(){return this.initialized}},{key:"getUser",value:function(){return this.isInitialized()?this.validateUser()?this.user:null:(cn("BrazeClient has not been initialized."),null)}},{key:"card",get:function(){return this.isInitialized()?this.cardsModule:(cn("BrazeClient has not been initialized."),null)}},{key:"bam",get:function(){return this.isInitialized()?this.bamModule:(cn("BrazeClient has not been initialized."),null)}},{key:"event",get:function(){return this.isInitialized()?this.allowAnonymous||this.validateUser()?this.eventModule:(cn("Anon events are disabled! Please invoke `setUser` before logging events!"),null):(cn("BrazeClient has not been initialized."),null)}},{key:"setUser",value:function(te){this.isInitialized()?(this.user=te,this.startSession(),this.logUserAttributes()):cn("Trying to `setUser` but the client has not been initialized")}},{key:"setUserInit",value:function(te){this.isInitialized()||this.initialize(),this.setUser(te)}},{key:"allowAnonymousSessions",value:function(){this.allowAnonymous=!0}},{key:"api",value:function(){return this.isInitialized()?this.apiClient:null}},{key:"setEmailNotificationSubscriptionType",value:function(te){return this.isInitialized()&&this.validateUser()?this.apiClient.setUserEmailNotificationSubscriptionType(te):null}},{key:"validateUser",value:function(){return!!this.user||(cn("No user has been set!"),!1)}},{key:"startSession",value:function(){this.allowAnonymous||this.validateUser()?(this.enableSubscriptions(),this.user?(this.apiClient.setUser(Ra.getEmailHash(this.user.email)),this.apiClient.openSession()):this.apiClient.openSession()):cn("No user provided and cannot start anonymous sessions!")}},{key:"enableSubscriptions",value:function(){var te,J;!((te=this.subscriptions)===null||te===void 0)&&te.subscribeToInAppMessage&&typeof this.subscriptions.subscribeToInAppMessage=="function"&&this.apiClient.subscribeToInAppMessage(this.subscriptions.subscribeToInAppMessage),!((J=this.subscriptions)===null||J===void 0)&&J.subscribeToContentCards&&typeof this.subscriptions.subscribeToContentCards=="function"&&this.apiClient.subscribeToContentCardUpdate(this.subscriptions.subscribeToContentCards)}},{key:"logUserAttributes",value:function(){if(this.validateUser()){this.apiClient.setUserEmail(this.user.email),this.user.firstName&&this.apiClient.setUserFirstName(this.user.firstName),this.user.lastName&&this.apiClient.setUserLastName(this.user.lastName),this.user.phone&&this.apiClient.setUserPhone(this.user.phone),this.user.country&&this.apiClient.setUserCountry(this.user.country);var te=Ra.getCustomUserAttributes(this.user);this.apiClient.bulkSetCustomUserAttributes(te)}}}])&&vs(Z.prototype,X),Object.defineProperty(Z,"prototype",{writable:!1}),z})();function xo(z){return yn.getInstance(z)}})(),p})()))})(nb)),nb.exports}var Tl=Iee();function Aee(e){Nr.useEffect(()=>{const r=Tee(e==null?void 0:e.additionalData);r!=null&&r.attributionData&&bi.setAttributionData(r.attributionData),r!=null&&r.utms&&ss.setUtmParameters(r.utms)},[])}function Tee(e){var r;if(!((r=e==null?void 0:e.attribution)!=null&&r.length))return null;try{const{r:t,utms:a}=JSON.parse(e.attribution);return{attributionData:bi.decodeRValue(t),utms:a}}catch(t){const a=t instanceof Error?t.message:t==null?void 0:t.toString();console.error(a)}}var La=(e=>(e.Lite="lite",e.Auth="auth",e))(La||{});function Ree(e){return{productName:La.Auth,prospectStatus:r=>`${e}/v1/prospects/${r}/trial-status`,createTrial:"/ajax/trials/new",searchProspect:`${e}/v1/search/prospects`,createProspect:"/ajax/trials/prospects",prospectLookups:r=>`${e}/v1/prospects/${r}/lookups`,joinRequest:"/ajax/trials/join-request"}}const QU="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function iD(e,r,t,a){let o,s,u;const p=r||[0],d=(t=t||0)>>>3,h=a===-1?3:0;for(o=0;o<e.length;o+=1)u=o+d,s=u>>>2,p.length<=s&&p.push(0),p[s]|=e[o]<<8*(h+a*(u%4));return{value:p,binLen:8*e.length+t}}function ab(e,r,t){switch(r){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(e){case"HEX":return function(a,o,s){return(function(u,p,d,h){let f,c,_,E;if(u.length%2!=0)throw new Error("String of HEX type must be in byte increments");const S=p||[0],w=(d=d||0)>>>3,R=h===-1?3:0;for(f=0;f<u.length;f+=2){if(c=parseInt(u.substr(f,2),16),isNaN(c))throw new Error("String of HEX type contains invalid characters");for(E=(f>>>1)+w,_=E>>>2;S.length<=_;)S.push(0);S[_]|=c<<8*(R+h*(E%4))}return{value:S,binLen:4*u.length+d}})(a,o,s,t)};case"TEXT":return function(a,o,s){return(function(u,p,d,h,f){let c,_,E,S,w,R,b,I,m=0;const v=d||[0],y=(h=h||0)>>>3;if(p==="UTF8")for(b=f===-1?3:0,E=0;E<u.length;E+=1)for(c=u.charCodeAt(E),_=[],128>c?_.push(c):2048>c?(_.push(192|c>>>6),_.push(128|63&c)):55296>c||57344<=c?_.push(224|c>>>12,128|c>>>6&63,128|63&c):(E+=1,c=65536+((1023&c)<<10|1023&u.charCodeAt(E)),_.push(240|c>>>18,128|c>>>12&63,128|c>>>6&63,128|63&c)),S=0;S<_.length;S+=1){for(R=m+y,w=R>>>2;v.length<=w;)v.push(0);v[w]|=_[S]<<8*(b+f*(R%4)),m+=1}else for(b=f===-1?2:0,I=p==="UTF16LE"&&f!==1||p!=="UTF16LE"&&f===1,E=0;E<u.length;E+=1){for(c=u.charCodeAt(E),I===!0&&(S=255&c,c=S<<8|c>>>8),R=m+y,w=R>>>2;v.length<=w;)v.push(0);v[w]|=c<<8*(b+f*(R%4)),m+=2}return{value:v,binLen:8*m+h}})(a,r,o,s,t)};case"B64":return function(a,o,s){return(function(u,p,d,h){let f,c,_,E,S,w,R,b=0;const I=p||[0],m=(d=d||0)>>>3,v=h===-1?3:0,y=u.indexOf("=");if(u.search(/^[a-zA-Z0-9=+/]+$/)===-1)throw new Error("Invalid character in base-64 string");if(u=u.replace(/=/g,""),y!==-1&&y<u.length)throw new Error("Invalid '=' found in base-64 string");for(c=0;c<u.length;c+=4){for(S=u.substr(c,4),E=0,_=0;_<S.length;_+=1)f=QU.indexOf(S.charAt(_)),E|=f<<18-6*_;for(_=0;_<S.length-1;_+=1){for(R=b+m,w=R>>>2;I.length<=w;)I.push(0);I[w]|=(E>>>16-8*_&255)<<8*(v+h*(R%4)),b+=1}}return{value:I,binLen:8*b+d}})(a,o,s,t)};case"BYTES":return function(a,o,s){return(function(u,p,d,h){let f,c,_,E;const S=p||[0],w=(d=d||0)>>>3,R=h===-1?3:0;for(c=0;c<u.length;c+=1)f=u.charCodeAt(c),E=c+w,_=E>>>2,S.length<=_&&S.push(0),S[_]|=f<<8*(R+h*(E%4));return{value:S,binLen:8*u.length+d}})(a,o,s,t)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch{throw new Error("ARRAYBUFFER not supported by this environment")}return function(a,o,s){return(function(u,p,d,h){return iD(new Uint8Array(u),p,d,h)})(a,o,s,t)};case"UINT8ARRAY":try{new Uint8Array(0)}catch{throw new Error("UINT8ARRAY not supported by this environment")}return function(a,o,s){return iD(a,o,s,t)};default:throw new Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function oD(e,r,t,a){switch(e){case"HEX":return function(o){return(function(s,u,p,d){let h,f,c="";const _=u/8,E=p===-1?3:0;for(h=0;h<_;h+=1)f=s[h>>>2]>>>8*(E+p*(h%4)),c+="0123456789abcdef".charAt(f>>>4&15)+"0123456789abcdef".charAt(15&f);return d.outputUpper?c.toUpperCase():c})(o,r,t,a)};case"B64":return function(o){return(function(s,u,p,d){let h,f,c,_,E,S="";const w=u/8,R=p===-1?3:0;for(h=0;h<w;h+=3)for(_=h+1<w?s[h+1>>>2]:0,E=h+2<w?s[h+2>>>2]:0,c=(s[h>>>2]>>>8*(R+p*(h%4))&255)<<16|(_>>>8*(R+p*((h+1)%4))&255)<<8|E>>>8*(R+p*((h+2)%4))&255,f=0;f<4;f+=1)S+=8*h+6*f<=u?QU.charAt(c>>>6*(3-f)&63):d.b64Pad;return S})(o,r,t,a)};case"BYTES":return function(o){return(function(s,u,p){let d,h,f="";const c=u/8,_=p===-1?3:0;for(d=0;d<c;d+=1)h=s[d>>>2]>>>8*(_+p*(d%4))&255,f+=String.fromCharCode(h);return f})(o,r,t)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch{throw new Error("ARRAYBUFFER not supported by this environment")}return function(o){return(function(s,u,p){let d;const h=u/8,f=new ArrayBuffer(h),c=new Uint8Array(f),_=p===-1?3:0;for(d=0;d<h;d+=1)c[d]=s[d>>>2]>>>8*(_+p*(d%4))&255;return f})(o,r,t)};case"UINT8ARRAY":try{new Uint8Array(0)}catch{throw new Error("UINT8ARRAY not supported by this environment")}return function(o){return(function(s,u,p){let d;const h=u/8,f=p===-1?3:0,c=new Uint8Array(h);for(d=0;d<h;d+=1)c[d]=s[d>>>2]>>>8*(f+p*(d%4))&255;return c})(o,r,t)};default:throw new Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function sD(e){const r={outputUpper:!1,b64Pad:"=",outputLen:-1},t=e||{},a="Output length must be a multiple of 8";if(r.outputUpper=t.outputUpper||!1,t.b64Pad&&(r.b64Pad=t.b64Pad),t.outputLen){if(t.outputLen%8!=0)throw new Error(a);r.outputLen=t.outputLen}else if(t.shakeLen){if(t.shakeLen%8!=0)throw new Error(a);r.outputLen=t.shakeLen}if(typeof r.outputUpper!="boolean")throw new Error("Invalid outputUpper formatting option");if(typeof r.b64Pad!="string")throw new Error("Invalid b64Pad formatting option");return r}function qs(e,r){return e<<r|e>>>32-r}function uD(e,r,t){return e^r^t}function Oee(e,r,t){return e&r^e&t^r&t}function Wu(e,r){const t=(65535&e)+(65535&r);return(65535&(e>>>16)+(r>>>16)+(t>>>16))<<16|65535&t}function jc(e,r,t,a,o){const s=(65535&e)+(65535&r)+(65535&t)+(65535&a)+(65535&o);return(65535&(e>>>16)+(r>>>16)+(t>>>16)+(a>>>16)+(o>>>16)+(s>>>16))<<16|65535&s}function kee(e){return[1732584193,4023233417,2562383102,271733878,3285377520]}function eF(e,r){let t,a,o,s,u,p,d;const h=[];for(t=r[0],a=r[1],o=r[2],s=r[3],u=r[4],d=0;d<80;d+=1)h[d]=d<16?e[d]:qs(h[d-3]^h[d-8]^h[d-14]^h[d-16],1),p=d<20?jc(qs(t,5),(f=a)&o^~f&s,u,1518500249,h[d]):d<40?jc(qs(t,5),uD(a,o,s),u,1859775393,h[d]):d<60?jc(qs(t,5),Oee(a,o,s),u,2400959708,h[d]):jc(qs(t,5),uD(a,o,s),u,3395469782,h[d]),u=s,s=o,o=qs(a,30),a=t,t=p;var f;return r[0]=Wu(t,r[0]),r[1]=Wu(a,r[1]),r[2]=Wu(o,r[2]),r[3]=Wu(s,r[3]),r[4]=Wu(u,r[4]),r}function Pee(e,r,t,a){let o;const s=15+(r+65>>>9<<4),u=r+t;for(;e.length<=s;)e.push(0);for(e[r>>>5]|=128<<24-r%32,e[s]=4294967295&u,e[s-1]=u/4294967296|0,o=0;o<e.length;o+=16)a=eF(e.slice(o,o+16),a);return a}class Nee extends class{constructor(r,t,a){const o=a||{};if(this.t=t,this.i=o.encoding||"UTF8",this.numRounds=o.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw new Error("numRounds must a integer >= 1");this.s=r,this.o=[],this.h=0,this.u=!1,this.l=0,this.A=!1,this.p=[],this.R=[]}update(r){let t,a=0;const o=this.U>>>5,s=this.T(r,this.o,this.h),u=s.binLen,p=s.value,d=u>>>5;for(t=0;t<d;t+=o)a+this.U<=u&&(this.F=this.m(p.slice(t,t+o),this.F),a+=this.U);this.l+=a,this.o=p.slice(a>>>5),this.h=u%this.U,this.u=!0}getHash(r,t){let a,o,s=this.g;const u=sD(t);if(this.B){if(u.outputLen===-1)throw new Error("Output length must be specified in options");s=u.outputLen}const p=oD(r,s,this.v,u);if(this.A&&this.Y)return p(this.Y(u));for(o=this.H(this.o.slice(),this.h,this.l,this.C(this.F),s),a=1;a<this.numRounds;a+=1)this.B&&s%32!=0&&(o[o.length-1]&=16777215>>>24-s%32),o=this.H(o,s,0,this.I(this.s),s);return p(o)}setHMACKey(r,t,a){if(!this.L)throw new Error("Variant does not support HMAC");if(this.u)throw new Error("Cannot set MAC key after calling update");const o=ab(t,(a||{}).encoding||"UTF8",this.v);this.M(o(r))}M(r){const t=this.U>>>3,a=t/4-1;let o;if(this.numRounds!==1)throw new Error("Cannot set numRounds with MAC");if(this.A)throw new Error("MAC key already set");for(t<r.binLen/8&&(r.value=this.H(r.value,r.binLen,0,this.I(this.s),this.g));r.value.length<=a;)r.value.push(0);for(o=0;o<=a;o+=1)this.p[o]=909522486^r.value[o],this.R[o]=1549556828^r.value[o];this.F=this.m(this.p,this.F),this.l=this.U,this.A=!0}getHMAC(r,t){const a=sD(t);return oD(r,this.g,this.v,a)(this.N())}N(){let r;if(!this.A)throw new Error("Cannot call getHMAC without first setting MAC key");const t=this.H(this.o.slice(),this.h,this.l,this.C(this.F),this.g);return r=this.m(this.R,this.I(this.s)),r=this.H(t,this.g,this.U,r,this.g),r}}{constructor(r,t,a){if(r!=="SHA-1")throw new Error("Chosen SHA variant is not supported");super(r,t,a);const o=a||{};this.L=!0,this.Y=this.N,this.v=-1,this.T=ab(this.t,this.i,this.v),this.m=eF,this.C=function(s){return s.slice()},this.I=kee,this.H=Pee,this.F=[1732584193,4023233417,2562383102,271733878,3285377520],this.U=512,this.g=160,this.B=!1,o.hmacKey&&this.M((function(s,u,p,d){const h=s+" must include a value and format";if(!u)throw new Error(h);if(u.value===void 0||!u.format)throw new Error(h);return ab(u.format,u.encoding||"UTF8",p)(u.value)})("hmacKey",o.hmacKey,this.v))}}var pn=(e=>(e.CvApSoutheast1="cv-ap-southeast-1",e.CvApSoutheast2="cv-ap-southeast-2",e.CvEuWest1="cv-eu-west-1",e.CvNaWest1="cv-na-west-1",e))(pn||{});const jee={systemName:pn.CvApSoutheast1},qee={systemName:pn.CvApSoutheast2},Dee={systemName:pn.CvEuWest1},Lee={systemName:pn.CvNaWest1},Mee={CvApSoutheast1:jee,CvApSoutheast2:qee,CvEuWest1:Dee,CvNaWest1:Lee};var rF=(e=>(e.Staff="Staff",e.Learner="Learner",e.Unknown="Unknown",e.System="System",e))(rF||{});const lD=3,Uee=5e3,Fee=6,ib={};class Bee{constructor(r){this.key=r.toString()}getCount(){return ib[this.key]||0}increment(){ib[this.key]=this.getCount()+1}reset(){delete ib[this.key]}shouldBreak(){return this.getCount()>=Fee}}class $ee{constructor(){this.attempt=0}async wait(){await new Promise(r=>setTimeout(r,Uee*Math.pow(2,this.attempt))),this.attempt++}}async function zee(e,r){const t=new $ee,a=new Bee(e);async function o(){const s=await fetch(e,r);if(s.status>=500&&!a.shouldBreak())throw new Error(`Server error: ${s.status}`);return s.ok&&a.reset(),s}for(let s=1;s<=lD;s++)try{return await o()}catch(u){if(s>=lD||a.shouldBreak())throw u;a.increment(),await t.wait()}}var qc,Zee=new Uint8Array(16);function Hee(){if(!qc&&(qc=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!qc))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return qc(Zee)}const Vee=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function H_(e){return typeof e=="string"&&Vee.test(e)}var xn=[];for(var ob=0;ob<256;++ob)xn.push((ob+256).toString(16).substr(1));function Gee(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=(xn[e[r+0]]+xn[e[r+1]]+xn[e[r+2]]+xn[e[r+3]]+"-"+xn[e[r+4]]+xn[e[r+5]]+"-"+xn[e[r+6]]+xn[e[r+7]]+"-"+xn[e[r+8]]+xn[e[r+9]]+"-"+xn[e[r+10]]+xn[e[r+11]]+xn[e[r+12]]+xn[e[r+13]]+xn[e[r+14]]+xn[e[r+15]]).toLowerCase();if(!H_(t))throw TypeError("Stringified UUID is invalid");return t}function Wee(e,r,t){e=e||{};var a=e.random||(e.rng||Hee)();return a[6]=a[6]&15|64,a[8]=a[8]&63|128,Gee(a)}function Kee(e){if(!H_(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}const cD="cv:session:",fD="cv:window:",Yee=new Date(864e13).getTime(),dD=18e5,Jee=4;function tF(e){if(e===zo.LocalStorage)return Tn.isAvailable()?Tn:Y9;if(e===zo.SessionStorage)return K9.isAvailable()?K9:Y9}function hD(e){return e===!1?Yee:new Date().getTime()+e}function Xee(){return Wee()}function Qee(e){return e?new Date().getTime()>e:!1}function ere(e){return!(typeof e!="object"||typeof(e==null?void 0:e.id)!="string"||!H_(e.id)||Kee(e.id)!==Jee||typeof(e==null?void 0:e.ttl)!="number"||(e==null?void 0:e.ttl)<=0||isNaN(e==null?void 0:e.ttl))}function vD(e,r,t){const a=tF(t);if(!(a!=null&&a.isAvailable()))return;const o=e+(r||"0");a.remove(o)}function pD(e,r,t,a){const o=tF(t),s=e+(r||"0"),u=o.get(s);if(!ere(u)||Qee(u==null?void 0:u.ttl)){const d={id:Xee(),ttl:hD(a)};return o.set(s,d),d.id}const p={id:u.id,ttl:hD(a)};return o.set(s,p),u.id}let sb=!1;const gD={getClientSessionData(e){const r=pD(cD,e,zo.LocalStorage,dD),t=pD(fD,e,zo.SessionStorage,sb?!1:dD);return!r&&!t?null:{id:r,windowId:t}},resetClientSession(e){vD(cD,e,zo.LocalStorage),vD(fD,e,zo.SessionStorage)},lockWindowSession(){sb=!0},unlockWindowSession(){sb=!1}},Dc={isObject(e){const r=typeof e;return r==="function"||r==="object"&&!!e},isFunction(e){return typeof e=="function"}},mD={safeUrlConcat(e,r){if(!e)return;let t=e;return e.endsWith("/")||(t+="/"),r&&(t+=r.startsWith("/")?r.slice(1):r),t}},Zr={mobileDevice:/Mobi/i,iphone:/iphone/i,ipad:/ipad/i,android:/android/i,blackberry:/blackberry/i,windowsPhone:/windows phone/i,iosVersion:/OS\s+([\d_.-:]+)\s/i,androidVersion:/android\s+([\d_.-\/]+)[\s;:,\)]/i,blackberryVersion:/(blackberry|version)\s?\d*\/([\d.]+)/i,windowsPhoneVersion:/windows\sphone.*?([\d_.-\/]+)[\s;:,\)]/i,mac:/Mac/i,unix:/X11/i,linux:/Linux/i,windows:/Win/i,win2000:/nt 5.0/i,winXP:/nt 5.1/i,winVista:/nt 6.0/i,win7:/nt 6.1/i,win8:/nt 6.2/i,win81:/nt 6.3/i,win10:/nt 10.0/i,osxVersion:/OS\sX\s([\d_.]+)/i,chrome:/^(?!.*Edge).*Chrome/i,safari:/^(?!.*(?:Chrome|Edge)).*Safari/i,edge:/edge/i,ie:/(msie|trident)/i,opera:/(opr|opera)/i,firefox:/firefox/i,generalVersion:/(chrome|firefox|version)\/(\d+.*?)(\s|$)/i,operaVersion:/(opr|opera)\/(\d+).*?(\s|$)/i,ieVersion:/MSIE\s+(\d+).*?/i,edgeVersion:/(edge)\/(\d+).*?(\s|$)/i},Di="Unknown";function Ds(e,r,t){const a=r.exec(t)||[];let[o]=a;return o||(o=Di),{name:e,version:o}}function Mo(e,r,t){if(!r)return{name:e,version:Di};const a=r.exec(t),o=a&&a.length?a[0].trim():Di;return{name:e,version:o}}function rre(e,r){const t={name:e,version:null};return Zr.win2000.test(r)&&(t.version="2000"),Zr.winXP.test(r)&&(t.version="XP"),Zr.winVista.test(r)&&(t.version="Vista"),Zr.win7.test(r)&&(t.version="7"),Zr.win8.test(r)&&(t.version="8"),Zr.win81.test(r)&&(t.version="8.1"),Zr.win10.test(r)&&(t.version="10"),t.version||(t.version=Di),t}const yD={getDeviceType(){const e=window.navigator.userAgent;return Zr.mobileDevice.test(e)?Zr.iphone.test(e)?"iPhone":Zr.ipad.test(e)?"iPad":Zr.android.test(e)?"Android":Zr.blackberry.test(e)?"Blackberry":Zr.windowsPhone.test(e)?"Windows Phone":Di:"Desktop"},getOperatingSystem(){const e=window.navigator.userAgent;return Zr.android.test(e)?Mo("Android",Zr.androidVersion,e):Zr.iphone.test(e)||Zr.ipad.test(e)?Mo("iOS",Zr.iosVersion,e):Zr.linux.test(e)?Mo("Linux",null,e):Zr.unix.test(e)?Mo("Unix",null,e):Zr.mac.test(e)?Mo("Macintosh",Zr.osxVersion,e):Zr.windows.test(e)?rre("Windows",e):Zr.blackberry.test(e)?Mo("BlackBerry",Zr.blackberryVersion,e):Zr.windowsPhone.test(e)?Mo("Windows Phone",Zr.windowsPhoneVersion,e):{name:Di,version:Di}},getBrowser(){const e=window.navigator.userAgent;return Zr.chrome.test(e)?Ds("Chrome",Zr.generalVersion,e):Zr.firefox.test(e)?Ds("Firefox",Zr.generalVersion,e):Zr.safari.test(e)?Ds("Safari",Zr.generalVersion,e):Zr.ie.test(e)?Ds("Internet Explorer",Zr.ieVersion,e):Zr.edge.test(e)?Ds("Edge",Zr.edgeVersion,e):Zr.opera.test(e)?Ds("Opera",Zr.operaVersion,e):{name:Di,version:Di}},isTouchScreen(){return!!("ontouchstart"in window||navigator.maxTouchPoints)}},tre="2.3.0",nre={version:tre},are="zXJL9nOHxzDlMUDjiP41",bD="unknown";class ire{constructor(r){this.options=r,this.initialize()}initialize(){this.validateOptions(),this.options.logUtmParameters&&(this.utmParameters=ss.getUtmParameters()),this.options.logAttributionData&&(this.attributionData=bi.getDecodedAttributionData())}get name(){return"CollectionApiClient"}async log(r){if(Array.isArray(r))return this.logBulk(r);this.shouldLog(r)&&(this.validateEvent(r),await this.postData(await this.formatData(r)))}async logBulk(r){const t=r.filter(o=>this.shouldLog(o));if(!t.length)return;t.forEach(o=>this.validateEvent(o));const a=await Promise.all(t.map(o=>this.formatData(o)));await this.postData(a)}validateOptions(){if(!Dc.isFunction(this.options.getUser))throw new Error("getUser option is required.")}shouldLog(r){return Dc.isFunction(this.options.shouldLog)?this.options.shouldLog(r):!0}async postData(r){const t=await this.getRegionalUrl(this.options.collectionApiUrls),a=JSON.stringify(r),o={"Content-Type":"application/json",...this.getSignatureHeader(a)};let s=mD.safeUrlConcat(t,"/v1/ingest");Array.isArray(r)&&(s=mD.safeUrlConcat(s,"/bulk"));try{const u=await zee(s,{method:"POST",mode:"cors",headers:o,body:a});u.ok||this.logError(new Error(`CollectionApiClient failed to log event. Status: ${u.status} ${u.statusText}`),!1,this.getResponseAsObject(u))}catch(u){this.logError(u)}}getResponseAsObject(r){return{headers:r.headers,ok:r.ok,redirected:r.redirected,status:r.status,statusText:r.statusText,type:r.type,url:r.url,body:r.text()}}getSignatureHeader(r){const t=new Nee("SHA-1","TEXT",{hmacKey:{value:are,format:"TEXT",encoding:"UTF8"}});return t.update(r),{"cv-analytics-signature":`${this.options.collectionApiClientId}.${t.getHash("B64")}`}}async getRegionalUrl(r){switch((await this.getRegion()).systemName){case pn.CvEuWest1:return r.cvEuWest1;case pn.CvApSoutheast2:return r.cvApSoutheast2;case pn.CvNaWest1:return r.cvNaWest1;case pn.CvApSoutheast1:default:return r.cvApSoutheast1}}validateEvent(r){typeof r.type!="string"&&this.logError(new Error("Event type is required."),!0),Dc.isObject(r.actionContext)||this.logError(new Error("Event actionContext is required."),!0),r.actionContext.entity||this.logError(new Error("Event actionContext entity is required."),!0)}async formatData(r){return{type:r.type,data:await this.getEventData(r),metadata:this.getEventMetadata(r)}}async getEventData(r){const t=r.actionContext,a=this.getPlatformMetadata(),o=await this.getUserData(),s=await this.getSessionData(),u={name:this.options.productName,version:this.options.productVersion};this.options.productVariant&&(u.variant=this.options.productVariant);const p={user:o,action:t,platform:a,product:u,session:s};this.utmParameters&&(p.utm=this.utmParameters);const d=this.extractData(r),h=Object.keys(p).map(c=>c.toLowerCase()),f=Object.keys(d).map(c=>c.toLowerCase());return h.forEach(c=>{f.includes(c)&&this.logError(new Error(`${c} is a reserved key.`),!0)}),{...p,...d}}extractData(r){return Dc.isFunction(this.options.formatData)?this.options.formatData(r):{[r.actionContext.entity]:r.data}}async getUserData(){var t,a,o;let r;try{r=await((a=(t=this.options).getProfileId)==null?void 0:a.call(t))}catch(s){this.logError(s)}try{const s=await this.options.getUser();return s!=null&&s.id?{id:s.id,role:((o=s.role)==null?void 0:o.toLowerCase())||bD,userGroup:(s.userGroup??rF.Unknown).toLowerCase(),yearGroup:this.normalizeYearGroup(s.yearGroup),profileId:r,customer:{id:s.customerId,name:s.customerName,customerGuid:s.customerGuid,crmId:s.crmId,country:s.countryCode,region:await this.getRegion(),openCustomer:!1,accessPolicy:s.accessPolicy}}:r?{profileId:r}:void 0}catch(s){this.logError(s)}}async getRegion(){let r=this.options.regionName;try{const t=await this.options.getUser();t!=null&&t.instanceRegion&&(r=t.instanceRegion)}catch(t){this.logError(t)}return r||this.logError(new Error("RegionName is not set."),!0),this.getRegionByName(r.toLowerCase())}async getSessionData(){try{const r=await this.options.getUser();return{...gD.getClientSessionData(r==null?void 0:r.id),authSessionId:r==null?void 0:r.sessionId}}catch(r){return console.error(r),gD.getClientSessionData(null)}}getPlatformMetadata(){var t,a;const r={url:window.location.href,referrer:document.referrer};return(t=this.attributionData)!=null&&t.internalReferrer&&(r.internalReferrer=this.attributionData.internalReferrer),(a=this.attributionData)!=null&&a.originalReferrer&&(r.originalReferrer=this.attributionData.originalReferrer),{browser:yD.getBrowser(),os:yD.getOperatingSystem(),request:r,screenResolution:`${window.screen.width}x${window.screen.height}`,viewportResolution:`${window.innerWidth}x${window.innerHeight}`}}getEventMetadata(r){return{client:{name:`${this.name}.ts`,version:nre.version,region:this.getRegionByName(this.options.regionName)},timestamp:new Date().toISOString(),eventVersion:r.eventVersion}}getRegionByName(r){let t;return Object.values(Mee).forEach(a=>{a.systemName===r&&(t=a)}),t}normalizeYearGroup(r){return r?r.toLowerCase().split(" ").join("_"):bD}logError(r,t,...a){if(this.options.logError&&this.options.logError(r,...a),t)throw r}}var sn=(e=>(e.Stream="cv_product_stream",e.WebPlayerStream="cv_product_webplayer_stream",e.StreamProgress="cv_product_stream_progress",e.PreviewStreamProgress="cv_product_preview_stream_progress",e.StreamBuffering="cv_product_stream_buffering",e.Login="cv_product_login",e.LoginSsoRedirect="cv_product_login_sso_redirect",e.LoginFailed="cv_product_login_failed",e.Search="cv_product_search",e.InstantSearch="cv_product_instant_search",e.SearchEmptyResult="cv_product_search_empty_result",e.Filter="cv_product_search_filter",e.SearchLanding="cv_product_search_landing",e.Share="cv_product_share",e.Unshare="cv_product_unshare",e.WorkspaceAdd="cv_product_tv_add",e.Rename="cv_product_rename",e.Move="cv_product_move",e.Sort="cv_product_sort",e.Create="cv_product_create",e.Delete="cv_product_delete",e.Associate="cv_product_associate",e.Dissociate="cv_product_dissociate",e.Edit="cv_product_edit",e.Approve="cv_product_approve",e.Reject="cv_product_reject",e.Disable="cv_product_disable",e.Upload="cv_product_upload",e.Download="cv_product_download",e.Navigate="cv_product_navigate",e.Click="cv_product_click",e.Suggest="cv_product_suggest",e.EditAssoc="cv_product_edit_assoc",e.Play="cv_product_play",e.Favourite="cv_product_favourite",e.Follow="cv_product_follow",e.Prefer="cv_product_prefer",e.Print="cv_product_print",e.Copy="cv_product_copy",e.Activate="cv_product_activate",e.VerifyEmail="cv_product_verify_email",e.ChangePassword="cv_product_change_password",e.ManageGroup="cv_product_manage_group",e.Export="cv_product_export",e.SendEmail="cv_product_send_email",e.Publish="cv_product_publish",e.Submit="cv_product_submit",e.Complete="cv_product_complete",e.Archive="cv_product_archive",e.Promote="cv_product_promote",e.Demote="cv_product_demote",e.BulkAction="cv_product_bulk_action",e.Remove="cv_product_remove",e.Dismiss="cv_product_dismiss",e.Open="cv_product_open",e.Hide="cv_product_hide",e.PageView="cv_product_page_view",e.Select="cv_product_select",e.SwitchCustomer="cv_product_switch_customer",e.Focus="cv_product_focus",e.Blur="cv_product_blur",e.Hover="cv_product_hover",e.Unhover="cv_product_unhover",e.SetAccess="cv_product_set_access",e.AddToLocalCache="cv_product_add_to_lc",e.ResolveWarning="cv_product_resolve_warning",e.DismissWarning="cv_product_dismiss_warning",e))(sn||{}),nF=(e=>(e.Folder="folder",e.Video="video",e.Rating="rating",e.Series="series",e.Library="library",e.Resource="resource",e.Tag="tag",e.Subtitle="subtitle",e.Chapter="chapter",e.Resolution="resolution",e.PlaybackSpeed="playback_speed",e.Device="device",e.Restriction="restriction",e.Interactive="interactive",e.Interaction="interaction",e.PDF="pdf",e.CustomerSetting="customer_setting",e.UserSetting="user_setting",e.LibraryRequest="staff_request",e.Logo="logo",e.Pagination="pagination",e.Thumbnail="thumbnail",e.Banner="banner",e.Link="link",e.Playlist="playlist",e.Playlists="playlists",e.Person="person",e.Company="company",e.Classroom="classroom",e.ClassroomGroup="classroom_group",e.Classification="classification",e.ShareLink="share_link",e.DirectShare="direct_share",e.Upload="upload",e.SearchResults="search_results",e.SearchSuggestion="search_suggestion",e.Audience="audience",e.User="user",e.Clip="clip",e.UserChannel="user_channel",e.Widget="widget",e.Url="url",e.SocialShare="social_share",e.Presentation="presentation",e.BatchJob="batch_job",e.DeepLink="deep_link",e.Feedback="feedback",e.AppLink="app_link",e.SignUp="sign_up",e.FileGeneratorJob="file_generator_job",e.ExportLibraries="export_libraries",e.Product="product",e.Customer="customer",e.SpecialEvent="special_event",e.Region="region",e.ProductTip="product_tip",e.Livestream="livestream",e.DevicesCta="devices_cta",e.Integration="integration",e.Faq="faq",e.MixedMedia="mixed_media",e.TableOfContents="table_of_contents",e.Author="author",e.Glance="glance",e.Filter="filter",e.NotificationSetting="notification_setting",e.Transcript="transcript",e.CurriculumCode="curriculum_code",e.Assign="assign",e.PartnerProfile="partner_profile",e))(nF||{}),aF=(e=>(e.TopNav="top_nav",e.LeftNav="left_nav",e.Footer="footer",e.Popup="popup",e.Banner="banner",e.VideoList="video_list",e.VideoListItem="video_list_item",e.VideoListHeader="video_header",e.VideoThumbnail="video_thumbnail",e.ExpandableVideoThumbnail="expandable_video_thumbnail",e.VideoItemPreview="video_item_preview",e.InteractiveItemPreview="interactive_item_preview",e.ClipItemPreview="clip_item_preview",e.VideoDetails="video_details",e.InteractiveDetails="interactive_details",e.ClipDetails="clip_details",e.VideoDetailsHeader="video_details_header",e.EditVideoDetails="edit_video_details",e.EditInteractiveVideoDetails="edit_interactive_video_details",e.EditClipDetails="edit_clip_details",e.EditVideoChapters="edit_video_chapters",e.EditVideoResources="edit_video_resources",e.PreviewVideoResources="preview_video_resources",e.VideoUpload="video_upload",e.VideoRequest="video_request",e.Pagination="pagination",e.LibraryHeader="library_header",e.LibraryTiles="library_tiles",e.LibraryRequestDetails="staff_request_details",e.Libraries="libraries",e.SubFolderList="sub_folder_list",e.AwaitingReviewVideoListHeader="awaiting_review_video_list_header",e.AwaitingReviewVideoItem="awaiting_review_video_item",e.PastReleasesHeader="past_releases_header",e.MigrationWarnings="migration_warnings",e.PlaylistListHeader="playlist_list_header",e.PlaylistListItem="playlist_list_item",e.SeriesListItem="series_list_item",e.SeriesWithVideos="series_with_videos",e.PlaylistWithVideos="playlist_with_videos",e.Dropdown="dropdown",e.ViewCurriculumLinks="view_curriculum_links",e.SearchBar="search_bar",e.InstantSearch="instant_search",e.SearchFilters="search_filters",e.FeaturedSeriesSearchResult="featured_series_search_result",e.ExchangeSearchGroupItem="exchange_search_group_item",e.StaffManager="staff_manager",e.StaffManagerListItem="staff_manager_list_item",e.StudentManager="student_manager",e.ViewStudentVideos="view_student_videos",e.StudentManagerListItem="student_manager_list_item",e.EditUser="edit_user",e.UserAuditLog="user_audit_log",e.BulkUserActionsWizard="bulk_user_actions_wizard",e.BulkUserUploadWizard="bulk_user_upload_wizard",e.Classroom="classroom",e.ClassroomsList="classrooms_list",e.ClassroomsListItem="classrooms_list_item",e.ManageClassroomStudents="manage_classroom_students",e.ManageClassroomStudentListItem="manage_classroom_student_list_item",e.ManageClassroomGroups="manage_classroom_groups",e.ManageClassroomGroupListItem="manage_classroom_group_list_item",e.ManageClassroomTeachers="manage_classroom_teachers",e.ManageClassroomTeacherListItem="manage_classroom_teachers_list_item",e.ArchivedClassrooms="archived_classrooms",e.PreviewInteractive="preview_interactive",e.PreviewSharedInteractive="preview_shared_interactive",e.PreviewInteractiveQuestions="preview_interactive_questions",e.EditInteractive="edit_interactive",e.EditInteractiveDetails="edit_interactive_details",e.PlaySharedInteractive="play_shared_interactive",e.PlayInteractive="play_interactive",e.InteractiveListItem="interactive_list_item",e.DeleteInteractive="delete_interactive",e.NewInteractive="new_interactive",e.CopyInteractive="copy_interactive",e.UnpublishInteractive="unpublish_interactive",e.ShareInteractive="share_interactive",e.PlayPage="play_page",e.Player="player",e.FloatingPlayer="floating_player",e.InteractivePlayer="interactive_player",e.EmbeddedPlayer="embedded_player",e.CreateClipPlayer="create_clip_player",e.PlayClip="play_clip",e.PlaySharedClip="play_shared_clip",e.ClipListItem="clip_list_item",e.ContentUpdatesBanner="content_updates_banner",e.ContentUpdatesClassificationBanner="content_updates_classification_banner",e.PreferencesSettings="preferences_settings",e.NotificationSettings="notification_settings",e.TopicsOnboarding="topics_onboarding",e.MyUploads="my_uploads",e.MyVideos="my_videos",e.SlidingList="sliding_list",e.HeroBannerItem="hero_banner_item",e.SlidingListItem="sliding_list_item",e.ClassificationListItem="classification_list_item",e.ClassificationComingSoon="classification_coming_soon",e.ClassificationHero="classification_hero",e.ClassificationFooter="classification_footer",e.Classification="classification",e.PresentationClassifications="presentation_classifications",e.Dashboard="dashboard",e.DiscoverFooter="discover_footer",e.ProductBanner="product_banner",e.UserOptions="user_options",e.MagicTabs="magic_tabs",e.Settings="settings",e.StudentFeed="student_feed",e.MyShares="my_shares",e.SharedByMe="shared_by_me",e.SharedWithMe="shared_with_me",e.Insights="insights",e.Error="error_view",e.UpgradeForm="upgrade_form",e.ClassroomGuide="classroom_guide",e.TeachingResources="teaching_resources",e.ResourcesGuidancePopup="resources_guidance_popup",e.InteractivesGuidancePopup="interactives_guidance_popup",e.CurriculumGuidancePopup="curriculum_guidance_popup",e.TopVideos="top_videos",e.VideoViewsList="video_views_list",e.VideoOverview="video_overview",e.StudentReachPopup="student_reach_popup",e.GiveFeedbackPopup="give_feedback_popup",e.LibraryRequestSettings="library_request_settings",e.OpenInAppPrompt="open_in_app_prompt",e.UseAppButton="use_app_button",e.Launchpad="launchpad",e.EditableSubjectPreferencesWidget="editable_subject_preferences_widget",e.ThumbnailHeroMediaWidget="thumbnail_hero_media_widget",e.ThumbnailFixedListMediaLargeWidget="thumbnail_fixed_list_media_large",e.FilterSlidingPillListSmallWidget="filter_sliding_pill_list_small",e.CircleLogoSlidingListWidget="circle_logo_sliding_list_widget",e.RectangularLogoSlidingListWidget="rectangular_logo_sliding_list_widget",e.HeroBannerSmallWidget="hero_banner_small",e.EventIconSlidingListWidget="event_icon_sliding_list_widget",e.OnboardingStepsWidget="onboarding_steps_widget",e.FaqQuestionWidget="faq_question_widget",e.FaqQuestionAccordionWidget="faq_question_accordion_widget",e.SubjectStatsWidgetItem="subject_stats_widget_item",e.AuthorReviewerWidget="author_reviewer_widget",e.ThumbnailFixedListMediaSmallWidget="thumbnail_fixed_list_media_small_widget",e.ThumbnailFixedListFolderSmallWidget="thumbnail_fixed_list_folder_small_widget",e.ThumbnailVerticalListWidget="thumbnail_vertical_list_widget",e.ThumbnailFixedListSmallWidget="thumbnail_fixed_list_small_widget",e.PosterFixedListLargeWidget="poster_fixed_list_large_widget",e.CurriculumResourcesAccordionWidget="curriculum_resources_accordion_widget",e.SearchCurriculumCodeWidget="search_curriculum_code_widget",e.ExchangeLinksWidget="exchange_links_widget",e.TableOfContents="table_of_contents",e.SignUpPopup="sign_up_popup",e.SignUpPage="sign_up_page",e.TrialBanner="trial_banner",e.InviteColleaguePopup="invite_colleague_popup",e.AuthProspectSelect="auth_prospect_select",e.GatedBanner="gated_banner",e.GatedEmptyState="gated_empty_state",e.GatedPopup="gated_popup",e.WelcomePopup="welcome_popup",e.WatchHistoryLanding="watch_history_landing",e.MyFavouritesLanding="my_favourites_landing",e.MyVideoLanding="my_videos_landing",e.PlaylistsLanding="playlists_landing",e.MySharesLanding="myshares_landing",e.PremiumFeatures="premium_features",e.NotificationsDropdown="notifications_dropdown",e.CalendarNav="calendar_nav",e.CalendarDay="calendar_day",e.CalendarPopup="calendar_popup",e.RegionMap="region_map",e.OnboardingWelcomeVideoScreen="onboarding_welcome_video_screen",e.OnboardingSelectRoleScreen="onboarding_select_role_screen",e.OnboardingUsageIntentionScreen="onboarding_usage_intention_screen",e.OnboardingSchoolLevelScreen="onboarding_school_level_screen",e.OnboardingSelectCurriculumScreen="onboarding_select_curriculum_screen",e.OnboardingSubjectsScreen="onboarding_subjects_screen",e.OnboardingSelectVideosScreen="onboarding_select_videos_screen",e.OnboardingCreatePlaylistScreen="onboarding_create_playlist_screen",e.OnboardingSubjectsSummaryScreen="onboarding_subjects_summary_screen",e.ProductTips="product_tips",e.LivestreamBookingForm="booking_form",e.DateRangeFilter="date_range_selector",e.AudienceFilter="audience_filter",e.AssignFlowView="assign_flow_view",e.Global="global",e))(aF||{}),Ua=(e=>(e.Start="start",e.Complete="complete",e.Save="save",e.Discard="discard",e.Next="next",e.Back="back",e))(Ua||{}),Yt=(e=>(e.SignIn="sign_in",e.SignUp="sign_up",e.SignOut="sign_out",e.SwitchAccount="switch_account",e.TopNavButton="top_nav_button",e.Educator="educator",e.Student="student",e.TermsAndConditions="terms_and_conditions",e.PrivacyPolicy="privacy_policy",e.EnterEmail="enter_email",e.ClosePopup="close_popup",e.Back="back",e.UseMyLocation="use_my_location",e.TrialCreated="trial_created",e.TrialRequested="trial_requested",e.DeadEnd="dead_end",e.CantFindSchool="cant_find_school",e.ResendEmail="resend_email",e.ContactUs="contact_us",e.InviteColleague="invite_colleague",e.PremiumFeatures="premium_features",e.Upgrade="upgrade",e.FindSchool="find_school",e.AddToBraze="add_to_braze",e.RequestAccess="request_access",e.AutoJoin="auto_join",e.WrongEmail="wrong_email",e.RequestBdmTrial="request_bdm_trial",e.SkipIdpSelect="skip_idp_select",e))(Yt||{}),iF=(e=>(e[e.V1=1]="V1",e[e.V2=2]="V2",e[e.V3=3]="V3",e[e.V4=4]="V4",e[e.V5=5]="V5",e))(iF||{});const ore={first(e){return Qu(e)},firstFew(e,r){return Qu(e,r)},last(e){return Sb(e)},lastFew(e,r){return Sb(e,r)},max(e,r){return $_(e,r)},cloneAndReplaceAtIdx(e,r,t,a=null){let o=e&&e.length?e.slice():[];return r+1>o.length&&(o=[...o,...Array(r+1-o.length).fill(a)]),o.splice(r,1,t),o},moveItem(e,r,t){const a=e.slice();return a.splice(t,0,a.splice(r,1)[0]),a},isEmpty(e){return e&&!e.length},findIndex(e,r){return Bf(e,r)},findWhere(e,r){return PU(e,r)},where(e,r){return jU(e,r)},groupBy(e,r){return UU(e,r)},countBy(e,r){return FU(e,r)},flatten(e,r){return zU(e,r)},intersection(...e){return HU(...e)},addOrRemove(e,r){const t=e.indexOf(r);return t===-1?e.push(r):e.splice(t,1),e},addOrRemoveImmutable(e,r){const t=e.indexOf(r),a=nl.deepClone(e);return t===-1?[...a,r]:[...a.slice(0,t),...a.slice(t+1)]},sortBy(e,r){return MU(e,r)},chunk(e,r){return VU(e,r)},uniq(e,r){return Gc(e,r)},toObject(e,r){return e.reduce((t,a)=>Object.assign(t,nl.isObject(a)?{[a[r]]:a}:{[r]:a}),{})},findIndexById(e,r){return e.findIndex(t=>t.id===r.id)},removeItem(e,r){const t=this.findIndex(e,r);return t===-1?e:this.removeItemFromIndex(e,t)},removeItemFromIndex(e,r){return[...e.slice(0,r),...e.slice(r+1)]},findMatchedIdIndex(e,r){return e.findIndex(t=>{var a;return((a=t.id)==null?void 0:a.toString())===r.toString()})},shuffle(e){return LU(e)},findLast(e,r){for(let t=e.length-1;t>=0;t--)if(r(e[t]))return e[t]}},Xu="OTHER";function _D(e,r){return r.includes(e)?e:e?Xu:""}function sre(e){const{error:r,onChange:t,countryCode:a,isTertiary:o}=e,s=wM({countryCode:a,isTertiary:o}),u=_D(e.initialValue,s),[p,d]=je.useState(u),[h,f]=je.useState(u===Xu?e.initialValue:"");je.useEffect(()=>{d(_D(e.initialValue,s))},[e.initialValue]);function c(S){d(S.target.value),f(""),t(S.target.value===Xu?"":S.target.value)}function _(S){f(S.target.value),t(S.target.value)}const E=p===Xu;return A.jsxs("div",{className:"form-group",children:[A.jsxs("label",{htmlFor:e.id,className:e.labelClassName,children:["Job title",e.required&&A.jsx("span",{className:"text-danger",children:"*"})]}),A.jsxs("div",{className:"mb-2",children:[A.jsxs("select",{id:e.id,name:e.id,className:`form-select ${e.size==="lg"?"form-select-lg":""} ${p.length?"text-dark":"text-secondary"} ${!!r&&"is-invalid"}`,value:p,placeholder:"Role",onChange:c,children:[A.jsx("option",{value:"",disabled:!0,className:"text-secondary",children:e.placeholder?e.placeholder:A.jsx(A.Fragment,{children:"What do you do?"})}),s.map((S,w)=>A.jsx("option",{value:S,className:"text-dark",children:S},w)),A.jsx("option",{value:Xu,className:"text-dark",children:"Other"})]}),!!r&&!E&&A.jsx(Ht,{name:e.id,children:r})]}),E&&A.jsxs("div",{className:"mb-3",children:[A.jsx("input",{className:`form-control ${e.size==="lg"?"form-select-lg":""} ${!!r&&"is-invalid"}`,type:"text",value:h,placeholder:"What do you do?",autoFocus:!0,onChange:_}),!!r&&A.jsx(Ht,{name:e.id,children:r})]})]})}var Ls=(e=>(e.AU="cv-ap-southeast-1",e.NZ="cv-ap-southeast-2",e.UK="cv-eu-west-1",e.US="cv-na-west-1",e))(Ls||{});const ure=["uk","gb","gg","im","je","ie"],SD={au:Ze.AU,nz:Ze.NZ,us:Ze.US,uk:Ze.UK,ca:Ze.CA,gb:Ze.UK,gg:Ze.UK,im:Ze.UK,je:Ze.UK,ie:Ze.UK,al:Ze.UK,ad:Ze.UK,am:Ze.UK,at:Ze.UK,az:Ze.UK,by:Ze.UK,be:Ze.UK,ba:Ze.UK,bg:Ze.UK,hr:Ze.UK,cy:Ze.UK,cz:Ze.UK,dk:Ze.UK,ee:Ze.UK,fi:Ze.UK,fr:Ze.UK,de:Ze.UK,ge:Ze.UK,gr:Ze.UK,hu:Ze.UK,is:Ze.UK,it:Ze.UK,lv:Ze.UK,li:Ze.UK,lt:Ze.UK,lu:Ze.UK,mt:Ze.UK,md:Ze.UK,mc:Ze.UK,me:Ze.UK,nl:Ze.UK,mk:Ze.UK,no:Ze.UK,pl:Ze.UK,pt:Ze.UK,ro:Ze.UK,ru:Ze.UK,sm:Ze.UK,rs:Ze.UK,sk:Ze.UK,si:Ze.UK,es:Ze.UK,se:Ze.UK,ch:Ze.UK,tr:Ze.UK,ua:Ze.UK,va:Ze.UK},lre={au:pn.CvApSoutheast1,uk:pn.CvEuWest1,us:pn.CvNaWest1,nz:pn.CvApSoutheast2,ca:pn.CvNaWest1},cre={au:Ls.AU,uk:Ls.UK,us:Ls.US,nz:Ls.NZ,ca:Ls.US},Zt={getRegionName(e){const r=Zt.getCountryCode(e);return lre[r]},getInstanceRegion(e){const r=Zt.getCountryCode(e);return cre[r]},getCountryCode(e){const r=SD[e==null?void 0:e.toLowerCase()];return r||Ze.US},isCountryCodeUK(e){return ure.includes(e.toLowerCase())},isCountryCodeAU(e){return(e==null?void 0:e.toLowerCase())===Ze.AU},isCountryCodeUS(e){return(e==null?void 0:e.toLowerCase())===Ze.US},isCountryCodeNZ(e){return(e==null?void 0:e.toLowerCase())===Ze.NZ},isSupportedCountryCode(e){return Object.keys(SD).includes(e==null?void 0:e.toLowerCase())},getLocalizedLocalityPlaceholderPhrase(e){if(e){if(Zt.isCountryCodeUK(e))return"E.g. CR0 3RL or 36 Factory Lane";if(Zt.isCountryCodeAU(e)||Zt.isCountryCodeNZ(e))return"E.g. 2212 or Revesby";if(Zt.isCountryCodeUS(e))return"E.g. 95826 or Sacramento"}},getLocalizedLocalityPlaceholderText(e){if(!e)return;const r=Zt.getLocalizedLocalityPlaceholderPhrase(e);if(r)return r}};function V_(e){if(!e)return{firstName:"",surname:""};const[r,...t]=e.split(" ").filter(a=>a.length);return{firstName:r,surname:t==null?void 0:t.join(" ")}}var ub={exports:{}};/*!
62
62
  Copyright (c) 2018 Jed Watson.
63
63
  Licensed under the MIT License (MIT), see
64
64
  http://jedwatson.github.io/classnames
65
- */var wD;function fre(){return wD||(wD=1,(function(e){(function(){var r={}.hasOwnProperty;function t(){for(var s="",u=0;u<arguments.length;u++){var p=arguments[u];p&&(s=o(s,a(p)))}return s}function a(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return t.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var u="";for(var p in s)r.call(s,p)&&s[p]&&(u=o(u,p));return u}function o(s,u){return u?s?s+" "+u:s+u:s}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(ub)),ub.exports}var dre=fre();const oF=al(dre),hre=["xxl","xl","lg","md","sm","xs"],vre="xs",sF=Nr.createContext({prefixes:{},breakpoints:hre,minBreakpoint:vre}),{Consumer:Qne,Provider:eae}=sF;function uF(e,r){const{prefixes:t}=Nr.useContext(sF);return e||t[r]||r}const pre=["as","disabled"];function gre(e,r){if(e==null)return{};var t={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(r.indexOf(a)>=0)continue;t[a]=e[a]}return t}function mre(e){return!e||e.trim()==="#"}function lF({tagName:e,disabled:r,href:t,target:a,rel:o,role:s,onClick:u,tabIndex:p=0,type:d}){e||(t!=null||a!=null||o!=null?e="a":e="button");const h={tagName:e};if(e==="button")return[{type:d||"button",disabled:r},h];const f=_=>{if((r||e==="a"&&mre(t))&&_.preventDefault(),r){_.stopPropagation();return}u==null||u(_)},c=_=>{_.key===" "&&(_.preventDefault(),f(_))};return e==="a"&&(t||(t="#"),r&&(t=void 0)),[{role:s??"button",disabled:void 0,tabIndex:r?void 0:p,href:t,target:e==="a"?a:void 0,"aria-disabled":r||void 0,rel:e==="a"?o:void 0,onClick:f,onKeyDown:c},h]}const yre=Nr.forwardRef((e,r)=>{let{as:t,disabled:a}=e,o=gre(e,pre);const[s,{tagName:u}]=lF(Object.assign({tagName:t,disabled:a},o));return A.jsx(u,Object.assign({},o,s,{ref:r}))});yre.displayName="Button";const cF=Nr.forwardRef(({as:e,bsPrefix:r,variant:t="primary",size:a,active:o=!1,disabled:s=!1,className:u,...p},d)=>{const h=uF(r,"btn"),[f,{tagName:c}]=lF({tagName:e,disabled:s,...p}),_=c;return A.jsx(_,{...f,...p,ref:d,disabled:s,className:oF(u,h,o&&"active",t&&`${h}-${t}`,a&&`${h}-${a}`,p.href&&s&&"disabled")})});cF.displayName="Button";const G_=Nr.forwardRef(({bsPrefix:e,variant:r,animation:t="border",size:a,as:o="div",className:s,...u},p)=>{e=uF(e,"spinner");const d=`${e}-${t}`;return A.jsx(o,{ref:p,...u,className:oF(s,d,a&&`${d}-${a}`,r&&`text-${r}`)})});G_.displayName="Spinner";function zf(e){const{showSpinner:r,children:t,style:a,spinnerText:o,...s}=e,u=Nr.useRef(null),[{width:p,height:d},h]=Nr.useState({}),[f,c]=Nr.useState(r);Nr.useEffect(()=>{if(!r){h({});return}const E=u.current,S=E.offsetHeight,w=E.offsetWidth;!S||!w||h({width:w,height:S})},[r]),Nr.useLayoutEffect(()=>{c(r)},[r]);const _={...a};return p&&(_.width=`${p+1}px`),d&&(_.height=`${d+1}px`),A.jsx(cF,{ref:u,disabled:r,style:_,...s,children:f?A.jsxs(A.Fragment,{children:[A.jsx(G_,{as:"span",animation:"border",role:"status",size:"sm"}),!!o&&A.jsx("span",{className:"ps-1",children:o})]}):t})}const Lc=/\$+[\w\s]?/,bre=/^\+?\d{4,255}$/,Mc=255;function fF(e){var E,S,w,R;const[r,t]=je.useState({fullname:"",jobTitle:"",phone:""});function a(b){b==null||b.preventDefault(),c(r)&&e.handleSubmitForm(r)}function o(b){b.preventDefault(),h("fullname",b.target.value),f("fullname"),f("submission")}function s(b){b.preventDefault(),h("phone",b.target.value.trim()),f("phone"),f("submission")}function u(b){h("jobTitle",b),f("jobTitle"),f("submission")}function p(){h("fullname",""),f("fullname"),f("submission")}function d(){h("phone",""),f("phone"),f("submission")}function h(b,I){t(m=>({...m,[b]:I}))}function f(b){if(!Object.keys(e.errors).length||!e.errors[b])return;const I={...e.errors};delete I[b],e.setErrors(I)}function c(b){const{fullname:I,jobTitle:m,phone:v}=b,{firstName:y,surname:g}=V_(I),x={};return(!y||!g)&&(x.fullname="Please enter your full name."),(Lc.test(y)||Lc.test(g))&&(x.fullname="Please enter your full name."),I.length>Mc&&(x.fullname=`Full name cannot exceed max length of ${Mc} characters.`),m!=null&&m.length||(x.jobTitle="Please enter your job title."),Lc.test(m)&&(x.jobTitle="Please enter a valid job title."),m.length>Mc&&(x.jobTitle=`Job title cannot exceed max length of ${Mc} characters.`),v!=null&&v.length||(x.phone="Please enter your phone number."),(Lc.test(v)||!bre.test(v))&&(x.phone="Please enter a valid phone number."),e.setErrors(x),!Object.keys(x).length}function _(){const{fullname:b,jobTitle:I,phone:m}=r;return!(!b.length||!I.length||!m.length||Object.keys(e.errors).length)}return A.jsxs("div",{className:"text-center",children:[A.jsx("h1",{className:"text-center h4",children:"A little more about you"}),A.jsx("p",{children:"Please enter your details."}),A.jsxs("form",{onSubmit:a,"aria-errormessage":"brazeFormError",children:[A.jsxs("div",{className:"form-group text-start",children:[A.jsx("label",{className:"d-block fw-bold mb-1",htmlFor:"fullname-input",children:"Full name"}),A.jsx(Bs,{value:r.fullname,onChange:o,name:"fullname-input",id:"fullname-input",type:"text",className:`form-control form-control-lg ${(E=e.errors.fullname)!=null&&E.length?"is-invalid":""}`,placeholder:"Enter your name",onClickClear:p,autoFocus:!0,"aria-errormessage":"fullname-inputError"}),e.errors.fullname&&A.jsx(Ht,{name:"fullname-input",children:e.errors.fullname})]}),A.jsxs("div",{className:"form-group text-start",children:[A.jsx("label",{className:"d-block fw-bold mb-1",htmlFor:"phone-input",children:"Contact number"}),A.jsx(Bs,{value:r.phone,onChange:s,name:"phone-input",id:"phone-input",type:"tel",className:`form-control form-control-lg ${(S=e.errors.phone)!=null&&S.length?"is-invalid":""}`,placeholder:"Enter your phone number",onClickClear:d,"aria-errormessage":"phone-inputError"}),e.errors.phone&&A.jsx(Ht,{name:"phone-input",children:e.errors.phone})]}),A.jsxs("div",{className:"form-group text-start",children:[A.jsx("label",{className:"d-block fw-bold mb-1",htmlFor:"jobTitle-select",children:"Job title"}),A.jsx(sre,{id:"jobTitle-select",countryCode:Zt.getCountryCode(e.country),onChange:u,error:(w=e.errors)==null?void 0:w.jobTitle,size:"lg",labelClassName:"d-none",isTertiary:e.isTertiary})]}),!!((R=e.errors)!=null&&R.submission)&&A.jsx(Ht,{name:"brazeForm",className:"form-group",children:e.errors.submission}),A.jsx("div",{className:"form-group mb-1",children:A.jsx(zf,{className:"btn-lg w-100",variant:"dark",onClick:()=>a(),showSpinner:e.loading,disabled:e.loading||!_(),children:"Submit"})})]})]})}var Dr=(e=>(e.Unavailable="unavailable",e.Expired="expired",e.Active="active",e.NotRequired="not-required",e.Available="available",e.Unsupported="unsupported",e.UserAutoJoinAllowed="user-auto-join-allowed",e.UserJoinApprovalRequired="user-join-approval-required",e.InvalidEmail="invalid-email",e.BdmTrialAvailable="bdm-trial-available",e))(Dr||{}),In=(e=>(e.Staff="staff",e.Learner="learner",e))(In||{}),lb={exports:{}},ED;function _re(){return ED||(ED=1,(function(e,r){(function(t){e.exports=t()})(function(t){var a=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function o(b,I){var m=b[0],v=b[1],y=b[2],g=b[3];m+=(v&y|~v&g)+I[0]-680876936|0,m=(m<<7|m>>>25)+v|0,g+=(m&v|~m&y)+I[1]-389564586|0,g=(g<<12|g>>>20)+m|0,y+=(g&m|~g&v)+I[2]+606105819|0,y=(y<<17|y>>>15)+g|0,v+=(y&g|~y&m)+I[3]-1044525330|0,v=(v<<22|v>>>10)+y|0,m+=(v&y|~v&g)+I[4]-176418897|0,m=(m<<7|m>>>25)+v|0,g+=(m&v|~m&y)+I[5]+1200080426|0,g=(g<<12|g>>>20)+m|0,y+=(g&m|~g&v)+I[6]-1473231341|0,y=(y<<17|y>>>15)+g|0,v+=(y&g|~y&m)+I[7]-45705983|0,v=(v<<22|v>>>10)+y|0,m+=(v&y|~v&g)+I[8]+1770035416|0,m=(m<<7|m>>>25)+v|0,g+=(m&v|~m&y)+I[9]-1958414417|0,g=(g<<12|g>>>20)+m|0,y+=(g&m|~g&v)+I[10]-42063|0,y=(y<<17|y>>>15)+g|0,v+=(y&g|~y&m)+I[11]-1990404162|0,v=(v<<22|v>>>10)+y|0,m+=(v&y|~v&g)+I[12]+1804603682|0,m=(m<<7|m>>>25)+v|0,g+=(m&v|~m&y)+I[13]-40341101|0,g=(g<<12|g>>>20)+m|0,y+=(g&m|~g&v)+I[14]-1502002290|0,y=(y<<17|y>>>15)+g|0,v+=(y&g|~y&m)+I[15]+1236535329|0,v=(v<<22|v>>>10)+y|0,m+=(v&g|y&~g)+I[1]-165796510|0,m=(m<<5|m>>>27)+v|0,g+=(m&y|v&~y)+I[6]-1069501632|0,g=(g<<9|g>>>23)+m|0,y+=(g&v|m&~v)+I[11]+643717713|0,y=(y<<14|y>>>18)+g|0,v+=(y&m|g&~m)+I[0]-373897302|0,v=(v<<20|v>>>12)+y|0,m+=(v&g|y&~g)+I[5]-701558691|0,m=(m<<5|m>>>27)+v|0,g+=(m&y|v&~y)+I[10]+38016083|0,g=(g<<9|g>>>23)+m|0,y+=(g&v|m&~v)+I[15]-660478335|0,y=(y<<14|y>>>18)+g|0,v+=(y&m|g&~m)+I[4]-405537848|0,v=(v<<20|v>>>12)+y|0,m+=(v&g|y&~g)+I[9]+568446438|0,m=(m<<5|m>>>27)+v|0,g+=(m&y|v&~y)+I[14]-1019803690|0,g=(g<<9|g>>>23)+m|0,y+=(g&v|m&~v)+I[3]-187363961|0,y=(y<<14|y>>>18)+g|0,v+=(y&m|g&~m)+I[8]+1163531501|0,v=(v<<20|v>>>12)+y|0,m+=(v&g|y&~g)+I[13]-1444681467|0,m=(m<<5|m>>>27)+v|0,g+=(m&y|v&~y)+I[2]-51403784|0,g=(g<<9|g>>>23)+m|0,y+=(g&v|m&~v)+I[7]+1735328473|0,y=(y<<14|y>>>18)+g|0,v+=(y&m|g&~m)+I[12]-1926607734|0,v=(v<<20|v>>>12)+y|0,m+=(v^y^g)+I[5]-378558|0,m=(m<<4|m>>>28)+v|0,g+=(m^v^y)+I[8]-2022574463|0,g=(g<<11|g>>>21)+m|0,y+=(g^m^v)+I[11]+1839030562|0,y=(y<<16|y>>>16)+g|0,v+=(y^g^m)+I[14]-35309556|0,v=(v<<23|v>>>9)+y|0,m+=(v^y^g)+I[1]-1530992060|0,m=(m<<4|m>>>28)+v|0,g+=(m^v^y)+I[4]+1272893353|0,g=(g<<11|g>>>21)+m|0,y+=(g^m^v)+I[7]-155497632|0,y=(y<<16|y>>>16)+g|0,v+=(y^g^m)+I[10]-1094730640|0,v=(v<<23|v>>>9)+y|0,m+=(v^y^g)+I[13]+681279174|0,m=(m<<4|m>>>28)+v|0,g+=(m^v^y)+I[0]-358537222|0,g=(g<<11|g>>>21)+m|0,y+=(g^m^v)+I[3]-722521979|0,y=(y<<16|y>>>16)+g|0,v+=(y^g^m)+I[6]+76029189|0,v=(v<<23|v>>>9)+y|0,m+=(v^y^g)+I[9]-640364487|0,m=(m<<4|m>>>28)+v|0,g+=(m^v^y)+I[12]-421815835|0,g=(g<<11|g>>>21)+m|0,y+=(g^m^v)+I[15]+530742520|0,y=(y<<16|y>>>16)+g|0,v+=(y^g^m)+I[2]-995338651|0,v=(v<<23|v>>>9)+y|0,m+=(y^(v|~g))+I[0]-198630844|0,m=(m<<6|m>>>26)+v|0,g+=(v^(m|~y))+I[7]+1126891415|0,g=(g<<10|g>>>22)+m|0,y+=(m^(g|~v))+I[14]-1416354905|0,y=(y<<15|y>>>17)+g|0,v+=(g^(y|~m))+I[5]-57434055|0,v=(v<<21|v>>>11)+y|0,m+=(y^(v|~g))+I[12]+1700485571|0,m=(m<<6|m>>>26)+v|0,g+=(v^(m|~y))+I[3]-1894986606|0,g=(g<<10|g>>>22)+m|0,y+=(m^(g|~v))+I[10]-1051523|0,y=(y<<15|y>>>17)+g|0,v+=(g^(y|~m))+I[1]-2054922799|0,v=(v<<21|v>>>11)+y|0,m+=(y^(v|~g))+I[8]+1873313359|0,m=(m<<6|m>>>26)+v|0,g+=(v^(m|~y))+I[15]-30611744|0,g=(g<<10|g>>>22)+m|0,y+=(m^(g|~v))+I[6]-1560198380|0,y=(y<<15|y>>>17)+g|0,v+=(g^(y|~m))+I[13]+1309151649|0,v=(v<<21|v>>>11)+y|0,m+=(y^(v|~g))+I[4]-145523070|0,m=(m<<6|m>>>26)+v|0,g+=(v^(m|~y))+I[11]-1120210379|0,g=(g<<10|g>>>22)+m|0,y+=(m^(g|~v))+I[2]+718787259|0,y=(y<<15|y>>>17)+g|0,v+=(g^(y|~m))+I[9]-343485551|0,v=(v<<21|v>>>11)+y|0,b[0]=m+b[0]|0,b[1]=v+b[1]|0,b[2]=y+b[2]|0,b[3]=g+b[3]|0}function s(b){var I=[],m;for(m=0;m<64;m+=4)I[m>>2]=b.charCodeAt(m)+(b.charCodeAt(m+1)<<8)+(b.charCodeAt(m+2)<<16)+(b.charCodeAt(m+3)<<24);return I}function u(b){var I=[],m;for(m=0;m<64;m+=4)I[m>>2]=b[m]+(b[m+1]<<8)+(b[m+2]<<16)+(b[m+3]<<24);return I}function p(b){var I=b.length,m=[1732584193,-271733879,-1732584194,271733878],v,y,g,x,T,O;for(v=64;v<=I;v+=64)o(m,s(b.substring(v-64,v)));for(b=b.substring(v-64),y=b.length,g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],v=0;v<y;v+=1)g[v>>2]|=b.charCodeAt(v)<<(v%4<<3);if(g[v>>2]|=128<<(v%4<<3),v>55)for(o(m,g),v=0;v<16;v+=1)g[v]=0;return x=I*8,x=x.toString(16).match(/(.*?)(.{0,8})$/),T=parseInt(x[2],16),O=parseInt(x[1],16)||0,g[14]=T,g[15]=O,o(m,g),m}function d(b){var I=b.length,m=[1732584193,-271733879,-1732584194,271733878],v,y,g,x,T,O;for(v=64;v<=I;v+=64)o(m,u(b.subarray(v-64,v)));for(b=v-64<I?b.subarray(v-64):new Uint8Array(0),y=b.length,g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],v=0;v<y;v+=1)g[v>>2]|=b[v]<<(v%4<<3);if(g[v>>2]|=128<<(v%4<<3),v>55)for(o(m,g),v=0;v<16;v+=1)g[v]=0;return x=I*8,x=x.toString(16).match(/(.*?)(.{0,8})$/),T=parseInt(x[2],16),O=parseInt(x[1],16)||0,g[14]=T,g[15]=O,o(m,g),m}function h(b){var I="",m;for(m=0;m<4;m+=1)I+=a[b>>m*8+4&15]+a[b>>m*8&15];return I}function f(b){var I;for(I=0;I<b.length;I+=1)b[I]=h(b[I]);return b.join("")}f(p("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&(function(){function b(I,m){return I=I|0||0,I<0?Math.max(I+m,0):Math.min(I,m)}ArrayBuffer.prototype.slice=function(I,m){var v=this.byteLength,y=b(I,v),g=v,x,T,O,j;return m!==t&&(g=b(m,v)),y>g?new ArrayBuffer(0):(x=g-y,T=new ArrayBuffer(x),O=new Uint8Array(T),j=new Uint8Array(this,y,x),O.set(j),T)}})();function c(b){return/[\u0080-\uFFFF]/.test(b)&&(b=unescape(encodeURIComponent(b))),b}function _(b,I){var m=b.length,v=new ArrayBuffer(m),y=new Uint8Array(v),g;for(g=0;g<m;g+=1)y[g]=b.charCodeAt(g);return I?y:v}function E(b){return String.fromCharCode.apply(null,new Uint8Array(b))}function S(b,I,m){var v=new Uint8Array(b.byteLength+I.byteLength);return v.set(new Uint8Array(b)),v.set(new Uint8Array(I),b.byteLength),v}function w(b){var I=[],m=b.length,v;for(v=0;v<m-1;v+=2)I.push(parseInt(b.substr(v,2),16));return String.fromCharCode.apply(String,I)}function R(){this.reset()}return R.prototype.append=function(b){return this.appendBinary(c(b)),this},R.prototype.appendBinary=function(b){this._buff+=b,this._length+=b.length;var I=this._buff.length,m;for(m=64;m<=I;m+=64)o(this._hash,s(this._buff.substring(m-64,m)));return this._buff=this._buff.substring(m-64),this},R.prototype.end=function(b){var I=this._buff,m=I.length,v,y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g;for(v=0;v<m;v+=1)y[v>>2]|=I.charCodeAt(v)<<(v%4<<3);return this._finish(y,m),g=f(this._hash),b&&(g=w(g)),this.reset(),g},R.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},R.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},R.prototype.setState=function(b){return this._buff=b.buff,this._length=b.length,this._hash=b.hash,this},R.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},R.prototype._finish=function(b,I){var m=I,v,y,g;if(b[m>>2]|=128<<(m%4<<3),m>55)for(o(this._hash,b),m=0;m<16;m+=1)b[m]=0;v=this._length*8,v=v.toString(16).match(/(.*?)(.{0,8})$/),y=parseInt(v[2],16),g=parseInt(v[1],16)||0,b[14]=y,b[15]=g,o(this._hash,b)},R.hash=function(b,I){return R.hashBinary(c(b),I)},R.hashBinary=function(b,I){var m=p(b),v=f(m);return I?w(v):v},R.ArrayBuffer=function(){this.reset()},R.ArrayBuffer.prototype.append=function(b){var I=S(this._buff.buffer,b),m=I.length,v;for(this._length+=b.byteLength,v=64;v<=m;v+=64)o(this._hash,u(I.subarray(v-64,v)));return this._buff=v-64<m?new Uint8Array(I.buffer.slice(v-64)):new Uint8Array(0),this},R.ArrayBuffer.prototype.end=function(b){var I=this._buff,m=I.length,v=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y,g;for(y=0;y<m;y+=1)v[y>>2]|=I[y]<<(y%4<<3);return this._finish(v,m),g=f(this._hash),b&&(g=w(g)),this.reset(),g},R.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},R.ArrayBuffer.prototype.getState=function(){var b=R.prototype.getState.call(this);return b.buff=E(b.buff),b},R.ArrayBuffer.prototype.setState=function(b){return b.buff=_(b.buff,!0),R.prototype.setState.call(this,b)},R.ArrayBuffer.prototype.destroy=R.prototype.destroy,R.ArrayBuffer.prototype._finish=R.prototype._finish,R.ArrayBuffer.hash=function(b,I){var m=d(new Uint8Array(b)),v=f(m);return I?w(v):v},R})})(lb)),lb.exports}var Sre=_re();const wre=al(Sre),CD={secondary:{label:"Secondary",isTertiary:!1},"primary & secondary":{label:"Primary & Secondary",isTertiary:!1},k12:{label:"Primary & Secondary",isTertiary:!1},primary:{label:"Primary",isTertiary:!1},special:{label:"Special",isTertiary:!1},university:{label:"University",isTertiary:!0},middle:{label:"Middle",isTertiary:!1},"fe college":{label:"FE College",isTertiary:!0},"high school":{label:"Secondary",isTertiary:!1},elementary:{label:"Primary",isTertiary:!1},"middle school":{label:"Middle",isTertiary:!1},tafe:{label:"TAFE",isTertiary:!0},college:{label:"FE College",isTertiary:!0},"sixth form college":{label:"Sixth Form College",isTertiary:!0}},Ere={england:"ENG",scotland:"SCT",wales:"WLS","northern ireland":"NIR"},Kt={hashedEmail(e){const r=e.trim().toLowerCase();return wre.hash(r)},removeEmptyKeys(e){if(Array.isArray(e))return e;const r={...e};return Object.entries(r).filter(([,t])=>!(t==null||typeof t=="string"&&!t.length)).reduce((t,[a,o])=>({...t,[a]:o===Object(o)?Kt.removeEmptyKeys(o):o}),{})},EVENT_TOPIC:"Free Trial Request",BDM_EVENT_TOPIC:"Requested free trial (Streamable Customer)",SOURCE:"cv_product_trial_requested",BDM_SOURCE:"cv_product_bdm_trial_requested",TRIAL_UPGRADE_SOURCE:"cv_product_trial_upgrade_requested",getSchoolType(e){var a;if(!e)return;const r=e.toLowerCase();if(["unknown","other"].includes(r))return;const t=(a=CD[r])==null?void 0:a.label;return t||e},isTertiarySchool(e){var r;return((r=CD[e==null?void 0:e.toLowerCase()])==null?void 0:r.isTertiary)||!1},parseProvince(e){return e.length?Ere[e.toLowerCase()]||e:""}};function Cre(e){var h;const[r,t]=je.useState(!1),[a,o]=je.useState({});je.useEffect(()=>{e.userType===In.Learner&&e.complete({completionStep:"trial-status",trialCreated:!1,trialStatus:Dr.Unsupported})},[]);function s(f){if(EM(f.jobTitle)){d();return}u(f)}async function u(f){if(r)return;if(e.userType===In.Learner){o({...a,submission:"Something went wrong! Please try again later."});return}e.logUserAction({},{actionType:sn.Click,workflowPhase:Ua.Next,descriptor:Yt.AddToBraze}),t(!0);const{firstName:c,surname:_}=V_(f.fullname);try{const E={email:e.email,firstName:c,lastName:_,phone:f.phone,custom:{orgSubType:Kt.getSchoolType(e==null?void 0:e.schoolType),accountName:e==null?void 0:e.schoolName,jobTitle:f.jobTitle,accountAddress:{countryCode:e==null?void 0:e.country,province:Kt.parseProvince((e==null?void 0:e.province)||"")},syncToCrm:!0,source:Kt.SOURCE},event:{accountCountry:e==null?void 0:e.country,accountPostCode:e==null?void 0:e.schoolPostCode,eventTopic:Kt.EVENT_TOPIC}},S={prospect_id:e==null?void 0:e.prospectId};e.logBrazeEvent({user:E,event:{eventType:Tl.ProductFormEvent.ProductTrailRequested,additionalData:S,callback:p}})}catch{o({...a,submission:"Something went wrong! Please try again later."})}Object.keys(a).length||d()}function p(f){o(f?{}:{...a,submission:"Something went wrong! Please try again later."}),t(!1)}function d(){e.complete({completionStep:"added-to-braze",trialCreated:!1,trialStatus:null})}return A.jsx(fF,{loading:r,errors:a,setErrors:o,country:e.country||((h=e.geoLocation)==null?void 0:h.countryCode),logUserAction:e.logUserAction,handleSubmitForm:s,isTertiary:Kt.isTertiarySchool(e.schoolType)})}const dF={getRandomInt(e=1e4){return Math.floor(Math.random()*Math.floor(e))}};var xre=function e(r,t){if(r===t)return!0;if(r&&t&&typeof r=="object"&&typeof t=="object"){if(r.constructor!==t.constructor)return!1;var a,o,s;if(Array.isArray(r)){if(a=r.length,a!=t.length)return!1;for(o=a;o--!==0;)if(!e(r[o],t[o]))return!1;return!0}if(r.constructor===RegExp)return r.source===t.source&&r.flags===t.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===t.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===t.toString();if(s=Object.keys(r),a=s.length,a!==Object.keys(t).length)return!1;for(o=a;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[o]))return!1;for(o=a;o--!==0;){var u=s[o];if(!e(r[u],t[u]))return!1}return!0}return r!==r&&t!==t};const xD="__googleMapsScriptId";var Ms;(function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILURE=3]="FAILURE"})(Ms||(Ms={}));class $o{constructor({apiKey:r,authReferrerPolicy:t,channel:a,client:o,id:s=xD,language:u,libraries:p=[],mapIds:d,nonce:h,region:f,retries:c=3,url:_="https://maps.googleapis.com/maps/api/js",version:E}){if(this.CALLBACK="__googleMapsCallback",this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=r,this.authReferrerPolicy=t,this.channel=a,this.client=o,this.id=s||xD,this.language=u,this.libraries=p,this.mapIds=d,this.nonce=h,this.region=f,this.retries=c,this.url=_,this.version=E,$o.instance){if(!xre(this.options,$o.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify($o.instance.options)}`);return $o.instance}$o.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?Ms.FAILURE:this.done?Ms.SUCCESS:this.loading?Ms.LOADING:Ms.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let r=this.url;return r+=`?callback=${this.CALLBACK}`,this.apiKey&&(r+=`&key=${this.apiKey}`),this.channel&&(r+=`&channel=${this.channel}`),this.client&&(r+=`&client=${this.client}`),this.libraries.length>0&&(r+=`&libraries=${this.libraries.join(",")}`),this.language&&(r+=`&language=${this.language}`),this.region&&(r+=`&region=${this.region}`),this.version&&(r+=`&v=${this.version}`),this.mapIds&&(r+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(r+=`&auth_referrer_policy=${this.authReferrerPolicy}`),r}deleteScript(){const r=document.getElementById(this.id);r&&r.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((r,t)=>{this.loadCallback(a=>{a?t(a.error):r(window.google)})})}loadCallback(r){this.callbacks.push(r),this.execute()}setScript(){if(document.getElementById(this.id)){this.callback();return}const r=this.createUrl(),t=document.createElement("script");t.id=this.id,t.type="text/javascript",t.src=r,t.onerror=this.loadErrorCallback.bind(this),t.defer=!0,t.async=!0,this.nonce&&(t.nonce=this.nonce),document.head.appendChild(t)}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(r){if(this.errors.push(r),this.errors.length<=this.retries){const t=this.errors.length*Math.pow(2,this.errors.length);console.log(`Failed to load Google Maps script, retrying in ${t} ms.`),setTimeout(()=>{this.deleteScript(),this.setScript()},t)}else this.onerrorEvent=r,this.callback()}setCallback(){window.__googleMapsCallback=this.callback.bind(this)}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(r=>{r(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version){console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),this.callback();return}this.loading||(this.loading=!0,this.setCallback(),this.setScript())}}}function ID(e){return new $o({apiKey:e.apiKey,version:"weekly",libraries:e.libraries,retries:3})}function hF(e){const r={apiKey:e.apiKey,libraries:e.libraries||["places"]},[t,a]=je.useState(!1),[o,s]=je.useState(ID(r));je.useEffect(()=>{u()},[]);function u(p,d){if(!o){s(ID(r));return}o.loadCallback(h=>{if(h){a(!1),d&&d(h);return}a(!0),p&&p()})}return{loader:o,scriptLoaded:t,onGoogleApiReady:u}}function vF(e){const{scriptLoaded:r}=hF({apiKey:e.googleApiKey}),[t,a]=je.useState();return je.useEffect(()=>{r&&a(new google.maps.places.AutocompleteService)},[r]),t}const AD="us",pF="country:placeholder:text";function Ire(e){const r=Zt.getLocalizedLocalityPlaceholderText(e==null?void 0:e.countryCode);if(r)return r;const t=Tn.cacheGet(`${pF}:${e==null?void 0:e.countryCode}`);if(t)return t}function Are(){return String.fromCharCode(96+dF.getRandomInt(26))}function Tre({apiKey:e,geoLocation:r,makeRequest:t=!0,template:a="E.g. [placeholder]",templateKey:o="[placeholder]"}){const s=vF({googleApiKey:e}),[u,p]=je.useState(()=>Ire(r));je.useEffect(()=>{if(u||!s||!t)return;const f=(r==null?void 0:r.countryCode)||AD,_={input:Are(),types:["(cities)"],region:f,componentRestrictions:{country:f}};s.getPlacePredictions(_,(E,S)=>h(E,S,f))},[u,s,r,t]);function d(f,c){Tn.cacheSet(`${pF}:${c}`,f,86400),p(f)}function h(f,c,_){if(c!==google.maps.places.PlacesServiceStatus.OK||!f){d(Zt.getLocalizedLocalityPlaceholderText(AD),_);return}const E=dF.getRandomInt(f.length),S=f[E].description;d(a.replace(o,S),_)}return u}const gF={getPlaceDetails(e){let r,t,a,o;const s=e.formatted_address;for(const u of e.address_components)for(const p of u.types)p==="locality"&&(r=u.short_name),p==="administrative_area_level_1"&&(t=u.short_name),p==="postal_code"&&(o=u.short_name),p==="country"&&(a=u.short_name);return{locality:s,country:a,postalCode:o,city:r,province:t}}},Rre={1:"geocoderPermissionDenied",2:"geocoderUnavailable",3:"geocoderTimeout"};function Ore(e){const[r,t]=je.useState({}),{onGoogleApiReady:a}=hF(e);function o(){a(()=>{window.navigator.geolocation.getCurrentPosition(s,u)})}function s(p){const{latitude:d,longitude:h}=p.coords,f=new google.maps.LatLng(d,h);new google.maps.Geocoder().geocode({location:f},(_,E)=>{if(E!==google.maps.GeocoderStatus.OK)return;const S=_.find(R=>R.types.includes("locality")||R.types.includes("administrative_area_level_2")),w=gF.getPlaceDetails(S);t({...w,longitude:h,latitude:d})})}function u(p){Rre[p.code],e.onPositionError("We are unable to access your location. Please try again later.")}return{placeDetails:r,onClickGetCurrentLocation:o}}const mF=(e,r)=>{const[t,a]=je.useState(e);return je.useEffect(()=>{const o=setTimeout(()=>a(e),r);return()=>clearTimeout(o)},[e,r]),t};function kre({search:e,makePredicition:r,geoLocation:t,apiKey:a}){const o=vF({googleApiKey:a}),s=mF(e,300),[u,p]=je.useState();je.useEffect(()=>{if(!o)return;if((s==null?void 0:s.length)===0||!r){p(void 0);return}const f=(t==null?void 0:t.countryCode)||"us";o.getPlacePredictions({input:s,componentRestrictions:t!=null&&t.isFallback?void 0:{country:f},region:f,types:["locality","sublocality","postal_code"]},d)},[s,r,o]);function d(f,c){if(c!==google.maps.places.PlacesServiceStatus.OK||!f){p(void 0);return}p(f)}function h(f,c,_){new google.maps.places.PlacesService(c.current).getDetails({placeId:f.place_id,fields:["geometry","address_components","formatted_address"],region:t.countryCode},(S,w)=>{if(w!==google.maps.places.PlacesServiceStatus.OK)return;const R=S.geometry.location.lng(),b=S.geometry.location.lat(),{locality:I,country:m,postalCode:v,city:y,province:g}=gF.getPlaceDetails(S);_({longitude:R,latitude:b,locality:I,country:m,city:y,postalCode:v,province:g})})}return{localityPredicitions:u,getPlaceInfo:h}}function TD(){return A.jsx("svg",{viewBox:"0 0 24 24",children:A.jsx("path",{d:"m12.00559,20.40189c4.60881,0 8.37242,-3.78424 8.37242,-8.40189c0,-4.61764 -3.76361,-8.40187 -8.37242,-8.40187c-4.62002,0 -8.38365,3.78422 -8.38365,8.40187c0,4.61765 3.76364,8.40189 8.38365,8.40189zm0,-1.65557c-3.75235,0 -6.67085,-2.96208 -6.67085,-6.74632c0,-3.7842 2.91851,-6.74625 6.67085,-6.74625c3.74105,0 6.67084,2.96206 6.67084,6.74625c0,3.78424 -2.92978,6.74632 -6.67084,6.74632zm-10.14151,-6.02552l6.01731,0c0.40566,0 0.72118,-0.31536 0.72118,-0.7208c0,-0.40544 -0.31552,-0.7208 -0.72118,-0.7208l-6.01731,0c-0.40566,0 -0.72117,0.31536 -0.72117,0.7208c0,0.40544 0.31551,0.7208 0.72118,0.7208l-0.00001,0zm14.25442,0l6.0174,0c0.40565,0 0.72118,-0.31536 0.72118,-0.7208c0,-0.40544 -0.31553,-0.7208 -0.72118,-0.7208l-6.0174,0c-0.40565,0 -0.72118,0.31536 -0.72118,0.7208c0,0.40544 0.31553,0.7208 0.72118,0.7208zm-4.12417,-4.1221c0.40566,0 0.72118,-0.31534 0.72118,-0.70952l0,-6.02547c0,-0.40544 -0.31552,-0.7208 -0.72118,-0.7208c-0.3944,0 -0.7099,0.31536 -0.7099,0.7208l0,6.02547c0,0.39418 0.31551,0.70952 0.7099,0.70952zm0,14.25838c0.40566,0 0.72118,-0.3154 0.72118,-0.72077l0,-6.02541c0,-0.39425 -0.31552,-0.70965 -0.72118,-0.70965c-0.3944,0 -0.7099,0.3154 -0.7099,0.70965l0,6.02541c0,0.40538 0.31551,0.72077 0.7099,0.72077z"})})}const Pre="_baseText_bmazz_1",Nre="_dropdown_bmazz_4",jre="_suggestionContainer_bmazz_7",qre="_suggestionContainerInner_bmazz_13",Dre="_suggestionItem_bmazz_18",Lre="_suggestionLoading_bmazz_18",Mre="_noSuggestion_bmazz_18",Ure="_large_bmazz_22",Fre="_selected_bmazz_32",Bre="_useMyLocation_bmazz_36",zt={baseText:Pre,dropdown:Nre,suggestionContainer:jre,suggestionContainerInner:qre,suggestionItem:Dre,suggestionLoading:Lre,noSuggestion:Mre,large:Ure,selected:Fre,useMyLocation:Bre};function $re(e){const{predictions:r,getPlaceInfo:t,selectedIndex:a}=e;return A.jsx(A.Fragment,{children:r.map((o,s)=>A.jsx(Zo,{className:`${zt.suggestionItem} ${a-1===s?zt.selected:""}`,onKeyDown:u=>u.key==="Enter"&&t(o),onMouseDown:()=>t(o),onClick:()=>t(o),children:o.description},o.place_id))})}function yF(e){var H,G,$,M,D;const r=je.useRef(null),[t,a]=je.useState(((H=e.data)==null?void 0:H.schoolLocality)||""),[o,s]=je.useState(!1),u=Tre({apiKey:e.googleMapsApiKey,geoLocation:e.geoLocation}),{localityPredicitions:p,getPlaceInfo:d}=kre({search:t,makePredicition:o,geoLocation:e.geoLocation,apiKey:e.googleMapsApiKey}),{placeDetails:h,onClickGetCurrentLocation:f}=Ore({apiKey:e.googleMapsApiKey,onPositionError:v}),c=window.navigator.geolocation?1:0,{selectedIndex:_,onKeyDown:E,containerRef:S,hide:w,onBlur:R,onFocus:b}=g_({onSelected:x,itemCount:((p==null?void 0:p.length)??0)+c,hideOnBlur:e.hideOnBlur}),[I,m]=je.useState();je.useEffect(()=>{T(h)},[h]);function v(F){s(!0),m(F)}function y(F){var V,ae,oe;I&&m(void 0),o||s(!0),((V=e.data)!=null&&V.longitude||(ae=e.data)!=null&&ae.latitude||(oe=e.data)!=null&&oe.schoolLocality)&&e.clearData(),a(F)}function g(){y(""),r.current.focus()}function x(F){if(!p)return;if(F===p.length){j();return}const V=p[F];V&&O(V)}function T(F){e.setData({schoolLocality:F.locality,country:F.country,province:F.province,schoolPostCode:F.postalCode,longitude:F.longitude,latitude:F.latitude}),F.locality&&a(F.locality)}function O(F){o&&s(!1),d(F,r,T)}function j(F){var V;F==null||F.preventDefault(),s(!1),f(),(V=e.logUserAction)==null||V.call(e,{},{actionType:sn.Click,descriptor:Yt.UseMyLocation})}function k(){let F="form-control";return e.size==="lg"&&(F+=" form-control-lg"),F}const N=(p==null?void 0:p.length)&&!(($=(G=e.data)==null?void 0:G.schoolLocality)!=null&&$.length),L=window.navigator.geolocation&&!((D=(M=e.data)==null?void 0:M.schoolLocality)!=null&&D.length),U=e.labelClassName||`d-block text-center mb-3 fw-normal ${zt.baseText}`;let B="form-group position-relative";return e.size==="lg"&&(B+=` ${zt.large}`),A.jsxs("div",{className:B,children:[A.jsxs("label",{className:U,htmlFor:"locality-input",children:["ZIP code or city",e.required&&A.jsx("span",{className:"text-danger",children:"*"})]}),A.jsx(Bs,{type:"text",value:t,onChange:F=>y(F.currentTarget.value),id:"locality-input",className:k(),ref:r,autoComplete:"off",placeholder:u||"Loading...",disabled:e.disabled||!u,autoFocus:e==null?void 0:e.autoFocus,onClickClear:g,onKeyDown:E,onFocus:b,onBlur:R}),A.jsxs("div",{className:`position-absolute z-1 w-100 ${zt.dropdown} ${w?"d-none":""}`,children:[!!N&&A.jsx("div",{className:zt.suggestionContainer,children:A.jsxs("div",{className:zt.suggestionContainerInner,ref:S,children:[A.jsx($re,{predictions:p,getPlaceInfo:O,selectedIndex:_}),window.navigator.geolocation&&e.useGeoLocationApi&&A.jsx(Zo,{className:Ma(zt.suggestionItem,"px-1",_-1===p.length?zt.selected:""),onClick:j,children:A.jsxs("div",{className:"btn btn-link info-link btn-with-icon bg-transparent py-0 pe-1",children:[A.jsx(TD,{}),"Use my current location"]})})]})}),L&&!N&&e.useGeoLocationApi&&A.jsx("div",{className:`d-flex ${zt.useMyLocation}`,children:A.jsxs("button",{onClick:j,className:"btn btn-link info-link bg-white btn-with-icon",children:[A.jsx(TD,{}),"Use my current location"]})}),!!I&&A.jsx("div",{className:"text-danger p-2",children:I})]})]})}var Li=(e=>(e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e))(Li||{});class zre extends Error{constructor(r,t="Error"){super(t),this.body=r}}const Zre={prepareQuery(e,r){let t=e;return Object.keys(r).forEach((a,o)=>{r[a]&&(o===0?t+="?":t+="&",t+=`${a}=${encodeURIComponent(r[a])}`)}),t}};function cb(e){let r={method:Li.GET,headers:{"Content-type":"application/json"}};e.method&&(r={...r,method:e.method}),e.init&&(r={...r,...e.init});let t=e.url;return r.method===Li.GET&&e.data?t=Zre.prepareQuery(t,e.data):e.data&&(r={...r,body:JSON.stringify(e.data)}),{init:r,url:t}}const ri={async asyncFetch(e){const r=cb(e),t=await fetch(r.url,r.init);if(!t.ok){const a=await t.json();throw new zre(a)}if(t.status!==204)return await t.json()},async asyncFetchPlain(e){const r=cb(e),t=await fetch(r.url,r.init);if(t.ok)return await t.text()},fetch(e){const r=cb(e);return fetch(r.url,r.init).then(t=>{if(t.status!==204)return t.json()}).then(t=>(e.success&&e.success(t),t)).catch(t=>(e.error&&e.error(),t)).finally(()=>{e.always&&e.always()})}},Zf={search(e,r,t,a,o){const s={longitude:r.longitude,latitude:r.latitude};r.query&&(s.query=r.query),ri.fetch({url:e,data:s,success:t,error:a,always:o})},async create(e,r){return ri.asyncFetch({url:e.createProspect,method:Li.POST,data:r})},getLookups(e,r){return ri.asyncFetch({url:e.prospectLookups(r)})}},Hre=/\/$/,Vre={urlBuilder(e,r){const a=Object.entries(r).map(([o,s])=>o&&Array.isArray(s)?s.map(p=>`${o}=${encodeURIComponent(p)}`).join("&"):o&&s!==void 0&&s!==null?`${o}=${encodeURIComponent(s)}`:"").reduce((o,s)=>s?o?`${o}&${s}`:s:o,"");return a?`${e}?${a}`:e},buildFilter(e){const r=[];if(e.limit&&r.push(`limit:${e.limit}`),e.cursor&&r.push(`page:${e.cursor}`),e.before&&r.push(`dateCreated:...${e.before}`),!!r.length)return r.join(",")},makeHttps(e){return typeof e!="string"||e.indexOf("http://")===-1||(e=e.replace("http://","https://")),e},safeUrlConcat(e,r){if(!e)return;let t=e;return e.endsWith("/")||(t+="/"),r&&(t+=r.startsWith("/")?r.slice(1):r),t},removeTrailingSlash(e){if(typeof e=="string")return e.replace(Hre,"")}},mo={checkTrialStatus(e,r){if(e.productName!==La.Lite)return Promise.reject();const t={email:r.email};return ri.asyncFetch({url:e.userStatus,data:t})},checkUserIdps(e,r){return e.productName!==La.Lite?Promise.reject():ri.asyncFetch({url:e.idps,data:{email:r}})},checkProspectTrialStatus(e,r,t,a,o){let s=e.prospectStatus(r.prospectId);s=Vre.urlBuilder(s,{email:r.email}),ri.fetch({url:s,success:t,error:a,always:o})},createTrial(e,r){const t={prospectId:r.prospectId,email:r.email,userType:r.userType,appLink:r==null?void 0:r.appLink,attribution:r==null?void 0:r.attribution};return ri.asyncFetch({url:e.createTrial,method:Li.POST,data:t})},resendTrialEmail(e,r,t){if(e.productName!==La.Lite)return Promise.reject();const a={email:t.email,appLink:t==null?void 0:t.appLink};return ri.asyncFetch({url:e.resendTrialEmail(r),method:Li.POST,data:a})},createJoinRequest(e,r){const t=e.productName===La.Auth?e.joinRequest:e.joinRequest(r.customerId),a=e.productName===La.Auth?r:{email:r.email};return ri.asyncFetch({url:t,method:Li.POST,data:a})},createAutoJoinRequest(e,r){return e.productName!==La.Lite?Promise.reject():ri.asyncFetch({url:e.autoJoin,method:Li.POST,data:r})}},RD=["Primary","Secondary","K12","Special","TAFE","University"],Gre=["Primary","Secondary","Primary & Secondary","Special","Sixth Form College","FE College","University","Other"],xb=["Elementary","Middle School","High School","College","Other"],Wre={au:RD,nz:RD,uk:Gre,us:xb,ca:xb};function Kre(e){const r=Zt.getCountryCode(e),t=Wre[r];return t||xb}var bF=(e=>(e.Published="Published",e.Draft="Draft",e))(bF||{});function Yre(e){var R;const[r,t]=je.useState({prospectId:e.prospectId,schoolName:e.schoolName,schoolType:e.schoolType,schoolLocality:e.schoolLocality,country:e.country,province:e.province,city:e.city,longitude:e.longitude,latitude:e.latitude}),[a,o]=je.useState(),[s,u]=je.useState(!1),p=Kre(r.country||((R=e.geoLocation)==null?void 0:R.countryCode));function d(){const{schoolName:b,schoolType:I,country:m}=r;return!!(b&&I&&m)}function h(b,I){t(m=>({...m,[b]:I}))}function f(b){const{longitude:I,latitude:m,schoolLocality:v,country:y,city:g,province:x}=b;I&&h("longitude",I),m&&h("latitude",m),y&&h("country",y),g&&h("city",g),x&&h("province",x),v&&h("schoolLocality",v)}function c(){h("schoolLocality",void 0),h("longitude",void 0),h("latitude",void 0),h("city",void 0),h("province",void 0),h("country",void 0),o("")}function _(b){const I=b.target.value;h("schoolType",I)}function E(b){h("schoolName",b.target.value)}async function S(b){const I={email:e.email,custom:{accountName:r==null?void 0:r.schoolName,accountAddress:{countryCode:r==null?void 0:r.country,province:Kt.parseProvince(r.province)},orgSubType:Kt.getSchoolType(r==null?void 0:r.schoolType),syncToCrm:!0,source:Kt.SOURCE},event:{accountCountry:r==null?void 0:r.country,accountPostCode:r==null?void 0:r.schoolPostCode,accountState:Kt.parseProvince(r.province)}},m={form_type:"trial-sign-up",prospect_id:r==null?void 0:r.prospectId};e.logBrazeEvent({user:I,event:{eventType:Tl.ProductFormEvent.FormSubmission,additionalData:m,callback:b}})}async function w(b){var m;if(b.preventDefault(),!d())return;e.logUserAction(r,{actionType:sn.Click,workflowPhase:Ua.Next,descriptor:Yt.CantFindSchool}),u(!0);let I;try{if(I=await Zf.create(e.ajaxUrls,{name:r.schoolName,status:bF.Draft,countryCode:r.country,prospectType:r.schoolType,city:r.city,postCode:r.schoolPostCode,province:Kt.parseProvince(r.province)}),!I.id){u(!1),o("Error. Something went wrong.");return}}catch{u(!1),o("Error. Something went wrong.");return}if(e.userTrialStatus===Dr.BdmTrialAvailable){if(e.userType!==In.Staff){e.complete({completionStep:"added-to-braze",trialCreated:!1,trialStatus:null});return}e.nextStep({step:"request-bdm-trial",...r});return}try{const v={prospectId:I.id,email:e.email,userType:e.userType,appLink:e.pageAppLinkString,attribution:{...bi.getDecodedAttributionData(),utms:ss.getUtmParameters()}},y=await mo.createTrial(e.ajaxUrls,v);e.createOrUpdateProfile&&e.createOrUpdateProfile({masterId:y.id,email:e.email,countryCode:r==null?void 0:r.country});const g={completionStep:"trial-status",email:e.email,userId:y.id,prospectId:I.id,schoolName:r.schoolName,schoolLocality:r.schoolLocality,country:r.country,schoolType:r.schoolType,city:r.city,schoolPostCode:r.schoolPostCode,latitude:r.latitude,longitude:r.longitude,province:r.province,trialStatus:Dr.Available,trialCreated:!0,customerId:(m=y.data)==null?void 0:m.customerId};if((e==null?void 0:e.userType)===In.Staff){await S(x=>{x||console.error("Failed to submit create trial data to braze."),e.complete(g)});return}e.complete(g)}catch(v){if(!v.body){u(!1),o("Error. Something went wrong.");return}const y=v;if(y.body.status===400&&y.body.type==="trial-not-available"){e.nextStep({step:"add-to-braze",...r,prospectId:I.id,trialStatus:Dr.Unavailable});return}console.error(v)}}return A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"text-center",children:[A.jsx("h1",{className:"h4",children:"Tell us more about your school"}),A.jsx("p",{children:"Please enter your school details."})]}),A.jsxs("div",{className:"form-group",children:[A.jsx("label",{className:"d-block",htmlFor:"school-name-input",children:"Name of school"}),A.jsx("input",{type:"text",value:(r==null?void 0:r.schoolName)||"",onChange:E,id:"school-name-input",className:"form-control form-control-lg",autoComplete:"off",placeholder:"Enter name of school",autoFocus:!0})]}),A.jsxs("div",{className:"form-group",children:[A.jsx("label",{className:"d-block",htmlFor:"school-type-select",children:"Type of school"}),A.jsxs("select",{id:"school-type-select",className:`form-select form-select-lg ${r.schoolType?"":"text-secondary"}`,autoComplete:"off",value:r.schoolType||"none",onChange:_,children:[A.jsx("option",{value:"none",className:"text-secondary",disabled:!0,children:"Select type of school"}),p.map(b=>A.jsx("option",{value:b,className:"text-dark",children:b},b))]})]}),A.jsx(yF,{data:r,setData:f,clearData:c,disabled:!1,labelClassName:"d-block",geoLocation:e.geoLocation,logUserAction:e.logUserAction,googleMapsApiKey:e.googleMapsApiKey,autoFocus:!1,size:"lg",useGeoLocationApi:!0}),a&&A.jsx("div",{className:"text-danger mb-3",children:a}),d()&&A.jsx(zf,{className:"btn-lg w-100",variant:"dark",onClick:w,showSpinner:s,disabled:s,children:"Get started"})]})}function W_(e,r){return r?`${e} ${r}`:e}function Jre(e){return A.jsx("h1",{className:W_("text-center mb-2 h4",e.className),children:e.children})}function Xre(e){return A.jsx("div",{className:W_("text-center text-sm px-2 px-lg-4",e.className),children:e.children})}function Qre(e){return A.jsx("p",{className:W_("",e.className),children:e.children})}const rt={Heading:Jre,Body:Xre,Message:Qre};function Rl(e){const r={[Dr.Available]:e.imageUrls.statusImages.available,[Dr.Active]:e.imageUrls.statusImages.active,[Dr.Expired]:e.imageUrls.statusImages.expired,[Dr.NotRequired]:e.imageUrls.statusImages.notRequired,[Dr.Unavailable]:e.imageUrls.statusImages.unavailable,[Dr.Unsupported]:e.imageUrls.statusImages.unsupported,[Dr.UserAutoJoinAllowed]:e.imageUrls.statusImages.notRequired,[Dr.UserJoinApprovalRequired]:e.imageUrls.statusImages.notRequired,[Dr.InvalidEmail]:"",[Dr.BdmTrialAvailable]:""};return A.jsx("div",{className:"d-flex justify-content-center my-4 px-2 px-lg-4",children:A.jsx("img",{src:r[e.trialStatus],className:"w-100 h-auto"})})}function ete(e){return je.useEffect(()=>{e.logUserAction({},{actionType:sn.Create,descriptor:Yt.TrialRequested,workflowPhase:Ua.Complete})},[]),A.jsxs(A.Fragment,{children:[A.jsx(Rl,{trialStatus:Dr.Available,imageUrls:e.imageUrls}),A.jsxs(rt.Body,{className:"mb-3",children:[A.jsx(rt.Heading,{children:"Submitted!"}),A.jsx(rt.Message,{children:"Thank you for your interest in trialing ClickView. We will be in touch with you as soon as possible."})]})]})}function rte(e){return A.jsxs(A.Fragment,{children:[A.jsx(Rl,{trialStatus:Dr.Available,imageUrls:e.imageUrls}),A.jsxs(rt.Body,{className:"mb-3",children:[A.jsx(rt.Heading,{children:"You've requested access!"}),A.jsx(rt.Message,{children:"We've sent a request to your ClickView admin. Once your account is ready, you'll receive an email notification with instructions on how to get started with ClickView."})]})]})}const Uc={Marketing:{au:"https://www.clickvieweducation.com/en-au",us:"https://www.clickvieweducation.com",nz:"https://www.clickview.co.nz",uk:"https://www.clickview.co.uk",ca:"https://www.clickvieweducation.com/en-ca"},Support:{au:"https://www.clickviewsupport.com/hc/en-au",uk:"https://www.clickviewsupport.com/hc/en-au#gb",nz:"https://www.clickviewsupport.com/hc/en-au#nz",us:"https://www.clickviewsupport.com/hc/en-au#us",ca:"https://www.clickviewsupport.com/hc/en-au#ca"}},tte={[Ze.AU]:"/contact-us/sales",[Ze.US]:"/contact-us/sales",[Ze.NZ]:"/contact-us/",[Ze.UK]:"/contact-us/trial",[Ze.CA]:"/contact-us/sales"},nte={[Ze.AU]:"/resources/free-student-resources",[Ze.US]:"/resources/free-student-resources",[Ze.NZ]:"/free-student-resources/",[Ze.UK]:"/free-student-resources/",[Ze.CA]:"/resources/free-student-resources"},wo={getMarketingUrlForGeoLocation(e){const r=Zt.getCountryCode(e==null?void 0:e.countryCode),t=Uc.Marketing[r];return t||Uc.Marketing.us},getMarketingSalesContactForGeoLocation(e){const r=Zt.getCountryCode(e==null?void 0:e.countryCode),t=wo.getMarketingUrlForGeoLocation(e),a=tte[r];return`${t}${a}`},getFreeResourcesForGeoLocation(e){const r=Zt.getCountryCode(e==null?void 0:e.countryCode),t=this.getMarketingUrlForGeoLocation({countryCode:r}),a=nte[r];return`${t}${a}`},getTermsAndConditionsLink(){return this.getMarketingUrlForGeoLocation(Ze.US)+"/terms-and-conditions/"},getPrivacyPolicyLink(){return this.getMarketingUrlForGeoLocation(Ze.US)+"/privacy-policy/"},getSupportUrlForGeoLocation(e){const r=Zt.getCountryCode(e==null?void 0:e.countryCode),t=Uc.Support[r];return t||Uc.Support.us}};function Fc(e){const r=(e==null?void 0:e.previousStepIds)&&e.previousStepIds[e.previousStepIds.length-1]==="find-school",t=(e==null?void 0:e.schoolName)||"Your school";return A.jsxs(rt.Body,{className:"mb-3",children:[r?A.jsxs(A.Fragment,{children:[A.jsxs(rt.Heading,{children:[t,A.jsx("br",{}),"already has ClickView 🎉"]}),A.jsxs(rt.Message,{className:"mt-3",children:["If your school has SSO ",A.jsx("a",{href:e.getSignInUrl({email:e.email,customerId:e.customerId}),className:"info-link",children:"click here to sign in."})]}),A.jsx(rt.Message,{children:"Otherwise please contact your school admin for access."})]}):A.jsxs(A.Fragment,{children:[A.jsx(rt.Heading,{children:"Good News!"}),A.jsxs(rt.Message,{children:["An account already exists for:",A.jsx("br",{})," ",A.jsx("strong",{children:e.email})]}),A.jsx(rt.Message,{children:A.jsx("a",{href:e.getSignInUrl({email:e.email}),className:"btn btn-dark btn-lg w-100",children:"Sign into ClickView"})})]}),A.jsxs(rt.Message,{children:["Need Help? ",A.jsx("a",{href:wo.getSupportUrlForGeoLocation(e.geoLocation),className:"info-link",target:"_blank",children:"Contact our Help Centre."})]})]})}function ate(e){const r=wo.getMarketingSalesContactForGeoLocation(e.geoLocation),t=(e==null?void 0:e.previousStepIds)&&e.previousStepIds[e.previousStepIds.length-1]==="find-school",a=(e==null?void 0:e.schoolName)||"Your school";return A.jsxs(rt.Body,{children:[A.jsx(rt.Heading,{children:t?`${a} trial has expired`:"Your trial has expired"}),A.jsxs(rt.Message,{children:["Please contact our ",A.jsx("a",{href:r,className:"info-link",target:"_blank",children:"ClickView Sales Team"})]})]})}function ite(e){const r=wo.getMarketingSalesContactForGeoLocation(e.geoLocation);return A.jsxs(rt.Body,{children:[A.jsxs(rt.Heading,{children:["Your school no longer",A.jsx("br",{})," has access to ClickView"]}),A.jsxs(rt.Message,{children:["Please contact our ",A.jsx("a",{href:r,className:"info-link",children:"ClickView Sales Team"})," for more information."]})]})}function ote(){return A.jsxs(rt.Body,{children:[A.jsxs(rt.Heading,{className:"px-2 px-lg-4",children:["ClickView isn't currently ",A.jsx("br",{})," available for your school"]}),A.jsx(rt.Message,{children:"We're working hard to get ClickView ready for more people."})]})}const ste=1;function ute(e){const[r,t]=je.useState(0),[a,o]=je.useState(!1);async function s(p){p==null||p.preventDefault();try{await mo.resendTrialEmail(e.ajaxUrls,e.userId,{email:e.email,appLink:e.pageAppLinkString}),t(r+1)}catch{o(!0)}e.logUserAction({},{actionType:sn.Click,descriptor:Yt.ResendEmail})}function u(p){p==null||p.preventDefault(),e.logUserAction({},{actionType:sn.Click,descriptor:Yt.WrongEmail}),e.nextStep({step:"enter-email",userType:e.userType})}if(e!=null&&e.email)return A.jsxs(rt.Body,{children:[A.jsx(rt.Heading,{children:"Check your inbox!"}),A.jsxs(rt.Message,{children:["An email has been sent to ",A.jsx("strong",{children:e.email}),"."]}),!!e.userId&&A.jsxs(A.Fragment,{children:[r<ste?A.jsx("button",{onClick:s,className:"btn btn-outline-dark btn-lg mb-3",children:"Resend verification email"}):A.jsx(rt.Message,{children:"✅ Email has been resent!"}),A.jsxs(rt.Message,{children:["Wrong email? ",A.jsx("button",{onClick:u,className:"btn info-link p-0 align-top border-0",children:"Update email address"})]}),a&&A.jsxs(rt.Message,{className:"mb-0 text-danger",children:["❌ There was a problem resending the email. Please try again later or contact our  ",A.jsx("a",{href:wo.getSupportUrlForGeoLocation(e.geoLocation),className:"info-link",children:"support"})]})]})]})}const lte={[Dr.Available]:ute,[Dr.Active]:Fc,[Dr.Expired]:ate,[Dr.NotRequired]:Fc,[Dr.Unavailable]:ite,[Dr.Unsupported]:ote,[Dr.UserAutoJoinAllowed]:Fc,[Dr.UserJoinApprovalRequired]:Fc,[Dr.InvalidEmail]:null,[Dr.BdmTrialAvailable]:null};function cte(e){const r=lte[e.trialStatus];return r?A.jsx(r,{...e}):A.jsx(A.Fragment,{})}function fte(e){return je.useEffect(()=>{const r={actionType:sn.Create,descriptor:Yt.DeadEnd,workflowPhase:Ua.Discard};e.trialCreated&&(r.descriptor=Yt.TrialCreated,r.workflowPhase=Ua.Complete),e.logUserAction({},r)},[]),A.jsxs(A.Fragment,{children:[A.jsx(Rl,{trialStatus:e.trialStatus,imageUrls:e.imageUrls}),A.jsx(cte,{...e})]})}const dte="young-student";function hte(e){const r=wo.getFreeResourcesForGeoLocation(e.geoLocation);return je.useEffect(()=>{Tn.set(dte,!0)},[]),A.jsxs(A.Fragment,{children:[A.jsx(Rl,{trialStatus:Dr.Active,imageUrls:e.imageUrls}),A.jsxs(rt.Body,{className:"mb-3",children:[A.jsx(rt.Heading,{children:"Discover our free content"}),A.jsx(rt.Message,{children:"Click the button below to explore our videos"}),A.jsx("a",{href:r,className:"btn btn-lg btn-dark w-100",target:"_blank",children:"Start watching now"})]})]})}const vte={"trial-status":fte,"added-to-braze":ete,"young-student":hte,"requested-access":rte};function pte(e){const r=vte[e.completionStep];return A.jsx("div",{className:"d-flex justify-content-center flex-column mx-auto px-2",children:A.jsx(r,{...e})})}const gte="_day_n6ysn_1",mte="_month_n6ysn_4",yte="_year_n6ysn_7",fb={day:gte,month:mte,year:yte},bte=120,_te=16;function Ste(e,r,t){const a=new Date(_F(e,r,t));return!isNaN(+a)}function _F(e,r,t){return`${e.padStart(4,"0")}-${r.padStart(2,"0")}-${t.padStart(2,"0")}`}function wte(e){const[r,t]=je.useState(""),[a,o]=je.useState(""),[s,u]=je.useState(""),[p,d]=je.useState(null);function h(v){t(v.target.value),d(null)}function f(v){o(v.target.value),d(null)}function c(v){u(v.target.value),d(null)}function _(){return!r||!a||!s?(d("Please enter your date of birth"),!1):Ste(s,a,r)?+s>S?(d("Please enter a date in the past"),!1):+s<S-bte?(d("Please enter a realistic date of birth"),!1):!0:(d("Please enter a valid date"),!1)}function E(v){if(v.preventDefault(),!_())return;const y=new Date(_F(s,a,r)),g=S-_te,x=new Date;if(x.setFullYear(g),y>x){e.complete({completionStep:"young-student",trialCreated:!1,trialStatus:null});return}e.nextStep({step:"enter-email",userType:e.userType})}const S=new Date().getFullYear(),w="mx-2 d-inline-block text-start",R=`form-control form-control-lg ${p?"is-invalid":""}`;let b="order-0",I="order-3";const m=Zt.isCountryCodeUS(e.geoLocation.countryCode);return m&&(b="order-3",I="order-0"),A.jsxs("form",{className:"text-center",onSubmit:E,noValidate:!0,children:[A.jsx("h1",{className:"h4",children:"Tell us a little about yourself"}),A.jsx("p",{children:"Please enter your date of birth"}),A.jsxs("div",{className:"my-4",children:[A.jsxs("fieldset",{className:"d-flex justify-content-center","aria-describedby":"dateOfBirthError",children:[A.jsxs("div",{className:`${w} ${b}`,children:[A.jsx("label",{className:"mb-0",htmlFor:"day",children:"Day"}),A.jsx("input",{id:"day",type:"number",className:`${R} ${fb.day}`,min:"1",max:"31",placeholder:"DD",value:r,onChange:h,autoFocus:!m,tabIndex:m?2:1})]}),A.jsx("span",{className:`h1 fw-normal mt-3 mb-0 order-1 ${p?"text-danger":""}`,children:"/"}),A.jsxs("div",{className:`${w} ${I}`,children:[A.jsx("label",{className:"mb-0",htmlFor:"month",children:"Month"}),A.jsx("input",{id:"month",type:"number",className:`${R} ${fb.month}`,min:"1",max:"12",placeholder:"MM",value:a,onChange:f,autoFocus:m,tabIndex:m?1:2})]}),A.jsx("span",{className:`h1 fw-normal mt-3 mb-0 order-4 ${p?"text-danger":""}`,children:"/"}),A.jsxs("div",{className:`${w} order-5`,children:[A.jsx("label",{className:"mb-0",htmlFor:"year",children:"Year"}),A.jsx("input",{id:"year",name:"year",type:"number",className:`${R} ${fb.year}`,min:S-120,max:S,placeholder:"YYYY",value:s,onChange:c,tabIndex:3})]})]}),!!p&&A.jsx(Ht,{name:"dateofBirth",children:p})]}),A.jsx("button",{type:"submit",className:"btn btn-lg btn-dark w-100",children:"Continue"})]})}function Ete(e){return A.jsxs(A.Fragment,{children:["Have a ClickView account already?",A.jsx("a",{href:e.link,className:"info-link ms-1",onClick:e.onClick,children:"Sign in"})]})}function Cte(){const e={},r=bi.getEncodedAttributionData();r&&(e.r=r);const t=ss.getUtmParameters();return t&&(e.utms=t),JSON.stringify(e)}const xte=new RegExp(/^[^\s@]+@[^\s@]+\.[^\s@]+$/),OD={[Ze.AU]:"valerie.frizzle@school.edu.au",[Ze.UK]:"valerie.frizzle@school.gov.uk",[Ze.US]:"valerie.frizzle@school.gov",[Ze.NZ]:"valerie.frizzle@school.nz",[Ze.CA]:"valerie.frizzle@school.ca"},Ite={[Ze.AU]:"/contact-us/support",[Ze.US]:"/contact-us/support",[Ze.NZ]:"/contact-us/",[Ze.UK]:"/contact-us/technical/",[Ze.CA]:"/contact-us/support"};function Ate(e){const r=wo.getMarketingUrlForGeoLocation(e),t=Zt.getCountryCode(e==null?void 0:e.countryCode),a=Ite[t];return`${r}${a}`}function Tte(e){const r=OD[Zt.getCountryCode(e.countryCode)];return r||OD.us}const Rte=[Dr.Expired,Dr.NotRequired,Dr.Unavailable,Dr.Unsupported,Dr.Active];function Ote(e){const[r,t]=je.useState(!1),[a,o]=je.useState((e==null?void 0:e.email)||""),[s,u]=je.useState(),p=Ate(e.geoLocation);async function d(){u("");let S;try{S=await mo.checkTrialStatus(e.ajaxUrls,{email:a})}catch{u("Something went wrong! Please try again later.");return}if(S.status===Dr.InvalidEmail){u("Please use your school email address.");return}if(e.logUserAction({},{actionType:sn.Click,workflowPhase:Ua.Next,descriptor:Yt.EnterEmail}),Rte.includes(S.status)){e.complete({completionStep:"trial-status",email:a,trialStatus:S.status,trialCreated:!1});return}try{const w=await mo.checkUserIdps(e.ajaxUrls,a);if(w.length){e.nextStep({step:"select-idp",email:a,userTrialStatus:S.status,idps:w});return}}catch{u("Something went wrong! Please try again later.");return}e.nextStep({step:"find-school",email:a,userTrialStatus:S.status})}function h(){e.logUserAction({},{actionType:sn.Click,descriptor:Yt.ContactUs})}function f(){return a.length?xte.test(a)?!0:(u("Please use your school email address."),!1):(u("Please enter your school email address."),!1)}function c(){e.logUserAction({},{actionType:sn.Click,descriptor:Yt.SignIn})}function _(S){S.preventDefault(),o(S.target.value),u("")}async function E(S){S==null||S.preventDefault(),f()&&(t(!0),await d(),t(!1))}return A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"text-center",children:[A.jsx("h1",{className:"h4",children:"Let's set up your account"}),A.jsx("p",{children:"Enter your school email address"})]}),A.jsxs("form",{onSubmit:E,noValidate:!0,children:[A.jsxs("div",{className:"form-group mb-3",children:[A.jsx(Bs,{value:a,onChange:_,name:"email-input",id:"email-input",type:"email",className:`form-control form-control-lg ${s?"is-invalid":""}`,placeholder:Tte(e.geoLocation),autoComplete:"false",autoCorrect:"false",autoFocus:!0,onClickClear:()=>o(""),"aria-errormessage":"email-inputError"}),s&&A.jsxs(A.Fragment,{children:[A.jsx(Ht,{name:"error-input",children:s}),A.jsxs("small",{children:["Having an issue with your email?",A.jsx("a",{href:p,className:"info-link ps-1",target:"_blank",onClick:h,children:"Contact our team"})]})]})]}),A.jsx(zf,{showSpinner:r,variant:"dark",className:"btn-lg mb-3 w-100",disabled:r,onClick:E,children:"Continue"})]}),e.userType===In.Staff&&A.jsx(h_,{idps:e.globalIdps,className:"mt-n3",attribution:Cte()}),A.jsx("div",{className:"text-center",children:A.jsx(Ete,{link:e.getSignInUrl({email:a}),onClick:c})})]})}function kte(e){var r;switch((r=e==null?void 0:e.body)==null?void 0:r.type){case"user-type-not-supported":return"Students may not request to join schools.";case"join-request-already-pending":return"Your request is awaiting administrator approval.";case"join-request-already-denied":return"Your request has been denied by an administrator.";case"join-request-not-allowed":case"user-email-domain-not-approved":case"user-email-invalid":case"create-join-request-failed":case"join-not-required":default:return"Something went wrong."}}var K_=(e=>(e.MasterId="master_id",e.CrmId="crm_id",e.SalesforceId="salesforce_id",e))(K_||{});function Pte(e){const[r,t]=je.useState(null);async function a(){var o;try{const u=(o=(await Zf.getLookups(e.ajaxUrls,e.prospectId)).find(p=>p.type===K_.MasterId))==null?void 0:o.externalId;if(!u){t("Something went wrong.");return}await mo.createJoinRequest(e.ajaxUrls,{customerId:u,email:e.email}),e.logUserAction({},{actionType:sn.Click,descriptor:Yt.RequestAccess}),e.complete({completionStep:"requested-access",trialCreated:!1,trialStatus:Dr.UserJoinApprovalRequired})}catch(s){t(kte(s))}}return A.jsxs(A.Fragment,{children:[A.jsx(Rl,{trialStatus:Dr.UserJoinApprovalRequired,imageUrls:e.imageUrls}),A.jsx(rt.Body,{className:"mb-3",children:A.jsxs(rt.Heading,{children:[e.schoolName,A.jsx("br",{}),"already has ClickView 🎉"]})}),A.jsx("button",{className:"btn btn-lg btn-dark w-100 mb-3",onClick:a,children:"Request access"}),r&&A.jsx("p",{className:"text-danger text-center mb-2",children:r}),A.jsxs(rt.Message,{className:"text-center",children:["Need Help? ",A.jsx("a",{href:wo.getSupportUrlForGeoLocation(e.geoLocation),className:"info-link",target:"_blank",children:"Contact our Help Centre."})]})]})}const Nte={checkEmail(e,r,t){return e.productName!==La.Lite?Promise.reject():ri.asyncFetch({url:e.brazeCheckEmail,method:Li.POST,data:{email:r,instanceRegion:t}})}};function jte(e){var f;const[r,t]=je.useState(!1),[a,o]=je.useState({});function s(c){if(EM(c.jobTitle)){h();return}p(c)}function u(){var _;const c=Zt.getCountryCode(e.country||((_=e.geoLocation)==null?void 0:_.countryCode));return Zt.getInstanceRegion(c)}async function p(c){var S;if(r)return;if(e.userType===In.Learner){o({...a,submission:"Something went wrong! Please try again later."});return}e.logUserAction({},{actionType:sn.Click,workflowPhase:Ua.Next,descriptor:Yt.RequestBdmTrial}),t(!0);const{firstName:_,surname:E}=V_(c.fullname);try{const w=await Nte.checkEmail(e.ajaxUrls,e.email,u()),R={email:e.email,firstName:_,lastName:E,phone:c.phone,custom:{orgSubType:Kt.getSchoolType(e==null?void 0:e.schoolType),accountName:e==null?void 0:e.schoolName,jobTitle:c.jobTitle,accountAddress:{countryCode:e==null?void 0:e.country,province:Kt.parseProvince((e==null?void 0:e.province)||"")},syncToCrm:((S=w.users)==null?void 0:S.length)===0?!0:void 0,source:Kt.BDM_SOURCE},event:{eventTopic:Kt.BDM_EVENT_TOPIC}},b={prospect_id:e==null?void 0:e.prospectId};e.logBrazeEvent({user:R,event:{eventType:Tl.ProductFormEvent.BdmTrialRequested,additionalData:b,callback:d}})}catch{o({...a,submission:"Something went wrong! Please try again later."})}Object.keys(a).length||h()}function d(c){o(c?{}:{...a,submission:"Something went wrong! Please try again later."}),t(!1)}function h(){e.complete({completionStep:"added-to-braze",trialCreated:!1,trialStatus:null})}return A.jsx(fF,{loading:r,errors:a,setErrors:o,country:e.country||((f=e.geoLocation)==null?void 0:f.countryCode),logUserAction:e.logUserAction,handleSubmitForm:s,isTertiary:Kt.isTertiarySchool(e.schoolType)})}function qte(e){const{loading:r,canSubmitForm:t,setSubmissionError:a,prospectStatus:o,userType:s,logStepEvent:u,logUserAction:p,nextStep:d,data:h,productName:f,ajaxUrls:c,complete:_,setLoadingState:E,email:S,userTrialStatus:w,pageAppLinkString:R,setProperty:b,logBrazeEvent:I,createOrUpdateProfile:m}=e;function v(){d({step:"add-to-braze",trialStatus:o,...h}),u()}function y(){if(u(),s!==In.Staff){_({completionStep:"added-to-braze",trialCreated:!1,trialStatus:null});return}d({step:"request-bdm-trial",...h})}function g(){d({step:"request-access",...h}),u()}async function x(){try{await mo.createAutoJoinRequest(c,{prospectId:h.prospectId,email:S}),p({},{actionType:sn.Click,descriptor:Yt.AutoJoin}),_({completionStep:"trial-status",trialCreated:!0,trialStatus:Dr.Available,...h})}catch{a("Something went wrong! Please try again later."),E(!1);return}}async function T(){var L;let N;h!=null&&h.prospectId&&o===Dr.NotRequired&&(N=(L=(await Zf.getLookups(c,h.prospectId)).find(B=>B.type===K_.MasterId))==null?void 0:L.externalId),_({completionStep:"trial-status",trialStatus:o,trialCreated:!1,customerId:N,...h}),u()}function O(){return o===Dr.Active||o===Dr.Available?!0:o===Dr.UserAutoJoinAllowed?f===La.Auth:!1}async function j(){if(s!==In.Staff)return;const N={email:S,custom:{accountName:h==null?void 0:h.schoolName,accountAddress:{countryCode:h==null?void 0:h.country,province:Kt.parseProvince(h.province)},orgSubType:Kt.getSchoolType(h==null?void 0:h.schoolType),syncToCrm:!0,source:Kt.SOURCE},event:{accountCountry:h==null?void 0:h.country,accountPostCode:h==null?void 0:h.schoolPostCode,accountState:Kt.parseProvince(h.province)}},L={form_type:"trial-sign-up",prospect_id:h==null?void 0:h.prospectId};I({user:N,event:{eventType:Tl.ProductFormEvent.FormSubmission,additionalData:L}})}async function k(){var L;E(!0);let N;try{N=await mo.createTrial(c,{userType:s,email:S,prospectId:h==null?void 0:h.prospectId,appLink:R,attribution:{...bi.getDecodedAttributionData(),utms:ss.getUtmParameters()}})}catch{a("Something went wrong! Please try again later."),E(!1);return}o===Dr.UserAutoJoinAllowed&&p({},{actionType:sn.Click,descriptor:Yt.AutoJoin}),b("userId",N.id),_({completionStep:"trial-status",userId:N.id,trialCreated:!0,trialStatus:Dr.Available,customerId:(L=N.data)==null?void 0:L.customerId,...h}),j(),m&&m({masterId:N.id,email:S,countryCode:h==null?void 0:h.country}),u()}return async function(){if(!r){if(!t()){a("Something went wrong! Please try again later.");return}if(w===Dr.BdmTrialAvailable)return y();if(s===In.Staff){if(o===Dr.Unsupported)return v();if(o===Dr.UserJoinApprovalRequired)return g();if(o===Dr.UserAutoJoinAllowed&&f===La.Lite)return await x()}return O()?await k():await T()}}}const kD=50;function Dte(e){return e.toLowerCase().split(" ").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}function Lte(e){const r=[];return e.city&&r.push(Dte(e.city)),e.province&&r.push(e.province),e.postCode&&r.push(e.postCode),r.join(" ")}function Mte(e){const{filteredSchoolsList:r,getSchoolName:t,onSchoolSuggestionClick:a,selectedIndex:o}=e;return A.jsx(A.Fragment,{children:r.map((s,u)=>A.jsxs(Zo,{className:`${zt.suggestionItem} ${o-1===u?zt.selected:""}`,onKeyDown:p=>p.key==="Enter"&&a(s),onMouseDown:()=>a(s),onClick:()=>a(s),children:[t(s)," ",A.jsx("br",{}),A.jsx("small",{className:"text-secondary",children:Lte(s)})]},s.id))})}function Ute(e){return A.jsx("div",{className:`info-link ${zt.suggestionItem} ${zt.noSuggestion} ${e.selected?zt.selected:""}`,onKeyDown:r=>r.key==="Enter"&&e.handleNoSuggestion(),onMouseDown:e.handleNoSuggestion,onClick:e.handleNoSuggestion,children:"Can't find your school?"})}function Fte(e){var L;const r=je.useRef(null),[t,a]=je.useState(!0),[o,s]=je.useState(e.data.schoolName&&e.data.schoolPostCode?e.data.schoolName+", "+e.data.schoolPostCode:e.data.schoolName?e.data.schoolName:""),[u,p]=je.useState(),d=mF(o,250),{selectedIndex:h,onKeyDown:f,containerRef:c,hide:_,onBlur:E,onFocus:S}=g_({onSelected:w,itemCount:((u==null?void 0:u.length)??0)+1,hideOnBlur:e.hideOnBlur});function w(U){if(!u&&!U)return;if(U===u.length){e.onClickNoSuggestions(o);return}const B=u[U];B&&x(B)}const R=!!((L=e.data)!=null&&L.prospectId),b=t&&!R,I=!t&&!R&&(u==null?void 0:u.length)<kD,m=(u==null?void 0:u.length)&&!R;je.useEffect(()=>{if(!R){if(!d.length){g();return}if(!R&&d.length>1&&d===o){g(d);return}}},[d,R]);function v(U){(e.data.schoolName||e.data.prospectId)&&e.clearData(),U!==o&&s(U)}function y(){v(""),r.current.focus()}function g(U){if(!e.data.latitude&&!e.data.longitude){a(!1);return}a(!0);const B={latitude:e.data.latitude,longitude:e.data.longitude};U&&U.length&&(B.query=U),Zf.search(e.searchUrl,B,H=>p(H),null,()=>a(!1))}function x(U){s(T(U)),e.setData({prospectId:U.id,schoolName:U.name,schoolPostCode:U.postCode,schoolType:U.prospectType,province:U.province,city:U.city,country:U.countryCode})}function T(U){return U.name}const O=(m||b||I)&&!e.disabled&&!_,j=!b&&!I&&(u==null?void 0:u.length)>=kD;let k="form-control",N="form-group position-relative";return e.size==="lg"&&(k+=" form-control-lg",N+=` ${zt.large}`),A.jsxs("div",{className:N,children:[A.jsxs("label",{className:e.labelClassName,htmlFor:"school-input",children:["School",e.required&&A.jsx("span",{className:"text-danger",children:"*"})]}),A.jsx(Bs,{id:"school-input",value:o,onChange:U=>v(U.currentTarget.value),ref:r,className:k,type:"text",autoComplete:"off",placeholder:e.placeholder||"Search for your school",disabled:e.disabled,autoFocus:!0,onClickClear:y,onKeyDown:f,onFocus:S,onBlur:E}),A.jsx("div",{className:`position-absolute z-1 w-100 ${zt.dropdown} ${_?"d-none":""}`,children:A.jsx("div",{className:`${zt.suggestionContainer} ${O?"":"d-none"}`,children:A.jsxs("div",{className:zt.suggestionContainerInner,ref:c,children:[m?A.jsx(Mte,{filteredSchoolsList:u,onSchoolSuggestionClick:x,getSchoolName:T,selectedIndex:h}):b&&A.jsx("div",{className:`${zt.suggestionLoading} py-4 d-flex justify-content-center`,children:A.jsx(G_,{animation:"border"})}),j&&A.jsxs(A.Fragment,{children:[A.jsx("hr",{className:"my-0"}),A.jsx("div",{className:`${zt.suggestionItem} ${zt.noSuggestion} text-secondary text-center`,children:A.jsxs("small",{children:["Can't find your school? ",A.jsx("br",{})," Try searching to narrow the results"]})})]}),!b&&I&&A.jsx(Ute,{selected:h===u.length+1,handleNoSuggestion:()=>{e.onClickNoSuggestions(o)}})]})})})]})}function Bte(e){return(e==null?void 0:e.toLowerCase())==="au"?"Enter your school postcode or suburb":(e==null?void 0:e.toLowerCase())==="us"?"Enter your school ZIP code or city":(e==null?void 0:e.toLowerCase())==="ca"?"Enter your school postal code or city":"Enter your school postcode or city"}function $te(e){var j;const{email:r,userType:t}=e,[a,o]=je.useState({schoolLocality:e.schoolLocality,country:e.country,longitude:e.longitude,latitude:e.latitude,city:e.city,province:e.province,prospectId:e.prospectId,schoolName:e.schoolName,schoolType:e.schoolType,schoolPostCode:e.schoolPostCode}),[s,u]=je.useState(e.trialStatus),[p,d]=je.useState(),[h,f]=je.useState(!1),[c,_]=je.useState(!1),[E,S]=je.useState(!1),w=qte({...e,prospectStatus:s,loading:h,data:a,canSubmitForm:b,setSubmissionError:d,logStepEvent:I,setLoadingState:m,setProperty:v});function R(){return!!(a&&a.schoolLocality&&a.longitude&&a.latitude)}function b(){if(!a||!r||!t)return!1;const{prospectId:k}=a;return!!(r&&t&&k)}function I(){const k={actionType:sn.Click,descriptor:Yt.FindSchool,workflowPhase:Ua.Next};e.logUserAction(a||{},k)}function m(k){_(k),S(k),f(k)}function v(k,N){k==="prospectId"&&N&&(f(!0),mo.checkProspectTrialStatus(e.ajaxUrls,{prospectId:N.toString(),email:e.email},L=>{u(L.status)},()=>{console.log("error")},()=>{f(!1)})),o(L=>({...L,[k]:N}))}function y(){v("schoolLocality",void 0),v("longitude",void 0),v("latitude",void 0),v("city",void 0),v("province",void 0),v("country",void 0),g()}function g(){v("prospectId",void 0),v("schoolName",""),v("schoolPostCode",void 0),d(void 0)}function x(k){e.nextStep({step:"cant-find-school",prospectId:a.prospectId,schoolName:k,schoolLocality:a.schoolLocality,longitude:a.longitude,latitude:a.latitude,country:a.country,city:a.city,province:a.province}),e.logUserAction({},{actionType:sn.Click,descriptor:Yt.CantFindSchool,workflowPhase:Ua.Next})}function T(k){v("prospectId",k.prospectId),v("schoolName",k.schoolName),v("schoolPostCode",k.schoolPostCode),v("schoolType",k.schoolType),v("province",k.province),v("city",k.city),v("country",k.country)}function O(k){const{longitude:N,latitude:L,schoolLocality:U,country:B,city:H,province:G}=k;N&&v("longitude",N),L&&v("latitude",L),B&&v("country",B),H&&v("city",H),G&&v("province",G),U&&v("schoolLocality",U)}return A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"text-center",children:[A.jsx("h1",{className:"h4",children:"Let's find your school"}),A.jsx("p",{children:Bte((j=e.geoLocation)==null?void 0:j.countryCode)})]}),A.jsx(yF,{data:a,setData:O,clearData:y,disabled:c,geoLocation:e.geoLocation,labelClassName:"d-none",logUserAction:e.logUserAction,googleMapsApiKey:e.googleMapsApiKey,autoFocus:!0,size:"lg",useGeoLocationApi:!0}),R()&&A.jsx(Fte,{data:a,setData:T,clearData:g,disabled:E,searchUrl:e.ajaxUrls.searchProspect,onClickNoSuggestions:x,size:"lg",labelClassName:"d-none"}),p&&A.jsx("p",{className:"text-danger mb-2",children:p}),b()&&A.jsx(zf,{className:"btn-lg w-100",variant:"dark",onClick:w,showSpinner:c||E||h,disabled:c||E||h,children:"Get started"})]})}const PD=["38A2E8","7A76E8","40BCC3","F7847B"];function zte(e){const[r,t]=je.useState(null);function a(s){if(!s)return;const u=window.location.pathname+window.location.search;window.location.href=`/challenge?idp=${s.id}&redirectUrl=`+encodeURIComponent(u)}function o(){e.logUserAction({},{actionType:sn.Click,workflowPhase:Ua.Next,descriptor:Yt.SkipIdpSelect}),e.nextStep({step:"find-school",email:e.email,userTrialStatus:e.userTrialStatus})}return A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"text-center",children:[A.jsx("h1",{className:"h4",children:"Does your school already have ClickView?"}),A.jsx("p",{children:"Find your school from the list below"})]}),e.idps.length>4?A.jsxs(A.Fragment,{children:[A.jsx(Sl,{id:"idp",item:r,items:e.idps,onSelect:t,getName:s=>s.name,clearData:()=>t(null),placeholder:"Select a school",size:"lg"}),A.jsx("button",{className:"btn btn-lg btn-dark w-100 mb-3",disabled:!r,onClick:()=>a(r),children:"Continue"})]}):e.idps.map((s,u)=>A.jsx("button",{className:"btn btn-lg w-100 mb-3",onClick:()=>a(s),style:{backgroundColor:`#${PD[u%PD.length]}`,color:"#FFF"},children:s.name},u)),A.jsx("button",{className:"btn btn-link text-info w-100 no-sso-link",onClick:o,children:"My school does not have ClickView"})]})}const Zte="_userTypeOption_egazo_1",Hte="_selected_egazo_8",Vte="_mobileButtons_egazo_13",db={userTypeOption:Zte,selected:Hte,mobileButtons:Vte};function ND(e){return A.jsxs(A.Fragment,{children:[A.jsxs(Zo,{className:`
65
+ */var wD;function fre(){return wD||(wD=1,(function(e){(function(){var r={}.hasOwnProperty;function t(){for(var s="",u=0;u<arguments.length;u++){var p=arguments[u];p&&(s=o(s,a(p)))}return s}function a(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return t.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var u="";for(var p in s)r.call(s,p)&&s[p]&&(u=o(u,p));return u}function o(s,u){return u?s?s+" "+u:s+u:s}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(ub)),ub.exports}var dre=fre();const oF=al(dre),hre=["xxl","xl","lg","md","sm","xs"],vre="xs",sF=Nr.createContext({prefixes:{},breakpoints:hre,minBreakpoint:vre}),{Consumer:Qne,Provider:eae}=sF;function uF(e,r){const{prefixes:t}=Nr.useContext(sF);return e||t[r]||r}const pre=["as","disabled"];function gre(e,r){if(e==null)return{};var t={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(r.indexOf(a)>=0)continue;t[a]=e[a]}return t}function mre(e){return!e||e.trim()==="#"}function lF({tagName:e,disabled:r,href:t,target:a,rel:o,role:s,onClick:u,tabIndex:p=0,type:d}){e||(t!=null||a!=null||o!=null?e="a":e="button");const h={tagName:e};if(e==="button")return[{type:d||"button",disabled:r},h];const f=_=>{if((r||e==="a"&&mre(t))&&_.preventDefault(),r){_.stopPropagation();return}u==null||u(_)},c=_=>{_.key===" "&&(_.preventDefault(),f(_))};return e==="a"&&(t||(t="#"),r&&(t=void 0)),[{role:s??"button",disabled:void 0,tabIndex:r?void 0:p,href:t,target:e==="a"?a:void 0,"aria-disabled":r||void 0,rel:e==="a"?o:void 0,onClick:f,onKeyDown:c},h]}const yre=Nr.forwardRef((e,r)=>{let{as:t,disabled:a}=e,o=gre(e,pre);const[s,{tagName:u}]=lF(Object.assign({tagName:t,disabled:a},o));return A.jsx(u,Object.assign({},o,s,{ref:r}))});yre.displayName="Button";const cF=Nr.forwardRef(({as:e,bsPrefix:r,variant:t="primary",size:a,active:o=!1,disabled:s=!1,className:u,...p},d)=>{const h=uF(r,"btn"),[f,{tagName:c}]=lF({tagName:e,disabled:s,...p}),_=c;return A.jsx(_,{...f,...p,ref:d,disabled:s,className:oF(u,h,o&&"active",t&&`${h}-${t}`,a&&`${h}-${a}`,p.href&&s&&"disabled")})});cF.displayName="Button";const G_=Nr.forwardRef(({bsPrefix:e,variant:r,animation:t="border",size:a,as:o="div",className:s,...u},p)=>{e=uF(e,"spinner");const d=`${e}-${t}`;return A.jsx(o,{ref:p,...u,className:oF(s,d,a&&`${d}-${a}`,r&&`text-${r}`)})});G_.displayName="Spinner";function zf(e){const{showSpinner:r,children:t,style:a,spinnerText:o,...s}=e,u=Nr.useRef(null),[{width:p,height:d},h]=Nr.useState({}),[f,c]=Nr.useState(r);Nr.useEffect(()=>{if(!r){h({});return}const E=u.current,S=E.offsetHeight,w=E.offsetWidth;!S||!w||h({width:w,height:S})},[r]),Nr.useLayoutEffect(()=>{c(r)},[r]);const _={...a};return p&&(_.width=`${p+1}px`),d&&(_.height=`${d+1}px`),A.jsx(cF,{ref:u,disabled:r,style:_,...s,children:f?A.jsxs(A.Fragment,{children:[A.jsx(G_,{as:"span",animation:"border",role:"status",size:"sm"}),!!o&&A.jsx("span",{className:"ps-1",children:o})]}):t})}const Lc=/\$+[\w\s]?/,bre=/^\+?\d{4,255}$/,Mc=255;function fF(e){var E,S,w,R;const[r,t]=je.useState({fullname:"",jobTitle:"",phone:""});function a(b){b==null||b.preventDefault(),c(r)&&e.handleSubmitForm(r)}function o(b){b.preventDefault(),h("fullname",b.target.value),f("fullname"),f("submission")}function s(b){b.preventDefault(),h("phone",b.target.value.trim()),f("phone"),f("submission")}function u(b){h("jobTitle",b),f("jobTitle"),f("submission")}function p(){h("fullname",""),f("fullname"),f("submission")}function d(){h("phone",""),f("phone"),f("submission")}function h(b,I){t(m=>({...m,[b]:I}))}function f(b){if(!Object.keys(e.errors).length||!e.errors[b])return;const I={...e.errors};delete I[b],e.setErrors(I)}function c(b){const{fullname:I,jobTitle:m,phone:v}=b,{firstName:y,surname:g}=V_(I),x={};return(!y||!g)&&(x.fullname="Please enter your full name."),(Lc.test(y)||Lc.test(g))&&(x.fullname="Please enter your full name."),I.length>Mc&&(x.fullname=`Full name cannot exceed max length of ${Mc} characters.`),m!=null&&m.length||(x.jobTitle="Please enter your job title."),Lc.test(m)&&(x.jobTitle="Please enter a valid job title."),m.length>Mc&&(x.jobTitle=`Job title cannot exceed max length of ${Mc} characters.`),v!=null&&v.length||(x.phone="Please enter your phone number."),(Lc.test(v)||!bre.test(v))&&(x.phone="Please enter a valid phone number."),e.setErrors(x),!Object.keys(x).length}function _(){const{fullname:b,jobTitle:I,phone:m}=r;return!(!b.length||!I.length||!m.length||Object.keys(e.errors).length)}return A.jsxs("div",{className:"text-center",children:[A.jsx("h1",{className:"text-center h4",children:"A little more about you"}),A.jsx("p",{children:"Please enter your details."}),A.jsxs("form",{onSubmit:a,"aria-errormessage":"brazeFormError",children:[A.jsxs("div",{className:"form-group text-start",children:[A.jsx("label",{className:"d-block fw-bold mb-1",htmlFor:"fullname-input",children:"Full name"}),A.jsx(Bs,{value:r.fullname,onChange:o,name:"fullname-input",id:"fullname-input",type:"text",className:`form-control form-control-lg ${(E=e.errors.fullname)!=null&&E.length?"is-invalid":""}`,placeholder:"Enter your name",onClickClear:p,autoFocus:!0,"aria-errormessage":"fullname-inputError"}),e.errors.fullname&&A.jsx(Ht,{name:"fullname-input",children:e.errors.fullname})]}),A.jsxs("div",{className:"form-group text-start",children:[A.jsx("label",{className:"d-block fw-bold mb-1",htmlFor:"phone-input",children:"Contact number"}),A.jsx(Bs,{value:r.phone,onChange:s,name:"phone-input",id:"phone-input",type:"tel",className:`form-control form-control-lg ${(S=e.errors.phone)!=null&&S.length?"is-invalid":""}`,placeholder:"Enter your phone number",onClickClear:d,"aria-errormessage":"phone-inputError"}),e.errors.phone&&A.jsx(Ht,{name:"phone-input",children:e.errors.phone})]}),A.jsxs("div",{className:"form-group text-start",children:[A.jsx("label",{className:"d-block fw-bold mb-1",htmlFor:"jobTitle-select",children:"Job title"}),A.jsx(sre,{id:"jobTitle-select",countryCode:Zt.getCountryCode(e.country),onChange:u,error:(w=e.errors)==null?void 0:w.jobTitle,size:"lg",labelClassName:"d-none",isTertiary:e.isTertiary})]}),!!((R=e.errors)!=null&&R.submission)&&A.jsx(Ht,{name:"brazeForm",className:"form-group",children:e.errors.submission}),A.jsx("div",{className:"form-group mb-1",children:A.jsx(zf,{className:"btn-lg w-100",variant:"dark",onClick:()=>a(),showSpinner:e.loading,disabled:e.loading||!_(),children:"Submit"})})]})]})}var Dr=(e=>(e.Unavailable="unavailable",e.Expired="expired",e.Active="active",e.NotRequired="not-required",e.Available="available",e.Unsupported="unsupported",e.UserAutoJoinAllowed="user-auto-join-allowed",e.UserJoinApprovalRequired="user-join-approval-required",e.InvalidEmail="invalid-email",e.BdmTrialAvailable="bdm-trial-available",e))(Dr||{}),In=(e=>(e.Staff="staff",e.Learner="learner",e))(In||{}),lb={exports:{}},ED;function _re(){return ED||(ED=1,(function(e,r){(function(t){e.exports=t()})(function(t){var a=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function o(b,I){var m=b[0],v=b[1],y=b[2],g=b[3];m+=(v&y|~v&g)+I[0]-680876936|0,m=(m<<7|m>>>25)+v|0,g+=(m&v|~m&y)+I[1]-389564586|0,g=(g<<12|g>>>20)+m|0,y+=(g&m|~g&v)+I[2]+606105819|0,y=(y<<17|y>>>15)+g|0,v+=(y&g|~y&m)+I[3]-1044525330|0,v=(v<<22|v>>>10)+y|0,m+=(v&y|~v&g)+I[4]-176418897|0,m=(m<<7|m>>>25)+v|0,g+=(m&v|~m&y)+I[5]+1200080426|0,g=(g<<12|g>>>20)+m|0,y+=(g&m|~g&v)+I[6]-1473231341|0,y=(y<<17|y>>>15)+g|0,v+=(y&g|~y&m)+I[7]-45705983|0,v=(v<<22|v>>>10)+y|0,m+=(v&y|~v&g)+I[8]+1770035416|0,m=(m<<7|m>>>25)+v|0,g+=(m&v|~m&y)+I[9]-1958414417|0,g=(g<<12|g>>>20)+m|0,y+=(g&m|~g&v)+I[10]-42063|0,y=(y<<17|y>>>15)+g|0,v+=(y&g|~y&m)+I[11]-1990404162|0,v=(v<<22|v>>>10)+y|0,m+=(v&y|~v&g)+I[12]+1804603682|0,m=(m<<7|m>>>25)+v|0,g+=(m&v|~m&y)+I[13]-40341101|0,g=(g<<12|g>>>20)+m|0,y+=(g&m|~g&v)+I[14]-1502002290|0,y=(y<<17|y>>>15)+g|0,v+=(y&g|~y&m)+I[15]+1236535329|0,v=(v<<22|v>>>10)+y|0,m+=(v&g|y&~g)+I[1]-165796510|0,m=(m<<5|m>>>27)+v|0,g+=(m&y|v&~y)+I[6]-1069501632|0,g=(g<<9|g>>>23)+m|0,y+=(g&v|m&~v)+I[11]+643717713|0,y=(y<<14|y>>>18)+g|0,v+=(y&m|g&~m)+I[0]-373897302|0,v=(v<<20|v>>>12)+y|0,m+=(v&g|y&~g)+I[5]-701558691|0,m=(m<<5|m>>>27)+v|0,g+=(m&y|v&~y)+I[10]+38016083|0,g=(g<<9|g>>>23)+m|0,y+=(g&v|m&~v)+I[15]-660478335|0,y=(y<<14|y>>>18)+g|0,v+=(y&m|g&~m)+I[4]-405537848|0,v=(v<<20|v>>>12)+y|0,m+=(v&g|y&~g)+I[9]+568446438|0,m=(m<<5|m>>>27)+v|0,g+=(m&y|v&~y)+I[14]-1019803690|0,g=(g<<9|g>>>23)+m|0,y+=(g&v|m&~v)+I[3]-187363961|0,y=(y<<14|y>>>18)+g|0,v+=(y&m|g&~m)+I[8]+1163531501|0,v=(v<<20|v>>>12)+y|0,m+=(v&g|y&~g)+I[13]-1444681467|0,m=(m<<5|m>>>27)+v|0,g+=(m&y|v&~y)+I[2]-51403784|0,g=(g<<9|g>>>23)+m|0,y+=(g&v|m&~v)+I[7]+1735328473|0,y=(y<<14|y>>>18)+g|0,v+=(y&m|g&~m)+I[12]-1926607734|0,v=(v<<20|v>>>12)+y|0,m+=(v^y^g)+I[5]-378558|0,m=(m<<4|m>>>28)+v|0,g+=(m^v^y)+I[8]-2022574463|0,g=(g<<11|g>>>21)+m|0,y+=(g^m^v)+I[11]+1839030562|0,y=(y<<16|y>>>16)+g|0,v+=(y^g^m)+I[14]-35309556|0,v=(v<<23|v>>>9)+y|0,m+=(v^y^g)+I[1]-1530992060|0,m=(m<<4|m>>>28)+v|0,g+=(m^v^y)+I[4]+1272893353|0,g=(g<<11|g>>>21)+m|0,y+=(g^m^v)+I[7]-155497632|0,y=(y<<16|y>>>16)+g|0,v+=(y^g^m)+I[10]-1094730640|0,v=(v<<23|v>>>9)+y|0,m+=(v^y^g)+I[13]+681279174|0,m=(m<<4|m>>>28)+v|0,g+=(m^v^y)+I[0]-358537222|0,g=(g<<11|g>>>21)+m|0,y+=(g^m^v)+I[3]-722521979|0,y=(y<<16|y>>>16)+g|0,v+=(y^g^m)+I[6]+76029189|0,v=(v<<23|v>>>9)+y|0,m+=(v^y^g)+I[9]-640364487|0,m=(m<<4|m>>>28)+v|0,g+=(m^v^y)+I[12]-421815835|0,g=(g<<11|g>>>21)+m|0,y+=(g^m^v)+I[15]+530742520|0,y=(y<<16|y>>>16)+g|0,v+=(y^g^m)+I[2]-995338651|0,v=(v<<23|v>>>9)+y|0,m+=(y^(v|~g))+I[0]-198630844|0,m=(m<<6|m>>>26)+v|0,g+=(v^(m|~y))+I[7]+1126891415|0,g=(g<<10|g>>>22)+m|0,y+=(m^(g|~v))+I[14]-1416354905|0,y=(y<<15|y>>>17)+g|0,v+=(g^(y|~m))+I[5]-57434055|0,v=(v<<21|v>>>11)+y|0,m+=(y^(v|~g))+I[12]+1700485571|0,m=(m<<6|m>>>26)+v|0,g+=(v^(m|~y))+I[3]-1894986606|0,g=(g<<10|g>>>22)+m|0,y+=(m^(g|~v))+I[10]-1051523|0,y=(y<<15|y>>>17)+g|0,v+=(g^(y|~m))+I[1]-2054922799|0,v=(v<<21|v>>>11)+y|0,m+=(y^(v|~g))+I[8]+1873313359|0,m=(m<<6|m>>>26)+v|0,g+=(v^(m|~y))+I[15]-30611744|0,g=(g<<10|g>>>22)+m|0,y+=(m^(g|~v))+I[6]-1560198380|0,y=(y<<15|y>>>17)+g|0,v+=(g^(y|~m))+I[13]+1309151649|0,v=(v<<21|v>>>11)+y|0,m+=(y^(v|~g))+I[4]-145523070|0,m=(m<<6|m>>>26)+v|0,g+=(v^(m|~y))+I[11]-1120210379|0,g=(g<<10|g>>>22)+m|0,y+=(m^(g|~v))+I[2]+718787259|0,y=(y<<15|y>>>17)+g|0,v+=(g^(y|~m))+I[9]-343485551|0,v=(v<<21|v>>>11)+y|0,b[0]=m+b[0]|0,b[1]=v+b[1]|0,b[2]=y+b[2]|0,b[3]=g+b[3]|0}function s(b){var I=[],m;for(m=0;m<64;m+=4)I[m>>2]=b.charCodeAt(m)+(b.charCodeAt(m+1)<<8)+(b.charCodeAt(m+2)<<16)+(b.charCodeAt(m+3)<<24);return I}function u(b){var I=[],m;for(m=0;m<64;m+=4)I[m>>2]=b[m]+(b[m+1]<<8)+(b[m+2]<<16)+(b[m+3]<<24);return I}function p(b){var I=b.length,m=[1732584193,-271733879,-1732584194,271733878],v,y,g,x,T,O;for(v=64;v<=I;v+=64)o(m,s(b.substring(v-64,v)));for(b=b.substring(v-64),y=b.length,g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],v=0;v<y;v+=1)g[v>>2]|=b.charCodeAt(v)<<(v%4<<3);if(g[v>>2]|=128<<(v%4<<3),v>55)for(o(m,g),v=0;v<16;v+=1)g[v]=0;return x=I*8,x=x.toString(16).match(/(.*?)(.{0,8})$/),T=parseInt(x[2],16),O=parseInt(x[1],16)||0,g[14]=T,g[15]=O,o(m,g),m}function d(b){var I=b.length,m=[1732584193,-271733879,-1732584194,271733878],v,y,g,x,T,O;for(v=64;v<=I;v+=64)o(m,u(b.subarray(v-64,v)));for(b=v-64<I?b.subarray(v-64):new Uint8Array(0),y=b.length,g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],v=0;v<y;v+=1)g[v>>2]|=b[v]<<(v%4<<3);if(g[v>>2]|=128<<(v%4<<3),v>55)for(o(m,g),v=0;v<16;v+=1)g[v]=0;return x=I*8,x=x.toString(16).match(/(.*?)(.{0,8})$/),T=parseInt(x[2],16),O=parseInt(x[1],16)||0,g[14]=T,g[15]=O,o(m,g),m}function h(b){var I="",m;for(m=0;m<4;m+=1)I+=a[b>>m*8+4&15]+a[b>>m*8&15];return I}function f(b){var I;for(I=0;I<b.length;I+=1)b[I]=h(b[I]);return b.join("")}f(p("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&(function(){function b(I,m){return I=I|0||0,I<0?Math.max(I+m,0):Math.min(I,m)}ArrayBuffer.prototype.slice=function(I,m){var v=this.byteLength,y=b(I,v),g=v,x,T,O,j;return m!==t&&(g=b(m,v)),y>g?new ArrayBuffer(0):(x=g-y,T=new ArrayBuffer(x),O=new Uint8Array(T),j=new Uint8Array(this,y,x),O.set(j),T)}})();function c(b){return/[\u0080-\uFFFF]/.test(b)&&(b=unescape(encodeURIComponent(b))),b}function _(b,I){var m=b.length,v=new ArrayBuffer(m),y=new Uint8Array(v),g;for(g=0;g<m;g+=1)y[g]=b.charCodeAt(g);return I?y:v}function E(b){return String.fromCharCode.apply(null,new Uint8Array(b))}function S(b,I,m){var v=new Uint8Array(b.byteLength+I.byteLength);return v.set(new Uint8Array(b)),v.set(new Uint8Array(I),b.byteLength),v}function w(b){var I=[],m=b.length,v;for(v=0;v<m-1;v+=2)I.push(parseInt(b.substr(v,2),16));return String.fromCharCode.apply(String,I)}function R(){this.reset()}return R.prototype.append=function(b){return this.appendBinary(c(b)),this},R.prototype.appendBinary=function(b){this._buff+=b,this._length+=b.length;var I=this._buff.length,m;for(m=64;m<=I;m+=64)o(this._hash,s(this._buff.substring(m-64,m)));return this._buff=this._buff.substring(m-64),this},R.prototype.end=function(b){var I=this._buff,m=I.length,v,y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g;for(v=0;v<m;v+=1)y[v>>2]|=I.charCodeAt(v)<<(v%4<<3);return this._finish(y,m),g=f(this._hash),b&&(g=w(g)),this.reset(),g},R.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},R.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},R.prototype.setState=function(b){return this._buff=b.buff,this._length=b.length,this._hash=b.hash,this},R.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},R.prototype._finish=function(b,I){var m=I,v,y,g;if(b[m>>2]|=128<<(m%4<<3),m>55)for(o(this._hash,b),m=0;m<16;m+=1)b[m]=0;v=this._length*8,v=v.toString(16).match(/(.*?)(.{0,8})$/),y=parseInt(v[2],16),g=parseInt(v[1],16)||0,b[14]=y,b[15]=g,o(this._hash,b)},R.hash=function(b,I){return R.hashBinary(c(b),I)},R.hashBinary=function(b,I){var m=p(b),v=f(m);return I?w(v):v},R.ArrayBuffer=function(){this.reset()},R.ArrayBuffer.prototype.append=function(b){var I=S(this._buff.buffer,b),m=I.length,v;for(this._length+=b.byteLength,v=64;v<=m;v+=64)o(this._hash,u(I.subarray(v-64,v)));return this._buff=v-64<m?new Uint8Array(I.buffer.slice(v-64)):new Uint8Array(0),this},R.ArrayBuffer.prototype.end=function(b){var I=this._buff,m=I.length,v=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y,g;for(y=0;y<m;y+=1)v[y>>2]|=I[y]<<(y%4<<3);return this._finish(v,m),g=f(this._hash),b&&(g=w(g)),this.reset(),g},R.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},R.ArrayBuffer.prototype.getState=function(){var b=R.prototype.getState.call(this);return b.buff=E(b.buff),b},R.ArrayBuffer.prototype.setState=function(b){return b.buff=_(b.buff,!0),R.prototype.setState.call(this,b)},R.ArrayBuffer.prototype.destroy=R.prototype.destroy,R.ArrayBuffer.prototype._finish=R.prototype._finish,R.ArrayBuffer.hash=function(b,I){var m=d(new Uint8Array(b)),v=f(m);return I?w(v):v},R})})(lb)),lb.exports}var Sre=_re();const wre=al(Sre),CD={secondary:{label:"Secondary",isTertiary:!1},"primary & secondary":{label:"Primary & Secondary",isTertiary:!1},k12:{label:"Primary & Secondary",isTertiary:!1},primary:{label:"Primary",isTertiary:!1},special:{label:"Special",isTertiary:!1},university:{label:"University",isTertiary:!0},middle:{label:"Middle",isTertiary:!1},"fe college":{label:"FE College",isTertiary:!0},"high school":{label:"Secondary",isTertiary:!1},elementary:{label:"Primary",isTertiary:!1},"middle school":{label:"Middle",isTertiary:!1},tafe:{label:"TAFE",isTertiary:!0},college:{label:"FE College",isTertiary:!0},"sixth form college":{label:"Sixth Form College",isTertiary:!0}},Ere={england:"ENG",scotland:"SCT",wales:"WLS","northern ireland":"NIR"},Kt={hashedEmail(e){const r=e.trim().toLowerCase();return wre.hash(r)},removeEmptyKeys(e){if(Array.isArray(e))return e;const r={...e};return Object.entries(r).filter(([,t])=>!(t==null||typeof t=="string"&&!t.length)).reduce((t,[a,o])=>({...t,[a]:o===Object(o)?Kt.removeEmptyKeys(o):o}),{})},EVENT_TOPIC:"Free Trial Request",BDM_EVENT_TOPIC:"Requested free trial (Streamable Customer)",SOURCE:"cv_product_trial_requested",BDM_SOURCE:"cv_product_bdm_trial_requested",TRIAL_UPGRADE_SOURCE:"cv_product_trial_upgrade_requested",getSchoolType(e){var a;if(!e)return;const r=e.toLowerCase();if(["unknown","other"].includes(r))return;const t=(a=CD[r])==null?void 0:a.label;return t||e},isTertiarySchool(e){var r;return((r=CD[e==null?void 0:e.toLowerCase()])==null?void 0:r.isTertiary)||!1},parseProvince(e){return e.length?Ere[e.toLowerCase()]||e:""}};function Cre(e){var h;const[r,t]=je.useState(!1),[a,o]=je.useState({});je.useEffect(()=>{e.userType===In.Learner&&e.complete({completionStep:"trial-status",trialCreated:!1,trialStatus:Dr.Unsupported})},[]);function s(f){if(EM(f.jobTitle)){d();return}u(f)}async function u(f){if(r)return;if(e.userType===In.Learner){o({...a,submission:"Something went wrong! Please try again later."});return}e.logUserAction({},{actionType:sn.Click,workflowPhase:Ua.Next,descriptor:Yt.AddToBraze}),t(!0);const{firstName:c,surname:_}=V_(f.fullname);try{const E={email:e.email,firstName:c,lastName:_,phone:f.phone,custom:{orgSubType:Kt.getSchoolType(e==null?void 0:e.schoolType),accountName:e==null?void 0:e.schoolName,jobTitle:f.jobTitle,accountAddress:{countryCode:e==null?void 0:e.country,province:Kt.parseProvince((e==null?void 0:e.province)||"")},syncToCrm:!0,source:Kt.SOURCE},event:{accountCountry:e==null?void 0:e.country,accountPostCode:e==null?void 0:e.schoolPostCode,eventTopic:Kt.EVENT_TOPIC}},S={prospect_id:e==null?void 0:e.prospectId};e.logBrazeEvent({user:E,event:{eventType:Tl.ProductFormEvent.ProductTrailRequested,additionalData:S,callback:p}})}catch{o({...a,submission:"Something went wrong! Please try again later."})}Object.keys(a).length||d()}function p(f){o(f?{}:{...a,submission:"Something went wrong! Please try again later."}),t(!1)}function d(){e.complete({completionStep:"added-to-braze",trialCreated:!1,trialStatus:null})}return A.jsx(fF,{loading:r,errors:a,setErrors:o,country:e.country||((h=e.geoLocation)==null?void 0:h.countryCode),logUserAction:e.logUserAction,handleSubmitForm:s,isTertiary:Kt.isTertiarySchool(e.schoolType)})}const dF={getRandomInt(e=1e4){return Math.floor(Math.random()*Math.floor(e))}};var xre=function e(r,t){if(r===t)return!0;if(r&&t&&typeof r=="object"&&typeof t=="object"){if(r.constructor!==t.constructor)return!1;var a,o,s;if(Array.isArray(r)){if(a=r.length,a!=t.length)return!1;for(o=a;o--!==0;)if(!e(r[o],t[o]))return!1;return!0}if(r.constructor===RegExp)return r.source===t.source&&r.flags===t.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===t.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===t.toString();if(s=Object.keys(r),a=s.length,a!==Object.keys(t).length)return!1;for(o=a;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[o]))return!1;for(o=a;o--!==0;){var u=s[o];if(!e(r[u],t[u]))return!1}return!0}return r!==r&&t!==t};const xD="__googleMapsScriptId";var Ms;(function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILURE=3]="FAILURE"})(Ms||(Ms={}));class $o{constructor({apiKey:r,authReferrerPolicy:t,channel:a,client:o,id:s=xD,language:u,libraries:p=[],mapIds:d,nonce:h,region:f,retries:c=3,url:_="https://maps.googleapis.com/maps/api/js",version:E}){if(this.CALLBACK="__googleMapsCallback",this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=r,this.authReferrerPolicy=t,this.channel=a,this.client=o,this.id=s||xD,this.language=u,this.libraries=p,this.mapIds=d,this.nonce=h,this.region=f,this.retries=c,this.url=_,this.version=E,$o.instance){if(!xre(this.options,$o.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify($o.instance.options)}`);return $o.instance}$o.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?Ms.FAILURE:this.done?Ms.SUCCESS:this.loading?Ms.LOADING:Ms.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let r=this.url;return r+=`?callback=${this.CALLBACK}`,this.apiKey&&(r+=`&key=${this.apiKey}`),this.channel&&(r+=`&channel=${this.channel}`),this.client&&(r+=`&client=${this.client}`),this.libraries.length>0&&(r+=`&libraries=${this.libraries.join(",")}`),this.language&&(r+=`&language=${this.language}`),this.region&&(r+=`&region=${this.region}`),this.version&&(r+=`&v=${this.version}`),this.mapIds&&(r+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(r+=`&auth_referrer_policy=${this.authReferrerPolicy}`),r}deleteScript(){const r=document.getElementById(this.id);r&&r.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((r,t)=>{this.loadCallback(a=>{a?t(a.error):r(window.google)})})}loadCallback(r){this.callbacks.push(r),this.execute()}setScript(){if(document.getElementById(this.id)){this.callback();return}const r=this.createUrl(),t=document.createElement("script");t.id=this.id,t.type="text/javascript",t.src=r,t.onerror=this.loadErrorCallback.bind(this),t.defer=!0,t.async=!0,this.nonce&&(t.nonce=this.nonce),document.head.appendChild(t)}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(r){if(this.errors.push(r),this.errors.length<=this.retries){const t=this.errors.length*Math.pow(2,this.errors.length);console.log(`Failed to load Google Maps script, retrying in ${t} ms.`),setTimeout(()=>{this.deleteScript(),this.setScript()},t)}else this.onerrorEvent=r,this.callback()}setCallback(){window.__googleMapsCallback=this.callback.bind(this)}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(r=>{r(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version){console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),this.callback();return}this.loading||(this.loading=!0,this.setCallback(),this.setScript())}}}function ID(e){return new $o({apiKey:e.apiKey,version:"weekly",libraries:e.libraries,retries:3})}function hF(e){const r={apiKey:e.apiKey,libraries:e.libraries||["places"]},[t,a]=je.useState(!1),[o,s]=je.useState(ID(r));je.useEffect(()=>{u()},[]);function u(p,d){if(!o){s(ID(r));return}o.loadCallback(h=>{if(h){a(!1),d&&d(h);return}a(!0),p&&p()})}return{loader:o,scriptLoaded:t,onGoogleApiReady:u}}function vF(e){const{scriptLoaded:r}=hF({apiKey:e.googleApiKey}),[t,a]=je.useState();return je.useEffect(()=>{r&&a(new google.maps.places.AutocompleteService)},[r]),t}const AD="us",pF="country:placeholder:text";function Ire(e){const r=Zt.getLocalizedLocalityPlaceholderText(e==null?void 0:e.countryCode);if(r)return r;const t=Tn.cacheGet(`${pF}:${e==null?void 0:e.countryCode}`);if(t)return t}function Are(){return String.fromCharCode(96+dF.getRandomInt(26))}function Tre({apiKey:e,geoLocation:r,makeRequest:t=!0,template:a="E.g. [placeholder]",templateKey:o="[placeholder]"}){const s=vF({googleApiKey:e}),[u,p]=je.useState(()=>Ire(r));je.useEffect(()=>{if(u||!s||!t)return;const f=(r==null?void 0:r.countryCode)||AD,_={input:Are(),types:["(cities)"],region:f,componentRestrictions:{country:f}};s.getPlacePredictions(_,(E,S)=>h(E,S,f))},[u,s,r,t]);function d(f,c){Tn.cacheSet(`${pF}:${c}`,f,86400),p(f)}function h(f,c,_){if(c!==google.maps.places.PlacesServiceStatus.OK||!f){d(Zt.getLocalizedLocalityPlaceholderText(AD),_);return}const E=dF.getRandomInt(f.length),S=f[E].description;d(a.replace(o,S),_)}return u}const gF={getPlaceDetails(e){let r,t,a,o;const s=e.formatted_address;for(const u of e.address_components)for(const p of u.types)p==="locality"&&(r=u.short_name),p==="administrative_area_level_1"&&(t=u.short_name),p==="postal_code"&&(o=u.short_name),p==="country"&&(a=u.short_name);return{locality:s,country:a,postalCode:o,city:r,province:t}}},Rre={1:"geocoderPermissionDenied",2:"geocoderUnavailable",3:"geocoderTimeout"};function Ore(e){const[r,t]=je.useState({}),{onGoogleApiReady:a}=hF(e);function o(){a(()=>{window.navigator.geolocation.getCurrentPosition(s,u)})}function s(p){const{latitude:d,longitude:h}=p.coords,f=new google.maps.LatLng(d,h);new google.maps.Geocoder().geocode({location:f},(_,E)=>{if(E!==google.maps.GeocoderStatus.OK)return;const S=_.find(R=>R.types.includes("locality")||R.types.includes("administrative_area_level_2")),w=gF.getPlaceDetails(S);t({...w,longitude:h,latitude:d})})}function u(p){Rre[p.code],e.onPositionError("We are unable to access your location. Please try again later.")}return{placeDetails:r,onClickGetCurrentLocation:o}}const mF=(e,r)=>{const[t,a]=je.useState(e);return je.useEffect(()=>{const o=setTimeout(()=>a(e),r);return()=>clearTimeout(o)},[e,r]),t};function kre({search:e,makePredicition:r,geoLocation:t,apiKey:a}){const o=vF({googleApiKey:a}),s=mF(e,300),[u,p]=je.useState();je.useEffect(()=>{if(!o)return;if((s==null?void 0:s.length)===0||!r){p(void 0);return}const f=(t==null?void 0:t.countryCode)||"us";o.getPlacePredictions({input:s,componentRestrictions:t!=null&&t.isFallback?void 0:{country:f},region:f,types:["locality","sublocality","postal_code"]},d)},[s,r,o]);function d(f,c){if(c!==google.maps.places.PlacesServiceStatus.OK||!f){p(void 0);return}p(f)}function h(f,c,_){new google.maps.places.PlacesService(c.current).getDetails({placeId:f.place_id,fields:["geometry","address_components","formatted_address"],region:t.countryCode},(S,w)=>{if(w!==google.maps.places.PlacesServiceStatus.OK)return;const R=S.geometry.location.lng(),b=S.geometry.location.lat(),{locality:I,country:m,postalCode:v,city:y,province:g}=gF.getPlaceDetails(S);_({longitude:R,latitude:b,locality:I,country:m,city:y,postalCode:v,province:g})})}return{localityPredicitions:u,getPlaceInfo:h}}function TD(){return A.jsx("svg",{viewBox:"0 0 24 24",children:A.jsx("path",{d:"m12.00559,20.40189c4.60881,0 8.37242,-3.78424 8.37242,-8.40189c0,-4.61764 -3.76361,-8.40187 -8.37242,-8.40187c-4.62002,0 -8.38365,3.78422 -8.38365,8.40187c0,4.61765 3.76364,8.40189 8.38365,8.40189zm0,-1.65557c-3.75235,0 -6.67085,-2.96208 -6.67085,-6.74632c0,-3.7842 2.91851,-6.74625 6.67085,-6.74625c3.74105,0 6.67084,2.96206 6.67084,6.74625c0,3.78424 -2.92978,6.74632 -6.67084,6.74632zm-10.14151,-6.02552l6.01731,0c0.40566,0 0.72118,-0.31536 0.72118,-0.7208c0,-0.40544 -0.31552,-0.7208 -0.72118,-0.7208l-6.01731,0c-0.40566,0 -0.72117,0.31536 -0.72117,0.7208c0,0.40544 0.31551,0.7208 0.72118,0.7208l-0.00001,0zm14.25442,0l6.0174,0c0.40565,0 0.72118,-0.31536 0.72118,-0.7208c0,-0.40544 -0.31553,-0.7208 -0.72118,-0.7208l-6.0174,0c-0.40565,0 -0.72118,0.31536 -0.72118,0.7208c0,0.40544 0.31553,0.7208 0.72118,0.7208zm-4.12417,-4.1221c0.40566,0 0.72118,-0.31534 0.72118,-0.70952l0,-6.02547c0,-0.40544 -0.31552,-0.7208 -0.72118,-0.7208c-0.3944,0 -0.7099,0.31536 -0.7099,0.7208l0,6.02547c0,0.39418 0.31551,0.70952 0.7099,0.70952zm0,14.25838c0.40566,0 0.72118,-0.3154 0.72118,-0.72077l0,-6.02541c0,-0.39425 -0.31552,-0.70965 -0.72118,-0.70965c-0.3944,0 -0.7099,0.3154 -0.7099,0.70965l0,6.02541c0,0.40538 0.31551,0.72077 0.7099,0.72077z"})})}const Pre="_baseText_bmazz_1",Nre="_dropdown_bmazz_4",jre="_suggestionContainer_bmazz_7",qre="_suggestionContainerInner_bmazz_13",Dre="_suggestionItem_bmazz_18",Lre="_suggestionLoading_bmazz_18",Mre="_noSuggestion_bmazz_18",Ure="_large_bmazz_22",Fre="_selected_bmazz_32",Bre="_useMyLocation_bmazz_36",zt={baseText:Pre,dropdown:Nre,suggestionContainer:jre,suggestionContainerInner:qre,suggestionItem:Dre,suggestionLoading:Lre,noSuggestion:Mre,large:Ure,selected:Fre,useMyLocation:Bre};function $re(e){const{predictions:r,getPlaceInfo:t,selectedIndex:a}=e;return A.jsx(A.Fragment,{children:r.map((o,s)=>A.jsx(Zo,{className:`${zt.suggestionItem} ${a-1===s?zt.selected:""}`,onKeyDown:u=>u.key==="Enter"&&t(o),onMouseDown:()=>t(o),onClick:()=>t(o),children:o.description},o.place_id))})}function yF(e){var H,G,$,M,D;const r=je.useRef(null),[t,a]=je.useState(((H=e.data)==null?void 0:H.schoolLocality)||""),[o,s]=je.useState(!1),u=Tre({apiKey:e.googleMapsApiKey,geoLocation:e.geoLocation}),{localityPredicitions:p,getPlaceInfo:d}=kre({search:t,makePredicition:o,geoLocation:e.geoLocation,apiKey:e.googleMapsApiKey}),{placeDetails:h,onClickGetCurrentLocation:f}=Ore({apiKey:e.googleMapsApiKey,onPositionError:v}),c=window.navigator.geolocation?1:0,{selectedIndex:_,onKeyDown:E,containerRef:S,hide:w,onBlur:R,onFocus:b}=g_({onSelected:x,itemCount:((p==null?void 0:p.length)??0)+c,hideOnBlur:e.hideOnBlur}),[I,m]=je.useState();je.useEffect(()=>{T(h)},[h]);function v(F){s(!0),m(F)}function y(F){var V,ae,oe;I&&m(void 0),o||s(!0),((V=e.data)!=null&&V.longitude||(ae=e.data)!=null&&ae.latitude||(oe=e.data)!=null&&oe.schoolLocality)&&e.clearData(),a(F)}function g(){y(""),r.current.focus()}function x(F){if(!p)return;if(F===p.length){j();return}const V=p[F];V&&O(V)}function T(F){e.setData({schoolLocality:F.locality,country:F.country,province:F.province,schoolPostCode:F.postalCode,longitude:F.longitude,latitude:F.latitude}),F.locality&&a(F.locality)}function O(F){o&&s(!1),d(F,r,T)}function j(F){var V;F==null||F.preventDefault(),s(!1),f(),(V=e.logUserAction)==null||V.call(e,{},{actionType:sn.Click,descriptor:Yt.UseMyLocation})}function k(){let F="form-control";return e.size==="lg"&&(F+=" form-control-lg"),F}const N=(p==null?void 0:p.length)&&!(($=(G=e.data)==null?void 0:G.schoolLocality)!=null&&$.length),L=window.navigator.geolocation&&!((D=(M=e.data)==null?void 0:M.schoolLocality)!=null&&D.length),U=e.labelClassName||`d-block text-center mb-3 fw-normal ${zt.baseText}`;let B="form-group position-relative";return e.size==="lg"&&(B+=` ${zt.large}`),A.jsxs("div",{className:B,children:[A.jsxs("label",{className:U,htmlFor:"locality-input",children:["ZIP code or city",e.required&&A.jsx("span",{className:"text-danger",children:"*"})]}),A.jsx(Bs,{type:"text",value:t,onChange:F=>y(F.currentTarget.value),id:"locality-input",className:k(),ref:r,autoComplete:"off",placeholder:u||"Loading...",disabled:e.disabled||!u,autoFocus:e==null?void 0:e.autoFocus,onClickClear:g,onKeyDown:E,onFocus:b,onBlur:R}),A.jsxs("div",{className:`position-absolute z-1 w-100 ${zt.dropdown} ${w?"d-none":""}`,children:[!!N&&A.jsx("div",{className:zt.suggestionContainer,children:A.jsxs("div",{className:zt.suggestionContainerInner,ref:S,children:[A.jsx($re,{predictions:p,getPlaceInfo:O,selectedIndex:_}),window.navigator.geolocation&&e.useGeoLocationApi&&A.jsx(Zo,{className:Ma(zt.suggestionItem,"px-1",_-1===p.length?zt.selected:""),onClick:j,children:A.jsxs("div",{className:"btn btn-link info-link btn-with-icon bg-transparent py-0 pe-1",children:[A.jsx(TD,{}),"Use my current location"]})})]})}),L&&!N&&e.useGeoLocationApi&&A.jsx("div",{className:`d-flex ${zt.useMyLocation}`,children:A.jsxs("button",{onClick:j,className:"btn btn-link info-link bg-white btn-with-icon",children:[A.jsx(TD,{}),"Use my current location"]})}),!!I&&A.jsx("div",{className:"text-danger p-2",children:I})]})]})}var Li=(e=>(e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e))(Li||{});class zre extends Error{constructor(r,t="Error"){super(t),this.body=r}}const Zre={prepareQuery(e,r){let t=e;return Object.keys(r).forEach((a,o)=>{r[a]&&(o===0?t+="?":t+="&",t+=`${a}=${encodeURIComponent(r[a])}`)}),t}};function cb(e){let r={method:Li.GET,headers:{"Content-type":"application/json"}};e.method&&(r={...r,method:e.method}),e.init&&(r={...r,...e.init});let t=e.url;return r.method===Li.GET&&e.data?t=Zre.prepareQuery(t,e.data):e.data&&(r={...r,body:JSON.stringify(e.data)}),{init:r,url:t}}const ri={async asyncFetch(e){const r=cb(e),t=await fetch(r.url,r.init);if(!t.ok){const a=await t.json();throw new zre(a)}if(t.status!==204)return await t.json()},async asyncFetchPlain(e){const r=cb(e),t=await fetch(r.url,r.init);if(t.ok)return await t.text()},fetch(e){const r=cb(e);return fetch(r.url,r.init).then(t=>{if(t.status!==204)return t.json()}).then(t=>(e.success&&e.success(t),t)).catch(t=>(e.error&&e.error(),t)).finally(()=>{e.always&&e.always()})}},Zf={search(e,r,t,a,o){const s={longitude:r.longitude,latitude:r.latitude};r.query&&(s.query=r.query),ri.fetch({url:e,data:s,success:t,error:a,always:o})},async create(e,r){return ri.asyncFetch({url:e.createProspect,method:Li.POST,data:r})},getLookups(e,r){return ri.asyncFetch({url:e.prospectLookups(r)})}},Hre=/\/$/,Vre={urlBuilder(e,r){const a=Object.entries(r).map(([o,s])=>o&&Array.isArray(s)?s.map(p=>`${o}=${encodeURIComponent(p)}`).join("&"):o&&s!==void 0&&s!==null?`${o}=${encodeURIComponent(s)}`:"").reduce((o,s)=>s?o?`${o}&${s}`:s:o,"");return a?`${e}?${a}`:e},buildFilter(e){const r=[];if(e.limit&&r.push(`limit:${e.limit}`),e.cursor&&r.push(`page:${e.cursor}`),e.before&&r.push(`dateCreated:...${e.before}`),!!r.length)return r.join(",")},makeHttps(e){return typeof e!="string"||e.indexOf("http://")===-1||(e=e.replace("http://","https://")),e},safeUrlConcat(e,r){if(!e)return;let t=e;return e.endsWith("/")||(t+="/"),r&&(t+=r.startsWith("/")?r.slice(1):r),t},removeTrailingSlash(e){if(typeof e=="string")return e.replace(Hre,"")},getHostname(e){if(!e)return window.location.hostname;try{return new URL(e).hostname}catch{return null}}},mo={checkTrialStatus(e,r){if(e.productName!==La.Lite)return Promise.reject();const t={email:r.email};return ri.asyncFetch({url:e.userStatus,data:t})},checkUserIdps(e,r){return e.productName!==La.Lite?Promise.reject():ri.asyncFetch({url:e.idps,data:{email:r}})},checkProspectTrialStatus(e,r,t,a,o){let s=e.prospectStatus(r.prospectId);s=Vre.urlBuilder(s,{email:r.email}),ri.fetch({url:s,success:t,error:a,always:o})},createTrial(e,r){const t={prospectId:r.prospectId,email:r.email,userType:r.userType,appLink:r==null?void 0:r.appLink,attribution:r==null?void 0:r.attribution};return ri.asyncFetch({url:e.createTrial,method:Li.POST,data:t})},resendTrialEmail(e,r,t){if(e.productName!==La.Lite)return Promise.reject();const a={email:t.email,appLink:t==null?void 0:t.appLink};return ri.asyncFetch({url:e.resendTrialEmail(r),method:Li.POST,data:a})},createJoinRequest(e,r){const t=e.productName===La.Auth?e.joinRequest:e.joinRequest(r.customerId),a=e.productName===La.Auth?r:{email:r.email};return ri.asyncFetch({url:t,method:Li.POST,data:a})},createAutoJoinRequest(e,r){return e.productName!==La.Lite?Promise.reject():ri.asyncFetch({url:e.autoJoin,method:Li.POST,data:r})}},RD=["Primary","Secondary","K12","Special","TAFE","University"],Gre=["Primary","Secondary","Primary & Secondary","Special","Sixth Form College","FE College","University","Other"],xb=["Elementary","Middle School","High School","College","Other"],Wre={au:RD,nz:RD,uk:Gre,us:xb,ca:xb};function Kre(e){const r=Zt.getCountryCode(e),t=Wre[r];return t||xb}var bF=(e=>(e.Published="Published",e.Draft="Draft",e))(bF||{});function Yre(e){var R;const[r,t]=je.useState({prospectId:e.prospectId,schoolName:e.schoolName,schoolType:e.schoolType,schoolLocality:e.schoolLocality,country:e.country,province:e.province,city:e.city,longitude:e.longitude,latitude:e.latitude}),[a,o]=je.useState(),[s,u]=je.useState(!1),p=Kre(r.country||((R=e.geoLocation)==null?void 0:R.countryCode));function d(){const{schoolName:b,schoolType:I,country:m}=r;return!!(b&&I&&m)}function h(b,I){t(m=>({...m,[b]:I}))}function f(b){const{longitude:I,latitude:m,schoolLocality:v,country:y,city:g,province:x}=b;I&&h("longitude",I),m&&h("latitude",m),y&&h("country",y),g&&h("city",g),x&&h("province",x),v&&h("schoolLocality",v)}function c(){h("schoolLocality",void 0),h("longitude",void 0),h("latitude",void 0),h("city",void 0),h("province",void 0),h("country",void 0),o("")}function _(b){const I=b.target.value;h("schoolType",I)}function E(b){h("schoolName",b.target.value)}async function S(b){const I={email:e.email,custom:{accountName:r==null?void 0:r.schoolName,accountAddress:{countryCode:r==null?void 0:r.country,province:Kt.parseProvince(r.province)},orgSubType:Kt.getSchoolType(r==null?void 0:r.schoolType),syncToCrm:!0,source:Kt.SOURCE},event:{accountCountry:r==null?void 0:r.country,accountPostCode:r==null?void 0:r.schoolPostCode,accountState:Kt.parseProvince(r.province)}},m={form_type:"trial-sign-up",prospect_id:r==null?void 0:r.prospectId};e.logBrazeEvent({user:I,event:{eventType:Tl.ProductFormEvent.FormSubmission,additionalData:m,callback:b}})}async function w(b){var m;if(b.preventDefault(),!d())return;e.logUserAction(r,{actionType:sn.Click,workflowPhase:Ua.Next,descriptor:Yt.CantFindSchool}),u(!0);let I;try{if(I=await Zf.create(e.ajaxUrls,{name:r.schoolName,status:bF.Draft,countryCode:r.country,prospectType:r.schoolType,city:r.city,postCode:r.schoolPostCode,province:Kt.parseProvince(r.province)}),!I.id){u(!1),o("Error. Something went wrong.");return}}catch{u(!1),o("Error. Something went wrong.");return}if(e.userTrialStatus===Dr.BdmTrialAvailable){if(e.userType!==In.Staff){e.complete({completionStep:"added-to-braze",trialCreated:!1,trialStatus:null});return}e.nextStep({step:"request-bdm-trial",...r});return}try{const v={prospectId:I.id,email:e.email,userType:e.userType,appLink:e.pageAppLinkString,attribution:{...bi.getDecodedAttributionData(),utms:ss.getUtmParameters()}},y=await mo.createTrial(e.ajaxUrls,v);e.createOrUpdateProfile&&e.createOrUpdateProfile({masterId:y.id,email:e.email,countryCode:r==null?void 0:r.country});const g={completionStep:"trial-status",email:e.email,userId:y.id,prospectId:I.id,schoolName:r.schoolName,schoolLocality:r.schoolLocality,country:r.country,schoolType:r.schoolType,city:r.city,schoolPostCode:r.schoolPostCode,latitude:r.latitude,longitude:r.longitude,province:r.province,trialStatus:Dr.Available,trialCreated:!0,customerId:(m=y.data)==null?void 0:m.customerId};if((e==null?void 0:e.userType)===In.Staff){await S(x=>{x||console.error("Failed to submit create trial data to braze."),e.complete(g)});return}e.complete(g)}catch(v){if(!v.body){u(!1),o("Error. Something went wrong.");return}const y=v;if(y.body.status===400&&y.body.type==="trial-not-available"){e.nextStep({step:"add-to-braze",...r,prospectId:I.id,trialStatus:Dr.Unavailable});return}console.error(v)}}return A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"text-center",children:[A.jsx("h1",{className:"h4",children:"Tell us more about your school"}),A.jsx("p",{children:"Please enter your school details."})]}),A.jsxs("div",{className:"form-group",children:[A.jsx("label",{className:"d-block",htmlFor:"school-name-input",children:"Name of school"}),A.jsx("input",{type:"text",value:(r==null?void 0:r.schoolName)||"",onChange:E,id:"school-name-input",className:"form-control form-control-lg",autoComplete:"off",placeholder:"Enter name of school",autoFocus:!0})]}),A.jsxs("div",{className:"form-group",children:[A.jsx("label",{className:"d-block",htmlFor:"school-type-select",children:"Type of school"}),A.jsxs("select",{id:"school-type-select",className:`form-select form-select-lg ${r.schoolType?"":"text-secondary"}`,autoComplete:"off",value:r.schoolType||"none",onChange:_,children:[A.jsx("option",{value:"none",className:"text-secondary",disabled:!0,children:"Select type of school"}),p.map(b=>A.jsx("option",{value:b,className:"text-dark",children:b},b))]})]}),A.jsx(yF,{data:r,setData:f,clearData:c,disabled:!1,labelClassName:"d-block",geoLocation:e.geoLocation,logUserAction:e.logUserAction,googleMapsApiKey:e.googleMapsApiKey,autoFocus:!1,size:"lg",useGeoLocationApi:!0}),a&&A.jsx("div",{className:"text-danger mb-3",children:a}),d()&&A.jsx(zf,{className:"btn-lg w-100",variant:"dark",onClick:w,showSpinner:s,disabled:s,children:"Get started"})]})}function W_(e,r){return r?`${e} ${r}`:e}function Jre(e){return A.jsx("h1",{className:W_("text-center mb-2 h4",e.className),children:e.children})}function Xre(e){return A.jsx("div",{className:W_("text-center text-sm px-2 px-lg-4",e.className),children:e.children})}function Qre(e){return A.jsx("p",{className:W_("",e.className),children:e.children})}const rt={Heading:Jre,Body:Xre,Message:Qre};function Rl(e){const r={[Dr.Available]:e.imageUrls.statusImages.available,[Dr.Active]:e.imageUrls.statusImages.active,[Dr.Expired]:e.imageUrls.statusImages.expired,[Dr.NotRequired]:e.imageUrls.statusImages.notRequired,[Dr.Unavailable]:e.imageUrls.statusImages.unavailable,[Dr.Unsupported]:e.imageUrls.statusImages.unsupported,[Dr.UserAutoJoinAllowed]:e.imageUrls.statusImages.notRequired,[Dr.UserJoinApprovalRequired]:e.imageUrls.statusImages.notRequired,[Dr.InvalidEmail]:"",[Dr.BdmTrialAvailable]:""};return A.jsx("div",{className:"d-flex justify-content-center my-4 px-2 px-lg-4",children:A.jsx("img",{src:r[e.trialStatus],className:"w-100 h-auto"})})}function ete(e){return je.useEffect(()=>{e.logUserAction({},{actionType:sn.Create,descriptor:Yt.TrialRequested,workflowPhase:Ua.Complete})},[]),A.jsxs(A.Fragment,{children:[A.jsx(Rl,{trialStatus:Dr.Available,imageUrls:e.imageUrls}),A.jsxs(rt.Body,{className:"mb-3",children:[A.jsx(rt.Heading,{children:"Submitted!"}),A.jsx(rt.Message,{children:"Thank you for your interest in trialing ClickView. We will be in touch with you as soon as possible."})]})]})}function rte(e){return A.jsxs(A.Fragment,{children:[A.jsx(Rl,{trialStatus:Dr.Available,imageUrls:e.imageUrls}),A.jsxs(rt.Body,{className:"mb-3",children:[A.jsx(rt.Heading,{children:"You've requested access!"}),A.jsx(rt.Message,{children:"We've sent a request to your ClickView admin. Once your account is ready, you'll receive an email notification with instructions on how to get started with ClickView."})]})]})}const Uc={Marketing:{au:"https://www.clickvieweducation.com/en-au",us:"https://www.clickvieweducation.com",nz:"https://www.clickview.co.nz",uk:"https://www.clickview.co.uk",ca:"https://www.clickvieweducation.com/en-ca"},Support:{au:"https://www.clickviewsupport.com/hc/en-au",uk:"https://www.clickviewsupport.com/hc/en-au#gb",nz:"https://www.clickviewsupport.com/hc/en-au#nz",us:"https://www.clickviewsupport.com/hc/en-au#us",ca:"https://www.clickviewsupport.com/hc/en-au#ca"}},tte={[Ze.AU]:"/contact-us/sales",[Ze.US]:"/contact-us/sales",[Ze.NZ]:"/contact-us/",[Ze.UK]:"/contact-us/trial",[Ze.CA]:"/contact-us/sales"},nte={[Ze.AU]:"/resources/free-student-resources",[Ze.US]:"/resources/free-student-resources",[Ze.NZ]:"/free-student-resources/",[Ze.UK]:"/free-student-resources/",[Ze.CA]:"/resources/free-student-resources"},wo={getMarketingUrlForGeoLocation(e){const r=Zt.getCountryCode(e==null?void 0:e.countryCode),t=Uc.Marketing[r];return t||Uc.Marketing.us},getMarketingSalesContactForGeoLocation(e){const r=Zt.getCountryCode(e==null?void 0:e.countryCode),t=wo.getMarketingUrlForGeoLocation(e),a=tte[r];return`${t}${a}`},getFreeResourcesForGeoLocation(e){const r=Zt.getCountryCode(e==null?void 0:e.countryCode),t=this.getMarketingUrlForGeoLocation({countryCode:r}),a=nte[r];return`${t}${a}`},getTermsAndConditionsLink(){return this.getMarketingUrlForGeoLocation(Ze.US)+"/terms-and-conditions/"},getPrivacyPolicyLink(){return this.getMarketingUrlForGeoLocation(Ze.US)+"/privacy-policy/"},getSupportUrlForGeoLocation(e){const r=Zt.getCountryCode(e==null?void 0:e.countryCode),t=Uc.Support[r];return t||Uc.Support.us}};function Fc(e){const r=(e==null?void 0:e.previousStepIds)&&e.previousStepIds[e.previousStepIds.length-1]==="find-school",t=(e==null?void 0:e.schoolName)||"Your school";return A.jsxs(rt.Body,{className:"mb-3",children:[r?A.jsxs(A.Fragment,{children:[A.jsxs(rt.Heading,{children:[t,A.jsx("br",{}),"already has ClickView 🎉"]}),A.jsxs(rt.Message,{className:"mt-3",children:["If your school has SSO ",A.jsx("a",{href:e.getSignInUrl({email:e.email,customerId:e.customerId}),className:"info-link",children:"click here to sign in."})]}),A.jsx(rt.Message,{children:"Otherwise please contact your school admin for access."})]}):A.jsxs(A.Fragment,{children:[A.jsx(rt.Heading,{children:"Good News!"}),A.jsxs(rt.Message,{children:["An account already exists for:",A.jsx("br",{})," ",A.jsx("strong",{children:e.email})]}),A.jsx(rt.Message,{children:A.jsx("a",{href:e.getSignInUrl({email:e.email}),className:"btn btn-dark btn-lg w-100",children:"Sign into ClickView"})})]}),A.jsxs(rt.Message,{children:["Need Help? ",A.jsx("a",{href:wo.getSupportUrlForGeoLocation(e.geoLocation),className:"info-link",target:"_blank",children:"Contact our Help Centre."})]})]})}function ate(e){const r=wo.getMarketingSalesContactForGeoLocation(e.geoLocation),t=(e==null?void 0:e.previousStepIds)&&e.previousStepIds[e.previousStepIds.length-1]==="find-school",a=(e==null?void 0:e.schoolName)||"Your school";return A.jsxs(rt.Body,{children:[A.jsx(rt.Heading,{children:t?`${a} trial has expired`:"Your trial has expired"}),A.jsxs(rt.Message,{children:["Please contact our ",A.jsx("a",{href:r,className:"info-link",target:"_blank",children:"ClickView Sales Team"})]})]})}function ite(e){const r=wo.getMarketingSalesContactForGeoLocation(e.geoLocation);return A.jsxs(rt.Body,{children:[A.jsxs(rt.Heading,{children:["Your school no longer",A.jsx("br",{})," has access to ClickView"]}),A.jsxs(rt.Message,{children:["Please contact our ",A.jsx("a",{href:r,className:"info-link",children:"ClickView Sales Team"})," for more information."]})]})}function ote(){return A.jsxs(rt.Body,{children:[A.jsxs(rt.Heading,{className:"px-2 px-lg-4",children:["ClickView isn't currently ",A.jsx("br",{})," available for your school"]}),A.jsx(rt.Message,{children:"We're working hard to get ClickView ready for more people."})]})}const ste=1;function ute(e){const[r,t]=je.useState(0),[a,o]=je.useState(!1);async function s(p){p==null||p.preventDefault();try{await mo.resendTrialEmail(e.ajaxUrls,e.userId,{email:e.email,appLink:e.pageAppLinkString}),t(r+1)}catch{o(!0)}e.logUserAction({},{actionType:sn.Click,descriptor:Yt.ResendEmail})}function u(p){p==null||p.preventDefault(),e.logUserAction({},{actionType:sn.Click,descriptor:Yt.WrongEmail}),e.nextStep({step:"enter-email",userType:e.userType})}if(e!=null&&e.email)return A.jsxs(rt.Body,{children:[A.jsx(rt.Heading,{children:"Check your inbox!"}),A.jsxs(rt.Message,{children:["An email has been sent to ",A.jsx("strong",{children:e.email}),"."]}),!!e.userId&&A.jsxs(A.Fragment,{children:[r<ste?A.jsx("button",{onClick:s,className:"btn btn-outline-dark btn-lg mb-3",children:"Resend verification email"}):A.jsx(rt.Message,{children:"✅ Email has been resent!"}),A.jsxs(rt.Message,{children:["Wrong email? ",A.jsx("button",{onClick:u,className:"btn info-link p-0 align-top border-0",children:"Update email address"})]}),a&&A.jsxs(rt.Message,{className:"mb-0 text-danger",children:["❌ There was a problem resending the email. Please try again later or contact our  ",A.jsx("a",{href:wo.getSupportUrlForGeoLocation(e.geoLocation),className:"info-link",children:"support"})]})]})]})}const lte={[Dr.Available]:ute,[Dr.Active]:Fc,[Dr.Expired]:ate,[Dr.NotRequired]:Fc,[Dr.Unavailable]:ite,[Dr.Unsupported]:ote,[Dr.UserAutoJoinAllowed]:Fc,[Dr.UserJoinApprovalRequired]:Fc,[Dr.InvalidEmail]:null,[Dr.BdmTrialAvailable]:null};function cte(e){const r=lte[e.trialStatus];return r?A.jsx(r,{...e}):A.jsx(A.Fragment,{})}function fte(e){return je.useEffect(()=>{const r={actionType:sn.Create,descriptor:Yt.DeadEnd,workflowPhase:Ua.Discard};e.trialCreated&&(r.descriptor=Yt.TrialCreated,r.workflowPhase=Ua.Complete),e.logUserAction({},r)},[]),A.jsxs(A.Fragment,{children:[A.jsx(Rl,{trialStatus:e.trialStatus,imageUrls:e.imageUrls}),A.jsx(cte,{...e})]})}const dte="young-student";function hte(e){const r=wo.getFreeResourcesForGeoLocation(e.geoLocation);return je.useEffect(()=>{Tn.set(dte,!0)},[]),A.jsxs(A.Fragment,{children:[A.jsx(Rl,{trialStatus:Dr.Active,imageUrls:e.imageUrls}),A.jsxs(rt.Body,{className:"mb-3",children:[A.jsx(rt.Heading,{children:"Discover our free content"}),A.jsx(rt.Message,{children:"Click the button below to explore our videos"}),A.jsx("a",{href:r,className:"btn btn-lg btn-dark w-100",target:"_blank",children:"Start watching now"})]})]})}const vte={"trial-status":fte,"added-to-braze":ete,"young-student":hte,"requested-access":rte};function pte(e){const r=vte[e.completionStep];return A.jsx("div",{className:"d-flex justify-content-center flex-column mx-auto px-2",children:A.jsx(r,{...e})})}const gte="_day_n6ysn_1",mte="_month_n6ysn_4",yte="_year_n6ysn_7",fb={day:gte,month:mte,year:yte},bte=120,_te=16;function Ste(e,r,t){const a=new Date(_F(e,r,t));return!isNaN(+a)}function _F(e,r,t){return`${e.padStart(4,"0")}-${r.padStart(2,"0")}-${t.padStart(2,"0")}`}function wte(e){const[r,t]=je.useState(""),[a,o]=je.useState(""),[s,u]=je.useState(""),[p,d]=je.useState(null);function h(v){t(v.target.value),d(null)}function f(v){o(v.target.value),d(null)}function c(v){u(v.target.value),d(null)}function _(){return!r||!a||!s?(d("Please enter your date of birth"),!1):Ste(s,a,r)?+s>S?(d("Please enter a date in the past"),!1):+s<S-bte?(d("Please enter a realistic date of birth"),!1):!0:(d("Please enter a valid date"),!1)}function E(v){if(v.preventDefault(),!_())return;const y=new Date(_F(s,a,r)),g=S-_te,x=new Date;if(x.setFullYear(g),y>x){e.complete({completionStep:"young-student",trialCreated:!1,trialStatus:null});return}e.nextStep({step:"enter-email",userType:e.userType})}const S=new Date().getFullYear(),w="mx-2 d-inline-block text-start",R=`form-control form-control-lg ${p?"is-invalid":""}`;let b="order-0",I="order-3";const m=Zt.isCountryCodeUS(e.geoLocation.countryCode);return m&&(b="order-3",I="order-0"),A.jsxs("form",{className:"text-center",onSubmit:E,noValidate:!0,children:[A.jsx("h1",{className:"h4",children:"Tell us a little about yourself"}),A.jsx("p",{children:"Please enter your date of birth"}),A.jsxs("div",{className:"my-4",children:[A.jsxs("fieldset",{className:"d-flex justify-content-center","aria-describedby":"dateOfBirthError",children:[A.jsxs("div",{className:`${w} ${b}`,children:[A.jsx("label",{className:"mb-0",htmlFor:"day",children:"Day"}),A.jsx("input",{id:"day",type:"number",className:`${R} ${fb.day}`,min:"1",max:"31",placeholder:"DD",value:r,onChange:h,autoFocus:!m,tabIndex:m?2:1})]}),A.jsx("span",{className:`h1 fw-normal mt-3 mb-0 order-1 ${p?"text-danger":""}`,children:"/"}),A.jsxs("div",{className:`${w} ${I}`,children:[A.jsx("label",{className:"mb-0",htmlFor:"month",children:"Month"}),A.jsx("input",{id:"month",type:"number",className:`${R} ${fb.month}`,min:"1",max:"12",placeholder:"MM",value:a,onChange:f,autoFocus:m,tabIndex:m?1:2})]}),A.jsx("span",{className:`h1 fw-normal mt-3 mb-0 order-4 ${p?"text-danger":""}`,children:"/"}),A.jsxs("div",{className:`${w} order-5`,children:[A.jsx("label",{className:"mb-0",htmlFor:"year",children:"Year"}),A.jsx("input",{id:"year",name:"year",type:"number",className:`${R} ${fb.year}`,min:S-120,max:S,placeholder:"YYYY",value:s,onChange:c,tabIndex:3})]})]}),!!p&&A.jsx(Ht,{name:"dateofBirth",children:p})]}),A.jsx("button",{type:"submit",className:"btn btn-lg btn-dark w-100",children:"Continue"})]})}function Ete(e){return A.jsxs(A.Fragment,{children:["Have a ClickView account already?",A.jsx("a",{href:e.link,className:"info-link ms-1",onClick:e.onClick,children:"Sign in"})]})}function Cte(){const e={},r=bi.getEncodedAttributionData();r&&(e.r=r);const t=ss.getUtmParameters();return t&&(e.utms=t),JSON.stringify(e)}const xte=new RegExp(/^[^\s@]+@[^\s@]+\.[^\s@]+$/),OD={[Ze.AU]:"valerie.frizzle@school.edu.au",[Ze.UK]:"valerie.frizzle@school.gov.uk",[Ze.US]:"valerie.frizzle@school.gov",[Ze.NZ]:"valerie.frizzle@school.nz",[Ze.CA]:"valerie.frizzle@school.ca"},Ite={[Ze.AU]:"/contact-us/support",[Ze.US]:"/contact-us/support",[Ze.NZ]:"/contact-us/",[Ze.UK]:"/contact-us/technical/",[Ze.CA]:"/contact-us/support"};function Ate(e){const r=wo.getMarketingUrlForGeoLocation(e),t=Zt.getCountryCode(e==null?void 0:e.countryCode),a=Ite[t];return`${r}${a}`}function Tte(e){const r=OD[Zt.getCountryCode(e.countryCode)];return r||OD.us}const Rte=[Dr.Expired,Dr.NotRequired,Dr.Unavailable,Dr.Unsupported,Dr.Active];function Ote(e){const[r,t]=je.useState(!1),[a,o]=je.useState((e==null?void 0:e.email)||""),[s,u]=je.useState(),p=Ate(e.geoLocation);async function d(){u("");let S;try{S=await mo.checkTrialStatus(e.ajaxUrls,{email:a})}catch{u("Something went wrong! Please try again later.");return}if(S.status===Dr.InvalidEmail){u("Please use your school email address.");return}if(e.logUserAction({},{actionType:sn.Click,workflowPhase:Ua.Next,descriptor:Yt.EnterEmail}),Rte.includes(S.status)){e.complete({completionStep:"trial-status",email:a,trialStatus:S.status,trialCreated:!1});return}try{const w=await mo.checkUserIdps(e.ajaxUrls,a);if(w.length){e.nextStep({step:"select-idp",email:a,userTrialStatus:S.status,idps:w});return}}catch{u("Something went wrong! Please try again later.");return}e.nextStep({step:"find-school",email:a,userTrialStatus:S.status})}function h(){e.logUserAction({},{actionType:sn.Click,descriptor:Yt.ContactUs})}function f(){return a.length?xte.test(a)?!0:(u("Please use your school email address."),!1):(u("Please enter your school email address."),!1)}function c(){e.logUserAction({},{actionType:sn.Click,descriptor:Yt.SignIn})}function _(S){S.preventDefault(),o(S.target.value),u("")}async function E(S){S==null||S.preventDefault(),f()&&(t(!0),await d(),t(!1))}return A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"text-center",children:[A.jsx("h1",{className:"h4",children:"Let's set up your account"}),A.jsx("p",{children:"Enter your school email address"})]}),A.jsxs("form",{onSubmit:E,noValidate:!0,children:[A.jsxs("div",{className:"form-group mb-3",children:[A.jsx(Bs,{value:a,onChange:_,name:"email-input",id:"email-input",type:"email",className:`form-control form-control-lg ${s?"is-invalid":""}`,placeholder:Tte(e.geoLocation),autoComplete:"false",autoCorrect:"false",autoFocus:!0,onClickClear:()=>o(""),"aria-errormessage":"email-inputError"}),s&&A.jsxs(A.Fragment,{children:[A.jsx(Ht,{name:"error-input",children:s}),A.jsxs("small",{children:["Having an issue with your email?",A.jsx("a",{href:p,className:"info-link ps-1",target:"_blank",onClick:h,children:"Contact our team"})]})]})]}),A.jsx(zf,{showSpinner:r,variant:"dark",className:"btn-lg mb-3 w-100",disabled:r,onClick:E,children:"Continue"})]}),e.userType===In.Staff&&A.jsx(h_,{idps:e.globalIdps,className:"mt-n3",attribution:Cte()}),A.jsx("div",{className:"text-center",children:A.jsx(Ete,{link:e.getSignInUrl({email:a}),onClick:c})})]})}function kte(e){var r;switch((r=e==null?void 0:e.body)==null?void 0:r.type){case"user-type-not-supported":return"Students may not request to join schools.";case"join-request-already-pending":return"Your request is awaiting administrator approval.";case"join-request-already-denied":return"Your request has been denied by an administrator.";case"join-request-not-allowed":case"user-email-domain-not-approved":case"user-email-invalid":case"create-join-request-failed":case"join-not-required":default:return"Something went wrong."}}var K_=(e=>(e.MasterId="master_id",e.CrmId="crm_id",e.SalesforceId="salesforce_id",e))(K_||{});function Pte(e){const[r,t]=je.useState(null);async function a(){var o;try{const u=(o=(await Zf.getLookups(e.ajaxUrls,e.prospectId)).find(p=>p.type===K_.MasterId))==null?void 0:o.externalId;if(!u){t("Something went wrong.");return}await mo.createJoinRequest(e.ajaxUrls,{customerId:u,email:e.email}),e.logUserAction({},{actionType:sn.Click,descriptor:Yt.RequestAccess}),e.complete({completionStep:"requested-access",trialCreated:!1,trialStatus:Dr.UserJoinApprovalRequired})}catch(s){t(kte(s))}}return A.jsxs(A.Fragment,{children:[A.jsx(Rl,{trialStatus:Dr.UserJoinApprovalRequired,imageUrls:e.imageUrls}),A.jsx(rt.Body,{className:"mb-3",children:A.jsxs(rt.Heading,{children:[e.schoolName,A.jsx("br",{}),"already has ClickView 🎉"]})}),A.jsx("button",{className:"btn btn-lg btn-dark w-100 mb-3",onClick:a,children:"Request access"}),r&&A.jsx("p",{className:"text-danger text-center mb-2",children:r}),A.jsxs(rt.Message,{className:"text-center",children:["Need Help? ",A.jsx("a",{href:wo.getSupportUrlForGeoLocation(e.geoLocation),className:"info-link",target:"_blank",children:"Contact our Help Centre."})]})]})}const Nte={checkEmail(e,r,t){return e.productName!==La.Lite?Promise.reject():ri.asyncFetch({url:e.brazeCheckEmail,method:Li.POST,data:{email:r,instanceRegion:t}})}};function jte(e){var f;const[r,t]=je.useState(!1),[a,o]=je.useState({});function s(c){if(EM(c.jobTitle)){h();return}p(c)}function u(){var _;const c=Zt.getCountryCode(e.country||((_=e.geoLocation)==null?void 0:_.countryCode));return Zt.getInstanceRegion(c)}async function p(c){var S;if(r)return;if(e.userType===In.Learner){o({...a,submission:"Something went wrong! Please try again later."});return}e.logUserAction({},{actionType:sn.Click,workflowPhase:Ua.Next,descriptor:Yt.RequestBdmTrial}),t(!0);const{firstName:_,surname:E}=V_(c.fullname);try{const w=await Nte.checkEmail(e.ajaxUrls,e.email,u()),R={email:e.email,firstName:_,lastName:E,phone:c.phone,custom:{orgSubType:Kt.getSchoolType(e==null?void 0:e.schoolType),accountName:e==null?void 0:e.schoolName,jobTitle:c.jobTitle,accountAddress:{countryCode:e==null?void 0:e.country,province:Kt.parseProvince((e==null?void 0:e.province)||"")},syncToCrm:((S=w.users)==null?void 0:S.length)===0?!0:void 0,source:Kt.BDM_SOURCE},event:{eventTopic:Kt.BDM_EVENT_TOPIC}},b={prospect_id:e==null?void 0:e.prospectId};e.logBrazeEvent({user:R,event:{eventType:Tl.ProductFormEvent.BdmTrialRequested,additionalData:b,callback:d}})}catch{o({...a,submission:"Something went wrong! Please try again later."})}Object.keys(a).length||h()}function d(c){o(c?{}:{...a,submission:"Something went wrong! Please try again later."}),t(!1)}function h(){e.complete({completionStep:"added-to-braze",trialCreated:!1,trialStatus:null})}return A.jsx(fF,{loading:r,errors:a,setErrors:o,country:e.country||((f=e.geoLocation)==null?void 0:f.countryCode),logUserAction:e.logUserAction,handleSubmitForm:s,isTertiary:Kt.isTertiarySchool(e.schoolType)})}function qte(e){const{loading:r,canSubmitForm:t,setSubmissionError:a,prospectStatus:o,userType:s,logStepEvent:u,logUserAction:p,nextStep:d,data:h,productName:f,ajaxUrls:c,complete:_,setLoadingState:E,email:S,userTrialStatus:w,pageAppLinkString:R,setProperty:b,logBrazeEvent:I,createOrUpdateProfile:m}=e;function v(){d({step:"add-to-braze",trialStatus:o,...h}),u()}function y(){if(u(),s!==In.Staff){_({completionStep:"added-to-braze",trialCreated:!1,trialStatus:null});return}d({step:"request-bdm-trial",...h})}function g(){d({step:"request-access",...h}),u()}async function x(){try{await mo.createAutoJoinRequest(c,{prospectId:h.prospectId,email:S}),p({},{actionType:sn.Click,descriptor:Yt.AutoJoin}),_({completionStep:"trial-status",trialCreated:!0,trialStatus:Dr.Available,...h})}catch{a("Something went wrong! Please try again later."),E(!1);return}}async function T(){var L;let N;h!=null&&h.prospectId&&o===Dr.NotRequired&&(N=(L=(await Zf.getLookups(c,h.prospectId)).find(B=>B.type===K_.MasterId))==null?void 0:L.externalId),_({completionStep:"trial-status",trialStatus:o,trialCreated:!1,customerId:N,...h}),u()}function O(){return o===Dr.Active||o===Dr.Available?!0:o===Dr.UserAutoJoinAllowed?f===La.Auth:!1}async function j(){if(s!==In.Staff)return;const N={email:S,custom:{accountName:h==null?void 0:h.schoolName,accountAddress:{countryCode:h==null?void 0:h.country,province:Kt.parseProvince(h.province)},orgSubType:Kt.getSchoolType(h==null?void 0:h.schoolType),syncToCrm:!0,source:Kt.SOURCE},event:{accountCountry:h==null?void 0:h.country,accountPostCode:h==null?void 0:h.schoolPostCode,accountState:Kt.parseProvince(h.province)}},L={form_type:"trial-sign-up",prospect_id:h==null?void 0:h.prospectId};I({user:N,event:{eventType:Tl.ProductFormEvent.FormSubmission,additionalData:L}})}async function k(){var L;E(!0);let N;try{N=await mo.createTrial(c,{userType:s,email:S,prospectId:h==null?void 0:h.prospectId,appLink:R,attribution:{...bi.getDecodedAttributionData(),utms:ss.getUtmParameters()}})}catch{a("Something went wrong! Please try again later."),E(!1);return}o===Dr.UserAutoJoinAllowed&&p({},{actionType:sn.Click,descriptor:Yt.AutoJoin}),b("userId",N.id),_({completionStep:"trial-status",userId:N.id,trialCreated:!0,trialStatus:Dr.Available,customerId:(L=N.data)==null?void 0:L.customerId,...h}),j(),m&&m({masterId:N.id,email:S,countryCode:h==null?void 0:h.country}),u()}return async function(){if(!r){if(!t()){a("Something went wrong! Please try again later.");return}if(w===Dr.BdmTrialAvailable)return y();if(s===In.Staff){if(o===Dr.Unsupported)return v();if(o===Dr.UserJoinApprovalRequired)return g();if(o===Dr.UserAutoJoinAllowed&&f===La.Lite)return await x()}return O()?await k():await T()}}}const kD=50;function Dte(e){return e.toLowerCase().split(" ").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}function Lte(e){const r=[];return e.city&&r.push(Dte(e.city)),e.province&&r.push(e.province),e.postCode&&r.push(e.postCode),r.join(" ")}function Mte(e){const{filteredSchoolsList:r,getSchoolName:t,onSchoolSuggestionClick:a,selectedIndex:o}=e;return A.jsx(A.Fragment,{children:r.map((s,u)=>A.jsxs(Zo,{className:`${zt.suggestionItem} ${o-1===u?zt.selected:""}`,onKeyDown:p=>p.key==="Enter"&&a(s),onMouseDown:()=>a(s),onClick:()=>a(s),children:[t(s)," ",A.jsx("br",{}),A.jsx("small",{className:"text-secondary",children:Lte(s)})]},s.id))})}function Ute(e){return A.jsx("div",{className:`info-link ${zt.suggestionItem} ${zt.noSuggestion} ${e.selected?zt.selected:""}`,onKeyDown:r=>r.key==="Enter"&&e.handleNoSuggestion(),onMouseDown:e.handleNoSuggestion,onClick:e.handleNoSuggestion,children:"Can't find your school?"})}function Fte(e){var L;const r=je.useRef(null),[t,a]=je.useState(!0),[o,s]=je.useState(e.data.schoolName&&e.data.schoolPostCode?e.data.schoolName+", "+e.data.schoolPostCode:e.data.schoolName?e.data.schoolName:""),[u,p]=je.useState(),d=mF(o,250),{selectedIndex:h,onKeyDown:f,containerRef:c,hide:_,onBlur:E,onFocus:S}=g_({onSelected:w,itemCount:((u==null?void 0:u.length)??0)+1,hideOnBlur:e.hideOnBlur});function w(U){if(!u&&!U)return;if(U===u.length){e.onClickNoSuggestions(o);return}const B=u[U];B&&x(B)}const R=!!((L=e.data)!=null&&L.prospectId),b=t&&!R,I=!t&&!R&&(u==null?void 0:u.length)<kD,m=(u==null?void 0:u.length)&&!R;je.useEffect(()=>{if(!R){if(!d.length){g();return}if(!R&&d.length>1&&d===o){g(d);return}}},[d,R]);function v(U){(e.data.schoolName||e.data.prospectId)&&e.clearData(),U!==o&&s(U)}function y(){v(""),r.current.focus()}function g(U){if(!e.data.latitude&&!e.data.longitude){a(!1);return}a(!0);const B={latitude:e.data.latitude,longitude:e.data.longitude};U&&U.length&&(B.query=U),Zf.search(e.searchUrl,B,H=>p(H),null,()=>a(!1))}function x(U){s(T(U)),e.setData({prospectId:U.id,schoolName:U.name,schoolPostCode:U.postCode,schoolType:U.prospectType,province:U.province,city:U.city,country:U.countryCode})}function T(U){return U.name}const O=(m||b||I)&&!e.disabled&&!_,j=!b&&!I&&(u==null?void 0:u.length)>=kD;let k="form-control",N="form-group position-relative";return e.size==="lg"&&(k+=" form-control-lg",N+=` ${zt.large}`),A.jsxs("div",{className:N,children:[A.jsxs("label",{className:e.labelClassName,htmlFor:"school-input",children:["School",e.required&&A.jsx("span",{className:"text-danger",children:"*"})]}),A.jsx(Bs,{id:"school-input",value:o,onChange:U=>v(U.currentTarget.value),ref:r,className:k,type:"text",autoComplete:"off",placeholder:e.placeholder||"Search for your school",disabled:e.disabled,autoFocus:!0,onClickClear:y,onKeyDown:f,onFocus:S,onBlur:E}),A.jsx("div",{className:`position-absolute z-1 w-100 ${zt.dropdown} ${_?"d-none":""}`,children:A.jsx("div",{className:`${zt.suggestionContainer} ${O?"":"d-none"}`,children:A.jsxs("div",{className:zt.suggestionContainerInner,ref:c,children:[m?A.jsx(Mte,{filteredSchoolsList:u,onSchoolSuggestionClick:x,getSchoolName:T,selectedIndex:h}):b&&A.jsx("div",{className:`${zt.suggestionLoading} py-4 d-flex justify-content-center`,children:A.jsx(G_,{animation:"border"})}),j&&A.jsxs(A.Fragment,{children:[A.jsx("hr",{className:"my-0"}),A.jsx("div",{className:`${zt.suggestionItem} ${zt.noSuggestion} text-secondary text-center`,children:A.jsxs("small",{children:["Can't find your school? ",A.jsx("br",{})," Try searching to narrow the results"]})})]}),!b&&I&&A.jsx(Ute,{selected:h===u.length+1,handleNoSuggestion:()=>{e.onClickNoSuggestions(o)}})]})})})]})}function Bte(e){return(e==null?void 0:e.toLowerCase())==="au"?"Enter your school postcode or suburb":(e==null?void 0:e.toLowerCase())==="us"?"Enter your school ZIP code or city":(e==null?void 0:e.toLowerCase())==="ca"?"Enter your school postal code or city":"Enter your school postcode or city"}function $te(e){var j;const{email:r,userType:t}=e,[a,o]=je.useState({schoolLocality:e.schoolLocality,country:e.country,longitude:e.longitude,latitude:e.latitude,city:e.city,province:e.province,prospectId:e.prospectId,schoolName:e.schoolName,schoolType:e.schoolType,schoolPostCode:e.schoolPostCode}),[s,u]=je.useState(e.trialStatus),[p,d]=je.useState(),[h,f]=je.useState(!1),[c,_]=je.useState(!1),[E,S]=je.useState(!1),w=qte({...e,prospectStatus:s,loading:h,data:a,canSubmitForm:b,setSubmissionError:d,logStepEvent:I,setLoadingState:m,setProperty:v});function R(){return!!(a&&a.schoolLocality&&a.longitude&&a.latitude)}function b(){if(!a||!r||!t)return!1;const{prospectId:k}=a;return!!(r&&t&&k)}function I(){const k={actionType:sn.Click,descriptor:Yt.FindSchool,workflowPhase:Ua.Next};e.logUserAction(a||{},k)}function m(k){_(k),S(k),f(k)}function v(k,N){k==="prospectId"&&N&&(f(!0),mo.checkProspectTrialStatus(e.ajaxUrls,{prospectId:N.toString(),email:e.email},L=>{u(L.status)},()=>{console.log("error")},()=>{f(!1)})),o(L=>({...L,[k]:N}))}function y(){v("schoolLocality",void 0),v("longitude",void 0),v("latitude",void 0),v("city",void 0),v("province",void 0),v("country",void 0),g()}function g(){v("prospectId",void 0),v("schoolName",""),v("schoolPostCode",void 0),d(void 0)}function x(k){e.nextStep({step:"cant-find-school",prospectId:a.prospectId,schoolName:k,schoolLocality:a.schoolLocality,longitude:a.longitude,latitude:a.latitude,country:a.country,city:a.city,province:a.province}),e.logUserAction({},{actionType:sn.Click,descriptor:Yt.CantFindSchool,workflowPhase:Ua.Next})}function T(k){v("prospectId",k.prospectId),v("schoolName",k.schoolName),v("schoolPostCode",k.schoolPostCode),v("schoolType",k.schoolType),v("province",k.province),v("city",k.city),v("country",k.country)}function O(k){const{longitude:N,latitude:L,schoolLocality:U,country:B,city:H,province:G}=k;N&&v("longitude",N),L&&v("latitude",L),B&&v("country",B),H&&v("city",H),G&&v("province",G),U&&v("schoolLocality",U)}return A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"text-center",children:[A.jsx("h1",{className:"h4",children:"Let's find your school"}),A.jsx("p",{children:Bte((j=e.geoLocation)==null?void 0:j.countryCode)})]}),A.jsx(yF,{data:a,setData:O,clearData:y,disabled:c,geoLocation:e.geoLocation,labelClassName:"d-none",logUserAction:e.logUserAction,googleMapsApiKey:e.googleMapsApiKey,autoFocus:!0,size:"lg",useGeoLocationApi:!0}),R()&&A.jsx(Fte,{data:a,setData:T,clearData:g,disabled:E,searchUrl:e.ajaxUrls.searchProspect,onClickNoSuggestions:x,size:"lg",labelClassName:"d-none"}),p&&A.jsx("p",{className:"text-danger mb-2",children:p}),b()&&A.jsx(zf,{className:"btn-lg w-100",variant:"dark",onClick:w,showSpinner:c||E||h,disabled:c||E||h,children:"Get started"})]})}const PD=["38A2E8","7A76E8","40BCC3","F7847B"];function zte(e){const[r,t]=je.useState(null);function a(s){if(!s)return;const u=window.location.pathname+window.location.search;window.location.href=`/challenge?idp=${s.id}&redirectUrl=`+encodeURIComponent(u)}function o(){e.logUserAction({},{actionType:sn.Click,workflowPhase:Ua.Next,descriptor:Yt.SkipIdpSelect}),e.nextStep({step:"find-school",email:e.email,userTrialStatus:e.userTrialStatus})}return A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"text-center",children:[A.jsx("h1",{className:"h4",children:"Does your school already have ClickView?"}),A.jsx("p",{children:"Find your school from the list below"})]}),e.idps.length>4?A.jsxs(A.Fragment,{children:[A.jsx(Sl,{id:"idp",item:r,items:e.idps,onSelect:t,getName:s=>s.name,clearData:()=>t(null),placeholder:"Select a school",size:"lg"}),A.jsx("button",{className:"btn btn-lg btn-dark w-100 mb-3",disabled:!r,onClick:()=>a(r),children:"Continue"})]}):e.idps.map((s,u)=>A.jsx("button",{className:"btn btn-lg w-100 mb-3",onClick:()=>a(s),style:{backgroundColor:`#${PD[u%PD.length]}`,color:"#FFF"},children:s.name},u)),A.jsx("button",{className:"btn btn-link text-info w-100 no-sso-link",onClick:o,children:"My school does not have ClickView"})]})}const Zte="_userTypeOption_egazo_1",Hte="_selected_egazo_8",Vte="_mobileButtons_egazo_13",db={userTypeOption:Zte,selected:Hte,mobileButtons:Vte};function ND(e){return A.jsxs(A.Fragment,{children:[A.jsxs(Zo,{className:`
66
66
  d-flex
67
67
  flex-column
68
68
  justify-content-between
@@ -75,4 +75,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
75
75
  d-md-block
76
76
  d-none
77
77
  ${db.userTypeOption} ${e.selected?db.selected:""}`,onClick:()=>e.onClick(e.type),children:[A.jsx("img",{src:e.imageSrc,className:"rounded-top mx-auto pb-2 w-100"}),A.jsx("div",{className:"py-2",children:A.jsx("span",{className:"h4",children:e.buttonText})})]}),A.jsx(Zo,{className:`btn btn-lg btn-outline-dark w-100 d-md-none d-block mx-auto ${db.mobileButtons}`,onClick:()=>e.onClick(e.type),children:e.buttonText})]})}function Gte(e){function r(t){if(e.logUserAction({userType:t},{actionType:sn.Click,workflowPhase:Ua.Next,descriptor:t===In.Staff?Yt.Educator:Yt.Student}),t===In.Staff){e.nextStep({step:"enter-email",userType:t});return}e.nextStep({step:"enter-age",userType:t})}return A.jsxs("div",{className:"text-center",children:[A.jsx("h1",{className:"h4",children:"Access educational videos at your fingertips"}),A.jsx("p",{className:"mb-3",children:"Sign up for instant access to class-ready videos and worksheets."}),A.jsxs("div",{className:"row",children:[A.jsx("div",{className:"col-lg-6 mb-3",children:A.jsx(ND,{type:In.Staff,buttonText:"I'm an educator",imageSrc:e.imageUrls.educator,onClick:r,selected:e.userType===In.Staff})}),A.jsx("div",{className:"col-lg-6 mb-3",children:A.jsx(ND,{type:In.Learner,buttonText:"I'm a student",imageSrc:e.imageUrls.student,onClick:r,selected:e.userType===In.Learner})})]})]})}const Wte={"select-type":Gte,"enter-email":Ote,"find-school":$te,"cant-find-school":Yre,completed:pte,"add-to-braze":Cre,"enter-age":wte,"request-access":Pte,"request-bdm-trial":jte,"select-idp":zte};function Kte(e){const{state:r,geoLocation:t,layout:a,hasPreviousStep:o,googleMapsApiKey:s,pageAppLinkString:u,back:p,nextStep:d,complete:h,logUserAction:f,logBrazeEvent:c,imageUrls:_,ajaxUrls:E,productName:S,getSignInUrl:w,globalIdps:R,createOrUpdateProfile:b}=e,I=Wte[r.currentStepId],m={...r,geoLocation:t,googleMapsApiKey:s,pageAppLinkString:u,back:p,nextStep:d,complete:h,logUserAction:f,imageUrls:_,ajaxUrls:E,productName:S,getSignInUrl:w,logBrazeEvent:c,globalIdps:R,createOrUpdateProfile:b},v=a;if(!v)return A.jsx(I,{...m});const y=ore.last(e.state.previousStepIds)==="completed";return A.jsx(v,{geoLocation:e.geoLocation,currentStep:r.currentStepId,previousStep:p,closeApp:e.close,logUserAction:f,hasPreviousStep:o,showBackButton:!y,imageUrls:e.imageUrls,getSignInUrl:w,children:A.jsx(I,{...m})})}const Yte=["email","longitude","latitude","trialCreated","idps"],Jte={filterBlacklistedKeys(e){const r={...e};return Yte.forEach(t=>delete r[t]),r}};function Xte(e){const r=[...e.previousStepIds],t=r.pop();return{...e,previousStepIds:r,currentStepId:t}}function Qte(e){return Object.entries(e).filter(([,r])=>r!==null).reduce((r,[t,a])=>({...r,[t]:a}),{})}function ene(e,r){const t={...e,previousStepIds:[...e.previousStepIds,e.currentStepId],currentStepId:r.step};if(r.step==="select-type")return{...t};if(r.step==="enter-email"||r.step==="enter-age")return{...t,userType:r.userType};if(r.step==="select-idp")return{...t,email:r.email,userTrialStatus:r.userTrialStatus,idps:r.idps};if(r.step==="find-school")return{...t,email:r.email,userTrialStatus:r.userTrialStatus};if(r.step==="cant-find-school")return{...t,prospectId:r.prospectId,schoolName:r.schoolName,schoolLocality:r.schoolLocality,country:r.country,longitude:r.longitude,latitude:r.latitude,city:r.city,province:r.province};if(r.step==="add-to-braze"||r.step==="completed"||r.step==="request-access"||r.step==="request-bdm-trial"){let a={...r};return delete a.type,delete a.step,a=Qte(a),{...t,...a}}}function rne(e,r){switch(r.type){case"nextStep":return ene(e,r);case"back":return Xte(e)}}const tne=({location:e,initialValues:r,onStepUpdate:t,externalLogUserAction:a})=>{const o=Kt.removeEmptyKeys(r),s={currentStepId:"select-type",previousStepIds:[],...o},[u,p]=je.useReducer(rne,s);je.useEffect(()=>{t==null||t(u)},[u.currentStepId]);function d(){p({type:"back"})}function h(_){p({type:"nextStep",..._})}function f(_){p({type:"nextStep",step:"completed",..._})}function c(_,E){const S={...u,..._},w=Jte.filterBlacklistedKeys(S),R={currentStepId:u.currentStepId,...w},b=Object.entries(R).filter(([,I])=>I!==void 0).reduce((I,[m,v])=>({...I,[m]:v}),{});a(b,{entity:nF.SignUp,location:e,...E})}return{state:u,back:d,nextStep:h,complete:f,hasPreviousStep:!!u.previousStepIds.length,logUserAction:c}},nne={statusImages:{available:"/images/sign-up/available-v2.png",active:"/images/sign-up/active-v2.png",expired:"/images/sign-up/expired-v2.png",notRequired:"/images/sign-up/active-v2.png",unavailable:"/images/sign-up/unavailable-v2.png",unsupported:"/images/sign-up/unavailable-v2.png",autoJoin:"/images/sign-up/active-v2.png",requestAccess:"/images/sign-up/active-v2.png"}};function ane(e){var E;const r={currentStepId:"find-school",previousStepIds:[],email:e.email,userType:In.Staff},t=(E=e.geoLocation)!=null&&E.countryCode?e.geoLocation:{countryCode:Ze.US,isFallback:!0},{complete:a,...o}=tne({location:aF.AuthProspectSelect,initialValues:r,externalLogUserAction:f}),[s,u]=je.useState(null);je.useEffect(()=>{vt.get("/ajax/config").then(S=>u(S))},[]);const p=je.useMemo(()=>{if(!s)return null;const S={cvApSoutheast1:s.analytics[pn.CvApSoutheast1].collectionApi,cvApSoutheast2:s.analytics[pn.CvApSoutheast2].collectionApi,cvEuWest1:s.analytics[pn.CvEuWest1].collectionApi,cvNaWest1:s.analytics[pn.CvNaWest1].collectionApi};return new ire({productName:"auth.web",productVersion:s.version,regionName:Zt.getRegionName(t==null?void 0:t.countryCode),collectionApiUrls:S,collectionApiClientId:"cv_auth",getUser:()=>null,logAttributionData:!0,logUtmParameters:!0})},[s]),d=je.useMemo(()=>{if(!(s!=null&&s.braze))return null;const S=s.braze[Zt.getRegionName(t==null?void 0:t.countryCode)];return new Tl.BrazeClient({apiOptions:{apiKey:S.apiKey,baseUrl:S.url,productName:"auth.web",productVersion:s.version,allowUserSuppliedJavascript:!1,automaticallyShowInAppMessages:!1}})},[s]);Aee({additionalData:e.additionalData});function h(S){var I;if(!d)return;const w=bi.getDecodedAttributionData(),R=((I=S.event)==null?void 0:I.additionalData)||{};w!=null&&w.originalReferrer&&(R.original_referrer=w.originalReferrer),w!=null&&w.internalReferrer&&(R.internal_referrer=w.internalReferrer);const b={...S.event,additionalData:R};d.setUserInit(S.user),d.event.log(b)}function f(S,w){p==null||p.log({type:w.actionType,data:S,actionContext:{productArea:"prospect_select",entity:w.entity,location:w.location,descriptor:w.descriptor,workflowPhase:w.workflowPhase},eventVersion:w.eventVersion||iF.V1})}function c(S){if(!S.trialCreated){a(S);return}vt.post("/ajax/login/select-customer",{customerId:S.customerId,returnUrl:e.returnUrl}).then(w=>Pt(w,e))}if(!s)return A.jsx(A.Fragment,{});const _={...o,complete:c,googleMapsApiKey:s.googleMapsApiKey,ajaxUrls:Ree(s.gatewayApi),imageUrls:nne,geoLocation:t,productName:La.Auth,getSignInUrl:()=>"",logBrazeEvent:h};return A.jsxs(A.Fragment,{children:[A.jsx(yt,{theme:e.theme}),A.jsx(Kte,{..._})]})}function ine(e){return A.jsxs("div",{className:"text-center",children:[A.jsx(yt,{theme:e.theme}),A.jsx("img",{className:"img-fluid mb-4",alt:"error",src:"/images/errors/email-not-allowed-v2.png"}),A.jsx("h1",{className:"h2 mb-3",children:"Oops! Make sure to use your school email address"}),A.jsx("p",{className:"mb-3",children:"This includes the email you use to sign in to Google or Microsoft."}),A.jsx("a",{href:e.liteUrl+"sign-up",className:"btn btn-lg btn-dark w-100 text-decoration-none",children:"Try again"})]})}const SF={username:gW,"username-input":sK,"username-or-guest":uK,"guest-selection":RK,password:jK,"select-idp":qK,error:tY,"verify-email":MK,"verify-email-check-code":ZK,"verify-email-link-success":HK,"verify-email-skip-reason":oY,"forgot-password":VK,"forgot-password-check-code":GK,"reset-password":KK,"change-password":YK,"self-activation":JK,"self-activation-check-code":XK,"verify-email-link-email-in-use":aY,"verify-email-code-email-in-use":iY,logout:sY,loggedout:uY,"activate-user":yQ,"select-customer":RQ,"trial-expired":NQ,"link-account":mee,"link-account-code":yee,invite:wee,"invite-success":Eee,"select-user-type":xee,"prospect-select":ane,"email-not-allowed":ine,"organisation-select-customer":lY,"contact-support":rY};function one(e,r){if(r.type!=="navigate")return e;const t=Object.keys(r.data).reduce((a,o)=>{if(o!=="bannerType")return r.data[o]!==void 0&&(a={...a,[o]:r.data[o]}),a},{});return r.data.clearUsername&&(t.username=void 0,t.clearUsername=void 0),{...e,...t}}function sne(e,r){return r.type!=="setBanner"?e:{...e,bannerType:r.data.bannerType}}function une(e,r){switch(r.type){case"navigate":return one(e,r);case"setBanner":return sne(e,r)}}const lne="_footer_psbd8_1",cne={footer:lne};function fne(e){return A.jsx("div",{className:"text-center p-2 text-secondary small",children:A.jsxs("ul",{className:"d-flex flex-wrap list-unstyled justify-content-center",children:[A.jsx("li",{children:A.jsxs("span",{children:["2003 - ",new Date().getFullYear()," © ClickView Pty Limited"]})})," | ",A.jsx("li",{children:A.jsx("a",{href:e.privacyPolicyUrl,className:"text-secondary",children:A.jsx("strong",{children:"Privacy Policy"})})})," | ",A.jsx("li",{children:A.jsx("a",{href:e.termsAndConditionsUrl,className:"text-secondary",children:A.jsx("strong",{children:"Terms and Conditions"})})})," | ",A.jsx("li",{children:A.jsx("span",{children:e.version})})]})})}function dne(e){return A.jsx("footer",{className:cne.footer,children:A.jsx(fne,{...e})})}function hne(){return A.jsx("svg",{viewBox:"0 0 434 71",children:A.jsxs("g",{children:[A.jsx("path",{fill:"#000000",d:"M114.44 56.57l3.5 3.5a32.87 32.87 0 0 1-25.16 11.26c-19.63 0-33.62-15.54-33.62-35.16C59.16 16.55 73.16 1 92.78 1a32.31 32.31 0 0 1 24.19 10.4l-3.6 3.3a27.32 27.32 0 0 0-20.59-8.74c-16.91 0-28.39 13.5-28.39 30.21s11.48 30.21 28.39 30.21a28.08 28.08 0 0 0 21.66-9.81zM126.64 1h4.55v70.22h-4.73L126.64 1zm17.3 10.6a3.7 3.7 0 1 1 0 7.4 3.7 3.7 0 0 1 0-7.4zm-2.41 15.07h4.81v44.56h-4.81V26.67zm48 33.15l3.33 3.15a21.8 21.8 0 0 1-17.31 8.61c-12.59 0-21.76-10-21.76-22.22 0-12.22 9.17-22.22 21.76-22.22a21.84 21.84 0 0 1 16.85 8l-3.43 3.06a17.15 17.15 0 0 0-13.42-6.3c-10.09 0-16.76 8.15-16.76 17.5s6.67 17.5 16.76 17.5a17.38 17.38 0 0 0 13.98-7.08zm14.99-9.33v20.74h-4.73V1.01h4.73v47.75l20.74-19.02h6.64l-21.56 19.84L234 71.23h-7.01l-22.47-20.74z"}),A.jsx("path",{fill:"#F8981D",d:"M304.09 19.4a5.56 5.56 0 1 1 0-11.12 5.56 5.56 0 0 1 0 11.12zm-5.56 7.27h11.11v44.56h-11.11V26.67zm61.42 22.15c0 .81 0 2.42-.09 4h-31.75c.8 3.77 5.2 8.61 11.93 8.61a17.11 17.11 0 0 0 11.66-4.31l5.38 8.16a27.23 27.23 0 0 1-17 6.1c-12.92 0-22.88-9.87-22.88-22.34s9.06-22.33 21.35-22.33c11.62-.04 21.4 9.02 21.4 22.11zm-10.77-3.76c-.18-3.68-3.58-8.62-10.67-8.62-6.91 0-10.05 4.85-10.4 8.62h21.07zM385.92 71h-6.42l-19.64-44.37h13.97l9.16 23.98 9.72-23.98h8.31l9.63 23.98 9.16-23.98h13.97L414.24 71h-6.52l-10.85-23.7L385.92 71zm-120.22.35h-6L226.11 1.01h17.01l19.42 44.18 18.08-44.18h16.91L265.7 71.35zM0 1l41 35L0 71V1z"})]})})}var Bo=(e=>(e[e.Audience=1]="Audience",e[e.Category=2]="Category",e[e.Channel=3]="Channel",e[e.Chapter=4]="Chapter",e[e.Comment=5]="Comment",e[e.OwnerComment=6]="OwnerComment",e[e.Image=7]="Image",e[e.Thumbnail=8]="Thumbnail",e[e.Avatar=9]="Avatar",e[e.Banner=10]="Banner",e[e.Video=11]="Video",e[e.Trailer=12]="Trailer",e[e.Rating=13]="Rating",e[e.Topic=14]="Topic",e[e.Series=15]="Series",e[e.Season=16]="Season",e[e.HostedMediaObjectCollection=17]="HostedMediaObjectCollection",e[e.ExchangeCollection=18]="ExchangeCollection",e[e.CustomMediaObjectCollection=19]="CustomMediaObjectCollection",e[e.Playlist=20]="Playlist",e[e.ClickViewTvCollection=21]="ClickViewTvCollection",e[e.ClickViewProductionsCollection=22]="ClickViewProductionsCollection",e[e.User=23]="User",e[e.SystemUser=24]="SystemUser",e[e.Customer=25]="Customer",e[e.Country=26]="Country",e[e.Organisation=28]="Organisation",e[e.SystemOrganisation=29]="SystemOrganisation",e[e.Group=30]="Group",e[e.SystemGroup=31]="SystemGroup",e[e.FlagReason=32]="FlagReason",e[e.Library=33]="Library",e[e.Interactive=34]="Interactive",e[e.WorkspaceCollection=35]="WorkspaceCollection",e[e.Conversation=36]="Conversation",e[e.Message=37]="Message",e[e.Notification=38]="Notification",e[e.Clip=39]="Clip",e[e.Link=40]="Link",e[e.UserChannel=41]="UserChannel",e[e.Resource=42]="Resource",e[e.VideoStream=43]="VideoStream",e[e.AudioStream=44]="AudioStream",e[e.Tag=45]="Tag",e[e.Subtitle=46]="Subtitle",e[e.LicencedContentCollection=47]="LicencedContentCollection",e[e.PublicCollection=48]="PublicCollection",e[e.CategoryTree=49]="CategoryTree",e[e.Logo=50]="Logo",e[e.Permission=51]="Permission",e[e.Subject=52]="Subject",e[e.Field=53]="Field",e[e.Company=54]="Company",e[e.Person=55]="Person",e[e.Cover=56]="Cover",e[e.Poster=57]="Poster",e[e.SubjectAudience=58]="SubjectAudience",e[e.TallPoster=60]="TallPoster",e[e.Classroom=67]="Classroom",e[e.ClassroomGroup=68]="ClassroomGroup",e[e.UserProfile=74]="UserProfile",e[e.PartnerProfile=78]="PartnerProfile",e))(Bo||{});const vne="_left_1r3w0_1",pne="_leftWithImage_1r3w0_10",gne="_bgCover_1r3w0_14",mne="_bgFull_1r3w0_17",yne="_right_1r3w0_20",bne="_rightContent_1r3w0_28",_ne="_narrowContent_1r3w0_34",Sne="_logo_1r3w0_37",wne="_buttonContainer_1r3w0_43",Ene="_blur_1r3w0_53",Cne="_imageContainer_1r3w0_65",xne="_imagePosition_1r3w0_73",Ine="_image_1r3w0_65",Ane="_thumbnail_1r3w0_87",Tne="_tallposter_1r3w0_90",Rne="_cover_1r3w0_96",One="_contentBody_1r3w0_102",kne="_contentBodyBase_1r3w0_106",Dt={left:vne,leftWithImage:pne,bgCover:gne,bgFull:mne,right:yne,rightContent:bne,narrowContent:_ne,logo:Sne,buttonContainer:wne,blur:Ene,imageContainer:Cne,imagePosition:xne,image:Ine,thumbnail:Ane,tallposter:Tne,cover:Rne,contentBody:One,contentBodyBase:kne};function Pne(e){switch(e){case Bo.Video:case Bo.Interactive:case Bo.Clip:return Dt.thumbnail;case Bo.Subject:case Bo.Playlist:return Dt.cover;case Bo.Series:return Dt.tallposter;default:return""}}function An(e){return A.jsx("div",{className:"d-flex",children:e.children})}function Nne(e){return A.jsx("div",{className:`${Dt.left} ${e.className?e.className:""}`,children:e.children})}function jne(e){const[r,t]=je.useState(!1),[a,o]=je.useState("");return je.useEffect(()=>{if(!e.imageUrl){const u=e.fallbackImages[Math.floor(Math.random()*e.fallbackImages.length)];o(u.bgUrl);return}const s=new Image;return s.onload=()=>t(!0),s.src=e.imageUrl,()=>s.onload=null},[e.imageUrl]),A.jsx("div",{className:`${Dt.left} ${Dt.leftWithImage} ${Dt.bgCover} bg-light`,style:{backgroundImage:a?`url('${a}')`:""},children:r&&A.jsxs(A.Fragment,{children:[A.jsx("div",{className:Dt.blur,style:{backgroundImage:`url('${e.imageUrl}')`}}),A.jsx("div",{className:`${Dt.imageContainer} ${Pne(e.objectType)}`,children:A.jsx("div",{className:Dt.imagePosition,children:A.jsx("img",{className:Dt.image,src:e.imageUrl,alt:e.title})})})]})})}function qne(e){const[r,t]=je.useState("");return je.useEffect(()=>{const a=e.images[Math.floor(Math.random()*e.images.length)];t(a.bgUrl)},[]),A.jsx("div",{className:`${Dt.left} bg-blue d-flex align-items-center`,children:r&&A.jsx("img",{className:"img-fluid",src:r,draggable:!1})})}const Dne={cover:Dt.bgCover,full:Dt.bgFull};function Lne(e){const r={backgroundImage:e.imageUrl?`url("${e.imageUrl}")`:""};return e.backgroundColor&&(r.backgroundColor=e.backgroundColor),A.jsx("div",{className:`${Dt.left} ${Dt.leftWithImage} ${Dne[e.imageSize||"cover"]} d-flex align-items-center`,style:r,title:e.title})}function Mne(e){return A.jsx("div",{className:`${Dt.right} ${e.className?e.className:""}`,children:e.children})}function Une(e){var t;const r=(e==null?void 0:e.logoComponent)||hne;return A.jsxs("div",{className:"position-relative",children:[!!e.bannerComponent&&e.bannerComponent,A.jsx("div",{className:Ma(Dt.logo,"position-absolute",(t=e.className)==null?void 0:t.logoContainer),children:A.jsx(r,{})}),e.children]})}function Fne(e){return A.jsx("div",{className:Ma(Dt.rightContent,"d-flex flex-column justify-content-center h-100",e==null?void 0:e.className),children:e.children})}const Bne={base:Dt.contentBodyBase,full:""};function $ne(e){const r=Bne[e.width||"base"];return A.jsx("div",{className:Ma(Dt.contentBody,r,"m-auto p-3",e.className),children:e.children})}An.NarrowContent=zne;function zne(e){return A.jsx("div",{className:`${Dt.narrowContent} mx-auto w-100 ${e.className?e.className:""}`,children:e.children})}function Zne(e){return A.jsx("div",{className:Ma("position-fixed bg-white d-flex align-items-center",Dt.buttonContainer,e==null?void 0:e.className),children:e.children})}An.Left=Nne;An.LeftImage=jne;An.LeftProductImage=qne;An.LeftImageWithBackground=Lne;An.Right=Mne;An.Header=Une;An.Content=Fne;An.ContentBody=$ne;An.Buttons=Zne;function Hne(){function e(t){t.key==="Tab"&&(document.body.classList.add("user-is-tabbing"),window.removeEventListener("keydown",e),window.addEventListener("mousedown",r))}function r(){document.body.classList.remove("user-is-tabbing"),window.removeEventListener("mousedown",r),window.addEventListener("keydown",e)}Nr.useEffect(()=>(window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)),[])}const Vne="_full_vw1kz_1",Gne="_themeBannerClearance_vw1kz_9",jD={full:Vne,themeBannerClearance:Gne};function Wne(e){return e.imageType==="background"?A.jsx(An.LeftImageWithBackground,{imageUrl:e.imageUrl}):e.imageType==="image"?A.jsx(An.LeftImageWithBackground,{imageUrl:e.imageUrl,imageSize:"full",backgroundColor:e.backgroundColor,title:e.title}):A.jsx(A.Fragment,{})}function Kne(e){var I,m;const{children:r,footer:t,bannerType:a,theme:o}=e,[s,u]=Nr.useState(null);Hne();const{imageUrls:p,imageType:d,backgroundColor:h,banner:f,title:c,logoComponent:_,bannerSpacer:E}=$a.getDefinition(o),S=p[(m=(I=e.geoLocation)==null?void 0:I.countryCode)==null?void 0:m.toLowerCase()]||p.default;Nr.useEffect(()=>{const v=Math.floor(Math.random()*S.length);u(S[v])},[]);const w=d!=="none",R=!!a,b=["plugin"].includes(a);return A.jsxs(An,{children:[w&&A.jsx(Wne,{title:c,imageUrl:s,imageType:d,backgroundColor:h}),A.jsxs(An.Right,{className:Ma(!w&&jD.full),children:[A.jsx(An.Header,{bannerComponent:!!f&&A.jsx(G9,{bannerType:f}),logoComponent:_,className:{logoContainer:!!f&&jD.themeBannerClearance}}),A.jsxs(An.Content,{className:Ma(!w&&"px-0 w-100","pb-0"),children:[!b&&A.jsx(G9,{bannerType:a}),A.jsxs(An.ContentBody,{children:[r,!b&&R&&A.jsx(E,{})]}),A.jsx(dne,{...t})]})]})]})}function Yne(e){const{step:r,returnUrl:t,data:a={},footer:o,geoLocation:s,theme:u,additionalData:p}=e,[d,h]=Nr.useReducer(une,{step:r,returnUrl:t,geoLocation:s,theme:u,additionalData:p,...a});function f(_){h({type:"navigate",data:_})}const c=SF[d.step];return c||Pt({step:r,data:a},null),A.jsxs(A.Fragment,{children:[A.jsx(Kne,{footer:{...o,...d},bannerType:d.bannerType,step:r,theme:u,geoLocation:s,children:!!c&&A.jsx(c,{navigate:f,dispatch:h,...d})}),!1]})}function Jne(e){var c;const{id:r,returnUrl:t,footer:a,region:o,config:s,theme:u,additionalData:p}=e,d=e.currentStep||{},h=document.getElementById(r);hW.createRoot(h).render(A.jsx(Yne,{returnUrl:t,step:d.step,data:{...s,...d.data},footer:a,geoLocation:o,theme:((c=d.data)==null?void 0:c.theme)||u,additionalData:p}))}window.cvauth={start:Jne};
78
- //# sourceMappingURL=index-CQWaVNwN.js.map
78
+ //# sourceMappingURL=index-DpUPtszi.js.map