"use strict";(("undefined"!=typeof self?self:this).webpackChunkthundr=("undefined"!=typeof self?self:this).webpackChunkthundr||[]).push([[273],{273:(t,e,i)=>{i.r(e),i.d(e,{default:()=>W});var a=i(4180),s=i(939),o=i(4296),r=i(8635),n=i(1158),l=i(4739),h=i(6430);n.A.on("CHANGE_ACTIVE_IMAGE",(t=>{let{image:e,pageId:i}=t;n.A.get().gallery||n.A.get().set({gallery:{}});let a={activeImage:e};i&&(a={[i]:a}),n.A.get().gallery.set(a)})),n.A.on("GALLERY_SHARE_IMAGE",(async t=>{let{imageUrl:e,siteUrl:i,metaOverrides:a}=t;const s=await(0,l.xF)("generateHashFromQuery",{imageUrl:e,siteUrl:i,metaOverrides:a}),o="https://share.s-prod.pow.io/"+(0,h.zJ)({imageUrl:e,siteUrl:i,metaOverrides:a,hash:s});"function"==typeof navigator?.share?navigator.share({url:o}):n.A.get().gallery.set({imageShareLink:o})})),n.A.on("CLOSE_GALLERY_SHARE",(()=>{n.A.get().gallery.set({imageShareLink:!1})}));const d=n.A.get(),g=(0,h.wh)(d,"appData.options.paramountFeatures.toutCarousel.contentCarousel",!1);!d.gallery&&g&&d.set({gallery:{}});var c=i(9248),p=i(818),u=i(993),_=i(1866),m=i(5809),y=i(1324),A=i(4311),b=i(2265),w=i(7120),v=i(5971),S=i(4462);const f="STATE_CHILD_ENTERING",I="STATE_CHILD_VISIBLE",C="STATE_CHILD_LEAVING",D="STATE_CHILD_EMPTY";var E=i(7959);const k={visible:"transition__visible__cG1Az",leaving:"transition__leaving__m3Ebj",entering:"transition__entering__BjqLR",empty:"transition__empty__sRqEI"},T="undefined"==typeof window;class L extends o.uA{constructor(t){super(t),(0,s.A)(this,"getStyles",(()=>({"transition-duration":this.props.duration/2+"ms","animation-duration":this.props.duration/2+"ms"}))),(0,s.A)(this,"setTimer",((t,e)=>{this.endTimer(),this.timerFunc=t,this.timer=setTimeout((()=>{t(),this.timer=null,this.afterTimer&&(this.afterTimer(),this.afterTimer=null)}),e)})),(0,s.A)(this,"endTimer",(t=>{this.timer&&(clearTimeout(this.timer),t||this.timerFunc(),this.timer=null,this.afterTimer&&(this.afterTimer(),this.afterTimer=null))}));let e=this.getChildGenerator(t),i={firstChild:e,firstChildState:f,secondChild:null,secondChildState:D,upcomingChild:e},a=this.props.noInitialTransition;a&&(i.firstChildState=I),this.state=i,a||this.setTimer((()=>{this.setState({firstChildState:this.getNextStep("firstChild",this.state.firstChildState)})}),t.duration/2)}componentWillReceiveProps(t){let{waitBeforeNext:e,...i}=t,a=this.getChildGenerator(i),s=a();const o=this.getId(s);if(o!==this.getId(this.state.upcomingChild())){this.setState({upcomingChild:a});let t=this.state.firstChildState===I,i=this.state.secondChildState===I;!e||t||i?this.goToNextPage():this.afterTimer=this.goToNextPage}else this.state.firstChild&&this.getId(this.state.firstChild())===o&&this.setState({firstChild:a}),this.state.secondChild&&this.getId(this.state.secondChild())===o&&this.setState({secondChild:a})}componentDidUpdate(){this.renderDone?.resolve(),this.renderDone=null}getChildGenerator(t){return"function"==typeof t.renderChildren?t.renderChildren:()=>t.children[0]}getId(t){return t?.attributes?.id||t?.attributes?.key}async goToNextPage(){this.endTimer();const{firstChild:t,secondChild:e,upcomingChild:i,firstChildState:a,secondChildState:s}=this.state,o=s===I;if(a===I&&this.getId(i())===this.getId(t())||o&&this.getId(i())===this.getId(e()))return;this.setState({firstChildState:this.getNextStep("firstChild",a),secondChildState:this.getNextStep("secondChild",s)});this.renderDone?.resolve(),this.renderDone=(0,E.A)(),await this.renderDone,this.setTimer((()=>{this.setState({firstChildState:this.getNextStep("firstChild",this.state.firstChildState),secondChildState:this.getNextStep("secondChild",this.state.secondChildState)})}),this.props.duration/2)}getNextStep(t,e){let i={};switch(e){case f:return I;case I:return C;case C:return i[t]=null,this.setState(i),D;case D:return i[t]=this.state.upcomingChild,this.setState(i),f}}getActiveClass(t){let{enteringClass:e,visibleClass:i,leavingClass:a,emptyClass:s}=this.props,o=t===f,r=t===I,n=t===C,l=t===D;return(0,h.XS)(this.props.baseClass,o&&e,r&&i,n&&a,l&&s,{s:k,entering:o,visible:r,leaving:n,empty:l})}render(t,e){let i,a,{duration:s,...r}=t,{firstChild:n,firstChildState:l,secondChild:h,secondChildState:d}=e,g=this.getStyles();n=n&&n(),n?.attributes&&"string"!=typeof n?.nodeName&&(n.attributes.transitionState=T?I:l),h=h&&h(),h?.attributes&&"string"!=typeof h?.nodeName&&(h.attributes.transitionState=d);let c=this.getActiveClass(T?I:l);i=(0,o.h)("div",{class:c,style:g},n);let p=this.getActiveClass(d);return a=(0,o.h)("div",{class:p,style:g},h),(0,o.h)("div",{class:r.class,id:r.id},i,a)}}const M={container:"gallery__container__o4CoH",dedicatedPage:"gallery__dedicatedPage__TIwO2",inner:"gallery__inner__k18iX",includeTopArrows:"gallery__includeTopArrows__qcM7I",loading:"gallery__loading__mfgeP",galleryTitle:"gallery__galleryTitle__luxxc",galleryDescription:"gallery__galleryDescription__DQIKa",withMobileArrows:"gallery__withMobileArrows__V4tE7",videoContainer:"gallery__videoContainer__bqOjt",touchOverlay:"gallery__touchOverlay__YQRt4",spinner:"gallery__spinner__ZvQAr",spin:"gallery__spin__AWWwM",contentWrapper:"gallery__contentWrapper__N5Km6",imageWrapper:"gallery__imageWrapper__mEMVR",imageTransitionContainer:"gallery__imageTransitionContainer__BZEyi",imageTransitionVisible:"gallery__imageTransitionVisible__vtziq",imageTransitionLeaving:"gallery__imageTransitionLeaving__APx7g",annotationTransitionContainer:"gallery__annotationTransitionContainer__WQLfA",annotationTransitionLeaving:"gallery__annotationTransitionLeaving__oJ2yz",activeImage:"gallery__activeImage__ElOts",clickable:"gallery__clickable__I27Jp",video:"gallery__video__KcZUO",arrows:"gallery__arrows__Fo3Hm",hideArrowsDesktop:"gallery__hideArrowsDesktop__FZJWs",mobileArrows:"gallery__mobileArrows__YWFWp",noDownloads:"gallery__noDownloads__LHorc",hideArrowsMobile:"gallery__hideArrowsMobile__tKbqd",arrowBtn:"gallery__arrowBtn__qsj8j",leftArrow:"gallery__leftArrow__NqrOU",rightArrow:"gallery__rightArrow__wR9Oe",bottomWrapper:"gallery__bottomWrapper__CmXJI",bottom:"gallery__bottom__wd9w0",navDots:"gallery__navDots__vWAwq",dotBtn:"gallery__dotBtn__pnzRj",pointer:"gallery__pointer__peXkT",hasDownloads:"gallery__hasDownloads__TArHK",canShare:"gallery__canShare__EPc38",dot:"gallery__dot__SjRul",activeDot:"gallery__activeDot__ulZ24",popBack:"gallery__popBack__lFxcO",fade:"gallery__fade__fZ_ci",pop:"gallery__pop__To36B",goingLeft:"gallery__goingLeft__dikMo",isLast:"gallery__isLast__mGHdQ",goingRight:"gallery__goingRight__TPfFB",isFirst:"gallery__isFirst__k93Oy",annotation:"gallery__annotation__NmpqE",share:"gallery__share__DSV3L",sharePopout:"gallery__sharePopout__VDMvY",downloadBtnContainer:"gallery__downloadBtnContainer__xdv7O",downloadButton:"gallery__downloadButton__v2XaY",downloadSingle:"gallery__downloadSingle__rJ2e3",downloadAll:"gallery__downloadAll__RPyaG",rotate:"gallery__rotate__bxtes",downloadInProgress:"gallery__downloadInProgress__C913m",downloadIcon:"gallery__downloadIcon__OFfz5",extraActions:"gallery__extraActions__jAWlL",isEmbeded:"gallery__isEmbeded__wbuxY",active:"gallery__active__lTEf2",disabled:"gallery__disabled__z8FHb",lowerOpacity:"gallery__lowerOpacity__UjqMV",miniGallery:"gallery__miniGallery__VqQ3U"};var R=i(6924),G=i(7081),O=i(2824),P=i(8790);class W extends r.A{constructor(t){super(t),(0,s.A)(this,"unpackYoutubePlaylists",(t=>{void 0!==t.find((t=>t.youtubePlaylistId))&&this.replacePlaylistWithVideos(t)})),(0,s.A)(this,"removeYoutubePlaylists",(t=>t.filter((t=>!t.youtubePlaylistId&&t)))),(0,s.A)(this,"onLoadedHandler",(()=>{this.setState({loading:!1})})),(0,s.A)(this,"onEndedHandler",(t=>{this.getNextVideo(t,this.state.images)?this.changeImageRelative(1):n.A.emit("VIDEO_ENDED",t)})),(0,s.A)(this,"getNextVideo",((t,e)=>{if(!t||!e.length)return;const i=e.findIndex((e=>e.key===t.key));return this.autoRotate&&i+1===e.length?e[0]:e[i+1]}));const e=this.hasMultipleGalleries(),i=t.appData,a=this.props.pageData||i?.pages?.[this.props.id]?.data;let o=a?.contentCarousel;this.props.isMiniGallery?o=this.props.appData?.options?.paramountFeatures?.toutCarousel?.contentCarousel:this.props.isEmbeded&&(o=a?.gallery?.contentCarousel),this.autoRotate=a?.autoRotate||!1,t.isMiniGallery&&(this.autoRotate=t?.appData?.options?.paramountFeatures?.toutCarousel?.autoRotate||!1);const r=a?.hash,l=i?.pages?.[this.props.id]?.name,d=i?.copy?.baseCopy?.[l]||(l?.startsWith("$")?null:l)||t.id,g=(0,h.fz)(o,((t,e)=>({...t,fileName:t?.pdfSrc?.split("/")?.pop(),key:e,trackKey:(0,O.A)(d+"-"+e),altKey:r&&(0,O.A)(r+"-"+e)})));this.unpackYoutubePlaylists(g),this.loadedSrcs=[],this.state={images:g||[],hasMultipleGalleries:e},this.observerCallback=this.observerCallback.bind(this),this.onDragStart=this.onDragStart.bind(this),this.onDrag=this.onDrag.bind(this),this.onDragEnd=this.onDragEnd.bind(this),this.onImageClick=this.onImageClick.bind(this),this.imageLoaded=this.imageLoaded.bind(this),this.renderImageLoader=this.renderImageLoader.bind(this),this.downloadAll=this.downloadAll.bind(this),this.downloadAllAsSingleFile=this.downloadAllAsSingleFile.bind(this),this.getFallbackFormat=this.getFallbackFormat.bind(this),this.togglePlaying=this.togglePlaying.bind(this),this.videoClickHandler=this.videoClickHandler.bind(this),this.onImageShare=this.onImageShare.bind(this),this.getImageForHash=this.getImageForHash.bind(this),this.useDownloadAttribute="undefined"==typeof window||"download"in document.createElement("a")}componentDidMount(){super.componentDidMount();const t=this.getActiveImage();this.activeImageUrl=this.getSrc(t),t&&n.A.emit("GALLERY_VIEW_IMAGE",t?.trackKey);t.videoSrc||t.vimeoId||t.youtubeId||t.youtubeId||t.disneySrc||t.youtubePlaylistId||(this.observer=new IntersectionObserver(this.observerCallback,{threshold:[1]}),this.observer.observe(this.contentWrapper))}componentWillUnmount(){window.clearTimeout(this.nextRotationTimer),window.clearTimeout(this.changeImageTimeout),this.observer&&(this.observer.unobserve(this.contentWrapper),this.observer.disconnect())}componentDidUpdate(t){if(t.id!==this.props.id){const t=this.props.pageData||this.props.appData.pages[this.props.id]?.data;let e=t?.contentCarousel;this.props.isMiniGallery?e=(0,h.wh)(this.props,"appData.options.paramountFeatures.toutCarousel.contentCarousel",{}):this.props.isEmbeded&&(e=t?.gallery?.contentCarousel);const i=(0,h.fz)(e,((t,e)=>({...t,key:(0,O.A)(e)})));this.unpackYoutubePlaylists(i),n.A.emit("CHANGE_ACTIVE_IMAGE",{image:i[0],pageId:this.props.combinedId||this.props.id}),this.setState({images:i})}}observerCallback(t){let[e]=t;if(e.isIntersecting&&1===e.intersectionRatio&&!this.firstAutoRotationTriggered){this.firstAutoRotationTriggered=!0;const t=this.getActiveImage(),e=this.getSrc(t);this.setAutoRotateTimer(e)}}replacePlaylistWithVideos(t){Promise.all(t.map((t=>t&&t.youtubePlaylistId?this.getVideosFromPlaylist(t):t))).then((t=>{const e=[].concat(...t);this.setState({images:(0,c.Zs)(e)})})).catch((()=>{this.setState({images:this.removeYoutubePlaylists(t)})}))}sortPlaylist(t,e,i){if(!i)return 0;const a=i.replace(/\s/g,"").split(",").reverse();return a.indexOf(e.snippet.resourceId.videoId)-a.indexOf(t.snippet.resourceId.videoId)}getVideosFromPlaylist(t){const e=t.youtubePlaylistId,i="No Cookie Mode"===t.noCookies;return(0,u.l)(e).then((e=>e.items.filter((t=>t.snippet.thumbnails.medium)).sort(((e,i)=>this.sortPlaylist(e,i,t.playlistOrder))).map((t=>({name:t.snippet.title,thumbSrc:t.snippet.thumbnails.medium.url,youtubeId:t.snippet.resourceId.videoId,key:t.id,noCookies:i})))))}hasMultipleGalleries(){const t=(0,h.fz)((0,h.wh)(this.props,"appData.pages",{})).filter((t=>"gallery"===t.component||"gallery"===t.page||t.data?.gallery?.contentCarousel||"filmPage"===t.type)),e=(0,h.wh)(this.props,"appData.options.paramountFeatures.toutCarousel.contentCarousel",!1);let i=t.length;return e&&(i+=1),i>1}getFallbackFormat(){return(0,h.wh)(this.props,"appData.pages.boltGallery.data.alternativeImageFormat","jpg")}getActiveImage(){const{images:t,hasMultipleGalleries:e}=this.state,{isMiniGallery:i}=this.props,a=n.A.get(),s=i?"miniGallery":this.props.combinedId||this.props.id;let o=e?(0,h.wh)(a,["gallery",s,"activeImage"]):(0,h.wh)(a,"gallery.activeImage");if(o){let e=t.findIndex((t=>t.key===o?.key));t.length&&-1==e&&(o=t[0])}const r=o||t[0]||{},l=this.getImageForHash();return l||r}getImageForHash(){const t="undefined"!=typeof window&&location.hash.slice(1);if(!t)return;const{images:e}=this.state;return e.find((e=>{const i=e.vimeoId||e.youtubeId;return!!i?i===t||e.key===t:e.key===t||e.altKey===t}))}changeActiveImage(t){n.A.emit("GALLERY_VIEW_IMAGE",t.key);const{hasMultipleGalleries:e}=this.state,{isMiniGallery:i}=this.props,a=e&&(i?"miniGallery":this.props.id),s=t.videoSrc||t.vimeoId||t.youtubeId||t.youtubeId||t.disneySrc||t.youtubePlaylistId;n.A.emit("CHANGE_ACTIVE_IMAGE",{image:t,pageId:e&&(this.props.combinedId||a)});const o=this.getSrc(t);if(this.autoRotate&&(window.clearTimeout(this.nextRotationTimer),!s&&this.setAutoRotateTimer(o)),i)return;this.getImageForHash()&&window.history.replaceState({},document.title,"."+location.search);o===this.activeImageUrl&&!s||this.loadedSrcs.includes(o)||this.setState({loading:!0}),o&&!s&&(this.activeImageUrl=this.getSrc(t))}getSrc(t){let e;return e=t.mobileSrc||t.tabletSrc?{desktop:t.desktopSrc,mobile:t.mobileSrc,tablet:t.tabletSrc}:t.desktopSrc,(0,p.L)((0,c.xO)(e))}onDragStart(t){if(1===(this.state.images||[]).length)return;const e=this.props.client?.isDesktopSize,{isMiniGallery:i}=this.props;if(this.grabbed||void 0!==t.button&&0!==t.button||e||i)return;t.touches&&t.touches.length||t.preventDefault();this.contentWrapper.style.transition="none";let a=t.touches&&t.touches[0]||t,s=a.pageX||0;this.grabbed={x:s,y:a.pageY||0,previous:s,lastEvent:Date.now()}}onDrag(t){if(1===(this.state.images||[]).length)return;const e=this.props.client?.isDesktopSize,{isMiniGallery:i}=this.props;if(!this.grabbed||e||i)return;const a=this.contentWrapper;let s=t.touches&&t.touches[0]||t,o=s.pageX||0,r=s.pageY||0,n=Math.abs(o-this.grabbed.x),l=Math.abs(r-this.grabbed.y);a.style.transform=`translate(${o-this.grabbed.x}px, -50%)`,!this.grabbed.active&&n<8?l>=8&&(this.grabbed=!1):(this.grabbed.active||(this.grabbed.x=o,this.grabbed.active=!0),t.cancelable&&t.preventDefault(),this.grabbed.lastEvent=Date.now(),this.grabbed.speed=this.grabbed.previous-o,this.grabbed.previous=o)}onDragEnd(t){const e=this.props.client?.isDesktopSize,{isMiniGallery:i}=this.props;let a=this.grabbed;if(this.grabbed=!1,a){if(!a.active||e||i)return void this.onImageClick(t);const s=this.contentWrapper;let o=a.speed*Math.max(0,1-(Date.now()-a.lastEvent)/200);Math.abs(o)>3&&(this.setState({swipeToChange:!0}),this.changeImageRelative(o>0?1:-1),s.style.transform=`translate(${o>0?100:-100}%, -50%)`),this.changeImageTimeout=window.setTimeout((()=>{s.style.transition=".3s transform",s.style.transform="translate(0, -50%)",this.setState({swipeToChange:!1})}),10)}else this.contentWrapper.style.transition=".3s transform",this.contentWrapper.style.transform="translate(0, -50%)",this.setState({swipeToChange:!1})}onImageClick(t){}changeImageRelative(t,e){let i=this.state.images||[];if(1===i.length)return;const a=this.getActiveImage();let s=i.findIndex((t=>t.key===a.key));-1===s&&(s=0),s=(s+t)%i.length,s<0&&(s+=i.length),this.setState({direction:t});const o=i[s];o&&this.changeActiveImage(o,e)}download(t,e){const i=(0,h.wh)(this.props,"client.isEdge",!1),a=(0,h.wh)(this.props,"client.isIOS",!1);if(e.target="_blank",a)e.target="_blank";else if(!i){const i=document.createElement("canvas"),a=i.getContext("2d");i.width=t.naturalWidth,i.height=t.naturalHeight,a.drawImage(t,0,0),e.href=i.toDataURL("image/jpeg"),e.style.display="none"}document.body.appendChild(e),e.click(),document.body.removeChild(e)}downloadImage(t,e){let i=this.$galleryImage;const a=(0,h.wh)(this.props,"appData.meta.title.localeSlug","image"),s=(0,h.wh)(this.props,"client.isIOS",!1),o=t.pdfSrc||this.getSrc(t);let r=document.createElement("a");const n=o.endsWith("gif");return!n&&!t.pdfSrc||s?(r.download=e?`${a}-${e}.jpg`:`${a}.jpg`,r.href=o,i?void 0!==e?(i=document.createElement("IMG"),i.crossOrigin="anonymous",i.src=o+(o.includes("?")?"&":"?")+"_cors=1",void(i.onload=()=>{this.download(i,r)})):void this.download(i,r):void 0):this.downloadGifOrPdf(n?o:t.pdfSrc,t.fileName?t.fileName:`${a}.${n?"gif":"pdf"}`)}async downloadGifOrPdf(t,e){const i=await fetch(t),a=await i.blob(),s=document.createElement("a");s.href=window.URL.createObjectURL(a),s.download=e,s.dataset.downloadurl=["application/octet-stream",s.download,s.href].join(":"),s.click()}downloadAll(){this.state.images.forEach(((t,e)=>this.downloadImage(t,e))),n.A.emit("GALLERY_DOWNLOAD_ALL",this.props.id)}async downloadAllAsSingleFile(t){let{path:e,fileName:i}=t;const a=e.endsWith(".gif"),s=e.endsWith(".pdf");(a||s)&&(n.A.emit("GALLERY_DOWNLOAD_ALL",this.props.id),this.setState({downloadAllInProgress:!0}),await this.downloadGifOrPdf(e,i),this.setState({downloadAllInProgress:!1}))}togglePlaying(t){this.setState({playing:t})}triggerImageClick(t){if(this.props.isMiniGallery&&n.A.emit("TOUT_CLICK","carousel","tout",t),!t.startsWith("http"))return t.startsWith("@")?n.A.emit("OPEN_RESERVED_VARIABLE_LINK",t):(0,c.aN)(t)?n.A.emit("OPEN_VIDEO_OVERLAY",t):"boltShowtimes"===t?n.A.emit("SHOWTIMES_SHOW",!0):"boltHomeEnt"===t?n.A.emit("HOMEENT_SHOW",!0):n.A.emit("CHANGE_ACTIVE_SECTION",t)}onImageShare(t){const e=this.getActiveImage(),i=this.getSrc(e),a=window.location.href;n.A.emit("GALLERY_SHARE_IMAGE",{imageUrl:i,siteUrl:a,metaOverrides:t})}toggleShare(){n.A.emit("CLOSE_GALLERY_SHARE")}setAutoRotateTimer(t){!this.autoRotate||this.autoRotate<=0||(this.loadedSrcs.includes(t)?this.nextRotationTimer=window.setTimeout((()=>{this.changeImageRelative(1)}),1e3*this.autoRotate):this.autoRotateWaitingForLoad=t)}videoClickHandler(){this.videoPlayer&&(this.state.videoPlaying||this.videoPlayer.play())}renderArrow(t,e){const i=(0,h.wh)(this.props,"appData.copy.accessibilityCopy.$RIGHT_ARROW_ARIA"),a=(0,h.wh)(this.props,"appData.copy.accessibilityCopy.$LEFT_ARROW_ARIA");return(0,o.h)(_.A,{class:(0,h.XS)(M.arrowBtn,this.state.loading&&M.disabled),disabled:this.state.loading,trigger:()=>this.changeImageRelative(e),ariaLabel:"rightArrow"===t?i:a},(0,o.h)(y.A,{class:M[t]}))}renderNavDots(t,e){return(0,o.h)("div",{class:M.navDots},t.map(((i,a)=>{const s=e==i.key,r=0===a,n=a===t.length-1;let{direction:l=1}=this.state;return 2===t.length&&0==e&&(l=-1),(0,o.h)("div",{class:(0,h.XS)(M.dotBtn,M.pointer),onClick:()=>this.changeActiveImage(i)},(0,o.h)("div",{class:(0,h.XS)({s:M,dot:!0,activeDot:s,isFirst:r,isLast:n,goingLeft:-1===l,goingRight:1===l})}))})))}renderDownloadButtons(t,e,i,s){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},l=arguments.length>5?arguments[5]:void 0;const d=(0,h.wh)(this.props,"appData.copy",{});if(!e&&!i)return;const g=t.pdfSrc;let c;if(e){const t=s?.path&&s.fileName,e=this.props.client?.isIOS,i=t&&e,r=[(0,o.h)("span",null,d.baseCopy.$ALL||"All"),(0,o.h)(m.A,{class:M.downloadIcon})],n=this.state.downloadAllInProgress,g={class:(0,h.XS)(M.downloadButton,M.downloadAll,l&&M.lowerOpacity,n&&M.downloadInProgress),disabled:l||n,key:"all",ariaLabel:d.accessibilityCopy.$DOWNLOAD_ALL_ARIA};if(i)c=(0,o.h)("a",(0,a.A)({},g,{target:"_blank",href:s.path,download:s.fileName}),r);else{const e=t?()=>this.downloadAllAsSingleFile(s):this.downloadAll;c=(0,o.h)(_.A,(0,a.A)({},g,{trigger:e}),r)}}return(0,o.h)("div",{class:(0,h.XS)(M.downloadBtnContainer,r.galleryDownloadButtons),key:"download-buttons"},i&&(0,o.h)(_.A,{class:(0,h.XS)(M.downloadButton,M.downloadSingle,l&&M.lowerOpacity),disabled:l,trigger:()=>{this.downloadImage(t,t.key),n.A.emit("GALLERY_DOWNLOAD_IMAGE",t.key)},key:"single",ariaLabel:d.accessibilityCopy.$DOWNLOAD_IMAGE_ARIA},(0,o.h)("span",null,g?d.baseCopy.$PDF||"PDF":d.baseCopy.$IMAGE||"Image"),(0,o.h)(m.A,{class:M.downloadIcon})),c)}renderImageLoader(){return(0,o.h)("div",{class:M.spinner,key:"loader"})}imageLoaded(t){this.loadedSrcs.includes(t)||this.loadedSrcs.push(t),this.setState({loading:!1}),this.autoRotateWaitingForLoad===t&&(this.autoRotateWaitingForLoad=null,this.setAutoRotateTimer(t))}onMarkdownClickCapture(){}renderImage(){const{loading:t,swipeToChange:e}=this.state,i=this.getActiveImage(),a=this.getSrc(i),s=this.getFallbackFormat(),r=e?0:1e3,n=i.alt&&"$"===i.alt.charAt(0)?(0,P.u)(i.alt):i.alt||"";let l=(0,o.h)(L,{duration:r,class:M.imageTransitionContainer,visibleClass:M.imageTransitionVisible,leavingClass:M.imageTransitionLeaving},(0,o.h)(G.VI,{class:(0,h.XS)(M.activeImage,t&&M.loading,i.path&&M.clickable),src:a,fallbackFormat:s,alt:n,ariaLabel:n,onLoad:()=>this.imageLoaded(a),ref:t=>this.$galleryImage=t,key:`image-${a}`,onMouseDown:this.onDragStart,onTouchStart:this.onDragStart,onMouseMove:this.onDrag,onTouchMove:this.onDrag,onMouseUp:this.onDragEnd,onTouchEnd:this.onDragEnd,onClick:!!i.path&&(()=>this.triggerImageClick(i.path,i.sameWindow))}));return i.path?.startsWith("http")?(0,o.h)(b.A,{href:i.path,target:i.sameWindow?"_self":"_blank"},l):l}renderVideo(){const{loading:t,playing:e}=this.state,i=this.getActiveImage(),a=i.youtubeId,s=this.props?.id,r=this.props?.appData?.pages[s]?.data||{};return(0,o.h)("div",{class:(0,h.XS)(M.videoContainer,t&&M.loading),ref:t=>this.videoContainer=t,onMouseDown:!a&&this.onDragStart,onTouchStart:!a&&this.onDragStart,onMouseMove:!a&&this.onDrag,onTouchMove:!a&&this.onDrag,onMouseUp:!a&&this.onDragEnd,onTouchEnd:!a&&this.onDragEnd},(0,o.h)(w.A,{ref:t=>this.videoPlayer=t,activeVideo:i,onPlay:()=>this.togglePlaying(!0),onPause:()=>this.togglePlaying(!1),noAutoplay:i.noAutoplay,onLoaded:this.onLoadedHandler,onEnded:()=>this.onEndedHandler(i),overrideStyles:!0,muted:r.autoMuteVideos}),a&&(0,o.h)("div",{onMouseDown:this.onDragStart,onTouchStart:this.onDragStart,onMouseMove:this.onDrag,onTouchMove:this.onDrag,onMouseUp:this.onDragEnd,onTouchEnd:this.onDragEnd,onClick:this.videoClickHandler,class:M.touchOverlay,style:{pointerEvents:e?"none":"all"}}))}renderPDF(){const t=this.getActiveImage();if(t.desktopSrc||t.mobileSrc||t.tabletSrc)return this.renderImage();let e=(0,o.h)("embed",{type:"application/pdf",onClick:t.path&&(()=>this.triggerImageClick(t.path,t.sameWindow)),src:t.pdfSrc,width:"100%",height:"100%",onLoad:()=>this.imageLoaded(t.pdfSrc),ariaLabel:t.ariaLabel,onMouseDown:this.onDragStart,onTouchStart:this.onDragStart,onMouseMove:this.onDrag,onTouchMove:this.onDrag,onMouseUp:this.onDragEnd,onTouchEnd:this.onDragEnd});return t.path?.startsWith("http")?(0,o.h)(b.A,{class:M.activeImage,href:t.path,target:t.sameWindow?"_self":"_blank"},e):(0,o.h)("div",{class:M.activeImage},e)}renderContent(t,e){switch(e?"video":t.pdfSrc?"pdf":"image"){case"video":return this.renderVideo();case"pdf":return this.renderPDF();case"image":return this.renderImage()}}renderShare(t,e){const i=this.getActiveImage(),a=this.getSrc(i),s=this.props?.appData?.copy?.baseCopy||{},r=this.props?.appData?.copy?.accessibilityCopy||{},n=s.$GALLERY_SHARE||s.$SHARE||"Share";return(0,o.h)("div",{class:M.share},(0,o.h)(_.A,{class:t&&M.lowerOpacity,trigger:()=>this.onImageShare(e),key:"image-share",ariaLabel:r.$GALLERY_SHARE_ARIA,disabled:t},n,(0,o.h)(S.A,{class:M.downloadIcon,"aria-hidden":!0})),(0,o.h)(v.A,{extraClass:M.sharePopout,appData:this.props.appData,shareOpen:this.props.store?.gallery?.imageShareLink,toggleSharePop:this.toggleShare,shareUrl:this.props.store?.gallery?.imageShareLink,shareImage:a,key:"gallery-share"}))}onClick(t){let e=t.target.closest('a[href^="#$"]');if(e){t.preventDefault();let i=e.getAttribute("href").slice(2).trim(),a={};if(i.includes("/?")){let[t,e]=i.split("/?");i=t,a.queryString="?"+e}(0,c.OU)(i,a)}}render(t){let e=`appData.pages.${t.id}.data`;t.isEmbeded&&(e=`${e}.gallery`);const i=t.pageData||(0,h.wh)(t,e)||{},{images:a,loading:s,swipeToChange:r}=this.state,n=(0,h.wh)(t,"client.dimensions.width",0)>=1024,l=this.getActiveImage(),d=l.videoSrc||l.vimeoId||l.youtubeId||l.youtubeId||l.disneySrc||l.youtubePlaylistId,g=i.title,c=i.downloadAll,p=i.customDownloadAll||{},u=i.downloadSingle,_=i.share,m=i.description,y=i.hideArrowsMobile||t.isMiniGallery,b=i.hideArrowsDesktop||t.isMiniGallery,w="mobile"===(0,h.wh)(t,"client.deviceSize","mobile"),v=i.shareMetaOverrides,S=a.length>1,f=S&&!n,I=t.store?.header?.activeSection===t.id,C=(0,h.wh)(t,"appData.styling.fontVariables",{}),D=this.state.images.map((t=>this.getSrc(t))).find((t=>t&&t.endsWith("gif"))),E=(0,h.wh)(t,"client.isIOS",!1),k=(0,h.wh)(t,"client.isSafari",!1),T=E&&!k&&D,G=(0,h.wh)(this.props,["store","appData","pages",t.id,"section"]),O=R.Bd[t.id]&&!G,P=(c||u)&&!T,W=P||_,F=r?0:1e3;return(0,o.h)("div",{class:(0,h.XS)({s:M,container:!0,active:I,hasDownloads:P,canShare:_,includeTopArrows:!n&&!y,isEmbeded:t.isEmbeded,dedicatedPage:O,miniGallery:t.isMiniGallery}),"data-section":t.id,ref:t=>this.$container=t},this.renderBgContent(),(0,o.h)("div",{class:M.inner},g&&(0,o.h)(A.A,{tag:"h1",onClickCapture:this.onClick,markdown:!0,content:g,class:(0,h.XS)(M.galleryTitle,"h3")}),m&&(0,o.h)(A.A,{tag:"h2",onClickCapture:this.onMarkdownClickCapture,markdown:!0,content:m,class:(0,h.XS)(M.galleryDescription,"xlarge",w&&!y&&M.withMobileArrows)}),(0,o.h)("div",{class:M.imageWrapper,key:"imageWrapper",id:`${t.id}GalleryImageWrapper`},S&&(0,o.h)("div",{class:(0,h.XS)(M.arrows,f&&M.mobileArrows,!P&&M.noDownloads,y&&M.hideArrowsMobile,b&&M.hideArrowsDesktop),key:"arrows"},this.renderArrow("leftArrow",-1),this.renderArrow("rightArrow",1)),(0,o.h)("div",{class:M.contentWrapper,ref:t=>this.contentWrapper=t},this.renderContent(l,d)),s&&this.renderImageLoader()),(0,o.h)("div",{class:M.bottomWrapper,key:"bottomWrapper"},(0,o.h)("div",{class:M.bottom,key:"bottom"},S&&this.renderNavDots(a,l.key),l.annotation&&(0,o.h)(L,{duration:F,class:M.annotationTransitionContainer,leavingClass:M.annotationTransitionLeaving},(0,o.h)(A.A,{class:(0,h.XS)(M.annotation,C.galleryAnnotations),content:l.annotation,markdown:!0,key:l.annotation})),W&&(0,o.h)("div",{class:M.extraActions},_&&this.renderShare(d,v),!T&&this.renderDownloadButtons(l,c,u,p,C,d))))),this.renderOverlayedContent())}}},5809:(t,e,i)=>{i.d(e,{A:()=>o});var a=i(4180),s=i(4296);const o=t=>(0,s.h)("svg",(0,a.A)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},t),(0,s.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 0a.5.5 0 0 1 .5.5v8.793l1.646-1.647a.502.502 0 0 1 .708.708l-2.5 2.5a.502.502 0 0 1-.708 0l-2.5-2.5a.502.502 0 0 1 .708-.708L7.5 9.293V.5A.501.501 0 0 1 8 0z"}),(0,s.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.5 11a.5.5 0 0 1 .5.5v3c0 .827-.673 1.5-1.5 1.5h-9c-.827 0-1.5-.673-1.5-1.5l.001-3a.5.5 0 0 1 1 0v3a.5.5 0 0 0 .499.5h9c.275 0 .5-.225.5-.5v-3a.5.5 0 0 1 .5-.5z"}))},8635:(t,e,i)=>{i.d(e,{A:()=>n});var a=i(4296),s=i(1158),o=i(6430);const r={};class n extends a.uA{componentDidMount(){const t=this.props.appData,e=t?.pages?.[this.props.id];t?.options?.ageGate&&e?.section&&i.e(873).then(i.bind(i,8943)).then((t=>{this.AgeGate=t.default,this.forceUpdate()})),e?.data?.bg&&i.e(528).then(i.bind(i,1076)).then((t=>{this.SectionBackground=t.default,this.forceUpdate()}))}shouldShowAgeGate(){const t=this.props.appData,e=this.props.appData?.options?.ageGate,i=t?.pages?.[this.props.id];if(!e||!i?.section||!1!==s.A.get().ageGateOpen)return!1;const a=e?.onlyOnPages||"";return(0,o.fY)(a).includes(this.props.id)}renderBgContent(){const{appData:t,id:e}=this.props,i=t.pages[e]?.data;if(this.SectionBackground&&i?.bg)return(0,a.h)("div",{class:r.contentBelow},(0,a.h)(this.SectionBackground,{ref:t=>this.sectionBackground=t,data:i.bg}))}renderOverlayedContent(){const{appData:t}=this.props;if(this.AgeGate)return(0,a.h)("div",{class:r.overlayedContent},!!this.shouldShowAgeGate()&&(0,a.h)(this.AgeGate,{appData:t,copy:t.copy,key:"ageGate",isSectionAgeGate:!0}))}}},993:(t,e,i)=>{function a(t){return 0===t.status||t.status>=400&&t.status<600}async function s(t){if(a(t))throw t;return t.json()}i.d(e,{l:()=>r});const o="undefined"==typeof window,r=async t=>{if(o)throw new Error("Trying to call service-youtube server-side");if(!t)throw new Error("No playlist id given");return fetch(`https://youtube.s-prod.pow.io/getPlaylistData?playlistId=${t}`).then(s)}}}]);
//# sourceMappingURL=273.bolt.js.map?v=9e6a5e68e19f7e5ad653