@fancyapps/ui
Version:
Robust JavaScript UI Component Library
4 lines • 97.5 kB
JavaScript
!/*! License details at fancyapps.com/license */function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).window=e.window||{})}(this,function(e){"use strict";let t,n,o,i,a=e=>"string"==typeof e,l=e=>e&&null!==e&&e instanceof Element&&"nodeType"in e,r=function(e){if(!(e&&e instanceof Element&&e.offsetParent))return!1;let t=e.scrollHeight>e.clientHeight,n=window.getComputedStyle(e).overflowY,o=-1!==n.indexOf("hidden"),i=-1!==n.indexOf("visible");return t&&!o&&!i},s=function(e,t){return!e||e===document.body||t&&e===t?null:r(e)?e:s(e.parentElement,t)},c=function(e){var t=new DOMParser().parseFromString(e,"text/html").body;if(t.childElementCount>1){for(var n=document.createElement("div");t.firstChild;)n.appendChild(t.firstChild);return n}let o=t.firstChild;if(o&&!(o instanceof HTMLElement)){var n=document.createElement("div");return n.appendChild(o),n}return o},u=function(e=0,t=0,n=0){return Math.max(Math.min(t,n),e)},d=e=>"object"==typeof e&&null!==e&&e.constructor===Object&&"[object Object]"===Object.prototype.toString.call(e);function f(e){return d(e)||Array.isArray(e)}function g(e,t){let n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&n.every(n=>{let o=e[n],i=t[n];return"function"==typeof o?`${o}`==`${i}`:f(o)&&f(i)?g(o,i):o===i})}let p=1/60*3e3,m=function(e){for(let t of C)t.getState()===h.Running&&t.tick(A?e-A:0);A=e,O=window.requestAnimationFrame(m)},h=((v={})[v.Initializing=0]="Initializing",v[v.Running=1]="Running",v[v.Paused=2]="Paused",v[v.Completed=3]="Completed",v[v.Destroyed=4]="Destroyed",v);var v,y,b,E,w,x,M,L,S,T,R=((y=R||{})[y.Spring=0]="Spring",y[y.Ease=1]="Ease",y);let P=((b={})[b.Loop=0]="Loop",b[b.Reverse=1]="Reverse",b),C=new Set,O=null,A=0;function z(){let e=h.Initializing,t=R.Ease,n=0,o=0,i=z.Easings.Linear,a=500,l=0,r=0,s=0,c=0,d=1/0,f=.01,v=.01,y=!1,b={},E=null,w={},x={},M={},L=0,S=0,T=P.Loop,A=z.Easings.Linear,k=new Map;function I(e,...t){for(let n of k.get(e)||[])n(...t)}function $(e){return o=0,e?E=setTimeout(()=>{F()},e):F(),D}function F(){e=h.Running,I("start",w,x)}function _(){if(e=h.Completed,M={},I("end",w),e===h.Completed)if(n<L){if(n++,T===P.Reverse){let e={...b};b={...x},x=e}$(S)}else n=0;return D}let D={getState:function(){return e},easing:function(e){return i=e,t=R.Ease,M={},D},duration:function(e){return a=e,D},spring:function(e={}){t=R.Spring;let{velocity:n,mass:o,tension:i,friction:a,restDelta:u,restSpeed:g,maxSpeed:p,clamp:m}={velocity:0,mass:1,tension:170,friction:26,restDelta:.1,restSpeed:.1,maxSpeed:1/0,clamp:!0,...e};return l=n,r=o,s=i,c=a,v=u,f=g,d=p,y=m,M={},D},isRunning:function(){return e===h.Running},isSpring:function(){return t===R.Spring},from:function(e){return w={...e},D},to:function(e){return x=e,D},repeat:function(e,t=0,n=P.Loop,o){return L=e,S=t,T=n,A=o||i,D},on:function(e,t){return k.set(e,[...k.get(e)||[],t]),D},off:function(e,t){return k.has(e)&&k.set(e,k.get(e).filter(e=>e!==t)),D},start:function(t){return e=h.Initializing,g(b={...w},x)||(C.add(this),O||(O=window.requestAnimationFrame(m)),$(t)),D},pause:function(){return E&&(clearTimeout(E),E=null),e===h.Running&&(e=h.Paused,I("pause",w)),D},end:_,tick:function(n){n>p&&(n=p),o+=n;let m=0,E=!1;if(e!==h.Running)return D;if(t===R.Ease){E=1===(m=u(0,o/a,1));let e=T===P.Reverse?A:i;for(let t in w)w[t]=b[t]+(x[t]-b[t])*e(m)}if(t===R.Spring){let e=.001*n,t=0;for(let n in w){let o=x[n],i=w[n];if(!("number"==typeof o&&!isNaN(o))||!("number"==typeof i&&!isNaN(i)))continue;if(Math.abs(o-i)<=v){w[n]=o,M[n]=0;continue}M[n]||("object"==typeof l&&"number"==typeof l[n]?M[n]=l[n]:"number"==typeof l?M[n]=l:M[n]=0);let a=M[n],g=(a=u(-1*Math.abs(d),a,Math.abs(d)))*r*c,p=Math.abs(o-i)*s;a+=((i>o?-1:1)*p-g)/r*e,i+=a*e;let m=w[n]>o?i<o:i>o,h=Math.abs(a)<f&&Math.abs(o-i)<=v;y&&m&&(h=!0),h?(i=o,a=0):t++,w[n]=i,M[n]=a}E=!t}let L={...x};return I("step",w,b,x,m),E&&e===h.Running&&g(x,L)&&(e=h.Completed,_()),D},getStartValues:function(){return b},getCurrentValues:function(){return w},getCurrentVelocities:function(){return M},getEndValues:function(){return x},destroy:function(){e=h.Destroyed,E&&(clearTimeout(E),E=null),b=w=x={},C.delete(this)}};return D}function k(e){let t=[];for(let n of"undefined"!=typeof TouchEvent&&e instanceof TouchEvent?e.touches:e instanceof MouseEvent&&"mouseup"!==e.type?[e]:[])t.push({x:n.clientX,y:n.clientY,ts:Date.now()});return t}function I(e){let t=[];for(let n of"undefined"!=typeof TouchEvent&&e instanceof TouchEvent?e.changedTouches:e instanceof MouseEvent?[e]:[])t.push({x:n.clientX,y:n.clientY,ts:Date.now()});return t}function $(e){let t=e[0],n=e[1]||t;return{x:(t.x+n.x)/2,y:(t.y+n.y)/2,ts:n.ts}}function F(e){let t=e[0],n=e[1]||e[0];return t&&n?-1*Math.sqrt((n.x-t.x)*(n.x-t.x)+(n.y-t.y)*(n.y-t.y)):0}z.destroy=()=>{for(let e of C)e.destroy();O&&(cancelAnimationFrame(O),O=null)},z.Easings={Linear:function(e){return e},EaseIn:function(e){return 0===e?0:Math.pow(2,10*e-10)},EaseOut:function(e){return 1===e?1:1-Math.pow(2,-10*e)},EaseInOut:function(e){return 0===e?0:1===e?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2}};let _=e=>{e.cancelable&&e.preventDefault()},D={passive:!1},H={panThreshold:5,swipeThreshold:3,ignore:["textarea","input","select","[contenteditable]","[data-selectable]","[data-draggable]"]},V=!1,j=!0,N=(e,t)=>{let n,o,i,a={...H,...t},l=[],r=[],s=[],c=!1,u=!1,d=!1,f=0,g=0,p=0,m=0,h=0,v=0,y=0,b=0,E=0,w=[],x=0,M=0,L=new Map;function S(e){let t=F(r),a=F(s),d=Math.abs(y)>Math.abs(b)?y:b,f={srcEvent:i,isPanRecognized:c,isSwipeRecognized:u,firstTouch:l,previousTouch:s,currentTouch:r,deltaX:p,deltaY:m,offsetX:h,offsetY:v,velocityX:y,velocityY:b,velocity:d,angle:E,axis:o,scale:t&&a?t/a:0,center:n};for(let t of L.get(e)||[])t(f)}function T(e){let t=Date.now();w=w.filter(e=>!e.ts||e.ts>t-100),e&&w.push(e)}function R(){if(y=0,b=0,w.length>3){let e=w[0],t=w[w.length-1];if(e&&t){let n=t.x-e.x,o=t.y-e.y,i=e.ts&&t.ts?t.ts-e.ts:0;i>0&&(y=Math.abs(n)>3?n/(i/30):0,b=Math.abs(o)>3?o/(i/30):0)}}}function P(e){if(e instanceof MouseEvent){if(V)return}else V=!0;let t=e.composedPath()[0],o=a.ignore.join(",");if(t.matches(o)||t.closest(o)||"undefined"!=typeof MouseEvent&&e instanceof MouseEvent&&(!e.buttons||0!==e.button))return;e instanceof MouseEvent&&_(e);let p=Date.now(),m=p-(f||p);d=m>0&&m<=250,f=p,clearTimeout(x),i=e,e instanceof MouseEvent&&(window.addEventListener("mousemove",C),window.addEventListener("mouseup",O)),window.addEventListener("blur",A),l=[...r=k(e)],s=[],g=r.length,n=$(r),1===g&&(c=!1,u=!1),g&&T($(r)),S("start")}function C(e){if(!l.length||e.defaultPrevented)return;i=e,s=[...r],g=(r=k(e)).length;let t=n=$(r),u=$(s);if(p=t.x-u.x,m=t.y-u.y,T(t),R(),S("move"),r.length>1&&Math.abs(F(r)-F(s))>=.1&&S("pinch"),!c&&l.length){let e=$(l);h=t.x-e.x,v=t.y-e.y,(c=Math.abs(h)>a.panThreshold||Math.abs(v)>a.panThreshold)&&(j=!1,clearTimeout(M),M=0,o=(E=Math.abs(180*Math.atan2(v,h)/Math.PI))>45&&E<135?"y":"x",l=[...r],s=[...r],window.getSelection()?.removeAllRanges(),S("panstart"))}c&&(p||m)&&S("pan")}function O(e){if(i=e,!l.length)return;let t=k(e),o=I(e);if(g=t.length,n=$(o),o.length&&T($(o)),R(),s=[...r],r=[...t],l=[...t],t.length>0)S("end"),c=!1,u=!1,w=[];else{let e=a.swipeThreshold;(Math.abs(y)>e||Math.abs(b)>e)&&(u=!0),c&&S("panend"),u&&S("swipe"),c||u||(S("tap"),d?S("doubleTap"):x=setTimeout(function(){S("singleTap")},250)),S("end"),z()}}function A(){clearTimeout(x),z(),c&&S("panend"),S("end")}function z(){c=!1,u=!1,d=!1,g=0,w=[],r=[],s=[],l=[],p=0,m=0,h=0,v=0,y=0,b=0,E=0,o=void 0,window.removeEventListener("mousemove",C),window.removeEventListener("mouseup",O),window.removeEventListener("blur",A),j||M||(M=setTimeout(()=>{j=!0,M=0},100))}function N(e){let t=e.target;V=!1,t&&!e.defaultPrevented&&(j||(_(e),e.stopPropagation()))}let q={init:function(){if(e)return e.addEventListener("click",N,D),e.addEventListener("mousedown",P,D),e.addEventListener("touchstart",P,D),e.addEventListener("touchmove",C,D),e.addEventListener("touchend",O),e.addEventListener("touchcancel",O),q},on:function(e,t){return L.set(e,[...L.get(e)||[],t]),q},off:function(e,t){return L.has(e)&&L.set(e,L.get(e).filter(e=>e!==t)),q},isPointerDown:()=>g>0,destroy:function(){clearTimeout(x),clearTimeout(M),M=0,e&&(e.removeEventListener("click",N,D),e.removeEventListener("mousedown",P,D),e.removeEventListener("touchstart",P,D),e.removeEventListener("touchmove",C,D),e.removeEventListener("touchend",O),e.removeEventListener("touchcancel",O)),e=null,z()}};return q};N.isClickAllowed=()=>j;let q={IMAGE_ERROR:"This image couldn't be loaded. <br /> Please try again later.",MOVE_UP:"Move up",MOVE_DOWN:"Move down",MOVE_LEFT:"Move left",MOVE_RIGHT:"Move right",ZOOM_IN:"Zoom in",ZOOM_OUT:"Zoom out",TOGGLE_FULL:"Toggle zoom level",TOGGLE_1TO1:"Toggle zoom level",ITERATE_ZOOM:"Toggle zoom level",ROTATE_CCW:"Rotate counterclockwise",ROTATE_CW:"Rotate clockwise",FLIP_X:"Flip horizontally",FLIP_Y:"Flip vertically",RESET:"Reset"},B=(e,t="")=>{e&&e.classList&&t.split(" ").forEach(t=>{t&&e.classList.add(t)})},W=1e4,Z=e=>{e.cancelable&&e.preventDefault()},G=(e,t=W)=>Math.round(((e=parseFloat(e+"")||0)+Number.EPSILON)*t)/t,Y=((E={}).Reset="reset",E.Zoom="zoom",E.ZoomIn="zoomIn",E.ZoomOut="zoomOut",E.ZoomTo="zoomTo",E.ToggleCover="toggleCover",E.ToggleFull="toggleFull",E.ToggleMax="toggleMax",E.IterateZoom="iterateZoom",E.Pan="pan",E.Swipe="swipe",E.Move="move",E.MoveLeft="moveLeft",E.MoveRight="moveRight",E.MoveUp="moveUp",E.MoveDown="moveDown",E.RotateCCW="rotateCCW",E.RotateCW="rotateCW",E.FlipX="flipX",E.FlipY="flipY",E),X=((w={}).Cover="cover",w.Full="full",w.Max="max",w),U={x:0,y:0,scale:1,angle:0,flipX:1,flipY:1},K=((x={})[x.Init=0]="Init",x[x.Loading=1]="Loading",x[x.Error=2]="Error",x[x.Ready=3]="Ready",x[x.Destroyed=4]="Destroyed",x),J={bounds:!0,classes:{container:"f-panzoom",wrapper:"f-panzoom__wrapper",content:"f-panzoom__content",viewport:"f-panzoom__viewport"},clickAction:Y.ToggleFull,dblClickAction:!1,gestures:{},height:"auto",l10n:q,maxScale:4,minScale:1,mouseMoveFactor:1,panMode:"drag",protected:!1,singleClickAction:!1,spinnerTpl:'<div class="f-spinner"></div>',wheelAction:Y.Zoom,width:"auto"},Q=0,ee=0,et=0,en=(e,n={},o={})=>{let i,r,d,f,g,p,m,h=K.Init,v={...J,...n},y={},b={...U},E={...U},w=[];function x(e){let t=v[e];return t&&"function"==typeof t?t(ep):t}let M=new Map;function L(e,...t){let n=M.get(e)||[];for(let o of(v.on&&n.push(v.on[e]),n))o&&o instanceof Function&&o(ep,...t);"*"!==e&&L("*",e,...t)}function S(e){if(h!==K.Ready||s(e.target))return;let t=Date.now(),n=u(-1,[-e.deltaX||0,-e.deltaY||0,-e.detail||0].reduce(function(e,t){return Math.abs(t)>Math.abs(e)?t:e}),1);L("wheel",e,n);let o=x("wheelAction");if(!o||e.defaultPrevented)return;let i=E.scale,a=i*(n>0?1.5:.5);if(o===Y.Zoom){let o=100>Math.abs(e.deltaY)&&100>Math.abs(e.deltaX);if(t-ee<(o?200:45))return void Z(e);ee=t;let l=_(),r=j();if(G(a)<G(l)&&G(i)<=G(l)?(et+=Math.abs(n),a=l):G(a)>G(r)&&G(i)>=G(r)?(et+=Math.abs(n),a=r):(et=0,a=u(l,a,r)),et>7)return}switch(Z(e),o){case Y.Pan:eo(o,{srcEvent:e,deltaX:-(2*e.deltaX),deltaY:-(2*e.deltaY)});break;case Y.Zoom:eo(Y.ZoomTo,{srcEvent:e,scale:a,center:{x:e.clientX,y:e.clientY}});break;default:eo(o,{srcEvent:e})}}function T(n){let o=n.composedPath()[0];if(!N.isClickAllowed()||!l(o)||n.defaultPrevented||!e?.contains(o)||o.hasAttribute("disabled")||o.hasAttribute("aria-disabled"))return;let a=o.closest("[data-panzoom-action]"),r=a?.dataset?.panzoomAction,s=a?.dataset?.panzoomValue||"";if(r){switch(r){case Y.ZoomTo:case Y.ZoomIn:case Y.ZoomOut:eo(r,{scale:parseFloat(s||"")||void 0});break;case Y.MoveLeft:case Y.MoveRight:eo(r,{deltaX:parseFloat(s||"")||void 0});break;case Y.MoveUp:case Y.MoveDown:eo(r,{deltaY:parseFloat(s||"")||void 0});break;default:eo(r)}return}if(!i?.contains(o))return;let c={srcEvent:n};if(eo(x("clickAction"),c),x("dblClickAction")){let e=Date.now(),n=e-(Q||e);Q=e,n>0&&n<=250?(t&&(clearTimeout(t),t=void 0),eo(x("dblClickAction"),c)):t=setTimeout(()=>{eo(x("singleClickAction"),c)},250)}}function R(e){if(m=e,!A()||h!==K.Ready||b.scale<=1||E.scale<=1||(i?.dataset.animationName||"").indexOf("zoom")>-1)return;let t=k(E.scale);if(!t)return;let{x:n,y:o}=t;eo(Y.Pan,{deltaX:n-E.x,deltaY:o-E.y})}function P(){if(e&&(e.querySelector(".f-spinner")?.remove(),e.classList.remove("is-loading")),!e||!i)return;if(r instanceof HTMLImageElement&&!(r.complete&&r.naturalWidth)){h=K.Error,i?.classList.add("has-error"),L("error");return}L("loaded");let{width:t,height:n}=O();r&&(r.setAttribute("width",t+""),r.setAttribute("height",n+"")),i&&(i.classList.remove("has-error"),i.setAttribute("width",t+""),i.setAttribute("height",n+""),i.style.aspectRatio=`${t/n||""}`),g=z().on("start",(e,t)=>{E={...U,...t},void 0!==t.angle&&(t.angle=90*Math.round(t.angle/90)),void 0!==t.flipX&&(t.flipX=t.flipX>0?1:-1),void 0!==t.flipY&&(t.flipY=t.flipY>0?1:-1),en(),L("animationStart")}).on("pause",e=>{E={...U,...e}}).on("step",t=>{if(h!==K.Ready||!g)return;if(!e||!e.parentElement)return void g.end();if(b={...U,...t},A()||!x("bounds")||f?.isPointerDown()||E.scale>b.scale||E.scale<D())return void ei();let n=q(E.scale),o=!1,i=!1,a=!1,l=!1;b.x<n.x[0]&&(o=!0),b.x>n.x[1]&&(i=!0),b.y<n.y[0]&&(l=!0),b.y>n.y[1]&&(a=!0);let r=!1,s=!1,c=!1,d=!1;E.x<n.x[0]&&(r=!0),E.x>n.x[1]&&(s=!0),E.y<n.y[0]&&(d=!0),E.y>n.y[1]&&(c=!0);let p=!1;(i&&s||o&&r)&&(E.x=u(n.x[0],E.x,n.x[1]),p=!0),(a&&c||l&&d)&&(E.y=u(n.y[0],E.y,n.y[1]),p=!0),p&&g.spring({tension:94,friction:17,maxSpeed:555*E.scale,restDelta:.1,restSpeed:.1,velocity:g.getCurrentVelocities()}).from(b).to(E).start(),ei()}).on("end",()=>{X(),g?.isRunning()||(en(),L("animationEnd"))}),function(){let e=x("gestures");e&&d&&r&&(f=N(d,e).on("start",e=>{if(!g)return;let t=e.srcEvent;A()||((b.scale>1||e.currentTouch.length>1)&&(t?.stopPropagation(),g.pause()),1===e.currentTouch.length&&L("touchStart"))}).on("move",e=>{!A()&&(1!==E.scale||e.currentTouch.length>1)&&(e.srcEvent.preventDefault(),e.srcEvent.stopPropagation())}).on("pan",e=>{if(A())return;let t=e.srcEvent;(1!==E.scale||e.currentTouch.length>1)&&(Z(t),eo(Y.Pan,e))}).on("swipe",e=>{!A()&&E.scale>1&&eo(Y.Swipe,e)}).on("tap",e=>{L("click",e)}).on("singleTap",e=>{L("singleClick",e)}).on("doubleTap",e=>{L("dblClick",e)}).on("pinch",e=>{A()||(e.scale>D()?eo(Y.ZoomIn,e):e.scale<D()?eo(Y.ZoomOut,e):eo(Y.Pan,e))}).on("end",e=>{A()||(e.currentTouch.length?(e.srcEvent.stopPropagation(),Z(e.srcEvent),g?.end()):(en(),X(),L("touchEnd")))}).init())}(),d&&(d.addEventListener("wheel",S,{passive:!1}),w.push(()=>{d?.removeEventListener("wheel",S,{passive:!1})})),e?.addEventListener("click",T),document?.addEventListener("mousemove",R),w.push(()=>{e?.removeEventListener("click",T),document?.removeEventListener("mousemove",R)});let o={...x("startPos")||{},...{scale:D()}};if(b={...U,...o},E={...U,...o},A()){let e=k(E.scale);if(e){let{x:t,y:n}=e;b.x=t,b.y=n,E.x=t,E.y=n}}h=K.Ready,ei(),en(),L("ready"),requestAnimationFrame(()=>{d&&(d.style.visibility="")})}function C(){let e={top:0,left:0,width:0,height:0};if(i){let t=i.getBoundingClientRect();E.angle%180==90?(e.top=t.top+.5*t.height-.5*t.width,e.left=t.left+.5*t.width-.5*t.height,e.width=t.height,e.height=t.width):(e.top=t.top,e.left=t.left,e.width=t.width,e.height=t.height)}return e}function O(){let e=x("width"),t=x("height");if(r&&"auto"===e){let t=r.getAttribute("width");e=t?parseFloat(t+""):void 0!==r.dataset.width?parseFloat(r.dataset.width+""):d instanceof HTMLImageElement?d.naturalWidth:r instanceof HTMLImageElement?r.naturalWidth:r.getBoundingClientRect().width}else e=a(e)?parseFloat(e):e;if(r&&"auto"===t){let e=r.getAttribute("height");t=e?parseFloat(e+""):void 0!==r.dataset.height?parseFloat(r.dataset.height+""):d instanceof HTMLImageElement?d.naturalHeight:r instanceof HTMLImageElement?r.naturalHeight:r.getBoundingClientRect().height}else t=a(t)?parseFloat(t):t;return{width:e,height:t}}function A(){return"mousemove"===x("panMode")&&matchMedia("(hover: hover)").matches}function k(e){let t=m||x("event"),n=i?.getBoundingClientRect();if(!t||!n||e<=1)return{x:0,y:0};let o=(t.clientX||0)-n.left,a=(t.clientY||0)-n.top,l=n.width,r=n.height,s=q(e);if(e>1){let t=x("mouseMoveFactor");t>1&&(e*=t)}let c=l*e,d=r*e,f=(c-l)*.5-o/l*100/100*(c-l),g=(d-r)*.5-a/r*100/100*(d-r);return{x:f=u(s.x[0],f,s.x[1]),y:g=u(s.y[0],g,s.y[1])}}function F(t="base"){if(!e)return 1;let n=e.getBoundingClientRect(),o=C(),{width:i,height:a}=O(),l=e=>{if("number"==typeof e)return e;switch(e){case"min":case"base":return 1;case"cover":return Math.max(n.height/o.height,n.width/o.width)||1;case"full":case"max":{let e=E.angle%180==90?a:i;return e&&o.width?e/o.width:1}}},r=x("minScale"),s=x("maxScale"),c=Math.min(l("full"),l(r)),d="number"==typeof s?l("full")*s:Math.min(l("full"),l(s));switch(t){case"min":return c;case"base":return u(c,1,d);case"cover":return l("cover");case"full":return Math.min(d,l("full"));case"max":return d}}function _(){return F("min")}function D(){return F("base")}function H(){return F("cover")}function V(){return F("full")}function j(){return F("max")}function q(t){let n={x:[0,0],y:[0,0]},o=e?.getBoundingClientRect();if(!o)return n;let i=C(),a=o.width,l=o.height,r=i.width,s=i.height,c=t=void 0===t?E.scale:t,u=t;if(A()&&t>1){let e=x("mouseMoveFactor");e>1&&(r*t>a+.01&&(c*=e),s*t>l+.01&&(u*=e))}return r*=c,s*=u,t>1&&(r>a&&(n.x[0]=(a-r)*.5,n.x[1]=(r-a)*.5),n.x[0]-=(i.left-o.left)*.5,n.x[1]-=(i.left-o.left)*.5,n.x[0]-=(i.left+i.width-o.right)*.5,n.x[1]-=(i.left+i.width-o.right)*.5,s>l&&(n.y[0]=(l-s)*.5,n.y[1]=(s-l)*.5),n.y[0]-=(i.top-o.top)*.5,n.y[1]-=(i.top-o.top)*.5,n.y[0]-=(i.top+i.height-o.bottom)*.5,n.y[1]-=(i.top+i.height-o.bottom)*.5),n}function X(){if(!x("bounds")||h!==K.Ready||!e?.parentElement||!g)return;let t=_(),n=j(),o=u(t,E.scale,n);if(E.scale<t-.01||E.scale>n+.01)return void eo(Y.ZoomTo,{scale:o});if(g.isRunning()||f?.isPointerDown())return;let i=q(o);E.x<i.x[0]||E.x>i.x[1]||E.y<i.y[0]||E.y>i.y[1]?(E.x=u(i.x[0],E.x,i.x[1]),E.y=u(i.y[0],E.y,i.y[1]),g.spring({tension:170,friction:17,restDelta:.001,restSpeed:.001,maxSpeed:1/0,velocity:g.getCurrentVelocities()}),g.from(b).to(E).start()):ei()}function en(){if(!e||!e.parentElement||!i)return;let t=eu(),n=ed(),o=ef(),a=eg(),l=el(),r=er();i.classList.toggle("is-fullsize",a),i.classList.toggle("is-expanded",o),i.classList.toggle("is-dragging",n),i.classList.toggle("can-drag",t),i.classList.toggle("will-zoom-in",l),i.classList.toggle("will-zoom-out",r);let s=es(),c=ec(),u=h!==K.Ready;for(let t of e?.querySelectorAll("[data-panzoom-action]")||[]){let e=t.dataset.panzoomAction,n=!1;if(u)n=!0;else switch(e){case Y.ZoomIn:s||(n=!0);break;case Y.ZoomOut:c||(n=!0);break;case Y.ToggleFull:s||c||(n=!0);let o=t.querySelector("g");o&&(o.style.display=a?"none":"");break;case Y.ToggleCover:case Y.ToggleMax:s||c||(n=!0)}n?(t.setAttribute("aria-disabled",""),t.setAttribute("tabindex","-1")):(t.removeAttribute("aria-disabled"),t.removeAttribute("tabindex"))}}function eo(t,n){if(!e||!r||!g||t===Y.Swipe&&Math.abs(g.getCurrentVelocities().scale)>.01)return;let o={...E},i=q(A()?E.scale:b.scale),a=g.getCurrentVelocities(),l=C();n=n||{};let s=(n.currentTouch?.length||0)>1,c=n.velocityX||0,d=n.velocityY||0,p=n.center;!p&&n.srcEvent&&(p=$(I(n.srcEvent)));let m=n.deltaX||0,h=n.deltaY||0;switch(t){case Y.MoveRight:m=n.deltaX||100;break;case Y.MoveLeft:m=n.deltaX||-100;break;case Y.MoveUp:h=n.deltaY||-100;break;case Y.MoveDown:h=n.deltaY||100}let v=[];switch(t){case Y.Reset:(E={...U}).scale=D();break;case Y.Pan:case Y.Move:case Y.MoveLeft:case Y.MoveRight:case Y.MoveUp:case Y.MoveDown:if(f?.isPointerDown()){let e=1,t=1;E.x<=i.x[0]&&c<=0&&(e=.2*Math.max(.01,1-Math.abs(1/l.width*Math.abs(E.x-i.x[0])))),E.x>=i.x[1]&&c>=0&&(e=.2*Math.max(.01,1-Math.abs(1/l.width*Math.abs(E.x-i.x[1])))),E.y<=i.y[0]&&d<=0&&(t=.2*Math.max(.01,1-Math.abs(1/l.height*Math.abs(E.y-i.y[0])))),E.y>=i.y[1]&&d>=0&&(t=.2*Math.max(.01,1-Math.abs(1/l.height*Math.abs(E.y-i.y[1])))),E.x+=m*e,E.y+=h*t}else E.x=u(i.x[0],E.x+m,i.x[1]),E.y=u(i.y[0],E.y+h,i.y[1]);break;case Y.Swipe:let y=(e=0)=>Math.sign(e)*Math.pow(Math.abs(e),1.5);E.x+=u(-1e3,y(c),1e3),E.y+=u(-1e3,y(d),1e3),d&&!c&&(E.x=u(i.x[0],E.x,i.x[1])),!d&&c&&(E.y=u(i.y[0],E.y,i.y[1])),a.x=c,a.y=d;break;case Y.ZoomTo:E.scale=n.scale||1;break;case Y.ZoomIn:E.scale=E.scale*(n.scale||2),s||(E.scale=Math.min(E.scale,j()));break;case Y.ZoomOut:E.scale=E.scale*(n.scale||.5),s||(E.scale=Math.max(E.scale,_()));break;case Y.ToggleCover:v=[D(),H()];break;case Y.ToggleFull:v=[D(),V()];break;case Y.ToggleMax:v=[D(),j()];break;case Y.IterateZoom:v=[D(),V(),j()];break;case Y.Zoom:let w=V();E.scale>=w-.05?E.scale=D():E.scale=Math.min(w,E.scale*(n.scale||2));break;case Y.RotateCW:E.angle+=90;break;case Y.RotateCCW:E.angle-=90;break;case Y.FlipX:E.flipX*=-1;break;case Y.FlipY:E.flipY*=-1}if(void 0!==b.angle&&Math.abs(b.angle)>=360&&(E.angle-=360*Math.floor(b.angle/360),b.angle-=360*Math.floor(b.angle/360)),v.length){let e=v.findIndex(e=>e>E.scale+1/W);E.scale=v[e]||v[0]}if(s&&(E.scale=u(_()*(s?.8:1),E.scale,j()*(s?1.6:1))),A()){let e=k(E.scale);if(e){let{x:t,y:n}=e;E.x=t,E.y=n}}else if(E.scale!==o.scale){let t=0,n=0;if(p)t=p.x,n=p.y;else{let o=e.getBoundingClientRect();t=o.x+.5*o.width,n=o.y+.5*o.height}let a=t-l.left,r=n-l.top;a-=.5*l.width,r-=.5*l.height;let c=(a-o.x)/o.scale,d=(r-o.y)/o.scale;E.x=a-c*E.scale,E.y=r-d*E.scale,!s&&x("bounds")&&(i=q(E.scale),E.x=u(i.x[0],E.x,i.x[1]),E.y=u(i.y[0],E.y,i.y[1]))}if(t===Y.Swipe){let e=500*E.scale;g.spring({tension:94,friction:17,maxSpeed:e,restDelta:.1,restSpeed:.1,velocity:a})}else t===Y.Pan||s?g.spring({tension:750,friction:17,restDelta:.01,restSpeed:.01,maxSpeed:1}):g.spring({tension:170,friction:17,restDelta:.001,restSpeed:.001,maxSpeed:1/0,velocity:a});t===Y.Reset&&0===n.velocity?b={...E}:g.from(b).to(E).start(),L("action",t)}function ei(){if(!i||!r)return;if(r instanceof HTMLImageElement){let{width:e,height:t}=O();i.style.maxWidth=`min(${e}px, 100%)`,i.style.maxHeight=`min(${t}px, 100%)`}let{x:t,y:n,scale:o,angle:a,flipX:l,flipY:s}=b,c=`translate3d(${t}px, ${n}px, 0)`;1!==l||1!==s?c+=` scaleX(${o*l}) scaleY(${o*s})`:1!==o&&(c+=` scale(${o})`),a%360!=0&&(c+=` rotate(${a}deg)`);let u=function(){let t=C(),n=t.width,o=t.height,{width:i,height:a}=O();if(!e)return{x:0,y:0,width:0,height:0,scale:0,flipX:0,flipY:0,angle:0,fitWidth:n,fitHeight:o,fullWidth:i,fullHeight:a};let{x:l,y:r,scale:s,angle:c,flipX:u,flipY:d}=b,f=1/V(),g=i,p=a,m=b.scale*f,h=E.scale*f,v=Math.max(n,o),y=Math.min(n,o);i>a?(g=v,p=y):(g=y,p=v),m=i>a?v*s/i||1:v*s/a||1;let w=g?i*h:0,x=p?a*h:0,M=g&&p?i*m/w:0;return{x:l=l+.5*g-.5*w,y:r=r+.5*p-.5*x,width:w,height:x,scale:M,flipX:u,flipY:d,angle:c,fitWidth:n,fitHeight:o,fullWidth:i,fullHeight:a}}();if(i&&u){let{x:e,y:t,width:n,height:o,scale:i,flipX:l,flipY:r}=u,s=`translate(${G(e)}px, ${G(t)}px)`;1!==l||1!==r?s+=` scaleX(${G(i*l)}) scaleY(${G(i*r)})`:s+=` scale(${G(i)})`,0!==a&&(s+=` rotate(${a}deg)`),d&&(d.style.width=`${G(n)}px`,d.style.height=`${G(o)}px`,d.style.transform=`${s}`)}L("render")}function ea(){let e=E.scale,t=void 0,n=x("clickAction"),o=D();if(n){let i=[];switch(n){case Y.ZoomIn:o=e*(t||2);break;case Y.ZoomOut:o=e*(t||.5);break;case Y.ToggleCover:i=[D(),H()];break;case Y.ToggleFull:i=[D(),V()];break;case Y.ToggleMax:i=[D(),j()];break;case Y.IterateZoom:i=[D(),V(),j()];break;case Y.Zoom:let a=V();o=e>=a-.05?D():Math.min(a,e*(t||2))}if(i.length){let t=i.findIndex(t=>t>e+1/W);o=i[t]||D()}}return u(_(),o,j())}function el(){return h===K.Ready&&ea()>E.scale}function er(){return h===K.Ready&&ea()<E.scale}function es(){return h===K.Ready&&E.scale<j()}function ec(){return h===K.Ready&&E.scale>_()}function eu(){return h===K.Ready&&ef()&&!!f&&!A()}function ed(){return h===K.Ready&&f?.isPointerDown()&&!A()}function ef(){return h===K.Ready&&E.scale>D()}function eg(){return h===K.Ready&&E.scale>=V()}let ep={canDrag:eu,canZoomIn:es,canZoomOut:ec,destroy:function(){for(let e of(L("destroy"),Object.values(y)))e?.destroy(ep);for(let e of w)e();return i&&(i.style.aspectRatio="",i.style.maxWidth="",i.style.maxHeight=""),d&&(d.style.width="",d.style.height="",d.style.transform=""),i=void 0,r=void 0,d=void 0,b={...U},E={...U},g?.destroy(),g=void 0,f?.destroy(),f=void 0,h=K.Destroyed,ep},emit:L,execute:eo,getBoundaries:q,getContainer:function(){return e},getFullDim:O,getGestures:function(){return f},getMousemovePos:k,getOptions:function(){return v},getScale:F,getState:function(){return h},getTransform:function(e){return!0===e?E:b},getTween:function(){return g},getViewport:function(){return d},getWrapper:function(){return i},init:function(){return h=K.Init,L("init"),function(){for(let[e,t]of Object.entries({...o,...v.plugins||{}}))if(e&&!y[e]&&t instanceof Function){let n=t();n.init(ep),y[e]=n}L("initPlugins")}(),function(){if(!e)return;let t={...J.classes,...x("classes")};if((B(e,t.container),r=e.querySelector("."+t.content))&&(r.setAttribute("draggable","false"),(i=e.querySelector("."+t.wrapper))||(B(i=document.createElement("div"),t.wrapper),r.insertAdjacentElement("beforebegin",i),i.insertAdjacentElement("afterbegin",r)),r instanceof HTMLImageElement||r instanceof HTMLPictureElement)){if(!(d=e.querySelector("."+t.viewport))){B(d=document.createElement("div"),t.viewport);let e=r.cloneNode(!0);e.classList.remove("is-lazyloading"),e.classList.remove("is-lazyloaded"),d.insertAdjacentElement("afterbegin",e),i.insertAdjacentElement("beforeend",d)}if(r instanceof HTMLPictureElement&&(r=r.querySelector("img")),d instanceof HTMLPictureElement&&(d=d.querySelector("img")),d.style.visibility="hidden",x("protected")){d.addEventListener("contextmenu",e=>{e.preventDefault()});let e=document.createElement("div");B(e,"f-panzoom__protected"),d.appendChild(e)}L("initLayout")}}(),function(){if(!(r&&r instanceof HTMLImageElement))return;let t=()=>{r&&r instanceof HTMLImageElement&&r.decode().then(()=>{requestAnimationFrame(()=>{P()})}).catch(()=>{P()})};if(r.src&&r.complete)return t();h=K.Loading,function(){let t=e?.querySelector(".f-spinner");if(!e||t)return;let n=c(x("spinnerTpl"));n&&(n.classList.add("f-spinner"),e.classList.add("is-loading"),i?.insertAdjacentElement("afterbegin",n))}(),L("loading"),r.addEventListener("load",t,!1),r.addEventListener("error",t,!1),w.push(()=>{r?.removeEventListener("load",t,!1),r?.removeEventListener("error",t,!1)})}(),function(){if(e&&!p){let t=null;(p=new ResizeObserver(()=>{t||(t=requestAnimationFrame(()=>{e&&e.parentElement&&h===K.Ready&&(en(),X(),L("refresh")),t=null}))})).observe(e),w.push(()=>{p?.disconnect(),p=void 0,t&&(cancelAnimationFrame(t),t=null)})}}(),ep},isDragging:ed,isExpanded:ef,isFullsize:eg,localize:function(e,t=[]){let n=x("l10n")||{};e=String(e).replace(/\{\{(\w+)\}\}/g,(e,t)=>n[t]||e);for(let n=0;n<t.length;n++)e=e.split(t[n][0]).join(t[n][1]);return e=e.replace(/\{\{(.*?)\}\}/g,(e,t)=>t)},off:function(e,t){for(let n of e instanceof Array?e:[e])M.has(n)&&M.set(n,M.get(n).filter(e=>e!==t));return ep},on:function(e,t){for(let n of e instanceof Array?e:[e])M.set(n,[...M.get(n)||[],t]);return ep},version:"6.0.14",willZoomIn:el,willZoomOut:er};return ep};en.l10n={en_EN:q},en.getDefaults=()=>J;let eo=(e,t)=>{let n=[];return e.childNodes.forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&(!t||e.matches(t))&&n.push(e)}),n},ei=(e,...t)=>{let n=t.length;for(let o=0;o<n;o++)Object.entries(t[o]||{}).forEach(([t,n])=>{let o=Array.isArray(n)?[]:{};e[t]||Object.assign(e,{[t]:o}),d(n)?Object.assign(e[t],ei(o,n)):Array.isArray(n)?Object.assign(e,{[t]:[...n]}):Object.assign(e,{[t]:n})});return e},ea=function(e=0,t=0,n=0,o=0,i=0,a=!1){let l=(e-t)/(n-t)*(i-o)+o;return a?o<i?u(o,l,i):u(i,l,o):l},el=(e,t="")=>{e&&e.classList&&t.split(" ").forEach(t=>{t&&e.classList.remove(t)})},er=(e,t="",n)=>{e&&e.classList&&t.split(" ").forEach(t=>{t&&e.classList.toggle(t,n||!1)})},es={...q,ERROR:"Something went wrong. <br /> Please try again later.",NEXT:"Next page",PREV:"Previous page",GOTO:"Go to page #%d",DOWNLOAD:"Download",TOGGLE_FULLSCREEN:"Toggle full-screen mode",TOGGLE_EXPAND:"Toggle full-size mode",TOGGLE_THUMBS:"Toggle thumbnails",TOGGLE_AUTOPLAY:"Toggle slideshow"},ec=e=>{e.cancelable&&e.preventDefault()},eu=((M={})[M.Init=0]="Init",M[M.Ready=1]="Ready",M[M.Destroyed=2]="Destroyed",M),ed=((L={})[L.Loading=0]="Loading",L[L.Loaded=1]="Loaded",L[L.Error=2]="Error",L),ef={adaptiveHeight:!1,center:!0,classes:{container:"f-carousel",isEnabled:"is-enabled",isLTR:"is-ltr",isRTL:"is-rtl",isHorizontal:"is-horizontal",isVertical:"is-vertical",hasAdaptiveHeight:"has-adaptive-height",viewport:"f-carousel__viewport",slide:"f-carousel__slide",isSelected:"is-selected"},dragFree:!1,enabled:!0,errorTpl:'<div class="f-html">{{ERROR}}</div>',fill:!1,infinite:!0,initialPage:0,l10n:es,rtl:!1,slides:[],slidesPerPage:"auto",spinnerTpl:'<div class="f-spinner"></div>',transition:"fade",tween:{clamp:!0,mass:1,tension:200,friction:25,restDelta:1,restSpeed:1,velocity:0},vertical:!1},eg=0,ep=(e,t={},o={})=>{let i,r,f,g,p;eg++;let m=eu.Init,h={...ef},v={...ef},y={},b=null,E=null,w=!1,x=!1,M=!1,L=!1,S="height",T=0,R=!0,P=0,C=0,O=0,A=0,k="*",I=[],$=[],F=new Set,_=[],D=[],H=0,V=0;function j(e,...t){let n=v[e];return n&&n instanceof Function?n(eO,...t):n}function q(e,t=[]){let n=j("l10n")||{};e=String(e).replace(/\{\{(\w+)\}\}/g,(e,t)=>n[t]||e);for(let n=0;n<t.length;n++)e=e.split(t[n][0]).join(t[n][1]);return e=e.replace(/\{\{(.*?)\}\}/g,(e,t)=>t)}let W=new Map;function Z(e,...t){let n=W.get(e)||[];for(let o of(v.on&&n.push(v.on[e]),n))o&&o instanceof Function&&o(eO,...t);"*"!==e&&Z("*",e,...t)}function G(){let e=ei({},ef,h);ei(e,ef,h);let t="",n=h.breakpoints||{};if(n)for(let[o,i]of Object.entries(n))window.matchMedia(o).matches&&(t+=o,ei(e,i));if(void 0===p||t!==p){if(p=t,m!==eu.Init){let t=D[P]?.slides[0]?.index;for(let n of(void 0===t&&(t=v.initialSlide),e.initialSlide=t,e.slides=[],I))n.isVirtual&&e.slides.push(n)}eC(),!1!==(v=e).enabled&&(m=eu.Init,Z("init"),function(){for(let[e,t]of Object.entries({...o,...v.plugins||{}}))if(e&&!y[e]&&t instanceof Function){let n=t();n.init(eO,ep),y[e]=n}Z("initPlugins")}(),function(){if(!b)return;let e=j("classes")||{};B(b,e.container),B(b,e.isEnabled);let t=j("style");if(t&&d(t))for(let[e,n]of Object.entries(t))b.style.setProperty(e,n);(E=b.querySelector(`.${e.viewport}`))||(B(E=document.createElement("div"),e.viewport),E.append(...eo(b,`.${e.slide}`)),b.insertAdjacentElement("afterbegin",E)),w="visible"===window.getComputedStyle(E).getPropertyValue("overflow"),b.carousel=eO,Z("initLayout")}(),function(){if(!E)return;let e=j("classes")||{};for(let t of(I=[],[...eo(E,`.${e.slide}`)].forEach(e=>{e.parentElement&&(I.push(em({el:e,isVirtual:!1,...e.dataset||{}})),e.parentElement.removeChild(e))}),ed(j("slides")),I))Z("addSlide",t);Z("initSlides")}(),r=z().on("start",()=>{R=!1,i&&i.isPointerDown()||(U(),eP())}).on("step",e=>{T=e.pos,eP()}).on("end",e=>{!i?.isPointerDown()&&(T=e.pos,r&&!x&&(T<O||T>A)?r.spring({clamp:!0,mass:1,tension:200,friction:25,velocity:0,restDelta:1,restSpeed:1}).from({pos:T}).to({pos:u(O,T,A)}).start():R||(R=!0,Z("settle")))}),function(){let e=j("gestures");E&&!1!==e&&(i=N(E,e).on("start",e=>{if(!r)return;let{srcEvent:t}=e;L&&ec(t),r.pause(),r.getCurrentVelocities().pos=0;let n=D[P]?.slides[0];n&&F.has(n.index)&&n.el&&(T=(n.offset||0)+(function(e){let t=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return{width:t.m41||0,height:t.m42||0}}(n.el)[S]||0)*(M&&!L?1:-1)),ew(),!x&&(T<O||T>A)&&r.spring({clamp:!0,mass:1,tension:500,friction:25,velocity:r.getCurrentVelocities()?.pos||0,restDelta:1,restSpeed:1}).from({pos:T}).to({pos:u(O,T,A)}).start()}).on("move",e=>{let{srcEvent:t,axis:n}=e,o=e.srcEvent.target;o&&s(o)||(n||(t.stopPropagation(),t.stopImmediatePropagation()),("y"===n&&L||"x"===n&&!L)&&(ec(t),t.stopPropagation()))}).on("panstart",e=>{e?.axis===(L?"y":"x")&&B(E,"is-dragging")}).on("panend",()=>{el(E,"is-dragging")}).on("pan",e=>{let{deltaX:t,deltaY:n,currentTouch:o,axis:i}=e;if(!r||o.length>1||"y"===i&&!L||"x"===i&&L)return;let a=M&&!L?1:-1,l=L?n:t,s=r?.isRunning()?r.getEndValues().pos:T,c=1;!x&&(s<=O&&l*a<0?c=.2*Math.max(.01,1-Math.abs(1/et()*Math.abs(s-O))):s>=A&&l*a>0&&(c=.2*Math.max(.01,1-Math.abs(1/et()*Math.abs(s-A))))),s+=l*c*a,r.spring({clamp:!0,mass:1,tension:700,friction:25,velocity:r.getCurrentVelocities()?.pos||0,restDelta:1,restSpeed:1}).from({pos:T}).to({pos:s}).start()}).on("end",e=>{let{axis:t,velocityX:n,velocityY:o,currentTouch:i}=e,a=D.length,l=j("dragFree");if(i.length>0||!r||!a)return;let s=j("vertical")?o:n,c=r?.isRunning()?r.getEndValues().pos:T,d=M&&!L?1:-1;if(c+=s*(l?5:1)*d,!x&&(s*d<=0&&c<O||s*d>=0&&c>A)){let e=0;Math.abs(s)>0&&(e=2*Math.abs(s),e=Math.min(.3*et(),e)),c=u(O+-1*e,c,A+e),r.spring({clamp:!0,mass:1,tension:380,friction:25,velocity:-1*s,restDelta:1,restSpeed:1}).from({pos:T}).to({pos:c}).start();return}if(l||y.Autoscroll?.isEnabled())return void(Math.abs(s)>10?r.spring({clamp:!0,mass:1,tension:150,friction:25,velocity:-1*s,restDelta:1,restSpeed:1}).from({pos:T}).to({pos:c}).start():r.isRunning()||R||(R=!0,Z("settle")));if(!(l||y.Autoscroll?.isEnabled())&&(!(e.offsetX||e.offsetY)||"y"===t&&!L||"x"===t&&L))return void eR(P,{transition:"tween"});let f=Q(c);Math.abs(s)>10&&f===P&&(s>0?f+=M&&!L?1:-1:f+=M&&!L?-1:1),eR(f,{transition:"tween",tween:{tension:160,friction:25,velocity:-1*s}})}).init())}(),eb(),function(){if(b&&(b.addEventListener("click",eM,{passive:!1}),document.addEventListener("mousemove",Y),!f)){let e=null;(f=new ResizeObserver(t=>{e||(e=requestAnimationFrame(()=>{(function(e){if(!b)return;let t=e[0].contentBoxSize[0].blockSize,n=e[0].contentBoxSize[0].inlineSize;if(m===eu.Init){H=t,V=n,m=eu.Ready,eP(),K(),Z("ready");return}if(m!==eu.Ready)return;let o=D.length;eb();let a=b.getBoundingClientRect();if(t=a.height,n=a.width,!(o>1&&(L&&.5>Math.abs(t-H)||!L&&.5>Math.abs(n-V))))H=t,V=n,(!L||t)&&(L||n)&&b&&E&&(o===D.length&&i?.isPointerDown()||(j("dragFree")&&(x||T>O&&T<A)?(U(),eP()):eR(P,{transition:!1})))})(t),e=null}))})).observe(b)}}())}}function Y(e){n=e}function X(e="*"){let t=[];for(let n of I)("*"===e||n.class&&n.class.includes(e)||n.el&&n.el?.classList.contains(e))&&t.push(n);g=void 0,k=e,$=[...t]}function U(){if(!r)return;let e=Q(r?.isRunning()?r.getEndValues().pos:T);e!==P&&(g=P,P=e,eT(),K(),J(),Z("change",P,g))}function K(){if(!b)return;for(let e of(er(E,"is-draggable",!!i&&D.length>0),b.querySelectorAll("[data-carousel-index]")))e.innerHTML=P+"";for(let e of b.querySelectorAll("[data-carousel-page]"))e.innerHTML=P+1+"";for(let e of b.querySelectorAll("[data-carousel-pages]"))e.innerHTML=D.length+"";let e=!1,t=D[P]?.slides[0];for(let n of(t&&(t.downloadSrc||"image"===t.type&&t.src)&&(e=!0),b.querySelectorAll("[data-carousel-download]")))n.toggleAttribute("aria-disabled",!e)}function J(e){if(!b)return;e||(e=D[P]?.slides[0]);let t=e.el;if(t)for(let n of t.querySelectorAll("[data-slide-index]"))n.innerHTML=e.index+1+""}function Q(e){if(!D.length||!r)return 0;let t=en(),n=e;x?n-=Math.floor((e-D[0].pos)/t)*t:n=u(D[0].pos,e,D[D.length-1].pos);let o=new Map,i=0;for(let e of D){let a=Math.abs(e.pos-n),l=Math.min(a,Math.abs(e.pos-n-t),Math.abs(e.pos-n+t));o.set(i,l),i++}return parseInt((o.size>0?[...o.entries()].reduce((e,t)=>t[1]<e[1]?t:e):[P,0])[0])}function ee(){return E&&parseFloat(getComputedStyle(E).getPropertyValue("--f-carousel-gap"))||0}function et(){return E&&E.getBoundingClientRect()[S]||0}function en(e=!0){let t=ee();return $.reduce((e,t)=>e+t.dim,0)+($.length-(x&&e?0:1))*t}function es(e){let t=ee(),n=en(),o=et();if(!E)return[];let i=[];if(!n||!o)return[];e=void 0===e?T:e,x&&(e-=Math.floor(e/n)*n);let a=0,l=0;if(w){let e=E.getBoundingClientRect();a=e.left,l=e.right-e.width}let r=0;for(let s of $){let c=(t=0)=>{!(i.indexOf(s)>-1)&&(s.pos=r-e+t||0,s.offset+t>e-s.dim-a+.51&&s.offset+t<e+o+l-.51&&i.push(s))};if(s.offset=r,x)for(let e=-1;e<=1;e++)c(n*e);else c();r+=s.dim+t}return i}function ed(e,t){let n=[];for(let t of Array.isArray(e)?e:[e]){let e=em({...t,isVirtual:!0});n.push(e)}for(let e of(I.splice(void 0===t?I.length:t,0,...n),ey(),n))!function(e){if(!e)return;let t=e.el;t||(e.el=t=document.createElement("div"));let n=e.html?e.html instanceof HTMLElement?e.html:c(e.html):void 0;n&&(B(n,"f-html"),e.htmlEl=n,B(t,"has-html"),t.append(n),Z("contentReady",e))}(e);return X(k),n}function em(e){return(a(e)||e instanceof HTMLElement)&&(e={html:e}),{index:-1,el:void 0,class:"",isVirtual:!0,dim:0,pos:0,offset:0,html:"",src:"",...e}}function eh(e){if(!E||!e)return;let t=e.el;if(t){if(t.setAttribute("index",e.index+""),t.parentElement!==E){let n;for(let o of(B(t,v.classes.slide),B(t,e.class),eT(e),I))if(o.index>e.index){n=o.el;break}E.insertBefore(t,n&&E.contains(n)?n:null),Z("attachSlideEl",e)}return t}}function ev(e){let t=e?.el;t&&(t.remove(),eE(t),Z("detachSlideEl",e))}function ey(){for(let e=0;e<I.length;e++){let t=I[e],n=t.el;n&&(t.index!==e&&eE(n),n.setAttribute("index",`${e}`)),t.index=e}}function eb(){if(!b||!E)return;M=j("rtl"),S=(L=j("vertical"))?"height":"width";let e=j("classes");er(b,e.isLTR,!M),er(b,e.isRTL,M),er(b,e.isHorizontal,!L),er(b,e.isVertical,L),er(b,e.hasAdaptiveHeight,j("adaptiveHeight"));let t=E.getBoundingClientRect();if(!t.width&&!t.height)return;let n=function(){let e=0;if(E){let t=document.createElement("div");B(t,v.classes.slide),E.appendChild(t),e=t.getBoundingClientRect()[S],t.remove(),t=void 0}return e}();for(let e of $){let t=e.el,o=0;if(!e.isVirtual&&t&&l(t)){let e=!1;t.parentElement&&t.parentElement===E||(E.appendChild(t),e=!0),o=t.getBoundingClientRect()[S],e&&t.parentElement?.removeChild(t)}else o=n;e.dim=o}if(!function(){let e;if(!b)return;ey();let t=et(),n=ee(),o=en(!1),i=j("slidesPerPage");i="auto"===i?1/0:parseFloat(i+""),D=[];let a=0,l=0;for(let e of $)(!D.length||a+e.dim-t>.05||l>=i)&&(D.push({index:D.length,slides:[],dim:0,offset:0,pos:0}),a=0,l=0),D[D.length-1].slides.push(e),a+=e.dim+n,l++;let r=j("center"),s=j("fill"),c=j("infinite"),d=0;for(let e of D){for(let t of(e.dim=(e.slides.length-1)*n,e.slides))e.dim+=t.dim;e.offset=d,e.pos=d,!1!==r&&(e.pos-=(t-e.dim)*.5),s&&!c&&o>t&&(e.pos=u(0,e.pos,o-t)),d+=e.dim+n}let f=[];for(let t of D){let n={...t};e&&n.pos===e.pos?(e.dim+=n.dim,e.slides=[...e.slides,...n.slides]):(e=n,n.index=f.length,f.push(n))}D=f,K()}(),x=j("infinite")&&D.length>1&&en()-(et()+($[0]?.dim||0))>-.5,O=D[0]?.pos||0,A=D[D.length-1]?.pos||0,m===eu.Init){g=void 0,P=j("initialPage");let e=j("initialSlide")||void 0;void 0!==e&&(P=eO.getPageIndex(e)||0),P=u(0,P,D.length-1),C=T=D[P]?.pos||0}else{let e=r?.isRunning()?r.getEndValues().pos:T;(e<O||e>A)&&(P=u(0,P,D.length-1),C=D[P||0].pos||0)}Z("refresh")}function eE(e){if(!e||!l(e))return;let t=parseInt(e.getAttribute("index")||"-1"),n="";for(let t of Array.from(e.classList)){let e=t.match(/^f-(\w+)(Out|In)$/);e&&e[1]&&(n=e[1]+"")}if(!e||!n)return;let o=[`f-${n}Out`,`f-${n}In`,"to-prev","to-next","from-prev","from-next"];e.removeEventListener("animationend",ex),el(e,o.join(" ")),F.delete(t)}function ew(){if(!E)return;let e=F.size;for(let e of $)eE(e.el);F.clear(),e&&eP()}function ex(e){"f-"===e.animationName.substring(0,2)&&(eE(e.target),!F.size&&(el(b,"in-transition"),!R&&.5>Math.abs(eO.getPosition(!0)-C)&&(R=!0,Z("settle"))),eP())}function eM(e){if(e.defaultPrevented)return;let t=e.composedPath()[0];if(t.closest("[data-carousel-go-prev]")){ec(e),eO.prev();return}if(t.closest("[data-carousel-go-next]")){ec(e),eO.next();return}let n=t.closest("[data-carousel-go-to]");if(n){ec(e),eO.goTo(parseFloat(n.dataset.carouselGoTo||"")||0);return}if(t.closest("[data-carousel-download]")){ec(e);let t=D[P].slides[0];if(t.downloadSrc||"image"===t.type&&t.src){let e=t.downloadFilename,n=document.createElement("a"),o=t.downloadSrc||t.src||"";n.href=o,n.target="_blank",n.download=e||o,n.click()}return}Z("click",e)}function eL(e){let t=e.el;t&&(t.querySelector(".f-spinner")?.remove(),el(t,"is-loading"))}function eS(e){let t=e.el;t&&(t.querySelector(".f-html.is-error")?.remove(),el(t,"has-error"))}function eT(e){e||(e=D[P]?.slides[0]);let t=e?.el;if(!t)return;let n=j("formatCaption",e);void 0===n&&(n=e.caption),n=n||"";let o=j("captionEl");if(o&&o instanceof HTMLElement){if(e.index!==P)return;if(a(n)&&(o.innerHTML=q(n+"")),n instanceof HTMLElement){if(n.parentElement===o)return;o.innerHTML="",n.parentElement&&(n=n.cloneNode(!0)),o.append(n)}return}if(!n)return;let i=e.captionEl||t.querySelector(".f-caption");!i&&n instanceof HTMLElement&&n.classList.contains("f-caption")&&(i=n),!i&&(B(i=document.createElement("div"),"f-caption"),a(n)?i.innerHTML=q(n+""):n instanceof HTMLElement&&(n.parentElement&&(n=n.cloneNode(!0)),i.append(n)));let l=`f-caption-${eg}_${e.index}`;i.setAttribute("id",l),i.dataset.selectable="true",B(t,"has-caption"),t.setAttribute("aria-labelledby",l),e.captionEl=i,t.insertAdjacentElement("beforeend",i)}function eR(e,t){let{transition:n,tween:o}={...{transition:v.transition,tween:v.tween},...t||{}};if(!b||!r)return;let i=D.length;if(!i||function(e,t){if(!b||!r||!t||!a(t)||"tween"===t||D[P]?.slides.length>1)return!1;let n=D.length,o=e>P?1:-1;e=x?(e%n+n)%n:u(0,e,n-1),M&&(o*=-1);let i=D[P]?.slides[0],l=i?.index,s=D[e]?.slides[0],c=s?.index,d=D[e]?.pos;if(void 0===c||void 0===l||l===c||T===d||Math.abs(et()-(s?.dim||0))>1)return!1;R=!1,r.pause(),ew(),B(b,"in-transition"),T=C=d;let f=eh(i),g=eh(s);return U(),f&&(F.add(l),f.style.transform="",f.addEventListener("animationend",ex),el(f,v.classes.isSelected),B(f,`f-${t}Out to-${o>0?"next":"prev"}`)),g&&(F.add(c),g.style.transform="",g.addEventListener("animationend",ex),B(g,v.classes.isSelected),B(g,`f-${t}In from-${o>0?"prev":"next"}`)),eP(),!0}(e,n))return;C=D[(e=x?(e%i+i)%i:u(0,e,i-1))||0].pos||0;let l=r.isRunning()?r.getEndValues().pos:T;if(1>Math.abs(C-l)){T=C,P!==e&&(eT(),K(),J(),g=P,Z("change",P=e,g)),eP(),R||(R=!0,Z("settle"));return}if(r.pause(),ew(),x){let e=en(),t=Math.floor((l-D[0].pos)/e),n=C+t*e,o=n-e;C=[n+e,n,o].reduce(function(e,t){return Math.abs(t-l)<Math.abs(e-l)?t:e})}if(!1!==n&&d(o))return void r.spring(o).from({pos:T}).to({pos:C}).start();T=C,U(),eP(),R||(R=!0,Z("settle"))}function eP(){let e;if(!b||!E)return;let t=D[P];_=es();let n=new Set,o=[];for(let i of $){if(i.isVirtual&&!F.has(i.index)&&0>_.indexOf(i))continue;let a=eh(i);if(!a)continue;o.push(i);let l=t?.slides?.indexOf(i)>-1;if(l&&n.add(a),!F.has(i.index)){let e=i.pos?Math.round(1e4*i.pos)/1e4:0,t=L?0:M?-1*e:e,n=L?e:0,o=ea(t,0,i.dim,0,100),l=ea(n,0,i.dim,0,100),r=v.setTransform||void 0;r instanceof Function?r(eO,i,{x:t,y:n,xPercent:o,yPercent:l}):a.style.transform=t||n?`translate3d(${o}%, ${l}%,0)`:""}if(j("adaptiveHeight")&&l){let t=(a.firstElementChild||a).getBoundingClientRect().height;e=void 0==e?t:Math.max(e,t)}}[...eo(E,`.${v.classes.slide}`)].forEach(e=>{let t=I[parseInt(e.getAttribute("index")||"-1")];t||e.remove(),er(e,v.classes.isSelected,n.has(e)),t.isVirtual&&!F.has(t.index)&&0>_.indexOf(t)&&ev(t)}),E&&e&&(E.style.height=`${e}px`),Z("render",o)}function eC(){for(let e of(b?.removeEventListener("click",eM),ew(),document.removeEventListener("mousemove",Y),f?.disconnect(),f=void 0,I))e.el&&l(e.el)&&(e.state=void 0,eL(e),eS(e),ev(e),e.isVirtual?(e.el?.remove(),e.el=void 0):(e.el.style.transform="",E?.appendChild(e.el)));for(let e of Object.values(y))e?.destroy();for(let e of(y={},i?.destroy(),i=void 0,r?.destroy(),r=void 0,Object.values(v.classes||{})))el(b,e);el(E,"is-draggable")}let eO={add:function(e,t){let n=T,o=C;for(let n of ed(e,t))Z("addSlide",n);return X(k),eb(),r&&o!==C&&r.spring({clamp:!0,mass:1,tension:300,friction:25,restDelta:1,restSpeed:1}).from({pos:n}).to({pos:C}).start(),eP(),eO},canGoPrev:function(){return x||P>0},canGoNext:function(){return x||P<D.length-1},destroy:function(){return Z("destroy"),window.removeEventListener("resize",G),eC(),W.clear(),b=null,D=[],I=[],v={...ef},y={},$=[],p="",k="*",m=eu.Destroyed,eO},emit:Z,filter:function(e="*"){return X(e),eb(),eP(),Z("filter",e),eO},getContainer:function(){return b},getGapDim:ee,getGestures:function(){return i},getLastMouseMove:function(){return n},getOptions:function(){return v},getPage:function(){return D[P]},getPageIndex:function(e){if(void 0!==e){for(let t of D||[])for(let n of t.slides)if(n.index===e)return t.index;return -1}return P},getPageProgress:function(e,t){void 0===e&&(e=P);let n=D[e];if(!n)return e>P?-1:1;let o=n.pos,i=ee(),a=eO.getPosition(),l=en();if(x&&!0!==t){let e=Math.floor((a-D[0].pos)/l),t=o+l*e;o=[t+l,t,t-l].reduce(function(e,t){return Math.abs(t-a)<Math.abs(e-a)?t:e})}return(a-o)/(n.dim+i)},getPageVisibility:function(e){void 0===e&&(e=P);let t=D[e];if(!t)return e>P?-1:1;let n=eO.getPosition(),o=et(),i=t.pos;if(x){let e=eO.getPosition(),t=en(),n=i+Math.floor((e-D[0].pos)/t)*t,o=n-t;i=[n+t,n,o].reduce(function(t,n){return Math.abs(n-e)<Math.abs(t-e)?n:t})}return i>n&&i+t.dim<n+o?1:i<n?(i+t.dim-n)/t.dim:i+t.dim>n+o?(n+o-i)/t.dim:0},getPages:function(){return D},getPlugins:function(){return y},getPosition:function(e){let t=T;if(x&&!0!==e){let e=en();t-=Math.floor((T-D[0]?.pos||0)/e)*e}return t},getSlides:function(){return I},getState:function(){return m},getTotalSlideDim:en,getTween:function(){return r},getViewport:function(){return E},getViewportDim:et,getVisibleSlides:function(e){return void 0===e?_:es(e)},goTo:eR,hasNavigated:function(){return void 0!==g},hideError:eS,hideLoading:eL,init:function(){if(!e||!l(e))throw Error("No Element found");return m!==eu.Init&&(eC(),m=eu.Init),b=e,h=t,window.removeEventListener("resize",G),h.breakpoints&&window.addEventListener("resize",G),G(),eO},isInfinite:function(){return x},isInTransition:function(){return F.size>0},isRTL:function(){return M},isSettled:function(){return R},localize:function(e,t=[]){return q(e,t)},next:function(e={}){return eR(P+1,e),eO},off:function(e,t){for(let n of e instanceof Array?e:[e])W.has(n)&&W.set(n,W.get(n).filter(e=>e!==t));return eO},on:function(e,t){for(let n of e instanceof Array?e:[e])W.set(n,[...W.get(n)||[],t]);return eO},prev:function(e={}){return eR(P-1,e),eO},remove:function(e){void 0===e&&(e=I.length-1);let t=I[e];return t&&(Z("removeSlide",t),t.el&&(eE(t.el),t.el.remove(),t.el=void 0),I.splice(e,1),X(k),eb(),eP()),eO},setPosition:function(e){T=e,U(),eP()},showError:function(e,t){eL(e),eS(e);let n=e.el;if(n){let o=document.createElement("div");B(o,"f-html"),B(o,"is-error"),o.innerHTML=q(t||"<p>{{ERROR}}</p>"),e.htmlEl=o,B(n,"has-html"),B(n,"has-error"),n.insertAdjacentElement("afterbegin",o),Z("contentReady",e)}return eO},showLoading:function(e){let t=e.el,n=t?.querySelector(".f-spinner");if(!t||n)return eO;let o=c(j("spinnerTpl"));return o&&(B(o,"f-spinner"),B(t,"is-loading"),t.insertAdjacentElement("beforeend",o)),eO},version:"6.0.14"};return eO};ep.l10n={en_EN:es},ep.getDefaults=()=>ef;let em=(e=!0,t="--f-scrollbar-compensate",n="--f-body-margin",o="hide-scrollbar")=>{let i=document,a=i.body,l=i.documentElement;if(e){if(a.classList.contains(o))return;let e=window.innerWidth-l.getBoundingClientRect().width;e<0&&(e=0),l.style.setProperty(t,`${e}px`);let i=parseFloat(window.getComputedStyle(a).marginRight);i&&a.style.setProperty(n,`${i}px`),a.classList.add(o)}else a.classList.remove(o),a.style.setProperty(n,""),i.documentElement.style.setProperty(t,"")};function eh(){return!!("undefined"!=typeof window&&window.document&&window.document.createElement)}let ev=function(e="",t="",n=""){return e.split(t).join(n)},ey={tpl:e=>`<img class="f-panzoom__content"
${e.srcset?'data-lazy-srcset="{{srcset}}"':""}
${e.sizes?'data-lazy-sizes="{{sizes}}"':""}
data-lazy-src="{{src}}" alt="{{alt}}" />`},eb=()=>{let e;function t(t,n){let o=e?.getOptions().Zoomable,i=(d(o)?{...ey,...o}:ey)[t];return i&&"function"==typeof i&&n?i(n):i}function n(){e&&(e.on("addSlide",l),e.on("removeSlide",r),e.on("attachSlideEl",s),e.on("click",i),e.on("change",o))}function o(){c()}function i(e,t){let n=t.target;n&&!t.defaultPrevented&&n.dataset.panzoomAction&&u(n.dataset.panzoomAction)}function l(n,o){if(!e)return;let i=o.el;if(!i)return;let l=o.src||o.lazySrc||"",r=o.srcset||o.lazySrcset||"",s=o.sizes||o.lazySizes||"";if(l&&a(l)&&!o.html&&(!o.type||"image"===o.type)){o.type="image";let e=t("tpl",o);e=ev(e,"{{src}}",l+""),e=ev(e,"{{srcset}}",r+""),e=ev(e,"{{sizes}}",s+""),e=ev(e,"{{alt}}",`${o.alt||o.caption||`Image #${o.index}`}`),i.insertAdjacentHTML("afterbegin",e)}if(!i.querySelector(".f-panzoom__content"))return;let u=en(i,{width:o.width&&"auto"!==o.width?parseFloat(o.width+""):"auto",height:o.height&&"auto"!==o.height?parseFloat(o.height+""):"auto",event:()=>e?.getLastMouseMove(),classes:{container:"f-zoomable"},...t("Panzoom")});u.on("*",(t,n,...i)=>{e&&("loading"===n&&(o.state=0),"loaded"===n&&(o.state=1),"error"===n&&(o.state=2,e?.showError(o,"{{IMAGE_ERROR}}")),e.emit(`panzoom:${n}`,o,...i),"ready"===n&&e.emit("contentReady",o),o.index===e.getPageIndex()&&c())}),o.panzoomRef=u}function r(e,t){t.panzoomRef&&(t.panzoomRef.destroy(),t.panzoomRef=void 0)}function s(e,t){let n=t.panzoomRef;if(n)switch(n.getState()){case K.Init:n.init();break;case K.Ready:n.execute(Y.Reset,{velocity:0})}}function c(){let t=e?.getContainer();if(!t)return;let n=e?.getPage()?.slides[0].panzoomRef,o=n?.canZoomIn()||!1,i=n?.canZoomOut()||!1,a=n?.isFullsize()||!1,l=!n||n?.getState()!==K.Ready;for(let e of t?.querySelectorAll("[data-panzoom-action]")||[]){let t=e.dataset.panzoomAction,n=!1;if(l)n=!0;else switch(t){case Y.ZoomIn:o||(n=!0);break;case Y.ZoomOut:i||(n=!0);break;case Y.ToggleFull:o||i||(n=!0);let r=e.querySelector("g");r&&(r.style.display=a?"none":"");break;case Y.ToggleCover:case Y.ToggleMax:o||i||(n=!0)}n?(e.setAttribute("aria-disabled",""),e.setAttribute("tabindex","-1")):(e.removeAttribute("aria-disabled"),e.removeAttribute("tabindex"))}}function u(t,...n){e?.getPage().slides[0].panzoomRef?.execute(t,...n)}return{init:function(t){!1!==(e=t).getOptions().Zoomable&&e.on("initPlugins",n)},destroy:function(){if(e)for(let t of(e.off("addSlide",l),e.off("removeSlide",r),e.off("attachSlideEl",s),e.off("change",o),e.getSlides()))r(e,t);e=void 0},execute:u}},eE={syncOnChange:!1,syncOnClick:!0,syncOnHove