PageSourceSearch

https://verdinytt.no/src/include/jsCombine.php?loc=footer&pos=early&type=standard&bundle=core&ver=1790285460

js verdinytt.no collected 2026-09-25 06:51:03 UTC 441,905 bytes, 894 lines download raw bytes

1(function($){'use strict';var MODAL_CONFIG={zIndex:9999,animationDuration:300,overlayOpacity:0.5,maxWidth:440,minWidth:300};var MODAL_TYPES={ALERT:'alert',CONFIRM:'confirm',PROMPT:'prompt',CUSTOM:'custom'};var DEFAULT_TEXTS={ok:'OK',cancel:'Avbryt',yes:'Ja',no:'Nei',confirm:'Bekreft',close:'Lukk'};function showModal(options){return $.Deferred(function(defer){var config=$.extend({type:MODAL_TYPES.ALERT,title:'',message:'',buttons:[],width:MODAL_CONFIG.maxWidth,height:'auto',closable:!0,onClose:null,isError:!1},options);var modalHtml=createModalHTML(config);var $modal=$(modalHtml).appendTo('body');if(config.isError){$modal.find('.nf-modal-container').addClass('nf-modal-error')}
2try{positionModal($modal);showModalWithAnimation($modal,config)}catch(error){$modal.show()}
3setupModalEvents($modal,config,defer)}).promise()}
4function createModalHTML(config){var modalId='nf-modal-'+Date.now();var buttonHtml=createButtonHTML(config.buttons,config.type);var viewportW=(typeof window!=='undefined'&&window.innerWidth)?window.innerWidth:(typeof document!=='undefined'&&document.documentElement&&document.documentElement.clientWidth)?document.documentElement.clientWidth:500;var effectiveMaxWidth=Math.min(config.width,Math.max(260,viewportW-40));return'<div id="'+modalId+'" class="nf-modal-overlay">'+'<div class="nf-modal-container" style="max-width: '+effectiveMaxWidth+'px; height: '+config.height+';">'+'<div class="nf-modal-header">'+'<h3 class="nf-modal-title">'+config.title+'</h3>'+(config.closable?'<button type="button" class="nf-modal-close">&times;</button>':'')+'</div>'+'<div class="nf-modal-body">'+'<div class="nf-modal-message">'+config.message+'</div>'+(config.type===MODAL_TYPES.PROMPT?'<input type="text" class="nf-modal-input" placeholder="Skriv inn tekst..." value="'+(config.defaultValue||'').replace(/"/g,'&quot;')+'">':'')+'</div>'+'<div class="nf-modal-footer">'+buttonHtml+'</div>'+'</div></div>'}
5function createButtonHTML(buttons,type){if(buttons&&buttons.length>0){return $.map(buttons,function(btn){return'<button type="button" class="nf-modal-btn '+(btn.class||'')+'" data-action="'+(btn.action||'custom')+'">'+btn.text+'</button>'}).join('')}
6switch(type){case MODAL_TYPES.ALERT:return'<button type="button" class="nf-modal-btn nf-modal-btn-primary" data-action="ok">'+DEFAULT_TEXTS.ok+'</button>';case MODAL_TYPES.CONFIRM:return'<button type="button" class="nf-modal-btn nf-modal-btn-secondary" data-action="cancel">'+DEFAULT_TEXTS.cancel+'</button>'+'<button type="button" class="nf-modal-btn nf-modal-btn-primary" data-action="confirm">'+DEFAULT_TEXTS.confirm+'</button>';case MODAL_TYPES.PROMPT:return'<button type="button" class="nf-modal-btn nf-modal-btn-secondary" data-action="cancel">'+DEFAULT_TEXTS.cancel+'</button>'+'<button type="button" class="nf-modal-btn nf-modal-btn-primary" data-action="ok">'+DEFAULT_TEXTS.ok+'</button>';default:return'<button type="button" class="nf-modal-btn nf-modal-btn-primary" data-action="ok">'+DEFAULT_TEXTS.ok+'</button>'}}
7function positionModal($modal){var $container=$modal.find('.nf-modal-container');if($container.length===0){return}
8$container.css({position:'fixed',top:'50%',left:'50%',transform:'translate(-50%, -50%)',margin:'0'})}
9function showModalWithAnimation($modal,config){$modal.fadeIn(MODAL_CONFIG.animationDuration);$modal.find('.nf-modal-container').addClass('nf-modal-show');setTimeout(function(){var $input=$modal.find('.nf-modal-input');var $button=$modal.find('.nf-modal-btn').first();if($input.length){if(config.defaultValue){$input[0].select()}
10$input.focus()}else if($button.length){$button.focus()}},100)}
11function setupModalEvents($modal,config,defer){var modalId=$modal.attr('id');$modal.on('click','.nf-modal-btn',function(e){e.preventDefault();var action=$(this).data('action');var inputValue=$modal.find('.nf-modal-input').val();closeModal($modal,function(){if(config.type===MODAL_TYPES.PROMPT){defer.resolve({action:action,value:inputValue})}else{defer.resolve({action:action})}})});$modal.on('click','.nf-modal-close',function(e){e.preventDefault();closeModal($modal,function(){defer.resolve({action:'cancel'})})});if(config.closable){$modal.on('click',function(e){if(e.target===this){closeModal($modal,function(){defer.resolve({action:'cancel'})})}})}
12$(document).on('keydown.nf-modal-'+modalId,function(e){if(e.keyCode===27&&config.closable){closeModal($modal,function(){defer.resolve({action:'cancel'})})}else if(e.keyCode===13&&config.type===MODAL_TYPES.PROMPT){var inputValue=$modal.find('.nf-modal-input').val();closeModal($modal,function(){defer.resolve({action:'ok',value:inputValue})})}});if(config.type===MODAL_TYPES.PROMPT){$modal.on('keydown','.nf-modal-input',function(e){if(e.keyCode===13){e.preventDefault();$modal.find('.nf-modal-btn[data-action="ok"]').click()}})}}
13function closeModal($modal,callback){var modalId=$modal.attr('id');$modal.find('.nf-modal-container').removeClass('nf-modal-show');$modal.fadeOut(MODAL_CONFIG.animationDuration,function(){$(document).off('keydown.nf-modal-'+modalId);$modal.remove();if(callback)callback();})}
14window.NFModal={close:function(){var $overlay=$('.nf-modal-overlay');if($overlay.length){var mid=$overlay.attr('id');
14if(mid)$(document).off('keydown.nf-modal-'+mid);$overlay.remove()}},alert:function(message,title,isError){title=title||'Melding';isError=isError||!1;return showModal({type:MODAL_TYPES.ALERT,title:title,message:message,isError:isError})},confirm:function(message,title){title=title||'Bekreft';return showModal({type:MODAL_TYPES.CONFIRM,title:title,message:message})},prompt:function(message,title,defaultValue){title=title||'Inndata';defaultValue=defaultValue||'';return showModal({type:MODAL_TYPES.PROMPT,title:title,message:message,defaultValue:defaultValue})},show:function(options){return showModal($.extend({type:MODAL_TYPES.CUSTOM},options))}}})(jQuery);var CryptoJS=CryptoJS||function(s,p){var m={},l=m.lib={},n=function(){},r=l.Base={extend:function(b){n.prototype=this;var h=new n;b&&h.mixIn(b);h.hasOwnProperty("init")||(h.init=function(){h.$super.init.apply(this,arguments)});h.init.prototype=h;h.$super=this;return h},create:function(){var b=this.extend();b.init.apply(b,arguments);return b},init:function(){},mixIn:function(b){for(var h in b)b.hasOwnProperty(h)&&(this[h]=b[h]);b.hasOwnProperty("toString")&&(this.toString=b.toString)},clone:function(){return this.init.prototype.extend(this)}},q=l.WordArray=r.extend({init:function(b,h){b=this.words=b||[];this.sigBytes=h!=p?h:4*b.length},toString:function(b){return(b||t).stringify(this)},concat:function(b){var h=this.words,a=b.words,j=this.sigBytes;b=b.sigBytes;this.clamp();if(j%4)for(var g=0;g<b;g++)h[j+g>>>2]|=(a[g>>>2]>>>24-8*(g%4)&255)<<24-8*((j+g)%4);else if(65535<a.length)for(g=0;g<b;g+=4)h[j+g>>>2]=a[g>>>2];else h.push.apply(h,a);this.sigBytes+=b;return this},clamp:function(){var b=this.words,h=this.sigBytes;b[h>>>2]&=4294967295<<32-8*(h%4);b.length=s.ceil(h/4)},clone:function(){var b=r.clone.call(this);b.words=this.words.slice(0);return b},random:function(b){for(var h=[],a=0;a<b;a+=4)h.push(4294967296*s.random()|0);return new q.init(h,b)}}),v=m.enc={},t=v.Hex={stringify:function(b){var a=b.words;b=b.sigBytes;for(var g=[],j=0;j<b;j++){var k=a[j>>>2]>>>24-8*(j%4)&255;g.push((k>>>4).toString(16));g.push((k&15).toString(16))}return g.join("")},parse:function(b){for(var a=b.length,g=[],j=0;j<a;j+=2)g[j>>>3]|=parseInt(b.substr(j,2),16)<<24-4*(j%8);return new q.init(g,a/2)}},a=v.Latin1={stringify:function(b){var a=b.words;b=b.sigBytes;for(var g=[],j=0;j<b;j++)g.push(String.fromCharCode(a[j>>>2]>>>24-8*(j%4)&255));return g.join("")},parse:function(b){for(var a=b.length,g=[],j=0;j<a;j++)g[j>>>2]|=(b.charCodeAt(j)&255)<<24-8*(j%4);return new q.init(g,a)}},u=v.Utf8={stringify:function(b){try{return decodeURIComponent(escape(a.stringify(b)))}catch(g){throw Error("Malformed UTF-8 data")}},parse:function(b){return a.parse(unescape(encodeURIComponent(b)))}},g=l.BufferedBlockAlgorithm=r.extend({reset:function(){this._data=new q.init;this._nDataBytes=0},_append:function(b){"string"==typeof b&&(b=u.parse(b));this._data.concat(b);this._nDataBytes+=b.sigBytes},_process:function(b){var a=this._data,g=a.words,j=a.sigBytes,k=this.blockSize,m=j/(4*k),m=b?s.ceil(m):s.max((m|0)-this._minBufferSize,0);b=m*k;j=s.min(4*b,j);if(b){for(var l=0;l<b;l+=k)this._doProcessBlock(g,l);l=g.splice(0,b);a.sigBytes-=j}return new q.init(l,j)},clone:function(){var b=r.clone.call(this);b._data=this._data.clone();return b},_minBufferSize:0});l.Hasher=g.extend({cfg:r.extend(),init:function(b){this.cfg=this.cfg.extend(b);this.reset()},reset:function(){g.reset.call(this);this._doReset()},update:function(b){this._append(b);this._process();return this},finalize:function(b){b&&this._append(b);return this._doFinalize()},blockSize:16,_createHelper:function(b){return function(a,g){return(new b.init(g)).finalize(a)}},_createHmacHelper:function(b){return function(a,g){return(new k.HMAC.init(b,g)).finalize(a)}}});var k=m.algo={};return m}(Math);(function(s){function p(a,k,b,h,l,j,m){a=a+(k&b|~k&h)+l+m;return(a<<j|a>>>32-j)+k}function m(a,k,b,h,l,j,m){a=a+(k&h|b&~h)+l+m;return(a<<j|a>>>32-j)+k}function l(a,k,b,h,l,j,m){a=a+(k^b^h)+l+m;return(a<<j|a>>>32-j)+k}function n(a,k,b,h,l,j,m){a=a+(b^(k|~h))+l+m;return(a<<j|a>>>32-j)+k}for(var r=CryptoJS,q=r.lib,v=q.WordArray,t=q.Hasher,q=r.algo,a=[],u=0;64>u;u++)a[u]=4294967296*s.abs(s.sin(u+1))|0;
14q=q.MD5=t.extend({_doReset:function(){this._hash=new v.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(g,k){for(var b=0;16>b;b++){var h=k+b,w=g[h];g[h]=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360}var b=this._hash.words,h=g[k+0],w=g[k+1],j=g[k+2],q=g[k+3],r=g[k+4],s=g[k+5],t=g[k+6],u=g[k+7],v=g[k+8],x=g[k+9],y=g[k+10],z=g[k+11],A=g[k+12],B=g[k+13],C=g[k+14],D=g[k+15],c=b[0],d=b[1],e=b[2],f=b[3],c=p(c,d,e,f,h,7,a[0]),f=p(f,c,d,e,w,12,a[1]),e=p(e,f,c,d,j,17,a[2]),d=p(d,e,f,c,q,22,a[3]),c=p(c,d,e,f,r,7,a[4]),f=p(f,c,d,e,s,12,a[5]),e=p(e,f,c,d,t,17,a[6]),d=p(d,e,f,c,u,22,a[7]),c=p(c,d,e,f,v,7,a[8]),f=p(f,c,d,e,x,12,a[9]),e=p(e,f,c,d,y,17,a[10]),d=p(d,e,f,c,z,22,a[11]),c=p(c,d,e,f,A,7,a[12]),f=p(f,c,d,e,B,12,a[13]),e=p(e,f,c,d,C,17,a[14]),d=p(d,e,f,c,D,22,a[15]),c=m(c,d,e,f,w,5,a[16]),f=m(f,c,d,e,t,9,a[17]),e=m(e,f,c,d,z,14,a[18]),d=m(d,e,f,c,h,20,a[19]),c=m(c,d,e,f,s,5,a[20]),f=m(f,c,d,e,y,9,a[21]),e=m(e,f,c,d,D,14,a[22]),d=m(d,e,f,c,r,20,a[23]),c=m(c,d,e,f,x,5,a[24]),f=m(f,c,d,e,C,9,a[25]),e=m(e,f,c,d,q,14,a[26]),d=m(d,e,f,c,v,20,a[27]),c=m(c,d,e,f,B,5,a[28]),f=m(f,c,d,e,j,9,a[29]),e=m(e,f,c,d,u,14,a[30]),d=m(d,e,f,c,A,20,a[31]),c=l(c,d,e,f,s,4,a[32]),f=l(f,c,d,e,v,11,a[33]),e=l(e,f,c,d,z,16,a[34]),d=l(d,e,f,c,C,23,a[35]),c=l(c,d,e,f,w,4,a[36]),f=l(f,c,d,e,r,11,a[37]),e=l(e,f,c,d,u,16,a[38]),d=l(d,e,f,c,y,23,a[39]),c=l(c,d,e,f,B,4,a[40]),f=l(f,c,d,e,h,11,a[41]),e=l(e,f,c,d,q,16,a[42]),d=l(d,e,f,c,t,23,a[43]),c=l(c,d,e,f,x,4,a[44]),f=l(f,c,d,e,A,11,a[45]),e=l(e,f,c,d,D,16,a[46]),d=l(d,e,f,c,j,23,a[47]),c=n(c,d,e,f,h,6,a[48]),f=n(f,c,d,e,u,10,a[49]),e=n(e,f,c,d,C,15,a[50]),d=n(d,e,f,c,s,21,a[51]),c=n(c,d,e,f,A,6,a[52]),f=n(f,c,d,e,q,10,a[53]),e=n(e,f,c,d,y,15,a[54]),d=n(d,e,f,c,w,21,a[55]),c=n(c,d,e,f,v,6,a[56]),f=n(f,c,d,e,D,10,a[57]),e=n(e,f,c,d,t,15,a[58]),d=n(d,e,f,c,B,21,a[59]),c=n(c,d,e,f,r,6,a[60]),f=n(f,c,d,e,z,10,a[61]),e=n(e,f,c,d,j,15,a[62]),d=n(d,e,f,c,x,21,a[63]);b[0]=b[0]+c|0;b[1]=b[1]+d|0;b[2]=b[2]+e|0;b[3]=b[3]+f|0},_doFinalize:function(){var a=this._data,k=a.words,b=8*this._nDataBytes,h=8*a.sigBytes;k[h>>>5]|=128<<24-h%32;var l=s.floor(b/4294967296);k[(h+64>>>9<<4)+15]=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360;k[(h+64>>>9<<4)+14]=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360;a.sigBytes=4*(k.length+1);this._process();a=this._hash;k=a.words;for(b=0;4>b;b++)h=k[b],k[b]=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360;return a},clone:function(){var a=t.clone.call(this);a._hash=this._hash.clone();return a}});r.MD5=t._createHelper(q);r.HmacMD5=t._createHmacHelper(q)})(Math);
15/*!
16 * JavaScript Cookie v2.2.0
17 * https://github.com/js-cookie/js-cookie
18 *
19 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
20 * Released under the MIT license
21 */
22;(function(factory){var registeredInModuleLoader;if(typeof define==='function'&&define.amd){define(factory);registeredInModuleLoader=!0}
23if(typeof exports==='object'){module.exports=factory();registeredInModuleLoader=!0}
24if(!registeredInModuleLoader){var OldCookies=window.Cookies;var api=window.Cookies=factory();api.noConflict=function(){window.Cookies=OldCookies;return api}}}(function(){function extend(){var i=0;var result={};for(;i<arguments.length;i++){var attributes=arguments[i];for(var key in attributes){result[key]=attributes[key]}}
25return result}
26function init(converter){function api(key,value,attributes){if(typeof document==='undefined'){return}
27if(arguments.length>1){attributes=extend({path:'/'},api.defaults,attributes);if(typeof attributes.expires==='number'){attributes.expires=new Date(new Date()*1+attributes.expires*864e+5)}
28attributes.expires=attributes.expires?attributes.expires.toUTCString():'';try{var result=JSON.stringify(value);if(/^[\{\[]/.test(result)){value=result}}catch(e){}
29value=converter.write?converter.write(value,key):encodeURIComponent(String(value)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent);key=encodeURIComponent(String(key)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var stringifiedAttributes='';
29for(var attributeName in attributes){if(!attributes[attributeName]){continue}
30stringifiedAttributes+='; '+attributeName;if(attributes[attributeName]===!0){continue}
31stringifiedAttributes+='='+attributes[attributeName].split(';')[0]}
32return(document.cookie=key+'='+value+stringifiedAttributes)}
33var jar={};var decode=function(s){return s.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)};var cookies=document.cookie?document.cookie.split('; '):[];var i=0;for(;i<cookies.length;i++){var parts=cookies[i].split('=');var cookie=parts.slice(1).join('=');if(!this.json&&cookie.charAt(0)==='"'){cookie=cookie.slice(1,-1)}
34try{var name=decode(parts[0]);cookie=(converter.read||converter)(cookie,name)||decode(cookie);if(this.json){try{cookie=JSON.parse(cookie)}catch(e){}}
35jar[name]=cookie;if(key===name){break}}catch(e){}}
36return key?jar[key]:jar}
37api.set=api;api.get=function(key){return api.call(api,key)};api.getJSON=function(key){return api.call({json:!0},key)};api.remove=function(key,attributes){api(key,'',extend(attributes,{expires:-1}))};api.defaults={};api.withConverter=init;return api}
38return init(function(){})}));!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).window=t.window||{})}(this,(function(t){"use strict";const e=(t,e=1e4)=>(t=parseFloat(t+"")||0,Math.round((t+Number.EPSILON)*e)/e),i=function(t){if(!(t&&t instanceof Element&&t.offsetParent))return!1;const e=t.scrollHeight>t.clientHeight,i=window.getComputedStyle(t).overflowY,n=-1!==i.indexOf("hidden"),s=-1!==i.indexOf("visible");return e&&!n&&!s},n=function(t,e=void 0){return!(!t||t===document.body||e&&t===e)&&(i(t)?t:n(t.parentElement,e))},s=function(t){var e=(new DOMParser).parseFromString(t,"text/html").body;if(e.childElementCount>1){for(var i=document.createElement("div");e.firstChild;)i.appendChild(e.firstChild);return i}return e.firstChild},o=t=>`${t||""}`.split(" ").filter((t=>!!t)),a=(t,e,i)=>{t&&o(e).forEach((e=>{t.classList.toggle(e,i||!1)}))};class r{constructor(t){Object.defineProperty(this,"pageX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pageY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"clientX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"clientY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"time",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"nativePointer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.nativePointer=t,this.pageX=t.pageX,this.pageY=t.pageY,this.clientX=t.clientX,this.clientY=t.clientY,this.id=self.Touch&&t instanceof Touch?t.identifier:-1,this.time=Date.now()}}const l={passive:!1};class c{constructor(t,{start:e=(()=>!0),move:i=(()=>{}),end:n=(()=>{})}){Object.defineProperty(this,"element",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"startCallback",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"moveCallback",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"endCallback",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"currentPointers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"startPointers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this.element=t,this.startCallback=e,this.moveCallback=i,this.endCallback=n;for(const t of["onPointerStart","onTouchStart","onMove","onTouchEnd","onPointerEnd","onWindowBlur"])this[t]=this[t].bind(this);this.element.addEventListener("mousedown",this.onPointerStart,l),this.element.addEventListener("touchstart",this.onTouchStart,l),this.element.addEventListener("touchmove",this.onMove,l),this.element.addEventListener("touchend",this.onTouchEnd),this.element.addEventListener("touchcancel",this.onTouchEnd)}onPointerStart(t){if(!t.buttons||0!==t.button)return;const e=new r(t);this.currentPointers.some((t=>
38t.id===e.id))||this.triggerPointerStart(e,t)&&(window.addEventListener("mousemove",this.onMove),window.addEventListener("mouseup",this.onPointerEnd),window.addEventListener("blur",this.onWindowBlur))}onTouchStart(t){for(const e of Array.from(t.changedTouches||[]))this.triggerPointerStart(new r(e),t);window.addEventListener("blur",this.onWindowBlur)}onMove(t){const e=this.currentPointers.slice(),i="changedTouches"in t?Array.from(t.changedTouches||[]).map((t=>new r(t))):[new r(t)],n=[];for(const t of i){const e=this.currentPointers.findIndex((e=>e.id===t.id));e<0||(n.push(t),this.currentPointers[e]=t)}n.length&&this.moveCallback(t,this.currentPointers.slice(),e)}onPointerEnd(t){t.buttons>0&&0!==t.button||(this.triggerPointerEnd(t,new r(t)),window.removeEventListener("mousemove",this.onMove),window.removeEventListener("mouseup",this.onPointerEnd),window.removeEventListener("blur",this.onWindowBlur))}onTouchEnd(t){for(const e of Array.from(t.changedTouches||[]))this.triggerPointerEnd(t,new r(e))}triggerPointerStart(t,e){return!!this.startCallback(e,t,this.currentPointers.slice())&&(this.currentPointers.push(t),this.startPointers.push(t),!0)}triggerPointerEnd(t,e){const i=this.currentPointers.findIndex((t=>t.id===e.id));i<0||(this.currentPointers.splice(i,1),this.startPointers.splice(i,1),this.endCallback(t,e,this.currentPointers.slice()))}onWindowBlur(){this.clear()}clear(){for(;this.currentPointers.length;){const t=this.currentPointers[this.currentPointers.length-1];this.currentPointers.splice(this.currentPointers.length-1,1),this.startPointers.splice(this.currentPointers.length-1,1),this.endCallback(new Event("touchend",{bubbles:!0,cancelable:!0,clientX:t.clientX,clientY:t.clientY}),t,this.currentPointers.slice())}}stop(){this.element.removeEventListener("mousedown",this.onPointerStart,l),this.element.removeEventListener("touchstart",this.onTouchStart,l),this.element.removeEventListener("touchmove",this.onMove,l),this.element.removeEventListener("touchend",this.onTouchEnd),this.element.removeEventListener("touchcancel",this.onTouchEnd),window.removeEventListener("mousemove",this.onMove),window.removeEventListener("mouseup",this.onPointerEnd),window.removeEventListener("blur",this.onWindowBlur)}}function h(t,e){return e?Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2)):0}function d(t,e){return e?{clientX:(t.clientX+e.clientX)/2,clientY:(t.clientY+e.clientY)/2}:t}const u=t=>"object"==typeof t&&null!==t&&t.constructor===Object&&"[object Object]"===Object.prototype.toString.call(t),p=(t,...e)=>{const i=e.length;for(let n=0;n<i;n++){const i=e[n]||{};Object.entries(i).forEach((([e,i])=>{const n=Array.isArray(i)?[]:{};t[e]||Object.assign(t,{[e]:n}),u(i)?Object.assign(t[e],p(n,i)):Array.isArray(i)?Object.assign(t,{[e]:[...i]}):Object.assign(t,{[e]:i})}))}return t},f=function(t,e){return t.split(".").reduce(((t,e)=>"object"==typeof t?t[e]:void 0),e)};class g{constructor(t={}){Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),this.setOptions(t);for(const t of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))t.startsWith("on")&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}setOptions(t){this.options=t?p({},this.constructor.defaults,t):{};for(const[t,e]of Object.entries(this.option("on")||{}))this.on(t,e)}option(t,...e){let i=f(t,this.options);return i&&"function"==typeof i&&(i=i.call(this,this,...e)),i}optionFor(t,e,i,...n){let s=f(e,t);var o;"string"!=typeof(o=s)||isNaN(o)||isNaN(parseFloat(o))||(s=parseFloat(s)),"true"===s&&(s=!0),"false"===s&&(s=!1),s&&"function"==typeof s&&(s=s.call(this,this,t,...n));let a=f(e,this.options);return a&&"function"==typeof a?s=a.call(this,this,t,...n,s):void 0===s&&(s=a),void 0===s?i:s}cn(t){const e=this.options.classes;return e&&e[t]||""}localize(t,e=[]){t=String(t).replace(/\{\{(\w+).?(\w+)?\}\}/g,((t,e,i)=>{let n="";return i?n=this.option(`${e[0]+e.toLowerCase().substring(1)}.l10n.${i}`):e&&(n=this.option(`l10n.${e}`)),n||(n=t),n}));for(let i=0;i<e.length;i++)t=t.split(e[i][0]).join(e[i][1]);return t=t.replace(/\{\{(.*?)\}\}/g,((t,e)=>e))}on(t,e){let i=[];"string"==typeof t?i=t.split(" "):Array.isArray(t)&&(i=t),this.events||(this.events=new Map),i.forEac
38h((t=>{let i=this.events.get(t);i||(this.events.set(t,[]),i=[]),i.includes(e)||i.push(e),this.events.set(t,i)}))}off(t,e){let i=[];"string"==typeof t?i=t.split(" "):Array.isArray(t)&&(i=t),i.forEach((t=>{const i=this.events.get(t);if(Array.isArray(i)){const t=i.indexOf(e);t>-1&&i.splice(t,1)}}))}emit(t,...e){[...this.events.get(t)||[]].forEach((t=>t(this,...e))),"*"!==t&&this.emit("*",t,...e)}}Object.defineProperty(g,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.0.36"}),Object.defineProperty(g,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{}});class m extends g{constructor(t={}){super(t),Object.defineProperty(this,"plugins",{enumerable:!0,configurable:!0,writable:!0,value:{}})}attachPlugins(t={}){const e=new Map;for(const[i,n]of Object.entries(t)){const t=this.option(i),s=this.plugins[i];s||!1===t?s&&!1===t&&(s.detach(),delete this.plugins[i]):e.set(i,new n(this,t||{}))}for(const[t,i]of e)this.plugins[t]=i,i.attach()}detachPlugins(t){t=t||Object.keys(this.plugins);for(const e of t){const t=this.plugins[e];t&&t.detach(),delete this.plugins[e]}return this.emit("detachPlugins"),this}}var v;!function(t){t[t.Init=0]="Init",t[t.Error=1]="Error",t[t.Ready=2]="Ready",t[t.Panning=3]="Panning",t[t.Mousemove=4]="Mousemove",t[t.Destroy=5]="Destroy"}(v||(v={}));const b=["a","b","c","d","e","f"],y={PANUP:"Move up",PANDOWN:"Move down",PANLEFT:"Move left",PANRIGHT:"Move right",ZOOMIN:"Zoom in",ZOOMOUT:"Zoom out",TOGGLEZOOM:"Toggle zoom level",TOGGLE1TO1:"Toggle zoom level",ITERATEZOOM:"Toggle zoom level",ROTATECCW:"Rotate counterclockwise",ROTATECW:"Rotate clockwise",FLIPX:"Flip horizontally",FLIPY:"Flip vertically",FITX:"Fit horizontally",FITY:"Fit vertically",RESET:"Reset",TOGGLEFS:"Toggle fullscreen"},w={content:null,width:"auto",height:"auto",panMode:"drag",touch:!0,dragMinThreshold:3,lockAxis:!1,mouseMoveFactor:1,mouseMoveFriction:.12,zoom:!0,pinchToZoom:!0,panOnlyZoomed:"auto",minScale:1,maxScale:2,friction:.25,dragFriction:.35,decelFriction:.05,click:"toggleZoom",dblClick:!1,wheel:"zoom",wheelLimit:7,spinner:!0,bounds:"auto",infinite:!1,rubberband:!0,bounce:!0,maxVelocity:75,transformParent:!1,classes:{content:"f-panzoom__content",isLoading:"is-loading",canZoomIn:"can-zoom_in",canZoomOut:"can-zoom_out",isDraggable:"is-draggable",isDragging:"is-dragging",inFullscreen:"in-fullscreen",htmlHasFullscreen:"with-panzoom-in-fullscreen"},l10n:y},x='<circle cx="25" cy="25" r="20"></circle>',E='<div class="f-spinner"><svg viewBox="0 0 50 50">'+x+x+"</svg></div>",S=t=>t&&null!==t&&t instanceof Element&&"nodeType"in t,P=(t,e)=>{t&&o(e).forEach((e=>{t.classList.remove(e)}))},C=(t,e)=>{t&&o(e).forEach((e=>{t.classList.add(e)}))},T={a:1,b:0,c:0,d:1,e:0,f:0},M=1e5,O=1e4,A="mousemove",L="drag",z="content",R="auto";let k=null,I=null;class D extends m{get fits(){return this.contentRect.width-this.contentRect.fitWidth<1&&this.contentRect.height-this.contentRect.fitHeight<1}get isTouchDevice(){return null===I&&(I=window.matchMedia("(hover: none)").matches),I}get isMobile(){return null===k&&(k=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)),k}get panMode(){return this.options.panMode!==A||this.isTouchDevice?L:A}get panOnlyZoomed(){const t=this.options.panOnlyZoomed;return t===R?this.isTouchDevice:t}get isInfinite(){return this.option("infinite")}get angle(){return 180*Math.atan2(this.current.b,this.current.a)/Math.PI||0}get targetAngle(){return 180*Math.atan2(this.target.b,this.target.a)/Math.PI||0}get scale(){const{a:t,b:e}=this.current;return Math.sqrt(t*t+e*e)||1}get targetScale(){const{a:t,b:e}=this.target;return Math.sqrt(t*t+e*e)||1}get minScale(){return this.option("minScale")||1}get fullScale(){const{contentRect:t}=this;return t.fullWidth/t.fitWidth||1}get maxScale(){return this.fullScale*(this.option("maxScale")||1)||1}get coverScale(){const{containerRect:t,contentRect:e}=this,i=Math.max(t.height/e.fitHeight,t.width/e.fitWidth)||1;return Math.min(this.fullScale,i)}get isScaling(){return Math.abs(this.targetScale-this.scale)>1e-5&&!this.isResting}get isContentLoading(){const t=this.content;return!!(t&&t instanceof HTMLImageElement)&&!t.complete}get isResting(){if(this.isBouncingX||this.isBouncingY)return!1;for(const t of b){const e="e"==t||"f"===t?1e-4:1e-5;
38if(Math.abs(this.target[t]-this.current[t])>e)return!1}return!(!this.ignoreBounds&&!this.checkBounds().inBounds)}constructor(t,e={},i={}){var n;if(super(e),Object.defineProperty(this,"pointerTracker",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"resizeObserver",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"updateTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"clickTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"rAF",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"isTicking",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"ignoreBounds",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isBouncingX",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isBouncingY",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"clicks",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"trackingPoints",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"pwt",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"cwd",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"pmme",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"friction",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:v.Init}),Object.defineProperty(this,"isDragging",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"content",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"spinner",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"containerRect",{enumerable:!0,configurable:!0,writable:!0,value:{width:0,height:0,innerWidth:0,innerHeight:0}}),Object.defineProperty(this,"contentRect",{enumerable:!0,configurable:!0,writable:!0,value:{top:0,right:0,bottom:0,left:0,fullWidth:0,fullHeight:0,fitWidth:0,fitHeight:0,width:0,height:0}}),Object.defineProperty(this,"dragStart",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0,top:0,left:0,time:0}}),Object.defineProperty(this,"dragOffset",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0,time:0}}),Object.defineProperty(this,"current",{enumerable:!0,configurable:!0,writable:!0,value:Object.assign({},T)}),Object.defineProperty(this,"target",{enumerable:!0,configurable:!0,writable:!0,value:Object.assign({},T)}),Object.defineProperty(this,"velocity",{enumerable:!0,configurable:!0,writable:!0,value:{a:0,b:0,c:0,d:0,e:0,f:0}}),Object.defineProperty(this,"lockedAxis",{enumerable:!0,configurable:!0,writable:!0,value:!1}),!t)throw new Error("Container Element Not Found");this.container=t,this.initContent(),this.attachPlugins(Object.assign(Object.assign({},D.Plugins),i)),this.emit("attachPlugins"),this.emit("init");const o=this.content;if(o.addEventListener("load",this.onLoad),o.addEventListener("error",this.onError),this.isContentLoading){if(this.option("spinner")){t.classList.add(this.cn("isLoading"));const e=s(E);!t.contains(o)||o.parentElement instanceof HTMLPictureElement?this.spinner=t.appendChild(e):this.spinner=(null===(n=o.parentElement)||void 0===n?void 0:n.insertBefore(e,o))||null}this.emit("beforeLoad")}else queueMicrotask((()=>{this.enable()}))}initContent(){const{container:t}=this,e=this.cn(z);let i=this.option(z)||t.querySelector(`.${e}`);if(i||(i=t.querySelector("img,picture")||t.firstElementChild,i&&C(i,e)),i instanceof HTMLPictureElement&&(i=i.querySelector("img")),!i)throw new Error("No content found");this.content=i}onLoad(){const{spinner:t,container:e,state:i}=this;t&&(t.remove(),this.spinner=null),this.option("spinner")&&e.classList.remove(this.cn("isLoading")),this.emit
38("afterLoad"),i===v.Init?this.enable():this.updateMetrics()}onError(){this.state!==v.Destroy&&(this.spinner&&(this.spinner.remove(),this.spinner=null),this.stop(),this.detachEvents(),this.state=v.Error,this.emit("error"))}getNextScale(t){const{fullScale:e,targetScale:i,coverScale:n,maxScale:s,minScale:o}=this;let a=o;switch(t){case"toggleMax":a=i-o<.5*(s-o)?s:o;break;case"toggleCover":a=i-o<.5*(n-o)?n:o;break;case"toggleZoom":a=i-o<.5*(e-o)?e:o;break;case"iterateZoom":let t=[1,e,s].sort(((t,e)=>t-e)),r=t.findIndex((t=>t>i+1e-5));a=t[r]||1}return a}attachObserver(){var t;const e=()=>{const{container:t,containerRect:e}=this;return Math.abs(e.width-t.getBoundingClientRect().width)>.1||Math.abs(e.height-t.getBoundingClientRect().height)>.1};this.resizeObserver||void 0===window.ResizeObserver||(this.resizeObserver=new ResizeObserver((()=>{this.updateTimer||(e()?(this.onResize(),this.isMobile&&(this.updateTimer=setTimeout((()=>{e()&&this.onResize(),this.updateTimer=null}),500))):this.updateTimer&&(clearTimeout(this.updateTimer),this.updateTimer=null))}))),null===(t=this.resizeObserver)||void 0===t||t.observe(this.container)}detachObserver(){var t;null===(t=this.resizeObserver)||void 0===t||t.disconnect()}attachEvents(){const{container:t}=this;t.addEventListener("click",this.onClick,{passive:!1,capture:!1}),t.addEventListener("wheel",this.onWheel,{passive:!1}),this.pointerTracker=new c(t,{start:this.onPointerDown,move:this.onPointerMove,end:this.onPointerUp}),document.addEventListener(A,this.onMouseMove)}detachEvents(){var t;const{container:e}=this;e.removeEventListener("click",this.onClick,{passive:!1,capture:!1}),e.removeEventListener("wheel",this.onWheel,{passive:!1}),null===(t=this.pointerTracker)||void 0===t||t.stop(),this.pointerTracker=null,document.removeEventListener(A,this.onMouseMove),document.removeEventListener("keydown",this.onKeydown,!0),this.clickTimer&&(clearTimeout(this.clickTimer),this.clickTimer=null),this.updateTimer&&(clearTimeout(this.updateTimer),this.updateTimer=null)}animate(){this.setTargetForce();const t=this.friction,e=this.option("maxVelocity");for(const i of b)t?(this.velocity[i]*=1-t,e&&!this.isScaling&&(this.velocity[i]=Math.max(Math.min(this.velocity[i],e),-1*e)),this.current[i]+=this.velocity[i]):this.current[i]=this.target[i];this.setTransform(),this.setEdgeForce(),!this.isResting||this.isDragging?this.rAF=requestAnimationFrame((()=>this.animate())):this.stop("current")}setTargetForce(){for(const t of b)"e"===t&&this.isBouncingX||"f"===t&&this.isBouncingY||(this.velocity[t]=(1/(1-this.friction)-1)*(this.target[t]-this.current[t]))}checkBounds(t=0,e=0){const{current:i}=this,n=i.e+t,s=i.f+e,o=this.getBounds(),{x:a,y:r}=o,l=a.min,c=a.max,h=r.min,d=r.max;let u=0,p=0;return l!==1/0&&n<l?u=l-n:c!==1/0&&n>c&&(u=c-n),h!==1/0&&s<h?p=h-s:d!==1/0&&s>d&&(p=d-s),Math.abs(u)<1e-4&&(u=0),Math.abs(p)<1e-4&&(p=0),Object.assign(Object.assign({},o),{xDiff:u,yDiff:p,inBounds:!u&&!p})}clampTargetBounds(){const{target:t}=this,{x:e,y:i}=this.getBounds();e.min!==1/0&&(t.e=Math.max(t.e,e.min)),e.max!==1/0&&(t.e=Math.min(t.e,e.max)),i.min!==1/0&&(t.f=Math.max(t.f,i.min)),i.max!==1/0&&(t.f=Math.min(t.f,i.max))}calculateContentDim(t=this.current){const{content:e,contentRect:i}=this,{fitWidth:n,fitHeight:s,fullWidth:o,fullHeight:a}=i;let r=o,l=a;if(this.option("zoom")||0!==this.angle){const i=!(e instanceof HTMLImageElement)&&("none"===window.getComputedStyle(e).maxWidth||"none"===window.getComputedStyle(e).maxHeight),c=i?o:n,h=i?a:s,d=this.getMatrix(t),u=new DOMPoint(0,0).matrixTransform(d),p=new DOMPoint(0+c,0).matrixTransform(d),f=new DOMPoint(0+c,0+h).matrixTransform(d),g=new DOMPoint(0,0+h).matrixTransform(d),m=Math.abs(f.x-u.x),v=Math.abs(f.y-u.y),b=Math.abs(g.x-p.x),y=Math.abs(g.y-p.y);r=Math.max(m,b),l=Math.max(v,y)}return{contentWidth:r,contentHeight:l}}setEdgeForce(){if(this.ignoreBounds||this.isDragging||this.panMode===A||this.targetScale<this.scale)return this.isBouncingX=!1,void(this.isBouncingY=!1);const{target:t}=this,{x:e,y:i,xDiff:n,yDiff:s}=this.checkBounds();const o=this.option("maxVelocity");let a=this.velocity.e,r=this.velocity.f;0!==n?(this.isBouncingX=!0,n*a<=0?a+=.14*n:(a=.14*n,e.min!==1/0&&(this.target.e=Math.max(t.e,e.min)),e.max!==1/0&&(this.target.e=Math.min(t.e,e.max))),o&&(a=Math.max(Math.min(a,o),-1*o))):this.isBouncingX=!1,0!==s?(this.isBouncingY=!0,s*r<=0?r+=.14*s:(r=.14*s,i.min!==1/0&&(this.target.f=Math.max(t.f,i.min)),i.max!==1/0&&(this.target.f=Math.min(t.f,i.max))),o&&(r=Math.max(Math.min(r,o),-1*o))):this.isBouncingY=!1,this.isBouncingX&&(this.velocity.e=a
38),this.isBouncingY&&(this.velocity.f=r)}enable(){const{content:t}=this,e=new DOMMatrixReadOnly(window.getComputedStyle(t).transform);for(const t of b)this.current[t]=this.target[t]=e[t];this.updateMetrics(),this.attachObserver(),this.attachEvents(),this.state=v.Ready,this.emit("ready")}onClick(t){var e;"click"===t.type&&0===t.detail&&(this.dragOffset.x=0,this.dragOffset.y=0),this.isDragging&&(null===(e=this.pointerTracker)||void 0===e||e.clear(),this.trackingPoints=[],this.startDecelAnim());const i=t.target;if(!i||t.defaultPrevented)return;if(i.hasAttribute("disabled"))return t.preventDefault(),void t.stopPropagation();if((()=>{const t=window.getSelection();return t&&"Range"===t.type})()&&!i.closest("button"))return;const n=i.closest("[data-panzoom-action]"),s=i.closest("[data-panzoom-change]"),o=n||s,a=o&&S(o)?o.dataset:null;if(a){const e=a.panzoomChange,i=a.panzoomAction;if((e||i)&&t.preventDefault(),e){let t={};try{t=JSON.parse(e)}catch(t){console&&console.warn("The given data was not valid JSON")}return void this.applyChange(t)}if(i)return void(this[i]&&this[i]())}if(Math.abs(this.dragOffset.x)>3||Math.abs(this.dragOffset.y)>3)return t.preventDefault(),void t.stopPropagation();if(i.closest("[data-fancybox]"))return;const r=this.content.getBoundingClientRect(),l=this.dragStart;if(l.time&&!this.canZoomOut()&&(Math.abs(r.x-l.x)>2||Math.abs(r.y-l.y)>2))return;this.dragStart.time=0;const c=e=>{this.option("zoom",t)&&e&&"string"==typeof e&&/(iterateZoom)|(toggle(Zoom|Full|Cover|Max)|(zoomTo(Fit|Cover|Max)))/.test(e)&&"function"==typeof this[e]&&(t.preventDefault(),this[e]({event:t}))},h=this.option("click",t),d=this.option("dblClick",t);d?(this.clicks++,1==this.clicks&&(this.clickTimer=setTimeout((()=>{1===this.clicks?(this.emit("click",t),!t.defaultPrevented&&h&&c(h)):(this.emit("dblClick",t),t.defaultPrevented||c(d)),this.clicks=0,this.clickTimer=null}),350))):(this.emit("click",t),!t.defaultPrevented&&h&&c(h))}addTrackingPoint(t){const e=this.trackingPoints.filter((t=>t.time>Date.now()-100));e.push(t),this.trackingPoints=e}onPointerDown(t,e,i){var n;if(!1===this.option("touch",t))return!1;this.pwt=0,this.dragOffset={x:0,y:0,time:0},this.trackingPoints=[];const s=this.content.getBoundingClientRect();if(this.dragStart={x:s.x,y:s.y,top:s.top,left:s.left,time:Date.now()},this.clickTimer)return!1;if(this.panMode===A&&this.targetScale>1)return t.preventDefault(),t.stopPropagation(),!1;const o=t.composedPath()[0];if(!i.length){if(["TEXTAREA","OPTION","INPUT","SELECT","VIDEO","IFRAME"].includes(o.nodeName)||o.closest("[contenteditable],[data-selectable],[data-draggable],[data-clickable],[data-panzoom-change],[data-panzoom-action]"))return!1;null===(n=window.getSelection())||void 0===n||n.removeAllRanges()}if("mousedown"===t.type)["A","BUTTON"].includes(o.nodeName)||t.preventDefault();else if(Math.abs(this.velocity.a)>.3)return!1;return this.target.e=this.current.e,this.target.f=this.current.f,this.stop(),this.isDragging||(this.isDragging=!0,this.addTrackingPoint(e),this.emit("touchStart",t)),!0}onPointerMove(t,i,s){if(!1===this.option("touch",t))return;if(!this.isDragging)return;if(i.length<2&&this.panOnlyZoomed&&e(this.targetScale)<=e(this.minScale))return;if(this.emit("touchMove",t),t.defaultPrevented)return;this.addTrackingPoint(i[0]);const{content:o}=this,a=d(s[0],s[1]),r=d(i[0],i[1]);let l=0,c=0;if(i.length>1){const t=o.getBoundingClientRect();l=a.clientX-t.left-.5*t.width,c=a.clientY-t.top-.5*t.height}const u=h(s[0],s[1]),p=h(i[0],i[1]);let f=u?p/u:1,g=r.clientX-a.clientX,m=r.clientY-a.clientY;this.dragOffset.x+=g,this.dragOffset.y+=m,this.dragOffset.time=Date.now()-this.dragStart.time;let v=e(this.targetScale)===e(this.minScale)&&this.option("lockAxis");if(v&&!this.lockedAxis)if("xy"===v||"y"===v||"touchmove"===t.type){if(Math.abs(this.dragOffset.x)<6&&Math.abs(this.dragOffset.y)<6)return void t.preventDefault();const e=Math.abs(180*Math.atan2(this.dragOffset.y,this.dragOffset.x)/Math.PI);this.lockedAxis=e>45&&e<135?"y":"x",this.dragOffset.x=0,this.dragOffset.y=0,g=0,m=0}else this.lockedAxis=v;if(n(t.target,this.content)&&(v="x",this.dragOffset.y=0),v&&"xy"!==v&&this.lockedAxis!==v&&e(this.targetScale)===e(this.minScale))return;t.cancelable&&t.preventDefault(),this.container.classList.add(this.cn("isDragging"));const b=this.checkBounds(g,m);this.option("rubberband")?("x"!==this.isInfinite&&(b.xDiff>0&&g<0||b.xDiff<0&&g>0)&&(g*=Math.max(0,.5-Math.abs(.75/this.contentRect.fitWidth*b.xDiff))),"y"!==this.isInfinite&&(b.yDiff>0&&m<0||b.yDiff<0&&m>0)&&(m*=Math.max(0,.5-Math.abs(.75/this.contentRect.fitHeight*b.yDiff)))):(b.xDiff&&(g=0),b.yDiff&&(m=0));const y=this.targetScale,w=this.minScale,x=this.maxScale;y<.5*w&&(f=Math.max(f,w)),y>
381.5*x&&(f=Math.min(f,x)),"y"===this.lockedAxis&&e(y)===e(w)&&(g=0),"x"===this.lockedAxis&&e(y)===e(w)&&(m=0),this.applyChange({originX:l,originY:c,panX:g,panY:m,scale:f,friction:this.option("dragFriction"),ignoreBounds:!0})}onPointerUp(t,e,i){if(i.length)return this.dragOffset.x=0,this.dragOffset.y=0,void(this.trackingPoints=[]);this.container.classList.remove(this.cn("isDragging")),this.isDragging&&(this.addTrackingPoint(e),this.panOnlyZoomed&&this.contentRect.width-this.contentRect.fitWidth<1&&this.contentRect.height-this.contentRect.fitHeight<1&&(this.trackingPoints=[]),n(t.target,this.content)&&"y"===this.lockedAxis&&(this.trackingPoints=[]),this.emit("touchEnd",t),this.isDragging=!1,this.lockedAxis=!1,this.state!==v.Destroy&&(t.defaultPrevented||this.startDecelAnim()))}startDecelAnim(){var t;const i=this.isScaling;this.rAF&&(cancelAnimationFrame(this.rAF),this.rAF=null),this.isBouncingX=!1,this.isBouncingY=!1;for(const t of b)this.velocity[t]=0;this.target.e=this.current.e,this.target.f=this.current.f,P(this.container,"is-scaling"),P(this.container,"is-animating"),this.isTicking=!1;const{trackingPoints:n}=this,s=n[0],o=n[n.length-1];let a=0,r=0,l=0;o&&s&&(a=o.clientX-s.clientX,r=o.clientY-s.clientY,l=o.time-s.time);const c=(null===(t=window.visualViewport)||void 0===t?void 0:t.scale)||1;1!==c&&(a*=c,r*=c);let h=0,d=0,u=0,p=0,f=this.option("decelFriction");const g=this.targetScale;if(l>0){u=Math.abs(a)>3?a/(l/30):0,p=Math.abs(r)>3?r/(l/30):0;const t=this.option("maxVelocity");t&&(u=Math.max(Math.min(u,t),-1*t),p=Math.max(Math.min(p,t),-1*t))}u&&(h=u/(1/(1-f)-1)),p&&(d=p/(1/(1-f)-1)),("y"===this.option("lockAxis")||"xy"===this.option("lockAxis")&&"y"===this.lockedAxis&&e(g)===this.minScale)&&(h=u=0),("x"===this.option("lockAxis")||"xy"===this.option("lockAxis")&&"x"===this.lockedAxis&&e(g)===this.minScale)&&(d=p=0);const m=this.dragOffset.x,v=this.dragOffset.y,y=this.option("dragMinThreshold")||0;Math.abs(m)<y&&Math.abs(v)<y&&(h=d=0,u=p=0),(this.option("zoom")&&(g<this.minScale-1e-5||g>this.maxScale+1e-5)||i&&!h&&!d)&&(f=.35),this.applyChange({panX:h,panY:d,friction:f}),this.emit("decel",u,p,m,v)}onWheel(t){var e=[-t.deltaX||0,-t.deltaY||0,-t.detail||0].reduce((function(t,e){return Math.abs(e)>Math.abs(t)?e:t}));const i=Math.max(-1,Math.min(1,e));if(this.emit("wheel",t,i),this.panMode===A)return;if(t.defaultPrevented)return;const n=this.option("wheel");"pan"===n?(t.preventDefault(),this.panOnlyZoomed&&!this.canZoomOut()||this.applyChange({panX:2*-t.deltaX,panY:2*-t.deltaY,bounce:!1})):"zoom"===n&&!1!==this.option("zoom")&&this.zoomWithWheel(t)}onMouseMove(t){this.panWithMouse(t)}onKeydown(t){"Escape"===t.key&&this.toggleFS()}onResize(){this.updateMetrics(),this.checkBounds().inBounds||this.requestTick()}setTransform(){this.emit("beforeTransform");const{current:t,target:i,content:n,contentRect:s}=this,o=Object.assign({},T);for(const n of b){const s="e"==n||"f"===n?O:M;o[n]=e(t[n],s),Math.abs(i[n]-t[n])<("e"==n||"f"===n?.51:.001)&&(t[n]=i[n])}let{a:a,b:r,c:l,d:c,e:h,f:d}=o,u=`matrix(${a}, ${r}, ${l}, ${c}, ${h}, ${d})`,p=n.parentElement instanceof HTMLPictureElement?n.parentElement:n;if(this.option("transformParent")&&(p=p.parentElement||p),p.style.transform===u)return;p.style.transform=u;const{contentWidth:f,contentHeight:g}=this.calculateContentDim();s.width=f,s.height=g,this.emit("afterTransform")}updateMetrics(t=!1){var i;if(!this||this.state===v.Destroy)return;if(this.isContentLoading)return;const n=Math.max(1,(null===(i=window.visualViewport)||void 0===i?void 0:i.scale)||1),{container:s,content:o}=this,a=o instanceof HTMLImageElement,r=s.getBoundingClientRect(),l=getComputedStyle(this.container);let c=r.width*n,h=r.height*n;const d=parseFloat(l.paddingTop)+parseFloat(l.paddingBottom),u=c-(parseFloat(l.paddingLeft)+parseFloat(l.paddingRight)),p=h-d;this.containerRect={width:c,height:h,innerWidth:u,innerHeight:p};const f=parseFloat(o.dataset.width||"")||(t=>{let e=0;return e=t instanceof HTMLImageElement?t.naturalWidth:t instanceof SVGElement?t.width.baseVal.value:Math.max(t.offsetWidth,t.scrollWidth),e||0})(o),g=parseFloat(o.dataset.height||"")||(t=>{let e=0;return e=t instanceof HTMLImageElement?t.naturalHeight:t instanceof SVGElement?t.height.baseVal.value:Math.max(t.offsetHeight,t.scrollHeight),e||0})(o);let m=this.option("width",f)||R,b=this.option("height",g)||R;const y=m===R,w=b===R;"number"!=typeof m&&(m=f),"number"!=typeof b&&(b=g),y&&(m=f*(b/g)),w&&(b=g/(f/m));let x=o.parentElement instanceof HTMLPictureElement?o.parentElement:o;this.option("transformParent")&&(x=x.parentElement||x);const E=x.getAttribute("style")||"";x.style.setProperty("transform","none","important"),a&&(x.style.width="",x.style.height=""),x.offsetHeight;const S=o.getBoundingClientRect();let P=S.width*n,C=S.height*n,T=P,M=C;P=Math.min(P,m),C=Math.min(C,b),a?({width:P,height:C}
38=((t,e,i,n)=>{const s=i/t,o=n/e,a=Math.min(s,o);return{width:t*=a,height:e*=a}})(m,b,P,C)):(P=Math.min(P,m),C=Math.min(C,b));let O=.5*(M-C),A=.5*(T-P);this.contentRect=Object.assign(Object.assign({},this.contentRect),{top:S.top-r.top+O,bottom:r.bottom-S.bottom+O,left:S.left-r.left+A,right:r.right-S.right+A,fitWidth:P,fitHeight:C,width:P,height:C,fullWidth:m,fullHeight:b}),x.style.cssText=E,a&&(x.style.width=`${P}px`,x.style.height=`${C}px`),this.setTransform(),!0!==t&&this.emit("refresh"),this.ignoreBounds||(e(this.targetScale)<e(this.minScale)?this.zoomTo(this.minScale,{friction:0}):this.targetScale>this.maxScale?this.zoomTo(this.maxScale,{friction:0}):this.state===v.Init||this.checkBounds().inBounds||this.requestTick()),this.updateControls()}calculateBounds(){const{contentWidth:t,contentHeight:i}=this.calculateContentDim(this.target),{targetScale:n,lockedAxis:s}=this,{fitWidth:o,fitHeight:a}=this.contentRect;let r=0,l=0,c=0,h=0;const d=this.option("infinite");if(!0===d||s&&d===s)r=-1/0,c=1/0,l=-1/0,h=1/0;else{let{containerRect:s,contentRect:d}=this,u=e(o*n,O),p=e(a*n,O),{innerWidth:f,innerHeight:g}=s;if(s.width===u&&(f=s.width),s.width===p&&(g=s.height),t>f){c=.5*(t-f),r=-1*c;let e=.5*(d.right-d.left);r+=e,c+=e}if(o>f&&t<f&&(r-=.5*(o-f),c-=.5*(o-f)),i>g){h=.5*(i-g),l=-1*h;let t=.5*(d.bottom-d.top);l+=t,h+=t}a>g&&i<g&&(r-=.5*(a-g),c-=.5*(a-g))}return{x:{min:r,max:c},y:{min:l,max:h}}}getBounds(){const t=this.option("bounds");return t!==R?t:this.calculateBounds()}updateControls(){const t=this,i=t.container,{panMode:n,contentRect:s,targetScale:o,minScale:r}=t;let l=r,c=t.option("click")||!1;c&&(l=t.getNextScale(c));let h=t.canZoomIn(),d=t.canZoomOut(),u=n===L&&!!this.option("touch"),p=d&&u;if(u&&(e(o)<e(r)&&!this.panOnlyZoomed&&(p=!0),(e(s.width,1)>e(s.fitWidth,1)||e(s.height,1)>e(s.fitHeight,1))&&(p=!0)),e(s.width*o,1)<e(s.fitWidth,1)&&(p=!1),n===A&&(p=!1),a(i,this.cn("isDraggable"),p),!this.option("zoom"))return;let f=h&&e(l)>e(o),g=!f&&!p&&d&&e(l)<e(o);a(i,this.cn("canZoomIn"),f),a(i,this.cn("canZoomOut"),g);for(const t of i.querySelectorAll("[data-panzoom-action]")){let e=!1,i=!1;switch(t.dataset.panzoomAction){case"zoomIn":h?e=!0:i=!0;break;case"zoomOut":d?e=!0:i=!0;break;case"toggleZoom":case"iterateZoom":h||d?e=!0:i=!0;const n=t.querySelector("g");n&&(n.style.display=h?"":"none")}e?(t.removeAttribute("disabled"),t.removeAttribute("tabindex")):i&&(t.setAttribute("disabled",""),t.setAttribute("tabindex","-1"))}}panTo({x:t=this.target.e,y:e=this.target.f,scale:i=this.targetScale,friction:n=this.option("friction"),angle:s=0,originX:o=0,originY:a=0,flipX:r=!1,flipY:l=!1,ignoreBounds:c=!1}){this.state!==v.Destroy&&this.applyChange({panX:t-this.target.e,panY:e-this.target.f,scale:i/this.targetScale,angle:s,originX:o,originY:a,friction:n,flipX:r,flipY:l,ignoreBounds:c})}applyChange({panX:t=0,panY:i=0,scale:n=1,angle:s=0,originX:o=-this.current.e,originY:a=-this.current.f,friction:r=this.option("friction"),flipX:l=!1,flipY:c=!1,ignoreBounds:h=!1,bounce:d=this.option("bounce")}){const u=this.state;if(u===v.Destroy)return;this.rAF&&(cancelAnimationFrame(this.rAF),this.rAF=null),this.friction=r||0,this.ignoreBounds=h;const{current:p}=this,f=p.e,g=p.f,m=this.getMatrix(this.target);let y=(new DOMMatrix).translate(f,g).translate(o,a).translate(t,i);if(this.option("zoom")){if(!h){const t=this.targetScale,e=this.minScale,i=this.maxScale;t*n<e&&(n=e/t),t*n>i&&(n=i/t)}y=y.scale(n)}y=y.translate(-o,-a).translate(-f,-g).multiply(m),s&&(y=y.rotate(s)),l&&(y=y.scale(-1,1)),c&&(y=y.scale(1,-1));for(const t of b)"e"!==t&&"f"!==t&&(y[t]>this.minScale+1e-5||y[t]<this.minScale-1e-5)?this.target[t]=y[t]:this.target[t]=e(y[t],O);(this.targetScale<this.scale||Math.abs(n-1)>.1||this.panMode===A||!1===d)&&!h&&this.clampTargetBounds(),u===v.Init?this.animate():this.isResting||(this.state=v.Panning,this.requestTick())}stop(t=!1){if(this.state===v.Init||this.state===v.Destroy)return;const e=this.isTicking;this.rAF&&(cancelAnimationFrame(this.rAF),this.rAF=null),this.isBouncingX=!1,this.isBouncingY=!1;for(const e of b)this.velocity[e]=0,"current"===t?this.current[e]=this.target[e]:"target"===t&&(this.target[e]=this.current[e]);this.setTransform(),P(this.container,"is-scaling"),P(this.container,"is-animating"),this.isTicking=!1,this.state=v.Ready,e&&(this.emit
38("endAnimation"),this.updateControls())}requestTick(){this.isTicking||(this.emit("startAnimation"),this.updateControls(),C(this.container,"is-animating"),this.isScaling&&C(this.container,"is-scaling")),this.isTicking=!0,this.rAF||(this.rAF=requestAnimationFrame((()=>this.animate())))}panWithMouse(t,i=this.option("mouseMoveFriction")){if(this.pmme=t,this.panMode!==A||!t)return;if(e(this.targetScale)<=e(this.minScale))return;this.emit("mouseMove",t);const{container:n,containerRect:s,contentRect:o}=this,a=s.width,r=s.height,l=n.getBoundingClientRect(),c=(t.clientX||0)-l.left,h=(t.clientY||0)-l.top;let{contentWidth:d,contentHeight:u}=this.calculateContentDim(this.target);const p=this.option("mouseMoveFactor");p>1&&(d!==a&&(d*=p),u!==r&&(u*=p));let f=.5*(d-a)-c/a*100/100*(d-a);f+=.5*(o.right-o.left);let g=.5*(u-r)-h/r*100/100*(u-r);g+=.5*(o.bottom-o.top),this.applyChange({panX:f-this.target.e,panY:g-this.target.f,friction:i})}zoomWithWheel(t){if(this.state===v.Destroy||this.state===v.Init)return;const i=Date.now();if(i-this.pwt<45)return void t.preventDefault();this.pwt=i;var n=[-t.deltaX||0,-t.deltaY||0,-t.detail||0].reduce((function(t,e){return Math.abs(e)>Math.abs(t)?e:t}));const s=Math.max(-1,Math.min(1,n)),{targetScale:o,maxScale:a,minScale:r}=this;let l=o*(100+45*s)/100;e(l)<e(r)&&e(o)<=e(r)?(this.cwd+=Math.abs(s),l=r):e(l)>e(a)&&e(o)>=e(a)?(this.cwd+=Math.abs(s),l=a):(this.cwd=0,l=Math.max(Math.min(l,a),r)),this.cwd>this.option("wheelLimit")||(t.preventDefault(),e(l)!==e(o)&&this.zoomTo(l,{event:t}))}canZoomIn(){return this.option("zoom")&&(e(this.contentRect.width,1)<e(this.contentRect.fitWidth,1)||e(this.targetScale)<e(this.maxScale))}canZoomOut(){return this.option("zoom")&&e(this.targetScale)>e(this.minScale)}zoomIn(t=1.25,e){this.zoomTo(this.targetScale*t,e)}zoomOut(t=.8,e){this.zoomTo(this.targetScale*t,e)}zoomToFit(t){this.zoomTo("fit",t)}zoomToCover(t){this.zoomTo("cover",t)}zoomToFull(t){this.zoomTo("full",t)}zoomToMax(t){this.zoomTo("max",t)}toggleZoom(t){this.zoomTo(this.getNextScale("toggleZoom"),t)}toggleMax(t){this.zoomTo(this.getNextScale("toggleMax"),t)}toggleCover(t){this.zoomTo(this.getNextScale("toggleCover"),t)}iterateZoom(t){this.zoomTo("next",t)}zoomTo(t=1,{friction:e=R,originX:i=R,originY:n=R,event:s}={}){if(this.isContentLoading||this.state===v.Destroy)return;const{targetScale:o,fullScale:a,maxScale:r,coverScale:l}=this;if(this.stop(),this.panMode===A&&(s=this.pmme||s),s||i===R||n===R){const t=this.content.getBoundingClientRect(),e=this.container.getBoundingClientRect(),o=s?s.clientX:e.left+.5*e.width,a=s?s.clientY:e.top+.5*e.height;i=o-t.left-.5*t.width,n=a-t.top-.5*t.height}let c=1;"number"==typeof t?c=t:"full"===t?c=a:"cover"===t?c=l:"max"===t?c=r:"fit"===t?c=1:"next"===t&&(c=this.getNextScale("iterateZoom")),c=c/o||1,e=e===R?c>1?.15:.25:e,this.applyChange({scale:c,originX:i,originY:n,friction:e}),s&&this.panMode===A&&this.panWithMouse(s,e)}rotateCCW(){this.applyChange({angle:-90})}rotateCW(){this.applyChange({angle:90})}flipX(){this.applyChange({flipX:!0})}flipY(){this.applyChange({flipY:!0})}fitX(){this.stop("target");const{containerRect:t,contentRect:e,target:i}=this;this.applyChange({panX:.5*t.width-(e.left+.5*e.fitWidth)-i.e,panY:.5*t.height-(e.top+.5*e.fitHeight)-i.f,scale:t.width/e.fitWidth/this.targetScale,originX:0,originY:0,ignoreBounds:!0})}fitY(){this.stop("target");const{containerRect:t,contentRect:e,target:i}=this;this.applyChange({panX:.5*t.width-(e.left+.5*e.fitWidth)-i.e,panY:.5*t.innerHeight-(e.top+.5*e.fitHeight)-i.f,scale:t.height/e.fitHeight/this.targetScale,originX:0,originY:0,ignoreBounds:!0})}toggleFS(){const{container:t}=this,e=this.cn("inFullscreen"),i=this.cn("htmlHasFullscreen");t.classList.toggle(e);const n=t.classList.contains(e);n?(document.documentElement.classList.add(i),document.addEventListener("keydown",this.onKeydown,!0)):(document.documentElement.classList.remove(i),document.removeEventListener("keydown",this.onKeydown,!0)),this.updateMetrics(),this.emit(n?"enterFS":"exitFS")}getMatrix(t=this.current){const{a:e,b:i,c:n,d:s,e:o,f:a}=t;return new DOMMatrix([e,i,n,s,o,a])}reset(t){if(this.state!==v.Init&&this.state!==v.Destroy){this.stop("current");for(const t of b)this.target[t]=T[t];this.target.a=this.minScale,this.target.d=this.minScale,this.clampTargetBounds(),this.isResting||(this.friction=void 0===t?this.option("friction"):t,this.state=v.Panning,this.requestTick())}}
38destroy(){this.stop(),this.state=v.Destroy,this.detachEvents(),this.detachObserver();const{container:t,content:e}=this,i=this.option("classes")||{};for(const e of Object.values(i))t.classList.remove(e+"");e&&(e.removeEventListener("load",this.onLoad),e.removeEventListener("error",this.onError)),this.detachPlugins()}}Object.defineProperty(D,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:w}),Object.defineProperty(D,"Plugins",{enumerable:!0,configurable:!0,writable:!0,value:{}});const F=function(t,e){let i=!0;return(...n)=>{i&&(i=!1,t(...n),setTimeout((()=>{i=!0}),e))}},j=(t,e)=>{let i=[];return t.childNodes.forEach((t=>{t.nodeType!==Node.ELEMENT_NODE||e&&!t.matches(e)||i.push(t)})),i},B={viewport:null,track:null,enabled:!0,slides:[],axis:"x",transition:"fade",preload:1,slidesPerPage:"auto",initialPage:0,friction:.12,Panzoom:{decelFriction:.12},center:!0,infinite:!0,fill:!0,dragFree:!1,adaptiveHeight:!1,direction:"ltr",classes:{container:"f-carousel",viewport:"f-carousel__viewport",track:"f-carousel__track",slide:"f-carousel__slide",isLTR:"is-ltr",isRTL:"is-rtl",isHorizontal:"is-horizontal",isVertical:"is-vertical",inTransition:"in-transition",isSelected:"is-selected"},l10n:{NEXT:"Next slide",PREV:"Previous slide",GOTO:"Go to slide #%d"}};var H;!function(t){t[t.Init=0]="Init",t[t.Ready=1]="Ready",t[t.Destroy=2]="Destroy"}(H||(H={}));const N=t=>{if("string"==typeof t||t instanceof HTMLElement)t={html:t};else{const e=t.thumb;void 0!==e&&("string"==typeof e&&(t.thumbSrc=e),e instanceof HTMLImageElement&&(t.thumbEl=e,t.thumbElSrc=e.src,t.thumbSrc=e.src),delete t.thumb)}return Object.assign({html:"",el:null,isDom:!1,class:"",customClass:"",index:-1,dim:0,gap:0,pos:0,transition:!1},t)},_=(t={})=>Object.assign({index:-1,slides:[],dim:0,pos:-1},t);class $ extends g{constructor(t,e){super(e),Object.defineProperty(this,"instance",{enumerable:!0,configurable:!0,writable:!0,value:t})}attach(){}detach(){}}const W={classes:{list:"f-carousel__dots",isDynamic:"is-dynamic",hasDots:"has-dots",dot:"f-carousel__dot",isBeforePrev:"is-before-prev",isPrev:"is-prev",isCurrent:"is-current",isNext:"is-next",isAfterNext:"is-after-next"},dotTpl:'<button type="button" data-carousel-page="%i" aria-label="{{GOTO}}"><span class="f-carousel__dot" aria-hidden="true"></span></button>',dynamicFrom:11,maxCount:1/0,minCount:2};class X extends ${constructor(){super(...arguments),Object.defineProperty(this,"isDynamic",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"list",{enumerable:!0,configurable:!0,writable:!0,value:null})}onRefresh(){this.refresh()}build(){let t=this.list;if(!t){t=document.createElement("ul"),C(t,this.cn("list")),t.setAttribute("role","tablist");const e=this.instance.container;e.appendChild(t),C(e,this.cn("hasDots")),this.list=t}return t}refresh(){var t;const e=this.instance.pages.length,i=Math.min(2,this.option("minCount")),n=Math.max(2e3,this.option("maxCount")),s=this.option("dynamicFrom");if(e<i||e>n)return void this.cleanup();const o="number"==typeof s&&e>5&&e>=s,r=!this.list||this.isDynamic!==o||this.list.children.length!==e;r&&this.cleanup();const l=this.build();if(a(l,this.cn("isDynamic"),!!o),r)for(let t=0;t<e;t++)l.append(this.createItem(t));let c,h=0;for(const e of[...l.children]){const i=h===this.instance.page;i&&(c=e),a(e,this.cn("isCurrent"),i),null===(t=e.children[0])||void 0===t||t.setAttribute("aria-selected",i?"true":"false");for(const t of["isBeforePrev","isPrev","isNext","isAfterNext"])P(e,this.cn(t));h++}if(c=c||l.firstChild,o&&c){const t=c.previousElementSibling,e=t&&t.previousElementSibling;C(t,this.cn("isPrev")),C(e,this.cn("isBeforePrev"));const i=c.nextElementSibling,n=i&&i.nextElementSibling;C(i,this.cn("isNext")),C(n,this.cn("isAfterNext"))}this.isDynamic=o}createItem(t=0){var e;const i=document.createElement("li");i.setAttribute("role","presentation");const n=s(this.instance.localize(this.option("dotTpl"),[["%d",t+1]]).replace(/\%i/g,t+""));return i.appendChild(n),null===(e=i.children[0])||void 0===e||e.setAttribute("role","tab"),i}cleanup(){this.list&&(this.list.remove(),this.list=null),this.isDynamic=!1,P(this.instance.container,this.cn("hasDots"))}attach(){this.instance.on(["refresh","change"],this.onRefresh)}detach(){this.instance.off(["refresh","change"],this.onRefresh),this.cleanup()}}Object.defineProperty(X,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:W});const q="disabled",Y="next",V="prev";class Z extends ${constructor(){super(...arguments),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"prev",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"next",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"isDom",{enumerable:!0,configurable:!0,writable:!0,value:!1})}onRefresh(){const t=this.instance,e=t.pages.length,i=t.page;if(e<2)return void this.cleanup();this.build();let n=this.prev,s=this.next;n&&s&&(n.removeAttribute(q),s.removeAttribute(q),t.isInfinite||(i<=0&&n.setAttribute(q,""),i>=e-1&&s.setAttribute(q,"")))}addBtn(t){var e;const i=this.instance,n=document.createElement("button");n.setAttribute("tabindex","0"),n.setAttribute("title",i.localize(`{{${t.toUpperCase()}}}`)),C(n,this.cn("button")+" "+this.cn(t===Y?"isNext":"isPrev"));const s=i.isRTL?t===Y?V:Y:t;var o;return n.innerHTML=i.localize(this.option(`${s}Tpl`)),n.dataset[`carousel${o=t,o?o.match("^[a-z]")?o.charAt(0).toUpperCase()+o.substring(1):o:""}`]="true",null===(e=this.container)||void 0===e||e.appendChild(n),n}build(){const t=this.instance.container,e=this.cn("container");let{container:i,prev:n,next:s}=this;i||(i=t.querySelector("."+e),this.isDom=!!i),i||(i=document.createElement("div"),C(i,e),t.appendChild(i)),this.container=i,s||(s=i.querySelector("[data-carousel-next]")),s||(s=this.addBtn(Y)),this.next=s,n||(n=i.querySelector("[data-carousel-prev]")),n||(n=this.addBtn(V)),this.prev=n}cleanup(){this.isDom||(this.prev&&this.prev.remove(),this.next&&this.next.remove(),this.container&&this.container.remove()),this.prev=null,this.next=null,this.container=null,this.isDom=!1}attach(){this.instance.on(["refresh","change"],this.onRefresh)}detach(){this.instance.off(["refresh","change"],this.onRefresh),this.cleanup()}}Object.defineProperty(Z,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{classes:{container:"f-carousel__nav",button:"f-button",isNext:"is-next",isPrev:"is-prev"},nextTpl:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M9 3l9 9-9 9"/></svg>
38',prevTpl:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M15 3l-9 9 9 9"/></svg>'}});class U extends ${constructor(){super(...arguments),Object.defineProperty(this,"selectedIndex",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"target",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"nav",{enumerable:!0,configurable:!0,writable:!0,value:null})}addAsTargetFor(t){this.target=this.instance,this.nav=t,this.attachEvents()}addAsNavFor(t){this.nav=this.instance,this.target=t,this.attachEvents()}attachEvents(){const{nav:t,target:e}=this;t&&e&&(t.options.initialSlide=e.options.initialPage,t.state===H.Ready?this.onNavReady(t):t.on("ready",this.onNavReady),e.state===H.Ready?this.onTargetReady(e):e.on("ready",this.onTargetReady))}onNavReady(t){t.on("createSlide",this.onNavCreateSlide),t.on("Panzoom.click",this.onNavClick),t.on("Panzoom.touchEnd",this.onNavTouch),this.onTargetChange()}onTargetReady(t){t.on("change",this.onTargetChange),t.on("Panzoom.refresh",this.onTargetChange),this.onTargetChange()}onNavClick(t,e,i){this.onNavTouch(t,t.panzoom,i)}onNavTouch(t,e,i){var n,s;if(Math.abs(e.dragOffset.x)>3||Math.abs(e.dragOffset.y)>3)return;const o=i.target,{nav:a,target:r}=this;if(!a||!r||!o)return;const l=o.closest("[data-index]");if(i.stopPropagation(),i.preventDefault(),!l)return;const c=parseInt(l.dataset.index||"",10)||0,h=r.getPageForSlide(c),d=a.getPageForSlide(c);a.slideTo(d),r.slideTo(h,{friction:(null===(s=null===(n=this.nav)||void 0===n?void 0:n.plugins)||void 0===s?void 0:s.Sync.option("friction"))||0}),this.markSelectedSlide(c)}onNavCreateSlide(t,e){e.index===this.selectedIndex&&this.markSelectedSlide(e.index)}onTargetChange(){var t,e;const{target:i,nav:n}=this;if(!i||!n)return;if(n.state!==H.Ready||i.state!==H.Ready)return;const s=null===(e=null===(t=i.pages[i.page])||void 0===t?void 0:t.slides[0])||void 0===e?void 0:e.index,o=n.getPageForSlide(s);this.markSelectedSlide(s),n.slideTo(o,null===n.prevPage&&null===i.prevPage?{friction:0}:void 0)}markSelectedSlide(t){const e=this.nav;e&&e.state===H.Ready&&(this.selectedIndex=t,[...e.slides].map((e=>{e.el&&e.el.classList[e.index===t?"add":"remove"]("is-nav-selected")})))}attach(){const t=this;let e=t.options.target,i=t.options.nav;e?t.addAsNavFor(e):i&&t.addAsTargetFor(i)}detach(){const t=this,e=t.nav,i=t.target;e&&(e.off("ready",t.onNavReady),e.off("createSlide",t.onNavCreateSlide),e.off("Panzoom.click",t.onNavClick),e.off("Panzoom.touchEnd",t.onNavTouch)),t.nav=null,i&&(i.off("ready",t.onTargetReady),i.off("refresh",t.onTargetChange),i.off("change",t.onTargetChange)),t.target=null}}Object.defineProperty(U,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{friction:.35}});const G={Navigation:Z,Dots:X,Sync:U},K="animationend",J="isSelected",Q="slide";class tt extends m{get axis(){return this.isHorizontal?"e":"f"}get isEnabled(){return this.state===H.Ready}get isInfinite(){let t=!1;const{contentDim:e,viewportDim:i,pages:n,slides:s}=this,o=s[0];return n.length>=2&&o&&e+o.dim>=i&&(t=this.option("infinite")),t}get isRTL(){return"rtl"===this.option("direction")}get isHorizontal(){return"x"===this.option("axis")}constructor(t,e={},i={}){if(super(),Object.defineProperty(this,"bp",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"lp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"userOptions",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"userPlugins",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:H.Init}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"prevPage",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"viewport",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"track",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"slides",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"pages",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"panzoom",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"inTransition",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"contentDim",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"viewportDim",{enumerable:!0,configurable:!0,writable:!0,value:0}),"string"==typeof t&&(t=document.querySelector(t)),!t||!S(t))throw new Error("No Element found");this.container=t,this.slideNext=F(this.slideNext.bind(this),150),this.slidePrev=F(this.slidePrev.bind(this),150),this.userOptions=e,this.userPlugins=i,queueMicrotask((()=>{this.processOptions()}))}processOptions(){var t,e;const i=p({},tt.defaults,this.userOptions);let n="";const s=i.breakpoints;if(s&&u(s))for(const[t,e]of Object.entries(s))window.matchMedia(t).matches&&u(e)&&(n+=t,p(i,e));n===this.bp&&this.state!==H.Init||(this.bp=n,this.state===H.Ready&&(i.initialSlide=(null===(e=null===(t=this.pages[this.page])||void 0===t?void 0:t.slides[0])||void 0===e?void 0:e.index)||0),this.state!==H.Init&&this.destroy(),super.setOptions(i),!1===this.option("enabled")?this.attachEvents():setTimeout((()=>{this.init()}),0))}
38init(){this.state=H.Init,this.emit("init"),this.attachPlugins(Object.assign(Object.assign({},tt.Plugins),this.userPlugins)),this.emit("attachPlugins"),this.initLayout(),this.initSlides(),this.updateMetrics(),this.setInitialPosition(),this.initPanzoom(),this.attachEvents(),this.state=H.Ready,this.emit("ready")}initLayout(){const{container:t}=this,e=this.option("classes");C(t,this.cn("container")),a(t,e.isLTR,!this.isRTL),a(t,e.isRTL,this.isRTL),a(t,e.isVertical,!this.isHorizontal),a(t,e.isHorizontal,this.isHorizontal);let i=this.option("viewport")||t.querySelector(`.${e.viewport}`);i||(i=document.createElement("div"),C(i,e.viewport),i.append(...j(t,`.${e.slide}`)),t.prepend(i)),i.addEventListener("scroll",this.onScroll);let n=this.option("track")||t.querySelector(`.${e.track}`);n||(n=document.createElement("div"),C(n,e.track),n.append(...Array.from(i.childNodes))),n.setAttribute("aria-live","polite"),i.contains(n)||i.prepend(n),this.viewport=i,this.track=n,this.emit("initLayout")}initSlides(){const{track:t}=this;if(!t)return;const e=[...this.slides],i=[];[...j(t,`.${this.cn(Q)}`)].forEach((t=>{if(S(t)){const e=N({el:t,isDom:!0,index:this.slides.length});i.push(e)}}));for(let t of[...this.option("slides",[])||[],...e])i.push(N(t));this.slides=i;for(let t=0;t<this.slides.length;t++)this.slides[t].index=t;
38for(const t of i)this.emit("beforeInitSlide",t,t.index),this.emit("initSlide",t,t.index);this.emit("initSlides")}setInitialPage(){const t=this.option("initialSlide");this.page="number"==typeof t?this.getPageForSlide(t):parseInt(this.option("initialPage",0)+"",10)||0}setInitialPosition(){const{track:t,pages:e,isHorizontal:i}=this;if(!t||!e.length)return;let n=this.page;e[n]||(this.page=n=0);const s=(e[n].pos||0)*(this.isRTL&&i?1:-1),o=i?`${s}px`:"0",a=i?"0":`${s}px`;t.style.transform=`translate3d(${o}, ${a}, 0) scale(1)`,this.option("adaptiveHeight")&&this.setViewportHeight()}initPanzoom(){this.panzoom&&(this.panzoom.destroy(),this.panzoom=null);const t=this.option("Panzoom")||{};this.panzoom=new D(this.viewport,p({},{content:this.track,zoom:!1,panOnlyZoomed:!1,lockAxis:this.isHorizontal?"x":"y",infinite:this.isInfinite,click:!1,dblClick:!1,touch:t=>!(this.pages.length<2&&!t.options.infinite),bounds:()=>this.getBounds(),maxVelocity:t=>Math.abs(t.target[this.axis]-t.current[this.axis])<2*this.viewportDim?100:0},t)),this.panzoom.on("*",((t,e,...i)=>{this.emit(`Panzoom.${e}`,t,...i)})),this.panzoom.on("decel",this.onDecel),this.panzoom.on("refresh",this.onRefresh),this.panzoom.on("beforeTransform",this.onBeforeTransform),this.panzoom.on("endAnimation",this.onEndAnimation)}attachEvents(){const t=this.container;t&&(t.addEventListener("click",this.onClick,{passive:!1,capture:!1}),t.addEventListener("slideTo",this.onSlideTo)),window.addEventListener("resize",this.onResize)}createPages(){let t=[];const{contentDim:e,viewportDim:i}=this;let n=this.option("slidesPerPage");n=("auto"===n||e<=i)&&!1!==this.option("fill")?1/0:parseFloat(n+"");let s=0,o=0,a=0;for(const e of this.slides)(!t.length||o+e.dim-i>.05||a>=n)&&(t.push(_()),s=t.length-1,o=0,a=0),t[s].slides.push(e),o+=e.dim+e.gap,a++;return t}processPages(){const t=this.pages,{contentDim:i,viewportDim:n,isInfinite:s}=this,o=this.option("center"),a=this.option("fill"),r=a&&o&&i>n&&!s;if(t.forEach(((t,e)=>{var s;t.index=e,t.pos=(null===(s=t.slides[0])||void 0===s?void 0:s.pos)||0,t.dim=0;for(const[e,i]of t.slides.entries())t.dim+=i.dim,e<t.slides.length-1&&(t.dim+=i.gap);r&&t.pos+.5*t.dim<.5*n?t.pos=0:r&&t.pos+.5*t.dim>=i-.5*n?t.pos=i-n:o&&(t.pos+=-.5*(n-t.dim))})),t.forEach((t=>{a&&!s&&i>n&&(t.pos=Math.max(t.pos,0),t.pos=Math.min(t.pos,i-n)),t.pos=e(t.pos,1e3),t.dim=e(t.dim,1e3),Math.abs(t.pos)<=.1&&(t.pos=0)})),s)return t;const l=[];let c;return t.forEach((t=>{const e=Object.assign({},t);c&&e.pos===c.pos?(c.dim+=e.dim,c.slides=[...c.slides,...e.slides]):(e.index=l.length,c=e,l.push(e))})),l}getPageFromIndex(t=0){const e=this.pages.length;let i;return t=parseInt((t||0).toString())||0,i=this.isInfinite?(t%e+e)%e:Math.max(Math.min(t,e-1),0),i}getSlideMetrics(t){var i,n;const s=this.isHorizontal?"width":"height";let o=0,a=0,r=t.el;const l=!(!r||r.parentNode);if(r?o=parseFloat(r.dataset[s]||"")||0:(r=document.createElement("div"),r.style.visibility="hidden",(this.track||document.body).prepend(r)),C(r,this.cn(Q)+" "+t.class+" "+t.customClass),o)r.style[s]=`${o}px`,r.style["width"===s?"height":"width"]="";else{l&&(this.track||document.body).prepend(r),o=r.getBoundingClientRect()[s]*Math.max(1,(null===(i=window.visualViewport)||void 0===i?void 0:i.scale)||1);let t=r[this.isHorizontal?"offsetWidth":"offsetHeight"];t-1>o&&(o=t)}const c=getComputedStyle(r);return"content-box"===c.boxSizing&&(this.isHorizontal?(o+=parseFloat(c.paddingLeft)||0,o+=parseFloat(c.paddingRight)||0):(o+=parseFloat(c.paddingTop)||0,o+=parseFloat(c.paddingBottom)||0)),a=parseFloat(c[this.isHorizontal?"marginRight":"marginBottom"])||0,l?null===(n=r.parentElement)||void 0===n||n.removeChild(r):t.el||r.remove(),{dim:e(o,1e3),gap:e(a,1e3)}}getBounds(){const{isInfinite:t,isRTL:e,isHorizontal:i,pages:n}=this;let s={min:0,max:0};if(t)s={min:-1/0,max:1/0};else if(n.length){const t=n[0].pos,o=n[n.length-1].pos;s=e&&i?{min:t,max:o}:{min:-1*o,max:-1*t}}return{x:i?s:{min:0,max:0},y:i?{min:0,max:0}:s}}repositionSlides(){let t,{isHorizontal:i,isRTL:n,isInfinite:s,viewport:o,viewportDim:a,contentDim:r,page:l,pages:c,slides:h,panzoom:d}=this,u=0,p=0,f=0,g=0;d?g=-1*d.current[this.axis]:c[l]&&(g=c[l].pos||0),t=i?n?"right":"left":"top",n&&i&&(g*=-1);for(const i of h){const n=i.el;n?("top"===t?(n.style.right="",n.style.left=""):n.style.top="",i.index!==u?n.style[t]=0===p?"":`${e(p,1e3)}px`:n.style[t]="",f+=i.dim+i.gap,u++):p+=i.dim+i.gap}if(s&&f&&o){let n=getComputedStyle(o),s="padding",l=i?"Right":"Bottom",c=parseFloat(n[s+(i?"Left":"Top")]);g-=c,a+=c,a+=parseFloat(n[s+l]);for(const i of h)i.el&&(e(i.pos)<e(a)&&e(i.pos+i.dim+i.gap)<e(g)&&e(g)>e(r-a)&&(i.el.style[t]=`${e(p+f,1e3)}px`),e(i.pos+i.gap)>=e(r-a)&&e(i.pos)>e(g+a)&&e(g)<e(a)&&(i.el.style[t]=`-${e(f,1e3)}px`))}let m,v,b=[...this.inTransition];if(b.length>1&&(m=c[b[0]],v=c[b[1]]),m&&v){let i=0;for(const n of h)n.el?this.inTransition.has(n.index)&&m.slides.indexOf(n)<0&&(n.el.style[t]=`${e(i+(m.pos-v.pos),1e3)}px`):i+=n.dim+n.gap}}createSlideEl(t){const{track:e,slides:i}=this;if(!e||!t)return;if(t.el&&t.el.parentNode)return;const n=t.el||document.createElement("div");
38C(n,this.cn(Q)),C(n,t.class),C(n,t.customClass);const s=t.html;s&&(s instanceof HTMLElement?n.appendChild(s):n.innerHTML=t.html+"");const o=[];i.forEach(((t,e)=>{t.el&&o.push(e)}));const a=t.index;let r=null;if(o.length){r=i[o.reduce(((t,e)=>Math.abs(e-a)<Math.abs(t-a)?e:t))]}const l=r&&r.el&&r.el.parentNode?r.index<t.index?r.el.nextSibling:r.el:null;e.insertBefore(n,e.contains(l)?l:null),t.el=n,this.emit("createSlide",t)}removeSlideEl(t,e=!1){const i=null==t?void 0:t.el;if(!i||!i.parentNode)return;const n=this.cn(J);if(i.classList.contains(n)&&(P(i,n),this.emit("unselectSlide",t)),t.isDom&&!e)return i.removeAttribute("aria-hidden"),i.removeAttribute("data-index"),void(i.style.left="");this.emit("removeSlide",t);const s=new CustomEvent(K);i.dispatchEvent(s),t.el&&(t.el.remove(),t.el=null)}transitionTo(t=0,e=this.option("transition")){var i,n,s,o;if(!e)return!1;const a=this.page,{pages:r,panzoom:l}=this;t=parseInt((t||0).toString())||0;const c=this.getPageFromIndex(t);if(!l||!r[c]||r.length<2||Math.abs(((null===(n=null===(i=r[a])||void 0===i?void 0:i.slides[0])||void 0===n?void 0:n.dim)||0)-this.viewportDim)>1)return!1;let h=t>a?1:-1;this.isInfinite&&(0===a&&t===r.length-1&&(h=-1),a===r.length-1&&0===t&&(h=1));const d=r[c].pos*(this.isRTL?1:-1);if(a===c&&Math.abs(d-l.target[this.axis])<1)return!1;this.clearTransitions();const u=l.isResting;C(this.container,this.cn("inTransition"));const p=(null===(s=r[a])||void 0===s?void 0:s.slides[0])||null,f=(null===(o=r[c])||void 0===o?void 0:o.slides[0])||null;this.inTransition.add(f.index),this.createSlideEl(f);let g=p.el,m=f.el;u||e===Q||(e="fadeFast",g=null);const v=this.isRTL?"next":"prev",b=this.isRTL?"prev":"next";return g&&(this.inTransition.add(p.index),p.transition=e,g.addEventListener(K,this.onAnimationEnd),g.classList.add(`f-${e}Out`,`to-${h>0?b:v}`)),m&&(f.transition=e,m.addEventListener(K,this.onAnimationEnd),m.classList.add(`f-${e}In`,`from-${h>0?v:b}`)),l.current[this.axis]=d,l.target[this.axis]=d,l.requestTick(),this.onChange(c),!0}manageSlideVisiblity(){const t=new Set,e=new Set,i=this.getVisibleSlides(parseFloat(this.option("preload",0)+"")||0);for(const n of this.slides)i.has(n)?t.add(n):e.add(n);for(const e of this.inTransition)t.add(this.slides[e]);for(const e of t)this.createSlideEl(e),this.lazyLoadSlide(e);for(const i of e)t.has(i)||this.removeSlideEl(i);this.markSelectedSlides(),this.repositionSlides()}markSelectedSlides(){if(!this.pages[this.page]||!this.pages[this.page].slides)return;const t="aria-hidden";let e=this.cn(J);if(e)for(const i of this.slides){const n=i.el;n&&(n.dataset.index=`${i.index}`,n.classList.contains("f-thumbs__slide")?this.getVisibleSlides(0).has(i)?n.removeAttribute(t):n.setAttribute(t,"true"):this.pages[this.page].slides.includes(i)?(n.classList.contains(e)||(C(n,e),this.emit("selectSlide",i)),n.removeAttribute(t)):(n.classList.contains(e)&&(P(n,e),this.emit("unselectSlide",i)),n.setAttribute(t,"true")))}}flipInfiniteTrack(){const{axis:t,isHorizontal:e,isInfinite:i,isRTL:n,viewportDim:s,contentDim:o}=this,a=this.panzoom;if(!a||!i)return;let r=a.current[t],l=a.target[t]-r,c=0,h=.5*s;n&&e?(r<-h&&(c=-1,r+=o),r>o-h&&(c=1,r-=o)):(r>h&&(c=1,r-=o),r<-o+h&&(c=-1,r+=o)),c&&(a.current[t]=r,a.target[t]=r+l)}lazyLoadImg(t,e){const i=this,n="f-fadeIn",o="is-preloading";let a=!1,r=null;const l=()=>{a||(a=!0,r&&(r.remove(),r=null),P(e,o),e.complete&&(C(e,n),setTimeout((()=>{P(e,n)}),350)),this.option("adaptiveHeight")&&t.el&&this.pages[this.page].slides.indexOf(t)>-1&&(i.updateMetrics(),i.setViewportHeight()),this.emit("load",t))};C(e,o),e.src=e.dataset.lazySrcset||e.dataset.lazySrc||"",delete e.dataset.lazySrc,delete e.dataset.lazySrcset,e.addEventListener("error",(()=>{l()})),e.addEventListener("load",(()=>{l()})),setTimeout((()=>{const i=e.parentNode;i&&t.el&&(e.complete?l():a||(r=s(E),i.insertBefore(r,e)))}),300)}lazyLoadSlide(t){const e=t&&t.el;if(!e)return;const i=new Set;let n=Array.from(e.querySelectorAll("[data-lazy-src],[data-lazy-srcset]"));e.dataset.lazySrc&&n.push(e),n.map((t=>{t instanceof HTMLImageElement?i.add(t):t instanceof HTMLElement&&t.dataset.lazySrc&&(t.style.backgroundImage=`url('${t.dataset.lazySrc}')`,delete t.dataset.lazySrc)}));for(const e of i)this.lazyLoadImg(t,e)}onAnimationEnd(t){var e;const i=t.target,n=i?parseInt(i.dataset.index||"",10)||0:-1,s=this.slides[n],o=t.animationName;if(!i||!s||!o)return;const a=!!this.inTransition.has(n)&&s.transition;a&&o.substring(0,a.length+2)===`f-${a}`&&this.inTransition.delete(n),this.inTransition.size||this.clearTransitions(),n===this.page&&(null===(e=this.panzoom)||void 0===e?void 0:e.isResting)&&this.emit
38("settle")}onDecel(t,e=0,i=0,n=0,s=0){if(this.option("dragFree"))return void this.setPageFromPosition();const{isRTL:o,isHorizontal:a,axis:r,pages:l}=this,c=l.length,h=Math.abs(Math.atan2(i,e)/(Math.PI/180));let d=0;if(d=h>45&&h<135?a?0:i:a?e:0,!c)return;let u=this.page,p=o&&a?1:-1;const f=t.current[r]*p;let{pageIndex:g}=this.getPageFromPosition(f);Math.abs(d)>5?(l[u].dim<document.documentElement["client"+(this.isHorizontal?"Width":"Height")]-1&&(u=g),u=o&&a?d<0?u-1:u+1:d<0?u+1:u-1):u=0===n&&0===s?u:g,this.slideTo(u,{transition:!1,friction:t.option("decelFriction")})}onClick(t){const e=t.target,i=e&&S(e)?e.dataset:null;let n,s;i&&(void 0!==i.carouselPage?(s="slideTo",n=i.carouselPage):void 0!==i.carouselNext?s="slideNext":void 0!==i.carouselPrev&&(s="slidePrev")),s?(t.preventDefault(),t.stopPropagation(),e&&!e.hasAttribute("disabled")&&this[s](n)):this.emit("click",t)}onSlideTo(t){const e=t.detail||0;this.slideTo(this.getPageForSlide(e),{friction:0})}onChange(t,e=0){const i=this.page;this.prevPage=i,this.page=t,this.option("adaptiveHeight")&&this.setViewportHeight(),t!==i&&(this.markSelectedSlides(),this.emit("change",t,i,e))}onRefresh(){let t=this.contentDim,e=this.viewportDim;this.updateMetrics(),this.contentDim===t&&this.viewportDim===e||this.slideTo(this.page,{friction:0,transition:!1})}onScroll(){var t;null===(t=this.viewport)||void 0===t||t.scroll(0,0)}onResize(){this.option("breakpoints")&&this.processOptions()}onBeforeTransform(t){this.lp!==t.current[this.axis]&&(this.flipInfiniteTrack(),this.manageSlideVisiblity()),this.lp=t.current.e}onEndAnimation(){this.inTransition.size||this.emit("settle")}reInit(t=null,e=null){this.destroy(),this.state=H.Init,this.prevPage=null,this.userOptions=t||this.userOptions,this.userPlugins=e||this.userPlugins,this.processOptions()}slideTo(t=0,{friction:e=this.option("friction"),transition:i=this.option("transition")}={}){if(this.state===H.Destroy)return;t=parseInt((t||0).toString())||0;const n=this.getPageFromIndex(t),{axis:s,isHorizontal:o,isRTL:a,pages:r,panzoom:l}=this,c=r.length,h=a&&o?1:-1;if(!l||!c)return;if(this.page!==n){const e=new Event("beforeChange",{bubbles:!0,cancelable:!0});if(this.emit("beforeChange",e,t),e.defaultPrevented)return}if(this.transitionTo(t,i))return;let d=r[n].pos;if(this.isInfinite){const e=this.contentDim,i=l.target[s]*h;if(2===c)d+=e*Math.floor(parseFloat(t+"")/2);else{d=[d,d-e,d+e].reduce((function(t,e){return Math.abs(e-i)<Math.abs(t-i)?e:t}))}}d*=h,Math.abs(l.target[s]-d)<1||(l.panTo({x:o?d:0,y:o?0:d,friction:e}),this.onChange(n))}slideToClosest(t){if(this.panzoom){const{pageIndex:e}=this.getPageFromPosition();this.slideTo(e,t)}}slideNext(){this.slideTo(this.page+1)}slidePrev(){this.slideTo(this.page-1)}clearTransitions(){this.inTransition.clear(),P(this.container,this.cn("inTransition"));const t=["to-prev","to-next","from-prev","from-next"];for(const e of this.slides){const i=e.el;if(i){i.removeEventListener(K,this.onAnimationEnd),i.classList.remove(...t);const n=e.transition;n&&i.classList.remove(`f-${n}Out`,`f-${n}In`)}}this.manageSlideVisiblity()}addSlide(t,e){var i,n,s,o;const a=this.panzoom,r=(null===(i=this.pages[this.page])||void 0===i?void 0:i.pos)||0,l=(null===(n=this.pages[this.page])||void 0===n?void 0:n.dim)||0,c=this.contentDim<this.viewportDim;let h=Array.isArray(e)?e:[e];const d=[];for(const t of h)d.push(N(t));this.slides.splice(t,0,...d);for(let t=0;t<this.slides.length;t++)this.slides[t].index=t;for(const t of d)this.emit("beforeInitSlide",t,t.index);if(this.page>=t&&(this.page+=d.length),this.updateMetrics(),a){const e=(null===(s=this.pages[this.page])||void 0===s?void 0:s.pos)||0,i=(null===(o=this.pages[this.page])||void 0===o?void 0:o.dim)||0,n=this.pages.length||1,h=this.isRTL?l-i:i-l,d=this.isRTL?r-e:e-r;c&&1===n?(t<=this.page&&(a.current[this.axis]-=h,a.target[this.axis]-=h),a.panTo({[this.isHorizontal?"x":"y"]:-1*e})):d&&t<=this.page&&(a.target[this.axis]-=d,a.current[this.axis]-=d,a.requestTick())}for(const t of d)this.emit("initSlide",t,t.index)}prependSlide(t){this.addSlide(0,t)}appendSlide(t){this.addSlide(this.slides.length,t)}removeSlide(t){const e=this.slides.length;t=(t%e+e)%e;const i=this.slides[t];
38if(i){this.removeSlideEl(i,!0),this.slides.splice(t,1);for(let t=0;t<this.slides.length;t++)this.slides[t].index=t;this.updateMetrics(),this.slideTo(this.page,{friction:0,transition:!1}),this.emit("destroySlide",i)}}updateMetrics(){const{panzoom:t,viewport:i,track:n,slides:s,isHorizontal:o,isInfinite:a}=this;if(!n)return;const r=o?"width":"height",l=o?"offsetWidth":"offsetHeight";if(i){let t=Math.max(i[l],e(i.getBoundingClientRect()[r],1e3)),n=getComputedStyle(i),s="padding",a=o?"Right":"Bottom";t-=parseFloat(n[s+(o?"Left":"Top")])+parseFloat(n[s+a]),this.viewportDim=t}let c,h=0;for(const[t,i]of s.entries()){let n=0,o=0;!i.el&&c?(n=c.dim,o=c.gap):(({dim:n,gap:o}=this.getSlideMetrics(i)),c=i),n=e(n,1e3),o=e(o,1e3),i.dim=n,i.gap=o,i.pos=h,h+=n,(a||t<s.length-1)&&(h+=o)}h=e(h,1e3),this.contentDim=h,t&&(t.contentRect[r]=h,t.contentRect[o?"fullWidth":"fullHeight"]=h),this.pages=this.createPages(),this.pages=this.processPages(),this.state===H.Init&&this.setInitialPage(),this.page=Math.max(0,Math.min(this.page,this.pages.length-1)),this.manageSlideVisiblity(),this.emit("refresh")}getProgress(t,i=!1,n=!1){void 0===t&&(t=this.page);const s=this,o=s.panzoom,a=s.contentDim,r=s.pages[t]||0;if(!r||!o)return t>this.page?-1:1;let l=-1*o.current.e,c=e((l-r.pos)/(1*r.dim),1e3),h=c,d=c;this.isInfinite&&!0!==n&&(h=e((l-r.pos+a)/(1*r.dim),1e3),d=e((l-r.pos-a)/(1*r.dim),1e3));let u=[c,h,d].reduce((function(t,e){return Math.abs(e)<Math.abs(t)?e:t}));return i?u:u>1?1:u<-1?-1:u}setViewportHeight(){const{page:t,pages:e,viewport:i,isHorizontal:n}=this;if(!i||!e[t])return;let s=0;n&&this.track&&(this.track.style.height="auto",e[t].slides.forEach((t=>{t.el&&(s=Math.max(s,t.el.offsetHeight))}))),i.style.height=s?`${s}px`:""}getPageForSlide(t){for(const e of this.pages)for(const i of e.slides)if(i.index===t)return e.index;return-1}getVisibleSlides(t=0){var e;const i=new Set;let{panzoom:n,contentDim:s,viewportDim:o,pages:a,page:r}=this;if(o){s=s+(null===(e=this.slides[this.slides.length-1])||void 0===e?void 0:e.gap)||0;let l=0;l=n&&n.state!==v.Init&&n.state!==v.Destroy?-1*n.current[this.axis]:a[r]&&a[r].pos||0,this.isInfinite&&(l-=Math.floor(l/s)*s),this.isRTL&&this.isHorizontal&&(l*=-1);const c=l-o*t,h=l+o*(t+1),d=this.isInfinite?[-1,0,1]:[0];for(const t of this.slides)for(const e of d){const n=t.pos+e*s,o=n+t.dim+t.gap;n<h&&o>c&&i.add(t)}}return i}getPageFromPosition(t){const{viewportDim:e,contentDim:i,slides:n,pages:s,panzoom:o}=this,a=s.length,r=n.length,l=n[0],c=n[r-1],h=this.option("center");let d=0,u=0,p=0,f=void 0===t?-1*((null==o?void 0:o.target[this.axis])||0):t;h&&(f+=.5*e),this.isInfinite?(f<l.pos-.5*c.gap&&(f-=i,p=-1),f>c.pos+c.dim+.5*c.gap&&(f-=i,p=1)):f=Math.max(l.pos||0,Math.min(f,c.pos));let g=c,m=n.find((t=>{const e=t.pos-.5*g.gap,i=t.pos+t.dim+.5*t.gap;return g=t,f>=e&&f<i}));return m||(m=c),u=this.getPageForSlide(m.index),d=u+p*a,{page:d,pageIndex:u}}setPageFromPosition(){const{pageIndex:t}=this.getPageFromPosition();this.onChange(t)}destroy(){if([H.Destroy].includes(this.state))return;this.state=H.Destroy;const{container:t,viewport:e,track:i,slides:n,panzoom:s}=this,o=this.option("classes");t.removeEventListener("click",this.onClick,{passive:!1,capture:!1}),t.removeEventListener("slideTo",this.onSlideTo),window.removeEventListener("resize",this.onResize),s&&(s.destroy(),this.panzoom=null),n&&n.forEach((t=>{this.removeSlideEl(t)})),this.detachPlugins(),e&&(e.removeEventListener("scroll",this.onScroll),e.offsetParent&&i&&i.offsetParent&&e.replaceWith(...i.childNodes));for(const[e,i]of Object.entries(o))"container"!==e&&i&&t.classList.remove(i);this.track=null,this.viewport=null,this.page=0,this.slides=[];const a=this.events.get("ready");this.events=new Map,a&&this.events.set("ready",a)}}Object.defineProperty(tt,"Panzoom",{enumerable:!0,configurable:!0,writable:!0,value:D}),Object.defineProperty(tt,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:B}),Object.defineProperty(tt,"Plugins",{enumerable:!0,configurable:!0,writable:!0,value:G});const et=function(t){if(!S(t))return 0;const e=window.scrollY,i=window.innerHeight,n=e+i,s=t.getBoundingClientRect(),o=s.y+e,a=s.height,r=o+a;if(e>r||n<o)return 0;if(e<o&&n>r)return 100;if(o<e&&r>n)return 100;let l=a;o<e&&(l-=e-o),r>n&&(l-=r-n);const c=l/i*100;return Math.round(c)},it=!("undefined"==typeof window||!window.document||!window.document.createElement);let nt;const st=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden]):not(.fancybox-focus-guard)","iframe","object","embed","video","audio","[contenteditable]",'[tabindex]:not
38([tabindex^="-"]):not([disabled]):not([aria-hidden])'].join(","),ot=t=>{if(t&&it){void 0===nt&&document.createElement("div").focus({get preventScroll(){return nt=!0,!1}});try{if(nt)t.focus({preventScroll:!0});else{const e=window.scrollY||document.body.scrollTop,i=window.scrollX||document.body.scrollLeft;t.focus(),document.body.scrollTo({top:e,left:i,behavior:"auto"})}}catch(t){}}},at=()=>{const t=document;let e,i="",n="",s="";return t.fullscreenEnabled?(i="requestFullscreen",n="exitFullscreen",s="fullscreenElement"):t.webkitFullscreenEnabled&&(i="webkitRequestFullscreen",n="webkitExitFullscreen",s="webkitFullscreenElement"),i&&(e={request:function(e=t.documentElement){return"webkitRequestFullscreen"===i?e[i](Element.ALLOW_KEYBOARD_INPUT):e[i]()},exit:function(){return t[s]&&t[n]()},isFullscreen:function(){return t[s]}}),e},rt={animated:!0,autoFocus:!0,backdropClick:"close",Carousel:{classes:{container:"fancybox__carousel",viewport:"fancybox__viewport",track:"fancybox__track",slide:"fancybox__slide"}},closeButton:"auto",closeExisting:!1,commonCaption:!1,compact:()=>window.matchMedia("(max-width: 578px), (max-height: 578px)").matches,contentClick:"toggleZoom",contentDblClick:!1,defaultType:"image",defaultDisplay:"flex",dragToClose:!0,Fullscreen:{autoStart:!1},groupAll:!1,groupAttr:"data-fancybox",hideClass:"f-fadeOut",hideScrollbar:!0,idle:3500,keyboard:{Escape:"close",Delete:"close",Backspace:"close",PageUp:"next",PageDown:"prev",ArrowUp:"prev",ArrowDown:"next",ArrowRight:"next",ArrowLeft:"prev"},l10n:Object.assign(Object.assign({},y),{CLOSE:"Close",NEXT:"Next",PREV:"Previous",MODAL:"You can close this modal content with the ESC key",ERROR:"Something Went Wrong, Please Try Again Later",IMAGE_ERROR:"Image Not Found",ELEMENT_NOT_FOUND:"HTML Element Not Found",AJAX_NOT_FOUND:"Error Loading AJAX : Not Found",AJAX_FORBIDDEN:"Error Loading AJAX : Forbidden",IFRAME_ERROR:"Error Loading Page",TOGGLE_ZOOM:"Toggle zoom level",TOGGLE_THUMBS:"Toggle thumbnails",TOGGLE_SLIDESHOW:"Toggle slideshow",TOGGLE_FULLSCREEN:"Toggle full-screen mode",DOWNLOAD:"Download"}),parentEl:null,placeFocusBack:!0,showClass:"f-zoomInUp",startIndex:0,tpl:{closeButton:'<button data-fancybox-close class="f-button is-close-btn" title="{{CLOSE}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M20 20L4 4m16 0L4 20"/></svg></button>',main:'<div class="fancybox__container" role="dialog" aria-modal="true" aria-label="{{MODAL}}" tabindex="-1">\n    <div class="fancybox__backdrop"></div>\n    <div class="fancybox__carousel"></div>\n    <div class="fancybox__footer"></div>\n  </div>'},trapFocus:!0,wheel:"zoom"};var lt,ct;!function(t){t[t.Init=0]="Init",t[t.Ready=1]="Ready",t[t.Closing=2]="Closing",t[t.CustomClosing=3]="CustomClosing",t[t.Destroy=4]="Destroy"}(lt||(lt={})),function(t){t[t.Loading=0]="Loading",t[t.Opening=1]="Opening",t[t.Ready=2]="Ready",t[t.Closing=3]="Closing"}(ct||(ct={}));let ht="",dt=!1,ut=!1,pt=null;const ft=()=>{let t="",e="";const i=Ae.getInstance();if(i){const n=i.carousel,s=i.getSlide();if(n&&s){let o=s.slug||void 0,a=s.triggerEl||void 0;e=o||(i.option("slug")||""),!e&&a&&a.dataset&&(e=a.dataset.fancybox||""),e&&"true"!==e&&(t="#"+e+(!o&&n.slides.length>1?"-"+(s.index+1):""))}}return{hash:t,slug:e,index:1}},gt=()=>{const t=new URL(document.URL).hash,e=t.slice(1).split("-"),i=e[e.length-1],n=i&&/^\+?\d+$/.test(i)&&parseInt(e.pop()||"1",10)||1;return{hash:t,slug:e.join("-"),index:n}},mt=()=>{const{slug:t,index:e}=gt();if(!t)return;let i=document.querySelector(`[data-slug="${t}"]`);if(i&&i.dispatchEvent(new CustomEvent("click",{bubbles:!0,cancelable:!0})),Ae.getInstance())return;const n=document.querySelectorAll(`[data-fancybox="${t}"]`);n.length&&(i=n[e-1],i&&i.dispatchEvent(new CustomEvent("click",{bubbles:!0,cancelable:!0})))},vt=()=>{if(!1===Ae.defaults.Hash)return;const t=Ae.getInstance();if(!1===(null==t?void 0:t.options.Hash))return;const{slug:e,index:i}=gt(),{slug:n}=ft();t&&(e===n?t.jumpTo(i-1):(dt=!0,t.close())),mt()},bt=()=>{pt&&clearTimeout(pt),queueMicrotask((()=>{vt()}))},yt=()=>{window.addEventListener("hashchange",bt,!1),setTimeout((()=>{vt()}),500)};it&&(/complete|interactive|loaded/.test(document.readyState)?yt():document.addEventListener("DOMContentLoaded",yt));const wt="is-zooming-in";class xt extends ${onCreateSlide(t,e,i){const n=this.instance.optionFor(i,"src")||"";i.el&&"image"===i.type&&"string"==typeof n&&this.setImage(i,n)}onRemoveSlide(t,e,i){i.panzoom&&i.panzoom.destroy(),i.panzoom=void 0,i.imageEl=void 0}onChange(t,e,i,n){P(this.instance.container,wt);for(const t of e.slides){const e=t.panzoom;e&&t.index!==i&&e.reset(.35)}}onClose(){var t;const e=this.instance,i=e.container,n=e.getSlide();if(!i||!i.parentElement||!n)return;const{el:s,contentEl:o,panzoom:a,thumbElSrc:r}=n;if(!s||!r||!o||!a||a.isContentLoading||a.state===v.Init||a.state===v.Destroy)return;a.updateMetrics();let l=this.getZoomInfo(n);if(!l)return;this.instance.state=lt.CustomClosing,i.classList.remove(wt),i.classList.add("is-zooming-out"),o.style.backgroundImage=`url('${r}')`;const c=i.getBoundingClientRect();
381===((null===(t=window.visualViewport)||void 0===t?void 0:t.scale)||1)&&Object.assign(i.style,{position:"absolute",top:`${i.offsetTop+window.scrollY}px`,left:`${i.offsetLeft+window.scrollX}px`,bottom:"auto",right:"auto",width:`${c.width}px`,height:`${c.height}px`,overflow:"hidden"});const{x:h,y:d,scale:u,opacity:p}=l;if(p){const t=((t,e,i,n)=>{const s=e-t,o=n-i;return e=>i+((e-t)/s*o||0)})(a.scale,u,1,0);a.on("afterTransform",(()=>{o.style.opacity=t(a.scale)+""}))}a.on("endAnimation",(()=>{e.destroy()})),a.target.a=u,a.target.b=0,a.target.c=0,a.target.d=u,a.panTo({x:h,y:d,scale:u,friction:p?.2:.33,ignoreBounds:!0}),a.isResting&&e.destroy()}setImage(t,e){const i=this.instance;t.src=e,this.process(t,e).then((e=>{const{contentEl:n,imageEl:s,thumbElSrc:o,el:a}=t;if(i.isClosing()||!n||!s)return;n.offsetHeight;const r=!!i.isOpeningSlide(t)&&this.getZoomInfo(t);if(this.option("protected")&&a){a.addEventListener("contextmenu",(t=>{t.preventDefault()}));const t=document.createElement("div");C(t,"fancybox-protected"),n.appendChild(t)}if(o&&r){const s=e.contentRect,a=Math.max(s.fullWidth,s.fullHeight);let c=null;!r.opacity&&a>1200&&(c=document.createElement("img"),C(c,"fancybox-ghost"),c.src=o,n.appendChild(c));const h=()=>{c&&(C(c,"f-fadeFastOut"),setTimeout((()=>{c&&(c.remove(),c=null)}),200))};(l=o,new Promise(((t,e)=>{const i=new Image;i.onload=t,i.onerror=e,i.src=l}))).then((()=>{i.hideLoading(t),t.state=ct.Opening,this.instance.emit("reveal",t),this.zoomIn(t).then((()=>{h(),this.instance.done(t)}),(()=>{})),c&&setTimeout((()=>{h()}),a>2500?800:200)}),(()=>{i.hideLoading(t),i.revealContent(t)}))}else{const n=this.optionFor(t,"initialSize"),s=this.optionFor(t,"zoom"),o={event:i.prevMouseMoveEvent||i.options.event,friction:s?.12:0};let a=i.optionFor(t,"showClass")||void 0,r=!0;i.isOpeningSlide(t)&&("full"===n?e.zoomToFull(o):"cover"===n?e.zoomToCover(o):"max"===n?e.zoomToMax(o):r=!1,e.stop("current")),r&&a&&(a=e.isDragging?"f-fadeIn":""),i.hideLoading(t),i.revealContent(t,a)}var l}),(()=>{i.setError(t,"{{IMAGE_ERROR}}")}))}process(t,e){return new Promise(((i,n)=>{var o;const a=this.instance,r=t.el;a.clearContent(t),a.showLoading(t);let l=this.optionFor(t,"content");if("string"==typeof l&&(l=s(l)),!l||!S(l)){if(l=document.createElement("img"),l instanceof HTMLImageElement){let i="",n=t.caption;i="string"==typeof n&&n?n.replace(/<[^>]+>/gi,"").substring(0,1e3):`Image ${t.index+1} of ${(null===(o=a.carousel)||void 0===o?void 0:o.pages.length)||1}`,l.src=e||"",l.alt=i,l.draggable=!1,t.srcset&&l.setAttribute("srcset",t.srcset),this.instance.isOpeningSlide(t)&&(l.fetchPriority="high")}t.sizes&&l.setAttribute("sizes",t.sizes)}C(l,"fancybox-image"),t.imageEl=l,a.setContent(t,l,!1);t.panzoom=new D(r,p({transformParent:!0},this.option("Panzoom")||{},{content:l,width:(e,i)=>a.optionFor(t,"width","auto",i)||"auto",height:(e,i)=>a.optionFor(t,"height","auto",i)||"auto",wheel:()=>{const t=a.option("wheel");return("zoom"===t||"pan"==t)&&t},click:(e,i)=>{var n,s;if(a.isCompact||a.isClosing())return!1;if(t.index!==(null===(n=a.getSlide())||void 0===n?void 0:n.index))return!1;if(i){const t=i.composedPath()[0];if(["A","BUTTON","TEXTAREA","OPTION","INPUT","SELECT","VIDEO"].includes(t.nodeName))return!1}let o=!i||i.target&&(null===(s=t.contentEl)||void 0===s?void 0:s.contains(i.target));return a.option(o?"contentClick":"backdropClick")||!1},dblClick:()=>a.isCompact?"toggleZoom":a.option("contentDblClick")||!1,spinner:!1,panOnlyZoomed:!0,wheelLimit:1/0,on:{ready:t=>{i(t)},error:()=>{n()},destroy:()=>{n()}}}))}))}zoomIn(t){return new Promise(((e,i)=>{const n=this.instance,s=n.container,{panzoom:o,contentEl:a,el:r}=t;o&&o.updateMetrics();const l=this.getZoomInfo(t);if(!(l&&r&&a&&o&&s))return void i();const{x:c,y:h,scale:d,opacity:u}=l,p=()=>{t.state!==ct.Closing&&(u&&(a.style.opacity=Math.max(Math.min(1,1-(1-o.scale)/(1-d)),0)+""),o.scale>=1&&o.scale>o.targetScale-.1&&e(o))},f=t=>{(t.scale<.99||t.scale>1.01)&&!t.isDragging||(P(s,wt),a.style.opacity="",t.off("endAnimation",f),t.off("touchStart",f),t.off("afterTransform",p),e(t))};o.on("endAnimation",f),o.on("touchStart",f),o.on("afterTransform",p),o.on(["error","destroy"],(()=>{i()})),o.panTo({x:c,y:h,scale:d,friction:0,ignoreBounds:!0}),o.stop("current");
38const g={event:"mousemove"===o.panMode?n.prevMouseMoveEvent||n.options.event:void 0},m=this.optionFor(t,"initialSize");C(s,wt),n.hideLoading(t),"full"===m?o.zoomToFull(g):"cover"===m?o.zoomToCover(g):"max"===m?o.zoomToMax(g):o.reset(.172)}))}getZoomInfo(t){const{el:e,imageEl:i,thumbEl:n,panzoom:s}=t,o=this.instance,a=o.container;if(!e||!i||!n||!s||et(n)<3||!this.optionFor(t,"zoom")||!a||o.state===lt.Destroy)return!1;if("0"===getComputedStyle(a).getPropertyValue("--f-images-zoom"))return!1;const r=window.visualViewport||null;if(1!==(r?r.scale:1))return!1;let{top:l,left:c,width:h,height:d}=n.getBoundingClientRect(),{top:u,left:p,fitWidth:f,fitHeight:g}=s.contentRect;if(!(h&&d&&f&&g))return!1;const m=s.container.getBoundingClientRect();p+=m.left,u+=m.top;const v=-1*(p+.5*f-(c+.5*h)),b=-1*(u+.5*g-(l+.5*d)),y=h/f;let w=this.option("zoomOpacity")||!1;return"auto"===w&&(w=Math.abs(h/d-f/g)>.1),{x:v,y:b,scale:y,opacity:w}}attach(){const t=this,e=t.instance;e.on("Carousel.change",t.onChange),e.on("Carousel.createSlide",t.onCreateSlide),e.on("Carousel.removeSlide",t.onRemoveSlide),e.on("close",t.onClose)}detach(){const t=this,e=t.instance;e.off("Carousel.change",t.onChange),e.off("Carousel.createSlide",t.onCreateSlide),e.off("Carousel.removeSlide",t.onRemoveSlide),e.off("close",t.onClose)}}Object.defineProperty(xt,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{initialSize:"fit",Panzoom:{maxScale:1},protected:!1,zoom:!0,zoomOpacity:"auto"}}),"function"==typeof SuppressedError&&SuppressedError;const Et="html",St="image",Pt="map",Ct="youtube",Tt="vimeo",Mt="html5video",Ot=(t,e={})=>{const i=new URL(t),n=new URLSearchParams(i.search),s=new URLSearchParams;for(const[t,i]of[...n,...Object.entries(e)]){let e=i+"";if("t"===t){let t=e.match(/((\d*)m)?(\d*)s?/);t&&s.set("start",60*parseInt(t[2]||"0")+parseInt(t[3]||"0")+"")}else s.set(t,e)}let o=s+"",a=t.match(/#t=((.*)?\d+s)/);return a&&(o+=`#t=${a[1]}`),o},At={ajax:null,autoSize:!0,iframeAttr:{allow:"autoplay; fullscreen",scrolling:"auto"},preload:!0,videoAutoplay:!0,videoRatio:16/9,videoTpl:'<video class="fancybox__html5video" playsinline controls controlsList="nodownload" poster="{{poster}}">\n  <source src="{{src}}" type="{{format}}" />Sorry, your browser doesn\'t support embedded videos.</video>',videoFormat:"",vimeo:{byline:1,color:"00adef",controls:1,dnt:1,muted:0},youtube:{controls:1,enablejsapi:1,nocookie:1,rel:0,fs:1}},Lt=["image","html","ajax","inline","clone","iframe","map","pdf","html5video","youtube","vimeo"];class zt extends ${onBeforeInitSlide(t,e,i){this.processType(i)}onCreateSlide(t,e,i){this.setContent(i)}onClearContent(t,e){e.xhr&&(e.xhr.abort(),e.xhr=null);const i=e.iframeEl;i&&(i.onload=i.onerror=null,i.src="//about:blank",e.iframeEl=null);const n=e.contentEl,s=e.placeholderEl;if("inline"===e.type&&n&&s)n.classList.remove("fancybox__content"),"none"!==getComputedStyle(n).getPropertyValue("display")&&(n.style.display="none"),setTimeout((()=>{s&&(n&&s.parentNode&&s.parentNode.insertBefore(n,s),s.remove())}),0),e.contentEl=void 0,e.placeholderEl=void 0;else for(;e.el&&e.el.firstChild;)e.el.removeChild(e.el.firstChild)}onSelectSlide(t,e,i){i.state===ct.Ready&&this.playVideo()}onUnselectSlide(t,e,i){var n,s;if(i.type===Mt){try{null===(s=null===(n=i.el)||void 0===n?void 0:n.querySelector("video"))||void 0===s||s.pause()}catch(t){}return}let o;i.type===Tt?o={method:"pause",value:"true"}:i.type===Ct&&(o={event:"command",func:"pauseVideo"}),o&&i.iframeEl&&i.iframeEl.contentWindow&&i.iframeEl.contentWindow.postMessage(JSON.stringify(o),"*"),i.poller&&clearTimeout(i.poller)}onDone(t,e){t.isCurrentSlide(e)&&!t.isClosing()&&this.playVideo()}onRefresh(t,e){e.slides.forEach((t=>{t.el&&(this.resizeIframe(t),this.setAspectRatio(t))}))}onMessage(t){try{let e=JSON.parse(t.data);if("https://player.vimeo.com"===t.origin){if("ready"===e.event)for(let e of Array.from(document.getElementsByClassName("fancybox__iframe")))e instanceof HTMLIFrameElement&&e.contentWindow===t.source&&(e.dataset.ready="true")}else if(t.origin.match(/^https:\/\/(www.)?youtube(-nocookie)?.com$/)&&"onReady"===e.event){const t=document.getElementById(e.id);t&&(t.dataset.ready="true")}}catch(t){}}loadAjaxContent(t){const e=this.instance.optionFor(t,"src")||"";this.instance.showLoading(t);const i=this.instance,n=new XMLHttpRequest;i.showLoading(t),n.onreadystatechange=function(){n.readyState===XMLHttpRequest.DONE&&i.state===lt.Ready&&(i.hideLoading(t),200===n.status?i.setContent(t,n.responseText):i.setError(t,404===n.status?"{{AJAX_NOT_FOUND}}":"{{AJAX_FORBIDDEN}}"))};const s=t.ajax||null;n.open(s?"POST":"GET",e+""),n.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.send(s),t.xhr=n}setInlineContent(t){let e=null;if(S(t.src))e=t.src;else if("string"==typeof t.src){const i=t.src.split("#",2).pop();e=i?document.getElementById(i):null}if(e){if("clone"===t.type||e.closest(".fancybox__slide")){e=e.cloneNode(!0);const i=e.dataset.animationName;i&&(e.classList.remove(i),delete e.dataset.animationName);let n=e.getAttribute("id");n=n?`${n}--clone`:`clone-${this.instance.id}-${t.index}`,e.setAttribute("id",n)}else if(e.parentNode){const i=document.createElement("div");i.classList.add("fancybox-placeholder"),e.parentNode.insertBefore(i,e),t.placeholderEl=i}this.instance.setContent(t,e)}else this.instance.setError(t,"{{ELEMENT_NOT_FOUND}}")}setIframeContent(t){const{src:e,el:i}=t;if(!e||"string"!=typeof e||!i)return;i.classList.add("is-loading");const n=this.instance,s=document.createElement("iframe");s.className="fancybox__iframe",s.setAttribute("id",`fancybox__iframe_${n.id}_${t.index}`);for(const[e,i]of Object.entries(this.optionFor(t,"iframeAttr")||{}))s.setAttribute(e,i);s.onerror=()=>{n.setError(t,"{{IFRAME_ERROR}}")},t.iframeEl=s;const o=this.optionFor(t,"preload");if("iframe"!==t.type||!1===o)return s.setAttribute("src",t.src+""),n.setContent(t,s,!1),this.resizeIframe(t),void n.revealContent(t);n.showLoading(t),s.onload=()=>
38{if(!s.src.length)return;const e="true"!==s.dataset.ready;s.dataset.ready="true",this.resizeIframe(t),e?n.revealContent(t):n.hideLoading(t)},s.setAttribute("src",e),n.setContent(t,s,!1)}resizeIframe(t){const{type:e,iframeEl:i}=t;if(e===Ct||e===Tt)return;const n=null==i?void 0:i.parentElement;if(!i||!n)return;let s=t.autoSize;void 0===s&&(s=this.optionFor(t,"autoSize"));let o=t.width||0,a=t.height||0;o&&a&&(s=!1);const r=n&&n.style;if(!1!==t.preload&&!1!==s&&r)try{const t=window.getComputedStyle(n),e=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight),s=parseFloat(t.paddingTop)+parseFloat(t.paddingBottom),l=i.contentWindow;if(l){const t=l.document,i=t.getElementsByTagName(Et)[0],n=t.body;r.width="",n.style.overflow="hidden",o=o||i.scrollWidth+e,r.width=`${o}px`,n.style.overflow="",r.flex="0 0 auto",r.height=`${n.scrollHeight}px`,a=i.scrollHeight+s}}catch(t){}if(o||a){const t={flex:"0 1 auto",width:"",height:""};o&&"auto"!==o&&(t.width=`${o}px`),a&&"auto"!==a&&(t.height=`${a}px`),Object.assign(r,t)}}playVideo(){const t=this.instance.getSlide();if(!t)return;const{el:e}=t;if(!e||!e.offsetParent)return;if(!this.optionFor(t,"videoAutoplay"))return;if(t.type===Mt)try{const t=e.querySelector("video");if(t){const e=t.play();void 0!==e&&e.then((()=>{})).catch((e=>{t.muted=!0,t.play()}))}}catch(t){}if(t.type!==Ct&&t.type!==Tt)return;const i=()=>{if(t.iframeEl&&t.iframeEl.contentWindow){let e;if("true"===t.iframeEl.dataset.ready)return e=t.type===Ct?{event:"command",func:"playVideo"}:{method:"play",value:"true"},e&&t.iframeEl.contentWindow.postMessage(JSON.stringify(e),"*"),void(t.poller=void 0);t.type===Ct&&(e={event:"listening",id:t.iframeEl.getAttribute("id")},t.iframeEl.contentWindow.postMessage(JSON.stringify(e),"*"))}t.poller=setTimeout(i,250)};i()}processType(t){if(t.html)return t.type=Et,t.src=t.html,void(t.html="");const e=this.instance.optionFor(t,"src","");if(!e||"string"!=typeof e)return;let i=t.type,n=null;if(n=e.match(/(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(?:watch\?(?:.*&)?v=|v\/|u\/|shorts\/|embed\/?)?(videoseries\?list=(?:.*)|[\w-]{11}|\?listType=(?:.*)&list=(?:.*))(?:.*)/i)){const s=this.optionFor(t,Ct),{nocookie:o}=s,a=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i}(s,["nocookie"]),r=`www.youtube${o?"-nocookie":""}.com`,l=Ot(e,a),c=encodeURIComponent(n[2]);t.videoId=c,t.src=`https://${r}/embed/${c}?${l}`,t.thumbSrc=t.thumbSrc||`https://i.ytimg.com/vi/${c}/mqdefault.jpg`,i=Ct}else if(n=e.match(/^.+vimeo.com\/(?:\/)?([\d]+)((\/|\?h=)([a-z0-9]+))?(.*)?/)){const s=Ot(e,this.optionFor(t,Tt)),o=encodeURIComponent(n[1]),a=n[4]||"";t.videoId=o,t.src=`https://player.vimeo.com/video/${o}?${a?`h=${a}${s?"&":""}`:""}${s}`,i=Tt}if(!i&&t.triggerEl){const e=t.triggerEl.dataset.type;Lt.includes(e)&&(i=e)}i||"string"==typeof e&&("#"===e.charAt(0)?i="inline":(n=e.match(/\.(mp4|mov|ogv|webm)((\?|#).*)?$/i))?(i=Mt,t.videoFormat=t.videoFormat||"video/"+("ogv"===n[1]?"ogg":n[1])):e.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)?i=St:e.match(/\.(pdf)((\?|#).*)?$/i)&&(i="pdf")),(n=e.match(/(?:maps\.)?google\.([a-z]{2,3}(?:\.[a-z]{2})?)\/(?:(?:(?:maps\/(?:place\/(?:.*)\/)?\@(.*),(\d+.?\d+?)z))|(?:\?ll=))(.*)?/i))?(t.src=`https://maps.google.${n[1]}/?ll=${(n[2]?n[2]+"&z="+Math.floor(parseFloat(n[3]))+(n[4]?n[4].replace(/^\//,"&"):""):n[4]+"").replace(/\?/,"&")}&output=${n[4]&&n[4].indexOf("layer=c")>0?"svembed":"embed"}`,i=Pt):(n=e.match(/(?:maps\.)?google\.([a-z]{2,3}(?:\.[a-z]{2})?)\/(?:maps\/search\/)(.*)/i))&&(t.src=`https://maps.google.${n[1]}/maps?q=${n[2].replace("query=","q=").replace("api=1","")}&output=embed`,i=Pt),i=i||this.instance.option("defaultType"),t.type=i,i===St&&(t.thumbSrc=t.thumbSrc||t.src)}setContent(t){const e=this.instance.optionFor(t,"src")||"";if(t&&t.type&&e){switch(t.type){case Et:this.instance.setContent(t,e);break;case Mt:const i=this.option("videoTpl");i&&this.instance.setContent(t,i.replace(/\{\{src\}\}/gi,e+"").replace(/\{\{format\}\}/gi,this.optionFor(t,"videoFormat")||"").replace(/\{\{poster\}\}/gi,t.poster||t.thumbSrc||""));break;case"inline":case"clone":this.setInlineContent(t);break;case"ajax":this.loadAjaxContent(t);break;case"pdf":case Pt:case Ct:case Tt:t.preload=!1;case"iframe":this.setIframeContent(t)}this.setAspectRatio(t)}}setAspectRatio(t){const e=t.contentEl;if(!(t.el&&e&&t.type&&[Ct,Tt,Mt].includes(t.type)))return;let i,n=t.width||"auto",s=t.height||"auto";if("auto"===n||"auto"===s){i=this.optionFor(t,"videoRatio");const e=(i+"").match(/(\d+)\s*\/\s?(\d+)/);i=e&&e.length>2?parseFloat(e[1])/parseFloat(e[2]):parseFloat(i+"")}else n&&s&&(i=n/s);if(!i)return;e.style.aspectRatio="",e.style.width="",e.style.height="",e.offsetHeight;const o=e.getBoundingClientRect(),a=o.width||1,r=o.height||1;e.style.aspectRatio=i+"",i<a/r?(s="auto"===s?r:Math.min(r,s),e.style.width="auto",e.style.height=`${s}px`):(n="auto"===n?a:Math.min(a,n),e.style.width=`${n}px`,e.style.height="auto")}attach(){const t=this,e=t.instance;e.on("Carousel.beforeInitSlide",t.onBeforeInitSlide),e.on("Carousel.createSlide",t.onCreateSlide),e.on("Carousel.selectSlide",t.onSelectSlide),e.on("Carousel.unselectSlide",t.onUnselectSlide),e.on("Carousel.Panzoom.refresh",t.onRefresh),e.on("done",t.onDone),e.on("clearContent",t.onClearContent),window.addEventListener("message",t.onMessage)}detach(){const t=this,e=t.instance;e.off("Carousel.beforeInitSlide",t.onBeforeInitSlide),e.off("Carousel.createSlide",t.onCreateSlide),e.off("Carousel.selectSlide",t.onSelectSlide),e.off("Carousel.unselectSlide",t.onUnselectSlide),e.off("Carousel.Panzoom.refresh",t.onRefresh),e.off("done",t.onDone),e.off("clearContent",t.onClearContent),window.removeEventListener("message",t.onMessage)}}Object.defineProperty(zt,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:At});const Rt="play",kt="pause",It="ready";class Dt extends ${constructor(){super(...arguments),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:
38It}),Object.defineProperty(this,"inHover",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"progressBar",{enumerable:!0,configurable:!0,writable:!0,value:null})}get isActive(){return this.state!==It}onReady(t){this.option("autoStart")&&(t.isInfinite||t.page<t.pages.length-1)&&this.start()}onChange(){this.removeProgressBar(),this.pause()}onSettle(){this.resume()}onVisibilityChange(){"visible"===document.visibilityState?this.resume():this.pause()}onMouseEnter(){this.inHover=!0,this.pause()}onMouseLeave(){var t;this.inHover=!1,(null===(t=this.instance.panzoom)||void 0===t?void 0:t.isResting)&&this.resume()}onTimerEnd(){const t=this.instance;"play"===this.state&&(t.isInfinite||t.page!==t.pages.length-1?t.slideNext():t.slideTo(0))}removeProgressBar(){this.progressBar&&(this.progressBar.remove(),this.progressBar=null)}createProgressBar(){var t;if(!this.option("showProgress"))return null;this.removeProgressBar();const e=this.instance,i=(null===(t=e.pages[e.page])||void 0===t?void 0:t.slides)||[];let n=this.option("progressParentEl");if(n||(n=(1===i.length?i[0].el:null)||e.viewport),!n)return null;const s=document.createElement("div");return C(s,"f-progress"),n.prepend(s),this.progressBar=s,s.offsetHeight,s}set(){const t=this,e=t.instance;if(e.pages.length<2)return;if(t.timer)return;const i=t.option("timeout");t.state=Rt,C(e.container,"has-autoplay");let n=t.createProgressBar();n&&(n.style.transitionDuration=`${i}ms`,n.style.transform="scaleX(1)"),t.timer=setTimeout((()=>{t.timer=null,t.inHover||t.onTimerEnd()}),i),t.emit("set")}clear(){const t=this;t.timer&&(clearTimeout(t.timer),t.timer=null),t.removeProgressBar()}start(){const t=this;if(t.set(),t.state!==It){if(t.option("pauseOnHover")){const e=t.instance.container;e.addEventListener("mouseenter",t.onMouseEnter,!1),e.addEventListener("mouseleave",t.onMouseLeave,!1)}document.addEventListener("visibilitychange",t.onVisibilityChange,!1),t.emit("start")}}stop(){const t=this,e=t.state,i=t.instance.container;t.clear(),t.state=It,i.removeEventListener("mouseenter",t.onMouseEnter,!1),i.removeEventListener("mouseleave",t.onMouseLeave,!1),document.removeEventListener("visibilitychange",t.onVisibilityChange,!1),P(i,"has-autoplay"),e!==It&&t.emit("stop")}pause(){const t=this;t.state===Rt&&(t.state=kt,t.clear(),t.emit(kt))}resume(){const t=this,e=t.instance;if(e.isInfinite||e.page!==e.pages.length-1)if(t.state!==Rt){if(t.state===kt&&!t.inHover){const e=new Event("resume",{bubbles:!0,cancelable:!0});t.emit("resume",e),e.defaultPrevented||t.set()}}else t.set();else t.stop()}toggle(){this.state===Rt||this.state===kt?this.stop():this.start()}attach(){const t=this,e=t.instance;e.on("ready",t.onReady),e.on("Panzoom.startAnimation",t.onChange),e.on("Panzoom.endAnimation",t.onSettle),e.on("Panzoom.touchMove",t.onChange)}detach(){const t=this,e=t.instance;e.off("ready",t.onReady),e.off("Panzoom.startAnimation",t.onChange),e.off("Panzoom.endAnimation",t.onSettle),e.off("Panzoom.touchMove",t.onChange),t.stop()}}Object.defineProperty(Dt,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{autoStart:!0,pauseOnHover:!0,progressParentEl:null,showProgress:!0,timeout:3e3}});class Ft extends ${constructor(){super(...arguments),Object.defineProperty(this,"ref",{enumerable:!0,configurable:!0,writable:!0,value:null})}onPrepare(t){const e=t.carousel;if(!e)return;const i=t.container;i&&(e.options.Autoplay=p({autoStart:!1},this.option("Autoplay")||{},{pauseOnHover:!1,timeout:this.option("timeout"),progressParentEl:()=>this.option("progressParentEl")||null,on:{start:()=>{t.emit("startSlideshow")},set:e=>{var n;i.classList.add("has-slideshow"),(null===(n=t.getSlide())||void 0===n?void 0:n.state)!==ct.Ready&&e.pause()},stop:()=>{i.classList.remove("has-slideshow"),t.isCompact||t.endIdle(),t.emit("endSlideshow")},resume:(e,i)=>{var n,s,o;!i||!i.cancelable||(null===(n=t.getSlide())||void 0===n?void 0:n.state)===ct.Ready&&(null===(o=null===(s=t.carousel)||void 0===s?void 0:s.panzoom)||void 0===o?void 0:o.isResting)||i.preventDefault()}}}),e.attachPlugins({Autoplay:Dt}),this.ref=e.plugins.Autoplay)}onReady(t){const e=t.carousel,i=this.ref;i&&e&&this.option("playOnStart")&&(e.isInfinite||e.page<e.pages.length-1)&&i.start()}onDone(t,e){const i=this.ref,n=t.carousel;if(!i||!n)return;const s=e.panzoom;s&&s.on("startAnimation",(()=>{t.isCurrentSlide(e)&&i.stop()})),t.isCurrentSlide(e)&&i.resume()}onKeydown(t,e){var i;const n=this.ref;n&&e===this.option("key")&&"BUTTON"!==(null===(i=document.activeElement)||void 0===i?void 0:i.nodeName)&&n.toggle()}attach(){const t=this,e=t.instance;e.on("Carousel.init",t.onPrepare),e.on("Carousel.ready",t.onReady),e.on("done",t.onDone),e.on("key
38down",t.onKeydown)}detach(){const t=this,e=t.instance;e.off("Carousel.init",t.onPrepare),e.off("Carousel.ready",t.onReady),e.off("done",t.onDone),e.off("keydown",t.onKeydown)}}Object.defineProperty(Ft,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{key:" ",playOnStart:!1,progressParentEl:t=>{var e;return(null===(e=t.instance.container)||void 0===e?void 0:e.querySelector(".fancybox__toolbar [data-fancybox-toggle-slideshow]"))||t.instance.container},timeout:3e3}});const jt={classes:{container:"f-thumbs f-carousel__thumbs",viewport:"f-thumbs__viewport",track:"f-thumbs__track",slide:"f-thumbs__slide",isResting:"is-resting",isSelected:"is-selected",isLoading:"is-loading",hasThumbs:"has-thumbs"},minCount:2,parentEl:null,thumbTpl:'<button class="f-thumbs__slide__button" tabindex="0" type="button" aria-label="{{GOTO}}" data-carousel-index="%i"><img class="f-thumbs__slide__img" data-lazy-src="{{%s}}" alt="" /></button>',type:"modern"};var Bt;!function(t){t[t.Init=0]="Init",t[t.Ready=1]="Ready",t[t.Hidden=2]="Hidden"}(Bt||(Bt={}));const Ht="isResting",Nt="thumbWidth",_t="thumbHeight",$t="thumbClipWidth";let Wt=class extends ${constructor(){super(...arguments),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:"modern"}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"track",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"carousel",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"thumbWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbClipWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbGap",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbExtraGap",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:Bt.Init})}get isModern(){return"modern"===this.type}onInitSlide(t,e){const i=e.el?e.el.dataset:void 0;i&&(e.thumbSrc=i.thumbSrc||e.thumbSrc||"",e[$t]=parseFloat(i[$t]||"")||e[$t]||0,e[_t]=parseFloat(i.thumbHeight||"")||e[_t]||0),this.addSlide(e)}onInitSlides(){this.build()}onChange(){var t;if(!this.isModern)return;const e=this.container,i=this.instance,n=i.panzoom,s=this.carousel,o=s?s.panzoom:null,r=i.page;if(n&&s&&o){if(n.isDragging){P(e,this.cn(Ht));let n=(null===(t=s.pages[r])||void 0===t?void 0:t.pos)||0;n+=i.getProgress(r)*(this[$t]+this.thumbGap);let a=o.getBounds();-1*n>a.x.min&&-1*n<a.x.max&&o.panTo({x:-1*n,friction:.12})}else a(e,this.cn(Ht),n.isResting);this.shiftModern()}}onRefresh(){this.updateProps();for(const t of this.instance.slides||[])this.resizeModernSlide(t);this.shiftModern()}isDisabled(){const t=this.option("minCount")||0;if(t){const e=this.instance;let i=0;for(const t of e.slides||[])t.thumbSrc&&i++;if(i<t)return!0}const e=this.option("type");return["modern","classic"].indexOf(e)<0}getThumb(t){const e=this.option("thumbTpl")||"";return{html:this.instance.localize(e,[["%i",t.index],["%d",t.index+1],["%s",t.thumbSrc||"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"]])}}addSlide(t){const e=this.carousel;e&&e.addSlide(t.index,this.getThumb(t))}getSlides(){const t=[];for(const e of this.instance.slides||[])t.push(this.getThumb(e));return t}resizeModernSlide(t){this.isModern&&(t[Nt]=t[$t]&&t[_t]?Math.round(this[_t]*(t[$t]/t[_t])):this[Nt])}updateProps(){const t=this.container;if(!t)return;const e=e=>parseFloat(getComputedStyle(t).getPropertyValue("--f-thumb-"+e))||0;this.thumbGap=e("gap"),this.thumbExtraGap=e("extra-gap"),this[Nt]=e("width")||40,this[$t]=e("clip-width")||40,this[_t]=e("height")||40}build(){const t=this;if(t.state!==Bt.Init)return;if(t.isDisabled())return void t.emit("disabled");const e=t.instance,i=e.container,n=t.getSlides(),s=t.option("type");t.type=s;const o=t.option("parentEl"),a=t.cn("container"),r=t.cn("track");let l=null==o?void 0:o.querySelector("."+a);l||(l=document.createElement("div"),C(l,a),o?o.appendChild(l):i.after(l)),C(l,`is-${s}`),C(i,t.cn("hasThumbs")),t.container=l,t.updateProps();let c=l.querySelector("."+r);c||(c=document.createElement("div"),C(c,t.cn("track")),l.appendChild(c)),t.track=c;const h=p({},{track:c,infinite:!1,center:!0,fill:"classic"===s,dragFree:!0,slidesPerPage:1,transition:!1,preload:.25,friction:.12,Panzoom:{maxVelocity:0},Dots:!1,Navigation:!1,classes:{container:"f-thumbs",viewport:"f-thumbs__viewport",track:"f-thumbs__track",slide:"f-thumbs__slide"}},t.option("Carousel")||{},{Sync:{target:e},slides:n}),d=new e.constructor(l,h);d.on("createSlide",((e,i)=>{t.setProps(i.index),t.emit("createSlide",i,i.el)})),d.on("ready",(()=>{t.shiftModern(),t.emit("ready")})),d.on("refresh",(()=>{t.shiftModern()})),d.on("Panzoom.click",((e,i,n)=>{t.onClick(n)})),t.carousel=d,t.state=Bt.Ready}onClick(t){t.preventDefault(),t.stopPropagation();const e=this.instance,{pages:i,page:n}=e,s=t=>{if(t){const e=t.closest("[data-carousel-index]");if(e)return[parseInt(e.dataset.carouselIndex||"",10)||0,e]}return[-1,void 0]},o=(t,e)=>{const i=document.elementFromPoint(t,e);return i?s(i):[-1,void 0]};let[a,r]=s(t.target);if(a>-1)return;const l=this[$t],c=t.clientX,h=t.clientY;let[d,u]=o(c-l,h),[p,f]=o(c+l,h);u&&f?(a=Math.abs(c-u.getBoundingClientRect().right)<Math.abs(c-f.getBoundingClientRect().left)?d:
38p,a===n&&(a=a===d?p:d)):u?a=d:f&&(a=p),a>-1&&i[a]&&e.slideTo(a)}getShift(t){var e;const i=this,{instance:n}=i,s=i.carousel;if(!n||!s)return 0;const o=i[Nt],a=i[$t],r=i.thumbGap,l=i.thumbExtraGap;if(!(null===(e=s.slides[t])||void 0===e?void 0:e.el))return 0;const c=.5*(o-a),h=n.pages.length-1;let d=n.getProgress(0),u=n.getProgress(h),p=n.getProgress(t,!1,!0),f=0,g=c+l+r;const m=d<0&&d>-1,v=u>0&&u<1;return 0===t?(f=g*Math.abs(d),v&&1===d&&(f-=g*Math.abs(u))):t===h?(f=g*Math.abs(u)*-1,m&&-1===u&&(f+=g*Math.abs(d))):m||v?(f=-1*g,f+=g*Math.abs(d),f+=g*(1-Math.abs(u))):f=g*p,f}setProps(t){var i;const n=this;if(!n.isModern)return;const{instance:s}=n,o=n.carousel;if(s&&o){const a=null===(i=o.slides[t])||void 0===i?void 0:i.el;if(a&&a.childNodes.length){let i=e(1-Math.abs(s.getProgress(t))),o=e(n.getShift(t));a.style.setProperty("--progress",i?i+"":""),a.style.setProperty("--shift",o+"")}}}shiftModern(){const t=this;if(!t.isModern)return;const{instance:e,track:i}=t,n=e.panzoom,s=t.carousel;if(!(e&&i&&n&&s))return;if(n.state===v.Init||n.state===v.Destroy)return;for(const i of e.slides)t.setProps(i.index);let o=(t[$t]+t.thumbGap)*(s.slides.length||0);i.style.setProperty("--width",o+"")}cleanup(){const t=this;t.carousel&&t.carousel.destroy(),t.carousel=null,t.container&&t.container.remove(),t.container=null,t.track&&t.track.remove(),t.track=null,t.state=Bt.Init,P(t.instance.container,t.cn("hasThumbs"))}attach(){const t=this,e=t.instance;e.on("initSlide",t.onInitSlide),e.state===H.Init?e.on("initSlides",t.onInitSlides):t.onInitSlides(),e.on(["change","Panzoom.afterTransform"],t.onChange),e.on("Panzoom.refresh",t.onRefresh)}detach(){const t=this,e=t.instance;e.off("initSlide",t.onInitSlide),e.off("initSlides",t.onInitSlides),e.off(["change","Panzoom.afterTransform"],t.onChange),e.off("Panzoom.refresh",t.onRefresh),t.cleanup()}};Object.defineProperty(Wt,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:jt});const Xt=Object.assign(Object.assign({},jt),{key:"t",showOnStart:!0,parentEl:null}),qt="is-masked",Yt="aria-hidden";class Vt extends ${constructor(){super(...arguments),Object.defineProperty(this,"ref",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"hidden",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get isEnabled(){const t=this.ref;return t&&!t.isDisabled()}get isHidden(){return this.hidden}onClick(t,e){e.stopPropagation()}onCreateSlide(t,e){var i,n,s;const o=(null===(s=null===(n=null===(i=this.instance)||void 0===i?void 0:i.carousel)||void 0===n?void 0:n.slides[e.index])||void 0===s?void 0:s.type)||"",a=e.el;if(a&&o){let t=`for-${o}`;["video","youtube","vimeo","html5video"].includes(o)&&(t+=" for-video"),C(a,t)}}onInit(){var t;const e=this,i=e.instance,n=i.carousel;if(e.ref||!n)return;const s=e.option("parentEl")||i.footer||i.container;if(!s)return;const o=p({},e.options,{parentEl:s,classes:{container:"f-thumbs fancybox__thumbs"},Carousel:{Sync:{friction:i.option("Carousel.friction")||0}},on:{ready:t=>{const i=t.container;i&&this.hidden&&(e.refresh(),i.style.transition="none",e.hide(),i.offsetHeight,queueMicrotask((()=>{i.style.transition="",e.show()})))}}});o.Carousel=o.Carousel||{},o.Carousel.on=p((null===(t=e.options.Carousel)||void 0===t?void 0:t.on)||{},{click:this.onClick,createSlide:this.onCreateSlide}),n.options.Thumbs=o,n.attachPlugins({Thumbs:Wt}),e.ref=n.plugins.Thumbs,e.option("showOnStart")||(e.ref.state=Bt.Hidden,e.hidden=!0)}onResize(){var t;const e=null===(t=this.ref)||void 0===t?void 0:t.container;e&&(e.style.maxHeight="")}onKeydown(t,e){const i=this.option("key");i&&i===e&&this.toggle()}toggle(){const t=this.ref;if(t&&!t.isDisabled())return t.state===Bt.Hidden?(t.state=Bt.Init,void t.build()):void(this.hidden?this.show():this.hide())}show(){const t=this.ref;if(!t||t.isDisabled())return;const e=t.container;e&&(this.refresh(),e.offsetHeight,e.removeAttribute(Yt),e.classList.remove(qt),this.hidden=!1)}hide(){const t=this.ref,e=t&&t.container;e&&(this.refresh(),e.offsetHeight,e.classList.add(qt),e.setAttribute(Yt,"true")),this.hidden=!0}refresh(){const t=this.ref;if(!t||!t.state)return;const e=t.container,i=(null==e?void 0:e.firstChild)||null;e&&i&&i.childNodes.length&&(e.style.maxHeight=`${i.getBoundingClientRect().height}px`)}
38attach(){const t=this,e=t.instance;e.state===lt.Init?e.on("Carousel.init",t.onInit):t.onInit(),e.on("resize",t.onResize),e.on("keydown",t.onKeydown)}detach(){var t;const e=this,i=e.instance;i.off("Carousel.init",e.onInit),i.off("resize",e.onResize),i.off("keydown",e.onKeydown),null===(t=i.carousel)||void 0===t||t.detachPlugins(["Thumbs"]),e.ref=null}}Object.defineProperty(Vt,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:Xt});const Zt={panLeft:{icon:'<svg><path d="M5 12h14M5 12l6 6M5 12l6-6"/></svg>',change:{panX:-100}},panRight:{icon:'<svg><path d="M5 12h14M13 18l6-6M13 6l6 6"/></svg>',change:{panX:100}},panUp:{icon:'<svg><path d="M12 5v14M18 11l-6-6M6 11l6-6"/></svg>',change:{panY:-100}},panDown:{icon:'<svg><path d="M12 5v14M18 13l-6 6M6 13l6 6"/></svg>',change:{panY:100}},zoomIn:{icon:'<svg><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M11 8v6M8 11h6"/></svg>',action:"zoomIn"},zoomOut:{icon:'<svg><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M8 11h6"/></svg>',action:"zoomOut"},toggle1to1:{icon:'<svg><path d="M3.51 3.07c5.74.02 11.48-.02 17.22.02 1.37.1 2.34 1.64 2.18 3.13 0 4.08.02 8.16 0 12.23-.1 1.54-1.47 2.64-2.79 2.46-5.61-.01-11.24.02-16.86-.01-1.36-.12-2.33-1.65-2.17-3.14 0-4.07-.02-8.16 0-12.23.1-1.36 1.22-2.48 2.42-2.46Z"/><path d="M5.65 8.54h1.49v6.92m8.94-6.92h1.49v6.92M11.5 9.4v.02m0 5.18v0"/></svg>',action:"toggleZoom"},toggleZoom:{icon:'<svg><g><line x1="11" y1="8" x2="11" y2="14"></line></g><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M8 11h6"/></svg>',action:"toggleZoom"},iterateZoom:{icon:'<svg><g><line x1="11" y1="8" x2="11" y2="14"></line></g><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M8 11h6"/></svg>',action:"iterateZoom"},rotateCCW:{icon:'<svg><path d="M15 4.55a8 8 0 0 0-6 14.9M9 15v5H4M18.37 7.16v.01M13 19.94v.01M16.84 18.37v.01M19.37 15.1v.01M19.94 11v.01"/></svg>',action:"rotateCCW"},rotateCW:{icon:'<svg><path d="M9 4.55a8 8 0 0 1 6 14.9M15 15v5h5M5.63 7.16v.01M4.06 11v.01M4.63 15.1v.01M7.16 18.37v.01M11 19.94v.01"/></svg>',action:"rotateCW"},flipX:{icon:'<svg style="stroke-width: 1.3"><path d="M12 3v18M16 7v10h5L16 7M8 7v10H3L8 7"/></svg>',action:"flipX"},flipY:{icon:'<svg style="stroke-width: 1.3"><path d="M3 12h18M7 16h10L7 21v-5M7 8h10L7 3v5"/></svg>',action:"flipY"},fitX:{icon:'<svg><path d="M4 12V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v6M10 18H3M21 18h-7M6 15l-3 3 3 3M18 15l3 3-3 3"/></svg>',action:"fitX"},fitY:{icon:'<svg><path d="M12 20H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h6M18 14v7M18 3v7M15 18l3 3 3-3M15 6l3-3 3 3"/></svg>',action:"fitY"},reset:{icon:'<svg><path d="M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/></svg>',action:"reset"},toggleFS:{icon:'<svg><g><path d="M14.5 9.5 21 3m0 0h-6m6 0v6M3 21l6.5-6.5M3 21v-6m0 6h6"/></g><g><path d="m14 10 7-7m-7 7h6m-6 0V4M3 21l7-7m0 0v6m0-6H4"/></g></svg>',action:"toggleFS"}};var Ut;!function(t){t[t.Init=0]="Init",t[t.Ready=1]="Ready",t[t.Disabled=2]="Disabled"}(Ut||(Ut={}));const Gt={absolute:"auto",display:{left:["infobar"],middle:[],right:["iterateZoom","slideshow","fullscreen","thumbs","close"]},enabled:"auto",items:{infobar:{tpl:'<div class="fancybox__infobar" tabindex="-1"><span data-fancybox-current-index></span>/<span data-fancybox-count></span></div>'},download:{tpl:'<a class="f-button" title="{{DOWNLOAD}}" data-fancybox-download href="javasript:;"><svg><path d="M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2M7 11l5 5 5-5M12 4v12"/></svg></a>'},prev:{tpl:'<button class="f-button" title="{{PREV}}" data-fancybox-prev><svg><path d="m15 6-6 6 6 6"/></svg></button>'},next:{tpl:'<button class="f-button" title="{{NEXT}}" data-fancybox-next><svg><path d="m9 6 6 6-6 6"/></svg></button>'},slideshow:{tpl:'<button class="f-button" title="{{TOGGLE_SLIDESHOW}}" data-fancybox-toggle-slideshow><svg><g><path d="M8 4v16l13 -8z"></path></g><g><path d="M8 4v15M17 4v15"/></g></svg></button>'},fullscreen:{tpl:'<button class="f-button" title="{{TOGGLE_FULLSCREEN}}" data-fancybox-toggle-fullscreen><svg><g><path d="M4 8V6a2 2 0 0 1 2-2h2M4 16v2a2 2 0 0 0 2 2h2M16 4h2a2 2 0 0 1 2 2v2M16 20h2a2 2 0 0 0 2-2v-2"/></g><g><path d="M15 19v-2a2 2 0 0 1 2-2h2M15 5v2a2 2 0 0 0 2 2h2M5 15h2a2 2 0 0 1 2 2v2M5 9h2a2 2 0 0 0 2-2V5"/></g></svg></button>'},thumbs:{tpl:'<button class="f-button" title="{{TOGGLE_THUMBS}}" data-fancybox-toggle-thumbs><svg><circle cx="5.5" cy="5.5" r="1"/><circle cx="12" cy="5.5" r="1"/><circle cx="18.5" cy="5.5" r="1"/><circle cx="5.5" cy="12" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="18.5" cy="12" r="1"/><circle cx="5.5" cy="18.5" r="1"/><circle cx="12" cy="18.5" r="1"/><circle cx="18.5" cy="18.5" r="1"/></svg></button>'},close:{tpl:'<button class="f-button" title="{{CLOSE}}" data-fancybox-close><svg><path d="m19.5 4.5-15 15M4.5 4.5l15 15"/></svg></button>'}},parentEl:null},Kt={tabindex:"-1",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Jt="has-toolbar",Qt="fancybox__toolbar";class te extends ${constructor(){super(...arguments),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:Ut.Init}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null})}onReady(t){var e;if(!t.carousel)return;let i=this.option("display"),n=this.option("absolute"),s=this.option("enabled");if("auto"===s){const t=this.instance.carousel;let e=0;if(t)for(const i of t.slides)(i.panzoom||"image"===i.type)&&e++;e||(s=!1)}s||(i=void 0);let o=0;const a={left:[],middle:[],right:[]};if(i)for(const t of["left","middle","right"])for(const n of i[t]){const i=this.createEl(n);i&&(null===(e=a[t])||void 0===e||e.push(i),o++)}let r=null;if(o&&(r=this.createContainer()),r){for(const[t,e]of Object.entries(a)){const i=document.createElement("div");C(i,Qt+"__column is-"+t);for(const t of e)i.appendChild(t);"auto"!==n||"middle"!==t||e.length||(n=!0),r.appendChild(i)}!0===n&&C(r,"is-absolute"),this.state=Ut.Ready,this.onRefresh()}else this.state=Ut.Disabled}onClick(t){var e,i;const n=this.instance,s=n.getSlide(),o=null==s?void 0:s.panzoom,a=t.target,r=a&&S(a)?a.dataset:null;if(!r)return;if(void 0!==r.fancyboxToggleThumbs)return t.preventDefault(),t.stopPropagation(),void(null===(e=n.plugins.Thumbs
38)||void 0===e||e.toggle());if(void 0!==r.fancyboxToggleFullscreen)return t.preventDefault(),t.stopPropagation(),void this.instance.toggleFullscreen();if(void 0!==r.fancyboxToggleSlideshow){t.preventDefault(),t.stopPropagation();const e=null===(i=n.carousel)||void 0===i?void 0:i.plugins.Autoplay;let s=e.isActive;return o&&"mousemove"===o.panMode&&!s&&o.reset(),void(s?e.stop():e.start())}const l=r.panzoomAction,c=r.panzoomChange;if((c||l)&&(t.preventDefault(),t.stopPropagation()),c){let t={};try{t=JSON.parse(c)}catch(t){}o&&o.applyChange(t)}else l&&o&&o[l]&&o[l]()}onChange(){this.onRefresh()}onRefresh(){if(this.instance.isClosing())return;const t=this.container;if(!t)return;const e=this.instance.getSlide();if(!e||e.state!==ct.Ready)return;const i=e&&!e.error&&e.panzoom;for(const e of t.querySelectorAll("[data-panzoom-action]"))i?(e.removeAttribute("disabled"),e.removeAttribute("tabindex")):(e.setAttribute("disabled",""),e.setAttribute("tabindex","-1"));let n=i&&i.canZoomIn(),s=i&&i.canZoomOut();for(const e of t.querySelectorAll('[data-panzoom-action="zoomIn"]'))n?(e.removeAttribute("disabled"),e.removeAttribute("tabindex")):(e.setAttribute("disabled",""),e.setAttribute("tabindex","-1"));for(const e of t.querySelectorAll('[data-panzoom-action="zoomOut"]'))s?(e.removeAttribute("disabled"),e.removeAttribute("tabindex")):(e.setAttribute("disabled",""),e.setAttribute("tabindex","-1"));for(const e of t.querySelectorAll('[data-panzoom-action="toggleZoom"],[data-panzoom-action="iterateZoom"]')){s||n?(e.removeAttribute("disabled"),e.removeAttribute("tabindex")):(e.setAttribute("disabled",""),e.setAttribute("tabindex","-1"));const t=e.querySelector("g");t&&(t.style.display=n?"":"none")}}onDone(t,e){var i;null===(i=e.panzoom)||void 0===i||i.on("afterTransform",(()=>{this.instance.isCurrentSlide(e)&&this.onRefresh()})),this.instance.isCurrentSlide(e)&&this.onRefresh()}createContainer(){const t=this.instance.container;if(!t)return null;const e=this.option("parentEl")||t;let i=e.querySelector("."+Qt);return i||(i=document.createElement("div"),C(i,Qt),e.prepend(i)),i.addEventListener("click",this.onClick,{passive:!1,capture:!0}),t&&C(t,Jt),this.container=i,i}createEl(t){const e=this.instance,i=e.carousel;if(!i)return null;if("toggleFS"===t)return null;if("fullscreen"===t&&!at())return null;let n=null;const o=i.slides.length||0;let a=0,r=0;for(const t of i.slides)(t.panzoom||"image"===t.type)&&a++,("image"===t.type||t.downloadSrc)&&r++;if(o<2&&["infobar","prev","next"].includes(t))return n;if(void 0!==Zt[t]&&!a)return null;if("download"===t&&!r)return null;if("thumbs"===t){const t=e.plugins.Thumbs;if(!t||!t.isEnabled)return null}if("slideshow"===t){if(!i.plugins.Autoplay||o<2)return null}if(void 0!==Zt[t]){const e=Zt[t];n=document.createElement("button"),n.setAttribute("title",this.instance.localize(`{{${t.toUpperCase()}}}`)),C(n,"f-button"),e.action&&(n.dataset.panzoomAction=e.action),e.change&&(n.dataset.panzoomChange=JSON.stringify(e.change)),n.appendChild(s(this.instance.localize(e.icon)))}else{const e=(this.option("items")||[])[t];e&&(n=s(this.instance.localize(e.tpl)),"function"==typeof e.click&&n.addEventListener("click",(t=>{t.preventDefault(),t.stopPropagation(),"function"==typeof e.click&&e.click.call(this,this,t)})))}const l=null==n?void 0:n.querySelector("svg");if(l)for(const[t,e]of Object.entries(Kt))l.getAttribute(t)||l.setAttribute(t,String(e));return n}removeContainer(){const t=this.container;t&&t.remove(),this.container=null,this.state=Ut.Disabled;const e=this.instance.container;e&&P(e,Jt)}attach(){const t=this,e=t.instance;e.on("Carousel.initSlides",t.onReady),e.on("done",t.onDone),e.on(["reveal","Carousel.change"],t.onChange),t.onReady(t.instance)}detach(){const t=this,e=t.instance;e.off("Carousel.initSlides",t.onReady),e.off("done",t.onDone),e.off(["reveal","Carousel.change"],t.onChange),t.removeContainer()}}Object.defineProperty(te,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:Gt});const ee={Hash:class extends ${onReady(){dt=!1}onChange(t){pt&&clearTimeout(pt);const{hash:e}=ft(),{hash:i}=gt(),n=t.isOpeningSlide(t.getSlide());n&&(ht=i===e?"":i),e&&e!==i&&(pt=setTimeout((()=>{try{if(t.state===lt.Ready){let t="replaceState";
38n&&!ut&&(t="pushState",ut=!0),window.history[t]({},document.title,window.location.pathname+window.location.search+e)}}catch(t){}}),300))}onClose(t){if(pt&&clearTimeout(pt),!dt&&ut)return ut=!1,dt=!1,void window.history.back();if(!dt)try{window.history.replaceState({},document.title,window.location.pathname+window.location.search+(ht||""))}catch(t){}}attach(){const t=this.instance;t.on("ready",this.onReady),t.on(["Carousel.ready","Carousel.change"],this.onChange),t.on("close",this.onClose)}detach(){const t=this.instance;t.off("ready",this.onReady),t.off(["Carousel.ready","Carousel.change"],this.onChange),t.off("close",this.onClose)}static parseURL(){return gt()}static startFromUrl(){mt()}static destroy(){window.removeEventListener("hashchange",bt,!1)}},Html:zt,Images:xt,Slideshow:Ft,Thumbs:Vt,Toolbar:te},ie="with-fancybox",ne="hide-scrollbar",se="--fancybox-scrollbar-compensate",oe="--fancybox-body-margin",ae="aria-hidden",re="is-using-tab",le="is-animated",ce="is-compact",he="is-loading",de="is-opening",ue="has-caption",pe="disabled",fe="tabindex",ge="download",me="href",ve="src",be=t=>"string"==typeof t,ye=function(){var t=window.getSelection();return!!t&&"Range"===t.type};let we,xe=null,Ee=null,Se=0,Pe=0,Ce=0,Te=0;const Me=new Map;let Oe=0;class Ae extends m{get isIdle(){return this.idle}get isCompact(){return this.option("compact")}constructor(t=[],e={},i={}){super(e),Object.defineProperty(this,"userSlides",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"userPlugins",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"idle",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"idleTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"clickTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"pwt",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"ignoreFocusChange",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"startedFs",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:lt.Init}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"footer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"carousel",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"lastFocus",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"prevMouseMoveEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),we||(we=at()),this.id=e.id||++Oe,Me.set(this.id,this),this.userSlides=t,this.userPlugins=i,queueMicrotask((()=>{this.init()}))}init(){if(this.state===lt.Destroy)return;this.state=lt.Init,this.attachPlugins(Object.assign(Object.assign({},Ae.Plugins),this.userPlugins)),this.emit("init"),this.emit("attachPlugins"),!0===this.option("hideScrollbar")&&(()=>{if(!it)return;const t=document,e=t.body,i=t.documentElement;if(e.classList.contains(ne))return;let n=window.innerWidth-i.getBoundingClientRect().width;const s=parseFloat(window.getComputedStyle(e).marginRight);n<0&&(n=0),i.style.setProperty(se,`${n}px`),s&&e.style.setProperty(oe,`${s}px`),e.classList.add(ne)})(),this.initLayout(),this.scale();const t=()=>{this.initCarousel(this.userSlides),this.state=lt.Ready,this.attachEvents(),this.emit("ready"),setTimeout((()=>{this.container&&this.container.setAttribute(ae,"false")}),16)};this.option("Fullscreen.autoStart")&&we&&!we.isFullscreen()?we.request().then((()=>{this.startedFs=!0,t()})).catch((()=>t())):t()}initLayout(){var t,e;const i=this.option("parentEl")||document.body,n=s(this.localize(this.option("tpl.main")||""));if(n){if(n.setAttribute("id",`fancybox-${this.id}`),n.setAttribute("aria-label",this.localize("{{MODAL}}")),n.classList.toggle(ce,this.isCompact),C(n,this.option("mainClass")||""),C(n,de),this.container=n,this.footer=n.querySelector(".fancybox__footer"),i.appendChild(n),C(document.documentElement,ie),xe&&Ee||(xe=document.createElement("span"),C(xe,"fancybox-focus-guard"),xe.setAttribute(fe,"0"),xe.setAttribute(ae,"true"),xe.setAttribute("aria-label","Focus guard"),Ee=xe.cloneNode(),null===(t=n.parentElement)||void 0===t||t.insertBefore(xe,n),null===(e=n.parentElement)||void 0===e||e.append(Ee)),n.addEventListener("mousedown",(t=>{Se=t.pageX,Pe=t.pageY,P(n,re)})),this.option("closeExisting"))for(const t of Me.values())t.id!==this.id&&t.close();else this.option("animated")&&(C(n,le),setTimeout((()=>{this.isClosing()||P(n,le)}),350));
38this.emit("initLayout")}}initCarousel(t){const e=this.container;if(!e)return;const n=e.querySelector(".fancybox__carousel");if(!n)return;const s=this.carousel=new tt(n,p({},{slides:t,transition:"fade",Panzoom:{lockAxis:this.option("dragToClose")?"xy":"x",infinite:!!this.option("dragToClose")&&"y"},Dots:!1,Navigation:{classes:{container:"fancybox__nav",button:"f-button",isNext:"is-next",isPrev:"is-prev"}},initialPage:this.option("startIndex"),l10n:this.option("l10n")},this.option("Carousel")||{}));s.on("*",((t,e,...i)=>{this.emit(`Carousel.${e}`,t,...i)})),s.on(["ready","change"],(()=>{this.manageCaption()})),this.on("Carousel.removeSlide",((t,e,i)=>{this.clearContent(i),i.state=void 0})),s.on("Panzoom.touchStart",(()=>{var t,e;this.isCompact||this.endIdle(),(null===(t=document.activeElement)||void 0===t?void 0:t.closest(".f-thumbs"))&&(null===(e=this.container)||void 0===e||e.focus())})),s.on("settle",(()=>{this.idleTimer||this.isCompact||!this.option("idle")||this.setIdle(),this.option("autoFocus")&&!this.isClosing&&this.checkFocus()})),this.option("dragToClose")&&(s.on("Panzoom.afterTransform",((t,e)=>{const n=this.getSlide();if(n&&i(n.el))return;const s=this.container;if(s){const t=Math.abs(e.current.f),i=t<1?"":Math.max(.5,Math.min(1,1-t/e.contentRect.fitHeight*1.5));s.style.setProperty("--fancybox-ts",i?"0s":""),s.style.setProperty("--fancybox-opacity",i+"")}})),s.on("Panzoom.touchEnd",((t,e,n)=>{var s;const o=this.getSlide();if(o&&i(o.el))return;if(e.isMobile&&document.activeElement&&-1!==["TEXTAREA","INPUT"].indexOf(null===(s=document.activeElement)||void 0===s?void 0:s.nodeName))return;const a=Math.abs(e.dragOffset.y);"y"===e.lockedAxis&&(a>=200||a>=50&&e.dragOffset.time<300)&&(n&&n.cancelable&&n.preventDefault(),this.close(n,"f-throwOut"+(e.current.f<0?"Up":"Down")))}))),s.on("change",(t=>{var e;let i=null===(e=this.getSlide())||void 0===e?void 0:e.triggerEl;if(i){const e=new CustomEvent("slideTo",{bubbles:!0,cancelable:!0,detail:t.page});i.dispatchEvent(e)}})),s.on(["refresh","change"],(t=>{const e=this.container;if(!e)return;for(const i of e.querySelectorAll("[data-fancybox-current-index]"))i.innerHTML=t.page+1;for(const i of e.querySelectorAll("[data-fancybox-count]"))i.innerHTML=t.pages.length;if(!t.isInfinite){for(const i of e.querySelectorAll("[data-fancybox-next]"))t.page<t.pages.length-1?(i.removeAttribute(pe),i.removeAttribute(fe)):(i.setAttribute(pe,""),i.setAttribute(fe,"-1"));for(const i of e.querySelectorAll("[data-fancybox-prev]"))t.page>0?(i.removeAttribute(pe),i.removeAttribute(fe)):(i.setAttribute(pe,""),i.setAttribute(fe,"-1"))}const i=this.getSlide();if(!i)return;let n=i.downloadSrc||"";n||"image"!==i.type||i.error||!be(i[ve])||(n=i[ve]);for(const t of e.querySelectorAll("[data-fancybox-download]")){const e=i.downloadFilename;n?(t.removeAttribute(pe),t.removeAttribute(fe),t.setAttribute(me,n),t.setAttribute(ge,e||n),t.setAttribute("target","_blank")):(t.setAttribute(pe,""),t.setAttribute(fe,"-1"),t.removeAttribute(me),t.removeAttribute(ge))}})),this.emit("initCarousel")}attachEvents(){const t=this,e=t.container;if(!e)return;e.addEventListener("click",t.onClick,{passive:!1,capture:!1}),e.addEventListener("wheel",t.onWheel,{passive:!1,capture:!1}),document.addEventListener("keydown",t.onKeydown,{passive:!1,capture:!0}),document.addEventListener("visibilitychange",t.onVisibilityChange,!1),document.addEventListener("mousemove",t.onMousemove),t.option("trapFocus")&&document.addEventListener("focus",t.onFocus,!0),window.addEventListener("resize",t.onResize);const i=window.visualViewport;i&&(i.addEventListener("scroll",t.onResize),i.addEventListener("resize",t.onResize))}detachEvents(){const t=this,e=t.container;if(!e)return;document.removeEventListener("keydown",t.onKeydown,{passive:!1,capture:!0}),e.removeEventListener("wheel",t.onWheel,{passive:!1,capture:!1}),e.removeEventListener("click",t.onClick,{passive:!1,capture:!1}),document.removeEventListener("mousemove",t.onMousemove),window.removeEventListener("resize",t.onResize);const i=window.visualViewport;i&&(i.removeEventListener("resize",t.onResize),i.removeEventListener("scroll",t.onResize)),document.removeEventListener("visibilitychange",t.onVisibilityChange,!1),document.removeEventListener("focus",t.onFocus,!0)}scale(){const t=this.container;if(!t)return;
38const e=window.visualViewport,i=Math.max(1,(null==e?void 0:e.scale)||1);let n="",s="",o="";if(e&&i>1){let t=`${e.offsetLeft}px`,a=`${e.offsetTop}px`;n=e.width*i+"px",s=e.height*i+"px",o=`translate3d(${t}, ${a}, 0) scale(${1/i})`}t.style.transform=o,t.style.width=n,t.style.height=s}onClick(t){var e;const{container:i,isCompact:n}=this;if(!i||this.isClosing())return;!n&&this.option("idle")&&this.resetIdle();const s=t.composedPath()[0];if(s.closest(".fancybox-spinner")||s.closest("[data-fancybox-close]"))return t.preventDefault(),void this.close(t);if(s.closest("[data-fancybox-prev]"))return t.preventDefault(),void this.prev();if(s.closest("[data-fancybox-next]"))return t.preventDefault(),void this.next();if("click"===t.type&&0===t.detail)return;if(Math.abs(t.pageX-Se)>30||Math.abs(t.pageY-Pe)>30)return;const o=document.activeElement;if(ye()&&o&&i.contains(o))return;if(n&&"image"===(null===(e=this.getSlide())||void 0===e?void 0:e.type))return void(this.clickTimer?(clearTimeout(this.clickTimer),this.clickTimer=null):this.clickTimer=setTimeout((()=>{this.toggleIdle(),this.clickTimer=null}),350));if(this.emit("click",t),t.defaultPrevented)return;let a=!1;if(s.closest(".fancybox__content")){if(o){if(o.closest("[contenteditable]"))return;s.matches(st)||o.blur()}if(ye())return;a=this.option("contentClick")}else s.closest(".fancybox__carousel")&&!s.matches(st)&&(a=this.option("backdropClick"));"close"===a?(t.preventDefault(),this.close(t)):"next"===a?(t.preventDefault(),this.next()):"prev"===a&&(t.preventDefault(),this.prev())}onWheel(t){const e=t.target;let i=this.option("wheel",t);e.closest(".fancybox__thumbs")&&(i="slide");const s="slide"===i,o=[-t.deltaX||0,-t.deltaY||0,-t.detail||0].reduce((function(t,e){return Math.abs(e)>Math.abs(t)?e:t})),a=Math.max(-1,Math.min(1,o)),r=Date.now();this.pwt&&r-this.pwt<300?s&&t.preventDefault():(this.pwt=r,this.emit("wheel",t,a),t.defaultPrevented||("close"===i?(t.preventDefault(),this.close(t)):"slide"===i&&(n(e)||(t.preventDefault(),this[a>0?"prev":"next"]()))))}onScroll(){window.scrollTo(Ce,Te)}onKeydown(t){if(!this.isTopmost())return;this.isCompact||!this.option("idle")||this.isClosing()||this.resetIdle();const e=t.key,i=this.option("keyboard");if(!i)return;const n=t.composedPath()[0],s=document.activeElement&&document.activeElement.classList,o=s&&s.contains("f-button")||n.dataset.carouselPage||n.dataset.carouselIndex;if("Escape"!==e&&!o&&S(n)){if(n.isContentEditable||-1!==["TEXTAREA","OPTION","INPUT","SELECT","VIDEO"].indexOf(n.nodeName))return}if("Tab"===t.key?C(this.container,re):P(this.container,re),t.ctrlKey||t.altKey||t.shiftKey)return;this.emit("keydown",e,t);const a=i[e];a&&"function"==typeof this[a]&&(t.preventDefault(),this[a]())}onResize(){const t=this.container;if(!t)return;const e=this.isCompact;t.classList.toggle(ce,e),this.manageCaption(this.getSlide()),this.isCompact?this.clearIdle():this.endIdle(),this.scale(),this.emit("resize")}onFocus(t){this.isTopmost()&&this.checkFocus(t)}onMousemove(t){this.prevMouseMoveEvent=t,!this.isCompact&&this.option("idle")&&this.resetIdle()}onVisibilityChange(){"visible"===document.visibilityState?this.checkFocus():this.endIdle()}manageCloseBtn(t){const e=this.optionFor(t,"closeButton")||!1;if("auto"===e){const t=this.plugins.Toolbar;if(t&&t.state===Ut.Ready)return}if(!e)return;if(!t.contentEl||t.closeBtnEl)return;const i=this.option("tpl.closeButton");if(i){const e=s(this.localize(i));t.closeBtnEl=t.contentEl.appendChild(e),t.el&&C(t.el,"has-close-btn")}}manageCaption(t=void 0){var e,i;const n="fancybox__caption",s=this.container;if(!s)return;P(s,ue);const o=this.isCompact||this.option("commonCaption"),a=!o;if(this.caption&&this.stop(this.caption),a&&this.caption&&(this.caption.remove(),this.caption=null),o&&!this.caption)for(const t of(null===(e=this.carousel)||void 0===e?void 0:e.slides)||[])t.captionEl&&(t.captionEl.remove(),t.captionEl=void 0,P(t.el,ue),null===(i=t.el)||void 0===i||i.removeAttribute("aria-labelledby"));if(t||(t=this.getSlide()),!t||o&&!this.isCurrentSlide(t))return;const r=t.el;let l=this.optionFor(t,"caption","");if(!l)return void(o&&this.caption&&this.animate(this.caption,"f-fadeOut",(()=>{this.caption&&(this.caption.innerHTML="")})));let c=null;if(a){if(c=t.captionEl||null,r&&!c){const e=n+`_${this.id}_${t.index}`;c=document.createElement("div"),C(c,n),c.setAttribute("id",e),t.captionEl=r.a
38ppendChild(c),C(r,ue),r.setAttribute("aria-labelledby",e)}}else{if(c=this.caption,c||(c=s.querySelector("."+n)),!c){c=document.createElement("div"),c.dataset.fancyboxCaption="",C(c,n);(this.footer||s).prepend(c)}C(s,ue),this.caption=c}c&&(c.innerHTML="",be(l)||"number"==typeof l?c.innerHTML=l+"":l instanceof HTMLElement&&c.appendChild(l))}checkFocus(t){this.focus(t)}focus(t){var e;if(this.ignoreFocusChange)return;const i=document.activeElement||null,n=(null==t?void 0:t.target)||null,s=this.container,o=null===(e=this.carousel)||void 0===e?void 0:e.viewport;if(!s||!o)return;if(!t&&i&&s.contains(i))return;const a=this.getSlide(),r=a&&a.state===ct.Ready?a.el:null;if(!r||r.contains(i)||s===i)return;t&&t.cancelable&&t.preventDefault(),this.ignoreFocusChange=!0;const l=Array.from(s.querySelectorAll(st));let c=[],h=null;for(let t of l){const e=!t.offsetParent||!!t.closest('[aria-hidden="true"]'),i=r&&r.contains(t),n=!o.contains(t);if(t===s||(i||n)&&!e){c.push(t);const e=t.dataset.origTabindex;void 0!==e&&e&&(t.tabIndex=parseFloat(e)),t.removeAttribute("data-orig-tabindex"),!t.hasAttribute("autoFocus")&&h||(h=t)}else{const e=void 0===t.dataset.origTabindex?t.getAttribute("tabindex")||"":t.dataset.origTabindex;e&&(t.dataset.origTabindex=e),t.tabIndex=-1}}let d=null;t?(!n||c.indexOf(n)<0)&&(d=h||s,c.length&&(i===Ee?d=c[0]:this.lastFocus!==s&&i!==xe||(d=c[c.length-1]))):d=a&&"image"===a.type?s:h||s,d&&ot(d),this.lastFocus=document.activeElement,this.ignoreFocusChange=!1}next(){const t=this.carousel;t&&t.pages.length>1&&t.slideNext()}prev(){const t=this.carousel;t&&t.pages.length>1&&t.slidePrev()}jumpTo(...t){this.carousel&&this.carousel.slideTo(...t)}isTopmost(){var t;return(null===(t=Ae.getInstance())||void 0===t?void 0:t.id)==this.id}animate(t=null,e="",i){if(!t||!e)return void(i&&i());this.stop(t);const n=s=>{s.target===t&&t.dataset.animationName&&(t.removeEventListener("animationend",n),delete t.dataset.animationName,i&&i(),P(t,e))};t.dataset.animationName=e,t.addEventListener("animationend",n),C(t,e)}stop(t){t&&t.dispatchEvent(new CustomEvent("animationend",{bubbles:!1,cancelable:!0,currentTarget:t}))}setContent(t,e="",i=!0){if(this.isClosing())return;const n=t.el;if(!n)return;let o=null;if(S(e)?o=e:(o=s(e+""),S(o)||(o=document.createElement("div"),o.innerHTML=e+"")),["img","picture","iframe","video","audio"].includes(o.nodeName.toLowerCase())){const t=document.createElement("div");t.appendChild(o),o=t}S(o)&&t.filter&&!t.error&&(o=o.querySelector(t.filter)),o&&S(o)?(C(o,"fancybox__content"),t.id&&o.setAttribute("id",t.id),n.classList.add(`has-${t.error?"error":t.type||"unknown"}`),n.prepend(o),"none"===o.style.display&&(o.style.display=""),"none"===getComputedStyle(o).getPropertyValue("display")&&(o.style.display=t.display||this.option("defaultDisplay")||"flex"),t.contentEl=o,i&&this.revealContent(t),this.manageCloseBtn(t),this.manageCaption(t)):this.setError(t,"{{ELEMENT_NOT_FOUND}}")}revealContent(t,e){const i=t.el,n=t.contentEl;i&&n&&(this.emit("reveal",t),this.hideLoading(t),t.state=ct.Opening,(e=this.isOpeningSlide(t)?void 0===e?this.optionFor(t,"showClass"):e:"f-fadeIn")?this.animate(n,e,(()=>{this.done(t)})):this.done(t))}done(t){this.isClosing()||(t.state=ct.Ready,this.emit("done",t),C(t.el,"is-done"),this.isCurrentSlide(t)&&this.option("autoFocus")&&queueMicrotask((()=>{var e;null===(e=t.panzoom)||void 0===e||e.updateControls(),this.option("autoFocus")&&this.focus()})),this.isOpeningSlide(t)&&(P(this.container,de),!this.isCompact&&this.option("idle")&&this.setIdle()))}isCurrentSlide(t){const e=this.getSlide();return!(!t||!e)&&e.index===t.index}isOpeningSlide(t){var e,i;return null===(null===(e=this.carousel)||void 0===e?void 0:e.prevPage)&&t&&t.index===(null===(i=this.getSlide())||void 0===i?void 0:i.index)}showLoading(t){t.state=ct.Loading;const e=t.el;if(!e)return;C(e,he),this.emit("loading",t),t.spinnerEl||setTimeout((()=>{if(!this.isClosing()&&!t.spinnerEl&&t.state===ct.Loading){let i=s(E);C(i,"fancybox-spinner"),t.spinnerEl=i,e.prepend(i),this.animate(i,"f-fadeIn")}}),250)}hideLoading(t){const e=t.el;if(!e)return;const i=t.spinnerEl;this.isClosing()?null==i||i.remove():(P(e,he),i&&this.animate(i,"f-fadeOut",(()=>{i.remove()}
38)),t.state===ct.Loading&&(this.emit("loaded",t),t.state=ct.Ready))}setError(t,e){if(this.isClosing())return;const i=new Event("error",{bubbles:!0,cancelable:!0});if(this.emit("error",i,t),i.defaultPrevented)return;t.error=e,this.hideLoading(t),this.clearContent(t);const n=document.createElement("div");n.classList.add("fancybox-error"),n.innerHTML=this.localize(e||"<p>{{ERROR}}</p>"),this.setContent(t,n)}clearContent(t){if(void 0===t.state)return;this.emit("clearContent",t),t.contentEl&&(t.contentEl.remove(),t.contentEl=void 0);const e=t.el;e&&(P(e,"has-error"),P(e,"has-unknown"),P(e,`has-${t.type||"unknown"}`)),t.closeBtnEl&&t.closeBtnEl.remove(),t.closeBtnEl=void 0,t.captionEl&&t.captionEl.remove(),t.captionEl=void 0,t.spinnerEl&&t.spinnerEl.remove(),t.spinnerEl=void 0}getSlide(){var t;const e=this.carousel;return(null===(t=null==e?void 0:e.pages[null==e?void 0:e.page])||void 0===t?void 0:t.slides[0])||void 0}close(t,e){if(this.isClosing())return;const i=new Event("shouldClose",{bubbles:!0,cancelable:!0});if(this.emit("shouldClose",i,t),i.defaultPrevented)return;t&&t.cancelable&&(t.preventDefault(),t.stopPropagation());const n=()=>{this.proceedClose(t,e)};this.startedFs&&we&&we.isFullscreen()?Promise.resolve(we.exit()).then((()=>n())):n()}clearIdle(){this.idleTimer&&clearTimeout(this.idleTimer),this.idleTimer=null}setIdle(t=!1){const e=()=>{this.clearIdle(),this.idle=!0,C(this.container,"is-idle"),this.emit("setIdle")};if(this.clearIdle(),!this.isClosing())if(t)e();else{const t=this.option("idle");t&&(this.idleTimer=setTimeout(e,t))}}endIdle(){this.clearIdle(),this.idle&&!this.isClosing()&&(this.idle=!1,P(this.container,"is-idle"),this.emit("endIdle"))}resetIdle(){this.endIdle(),this.setIdle()}toggleIdle(){this.idle?this.endIdle():this.setIdle(!0)}toggleFullscreen(){we&&(we.isFullscreen()?we.exit():we.request().then((()=>{this.startedFs=!0})))}isClosing(){return[lt.Closing,lt.CustomClosing,lt.Destroy].includes(this.state)}proceedClose(t,e){var i,n;this.state=lt.Closing,this.clearIdle(),this.detachEvents();const s=this.container,o=this.carousel,a=this.getSlide(),r=a&&this.option("placeFocusBack")?a.triggerEl||this.option("triggerEl"):null;if(r&&(et(r)?ot(r):r.focus()),s&&(P(s,de),C(s,"is-closing"),s.setAttribute(ae,"true"),this.option("animated")&&C(s,le),s.style.pointerEvents="none"),o){o.clearTransitions(),null===(i=o.panzoom)||void 0===i||i.destroy(),null===(n=o.plugins.Navigation)||void 0===n||n.detach();for(const t of o.slides){t.state=ct.Closing,this.hideLoading(t);const e=t.contentEl;e&&this.stop(e);const i=null==t?void 0:t.panzoom;i&&(i.stop(),i.detachEvents(),i.detachObserver()),this.isCurrentSlide(t)||o.emit("removeSlide",t)}}Ce=window.scrollX,Te=window.scrollY,window.addEventListener("scroll",this.onScroll),this.emit("close",t),this.state!==lt.CustomClosing?(void 0===e&&a&&(e=this.optionFor(a,"hideClass")),e&&a?(this.animate(a.contentEl,e,(()=>{o&&o.emit("removeSlide",a)})),setTimeout((()=>{this.destroy()}),500)):this.destroy()):setTimeout((()=>{this.destroy()}),500)}destroy(){var t;if(this.state===lt.Destroy)return;window.removeEventListener("scroll",this.onScroll),this.state=lt.Destroy,null===(t=this.carousel)||void 0===t||t.destroy();const e=this.container;e&&e.remove(),Me.delete(this.id);const i=Ae.getInstance();i?i.focus():(xe&&(xe.remove(),xe=null),Ee&&(Ee.remove(),Ee=null),P(document.documentElement,ie),(()=>{if(!it)return;const t=document,e=t.body;e.classList.remove(ne),e.style.setProperty(oe,""),t.documentElement.style.setProperty(se,"")})(),this.emit("destroy"))}static bind(t,e,i){if(!it)return;let n,s="",o={};if(void 0===t?n=document.body:be(t)?(n=document.body,s=t,"object"==typeof e&&(o=e||{})):(n=t,be(e)&&(s=e),"object"==typeof i&&(o=i||{})),!n||!S(n))return;s=s||"[data-fancybox]";const a=Ae.openers.get(n)||new Map;a.set(s,o),Ae.openers.set(n,a),1===a.size&&n.addEventListener("click",Ae.fromEvent)}static unbind(t,e){let i,n="";if(be(t)?(i=document.body,n=t):(i=t,be(e)&&(n=e)),!i)return;const s=Ae.openers.get(i);s&&n&&s.delete(n),n&&s||(Ae.openers.delete(i),i.removeEventListener("click",Ae.fromEvent))}static destroy(){let t;for(;t=Ae.getInstance();)t.destroy();for(const t of Ae.openers.keys())t.removeEventListener("click",Ae.from
38Event);Ae.openers=new Map}static fromEvent(t){if(t.defaultPrevented)return;if(t.button&&0!==t.button)return;if(t.ctrlKey||t.metaKey||t.shiftKey)return;let e=t.composedPath()[0];const i=e.closest("[data-fancybox-trigger]");if(i){const t=i.dataset.fancyboxTrigger||"",n=document.querySelectorAll(`[data-fancybox="${t}"]`),s=parseInt(i.dataset.fancyboxIndex||"",10)||0;e=n[s]||e}if(!(e&&e instanceof Element))return;let n,s,o,a;if([...Ae.openers].reverse().find((([t,i])=>!(!t.contains(e)||![...i].reverse().find((([i,r])=>{let l=e.closest(i);return!!l&&(n=t,s=i,o=l,a=r,!0)}))))),!n||!s||!o)return;a=a||{},t.preventDefault(),e=o;let r=[],l=p({},rt,a);l.event=t,l.triggerEl=e,l.delegate=i;const c=l.groupAll,h=l.groupAttr,d=h&&e?e.getAttribute(`${h}`):"";if((!e||d||c)&&(r=[].slice.call(n.querySelectorAll(s))),e&&!c&&(r=d?r.filter((t=>t.getAttribute(`${h}`)===d)):[e]),!r.length)return;const u=Ae.getInstance();return u&&u.options.triggerEl&&r.indexOf(u.options.triggerEl)>-1?void 0:(e&&(l.startIndex=r.indexOf(e)),Ae.fromNodes(r,l))}static fromSelector(t,e,i){let n=null,s="",o={};if(be(t)?(n=document.body,s=t,"object"==typeof e&&(o=e||{})):t instanceof HTMLElement&&be(e)&&(n=t,s=e,"object"==typeof i&&(o=i||{})),!n||!s)return!1;const a=Ae.openers.get(n);return!!a&&(o=p({},a.get(s)||{},o),!!o&&Ae.fromNodes(Array.from(n.querySelectorAll(s)),o))}static fromNodes(t,e){e=p({},rt,e||{});const i=[];for(const n of t){const t=n.dataset||{},s=t[ve]||n.getAttribute(me)||n.getAttribute("currentSrc")||n.getAttribute(ve)||void 0;let o;const a=e.delegate;let r;a&&i.length===e.startIndex&&(o=a instanceof HTMLImageElement?a:a.querySelector("img:not([aria-hidden])")),o||(o=n instanceof HTMLImageElement?n:n.querySelector("img:not([aria-hidden])")),o&&(r=o.currentSrc||o[ve]||void 0,!r&&o.dataset&&(r=o.dataset.lazySrc||o.dataset[ve]||void 0));const l={src:s,triggerEl:n,thumbEl:o,thumbElSrc:r,thumbSrc:r};for(const e in t){let i=t[e]+"";i="false"!==i&&("true"===i||i),l[e]=i}i.push(l)}return new Ae(i,e)}static getInstance(t){if(t)return Me.get(t);return Array.from(Me.values()).reverse().find((t=>!t.isClosing()&&t))||null}static getSlide(){var t;return(null===(t=Ae.getInstance())||void 0===t?void 0:t.getSlide())||null}static show(t=[],e={}){return new Ae(t,e)}static next(){const t=Ae.getInstance();t&&t.next()}static prev(){const t=Ae.getInstance();t&&t.prev()}static close(t=!0,...e){if(t)for(const t of Me.values())t.close(...e);else{const t=Ae.getInstance();t&&t.close(...e)}}}Object.defineProperty(Ae,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.0.36"}),Object.defineProperty(Ae,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:rt}),Object.defineProperty(Ae,"Plugins",{enumerable:!0,configurable:!0,writable:!0,value:ee}),Object.defineProperty(Ae,"openers",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),t.Carousel=tt,t.Fancybox=Ae,t.Panzoom=D}));!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).window=t.window||{})}(this,(function(t){"use strict";const e=(t,e=1e4)=>(t=parseFloat(t+"")||0,Math.round((t+Number.EPSILON)*e)/e),i=function(t,e=void 0){return!(!t||t===document.body||e&&t===e)&&(function(t){if(!(t&&t instanceof Element&&t.offsetParent))return!1;const e=t.scrollHeight>t.clientHeight,i=window.getComputedStyle(t).overflowY,n=-1!==i.indexOf("hidden"),s=-1!==i.indexOf("visible");return e&&!n&&!s}(t)?t:i(t.parentElement,e))},n=function(t){var e=(new DOMParser).parseFromString(t,"text/html").body;if(e.childElementCount>1){for(var i=document.createElement("div");e.firstChild;)i.appendChild(e.firstChild);return i}return e.firstChild},s=t=>`${t||""}`.split(" ").filter((t=>!!t)),o=(t,e,i)=>{t&&s(e).forEach((e=>{t.classList.toggle(e,i||!1)}))};class a{constructor(t){Object.defineProperty(this,"pageX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pageY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"clientX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"clientY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"time",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"nativePointer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.nativePointer=t,this.pageX=t.pageX,this.pageY=t.pageY,this.clientX=t.clientX,this.clientY=t.clientY,this.id=self.Touch&&t instanceof Touch?t.identifier:-1,this.time=Date.now()}}const r={passive:!1};class l{constructor(t,{start:e=(()=>!0),move:i=(()=>{}),end:n=(()=>{})}){Object.defineProperty(this,"element",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"startCallback",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"moveCallback",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"endCallback",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"currentPointers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"startPointers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this.element=t,this.startCallback=e,this.moveCallback=i,this.endCallback=n;for(const t of["onPointerStart","onTouchStart","onMove","onTouchEnd","onPointerEnd","onWindowBlur"])this[t]=this[t].bind(this);this.element.addEventListener("mousedown",this.onPointerStart,r),this.element.addEventListener("touchstart",this.onTouchStart,r),this.element.addEventListener("touchmove",this.onMove,r),this.element.addEventListener("touchend",this.onTouchEnd),this.element.addEventListener("touchcancel",this.onTouchEnd)}onPointerStart(t){if(!t.buttons||0!==t.button)return;const e=new a(t);this.currentPointers.some((t=>
38t.id===e.id))||this.triggerPointerStart(e,t)&&(window.addEventListener("mousemove",this.onMove),window.addEventListener("mouseup",this.onPointerEnd),window.addEventListener("blur",this.onWindowBlur))}onTouchStart(t){for(const e of Array.from(t.changedTouches||[]))this.triggerPointerStart(new a(e),t);window.addEventListener("blur",this.onWindowBlur)}onMove(t){const e=this.currentPointers.slice(),i="changedTouches"in t?Array.from(t.changedTouches||[]).map((t=>new a(t))):[new a(t)],n=[];for(const t of i){const e=this.currentPointers.findIndex((e=>e.id===t.id));e<0||(n.push(t),this.currentPointers[e]=t)}n.length&&this.moveCallback(t,this.currentPointers.slice(),e)}onPointerEnd(t){t.buttons>0&&0!==t.button||(this.triggerPointerEnd(t,new a(t)),window.removeEventListener("mousemove",this.onMove),window.removeEventListener("mouseup",this.onPointerEnd),window.removeEventListener("blur",this.onWindowBlur))}onTouchEnd(t){for(const e of Array.from(t.changedTouches||[]))this.triggerPointerEnd(t,new a(e))}triggerPointerStart(t,e){return!!this.startCallback(e,t,this.currentPointers.slice())&&(this.currentPointers.push(t),this.startPointers.push(t),!0)}triggerPointerEnd(t,e){const i=this.currentPointers.findIndex((t=>t.id===e.id));i<0||(this.currentPointers.splice(i,1),this.startPointers.splice(i,1),this.endCallback(t,e,this.currentPointers.slice()))}onWindowBlur(){this.clear()}clear(){for(;this.currentPointers.length;){const t=this.currentPointers[this.currentPointers.length-1];this.currentPointers.splice(this.currentPointers.length-1,1),this.startPointers.splice(this.currentPointers.length-1,1),this.endCallback(new Event("touchend",{bubbles:!0,cancelable:!0,clientX:t.clientX,clientY:t.clientY}),t,this.currentPointers.slice())}}stop(){this.element.removeEventListener("mousedown",this.onPointerStart,r),this.element.removeEventListener("touchstart",this.onTouchStart,r),this.element.removeEventListener("touchmove",this.onMove,r),this.element.removeEventListener("touchend",this.onTouchEnd),this.element.removeEventListener("touchcancel",this.onTouchEnd),window.removeEventListener("mousemove",this.onMove),window.removeEventListener("mouseup",this.onPointerEnd),window.removeEventListener("blur",this.onWindowBlur)}}function h(t,e){return e?Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2)):0}function c(t,e){return e?{clientX:(t.clientX+e.clientX)/2,clientY:(t.clientY+e.clientY)/2}:t}const d=t=>"object"==typeof t&&null!==t&&t.constructor===Object&&"[object Object]"===Object.prototype.toString.call(t),u=(t,...e)=>{const i=e.length;for(let n=0;n<i;n++){const i=e[n]||{};Object.entries(i).forEach((([e,i])=>{const n=Array.isArray(i)?[]:{};t[e]||Object.assign(t,{[e]:n}),d(i)?Object.assign(t[e],u(n,i)):Array.isArray(i)?Object.assign(t,{[e]:[...i]}):Object.assign(t,{[e]:i})}))}return t},g=function(t,e){return t.split(".").reduce(((t,e)=>"object"==typeof t?t[e]:void 0),e)};class f{constructor(t={}){Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),this.setOptions(t);for(const t of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))t.startsWith("on")&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}setOptions(t){this.options=t?u({},this.constructor.defaults,t):{};for(const[t,e]of Object.entries(this.option("on")||{}))this.on(t,e)}option(t,...e){let i=g(t,this.options);return i&&"function"==typeof i&&(i=i.call(this,this,...e)),i}optionFor(t,e,i,...n){let s=g(e,t);var o;"string"!=typeof(o=s)||isNaN(o)||isNaN(parseFloat(o))||(s=parseFloat(s)),"true"===s&&(s=!0),"false"===s&&(s=!1),s&&"function"==typeof s&&(s=s.call(this,this,t,...n));let a=g(e,this.options);return a&&"function"==typeof a?s=a.call(this,this,t,...n,s):void 0===s&&(s=a),void 0===s?i:s}cn(t){const e=this.options.classes;return e&&e[t]||""}localize(t,e=[]){t=String(t).replace(/\{\{(\w+).?(\w+)?\}\}/g,((t,e,i)=>{let n="";return i?n=this.option(`${e[0]+e.toLowerCase().substring(1)}.l10n.${i}`):e&&(n=this.option(`l10n.${e}`)),n||(n=t),n}));for(let i=0;i<e.length;i++)t=t.split(e[i][0]).join(e[i][1]);return t=t.replace(/\{\{(.*?)\}\}/g,((t,e)=>e))}on(t,e){let i=[];"string"==typeof t?i=t.split(" "):Array.isArray(t)&&(i=t),this.events||(this.events=new Map),i.forEac
38h((t=>{let i=this.events.get(t);i||(this.events.set(t,[]),i=[]),i.includes(e)||i.push(e),this.events.set(t,i)}))}off(t,e){let i=[];"string"==typeof t?i=t.split(" "):Array.isArray(t)&&(i=t),i.forEach((t=>{const i=this.events.get(t);if(Array.isArray(i)){const t=i.indexOf(e);t>-1&&i.splice(t,1)}}))}emit(t,...e){[...this.events.get(t)||[]].forEach((t=>t(this,...e))),"*"!==t&&this.emit("*",t,...e)}}Object.defineProperty(f,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.0.33"}),Object.defineProperty(f,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{}});class p extends f{constructor(t={}){super(t),Object.defineProperty(this,"plugins",{enumerable:!0,configurable:!0,writable:!0,value:{}})}attachPlugins(t={}){const e=new Map;for(const[i,n]of Object.entries(t)){const t=this.option(i),s=this.plugins[i];s||!1===t?s&&!1===t&&(s.detach(),delete this.plugins[i]):e.set(i,new n(this,t||{}))}for(const[t,i]of e)this.plugins[t]=i,i.attach()}detachPlugins(t){t=t||Object.keys(this.plugins);for(const e of t){const t=this.plugins[e];t&&t.detach(),delete this.plugins[e]}return this.emit("detachPlugins"),this}}var m;!function(t){t[t.Init=0]="Init",t[t.Error=1]="Error",t[t.Ready=2]="Ready",t[t.Panning=3]="Panning",t[t.Mousemove=4]="Mousemove",t[t.Destroy=5]="Destroy"}(m||(m={}));const b=["a","b","c","d","e","f"],v={content:null,width:"auto",height:"auto",panMode:"drag",touch:!0,dragMinThreshold:3,lockAxis:!1,mouseMoveFactor:1,mouseMoveFriction:.12,zoom:!0,pinchToZoom:!0,panOnlyZoomed:"auto",minScale:1,maxScale:2,friction:.25,dragFriction:.35,decelFriction:.05,click:"toggleZoom",dblClick:!1,wheel:"zoom",wheelLimit:7,spinner:!0,bounds:"auto",infinite:!1,rubberband:!0,bounce:!0,maxVelocity:75,transformParent:!1,classes:{content:"f-panzoom__content",isLoading:"is-loading",canZoomIn:"can-zoom_in",canZoomOut:"can-zoom_out",isDraggable:"is-draggable",isDragging:"is-dragging",inFullscreen:"in-fullscreen",htmlHasFullscreen:"with-panzoom-in-fullscreen"},l10n:{PANUP:"Move up",PANDOWN:"Move down",PANLEFT:"Move left",PANRIGHT:"Move right",ZOOMIN:"Zoom in",ZOOMOUT:"Zoom out",TOGGLEZOOM:"Toggle zoom level",TOGGLE1TO1:"Toggle zoom level",ITERATEZOOM:"Toggle zoom level",ROTATECCW:"Rotate counterclockwise",ROTATECW:"Rotate clockwise",FLIPX:"Flip horizontally",FLIPY:"Flip vertically",FITX:"Fit horizontally",FITY:"Fit vertically",RESET:"Reset",TOGGLEFS:"Toggle fullscreen"}},y='<circle cx="25" cy="25" r="20"></circle>',w='<div class="f-spinner"><svg viewBox="0 0 50 50">'+y+y+"</svg></div>",x=t=>t&&null!==t&&t instanceof Element&&"nodeType"in t,P=(t,e)=>{t&&s(e).forEach((e=>{t.classList.remove(e)}))},T=(t,e)=>{t&&s(e).forEach((e=>{t.classList.add(e)}))},S={a:1,b:0,c:0,d:1,e:0,f:0},M=1e5,O=1e4,E="mousemove",k="drag",z="content";let L=null,D=null;class C extends p{get fits(){return this.contentRect.width-this.contentRect.fitWidth<1&&this.contentRect.height-this.contentRect.fitHeight<1}get isTouchDevice(){return null===D&&(D=window.matchMedia("(hover: none)").matches),D}get isMobile(){return null===L&&(L=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)),L}get panMode(){return this.options.panMode!==E||this.isTouchDevice?k:E}get panOnlyZoomed(){const t=this.options.panOnlyZoomed;return"auto"===t?this.isTouchDevice:t}get isInfinite(){return this.option("infinite")}get angle(){return 180*Math.atan2(this.current.b,this.current.a)/Math.PI||0}get targetAngle(){return 180*Math.atan2(this.target.b,this.target.a)/Math.PI||0}get scale(){const{a:t,b:e}=this.current;return Math.sqrt(t*t+e*e)||1}get targetScale(){const{a:t,b:e}=this.target;return Math.sqrt(t*t+e*e)||1}get minScale(){return this.option("minScale")||1}get fullScale(){const{contentRect:t}=this;return t.fullWidth/t.fitWidth||1}get maxScale(){return this.fullScale*(this.option("maxScale")||1)||1}get coverScale(){const{containerRect:t,contentRect:e}=this,i=Math.max(t.height/e.fitHeight,t.width/e.fitWidth)||1;return Math.min(this.fullScale,i)}get isScaling(){return Math.abs(this.targetScale-this.scale)>1e-5&&!this.isResting}get isContentLoading(){const t=this.content;return!!(t&&t instanceof HTMLImageElement)&&!t.complete}get isResting(){if(this.isBouncingX||this.isBouncingY)return!1;for(const t of b){const e="e"==t||"f"===t?1e-4:1e-5;
38if(Math.abs(this.target[t]-this.current[t])>e)return!1}return!(!this.ignoreBounds&&!this.checkBounds().inBounds)}constructor(t,e={},i={}){var s;if(super(e),Object.defineProperty(this,"pointerTracker",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"resizeObserver",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"updateTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"clickTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"rAF",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"isTicking",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"ignoreBounds",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isBouncingX",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isBouncingY",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"clicks",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"trackingPoints",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"pwt",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"cwd",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"pmme",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"friction",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:m.Init}),Object.defineProperty(this,"isDragging",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"content",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"spinner",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"containerRect",{enumerable:!0,configurable:!0,writable:!0,value:{width:0,height:0,innerWidth:0,innerHeight:0}}),Object.defineProperty(this,"contentRect",{enumerable:!0,configurable:!0,writable:!0,value:{top:0,right:0,bottom:0,left:0,fullWidth:0,fullHeight:0,fitWidth:0,fitHeight:0,width:0,height:0}}),Object.defineProperty(this,"dragStart",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0,top:0,left:0,time:0}}),Object.defineProperty(this,"dragOffset",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0,time:0}}),Object.defineProperty(this,"current",{enumerable:!0,configurable:!0,writable:!0,value:Object.assign({},S)}),Object.defineProperty(this,"target",{enumerable:!0,configurable:!0,writable:!0,value:Object.assign({},S)}),Object.defineProperty(this,"velocity",{enumerable:!0,configurable:!0,writable:!0,value:{a:0,b:0,c:0,d:0,e:0,f:0}}),Object.defineProperty(this,"lockedAxis",{enumerable:!0,configurable:!0,writable:!0,value:!1}),!t)throw new Error("Container Element Not Found");this.container=t,this.initContent(),this.attachPlugins(Object.assign(Object.assign({},C.Plugins),i)),this.emit("attachPlugins"),this.emit("init");const o=this.content;if(o.addEventListener("load",this.onLoad),o.addEventListener("error",this.onError),this.isContentLoading){if(this.option("spinner")){t.classList.add(this.cn("isLoading"));const e=n(w);!t.contains(o)||o.parentElement instanceof HTMLPictureElement?this.spinner=t.appendChild(e):this.spinner=(null===(s=o.parentElement)||void 0===s?void 0:s.insertBefore(e,o))||null}this.emit("beforeLoad")}else queueMicrotask((()=>{this.enable()}))}initContent(){const{container:t}=this,e=this.cn(z);let i=this.option(z)||t.querySelector(`.${e}`);if(i||(i=t.querySelector("img,picture")||t.firstElementChild,i&&T(i,e)),i instanceof HTMLPictureElement&&(i=i.querySelector("img")),!i)throw new Error("No content found");this.content=i}onLoad(){const{spinner:t,container:e,state:i}=this;t&&(t.remove(),this.spinner=null),this.option("spinner")&&e.classList.remove(this.cn("isLoading")),this.emit
38("afterLoad"),i===m.Init?this.enable():this.updateMetrics()}onError(){this.state!==m.Destroy&&(this.spinner&&(this.spinner.remove(),this.spinner=null),this.stop(),this.detachEvents(),this.state=m.Error,this.emit("error"))}getNextScale(t){const{fullScale:e,targetScale:i,coverScale:n,maxScale:s,minScale:o}=this;let a=o;switch(t){case"toggleMax":a=i-o<.5*(s-o)?s:o;break;case"toggleCover":a=i-o<.5*(n-o)?n:o;break;case"toggleZoom":a=i-o<.5*(e-o)?e:o;break;case"iterateZoom":let t=[1,e,s].sort(((t,e)=>t-e)),r=t.findIndex((t=>t>i+1e-5));a=t[r]||1}return a}attachObserver(){var t;const e=()=>{const{container:t,containerRect:e}=this;return Math.abs(e.width-t.getBoundingClientRect().width)>.1||Math.abs(e.height-t.getBoundingClientRect().height)>.1};this.resizeObserver||void 0===window.ResizeObserver||(this.resizeObserver=new ResizeObserver((()=>{this.updateTimer||(e()?(this.onResize(),this.isMobile&&(this.updateTimer=setTimeout((()=>{e()&&this.onResize(),this.updateTimer=null}),500))):this.updateTimer&&(clearTimeout(this.updateTimer),this.updateTimer=null))}))),null===(t=this.resizeObserver)||void 0===t||t.observe(this.container)}detachObserver(){var t;null===(t=this.resizeObserver)||void 0===t||t.disconnect()}attachEvents(){const{container:t}=this;t.addEventListener("click",this.onClick,{passive:!1,capture:!1}),t.addEventListener("wheel",this.onWheel,{passive:!1}),this.pointerTracker=new l(t,{start:this.onPointerDown,move:this.onPointerMove,end:this.onPointerUp}),document.addEventListener(E,this.onMouseMove)}detachEvents(){var t;const{container:e}=this;e.removeEventListener("click",this.onClick,{passive:!1,capture:!1}),e.removeEventListener("wheel",this.onWheel,{passive:!1}),null===(t=this.pointerTracker)||void 0===t||t.stop(),this.pointerTracker=null,document.removeEventListener(E,this.onMouseMove),document.removeEventListener("keydown",this.onKeydown,!0),this.clickTimer&&(clearTimeout(this.clickTimer),this.clickTimer=null),this.updateTimer&&(clearTimeout(this.updateTimer),this.updateTimer=null)}animate(){this.setTargetForce();const t=this.friction,e=this.option("maxVelocity");for(const i of b)t?(this.velocity[i]*=1-t,e&&!this.isScaling&&(this.velocity[i]=Math.max(Math.min(this.velocity[i],e),-1*e)),this.current[i]+=this.velocity[i]):this.current[i]=this.target[i];this.setTransform(),this.setEdgeForce(),!this.isResting||this.isDragging?this.rAF=requestAnimationFrame((()=>this.animate())):this.stop("current")}setTargetForce(){for(const t of b)"e"===t&&this.isBouncingX||"f"===t&&this.isBouncingY||(this.velocity[t]=(1/(1-this.friction)-1)*(this.target[t]-this.current[t]))}checkBounds(t=0,e=0){const{current:i}=this,n=i.e+t,s=i.f+e,o=this.getBounds(),{x:a,y:r}=o,l=a.min,h=a.max,c=r.min,d=r.max;let u=0,g=0;return l!==1/0&&n<l?u=l-n:h!==1/0&&n>h&&(u=h-n),c!==1/0&&s<c?g=c-s:d!==1/0&&s>d&&(g=d-s),Math.abs(u)<1e-4&&(u=0),Math.abs(g)<1e-4&&(g=0),Object.assign(Object.assign({},o),{xDiff:u,yDiff:g,inBounds:!u&&!g})}clampTargetBounds(){const{target:t}=this,{x:e,y:i}=this.getBounds();e.min!==1/0&&(t.e=Math.max(t.e,e.min)),e.max!==1/0&&(t.e=Math.min(t.e,e.max)),i.min!==1/0&&(t.f=Math.max(t.f,i.min)),i.max!==1/0&&(t.f=Math.min(t.f,i.max))}calculateContentDim(t=this.current){const{content:e,contentRect:i}=this,{fitWidth:n,fitHeight:s,fullWidth:o,fullHeight:a}=i;let r=o,l=a;if(this.option("zoom")||0!==this.angle){const i=!(e instanceof HTMLImageElement)&&("none"===window.getComputedStyle(e).maxWidth||"none"===window.getComputedStyle(e).maxHeight),h=i?o:n,c=i?a:s,d=this.getMatrix(t),u=new DOMPoint(0,0).matrixTransform(d),g=new DOMPoint(0+h,0).matrixTransform(d),f=new DOMPoint(0+h,0+c).matrixTransform(d),p=new DOMPoint(0,0+c).matrixTransform(d),m=Math.abs(f.x-u.x),b=Math.abs(f.y-u.y),v=Math.abs(p.x-g.x),y=Math.abs(p.y-g.y);r=Math.max(m,v),l=Math.max(b,y)}return{contentWidth:r,contentHeight:l}}setEdgeForce(){if(this.ignoreBounds||this.isDragging||this.panMode===E||this.targetScale<this.scale)return this.isBouncingX=!1,void(this.isBouncingY=!1);const{target:t}=this,{x:e,y:i,xDiff:n,yDiff:s}=this.checkBounds();const o=this.option("maxVelocity");let a=this.velocity.e,r=this.velocity.f;0!==n?(this.isBouncingX=!0,n*a<=0?a+=.14*n:(a=.14*n,e.min!==1/0&&(this.target.e=Math.max(t.e,e.min)),e.max!==1/0&&(this.target.e=Math.min(t.e,e.max))),o&&(a=Math.max(Math.min(a,o),-1*o))):this.isBouncingX=!1,0!==s?(this.isBouncingY=!0,s*r<=0?r+=.14*s:(r=.14*s,i.min!==1/0&&(this.target.f=Math.max(t.f,i.min)),i.max!==1/0&&(this.target.f=Math.min(t.f,i.max))),o&&(r=Math.max(Math.min(r,o),-1*o))):this.isBouncingY=!1,this.isBouncingX&&(this.velocity.e=a
38),this.isBouncingY&&(this.velocity.f=r)}enable(){const{content:t}=this,e=new DOMMatrixReadOnly(window.getComputedStyle(t).transform);for(const t of b)this.current[t]=this.target[t]=e[t];this.updateMetrics(),this.attachObserver(),this.attachEvents(),this.state=m.Ready,this.emit("ready")}onClick(t){var e;"click"===t.type&&0===t.detail&&(this.dragOffset.x=0,this.dragOffset.y=0),this.isDragging&&(null===(e=this.pointerTracker)||void 0===e||e.clear(),this.trackingPoints=[],this.startDecelAnim());const i=t.target;if(!i||t.defaultPrevented)return;if(i.hasAttribute("disabled"))return t.preventDefault(),void t.stopPropagation();if((()=>{const t=window.getSelection();return t&&"Range"===t.type})()&&!i.closest("button"))return;const n=i.closest("[data-panzoom-action]"),s=i.closest("[data-panzoom-change]"),o=n||s,a=o&&x(o)?o.dataset:null;if(a){const e=a.panzoomChange,i=a.panzoomAction;if((e||i)&&t.preventDefault(),e){let t={};try{t=JSON.parse(e)}catch(t){console&&console.warn("The given data was not valid JSON")}return void this.applyChange(t)}if(i)return void(this[i]&&this[i]())}if(Math.abs(this.dragOffset.x)>3||Math.abs(this.dragOffset.y)>3)return t.preventDefault(),void t.stopPropagation();if(i.closest("[data-fancybox]"))return;const r=this.content.getBoundingClientRect(),l=this.dragStart;if(l.time&&!this.canZoomOut()&&(Math.abs(r.x-l.x)>2||Math.abs(r.y-l.y)>2))return;this.dragStart.time=0;const h=e=>{this.option("zoom",t)&&e&&"string"==typeof e&&/(iterateZoom)|(toggle(Zoom|Full|Cover|Max)|(zoomTo(Fit|Cover|Max)))/.test(e)&&"function"==typeof this[e]&&(t.preventDefault(),this[e]({event:t}))},c=this.option("click",t),d=this.option("dblClick",t);d?(this.clicks++,1==this.clicks&&(this.clickTimer=setTimeout((()=>{1===this.clicks?(this.emit("click",t),!t.defaultPrevented&&c&&h(c)):(this.emit("dblClick",t),t.defaultPrevented||h(d)),this.clicks=0,this.clickTimer=null}),350))):(this.emit("click",t),!t.defaultPrevented&&c&&h(c))}addTrackingPoint(t){const e=this.trackingPoints.filter((t=>t.time>Date.now()-100));e.push(t),this.trackingPoints=e}onPointerDown(t,e,i){var n;if(!1===this.option("touch",t))return!1;this.pwt=0,this.dragOffset={x:0,y:0,time:0},this.trackingPoints=[];const s=this.content.getBoundingClientRect();if(this.dragStart={x:s.x,y:s.y,top:s.top,left:s.left,time:Date.now()},this.clickTimer)return!1;if(this.panMode===E&&this.targetScale>1)return t.preventDefault(),t.stopPropagation(),!1;const o=t.composedPath()[0];if(!i.length){if(["TEXTAREA","OPTION","INPUT","SELECT","VIDEO","IFRAME"].includes(o.nodeName)||o.closest("[contenteditable],[data-selectable],[data-draggable],[data-clickable],[data-panzoom-change],[data-panzoom-action]"))return!1;null===(n=window.getSelection())||void 0===n||n.removeAllRanges()}if("mousedown"===t.type)["A","BUTTON"].includes(o.nodeName)||t.preventDefault();else if(Math.abs(this.velocity.a)>.3)return!1;return this.target.e=this.current.e,this.target.f=this.current.f,this.stop(),this.isDragging||(this.isDragging=!0,this.addTrackingPoint(e),this.emit("touchStart",t)),!0}onPointerMove(t,n,s){if(!1===this.option("touch",t))return;if(!this.isDragging)return;if(n.length<2&&this.panOnlyZoomed&&e(this.targetScale)<=e(this.minScale))return;if(this.emit("touchMove",t),t.defaultPrevented)return;this.addTrackingPoint(n[0]);const{content:o}=this,a=c(s[0],s[1]),r=c(n[0],n[1]);let l=0,d=0;if(n.length>1){const t=o.getBoundingClientRect();l=a.clientX-t.left-.5*t.width,d=a.clientY-t.top-.5*t.height}const u=h(s[0],s[1]),g=h(n[0],n[1]);let f=u?g/u:1,p=r.clientX-a.clientX,m=r.clientY-a.clientY;this.dragOffset.x+=p,this.dragOffset.y+=m,this.dragOffset.time=Date.now()-this.dragStart.time;let b=e(this.targetScale)===e(this.minScale)&&this.option("lockAxis");if(b&&!this.lockedAxis)if("xy"===b||"y"===b||"touchmove"===t.type){if(Math.abs(this.dragOffset.x)<6&&Math.abs(this.dragOffset.y)<6)return void t.preventDefault();const e=Math.abs(180*Math.atan2(this.dragOffset.y,this.dragOffset.x)/Math.PI);this.lockedAxis=e>45&&e<135?"y":"x",this.dragOffset.x=0,this.dragOffset.y=0,p=0,m=0}else this.lockedAxis=b;if(i(t.target,this.content)&&(b="x",this.dragOffset.y=0),b&&"xy"!==b&&this.lockedAxis!==b&&e(this.targetScale)===e(this.minScale))return;t.cancelable&&t.preventDefault(),this.container.classList.add(this.cn("isDragging"));const v=this.checkBounds(p,m);this.option("rubberband")?("x"!==this.isInfinite&&(v.xDiff>0&&p<0||v.xDiff<0&&p>0)&&(p*=Math.max(0,.5-Math.abs(.75/this.contentRect.fitWidth*v.xDiff))),"y"!==this.isInfinite&&(v.yDiff>0&&m<0||v.yDiff<0&&m>0)&&(m*=Math.max(0,.5-Math.abs(.75/this.contentRect.fitHeight*v.yDiff)))):(v.xDiff&&(p=0),v.yDiff&&(m=0));const y=this.targetScale,w=this.minScale,x=this.maxScale;y<.5*w&&(f=Math.max(f,w)),y>
381.5*x&&(f=Math.min(f,x)),"y"===this.lockedAxis&&e(y)===e(w)&&(p=0),"x"===this.lockedAxis&&e(y)===e(w)&&(m=0),this.applyChange({originX:l,originY:d,panX:p,panY:m,scale:f,friction:this.option("dragFriction"),ignoreBounds:!0})}onPointerUp(t,e,n){if(n.length)return this.dragOffset.x=0,this.dragOffset.y=0,void(this.trackingPoints=[]);this.container.classList.remove(this.cn("isDragging")),this.isDragging&&(this.addTrackingPoint(e),this.panOnlyZoomed&&this.contentRect.width-this.contentRect.fitWidth<1&&this.contentRect.height-this.contentRect.fitHeight<1&&(this.trackingPoints=[]),i(t.target,this.content)&&"y"===this.lockedAxis&&(this.trackingPoints=[]),this.emit("touchEnd",t),this.isDragging=!1,this.lockedAxis=!1,this.state!==m.Destroy&&(t.defaultPrevented||this.startDecelAnim()))}startDecelAnim(){var t;const i=this.isScaling;this.rAF&&(cancelAnimationFrame(this.rAF),this.rAF=null),this.isBouncingX=!1,this.isBouncingY=!1;for(const t of b)this.velocity[t]=0;this.target.e=this.current.e,this.target.f=this.current.f,P(this.container,"is-scaling"),P(this.container,"is-animating"),this.isTicking=!1;const{trackingPoints:n}=this,s=n[0],o=n[n.length-1];let a=0,r=0,l=0;o&&s&&(a=o.clientX-s.clientX,r=o.clientY-s.clientY,l=o.time-s.time);const h=(null===(t=window.visualViewport)||void 0===t?void 0:t.scale)||1;1!==h&&(a*=h,r*=h);let c=0,d=0,u=0,g=0,f=this.option("decelFriction");const p=this.targetScale;if(l>0){u=Math.abs(a)>3?a/(l/30):0,g=Math.abs(r)>3?r/(l/30):0;const t=this.option("maxVelocity");t&&(u=Math.max(Math.min(u,t),-1*t),g=Math.max(Math.min(g,t),-1*t))}u&&(c=u/(1/(1-f)-1)),g&&(d=g/(1/(1-f)-1)),("y"===this.option("lockAxis")||"xy"===this.option("lockAxis")&&"y"===this.lockedAxis&&e(p)===this.minScale)&&(c=u=0),("x"===this.option("lockAxis")||"xy"===this.option("lockAxis")&&"x"===this.lockedAxis&&e(p)===this.minScale)&&(d=g=0);const m=this.dragOffset.x,v=this.dragOffset.y,y=this.option("dragMinThreshold")||0;Math.abs(m)<y&&Math.abs(v)<y&&(c=d=0,u=g=0),(this.option("zoom")&&(p<this.minScale-1e-5||p>this.maxScale+1e-5)||i&&!c&&!d)&&(f=.35),this.applyChange({panX:c,panY:d,friction:f}),this.emit("decel",u,g,m,v)}onWheel(t){var e=[-t.deltaX||0,-t.deltaY||0,-t.detail||0].reduce((function(t,e){return Math.abs(e)>Math.abs(t)?e:t}));const i=Math.max(-1,Math.min(1,e));if(this.emit("wheel",t,i),this.panMode===E)return;if(t.defaultPrevented)return;const n=this.option("wheel");"pan"===n?(t.preventDefault(),this.panOnlyZoomed&&!this.canZoomOut()||this.applyChange({panX:2*-t.deltaX,panY:2*-t.deltaY,bounce:!1})):"zoom"===n&&!1!==this.option("zoom")&&this.zoomWithWheel(t)}onMouseMove(t){this.panWithMouse(t)}onKeydown(t){"Escape"===t.key&&this.toggleFS()}onResize(){this.updateMetrics(),this.checkBounds().inBounds||this.requestTick()}setTransform(){this.emit("beforeTransform");const{current:t,target:i,content:n,contentRect:s}=this,o=Object.assign({},S);for(const n of b){const s="e"==n||"f"===n?O:M;o[n]=e(t[n],s),Math.abs(i[n]-t[n])<("e"==n||"f"===n?.51:.001)&&(t[n]=i[n])}let{a:a,b:r,c:l,d:h,e:c,f:d}=o,u=`matrix(${a}, ${r}, ${l}, ${h}, ${c}, ${d})`,g=n.parentElement instanceof HTMLPictureElement?n.parentElement:n;if(this.option("transformParent")&&(g=g.parentElement||g),g.style.transform===u)return;g.style.transform=u;const{contentWidth:f,contentHeight:p}=this.calculateContentDim();s.width=f,s.height=p,this.emit("afterTransform")}updateMetrics(t=!1){var i;if(!this||this.state===m.Destroy)return;if(this.isContentLoading)return;const n=Math.max(1,(null===(i=window.visualViewport)||void 0===i?void 0:i.scale)||1),{container:s,content:o}=this,a=o instanceof HTMLImageElement,r=s.getBoundingClientRect(),l=getComputedStyle(this.container);let h=r.width*n,c=r.height*n;const d=parseFloat(l.paddingTop)+parseFloat(l.paddingBottom),u=h-(parseFloat(l.paddingLeft)+parseFloat(l.paddingRight)),g=c-d;this.containerRect={width:h,height:c,innerWidth:u,innerHeight:g};let f=this.option("width")||"auto",p=this.option("height")||"auto";"auto"===f&&(f=parseFloat(o.dataset.width||"")||(t=>{let e=0;return e=t instanceof HTMLImageElement?t.naturalWidth:t instanceof SVGElement?t.width.baseVal.value:Math.max(t.offsetWidth,t.scrollWidth),e||0})(o)),"auto"===p&&(p=parseFloat(o.dataset.height||"")||(t=>{let e=0;return e=t instanceof HTMLImageElement?t.naturalHeight:t instanceof SVGElement?t.height.baseVal.value:Math.max(t.offsetHeight,t.scrollHeight),e||0})(o));let b=o.parentElement instanceof HTMLPictureElement?o.parentElement:o;this.option("transformParent")&&(b=b.parentElement||b);const v=b.getAttribute("style")||"";b.style.setProperty("transform","none","important"),a&&(b.style.width="",b.style.height=""),b.offsetHeight;const y=o.getBoundingClientRect();let w=y.width*n,x=y.height*n,P=0,T=0;a&&(Math.abs(f-w)>1||Math.abs(p-x)>1)&&({width:w,height:x,top:P,left:T}=((t,e,i,n)=>{const s=i/n;return s>t/e?(i=t,n=t/s):(i=e*s,n=e),{width:i,height:n,top:.5*(e-n),left:.5*(t-i)}})(w,x,f,p)),this.contentRect=Object.assign(Object.assign({},this.contentRect),{top:y.top-r.top+P,bottom:r.bottom-y.bottom+P,left:y.left-r.left+T,right:r.right-y.right+T,fitWidth:w,fitHeight:x,width:w,height:x,fullWidth:f,fullHeight:p}),b.style.cssText=v,a&&(b.style.width=`${w}px`,b.style.height=`${x}
38px`),this.setTransform(),!0!==t&&this.emit("refresh"),this.ignoreBounds||(e(this.targetScale)<e(this.minScale)?this.zoomTo(this.minScale,{friction:0}):this.targetScale>this.maxScale?this.zoomTo(this.maxScale,{friction:0}):this.state===m.Init||this.checkBounds().inBounds||this.requestTick()),this.updateControls()}calculateBounds(){const{contentWidth:t,contentHeight:i}=this.calculateContentDim(this.target),{targetScale:n,lockedAxis:s}=this,{fitWidth:o,fitHeight:a}=this.contentRect;let r=0,l=0,h=0,c=0;const d=this.option("infinite");if(!0===d||s&&d===s)r=-1/0,h=1/0,l=-1/0,c=1/0;else{let{containerRect:s,contentRect:d}=this,u=e(o*n,O),g=e(a*n,O),{innerWidth:f,innerHeight:p}=s;if(s.width===u&&(f=s.width),s.width===g&&(p=s.height),t>f){h=.5*(t-f),r=-1*h;let e=.5*(d.right-d.left);r+=e,h+=e}if(o>f&&t<f&&(r-=.5*(o-f),h-=.5*(o-f)),i>p){c=.5*(i-p),l=-1*c;let t=.5*(d.bottom-d.top);l+=t,c+=t}a>p&&i<p&&(r-=.5*(a-p),h-=.5*(a-p))}return{x:{min:r,max:h},y:{min:l,max:c}}}getBounds(){const t=this.option("bounds");return"auto"!==t?t:this.calculateBounds()}updateControls(){const t=this,i=t.container,{panMode:n,contentRect:s,targetScale:a,minScale:r}=t;let l=r,h=t.option("click")||!1;h&&(l=t.getNextScale(h));let c=t.canZoomIn(),d=t.canZoomOut(),u=n===k&&!!this.option("touch"),g=d&&u;if(u&&(e(a)<e(r)&&!this.panOnlyZoomed&&(g=!0),(e(s.width,1)>e(s.fitWidth,1)||e(s.height,1)>e(s.fitHeight,1))&&(g=!0)),e(s.width*a,1)<e(s.fitWidth,1)&&(g=!1),n===E&&(g=!1),o(i,this.cn("isDraggable"),g),!this.option("zoom"))return;let f=c&&e(l)>e(a),p=!f&&!g&&d&&e(l)<e(a);o(i,this.cn("canZoomIn"),f),o(i,this.cn("canZoomOut"),p);for(const t of i.querySelectorAll("[data-panzoom-action]")){let e=!1,i=!1;switch(t.dataset.panzoomAction){case"zoomIn":c?e=!0:i=!0;break;case"zoomOut":d?e=!0:i=!0;break;case"toggleZoom":case"iterateZoom":c||d?e=!0:i=!0;const n=t.querySelector("g");n&&(n.style.display=c?"":"none")}e?(t.removeAttribute("disabled"),t.removeAttribute("tabindex")):i&&(t.setAttribute("disabled",""),t.setAttribute("tabindex","-1"))}}panTo({x:t=this.target.e,y:e=this.target.f,scale:i=this.targetScale,friction:n=this.option("friction"),angle:s=0,originX:o=0,originY:a=0,flipX:r=!1,flipY:l=!1,ignoreBounds:h=!1}){this.state!==m.Destroy&&this.applyChange({panX:t-this.target.e,panY:e-this.target.f,scale:i/this.targetScale,angle:s,originX:o,originY:a,friction:n,flipX:r,flipY:l,ignoreBounds:h})}applyChange({panX:t=0,panY:i=0,scale:n=1,angle:s=0,originX:o=-this.current.e,originY:a=-this.current.f,friction:r=this.option("friction"),flipX:l=!1,flipY:h=!1,ignoreBounds:c=!1,bounce:d=this.option("bounce")}){const u=this.state;if(u===m.Destroy)return;this.rAF&&(cancelAnimationFrame(this.rAF),this.rAF=null),this.friction=r||0,this.ignoreBounds=c;const{current:g}=this,f=g.e,p=g.f,v=this.getMatrix(this.target);let y=(new DOMMatrix).translate(f,p).translate(o,a).translate(t,i);if(this.option("zoom")){if(!c){const t=this.targetScale,e=this.minScale,i=this.maxScale;t*n<e&&(n=e/t),t*n>i&&(n=i/t)}y=y.scale(n)}y=y.translate(-o,-a).translate(-f,-p).multiply(v),s&&(y=y.rotate(s)),l&&(y=y.scale(-1,1)),h&&(y=y.scale(1,-1));for(const t of b)"e"!==t&&"f"!==t&&(y[t]>this.minScale+1e-5||y[t]<this.minScale-1e-5)?this.target[t]=y[t]:this.target[t]=e(y[t],O);(this.targetScale<this.scale||Math.abs(n-1)>.1||this.panMode===E||!1===d)&&!c&&this.clampTargetBounds(),u===m.Init?this.animate():this.isResting||(this.state=m.Panning,this.requestTick())}stop(t=!1){if(this.state===m.Init||this.state===m.Destroy)return;const e=this.isTicking;this.rAF&&(cancelAnimationFrame(this.rAF),this.rAF=null),this.isBouncingX=!1,this.isBouncingY=!1;for(const e of b)this.velocity[e]=0,"current"===t?this.current[e]=this.target[e]:"target"===t&&(this.target[e]=this.current[e]);this.setTransform(),P(this.container,"is-scaling"),P(this.container,"is-animating"),this.isTicking=!1,this.state=m.Ready,e&&(this.emit
38("endAnimation"),this.updateControls())}requestTick(){this.isTicking||(this.emit("startAnimation"),this.updateControls(),T(this.container,"is-animating"),this.isScaling&&T(this.container,"is-scaling")),this.isTicking=!0,this.rAF||(this.rAF=requestAnimationFrame((()=>this.animate())))}panWithMouse(t,i=this.option("mouseMoveFriction")){if(this.pmme=t,this.panMode!==E||!t)return;if(e(this.targetScale)<=e(this.minScale))return;this.emit("mouseMove",t);const{container:n,containerRect:s,contentRect:o}=this,a=s.width,r=s.height,l=n.getBoundingClientRect(),h=(t.clientX||0)-l.left,c=(t.clientY||0)-l.top;let{contentWidth:d,contentHeight:u}=this.calculateContentDim(this.target);const g=this.option("mouseMoveFactor");g>1&&(d!==a&&(d*=g),u!==r&&(u*=g));let f=.5*(d-a)-h/a*100/100*(d-a);f+=.5*(o.right-o.left);let p=.5*(u-r)-c/r*100/100*(u-r);p+=.5*(o.bottom-o.top),this.applyChange({panX:f-this.target.e,panY:p-this.target.f,friction:i})}zoomWithWheel(t){if(this.state===m.Destroy||this.state===m.Init)return;const i=Date.now();if(i-this.pwt<45)return void t.preventDefault();this.pwt=i;var n=[-t.deltaX||0,-t.deltaY||0,-t.detail||0].reduce((function(t,e){return Math.abs(e)>Math.abs(t)?e:t}));const s=Math.max(-1,Math.min(1,n)),{targetScale:o,maxScale:a,minScale:r}=this;let l=o*(100+45*s)/100;e(l)<e(r)&&e(o)<=e(r)?(this.cwd+=Math.abs(s),l=r):e(l)>e(a)&&e(o)>=e(a)?(this.cwd+=Math.abs(s),l=a):(this.cwd=0,l=Math.max(Math.min(l,a),r)),this.cwd>this.option("wheelLimit")||(t.preventDefault(),e(l)!==e(o)&&this.zoomTo(l,{event:t}))}canZoomIn(){return this.option("zoom")&&(e(this.contentRect.width,1)<e(this.contentRect.fitWidth,1)||e(this.targetScale)<e(this.maxScale))}canZoomOut(){return this.option("zoom")&&e(this.targetScale)>e(this.minScale)}zoomIn(t=1.25,e){this.zoomTo(this.targetScale*t,e)}zoomOut(t=.8,e){this.zoomTo(this.targetScale*t,e)}zoomToFit(t){this.zoomTo("fit",t)}zoomToCover(t){this.zoomTo("cover",t)}zoomToFull(t){this.zoomTo("full",t)}zoomToMax(t){this.zoomTo("max",t)}toggleZoom(t){this.zoomTo(this.getNextScale("toggleZoom"),t)}toggleMax(t){this.zoomTo(this.getNextScale("toggleMax"),t)}toggleCover(t){this.zoomTo(this.getNextScale("toggleCover"),t)}iterateZoom(t){this.zoomTo("next",t)}zoomTo(t=1,{friction:e="auto",originX:i="auto",originY:n="auto",event:s}={}){if(this.isContentLoading||this.state===m.Destroy)return;const{targetScale:o,fullScale:a,maxScale:r,coverScale:l}=this;if(this.stop(),this.panMode===E&&(s=this.pmme||s),s||"auto"===i||"auto"===n){const t=this.content.getBoundingClientRect(),e=this.container.getBoundingClientRect(),o=s?s.clientX:e.left+.5*e.width,a=s?s.clientY:e.top+.5*e.height;i=o-t.left-.5*t.width,n=a-t.top-.5*t.height}let h=1;"number"==typeof t?h=t:"full"===t?h=a:"cover"===t?h=l:"max"===t?h=r:"fit"===t?h=1:"next"===t&&(h=this.getNextScale("iterateZoom")),h=h/o||1,e="auto"===e?h>1?.15:.25:e,this.applyChange({scale:h,originX:i,originY:n,friction:e}),s&&this.panMode===E&&this.panWithMouse(s,e)}rotateCCW(){this.applyChange({angle:-90})}rotateCW(){this.applyChange({angle:90})}flipX(){this.applyChange({flipX:!0})}flipY(){this.applyChange({flipY:!0})}fitX(){this.stop("target");const{containerRect:t,contentRect:e,target:i}=this;this.applyChange({panX:.5*t.width-(e.left+.5*e.fitWidth)-i.e,panY:.5*t.height-(e.top+.5*e.fitHeight)-i.f,scale:t.width/e.fitWidth/this.targetScale,originX:0,originY:0,ignoreBounds:!0})}fitY(){this.stop("target");const{containerRect:t,contentRect:e,target:i}=this;this.applyChange({panX:.5*t.width-(e.left+.5*e.fitWidth)-i.e,panY:.5*t.innerHeight-(e.top+.5*e.fitHeight)-i.f,scale:t.height/e.fitHeight/this.targetScale,originX:0,originY:0,ignoreBounds:!0})}toggleFS(){const{container:t}=this,e=this.cn("inFullscreen"),i=this.cn("htmlHasFullscreen");t.classList.toggle(e);const n=t.classList.contains(e);n?(document.documentElement.classList.add(i),document.addEventListener("keydown",this.onKeydown,!0)):(document.documentElement.classList.remove(i),document.removeEventListener("keydown",this.onKeydown,!0)),this.updateMetrics(),this.emit(n?"enterFS":"exitFS")}getMatrix(t=this.current){const{a:e,b:i,c:n,d:s,e:o,f:a}=t;return new DOMMatrix([e,i,n,s,o,a])}reset(t){if(this.state!==m.Init&&this.state!==m.Destroy){this.stop("current");for(const t of b)this.target[t]=S[t];this.target.a=this.minScale,this.target.d=this.minScale,this.clampTargetBounds(),this.isResting||(this.friction=void 0===t?this.option("friction"):t,this.state=m.Panning,this.requestTick())}}destroy(){this.stop(),this.state=m.Destroy,this.detachEvents(),this.detachObserver();const{container:t,content:e}=this,i=this.option("classes")||{};for(const e of Object.values(i))t.classList.remove(e+"");e&&(e.removeEventListener("load",this.onLoad),e.removeEventListener("error",this.onError)),this.detachPlugins()}}Object.defineProperty(C,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:v}),Object.defineProperty(C,"Plugins",{enumerable:!0,configurable:!0,writable:!0,value:{}});const R=function(t,e){let i=!0;return(...n)=>{i&&(i=!1,t(...n),setTimeout((()=>{i=!0}),e))}},A=(t,e)=>{let i=[];
38return t.childNodes.forEach((t=>{t.nodeType!==Node.ELEMENT_NODE||e&&!t.matches(e)||i.push(t)})),i},j={viewport:null,track:null,enabled:!0,slides:[],axis:"x",transition:"fade",preload:1,slidesPerPage:"auto",initialPage:0,friction:.12,Panzoom:{decelFriction:.12},center:!0,infinite:!0,fill:!0,dragFree:!1,adaptiveHeight:!1,direction:"ltr",classes:{container:"f-carousel",viewport:"f-carousel__viewport",track:"f-carousel__track",slide:"f-carousel__slide",isLTR:"is-ltr",isRTL:"is-rtl",isHorizontal:"is-horizontal",isVertical:"is-vertical",inTransition:"in-transition",isSelected:"is-selected"},l10n:{NEXT:"Next slide",PREV:"Previous slide",GOTO:"Go to slide #%d"}};var F;!function(t){t[t.Init=0]="Init",t[t.Ready=1]="Ready",t[t.Destroy=2]="Destroy"}(F||(F={}));const I=t=>{if("string"==typeof t||t instanceof HTMLElement)t={html:t};else{const e=t.thumb;void 0!==e&&("string"==typeof e&&(t.thumbSrc=e),e instanceof HTMLImageElement&&(t.thumbEl=e,t.thumbElSrc=e.src,t.thumbSrc=e.src),delete t.thumb)}return Object.assign({html:"",el:null,isDom:!1,class:"",customClass:"",index:-1,dim:0,gap:0,pos:0,transition:!1},t)},B=(t={})=>Object.assign({index:-1,slides:[],dim:0,pos:-1},t);class H extends f{constructor(t,e){super(e),Object.defineProperty(this,"instance",{enumerable:!0,configurable:!0,writable:!0,value:t})}attach(){}detach(){}}const N={classes:{list:"f-carousel__dots",isDynamic:"is-dynamic",hasDots:"has-dots",dot:"f-carousel__dot",isBeforePrev:"is-before-prev",isPrev:"is-prev",isCurrent:"is-current",isNext:"is-next",isAfterNext:"is-after-next"},dotTpl:'<button type="button" data-carousel-page="%i" aria-label="{{GOTO}}"><span class="f-carousel__dot" aria-hidden="true"></span></button>',dynamicFrom:11,maxCount:1/0,minCount:2};class X extends H{constructor(){super(...arguments),Object.defineProperty(this,"isDynamic",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"list",{enumerable:!0,configurable:!0,writable:!0,value:null})}onRefresh(){this.refresh()}build(){let t=this.list;if(!t){t=document.createElement("ul"),T(t,this.cn("list")),t.setAttribute("role","tablist");const e=this.instance.container;e.appendChild(t),T(e,this.cn("hasDots")),this.list=t}return t}refresh(){var t;const e=this.instance.pages.length,i=Math.min(2,this.option("minCount")),n=Math.max(2e3,this.option("maxCount")),s=this.option("dynamicFrom");if(e<i||e>n)return void this.cleanup();const a="number"==typeof s&&e>5&&e>=s,r=!this.list||this.isDynamic!==a||this.list.children.length!==e;r&&this.cleanup();const l=this.build();if(o(l,this.cn("isDynamic"),!!a),r)for(let t=0;t<e;t++)l.append(this.createItem(t));let h,c=0;for(const e of[...l.children]){const i=c===this.instance.page;i&&(h=e),o(e,this.cn("isCurrent"),i),null===(t=e.children[0])||void 0===t||t.setAttribute("aria-selected",i?"true":"false");for(const t of["isBeforePrev","isPrev","isNext","isAfterNext"])P(e,this.cn(t));c++}if(h=h||l.firstChild,a&&h){const t=h.previousElementSibling,e=t&&t.previousElementSibling;T(t,this.cn("isPrev")),T(e,this.cn("isBeforePrev"));const i=h.nextElementSibling,n=i&&i.nextElementSibling;T(i,this.cn("isNext")),T(n,this.cn("isAfterNext"))}this.isDynamic=a}createItem(t=0){var e;const i=document.createElement("li");i.setAttribute("role","presentation");const s=n(this.instance.localize(this.option("dotTpl"),[["%d",t+1]]).replace(/\%i/g,t+""));return i.appendChild(s),null===(e=i.children[0])||void 0===e||e.setAttribute("role","tab"),i}cleanup(){this.list&&(this.list.remove(),this.list=null),this.isDynamic=!1,P(this.instance.container,this.cn("hasDots"))}attach(){this.instance.on(["refresh","change"],this.onRefresh)}detach(){this.instance.off(["refresh","change"],this.onRefresh),this.cleanup()}}Object.defineProperty(X,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:N});const W="disabled",Y="next",$="prev";class Z extends H{constructor(){super(...arguments),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"prev",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"next",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"isDom",{enumerable:!0,configurable:!0,writable:!0,value:!1})}onRefresh(){const t=this.instance,e=t.pages.length,i=t.page;if(e<2)return void this.cleanup();this.build();let n=this.prev,s=this.next;n&&s&&(n.removeAttribute(W),s.removeAttribute(W),t.isInfinite||(i<=0&&n.setAttribute(W,""),i>=e-1&&s.setAttribute(W,"")))}addBtn(t){var e;const i=this.instance,n=document.createElement("button");n.setAttribute("tabindex","0"),n.setAttribute("title",i.localize(`{{${t.toUpperCase()}}}`)),T(n,this.cn("button")+" "+this.cn(t===Y?"isNext":"isPrev"));const s=i.isRTL?t===Y?$:Y:t;var o;return n.innerHTML=i.localize(this.option(`${s}Tpl`)),n.dataset[`carousel${o=t,o?o.match("^[a-z]")?o.charAt(0).toUpperCase()+o.substring(1):o:""}`]="true",null===(e=this.container)||void 0===e||e.appendChild(n),n}build(){const t=this.instance.container,e=this.cn("container");let{container:i,prev:n,next:s}=this;i||(i=t.querySelector("."+e),this.isDom=!!i),i||(i=document.createElement("div"),T(i,e),t.appendChild(i)),this.container=i,s||(s=i.querySelector("[data-carousel-next]")),s||(s=this.addBtn(Y)),this.next=s,n||(n=i.querySelector("[data-carousel-prev]")),n||(n=this.addBtn($)),this.prev=n}cleanup(){this.isDom||(this.prev&&this.prev.remove(),this.next&&this.next.remove(),this.container&&this.container.remove()),this.prev=null,this.next=null,this.container=null,this.isDom=!1}attach(){this.instance.on(["refresh","change"],this.onRefresh)}detach(){this.instance.off(["refresh","change"],this.onRefresh),this.cleanup()}}Object.defineProperty(Z,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{classes:{container:"f-carousel__nav",button:"f-button",isNext:"is-next",isPrev:"is-prev"},nextTpl:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M9 3l9 9-9 9"/></svg>
38',prevTpl:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M15 3l-9 9 9 9"/></svg>'}});class V extends H{constructor(){super(...arguments),Object.defineProperty(this,"selectedIndex",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"target",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"nav",{enumerable:!0,configurable:!0,writable:!0,value:null})}addAsTargetFor(t){this.target=this.instance,this.nav=t,this.attachEvents()}addAsNavFor(t){this.nav=this.instance,this.target=t,this.attachEvents()}attachEvents(){const{nav:t,target:e}=this;t&&e&&(t.options.initialSlide=e.options.initialPage,t.state===F.Ready?this.onNavReady(t):t.on("ready",this.onNavReady),e.state===F.Ready?this.onTargetReady(e):e.on("ready",this.onTargetReady))}onNavReady(t){t.on("createSlide",this.onNavCreateSlide),t.on("Panzoom.click",this.onNavClick),t.on("Panzoom.touchEnd",this.onNavTouch),this.onTargetChange()}onTargetReady(t){t.on("change",this.onTargetChange),t.on("Panzoom.refresh",this.onTargetChange),this.onTargetChange()}onNavClick(t,e,i){this.onNavTouch(t,t.panzoom,i)}onNavTouch(t,e,i){var n,s;if(Math.abs(e.dragOffset.x)>3||Math.abs(e.dragOffset.y)>3)return;const o=i.target,{nav:a,target:r}=this;if(!a||!r||!o)return;const l=o.closest("[data-index]");if(i.stopPropagation(),i.preventDefault(),!l)return;const h=parseInt(l.dataset.index||"",10)||0,c=r.getPageForSlide(h),d=a.getPageForSlide(h);a.slideTo(d),r.slideTo(c,{friction:(null===(s=null===(n=this.nav)||void 0===n?void 0:n.plugins)||void 0===s?void 0:s.Sync.option("friction"))||0}),this.markSelectedSlide(h)}onNavCreateSlide(t,e){e.index===this.selectedIndex&&this.markSelectedSlide(e.index)}onTargetChange(){var t,e;const{target:i,nav:n}=this;if(!i||!n)return;if(n.state!==F.Ready||i.state!==F.Ready)return;const s=null===(e=null===(t=i.pages[i.page])||void 0===t?void 0:t.slides[0])||void 0===e?void 0:e.index,o=n.getPageForSlide(s);this.markSelectedSlide(s),n.slideTo(o,null===n.prevPage&&null===i.prevPage?{friction:0}:void 0)}markSelectedSlide(t){const e=this.nav;e&&e.state===F.Ready&&(this.selectedIndex=t,[...e.slides].map((e=>{e.el&&e.el.classList[e.index===t?"add":"remove"]("is-nav-selected")})))}attach(){const t=this;let e=t.options.target,i=t.options.nav;e?t.addAsNavFor(e):i&&t.addAsTargetFor(i)}detach(){const t=this,e=t.nav,i=t.target;e&&(e.off("ready",t.onNavReady),e.off("createSlide",t.onNavCreateSlide),e.off("Panzoom.click",t.onNavClick),e.off("Panzoom.touchEnd",t.onNavTouch)),t.nav=null,i&&(i.off("ready",t.onTargetReady),i.off("refresh",t.onTargetChange),i.off("change",t.onTargetChange)),t.target=null}}Object.defineProperty(V,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{friction:.35}});const q={Navigation:Z,Dots:X,Sync:V},_="animationend",G="isSelected",U="slide";class K extends p{get axis(){return this.isHorizontal?"e":"f"}get isEnabled(){return this.state===F.Ready}get isInfinite(){let t=!1;const{contentDim:e,viewportDim:i,pages:n,slides:s}=this,o=s[0];return n.length>=2&&o&&e+o.dim>=i&&(t=this.option("infinite")),t}get isRTL(){return"rtl"===this.option("direction")}get isHorizontal(){return"x"===this.option("axis")}constructor(t,e={},i={}){if(super(),Object.defineProperty(this,"bp",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"lp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"userOptions",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"userPlugins",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:F.Init}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"prevPage",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"viewport",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"track",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"slides",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"pages",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"panzoom",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"inTransition",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"contentDim",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"viewportDim",{enumerable:!0,configurable:!0,writable:!0,value:0}),"string"==typeof t&&(t=document.querySelector(t)),!t||!x(t))throw new Error("No Element found");this.container=t,this.slideNext=R(this.slideNext.bind(this),150),this.slidePrev=R(this.slidePrev.bind(this),150),this.userOptions=e,this.userPlugins=i,queueMicrotask((()=>{this.processOptions()}))}processOptions(){var t,e;const i=u({},K.defaults,this.userOptions);let n="";const s=i.breakpoints;if(s&&d(s))for(const[t,e]of Object.entries(s))window.matchMedia(t).matches&&d(e)&&(n+=t,u(i,e));n===this.bp&&this.state!==F.Init||(this.bp=n,this.state===F.Ready&&(i.initialSlide=(null===(e=null===(t=this.pages[this.page])||void 0===t?void 0:t.slides[0])||void 0===e?void 0:e.index)||0),this.state!==F.Init&&this.destroy(),super.setOptions(i),!1===this.option("enabled")?this.attachEvents():setTimeout((()=>{this.init()}),0))}
38init(){this.state=F.Init,this.emit("init"),this.attachPlugins(Object.assign(Object.assign({},K.Plugins),this.userPlugins)),this.emit("attachPlugins"),this.initLayout(),this.initSlides(),this.updateMetrics(),this.setInitialPosition(),this.initPanzoom(),this.attachEvents(),this.state=F.Ready,this.emit("ready")}initLayout(){const{container:t}=this,e=this.option("classes");T(t,this.cn("container")),o(t,e.isLTR,!this.isRTL),o(t,e.isRTL,this.isRTL),o(t,e.isVertical,!this.isHorizontal),o(t,e.isHorizontal,this.isHorizontal);let i=this.option("viewport")||t.querySelector(`.${e.viewport}`);i||(i=document.createElement("div"),T(i,e.viewport),i.append(...A(t,`.${e.slide}`)),t.prepend(i)),i.addEventListener("scroll",this.onScroll);let n=this.option("track")||t.querySelector(`.${e.track}`);n||(n=document.createElement("div"),T(n,e.track),n.append(...Array.from(i.childNodes))),n.setAttribute("aria-live","polite"),i.contains(n)||i.prepend(n),this.viewport=i,this.track=n,this.emit("initLayout")}initSlides(){const{track:t}=this;if(!t)return;const e=[...this.slides],i=[];[...A(t,`.${this.cn(U)}`)].forEach((t=>{if(x(t)){const e=I({el:t,isDom:!0,index:this.slides.length});i.push(e)}}));for(let t of[...this.option("slides",[])||[],...e])i.push(I(t));this.slides=i;for(let t=0;t<this.slides.length;t++)this.slides[t].index=t;
38for(const t of i)this.emit("beforeInitSlide",t,t.index),this.emit("initSlide",t,t.index);this.emit("initSlides")}setInitialPage(){const t=this.option("initialSlide");this.page="number"==typeof t?this.getPageForSlide(t):parseInt(this.option("initialPage",0)+"",10)||0}setInitialPosition(){const{track:t,pages:e,isHorizontal:i}=this;if(!t||!e.length)return;let n=this.page;e[n]||(this.page=n=0);const s=(e[n].pos||0)*(this.isRTL&&i?1:-1),o=i?`${s}px`:"0",a=i?"0":`${s}px`;t.style.transform=`translate3d(${o}, ${a}, 0) scale(1)`,this.option("adaptiveHeight")&&this.setViewportHeight()}initPanzoom(){this.panzoom&&(this.panzoom.destroy(),this.panzoom=null);const t=this.option("Panzoom")||{};this.panzoom=new C(this.viewport,u({},{content:this.track,zoom:!1,panOnlyZoomed:!1,lockAxis:this.isHorizontal?"x":"y",infinite:this.isInfinite,click:!1,dblClick:!1,touch:t=>!(this.pages.length<2&&!t.options.infinite),bounds:()=>this.getBounds(),maxVelocity:t=>Math.abs(t.target[this.axis]-t.current[this.axis])<2*this.viewportDim?100:0},t)),this.panzoom.on("*",((t,e,...i)=>{this.emit(`Panzoom.${e}`,t,...i)})),this.panzoom.on("decel",this.onDecel),this.panzoom.on("refresh",this.onRefresh),this.panzoom.on("beforeTransform",this.onBeforeTransform),this.panzoom.on("endAnimation",this.onEndAnimation)}attachEvents(){const t=this.container;t&&(t.addEventListener("click",this.onClick,{passive:!1,capture:!1}),t.addEventListener("slideTo",this.onSlideTo)),window.addEventListener("resize",this.onResize)}createPages(){let t=[];const{contentDim:e,viewportDim:i}=this;let n=this.option("slidesPerPage");n=("auto"===n||e<=i)&&!1!==this.option("fill")?1/0:parseFloat(n+"");let s=0,o=0,a=0;for(const e of this.slides)(!t.length||o+e.dim-i>.05||a>=n)&&(t.push(B()),s=t.length-1,o=0,a=0),t[s].slides.push(e),o+=e.dim+e.gap,a++;return t}processPages(){const t=this.pages,{contentDim:i,viewportDim:n,isInfinite:s}=this,o=this.option("center"),a=this.option("fill"),r=a&&o&&i>n&&!s;if(t.forEach(((t,e)=>{var s;t.index=e,t.pos=(null===(s=t.slides[0])||void 0===s?void 0:s.pos)||0,t.dim=0;for(const[e,i]of t.slides.entries())t.dim+=i.dim,e<t.slides.length-1&&(t.dim+=i.gap);r&&t.pos+.5*t.dim<.5*n?t.pos=0:r&&t.pos+.5*t.dim>=i-.5*n?t.pos=i-n:o&&(t.pos+=-.5*(n-t.dim))})),t.forEach((t=>{a&&!s&&i>n&&(t.pos=Math.max(t.pos,0),t.pos=Math.min(t.pos,i-n)),t.pos=e(t.pos,1e3),t.dim=e(t.dim,1e3),Math.abs(t.pos)<=.1&&(t.pos=0)})),s)return t;const l=[];let h;return t.forEach((t=>{const e=Object.assign({},t);h&&e.pos===h.pos?(h.dim+=e.dim,h.slides=[...h.slides,...e.slides]):(e.index=l.length,h=e,l.push(e))})),l}getPageFromIndex(t=0){const e=this.pages.length;let i;return t=parseInt((t||0).toString())||0,i=this.isInfinite?(t%e+e)%e:Math.max(Math.min(t,e-1),0),i}getSlideMetrics(t){var i,n;const s=this.isHorizontal?"width":"height";let o=0,a=0,r=t.el;const l=!(!r||r.parentNode);if(r?o=parseFloat(r.dataset[s]||"")||0:(r=document.createElement("div"),r.style.visibility="hidden",(this.track||document.body).prepend(r)),T(r,this.cn(U)+" "+t.class+" "+t.customClass),o)r.style[s]=`${o}px`,r.style["width"===s?"height":"width"]="";else{l&&(this.track||document.body).prepend(r),o=r.getBoundingClientRect()[s]*Math.max(1,(null===(i=window.visualViewport)||void 0===i?void 0:i.scale)||1);let t=r[this.isHorizontal?"offsetWidth":"offsetHeight"];t-1>o&&(o=t)}const h=getComputedStyle(r);return"content-box"===h.boxSizing&&(this.isHorizontal?(o+=parseFloat(h.paddingLeft)||0,o+=parseFloat(h.paddingRight)||0):(o+=parseFloat(h.paddingTop)||0,o+=parseFloat(h.paddingBottom)||0)),a=parseFloat(h[this.isHorizontal?"marginRight":"marginBottom"])||0,l?null===(n=r.parentElement)||void 0===n||n.removeChild(r):t.el||r.remove(),{dim:e(o,1e3),gap:e(a,1e3)}}getBounds(){const{isInfinite:t,isRTL:e,isHorizontal:i,pages:n}=this;let s={min:0,max:0};if(t)s={min:-1/0,max:1/0};else if(n.length){const t=n[0].pos,o=n[n.length-1].pos;s=e&&i?{min:t,max:o}:{min:-1*o,max:-1*t}}return{x:i?s:{min:0,max:0},y:i?{min:0,max:0}:s}}repositionSlides(){let t,{isHorizontal:i,isRTL:n,isInfinite:s,viewport:o,viewportDim:a,contentDim:r,page:l,pages:h,slides:c,panzoom:d}=this,u=0,g=0,f=0,p=0;d?p=-1*d.current[this.axis]:h[l]&&(p=h[l].pos||0),t=i?n?"right":"left":"top",n&&i&&(p*=-1);for(const i of c){const n=i.el;n?("top"===t?(n.style.right="",n.style.left=""):n.style.top="",i.index!==u?n.style[t]=0===g?"":`${e(g,1e3)}px`:n.style[t]="",f+=i.dim+i.gap,u++):g+=i.dim+i.gap}if(s&&f&&o){let n=getComputedStyle(o),s="padding",l=i?"Right":"Bottom",h=parseFloat(n[s+(i?"Left":"Top")]);p-=h,a+=h,a+=parseFloat(n[s+l]);for(const i of c)i.el&&(e(i.pos)<e(a)&&e(i.pos+i.dim+i.gap)<e(p)&&e(p)>e(r-a)&&(i.el.style[t]=`${e(g+f,1e3)}px`),e(i.pos+i.gap)>=e(r-a)&&e(i.pos)>e(p+a)&&e(p)<e(a)&&(i.el.style[t]=`-${e(f,1e3)}px`))}let m,b,v=[...this.inTransition];if(v.length>1&&(m=h[v[0]],b=h[v[1]]),m&&b){let i=0;for(const n of c)n.el?this.inTransition.has(n.index)&&m.slides.indexOf(n)<0&&(n.el.style[t]=`${e(i+(m.pos-b.pos),1e3)}px`):i+=n.dim+n.gap}}createSlideEl(t){const{track:e,slides:i}=this;if(!e||!t)return;if(t.el&&t.el.parentNode)return;const n=t.el||document.createElement("div");T(n,this.cn(U)),T(n,t.class),T(n,t.customClass);const s=t.html;s&&(s instanceof HTMLElement?n.appendChild(s):n.innerHTML=t.html+"");const o=[];
38i.forEach(((t,e)=>{t.el&&o.push(e)}));const a=t.index;let r=null;if(o.length){r=i[o.reduce(((t,e)=>Math.abs(e-a)<Math.abs(t-a)?e:t))]}const l=r&&r.el&&r.el.parentNode?r.index<t.index?r.el.nextSibling:r.el:null;e.insertBefore(n,e.contains(l)?l:null),t.el=n,this.emit("createSlide",t)}removeSlideEl(t,e=!1){const i=null==t?void 0:t.el;if(!i||!i.parentNode)return;const n=this.cn(G);if(i.classList.contains(n)&&(P(i,n),this.emit("unselectSlide",t)),t.isDom&&!e)return i.removeAttribute("aria-hidden"),i.removeAttribute("data-index"),void(i.style.left="");this.emit("removeSlide",t);const s=new CustomEvent(_);i.dispatchEvent(s),t.el&&(t.el.remove(),t.el=null)}transitionTo(t=0,e=this.option("transition")){var i,n,s,o;if(!e)return!1;const a=this.page,{pages:r,panzoom:l}=this;t=parseInt((t||0).toString())||0;const h=this.getPageFromIndex(t);if(!l||!r[h]||r.length<2||Math.abs(((null===(n=null===(i=r[a])||void 0===i?void 0:i.slides[0])||void 0===n?void 0:n.dim)||0)-this.viewportDim)>1)return!1;const c=t>a?1:-1,d=r[h].pos*(this.isRTL?1:-1);if(a===h&&Math.abs(d-l.target[this.axis])<1)return!1;this.clearTransitions();const u=l.isResting;T(this.container,this.cn("inTransition"));const g=(null===(s=r[a])||void 0===s?void 0:s.slides[0])||null,f=(null===(o=r[h])||void 0===o?void 0:o.slides[0])||null;this.inTransition.add(f.index),this.createSlideEl(f);let p=g.el,m=f.el;u||e===U||(e="fadeFast",p=null);const b=this.isRTL?"next":"prev",v=this.isRTL?"prev":"next";return p&&(this.inTransition.add(g.index),g.transition=e,p.addEventListener(_,this.onAnimationEnd),p.classList.add(`f-${e}Out`,`to-${c>0?v:b}`)),m&&(f.transition=e,m.addEventListener(_,this.onAnimationEnd),m.classList.add(`f-${e}In`,`from-${c>0?b:v}`)),l.current[this.axis]=d,l.target[this.axis]=d,l.requestTick(),this.onChange(h),!0}manageSlideVisiblity(){const t=new Set,e=new Set,i=this.getVisibleSlides(parseFloat(this.option("preload",0)+"")||0);for(const n of this.slides)i.has(n)?t.add(n):e.add(n);for(const e of this.inTransition)t.add(this.slides[e]);for(const e of t)this.createSlideEl(e),this.lazyLoadSlide(e);for(const i of e)t.has(i)||this.removeSlideEl(i);this.markSelectedSlides(),this.repositionSlides()}markSelectedSlides(){if(!this.pages[this.page]||!this.pages[this.page].slides)return;const t="aria-hidden";let e=this.cn(G);if(e)for(const i of this.slides){const n=i.el;n&&(n.dataset.index=`${i.index}`,n.classList.contains("f-thumbs__slide")?this.getVisibleSlides(0).has(i)?n.removeAttribute(t):n.setAttribute(t,"true"):this.pages[this.page].slides.includes(i)?(n.classList.contains(e)||(T(n,e),this.emit("selectSlide",i)),n.removeAttribute(t)):(n.classList.contains(e)&&(P(n,e),this.emit("unselectSlide",i)),n.setAttribute(t,"true")))}}flipInfiniteTrack(){const{axis:t,isHorizontal:e,isInfinite:i,isRTL:n,viewportDim:s,contentDim:o}=this,a=this.panzoom;if(!a||!i)return;let r=a.current[t],l=a.target[t]-r,h=0,c=.5*s;n&&e?(r<-c&&(h=-1,r+=o),r>o-c&&(h=1,r-=o)):(r>c&&(h=1,r-=o),r<-o+c&&(h=-1,r+=o)),h&&(a.current[t]=r,a.target[t]=r+l)}lazyLoadImg(t,e){const i=this,s="f-fadeIn",o="is-preloading";let a=!1,r=null;const l=()=>{a||(a=!0,r&&(r.remove(),r=null),P(e,o),e.complete&&(T(e,s),setTimeout((()=>{P(e,s)}),350)),this.option("adaptiveHeight")&&t.el&&this.pages[this.page].slides.indexOf(t)>-1&&(i.updateMetrics(),i.setViewportHeight()),this.emit("load",t))};T(e,o),e.src=e.dataset.lazySrcset||e.dataset.lazySrc||"",delete e.dataset.lazySrc,delete e.dataset.lazySrcset,e.addEventListener("error",(()=>{l()})),e.addEventListener("load",(()=>{l()})),setTimeout((()=>{const i=e.parentNode;i&&t.el&&(e.complete?l():a||(r=n(w),i.insertBefore(r,e)))}),300)}lazyLoadSlide(t){const e=t&&t.el;if(!e)return;const i=new Set;let n=Array.from(e.querySelectorAll("[data-lazy-src],[data-lazy-srcset]"));e.dataset.lazySrc&&n.push(e),n.map((t=>{t instanceof HTMLImageElement?i.add(t):t instanceof HTMLElement&&t.dataset.lazySrc&&(t.style.backgroundImage=`url('${t.dataset.lazySrc}')`,delete t.dataset.lazySrc)}));for(const e of i)this.lazyLoadImg(t,e)}onAnimationEnd(t){var e;const i=t.target,n=i?parseInt(i.dataset.index||"",10)||0:-1,s=this.slides[n],o=t.animationName;if(!i||!s||!o)return;const a=!!this.inTransition.has(n)&&s.transition;a&&o.substring(0,a.length+2)===`f-${a}`&&this.inTransition.delete(n),this.inTransition.size||this.clearTransitions(),n===this.page&&(null===(e=this.panzoom)||void 0===e?void 0:e.isResting)&&this.emit
38("settle")}onDecel(t,e=0,i=0,n=0,s=0){if(this.option("dragFree"))return void this.setPageFromPosition();const{isRTL:o,isHorizontal:a,axis:r,pages:l}=this,h=l.length,c=Math.abs(Math.atan2(i,e)/(Math.PI/180));let d=0;if(d=c>45&&c<135?a?0:i:a?e:0,!h)return;let u=this.page,g=o&&a?1:-1;const f=t.current[r]*g;let{pageIndex:p}=this.getPageFromPosition(f);Math.abs(d)>5?(l[u].dim<document.documentElement["client"+(this.isHorizontal?"Width":"Height")]-1&&(u=p),u=o&&a?d<0?u-1:u+1:d<0?u+1:u-1):u=0===n&&0===s?u:p,this.slideTo(u,{transition:!1,friction:t.option("decelFriction")})}onClick(t){const e=t.target,i=e&&x(e)?e.dataset:null;let n,s;i&&(void 0!==i.carouselPage?(s="slideTo",n=i.carouselPage):void 0!==i.carouselNext?s="slideNext":void 0!==i.carouselPrev&&(s="slidePrev")),s?(t.preventDefault(),t.stopPropagation(),e&&!e.hasAttribute("disabled")&&this[s](n)):this.emit("click",t)}onSlideTo(t){const e=t.detail||0;this.slideTo(this.getPageForSlide(e),{friction:0})}onChange(t,e=0){const i=this.page;this.prevPage=i,this.page=t,this.option("adaptiveHeight")&&this.setViewportHeight(),t!==i&&(this.markSelectedSlides(),this.emit("change",t,i,e))}onRefresh(){let t=this.contentDim,e=this.viewportDim;this.updateMetrics(),this.contentDim===t&&this.viewportDim===e||this.slideTo(this.page,{friction:0,transition:!1})}onScroll(){var t;null===(t=this.viewport)||void 0===t||t.scroll(0,0)}onResize(){this.option("breakpoints")&&this.processOptions()}onBeforeTransform(t){this.lp!==t.current[this.axis]&&(this.flipInfiniteTrack(),this.manageSlideVisiblity()),this.lp=t.current.e}onEndAnimation(){this.inTransition.size||this.emit("settle")}reInit(t=null,e=null){this.destroy(),this.state=F.Init,this.prevPage=null,this.userOptions=t||this.userOptions,this.userPlugins=e||this.userPlugins,this.processOptions()}slideTo(t=0,{friction:e=this.option("friction"),transition:i=this.option("transition")}={}){if(this.state===F.Destroy)return;t=parseInt((t||0).toString())||0;const n=this.getPageFromIndex(t),{axis:s,isHorizontal:o,isRTL:a,pages:r,panzoom:l}=this,h=r.length,c=a&&o?1:-1;if(!l||!h)return;if(this.page!==n){const e=new Event("beforeChange",{bubbles:!0,cancelable:!0});if(this.emit("beforeChange",e,t),e.defaultPrevented)return}if(this.transitionTo(t,i))return;let d=r[n].pos;if(this.isInfinite){const e=this.contentDim,i=l.target[s]*c;if(2===h)d+=e*Math.floor(parseFloat(t+"")/2);else{d=[d,d-e,d+e].reduce((function(t,e){return Math.abs(e-i)<Math.abs(t-i)?e:t}))}}d*=c,Math.abs(l.target[s]-d)<1||(l.panTo({x:o?d:0,y:o?0:d,friction:e}),this.onChange(n))}slideToClosest(t){if(this.panzoom){const{pageIndex:e}=this.getPageFromPosition();this.slideTo(e,t)}}slideNext(){this.slideTo(this.page+1)}slidePrev(){this.slideTo(this.page-1)}clearTransitions(){this.inTransition.clear(),P(this.container,this.cn("inTransition"));const t=["to-prev","to-next","from-prev","from-next"];for(const e of this.slides){const i=e.el;if(i){i.removeEventListener(_,this.onAnimationEnd),i.classList.remove(...t);const n=e.transition;n&&i.classList.remove(`f-${n}Out`,`f-${n}In`)}}this.manageSlideVisiblity()}addSlide(t,e){var i,n,s,o;const a=this.panzoom,r=(null===(i=this.pages[this.page])||void 0===i?void 0:i.pos)||0,l=(null===(n=this.pages[this.page])||void 0===n?void 0:n.dim)||0,h=this.contentDim<this.viewportDim;let c=Array.isArray(e)?e:[e];const d=[];for(const t of c)d.push(I(t));this.slides.splice(t,0,...d);for(let t=0;t<this.slides.length;t++)this.slides[t].index=t;for(const t of d)this.emit("beforeInitSlide",t,t.index);if(this.page>=t&&(this.page+=d.length),this.updateMetrics(),a){const e=(null===(s=this.pages[this.page])||void 0===s?void 0:s.pos)||0,i=(null===(o=this.pages[this.page])||void 0===o?void 0:o.dim)||0,n=this.pages.length||1,c=this.isRTL?l-i:i-l,d=this.isRTL?r-e:e-r;h&&1===n?(t<=this.page&&(a.current[this.axis]-=c,a.target[this.axis]-=c),a.panTo({[this.isHorizontal?"x":"y"]:-1*e})):d&&t<=this.page&&(a.target[this.axis]-=d,a.current[this.axis]-=d,a.requestTick())}for(const t of d)this.emit("initSlide",t,t.index)}prependSlide(t){this.addSlide(0,t)}appendSlide(t){this.addSlide(this.slides.length,t)}removeSlide(t){const e=this.slides.length;t=(t%e+e)%e;const i=this.slides[t];
38if(i){this.removeSlideEl(i,!0),this.slides.splice(t,1);for(let t=0;t<this.slides.length;t++)this.slides[t].index=t;this.updateMetrics(),this.slideTo(this.page,{friction:0,transition:!1}),this.emit("destroySlide",i)}}updateMetrics(){const{panzoom:t,viewport:i,track:n,slides:s,isHorizontal:o,isInfinite:a}=this;if(!n)return;const r=o?"width":"height",l=o?"offsetWidth":"offsetHeight";if(i){let t=Math.max(i[l],e(i.getBoundingClientRect()[r],1e3)),n=getComputedStyle(i),s="padding",a=o?"Right":"Bottom";t-=parseFloat(n[s+(o?"Left":"Top")])+parseFloat(n[s+a]),this.viewportDim=t}let h,c=0;for(const[t,i]of s.entries()){let n=0,o=0;!i.el&&h?(n=h.dim,o=h.gap):(({dim:n,gap:o}=this.getSlideMetrics(i)),h=i),n=e(n,1e3),o=e(o,1e3),i.dim=n,i.gap=o,i.pos=c,c+=n,(a||t<s.length-1)&&(c+=o)}c=e(c,1e3),this.contentDim=c,t&&(t.contentRect[r]=c,t.contentRect[o?"fullWidth":"fullHeight"]=c),this.pages=this.createPages(),this.pages=this.processPages(),this.state===F.Init&&this.setInitialPage(),this.page=Math.max(0,Math.min(this.page,this.pages.length-1)),this.manageSlideVisiblity(),this.emit("refresh")}getProgress(t,i=!1,n=!1){void 0===t&&(t=this.page);const s=this,o=s.panzoom,a=s.contentDim,r=s.pages[t]||0;if(!r||!o)return t>this.page?-1:1;let l=-1*o.current.e,h=e((l-r.pos)/(1*r.dim),1e3),c=h,d=h;this.isInfinite&&!0!==n&&(c=e((l-r.pos+a)/(1*r.dim),1e3),d=e((l-r.pos-a)/(1*r.dim),1e3));let u=[h,c,d].reduce((function(t,e){return Math.abs(e)<Math.abs(t)?e:t}));return i?u:u>1?1:u<-1?-1:u}setViewportHeight(){const{page:t,pages:e,viewport:i,isHorizontal:n}=this;if(!i||!e[t])return;let s=0;n&&this.track&&(this.track.style.height="auto",e[t].slides.forEach((t=>{t.el&&(s=Math.max(s,t.el.offsetHeight))}))),i.style.height=s?`${s}px`:""}getPageForSlide(t){for(const e of this.pages)for(const i of e.slides)if(i.index===t)return e.index;return-1}getVisibleSlides(t=0){var e;const i=new Set;let{panzoom:n,contentDim:s,viewportDim:o,pages:a,page:r}=this;if(o){s=s+(null===(e=this.slides[this.slides.length-1])||void 0===e?void 0:e.gap)||0;let l=0;l=n&&n.state!==m.Init&&n.state!==m.Destroy?-1*n.current[this.axis]:a[r]&&a[r].pos||0,this.isInfinite&&(l-=Math.floor(l/s)*s),this.isRTL&&this.isHorizontal&&(l*=-1);const h=l-o*t,c=l+o*(t+1),d=this.isInfinite?[-1,0,1]:[0];for(const t of this.slides)for(const e of d){const n=t.pos+e*s,o=n+t.dim+t.gap;n<c&&o>h&&i.add(t)}}return i}getPageFromPosition(t){const{viewportDim:e,contentDim:i,slides:n,pages:s,panzoom:o}=this,a=s.length,r=n.length,l=n[0],h=n[r-1],c=this.option("center");let d=0,u=0,g=0,f=void 0===t?-1*((null==o?void 0:o.target[this.axis])||0):t;c&&(f+=.5*e),this.isInfinite?(f<l.pos-.5*h.gap&&(f-=i,g=-1),f>h.pos+h.dim+.5*h.gap&&(f-=i,g=1)):f=Math.max(l.pos||0,Math.min(f,h.pos));let p=h,m=n.find((t=>{const e=t.pos-.5*p.gap,i=t.pos+t.dim+.5*t.gap;return p=t,f>=e&&f<i}));return m||(m=h),u=this.getPageForSlide(m.index),d=u+g*a,{page:d,pageIndex:u}}setPageFromPosition(){const{pageIndex:t}=this.getPageFromPosition();this.onChange(t)}destroy(){if([F.Destroy].includes(this.state))return;this.state=F.Destroy;const{container:t,viewport:e,track:i,slides:n,panzoom:s}=this,o=this.option("classes");t.removeEventListener("click",this.onClick,{passive:!1,capture:!1}),t.removeEventListener("slideTo",this.onSlideTo),window.removeEventListener("resize",this.onResize),s&&(s.destroy(),this.panzoom=null),n&&n.forEach((t=>{this.removeSlideEl(t)})),this.detachPlugins(),e&&(e.removeEventListener("scroll",this.onScroll),e.offsetParent&&i&&i.offsetParent&&e.replaceWith(...i.childNodes));for(const[e,i]of Object.entries(o))"container"!==e&&i&&t.classList.remove(i);this.track=null,this.viewport=null,this.page=0,this.slides=[];const a=this.events.get("ready");this.events=new Map,a&&this.events.set("ready",a)}}Object.defineProperty(K,"Panzoom",{enumerable:!0,configurable:!0,writable:!0,value:C}),Object.defineProperty(K,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:j}),Object.defineProperty(K,"Plugins",{enumerable:!0,configurable:!0,writable:!0,value:q}),t.Carousel=K,t.Panzoom=C}));!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).window=t.window||{})}(this,(function(t){"use strict";const e=(t,...i)=>{const s=i.length;for(let n=0;n<s;n++){const s=i[n]||{};
38Object.entries(s).forEach((([i,s])=>{const n=Array.isArray(s)?[]:{};var r;t[i]||Object.assign(t,{[i]:n}),"object"==typeof(r=s)&&null!==r&&r.constructor===Object&&"[object Object]"===Object.prototype.toString.call(r)?Object.assign(t[i],e(n,s)):Array.isArray(s)?Object.assign(t,{[i]:[...s]}):Object.assign(t,{[i]:s})}))}return t},i=t=>`${t||""}`.split(" ").filter((t=>!!t)),s=(t,e)=>{t&&i(e).forEach((e=>{t.classList.add(e)}))},n=(t,e)=>{t&&i(e).forEach((e=>{t.classList.remove(e)}))},r=function(t,e){return t.split(".").reduce(((t,e)=>"object"==typeof t?t[e]:void 0),e)};class o{constructor(t={}){Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),this.setOptions(t);for(const t of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))t.startsWith("on")&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}setOptions(t){this.options=t?e({},this.constructor.defaults,t):{};for(const[t,e]of Object.entries(this.option("on")||{}))this.on(t,e)}option(t,...e){let i=r(t,this.options);return i&&"function"==typeof i&&(i=i.call(this,this,...e)),i}optionFor(t,e,i,...s){let n=r(e,t);var o;"string"!=typeof(o=n)||isNaN(o)||isNaN(parseFloat(o))||(n=parseFloat(n)),"true"===n&&(n=!0),"false"===n&&(n=!1),n&&"function"==typeof n&&(n=n.call(this,this,t,...s));let a=r(e,this.options);return a&&"function"==typeof a?n=a.call(this,this,t,...s,n):void 0===n&&(n=a),void 0===n?i:n}cn(t){const e=this.options.classes;return e&&e[t]||""}localize(t,e=[]){t=String(t).replace(/\{\{(\w+).?(\w+)?\}\}/g,((t,e,i)=>{let s="";return i?s=this.option(`${e[0]+e.toLowerCase().substring(1)}.l10n.${i}`):e&&(s=this.option(`l10n.${e}`)),s||(s=t),s}));for(let i=0;i<e.length;i++)t=t.split(e[i][0]).join(e[i][1]);return t=t.replace(/\{\{(.*?)\}\}/g,((t,e)=>e))}on(t,e){let i=[];"string"==typeof t?i=t.split(" "):Array.isArray(t)&&(i=t),this.events||(this.events=new Map),i.forEac
38h((t=>{let i=this.events.get(t);i||(this.events.set(t,[]),i=[]),i.includes(e)||i.push(e),this.events.set(t,i)}))}off(t,e){let i=[];"string"==typeof t?i=t.split(" "):Array.isArray(t)&&(i=t),i.forEach((t=>{const i=this.events.get(t);if(Array.isArray(i)){const t=i.indexOf(e);t>-1&&i.splice(t,1)}}))}emit(t,...e){[...this.events.get(t)||[]].forEach((t=>t(this,...e))),"*"!==t&&this.emit("*",t,...e)}}Object.defineProperty(o,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.0.33"}),Object.defineProperty(o,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{}});class a extends o{constructor(t,e){super(e),Object.defineProperty(this,"instance",{enumerable:!0,configurable:!0,writable:!0,value:t})}attach(){}detach(){}}var l,c;!function(t){t[t.Init=0]="Init",t[t.Error=1]="Error",t[t.Ready=2]="Ready",t[t.Panning=3]="Panning",t[t.Mousemove=4]="Mousemove",t[t.Destroy=5]="Destroy"}(l||(l={})),function(t){t[t.Init=0]="Init",t[t.Ready=1]="Ready",t[t.Destroy=2]="Destroy"}(c||(c={}));const u=(t,e=1e4)=>(t=parseFloat(t+"")||0,Math.round((t+Number.EPSILON)*e)/e),h={classes:{container:"f-thumbs f-carousel__thumbs",viewport:"f-thumbs__viewport",track:"f-thumbs__track",slide:"f-thumbs__slide",isResting:"is-resting",isSelected:"is-selected",isLoading:"is-loading",hasThumbs:"has-thumbs"},minCount:2,parentEl:null,thumbTpl:'<button class="f-thumbs__slide__button" tabindex="0" type="button" aria-label="{{GOTO}}" data-carousel-index="%i"><img class="f-thumbs__slide__img" data-lazy-src="{{%s}}" alt="" /></button>',type:"modern"};t.States=void 0,function(t){t[t.Init=0]="Init",t[t.Ready=1]="Ready",t[t.Hidden=2]="Hidden"}(t.States||(t.States={}));const d="isResting",f="thumbWidth",b="thumbHeight",p="thumbClipWidth";class g extends a{constructor(){super(...arguments),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:"modern"}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"track",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"carousel",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"thumbWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbClipWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbGap",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbExtraGap",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:t.States.Init})}get isModern(){return"modern"===this.type}onInitSlide(t,e){const i=e.el?e.el.dataset:void 0;i&&(e.thumbSrc=i.thumbSrc||e.thumbSrc||"",e[p]=parseFloat(i[p]||"")||e[p]||0,e[b]=parseFloat(i.thumbHeight||"")||e[b]||0),this.addSlide(e)}onInitSlides(){this.build()}onChange(){var t;if(!this.isModern)return;const e=this.container,s=this.instance,r=s.panzoom,o=this.carousel,a=o?o.panzoom:null,l=s.page;if(r&&o&&a){if(r.isDragging){n(e,this.cn(d));let i=(null===(t=o.pages[l])||void 0===t?void 0:t.pos)||0;i+=s.getProgress(l)*(this[p]+this.thumbGap);let r=a.getBounds();-1*i>r.x.min&&-1*i<r.x.max&&a.panTo({x:-1*i,friction:.12})}else c=e,u=this.cn(d),h=r.isResting,c&&i(u).forEach((t=>{c.classList.toggle(t,h||!1)}));var c,u,h;this.shiftModern()}}onRefresh(){this.updateProps();for(const t of this.instance.slides||[])this.resizeModernSlide(t);this.shiftModern()}isDisabled(){const t=this.option("minCount")||0;if(t){const e=this.instance;let i=0;for(const t of e.slides||[])t.thumbSrc&&i++;if(i<t)return!0}const e=this.option("type");return["modern","classic"].indexOf(e)<0}getThumb(t){const e=this.option("thumbTpl")||"";return{html:this.instance.localize(e,[["%i",t.index],["%d",t.index+1],["%s",t.thumbSrc||"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"]])}}addSlide(t){const e=this.carousel;e&&e.addSlide(t.index,this.getThumb(t))}getSlides(){const t=[];for(const e of this.instance.slides||[])t.push(this.getThumb(e));return t}resizeModernSlide(t){this.isModern&&(t[f]=t[p]&&t[b]?Math.round(this[b]*(t[p]/t[b])):this[f])}updateProps(){const t=this.container;if(!t)return;const e=e=>parseFloat(getComputedStyle(t).getPropertyValue("--f-thumb-"+e))||0;this.thumbGap=e("gap"),this.thumbExtraGap=e("extra-gap"),this[f]=e("width")||40,this[p]=e("clip-width")||40,this[b]=e("height")||40}build(){const i=this;if(i.state!==t.States.Init)return;if(i.isDisabled())return void i.emit("disabled");
38const n=i.instance,r=n.container,o=i.getSlides(),a=i.option("type");i.type=a;const l=i.option("parentEl"),c=i.cn("container"),u=i.cn("track");let h=null==l?void 0:l.querySelector("."+c);h||(h=document.createElement("div"),s(h,c),l?l.appendChild(h):r.after(h)),s(h,`is-${a}`),s(r,i.cn("hasThumbs")),i.container=h,i.updateProps();let d=h.querySelector("."+u);d||(d=document.createElement("div"),s(d,i.cn("track")),h.appendChild(d)),i.track=d;const f=e({},{track:d,infinite:!1,center:!0,fill:"classic"===a,dragFree:!0,slidesPerPage:1,transition:!1,preload:.25,friction:.12,Panzoom:{maxVelocity:0},Dots:!1,Navigation:!1,classes:{container:"f-thumbs",viewport:"f-thumbs__viewport",track:"f-thumbs__track",slide:"f-thumbs__slide"}},i.option("Carousel")||{},{Sync:{target:n},slides:o}),b=new n.constructor(h,f);b.on("createSlide",((t,e)=>{i.setProps(e.index),i.emit("createSlide",e,e.el)})),b.on("ready",(()=>{i.shiftModern(),i.emit("ready")})),b.on("refresh",(()=>{i.shiftModern()})),b.on("Panzoom.click",((t,e,s)=>{i.onClick(s)})),i.carousel=b,i.state=t.States.Ready}onClick(t){t.preventDefault(),t.stopPropagation();const e=this.instance,{pages:i,page:s}=e,n=t=>{if(t){const e=t.closest("[data-carousel-index]");if(e)return[parseInt(e.dataset.carouselIndex||"",10)||0,e]}return[-1,void 0]},r=(t,e)=>{const i=document.elementFromPoint(t,e);return i?n(i):[-1,void 0]};let[o,a]=n(t.target);if(o>-1)return;const l=this[p],c=t.clientX,u=t.clientY;let[h,d]=r(c-l,u),[f,b]=r(c+l,u);d&&b?(o=Math.abs(c-d.getBoundingClientRect().right)<Math.abs(c-b.getBoundingClientRect().left)?h:f,o===s&&(o=o===h?f:h)):d?o=h:b&&(o=f),o>-1&&i[o]&&e.slideTo(o)}getShift(t){var e;const i=this,{instance:s}=i,n=i.carousel;if(!s||!n)return 0;const r=i[f],o=i[p],a=i.thumbGap,l=i.thumbExtraGap;if(!(null===(e=n.slides[t])||void 0===e?void 0:e.el))return 0;const c=.5*(r-o),u=s.pages.length-1;let h=s.getProgress(0),d=s.getProgress(u),b=s.getProgress(t,!1,!0),g=0,m=c+l+a;const y=h<0&&h>-1,v=d>0&&d<1;return 0===t?(g=m*Math.abs(h),v&&1===h&&(g-=m*Math.abs(d))):t===u?(g=m*Math.abs(d)*-1,y&&-1===d&&(g+=m*Math.abs(h))):y||v?(g=-1*m,g+=m*Math.abs(h),g+=m*(1-Math.abs(d))):g=m*b,g}setProps(t){var e;const i=this;if(!i.isModern)return;const{instance:s}=i,n=i.carousel;if(s&&n){const r=null===(e=n.slides[t])||void 0===e?void 0:e.el;if(r&&r.childNodes.length){let e=u(1-Math.abs(s.getProgress(t))),n=u(i.getShift(t));r.style.setProperty("--progress",e?e+"":""),r.style.setProperty("--shift",n+"")}}}shiftModern(){const t=this;if(!t.isModern)return;const{instance:e,track:i}=t,s=e.panzoom,n=t.carousel;if(!(e&&i&&s&&n))return;if(s.state===l.Init||s.state===l.Destroy)return;for(const i of e.slides)t.setProps(i.index);let r=(t[p]+t.thumbGap)*(n.slides.length||0);i.style.setProperty("--width",r+"")}cleanup(){const e=this;e.carousel&&e.carousel.destroy(),e.carousel=null,e.container&&e.container.remove(),e.container=null,e.track&&e.track.remove(),e.track=null,e.state=t.States.Init,n(e.instance.container,e.cn("hasThumbs"))}attach(){const t=this,e=t.instance;e.on("initSlide",t.onInitSlide),e.state===c.Init?e.on("initSlides",t.onInitSlides):t.onInitSlides(),e.on(["change","Panzoom.afterTransform"],t.onChange),e.on("Panzoom.refresh",t.onRefresh)}detach(){const t=this,e=t.instance;e.off("initSlide",t.onInitSlide),e.off("initSlides",t.onInitSlides),e.off(["change","Panzoom.afterTransform"],t.onChange),e.off("Panzoom.refresh",t.onRefresh),t.cleanup()}}Object.defineProperty(g,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:h}),t.Thumbs=g,t.defaultOptions=h}));!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";const t=(e,...s)=>{const n=s.length;for(let i=0;i<n;i++){const n=s[i]||{};Object.entries(n).forEach((([s,n])=>{const i=Array.isArray(n)?[]:{};var o;e[s]||Object.assign(e,{[s]:i}),"object"==typeof(o=n)&&null!==o&&o.constructor===Object&&"[object Object]"===Object.prototype.toString.call(o)?Object.assign(e[s],t(i,n)):Array.isArray(n)?Object.assign(e,{[s]:[...n]}):Object.assign(e,{[s]:n})}))}return e},s=function(e,t){return e.split(".").reduce(((e,t)=>"object"==typeof e?e[t]:void 0),t)};
38class n{constructor(e={}){Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),this.setOptions(e);for(const e of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))e.startsWith("on")&&"function"==typeof this[e]&&(this[e]=this[e].bind(this))}setOptions(e){this.options=e?t({},this.constructor.defaults,e):{};for(const[e,t]of Object.entries(this.option("on")||{}))this.on(e,t)}option(e,...t){let n=s(e,this.options);return n&&"function"==typeof n&&(n=n.call(this,this,...t)),n}optionFor(e,t,n,...i){let o=s(t,e);var r;"string"!=typeof(r=o)||isNaN(r)||isNaN(parseFloat(r))||(o=parseFloat(o)),"true"===o&&(o=!0),"false"===o&&(o=!1),o&&"function"==typeof o&&(o=o.call(this,this,e,...i));let a=s(t,this.options);return a&&"function"==typeof a?o=a.call(this,this,e,...i,o):void 0===o&&(o=a),void 0===o?n:o}cn(e){const t=this.options.classes;return t&&t[e]||""}localize(e,t=[]){e=String(e).replace(/\{\{(\w+).?(\w+)?\}\}/g,((e,t,s)=>{let n="";return s?n=this.option(`${t[0]+t.toLowerCase().substring(1)}.l10n.${s}`):t&&(n=this.option(`l10n.${t}`)),n||(n=e),n}));for(let s=0;s<t.length;s++)e=e.split(t[s][0]).join(t[s][1]);return e=e.replace(/\{\{(.*?)\}\}/g,((e,t)=>t))}on(e,t){let s=[];"string"==typeof e?s=e.split(" "):Array.isArray(e)&&(s=e),this.events||(this.events=new Map),s.forEach((e=>{let s=this.events.get(e);s||(this.events.set(e,[]),s=[]),s.includes(t)||s.push(t),this.events.set(e,s)}))}off(e,t){let s=[];"string"==typeof e?s=e.split(" "):Array.isArray(e)&&(s=e),s.forEach((e=>{const s=this.events.get(e);if(Array.isArray(s)){const e=s.indexOf(t);e>-1&&s.splice(e,1)}}))}emit(e,...t){[...this.events.get(e)||[]].forEach((e=>e(this,...t))),"*"!==e&&this.emit("*",e,...t)}}Object.defineProperty(n,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.0.33"}),Object.defineProperty(n,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{}});class i extends n{constructor(e,t){super(t),Object.defineProperty(this,"instance",{enumerable:!0,configurable:!0,writable:!0,value:e})}attach(){}detach(){}}const o=e=>`${e||""}`.split(" ").filter((e=>!!e)),r=(e,t)=>{e&&o(t).forEach((t=>{e.classList.add(t)}))},a="play",l="pause",c="ready";class u extends i{constructor(){super(...arguments),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:c}),Object.defineProperty(this,"inHover",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"progressBar",{enumerable:!0,configurable:!0,writable:!0,value:null})}get isActive(){return this.state!==c}onReady(e){this.option("autoStart")&&(e.isInfinite||e.page<e.pages.length-1)&&this.start()}onChange(){this.removeProgressBar(),this.pause()}onSettle(){this.resume()}onVisibilityChange(){"visible"===document.visibilityState?this.resume():this.pause()}onMouseEnter(){this.inHover=!0,this.pause()}onMouseLeave(){var e;this.inHover=!1,(null===(e=this.instance.panzoom)||void 0===e?void 0:e.isResting)&&this.resume()}onTimerEnd(){const e=this.instance;"play"===this.state&&(e.isInfinite||e.page!==e.pages.length-1?e.slideNext():e.slideTo(0))}removeProgressBar(){this.progressBar&&(this.progressBar.remove(),this.progressBar=null)}createProgressBar(){var e;if(!this.option("showProgress"))return null;this.removeProgressBar();const t=this.instance,s=(null===(e=t.pages[t.page])||void 0===e?void 0:e.slides)||[];let n=this.option("progressParentEl");if(n||(n=(1===s.length?s[0].el:null)||t.viewport),!n)return null;const i=document.createElement("div");return r(i,"f-progress"),n.prepend(i),this.progressBar=i,i.offsetHeight,i}set(){const e=this,t=e.instance;if(t.pages.length<2)return;if(e.timer)return;const s=e.option("timeout");e.state=a,r(t.container,"has-autoplay");let n=e.createProgressBar();n&&(n.style.transitionDuration=`${s}ms`,n.style.transform="scaleX(1)"),e.timer=setTimeout((()=>{e.timer=null,e.inHover||e.onTimerEnd()}),s),e.emit("set")}clear(){const e=this;e.timer&&(clearTimeout(e.timer),e.timer=null),e.removeProgressBar()}start(){const e=this;if(e.set(),e.state!==c){if(e.option("pauseOnHover")){const t=e.instance.container;t.addEventListener("mouseenter",e.onMouseEnter,!1),t.addEventListener("mouseleave",e.onMouseLeave,!1)}document.addEventListener("visibilitychange",e.onVisibilityChange,!1),e.emit("start")}}stop(){const e=this,t=e.state,s=e.instance.container;var n,i;e.clear(),e.state=c,s.removeEventListener("mouseenter",e.onMouseEnter,!1),s.removeEventListener("mouseleave",e.onMouseLeave,!1),document.removeEventListener("visibilitychange",e.onVisibilityChange,!1),i="has-autoplay",(n=s)&&o(i).forEac
38h((e=>{n.classList.remove(e)})),t!==c&&e.emit("stop")}pause(){const e=this;e.state===a&&(e.state=l,e.clear(),e.emit(l))}resume(){const e=this,t=e.instance;if(t.isInfinite||t.page!==t.pages.length-1)if(e.state!==a){if(e.state===l&&!e.inHover){const t=new Event("resume",{bubbles:!0,cancelable:!0});e.emit("resume",t),t.defaultPrevented||e.set()}}else e.set();else e.stop()}toggle(){this.state===a||this.state===l?this.stop():this.start()}attach(){const e=this,t=e.instance;t.on("ready",e.onReady),t.on("Panzoom.startAnimation",e.onChange),t.on("Panzoom.endAnimation",e.onSettle),t.on("Panzoom.touchMove",e.onChange)}detach(){const e=this,t=e.instance;t.off("ready",e.onReady),t.off("Panzoom.startAnimation",e.onChange),t.off("Panzoom.endAnimation",e.onSettle),t.off("Panzoom.touchMove",e.onChange),e.stop()}}Object.defineProperty(u,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{autoStart:!0,pauseOnHover:!0,progressParentEl:null,showProgress:!0,timeout:3e3}}),e.Autoplay=u}));(function(){'use strict';function parseIntAttr(value){var n=parseInt(value,10);return(isNaN(n)?0:n)}
39function parseFloatAttr(value,fallback){var n=parseFloat(value);if(isNaN(n)){return fallback}
40return n}
41function parseBoolAttr(value){return value==='1'||value===1||value===!0||value==='true'}
42function ensureRegistry(){window.nfVideoPlayers=window.nfVideoPlayers||{};return window.nfVideoPlayers}
43function getAttr(container,key){if(!container||!container.getAttribute){return''}
44return container.getAttribute(key)||''}
45function buildPlayerDataFromContainer(container){if(!container||!container.id){return null}
46var videoType=getAttr(container,'data-type')||'local';
46var playerData={videoID:getAttr(container,'data-video-id'),type:videoType,autoplay:parseBoolAttr(getAttr(container,'data-autoplay')),muted:parseBoolAttr(getAttr(container,'data-muted')),preview:parseBoolAttr(getAttr(container,'data-preview')),front:parseBoolAttr(getAttr(container,'data-front')),minimalUi:parseBoolAttr(getAttr(container,'data-minimal-ui')),shorts:parseBoolAttr(getAttr(container,'data-shorts')),width:parseIntAttr(getAttr(container,'data-width')),height:parseIntAttr(getAttr(container,'data-height')),ratio:parseFloatAttr(getAttr(container,'data-ratio'),16/9),sourceRatio:parseFloatAttr(getAttr(container,'data-source-ratio'),parseFloatAttr(getAttr(container,'data-ratio'),16/9)),posterUrl:getAttr(container,'data-poster-url'),title:getAttr(container,'data-title'),description:getAttr(container,'data-description'),videoUrl:getAttr(container,'data-video-url'),embedHtmlBase64:getAttr(container,'data-embed-html-base64'),initialized:!1,pendingPlayOptions:null};if(videoType==='youtube'){var youtubeID=getAttr(container,'data-youtube-id');if(youtubeID){playerData.youtubeID=youtubeID}
47playerData.youtubeReady=!1}else if(videoType==='vimeo'){var vimeoID=getAttr(container,'data-vimeo-id');var vimeoUrl=getAttr(container,'data-vimeo-url');var vimeoEvent=getAttr(container,'data-vimeo-event');if(vimeoID){playerData.vimeoID=vimeoID}
48if(vimeoUrl){playerData.vimeoUrl=vimeoUrl}
49if(vimeoEvent==='1'){playerData.vimeoEvent=!0}}else if(videoType==='local'){var srcDataJson=getAttr(container,'data-src');var streamType=getAttr(container,'data-stream-type');if(srcDataJson){try{playerData.src=JSON.parse(srcDataJson)}catch(e){if(typeof console!=='undefined'&&console.warn){console.warn('Failed to parse video src data for '+container.id+': '+e)}}}
50if(streamType){playerData.streamType=streamType}}
51return playerData}
52function registerVideoPlayerData(container,force){if(!container||!container.id){return null}
53var registry=ensureRegistry();if(registry[container.id]&&!force){return registry[container.id]}
54var playerData=buildPlayerDataFromContainer(container);if(!playerData){return null}
55registry[container.id]=playerData;return playerData}
56function initVideoPlayerRegistry(context){context=context||document;var containers=context.querySelectorAll('.nf-video-player[data-lazy="true"]');for(var i=0;i<containers.length;i++){registerVideoPlayerData(containers[i],!1)}}
57window.nfBuildVideoPlayerDataFromContainer=buildPlayerDataFromContainer;window.nfRegisterVideoPlayerData=registerVideoPlayerData;window.nfInitVideoPlayerRegistry=initVideoPlayerRegistry})();(function(){'use strict';function initVideoPlayerData(){if(typeof window.nfInitVideoPlayerRegistry!=='function'){return}
58window.nfInitVideoPlayerRegistry(document)}
59window.initVideoPlayerData=initVideoPlayerData;initVideoPlayerData();jQuery(document).on('esi-content-loaded',function(){initVideoPlayerData()})})();(function(){'use strict';window.DEBUG_VIDEO_PLAYER=window.DEBUG_VIDEO_PLAYER||!1;function debugLog(message){}
60function parseVideoInfoResponse(data,context){if(typeof window.nfParseJSON==='function'){return window.nfParseJSON(data,context||'video-info',null)}
61if(data&&typeof data==='object'){return data}
62if(typeof data!=='string'||data.trim()===''){return null}
63try{return JSON.parse(data)}catch(e){debugLog('Failed to parse AJAX response for '+(context||'video-info')+': '+e.message);return null}}
64function getRenderedVideoPlayerSize(container,playerData){var ratio=(playerData.ratio&&playerData.ratio>0)?playerData.ratio:(playerData.shorts?(9/16):(16/9));var rect=container&&container.getBoundingClientRect?container.getBoundingClientRect():null;var width=rect&&rect.width>0?Math.round(rect.width):playerData.width;var height=rect&&rect.height>0?Math.round(rect.height):0;if(!height&&width&&ratio>0){height=Math.round(width/ratio)}
65if(!width&&height&&ratio>0){width=Math.round(height*ratio)}
66return{width:width||playerData.width||854,height:height||playerData.height||480,ratio:ratio}}
67function decodeBase64Utf8(value){if(!value||typeof window.atob!=='function'){return''}
68try{return decodeURIComponent(Array.prototype.map.call(window.atob(value),function(ch){return'%'+('00'+ch.charCo
68deAt(0).toString(16)).slice(-2)}).join(''))}catch(e){try{return window.atob(value)}catch(ignore){return''}}}
69function applyAutoplayParamsToUrl(rawUrl,muted){if(!rawUrl||typeof rawUrl!=='string'){return rawUrl||''}
70var originalUrl=rawUrl.trim();if(!originalUrl){return originalUrl}
71try{var keepProtocolRelative=originalUrl.indexOf('//')===0;var url=new URL(originalUrl,window.location.href);var host=(url.hostname||'').toLowerCase();url.searchParams.set('autoplay','1');if(muted){url.searchParams.set('muted','1');url.searchParams.set('mute','1')}
72if(host.indexOf('facebook.com')!==-1||host.indexOf('fb.watch')!==-1){url.searchParams.set('autoplay','true')}
73if(host.indexOf('livestream.com')!==-1){url.searchParams.set('autoPlay','true')}
74var normalized=url.toString();if(keepProtocolRelative){normalized=normalized.replace(/^https?:/i,'')}
75return normalized}catch(e){var separator=(originalUrl.indexOf('?')!==-1?'&':'?');var fallback=originalUrl+separator+'autoplay=1';if(muted){fallback+='&muted=1&mute=1'}
76return fallback}}
77function injectAutoplayIntoEmbedHtml(embedHtml,muted){if(!embedHtml||typeof embedHtml!=='string'){return embedHtml||''}
78try{var parser=new DOMParser();var doc=parser.parseFromString(embedHtml,'text/html');var iframes=doc.querySelectorAll('iframe');for(var i=0;i<iframes.length;i++){var iframe=iframes[i];var src=iframe.getAttribute('src');if(src){iframe.setAttribute('src',applyAutoplayParamsToUrl(src,muted))}
79var allow=iframe.getAttribute('allow')||'';if(allow.toLowerCase().indexOf('autoplay')===-1){iframe.setAttribute('allow',allow?(allow+'; autoplay'):'autoplay; fullscreen; picture-in-picture')}}
80return doc.body.innerHTML}catch(e){return embedHtml.replace(/src=(["'])([^"']+)\1/i,function(match,quote,src){return'src='+quote+applyAutoplayParamsToUrl(src,muted)+quote})}}
81function activateInlineScripts(scope){if(!scope||!scope.querySelectorAll){return}
82var scripts=scope.querySelectorAll('script');for(var i=0;i<scripts.length;i++){var oldScript=scripts[i];var newScript=document.createElement('script');for(var j=0;j<oldScript.attributes.length;j++){var attr=oldScript.attributes[j];newScript.setAttribute(attr.name,attr.value)}
83newScript.text=oldScript.text||oldScript.textContent||'';oldScript.parentNode.replaceChild(newScript,oldScript)}}
84function hasStoredUserVolumePreference(){try{return window.localStorage&&window.localStorage.getItem('nfVideoUserVolumeChanged')==='1'}catch(e){return!1}}
85function markUserVolumePreference(){try{if(window.localStorage){window.localStorage.setItem('nfVideoUserVolumeChanged','1')}}catch(e){}}
86var shortsPlaybackState={fancyboxOpen:!1,activeFancyboxContainerID:null,activePreviewContainerID:null,playRequestToken:0,nextSlideCooldownUntil:0};function isShortsPlayer(playerData){return!!(playerData&&playerData.shorts)}
87function emitNormalizedPlayerEvent(containerID,eventType,meta){if(!window.nfVideoPlayers||!containerID||!window.nfVideoPlayers[containerID]){return}
88var playerData=window.nfVideoPlayers[containerID];playerData.lastNormalizedEvent=eventType;playerData.lastNormalizedEventMeta=meta||{};playerData.lastNormalizedEventAt=Date.now();if(eventType==='play'){playerData.isPlaying=!0;if(playerData.preview&&!shortsPlaybackState.fancyboxOpen){shortsPlaybackState.activePreviewContainerID=containerID}
89if(!playerData.preview&&shortsPlaybackState.fancyboxOpen&&playerData.shorts){shortsPlaybackState.activeFancyboxContainerID=containerID}}
90if(eventType==='pause'||eventType==='ended'||eventType==='error'||eventType==='stop'){playerData.isPlaying=!1;if(shortsPlaybackState.activePreviewContainerID===containerID){shortsPlaybackState.activePreviewContainerID=null}}}
91function invalidateShortsPlayRequests(){shortsPlaybackState.playRequestToken++}
92function controlPlayer(containerID,action,options){options=options||{};if(!window.nfVideoPlayers||!window.nfVideoPlayers[containerID]){return!1}
93var playerData=window.nfVideoPlayers[containerID];var player=playerData.player;function storePendingPlayOptions(){playerData.pendingPlayOptions={seekToStart:!!options.seekToStart,muted:!!options.muted,unmuted:!!options.unmuted,playRequestToken:options.playRequestToken||0}}
94if(!player){if(action==='play'){storePendingPlayOptions()}else if(action==='pause'){playerData.pendingPlayOptions=null}
95return!1}
96try{if(action==='seekStart'){if(playerData.type==='youtube'&&!playerData.youtubeReady){return!1}
97if(playerData.type==='youtube'&&typeof player.seekTo==='function'){player.seekTo(0);return!0}
98if(playerData.type==='vimeo'&&typeof player.setCurrentTime==='function'){player.setCurrentTime(0);return!0}
99if(playerData.type==='local'&&typeof player.seekTo==='function'){player.seekTo(0);return!0}
100return!1}
101if(action==='mute'){if(playerData.type==='youtube'&&!playerData.youtubeReady){return!1}
102if(playerData.type==='youtube'&&typeof player.mute==='function'){player.mute();return!0}
103if(playerData.type==='vimeo'&&typeof player.setVolume==='function'){player.setVolume(0);return!0}
104if(playerData.type==='local'){if(typeof player.setMute==='function'){player.setMute(!0)}else if(typeof player.setVolume==='function'){player.setVolume(0)}
105var localMediaContainer=document.getElementById('rmp_player_'+containerID);var localMedia=localMediaContainer?localMediaContainer.querySelector('video, audio'):null;if(localMedia){localMedia.muted=!0;localMedia.defaultMuted=!0;localMedia.setAttribute('muted','')}
106return!0}
107return!1}
108if(action==='unmute'){if(playerData.type==='youtube'&&!playerData.youtubeReady){return!1}
109if(playerData.type==='youtube'&&typeof player.unMute==='function'){player.unMute();return!0}
110if(playerData.type==='vimeo'&&typeof player.setVolume==='function'){player.setVolume(1);return!0}
111if(playerData.type==='local'&&typeof player.setVolume==='function'){player.setVolume(1);return!0}
112return!1}
113if(action==='pause'){playerData.pendingPlayOptions=null;if(playerData.type==='youtube'&&!playerData.youtubeReady){return!1}
114if(playerData.type==='youtube'&&typeof player.pauseVideo==='function'){player.pauseVideo();return!0}
115if((playerData.type==='vimeo'||playerData.type==='local')&&typeof player.pause==='function'){player.pause();return!0}
116return!1}
117if(action==='play'){if(playerData.type==='youtube'&&!playerData.youtubeReady){storePendingPlayOptions();return!1}
118if(playerData.type==='local'&&playerData.ready===!1){storePendingPlayOptions();return!1}
119playerData.pendingPlayOptions=null;if(options.seekToStart){controlPlayer(containerID,'seekStart')}
120if(options.muted){controlPlayer(containerID,'mute')}else if(options.unmuted){controlPlayer(containerID,'unmute')}
121if(playerData.type==='youtube'&&typeof player.playVideo==='function'){player.playVideo();return!0}
122if((playerData.type==='vimeo'||playerData.type==='local')&&typeof player.play==='function'){player.play();return!0}
123return!1}}catch(e){debugLog('Player control failed for '+containerID+': '+e.message)}
124return!1}
125function pauseShortVideo(containerID,options){options=options||{};if(!window.nfVideoPlayers||!window.nfVideoPlayers[containerID]){return}
126if(options.seekToStart){controlPlayer(containerID,'seekStart')}
127controlPlayer(containerID,'pause');emitNormalizedPlayerEvent(containerID,'pause',{source:options.source||'pauseShortVideo'})}
128function pauseAllShortVideos(exceptContainerID,options){options=options||{};if(!window.nfVideoPlayers){return}
129Object.keys(window.nfVideoPlayers).forEach(function(containerID){if(exceptContainerID&&containerID===exceptContainerID){return}
130var playerData=window.nfVideoPlayers[containerID];if(!isShortsPlayer(playerData)){return}
131if(options.onlyPreview&&!playerData.preview){return}
132if(!playerData.player){return}
133pauseShortVideo(containerID,{source:options.source||'pauseAllShortVideos',seekToStart:!!options.seekToStart})})}
134function resolveShortContainerElement(containerID,preferredElement){if(preferredElement&&preferredElement.id===containerID){return preferredElement}
135var selectedSlideElement=document.querySelector('.fancybox__slide.is-selected .nf-video-player#'+containerID);if(selectedSlideElement){return selectedSlideElement}
136var fancyboxElement=document.querySelector('.fancybox__container .nf-video-player#'+containerID);if(fancyboxElement){return fancyboxElement}
137return document.getElementById(containerID)}
138function ensureShortVideoInitialized(containerID,preferredElement){if(!window.nfVideoPlayers||!window.nfVideoPlayers[containerID]){return!1}
139var playerData=window.nfVideoPlayers[containerID];if(!isShortsPlayer(playerData)){return!1}
140if(playerData.initialized&&playerData.player){return!0}
141var container=resolveShortContainerElement(containerID,preferredElement);if(!container){return!1}
142if(playerData.shorts&&container.closest('.fancybox__content')){container.classList.add('nf-video-fancybox');var fancyboxContent=container.closest('.fancybox__content');if(fancyboxContent){fancyboxContent.classList.add('nf-video-fancybox-content')}}
143if(playerData.preview&&!playerData.autoplay&&!container.closest('.fancybox__content')){var originalAutoplay=playerData.autoplay;playerData.autoplay=!0;initVideoPlayer(container);playerData.autoplay=originalAutoplay;return!0}
144initVideoPlayer(container);return!0}
145function playShortVideo(containerID,options){options=options||{};if(!window.nfVideoPlayers||!window.nfVideoPlayers[containerID]){return!1}
146var playerData=window.nfVideoPlayers[containerID];if(!isShortsPlayer(playerData)){return!1}
147ensureShortVideoInitialized(containerID,options.containerElement||null);if(!playerData.player){return!1}
148if(options.stopOthers!==!1){pauseAllShortVideos(containerID,{source:options.source||'playShortVideo'})}
149var didPlay=controlPlayer(containerID,'play',{seekToStart:!!options.seekToStart,muted:!!options.muted,unmuted:!!options.unmuted});if(didPlay){emitNormalizedPlayerEvent(containerID,'play',{source:options.source||'playShortVideo'})}
150return didPlay}
151function scheduleShortPlay(containerID,options){options=options||{};var delayMs=options.delayMs||0;var retryDelayMs=options.retryDelayMs||200;var maxRetries=options.maxRetries||60;var allowConcurrent=!!options.allowConcurrent;var token=allowConcurrent?shortsPlaybackState.playRequestToken:++shortsPlaybackState.playRequestToken;var requestOptions={};
151Object.keys(options).forEach(function(key){requestOptions[key]=options[key]});requestOptions.playRequestToken=allowConcurrent?0:token;function attemptPlay(attemptNo){if(!allowConcurrent&&token!==shortsPlaybackState.playRequestToken){return}
152var didPlay=playShortVideo(containerID,requestOptions);if(didPlay){return}
153if(attemptNo<maxRetries){setTimeout(function(){attemptPlay(attemptNo+1)},retryDelayMs)}}
154if(delayMs>0){setTimeout(function(){attemptPlay(0)},delayMs)}else{attemptPlay(0)}}
155function getSelectedFancyboxVideoContainer(fancybox){if(!fancybox||typeof fancybox.getSlide!=='function'){return null}
156var slide=fancybox.getSlide();if(!slide||!slide.contentEl){return null}
157return slide.contentEl.querySelector('.nf-video-player')}
158function maybeTriggerNextSlide(containerID){if(!window.nfVideoPlayers||!window.nfVideoPlayers[containerID]){return}
159var playerData=window.nfVideoPlayers[containerID];if(!playerData||playerData.preview){return}
160if(playerData.shorts){if(!shortsPlaybackState.fancyboxOpen){return}
161if(shortsPlaybackState.activeFancyboxContainerID&&shortsPlaybackState.activeFancyboxContainerID!==containerID){return}
162var now=Date.now();if(now<shortsPlaybackState.nextSlideCooldownUntil){return}
163shortsPlaybackState.nextSlideCooldownUntil=now+350;window.top.postMessage({type:'nextSlide',containerID:containerID},'*');return}
164window.top.postMessage('nextSlide','*')}
165var youtubeAPILoading=!1;var youtubeAPIReady=!1;var youtubeAPIQueue=[];function loadYouTubeAPI(){if(youtubeAPIReady||youtubeAPILoading){return}
166youtubeAPILoading=!0;debugLog('Loading YouTube IFrame API');var tag=document.createElement('script');tag.src='https://www.youtube.com/iframe_api';var firstScriptTag=document.getElementsByTagName('script')[0];firstScriptTag.parentNode.insertBefore(tag,firstScriptTag)}
167window.onYouTubeIframeAPIReady=function(){debugLog('YouTube IFrame API ready');youtubeAPIReady=!0;youtubeAPILoading=!1;youtubeAPIQueue.forEach(function(callback){callback()});youtubeAPIQueue=[]};var vimeoAPILoading=!1;var vimeoAPIReady=!1;var vimeoAPIQueue=[];function loadVimeoAPI(){if(vimeoAPIReady||vimeoAPILoading){return}
168vimeoAPILoading=!0;debugLog('Loading Vimeo Player SDK');var tag=document.createElement('script');tag.src='https://player.vimeo.com/api/player.js';tag.onload=function(){debugLog('Vimeo Player SDK loaded');vimeoAPIReady=!0;vimeoAPILoading=!1;vimeoAPIQueue.forEach(function(callback){callback()});vimeoAPIQueue=[]};tag.onerror=function(){debugLog('Failed to load Vimeo Player SDK');vimeoAPILoading=!1};var firstScriptTag=document.getElementsByTagName('script')[0];firstScriptTag.parentNode.insertBefore(tag,firstScriptTag)}
169var rmpAPILoading=!1;var rmpAPIReady=!1;var rmpAPIQueue=[];function loadRMPAPI(){if(rmpAPIReady||rmpAPILoading){return}
170rmpAPILoading=!0;debugLog('Loading Radiant Media Player');var basePath=(window.baseNewsflowHref||'/src')+'/lib/mediaplayer/radiantmediaplayer-'+(window.RMPVERSION||'9.15.5')+'/dist/';function onRMPReady(){debugLog('RMP loaded');rmpAPIReady=!0;rmpAPILoading=!1;rmpAPIQueue.forEach(function(callback){callback()});rmpAPIQueue=[]}
171function loadRmpHls(){var tag2=document.createElement('script');tag2.src=basePath+'rmp-hlsjs.min.js';tag2.onload=onRMPReady;tag2.onerror=onRMPReady;document.head.appendChild(tag2)}
172var tag=document.createElement('script');tag.src=basePath+'rmp.min.js';tag.onload=loadRmpHls;tag.onerror=function(){debugLog('Failed to load RMP');rmpAPILoading=!1};document.head.appendChild(tag)}
173function initVimeoPlayer(container,playerData){var videoID=playerData.videoID;var containerID=container.id;var autoplay=playerData.autoplay;var preview=playerData.preview;var shorts=playerData.shorts;var isEvent=container.getAttribute('data-vimeo-event')==='1';var vimeoUrl=container.getAttribute('data-vimeo-url');var vimeoID=!isEvent?(container.getAttribute('data-vimeo-id')||playerData.vimeoID):null;debugLog('Initializing Vimeo player for VideoID '+videoID+', isEvent: '+isEvent+', vimeoID: '+vimeoID+', vimeoUrl: '+vimeoUrl);if(isEvent){if(!vimeoUrl){debugLog('Vimeo event URL missing, fetching via AJAX for VideoID '+videoID);var xhr=new XMLHttpRequest();xhr.open('GET','/src/nocache/ajax/ajax_video_info.php?VideoID='+videoI
173D+'&shorts='+(shorts?'1':'0'),!0);xhr.onreadystatechange=function(){if(xhr.readyState===4&&xhr.status===200){var data=parseVideoInfoResponse(xhr.responseText,'vimeo-event-info');if(!data){return}
174if(data.vimeoUrl){container.setAttribute('data-vimeo-url',data.vimeoUrl);initVimeoPlayer(container,playerData)}else{debugLog('Failed to get Vimeo event URL from AJAX response');console.error('There was an error creating an embed: Error: Missing Vimeo event URL for video '+videoID)}}};xhr.send();return}}else{if(vimeoID&&typeof vimeoID==='string'){vimeoID=vimeoID.trim();if(!/^\d+$/.test(vimeoID)){debugLog('Invalid Vimeo video ID format: '+vimeoID);vimeoID=null}}else{vimeoID=null}
175if(!vimeoID){debugLog('Vimeo ID missing, fetching via AJAX for VideoID '+videoID);var xhr=new XMLHttpRequest();xhr.open('GET','/src/nocache/ajax/ajax_video_info.php?VideoID='+videoID+'&shorts='+(shorts?'1':'0'),!0);xhr.onreadystatechange=function(){if(xhr.readyState===4&&xhr.status===200){var data=parseVideoInfoResponse(xhr.responseText,'vimeo-id-info');if(!data){return}
176if(data.vimeoUrl){container.setAttribute('data-vimeo-url',data.vimeoUrl);container.setAttribute('data-vimeo-event','1');initVimeoPlayer(container,playerData)}else if(data.vimeoID&&/^\d+$/.test(String(data.vimeoID).trim())){playerData.vimeoID=String(data.vimeoID).trim();container.setAttribute('data-vimeo-id',playerData.vimeoID);initVimeoPlayer(container,playerData)}else{debugLog('Failed to get valid Vimeo ID from AJAX response');console.error('There was an error creating an embed: Error: Invalid Vimeo ID for video '+videoID)}}};xhr.send();return}}
177if(isEvent&&!vimeoUrl){console.error('There was an error creating an embed: Error: Vimeo event URL is missing for video '+videoID);debugLog('['+videoID+'] Cannot create Vimeo event player - URL is missing');return}
178if(!isEvent&&!vimeoID){console.error('There was an error creating an embed: Error: Vimeo video ID is missing for video '+videoID);debugLog('['+videoID+'] Cannot create Vimeo player - ID is missing');return}
179var iframeContainer=document.createElement('div');iframeContainer.id='vimeo_player_'+containerID;iframeContainer.style.width='100%';iframeContainer.style.height='100%';container.innerHTML='';container.appendChild(iframeContainer);container.removeAttribute('data-vimeo-id');container.removeAttribute('data-vimeo-url');container.removeAttribute('data-vimeo-event');container.removeAttribute('data-vimeo-defer');var playerSize=getRenderedVideoPlayerSize(container,playerData);var playerOptions={width:playerSize.width,height:playerSize.height,responsive:!0,autopause:!0,dnt:!0};if(isEvent){playerOptions.url=vimeoUrl;debugLog('['+videoID+'] Using Vimeo event URL: '+vimeoUrl)}else{playerOptions.id=vimeoID;debugLog('['+videoID+'] Using Vimeo video ID: '+vimeoID)}
180if(preview){playerOptions.autoplay=!0;playerOptions.muted=!0;playerOptions.loop=!0;playerOptions.controls=!1}else if(autoplay){playerOptions.autoplay=!0;playerOptions.muted=!0}
181debugLog('['+videoID+'] Creating Vimeo player with options: '+JSON.stringify(playerOptions));var player=new Vimeo.Player(iframeContainer,playerOptions);player.ready().then(function(){debugLog('['+videoID+'] Vimeo player ready');container.classList.add('nf-video-player--initialized');emitNormalizedPlayerEvent(container.id,'ready',{provider:'vimeo'});if(!preview&&autoplay){player.setVolume(0).catch(function(){});player.play().catch(function(error){debugLog('['+videoID+'] Vimeo autoplay play() blocked: '+(error&&error.message?error.message:'unknown'))})}}).catch(function(error){debugLog('['+videoID+'] Vimeo player error: '+error.message);emitNormalizedPlayerEvent(container.id,'error',{provider:'vimeo',message:error.message});console.error('There was an error creating an embed: Error: "'+(error.message||'Unknown error')+'" for video '+videoID+' (Vimeo ID: '+vimeoID+')')});player.on('play',function(){debugLog('['+videoID+'] Vimeo playing');container.classList.add('nf-video-player--playing');emitNormalizedPlayerEvent(container.id,'play',{provider:'vimeo'})});player.on('pause',function(){debugLog('['+videoID+'] Vimeo paused');container.classList.remove('nf-video-player--playing');emitNormalizedPlayerEvent(container.id,'pause',{provider:'vimeo'})});player.on('ended',function(){debugLog('['+videoID+'] Vimeo ended');container.classList.remove('nf-video-player--playing');emitNormalizedPlayerEvent(container.id,'ended',{provider:'vimeo'});if(!preview){maybeTriggerNextSlide(container.id)}});if(preview){var previewTimer=null;player.on('play',function(){debugLog('['+videoID+'] Vimeo preview started playing');if(previewTimer)clearTimeout(previewTimer);previewTimer=setTimeout(function(){debugLog('['+videoID+'] Vimeo preview 5 seconds elapsed, restarting');player.setCurrentTime(0)},5000)});player.on('pause',function(){if(previewTimer){clearTimeout(previewTimer);previewTimer=null}})}
182playerData.player=player}
183function initYouTubePlayer(container,playerData){var videoID=playerData.videoID;var containerID=container.id;var youtubeID=container.getAttribute('data-youtube-id');var autoplay=playerData.autoplay;var preview=playerData.preview;var front=playerData.front;var shorts=playerData.shorts;var playerSize=getRenderedVideoPlayerSize(container,playerData);debugLog('Initializing YouTube player for VideoID '+videoID);
183var iframeContainer=document.createElement('div');iframeContainer.id='youtube_player_'+containerID;iframeContainer.style.width='100%';iframeContainer.style.height='100%';container.innerHTML='';container.appendChild(iframeContainer);var playerVars={autoplay:0,controls:1,rel:0,showinfo:0,modestbranding:1};if(preview){playerVars.autoplay=1;playerVars.mute=1;playerVars.start=0;playerVars.controls=0;playerVars.cc_load_policy=0}else if(autoplay){playerVars.autoplay=1;playerVars.mute=1}
184var player=new YT.Player(iframeContainer.id,{videoId:youtubeID,width:playerSize.width,height:playerSize.height,playerVars:playerVars,events:{'onStateChange':function(event){onYouTubeStateChange(event,player,videoID,preview,front,autoplay,shorts,containerID)},'onReady':function(event){onYouTubeReady(event,player,videoID,preview,autoplay,containerID)}}});playerData.player=player;playerData.previewTimer=null;playerData.youtubeReady=!1}
185function onYouTubeReady(event,player,videoID,preview,autoplay,containerID){var playerData=window.nfVideoPlayers?window.nfVideoPlayers[containerID]:null;if(playerData){playerData.youtubeReady=!0}
186debugLog('YouTube player ready ['+videoID+']');emitNormalizedPlayerEvent(containerID,'ready',{provider:'youtube'});if(preview){debugLog('['+videoID+'] Preview mode - starting muted autoplay');setTimeout(function(){if(player.getPlayerState()===YT.PlayerState.PLAYING){debugLog('['+videoID+'] Preview already playing - setting 5 second timer');var previewTimer=setTimeout(function(){debugLog('['+videoID+'] Preview 5 seconds elapsed, restarting');player.seekTo(0);player.playVideo()},5000);if(window.nfVideoPlayers&&window.nfVideoPlayers[containerID]){window.nfVideoPlayers[containerID].previewTimer=previewTimer}}},500)}else{if(autoplay){debugLog('['+videoID+'] Autoplay enabled - starting muted playback');setTimeout(function(){controlPlayer(containerID,'play',{muted:!0})},0);return}
187if(playerData&&playerData.pendingPlayOptions){var pendingPlayOptions=playerData.pendingPlayOptions;playerData.pendingPlayOptions=null;setTimeout(function(){controlPlayer(containerID,'play',pendingPlayOptions)},0);return}
188debugLog('['+videoID+'] Video ready, waiting for activation message');setTimeout(function(){if(typeof player.pauseVideo==='function'){player.pauseVideo();debugLog('['+videoID+'] Video paused on ready')}},100)}}
189function onYouTubeStateChange(event,player,videoID,preview,front,autoplay,shorts,containerID){var stateName='UNKNOWN';switch(event.data){case YT.PlayerState.UNSTARTED:stateName='UNSTARTED';break;case YT.PlayerState.ENDED:stateName='ENDED';break;case YT.PlayerState.PLAYING:stateName='PLAYING';break;case YT.PlayerState.PAUSED:stateName='PAUSED';break;case YT.PlayerState.BUFFERING:stateName='BUFFERING';break;case YT.PlayerState.CUED:stateName='CUED';break}
190debugLog('['+videoID+'] YouTube player state: '+stateName);var iframe=player.getIframe();var container=iframe?iframe.closest('.nf-video-player'):null;if(container){if(event.data===YT.PlayerState.PLAYING){container.classList.add('nf-video-player--playing');container.classList.add('nf-video-player--initialized');emitNormalizedPlayerEvent(containerID,'play',{provider:'youtube'})}else if(event.data===YT.PlayerState.PAUSED||event.data===YT.PlayerState.ENDED){container.classList.remove('nf-video-player--playing');if(event.data===YT.PlayerState.PAUSED){emitNormalizedPlayerEvent(containerID,'pause',{provider:'youtube'})}else{emitNormalizedPlayerEvent(containerID,'ended',{provider:'youtube'})}}}
191if(preview&&event.data===YT.PlayerState.PLAYING){debugLog('['+videoID+'] Preview mode - setting 5 second timer');var playerData=window.nfVideoPlayers[containerID];if(playerData&&playerData.previewTimer){clearTimeout(playerData.previewTimer)}
192var previewTimer=setTimeout(function(){debugLog('['+videoID+'] Preview 5 seconds elapsed, restarting');player.seekTo(0);player.playVideo()},5000);if(playerData){playerData.previewTimer=previewTimer}}
193if(preview&&event.data===YT.PlayerState.PAUSED){debugLog('['+videoID+'] Preview paused, clearing timer');var playerData=window.nfVideoPlayers[containerID];if(playerData&&playerData.previewTimer){clearTimeout(playerData.previewTimer);playerData.previewTimer=null}}
194if(event.data===YT.PlayerState.ENDED&&!preview){debugLog('['+videoID+'] Video has ended');if(front&&autoplay&&shorts){debugLog('Video ferdig... restart loop ['+videoID+']');if(typeof player.unMute==='function'){player.unMute()}
195player.seekTo(0);player.playVideo()}else{debugLog('['+videoID+'] Video ended, sending nextSlide message');maybeTriggerNextSlide(containerID)}}}
196function initGenericEmbedPlayer(container,playerData){var videoID=playerData.videoID;var playerSize=getRenderedVideoPlayerSize(container,playerData);var autoplay=!!playerData.autoplay;var embedHtml=decodeBase64Utf8(playerData.embedHtmlBase64);var wrapper=document.createElement('div');wrapper.className='nf-video-player__embed nf-video-player__embed--'+(playerData.type||'external');wrapper.style.width=playerSize.width+'px';wrapper.style.height=playerSize.height+'px';wrapper.style.maxWidth='100%';wrapper.style.maxHeight='100%';if(embedHtml){if(autoplay){embedHtml=injectAutoplayIntoEmbedHtml(embedHtml,!0)}
197wrapper.innerHTML=embedHtml}else if(playerData.videoUrl){var iframe=document.createElement('iframe');
197iframe.src=autoplay?applyAutoplayParamsToUrl(playerData.videoUrl,!0):playerData.videoUrl;iframe.setAttribute('allowfullscreen','allowfullscreen');iframe.setAttribute('allow','autoplay; fullscreen; picture-in-picture');iframe.setAttribute('frameborder','0');wrapper.appendChild(iframe)}else{debugLog('No generic embed HTML or URL for VideoID '+videoID);playerData.initialized=!1;return}
198container.innerHTML='';container.appendChild(wrapper);activateInlineScripts(wrapper);container.classList.add('nf-video-player--initialized');playerData.player=wrapper;emitNormalizedPlayerEvent(container.id,'ready',{provider:playerData.type||'external'})}
199function initRMPlayer(container,playerData){var videoID=playerData.videoID;var containerID=container.id;var streamType=playerData.streamType;var autoplay=playerData.autoplay;var preview=playerData.preview;var shorts=playerData.shorts;var minimalUi=!!playerData.minimalUi;var forceMutedPlayback=!!(playerData.muted||preview||autoplay);var sourceRatio=(playerData.sourceRatio&&playerData.sourceRatio>0)?playerData.sourceRatio:playerData.ratio;playerData.ready=!1;var inFancybox=!!container.closest('.fancybox__content');var inIframe=(typeof window!=='undefined'&&window.self!==window.top);debugLog('Initializing RMP player for VideoID '+videoID+' (containerID: '+containerID+', streamType: '+streamType+', inFancybox: '+inFancybox+', shorts: '+shorts+', width: '+playerData.width+', height: '+playerData.height+', autoplay: '+autoplay+')');if(inFancybox&&shorts){container.classList.add('nf-video-fancybox')}
200var playerContainer=document.createElement('div');playerContainer.id='rmp_player_'+containerID;playerContainer.style.width='100%';playerContainer.style.height='100%';playerContainer.style.position='absolute';playerContainer.style.top='0';playerContainer.style.left='0';playerContainer.style.zIndex='0';if(inFancybox&&shorts){playerContainer.classList.add('nf-video-fancybox__rmp')}
201container.insertBefore(playerContainer,container.firstChild);var playerWidth,playerHeight;var containerRatio=(playerData.ratio&&playerData.ratio>0)?playerData.ratio:(shorts?(9/16):(16/9));var iframeTargetRatio=containerRatio;var renderedSize=getRenderedVideoPlayerSize(container,playerData);if(inFancybox&&shorts){playerHeight=Math.floor(window.innerHeight*0.9);playerWidth=Math.floor(playerHeight*9/16)}else if(inIframe&&!shorts&&iframeTargetRatio>0){if(iframeTargetRatio>=1){var fitHeightFromWidth=Math.round(window.innerWidth/iframeTargetRatio);if(fitHeightFromWidth<=window.innerHeight){playerWidth=window.innerWidth;playerHeight=fitHeightFromWidth}else{playerHeight=window.innerHeight;playerWidth=Math.round(window.innerHeight*iframeTargetRatio)}}else{var fitWidthFromHeight=Math.round(window.innerHeight*iframeTargetRatio);if(fitWidthFromHeight<=window.innerWidth){playerHeight=window.innerHeight;playerWidth=fitWidthFromHeight}else{playerWidth=window.innerWidth;playerHeight=Math.round(window.innerWidth/iframeTargetRatio)}}}else if(!inFancybox&&!shorts){playerWidth=renderedSize.width;playerHeight=renderedSize.height}else{playerWidth=playerData.width;playerHeight=playerData.height}
202var isVertical=(sourceRatio&&sourceRatio<1)||(playerWidth&&playerHeight&&playerWidth<playerHeight);debugLog('Video '+videoID+' isVertical: '+isVertical+', containerRatio: '+playerData.ratio+', sourceRatio: '+sourceRatio);var shouldCenterPlayerBox=!!(inIframe&&!shorts&&iframeTargetRatio>0&&(playerWidth<window.innerWidth||playerHeight<window.innerHeight));function centerPlayerBox(){if(!shouldCenterPlayerBox){return}
203playerContainer.style.width=String(playerWidth)+'px';playerContainer.style.height=String(playerHeight)+'px';playerContainer.style.left='50%';playerContainer.style.top='50%';playerContainer.style.right='auto';playerContainer.style.transform='translate(-50%, -50%)'}
204centerPlayerBox();function hideRMPlayerUiElement(element){if(!element||!element.style){return}
205element.style.display='none';element.style.visibility='hidden';element.style.opacity='0';element.style.pointerEvents='none'}
206function applyMinimalRMPlayerUi(){if(!minimalUi){return}
207playerContainer.classList.add('nf-rmp-minimal-ui');var hideSelectors=['.rmp-control-bar','.rmp-title-area','.rmp-description','.rmp-module','.rmp-module-overlay','.rmp-module-overlay-icons','.rmp-logo','.rmp-airplay-ui','.rmp-airplay','.rmp-playlist-left-arrow','.rmp-playlist-right-arrow','.rmp-360-nav','.rmp-360-text'];for(var i=0;i<hideSelectors.length;i++){var elements=playerContainer.querySelectorAll(hideSelectors[i]);for(var j=0;j<elements.length;j++){hideRMPlayerUiElement(elements[j])}}}
208function forceMutedLocalPlayback(){if(!forceMutedPlayback||playerData.userVolumeInteraction){return}
209if(typeof rmp!=='undefined'&&rmp){if(typeof rmp.setMute==='function'){try{rmp.setMute(!0)}catch(ignoreSetMute){}}else if(typeof rmp.mute==='function'){try{rmp.mute()}catch(ignoreMute){}}}
210var media=playerContainer.querySelector('video, audio');if(media){media.muted=!0;media.defaultMuted=!0;media.setAttribute('muted','');media.setAttribute('playsinline','')}}
211var useHLS=(streamType==='hls');var scaleMode='fit';var settings={pathToRmpFiles:'/src/lib/mediaplayer/radiantmediaplayer
211-'+(window.RMPVERSION||'10.6.1')+'/',licenseKey:window.MEDIAPLAYER_LICENSEKEY||'',src:playerData.src,delayToFade:3500,preload:'smart',skin:'s1',width:playerWidth,height:playerHeight,scaleMode:scaleMode,responsive:((inFancybox&&shorts)||inIframe)?!1:!0,controls:!0,quickRewind:10,quickForward:10,automaticFullscreenOnLandscape:!0,forceHlsJSOnAppleDevices:!0,strictGdprCompliance:!0,autoplay:autoplay,contentMetadata:{title:playerData.title,description:playerData.description,id:videoID,poster:[playerData.posterUrl]}};debugLog('RMP settings for '+videoID+': scaleMode='+settings.scaleMode+', responsive='+settings.responsive+', width='+settings.width+', height='+settings.height);if(forceMutedPlayback){settings.muted=!0}
212if(preview){settings.muted=!0;settings.loop=!0;if(autoplay){settings.muted=!0;settings.viewableAutoplay=!0;settings.viewablePlayPause=!0}}else if(autoplay){settings.muted=!0;if(inIframe){settings.viewableAutoplay=!1;settings.viewablePlayPause=!1}else{settings.viewableAutoplay=!0;settings.viewablePlayPause=!0}}
213if(streamType==='audio'){settings.autoHeightMode=!0;settings.autoHeightModeRatio=playerData.width/playerData.height;settings.audioOnly=!0;settings.pdCheckCodecsDone=!0;if(playerData.posterUrl){settings.audioOnlyUseVideoLayout=!0}}
214var rmp=new RadiantMP(playerContainer.id);var hasLoggedFirstTimeupdate=!1;var posterHidden=!1;function markUserControlledLocalVolume(){playerData.userVolumeInteraction=!0}
215function clearNativeMutedState(){var media=playerContainer.querySelector('video, audio');if(media){media.muted=!1;media.defaultMuted=!1;media.removeAttribute('muted')}}
216function maybeMarkVolumeInteraction(event){var target=event&&event.target;if(target&&target.closest&&target.closest('.rmp-volume, .rmp-volume-container')){markUserControlledLocalVolume();markUserVolumePreference()}}
217function maybeClearMutedAfterVolumeInteraction(event){var target=event&&event.target;if(target&&target.closest&&target.closest('.rmp-volume, .rmp-volume-container')){markUserControlledLocalVolume();markUserVolumePreference();setTimeout(clearNativeMutedState,0)}}
218playerContainer.addEventListener('pointerdown',maybeMarkVolumeInteraction);playerContainer.addEventListener('touchstart',maybeMarkVolumeInteraction);playerContainer.addEventListener('click',maybeClearMutedAfterVolumeInteraction);playerContainer.addEventListener('keydown',maybeMarkVolumeInteraction);playerContainer.addEventListener('keyup',maybeClearMutedAfterVolumeInteraction);function hidePosterAndOverlay(){if(posterHidden){return}
219var poster=container.querySelector('.nf-video-player__poster');if(poster){poster.style.opacity='0';poster.style.visibility='hidden'}
220var overlay=container.querySelector('.nf-video-player__play-overlay');if(overlay){overlay.style.display='none';overlay.style.pointerEvents='none'}
221posterHidden=!0}
222function restorePosterAndOverlay(){if(minimalUi){posterHidden=!1;return}
223var poster=container.querySelector('.nf-video-player__poster');var overlay=container.querySelector('.nf-video-player__play-overlay');if(poster){poster.style.opacity='1';poster.style.visibility='visible'}
224if(overlay){overlay.style.display='flex';overlay.style.pointerEvents='auto'}
225posterHidden=!1}
226rmp.on('error',function(error){debugLog('['+videoID+'] RMP ERROR: '+JSON.stringify(error));emitNormalizedPlayerEvent(containerID,'error',{provider:'local',error:error})});rmp.on('ready',function(){debugLog('['+videoID+'] RMP ready event fired');playerData.ready=!0;emitNormalizedPlayerEvent(containerID,'ready',{provider:'local'});container.classList.add('nf-video-player--initialized');var video=playerContainer.querySelector('video');if(video){var rect=video.getBoundingClientRect();debugLog('['+videoID+'] Video element created: '+Math.round(rect.width)+'x'+Math.round(rect.height)+', display='+window.getComputedStyle(video).display)}
227applyMinimalRMPlayerUi();centerPlayerBox();forceMutedLocalPlayback();if(!preview&&!autoplay&&!hasStoredUserVolumePreference()&&typeof rmp.setVolume==='function'){rmp.setVolume(1)}
228if(playerData.pendingPlayOptions){var pendingPlayOptions=playerData.pendingPlayOptions;var pendingToken=pendingPlayOptions.playRequestToken||0;if(!pendingToken||pendingToken===shortsPlaybackState.playRequestToken){playerData.pendingPlayOptions=null;setTimeout(function(){controlPlayer(containerID,'play',pendingPlayOptions)},0)}else{playerData.pendingPlayOptions=null}}else if(autoplay){setTimeout(function(){controlPlayer(containerID,'play',{muted:!0}
228)},0)}});rmp.on('play',function(){var playTime=(typeof rmp.getCurrentTime==='function')?rmp.getCurrentTime():null;forceMutedLocalPlayback();container.classList.add('nf-video-player--playing');emitNormalizedPlayerEvent(containerID,'play',{provider:'local'});if(playTime!=null&&playTime>0.05){hidePosterAndOverlay()}
229applyMinimalRMPlayerUi();centerPlayerBox()});rmp.on('pause',function(){container.classList.remove('nf-video-player--playing');emitNormalizedPlayerEvent(containerID,'pause',{provider:'local'});applyMinimalRMPlayerUi();centerPlayerBox()});rmp.on('timeupdate',function(){forceMutedLocalPlayback();if(hasLoggedFirstTimeupdate){var t2=(typeof rmp.getCurrentTime==='function')?rmp.getCurrentTime():null;if(t2!=null&&t2>0.05){hidePosterAndOverlay()}
230return}
231hasLoggedFirstTimeupdate=!0;var t=(typeof rmp.getCurrentTime==='function')?rmp.getCurrentTime():null;if(t!=null&&t>0.05){hidePosterAndOverlay()}});rmp.on('ended',function(){container.classList.remove('nf-video-player--playing');restorePosterAndOverlay();applyMinimalRMPlayerUi();centerPlayerBox();emitNormalizedPlayerEvent(containerID,'ended',{provider:'local'});if(!preview){debugLog('['+videoID+'] Video ended, evaluating nextSlide');maybeTriggerNextSlide(containerID)}});if(typeof gtag!=='undefined'){settings.enableGAVideoTracking=!0;settings.gaEvents=['context','fullminutewatched','ready','playerstart','bufferstalled','ended','error'];settings.gaEventParameters={'video_title':playerData.title,'video_url':window.MEDIAPROVIDER+'?VideoID='+videoID+'&shorts='+(shorts?'1':'0')};var watchComplete95=!1,watchComplete75=!1,watchComplete50=!1,watchComplete25=!1,watchComplete10=!1,watchComplete100=!1;rmp.on('playerstart',function(){watchComplete95=!1;watchComplete75=!1;watchComplete50=!1;watchComplete25=!1;watchComplete10=!1;watchComplete100=!1});rmp.on('timeupdate',function(){var percentViewed=rmp.getPercentViewed();if(!watchComplete95&&percentViewed>=95){gtag('event','watchComplete95',{'video_url':window.MEDIAPROVIDER+'?VideoID='+videoID+'&shorts='+(shorts?'1':'0'),'nf_platform':window.nf_platform||'web'});watchComplete95=!0}else if(!watchComplete75&&percentViewed>=75){gtag('event','watchComplete75',{'video_url':window.MEDIAPROVIDER+'?VideoID='+videoID+'&shorts='+(shorts?'1':'0'),'nf_platform':window.nf_platform||'web'});watchComplete75=!0}else if(!watchComplete50&&percentViewed>=50){gtag('event','watchComplete50',{'video_url':window.MEDIAPROVIDER+'?VideoID='+videoID+'&shorts='+(shorts?'1':'0'),'nf_platform':window.nf_platform||'web'});watchComplete50=!0}else if(!watchComplete25&&percentViewed>=25){gtag('event','watchComplete25',{'video_url':window.MEDIAPROVIDER+'?VideoID='+videoID+'&shorts='+(shorts?'1':'0'),'nf_platform':window.nf_platform||'web'});watchComplete25=!0}else if(!watchComplete10&&percentViewed>=10){gtag('event','watchComplete10',{'video_url':window.MEDIAPROVIDER+'?VideoID='+videoID+'&shorts='+(shorts?'1':'0'),'nf_platform':window.nf_platform||'web'});watchComplete10=!0}});rmp.on('ended',function(){gtag('event','watchComplete100',{'video_url':window.MEDIAPROVIDER+'?VideoID='+videoID+'&shorts='+(shorts?'1':'0'),'nf_platform':window.nf_platform||'web'});watchComplete100=!0})}
232if(preview){var previewTimer=null;rmp.on('play',function(){debugLog('['+videoID+'] Local preview started playing');if(previewTimer)clearTimeout(previewTimer);previewTimer=setTimeout(function(){debugLog('['+videoID+'] Local preview 5 seconds elapsed, restarting');rmp.seekTo(0);rmp.play()},5000)});rmp.on('pause',function(){debugLog('['+videoID+'] Local preview paused');if(previewTimer){clearTimeout(previewTimer);previewTimer=null}})}
233rmp.init(settings);playerData.player=rmp;setTimeout(function(){var videoElement=playerContainer.querySelector('video');if(videoElement){debugLog('['+videoID+'] Video element created: '+videoElement.offsetWidth+'x'+videoElement.offsetHeight+', display='+window.getComputedStyle(videoElement).display)}else{debugLog('['+videoID+'] WARNING: No video element found after RMP init');debugLog('['+videoID+'] PlayerContainer HTML: '+playerContainer.innerHTML.substring(0,200))}},500)}
234function initVideoPlayer(container){var containerID=container.id;var playerData=window.nfVideoPlayers[containerID];if(!playerData){return}
235if(playerData.initialized){return}
236var videoType=playerData.type;if(playerData.preview&&!playerData.autoplay){var inFancybox=!!container.closest('.fancybox__content');if(!inFancybox){debugLog('Deferring initialization for VideoID '+playerData.videoID+' - preview without autoplay');return}}
237debugLog('Initializing video player: '+containerID);playerData.initialized=!0;container.removeAttribute('data-lazy');if(videoType==='youtube'){if(!youtubeAPIReady){loadYouTubeAPI();youtubeAPIQueue.push(function(){initYouTubePlayer(container,playerData)})}else{initYouTubePlayer(container,playerData)}}else if(videoType==='vimeo'){if(!vimeoAPIReady){loadVimeoAPI();vimeoAPIQueue.push(function(){initVimeoPlayer(container,playerData)})}else{initVimeoPlayer(container,playerData)}}else if(videoType==='local'){var src=playerData.src;
237var hasSrc=src!=null&&src!==''&&(typeof src!=='object'||Object.keys(src).length>0);if(!hasSrc){debugLog('Skipping RMP init for '+containerID+' - no video source (playerData.src empty)');playerData.initialized=!1;return}
238if(typeof RadiantMP==='undefined'){loadRMPAPI();rmpAPIQueue.push(function(){initRMPlayer(container,playerData)})}else{initRMPlayer(container,playerData)}}else{initGenericEmbedPlayer(container,playerData)}}
239window.nfInitVideoPlayer=initVideoPlayer;function attachPlayButtonHandler(video){var playOverlay=video.querySelector('.nf-video-player__play-overlay');if(playOverlay&&!playOverlay.getAttribute('data-click-attached')){playOverlay.setAttribute('data-click-attached','true');playOverlay.addEventListener('click',function(e){e.preventDefault();e.stopPropagation();debugLog('Play button clicked for: '+video.id);if(video.getAttribute('data-lazy')==='true'){initVideoPlayer(video)}
240var containerID=video.id;var playerData=window.nfVideoPlayers?window.nfVideoPlayers[containerID]:null;if(playerData&&playerData.shorts){scheduleShortPlay(containerID,{source:'play-overlay',delayMs:180,stopOthers:!0,unmuted:!playerData.preview,muted:!!playerData.preview,seekToStart:!!playerData.preview})}else if(playerData&&!playerData.shorts){var pollCount=0;var maxPoll=50;var pollInterval=setInterval(function(){pollCount++;var pd=window.nfVideoPlayers?window.nfVideoPlayers[containerID]:null;if(pd&&pd.player){clearInterval(pollInterval);controlPlayer(containerID,'play')}else if(pollCount>=maxPoll){clearInterval(pollInterval)}},100)}})}}
241function resolveLeftmostShortContainerID($parent){var $items=$parent.find('.nf-js-scrollable-item');var $wrapper=$parent.find('.nf-js-scrollable-wrapper').first();if(!$items.length||!$wrapper.length){return null}
242var wrapperLeft=$wrapper.offset().left;var bestContainerID=null;var bestDelta=Number.MAX_SAFE_INTEGER;$items.each(function(){var $item=$(this);var itemLeft=$item.offset().left;var itemRight=itemLeft+$item.outerWidth();var intersectsLeftEdge=itemRight>=wrapperLeft-5;if(!intersectsLeftEdge){return}
243var $videoPlayer=$item.find('.nf-video-player').first();if(!$videoPlayer.length){return}
244var containerID=$videoPlayer.attr('id');if(!containerID||!window.nfVideoPlayers||!window.nfVideoPlayers[containerID]){return}
245var playerData=window.nfVideoPlayers[containerID];if(!isShortsPlayer(playerData)||!playerData.preview){return}
246var delta=Math.abs(itemLeft-wrapperLeft);if(delta<bestDelta){bestDelta=delta;bestContainerID=containerID}});if(bestContainerID){return bestContainerID}
247var $fallback=$items.first().find('.nf-video-player').first();return $fallback.length?$fallback.attr('id'):null}
248function handleShortVideoNavigation($parent){if(!$parent||!$parent.length){return}
249pauseAllShortVideos(null,{source:'carousel-navigation',onlyPreview:!0});invalidateShortsPlayRequests();setTimeout(function(){var containerID=resolveLeftmostShortContainerID($parent);if(!containerID){debugLog('WARNING: No primary video found at wrapper left edge!');return}
250scheduleShortPlay(containerID,{source:'carousel-navigation',delayMs:100,stopOthers:!0,muted:!0,seekToStart:!0})},50)}
251window.nfHandleShortVideoNavigation=handleShortVideoNavigation;function initLazyLoading(){if(typeof window.nfInitVideoPlayerRegistry==='function'){window.nfInitVideoPlayerRegistry(document)}
252if(!window.IntersectionObserver){debugLog('IntersectionObserver not supported - initializing all videos immediately');var videos=document.querySelectorAll('.nf-video-player[data-lazy="true"]');for(var i=0;i<videos.length;i++){initVideoPlayer(videos[i])}
253return}
254var observerOptions={root:null,rootMargin:'100px',threshold:0.01};var observer=new IntersectionObserver(function(entries){entries.forEach(function(entry){if(entry.isIntersecting){var container=entry.target;var fancyboxParent=container.closest('.fancybox__content');if(fancyboxParent){debugLog('Video container '+container.id+' is inside Fancybox, skipping Intersection Observer initialization');return}
255var containerStyle=window.getComputedStyle(container);if(containerStyle.display==='none'||containerStyle.visibility==='hidden'){debugLog('Video container '+container.id+' itself is hidden, skipping initialization');return}
256var parent=container.parentElement;while(parent&&parent!==document.body){var parentStyle=window.getComputedStyle(parent);if(parentStyle.display==='none'||parentStyle.visibility==='hidden'){debugLog('Video container '+container.id+' is inside hidden parent ('+parent.i
256d+' or '+parent.className+'), skipping initialization');return}
257parent=parent.parentElement}
258debugLog('Video container entering viewport: '+container.id);initVideoPlayer(container);observer.unobserve(container)}})},observerOptions);var videos=document.querySelectorAll('.nf-video-player[data-lazy="true"]');debugLog('Found '+videos.length+' lazy video containers');videos.forEach(function(video){var parent=video.parentElement;var isHidden=!1;while(parent&&parent!==document.body){var parentStyle=window.getComputedStyle(parent);if(parentStyle.display==='none'||parentStyle.visibility==='hidden'){debugLog('Skipping observation of '+video.id+' - inside hidden parent');isHidden=!0;break}
259parent=parent.parentElement}
260if(!isHidden){observer.observe(video);attachPlayButtonHandler(video)}})}
261function setupFancyboxObserver(){if(!document.body){return}
262var fancyboxObserver=new MutationObserver(function(mutations){mutations.forEach(function(mutation){mutation.addedNodes.forEach(function(node){if(node.nodeType===1&&node.classList&&node.classList.contains('fancybox__container')){setTimeout(function(){handleFancyboxReveal()},100)}});mutation.removedNodes.forEach(function(node){if(node.nodeType===1&&node.classList&&node.classList.contains('fancybox__container')){handleFancyboxDestroy()}})})});fancyboxObserver.observe(document.body,{childList:!0,subtree:!1})}
263function handleShortsFancyboxInit(fancybox){shortsPlaybackState.fancyboxOpen=!0;
263invalidateShortsPlayRequests();pauseAllShortVideos(null,{source:'fancybox-init',onlyPreview:!0});handleShortsFancyboxChange(fancybox,{delayMs:280})}
264function handleShortsFancyboxBeforeChange(){invalidateShortsPlayRequests();pauseAllShortVideos(null,{source:'fancybox-before-change'})}
265function handleShortsFancyboxChange(fancybox,options){options=options||{};shortsPlaybackState.fancyboxOpen=!0;invalidateShortsPlayRequests();pauseAllShortVideos(null,{source:'fancybox-change'});var activeContainer=getSelectedFancyboxVideoContainer(fancybox);if(!activeContainer||!activeContainer.id){shortsPlaybackState.activeFancyboxContainerID=null;return}
266shortsPlaybackState.activeFancyboxContainerID=activeContainer.id;scheduleShortPlay(activeContainer.id,{source:'fancybox-change',containerElement:activeContainer,delayMs:options.delayMs||220,maxRetries:40,retryDelayMs:150,stopOthers:!0,unmuted:!0})}
267function handleShortsFancyboxDestroy(){invalidateShortsPlayRequests();pauseAllShortVideos(null,{source:'fancybox-destroy-controller'});shortsPlaybackState.fancyboxOpen=!1;shortsPlaybackState.activeFancyboxContainerID=null;setTimeout(function(){if(typeof $!=='function'){return}
268$('.nf-c-kortvideoer-hori__wrapper').each(function(){handleShortVideoNavigation($(this))})},250)}
269function shouldHandleNextSlideMessage(payload){if(!shortsPlaybackState.fancyboxOpen){return!1}
270if(!payload||typeof payload!=='object'||!payload.containerID){return!1}
271if(shortsPlaybackState.activeFancyboxContainerID&&payload.containerID!==shortsPlaybackState.activeFancyboxContainerID){return!1}
272var now=Date.now();if(now<shortsPlaybackState.nextSlideCooldownUntil){return!1}
273shortsPlaybackState.nextSlideCooldownUntil=now+200;return!0}
274window.nfShortsVideoController={pauseAllShortVideos:function(options){pauseAllShortVideos(null,options||{})},playShortVideo:function(containerID,options){scheduleShortPlay(containerID,options||{})},onFancyboxInit:handleShortsFancyboxInit,onFancyboxBeforeChange:handleShortsFancyboxBeforeChange,onFancyboxChange:handleShortsFancyboxChange,onFancyboxDestroy:handleShortsFancyboxDestroy,shouldHandleNextSlideMessage:shouldHandleNextSlideMessage,getActiveFancyboxContainerID:function(){return shortsPlaybackState.activeFancyboxContainerID}};function handleFancyboxReveal(){debugLog('Fancybox revealed, syncing shorts playback');shortsPlaybackState.fancyboxOpen=!0;
274invalidateShortsPlayRequests();pauseAllShortVideos(null,{source:'fancybox-reveal',onlyPreview:!0});var selected=document.querySelector('.fancybox__slide.is-selected .nf-video-player, .fancybox__content .nf-video-player');if(selected&&selected.id){shortsPlaybackState.activeFancyboxContainerID=selected.id;scheduleShortPlay(selected.id,{source:'fancybox-reveal',containerElement:selected,delayMs:220,maxRetries:40,retryDelayMs:150,stopOthers:!0,unmuted:!0})}}
275function handleFancyboxDestroy(){debugLog('Fancybox closing, pausing videos');invalidateShortsPlayRequests();pauseAllShortVideos(null,{source:'fancybox-destroy'});shortsPlaybackState.fancyboxOpen=!1;shortsPlaybackState.activeFancyboxContainerID=null;setTimeout(function(){if(typeof $!=='function'){return}
276$('.nf-c-kortvideoer-hori__wrapper').each(function(){handleShortVideoNavigation($(this))})},250)}
277var useLegacyFancyboxObserver=(window.self!==window.top);if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',function(){initLazyLoading();setupMutationObserver();bootstrapAutoplayShortPreviews(document);if(useLegacyFancyboxObserver){setupFancyboxObserver()}})}else{initLazyLoading();setupMutationObserver();bootstrapAutoplayShortPreviews(document);if(useLegacyFancyboxObserver){setupFancyboxObserver()}}
278if(window.addEventListener){window.addEventListener('load',function(){bootstrapAutoplayShortPreviews(document)})}
279setTimeout(function(){bootstrapAutoplayShortPreviews(document)},1500);function setupMutationObserver(){if(!window.MutationObserver||!document.body){return}
280var mutationObserver=new MutationObserver(function(mutations){var foundNewVideo=!1;mutations.forEach(function(mutation){mutation.addedNodes.forEach(function(node){if(node.nodeType===1){if(node.classList&&node.classList.contains('nf-video-player')&&node.getAttribute('data-lazy')==='true'){debugLog('New lazy video container detected: '+node.id);foundNewVideo=!0}
281if(node.querySelectorAll){var childVideos=node.querySelectorAll('.nf-video-player[data-lazy="true"]');if(childVideos.length>0){debugLog('Found '+childVideos.length+' lazy video containers in added content');foundNewVideo=!0}}}})});if(foundNewVideo){if(typeof window.nfInitVideoPlayerRegistry==='function'){window.nfInitVideoPlayerRegistry(document)}
282initLazyLoading();bootstrapAutoplayShortPreviews(document)}});mutationObserver.observe(document.body,{childList:!0,subtree:!0})}
283function bootstrapAutoplayShortPreviews(context){context=context||document;if(!context.querySelectorAll){return}
284if(typeof window.nfInitVideoPlayerRegistry==='function'){window.nfInitVideoPlayerRegistry(context)}
285var wrappers=[];if(context.matches&&context.matches('.nf-c-kortvideoer-hori__wrapper')){wrappers.push(context)}
286var childWrappers=context.querySelectorAll('.nf-c-kortvideoer-hori__wrapper');for(var w=0;w<childWrappers.length;w++){wrappers.push(childWrappers[w])}
287for(var i=0;i<wrappers.length;i++){var players=wrappers[i].querySelectorAll('.nf-js-scrollable-item .nf-video-player[data-shorts="1"][data-preview="1"]');for(var p=0;p<players.length;p++){var player=players[p];if(!player.id||player.getAttribute('data-nf-autoplay-bootstrap')==='1'){continue}
288if(player.getAttribute('data-autoplay')!=='1'){continue}
289if(!window.nfVideoPlayers||!window.nfVideoPlayers[player.id]){continue}
290player.setAttribute('data-nf-autoplay-bootstrap','1');scheduleShortPlay(player.id,{source:'autoplay-short-bootstrap',containerElement:player,delayMs:100,maxRetries:120,retryDelayMs:250,allowConcurrent:!0,stopOthers:!1,muted:!0,seekToStart:!0});break}}}
291window.nfControlVideoPlayer=controlPlayer})();(function($){'use strict';function safeGtagCheck(){if(typeof safeGtag!=='undefined'&&typeof safeGtag==='function'){return safeGtag.apply(this,arguments)}else if(typeof gtag!=='undefined'&&typeof gtag==='function'){return gtag.apply(this,arguments)}else{window.dataLayer=window.dataLayer||[];window.dataLayer.push(arguments)}}
292function getGDPRConsentCheck(vendorId){if(typeof getGDPRConsent!=='undefined'&&typeof getGDPRConsent==='function'){return getGDPRConsent(vendorId)}
293return!0}
294window.nfCMPUserDecided=window.nfCMPUserDecided||!1;function isCMPDecided(){if(typeof inMobiCMPLoaded==='undefined'||inMobiCMPLoaded===null){return!1}
295if(!inMobiCMPLoaded){return!0}
296return window.nfCMPUserDecided===!0}
297function runWhenCMPDecided(callback){if(typeof callback!=='function'){return}
298if(typeof inMobiCMPLoaded==='undefined'||inMobiCMPLoaded===null){return}
299if(isCMPDecided()){callback();return}
300let done=!1;function runOnce(){if(done){return}
301done=!0;window.nfCMPUserDecided=!0;callback()}
302if(typeof __tcfapi!=='undefined'){__tcfapi('addEventListener',2,function(tcData,success){if(success&&tcData&&tcData.eventStatus==='useractioncomplete'){runOnce()}})}
303setTimeout(function(){if(done){return}
304if(typeof Cookies!=='undefined'&&typeof Cookies.get==='function'){const cookie=Cookies.get('newsflow_gdpr_accepted');if(cookie!==undefined&&cookie!==null&&String(cookie).length>0){runOnce()}}},8000)}
305function isElementInViewport(el){if(!el||!el.getBoundingClientRect){return!1}
306const rect=el.getBoundingClientRect();return rect.top<window.innerHeight&&rect.bottom>0&&rect.left<window.innerWidth&&rect.right>0}
307function isElementNearViewport(el,margin){if(!el||!el.getBoundingClientRect){return!1}
308const viewportMargin=parseInt(margin||0,10);const rect=el.getBoundingClientRect();return rect.top<window.innerHeight+viewportMargin&&rect.bottom>-viewportMargin&&rect.left<window.innerWidth+viewportMargin&&rect.right>-viewportMargin}
309const EMPTY_CHECK_SELECTOR='.nf-o-annonse-container[data-ad-type="external"], .nf-o-annonse-container:not([data-ad-type])';const MIN_VIEWPORT_EMPTY_GRACE_MS=1000;const GPT_HEURISTIC_EMPTY_DELAY_MS=3000;const EMPTY_COLLAPSE_VIEWPORT_MARGIN_PX=250;let preservedEmptyCollapseTimeout=null;const VIEWPORT_EMPTY_CHECK_DELAYS_MS=[1000,2000,3000];function isAdMarkedEmpty($container){return $container.hasClass('nf-o-annonse-container--empty')||$container.attr('data-empty')==='1'}
310function isAdContainerAttached($container){return!!($container&&$container.length&&$container[0]&&document.documentElement.contains($container[0]))}
311function markAdViewportEntry($container){if(!$container.data('nf-ad-first-visible-at')){$container.data('nf-ad-first-visible-at',Date.now())}}
312function getRemainingViewportGraceMs($container){const firstVisibleAt=parseInt($container.data('nf-ad-first-visible-at')||0,10);if(!firstVisibleAt){return MIN_VIEWPORT_EMPTY_GRACE_MS}
313return Math.max(0,MIN_VIEWPORT_EMPTY_GRACE_MS-(Date.now()-firstVisibleAt))}
314function getViewportVisibleElapsedMs($container){const firstVisibleAt=parseInt($container.data('nf-ad-first-visible-at')||0,10);if(!firstVisibleAt){return 0}
315return Math.max(0,Date.now()-firstVisibleAt)}
316function markAdEmpty($container,options){const settings=options||{};$container.addClass('nf-o-annonse-container--empty').attr('data-empty','1');if(settings.gptConfirmed){$container.attr('data-gpt-empty','1')}
317if(settings.sandboxConfirmed){$container.attr('data-nf-sandbox-empty','1')}}
318function isSafeToCollapseEmptyAd($container){if(!isAdContainerAttached($container)){return!0}
319return!isElementNearViewport($container[0],EMPTY_COLLAPSE_VIEWPORT_MARGIN_PX)}
320function collapseMarkedEmptyAd($container,options){$container.removeClass('nf-ad-empty').removeAttr('data-nf-empty-preserved');markAdEmpty($container,options);hideEmptyAd($container)}
321function collapsePreservedEmptyAdsWhenSafe(){$('.nf-o-annonse-container[data-nf-empty-preserved="1"]').each(function(){const $container=$(this);if(isSafeToCollapseEmptyAd($container)){collapseMarkedEmptyAd($container)}})}
322function schedulePreservedEmptyAdCollapseSweep(){clearTimeout(preservedEmptyCollapseTimeout);preservedEmptyCollapseTimeout=setTimeout(function(){collapsePreservedEmptyAdsWhenSafe()},150)}
323function preserveEmptyAdSpace($container,options){const settings=options||{};$container.addClass('nf-ad-empty').attr('data-nf-empty-preserved','1');if(settings.sandboxConfirmed){$container.attr('data-nf-sandbox-empty','1')}
324schedulePreservedEmptyAdCollapseSweep()}
325function collapseEmptyAdWhenSafe($container,options){if(isSafeToCollapseEmptyAd($container)){collapseMarkedEmptyAd($container,options);return!0}
326preserveEmptyAdSpace($container,options);return!1}
327function clearViewportEmptyCheckState($container){const timerId=$container.data('nf-ad-view-check-timer');if(timerId){clearTimeout(timerId)}
328const graceTimerId=$container.data('nf-ad-grace-timer');if(graceTimerId){clearTimeout(graceTimerId)}
329$container.removeData('nf-ad-view-check-timer').removeData('nf-ad-grace-timer').removeData('nf-ad-view-check-scheduled').removeData('nf-ad-view-check-attempt').removeData('nf-ad-grace-scheduled').removeData('nf-ad-first-visible-at')}
330function schedulePostGraceAdCheck($container){if(!$container.data('nf-ad-first-visible-at')){if(!isElementInViewport($container[0])){clearViewportEmptyCheckState($container);return!0}
331markAdViewportEntry($container)}
332const remaining=getRemainingViewportGraceMs($container);if(remaining<=0){return!1}
333if($container.data('nf-ad-grace-scheduled')){return!0}
334$container.data('nf-ad-grace-scheduled',!0);$container.data('nf-ad-grace-timer',setTimeout(function(){$container.removeData('nf-ad-grace-scheduled').removeData('nf-ad-grace-timer');if(!isAdContainerAttached($container)||isAdMarkedEmpty($container)||$container.data('gpt-filled')===!0){return}
335if(!$container.data('nf-ad-first-visible-at')&&!isElementInViewport($container[0])){clearViewportEmptyCheckState($container);return}
336if(isGoogleGptSlot($container)){const gptState=getGoogleGptSlotState($container);if(gptState==='empty'){collapseGptEmptyContainer($container);return}}
337scheduleViewportEmptyCheck($container)},remaining));return!0}
338function evaluateVisibleAdContainer($container){if(!isAdContainerAttached($container)){clearViewportEmptyCheckState($container);return!0}
339if(isAdMarkedEmpty($container)){clearViewportEmptyCheckState($container);return!0}
340if($container.data('gpt-filled')===!0){clearViewportEmptyCheckState($container);return!0}
341if(!$container.data('nf-ad-first-visible-at')&&!isElementInViewport($container[0])){clearViewportEmptyCheckState($container);return!1}
342markAdViewportEntry($container);const adnuntiusSystemActive=typeof window.nfAdnuntiusSystemActive!=='undefined'&&window.nfAdnuntiusSystemActive;if(adnuntiusSystemActive&&isAdnuntiusSlot($container)){clearViewportEmptyCheckState($container);return!0}
343if(isSandboxedAdContainer($container)){clearViewportEmptyCheckState($container);return!0}
344if(isGoogleGptSlot($container)){const gptState=getGoogleGptSlotState($container);if(gptState==='empty'){collapseGptEmptyContainer($container);clearViewportEmptyCheckState($container);return!0}
345if(gptState==='filled'){clearViewportEmptyCheckState($container);return!0}
346return!1}
347if($container.attr('data-ad-type')==='external'&&isExternalAdContainerEmpty($container)){collapseEmptyAdWhenSafe($container);clearViewportEmptyCheckState($container);return!0}
348if(!hasNoMeaningfulAdContent($container)){clearViewportEmptyCheckState($container);return!0}
349collapseEmptyAdWhenSafe($container);clearViewportEmptyCheckState($container);return!0}
350function scheduleViewportEmptyCheck($container){if(isCMPDecided()&&$container.data('nf-cmp-check-pending')){$container.removeData('nf-cmp-check-pending')}
351if(isAdMarkedEmpty($container)||$container.data('gpt-filled')===!0){return}
352if(!isCMPDecided()){if(!$container.data('nf-cmp-check-pending')){$container.data('nf-cmp-check-pending',!0);runWhenCMPDecided(function(){$container.removeData('nf-cmp-check-pending');scheduleViewportEmptyCheck($container)})}
353return}
354if($container.data('nf-ad-view-check-scheduled')){return}
355const attempt=parseInt($container.data('nf-ad-view-check-attempt')||0,10);const delay=VIEWPORT_EMPTY_CHECK_DELAYS_MS[attempt];if(typeof delay==='undefined'){clearViewportEmptyCheckState($container);return}
356$container.data('nf-ad-view-check-scheduled',!0);$container.data('nf-ad-view-check-timer',setTimeout(function(){$container.removeData('nf-ad-view-check-scheduled').removeData('nf-ad-view-check-timer');if(evaluateVisibleAdContainer($container)){return}
357if(!isAdContainerAttached($container)||isAdMarkedEmpty($container)||$container.data('gpt-filled')===!0){clearViewportEmptyCheckState($container);return}
358$container.data('nf-ad-view-check-attempt',attempt+1);scheduleViewportEmptyCheck($container)},delay))}
359function trackAdImpressions(){if(!getGDPRConsentCheck("GDPR_VENDOR_GOOGLE")){return}
360if(typeof ga4id==='undefined'){return}
361$(".nf-o-annonse__adcounterimg").each(function(){const $img=$(this);if($img.data('impression-tracked')){return}
362$img.data('impression-tracked',!0);safeGtagCheck("event","impression_ad",{send_to:ga4id,item_name:$img.attr("data-label"),item_category:"banner",nf_platform:window.nf_platform||'web',})})}
363function isSandboxedAdContainer($container){return $container&&$container.length&&($container.attr('data-ad-sandbox')==='1'||$container.children('iframe[data-nf-sandboxed-ad="1"]').length>0)}
364function trackSandboxAdImpression($iframe){if(!$iframe||!$iframe.length||$iframe.data('impression-tracked')){return}
365if(!getGDPRConsentCheck("GDPR_VENDOR_GOOGLE")||typeof ga4id==='undefined'){return}
366$iframe.data('impression-tracked',!0);safeGtagCheck("event","impression_ad",{send_to:ga4id,item_name:$iframe.attr("data-label"),item_category:"banner",nf_platform:window.nf_platform||'web',})}
367function trackSandboxAdClick($iframe){if(!$iframe||!$iframe.length){return}
368if(!getGDPRConsentCheck("GDPR_VENDOR_GOOGLE")||typeof ga4id==='undefined'){return}
369safeGtagCheck("event","clicked_ad",{send_to:ga4id,item_name:$iframe.attr("data-label"),item_category:"banner",nf_platform:window.nf_platform||'web',})}
370function setupSandboxAdMessageListener(){if(window.nfSandboxAdMessageListenerAttached){return}
371window.nfSandboxAdMessageListenerAttached=!0;window.addEventListener('message',function(event){const data=event.data;if(!data||typeof data!=='object'||data.type!=='nf-sandbox-ad'||typeof data.slotId!=='string'){return}
372let $iframe=$();$('.nf-js-sandbox-ad-frame[data-nf-sandbox-slot]').each(function(){if($(this).attr('data-nf-sandbox-slot')===data.slotId&&this.contentWindow===event.source){$iframe=$(this);return!1}
373return!0});if(!$iframe.length){return}
374const $container=$iframe.closest('.nf-o-annonse-container');if(!$container.length){return}
375if(data.click===!0){trackSandboxAdClick($iframe);return}
376if(data.empty===!0||parseInt(data.height||0,10)<=0){collapseEmptyAdWhenSafe($container,{sandboxConfirmed:!0});return}
377const rawHeight=parseInt(data.height,10);if(!isFinite(rawHeight)||rawHeight<=0){return}
378const height=Math.max(1,Math.min(rawHeight,2400));const previousHeight=parseAdDimension($iframe.attr('height'));if(Math.abs(previousHeight-height)<=1&&$container.attr('data-empty')!=='1'){$container.parents('.nf-o-annonse-container').css({height:'auto',minHeight:'0',overflow:'visible',});if(data.impression===!0){trackSandboxAdImpression($iframe)}
379return}
380restoreAdVisibility($container);$iframe.attr('height',String(height)).css({height:height+'px',width:'100%',display:'block',});$container.attr('data-ad-sandbox-height',String(height)).css({height:height+'px',minHeight:'0',overflow:'visible',});$container.parents('.nf-o-annonse-container').css({height:'auto',minHeight:'0',overflow:'visible',});if(data.impression===!0){trackSandboxAdImpression($iframe)}})}
381setupSandboxAdMessageListener();function scheduleVisibleViewportAdChecks(){$(EMPTY_CHECK_SELECTOR).each(function(){const $container=$(this);if(isAdMarkedEmpty($container)||$container.data('nf-ad-view-check-scheduled')){return}
382if(!isElementInViewport($container[0])){return}
383markAdViewportEntry($container);scheduleViewportEmptyCheck($container)})}
384function attachViewportEmptyCheckHooks(){if(window.nfViewportEmptyHooksAttached){return}
385window.nfViewportEmptyHooksAttached=!0;let viewportCheckTimeout;function scheduleViewportHookSweep(){clearTimeout(viewportCheckTimeout);viewportCheckTimeout=setTimeout(function(){scheduleVisibleViewportAdChecks();collapsePreservedEmptyAdsWhenSafe();setupViewportAdObserver()},150)}
386$(window).on('scroll resize',function(){scheduleViewportHookSweep()});scheduleVisibleViewportAdChecks();setupViewportAdObserver()}
387window.trackAdImpressions=trackAdImpressions;function forceHide(el){if(el&&el.style){el.style.setProperty('display','none','important')}}
388function setupViewportAdObserver(){if(typeof IntersectionObserver==='undefined'){return}
389if(!window.nfAdViewportObserver){window.nfAdViewportObserver=new IntersectionObserver(function(entries){entries.forEac
389h(function(entry){const $container=$(entry.target);if(!entry.isIntersecting){return}
390if(isAdMarkedEmpty($container)){return}
391markAdViewportEntry($container);scheduleViewportEmptyCheck($container)})},{root:null,threshold:0,})}
392$(EMPTY_CHECK_SELECTOR).each(function(){const $container=$(this);if($container.data('nf-viewport-observed')){return}
393$container.data('nf-viewport-observed',!0);window.nfAdViewportObserver.observe(this)})}
394function hideEmptyAd($container){const gptConfirmedEmpty=$container.attr('data-gpt-empty')==='1';const sandboxConfirmedEmpty=$container.attr('data-nf-sandbox-empty')==='1';if(!gptConfirmedEmpty&&!sandboxConfirmedEmpty&&!isCMPDecided()){return}
395markAdEmpty($container,{gptConfirmed:gptConfirmedEmpty});forceHide($container[0]);const $parentContainer=$container.parent().closest('.nf-o-annonse-container');if($parentContainer.length&&!$parentContainer.hasClass('nf-o-annonse-container--empty')){const $siblings=$parentContainer.children('.nf-o-annonse-container').not($container);const $visibleSiblings=$siblings.filter(':visible');if($visibleSiblings.length===0){hideEmptyAd($parentContainer);return}}
396const $wrapper=$container.closest('.nf-o-annonse-wrapper, .nf-o-annonse, .nf-o-mobilannonse');if($wrapper.length){const $allContainers=$wrapper.find('.nf-o-annonse-container');const $emptyContainers=$wrapper.find('.nf-o-annonse-container--empty, .nf-o-annonse-container[data-empty="1"]');if($allContainers.length>0&&$allContainers.length===$emptyContainers.length){forceHide($wrapper[0]);if($wrapper.hasClass('nf-o-annonse-wrapper')){$wrapper.addClass('nf-o-annonse-wrapper--all-empty')}else if($wrapper.hasClass('nf-o-annonse')||$wrapper.hasClass('nf-o-mobilannonse')){$wrapper.addClass($wrapper.hasClass('nf-o-mobilannonse')?'nf-o-mobilannonse--all-empty':'nf-o-annonse--all-empty')}
397const $parentAnnonse=$wrapper.closest('.nf-o-annonse, .nf-o-mobilannonse');if($parentAnnonse.length&&$parentAnnonse[0]!==$wrapper[0]){forceHide($parentAnnonse[0]);$parentAnnonse.addClass($parentAnnonse.hasClass('nf-o-mobilannonse')?'nf-o-mobilannonse--all-empty':'nf-o-annonse--all-empty')}}}else{const $parent=$container.parent();if($parent.hasClass('nf-o-annonse')||$parent.hasClass('nf-o-mobilannonse')){forceHide($parent[0])}}}
398function collapseGptEmptyContainer($container){if(!$container||!$container.length){return}
399if(isAdMarkedEmpty($container)){return}
400if(schedulePostGraceAdCheck($container)){return}
401collapseEmptyAdWhenSafe($container,{gptConfirmed:!0})}
402function hasRenderableIframeSource($container){return $container.find('iframe[src]').filter(function(){const src=($(this).attr('src')||'').trim().toLowerCase();if(!src){return!1}
403return src!=='about:blank'&&src.indexOf('javascript:')!==0}).length>0}
404function restoreAdVisibility($container){$container.removeClass('nf-o-annonse-container--empty').removeClass('nf-ad-empty').removeAttr('data-empty').removeAttr('data-gpt-empty').removeAttr('data-gpt-empty-event').removeAttr('data-nf-empty-preserved').removeAttr('data-nf-sandbox-empty');if($container[0]&&$container[0].style){$container[0].style.removeProperty('display')}
405$container.show();$container.parents('.nf-o-annonse-container').each(function(){$(this).removeClass('nf-o-annonse-container--empty').removeClass('nf-ad-empty').removeAttr('data-empty').removeAttr('data-gpt-empty').removeAttr('data-gpt-empty-event').removeAttr('data-nf-empty-preserved').removeAttr('data-nf-sandbox-empty');if(this.style){this.style.removeProperty('display')}
406$(this).show()});$container.parents('.nf-o-annonse-wrapper, .nf-o-annonse, .nf-o-mobilannonse').each(function(){$(this).removeClass('nf-o-annonse-wrapper--all-empty').removeClass('nf-o-annonse--all-empty').removeClass('nf-o-mobilannonse--all-empty');if(this.style){this.style.removeProperty('display')}
407$(this).show()})}
408function recoverFalseEmptyAds(){let restoredCount=0;$('.nf-o-annonse-container--empty, .nf-o-annonse-container[data-empty="1"]').each(function(){const $container=$(this);if($container.attr('data-gpt-empty')==='1'||$container.attr('data-nf-sandbox-empty')==='1'){return}
409if(!hasRenderableIframeSource($container)&&!$container.find('.nf-ad-loaded').length){return}
410restoreAdVisibility($container);restoredCount++});return restoredCount}
411function setupIframeAdVisibilityObserver(){if(typeof MutationObserver==='undefined'||!document.body){return}
412const observer=new MutationObserver(function(mutations){let shouldRecover=!1;for(let i=0;i<mutations.length;i++){const m=mutations[i];if(m.type==='childList'){shouldRecover=!0;break}
413if(m.type==='attributes'&&(m.attributeName==='class'||m.attributeName==='style'||m.attributeName==='data-empty')){shouldRecover=!0;break}}
414if(shouldRecover){recoverFalseEmptyAds();scheduleAdFitDebounced(250)}});observer.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:['class','style','data-empty'],})}
415function watchGptSlotsForCollapse(){if(typeof MutationObserver==='undefined'){return}
416$('.nf-o-annonse-container[data-ad-type="external"]:not(.nf-o-annonse-container--empty)').each(function(){const $container=$(this);if($container.data('gpt-slot-observer')){return}
417const $gptDiv=$container.children('[id^="div-gpt-ad-"]').first();if(!$gptDiv.length){return}
418$container.data('gpt-slot-observer',!0);const collapseIfEmpty=function(){if(isAdMarkedEmpty($container)){return!0}
419const gptState=getGoogleGptSlotState($container);if(gptState==='empty'){collapseGptEmptyContainer($container);return!0}
420return gptState==='filled'};if(collapseIfEmpty()){return}
421const observer=new MutationObserver(function(){if(collapseIfEmpty()){observer.disconnect()}});observer.observe($gptDiv[0],{attributes:!0,attributeFilter:['style','class'],childList:!0,subtree:!0,})})}
422function initStaticAds(){$('.nf-js-ad-container[data-ad-type="static"]').each(function(){const $container=$(this);if($container.data('ad-initialized')){return}
423if($container.hasClass('nf-o-annonse-container--empty')||$container.attr('data-empty')==='1'){hideEmptyAd($container);return}
424const annonseID=$container.attr('data-annonse-id');const type=$container.attr('data-type');const imageUrl=$container.attr('data-image-url');const url=$container.attr('data-url');const altText=$container.attr('data-alt-text')||'';const newWindow=$container.attr('data-new-window')==='1';if(!imageUrl||imageUrl.trim()===''){hideEmptyAd($container);return}
425let width,height;if(isMobile()){width=$container.attr('data-mobile-width')||$container.attr('data-width');height=$container.attr('data-mobile-height')||$container.attr('data-height')}else{width=$container.attr('data-width');height=$container.attr('data-height')}
426let adHtml='';if(url){const linkAttrs='class="nf-o-annonse__link" data-label="'+type+'_'+annonseID+'" data-id="'+annonseID+'" href="'+url+'"';if(newWindow){adHtml+='<a '+linkAttrs+' target="_blank">'}else{adHtml+='<a '+linkAttrs+'>'}}
427if(imageUrl){adHtml+='<img class="nf-o-annonse__img" src="'+imageUrl+'" alt="'+altText+'"';
427if(width&&width!=='auto'&&width!=='100%'){adHtml+=' width="'+width+'"'}
428if(height&&height!=='auto'){adHtml+=' height="'+height+'"'}
429adHtml+=' onerror="if(typeof jQuery!==\'undefined\'){jQuery(this).closest(\'.nf-o-annonse-container\').addClass(\'nf-o-annonse-container--empty\').attr(\'data-empty\',\'1\').hide();if(typeof window.hideEmptyAd===\'function\'){window.hideEmptyAd(jQuery(this).closest(\'.nf-o-annonse-container\'));}}">'}
430if(url){adHtml+='</a>'}
431adHtml+='<img class="nf-o-annonse__adcounterimg" data-label="'+type+'_'+annonseID+'" data-id="'+annonseID+'" width="1" height="1" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="">';$container.html(adHtml);$container.data('ad-initialized',!0);if(typeof window.trackAdImpressions==='function'){window.trackAdImpressions()}})}
432function isGoogleGptSlot($container){return $container.children('[id^="div-gpt-ad-"]').length>0}
433function getGoogleGptSlotState($container){const $gptDiv=$container.children('[id^="div-gpt-ad-"]').first();const elapsedMs=getViewportVisibleElapsedMs($container);const allowHeuristicEmpty=elapsedMs>=GPT_HEURISTIC_EMPTY_DELAY_MS;if(!$gptDiv.length){return'pending'}
434if($container.data('gpt-filled')===!0){return'filled'}
435if($container.attr('data-gpt-empty-event')==='1'){return'empty'}
436if($gptDiv.css('display')==='none'||$gptDiv.css('visibility')==='hidden'){return allowHeuristicEmpty?'empty':'pending'}
437if($gptDiv.outerHeight()!==undefined&&$gptDiv.outerHeight()<=0){return allowHeuristicEmpty?'empty':'pending'}
438const $gptIframes=$container.find('iframe[id*="google_ads_iframe"], iframe[src*="doubleclick"], iframe[src*="googlesyndication"]');if($gptIframes.length>0){const hasVisibleIframe=$gptIframes.filter(function(){const $iframe=$(this);const iframeHeight=$iframe.outerHeight();return $iframe.css('display')!=='none'&&$iframe.css('visibility')!=='hidden'&&(typeof iframeHeight==='undefined'||iframeHeight>0)}).length>0;return hasVisibleIframe?'filled':'empty'}
439const $gptContainer=$container.find('[id*="google_ads_iframe"][id*="__container__"]');if($gptContainer.length>0){const hasVisibleContainer=$gptContainer.filter(function(){const $el=$(this);return $el.css('display')!=='none'&&$el.css('visibility')!=='hidden'&&$el.outerHeight()>0}).length>0;return hasVisibleContainer?'filled':(allowHeuristicEmpty?'empty':'pending')}
440const hasRenderableNode=$gptDiv.contents().filter(function(){const node=this;if(node.nodeType===8){return!1}
441if(node.nodeType===3){return $.trim(node.nodeValue||'')!==''}
442if(node.nodeType!==1){return!1}
443const tagName=(node.tagName||'').toLowerCase();if(tagName==='script'){return!1}
444const $el=$(node);return $el.css('display')!=='none'&&$el.css('visibility')!=='hidden'}).length>0;if(hasRenderableNode){return'filled'}
445const finalState=allowHeuristicEmpty?'empty':'pending';return finalState}
446function isGoogleGptSlotEmpty($container){return getGoogleGptSlotState($container)==='empty'}
447function isExternalAdContainerEmpty($container){if(isGoogleGptSlot($container)){return isGoogleGptSlotEmpty($container)}
448const $adnDiv=$container.find('[id^="adn_"], [id^="adn-"]').first();if(!$adnDiv.length){return!1}
449if($adnDiv.css('display')==='none'||$adnDiv.css('visibility')==='hidden'){return!0}
450const $visible=$adnDiv.find('iframe, img:visible, [style*="display: block"], [style*="display:block"]').filter(function(){return $(this).css('display')!=='none'&&$(this).css('visibility')!=='hidden'});return $visible.length===0&&$adnDiv.contents().length===0}
451function hasNoMeaningfulAdContent($container){if($container.children('[id^="div-gpt-ad-"]').length>0){return!1}
452if($container.find('[id^="adn_"], [id^="adn-"]').length>0){return!1}
453if($container.find('iframe[data-nf-sandboxed-ad="1"]').length>0){return!1}
454if($container.find('iframe[src]').length>0){return!1}
455if($container.find('img.nf-o-annonse__img').length>0){return!1}
456const $meaningful=$container.children().not('.nf-o-annonse__adcounterimg').filter(function(){const $el=$(this);if($el[0].nodeType===8){return!1}
457if($el.hasClass('nf-o-annonse__continue')&&$el.css('display')==='none'){return!1}
458return $el.css('display')!=='none'&&$el.css('visibility')!=='hidden'});return $meaningful.length===0}
459function checkEmptyAds(){if(!isCMPDecided()){return}
460recoverFalseEmptyAds();$('.nf-o-annonse-container--empty, .nf-o-annonse-container[data-empty="1"]').each(function(){const $container=$(this);if($container.attr('data-gpt-empty')==='1'||$container.attr('data-nf-sandbox-empty')==='1'){hideEmptyAd($container);return}
461if(hasRenderableIframeSource($container)){restoreAdVisibility($container);return}
462hideEmptyAd($container)})}
463function isAdnuntiusSlot($container){return $container.find('[id^="adn_"], [id^
463="adn-"]').length>0}
464function initParallaxAds(){const $parallax=$(".nf-js-annonse-parallax");if($parallax.length){const parallaxWidthOrig=$parallax.data("width");const parallaxHeightOrig=$parallax.data("height");if(parallaxWidthOrig&&parallaxHeightOrig){const parallaxRatio=parallaxHeightOrig/parallaxWidthOrig;const windowWidth=$("body").width();const parallaxWidthNew="100%";const parallaxHeightNew=Math.round(windowWidth*parallaxRatio);$parallax.css("width",parallaxWidthNew).css("height",parallaxHeightNew)}}}
465function parseAdDimension(value){if(typeof value==='number'&&isFinite(value)&&value>0){return Math.round(value)}
466if(typeof value==='string'){const trimmed=value.trim();if(!trimmed||trimmed==='auto'||trimmed==='100%'){return 0}
467const parsed=parseInt(trimmed.replace(/[^\d]/g,''),10);if(isFinite(parsed)&&parsed>0){return parsed}}
468return 0}
469function parseHtml5AdSizeMeta(content){if(typeof content!=='string'||!content){return null}
470let width=0;let height=0;content.split(',').forEach(function(part){const bits=part.split('=');if(bits.length!==2){return}
471const key=bits[0].trim().toLowerCase();const value=parseAdDimension(bits[1]);if(key==='width'){width=value}else if(key==='height'){height=value}});if(width>0&&height>0){return{width:width,height:height}}
472return null}
473function getHtml5IframeAdSize($iframe){const iframe=$iframe&&$iframe.length?$iframe[0]:null;if(!iframe){return null}
474try{const iframeDoc=iframe.contentDocument||(iframe.contentWindow?iframe.contentWindow.document:null);if(!iframeDoc){return null}
475const meta=iframeDoc.querySelector('meta[name="ad.size"]');const dimensions=meta?parseHtml5AdSizeMeta(meta.getAttribute('content')):null;if(!dimensions){return null}
476if(iframeDoc.documentElement){iframeDoc.documentElement.style.overflow='hidden'}
477if(iframeDoc.body){iframeDoc.body.style.overflow='hidden'}
478return dimensions}catch(e){return null}}
479function getRenderedAdDimensions($container){let bestWidth=0;let bestHeight=0;let bestArea=0;let bestIframeDimensions=null;const measuredElements=[];function considerElement($el){if(!$el||!$el.length){return}
480if($el.css('display')==='none'||$el.css('visibility')==='hidden'){return}
481const el=$el[0];if(!el){return}
482if(measuredElements.indexOf(el)!==-1){return}
483measuredElements.push(el);const tagName=el.tagName?el.tagName.toLowerCase():'';if(tagName!=='iframe'&&tagName!=='img'&&$el.find('iframe, img.nf-o-annonse__img').length>0){return}
484const iframeDimensions=tagName==='iframe'?getHtml5IframeAdSize($el):null;if(iframeDimensions){const container=$container[0];const containerRect=container&&container.getBoundingClientRect?container.getBoundingClientRect():null;const rect=el.getBoundingClientRect?el.getBoundingClientRect():null;const style=window.getComputedStyle?window.getComputedStyle(el):null;const marginBottom=style?parseFloat(style.marginBottom)||0:0;const measuredHeight=containerRect&&rect?Math.ceil(rect.top-containerRect.top+iframeDimensions.height+marginBottom):iframeDimensions.height;const height=Math.max(iframeDimensions.height,measuredHeight);const iframeArea=iframeDimensions.width*height;if(iframeArea>bestArea){bestArea=iframeArea;bestWidth=iframeDimensions.width;bestHeight=height;bestIframeDimensions=iframeDimensions}
485return}
486const rect=el.getBoundingClientRect?el.getBoundingClientRect():null;const width=Math.max(parseAdDimension($el.attr('width')),parseAdDimension($el.css('width')),parseAdDimension($el.outerWidth()),parseAdDimension(rect?rect.width:0));const height=Math.max(parseAdDimension($el.attr('height')),parseAdDimension($el.css('height')),parseAdDimension($el.outerHeight()),parseAdDimension(rect?rect.height:0));if(width<=0||height<=0){return}
487const area=width*height;if(area>bestArea){bestArea=area;bestWidth=width;bestHeight=height}}
488$container.children('[id^="adn_"], [id^="adn-"], [id^="div-gpt-ad-"], iframe, img.nf-o-annonse__img').each(function(){considerElement($(this))});$container.find('iframe, img.nf-o-annonse__img').each(function(){considerElement($(this))});if(bestWidth>0&&bestHeight>0){return{width:bestWidth,height:bestHeight,iframeDimensions:bestIframeDimensions}}
489return null}
490function getAdContainerAvailableWidth($container,fallbackWidth){const widths=[];const viewportWidth=document.documentElement?document.documentElement.clientWidth:window.innerWidth;$container.parent().add($container.closest('.nf-o-annonse-wrapper, .nf-o-mobilannonse, .nf-o-annonse')).each(function(){const rect=this.getBoundingClientRect?this.getBoundingClientRect():null;const width=parseAdDimension(rect?rect.width:0)||parseAdDimension(this.clientWidth);if(width>0){widths.push(width)}});if(viewportWidth>0){widths.push(viewportWidth)}
491if(!widths.length){return fallbackWidth}
492return Math.max(1,Math.min.apply(null,widths))}
493function applyHtml5IframeScale($iframe,iframeDimensions,scale){const iframe=$iframe&&$iframe.length?$iframe[0]:null;if(!iframe||!iframeDimensions){return}
494try{const iframeDoc=iframe.contentDocument||(iframe.contentWindow?iframe.contentWindow.document:null);if(!iframeDoc){return}
495const scaleValue=Math.min(1,Math.max(0.01,scale||1));const cssScale=Math.round(scaleValue*100000)/100000;let style=iframeDoc.getElementById('nf-html5-ad-scale');if(!style){style=iframeDoc.createElement('style');style.id='nf-html5-ad-scale';(iframeDoc.head||iframeDoc.documentElement).appendChild(style)}
496style.textContent='html,body{margin:0!important;padding:0!important;width:'+iframeDimensions.width+'px!important;height:'+iframeDimensions.height+'px!important;overflow:hidden!important;}'+'body{transform:scale('+cssScale+')!important;transform-origin:0 0!important;}'}catch(e){return}}
497function applyRenderedAdSize($container,dimensions){if(!$container||!$container.length||!dimensions){return}
498let targetWidth=dimensions.width;let targetHeight=dimensions.height;let iframeScale=1;if(dimensions.iframeDimensions){const availableWidth=getAdContainerAvailableWidth($container,dimensions.iframeDimensions.width);iframeScale=Math.min(1,availableWidth/dimensions.iframeDimensions.width);const iframeHeightOffset=Math.max(0,dimensions.height-dimensions.iframeDimensions.height);targetWidth=Math.round(dimensions.iframeDimensions.width*iframeScale);targetHeight=Math.ceil(iframeHeightOffset+dimensions.iframeDimensions.height*iframeScale)}
499const prevWidth=parseAdDimension($container.attr('data-ad-fitted-width'));const prevHeight=parseAdDimension($container.attr('data-ad-fitted-height'));const widthChanged=Math.abs(prevWidth-targetWidth)>1;const heightChanged=Math.abs(prevHeight-targetHeight)>2;const hasDynamicReadPeakIframe=$container.find('iframe[id^="rp_iframe_"], iframe[src*="app.readpeak.com/get"]').length>0;const inLeftSideColumn=$container.closest('.nf-o-annonse-column--left').length>0;const inSideColumn=inLeftSideColumn||$container.closest('.nf-o-annonse-column').length>0;const alignMode=inSideColumn?(inLeftSideColumn?'left-column':'right-column'):'center';const prevAlignMode=$container.attr('data-ad-fitted-align')||'';const sizeCss={width:targetWidth+'px',maxWidth:'100%',minHeight:'0',};if(inSideColumn){if(inLeftSideColumn){sizeCss.marginLeft='auto';sizeCss.marginRight='0';sizeCss.float='right'}else{sizeCss.marginLeft='0';sizeCss.marginRight='auto';sizeCss.float='left'}}else{sizeCss.marginLeft='auto';sizeCss.marginRight='auto';sizeCss.float='none'}
500const $html5Iframe=dimensions.iframeDimensions?$container.children('iframe').first():null;if($container.attr('data-ad-fitted')==='1'&&!widthChanged&&!heightChanged&&prevAlignMode===alignMode){if($html5Iframe&&$html5Iframe.length){applyHtml5IframeScale($html5Iframe,dimensions.iframeDimensions,iframeScale)}
501return}
502if(hasDynamicReadPeakIframe){sizeCss.height='auto'}else{sizeCss.height=targetHeight+'px'}
503$container.attr('data-ad-fitted','1').attr('data-ad-fitted-width',String(targetWidth)).attr('data-ad-fitted-height',String(targetHeight)).attr('data-ad-fitted-align',alignMode).css(sizeCss);if($html5Iframe&&$html5Iframe.length){const iframeWidth=Math.round(dimensions.iframeDimensions.width*iframeScale);const iframeHeight=Math.round(dimensions.iframeDimensions.height*iframeScale);$html5Iframe.attr('width',String(dimensions.iframeDimensions.width)).attr('height',String(dimensions.iframeDimensions.height)).css({width:iframeWidth+'px',maxWidth:'100%',height:iframeHeight+'px',overflow:'hidden',});applyHtml5IframeScale($html5Iframe,dimensions.iframeDimensions,iframeScale)}
504const $outerContainer=$container.parent().closest('.nf-o-annonse-container');if($outerContainer.length){$outerContainer.attr('data-ad-fitted-outer','1').css({minHeight:'0',height:'auto',})}}
505function fitAdContainersToRenderedSize(){$('.nf-o-annonse-container').each(function(){const $container=$(this);if(isAdMarkedEmpty($container)||$container.is(':hidden')){return}
506if(isSandboxedAdContainer($container)){return}
507if($container.children('.nf-o-annonse-container').length>0){return}
508const hasRenderableAdChild=$container.children('[id^="adn_"], [id^="adn-"], [id^="div-gpt-ad-"], iframe, img.nf-o-annonse__img').length>0;if(!hasRenderableAdChild){return}
509const dimensions=getRenderedAdDimensions($container);if(!dimensions){return}
510applyRenderedAdSize($container,dimensions)})}
511function scheduleAdFitPasses(){const delays=[0,300,900,1800,3200];delays.forEach(function(delay){setTimeout(function(){fitAdContainersToRenderedSize()},delay)})}
512let adFitDebounceTimer=null;function scheduleAdFitDebounced(delayMs){const delay=typeof delayMs==='number'?delayMs:250;if(adFitDebounceTimer){clearTimeout(adFitDebounceTimer)}
513adFitDebounceTimer=setTimeout(function(){adFitDebounceTimer=null;fitAdContainersToRenderedSize()},delay)}
514function setupIframeAdSizeMetaListeners(){$('.nf-o-annonse-container iframe').each(function(){const $iframe=$(this);if($iframe.data('nf-ad-size-meta-listener')){return}
515$iframe.data('nf-ad-size-meta-listener',!0);$iframe.on('load.nfAdSizeMeta',function(){scheduleAdFitDebounced(0);setTimeout(function(){scheduleAdFitDebounced(0)},100)});try{const iframeDoc=this.contentDocument||(this.contentWindow?this.contentWindow.document:null);
515if(iframeDoc&&iframeDoc.readyState==='complete'){scheduleAdFitDebounced(0)}}catch(e){}})}
516function initSkyskraper2Sticky(){const $banners=$(".nf-js-annonse-skyskraper2");if(!$banners.length){return}
517const $window=$(window);const paddingTop=12;function getHeaderClearance(){let clearance=0;if(typeof window!=="undefined"&&typeof window.getComputedStyle==="function"){const root=document.documentElement;if(root){const cssValue=window.getComputedStyle(root).getPropertyValue("--nf-header-clearance");const parsedCss=parseInt(cssValue,10);if(!isNaN(parsedCss)){clearance=parsedCss}}}
518if(clearance>0){return clearance}
519const $toppstripe=$(".nf-c-toppstripe");const $katStripe=$(".nf-c-topmenu__extra");let measured=0;if($toppstripe.length&&$toppstripe.css("position")==="fixed"){measured+=parseInt($toppstripe.outerHeight(),10)||0;if($katStripe.length&&$katStripe.css("position")==="fixed"&&$katStripe.is(":visible")){measured+=parseInt($katStripe.outerHeight(),10)||0}}
520return measured}
521function refreshBannerBaseOffsets(){$banners.each(function(){const $banner=$(this);$banner.css({top:"",position:"static"});const baseOffset=$banner.offset();$banner.data("nf-sticky-base-offset",baseOffset?baseOffset.top:0)})}
522function updateBannerStickyPositions(){const scrollTop=$window.scrollTop();const headerClearance=getHeaderClearance();const stickyTop=headerClearance+paddingTop;if(scrollTop<=0){$banners.each(function(){$(this).css({top:"",position:"static"})});return}
523$banners.each(function(){const $banner=$(this);const baseOffset=parseInt($banner.data("nf-sticky-base-offset"),10)||0;const limit=baseOffset-paddingTop-headerClearance;if(scrollTop>limit){$banner.css({top:stickyTop,position:"fixed"})}else{$banner.css({top:"",position:"static"})}})}
524refreshBannerBaseOffsets();updateBannerStickyPositions();$window.on("scroll",updateBannerStickyPositions);$window.on("resize orientationchange",function(){refreshBannerBaseOffsets();updateBannerStickyPositions()});if(typeof document!=="undefined"&&typeof document.addEventListener==="function"){document.addEventListener("nf:header-clearance-updated",function(){refreshBannerBaseOffsets();updateBannerStickyPositions()})}}
525function hideEmptyAdsLegacy(){if(!isCMPDecided()){return}
526recoverFalseEmptyAds();$(".nf-o-annonse__continue:visible").each(function(){let notEmpty=0;const $adtxt=$(this);$adtxt.parents(".nf-o-mobilannonse").nextAll("p").each(function(){if($.trim($(this).html())){notEmpty++}
527if(!notEmpty){$adtxt.hide()}})});$(".nf-o-annonse, .nf-o-mobilannonse").each(function(){if($(this).children(".nf-o-annonse-wrapper").length){const $adKids=$(".nf-o-annonse-wrapper .nf-o-annonse-container",$(this));const adKidsNo=$adKids.length;let c=0;if(adKidsNo){$adKids.each(function(){if($(this).is(":hidden")){c++}});if(c==adKidsNo){$(this).slideUp()}}}else{if($(".nf-o-annonse-container",$(this)).is(":hidden")){$(this).slideUp()}
528if($(".nf-o-annonse-parallax",$(this)).is(":hidden")){$(this).slideUp()}}})}
529window.hideEmptyAd=hideEmptyAd;window.restoreAdVisibility=restoreAdVisibility;function registerGptEmptySlotListener(){if(window.nfGptEmptySlotListenerRegistered){return}
530if(typeof googletag==='undefined'||!googletag.cmd||!googletag.cmd.push){return}
531window.nfGptEmptySlotListenerRegistered=!0;googletag.cmd.push(function(){const pubads=googletag.pubads();if(!pubads||typeof pubads.addEventListener!=='function'){return}
532pubads.addEventListener('slotRenderEnded',function(event){const slot=event.slot;if(!slot||typeof slot.getSlotElementId!=='function'){return}
533const slotId=slot.getSlotElementId();setTimeout(function(){const $slotEl=$('#'+slotId);if(!$slotEl.length){return}
534const $container=$slotEl.closest('.nf-o-annonse-container[data-ad-type="external"]');if(!$container.length){return}
535if(!event.isEmpty){$container.data('gpt-filled',!0);$container.removeAttr('data-gpt-empty-event');if($container.hasClass('nf-o-annonse-container--empty')||$container.attr('data-empty')==='1'){restoreAdVisibility($container)}
536setTimeout(function(){fitAdContainersToRenderedSize()},0);return}
537if($container.hasClass('nf-o-annonse-container--empty')){return}
538$container.attr('data-gpt-empty-event','1');collapseGptEmptyContainer($container)},0)})})}
539registerGptEmptySlotListener();function isMobile(){const smallMax=(typeof breakpoint_small_max!=='undefined')?breakpoint_small_max:599;return window.innerWidth<=smallMax||/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}
540let resizeTimeout;$(window).on('resize',function(){clearTimeout(resizeTimeout);resizeTimeout=setTimeout(function(){$('.nf-js-ad-container[data-ad-type="static"]').removeData('ad-initialized');initStaticAds();scheduleAdFitPasses()},250)});function runAdInitDeferred(){if(window.nfAdsDeferredInitCompleted){return}
541initStaticAds();checkEmptyAds();initParallaxAds();initSkyskraper2Sticky();setupSandboxAdMessageListener();fitAdContainersToRenderedSize();scheduleAdFitPasses();setupIframeAdSizeMetaListeners();setupViewportAdObserver();registerGptEmptySlotListener();setupIframeAdVisibilityObserver();watchGptSlotsForCollapse();setTimeout(function(){trackAdImpressions()},100);window.nfAdsDeferredInitCompleted=!0}
542$(document).ready(function(){setTimeout(function(){attachViewportEmptyCheckHooks();try{runAdInitDeferred()}catch(err){if(window.console&&typeof window.console.error==='function'){console.error('newsflow_ads.js init failed',err)}}},0);$(document).on("click",".nf-o-annonse__link",function(){if(!getGDPRConsentCheck("GDPR_VENDOR_GOOGLE")){return}
543if(typeof ga4id==='undefined'){return}
544safeGtagCheck("event","clicked_ad",{send_to:ga4id,item_name:$(this).attr("data-label"),item_category:"banner",nf_platform:window.nf_platform||'web',})})});function onWindowLoad(){setTimeout(function(){if(!window.nfAdsDeferredInitCompleted){try{runAdInitDeferred()}catch(err){if(window.console&&typeof window.console.error==='function'){console.error('newsflow_ads.js load init failed',err)}}}
545setTimeout(hideEmptyAdsLegacy,500);scheduleAdFitPasses();runWhenCMPDecided(function(){scheduleVisibleViewportAdChecks();setupViewportAdObserver()})},0)}
546if(document.readyState==='complete'){onWindowLoad()}else{$(window).load(onWindowLoad)}})(jQuery);const DEBUG_FANCYBOX=!1;function runWhenIdle(fn,timeout){timeout=timeout||2000;if(typeof requestIdleCallback!=='undefined'){requestIdleCallback(fn,{timeout:timeout})}else{setTimeout(fn,300)}}
547if(typeof window!=='undefined'){var originalConsoleError=console.error;console.error=function(){var args=Array.prototype.slice.call(arguments);var errorMessage='';var shouldSuppress=!1;for(var i=0;i<args.length;i++){var arg=args[i];if(typeof arg==='string'){errorMessage+=arg+' '}else if(arg&&typeof arg==='object'){if(arg.message){errorMessage+=arg.message+' '}
548if(arg.toString){errorMessage+=arg.toString()+' '}}}
549if(errorMessage.indexOf('Cannot listen to an undefined element')!==-1||errorMessage.indexOf('PluginFeedFooterActionLogger')!==-1||(errorMessage.indexOf('ErrorUtils caught an error')!==-1&&errorMessage.indexOf('undefined element')!==-1)||(errorMessage.indexOf('Tried to listen to element of type click')!==-1)){shouldSuppress=!0}
550if(!shouldSuppress){for(var j=0;j<args.length;j++){if(args[j]&&typeof args[j]==='object'&&args[j].guardList){var guardListStr=JSON.stringify(args[j].guardList||[]);if(guardListStr.indexOf('PluginFeedFooterActionLogger')!==-1||guardListStr.indexOf('initializeClickLoggers')!==-1){shouldSuppress=!0;break}}}}
551if(shouldSuppress){return}
552originalConsoleError.apply(console,args)};window.addEventListener('error',function(event){if(event.message&&(event.message.indexOf('Cannot listen to an undefined element')!==-1||event.message.indexOf('PluginFeedFooterActionLogger')!==-1||(event.filename&&event.filename.indexOf('facebook.net')!==-1&&event.message.indexOf('undefined')!==-1))){event.preventDefault();return!0}},!0);if(typeof window.addEventListener!=='undefined'){window.addEventListener('unhandledrejection',function(event){if(event.reason&&typeof event.reason==='string'&&(event.reason.indexOf('Cannot listen to an undefined element')!==-1||event.reason.indexOf('PluginFeedFooterActionLogger')!==-1)){event.preventDefault()}})}}
553function debugLog(message){if(DEBUG_FANCYBOX){console.log(message)}}
554function breakingnews_scroll_setup($scrollcontainer){if($scrollcontainer.data("nfBreakingnewsScrollReady")){return}
555let $scrolltext=$scrollcontainer.find("> .nf-o-fl-post__breakingnews-text").first(),containerWidth=$scrollcontainer.width(),elementWidth=$(".nf-o-fl-post__breakingnews-text__element",$scrolltext).outerWidth(!0),html=$scrolltext.html(),ant=Math.ceil(containerWidth/elementWidth);if(!$scrolltext.length||!html||!isFinite(elementWidth)||elementWidth<=0){return}
556$scrollcontainer.data("nfBreakingnewsScrollReady",!0);for(let i=0;i<ant+1;i++){$scrolltext.append(html)}
557$scrolltext.css("width",elementWidth*(ant+1)+10+"px");breakingnews_scroll($scrollcontainer)}
558function breakingnews_scroll($scrollcontainer){let $scrolltext=$scrollcontainer.find("> .nf-o-fl-post__breakingnews-text").first(),elementWidth=$(".nf-o-fl-post__breakingnews-text__element",$scrolltext).outerWidth(!0);if(!$scrolltext.length||!isFinite(elementWidth)||elementWidth<=0){return}
559$scrolltext.css("visibility","visible");$scrolltext.stop(!0,!0);$scrolltext.animate({left:"-="+elementWidth},10000,"linear",function(){$scrolltext.children().first().appendTo($scrolltext);$scrolltext.css("left",0);if($scrollcontainer.data("nfBreakingnewsScrollReady")){breakingnews_scroll($scrollcontainer)}})}
560function safeGtag(){if(typeof gtag!=='undefined'&&typeof gtag==='function'){gtag.apply(this,arguments)}else{window.dataLayer=window.dataLayer||[];window.dataLayer.push(arguments)}}
561function grantGoogleAnalyticsConsent(){safeGtag("consent","update",{ad_storage:"granted",analytics_storage:"granted",ad_user_data:"granted",ad_personalization:"granted",});safeGtag("set","ads_data_redaction",!1)}
562var todayTime=typeof moment!=="undefined"?moment(new Date(),"DD.MM.YYYY HH:mm"):null;var today=typeof moment!=="undefined"?moment(new Date(),"DD.MM.YYYY"):null;function ensureCalentimCSS(){if(document.getElementById("nf-calentim-css"))return;var basePath=window.baseNewsflowHref||(window.jsPath||"/src/js/").replace(/\/js\/?$/,"");var link=document.createElement("link");link.id="nf-calentim-css";link.rel="stylesheet";link.href=basePath+"/js/calentim/build/css/calentim.min.css?ver="+encodeURIComponent(window.nfCssVersion||"");document.head.appendChild(link)}
563function loadCalentim(callback){window.calentimCallbacks=window.calentimCallbacks||[];if(callback)window.calentimCallbacks.push(callback);if(window.calentimLoading)return;window.calentimLoading=!0;var script=document.createElement("script");var finish=function(){window.calentimLoading=!1;window.calentimLoadFailed=!1;var callbacks=window.calentimCallbacks.splice(0);callbacks.forEach(function(queuedCallback){queuedCallback()})};script.src=(window.nfJsCombineHref||"/src/include/jsCombine.php")+"?loc=footer&pos=early&type=standard&bundle=calendar&ver="+encodeURIComponent(window.nfJsVersion||"");script.onload=finish;script.onerror=function(){window.calentimLoading=!1;window.calentimLoadFailed=!0;window.calentimCallbacks.splice(0);console.error("Failed to load the calendar bundle")};document.head.appendChild(script)}
564function prepareCalentimDates(){if(typeof moment==="undefined"){return!1}
565todayTime=moment(new Date(),"DD.MM.YYYY HH:mm");today=moment(new Date(),"DD.MM.YYYY");return!0}
566function activate_datepickers(){var datepickerSel=".nf-js-datepicker, .nf-js-datepicker-time, .nf-js-datepicker-future, .nf-js-datepicker-time-future";if(!$(datepickerSel).length)return;ensureCalentimCSS();
566if(typeof moment==="undefined"||typeof $.fn.calentim==="undefined"){if(window.calentimLoadFailed)return;loadCalentim(function(){activate_datepickers()});return}
567prepareCalentimDates();$(".nf-js-datepicker").each(function(){$(this).calentim(calentimOptions);calentim=$(this).data("calentim");$(this).click(function(){if($(this).val()==""){calentim.destroy();var calentimOptionsLocal=JSON.parse(JSON.stringify(calentimOptions));calentimOptionsLocal.startEmpty=!1;$(this).calentim(calentimOptionsLocal);calentim=$(this).data("calentim");calentim.setStart(moment(todayTime,"DD.MM.YYYY"));calentim.showDropdown()}})});$(".nf-js-datepicker-time").each(function(){var calentimOptionsLocal=JSON.parse(JSON.stringify(calentimOptions));calentimOptionsLocal.showTimePickers=!0;calentimOptionsLocal.format="DD.MM.YYYY HH:mm";$(this).calentim(calentimOptionsLocal);var calentim=$(this).data("calentim");$(this).click(function(){if($(this).val()==""){calentim.destroy();calentimOptionsLocal.startEmpty=!1;$(this).calentim(calentimOptionsLocal);calentim=$(this).data("calentim");calentim.setStart(moment(todayTime,"DD.MM.YYYY HH:mm"));calentim.showDropdown()}})});$(".nf-js-datepicker-future").each(function(){var calentimOptionsLocal=JSON.parse(JSON.stringify(calentimOptions));calentimOptionsLocal.minDate=today;$(this).calentim(calentimOptionsLocal);var calentim=$(this).data("calentim");$(this).click(function(){if($(this).val()==""){calentim.destroy();calentimOptionsLocal.startEmpty=!1;$(this).calentim(calentimOptionsLocal);calentim=$(this).data("calentim");calentim.setStart(moment(todayTime));calentim.showDropdown()}})});$(".nf-js-datepicker-time-future").each(function(){var calentimOptionsLocal=JSON.parse(JSON.stringify(calentimOptions));calentimOptionsLocal.minDate=today;calentimOptionsLocal.showTimePickers=!0;calentimOptionsLocal.format="DD.MM.YYYY HH:mm";$(this).calentim(calentimOptionsLocal);var calentim=$(this).data("calentim");$(this).click(function(){if($(this).val()==""){calentim.destroy();calentimOptionsLocal.startEmpty=!1;$(this).calentim(calentimOptionsLocal);calentim=$(this).data("calentim");calentim.setStart(moment(todayTime,"DD.MM.YYYY HH:mm"));calentim.showDropdown()}})})}
568function getGDPRConsent(vendorId){if(typeof vendorId==="undefined"||vendorId==null){return!0}
569if(typeof gdprVendorsNames==="undefined"||gdprVendorsNames==null){return!0}
570if(typeof inMobiCMPLoaded==="undefined"||inMobiCMPLoaded===null||!inMobiCMPLoaded){return!0}
571const i=gdprVendorsNames.indexOf(vendorId);if(i<0){return!0}
572const vendorRealId=gdprVendors[i];let gdprCookie=Cookies.get("newsflow_gdpr_accepted");if(gdprCookie!==undefined){gdprCookie=JSON.parse(gdprCookie);return gdprCookie[vendorRealId]}else{return!1}}
573function nfAbTitleHotcountHostUrl(){return window.location.protocol+"//"+window.location.host}
574function nfAbTitleHotcountSitehashString(articleId){if(typeof CryptoJS==="undefined"||!CryptoJS.MD5){return""}
575return CryptoJS.MD5(nfAbTitleHotcountHostUrl()+String(articleId||"")).toString()}
576function nfAbTitleHotcountArticleId(){var urlBase=window.location.pathname.split("?")[0];var id=typeof NyhetID!=="undefined"&&NyhetID?NyhetID:urlBase.slice(urlBase.lastIndexOf(".")+1);return String(id||"")}
577function nfAbTitleQueryParamFromUrl(){return(typeof nfAbTitleVariant!=="undefined"&&nfAbTitleVariant)?String(nfAbTitleVariant):(new URLSearchParams(window.location.search).get("abtitlevariant")||"")}
578function nfAbTitleHotcountPostBody(id,action,abTitleVariant){var sid=String(id||"");return{NyhetID:sid,Action:action,Sitehash:nfAbTitleHotcountSitehashString(sid),ABTitleVariant:abTitleVariant!=null?String(abTitleVariant):"",}}
579if(getGDPRConsent("GDPR_VENDOR_THIN")){var hotcountVisitor=function(){var id=nfAbTitleHotcountArticleId();if(!id){return}
580$.post("/src/nocache/ajax/ajax_hotcount.php",nfAbTitleHotcountPostBody(id,"update",nfAbTitleQueryParamFromUrl()))}}
581$(document).on("click","[data-nf-ab-title-variant][data-nf-ab-title-nyhetid]",function(){nfTrackAbTitleEvent($(this).attr("data-nf-ab-title-nyhetid"),$(this).attr("data-nf-ab-title-variant"),"abtitle_click")});function nfTrackAbTitleEvent(id,variant,action){if(!getGDPRConsent("GDPR_VENDOR_THIN")){return}
582id=String(id||"");variant=String(variant||"").toUpperCase();if(!id||["A","B","C","D"].indexOf(variant)===-1){return}
583const params=new URLSearchParams(nfAbTitleHotcountPostBody(id,action,variant));if(window.fetch){fetch("/src/nocache/ajax/ajax_hotcount.php",{method:"POST",body:params,keepalive:!0,credentials:"same-origin",})}else if(navigator.sendBeacon){navigator.sendBeacon("/src/nocache/ajax/ajax_hotcount.php",new Blob([params.toString()],{t
583ype:"application/x-www-form-urlencoded"}))}else{$.post("/src/nocache/ajax/ajax_hotcount.php",params.toString())}}
584function nfInitAbTitleImpressions(context){if(!getGDPRConsent("GDPR_VENDOR_THIN")||!("IntersectionObserver" in window)){return}
585const selector="[data-nf-ab-title-variant][data-nf-ab-title-nyhetid]:not([data-nf-ab-title-impression-watch])",root=context&&context.querySelectorAll?context:document,elements=Array.from(root.querySelectorAll(selector));if(root!==document&&root.matches&&root.matches(selector)){elements.push(root)}
586if(!elements.length){return}
587const observer=new IntersectionObserver(function(entries,obs){entries.forEach(function(entry){const el=entry.target;if(el.getAttribute("data-nf-ab-title-impression-sent")==="1"){obs.unobserve(el);return}
588if(entry.isIntersecting&&entry.intersectionRatio>=0.5){if(el.nfAbTitleImpressionTimer){return}
589el.nfAbTitleImpressionTimer=window.setTimeout(function(){el.setAttribute("data-nf-ab-title-impression-sent","1");nfTrackAbTitleEvent(el.getAttribute("data-nf-ab-title-nyhetid"),el.getAttribute("data-nf-ab-title-variant"),"abtitle_impression");obs.unobserve(el)},700)}else if(el.nfAbTitleImpressionTimer){window.clearTimeout(el.nfAbTitleImpressionTimer);el.nfAbTitleImpressionTimer=null}})},{threshold:[0,0.5]});elements.forEach(function(el){el.setAttribute("data-nf-ab-title-impression-watch","1");observer.observe(el)})}
590$(function(){nfInitAbTitleImpressions(document);if("MutationObserver" in window){const mutationObserver=new MutationObserver(function(mutations){mutations.forEach(function(mutation){mutation.addedNodes.forEach(function(node){if(node.nodeType===1){nfInitAbTitleImpressions(node)}})})});mutationObserver.observe(document.body,{childList:!0,subtree:!0})}});var parallaxSizer;function articleQAFrame(callback){if(window.requestAnimationFrame){window.requestAnimationFrame(callback);return}
591setTimeout(callback,16)}
592function initArticleQA(){$(".nf-c-artikkel-qa__item").each(function(){var $item=$(this);var $question=$item.children(".nf-c-artikkel-qa__question").first();var $answer=$item.children(".nf-c-artikkel-qa__answer").first();if($item.data("nfQaReady")||!$question.length||!$answer.length){return}
593$item.data("nfQaReady",!0).addClass("nf-js-qa-ready");if($item.prop("open")){$answer.css("height","auto")}else{$answer.css("height","0px")}
594$question.on("click.nfArticleQA",function(event){event.preventDefault();if($item.data("nfQaAnimating")){return}
595if($item.prop("open")){closeArticleQAItem($item,$answer)}else{openArticleQAItem($item,$answer)}})})}
596function openArticleQAItem($item,$answer){var done=!1;var targetHeight;$item.data("nfQaAnimating",!0);$item.removeClass("nf-qa-is-closing").prop("open",!0);$answer.css({height:"auto",overflow:"hidden",transition:"none"});targetHeight=$answer[0].scrollHeight;$answer.css("height","0px");$answer[0].offsetHeight;$answer.css("transition","");articleQAFrame(function(){$answer.css("height",targetHeight+"px")});function finish(){if(done){return}
597done=!0;$answer.css({height:"auto",overflow:"visible"});$item.data("nfQaAnimating",!1)}
598$answer.one("transitionend.nfArticleQA",function(event){if(event.originalEvent&&event.originalEvent.propertyName!=="height"){return}
599finish()});setTimeout(finish,260)}
600function closeArticleQAItem($item,$answer){var done=!1;$item.data("nfQaAnimating",!0);$answer.css({height:$answer[0].scrollHeight+"px",overflow:"hidden"});articleQAFrame(function(){$item.addClass("nf-qa-is-closing");$answer.css("height","0px")});function finish(){if(done){return}
601done=!0;$item.removeClass("nf-qa-is-closing").prop("open",!1);$answer.css("height","0px");$item.data("nfQaAnimating",!1)}
602$answer.one("transitionend.nfArticleQA",function(event){if(event.originalEvent&&event.originalEvent.propertyName!=="height"){return}
603finish()});setTimeout(finish,260)}
604$(document).ready(function(){initArticleQA();$(".nf-o-fl-post__breakingnews").each(function(){let duration=$(this).attr("data-duration");if(duration>Math.floor(Date.now()/1000)){$(this).show();if($(this).hasClass("nf-js-breakingnews--scroll")){breakingnews_scroll_setup($(this))}}else{$(this).hide()}});if(typeof inMobiCMPLoaded!=="undefined"&&inMobiCMPLoaded!==null&&inMobiCMPLoaded){$("#openCMPwindow").click(function(){__tcfapi("displayConsentUi",2,function(){})})}else{Cookies.set("newsflow_gdpr_accepted",1,{expires:90})}
605function positionPasswordToggle($pwField,$eye){const $container=$pwField.parent();$container.css("position","relative");const fieldPosition=$pwField.position(),eyeWidth=$eye.outerWidth(),eyeHeight=$eye.outerHeight();$eye.css({left:fieldPosition.left+$pwField.outerWidth()-eyeWidth-12,right:"auto",top:fieldPosition.top+($pwField.outerHeight()-eyeHeight)/2,})}
606$("input[type=password]").each(function(){const $pwField=$(this),$eye=$('<i class="fa-solid fa-eye nf-password-toggle" title="Vis passord"></i>').insertAfter($pwField);$pwField.css("padding-right","36px");$eye.data("passwordField",$pwField).css({cursor:"pointer",position:"absolute","z-index":1});positionPasswordToggle($pwField,$eye);$eye.click(function(){if($(this).hasClass("fa-eye")){$(this).removeClass("fa-eye");$(this).addClass("fa-eye-slash");$pwField.attr("type","text")}else{$(this).removeClass("fa-eye-slash");$(this).addClass("fa-eye");$pwField.attr("type","password")}})});$(window).off("resize.nf-password-toggle").on("resize.nf-password-toggle",function(){$(".nf-password-toggle").each(function(){const $eye=$(this);positionPasswordToggle($eye.data("passwordField"),$eye)})});
606if($(".nf-js-passwordtest").length){$.getScript(jsPath+"zxcvbn/dist/zxcvbn.js").done(function(){$(".nf-js-passwordtest").after('<meter max="4" class="nf-o-passwordtest-meter"></meter><div class="nf-o-passwordtest-text"></div><input type="hidden" id="passordstyrke" name="passordstyrke" value="0">');$(".nf-js-passwordtest-login").after('<input type="hidden" id="passordstyrke" name="passordstyrke" value="0">');var $pwtest_strength={0:"Veldig svakt",1:"Svakt",2:"SÃ¥nn passe",3:"Bra",4:"Perfekt",};var $pwtest_password=$(".nf-js-passwordtest");var $pwtest_password_login=$(".nf-js-passwordtest-login");var $pwtest_meter=$(".nf-o-passwordtest-meter");var $pwtest_text=$(".nf-o-passwordtest-text");var $pwtest_styrke=$("#passordstyrke");function passwordUpdateLogin(){var val=$pwtest_password_login.val();var result=zxcvbn(val);if(val!==""){$pwtest_styrke.val(result.score)}else{$pwtest_styrke.val("0")}}
607function passwordUpdateSet(){var val=$pwtest_password.val();var result=zxcvbn(val);$pwtest_meter.val(result.score);if(val!==""){$pwtest_text.html("Passordstyrke: "+$pwtest_strength[result.score]);$pwtest_styrke.val(result.score)}else{$pwtest_text.html("");$pwtest_styrke.val("0")}}
608$(".nf-js-form-loginbutton").click(function(e){passwordUpdateLogin()});$pwtest_password.on("input",function(){passwordUpdateSet()});$pwtest_password_login.on("input",function(){passwordUpdateLogin()})})}
609if($("form.nf-o-form input[name=sludiballCtrl1]").length){$("form.nf-o-form input[name=sludiballCtrl1]").val("di-raor")}
610$("iframe[id^='nyhet_galleri']").each(function(){const $iframe=$(this);$iframe.load(function(){const $galleri=$iframe.contents().find(".nf-c-artikkel-galleri");$(".f-button",$galleri).click(function(){safeGtag("event","Galleri",{send_to:ga4id,event_action:"gallery_interaction_"+$galleri.attr("data-id"),nf_platform:window.nf_platform||'web',});$(".f-button",$galleri).off("click")})})});$(".nf-o-annonse__stillingcounterimg").each(function(){if(!getGDPRConsent("GDPR_VENDOR_GOOGLE")){}
611safeGtag("event","impression_ad",{send_to:ga4id,item_name:$(this).attr("data-label"),item_category:"Stillinger_front",nf_platform:window.nf_platform||'web',})});function recalcScaledIframes(){$("iframe.nf-js-iframe-scale").each(function(){let h=$(this).attr("height"),w=$(this).attr("width");if(h!="auto"){let realWidth=$(this).width(),ratio=w/(realWidth||1),newHeight=Math.round(h/ratio);$(this).css("width","100%").css("height",newHeight)}})}
612runWhenIdle(recalcScaledIframes);$(window).on("load",function(){runWhenIdle(recalcScaledIframes)});$(window).on("resize",function(){clearTimeout(window._nfIframeScaleTimer);window._nfIframeScaleTimer=setTimeout(recalcScaledIframes,150)});if($("#skattelisteSagat").length){$("#skattelisteSagat").attr("src","https://extras.sagat.no/seavnnjaijja.html")}
613$(".nf-js-text-folded").each(function(){var $folded=$(this);var foldedHeight=parseInt($folded.attr("data-folded-height"),10)||230;function setFoldedState(expanded){$folded.find(".nf-js-text-folded-toggle").attr("aria-expanded",expanded?"true":"false");if(expanded){var targetHeight=$folded[0].scrollHeight;$folded.addClass("nf-o-text-folded--unfolded");$folded.stop(!0).animate({height:targetHeight},200,function(){$folded.css("height","auto")})}else{if($folded.css("height")==="auto"){$folded.height($folded.outerHeight())}
614$folded.stop(!0).animate({height:foldedHeight},200,function(){$folded.removeClass("nf-o-text-folded--unfolded")})}}
615$folded.css("height",foldedHeight);$folded.on("click",function(e){if($(e.target).closest("a, button, input, select, textarea, iframe").length){return}
616setFoldedState(!$folded.hasClass("nf-o-text-folded--unfolded"))});$folded.find(".nf-js-text-folded-toggle").on("click",function(e){e.preventDefault();e.stopPropagation();setFoldedState(!$folded.hasClass("nf-o-text-folded--unfolded"))})});function nfSyncAdvertiserCarouselWidths(){document.querySelectorAll("[data-nf-advertiser-carousel]").forEach(function(carousel){carousel.style.setProperty("--nf-advertiser-viewport-width",carousel.clientWidth+"px")})}
617var nfAdvertiserCarouselMotion=window.matchMedia?window.matchMedia("(prefers-reduced-motion: reduce)"):null;function nfApplyAdvertiserCarouselMotionPreference(){var autoplay=!nfAdvertiserCarouselMotion||!nfAdvertiserCarouselMotion.matches;document.querySelectorAll("[data-nf-advertiser-carousel]").forEach(function(carousel){carousel.classList.remove("is-paused","is-focus-paused");if(autoplay){carousel.setAttribute("data-nf-advertiser-autoplay","");carousel.setAttribute("tabindex","0");
617carousel.setAttribute("role","region");carousel.setAttribute("aria-label",carousel.dataset.nfRunningLabel)}else{carousel.removeAttribute("data-nf-advertiser-autoplay");carousel.removeAttribute("tabindex");carousel.removeAttribute("role");carousel.removeAttribute("aria-label")}})}
618function nfToggleAdvertiserCarousel(carousel){if(!carousel||!carousel.hasAttribute("data-nf-advertiser-autoplay"))return;var paused=carousel.classList.toggle("is-paused");var label=paused?carousel.dataset.nfPausedLabel:carousel.dataset.nfRunningLabel;if(label)carousel.setAttribute("aria-label",label);}
619nfSyncAdvertiserCarouselWidths();nfApplyAdvertiserCarouselMotionPreference();if(nfAdvertiserCarouselMotion){if(nfAdvertiserCarouselMotion.addEventListener){nfAdvertiserCarouselMotion.addEventListener("change",nfApplyAdvertiserCarouselMotionPreference)}else if(nfAdvertiserCarouselMotion.addListener){nfAdvertiserCarouselMotion.addListener(nfApplyAdvertiserCarouselMotionPreference)}}
620$(document).on("pointerup","[data-nf-advertiser-carousel]",function(event){if(!this.hasAttribute("data-nf-advertiser-autoplay")||event.pointerType==="mouse"||$(event.target).closest("a, button").length)return;nfToggleAdvertiserCarousel(this);this.blur()});$(document).on("keydown","[data-nf-advertiser-carousel]",function(event){if(!this.hasAttribute("data-nf-advertiser-autoplay")||(event.key!=="Enter"&&event.key!==" ")||$(event.target).closest("a, button").length)return;event.preventDefault();nfToggleAdvertiserCarousel(this)});$(document).on("focusin","[data-nf-advertiser-carousel] a",function(){$(this).closest("[data-nf-advertiser-autoplay]").addClass("is-focus-paused")});$(document).on("focusout","[data-nf-advertiser-carousel] a",function(){$(this).closest("[data-nf-advertiser-autoplay]").removeClass("is-focus-paused")});$(window).on("resize.nf-advertiser-carousel",nfSyncAdvertiserCarouselWidths);runWhenIdle(function(){$(".nf-js-scrollable").each(function(){let $parent=$(this),$wrapper=$parent.find(".nf-js-scrollable-wrapper").first(),$scrollable=$parent.find(".nf-o-module-container, .nf-o-table, .nf-o-annonse-wrapper, .nf-js-scrollable-scroller").first(),$items=$scrollable.find(".nf-js-scrollable-item"),$item=$items.first(),antVisible=$parent.attr("data-ant"),autoScroll=$parent.attr("data-autoscroll"),autoScrollSpeed=parseInt($parent.attr("data-autoscrollspeed"));$items.css("max-width",parseInt($parent.width()/antVisible));let itemWidth=parseInt($item.outerWidth(!0));if($parent.width()<300){itemWidth=$parent.width();$items.css("width",itemWidth);$items.css("max-width",itemWidth)}
621let itemHeight=parseInt($item.outerHeight(!0)),itemMargin=parseInt($item.css("margin-right")),totalWidth=itemWidth*$items.length;if(totalWidth>$parent.width()){$scrollable.css("width",totalWidth)}else{$scrollable.css("width","100%")}
622$wrapper.css("height",itemHeight);if(totalWidth>$parent.width()){let scrollerLeft=$scrollable.position().left,scrollerRight=scrollerLeft+totalWidth,wrapperLeft=$wrapper.position().left,wrapperRight=wrapperLeft+$wrapper.width(),$leftButton=$('<div class="nf-o-scrollable__nav-left"><i class="fa-solid fa-circle-arrow-left"></i></div>').prependTo($parent),$rightButton=$('<div class="nf-o-scrollable__nav-right"><i class="fa-solid fa-circle-arrow-right"></i></div>').appendTo($parent),moveTo=0,isSliding=!1,isScrolling;let fontSize=parseFloat($leftButton.css("font-size"));fontSize=fontSize/(980/parseInt($parent.width()));fontSize=fontSize<30?30:fontSize;$leftButton.css("font-size",fontSize+"px");$rightButton.css("font-size",fontSize+"px");function checkButtons(){scrollerLeft=$scrollable.position().left;scrollerRight=scrollerLeft+totalWidth;if(scrollerLeft<0){$leftButton.fadeIn()}else{$leftButton.fadeOut()}
623if(scrollerRight-itemMargin>=wrapperRight+1){$rightButton.fadeIn()}else{$rightButton.fadeOut()}}
624checkButtons();$leftButton.click(function(){moveTo=scrollerLeft+itemWidth;while(moveTo%itemWidth){moveTo-=1;if(moveTo<0){break}}
625if(moveTo>wrapperLeft){moveTo=wrapperLeft}
626$scrollable.animate({left:moveTo+"px"},500,"swing",function(){checkButtons();if($parent.hasClass('nf-c-kortvideoer-hori__wrapper')&&typeof window.nfHandleShortVideoNavigation==='function'){window.nfHandleShortVideoNavigation($parent)}})});
626$rightButton.click(function(){moveTo=scrollerLeft-itemWidth;if(moveTo+totalWidth<wrapperRight){moveTo=wrapperRight-totalWidth}
627$scrollable.animate({left:moveTo+"px"},500,"swing",function(){checkButtons();if($parent.hasClass('nf-c-kortvideoer-hori__wrapper')&&typeof window.nfHandleShortVideoNavigation==='function'){window.nfHandleShortVideoNavigation($parent)}})});if(autoScroll){setInterval(function(){let reset=!1;moveTo=scrollerLeft-itemWidth;if(moveTo+totalWidth<wrapperRight){moveTo=wrapperRight-totalWidth;reset=!0}
628$scrollable.animate({left:moveTo+"px"},500,"swing",function(){checkButtons()});if(reset){$scrollable.animate({left:0+"px"},500,"swing",function(){checkButtons()});reset=!1}},autoScrollSpeed)}
629function slideToPosition(){setTimeout(function(){if(!isSliding){isSliding=!0;let sign="+=";scrollerLeft=$scrollable.position().left;moveTo=scrollerLeft*-1;while(moveTo>itemWidth){moveTo-=itemWidth;if(moveTo<0){break}}
630if(moveTo>itemWidth/2){sign="-=";moveTo=itemWidth-moveTo}
631$scrollable.animate({left:sign+moveTo+"px"},500,"swing",function(){isSliding=!1;checkButtons()})}},100)}
632$wrapper.on("scrollend touchend",function(){oldscrollerLeft=$scrollable.position().left;clearTimeout(isScrolling);isScrolling=setInterval(()=>{scrollerLeft=$scrollable.position().left;if(scrollerLeft+totalWidth<=wrapperRight||scrollerLeft>=0){console.log("NÃ¥dde en kant");clearTimeout(isScrolling);checkButtons()}else if(oldscrollerLeft==scrollerLeft){console.log("Scrolling stoppet");clearTimeout(isScrolling);slideToPosition()}else{oldscrollerLeft=scrollerLeft}},50)})}else{$parent.removeClass("nf-o-scrollable")}})});var truncate=function(fullStr,strLen,separator){if(fullStr.length<=strLen)return fullStr;separator=separator||"...";var sepLen=separator.length,charsToShow=strLen-sepLen,frontChars=Math.ceil(charsToShow/2),backChars=Math.floor(charsToShow/2);return(fullStr.substr(0,frontChars)+separator+fullStr.substr(fullStr.length-backChars))};if($("#g-recaptcha").length){$("#g-recaptcha").each(function(){$.getScript("https://www.google.com/recaptcha/enterprise.js").done(function(){if(typeof grecaptcha!=="undefined"){grecaptcha.enterprise.ready(function(){let widgetId=grecaptcha.enterprise.render("g-recaptcha")})}})})}
633$(".nf-js-form-checkpw").click(function(e){var $pw1=$(".nf-js-pw1").val();var $pw2=$(".nf-js-pw2").val();var result=zxcvbn($pw1);var error1='<div id="passordUlike" class="nf-o-popupcontent"><p>Passordene du oppga er ikke like!</p></div>';var error2='<div id="passordSvakt" class="nf-o-popupcontent">'+"<h2>Passordet er ikke langt eller sterkt nok!</h2>"+'<p>Passord som er for enkle å gjette, f.eks ved at de inneholder kjente navn, enkle ordbok-ord og/eller enkle tall- eller bokstavsekvenser som årstall, 123456 eller "qwerty", bør unngås.<p>'+"<p><em>Lengde er viktigere enn kompleksitet!</em></p>"+'<p>Prøv derfor å kombinere flere ord, gjerne med mellomrom, for å øke lengden og kompleksisteten på passordet ditt. <a href="https://xkcd.com/936/" target="_blank">Passordet trenger ikke å være vanskelig å huske.</a></p>'+"</div>";if($pw1!=$pw2){e.preventDefault();new Fancybox([{src:error1,type:"html",},])}else if(result<pwstrength||$pw1.length<pwlength){e.preventDefault();new Fancybox([{src:error2,type:"html",},])}});if($("[data-content]").length){let currentPopup=null;let popupOpening=!1;function closeAllPopups(){$(".nf-o-popup-hover").hide();currentPopup=null;popupOpening=!1}
634$(window).on("scroll",function(){const breakpointSmallMax=typeof breakpoint_small_max!=='undefined'?breakpoint_small_max:599;const isCurrentlySmallScreen=window.matchMedia("(max-width: "+breakpointSmallMax+"px)").matches;if(isCurrentlySmallScreen){closeAllPopups()}});$(document).on("click touchend",function(e){const breakpointSmallMax=typeof breakpoint_small_max!=='undefined'?breakpoint_small_max:599;const isCurrentlySmallScreen=window.matchMedia("(max-width: "+breakpointSmallMax+"px)").matches;if(isCurrentlySmallScreen){if(popupOpening){return}
635setTimeout(function(){if(popupOpening){return}
636if($(e.target).closest("[data-content]").length){return}
637if($(e.target).closest(".nf-o-popup-hover").length){return}
638if(currentPopup&&currentPopup.is(":visible")){closeAllPopups()}},100)}});$("[data-content]").each(function(){const $popupLink=$(this);const content='<div style="position: relative; color: #222; font-size: .85em; word-wrap:break-word; white-space: pre-wrap; text-transform: none; font-weight: normal;"><h1>'+$popupLink.attr("title")+"</h1>"+"<p>"+$popupLink.attr("data-content")+"</p></div>",$popup=$('<div class="nf-o-popup-hover" style="display: none; border: 2px solid #222; border-radius: 5px; background: #fff; padding: 10px; position: absolute; z-index: 10000; width: auto; max-width: 50%; min-width: 300px; height: auto; max-height: 600px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);">'+content+"</div>").insertAfter($popupLink),targetXpos=$popupLink.offset().left-$popupLink.position().left,targetYpos=$popupLink.offset().top-$popupLink.position().top;$popupLink.removeAttr("title");$popupLink.on("click touchend",function(e){const breakpointSmallMax=typeof breakpoint_small_max!=='undefined'?breakpoint_small_max:599;const isCurrentlySmallScreen=window.matchMedia("(max-width: "+breakpointSmallMax+"px)").matches;if(isCurrentlySmallScreen){const href=$popupLink.attr("href");if($popupLink.is("a")&&href&&href!=="#"&&href.trim()!==""){return}
639e.preventDefault();e.stopPropagation();e.stopImmediatePropagation();popupOpening=!0;if(currentPopup===$popup&&$popup.is(":visible")){closeAllPopups();return!1}
640closeAllPopups();$popup.show().css({top:'50%',left:'50%',transform:'translate(-50%, -50%)',position:'fixed'});currentPopup=$popup;setTimeout(function(){popupOpening=!1},100);return!1}});$popupLink.mouseover(function(){const breakpointSmallMax=typeof breakpoint_small_max!=='undefined'?breakpoint_small_max:599;const isCurrentlySmallScreen=window.matchMedia("(max-width: "+breakpointSmallMax+"px)").matches;if(!isCurrentlySmallScreen){$(document).mousemove(function(e){let xpos=e.pageX-targetXpos+10,ypos=e.pageY-targetYpos+10;$popup.show().css({top:ypos,left:xpos,transform:'none',position:'absolute'})})}}).mouseleave(function(){$(document).off("mousemove");$popup.hide()})})}
641$(".nf-o-form-fieldset div").each(function(index){if($(this).hasClass("nf-o-form__item--medium")&&(index==0||!$(this).prev().hasClass("nf-o-form__item--medium")||!$(this).prev().hasClass("nf-o-form__item--first"))){$(this).addClass("nf-o-form__item--first")}});activate_datepickers();$('[data-src^="#"]').click(function(){new Fancybox([{src:$(this).attr("data-src"),type:"inline",},],{animationEffect:"zoom",})});function nfFancyboxResizeVideoOverlay($links){$links.each(function(){var w=parseInt($(this).attr("data-width"),10)||0;var h=parseInt($(this).attr("data-height"),10)||0;if(!w||!h)return;var winW=parseInt($(window).width(),10);var winH=parseInt($(window).height(),10);var ratioW=winW/w;var ratioH=winH/h;var newW,newH;if(w>h){newW=winW;newH=Math.round(h*ratioW)}else{newH=winH;newW=Math.round(w*ratioH)}
642$(this).attr("data-width",newW);$(this).attr("data-height",newH)})}
643nfFancyboxResizeVideoOverlay($(".nf-o-videopreview__link[data-fancybox='kortvideoer']"));nfFancyboxResizeVideoOverlay($(".nf-o-videopreview__link[data-type='iframe']:not([data-fancybox='kortvideoer'])"));if($("#landingpage").length){new Fancybox([{src:"#landingpage",type:"inline",},],{animationEffect:"zoom",})}
644if(typeof Fancybox!=="undefined"){function nfFancyboxNormalizeHrefs(){var sel="a[href]";$(sel).each(function(){var h=this.getAttribute("href");if(!h)return;h=h.trim();if(/^javascript:/i.test(h)){this.setAttribute("href","#");return}
645if(/^(tel:|mailto:)/i.test(h)&&(this.getAttribute("data-fancybox")!=null||this.getAttribute("data-type")==="iframe")){this.setAttribute("href","#")}})}
646nfFancyboxNormalizeHrefs();setTimeout(nfFancyboxNormalizeHrefs,0);$(document).on("esi-content-loaded",nfFancyboxNormalizeHrefs);Fancybox.bind('[data-fancybox][data-type="inline"]:not([data-fancybox="kortvideoer"])',{type:"inline",});Fancybox.bind('[data-type="iframe"]',{on:{init:(fancybox)=>{const slide=fancybox.getSlide();if(slide){const src=slide.src;const dataSrc=slide.element?.getAttribute("data-src");if((src&&src.startsWith("javascript:"))||(dataSrc&&dataSrc.startsWith("javascript:"))){return}}},},});let activeShortsFancybox=null;let shortsNextSlideMessageHandler=null;let shortsInitialActivationObserver=null;function cleanupShortsInitialActivationObserver(){if(shortsInitialActivationObserver){shortsInitialActivationObserver.disconnect();shortsInitialActivationObserver=null}}
647function activateShortsInitialSlideWhenReady(fancybox){if(!window.nfShortsVideoController||typeof window.nfShortsVideoController.onFancyboxChange!=="function"){return!1}
648const slide=fancybox&&typeof fancybox.getSlide==="function"?fancybox.getSlide():null;const selectedPlayer=slide&&slide.contentEl?slide.contentEl.querySelector(".nf-video-player"):null;if(!selectedPlayer){return!1}
649window.nfShortsVideoController.onFancyboxChange(fancybox,{delayMs:0});cleanupShortsInitialActivationObserver();return!0}
650function ensureShortsInitialActivationObserver(fancybox){cleanupShortsInitialActivationObserver();const observerTarget=(fancybox&&fancybox.container)?fancybox.container:document.body;shortsInitialActivationObserver=new MutationObserver(function(){if(activeShortsFancybox!==fancybox){cleanupShortsInitialActivationObserver();return}
651activateShortsInitialSlideWhenReady(fancybox)});shortsInitialActivationObserver.observe(observerTarget,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"],})}
652Fancybox.bind("[data-fancybox='kortvideoer']",{Thumbs:!1,Carousel:{preload:1,},Slideshow:!1,on:{init:(fancybox)=>{debugLog("Initialiserer fancybox...");activeShortsFancybox=fancybox;if(window.nfShortsVideoController&&typeof window.nfShortsVideoController.onFancyboxInit==="function"){window.nfShortsVideoController.onFancyboxInit(fancybox)}},destroy:(fancybox)=>{debugLog("Fancybox closing...");activeShortsFancybox=null;cleanupShortsInitialActivationObserver();if(window.nfShortsVideoController&&typeof window.nfShortsVideoController.onFancyboxDestroy==="function"){window.nfShortsVideoController.onFancyboxDestroy(fancybox)}},"Carousel.beforeChange":(fancybox)=>{if(window.nfShortsVideoController&&typeof window.nfShortsVideoController.onFancyboxBeforeChange==="function"){window.nfShortsVideoController.onFancyboxBeforeChange(fancybox)}},"Carousel.change":(fancybox)=>{if(window.nfShortsVideoController&&typeof window.nfShortsVideoController.onFancyboxChange==="function"){window.nfShortsVideoController.onFancyboxChange(fancybox)}},ready:(fancybox)=>{activeShortsFancybox=fancybox;if(window.nfShortsVideoController&&typeof window.nfShortsVideoController.onFancyboxChange==="function"){const activatedNow=activateShortsInitialSlideWhenReady(fancybox);if(!activatedNow){ensureShortsInitialActivationObserver(fancybox)}}
653if(!shortsNextSlideMessageHandler){shortsNextSlideMessageHandler=function(event){if(!activeShortsFancybox){return}
654const payload=event.data;const isNextSlide=payload==="nextSlide"||(payload&&typeof payload==="object"&&payload.type==="nextSlide");if(!isNextSlide){return}
655if(window.nfShortsVideoController&&typeof window.nfShortsVideoController.shouldHandleNextSlideMessage==="function"){const shouldHandle=window.nfShortsVideoController.shouldHandleNextSlideMessage(payload&&typeof payload==="object"?payload:null);if(!shouldHandle){return}}
656debugLog("Bytter video!");activeShortsFancybox.next()};window.addEventListener("message",shortsNextSlideMessageHandler)}
657return},},});Fancybox.bind('[data-fancybox="bilder"],[data-fancybox="galleribilder"],[data-fancybox="nsbilder"],[data-fancybox="nyhetsbilder"]',{Images:{protected:!0,initialSize:"fit",},})}
658function waitForCarouselDependencies(callback,options){options=options||{};var attempts=0;var maxAttempts=typeof options.maxAttempts==="number"?options.maxAttempts:60;var retryMs=typeof options.retryMs==="number"?options.retryMs:200;var requireAutoplay=!!options.requireAutoplay;function tryInit(){var hasCarousel=typeof Carousel!=="undefined";var hasAutoplay=!requireAutoplay||typeof Autoplay!=="undefined";if(!hasCarousel||!hasAutoplay){attempts++;if(attempts<maxAttempts){setTimeout(tryInit,retryMs)}
659return}
660callback()}
661tryInit()}
662function nfCarouselFocusableSelector(){return["a[href]","area[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","iframe","object","embed","[tabindex]","[contenteditable]",].join(",")}
663function nfUpdateCarouselHiddenFocus(target){if(!target||typeof target.querySelectorAll!=="function"){return}
664var focusables=target.querySelectorAll(nfCarouselFocusableSelector());focusables.forEach(function(element){var hiddenSlide=typeof element.closest==="function"?element.closest('.f-carousel__slide[aria-hidden="true"]'):null;if(hiddenSlide){if(!Object.prototype.hasOwnProperty.call(element.dataset,"nfOrigTabindex")){element.dataset.nfOrigTabindex=element.getAttribute("tabindex")||""}
665element.setAttribute("tabindex","-1");return}
666if(Object.prototype.hasOwnProperty.call(element.dataset,"nfOrigTabindex")){if(element.dataset.nfOrigTabindex===""){element.removeAttribute("tabindex")}else{element.setAttribute("tabindex",element.dataset.nfOrigTabindex)}
667delete element.dataset.nfOrigTabindex}})}
668function nfBindCarouselHiddenFocus(target,carouselInstance){if(!target||target.dataset.nfCarouselHiddenFocusBound==="1"){return}
669target.dataset.nfCarouselHiddenFocusBound="1";var updateFocus=function(){nfUpdateCarouselHiddenFocus(target)};updateFocus();window.setTimeout(updateFocus,0);if(carouselInstance&&typeof carouselInstance.on==="function"){carouselInstance.on("ready change refresh settle",updateFocus)}
670if(typeof MutationObserver==="function"){var observer=new MutationObserver(updateFocus);observer.observe(target,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["aria-hidden","class"],});target.nfCarouselHiddenFocusObserver=observer}}
671function nfCreateCarousel(target,carouselOptions,plugins){if(!target||typeof Carousel==="undefined"){return null}
672var carouselInstance=null;try{carouselInstance=new Carousel(target,carouselOptions,plugins)}catch(error){if(typeof console!=="undefined"&&typeof console.warn==="function"){console.warn("Failed to initialize carousel",target,error)}
673return null}
674if(target.classList){target.classList.add("nf-carousel-ready")}
675nfBindCarouselHiddenFocus(target,carouselInstance);return carouselInstance}
676function nfDispatchResizeEvent(){if(typeof window==="undefined"||typeof window.dispatchEvent!=="function"){return}
677var resizeEvent=null;
677if(typeof Event==="function"){resizeEvent=new Event("resize")}else if(typeof document!=="undefined"&&typeof document.createEvent==="function"){resizeEvent=document.createEvent("Event");resizeEvent.initEvent("resize",!0,!0)}
678if(resizeEvent){window.dispatchEvent(resizeEvent)}}
679function nfScheduleCarouselLayoutUpdate(target,delay){if(!target){return}
680delay=typeof delay==="number"?delay:0;if(target.nfCarouselLayoutTimer){clearTimeout(target.nfCarouselLayoutTimer)}
681target.nfCarouselLayoutTimer=window.setTimeout(function(){var carouselInstance=target.nfCarouselInstance||null;target.nfCarouselLayoutTimer=null;if(carouselInstance){if(typeof carouselInstance.refresh==="function"){carouselInstance.refresh()}else if(typeof carouselInstance.updateMetrics==="function"){carouselInstance.updateMetrics()}else if(typeof carouselInstance.emit==="function"){carouselInstance.emit("refresh")}}
682nfDispatchResizeEvent()},delay)}
683function nfBindCarouselImageLayoutUpdates(target){if(!target||target.dataset.nfCarouselImageLayoutBound==="1"){return}
684target.dataset.nfCarouselImageLayoutBound="1";var $images=$("img",target);if(!$images.length){nfScheduleCarouselLayoutUpdate(target,0);return}
685$images.each(function(){if(this.complete){nfScheduleCarouselLayoutUpdate(target,0);return}
686$(this).one("load error",function(){nfScheduleCarouselLayoutUpdate(target,0)})})}
687function initAdCarouselElement(target){if(!target){return null}
688nfBindCarouselImageLayoutUpdates(target);if($(target).data("carousel-initialized")){nfScheduleCarouselLayoutUpdate(target,0);return target.nfCarouselInstance||null}
689let annonsescroller_options={on:{ready:()=>{target.style.display="block";nfScheduleCarouselLayoutUpdate(target,0);nfScheduleCarouselLayoutUpdate(target,150);nfScheduleCarouselLayoutUpdate(target,600)},load:()=>{},},Autoplay:{timeout:3000,showProgress:!1,},slidesPerPage:1,adaptiveHeight:!0,transition:"slide",center:!1,Dots:!1,};if(!$(target).hasClass("nf-js-multihori-autoscroll")){annonsescroller_options.Autoplay=!1}
690const carouselInstance=nfCreateCarousel(target,annonsescroller_options,{Autoplay});if(!carouselInstance){return null}
691target.nfCarouselInstance=carouselInstance;$(target).data("carousel-initialized",!0);target.style.display="block";nfScheduleCarouselLayoutUpdate(target,0);return carouselInstance}
692function initAdCarouselsNow(){$("[id^='annonsescroll_']").each(function(){initAdCarouselElement(this)});if(typeof lazySizes!=="undefined"&&lazySizes.loader){lazySizes.loader.checkElems()}}
693window.initAdCarousels=function(options){options=options||{};waitForCarouselDependencies(function(){initAdCarouselsNow()},{requireAutoplay:!0,maxAttempts:typeof options.maxAttempts==="number"?options.maxAttempts:60,retryMs:typeof options.retryMs==="number"?options.retryMs:200})};function scheduleAdCarouselRecoveryPasses(){if(window.nfAdCarouselRecoveryScheduled){return}
694window.nfAdCarouselRecoveryScheduled=!0;[250,1000,2500].forEach(function(delay){window.setTimeout(function(){if(typeof window.initAdCarousels==="function"){window.initAdCarousels({maxAttempts:20,retryMs:100})}},delay)})}
695window.initArticleGalleries=function(){waitForCarouselDependencies(function(){$(".nf-c-artikkel-galleri .f-carousel").each(function(){const $carousel=$(this);if($carousel.data("carousel-initialized")){return}
696const $galleriContainer=$carousel.closest(".nf-c-artikkel-galleri");const hasThumbnails=$galleriContainer.attr("data-thumbnails")==="1";const plugins={};if(hasThumbnails&&typeof Thumbs!=="undefined"){plugins.Thumbs=Thumbs}
697const carouselOptions={slidesPerPage:1,transition:"crossfade",adaptiveHeight:!1};if(hasThumbnails){carouselOptions.Thumbs={type:"modern",parentEl:$galleriContainer[0]}}
698const carouselInstance=nfCreateCarousel(this,carouselOptions,plugins);if(!carouselInstance){return}
699$carousel.data("carousel-initialized",!0)})},{requireAutoplay:!1,maxAttempts:60,retryMs:200})};$(document).on("esi-content-loaded",function(){if(typeof window.initArticleGalleries==="function"){setTimeout(function(){window.initArticleGalleries()},100)}});window.initWebcamCarousels=function(){waitForCarouselDependencies(function(){$(".nf-js-webcam-carousel").each(function(){const $carousel=$(this);if($carousel.data("carousel-initialized")){return}
700const carouselOptions={slidesPerPage:1,transition:"crossfade",Dots:!1,Autoplay:{timeout:5000,showProgress:!0,},};const carouselInstance=nfCreateCarousel(this,carouselOptions,{Autoplay});if(!carouselInstance){return}
701$carousel.data("carousel-initialized",!0)})},{requireAutoplay:!0,maxAttempts:60,retryMs:200})};$(document).on("esi-content-loaded",function(){if(typeof window.initWebcamCarousels==="function"){setTimeout(function(){window.initWebcamCarousels()},100)}});$(document).on("esi-content-loaded",function(){if(typeof window.initAdCarousels==="function"){setTimeout(function(){window.initAdCarousels({maxAttempts:20,retryMs:100})},100)}});(function(){function initFrontPageCarouselsWhenReady(){if($("#newsticker").length){const newsticker=document.getElementById("newsticker");const wrapper=newsticker.closest(".nf-c-newsticker__wrapper");const isCarouselStyled=()=>{const track=newsticker.querySelector(".f-carousel__track");if(!track){return!1}
702const trackStyle=window.getComputedStyle(track);return trackStyle.display==="flex"};const revealNewsticker=()=>{if(wrapper){wrapper.classList.remove("nf-c-newsticker__wrapper--loading");wrapper.classList.add("nf-c-newsticker__wrapper--ready");wrapper.style.removeProperty("visibility");wrapper.style.removeProperty("opacity")}};const revealNewstickerWhenCarouselReady=(attempt=0)=>{if(isCarouselStyled()){window.requestAnimationFrame(revealNewsticker);return}
703if(attempt>=120){return}
704window.setTimeout(()=>revealNewstickerWhenCarouselReady(attempt+1),25)};let newsticker_options={on:{ready:()=>{revealNewstickerWhenCarouselReady()},},transition:"slide",adaptiveHeight:!0,center:!1,Dots:!1,classes:{container:"nf-c-newsticker",slide:"nf-c-newsticker__item",},};nfCreateCarousel(newsticker,newsticker_options)}
705if($("#stillingscroller").length){const stillingscroller=document.getElementById("stillingscroller");let stillingscroller_options={on:{ready:()=>{stillingscroller.style.display="block"},},Autoplay:{timeout:3000,showProgress:!1,},slidesPerPage:1,adaptiveHeight:!0,transition:"slide",center:!1,Dots:!1,classes:{container:"nf-c-stillingscroller-hori",slide:"nf-c-stillingscroller-hori__item",},};nfCreateCarousel(stillingscroller,stillingscroller_options,{Autoplay})}
706$("[id^='rssscroller_']").each(function(){const rssscroller=document.getElementById($(this).attr("id"));let rssscroller_options={on:{ready:()=>{rssscroller.style.display="block";$(rssscroller).parents(".nf-c-front-rssfeeds").css("height","auto")},},Autoplay:{timeout:3000,showProgress:!1,},slidesPerPage:1,adaptiveHeight:!0,transition:"slide",center:!1,Dots:!1,classes:{container:"nf-c-front-rssfeeds--fullwidth",slide:"nf-c-front-rssfeeds-frontliste__item",},};if(!$(this).hasClass("nf-js-rsssscroller-hori-autoscroll")){rssscroller_options.Autoplay=!1}
707nfCreateCarousel(rssscroller,rssscroller_options,{Autoplay})});if($("#kulturscroller-hori").length){const kulturscroller=document.getElementById("kulturscroller-hori");let kulturscroller_options={on:{ready:()=>{kulturscroller.style.display="block"},},Autoplay:{timeout:3000,showProgress:!1,},slidesPerPage:1,adaptiveHeight:!0,transition:"slide",center:!1,Dots:!1,classes:{container:"nf-c-kulturscroller-hori",slide:"nf-c-kulturscroller-hori__item",},};nfCreateCarousel(kulturscroller,kulturscroller_options,{Autoplay})}
708if($("#serviceguidescroller-hori").length){const serviceguidescroller=document.getElementById("serviceguidescroller-hori");let serviceguidescroller_options={on:{ready:()=>{serviceguidescroller.style.display="block"},},Autoplay:{timeout:3000,showProgress:!1,},slidesPerPage:1,adaptiveHeight:!0,transition:"slide",center:!1,Dots:!1,classes:{container:"nf-c-serviceguidescroller-hori",slide:"nf-c-serviceguidescroller-hori__item",},};nfCreateCarousel(serviceguidescroller,serviceguidescroller_options,{Autoplay,})}
709if($("#kulturscroller").length){const kulturscroller=document.getElementById("kulturscroller");let kulturscroller_options={on:{ready:()=>{kulturscroller.style.display="block"},},Autoplay:{timeout:2000,showProgress:!1,},slidesPerPage:1,axis:"y",transition:"slide",center:!1,Navigation:!1,Dots:!1,classes:{container:"nf-c-kulturscroller",slide:"nf-c-kulturscroller__item",},};nfCreateCarousel(kulturscroller,kulturscroller_options,{Autoplay})}
710if($("#travscroller").length){const travscroller=document.getElementById("travscroller");let travscroller_options={on:{ready:()=>{travscroller.style.display="block"},},Autoplay:{timeout:2000,showProgress:!1,},slidesPerPage:1,axis:"y",transition:"slide",center:!1,Navigation:!1,Dots:!1,classes:{container:"nf-c-front-travscroller",slide:"nf-c-front-travscroller__item",},};nfCreateCarousel(travscroller,travscroller_options,{Autoplay})}
711if($("#hingstscroller").length){const hingstscroller=document.getElementById("hingstscroller");let hingstscroller_options={on:{ready:()=>{hingstscroller.style.display="block"},},Autoplay:{timeout:2000,showProgress:!1,},slidesPerPage:1,axis:"y",transition:"slide",center:!1,Navigation:!1,Dots:!1,classes:{container:"nf-c-front-travscroller",slide:"nf-c-front-travscroller__item",},};nfCreateCarousel(hingstscroller,hingstscroller_options,{Autoplay})}
712if($("#follscroller").length){const follscroller=document.getElementById("follscroller");let follscroller_options={on:{ready:()=>{follscroller.style.display="block"},},Autoplay:{timeout:2000,showProgress:!1,},slidesPerPage:1,axis:"y",transition:"slide",center:!1,Navigation:!1,Dots:!1,classes:{container:"nf-c-front-travscroller",slide:"nf-c-front-travscroller__item",},};nfCreateCarousel(follscroller,follscroller_options,{Autoplay})}
713if($("#hestescroller").length){const hestescroller=document.getElementById("hestescroller");let hestescroller_options={on:{ready:()=>{hestescroller.style.display="block"},},Autoplay:{timeout:3000,showProgress:!1,},slidesPerPage:1,adaptiveHeight:!0,transition:"slide",center:!1,Dots:!1,classes:{container:"nf-c-front-hesteauksjon",slide:"nf-c-front-hesteauksjon__item",},};nfCreateCarousel(hestescroller,hestescroller_options,{Autoplay})}
714initAdCarouselsNow();if(typeof lazySizes!=="undefined"&&lazySizes.loader){lazySizes.loader.checkElems()}}
715waitForCarouselDependencies(initFrontPageCarouselsWhenReady,{requireAutoplay:!0,maxAttempts:60,retryMs:200});scheduleAdCarouselRecoveryPasses()})();$(".nf-js-spfancy-list__item").on("click touchstart",function(e){var $prodid=$(this).data("prodid");
715$(".nf-c-spfancy-list__item, .nf-c-spfancy-list__item *").removeClass("nf-c-spfancy-list__item--selected nf-u-blurry-text-white nf-u-blurry-text-black");$(this).addClass("nf-c-spfancy-list__item--selected");$(".nf-c-spfancy-content").hide();$(".nf-c-spfancy-content--prodid"+$prodid).show();if($(".nf-c-salgsplakater-fancy").width()<=breakpoint_small_max){}else{$(".nf-c-spfancy-list__item").not(".nf-c-spfancy-list__item--selected").addClass("nf-u-blurry-text-white");$(".nf-c-spfancy-list__item").not(".nf-c-spfancy-list__item--selected").find(".nf-c-spfancy-prodprice__content").addClass("nf-u-blurry-text-black");$(".nf-c-spfancy-list__item").not(".nf-c-spfancy-list__item--selected").find(".nf-c-spfancy-prodprice__content > .nf-c-spfancy__campaign").addClass("nf-u-blurry-text-white");$(".nf-c-spfancy-content--prodid"+$prodid).css("margin-top",($(this).offset().top-$(".nf-c-spfancy-list").offset().top)*-1)}});$(".nf-c-artikkel-share-buttons__link--mastodon").click(function(){let src=$(this).attr("data-src"),title=$(this).attr("data-title");if(typeof NFModal!=="undefined"&&NFModal.prompt){NFModal.prompt("Oppgi din Mastodon instans (domenenavn)","Mastodon instans","snabelen.no").then(function(result){if(result&&result.action==="ok"&&result.value){domain=result.value;if(domain==""||domain==null){return}
716let url="https://"+domain+"/share?text="+title+"&url="+src;window.open(url,"_blank")}});return}else{domain=prompt("Oppgi din Mastodon instans (domenenavn)","snabelen.no");if(domain==""||domain==null){return}}
717if(domain){let url="https://"+domain+"/share?text="+title+"&url="+src;window.open(url,"_blank")}});$(".nf-c-artikkel-share-buttons__link--utskrift").click(function(){$("#printArticleWait").fadeIn();$("html, body").animate({scrollTop:$(document).height()},1000);$("html, body").animate({scrollTop:0},1000);setTimeout(function(){$("#printArticleWait").fadeOut();setTimeout(function(){window.print()},500)},2000)});$(document).on("click",".nf-js-clickscroll",function(e){e.preventDefault();var $trigger=$(this),target=$trigger.attr("data-target");if(($trigger.hasClass("nf-comment-share-btn")||$trigger.hasClass("nf-c-artikkel__kommentarer-goto-btn"))&&typeof window.nfOpenArticleCommentsAndScroll==="function"){e.stopImmediatePropagation();window.nfOpenArticleCommentsAndScroll(target)}else{scrollToAnchor(target)}
718this.blur()});if(getGDPRConsent("GDPR_VENDOR_LESEWEB")){if($(".nf-o-leseweb-wrapper").length){(function(){let lw=document.createElement("script");lw.type="text/javascript";lw.async=!0;lw.src=("https:"==document.location.protocol?"https://":"http://")+"speech.leseweb.dk/script/"+lwfile;const s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(lw,s)})()}}
719$("#nf-c-opensearchform").click(function(){$(".nf-js-searchformpublic").slideToggle(function(){})});
719function initFrontArticleLoader(){const $control=$(".nf-js-front-load-more").first();if(!$control.length)return;const $button=$control.find("#loadMoreNewsItemsFront");let loading=!1;let observer=null;function stopAutomaticLoad(){$control.attr("data-auto-load","0");if(observer)observer.disconnect();$(window).off(".nfFrontArticleLoader")}
720function removeControl(){stopAutomaticLoad();$control.remove()}
721function loadMoreFrontArticles(automatic){if(loading||(automatic&&$control.attr("data-auto-load")!=="1"))return;loading=!0;const usedIDs=$(".nf-o-fl-post[data-nyhetid]").map(function(){return parseInt($(this).attr("data-nyhetid"),10)||null}).get().filter(function(id,index,ids){return id&&ids.indexOf(id)===index});$button.prop("disabled",!0).attr("aria-busy","true");$.ajax({url:ajaxNocachePath+"/ajax_load_more_frontarticles.php",type:"POST",dataType:"html",data:{ant:9,automatic:automatic?1:0,usedIDs:usedIDs,KatID:$control.attr("data-katid"),features:$control.attr("data-features"),},}).done(function(html,textStatus,xhr){if(html!="error"){$control.before(html);if(typeof lazySizes!=="undefined"&&lazySizes.loader){lazySizes.loader.checkElems()}
722$(document).trigger("esi-content-loaded")}
723if(xhr.getResponseHeader("X-NewsFlow-Auto-Has-More")==="0"){stopAutomaticLoad()}
724if(xhr.getResponseHeader("X-NewsFlow-Has-More")==="0"){removeControl()}}).always(function(){loading=!1;$button.prop("disabled",!1).removeAttr("aria-busy")})}
725$button.on("click",function(){stopAutomaticLoad();loadMoreFrontArticles(!1)});if($control.attr("data-auto-load")!=="1")return;if("IntersectionObserver" in window){observer=new IntersectionObserver(function(entries){if(entries[0]&&entries[0].isIntersecting)loadMoreFrontArticles(!0);},{rootMargin:"600px 0px"});observer.observe($control[0])}else{const loadWhenNearViewport=function(){if($control[0]&&$control[0].getBoundingClientRect().top<=window.innerHeight+600){loadMoreFrontArticles(!0)}};$(window).on("scroll.nfFrontArticleLoader resize.nfFrontArticleLoader",loadWhenNearViewport);loadWhenNearViewport()}}
726initFrontArticleLoader();function initAuthorProfileInfiniteList(){const $list=$(".nf-js-author-profile-list");const $more=$(".nf-js-author-profile-more");const $button=$(".nf-js-author-profile-load");const $loading=$(".nf-js-author-profile-loading");if(!$list.length||!$more.length){return}
727let loading=!1;let hasMore=$list.attr("data-has-more")==="1";function setLoading(isLoading){loading=isLoading;$button.prop("disabled",isLoading);if($loading.length){$loading.prop("hidden",!isLoading)}}
728function loadMoreAuthorArticles(){if(loading||!hasMore){return}
729setLoading(!0);$.post(ajaxNocachePath+"/ajax_load_author_articles.php",{author:$list.attr("data-author"),offset:$list.attr("data-next-offset"),},null,"json").done(function(response){if(!response||!response.ok){hasMore=!1;$more.hide();return}
730if(response.html){$list.append(response.html);if(typeof lazySizes!=="undefined"&&lazySizes.loader){lazySizes.loader.checkElems()}
731$(document).trigger("esi-content-loaded")}
732hasMore=!!response.hasMore;$list.attr("data-next-offset",response.nextOffset);$list.attr("data-has-more",hasMore?"1":"0");if(!hasMore){$more.hide()}}).fail(function(){hasMore=!1;$more.hide()}).always(function(){setLoading(!1)})}
733$button.on("click",loadMoreAuthorArticles);if("IntersectionObserver" in window){const observer=new IntersectionObserver(function(entries){if(entries[0]&&entries[0].isIntersecting){loadMoreAuthorArticles()}},{rootMargin:"400px 0px"});observer.observe($more[0])}}
734initAuthorProfileInfiniteList();function loadFrontCommentCounts(){if(typeof ajaxNocachePath==='undefined')return;if(!window.location||!document.body.classList.contains('nf-frontpage'))return;if(!window.getGDPRConsent||!getGDPRConsent('GDPR_VENDOR_THIN')){return}
735var $spans=$('.nf-o-fl-post__commentbadge-count[data-nyhet-id]');if(!$spans.length)return;var ids=[];$spans.each(function(){var $el=$(this);var id=parseInt($el.attr('data-nyhet-id'),10);if(id&&ids.indexOf(id)===-1)ids.push(id);});if(!ids.length)return;$.ajax({url:ajaxNocachePath+'/ajax_get_comment_counts.php',method:'POST',data:{ids:ids.join(',')},dataType:'json'}).done(function(json){var data;try{data=typeof json==='string'?JSON.parse(json):json}catch(e){return}
736if(!data||!data.counts)return;
736Object.keys(data.counts).forEach(function(key){var count=parseInt(data.counts[key],10)||0;var $targets=$('.nf-o-fl-post__commentbadge-count[data-nyhet-id="'+key+'"]');var $wrappers=$targets.closest('.nf-o-fl-post__commentbadge');if(count>0){$targets.text(count);$wrappers.show()}else{$wrappers.hide()}})}).fail(function(){})}
737runWhenIdle(function(){try{if($('.nf-o-fl-post__commentbadge-count[data-nyhet-id]').length){loadFrontCommentCounts()}}catch(e){}})});function fontSizeInEm($element){const fontSizePx=parseFloat($element.css("font-size"));const parentFontSizePx=parseFloat($element.parent().css("font-size"));return fontSizePx/parentFontSizePx}
738var adsInit,iFramResizeSettings;(function(){if(document.fonts&&document.fonts.check){var checkFonts=function(){if(document.fonts.check('16px "Font Awesome 6 Pro"')||document.fonts.check('16px "Font Awesome 6 Brands"')){document.documentElement.classList.add('fontawesome-loaded')}else{setTimeout(checkFonts,50)}};if(document.fonts.ready){document.fonts.ready.then(function(){checkFonts()})}else{setTimeout(checkFonts,100)}}else{setTimeout(function(){document.documentElement.classList.add('fontawesome-loaded')},200)}})();$(window).load(function(){if(typeof window.initArticleGalleries==="function"){window.initArticleGalleries()}
739if(typeof window.initWebcamCarousels==="function"){window.initWebcamCarousels()}
740if(typeof window.initAdCarousels==="function"){window.initAdCarousels({maxAttempts:20,retryMs:100})}
741iFramResizeSettings={license:"12ajjdewwwy-26rnhw2943-1s7g1u8ma0i",inPageLinks:!0,scrolling:!1,direction:"vertical",waitForLoad:!1,checkOrigin:!1,warningTimeout:0,log:!1,};runWhenIdle(function(){if($("iframe.nf-js-iframeresizer").length){if(typeof iframeResize==="function"){iframeResize(iFramResizeSettings,"iframe.nf-js-iframeresizer")}else{var basePath=(window.baseNewsflowHref||(window.jsPath||"/src/js/").replace(/\/js\/?$/,""))+"/js/";var s=document.createElement("script");s.src=basePath+"iframe-resizer/iframe-resizer.parent.js";s.onload=function(){if(typeof iframeResize==="function")iframeResize(iFramResizeSettings,"iframe.nf-js-iframeresizer");};document.head.appendChild(s)}}});runWhenIdle(function(){$(".nf-o-fl-module").each(function(){const $module=$(this),resizeElements=[{el:".nf-c-front-rssfeed",baseSize:1},{el:".nf-c-front-rssfeeds",baseSize:1},{el:".nf-c-front-nyhetslistemodul",baseSize:1.1},];if(is_mobile){return!1}
742const checkVisibility=setInterval(function(){let $layoutColumn=$module.closest(".
742nf-c-frontlayout-col, .nf-c-frontlayout-subcol"),$layoutRow=$module.closest(".nf-c-frontlayout-row, .nf-c-frontlayout-sub"),$layoutContainer=$module.closest(".nf-c-frontlayout-grid, .nf-o-frontlayout"),h=$layoutColumn.length?$layoutColumn.height():($layoutRow.length?$layoutRow.height():$layoutContainer.height()),$resizeElement=null;if(h){clearInterval(checkVisibility);resizeElements.forEach(function(element){if($module.find(element.el).length){$resizeElement=$module.find(element.el)}
743if($resizeElement){$resizeElement.animate({height:h,},1000);if(element.el!==".nf-c-front-rssfeeds"){$(".nf-o-moduleblock-module__content",$module).css("height","100%")}
744$(".nf-o-moduleblock-module__content",$module).css("overflow-y","auto");if(window.self!==window.top&&window.frameElement){}
745const w=$resizeElement.width(),fontSize=fontSizeInEm($module),newFontSize=roundToDecimal(fontSize*(element.baseSize+(w-100)/1000),2);$resizeElement.css("font-size",newFontSize+"em")}})}},100)})});if(typeof inMobiCMPLoaded!=="undefined"&&inMobiCMPLoaded!==null&&inMobiCMPLoaded){async function updateGDPRConsent(tcData,vendorId,realId){return new Promise((resolve,reject)=>{let gdprCookie=Cookies.get("newsflow_gdpr_accepted");if(gdprCookie!==undefined){gdprCookie=JSON.parse(gdprCookie)}else{gdprCookie={}}
746if(tcData.gdprApplies){__tcfapi("getNonIABVendorConsents",2,function(consent,cSuccess){if(cSuccess){if(gdprVendorsDefaults[realId]||(consent.nonIabVendorConsents&&consent.nonIabVendorConsents[vendorId])){gdprCookie[vendorId]=!0;if(gdprVendorsNames[realId]==="GDPR_VENDOR_GOOGLE"){grantGoogleAnalyticsConsent()}}else{gdprCookie[vendorId]=!1}
747Cookies.set("newsflow_gdpr_accepted",JSON.stringify(gdprCookie),{expires:30})}})}else{gdprCookie[vendorId]=!0;Cookies.set("newsflow_gdpr_accepted",JSON.stringify(gdprCookie),{expires:30,})}
748resolve()})}
749async function updateGDPRCookies(tcData,gdprVendors){for(const vendorId of gdprVendors){let realId=gdprVendors.indexOf(vendorId);await updateGDPRConsent(tcData,vendorId,realId)}}
750__tcfapi("addEventListener",2,function(tcData,success){if(success){if(tcData.gdprApplies){if(tcData.eventStatus==="tcloaded"){updateGDPRCookies(tcData,gdprVendors)}else if(tcData.eventStatus==="useractioncomplete"){updateGDPRCookies(tcData,gdprVendors)}else{}}}})}
751if(getGDPRConsent("GDPR_VENDOR_LESEWEB")){if($(".nf-o-leseweb-wrapper").length){let $playButton=$(".nf-o-leseweb-controls i.fa-circle-play"),$pauseButton=$(".nf-o-leseweb-controls i.fa-circle-pause"),$settingsButton=$(".nf-o-leseweb-controls i.fa-gear"),$helpButton=$(".nf-o-leseweb-controls i.fa-circle-question"),paused=!1;const lesewebInitMaxAttempts=40;const lesewebInitIntervalMs=250;let lesewebInitAttempts=0;function hideLeseweb(error){console.log("vfact_SetCustomParams error: "+error);$(".nf-o-leseweb-wrapper").hide()}
752function applyLesewebParams(){if(window.nfDisableLesewebCustomParams!==!1){return}
753if(typeof window.vfact_SetCustomParams!=="function"){throw new Error("vfact_SetCustomParams is not available")}
754const safeSpeed=typeof lesewebParamsSpeed==="number"?lesewebParamsSpeed:1;const safeGender=typeof lesewebParamsGender==="string"&&lesewebParamsGender?lesewebParamsGender:"f";const safeQuality=typeof lesewebParamsQuality==="number"?lesewebParamsQuality:2;const maybePromise=window.vfact_SetCustomParams(safeSpeed,safeGender,safeQuality,function(){});if(maybePromise&&typeof maybePromise.catch==="function"){maybePromise.catch(function(error){hideLeseweb(error)})}}
755function initLesewebParamsWithRetry(){if(typeof window.vfact_SetCustomParams==="function"){try{applyLesewebParams()}catch(error){hideLeseweb(error)}
756return}
757lesewebInitAttempts++;if(lesewebInitAttempts>=lesewebInitMaxAttempts){hideLeseweb("vFact init timeout");return}
758setTimeout(initLesewebParamsWithRetry,lesewebInitIntervalMs)}
759initLesewebParamsWithRetry();$playButton.click(function(){if(typeof window.vFact_playsection_or_selection!=="function"){return}
760if(paused){window.vFact_playsection_or_selection("nf-c-artikkel-content")}else{window.vFact_playsection_or_selection("nf-c-artikkel-content");if(window.vFact_HTML5Player&&typeof window.vFact_HTML5Player.setEventHandler_OnChangePlaylistStatus==="function"){window.vFact_HTML5Player.setEventHandler_OnChangePlaylistStatus(ExecEvent)}}});$pauseButton.click(function(){if(typeof window.vFact_dostop!=="function"){return}
761window.vFact_dostop();paused=!0});function ExecEvent(newPlaylistStatus){if(newPlaylistStatus==0){$pauseButton.hide();$pauseButton.next("span").hide();$playButton.show();$playButton.next("span").show()}else{$playButton.hide();$playButton.next("span").hide();$pauseButton.show();$pauseButton.next("span").show()}}
762$settingsButton.click(function(){if(typeof window.vFact_showconfigbox==="function"){window.vFact_showconfigbox()}});$helpButton.click(function(){if(typeof window.vFact_dohelp==="function"){window.vFact_dohelp()}})}}});var resizeId;$(window).resize(function(){clearTimeout(resizeId);resizeId=setTimeout(doneResizing,500)});function doneResizing(){}(function(){'use strict';function pad(value){return value<10?'0'+value:String(value)}
763function writePart(root,part,value){var node=root.querySelector('[data-countdown-part="'+part+'"]');if(node){node.textContent=part==='days'?String(value):pad(value)}}
764function hideExpired(root){var wrapper=root.closest('.nf-c-nedtelling-mediawrap');if(wrapper&&wrapper.querySelector('.nf-c-nedtelling-placeholder-container')){wrapper.style.display='none';return}
765root.style.display='none'}
766function updateCountdown(root,nowTs){var until=parseInt(root.getAttribute('data-nedtelling-until'),10);if(!until){hideExpired(root);return!1}
767var diff=until-nowTs;if(diff<=0){hideExpired(root);return!1}
768var days=Math.floor(diff/86400);var hours=Math.floor((diff%86400)/3600);var minutes=Math.floor((diff%3600)/60);var seconds=diff%60;writePart(root,'days',days);writePart(root,'hours',hours);writePart(root,'minutes',minutes);writePart(root,'seconds',seconds);return!0}
769function initCountdowns(){var countdowns=Array.prototype.slice.call(document.querySelectorAll('.nf-js-nedtelling[data-nedtelling-until]'));if(!countdowns.length){return}
770function tick(){var nowTs=Math.floor(Date.now()/1000);countdowns=countdowns.filter(function(root){return updateCountdown(root,nowTs)});if(!countdowns.length){clearInterval(interval)}}
771tick();var interval=setInterval(tick,1000)}
772if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',initCountdowns)}else{initCountdowns()}})();(function($){'use strict';var config={debug:!1,_isAdminCached:null,isAdmin:function(){if(this._isAdminCached===null){this._isAdminCached=window.location.pathname.indexOf('/webdesk/')!==-1||$('#outer
772wrap').length>0||$('.uppyThumbnail__img').length>0}
773return this._isAdminCached},placeholders:{admin:{width:150,height:100,fontSize:12,text:['Kan ikke','vise bildet']},public:{width:200,height:100,fontSize:14,text:['Kan ikke','vise bildet']}}};var svgPlaceholderCache={};var videoPosterRetryObserver=null;function debugLog(){if(config.debug&&console&&console.log){var args=Array.prototype.slice.call(arguments);args.unshift('[NewsFlow Images]');console.log.apply(console,args)}}
774function generateSVGPlaceholder(){var isAdmin=config.isAdmin();var cacheKey=isAdmin?'admin':'public';if(!svgPlaceholderCache[cacheKey]){var settings=config.placeholders[cacheKey];var svgContent='<svg width="'+settings.width+'" height="'+settings.height+'" xmlns="http://www.w3.org/2000/svg">'+'<rect width="100%" height="100%" fill="#f5f5f5" stroke="#ddd" stroke-width="1"/>'+'<text x="50%" y="40%" font-family="Arial, sans-serif" font-size="'+settings.fontSize+'" fill="#999" text-anchor="middle" dominant-baseline="central">'+settings.text[0]+'</text>'+'<text x="50%" y="60%" font-family="Arial, sans-serif" font-size="'+settings.fontSize+'" fill="#999" text-anchor="middle" dominant-baseline="central">'+settings.text[1]+'</text>'+'</svg>';svgPlaceholderCache[cacheKey]="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(svgContent)}
775return svgPlaceholderCache[cacheKey]}
776function isImageBroken(img){if(!img.complete)return!1;var $img=$(img);if($img.attr('data-error-retry'))return!1;if($img.hasClass('retrying-load')&&$img.attr('data-original-src'))return!1;if($img.hasClass("lazyload")||$img.hasClass("lazyloading"))return!1;var $picture=$img.closest('picture');if($picture.length&&$picture.find('source[data-srcset]').length&&!img.src)return!1;if($img.attr('data-src')&&(!img.src||img.src===''||img.src===window.location.href))return!1;if(img.src&&img.src.indexOf('data:image/gif;base64,R0lGOD')===0&&$img.attr('data-src'))return!1;var isGreyGif=img.src.indexOf('/pix/grey.gif')!==-1||img.src.indexOf('grey.gif')!==-1;if(isGreyGif){debugLog("Detected grey.gif placeholder:",img.src);return!0}
777var isVerySmall=img.naturalWidth<=2||img.naturalHeight<=2;if(isVerySmall){var hasValidSrc=img.src&&img.src!==''&&img.src.indexOf('data:image/svg+xml')===-1;var hasLazyAttributes=$img.attr('data-src')||$img.attr('data-srcset')||($picture.length&&$picture.find('source[data-srcset]').length);if(hasValidSrc&&$img.hasClass("lazyloaded")&&img.complete&&(img.naturalWidth===0||img.naturalHeight===0)&&isRetryableImageUrl(img.src)){debugLog("Detected failed lazyloaded nfimage:",img.src,"dimensions:",img.naturalWidth,"x",img.naturalHeight);return!0}
778if(hasValidSrc&&hasLazyAttributes)return!1;if($img.hasClass("lazyloaded")&&img.naturalWidth>0&&img.naturalHeight>0&&img.naturalWidth===1&&img.naturalHeight===1){var isImageUrl=isRetryableImageUrl(img.src);if(isImageUrl&&img.src.indexOf('grey.gif')===-1&&img.src.indexOf('data:image/svg+xml')===-1){debugLog("Detected very small image (likely broken - exactly 1x1, probably grey.gif from server):",img.src,"dimensions:",img.naturalWidth,"x",img.naturalHeight);return!0}}}
779return(isVerySmall||$img.hasClass("error-placeholder")||$img.hasClass("broken-image"))}
780function setupMutationObserver($img,img){if(!window.MutationObserver)return;var observer=new MutationObserver(function(mutations){for(var i=0;i<mutations.length;i++){var mutation=mutations[i];if(mutation.type==='attributes'&&mutation.attributeName==='class'){if($img.hasClass("lazyloaded")){$img.removeClass("lazyloaded");debugLog("Prevented lazyloaded class from being re-added to error placeholder")}}}});observer.observe(img,{attributes:!0,attributeFilter:['class']})}
781function replaceBrokenImageWithPlaceholder(img,opts){if(img.src.indexOf("data:image/svg+xml")!==-1)return;var $img=$(img);var isAdmin=config.isAdmin();var url=img.src||$img.attr('data-original-src')||'';if(isAdmin&&isRetryableImageUrl(url)&&!(opts&&opts.forceReplace)){return}
782var isAdImage=$img.hasClass('nf-o-annonse__img')&&!$img.hasClass('nf-o-annonse__adcounterimg');var $adContainer=null;if(isAdImage){$adContainer=$img.closest('.nf-o-annonse-container')}
783var originalSrc=$img.attr('data-src')||$img.attr('src');var $picture=$img.closest('picture');if($picture.length&&!originalSrc){var $firstSource=$picture.find('source[data-srcset]').first();if($firstSource.length){var srcset=$firstSource.attr('data-srcset');
783if(srcset){var match=srcset.match(/^([^\s,]+)/);if(match){originalSrc=match[1]}}}}
784if(originalSrc&&originalSrc.indexOf('data:image/svg+xml')===-1){$img.attr('data-original-src',originalSrc);$img.attr('data-error-timestamp',Date.now())}
785$img.addClass("error-placeholder").removeClass("lazyload lazyloading lazyloaded").removeAttr("data-src data-srcset srcset").attr("alt","Kan ikke vise bildet");if($picture.length){$picture.find('source').each(function(){var $source=$(this);if($source.attr('data-srcset')){$source.removeAttr("srcset")}else{var srcset=$source.attr('srcset');if(srcset){$source.attr('data-srcset',srcset).removeAttr("srcset")}}})}
786img.src=generateSVGPlaceholder();if(isAdmin){var settings=config.placeholders.admin;$img.css({width:settings.width+"px",height:settings.height+"px",minWidth:settings.width+"px",minHeight:settings.height+"px",maxWidth:settings.width+"px",maxHeight:settings.height+"px"})}
787debugLog("Replaced broken image with SVG placeholder (context: "+(isAdmin?"admin":"public")+")");if($img.hasClass("error-placeholder")){setupMutationObserver($img,img)}
788if(isAdmin){hideEditIconForBrokenImage(img);$img.off('click').css('cursor','default').removeAttr('title');var $tbody=$img.closest('tbody');if($tbody.length){$img.addClass('broken-image');$img.closest('picture').addClass('broken-image');$img.closest('.previewbilde__img').addClass('has-broken-image');$tbody.addClass('notMovable broken-image-row')}}
789if(isAdImage&&$adContainer&&$adContainer.length){$adContainer.addClass('nf-o-annonse-container--empty').attr('data-empty','1');if(typeof window.hideEmptyAd==='function'){window.hideEmptyAd($adContainer)}else{$adContainer.hide()}
790debugLog("Hidden ad container due to broken image")}}
791function findEditIconForImage(img){var $img=$(img);var $parentDiv=$img.closest('.previewbilde__img');if($parentDiv.length){var $editIcon=$parentDiv.find('.uppyThumbnail__edit');if($editIcon.length)return $editIcon}
792var $fromParent=$img.parent().find(".uppyThumbnail__edit");if($fromParent.length)return $fromParent;return $img.closest('li').find(".uppyThumbnail__edit")}
793function showEditIconForLoadedImage(img){if(!config.isAdmin())return;var $editIcon=findEditIconForImage(img);if($editIcon.length){$editIcon.css({display:'block',visibility:'visible'}).removeClass('hidden-for-lazy-loading');debugLog("Showing edit icon for successfully loaded image with PID:",$(img).data('pid')||"unknown")}}
794function hideEditIconForBrokenImage(img){if(!config.isAdmin())return;var $editIcon=findEditIconForImage(img);if($editIcon.length){$editIcon.css({display:'none',visibility:'hidden'}).addClass('hidden-for-broken-image');debugLog("Hiding edit icon for broken image with PID:",$(img).data('pid')||"unknown")}}
795function hideEditIconForImage(img,opts){var $editIcon=findEditIconForImage(img);if($editIcon.length){$editIcon.css("display","none")}
796replaceBrokenImageWithPlaceholder(img,opts)}
797function getTransparentPlaceholder(){return'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=='}
798function isRetryableImageUrl(url){url=String(url||'');return url.indexOf('/bilder/')!==-1||url.indexOf('/webdesk/ajax/inactiveImagePreview.php')!==-1}
799function addRetryParam(url){return url+(url.indexOf('?')!==-1?'&':'?')+'_retry='+Date.now()}
800function getRetryDelay($img,retryCount,opts){if(opts&&typeof opts.retryDelayMs==='number'){return Math.max(0,opts.retryDelayMs)}
801var baseDelay=5000;if(config.isAdmin()){return baseDelay}
802var seed=String($img.attr('data-pid')||$img.attr('data-original-src')||$img.attr('data-src')||'');var spread=0;for(var i=0;i<seed.length;i++){spread=((spread*31)+seed.charCodeAt(i))%3500}
803return baseDelay+spread+(Math.min(retryCount,3)*1000)}
804function firstUrlFromSrcset(srcset){var match=(srcset||'').match(/^([^\s,]+)/
804);return match?match[1]:''}
805function getImageRetryCandidateUrl($img,img){var src=(img&&img.src)||'';if(isRetryableImageUrl(src)){return src}
806var attrNames=['data-src','srcset','data-srcset'];for(var i=0;i<attrNames.length;i++){var attrValue=$img.attr(attrNames[i])||'';if(!attrValue)continue;var candidate=attrNames[i].indexOf('srcset')!==-1?firstUrlFromSrcset(attrValue):attrValue;if(candidate&&isRetryableImageUrl(candidate)){return candidate}}
807var $picture=$img.closest('picture');var $source=$picture.find('source[srcset*="/bilder/"], source[data-srcset*="/bilder/"], source[srcset*="/webdesk/ajax/inactiveImagePreview.php"], source[data-srcset*="/webdesk/ajax/inactiveImagePreview.php"]').first();if($source.length){return firstUrlFromSrcset($source.attr('srcset')||$source.attr('data-srcset')||'')}
808return src}
809function storePictureSourcesForRetry($picture){if(!$picture.length)return;$picture.find('source').each(function(){var $source=$(this);var srcset=$source.attr('srcset')||$source.attr('data-srcset');if(srcset){$source.attr('data-srcset',srcset).removeAttr('srcset')}})}
810function restorePictureSourcesForRetry($picture){if(!$picture.length)return;$picture.find('source[data-srcset]').each(function(){var $source=$(this);var srcset=$source.attr('data-srcset');if(!srcset)return;var retriedSrcset=srcset.replace(/(^|,\s*)([^\s,]+)/g,function(match,prefix,url){return prefix+addRetryParam(url)});$source.attr('srcset',retriedSrcset)})}
811function updateVideoPosterRetrySource($img,retryUrl){if(!$img.hasClass('nf-video-player__poster')||!retryUrl){return}
812var $container=$img.closest('.nf-video-player');if(!$container.length){return}
813$container.attr('data-poster-url',retryUrl);if(window.nfVideoPlayers&&$container.attr('id')&&window.nfVideoPlayers[$container.attr('id')]){window.nfVideoPlayers[$container.attr('id')].posterUrl=retryUrl}}
814function retryVideoPosterWhenAvailable($img,img,retryUrl){if(!$img.hasClass('nf-video-player__poster')||!retryUrl||!window.fetch){return!1}
815$img.attr('data-poster-probe','1');window.fetch(retryUrl,{credentials:'same-origin'}).then(function(response){$img.removeAttr('data-poster-probe');if(!response||!response.ok){$img.removeClass('retrying-load').removeAttr('data-original-src');return}
816restoreAdContainerForImageRetry($img);$img.removeClass('nf-video-player__poster--pending error-placeholder broken-image retrying-load').removeAttr('data-original-src data-error-timestamp data-src data-error-retry data-error-retry-scheduled data-poster-probe');updateVideoPosterRetrySource($img,retryUrl);img.src=retryUrl}).catch(function(){$img.removeAttr('data-poster-probe').removeClass('retrying-load').removeAttr('data-original-src')});return!0}
817function restoreAdContainerForImageRetry($img){if(!$img.hasClass('nf-o-annonse__img')||$img.hasClass('nf-o-annonse__adcounterimg')){return}
818var $adContainer=$img.closest('.nf-o-annonse-container');if(!$adContainer.length){return}
819if(typeof window.restoreAdVisibility==='function'){window.restoreAdVisibility($adContainer)}else{$adContainer.removeClass('nf-o-annonse-container--empty').removeAttr('data-empty').show();$adContainer.parents('.nf-o-annonse-wrapper, .nf-o-annonse, .nf-o-mobilannonse').removeClass('nf-o-annonse-wrapper--all-empty nf-o-annonse--all-empty nf-o-mobilannonse--all-empty').show()}}
820function handleImageError(img,opts){var $img=$(img);var src=getImageRetryCandidateUrl($img,img);var isNfimageUrl=isRetryableImageUrl(src);var retryCount=parseInt($img.attr('data-error-retry')||'0',10);var retryScheduled=$img.attr('data-error-retry-scheduled')==='1';var isAdmin=config.isAdmin();var maxRetries=isAdmin?2:6;var skipRetry=!!(opts&&opts.skipRetry);if(!skipRetry&&isNfimageUrl&&retryScheduled){return}
821if(!skipRetry&&isNfimageUrl&&retryCount<maxRetries){$img.attr('data-error-retry',String(retryCount+1));$img.attr('data-error-retry-scheduled','1');var originalUrlForRetry=(src&&src.indexOf('data:image/svg+xml')===-1)?src:($img.attr('data-original-src')||'');var $picture=$img.closest('picture');if(originalUrlForRetry){$img.attr('data-original-src',originalUrlForRetry)}
822storePictureSourcesForRetry($picture);$img.removeAttr('srcset data-srcset').removeClass('lazyload lazyloading lazyloaded').addClass('retrying-load');img.src=getTransparentPlaceholder();var delay=getRetryDelay($img,retryCount,opts);setTimeout(function(){$img.removeAttr('data-error-retry-scheduled');var urlToRetry=($img.attr('data-original-src')||originalUrlForRetry||img.src||'');if(urlToRetry&&urlToRetry.indexOf('data:image/svg+xml')===-1&&isRetryableImageUrl(urlToRetry)){restoreAdContainerForImageRetry($img);$img.removeClass('error-placeholder broken-image').removeAttr('data-original-src data-error-timestamp');$img.closest('picture').removeClass('broken-image');$img.closest('.previewbilde__img').removeClass('has-broken-image');$img.closest('tbody').removeClass('notMovable broken-image-row');restorePictureSourcesForRetry($picture);var retryUrl=addRetryParam(urlToRetry);if(retryVideoPosterWhenAvailable($img,img,retryUrl)){return}
823updateVideoPosterRetrySource($img,retryUrl);img.src=retryUrl}},delay);return}
824$img.removeAttr('data-error-retry data-error-retry-scheduled');if(config.isAdmin()){hideEditIconForImage(img,{forceReplace:!0})}else{replaceBrokenImageWithPlaceholder(img)}}
825function hasLazyAttributes(img){var $img=$(img);var $picture=$img.closest('picture');return $img.attr('data-src')||$img.attr('data-srcset')||$img.hasClass('lazyload')||($picture.length&&$picture.find('source[data-srcset]').length)}
826function isInViewport(img){var rect=img.getBoundingClientRect();return(rect.top<window.innerHeight&&rect.bottom>0&&rect.left<window.innerWidth&&rect.right>0)}
827function getVideoPosterViewportTarget($img,img){var $container=$img.closest('.nf-video-player');return $container.length?$container[0]:img}
828function observeVideoPosterForRetry($img,img){if(config.isAdmin()||!window.IntersectionObserver||!$img.hasClass('nf-video-player__poster')||!$img.attr('data-src')){return!1}
829if($img.attr('data-poster-retry-observed')==='1'){return!0}
830if(!videoPosterRetryObserver){videoPosterRetryObserver=new IntersectionObserver(function(entries){for(var i=0;i<entries.length;i++){if(!entries[i].isIntersecting)continue;var poster=entries[i].target;var $poster=$(poster);videoPosterRetryObserver.unobserve(poster);$poster.removeAttr('data-poster-retry-observed');if($poster.hasClass('image-rendered')||$poster.hasClass('error-placeholder')||$poster.attr('data-error-retry-scheduled'))continue;if($poster.hasClass('retrying-load')&&$poster.attr('data-original-src'))continue;if(!isRetryableImageUrl(getImageRetryCandidateUrl($poster,poster)))continue;handleImageError(poster,{retryDelayMs:150})}},{root:null,rootMargin:'80px',threshold:0.01})}
831$img.attr('data-poster-retry-observed','1');videoPosterRetryObserver.observe(img);return!0}
832function processImages(selector,checkFn){$(selector).each(function(){var $img=$(this);var img=this;var isDeletedItemsImage=$img.closest('table.deleted-items-table').length>0;var hasLazy=hasLazyAttributes(this);var hasBeenProcessed=$img.hasClass("lazyloaded")||(!$img.hasClass("lazyload")&&!$img.hasClass("lazyloading"))||($img.attr('data-src')&&this.src&&this.src!==''&&this.src.indexOf('data:image/svg+xml')===-1);if(!hasLazy||hasBeenProcessed||$img.hasClass("lazyloaded")){if(isDeletedItemsImage){var isGreyGif=img.src&&(img.src.indexOf('/pix/grey.gif')!==-1||img.src.indexOf('grey.gif')!==-1);var hasValidSrc=img.src&&img.src.indexOf('data:image/svg+xml')===-1&&img.src.indexOf('grey.gif')===-1;
832var isCompletelyFailed=img.complete&&img.naturalWidth===0&&img.naturalHeight===0;if(isGreyGif||(isCompletelyFailed&&hasValidSrc)){debugLog("Found broken image in deleted items (processImages):",img.src||'unknown');checkFn(img)}}else{if(isImageBroken(img)){debugLog("Found broken image in processImages:",img.src||'unknown',"hasLazy:",hasLazy,"hasBeenProcessed:",hasBeenProcessed,"lazyloaded:",$img.hasClass("lazyloaded"));checkFn(img)}}}})}
833function checkImmediatelyVisibleImages(){var isAdmin=config.isAdmin();var selector=isAdmin?"img.uppyThumbnail__img":"img:not([class*='lazy'])";var checkFn=isAdmin?hideEditIconForImage:handleImageError;$(selector).each(function(){if(isAdmin&&hasLazyAttributes(this))return;var img=this;var $img=$(img);var imgSrc=img.src||'unknown';var isImageUrl=isRetryableImageUrl(imgSrc);if(isImageUrl){debugLog("checkImmediatelyVisibleImages: Checking non-lazy image:",imgSrc,"complete:",img.complete,"dimensions:",img.naturalWidth||0,"x",img.naturalHeight||0)}
834var isDeletedItemsImage=$img.closest('table.deleted-items-table').length>0;if(isDeletedItemsImage){var isGreyGif=imgSrc.indexOf('/pix/grey.gif')!==-1||imgSrc.indexOf('grey.gif')!==-1;var isCompletelyFailed=img.complete&&img.naturalWidth===0&&img.naturalHeight===0&&imgSrc.indexOf('data:image/svg+xml')===-1;if(isGreyGif||isCompletelyFailed){debugLog("Found broken image in deleted items:",imgSrc);checkFn(img)}}else{if(isImageBroken(img)){debugLog("Found broken image in checkImmediatelyVisibleImages:",imgSrc);checkFn(img)}else if(img.complete&&img.naturalWidth>0&&img.naturalHeight>0&&img.naturalWidth===1&&img.naturalHeight===1&&isImageUrl&&imgSrc.indexOf('grey.gif')===-1&&imgSrc.indexOf('data:image/svg+xml')===-1){debugLog("CRITICAL: Found non-lazy image with exactly 1x1 dimensions from retryable NewsFlow image URL:",imgSrc);checkFn(img)}}});if(!isAdmin){$("img[src*='/bilder/'], img[src*='/webdesk/ajax/inactiveImagePreview.php']").each(function(){var img=this;var $img=$(img);if($img.hasClass("error-placeholder")){return}
835if(isImageBroken(img)){handleImageError(img)}})}}
836function checkAllImagesForErrors(){var isAdmin=config.isAdmin();if(isAdmin){processImages("img.uppyThumbnail__img",hideEditIconForImage)}else{processImages("img[class*='lazy'], img.lazyloaded",handleImageError)}}
837function refreshLazyImageCandidates(){if(typeof lazySizes==='undefined'||!lazySizes.loader){return}
838if(typeof lazySizes.loader.checkElems==='function'){lazySizes.loader.checkElems()}
839if(lazySizes.autoSizer&&typeof lazySizes.autoSizer.checkElems==='function'){lazySizes.autoSizer.checkElems()}}
840function initImageErrorHandling(){$(document).on("error","img[data-pid]",function(){handleImageError(this)});if(typeof lazySizes==='undefined')return;var isAdmin=config.isAdmin();$(document).on("lazybeforeunveil",function(e){if(e.target.tagName!=="IMG")return;var $img=$(e.target);var imgTimeout=null;imgTimeout=setTimeout(function(){var img=$img[0];if($img.hasClass("lazyloaded")&&isImageBroken(img)){handleImageError(img)}},30000);$img.on("error",function(){if(imgTimeout)clearTimeout(imgTimeout);}).on("load",function(){if(imgTimeout)clearTimeout(imgTimeout);$img.removeAttr('data-error-retry-scheduled');var loadedImg=this;var $loadedImg=$(loadedImg);if($loadedImg.hasClass("retrying-load")){var width=loadedImg.naturalWidth||0;var height=loadedImg.naturalHeight||0;if(width>2&&height>2&&loadedImg.src.indexOf('grey.gif')===-1&&loadedImg.src.indexOf('data:image/svg+xml')===-1){$loadedImg.removeClass("retrying-load");return}}
841var finalizeLoadedImage=function(){if(isImageBroken(loadedImg)){handleImageError(loadedImg)}else{if(!$loadedImg.hasClass('image-rendered')&&loadedImg.naturalWidth>0&&loadedImg.naturalHeight>0){$loadedImg.addClass('image-rendered')}
842if(isAdmin&&$loadedImg.hasClass("uppyThumbnail__img")){showEditIconForLoadedImage(loadedImg)}}};if(loadedImg.naturalWidth>0&&loadedImg.naturalHeight>0){finalizeLoadedImage()}else{var runNext=window.requestAnimationFrame||function(fn){setTimeout(fn,0)};runNext(finalizeLoadedImage)}})});$(document).on("lazyloaded",function(e){if(e.target&&e.target.tagName==="IMG"){var img=e.target;var $img=$(img);
842if($img.hasClass("retrying-load")){var width=img.naturalWidth||0;var height=img.naturalHeight||0;if(width>2&&height>2&&img.src.indexOf('grey.gif')===-1&&img.src.indexOf('data:image/svg+xml')===-1){$img.removeClass("retrying-load");$img.removeAttr('data-error-retry-scheduled');return}}
843var finalizeLazyLoadedImage=function(){if(isImageBroken(img)){handleImageError(img)}else if(isAdmin&&$img.hasClass("uppyThumbnail__img")){showEditIconForLoadedImage(img)}};if(img.naturalWidth>0&&img.naturalHeight>0){finalizeLazyLoadedImage()}else{var runNext=window.requestAnimationFrame||function(fn){setTimeout(fn,0)};runNext(finalizeLazyLoadedImage)}}})}
844function initComprehensiveChecking(){$(document).ready(function(){setTimeout(checkImmediatelyVisibleImages,2000);setTimeout(refreshLazyImageCandidates,250);setTimeout(refreshLazyImageCandidates,1500);setTimeout(function(){debugLog("Comprehensive check for all images after page load");refreshLazyImageCandidates();checkAllImagesForErrors()},5000)});var isAdmin=config.isAdmin();if(isAdmin){setTimeout(function(){debugLog("Checking for broken-image class elements");$("img.broken-image").each(function(){debugLog("Found broken-image element:",this);replaceBrokenImageWithPlaceholder(this)})},1000);setTimeout(function(){debugLog("Comprehensive check for processed images");checkAllImagesForErrors()},4000);function checkStuckImages(){$('.previewbilde__img img[data-pid], td.previewbilde img[data-pid]').each(function(){var img=this;var $img=$(img);if($img.hasClass('image-rendered')||$img.hasClass('error-placeholder'))return;var url=img.src||$img.attr('data-src')||'';if(!isRetryableImageUrl(url))return;if(img.naturalWidth>0&&img.naturalHeight>0)return;handleImageError(img)})}
845setTimeout(checkStuckImages,12000);setTimeout(checkStuckImages,22000)}else{function checkStuckFrontModuleImages(){$('.nf-o-moduleblock img[data-pid][src*="/bilder/"], .nf-o-moduleblock img[data-pid][data-src*="/bilder/"], .nf-c-front-nyhetslistemodul__img[data-pid][src*="/bilder/"], .nf-c-front-nyhetslistemodul__img[data-pid][data-src*="/bilder/"], .nf-video-player__poster[data-pid][src*="/bilder/"], .nf-video-player__poster[data-pid][data-src*="/bilder/"], .nf-js-ad-container[data-ad-type="static"] img.nf-o-annonse__img[data-pid][src*="/bilder/"], .nf-js-ad-container[data-ad-type="static"] img.nf-o-annonse__img[data-pid][data-src*="/bilder/"]').each(function(){var img=this;var $img=$(img);var isVideoPoster=$img.hasClass('nf-video-player__poster');if($img.hasClass('image-rendered')||$img.hasClass('error-placeholder')||$img.attr('data-error-retry-scheduled'))return;if($img.hasClass('retrying-load')&&$img.attr('data-original-src'))return;if(!isRetryableImageUrl(getImageRetryCandidateUrl($img,img)))return;if(isVideoPoster){if(!isInViewport(getVideoPosterViewportTarget($img,img))){observeVideoPosterForRetry($img,img);return}
846if($img.attr('data-src')){handleImageError(img,{retryDelayMs:150});return}}
847var isStaticAdImage=$img.closest('.nf-js-ad-container[data-ad-type="static"]').length>0;if(isStaticAdImage&&isInViewport(img)&&!$img.hasClass('lazyloaded')){handleImageError(img);return}
848if(img.complete&&img.naturalWidth>2&&img.naturalHeight>2&&img.src.indexOf('grey.gif')===-1){$img.addClass('image-rendered');return}
849if(!img.complete&&isVideoPoster){handleImageError(img);return}
850if(img.complete&&$img.hasClass('lazyloaded')&&(img.naturalWidth===0||img.naturalHeight===0||isImageBroken(img))){handleImageError(img)}})}[750,2000].forEach(function(delay){setTimeout(function(){refreshLazyImageCandidates();checkStuckFrontModuleImages()},delay)});setTimeout(function(){refreshLazyImageCandidates();checkAllImagesForErrors();checkStuckFrontModuleImages()},4000);[10000,20000,35000].forEach(function(delay){setTimeout(function(){refreshLazyImageCandidates();checkStuckFrontModuleImages();if(typeof window.NewsFlowImages!=='undefined'&&window.NewsFlowImages.retryErrorPlaceholderImages){window.NewsFlowImages.retryErrorPlaceholderImages()}},delay)})}}
851function retryErrorPlaceholderImages(){var retriedCount=0;$('img.error-placeholder[data-original-src]').each(function(){var $img=$(this);var originalSrc=$img.attr('data-original-src');var $picture=$img.closest('picture');if(!originalSrc)return;restoreAdContainerForImageRetry($img);$img.addClass('retrying-load').removeClass('error-placeholder').removeAttr('data-original-src data-error-timestamp');if($picture.length){$picture.find('source[data-srcset]').each(function(){var $source=$(this);var dataSrcset=$source.attr('data-srcset');if(dataSrcset){$source.attr('srcset',dataSrcset)}});var $firstSource=$picture.find('source[srcset]').first();if($firstSource.length){var srcset=$firstSource.attr('srcset');
851if(srcset){var match=srcset.match(/^([^\s,]+)/);if(match){var firstUrl=match[1];$img.attr('src',firstUrl);$img.attr('data-src',firstUrl);var dataSrcset=$firstSource.attr('data-srcset');if(dataSrcset){$img.attr('data-srcset',dataSrcset)}}}}}else{$img.attr('src',originalSrc);$img.attr('data-src',originalSrc)}
852$img.addClass('lazyload').removeClass('lazyloaded lazyloading');if(typeof lazySizes!=='undefined'){lazySizes.loader.unveil($img[0])}else{var newImg=new Image();newImg.onload=function(){$img.attr('src',originalSrc);$img.addClass('lazyloaded').removeClass('retrying-load')};newImg.onerror=function(){$img.removeClass('retrying-load')};newImg.src=originalSrc}
853retriedCount++});if(retriedCount>0){debugLog("Retried loading "+retriedCount+" error-placeholder images")}
854return retriedCount}
855window.NewsFlowImages={replaceBrokenImageWithPlaceholder:replaceBrokenImageWithPlaceholder,hideEditIconForBrokenImage:hideEditIconForBrokenImage,hideEditIconForImage:hideEditIconForImage,showEditIconForLoadedImage:showEditIconForLoadedImage,findEditIconForImage:findEditIconForImage,checkAdminImagesForErrors:checkAllImagesForErrors,checkAllImagesForErrors:checkAllImagesForErrors,handleImageError:handleImageError,isImageBroken:isImageBroken,retryErrorPlaceholderImages:retryErrorPlaceholderImages,setDebug:function(enabled){config.debug=enabled},getDebug:function(){return config.debug}};$(document).ready(function(){initImageErrorHandling();initComprehensiveChecking()});$(window).on('load pageshow',function(){refreshLazyImageCandidates()});$(document).on('visibilitychange',function(){if(document.visibilityState==='visible'){refreshLazyImageCandidates()}})})(jQuery);(function($){'use strict';var CONFIG={targetClasses:['nf-c-front-nyhetslistemodul__tittel','nf-c-front-nyhetsmodul__tittel','nf-c-front-nyhetsstudio__tittel','nf-c-front-mestlest__tittel','nf-c-front-nyhetsstudio__link','nf-c-front-nyhetslistemodul__link','nf-c-front-nyhetsmodul__link'],scopedTitleClasses:['nf-o-fl-post-tittelbox__tittel','nf-o-fl-post-tittelbox__stikktittel','nf-o-fl-post-tittelbox__undertittel'],scopedTitleContexts:['nf-c-front-mestlest-nyhet','nf-s-frontlayout-block-tipsogspill','nf-c-artikkel-mestlest__list-item'],minFontSize:14,maxFontSize:24,stepSize:0.5,maxIterations:20,debounceDelay:250};function classSelector(classNames){return classNames.map(function(className){return'.'+className}).join(', ')}
856function targetSelector(){return classSelector(CONFIG.targetClasses.concat(CONFIG.scopedTitleClasses))}
857function isScopedTitleElement($element){var i;for(i=0;i<CONFIG.scopedTitleClasses.length;i++){if($element.hasClass(CONFIG.scopedTitleClasses[i])){return!0}}
858return!1}
859function canFitElement($element){if(!isScopedTitleElement($element)){return!0}
860return $element.closest(classSelector(CONFIG.scopedTitleContexts)).length>0}
861function resetElement($element){$element.css('font-size','');$element.removeAttr('data-text-fitted')}
862function isTextOverflowing($element){var element=$element[0];if(!element)return!1;if(element.clientWidth<=0)return!1;return element.scrollWidth-element.clientWidth>1}
863function fitTextToContainer($element){if($element.attr('data-text-fitted')==='true'){return}
864if(!isTextOverflowing($element)){$element.attr('data-text-fitted','true');return}
865var currentFontSize=parseFloat($element.css('font-size'));if(currentFontSize<=CONFIG.minFontSize){$element.attr('data-text-fitted','true');return}
866$element.css('font-size',CONFIG.minFontSize+'px');if(isTextOverflowing($element)){$element.attr('data-text-fitted','true');return}
867$element.css('font-size',currentFontSize+'px');var low=CONFIG.minFontSize;var high=currentFontSize;var best=low;var i;var mid;for(i=0;i<45&&high-low>0.25;i++){mid=(low+high)/2;$element.css('font-size',mid+'px');if(isTextOverflowing($element)){high=mid}else{best=mid;low=mid}}
868$element.css('font-size',best+'px');i=0;while(isTextOverflowing($element)&&best>CONFIG.minFontSize&&i<200){best-=0.25;$element.css('font-size',best+'px');i++}
869$element.attr('data-text-fitted','true')}
870function processAllElements(resetFitted){var selector=targetSelector();$(selector).each(function(){var $element=$(this);if(!canFitElement($element)){resetElement($element);return}
871if(resetFitted){resetElement($element)}
872if($element.is(':hidden')||!$element.text().trim()||$element.attr('data-text-fitted')==='true'){return}
873if(isTextOverflowing($element)){fitTextToContainer($element)}})}
874var debouncedReprocess=(function(){var timeout;return function(){clearTimeout(timeout);timeout=setTimeout(function(){processAllElements(!0)},CONFIG.debounceDelay)}})();
874function init(){$(document).ready(function(){setTimeout(function(){processAllElements()},50);$(window).on('resize',debouncedReprocess);$(window).on('load',function(){processAllElements(!0)});if(document.fonts&&document.fonts.ready&&document.fonts.ready.then){document.fonts.ready.then(function(){processAllElements(!0)})}
875if(typeof MutationObserver!=='undefined'){var observer=new MutationObserver(function(mutations){mutations.forEach(function(mutation){if(mutation.type==='childList'){mutation.addedNodes.forEach(function(node){if(node.nodeType===1){var $newElement=$(node);if($newElement.is(targetSelector())&&canFitElement($newElement)){setTimeout(function(){if(isTextOverflowing($newElement)){fitTextToContainer($newElement)}},100)}
876$newElement.find(targetSelector()).each(function(){var $childElement=$(this);if(canFitElement($childElement)&&isTextOverflowing($childElement)){fitTextToContainer($childElement)}})}})}})});observer.observe(document.body,{childList:!0,subtree:!0})}
877$(document).on('lazyloaded',debouncedReprocess);$(document).on('esi-content-loaded',debouncedReprocess)})}
878window.NewsFlowTextFitting={fitElement:function(element){var $element=$(element);if($element.length&&canFitElement($element)){fitTextToContainer($element)}},processAll:function(){$(targetSelector()).each(function(){resetElement($(this))});processAllElements()},updateConfig:function(newConfig){$.extend(CONFIG,newConfig)}
878};init()})(jQuery);var POOLED_CHECKER_CONFIG={MAX_BACKOFF_MULTIPLIER:8,SERVER_BACKOFF_LIMIT:4,CONNECTION_FAIL_DELAY:10000,BATCH_SIZE:3,MIN_INTERVAL:2000,MAX_INTERVAL:10000};var pooledCheckerState={timeout:0,callNumber:0,backoffMultiplier:1,pendingChecks:{},lastRequestTime:0,nextCheckId:0};function calculatePooledTimeout(baseFreq,slowFreq,backoffMultiplier){var focus=document.hasFocus()?1:0;var baseTimeout=focus?baseFreq*1000:slowFreq*1000;return Math.min(Math.max(baseTimeout*backoffMultiplier,POOLED_CHECKER_CONFIG.MIN_INTERVAL),POOLED_CHECKER_CONFIG.MAX_INTERVAL)}
879function applyPooledBackoff(currentMultiplier,factor,maxMultiplier){return Math.min(currentMultiplier*factor,maxMultiplier)}
880function safePooledJSONParse(data){if(typeof window.safeParseJSON==='function'){return window.safeParseJSON(data)}
881try{if(typeof data==='object'&&data!==null){return data}
882if(typeof data==='string'){return JSON.parse(data)}
883console.error('Unexpected data type for pooled JSON response:',typeof data,data);return null}catch(e){console.error('Failed to parse pooled JSON response:',e,'Data:',data);return null}}
884function registerPooledCheck(checkType,checkData,callback){var checkId=checkType+'_'+Date.now()+'_'+(++pooledCheckerState.nextCheckId);pooledCheckerState.pendingChecks[checkId]={type:checkType,data:checkData,callback:callback,timestamp:Date.now()};if(pooledCheckerState.timeout===0){schedulePooledRequest()}}
885function schedulePooledRequest(){var now=Date.now();var timeSinceLastRequest=now-pooledCheckerState.lastRequestTime;var minInterval=POOLED_CHECKER_CONFIG.MIN_INTERVAL;if(timeSinceLastRequest<minInterval){pooledCheckerState.timeout=setTimeout(executePooledRequest,minInterval-timeSinceLastRequest)}else{executePooledRequest()}}
886function executePooledRequest(){var pendingCheckKeys=Object.keys(pooledCheckerState.pendingChecks);if(pendingCheckKeys.length===0){pooledCheckerState.timeout=0;return}
887var checks={};var callbacks={};var batchCount=0;for(var i=0;i<pendingCheckKeys.length;i++){if(batchCount>=POOLED_CHECKER_CONFIG.BATCH_SIZE)break;var checkId=pendingCheckKeys[i];var check=pooledCheckerState.pendingChecks[checkId];checks[check.type]=check.data;callbacks[checkId]=check.callback;delete pooledCheckerState.pendingChecks[checkId];batchCount++}
888pooledCheckerState.timeout=0;pooledCheckerState.lastRequestTime=Date.now();var requestData={checks:JSON.stringify(checks),BrukerID:window.BrukerID||0,CallNumber:++pooledCheckerState.callNumber};$.post('/webdesk/ajax/ajax_pooled_checker.php',requestData).done(function(response){var responseData=response;if(!responseData||typeof responseData!=='object'){console.error('Invalid response data:',responseData);return}
889if(responseData.status==='backoff'&&responseData.backoff>0){pooledCheckerState.backoffMultiplier=applyPooledBackoff(pooledCheckerState.backoffMultiplier,1.5,POOLED_CHECKER_CONFIG.SERVER_BACKOFF_LIMIT);console.log("Pooled checker server backoff:",responseData.backoff)}else if(responseData.status==='ok'){pooledCheckerState.backoffMultiplier=1;for(var checkId in callbacks){if(callbacks.hasOwnProperty(checkId)){var callback=callbacks[checkId];var checkTypeParts=checkId.split('_');var checkType=checkTypeParts[0];var resultKey=checkType;if(checkType==='edit'){resultKey='edit_status'}else if(checkType==='newslist'){resultKey='newslist_change'}
890var result=responseData.data?responseData.data[resultKey]:null;if(result&&callback){callback(result)}}}}}).fail(function(xhr,status,error){pooledCheckerState.backoffMultiplier=applyPooledBackoff(pooledCheckerState.backoffMultiplier,2,POOLED_CHECKER_CONFIG.MAX_BACKOFF_MULTIPLIER);console.warn("Pooled checker AJAX failed:",status)});var remainingChecks=Object.keys(pooledCheckerState.pendingChecks).length;if(remainingChecks>0){var timeout=calculatePooledTimeout(window.newsCheckFreq||2,window.newsCheckFreqSlow||5,pooledCheckerState.backoffMultiplier);pooledCheckerState.timeout=setTimeout(schedulePooledRequest,timeout)}}
891function checkNewslistChangePooled(BrukerID,callback){registerPooledCheck('newslist_change',{},function(result){if(callback)callback(result);})}
892function checkEditStatusPooled(NyhetIDs,Type,callback){registerPooledCheck('edit_status',{NyhetIDs:NyhetIDs,Type:Type},function(result){if(callback)callback(result);})}
893function checkReorderStatusPooled(type,action,callback){registerPooledCheck('reorder_check',{type:type,action:action},function(result){if(callback)callback(result);})}
894$(document).ready(function(){})

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