From 4d84b283854a92c440b0256b33684e04fda904fb Mon Sep 17 00:00:00 2001 From: henrygd Date: Sat, 23 Apr 2022 15:11:05 -0700 Subject: [PATCH] release 0.2.1 --- dist/bigger-picture.min.js | 2 +- dist/bigger-picture.min.mjs | 2 +- dist/bigger-picture.mjs | 399 ++++++++++++++++-------------------- dist/bigger-picture.umd.js | 399 ++++++++++++++++-------------------- package.json | 2 +- 5 files changed, 357 insertions(+), 447 deletions(-) diff --git a/dist/bigger-picture.min.js b/dist/bigger-picture.min.js index 48c7099..a4c18a4 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 i(t){t.forEach(o)}function r(t){return"function"==typeof t}let s;function u(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 l(t,n,e){return t.set(e),n}function a(n){return n&&r(n.destroy)?n.destroy:t}let f=()=>window.performance.now(),d=t=>requestAnimationFrame(t);const p=new Set;function m(t){p.forEach((n=>{n.c(t)||(p.delete(n),n.f())})),0!==p.size&&d(m)}function h(t){let n;return 0===p.size&&d(m),{promise:new Promise((e=>{p.add(n={c:t,f:e})})),abort(){p.delete(n)}}}function g(t,n){t.appendChild(n)}function b(t){const n=v("style");return((t,n)=>{g(t.head||t,n)})(document,n),n.sheet}function x(t,n,e){t.insertBefore(n,e||null)}function y(t){t.parentNode.removeChild(t)}function v(t){return document.createElement(t)}function w(t){return document.createTextNode(t)}function $(){return w("")}function k(t,n,e,o){return t.addEventListener(n,e,o),()=>t.removeEventListener(n,e,o)}function _(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function S(t,n,e,o){null===e?t.style.removeProperty(n):t.style.setProperty(n,e,o?"important":"")}function z(t,n,e){t.classList[e?"add":"remove"](n)}class M{constructor(){this.e=this.n=null}c(t){this.h(t)}m(t,n,e=null){this.e||(this.e=v(n.nodeName),this.t=n,this.c(t)),this.i(e)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.childNodes)}i(t){for(let n=0;this.n.length>n;n+=1)x(this.t,this.n[n],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(y)}}const I=new Map;let R,C=0;function F(t,n,e,o,i,r,s,u=0){const c=16.666/o;let l="{\n";for(let t=0;1>=t;t+=c){const o=n+(e-n)*r(t);l+=100*t+`%{${s(o,1-o)}}\n`}const a=l+`100% {${s(e,1-e)}}\n}`,f=`__svelte_${(t=>{let n=5381,e=t.length;for(;e--;)n=(n<<5)-n^t.charCodeAt(e);return n>>>0})(a)}_${u}`,d=document,{stylesheet:p,rules:m}=I.get(d)||((t,n)=>{const e={stylesheet:b(),rules:{}};return I.set(t,e),e})(d);m[f]||(m[f]=1,p.insertRule(`@keyframes ${f} ${a}`,p.cssRules.length));const h=t.style.animation||"";return t.style.animation=`${h?h+", ":""}${f} ${o}ms linear ${i}ms 1 both`,C+=1,f}function P(t,n){const e=(t.style.animation||"").split(", "),o=e.filter(n?t=>0>t.indexOf(n):t=>-1===t.indexOf("__svelte")),i=e.length-o.length;i&&(t.style.animation=o.join(", "),C-=i,C||d((()=>{C||(I.forEach((t=>{const{stylesheet:n}=t;let e=n.cssRules.length;for(;e--;)n.deleteRule(e);t.rules={}})),I.clear())})))}function D(t){R=t}const A=[],N=[],H=[],O=[],T=Promise.resolve();let W=0;function E(t){H.push(t)}const j=new Set;let q,J=0;function B(){const t=R;do{for(;A.length>J;){const t=A[J];J++,D(t),K(t.$$)}for(D(null),A.length=0,J=0;N.length;)N.pop()();for(let t=0;H.length>t;t+=1){const n=H[t];j.has(n)||(j.add(n),n())}H.length=0}while(A.length);for(;O.length;)O.pop()();W=0,j.clear(),D(t)}function K(t){if(null!==t.u){t.update(),i(t.before_update);const n=t.l;t.l=[-1],t.u&&t.u.p(t.ctx,n),t.after_update.forEach(E)}}function L(){return q||(q=Promise.resolve(),q.then((()=>{q=null}))),q}function G(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 Q=new Set;let U;function V(){U={r:0,c:[],p:U}}function X(){U.r||i(U.c),U=U.p}function Y(t,n){t&&t.i&&(Q.delete(t),t.i(n))}function Z(t,n,e,o){if(t&&t.o){if(Q.has(t))return;Q.add(t),U.c.push((()=>{Q.delete(t),o&&(e&&t.d(1),o())})),t.o(n)}}const tt={duration:0};function nt(e,o,i){let s,u,c=o(e,i),l=0,a=0;function d(){s&&P(e,s)}function p(){const{delay:o=0,duration:i=300,g:r=n,v:p=t,css:m}=c||tt;m&&(s=F(e,0,1,i,o,r,m,a++)),p(0,1);const g=f()+o,b=g+i;u&&u.abort(),l=1,E((()=>G(e,1,"start"))),u=h((t=>{if(l){if(t>=b)return p(1,0),G(e,1,"end"),d(),l=0;if(t>=g){const n=r((t-g)/i);p(n,1-n)}}return l}))}let m=0;return{start(){m||(m=1,P(e),r(c)?(c=c(),L().then(p)):p())},invalidate(){m=0},end(){l&&(d(),l=0)}}}function et(e,o,s){let u,c=o(e,s),l=1;const a=U;function d(){const{delay:o=0,duration:r=300,g:s=n,v:d=t,css:p}=c||tt;p&&(u=F(e,1,0,r,o,s,p));const m=f()+o,g=m+r;E((()=>G(e,0,"start"))),h((t=>{if(l){if(t>=g)return d(0,1),G(e,0,"end"),--a.r||i(a.c),0;if(t>=m){const n=s((t-m)/r);d(1-n,n)}}return l}))}return a.r+=1,r(c)?L().then((()=>{c=c(),d()})):d(),{end(t){t&&c.v&&c.v(1,0),l&&(u&&P(e,u),l=0)}}}function ot(e,o,s,u){let c=o(e,s),l=u?0:1,a=null,d=null,p=null;function m(){p&&P(e,p)}function g(t,n){const e=t.b-l;return{a:l,b:t.b,d:e,duration:n*=Math.abs(e),start:t.start,end:t.start+n,group:t.group}}function b(o){const{delay:r=0,duration:s=300,g:u=n,v:b=t,css:x}=c||tt,y={start:f()+r,b:o};o||(y.group=U,U.r+=1),a||d?d=y:(x&&(m(),p=F(e,l,o,s,r,u,x)),o&&b(0,1),a=g(y,s),E((()=>G(e,o,"start"))),h((t=>(d&&t>d.start&&(a=g(d,s),d=null,G(e,a.b,"start"),x&&(m(),p=F(e,l,a.b,a.duration,0,u,c.css))),a&&(a.end>t?a.start>t||(l=a.a+a.d*u((t-a.start)/a.duration),b(l,1-l)):(b(l=a.b,1-l),G(e,a.b,"end"),d||(a.b?m():--a.group.r||i(a.group.c)),a=null)),!(!a&&!d)))))}return{run(t){r(c)?L().then((()=>{c=c(),b(t)})):b(t)},end(){m(),a=d=null}}}function it(t){t&&t.c()}function rt(t,n,e,s){const{u,on_mount:c,on_destroy:l,after_update:a}=t.$$;u&&u.m(n,e),s||E((()=>{const n=c.map(o).filter(r);l?l.push(...n):i(n),t.$$.on_mount=[]})),a.forEach(E)}function st(t,n){const e=t.$$;null!==e.u&&(i(e.on_destroy),e.u&&e.u.d(n),e.on_destroy=e.u=null,e.ctx=[])}function ut(n,e,o,r,s,u,c,l=[-1]){const a=R;D(n);const f=n.$$={u:null,ctx:null,props:u,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:{},l,skip_bound:0,root:e.target||a.$$.root};c&&c(f.root);let d=0;f.ctx=o?o(n,e.props||{},((t,e,...o)=>{const i=o.length?o[0]:e;return f.ctx&&s(f.ctx[t],f.ctx[t]=i)&&(!f.skip_bound&&f.bound[t]&&f.bound[t](i),d&&((t,n)=>{-1===t.$$.l[0]&&(A.push(t),W||(W=1,T.then(B)),t.$$.l.fill(0)),t.$$.l[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 lt(t){const n=t-1;return n*n*n+1}function at(t,{delay:e=0,duration:o=400,g:i=n}={}){const r=+getComputedStyle(t).opacity;return{delay:e,duration:o,g:i,css(t){return"opacity: "+t*r}}}function ft(t,{delay:n=0,duration:e=400,g:o=lt,x:i=0,y:r=0,opacity:s=0}={}){const u=getComputedStyle(t),c=+u.opacity,l="none"===u.transform?"":u.transform,a=c*(1-s);return{delay:n,duration:e,g:o,css(t,n){return`\n\t\t\ttransform: ${l} translate(${(1-t)*i}px, ${(1-t)*r}px);\n\t\t\topacity: ${c-a*n}`}}}const dt=[];function pt(n,e=t){let o;const i=new Set;function r(t){if(r=t,((e=n)!=e?r==r:e!==r||e&&"object"==typeof e||"function"==typeof e)&&(n=t,o)){const t=!dt.length;for(const t of i)t[1](),dt.push(t,n);if(t){for(let t=0;dt.length>t;t+=2)dt[t][0](dt[t+1]);dt.length=0}}var e,r}return{set:r,update(t){r(t(n))},subscribe(s,u=t){const c=[s,u];return i.add(c),1===i.size&&(o=e(r)||t),s(n),()=>{i.delete(c),0===i.size&&(o(),o=null)}}}}function mt(t,n){if(t===n||t!=t)return()=>t;const e=typeof t;if(Array.isArray(t)){const e=n.map(((n,e)=>mt(t[e],n)));return t=>e.map((n=>n(t)))}if("number"===e){const e=n-t;return n=>t+n*e}}function ht(t,o={}){const i=pt(t);let r,s=t;function u(u,c){if(null==t)return i.set(t=u),Promise.resolve();s=u;let l=r,a=0,{delay:d=0,duration:p=400,g:m=n,interpolate:g=mt}=e(e({},o),c);if(0===p)return l&&(l.abort(),l=null),i.set(t=s),Promise.resolve();const b=f()+d;let x;return r=h((n=>{if(b>n)return 1;a||(x=g(t,u),"function"==typeof p&&(p=p(t,u)),a=1),l&&(l.abort(),l=null);const e=n-b;return e>p?(i.set(t=u),0):(i.set(t=x(m(e/p))),1)})),r.promise}return{set:u,update(n,e){return u(n(s,t),e)},subscribe:i.subscribe}}const gt=pt(0),bt=pt(0),xt=matchMedia("(prefers-reduced-motion: reduce)").matches;function yt(t){let n,e,o,i,r=!t[2]&&vt();return{c(){n=v("div"),r&&r.c(),_(n,"class","bp-load"),S(n,"background-image","url("+t[0]+")")},m(t,e){x(t,n,e),r&&r.m(n,null),i=1},p(e,o){(t=e)[2]?r&&(r.d(1),r=null):r||(r=vt(),r.c(),r.m(n,null)),(!i||1&o)&&S(n,"background-image","url("+t[0]+")")},i(r){i||(E((()=>{o&&o.end(1),e=nt(n,at,{duration:t[1]?300:0}),e.start()})),i=1)},o(t){e&&e.invalidate(),t&&(o=et(n,at,{duration:200})),i=0},d(t){t&&y(n),r&&r.d(),t&&o&&o.end()}}}function vt(t){let n,e;return{c(){n=v("span"),e=v("span"),_(n,"class","bp-bar"),_(e,"class","bp-o")},m(t,o){x(t,n,o),x(t,e,o)},d(t){t&&y(n),t&&y(e)}}}function wt(t){let n,e=(!t[1]||t[2])&&yt(t);return{c(){e&&e.c(),n=$()},m(t,o){e&&e.m(t,o),x(t,n,o)},p(t,[o]){!t[1]||t[2]?e?(e.p(t,o),6&o&&Y(e,1)):(e=yt(t),e.c(),Y(e,1),e.m(n.parentNode,n)):e&&(V(),Z(e,1,1,(()=>{e=null})),X())},i(t){Y(e)},o(t){Z(e)},d(t){e&&e.d(t),t&&y(n)}}}function $t(t,n,e){let o;c(t,gt,(t=>e(2,o=t)));let{thumb:i}=n,{loaded:r}=n;return t.$$set=t=>{"thumb"in t&&e(0,i=t.thumb),"loaded"in t&&e(1,r=t.loaded)},[i,r,o]}class kt extends ct{constructor(t){super(),ut(this,t,$t,wt,u,{thumb:0,loaded:1})}}function _t(t){let n,e,o,i,r,s;return{c(){n=v("img"),_(n,"srcset",t[12]),_(n,"sizes",e=t[11].sizes||t[1]+"px"),_(n,"alt",t[14])},m(e,o){x(e,n,o),i=1,r||(s=k(n,"outrostart",t[27]),r=1)},p(t,o){(!i||2&o[0]&&e!==(e=t[11].sizes||t[1]+"px"))&&_(n,"sizes",e)},i(t){i||(o&&o.end(1),i=1)},o(t){o=et(n,at,{}),i=0},d(t){t&&y(n),t&&o&&o.end(),r=0,s()}}}function St(t){let n,e;return n=new kt({props:{thumb:t[13],loaded:t[3]}}),{c(){it(n.$$.u)},m(t,o){rt(n,t,o),e=1},p(t,e){const o={};8&e[0]&&(o.loaded=t[3]),n.$set(o)},i(t){e||(Y(n.$$.u,t),e=1)},o(t){Z(n.$$.u,t),e=0},d(t){st(n,t)}}}function zt(t){let n,e,o,r,s,u,c=t[3]&&_t(t),l=t[4]&&St(t);return{c(){n=v("div"),e=v("div"),c&&c.c(),o=$(),l&&l.c(),_(e,"class","bp-item bp-img"),S(e,"background-image","url("+t[13]+")"),S(e,"width",t[0][0]+"px"),S(e,"height",t[0][1]+"px"),S(e,"transform","translate3d("+t[8][0]+"px, "+t[8][1]+"px, 0px)"),_(n,"class","bp-img-wrap"),z(n,"bp-drag",t[6]),z(n,"bp-close",t[7])},m(i,f){x(i,n,f),g(n,e),c&&c.m(e,null),g(e,o),l&&l.m(e,null),t[28](n),r=1,s||(u=[a(t[21].call(null,e)),k(n,"wheel",t[17]),k(n,"pointerdown",t[18]),k(n,"pointermove",t[19]),k(n,"pointerup",t[20]),k(n,"pointercancel",t[20])],s=1)},p(t,i){t[3]?c?(c.p(t,i),8&i[0]&&Y(c,1)):(c=_t(t),c.c(),Y(c,1),c.m(e,o)):c&&(V(),Z(c,1,1,(()=>{c=null})),X()),t[4]?l?(l.p(t,i),16&i[0]&&Y(l,1)):(l=St(t),l.c(),Y(l,1),l.m(e,null)):l&&(V(),Z(l,1,1,(()=>{l=null})),X()),(!r||1&i[0])&&S(e,"width",t[0][0]+"px"),(!r||1&i[0])&&S(e,"height",t[0][1]+"px"),(!r||256&i[0])&&S(e,"transform","translate3d("+t[8][0]+"px, "+t[8][1]+"px, 0px)"),64&i[0]&&z(n,"bp-drag",t[6]),128&i[0]&&z(n,"bp-close",t[7])},i(t){r||(Y(c),Y(l),r=1)},o(t){Z(c),Z(l),r=0},d(e){e&&y(n),c&&c.d(),l&&l.d(),t[28](null),s=0,i(u)}}}function Mt(t,n,e){let o,i,r,s;c(t,bt,(t=>e(9,i=t))),c(t,gt,(t=>e(10,s=t)));let u,a,f,d,p,m,h,g,b,x,y,v,w,{$}=n,{k}=n,{_}=n,{S}=n,{M:z,I:M,R:I,C:R,opts:C,prev:F,next:P,close:D,F:A,P:H}=$,{inline:O}=C,{img:T,thumb:W,alt:E,width:j,height:q}=z,J=z.maxZoom||C.maxZoom||10,B=+j,K=+q,L=M(B,K),G=L[0],Q=[],U=[],V=0;const X={g:lt,duration:xt?0:400},Y=ht(L,X);c(t,Y,(t=>e(0,r=t)));const Z=ht([0,0],X);c(t,Z,(t=>e(8,o=t)));const tt=([t,n],e=r)=>{const o=(e[0]-k)/2,i=(e[1]-_)/2;return 0>o?t=0:t>o?S?(t=m?o+(t-o)/10:o)>o+20&&F():t=o:-1*o>t&&(S?-1*o-20>(t=m?-1*o-(-1*o-t)/10:-1*o)&&P():t=-1*o),0>i?n=0:n>i?n=i:-1*i>n&&(n=-1*i),[t,n]},nt=(t,n=J)=>{if(p)return;const i=M(B,K),s=i[0]*J,[u,c]=r;let l=u+u*n,a=c+c*n;if(n>0)l>s&&(l=s,a=i[1]*J),l>B&&(l=B,a=K);else if(i[0]>l)return Y.set(i),void Z.set([0,0]);let{x:f,y:d,width:m,height:h}=t.target.getBoundingClientRect();const g=t.clientX-f-m/2,b=t.clientY-d-h/2;f=-1*g*(l/m)+g,d=-1*b*(a/h)+b;const x=[l,a];Y.set(x).then((()=>{e(1,G=Math.round(Math.max(G,l)))})),Z.set(tt([o[0]+f,o[1]+d],x))};return t.$$set=t=>{"$"in t&&e(22,$=t.$),"k"in t&&e(23,k=t.k),"_"in t&&e(24,_=t._),"S"in t&&e(25,S=t.S)},t.$$.update=()=>{67108865&t.$$.l[0]&&l(bt,i=r[0]>L[0],i)},[r,G,u,a,f,p,m,w,o,i,s,C,T,W,E,Y,Z,t=>{O&&!i||(t.preventDefault(),nt(t,t.deltaY/-300))},t=>{if(2!==t.button){t.preventDefault(),e(6,m=1),Q.push(t);const[n,i]=[t.clientX,t.clientY];g=n,b=i,x=o[0],y=o[1]}},t=>{if(Q.length>1)return d=1,e(6,m=0),(t=>{Q=Q.map((n=>n.pointerId==t.pointerId?t:n));const[n,e]=Q,o=Math.hypot(n.clientX-e.clientX,n.clientY-e.clientY);V||(V=o),nt(t,-.015*(V-o)),V=o})(t);if(p||!m)return;let[n,o]=[t.clientX,t.clientY];U.push({x:n,y:o}),n-=g,o-=b,i||(n>40&&F(),-40>n&&P(),-90>o&&!O&&D()),h=Math.hypot(n,o)>10,i&&h&&Z.set(tt([x+n,y+o]),{duration:0})},t=>{if(Q=Q.filter((n=>n.pointerId!=t.pointerId)),d)return d=Q.length?1:0,void(V=0);if(!p&&m){if(t.target===u&&!O)return D();if(e(6,m=0),S?h||(v?(clearTimeout(v),nt(t,i?-5:5),v=0):v=setTimeout((()=>{A(),v=0}),250)):i?h||nt(t,-5):2>U.length&&!i&&nt(t),h){let t;U=U.slice(-3);let n=U[1].x-U[2].x,e=U[1].y-U[2].y;Math.hypot(n,e)>5?(n=U[0].x-U[2].x,e=U[0].y-U[2].y,t=[o[0]-5*n,o[1]-5*e]):t=o,Z.set(tt(t))}h=0,U=[]}},()=>{H((()=>{e(26,L=M(B,K)),S||(Y.set(L),Z.set([0,0]))})),I(z).then((()=>{e(3,a=1),R()})),setTimeout((()=>{e(4,f=!a)}),250)},$,k,_,S,L,()=>{e(5,p=1),s&&i&&!C.intro&&(e(7,w=1),l(Z,o=[0,0],o))},t=>{N[t?"unshift":"push"]((()=>{u=t,e(2,u)}))}]}class It extends ct{constructor(t){super(),ut(this,t,Mt,zt,u,{$:22,k:23,_:24,S:25},null,[-1,-1])}}function Rt(t){let n,e,o,i,r,u,c;return i=new kt({props:{thumb:t[3],loaded:t[0]}}),{c(){var r,u;n=v("div"),e=v("iframe"),it(i.$$.u),_(e,"allow","autoplay; fullscreen"),r=e.src,u=o=t[2],s||(s=document.createElement("a")),s.href=u,r!==s.href&&_(e,"src",o),_(e,"title",t[4]),_(n,"class","bp-item bp-if"),S(n,"width",t[1][0]+"px"),S(n,"height",t[1][1]+"px")},m(o,s){x(o,n,s),g(n,e),rt(i,n,null),r=1,u||(c=k(e,"load",t[6]),u=1)},p(t,[e]){const o={};1&e&&(o.loaded=t[0]),i.$set(o),(!r||2&e)&&S(n,"width",t[1][0]+"px"),(!r||2&e)&&S(n,"height",t[1][1]+"px")},i(t){r||(Y(i.$$.u,t),r=1)},o(t){Z(i.$$.u,t),r=0},d(t){t&&y(n),st(i),u=0,c()}}}function Ct(t,n,e){let o,i,{$:r}=n,{M:s,I:u,P:c}=r,{iframe:l,thumb:a,title:f,width:d,height:p}=s;const m=()=>e(1,i=u(d,p));return m(),c(m),t.$$set=t=>{"$"in t&&e(5,r=t.$)},[o,i,l,a,f,r,()=>e(0,o=1)]}class Ft extends ct{constructor(t){super(),ut(this,t,Ct,Rt,u,{$:5})}}function Pt(t){let n,e,o,i,r;return e=new kt({props:{thumb:t[2],loaded:t[0]}}),{c(){n=v("div"),it(e.$$.u),_(n,"class","bp-item bp-vid"),S(n,"width",t[1][0]+"px"),S(n,"height",t[1][1]+"px"),S(n,"background-image","url("+t[2]+")")},m(s,u){x(s,n,u),rt(e,n,null),o=1,i||(r=a(t[3].call(null,n)),i=1)},p(t,[i]){const r={};1&i&&(r.loaded=t[0]),e.$set(r),(!o||2&i)&&S(n,"width",t[1][0]+"px"),(!o||2&i)&&S(n,"height",t[1][1]+"px")},i(t){o||(Y(e.$$.u,t),o=1)},o(t){Z(e.$$.u,t),o=0},d(t){t&&y(n),st(e),i=0,r()}}}function Dt(t,n,e){let o,i,{$:r}=n,{M:s,I:u,P:c}=r,{sources:l,thumb:a,tracks:f=[],width:d,height:p}=s;const m=()=>e(1,i=u(d,p));m(),c(m);const h=JSON.stringify(l).includes("audio"),b=(t,n)=>{Object.keys(n).forEach((e=>_(t,e,n[e])))};return t.$$set=t=>{"$"in t&&e(4,r=t.$)},[o,i,a,t=>{const n=v(h?"audio":"video");b(n,{controls:1,autoplay:1,playsinline:1,tabindex:"0"});const i=(t,e)=>{Array.isArray(e)||(e=JSON.parse(e)),e.forEach((e=>{const o=v(t);b(o,e),g(n,o)}))};i("track",f),i("source",l),k(n,"canplay",(()=>e(0,o=1))),t.prepend(n)},r]}class At extends ct{constructor(t){super(),ut(this,t,Dt,Pt,u,{$:4})}}let Nt,Ht,{documentElement:Ot,body:Tt}=document;function Wt(n){let e,o,i,r,s,c,l,f,d=n[7].i,p=Kt(n),m=(!n[12]||!n[11])&&Lt(n);return{c(){e=v("div"),o=v("div"),p.c(),r=$(),m&&m.c(),_(e,"class","bp-wrap"),z(e,"zoomed",n[15]),z(e,"bp-inline",n[13])},m(t,i){x(t,e,i),g(e,o),p.m(e,null),g(e,r),m&&m.m(e,null),n[30](e),c=1,l||(f=a(s=n[23].call(null,e)),l=1)},p(o,i){n=o,128&i[0]&&u(d,d=n[7].i)?(V(),Z(p,1,1,t),X(),p=Kt(n),p.c(),Y(p),p.m(e,r)):p.p(n,i),n[12]&&n[11]?m&&(V(),Z(m,1,1,(()=>{m=null})),X()):m?(m.p(n,i),6144&i[0]&&Y(m,1)):(m=Lt(n),m.c(),Y(m,1),m.m(e,null)),32768&i[0]&&z(e,"zoomed",n[15]),8192&i[0]&&z(e,"bp-inline",n[13])},i(t){c||(E((()=>{i||(i=ot(o,at,{g:lt,duration:480},1)),i.run(1)})),Y(p),Y(m),c=1)},o(t){i||(i=ot(o,at,{g:lt,duration:480},0)),i.run(0),Z(p),Z(m),c=0},d(t){t&&y(e),t&&i&&i.end(),p.d(t),m&&m.d(),n[30](null),l=0,f()}}}function Et(n){let e,o,i=n[7].html+"";return{c(){e=new M,o=$(),e.a=o},m(t,n){e.m(i,t,n),x(t,o,n)},p(t,n){128&n[0]&&i!==(i=t[7].html+"")&&e.p(i)},i:t,o:t,d(t){t&&y(o),t&&e.d()}}}function jt(t){let n,e;return n=new Ft({props:{$:{M:t[7],I:t[17],P:t[16]}}}),{c(){it(n.$$.u)},m(t,o){rt(n,t,o),e=1},p(t,e){const o={};128&e[0]&&(o.$={M:t[7],I:t[17],P:t[16]}),n.$set(o)},i(t){e||(Y(n.$$.u,t),e=1)},o(t){Z(n.$$.u,t),e=0},d(t){st(n,t)}}}function qt(t){let n,e;return n=new At({props:{$:{M:t[7],I:t[17],P:t[16]}}}),{c(){it(n.$$.u)},m(t,o){rt(n,t,o),e=1},p(t,e){const o={};128&e[0]&&(o.$={M:t[7],I:t[17],P:t[16]}),n.$set(o)},i(t){e||(Y(n.$$.u,t),e=1)},o(t){Z(n.$$.u,t),e=0},d(t){st(n,t)}}}function Jt(t){let n,e;return n=new It({props:{$:{M:t[7],I:t[17],R:t[19],C:t[18],opts:t[5],prev:t[2],next:t[3],close:t[1],F:t[22],P:t[16]},k:t[9],_:t[10],S:t[12]}}),{c(){it(n.$$.u)},m(t,o){rt(n,t,o),e=1},p(t,e){const o={};160&e[0]&&(o.$={M:t[7],I:t[17],R:t[19],C:t[18],opts:t[5],prev:t[2],next:t[3],close:t[1],F:t[22],P:t[16]}),512&e[0]&&(o.k=t[9]),1024&e[0]&&(o._=t[10]),4096&e[0]&&(o.S=t[12]),n.$set(o)},i(t){e||(Y(n.$$.u,t),e=1)},o(t){Z(n.$$.u,t),e=0},d(t){st(n,t)}}}function Bt(t){let n,e,o,i=t[7].caption+"";return{c(){n=v("div"),_(n,"class","bp-cap")},m(t,e){x(t,n,e),n.innerHTML=i,o=1},p(t,e){(!o||128&e[0])&&i!==(i=t[7].caption+"")&&(n.innerHTML=i)},i(t){o||(E((()=>{e||(e=ot(n,at,{duration:200},1)),e.run(1)})),o=1)},o(t){e||(e=ot(n,at,{duration:200},0)),e.run(0),o=0},d(t){t&&y(n),t&&e&&e.end()}}}function Kt(t){let n,e,o,r,s,u,c,l,a;const f=[Jt,qt,jt,Et],d=[];function p(t,n){return t[7].img?0:t[7].sources?1:t[7].iframe?2:3}e=p(t),o=d[e]=f[e](t);let m=t[7].caption&&Bt(t);return{c(){n=v("div"),o.c(),m&&m.c(),u=$(),_(n,"class","bp-inner"),z(n,"bp-html",t[8])},m(o,i){var r;x(o,n,i),d[e].m(n,null),m&&m.m(o,i),x(o,u,i),c=1,l||(a=[k(n,"pointerdown",t[28]),k(n,"pointerup",(r=t[29],function(t){t.target===this&&r.call(this,t)}))],l=1)},p(t,i){let r=e;e=p(t),e===r?d[e].p(t,i):(V(),Z(d[r],1,1,(()=>{d[r]=null})),X(),o=d[e],o?o.p(t,i):(o=d[e]=f[e](t),o.c()),Y(o,1),o.m(n,null)),256&i[0]&&z(n,"bp-html",t[8]),t[7].caption?m?(m.p(t,i),128&i[0]&&Y(m,1)):(m=Bt(t),m.c(),Y(m,1),m.m(u.parentNode,u)):m&&(V(),Z(m,1,1,(()=>{m=null})),X())},i(e){c||(Y(o),E((()=>{s&&s.end(1),r=nt(n,t[20],{}),r.start()})),Y(m),c=1)},o(e){Z(o),r&&r.invalidate(),s=et(n,t[21],{}),Z(m),c=0},d(t){t&&y(n),d[e].d(),t&&s&&s.end(),m&&m.d(t),t&&y(u),l=0,i(a)}}}function Lt(t){let n,e,o,i,r=!t[5].noClose&&Gt(t),s=t[0].length>1&&Qt(t);return{c(){n=v("div"),r&&r.c(),e=$(),s&&s.c(),_(n,"class","bp-controls")},m(t,o){x(t,n,o),r&&r.m(n,null),g(n,e),s&&s.m(n,null),i=1},p(t,o){t[5].noClose?r&&(r.d(1),r=null):r?r.p(t,o):(r=Gt(t),r.c(),r.m(n,e)),t[0].length>1?s?s.p(t,o):(s=Qt(t),s.c(),s.m(n,null)):s&&(s.d(1),s=null)},i(t){i||(E((()=>{o||(o=ot(n,at,{duration:300},1)),o.run(1)})),i=1)},o(t){o||(o=ot(n,at,{duration:300},0)),o.run(0),i=0},d(t){t&&y(n),r&&r.d(),s&&s.d(),t&&o&&o.end()}}}function Gt(n){let e,o,i;return{c(){e=v("button"),_(e,"class","bp-x"),_(e,"title","Close"),_(e,"aria-label","Close")},m(t,r){x(t,e,r),o||(i=k(e,"click",n[1]),o=1)},p:t,d(t){t&&y(e),o=0,i()}}}function Qt(t){let n,e,o,r,s,u,c=`${t[4]+1} / ${t[0].length}`;return{c(){n=v("div"),e=w(c),o=v("button"),r=v("button"),_(n,"class","bp-count"),_(o,"class","bp-prev"),_(o,"title","Previous"),_(o,"aria-label","Previous"),_(r,"class","bp-next"),_(r,"title","Next"),_(r,"aria-label","Next")},m(i,c){x(i,n,c),g(n,e),x(i,o,c),x(i,r,c),s||(u=[k(o,"click",t[2]),k(r,"click",t[3])],s=1)},p(t,n){17&n[0]&&c!==(c=`${t[4]+1} / ${t[0].length}`)&&((t,n)=>{t.wholeText!==(n=""+n)&&(t.data=n)})(e,c)},d(t){t&&y(n),t&&y(o),t&&y(r),s=0,i(u)}}}function Ut(t){let n,e,o=t[0]&&Wt(t);return{c(){o&&o.c(),n=$()},m(t,i){o&&o.m(t,i),x(t,n,i),e=1},p(t,e){t[0]?o?(o.p(t,e),1&e[0]&&Y(o,1)):(o=Wt(t),o.c(),Y(o,1),o.m(n.parentNode,n)):o&&(V(),Z(o,1,1,(()=>{o=null})),X())},i(t){e||(Y(o),e=1)},o(t){Z(o),e=0},d(t){o&&o.d(t),t&&y(n)}}}function Vt(t,n,e){let o,i;c(t,gt,(t=>e(34,o=t))),c(t,bt,(t=>e(15,i=t)));let r,s,u,a,f,d,p,m,h,g,b,x,y,w,$,{items:_}=n,{target:S}=n;const z=t=>$=t,M=()=>{const t=s.items;a=document.activeElement,e(9,d=S.offsetWidth),e(10,p=S===document.body?window.innerHeight:S.clientHeight),e(12,h=769>d),e(4,r=s.position||0),e(11,m=0),e(0,_=Array.isArray(t)?t.map(((t,n)=>({...t,i:n}))):[...t.length?t:[t]].map(((t,n)=>(t===s.el&&e(4,r=n),{element:t,i:n,...t.dataset}))))},I=()=>{s.noClose||(s.onClose&&s.onClose(),l(gt,o=1,o),e(0,_=0),a&&a.focus({preventScroll:1}))},R=()=>F(r-1),C=()=>F(r+1),F=t=>{b=t-r,e(4,r=P(t))},P=t=>(_.length>t?0>t&&(t=_.length-1):t=0,t),D=t=>{const{key:n,shiftKey:e}=t;if("Escape"===n)I();else if("ArrowRight"===n)C();else if("ArrowLeft"===n)R();else if("Tab"===n){const{activeElement:n}=document;if(e||!n.controls){t.preventDefault();const o=[...(s.focusWrap||f).querySelectorAll("*")].filter((t=>t.tabIndex>=0));let i=o.indexOf(n);i+=o.length+(e?-1:1),i%=o.length,o[i].focus()}}},A=(t,n)=>{const e=s.scale||.99;let o,i;const r=(n=n||1080)/(t=t||1920);return r>p/d?(i=Math.min(n,p*e),o=i/r):(o=Math.min(t,d*e),i=o*r),[Math.round(o),Math.round(i)]},H=t=>{const{img:n,width:e,height:o}=t;if(!n)return;const i=v("img");return i.sizes=s.sizes||A(e,o)[0]+"px",i.srcset=n,t.preload=i,i.decode()},O=t=>{const{element:n}=y,e=t.querySelector(".bp-item"),{clientWidth:o,clientHeight:i}=e,{top:r,left:s,width:u,height:c}=n.getBoundingClientRect(),l=s-(d-u)/2,a=r-(p-c)/2,f=n.clientWidth/o,m=n.clientHeight/i;return{duration:480,g:lt,css(t){const n=1-t;return`transform:translate3d(${l*n}px, ${a*n}px, 0px) scale3d(${f+t*(1-f)}, ${m+t*(1-m)}, 1)`}}};return t.$$set=t=>{"items"in t&&e(0,_=t.items),"target"in t&&e(24,S=t.target)},t.$$.update=()=>{134218225&t.$$.l[0]&&_&&(e(7,y=_[r]),u&&(e(8,w=y.hasOwnProperty("html")),w&&z(null),s.onUpdate&&s.onUpdate(f,y)))},[_,I,R,C,r,s,f,y,w,d,p,m,h,g,x,i,z,A,()=>{const t=_[P(r+1)],n=_[P(r-1)];t&&!t.preload&&H(t),n&&!n.preload&&H(n)},H,t=>u?ft(t,{x:b>0?20:-20,g:lt,duration:250}):(e(27,u=1),s.onOpen&&s.onOpen(f,y),s.intro?ft(t,{y:10,g:lt}):O(t)),t=>_?ft(t,{x:b>0?-20:20,g:lt,duration:250}):s.intro?ft(t,{y:-10,g:lt}):O(t),()=>e(11,m=!m),t=>{let n,i;g||(n=k(window,"keydown",D));const r=new ResizeObserver((t=>{i&&(e(9,d=t[0].contentRect.width),e(10,p=t[0].contentRect.height),e(12,h=769>d),$&&$(),s.onResize&&s.onResize(f,y)),i=1}));return r.observe(t),{destroy(){r.disconnect(),n&&n(),l(gt,o=e(27,u=0),o),Ot.style.overflowY=Nt,Tt.style.overflowY=Nt,s.onClosed&&s.onClosed()}}},S,t=>{e(5,s=t),e(13,g=s.inline),g||Ot.scrollHeight>Ot.clientHeight&&(Nt=Nt||getComputedStyle(Ot).overflowY,Ht=Ht||getComputedStyle(Tt).overflowY,Ot.style.overflowY="hidden",Tt.style.overflowY="scroll"),setTimeout(M,0)},F,u,({target:t})=>e(14,x=t),t=>{2!==t.button&&t.target===x&&I()},t=>{N[t?"unshift":"push"]((()=>{f=t,e(6,f)}))}]}class Xt extends ct{constructor(t){super(),ut(this,t,Vt,Ut,u,{items:0,target:24,open:25,close:1,prev:2,next:3,setPosition:26},null,[-1,-1])}get items(){return this.$$.ctx[0]}get target(){return this.$$.ctx[24]}get open(){return this.$$.ctx[25]}get close(){return this.$$.ctx[1]}get prev(){return this.$$.ctx[2]}get next(){return this.$$.ctx[3]}get setPosition(){return this.$$.ctx[26]}}return t=>new Xt({...t,props: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 i(t){return t()}function o(t){t.forEach(i)}function r(t){return"function"==typeof t}let s;function u(t,n){return t!=t?n==n:t!==n}function c(n,e,i){n.$$.on_destroy.push(((n,...e)=>{if(null==n)return t;const i=n.subscribe(...e);return i.unsubscribe?()=>i.unsubscribe():i})(e,i))}function l(t,n,e){return t.set(e),n}function a(n){return n&&r(n.destroy)?n.destroy:t}let f=()=>window.performance.now(),d=t=>requestAnimationFrame(t);const p=new Set;function m(t){p.forEach((n=>{n.c(t)||(p.delete(n),n.f())})),0!==p.size&&d(m)}function h(t){let n;return 0===p.size&&d(m),{promise:new Promise((e=>{p.add(n={c:t,f:e})})),abort(){p.delete(n)}}}function g(t,n){t.appendChild(n)}function b(t){const n=w("style");return((t,n)=>{g(t.head||t,n)})(document,n),n.sheet}function x(t,n,e){t.insertBefore(n,e||null)}function y(t){t.parentNode.removeChild(t)}function w(t){return document.createElement(t)}function v(t){return document.createTextNode(t)}function $(){return v("")}function k(t,n,e,i){return t.addEventListener(n,e,i),()=>t.removeEventListener(n,e,i)}function _(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function S(t,n,e,i){null===e?t.style.removeProperty(n):t.style.setProperty(n,e,i?"important":"")}function z(t,n,e){t.classList[e?"add":"remove"](n)}class M{constructor(){this.e=this.n=null}c(t){this.h(t)}m(t,n,e=null){this.e||(this.e=w(n.nodeName),this.t=n,this.c(t)),this.i(e)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.childNodes)}i(t){for(let n=0;this.n.length>n;n+=1)x(this.t,this.n[n],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(y)}}const I=new Map;let R,C=0;function F(t,n,e,i,o,r,s,u=0){const c=16.666/i;let l="{\n";for(let t=0;1>=t;t+=c){const i=n+(e-n)*r(t);l+=100*t+`%{${s(i,1-i)}}\n`}const a=l+`100% {${s(e,1-e)}}\n}`,f=`__svelte_${(t=>{let n=5381,e=t.length;for(;e--;)n=(n<<5)-n^t.charCodeAt(e);return n>>>0})(a)}_${u}`,d=document,{stylesheet:p,rules:m}=I.get(d)||((t,n)=>{const e={stylesheet:b(),rules:{}};return I.set(t,e),e})(d);m[f]||(m[f]=1,p.insertRule(`@keyframes ${f} ${a}`,p.cssRules.length));const h=t.style.animation||"";return t.style.animation=`${h?h+", ":""}${f} ${i}ms linear ${o}ms 1 both`,C+=1,f}function P(t,n){const e=(t.style.animation||"").split(", "),i=e.filter(n?t=>0>t.indexOf(n):t=>-1===t.indexOf("__svelte")),o=e.length-i.length;o&&(t.style.animation=i.join(", "),C-=o,C||d((()=>{C||(I.forEach((t=>{const{stylesheet:n}=t;let e=n.cssRules.length;for(;e--;)n.deleteRule(e);t.rules={}})),I.clear())})))}function D(t){R=t}const A=[],N=[],H=[],O=[],T=Promise.resolve();let W=0;function E(t){H.push(t)}const j=new Set;let q,J=0;function B(){const t=R;do{for(;A.length>J;){const t=A[J];J++,D(t),K(t.$$)}for(D(null),A.length=0,J=0;N.length;)N.pop()();for(let t=0;H.length>t;t+=1){const n=H[t];j.has(n)||(j.add(n),n())}H.length=0}while(A.length);for(;O.length;)O.pop()();W=0,j.clear(),D(t)}function K(t){if(null!==t.u){t.update(),o(t.before_update);const n=t.l;t.l=[-1],t.u&&t.u.p(t.ctx,n),t.after_update.forEach(E)}}function L(){return q||(q=Promise.resolve(),q.then((()=>{q=null}))),q}function G(t,n,e){t.dispatchEvent(((t,n,e=0)=>{const i=document.createEvent("CustomEvent");return i.initCustomEvent(t,e,0,n),i})(`${n?"intro":"outro"}${e}`))}const Q=new Set;let U;function V(){U={r:0,c:[],p:U}}function X(){U.r||o(U.c),U=U.p}function Y(t,n){t&&t.i&&(Q.delete(t),t.i(n))}function Z(t,n,e,i){if(t&&t.o){if(Q.has(t))return;Q.add(t),U.c.push((()=>{Q.delete(t),i&&(e&&t.d(1),i())})),t.o(n)}}const tt={duration:0};function nt(e,i,o){let s,u,c=i(e,o),l=0,a=0;function d(){s&&P(e,s)}function p(){const{delay:i=0,duration:o=300,g:r=n,v:p=t,css:m}=c||tt;m&&(s=F(e,0,1,o,i,r,m,a++)),p(0,1);const g=f()+i,b=g+o;u&&u.abort(),l=1,E((()=>G(e,1,"start"))),u=h((t=>{if(l){if(t>=b)return p(1,0),G(e,1,"end"),d(),l=0;if(t>=g){const n=r((t-g)/o);p(n,1-n)}}return l}))}let m=0;return{start(){m||(m=1,P(e),r(c)?(c=c(),L().then(p)):p())},invalidate(){m=0},end(){l&&(d(),l=0)}}}function et(e,i,s){let u,c=i(e,s),l=1;const a=U;function d(){const{delay:i=0,duration:r=300,g:s=n,v:d=t,css:p}=c||tt;p&&(u=F(e,1,0,r,i,s,p));const m=f()+i,g=m+r;E((()=>G(e,0,"start"))),h((t=>{if(l){if(t>=g)return d(0,1),G(e,0,"end"),--a.r||o(a.c),0;if(t>=m){const n=s((t-m)/r);d(1-n,n)}}return l}))}return a.r+=1,r(c)?L().then((()=>{c=c(),d()})):d(),{end(t){t&&c.v&&c.v(1,0),l&&(u&&P(e,u),l=0)}}}function it(e,i,s,u){let c=i(e,s),l=u?0:1,a=null,d=null,p=null;function m(){p&&P(e,p)}function g(t,n){const e=t.b-l;return{a:l,b:t.b,d:e,duration:n*=Math.abs(e),start:t.start,end:t.start+n,group:t.group}}function b(i){const{delay:r=0,duration:s=300,g:u=n,v:b=t,css:x}=c||tt,y={start:f()+r,b:i};i||(y.group=U,U.r+=1),a||d?d=y:(x&&(m(),p=F(e,l,i,s,r,u,x)),i&&b(0,1),a=g(y,s),E((()=>G(e,i,"start"))),h((t=>(d&&t>d.start&&(a=g(d,s),d=null,G(e,a.b,"start"),x&&(m(),p=F(e,l,a.b,a.duration,0,u,c.css))),a&&(a.end>t?a.start>t||(l=a.a+a.d*u((t-a.start)/a.duration),b(l,1-l)):(b(l=a.b,1-l),G(e,a.b,"end"),d||(a.b?m():--a.group.r||o(a.group.c)),a=null)),!(!a&&!d)))))}return{run(t){r(c)?L().then((()=>{c=c(),b(t)})):b(t)},end(){m(),a=d=null}}}function ot(t){t&&t.c()}function rt(t,n,e,s){const{u,on_mount:c,on_destroy:l,after_update:a}=t.$$;u&&u.m(n,e),s||E((()=>{const n=c.map(i).filter(r);l?l.push(...n):o(n),t.$$.on_mount=[]})),a.forEach(E)}function st(t,n){const e=t.$$;null!==e.u&&(o(e.on_destroy),e.u&&e.u.d(n),e.on_destroy=e.u=null,e.ctx=[])}function ut(n,e,i,r,s,u,c,l=[-1]){const a=R;D(n);const f=n.$$={u:null,ctx:null,props:u,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:{},l,skip_bound:0,root:e.target||a.$$.root};c&&c(f.root);let d=0;f.ctx=i?i(n,e.props||{},((t,e,...i)=>{const o=i.length?i[0]:e;return f.ctx&&s(f.ctx[t],f.ctx[t]=o)&&(!f.skip_bound&&f.bound[t]&&f.bound[t](o),d&&((t,n)=>{-1===t.$$.l[0]&&(A.push(t),W||(W=1,T.then(B)),t.$$.l.fill(0)),t.$$.l[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 lt(t){const n=t-1;return n*n*n+1}function at(t,{delay:e=0,duration:i=400,g:o=n}={}){const r=+getComputedStyle(t).opacity;return{delay:e,duration:i,g:o,css(t){return"opacity: "+t*r}}}function ft(t,{delay:n=0,duration:e=400,g:i=lt,x:o=0,y:r=0,opacity:s=0}={}){const u=getComputedStyle(t),c=+u.opacity,l="none"===u.transform?"":u.transform,a=c*(1-s);return{delay:n,duration:e,g:i,css(t,n){return`\n\t\t\ttransform: ${l} translate(${(1-t)*o}px, ${(1-t)*r}px);\n\t\t\topacity: ${c-a*n}`}}}const dt=[];function pt(n,e=t){let i;const o=new Set;function r(t){if(r=t,((e=n)!=e?r==r:e!==r||e&&"object"==typeof e||"function"==typeof e)&&(n=t,i)){const t=!dt.length;for(const t of o)t[1](),dt.push(t,n);if(t){for(let t=0;dt.length>t;t+=2)dt[t][0](dt[t+1]);dt.length=0}}var e,r}return{set:r,update(t){r(t(n))},subscribe(s,u=t){const c=[s,u];return o.add(c),1===o.size&&(i=e(r)||t),s(n),()=>{o.delete(c),0===o.size&&(i(),i=null)}}}}function mt(t,n){if(t===n||t!=t)return()=>t;const e=typeof t;if(Array.isArray(t)){const e=n.map(((n,e)=>mt(t[e],n)));return t=>e.map((n=>n(t)))}if("number"===e){const e=n-t;return n=>t+n*e}}function ht(t,i={}){const o=pt(t);let r,s=t;function u(u,c){if(null==t)return o.set(t=u),Promise.resolve();s=u;let l=r,a=0,{delay:d=0,duration:p=400,g:m=n,interpolate:g=mt}=e(e({},i),c);if(0===p)return l&&(l.abort(),l=null),o.set(t=s),Promise.resolve();const b=f()+d;let x;return r=h((n=>{if(b>n)return 1;a||(x=g(t,u),"function"==typeof p&&(p=p(t,u)),a=1),l&&(l.abort(),l=null);const e=n-b;return e>p?(o.set(t=u),0):(o.set(t=x(m(e/p))),1)})),r.promise}return{set:u,update(n,e){return u(n(s,t),e)},subscribe:o.subscribe}}const gt=pt(0),bt=pt(0),xt=matchMedia("(prefers-reduced-motion: reduce)").matches;function yt(t){let n,e,i,o,r=!t[2]&&wt();return{c(){n=w("div"),r&&r.c(),_(n,"class","bp-load"),S(n,"background-image","url("+t[0]+")")},m(t,e){x(t,n,e),r&&r.m(n,null),o=1},p(e,i){(t=e)[2]?r&&(r.d(1),r=null):r||(r=wt(),r.c(),r.m(n,null)),(!o||1&i)&&S(n,"background-image","url("+t[0]+")")},i(r){o||(E((()=>{i&&i.end(1),e=nt(n,at,{duration:t[1]?300:0}),e.start()})),o=1)},o(t){e&&e.invalidate(),t&&(i=et(n,at,{duration:200})),o=0},d(t){t&&y(n),r&&r.d(),t&&i&&i.end()}}}function wt(t){let n,e;return{c(){n=w("span"),e=w("span"),_(n,"class","bp-bar"),_(e,"class","bp-o")},m(t,i){x(t,n,i),x(t,e,i)},d(t){t&&y(n),t&&y(e)}}}function vt(t){let n,e=(!t[1]||t[2])&&yt(t);return{c(){e&&e.c(),n=$()},m(t,i){e&&e.m(t,i),x(t,n,i)},p(t,[i]){!t[1]||t[2]?e?(e.p(t,i),6&i&&Y(e,1)):(e=yt(t),e.c(),Y(e,1),e.m(n.parentNode,n)):e&&(V(),Z(e,1,1,(()=>{e=null})),X())},i(t){Y(e)},o(t){Z(e)},d(t){e&&e.d(t),t&&y(n)}}}function $t(t,n,e){let i;c(t,gt,(t=>e(2,i=t)));let{thumb:o}=n,{loaded:r}=n;return t.$$set=t=>{"thumb"in t&&e(0,o=t.thumb),"loaded"in t&&e(1,r=t.loaded)},[o,r,i]}class kt extends ct{constructor(t){super(),ut(this,t,$t,vt,u,{thumb:0,loaded:1})}}function _t(t){let n,e,i,o;return{c(){n=w("img"),_(n,"srcset",t[8]),_(n,"sizes",e=t[7].sizes||t[1]+"px"),_(n,"alt",t[10])},m(t,e){x(t,n,e),o=1},p(t,i){(!o||2&i[0]&&e!==(e=t[7].sizes||t[1]+"px"))&&_(n,"sizes",e)},i(t){o||(i&&i.end(1),o=1)},o(t){i=et(n,at,{}),o=0},d(t){t&&y(n),t&&i&&i.end()}}}function St(t){let n,e;return n=new kt({props:{thumb:t[9],loaded:t[2]}}),{c(){ot(n.$$.u)},m(t,i){rt(n,t,i),e=1},p(t,e){const i={};4&e[0]&&(i.loaded=t[2]),n.$set(i)},i(t){e||(Y(n.$$.u,t),e=1)},o(t){Z(n.$$.u,t),e=0},d(t){st(n,t)}}}function zt(t){let n,e,i,r,s,u,c=t[2]&&_t(t),l=t[3]&&St(t);return{c(){n=w("div"),e=w("div"),c&&c.c(),i=$(),l&&l.c(),_(e,"class","bp-item bp-img"),S(e,"background-image","url("+t[9]+")"),S(e,"width",t[0][0]+"px"),S(e,"height",t[0][1]+"px"),S(e,"transform","translate3d("+t[6][0]+"px, "+t[6][1]+"px, 0px)"),_(n,"class","bp-img-wrap"),z(n,"bp-drag",t[4]),z(n,"bp-close",t[5])},m(o,f){x(o,n,f),g(n,e),c&&c.m(e,null),g(e,i),l&&l.m(e,null),r=1,s||(u=[a(t[17].call(null,n)),k(n,"wheel",t[13]),k(n,"pointerdown",t[14]),k(n,"pointermove",t[15]),k(n,"pointerup",t[16]),k(n,"pointercancel",t[16])],s=1)},p(t,o){t[2]?c?(c.p(t,o),4&o[0]&&Y(c,1)):(c=_t(t),c.c(),Y(c,1),c.m(e,i)):c&&(V(),Z(c,1,1,(()=>{c=null})),X()),t[3]?l?(l.p(t,o),8&o[0]&&Y(l,1)):(l=St(t),l.c(),Y(l,1),l.m(e,null)):l&&(V(),Z(l,1,1,(()=>{l=null})),X()),(!r||1&o[0])&&S(e,"width",t[0][0]+"px"),(!r||1&o[0])&&S(e,"height",t[0][1]+"px"),(!r||64&o[0])&&S(e,"transform","translate3d("+t[6][0]+"px, "+t[6][1]+"px, 0px)"),16&o[0]&&z(n,"bp-drag",t[4]),32&o[0]&&z(n,"bp-close",t[5])},i(t){r||(Y(c),Y(l),r=1)},o(t){Z(c),Z(l),r=0},d(t){t&&y(n),c&&c.d(),l&&l.d(),s=0,o(u)}}}function Mt(t,n,e){let i,o,r,s;c(t,bt,(t=>e(23,o=t))),c(t,gt,(t=>e(24,r=t)));let u,a,f,d,p,m,h,g,b,x,y,{$:w}=n,{k:v}=n,{_:$}=n,{S:k}=n,{M:_,I:S,R:z,C:M,opts:I,prev:R,next:C,close:F,F:P,P:D}=w,{inline:A}=I,{img:N,thumb:H,alt:O,width:T,height:W}=_,E=_.maxZoom||I.maxZoom||10,j=+T,q=+W,J=S(j,q),B=J[0],K=[],L=[],G=0;const Q={g:lt,duration:xt?0:400},U=ht(J,Q);c(t,U,(t=>e(0,s=t)));const V=ht([0,0],Q);c(t,V,(t=>e(6,i=t)));const X=([t,n],e=s)=>{const i=(e[0]-v)/2,o=(e[1]-$)/2;return 0>i?t=0:t>i?k?(t=d?i+(t-i)/10:i)>i+20&&R():t=i:-1*i>t&&(k?-1*i-20>(t=d?-1*i-(-1*i-t)/10:-1*i)&&C():t=-1*i),0>o?n=0:n>o?n=o:-1*o>n&&(n=-1*o),[t,n]},Y=(t,n=E)=>{if(r)return;const o=S(j,q),u=o[0]*E,[c,l]=s;let a=c+c*n,f=l+l*n;if(n>0)a>u&&(a=u,f=o[1]*E),a>j&&(a=j,f=q);else if(o[0]>a)return U.set(o),void V.set([0,0]);let{x:d,y:p,width:m,height:h}=t.target.getBoundingClientRect();const g=t.clientX-d-m/2,b=t.clientY-p-h/2;d=-1*g*(a/m)+g,p=-1*b*(f/h)+b;const x=[a,f];U.set(x).then((()=>{e(1,B=Math.round(Math.max(B,a)))})),V.set(X([i[0]+d,i[1]+p],x))};return t.$$set=t=>{"$"in t&&e(18,w=t.$),"k"in t&&e(19,v=t.k),"_"in t&&e(20,$=t._),"S"in t&&e(21,k=t.S)},t.$$.update=()=>{4194305&t.$$.l[0]&&l(bt,o=s[0]>J[0],o),25165824&t.$$.l[0]&&r&&o&&!I.intro&&(e(5,y=1),V.set([0,0]))},[s,B,u,a,d,y,i,I,N,H,O,U,V,t=>{A&&!o||(t.preventDefault(),Y(t,t.deltaY/-300))},t=>{if(2!==t.button){t.preventDefault(),e(4,d=1),K.push(t);const[n,o]=[t.clientX,t.clientY];m=n,h=o,g=i[0],b=i[1]}},t=>{if(K.length>1)return f=1,e(4,d=0),(t=>{K=K.map((n=>n.pointerId==t.pointerId?t:n));const[n,e]=K,i=Math.hypot(n.clientX-e.clientX,n.clientY-e.clientY);G||(G=i),Y(t,-.02*(G-i)),G=i})(t);if(!d)return;let[n,i]=[t.clientX,t.clientY];L.push({x:n,y:i}),n-=m,i-=h,o||(n>40&&e(4,d=R()),-40>n&&e(4,d=C()),-90>i&&!A&&F()),p=Math.hypot(n,i)>10,o&&p&&!r&&V.set(X([g+n,b+i]),{duration:0})},function(t){if(K=K.filter((n=>n.pointerId!=t.pointerId)),f)return f=K.length?1:0,void(G=0);if(d){if(t.target===this&&!A)return F();if(e(4,d=0),k?p||(x?(clearTimeout(x),Y(t,o?-5:5),x=0):x=setTimeout((()=>{P(),x=0}),250)):o?p||Y(t,-5):2>L.length&&!o&&Y(t),p){let t;L=L.slice(-3);let n=L[1].x-L[2].x,e=L[1].y-L[2].y;Math.hypot(n,e)>5?(n=L[0].x-L[2].x,e=L[0].y-L[2].y,t=[i[0]-5*n,i[1]-5*e]):t=i,V.set(X(t))}p=0,L=[]}},()=>{D((()=>{e(22,J=S(j,q)),U.set(J),V.set([0,0])})),z(_).then((()=>{e(2,u=1),M()})),setTimeout((()=>{e(3,a=!u)}),250)},w,v,$,k,J,o,r]}class It extends ct{constructor(t){super(),ut(this,t,Mt,zt,u,{$:18,k:19,_:20,S:21},null,[-1,-1])}}function Rt(t){let n,e,i,o,r,u,c;return o=new kt({props:{thumb:t[3],loaded:t[0]}}),{c(){var r,u;n=w("div"),e=w("iframe"),ot(o.$$.u),_(e,"allow","autoplay; fullscreen"),r=e.src,u=i=t[2],s||(s=document.createElement("a")),s.href=u,r!==s.href&&_(e,"src",i),_(e,"title",t[4]),_(n,"class","bp-item bp-if"),S(n,"width",t[1][0]+"px"),S(n,"height",t[1][1]+"px")},m(i,s){x(i,n,s),g(n,e),rt(o,n,null),r=1,u||(c=k(e,"load",t[6]),u=1)},p(t,[e]){const i={};1&e&&(i.loaded=t[0]),o.$set(i),(!r||2&e)&&S(n,"width",t[1][0]+"px"),(!r||2&e)&&S(n,"height",t[1][1]+"px")},i(t){r||(Y(o.$$.u,t),r=1)},o(t){Z(o.$$.u,t),r=0},d(t){t&&y(n),st(o),u=0,c()}}}function Ct(t,n,e){let i,o,{$:r}=n,{M:s,I:u,P:c}=r,{iframe:l,thumb:a,title:f,width:d,height:p}=s;const m=()=>e(1,o=u(d,p));return m(),c(m),t.$$set=t=>{"$"in t&&e(5,r=t.$)},[i,o,l,a,f,r,()=>e(0,i=1)]}class Ft extends ct{constructor(t){super(),ut(this,t,Ct,Rt,u,{$:5})}}function Pt(t){let n,e,i,o,r;return e=new kt({props:{thumb:t[2],loaded:t[0]}}),{c(){n=w("div"),ot(e.$$.u),_(n,"class","bp-item bp-vid"),S(n,"width",t[1][0]+"px"),S(n,"height",t[1][1]+"px"),S(n,"background-image","url("+t[2]+")")},m(s,u){x(s,n,u),rt(e,n,null),i=1,o||(r=a(t[3].call(null,n)),o=1)},p(t,[o]){const r={};1&o&&(r.loaded=t[0]),e.$set(r),(!i||2&o)&&S(n,"width",t[1][0]+"px"),(!i||2&o)&&S(n,"height",t[1][1]+"px")},i(t){i||(Y(e.$$.u,t),i=1)},o(t){Z(e.$$.u,t),i=0},d(t){t&&y(n),st(e),o=0,r()}}}function Dt(t,n,e){let i,o,{$:r}=n,{M:s,I:u,P:c}=r,{sources:l,thumb:a,tracks:f=[],width:d,height:p}=s;const m=()=>e(1,o=u(d,p));m(),c(m);const h=JSON.stringify(l).includes("audio"),b=(t,n)=>{Object.keys(n).forEach((e=>_(t,e,n[e])))};return t.$$set=t=>{"$"in t&&e(4,r=t.$)},[i,o,a,t=>{const n=w(h?"audio":"video");b(n,{controls:1,autoplay:1,playsinline:1,tabindex:"0"});const o=(t,e)=>{Array.isArray(e)||(e=JSON.parse(e)),e.forEach((e=>{const i=w(t);b(i,e),g(n,i)}))};o("track",f),o("source",l),k(n,"canplay",(()=>e(0,i=1))),t.prepend(n)},r]}class At extends ct{constructor(t){super(),ut(this,t,Dt,Pt,u,{$:4})}}let Nt,Ht,{documentElement:Ot,body:Tt}=document;function Wt(n){let e,i,o,r,s,c,l,f,d=n[6].i,p=Kt(n),m=(!n[11]||!n[10])&&Lt(n);return{c(){e=w("div"),i=w("div"),p.c(),r=$(),m&&m.c(),_(e,"class","bp-wrap"),z(e,"zoomed",n[14]),z(e,"bp-inline",n[12])},m(t,o){x(t,e,o),g(e,i),p.m(e,null),g(e,r),m&&m.m(e,null),c=1,l||(f=a(s=n[22].call(null,e)),l=1)},p(i,o){n=i,64&o[0]&&u(d,d=n[6].i)?(V(),Z(p,1,1,t),X(),p=Kt(n),p.c(),Y(p),p.m(e,r)):p.p(n,o),n[11]&&n[10]?m&&(V(),Z(m,1,1,(()=>{m=null})),X()):m?(m.p(n,o),3072&o[0]&&Y(m,1)):(m=Lt(n),m.c(),Y(m,1),m.m(e,null)),16384&o[0]&&z(e,"zoomed",n[14]),4096&o[0]&&z(e,"bp-inline",n[12])},i(t){c||(E((()=>{o||(o=it(i,at,{g:lt,duration:480},1)),o.run(1)})),Y(p),Y(m),c=1)},o(t){o||(o=it(i,at,{g:lt,duration:480},0)),o.run(0),Z(p),Z(m),c=0},d(t){t&&y(e),t&&o&&o.end(),p.d(t),m&&m.d(),l=0,f()}}}function Et(n){let e,i,o=n[6].html+"";return{c(){e=new M,i=$(),e.a=i},m(t,n){e.m(o,t,n),x(t,i,n)},p(t,n){64&n[0]&&o!==(o=t[6].html+"")&&e.p(o)},i:t,o:t,d(t){t&&y(i),t&&e.d()}}}function jt(t){let n,e;return n=new Ft({props:{$:{M:t[6],I:t[16],P:t[15]}}}),{c(){ot(n.$$.u)},m(t,i){rt(n,t,i),e=1},p(t,e){const i={};64&e[0]&&(i.$={M:t[6],I:t[16],P:t[15]}),n.$set(i)},i(t){e||(Y(n.$$.u,t),e=1)},o(t){Z(n.$$.u,t),e=0},d(t){st(n,t)}}}function qt(t){let n,e;return n=new At({props:{$:{M:t[6],I:t[16],P:t[15]}}}),{c(){ot(n.$$.u)},m(t,i){rt(n,t,i),e=1},p(t,e){const i={};64&e[0]&&(i.$={M:t[6],I:t[16],P:t[15]}),n.$set(i)},i(t){e||(Y(n.$$.u,t),e=1)},o(t){Z(n.$$.u,t),e=0},d(t){st(n,t)}}}function Jt(t){let n,e;return n=new It({props:{$:{M:t[6],I:t[16],R:t[18],C:t[17],opts:t[5],prev:t[2],next:t[3],close:t[1],F:t[21],P:t[15]},k:t[8],_:t[9],S:t[11]}}),{c(){ot(n.$$.u)},m(t,i){rt(n,t,i),e=1},p(t,e){const i={};96&e[0]&&(i.$={M:t[6],I:t[16],R:t[18],C:t[17],opts:t[5],prev:t[2],next:t[3],close:t[1],F:t[21],P:t[15]}),256&e[0]&&(i.k=t[8]),512&e[0]&&(i._=t[9]),2048&e[0]&&(i.S=t[11]),n.$set(i)},i(t){e||(Y(n.$$.u,t),e=1)},o(t){Z(n.$$.u,t),e=0},d(t){st(n,t)}}}function Bt(t){let n,e,i,o=t[6].caption+"";return{c(){n=w("div"),_(n,"class","bp-cap")},m(t,e){x(t,n,e),n.innerHTML=o,i=1},p(t,e){(!i||64&e[0])&&o!==(o=t[6].caption+"")&&(n.innerHTML=o)},i(t){i||(E((()=>{e||(e=it(n,at,{duration:200},1)),e.run(1)})),i=1)},o(t){e||(e=it(n,at,{duration:200},0)),e.run(0),i=0},d(t){t&&y(n),t&&e&&e.end()}}}function Kt(t){let n,e,i,r,s,u,c,l,a;const f=[Jt,qt,jt,Et],d=[];function p(t,n){return t[6].img?0:t[6].sources?1:t[6].iframe?2:3}e=p(t),i=d[e]=f[e](t);let m=t[6].caption&&Bt(t);return{c(){n=w("div"),i.c(),m&&m.c(),u=$(),_(n,"class","bp-inner"),z(n,"bp-html",t[7])},m(i,o){x(i,n,o),d[e].m(n,null),m&&m.m(i,o),x(i,u,o),c=1,l||(a=[k(n,"pointerdown",t[28]),k(n,"pointerup",t[29])],l=1)},p(t,o){let r=e;e=p(t),e===r?d[e].p(t,o):(V(),Z(d[r],1,1,(()=>{d[r]=null})),X(),i=d[e],i?i.p(t,o):(i=d[e]=f[e](t),i.c()),Y(i,1),i.m(n,null)),128&o[0]&&z(n,"bp-html",t[7]),t[6].caption?m?(m.p(t,o),64&o[0]&&Y(m,1)):(m=Bt(t),m.c(),Y(m,1),m.m(u.parentNode,u)):m&&(V(),Z(m,1,1,(()=>{m=null})),X())},i(e){c||(Y(i),E((()=>{s&&s.end(1),r=nt(n,t[19],{}),r.start()})),Y(m),c=1)},o(e){Z(i),r&&r.invalidate(),s=et(n,t[20],{}),Z(m),c=0},d(t){t&&y(n),d[e].d(),t&&s&&s.end(),m&&m.d(t),t&&y(u),l=0,o(a)}}}function Lt(t){let n,e,i,o,r=!t[5].noClose&&Gt(t),s=t[0].length>1&&Qt(t);return{c(){n=w("div"),r&&r.c(),e=$(),s&&s.c(),_(n,"class","bp-controls")},m(t,i){x(t,n,i),r&&r.m(n,null),g(n,e),s&&s.m(n,null),o=1},p(t,i){t[5].noClose?r&&(r.d(1),r=null):r?r.p(t,i):(r=Gt(t),r.c(),r.m(n,e)),t[0].length>1?s?s.p(t,i):(s=Qt(t),s.c(),s.m(n,null)):s&&(s.d(1),s=null)},i(t){o||(E((()=>{i||(i=it(n,at,{duration:300},1)),i.run(1)})),o=1)},o(t){i||(i=it(n,at,{duration:300},0)),i.run(0),o=0},d(t){t&&y(n),r&&r.d(),s&&s.d(),t&&i&&i.end()}}}function Gt(n){let e,i,o;return{c(){e=w("button"),_(e,"class","bp-x"),_(e,"title","Close"),_(e,"aria-label","Close")},m(t,r){x(t,e,r),i||(o=k(e,"click",n[1]),i=1)},p:t,d(t){t&&y(e),i=0,o()}}}function Qt(t){let n,e,i,r,s,u,c=`${t[4]+1} / ${t[0].length}`;return{c(){n=w("div"),e=v(c),i=w("button"),r=w("button"),_(n,"class","bp-count"),_(i,"class","bp-prev"),_(i,"title","Previous"),_(i,"aria-label","Previous"),_(r,"class","bp-next"),_(r,"title","Next"),_(r,"aria-label","Next")},m(o,c){x(o,n,c),g(n,e),x(o,i,c),x(o,r,c),s||(u=[k(i,"click",t[2]),k(r,"click",t[3])],s=1)},p(t,n){17&n[0]&&c!==(c=`${t[4]+1} / ${t[0].length}`)&&((t,n)=>{t.wholeText!==(n=""+n)&&(t.data=n)})(e,c)},d(t){t&&y(n),t&&y(i),t&&y(r),s=0,o(u)}}}function Ut(t){let n,e,i=t[0]&&Wt(t);return{c(){i&&i.c(),n=$()},m(t,o){i&&i.m(t,o),x(t,n,o),e=1},p(t,e){t[0]?i?(i.p(t,e),1&e[0]&&Y(i,1)):(i=Wt(t),i.c(),Y(i,1),i.m(n.parentNode,n)):i&&(V(),Z(i,1,1,(()=>{i=null})),X())},i(t){e||(Y(i),e=1)},o(t){Z(i),e=0},d(t){i&&i.d(t),t&&y(n)}}}function Vt(t,n,e){let i,o;c(t,gt,(t=>e(33,i=t))),c(t,bt,(t=>e(14,o=t)));let r,s,u,a,f,d,p,m,h,g,b,x,y,v,$,{items:_}=n,{target:S}=n;const z=t=>$=t,M=()=>{const t=s.items;a=document.activeElement,e(8,d=S.offsetWidth),e(9,p=S===document.body?window.innerHeight:S.clientHeight),e(11,h=769>d),e(4,r=s.position||0),e(10,m=0),e(0,_=Array.isArray(t)?t.map(((t,n)=>({...t,i:n}))):[...t.length?t:[t]].map(((t,n)=>(t===s.el&&e(4,r=n),{element:t,i:n,...t.dataset}))))},I=()=>{s.noClose||(s.onClose&&s.onClose(),l(gt,i=1,i),e(0,_=0),a&&a.focus({preventScroll:1}))},R=()=>F(r-1),C=()=>F(r+1),F=t=>{b=t-r,e(4,r=P(t))},P=t=>(_.length>t?0>t&&(t=_.length-1):t=0,t),D=t=>{const{key:n,shiftKey:e}=t;if("Escape"===n)I();else if("ArrowRight"===n)C();else if("ArrowLeft"===n)R();else if("Tab"===n){const{activeElement:n}=document;if(e||!n.controls){t.preventDefault();const i=[...(s.focusWrap||f).querySelectorAll("*")].filter((t=>t.tabIndex>=0));let o=i.indexOf(n);o+=i.length+(e?-1:1),o%=i.length,i[o].focus()}}},A=(t,n)=>{const e=s.scale||.99;let i,o;const r=(n=n||1080)/(t=t||1920);return r>p/d?(o=Math.min(n,p*e),i=o/r):(i=Math.min(t,d*e),o=i*r),[Math.round(i),Math.round(o)]},N=t=>{const{img:n,width:e,height:i}=t;if(!n)return;const o=w("img");return o.sizes=s.sizes||A(e,i)[0]+"px",o.srcset=n,t.preload=o,o.decode()},H=t=>{const{element:n}=y,e=t.querySelector(".bp-item"),{clientWidth:i,clientHeight:o}=e,{top:r,left:s,width:u,height:c}=n.getBoundingClientRect(),l=s-(d-u)/2,a=r-(p-c)/2,f=n.clientWidth/i,m=n.clientHeight/o;return{duration:480,g:lt,css(t){const n=1-t;return`transform:translate3d(${l*n}px, ${a*n}px, 0px) scale3d(${f+t*(1-f)}, ${m+t*(1-m)}, 1)`}}};return t.$$set=t=>{"items"in t&&e(0,_=t.items),"target"in t&&e(23,S=t.target)},t.$$.update=()=>{201326833&t.$$.l[0]&&_&&(e(6,y=_[r]),u&&(e(7,v=y.hasOwnProperty("html")),v&&z(null),s.onUpdate&&s.onUpdate(f,y)))},[_,I,R,C,r,s,y,v,d,p,m,h,g,x,o,z,A,()=>{const t=_[P(r+1)],n=_[P(r-1)];t&&!t.preload&&N(t),n&&!n.preload&&N(n)},N,t=>u?ft(t,{x:b>0?20:-20,g:lt,duration:250}):(e(26,u=1),s.onOpen&&s.onOpen(f,y),s.intro?ft(t,{y:10,g:lt}):H(t)),t=>_?ft(t,{x:b>0?-20:20,g:lt,duration:250}):s.intro?ft(t,{y:-10,g:lt}):H(t),()=>e(10,m=!m),t=>{let n,o;e(27,f=t),g||(n=k(window,"keydown",D));const r=new ResizeObserver((t=>{o&&(e(8,d=t[0].contentRect.width),e(9,p=t[0].contentRect.height),e(11,h=769>d),$&&$(),s.onResize&&s.onResize(f,y)),o=1}));return r.observe(t),{destroy(){r.disconnect(),n&&n(),l(gt,i=e(26,u=0),i),Ot.style.overflowY=Nt,Tt.style.overflowY=Nt,s.onClosed&&s.onClosed()}}},S,t=>{e(5,s=t),e(12,g=s.inline),g||Ot.scrollHeight>Ot.clientHeight&&(Nt=Nt||getComputedStyle(Ot).overflowY,Ht=Ht||getComputedStyle(Tt).overflowY,Ot.style.overflowY="hidden",Tt.style.overflowY="scroll"),setTimeout(M,0)},F,u,f,t=>e(13,x=t.target),function(t){2!==t.button&&t.target===this&&x===this&&I()}]}class Xt extends ct{constructor(t){super(),ut(this,t,Vt,Ut,u,{items:0,target:23,open:24,close:1,prev:2,next:3,setPosition:25},null,[-1,-1])}get items(){return this.$$.ctx[0]}get target(){return this.$$.ctx[23]}get open(){return this.$$.ctx[24]}get close(){return this.$$.ctx[1]}get prev(){return this.$$.ctx[2]}get next(){return this.$$.ctx[3]}get setPosition(){return this.$$.ctx[25]}}return t=>new Xt({...t,props:t})}(); diff --git a/dist/bigger-picture.min.mjs b/dist/bigger-picture.min.mjs index 3e57847..b2addfe 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 i(t){t.forEach(o)}function r(t){return"function"==typeof t}let s;function u(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 l(t,n,e){return t.set(e),n}function a(n){return n&&r(n.destroy)?n.destroy:t}let f=()=>window.performance.now(),d=t=>requestAnimationFrame(t);const p=new Set;function m(t){p.forEach((n=>{n.c(t)||(p.delete(n),n.f())})),0!==p.size&&d(m)}function h(t){let n;return 0===p.size&&d(m),{promise:new Promise((e=>{p.add(n={c:t,f:e})})),abort(){p.delete(n)}}}function g(t,n){t.appendChild(n)}function b(t){const n=w("style");return((t,n)=>{g(t.head||t,n)})(document,n),n.sheet}function x(t,n,e){t.insertBefore(n,e||null)}function y(t){t.parentNode.removeChild(t)}function w(t){return document.createElement(t)}function v(t){return document.createTextNode(t)}function $(){return v("")}function k(t,n,e,o){return t.addEventListener(n,e,o),()=>t.removeEventListener(n,e,o)}function _(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function S(t,n,e,o){null===e?t.style.removeProperty(n):t.style.setProperty(n,e,o?"important":"")}function z(t,n,e){t.classList[e?"add":"remove"](n)}class M{constructor(){this.e=this.n=null}c(t){this.h(t)}m(t,n,e=null){this.e||(this.e=w(n.nodeName),this.t=n,this.c(t)),this.i(e)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.childNodes)}i(t){for(let n=0;this.n.length>n;n+=1)x(this.t,this.n[n],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(y)}}const I=new Map;let R,C=0;function F(t,n,e,o,i,r,s,u=0){const c=16.666/o;let l="{\n";for(let t=0;1>=t;t+=c){const o=n+(e-n)*r(t);l+=100*t+`%{${s(o,1-o)}}\n`}const a=l+`100% {${s(e,1-e)}}\n}`,f=`__svelte_${(t=>{let n=5381,e=t.length;for(;e--;)n=(n<<5)-n^t.charCodeAt(e);return n>>>0})(a)}_${u}`,d=document,{stylesheet:p,rules:m}=I.get(d)||((t,n)=>{const e={stylesheet:b(),rules:{}};return I.set(t,e),e})(d);m[f]||(m[f]=1,p.insertRule(`@keyframes ${f} ${a}`,p.cssRules.length));const h=t.style.animation||"";return t.style.animation=`${h?h+", ":""}${f} ${o}ms linear ${i}ms 1 both`,C+=1,f}function D(t,n){const e=(t.style.animation||"").split(", "),o=e.filter(n?t=>0>t.indexOf(n):t=>-1===t.indexOf("__svelte")),i=e.length-o.length;i&&(t.style.animation=o.join(", "),C-=i,C||d((()=>{C||(I.forEach((t=>{const{stylesheet:n}=t;let e=n.cssRules.length;for(;e--;)n.deleteRule(e);t.rules={}})),I.clear())})))}function P(t){R=t}const A=[],N=[],H=[],O=[],T=Promise.resolve();let W=0;function E(t){H.push(t)}const j=new Set;let q,J=0;function K(){const t=R;do{for(;A.length>J;){const t=A[J];J++,P(t),L(t.$$)}for(P(null),A.length=0,J=0;N.length;)N.pop()();for(let t=0;H.length>t;t+=1){const n=H[t];j.has(n)||(j.add(n),n())}H.length=0}while(A.length);for(;O.length;)O.pop()();W=0,j.clear(),P(t)}function L(t){if(null!==t.u){t.update(),i(t.before_update);const n=t.l;t.l=[-1],t.u&&t.u.p(t.ctx,n),t.after_update.forEach(E)}}function B(){return q||(q=Promise.resolve(),q.then((()=>{q=null}))),q}function G(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 Q=new Set;let U;function V(){U={r:0,c:[],p:U}}function X(){U.r||i(U.c),U=U.p}function Y(t,n){t&&t.i&&(Q.delete(t),t.i(n))}function Z(t,n,e,o){if(t&&t.o){if(Q.has(t))return;Q.add(t),U.c.push((()=>{Q.delete(t),o&&(e&&t.d(1),o())})),t.o(n)}}const tt={duration:0};function nt(e,o,i){let s,u,c=o(e,i),l=0,a=0;function d(){s&&D(e,s)}function p(){const{delay:o=0,duration:i=300,g:r=n,v:p=t,css:m}=c||tt;m&&(s=F(e,0,1,i,o,r,m,a++)),p(0,1);const g=f()+o,b=g+i;u&&u.abort(),l=1,E((()=>G(e,1,"start"))),u=h((t=>{if(l){if(t>=b)return p(1,0),G(e,1,"end"),d(),l=0;if(t>=g){const n=r((t-g)/i);p(n,1-n)}}return l}))}let m=0;return{start(){m||(m=1,D(e),r(c)?(c=c(),B().then(p)):p())},invalidate(){m=0},end(){l&&(d(),l=0)}}}function et(e,o,s){let u,c=o(e,s),l=1;const a=U;function d(){const{delay:o=0,duration:r=300,g:s=n,v:d=t,css:p}=c||tt;p&&(u=F(e,1,0,r,o,s,p));const m=f()+o,g=m+r;E((()=>G(e,0,"start"))),h((t=>{if(l){if(t>=g)return d(0,1),G(e,0,"end"),--a.r||i(a.c),0;if(t>=m){const n=s((t-m)/r);d(1-n,n)}}return l}))}return a.r+=1,r(c)?B().then((()=>{c=c(),d()})):d(),{end(t){t&&c.v&&c.v(1,0),l&&(u&&D(e,u),l=0)}}}function ot(e,o,s,u){let c=o(e,s),l=u?0:1,a=null,d=null,p=null;function m(){p&&D(e,p)}function g(t,n){const e=t.b-l;return{a:l,b:t.b,d:e,duration:n*=Math.abs(e),start:t.start,end:t.start+n,group:t.group}}function b(o){const{delay:r=0,duration:s=300,g:u=n,v:b=t,css:x}=c||tt,y={start:f()+r,b:o};o||(y.group=U,U.r+=1),a||d?d=y:(x&&(m(),p=F(e,l,o,s,r,u,x)),o&&b(0,1),a=g(y,s),E((()=>G(e,o,"start"))),h((t=>(d&&t>d.start&&(a=g(d,s),d=null,G(e,a.b,"start"),x&&(m(),p=F(e,l,a.b,a.duration,0,u,c.css))),a&&(a.end>t?a.start>t||(l=a.a+a.d*u((t-a.start)/a.duration),b(l,1-l)):(b(l=a.b,1-l),G(e,a.b,"end"),d||(a.b?m():--a.group.r||i(a.group.c)),a=null)),!(!a&&!d)))))}return{run(t){r(c)?B().then((()=>{c=c(),b(t)})):b(t)},end(){m(),a=d=null}}}function it(t){t&&t.c()}function rt(t,n,e,s){const{u,on_mount:c,on_destroy:l,after_update:a}=t.$$;u&&u.m(n,e),s||E((()=>{const n=c.map(o).filter(r);l?l.push(...n):i(n),t.$$.on_mount=[]})),a.forEach(E)}function st(t,n){const e=t.$$;null!==e.u&&(i(e.on_destroy),e.u&&e.u.d(n),e.on_destroy=e.u=null,e.ctx=[])}function ut(n,e,o,r,s,u,c,l=[-1]){const a=R;P(n);const f=n.$$={u:null,ctx:null,props:u,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:{},l,skip_bound:0,root:e.target||a.$$.root};c&&c(f.root);let d=0;f.ctx=o?o(n,e.props||{},((t,e,...o)=>{const i=o.length?o[0]:e;return f.ctx&&s(f.ctx[t],f.ctx[t]=i)&&(!f.skip_bound&&f.bound[t]&&f.bound[t](i),d&&((t,n)=>{-1===t.$$.l[0]&&(A.push(t),W||(W=1,T.then(K)),t.$$.l.fill(0)),t.$$.l[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 lt(t){const n=t-1;return n*n*n+1}function at(t,{delay:e=0,duration:o=400,g:i=n}={}){const r=+getComputedStyle(t).opacity;return{delay:e,duration:o,g:i,css(t){return"opacity: "+t*r}}}function ft(t,{delay:n=0,duration:e=400,g:o=lt,x:i=0,y:r=0,opacity:s=0}={}){const u=getComputedStyle(t),c=+u.opacity,l="none"===u.transform?"":u.transform,a=c*(1-s);return{delay:n,duration:e,g:o,css(t,n){return`\n\t\t\ttransform: ${l} translate(${(1-t)*i}px, ${(1-t)*r}px);\n\t\t\topacity: ${c-a*n}`}}}const dt=[];function pt(n,e=t){let o;const i=new Set;function r(t){if(r=t,((e=n)!=e?r==r:e!==r||e&&"object"==typeof e||"function"==typeof e)&&(n=t,o)){const t=!dt.length;for(const t of i)t[1](),dt.push(t,n);if(t){for(let t=0;dt.length>t;t+=2)dt[t][0](dt[t+1]);dt.length=0}}var e,r}return{set:r,update(t){r(t(n))},subscribe(s,u=t){const c=[s,u];return i.add(c),1===i.size&&(o=e(r)||t),s(n),()=>{i.delete(c),0===i.size&&(o(),o=null)}}}}function mt(t,n){if(t===n||t!=t)return()=>t;const e=typeof t;if(Array.isArray(t)){const e=n.map(((n,e)=>mt(t[e],n)));return t=>e.map((n=>n(t)))}if("number"===e){const e=n-t;return n=>t+n*e}}function ht(t,o={}){const i=pt(t);let r,s=t;function u(u,c){if(null==t)return i.set(t=u),Promise.resolve();s=u;let l=r,a=0,{delay:d=0,duration:p=400,g:m=n,interpolate:g=mt}=e(e({},o),c);if(0===p)return l&&(l.abort(),l=null),i.set(t=s),Promise.resolve();const b=f()+d;let x;return r=h((n=>{if(b>n)return 1;a||(x=g(t,u),"function"==typeof p&&(p=p(t,u)),a=1),l&&(l.abort(),l=null);const e=n-b;return e>p?(i.set(t=u),0):(i.set(t=x(m(e/p))),1)})),r.promise}return{set:u,update(n,e){return u(n(s,t),e)},subscribe:i.subscribe}}const gt=pt(0),bt=pt(0),xt=matchMedia("(prefers-reduced-motion: reduce)").matches;function yt(t){let n,e,o,i,r=!t[2]&&wt();return{c(){n=w("div"),r&&r.c(),_(n,"class","bp-load"),S(n,"background-image","url("+t[0]+")")},m(t,e){x(t,n,e),r&&r.m(n,null),i=1},p(e,o){(t=e)[2]?r&&(r.d(1),r=null):r||(r=wt(),r.c(),r.m(n,null)),(!i||1&o)&&S(n,"background-image","url("+t[0]+")")},i(r){i||(E((()=>{o&&o.end(1),e=nt(n,at,{duration:t[1]?300:0}),e.start()})),i=1)},o(t){e&&e.invalidate(),t&&(o=et(n,at,{duration:200})),i=0},d(t){t&&y(n),r&&r.d(),t&&o&&o.end()}}}function wt(t){let n,e;return{c(){n=w("span"),e=w("span"),_(n,"class","bp-bar"),_(e,"class","bp-o")},m(t,o){x(t,n,o),x(t,e,o)},d(t){t&&y(n),t&&y(e)}}}function vt(t){let n,e=(!t[1]||t[2])&&yt(t);return{c(){e&&e.c(),n=$()},m(t,o){e&&e.m(t,o),x(t,n,o)},p(t,[o]){!t[1]||t[2]?e?(e.p(t,o),6&o&&Y(e,1)):(e=yt(t),e.c(),Y(e,1),e.m(n.parentNode,n)):e&&(V(),Z(e,1,1,(()=>{e=null})),X())},i(t){Y(e)},o(t){Z(e)},d(t){e&&e.d(t),t&&y(n)}}}function $t(t,n,e){let o;c(t,gt,(t=>e(2,o=t)));let{thumb:i}=n,{loaded:r}=n;return t.$$set=t=>{"thumb"in t&&e(0,i=t.thumb),"loaded"in t&&e(1,r=t.loaded)},[i,r,o]}class kt extends ct{constructor(t){super(),ut(this,t,$t,vt,u,{thumb:0,loaded:1})}}function _t(t){let n,e,o,i,r,s;return{c(){n=w("img"),_(n,"srcset",t[12]),_(n,"sizes",e=t[11].sizes||t[1]+"px"),_(n,"alt",t[14])},m(e,o){x(e,n,o),i=1,r||(s=k(n,"outrostart",t[27]),r=1)},p(t,o){(!i||2&o[0]&&e!==(e=t[11].sizes||t[1]+"px"))&&_(n,"sizes",e)},i(t){i||(o&&o.end(1),i=1)},o(t){o=et(n,at,{}),i=0},d(t){t&&y(n),t&&o&&o.end(),r=0,s()}}}function St(t){let n,e;return n=new kt({props:{thumb:t[13],loaded:t[3]}}),{c(){it(n.$$.u)},m(t,o){rt(n,t,o),e=1},p(t,e){const o={};8&e[0]&&(o.loaded=t[3]),n.$set(o)},i(t){e||(Y(n.$$.u,t),e=1)},o(t){Z(n.$$.u,t),e=0},d(t){st(n,t)}}}function zt(t){let n,e,o,r,s,u,c=t[3]&&_t(t),l=t[4]&&St(t);return{c(){n=w("div"),e=w("div"),c&&c.c(),o=$(),l&&l.c(),_(e,"class","bp-item bp-img"),S(e,"background-image","url("+t[13]+")"),S(e,"width",t[0][0]+"px"),S(e,"height",t[0][1]+"px"),S(e,"transform","translate3d("+t[8][0]+"px, "+t[8][1]+"px, 0px)"),_(n,"class","bp-img-wrap"),z(n,"bp-drag",t[6]),z(n,"bp-close",t[7])},m(i,f){x(i,n,f),g(n,e),c&&c.m(e,null),g(e,o),l&&l.m(e,null),t[28](n),r=1,s||(u=[a(t[21].call(null,e)),k(n,"wheel",t[17]),k(n,"pointerdown",t[18]),k(n,"pointermove",t[19]),k(n,"pointerup",t[20]),k(n,"pointercancel",t[20])],s=1)},p(t,i){t[3]?c?(c.p(t,i),8&i[0]&&Y(c,1)):(c=_t(t),c.c(),Y(c,1),c.m(e,o)):c&&(V(),Z(c,1,1,(()=>{c=null})),X()),t[4]?l?(l.p(t,i),16&i[0]&&Y(l,1)):(l=St(t),l.c(),Y(l,1),l.m(e,null)):l&&(V(),Z(l,1,1,(()=>{l=null})),X()),(!r||1&i[0])&&S(e,"width",t[0][0]+"px"),(!r||1&i[0])&&S(e,"height",t[0][1]+"px"),(!r||256&i[0])&&S(e,"transform","translate3d("+t[8][0]+"px, "+t[8][1]+"px, 0px)"),64&i[0]&&z(n,"bp-drag",t[6]),128&i[0]&&z(n,"bp-close",t[7])},i(t){r||(Y(c),Y(l),r=1)},o(t){Z(c),Z(l),r=0},d(e){e&&y(n),c&&c.d(),l&&l.d(),t[28](null),s=0,i(u)}}}function Mt(t,n,e){let o,i,r,s;c(t,bt,(t=>e(9,i=t))),c(t,gt,(t=>e(10,s=t)));let u,a,f,d,p,m,h,g,b,x,y,w,v,{$}=n,{k}=n,{_}=n,{S}=n,{M:z,I:M,R:I,C:R,opts:C,prev:F,next:D,close:P,F:A,D:H}=$,{inline:O}=C,{img:T,thumb:W,alt:E,width:j,height:q}=z,J=z.maxZoom||C.maxZoom||10,K=+j,L=+q,B=M(K,L),G=B[0],Q=[],U=[],V=0;const X={g:lt,duration:xt?0:400},Y=ht(B,X);c(t,Y,(t=>e(0,r=t)));const Z=ht([0,0],X);c(t,Z,(t=>e(8,o=t)));const tt=([t,n],e=r)=>{const o=(e[0]-k)/2,i=(e[1]-_)/2;return 0>o?t=0:t>o?S?(t=m?o+(t-o)/10:o)>o+20&&F():t=o:-1*o>t&&(S?-1*o-20>(t=m?-1*o-(-1*o-t)/10:-1*o)&&D():t=-1*o),0>i?n=0:n>i?n=i:-1*i>n&&(n=-1*i),[t,n]},nt=(t,n=J)=>{if(p)return;const i=M(K,L),s=i[0]*J,[u,c]=r;let l=u+u*n,a=c+c*n;if(n>0)l>s&&(l=s,a=i[1]*J),l>K&&(l=K,a=L);else if(i[0]>l)return Y.set(i),void Z.set([0,0]);let{x:f,y:d,width:m,height:h}=t.target.getBoundingClientRect();const g=t.clientX-f-m/2,b=t.clientY-d-h/2;f=-1*g*(l/m)+g,d=-1*b*(a/h)+b;const x=[l,a];Y.set(x).then((()=>{e(1,G=Math.round(Math.max(G,l)))})),Z.set(tt([o[0]+f,o[1]+d],x))};return t.$$set=t=>{"$"in t&&e(22,$=t.$),"k"in t&&e(23,k=t.k),"_"in t&&e(24,_=t._),"S"in t&&e(25,S=t.S)},t.$$.update=()=>{67108865&t.$$.l[0]&&l(bt,i=r[0]>B[0],i)},[r,G,u,a,f,p,m,v,o,i,s,C,T,W,E,Y,Z,t=>{O&&!i||(t.preventDefault(),nt(t,t.deltaY/-300))},t=>{if(2!==t.button){t.preventDefault(),e(6,m=1),Q.push(t);const[n,i]=[t.clientX,t.clientY];g=n,b=i,x=o[0],y=o[1]}},t=>{if(Q.length>1)return d=1,e(6,m=0),(t=>{Q=Q.map((n=>n.pointerId==t.pointerId?t:n));const[n,e]=Q,o=Math.hypot(n.clientX-e.clientX,n.clientY-e.clientY);V||(V=o),nt(t,-.015*(V-o)),V=o})(t);if(p||!m)return;let[n,o]=[t.clientX,t.clientY];U.push({x:n,y:o}),n-=g,o-=b,i||(n>40&&F(),-40>n&&D(),-90>o&&!O&&P()),h=Math.hypot(n,o)>10,i&&h&&Z.set(tt([x+n,y+o]),{duration:0})},t=>{if(Q=Q.filter((n=>n.pointerId!=t.pointerId)),d)return d=Q.length?1:0,void(V=0);if(!p&&m){if(t.target===u&&!O)return P();if(e(6,m=0),S?h||(w?(clearTimeout(w),nt(t,i?-5:5),w=0):w=setTimeout((()=>{A(),w=0}),250)):i?h||nt(t,-5):2>U.length&&!i&&nt(t),h){let t;U=U.slice(-3);let n=U[1].x-U[2].x,e=U[1].y-U[2].y;Math.hypot(n,e)>5?(n=U[0].x-U[2].x,e=U[0].y-U[2].y,t=[o[0]-5*n,o[1]-5*e]):t=o,Z.set(tt(t))}h=0,U=[]}},()=>{H((()=>{e(26,B=M(K,L)),S||(Y.set(B),Z.set([0,0]))})),I(z).then((()=>{e(3,a=1),R()})),setTimeout((()=>{e(4,f=!a)}),250)},$,k,_,S,B,()=>{e(5,p=1),s&&i&&!C.intro&&(e(7,v=1),l(Z,o=[0,0],o))},t=>{N[t?"unshift":"push"]((()=>{u=t,e(2,u)}))}]}class It extends ct{constructor(t){super(),ut(this,t,Mt,zt,u,{$:22,k:23,_:24,S:25},null,[-1,-1])}}function Rt(t){let n,e,o,i,r,u,c;return i=new kt({props:{thumb:t[3],loaded:t[0]}}),{c(){var r,u;n=w("div"),e=w("iframe"),it(i.$$.u),_(e,"allow","autoplay; fullscreen"),r=e.src,u=o=t[2],s||(s=document.createElement("a")),s.href=u,r!==s.href&&_(e,"src",o),_(e,"title",t[4]),_(n,"class","bp-item bp-if"),S(n,"width",t[1][0]+"px"),S(n,"height",t[1][1]+"px")},m(o,s){x(o,n,s),g(n,e),rt(i,n,null),r=1,u||(c=k(e,"load",t[6]),u=1)},p(t,[e]){const o={};1&e&&(o.loaded=t[0]),i.$set(o),(!r||2&e)&&S(n,"width",t[1][0]+"px"),(!r||2&e)&&S(n,"height",t[1][1]+"px")},i(t){r||(Y(i.$$.u,t),r=1)},o(t){Z(i.$$.u,t),r=0},d(t){t&&y(n),st(i),u=0,c()}}}function Ct(t,n,e){let o,i,{$:r}=n,{M:s,I:u,D:c}=r,{iframe:l,thumb:a,title:f,width:d,height:p}=s;const m=()=>e(1,i=u(d,p));return m(),c(m),t.$$set=t=>{"$"in t&&e(5,r=t.$)},[o,i,l,a,f,r,()=>e(0,o=1)]}class Ft extends ct{constructor(t){super(),ut(this,t,Ct,Rt,u,{$:5})}}function Dt(t){let n,e,o,i,r;return e=new kt({props:{thumb:t[2],loaded:t[0]}}),{c(){n=w("div"),it(e.$$.u),_(n,"class","bp-item bp-vid"),S(n,"width",t[1][0]+"px"),S(n,"height",t[1][1]+"px"),S(n,"background-image","url("+t[2]+")")},m(s,u){x(s,n,u),rt(e,n,null),o=1,i||(r=a(t[3].call(null,n)),i=1)},p(t,[i]){const r={};1&i&&(r.loaded=t[0]),e.$set(r),(!o||2&i)&&S(n,"width",t[1][0]+"px"),(!o||2&i)&&S(n,"height",t[1][1]+"px")},i(t){o||(Y(e.$$.u,t),o=1)},o(t){Z(e.$$.u,t),o=0},d(t){t&&y(n),st(e),i=0,r()}}}function Pt(t,n,e){let o,i,{$:r}=n,{M:s,I:u,D:c}=r,{sources:l,thumb:a,tracks:f=[],width:d,height:p}=s;const m=()=>e(1,i=u(d,p));m(),c(m);const h=JSON.stringify(l).includes("audio"),b=(t,n)=>{Object.keys(n).forEach((e=>_(t,e,n[e])))};return t.$$set=t=>{"$"in t&&e(4,r=t.$)},[o,i,a,t=>{const n=w(h?"audio":"video");b(n,{controls:1,autoplay:1,playsinline:1,tabindex:"0"});const i=(t,e)=>{Array.isArray(e)||(e=JSON.parse(e)),e.forEach((e=>{const o=w(t);b(o,e),g(n,o)}))};i("track",f),i("source",l),k(n,"canplay",(()=>e(0,o=1))),t.prepend(n)},r]}class At extends ct{constructor(t){super(),ut(this,t,Pt,Dt,u,{$:4})}}let Nt,Ht,{documentElement:Ot,body:Tt}=document;function Wt(n){let e,o,i,r,s,c,l,f,d=n[7].i,p=Lt(n),m=(!n[12]||!n[11])&&Bt(n);return{c(){e=w("div"),o=w("div"),p.c(),r=$(),m&&m.c(),_(e,"class","bp-wrap"),z(e,"zoomed",n[15]),z(e,"bp-inline",n[13])},m(t,i){x(t,e,i),g(e,o),p.m(e,null),g(e,r),m&&m.m(e,null),n[30](e),c=1,l||(f=a(s=n[23].call(null,e)),l=1)},p(o,i){n=o,128&i[0]&&u(d,d=n[7].i)?(V(),Z(p,1,1,t),X(),p=Lt(n),p.c(),Y(p),p.m(e,r)):p.p(n,i),n[12]&&n[11]?m&&(V(),Z(m,1,1,(()=>{m=null})),X()):m?(m.p(n,i),6144&i[0]&&Y(m,1)):(m=Bt(n),m.c(),Y(m,1),m.m(e,null)),32768&i[0]&&z(e,"zoomed",n[15]),8192&i[0]&&z(e,"bp-inline",n[13])},i(t){c||(E((()=>{i||(i=ot(o,at,{g:lt,duration:480},1)),i.run(1)})),Y(p),Y(m),c=1)},o(t){i||(i=ot(o,at,{g:lt,duration:480},0)),i.run(0),Z(p),Z(m),c=0},d(t){t&&y(e),t&&i&&i.end(),p.d(t),m&&m.d(),n[30](null),l=0,f()}}}function Et(n){let e,o,i=n[7].html+"";return{c(){e=new M,o=$(),e.a=o},m(t,n){e.m(i,t,n),x(t,o,n)},p(t,n){128&n[0]&&i!==(i=t[7].html+"")&&e.p(i)},i:t,o:t,d(t){t&&y(o),t&&e.d()}}}function jt(t){let n,e;return n=new Ft({props:{$:{M:t[7],I:t[17],D:t[16]}}}),{c(){it(n.$$.u)},m(t,o){rt(n,t,o),e=1},p(t,e){const o={};128&e[0]&&(o.$={M:t[7],I:t[17],D:t[16]}),n.$set(o)},i(t){e||(Y(n.$$.u,t),e=1)},o(t){Z(n.$$.u,t),e=0},d(t){st(n,t)}}}function qt(t){let n,e;return n=new At({props:{$:{M:t[7],I:t[17],D:t[16]}}}),{c(){it(n.$$.u)},m(t,o){rt(n,t,o),e=1},p(t,e){const o={};128&e[0]&&(o.$={M:t[7],I:t[17],D:t[16]}),n.$set(o)},i(t){e||(Y(n.$$.u,t),e=1)},o(t){Z(n.$$.u,t),e=0},d(t){st(n,t)}}}function Jt(t){let n,e;return n=new It({props:{$:{M:t[7],I:t[17],R:t[19],C:t[18],opts:t[5],prev:t[2],next:t[3],close:t[1],F:t[22],D:t[16]},k:t[9],_:t[10],S:t[12]}}),{c(){it(n.$$.u)},m(t,o){rt(n,t,o),e=1},p(t,e){const o={};160&e[0]&&(o.$={M:t[7],I:t[17],R:t[19],C:t[18],opts:t[5],prev:t[2],next:t[3],close:t[1],F:t[22],D:t[16]}),512&e[0]&&(o.k=t[9]),1024&e[0]&&(o._=t[10]),4096&e[0]&&(o.S=t[12]),n.$set(o)},i(t){e||(Y(n.$$.u,t),e=1)},o(t){Z(n.$$.u,t),e=0},d(t){st(n,t)}}}function Kt(t){let n,e,o,i=t[7].caption+"";return{c(){n=w("div"),_(n,"class","bp-cap")},m(t,e){x(t,n,e),n.innerHTML=i,o=1},p(t,e){(!o||128&e[0])&&i!==(i=t[7].caption+"")&&(n.innerHTML=i)},i(t){o||(E((()=>{e||(e=ot(n,at,{duration:200},1)),e.run(1)})),o=1)},o(t){e||(e=ot(n,at,{duration:200},0)),e.run(0),o=0},d(t){t&&y(n),t&&e&&e.end()}}}function Lt(t){let n,e,o,r,s,u,c,l,a;const f=[Jt,qt,jt,Et],d=[];function p(t,n){return t[7].img?0:t[7].sources?1:t[7].iframe?2:3}e=p(t),o=d[e]=f[e](t);let m=t[7].caption&&Kt(t);return{c(){n=w("div"),o.c(),m&&m.c(),u=$(),_(n,"class","bp-inner"),z(n,"bp-html",t[8])},m(o,i){var r;x(o,n,i),d[e].m(n,null),m&&m.m(o,i),x(o,u,i),c=1,l||(a=[k(n,"pointerdown",t[28]),k(n,"pointerup",(r=t[29],function(t){t.target===this&&r.call(this,t)}))],l=1)},p(t,i){let r=e;e=p(t),e===r?d[e].p(t,i):(V(),Z(d[r],1,1,(()=>{d[r]=null})),X(),o=d[e],o?o.p(t,i):(o=d[e]=f[e](t),o.c()),Y(o,1),o.m(n,null)),256&i[0]&&z(n,"bp-html",t[8]),t[7].caption?m?(m.p(t,i),128&i[0]&&Y(m,1)):(m=Kt(t),m.c(),Y(m,1),m.m(u.parentNode,u)):m&&(V(),Z(m,1,1,(()=>{m=null})),X())},i(e){c||(Y(o),E((()=>{s&&s.end(1),r=nt(n,t[20],{}),r.start()})),Y(m),c=1)},o(e){Z(o),r&&r.invalidate(),s=et(n,t[21],{}),Z(m),c=0},d(t){t&&y(n),d[e].d(),t&&s&&s.end(),m&&m.d(t),t&&y(u),l=0,i(a)}}}function Bt(t){let n,e,o,i,r=!t[5].noClose&&Gt(t),s=t[0].length>1&&Qt(t);return{c(){n=w("div"),r&&r.c(),e=$(),s&&s.c(),_(n,"class","bp-controls")},m(t,o){x(t,n,o),r&&r.m(n,null),g(n,e),s&&s.m(n,null),i=1},p(t,o){t[5].noClose?r&&(r.d(1),r=null):r?r.p(t,o):(r=Gt(t),r.c(),r.m(n,e)),t[0].length>1?s?s.p(t,o):(s=Qt(t),s.c(),s.m(n,null)):s&&(s.d(1),s=null)},i(t){i||(E((()=>{o||(o=ot(n,at,{duration:300},1)),o.run(1)})),i=1)},o(t){o||(o=ot(n,at,{duration:300},0)),o.run(0),i=0},d(t){t&&y(n),r&&r.d(),s&&s.d(),t&&o&&o.end()}}}function Gt(n){let e,o,i;return{c(){e=w("button"),_(e,"class","bp-x"),_(e,"title","Close"),_(e,"aria-label","Close")},m(t,r){x(t,e,r),o||(i=k(e,"click",n[1]),o=1)},p:t,d(t){t&&y(e),o=0,i()}}}function Qt(t){let n,e,o,r,s,u,c=`${t[4]+1} / ${t[0].length}`;return{c(){n=w("div"),e=v(c),o=w("button"),r=w("button"),_(n,"class","bp-count"),_(o,"class","bp-prev"),_(o,"title","Previous"),_(o,"aria-label","Previous"),_(r,"class","bp-next"),_(r,"title","Next"),_(r,"aria-label","Next")},m(i,c){x(i,n,c),g(n,e),x(i,o,c),x(i,r,c),s||(u=[k(o,"click",t[2]),k(r,"click",t[3])],s=1)},p(t,n){17&n[0]&&c!==(c=`${t[4]+1} / ${t[0].length}`)&&((t,n)=>{t.wholeText!==(n=""+n)&&(t.data=n)})(e,c)},d(t){t&&y(n),t&&y(o),t&&y(r),s=0,i(u)}}}function Ut(t){let n,e,o=t[0]&&Wt(t);return{c(){o&&o.c(),n=$()},m(t,i){o&&o.m(t,i),x(t,n,i),e=1},p(t,e){t[0]?o?(o.p(t,e),1&e[0]&&Y(o,1)):(o=Wt(t),o.c(),Y(o,1),o.m(n.parentNode,n)):o&&(V(),Z(o,1,1,(()=>{o=null})),X())},i(t){e||(Y(o),e=1)},o(t){Z(o),e=0},d(t){o&&o.d(t),t&&y(n)}}}function Vt(t,n,e){let o,i;c(t,gt,(t=>e(34,o=t))),c(t,bt,(t=>e(15,i=t)));let r,s,u,a,f,d,p,m,h,g,b,x,y,v,$,{items:_}=n,{target:S}=n;const z=t=>$=t,M=()=>{const t=s.items;a=document.activeElement,e(9,d=S.offsetWidth),e(10,p=S===document.body?window.innerHeight:S.clientHeight),e(12,h=769>d),e(4,r=s.position||0),e(11,m=0),e(0,_=Array.isArray(t)?t.map(((t,n)=>({...t,i:n}))):[...t.length?t:[t]].map(((t,n)=>(t===s.el&&e(4,r=n),{element:t,i:n,...t.dataset}))))},I=()=>{s.noClose||(s.onClose&&s.onClose(),l(gt,o=1,o),e(0,_=0),a&&a.focus({preventScroll:1}))},R=()=>F(r-1),C=()=>F(r+1),F=t=>{b=t-r,e(4,r=D(t))},D=t=>(_.length>t?0>t&&(t=_.length-1):t=0,t),P=t=>{const{key:n,shiftKey:e}=t;if("Escape"===n)I();else if("ArrowRight"===n)C();else if("ArrowLeft"===n)R();else if("Tab"===n){const{activeElement:n}=document;if(e||!n.controls){t.preventDefault();const o=[...(s.focusWrap||f).querySelectorAll("*")].filter((t=>t.tabIndex>=0));let i=o.indexOf(n);i+=o.length+(e?-1:1),i%=o.length,o[i].focus()}}},A=(t,n)=>{const e=s.scale||.99;let o,i;const r=(n=n||1080)/(t=t||1920);return r>p/d?(i=Math.min(n,p*e),o=i/r):(o=Math.min(t,d*e),i=o*r),[Math.round(o),Math.round(i)]},H=t=>{const{img:n,width:e,height:o}=t;if(!n)return;const i=w("img");return i.sizes=s.sizes||A(e,o)[0]+"px",i.srcset=n,t.preload=i,i.decode()},O=t=>{const{element:n}=y,e=t.querySelector(".bp-item"),{clientWidth:o,clientHeight:i}=e,{top:r,left:s,width:u,height:c}=n.getBoundingClientRect(),l=s-(d-u)/2,a=r-(p-c)/2,f=n.clientWidth/o,m=n.clientHeight/i;return{duration:480,g:lt,css(t){const n=1-t;return`transform:translate3d(${l*n}px, ${a*n}px, 0px) scale3d(${f+t*(1-f)}, ${m+t*(1-m)}, 1)`}}};return t.$$set=t=>{"items"in t&&e(0,_=t.items),"target"in t&&e(24,S=t.target)},t.$$.update=()=>{134218225&t.$$.l[0]&&_&&(e(7,y=_[r]),u&&(e(8,v=y.hasOwnProperty("html")),v&&z(null),s.onUpdate&&s.onUpdate(f,y)))},[_,I,R,C,r,s,f,y,v,d,p,m,h,g,x,i,z,A,()=>{const t=_[D(r+1)],n=_[D(r-1)];t&&!t.preload&&H(t),n&&!n.preload&&H(n)},H,t=>u?ft(t,{x:b>0?20:-20,g:lt,duration:250}):(e(27,u=1),s.onOpen&&s.onOpen(f,y),s.intro?ft(t,{y:10,g:lt}):O(t)),t=>_?ft(t,{x:b>0?-20:20,g:lt,duration:250}):s.intro?ft(t,{y:-10,g:lt}):O(t),()=>e(11,m=!m),t=>{let n,i;g||(n=k(window,"keydown",P));const r=new ResizeObserver((t=>{i&&(e(9,d=t[0].contentRect.width),e(10,p=t[0].contentRect.height),e(12,h=769>d),$&&$(),s.onResize&&s.onResize(f,y)),i=1}));return r.observe(t),{destroy(){r.disconnect(),n&&n(),l(gt,o=e(27,u=0),o),Ot.style.overflowY=Nt,Tt.style.overflowY=Nt,s.onClosed&&s.onClosed()}}},S,t=>{e(5,s=t),e(13,g=s.inline),g||Ot.scrollHeight>Ot.clientHeight&&(Nt=Nt||getComputedStyle(Ot).overflowY,Ht=Ht||getComputedStyle(Tt).overflowY,Ot.style.overflowY="hidden",Tt.style.overflowY="scroll"),setTimeout(M,0)},F,u,({target:t})=>e(14,x=t),t=>{2!==t.button&&t.target===x&&I()},t=>{N[t?"unshift":"push"]((()=>{f=t,e(6,f)}))}]}class Xt extends ct{constructor(t){super(),ut(this,t,Vt,Ut,u,{items:0,target:24,open:25,close:1,prev:2,next:3,setPosition:26},null,[-1,-1])}get items(){return this.$$.ctx[0]}get target(){return this.$$.ctx[24]}get open(){return this.$$.ctx[25]}get close(){return this.$$.ctx[1]}get prev(){return this.$$.ctx[2]}get next(){return this.$$.ctx[3]}get setPosition(){return this.$$.ctx[26]}}function Yt(t){return new Xt({...t,props:t})}export{Yt 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 i(t){t.forEach(o)}function r(t){return"function"==typeof t}let s;function u(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 l(t,n,e){return t.set(e),n}function a(n){return n&&r(n.destroy)?n.destroy:t}let f=()=>window.performance.now(),d=t=>requestAnimationFrame(t);const p=new Set;function m(t){p.forEach((n=>{n.c(t)||(p.delete(n),n.f())})),0!==p.size&&d(m)}function h(t){let n;return 0===p.size&&d(m),{promise:new Promise((e=>{p.add(n={c:t,f:e})})),abort(){p.delete(n)}}}function g(t,n){t.appendChild(n)}function b(t){const n=w("style");return((t,n)=>{g(t.head||t,n)})(document,n),n.sheet}function x(t,n,e){t.insertBefore(n,e||null)}function y(t){t.parentNode.removeChild(t)}function w(t){return document.createElement(t)}function v(t){return document.createTextNode(t)}function $(){return v("")}function k(t,n,e,o){return t.addEventListener(n,e,o),()=>t.removeEventListener(n,e,o)}function _(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function S(t,n,e,o){null===e?t.style.removeProperty(n):t.style.setProperty(n,e,o?"important":"")}function z(t,n,e){t.classList[e?"add":"remove"](n)}class M{constructor(){this.e=this.n=null}c(t){this.h(t)}m(t,n,e=null){this.e||(this.e=w(n.nodeName),this.t=n,this.c(t)),this.i(e)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.childNodes)}i(t){for(let n=0;this.n.length>n;n+=1)x(this.t,this.n[n],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(y)}}const I=new Map;let R,C=0;function F(t,n,e,o,i,r,s,u=0){const c=16.666/o;let l="{\n";for(let t=0;1>=t;t+=c){const o=n+(e-n)*r(t);l+=100*t+`%{${s(o,1-o)}}\n`}const a=l+`100% {${s(e,1-e)}}\n}`,f=`__svelte_${(t=>{let n=5381,e=t.length;for(;e--;)n=(n<<5)-n^t.charCodeAt(e);return n>>>0})(a)}_${u}`,d=document,{stylesheet:p,rules:m}=I.get(d)||((t,n)=>{const e={stylesheet:b(),rules:{}};return I.set(t,e),e})(d);m[f]||(m[f]=1,p.insertRule(`@keyframes ${f} ${a}`,p.cssRules.length));const h=t.style.animation||"";return t.style.animation=`${h?h+", ":""}${f} ${o}ms linear ${i}ms 1 both`,C+=1,f}function D(t,n){const e=(t.style.animation||"").split(", "),o=e.filter(n?t=>0>t.indexOf(n):t=>-1===t.indexOf("__svelte")),i=e.length-o.length;i&&(t.style.animation=o.join(", "),C-=i,C||d((()=>{C||(I.forEach((t=>{const{stylesheet:n}=t;let e=n.cssRules.length;for(;e--;)n.deleteRule(e);t.rules={}})),I.clear())})))}function P(t){R=t}const A=[],N=[],H=[],O=[],T=Promise.resolve();let W=0;function E(t){H.push(t)}const j=new Set;let q,J=0;function K(){const t=R;do{for(;A.length>J;){const t=A[J];J++,P(t),L(t.$$)}for(P(null),A.length=0,J=0;N.length;)N.pop()();for(let t=0;H.length>t;t+=1){const n=H[t];j.has(n)||(j.add(n),n())}H.length=0}while(A.length);for(;O.length;)O.pop()();W=0,j.clear(),P(t)}function L(t){if(null!==t.u){t.update(),i(t.before_update);const n=t.l;t.l=[-1],t.u&&t.u.p(t.ctx,n),t.after_update.forEach(E)}}function B(){return q||(q=Promise.resolve(),q.then((()=>{q=null}))),q}function G(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 Q=new Set;let U;function V(){U={r:0,c:[],p:U}}function X(){U.r||i(U.c),U=U.p}function Y(t,n){t&&t.i&&(Q.delete(t),t.i(n))}function Z(t,n,e,o){if(t&&t.o){if(Q.has(t))return;Q.add(t),U.c.push((()=>{Q.delete(t),o&&(e&&t.d(1),o())})),t.o(n)}}const tt={duration:0};function nt(e,o,i){let s,u,c=o(e,i),l=0,a=0;function d(){s&&D(e,s)}function p(){const{delay:o=0,duration:i=300,g:r=n,v:p=t,css:m}=c||tt;m&&(s=F(e,0,1,i,o,r,m,a++)),p(0,1);const g=f()+o,b=g+i;u&&u.abort(),l=1,E((()=>G(e,1,"start"))),u=h((t=>{if(l){if(t>=b)return p(1,0),G(e,1,"end"),d(),l=0;if(t>=g){const n=r((t-g)/i);p(n,1-n)}}return l}))}let m=0;return{start(){m||(m=1,D(e),r(c)?(c=c(),B().then(p)):p())},invalidate(){m=0},end(){l&&(d(),l=0)}}}function et(e,o,s){let u,c=o(e,s),l=1;const a=U;function d(){const{delay:o=0,duration:r=300,g:s=n,v:d=t,css:p}=c||tt;p&&(u=F(e,1,0,r,o,s,p));const m=f()+o,g=m+r;E((()=>G(e,0,"start"))),h((t=>{if(l){if(t>=g)return d(0,1),G(e,0,"end"),--a.r||i(a.c),0;if(t>=m){const n=s((t-m)/r);d(1-n,n)}}return l}))}return a.r+=1,r(c)?B().then((()=>{c=c(),d()})):d(),{end(t){t&&c.v&&c.v(1,0),l&&(u&&D(e,u),l=0)}}}function ot(e,o,s,u){let c=o(e,s),l=u?0:1,a=null,d=null,p=null;function m(){p&&D(e,p)}function g(t,n){const e=t.b-l;return{a:l,b:t.b,d:e,duration:n*=Math.abs(e),start:t.start,end:t.start+n,group:t.group}}function b(o){const{delay:r=0,duration:s=300,g:u=n,v:b=t,css:x}=c||tt,y={start:f()+r,b:o};o||(y.group=U,U.r+=1),a||d?d=y:(x&&(m(),p=F(e,l,o,s,r,u,x)),o&&b(0,1),a=g(y,s),E((()=>G(e,o,"start"))),h((t=>(d&&t>d.start&&(a=g(d,s),d=null,G(e,a.b,"start"),x&&(m(),p=F(e,l,a.b,a.duration,0,u,c.css))),a&&(a.end>t?a.start>t||(l=a.a+a.d*u((t-a.start)/a.duration),b(l,1-l)):(b(l=a.b,1-l),G(e,a.b,"end"),d||(a.b?m():--a.group.r||i(a.group.c)),a=null)),!(!a&&!d)))))}return{run(t){r(c)?B().then((()=>{c=c(),b(t)})):b(t)},end(){m(),a=d=null}}}function it(t){t&&t.c()}function rt(t,n,e,s){const{u,on_mount:c,on_destroy:l,after_update:a}=t.$$;u&&u.m(n,e),s||E((()=>{const n=c.map(o).filter(r);l?l.push(...n):i(n),t.$$.on_mount=[]})),a.forEach(E)}function st(t,n){const e=t.$$;null!==e.u&&(i(e.on_destroy),e.u&&e.u.d(n),e.on_destroy=e.u=null,e.ctx=[])}function ut(n,e,o,r,s,u,c,l=[-1]){const a=R;P(n);const f=n.$$={u:null,ctx:null,props:u,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:{},l,skip_bound:0,root:e.target||a.$$.root};c&&c(f.root);let d=0;f.ctx=o?o(n,e.props||{},((t,e,...o)=>{const i=o.length?o[0]:e;return f.ctx&&s(f.ctx[t],f.ctx[t]=i)&&(!f.skip_bound&&f.bound[t]&&f.bound[t](i),d&&((t,n)=>{-1===t.$$.l[0]&&(A.push(t),W||(W=1,T.then(K)),t.$$.l.fill(0)),t.$$.l[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 lt(t){const n=t-1;return n*n*n+1}function at(t,{delay:e=0,duration:o=400,g:i=n}={}){const r=+getComputedStyle(t).opacity;return{delay:e,duration:o,g:i,css(t){return"opacity: "+t*r}}}function ft(t,{delay:n=0,duration:e=400,g:o=lt,x:i=0,y:r=0,opacity:s=0}={}){const u=getComputedStyle(t),c=+u.opacity,l="none"===u.transform?"":u.transform,a=c*(1-s);return{delay:n,duration:e,g:o,css(t,n){return`\n\t\t\ttransform: ${l} translate(${(1-t)*i}px, ${(1-t)*r}px);\n\t\t\topacity: ${c-a*n}`}}}const dt=[];function pt(n,e=t){let o;const i=new Set;function r(t){if(r=t,((e=n)!=e?r==r:e!==r||e&&"object"==typeof e||"function"==typeof e)&&(n=t,o)){const t=!dt.length;for(const t of i)t[1](),dt.push(t,n);if(t){for(let t=0;dt.length>t;t+=2)dt[t][0](dt[t+1]);dt.length=0}}var e,r}return{set:r,update(t){r(t(n))},subscribe(s,u=t){const c=[s,u];return i.add(c),1===i.size&&(o=e(r)||t),s(n),()=>{i.delete(c),0===i.size&&(o(),o=null)}}}}function mt(t,n){if(t===n||t!=t)return()=>t;const e=typeof t;if(Array.isArray(t)){const e=n.map(((n,e)=>mt(t[e],n)));return t=>e.map((n=>n(t)))}if("number"===e){const e=n-t;return n=>t+n*e}}function ht(t,o={}){const i=pt(t);let r,s=t;function u(u,c){if(null==t)return i.set(t=u),Promise.resolve();s=u;let l=r,a=0,{delay:d=0,duration:p=400,g:m=n,interpolate:g=mt}=e(e({},o),c);if(0===p)return l&&(l.abort(),l=null),i.set(t=s),Promise.resolve();const b=f()+d;let x;return r=h((n=>{if(b>n)return 1;a||(x=g(t,u),"function"==typeof p&&(p=p(t,u)),a=1),l&&(l.abort(),l=null);const e=n-b;return e>p?(i.set(t=u),0):(i.set(t=x(m(e/p))),1)})),r.promise}return{set:u,update(n,e){return u(n(s,t),e)},subscribe:i.subscribe}}const gt=pt(0),bt=pt(0),xt=matchMedia("(prefers-reduced-motion: reduce)").matches;function yt(t){let n,e,o,i,r=!t[2]&&wt();return{c(){n=w("div"),r&&r.c(),_(n,"class","bp-load"),S(n,"background-image","url("+t[0]+")")},m(t,e){x(t,n,e),r&&r.m(n,null),i=1},p(e,o){(t=e)[2]?r&&(r.d(1),r=null):r||(r=wt(),r.c(),r.m(n,null)),(!i||1&o)&&S(n,"background-image","url("+t[0]+")")},i(r){i||(E((()=>{o&&o.end(1),e=nt(n,at,{duration:t[1]?300:0}),e.start()})),i=1)},o(t){e&&e.invalidate(),t&&(o=et(n,at,{duration:200})),i=0},d(t){t&&y(n),r&&r.d(),t&&o&&o.end()}}}function wt(t){let n,e;return{c(){n=w("span"),e=w("span"),_(n,"class","bp-bar"),_(e,"class","bp-o")},m(t,o){x(t,n,o),x(t,e,o)},d(t){t&&y(n),t&&y(e)}}}function vt(t){let n,e=(!t[1]||t[2])&&yt(t);return{c(){e&&e.c(),n=$()},m(t,o){e&&e.m(t,o),x(t,n,o)},p(t,[o]){!t[1]||t[2]?e?(e.p(t,o),6&o&&Y(e,1)):(e=yt(t),e.c(),Y(e,1),e.m(n.parentNode,n)):e&&(V(),Z(e,1,1,(()=>{e=null})),X())},i(t){Y(e)},o(t){Z(e)},d(t){e&&e.d(t),t&&y(n)}}}function $t(t,n,e){let o;c(t,gt,(t=>e(2,o=t)));let{thumb:i}=n,{loaded:r}=n;return t.$$set=t=>{"thumb"in t&&e(0,i=t.thumb),"loaded"in t&&e(1,r=t.loaded)},[i,r,o]}class kt extends ct{constructor(t){super(),ut(this,t,$t,vt,u,{thumb:0,loaded:1})}}function _t(t){let n,e,o,i;return{c(){n=w("img"),_(n,"srcset",t[8]),_(n,"sizes",e=t[7].sizes||t[1]+"px"),_(n,"alt",t[10])},m(t,e){x(t,n,e),i=1},p(t,o){(!i||2&o[0]&&e!==(e=t[7].sizes||t[1]+"px"))&&_(n,"sizes",e)},i(t){i||(o&&o.end(1),i=1)},o(t){o=et(n,at,{}),i=0},d(t){t&&y(n),t&&o&&o.end()}}}function St(t){let n,e;return n=new kt({props:{thumb:t[9],loaded:t[2]}}),{c(){it(n.$$.u)},m(t,o){rt(n,t,o),e=1},p(t,e){const o={};4&e[0]&&(o.loaded=t[2]),n.$set(o)},i(t){e||(Y(n.$$.u,t),e=1)},o(t){Z(n.$$.u,t),e=0},d(t){st(n,t)}}}function zt(t){let n,e,o,r,s,u,c=t[2]&&_t(t),l=t[3]&&St(t);return{c(){n=w("div"),e=w("div"),c&&c.c(),o=$(),l&&l.c(),_(e,"class","bp-item bp-img"),S(e,"background-image","url("+t[9]+")"),S(e,"width",t[0][0]+"px"),S(e,"height",t[0][1]+"px"),S(e,"transform","translate3d("+t[6][0]+"px, "+t[6][1]+"px, 0px)"),_(n,"class","bp-img-wrap"),z(n,"bp-drag",t[4]),z(n,"bp-close",t[5])},m(i,f){x(i,n,f),g(n,e),c&&c.m(e,null),g(e,o),l&&l.m(e,null),r=1,s||(u=[a(t[17].call(null,n)),k(n,"wheel",t[13]),k(n,"pointerdown",t[14]),k(n,"pointermove",t[15]),k(n,"pointerup",t[16]),k(n,"pointercancel",t[16])],s=1)},p(t,i){t[2]?c?(c.p(t,i),4&i[0]&&Y(c,1)):(c=_t(t),c.c(),Y(c,1),c.m(e,o)):c&&(V(),Z(c,1,1,(()=>{c=null})),X()),t[3]?l?(l.p(t,i),8&i[0]&&Y(l,1)):(l=St(t),l.c(),Y(l,1),l.m(e,null)):l&&(V(),Z(l,1,1,(()=>{l=null})),X()),(!r||1&i[0])&&S(e,"width",t[0][0]+"px"),(!r||1&i[0])&&S(e,"height",t[0][1]+"px"),(!r||64&i[0])&&S(e,"transform","translate3d("+t[6][0]+"px, "+t[6][1]+"px, 0px)"),16&i[0]&&z(n,"bp-drag",t[4]),32&i[0]&&z(n,"bp-close",t[5])},i(t){r||(Y(c),Y(l),r=1)},o(t){Z(c),Z(l),r=0},d(t){t&&y(n),c&&c.d(),l&&l.d(),s=0,i(u)}}}function Mt(t,n,e){let o,i,r,s;c(t,bt,(t=>e(23,i=t))),c(t,gt,(t=>e(24,r=t)));let u,a,f,d,p,m,h,g,b,x,y,{$:w}=n,{k:v}=n,{_:$}=n,{S:k}=n,{M:_,I:S,R:z,C:M,opts:I,prev:R,next:C,close:F,F:D,D:P}=w,{inline:A}=I,{img:N,thumb:H,alt:O,width:T,height:W}=_,E=_.maxZoom||I.maxZoom||10,j=+T,q=+W,J=S(j,q),K=J[0],L=[],B=[],G=0;const Q={g:lt,duration:xt?0:400},U=ht(J,Q);c(t,U,(t=>e(0,s=t)));const V=ht([0,0],Q);c(t,V,(t=>e(6,o=t)));const X=([t,n],e=s)=>{const o=(e[0]-v)/2,i=(e[1]-$)/2;return 0>o?t=0:t>o?k?(t=d?o+(t-o)/10:o)>o+20&&R():t=o:-1*o>t&&(k?-1*o-20>(t=d?-1*o-(-1*o-t)/10:-1*o)&&C():t=-1*o),0>i?n=0:n>i?n=i:-1*i>n&&(n=-1*i),[t,n]},Y=(t,n=E)=>{if(r)return;const i=S(j,q),u=i[0]*E,[c,l]=s;let a=c+c*n,f=l+l*n;if(n>0)a>u&&(a=u,f=i[1]*E),a>j&&(a=j,f=q);else if(i[0]>a)return U.set(i),void V.set([0,0]);let{x:d,y:p,width:m,height:h}=t.target.getBoundingClientRect();const g=t.clientX-d-m/2,b=t.clientY-p-h/2;d=-1*g*(a/m)+g,p=-1*b*(f/h)+b;const x=[a,f];U.set(x).then((()=>{e(1,K=Math.round(Math.max(K,a)))})),V.set(X([o[0]+d,o[1]+p],x))};return t.$$set=t=>{"$"in t&&e(18,w=t.$),"k"in t&&e(19,v=t.k),"_"in t&&e(20,$=t._),"S"in t&&e(21,k=t.S)},t.$$.update=()=>{4194305&t.$$.l[0]&&l(bt,i=s[0]>J[0],i),25165824&t.$$.l[0]&&r&&i&&!I.intro&&(e(5,y=1),V.set([0,0]))},[s,K,u,a,d,y,o,I,N,H,O,U,V,t=>{A&&!i||(t.preventDefault(),Y(t,t.deltaY/-300))},t=>{if(2!==t.button){t.preventDefault(),e(4,d=1),L.push(t);const[n,i]=[t.clientX,t.clientY];m=n,h=i,g=o[0],b=o[1]}},t=>{if(L.length>1)return f=1,e(4,d=0),(t=>{L=L.map((n=>n.pointerId==t.pointerId?t:n));const[n,e]=L,o=Math.hypot(n.clientX-e.clientX,n.clientY-e.clientY);G||(G=o),Y(t,-.02*(G-o)),G=o})(t);if(!d)return;let[n,o]=[t.clientX,t.clientY];B.push({x:n,y:o}),n-=m,o-=h,i||(n>40&&e(4,d=R()),-40>n&&e(4,d=C()),-90>o&&!A&&F()),p=Math.hypot(n,o)>10,i&&p&&!r&&V.set(X([g+n,b+o]),{duration:0})},function(t){if(L=L.filter((n=>n.pointerId!=t.pointerId)),f)return f=L.length?1:0,void(G=0);if(d){if(t.target===this&&!A)return F();if(e(4,d=0),k?p||(x?(clearTimeout(x),Y(t,i?-5:5),x=0):x=setTimeout((()=>{D(),x=0}),250)):i?p||Y(t,-5):2>B.length&&!i&&Y(t),p){let t;B=B.slice(-3);let n=B[1].x-B[2].x,e=B[1].y-B[2].y;Math.hypot(n,e)>5?(n=B[0].x-B[2].x,e=B[0].y-B[2].y,t=[o[0]-5*n,o[1]-5*e]):t=o,V.set(X(t))}p=0,B=[]}},()=>{P((()=>{e(22,J=S(j,q)),U.set(J),V.set([0,0])})),z(_).then((()=>{e(2,u=1),M()})),setTimeout((()=>{e(3,a=!u)}),250)},w,v,$,k,J,i,r]}class It extends ct{constructor(t){super(),ut(this,t,Mt,zt,u,{$:18,k:19,_:20,S:21},null,[-1,-1])}}function Rt(t){let n,e,o,i,r,u,c;return i=new kt({props:{thumb:t[3],loaded:t[0]}}),{c(){var r,u;n=w("div"),e=w("iframe"),it(i.$$.u),_(e,"allow","autoplay; fullscreen"),r=e.src,u=o=t[2],s||(s=document.createElement("a")),s.href=u,r!==s.href&&_(e,"src",o),_(e,"title",t[4]),_(n,"class","bp-item bp-if"),S(n,"width",t[1][0]+"px"),S(n,"height",t[1][1]+"px")},m(o,s){x(o,n,s),g(n,e),rt(i,n,null),r=1,u||(c=k(e,"load",t[6]),u=1)},p(t,[e]){const o={};1&e&&(o.loaded=t[0]),i.$set(o),(!r||2&e)&&S(n,"width",t[1][0]+"px"),(!r||2&e)&&S(n,"height",t[1][1]+"px")},i(t){r||(Y(i.$$.u,t),r=1)},o(t){Z(i.$$.u,t),r=0},d(t){t&&y(n),st(i),u=0,c()}}}function Ct(t,n,e){let o,i,{$:r}=n,{M:s,I:u,D:c}=r,{iframe:l,thumb:a,title:f,width:d,height:p}=s;const m=()=>e(1,i=u(d,p));return m(),c(m),t.$$set=t=>{"$"in t&&e(5,r=t.$)},[o,i,l,a,f,r,()=>e(0,o=1)]}class Ft extends ct{constructor(t){super(),ut(this,t,Ct,Rt,u,{$:5})}}function Dt(t){let n,e,o,i,r;return e=new kt({props:{thumb:t[2],loaded:t[0]}}),{c(){n=w("div"),it(e.$$.u),_(n,"class","bp-item bp-vid"),S(n,"width",t[1][0]+"px"),S(n,"height",t[1][1]+"px"),S(n,"background-image","url("+t[2]+")")},m(s,u){x(s,n,u),rt(e,n,null),o=1,i||(r=a(t[3].call(null,n)),i=1)},p(t,[i]){const r={};1&i&&(r.loaded=t[0]),e.$set(r),(!o||2&i)&&S(n,"width",t[1][0]+"px"),(!o||2&i)&&S(n,"height",t[1][1]+"px")},i(t){o||(Y(e.$$.u,t),o=1)},o(t){Z(e.$$.u,t),o=0},d(t){t&&y(n),st(e),i=0,r()}}}function Pt(t,n,e){let o,i,{$:r}=n,{M:s,I:u,D:c}=r,{sources:l,thumb:a,tracks:f=[],width:d,height:p}=s;const m=()=>e(1,i=u(d,p));m(),c(m);const h=JSON.stringify(l).includes("audio"),b=(t,n)=>{Object.keys(n).forEach((e=>_(t,e,n[e])))};return t.$$set=t=>{"$"in t&&e(4,r=t.$)},[o,i,a,t=>{const n=w(h?"audio":"video");b(n,{controls:1,autoplay:1,playsinline:1,tabindex:"0"});const i=(t,e)=>{Array.isArray(e)||(e=JSON.parse(e)),e.forEach((e=>{const o=w(t);b(o,e),g(n,o)}))};i("track",f),i("source",l),k(n,"canplay",(()=>e(0,o=1))),t.prepend(n)},r]}class At extends ct{constructor(t){super(),ut(this,t,Pt,Dt,u,{$:4})}}let Nt,Ht,{documentElement:Ot,body:Tt}=document;function Wt(n){let e,o,i,r,s,c,l,f,d=n[6].i,p=Lt(n),m=(!n[11]||!n[10])&&Bt(n);return{c(){e=w("div"),o=w("div"),p.c(),r=$(),m&&m.c(),_(e,"class","bp-wrap"),z(e,"zoomed",n[14]),z(e,"bp-inline",n[12])},m(t,i){x(t,e,i),g(e,o),p.m(e,null),g(e,r),m&&m.m(e,null),c=1,l||(f=a(s=n[22].call(null,e)),l=1)},p(o,i){n=o,64&i[0]&&u(d,d=n[6].i)?(V(),Z(p,1,1,t),X(),p=Lt(n),p.c(),Y(p),p.m(e,r)):p.p(n,i),n[11]&&n[10]?m&&(V(),Z(m,1,1,(()=>{m=null})),X()):m?(m.p(n,i),3072&i[0]&&Y(m,1)):(m=Bt(n),m.c(),Y(m,1),m.m(e,null)),16384&i[0]&&z(e,"zoomed",n[14]),4096&i[0]&&z(e,"bp-inline",n[12])},i(t){c||(E((()=>{i||(i=ot(o,at,{g:lt,duration:480},1)),i.run(1)})),Y(p),Y(m),c=1)},o(t){i||(i=ot(o,at,{g:lt,duration:480},0)),i.run(0),Z(p),Z(m),c=0},d(t){t&&y(e),t&&i&&i.end(),p.d(t),m&&m.d(),l=0,f()}}}function Et(n){let e,o,i=n[6].html+"";return{c(){e=new M,o=$(),e.a=o},m(t,n){e.m(i,t,n),x(t,o,n)},p(t,n){64&n[0]&&i!==(i=t[6].html+"")&&e.p(i)},i:t,o:t,d(t){t&&y(o),t&&e.d()}}}function jt(t){let n,e;return n=new Ft({props:{$:{M:t[6],I:t[16],D:t[15]}}}),{c(){it(n.$$.u)},m(t,o){rt(n,t,o),e=1},p(t,e){const o={};64&e[0]&&(o.$={M:t[6],I:t[16],D:t[15]}),n.$set(o)},i(t){e||(Y(n.$$.u,t),e=1)},o(t){Z(n.$$.u,t),e=0},d(t){st(n,t)}}}function qt(t){let n,e;return n=new At({props:{$:{M:t[6],I:t[16],D:t[15]}}}),{c(){it(n.$$.u)},m(t,o){rt(n,t,o),e=1},p(t,e){const o={};64&e[0]&&(o.$={M:t[6],I:t[16],D:t[15]}),n.$set(o)},i(t){e||(Y(n.$$.u,t),e=1)},o(t){Z(n.$$.u,t),e=0},d(t){st(n,t)}}}function Jt(t){let n,e;return n=new It({props:{$:{M:t[6],I:t[16],R:t[18],C:t[17],opts:t[5],prev:t[2],next:t[3],close:t[1],F:t[21],D:t[15]},k:t[8],_:t[9],S:t[11]}}),{c(){it(n.$$.u)},m(t,o){rt(n,t,o),e=1},p(t,e){const o={};96&e[0]&&(o.$={M:t[6],I:t[16],R:t[18],C:t[17],opts:t[5],prev:t[2],next:t[3],close:t[1],F:t[21],D:t[15]}),256&e[0]&&(o.k=t[8]),512&e[0]&&(o._=t[9]),2048&e[0]&&(o.S=t[11]),n.$set(o)},i(t){e||(Y(n.$$.u,t),e=1)},o(t){Z(n.$$.u,t),e=0},d(t){st(n,t)}}}function Kt(t){let n,e,o,i=t[6].caption+"";return{c(){n=w("div"),_(n,"class","bp-cap")},m(t,e){x(t,n,e),n.innerHTML=i,o=1},p(t,e){(!o||64&e[0])&&i!==(i=t[6].caption+"")&&(n.innerHTML=i)},i(t){o||(E((()=>{e||(e=ot(n,at,{duration:200},1)),e.run(1)})),o=1)},o(t){e||(e=ot(n,at,{duration:200},0)),e.run(0),o=0},d(t){t&&y(n),t&&e&&e.end()}}}function Lt(t){let n,e,o,r,s,u,c,l,a;const f=[Jt,qt,jt,Et],d=[];function p(t,n){return t[6].img?0:t[6].sources?1:t[6].iframe?2:3}e=p(t),o=d[e]=f[e](t);let m=t[6].caption&&Kt(t);return{c(){n=w("div"),o.c(),m&&m.c(),u=$(),_(n,"class","bp-inner"),z(n,"bp-html",t[7])},m(o,i){x(o,n,i),d[e].m(n,null),m&&m.m(o,i),x(o,u,i),c=1,l||(a=[k(n,"pointerdown",t[28]),k(n,"pointerup",t[29])],l=1)},p(t,i){let r=e;e=p(t),e===r?d[e].p(t,i):(V(),Z(d[r],1,1,(()=>{d[r]=null})),X(),o=d[e],o?o.p(t,i):(o=d[e]=f[e](t),o.c()),Y(o,1),o.m(n,null)),128&i[0]&&z(n,"bp-html",t[7]),t[6].caption?m?(m.p(t,i),64&i[0]&&Y(m,1)):(m=Kt(t),m.c(),Y(m,1),m.m(u.parentNode,u)):m&&(V(),Z(m,1,1,(()=>{m=null})),X())},i(e){c||(Y(o),E((()=>{s&&s.end(1),r=nt(n,t[19],{}),r.start()})),Y(m),c=1)},o(e){Z(o),r&&r.invalidate(),s=et(n,t[20],{}),Z(m),c=0},d(t){t&&y(n),d[e].d(),t&&s&&s.end(),m&&m.d(t),t&&y(u),l=0,i(a)}}}function Bt(t){let n,e,o,i,r=!t[5].noClose&&Gt(t),s=t[0].length>1&&Qt(t);return{c(){n=w("div"),r&&r.c(),e=$(),s&&s.c(),_(n,"class","bp-controls")},m(t,o){x(t,n,o),r&&r.m(n,null),g(n,e),s&&s.m(n,null),i=1},p(t,o){t[5].noClose?r&&(r.d(1),r=null):r?r.p(t,o):(r=Gt(t),r.c(),r.m(n,e)),t[0].length>1?s?s.p(t,o):(s=Qt(t),s.c(),s.m(n,null)):s&&(s.d(1),s=null)},i(t){i||(E((()=>{o||(o=ot(n,at,{duration:300},1)),o.run(1)})),i=1)},o(t){o||(o=ot(n,at,{duration:300},0)),o.run(0),i=0},d(t){t&&y(n),r&&r.d(),s&&s.d(),t&&o&&o.end()}}}function Gt(n){let e,o,i;return{c(){e=w("button"),_(e,"class","bp-x"),_(e,"title","Close"),_(e,"aria-label","Close")},m(t,r){x(t,e,r),o||(i=k(e,"click",n[1]),o=1)},p:t,d(t){t&&y(e),o=0,i()}}}function Qt(t){let n,e,o,r,s,u,c=`${t[4]+1} / ${t[0].length}`;return{c(){n=w("div"),e=v(c),o=w("button"),r=w("button"),_(n,"class","bp-count"),_(o,"class","bp-prev"),_(o,"title","Previous"),_(o,"aria-label","Previous"),_(r,"class","bp-next"),_(r,"title","Next"),_(r,"aria-label","Next")},m(i,c){x(i,n,c),g(n,e),x(i,o,c),x(i,r,c),s||(u=[k(o,"click",t[2]),k(r,"click",t[3])],s=1)},p(t,n){17&n[0]&&c!==(c=`${t[4]+1} / ${t[0].length}`)&&((t,n)=>{t.wholeText!==(n=""+n)&&(t.data=n)})(e,c)},d(t){t&&y(n),t&&y(o),t&&y(r),s=0,i(u)}}}function Ut(t){let n,e,o=t[0]&&Wt(t);return{c(){o&&o.c(),n=$()},m(t,i){o&&o.m(t,i),x(t,n,i),e=1},p(t,e){t[0]?o?(o.p(t,e),1&e[0]&&Y(o,1)):(o=Wt(t),o.c(),Y(o,1),o.m(n.parentNode,n)):o&&(V(),Z(o,1,1,(()=>{o=null})),X())},i(t){e||(Y(o),e=1)},o(t){Z(o),e=0},d(t){o&&o.d(t),t&&y(n)}}}function Vt(t,n,e){let o,i;c(t,gt,(t=>e(33,o=t))),c(t,bt,(t=>e(14,i=t)));let r,s,u,a,f,d,p,m,h,g,b,x,y,v,$,{items:_}=n,{target:S}=n;const z=t=>$=t,M=()=>{const t=s.items;a=document.activeElement,e(8,d=S.offsetWidth),e(9,p=S===document.body?window.innerHeight:S.clientHeight),e(11,h=769>d),e(4,r=s.position||0),e(10,m=0),e(0,_=Array.isArray(t)?t.map(((t,n)=>({...t,i:n}))):[...t.length?t:[t]].map(((t,n)=>(t===s.el&&e(4,r=n),{element:t,i:n,...t.dataset}))))},I=()=>{s.noClose||(s.onClose&&s.onClose(),l(gt,o=1,o),e(0,_=0),a&&a.focus({preventScroll:1}))},R=()=>F(r-1),C=()=>F(r+1),F=t=>{b=t-r,e(4,r=D(t))},D=t=>(_.length>t?0>t&&(t=_.length-1):t=0,t),P=t=>{const{key:n,shiftKey:e}=t;if("Escape"===n)I();else if("ArrowRight"===n)C();else if("ArrowLeft"===n)R();else if("Tab"===n){const{activeElement:n}=document;if(e||!n.controls){t.preventDefault();const o=[...(s.focusWrap||f).querySelectorAll("*")].filter((t=>t.tabIndex>=0));let i=o.indexOf(n);i+=o.length+(e?-1:1),i%=o.length,o[i].focus()}}},A=(t,n)=>{const e=s.scale||.99;let o,i;const r=(n=n||1080)/(t=t||1920);return r>p/d?(i=Math.min(n,p*e),o=i/r):(o=Math.min(t,d*e),i=o*r),[Math.round(o),Math.round(i)]},N=t=>{const{img:n,width:e,height:o}=t;if(!n)return;const i=w("img");return i.sizes=s.sizes||A(e,o)[0]+"px",i.srcset=n,t.preload=i,i.decode()},H=t=>{const{element:n}=y,e=t.querySelector(".bp-item"),{clientWidth:o,clientHeight:i}=e,{top:r,left:s,width:u,height:c}=n.getBoundingClientRect(),l=s-(d-u)/2,a=r-(p-c)/2,f=n.clientWidth/o,m=n.clientHeight/i;return{duration:480,g:lt,css(t){const n=1-t;return`transform:translate3d(${l*n}px, ${a*n}px, 0px) scale3d(${f+t*(1-f)}, ${m+t*(1-m)}, 1)`}}};return t.$$set=t=>{"items"in t&&e(0,_=t.items),"target"in t&&e(23,S=t.target)},t.$$.update=()=>{201326833&t.$$.l[0]&&_&&(e(6,y=_[r]),u&&(e(7,v=y.hasOwnProperty("html")),v&&z(null),s.onUpdate&&s.onUpdate(f,y)))},[_,I,R,C,r,s,y,v,d,p,m,h,g,x,i,z,A,()=>{const t=_[D(r+1)],n=_[D(r-1)];t&&!t.preload&&N(t),n&&!n.preload&&N(n)},N,t=>u?ft(t,{x:b>0?20:-20,g:lt,duration:250}):(e(26,u=1),s.onOpen&&s.onOpen(f,y),s.intro?ft(t,{y:10,g:lt}):H(t)),t=>_?ft(t,{x:b>0?-20:20,g:lt,duration:250}):s.intro?ft(t,{y:-10,g:lt}):H(t),()=>e(10,m=!m),t=>{let n,i;e(27,f=t),g||(n=k(window,"keydown",P));const r=new ResizeObserver((t=>{i&&(e(8,d=t[0].contentRect.width),e(9,p=t[0].contentRect.height),e(11,h=769>d),$&&$(),s.onResize&&s.onResize(f,y)),i=1}));return r.observe(t),{destroy(){r.disconnect(),n&&n(),l(gt,o=e(26,u=0),o),Ot.style.overflowY=Nt,Tt.style.overflowY=Nt,s.onClosed&&s.onClosed()}}},S,t=>{e(5,s=t),e(12,g=s.inline),g||Ot.scrollHeight>Ot.clientHeight&&(Nt=Nt||getComputedStyle(Ot).overflowY,Ht=Ht||getComputedStyle(Tt).overflowY,Ot.style.overflowY="hidden",Tt.style.overflowY="scroll"),setTimeout(M,0)},F,u,f,t=>e(13,x=t.target),function(t){2!==t.button&&t.target===this&&x===this&&I()}]}class Xt extends ct{constructor(t){super(),ut(this,t,Vt,Ut,u,{items:0,target:23,open:24,close:1,prev:2,next:3,setPosition:25},null,[-1,-1])}get items(){return this.$$.ctx[0]}get target(){return this.$$.ctx[23]}get open(){return this.$$.ctx[24]}get close(){return this.$$.ctx[1]}get prev(){return this.$$.ctx[2]}get next(){return this.$$.ctx[3]}get setPosition(){return this.$$.ctx[25]}}function Yt(t){return new Xt({...t,props:t})}export{Yt as default}; diff --git a/dist/bigger-picture.mjs b/dist/bigger-picture.mjs index b59020a..df9c8aa 100644 --- a/dist/bigger-picture.mjs +++ b/dist/bigger-picture.mjs @@ -111,13 +111,6 @@ function listen(node, event, handler, options) { node.addEventListener(event, handler, options); return () => node.removeEventListener(event, handler, options); } -function self(fn) { - return function (event) { - // @ts-ignore - if (event.target === this) - fn.call(this, event); - }; -} function attr(node, attribute, value) { if (value == null) node.removeAttribute(attribute); @@ -1053,27 +1046,20 @@ function create_if_block_1$1(ctx) { let img_sizes_value; let img_outro; let current; - let mounted; - let dispose; return { c() { img = element("img"); - attr(img, "srcset", /*srcset*/ ctx[12]); - attr(img, "sizes", img_sizes_value = /*opts*/ ctx[11].sizes || `${/*sizes*/ ctx[1]}px`); - attr(img, "alt", /*alt*/ ctx[14]); + attr(img, "srcset", /*srcset*/ ctx[8]); + attr(img, "sizes", img_sizes_value = /*opts*/ ctx[7].sizes || `${/*sizes*/ ctx[1]}px`); + attr(img, "alt", /*alt*/ ctx[10]); }, m(target, anchor) { insert(target, img, anchor); current = true; - - if (!mounted) { - dispose = listen(img, "outrostart", /*outrostart_handler*/ ctx[27]); - mounted = true; - } }, p(ctx, dirty) { - if (!current || dirty[0] & /*sizes*/ 2 && img_sizes_value !== (img_sizes_value = /*opts*/ ctx[11].sizes || `${/*sizes*/ ctx[1]}px`)) { + if (!current || dirty[0] & /*sizes*/ 2 && img_sizes_value !== (img_sizes_value = /*opts*/ ctx[7].sizes || `${/*sizes*/ ctx[1]}px`)) { attr(img, "sizes", img_sizes_value); } }, @@ -1089,21 +1075,19 @@ function create_if_block_1$1(ctx) { d(detaching) { if (detaching) detach(img); if (detaching && img_outro) img_outro.end(); - mounted = false; - dispose(); } }; } -// (410:10) {#if showLoader} +// (394:85) {#if showLoader} function create_if_block$1(ctx) { let loading; let current; loading = new Loading({ props: { - thumb: /*thumb*/ ctx[13], - loaded: /*loaded*/ ctx[3] + thumb: /*thumb*/ ctx[9], + loaded: /*loaded*/ ctx[2] } }); @@ -1117,7 +1101,7 @@ function create_if_block$1(ctx) { }, p(ctx, dirty) { const loading_changes = {}; - if (dirty[0] & /*loaded*/ 8) loading_changes.loaded = /*loaded*/ ctx[3]; + if (dirty[0] & /*loaded*/ 4) loading_changes.loaded = /*loaded*/ ctx[2]; loading.$set(loading_changes); }, i(local) { @@ -1142,8 +1126,8 @@ function create_fragment$3(ctx) { let current; let mounted; let dispose; - let if_block0 = /*loaded*/ ctx[3] && create_if_block_1$1(ctx); - let if_block1 = /*showLoader*/ ctx[4] && create_if_block$1(ctx); + let if_block0 = /*loaded*/ ctx[2] && create_if_block_1$1(ctx); + let if_block1 = /*showLoader*/ ctx[3] && create_if_block$1(ctx); return { c() { @@ -1153,13 +1137,13 @@ function create_fragment$3(ctx) { if_block0_anchor = empty(); if (if_block1) if_block1.c(); attr(div0, "class", "bp-item bp-img"); - set_style(div0, "background-image", "url(" + /*thumb*/ ctx[13] + ")"); + set_style(div0, "background-image", "url(" + /*thumb*/ ctx[9] + ")"); set_style(div0, "width", /*$imageDimensions*/ ctx[0][0] + "px"); set_style(div0, "height", /*$imageDimensions*/ ctx[0][1] + "px"); - set_style(div0, "transform", "translate3d(" + /*$zoomDragTranslate*/ ctx[8][0] + "px, " + /*$zoomDragTranslate*/ ctx[8][1] + "px, 0px)"); + set_style(div0, "transform", "translate3d(" + /*$zoomDragTranslate*/ ctx[6][0] + "px, " + /*$zoomDragTranslate*/ ctx[6][1] + "px, 0px)"); attr(div1, "class", "bp-img-wrap"); - toggle_class(div1, "bp-drag", /*pointerDown*/ ctx[6]); - toggle_class(div1, "bp-close", /*closingWhileZoomed*/ ctx[7]); + toggle_class(div1, "bp-drag", /*pointerDown*/ ctx[4]); + toggle_class(div1, "bp-close", /*closingWhileZoomed*/ ctx[5]); }, m(target, anchor) { insert(target, div1, anchor); @@ -1167,28 +1151,27 @@ function create_fragment$3(ctx) { if (if_block0) if_block0.m(div0, null); append(div0, if_block0_anchor); if (if_block1) if_block1.m(div0, null); - /*div1_binding*/ ctx[28](div1); current = true; if (!mounted) { dispose = [ - action_destroyer(/*onMount*/ ctx[21].call(null, div0)), - listen(div1, "wheel", /*onWheel*/ ctx[17]), - listen(div1, "pointerdown", /*onPointerDown*/ ctx[18]), - listen(div1, "pointermove", /*onPointerMove*/ ctx[19]), - listen(div1, "pointerup", /*onPointerUp*/ ctx[20]), - listen(div1, "pointercancel", /*onPointerUp*/ ctx[20]) + action_destroyer(/*onMount*/ ctx[17].call(null, div1)), + listen(div1, "wheel", /*onWheel*/ ctx[13]), + listen(div1, "pointerdown", /*onPointerDown*/ ctx[14]), + listen(div1, "pointermove", /*onPointerMove*/ ctx[15]), + listen(div1, "pointerup", /*onPointerUp*/ ctx[16]), + listen(div1, "pointercancel", /*onPointerUp*/ ctx[16]) ]; mounted = true; } }, p(ctx, dirty) { - if (/*loaded*/ ctx[3]) { + if (/*loaded*/ ctx[2]) { if (if_block0) { if_block0.p(ctx, dirty); - if (dirty[0] & /*loaded*/ 8) { + if (dirty[0] & /*loaded*/ 4) { transition_in(if_block0, 1); } } else { @@ -1207,11 +1190,11 @@ function create_fragment$3(ctx) { check_outros(); } - if (/*showLoader*/ ctx[4]) { + if (/*showLoader*/ ctx[3]) { if (if_block1) { if_block1.p(ctx, dirty); - if (dirty[0] & /*showLoader*/ 16) { + if (dirty[0] & /*showLoader*/ 8) { transition_in(if_block1, 1); } } else { @@ -1238,16 +1221,16 @@ function create_fragment$3(ctx) { set_style(div0, "height", /*$imageDimensions*/ ctx[0][1] + "px"); } - if (!current || dirty[0] & /*$zoomDragTranslate*/ 256) { - set_style(div0, "transform", "translate3d(" + /*$zoomDragTranslate*/ ctx[8][0] + "px, " + /*$zoomDragTranslate*/ ctx[8][1] + "px, 0px)"); + if (!current || dirty[0] & /*$zoomDragTranslate*/ 64) { + set_style(div0, "transform", "translate3d(" + /*$zoomDragTranslate*/ ctx[6][0] + "px, " + /*$zoomDragTranslate*/ ctx[6][1] + "px, 0px)"); } - if (dirty[0] & /*pointerDown*/ 64) { - toggle_class(div1, "bp-drag", /*pointerDown*/ ctx[6]); + if (dirty[0] & /*pointerDown*/ 16) { + toggle_class(div1, "bp-drag", /*pointerDown*/ ctx[4]); } - if (dirty[0] & /*closingWhileZoomed*/ 128) { - toggle_class(div1, "bp-close", /*closingWhileZoomed*/ ctx[7]); + if (dirty[0] & /*closingWhileZoomed*/ 32) { + toggle_class(div1, "bp-close", /*closingWhileZoomed*/ ctx[5]); } }, i(local) { @@ -1265,7 +1248,6 @@ function create_fragment$3(ctx) { if (detaching) detach(div1); if (if_block0) if_block0.d(); if (if_block1) if_block1.d(); - /*div1_binding*/ ctx[28](null); mounted = false; run_all(dispose); } @@ -1275,10 +1257,10 @@ function create_fragment$3(ctx) { function instance$3($$self, $$props, $$invalidate) { let $zoomDragTranslate; let $zoomed; - let $imageDimensions; let $closing; - component_subscribe($$self, zoomed, $$value => $$invalidate(9, $zoomed = $$value)); - component_subscribe($$self, closing, $$value => $$invalidate(10, $closing = $$value)); + let $imageDimensions; + component_subscribe($$self, zoomed, $$value => $$invalidate(23, $zoomed = $$value)); + component_subscribe($$self, closing, $$value => $$invalidate(24, $closing = $$value)); let { stuff } = $$props; let { containerWidth } = $$props; let { containerHeight } = $$props; @@ -1292,9 +1274,6 @@ function instance$3($$self, $$props, $$invalidate) { let calculatedDimensions = calculateDimensions(naturalWidth, naturalHeight); let sizes = calculatedDimensions[0]; - // .bp-img-wrap element - let wrap; - // tracks load state of image let loaded, showLoader; @@ -1310,9 +1289,6 @@ function instance$3($$self, $$props, $$invalidate) { // track distance for pinch events let prevDiff = 0; - // bool ignore pointer events if true - let imageOutroStarted; - let pointerDown, hasDragged; let dragStartX, dragStartY; @@ -1339,7 +1315,7 @@ function instance$3($$self, $$props, $$invalidate) { // translate transform for pointerDown const zoomDragTranslate = tweened([0, 0], tweenOptions); - component_subscribe($$self, zoomDragTranslate, value => $$invalidate(8, $zoomDragTranslate = value)); + component_subscribe($$self, zoomDragTranslate, value => $$invalidate(6, $zoomDragTranslate = value)); // calculate translate position with bounds const boundTranslateValues = ([x, y], newDimensions = $imageDimensions) => { @@ -1391,7 +1367,7 @@ function instance$3($$self, $$props, $$invalidate) { // updates zoom level in or out based on amt value const changeZoom = (e, amt = maxZoom) => { - if (imageOutroStarted) { + if ($closing) { return; } @@ -1462,7 +1438,7 @@ function instance$3($$self, $$props, $$invalidate) { // don't run if right click if (e.button !== 2) { e.preventDefault(); - $$invalidate(6, pointerDown = true); + $$invalidate(4, pointerDown = true); eventCache.push(e); const [x, y] = [e.clientX, e.clientY]; dragStartX = x; @@ -1474,14 +1450,13 @@ function instance$3($$self, $$props, $$invalidate) { // on drag, update image translate val const onPointerMove = e => { - // e.preventDefault() if (eventCache.length > 1) { isPinch = true; - $$invalidate(6, pointerDown = false); + $$invalidate(4, pointerDown = false); return handlePinch(e); } - if (imageOutroStarted || !pointerDown) { + if (!pointerDown) { return; } @@ -1499,12 +1474,14 @@ function instance$3($$self, $$props, $$invalidate) { if (!$zoomed) { // previous if swipe left if (x > 40) { - prev(); + // pointerdown = undefined to stop pointermove from running again + $$invalidate(4, pointerDown = prev()); } // next if swipe right if (x < -40) { - next(); + // pointerdown = undefined to stop pointermove from running again + $$invalidate(4, pointerDown = next()); } // close if swipe up (don't close if inline) @@ -1516,7 +1493,7 @@ function instance$3($$self, $$props, $$invalidate) { hasDragged = Math.hypot(x, y) > 10; // image drag when zoomed - if ($zoomed && hasDragged) { + if ($zoomed && hasDragged && !$closing) { zoomDragTranslate.set(boundTranslateValues([dragStartTranslateX + x, dragStartTranslateY + y]), { duration: 0 }); } }; @@ -1537,14 +1514,14 @@ function instance$3($$self, $$props, $$invalidate) { } // scale image - changeZoom(e, (prevDiff - curDiff) * -0.015); + changeZoom(e, (prevDiff - curDiff) * -0.02); // Cache the distance for the next move event prevDiff = curDiff; }; // on mouse / touch end, set pointerDown to false - const onPointerUp = e => { + function onPointerUp(e) { // remove event from event cache eventCache = eventCache.filter(ev => ev.pointerId != e.pointerId); @@ -1557,16 +1534,16 @@ function instance$3($$self, $$props, $$invalidate) { } // make sure pointer events don't carry over to next image - if (imageOutroStarted || !pointerDown) { + if (!pointerDown) { return; } // close if overlay is clicked - if (e.target === wrap && !inline) { + if (e.target === this && !inline) { return close(); } - $$invalidate(6, pointerDown = false); + $$invalidate(4, pointerDown = false); if (!smallScreen) { // if largescreen @@ -1620,79 +1597,64 @@ function instance$3($$self, $$props, $$invalidate) { // reset dragPositions dragPositions = []; - }; + } const onMount = () => { // handle window resize setResizeFunc(() => { - $$invalidate(26, calculatedDimensions = calculateDimensions(naturalWidth, naturalHeight)); + $$invalidate(22, calculatedDimensions = calculateDimensions(naturalWidth, naturalHeight)); - // adjust image only if not smaller container - // some mobile browsers trigger resize constantly if dragging / pinching - if (!smallScreen) { - imageDimensions.set(calculatedDimensions); - zoomDragTranslate.set([0, 0]); - } + // adjust image size / zoom on resize + imageDimensions.set(calculatedDimensions); + + zoomDragTranslate.set([0, 0]); }); // decode initial image before rendering loadImage(activeItem).then(() => { - $$invalidate(3, loaded = true); + $$invalidate(2, loaded = true); preloadNext(); }); // show loading indicator if needed setTimeout( () => { - $$invalidate(4, showLoader = !loaded); + $$invalidate(3, showLoader = !loaded); }, 250 ); }; - const outrostart_handler = () => { - $$invalidate(5, imageOutroStarted = true); - - // if zoomed while closing, zoom out image and add class - // to change contain value on .bp-wrap to avoid cropping - if ($closing && $zoomed && !opts.intro) { - $$invalidate(7, closingWhileZoomed = true); - set_store_value(zoomDragTranslate, $zoomDragTranslate = [0, 0], $zoomDragTranslate); - } - }; - - function div1_binding($$value) { - binding_callbacks[$$value ? 'unshift' : 'push'](() => { - wrap = $$value; - $$invalidate(2, wrap); - }); - } - $$self.$$set = $$props => { - if ('stuff' in $$props) $$invalidate(22, stuff = $$props.stuff); - if ('containerWidth' in $$props) $$invalidate(23, containerWidth = $$props.containerWidth); - if ('containerHeight' in $$props) $$invalidate(24, containerHeight = $$props.containerHeight); - if ('smallScreen' in $$props) $$invalidate(25, smallScreen = $$props.smallScreen); + if ('stuff' in $$props) $$invalidate(18, stuff = $$props.stuff); + if ('containerWidth' in $$props) $$invalidate(19, containerWidth = $$props.containerWidth); + if ('containerHeight' in $$props) $$invalidate(20, containerHeight = $$props.containerHeight); + if ('smallScreen' in $$props) $$invalidate(21, smallScreen = $$props.smallScreen); }; $$self.$$.update = () => { - if ($$self.$$.dirty[0] & /*$imageDimensions, calculatedDimensions*/ 67108865) { + if ($$self.$$.dirty[0] & /*$imageDimensions, calculatedDimensions*/ 4194305) { set_store_value(zoomed, $zoomed = $imageDimensions[0] > calculatedDimensions[0], $zoomed); } + + if ($$self.$$.dirty[0] & /*$closing, $zoomed*/ 25165824) { + // if zoomed while closing, zoom out image and add class + // to change contain value on .bp-wrap to avoid cropping + if ($closing && $zoomed && !opts.intro) { + $$invalidate(5, closingWhileZoomed = true); + zoomDragTranslate.set([0, 0]); + } + } }; return [ $imageDimensions, sizes, - wrap, loaded, showLoader, - imageOutroStarted, pointerDown, closingWhileZoomed, $zoomDragTranslate, - $zoomed, - $closing, opts, srcset, thumb, @@ -1709,8 +1671,8 @@ function instance$3($$self, $$props, $$invalidate) { containerHeight, smallScreen, calculatedDimensions, - outrostart_handler, - div1_binding + $zoomed, + $closing ]; } @@ -1725,10 +1687,10 @@ class Image extends SvelteComponent { create_fragment$3, not_equal, { - stuff: 22, - containerWidth: 23, - containerHeight: 24, - smallScreen: 25 + stuff: 18, + containerWidth: 19, + containerHeight: 20, + smallScreen: 21 }, null, [-1, -1] @@ -1968,14 +1930,14 @@ function create_if_block(ctx) { let div1; let div0; let div0_transition; - let previous_key = /*activeItem*/ ctx[7].i; + let previous_key = /*activeItem*/ ctx[6].i; let key_block_anchor; let containerActions_action; let current; let mounted; let dispose; let key_block = create_key_block(ctx); - let if_block = (!/*smallScreen*/ ctx[12] || !/*hideControls*/ ctx[11]) && create_if_block_1(ctx); + let if_block = (!/*smallScreen*/ ctx[11] || !/*hideControls*/ ctx[10]) && create_if_block_1(ctx); return { c() { @@ -1985,8 +1947,8 @@ function create_if_block(ctx) { key_block_anchor = empty(); if (if_block) if_block.c(); attr(div1, "class", "bp-wrap"); - toggle_class(div1, "zoomed", /*$zoomed*/ ctx[15]); - toggle_class(div1, "bp-inline", /*inline*/ ctx[13]); + toggle_class(div1, "zoomed", /*$zoomed*/ ctx[14]); + toggle_class(div1, "bp-inline", /*inline*/ ctx[12]); }, m(target, anchor) { insert(target, div1, anchor); @@ -1994,18 +1956,17 @@ function create_if_block(ctx) { key_block.m(div1, null); append(div1, key_block_anchor); if (if_block) if_block.m(div1, null); - /*div1_binding*/ ctx[30](div1); current = true; if (!mounted) { - dispose = action_destroyer(containerActions_action = /*containerActions*/ ctx[23].call(null, div1)); + dispose = action_destroyer(containerActions_action = /*containerActions*/ ctx[22].call(null, div1)); mounted = true; } }, p(new_ctx, dirty) { ctx = new_ctx; - if (dirty[0] & /*activeItem*/ 128 && not_equal(previous_key, previous_key = /*activeItem*/ ctx[7].i)) { + if (dirty[0] & /*activeItem*/ 64 && not_equal(previous_key, previous_key = /*activeItem*/ ctx[6].i)) { group_outros(); transition_out(key_block, 1, 1, noop); check_outros(); @@ -2017,11 +1978,11 @@ function create_if_block(ctx) { key_block.p(ctx, dirty); } - if (!/*smallScreen*/ ctx[12] || !/*hideControls*/ ctx[11]) { + if (!/*smallScreen*/ ctx[11] || !/*hideControls*/ ctx[10]) { if (if_block) { if_block.p(ctx, dirty); - if (dirty[0] & /*smallScreen, hideControls*/ 6144) { + if (dirty[0] & /*smallScreen, hideControls*/ 3072) { transition_in(if_block, 1); } } else { @@ -2040,12 +2001,12 @@ function create_if_block(ctx) { check_outros(); } - if (dirty[0] & /*$zoomed*/ 32768) { - toggle_class(div1, "zoomed", /*$zoomed*/ ctx[15]); + if (dirty[0] & /*$zoomed*/ 16384) { + toggle_class(div1, "zoomed", /*$zoomed*/ ctx[14]); } - if (dirty[0] & /*inline*/ 8192) { - toggle_class(div1, "bp-inline", /*inline*/ ctx[13]); + if (dirty[0] & /*inline*/ 4096) { + toggle_class(div1, "bp-inline", /*inline*/ ctx[12]); } }, i(local) { @@ -2072,17 +2033,16 @@ function create_if_block(ctx) { if (detaching && div0_transition) div0_transition.end(); key_block.d(detaching); if (if_block) if_block.d(); - /*div1_binding*/ ctx[30](null); mounted = false; dispose(); } }; } -// (337:7) {:else} +// (339:7) {:else} function create_else_block(ctx) { let html_tag; - let raw_value = /*activeItem*/ ctx[7].html + ""; + let raw_value = /*activeItem*/ ctx[6].html + ""; let html_anchor; return { @@ -2096,7 +2056,7 @@ function create_else_block(ctx) { insert(target, html_anchor, anchor); }, p(ctx, dirty) { - if (dirty[0] & /*activeItem*/ 128 && raw_value !== (raw_value = /*activeItem*/ ctx[7].html + "")) html_tag.p(raw_value); + if (dirty[0] & /*activeItem*/ 64 && raw_value !== (raw_value = /*activeItem*/ ctx[6].html + "")) html_tag.p(raw_value); }, i: noop, o: noop, @@ -2107,7 +2067,7 @@ function create_else_block(ctx) { }; } -// (331:35) +// (333:35) function create_if_block_7(ctx) { let iframe; let current; @@ -2115,9 +2075,9 @@ function create_if_block_7(ctx) { iframe = new Iframe({ props: { stuff: { - activeItem: /*activeItem*/ ctx[7], - calculateDimensions: /*calculateDimensions*/ ctx[17], - setResizeFunc: /*setResizeFunc*/ ctx[16] + activeItem: /*activeItem*/ ctx[6], + calculateDimensions: /*calculateDimensions*/ ctx[16], + setResizeFunc: /*setResizeFunc*/ ctx[15] } } }); @@ -2133,10 +2093,10 @@ function create_if_block_7(ctx) { p(ctx, dirty) { const iframe_changes = {}; - if (dirty[0] & /*activeItem*/ 128) iframe_changes.stuff = { - activeItem: /*activeItem*/ ctx[7], - calculateDimensions: /*calculateDimensions*/ ctx[17], - setResizeFunc: /*setResizeFunc*/ ctx[16] + if (dirty[0] & /*activeItem*/ 64) iframe_changes.stuff = { + activeItem: /*activeItem*/ ctx[6], + calculateDimensions: /*calculateDimensions*/ ctx[16], + setResizeFunc: /*setResizeFunc*/ ctx[15] }; iframe.$set(iframe_changes); @@ -2156,7 +2116,7 @@ function create_if_block_7(ctx) { }; } -// (325:36) +// (327:36) function create_if_block_6(ctx) { let video; let current; @@ -2164,9 +2124,9 @@ function create_if_block_6(ctx) { video = new Video({ props: { stuff: { - activeItem: /*activeItem*/ ctx[7], - calculateDimensions: /*calculateDimensions*/ ctx[17], - setResizeFunc: /*setResizeFunc*/ ctx[16] + activeItem: /*activeItem*/ ctx[6], + calculateDimensions: /*calculateDimensions*/ ctx[16], + setResizeFunc: /*setResizeFunc*/ ctx[15] } } }); @@ -2182,10 +2142,10 @@ function create_if_block_6(ctx) { p(ctx, dirty) { const video_changes = {}; - if (dirty[0] & /*activeItem*/ 128) video_changes.stuff = { - activeItem: /*activeItem*/ ctx[7], - calculateDimensions: /*calculateDimensions*/ ctx[17], - setResizeFunc: /*setResizeFunc*/ ctx[16] + if (dirty[0] & /*activeItem*/ 64) video_changes.stuff = { + activeItem: /*activeItem*/ ctx[6], + calculateDimensions: /*calculateDimensions*/ ctx[16], + setResizeFunc: /*setResizeFunc*/ ctx[15] }; video.$set(video_changes); @@ -2205,7 +2165,7 @@ function create_if_block_6(ctx) { }; } -// (309:4) {#if activeItem.img} +// (311:4) {#if activeItem.img} function create_if_block_5(ctx) { let imageitem; let current; @@ -2213,20 +2173,20 @@ function create_if_block_5(ctx) { imageitem = new Image({ props: { stuff: { - activeItem: /*activeItem*/ ctx[7], - calculateDimensions: /*calculateDimensions*/ ctx[17], - loadImage: /*loadImage*/ ctx[19], - preloadNext: /*preloadNext*/ ctx[18], + activeItem: /*activeItem*/ ctx[6], + calculateDimensions: /*calculateDimensions*/ ctx[16], + loadImage: /*loadImage*/ ctx[18], + preloadNext: /*preloadNext*/ ctx[17], opts: /*opts*/ ctx[5], prev: /*prev*/ ctx[2], next: /*next*/ ctx[3], close: /*close*/ ctx[1], - toggleControls: /*toggleControls*/ ctx[22], - setResizeFunc: /*setResizeFunc*/ ctx[16] + toggleControls: /*toggleControls*/ ctx[21], + setResizeFunc: /*setResizeFunc*/ ctx[15] }, - containerWidth: /*containerWidth*/ ctx[9], - containerHeight: /*containerHeight*/ ctx[10], - smallScreen: /*smallScreen*/ ctx[12] + containerWidth: /*containerWidth*/ ctx[8], + containerHeight: /*containerHeight*/ ctx[9], + smallScreen: /*smallScreen*/ ctx[11] } }); @@ -2241,22 +2201,22 @@ function create_if_block_5(ctx) { p(ctx, dirty) { const imageitem_changes = {}; - if (dirty[0] & /*activeItem, opts*/ 160) imageitem_changes.stuff = { - activeItem: /*activeItem*/ ctx[7], - calculateDimensions: /*calculateDimensions*/ ctx[17], - loadImage: /*loadImage*/ ctx[19], - preloadNext: /*preloadNext*/ ctx[18], + if (dirty[0] & /*activeItem, opts*/ 96) imageitem_changes.stuff = { + activeItem: /*activeItem*/ ctx[6], + calculateDimensions: /*calculateDimensions*/ ctx[16], + loadImage: /*loadImage*/ ctx[18], + preloadNext: /*preloadNext*/ ctx[17], opts: /*opts*/ ctx[5], prev: /*prev*/ ctx[2], next: /*next*/ ctx[3], close: /*close*/ ctx[1], - toggleControls: /*toggleControls*/ ctx[22], - setResizeFunc: /*setResizeFunc*/ ctx[16] + toggleControls: /*toggleControls*/ ctx[21], + setResizeFunc: /*setResizeFunc*/ ctx[15] }; - if (dirty[0] & /*containerWidth*/ 512) imageitem_changes.containerWidth = /*containerWidth*/ ctx[9]; - if (dirty[0] & /*containerHeight*/ 1024) imageitem_changes.containerHeight = /*containerHeight*/ ctx[10]; - if (dirty[0] & /*smallScreen*/ 4096) imageitem_changes.smallScreen = /*smallScreen*/ ctx[12]; + if (dirty[0] & /*containerWidth*/ 256) imageitem_changes.containerWidth = /*containerWidth*/ ctx[8]; + if (dirty[0] & /*containerHeight*/ 512) imageitem_changes.containerHeight = /*containerHeight*/ ctx[9]; + if (dirty[0] & /*smallScreen*/ 2048) imageitem_changes.smallScreen = /*smallScreen*/ ctx[11]; imageitem.$set(imageitem_changes); }, i(local) { @@ -2274,10 +2234,10 @@ function create_if_block_5(ctx) { }; } -// (337:48) {#if activeItem.caption} +// (339:48) {#if activeItem.caption} function create_if_block_4(ctx) { let div; - let raw_value = /*activeItem*/ ctx[7].caption + ""; + let raw_value = /*activeItem*/ ctx[6].caption + ""; let div_transition; let current; @@ -2292,7 +2252,7 @@ function create_if_block_4(ctx) { current = true; }, p(ctx, dirty) { - if ((!current || dirty[0] & /*activeItem*/ 128) && raw_value !== (raw_value = /*activeItem*/ ctx[7].caption + "")) div.innerHTML = raw_value; }, + if ((!current || dirty[0] & /*activeItem*/ 64) && raw_value !== (raw_value = /*activeItem*/ ctx[6].caption + "")) div.innerHTML = raw_value; }, i(local) { if (current) return; @@ -2330,15 +2290,15 @@ function create_key_block(ctx) { const if_blocks = []; function select_block_type(ctx, dirty) { - if (/*activeItem*/ ctx[7].img) return 0; - if (/*activeItem*/ ctx[7].sources) return 1; - if (/*activeItem*/ ctx[7].iframe) return 2; + if (/*activeItem*/ ctx[6].img) return 0; + if (/*activeItem*/ ctx[6].sources) return 1; + if (/*activeItem*/ ctx[6].iframe) return 2; return 3; } current_block_type_index = select_block_type(ctx); if_block0 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); - let if_block1 = /*activeItem*/ ctx[7].caption && create_if_block_4(ctx); + let if_block1 = /*activeItem*/ ctx[6].caption && create_if_block_4(ctx); return { c() { @@ -2347,7 +2307,7 @@ function create_key_block(ctx) { if (if_block1) if_block1.c(); if_block1_anchor = empty(); attr(div, "class", "bp-inner"); - toggle_class(div, "bp-html", /*activeItemIsHtml*/ ctx[8]); + toggle_class(div, "bp-html", /*activeItemIsHtml*/ ctx[7]); }, m(target, anchor) { insert(target, div, anchor); @@ -2359,7 +2319,7 @@ function create_key_block(ctx) { if (!mounted) { dispose = [ listen(div, "pointerdown", /*pointerdown_handler*/ ctx[28]), - listen(div, "pointerup", self(/*pointerup_handler*/ ctx[29])) + listen(div, "pointerup", /*pointerup_handler*/ ctx[29]) ]; mounted = true; @@ -2392,15 +2352,15 @@ function create_key_block(ctx) { if_block0.m(div, null); } - if (dirty[0] & /*activeItemIsHtml*/ 256) { - toggle_class(div, "bp-html", /*activeItemIsHtml*/ ctx[8]); + if (dirty[0] & /*activeItemIsHtml*/ 128) { + toggle_class(div, "bp-html", /*activeItemIsHtml*/ ctx[7]); } - if (/*activeItem*/ ctx[7].caption) { + if (/*activeItem*/ ctx[6].caption) { if (if_block1) { if_block1.p(ctx, dirty); - if (dirty[0] & /*activeItem*/ 128) { + if (dirty[0] & /*activeItem*/ 64) { transition_in(if_block1, 1); } } else { @@ -2425,7 +2385,7 @@ function create_key_block(ctx) { add_render_callback(() => { if (div_outro) div_outro.end(1); - div_intro = create_in_transition(div, /*animateIn*/ ctx[20], {}); + div_intro = create_in_transition(div, /*animateIn*/ ctx[19], {}); div_intro.start(); }); @@ -2435,7 +2395,7 @@ function create_key_block(ctx) { o(local) { transition_out(if_block0); if (div_intro) div_intro.invalidate(); - div_outro = create_out_transition(div, /*animateOut*/ ctx[21], {}); + div_outro = create_out_transition(div, /*animateOut*/ ctx[20], {}); transition_out(if_block1); current = false; }, @@ -2451,7 +2411,7 @@ function create_key_block(ctx) { }; } -// (337:171) {#if !smallScreen || !hideControls} +// (339:171) {#if !smallScreen || !hideControls} function create_if_block_1(ctx) { let div; let if_block0_anchor; @@ -2526,7 +2486,7 @@ function create_if_block_1(ctx) { }; } -// (337:288) {#if !opts.noClose} +// (339:288) {#if !opts.noClose} function create_if_block_3(ctx) { let button; let mounted; @@ -2556,7 +2516,7 @@ function create_if_block_3(ctx) { }; } -// (342:12) {#if items.length > 1} +// (344:12) {#if items.length > 1} function create_if_block_2(ctx) { let div; let t_value = `${/*position*/ ctx[4] + 1} / ${/*items*/ ctx[0].length}` + ""; @@ -2666,8 +2626,8 @@ function create_fragment(ctx) { function instance($$self, $$props, $$invalidate) { let $closing; let $zoomed; - component_subscribe($$self, closing, $$value => $$invalidate(34, $closing = $$value)); - component_subscribe($$self, zoomed, $$value => $$invalidate(15, $zoomed = $$value)); + component_subscribe($$self, closing, $$value => $$invalidate(33, $closing = $$value)); + component_subscribe($$self, zoomed, $$value => $$invalidate(14, $zoomed = $$value)); let { items = undefined } = $$props; let { target = undefined } = $$props; @@ -2716,7 +2676,7 @@ function instance($$self, $$props, $$invalidate) { $$invalidate(5, opts = options); // disable scroll if not inline gallery - $$invalidate(13, inline = opts.inline); + $$invalidate(12, inline = opts.inline); inline || r(); @@ -2731,17 +2691,17 @@ function instance($$self, $$props, $$invalidate) { // update trigger element to restore focus focusTrigger = document.activeElement; - $$invalidate(9, containerWidth = target.offsetWidth); + $$invalidate(8, containerWidth = target.offsetWidth); - $$invalidate(10, containerHeight = target === document.body + $$invalidate(9, containerHeight = target === document.body ? window.innerHeight : target.clientHeight); - $$invalidate(12, smallScreen = containerWidth < 769); + $$invalidate(11, smallScreen = containerWidth < 769); $$invalidate(4, position = opts.position || 0); // reset controls - $$invalidate(11, hideControls = false); + $$invalidate(10, hideControls = false); // make array w/ dataset to work with $$invalidate(0, items = Array.isArray(openItems) @@ -2860,7 +2820,7 @@ function instance($$self, $$props, $$invalidate) { // animate media in when bp is first opened const animateIn = node => { if (!isOpen) { - $$invalidate(27, isOpen = 1); + $$invalidate(26, isOpen = 1); opts.onOpen && opts.onOpen(container, activeItem); return opts.intro @@ -2912,9 +2872,10 @@ function instance($$self, $$props, $$invalidate) { }; // toggle controls for small screen - const toggleControls = () => $$invalidate(11, hideControls = !hideControls); + const toggleControls = () => $$invalidate(10, hideControls = !hideControls); const containerActions = node => { + $$invalidate(27, container = node); let removeKeydownListener; let roActive; @@ -2927,9 +2888,9 @@ function instance($$self, $$props, $$invalidate) { const ro = new ResizeObserver(entries => { // use roActive to avoid running on initial open if (roActive) { - $$invalidate(9, containerWidth = entries[0].contentRect.width); - $$invalidate(10, containerHeight = entries[0].contentRect.height); - $$invalidate(12, smallScreen = containerWidth < 769); + $$invalidate(8, containerWidth = entries[0].contentRect.width); + $$invalidate(9, containerHeight = entries[0].contentRect.height); + $$invalidate(11, smallScreen = containerWidth < 769); // run child component resize function resizeFunc && resizeFunc(); @@ -2947,40 +2908,35 @@ function instance($$self, $$props, $$invalidate) { destroy() { ro.disconnect(); removeKeydownListener && removeKeydownListener(); - set_store_value(closing, $closing = $$invalidate(27, isOpen = false), $closing); + set_store_value(closing, $closing = $$invalidate(26, isOpen = false), $closing); s(); opts.onClosed && opts.onClosed(); } }; }; - const pointerdown_handler = ({ target }) => $$invalidate(14, clickedEl = target); + const pointerdown_handler = e => $$invalidate(13, clickedEl = e.target); - const pointerup_handler = e => { - // only close on left click and not dragged - e.button !== 2 && e.target === clickedEl && close(); + const pointerup_handler = function (e) { + // only close if left click on self and not dragged + if (e.button !== 2 && e.target === this && clickedEl === this) { + close(); + } }; - function div1_binding($$value) { - binding_callbacks[$$value ? 'unshift' : 'push'](() => { - container = $$value; - $$invalidate(6, container); - }); - } - $$self.$$set = $$props => { if ('items' in $$props) $$invalidate(0, items = $$props.items); - if ('target' in $$props) $$invalidate(24, target = $$props.target); + if ('target' in $$props) $$invalidate(23, target = $$props.target); }; $$self.$$.update = () => { - if ($$self.$$.dirty[0] & /*items, position, isOpen, activeItem, activeItemIsHtml, opts, container*/ 134218225) { + if ($$self.$$.dirty[0] & /*items, position, isOpen, activeItem, activeItemIsHtml, opts, container*/ 201326833) { if (items) { // update active item when position changes - $$invalidate(7, activeItem = items[position]); + $$invalidate(6, activeItem = items[position]); if (isOpen) { - $$invalidate(8, activeItemIsHtml = activeItem.hasOwnProperty('html')); + $$invalidate(7, activeItemIsHtml = activeItem.hasOwnProperty('html')); // clear child resize function if html activeItemIsHtml && setResizeFunc(null); @@ -2999,7 +2955,6 @@ function instance($$self, $$props, $$invalidate) { next, position, opts, - container, activeItem, activeItemIsHtml, containerWidth, @@ -3021,9 +2976,9 @@ function instance($$self, $$props, $$invalidate) { open, setPosition, isOpen, + container, pointerdown_handler, - pointerup_handler, - div1_binding + pointerup_handler ]; } @@ -3039,12 +2994,12 @@ class Bigger_picture extends SvelteComponent { not_equal, { items: 0, - target: 24, - open: 25, + target: 23, + open: 24, close: 1, prev: 2, next: 3, - setPosition: 26 + setPosition: 25 }, null, [-1, -1] @@ -3058,13 +3013,13 @@ class Bigger_picture extends SvelteComponent { get target() { - return this.$$.ctx[24]; + return this.$$.ctx[23]; } get open() { - return this.$$.ctx[25]; + return this.$$.ctx[24]; } get close() { @@ -3080,7 +3035,7 @@ class Bigger_picture extends SvelteComponent { } get setPosition() { - return this.$$.ctx[26]; + return this.$$.ctx[25]; } } diff --git a/dist/bigger-picture.umd.js b/dist/bigger-picture.umd.js index c1ff6d9..81f221d 100644 --- a/dist/bigger-picture.umd.js +++ b/dist/bigger-picture.umd.js @@ -116,13 +116,6 @@ node.addEventListener(event, handler, options); return () => node.removeEventListener(event, handler, options); } - function self(fn) { - return function (event) { - // @ts-ignore - if (event.target === this) - fn.call(this, event); - }; - } function attr(node, attribute, value) { if (value == null) node.removeAttribute(attribute); @@ -1058,27 +1051,20 @@ let img_sizes_value; let img_outro; let current; - let mounted; - let dispose; return { c() { img = element("img"); - attr(img, "srcset", /*srcset*/ ctx[12]); - attr(img, "sizes", img_sizes_value = /*opts*/ ctx[11].sizes || `${/*sizes*/ ctx[1]}px`); - attr(img, "alt", /*alt*/ ctx[14]); + attr(img, "srcset", /*srcset*/ ctx[8]); + attr(img, "sizes", img_sizes_value = /*opts*/ ctx[7].sizes || `${/*sizes*/ ctx[1]}px`); + attr(img, "alt", /*alt*/ ctx[10]); }, m(target, anchor) { insert(target, img, anchor); current = true; - - if (!mounted) { - dispose = listen(img, "outrostart", /*outrostart_handler*/ ctx[27]); - mounted = true; - } }, p(ctx, dirty) { - if (!current || dirty[0] & /*sizes*/ 2 && img_sizes_value !== (img_sizes_value = /*opts*/ ctx[11].sizes || `${/*sizes*/ ctx[1]}px`)) { + if (!current || dirty[0] & /*sizes*/ 2 && img_sizes_value !== (img_sizes_value = /*opts*/ ctx[7].sizes || `${/*sizes*/ ctx[1]}px`)) { attr(img, "sizes", img_sizes_value); } }, @@ -1094,21 +1080,19 @@ d(detaching) { if (detaching) detach(img); if (detaching && img_outro) img_outro.end(); - mounted = false; - dispose(); } }; } - // (410:10) {#if showLoader} + // (394:85) {#if showLoader} function create_if_block$1(ctx) { let loading; let current; loading = new Loading({ props: { - thumb: /*thumb*/ ctx[13], - loaded: /*loaded*/ ctx[3] + thumb: /*thumb*/ ctx[9], + loaded: /*loaded*/ ctx[2] } }); @@ -1122,7 +1106,7 @@ }, p(ctx, dirty) { const loading_changes = {}; - if (dirty[0] & /*loaded*/ 8) loading_changes.loaded = /*loaded*/ ctx[3]; + if (dirty[0] & /*loaded*/ 4) loading_changes.loaded = /*loaded*/ ctx[2]; loading.$set(loading_changes); }, i(local) { @@ -1147,8 +1131,8 @@ let current; let mounted; let dispose; - let if_block0 = /*loaded*/ ctx[3] && create_if_block_1$1(ctx); - let if_block1 = /*showLoader*/ ctx[4] && create_if_block$1(ctx); + let if_block0 = /*loaded*/ ctx[2] && create_if_block_1$1(ctx); + let if_block1 = /*showLoader*/ ctx[3] && create_if_block$1(ctx); return { c() { @@ -1158,13 +1142,13 @@ if_block0_anchor = empty(); if (if_block1) if_block1.c(); attr(div0, "class", "bp-item bp-img"); - set_style(div0, "background-image", "url(" + /*thumb*/ ctx[13] + ")"); + set_style(div0, "background-image", "url(" + /*thumb*/ ctx[9] + ")"); set_style(div0, "width", /*$imageDimensions*/ ctx[0][0] + "px"); set_style(div0, "height", /*$imageDimensions*/ ctx[0][1] + "px"); - set_style(div0, "transform", "translate3d(" + /*$zoomDragTranslate*/ ctx[8][0] + "px, " + /*$zoomDragTranslate*/ ctx[8][1] + "px, 0px)"); + set_style(div0, "transform", "translate3d(" + /*$zoomDragTranslate*/ ctx[6][0] + "px, " + /*$zoomDragTranslate*/ ctx[6][1] + "px, 0px)"); attr(div1, "class", "bp-img-wrap"); - toggle_class(div1, "bp-drag", /*pointerDown*/ ctx[6]); - toggle_class(div1, "bp-close", /*closingWhileZoomed*/ ctx[7]); + toggle_class(div1, "bp-drag", /*pointerDown*/ ctx[4]); + toggle_class(div1, "bp-close", /*closingWhileZoomed*/ ctx[5]); }, m(target, anchor) { insert(target, div1, anchor); @@ -1172,28 +1156,27 @@ if (if_block0) if_block0.m(div0, null); append(div0, if_block0_anchor); if (if_block1) if_block1.m(div0, null); - /*div1_binding*/ ctx[28](div1); current = true; if (!mounted) { dispose = [ - action_destroyer(/*onMount*/ ctx[21].call(null, div0)), - listen(div1, "wheel", /*onWheel*/ ctx[17]), - listen(div1, "pointerdown", /*onPointerDown*/ ctx[18]), - listen(div1, "pointermove", /*onPointerMove*/ ctx[19]), - listen(div1, "pointerup", /*onPointerUp*/ ctx[20]), - listen(div1, "pointercancel", /*onPointerUp*/ ctx[20]) + action_destroyer(/*onMount*/ ctx[17].call(null, div1)), + listen(div1, "wheel", /*onWheel*/ ctx[13]), + listen(div1, "pointerdown", /*onPointerDown*/ ctx[14]), + listen(div1, "pointermove", /*onPointerMove*/ ctx[15]), + listen(div1, "pointerup", /*onPointerUp*/ ctx[16]), + listen(div1, "pointercancel", /*onPointerUp*/ ctx[16]) ]; mounted = true; } }, p(ctx, dirty) { - if (/*loaded*/ ctx[3]) { + if (/*loaded*/ ctx[2]) { if (if_block0) { if_block0.p(ctx, dirty); - if (dirty[0] & /*loaded*/ 8) { + if (dirty[0] & /*loaded*/ 4) { transition_in(if_block0, 1); } } else { @@ -1212,11 +1195,11 @@ check_outros(); } - if (/*showLoader*/ ctx[4]) { + if (/*showLoader*/ ctx[3]) { if (if_block1) { if_block1.p(ctx, dirty); - if (dirty[0] & /*showLoader*/ 16) { + if (dirty[0] & /*showLoader*/ 8) { transition_in(if_block1, 1); } } else { @@ -1243,16 +1226,16 @@ set_style(div0, "height", /*$imageDimensions*/ ctx[0][1] + "px"); } - if (!current || dirty[0] & /*$zoomDragTranslate*/ 256) { - set_style(div0, "transform", "translate3d(" + /*$zoomDragTranslate*/ ctx[8][0] + "px, " + /*$zoomDragTranslate*/ ctx[8][1] + "px, 0px)"); + if (!current || dirty[0] & /*$zoomDragTranslate*/ 64) { + set_style(div0, "transform", "translate3d(" + /*$zoomDragTranslate*/ ctx[6][0] + "px, " + /*$zoomDragTranslate*/ ctx[6][1] + "px, 0px)"); } - if (dirty[0] & /*pointerDown*/ 64) { - toggle_class(div1, "bp-drag", /*pointerDown*/ ctx[6]); + if (dirty[0] & /*pointerDown*/ 16) { + toggle_class(div1, "bp-drag", /*pointerDown*/ ctx[4]); } - if (dirty[0] & /*closingWhileZoomed*/ 128) { - toggle_class(div1, "bp-close", /*closingWhileZoomed*/ ctx[7]); + if (dirty[0] & /*closingWhileZoomed*/ 32) { + toggle_class(div1, "bp-close", /*closingWhileZoomed*/ ctx[5]); } }, i(local) { @@ -1270,7 +1253,6 @@ if (detaching) detach(div1); if (if_block0) if_block0.d(); if (if_block1) if_block1.d(); - /*div1_binding*/ ctx[28](null); mounted = false; run_all(dispose); } @@ -1280,10 +1262,10 @@ function instance$3($$self, $$props, $$invalidate) { let $zoomDragTranslate; let $zoomed; - let $imageDimensions; let $closing; - component_subscribe($$self, zoomed, $$value => $$invalidate(9, $zoomed = $$value)); - component_subscribe($$self, closing, $$value => $$invalidate(10, $closing = $$value)); + let $imageDimensions; + component_subscribe($$self, zoomed, $$value => $$invalidate(23, $zoomed = $$value)); + component_subscribe($$self, closing, $$value => $$invalidate(24, $closing = $$value)); let { stuff } = $$props; let { containerWidth } = $$props; let { containerHeight } = $$props; @@ -1297,9 +1279,6 @@ let calculatedDimensions = calculateDimensions(naturalWidth, naturalHeight); let sizes = calculatedDimensions[0]; - // .bp-img-wrap element - let wrap; - // tracks load state of image let loaded, showLoader; @@ -1315,9 +1294,6 @@ // track distance for pinch events let prevDiff = 0; - // bool ignore pointer events if true - let imageOutroStarted; - let pointerDown, hasDragged; let dragStartX, dragStartY; @@ -1344,7 +1320,7 @@ // translate transform for pointerDown const zoomDragTranslate = tweened([0, 0], tweenOptions); - component_subscribe($$self, zoomDragTranslate, value => $$invalidate(8, $zoomDragTranslate = value)); + component_subscribe($$self, zoomDragTranslate, value => $$invalidate(6, $zoomDragTranslate = value)); // calculate translate position with bounds const boundTranslateValues = ([x, y], newDimensions = $imageDimensions) => { @@ -1396,7 +1372,7 @@ // updates zoom level in or out based on amt value const changeZoom = (e, amt = maxZoom) => { - if (imageOutroStarted) { + if ($closing) { return; } @@ -1467,7 +1443,7 @@ // don't run if right click if (e.button !== 2) { e.preventDefault(); - $$invalidate(6, pointerDown = true); + $$invalidate(4, pointerDown = true); eventCache.push(e); const [x, y] = [e.clientX, e.clientY]; dragStartX = x; @@ -1479,14 +1455,13 @@ // on drag, update image translate val const onPointerMove = e => { - // e.preventDefault() if (eventCache.length > 1) { isPinch = true; - $$invalidate(6, pointerDown = false); + $$invalidate(4, pointerDown = false); return handlePinch(e); } - if (imageOutroStarted || !pointerDown) { + if (!pointerDown) { return; } @@ -1504,12 +1479,14 @@ if (!$zoomed) { // previous if swipe left if (x > 40) { - prev(); + // pointerdown = undefined to stop pointermove from running again + $$invalidate(4, pointerDown = prev()); } // next if swipe right if (x < -40) { - next(); + // pointerdown = undefined to stop pointermove from running again + $$invalidate(4, pointerDown = next()); } // close if swipe up (don't close if inline) @@ -1521,7 +1498,7 @@ hasDragged = Math.hypot(x, y) > 10; // image drag when zoomed - if ($zoomed && hasDragged) { + if ($zoomed && hasDragged && !$closing) { zoomDragTranslate.set(boundTranslateValues([dragStartTranslateX + x, dragStartTranslateY + y]), { duration: 0 }); } }; @@ -1542,14 +1519,14 @@ } // scale image - changeZoom(e, (prevDiff - curDiff) * -0.015); + changeZoom(e, (prevDiff - curDiff) * -0.02); // Cache the distance for the next move event prevDiff = curDiff; }; // on mouse / touch end, set pointerDown to false - const onPointerUp = e => { + function onPointerUp(e) { // remove event from event cache eventCache = eventCache.filter(ev => ev.pointerId != e.pointerId); @@ -1562,16 +1539,16 @@ } // make sure pointer events don't carry over to next image - if (imageOutroStarted || !pointerDown) { + if (!pointerDown) { return; } // close if overlay is clicked - if (e.target === wrap && !inline) { + if (e.target === this && !inline) { return close(); } - $$invalidate(6, pointerDown = false); + $$invalidate(4, pointerDown = false); if (!smallScreen) { // if largescreen @@ -1625,79 +1602,64 @@ // reset dragPositions dragPositions = []; - }; + } const onMount = () => { // handle window resize setResizeFunc(() => { - $$invalidate(26, calculatedDimensions = calculateDimensions(naturalWidth, naturalHeight)); + $$invalidate(22, calculatedDimensions = calculateDimensions(naturalWidth, naturalHeight)); - // adjust image only if not smaller container - // some mobile browsers trigger resize constantly if dragging / pinching - if (!smallScreen) { - imageDimensions.set(calculatedDimensions); - zoomDragTranslate.set([0, 0]); - } + // adjust image size / zoom on resize + imageDimensions.set(calculatedDimensions); + + zoomDragTranslate.set([0, 0]); }); // decode initial image before rendering loadImage(activeItem).then(() => { - $$invalidate(3, loaded = true); + $$invalidate(2, loaded = true); preloadNext(); }); // show loading indicator if needed setTimeout( () => { - $$invalidate(4, showLoader = !loaded); + $$invalidate(3, showLoader = !loaded); }, 250 ); }; - const outrostart_handler = () => { - $$invalidate(5, imageOutroStarted = true); - - // if zoomed while closing, zoom out image and add class - // to change contain value on .bp-wrap to avoid cropping - if ($closing && $zoomed && !opts.intro) { - $$invalidate(7, closingWhileZoomed = true); - set_store_value(zoomDragTranslate, $zoomDragTranslate = [0, 0], $zoomDragTranslate); - } - }; - - function div1_binding($$value) { - binding_callbacks[$$value ? 'unshift' : 'push'](() => { - wrap = $$value; - $$invalidate(2, wrap); - }); - } - $$self.$$set = $$props => { - if ('stuff' in $$props) $$invalidate(22, stuff = $$props.stuff); - if ('containerWidth' in $$props) $$invalidate(23, containerWidth = $$props.containerWidth); - if ('containerHeight' in $$props) $$invalidate(24, containerHeight = $$props.containerHeight); - if ('smallScreen' in $$props) $$invalidate(25, smallScreen = $$props.smallScreen); + if ('stuff' in $$props) $$invalidate(18, stuff = $$props.stuff); + if ('containerWidth' in $$props) $$invalidate(19, containerWidth = $$props.containerWidth); + if ('containerHeight' in $$props) $$invalidate(20, containerHeight = $$props.containerHeight); + if ('smallScreen' in $$props) $$invalidate(21, smallScreen = $$props.smallScreen); }; $$self.$$.update = () => { - if ($$self.$$.dirty[0] & /*$imageDimensions, calculatedDimensions*/ 67108865) { + if ($$self.$$.dirty[0] & /*$imageDimensions, calculatedDimensions*/ 4194305) { set_store_value(zoomed, $zoomed = $imageDimensions[0] > calculatedDimensions[0], $zoomed); } + + if ($$self.$$.dirty[0] & /*$closing, $zoomed*/ 25165824) { + // if zoomed while closing, zoom out image and add class + // to change contain value on .bp-wrap to avoid cropping + if ($closing && $zoomed && !opts.intro) { + $$invalidate(5, closingWhileZoomed = true); + zoomDragTranslate.set([0, 0]); + } + } }; return [ $imageDimensions, sizes, - wrap, loaded, showLoader, - imageOutroStarted, pointerDown, closingWhileZoomed, $zoomDragTranslate, - $zoomed, - $closing, opts, srcset, thumb, @@ -1714,8 +1676,8 @@ containerHeight, smallScreen, calculatedDimensions, - outrostart_handler, - div1_binding + $zoomed, + $closing ]; } @@ -1730,10 +1692,10 @@ create_fragment$3, not_equal, { - stuff: 22, - containerWidth: 23, - containerHeight: 24, - smallScreen: 25 + stuff: 18, + containerWidth: 19, + containerHeight: 20, + smallScreen: 21 }, null, [-1, -1] @@ -1973,14 +1935,14 @@ let div1; let div0; let div0_transition; - let previous_key = /*activeItem*/ ctx[7].i; + let previous_key = /*activeItem*/ ctx[6].i; let key_block_anchor; let containerActions_action; let current; let mounted; let dispose; let key_block = create_key_block(ctx); - let if_block = (!/*smallScreen*/ ctx[12] || !/*hideControls*/ ctx[11]) && create_if_block_1(ctx); + let if_block = (!/*smallScreen*/ ctx[11] || !/*hideControls*/ ctx[10]) && create_if_block_1(ctx); return { c() { @@ -1990,8 +1952,8 @@ key_block_anchor = empty(); if (if_block) if_block.c(); attr(div1, "class", "bp-wrap"); - toggle_class(div1, "zoomed", /*$zoomed*/ ctx[15]); - toggle_class(div1, "bp-inline", /*inline*/ ctx[13]); + toggle_class(div1, "zoomed", /*$zoomed*/ ctx[14]); + toggle_class(div1, "bp-inline", /*inline*/ ctx[12]); }, m(target, anchor) { insert(target, div1, anchor); @@ -1999,18 +1961,17 @@ key_block.m(div1, null); append(div1, key_block_anchor); if (if_block) if_block.m(div1, null); - /*div1_binding*/ ctx[30](div1); current = true; if (!mounted) { - dispose = action_destroyer(containerActions_action = /*containerActions*/ ctx[23].call(null, div1)); + dispose = action_destroyer(containerActions_action = /*containerActions*/ ctx[22].call(null, div1)); mounted = true; } }, p(new_ctx, dirty) { ctx = new_ctx; - if (dirty[0] & /*activeItem*/ 128 && not_equal(previous_key, previous_key = /*activeItem*/ ctx[7].i)) { + if (dirty[0] & /*activeItem*/ 64 && not_equal(previous_key, previous_key = /*activeItem*/ ctx[6].i)) { group_outros(); transition_out(key_block, 1, 1, noop); check_outros(); @@ -2022,11 +1983,11 @@ key_block.p(ctx, dirty); } - if (!/*smallScreen*/ ctx[12] || !/*hideControls*/ ctx[11]) { + if (!/*smallScreen*/ ctx[11] || !/*hideControls*/ ctx[10]) { if (if_block) { if_block.p(ctx, dirty); - if (dirty[0] & /*smallScreen, hideControls*/ 6144) { + if (dirty[0] & /*smallScreen, hideControls*/ 3072) { transition_in(if_block, 1); } } else { @@ -2045,12 +2006,12 @@ check_outros(); } - if (dirty[0] & /*$zoomed*/ 32768) { - toggle_class(div1, "zoomed", /*$zoomed*/ ctx[15]); + if (dirty[0] & /*$zoomed*/ 16384) { + toggle_class(div1, "zoomed", /*$zoomed*/ ctx[14]); } - if (dirty[0] & /*inline*/ 8192) { - toggle_class(div1, "bp-inline", /*inline*/ ctx[13]); + if (dirty[0] & /*inline*/ 4096) { + toggle_class(div1, "bp-inline", /*inline*/ ctx[12]); } }, i(local) { @@ -2077,17 +2038,16 @@ if (detaching && div0_transition) div0_transition.end(); key_block.d(detaching); if (if_block) if_block.d(); - /*div1_binding*/ ctx[30](null); mounted = false; dispose(); } }; } - // (337:7) {:else} + // (339:7) {:else} function create_else_block(ctx) { let html_tag; - let raw_value = /*activeItem*/ ctx[7].html + ""; + let raw_value = /*activeItem*/ ctx[6].html + ""; let html_anchor; return { @@ -2101,7 +2061,7 @@ insert(target, html_anchor, anchor); }, p(ctx, dirty) { - if (dirty[0] & /*activeItem*/ 128 && raw_value !== (raw_value = /*activeItem*/ ctx[7].html + "")) html_tag.p(raw_value); + if (dirty[0] & /*activeItem*/ 64 && raw_value !== (raw_value = /*activeItem*/ ctx[6].html + "")) html_tag.p(raw_value); }, i: noop, o: noop, @@ -2112,7 +2072,7 @@ }; } - // (331:35) + // (333:35) function create_if_block_7(ctx) { let iframe; let current; @@ -2120,9 +2080,9 @@ iframe = new Iframe({ props: { stuff: { - activeItem: /*activeItem*/ ctx[7], - calculateDimensions: /*calculateDimensions*/ ctx[17], - setResizeFunc: /*setResizeFunc*/ ctx[16] + activeItem: /*activeItem*/ ctx[6], + calculateDimensions: /*calculateDimensions*/ ctx[16], + setResizeFunc: /*setResizeFunc*/ ctx[15] } } }); @@ -2138,10 +2098,10 @@ p(ctx, dirty) { const iframe_changes = {}; - if (dirty[0] & /*activeItem*/ 128) iframe_changes.stuff = { - activeItem: /*activeItem*/ ctx[7], - calculateDimensions: /*calculateDimensions*/ ctx[17], - setResizeFunc: /*setResizeFunc*/ ctx[16] + if (dirty[0] & /*activeItem*/ 64) iframe_changes.stuff = { + activeItem: /*activeItem*/ ctx[6], + calculateDimensions: /*calculateDimensions*/ ctx[16], + setResizeFunc: /*setResizeFunc*/ ctx[15] }; iframe.$set(iframe_changes); @@ -2161,7 +2121,7 @@ }; } - // (325:36) + // (327:36) function create_if_block_6(ctx) { let video; let current; @@ -2169,9 +2129,9 @@ video = new Video({ props: { stuff: { - activeItem: /*activeItem*/ ctx[7], - calculateDimensions: /*calculateDimensions*/ ctx[17], - setResizeFunc: /*setResizeFunc*/ ctx[16] + activeItem: /*activeItem*/ ctx[6], + calculateDimensions: /*calculateDimensions*/ ctx[16], + setResizeFunc: /*setResizeFunc*/ ctx[15] } } }); @@ -2187,10 +2147,10 @@ p(ctx, dirty) { const video_changes = {}; - if (dirty[0] & /*activeItem*/ 128) video_changes.stuff = { - activeItem: /*activeItem*/ ctx[7], - calculateDimensions: /*calculateDimensions*/ ctx[17], - setResizeFunc: /*setResizeFunc*/ ctx[16] + if (dirty[0] & /*activeItem*/ 64) video_changes.stuff = { + activeItem: /*activeItem*/ ctx[6], + calculateDimensions: /*calculateDimensions*/ ctx[16], + setResizeFunc: /*setResizeFunc*/ ctx[15] }; video.$set(video_changes); @@ -2210,7 +2170,7 @@ }; } - // (309:4) {#if activeItem.img} + // (311:4) {#if activeItem.img} function create_if_block_5(ctx) { let imageitem; let current; @@ -2218,20 +2178,20 @@ imageitem = new Image({ props: { stuff: { - activeItem: /*activeItem*/ ctx[7], - calculateDimensions: /*calculateDimensions*/ ctx[17], - loadImage: /*loadImage*/ ctx[19], - preloadNext: /*preloadNext*/ ctx[18], + activeItem: /*activeItem*/ ctx[6], + calculateDimensions: /*calculateDimensions*/ ctx[16], + loadImage: /*loadImage*/ ctx[18], + preloadNext: /*preloadNext*/ ctx[17], opts: /*opts*/ ctx[5], prev: /*prev*/ ctx[2], next: /*next*/ ctx[3], close: /*close*/ ctx[1], - toggleControls: /*toggleControls*/ ctx[22], - setResizeFunc: /*setResizeFunc*/ ctx[16] + toggleControls: /*toggleControls*/ ctx[21], + setResizeFunc: /*setResizeFunc*/ ctx[15] }, - containerWidth: /*containerWidth*/ ctx[9], - containerHeight: /*containerHeight*/ ctx[10], - smallScreen: /*smallScreen*/ ctx[12] + containerWidth: /*containerWidth*/ ctx[8], + containerHeight: /*containerHeight*/ ctx[9], + smallScreen: /*smallScreen*/ ctx[11] } }); @@ -2246,22 +2206,22 @@ p(ctx, dirty) { const imageitem_changes = {}; - if (dirty[0] & /*activeItem, opts*/ 160) imageitem_changes.stuff = { - activeItem: /*activeItem*/ ctx[7], - calculateDimensions: /*calculateDimensions*/ ctx[17], - loadImage: /*loadImage*/ ctx[19], - preloadNext: /*preloadNext*/ ctx[18], + if (dirty[0] & /*activeItem, opts*/ 96) imageitem_changes.stuff = { + activeItem: /*activeItem*/ ctx[6], + calculateDimensions: /*calculateDimensions*/ ctx[16], + loadImage: /*loadImage*/ ctx[18], + preloadNext: /*preloadNext*/ ctx[17], opts: /*opts*/ ctx[5], prev: /*prev*/ ctx[2], next: /*next*/ ctx[3], close: /*close*/ ctx[1], - toggleControls: /*toggleControls*/ ctx[22], - setResizeFunc: /*setResizeFunc*/ ctx[16] + toggleControls: /*toggleControls*/ ctx[21], + setResizeFunc: /*setResizeFunc*/ ctx[15] }; - if (dirty[0] & /*containerWidth*/ 512) imageitem_changes.containerWidth = /*containerWidth*/ ctx[9]; - if (dirty[0] & /*containerHeight*/ 1024) imageitem_changes.containerHeight = /*containerHeight*/ ctx[10]; - if (dirty[0] & /*smallScreen*/ 4096) imageitem_changes.smallScreen = /*smallScreen*/ ctx[12]; + if (dirty[0] & /*containerWidth*/ 256) imageitem_changes.containerWidth = /*containerWidth*/ ctx[8]; + if (dirty[0] & /*containerHeight*/ 512) imageitem_changes.containerHeight = /*containerHeight*/ ctx[9]; + if (dirty[0] & /*smallScreen*/ 2048) imageitem_changes.smallScreen = /*smallScreen*/ ctx[11]; imageitem.$set(imageitem_changes); }, i(local) { @@ -2279,10 +2239,10 @@ }; } - // (337:48) {#if activeItem.caption} + // (339:48) {#if activeItem.caption} function create_if_block_4(ctx) { let div; - let raw_value = /*activeItem*/ ctx[7].caption + ""; + let raw_value = /*activeItem*/ ctx[6].caption + ""; let div_transition; let current; @@ -2297,7 +2257,7 @@ current = true; }, p(ctx, dirty) { - if ((!current || dirty[0] & /*activeItem*/ 128) && raw_value !== (raw_value = /*activeItem*/ ctx[7].caption + "")) div.innerHTML = raw_value; }, + if ((!current || dirty[0] & /*activeItem*/ 64) && raw_value !== (raw_value = /*activeItem*/ ctx[6].caption + "")) div.innerHTML = raw_value; }, i(local) { if (current) return; @@ -2335,15 +2295,15 @@ const if_blocks = []; function select_block_type(ctx, dirty) { - if (/*activeItem*/ ctx[7].img) return 0; - if (/*activeItem*/ ctx[7].sources) return 1; - if (/*activeItem*/ ctx[7].iframe) return 2; + if (/*activeItem*/ ctx[6].img) return 0; + if (/*activeItem*/ ctx[6].sources) return 1; + if (/*activeItem*/ ctx[6].iframe) return 2; return 3; } current_block_type_index = select_block_type(ctx); if_block0 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); - let if_block1 = /*activeItem*/ ctx[7].caption && create_if_block_4(ctx); + let if_block1 = /*activeItem*/ ctx[6].caption && create_if_block_4(ctx); return { c() { @@ -2352,7 +2312,7 @@ if (if_block1) if_block1.c(); if_block1_anchor = empty(); attr(div, "class", "bp-inner"); - toggle_class(div, "bp-html", /*activeItemIsHtml*/ ctx[8]); + toggle_class(div, "bp-html", /*activeItemIsHtml*/ ctx[7]); }, m(target, anchor) { insert(target, div, anchor); @@ -2364,7 +2324,7 @@ if (!mounted) { dispose = [ listen(div, "pointerdown", /*pointerdown_handler*/ ctx[28]), - listen(div, "pointerup", self(/*pointerup_handler*/ ctx[29])) + listen(div, "pointerup", /*pointerup_handler*/ ctx[29]) ]; mounted = true; @@ -2397,15 +2357,15 @@ if_block0.m(div, null); } - if (dirty[0] & /*activeItemIsHtml*/ 256) { - toggle_class(div, "bp-html", /*activeItemIsHtml*/ ctx[8]); + if (dirty[0] & /*activeItemIsHtml*/ 128) { + toggle_class(div, "bp-html", /*activeItemIsHtml*/ ctx[7]); } - if (/*activeItem*/ ctx[7].caption) { + if (/*activeItem*/ ctx[6].caption) { if (if_block1) { if_block1.p(ctx, dirty); - if (dirty[0] & /*activeItem*/ 128) { + if (dirty[0] & /*activeItem*/ 64) { transition_in(if_block1, 1); } } else { @@ -2430,7 +2390,7 @@ add_render_callback(() => { if (div_outro) div_outro.end(1); - div_intro = create_in_transition(div, /*animateIn*/ ctx[20], {}); + div_intro = create_in_transition(div, /*animateIn*/ ctx[19], {}); div_intro.start(); }); @@ -2440,7 +2400,7 @@ o(local) { transition_out(if_block0); if (div_intro) div_intro.invalidate(); - div_outro = create_out_transition(div, /*animateOut*/ ctx[21], {}); + div_outro = create_out_transition(div, /*animateOut*/ ctx[20], {}); transition_out(if_block1); current = false; }, @@ -2456,7 +2416,7 @@ }; } - // (337:171) {#if !smallScreen || !hideControls} + // (339:171) {#if !smallScreen || !hideControls} function create_if_block_1(ctx) { let div; let if_block0_anchor; @@ -2531,7 +2491,7 @@ }; } - // (337:288) {#if !opts.noClose} + // (339:288) {#if !opts.noClose} function create_if_block_3(ctx) { let button; let mounted; @@ -2561,7 +2521,7 @@ }; } - // (342:12) {#if items.length > 1} + // (344:12) {#if items.length > 1} function create_if_block_2(ctx) { let div; let t_value = `${/*position*/ ctx[4] + 1} / ${/*items*/ ctx[0].length}` + ""; @@ -2671,8 +2631,8 @@ function instance($$self, $$props, $$invalidate) { let $closing; let $zoomed; - component_subscribe($$self, closing, $$value => $$invalidate(34, $closing = $$value)); - component_subscribe($$self, zoomed, $$value => $$invalidate(15, $zoomed = $$value)); + component_subscribe($$self, closing, $$value => $$invalidate(33, $closing = $$value)); + component_subscribe($$self, zoomed, $$value => $$invalidate(14, $zoomed = $$value)); let { items = undefined } = $$props; let { target = undefined } = $$props; @@ -2721,7 +2681,7 @@ $$invalidate(5, opts = options); // disable scroll if not inline gallery - $$invalidate(13, inline = opts.inline); + $$invalidate(12, inline = opts.inline); inline || r(); @@ -2736,17 +2696,17 @@ // update trigger element to restore focus focusTrigger = document.activeElement; - $$invalidate(9, containerWidth = target.offsetWidth); + $$invalidate(8, containerWidth = target.offsetWidth); - $$invalidate(10, containerHeight = target === document.body + $$invalidate(9, containerHeight = target === document.body ? window.innerHeight : target.clientHeight); - $$invalidate(12, smallScreen = containerWidth < 769); + $$invalidate(11, smallScreen = containerWidth < 769); $$invalidate(4, position = opts.position || 0); // reset controls - $$invalidate(11, hideControls = false); + $$invalidate(10, hideControls = false); // make array w/ dataset to work with $$invalidate(0, items = Array.isArray(openItems) @@ -2865,7 +2825,7 @@ // animate media in when bp is first opened const animateIn = node => { if (!isOpen) { - $$invalidate(27, isOpen = 1); + $$invalidate(26, isOpen = 1); opts.onOpen && opts.onOpen(container, activeItem); return opts.intro @@ -2917,9 +2877,10 @@ }; // toggle controls for small screen - const toggleControls = () => $$invalidate(11, hideControls = !hideControls); + const toggleControls = () => $$invalidate(10, hideControls = !hideControls); const containerActions = node => { + $$invalidate(27, container = node); let removeKeydownListener; let roActive; @@ -2932,9 +2893,9 @@ const ro = new ResizeObserver(entries => { // use roActive to avoid running on initial open if (roActive) { - $$invalidate(9, containerWidth = entries[0].contentRect.width); - $$invalidate(10, containerHeight = entries[0].contentRect.height); - $$invalidate(12, smallScreen = containerWidth < 769); + $$invalidate(8, containerWidth = entries[0].contentRect.width); + $$invalidate(9, containerHeight = entries[0].contentRect.height); + $$invalidate(11, smallScreen = containerWidth < 769); // run child component resize function resizeFunc && resizeFunc(); @@ -2952,40 +2913,35 @@ destroy() { ro.disconnect(); removeKeydownListener && removeKeydownListener(); - set_store_value(closing, $closing = $$invalidate(27, isOpen = false), $closing); + set_store_value(closing, $closing = $$invalidate(26, isOpen = false), $closing); s(); opts.onClosed && opts.onClosed(); } }; }; - const pointerdown_handler = ({ target }) => $$invalidate(14, clickedEl = target); + const pointerdown_handler = e => $$invalidate(13, clickedEl = e.target); - const pointerup_handler = e => { - // only close on left click and not dragged - e.button !== 2 && e.target === clickedEl && close(); + const pointerup_handler = function (e) { + // only close if left click on self and not dragged + if (e.button !== 2 && e.target === this && clickedEl === this) { + close(); + } }; - function div1_binding($$value) { - binding_callbacks[$$value ? 'unshift' : 'push'](() => { - container = $$value; - $$invalidate(6, container); - }); - } - $$self.$$set = $$props => { if ('items' in $$props) $$invalidate(0, items = $$props.items); - if ('target' in $$props) $$invalidate(24, target = $$props.target); + if ('target' in $$props) $$invalidate(23, target = $$props.target); }; $$self.$$.update = () => { - if ($$self.$$.dirty[0] & /*items, position, isOpen, activeItem, activeItemIsHtml, opts, container*/ 134218225) { + if ($$self.$$.dirty[0] & /*items, position, isOpen, activeItem, activeItemIsHtml, opts, container*/ 201326833) { if (items) { // update active item when position changes - $$invalidate(7, activeItem = items[position]); + $$invalidate(6, activeItem = items[position]); if (isOpen) { - $$invalidate(8, activeItemIsHtml = activeItem.hasOwnProperty('html')); + $$invalidate(7, activeItemIsHtml = activeItem.hasOwnProperty('html')); // clear child resize function if html activeItemIsHtml && setResizeFunc(null); @@ -3004,7 +2960,6 @@ next, position, opts, - container, activeItem, activeItemIsHtml, containerWidth, @@ -3026,9 +2981,9 @@ open, setPosition, isOpen, + container, pointerdown_handler, - pointerup_handler, - div1_binding + pointerup_handler ]; } @@ -3044,12 +2999,12 @@ not_equal, { items: 0, - target: 24, - open: 25, + target: 23, + open: 24, close: 1, prev: 2, next: 3, - setPosition: 26 + setPosition: 25 }, null, [-1, -1] @@ -3063,13 +3018,13 @@ get target() { - return this.$$.ctx[24]; + return this.$$.ctx[23]; } get open() { - return this.$$.ctx[25]; + return this.$$.ctx[24]; } get close() { @@ -3085,7 +3040,7 @@ } get setPosition() { - return this.$$.ctx[26]; + return this.$$.ctx[25]; } } diff --git a/package.json b/package.json index 638efd7..d5fbab2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bigger-picture", - "version": "0.2.0", + "version": "0.2.1", "main": "dist/bigger-picture.umd.js", "module": "dist/bigger-picture.mjs", "svelte": "src/bigger-picture.js",