PageSourceSearch

https://smg.com/hubfs/hub_generated/template_assets/1/190527475496/1790015346558/template_lightbox.min.js

js smg.com collected 2026-09-24 22:10:06 UTC 14,672 bytes, 2 lines download raw bytes

1let bp_anim_rtl="";var BigPicture=function(){var el,initialized,container,displayElement,displayImage,displayVideo,displayAudio,iframeContainer,iframeSiteVid,imgSrc,closeButton,siteVidID,isLoading,checkMediaTimeout,loadingIcon,caption,captionText,captionContent,captionHideButton,isOpen,galleryOpen,isClosing,remoteImage,animationStart,animationEnd,onChangeImage,rightArrowBtn,leftArrowBtn,galleryPosition,galleryEls,galleryCounter,supportsTouch,opts,imgCache=[],preloadedImages={},appendEl="appendChild",createEl="createElement",removeEl="removeChild";function getRect(){var ref=el.getBoundingClientRect(),top=ref.top,left=ref.left,width=ref.width,height=ref.height;return"transform:translate3D("+(left-(container.clientWidth-width)/2)+"px, "+(top-(container.clientHeight-height)/2)+"px, 0) scale3D("+el.clientWidth/displayElement.clientWidth+", "+el.clientHeight/displayElement.clientHeight+", 0)"}function updateGallery(movement){var galleryLength=galleryEls.length-1;if(!isLoading){if(movement>0&&galleryPosition===galleryLength||movement<0&&!galleryPosition){if(!opts.loop)return changeCSS(displayImage,""),void setTimeout(changeCSS,9,displayImage,"animation:"+(movement>0?"bpl".concat(bp_anim_rtl):"bpf".concat(bp_anim_rtl))+" .3s;transition:transform .35s");galleryPosition=movement>0?-1:galleryLength+1}if([(galleryPosition=Math.max(0,Math.min(galleryPosition+movement,galleryLength)))-1,galleryPosition,galleryPosition+1].forEach(function(position){if(position=Math.max(0,Math.min(position,galleryLength)),!preloadedImages[position]){var src=galleryEls[position].src,img=document[createEl]("IMG");img.addEventListener("load",addToImgCache.bind(null,src)),img.src=src,preloadedImages[position]=img}}),preloadedImages[galleryPosition].complete)return changeGalleryImage(movement);isLoading=!0,changeCSS(loadingIcon,"opacity:.4;"),container[appendEl](loadingIcon),preloadedImages[galleryPosition].onload=function(){galleryOpen&&changeGalleryImage(movement)},preloadedImages[galleryPosition].onerror=function(){galleryEls[galleryPosition]={error:"Error loading image"},galleryOpen&&changeGalleryImage(movement)}}}function changeGalleryImage(movement){isLoading&&(container[removeEl](loadingIcon),isLoading=!1);var activeEl=galleryEls[galleryPosition];if(activeEl.error)alert(activeEl.error);else{var oldimg=container.querySelector("img:last-of-type");changeCSS(displayImage=displayElement=preloadedImages[galleryPosition],"animation:"+(movement>0?"bpfl"+bp_anim_rtl:"bpfr"+bp_anim_rtl)+" .35s;transition:transform .35s"),changeCSS(oldimg,"animation:"+(movement>0?"bpfol".concat(bp_anim_rtl):"bpfor".concat(bp_anim_rtl))+" .35s both"),container[appendEl](displayImage),activeEl.el&&(el=activeEl.el)}galleryCounter.innerHTML=galleryPosition+1+"/"+galleryEls.length,toggleCaption(galleryEls[galleryPosition].caption),onChangeImage&&onChangeImage([displayImage,galleryEls[galleryPosition]])}function updateIframeDimensions(){var height,width,windowHeight=.95*window.innerHeight,windowWidth=.95*window.innerWidth,windowAspect=windowHeight/windowWidth,ref=opts.dimensions||[1920,1080],dimensionWidth=ref[0],dimensionHeight=ref[1],iframeAspect=dimensionHeight/dimensionWidth;iframeAspect>windowAspect?width=(height=Math.min(dimensionHeight,windowHeight))/iframeAspect:height=(width=Math.min(dimensionWidth,windowWidth))*iframeAspect,iframeContainer.style.cssText+="width:"+width+"px;height:"+height+"px;"}function checkMedia(errMsg){~[1,4].indexOf(displayElement.readyState)?(open(),setTimeout(function(){displayElement.play()},99)):displayElement.error?open(errMsg):checkMediaTimeout=setTimeout(checkMedia,35,errMsg)}function toggleLoadingIcon(bool){opts.noLoader||(bool&&changeCSS(loadingIcon,"top:"+el.offsetTop+"px;left:"+el.offsetLeft+"px;height:"+el.clientHeight+"px;width:"+el.clientWidth+"px"),el.parentElement[bool?appendEl:removeEl](loadingIcon),isLoading=bool)}function toggleCaption(captionContent){captionContent&&(captionText.innerHTML=captionContent),changeCSS(caption,"opacity:"+(captionContent?"1;pointer-events:auto":"0"))}function addToImgCache(url){!~imgCache.indexOf(url)&&imgCache.push(url)}function open(err){if(isLoading&&toggleLoadingIcon(),animationStart&&animationStart(),"string"==typeof err)return removeContainer(),opts.onError?opts.onError():alert("Error: The requested "+err+" could not be loaded.");remoteImage&&addToImgCache(imgSrc),displayElement.style.cssText+=getRect(),changeCSS(container,"opacity:1;pointer-events:auto"),animationEnd&&(animationEnd=setTimeout(animationEnd,410)),isOpen=!0,document.body.classList.add("lightbox-open"),galleryOpen=!!galleryEls,setTimeout(function(){displayElement.style.cssText+="transition:transform .35s;transform:none",captionContent&&setTimeout(toggleCaption,250,captionContent)},60)}function close(e){var target=e?e.target:container,clickEls=[caption,captionHideButton,displayVideo,displayAudio,captionText,leftArrowBtn,rightArrowBtn,loadingIcon];target.blur(),isClosing||~clickEls.indexOf(target)||(displayElement.style.cssText+=getRect(),changeCSS(container,"pointer-events:auto"),setTimeout(removeC
1ontainer,350),clearTimeout(animationEnd),isOpen=!1,isClosing=!0,document.body.classList.remove("lightbox-open"))}function removeContainer(){if((displayElement===iframeContainer?iframeSiteVid:displayElement).removeAttribute("src"),document.body[removeEl](container),container[removeEl](displayElement),changeCSS(container,""),changeCSS(displayElement,""),toggleCaption(!1),galleryOpen){for(var images=container.querySelectorAll("img"),i=0;i<images.length;i++)container[removeEl](images[i]);isLoading&&container[removeEl](loadingIcon),container[removeEl](galleryCounter),galleryOpen=galleryEls=!1,preloadedImages={},supportsTouch||container[removeEl](rightArrowBtn),supportsTouch||container[removeEl](leftArrowBtn),displayImage.onload=open,displayImage.onerror=open.bind(null,"image")}opts.onClose&&opts.onClose(),isClosing=isLoading=!1}function changeCSS(ref,newStyle){ref.style.cssText=newStyle}return function(options){var source,loop;return initialized||function(){var startX;function createCloseButton(className){var el=document[createEl]("button");return el.className=className,el.innerHTML='<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M20.707 4.707a1 1 0 0 0-1.414-1.414L12 10.586 4.707 3.293a1 1 0 0 0-1.414 1.414L10.586 12l-7.293 7.293a1 1 0 1 0 1.414 1.414L12 13.414l7.293 7.293a1 1 0 0 0 1.414-1.414L13.414 12l7.293-7.293z" fill="currentColor"></path></svg>',el}function createArrowSymbol(direction,class_name){var el=document[createEl]("button");return el.className=class_name,el.innerHTML=1==direction?'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M6.32218 2.32544C6.75176 1.89152 7.44824 1.89152 7.87782 2.32544L17.6778 11.2143C18.1074 11.6482 18.1074 12.3518 17.6778 12.7857L7.87782 21.6746C7.44824 22.1085 6.75176 22.1085 6.32218 21.6746C5.89261 21.2406 5.89261 20.5371 6.32218 20.1032L15.3444 12L6.32218 3.89679C5.89261 3.46287 5.89261 2.75935 6.32218 2.32544Z" fill="currentColor"></path></svg>':'<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M17.6778 2.32544C17.2482 1.89152 16.5518 1.89152 16.1222 2.32544L6.32219 11.2143C5.89261 11.6482 5.89261 12.3518 6.32219 12.7857L16.1222 21.6746C16.5518 22.1085 17.2482 22.1085 17.6778 21.6746C18.1074 21.2406 18.1074 20.5371 17.6778 20.1032L8.65564 12L17.6778 3.89679C18.1074 3.46287 18.1074 2.75935 17.6778 2.32544Z" fill="currentColor"></path></svg>',el.onclick=function(e){e.stopPropagation(),updateGallery(direction)},el}var style=document[createEl]("STYLE");style.innerHTML="/*css here*/",document.head[appendEl](style),(container=document[createEl]("DIV")).id="bp_container",container.onclick=close,closeButton=createCloseButton("bp-x"),container[appendEl](closeButton),"ontouchstart"in window&&(supportsTouch=!0,container.ontouchstart=function(ref){var changedTouches=ref.changedTouches;startX=changedTouches[0].pageX},container.ontouchmove=function(e){e.preventDefault()},container.ontouchend=function(ref){var changedTouches=ref.changedTouches;if(galleryOpen){var distX=changedTouches[0].pageX-startX;distX<-30&&updateGallery(1),distX>30&&updateGallery(-1)}});displayImage=document[createEl]("IMG"),(displayVideo=document[createEl]("VIDEO")).id="bp_vid",displayVideo.setAttribute("playsinline",!0),displayVideo.controls=!0,displayVideo.loop=!0,(displayAudio=document[createEl]("audio")).id="bp_aud",displayAudio.controls=!0,displayAudio.loop=!0,(galleryCounter=document[createEl]("span")).id="bp_count",(caption=document[createEl]("DIV")).id="bp_caption",(captionHideButton=createCloseButton("bp-xc")).onclick=toggleCaption.bind(null,!1),caption[appendEl](captionHideButton),captionText=document[createEl]("SPAN"),caption[appendEl](captionText),container[appendEl](caption),leftArrowBtn=createArrowSymbol(-1,"bp-lr bp-lrl"),rightArrowBtn=createArrowSymbol(1,"bp-lr bp-lrr"),(loadingIcon=document[createEl]("DIV")).id="bp_loader",loadingIcon.innerHTML='<svg viewbox="0 0 32 32" fill="#fff" opacity=".8"><path d="M16 0a16 16 0 0 0 0 32 16 16 0 0 0 0-32m0 4a12 12 0 0 1 0 24 12 12 0 0 1 0-24" fill="#000" opacity=".5"/><path d="M16 0a16 16 0 0 1 16 16h-4A12 12 0 0 0 16 4z"/></svg>',(iframeContainer=document[createEl]("DIV")).id="bp_sv",(iframeSiteVid=document[createEl]("IFRAME")).allow="autoplay; fullscreen",iframeSiteVid.setAttribute("allowfullscreen",!0),iframeSiteVid.onload=function(){return iframeContainer[removeEl](loadingIcon)},changeCSS(iframeSiteVid,"border:0;position:absolute;height:100%;width:100%;left:0;
1top:0"),iframeContainer[appendEl](iframeSiteVid),displayImage.onload=open,displayImage.onerror=open.bind(null,"image"),window.addEventListener("resize",function(){galleryOpen||isLoading&&toggleLoadingIcon(!0),displayElement===iframeContainer&&updateIframeDimensions()}),document.addEventListener("keyup",function(ref){var keyCode=ref.keyCode;27===keyCode&&isOpen&&close(),galleryOpen&&(39===keyCode&&updateGallery(1),37===keyCode&&updateGallery(-1),38===keyCode&&updateGallery(10),40===keyCode&&updateGallery(-10))}),document.addEventListener("keydown",function(e){galleryOpen&&~[37,38,39,40].indexOf(e.keyCode)&&e.preventDefault()}),document.addEventListener("focus",function(e){isOpen&&!container.contains(e.target)&&(e.stopPropagation(),closeButton.focus())},!0),initialized=!0}(),isLoading&&(clearTimeout(checkMediaTimeout),removeContainer()),opts=options,siteVidID=options.ytSrc||options.vimeoSrc,animationStart=options.animationStart,animationEnd=options.animationEnd,onChangeImage=options.onChangeImage,el=options.el,remoteImage=!1,captionContent=el.getAttribute("data-caption"),options.gallery?function(gallery,position){var galleryAttribute=opts.galleryAttribute||"data-bp";if(Array.isArray(gallery))galleryEls=gallery,captionContent=gallery[galleryPosition=position||0].caption;else{var elIndex=(galleryEls=[].slice.call("string"==typeof gallery?document.querySelectorAll(gallery+" ["+galleryAttribute+"]"):gallery)).indexOf(el);galleryPosition=0===position||position?position:-1!==elIndex?elIndex:0,galleryEls=galleryEls.map(function(el){return{el:el,src:el.getAttribute(galleryAttribute),caption:el.getAttribute("data-caption")}})}remoteImage=!0,imgSrc=galleryEls[galleryPosition].src,!~imgCache.indexOf(imgSrc)&&toggleLoadingIcon(!0),galleryEls.length>1?(container[appendEl](galleryCounter),galleryCounter.innerHTML=galleryPosition+1+"/"+galleryEls.length,supportsTouch||(container[appendEl](rightArrowBtn),container[appendEl](leftArrowBtn))):galleryEls=!1;(displayElement=displayImage).src=imgSrc}(options.gallery,options.position):siteVidID||options.iframeSrc?(displayElement=iframeContainer,function(){var url,prefix="https://",suffix="autoplay=1";opts.ytSrc?url=prefix+"www.youtube"+(opts.ytNoCookie?"-nocookie":"")+".com/embed/"+siteVidID+"?html5=1&rel=0&playsinline=1&"+suffix:opts.vimeoSrc?url=prefix+"player.vimeo.com/video/"+siteVidID+"?"+suffix+"&dnt=1":opts.iframeSrc&&(url=opts.iframeSrc);changeCSS(loadingIcon,""),iframeContainer[appendEl](loadingIcon),iframeSiteVid.src=url,updateIframeDimensions(),setTimeout(open,9)}()):options.imgSrc?(remoteImage=!0,imgSrc=options.imgSrc,!~imgCache.indexOf(imgSrc)&&toggleLoadingIcon(!0),(displayElement=displayImage).src=imgSrc):options.audio?(toggleLoadingIcon(!0),(displayElement=displayAudio).src=options.audio,displayElement.loop=options.loop,checkMedia("audio file")):options.vidSrc?(toggleLoadingIcon(!0),options.dimensions&&changeCSS(displayVideo,"width:"+options.dimensions[0]+"px"),source=options.vidSrc,loop=options.loop,Array.isArray(source)?(displayElement=displayVideo.cloneNode(),source.forEach(function(src){var source=document[createEl]("SOURCE");source.src=src,source.type="video/"+src.match(/.(\w+)$/)[1],displayElement[appendEl](source)})):((displayElement=displayVideo).src=source,displayElement.loop=loop),checkMedia("video")):(displayElement=displayImage).src="IMG"===el.tagName?el.src:window.getComputedStyle(el).backgroundImage.replace(/^url|[(|)|'|"]/g,""),container[appendEl](displayElement),document.body[appendEl](container),{close:close,next:function(){return updateGallery(1)},prev:function(){return updateGallery(-1)}}}}();document.addEventListener("click",function(e){const self=e.target.closest(".lightbox");if(!self)return;const href=self.getAttribute("href");if(!href.startsWith("#"))if(e.preventDefault(),null!=href.split("?")[0].match(/\.(jpeg|jpg|gif|png|webp)$/)){var class_list=self.classList,group=!1;for(let j=0;j<class_list.length;j++)"lightbox-"==class_list[j].substring(0,9)&&(group=class_list[j]);BigPicture(group?{el:self,gallery:document.getElementsByClassName(group),galleryAttribute:"href"}:{el:self,imgSrc:href})}else if(href.match(/(youtube.com)/)){var yt_id=href.split("v=")[1];BigPicture({el:self,ytSrc:yt_id,ytNoCookie:!0})}else if(href.match(/(youtu.be)/)){yt_id=href.split("/")[3];BigPicture({el:self,ytSrc:yt_id,ytNoCookie:!0})}else if(href.match(/(vimeo.com\/)+[0-9]/)){var vm_id=href.split("/")[3];BigPicture({el:self,vimeoSrc:vm_id})}else if(href.match(/(vimeo.com\/)+[a-zA-Z]/)){vm_id=href.split("/")[4];BigPicture({el:self,vimeoSrc:vm_id})}else null!=href.match(/\.(mp4|webm)$/)?BigPicture({el:self,vidSrc:href,loop:!self.classList.contains("noloop")}):null!=href.match(/\.mp3$/)?BigPicture({el:self,audio:href,loop:!self.classList.contains("noloop")}):BigPicture({el:self,iframeSrc:href})});
2//# sourceURL=https://23425093.fs1.hubspotusercontent-na1.net/hubfs/23425093/hub_generated/template_assets/1/190527475496/1790015346558/template_lightbox.js

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