diff --git a/dist/bigger-picture.cjs b/dist/bigger-picture.cjs
index e14d981..cfccf65 100644
--- a/dist/bigger-picture.cjs
+++ b/dist/bigger-picture.cjs
@@ -696,32 +696,32 @@ const defaultTweenOptions = (duration) => ({
duration: prefersReducedMotion ? 0 : duration,
});
+const getThumbBackground = (activeItem) =>
+ !activeItem.thumb || `url(${activeItem.thumb})`;
+
/* src/components/loading.svelte generated by Svelte v3.47.0 */
function create_if_block_1$2(ctx) {
let div;
- let span0;
- let span1;
let div_outro;
let current;
return {
c() {
div = element("div");
- span0 = element("span");
- span1 = element("span");
- attr(span0, "class", "bp-bar");
- attr(span1, "class", "bp-o");
+ div.innerHTML = ``;
attr(div, "class", "bp-load");
- attr(div, "style", /*style*/ ctx[2]);
+ set_style(div, "background-image", getThumbBackground(/*activeItem*/ ctx[0]));
},
m(target, anchor) {
insert(target, div, anchor);
- append(div, span0);
- append(div, span1);
current = true;
},
- p: noop,
+ p(ctx, dirty) {
+ if (dirty & /*activeItem*/ 1) {
+ set_style(div, "background-image", getThumbBackground(/*activeItem*/ ctx[0]));
+ }
+ },
i(local) {
if (current) return;
if (div_outro) div_outro.end(1);
@@ -741,7 +741,7 @@ function create_if_block_1$2(ctx) {
};
}
-// (9:140) {#if $closing}
+// (11:57) {#if $closing}
function create_if_block$2(ctx) {
let div;
let div_intro;
@@ -750,12 +750,16 @@ function create_if_block$2(ctx) {
c() {
div = element("div");
attr(div, "class", "bp-load");
- attr(div, "style", /*style*/ ctx[2]);
+ set_style(div, "background-image", getThumbBackground(/*activeItem*/ ctx[0]));
},
m(target, anchor) {
insert(target, div, anchor);
},
- p: noop,
+ p(ctx, dirty) {
+ if (dirty & /*activeItem*/ 1) {
+ set_style(div, "background-image", getThumbBackground(/*activeItem*/ ctx[0]));
+ }
+ },
i(local) {
if (!div_intro) {
add_render_callback(() => {
@@ -774,8 +778,8 @@ function create_if_block$2(ctx) {
function create_fragment$4(ctx) {
let if_block0_anchor;
let if_block1_anchor;
- let if_block0 = !/*loaded*/ ctx[0] && create_if_block_1$2(ctx);
- let if_block1 = /*$closing*/ ctx[1] && create_if_block$2(ctx);
+ let if_block0 = !/*loaded*/ ctx[1] && create_if_block_1$2(ctx);
+ let if_block1 = /*$closing*/ ctx[2] && create_if_block$2(ctx);
return {
c() {
@@ -791,11 +795,11 @@ function create_fragment$4(ctx) {
insert(target, if_block1_anchor, anchor);
},
p(ctx, [dirty]) {
- if (!/*loaded*/ ctx[0]) {
+ if (!/*loaded*/ ctx[1]) {
if (if_block0) {
if_block0.p(ctx, dirty);
- if (dirty & /*loaded*/ 1) {
+ if (dirty & /*loaded*/ 2) {
transition_in(if_block0, 1);
}
} else {
@@ -814,11 +818,11 @@ function create_fragment$4(ctx) {
check_outros();
}
- if (/*$closing*/ ctx[1]) {
+ if (/*$closing*/ ctx[2]) {
if (if_block1) {
if_block1.p(ctx, dirty);
- if (dirty & /*$closing*/ 2) {
+ if (dirty & /*$closing*/ 4) {
transition_in(if_block1, 1);
}
} else {
@@ -850,23 +854,22 @@ function create_fragment$4(ctx) {
function instance$4($$self, $$props, $$invalidate) {
let $closing;
- component_subscribe($$self, closing, $$value => $$invalidate(1, $closing = $$value));
- let { thumb } = $$props;
+ component_subscribe($$self, closing, $$value => $$invalidate(2, $closing = $$value));
+ let { activeItem } = $$props;
let { loaded } = $$props;
- const style = `background-image:url(${thumb})`;
$$self.$$set = $$props => {
- if ('thumb' in $$props) $$invalidate(3, thumb = $$props.thumb);
- if ('loaded' in $$props) $$invalidate(0, loaded = $$props.loaded);
+ if ('activeItem' in $$props) $$invalidate(0, activeItem = $$props.activeItem);
+ if ('loaded' in $$props) $$invalidate(1, loaded = $$props.loaded);
};
- return [loaded, $closing, style, thumb];
+ return [activeItem, loaded, $closing];
}
class Loading extends SvelteComponent {
constructor(options) {
super();
- init(this, options, instance$4, create_fragment$4, not_equal, { thumb: 3, loaded: 0 });
+ init(this, options, instance$4, create_fragment$4, not_equal, { activeItem: 0, loaded: 1 });
}
}
@@ -928,7 +931,7 @@ function create_if_block$1(ctx) {
loading = new Loading({
props: {
- thumb: /*activeItem*/ ctx[7].thumb,
+ activeItem: /*activeItem*/ ctx[7],
loaded: /*loaded*/ ctx[2]
}
});
@@ -965,6 +968,7 @@ function create_fragment$3(ctx) {
let div1;
let div0;
let if_block0_anchor;
+ let style_transform = `translate3d(${/*$imageDimensions*/ ctx[0][0] / -2 + /*$zoomDragTranslate*/ ctx[6][0]}px, ${/*$imageDimensions*/ ctx[0][1] / -2 + /*$zoomDragTranslate*/ ctx[6][1]}px, 0)`;
let current;
let mounted;
let dispose;
@@ -979,12 +983,12 @@ function create_fragment$3(ctx) {
if_block0_anchor = empty();
if (if_block1) if_block1.c();
attr(div0, "class", "bp-img");
- set_style(div0, "background-image", "url(" + /*activeItem*/ ctx[7].thumb + ")");
set_style(div0, "width", /*$imageDimensions*/ ctx[0][0] + "px");
set_style(div0, "height", /*$imageDimensions*/ ctx[0][1] + "px");
- set_style(div0, "transform", "translate3d(" + (/*$imageDimensions*/ ctx[0][0] / -2 + /*$zoomDragTranslate*/ ctx[6][0]) + "px, " + (/*$imageDimensions*/ ctx[0][1] / -2 + /*$zoomDragTranslate*/ ctx[6][1]) + "px, 0)");
toggle_class(div0, "bp-drag", /*pointerDown*/ ctx[4]);
toggle_class(div0, "bp-canzoom", /*maxZoom*/ ctx[11] > 1 && /*$imageDimensions*/ ctx[0][0] < /*naturalWidth*/ ctx[12]);
+ set_style(div0, "background-image", getThumbBackground(/*activeItem*/ ctx[7]));
+ set_style(div0, "transform", style_transform);
attr(div1, "class", "bp-img-wrap");
toggle_class(div1, "bp-close", /*closingWhileZoomed*/ ctx[5]);
},
@@ -1064,10 +1068,6 @@ function create_fragment$3(ctx) {
set_style(div0, "height", /*$imageDimensions*/ ctx[0][1] + "px");
}
- if (!current || dirty[0] & /*$imageDimensions, $zoomDragTranslate*/ 65) {
- set_style(div0, "transform", "translate3d(" + (/*$imageDimensions*/ ctx[0][0] / -2 + /*$zoomDragTranslate*/ ctx[6][0]) + "px, " + (/*$imageDimensions*/ ctx[0][1] / -2 + /*$zoomDragTranslate*/ ctx[6][1]) + "px, 0)");
- }
-
if (dirty[0] & /*pointerDown*/ 16) {
toggle_class(div0, "bp-drag", /*pointerDown*/ ctx[4]);
}
@@ -1076,6 +1076,10 @@ function create_fragment$3(ctx) {
toggle_class(div0, "bp-canzoom", /*maxZoom*/ ctx[11] > 1 && /*$imageDimensions*/ ctx[0][0] < /*naturalWidth*/ ctx[12]);
}
+ if (dirty[0] & /*$imageDimensions, $zoomDragTranslate*/ 65 && style_transform !== (style_transform = `translate3d(${/*$imageDimensions*/ ctx[0][0] / -2 + /*$zoomDragTranslate*/ ctx[6][0]}px, ${/*$imageDimensions*/ ctx[0][1] / -2 + /*$zoomDragTranslate*/ ctx[6][1]}px, 0)`)) {
+ set_style(div0, "transform", style_transform);
+ }
+
if (dirty[0] & /*closingWhileZoomed*/ 32) {
toggle_class(div1, "bp-close", /*closingWhileZoomed*/ ctx[5]);
}
@@ -1524,7 +1528,7 @@ function create_fragment$2(ctx) {
loading = new Loading({
props: {
- thumb: /*activeItem*/ ctx[2].thumb,
+ activeItem: /*activeItem*/ ctx[2],
loaded: /*loaded*/ ctx[0]
}
});
@@ -1622,7 +1626,7 @@ function create_fragment$1(ctx) {
loading = new Loading({
props: {
- thumb: /*activeItem*/ ctx[2].thumb,
+ activeItem: /*activeItem*/ ctx[2],
loaded: /*loaded*/ ctx[0]
}
});
@@ -1634,7 +1638,7 @@ function create_fragment$1(ctx) {
attr(div, "class", "bp-vid");
set_style(div, "width", /*dimensions*/ ctx[1][0] + "px");
set_style(div, "height", /*dimensions*/ ctx[1][1] + "px");
- set_style(div, "background-image", "url(" + /*activeItem*/ ctx[2].thumb + ")");
+ set_style(div, "background-image", getThumbBackground(/*activeItem*/ ctx[2]));
},
m(target, anchor) {
insert(target, div, anchor);
diff --git a/dist/bigger-picture.min.js b/dist/bigger-picture.min.js
index 60b5cc1..b49d415 100644
--- a/dist/bigger-picture.min.js
+++ b/dist/bigger-picture.min.js
@@ -1 +1 @@
-var BiggerPicture=function(){function t(){}const n=t=>t;function e(t,n){for(const e in n)t[e]=n[e];return t}function o(t){return t()}function r(t){t.forEach(o)}function i(t){return"function"==typeof t}function s(t,n){return t!=t?n==n:t!==n}function c(n,e,o){n.$$.on_destroy.push(((n,...e)=>{if(null==n)return t;const o=n.subscribe(...e);return o.unsubscribe?()=>o.unsubscribe():o})(e,o))}function u(n){return n&&i(n.destroy)?n.destroy:t}let l=()=>globalThis.performance.now(),a=t=>requestAnimationFrame(t);const p=new Set;function f(t){p.forEach((n=>{n.c(t)||(p.delete(n),n.f())})),0!==p.size&&a(f)}function d(t){let n;return 0===p.size&&a(f),{promise:new Promise((e=>{p.add(n={c:t,f:e})})),abort(){p.delete(n)}}}function m(t,n){t.appendChild(n)}function h(t,n,e){t.insertBefore(n,e||null)}function b(t){t.parentNode.removeChild(t)}function g(t){return document.createElement(t)}function x(){return document.createTextNode("")}function y(t,n,e,o){return t.addEventListener(n,e,o),()=>t.removeEventListener(n,e,o)}function v(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function w(t,n,e,o){null===e?t.style.removeProperty(n):t.style.setProperty(n,e)}function $(t,n,e){t.classList[e?"add":"remove"](n)}let k,_,M=0,z={};function S(t,n,e,o,r,i,s,c=0){const u=16.666/o;let l="{\n";for(let t=0;1>=t;t+=u){const o=n+(e-n)*i(t);l+=100*t+`%{${s(o,1-o)}}\n`}const a=l+`100% {${s(e,1-e)}}\n}`,p=`_bp_${Math.round(1e9*Math.random())}_${c}`;if(!z[p]){if(!k){const t=g("style");document.head.appendChild(t),k=t.sheet}z[p]=1,k.insertRule(`@keyframes ${p} ${a}`,k.cssRules.length)}const f=t.style.animation||"";return t.style.animation=`${f?f+", ":""}${p} ${o}ms linear ${r}ms 1 both`,M+=1,p}function P(t,n){t.style.animation=(t.style.animation||"").split(", ").filter(n?t=>0>t.indexOf(n):t=>-1===t.indexOf("_bp")).join(", "),n&&!--M&&a((()=>{if(M)return;let t=k.cssRules.length;for(;t--;)k.deleteRule(t);z={}}))}function A(t){_=t}const T=[],I=[],C=[],N=[],O=Promise.resolve();let E=0;function R(t){C.push(t)}const j=new Set;let q,F=0;function B(){const t=_;do{for(;T.length>F;){const t=T[F];F++,A(t),D(t.$$)}for(A(null),T.length=0,F=0;I.length;)I.pop()();for(let t=0;C.length>t;t+=1){const n=C[t];j.has(n)||(j.add(n),n())}C.length=0}while(T.length);for(;N.length;)N.pop()();E=0,j.clear(),A(t)}function D(t){if(null!==t.t){t.update(),r(t.before_update);const n=t.u;t.u=[-1],t.t&&t.t.p(t.ctx,n),t.after_update.forEach(R)}}function J(){return q||(q=Promise.resolve(),q.then((()=>{q=null}))),q}function K(t,n,e){t.dispatchEvent(((t,n,e=0)=>{const o=document.createEvent("CustomEvent");return o.initCustomEvent(t,e,0,n),o})(`${n?"intro":"outro"}${e}`))}const L=new Set;let W;function X(){W={r:0,c:[],p:W}}function Y(){W.r||r(W.c),W=W.p}function G(t,n){t&&t.i&&(L.delete(t),t.i(n))}function H(t,n,e,o){if(t&&t.o){if(L.has(t))return;L.add(t),W.c.push((()=>{L.delete(t),o&&(e&&t.d(1),o())})),t.o(n)}}const Q={duration:0};function U(e,o,r){let s,c,u=o(e,r),a=0,p=0;function f(){s&&P(e,s)}function m(){const{delay:o=0,duration:r=300,l:i=n,g:m=t,css:h}=u||Q;h&&(s=S(e,0,1,r,o,i,h,p++)),m(0,1);const b=l()+o,g=b+r;c&&c.abort(),a=1,R((()=>K(e,1,"start"))),c=d((t=>{if(a){if(t>=g)return m(1,0),K(e,1,"end"),f(),a=0;if(t>=b){const n=i((t-b)/r);m(n,1-n)}}return a}))}let h=0;return{start(){h||(h=1,P(e),i(u)?(u=u(),J().then(m)):m())},invalidate(){h=0},end(){a&&(f(),a=0)}}}function V(e,o,s){let c,u=o(e,s),a=1;const p=W;function f(){const{delay:o=0,duration:i=300,l:s=n,g:f=t,css:m}=u||Q;m&&(c=S(e,1,0,i,o,s,m));const h=l()+o,b=h+i;R((()=>K(e,0,"start"))),d((t=>{if(a){if(t>=b)return f(0,1),K(e,0,"end"),--p.r||r(p.c),0;if(t>=h){const n=s((t-h)/i);f(1-n,n)}}return a}))}return p.r+=1,i(u)?J().then((()=>{u=u(),f()})):f(),{end(t){t&&u.g&&u.g(1,0),a&&(c&&P(e,c),a=0)}}}function Z(t){t&&t.c()}function tt(t,n,e,s){const{t:c,on_mount:u,on_destroy:l,after_update:a}=t.$$;c&&c.m(n,e),s||R((()=>{const n=u.map(o).filter(i);l?l.push(...n):r(n),t.$$.on_mount=[]})),a.forEach(R)}function nt(t,n){const e=t.$$;null!==e.t&&(r(e.on_destroy),e.t&&e.t.d(n),e.on_destroy=e.t=null,e.ctx=[])}function et(n,e,o,i,s,c,u,l=[-1]){const a=_;A(n);const p=n.$$={t:null,ctx:null,v:c,update:t,not_equal:s,bound:{},on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:{},u:l,skip_bound:0,root:e.target||a.$$.root};u&&u(p.root);let f=0;p.ctx=o?o(n,e.v||{},((t,e,...o)=>{const r=o.length?o[0]:e;return p.ctx&&s(p.ctx[t],p.ctx[t]=r)&&(!p.skip_bound&&p.bound[t]&&p.bound[t](r),f&&((t,n)=>{-1===t.$$.u[0]&&(T.push(t),E||(E=1,O.then(B)),t.$$.u.fill(0)),t.$$.u[n/31|0]|=1<{const t=e.indexOf(n);-1!==t&&e.splice(t,1)}}$set(t){this.$$set&&0!==Object.keys(t).length&&(this.$$.skip_bound=1,this.$$set(t),this.$$.skip_bound=0)}}function rt(t){const n=t-1;return n*n*n+1}function it(t,{delay:n=0,duration:e=400,l:o=rt,x:r=0,y:i=0,opacity:s=0}={}){const c=getComputedStyle(t),u=+c.opacity,l="none"===c.transform?"":c.transform,a=u*(1-s);return{delay:n,duration:e,l:o,css(t,n){return`\n\t\t\ttransform: ${l} translate(${(1-t)*r}px, ${(1-t)*i}px);\n\t\t\topacity: ${u-a*n}`}}}const st=[];function ct(n,e=t){let o;const r=new Set;function i(t){if(s(n,t)&&(n=t,o)){const t=!st.length;for(const t of r)t[1](),st.push(t,n);if(t){for(let t=0;st.length>t;t+=2)st[t][0](st[t+1]);st.length=0}}}return{set:i,update(t){i(t(n))},subscribe(s,c=t){const u=[s,c];return r.add(u),1===r.size&&(o=e(i)||t),s(n),()=>{r.delete(u),0===r.size&&(o(),o=null)}}}}function ut(t,n){if(t===n||t!=t)return()=>t;const e=typeof t;if(Array.isArray(t)){const e=n.map(((n,e)=>ut(t[e],n)));return t=>e.map((n=>n(t)))}if("number"===e){const e=n-t;return n=>t+n*e}}function lt(t,o={}){const r=ct(t);let i,s=t;function c(c,u){if(null==t)return r.set(t=c),Promise.resolve();s=c;let a=i,p=0,{delay:f=0,duration:m=400,l:h=n,interpolate:b=ut}=e(e({},o),u);if(0===m)return a&&(a.abort(),a=null),r.set(t=s),Promise.resolve();const g=l()+f;let x;return i=d((n=>{if(g>n)return 1;p||(x=b(t,c),"function"==typeof m&&(m=m(t,c)),p=1),a&&(a.abort(),a=null);const e=n-g;return e>m?(r.set(t=c),0):(r.set(t=x(h(e/m))),1)})),i.promise}return{set:c,update(n,e){return c(n(s,t),e)},subscribe:r.subscribe}}const at=ct(0),pt=globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches,ft=t=>({l:rt,duration:pt?0:t});function dt(n){let e,o,r,i,s;return{c(){e=g("div"),o=g("span"),r=g("span"),v(o,"class","bp-bar"),v(r,"class","bp-o"),v(e,"class","bp-load"),v(e,"style",n[2])},m(t,n){h(t,e,n),m(e,o),m(e,r),s=1},p:t,i(t){s||(i&&i.end(1),s=1)},o(t){t&&(i=V(e,it,{duration:480})),s=0},d(t){t&&b(e),t&&i&&i.end()}}}function mt(n){let e,o;return{c(){e=g("div"),v(e,"class","bp-load"),v(e,"style",n[2])},m(t,n){h(t,e,n)},p:t,i(t){o||R((()=>{o=U(e,it,{duration:480}),o.start()}))},o:t,d(t){t&&b(e)}}}function ht(t){let n,e,o=!t[0]&&dt(t),r=t[1]&&mt(t);return{c(){o&&o.c(),n=x(),r&&r.c(),e=x()},m(t,i){o&&o.m(t,i),h(t,n,i),r&&r.m(t,i),h(t,e,i)},p(t,[i]){t[0]?o&&(X(),H(o,1,1,(()=>{o=null})),Y()):o?(o.p(t,i),1&i&&G(o,1)):(o=dt(t),o.c(),G(o,1),o.m(n.parentNode,n)),t[1]?r?(r.p(t,i),2&i&&G(r,1)):(r=mt(t),r.c(),G(r,1),r.m(e.parentNode,e)):r&&(r.d(1),r=null)},i(t){G(o),G(r)},o(t){H(o)},d(t){o&&o.d(t),t&&b(n),r&&r.d(t),t&&b(e)}}}function bt(t,n,e){let o;c(t,at,(t=>e(1,o=t)));let{thumb:r}=n,{loaded:i}=n;const s=`background-image:url(${r})`;return t.$$set=t=>{"thumb"in t&&e(3,r=t.thumb),"loaded"in t&&e(0,i=t.loaded)},[i,o,s,r]}class gt extends ot{constructor(t){super(),et(this,t,bt,ht,s,{thumb:3,loaded:0})}}function xt(t){let n,e,o,r,i,s,c,u;return{c(){n=g("img"),v(n,"srcset",e=t[7].img),v(n,"sizes",o=t[8].sizes||t[1]+"px"),v(n,"alt",r=t[7].alt)},m(e,o){h(e,n,o),s=1,c||(u=y(n,"error",t[26]),c=1)},p(t,e){(!s||2&e[0]&&o!==(o=t[8].sizes||t[1]+"px"))&&v(n,"sizes",o)},i(t){s||(i&&i.end(1),s=1)},o(t){i=V(n,it,{}),s=0},d(t){t&&b(n),t&&i&&i.end(),c=0,u()}}}function yt(t){let n,e;return n=new gt({v:{thumb:t[7].thumb,loaded:t[2]}}),{c(){Z(n.$$.t)},m(t,o){tt(n,t,o),e=1},p(t,e){const o={};4&e[0]&&(o.loaded=t[2]),n.$set(o)},i(t){e||(G(n.$$.t,t),e=1)},o(t){H(n.$$.t,t),e=0},d(t){nt(n,t)}}}function vt(t){let n,e,o,i,s,c,l=t[2]&&xt(t),a=t[3]&&yt(t);return{c(){n=g("div"),e=g("div"),l&&l.c(),o=x(),a&&a.c(),v(e,"class","bp-img"),w(e,"background-image","url("+t[7].thumb+")"),w(e,"width",t[0][0]+"px"),w(e,"height",t[0][1]+"px"),w(e,"transform","translate3d("+(t[0][0]/-2+t[6][0])+"px, "+(t[0][1]/-2+t[6][1])+"px, 0)"),$(e,"bp-drag",t[4]),$(e,"bp-canzoom",t[11]>1&&t[12]>t[0][0]),v(n,"class","bp-img-wrap"),$(n,"bp-close",t[5])},m(r,p){h(r,n,p),m(n,e),l&&l.m(e,null),m(e,o),a&&a.m(e,null),i=1,s||(c=[u(t[20].call(null,e)),y(n,"wheel",t[15]),y(n,"pointerdown",t[16]),y(n,"pointermove",t[17]),y(n,"pointerup",t[19]),y(n,"pointercancel",t[18])],s=1)},p(t,r){t[2]?l?(l.p(t,r),4&r[0]&&G(l,1)):(l=xt(t),l.c(),G(l,1),l.m(e,o)):l&&(X(),H(l,1,1,(()=>{l=null})),Y()),t[3]?a?(a.p(t,r),8&r[0]&&G(a,1)):(a=yt(t),a.c(),G(a,1),a.m(e,null)):a&&(X(),H(a,1,1,(()=>{a=null})),Y()),(!i||1&r[0])&&w(e,"width",t[0][0]+"px"),(!i||1&r[0])&&w(e,"height",t[0][1]+"px"),(!i||65&r[0])&&w(e,"transform","translate3d("+(t[0][0]/-2+t[6][0])+"px, "+(t[0][1]/-2+t[6][1])+"px, 0)"),16&r[0]&&$(e,"bp-drag",t[4]),6145&r[0]&&$(e,"bp-canzoom",t[11]>1&&t[12]>t[0][0]),32&r[0]&&$(n,"bp-close",t[5])},i(t){i||(G(l),G(a),i=1)},o(t){H(l),H(a),i=0},d(t){t&&b(n),l&&l.d(),a&&a.d(),s=0,r(c)}}}function wt(t,n,e){let o,r,i,s;c(t,at,(t=>e(25,i=t)));let{v:u}=n,{$:l}=n,{k:a,_:p,M:f,next:d,zoomed:m,container:h}=u;c(t,m,(t=>e(24,o=t)));let b,g,x,y,v,w,$,k,_,M,z,S=a.maxZoom||p.maxZoom||10,P=u.S(a),A=P[0],T=0;const I=+a.width,C=[],N=new Map,O=lt(P,ft(400));c(t,O,(t=>e(0,s=t)));const E=lt([0,0],ft(400));c(t,E,(t=>e(6,r=t)));const R=([t,n],o=s)=>{const r=(o[0]-h.w)/2,i=(o[1]-h.h)/2;return 0>r?t=0:t>r?l?(t=v?r+(t-r)/10:r)>r+20&&e(4,v=f()):t=r:-r>t&&(l?-r-20>(t=v?-r-(-r-t)/10:-r)&&e(4,v=d()):t=-r),0>i?n=0:n>i?n=i:-i>n&&(n=-i),[t,n]};function j(t=S,n){if(i)return;const o=P[0]*S;let c=s[0]+s[0]*t,u=s[1]+s[1]*t;if(t>0)c>o&&(c=o,u=P[1]*S),c>I&&(c=I,u=+a.height);else if(P[0]>c)return O.set(P),E.set([0,0]);let{x:l,y:p,width:f,height:d}=y.getBoundingClientRect();const m=n?n.clientX-l-f/2:0,h=n?n.clientY-p-d/2:0;l=c/f*-m+m,p=u/d*-h+h;const b=[c,u];O.set(b).then((()=>{e(1,A=Math.round(Math.max(A,c)))})),E.set(R([r[0]+l,r[1]+p],b))}Object.defineProperty(a,"zoom",{configurable:1,get(){return o},set(t){return j(t?S:-S)}});const q=t=>N.delete(t.pointerId);return t.$$set=t=>{"$"in t&&e(22,l=t.$)},t.$$.update=()=>{if(8388609&t.$$.u[0]&&m.set(s[0]-10>P[0]),58720256&t.$$.u[0]&&i&&o&&!p.intro){const t=ft(480);E.set([0,0],t),O.set(P,t),e(5,z=1)}},[s,A,b,g,v,z,r,a,p,m,h,S,I,O,E,t=>{p.inline&&!o||(t.preventDefault(),j(t.deltaY/-300,t))},t=>{2!==t.button&&(t.preventDefault(),e(4,v=1),N.set(t.pointerId,t),$=t.clientX,k=t.clientY,_=r[0],M=r[1])},t=>{if(N.size>1)return e(4,v=0),p.noPinch?.(h.el)||(t=>{const[n,e]=N.set(t.pointerId,t).values(),o=Math.hypot(n.clientX-e.clientX,n.clientY-e.clientY);x=x||{clientX:(n.clientX+e.clientX)/2,clientY:(n.clientY+e.clientY)/2},j(((T||o)-o)/-35,x),T=o})(t);if(!v)return;let n=t.clientX,r=t.clientY;w=C.push({x:n,y:r})>2,n-=$,r-=k,o||(-90>r&&e(4,v=!p.noClose&&u.close()),30>Math.abs(r)&&(n>40&&e(4,v=f()),-40>n&&e(4,v=d()))),o&&w&&!i&&E.set(R([_+n,M+r]),{duration:0})},q,function(t){if(q(t),x&&(e(4,v=T=0),x=N.size?x:null),v){if(e(4,v=0),t.target===this&&!p.noClose)return u.close();if(w){const[t,n,e]=C.slice(-3);Math.hypot(n.x-e.x,n.y-e.y)>5&&E.set(R([r[0]-5*(t.x-e.x),r[1]-5*(t.y-e.y)]))}else p.onImageClick?.(h.el,a)||j(o?-S:S,t);w=0,C.length=0}},t=>{y=t,u.P((()=>{e(23,P=u.S(a)),!p.inline&&l||(O.set(P),E.set([0,0]))})),u.A(a).then((()=>{e(2,b=1),u.T()})),setTimeout((()=>{e(3,g=!b)}),250)},u,l,P,o,i,t=>p.onError?.(h,a,t)]}class $t extends ot{constructor(t){super(),et(this,t,wt,vt,s,{v:21,$:22},null,[-1,-1])}}function kt(t){let n,e,o,i,s,c;return o=new gt({v:{thumb:t[2].thumb,loaded:t[0]}}),{c(){n=g("div"),e=g("iframe"),Z(o.$$.t),v(e,"allow","autoplay; fullscreen"),v(e,"title",t[2].title),v(n,"class","bp-if"),w(n,"width",t[1][0]+"px"),w(n,"height",t[1][1]+"px")},m(r,l){h(r,n,l),m(n,e),tt(o,n,null),i=1,s||(c=[u(t[3].call(null,e)),y(e,"load",t[5])],s=1)},p(t,[e]){const r={};1&e&&(r.loaded=t[0]),o.$set(r),(!i||2&e)&&w(n,"width",t[1][0]+"px"),(!i||2&e)&&w(n,"height",t[1][1]+"px")},i(t){i||(G(o.$$.t,t),i=1)},o(t){H(o.$$.t,t),i=0},d(t){t&&b(n),nt(o),s=0,r(c)}}}function _t(t,n,e){let o,r,{v:i}=n;const{k:s}=i,c=()=>e(1,r=i.S(s));return c(),i.P(c),[o,r,s,t=>t.src=s.iframe,i,()=>e(0,o=1)]}class Mt extends ot{constructor(t){super(),et(this,t,_t,kt,s,{v:4})}}function zt(t){let n,e,o,r,i;return e=new gt({v:{thumb:t[2].thumb,loaded:t[0]}}),{c(){n=g("div"),Z(e.$$.t),v(n,"class","bp-vid"),w(n,"width",t[1][0]+"px"),w(n,"height",t[1][1]+"px"),w(n,"background-image","url("+t[2].thumb+")")},m(s,c){h(s,n,c),tt(e,n,null),o=1,r||(i=u(t[3].call(null,n)),r=1)},p(t,[r]){const i={};1&r&&(i.loaded=t[0]),e.$set(i),(!o||2&r)&&w(n,"width",t[1][0]+"px"),(!o||2&r)&&w(n,"height",t[1][1]+"px")},i(t){o||(G(e.$$.t,t),o=1)},o(t){H(e.$$.t,t),o=0},d(t){t&&b(n),nt(e),r=0,i()}}}function St(t,n,e){let o,r,{v:i}=n;const{k:s,_:c,container:u}=i,l=()=>e(1,r=i.S(s));l(),i.P(l);const a=(t,n)=>{for(const e in n)v(t,e,n[e])};return[o,r,s,t=>{let n;const r=(t,e)=>{Array.isArray(e)||(e=JSON.parse(e));for(const o of e){n||(n=g(o.type?.includes("audio")?"audio":"video"),a(n,{controls:1,autoplay:1,playsinline:1,tabindex:"0"}));const e=g(t);a(e,o),"source"==t&&y(e,"error",(t=>c.onError?.(u,s,t))),m(n,e)}};r("source",s.sources),r("track",s.tracks||[]),y(n,"canplay",(()=>e(0,o=1))),m(t,n)},i]}class Pt extends ot{constructor(t){super(),et(this,t,St,zt,s,{v:4})}}function At(n){let e,o,i,c,l,a,p,f,d,x,w=n[6].i,k=Et(n),_=n[0].length>1&&Rt(n);return{c(){e=g("div"),o=g("div"),k.c(),c=g("div"),l=g("button"),_&&_.c(),v(l,"class","bp-x"),v(l,"title","Close"),v(l,"aria-label","Close"),v(c,"class","bp-controls"),v(e,"class","bp-wrap"),$(e,"bp-zoomed",n[10]),$(e,"bp-inline",n[8]),$(e,"bp-small",n[7]),$(e,"bp-noclose",n[5].noClose)},m(t,r){h(t,e,r),m(e,o),k.m(e,null),m(e,c),m(c,l),_&&_.m(c,null),f=1,d||(x=[y(l,"click",n[1]),u(p=n[14].call(null,e))],d=1)},p(n,o){64&o[0]&&s(w,w=n[6].i)?(X(),H(k,1,1,t),Y(),k=Et(n),k.c(),G(k),k.m(e,c)):k.p(n,o),n[0].length>1?_?_.p(n,o):(_=Rt(n),_.c(),_.m(c,null)):_&&(_.d(1),_=null),1024&o[0]&&$(e,"bp-zoomed",n[10]),256&o[0]&&$(e,"bp-inline",n[8]),128&o[0]&&$(e,"bp-small",n[7]),32&o[0]&&$(e,"bp-noclose",n[5].noClose)},i(t){f||(i&&i.end(1),G(k),a&&a.end(1),f=1)},o(t){t&&(i=V(o,it,{duration:480})),H(k),t&&(a=V(c,it,{})),f=0},d(t){t&&b(e),t&&i&&i.end(),k.d(t),_&&_.d(),t&&a&&a.end(),d=0,r(x)}}}function Tt(n){let e,o=(n[6].html??n[6].element.outerHTML)+"";return{c(){e=g("div"),v(e,"class","bp-html")},m(t,n){h(t,e,n),e.innerHTML=o},p(t,n){64&n[0]&&o!==(o=(t[6].html??t[6].element.outerHTML)+"")&&(e.innerHTML=o)},i:t,o:t,d(t){t&&b(e)}}}function It(n){let e,o;return e=new Mt({v:{v:n[13]()}}),{c(){Z(e.$$.t)},m(t,n){tt(e,t,n),o=1},p:t,i(t){o||(G(e.$$.t,t),o=1)},o(t){H(e.$$.t,t),o=0},d(t){nt(e,t)}}}function Ct(n){let e,o;return e=new Pt({v:{v:n[13]()}}),{c(){Z(e.$$.t)},m(t,n){tt(e,t,n),o=1},p:t,i(t){o||(G(e.$$.t,t),o=1)},o(t){H(e.$$.t,t),o=0},d(t){nt(e,t)}}}function Nt(t){let n,e;return n=new $t({v:{v:t[13](),$:t[7]}}),{c(){Z(n.$$.t)},m(t,o){tt(n,t,o),e=1},p(t,e){const o={};128&e[0]&&(o.$=t[7]),n.$set(o)},i(t){e||(G(n.$$.t,t),e=1)},o(t){H(n.$$.t,t),e=0},d(t){nt(n,t)}}}function Ot(t){let n,e,o,r=t[6].caption+"";return{c(){n=g("div"),v(n,"class","bp-cap")},m(t,e){h(t,n,e),n.innerHTML=r,o=1},p(t,e){(!o||64&e[0])&&r!==(r=t[6].caption+"")&&(n.innerHTML=r)},i(t){o||(e&&e.end(1),o=1)},o(t){e=V(n,it,{duration:200}),o=0},d(t){t&&b(n),t&&e&&e.end()}}}function Et(t){let n,e,o,i,s,c,u,l,a;const p=[Nt,Ct,It,Tt],f=[];function d(t,n){return t[6].img?0:t[6].sources?1:t[6].iframe?2:3}e=d(t),o=f[e]=p[e](t);let m=t[6].caption&&Ot(t);return{c(){n=g("div"),o.c(),m&&m.c(),c=x(),v(n,"class","bp-inner")},m(o,r){h(o,n,r),f[e].m(n,null),m&&m.m(o,r),h(o,c,r),u=1,l||(a=[y(n,"pointerdown",t[20]),y(n,"pointerup",t[21])],l=1)},p(t,r){let i=e;e=d(t),e===i?f[e].p(t,r):(X(),H(f[i],1,1,(()=>{f[i]=null})),Y(),o=f[e],o?o.p(t,r):(o=f[e]=p[e](t),o.c()),G(o,1),o.m(n,null)),t[6].caption?m?(m.p(t,r),64&r[0]&&G(m,1)):(m=Ot(t),m.c(),G(m,1),m.m(c.parentNode,c)):m&&(X(),H(m,1,1,(()=>{m=null})),Y())},i(e){u||(G(o),R((()=>{s&&s.end(1),i=U(n,t[12],1),i.start()})),G(m),u=1)},o(e){H(o),i&&i.invalidate(),s=V(n,t[12],0),H(m),u=0},d(t){t&&b(n),f[e].d(),t&&s&&s.end(),m&&m.d(t),t&&b(c),l=0,r(a)}}}function Rt(t){let n,e,o,i,s,c=`${t[4]+1} / ${t[0].length}`;return{c(){n=g("div"),e=g("button"),o=g("button"),v(n,"class","bp-count"),v(e,"class","bp-prev"),v(e,"title","Previous"),v(e,"aria-label","Previous"),v(o,"class","bp-next"),v(o,"title","Next"),v(o,"aria-label","Next")},m(r,u){h(r,n,u),n.innerHTML=c,h(r,e,u),h(r,o,u),i||(s=[y(e,"click",t[2]),y(o,"click",t[3])],i=1)},p(t,e){17&e[0]&&c!==(c=`${t[4]+1} / ${t[0].length}`)&&(n.innerHTML=c)},d(t){t&&b(n),t&&b(e),t&&b(o),i=0,r(s)}}}function jt(t){let n,e,o=t[0]&&At(t);return{c(){o&&o.c(),n=x()},m(t,r){o&&o.m(t,r),h(t,n,r),e=1},p(t,e){t[0]?o?(o.p(t,e),1&e[0]&&G(o,1)):(o=At(t),o.c(),G(o,1),o.m(n.parentNode,n)):o&&(X(),H(o,1,1,(()=>{o=null})),Y())},i(t){e||(G(o),e=1)},o(t){H(o),e=0},d(t){o&&o.d(t),t&&b(n)}}}function qt(t,n,e){let o,{items:r}=n,{target:i}=n;const s=document.documentElement;let u,l,a,p,f,d,m,h,b;const x=()=>!b.img&&!b.sources&&!b.iframe;let v;const w=t=>v=t,$={},k=ct(0);c(t,k,(t=>e(10,o=t)));const _=()=>{l.onClose?.($.el,b),at.set(1),e(0,r=null),p?.focus({preventScroll:1})},M=()=>S(u-1),z=()=>S(u+1),S=t=>{m=t-u,e(4,u=P(t))},P=t=>(t+r.length)%r.length,A=t=>{const{key:n,shiftKey:e}=t;if("Escape"===n)!l.noClose&&_();else if("ArrowRight"===n)z();else if("ArrowLeft"===n)M();else if("Tab"===n){const{activeElement:n}=document;if(e||!n.controls){t.preventDefault();const{focusWrap:o=$.el}=l,r=[...o.querySelectorAll("*")].filter((t=>t.tabIndex>=0));let i=r.indexOf(n);i+=r.length+(e?-1:1),r[i%r.length].focus()}}},T=({width:t=1920,height:n=1080})=>{const{scale:e=.99}=l,o=Math.min(1,$.w/t*e,$.h/n*e);return[Math.round(t*o),Math.round(n*o)]},I=()=>{if(r){const t=r[P(u+1)],n=r[P(u-1)];!t.preload&&C(t),!n.preload&&C(n)}},C=t=>{if(t.img){const n=g("img");return n.sizes=l.sizes||T(t)[0]+"px",n.srcset=t.img,t.preload=1,n.decode().catch((t=>{}))}};return t.$$set=t=>{"items"in t&&e(0,r=t.items),"target"in t&&e(15,i=t.target)},t.$$.update=()=>{786545&t.$$.u[0]&&r&&(e(6,b=r[u]),a&&l.onUpdate?.($.el,b))},[r,_,M,z,u,l,b,f,d,h,o,k,(t,n)=>a&&r?it(t,{x:(m>0?20:-20)*(n?1:-1),duration:250}):(e(18,a=n),l.intro?it(t,{y:n?10:-10}):(t=>{let n;if(x()){const e=t.firstChild.firstChild;n=[e.clientWidth,e.clientHeight]}else n=T(b);const e=(b.element||p).getBoundingClientRect(),o=e.left-($.w-e.width)/2,r=e.top-($.h-e.height)/2,i=e.width/n[0],s=e.height/n[1];return{duration:480,l:rt,css:(t,n)=>`transform:translate3d(${o*n}px, ${r*n}px, 0) scale3d(${i+t*(1-i)}, ${s+t*(1-s)}, 1)`}})(t)),()=>({k:b,S:T,A:C,T:I,_:l,M,next:z,close:_,P:w,zoomed:k,container:$}),t=>{let n,o;e(19,$.el=t,$),l.onOpen?.($.el,b),d||(n=y(globalThis,"keydown",A));const r=new ResizeObserver((t=>{o&&(e(19,$.w=t[0].contentRect.width,$),e(19,$.h=t[0].contentRect.height,$),e(7,f=769>$.w),x()||v?.(),l.onResize?.($.el,b)),o=1}));return r.observe(t),{destroy(){r.disconnect(),n?.(),at.set(0),s.classList.remove("bp-lock"),l.onClosed?.()}}},i,t=>{e(5,l=t),e(8,d=l.inline);const n=l.items;!d&&s.scrollHeight>s.clientHeight&&s.classList.add("bp-lock"),p=document.activeElement,e(19,$.w=i.offsetWidth,$),e(19,$.h=i===document.body?globalThis.innerHeight:i.clientHeight,$),e(7,f=769>$.w),e(4,u=l.position||0),e(0,r=Array.isArray(n)?n.map(((t,n)=>(l.el&&l.el===t.element&&e(4,u=n),{i:n,...t}))):(n.length?[...n]:[n]).map(((t,n)=>(l.el===t&&e(4,u=n),{element:t,i:n,...t.dataset}))))},S,a,$,t=>e(9,h=t.target),function(t){2!==t.button&&t.target===this&&h===this&&!l.noClose&&_()}]}class Ft extends ot{constructor(t){super(),et(this,t,qt,jt,s,{items:0,target:15,open:16,close:1,M:2,next:3,setPosition:17},null,[-1,-1])}get items(){return this.$$.ctx[0]}get target(){return this.$$.ctx[15]}get open(){return this.$$.ctx[16]}get close(){return this.$$.ctx[1]}get M(){return this.$$.ctx[2]}get next(){return this.$$.ctx[3]}get setPosition(){return this.$$.ctx[17]}}return t=>new Ft({...t,v:t})}();
+var BiggerPicture=function(){function t(){}const n=t=>t;function e(t,n){for(const e in n)t[e]=n[e];return t}function o(t){return t()}function r(t){t.forEach(o)}function i(t){return"function"==typeof t}function c(t,n){return t!=t?n==n:t!==n}function s(n,e,o){n.$$.on_destroy.push(((n,...e)=>{if(null==n)return t;const o=n.subscribe(...e);return o.unsubscribe?()=>o.unsubscribe():o})(e,o))}function u(n){return n&&i(n.destroy)?n.destroy:t}let l=()=>globalThis.performance.now(),a=t=>requestAnimationFrame(t);const p=new Set;function f(t){p.forEach((n=>{n.c(t)||(p.delete(n),n.f())})),0!==p.size&&a(f)}function d(t){let n;return 0===p.size&&a(f),{promise:new Promise((e=>{p.add(n={c:t,f:e})})),abort(){p.delete(n)}}}function m(t,n){t.appendChild(n)}function b(t,n,e){t.insertBefore(n,e||null)}function h(t){t.parentNode.removeChild(t)}function g(t){return document.createElement(t)}function x(){return document.createTextNode("")}function v(t,n,e,o){return t.addEventListener(n,e,o),()=>t.removeEventListener(n,e,o)}function w(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function y(t,n,e,o){null===e?t.style.removeProperty(n):t.style.setProperty(n,e)}function $(t,n,e){t.classList[e?"add":"remove"](n)}let k,_,M=0,z={};function I(t,n,e,o,r,i,c,s=0){const u=16.666/o;let l="{\n";for(let t=0;1>=t;t+=u){const o=n+(e-n)*i(t);l+=100*t+`%{${c(o,1-o)}}\n`}const a=l+`100% {${c(e,1-e)}}\n}`,p=`_bp_${Math.round(1e9*Math.random())}_${s}`;if(!z[p]){if(!k){const t=g("style");document.head.appendChild(t),k=t.sheet}z[p]=1,k.insertRule(`@keyframes ${p} ${a}`,k.cssRules.length)}const f=t.style.animation||"";return t.style.animation=`${f?f+", ":""}${p} ${o}ms linear ${r}ms 1 both`,M+=1,p}function S(t,n){t.style.animation=(t.style.animation||"").split(", ").filter(n?t=>0>t.indexOf(n):t=>-1===t.indexOf("_bp")).join(", "),n&&!--M&&a((()=>{if(M)return;let t=k.cssRules.length;for(;t--;)k.deleteRule(t);z={}}))}function P(t){_=t}const A=[],T=[],C=[],N=[],O=Promise.resolve();let E=0;function R(t){C.push(t)}const j=new Set;let q,F=0;function B(){const t=_;do{for(;A.length>F;){const t=A[F];F++,P(t),D(t.$$)}for(P(null),A.length=0,F=0;T.length;)T.pop()();for(let t=0;C.length>t;t+=1){const n=C[t];j.has(n)||(j.add(n),n())}C.length=0}while(A.length);for(;N.length;)N.pop()();E=0,j.clear(),P(t)}function D(t){if(null!==t.t){t.update(),r(t.before_update);const n=t.u;t.u=[-1],t.t&&t.t.p(t.ctx,n),t.after_update.forEach(R)}}function J(){return q||(q=Promise.resolve(),q.then((()=>{q=null}))),q}function K(t,n,e){t.dispatchEvent(((t,n,e=0)=>{const o=document.createEvent("CustomEvent");return o.initCustomEvent(t,e,0,n),o})(`${n?"intro":"outro"}${e}`))}const L=new Set;let W;function X(){W={r:0,c:[],p:W}}function Y(){W.r||r(W.c),W=W.p}function G(t,n){t&&t.i&&(L.delete(t),t.i(n))}function H(t,n,e,o){if(t&&t.o){if(L.has(t))return;L.add(t),W.c.push((()=>{L.delete(t),o&&(e&&t.d(1),o())})),t.o(n)}}const Q={duration:0};function U(e,o,r){let c,s,u=o(e,r),a=0,p=0;function f(){c&&S(e,c)}function m(){const{delay:o=0,duration:r=300,l:i=n,g:m=t,css:b}=u||Q;b&&(c=I(e,0,1,r,o,i,b,p++)),m(0,1);const h=l()+o,g=h+r;s&&s.abort(),a=1,R((()=>K(e,1,"start"))),s=d((t=>{if(a){if(t>=g)return m(1,0),K(e,1,"end"),f(),a=0;if(t>=h){const n=i((t-h)/r);m(n,1-n)}}return a}))}let b=0;return{start(){b||(b=1,S(e),i(u)?(u=u(),J().then(m)):m())},invalidate(){b=0},end(){a&&(f(),a=0)}}}function V(e,o,c){let s,u=o(e,c),a=1;const p=W;function f(){const{delay:o=0,duration:i=300,l:c=n,g:f=t,css:m}=u||Q;m&&(s=I(e,1,0,i,o,c,m));const b=l()+o,h=b+i;R((()=>K(e,0,"start"))),d((t=>{if(a){if(t>=h)return f(0,1),K(e,0,"end"),--p.r||r(p.c),0;if(t>=b){const n=c((t-b)/i);f(1-n,n)}}return a}))}return p.r+=1,i(u)?J().then((()=>{u=u(),f()})):f(),{end(t){t&&u.g&&u.g(1,0),a&&(s&&S(e,s),a=0)}}}function Z(t){t&&t.c()}function tt(t,n,e,c){const{t:s,on_mount:u,on_destroy:l,after_update:a}=t.$$;s&&s.m(n,e),c||R((()=>{const n=u.map(o).filter(i);l?l.push(...n):r(n),t.$$.on_mount=[]})),a.forEach(R)}function nt(t,n){const e=t.$$;null!==e.t&&(r(e.on_destroy),e.t&&e.t.d(n),e.on_destroy=e.t=null,e.ctx=[])}function et(n,e,o,i,c,s,u,l=[-1]){const a=_;P(n);const p=n.$$={t:null,ctx:null,v:s,update:t,not_equal:c,bound:{},on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:{},u:l,skip_bound:0,root:e.target||a.$$.root};u&&u(p.root);let f=0;p.ctx=o?o(n,e.v||{},((t,e,...o)=>{const r=o.length?o[0]:e;return p.ctx&&c(p.ctx[t],p.ctx[t]=r)&&(!p.skip_bound&&p.bound[t]&&p.bound[t](r),f&&((t,n)=>{-1===t.$$.u[0]&&(A.push(t),E||(E=1,O.then(B)),t.$$.u.fill(0)),t.$$.u[n/31|0]|=1<{const t=e.indexOf(n);-1!==t&&e.splice(t,1)}}$set(t){this.$$set&&0!==Object.keys(t).length&&(this.$$.skip_bound=1,this.$$set(t),this.$$.skip_bound=0)}}function rt(t){const n=t-1;return n*n*n+1}function it(t,{delay:n=0,duration:e=400,l:o=rt,x:r=0,y:i=0,opacity:c=0}={}){const s=getComputedStyle(t),u=+s.opacity,l="none"===s.transform?"":s.transform,a=u*(1-c);return{delay:n,duration:e,l:o,css(t,n){return`\n\t\t\ttransform: ${l} translate(${(1-t)*r}px, ${(1-t)*i}px);\n\t\t\topacity: ${u-a*n}`}}}const ct=[];function st(n,e=t){let o;const r=new Set;function i(t){if(c(n,t)&&(n=t,o)){const t=!ct.length;for(const t of r)t[1](),ct.push(t,n);if(t){for(let t=0;ct.length>t;t+=2)ct[t][0](ct[t+1]);ct.length=0}}}return{set:i,update(t){i(t(n))},subscribe(c,s=t){const u=[c,s];return r.add(u),1===r.size&&(o=e(i)||t),c(n),()=>{r.delete(u),0===r.size&&(o(),o=null)}}}}function ut(t,n){if(t===n||t!=t)return()=>t;const e=typeof t;if(Array.isArray(t)){const e=n.map(((n,e)=>ut(t[e],n)));return t=>e.map((n=>n(t)))}if("number"===e){const e=n-t;return n=>t+n*e}}function lt(t,o={}){const r=st(t);let i,c=t;function s(s,u){if(null==t)return r.set(t=s),Promise.resolve();c=s;let a=i,p=0,{delay:f=0,duration:m=400,l:b=n,interpolate:h=ut}=e(e({},o),u);if(0===m)return a&&(a.abort(),a=null),r.set(t=c),Promise.resolve();const g=l()+f;let x;return i=d((n=>{if(g>n)return 1;p||(x=h(t,s),"function"==typeof m&&(m=m(t,s)),p=1),a&&(a.abort(),a=null);const e=n-g;return e>m?(r.set(t=s),0):(r.set(t=x(b(e/m))),1)})),i.promise}return{set:s,update(n,e){return s(n(c,t),e)},subscribe:r.subscribe}}const at=st(0),pt=globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches,ft=t=>({l:rt,duration:pt?0:t}),dt=t=>!t.thumb||`url(${t.thumb})`;function mt(t){let n,e,o;return{c(){n=g("div"),n.innerHTML='',w(n,"class","bp-load"),y(n,"background-image",dt(t[0]))},m(t,e){b(t,n,e),o=1},p(t,e){1&e&&y(n,"background-image",dt(t[0]))},i(t){o||(e&&e.end(1),o=1)},o(t){t&&(e=V(n,it,{duration:480})),o=0},d(t){t&&h(n),t&&e&&e.end()}}}function bt(n){let e,o;return{c(){e=g("div"),w(e,"class","bp-load"),y(e,"background-image",dt(n[0]))},m(t,n){b(t,e,n)},p(t,n){1&n&&y(e,"background-image",dt(t[0]))},i(t){o||R((()=>{o=U(e,it,{duration:480}),o.start()}))},o:t,d(t){t&&h(e)}}}function ht(t){let n,e,o=!t[1]&&mt(t),r=t[2]&&bt(t);return{c(){o&&o.c(),n=x(),r&&r.c(),e=x()},m(t,i){o&&o.m(t,i),b(t,n,i),r&&r.m(t,i),b(t,e,i)},p(t,[i]){t[1]?o&&(X(),H(o,1,1,(()=>{o=null})),Y()):o?(o.p(t,i),2&i&&G(o,1)):(o=mt(t),o.c(),G(o,1),o.m(n.parentNode,n)),t[2]?r?(r.p(t,i),4&i&&G(r,1)):(r=bt(t),r.c(),G(r,1),r.m(e.parentNode,e)):r&&(r.d(1),r=null)},i(t){G(o),G(r)},o(t){H(o)},d(t){o&&o.d(t),t&&h(n),r&&r.d(t),t&&h(e)}}}function gt(t,n,e){let o;s(t,at,(t=>e(2,o=t)));let{$:r}=n,{loaded:i}=n;return t.$$set=t=>{"$"in t&&e(0,r=t.$),"loaded"in t&&e(1,i=t.loaded)},[r,i,o]}class xt extends ot{constructor(t){super(),et(this,t,gt,ht,c,{$:0,loaded:1})}}function vt(t){let n,e,o,r,i,c,s,u;return{c(){n=g("img"),w(n,"srcset",e=t[7].img),w(n,"sizes",o=t[8].sizes||t[1]+"px"),w(n,"alt",r=t[7].alt)},m(e,o){b(e,n,o),c=1,s||(u=v(n,"error",t[26]),s=1)},p(t,e){(!c||2&e[0]&&o!==(o=t[8].sizes||t[1]+"px"))&&w(n,"sizes",o)},i(t){c||(i&&i.end(1),c=1)},o(t){i=V(n,it,{}),c=0},d(t){t&&h(n),t&&i&&i.end(),s=0,u()}}}function wt(t){let n,e;return n=new xt({v:{$:t[7],loaded:t[2]}}),{c(){Z(n.$$.t)},m(t,o){tt(n,t,o),e=1},p(t,e){const o={};4&e[0]&&(o.loaded=t[2]),n.$set(o)},i(t){e||(G(n.$$.t,t),e=1)},o(t){H(n.$$.t,t),e=0},d(t){nt(n,t)}}}function yt(t){let n,e,o,i,c,s,l=`translate3d(${t[0][0]/-2+t[6][0]}px, ${t[0][1]/-2+t[6][1]}px, 0)`,a=t[2]&&vt(t),p=t[3]&&wt(t);return{c(){n=g("div"),e=g("div"),a&&a.c(),o=x(),p&&p.c(),w(e,"class","bp-img"),y(e,"width",t[0][0]+"px"),y(e,"height",t[0][1]+"px"),$(e,"bp-drag",t[4]),$(e,"bp-canzoom",t[11]>1&&t[12]>t[0][0]),y(e,"background-image",dt(t[7])),y(e,"transform",l),w(n,"class","bp-img-wrap"),$(n,"bp-close",t[5])},m(r,l){b(r,n,l),m(n,e),a&&a.m(e,null),m(e,o),p&&p.m(e,null),i=1,c||(s=[u(t[20].call(null,e)),v(n,"wheel",t[15]),v(n,"pointerdown",t[16]),v(n,"pointermove",t[17]),v(n,"pointerup",t[19]),v(n,"pointercancel",t[18])],c=1)},p(t,r){t[2]?a?(a.p(t,r),4&r[0]&&G(a,1)):(a=vt(t),a.c(),G(a,1),a.m(e,o)):a&&(X(),H(a,1,1,(()=>{a=null})),Y()),t[3]?p?(p.p(t,r),8&r[0]&&G(p,1)):(p=wt(t),p.c(),G(p,1),p.m(e,null)):p&&(X(),H(p,1,1,(()=>{p=null})),Y()),(!i||1&r[0])&&y(e,"width",t[0][0]+"px"),(!i||1&r[0])&&y(e,"height",t[0][1]+"px"),16&r[0]&&$(e,"bp-drag",t[4]),6145&r[0]&&$(e,"bp-canzoom",t[11]>1&&t[12]>t[0][0]),65&r[0]&&l!==(l=`translate3d(${t[0][0]/-2+t[6][0]}px, ${t[0][1]/-2+t[6][1]}px, 0)`)&&y(e,"transform",l),32&r[0]&&$(n,"bp-close",t[5])},i(t){i||(G(a),G(p),i=1)},o(t){H(a),H(p),i=0},d(t){t&&h(n),a&&a.d(),p&&p.d(),c=0,r(s)}}}function $t(t,n,e){let o,r,i,c;s(t,at,(t=>e(25,i=t)));let{v:u}=n,{k:l}=n,{$:a,_:p,M:f,next:d,zoomed:m,container:b}=u;s(t,m,(t=>e(24,o=t)));let h,g,x,v,w,y,$,k,_,M,z,I=a.maxZoom||p.maxZoom||10,S=u.I(a),P=S[0],A=0;const T=+a.width,C=[],N=new Map,O=lt(S,ft(400));s(t,O,(t=>e(0,c=t)));const E=lt([0,0],ft(400));s(t,E,(t=>e(6,r=t)));const R=([t,n],o=c)=>{const r=(o[0]-b.w)/2,i=(o[1]-b.h)/2;return 0>r?t=0:t>r?l?(t=w?r+(t-r)/10:r)>r+20&&e(4,w=f()):t=r:-r>t&&(l?-r-20>(t=w?-r-(-r-t)/10:-r)&&e(4,w=d()):t=-r),0>i?n=0:n>i?n=i:-i>n&&(n=-i),[t,n]};function j(t=I,n){if(i)return;const o=S[0]*I;let s=c[0]+c[0]*t,u=c[1]+c[1]*t;if(t>0)s>o&&(s=o,u=S[1]*I),s>T&&(s=T,u=+a.height);else if(S[0]>s)return O.set(S),E.set([0,0]);let{x:l,y:p,width:f,height:d}=v.getBoundingClientRect();const m=n?n.clientX-l-f/2:0,b=n?n.clientY-p-d/2:0;l=s/f*-m+m,p=u/d*-b+b;const h=[s,u];O.set(h).then((()=>{e(1,P=Math.round(Math.max(P,s)))})),E.set(R([r[0]+l,r[1]+p],h))}Object.defineProperty(a,"zoom",{configurable:1,get(){return o},set(t){return j(t?I:-I)}});const q=t=>N.delete(t.pointerId);return t.$$set=t=>{"k"in t&&e(22,l=t.k)},t.$$.update=()=>{if(8388609&t.$$.u[0]&&m.set(c[0]-10>S[0]),58720256&t.$$.u[0]&&i&&o&&!p.intro){const t=ft(480);E.set([0,0],t),O.set(S,t),e(5,z=1)}},[c,P,h,g,w,z,r,a,p,m,b,I,T,O,E,t=>{p.inline&&!o||(t.preventDefault(),j(t.deltaY/-300,t))},t=>{2!==t.button&&(t.preventDefault(),e(4,w=1),N.set(t.pointerId,t),$=t.clientX,k=t.clientY,_=r[0],M=r[1])},t=>{if(N.size>1)return e(4,w=0),p.noPinch?.(b.el)||(t=>{const[n,e]=N.set(t.pointerId,t).values(),o=Math.hypot(n.clientX-e.clientX,n.clientY-e.clientY);x=x||{clientX:(n.clientX+e.clientX)/2,clientY:(n.clientY+e.clientY)/2},j(((A||o)-o)/-35,x),A=o})(t);if(!w)return;let n=t.clientX,r=t.clientY;y=C.push({x:n,y:r})>2,n-=$,r-=k,o||(-90>r&&e(4,w=!p.noClose&&u.close()),30>Math.abs(r)&&(n>40&&e(4,w=f()),-40>n&&e(4,w=d()))),o&&y&&!i&&E.set(R([_+n,M+r]),{duration:0})},q,function(t){if(q(t),x&&(e(4,w=A=0),x=N.size?x:null),w){if(e(4,w=0),t.target===this&&!p.noClose)return u.close();if(y){const[t,n,e]=C.slice(-3);Math.hypot(n.x-e.x,n.y-e.y)>5&&E.set(R([r[0]-5*(t.x-e.x),r[1]-5*(t.y-e.y)]))}else p.onImageClick?.(b.el,a)||j(o?-I:I,t);y=0,C.length=0}},t=>{v=t,u.S((()=>{e(23,S=u.I(a)),!p.inline&&l||(O.set(S),E.set([0,0]))})),u.P(a).then((()=>{e(2,h=1),u.A()})),setTimeout((()=>{e(3,g=!h)}),250)},u,l,S,o,i,t=>p.onError?.(b,a,t)]}class kt extends ot{constructor(t){super(),et(this,t,$t,yt,c,{v:21,k:22},null,[-1,-1])}}function _t(t){let n,e,o,i,c,s;return o=new xt({v:{$:t[2],loaded:t[0]}}),{c(){n=g("div"),e=g("iframe"),Z(o.$$.t),w(e,"allow","autoplay; fullscreen"),w(e,"title",t[2].title),w(n,"class","bp-if"),y(n,"width",t[1][0]+"px"),y(n,"height",t[1][1]+"px")},m(r,l){b(r,n,l),m(n,e),tt(o,n,null),i=1,c||(s=[u(t[3].call(null,e)),v(e,"load",t[5])],c=1)},p(t,[e]){const r={};1&e&&(r.loaded=t[0]),o.$set(r),(!i||2&e)&&y(n,"width",t[1][0]+"px"),(!i||2&e)&&y(n,"height",t[1][1]+"px")},i(t){i||(G(o.$$.t,t),i=1)},o(t){H(o.$$.t,t),i=0},d(t){t&&h(n),nt(o),c=0,r(s)}}}function Mt(t,n,e){let o,r,{v:i}=n;const{$:c}=i,s=()=>e(1,r=i.I(c));return s(),i.S(s),[o,r,c,t=>t.src=c.iframe,i,()=>e(0,o=1)]}class zt extends ot{constructor(t){super(),et(this,t,Mt,_t,c,{v:4})}}function It(t){let n,e,o,r,i;return e=new xt({v:{$:t[2],loaded:t[0]}}),{c(){n=g("div"),Z(e.$$.t),w(n,"class","bp-vid"),y(n,"width",t[1][0]+"px"),y(n,"height",t[1][1]+"px"),y(n,"background-image",dt(t[2]))},m(c,s){b(c,n,s),tt(e,n,null),o=1,r||(i=u(t[3].call(null,n)),r=1)},p(t,[r]){const i={};1&r&&(i.loaded=t[0]),e.$set(i),(!o||2&r)&&y(n,"width",t[1][0]+"px"),(!o||2&r)&&y(n,"height",t[1][1]+"px")},i(t){o||(G(e.$$.t,t),o=1)},o(t){H(e.$$.t,t),o=0},d(t){t&&h(n),nt(e),r=0,i()}}}function St(t,n,e){let o,r,{v:i}=n;const{$:c,_:s,container:u}=i,l=()=>e(1,r=i.I(c));l(),i.S(l);const a=(t,n)=>{for(const e in n)w(t,e,n[e])};return[o,r,c,t=>{let n;const r=(t,e)=>{Array.isArray(e)||(e=JSON.parse(e));for(const o of e){n||(n=g(o.type?.includes("audio")?"audio":"video"),a(n,{controls:1,autoplay:1,playsinline:1,tabindex:"0"}));const e=g(t);a(e,o),"source"==t&&v(e,"error",(t=>s.onError?.(u,c,t))),m(n,e)}};r("source",c.sources),r("track",c.tracks||[]),v(n,"canplay",(()=>e(0,o=1))),m(t,n)},i]}class Pt extends ot{constructor(t){super(),et(this,t,St,It,c,{v:4})}}function At(n){let e,o,i,s,l,a,p,f,d,x,y=n[6].i,k=Rt(n),_=n[0].length>1&&jt(n);return{c(){e=g("div"),o=g("div"),k.c(),s=g("div"),l=g("button"),_&&_.c(),w(l,"class","bp-x"),w(l,"title","Close"),w(l,"aria-label","Close"),w(s,"class","bp-controls"),w(e,"class","bp-wrap"),$(e,"bp-zoomed",n[10]),$(e,"bp-inline",n[8]),$(e,"bp-small",n[7]),$(e,"bp-noclose",n[5].noClose)},m(t,r){b(t,e,r),m(e,o),k.m(e,null),m(e,s),m(s,l),_&&_.m(s,null),f=1,d||(x=[v(l,"click",n[1]),u(p=n[14].call(null,e))],d=1)},p(n,o){64&o[0]&&c(y,y=n[6].i)?(X(),H(k,1,1,t),Y(),k=Rt(n),k.c(),G(k),k.m(e,s)):k.p(n,o),n[0].length>1?_?_.p(n,o):(_=jt(n),_.c(),_.m(s,null)):_&&(_.d(1),_=null),1024&o[0]&&$(e,"bp-zoomed",n[10]),256&o[0]&&$(e,"bp-inline",n[8]),128&o[0]&&$(e,"bp-small",n[7]),32&o[0]&&$(e,"bp-noclose",n[5].noClose)},i(t){f||(i&&i.end(1),G(k),a&&a.end(1),f=1)},o(t){t&&(i=V(o,it,{duration:480})),H(k),t&&(a=V(s,it,{})),f=0},d(t){t&&h(e),t&&i&&i.end(),k.d(t),_&&_.d(),t&&a&&a.end(),d=0,r(x)}}}function Tt(n){let e,o=(n[6].html??n[6].element.outerHTML)+"";return{c(){e=g("div"),w(e,"class","bp-html")},m(t,n){b(t,e,n),e.innerHTML=o},p(t,n){64&n[0]&&o!==(o=(t[6].html??t[6].element.outerHTML)+"")&&(e.innerHTML=o)},i:t,o:t,d(t){t&&h(e)}}}function Ct(n){let e,o;return e=new zt({v:{v:n[13]()}}),{c(){Z(e.$$.t)},m(t,n){tt(e,t,n),o=1},p:t,i(t){o||(G(e.$$.t,t),o=1)},o(t){H(e.$$.t,t),o=0},d(t){nt(e,t)}}}function Nt(n){let e,o;return e=new Pt({v:{v:n[13]()}}),{c(){Z(e.$$.t)},m(t,n){tt(e,t,n),o=1},p:t,i(t){o||(G(e.$$.t,t),o=1)},o(t){H(e.$$.t,t),o=0},d(t){nt(e,t)}}}function Ot(t){let n,e;return n=new kt({v:{v:t[13](),k:t[7]}}),{c(){Z(n.$$.t)},m(t,o){tt(n,t,o),e=1},p(t,e){const o={};128&e[0]&&(o.k=t[7]),n.$set(o)},i(t){e||(G(n.$$.t,t),e=1)},o(t){H(n.$$.t,t),e=0},d(t){nt(n,t)}}}function Et(t){let n,e,o,r=t[6].caption+"";return{c(){n=g("div"),w(n,"class","bp-cap")},m(t,e){b(t,n,e),n.innerHTML=r,o=1},p(t,e){(!o||64&e[0])&&r!==(r=t[6].caption+"")&&(n.innerHTML=r)},i(t){o||(e&&e.end(1),o=1)},o(t){e=V(n,it,{duration:200}),o=0},d(t){t&&h(n),t&&e&&e.end()}}}function Rt(t){let n,e,o,i,c,s,u,l,a;const p=[Ot,Nt,Ct,Tt],f=[];function d(t,n){return t[6].img?0:t[6].sources?1:t[6].iframe?2:3}e=d(t),o=f[e]=p[e](t);let m=t[6].caption&&Et(t);return{c(){n=g("div"),o.c(),m&&m.c(),s=x(),w(n,"class","bp-inner")},m(o,r){b(o,n,r),f[e].m(n,null),m&&m.m(o,r),b(o,s,r),u=1,l||(a=[v(n,"pointerdown",t[20]),v(n,"pointerup",t[21])],l=1)},p(t,r){let i=e;e=d(t),e===i?f[e].p(t,r):(X(),H(f[i],1,1,(()=>{f[i]=null})),Y(),o=f[e],o?o.p(t,r):(o=f[e]=p[e](t),o.c()),G(o,1),o.m(n,null)),t[6].caption?m?(m.p(t,r),64&r[0]&&G(m,1)):(m=Et(t),m.c(),G(m,1),m.m(s.parentNode,s)):m&&(X(),H(m,1,1,(()=>{m=null})),Y())},i(e){u||(G(o),R((()=>{c&&c.end(1),i=U(n,t[12],1),i.start()})),G(m),u=1)},o(e){H(o),i&&i.invalidate(),c=V(n,t[12],0),H(m),u=0},d(t){t&&h(n),f[e].d(),t&&c&&c.end(),m&&m.d(t),t&&h(s),l=0,r(a)}}}function jt(t){let n,e,o,i,c,s=`${t[4]+1} / ${t[0].length}`;return{c(){n=g("div"),e=g("button"),o=g("button"),w(n,"class","bp-count"),w(e,"class","bp-prev"),w(e,"title","Previous"),w(e,"aria-label","Previous"),w(o,"class","bp-next"),w(o,"title","Next"),w(o,"aria-label","Next")},m(r,u){b(r,n,u),n.innerHTML=s,b(r,e,u),b(r,o,u),i||(c=[v(e,"click",t[2]),v(o,"click",t[3])],i=1)},p(t,e){17&e[0]&&s!==(s=`${t[4]+1} / ${t[0].length}`)&&(n.innerHTML=s)},d(t){t&&h(n),t&&h(e),t&&h(o),i=0,r(c)}}}function qt(t){let n,e,o=t[0]&&At(t);return{c(){o&&o.c(),n=x()},m(t,r){o&&o.m(t,r),b(t,n,r),e=1},p(t,e){t[0]?o?(o.p(t,e),1&e[0]&&G(o,1)):(o=At(t),o.c(),G(o,1),o.m(n.parentNode,n)):o&&(X(),H(o,1,1,(()=>{o=null})),Y())},i(t){e||(G(o),e=1)},o(t){H(o),e=0},d(t){o&&o.d(t),t&&h(n)}}}function Ft(t,n,e){let o,{items:r}=n,{target:i}=n;const c=document.documentElement;let u,l,a,p,f,d,m,b,h;const x=()=>!h.img&&!h.sources&&!h.iframe;let w;const y=t=>w=t,$={},k=st(0);s(t,k,(t=>e(10,o=t)));const _=()=>{l.onClose?.($.el,h),at.set(1),e(0,r=null),p?.focus({preventScroll:1})},M=()=>I(u-1),z=()=>I(u+1),I=t=>{m=t-u,e(4,u=S(t))},S=t=>(t+r.length)%r.length,P=t=>{const{key:n,shiftKey:e}=t;if("Escape"===n)!l.noClose&&_();else if("ArrowRight"===n)z();else if("ArrowLeft"===n)M();else if("Tab"===n){const{activeElement:n}=document;if(e||!n.controls){t.preventDefault();const{focusWrap:o=$.el}=l,r=[...o.querySelectorAll("*")].filter((t=>t.tabIndex>=0));let i=r.indexOf(n);i+=r.length+(e?-1:1),r[i%r.length].focus()}}},A=({width:t=1920,height:n=1080})=>{const{scale:e=.99}=l,o=Math.min(1,$.w/t*e,$.h/n*e);return[Math.round(t*o),Math.round(n*o)]},T=()=>{if(r){const t=r[S(u+1)],n=r[S(u-1)];!t.preload&&C(t),!n.preload&&C(n)}},C=t=>{if(t.img){const n=g("img");return n.sizes=l.sizes||A(t)[0]+"px",n.srcset=t.img,t.preload=1,n.decode().catch((t=>{}))}};return t.$$set=t=>{"items"in t&&e(0,r=t.items),"target"in t&&e(15,i=t.target)},t.$$.update=()=>{786545&t.$$.u[0]&&r&&(e(6,h=r[u]),a&&l.onUpdate?.($.el,h))},[r,_,M,z,u,l,h,f,d,b,o,k,(t,n)=>a&&r?it(t,{x:(m>0?20:-20)*(n?1:-1),duration:250}):(e(18,a=n),l.intro?it(t,{y:n?10:-10}):(t=>{let n;if(x()){const e=t.firstChild.firstChild;n=[e.clientWidth,e.clientHeight]}else n=A(h);const e=(h.element||p).getBoundingClientRect(),o=e.left-($.w-e.width)/2,r=e.top-($.h-e.height)/2,i=e.width/n[0],c=e.height/n[1];return{duration:480,l:rt,css:(t,n)=>`transform:translate3d(${o*n}px, ${r*n}px, 0) scale3d(${i+t*(1-i)}, ${c+t*(1-c)}, 1)`}})(t)),()=>({$:h,I:A,P:C,A:T,_:l,M,next:z,close:_,S:y,zoomed:k,container:$}),t=>{let n,o;e(19,$.el=t,$),l.onOpen?.($.el,h),d||(n=v(globalThis,"keydown",P));const r=new ResizeObserver((t=>{o&&(e(19,$.w=t[0].contentRect.width,$),e(19,$.h=t[0].contentRect.height,$),e(7,f=769>$.w),x()||w?.(),l.onResize?.($.el,h)),o=1}));return r.observe(t),{destroy(){r.disconnect(),n?.(),at.set(0),c.classList.remove("bp-lock"),l.onClosed?.()}}},i,t=>{e(5,l=t),e(8,d=l.inline);const n=l.items;!d&&c.scrollHeight>c.clientHeight&&c.classList.add("bp-lock"),p=document.activeElement,e(19,$.w=i.offsetWidth,$),e(19,$.h=i===document.body?globalThis.innerHeight:i.clientHeight,$),e(7,f=769>$.w),e(4,u=l.position||0),e(0,r=Array.isArray(n)?n.map(((t,n)=>(l.el&&l.el===t.element&&e(4,u=n),{i:n,...t}))):(n.length?[...n]:[n]).map(((t,n)=>(l.el===t&&e(4,u=n),{element:t,i:n,...t.dataset}))))},I,a,$,t=>e(9,b=t.target),function(t){2!==t.button&&t.target===this&&b===this&&!l.noClose&&_()}]}class Bt extends ot{constructor(t){super(),et(this,t,Ft,qt,c,{items:0,target:15,open:16,close:1,M:2,next:3,setPosition:17},null,[-1,-1])}get items(){return this.$$.ctx[0]}get target(){return this.$$.ctx[15]}get open(){return this.$$.ctx[16]}get close(){return this.$$.ctx[1]}get M(){return this.$$.ctx[2]}get next(){return this.$$.ctx[3]}get setPosition(){return this.$$.ctx[17]}}return t=>new Bt({...t,v:t})}();
diff --git a/dist/bigger-picture.min.mjs b/dist/bigger-picture.min.mjs
index e39c44e..017865b 100644
--- a/dist/bigger-picture.min.mjs
+++ b/dist/bigger-picture.min.mjs
@@ -1 +1 @@
-function t(){}const n=t=>t;function e(t,n){for(const e in n)t[e]=n[e];return t}function o(t){return t()}function r(t){t.forEach(o)}function i(t){return"function"==typeof t}function s(t,n){return t!=t?n==n:t!==n}function c(n,e,o){n.$$.on_destroy.push(((n,...e)=>{if(null==n)return t;const o=n.subscribe(...e);return o.unsubscribe?()=>o.unsubscribe():o})(e,o))}function u(n){return n&&i(n.destroy)?n.destroy:t}let l=()=>globalThis.performance.now(),a=t=>requestAnimationFrame(t);const p=new Set;function f(t){p.forEach((n=>{n.c(t)||(p.delete(n),n.f())})),0!==p.size&&a(f)}function d(t){let n;return 0===p.size&&a(f),{promise:new Promise((e=>{p.add(n={c:t,f:e})})),abort(){p.delete(n)}}}function m(t,n){t.appendChild(n)}function h(t,n,e){t.insertBefore(n,e||null)}function b(t){t.parentNode.removeChild(t)}function g(t){return document.createElement(t)}function x(){return document.createTextNode("")}function y(t,n,e,o){return t.addEventListener(n,e,o),()=>t.removeEventListener(n,e,o)}function w(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function v(t,n,e,o){null===e?t.style.removeProperty(n):t.style.setProperty(n,e)}function $(t,n,e){t.classList[e?"add":"remove"](n)}let k,_,M=0,z={};function S(t,n,e,o,r,i,s,c=0){const u=16.666/o;let l="{\n";for(let t=0;1>=t;t+=u){const o=n+(e-n)*i(t);l+=100*t+`%{${s(o,1-o)}}\n`}const a=l+`100% {${s(e,1-e)}}\n}`,p=`_bp_${Math.round(1e9*Math.random())}_${c}`;if(!z[p]){if(!k){const t=g("style");document.head.appendChild(t),k=t.sheet}z[p]=1,k.insertRule(`@keyframes ${p} ${a}`,k.cssRules.length)}const f=t.style.animation||"";return t.style.animation=`${f?f+", ":""}${p} ${o}ms linear ${r}ms 1 both`,M+=1,p}function P(t,n){t.style.animation=(t.style.animation||"").split(", ").filter(n?t=>0>t.indexOf(n):t=>-1===t.indexOf("_bp")).join(", "),n&&!--M&&a((()=>{if(M)return;let t=k.cssRules.length;for(;t--;)k.deleteRule(t);z={}}))}function A(t){_=t}const T=[],I=[],C=[],N=[],O=Promise.resolve();let E=0;function R(t){C.push(t)}const j=new Set;let q,F=0;function D(){const t=_;do{for(;T.length>F;){const t=T[F];F++,A(t),J(t.$$)}for(A(null),T.length=0,F=0;I.length;)I.pop()();for(let t=0;C.length>t;t+=1){const n=C[t];j.has(n)||(j.add(n),n())}C.length=0}while(T.length);for(;N.length;)N.pop()();E=0,j.clear(),A(t)}function J(t){if(null!==t.t){t.update(),r(t.before_update);const n=t.u;t.u=[-1],t.t&&t.t.p(t.ctx,n),t.after_update.forEach(R)}}function K(){return q||(q=Promise.resolve(),q.then((()=>{q=null}))),q}function L(t,n,e){t.dispatchEvent(((t,n,e=0)=>{const o=document.createEvent("CustomEvent");return o.initCustomEvent(t,e,0,n),o})(`${n?"intro":"outro"}${e}`))}const W=new Set;let X;function Y(){X={r:0,c:[],p:X}}function B(){X.r||r(X.c),X=X.p}function G(t,n){t&&t.i&&(W.delete(t),t.i(n))}function H(t,n,e,o){if(t&&t.o){if(W.has(t))return;W.add(t),X.c.push((()=>{W.delete(t),o&&(e&&t.d(1),o())})),t.o(n)}}const Q={duration:0};function U(e,o,r){let s,c,u=o(e,r),a=0,p=0;function f(){s&&P(e,s)}function m(){const{delay:o=0,duration:r=300,l:i=n,g:m=t,css:h}=u||Q;h&&(s=S(e,0,1,r,o,i,h,p++)),m(0,1);const b=l()+o,g=b+r;c&&c.abort(),a=1,R((()=>L(e,1,"start"))),c=d((t=>{if(a){if(t>=g)return m(1,0),L(e,1,"end"),f(),a=0;if(t>=b){const n=i((t-b)/r);m(n,1-n)}}return a}))}let h=0;return{start(){h||(h=1,P(e),i(u)?(u=u(),K().then(m)):m())},invalidate(){h=0},end(){a&&(f(),a=0)}}}function V(e,o,s){let c,u=o(e,s),a=1;const p=X;function f(){const{delay:o=0,duration:i=300,l:s=n,g:f=t,css:m}=u||Q;m&&(c=S(e,1,0,i,o,s,m));const h=l()+o,b=h+i;R((()=>L(e,0,"start"))),d((t=>{if(a){if(t>=b)return f(0,1),L(e,0,"end"),--p.r||r(p.c),0;if(t>=h){const n=s((t-h)/i);f(1-n,n)}}return a}))}return p.r+=1,i(u)?K().then((()=>{u=u(),f()})):f(),{end(t){t&&u.g&&u.g(1,0),a&&(c&&P(e,c),a=0)}}}function Z(t){t&&t.c()}function tt(t,n,e,s){const{t:c,on_mount:u,on_destroy:l,after_update:a}=t.$$;c&&c.m(n,e),s||R((()=>{const n=u.map(o).filter(i);l?l.push(...n):r(n),t.$$.on_mount=[]})),a.forEach(R)}function nt(t,n){const e=t.$$;null!==e.t&&(r(e.on_destroy),e.t&&e.t.d(n),e.on_destroy=e.t=null,e.ctx=[])}function et(n,e,o,i,s,c,u,l=[-1]){const a=_;A(n);const p=n.$$={t:null,ctx:null,v:c,update:t,not_equal:s,bound:{},on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:{},u:l,skip_bound:0,root:e.target||a.$$.root};u&&u(p.root);let f=0;p.ctx=o?o(n,e.v||{},((t,e,...o)=>{const r=o.length?o[0]:e;return p.ctx&&s(p.ctx[t],p.ctx[t]=r)&&(!p.skip_bound&&p.bound[t]&&p.bound[t](r),f&&((t,n)=>{-1===t.$$.u[0]&&(T.push(t),E||(E=1,O.then(D)),t.$$.u.fill(0)),t.$$.u[n/31|0]|=1<{const t=e.indexOf(n);-1!==t&&e.splice(t,1)}}$set(t){this.$$set&&0!==Object.keys(t).length&&(this.$$.skip_bound=1,this.$$set(t),this.$$.skip_bound=0)}}function rt(t){const n=t-1;return n*n*n+1}function it(t,{delay:n=0,duration:e=400,l:o=rt,x:r=0,y:i=0,opacity:s=0}={}){const c=getComputedStyle(t),u=+c.opacity,l="none"===c.transform?"":c.transform,a=u*(1-s);return{delay:n,duration:e,l:o,css(t,n){return`\n\t\t\ttransform: ${l} translate(${(1-t)*r}px, ${(1-t)*i}px);\n\t\t\topacity: ${u-a*n}`}}}const st=[];function ct(n,e=t){let o;const r=new Set;function i(t){if(s(n,t)&&(n=t,o)){const t=!st.length;for(const t of r)t[1](),st.push(t,n);if(t){for(let t=0;st.length>t;t+=2)st[t][0](st[t+1]);st.length=0}}}return{set:i,update(t){i(t(n))},subscribe(s,c=t){const u=[s,c];return r.add(u),1===r.size&&(o=e(i)||t),s(n),()=>{r.delete(u),0===r.size&&(o(),o=null)}}}}function ut(t,n){if(t===n||t!=t)return()=>t;const e=typeof t;if(Array.isArray(t)){const e=n.map(((n,e)=>ut(t[e],n)));return t=>e.map((n=>n(t)))}if("number"===e){const e=n-t;return n=>t+n*e}}function lt(t,o={}){const r=ct(t);let i,s=t;function c(c,u){if(null==t)return r.set(t=c),Promise.resolve();s=c;let a=i,p=0,{delay:f=0,duration:m=400,l:h=n,interpolate:b=ut}=e(e({},o),u);if(0===m)return a&&(a.abort(),a=null),r.set(t=s),Promise.resolve();const g=l()+f;let x;return i=d((n=>{if(g>n)return 1;p||(x=b(t,c),"function"==typeof m&&(m=m(t,c)),p=1),a&&(a.abort(),a=null);const e=n-g;return e>m?(r.set(t=c),0):(r.set(t=x(h(e/m))),1)})),i.promise}return{set:c,update(n,e){return c(n(s,t),e)},subscribe:r.subscribe}}const at=ct(0),pt=globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches,ft=t=>({l:rt,duration:pt?0:t});function dt(n){let e,o,r,i,s;return{c(){e=g("div"),o=g("span"),r=g("span"),w(o,"class","bp-bar"),w(r,"class","bp-o"),w(e,"class","bp-load"),w(e,"style",n[2])},m(t,n){h(t,e,n),m(e,o),m(e,r),s=1},p:t,i(t){s||(i&&i.end(1),s=1)},o(t){t&&(i=V(e,it,{duration:480})),s=0},d(t){t&&b(e),t&&i&&i.end()}}}function mt(n){let e,o;return{c(){e=g("div"),w(e,"class","bp-load"),w(e,"style",n[2])},m(t,n){h(t,e,n)},p:t,i(t){o||R((()=>{o=U(e,it,{duration:480}),o.start()}))},o:t,d(t){t&&b(e)}}}function ht(t){let n,e,o=!t[0]&&dt(t),r=t[1]&&mt(t);return{c(){o&&o.c(),n=x(),r&&r.c(),e=x()},m(t,i){o&&o.m(t,i),h(t,n,i),r&&r.m(t,i),h(t,e,i)},p(t,[i]){t[0]?o&&(Y(),H(o,1,1,(()=>{o=null})),B()):o?(o.p(t,i),1&i&&G(o,1)):(o=dt(t),o.c(),G(o,1),o.m(n.parentNode,n)),t[1]?r?(r.p(t,i),2&i&&G(r,1)):(r=mt(t),r.c(),G(r,1),r.m(e.parentNode,e)):r&&(r.d(1),r=null)},i(t){G(o),G(r)},o(t){H(o)},d(t){o&&o.d(t),t&&b(n),r&&r.d(t),t&&b(e)}}}function bt(t,n,e){let o;c(t,at,(t=>e(1,o=t)));let{thumb:r}=n,{loaded:i}=n;const s=`background-image:url(${r})`;return t.$$set=t=>{"thumb"in t&&e(3,r=t.thumb),"loaded"in t&&e(0,i=t.loaded)},[i,o,s,r]}class gt extends ot{constructor(t){super(),et(this,t,bt,ht,s,{thumb:3,loaded:0})}}function xt(t){let n,e,o,r,i,s,c,u;return{c(){n=g("img"),w(n,"srcset",e=t[7].img),w(n,"sizes",o=t[8].sizes||t[1]+"px"),w(n,"alt",r=t[7].alt)},m(e,o){h(e,n,o),s=1,c||(u=y(n,"error",t[26]),c=1)},p(t,e){(!s||2&e[0]&&o!==(o=t[8].sizes||t[1]+"px"))&&w(n,"sizes",o)},i(t){s||(i&&i.end(1),s=1)},o(t){i=V(n,it,{}),s=0},d(t){t&&b(n),t&&i&&i.end(),c=0,u()}}}function yt(t){let n,e;return n=new gt({v:{thumb:t[7].thumb,loaded:t[2]}}),{c(){Z(n.$$.t)},m(t,o){tt(n,t,o),e=1},p(t,e){const o={};4&e[0]&&(o.loaded=t[2]),n.$set(o)},i(t){e||(G(n.$$.t,t),e=1)},o(t){H(n.$$.t,t),e=0},d(t){nt(n,t)}}}function wt(t){let n,e,o,i,s,c,l=t[2]&&xt(t),a=t[3]&&yt(t);return{c(){n=g("div"),e=g("div"),l&&l.c(),o=x(),a&&a.c(),w(e,"class","bp-img"),v(e,"background-image","url("+t[7].thumb+")"),v(e,"width",t[0][0]+"px"),v(e,"height",t[0][1]+"px"),v(e,"transform","translate3d("+(t[0][0]/-2+t[6][0])+"px, "+(t[0][1]/-2+t[6][1])+"px, 0)"),$(e,"bp-drag",t[4]),$(e,"bp-canzoom",t[11]>1&&t[12]>t[0][0]),w(n,"class","bp-img-wrap"),$(n,"bp-close",t[5])},m(r,p){h(r,n,p),m(n,e),l&&l.m(e,null),m(e,o),a&&a.m(e,null),i=1,s||(c=[u(t[20].call(null,e)),y(n,"wheel",t[15]),y(n,"pointerdown",t[16]),y(n,"pointermove",t[17]),y(n,"pointerup",t[19]),y(n,"pointercancel",t[18])],s=1)},p(t,r){t[2]?l?(l.p(t,r),4&r[0]&&G(l,1)):(l=xt(t),l.c(),G(l,1),l.m(e,o)):l&&(Y(),H(l,1,1,(()=>{l=null})),B()),t[3]?a?(a.p(t,r),8&r[0]&&G(a,1)):(a=yt(t),a.c(),G(a,1),a.m(e,null)):a&&(Y(),H(a,1,1,(()=>{a=null})),B()),(!i||1&r[0])&&v(e,"width",t[0][0]+"px"),(!i||1&r[0])&&v(e,"height",t[0][1]+"px"),(!i||65&r[0])&&v(e,"transform","translate3d("+(t[0][0]/-2+t[6][0])+"px, "+(t[0][1]/-2+t[6][1])+"px, 0)"),16&r[0]&&$(e,"bp-drag",t[4]),6145&r[0]&&$(e,"bp-canzoom",t[11]>1&&t[12]>t[0][0]),32&r[0]&&$(n,"bp-close",t[5])},i(t){i||(G(l),G(a),i=1)},o(t){H(l),H(a),i=0},d(t){t&&b(n),l&&l.d(),a&&a.d(),s=0,r(c)}}}function vt(t,n,e){let o,r,i,s;c(t,at,(t=>e(25,i=t)));let{v:u}=n,{$:l}=n,{k:a,_:p,M:f,next:d,zoomed:m,container:h}=u;c(t,m,(t=>e(24,o=t)));let b,g,x,y,w,v,$,k,_,M,z,S=a.maxZoom||p.maxZoom||10,P=u.S(a),A=P[0],T=0;const I=+a.width,C=[],N=new Map,O=lt(P,ft(400));c(t,O,(t=>e(0,s=t)));const E=lt([0,0],ft(400));c(t,E,(t=>e(6,r=t)));const R=([t,n],o=s)=>{const r=(o[0]-h.w)/2,i=(o[1]-h.h)/2;return 0>r?t=0:t>r?l?(t=w?r+(t-r)/10:r)>r+20&&e(4,w=f()):t=r:-r>t&&(l?-r-20>(t=w?-r-(-r-t)/10:-r)&&e(4,w=d()):t=-r),0>i?n=0:n>i?n=i:-i>n&&(n=-i),[t,n]};function j(t=S,n){if(i)return;const o=P[0]*S;let c=s[0]+s[0]*t,u=s[1]+s[1]*t;if(t>0)c>o&&(c=o,u=P[1]*S),c>I&&(c=I,u=+a.height);else if(P[0]>c)return O.set(P),E.set([0,0]);let{x:l,y:p,width:f,height:d}=y.getBoundingClientRect();const m=n?n.clientX-l-f/2:0,h=n?n.clientY-p-d/2:0;l=c/f*-m+m,p=u/d*-h+h;const b=[c,u];O.set(b).then((()=>{e(1,A=Math.round(Math.max(A,c)))})),E.set(R([r[0]+l,r[1]+p],b))}Object.defineProperty(a,"zoom",{configurable:1,get(){return o},set(t){return j(t?S:-S)}});const q=t=>N.delete(t.pointerId);return t.$$set=t=>{"$"in t&&e(22,l=t.$)},t.$$.update=()=>{if(8388609&t.$$.u[0]&&m.set(s[0]-10>P[0]),58720256&t.$$.u[0]&&i&&o&&!p.intro){const t=ft(480);E.set([0,0],t),O.set(P,t),e(5,z=1)}},[s,A,b,g,w,z,r,a,p,m,h,S,I,O,E,t=>{p.inline&&!o||(t.preventDefault(),j(t.deltaY/-300,t))},t=>{2!==t.button&&(t.preventDefault(),e(4,w=1),N.set(t.pointerId,t),$=t.clientX,k=t.clientY,_=r[0],M=r[1])},t=>{if(N.size>1)return e(4,w=0),p.noPinch?.(h.el)||(t=>{const[n,e]=N.set(t.pointerId,t).values(),o=Math.hypot(n.clientX-e.clientX,n.clientY-e.clientY);x=x||{clientX:(n.clientX+e.clientX)/2,clientY:(n.clientY+e.clientY)/2},j(((T||o)-o)/-35,x),T=o})(t);if(!w)return;let n=t.clientX,r=t.clientY;v=C.push({x:n,y:r})>2,n-=$,r-=k,o||(-90>r&&e(4,w=!p.noClose&&u.close()),30>Math.abs(r)&&(n>40&&e(4,w=f()),-40>n&&e(4,w=d()))),o&&v&&!i&&E.set(R([_+n,M+r]),{duration:0})},q,function(t){if(q(t),x&&(e(4,w=T=0),x=N.size?x:null),w){if(e(4,w=0),t.target===this&&!p.noClose)return u.close();if(v){const[t,n,e]=C.slice(-3);Math.hypot(n.x-e.x,n.y-e.y)>5&&E.set(R([r[0]-5*(t.x-e.x),r[1]-5*(t.y-e.y)]))}else p.onImageClick?.(h.el,a)||j(o?-S:S,t);v=0,C.length=0}},t=>{y=t,u.P((()=>{e(23,P=u.S(a)),!p.inline&&l||(O.set(P),E.set([0,0]))})),u.A(a).then((()=>{e(2,b=1),u.T()})),setTimeout((()=>{e(3,g=!b)}),250)},u,l,P,o,i,t=>p.onError?.(h,a,t)]}class $t extends ot{constructor(t){super(),et(this,t,vt,wt,s,{v:21,$:22},null,[-1,-1])}}function kt(t){let n,e,o,i,s,c;return o=new gt({v:{thumb:t[2].thumb,loaded:t[0]}}),{c(){n=g("div"),e=g("iframe"),Z(o.$$.t),w(e,"allow","autoplay; fullscreen"),w(e,"title",t[2].title),w(n,"class","bp-if"),v(n,"width",t[1][0]+"px"),v(n,"height",t[1][1]+"px")},m(r,l){h(r,n,l),m(n,e),tt(o,n,null),i=1,s||(c=[u(t[3].call(null,e)),y(e,"load",t[5])],s=1)},p(t,[e]){const r={};1&e&&(r.loaded=t[0]),o.$set(r),(!i||2&e)&&v(n,"width",t[1][0]+"px"),(!i||2&e)&&v(n,"height",t[1][1]+"px")},i(t){i||(G(o.$$.t,t),i=1)},o(t){H(o.$$.t,t),i=0},d(t){t&&b(n),nt(o),s=0,r(c)}}}function _t(t,n,e){let o,r,{v:i}=n;const{k:s}=i,c=()=>e(1,r=i.S(s));return c(),i.P(c),[o,r,s,t=>t.src=s.iframe,i,()=>e(0,o=1)]}class Mt extends ot{constructor(t){super(),et(this,t,_t,kt,s,{v:4})}}function zt(t){let n,e,o,r,i;return e=new gt({v:{thumb:t[2].thumb,loaded:t[0]}}),{c(){n=g("div"),Z(e.$$.t),w(n,"class","bp-vid"),v(n,"width",t[1][0]+"px"),v(n,"height",t[1][1]+"px"),v(n,"background-image","url("+t[2].thumb+")")},m(s,c){h(s,n,c),tt(e,n,null),o=1,r||(i=u(t[3].call(null,n)),r=1)},p(t,[r]){const i={};1&r&&(i.loaded=t[0]),e.$set(i),(!o||2&r)&&v(n,"width",t[1][0]+"px"),(!o||2&r)&&v(n,"height",t[1][1]+"px")},i(t){o||(G(e.$$.t,t),o=1)},o(t){H(e.$$.t,t),o=0},d(t){t&&b(n),nt(e),r=0,i()}}}function St(t,n,e){let o,r,{v:i}=n;const{k:s,_:c,container:u}=i,l=()=>e(1,r=i.S(s));l(),i.P(l);const a=(t,n)=>{for(const e in n)w(t,e,n[e])};return[o,r,s,t=>{let n;const r=(t,e)=>{Array.isArray(e)||(e=JSON.parse(e));for(const o of e){n||(n=g(o.type?.includes("audio")?"audio":"video"),a(n,{controls:1,autoplay:1,playsinline:1,tabindex:"0"}));const e=g(t);a(e,o),"source"==t&&y(e,"error",(t=>c.onError?.(u,s,t))),m(n,e)}};r("source",s.sources),r("track",s.tracks||[]),y(n,"canplay",(()=>e(0,o=1))),m(t,n)},i]}class Pt extends ot{constructor(t){super(),et(this,t,St,zt,s,{v:4})}}function At(n){let e,o,i,c,l,a,p,f,d,x,v=n[6].i,k=Et(n),_=n[0].length>1&&Rt(n);return{c(){e=g("div"),o=g("div"),k.c(),c=g("div"),l=g("button"),_&&_.c(),w(l,"class","bp-x"),w(l,"title","Close"),w(l,"aria-label","Close"),w(c,"class","bp-controls"),w(e,"class","bp-wrap"),$(e,"bp-zoomed",n[10]),$(e,"bp-inline",n[8]),$(e,"bp-small",n[7]),$(e,"bp-noclose",n[5].noClose)},m(t,r){h(t,e,r),m(e,o),k.m(e,null),m(e,c),m(c,l),_&&_.m(c,null),f=1,d||(x=[y(l,"click",n[1]),u(p=n[14].call(null,e))],d=1)},p(n,o){64&o[0]&&s(v,v=n[6].i)?(Y(),H(k,1,1,t),B(),k=Et(n),k.c(),G(k),k.m(e,c)):k.p(n,o),n[0].length>1?_?_.p(n,o):(_=Rt(n),_.c(),_.m(c,null)):_&&(_.d(1),_=null),1024&o[0]&&$(e,"bp-zoomed",n[10]),256&o[0]&&$(e,"bp-inline",n[8]),128&o[0]&&$(e,"bp-small",n[7]),32&o[0]&&$(e,"bp-noclose",n[5].noClose)},i(t){f||(i&&i.end(1),G(k),a&&a.end(1),f=1)},o(t){t&&(i=V(o,it,{duration:480})),H(k),t&&(a=V(c,it,{})),f=0},d(t){t&&b(e),t&&i&&i.end(),k.d(t),_&&_.d(),t&&a&&a.end(),d=0,r(x)}}}function Tt(n){let e,o=(n[6].html??n[6].element.outerHTML)+"";return{c(){e=g("div"),w(e,"class","bp-html")},m(t,n){h(t,e,n),e.innerHTML=o},p(t,n){64&n[0]&&o!==(o=(t[6].html??t[6].element.outerHTML)+"")&&(e.innerHTML=o)},i:t,o:t,d(t){t&&b(e)}}}function It(n){let e,o;return e=new Mt({v:{v:n[13]()}}),{c(){Z(e.$$.t)},m(t,n){tt(e,t,n),o=1},p:t,i(t){o||(G(e.$$.t,t),o=1)},o(t){H(e.$$.t,t),o=0},d(t){nt(e,t)}}}function Ct(n){let e,o;return e=new Pt({v:{v:n[13]()}}),{c(){Z(e.$$.t)},m(t,n){tt(e,t,n),o=1},p:t,i(t){o||(G(e.$$.t,t),o=1)},o(t){H(e.$$.t,t),o=0},d(t){nt(e,t)}}}function Nt(t){let n,e;return n=new $t({v:{v:t[13](),$:t[7]}}),{c(){Z(n.$$.t)},m(t,o){tt(n,t,o),e=1},p(t,e){const o={};128&e[0]&&(o.$=t[7]),n.$set(o)},i(t){e||(G(n.$$.t,t),e=1)},o(t){H(n.$$.t,t),e=0},d(t){nt(n,t)}}}function Ot(t){let n,e,o,r=t[6].caption+"";return{c(){n=g("div"),w(n,"class","bp-cap")},m(t,e){h(t,n,e),n.innerHTML=r,o=1},p(t,e){(!o||64&e[0])&&r!==(r=t[6].caption+"")&&(n.innerHTML=r)},i(t){o||(e&&e.end(1),o=1)},o(t){e=V(n,it,{duration:200}),o=0},d(t){t&&b(n),t&&e&&e.end()}}}function Et(t){let n,e,o,i,s,c,u,l,a;const p=[Nt,Ct,It,Tt],f=[];function d(t,n){return t[6].img?0:t[6].sources?1:t[6].iframe?2:3}e=d(t),o=f[e]=p[e](t);let m=t[6].caption&&Ot(t);return{c(){n=g("div"),o.c(),m&&m.c(),c=x(),w(n,"class","bp-inner")},m(o,r){h(o,n,r),f[e].m(n,null),m&&m.m(o,r),h(o,c,r),u=1,l||(a=[y(n,"pointerdown",t[20]),y(n,"pointerup",t[21])],l=1)},p(t,r){let i=e;e=d(t),e===i?f[e].p(t,r):(Y(),H(f[i],1,1,(()=>{f[i]=null})),B(),o=f[e],o?o.p(t,r):(o=f[e]=p[e](t),o.c()),G(o,1),o.m(n,null)),t[6].caption?m?(m.p(t,r),64&r[0]&&G(m,1)):(m=Ot(t),m.c(),G(m,1),m.m(c.parentNode,c)):m&&(Y(),H(m,1,1,(()=>{m=null})),B())},i(e){u||(G(o),R((()=>{s&&s.end(1),i=U(n,t[12],1),i.start()})),G(m),u=1)},o(e){H(o),i&&i.invalidate(),s=V(n,t[12],0),H(m),u=0},d(t){t&&b(n),f[e].d(),t&&s&&s.end(),m&&m.d(t),t&&b(c),l=0,r(a)}}}function Rt(t){let n,e,o,i,s,c=`${t[4]+1} / ${t[0].length}`;return{c(){n=g("div"),e=g("button"),o=g("button"),w(n,"class","bp-count"),w(e,"class","bp-prev"),w(e,"title","Previous"),w(e,"aria-label","Previous"),w(o,"class","bp-next"),w(o,"title","Next"),w(o,"aria-label","Next")},m(r,u){h(r,n,u),n.innerHTML=c,h(r,e,u),h(r,o,u),i||(s=[y(e,"click",t[2]),y(o,"click",t[3])],i=1)},p(t,e){17&e[0]&&c!==(c=`${t[4]+1} / ${t[0].length}`)&&(n.innerHTML=c)},d(t){t&&b(n),t&&b(e),t&&b(o),i=0,r(s)}}}function jt(t){let n,e,o=t[0]&&At(t);return{c(){o&&o.c(),n=x()},m(t,r){o&&o.m(t,r),h(t,n,r),e=1},p(t,e){t[0]?o?(o.p(t,e),1&e[0]&&G(o,1)):(o=At(t),o.c(),G(o,1),o.m(n.parentNode,n)):o&&(Y(),H(o,1,1,(()=>{o=null})),B())},i(t){e||(G(o),e=1)},o(t){H(o),e=0},d(t){o&&o.d(t),t&&b(n)}}}function qt(t,n,e){let o,{items:r}=n,{target:i}=n;const s=document.documentElement;let u,l,a,p,f,d,m,h,b;const x=()=>!b.img&&!b.sources&&!b.iframe;let w;const v=t=>w=t,$={},k=ct(0);c(t,k,(t=>e(10,o=t)));const _=()=>{l.onClose?.($.el,b),at.set(1),e(0,r=null),p?.focus({preventScroll:1})},M=()=>S(u-1),z=()=>S(u+1),S=t=>{m=t-u,e(4,u=P(t))},P=t=>(t+r.length)%r.length,A=t=>{const{key:n,shiftKey:e}=t;if("Escape"===n)!l.noClose&&_();else if("ArrowRight"===n)z();else if("ArrowLeft"===n)M();else if("Tab"===n){const{activeElement:n}=document;if(e||!n.controls){t.preventDefault();const{focusWrap:o=$.el}=l,r=[...o.querySelectorAll("*")].filter((t=>t.tabIndex>=0));let i=r.indexOf(n);i+=r.length+(e?-1:1),r[i%r.length].focus()}}},T=({width:t=1920,height:n=1080})=>{const{scale:e=.99}=l,o=Math.min(1,$.w/t*e,$.h/n*e);return[Math.round(t*o),Math.round(n*o)]},I=()=>{if(r){const t=r[P(u+1)],n=r[P(u-1)];!t.preload&&C(t),!n.preload&&C(n)}},C=t=>{if(t.img){const n=g("img");return n.sizes=l.sizes||T(t)[0]+"px",n.srcset=t.img,t.preload=1,n.decode().catch((t=>{}))}};return t.$$set=t=>{"items"in t&&e(0,r=t.items),"target"in t&&e(15,i=t.target)},t.$$.update=()=>{786545&t.$$.u[0]&&r&&(e(6,b=r[u]),a&&l.onUpdate?.($.el,b))},[r,_,M,z,u,l,b,f,d,h,o,k,(t,n)=>a&&r?it(t,{x:(m>0?20:-20)*(n?1:-1),duration:250}):(e(18,a=n),l.intro?it(t,{y:n?10:-10}):(t=>{let n;if(x()){const e=t.firstChild.firstChild;n=[e.clientWidth,e.clientHeight]}else n=T(b);const e=(b.element||p).getBoundingClientRect(),o=e.left-($.w-e.width)/2,r=e.top-($.h-e.height)/2,i=e.width/n[0],s=e.height/n[1];return{duration:480,l:rt,css:(t,n)=>`transform:translate3d(${o*n}px, ${r*n}px, 0) scale3d(${i+t*(1-i)}, ${s+t*(1-s)}, 1)`}})(t)),()=>({k:b,S:T,A:C,T:I,_:l,M,next:z,close:_,P:v,zoomed:k,container:$}),t=>{let n,o;e(19,$.el=t,$),l.onOpen?.($.el,b),d||(n=y(globalThis,"keydown",A));const r=new ResizeObserver((t=>{o&&(e(19,$.w=t[0].contentRect.width,$),e(19,$.h=t[0].contentRect.height,$),e(7,f=769>$.w),x()||w?.(),l.onResize?.($.el,b)),o=1}));return r.observe(t),{destroy(){r.disconnect(),n?.(),at.set(0),s.classList.remove("bp-lock"),l.onClosed?.()}}},i,t=>{e(5,l=t),e(8,d=l.inline);const n=l.items;!d&&s.scrollHeight>s.clientHeight&&s.classList.add("bp-lock"),p=document.activeElement,e(19,$.w=i.offsetWidth,$),e(19,$.h=i===document.body?globalThis.innerHeight:i.clientHeight,$),e(7,f=769>$.w),e(4,u=l.position||0),e(0,r=Array.isArray(n)?n.map(((t,n)=>(l.el&&l.el===t.element&&e(4,u=n),{i:n,...t}))):(n.length?[...n]:[n]).map(((t,n)=>(l.el===t&&e(4,u=n),{element:t,i:n,...t.dataset}))))},S,a,$,t=>e(9,h=t.target),function(t){2!==t.button&&t.target===this&&h===this&&!l.noClose&&_()}]}class Ft extends ot{constructor(t){super(),et(this,t,qt,jt,s,{items:0,target:15,open:16,close:1,M:2,next:3,setPosition:17},null,[-1,-1])}get items(){return this.$$.ctx[0]}get target(){return this.$$.ctx[15]}get open(){return this.$$.ctx[16]}get close(){return this.$$.ctx[1]}get M(){return this.$$.ctx[2]}get next(){return this.$$.ctx[3]}get setPosition(){return this.$$.ctx[17]}}function Dt(t){return new Ft({...t,v:t})}export{Dt as default};
+function t(){}const n=t=>t;function e(t,n){for(const e in n)t[e]=n[e];return t}function o(t){return t()}function r(t){t.forEach(o)}function i(t){return"function"==typeof t}function s(t,n){return t!=t?n==n:t!==n}function c(n,e,o){n.$$.on_destroy.push(((n,...e)=>{if(null==n)return t;const o=n.subscribe(...e);return o.unsubscribe?()=>o.unsubscribe():o})(e,o))}function u(n){return n&&i(n.destroy)?n.destroy:t}let l=()=>globalThis.performance.now(),a=t=>requestAnimationFrame(t);const p=new Set;function f(t){p.forEach((n=>{n.c(t)||(p.delete(n),n.f())})),0!==p.size&&a(f)}function d(t){let n;return 0===p.size&&a(f),{promise:new Promise((e=>{p.add(n={c:t,f:e})})),abort(){p.delete(n)}}}function m(t,n){t.appendChild(n)}function b(t,n,e){t.insertBefore(n,e||null)}function h(t){t.parentNode.removeChild(t)}function g(t){return document.createElement(t)}function x(){return document.createTextNode("")}function v(t,n,e,o){return t.addEventListener(n,e,o),()=>t.removeEventListener(n,e,o)}function w(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function y(t,n,e,o){null===e?t.style.removeProperty(n):t.style.setProperty(n,e)}function $(t,n,e){t.classList[e?"add":"remove"](n)}let k,_,M=0,z={};function I(t,n,e,o,r,i,s,c=0){const u=16.666/o;let l="{\n";for(let t=0;1>=t;t+=u){const o=n+(e-n)*i(t);l+=100*t+`%{${s(o,1-o)}}\n`}const a=l+`100% {${s(e,1-e)}}\n}`,p=`_bp_${Math.round(1e9*Math.random())}_${c}`;if(!z[p]){if(!k){const t=g("style");document.head.appendChild(t),k=t.sheet}z[p]=1,k.insertRule(`@keyframes ${p} ${a}`,k.cssRules.length)}const f=t.style.animation||"";return t.style.animation=`${f?f+", ":""}${p} ${o}ms linear ${r}ms 1 both`,M+=1,p}function S(t,n){t.style.animation=(t.style.animation||"").split(", ").filter(n?t=>0>t.indexOf(n):t=>-1===t.indexOf("_bp")).join(", "),n&&!--M&&a((()=>{if(M)return;let t=k.cssRules.length;for(;t--;)k.deleteRule(t);z={}}))}function P(t){_=t}const A=[],T=[],C=[],N=[],O=Promise.resolve();let E=0;function R(t){C.push(t)}const j=new Set;let q,F=0;function D(){const t=_;do{for(;A.length>F;){const t=A[F];F++,P(t),J(t.$$)}for(P(null),A.length=0,F=0;T.length;)T.pop()();for(let t=0;C.length>t;t+=1){const n=C[t];j.has(n)||(j.add(n),n())}C.length=0}while(A.length);for(;N.length;)N.pop()();E=0,j.clear(),P(t)}function J(t){if(null!==t.t){t.update(),r(t.before_update);const n=t.u;t.u=[-1],t.t&&t.t.p(t.ctx,n),t.after_update.forEach(R)}}function K(){return q||(q=Promise.resolve(),q.then((()=>{q=null}))),q}function L(t,n,e){t.dispatchEvent(((t,n,e=0)=>{const o=document.createEvent("CustomEvent");return o.initCustomEvent(t,e,0,n),o})(`${n?"intro":"outro"}${e}`))}const W=new Set;let X;function Y(){X={r:0,c:[],p:X}}function B(){X.r||r(X.c),X=X.p}function G(t,n){t&&t.i&&(W.delete(t),t.i(n))}function H(t,n,e,o){if(t&&t.o){if(W.has(t))return;W.add(t),X.c.push((()=>{W.delete(t),o&&(e&&t.d(1),o())})),t.o(n)}}const Q={duration:0};function U(e,o,r){let s,c,u=o(e,r),a=0,p=0;function f(){s&&S(e,s)}function m(){const{delay:o=0,duration:r=300,l:i=n,g:m=t,css:b}=u||Q;b&&(s=I(e,0,1,r,o,i,b,p++)),m(0,1);const h=l()+o,g=h+r;c&&c.abort(),a=1,R((()=>L(e,1,"start"))),c=d((t=>{if(a){if(t>=g)return m(1,0),L(e,1,"end"),f(),a=0;if(t>=h){const n=i((t-h)/r);m(n,1-n)}}return a}))}let b=0;return{start(){b||(b=1,S(e),i(u)?(u=u(),K().then(m)):m())},invalidate(){b=0},end(){a&&(f(),a=0)}}}function V(e,o,s){let c,u=o(e,s),a=1;const p=X;function f(){const{delay:o=0,duration:i=300,l:s=n,g:f=t,css:m}=u||Q;m&&(c=I(e,1,0,i,o,s,m));const b=l()+o,h=b+i;R((()=>L(e,0,"start"))),d((t=>{if(a){if(t>=h)return f(0,1),L(e,0,"end"),--p.r||r(p.c),0;if(t>=b){const n=s((t-b)/i);f(1-n,n)}}return a}))}return p.r+=1,i(u)?K().then((()=>{u=u(),f()})):f(),{end(t){t&&u.g&&u.g(1,0),a&&(c&&S(e,c),a=0)}}}function Z(t){t&&t.c()}function tt(t,n,e,s){const{t:c,on_mount:u,on_destroy:l,after_update:a}=t.$$;c&&c.m(n,e),s||R((()=>{const n=u.map(o).filter(i);l?l.push(...n):r(n),t.$$.on_mount=[]})),a.forEach(R)}function nt(t,n){const e=t.$$;null!==e.t&&(r(e.on_destroy),e.t&&e.t.d(n),e.on_destroy=e.t=null,e.ctx=[])}function et(n,e,o,i,s,c,u,l=[-1]){const a=_;P(n);const p=n.$$={t:null,ctx:null,v:c,update:t,not_equal:s,bound:{},on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:{},u:l,skip_bound:0,root:e.target||a.$$.root};u&&u(p.root);let f=0;p.ctx=o?o(n,e.v||{},((t,e,...o)=>{const r=o.length?o[0]:e;return p.ctx&&s(p.ctx[t],p.ctx[t]=r)&&(!p.skip_bound&&p.bound[t]&&p.bound[t](r),f&&((t,n)=>{-1===t.$$.u[0]&&(A.push(t),E||(E=1,O.then(D)),t.$$.u.fill(0)),t.$$.u[n/31|0]|=1<{const t=e.indexOf(n);-1!==t&&e.splice(t,1)}}$set(t){this.$$set&&0!==Object.keys(t).length&&(this.$$.skip_bound=1,this.$$set(t),this.$$.skip_bound=0)}}function rt(t){const n=t-1;return n*n*n+1}function it(t,{delay:n=0,duration:e=400,l:o=rt,x:r=0,y:i=0,opacity:s=0}={}){const c=getComputedStyle(t),u=+c.opacity,l="none"===c.transform?"":c.transform,a=u*(1-s);return{delay:n,duration:e,l:o,css(t,n){return`\n\t\t\ttransform: ${l} translate(${(1-t)*r}px, ${(1-t)*i}px);\n\t\t\topacity: ${u-a*n}`}}}const st=[];function ct(n,e=t){let o;const r=new Set;function i(t){if(s(n,t)&&(n=t,o)){const t=!st.length;for(const t of r)t[1](),st.push(t,n);if(t){for(let t=0;st.length>t;t+=2)st[t][0](st[t+1]);st.length=0}}}return{set:i,update(t){i(t(n))},subscribe(s,c=t){const u=[s,c];return r.add(u),1===r.size&&(o=e(i)||t),s(n),()=>{r.delete(u),0===r.size&&(o(),o=null)}}}}function ut(t,n){if(t===n||t!=t)return()=>t;const e=typeof t;if(Array.isArray(t)){const e=n.map(((n,e)=>ut(t[e],n)));return t=>e.map((n=>n(t)))}if("number"===e){const e=n-t;return n=>t+n*e}}function lt(t,o={}){const r=ct(t);let i,s=t;function c(c,u){if(null==t)return r.set(t=c),Promise.resolve();s=c;let a=i,p=0,{delay:f=0,duration:m=400,l:b=n,interpolate:h=ut}=e(e({},o),u);if(0===m)return a&&(a.abort(),a=null),r.set(t=s),Promise.resolve();const g=l()+f;let x;return i=d((n=>{if(g>n)return 1;p||(x=h(t,c),"function"==typeof m&&(m=m(t,c)),p=1),a&&(a.abort(),a=null);const e=n-g;return e>m?(r.set(t=c),0):(r.set(t=x(b(e/m))),1)})),i.promise}return{set:c,update(n,e){return c(n(s,t),e)},subscribe:r.subscribe}}const at=ct(0),pt=globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches,ft=t=>({l:rt,duration:pt?0:t}),dt=t=>!t.thumb||`url(${t.thumb})`;function mt(t){let n,e,o;return{c(){n=g("div"),n.innerHTML='',w(n,"class","bp-load"),y(n,"background-image",dt(t[0]))},m(t,e){b(t,n,e),o=1},p(t,e){1&e&&y(n,"background-image",dt(t[0]))},i(t){o||(e&&e.end(1),o=1)},o(t){t&&(e=V(n,it,{duration:480})),o=0},d(t){t&&h(n),t&&e&&e.end()}}}function bt(n){let e,o;return{c(){e=g("div"),w(e,"class","bp-load"),y(e,"background-image",dt(n[0]))},m(t,n){b(t,e,n)},p(t,n){1&n&&y(e,"background-image",dt(t[0]))},i(t){o||R((()=>{o=U(e,it,{duration:480}),o.start()}))},o:t,d(t){t&&h(e)}}}function ht(t){let n,e,o=!t[1]&&mt(t),r=t[2]&&bt(t);return{c(){o&&o.c(),n=x(),r&&r.c(),e=x()},m(t,i){o&&o.m(t,i),b(t,n,i),r&&r.m(t,i),b(t,e,i)},p(t,[i]){t[1]?o&&(Y(),H(o,1,1,(()=>{o=null})),B()):o?(o.p(t,i),2&i&&G(o,1)):(o=mt(t),o.c(),G(o,1),o.m(n.parentNode,n)),t[2]?r?(r.p(t,i),4&i&&G(r,1)):(r=bt(t),r.c(),G(r,1),r.m(e.parentNode,e)):r&&(r.d(1),r=null)},i(t){G(o),G(r)},o(t){H(o)},d(t){o&&o.d(t),t&&h(n),r&&r.d(t),t&&h(e)}}}function gt(t,n,e){let o;c(t,at,(t=>e(2,o=t)));let{$:r}=n,{loaded:i}=n;return t.$$set=t=>{"$"in t&&e(0,r=t.$),"loaded"in t&&e(1,i=t.loaded)},[r,i,o]}class xt extends ot{constructor(t){super(),et(this,t,gt,ht,s,{$:0,loaded:1})}}function vt(t){let n,e,o,r,i,s,c,u;return{c(){n=g("img"),w(n,"srcset",e=t[7].img),w(n,"sizes",o=t[8].sizes||t[1]+"px"),w(n,"alt",r=t[7].alt)},m(e,o){b(e,n,o),s=1,c||(u=v(n,"error",t[26]),c=1)},p(t,e){(!s||2&e[0]&&o!==(o=t[8].sizes||t[1]+"px"))&&w(n,"sizes",o)},i(t){s||(i&&i.end(1),s=1)},o(t){i=V(n,it,{}),s=0},d(t){t&&h(n),t&&i&&i.end(),c=0,u()}}}function wt(t){let n,e;return n=new xt({v:{$:t[7],loaded:t[2]}}),{c(){Z(n.$$.t)},m(t,o){tt(n,t,o),e=1},p(t,e){const o={};4&e[0]&&(o.loaded=t[2]),n.$set(o)},i(t){e||(G(n.$$.t,t),e=1)},o(t){H(n.$$.t,t),e=0},d(t){nt(n,t)}}}function yt(t){let n,e,o,i,s,c,l=`translate3d(${t[0][0]/-2+t[6][0]}px, ${t[0][1]/-2+t[6][1]}px, 0)`,a=t[2]&&vt(t),p=t[3]&&wt(t);return{c(){n=g("div"),e=g("div"),a&&a.c(),o=x(),p&&p.c(),w(e,"class","bp-img"),y(e,"width",t[0][0]+"px"),y(e,"height",t[0][1]+"px"),$(e,"bp-drag",t[4]),$(e,"bp-canzoom",t[11]>1&&t[12]>t[0][0]),y(e,"background-image",dt(t[7])),y(e,"transform",l),w(n,"class","bp-img-wrap"),$(n,"bp-close",t[5])},m(r,l){b(r,n,l),m(n,e),a&&a.m(e,null),m(e,o),p&&p.m(e,null),i=1,s||(c=[u(t[20].call(null,e)),v(n,"wheel",t[15]),v(n,"pointerdown",t[16]),v(n,"pointermove",t[17]),v(n,"pointerup",t[19]),v(n,"pointercancel",t[18])],s=1)},p(t,r){t[2]?a?(a.p(t,r),4&r[0]&&G(a,1)):(a=vt(t),a.c(),G(a,1),a.m(e,o)):a&&(Y(),H(a,1,1,(()=>{a=null})),B()),t[3]?p?(p.p(t,r),8&r[0]&&G(p,1)):(p=wt(t),p.c(),G(p,1),p.m(e,null)):p&&(Y(),H(p,1,1,(()=>{p=null})),B()),(!i||1&r[0])&&y(e,"width",t[0][0]+"px"),(!i||1&r[0])&&y(e,"height",t[0][1]+"px"),16&r[0]&&$(e,"bp-drag",t[4]),6145&r[0]&&$(e,"bp-canzoom",t[11]>1&&t[12]>t[0][0]),65&r[0]&&l!==(l=`translate3d(${t[0][0]/-2+t[6][0]}px, ${t[0][1]/-2+t[6][1]}px, 0)`)&&y(e,"transform",l),32&r[0]&&$(n,"bp-close",t[5])},i(t){i||(G(a),G(p),i=1)},o(t){H(a),H(p),i=0},d(t){t&&h(n),a&&a.d(),p&&p.d(),s=0,r(c)}}}function $t(t,n,e){let o,r,i,s;c(t,at,(t=>e(25,i=t)));let{v:u}=n,{k:l}=n,{$:a,_:p,M:f,next:d,zoomed:m,container:b}=u;c(t,m,(t=>e(24,o=t)));let h,g,x,v,w,y,$,k,_,M,z,I=a.maxZoom||p.maxZoom||10,S=u.I(a),P=S[0],A=0;const T=+a.width,C=[],N=new Map,O=lt(S,ft(400));c(t,O,(t=>e(0,s=t)));const E=lt([0,0],ft(400));c(t,E,(t=>e(6,r=t)));const R=([t,n],o=s)=>{const r=(o[0]-b.w)/2,i=(o[1]-b.h)/2;return 0>r?t=0:t>r?l?(t=w?r+(t-r)/10:r)>r+20&&e(4,w=f()):t=r:-r>t&&(l?-r-20>(t=w?-r-(-r-t)/10:-r)&&e(4,w=d()):t=-r),0>i?n=0:n>i?n=i:-i>n&&(n=-i),[t,n]};function j(t=I,n){if(i)return;const o=S[0]*I;let c=s[0]+s[0]*t,u=s[1]+s[1]*t;if(t>0)c>o&&(c=o,u=S[1]*I),c>T&&(c=T,u=+a.height);else if(S[0]>c)return O.set(S),E.set([0,0]);let{x:l,y:p,width:f,height:d}=v.getBoundingClientRect();const m=n?n.clientX-l-f/2:0,b=n?n.clientY-p-d/2:0;l=c/f*-m+m,p=u/d*-b+b;const h=[c,u];O.set(h).then((()=>{e(1,P=Math.round(Math.max(P,c)))})),E.set(R([r[0]+l,r[1]+p],h))}Object.defineProperty(a,"zoom",{configurable:1,get(){return o},set(t){return j(t?I:-I)}});const q=t=>N.delete(t.pointerId);return t.$$set=t=>{"k"in t&&e(22,l=t.k)},t.$$.update=()=>{if(8388609&t.$$.u[0]&&m.set(s[0]-10>S[0]),58720256&t.$$.u[0]&&i&&o&&!p.intro){const t=ft(480);E.set([0,0],t),O.set(S,t),e(5,z=1)}},[s,P,h,g,w,z,r,a,p,m,b,I,T,O,E,t=>{p.inline&&!o||(t.preventDefault(),j(t.deltaY/-300,t))},t=>{2!==t.button&&(t.preventDefault(),e(4,w=1),N.set(t.pointerId,t),$=t.clientX,k=t.clientY,_=r[0],M=r[1])},t=>{if(N.size>1)return e(4,w=0),p.noPinch?.(b.el)||(t=>{const[n,e]=N.set(t.pointerId,t).values(),o=Math.hypot(n.clientX-e.clientX,n.clientY-e.clientY);x=x||{clientX:(n.clientX+e.clientX)/2,clientY:(n.clientY+e.clientY)/2},j(((A||o)-o)/-35,x),A=o})(t);if(!w)return;let n=t.clientX,r=t.clientY;y=C.push({x:n,y:r})>2,n-=$,r-=k,o||(-90>r&&e(4,w=!p.noClose&&u.close()),30>Math.abs(r)&&(n>40&&e(4,w=f()),-40>n&&e(4,w=d()))),o&&y&&!i&&E.set(R([_+n,M+r]),{duration:0})},q,function(t){if(q(t),x&&(e(4,w=A=0),x=N.size?x:null),w){if(e(4,w=0),t.target===this&&!p.noClose)return u.close();if(y){const[t,n,e]=C.slice(-3);Math.hypot(n.x-e.x,n.y-e.y)>5&&E.set(R([r[0]-5*(t.x-e.x),r[1]-5*(t.y-e.y)]))}else p.onImageClick?.(b.el,a)||j(o?-I:I,t);y=0,C.length=0}},t=>{v=t,u.S((()=>{e(23,S=u.I(a)),!p.inline&&l||(O.set(S),E.set([0,0]))})),u.P(a).then((()=>{e(2,h=1),u.A()})),setTimeout((()=>{e(3,g=!h)}),250)},u,l,S,o,i,t=>p.onError?.(b,a,t)]}class kt extends ot{constructor(t){super(),et(this,t,$t,yt,s,{v:21,k:22},null,[-1,-1])}}function _t(t){let n,e,o,i,s,c;return o=new xt({v:{$:t[2],loaded:t[0]}}),{c(){n=g("div"),e=g("iframe"),Z(o.$$.t),w(e,"allow","autoplay; fullscreen"),w(e,"title",t[2].title),w(n,"class","bp-if"),y(n,"width",t[1][0]+"px"),y(n,"height",t[1][1]+"px")},m(r,l){b(r,n,l),m(n,e),tt(o,n,null),i=1,s||(c=[u(t[3].call(null,e)),v(e,"load",t[5])],s=1)},p(t,[e]){const r={};1&e&&(r.loaded=t[0]),o.$set(r),(!i||2&e)&&y(n,"width",t[1][0]+"px"),(!i||2&e)&&y(n,"height",t[1][1]+"px")},i(t){i||(G(o.$$.t,t),i=1)},o(t){H(o.$$.t,t),i=0},d(t){t&&h(n),nt(o),s=0,r(c)}}}function Mt(t,n,e){let o,r,{v:i}=n;const{$:s}=i,c=()=>e(1,r=i.I(s));return c(),i.S(c),[o,r,s,t=>t.src=s.iframe,i,()=>e(0,o=1)]}class zt extends ot{constructor(t){super(),et(this,t,Mt,_t,s,{v:4})}}function It(t){let n,e,o,r,i;return e=new xt({v:{$:t[2],loaded:t[0]}}),{c(){n=g("div"),Z(e.$$.t),w(n,"class","bp-vid"),y(n,"width",t[1][0]+"px"),y(n,"height",t[1][1]+"px"),y(n,"background-image",dt(t[2]))},m(s,c){b(s,n,c),tt(e,n,null),o=1,r||(i=u(t[3].call(null,n)),r=1)},p(t,[r]){const i={};1&r&&(i.loaded=t[0]),e.$set(i),(!o||2&r)&&y(n,"width",t[1][0]+"px"),(!o||2&r)&&y(n,"height",t[1][1]+"px")},i(t){o||(G(e.$$.t,t),o=1)},o(t){H(e.$$.t,t),o=0},d(t){t&&h(n),nt(e),r=0,i()}}}function St(t,n,e){let o,r,{v:i}=n;const{$:s,_:c,container:u}=i,l=()=>e(1,r=i.I(s));l(),i.S(l);const a=(t,n)=>{for(const e in n)w(t,e,n[e])};return[o,r,s,t=>{let n;const r=(t,e)=>{Array.isArray(e)||(e=JSON.parse(e));for(const o of e){n||(n=g(o.type?.includes("audio")?"audio":"video"),a(n,{controls:1,autoplay:1,playsinline:1,tabindex:"0"}));const e=g(t);a(e,o),"source"==t&&v(e,"error",(t=>c.onError?.(u,s,t))),m(n,e)}};r("source",s.sources),r("track",s.tracks||[]),v(n,"canplay",(()=>e(0,o=1))),m(t,n)},i]}class Pt extends ot{constructor(t){super(),et(this,t,St,It,s,{v:4})}}function At(n){let e,o,i,c,l,a,p,f,d,x,y=n[6].i,k=Rt(n),_=n[0].length>1&&jt(n);return{c(){e=g("div"),o=g("div"),k.c(),c=g("div"),l=g("button"),_&&_.c(),w(l,"class","bp-x"),w(l,"title","Close"),w(l,"aria-label","Close"),w(c,"class","bp-controls"),w(e,"class","bp-wrap"),$(e,"bp-zoomed",n[10]),$(e,"bp-inline",n[8]),$(e,"bp-small",n[7]),$(e,"bp-noclose",n[5].noClose)},m(t,r){b(t,e,r),m(e,o),k.m(e,null),m(e,c),m(c,l),_&&_.m(c,null),f=1,d||(x=[v(l,"click",n[1]),u(p=n[14].call(null,e))],d=1)},p(n,o){64&o[0]&&s(y,y=n[6].i)?(Y(),H(k,1,1,t),B(),k=Rt(n),k.c(),G(k),k.m(e,c)):k.p(n,o),n[0].length>1?_?_.p(n,o):(_=jt(n),_.c(),_.m(c,null)):_&&(_.d(1),_=null),1024&o[0]&&$(e,"bp-zoomed",n[10]),256&o[0]&&$(e,"bp-inline",n[8]),128&o[0]&&$(e,"bp-small",n[7]),32&o[0]&&$(e,"bp-noclose",n[5].noClose)},i(t){f||(i&&i.end(1),G(k),a&&a.end(1),f=1)},o(t){t&&(i=V(o,it,{duration:480})),H(k),t&&(a=V(c,it,{})),f=0},d(t){t&&h(e),t&&i&&i.end(),k.d(t),_&&_.d(),t&&a&&a.end(),d=0,r(x)}}}function Tt(n){let e,o=(n[6].html??n[6].element.outerHTML)+"";return{c(){e=g("div"),w(e,"class","bp-html")},m(t,n){b(t,e,n),e.innerHTML=o},p(t,n){64&n[0]&&o!==(o=(t[6].html??t[6].element.outerHTML)+"")&&(e.innerHTML=o)},i:t,o:t,d(t){t&&h(e)}}}function Ct(n){let e,o;return e=new zt({v:{v:n[13]()}}),{c(){Z(e.$$.t)},m(t,n){tt(e,t,n),o=1},p:t,i(t){o||(G(e.$$.t,t),o=1)},o(t){H(e.$$.t,t),o=0},d(t){nt(e,t)}}}function Nt(n){let e,o;return e=new Pt({v:{v:n[13]()}}),{c(){Z(e.$$.t)},m(t,n){tt(e,t,n),o=1},p:t,i(t){o||(G(e.$$.t,t),o=1)},o(t){H(e.$$.t,t),o=0},d(t){nt(e,t)}}}function Ot(t){let n,e;return n=new kt({v:{v:t[13](),k:t[7]}}),{c(){Z(n.$$.t)},m(t,o){tt(n,t,o),e=1},p(t,e){const o={};128&e[0]&&(o.k=t[7]),n.$set(o)},i(t){e||(G(n.$$.t,t),e=1)},o(t){H(n.$$.t,t),e=0},d(t){nt(n,t)}}}function Et(t){let n,e,o,r=t[6].caption+"";return{c(){n=g("div"),w(n,"class","bp-cap")},m(t,e){b(t,n,e),n.innerHTML=r,o=1},p(t,e){(!o||64&e[0])&&r!==(r=t[6].caption+"")&&(n.innerHTML=r)},i(t){o||(e&&e.end(1),o=1)},o(t){e=V(n,it,{duration:200}),o=0},d(t){t&&h(n),t&&e&&e.end()}}}function Rt(t){let n,e,o,i,s,c,u,l,a;const p=[Ot,Nt,Ct,Tt],f=[];function d(t,n){return t[6].img?0:t[6].sources?1:t[6].iframe?2:3}e=d(t),o=f[e]=p[e](t);let m=t[6].caption&&Et(t);return{c(){n=g("div"),o.c(),m&&m.c(),c=x(),w(n,"class","bp-inner")},m(o,r){b(o,n,r),f[e].m(n,null),m&&m.m(o,r),b(o,c,r),u=1,l||(a=[v(n,"pointerdown",t[20]),v(n,"pointerup",t[21])],l=1)},p(t,r){let i=e;e=d(t),e===i?f[e].p(t,r):(Y(),H(f[i],1,1,(()=>{f[i]=null})),B(),o=f[e],o?o.p(t,r):(o=f[e]=p[e](t),o.c()),G(o,1),o.m(n,null)),t[6].caption?m?(m.p(t,r),64&r[0]&&G(m,1)):(m=Et(t),m.c(),G(m,1),m.m(c.parentNode,c)):m&&(Y(),H(m,1,1,(()=>{m=null})),B())},i(e){u||(G(o),R((()=>{s&&s.end(1),i=U(n,t[12],1),i.start()})),G(m),u=1)},o(e){H(o),i&&i.invalidate(),s=V(n,t[12],0),H(m),u=0},d(t){t&&h(n),f[e].d(),t&&s&&s.end(),m&&m.d(t),t&&h(c),l=0,r(a)}}}function jt(t){let n,e,o,i,s,c=`${t[4]+1} / ${t[0].length}`;return{c(){n=g("div"),e=g("button"),o=g("button"),w(n,"class","bp-count"),w(e,"class","bp-prev"),w(e,"title","Previous"),w(e,"aria-label","Previous"),w(o,"class","bp-next"),w(o,"title","Next"),w(o,"aria-label","Next")},m(r,u){b(r,n,u),n.innerHTML=c,b(r,e,u),b(r,o,u),i||(s=[v(e,"click",t[2]),v(o,"click",t[3])],i=1)},p(t,e){17&e[0]&&c!==(c=`${t[4]+1} / ${t[0].length}`)&&(n.innerHTML=c)},d(t){t&&h(n),t&&h(e),t&&h(o),i=0,r(s)}}}function qt(t){let n,e,o=t[0]&&At(t);return{c(){o&&o.c(),n=x()},m(t,r){o&&o.m(t,r),b(t,n,r),e=1},p(t,e){t[0]?o?(o.p(t,e),1&e[0]&&G(o,1)):(o=At(t),o.c(),G(o,1),o.m(n.parentNode,n)):o&&(Y(),H(o,1,1,(()=>{o=null})),B())},i(t){e||(G(o),e=1)},o(t){H(o),e=0},d(t){o&&o.d(t),t&&h(n)}}}function Ft(t,n,e){let o,{items:r}=n,{target:i}=n;const s=document.documentElement;let u,l,a,p,f,d,m,b,h;const x=()=>!h.img&&!h.sources&&!h.iframe;let w;const y=t=>w=t,$={},k=ct(0);c(t,k,(t=>e(10,o=t)));const _=()=>{l.onClose?.($.el,h),at.set(1),e(0,r=null),p?.focus({preventScroll:1})},M=()=>I(u-1),z=()=>I(u+1),I=t=>{m=t-u,e(4,u=S(t))},S=t=>(t+r.length)%r.length,P=t=>{const{key:n,shiftKey:e}=t;if("Escape"===n)!l.noClose&&_();else if("ArrowRight"===n)z();else if("ArrowLeft"===n)M();else if("Tab"===n){const{activeElement:n}=document;if(e||!n.controls){t.preventDefault();const{focusWrap:o=$.el}=l,r=[...o.querySelectorAll("*")].filter((t=>t.tabIndex>=0));let i=r.indexOf(n);i+=r.length+(e?-1:1),r[i%r.length].focus()}}},A=({width:t=1920,height:n=1080})=>{const{scale:e=.99}=l,o=Math.min(1,$.w/t*e,$.h/n*e);return[Math.round(t*o),Math.round(n*o)]},T=()=>{if(r){const t=r[S(u+1)],n=r[S(u-1)];!t.preload&&C(t),!n.preload&&C(n)}},C=t=>{if(t.img){const n=g("img");return n.sizes=l.sizes||A(t)[0]+"px",n.srcset=t.img,t.preload=1,n.decode().catch((t=>{}))}};return t.$$set=t=>{"items"in t&&e(0,r=t.items),"target"in t&&e(15,i=t.target)},t.$$.update=()=>{786545&t.$$.u[0]&&r&&(e(6,h=r[u]),a&&l.onUpdate?.($.el,h))},[r,_,M,z,u,l,h,f,d,b,o,k,(t,n)=>a&&r?it(t,{x:(m>0?20:-20)*(n?1:-1),duration:250}):(e(18,a=n),l.intro?it(t,{y:n?10:-10}):(t=>{let n;if(x()){const e=t.firstChild.firstChild;n=[e.clientWidth,e.clientHeight]}else n=A(h);const e=(h.element||p).getBoundingClientRect(),o=e.left-($.w-e.width)/2,r=e.top-($.h-e.height)/2,i=e.width/n[0],s=e.height/n[1];return{duration:480,l:rt,css:(t,n)=>`transform:translate3d(${o*n}px, ${r*n}px, 0) scale3d(${i+t*(1-i)}, ${s+t*(1-s)}, 1)`}})(t)),()=>({$:h,I:A,P:C,A:T,_:l,M,next:z,close:_,S:y,zoomed:k,container:$}),t=>{let n,o;e(19,$.el=t,$),l.onOpen?.($.el,h),d||(n=v(globalThis,"keydown",P));const r=new ResizeObserver((t=>{o&&(e(19,$.w=t[0].contentRect.width,$),e(19,$.h=t[0].contentRect.height,$),e(7,f=769>$.w),x()||w?.(),l.onResize?.($.el,h)),o=1}));return r.observe(t),{destroy(){r.disconnect(),n?.(),at.set(0),s.classList.remove("bp-lock"),l.onClosed?.()}}},i,t=>{e(5,l=t),e(8,d=l.inline);const n=l.items;!d&&s.scrollHeight>s.clientHeight&&s.classList.add("bp-lock"),p=document.activeElement,e(19,$.w=i.offsetWidth,$),e(19,$.h=i===document.body?globalThis.innerHeight:i.clientHeight,$),e(7,f=769>$.w),e(4,u=l.position||0),e(0,r=Array.isArray(n)?n.map(((t,n)=>(l.el&&l.el===t.element&&e(4,u=n),{i:n,...t}))):(n.length?[...n]:[n]).map(((t,n)=>(l.el===t&&e(4,u=n),{element:t,i:n,...t.dataset}))))},I,a,$,t=>e(9,b=t.target),function(t){2!==t.button&&t.target===this&&b===this&&!l.noClose&&_()}]}class Dt extends ot{constructor(t){super(),et(this,t,Ft,qt,s,{items:0,target:15,open:16,close:1,M:2,next:3,setPosition:17},null,[-1,-1])}get items(){return this.$$.ctx[0]}get target(){return this.$$.ctx[15]}get open(){return this.$$.ctx[16]}get close(){return this.$$.ctx[1]}get M(){return this.$$.ctx[2]}get next(){return this.$$.ctx[3]}get setPosition(){return this.$$.ctx[17]}}function Jt(t){return new Dt({...t,v:t})}export{Jt as default};
diff --git a/dist/bigger-picture.mjs b/dist/bigger-picture.mjs
index 8994797..5521e5e 100644
--- a/dist/bigger-picture.mjs
+++ b/dist/bigger-picture.mjs
@@ -696,32 +696,32 @@ const defaultTweenOptions = (duration) => ({
duration: prefersReducedMotion ? 0 : duration,
});
+const getThumbBackground = (activeItem) =>
+ !activeItem.thumb || `url(${activeItem.thumb})`;
+
/* src/components/loading.svelte generated by Svelte v3.47.0 */
function create_if_block_1$2(ctx) {
let div;
- let span0;
- let span1;
let div_outro;
let current;
return {
c() {
div = element("div");
- span0 = element("span");
- span1 = element("span");
- attr(span0, "class", "bp-bar");
- attr(span1, "class", "bp-o");
+ div.innerHTML = ``;
attr(div, "class", "bp-load");
- attr(div, "style", /*style*/ ctx[2]);
+ set_style(div, "background-image", getThumbBackground(/*activeItem*/ ctx[0]));
},
m(target, anchor) {
insert(target, div, anchor);
- append(div, span0);
- append(div, span1);
current = true;
},
- p: noop,
+ p(ctx, dirty) {
+ if (dirty & /*activeItem*/ 1) {
+ set_style(div, "background-image", getThumbBackground(/*activeItem*/ ctx[0]));
+ }
+ },
i(local) {
if (current) return;
if (div_outro) div_outro.end(1);
@@ -741,7 +741,7 @@ function create_if_block_1$2(ctx) {
};
}
-// (9:140) {#if $closing}
+// (11:57) {#if $closing}
function create_if_block$2(ctx) {
let div;
let div_intro;
@@ -750,12 +750,16 @@ function create_if_block$2(ctx) {
c() {
div = element("div");
attr(div, "class", "bp-load");
- attr(div, "style", /*style*/ ctx[2]);
+ set_style(div, "background-image", getThumbBackground(/*activeItem*/ ctx[0]));
},
m(target, anchor) {
insert(target, div, anchor);
},
- p: noop,
+ p(ctx, dirty) {
+ if (dirty & /*activeItem*/ 1) {
+ set_style(div, "background-image", getThumbBackground(/*activeItem*/ ctx[0]));
+ }
+ },
i(local) {
if (!div_intro) {
add_render_callback(() => {
@@ -774,8 +778,8 @@ function create_if_block$2(ctx) {
function create_fragment$4(ctx) {
let if_block0_anchor;
let if_block1_anchor;
- let if_block0 = !/*loaded*/ ctx[0] && create_if_block_1$2(ctx);
- let if_block1 = /*$closing*/ ctx[1] && create_if_block$2(ctx);
+ let if_block0 = !/*loaded*/ ctx[1] && create_if_block_1$2(ctx);
+ let if_block1 = /*$closing*/ ctx[2] && create_if_block$2(ctx);
return {
c() {
@@ -791,11 +795,11 @@ function create_fragment$4(ctx) {
insert(target, if_block1_anchor, anchor);
},
p(ctx, [dirty]) {
- if (!/*loaded*/ ctx[0]) {
+ if (!/*loaded*/ ctx[1]) {
if (if_block0) {
if_block0.p(ctx, dirty);
- if (dirty & /*loaded*/ 1) {
+ if (dirty & /*loaded*/ 2) {
transition_in(if_block0, 1);
}
} else {
@@ -814,11 +818,11 @@ function create_fragment$4(ctx) {
check_outros();
}
- if (/*$closing*/ ctx[1]) {
+ if (/*$closing*/ ctx[2]) {
if (if_block1) {
if_block1.p(ctx, dirty);
- if (dirty & /*$closing*/ 2) {
+ if (dirty & /*$closing*/ 4) {
transition_in(if_block1, 1);
}
} else {
@@ -850,23 +854,22 @@ function create_fragment$4(ctx) {
function instance$4($$self, $$props, $$invalidate) {
let $closing;
- component_subscribe($$self, closing, $$value => $$invalidate(1, $closing = $$value));
- let { thumb } = $$props;
+ component_subscribe($$self, closing, $$value => $$invalidate(2, $closing = $$value));
+ let { activeItem } = $$props;
let { loaded } = $$props;
- const style = `background-image:url(${thumb})`;
$$self.$$set = $$props => {
- if ('thumb' in $$props) $$invalidate(3, thumb = $$props.thumb);
- if ('loaded' in $$props) $$invalidate(0, loaded = $$props.loaded);
+ if ('activeItem' in $$props) $$invalidate(0, activeItem = $$props.activeItem);
+ if ('loaded' in $$props) $$invalidate(1, loaded = $$props.loaded);
};
- return [loaded, $closing, style, thumb];
+ return [activeItem, loaded, $closing];
}
class Loading extends SvelteComponent {
constructor(options) {
super();
- init(this, options, instance$4, create_fragment$4, not_equal, { thumb: 3, loaded: 0 });
+ init(this, options, instance$4, create_fragment$4, not_equal, { activeItem: 0, loaded: 1 });
}
}
@@ -928,7 +931,7 @@ function create_if_block$1(ctx) {
loading = new Loading({
props: {
- thumb: /*activeItem*/ ctx[7].thumb,
+ activeItem: /*activeItem*/ ctx[7],
loaded: /*loaded*/ ctx[2]
}
});
@@ -965,6 +968,7 @@ function create_fragment$3(ctx) {
let div1;
let div0;
let if_block0_anchor;
+ let style_transform = `translate3d(${/*$imageDimensions*/ ctx[0][0] / -2 + /*$zoomDragTranslate*/ ctx[6][0]}px, ${/*$imageDimensions*/ ctx[0][1] / -2 + /*$zoomDragTranslate*/ ctx[6][1]}px, 0)`;
let current;
let mounted;
let dispose;
@@ -979,12 +983,12 @@ function create_fragment$3(ctx) {
if_block0_anchor = empty();
if (if_block1) if_block1.c();
attr(div0, "class", "bp-img");
- set_style(div0, "background-image", "url(" + /*activeItem*/ ctx[7].thumb + ")");
set_style(div0, "width", /*$imageDimensions*/ ctx[0][0] + "px");
set_style(div0, "height", /*$imageDimensions*/ ctx[0][1] + "px");
- set_style(div0, "transform", "translate3d(" + (/*$imageDimensions*/ ctx[0][0] / -2 + /*$zoomDragTranslate*/ ctx[6][0]) + "px, " + (/*$imageDimensions*/ ctx[0][1] / -2 + /*$zoomDragTranslate*/ ctx[6][1]) + "px, 0)");
toggle_class(div0, "bp-drag", /*pointerDown*/ ctx[4]);
toggle_class(div0, "bp-canzoom", /*maxZoom*/ ctx[11] > 1 && /*$imageDimensions*/ ctx[0][0] < /*naturalWidth*/ ctx[12]);
+ set_style(div0, "background-image", getThumbBackground(/*activeItem*/ ctx[7]));
+ set_style(div0, "transform", style_transform);
attr(div1, "class", "bp-img-wrap");
toggle_class(div1, "bp-close", /*closingWhileZoomed*/ ctx[5]);
},
@@ -1064,10 +1068,6 @@ function create_fragment$3(ctx) {
set_style(div0, "height", /*$imageDimensions*/ ctx[0][1] + "px");
}
- if (!current || dirty[0] & /*$imageDimensions, $zoomDragTranslate*/ 65) {
- set_style(div0, "transform", "translate3d(" + (/*$imageDimensions*/ ctx[0][0] / -2 + /*$zoomDragTranslate*/ ctx[6][0]) + "px, " + (/*$imageDimensions*/ ctx[0][1] / -2 + /*$zoomDragTranslate*/ ctx[6][1]) + "px, 0)");
- }
-
if (dirty[0] & /*pointerDown*/ 16) {
toggle_class(div0, "bp-drag", /*pointerDown*/ ctx[4]);
}
@@ -1076,6 +1076,10 @@ function create_fragment$3(ctx) {
toggle_class(div0, "bp-canzoom", /*maxZoom*/ ctx[11] > 1 && /*$imageDimensions*/ ctx[0][0] < /*naturalWidth*/ ctx[12]);
}
+ if (dirty[0] & /*$imageDimensions, $zoomDragTranslate*/ 65 && style_transform !== (style_transform = `translate3d(${/*$imageDimensions*/ ctx[0][0] / -2 + /*$zoomDragTranslate*/ ctx[6][0]}px, ${/*$imageDimensions*/ ctx[0][1] / -2 + /*$zoomDragTranslate*/ ctx[6][1]}px, 0)`)) {
+ set_style(div0, "transform", style_transform);
+ }
+
if (dirty[0] & /*closingWhileZoomed*/ 32) {
toggle_class(div1, "bp-close", /*closingWhileZoomed*/ ctx[5]);
}
@@ -1524,7 +1528,7 @@ function create_fragment$2(ctx) {
loading = new Loading({
props: {
- thumb: /*activeItem*/ ctx[2].thumb,
+ activeItem: /*activeItem*/ ctx[2],
loaded: /*loaded*/ ctx[0]
}
});
@@ -1622,7 +1626,7 @@ function create_fragment$1(ctx) {
loading = new Loading({
props: {
- thumb: /*activeItem*/ ctx[2].thumb,
+ activeItem: /*activeItem*/ ctx[2],
loaded: /*loaded*/ ctx[0]
}
});
@@ -1634,7 +1638,7 @@ function create_fragment$1(ctx) {
attr(div, "class", "bp-vid");
set_style(div, "width", /*dimensions*/ ctx[1][0] + "px");
set_style(div, "height", /*dimensions*/ ctx[1][1] + "px");
- set_style(div, "background-image", "url(" + /*activeItem*/ ctx[2].thumb + ")");
+ set_style(div, "background-image", getThumbBackground(/*activeItem*/ ctx[2]));
},
m(target, anchor) {
insert(target, div, anchor);
diff --git a/dist/bigger-picture.umd.js b/dist/bigger-picture.umd.js
index f325d56..716a1b3 100644
--- a/dist/bigger-picture.umd.js
+++ b/dist/bigger-picture.umd.js
@@ -701,32 +701,32 @@
duration: prefersReducedMotion ? 0 : duration,
});
+ const getThumbBackground = (activeItem) =>
+ !activeItem.thumb || `url(${activeItem.thumb})`;
+
/* src/components/loading.svelte generated by Svelte v3.47.0 */
function create_if_block_1$2(ctx) {
let div;
- let span0;
- let span1;
let div_outro;
let current;
return {
c() {
div = element("div");
- span0 = element("span");
- span1 = element("span");
- attr(span0, "class", "bp-bar");
- attr(span1, "class", "bp-o");
+ div.innerHTML = ``;
attr(div, "class", "bp-load");
- attr(div, "style", /*style*/ ctx[2]);
+ set_style(div, "background-image", getThumbBackground(/*activeItem*/ ctx[0]));
},
m(target, anchor) {
insert(target, div, anchor);
- append(div, span0);
- append(div, span1);
current = true;
},
- p: noop,
+ p(ctx, dirty) {
+ if (dirty & /*activeItem*/ 1) {
+ set_style(div, "background-image", getThumbBackground(/*activeItem*/ ctx[0]));
+ }
+ },
i(local) {
if (current) return;
if (div_outro) div_outro.end(1);
@@ -746,7 +746,7 @@
};
}
- // (9:140) {#if $closing}
+ // (11:57) {#if $closing}
function create_if_block$2(ctx) {
let div;
let div_intro;
@@ -755,12 +755,16 @@
c() {
div = element("div");
attr(div, "class", "bp-load");
- attr(div, "style", /*style*/ ctx[2]);
+ set_style(div, "background-image", getThumbBackground(/*activeItem*/ ctx[0]));
},
m(target, anchor) {
insert(target, div, anchor);
},
- p: noop,
+ p(ctx, dirty) {
+ if (dirty & /*activeItem*/ 1) {
+ set_style(div, "background-image", getThumbBackground(/*activeItem*/ ctx[0]));
+ }
+ },
i(local) {
if (!div_intro) {
add_render_callback(() => {
@@ -779,8 +783,8 @@
function create_fragment$4(ctx) {
let if_block0_anchor;
let if_block1_anchor;
- let if_block0 = !/*loaded*/ ctx[0] && create_if_block_1$2(ctx);
- let if_block1 = /*$closing*/ ctx[1] && create_if_block$2(ctx);
+ let if_block0 = !/*loaded*/ ctx[1] && create_if_block_1$2(ctx);
+ let if_block1 = /*$closing*/ ctx[2] && create_if_block$2(ctx);
return {
c() {
@@ -796,11 +800,11 @@
insert(target, if_block1_anchor, anchor);
},
p(ctx, [dirty]) {
- if (!/*loaded*/ ctx[0]) {
+ if (!/*loaded*/ ctx[1]) {
if (if_block0) {
if_block0.p(ctx, dirty);
- if (dirty & /*loaded*/ 1) {
+ if (dirty & /*loaded*/ 2) {
transition_in(if_block0, 1);
}
} else {
@@ -819,11 +823,11 @@
check_outros();
}
- if (/*$closing*/ ctx[1]) {
+ if (/*$closing*/ ctx[2]) {
if (if_block1) {
if_block1.p(ctx, dirty);
- if (dirty & /*$closing*/ 2) {
+ if (dirty & /*$closing*/ 4) {
transition_in(if_block1, 1);
}
} else {
@@ -855,23 +859,22 @@
function instance$4($$self, $$props, $$invalidate) {
let $closing;
- component_subscribe($$self, closing, $$value => $$invalidate(1, $closing = $$value));
- let { thumb } = $$props;
+ component_subscribe($$self, closing, $$value => $$invalidate(2, $closing = $$value));
+ let { activeItem } = $$props;
let { loaded } = $$props;
- const style = `background-image:url(${thumb})`;
$$self.$$set = $$props => {
- if ('thumb' in $$props) $$invalidate(3, thumb = $$props.thumb);
- if ('loaded' in $$props) $$invalidate(0, loaded = $$props.loaded);
+ if ('activeItem' in $$props) $$invalidate(0, activeItem = $$props.activeItem);
+ if ('loaded' in $$props) $$invalidate(1, loaded = $$props.loaded);
};
- return [loaded, $closing, style, thumb];
+ return [activeItem, loaded, $closing];
}
class Loading extends SvelteComponent {
constructor(options) {
super();
- init(this, options, instance$4, create_fragment$4, not_equal, { thumb: 3, loaded: 0 });
+ init(this, options, instance$4, create_fragment$4, not_equal, { activeItem: 0, loaded: 1 });
}
}
@@ -933,7 +936,7 @@
loading = new Loading({
props: {
- thumb: /*activeItem*/ ctx[7].thumb,
+ activeItem: /*activeItem*/ ctx[7],
loaded: /*loaded*/ ctx[2]
}
});
@@ -970,6 +973,7 @@
let div1;
let div0;
let if_block0_anchor;
+ let style_transform = `translate3d(${/*$imageDimensions*/ ctx[0][0] / -2 + /*$zoomDragTranslate*/ ctx[6][0]}px, ${/*$imageDimensions*/ ctx[0][1] / -2 + /*$zoomDragTranslate*/ ctx[6][1]}px, 0)`;
let current;
let mounted;
let dispose;
@@ -984,12 +988,12 @@
if_block0_anchor = empty();
if (if_block1) if_block1.c();
attr(div0, "class", "bp-img");
- set_style(div0, "background-image", "url(" + /*activeItem*/ ctx[7].thumb + ")");
set_style(div0, "width", /*$imageDimensions*/ ctx[0][0] + "px");
set_style(div0, "height", /*$imageDimensions*/ ctx[0][1] + "px");
- set_style(div0, "transform", "translate3d(" + (/*$imageDimensions*/ ctx[0][0] / -2 + /*$zoomDragTranslate*/ ctx[6][0]) + "px, " + (/*$imageDimensions*/ ctx[0][1] / -2 + /*$zoomDragTranslate*/ ctx[6][1]) + "px, 0)");
toggle_class(div0, "bp-drag", /*pointerDown*/ ctx[4]);
toggle_class(div0, "bp-canzoom", /*maxZoom*/ ctx[11] > 1 && /*$imageDimensions*/ ctx[0][0] < /*naturalWidth*/ ctx[12]);
+ set_style(div0, "background-image", getThumbBackground(/*activeItem*/ ctx[7]));
+ set_style(div0, "transform", style_transform);
attr(div1, "class", "bp-img-wrap");
toggle_class(div1, "bp-close", /*closingWhileZoomed*/ ctx[5]);
},
@@ -1069,10 +1073,6 @@
set_style(div0, "height", /*$imageDimensions*/ ctx[0][1] + "px");
}
- if (!current || dirty[0] & /*$imageDimensions, $zoomDragTranslate*/ 65) {
- set_style(div0, "transform", "translate3d(" + (/*$imageDimensions*/ ctx[0][0] / -2 + /*$zoomDragTranslate*/ ctx[6][0]) + "px, " + (/*$imageDimensions*/ ctx[0][1] / -2 + /*$zoomDragTranslate*/ ctx[6][1]) + "px, 0)");
- }
-
if (dirty[0] & /*pointerDown*/ 16) {
toggle_class(div0, "bp-drag", /*pointerDown*/ ctx[4]);
}
@@ -1081,6 +1081,10 @@
toggle_class(div0, "bp-canzoom", /*maxZoom*/ ctx[11] > 1 && /*$imageDimensions*/ ctx[0][0] < /*naturalWidth*/ ctx[12]);
}
+ if (dirty[0] & /*$imageDimensions, $zoomDragTranslate*/ 65 && style_transform !== (style_transform = `translate3d(${/*$imageDimensions*/ ctx[0][0] / -2 + /*$zoomDragTranslate*/ ctx[6][0]}px, ${/*$imageDimensions*/ ctx[0][1] / -2 + /*$zoomDragTranslate*/ ctx[6][1]}px, 0)`)) {
+ set_style(div0, "transform", style_transform);
+ }
+
if (dirty[0] & /*closingWhileZoomed*/ 32) {
toggle_class(div1, "bp-close", /*closingWhileZoomed*/ ctx[5]);
}
@@ -1529,7 +1533,7 @@
loading = new Loading({
props: {
- thumb: /*activeItem*/ ctx[2].thumb,
+ activeItem: /*activeItem*/ ctx[2],
loaded: /*loaded*/ ctx[0]
}
});
@@ -1627,7 +1631,7 @@
loading = new Loading({
props: {
- thumb: /*activeItem*/ ctx[2].thumb,
+ activeItem: /*activeItem*/ ctx[2],
loaded: /*loaded*/ ctx[0]
}
});
@@ -1639,7 +1643,7 @@
attr(div, "class", "bp-vid");
set_style(div, "width", /*dimensions*/ ctx[1][0] + "px");
set_style(div, "height", /*dimensions*/ ctx[1][1] + "px");
- set_style(div, "background-image", "url(" + /*activeItem*/ ctx[2].thumb + ")");
+ set_style(div, "background-image", getThumbBackground(/*activeItem*/ ctx[2]));
},
m(target, anchor) {
insert(target, div, anchor);
diff --git a/package.json b/package.json
index b493d12..c645fd4 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "bigger-picture",
- "version": "1.1.13",
+ "version": "1.1.14",
"type": "module",
"exports": {
".": {