@behold/widget 0.5.158 → 0.5.159

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.
@@ -1 +1 @@
1
- import{B as t,c as s}from"./index-DqJM0ILL.js";import{l as e}from"./logo-CAJXYQBc.js";class r extends t{label="Branding";t;constructor(){super(),this.onConnect(()=>{this.t=s({type:"a",classes:"branding",contents:[e],attributes:{href:"https://behold.so",target:"_blank","aria-label":"behold"}}),this.replaceChildren(this.t)})}static register(t="behold-branding"){return customElements.get(t)||customElements.define(t,r),t}}export{r as B};
1
+ import{B as t,c as s}from"./index-DlG54u5e.js";import{l as e}from"./logo-CAJXYQBc.js";class r extends t{label="Branding";t;constructor(){super(),this.onConnect(()=>{this.t=s({type:"a",classes:"branding",contents:[e],attributes:{href:"https://behold.so",target:"_blank","aria-label":"behold"}}),this.replaceChildren(this.t)})}static register(t="behold-branding"){return customElements.get(t)||customElements.define(t,r),t}}export{r as B};
@@ -1 +1 @@
1
- import{c as t,m as s,g as i,d as e,n as o,s as h,j as r}from"./index-DqJM0ILL.js";import{B as n,a,b as l,A as c,c as d,g as u}from"./base-t3hPe2AE.js";import{c as p,a as g}from"./caret-right-CSBbJCRm.js";const b=/^mozilla\/\d\.\d\W/,f=/(\w+)\/(\d+\.\d+(?:\.\d+)?(?:\.\d+)?)/g,m=/^(ver|cri|gec)/,v=["chrome","opera","safari","edge","firefox"],w="Unknown";let x=window.navigator.userAgentData,y=window.navigator.userAgent;const S={iphone:/iphone/,ipad:/ipad|macintosh/,android:/android/},P={windows:/win/,mac:/macintosh/,linux:/linux/},_=function(){if(y){const t=y.toLowerCase().replace(b,""),s=Object.keys(S).find(s=>S[s].test(t)&&window.navigator.maxTouchPoints>=1),i=Object.keys(P).find(s=>P[s].test(t)),e=s||i,o=t.match(f),h=/version\/(\d+(\.\d+)*)/,r=t.match(h),n=Array.isArray(r)?r[1]:null,a=o&&(o.length>2&&!m.test(o[1])?1:0),l=o&&o[o.length-1-(a||0)].split("/");return{os:e,browser:l&&l[0],version:n||l&&l[1]}}if(x){const t=x.platform.toLowerCase();let s;for(const t of x.brands){const i=t.brand.toLowerCase(),e=v.find(t=>{if(i.includes(t))return t});if(e){s={browser:e,version:t.version};break}}return{os:t,...s||{browser:w,version:w}}}return console.error("Could not find `userAgent` or `userAgentData` window.navigator properties to set `os`, `browser` and `version`"),{os:navigator.platform||w,browser:w,version:w}}(),C={mass:1,naturalFrequency:7,dampingRatio:.65},M={mass:1,naturalFrequency:4.5,dampingRatio:.65},k={mass:1,naturalFrequency:2,dampingRatio:1},E={mass:1,naturalFrequency:2,dampingRatio:1};class R{containerEl;slideEls=[];height;gap;borderRadius;applyBorderRadiusToContainer;snapToSlide;bindToScrollPos;resizeObserver;onSlideChange;onReachEnd;startIndex=0;t=0;i=0;o=[];h;l;u;p;m;v;S;P;_;C;M=0;k;R;T;$;I;A;L;B;F;j;O;G;q;D=0;H;atEnd;anchorSlide;constructor({onSlideChange:t,onReachEnd:s}){this.l=[],this.h=new Map,this.u=!1,this.p=0,this.m=!1,this.v=!1,this.S=0,this.P=0,this._=0,this.anchorSlide=0,this.C=0,this.k={start:0,previous:0},this.R=[],this.T=15,this.$=0,this.B=1/60,this.F=3,this.borderRadius=20,this.applyBorderRadiusToContainer=!1,this.gap=20,this.height=300,this.snapToSlide=!1,this.bindToScrollPos=!1,this.atEnd=!1,this.I=40,this.A=0,this.L=0,this.j=window.innerHeight,this.G=0,this.q=()=>{},this.onSlideChange=t,this.onReachEnd=s,this.resizeObserver=new ResizeObserver(t=>this.handleResize(t)),this.handlePointerdown=this.handlePointerdown.bind(this),this.handlePointermove=this.handlePointermove.bind(this),this.handlePointerup=this.handlePointerup.bind(this),this.handleVirtObserver=this.handleVirtObserver.bind(this)}init({containerEl:s,slideEls:i,height:e=300,gap:o=20,borderRadius:h=40,applyBorderRadiusToContainer:r=!0,snapToSlide:n=!1,bindToScrollPos:a=!1,startIndex:l=0}){this.startIndex=l,this.containerEl=s,this.slideEls=i.map(s=>t({classes:"ec-slide",contents:s,style:{backgroundColor:s.backgroundColor}})),this.o=i,this.t=s.offsetWidth,this.i=s?.scrollWidth||0,this.M=this.t-this.i,this.u=!1,this.p=0,this.H=new IntersectionObserver(this.handleVirtObserver,{root:this.containerEl,rootMargin:`0px ${this.t/4}px 0px ${this.t}px`}),this.updateSettings({height:e,gap:o,borderRadius:h,applyBorderRadiusToContainer:r,snapToSlide:n,bindToScrollPos:a}),this.addEventListeners(),this.containerEl.style.setProperty("--ec-container-width",`${this.t}px`),this.t<600&&(this.T=12),l>0&&(this.containerEl.style.opacity="0"),this.containerEl.replaceChildren(...this.slideEls),this.updateDimensions(),this.u=!0,this.loop(performance.now())}handleVirtObserver(t){t.forEach(t=>{const s=t.target,i=this.slideEls.indexOf(s);this.setVirtualization(s,i,t.isIntersecting)})}updateSettings({height:t=300,gap:s=20,borderRadius:i=40,applyBorderRadiusToContainer:e=!0,snapToSlide:o=!1,bindToScrollPos:h=!1}){cancelAnimationFrame(this.D),this.D=requestAnimationFrame(()=>{this.height=t,this.gap=s,this.borderRadius=Math.min(i/100*this.height,.45*this.t*.5),this.I=Math.max(this.borderRadius,40),this.applyBorderRadiusToContainer=e,this.snapToSlide=o,this.bindToScrollPos=h,this.containerEl?.style.setProperty("--ec-height",`${this.height}px`),this.containerEl?.style.setProperty("--ec-border-radius",this.applyBorderRadiusToContainer?`${this.borderRadius}px`:"0px"),this.snapToSlide&&(this.C=-this.getClosestSlideToPoint(this.C).leftEdge)})}destroy(){this.u=!1,cancelAnimationFrame(this.D),this.removeEventListeners(),this.slideEls?.length&&this.slideEls.forEach(t=>{t.remove()}),this.slideEls=[],this.containerEl=void 0}handleResize(t){let s=null;t&&t.forEach(t=>{t.target===this.containerEl&&(s=t.borderBoxSize?t.borderBoxSize[0].inlineSize:t.contentRect.width)}),this.updateDimensions(s)}addEventListeners(){this.removeEventListeners(),this.slideEls.length&&this.slideEls.forEach(t=>{this.resizeObserver.observe(t),this.H?.observe(t)}),this.containerEl&&(this.resizeObserver.observe(this.containerEl),this.containerEl.addEventListener("pointerdown",this.handlePointerdown),document.addEventListener("pointermove",this.handlePointermove,{passive:!0}),document.addEventListener("pointerup",this.handlePointerup),document.body.addEventListener("pointerleave",this.handlePointerup))}removeEventListeners(){this.resizeObserver.disconnect(),this.containerEl&&(this.containerEl.removeEventListener("pointerdown",this.handlePointerdown),document.removeEventListener("pointermove",this.handlePointermove),document.removeEventListener("pointerup",this.handlePointerup))}handlePointerdown(t){this.m=!0,this.P=this._,this.C=this._,this.k.start=t.clientX,this.k.previous=t.clientX,this.updateDimensions()}handlePointermove(t){if(!this.m)return;const i=t.clientX-this.k.start;Math.abs(i)>10&&this.containerEl?.classList.add("ec-is-dragging"),this.C=this.P+i,s(this.R,t.clientX-this.k.previous,10),this.k.previous=t.clientX}handlePointerup(){var t;this.containerEl?.classList.remove("ec-is-dragging"),this.m=!1,this.C+=((t=this.R).length?t.reduce((t,s)=>t+s,0)/t.length:0)*this.T}updateDimensions(t){this.t=t||this.containerEl?.offsetWidth||0;let s=0;this.l=this.slideEls.map((t,i)=>{let e=t.offsetWidth,o=s;return s+=e,i<this.l.length-1&&(s+=this.gap),{width:e,x:o}}),this.i=s,this.M=this.t-this.i,this.containerEl?.style.setProperty("--ec-container-width",`${this.t}px`),this.t<600?this.T=12:this.T=15}isAtBoundary(){return this.C>0||this.C<this.t-this.i}getPhysicsConfig(){return this.m?C:this.v?M:this.isAtBoundary()?k:E}updatePosition(){if(!this.m)if(this.C>0)this.C-=.25*this.C;else if(this.C<this.M){const t=this.C-this.M;this.C-=.25*t}const t=this.B,s=this._-this.C,i=Math.abs(s)<.01&&Math.abs(this.S)<.01;if(!this.m&&i)return this._=this.C,void(this.S=0);const e=this.getPhysicsConfig(),{mass:o,naturalFrequency:h,dampingRatio:r}=e,n=o*(2*h*Math.PI)**2,a=(-n*s+-2*r*Math.sqrt(n*o)*this.S)/o;this.S+=a*t,this._+=this.S*t}getClosestSlideToPoint(t){return this.l.reduce((s,i,e)=>{const o=Math.abs(s.cumulativeWidth+t),h=i?.width??0;return o<s.distanceFromTarget?{index:e,distanceFromTarget:o,leftEdge:s.cumulativeWidth,cumulativeWidth:s.cumulativeWidth+h+this.gap}:{...s,cumulativeWidth:s.cumulativeWidth+h+this.gap}},{index:0,distanceFromTarget:1/0,leftEdge:0,cumulativeWidth:0})}updateScrollPos(){this.containerEl&&(this.q(),this.i,this.q=i(this.containerEl,t=>{this.t=t.width,this.M=this.t-this.i;const s=Math.max(Math.min((this.j-t.top)/(this.j+t.height),1),0);if(s!==this.G){this.v=!0;const t=this.G-s,i=this.j*t*.5;this.C+=i,this.C=Math.max(Math.min(0,this.C),this.t-this.i),this.G=s}this.O=t}))}getSlidePositions(){const t=this._;let s=t,i=!1;const e=this.slideEls.filter((t,s)=>this.l[s]?.width).map((e,o)=>{const h=this.o[o],r=this.l[o].width;o>0&&this.l[o-1]?.width&&(s+=this.l[o-1].width+this.gap);let n=0,a=0,l=0,c=0,d=Math.min(r*this.F,this.t);const u=this.l[o];u&&u.x+u.width*this.F>this.i&&(d=r*(this.slideEls.length-o)+Math.round(this.A*this.F));let p=Math.min(Math.max(d-Math.max(this.t-s+Math.round(this.A*this.F),0),0)/(d-this.I),1);const g=(r-this.I)*p;if(l=g,n=-g/2,c-=g,s<this.t&&s+r-l+this.gap>=this.t&&t<=0){const t=r-a-l,e=this.I-(this.t-s)<=0?t:this.t-s,h=this.t-(s+e);h>0&&!this.A&&(this.A=h,this.L=o+1,i=!0),e<this.I/2&&!this.A&&(this.A=e+this.gap,this.L=o+1,i=!0)}Math.round(s-this.gap)<=0&&Math.round(r+s)>0&&(o!==this.anchorSlide&&this.onSlideChange&&this.onSlideChange(o),this.anchorSlide=o),s<=0&&(a=Math.min(Math.abs(s),r-this.I),n=s/-2);const b={el:e,contentEl:h,xPos:s,rightClipInset:l,leftClipInset:a,innerTranslate:n};return s+=c,b});return i?this.getSlidePositions():e}setVirtualization(t,s,i=!0){if(i){if(t.childElementCount>0)return;const s=this.h.get(t);s&&(t.replaceChildren(s),this.h.delete(t),t.style.width="")}else{if(!t.firstElementChild||!this.l[s])return;const i=t.firstElementChild;t.style.width=`${this.l[s].width}px`,t.style.backgroundColor=i.backgroundColor,this.h.set(t,t.removeChild(t.firstElementChild))}}positionSlides(){this.getSlidePositions().filter((t,s)=>this.l[s]?.width).forEach(({el:t,contentEl:s,xPos:i,rightClipInset:e,leftClipInset:o,innerTranslate:h},r)=>{const n=this.l[r].width-e-o,a=Math.min(this.borderRadius,n/2);t?.style.setProperty("--transform",`translate3d(${i}px, 0 ,0)`),this.h.has(t)||(t?.style.setProperty("--clip",`inset(0 ${e}px 0 ${o}px round ${a}px)`),s?.style.setProperty("--content-transform",`translate3d(${h}px, 0, 0)`))})}goToSlide(t,s=!0){t=Math.max(Math.min(t,this.slideEls.length-1),0),this.updateDimensions(),t===this.l.length-1?this.C=this.M:(this.C=this.l[t]?.x||0===this.l[t]?.x?-this.l[t].x:this.C,this.C=Math.max(this.C,this.M)),s||(this._=this.C)}advance(){this.goToSlide(Math.min(this.getClosestSlideToPoint(this.C).index+1,this.slideEls.length-1))}retreat(){this.goToSlide(Math.max(this.getClosestSlideToPoint(this.C).index-1,0))}render(){if(this.R.shift(),!this.slideEls)return;this.bindToScrollPos&&this.updateScrollPos();const t=this.getClosestSlideToPoint(this.M),s=this.C+t.leftEdge<=0;if(this.snapToSlide&&!this.m&&!this.isAtBoundary()&&!s){const t=this.getClosestSlideToPoint(this.C);this.C=-t.leftEdge}this.atEnd=t.cumulativeWidth+this.C-this.t-this.gap<=0,this.atEnd&&this.onReachEnd?this.onReachEnd(!0):this.onReachEnd&&this.onReachEnd(!1),this.updatePosition(),this.positionSlides(),this.v=!1,this.startIndex>0&&(this.p<4&&(1==this.p&&this.goToSlide(this.startIndex,!1),3==this.p&&this.containerEl?.style.setProperty("opacity","")),this.p++)}loop(t){if(!this.u)return;const s="safari"===_.browser?8:12;t-this.$>s&&(this.render(),this.$=t),requestAnimationFrame(t=>this.loop(t))}}class T extends n{label="ElasticCarousel";widgetSettings;feedMetadata;posts;previewLoadingColors;startIndex=0;containerEl;headerEl;innerEl;footerEl;instagramLogoEl;labelEl;leftArrowEl;rightArrowEl;slidesContainerEl;postEls=[];popoverGalleryEl;langDirection="ltr";appliedBreakpoint;medianPaletteHSL;gyre;constructor(){super(),this.onPropChange(this.W,["widgetSettings","feedMetadata","posts","previewLoadingColors","startIndex"],["widgetSettings","feedMetadata","posts"],this.setup),a.register(),l.register(),c.register(),this.gyre=new R({onSlideChange:t=>this.V(t),onReachEnd:t=>this.J(t)}),this.U=this.U.bind(this),this.N=this.N.bind(this),this.addEventListener("post-focus-next",this.K),this.addEventListener("post-focus-previous",this.X),this.onConnect(()=>{e("elasticCarousel: onConnect"),this.N(),this.containerEl||(this.slidesContainerEl=t({classes:"ec-slides"}),this.headerEl=t({type:"header",classes:"ec-header",attributes:{dir:"ltr"}}),this.innerEl=t({classes:"ec-inner",contents:[this.slidesContainerEl]}),this.footerEl=t({type:"footer",classes:"ec-footer",attributes:{dir:"ltr"}}),this.labelEl=t({classes:"ec-label",attributes:{dir:this.langDirection??"ltr"}}),this.leftArrowEl=t({type:"button",classes:"ec-button ec-retreat",contents:[p],listeners:{click:()=>this.Y()},attributes:{tabindex:-1,disabled:!0,"aria-hidden":!0}}),this.rightArrowEl=t({type:"button",classes:"ec-button ec-advance",contents:[g],listeners:{click:()=>this.Z()},attributes:{tabindex:-1,"aria-hidden":!0}}),this.containerEl=t({type:"figure",classes:"ec-carousel",contents:[this.innerEl]})),this.renderWidget(this.containerEl,[d,'.ec-carousel{--ec-controls-margin:20px;--ec-button-border-radius:40%;--ec-icon-color:#4a4a4a;--ec-text-color:#4a4a4a;--ec-button-color:#f4f4f4;--ec-button-hover-color:#ececec;--ec-button-icon-color:#4a4a4a;--ec-button-icon-hover-color:#2e2e2e;--ec-button-gap:min(calc(var(--ec-controls-margin)/2),5px);flex-direction:column;height:var(--ec-height);margin:0;overflow:hidden;width:100%}.ec-carousel,.ec-inner{display:flex;justify-content:center}.ec-inner{align-items:center}.ec-slides{border-radius:var(--ec-border-radius);cursor:grab;height:var(--ec-height);justify-content:flex-start;overflow:hidden;position:relative;touch-action:pan-y;width:100%}.ec-slide,.ec-slides{display:flex;isolation:isolate}.ec-slide{clip-path:var(--clip);flex-shrink:0;height:100%;left:0;max-width:calc(var(--ec-container-width)*.45);position:absolute;top:0;transform:var(--transform);-moz-user-select:none;user-select:none;-webkit-user-select:none;will-change:clip-path,transform}.ec-slide behold-album-post,.ec-slide behold-image-post,.ec-slide behold-video-post{transform:var(--content-transform)}.ec-slide .post--placeholder{aspect-ratio:unset;height:100%}.ec-is-dragging{cursor:grabbing}.ec-is-dragging .ec-slide{pointer-events:none}.ec-footer,.ec-header{display:flex;justify-content:center}.ec-carousel--controls-sides .ec-footer,.ec-carousel--controls-sides .ec-header{padding:0 64px;padding-inline:64px}.ec-header{margin-bottom:var(--ec-controls-margin)}.ec-footer{margin-top:var(--ec-controls-margin)}.ec-label{align-items:center;display:flex;flex-shrink:1;gap:7px 5px;line-height:1.2;min-width:0;overflow:hidden;text-overflow:ellipsis;-moz-user-select:none;user-select:none;-webkit-user-select:none}.ec-carousel--controls-center .ec-button+.ec-label,.ec-carousel--controls-split .ec-button+.ec-label{margin:0 max(calc(var(--ec-controls-margin)*1.5),20px)}.ec-carousel--label-right .ec-label{margin-left:auto}.ec-carousel--label-left .ec-label{margin-right:auto}.ec-label svg{flex-shrink:0;height:24px;margin-right:5px;width:24px}.ec-label svg path{fill:var(--behold-icon-color,var(--ec-icon-color))}.ec-label a,.ec-label div{color:var(--behold-text-color,var(--ec-text-color));display:inline-block;font-family:inherit;font-size:19px;overflow:hidden;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}.ec-button,.ec-carousel--controls-center .ec-footer,.ec-carousel--controls-center .ec-header{justify-content:center}.ec-button{align-items:center;background-color:transparent;border:none;cursor:pointer;display:flex;flex-shrink:0;height:44px;padding:0;touch-action:manipulation;transition:all .3s ease;width:44px}.ec-carousel--controls-sides .ec-button{height:var(--ec-height);width:64px}.ec-button:disabled{cursor:default;opacity:.5}.ec-button:before{background-color:var(--behold-button-color,var(--ec-button-color));border-radius:var(--ec-button-border-radius);content:"";height:44px;position:absolute;transition:all .3s ease;width:44px}.ec-button:not(:disabled):hover:before{background-color:var(\n --behold-button-hover-color,var(--ec-button-hover-color)\n )}.ec-button svg{height:14px;position:relative;width:auto;z-index:1}.ec-button svg path{fill:var(--behold-button-icon-color,var(--ec-button-icon-color));transition:all .3s ease}.ec-button:not(:disabled):hover svg path{fill:var(\n --behold-button-icon-hover-color,var(--ec-button-icon-hover-color)\n )}.ec-retreat{padding-right:var(--ec-button-gap);width:calc(44px + var(--ec-button-gap))}.ec-retreat:dir(rtl){padding-right:0;padding-inline-end:var(--ec-button-gap)}.ec-carousel--controls-split .ec-retreat{margin-right:auto}.ec-carousel--controls-split .ec-retreat:dir(rtl){margin-right:0;margin-inline-end:auto}.ec-carousel--controls-right .ec-retreat{margin-left:auto}.ec-carousel--controls-right .ec-retreat:dir(rtl){margin-left:0;margin-inline-start:auto}.ec-advance{padding-left:var(--ec-button-gap);width:calc(44px + var(--ec-button-gap))}.ec-advance:dir(rtl){padding-left:0;padding-inline-start:var(--ec-button-gap)}.ec-carousel--controls-split .ec-advance{margin-left:auto}.ec-carousel--controls-split .ec-advance:dir(rtl){margin-left:0;margin-inline-start:auto}.ec-carousel--controls-left .ec-advance{margin-right:auto;margin-inline-end:auto}.ec-carousel--controls-left .ec-advance:dir(rtl){margin-right:0;margin-inline-end:auto}.ec-carousel--controls-sides .ec-retreat{padding-right:20px}.ec-carousel--controls-sides .ec-advance{padding-left:20px}.post{height:100%;max-width:calc(var(--ec-container-width)*.45)}.post a{-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.post--placeholder{background-color:#dedede;height:0;min-height:100%;padding-bottom:calc(100%/var(--post-aspect-ratio))}']),this.setAttribute("tabindex","0"),this.setAttribute("aria-label","Gallery of Instagram posts. Shift + arrow keys to navigate"),this.onResize(this,this,this.tt)})}setup(){if(e("elasticCarousel: setup"),!this.widgetSettings||!this.containerEl)return;if("transparent"!==this.widgetSettings.loadingColor&&this.posts){const t=this.posts.filter(t=>t.colorPalette).map(t=>t.colorPalette);this.medianPaletteHSL=this.widgetSettings?.loadingColor?u(t,this.widgetSettings.loadingColor):["0","0","0"]}const t=this.getMatchingBreakpoint(this.offsetWidth,this.widgetSettings.breakpoints);this.renderBreakpoint(t),o(this.containerEl,{"--ec-icon-color":this.widgetSettings.iconColor,"--ec-text-color":this.widgetSettings.textColor,"--ec-button-color":this.widgetSettings.buttonColor,"--ec-button-hover-color":this.widgetSettings.buttonHoverColor,"--ec-button-icon-color":this.widgetSettings.buttonIconColor,"--ec-button-icon-hover-color":this.widgetSettings.buttonIconHoverColor}),this.postEls&&this.postEls.forEach(t=>{t.widgetSettings=this.widgetSettings,t.feedMetadata=this.feedMetadata}),this.st(),"openPopupGallery"===this.widgetSettings.onPostClick&&this.enablePopoverGallery(),this.previewLoadingColors&&this.postEls&&(this.postEls.forEach(t=>{t.previewLoadingColors=this.previewLoadingColors}),h(this,{"is-previewing-loading-colors":!!this.previewLoadingColors}))}N(){const t=getComputedStyle(document.body);this.langDirection=t.direction}st(){if(e("elasticCarousel: buildLabel"),!this.widgetSettings)return;const s=document.createElement("template");s.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><path d="M295.42,6c-53.2,2.51-89.53,11-121.29,23.48-32.87,12.81-60.73,30-88.45,57.82S40.89,143,28.17,175.92c-12.31,31.83-20.65,68.19-23,121.42S2.3,367.68,2.56,503.46,3.42,656.26,6,709.6c2.54,53.19,11,89.51,23.48,121.28,12.83,32.87,30,60.72,57.83,88.45S143,964.09,176,976.83c31.8,12.29,68.17,20.67,121.39,23s70.35,2.87,206.09,2.61,152.83-.86,206.16-3.39S799.1,988,830.88,975.58c32.87-12.86,60.74-30,88.45-57.84S964.1,862,976.81,829.06c12.32-31.8,20.69-68.17,23-121.35,2.33-53.37,2.88-70.41,2.62-206.17s-.87-152.78-3.4-206.1-11-89.53-23.47-121.32c-12.85-32.87-30-60.7-57.82-88.45S862,40.87,829.07,28.19c-31.82-12.31-68.17-20.7-121.39-23S637.33,2.3,501.54,2.56,348.75,3.4,295.42,6m5.84,903.88c-48.75-2.12-75.22-10.22-92.86-17-23.36-9-40-19.88-57.58-37.29s-28.38-34.11-37.5-57.42c-6.85-17.64-15.1-44.08-17.38-92.83-2.48-52.69-3-68.51-3.29-202s.22-149.29,2.53-202c2.08-48.71,10.23-75.21,17-92.84,9-23.39,19.84-40,37.29-57.57s34.1-28.39,57.43-37.51c17.62-6.88,44.06-15.06,92.79-17.38,52.73-2.5,68.53-3,202-3.29s149.31.21,202.06,2.53c48.71,2.12,75.22,10.19,92.83,17,23.37,9,40,19.81,57.57,37.29s28.4,34.07,37.52,57.45c6.89,17.57,15.07,44,17.37,92.76,2.51,52.73,3.08,68.54,3.32,202s-.23,149.31-2.54,202c-2.13,48.75-10.21,75.23-17,92.89-9,23.35-19.85,40-37.31,57.56s-34.09,28.38-57.43,37.5c-17.6,6.87-44.07,15.07-92.76,17.39-52.73,2.48-68.53,3-202.05,3.29s-149.27-.25-202-2.53m407.6-674.61a60,60,0,1,0,59.88-60.1,60,60,0,0,0-59.88,60.1M245.77,503c.28,141.8,115.44,256.49,257.21,256.22S759.52,643.8,759.25,502,643.79,245.48,502,245.76,245.5,361.22,245.77,503m90.06-.18a166.67,166.67,0,1,1,167,166.34,166.65,166.65,0,0,1-167-166.34" transform="translate(-2.5 -2.5)"/><title>Instagram</title></svg>';let i=`https://instagram.com/${this.feedMetadata?.username??""}`;if(this.widgetSettings.labelLink?.length&&(i=this.widgetSettings.labelLink),this.widgetSettings.labelLink?.length||this.widgetSettings.label?.length){const e=t({type:"a",contents:this.widgetSettings.label?.length?this.widgetSettings.label:this.feedMetadata?.username,attributes:{href:i,target:"_blank"}});this.labelEl?.replaceChildren(s.content,e)}else if(this.feedMetadata?.hashtags?.length){const i=this.feedMetadata.hashtags.map((s,i,e)=>t({type:"a",contents:["#",s,i<e.length-1?", ":""],attributes:{target:"_blank",href:`https://instagram.com/explore/tags/${s}`}}));this.labelEl?.replaceChildren(s.content,...i)}else{const e=t({type:"a",contents:[this.feedMetadata?.username??""],attributes:{target:"_blank",href:i}});this.labelEl?.replaceChildren(s.content,e)}}V(t){0===t&&this.leftArrowEl?this.leftArrowEl.disabled=!0:this.leftArrowEl&&(this.leftArrowEl.disabled=!1),this.gyre.atEnd&&this.rightArrowEl?this.rightArrowEl.disabled=!0:this.rightArrowEl&&(this.rightArrowEl.disabled=!1),this.dispatchEvent(new CustomEvent("slide-change",{bubbles:!0,composed:!0,detail:{index:t,currentPost:this.posts?.[t??0]}}))}J(t){t&&this.rightArrowEl?this.rightArrowEl.disabled=!0:this.rightArrowEl&&(this.rightArrowEl.disabled=!1)}W({changedProp:t,oldValue:s,newValue:i}){switch(t){case"posts":this.it();break;case"widgetSettings":this.et(s,i);break;case"feedMetadata":this.ot();break;case"previewLoadingColors":this.postEls?.forEach(t=>{t.previewLoadingColors=this.previewLoadingColors}),h(this,{"is-previewing-loading-colors":!!this.previewLoadingColors})}}it(){this.postEls=[],this.widgetSettings?.breakpoints&&this.renderBreakpoint(this.getMatchingBreakpoint(this.offsetWidth,this.widgetSettings.breakpoints),!0),this.postEls.forEach(t=>{t.widgetSettings=this.widgetSettings,t.feedMetadata=this.feedMetadata}),this.popoverGalleryEl&&this.posts&&(this.popoverGalleryEl.posts=this.posts)}et(t,s){let i=!1;if(!s)return;!t||this.postEls?.length&&!r(t.breakpoints,s.breakpoints,["postHeight"],1)||(i=!0),o(this.containerEl,{"--ec-icon-color":s.iconColor,"--ec-text-color":s.textColor,"--ec-button-color":s.buttonColor,"--ec-button-hover-color":s.buttonHoverColor,"--ec-button-icon-color":s.buttonIconColor,"--ec-button-icon-hover-color":s.buttonIconHoverColor}),r(t,s,["label","labelLink"])&&this.st(),"openPopupGallery"!==t?.onPostClick&&"openPopupGallery"===s?.onPostClick&&this.enablePopoverGallery();const e=this.getMatchingBreakpoint(this.offsetWidth,s.breakpoints);this.renderBreakpoint(e,i),this.postEls?.forEach(t=>{t.widgetSettings=s}),this.popoverGalleryEl&&(this.popoverGalleryEl.widgetSettings=s)}ot(){let t=`from @${this.feedMetadata?.username}`;this.feedMetadata?.hashtags?.length&&(t=`from hashtag${this.feedMetadata.hashtags.length>1?"s":""} ${this.feedMetadata.hashtags.join(", ")}`),this.setAttribute("aria-label",`Gallery of Instagram posts ${t}. Shift + arrow keys to navigate`),this.postEls?.forEach(t=>{t.feedMetadata=this.feedMetadata}),this.popoverGalleryEl&&this.feedMetadata&&(this.popoverGalleryEl.feedMetadata=this.feedMetadata)}async enablePopoverGallery(){if(this.popoverGalleryEl)return;const{default:t}=await import("./PopoverGallery-Bj9OSwwT.js");t.register(),this.popoverGalleryEl=document.createElement("behold-popover-gallery"),Object.assign(this.popoverGalleryEl,{widgetSettings:this.widgetSettings,feedMetadata:this.feedMetadata,posts:this.posts,closeFocusEl:this,onSlideChange:t=>{"number"==typeof t&&(this.gyre.goToSlide(t),this.popoverGalleryEl?.closeFocusEl&&(this.popoverGalleryEl.closeFocusEl=this.postEls?.[t]))}})}tt(t){const s=t.contentBoxSize?.[0]?.inlineSize,i=this.widgetSettings?.breakpoints;if(!i)return;const e=this.getMatchingBreakpoint(s,i);this.renderBreakpoint(e)}X(){if(!this.postEls?.length)return;let t=[...this.postEls].indexOf(this.shadow.activeElement?.parentElement);t>0&&(t-=1),this.postEls[t].focus(),this.gyre.goToSlide(t)}K(){if(!this.postEls?.length)return;let t=[...this.postEls].indexOf(this.shadow.activeElement?.parentElement);this.gyre.anchorSlide>0&&t<this.gyre.anchorSlide&&(t=this.gyre.anchorSlide),t>-1&&t<this.postEls.length-1&&(t+=1),t<0&&(t=0),this.postEls[t].focus(),this.gyre.goToSlide(t)}U(t){this.popoverGalleryEl?.open(this.postEls.indexOf(t)??0,t)}Z(){this.gyre&&this.gyre.advance()}Y(){this.gyre&&this.gyre.retreat()}renderPosts(t){this.postEls=this.createPostEls(t),e("elasticCarousel: renderPosts"),this.raf(()=>{this.slidesContainerEl&&(this.gyre.destroy(),this.gyre.init({containerEl:this.slidesContainerEl,slideEls:this.postEls,height:t.postHeight,gap:t.gap.x,borderRadius:t.borderRadius,applyBorderRadiusToContainer:t.applyBorderRadiusToContainer||!0,snapToSlide:t.snapToSlide||!1,bindToScrollPos:t.bindToScrollPos||!1,startIndex:this.startIndex}))},"renderPosts")}getMatchingBreakpoint(t,s){e("elasticCarousel: getMatchingBreakpoint");const i=Object.entries(s).map(([t,s])=>({...s,width:t})).filter(t=>"default"!==t.width).sort((t,s)=>parseInt(s.width)-parseInt(t.width)).reduce((s,i)=>t<=parseInt(i.width)?i:s,s.default);return{...s.default,...i}}renderBreakpoint(t,s=!1){if(!this.posts||!this.containerEl)return;e("elasticCarousel: renderBreakpoint"),this.N();const i=this.appliedBreakpoint,{showControls:n,controlsPosition:a,controlsJustification:l,showLabel:c,labelPosition:d,labelJustification:u,buttonBorderRadius:p,controlsMargin:g,postHeight:b}=t;if(this.postEls?.length&&!r(i,t,["numPosts","forcePostAspectRatio","postAspectRatio","postHeight"])||(s=!0),b&&this.slidesContainerEl?.style.setProperty("--ec-height",`${b}px`),this.widgetSettings?.maxWidth&&this.widgetSettings.constrainWidth&&this.containerEl.style.maxWidth!==`${this.widgetSettings.maxWidth}px`&&(this.containerEl.style.maxWidth=`${this.widgetSettings.maxWidth}px`),this.widgetSettings?.constrainWidth||(this.containerEl.style.maxWidth=""),this.leftArrowEl?.remove(),this.rightArrowEl?.remove(),r(i,t,["showControls","controlsPosition","controlsJustification","showLabel","labelPosition","labelJustification"])||n&&!this.leftArrowEl?.isConnected||c&&!this.labelEl?.isConnected){this.leftArrowEl?.remove(),this.rightArrowEl?.remove(),this.labelEl?.remove(),this.headerEl?.remove(),this.footerEl?.remove(),o(this.containerEl,{"--ec-button-border-radius":`${p}%`,"--ec-controls-margin":`${g}px`}),h(this.containerEl,{"ec-carousel--controls-sides":"sides"===a,"ec-carousel--controls-left":"left"===l,"ec-carousel--controls-right":"right"===l,"ec-carousel--controls-center":"center"===l,"ec-carousel--controls-split":"split"===l,"ec-carousel--label-left":"left"===u,"ec-carousel--label-right":"right"===u,"ec-carousel--label-center":"left"===u}),c&&this.labelEl&&("top"===d&&this.headerEl?.append(this.labelEl),"bottom"===d&&this.footerEl?.append(this.labelEl));let t=this.innerEl;if("top"===a&&(t=this.headerEl),"bottom"===a&&(t=this.footerEl),n&&"sides"===a&&t&&this.leftArrowEl&&this.rightArrowEl)"rtl"===this.langDirection?(t.append(this.leftArrowEl),t.prepend(this.rightArrowEl)):(t.prepend(this.leftArrowEl),t.append(this.rightArrowEl));else if(n&&t&&this.leftArrowEl&&this.rightArrowEl)switch(l){case"left":t.prepend(this.rightArrowEl),t.prepend(this.leftArrowEl);break;case"right":t.append(this.leftArrowEl),t.append(this.rightArrowEl);break;default:t.prepend(this.leftArrowEl),t.append(this.rightArrowEl)}this.headerEl?.childElementCount&&this.containerEl.prepend(this.headerEl),this.footerEl?.childElementCount&&this.containerEl.append(this.footerEl)}this.widgetSettings&&this.containerEl.setAttribute("data-hover-effect",this.widgetSettings.hoverEffect),s?this.renderPosts(t):this.gyre.updateSettings({height:t.postHeight,gap:t.gap.x,borderRadius:t.borderRadius,applyBorderRadiusToContainer:t.applyBorderRadiusToContainer,snapToSlide:t.snapToSlide,bindToScrollPos:t.bindToScrollPos}),this.appliedBreakpoint=t}createPostEls(s){e("elasticCarousel: createPostEls");const{numPosts:i,postHeight:o,postAspectRatio:h,forcePostAspectRatio:r}=s,n=this.posts?.filter((t,i)=>i<(s?.numPosts||this.posts?.length||12)),a=n?.map((s,e)=>{const a=[s.sizes.full.width,s.sizes.full.height],l=r?h||[1,1]:a,c=l.reduce((t,s)=>t/s);let d="behold-image-post";return"VIDEO"===s.mediaType&&(d="behold-video-post"),"CAROUSEL_ALBUM"===s.mediaType&&(d="behold-album-post"),t({type:d,props:{post:s,widgetSettings:this.widgetSettings,feedMetadata:this.feedMetadata,medianPaletteHSL:this.medianPaletteHSL,onClick:this.U,hasRowGap:!0,isLastRow:!1,index:e,aspectRatio:l,totalPosts:n?.length||i||this.posts?.length||0},style:{width:o*c+"px","--post-aspect-ratio":c}})});if(!a)return[];for(;a.length<s.numPosts;){const s=t({classes:"post post--placeholder",style:{width:`${o}px`,"--post-aspect-ratio":1}});a.push(s)}return a}static register(t="behold-elastic-carousel"){return customElements.get(t)||customElements.define(t,T),t}}export{T as default};
1
+ import{c as t,m as s,g as i,d as e,n as o,s as h,j as r}from"./index-DlG54u5e.js";import{B as n,a,b as l,A as c,c as d,g as u}from"./base-COwgdJg5.js";import{c as p,a as g}from"./caret-right-CSBbJCRm.js";const b=/^mozilla\/\d\.\d\W/,f=/(\w+)\/(\d+\.\d+(?:\.\d+)?(?:\.\d+)?)/g,m=/^(ver|cri|gec)/,v=["chrome","opera","safari","edge","firefox"],w="Unknown";let x=window.navigator.userAgentData,y=window.navigator.userAgent;const S={iphone:/iphone/,ipad:/ipad|macintosh/,android:/android/},P={windows:/win/,mac:/macintosh/,linux:/linux/},_=function(){if(y){const t=y.toLowerCase().replace(b,""),s=Object.keys(S).find(s=>S[s].test(t)&&window.navigator.maxTouchPoints>=1),i=Object.keys(P).find(s=>P[s].test(t)),e=s||i,o=t.match(f),h=/version\/(\d+(\.\d+)*)/,r=t.match(h),n=Array.isArray(r)?r[1]:null,a=o&&(o.length>2&&!m.test(o[1])?1:0),l=o&&o[o.length-1-(a||0)].split("/");return{os:e,browser:l&&l[0],version:n||l&&l[1]}}if(x){const t=x.platform.toLowerCase();let s;for(const t of x.brands){const i=t.brand.toLowerCase(),e=v.find(t=>{if(i.includes(t))return t});if(e){s={browser:e,version:t.version};break}}return{os:t,...s||{browser:w,version:w}}}return console.error("Could not find `userAgent` or `userAgentData` window.navigator properties to set `os`, `browser` and `version`"),{os:navigator.platform||w,browser:w,version:w}}(),C={mass:1,naturalFrequency:7,dampingRatio:.65},M={mass:1,naturalFrequency:4.5,dampingRatio:.65},k={mass:1,naturalFrequency:2,dampingRatio:1},E={mass:1,naturalFrequency:2,dampingRatio:1};class R{containerEl;slideEls=[];height;gap;borderRadius;applyBorderRadiusToContainer;snapToSlide;bindToScrollPos;resizeObserver;onSlideChange;onReachEnd;startIndex=0;t=0;i=0;o=[];h;l;u;p;m;v;S;P;_;C;M=0;k;R;T;$;I;A;L;B;F;j;O;G;q;D=0;H;atEnd;anchorSlide;constructor({onSlideChange:t,onReachEnd:s}){this.l=[],this.h=new Map,this.u=!1,this.p=0,this.m=!1,this.v=!1,this.S=0,this.P=0,this._=0,this.anchorSlide=0,this.C=0,this.k={start:0,previous:0},this.R=[],this.T=15,this.$=0,this.B=1/60,this.F=3,this.borderRadius=20,this.applyBorderRadiusToContainer=!1,this.gap=20,this.height=300,this.snapToSlide=!1,this.bindToScrollPos=!1,this.atEnd=!1,this.I=40,this.A=0,this.L=0,this.j=window.innerHeight,this.G=0,this.q=()=>{},this.onSlideChange=t,this.onReachEnd=s,this.resizeObserver=new ResizeObserver(t=>this.handleResize(t)),this.handlePointerdown=this.handlePointerdown.bind(this),this.handlePointermove=this.handlePointermove.bind(this),this.handlePointerup=this.handlePointerup.bind(this),this.handleVirtObserver=this.handleVirtObserver.bind(this)}init({containerEl:s,slideEls:i,height:e=300,gap:o=20,borderRadius:h=40,applyBorderRadiusToContainer:r=!0,snapToSlide:n=!1,bindToScrollPos:a=!1,startIndex:l=0}){this.startIndex=l,this.containerEl=s,this.slideEls=i.map(s=>t({classes:"ec-slide",contents:s,style:{backgroundColor:s.backgroundColor}})),this.o=i,this.t=s.offsetWidth,this.i=s?.scrollWidth||0,this.M=this.t-this.i,this.u=!1,this.p=0,this.H=new IntersectionObserver(this.handleVirtObserver,{root:this.containerEl,rootMargin:`0px ${this.t/4}px 0px ${this.t}px`}),this.updateSettings({height:e,gap:o,borderRadius:h,applyBorderRadiusToContainer:r,snapToSlide:n,bindToScrollPos:a}),this.addEventListeners(),this.containerEl.style.setProperty("--ec-container-width",`${this.t}px`),this.t<600&&(this.T=12),l>0&&(this.containerEl.style.opacity="0"),this.containerEl.replaceChildren(...this.slideEls),this.updateDimensions(),this.u=!0,this.loop(performance.now())}handleVirtObserver(t){t.forEach(t=>{const s=t.target,i=this.slideEls.indexOf(s);this.setVirtualization(s,i,t.isIntersecting)})}updateSettings({height:t=300,gap:s=20,borderRadius:i=40,applyBorderRadiusToContainer:e=!0,snapToSlide:o=!1,bindToScrollPos:h=!1}){cancelAnimationFrame(this.D),this.D=requestAnimationFrame(()=>{this.height=t,this.gap=s,this.borderRadius=Math.min(i/100*this.height,.45*this.t*.5),this.I=Math.max(this.borderRadius,40),this.applyBorderRadiusToContainer=e,this.snapToSlide=o,this.bindToScrollPos=h,this.containerEl?.style.setProperty("--ec-height",`${this.height}px`),this.containerEl?.style.setProperty("--ec-border-radius",this.applyBorderRadiusToContainer?`${this.borderRadius}px`:"0px"),this.snapToSlide&&(this.C=-this.getClosestSlideToPoint(this.C).leftEdge)})}destroy(){this.u=!1,cancelAnimationFrame(this.D),this.removeEventListeners(),this.slideEls?.length&&this.slideEls.forEach(t=>{t.remove()}),this.slideEls=[],this.containerEl=void 0}handleResize(t){let s=null;t&&t.forEach(t=>{t.target===this.containerEl&&(s=t.borderBoxSize?t.borderBoxSize[0].inlineSize:t.contentRect.width)}),this.updateDimensions(s)}addEventListeners(){this.removeEventListeners(),this.slideEls.length&&this.slideEls.forEach(t=>{this.resizeObserver.observe(t),this.H?.observe(t)}),this.containerEl&&(this.resizeObserver.observe(this.containerEl),this.containerEl.addEventListener("pointerdown",this.handlePointerdown),document.addEventListener("pointermove",this.handlePointermove,{passive:!0}),document.addEventListener("pointerup",this.handlePointerup),document.body.addEventListener("pointerleave",this.handlePointerup))}removeEventListeners(){this.resizeObserver.disconnect(),this.containerEl&&(this.containerEl.removeEventListener("pointerdown",this.handlePointerdown),document.removeEventListener("pointermove",this.handlePointermove),document.removeEventListener("pointerup",this.handlePointerup))}handlePointerdown(t){this.m=!0,this.P=this._,this.C=this._,this.k.start=t.clientX,this.k.previous=t.clientX,this.updateDimensions()}handlePointermove(t){if(!this.m)return;const i=t.clientX-this.k.start;Math.abs(i)>10&&this.containerEl?.classList.add("ec-is-dragging"),this.C=this.P+i,s(this.R,t.clientX-this.k.previous,10),this.k.previous=t.clientX}handlePointerup(){var t;this.containerEl?.classList.remove("ec-is-dragging"),this.m=!1,this.C+=((t=this.R).length?t.reduce((t,s)=>t+s,0)/t.length:0)*this.T}updateDimensions(t){this.t=t||this.containerEl?.offsetWidth||0;let s=0;this.l=this.slideEls.map((t,i)=>{let e=t.offsetWidth,o=s;return s+=e,i<this.l.length-1&&(s+=this.gap),{width:e,x:o}}),this.i=s,this.M=this.t-this.i,this.containerEl?.style.setProperty("--ec-container-width",`${this.t}px`),this.t<600?this.T=12:this.T=15}isAtBoundary(){return this.C>0||this.C<this.t-this.i}getPhysicsConfig(){return this.m?C:this.v?M:this.isAtBoundary()?k:E}updatePosition(){if(!this.m)if(this.C>0)this.C-=.25*this.C;else if(this.C<this.M){const t=this.C-this.M;this.C-=.25*t}const t=this.B,s=this._-this.C,i=Math.abs(s)<.01&&Math.abs(this.S)<.01;if(!this.m&&i)return this._=this.C,void(this.S=0);const e=this.getPhysicsConfig(),{mass:o,naturalFrequency:h,dampingRatio:r}=e,n=o*(2*h*Math.PI)**2,a=(-n*s+-2*r*Math.sqrt(n*o)*this.S)/o;this.S+=a*t,this._+=this.S*t}getClosestSlideToPoint(t){return this.l.reduce((s,i,e)=>{const o=Math.abs(s.cumulativeWidth+t),h=i?.width??0;return o<s.distanceFromTarget?{index:e,distanceFromTarget:o,leftEdge:s.cumulativeWidth,cumulativeWidth:s.cumulativeWidth+h+this.gap}:{...s,cumulativeWidth:s.cumulativeWidth+h+this.gap}},{index:0,distanceFromTarget:1/0,leftEdge:0,cumulativeWidth:0})}updateScrollPos(){this.containerEl&&(this.q(),this.i,this.q=i(this.containerEl,t=>{this.t=t.width,this.M=this.t-this.i;const s=Math.max(Math.min((this.j-t.top)/(this.j+t.height),1),0);if(s!==this.G){this.v=!0;const t=this.G-s,i=this.j*t*.5;this.C+=i,this.C=Math.max(Math.min(0,this.C),this.t-this.i),this.G=s}this.O=t}))}getSlidePositions(){const t=this._;let s=t,i=!1;const e=this.slideEls.filter((t,s)=>this.l[s]?.width).map((e,o)=>{const h=this.o[o],r=this.l[o].width;o>0&&this.l[o-1]?.width&&(s+=this.l[o-1].width+this.gap);let n=0,a=0,l=0,c=0,d=Math.min(r*this.F,this.t);const u=this.l[o];u&&u.x+u.width*this.F>this.i&&(d=r*(this.slideEls.length-o)+Math.round(this.A*this.F));let p=Math.min(Math.max(d-Math.max(this.t-s+Math.round(this.A*this.F),0),0)/(d-this.I),1);const g=(r-this.I)*p;if(l=g,n=-g/2,c-=g,s<this.t&&s+r-l+this.gap>=this.t&&t<=0){const t=r-a-l,e=this.I-(this.t-s)<=0?t:this.t-s,h=this.t-(s+e);h>0&&!this.A&&(this.A=h,this.L=o+1,i=!0),e<this.I/2&&!this.A&&(this.A=e+this.gap,this.L=o+1,i=!0)}Math.round(s-this.gap)<=0&&Math.round(r+s)>0&&(o!==this.anchorSlide&&this.onSlideChange&&this.onSlideChange(o),this.anchorSlide=o),s<=0&&(a=Math.min(Math.abs(s),r-this.I),n=s/-2);const b={el:e,contentEl:h,xPos:s,rightClipInset:l,leftClipInset:a,innerTranslate:n};return s+=c,b});return i?this.getSlidePositions():e}setVirtualization(t,s,i=!0){if(i){if(t.childElementCount>0)return;const s=this.h.get(t);s&&(t.replaceChildren(s),this.h.delete(t),t.style.width="")}else{if(!t.firstElementChild||!this.l[s])return;const i=t.firstElementChild;t.style.width=`${this.l[s].width}px`,t.style.backgroundColor=i.backgroundColor,this.h.set(t,t.removeChild(t.firstElementChild))}}positionSlides(){this.getSlidePositions().filter((t,s)=>this.l[s]?.width).forEach(({el:t,contentEl:s,xPos:i,rightClipInset:e,leftClipInset:o,innerTranslate:h},r)=>{const n=this.l[r].width-e-o,a=Math.min(this.borderRadius,n/2);t?.style.setProperty("--transform",`translate3d(${i}px, 0 ,0)`),this.h.has(t)||(t?.style.setProperty("--clip",`inset(0 ${e}px 0 ${o}px round ${a}px)`),s?.style.setProperty("--content-transform",`translate3d(${h}px, 0, 0)`))})}goToSlide(t,s=!0){t=Math.max(Math.min(t,this.slideEls.length-1),0),this.updateDimensions(),t===this.l.length-1?this.C=this.M:(this.C=this.l[t]?.x||0===this.l[t]?.x?-this.l[t].x:this.C,this.C=Math.max(this.C,this.M)),s||(this._=this.C)}advance(){this.goToSlide(Math.min(this.getClosestSlideToPoint(this.C).index+1,this.slideEls.length-1))}retreat(){this.goToSlide(Math.max(this.getClosestSlideToPoint(this.C).index-1,0))}render(){if(this.R.shift(),!this.slideEls)return;this.bindToScrollPos&&this.updateScrollPos();const t=this.getClosestSlideToPoint(this.M),s=this.C+t.leftEdge<=0;if(this.snapToSlide&&!this.m&&!this.isAtBoundary()&&!s){const t=this.getClosestSlideToPoint(this.C);this.C=-t.leftEdge}this.atEnd=t.cumulativeWidth+this.C-this.t-this.gap<=0,this.atEnd&&this.onReachEnd?this.onReachEnd(!0):this.onReachEnd&&this.onReachEnd(!1),this.updatePosition(),this.positionSlides(),this.v=!1,this.startIndex>0&&(this.p<4&&(1==this.p&&this.goToSlide(this.startIndex,!1),3==this.p&&this.containerEl?.style.setProperty("opacity","")),this.p++)}loop(t){if(!this.u)return;const s="safari"===_.browser?8:12;t-this.$>s&&(this.render(),this.$=t),requestAnimationFrame(t=>this.loop(t))}}class T extends n{label="ElasticCarousel";widgetSettings;feedMetadata;posts;previewLoadingColors;startIndex=0;containerEl;headerEl;innerEl;footerEl;instagramLogoEl;labelEl;leftArrowEl;rightArrowEl;slidesContainerEl;postEls=[];popoverGalleryEl;langDirection="ltr";appliedBreakpoint;medianPaletteHSL;gyre;constructor(){super(),this.onPropChange(this.W,["widgetSettings","feedMetadata","posts","previewLoadingColors","startIndex"],["widgetSettings","feedMetadata","posts"],this.setup),a.register(),l.register(),c.register(),this.gyre=new R({onSlideChange:t=>this.V(t),onReachEnd:t=>this.J(t)}),this.U=this.U.bind(this),this.N=this.N.bind(this),this.addEventListener("post-focus-next",this.K),this.addEventListener("post-focus-previous",this.X),this.onConnect(()=>{e("elasticCarousel: onConnect"),this.N(),this.containerEl||(this.slidesContainerEl=t({classes:"ec-slides"}),this.headerEl=t({type:"header",classes:"ec-header",attributes:{dir:"ltr"}}),this.innerEl=t({classes:"ec-inner",contents:[this.slidesContainerEl]}),this.footerEl=t({type:"footer",classes:"ec-footer",attributes:{dir:"ltr"}}),this.labelEl=t({classes:"ec-label",attributes:{dir:this.langDirection??"ltr"}}),this.leftArrowEl=t({type:"button",classes:"ec-button ec-retreat",contents:[p],listeners:{click:()=>this.Y()},attributes:{tabindex:-1,disabled:!0,"aria-hidden":!0}}),this.rightArrowEl=t({type:"button",classes:"ec-button ec-advance",contents:[g],listeners:{click:()=>this.Z()},attributes:{tabindex:-1,"aria-hidden":!0}}),this.containerEl=t({type:"figure",classes:"ec-carousel",contents:[this.innerEl]})),this.renderWidget(this.containerEl,[d,'.ec-carousel{--ec-controls-margin:20px;--ec-button-border-radius:40%;--ec-icon-color:#4a4a4a;--ec-text-color:#4a4a4a;--ec-button-color:#f4f4f4;--ec-button-hover-color:#ececec;--ec-button-icon-color:#4a4a4a;--ec-button-icon-hover-color:#2e2e2e;--ec-button-gap:min(calc(var(--ec-controls-margin)/2),5px);flex-direction:column;height:var(--ec-height);margin:0;overflow:hidden;width:100%}.ec-carousel,.ec-inner{display:flex;justify-content:center}.ec-inner{align-items:center}.ec-slides{border-radius:var(--ec-border-radius);cursor:grab;height:var(--ec-height);justify-content:flex-start;overflow:hidden;position:relative;touch-action:pan-y;width:100%}.ec-slide,.ec-slides{display:flex;isolation:isolate}.ec-slide{clip-path:var(--clip);flex-shrink:0;height:100%;left:0;max-width:calc(var(--ec-container-width)*.45);position:absolute;top:0;transform:var(--transform);-moz-user-select:none;user-select:none;-webkit-user-select:none;will-change:clip-path,transform}.ec-slide behold-album-post,.ec-slide behold-image-post,.ec-slide behold-video-post{transform:var(--content-transform)}.ec-slide .post--placeholder{aspect-ratio:unset;height:100%}.ec-is-dragging{cursor:grabbing}.ec-is-dragging .ec-slide{pointer-events:none}.ec-footer,.ec-header{display:flex;justify-content:center}.ec-carousel--controls-sides .ec-footer,.ec-carousel--controls-sides .ec-header{padding:0 64px;padding-inline:64px}.ec-header{margin-bottom:var(--ec-controls-margin)}.ec-footer{margin-top:var(--ec-controls-margin)}.ec-label{align-items:center;display:flex;flex-shrink:1;gap:7px 5px;line-height:1.2;min-width:0;overflow:hidden;text-overflow:ellipsis;-moz-user-select:none;user-select:none;-webkit-user-select:none}.ec-carousel--controls-center .ec-button+.ec-label,.ec-carousel--controls-split .ec-button+.ec-label{margin:0 max(calc(var(--ec-controls-margin)*1.5),20px)}.ec-carousel--label-right .ec-label{margin-left:auto}.ec-carousel--label-left .ec-label{margin-right:auto}.ec-label svg{flex-shrink:0;height:24px;margin-right:5px;width:24px}.ec-label svg path{fill:var(--behold-icon-color,var(--ec-icon-color))}.ec-label a,.ec-label div{color:var(--behold-text-color,var(--ec-text-color));display:inline-block;font-family:inherit;font-size:19px;overflow:hidden;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}.ec-button,.ec-carousel--controls-center .ec-footer,.ec-carousel--controls-center .ec-header{justify-content:center}.ec-button{align-items:center;background-color:transparent;border:none;cursor:pointer;display:flex;flex-shrink:0;height:44px;padding:0;touch-action:manipulation;transition:all .3s ease;width:44px}.ec-carousel--controls-sides .ec-button{height:var(--ec-height);width:64px}.ec-button:disabled{cursor:default;opacity:.5}.ec-button:before{background-color:var(--behold-button-color,var(--ec-button-color));border-radius:var(--ec-button-border-radius);content:"";height:44px;position:absolute;transition:all .3s ease;width:44px}.ec-button:not(:disabled):hover:before{background-color:var(\n --behold-button-hover-color,var(--ec-button-hover-color)\n )}.ec-button svg{height:14px;position:relative;width:auto;z-index:1}.ec-button svg path{fill:var(--behold-button-icon-color,var(--ec-button-icon-color));transition:all .3s ease}.ec-button:not(:disabled):hover svg path{fill:var(\n --behold-button-icon-hover-color,var(--ec-button-icon-hover-color)\n )}.ec-retreat{padding-right:var(--ec-button-gap);width:calc(44px + var(--ec-button-gap))}.ec-retreat:dir(rtl){padding-right:0;padding-inline-end:var(--ec-button-gap)}.ec-carousel--controls-split .ec-retreat{margin-right:auto}.ec-carousel--controls-split .ec-retreat:dir(rtl){margin-right:0;margin-inline-end:auto}.ec-carousel--controls-right .ec-retreat{margin-left:auto}.ec-carousel--controls-right .ec-retreat:dir(rtl){margin-left:0;margin-inline-start:auto}.ec-advance{padding-left:var(--ec-button-gap);width:calc(44px + var(--ec-button-gap))}.ec-advance:dir(rtl){padding-left:0;padding-inline-start:var(--ec-button-gap)}.ec-carousel--controls-split .ec-advance{margin-left:auto}.ec-carousel--controls-split .ec-advance:dir(rtl){margin-left:0;margin-inline-start:auto}.ec-carousel--controls-left .ec-advance{margin-right:auto;margin-inline-end:auto}.ec-carousel--controls-left .ec-advance:dir(rtl){margin-right:0;margin-inline-end:auto}.ec-carousel--controls-sides .ec-retreat{padding-right:20px}.ec-carousel--controls-sides .ec-advance{padding-left:20px}.post{height:100%;max-width:calc(var(--ec-container-width)*.45)}.post a{-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.post--placeholder{background-color:#dedede;height:0;min-height:100%;padding-bottom:calc(100%/var(--post-aspect-ratio))}']),this.setAttribute("tabindex","0"),this.setAttribute("aria-label","Gallery of Instagram posts. Shift + arrow keys to navigate"),this.onResize(this,this,this.tt)})}setup(){if(e("elasticCarousel: setup"),!this.widgetSettings||!this.containerEl)return;if("transparent"!==this.widgetSettings.loadingColor&&this.posts){const t=this.posts.filter(t=>t.colorPalette).map(t=>t.colorPalette);this.medianPaletteHSL=this.widgetSettings?.loadingColor?u(t,this.widgetSettings.loadingColor):["0","0","0"]}const t=this.getMatchingBreakpoint(this.offsetWidth,this.widgetSettings.breakpoints);this.renderBreakpoint(t),o(this.containerEl,{"--ec-icon-color":this.widgetSettings.iconColor,"--ec-text-color":this.widgetSettings.textColor,"--ec-button-color":this.widgetSettings.buttonColor,"--ec-button-hover-color":this.widgetSettings.buttonHoverColor,"--ec-button-icon-color":this.widgetSettings.buttonIconColor,"--ec-button-icon-hover-color":this.widgetSettings.buttonIconHoverColor}),this.postEls&&this.postEls.forEach(t=>{t.widgetSettings=this.widgetSettings,t.feedMetadata=this.feedMetadata}),this.st(),"openPopupGallery"===this.widgetSettings.onPostClick&&this.enablePopoverGallery(),this.previewLoadingColors&&this.postEls&&(this.postEls.forEach(t=>{t.previewLoadingColors=this.previewLoadingColors}),h(this,{"is-previewing-loading-colors":!!this.previewLoadingColors}))}N(){const t=getComputedStyle(document.body);this.langDirection=t.direction}st(){if(e("elasticCarousel: buildLabel"),!this.widgetSettings)return;const s=document.createElement("template");s.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><path d="M295.42,6c-53.2,2.51-89.53,11-121.29,23.48-32.87,12.81-60.73,30-88.45,57.82S40.89,143,28.17,175.92c-12.31,31.83-20.65,68.19-23,121.42S2.3,367.68,2.56,503.46,3.42,656.26,6,709.6c2.54,53.19,11,89.51,23.48,121.28,12.83,32.87,30,60.72,57.83,88.45S143,964.09,176,976.83c31.8,12.29,68.17,20.67,121.39,23s70.35,2.87,206.09,2.61,152.83-.86,206.16-3.39S799.1,988,830.88,975.58c32.87-12.86,60.74-30,88.45-57.84S964.1,862,976.81,829.06c12.32-31.8,20.69-68.17,23-121.35,2.33-53.37,2.88-70.41,2.62-206.17s-.87-152.78-3.4-206.1-11-89.53-23.47-121.32c-12.85-32.87-30-60.7-57.82-88.45S862,40.87,829.07,28.19c-31.82-12.31-68.17-20.7-121.39-23S637.33,2.3,501.54,2.56,348.75,3.4,295.42,6m5.84,903.88c-48.75-2.12-75.22-10.22-92.86-17-23.36-9-40-19.88-57.58-37.29s-28.38-34.11-37.5-57.42c-6.85-17.64-15.1-44.08-17.38-92.83-2.48-52.69-3-68.51-3.29-202s.22-149.29,2.53-202c2.08-48.71,10.23-75.21,17-92.84,9-23.39,19.84-40,37.29-57.57s34.1-28.39,57.43-37.51c17.62-6.88,44.06-15.06,92.79-17.38,52.73-2.5,68.53-3,202-3.29s149.31.21,202.06,2.53c48.71,2.12,75.22,10.19,92.83,17,23.37,9,40,19.81,57.57,37.29s28.4,34.07,37.52,57.45c6.89,17.57,15.07,44,17.37,92.76,2.51,52.73,3.08,68.54,3.32,202s-.23,149.31-2.54,202c-2.13,48.75-10.21,75.23-17,92.89-9,23.35-19.85,40-37.31,57.56s-34.09,28.38-57.43,37.5c-17.6,6.87-44.07,15.07-92.76,17.39-52.73,2.48-68.53,3-202.05,3.29s-149.27-.25-202-2.53m407.6-674.61a60,60,0,1,0,59.88-60.1,60,60,0,0,0-59.88,60.1M245.77,503c.28,141.8,115.44,256.49,257.21,256.22S759.52,643.8,759.25,502,643.79,245.48,502,245.76,245.5,361.22,245.77,503m90.06-.18a166.67,166.67,0,1,1,167,166.34,166.65,166.65,0,0,1-167-166.34" transform="translate(-2.5 -2.5)"/><title>Instagram</title></svg>';let i=`https://instagram.com/${this.feedMetadata?.username??""}`;if(this.widgetSettings.labelLink?.length&&(i=this.widgetSettings.labelLink),this.widgetSettings.labelLink?.length||this.widgetSettings.label?.length){const e=t({type:"a",contents:this.widgetSettings.label?.length?this.widgetSettings.label:this.feedMetadata?.username,attributes:{href:i,target:"_blank"}});this.labelEl?.replaceChildren(s.content,e)}else if(this.feedMetadata?.hashtags?.length){const i=this.feedMetadata.hashtags.map((s,i,e)=>t({type:"a",contents:["#",s,i<e.length-1?", ":""],attributes:{target:"_blank",href:`https://instagram.com/explore/tags/${s}`}}));this.labelEl?.replaceChildren(s.content,...i)}else{const e=t({type:"a",contents:[this.feedMetadata?.username??""],attributes:{target:"_blank",href:i}});this.labelEl?.replaceChildren(s.content,e)}}V(t){0===t&&this.leftArrowEl?this.leftArrowEl.disabled=!0:this.leftArrowEl&&(this.leftArrowEl.disabled=!1),this.gyre.atEnd&&this.rightArrowEl?this.rightArrowEl.disabled=!0:this.rightArrowEl&&(this.rightArrowEl.disabled=!1),this.dispatchEvent(new CustomEvent("slide-change",{bubbles:!0,composed:!0,detail:{index:t,currentPost:this.posts?.[t??0]}}))}J(t){t&&this.rightArrowEl?this.rightArrowEl.disabled=!0:this.rightArrowEl&&(this.rightArrowEl.disabled=!1)}W({changedProp:t,oldValue:s,newValue:i}){switch(t){case"posts":this.it();break;case"widgetSettings":this.et(s,i);break;case"feedMetadata":this.ot();break;case"previewLoadingColors":this.postEls?.forEach(t=>{t.previewLoadingColors=this.previewLoadingColors}),h(this,{"is-previewing-loading-colors":!!this.previewLoadingColors})}}it(){this.postEls=[],this.widgetSettings?.breakpoints&&this.renderBreakpoint(this.getMatchingBreakpoint(this.offsetWidth,this.widgetSettings.breakpoints),!0),this.postEls.forEach(t=>{t.widgetSettings=this.widgetSettings,t.feedMetadata=this.feedMetadata}),this.popoverGalleryEl&&this.posts&&(this.popoverGalleryEl.posts=this.posts)}et(t,s){let i=!1;if(!s)return;!t||this.postEls?.length&&!r(t.breakpoints,s.breakpoints,["postHeight"],1)||(i=!0),o(this.containerEl,{"--ec-icon-color":s.iconColor,"--ec-text-color":s.textColor,"--ec-button-color":s.buttonColor,"--ec-button-hover-color":s.buttonHoverColor,"--ec-button-icon-color":s.buttonIconColor,"--ec-button-icon-hover-color":s.buttonIconHoverColor}),r(t,s,["label","labelLink"])&&this.st(),"openPopupGallery"!==t?.onPostClick&&"openPopupGallery"===s?.onPostClick&&this.enablePopoverGallery();const e=this.getMatchingBreakpoint(this.offsetWidth,s.breakpoints);this.renderBreakpoint(e,i),this.postEls?.forEach(t=>{t.widgetSettings=s}),this.popoverGalleryEl&&(this.popoverGalleryEl.widgetSettings=s)}ot(){let t=`from @${this.feedMetadata?.username}`;this.feedMetadata?.hashtags?.length&&(t=`from hashtag${this.feedMetadata.hashtags.length>1?"s":""} ${this.feedMetadata.hashtags.join(", ")}`),this.setAttribute("aria-label",`Gallery of Instagram posts ${t}. Shift + arrow keys to navigate`),this.postEls?.forEach(t=>{t.feedMetadata=this.feedMetadata}),this.popoverGalleryEl&&this.feedMetadata&&(this.popoverGalleryEl.feedMetadata=this.feedMetadata)}async enablePopoverGallery(){if(this.popoverGalleryEl)return;const{default:t}=await import("./PopoverGallery-ckIKYe1i.js");t.register(),this.popoverGalleryEl=document.createElement("behold-popover-gallery"),Object.assign(this.popoverGalleryEl,{widgetSettings:this.widgetSettings,feedMetadata:this.feedMetadata,posts:this.posts,closeFocusEl:this,onSlideChange:t=>{"number"==typeof t&&(this.gyre.goToSlide(t),this.popoverGalleryEl?.closeFocusEl&&(this.popoverGalleryEl.closeFocusEl=this.postEls?.[t]))}})}tt(t){const s=t.contentBoxSize?.[0]?.inlineSize,i=this.widgetSettings?.breakpoints;if(!i)return;const e=this.getMatchingBreakpoint(s,i);this.renderBreakpoint(e)}X(){if(!this.postEls?.length)return;let t=[...this.postEls].indexOf(this.shadow.activeElement?.parentElement);t>0&&(t-=1),this.postEls[t].focus(),this.gyre.goToSlide(t)}K(){if(!this.postEls?.length)return;let t=[...this.postEls].indexOf(this.shadow.activeElement?.parentElement);this.gyre.anchorSlide>0&&t<this.gyre.anchorSlide&&(t=this.gyre.anchorSlide),t>-1&&t<this.postEls.length-1&&(t+=1),t<0&&(t=0),this.postEls[t].focus(),this.gyre.goToSlide(t)}U(t){this.popoverGalleryEl?.open(this.postEls.indexOf(t)??0,t)}Z(){this.gyre&&this.gyre.advance()}Y(){this.gyre&&this.gyre.retreat()}renderPosts(t){this.postEls=this.createPostEls(t),e("elasticCarousel: renderPosts"),this.raf(()=>{this.slidesContainerEl&&(this.gyre.destroy(),this.gyre.init({containerEl:this.slidesContainerEl,slideEls:this.postEls,height:t.postHeight,gap:t.gap.x,borderRadius:t.borderRadius,applyBorderRadiusToContainer:t.applyBorderRadiusToContainer||!0,snapToSlide:t.snapToSlide||!1,bindToScrollPos:t.bindToScrollPos||!1,startIndex:this.startIndex}))},"renderPosts")}getMatchingBreakpoint(t,s){e("elasticCarousel: getMatchingBreakpoint");const i=Object.entries(s).map(([t,s])=>({...s,width:t})).filter(t=>"default"!==t.width).sort((t,s)=>parseInt(s.width)-parseInt(t.width)).reduce((s,i)=>t<=parseInt(i.width)?i:s,s.default);return{...s.default,...i}}renderBreakpoint(t,s=!1){if(!this.posts||!this.containerEl)return;e("elasticCarousel: renderBreakpoint"),this.N();const i=this.appliedBreakpoint,{showControls:n,controlsPosition:a,controlsJustification:l,showLabel:c,labelPosition:d,labelJustification:u,buttonBorderRadius:p,controlsMargin:g,postHeight:b}=t;if(this.postEls?.length&&!r(i,t,["numPosts","forcePostAspectRatio","postAspectRatio","postHeight"])||(s=!0),b&&this.slidesContainerEl?.style.setProperty("--ec-height",`${b}px`),this.widgetSettings?.maxWidth&&this.widgetSettings.constrainWidth&&this.containerEl.style.maxWidth!==`${this.widgetSettings.maxWidth}px`&&(this.containerEl.style.maxWidth=`${this.widgetSettings.maxWidth}px`),this.widgetSettings?.constrainWidth||(this.containerEl.style.maxWidth=""),this.leftArrowEl?.remove(),this.rightArrowEl?.remove(),r(i,t,["showControls","controlsPosition","controlsJustification","showLabel","labelPosition","labelJustification"])||n&&!this.leftArrowEl?.isConnected||c&&!this.labelEl?.isConnected){this.leftArrowEl?.remove(),this.rightArrowEl?.remove(),this.labelEl?.remove(),this.headerEl?.remove(),this.footerEl?.remove(),o(this.containerEl,{"--ec-button-border-radius":`${p}%`,"--ec-controls-margin":`${g}px`}),h(this.containerEl,{"ec-carousel--controls-sides":"sides"===a,"ec-carousel--controls-left":"left"===l,"ec-carousel--controls-right":"right"===l,"ec-carousel--controls-center":"center"===l,"ec-carousel--controls-split":"split"===l,"ec-carousel--label-left":"left"===u,"ec-carousel--label-right":"right"===u,"ec-carousel--label-center":"left"===u}),c&&this.labelEl&&("top"===d&&this.headerEl?.append(this.labelEl),"bottom"===d&&this.footerEl?.append(this.labelEl));let t=this.innerEl;if("top"===a&&(t=this.headerEl),"bottom"===a&&(t=this.footerEl),n&&"sides"===a&&t&&this.leftArrowEl&&this.rightArrowEl)"rtl"===this.langDirection?(t.append(this.leftArrowEl),t.prepend(this.rightArrowEl)):(t.prepend(this.leftArrowEl),t.append(this.rightArrowEl));else if(n&&t&&this.leftArrowEl&&this.rightArrowEl)switch(l){case"left":t.prepend(this.rightArrowEl),t.prepend(this.leftArrowEl);break;case"right":t.append(this.leftArrowEl),t.append(this.rightArrowEl);break;default:t.prepend(this.leftArrowEl),t.append(this.rightArrowEl)}this.headerEl?.childElementCount&&this.containerEl.prepend(this.headerEl),this.footerEl?.childElementCount&&this.containerEl.append(this.footerEl)}this.widgetSettings&&this.containerEl.setAttribute("data-hover-effect",this.widgetSettings.hoverEffect),s?this.renderPosts(t):this.gyre.updateSettings({height:t.postHeight,gap:t.gap.x,borderRadius:t.borderRadius,applyBorderRadiusToContainer:t.applyBorderRadiusToContainer,snapToSlide:t.snapToSlide,bindToScrollPos:t.bindToScrollPos}),this.appliedBreakpoint=t}createPostEls(s){e("elasticCarousel: createPostEls");const{numPosts:i,postHeight:o,postAspectRatio:h,forcePostAspectRatio:r}=s,n=this.posts?.filter((t,i)=>i<(s?.numPosts||this.posts?.length||12)),a=n?.map((s,e)=>{const a=[s.sizes.full.width,s.sizes.full.height],l=r?h||[1,1]:a,c=l.reduce((t,s)=>t/s);let d="behold-image-post";return"VIDEO"===s.mediaType&&(d="behold-video-post"),"CAROUSEL_ALBUM"===s.mediaType&&(d="behold-album-post"),t({type:d,props:{post:s,widgetSettings:this.widgetSettings,feedMetadata:this.feedMetadata,medianPaletteHSL:this.medianPaletteHSL,onClick:this.U,hasRowGap:!0,isLastRow:!1,index:e,aspectRatio:l,totalPosts:n?.length||i||this.posts?.length||0},style:{width:o*c+"px","--post-aspect-ratio":c}})});if(!a)return[];for(;a.length<s.numPosts;){const s=t({classes:"post post--placeholder",style:{width:`${o}px`,"--post-aspect-ratio":1}});a.push(s)}return a}static register(t="behold-elastic-carousel"){return customElements.get(t)||customElements.define(t,T),t}}export{T as default};
@@ -1 +1 @@
1
- import{B as e,t,c as s,s as i}from"./index-DqJM0ILL.js";import{l as o}from"./logo-CAJXYQBc.js";class a extends e{label="ErrorMessage";shadow;linkEl;logoEl;styleEl;errorTitleEl;errorMessageEl;errorMessageTextEl;errorMessage;constructor(){super(),this.shadow=this.attachShadow({mode:"open"}),this.onPropChange(this.t,["errorMessage"]),this.onConnect(()=>{this.onResize(this,this,t(this.i,50,this))}),this.onConnect(()=>{this.render()})}t(){this.render()}render(){if(!this.errorMessage)return;let e=this.errorMessage.length>120?this.errorMessage.slice(0,120)+"...":this.errorMessage;try{const t=JSON.parse(this.errorMessage);t.message&&(e=t.message)}catch(e){}let t="Error";e.includes("Upgrade")&&(t="Upgrade Required"),this.linkEl=s({type:"a",classes:"link",attributes:{href:"https://behold.so",target:"_blank"}}),this.logoEl=s({type:"div",classes:"logo",contents:o,attributes:{"aria-label":"behold"}}),this.errorTitleEl=s({classes:"message__title",contents:[t]}),this.errorMessageTextEl=s({classes:"message__inner"}),this.errorMessageTextEl.innerHTML=e?.replace("Upgrade your plan",'<a href="https://app.behold.so/account" target="blank">Upgrade your plan</a>'),this.errorMessageEl=s({classes:"message",contents:[this.errorTitleEl,this.errorMessageTextEl]}),this.styleEl=s({type:"style",contents:':host{align-items:center;background:#f4f3f0;background-size:auto 100%;border:none;border-radius:40px;box-shadow:none;box-sizing:border-box;color:#1a1a1a;display:flex;height:200px;justify-content:center;margin:0;max-width:750px;min-width:50px;outline:none;overflow:hidden;padding:20px;position:relative;width:100%}:host *{box-sizing:border-box}:host(.large){height:180px}:host(.medium),:host(.small){flex-direction:column-reverse;height:auto;padding:40px 30px}.logo{align-items:center;border-right:1px solid #1a1a1a;display:flex;flex-shrink:0;justify-content:center;padding:20px 40px 20px 0;width:auto}.logo svg{height:18px;width:auto}.logo svg path{fill:#1a1a1a}:host(.large) .logo{width:180px}:host(.large) .logo svg{height:18px}:host(.medium) .logo,:host(.small) .logo{align-items:center;border-right:none;display:flex;flex-direction:column;gap:20px;justify-content:center;padding:20px 0 7px;width:100%}:host(.medium) .logo:before,:host(.small) .logo:before{background-color:#1a1a1a;content:"";height:1px;width:40px}:host(.medium) .logo svg,:host(.small) .logo svg{height:16px}.message{align-items:flex-start;display:flex;flex-direction:column;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;font-size:16px;gap:5px;justify-content:center;line-height:1.5;max-width:305px;padding:0 0 0 40px;text-align:left}.message a{color:#1a1a1a;display:inline-block;position:relative;text-decoration:underline;z-index:999}:host(.large) .message{font-size:15px}:host(.medium) .message{align-items:center;font-size:16px;gap:2px;padding:0;text-align:center}:host(.small) .message{align-items:center;font-size:15px;gap:2px;padding:0;text-align:center}.message__title{align-items:center;display:flex;font-size:22px;font-weight:400;justify-content:center}.message__title svg{height:25px;margin-right:15px;width:25px}:host(.large) .message__title{font-size:18px}:host(.large) .message__title svg{height:20px;margin-right:10px;width:20px}:host(.medium) .message__title,:host(.small) .message__title{flex-direction:column;font-size:20px;margin-bottom:10px}:host(.medium) .message__title svg,:host(.small) .message__title svg{margin-bottom:7px;margin-right:0}.link{border-radius:40px;height:100%;left:0;position:absolute;top:0;width:100%;z-index:998}.link:focus-visible{box-shadow:inset 0 0 0 3px #4169e1,inset 0 0 0 4px #fff}'.toString()}),this.shadow.replaceChildren(this.logoEl,this.errorMessageEl,this.linkEl,this.styleEl)}i(e){const t=e?.borderBoxSize?.[0]?.inlineSize||e?.contentRect?.width||0;let s="xlarge";t<600&&(s="large"),t<500&&(s="medium"),t<250&&(s="small"),["small","medium","large","xlarge"].forEach(e=>{const t=`${e}`;i(this,{[t]:e===s})})}static register(e="behold-error-message"){return customElements.get(e)||customElements.define(e,a),e}}export{a as default};
1
+ import{B as e,t,c as s,s as i}from"./index-DlG54u5e.js";import{l as o}from"./logo-CAJXYQBc.js";class a extends e{label="ErrorMessage";shadow;linkEl;logoEl;styleEl;errorTitleEl;errorMessageEl;errorMessageTextEl;errorMessage;constructor(){super(),this.shadow=this.attachShadow({mode:"open"}),this.onPropChange(this.t,["errorMessage"]),this.onConnect(()=>{this.onResize(this,this,t(this.i,50,this))}),this.onConnect(()=>{this.render()})}t(){this.render()}render(){if(!this.errorMessage)return;let e=this.errorMessage.length>120?this.errorMessage.slice(0,120)+"...":this.errorMessage;try{const t=JSON.parse(this.errorMessage);t.message&&(e=t.message)}catch(e){}let t="Error";e.includes("Upgrade")&&(t="Upgrade Required"),this.linkEl=s({type:"a",classes:"link",attributes:{href:"https://behold.so",target:"_blank"}}),this.logoEl=s({type:"div",classes:"logo",contents:o,attributes:{"aria-label":"behold"}}),this.errorTitleEl=s({classes:"message__title",contents:[t]}),this.errorMessageTextEl=s({classes:"message__inner"}),this.errorMessageTextEl.innerHTML=e?.replace("Upgrade your plan",'<a href="https://app.behold.so/account" target="blank">Upgrade your plan</a>'),this.errorMessageEl=s({classes:"message",contents:[this.errorTitleEl,this.errorMessageTextEl]}),this.styleEl=s({type:"style",contents:':host{align-items:center;background:#f4f3f0;background-size:auto 100%;border:none;border-radius:40px;box-shadow:none;box-sizing:border-box;color:#1a1a1a;display:flex;height:200px;justify-content:center;margin:0;max-width:750px;min-width:50px;outline:none;overflow:hidden;padding:20px;position:relative;width:100%}:host *{box-sizing:border-box}:host(.large){height:180px}:host(.medium),:host(.small){flex-direction:column-reverse;height:auto;padding:40px 30px}.logo{align-items:center;border-right:1px solid #1a1a1a;display:flex;flex-shrink:0;justify-content:center;padding:20px 40px 20px 0;width:auto}.logo svg{height:18px;width:auto}.logo svg path{fill:#1a1a1a}:host(.large) .logo{width:180px}:host(.large) .logo svg{height:18px}:host(.medium) .logo,:host(.small) .logo{align-items:center;border-right:none;display:flex;flex-direction:column;gap:20px;justify-content:center;padding:20px 0 7px;width:100%}:host(.medium) .logo:before,:host(.small) .logo:before{background-color:#1a1a1a;content:"";height:1px;width:40px}:host(.medium) .logo svg,:host(.small) .logo svg{height:16px}.message{align-items:flex-start;display:flex;flex-direction:column;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;font-size:16px;gap:5px;justify-content:center;line-height:1.5;max-width:305px;padding:0 0 0 40px;text-align:left}.message a{color:#1a1a1a;display:inline-block;position:relative;text-decoration:underline;z-index:999}:host(.large) .message{font-size:15px}:host(.medium) .message{align-items:center;font-size:16px;gap:2px;padding:0;text-align:center}:host(.small) .message{align-items:center;font-size:15px;gap:2px;padding:0;text-align:center}.message__title{align-items:center;display:flex;font-size:22px;font-weight:400;justify-content:center}.message__title svg{height:25px;margin-right:15px;width:25px}:host(.large) .message__title{font-size:18px}:host(.large) .message__title svg{height:20px;margin-right:10px;width:20px}:host(.medium) .message__title,:host(.small) .message__title{flex-direction:column;font-size:20px;margin-bottom:10px}:host(.medium) .message__title svg,:host(.small) .message__title svg{margin-bottom:7px;margin-right:0}.link{border-radius:40px;height:100%;left:0;position:absolute;top:0;width:100%;z-index:998}.link:focus-visible{box-shadow:inset 0 0 0 3px #4169e1,inset 0 0 0 4px #fff}'.toString()}),this.shadow.replaceChildren(this.logoEl,this.errorMessageEl,this.linkEl,this.styleEl)}i(e){const t=e?.borderBoxSize?.[0]?.inlineSize||e?.contentRect?.width||0;let s="xlarge";t<600&&(s="large"),t<500&&(s="medium"),t<250&&(s="small"),["small","medium","large","xlarge"].forEach(e=>{const t=`${e}`;i(this,{[t]:e===s})})}static register(e="behold-error-message"){return customElements.get(e)||customElements.define(e,a),e}}export{a as default};
@@ -1 +1 @@
1
- import{d as t,c as s,s as i,n as e,k as h,f as o,t as a}from"./index-DqJM0ILL.js";import{B as r,a as l,b as n,A as d,c as p,g as c}from"./base-t3hPe2AE.js";import{B as g}from"./Branding-z4-UkviK.js";import"./logo-CAJXYQBc.js";class u extends r{label="GalleryWall";widgetSettings;feedMetadata;posts=[];previewLoadingColors;containerEl;brandingEl;heightRefEl;postEls=[];popoverGalleryEl;appliedBreakpoint;medianPaletteHSL=["0","0","39"];constructor(){super(),this.onPropChange(this.t,["widgetSettings","feedMetadata","posts","previewLoadingColors"],["widgetSettings","feedMetadata","posts"],this.setup),l.register(),n.register(),d.register(),g.register(),this.i=this.i.bind(this),this.addEventListener("post-focus-next",this.h),this.addEventListener("post-focus-previous",this.o),this.onConnect(()=>{this.setAttribute("tabindex","0"),this.setAttribute("aria-label","Gallery of Instagram posts. Shift + arrow keys to navigate")})}setup(){if(t("galleryWall: setup"),!this.brandingEl&&this.feedMetadata?.showBranding&&(this.brandingEl=s({type:"behold-branding"})),this.containerEl||(this.style.opacity="0",this.heightRefEl=s({classes:"height-ref"}),this.containerEl=s({type:"figure",classes:"posts",contents:[this.heightRefEl,this.feedMetadata?.showBranding?this.brandingEl:""]})),this.renderWidget(this.containerEl,[p,".posts{display:block;min-height:100%;position:relative;width:100%}@media (hover:hover){.posts:hover behold-branding a{opacity:1!important;transform:none!important;transition:all .3s ease!important}}.height-ref{position:relative}.post{-webkit-font-smoothing:inherit;-moz-osx-font-smoothing:inherit;border:var(--post-border-width,0) solid var(--post-border-color,#000);color:inherit;display:block;font:inherit;height:100px;left:0;line-height:normal;overflow:hidden;position:absolute;top:0;transform-origin:top left;transition:background .3s ease;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100px}.post--placeholder{background-color:#dedede;position:absolute}"]),this.onResize(this,this.containerEl,this.l),"transparent"!==this.widgetSettings?.loadingColor){const t=this.posts.filter(t=>t.colorPalette).map(t=>t.colorPalette);this.medianPaletteHSL=this.widgetSettings?.loadingColor?c(t,this.widgetSettings.loadingColor):["0","0","0"]}if(this.widgetSettings?.breakpoints){const t=this.getMatchingBreakpoint(this.offsetWidth,this.widgetSettings?.breakpoints);this.renderBreakpoint(t)}this.style.opacity="","openPopupGallery"===this.widgetSettings?.onPostClick&&this.enablePopoverGallery(),this.previewLoadingColors&&(this.postEls.forEach(t=>{t.previewLoadingColors=this.previewLoadingColors}),i(this,{"is-previewing-loading-colors":!!this.previewLoadingColors}))}t({changedProp:t,oldValue:s,newValue:e}){switch(t){case"posts":this.p();break;case"widgetSettings":this.u(s,e);break;case"feedMetadata":this.m();break;case"previewLoadingColors":this.postEls.forEach(t=>{t.previewLoadingColors=this.previewLoadingColors}),i(this,{"is-previewing-loading-colors":!!this.previewLoadingColors})}}p(){this.postEls=[],this.appliedBreakpoint&&this.renderBreakpoint(this.appliedBreakpoint,!0),this.popoverGalleryEl&&(this.popoverGalleryEl.posts=this.posts)}u(t,s){"openPopupGallery"!==t?.onPostClick&&"openPopupGallery"===s?.onPostClick&&this.enablePopoverGallery(),this.widgetSettings?.breakpoints&&this.renderBreakpoint(this.getMatchingBreakpoint(this.offsetWidth,this.widgetSettings.breakpoints)),this.postEls.forEach(t=>{t.widgetSettings=this.widgetSettings}),this.popoverGalleryEl&&(this.popoverGalleryEl.widgetSettings=this.widgetSettings)}m(){let t=`from @${this.feedMetadata?.username}`;this.feedMetadata?.hashtags?.length&&(t=`from hashtag${this.feedMetadata.hashtags.length>1?"s":""} ${this.feedMetadata.hashtags.join(", ")}`),this.setAttribute("aria-label",`Gallery of Instagram posts ${t}. Shift + arrow keys to navigate`),this.postEls.forEach(t=>{t.feedMetadata=this.feedMetadata}),this.popoverGalleryEl&&(this.popoverGalleryEl.feedMetadata=this.feedMetadata)}async enablePopoverGallery(){const{default:t}=await import("./PopoverGallery-Bj9OSwwT.js");t.register(),this.popoverGalleryEl=document.createElement("behold-popover-gallery"),Object.assign(this.popoverGalleryEl,{widgetSettings:this.widgetSettings,feedMetadata:this.feedMetadata,posts:this.posts,closeFocusEl:this,onSlideChange:t=>{this.popoverGalleryEl&&(this.popoverGalleryEl.closeFocusEl=this.postEls[t])}})}l(s){t("galleryWall: handleResize");const i=s.contentBoxSize?.[0]?.inlineSize,e=this.widgetSettings?.breakpoints;if(e){const t=this.getMatchingBreakpoint(i,e);this.renderBreakpoint(t)}}o(){if(!this.postEls.length||!this.heightRefEl?.children||!this.shadow.activeElement?.parentElement)return;let t=[...this.heightRefEl?.children].indexOf(this.shadow.activeElement?.parentElement);t>0?t-=1:t=this.postEls.length-1,this.postEls[t].focus()}h(){if(!this.postEls.length||!this.heightRefEl?.children||!this.shadow.activeElement?.parentElement)return;let t=[...this.heightRefEl.children].indexOf(this.shadow.activeElement?.parentElement);t>-1&&t<this.postEls.length-1?t+=1:t=0,this.postEls[t].focus()}i(t){this.popoverGalleryEl?.open(this.postEls.indexOf(t),t)}renderPosts(s){t("galleryWall: renderPosts"),this.postEls=this.createPostEls(s),this.raf(()=>{this.heightRefEl?.replaceChildren(...this.postEls),t("galleryWall: renderPosts raf",this.heightRefEl?.childElementCount,this.postEls)},"renderPosts")}getMatchingBreakpoint(t,s){const i=Object.entries(s).map(([t,s])=>({...s,width:t})).filter(t=>"default"!==t.width).sort((t,s)=>s.width.localeCompare(t.width)).reduce((s,i)=>t<=parseInt(i.width)?i:s,{...s.default,numPosts:s.default.galleryWallLayout.length});return{...s.default,...i,numPosts:s.default.galleryWallLayout.length}}renderBreakpoint(s,i=!1){t("galleryWall: renderBreakpoint"),this.cancelRaf("setContainerHeight"),this.postEls||(i=!0);const a=this.appliedBreakpoint;this.appliedBreakpoint=s;const{gap:r,borderRadius:l,cornerShape:n,borderColor:d,borderWidth:p,numPosts:c,galleryWallLayout:g,galleryWallNamedLayout:u}=s;switch(this.widgetSettings?.alignment){case"left":this.style.justifyContent="flex-start";break;case"right":this.style.justifyContent="flex-end";break;default:this.style.justifyContent="center"}this.widgetSettings?.maxWidth&&this.widgetSettings?.constrainWidth&&this.containerEl?.style.maxWidth!==`${this.widgetSettings.maxWidth}px`&&this.containerEl?.style.setProperty("maxWidth",`${this.widgetSettings.maxWidth}px`),this.widgetSettings?.constrainWidth||this.containerEl?.style.setProperty("max-width",""),this.widgetSettings?.hoverEffect&&this.containerEl?.setAttribute("data-hover-effect",this.widgetSettings?.hoverEffect);const f=n??"round",b="squircle"===f?2*(l??0):l??0;e(this.containerEl,{"--post-border-radius":`${b}%`,"--post-corner-shape":`${f}`,"--post-border-width":`${p??0}px`,"--post-border-color":h(d??"0,0,0")}),(a?.numPosts!==c||a?.galleryWallNamedLayout!==u.toString()||i)&&this.renderPosts(s);const m=this.containerEl?.offsetWidth;if(m){const t=r.x/1e3*m,s=r.y/1e3*m;this.postEls.forEach((i,e)=>{const[h,o,a,r]=g?.[e]?g[e].split(",").map(t=>parseInt(t)):[0,0,10,10],l=h*(m/100)+t/2,n=o*(m/100);i.style.transform=`translate(${l}px, ${n}px`,i.style.width=a*(m/100)-t+"px",i.style.height=r*(m/100)-s+"px"})}o(),this.raf(()=>{this.setContainerHeight()},"setContainerHeight")}createPostEls(i){const{gap:e}=i,h=i?.numPosts||this.posts?.length||200,o=this.posts.filter((t,s)=>s<h),a=o.map((t,h)=>{let a="behold-image-post";return"VIDEO"===t.mediaType&&(a="behold-video-post"),"CAROUSEL_ALBUM"===t.mediaType&&(a="behold-album-post"),s({type:a,props:{post:t,widgetSettings:this.widgetSettings,feedMetadata:this.feedMetadata,medianPaletteHSL:this.medianPaletteHSL,onClick:this.i,hasRowGap:"0"!=`${e.y}`,index:h,aspectRatio:[1,1],totalPosts:o?.length||i?.numPosts||this.posts?.length||0}})});return a.length<i.galleryWallLayout.length&&i.galleryWallLayout.filter((t,s)=>s>=a.length).forEach(t=>{const i=s({classes:"post post--placeholder"});a.push(i)}),t("galleryWall: createPostEls",a),a}setContainerHeight=a(()=>{t("galleryWall: setContainerHeight",this.heightRefEl?.scrollHeight),this.heightRefEl?.isConnected&&(this.heightRefEl.scrollHeight>0?this.style.height=`${this.heightRefEl.scrollHeight}px`:this.raf(this.setContainerHeight,"setContainerHeight"))},10,this);static register(t="behold-gallery-wall"){return customElements.get(t)||customElements.define(t,u),t}}export{u as default};
1
+ import{d as t,c as s,s as i,n as e,k as h,f as o,t as a}from"./index-DlG54u5e.js";import{B as r,a as l,b as n,A as p,c as d,g as c}from"./base-COwgdJg5.js";import{B as g}from"./Branding-BZ8vXZUv.js";import"./logo-CAJXYQBc.js";class u extends r{label="GalleryWall";widgetSettings;feedMetadata;posts=[];previewLoadingColors;containerEl;brandingEl;heightRefEl;postEls=[];popoverGalleryEl;appliedBreakpoint;medianPaletteHSL=["0","0","39"];constructor(){super(),this.onPropChange(this.t,["widgetSettings","feedMetadata","posts","previewLoadingColors"],["widgetSettings","feedMetadata","posts"],this.setup),l.register(),n.register(),p.register(),g.register(),this.i=this.i.bind(this),this.addEventListener("post-focus-next",this.h),this.addEventListener("post-focus-previous",this.o),this.onConnect(()=>{this.setAttribute("tabindex","0"),this.setAttribute("aria-label","Gallery of Instagram posts. Shift + arrow keys to navigate")})}setup(){if(t("galleryWall: setup"),!this.brandingEl&&this.feedMetadata?.showBranding&&(this.brandingEl=s({type:"behold-branding"})),this.containerEl||(this.style.opacity="0",this.heightRefEl=s({classes:"height-ref"}),this.containerEl=s({type:"figure",classes:"posts",contents:[this.heightRefEl,this.feedMetadata?.showBranding?this.brandingEl:""]})),this.renderWidget(this.containerEl,[d,".posts{display:block;min-height:100%;position:relative;width:100%}@media (hover:hover){.posts:hover behold-branding a{opacity:1!important;transform:none!important;transition:all .3s ease!important}}.height-ref{position:relative}.post{-webkit-font-smoothing:inherit;-moz-osx-font-smoothing:inherit;border:var(--post-border-width,0) solid var(--post-border-color,#000);color:inherit;display:block;font:inherit;height:100px;left:0;line-height:normal;overflow:hidden;position:absolute;top:0;transform-origin:top left;transition:background .3s ease;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100px}.post--placeholder{background-color:#dedede;position:absolute}"]),this.onResize(this,this.containerEl,this.l),"transparent"!==this.widgetSettings?.loadingColor){const t=this.posts.filter(t=>t.colorPalette).map(t=>t.colorPalette);this.medianPaletteHSL=this.widgetSettings?.loadingColor?c(t,this.widgetSettings.loadingColor):["0","0","0"]}if(this.widgetSettings?.breakpoints){const t=this.getMatchingBreakpoint(this.offsetWidth,this.widgetSettings?.breakpoints);this.renderBreakpoint(t)}this.style.opacity="","openPopupGallery"===this.widgetSettings?.onPostClick&&this.enablePopoverGallery(),this.previewLoadingColors&&(this.postEls.forEach(t=>{t.previewLoadingColors=this.previewLoadingColors}),i(this,{"is-previewing-loading-colors":!!this.previewLoadingColors}))}t({changedProp:t,oldValue:s,newValue:e}){switch(t){case"posts":this.p();break;case"widgetSettings":this.u(s,e);break;case"feedMetadata":this.m();break;case"previewLoadingColors":this.postEls.forEach(t=>{t.previewLoadingColors=this.previewLoadingColors}),i(this,{"is-previewing-loading-colors":!!this.previewLoadingColors})}}p(){this.postEls=[],this.appliedBreakpoint&&this.renderBreakpoint(this.appliedBreakpoint,!0),this.popoverGalleryEl&&(this.popoverGalleryEl.posts=this.posts)}u(t,s){"openPopupGallery"!==t?.onPostClick&&"openPopupGallery"===s?.onPostClick&&this.enablePopoverGallery(),this.widgetSettings?.breakpoints&&this.renderBreakpoint(this.getMatchingBreakpoint(this.offsetWidth,this.widgetSettings.breakpoints)),this.postEls.forEach(t=>{t.widgetSettings=this.widgetSettings}),this.popoverGalleryEl&&(this.popoverGalleryEl.widgetSettings=this.widgetSettings)}m(){let t=`from @${this.feedMetadata?.username}`;this.feedMetadata?.hashtags?.length&&(t=`from hashtag${this.feedMetadata.hashtags.length>1?"s":""} ${this.feedMetadata.hashtags.join(", ")}`),this.setAttribute("aria-label",`Gallery of Instagram posts ${t}. Shift + arrow keys to navigate`),this.postEls.forEach(t=>{t.feedMetadata=this.feedMetadata}),this.popoverGalleryEl&&(this.popoverGalleryEl.feedMetadata=this.feedMetadata)}async enablePopoverGallery(){const{default:t}=await import("./PopoverGallery-ckIKYe1i.js");t.register(),this.popoverGalleryEl=document.createElement("behold-popover-gallery"),Object.assign(this.popoverGalleryEl,{widgetSettings:this.widgetSettings,feedMetadata:this.feedMetadata,posts:this.posts,closeFocusEl:this,onSlideChange:t=>{this.popoverGalleryEl&&(this.popoverGalleryEl.closeFocusEl=this.postEls[t])}})}l(s){t("galleryWall: handleResize");const i=s.contentBoxSize?.[0]?.inlineSize,e=this.widgetSettings?.breakpoints;if(e){const t=this.getMatchingBreakpoint(i,e);this.renderBreakpoint(t)}}o(){if(!this.postEls.length||!this.heightRefEl?.children||!this.shadow.activeElement?.parentElement)return;let t=[...this.heightRefEl?.children].indexOf(this.shadow.activeElement?.parentElement);t>0?t-=1:t=this.postEls.length-1,this.postEls[t].focus()}h(){if(!this.postEls.length||!this.heightRefEl?.children||!this.shadow.activeElement?.parentElement)return;let t=[...this.heightRefEl.children].indexOf(this.shadow.activeElement?.parentElement);t>-1&&t<this.postEls.length-1?t+=1:t=0,this.postEls[t].focus()}i(t){this.popoverGalleryEl?.open(this.postEls.indexOf(t),t)}renderPosts(s){t("galleryWall: renderPosts"),this.postEls=this.createPostEls(s),this.raf(()=>{this.heightRefEl?.replaceChildren(...this.postEls),t("galleryWall: renderPosts raf",this.heightRefEl?.childElementCount,this.postEls)},"renderPosts")}getMatchingBreakpoint(t,s){const i=Object.entries(s).map(([t,s])=>({...s,width:t})).filter(t=>"default"!==t.width).sort((t,s)=>s.width.localeCompare(t.width)).reduce((s,i)=>t<=parseInt(i.width)?i:s,{...s.default,numPosts:s.default.galleryWallLayout.length});return{...s.default,...i,numPosts:s.default.galleryWallLayout.length}}renderBreakpoint(s,i=!1){t("galleryWall: renderBreakpoint"),this.cancelRaf("setContainerHeight"),this.postEls||(i=!0);const a=this.appliedBreakpoint;this.appliedBreakpoint=s;const{gap:r,borderRadius:l,cornerShape:n,borderColor:p,borderWidth:d,numPosts:c,galleryWallLayout:g,galleryWallNamedLayout:u}=s;switch(this.widgetSettings?.alignment){case"left":this.style.justifyContent="flex-start";break;case"right":this.style.justifyContent="flex-end";break;default:this.style.justifyContent="center"}this.widgetSettings?.maxWidth&&this.widgetSettings?.constrainWidth&&this.containerEl?.style.maxWidth!==`${this.widgetSettings.maxWidth}px`&&this.containerEl?.style.setProperty("maxWidth",`${this.widgetSettings.maxWidth}px`),this.widgetSettings?.constrainWidth||this.containerEl?.style.setProperty("max-width",""),this.widgetSettings?.hoverEffect&&this.containerEl?.setAttribute("data-hover-effect",this.widgetSettings?.hoverEffect);const f=CSS.supports("corner-shape","squircle"),b=n??"round",m="squircle"===b&&f?2*(l??0):l??0;e(this.containerEl,{"--post-border-radius":`${m}%`,"--post-corner-shape":`${b}`,"--post-border-width":`${d??0}px`,"--post-border-color":h(p??"0,0,0")}),(a?.numPosts!==c||a?.galleryWallNamedLayout!==u.toString()||i)&&this.renderPosts(s);const y=this.containerEl?.offsetWidth;if(y){const t=r.x/1e3*y,s=r.y/1e3*y;this.postEls.forEach((i,e)=>{const[h,o,a,r]=g?.[e]?g[e].split(",").map(t=>parseInt(t)):[0,0,10,10],l=h*(y/100)+t/2,n=o*(y/100);i.style.transform=`translate(${l}px, ${n}px`,i.style.width=a*(y/100)-t+"px",i.style.height=r*(y/100)-s+"px"})}o(),this.raf(()=>{this.setContainerHeight()},"setContainerHeight")}createPostEls(i){const{gap:e}=i,h=i?.numPosts||this.posts?.length||200,o=this.posts.filter((t,s)=>s<h),a=o.map((t,h)=>{let a="behold-image-post";return"VIDEO"===t.mediaType&&(a="behold-video-post"),"CAROUSEL_ALBUM"===t.mediaType&&(a="behold-album-post"),s({type:a,props:{post:t,widgetSettings:this.widgetSettings,feedMetadata:this.feedMetadata,medianPaletteHSL:this.medianPaletteHSL,onClick:this.i,hasRowGap:"0"!=`${e.y}`,index:h,aspectRatio:[1,1],totalPosts:o?.length||i?.numPosts||this.posts?.length||0}})});return a.length<i.galleryWallLayout.length&&i.galleryWallLayout.filter((t,s)=>s>=a.length).forEach(t=>{const i=s({classes:"post post--placeholder"});a.push(i)}),t("galleryWall: createPostEls",a),a}setContainerHeight=a(()=>{t("galleryWall: setContainerHeight",this.heightRefEl?.scrollHeight),this.heightRefEl?.isConnected&&(this.heightRefEl.scrollHeight>0?this.style.height=`${this.heightRefEl.scrollHeight}px`:this.raf(this.setContainerHeight,"setContainerHeight"))},10,this);static register(t="behold-gallery-wall"){return customElements.get(t)||customElements.define(t,u),t}}export{u as default};
@@ -1 +1 @@
1
- import{d as t,c as s,s as i,f as e,n as h,k as a}from"./index-DqJM0ILL.js";import{B as o,a as r,b as n,A as d,c as l,g as p}from"./base-t3hPe2AE.js";import{B as c}from"./Branding-z4-UkviK.js";import"./logo-CAJXYQBc.js";class g extends o{label="Grid";widgetSettings;feedMetadata;posts=[];previewLoadingColors;containerEl;postsContainerEl;brandingEl;postEls=[];popoverGalleryEl;appliedBreakpoint;medianPaletteHSL=["0","0","39"];constructor(){super(),this.onPropChange(this.t,["widgetSettings","feedMetadata","posts","previewLoadingColors"],["widgetSettings","feedMetadata","posts"],this.setup),r.register(),n.register(),d.register(),c.register(),this.i=this.i.bind(this),this.addEventListener("post-focus-next",this.h),this.addEventListener("post-focus-previous",this.o),this.onConnect(()=>{t("grid: onConnect"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label","Gallery of Instagram posts. Shift + arrow keys to navigate")})}setup(){if(t("grid: setup"),!this.brandingEl&&this.feedMetadata?.showBranding&&(this.brandingEl=s({type:"behold-branding"})),this.postsContainerEl||(this.postsContainerEl=s({type:"div",classes:"posts"})),this.containerEl||(this.containerEl=s({type:"figure",classes:"container",contents:[this.postsContainerEl,this.feedMetadata?.showBranding?this.brandingEl:""]})),this.renderWidget(this.containerEl,[l,".container{display:flex;margin:0;max-width:100%;padding:0;position:relative;width:100%}@media (hover:hover){.container:hover behold-branding a{opacity:1!important;transform:none!important;transition:all .3s ease!important}}.post--placeholder{background-color:#dedede;height:0;min-height:100%;padding-bottom:calc(100%/var(--post-aspect-ratio))}"]),this.onResize(this,this,this.l),"transparent"!==this.widgetSettings?.loadingColor){const t=this.posts.filter(t=>t.colorPalette).map(t=>t.colorPalette);this.medianPaletteHSL=this.widgetSettings?.loadingColor?p(t,this.widgetSettings.loadingColor):["0","0","0"]}if(this.widgetSettings?.breakpoints){const t=this.getMatchingBreakpoint(this.offsetWidth,this.widgetSettings.breakpoints);this.renderBreakpoint(t)}this.postEls&&this.postEls.forEach(t=>{t.widgetSettings=this.widgetSettings,t.feedMetadata=this.feedMetadata}),"openPopupGallery"===this.widgetSettings?.onPostClick&&this.enablePopoverGallery(),this.previewLoadingColors&&(this.postEls.forEach(t=>{t.previewLoadingColors=this.previewLoadingColors}),i(this,{"is-previewing-loading-colors":!!this.previewLoadingColors}))}t({changedProp:t,oldValue:s,newValue:e}){switch(t){case"posts":this.p();break;case"widgetSettings":this.u(s,e);break;case"feedMetadata":this.m();break;case"previewLoadingColors":this.postEls.forEach(t=>{t.previewLoadingColors=this.previewLoadingColors}),i(this,{"is-previewing-loading-colors":!!this.previewLoadingColors})}}p(){this.postEls=[],this.widgetSettings?.breakpoints&&this.renderBreakpoint(this.getMatchingBreakpoint(this.offsetWidth,this.widgetSettings?.breakpoints),!0),this.popoverGalleryEl&&(this.popoverGalleryEl.posts=this.posts)}u(t,s){if("openPopupGallery"!==t?.onPostClick&&"openPopupGallery"===s?.onPostClick&&this.enablePopoverGallery(),this.widgetSettings?.breakpoints){const t=this.getMatchingBreakpoint(this.offsetWidth,this.widgetSettings.breakpoints);this.renderBreakpoint(t)}this.postEls.forEach(t=>{t.widgetSettings=this.widgetSettings}),this.popoverGalleryEl&&(this.popoverGalleryEl.widgetSettings=this.widgetSettings)}m(){let t=`from @${this.feedMetadata?.username}`;this.feedMetadata?.hashtags?.length&&(t=`from hashtag${this.feedMetadata.hashtags.length>1?"s":""} ${this.feedMetadata.hashtags.join(", ")}`),this.setAttribute("aria-label",`Gallery of Instagram posts ${t}. Shift + arrow keys to navigate`),this.postEls.forEach(t=>{t.feedMetadata=this.feedMetadata}),this.popoverGalleryEl&&(this.popoverGalleryEl.feedMetadata=this.feedMetadata)}async enablePopoverGallery(){if(this.popoverGalleryEl)return;const{default:t}=await import("./PopoverGallery-Bj9OSwwT.js");t.register(),this.popoverGalleryEl=document.createElement("behold-popover-gallery"),Object.assign(this.popoverGalleryEl,{widgetSettings:this.widgetSettings,feedMetadata:this.feedMetadata,posts:this.posts,closeFocusEl:this,onSlideChange:t=>{this.popoverGalleryEl?.closeFocusEl&&(this.popoverGalleryEl.closeFocusEl=this.postEls[t])}})}l(t){const s=t.contentBoxSize?.[0]?.inlineSize,i=this.widgetSettings?.breakpoints;if(i){const t=this.getMatchingBreakpoint(s,i);this.renderBreakpoint(t)}}o(){if(!this.postEls.length||!this.postsContainerEl?.children)return;let t=[...this.postsContainerEl.children].indexOf(this.shadow.activeElement?.parentElement);t>0?t-=1:t=this.postEls.length-1,this.postEls[t].focus()}h(){if(!this.postEls.length||!this.postsContainerEl?.children)return;let t=[...this.postsContainerEl.children].indexOf(this.shadow.activeElement?.parentElement);t>-1&&t<this.postEls.length-1?t+=1:t=0,this.postEls[t].focus()}i(t){this.popoverGalleryEl?.open(this.postEls.indexOf(t),t)}renderPosts(s){t("grid: renderPosts"),this.postEls=this.createPostEls(s),this.raf(()=>{this.postsContainerEl?.replaceChildren(...this.postEls)},"renderPosts")}getMatchingBreakpoint(s,i){t("grid: getMatchingBreakpoint");const e=Object.entries(i).map(([t,s])=>({...s,width:t})).filter(t=>"default"!==t.width).sort((t,s)=>parseInt(s.width)-parseInt(t.width)).reduce((t,i)=>s<=parseInt(i.width)?i:t,{...i.default,numPosts:this.posts.length});return{...i.default,...e}}renderBreakpoint(s,i=!1){if(!this.posts||!this.containerEl)return;this.postEls?.length||(i=!0),t("grid: renderBreakpoint, forceRender: = ",i);const o=this.appliedBreakpoint,{numColumns:r,gap:n,borderRadius:d,cornerShape:l,borderColor:p,borderWidth:c,numPosts:g,postAspectRatio:u}=s;switch(o?.numPosts&&o?.numPosts>g&&(this.postsContainerEl?.replaceChildren(),e()),this.widgetSettings?.alignment){case"left":this.style.justifyContent="flex-start";break;case"right":this.style.justifyContent="flex-end";break;default:this.style.justifyContent="center"}this.widgetSettings?.maxWidth&&this.widgetSettings.constrainWidth&&this.containerEl.style.maxWidth!==`${this.widgetSettings.maxWidth}px`&&(this.containerEl.style.maxWidth=`${this.widgetSettings.maxWidth}px`),this.widgetSettings?.constrainWidth||(this.containerEl.style.maxWidth=""),this.postsContainerEl?.style.setProperty("grid-template-columns",`repeat(${r}, 1fr)`),this.postsContainerEl?.style.setProperty("gap",`${n.y}px ${n.x}px`),this.widgetSettings?.hoverEffect&&this.postsContainerEl?.setAttribute("data-hover-effect",this.widgetSettings.hoverEffect);let f=(u||[1,1]).reduce((t,s)=>t/s);const m=l??"round",b="squircle"===m?2*(d??0):d??0;h(this.containerEl,{"--post-border-radius":`${b}%`,"--post-corner-shape":`${m}`,"--post-aspect-ratio":`${f??"1 / 1"}`,"--post-border-width":`${c??0}px`,"--post-border-color":a(p??"0,0,0")}),(o?.numPosts!==g||i)&&this.renderPosts(s),this.postEls.forEach((t,i)=>{t.hasRowGap="0"!=`${s.gap.y}`}),this.appliedBreakpoint=s}createPostEls(i){t("grid: createPostEls");const{numPosts:e,numColumns:h,gap:a,postAspectRatio:o}=i,r=this.posts.filter((t,s)=>s<(i?.numPosts||this.posts?.length||200)),n=r.map((t,i)=>{const n=Math.ceil((e||this.posts.length)/h);let d="behold-image-post";return"VIDEO"===t.mediaType&&(d="behold-video-post"),"CAROUSEL_ALBUM"===t.mediaType&&(d="behold-album-post"),s({type:d,props:{post:t,widgetSettings:this.widgetSettings,feedMetadata:this.feedMetadata,medianPaletteHSL:this.medianPaletteHSL,onClick:this.i,hasRowGap:"0"!=`${a.y}`,isLastRow:Math.ceil((i+1)/h)===n,index:i,aspectRatio:o||[1,1],totalPosts:r?.length||e||this.posts?.length||0}})});for(;n.length<i.numPosts;){const t=s({classes:"post post--placeholder"});n.push(t)}return n}static register(t="behold-grid"){return customElements.get(t)||customElements.define(t,g),t}}export{g as default};
1
+ import{d as t,c as s,s as i,f as e,n as h,k as a}from"./index-DlG54u5e.js";import{B as o,a as r,b as n,A as l,c as p,g as d}from"./base-COwgdJg5.js";import{B as c}from"./Branding-BZ8vXZUv.js";import"./logo-CAJXYQBc.js";class g extends o{label="Grid";widgetSettings;feedMetadata;posts=[];previewLoadingColors;containerEl;postsContainerEl;brandingEl;postEls=[];popoverGalleryEl;appliedBreakpoint;medianPaletteHSL=["0","0","39"];constructor(){super(),this.onPropChange(this.t,["widgetSettings","feedMetadata","posts","previewLoadingColors"],["widgetSettings","feedMetadata","posts"],this.setup),r.register(),n.register(),l.register(),c.register(),this.i=this.i.bind(this),this.addEventListener("post-focus-next",this.h),this.addEventListener("post-focus-previous",this.o),this.onConnect(()=>{t("grid: onConnect"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label","Gallery of Instagram posts. Shift + arrow keys to navigate")})}setup(){if(t("grid: setup"),!this.brandingEl&&this.feedMetadata?.showBranding&&(this.brandingEl=s({type:"behold-branding"})),this.postsContainerEl||(this.postsContainerEl=s({type:"div",classes:"posts"})),this.containerEl||(this.containerEl=s({type:"figure",classes:"container",contents:[this.postsContainerEl,this.feedMetadata?.showBranding?this.brandingEl:""]})),this.renderWidget(this.containerEl,[p,".container{display:flex;margin:0;max-width:100%;padding:0;position:relative;width:100%}@media (hover:hover){.container:hover behold-branding a{opacity:1!important;transform:none!important;transition:all .3s ease!important}}.post--placeholder{background-color:#dedede;height:0;min-height:100%;padding-bottom:calc(100%/var(--post-aspect-ratio))}"]),this.onResize(this,this,this.l),"transparent"!==this.widgetSettings?.loadingColor){const t=this.posts.filter(t=>t.colorPalette).map(t=>t.colorPalette);this.medianPaletteHSL=this.widgetSettings?.loadingColor?d(t,this.widgetSettings.loadingColor):["0","0","0"]}if(this.widgetSettings?.breakpoints){const t=this.getMatchingBreakpoint(this.offsetWidth,this.widgetSettings.breakpoints);this.renderBreakpoint(t)}this.postEls&&this.postEls.forEach(t=>{t.widgetSettings=this.widgetSettings,t.feedMetadata=this.feedMetadata}),"openPopupGallery"===this.widgetSettings?.onPostClick&&this.enablePopoverGallery(),this.previewLoadingColors&&(this.postEls.forEach(t=>{t.previewLoadingColors=this.previewLoadingColors}),i(this,{"is-previewing-loading-colors":!!this.previewLoadingColors}))}t({changedProp:t,oldValue:s,newValue:e}){switch(t){case"posts":this.p();break;case"widgetSettings":this.u(s,e);break;case"feedMetadata":this.m();break;case"previewLoadingColors":this.postEls.forEach(t=>{t.previewLoadingColors=this.previewLoadingColors}),i(this,{"is-previewing-loading-colors":!!this.previewLoadingColors})}}p(){this.postEls=[],this.widgetSettings?.breakpoints&&this.renderBreakpoint(this.getMatchingBreakpoint(this.offsetWidth,this.widgetSettings?.breakpoints),!0),this.popoverGalleryEl&&(this.popoverGalleryEl.posts=this.posts)}u(t,s){if("openPopupGallery"!==t?.onPostClick&&"openPopupGallery"===s?.onPostClick&&this.enablePopoverGallery(),this.widgetSettings?.breakpoints){const t=this.getMatchingBreakpoint(this.offsetWidth,this.widgetSettings.breakpoints);this.renderBreakpoint(t)}this.postEls.forEach(t=>{t.widgetSettings=this.widgetSettings}),this.popoverGalleryEl&&(this.popoverGalleryEl.widgetSettings=this.widgetSettings)}m(){let t=`from @${this.feedMetadata?.username}`;this.feedMetadata?.hashtags?.length&&(t=`from hashtag${this.feedMetadata.hashtags.length>1?"s":""} ${this.feedMetadata.hashtags.join(", ")}`),this.setAttribute("aria-label",`Gallery of Instagram posts ${t}. Shift + arrow keys to navigate`),this.postEls.forEach(t=>{t.feedMetadata=this.feedMetadata}),this.popoverGalleryEl&&(this.popoverGalleryEl.feedMetadata=this.feedMetadata)}async enablePopoverGallery(){if(this.popoverGalleryEl)return;const{default:t}=await import("./PopoverGallery-ckIKYe1i.js");t.register(),this.popoverGalleryEl=document.createElement("behold-popover-gallery"),Object.assign(this.popoverGalleryEl,{widgetSettings:this.widgetSettings,feedMetadata:this.feedMetadata,posts:this.posts,closeFocusEl:this,onSlideChange:t=>{this.popoverGalleryEl?.closeFocusEl&&(this.popoverGalleryEl.closeFocusEl=this.postEls[t])}})}l(t){const s=t.contentBoxSize?.[0]?.inlineSize,i=this.widgetSettings?.breakpoints;if(i){const t=this.getMatchingBreakpoint(s,i);this.renderBreakpoint(t)}}o(){if(!this.postEls.length||!this.postsContainerEl?.children)return;let t=[...this.postsContainerEl.children].indexOf(this.shadow.activeElement?.parentElement);t>0?t-=1:t=this.postEls.length-1,this.postEls[t].focus()}h(){if(!this.postEls.length||!this.postsContainerEl?.children)return;let t=[...this.postsContainerEl.children].indexOf(this.shadow.activeElement?.parentElement);t>-1&&t<this.postEls.length-1?t+=1:t=0,this.postEls[t].focus()}i(t){this.popoverGalleryEl?.open(this.postEls.indexOf(t),t)}renderPosts(s){t("grid: renderPosts"),this.postEls=this.createPostEls(s),this.raf(()=>{this.postsContainerEl?.replaceChildren(...this.postEls)},"renderPosts")}getMatchingBreakpoint(s,i){t("grid: getMatchingBreakpoint");const e=Object.entries(i).map(([t,s])=>({...s,width:t})).filter(t=>"default"!==t.width).sort((t,s)=>parseInt(s.width)-parseInt(t.width)).reduce((t,i)=>s<=parseInt(i.width)?i:t,{...i.default,numPosts:this.posts.length});return{...i.default,...e}}renderBreakpoint(s,i=!1){if(!this.posts||!this.containerEl)return;this.postEls?.length||(i=!0),t("grid: renderBreakpoint, forceRender: = ",i);const o=this.appliedBreakpoint,{numColumns:r,gap:n,borderRadius:l,cornerShape:p,borderColor:d,borderWidth:c,numPosts:g,postAspectRatio:u}=s;switch(o?.numPosts&&o?.numPosts>g&&(this.postsContainerEl?.replaceChildren(),e()),this.widgetSettings?.alignment){case"left":this.style.justifyContent="flex-start";break;case"right":this.style.justifyContent="flex-end";break;default:this.style.justifyContent="center"}this.widgetSettings?.maxWidth&&this.widgetSettings.constrainWidth&&this.containerEl.style.maxWidth!==`${this.widgetSettings.maxWidth}px`&&(this.containerEl.style.maxWidth=`${this.widgetSettings.maxWidth}px`),this.widgetSettings?.constrainWidth||(this.containerEl.style.maxWidth=""),this.postsContainerEl?.style.setProperty("grid-template-columns",`repeat(${r}, 1fr)`),this.postsContainerEl?.style.setProperty("gap",`${n.y}px ${n.x}px`),this.widgetSettings?.hoverEffect&&this.postsContainerEl?.setAttribute("data-hover-effect",this.widgetSettings.hoverEffect);let f=(u||[1,1]).reduce((t,s)=>t/s);const m=CSS.supports("corner-shape","squircle"),b=p??"round",w="squircle"===b&&m?2*(l??0):l??0;h(this.containerEl,{"--post-border-radius":`${w}%`,"--post-corner-shape":`${b}`,"--post-aspect-ratio":`${f??"1 / 1"}`,"--post-border-width":`${c??0}px`,"--post-border-color":a(d??"0,0,0")}),(o?.numPosts!==g||i)&&this.renderPosts(s),this.postEls.forEach((t,i)=>{t.hasRowGap="0"!=`${s.gap.y}`}),this.appliedBreakpoint=s}createPostEls(i){t("grid: createPostEls");const{numPosts:e,numColumns:h,gap:a,postAspectRatio:o}=i,r=this.posts.filter((t,s)=>s<(i?.numPosts||this.posts?.length||200)),n=r.map((t,i)=>{const n=Math.ceil((e||this.posts.length)/h);let l="behold-image-post";return"VIDEO"===t.mediaType&&(l="behold-video-post"),"CAROUSEL_ALBUM"===t.mediaType&&(l="behold-album-post"),s({type:l,props:{post:t,widgetSettings:this.widgetSettings,feedMetadata:this.feedMetadata,medianPaletteHSL:this.medianPaletteHSL,onClick:this.i,hasRowGap:"0"!=`${a.y}`,isLastRow:Math.ceil((i+1)/h)===n,index:i,aspectRatio:o||[1,1],totalPosts:r?.length||e||this.posts?.length||0}})});for(;n.length<i.numPosts;){const t=s({classes:"post post--placeholder"});n.push(t)}return n}static register(t="behold-grid"){return customElements.get(t)||customElements.define(t,g),t}}export{g as default};
@@ -1 +1 @@
1
- import{t,b as i,c as e,s,f as o,m as r,e as a,B as h,r as n,a as l,i as d,j as c,k as p,n as u}from"./index-DqJM0ILL.js";import{V as b,I as m,r as g}from"./base-t3hPe2AE.js";import{c as v,a as x}from"./caret-right-CSBbJCRm.js";let f=document,_=null,y=new Set,w=new Set,k=new MutationObserver(function(t){t.some(t=>"attributes"===t.type||!![...t.addedNodes,...t.removedNodes].some(t=>E(t).length>0))&&_&&M({include:[_],merge:!0})}),C=!1;function E(t){const i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:function(t){return t.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),e=[];let s=null;for(;s=i.nextNode();)e.push(s);return e}async function z(){return(await Promise.all([...y].map(async t=>!!await function(t){return new Promise(async i=>{if("disabled"in t&&t.disabled)return void i(!1);const e=await function(t){return new Promise(i=>{const e=new IntersectionObserver(t=>{i(t[0].isIntersecting),e.disconnect()});e.observe(t)})}(t);i(!!e&&[...w].every(i=>!i.contains(t)))})}(t)&&t))).filter(t=>!!t)}function S(t){!["Tab"].includes(t.code)||t.ctrlKey||t.altKey||t.metaKey||(t.preventDefault(),"Tab"===t.code&&t.shiftKey?async function(){const t=await z();let i=t.indexOf(f.activeElement)-1;i<0&&(i=t.length-1),t[i]?.focus()}():async function(){const t=await z();let i=t.indexOf(f.activeElement)+1;(i>t.length-1||i<0)&&(i=0),t[i]?.focus()}())}function M({include:t=[],exclude:i=[],merge:e=!1}){e?(t.forEach(t=>{w.delete(t),E(t).forEach(t=>{y.has(t)||y.add(t)})}),i.forEach(t=>w.add(t))):(y=new Set(t.flatMap(t=>E(t))),w=new Set(i))}function D(t){C&&(C=!1,t=t??document.body,document.removeEventListener("keydown",S),k.disconnect(),y.clear(),w.clear(),_=null,t&&t.focus())}class L{containerEl;slides;breadcrumbsContainerEl;previousEl;nextEl;keyboardNav;breadcrumbDiameter;onSlideChange;virtualize;proximalSlidesToRender;dynamicBreadCrumbsCutoff;dragLimit;transitionSpeed;baseTransition;momentumToTransition;index;t;i=document;o;h;l;p;u;m=0;v=0;_;k;C;S="ltr";M;D;L;A;F;O;P;$;B;R;T;j;constructor({slides:i,containerEl:e,breadcrumbsContainerEl:s,previousEl:o,nextEl:r,onSlideChange:a,breadcrumbDiameter:h=7,dynamicBreadCrumbsCutoff:n=10,keyboardNav:l=!0,dragLimit:d=.5,virtualize:c=!1,proximalSlidesToRender:p=1,momentumToTransition:u=5,transitionSpeed:b=300,baseTransition:m=""}){this.slides=i,this.containerEl=e,this.breadcrumbsContainerEl=s,this.previousEl=o,this.nextEl=r,this.onSlideChange=a,this.breadcrumbDiameter=h,this.dynamicBreadCrumbsCutoff=n,this.keyboardNav=l,this.dragLimit=d,this.virtualize=c,this.proximalSlidesToRender=p,this.transitionSpeed=b,this.baseTransition=m,this.momentumToTransition=u,this.index=0,this.t=!1,this.C=!1,this.D={x:0,y:0},this.L={x:0,y:0},this.F=0,this.O=0,this.P=0,this.$=0,this.B=[],this.R=new ResizeObserver(t=>this.j(t)),this.init=this.init.bind(this),this.destroy=this.destroy.bind(this),this.I=this.I.bind(this),this.U=this.U.bind(this),this.V=this.V.bind(this),this.H=this.H.bind(this),this.N=this.N.bind(this),this.q=this.q.bind(this),this.X=this.X.bind(this),this.G=this.G.bind(this),this.T=t(this.Z,10,this),this.j=t(this.K,100,this),this.W=this.W.bind(this),this.Y=this.Y.bind(this),this.J=this.J.bind(this),this.tt=this.tt.bind(this),this.it=this.it.bind(this),this.et=this.et.bind(this),this.st=this.st.bind(this),this.ot=this.ot.bind(this),this.rt=this.rt.bind(this)}it(){const t=getComputedStyle(document.body);this.S=t.direction}ot(){this.o?.addEventListener("mousedown",this.W,{passive:!0}),this.o?.addEventListener("touchstart",this.Y,{passive:!0}),document.body.addEventListener("mousemove",this.X,{passive:!0}),document.body.addEventListener("mouseup",this.tt,{passive:!0}),document.body.addEventListener("mouseleave",this.tt,{passive:!0}),document.body.addEventListener("touchmove",this.G,{passive:!0}),document.body.addEventListener("touchend",this.tt,{passive:!0}),this.previousEl&&this.previousEl.addEventListener("click",this.H,{passive:!0}),this.nextEl&&this.nextEl.addEventListener("click",this.N,{passive:!0}),this.keyboardNav&&document.addEventListener("keydown",this.q)}rt(){document.body.removeEventListener("mousemove",this.X),document.body.removeEventListener("mouseup",this.tt),document.body.removeEventListener("mouseleave",this.tt),document.body.removeEventListener("touchmove",this.G),document.body.removeEventListener("touchend",this.tt),this.o&&(this.o.removeEventListener("mousedown",this.W),this.o.removeEventListener("touchstart",this.Y)),this.previousEl&&this.previousEl.removeEventListener("click",this.H),this.nextEl&&this.nextEl.removeEventListener("click",this.N),this.keyboardNav&&document.removeEventListener("keydown",this.q)}init(t=0){this.t||(this.t=!0,this.i=i(this.containerEl),this.it(),this.h=this.slides.map(t=>e({classes:"hg-slide",contents:t})),this.u=this.slides.map((t,i)=>e({classes:"hg-breadcrumb",listeners:{click:()=>this.I({index:i})}})),this.p=e({classes:"hg-breadcrumbs-current"}),this.l=e({classes:"hg-breadcrumbs",contents:[...this.u,this.p],attributes:{dir:"ltr"}}),this.o=e({classes:"hg-container",contents:this.h,style:{"touch-action":"pan-y"}}),this.containerEl.appendChild(this.o),this.breadcrumbsContainerEl&&(this.breadcrumbsContainerEl.style.setProperty("--breadCrumbDiameter",this.breadcrumbDiameter+"px"),this.breadcrumbsContainerEl.appendChild(this.l)),this.ot(),this.slides.length<2&&(this.l.style.display="none",this.previousEl.style.display="none",this.nextEl.style.display="none"),this.R?.observe(this.containerEl),this.et(this.index,this.index,!1),this.I({index:t,animate:!1,forceUpdate:!0,isInitial:!0}))}destroy(){this.t&&(clearTimeout(this._),clearTimeout(this.k),cancelAnimationFrame(this.m),cancelAnimationFrame(this.v),this.R.disconnect(),this.rt(),this.u=void 0,this.p=void 0,this.l?.remove(),this.l=void 0,this.o?.remove(),this.o=void 0,this.i=void 0,this.h=void 0,this.t=!1)}K(t){t?.[0]&&this.h&&(this.A=A(this.containerEl,this.h))}st(t,i=!0){if(this.u.length>=this.dynamicBreadCrumbsCutoff&&this.l){s(this.l,{"no-transition":!i}),requestAnimationFrame(()=>{this.l?.classList.remove("no-transition")});const e=this.l.offsetWidth/2-this.breadcrumbDiameter/2-this.u[t].offsetLeft;this.l.style.transform=`translateX(${e}px)`,this.u.forEach((i,e)=>{s(i,{"hg-breadcrumb--hidden":e<=t-5||e>=t+5,"hg-breadcrumb--4":e===t-4||e===t+4,"hg-breadcrumb--3":e===t-3||e===t+3,"hg-breadcrumb--2":e===t-2||e===t+2,"hg-breadcrumb--1":e===t-1||e===t+1})})}}et(t,i,e){this.u?.length&&(this.st(t,e),this.breadcrumbsContainerEl&&((!e||this.u.length>=10&&Math.abs(t-i)>1)&&this.p&&this.l?t>i?(this.p.style.left="",this.p.style.right=this.l.offsetWidth-(this.u[t].offsetLeft+this.breadcrumbDiameter)+"px"):(this.p.style.right="",this.p.style.left=this.u[t].offsetLeft+"px"):this.p&&this.l&&(t<i?(this.p.style.left="",this.p.style.right=this.l.offsetWidth-this.u[i]?.offsetLeft-this.breadcrumbDiameter+"px"):(this.p.style.right="",this.p.style.left=this.u[i]?.offsetLeft+"px"),o(),this.m=requestAnimationFrame(()=>{t>i&&this.p?this.p.style.width=`${this.u[t]?.offsetLeft-this.p.offsetLeft+this.breadcrumbDiameter}px`:this.p&&(this.p.style.width=this.p.offsetLeft+this.p.offsetWidth-this.u[t]?.offsetLeft+"px")}),this._=setTimeout(()=>{t>i&&this.p&&this.l?(this.p.style.left="",this.p.style.right=this.l.offsetWidth-(this.u[t].offsetLeft+this.breadcrumbDiameter)+"px"):this.p&&(this.p.style.right="",this.p.style.left=this.u[t].offsetLeft+"px"),o(),this.m=requestAnimationFrame(()=>{this.p&&(this.p.style.width="")})},200))))}I({index:t,animate:i=!0,forceUpdate:e=!1,easing:s="ease",isInitial:o=!1}){if(!this.h?.[t])return;if(!this.t||!this.o)return;cancelAnimationFrame(this.v);const r=t,a=this.index;this.index=r,clearTimeout(this.k),this.virtualize&&this.h.forEach((t,i)=>{Math.abs(this.index-i)>this.proximalSlidesToRender&&i!==a?t.hasChildNodes()&&t.replaceChildren():t.hasChildNodes()||t.replaceChildren(this.slides[i])}),window.matchMedia("(prefers-reduced-motion)").matches&&(i=!1),this.C=!1,this.P=0,r!==a||e?(cancelAnimationFrame(this.m),clearTimeout(this._),this.et(r,a,i),this.onSlideChange&&this.onSlideChange(r,o)):this.p&&(this.p.style.width=""),this.o.style.transition=i?`transform ${this.transitionSpeed}ms ${s}`:this.baseTransition,this.o.style.transform=`translateX(${-100*r}%)`,this.O=-100*r,this.previousEl&&(r<1?(this.i?.activeElement===this.previousEl&&(this.v=requestAnimationFrame(()=>{this.nextEl.focus()})),this.previousEl.setAttribute("disabled","true")):this.previousEl.removeAttribute("disabled")),this.nextEl&&(r>=this.h.length-1?(this.i?.activeElement===this.nextEl&&(this.v=requestAnimationFrame(()=>{this.previousEl.focus()})),this.nextEl.setAttribute("disabled","true")):this.nextEl.removeAttribute("disabled")),this.k=setTimeout(()=>{this.o&&(this.o.style.transition=this.baseTransition)},this.transitionSpeed)}H(){this.U()}N(){this.V()}U(t="ease"){"string"!=typeof t&&(t="ease"),this.index<1?this.I({index:this.index}):this.I({index:this.index-1,easing:t})}V(t="ease"){"string"!=typeof t&&(t="ease"),this.index>=(this.h?.length??0)-1?this.I({index:this.index}):this.I({index:this.index+1,easing:t})}q(t){"ArrowRight"===t.code&&(t.preventDefault(),this.V()),"ArrowLeft"===t.code&&(t.preventDefault(),this.U())}W(t){t.stopPropagation(),t.button>0||this.J({x:t.clientX,y:t.clientY})}Y(t){t.stopPropagation(),this.J({x:t.touches.item(0)?.clientX??0,y:t.touches.item(0)?.clientY??0})}J(t){!(this.slides.length<2)&&this.t&&this.o&&this.h&&(this.C=!0,clearTimeout(this.k),cancelAnimationFrame(this.m),this.A=A(this.containerEl,this.h),this.F=this.A.leftDelta,this.O=this.F/this.A.parent.width*100,this.o.style.transform=`translateX(${this.O}%)`,this.o.style.transition=this.baseTransition,this.P=0,this.D=t,this.L=t,this.$=0,this.B=[],this.p&&(this.p.style.transition="none"))}Z(t,i=!1){if(this.slides.length<2||!this.C||!this.t||!this.o)return;const e=t.x-this.L.x;this.A={...this.A,leftDelta:this.A.leftDelta+e,rightDelta:this.A.rightDelta+e};const s=this.A.parent.width*this.dragLimit;r(this.B,e,5),this.L=t;const o=this.A.leftDelta>0||this.A.rightDelta<0;if(o){const t=function(t,i,e,s=.125){return t*(1-(Math.abs(i)/Math.abs(e))**s)}(e,this.$,this.A.parent.width);this.$=this.$+t}else this.$=this.$+e;let a=t.x-this.D.x,h=t.y-this.D.y,n=Math.abs(h)/Math.abs(a);if(i&&n>.85)return void this.tt();this.P=Math.abs(a/s),e<0&&(this.M="left"),e>0&&(this.M="right");const l=this.F+this.$;this.O=l/this.A.parent.width*100,this.$<0&&this.p&&(this.p.style.right="",this.p.style.left=`${this.u[this.index].offsetLeft}px`),this.$>0&&this.p&&this.l&&(this.p.style.left="",this.p.style.right=this.l.offsetWidth-(this.u[this.index].offsetLeft+this.breadcrumbDiameter)+"px"),o&&this.p?this.p.style.width=`${this.breadcrumbDiameter+Math.abs(4*this.breadcrumbDiameter*(this.O+100*this.index)/100)}px`:this.p&&(this.p.style.width=`${Math.min(2.75*this.breadcrumbDiameter,this.breadcrumbDiameter+Math.abs(4*this.breadcrumbDiameter*(this.O+100*this.index)/100))}px`),this.o.style.transform=`translateX(${this.O}%)`,this.o.style.transition=this.baseTransition}X(t){this.T({x:t.clientX,y:t.clientY},!1)}G(t){this.T({x:t.touches.item(0)?.clientX,y:t.touches.item(0)?.clientY},!0)}tt(){var t;this.C=!1,this.p?.style.setProperty("transition",""),this.o?.style.setProperty("transition",this.baseTransition),this.D={x:0,y:0},this.L={x:0,y:0},this.$=0;let i=null;switch(t=this.B,(Math.abs(t.reduce((t,i)=>t+i,0)/t.length)>this.momentumToTransition||this.P>=1)&&(this.O+100*this.index<0&&"left"===this.M&&(i="advance"),this.O+100*this.index>0&&"right"===this.M&&(i="retreat")),i){case"advance":this.m=requestAnimationFrame(()=>this.V("cubic-bezier(0.25, .25, 0.5, 1)"));break;case"retreat":this.m=requestAnimationFrame(()=>this.U("cubic-bezier(0.25, .25, 0.5, 1)"));break;default:this.m=requestAnimationFrame(()=>this.I({index:this.index}))}this.M=void 0,this.B=[]}}function A(t,i){if(!t||!i?.length)return;const e=t.getBoundingClientRect(),s=i[0].getBoundingClientRect(),o=i[i.length-1].getBoundingClientRect();return{parent:e,firstSlide:s,lastSlide:o,leftDelta:s.left-e.left,rightDelta:o.right-e.right}}class F{slides;containerEl;onSlideChange;onRequestClose;t;ht;nt;o;lt;dt=0;constructor({slides:i,containerEl:e,onSlideChange:s,onRequestClose:o}){this.slides=i,this.containerEl=e,this.onSlideChange=s,this.onRequestClose=o,this.init=this.init.bind(this),this.destroy=this.destroy.bind(this),this.t=!1,this.ht=null,this.nt=null,this.o=null,this.ct=this.ct.bind(this),this.lt=t(this.ut,200,this)}init(t=0){this.t||(this.t=!0,this.o=e({classes:O("inner"),contents:this.slides}),this.nt=e({classes:O("container"),contents:this.o??""}),this.nt&&(this.containerEl.appendChild(this.nt),this.nt.addEventListener("click",this.ct),this.nt.addEventListener("scroll",this.lt,{passive:!0})),this.I({index:t,animate:!1}))}destroy(){this.t&&(cancelAnimationFrame(this.dt),this.t=!1,this.nt&&(this.nt.removeEventListener("click",this.ct),this.nt.removeEventListener("scroll",this.lt),this.nt.remove()),this.nt=null,this.o=null)}ut(){a(this.slides).then(t=>{t&&this.ht!==t&&(this.ht=t,this.onSlideChange&&this.onSlideChange(this.ht))})}ct(t){t.target===this.nt&&this.onRequestClose&&this.onRequestClose()}I({index:t,animate:i=!0}){cancelAnimationFrame(this.dt),this.slides?.[t]&&(this.ht=t,this.onSlideChange&&this.onSlideChange(this.ht),this.dt=requestAnimationFrame(()=>{const e=this.slides[t].offsetTop;this.nt?.scrollTo({top:e-10,behavior:i?"smooth":"instant"})}))}}function O(t){return"behold-ps-"+t}var P='<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">\n<path fill-rule="evenodd" clip-rule="evenodd" fill="#FFFFFF" d="M4.4,7.3C4.2,7.3,4,7.5,4,7.7v4.6c0,0.2,0.2,0.4,0.4,0.4h2.2\n\tl3.2,3.2c0.2,0.2,0.6,0.1,0.6-0.2v-2.4c0-0.1-0.1-0.2-0.1-0.3L4.8,7.4C4.7,7.4,4.6,7.3,4.5,7.3C4.5,7.3,4.4,7.3,4.4,7.3z M16.1,15.2\n\tl-1.4-1.4c0.5-0.7,1.3-1.9,1.3-3.8c0-2.8-1.8-4.3-1.8-4.3c-0.1-0.2-0.4-0.2-0.6,0L13.3,6c-0.1,0.2-0.1,0.4,0,0.6\n\tc0,0,1.4,1.2,1.4,3.4c0,1.4-0.5,2.3-0.9,2.9L12.9,12c0.3-0.4,0.6-1.1,0.6-2c0-1.7-1-2.6-1-2.6c-0.1-0.2-0.4-0.2-0.6,0l-0.4,0.3\n\tc-0.1,0.2-0.1,0.4,0,0.6c0,0,0.7,0.5,0.7,1.7c0,0.4-0.1,0.8-0.2,1.1l-1.6-1.6V4.3c0-0.3-0.4-0.5-0.6-0.2L7.4,6.5L4.8,3.9\n\tc-0.1-0.1-0.4-0.1-0.5,0L4,4.3C3.8,4.4,3.8,4.7,4,4.8l1,1.1l6.7,6.7l3.5,3.5c0.1,0.1,0.4,0.1,0.5,0l0.4-0.4\n\tC16.2,15.6,16.2,15.3,16.1,15.2z"/>\n</svg>',$='<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">\n<path fill="#FFFFFF" d="M12.5,7.3c-0.3-0.4-0.8-0.4-1.1-0.2C11,7.4,11,7.9,11.2,8.3l0,0c0.4,0.5,0.6,1.1,0.6,1.7\n\tc0,0.6-0.2,1.2-0.6,1.7c-0.3,0.4-0.2,0.9,0.1,1.1c0.4,0.3,0.9,0.2,1.1-0.1c0,0,0,0,0,0c0.6-0.8,0.9-1.7,0.9-2.7\n\tC13.4,9,13.1,8.1,12.5,7.3z M14.6,6c-0.3-0.4-0.8-0.4-1.1-0.1C13.1,6.2,13,6.7,13.3,7c0,0,0,0,0,0c0.7,0.8,1.1,1.9,1.1,3\n\tc0,1.1-0.4,2.1-1.1,3c-0.3,0.4-0.2,0.9,0.1,1.1c0.3,0.3,0.8,0.2,1.1-0.1c0.9-1.1,1.4-2.5,1.4-4C16,8.5,15.5,7.1,14.6,6z M9.7,4\n\tC9.5,4,9.2,4,9.1,4.1L6.3,6.7H4.5C4.2,6.7,4,7,4,7.3v5.5c0,0.3,0.2,0.5,0.5,0.5h1.8l2.7,2.6l0,0c0.2,0.2,0.6,0.2,0.8,0\n\tc0.1-0.1,0.2-0.3,0.2-0.4l0-10.8C10,4.3,9.9,4.1,9.7,4z"/>\n</svg>';class B extends h{label="PopoverSlideVideo";bt;gt;vt;mayPlay=!1;post;constructor(){super(),b.register(),m.register(),this.xt=this.xt.bind(this),this.ft=this.ft.bind(this),this._t=this._t.bind(this),this.yt=this.yt.bind(this),this.wt=this.wt.bind(this),this.kt=this.kt.bind(this),this.preload=this.preload.bind(this),this.onGlobalStateChange(this.Ct),this.onConnect(()=>{this.post?.mediaUrl?(this.bt=e({type:"behold-video",classes:"video",props:{mediaUrl:this.post.mediaUrl,sizes:this.post.sizes,renderPlaceholder:!0},listeners:{click:this.yt,load:this.xt,play:this.ft,pause:this._t}}),this.vt=e({type:"button",classes:"video-mute video-mute--visible",contents:this.globalState.isMuted?P:$,listeners:{click:this.wt},attributes:{"aria-label":this.globalState.isMuted?"unmute":"mute"}}),this.globalState.isMuted?this.bt.mute():this.bt.unmute(),this.classList.add("video-container","video-container--paused"),this.replaceChildren(this.bt,this.vt)):this.post&&(this.gt=e({type:"behold-image",props:{sizes:this.post.sizes,mediaUrl:this.post.thumbnailUrl,aspectRatio:this.post.sizes.full.width/this.post.sizes.full.height},listeners:{load:this.xt}}),this.replaceChildren(this.gt)),this.onLoop(this.kt)})}Ct({changedProps:t,newState:i}){t.includes("isMuted")&&this.bt&&this.vt&&(i.isMuted?(this.bt.mute(),this.vt.innerHTML=P):(this.bt.unmute(),this.vt.innerHTML=$))}xt(){this.dispatchEvent(new Event("load")),this.classList.add("is-loaded")}kt(){this.bt&&(this.globalState.playPopoverVideos&&this.mayPlay&&!this.bt.isPlaying?this.bt.play():this.globalState.playPopoverVideos&&this.mayPlay||!this.bt.isPlaying||this.bt.pause())}ft(){this.classList.remove("video-container--paused")}_t(){this.classList.add("video-container--paused")}yt(){this.globalState.playPopoverVideos?this.updateGlobalState({playPopoverVideos:!1}):this.updateGlobalState({playPopoverVideos:!0})}wt(){this.bt&&(this.bt.muted?this.updateGlobalState({isMuted:!1}):this.updateGlobalState({isMuted:!0}))}preload(){this.bt?.preload()}static register(t="behold-popover-slide-video"){return customElements.get(t)||customElements.define(t,B),t}}class R extends h{label="PopoverSlideAlbum";Et;zt;St=[];Mt;Dt;Lt;At;Ft=!1;currentSlideIndex=0;mayPlay=!1;post;useDynamicBackground=!0;constructor(){super(),this.onPropChange(()=>{},["post","useDynamicBackground"]),m.register(),B.register(),this.Ot=this.Ot.bind(this),this.Pt=this.Pt.bind(this),this.kt=this.kt.bind(this),this.preload=this.preload.bind(this),this.onConnect(()=>{this.St=this.$t();const t=this.post?.children?.[0]?.sizes?.full.mediaUrl||this.post?.children?.[0]?.thumbnailUrl,i=t?n(t,"original"):"",s=this.post?.sizes?.full?.uncropped?.height?`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' width='${this.post.sizes?.full?.uncropped?.width}' height='${this.post.sizes?.full?.uncropped?.height}'%3E%3C/svg%3E%0A`:i??null;this.post?.mediaUrlIsVideo&&!s?this.zt=e({type:"video",classes:"slide__carousel-spaceholder",attributes:{src:this.post.mediaUrl,height:this.post.sizes?.full?.uncropped?.height??100,width:this.post.sizes?.full?.uncropped?.width??100},props:{muted:!0}}):this.zt=e({type:"img",classes:"slide__carousel-spaceholder",attributes:{src:s,height:this.post?.sizes?.full?.uncropped?.height??100,width:this.post?.sizes?.full?.uncropped?.width??100}}),this.Mt=e({type:"button",classes:"slide__carousel-previous",attributes:{"aria-label":"Previous album slide"},contents:v}),this.Dt=e({type:"button",classes:"slide__carousel-next",attributes:{"aria-label":"Next album slide"},contents:x}),this.Lt=e({classes:"slide__carousel-breadcrumbs"}),this.Et=e({classes:"slide__carousel",contents:[...this.St,this.Mt,this.Dt,this.Lt]}),this.replaceChildren(this.zt,this.Et),this.At=new L({slides:this.St,containerEl:this.Et,keyboardNav:!1,breadcrumbsContainerEl:this.Lt,dynamicBreadCrumbsCutoff:7,previousEl:this.Mt,nextEl:this.Dt,onSlideChange:this.Ot,virtualize:!0,proximalSlidesToRender:2,dragLimit:.6}),this.onIntersection(this,this.Pt),this.onLoop(this.kt)}),this.onDisconnect(()=>{this.At?.destroy(),this.At=void 0})}kt(){if(this.St)for(let t=0;t<this.St.length;t++){const i=this.St[t];T(i)&&(t===this.currentSlideIndex?i.mayPlay!==this.mayPlay&&(i.mayPlay=this.mayPlay):i.mayPlay&&(i.mayPlay=!1))}}Bt(){M({include:[this.St[this.currentSlideIndex]],exclude:this.St.filter((t,i)=>i!==this.currentSlideIndex),merge:!0})}Pt(t){t.isIntersecting&&this.At?.init(0)}Ot(t,i=!1){t!==this.currentSlideIndex&&this.globalState.keyboardNavEnabled&&l(`Slide ${t+1} of ${this.St.length} in Album`),this.currentSlideIndex=t,[t-2,t-1,t+1,t+2].forEach(t=>this.St[t]?.preload()),this.Bt(),!i&&this.useDynamicBackground&&this.Rt(t)}Rt(t){const i=g(this.post?.children[t].colorPalette?.dominant||"100,100,100");this.style.backgroundColor=`hsl(${i[0]} ${Math.min(i[1],35)}% ${Math.min(i[2],13)}%)`;const e=g(this.post?.children[t].colorPalette?.dominant||"255,255,255"),s=`hsl(${e[0]} ${e[1]}% ${Math.max(e[2],50)}%)`;this.style.setProperty("--uib-color",s),this.updateGlobalState({popoverOverlayHslArray:i})}$t(){return this.post?.children?this.post.children.map(t=>{let i=null;switch(t.mediaType){case"IMAGE":i=e({type:"behold-image",classes:"slide__carousel-slide",props:{sizes:t.sizes,mediaUrl:t.mediaUrl,showLoader:!0,useOriginalAspectRatio:!0,aspectRatio:(t.sizes.full.uncropped?.width??t.sizes.full.width)/(t.sizes.full.uncropped?.height??t.sizes.full.height)}});break;case"VIDEO":i=e({type:"behold-popover-slide-video",classes:"slide__carousel-slide",props:{post:t}})}return i}):[]}preload(){this.St?.[0]?.preload()}static register(t="behold-popover-slide-album"){return customElements.get(t)||customElements.define(t,R),t}}const T=t=>"BEHOLD-POPOVER-SLIDE-VIDEO"===t?.tagName;var j='<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">\n<g>\n\t<path fill="#262626" d="M13.8,5.9H3.2c-0.4,0-0.7-0.3-0.7-0.7s0.3-0.7,0.7-0.7h10.6c0.4,0,0.7,0.3,0.7,0.7S14.1,5.9,13.8,5.9z"/>\n</g>\n<g>\n\t<path fill="#262626" d="M12.8,10.8H2.2c-0.4,0-0.7-0.3-0.7-0.7s0.3-0.7,0.7-0.7h10.6c0.4,0,0.7,0.3,0.7,0.7S13.2,10.8,12.8,10.8z"\n\t\t/>\n</g>\n<g>\n\t<path fill="#262626" d="M8.9,15.3c0,0-0.1,0-0.1,0c-0.4-0.1-0.6-0.4-0.5-0.8l2.4-13.3c0.1-0.4,0.4-0.6,0.8-0.5\n\t\tc0.4,0.1,0.6,0.4,0.5,0.8L9.6,14.8C9.5,15.1,9.2,15.3,8.9,15.3z"/>\n</g>\n<g>\n\t<path fill="#262626" d="M4.7,15.3c0,0-0.1,0-0.1,0c-0.4-0.1-0.6-0.4-0.5-0.8L6.4,1.2c0.1-0.4,0.4-0.6,0.8-0.5\n\t\tc0.4,0.1,0.6,0.4,0.5,0.8L5.3,14.8C5.3,15.1,5,15.3,4.7,15.3z"/>\n</g>\n</svg>';class I extends h{label="PopoverGallerySlide";o;Tt;jt="";It;Ut;Vt;Ht;Nt;qt;Xt;Gt;post;feedMetadata;widgetSettings;constructor(){super(),this.onPropChange(this.Zt,["post","feedMetadata","widgetSettings"]),m.register(),B.register(),R.register(),this.expandCaption=this.expandCaption.bind(this),this.preload=this.preload.bind(this),this.onConnect(()=>{this.render()})}render(){if(this.classList.remove("is-loaded"),!this.post)return;const t=g(this.post.children?.[0]?.colorPalette?.dominant??this.post.colorPalette?.dominant??"100,100,100"),i=`hsl(${t[0]} ${Math.min(t[1],35)}% ${Math.min(t[2],13)}%)`,s=g(this.post.colorPalette?.dominant||"255,255,255"),r=`hsl(${s[0]} ${s[1]}% ${Math.max(s[2],50)}%)`;switch(this.style.setProperty("--uib-color",r),this.post?.mediaType){case"VIDEO":this.Xt=e({type:"behold-popover-slide-video",classes:"slide__media",style:{backgroundColor:i},props:{post:this.post}});break;case"CAROUSEL_ALBUM":this.Xt=e({type:"behold-popover-slide-album",classes:"slide__media",style:{backgroundColor:i},props:{post:this.post,useDynamicBackground:!this.widgetSettings?.popupUseCustomOverlayColor,aspectRatio:(this.post.sizes.full?.uncropped?.width??this.post.sizes.full.width)/(this.post.sizes.full?.uncropped?.height??this.post.sizes.full.height)}});break;default:this.Xt=e({type:"behold-image",classes:"slide__media",style:{backgroundColor:i},props:{sizes:this.post.sizes,mediaUrl:this.post.mediaUrl,showLoader:!0,useOriginalAspectRatio:!0,aspectRatio:(this.post.sizes.full?.uncropped?.width??this.post.sizes.full.width)/(this.post.sizes.full?.uncropped?.height??this.post.sizes.full.height)}})}this.Tt=this.feedMetadata?.profilePictureUrl?e({type:"img",attributes:{src:this.feedMetadata.profilePictureUrl}}):void 0,this.jt="@"+this.feedMetadata?.username,this.feedMetadata?.hashtags?.length&&(this.Tt=j,this.jt=this.feedMetadata.hashtags.join(", ")),this.It=this.Tt?e({classes:"slide__avatar",contents:this.Tt,attributes:{"aria-label":this.feedMetadata?.hashtags?"hashtags":"username"}}):void 0,this.Ut=e({classes:"slide__header",contents:[this.It,this.jt]}),this.Vt=this.post?.caption?.trim()?.length?e({classes:"slide__caption",contents:this.post.caption}):void 0;const a=this.widgetSettings?.popupFooterLinkText?.length?this.widgetSettings?.popupFooterLinkText:"Go to post",h=this.widgetSettings?.popupFooterLinkUrl?.length?this.widgetSettings?.popupFooterLinkUrl:this.post.permalink;this.Ht=this.post.permalink&&!1!==this.widgetSettings?.popupShowLink?e({type:"a",attributes:{href:h,target:"_blank"},classes:"slide__footer-link",contents:[a,'<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">\n<g>\n\t<path d="M16,19.8H4c-2.1,0-3.8-1.7-3.8-3.8V4c0-2.1,1.7-3.8,3.8-3.8h12c2.1,0,3.8,1.7,3.8,3.8v12C19.8,18.1,18.1,19.8,16,19.8z\n\t\t M4,1.8c-1.2,0-2.2,1-2.2,2.2v12c0,1.2,1,2.2,2.2,2.2h12c1.2,0,2.2-1,2.2-2.2V4c0-1.2-1-2.2-2.2-2.2H4z"/>\n</g>\n<path d="M14.4,5.6v7.5h-1.5V8.2l-6,6l-1.1-1.1l6-6H6.9V5.6H14.4z"/>\n</svg>']}):"",this.Nt=e({classes:"slide__footer",contents:[this.Ht]}),this.qt=e({classes:"slide__text",contents:[this.Ut,this.Vt,this.Nt]}),this.o=e({classes:"slide__inner",contents:[this.Xt,this.qt]}),this.Gt=e({type:"button",classes:"slide__more",contents:"… more",listeners:{click:this.expandCaption}}),this.replaceChildren(this.o),o(),this.to(()=>{this.classList.add("is-loaded")},10,"onConnect")}Zt({changedProp:t,newValue:i}){switch(t){case"feedMetadata":if(!this.isConnected||!i)return;this.jt="@"+i.username,i.hashtags?.length?(this.Tt=j,this.jt=i.hashtags.join(", ")):this.Tt=i?.profilePictureUrl?e({type:"img",attributes:{src:i.profilePictureUrl}}):void 0,this.It=this.Tt?e({classes:"slide__avatar",contents:this.Tt,attributes:{"aria-label":i.hashtags?"hashtags":"username"}}):void 0,this.Ut=e({classes:"slide__header",contents:[this.It,this.jt]});break;case"post":this.Xt||this.render(),"IMAGE"===i?.mediaType&&this.Xt?Object.assign(this.Xt,{sizes:i.sizes,mediaUrl:i.mediaUrl,showLoader:!0}):this.Xt&&(U(this.Xt)||(this.Xt.post=i))}}activate(){this.post?.mediaType&&"VIDEO,CAROUSEL_ALBUM".includes(this.post?.mediaType)&&this.Xt&&(this.Xt.mayPlay=!0)}deactivate(){this.post?.mediaType&&"VIDEO,CAROUSEL_ALBUM".includes(this.post?.mediaType)&&this.Xt&&(this.Xt.mayPlay=!1)}preload(){this.Xt?.preload()}getBackgroundColor(){let t=this.post;if("CAROUSEL_ALBUM"===this.post?.mediaType){const i=this.Xt;t=this.post?.children?.[i?.currentSlideIndex??0]}return g(t?.colorPalette?.dominant||"100,100,100")}expandCaption(){this.Vt&&(this.Vt.style.transition="",this.Vt.style.height=this.Vt.offsetHeight+"px",this.Vt.innerHTML=this.post?.caption||"",o(),this.raf(()=>{this.Vt&&(this.Vt.style.transition="height .3s ease",this.Vt.style.height=this.Vt.scrollHeight+"px",this.to(()=>{this.Vt&&(this.Vt.style.transition="",this.Vt.style.height="")},300,"expandCaption"))},"expandCaption"))}collapseCaption(){if(this.Vt){const t=d({text:this.post?.caption,maxChars:120,maxLines:4});this.Vt.innerHTML=t??"",t&&this.post?.caption&&t.length<this.post.caption.length&&this.Gt&&this.Vt.appendChild(this.Gt)}}static register(t="behold-popover-gallery-slide"){return customElements.get(t)||customElements.define(t,I),t}}const U=t=>"BEHOLD-IMAGE"===t.tagName;class V extends h{label="PopoverGallery";posts=[];widgetSettings;feedMetadata;closeFocusEl=document.body;onSlideChange=()=>{};Kt;Wt=900;Yt;Jt;Qt;ti;Mt;Dt;ii;ei;o;si;oi;ri;ai=0;hi="";ni="";constructor(){super(),this.Yt=this.attachShadow({mode:"open"}),this.Kt=!1,this.onPropChange(this.Zt,["posts","widgetSettings","feedMetadata"]),I.register(),this.Ot=this.Ot.bind(this),this.li=this.li.bind(this),this.di=this.di.bind(this),this.onGlobalStateChange(this.Ct),this.onConnect(()=>{s(this,{"theme--light":"light"===this.widgetSettings?.popupColorTheme,"theme--dark":"dark"===this.widgetSettings?.popupColorTheme,"theme--auto":"auto"===this.widgetSettings?.popupColorTheme,"keyboard-nav":this.globalState.keyboardNavEnabled}),this.ti=e({classes:"overlay",listeners:{click:this.li}}),this.Mt=e({type:"button",classes:"previous",attributes:{"aria-label":"Previous post"},contents:v}),this.Dt=e({type:"button",classes:"next",attributes:{"aria-label":"Next post"},contents:x}),this.ii=e({type:"button",classes:"close",contents:'<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">\n<path fill-rule="evenodd" clip-rule="evenodd" fill="#081B10" d="M11.6,10.1l5.5-5.7c0.5-0.5,0.5-1.1,0-1.6c-0.5-0.5-1.1-0.5-1.6,0\n\tl-5.5,5.6L4.4,2.8C4,2.4,3.3,2.4,2.8,2.8S2.4,4,2.8,4.4L8.4,10l-5.5,5.6c-0.5,0.5-0.5,1.1,0,1.6c0.5,0.5,1.1,0.5,1.6,0l5.5-5.6\n\tl5.5,5.6c0.5,0.5,1.1,0.5,1.6,0c0.5-0.5,0.5-1.1,0-1.6C17,15.6,11.6,10.1,11.6,10.1z"/>\n</svg>',attributes:{"aria-label":"Close"},listeners:{click:t=>{t.preventDefault(),this.li()}}}),this.ei=e({classes:"breadcrumbs"}),this.si=this.posts.map(t=>{const i=document.createElement("behold-popover-gallery-slide");return i.post=t,this.feedMetadata&&(i.feedMetadata=this.feedMetadata),this.widgetSettings&&(i.widgetSettings=this.widgetSettings),i}),this.o=e({classes:"inner",contents:this.si}),this.Jt=document.createDocumentFragment(),this.Jt.replaceChildren(this.ti,this.o,this.ei,this.Mt,this.Dt,this.ii),this.Qt=e({type:"style",contents:[':host{--icon-play:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 35 35\' xml:space=\'preserve\'%3E%3Cpath fill=\'%23FFF\' d=\'M28.4 14.9 9.5 4.2C7.5 3.1 5 4.6 5 6.8v21.3c0 2.3 2.5 3.7 4.5 2.6l19-10.7c2-1 2-4-.1-5.1z\'/%3E%3C/svg%3E");--icon-gallery:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 35 35\' xml:space=\'preserve\'%3E%3Cpath fill=\'%23FFF\' d=\'M27.3 22.7v-17c0-2.6-2.1-4.7-4.7-4.7H5.7C3.1 1 1 3.1 1 5.7v17c0 2.6 2.1 4.7 4.7 4.7h17c2.5-.1 4.6-2.2 4.6-4.7zm4-13.4v14.6c0 4.1-3.4 7.4-7.4 7.4H9.2c-.5 0-.8.6-.5 1 .9 1 2.2 1.6 3.7 1.6h12.1c5.2 0 9.3-4.2 9.3-9.3V12.5c0-1.5-.6-2.8-1.6-3.7-.3-.4-.9 0-.9.5z\'/%3E%3C/svg%3E");--bottomPadding:60px;--height:min(calc(100vh - 160px - var(--pg-border-width, 0px)*2),1400px);--width:calc(100% - 120px - var(--pg-border-width, 0px)*2);--text-width:400px;--text-color:#262626;--text-background:#fff;--text-size:15px;--border-color:#ededed;--ease-out-back:cubic-bezier(0.085,1.735,0.285,0.995);align-items:center;box-sizing:border-box;height:100vh;justify-content:flex-start;left:0;overflow:hidden;pointer-events:none;position:fixed;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:99999}:host *{box-sizing:border-box}@media (max-width:1200px){:host{--text-width:300px;--text-size:13px}}:host(.is-scroller){--text-width:100%;--height:auto;--width:calc(100vw - 40px - var(--ps-border-width, 0px)*2)}@media (prefers-color-scheme:dark){:host(.theme--auto){--text-color:#f2f2f2;--text-background:#1a1a1a;--border-color:#292929}}:host(.theme--dark){--text-color:#f2f2f2;--text-background:#1a1a1a;--border-color:#292929}:host(.is-visible){pointer-events:all}.overlay{background-color:rgba(0,0,0,.6);display:block;height:100%;left:0;opacity:0;pointer-events:none;position:absolute;top:0;transition:all .3s ease;width:100%;will-change:opacity,background-color}@media (min-width:901px){.overlay{backdrop-filter:blur(6px)}}:host(.is-visible) .overlay{opacity:1;pointer-events:all}.inner{display:flex;height:calc(100% - var(--bottomPadding));justify-content:center;pointer-events:none;position:relative;width:100%;z-index:1}:host(.is-scroller) .inner{height:100%}behold-popover-gallery-slide{align-items:center;display:flex;flex-grow:0;flex-shrink:0;height:calc(100% - var(--bottomPadding));justify-content:center;margin:0;opacity:0;padding:0;pointer-events:none;transform:scale(.99);transition:transform .2s ease-out,opacity .2s ease-out;width:100%}@media (min-width:901px){behold-popover-gallery-slide:active{cursor:grabbing}}@media (prefers-reduced-motion){behold-popover-gallery-slide{transform:none;transition:none}}:host(.is-visible) behold-popover-gallery-slide.is-loaded{opacity:1;transform:none}:host(.is-scroller) behold-popover-gallery-slide{height:auto;margin-top:calc(var(--ps-border-width, 0px)*2 + 10px)}.slide__inner{align-items:center;background-color:var(--text-background);border-radius:var(--pg-border-radius,0);box-shadow:0 0 0 var(--pg-border-width,0) var(--pg-border-color,"#000");display:flex;justify-content:center;max-height:var(--height);max-width:var(--width);overflow:hidden;pointer-events:all;position:relative}:host(.is-scroller) .slide__inner{border-radius:var(--ps-border-radius,0);box-shadow:0 0 0 var(--ps-border-width,0) var(--pg-border-color,"#000");flex-direction:column}.slide__media{align-items:center;display:flex;flex-shrink:1;height:var(--height);justify-content:center;max-height:var(--height);overflow:hidden;position:relative;transition:background-color .3s ease;z-index:1}:host(.is-scroller) .slide__media{min-width:100%}behold-image img,behold-image video,behold-video img,behold-video video{max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain;-o-object-position:center center;object-position:center center;opacity:0;position:relative;width:auto;z-index:1}.behold-ps-container behold-image img,.behold-ps-container behold-image video,.behold-ps-container behold-video img,.behold-ps-container behold-video video{height:auto;width:100%}behold-image{min-height:10px;min-width:10px;pointer-events:none;position:relative}@supports (aspect-ratio:1/1){behold-image img{min-height:100%;min-width:100%}}behold-image.is-loaded img{opacity:1;transition:opacity .4s ease}.slide__carousel{height:100%;left:0;position:absolute;top:0;width:100%}.slide__carousel:before{background:linear-gradient(0deg,rgba(0,0,0,.4),transparent);bottom:0;height:60px;left:0;width:100%;z-index:1}.slide__carousel:after,.slide__carousel:before{content:"";pointer-events:none;position:absolute;transform:translateZ(0)}.slide__carousel:after{background:var(--icon-gallery);height:20px;left:20px;opacity:.75;top:20px;width:20px;z-index:2}:host(.is-scroller) .slide__carousel:after{left:auto;right:15px;top:15px}:host(:not(.is-scroller).pg-medium-border-radius) .slide__carousel:after{left:30px;top:30px}:host(:not(.is-scroller).pg-large-border-radius) .slide__carousel:after{left:40px;top:40px}:host(.is-scroller.ps-medium-border-radius) .slide__carousel:after{right:30px;top:30px}:host(.is-scroller.ps-large-border-radius) .slide__carousel:after{right:40px;top:40px}img.slide__carousel-spaceholder,video.slide__carousel-spaceholder{height:auto;max-height:100%;opacity:0;pointer-events:none;visibility:hidden;width:auto}.behold-ps-container img.slide__carousel-spaceholder,.behold-ps-container video.slide__carousel-spaceholder{max-width:100%}.slide__carousel-breadcrumbs{bottom:30px;height:10px;left:50%;position:absolute;transform:translateX(-50%);z-index:2}:host(.is-scroller) .slide__carousel-breadcrumbs{bottom:10px}.slide__carousel-next,.slide__carousel-previous{align-items:center;background-color:hsla(0,0%,100%,.95);border:none;border-radius:50%;box-shadow:0 0 10px rgba(0,0,0,.2);display:flex;height:30px;justify-content:center;opacity:.75;outline:none;position:absolute;top:50%;touch-action:manipulation;transform:translateY(-50%) translateZ(0);transition:opacity .3s ease;width:30px;z-index:2}:host(.keyboard-nav) .slide__carousel-next:focus,:host(.keyboard-nav) .slide__carousel-previous:focus{background-color:#000;box-shadow:0 0 10px rgba(0,0,0,.2),0 0 0 2px #4169e1,0 0 0 3px #fff;opacity:1}:host(.keyboard-nav) .slide__carousel-next:focus svg path,:host(.keyboard-nav) .slide__carousel-previous:focus svg path{fill:#fff}.slide__carousel-next:not(:disabled),.slide__carousel-previous:not(:disabled){cursor:pointer}.slide__carousel-next:not(:disabled):hover,.slide__carousel-previous:not(:disabled):hover{opacity:1}.slide__carousel-next:disabled,.slide__carousel-previous:disabled{opacity:.25}.slide__carousel-next:before,.slide__carousel-previous:before{content:"";height:60px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:60px}.slide__carousel-next svg,.slide__carousel-previous svg{height:12px;position:absolute;width:12px}.slide__carousel-next svg path,.slide__carousel-previous svg path{fill:#000}:host(.is-scroller) .slide__carousel-next,:host(.is-scroller) .slide__carousel-previous{background-color:transparent;box-shadow:none;height:20px;width:20px}:host(.is-scroller) .slide__carousel-next svg path,:host(.is-scroller) .slide__carousel-previous svg path{fill:#fff}.slide__carousel-previous{left:20px}.slide__carousel-previous svg{transform:translateX(-1px)}:host(.is-scroller) .slide__carousel-previous{left:10px}.slide__carousel-next{right:20px}.slide__carousel-next svg{transform:translateX(1px)}:host(.is-scroller) .slide__carousel-next{right:10px}.slide__carousel-slide{cursor:grab;display:flex;height:var(--height);overflow:hidden;width:auto}.slide__carousel-slide:active{cursor:grabbing}.slide__carousel-slide-media{height:auto;max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain;pointer-events:none;width:auto}.video-container{align-items:center;cursor:pointer;display:flex;height:var(--height);justify-content:center;overflow:hidden;position:relative;width:100%}.video-container:after{background:var(--icon-play);content:"";filter:drop-shadow(1px 1px 1px rgba(0,0,0,.1));height:80px;left:calc(50% - 40px);opacity:0;pointer-events:none;position:absolute;top:calc(50% - 40px);transform:scale(.5);transition:all .15s ease;width:80px;z-index:2}.video-container.video-container--paused:after{opacity:.8;transform:none;transition:opacity .2s ease,transform .3s var(--ease-out-back)}.video-container:active{cursor:grabbing}behold-video{align-items:center;display:flex;height:100%;width:100%}behold-video.is-loaded video{opacity:1;transition:opacity .4s ease}.video-mute{align-items:center;background:transparent;border:none;bottom:0;cursor:pointer;display:flex;height:60px;justify-content:center;margin:0;opacity:0;outline:none;padding:0;position:absolute;right:0;transform:translateZ(0);transition:opacity .1s ease;width:60px;z-index:2}.video-mute.video-mute--visible{opacity:1;transition:opacity .2s ease .2s}.video-mute:before{background-color:rgba(0,0,0,.5);border-radius:50%;content:"";height:28px;left:calc(50% - 14px);position:absolute;top:calc(50% - 14px);width:28px}:host(.keyboard-nav) .video-mute:focus:before{background-color:#000;box-shadow:0 0 10px rgba(0,0,0,.2),0 0 0 2px #4169e1,0 0 0 4px #fff}.video-mute svg{height:20px;left:calc(50% - 10px);position:absolute;top:calc(50% - 10px);width:20px}.slide__text{align-items:stretch;box-shadow:-1px 0 0 var(--border-color);color:var(--text-color);display:flex;flex-direction:column;flex-shrink:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;font-size:var(--text-size);font-weight:400;height:var(--height);justify-content:flex-start;pointer-events:none;position:relative;transform:translateZ(0);width:var(--text-width);z-index:1}.slide__header{align-items:center;border-bottom:1px solid var(--border-color);display:flex;font-weight:600;line-height:1.25;padding:30px}@media (prefers-color-scheme:dark){.theme--auto .slide__header{border-color:#292929}}.slide__header.theme--dark{border-color:#292929}@media (max-width:1200px){.slide__header{padding:20px}}.slide__avatar{align-items:center;border-radius:50%;display:flex;flex-shrink:0;height:42px;justify-content:center;margin-right:10px;overflow:hidden;position:relative;width:42px}.slide__avatar:dir(rtl){margin-right:0;margin-inline-end:10px}.slide__avatar:before{background:radial-gradient(circle farthest-corner at 32% 106%,#ffe17d 0,#ffcd69 10%,#fa9137 28%,#eb4141 42%,transparent 82%),linear-gradient(135deg,#c33cbe 12%,#c33cbe 58%);height:100%;left:0;top:0;width:100%}.slide__avatar:after,.slide__avatar:before{border-radius:50%;content:"";position:absolute}.slide__avatar:after{background-color:var(--text-background);height:calc(100% - 4px);left:2px;top:2px;width:calc(100% - 4px)}@media (prefers-color-scheme:dark){.theme--auto .slide__avatar{background-color:#333}}.slide__avatar.theme--dark{background-color:#333}.slide__avatar img{border-radius:50%;height:calc(100% - 8px);position:relative;width:calc(100% - 8px);z-index:1}.slide__avatar svg{height:15px;position:relative;width:15px;z-index:1}.slide__avatar svg path{fill:var(--text-color)}:host(.is-scroller) .slide__avatar{height:32px;width:32px}:host(.is-scroller) .slide__avatar svg{height:12px;width:12px}.slide__caption{line-height:1.5;overflow:auto;padding:30px;scrollbar-width:none;white-space:pre-wrap;word-break:break-word}:host(.is-visible) .slide__caption{pointer-events:all}.slide__caption::-webkit-scrollbar{width:0!important}:host(.is-scroller) .slide__caption{overflow:hidden}.slide__more{background:transparent;border:none;color:var(--text-color);cursor:pointer;margin:0;opacity:.75;padding:0}.slide__more:hover{opacity:1;text-decoration:underline}.slide__footer{border-top:1px solid var(--border-color);margin-top:auto}:host(.is-visible) .slide__footer{pointer-events:all}.slide__footer-link{align-items:center;color:var(--text-color);cursor:pointer;display:flex;font-size:.9333em;font-weight:600;gap:20px;padding:30px;text-decoration:none;transition:background .3s ease}:host(.keyboard-nav) .slide__footer-link:focus{background-color:var(--border-color);border:none;box-shadow:inset 0 0 0 1px #fff,inset 0 0 0 3px #4169e1;outline:none;transition:background .1s ease}.slide__footer-link:hover{background-color:var(--border-color)}.slide__footer-link svg{flex-shrink:0;height:17px;margin-left:auto;width:17px}.slide__footer-link svg:dir(rtl){margin-left:0;margin-inline-start:auto}.slide__footer-link svg path{fill:var(--text-color)}@media (max-width:1200px){.slide__footer-link{padding:20px}}:host(:not(.is-scroller).pg-medium-border-radius) .slide__footer-link{padding-right:45px}:host(:not(.is-scroller).pg-large-border-radius) .slide__footer-link{padding-right:65px}:host(.is-scroller.ps-medium-border-radius) .slide__footer-link{padding:20px 75px}:host(.is-scroller.ps-large-border-radius) .slide__footer-link{padding:20px 75px}.breadcrumbs{align-items:center;bottom:calc(var(--bottomPadding)/2 + 30px - (var(--breadCrumbDiameter) + 10px)/2);display:flex;gap:calc(var(--breadCrumbDiameter)*.75);height:calc(var(--breadCrumbDiameter) + 10px);justify-content:center;left:50%;opacity:0;position:absolute;transform:translateX(-50%);width:auto;z-index:2}:host(.is-visible) .breadcrumbs{opacity:1}.breadcrumbs-current,.breadcrumbs-current:empty{background-color:#fff;border-radius:calc(var(--breadCrumbDiameter)/2);display:block;height:var(--breadCrumbDiameter);position:absolute;top:5px;transition:width .3s ease;width:var(--breadCrumbDiameter);will-change:left,right,width}.breadcrumb,.breadcrumb:empty{background-color:hsla(0,0%,100%,.4);border-radius:50%;cursor:pointer;display:block;height:7px;transition:all .3s ease;width:7px}.breadcrumb:empty:hover,.breadcrumb:hover{background-color:#fff}.close{align-items:center;background:none;border:none;cursor:pointer;display:flex;height:30px;justify-content:center;margin:0;opacity:0;padding:0;position:absolute;right:15px;top:15px;width:30px;z-index:2}:host(.is-visible) .close{opacity:.75;transition:opacity .3s ease}:host(.is-visible) .close:hover{opacity:1}:host(.keyboard-nav) .close:focus{box-shadow:0 0 0 2px #4169e1,0 0 0 3px #fff;opacity:1}.close:focus{border:none;outline:none}.close:before{content:"";height:60px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:60px}.close svg{height:20px;width:20px}.close svg path{fill:#fff}:host(.is-scroller) .close{background-color:hsla(0,0%,97%,.85);border-radius:50%;opacity:1;right:5px;top:5px}:host(.is-scroller) .close svg{height:14px;width:14px}:host(.is-scroller) .close svg path{fill:#000}.next,.previous{align-items:center;background:none;border:none;cursor:pointer;display:flex;height:60px;justify-content:center;margin:0;opacity:0;padding:0;position:absolute;top:calc(50% - var(--bottomPadding)/2);touch-action:manipulation;transform:translateY(-50%);width:60px;z-index:2}:host(.is-visible) .next,:host(.is-visible) .previous{opacity:.75;transition:opacity .3s ease}:host(.is-visible) .next:focus,:host(.is-visible) .previous:focus{border:none;outline:none}:host(.is-visible) .next:hover,:host(.is-visible) .previous:hover{opacity:1}:host(.is-visible) .next:disabled,:host(.is-visible) .previous:disabled{cursor:default;opacity:.15}:host(.is-visible) .next:disabled:hover,:host(.is-visible) .previous:disabled:hover{opacity:.15}:host(.keyboard-nav) .next:focus,:host(.keyboard-nav) .previous:focus{box-shadow:0 0 0 2px #4169e1,0 0 0 3px #fff;opacity:1}.next svg,.previous svg{height:16px;width:16px}.next svg path,.previous svg path{fill:#fff}.previous{left:0}.next{right:0}.ldr{--uib-size:50px;--uib-speed:1s;--uib-stroke:2px;--uib-bg-opacity:0.1;align-items:center;border-radius:calc(var(--uib-stroke)/2);contain:strict;display:none;height:var(--uib-stroke);justify-content:center;left:calc(50% - var(--uib-size)/2);overflow:hidden;position:absolute;top:calc(50% - var(--uib-stroke)/2);transform:translateZ(0);width:var(--uib-size)}.ldr.ldr--visible{display:flex}behold-image.is-loaded .ldr{display:none}.ldr:before{left:0;opacity:var(--uib-bg-opacity);position:absolute;top:0}.ldr:after,.ldr:before{background-color:var(--uib-color);content:"";height:100%;transition:background-color .3s ease;width:100%}.ldr:after{animation:wobble var(--uib-speed) ease-in-out infinite;border-radius:calc(var(--uib-stroke)/2);transform:translateX(-95%)}@keyframes wobble{0%,to{transform:translateX(-95%)}50%{transform:translateX(95%)}}'.toString(),'.hg-container{align-items:flex-start;backface-visibility:hidden;contain:layout style;display:flex;height:100%;justify-content:flex-start;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;will-change:transform}.hg-container:dir(rtl){flex-direction:row-reverse}.hg-slide{contain:strict;flex-grow:0;flex-shrink:0;height:100%;width:100%}.hg-breadcrumbs,.hg-slide{align-items:center;display:flex;justify-content:center}.hg-breadcrumbs{--ease:cubic-bezier(0.215,0.61,0.355,1);gap:calc(var(--breadCrumbDiameter)*.75);height:calc(var(--breadCrumbDiameter) + 10px);pointer-events:all;position:relative;transition:transform .4s var(--ease);width:auto;will-change:transform}.hg-breadcrumbs.no-transition{transition:none}@media (prefers-reduced-motion){.hg-breadcrumbs{transition:none}}.hg-breadcrumbs-current,.hg-breadcrumbs-current:empty{background-color:#fff;border-radius:calc(var(--breadCrumbDiameter)/2);display:block;height:var(--breadCrumbDiameter);position:absolute;top:5px;transition:width .3s var(--ease);width:var(--breadCrumbDiameter);will-change:left,right,width}.hg-breadcrumb,.hg-breadcrumb:empty{cursor:pointer;display:block;flex-shrink:0;height:var(--breadCrumbDiameter);position:relative;width:var(--breadCrumbDiameter)}.hg-breadcrumb:before,.hg-breadcrumb:empty:before{content:"";height:60px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:calc(var(--breadCrumbDiameter)*1.75)}.hg-breadcrumb:after,.hg-breadcrumb:empty:after{background-color:hsla(0,0%,100%,.4);border-radius:50%;content:"";height:100%;left:0;position:absolute;top:0;transition:all .3s var(--ease);width:100%}.no-transition .hg-breadcrumb:after,.no-transition .hg-breadcrumb:empty:after{transition:none}@media (prefers-reduced-motion){.hg-breadcrumb:after,.hg-breadcrumb:empty:after{transition:none}}.hg-breadcrumb.hg-breadcrumb--1:after,.hg-breadcrumb:empty.hg-breadcrumb--1:after{transform:scale(.85)}.hg-breadcrumb.hg-breadcrumb--2:after,.hg-breadcrumb:empty.hg-breadcrumb--2:after{opacity:.75;transform:scale(.7)}.hg-breadcrumb.hg-breadcrumb--3:after,.hg-breadcrumb:empty.hg-breadcrumb--3:after{opacity:.5;transform:scale(.55)}.hg-breadcrumb.hg-breadcrumb--4:after,.hg-breadcrumb:empty.hg-breadcrumb--4:after{opacity:.25;transform:scale(.4)}.hg-breadcrumb.hg-breadcrumb--hidden,.hg-breadcrumb:empty.hg-breadcrumb--hidden{pointer-events:none}.hg-breadcrumb.hg-breadcrumb--hidden:after,.hg-breadcrumb:empty.hg-breadcrumb--hidden:after{opacity:0;transform:scale(0)}.hg-breadcrumb:empty:hover:after,.hg-breadcrumb:hover:after{background-color:#fff;opacity:1;transform:none}'.toString(),'.behold-ps-container{display:flex;height:100vh;justify-content:center;overflow:auto;pointer-events:all;scrollbar-width:none;width:100%}.behold-ps-container::-webkit-scrollbar{width:0!important}.behold-ps-inner{max-width:400px}.behold-ps-inner:before{height:10px}.behold-ps-inner:after,.behold-ps-inner:before{content:"";display:block;pointer-events:none;width:100%}.behold-ps-inner:after{height:90px}'.toString()]}),this.oi=new L({slides:this.si,containerEl:this.o,breadcrumbsContainerEl:this.ei,previousEl:this.Mt,nextEl:this.Dt,onSlideChange:this.Ot,breadcrumbDiameter:this.si.length>9?9:8,virtualize:!0,dragLimit:.4}),this.ri=new F({slides:this.si,containerEl:this.o,onSlideChange:this.Ot,onRequestClose:()=>{this.li()}}),this.onResize(this,this,this.K)}),this.onDisconnect(()=>{document.removeEventListener("keydown",this.di),D(this.closeFocusEl),this.oi?.destroy(),this.ri?.destroy(),this.oi=void 0,this.ri=void 0,document.body.style.overflow=this.hi,document.documentElement.style.paddingRight=this.ni})}Zt({changedProp:t,oldValue:i,newValue:e}){switch(t){case"posts":e&&this.o&&(this.cancelRaf("updatePosts"),this.si=e.map(t=>{const i=document.createElement("behold-popover-gallery-slide");return i.post=t,this.feedMetadata&&(i.feedMetadata=this.feedMetadata),i}),this.o.replaceChildren(...this.si),this.ai=Math.min(this.ai,this.si.length-1),this.Kt&&(this.ci(),o(),this.raf(()=>{this.pi(this.offsetWidth)},"updatePosts")));break;case"widgetSettings":if(e&&c(i,e,["popupColorTheme","popupBorderRadius","popupBorderWidth","popupScrollerBorderRadius","popupScrollerBorderWidth","popupBorderColor","popupShowLink","popupFooterLinkText","popupFooterLinkUrl","popupOverlayOpacity","popupUseCustomOverlayColor","popupCustomOverlayColor"])){s(this,{"theme--light":"light"===e.popupColorTheme,"theme--dark":"dark"===e.popupColorTheme,"theme--auto":"auto"===e.popupColorTheme,"pg-medium-border-radius":(e.popupBorderRadius??0)>=50,"pg-large-border-radius":(e.popupBorderRadius??0)>=80,"ps-medium-border-radius":(e.popupScrollerBorderRadius??0)>=50,"ps-large-border-radius":(e.popupScrollerBorderRadius??0)>=80});const t=e.popupBorderColor??"0,0,0",o=p(t);if(u(this,{"--pg-border-radius":(this.widgetSettings?.popupBorderRadius??0)+"px","--pg-border-width":(this.widgetSettings?.popupBorderWidth??0)+"px","--pg-border-color":o,"--ps-border-radius":(this.widgetSettings?.popupScrollerBorderRadius??0)+"px","--ps-border-width":(this.widgetSettings?.popupScrollerBorderWidth??0)+"px"}),!i?.popupUseCustomOverlayColor&&e.popupUseCustomOverlayColor){const t=(e.popupCustomOverlayColor??"0,0,0").split(",").filter(t=>void 0!==t).map(t=>parseInt(t));this.updateGlobalState({popoverOverlayHslArray:t,popoverOverlayOpacity:e.popupOverlayOpacity??85})}}break;case"feedMetadata":this.si&&this.si.map(t=>{t.feedMetadata=e})}}Ct({changedProps:t,newState:i}){if(t.includes("keyboardNavEnabled")&&s(this,{"keyboard-nav":this.globalState.keyboardNavEnabled}),t.includes("popoverOverlayHslArray")||t.includes("popoverOverlayOpacity")){const t=i.popoverOverlayHslArray,e=i.popoverOverlayOpacity;let s=`hsl(${t[0]} ${Math.min(t[1],50)}% ${Math.min(t[2],15)}% / ${e}%)`;this.widgetSettings?.popupUseCustomOverlayColor&&(s=p(t,e)),this.raf(()=>{this.ti&&(this.ti.style.backgroundColor=s)},"overlayColor")}}di(t){"Escape"===t.code&&(t.preventDefault(),this.li())}open(t,i){if(this.Kt)return;this.Kt=!0,this.ai=t,this.cancelRaf("open"),this.closeFocusEl=i,this.hi=document.body.style.overflow;const e=window.innerWidth-document.documentElement.clientWidth;this.ni=document.documentElement.style.paddingRight;const s=parseInt(getComputedStyle(document.documentElement).paddingRight.replace("px",""));if(document.documentElement.style.paddingRight=`${s+e}px`,this.style.paddingRight=`${e}px`,document.body.style.overflow="hidden",this.widgetSettings?.popupUseCustomOverlayColor){const t=(this.widgetSettings.popupCustomOverlayColor??"0,0,0").split(",").filter(t=>void 0!==t).map(t=>parseInt(t));this.updateGlobalState({popoverOverlayHslArray:t})}this.ci(),o(),this.raf(()=>{this.classList.add("is-visible"),this.si&&async function(t,i=[],e=0){_=t,f=(t=>t instanceof ShadowRoot)(t)?t:document,C=!0,M({include:[t],exclude:i}),document.addEventListener("keydown",S),k.observe(t,{subtree:!0,attributes:!0,attributeFilter:["disabled"],childList:!0});const s=await z();s[e]?.focus()}(this.Yt,this.si?.filter((i,e)=>e!==t),1),this.pi(this.offsetWidth),document.addEventListener("keydown",this.di)},"open")}li(){this.Kt&&(this.Kt=!1,this.cancelTo("close"),this.classList.remove("is-visible"),this.to(this.remove.bind(this),300,"close"),D(this.closeFocusEl),document.removeEventListener("keydown",this.di),document.body.style.overflow=this.hi,document.documentElement.style.paddingRight=this.ni,this.style.paddingRight="")}Ot(t){this.ai=t;let i="image";switch(this.posts[t]?.mediaType){case"VIDEO":i=this.posts[t].isReel?"reel":"video";break;case"CAROUSEL_ALBUM":i="album";break;default:i="image"}this.globalState.keyboardNavEnabled&&l(`${i}, post ${t+1} of ${this.si?.length} in gallery`),M({include:[this.Yt],exclude:(this.si??[]).filter((i,e)=>e!==t),merge:!1}),this.onSlideChange&&this.onSlideChange(t),this.si?.forEach((i,e)=>{e===t?i.activate():i.deactivate()});const e=this.si?.[t-1]??null,s=this.si?.[t+1]??null;if(e&&this.raf(()=>e.preload(),"preloadPrev"),s&&this.raf(()=>s.preload(),"preloadNext"),!this.widgetSettings?.popupUseCustomOverlayColor){const i=this.si?.[t]?this.si[t].getBackgroundColor():null;i&&this.updateGlobalState({popoverOverlayHslArray:i})}}pi(t){t>this.Wt?(this.classList.remove("is-scroller"),this.Mt?.style.setProperty("display",""),this.Dt?.style.setProperty("display",""),this.ri?.destroy(),this.oi?.init(this.ai),this.si?.forEach(t=>t.expandCaption()),this.updateGlobalState({popoverOverlayOpacity:this.widgetSettings?.popupOverlayOpacity??85})):(this.classList.add("is-scroller"),this.oi?.destroy(),this.ri?.init(this.ai),this.si?.forEach(t=>t.collapseCaption()),this.Mt?.removeAttribute("disabled"),this.Mt?.style.setProperty("display","none"),this.Dt?.removeAttribute("disabled"),this.Dt?.style.setProperty("display","none"),this.updateGlobalState({popoverOverlayOpacity:(this.widgetSettings?.popupOverlayOpacity??85)+5}))}K(t){const i=t?.borderBoxSize?.[0]?.inlineSize||t?.contentRect?.width||0;this.pi(i)}ci(){document.body.append(this),this.Jt&&this.Qt&&this.Yt.replaceChildren(this.Jt,this.Qt)}static register(t="behold-popover-gallery"){return customElements.get(t)||customElements.define(t,V),t}}export{V as default};
1
+ import{t,b as i,c as e,s,f as o,m as r,e as a,B as h,r as n,a as l,i as d,j as c,k as p,n as u}from"./index-DlG54u5e.js";import{V as b,I as m,r as g}from"./base-COwgdJg5.js";import{c as v,a as x}from"./caret-right-CSBbJCRm.js";let f=document,_=null,y=new Set,w=new Set,k=new MutationObserver(function(t){t.some(t=>"attributes"===t.type||!![...t.addedNodes,...t.removedNodes].some(t=>E(t).length>0))&&_&&M({include:[_],merge:!0})}),C=!1;function E(t){const i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:function(t){return t.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),e=[];let s=null;for(;s=i.nextNode();)e.push(s);return e}async function z(){return(await Promise.all([...y].map(async t=>!!await function(t){return new Promise(async i=>{if("disabled"in t&&t.disabled)return void i(!1);const e=await function(t){return new Promise(i=>{const e=new IntersectionObserver(t=>{i(t[0].isIntersecting),e.disconnect()});e.observe(t)})}(t);i(!!e&&[...w].every(i=>!i.contains(t)))})}(t)&&t))).filter(t=>!!t)}function S(t){!["Tab"].includes(t.code)||t.ctrlKey||t.altKey||t.metaKey||(t.preventDefault(),"Tab"===t.code&&t.shiftKey?async function(){const t=await z();let i=t.indexOf(f.activeElement)-1;i<0&&(i=t.length-1),t[i]?.focus()}():async function(){const t=await z();let i=t.indexOf(f.activeElement)+1;(i>t.length-1||i<0)&&(i=0),t[i]?.focus()}())}function M({include:t=[],exclude:i=[],merge:e=!1}){e?(t.forEach(t=>{w.delete(t),E(t).forEach(t=>{y.has(t)||y.add(t)})}),i.forEach(t=>w.add(t))):(y=new Set(t.flatMap(t=>E(t))),w=new Set(i))}function D(t){C&&(C=!1,t=t??document.body,document.removeEventListener("keydown",S),k.disconnect(),y.clear(),w.clear(),_=null,t&&t.focus())}class L{containerEl;slides;breadcrumbsContainerEl;previousEl;nextEl;keyboardNav;breadcrumbDiameter;onSlideChange;virtualize;proximalSlidesToRender;dynamicBreadCrumbsCutoff;dragLimit;transitionSpeed;baseTransition;momentumToTransition;index;t;i=document;o;h;l;p;u;m=0;v=0;_;k;C;S="ltr";M;D;L;A;F;O;P;$;B;R;T;j;constructor({slides:i,containerEl:e,breadcrumbsContainerEl:s,previousEl:o,nextEl:r,onSlideChange:a,breadcrumbDiameter:h=7,dynamicBreadCrumbsCutoff:n=10,keyboardNav:l=!0,dragLimit:d=.5,virtualize:c=!1,proximalSlidesToRender:p=1,momentumToTransition:u=5,transitionSpeed:b=300,baseTransition:m=""}){this.slides=i,this.containerEl=e,this.breadcrumbsContainerEl=s,this.previousEl=o,this.nextEl=r,this.onSlideChange=a,this.breadcrumbDiameter=h,this.dynamicBreadCrumbsCutoff=n,this.keyboardNav=l,this.dragLimit=d,this.virtualize=c,this.proximalSlidesToRender=p,this.transitionSpeed=b,this.baseTransition=m,this.momentumToTransition=u,this.index=0,this.t=!1,this.C=!1,this.D={x:0,y:0},this.L={x:0,y:0},this.F=0,this.O=0,this.P=0,this.$=0,this.B=[],this.R=new ResizeObserver(t=>this.j(t)),this.init=this.init.bind(this),this.destroy=this.destroy.bind(this),this.I=this.I.bind(this),this.U=this.U.bind(this),this.V=this.V.bind(this),this.H=this.H.bind(this),this.N=this.N.bind(this),this.q=this.q.bind(this),this.X=this.X.bind(this),this.G=this.G.bind(this),this.T=t(this.Z,10,this),this.j=t(this.K,100,this),this.W=this.W.bind(this),this.Y=this.Y.bind(this),this.J=this.J.bind(this),this.tt=this.tt.bind(this),this.it=this.it.bind(this),this.et=this.et.bind(this),this.st=this.st.bind(this),this.ot=this.ot.bind(this),this.rt=this.rt.bind(this)}it(){const t=getComputedStyle(document.body);this.S=t.direction}ot(){this.o?.addEventListener("mousedown",this.W,{passive:!0}),this.o?.addEventListener("touchstart",this.Y,{passive:!0}),document.body.addEventListener("mousemove",this.X,{passive:!0}),document.body.addEventListener("mouseup",this.tt,{passive:!0}),document.body.addEventListener("mouseleave",this.tt,{passive:!0}),document.body.addEventListener("touchmove",this.G,{passive:!0}),document.body.addEventListener("touchend",this.tt,{passive:!0}),this.previousEl&&this.previousEl.addEventListener("click",this.H,{passive:!0}),this.nextEl&&this.nextEl.addEventListener("click",this.N,{passive:!0}),this.keyboardNav&&document.addEventListener("keydown",this.q)}rt(){document.body.removeEventListener("mousemove",this.X),document.body.removeEventListener("mouseup",this.tt),document.body.removeEventListener("mouseleave",this.tt),document.body.removeEventListener("touchmove",this.G),document.body.removeEventListener("touchend",this.tt),this.o&&(this.o.removeEventListener("mousedown",this.W),this.o.removeEventListener("touchstart",this.Y)),this.previousEl&&this.previousEl.removeEventListener("click",this.H),this.nextEl&&this.nextEl.removeEventListener("click",this.N),this.keyboardNav&&document.removeEventListener("keydown",this.q)}init(t=0){this.t||(this.t=!0,this.i=i(this.containerEl),this.it(),this.h=this.slides.map(t=>e({classes:"hg-slide",contents:t})),this.u=this.slides.map((t,i)=>e({classes:"hg-breadcrumb",listeners:{click:()=>this.I({index:i})}})),this.p=e({classes:"hg-breadcrumbs-current"}),this.l=e({classes:"hg-breadcrumbs",contents:[...this.u,this.p],attributes:{dir:"ltr"}}),this.o=e({classes:"hg-container",contents:this.h,style:{"touch-action":"pan-y"}}),this.containerEl.appendChild(this.o),this.breadcrumbsContainerEl&&(this.breadcrumbsContainerEl.style.setProperty("--breadCrumbDiameter",this.breadcrumbDiameter+"px"),this.breadcrumbsContainerEl.appendChild(this.l)),this.ot(),this.slides.length<2&&(this.l.style.display="none",this.previousEl.style.display="none",this.nextEl.style.display="none"),this.R?.observe(this.containerEl),this.et(this.index,this.index,!1),this.I({index:t,animate:!1,forceUpdate:!0,isInitial:!0}))}destroy(){this.t&&(clearTimeout(this._),clearTimeout(this.k),cancelAnimationFrame(this.m),cancelAnimationFrame(this.v),this.R.disconnect(),this.rt(),this.u=void 0,this.p=void 0,this.l?.remove(),this.l=void 0,this.o?.remove(),this.o=void 0,this.i=void 0,this.h=void 0,this.t=!1)}K(t){t?.[0]&&this.h&&(this.A=A(this.containerEl,this.h))}st(t,i=!0){if(this.u.length>=this.dynamicBreadCrumbsCutoff&&this.l){s(this.l,{"no-transition":!i}),requestAnimationFrame(()=>{this.l?.classList.remove("no-transition")});const e=this.l.offsetWidth/2-this.breadcrumbDiameter/2-this.u[t].offsetLeft;this.l.style.transform=`translateX(${e}px)`,this.u.forEach((i,e)=>{s(i,{"hg-breadcrumb--hidden":e<=t-5||e>=t+5,"hg-breadcrumb--4":e===t-4||e===t+4,"hg-breadcrumb--3":e===t-3||e===t+3,"hg-breadcrumb--2":e===t-2||e===t+2,"hg-breadcrumb--1":e===t-1||e===t+1})})}}et(t,i,e){this.u?.length&&(this.st(t,e),this.breadcrumbsContainerEl&&((!e||this.u.length>=10&&Math.abs(t-i)>1)&&this.p&&this.l?t>i?(this.p.style.left="",this.p.style.right=this.l.offsetWidth-(this.u[t].offsetLeft+this.breadcrumbDiameter)+"px"):(this.p.style.right="",this.p.style.left=this.u[t].offsetLeft+"px"):this.p&&this.l&&(t<i?(this.p.style.left="",this.p.style.right=this.l.offsetWidth-this.u[i]?.offsetLeft-this.breadcrumbDiameter+"px"):(this.p.style.right="",this.p.style.left=this.u[i]?.offsetLeft+"px"),o(),this.m=requestAnimationFrame(()=>{t>i&&this.p?this.p.style.width=`${this.u[t]?.offsetLeft-this.p.offsetLeft+this.breadcrumbDiameter}px`:this.p&&(this.p.style.width=this.p.offsetLeft+this.p.offsetWidth-this.u[t]?.offsetLeft+"px")}),this._=setTimeout(()=>{t>i&&this.p&&this.l?(this.p.style.left="",this.p.style.right=this.l.offsetWidth-(this.u[t].offsetLeft+this.breadcrumbDiameter)+"px"):this.p&&(this.p.style.right="",this.p.style.left=this.u[t].offsetLeft+"px"),o(),this.m=requestAnimationFrame(()=>{this.p&&(this.p.style.width="")})},200))))}I({index:t,animate:i=!0,forceUpdate:e=!1,easing:s="ease",isInitial:o=!1}){if(!this.h?.[t])return;if(!this.t||!this.o)return;cancelAnimationFrame(this.v);const r=t,a=this.index;this.index=r,clearTimeout(this.k),this.virtualize&&this.h.forEach((t,i)=>{Math.abs(this.index-i)>this.proximalSlidesToRender&&i!==a?t.hasChildNodes()&&t.replaceChildren():t.hasChildNodes()||t.replaceChildren(this.slides[i])}),window.matchMedia("(prefers-reduced-motion)").matches&&(i=!1),this.C=!1,this.P=0,r!==a||e?(cancelAnimationFrame(this.m),clearTimeout(this._),this.et(r,a,i),this.onSlideChange&&this.onSlideChange(r,o)):this.p&&(this.p.style.width=""),this.o.style.transition=i?`transform ${this.transitionSpeed}ms ${s}`:this.baseTransition,this.o.style.transform=`translateX(${-100*r}%)`,this.O=-100*r,this.previousEl&&(r<1?(this.i?.activeElement===this.previousEl&&(this.v=requestAnimationFrame(()=>{this.nextEl.focus()})),this.previousEl.setAttribute("disabled","true")):this.previousEl.removeAttribute("disabled")),this.nextEl&&(r>=this.h.length-1?(this.i?.activeElement===this.nextEl&&(this.v=requestAnimationFrame(()=>{this.previousEl.focus()})),this.nextEl.setAttribute("disabled","true")):this.nextEl.removeAttribute("disabled")),this.k=setTimeout(()=>{this.o&&(this.o.style.transition=this.baseTransition)},this.transitionSpeed)}H(){this.U()}N(){this.V()}U(t="ease"){"string"!=typeof t&&(t="ease"),this.index<1?this.I({index:this.index}):this.I({index:this.index-1,easing:t})}V(t="ease"){"string"!=typeof t&&(t="ease"),this.index>=(this.h?.length??0)-1?this.I({index:this.index}):this.I({index:this.index+1,easing:t})}q(t){"ArrowRight"===t.code&&(t.preventDefault(),this.V()),"ArrowLeft"===t.code&&(t.preventDefault(),this.U())}W(t){t.stopPropagation(),t.button>0||this.J({x:t.clientX,y:t.clientY})}Y(t){t.stopPropagation(),this.J({x:t.touches.item(0)?.clientX??0,y:t.touches.item(0)?.clientY??0})}J(t){!(this.slides.length<2)&&this.t&&this.o&&this.h&&(this.C=!0,clearTimeout(this.k),cancelAnimationFrame(this.m),this.A=A(this.containerEl,this.h),this.F=this.A.leftDelta,this.O=this.F/this.A.parent.width*100,this.o.style.transform=`translateX(${this.O}%)`,this.o.style.transition=this.baseTransition,this.P=0,this.D=t,this.L=t,this.$=0,this.B=[],this.p&&(this.p.style.transition="none"))}Z(t,i=!1){if(this.slides.length<2||!this.C||!this.t||!this.o)return;const e=t.x-this.L.x;this.A={...this.A,leftDelta:this.A.leftDelta+e,rightDelta:this.A.rightDelta+e};const s=this.A.parent.width*this.dragLimit;r(this.B,e,5),this.L=t;const o=this.A.leftDelta>0||this.A.rightDelta<0;if(o){const t=function(t,i,e,s=.125){return t*(1-(Math.abs(i)/Math.abs(e))**s)}(e,this.$,this.A.parent.width);this.$=this.$+t}else this.$=this.$+e;let a=t.x-this.D.x,h=t.y-this.D.y,n=Math.abs(h)/Math.abs(a);if(i&&n>.85)return void this.tt();this.P=Math.abs(a/s),e<0&&(this.M="left"),e>0&&(this.M="right");const l=this.F+this.$;this.O=l/this.A.parent.width*100,this.$<0&&this.p&&(this.p.style.right="",this.p.style.left=`${this.u[this.index].offsetLeft}px`),this.$>0&&this.p&&this.l&&(this.p.style.left="",this.p.style.right=this.l.offsetWidth-(this.u[this.index].offsetLeft+this.breadcrumbDiameter)+"px"),o&&this.p?this.p.style.width=`${this.breadcrumbDiameter+Math.abs(4*this.breadcrumbDiameter*(this.O+100*this.index)/100)}px`:this.p&&(this.p.style.width=`${Math.min(2.75*this.breadcrumbDiameter,this.breadcrumbDiameter+Math.abs(4*this.breadcrumbDiameter*(this.O+100*this.index)/100))}px`),this.o.style.transform=`translateX(${this.O}%)`,this.o.style.transition=this.baseTransition}X(t){this.T({x:t.clientX,y:t.clientY},!1)}G(t){this.T({x:t.touches.item(0)?.clientX,y:t.touches.item(0)?.clientY},!0)}tt(){var t;this.C=!1,this.p?.style.setProperty("transition",""),this.o?.style.setProperty("transition",this.baseTransition),this.D={x:0,y:0},this.L={x:0,y:0},this.$=0;let i=null;switch(t=this.B,(Math.abs(t.reduce((t,i)=>t+i,0)/t.length)>this.momentumToTransition||this.P>=1)&&(this.O+100*this.index<0&&"left"===this.M&&(i="advance"),this.O+100*this.index>0&&"right"===this.M&&(i="retreat")),i){case"advance":this.m=requestAnimationFrame(()=>this.V("cubic-bezier(0.25, .25, 0.5, 1)"));break;case"retreat":this.m=requestAnimationFrame(()=>this.U("cubic-bezier(0.25, .25, 0.5, 1)"));break;default:this.m=requestAnimationFrame(()=>this.I({index:this.index}))}this.M=void 0,this.B=[]}}function A(t,i){if(!t||!i?.length)return;const e=t.getBoundingClientRect(),s=i[0].getBoundingClientRect(),o=i[i.length-1].getBoundingClientRect();return{parent:e,firstSlide:s,lastSlide:o,leftDelta:s.left-e.left,rightDelta:o.right-e.right}}class F{slides;containerEl;onSlideChange;onRequestClose;t;ht;nt;o;lt;dt=0;constructor({slides:i,containerEl:e,onSlideChange:s,onRequestClose:o}){this.slides=i,this.containerEl=e,this.onSlideChange=s,this.onRequestClose=o,this.init=this.init.bind(this),this.destroy=this.destroy.bind(this),this.t=!1,this.ht=null,this.nt=null,this.o=null,this.ct=this.ct.bind(this),this.lt=t(this.ut,200,this)}init(t=0){this.t||(this.t=!0,this.o=e({classes:O("inner"),contents:this.slides}),this.nt=e({classes:O("container"),contents:this.o??""}),this.nt&&(this.containerEl.appendChild(this.nt),this.nt.addEventListener("click",this.ct),this.nt.addEventListener("scroll",this.lt,{passive:!0})),this.I({index:t,animate:!1}))}destroy(){this.t&&(cancelAnimationFrame(this.dt),this.t=!1,this.nt&&(this.nt.removeEventListener("click",this.ct),this.nt.removeEventListener("scroll",this.lt),this.nt.remove()),this.nt=null,this.o=null)}ut(){a(this.slides).then(t=>{t&&this.ht!==t&&(this.ht=t,this.onSlideChange&&this.onSlideChange(this.ht))})}ct(t){t.target===this.nt&&this.onRequestClose&&this.onRequestClose()}I({index:t,animate:i=!0}){cancelAnimationFrame(this.dt),this.slides?.[t]&&(this.ht=t,this.onSlideChange&&this.onSlideChange(this.ht),this.dt=requestAnimationFrame(()=>{const e=this.slides[t].offsetTop;this.nt?.scrollTo({top:e-10,behavior:i?"smooth":"instant"})}))}}function O(t){return"behold-ps-"+t}var P='<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">\n<path fill-rule="evenodd" clip-rule="evenodd" fill="#FFFFFF" d="M4.4,7.3C4.2,7.3,4,7.5,4,7.7v4.6c0,0.2,0.2,0.4,0.4,0.4h2.2\n\tl3.2,3.2c0.2,0.2,0.6,0.1,0.6-0.2v-2.4c0-0.1-0.1-0.2-0.1-0.3L4.8,7.4C4.7,7.4,4.6,7.3,4.5,7.3C4.5,7.3,4.4,7.3,4.4,7.3z M16.1,15.2\n\tl-1.4-1.4c0.5-0.7,1.3-1.9,1.3-3.8c0-2.8-1.8-4.3-1.8-4.3c-0.1-0.2-0.4-0.2-0.6,0L13.3,6c-0.1,0.2-0.1,0.4,0,0.6\n\tc0,0,1.4,1.2,1.4,3.4c0,1.4-0.5,2.3-0.9,2.9L12.9,12c0.3-0.4,0.6-1.1,0.6-2c0-1.7-1-2.6-1-2.6c-0.1-0.2-0.4-0.2-0.6,0l-0.4,0.3\n\tc-0.1,0.2-0.1,0.4,0,0.6c0,0,0.7,0.5,0.7,1.7c0,0.4-0.1,0.8-0.2,1.1l-1.6-1.6V4.3c0-0.3-0.4-0.5-0.6-0.2L7.4,6.5L4.8,3.9\n\tc-0.1-0.1-0.4-0.1-0.5,0L4,4.3C3.8,4.4,3.8,4.7,4,4.8l1,1.1l6.7,6.7l3.5,3.5c0.1,0.1,0.4,0.1,0.5,0l0.4-0.4\n\tC16.2,15.6,16.2,15.3,16.1,15.2z"/>\n</svg>',$='<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">\n<path fill="#FFFFFF" d="M12.5,7.3c-0.3-0.4-0.8-0.4-1.1-0.2C11,7.4,11,7.9,11.2,8.3l0,0c0.4,0.5,0.6,1.1,0.6,1.7\n\tc0,0.6-0.2,1.2-0.6,1.7c-0.3,0.4-0.2,0.9,0.1,1.1c0.4,0.3,0.9,0.2,1.1-0.1c0,0,0,0,0,0c0.6-0.8,0.9-1.7,0.9-2.7\n\tC13.4,9,13.1,8.1,12.5,7.3z M14.6,6c-0.3-0.4-0.8-0.4-1.1-0.1C13.1,6.2,13,6.7,13.3,7c0,0,0,0,0,0c0.7,0.8,1.1,1.9,1.1,3\n\tc0,1.1-0.4,2.1-1.1,3c-0.3,0.4-0.2,0.9,0.1,1.1c0.3,0.3,0.8,0.2,1.1-0.1c0.9-1.1,1.4-2.5,1.4-4C16,8.5,15.5,7.1,14.6,6z M9.7,4\n\tC9.5,4,9.2,4,9.1,4.1L6.3,6.7H4.5C4.2,6.7,4,7,4,7.3v5.5c0,0.3,0.2,0.5,0.5,0.5h1.8l2.7,2.6l0,0c0.2,0.2,0.6,0.2,0.8,0\n\tc0.1-0.1,0.2-0.3,0.2-0.4l0-10.8C10,4.3,9.9,4.1,9.7,4z"/>\n</svg>';class B extends h{label="PopoverSlideVideo";bt;gt;vt;mayPlay=!1;post;constructor(){super(),b.register(),m.register(),this.xt=this.xt.bind(this),this.ft=this.ft.bind(this),this._t=this._t.bind(this),this.yt=this.yt.bind(this),this.wt=this.wt.bind(this),this.kt=this.kt.bind(this),this.preload=this.preload.bind(this),this.onGlobalStateChange(this.Ct),this.onConnect(()=>{this.post?.mediaUrl?(this.bt=e({type:"behold-video",classes:"video",props:{mediaUrl:this.post.mediaUrl,sizes:this.post.sizes,renderPlaceholder:!0},listeners:{click:this.yt,load:this.xt,play:this.ft,pause:this._t}}),this.vt=e({type:"button",classes:"video-mute video-mute--visible",contents:this.globalState.isMuted?P:$,listeners:{click:this.wt},attributes:{"aria-label":this.globalState.isMuted?"unmute":"mute"}}),this.globalState.isMuted?this.bt.mute():this.bt.unmute(),this.classList.add("video-container","video-container--paused"),this.replaceChildren(this.bt,this.vt)):this.post&&(this.gt=e({type:"behold-image",props:{sizes:this.post.sizes,mediaUrl:this.post.thumbnailUrl,aspectRatio:this.post.sizes.full.width/this.post.sizes.full.height},listeners:{load:this.xt}}),this.replaceChildren(this.gt)),this.onLoop(this.kt)})}Ct({changedProps:t,newState:i}){t.includes("isMuted")&&this.bt&&this.vt&&(i.isMuted?(this.bt.mute(),this.vt.innerHTML=P):(this.bt.unmute(),this.vt.innerHTML=$))}xt(){this.dispatchEvent(new Event("load")),this.classList.add("is-loaded")}kt(){this.bt&&(this.globalState.playPopoverVideos&&this.mayPlay&&!this.bt.isPlaying?this.bt.play():this.globalState.playPopoverVideos&&this.mayPlay||!this.bt.isPlaying||this.bt.pause())}ft(){this.classList.remove("video-container--paused")}_t(){this.classList.add("video-container--paused")}yt(){this.globalState.playPopoverVideos?this.updateGlobalState({playPopoverVideos:!1}):this.updateGlobalState({playPopoverVideos:!0})}wt(){this.bt&&(this.bt.muted?this.updateGlobalState({isMuted:!1}):this.updateGlobalState({isMuted:!0}))}preload(){this.bt?.preload()}static register(t="behold-popover-slide-video"){return customElements.get(t)||customElements.define(t,B),t}}class R extends h{label="PopoverSlideAlbum";Et;zt;St=[];Mt;Dt;Lt;At;Ft=!1;currentSlideIndex=0;mayPlay=!1;post;useDynamicBackground=!0;constructor(){super(),this.onPropChange(()=>{},["post","useDynamicBackground"]),m.register(),B.register(),this.Ot=this.Ot.bind(this),this.Pt=this.Pt.bind(this),this.kt=this.kt.bind(this),this.preload=this.preload.bind(this),this.onConnect(()=>{this.St=this.$t();const t=this.post?.children?.[0]?.sizes?.full.mediaUrl||this.post?.children?.[0]?.thumbnailUrl,i=t?n(t,"original"):"",s=this.post?.sizes?.full?.uncropped?.height?`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' width='${this.post.sizes?.full?.uncropped?.width}' height='${this.post.sizes?.full?.uncropped?.height}'%3E%3C/svg%3E%0A`:i??null;this.post?.mediaUrlIsVideo&&!s?this.zt=e({type:"video",classes:"slide__carousel-spaceholder",attributes:{src:this.post.mediaUrl,height:this.post.sizes?.full?.uncropped?.height??100,width:this.post.sizes?.full?.uncropped?.width??100},props:{muted:!0}}):this.zt=e({type:"img",classes:"slide__carousel-spaceholder",attributes:{src:s,height:this.post?.sizes?.full?.uncropped?.height??100,width:this.post?.sizes?.full?.uncropped?.width??100}}),this.Mt=e({type:"button",classes:"slide__carousel-previous",attributes:{"aria-label":"Previous album slide"},contents:v}),this.Dt=e({type:"button",classes:"slide__carousel-next",attributes:{"aria-label":"Next album slide"},contents:x}),this.Lt=e({classes:"slide__carousel-breadcrumbs"}),this.Et=e({classes:"slide__carousel",contents:[...this.St,this.Mt,this.Dt,this.Lt]}),this.replaceChildren(this.zt,this.Et),this.At=new L({slides:this.St,containerEl:this.Et,keyboardNav:!1,breadcrumbsContainerEl:this.Lt,dynamicBreadCrumbsCutoff:7,previousEl:this.Mt,nextEl:this.Dt,onSlideChange:this.Ot,virtualize:!0,proximalSlidesToRender:2,dragLimit:.6}),this.onIntersection(this,this.Pt),this.onLoop(this.kt)}),this.onDisconnect(()=>{this.At?.destroy(),this.At=void 0})}kt(){if(this.St)for(let t=0;t<this.St.length;t++){const i=this.St[t];T(i)&&(t===this.currentSlideIndex?i.mayPlay!==this.mayPlay&&(i.mayPlay=this.mayPlay):i.mayPlay&&(i.mayPlay=!1))}}Bt(){M({include:[this.St[this.currentSlideIndex]],exclude:this.St.filter((t,i)=>i!==this.currentSlideIndex),merge:!0})}Pt(t){t.isIntersecting&&this.At?.init(0)}Ot(t,i=!1){t!==this.currentSlideIndex&&this.globalState.keyboardNavEnabled&&l(`Slide ${t+1} of ${this.St.length} in Album`),this.currentSlideIndex=t,[t-2,t-1,t+1,t+2].forEach(t=>this.St[t]?.preload()),this.Bt(),!i&&this.useDynamicBackground&&this.Rt(t)}Rt(t){const i=g(this.post?.children[t].colorPalette?.dominant||"100,100,100");this.style.backgroundColor=`hsl(${i[0]} ${Math.min(i[1],35)}% ${Math.min(i[2],13)}%)`;const e=g(this.post?.children[t].colorPalette?.dominant||"255,255,255"),s=`hsl(${e[0]} ${e[1]}% ${Math.max(e[2],50)}%)`;this.style.setProperty("--uib-color",s),this.updateGlobalState({popoverOverlayHslArray:i})}$t(){return this.post?.children?this.post.children.map(t=>{let i=null;switch(t.mediaType){case"IMAGE":i=e({type:"behold-image",classes:"slide__carousel-slide",props:{sizes:t.sizes,mediaUrl:t.mediaUrl,showLoader:!0,useOriginalAspectRatio:!0,aspectRatio:(t.sizes.full.uncropped?.width??t.sizes.full.width)/(t.sizes.full.uncropped?.height??t.sizes.full.height)}});break;case"VIDEO":i=e({type:"behold-popover-slide-video",classes:"slide__carousel-slide",props:{post:t}})}return i}):[]}preload(){this.St?.[0]?.preload()}static register(t="behold-popover-slide-album"){return customElements.get(t)||customElements.define(t,R),t}}const T=t=>"BEHOLD-POPOVER-SLIDE-VIDEO"===t?.tagName;var j='<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">\n<g>\n\t<path fill="#262626" d="M13.8,5.9H3.2c-0.4,0-0.7-0.3-0.7-0.7s0.3-0.7,0.7-0.7h10.6c0.4,0,0.7,0.3,0.7,0.7S14.1,5.9,13.8,5.9z"/>\n</g>\n<g>\n\t<path fill="#262626" d="M12.8,10.8H2.2c-0.4,0-0.7-0.3-0.7-0.7s0.3-0.7,0.7-0.7h10.6c0.4,0,0.7,0.3,0.7,0.7S13.2,10.8,12.8,10.8z"\n\t\t/>\n</g>\n<g>\n\t<path fill="#262626" d="M8.9,15.3c0,0-0.1,0-0.1,0c-0.4-0.1-0.6-0.4-0.5-0.8l2.4-13.3c0.1-0.4,0.4-0.6,0.8-0.5\n\t\tc0.4,0.1,0.6,0.4,0.5,0.8L9.6,14.8C9.5,15.1,9.2,15.3,8.9,15.3z"/>\n</g>\n<g>\n\t<path fill="#262626" d="M4.7,15.3c0,0-0.1,0-0.1,0c-0.4-0.1-0.6-0.4-0.5-0.8L6.4,1.2c0.1-0.4,0.4-0.6,0.8-0.5\n\t\tc0.4,0.1,0.6,0.4,0.5,0.8L5.3,14.8C5.3,15.1,5,15.3,4.7,15.3z"/>\n</g>\n</svg>';class I extends h{label="PopoverGallerySlide";o;Tt;jt="";It;Ut;Vt;Ht;Nt;qt;Xt;Gt;post;feedMetadata;widgetSettings;constructor(){super(),this.onPropChange(this.Zt,["post","feedMetadata","widgetSettings"]),m.register(),B.register(),R.register(),this.expandCaption=this.expandCaption.bind(this),this.preload=this.preload.bind(this),this.onConnect(()=>{this.render()})}render(){if(this.classList.remove("is-loaded"),!this.post)return;const t=g(this.post.children?.[0]?.colorPalette?.dominant??this.post.colorPalette?.dominant??"100,100,100"),i=`hsl(${t[0]} ${Math.min(t[1],35)}% ${Math.min(t[2],13)}%)`,s=g(this.post.colorPalette?.dominant||"255,255,255"),r=`hsl(${s[0]} ${s[1]}% ${Math.max(s[2],50)}%)`;switch(this.style.setProperty("--uib-color",r),this.post?.mediaType){case"VIDEO":this.Xt=e({type:"behold-popover-slide-video",classes:"slide__media",style:{backgroundColor:i},props:{post:this.post}});break;case"CAROUSEL_ALBUM":this.Xt=e({type:"behold-popover-slide-album",classes:"slide__media",style:{backgroundColor:i},props:{post:this.post,useDynamicBackground:!this.widgetSettings?.popupUseCustomOverlayColor,aspectRatio:(this.post.sizes.full?.uncropped?.width??this.post.sizes.full.width)/(this.post.sizes.full?.uncropped?.height??this.post.sizes.full.height)}});break;default:this.Xt=e({type:"behold-image",classes:"slide__media",style:{backgroundColor:i},props:{sizes:this.post.sizes,mediaUrl:this.post.mediaUrl,showLoader:!0,useOriginalAspectRatio:!0,aspectRatio:(this.post.sizes.full?.uncropped?.width??this.post.sizes.full.width)/(this.post.sizes.full?.uncropped?.height??this.post.sizes.full.height)}})}this.Tt=this.feedMetadata?.profilePictureUrl?e({type:"img",attributes:{src:this.feedMetadata.profilePictureUrl}}):void 0,this.jt="@"+this.feedMetadata?.username,this.feedMetadata?.hashtags?.length&&(this.Tt=j,this.jt=this.feedMetadata.hashtags.join(", ")),this.It=this.Tt?e({classes:"slide__avatar",contents:this.Tt,attributes:{"aria-label":this.feedMetadata?.hashtags?"hashtags":"username"}}):void 0,this.Ut=e({classes:"slide__header",contents:[this.It,this.jt]}),this.Vt=this.post?.caption?.trim()?.length?e({classes:"slide__caption",contents:this.post.caption}):void 0;const a=this.widgetSettings?.popupFooterLinkText?.length?this.widgetSettings?.popupFooterLinkText:"Go to post",h=this.widgetSettings?.popupFooterLinkUrl?.length?this.widgetSettings?.popupFooterLinkUrl:this.post.permalink;this.Ht=this.post.permalink&&!1!==this.widgetSettings?.popupShowLink?e({type:"a",attributes:{href:h,target:"_blank"},classes:"slide__footer-link",contents:[a,'<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">\n<g>\n\t<path d="M16,19.8H4c-2.1,0-3.8-1.7-3.8-3.8V4c0-2.1,1.7-3.8,3.8-3.8h12c2.1,0,3.8,1.7,3.8,3.8v12C19.8,18.1,18.1,19.8,16,19.8z\n\t\t M4,1.8c-1.2,0-2.2,1-2.2,2.2v12c0,1.2,1,2.2,2.2,2.2h12c1.2,0,2.2-1,2.2-2.2V4c0-1.2-1-2.2-2.2-2.2H4z"/>\n</g>\n<path d="M14.4,5.6v7.5h-1.5V8.2l-6,6l-1.1-1.1l6-6H6.9V5.6H14.4z"/>\n</svg>']}):"",this.Nt=e({classes:"slide__footer",contents:[this.Ht]}),this.qt=e({classes:"slide__text",contents:[this.Ut,this.Vt,this.Nt]}),this.o=e({classes:"slide__inner",contents:[this.Xt,this.qt]}),this.Gt=e({type:"button",classes:"slide__more",contents:"… more",listeners:{click:this.expandCaption}}),this.replaceChildren(this.o),o(),this.to(()=>{this.classList.add("is-loaded")},10,"onConnect")}Zt({changedProp:t,newValue:i}){switch(t){case"feedMetadata":if(!this.isConnected||!i)return;this.jt="@"+i.username,i.hashtags?.length?(this.Tt=j,this.jt=i.hashtags.join(", ")):this.Tt=i?.profilePictureUrl?e({type:"img",attributes:{src:i.profilePictureUrl}}):void 0,this.It=this.Tt?e({classes:"slide__avatar",contents:this.Tt,attributes:{"aria-label":i.hashtags?"hashtags":"username"}}):void 0,this.Ut=e({classes:"slide__header",contents:[this.It,this.jt]});break;case"post":this.Xt||this.render(),"IMAGE"===i?.mediaType&&this.Xt?Object.assign(this.Xt,{sizes:i.sizes,mediaUrl:i.mediaUrl,showLoader:!0}):this.Xt&&(U(this.Xt)||(this.Xt.post=i))}}activate(){this.post?.mediaType&&"VIDEO,CAROUSEL_ALBUM".includes(this.post?.mediaType)&&this.Xt&&(this.Xt.mayPlay=!0)}deactivate(){this.post?.mediaType&&"VIDEO,CAROUSEL_ALBUM".includes(this.post?.mediaType)&&this.Xt&&(this.Xt.mayPlay=!1)}preload(){this.Xt?.preload()}getBackgroundColor(){let t=this.post;if("CAROUSEL_ALBUM"===this.post?.mediaType){const i=this.Xt;t=this.post?.children?.[i?.currentSlideIndex??0]}return g(t?.colorPalette?.dominant||"100,100,100")}expandCaption(){this.Vt&&(this.Vt.style.transition="",this.Vt.style.height=this.Vt.offsetHeight+"px",this.Vt.innerHTML=this.post?.caption||"",o(),this.raf(()=>{this.Vt&&(this.Vt.style.transition="height .3s ease",this.Vt.style.height=this.Vt.scrollHeight+"px",this.to(()=>{this.Vt&&(this.Vt.style.transition="",this.Vt.style.height="")},300,"expandCaption"))},"expandCaption"))}collapseCaption(){if(this.Vt){const t=d({text:this.post?.caption,maxChars:120,maxLines:4});this.Vt.innerHTML=t??"",t&&this.post?.caption&&t.length<this.post.caption.length&&this.Gt&&this.Vt.appendChild(this.Gt)}}static register(t="behold-popover-gallery-slide"){return customElements.get(t)||customElements.define(t,I),t}}const U=t=>"BEHOLD-IMAGE"===t.tagName;class V extends h{label="PopoverGallery";posts=[];widgetSettings;feedMetadata;closeFocusEl=document.body;onSlideChange=()=>{};Kt;Wt=900;Yt;Jt;Qt;ti;Mt;Dt;ii;ei;o;si;oi;ri;ai=0;hi="";ni="";constructor(){super(),this.Yt=this.attachShadow({mode:"open"}),this.Kt=!1,this.onPropChange(this.Zt,["posts","widgetSettings","feedMetadata"]),I.register(),this.Ot=this.Ot.bind(this),this.li=this.li.bind(this),this.di=this.di.bind(this),this.onGlobalStateChange(this.Ct),this.onConnect(()=>{s(this,{"theme--light":"light"===this.widgetSettings?.popupColorTheme,"theme--dark":"dark"===this.widgetSettings?.popupColorTheme,"theme--auto":"auto"===this.widgetSettings?.popupColorTheme,"keyboard-nav":this.globalState.keyboardNavEnabled}),this.ti=e({classes:"overlay",listeners:{click:this.li}}),this.Mt=e({type:"button",classes:"previous",attributes:{"aria-label":"Previous post"},contents:v}),this.Dt=e({type:"button",classes:"next",attributes:{"aria-label":"Next post"},contents:x}),this.ii=e({type:"button",classes:"close",contents:'<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">\n<path fill-rule="evenodd" clip-rule="evenodd" fill="#081B10" d="M11.6,10.1l5.5-5.7c0.5-0.5,0.5-1.1,0-1.6c-0.5-0.5-1.1-0.5-1.6,0\n\tl-5.5,5.6L4.4,2.8C4,2.4,3.3,2.4,2.8,2.8S2.4,4,2.8,4.4L8.4,10l-5.5,5.6c-0.5,0.5-0.5,1.1,0,1.6c0.5,0.5,1.1,0.5,1.6,0l5.5-5.6\n\tl5.5,5.6c0.5,0.5,1.1,0.5,1.6,0c0.5-0.5,0.5-1.1,0-1.6C17,15.6,11.6,10.1,11.6,10.1z"/>\n</svg>',attributes:{"aria-label":"Close"},listeners:{click:t=>{t.preventDefault(),this.li()}}}),this.ei=e({classes:"breadcrumbs"}),this.si=this.posts.map(t=>{const i=document.createElement("behold-popover-gallery-slide");return i.post=t,this.feedMetadata&&(i.feedMetadata=this.feedMetadata),this.widgetSettings&&(i.widgetSettings=this.widgetSettings),i}),this.o=e({classes:"inner",contents:this.si}),this.Jt=document.createDocumentFragment(),this.Jt.replaceChildren(this.ti,this.o,this.ei,this.Mt,this.Dt,this.ii),this.Qt=e({type:"style",contents:[':host{--icon-play:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 35 35\' xml:space=\'preserve\'%3E%3Cpath fill=\'%23FFF\' d=\'M28.4 14.9 9.5 4.2C7.5 3.1 5 4.6 5 6.8v21.3c0 2.3 2.5 3.7 4.5 2.6l19-10.7c2-1 2-4-.1-5.1z\'/%3E%3C/svg%3E");--icon-gallery:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 35 35\' xml:space=\'preserve\'%3E%3Cpath fill=\'%23FFF\' d=\'M27.3 22.7v-17c0-2.6-2.1-4.7-4.7-4.7H5.7C3.1 1 1 3.1 1 5.7v17c0 2.6 2.1 4.7 4.7 4.7h17c2.5-.1 4.6-2.2 4.6-4.7zm4-13.4v14.6c0 4.1-3.4 7.4-7.4 7.4H9.2c-.5 0-.8.6-.5 1 .9 1 2.2 1.6 3.7 1.6h12.1c5.2 0 9.3-4.2 9.3-9.3V12.5c0-1.5-.6-2.8-1.6-3.7-.3-.4-.9 0-.9.5z\'/%3E%3C/svg%3E");--bottomPadding:60px;--height:min(calc(100vh - 160px - var(--pg-border-width, 0px)*2),1400px);--width:calc(100% - 120px - var(--pg-border-width, 0px)*2);--text-width:400px;--text-color:#262626;--text-background:#fff;--text-size:15px;--border-color:#ededed;--ease-out-back:cubic-bezier(0.085,1.735,0.285,0.995);align-items:center;box-sizing:border-box;height:100vh;justify-content:flex-start;left:0;overflow:hidden;pointer-events:none;position:fixed;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:99999}:host *{box-sizing:border-box}@media (max-width:1200px){:host{--text-width:300px;--text-size:13px}}:host(.is-scroller){--text-width:100%;--height:auto;--width:calc(100vw - 40px - var(--ps-border-width, 0px)*2)}@media (prefers-color-scheme:dark){:host(.theme--auto){--text-color:#f2f2f2;--text-background:#1a1a1a;--border-color:#292929}}:host(.theme--dark){--text-color:#f2f2f2;--text-background:#1a1a1a;--border-color:#292929}:host(.is-visible){pointer-events:all}.overlay{background-color:rgba(0,0,0,.6);display:block;height:100%;left:0;opacity:0;pointer-events:none;position:absolute;top:0;transition:all .3s ease;width:100%;will-change:opacity,background-color}@media (min-width:901px){.overlay{backdrop-filter:blur(6px)}}:host(.is-visible) .overlay{opacity:1;pointer-events:all}.inner{display:flex;height:calc(100% - var(--bottomPadding));justify-content:center;pointer-events:none;position:relative;width:100%;z-index:1}:host(.is-scroller) .inner{height:100%}behold-popover-gallery-slide{align-items:center;display:flex;flex-grow:0;flex-shrink:0;height:calc(100% - var(--bottomPadding));justify-content:center;margin:0;opacity:0;padding:0;pointer-events:none;transform:scale(.99);transition:transform .2s ease-out,opacity .2s ease-out;width:100%}@media (min-width:901px){behold-popover-gallery-slide:active{cursor:grabbing}}@media (prefers-reduced-motion){behold-popover-gallery-slide{transform:none;transition:none}}:host(.is-visible) behold-popover-gallery-slide.is-loaded{opacity:1;transform:none}:host(.is-scroller) behold-popover-gallery-slide{height:auto;margin-top:calc(var(--ps-border-width, 0px)*2 + 10px)}.slide__inner{align-items:center;background-color:var(--text-background);border-radius:var(--pg-border-radius,0);box-shadow:0 0 0 var(--pg-border-width,0) var(--pg-border-color,"#000");display:flex;justify-content:center;max-height:var(--height);max-width:var(--width);overflow:hidden;pointer-events:all;position:relative}:host(.is-scroller) .slide__inner{border-radius:var(--ps-border-radius,0);box-shadow:0 0 0 var(--ps-border-width,0) var(--pg-border-color,"#000");flex-direction:column}.slide__media{align-items:center;display:flex;flex-shrink:1;height:var(--height);justify-content:center;max-height:var(--height);overflow:hidden;position:relative;transition:background-color .3s ease;z-index:1}:host(.is-scroller) .slide__media{min-width:100%}behold-image img,behold-image video,behold-video img,behold-video video{max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain;-o-object-position:center center;object-position:center center;opacity:0;position:relative;width:auto;z-index:1}.behold-ps-container behold-image img,.behold-ps-container behold-image video,.behold-ps-container behold-video img,.behold-ps-container behold-video video{height:auto;width:100%}behold-image{min-height:10px;min-width:10px;pointer-events:none;position:relative}@supports (aspect-ratio:1/1){behold-image img{min-height:100%;min-width:100%}}behold-image.is-loaded img{opacity:1;transition:opacity .4s ease}.slide__carousel{height:100%;left:0;position:absolute;top:0;width:100%}.slide__carousel:before{background:linear-gradient(0deg,rgba(0,0,0,.4),transparent);bottom:0;height:60px;left:0;width:100%;z-index:1}.slide__carousel:after,.slide__carousel:before{content:"";pointer-events:none;position:absolute;transform:translateZ(0)}.slide__carousel:after{background:var(--icon-gallery);height:20px;left:20px;opacity:.75;top:20px;width:20px;z-index:2}:host(.is-scroller) .slide__carousel:after{left:auto;right:15px;top:15px}:host(:not(.is-scroller).pg-medium-border-radius) .slide__carousel:after{left:30px;top:30px}:host(:not(.is-scroller).pg-large-border-radius) .slide__carousel:after{left:40px;top:40px}:host(.is-scroller.ps-medium-border-radius) .slide__carousel:after{right:30px;top:30px}:host(.is-scroller.ps-large-border-radius) .slide__carousel:after{right:40px;top:40px}img.slide__carousel-spaceholder,video.slide__carousel-spaceholder{height:auto;max-height:100%;opacity:0;pointer-events:none;visibility:hidden;width:auto}.behold-ps-container img.slide__carousel-spaceholder,.behold-ps-container video.slide__carousel-spaceholder{max-width:100%}.slide__carousel-breadcrumbs{bottom:30px;height:10px;left:50%;position:absolute;transform:translateX(-50%);z-index:2}:host(.is-scroller) .slide__carousel-breadcrumbs{bottom:10px}.slide__carousel-next,.slide__carousel-previous{align-items:center;background-color:hsla(0,0%,100%,.95);border:none;border-radius:50%;box-shadow:0 0 10px rgba(0,0,0,.2);display:flex;height:30px;justify-content:center;opacity:.75;outline:none;position:absolute;top:50%;touch-action:manipulation;transform:translateY(-50%) translateZ(0);transition:opacity .3s ease;width:30px;z-index:2}:host(.keyboard-nav) .slide__carousel-next:focus,:host(.keyboard-nav) .slide__carousel-previous:focus{background-color:#000;box-shadow:0 0 10px rgba(0,0,0,.2),0 0 0 2px #4169e1,0 0 0 3px #fff;opacity:1}:host(.keyboard-nav) .slide__carousel-next:focus svg path,:host(.keyboard-nav) .slide__carousel-previous:focus svg path{fill:#fff}.slide__carousel-next:not(:disabled),.slide__carousel-previous:not(:disabled){cursor:pointer}.slide__carousel-next:not(:disabled):hover,.slide__carousel-previous:not(:disabled):hover{opacity:1}.slide__carousel-next:disabled,.slide__carousel-previous:disabled{opacity:.25}.slide__carousel-next:before,.slide__carousel-previous:before{content:"";height:60px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:60px}.slide__carousel-next svg,.slide__carousel-previous svg{height:12px;position:absolute;width:12px}.slide__carousel-next svg path,.slide__carousel-previous svg path{fill:#000}:host(.is-scroller) .slide__carousel-next,:host(.is-scroller) .slide__carousel-previous{background-color:transparent;box-shadow:none;height:20px;width:20px}:host(.is-scroller) .slide__carousel-next svg path,:host(.is-scroller) .slide__carousel-previous svg path{fill:#fff}.slide__carousel-previous{left:20px}.slide__carousel-previous svg{transform:translateX(-1px)}:host(.is-scroller) .slide__carousel-previous{left:10px}.slide__carousel-next{right:20px}.slide__carousel-next svg{transform:translateX(1px)}:host(.is-scroller) .slide__carousel-next{right:10px}.slide__carousel-slide{cursor:grab;display:flex;height:var(--height);overflow:hidden;width:auto}.slide__carousel-slide:active{cursor:grabbing}.slide__carousel-slide-media{height:auto;max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain;pointer-events:none;width:auto}.video-container{align-items:center;cursor:pointer;display:flex;height:var(--height);justify-content:center;overflow:hidden;position:relative;width:100%}.video-container:after{background:var(--icon-play);content:"";filter:drop-shadow(1px 1px 1px rgba(0,0,0,.1));height:80px;left:calc(50% - 40px);opacity:0;pointer-events:none;position:absolute;top:calc(50% - 40px);transform:scale(.5);transition:all .15s ease;width:80px;z-index:2}.video-container.video-container--paused:after{opacity:.8;transform:none;transition:opacity .2s ease,transform .3s var(--ease-out-back)}.video-container:active{cursor:grabbing}behold-video{align-items:center;display:flex;height:100%;width:100%}behold-video.is-loaded video{opacity:1;transition:opacity .4s ease}.video-mute{align-items:center;background:transparent;border:none;bottom:0;cursor:pointer;display:flex;height:60px;justify-content:center;margin:0;opacity:0;outline:none;padding:0;position:absolute;right:0;transform:translateZ(0);transition:opacity .1s ease;width:60px;z-index:2}.video-mute.video-mute--visible{opacity:1;transition:opacity .2s ease .2s}.video-mute:before{background-color:rgba(0,0,0,.5);border-radius:50%;content:"";height:28px;left:calc(50% - 14px);position:absolute;top:calc(50% - 14px);width:28px}:host(.keyboard-nav) .video-mute:focus:before{background-color:#000;box-shadow:0 0 10px rgba(0,0,0,.2),0 0 0 2px #4169e1,0 0 0 4px #fff}.video-mute svg{height:20px;left:calc(50% - 10px);position:absolute;top:calc(50% - 10px);width:20px}.slide__text{align-items:stretch;box-shadow:-1px 0 0 var(--border-color);color:var(--text-color);display:flex;flex-direction:column;flex-shrink:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;font-size:var(--text-size);font-weight:400;height:var(--height);justify-content:flex-start;pointer-events:none;position:relative;transform:translateZ(0);width:var(--text-width);z-index:1}.slide__header{align-items:center;border-bottom:1px solid var(--border-color);display:flex;font-weight:600;line-height:1.25;padding:30px}@media (prefers-color-scheme:dark){.theme--auto .slide__header{border-color:#292929}}.slide__header.theme--dark{border-color:#292929}@media (max-width:1200px){.slide__header{padding:20px}}.slide__avatar{align-items:center;border-radius:50%;display:flex;flex-shrink:0;height:42px;justify-content:center;margin-right:10px;overflow:hidden;position:relative;width:42px}.slide__avatar:dir(rtl){margin-right:0;margin-inline-end:10px}.slide__avatar:before{background:radial-gradient(circle farthest-corner at 32% 106%,#ffe17d 0,#ffcd69 10%,#fa9137 28%,#eb4141 42%,transparent 82%),linear-gradient(135deg,#c33cbe 12%,#c33cbe 58%);height:100%;left:0;top:0;width:100%}.slide__avatar:after,.slide__avatar:before{border-radius:50%;content:"";position:absolute}.slide__avatar:after{background-color:var(--text-background);height:calc(100% - 4px);left:2px;top:2px;width:calc(100% - 4px)}@media (prefers-color-scheme:dark){.theme--auto .slide__avatar{background-color:#333}}.slide__avatar.theme--dark{background-color:#333}.slide__avatar img{border-radius:50%;height:calc(100% - 8px);position:relative;width:calc(100% - 8px);z-index:1}.slide__avatar svg{height:15px;position:relative;width:15px;z-index:1}.slide__avatar svg path{fill:var(--text-color)}:host(.is-scroller) .slide__avatar{height:32px;width:32px}:host(.is-scroller) .slide__avatar svg{height:12px;width:12px}.slide__caption{line-height:1.5;overflow:auto;padding:30px;scrollbar-width:none;white-space:pre-wrap;word-break:break-word}:host(.is-visible) .slide__caption{pointer-events:all}.slide__caption::-webkit-scrollbar{width:0!important}:host(.is-scroller) .slide__caption{overflow:hidden}.slide__more{background:transparent;border:none;color:var(--text-color);cursor:pointer;margin:0;opacity:.75;padding:0}.slide__more:hover{opacity:1;text-decoration:underline}.slide__footer{border-top:1px solid var(--border-color);margin-top:auto}:host(.is-visible) .slide__footer{pointer-events:all}.slide__footer-link{align-items:center;color:var(--text-color);cursor:pointer;display:flex;font-size:.9333em;font-weight:600;gap:20px;padding:30px;text-decoration:none;transition:background .3s ease}:host(.keyboard-nav) .slide__footer-link:focus{background-color:var(--border-color);border:none;box-shadow:inset 0 0 0 1px #fff,inset 0 0 0 3px #4169e1;outline:none;transition:background .1s ease}.slide__footer-link:hover{background-color:var(--border-color)}.slide__footer-link svg{flex-shrink:0;height:17px;margin-left:auto;width:17px}.slide__footer-link svg:dir(rtl){margin-left:0;margin-inline-start:auto}.slide__footer-link svg path{fill:var(--text-color)}@media (max-width:1200px){.slide__footer-link{padding:20px}}:host(:not(.is-scroller).pg-medium-border-radius) .slide__footer-link{padding-right:45px}:host(:not(.is-scroller).pg-large-border-radius) .slide__footer-link{padding-right:65px}:host(.is-scroller.ps-medium-border-radius) .slide__footer-link{padding:20px 75px}:host(.is-scroller.ps-large-border-radius) .slide__footer-link{padding:20px 75px}.breadcrumbs{align-items:center;bottom:calc(var(--bottomPadding)/2 + 30px - (var(--breadCrumbDiameter) + 10px)/2);display:flex;gap:calc(var(--breadCrumbDiameter)*.75);height:calc(var(--breadCrumbDiameter) + 10px);justify-content:center;left:50%;opacity:0;position:absolute;transform:translateX(-50%);width:auto;z-index:2}:host(.is-visible) .breadcrumbs{opacity:1}.breadcrumbs-current,.breadcrumbs-current:empty{background-color:#fff;border-radius:calc(var(--breadCrumbDiameter)/2);display:block;height:var(--breadCrumbDiameter);position:absolute;top:5px;transition:width .3s ease;width:var(--breadCrumbDiameter);will-change:left,right,width}.breadcrumb,.breadcrumb:empty{background-color:hsla(0,0%,100%,.4);border-radius:50%;cursor:pointer;display:block;height:7px;transition:all .3s ease;width:7px}.breadcrumb:empty:hover,.breadcrumb:hover{background-color:#fff}.close{align-items:center;background:none;border:none;cursor:pointer;display:flex;height:30px;justify-content:center;margin:0;opacity:0;padding:0;position:absolute;right:15px;top:15px;width:30px;z-index:2}:host(.is-visible) .close{opacity:.75;transition:opacity .3s ease}:host(.is-visible) .close:hover{opacity:1}:host(.keyboard-nav) .close:focus{box-shadow:0 0 0 2px #4169e1,0 0 0 3px #fff;opacity:1}.close:focus{border:none;outline:none}.close:before{content:"";height:60px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:60px}.close svg{height:20px;width:20px}.close svg path{fill:#fff}:host(.is-scroller) .close{background-color:hsla(0,0%,97%,.85);border-radius:50%;opacity:1;right:5px;top:5px}:host(.is-scroller) .close svg{height:14px;width:14px}:host(.is-scroller) .close svg path{fill:#000}.next,.previous{align-items:center;background:none;border:none;cursor:pointer;display:flex;height:60px;justify-content:center;margin:0;opacity:0;padding:0;position:absolute;top:calc(50% - var(--bottomPadding)/2);touch-action:manipulation;transform:translateY(-50%);width:60px;z-index:2}:host(.is-visible) .next,:host(.is-visible) .previous{opacity:.75;transition:opacity .3s ease}:host(.is-visible) .next:focus,:host(.is-visible) .previous:focus{border:none;outline:none}:host(.is-visible) .next:hover,:host(.is-visible) .previous:hover{opacity:1}:host(.is-visible) .next:disabled,:host(.is-visible) .previous:disabled{cursor:default;opacity:.15}:host(.is-visible) .next:disabled:hover,:host(.is-visible) .previous:disabled:hover{opacity:.15}:host(.keyboard-nav) .next:focus,:host(.keyboard-nav) .previous:focus{box-shadow:0 0 0 2px #4169e1,0 0 0 3px #fff;opacity:1}.next svg,.previous svg{height:16px;width:16px}.next svg path,.previous svg path{fill:#fff}.previous{left:0}.next{right:0}.ldr{--uib-size:50px;--uib-speed:1s;--uib-stroke:2px;--uib-bg-opacity:0.1;align-items:center;border-radius:calc(var(--uib-stroke)/2);contain:strict;display:none;height:var(--uib-stroke);justify-content:center;left:calc(50% - var(--uib-size)/2);overflow:hidden;position:absolute;top:calc(50% - var(--uib-stroke)/2);transform:translateZ(0);width:var(--uib-size)}.ldr.ldr--visible{display:flex}behold-image.is-loaded .ldr{display:none}.ldr:before{left:0;opacity:var(--uib-bg-opacity);position:absolute;top:0}.ldr:after,.ldr:before{background-color:var(--uib-color);content:"";height:100%;transition:background-color .3s ease;width:100%}.ldr:after{animation:wobble var(--uib-speed) ease-in-out infinite;border-radius:calc(var(--uib-stroke)/2);transform:translateX(-95%)}@keyframes wobble{0%,to{transform:translateX(-95%)}50%{transform:translateX(95%)}}'.toString(),'.hg-container{align-items:flex-start;backface-visibility:hidden;contain:layout style;display:flex;height:100%;justify-content:flex-start;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;will-change:transform}.hg-container:dir(rtl){flex-direction:row-reverse}.hg-slide{contain:strict;flex-grow:0;flex-shrink:0;height:100%;width:100%}.hg-breadcrumbs,.hg-slide{align-items:center;display:flex;justify-content:center}.hg-breadcrumbs{--ease:cubic-bezier(0.215,0.61,0.355,1);gap:calc(var(--breadCrumbDiameter)*.75);height:calc(var(--breadCrumbDiameter) + 10px);pointer-events:all;position:relative;transition:transform .4s var(--ease);width:auto;will-change:transform}.hg-breadcrumbs.no-transition{transition:none}@media (prefers-reduced-motion){.hg-breadcrumbs{transition:none}}.hg-breadcrumbs-current,.hg-breadcrumbs-current:empty{background-color:#fff;border-radius:calc(var(--breadCrumbDiameter)/2);display:block;height:var(--breadCrumbDiameter);position:absolute;top:5px;transition:width .3s var(--ease);width:var(--breadCrumbDiameter);will-change:left,right,width}.hg-breadcrumb,.hg-breadcrumb:empty{cursor:pointer;display:block;flex-shrink:0;height:var(--breadCrumbDiameter);position:relative;width:var(--breadCrumbDiameter)}.hg-breadcrumb:before,.hg-breadcrumb:empty:before{content:"";height:60px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:calc(var(--breadCrumbDiameter)*1.75)}.hg-breadcrumb:after,.hg-breadcrumb:empty:after{background-color:hsla(0,0%,100%,.4);border-radius:50%;content:"";height:100%;left:0;position:absolute;top:0;transition:all .3s var(--ease);width:100%}.no-transition .hg-breadcrumb:after,.no-transition .hg-breadcrumb:empty:after{transition:none}@media (prefers-reduced-motion){.hg-breadcrumb:after,.hg-breadcrumb:empty:after{transition:none}}.hg-breadcrumb.hg-breadcrumb--1:after,.hg-breadcrumb:empty.hg-breadcrumb--1:after{transform:scale(.85)}.hg-breadcrumb.hg-breadcrumb--2:after,.hg-breadcrumb:empty.hg-breadcrumb--2:after{opacity:.75;transform:scale(.7)}.hg-breadcrumb.hg-breadcrumb--3:after,.hg-breadcrumb:empty.hg-breadcrumb--3:after{opacity:.5;transform:scale(.55)}.hg-breadcrumb.hg-breadcrumb--4:after,.hg-breadcrumb:empty.hg-breadcrumb--4:after{opacity:.25;transform:scale(.4)}.hg-breadcrumb.hg-breadcrumb--hidden,.hg-breadcrumb:empty.hg-breadcrumb--hidden{pointer-events:none}.hg-breadcrumb.hg-breadcrumb--hidden:after,.hg-breadcrumb:empty.hg-breadcrumb--hidden:after{opacity:0;transform:scale(0)}.hg-breadcrumb:empty:hover:after,.hg-breadcrumb:hover:after{background-color:#fff;opacity:1;transform:none}'.toString(),'.behold-ps-container{display:flex;height:100vh;justify-content:center;overflow:auto;pointer-events:all;scrollbar-width:none;width:100%}.behold-ps-container::-webkit-scrollbar{width:0!important}.behold-ps-inner{max-width:400px}.behold-ps-inner:before{height:10px}.behold-ps-inner:after,.behold-ps-inner:before{content:"";display:block;pointer-events:none;width:100%}.behold-ps-inner:after{height:90px}'.toString()]}),this.oi=new L({slides:this.si,containerEl:this.o,breadcrumbsContainerEl:this.ei,previousEl:this.Mt,nextEl:this.Dt,onSlideChange:this.Ot,breadcrumbDiameter:this.si.length>9?9:8,virtualize:!0,dragLimit:.4}),this.ri=new F({slides:this.si,containerEl:this.o,onSlideChange:this.Ot,onRequestClose:()=>{this.li()}}),this.onResize(this,this,this.K)}),this.onDisconnect(()=>{document.removeEventListener("keydown",this.di),D(this.closeFocusEl),this.oi?.destroy(),this.ri?.destroy(),this.oi=void 0,this.ri=void 0,document.body.style.overflow=this.hi,document.documentElement.style.paddingRight=this.ni})}Zt({changedProp:t,oldValue:i,newValue:e}){switch(t){case"posts":e&&this.o&&(this.cancelRaf("updatePosts"),this.si=e.map(t=>{const i=document.createElement("behold-popover-gallery-slide");return i.post=t,this.feedMetadata&&(i.feedMetadata=this.feedMetadata),i}),this.o.replaceChildren(...this.si),this.ai=Math.min(this.ai,this.si.length-1),this.Kt&&(this.ci(),o(),this.raf(()=>{this.pi(this.offsetWidth)},"updatePosts")));break;case"widgetSettings":if(e&&c(i,e,["popupColorTheme","popupBorderRadius","popupBorderWidth","popupScrollerBorderRadius","popupScrollerBorderWidth","popupBorderColor","popupShowLink","popupFooterLinkText","popupFooterLinkUrl","popupOverlayOpacity","popupUseCustomOverlayColor","popupCustomOverlayColor"])){s(this,{"theme--light":"light"===e.popupColorTheme,"theme--dark":"dark"===e.popupColorTheme,"theme--auto":"auto"===e.popupColorTheme,"pg-medium-border-radius":(e.popupBorderRadius??0)>=50,"pg-large-border-radius":(e.popupBorderRadius??0)>=80,"ps-medium-border-radius":(e.popupScrollerBorderRadius??0)>=50,"ps-large-border-radius":(e.popupScrollerBorderRadius??0)>=80});const t=e.popupBorderColor??"0,0,0",o=p(t);if(u(this,{"--pg-border-radius":(this.widgetSettings?.popupBorderRadius??0)+"px","--pg-border-width":(this.widgetSettings?.popupBorderWidth??0)+"px","--pg-border-color":o,"--ps-border-radius":(this.widgetSettings?.popupScrollerBorderRadius??0)+"px","--ps-border-width":(this.widgetSettings?.popupScrollerBorderWidth??0)+"px"}),!i?.popupUseCustomOverlayColor&&e.popupUseCustomOverlayColor){const t=(e.popupCustomOverlayColor??"0,0,0").split(",").filter(t=>void 0!==t).map(t=>parseInt(t));this.updateGlobalState({popoverOverlayHslArray:t,popoverOverlayOpacity:e.popupOverlayOpacity??85})}}break;case"feedMetadata":this.si&&this.si.map(t=>{t.feedMetadata=e})}}Ct({changedProps:t,newState:i}){if(t.includes("keyboardNavEnabled")&&s(this,{"keyboard-nav":this.globalState.keyboardNavEnabled}),t.includes("popoverOverlayHslArray")||t.includes("popoverOverlayOpacity")){const t=i.popoverOverlayHslArray,e=i.popoverOverlayOpacity;let s=`hsl(${t[0]} ${Math.min(t[1],50)}% ${Math.min(t[2],15)}% / ${e}%)`;this.widgetSettings?.popupUseCustomOverlayColor&&(s=p(t,e)),this.raf(()=>{this.ti&&(this.ti.style.backgroundColor=s)},"overlayColor")}}di(t){"Escape"===t.code&&(t.preventDefault(),this.li())}open(t,i){if(this.Kt)return;this.Kt=!0,this.ai=t,this.cancelRaf("open"),this.closeFocusEl=i,this.hi=document.body.style.overflow;const e=window.innerWidth-document.documentElement.clientWidth;this.ni=document.documentElement.style.paddingRight;const s=parseInt(getComputedStyle(document.documentElement).paddingRight.replace("px",""));if(document.documentElement.style.paddingRight=`${s+e}px`,this.style.paddingRight=`${e}px`,document.body.style.overflow="hidden",this.widgetSettings?.popupUseCustomOverlayColor){const t=(this.widgetSettings.popupCustomOverlayColor??"0,0,0").split(",").filter(t=>void 0!==t).map(t=>parseInt(t));this.updateGlobalState({popoverOverlayHslArray:t})}this.ci(),o(),this.raf(()=>{this.classList.add("is-visible"),this.si&&async function(t,i=[],e=0){_=t,f=(t=>t instanceof ShadowRoot)(t)?t:document,C=!0,M({include:[t],exclude:i}),document.addEventListener("keydown",S),k.observe(t,{subtree:!0,attributes:!0,attributeFilter:["disabled"],childList:!0});const s=await z();s[e]?.focus()}(this.Yt,this.si?.filter((i,e)=>e!==t),1),this.pi(this.offsetWidth),document.addEventListener("keydown",this.di)},"open")}li(){this.Kt&&(this.Kt=!1,this.cancelTo("close"),this.classList.remove("is-visible"),this.to(this.remove.bind(this),300,"close"),D(this.closeFocusEl),document.removeEventListener("keydown",this.di),document.body.style.overflow=this.hi,document.documentElement.style.paddingRight=this.ni,this.style.paddingRight="")}Ot(t){this.ai=t;let i="image";switch(this.posts[t]?.mediaType){case"VIDEO":i=this.posts[t].isReel?"reel":"video";break;case"CAROUSEL_ALBUM":i="album";break;default:i="image"}this.globalState.keyboardNavEnabled&&l(`${i}, post ${t+1} of ${this.si?.length} in gallery`),M({include:[this.Yt],exclude:(this.si??[]).filter((i,e)=>e!==t),merge:!1}),this.onSlideChange&&this.onSlideChange(t),this.si?.forEach((i,e)=>{e===t?i.activate():i.deactivate()});const e=this.si?.[t-1]??null,s=this.si?.[t+1]??null;if(e&&this.raf(()=>e.preload(),"preloadPrev"),s&&this.raf(()=>s.preload(),"preloadNext"),!this.widgetSettings?.popupUseCustomOverlayColor){const i=this.si?.[t]?this.si[t].getBackgroundColor():null;i&&this.updateGlobalState({popoverOverlayHslArray:i})}}pi(t){t>this.Wt?(this.classList.remove("is-scroller"),this.Mt?.style.setProperty("display",""),this.Dt?.style.setProperty("display",""),this.ri?.destroy(),this.oi?.init(this.ai),this.si?.forEach(t=>t.expandCaption()),this.updateGlobalState({popoverOverlayOpacity:this.widgetSettings?.popupOverlayOpacity??85})):(this.classList.add("is-scroller"),this.oi?.destroy(),this.ri?.init(this.ai),this.si?.forEach(t=>t.collapseCaption()),this.Mt?.removeAttribute("disabled"),this.Mt?.style.setProperty("display","none"),this.Dt?.removeAttribute("disabled"),this.Dt?.style.setProperty("display","none"),this.updateGlobalState({popoverOverlayOpacity:(this.widgetSettings?.popupOverlayOpacity??85)+5}))}K(t){const i=t?.borderBoxSize?.[0]?.inlineSize||t?.contentRect?.width||0;this.pi(i)}ci(){document.body.append(this),this.Jt&&this.Qt&&this.Yt.replaceChildren(this.Jt,this.Qt)}static register(t="behold-popover-gallery"){return customElements.get(t)||customElements.define(t,V),t}}export{V as default};
@@ -1 +1 @@
1
- import{B as t,s as e,j as o,k as s,n as i,c as a,t as r,h,f as n,l,r as d,p as c}from"./index-DqJM0ILL.js";function p(t){if(!t)return[0,0,39];let[e,o,s]=t.split(",").map(t=>parseInt(t));e/=255,o/=255,s/=255;const i=Math.max(e,o,s),a=i-Math.min(e,o,s),r=a?i===e?(o-s)/a:i===o?2+(s-e)/a:4+(e-o)/a:0;return[60*r<0?60*r+360:60*r,100*(a?i<=.5?a/(2*i-a):a/(2-(2*i-a)):0),100*(2*i-a)/2].map(t=>Math.round(t))}function f(t,e){const o=(s=t,i=e="tone"===e?"dominant":e,s.filter(t=>t[i]).map(t=>t[i])).map(t=>p(t).join(","));var s,i;return[b(m(o,0)),b(m(o,1)),b(m(o,2))].map(t=>String(t))}function b(t){const e=[...t];e.sort(function(t,e){return t-e});const o=Math.floor((e.length-1)/2);return e.length%2?e[o]:(e[o]+e[o+1])/2}function m(t,e){return t.map(t=>parseInt(t.split(",")[e]))}class v extends t{label="BaseWidget";shadow;styleEl;contents;shouldRenderStyles;stylesAdded;styles;constructor(){super(),this.shadow=this.attachShadow({mode:"open"}),this.handleKeydown=this.handleKeydown.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleFocusout=this.handleFocusout.bind(this),this.handleShadowFocusout=this.handleShadowFocusout.bind(this),this.onGlobalStateChange(()=>{e(this,{"keyboard-nav":this.globalState.keyboardNavEnabled})}),this.onConnect(()=>{this.styleEl=document.createElement("style"),e(this,{"keyboard-nav":this.globalState.keyboardNavEnabled}),this.addEventListener("focus",this.handleFocus),this.addEventListener("focusout",this.handleFocusout),this.shadow.addEventListener("focusout",this.handleShadowFocusout),this.addEventListener("keydown",this.handleKeydown),this.onLoop(()=>{!this.stylesAdded&&this.shouldRenderStyles&&(this.styleEl&&this.styles&&this.styleEl.replaceChildren(...this.styles.map(t=>t.toString())),this.shadow.replaceChildren(this.contents,this.styleEl),this.stylesAdded=!0)})})}focusPreviousPost(){this.dispatchEvent(new CustomEvent("post-focus-previous"))}focusNextPost(){this.dispatchEvent(new CustomEvent("post-focus-next"))}handleKeydown(t){"ArrowLeft"===t.key&&t.shiftKey&&this.focusPreviousPost(),"ArrowRight"===t.key&&t.shiftKey&&this.focusNextPost(),this.shadow.activeElement&&this.classList.remove("has-focus")}handleFocus(t){this.shadow.activeElement||this.classList.add("has-focus")}handleFocusout(){this.classList.remove("has-focus")}handleShadowFocusout(t){t.relatedTarget===this&&this.classList.add("has-focus")}renderWidget(t,e){this.stylesAdded&&this.contents?this.contents.replaceWith(t):(this.contents=t,this.styles=e,this.shouldRenderStyles=!0)}}function u(t){return t?`hsl(${t[0]}, ${t[1]}%, ${t[2]}%, ${Math.max(1*Math.random(),.3)})`:""}class g extends t{label="BasePost";post;widgetSettings;feedMetadata;medianPaletteHSL=["0","0","39"];hasRowGap=!1;isLastRow=!1;onClick=()=>{};previewLoadingColors;backgroundIsHidden=!1;backgroundColor="rgba(100,100,100)";aspectRatio=[1,1];index=0;totalPosts;t;o;constructor(){super(),this.onPropChange(this.i,["post","widgetSettings","feedMetadata","medianPaletteHSL","hasRowGap","isLastRow","previewLoadingColors","aspectRatio","index","totalPosts"],["post","widgetSettings","feedMetadata","medianPaletteHSL","index","totalPosts"]),this.h=this.h.bind(this),this.hideBackground=this.hideBackground.bind(this),this.onConnect(()=>{this.onResize(this,this,this.l)})}i({changedProp:t,oldValue:e,newValue:s}){switch(t){case"post":o(s,e,["colorPalette"])&&this.p();break;case"widgetSettings":if(!s)return;o(s,e,["loadingColor","loadingColorTone"])&&this.p(),this.t&&o(s,e,["linkTarget"])&&s?.onPostClick?.toLowerCase().includes("link")&&this.t.setAttribute("target",s.linkTarget),this.t&&o(s,e,["customLinkURL"])&&"customLink"===s.onPostClick&&this.t.setAttribute("href",s.customLinkURL),o(s,e,["hoverOverlayColor","hoverOverlayCustomColor","hoverOverlayOpacity"])&&this.m(),this.v();break;case"previewLoadingColors":s?(this.style.backgroundColor="",this.p()):this.backgroundIsHidden&&this.hideBackground();break;case"hasRowGap":case"isLastRow":this.v()}}m(){let t="rgba(0, 0, 0, 0.3)",e=this.widgetSettings?.hoverOverlayCustomColor??"0,0,0",o=this.widgetSettings?.hoverOverlayOpacity??65;if("auto"===this.widgetSettings?.hoverOverlayColor){const e=p(this.post?.colorPalette?.dominant||"100,100,100");t=`hsl(${e[0]} ${Math.min(e[1],50)}% ${Math.min(e[2],40)}% / ${o}%)`}"custom"===this.widgetSettings?.hoverOverlayColor&&(t=s(e,o,"0,0,0")),i(this,{"--overlay-color":t})}v(){e(this,{post:!0,"post--hover-icon":"showIcon"===this.widgetSettings?.onHover,"post--hover-caption":"showCaption"===this.widgetSettings?.onHover,"post--has-row-gap":this.hasRowGap,"post--last-row":this.isLastRow}),this.m(),this.p()}renderPost(t){let e="div",o=this.post?.permalink;this.v(),"linkToProfile"===this.widgetSettings?.onPostClick&&this.feedMetadata?.username&&(o=`https://instagram.com/${this.feedMetadata.username}`),"customLink"===this.widgetSettings?.onPostClick&&this.widgetSettings?.customLinkURL&&(o=this.widgetSettings?.customLinkURL),this.widgetSettings?.onPostClick.toLowerCase().includes("link")&&(e="a"),this.widgetSettings?.onPostClick.toLowerCase().includes("popup")&&(e="button");let s=null;if("showCaption"===this.widgetSettings?.onHover){const t=a({contents:this.post?.prunedCaption?.length?this.post?.prunedCaption:this.post?.caption,classes:"post-caption__inner"});s=a({contents:t,classes:"post-caption"})}let i="image";switch(this.post?.mediaType){case"VIDEO":i=this.post.isReel?"reel":"video";break;case"CAROUSEL_ALBUM":i="album";break;default:i="image"}t&&(this.t=a({type:e,contents:[t,s||""],attributes:{draggable:"false","aria-label":`${i}, post ${this.index+1} of ${this.totalPosts}`,tabindex:-1,..."a"===e?{href:o,target:this.widgetSettings?.linkTarget}:{}},listeners:{..."button"===e?{click:this.h}:{}}})),this.replaceChildren(this.t??"")}hideBackground(){this.backgroundIsHidden=!0,this.previewLoadingColors||(this.style.backgroundColor="transparent")}p(){const t=function(t,e,o,s){let i="";switch(t){case"dominant":case"vibrant":case"muted":case"vibrantLight":case"mutedLight":case"vibrantDark":case"mutedDark":i=e?`rgb(${e[t]})`:u(s);break;case"tone":if(o){const t=o.split(",");if(e){const o=(a=p(e.dominant)[2]-s[2],Math.log(Math.abs(a))/Math.log(1.6)*Math.sign(a));i=`hsl(${t[0]},${t[1]}%,${parseInt(t[2])+o}%)`}else i=`hsl(${t[0]},${t[1]}%,${t[2]}%, ${Math.max(1*Math.random(),.3)})`}else i=u(s)}var a;return i}(this.previewLoadingColors?this.previewLoadingColors:this.widgetSettings?.loadingColor,this.post?.colorPalette,this.widgetSettings?.loadingColorTone,this.medianPaletteHSL);this.backgroundColor=t,i(this,{"--post-background-color":t})}l(t){const o=t?.borderBoxSize?.[0]?.inlineSize||t?.contentRect?.width||0;i(this,{"--post-width":o+"px","--post-height":(t?.borderBoxSize?.[0]?.blockSize||t?.contentRect?.height||0)+"px"});let s="xlarge";o<600&&(s="large"),o<400&&(s="medium"),o<250&&(s="small"),o<175&&(s="xsmall"),["xsmall","small","medium","large","xlarge"].forEach(t=>{e(this,{[`post--${t}`]:t===s})})}h(){this.onClick&&this.onClick(this)}focus(){this.t?.focus()}}class y extends t{label="Image";sizes;useOriginalAspectRatio=!1;mediaUrl;aspectRatio=1;showLoader=!1;lazy=!0;u;k;G={isLoaded:!1,isVisible:!1,didError:!1,shouldPreload:!1,loaderIsShowing:!1};_;constructor(){super(),this.onPropChange(this.F,["sizes","mediaUrl","aspectRatio","showLoader"],["sizes","mediaUrl","aspectRatio"]),this.onLocalStateChange(this.P,this.G),this.C=this.C.bind(this),this.S=this.S.bind(this),this.L=this.L.bind(this),this._=r(this.l,50,this),this.preload=this.preload.bind(this),this.onConnect(()=>{const t=this.aspectRatio?(this.useOriginalAspectRatio?this.sizes?.full.uncropped?.height:this.sizes?.full.height)??300:300,e=this.aspectRatio?(this.useOriginalAspectRatio?this.sizes?.full.uncropped?.width:this.sizes?.full.width)??300:300*this.aspectRatio;this.style.aspectRatio=this.aspectRatio?`${this.aspectRatio}`:`${e}/${t}`;let o=this.sizes?.full.height?h(e,t):this.mediaUrl??h(e,t);this.u=a({type:"img",attributes:{alt:"",role:"presentation",height:t+"px",width:e+"px",tabindex:-1,src:o,draggable:"false"},listeners:{load:this.S,error:this.L}}),this.showLoader?(this.k=a({classes:"ldr"}),this.replaceChildren(this.k,this.u)):this.replaceChildren(this.u),this.lazy||this.preload(),n(),this.raf(()=>{this.onResize(this,this,this._),this.onIntersection(this,this.C)},"connect")}),this.onDisconnect(()=>{this.updateLocalState({isVisible:!1,isLoaded:!1}),this.u&&(this.u.removeEventListener("load",this.S),this.u.removeEventListener("error",this.L))})}F({changedProp:t,oldValue:e,newValue:o}){switch(t){case"showLoader":!e&&o&&this.u&&(this.k=a({classes:"ldr"}),this.replaceChildren(this.k,this.u));break;case"sizes":if(l(e,o))return;this.updateLocalState({isLoaded:!1,sizeObj:this.u?.isConnected?this.M(this.offsetWidth,this.offsetHeight):null})}}P({changedProps:t,newState:o}){if(t.includes("loaderIsShowing")&&this.k&&e(this.k,{"ldr--visible":!!o.loaderIsShowing&&!o.isLoaded}),t.includes("imageSrc")){const t=o.imageSrc;this.u&&(o.isVisible||o.shouldPreload)&&t!==this.u.src&&this.u.setAttribute("src",t)}if(t.includes("sizeObj")&&!o.didError){const t=o.sizeObj,e=this.mediaUrl;this.updateLocalState({imageSrc:t?.mediaUrl??e})}}C(t){t.isIntersecting?(this.updateLocalState({isVisible:!0}),!this.localState.isLoaded&&this.showLoader&&this.to(()=>{this.updateLocalState({loaderIsShowing:!0})},50,"loader"),this.localState.imageSrc&&this.u?.src!==this.localState.imageSrc&&this.u?.setAttribute("src",this.localState.imageSrc)):this.updateLocalState({isVisible:!1})}l(t){let e=t.borderBoxSize?t.borderBoxSize[0].inlineSize:t.contentRect.width||0,o=t.borderBoxSize?t.borderBoxSize[0].blockSize:t.contentRect.height||0;const s=this.M(e,o),i=this.useOriginalAspectRatio?s?.uncropped?.width:s?.width,a=this.useOriginalAspectRatio?s?.uncropped?.height:s?.height;(!this.localState.sizeObj?.width||this.localState.sizeObj?.width<(i??300)||this.localState.sizeObj?.height<(a??300))&&this.updateLocalState({sizeObj:s})}S(){this.u?.src!==this.localState.imageSrc&&!this.localState.shouldPreload&&this.sizes?.full.height||(this.cancelTo("loader"),this.updateLocalState({isLoaded:!0,loaderIsShowing:!1}),this.dispatchEvent(new Event("load")),this.classList.add("is-loaded"))}L(){this.localState.imageSrc===this.mediaUrl||this.localState.didError||(this.updateLocalState({didError:!0}),this.updateLocalState({imageSrc:this.mediaUrl}))}M(t,e){if(!this.sizes)return;const o=this.useOriginalAspectRatio;return this.sizes?Object.values(this.sizes).reduce((s,i)=>{const a=o?i.uncropped??i:i;return Math.abs(a.width/2-t)<Math.abs(s.width/2-t)||Math.abs(a.height/2-e)<Math.abs(s.height/2-e)?{mediaUrl:i.mediaUrl,...a,...o&&{mediaUrl:d(i.mediaUrl,"original")}}:s},{...this.sizes.full,...o&&{mediaUrl:d(this.sizes.full.mediaUrl,"original")}}):null}preload(){this.localState.isLoaded||(this.localState.imageSrc&&this.localState.sizeObj&&this.u?.src!==this.localState.imageSrc?this.u?.setAttribute("src",this.localState.imageSrc):this.updateLocalState({shouldPreload:!0}))}static register(t="behold-image"){return customElements.get(t)||customElements.define(t,y),t}}class w extends g{label="ImagePost";u;R=!1;constructor(){super(),this.B=this.B.bind(this),y.register(),this.onPropChange(this.F,["post","widgetSettings","aspectRatio"],null,this.j)}F({changedProp:t,oldValue:e,newValue:s}){switch(t){case"widgetSettings":o(s,e,["onHover","onPostClick"])&&this.j();break;case"post":case"aspectRatio":this.j()}}B(){"openPopupGallery"===this.widgetSettings?.onPostClick&&this.post&&!this.R&&(c("img",d(this.post.sizes.full.mediaUrl,"original")),this.R=!0)}j(){if(this.cancelTo("imageLoad"),!this.post)return void console.warn("No post object");const{sizes:t,mediaUrl:e}=this.post;this.u=a({type:"behold-image",props:{sizes:t,mediaUrl:e,aspectRatio:this.aspectRatio.reduce((t,e)=>t/e),lazy:this.widgetSettings?.lazyLoadMedia??!0},listeners:{mouseover:this.B}}),this.u.addEventListener("load",t=>{this.to(this.hideBackground,600,"imageLoad")}),this.renderPost(this.u)}static register(t="behold-image-post"){return customElements.get(t)||customElements.define(t,w),t}}class x extends t{label="Video";mediaUrl;sizes;autoplay=!1;aspectRatio=1;lazy=!0;renderPlaceholder;I;V;U=!0;$=!1;H=!1;O;u;constructor(){super(),this.I=!this.reduceMotion&&(this.autoplay||!1),this.V=!1,this.T=this.T.bind(this),this.C=this.C.bind(this),this.A=this.A.bind(this),this.Y=this.Y.bind(this),this.D=this.D.bind(this),this.N=this.N.bind(this),this.W=this.W.bind(this),this.preload=this.preload.bind(this),this.K=this.K.bind(this),this.onPropChange(({changedProp:t,newValue:e})=>{this.H&&this.mediaUrl&&c("video",this.mediaUrl),"autoplay"===t&&(e&&!this.reduceMotion?this.play():this.pause())},["mediaUrl","sizes","autoplay","aspectRatio","renderPlaceholder"],["mediaUrl","sizes","renderPlaceholder"]),this.onConnect(()=>{document.addEventListener("visibilitychange",this.D),this.onLoop(this.T,30),this.onIntersection(this,this.C),this.render()}),this.onDisconnect(()=>{document.removeEventListener("visibilitychange",this.D),this.O&&(this.O.removeEventListener("play",this.N),this.O.removeEventListener("pause",this.W),this.O.removeEventListener("loadeddata",this.A))})}get isPlaying(){return this.I||!1}get Z(){return this.O&&!!(this.O.currentTime>0&&!this.O.paused&&!this.O.ended&&this.O.readyState>2)}get paused(){return this.O?.paused}get muted(){return this.O?.muted}get isLoaded(){return this.$}render(){this.O=a({type:"video",attributes:{loop:!0,playsinline:!0,crossorigin:"anonymous",tabIndex:-1,disablePictureInPicture:!0,disableremoteplayback:!0,height:this.sizes?.full.height||100,width:this.sizes?.full.width||100},props:{muted:this.U,autoplay:this.autoplay||!1},listeners:{play:this.N,pause:this.W,error:this.Y}}),this.renderPlaceholder&&this.sizes&&(this.u=a({type:"img",attributes:{height:this.sizes?.full.height,width:this.sizes?.full.width,src:h(this.sizes.full.width,this.sizes.full.height)}}),this.replaceChildren(this.u)),this.lazy||this.K()}async T(){if(this.O&&this.isLoaded){if(!this.V&&this.I&&!this.Z)try{this.V=!0,await this.O.play()}catch{}finally{this.V=!1}!this.I&&this.Z&&(this.O.pause(),this.V=!1)}}K(){this.O&&this.mediaUrl?this.O.src!==this.mediaUrl&&(this.O.addEventListener("loadeddata",this.A,{once:!0}),this.O.src=this.mediaUrl,this.O.load()):this.autoplay&&!this.reduceMotion||this.pause()}C(t){t.isIntersecting&&this.O&&this.mediaUrl?this.O.src!==this.mediaUrl&&(this.O.addEventListener("loadeddata",this.A,{once:!0}),this.O.src=this.mediaUrl,this.O.load()):this.autoplay&&!this.reduceMotion||this.pause()}A(){this.$=!0,this.autoplay&&!this.reduceMotion||!this.O||(this.O.currentTime=.25,this.O.pause()),this.dispatchEvent(new Event("load")),this.O&&this.replaceChildren(this.O),n(),this.raf(()=>{this.classList.add("is-loaded")},"_handleVideoLoad")}Y(){this.dispatchEvent(new Event("error"))}N(){this.dispatchEvent(new Event("play"))}W(){this.dispatchEvent(new Event("pause"))}play(){this.I=!0}pause(){this.I=!1}mute(){this.U=!0,this.O&&(this.O.muted=!0)}unmute(){this.U=!1,this.O&&(this.O.muted=!1)}D(){document.hidden&&(this.pause(),this.O&&this.O.pause()),document.hidden||!this.autoplay||this.reduceMotion||this.play()}preload(){!this.$&&this.mediaUrl?c("video",this.mediaUrl):this.H=!0}static register(t="behold-video"){return customElements.get(t)||customElements.define(t,x),t}}class z extends g{label="VideoPost";q;O;u;constructor(){super(),this.onPropChange(this.F,["post","widgetSettings","aspectRatio"],null,this.j),x.register(),y.register(),this.B=this.B.bind(this),this.J=this.J.bind(this),this.onDisconnect(()=>{this.removeEventListener("mouseover",this.B),this.removeEventListener("mouseleave",this.J)})}F({changedProp:t,oldValue:e,newValue:s}){switch(t){case"widgetSettings":o(e,s,["onHover","onPostClick","previewVideosOnHover","autoplayVideos"])&&this.j();break;case"post":case"aspectRatio":this.j()}}B(){this.widgetSettings?.previewVideosOnHover&&this.O&&(this.u?.remove(),this.O?.play())}J(){this.widgetSettings?.autoplayVideos&&!this.reduceMotion||this.O?.pause()}j(){if(this.cancelTo("mediaLoad"),!this.post)return;const{sizes:t,mediaUrl:e,thumbnailUrl:o}=this.post;this.q=document.createDocumentFragment(),(this.widgetSettings?.previewVideosOnHover||this.widgetSettings?.autoplayVideos)&&e||!t.full.mediaUrl&&!o&&e?(this.u=this.widgetSettings?.autoplayVideos?void 0:a({type:"behold-image",classes:"video-thumbnail",props:{sizes:t,mediaUrl:o,aspectRatio:this.aspectRatio.reduce((t,e)=>t/e),lazy:this.widgetSettings?.lazyLoadMedia??!0},listeners:{mouseover:this.B,mouseleave:this.J}}),this.O=a({type:"behold-video",style:{visibility:this.widgetSettings?.autoplayVideos?"":"hidden"},props:{mediaUrl:e,sizes:t,autoplay:this.widgetSettings?.autoplayVideos,aspectRatio:this.aspectRatio.reduce((t,e)=>t/e),renderPlaceholder:!1,lazy:this.widgetSettings?.lazyLoadMedia??!0},listeners:{mouseover:this.B,mouseleave:this.J}}),this.O.addEventListener("load",()=>{this.to(()=>{this.hideBackground(),this.O?.style.setProperty("visibility","")},600,"mediaLoad")}),this.O.addEventListener("error",()=>{this.raf(()=>{this.u=a({type:"behold-image",props:{sizes:t,mediaUrl:o,aspectRatio:this.aspectRatio.reduce((t,e)=>t/e),lazy:this.widgetSettings?.lazyLoadMedia??!0}}),this.u.addEventListener("load",()=>{this.to(this.hideBackground,600,"mediaLoad")}),this.renderPost(this.u)},"mediaError")}),this.u?this.q.replaceChildren(this.O,this.u):this.q.replaceChildren(this.O),this.renderPost(this.q)):(this.u=a({type:"behold-image",props:{sizes:t,mediaUrl:o,aspectRatio:this.aspectRatio.reduce((t,e)=>t/e),lazy:this.widgetSettings?.lazyLoadMedia??!0}}),this.u.addEventListener("load",()=>{this.to(this.hideBackground,600,"mediaLoad")}),this.renderPost(this.u))}static register(t="behold-video-post"){return customElements.get(t)||customElements.define(t,z),t}}class k extends g{label="AlbumPost";X;R=!1;constructor(){super(),this.B=this.B.bind(this),y.register(),x.register(),this.onPropChange(this.F,["post","widgetSettings"],null,this.j)}F({changedProp:t,oldValue:e,newValue:s}){switch(t){case"widgetSettings":o(s,e,["onHover","onPostClick"])&&this.j();break;case"post":case"aspectRatio":this.j()}}B(){"openPopupGallery"===this.widgetSettings?.onPostClick&&this.post&&!this.R&&(c("img",d(this.post.children[0].sizes.full.mediaUrl,"original")),this.R=!0)}j(){if(this.cancelTo("mediaLoad"),!this.post)return;let{sizes:t,mediaUrl:e,children:o}=this.post;if(!t.full.mediaUrl&&!e){const s=o.filter(Boolean).reduce((t,e)=>"VIDEO"===e.mediaType?e.sizes.full.mediaUrl||e.thumbnailUrl?e:t:e.sizes.full.mediaUrl||e.mediaUrl?e:t);t=s.sizes,e=s.thumbnailUrl??s.mediaUrl}this.post.mediaUrlIsVideo?this.X=a({type:"behold-video",props:{sizes:t,mediaUrl:e,aspectRatio:this.aspectRatio.reduce((t,e)=>t/e),renderPlaceholder:!1,lazy:this.widgetSettings?.lazyLoadMedia??!0}}):this.X=a({type:"behold-image",props:{sizes:t,mediaUrl:e,aspectRatio:this.aspectRatio.reduce((t,e)=>t/e),lazy:this.widgetSettings?.lazyLoadMedia??!0},listeners:{mouseover:this.B}}),this.X?.addEventListener("load",()=>{this.to(this.hideBackground,600,"mediaLoad")}),this.renderPost(this.X)}static register(t="behold-album-post"){return customElements.get(t)||customElements.define(t,k),t}}var G=":host{--post-border-radius:0;--post-aspect-ratio:1;--icon-instagram:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 35 35' xml:space='preserve'%3E%3Cpath fill='%23FFF' d='M17.6 3.2c4.7 0 5.2 0 7.1.1 1.7.1 2.6.4 3.2.6.8.3 1.4.7 2 1.3.6.6 1 1.2 1.3 2 .2.6.5 1.5.6 3.3.1 1.8.1 2.4.1 7.1s0 5.2-.1 7.1c-.1 1.7-.4 2.6-.6 3.2-.6 1.5-1.8 2.7-3.3 3.3-.6.2-1.5.5-3.2.6-1.8.1-2.4.1-7.1.1s-5.2 0-7.1-.1c-1.7-.1-2.6-.4-3.2-.6-.8-.3-1.4-.7-2-1.3-.6-.6-1-1.2-1.3-2-.2-.6-.5-1.5-.6-3.2-.1-1.8-.1-2.4-.1-7.1s0-5.2.1-7.1c0-1.8.3-2.7.6-3.3.3-.8.7-1.4 1.3-2 .6-.6 1.2-1 2-1.3.6-.2 1.5-.5 3.2-.6 1.9-.1 2.4-.1 7.1-.1m0-3.2c-4.8 0-5.3 0-7.2.1-1.9.1-3.2.4-4.3.8C5 1.4 3.9 2 3 2.9c-.9.9-1.5 2-2 3.1C.6 7.1.3 8.4.2 10.2c-.1 1.9-.1 2.5-.1 7.2s0 5.3.1 7.2c.1 2 .4 3.2.8 4.4.4 1.2 1.1 2.2 2 3.1.9.9 1.9 1.6 3.1 2 1.1.4 2.4.7 4.2.8s2.5.1 7.2.1 5.3 0 7.2-.1c1.9-.1 3.1-.4 4.2-.8 2.3-.9 4.2-2.8 5.1-5.1.4-1.1.7-2.4.8-4.2.1-1.9.1-2.5.1-7.2s0-5.3-.1-7.2c-.1-1.9-.4-3.1-.8-4.2-.4-1.2-1.1-2.2-2-3.1-.9-.9-1.9-1.6-3.1-2-1.1-.4-2.4-.7-4.2-.8-1.8-.3-2.4-.3-7.1-.3z'/%3E%3Cpath fill='%23FFF' d='M17.6 8.5c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 14.8c-3.2 0-5.8-2.6-5.8-5.8s2.6-5.8 5.8-5.8 5.8 2.6 5.8 5.8-2.6 5.8-5.8 5.8z'/%3E%3Ccircle fill='%23FFF' cx='26.9' cy='8.2' r='2.1'/%3E%3C/svg%3E\");--icon-video:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 35 35' xml:space='preserve'%3E%3Cpath fill='%23FFF' d='M30.1 15.5 7.2 2.3c-1.5-.9-3.5.2-3.5 1.9v26.5c0 1.7 1.9 2.9 3.4 1.9L30 19.4c1.7-.8 1.7-3 .1-3.9z'/%3E%3C/svg%3E\");--icon-album:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 35 35' xml:space='preserve'%3E%3Cpath fill='%23FFF' d='M27.3 22.7v-17c0-2.6-2.1-4.7-4.7-4.7H5.7C3.1 1 1 3.1 1 5.7v17c0 2.6 2.1 4.7 4.7 4.7h17c2.5-.1 4.6-2.2 4.6-4.7zm4-13.4v14.6c0 4.1-3.4 7.4-7.4 7.4H9.2c-.5 0-.8.6-.5 1 .9 1 2.2 1.6 3.7 1.6h12.1c5.2 0 9.3-4.2 9.3-9.3V12.5c0-1.5-.6-2.8-1.6-3.7-.3-.4-.9 0-.9.5z'/%3E%3C/svg%3E\");align-items:center;border:none;box-shadow:none;box-sizing:border-box;display:flex;flex-wrap:wrap;justify-content:center;margin:0;min-width:50px;outline:none;position:relative;width:100%}:host *{box-sizing:border-box}:host(.keyboard-nav.has-focus){outline:none}:host(.keyboard-nav.has-focus):before{background-color:rgba(0,0,0,.25);border-radius:6px;content:\"\";display:block;height:100%;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:100%;z-index:1}:host(.keyboard-nav.has-focus):after{background-color:#222;border-radius:6px;box-shadow:0 0 0 2px #4169e1,0 0 0 3px #fff,0 .6px .4px rgba(0,0,0,.042),0 1.3px 1px rgba(0,0,0,.061),0 2.5px 1.9px rgba(0,0,0,.075),0 4.5px 3.4px rgba(0,0,0,.089),0 8.4px 6.3px rgba(0,0,0,.108),0 20px 15px rgba(0,0,0,.15);color:#fff;content:\"Shift + arrow keys to navigate posts\";font-family:sans-serif;font-size:16px;max-width:80%;padding:15px;position:absolute;text-align:center;z-index:1}@media (max-width:1300px){:host(.keyboard-nav.has-focus):after{font-size:15px}}:host(.keyboard-nav.has-focus) .posts{opacity:.65}behold-branding{--br:100px!important;--color:#1a1a1a!important;--bg:#fff!important;--dur:0.2s!important;border-radius:var(--br)!important;bottom:10px!important;display:flex!important;position:absolute!important;right:10px!important;z-index:999!important}@media (hover:hover){behold-branding:hover{--bg:#1a1a1a!important;--color:#fff!important}}behold-branding a{align-items:center!important;background:var(--bg)!important;border:none!important;border-radius:var(--br)!important;box-shadow:0 0 0 1px #1a1a1a,1px 1px 1px rgba(0,0,0,.08),2px 1.25px 1.25px rgba(0,0,0,.06),3px 2.5px 2.5px rgba(0,0,0,.04),5px 5px 5px rgba(0,0,0,.02)!important;display:flex!important;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif!important;height:27px!important;justify-content:center!important;letter-spacing:.01em!important;margin:0!important;opacity:0!important;padding:0 1px 0 0!important;pointer-events:all!important;text-decoration:none!important;transform:translateY(8px)!important;transition:all .3s ease!important;visibility:visible!important;width:157px!important}behold-branding a,behold-branding a:before{color:var(--color)!important;line-height:1!important}behold-branding a:before{content:\"Made with\"!important;font-size:10px!important;margin-right:7px!important;transition:all var(--dur) ease!important;white-space:no-wrap!important}behold-branding a:after{background:transparent!important;content:\"\"!important;height:47px!important;left:-10px;position:absolute;top:-10px;width:179px!important}behold-branding svg{border:none!important;display:block!important;height:11px!important;margin:0!important;opacity:1!important;padding:0!important;visibility:visible!important;width:auto!important}behold-branding svg path{fill:var(--color)!important;transition:all var(--dur) ease!important}.posts{display:grid;margin:0;max-width:100%;padding:0;width:100%}.post{-webkit-font-smoothing:inherit;-moz-osx-font-smoothing:inherit;corner-shape:var(--post-corner-shape,round);align-self:stretch;border:var(--post-border-width,0) solid var(--post-border-color,#000);border-radius:var(--post-border-radius) /calc(var(--post-border-radius)*var(--post-aspect-ratio));color:inherit;font:inherit;isolation:isolate;line-height:normal;margin:0 0 -1px;overflow:hidden;transform:translateZ(0);transition:background .3s ease;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:calc(100% + .5px)}:host(.keyboard-nav) .post.post:focus-within{box-shadow:0 0 0 1px #fff,0 0 0 3px #4169e1,0 0 0 4px #fff;z-index:1}:host(.is-previewing-loading-colors) .post *{opacity:0}.post.post--has-row-gap,.post.post--last-row{margin:0}.post:before{corner-shape:var(--post-corner-shape,round);background-color:transparent;border-radius:var(--post-border-radius) /calc(var(--post-border-radius)*var(--post-aspect-ratio));content:\"\";height:calc(100% + var(--post-border-width, 0px)*2);left:calc(var(--post-border-width, 0px)*-1);pointer-events:none;position:absolute;top:calc(var(--post-border-width, 0px)*-1);transition:all 2s cubic-bezier(.215,.61,.355,1);width:calc(100% + var(--post-border-width, 0px)*2);z-index:2}@supports (backdrop-filter:blur(3px)){[data-hover-effect*=blur i] .post:before{height:calc(100% + var(--post-border-width, 0px)*2 - 1px);opacity:0;transition:all .6s cubic-bezier(.215,.61,.355,1)}}.post.post--hover-icon:after{corner-shape:var(--post-corner-shape,round);background-image:var(--icon);background-position:50%;background-repeat:no-repeat;background-size:auto 100%;border-radius:var(--post-border-radius) /calc(var(--post-border-radius)*var(--post-aspect-ratio));content:\"\";height:12%;height:calc(min(var(--post-width), var(--post-height))*.12);left:0;max-height:30px;min-height:20px;opacity:0;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%) scale(.75);transition:all .6s cubic-bezier(.215,.61,.355,1);width:100%;will-change:transform;z-index:3}@media (prefers-reduced-motion){.post.post--hover-icon:after{transition:none}}.post>a,.post>button,.post>div{background-color:transparent;border:0;box-shadow:none;color:inherit;display:block;font:inherit;height:100%;line-height:inherit;outline:none;padding:0;transition:opacity .3s ease;width:100%}.post a,.post button{cursor:pointer}behold-image-post{--icon:var(--icon-instagram);--post-background-color:transparent}behold-image-post,behold-video-post{background-color:var(--post-background-color)}behold-video-post{--icon:var(--icon-video);--post-background-color:transparent}behold-video-post .video-thumbnail{height:100%;left:0;-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center;position:absolute;top:0;width:100%}behold-album-post{--icon:var(--icon-album);--post-background-color:transparent;background-color:var(--post-background-color)}.post-caption{align-items:center;background-color:var(--overlay-color);display:flex;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-size:15px;height:100%;justify-content:center;left:0;line-height:1.5;opacity:0;padding:15%;pointer-events:none;position:absolute;top:0;transition:opacity .4s ease;width:100%;z-index:2}.post:hover .post-caption,:host(:host(.keyboard-nav)) .post:focus-within .post-caption{opacity:1}.post--xlarge .post-caption{--lines:12;--innerScale:scale(0.98);padding:20%}.post--large .post-caption{--lines:9;--innerScale:scale(0.98)}.post--medium .post-caption{--lines:6;--innerScale:scale(0.97);font-size:14px}.post--small .post-caption{--lines:4;--innerScale:scale(0.95);font-size:13px;line-height:1.25}.post--xsmall .post-caption{--lines:3;--innerScale:scale(0.95);font-size:12px;line-height:1.25}.post-caption__inner{line-clamp:var(--lines);-webkit-line-clamp:var(--lines);-webkit-box-orient:vertical;color:#fff;display:-webkit-box;opacity:0;overflow:hidden;text-align:center;transform:var(--innerScale);transition:all .3s ease;white-space:pre-line;will-change:transform,opacity;word-break:none}@media (prefers-reduced-motion){.post-caption__inner{transform:none}}.post:hover .post-caption__inner,:host(.keyboard-nav) .post:focus-within .post-caption__inner{opacity:1;transform:none;transition:all .3s ease}:host(.keyboard-nav) .post:focus-within:before{background-color:var(--overlay-color);transition:all .6s cubic-bezier(.215,.61,.355,1)}:host(.keyboard-nav) .post:focus-within:after{opacity:1;transform:translateY(-50%)}:host(.keyboard-nav) [data-hover-effect=fade] .post:focus-within:before,[data-hover-effect=fade] .post:hover:before{background-color:var(--overlay-color);transition:all .6s cubic-bezier(.215,.61,.355,1)}:host(.keyboard-nav) [data-hover-effect=fade] .post:focus-within:after,[data-hover-effect=fade] .post:hover:after{opacity:1;transform:translateY(-50%)}:host(.keyboard-nav) [data-hover-effect=zoomFade] .post:focus-within behold-image img,:host(.keyboard-nav) [data-hover-effect=zoomFade] .post:focus-within behold-video video,[data-hover-effect=zoomFade] .post:hover behold-image img,[data-hover-effect=zoomFade] .post:hover behold-video video{transform:scale(1.05)}@media (prefers-reduced-motion){:host(.keyboard-nav) [data-hover-effect=zoomFade] .post:focus-within behold-image img,:host(.keyboard-nav) [data-hover-effect=zoomFade] .post:focus-within behold-video video,[data-hover-effect=zoomFade] .post:hover behold-image img,[data-hover-effect=zoomFade] .post:hover behold-video video{transform:none}}:host(.keyboard-nav) [data-hover-effect=zoomFade] .post:focus-within:before,[data-hover-effect=zoomFade] .post:hover:before{background-color:var(--overlay-color);transition:all .6s cubic-bezier(.215,.61,.355,1)}:host(.keyboard-nav) [data-hover-effect=zoomFade] .post:focus-within:after,[data-hover-effect=zoomFade] .post:hover:after{opacity:1;transform:translateY(-50%)}@supports not (backdrop-filter:blur(3px)){:host(.keyboard-nav) [data-hover-effect=blur] .post:focus-within behold-image,:host(.keyboard-nav) [data-hover-effect=blur] .post:focus-within behold-video,[data-hover-effect=blur] .post:hover behold-image,[data-hover-effect=blur] .post:hover behold-video{filter:brightness(97%) blur(3px);transition:all .6s cubic-bezier(.215,.61,.355,1)}}@supports (backdrop-filter:blur(3px)){:host(.keyboard-nav) [data-hover-effect=blur] .post:focus-within:before,[data-hover-effect=blur] .post:hover:before{backdrop-filter:blur(3px);background-color:rgba(0,0,0,.002);opacity:1}}:host(.keyboard-nav) [data-hover-effect=blur] .post:focus-within:after,[data-hover-effect=blur] .post:hover:after{opacity:1;transform:translateY(-50%)}:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within behold-image,:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within behold-video,[data-hover-effect=zoomBlur] .post:hover behold-image,[data-hover-effect=zoomBlur] .post:hover behold-video{transform:scale(1.05);transition:all .6s cubic-bezier(.215,.61,.355,1)}@media (prefers-reduced-motion){:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within behold-image,:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within behold-video,[data-hover-effect=zoomBlur] .post:hover behold-image,[data-hover-effect=zoomBlur] .post:hover behold-video{transform:none}}@supports not (backdrop-filter:blur(3px)){:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within behold-image,:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within behold-video,[data-hover-effect=zoomBlur] .post:hover behold-image,[data-hover-effect=zoomBlur] .post:hover behold-video{filter:brightness(97%) blur(3px)}}@supports (backdrop-filter:blur(3px)){:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within:before,[data-hover-effect=zoomBlur] .post:hover:before{backdrop-filter:blur(3px);background-color:rgba(0,0,0,.002);opacity:1}}:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within:after,[data-hover-effect=zoomBlur] .post:hover:after{opacity:1;transform:translateY(-50%)}:host(.keyboard-nav) [data-hover-effect=toGreyscale] .post:focus-within behold-image,:host(.keyboard-nav) [data-hover-effect=toGreyscale] .post:focus-within behold-video,[data-hover-effect=toGreyscale] .post:hover behold-image,[data-hover-effect=toGreyscale] .post:hover behold-video{filter:grayscale(100%);transition:all .6s cubic-bezier(.215,.61,.355,1)}:host(.keyboard-nav) [data-hover-effect=toGreyscale] .post:focus-within:after,[data-hover-effect=toGreyscale] .post:hover:after{opacity:1;transform:translateY(-50%)}:host(.keyboard-nav) [data-hover-effect=zoomToGreyscale] .post:focus-within behold-image,:host(.keyboard-nav) [data-hover-effect=zoomToGreyscale] .post:focus-within behold-video,[data-hover-effect=zoomToGreyscale] .post:hover behold-image,[data-hover-effect=zoomToGreyscale] .post:hover behold-video{filter:grayscale(100%);transform:scale(1.05);transition:all .6s cubic-bezier(.215,.61,.355,1)}@media (prefers-reduced-motion){:host(.keyboard-nav) [data-hover-effect=zoomToGreyscale] .post:focus-within behold-image,:host(.keyboard-nav) [data-hover-effect=zoomToGreyscale] .post:focus-within behold-video,[data-hover-effect=zoomToGreyscale] .post:hover behold-image,[data-hover-effect=zoomToGreyscale] .post:hover behold-video{transform:none}}:host(.keyboard-nav) [data-hover-effect=zoomToGreyscale] .post:focus-within:after,[data-hover-effect=zoomToGreyscale] .post:hover:after{opacity:1;transform:translateY(-50%)}:host(.keyboard-nav) [data-hover-effect=fromGreyscale] .post,[data-hover-effect=fromGreyscale] .post{filter:grayscale(100%)}:host(.keyboard-nav) [data-hover-effect=fromGreyscale] .post:focus,:host(.keyboard-nav) [data-hover-effect=fromGreyscale] .post:hover,[data-hover-effect=fromGreyscale] .post:focus,[data-hover-effect=fromGreyscale] .post:hover{filter:grayscale(0);transition:all .6s cubic-bezier(.215,.61,.355,1)}:host(.keyboard-nav) [data-hover-effect=fromGreyscale] .post:focus.post--hover-caption:before,:host(.keyboard-nav) [data-hover-effect=fromGreyscale] .post:hover.post--hover-caption:before,[data-hover-effect=fromGreyscale] .post:focus.post--hover-caption:before,[data-hover-effect=fromGreyscale] .post:hover.post--hover-caption:before{background-color:var(--overlay-color);transition:all .6s cubic-bezier(.215,.61,.355,1)}:host(.keyboard-nav) [data-hover-effect=fromGreyscale] .post:focus:after,:host(.keyboard-nav) [data-hover-effect=fromGreyscale] .post:hover:after,[data-hover-effect=fromGreyscale] .post:focus:after,[data-hover-effect=fromGreyscale] .post:hover:after{opacity:1;transform:translateY(-50%)}:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post,[data-hover-effect=zoomFromGreyscale] .post{filter:grayscale(100%)}:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:focus,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:hover,[data-hover-effect=zoomFromGreyscale] .post:focus,[data-hover-effect=zoomFromGreyscale] .post:hover{filter:grayscale(0)}:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:focus behold-image,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:focus behold-video,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:hover behold-image,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:hover behold-video,[data-hover-effect=zoomFromGreyscale] .post:focus behold-image,[data-hover-effect=zoomFromGreyscale] .post:focus behold-video,[data-hover-effect=zoomFromGreyscale] .post:hover behold-image,[data-hover-effect=zoomFromGreyscale] .post:hover behold-video{transform:scale(1.05);transition:all .6s cubic-bezier(.215,.61,.355,1)}@media (prefers-reduced-motion){:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:focus behold-image,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:focus behold-video,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:hover behold-image,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:hover behold-video,[data-hover-effect=zoomFromGreyscale] .post:focus behold-image,[data-hover-effect=zoomFromGreyscale] .post:focus behold-video,[data-hover-effect=zoomFromGreyscale] .post:hover behold-image,[data-hover-effect=zoomFromGreyscale] .post:hover behold-video{transform:none}}:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:focus.post--hover-caption:before,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:hover.post--hover-caption:before,[data-hover-effect=zoomFromGreyscale] .post:focus.post--hover-caption:before,[data-hover-effect=zoomFromGreyscale] .post:hover.post--hover-caption:before{background-color:var(--overlay-color);transition:all .6s cubic-bezier(.215,.61,.355,1)}:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:focus:after,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:hover:after,[data-hover-effect=zoomFromGreyscale] .post:focus:after,[data-hover-effect=zoomFromGreyscale] .post:hover:after{opacity:1;transform:translateY(-50%)}behold-image{display:block;height:0;min-height:100%;overflow:hidden;padding:0;padding-bottom:calc(100%/var(--post-aspect-ratio));position:relative;transition:all .6s cubic-bezier(.215,.61,.355,1);width:100%}behold-image img{border-radius:0;height:100%;left:0;-o-object-fit:cover;object-fit:cover;-o-object-position:center center;object-position:center center;opacity:0;pointer-events:none;position:absolute;top:0;transition:all .6s cubic-bezier(.215,.61,.355,1),opacity .6s ease;vertical-align:middle;width:100%;will-change:transform;z-index:1}@supports not (backdrop-filter:blur(3px)){[data-hover-effect=blur] behold-image img,[data-hover-effect=zoomBlur] behold-image img{height:calc(100% + 6px);left:-3px;top:-3px;width:calc(100% + 6px)}}.post--reel behold-image img{-o-object-position:center 25%;object-position:center 25%}behold-image.is-loaded img{opacity:1}behold-video{display:block;height:0;min-height:100%;overflow:hidden;padding:0;padding-bottom:calc(100%/var(--post-aspect-ratio));position:relative;transition:all .6s cubic-bezier(.215,.61,.355,1);width:100%}behold-video video{height:100%;left:0;-o-object-fit:cover;object-fit:cover;-o-object-position:center center;object-position:center center;opacity:0;pointer-events:none;position:absolute;top:0;transition:all .6s cubic-bezier(.215,.61,.355,1),opacity .6s ease;vertical-align:middle;width:100%;will-change:transform}.post--reel behold-video video{-o-object-position:center 25%;object-position:center 25%}behold-video.is-loaded video{opacity:1}";export{k as A,v as B,y as I,x as V,w as a,z as b,G as c,f as g,p as r};
1
+ import{B as t,s as e,j as o,k as s,n as i,c as a,t as r,h,f as n,l,r as d,p as c}from"./index-DlG54u5e.js";function p(t){if(!t)return[0,0,39];let[e,o,s]=t.split(",").map(t=>parseInt(t));e/=255,o/=255,s/=255;const i=Math.max(e,o,s),a=i-Math.min(e,o,s),r=a?i===e?(o-s)/a:i===o?2+(s-e)/a:4+(e-o)/a:0;return[60*r<0?60*r+360:60*r,100*(a?i<=.5?a/(2*i-a):a/(2-(2*i-a)):0),100*(2*i-a)/2].map(t=>Math.round(t))}function f(t,e){const o=(s=t,i=e="tone"===e?"dominant":e,s.filter(t=>t[i]).map(t=>t[i])).map(t=>p(t).join(","));var s,i;return[b(m(o,0)),b(m(o,1)),b(m(o,2))].map(t=>String(t))}function b(t){const e=[...t];e.sort(function(t,e){return t-e});const o=Math.floor((e.length-1)/2);return e.length%2?e[o]:(e[o]+e[o+1])/2}function m(t,e){return t.map(t=>parseInt(t.split(",")[e]))}class v extends t{label="BaseWidget";shadow;styleEl;contents;shouldRenderStyles;stylesAdded;styles;constructor(){super(),this.shadow=this.attachShadow({mode:"open"}),this.handleKeydown=this.handleKeydown.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleFocusout=this.handleFocusout.bind(this),this.handleShadowFocusout=this.handleShadowFocusout.bind(this),this.onGlobalStateChange(()=>{e(this,{"keyboard-nav":this.globalState.keyboardNavEnabled})}),this.onConnect(()=>{this.styleEl=document.createElement("style"),e(this,{"keyboard-nav":this.globalState.keyboardNavEnabled}),this.addEventListener("focus",this.handleFocus),this.addEventListener("focusout",this.handleFocusout),this.shadow.addEventListener("focusout",this.handleShadowFocusout),this.addEventListener("keydown",this.handleKeydown),this.onLoop(()=>{!this.stylesAdded&&this.shouldRenderStyles&&(this.styleEl&&this.styles&&this.styleEl.replaceChildren(...this.styles.map(t=>t.toString())),this.shadow.replaceChildren(this.contents,this.styleEl),this.stylesAdded=!0)})})}focusPreviousPost(){this.dispatchEvent(new CustomEvent("post-focus-previous"))}focusNextPost(){this.dispatchEvent(new CustomEvent("post-focus-next"))}handleKeydown(t){"ArrowLeft"===t.key&&t.shiftKey&&this.focusPreviousPost(),"ArrowRight"===t.key&&t.shiftKey&&this.focusNextPost(),this.shadow.activeElement&&this.classList.remove("has-focus")}handleFocus(t){this.shadow.activeElement||this.classList.add("has-focus")}handleFocusout(){this.classList.remove("has-focus")}handleShadowFocusout(t){t.relatedTarget===this&&this.classList.add("has-focus")}renderWidget(t,e){this.stylesAdded&&this.contents?this.contents.replaceWith(t):(this.contents=t,this.styles=e,this.shouldRenderStyles=!0)}}function u(t){return t?`hsl(${t[0]}, ${t[1]}%, ${t[2]}%, ${Math.max(1*Math.random(),.3)})`:""}class g extends t{label="BasePost";post;widgetSettings;feedMetadata;medianPaletteHSL=["0","0","39"];hasRowGap=!1;isLastRow=!1;onClick=()=>{};previewLoadingColors;backgroundIsHidden=!1;backgroundColor="rgba(100,100,100)";aspectRatio=[1,1];index=0;totalPosts;t;o;constructor(){super(),this.onPropChange(this.i,["post","widgetSettings","feedMetadata","medianPaletteHSL","hasRowGap","isLastRow","previewLoadingColors","aspectRatio","index","totalPosts"],["post","widgetSettings","feedMetadata","medianPaletteHSL","index","totalPosts"]),this.h=this.h.bind(this),this.hideBackground=this.hideBackground.bind(this),this.onConnect(()=>{this.onResize(this,this,this.l)})}i({changedProp:t,oldValue:e,newValue:s}){switch(t){case"post":o(s,e,["colorPalette"])&&this.p();break;case"widgetSettings":if(!s)return;o(s,e,["loadingColor","loadingColorTone"])&&this.p(),this.t&&o(s,e,["linkTarget"])&&s?.onPostClick?.toLowerCase().includes("link")&&this.t.setAttribute("target",s.linkTarget),this.t&&o(s,e,["customLinkURL"])&&"customLink"===s.onPostClick&&this.t.setAttribute("href",s.customLinkURL),o(s,e,["hoverOverlayColor","hoverOverlayCustomColor","hoverOverlayOpacity"])&&this.m(),this.v();break;case"previewLoadingColors":s?(this.style.backgroundColor="",this.p()):this.backgroundIsHidden&&this.hideBackground();break;case"hasRowGap":case"isLastRow":this.v()}}m(){let t="rgba(0, 0, 0, 0.3)",e=this.widgetSettings?.hoverOverlayCustomColor??"0,0,0",o=this.widgetSettings?.hoverOverlayOpacity??65;if("auto"===this.widgetSettings?.hoverOverlayColor){const e=p(this.post?.colorPalette?.dominant||"100,100,100");t=`hsl(${e[0]} ${Math.min(e[1],50)}% ${Math.min(e[2],40)}% / ${o}%)`}"custom"===this.widgetSettings?.hoverOverlayColor&&(t=s(e,o,"0,0,0")),i(this,{"--overlay-color":t})}v(){e(this,{post:!0,"post--hover-icon":"showIcon"===this.widgetSettings?.onHover,"post--hover-caption":"showCaption"===this.widgetSettings?.onHover,"post--has-row-gap":this.hasRowGap,"post--last-row":this.isLastRow}),this.m(),this.p()}renderPost(t){let e="div",o=this.post?.permalink;this.v(),"linkToProfile"===this.widgetSettings?.onPostClick&&this.feedMetadata?.username&&(o=`https://instagram.com/${this.feedMetadata.username}`),"customLink"===this.widgetSettings?.onPostClick&&this.widgetSettings?.customLinkURL&&(o=this.widgetSettings?.customLinkURL),this.widgetSettings?.onPostClick.toLowerCase().includes("link")&&(e="a"),this.widgetSettings?.onPostClick.toLowerCase().includes("popup")&&(e="button");let s=null;if("showCaption"===this.widgetSettings?.onHover){const t=a({contents:this.post?.prunedCaption?.length?this.post?.prunedCaption:this.post?.caption,classes:"post-caption__inner"});s=a({contents:t,classes:"post-caption"})}let i="image";switch(this.post?.mediaType){case"VIDEO":i=this.post.isReel?"reel":"video";break;case"CAROUSEL_ALBUM":i="album";break;default:i="image"}t&&(this.t=a({type:e,contents:[t,s||""],attributes:{draggable:"false","aria-label":`${i}, post ${this.index+1} of ${this.totalPosts}`,tabindex:-1,..."a"===e?{href:o,target:this.widgetSettings?.linkTarget}:{}},listeners:{..."button"===e?{click:this.h}:{}}})),this.replaceChildren(this.t??"")}hideBackground(){this.backgroundIsHidden=!0,this.previewLoadingColors||(this.style.backgroundColor="transparent")}p(){const t=function(t,e,o,s){let i="";switch(t){case"dominant":case"vibrant":case"muted":case"vibrantLight":case"mutedLight":case"vibrantDark":case"mutedDark":i=e?`rgb(${e[t]})`:u(s);break;case"tone":if(o){const t=o.split(",");if(e){const o=(a=p(e.dominant)[2]-s[2],Math.log(Math.abs(a))/Math.log(1.6)*Math.sign(a));i=`hsl(${t[0]},${t[1]}%,${parseInt(t[2])+o}%)`}else i=`hsl(${t[0]},${t[1]}%,${t[2]}%, ${Math.max(1*Math.random(),.3)})`}else i=u(s)}var a;return i}(this.previewLoadingColors?this.previewLoadingColors:this.widgetSettings?.loadingColor,this.post?.colorPalette,this.widgetSettings?.loadingColorTone,this.medianPaletteHSL);this.backgroundColor=t,i(this,{"--post-background-color":t})}l(t){const o=t?.borderBoxSize?.[0]?.inlineSize||t?.contentRect?.width||0;i(this,{"--post-width":o+"px","--post-height":(t?.borderBoxSize?.[0]?.blockSize||t?.contentRect?.height||0)+"px"});let s="xlarge";o<600&&(s="large"),o<400&&(s="medium"),o<250&&(s="small"),o<175&&(s="xsmall"),["xsmall","small","medium","large","xlarge"].forEach(t=>{e(this,{[`post--${t}`]:t===s})})}h(){this.onClick&&this.onClick(this)}focus(){this.t?.focus()}}class y extends t{label="Image";sizes;useOriginalAspectRatio=!1;mediaUrl;aspectRatio=1;showLoader=!1;lazy=!0;u;k;G={isLoaded:!1,isVisible:!1,didError:!1,shouldPreload:!1,loaderIsShowing:!1};_;constructor(){super(),this.onPropChange(this.F,["sizes","mediaUrl","aspectRatio","showLoader"],["sizes","mediaUrl","aspectRatio"]),this.onLocalStateChange(this.P,this.G),this.C=this.C.bind(this),this.S=this.S.bind(this),this.L=this.L.bind(this),this._=r(this.l,50,this),this.preload=this.preload.bind(this),this.onConnect(()=>{const t=this.aspectRatio?(this.useOriginalAspectRatio?this.sizes?.full.uncropped?.height:this.sizes?.full.height)??300:300,e=this.aspectRatio?(this.useOriginalAspectRatio?this.sizes?.full.uncropped?.width:this.sizes?.full.width)??300:300*this.aspectRatio;this.style.aspectRatio=this.aspectRatio?`${this.aspectRatio}`:`${e}/${t}`;let o=this.sizes?.full.height?h(e,t):this.mediaUrl??h(e,t);this.u=a({type:"img",attributes:{alt:"",role:"presentation",height:t+"px",width:e+"px",tabindex:-1,src:o,draggable:"false"},listeners:{load:this.S,error:this.L}}),this.showLoader?(this.k=a({classes:"ldr"}),this.replaceChildren(this.k,this.u)):this.replaceChildren(this.u),this.lazy||this.preload(),n(),this.raf(()=>{this.onResize(this,this,this._),this.onIntersection(this,this.C)},"connect")}),this.onDisconnect(()=>{this.updateLocalState({isVisible:!1,isLoaded:!1}),this.u&&(this.u.removeEventListener("load",this.S),this.u.removeEventListener("error",this.L))})}F({changedProp:t,oldValue:e,newValue:o}){switch(t){case"showLoader":!e&&o&&this.u&&(this.k=a({classes:"ldr"}),this.replaceChildren(this.k,this.u));break;case"sizes":if(l(e,o))return;this.updateLocalState({isLoaded:!1,sizeObj:this.u?.isConnected?this.M(this.offsetWidth,this.offsetHeight):null})}}P({changedProps:t,newState:o}){if(t.includes("loaderIsShowing")&&this.k&&e(this.k,{"ldr--visible":!!o.loaderIsShowing&&!o.isLoaded}),t.includes("imageSrc")){const t=o.imageSrc;this.u&&(o.isVisible||o.shouldPreload)&&t!==this.u.src&&this.u.setAttribute("src",t)}if(t.includes("sizeObj")&&!o.didError){const t=o.sizeObj,e=this.mediaUrl;this.updateLocalState({imageSrc:t?.mediaUrl??e})}}C(t){t.isIntersecting?(this.updateLocalState({isVisible:!0}),!this.localState.isLoaded&&this.showLoader&&this.to(()=>{this.updateLocalState({loaderIsShowing:!0})},50,"loader"),this.localState.imageSrc&&this.u?.src!==this.localState.imageSrc&&this.u?.setAttribute("src",this.localState.imageSrc)):this.updateLocalState({isVisible:!1})}l(t){let e=t.borderBoxSize?t.borderBoxSize[0].inlineSize:t.contentRect.width||0,o=t.borderBoxSize?t.borderBoxSize[0].blockSize:t.contentRect.height||0;const s=this.M(e,o),i=this.useOriginalAspectRatio?s?.uncropped?.width:s?.width,a=this.useOriginalAspectRatio?s?.uncropped?.height:s?.height;(!this.localState.sizeObj?.width||this.localState.sizeObj?.width<(i??300)||this.localState.sizeObj?.height<(a??300))&&this.updateLocalState({sizeObj:s})}S(){this.u?.src!==this.localState.imageSrc&&!this.localState.shouldPreload&&this.sizes?.full.height||(this.cancelTo("loader"),this.updateLocalState({isLoaded:!0,loaderIsShowing:!1}),this.dispatchEvent(new Event("load")),this.classList.add("is-loaded"))}L(){this.localState.imageSrc===this.mediaUrl||this.localState.didError||(this.updateLocalState({didError:!0}),this.updateLocalState({imageSrc:this.mediaUrl}))}M(t,e){if(!this.sizes)return;const o=this.useOriginalAspectRatio;return this.sizes?Object.values(this.sizes).reduce((s,i)=>{const a=o?i.uncropped??i:i;return Math.abs(a.width/2-t)<Math.abs(s.width/2-t)||Math.abs(a.height/2-e)<Math.abs(s.height/2-e)?{mediaUrl:i.mediaUrl,...a,...o&&{mediaUrl:d(i.mediaUrl,"original")}}:s},{...this.sizes.full,...o&&{mediaUrl:d(this.sizes.full.mediaUrl,"original")}}):null}preload(){this.localState.isLoaded||(this.localState.imageSrc&&this.localState.sizeObj&&this.u?.src!==this.localState.imageSrc?this.u?.setAttribute("src",this.localState.imageSrc):this.updateLocalState({shouldPreload:!0}))}static register(t="behold-image"){return customElements.get(t)||customElements.define(t,y),t}}class w extends g{label="ImagePost";u;R=!1;constructor(){super(),this.B=this.B.bind(this),y.register(),this.onPropChange(this.F,["post","widgetSettings","aspectRatio"],null,this.j)}F({changedProp:t,oldValue:e,newValue:s}){switch(t){case"widgetSettings":o(s,e,["onHover","onPostClick"])&&this.j();break;case"post":case"aspectRatio":this.j()}}B(){"openPopupGallery"===this.widgetSettings?.onPostClick&&this.post&&!this.R&&(c("img",d(this.post.sizes.full.mediaUrl,"original")),this.R=!0)}j(){if(this.cancelTo("imageLoad"),!this.post)return void console.warn("No post object");const{sizes:t,mediaUrl:e}=this.post;this.u=a({type:"behold-image",props:{sizes:t,mediaUrl:e,aspectRatio:this.aspectRatio.reduce((t,e)=>t/e),lazy:this.widgetSettings?.lazyLoadMedia??!0},listeners:{mouseover:this.B}}),this.u.addEventListener("load",t=>{this.to(this.hideBackground,600,"imageLoad")}),this.renderPost(this.u)}static register(t="behold-image-post"){return customElements.get(t)||customElements.define(t,w),t}}class x extends t{label="Video";mediaUrl;sizes;autoplay=!1;aspectRatio=1;lazy=!0;renderPlaceholder;I;V;U=!0;$=!1;H=!1;O;u;constructor(){super(),this.I=!this.reduceMotion&&(this.autoplay||!1),this.V=!1,this.T=this.T.bind(this),this.C=this.C.bind(this),this.A=this.A.bind(this),this.Y=this.Y.bind(this),this.D=this.D.bind(this),this.N=this.N.bind(this),this.W=this.W.bind(this),this.preload=this.preload.bind(this),this.K=this.K.bind(this),this.onPropChange(({changedProp:t,newValue:e})=>{this.H&&this.mediaUrl&&c("video",this.mediaUrl),"autoplay"===t&&(e&&!this.reduceMotion?this.play():this.pause())},["mediaUrl","sizes","autoplay","aspectRatio","renderPlaceholder"],["mediaUrl","sizes","renderPlaceholder"]),this.onConnect(()=>{document.addEventListener("visibilitychange",this.D),this.onLoop(this.T,30),this.onIntersection(this,this.C),this.render()}),this.onDisconnect(()=>{document.removeEventListener("visibilitychange",this.D),this.O&&(this.O.removeEventListener("play",this.N),this.O.removeEventListener("pause",this.W),this.O.removeEventListener("loadeddata",this.A))})}get isPlaying(){return this.I||!1}get Z(){return this.O&&!!(this.O.currentTime>0&&!this.O.paused&&!this.O.ended&&this.O.readyState>2)}get paused(){return this.O?.paused}get muted(){return this.O?.muted}get isLoaded(){return this.$}render(){this.O=a({type:"video",attributes:{loop:!0,playsinline:!0,crossorigin:"anonymous",tabIndex:-1,disablePictureInPicture:!0,disableremoteplayback:!0,height:this.sizes?.full.height||100,width:this.sizes?.full.width||100},props:{muted:this.U,autoplay:this.autoplay||!1},listeners:{play:this.N,pause:this.W,error:this.Y}}),this.renderPlaceholder&&this.sizes&&(this.u=a({type:"img",attributes:{height:this.sizes?.full.height,width:this.sizes?.full.width,src:h(this.sizes.full.width,this.sizes.full.height)}}),this.replaceChildren(this.u)),this.lazy||this.K()}async T(){if(this.O&&this.isLoaded){if(!this.V&&this.I&&!this.Z)try{this.V=!0,await this.O.play()}catch{}finally{this.V=!1}!this.I&&this.Z&&(this.O.pause(),this.V=!1)}}K(){this.O&&this.mediaUrl?this.O.src!==this.mediaUrl&&(this.O.addEventListener("loadeddata",this.A,{once:!0}),this.O.src=this.mediaUrl,this.O.load()):this.autoplay&&!this.reduceMotion||this.pause()}C(t){t.isIntersecting&&this.O&&this.mediaUrl?this.O.src!==this.mediaUrl&&(this.O.addEventListener("loadeddata",this.A,{once:!0}),this.O.src=this.mediaUrl,this.O.load()):this.autoplay&&!this.reduceMotion||this.pause()}A(){this.$=!0,this.autoplay&&!this.reduceMotion||!this.O||(this.O.currentTime=.25,this.O.pause()),this.dispatchEvent(new Event("load")),this.O&&this.replaceChildren(this.O),n(),this.raf(()=>{this.classList.add("is-loaded")},"_handleVideoLoad")}Y(){this.dispatchEvent(new Event("error"))}N(){this.dispatchEvent(new Event("play"))}W(){this.dispatchEvent(new Event("pause"))}play(){this.I=!0}pause(){this.I=!1}mute(){this.U=!0,this.O&&(this.O.muted=!0)}unmute(){this.U=!1,this.O&&(this.O.muted=!1)}D(){document.hidden&&(this.pause(),this.O&&this.O.pause()),document.hidden||!this.autoplay||this.reduceMotion||this.play()}preload(){!this.$&&this.mediaUrl?c("video",this.mediaUrl):this.H=!0}static register(t="behold-video"){return customElements.get(t)||customElements.define(t,x),t}}class z extends g{label="VideoPost";q;O;u;constructor(){super(),this.onPropChange(this.F,["post","widgetSettings","aspectRatio"],null,this.j),x.register(),y.register(),this.B=this.B.bind(this),this.J=this.J.bind(this),this.onDisconnect(()=>{this.removeEventListener("mouseover",this.B),this.removeEventListener("mouseleave",this.J)})}F({changedProp:t,oldValue:e,newValue:s}){switch(t){case"widgetSettings":o(e,s,["onHover","onPostClick","previewVideosOnHover","autoplayVideos"])&&this.j();break;case"post":case"aspectRatio":this.j()}}B(){this.widgetSettings?.previewVideosOnHover&&this.O&&(this.u?.remove(),this.O?.play())}J(){this.widgetSettings?.autoplayVideos&&!this.reduceMotion||this.O?.pause()}j(){if(this.cancelTo("mediaLoad"),!this.post)return;const{sizes:t,mediaUrl:e,thumbnailUrl:o}=this.post;this.q=document.createDocumentFragment(),(this.widgetSettings?.previewVideosOnHover||this.widgetSettings?.autoplayVideos)&&e||!t.full.mediaUrl&&!o&&e?(this.u=this.widgetSettings?.autoplayVideos?void 0:a({type:"behold-image",classes:"video-thumbnail",props:{sizes:t,mediaUrl:o,aspectRatio:this.aspectRatio.reduce((t,e)=>t/e),lazy:this.widgetSettings?.lazyLoadMedia??!0},listeners:{mouseover:this.B,mouseleave:this.J}}),this.O=a({type:"behold-video",style:{visibility:this.widgetSettings?.autoplayVideos?"":"hidden"},props:{mediaUrl:e,sizes:t,autoplay:this.widgetSettings?.autoplayVideos,aspectRatio:this.aspectRatio.reduce((t,e)=>t/e),renderPlaceholder:!1,lazy:this.widgetSettings?.lazyLoadMedia??!0},listeners:{mouseover:this.B,mouseleave:this.J}}),this.O.addEventListener("load",()=>{this.to(()=>{this.hideBackground(),this.O?.style.setProperty("visibility","")},600,"mediaLoad")}),this.O.addEventListener("error",()=>{this.raf(()=>{this.u=a({type:"behold-image",props:{sizes:t,mediaUrl:o,aspectRatio:this.aspectRatio.reduce((t,e)=>t/e),lazy:this.widgetSettings?.lazyLoadMedia??!0}}),this.u.addEventListener("load",()=>{this.to(this.hideBackground,600,"mediaLoad")}),this.renderPost(this.u)},"mediaError")}),this.u?this.q.replaceChildren(this.O,this.u):this.q.replaceChildren(this.O),this.renderPost(this.q)):(this.u=a({type:"behold-image",props:{sizes:t,mediaUrl:o,aspectRatio:this.aspectRatio.reduce((t,e)=>t/e),lazy:this.widgetSettings?.lazyLoadMedia??!0}}),this.u.addEventListener("load",()=>{this.to(this.hideBackground,600,"mediaLoad")}),this.renderPost(this.u))}static register(t="behold-video-post"){return customElements.get(t)||customElements.define(t,z),t}}class k extends g{label="AlbumPost";X;R=!1;constructor(){super(),this.B=this.B.bind(this),y.register(),x.register(),this.onPropChange(this.F,["post","widgetSettings"],null,this.j)}F({changedProp:t,oldValue:e,newValue:s}){switch(t){case"widgetSettings":o(s,e,["onHover","onPostClick"])&&this.j();break;case"post":case"aspectRatio":this.j()}}B(){"openPopupGallery"===this.widgetSettings?.onPostClick&&this.post&&!this.R&&(c("img",d(this.post.children[0].sizes.full.mediaUrl,"original")),this.R=!0)}j(){if(this.cancelTo("mediaLoad"),!this.post)return;let{sizes:t,mediaUrl:e,children:o}=this.post;if(!t.full.mediaUrl&&!e){const s=o.filter(Boolean).reduce((t,e)=>"VIDEO"===e.mediaType?e.sizes.full.mediaUrl||e.thumbnailUrl?e:t:e.sizes.full.mediaUrl||e.mediaUrl?e:t);t=s.sizes,e=s.thumbnailUrl??s.mediaUrl}this.post.mediaUrlIsVideo?this.X=a({type:"behold-video",props:{sizes:t,mediaUrl:e,aspectRatio:this.aspectRatio.reduce((t,e)=>t/e),renderPlaceholder:!1,lazy:this.widgetSettings?.lazyLoadMedia??!0}}):this.X=a({type:"behold-image",props:{sizes:t,mediaUrl:e,aspectRatio:this.aspectRatio.reduce((t,e)=>t/e),lazy:this.widgetSettings?.lazyLoadMedia??!0},listeners:{mouseover:this.B}}),this.X?.addEventListener("load",()=>{this.to(this.hideBackground,600,"mediaLoad")}),this.renderPost(this.X)}static register(t="behold-album-post"){return customElements.get(t)||customElements.define(t,k),t}}var G=":host{--post-border-radius:0;--post-aspect-ratio:1;--icon-instagram:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 35 35' xml:space='preserve'%3E%3Cpath fill='%23FFF' d='M17.6 3.2c4.7 0 5.2 0 7.1.1 1.7.1 2.6.4 3.2.6.8.3 1.4.7 2 1.3.6.6 1 1.2 1.3 2 .2.6.5 1.5.6 3.3.1 1.8.1 2.4.1 7.1s0 5.2-.1 7.1c-.1 1.7-.4 2.6-.6 3.2-.6 1.5-1.8 2.7-3.3 3.3-.6.2-1.5.5-3.2.6-1.8.1-2.4.1-7.1.1s-5.2 0-7.1-.1c-1.7-.1-2.6-.4-3.2-.6-.8-.3-1.4-.7-2-1.3-.6-.6-1-1.2-1.3-2-.2-.6-.5-1.5-.6-3.2-.1-1.8-.1-2.4-.1-7.1s0-5.2.1-7.1c0-1.8.3-2.7.6-3.3.3-.8.7-1.4 1.3-2 .6-.6 1.2-1 2-1.3.6-.2 1.5-.5 3.2-.6 1.9-.1 2.4-.1 7.1-.1m0-3.2c-4.8 0-5.3 0-7.2.1-1.9.1-3.2.4-4.3.8C5 1.4 3.9 2 3 2.9c-.9.9-1.5 2-2 3.1C.6 7.1.3 8.4.2 10.2c-.1 1.9-.1 2.5-.1 7.2s0 5.3.1 7.2c.1 2 .4 3.2.8 4.4.4 1.2 1.1 2.2 2 3.1.9.9 1.9 1.6 3.1 2 1.1.4 2.4.7 4.2.8s2.5.1 7.2.1 5.3 0 7.2-.1c1.9-.1 3.1-.4 4.2-.8 2.3-.9 4.2-2.8 5.1-5.1.4-1.1.7-2.4.8-4.2.1-1.9.1-2.5.1-7.2s0-5.3-.1-7.2c-.1-1.9-.4-3.1-.8-4.2-.4-1.2-1.1-2.2-2-3.1-.9-.9-1.9-1.6-3.1-2-1.1-.4-2.4-.7-4.2-.8-1.8-.3-2.4-.3-7.1-.3z'/%3E%3Cpath fill='%23FFF' d='M17.6 8.5c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 14.8c-3.2 0-5.8-2.6-5.8-5.8s2.6-5.8 5.8-5.8 5.8 2.6 5.8 5.8-2.6 5.8-5.8 5.8z'/%3E%3Ccircle fill='%23FFF' cx='26.9' cy='8.2' r='2.1'/%3E%3C/svg%3E\");--icon-video:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 35 35' xml:space='preserve'%3E%3Cpath fill='%23FFF' d='M30.1 15.5 7.2 2.3c-1.5-.9-3.5.2-3.5 1.9v26.5c0 1.7 1.9 2.9 3.4 1.9L30 19.4c1.7-.8 1.7-3 .1-3.9z'/%3E%3C/svg%3E\");--icon-album:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 35 35' xml:space='preserve'%3E%3Cpath fill='%23FFF' d='M27.3 22.7v-17c0-2.6-2.1-4.7-4.7-4.7H5.7C3.1 1 1 3.1 1 5.7v17c0 2.6 2.1 4.7 4.7 4.7h17c2.5-.1 4.6-2.2 4.6-4.7zm4-13.4v14.6c0 4.1-3.4 7.4-7.4 7.4H9.2c-.5 0-.8.6-.5 1 .9 1 2.2 1.6 3.7 1.6h12.1c5.2 0 9.3-4.2 9.3-9.3V12.5c0-1.5-.6-2.8-1.6-3.7-.3-.4-.9 0-.9.5z'/%3E%3C/svg%3E\");align-items:center;border:none;box-shadow:none;box-sizing:border-box;display:flex;flex-wrap:wrap;justify-content:center;margin:0;min-width:50px;outline:none;position:relative;width:100%}:host *{box-sizing:border-box}:host(.keyboard-nav.has-focus){outline:none}:host(.keyboard-nav.has-focus):before{background-color:rgba(0,0,0,.25);border-radius:6px;content:\"\";display:block;height:100%;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:100%;z-index:1}:host(.keyboard-nav.has-focus):after{background-color:#222;border-radius:6px;box-shadow:0 0 0 2px #4169e1,0 0 0 3px #fff,0 .6px .4px rgba(0,0,0,.042),0 1.3px 1px rgba(0,0,0,.061),0 2.5px 1.9px rgba(0,0,0,.075),0 4.5px 3.4px rgba(0,0,0,.089),0 8.4px 6.3px rgba(0,0,0,.108),0 20px 15px rgba(0,0,0,.15);color:#fff;content:\"Shift + arrow keys to navigate posts\";font-family:sans-serif;font-size:16px;max-width:80%;padding:15px;position:absolute;text-align:center;z-index:1}@media (max-width:1300px){:host(.keyboard-nav.has-focus):after{font-size:15px}}:host(.keyboard-nav.has-focus) .posts{opacity:.65}behold-branding{--br:100px!important;--color:#1a1a1a!important;--bg:#fff!important;--dur:0.2s!important;border-radius:var(--br)!important;bottom:10px!important;display:flex!important;position:absolute!important;right:10px!important;z-index:999!important}@media (hover:hover){behold-branding:hover{--bg:#1a1a1a!important;--color:#fff!important}}behold-branding a{align-items:center!important;background:var(--bg)!important;border:none!important;border-radius:var(--br)!important;box-shadow:0 0 0 1px #1a1a1a,1px 1px 1px rgba(0,0,0,.08),2px 1.25px 1.25px rgba(0,0,0,.06),3px 2.5px 2.5px rgba(0,0,0,.04),5px 5px 5px rgba(0,0,0,.02)!important;display:flex!important;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif!important;height:27px!important;justify-content:center!important;letter-spacing:.01em!important;margin:0!important;opacity:0!important;padding:0 1px 0 0!important;pointer-events:all!important;text-decoration:none!important;transform:translateY(8px)!important;transition:all .3s ease!important;visibility:visible!important;width:157px!important}behold-branding a,behold-branding a:before{color:var(--color)!important;line-height:1!important}behold-branding a:before{content:\"Made with\"!important;font-size:10px!important;margin-right:7px!important;transition:all var(--dur) ease!important;white-space:no-wrap!important}behold-branding a:after{background:transparent!important;content:\"\"!important;height:47px!important;left:-10px;position:absolute;top:-10px;width:179px!important}behold-branding svg{border:none!important;display:block!important;height:11px!important;margin:0!important;opacity:1!important;padding:0!important;visibility:visible!important;width:auto!important}behold-branding svg path{fill:var(--color)!important;transition:all var(--dur) ease!important}.posts{display:grid;margin:0;max-width:100%;padding:0;width:100%}.post{-webkit-font-smoothing:inherit;-moz-osx-font-smoothing:inherit;corner-shape:var(--post-corner-shape,round);align-self:stretch;border:var(--post-border-width,0) solid var(--post-border-color,#000);border-radius:var(--post-border-radius) /calc(var(--post-border-radius)*var(--post-aspect-ratio));color:inherit;font:inherit;isolation:isolate;line-height:normal;margin:0 0 -1px;overflow:hidden;transform:translateZ(0);transition:background .3s ease;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:calc(100% + .5px)}:host(.keyboard-nav) .post.post:focus-within{box-shadow:0 0 0 1px #fff,0 0 0 3px #4169e1,0 0 0 4px #fff;z-index:1}:host(.is-previewing-loading-colors) .post *{opacity:0}.post.post--has-row-gap,.post.post--last-row{margin:0}.post:before{corner-shape:var(--post-corner-shape,round);background-color:transparent;border-radius:var(--post-border-radius) /calc(var(--post-border-radius)*var(--post-aspect-ratio));content:\"\";height:calc(100% + var(--post-border-width, 0px)*2);left:calc(var(--post-border-width, 0px)*-1);pointer-events:none;position:absolute;top:calc(var(--post-border-width, 0px)*-1);transition:all 2s cubic-bezier(.215,.61,.355,1);width:calc(100% + var(--post-border-width, 0px)*2);z-index:2}@supports (backdrop-filter:blur(3px)){[data-hover-effect*=blur i] .post:before{height:calc(100% + var(--post-border-width, 0px)*2 - 1px);opacity:0;transition:all .6s cubic-bezier(.215,.61,.355,1)}}.post.post--hover-icon:after{corner-shape:var(--post-corner-shape,round);background-image:var(--icon);background-position:50%;background-repeat:no-repeat;background-size:auto 100%;border-radius:var(--post-border-radius) /calc(var(--post-border-radius)*var(--post-aspect-ratio));content:\"\";height:12%;height:calc(min(var(--post-width), var(--post-height))*.12);left:0;max-height:30px;min-height:20px;opacity:0;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%) scale(.75);transition:all .6s cubic-bezier(.215,.61,.355,1);width:100%;will-change:transform;z-index:3}@media (prefers-reduced-motion){.post.post--hover-icon:after{transition:none}}.post>a,.post>button,.post>div{background-color:transparent;border:0;box-shadow:none;color:inherit;display:block;font:inherit;height:100%;line-height:inherit;outline:none;padding:0;transition:opacity .3s ease;width:100%}.post a,.post button{cursor:pointer}behold-image-post{--icon:var(--icon-instagram);--post-background-color:transparent}behold-image-post,behold-video-post{background-color:var(--post-background-color)}behold-video-post{--icon:var(--icon-video);--post-background-color:transparent}behold-video-post .video-thumbnail{height:100%;left:0;-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center;position:absolute;top:0;width:100%}behold-album-post{--icon:var(--icon-album);--post-background-color:transparent;background-color:var(--post-background-color)}.post-caption{align-items:center;background-color:var(--overlay-color);display:flex;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-size:15px;height:100%;justify-content:center;left:0;line-height:1.5;opacity:0;padding:15%;pointer-events:none;position:absolute;top:0;transition:opacity .4s ease;width:100%;z-index:2}.post:hover .post-caption,:host(:host(.keyboard-nav)) .post:focus-within .post-caption{opacity:1}.post--xlarge .post-caption{--lines:12;--innerScale:scale(0.98);padding:20%}.post--large .post-caption{--lines:9;--innerScale:scale(0.98)}.post--medium .post-caption{--lines:6;--innerScale:scale(0.97);font-size:14px}.post--small .post-caption{--lines:4;--innerScale:scale(0.95);font-size:13px;line-height:1.25}.post--xsmall .post-caption{--lines:3;--innerScale:scale(0.95);font-size:12px;line-height:1.25}.post-caption__inner{line-clamp:var(--lines);-webkit-line-clamp:var(--lines);-webkit-box-orient:vertical;color:#fff;display:-webkit-box;opacity:0;overflow:hidden;text-align:center;transform:var(--innerScale);transition:all .3s ease;white-space:pre-line;will-change:transform,opacity;word-break:none}@media (prefers-reduced-motion){.post-caption__inner{transform:none}}.post:hover .post-caption__inner,:host(.keyboard-nav) .post:focus-within .post-caption__inner{opacity:1;transform:none;transition:all .3s ease}:host(.keyboard-nav) .post:focus-within:before{background-color:var(--overlay-color);transition:all .6s cubic-bezier(.215,.61,.355,1)}:host(.keyboard-nav) .post:focus-within:after{opacity:1;transform:translateY(-50%)}:host(.keyboard-nav) [data-hover-effect=fade] .post:focus-within:before,[data-hover-effect=fade] .post:hover:before{background-color:var(--overlay-color);transition:all .6s cubic-bezier(.215,.61,.355,1)}:host(.keyboard-nav) [data-hover-effect=fade] .post:focus-within:after,[data-hover-effect=fade] .post:hover:after{opacity:1;transform:translateY(-50%)}:host(.keyboard-nav) [data-hover-effect=zoomFade] .post:focus-within behold-image img,:host(.keyboard-nav) [data-hover-effect=zoomFade] .post:focus-within behold-video video,[data-hover-effect=zoomFade] .post:hover behold-image img,[data-hover-effect=zoomFade] .post:hover behold-video video{transform:scale(1.05)}@media (prefers-reduced-motion){:host(.keyboard-nav) [data-hover-effect=zoomFade] .post:focus-within behold-image img,:host(.keyboard-nav) [data-hover-effect=zoomFade] .post:focus-within behold-video video,[data-hover-effect=zoomFade] .post:hover behold-image img,[data-hover-effect=zoomFade] .post:hover behold-video video{transform:none}}:host(.keyboard-nav) [data-hover-effect=zoomFade] .post:focus-within:before,[data-hover-effect=zoomFade] .post:hover:before{background-color:var(--overlay-color);transition:all .6s cubic-bezier(.215,.61,.355,1)}:host(.keyboard-nav) [data-hover-effect=zoomFade] .post:focus-within:after,[data-hover-effect=zoomFade] .post:hover:after{opacity:1;transform:translateY(-50%)}@supports not (backdrop-filter:blur(3px)){:host(.keyboard-nav) [data-hover-effect=blur] .post:focus-within behold-image,:host(.keyboard-nav) [data-hover-effect=blur] .post:focus-within behold-video,[data-hover-effect=blur] .post:hover behold-image,[data-hover-effect=blur] .post:hover behold-video{filter:brightness(97%) blur(3px);transition:all .6s cubic-bezier(.215,.61,.355,1)}}@supports (backdrop-filter:blur(3px)){:host(.keyboard-nav) [data-hover-effect=blur] .post:focus-within:before,[data-hover-effect=blur] .post:hover:before{backdrop-filter:blur(3px);background-color:rgba(0,0,0,.002);opacity:1}}:host(.keyboard-nav) [data-hover-effect=blur] .post:focus-within:after,[data-hover-effect=blur] .post:hover:after{opacity:1;transform:translateY(-50%)}:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within behold-image,:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within behold-video,[data-hover-effect=zoomBlur] .post:hover behold-image,[data-hover-effect=zoomBlur] .post:hover behold-video{transform:scale(1.05);transition:all .6s cubic-bezier(.215,.61,.355,1)}@media (prefers-reduced-motion){:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within behold-image,:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within behold-video,[data-hover-effect=zoomBlur] .post:hover behold-image,[data-hover-effect=zoomBlur] .post:hover behold-video{transform:none}}@supports not (backdrop-filter:blur(3px)){:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within behold-image,:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within behold-video,[data-hover-effect=zoomBlur] .post:hover behold-image,[data-hover-effect=zoomBlur] .post:hover behold-video{filter:brightness(97%) blur(3px)}}@supports (backdrop-filter:blur(3px)){:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within:before,[data-hover-effect=zoomBlur] .post:hover:before{backdrop-filter:blur(3px);background-color:rgba(0,0,0,.002);opacity:1}}:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within:after,[data-hover-effect=zoomBlur] .post:hover:after{opacity:1;transform:translateY(-50%)}:host(.keyboard-nav) [data-hover-effect=toGreyscale] .post:focus-within behold-image,:host(.keyboard-nav) [data-hover-effect=toGreyscale] .post:focus-within behold-video,[data-hover-effect=toGreyscale] .post:hover behold-image,[data-hover-effect=toGreyscale] .post:hover behold-video{filter:grayscale(100%);transition:all .6s cubic-bezier(.215,.61,.355,1)}:host(.keyboard-nav) [data-hover-effect=toGreyscale] .post:focus-within:after,[data-hover-effect=toGreyscale] .post:hover:after{opacity:1;transform:translateY(-50%)}:host(.keyboard-nav) [data-hover-effect=zoomToGreyscale] .post:focus-within behold-image,:host(.keyboard-nav) [data-hover-effect=zoomToGreyscale] .post:focus-within behold-video,[data-hover-effect=zoomToGreyscale] .post:hover behold-image,[data-hover-effect=zoomToGreyscale] .post:hover behold-video{filter:grayscale(100%);transform:scale(1.05);transition:all .6s cubic-bezier(.215,.61,.355,1)}@media (prefers-reduced-motion){:host(.keyboard-nav) [data-hover-effect=zoomToGreyscale] .post:focus-within behold-image,:host(.keyboard-nav) [data-hover-effect=zoomToGreyscale] .post:focus-within behold-video,[data-hover-effect=zoomToGreyscale] .post:hover behold-image,[data-hover-effect=zoomToGreyscale] .post:hover behold-video{transform:none}}:host(.keyboard-nav) [data-hover-effect=zoomToGreyscale] .post:focus-within:after,[data-hover-effect=zoomToGreyscale] .post:hover:after{opacity:1;transform:translateY(-50%)}:host(.keyboard-nav) [data-hover-effect=fromGreyscale] .post,[data-hover-effect=fromGreyscale] .post{filter:grayscale(100%)}:host(.keyboard-nav) [data-hover-effect=fromGreyscale] .post:focus,:host(.keyboard-nav) [data-hover-effect=fromGreyscale] .post:hover,[data-hover-effect=fromGreyscale] .post:focus,[data-hover-effect=fromGreyscale] .post:hover{filter:grayscale(0);transition:all .6s cubic-bezier(.215,.61,.355,1)}:host(.keyboard-nav) [data-hover-effect=fromGreyscale] .post:focus.post--hover-caption:before,:host(.keyboard-nav) [data-hover-effect=fromGreyscale] .post:hover.post--hover-caption:before,[data-hover-effect=fromGreyscale] .post:focus.post--hover-caption:before,[data-hover-effect=fromGreyscale] .post:hover.post--hover-caption:before{background-color:var(--overlay-color);transition:all .6s cubic-bezier(.215,.61,.355,1)}:host(.keyboard-nav) [data-hover-effect=fromGreyscale] .post:focus:after,:host(.keyboard-nav) [data-hover-effect=fromGreyscale] .post:hover:after,[data-hover-effect=fromGreyscale] .post:focus:after,[data-hover-effect=fromGreyscale] .post:hover:after{opacity:1;transform:translateY(-50%)}:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post,[data-hover-effect=zoomFromGreyscale] .post{filter:grayscale(100%)}:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:focus,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:hover,[data-hover-effect=zoomFromGreyscale] .post:focus,[data-hover-effect=zoomFromGreyscale] .post:hover{filter:grayscale(0)}:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:focus behold-image,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:focus behold-video,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:hover behold-image,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:hover behold-video,[data-hover-effect=zoomFromGreyscale] .post:focus behold-image,[data-hover-effect=zoomFromGreyscale] .post:focus behold-video,[data-hover-effect=zoomFromGreyscale] .post:hover behold-image,[data-hover-effect=zoomFromGreyscale] .post:hover behold-video{transform:scale(1.05);transition:all .6s cubic-bezier(.215,.61,.355,1)}@media (prefers-reduced-motion){:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:focus behold-image,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:focus behold-video,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:hover behold-image,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:hover behold-video,[data-hover-effect=zoomFromGreyscale] .post:focus behold-image,[data-hover-effect=zoomFromGreyscale] .post:focus behold-video,[data-hover-effect=zoomFromGreyscale] .post:hover behold-image,[data-hover-effect=zoomFromGreyscale] .post:hover behold-video{transform:none}}:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:focus.post--hover-caption:before,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:hover.post--hover-caption:before,[data-hover-effect=zoomFromGreyscale] .post:focus.post--hover-caption:before,[data-hover-effect=zoomFromGreyscale] .post:hover.post--hover-caption:before{background-color:var(--overlay-color);transition:all .6s cubic-bezier(.215,.61,.355,1)}:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:focus:after,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:hover:after,[data-hover-effect=zoomFromGreyscale] .post:focus:after,[data-hover-effect=zoomFromGreyscale] .post:hover:after{opacity:1;transform:translateY(-50%)}behold-image{display:block;height:0;min-height:100%;overflow:hidden;padding:0;padding-bottom:calc(100%/var(--post-aspect-ratio));position:relative;transition:all .6s cubic-bezier(.215,.61,.355,1);width:100%}behold-image img{border-radius:0;height:100%;left:0;-o-object-fit:cover;object-fit:cover;-o-object-position:center center;object-position:center center;opacity:0;pointer-events:none;position:absolute;top:0;transition:all .6s cubic-bezier(.215,.61,.355,1),opacity .6s ease;vertical-align:middle;width:100%;will-change:transform;z-index:1}@supports not (backdrop-filter:blur(3px)){[data-hover-effect=blur] behold-image img,[data-hover-effect=zoomBlur] behold-image img{height:calc(100% + 6px);left:-3px;top:-3px;width:calc(100% + 6px)}}.post--reel behold-image img{-o-object-position:center 25%;object-position:center 25%}behold-image.is-loaded img{opacity:1}behold-video{display:block;height:0;min-height:100%;overflow:hidden;padding:0;padding-bottom:calc(100%/var(--post-aspect-ratio));position:relative;transition:all .6s cubic-bezier(.215,.61,.355,1);width:100%}behold-video video{height:100%;left:0;-o-object-fit:cover;object-fit:cover;-o-object-position:center center;object-position:center center;opacity:0;pointer-events:none;position:absolute;top:0;transition:all .6s cubic-bezier(.215,.61,.355,1),opacity .6s ease;vertical-align:middle;width:100%;will-change:transform}.post--reel behold-video video{-o-object-position:center 25%;object-position:center 25%}behold-video.is-loaded video{opacity:1}";export{k as A,v as B,y as I,x as V,w as a,z as b,G as c,f as g,p as r};
@@ -1 +1 @@
1
- function t(t){return JSON.parse(JSON.stringify(t,(t,e)=>void 0===e?null:e))}function e(){return document.body.offsetTop}async function n(t,e){const n=document.createElement(t);return new Promise((s,i)=>{switch(t){case"img":n.addEventListener("load",()=>{s(e)});break;case"video":n.addEventListener("loadeddata",()=>s(e))}n.addEventListener("error",t=>{i(t)}),n.src=e})}function s({text:t="",maxLines:e=2,maxChars:n=50}){if(!t)return;const s=t.match(/.*/g)?.filter(t=>t.length>0).slice(0,e),i=s?.join("").length??0,o=Math.min(i,n);return t.slice(0,o)}function i(t,e){return`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' width='${t}' height='${e}'%3E%3C/svg%3E%0A`}async function o(t){return t&&0!==t.length?new Promise(e=>{let n=null,s=!1;const i=setTimeout(()=>{s||(n?.disconnect(),e(null))},500);n=new IntersectionObserver(o=>{if(s)return;s=!0,clearTimeout(i);let r={intersectionRatio:-1,index:t.length};for(const e of o){const n=t.indexOf(e.target);if(-1===n)continue;const s=e.intersectionRatio>r.intersectionRatio,i=e.intersectionRatio===r.intersectionRatio&&n<r.index;(s||i)&&(r={intersectionRatio:e.intersectionRatio,index:n})}n?.disconnect(),n=null,e(r.index===t.length?null:r.index)}),t.forEach(t=>n?.observe(t))}):Promise.resolve(null)}function r(t,e){let n=!1,s=new IntersectionObserver(t=>{n||(s?.disconnect(),s=null,e(t[0].boundingClientRect))});return s.observe(t),function(){n||(n=!0,s&&(s.disconnect(),s=null))}}function a(t){return t.isConnected?"#document"===t.nodeName||t instanceof ShadowRoot?t:t.parentNode?a(t.parentNode):document:document}function l(t,e,n,s=!1){let i,o=s?performance.now():0;return(...s)=>{let r=performance.now();clearTimeout(i),i=setTimeout(()=>t.apply(n,s),e),r-o>e&&(clearTimeout(i),o=r,t.apply(n,s))}}function c(t,e){Object.entries(e).forEach(([e,n])=>{n?t.classList.add(e):t.classList.remove(e)})}function d(t,e){t&&Object.keys(e).forEach(n=>{t.style.setProperty(n,e[n])})}function u(t,e,n,s=0){if("string"==typeof n&&(n=[n]),s>0){let s=!1;return Object.keys(t).length!==Object.keys(e).length||(Object.keys(t).forEach(i=>{"object"==typeof t[i]&&"object"==typeof e[i]&&u(t[i],e[i],n)&&(s=!0)}),s)}return n.reduce((n,s)=>!h(t?.[s],e?.[s])||n,!1)}function h(t,e,n=!1,s=!1){if(s&&(Array.isArray(t)&&(t=t.sort()),Array.isArray(e)&&(e=e.sort())),n&&("number"==typeof t&&(t=t.toString()),"number"==typeof e&&(e=e.toString())),typeof t!=typeof e)return!1;if(null===t&&null===e)return!0;if(null===t&&null!==e)return!1;if(null!==t&&null===e)return!1;if(void 0===t&&void 0===e)return!0;if(void 0===t&&void 0!==e)return!1;if(void 0!==t&&void 0===e)return!1;if("object"==typeof t)return Object.keys(t).length===Object.keys(e).length&&Object.entries(t).reduce((t,[i,o])=>!!h(o,e[i],n,s)&&t,!0);if(Array.isArray(t)){let i=!0;return t.forEach((t,o)=>{h(t,e[o],n,s)||(i=!1)}),i}return t===e}function p(t,e="assertive"){const n=document.createElement("div");n.innerHTML=t,n.setAttribute("aria-live",e),n.setAttribute("aria-atomic","true"),n.style.cssText="\n position: absolute;\n position: absolute !important;\n width: 1px !important;\n height: 1px !important;\n padding: 0 !important;\n margin: -1px !important;\n overflow: hidden !important;\n clip: rect(0,0,0,0) !important;\n white-space: nowrap !important;\n border: 0 !important;\n ",requestAnimationFrame(()=>{document.body.appendChild(n),setTimeout(()=>{n.remove()},500)})}function m(t,e,n){t.length===n&&t.shift(),t.push(e)}function f(t,e){try{const n=new URL(t),s=n.searchParams.get("class"),i=s?.match(/[A-Z].*/);return s&&i?(n.searchParams.set("class",`${e}${i[0]}`),n.toString()):t}catch(e){return t}}function w(t,e=100,n="0,0,0"){const s=Array.isArray(t)?t:(t??n).split(",");return`hsl(${s[0]} ${s[1]}% ${s[2]}% / ${e}%)`}function b(...t){window?.location.search.includes("behold-debug-mode")&&console.log(...t)}let g={isMuted:!0,keyboardNavEnabled:!1,popoverOverlayHslArray:[0,0,0],popoverOverlayOpacity:60,playPopoverVideos:!0},v=!1,y=null,S=null;const O=new Map,j=new Map,x=new Map,M=new Set;!function t(){x.forEach(t=>{const e=performance.now(),{minWait:n,lastInvocation:s,callback:i}=t,o=e-s;o>n&&(i(o),x.set(i,{...t,lastInvocation:e}))}),requestAnimationFrame(t)}();class C extends HTMLElement{label="BaseElement";storedProperties=new Map;requiredProperties=[];hasRequiredProps=!1;propChangeHandlers=new Map;delayedPropChangeHandlers=new Map;queuedPropUpdates=new Set;localState=Object.freeze({});localStateChangeHandlers=new Set;connectHandlers=new Set;disconnectHandlers=new Set;rafs=new Map;timeouts=new Map;reduceMotion=!1;constructor(){super(),this.t=this.t.bind(this),this.i=this.i.bind(this),this.o=this.o.bind(this),window.matchMedia("(prefers-reduced-motion)").matches&&(this.reduceMotion=!0),y||(y=new ResizeObserver(t=>{t.forEach(t=>{const e=O.get(t.target);e&&e(t)})})),S||(S=new IntersectionObserver(t=>{t.forEach(t=>{const e=j.get(t.target);e&&e(t)})})),v||(v=!0,document.addEventListener("keydown",this.t),document.addEventListener("mousedown",this.i),document.addEventListener("mousemove",this.o,{passive:!0}))}connectedCallback(){this.connectHandlers.forEach(t=>t())}disconnectedCallback(){this.rafs.forEach(t=>cancelAnimationFrame(t)),this.rafs.clear(),this.timeouts.forEach(t=>clearTimeout(t)),this.timeouts.clear(),this.disconnectHandlers.forEach(t=>t())}onConnect(t){this.connectHandlers.add(t)}onDisconnect(t){this.disconnectHandlers.add(t)}onResize(t,e,n){O.set(e,n.bind(t)),y?.observe(e),this.disconnectHandlers.add(()=>{O.delete(e),y?.unobserve(e)})}onIntersection(t,e){j.set(t,e),S?.observe(t),this.disconnectHandlers.add(()=>{j.delete(t),S?.unobserve(t)})}onLoop(t,e=50){x.set(t,{minWait:e,lastInvocation:0,callback:t}),this.disconnectHandlers.add(()=>{x.delete(t)})}onPropChange(e,n,s=null,i=null){const o=this;s?this.requiredProperties.push(...s):this.requiredProperties.push(...n),n.forEach(n=>{void 0!==this[n]&&this.storedProperties.set(n,this[n]),this.propChangeHandlers.get(n)||(this.propChangeHandlers.set(n,[]),this.delayedPropChangeHandlers.set(n,[])),i?this.delayedPropChangeHandlers.get(n)?.push(e):this.propChangeHandlers.get(n)?.push(e),Object.defineProperty(this,n,{set(e){void 0===e&&(e=null,b(`Attempted to set value of ${String(n)} as "undefined" on ${o.label}. ${String(n)} was coerced to null instead.`)),e=t(e);const s=o.storedProperties.has(n)?t(o.storedProperties.get(n)):null;o.storedProperties.set(n,e),o.hasRequiredProps=o.requiredProperties.every(t=>o.storedProperties.has(t)),o.queueHandlers({prop:n,oldValue:s,newValue:e})},get:()=>o.storedProperties.get(n)})}),i&&(i=i.bind(this),queueMicrotask(()=>{o.hasRequiredProps&&(i(),o.delayedPropChangeHandlers.forEach((t,e)=>{o.propChangeHandlers.set(e,[...o.propChangeHandlers.get(e)??[],...t])}))})),o.queueMissingPropsCheck()}queueHandlers({prop:t,oldValue:e,newValue:n}){const s=t,i=this.propChangeHandlers.get(s);this.hasRequiredProps?(this.queuedPropUpdates.size&&(this.queuedPropUpdates.delete(s),this.runQueuedPropHandlers()),i&&i.forEach(s=>{s.call(this,{changedProp:t,oldValue:e,newValue:n})})):this.queuedPropUpdates.add(s)}runQueuedPropHandlers(){this.queuedPropUpdates.forEach(t=>{const e=this.propChangeHandlers.get(t);e&&e.forEach(e=>{e.call(this,{changedProp:t,oldValue:null,newValue:this[t]})})}),this.queuedPropUpdates.clear()}updateLocalState(e){const n=Object.freeze(t(this.localState));this.localState=Object.freeze({...this.localState,...e}),this.localStateChangeHandlers.forEach(t=>t({changedProps:Object.keys(e),oldState:n,newState:this.localState}))}onLocalStateChange(t,e){this.localState={...this.localState,...e};const n=t.bind(this);this.localStateChangeHandlers.add(n)}updateGlobalState(e){const n=t(g);g={...g,...e},M.forEach(t=>t({changedProps:Object.keys(e),oldState:n,newState:g}))}onGlobalStateChange(t){this.connectHandlers.add(()=>{const e=t.bind(this);M.add(e),this.disconnectHandlers.add(()=>M.delete(e))})}t(t){"Tab"===t.key&&this.updateGlobalState({keyboardNavEnabled:!0})}i(t){0===t.clientX&&0===t.clientY||this.updateGlobalState({keyboardNavEnabled:!1})}o(t){t.ctrlKey||t.altKey||t.shiftKey||t.metaKey||0===t.movementX||0===t.movementY||this.updateGlobalState({keyboardNavEnabled:!1})}get globalState(){return g}set globalState(t){throw new Error("Shared state cannot be set directly. Use this.updateGlobalState() instead.")}raf(t,e,n=!0){if(n){const t=this.rafs.get(e);t&&cancelAnimationFrame(t)}const s=requestAnimationFrame(()=>{t(),this.rafs.delete(e)});return this.rafs.set(e,s),s}cancelRaf(t){const e=this.rafs.get(t);e&&cancelAnimationFrame(e),this.rafs.delete(t)}to(t,e,n){const s=setTimeout(()=>{t(),this.timeouts.delete(n)},e);return this.timeouts.set(n,s),s}cancelTo(t){clearTimeout(this.timeouts.get(t)),this.timeouts.delete(t)}queueMissingPropsCheck(){queueMicrotask(()=>{if(this.requiredProperties.length&&!this.hasRequiredProps){const t=this.requiredProperties.filter(t=>!this.storedProperties.has(t));console.error(`${this.label||this.tagName} is missing required props: ${t.join(", ")}`)}})}}function E(t){let{type:e="div",classes:n=[],contents:s=[],attributes:i={},props:o={},style:r={}}=t;const a=(Array.isArray(n)?n:[n]).filter(Boolean),l=document.createElement(e),c=(Array.isArray(s)?s:[s]).reduce((t,e)=>{if("string"==typeof e&&e.includes("</svg>")){const n=document.createElement("template");n.innerHTML=e,t.push(n.content)}else e&&t.push(e);return t},[]);return l.replaceChildren(...c),a.length&&(l.className=a.join(" ")),Object.keys(i).forEach(t=>{const e=i[t];null!=e?l.setAttribute(t,String(e)):l.removeAttribute(t)}),Object.assign(l,o),Object.keys(r).forEach(t=>{l&&("--"===t.substring(0,2)?l.style.setProperty(t,String(r[t])):"string"==typeof t&&(l.style[t]=String(r[t])))}),t.listeners&&Object.entries(t.listeners).forEach(([t,e])=>{e&&l.addEventListener(t,e)}),l}class P extends C{label="BeholdWidget";shadow;abortController;loadedWidget;static get observedAttributes(){return["feed-id"]}constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.onPropChange(this.l,["widgetSettings","feedMetadata","posts","previewLoadingColors","startIndex","errorMessage"],[])}attributeChangedCallback(t,e,n){"feed-id"===t&&n!==e&&this.getFeed(n)}l({changedProp:t,oldValue:e,newValue:n}){if("errorMessage"!==t||e||!n){if("widgetSettings"===t&&u(n,e,"type")){const t=n;return void(t?.type&&this.loadWidget(t.type))}this.loadedWidget&&!h(n,e)&&Reflect.set(this.loadedWidget,t,n)}else this.loadWidget("ErrorMessage")}async loadWidget(t){const e=(await this.importWidget(t.replace(/.?/,t=>t.toUpperCase()))).register(),n=E({type:e}),s=E({type:"style",contents:":host{align-items:center;box-sizing:border-box;display:flex;flex-wrap:wrap;justify-content:center;margin:0;min-width:50px;overflow:hidden;position:relative;width:100%}:host *{box-sizing:border-box}:host([hidden]){display:none}".toString()});this.shadow.replaceChildren(n,s),this.loadedWidget=this.shadow.querySelector(e)??void 0,this.loadedWidget&&(this.previewLoadingColors&&(this.loadedWidget.previewLoadingColors=this.previewLoadingColors),this.startIndex&&(this.loadedWidget.startIndex=this.startIndex),this.widgetSettings&&(this.loadedWidget.widgetSettings=this.widgetSettings),this.feedMetadata&&(this.loadedWidget.feedMetadata=this.feedMetadata),this.posts&&(this.loadedWidget.posts=this.posts),this.loadedWidget.errorMessage=this.errorMessage),this.dispatchEvent(new Event("load")),window.dispatchEvent(new CustomEvent("behold:widget-loaded",{detail:{id:this["feed-id"]}}))}async getFeed(t){if(t){this.abortController&&this.abortController.abort(),this.abortController=new AbortController;try{const e="https://feeds.behold.so",n=await fetch(`${e}/${t}`,{mode:"cors",signal:this.abortController.signal});if(n.ok){const t=await n.json();if(!t.widgetSettings)throw new Error("JSON feeds cannot be used as a widget");if(t.widgetSettings.klaviyoWebFeedId)throw new Error("Klaviyo feeds cannot be used as an embedded widget");this.widgetSettings=t.widgetSettings,this.feedMetadata={username:t.username,profilePictureUrl:t.profilePictureUrl,website:t.website,followersCount:t.followersCount,hashtags:t.hashtags,showBranding:t.showBranding},this.posts=t.posts||t.media}else{const t=await n.text();this.errorMessage=t}}catch(t){t instanceof Error&&"The user aborted a request."!==t.message&&(this.errorMessage=t.message)}}else this.errorMessage="No feed ID provided"}async importWidget(t){const{default:e}=await function(t){switch(t){case"./widgets/ElasticCarousel.ts":return import("./ElasticCarousel-nLigs-z-.js");case"./widgets/ErrorMessage.ts":return import("./ErrorMessage-Dqz2Oagz.js");case"./widgets/GalleryWall.ts":return import("./GalleryWall-DtOPpSoG.js");case"./widgets/Grid.ts":return import("./Grid-Dg7pvDBk.js");default:return new Promise(function(e,n){("function"==typeof queueMicrotask?queueMicrotask:setTimeout)(n.bind(null,new Error("Unknown variable dynamic import: "+t)))})}}(`./widgets/${t}.ts`);return e}}var k={register:(t="behold-widget")=>{customElements.get(t)||customElements.define(t,class extends P{})},element:P};export{C as B,k as W,p as a,a as b,E as c,b as d,o as e,e as f,r as g,i as h,s as i,u as j,w as k,h as l,m,d as n,n as p,f as r,c as s,l as t};
1
+ function t(t){return JSON.parse(JSON.stringify(t,(t,e)=>void 0===e?null:e))}function e(){return document.body.offsetTop}async function n(t,e){const n=document.createElement(t);return new Promise((s,i)=>{switch(t){case"img":n.addEventListener("load",()=>{s(e)});break;case"video":n.addEventListener("loadeddata",()=>s(e))}n.addEventListener("error",t=>{i(t)}),n.src=e})}function s({text:t="",maxLines:e=2,maxChars:n=50}){if(!t)return;const s=t.match(/.*/g)?.filter(t=>t.length>0).slice(0,e),i=s?.join("").length??0,o=Math.min(i,n);return t.slice(0,o)}function i(t,e){return`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' width='${t}' height='${e}'%3E%3C/svg%3E%0A`}async function o(t){return t&&0!==t.length?new Promise(e=>{let n=null,s=!1;const i=setTimeout(()=>{s||(n?.disconnect(),e(null))},500);n=new IntersectionObserver(o=>{if(s)return;s=!0,clearTimeout(i);let r={intersectionRatio:-1,index:t.length};for(const e of o){const n=t.indexOf(e.target);if(-1===n)continue;const s=e.intersectionRatio>r.intersectionRatio,i=e.intersectionRatio===r.intersectionRatio&&n<r.index;(s||i)&&(r={intersectionRatio:e.intersectionRatio,index:n})}n?.disconnect(),n=null,e(r.index===t.length?null:r.index)}),t.forEach(t=>n?.observe(t))}):Promise.resolve(null)}function r(t,e){let n=!1,s=new IntersectionObserver(t=>{n||(s?.disconnect(),s=null,e(t[0].boundingClientRect))});return s.observe(t),function(){n||(n=!0,s&&(s.disconnect(),s=null))}}function a(t){return t.isConnected?"#document"===t.nodeName||t instanceof ShadowRoot?t:t.parentNode?a(t.parentNode):document:document}function l(t,e,n,s=!1){let i,o=s?performance.now():0;return(...s)=>{let r=performance.now();clearTimeout(i),i=setTimeout(()=>t.apply(n,s),e),r-o>e&&(clearTimeout(i),o=r,t.apply(n,s))}}function c(t,e){Object.entries(e).forEach(([e,n])=>{n?t.classList.add(e):t.classList.remove(e)})}function d(t,e){t&&Object.keys(e).forEach(n=>{t.style.setProperty(n,e[n])})}function u(t,e,n,s=0){if("string"==typeof n&&(n=[n]),s>0){let s=!1;return Object.keys(t).length!==Object.keys(e).length||(Object.keys(t).forEach(i=>{"object"==typeof t[i]&&"object"==typeof e[i]&&u(t[i],e[i],n)&&(s=!0)}),s)}return n.reduce((n,s)=>!h(t?.[s],e?.[s])||n,!1)}function h(t,e,n=!1,s=!1){if(s&&(Array.isArray(t)&&(t=t.sort()),Array.isArray(e)&&(e=e.sort())),n&&("number"==typeof t&&(t=t.toString()),"number"==typeof e&&(e=e.toString())),typeof t!=typeof e)return!1;if(null===t&&null===e)return!0;if(null===t&&null!==e)return!1;if(null!==t&&null===e)return!1;if(void 0===t&&void 0===e)return!0;if(void 0===t&&void 0!==e)return!1;if(void 0!==t&&void 0===e)return!1;if("object"==typeof t)return Object.keys(t).length===Object.keys(e).length&&Object.entries(t).reduce((t,[i,o])=>!!h(o,e[i],n,s)&&t,!0);if(Array.isArray(t)){let i=!0;return t.forEach((t,o)=>{h(t,e[o],n,s)||(i=!1)}),i}return t===e}function p(t,e="assertive"){const n=document.createElement("div");n.innerHTML=t,n.setAttribute("aria-live",e),n.setAttribute("aria-atomic","true"),n.style.cssText="\n position: absolute;\n position: absolute !important;\n width: 1px !important;\n height: 1px !important;\n padding: 0 !important;\n margin: -1px !important;\n overflow: hidden !important;\n clip: rect(0,0,0,0) !important;\n white-space: nowrap !important;\n border: 0 !important;\n ",requestAnimationFrame(()=>{document.body.appendChild(n),setTimeout(()=>{n.remove()},500)})}function m(t,e,n){t.length===n&&t.shift(),t.push(e)}function f(t,e){try{const n=new URL(t),s=n.searchParams.get("class"),i=s?.match(/[A-Z].*/);return s&&i?(n.searchParams.set("class",`${e}${i[0]}`),n.toString()):t}catch(e){return t}}function w(t,e=100,n="0,0,0"){const s=Array.isArray(t)?t:(t??n).split(",");return`hsl(${s[0]} ${s[1]}% ${s[2]}% / ${e}%)`}function b(...t){window?.location.search.includes("behold-debug-mode")&&console.log(...t)}let g={isMuted:!0,keyboardNavEnabled:!1,popoverOverlayHslArray:[0,0,0],popoverOverlayOpacity:60,playPopoverVideos:!0},v=!1,y=null,S=null;const O=new Map,j=new Map,x=new Map,M=new Set;!function t(){x.forEach(t=>{const e=performance.now(),{minWait:n,lastInvocation:s,callback:i}=t,o=e-s;o>n&&(i(o),x.set(i,{...t,lastInvocation:e}))}),requestAnimationFrame(t)}();class C extends HTMLElement{label="BaseElement";storedProperties=new Map;requiredProperties=[];hasRequiredProps=!1;propChangeHandlers=new Map;delayedPropChangeHandlers=new Map;queuedPropUpdates=new Set;localState=Object.freeze({});localStateChangeHandlers=new Set;connectHandlers=new Set;disconnectHandlers=new Set;rafs=new Map;timeouts=new Map;reduceMotion=!1;constructor(){super(),this.t=this.t.bind(this),this.i=this.i.bind(this),this.o=this.o.bind(this),window.matchMedia("(prefers-reduced-motion)").matches&&(this.reduceMotion=!0),y||(y=new ResizeObserver(t=>{t.forEach(t=>{const e=O.get(t.target);e&&e(t)})})),S||(S=new IntersectionObserver(t=>{t.forEach(t=>{const e=j.get(t.target);e&&e(t)})})),v||(v=!0,document.addEventListener("keydown",this.t),document.addEventListener("mousedown",this.i),document.addEventListener("mousemove",this.o,{passive:!0}))}connectedCallback(){this.connectHandlers.forEach(t=>t())}disconnectedCallback(){this.rafs.forEach(t=>cancelAnimationFrame(t)),this.rafs.clear(),this.timeouts.forEach(t=>clearTimeout(t)),this.timeouts.clear(),this.disconnectHandlers.forEach(t=>t())}onConnect(t){this.connectHandlers.add(t)}onDisconnect(t){this.disconnectHandlers.add(t)}onResize(t,e,n){O.set(e,n.bind(t)),y?.observe(e),this.disconnectHandlers.add(()=>{O.delete(e),y?.unobserve(e)})}onIntersection(t,e){j.set(t,e),S?.observe(t),this.disconnectHandlers.add(()=>{j.delete(t),S?.unobserve(t)})}onLoop(t,e=50){x.set(t,{minWait:e,lastInvocation:0,callback:t}),this.disconnectHandlers.add(()=>{x.delete(t)})}onPropChange(e,n,s=null,i=null){const o=this;s?this.requiredProperties.push(...s):this.requiredProperties.push(...n),n.forEach(n=>{void 0!==this[n]&&this.storedProperties.set(n,this[n]),this.propChangeHandlers.get(n)||(this.propChangeHandlers.set(n,[]),this.delayedPropChangeHandlers.set(n,[])),i?this.delayedPropChangeHandlers.get(n)?.push(e):this.propChangeHandlers.get(n)?.push(e),Object.defineProperty(this,n,{set(e){void 0===e&&(e=null,b(`Attempted to set value of ${String(n)} as "undefined" on ${o.label}. ${String(n)} was coerced to null instead.`)),e=t(e);const s=o.storedProperties.has(n)?t(o.storedProperties.get(n)):null;o.storedProperties.set(n,e),o.hasRequiredProps=o.requiredProperties.every(t=>o.storedProperties.has(t)),o.queueHandlers({prop:n,oldValue:s,newValue:e})},get:()=>o.storedProperties.get(n)})}),i&&(i=i.bind(this),queueMicrotask(()=>{o.hasRequiredProps&&(i(),o.delayedPropChangeHandlers.forEach((t,e)=>{o.propChangeHandlers.set(e,[...o.propChangeHandlers.get(e)??[],...t])}))})),o.queueMissingPropsCheck()}queueHandlers({prop:t,oldValue:e,newValue:n}){const s=t,i=this.propChangeHandlers.get(s);this.hasRequiredProps?(this.queuedPropUpdates.size&&(this.queuedPropUpdates.delete(s),this.runQueuedPropHandlers()),i&&i.forEach(s=>{s.call(this,{changedProp:t,oldValue:e,newValue:n})})):this.queuedPropUpdates.add(s)}runQueuedPropHandlers(){this.queuedPropUpdates.forEach(t=>{const e=this.propChangeHandlers.get(t);e&&e.forEach(e=>{e.call(this,{changedProp:t,oldValue:null,newValue:this[t]})})}),this.queuedPropUpdates.clear()}updateLocalState(e){const n=Object.freeze(t(this.localState));this.localState=Object.freeze({...this.localState,...e}),this.localStateChangeHandlers.forEach(t=>t({changedProps:Object.keys(e),oldState:n,newState:this.localState}))}onLocalStateChange(t,e){this.localState={...this.localState,...e};const n=t.bind(this);this.localStateChangeHandlers.add(n)}updateGlobalState(e){const n=t(g);g={...g,...e},M.forEach(t=>t({changedProps:Object.keys(e),oldState:n,newState:g}))}onGlobalStateChange(t){this.connectHandlers.add(()=>{const e=t.bind(this);M.add(e),this.disconnectHandlers.add(()=>M.delete(e))})}t(t){"Tab"===t.key&&this.updateGlobalState({keyboardNavEnabled:!0})}i(t){0===t.clientX&&0===t.clientY||this.updateGlobalState({keyboardNavEnabled:!1})}o(t){t.ctrlKey||t.altKey||t.shiftKey||t.metaKey||0===t.movementX||0===t.movementY||this.updateGlobalState({keyboardNavEnabled:!1})}get globalState(){return g}set globalState(t){throw new Error("Shared state cannot be set directly. Use this.updateGlobalState() instead.")}raf(t,e,n=!0){if(n){const t=this.rafs.get(e);t&&cancelAnimationFrame(t)}const s=requestAnimationFrame(()=>{t(),this.rafs.delete(e)});return this.rafs.set(e,s),s}cancelRaf(t){const e=this.rafs.get(t);e&&cancelAnimationFrame(e),this.rafs.delete(t)}to(t,e,n){const s=setTimeout(()=>{t(),this.timeouts.delete(n)},e);return this.timeouts.set(n,s),s}cancelTo(t){clearTimeout(this.timeouts.get(t)),this.timeouts.delete(t)}queueMissingPropsCheck(){queueMicrotask(()=>{if(this.requiredProperties.length&&!this.hasRequiredProps){const t=this.requiredProperties.filter(t=>!this.storedProperties.has(t));console.error(`${this.label||this.tagName} is missing required props: ${t.join(", ")}`)}})}}function E(t){let{type:e="div",classes:n=[],contents:s=[],attributes:i={},props:o={},style:r={}}=t;const a=(Array.isArray(n)?n:[n]).filter(Boolean),l=document.createElement(e),c=(Array.isArray(s)?s:[s]).reduce((t,e)=>{if("string"==typeof e&&e.includes("</svg>")){const n=document.createElement("template");n.innerHTML=e,t.push(n.content)}else e&&t.push(e);return t},[]);return l.replaceChildren(...c),a.length&&(l.className=a.join(" ")),Object.keys(i).forEach(t=>{const e=i[t];null!=e?l.setAttribute(t,String(e)):l.removeAttribute(t)}),Object.assign(l,o),Object.keys(r).forEach(t=>{l&&("--"===t.substring(0,2)?l.style.setProperty(t,String(r[t])):"string"==typeof t&&(l.style[t]=String(r[t])))}),t.listeners&&Object.entries(t.listeners).forEach(([t,e])=>{e&&l.addEventListener(t,e)}),l}class P extends C{label="BeholdWidget";shadow;abortController;loadedWidget;static get observedAttributes(){return["feed-id"]}constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.onPropChange(this.l,["widgetSettings","feedMetadata","posts","previewLoadingColors","startIndex","errorMessage"],[])}attributeChangedCallback(t,e,n){"feed-id"===t&&n!==e&&this.getFeed(n)}l({changedProp:t,oldValue:e,newValue:n}){if("errorMessage"!==t||e||!n){if("widgetSettings"===t&&u(n,e,"type")){const t=n;return void(t?.type&&this.loadWidget(t.type))}this.loadedWidget&&!h(n,e)&&Reflect.set(this.loadedWidget,t,n)}else this.loadWidget("ErrorMessage")}async loadWidget(t){const e=(await this.importWidget(t.replace(/.?/,t=>t.toUpperCase()))).register(),n=E({type:e}),s=E({type:"style",contents:":host{align-items:center;box-sizing:border-box;display:flex;flex-wrap:wrap;justify-content:center;margin:0;min-width:50px;overflow:hidden;position:relative;width:100%}:host *{box-sizing:border-box}:host([hidden]){display:none}".toString()});this.shadow.replaceChildren(n,s),this.loadedWidget=this.shadow.querySelector(e)??void 0,this.loadedWidget&&(this.previewLoadingColors&&(this.loadedWidget.previewLoadingColors=this.previewLoadingColors),this.startIndex&&(this.loadedWidget.startIndex=this.startIndex),this.widgetSettings&&(this.loadedWidget.widgetSettings=this.widgetSettings),this.feedMetadata&&(this.loadedWidget.feedMetadata=this.feedMetadata),this.posts&&(this.loadedWidget.posts=this.posts),this.loadedWidget.errorMessage=this.errorMessage),this.dispatchEvent(new Event("load")),window.dispatchEvent(new CustomEvent("behold:widget-loaded",{detail:{id:this["feed-id"]}}))}async getFeed(t){if(t){this.abortController&&this.abortController.abort(),this.abortController=new AbortController;try{const e="https://feeds.behold.so",n=await fetch(`${e}/${t}`,{mode:"cors",signal:this.abortController.signal});if(n.ok){const t=await n.json();if(!t.widgetSettings)throw new Error("JSON feeds cannot be used as a widget");if(t.widgetSettings.klaviyoWebFeedId)throw new Error("Klaviyo feeds cannot be used as an embedded widget");this.widgetSettings=t.widgetSettings,this.feedMetadata={username:t.username,profilePictureUrl:t.profilePictureUrl,website:t.website,followersCount:t.followersCount,hashtags:t.hashtags,showBranding:t.showBranding},this.posts=t.posts||t.media}else{const t=await n.text();this.errorMessage=t}}catch(t){t instanceof Error&&"The user aborted a request."!==t.message&&(this.errorMessage=t.message)}}else this.errorMessage="No feed ID provided"}async importWidget(t){const{default:e}=await function(t){switch(t){case"./widgets/ElasticCarousel.ts":return import("./ElasticCarousel-p2GI00M_.js");case"./widgets/ErrorMessage.ts":return import("./ErrorMessage-B-_FaPLT.js");case"./widgets/GalleryWall.ts":return import("./GalleryWall-BRvcCH5a.js");case"./widgets/Grid.ts":return import("./Grid-D6aL3F41.js");default:return new Promise(function(e,n){("function"==typeof queueMicrotask?queueMicrotask:setTimeout)(n.bind(null,new Error("Unknown variable dynamic import: "+t)))})}}(`./widgets/${t}.ts`);return e}}var k={register:(t="behold-widget")=>{customElements.get(t)||customElements.define(t,class extends P{})},element:P};export{C as B,k as W,p as a,a as b,E as c,b as d,o as e,e as f,r as g,i as h,s as i,u as j,w as k,h as l,m,d as n,n as p,f as r,c as s,l as t};
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export{W as widget}from"./index-DqJM0ILL.js";
2
- /* v0.5.158 */
1
+ export{W as widget}from"./index-DlG54u5e.js";
2
+ /* v0.5.159 */
@@ -1 +1 @@
1
- {"version":3,"file":"GalleryWall.d.ts","sourceRoot":"","sources":["../../src/widgets/GalleryWall.ts"],"names":[],"mappings":"AAUA,OAAO,IAAI,MAAM,2BAA2B,CAAA;AAC5C,OAAO,QAAQ,MAAM,yBAAyB,CAAA;AAI9C,OAAO,KAAK,cAAc,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAA;AAGnD,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,YAAY,EACZ,UAAU,EACV,WAAW,EACX,KAAK,EACN,MAAM,aAAa,CAAA;AAKpB,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,IAAI;IAC3C,KAAK,SAAgB;IAGrB,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,KAAK,EAAE,KAAK,CAAK;IACjB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAG7B,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,UAAU,CAAC,EAAE,QAAQ,CAAA;IACrB,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAK;IAC7B,gBAAgB,CAAC,EAAE,cAAc,CAAA;IACjC,iBAAiB,CAAC,EAAE,UAAU,CAAA;IAC9B,gBAAgB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAmB;;IAwCnD,KAAK;IAuEL,iBAAiB,CAAC,EAChB,WAAW,EACX,QAAQ,EACR,QAAQ,GACT,EAAE,eAAe,CAAC,WAAW,CAAC;IA0B/B,kBAAkB;IAelB,qBAAqB,CACnB,QAAQ,EAAE,cAAc,GAAG,SAAS,EACpC,QAAQ,EAAE,cAAc,GAAG,SAAS;IA6BtC,qBAAqB;IAqBrB;;OAEG;IACG,oBAAoB;IAsB1B,aAAa,CAAC,KAAK,EAAE,mBAAmB;IAaxC;;OAEG;IACH,wBAAwB;IAqBxB;;OAEG;IACH,oBAAoB;IAqBpB;;OAEG;IACH,gBAAgB,CAAC,IAAI,EAAE,QAAQ;IAO/B,WAAW,CAAC,UAAU,EAAE,UAAU;IAiBlC,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2B7D,gBAAgB,CAAC,UAAU,EAAE,UAAU,EAAE,WAAW,GAAE,OAAe;IAyGrE,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,KAAK,CAAC,QAAQ,CAAC;IAwDtD,kBAAkB,aAmBjB;IAKD,MAAM,CAAC,QAAQ,CAAC,IAAI,SAAwB,GAAG,MAAM;CAMtD;AAKD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,qBAAqB,EAAE,WAAW,CAAA;KACnC;CACF"}
1
+ {"version":3,"file":"GalleryWall.d.ts","sourceRoot":"","sources":["../../src/widgets/GalleryWall.ts"],"names":[],"mappings":"AAUA,OAAO,IAAI,MAAM,2BAA2B,CAAA;AAC5C,OAAO,QAAQ,MAAM,yBAAyB,CAAA;AAI9C,OAAO,KAAK,cAAc,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAA;AAGnD,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,YAAY,EACZ,UAAU,EACV,WAAW,EACX,KAAK,EACN,MAAM,aAAa,CAAA;AAKpB,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,IAAI;IAC3C,KAAK,SAAgB;IAGrB,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,KAAK,EAAE,KAAK,CAAK;IACjB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAG7B,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,UAAU,CAAC,EAAE,QAAQ,CAAA;IACrB,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAK;IAC7B,gBAAgB,CAAC,EAAE,cAAc,CAAA;IACjC,iBAAiB,CAAC,EAAE,UAAU,CAAA;IAC9B,gBAAgB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAmB;;IAwCnD,KAAK;IAuEL,iBAAiB,CAAC,EAChB,WAAW,EACX,QAAQ,EACR,QAAQ,GACT,EAAE,eAAe,CAAC,WAAW,CAAC;IA0B/B,kBAAkB;IAelB,qBAAqB,CACnB,QAAQ,EAAE,cAAc,GAAG,SAAS,EACpC,QAAQ,EAAE,cAAc,GAAG,SAAS;IA6BtC,qBAAqB;IAqBrB;;OAEG;IACG,oBAAoB;IAsB1B,aAAa,CAAC,KAAK,EAAE,mBAAmB;IAaxC;;OAEG;IACH,wBAAwB;IAqBxB;;OAEG;IACH,oBAAoB;IAqBpB;;OAEG;IACH,gBAAgB,CAAC,IAAI,EAAE,QAAQ;IAO/B,WAAW,CAAC,UAAU,EAAE,UAAU;IAiBlC,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2B7D,gBAAgB,CAAC,UAAU,EAAE,UAAU,EAAE,WAAW,GAAE,OAAe;IA0GrE,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,KAAK,CAAC,QAAQ,CAAC;IAwDtD,kBAAkB,aAmBjB;IAKD,MAAM,CAAC,QAAQ,CAAC,IAAI,SAAwB,GAAG,MAAM;CAMtD;AAKD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,qBAAqB,EAAE,WAAW,CAAA;KACnC;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../src/widgets/Grid.ts"],"names":[],"mappings":"AAIA,OAAO,IAAI,MAAM,2BAA2B,CAAA;AAC5C,OAAO,QAAQ,MAAM,yBAAyB,CAAA;AAI9C,OAAO,KAAK,cAAc,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAA;AAInD,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,YAAY,EACZ,KAAK,EACL,UAAU,EACV,WAAW,EACZ,MAAM,aAAa,CAAA;AAKpB,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,IAAI;IACpC,KAAK,SAAS;IAGd,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,KAAK,EAAE,KAAK,CAAK;IACjB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAG7B,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,gBAAgB,CAAC,EAAE,WAAW,CAAA;IAC9B,UAAU,CAAC,EAAE,QAAQ,CAAA;IACrB,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAK;IAC7B,gBAAgB,CAAC,EAAE,cAAc,CAAA;IACjC,iBAAiB,CAAC,EAAE,UAAU,CAAA;IAC9B,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAmB;;IA0ClD,KAAK;IAiFL,iBAAiB,CAAC,EAChB,WAAW,EACX,QAAQ,EACR,QAAQ,GACT,EAAE,eAAe,CAAC,IAAI,CAAC;IAyBxB,kBAAkB;IAmBlB,qBAAqB,CACnB,QAAQ,EAAE,cAAc,GAAG,SAAS,EACpC,QAAQ,EAAE,cAAc,GAAG,SAAS;IA8BtC,qBAAqB;IAqBrB;;OAEG;IACG,oBAAoB;IAuB1B,aAAa,CAAC,KAAK,EAAE,mBAAmB;IAaxC;;OAEG;IACH,wBAAwB;IAexB;;OAEG;IACH,oBAAoB;IAepB;;OAEG;IACH,gBAAgB,CAAC,IAAI,EAAE,QAAQ;IAO/B,WAAW,CAAC,UAAU,EAAE,UAAU;IAYlC,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAwB7D,gBAAgB,CAAC,UAAU,EAAE,UAAU,EAAE,WAAW,GAAE,OAAe;IA6FrE,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,KAAK,CAAC,QAAQ,CAAC;IAoDtD,MAAM,CAAC,QAAQ,CAAC,IAAI,SAAgB,GAAG,MAAM;CAM9C;AAKD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,IAAI,CAAA;KACpB;CACF"}
1
+ {"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../src/widgets/Grid.ts"],"names":[],"mappings":"AAIA,OAAO,IAAI,MAAM,2BAA2B,CAAA;AAC5C,OAAO,QAAQ,MAAM,yBAAyB,CAAA;AAI9C,OAAO,KAAK,cAAc,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAA;AAInD,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,YAAY,EACZ,KAAK,EACL,UAAU,EACV,WAAW,EACZ,MAAM,aAAa,CAAA;AAKpB,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,IAAI;IACpC,KAAK,SAAS;IAGd,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,KAAK,EAAE,KAAK,CAAK;IACjB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAG7B,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,gBAAgB,CAAC,EAAE,WAAW,CAAA;IAC9B,UAAU,CAAC,EAAE,QAAQ,CAAA;IACrB,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAK;IAC7B,gBAAgB,CAAC,EAAE,cAAc,CAAA;IACjC,iBAAiB,CAAC,EAAE,UAAU,CAAA;IAC9B,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAmB;;IA0ClD,KAAK;IAiFL,iBAAiB,CAAC,EAChB,WAAW,EACX,QAAQ,EACR,QAAQ,GACT,EAAE,eAAe,CAAC,IAAI,CAAC;IAyBxB,kBAAkB;IAmBlB,qBAAqB,CACnB,QAAQ,EAAE,cAAc,GAAG,SAAS,EACpC,QAAQ,EAAE,cAAc,GAAG,SAAS;IA8BtC,qBAAqB;IAqBrB;;OAEG;IACG,oBAAoB;IAuB1B,aAAa,CAAC,KAAK,EAAE,mBAAmB;IAaxC;;OAEG;IACH,wBAAwB;IAexB;;OAEG;IACH,oBAAoB;IAepB;;OAEG;IACH,gBAAgB,CAAC,IAAI,EAAE,QAAQ;IAO/B,WAAW,CAAC,UAAU,EAAE,UAAU;IAYlC,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAwB7D,gBAAgB,CAAC,UAAU,EAAE,UAAU,EAAE,WAAW,GAAE,OAAe;IA8FrE,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,KAAK,CAAC,QAAQ,CAAC;IAoDtD,MAAM,CAAC,QAAQ,CAAC,IAAI,SAAgB,GAAG,MAAM;CAM9C;AAKD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,IAAI,CAAA;KACpB;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@behold/widget",
3
- "version": "0.5.158",
3
+ "version": "0.5.159",
4
4
  "author": "Griffin Johnston",
5
5
  "license": "UNLICENSED",
6
6
  "keywords": [