var post_id=0,post_rating=0,is_being_rated=!1;ratingsL10n.custom=parseInt(ratingsL10n.custom);ratingsL10n.max=parseInt(ratingsL10n.max);ratingsL10n.show_loading=parseInt(ratingsL10n.show_loading);ratingsL10n.show_fading=parseInt(ratingsL10n.show_fading);
function current_rating(a,b,c){if(!is_being_rated){post_id=a;post_rating=b;if(ratingsL10n.custom&&2==ratingsL10n.max)jQuery("#rating_"+post_id+"_"+b).attr("src",eval("ratings_"+b+"_mouseover_image.src"));else for(i=1;i<=b;i++)ratingsL10n.custom?jQuery("#rating_"+post_id+"_"+i).attr("src",eval("ratings_"+i+"_mouseover_image.src")):jQuery("#rating_"+post_id+"_"+i).attr("src",ratings_mouseover_image.src);jQuery("#ratings_"+post_id+"_text").length&&(jQuery("#ratings_"+post_id+"_text").show(),jQuery("#ratings_"+
post_id+"_text").html(c))}}
function ratings_off(a,b,c){if(!is_being_rated){for(i=1;i<=ratingsL10n.max;i++)i<=a?ratingsL10n.custom?jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_"+i+"_on."+ratingsL10n.image_ext):jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_on."+ratingsL10n.image_ext):i==b?ratingsL10n.custom?jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_"+
i+"_half"+(c?"-rtl":"")+"."+ratingsL10n.image_ext):jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_half"+(c?"-rtl":"")+"."+ratingsL10n.image_ext):ratingsL10n.custom?jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_"+i+"_off."+ratingsL10n.image_ext):jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_off."+ratingsL10n.image_ext);jQuery("#ratings_"+
post_id+"_text").length&&(jQuery("#ratings_"+post_id+"_text").hide(),jQuery("#ratings_"+post_id+"_text").empty())}}function set_is_being_rated(a){is_being_rated=a}function rate_post_success(a){jQuery("#post-ratings-"+post_id).html(a);ratingsL10n.show_loading&&jQuery("#post-ratings-"+post_id+"-loading").hide();ratingsL10n.show_fading?jQuery("#post-ratings-"+post_id).fadeTo("def",1,function(){set_is_being_rated(!1)}):set_is_being_rated(!1)}
function rate_post(){post_ratings_el=jQuery("#post-ratings-"+post_id);if(is_being_rated)alert(ratingsL10n.text_wait);else{post_ratings_nonce=jQuery(post_ratings_el).data("nonce");if("undefined"==typeof post_ratings_nonce||null==post_ratings_nonce)post_ratings_nonce=jQuery(post_ratings_el).attr("data-nonce");set_is_being_rated(!0);ratingsL10n.show_fading?jQuery(post_ratings_el).fadeTo("def",0,function(){ratingsL10n.show_loading&&jQuery("#post-ratings-"+post_id+"-loading").show();jQuery.ajax({type:"POST",
xhrFields:{withCredentials:!0},dataType:"html",url:ratingsL10n.ajax_url,data:"action=postratings&pid="+post_id+"&rate="+post_rating+"&postratings_"+post_id+"_nonce="+post_ratings_nonce,cache:!1,success:rate_post_success})}):(ratingsL10n.show_loading&&jQuery("#post-ratings-"+post_id+"-loading").show(),jQuery.ajax({type:"POST",xhrFields:{withCredentials:!0},dataType:"html",url:ratingsL10n.ajax_url,data:"action=postratings&pid="+post_id+"&rate="+post_rating+"&postratings_"+post_id+"_nonce="+post_ratings_nonce,
cache:!1,success:rate_post_success}))}};
!function(){var t=jQuery;t(window).on("load",function(){var o,n,e,a,i,l,s,r,c;(o=wpfront_scroll_top_data.data).data.hide_iframe&&t(window).attr("self")!==t(window).attr("top")||(null!==o.css&&t("<style>").text(o.css).appendTo("head"),t("body").append(o.html),n=o.data,e=t("#wpfront-scroll-top-container"),a=!1,i=0,l=function(){clearTimeout(i),e.is(":visible")&&e.stop().fadeTo(n.button_fade_duration,0,function(){e.removeClass("show"),a=!1})},s=function(){n.auto_hide&&(clearTimeout(i),i=setTimeout(function(){l()},1e3*n.auto_hide_after))},r=!1,c=function(){r||(r=!0,t(window).scrollTop()>n.scroll_offset?(e.stop().css("opacity",a?1:n.button_opacity).addClass("show"),a||s()):l(),r=!1)},t(window).on("scroll",c),c(),e.on("mouseenter",function(){clearTimeout(i),a=!0,t(this).css("opacity",1)}).on("mouseleave",function(){t(this).css("opacity",n.button_opacity),a=!1,s()}).on("click",function(o){if("url"===n.button_action)return!0;if("element"===n.button_action){o.preventDefault();var e=t(n.button_action_element_selector).first(),a=t(n.button_action_container_selector),i=e.offset();if(null==i)return!1;var l=a.last().offset();if(null==l)return!1;n.button_action_element_offset=parseInt(n.button_action_element_offset),isNaN(n.button_action_element_offset)&&(n.button_action_element_offset=0);var s=i.top-l.top-n.button_action_element_offset;return a.animate({scrollTop:s},n.scroll_duration),!1}return o.preventDefault(),t("html, body").animate({scrollTop:0},n.scroll_duration),!1}))})}();
!function(m,y,e,o){var p="lazyLoadXT",w="lazied",z="load error",t="lazy-hidden",C=e.documentElement||e.body,b={autoInit:!0,selector:"img[data-src]",blankImage:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",throttle:99,forceLoad:y.onscroll===o||!!y.operamini||!C.getBoundingClientRect,loadEvent:"pageshow",updateEvent:"load orientationchange resize scroll touchmove focus",forceEvent:"lazyloadall",oninit:{removeClass:"lazy"},onshow:{addClass:t},onload:{removeClass:t,addClass:"lazy-loaded"},onerror:{removeClass:t},checkDuplicates:!0},n={srcAttr:"data-src",edgeX:0,edgeY:0,visibleOnly:!0},a=m(y),d=m.extend,E=m.data||function(e,t){return m(e).data(t)},T=[],L=0,r=0;function c(e,t){return e[t]===o?b[t]:e[t]}function I(){var e=y.pageYOffset;return e===o?C.scrollTop:e}function X(e,t){var o=b["on"+e];o&&("function"==typeof o?o.call(t[0]):(o.addClass&&t.addClass(o.addClass),o.removeClass&&t.removeClass(o.removeClass))),t.trigger("lazy"+e,[t]),u()}function B(e){X(e.type,m(this).off(z,B))}function i(e){if(T.length){e=e||b.forceLoad,L=1/0;for(var t=I(),o=y.innerHeight||C.clientHeight,n=y.innerWidth||C.clientWidth,a=0,r=T.length;a<r;a++){var i,l,s,d,c,u,f=T[a],h=f[0],v=f[p],A=!1,g=e||E(h,w)<0;m.contains(C,h)?(e||!v.visibleOnly||h.offsetWidth||h.offsetHeight)&&(g||(i=h.getBoundingClientRect(),l=v.edgeX,s=v.edgeY,g=(d=i.top+t-s-o)<=t&&i.bottom>-s&&i.left<=n+l&&i.right>-l),g?(f.on(z,B),X("show",f),(u="function"==typeof(c=v.srcAttr)?c(f):h.getAttribute(c))&&(h.src=u),A=!0):d<L&&(L=d)):A=!0,A&&(T.splice(a--,1),r--)}r||X("complete",m(C))}}function l(){1<r?(r=1,i(),setTimeout(l,b.throttle)):r=0}function u(e){T.length&&(e&&"scroll"===e.type&&e.currentTarget===y&&L>=I()||(r||setTimeout(l,0),r=2))}function s(){a.lazyLoadXT()}function f(){i(!0)}m[p]=d(b,n,m[p]),m.fn[p]=function(a){var e,r=c(a=a||{},"blankImage"),i=c(a,"checkDuplicates"),t=c(a,"scrollContainer"),l=c(a,"show"),s={};for(e in m(t).on("scroll",u),n)s[e]=c(a,e);return this.each(function(e,t){if(t===y)m(b.selector).lazyLoadXT(a);else{var o=i&&E(t,w),n=m(t).data(w,l?-1:1);if(o)return void u();r&&"IMG"===t.tagName&&!t.src&&(t.src=r),n[p]=d({},s),X("init",n),T.push(n),u()}})},m(e).ready(function(){X("start",a),a.on(b.updateEvent,u).on(b.forceEvent,f),m(e).on(b.updateEvent,u),b.autoInit&&(a.on(b.loadEvent,s),s())})}(window.jQuery||window.Zepto||window.$,window,document),function(l){var o=l.lazyLoadXT;o.selector+=",video,iframe[data-src],embed[data-src]",o.videoPoster="data-poster",l(document).on("lazyshow","video",function(e,t){var a=t.lazyLoadXT.srcAttr,r="function"==typeof a,i=!1;t.attr("poster",t.attr(o.videoPoster)),t.children("source,track").each(function(e,t){var o=l(t),n=r?a(o):o.attr(a);n&&(o.attr("src",n),i=!0)}),i&&void 0!==l(this).attr("preload")&&"none"!=l(this).attr("preload")&&this.load(),l(this).removeClass("lazy-hidden")}),l(document).on("lazyshow","embed",function(e,t){l(this).removeClass("lazy-hidden")})}(window.jQuery||window.Zepto||window.$);
!function(t,r,e,s){var n,a,c=t.lazyLoadXT,i="srcset"in new Image,o=/^\s*(\S*)/,d=/\S\s+(\d+)w/,u=/\S\s+(\d+)h/,l=/\S\s+([\d\.]+)x/,x=[0,1/0],w=[0,1],h={srcsetAttr:"data-srcset",srcsetExtended:!0,srcsetBaseAttr:"data-srcset-base",srcsetExtAttr:"data-srcset-ext"},f={w:0,h:0,x:0};for(n in h)void 0===c[n]&&(c[n]=h[n]);function p(r,e){return Math[e].apply(null,t.map(r,function(t){return t[n]}))}function A(t){return t[n]>=f[n]||t[n]===a}function m(t){return t[n]===a}function g(s){var i=s.attr(c.srcsetAttr);if(!i)return!1;var h=t.map(i.replace(/(\s[\d.]+[whx]),/g,"$1 @,@ ").split(" @,@ "),function(t){return{url:o.exec(t)[1],w:parseFloat((d.exec(t)||x)[1]),h:parseFloat((u.exec(t)||x)[1]),x:parseFloat((l.exec(t)||w)[1])}});if(!h.length)return!1;var g,v,y=e.documentElement;for(g in f={w:r.innerWidth||y.clientWidth,h:r.innerHeight||y.clientHeight,x:r.devicePixelRatio||1})n=g,a=p(h,"max"),h=t.grep(h,A);for(g in f)n=g,a=p(h,"min"),h=t.grep(h,m);return v=h[0].url,c.srcsetExtended&&(v=(s.attr(c.srcsetBaseAttr)||"")+v+(s.attr(c.srcsetExtAttr)||"")),v}c.selector+=",img["+c.srcsetAttr+"],source["+c.srcsetAttr+"]",t(e).on("lazyshow","img",function(t,r){var e=r.attr(c.srcsetAttr);e&&(!c.srcsetExtended&&i?(r.attr("srcset",e),r.attr("data-srcset","")):r.lazyLoadXT.srcAttr=g)}),t(e).on("lazyshow","source",function(r,e){t(this).removeClass("lazy-hidden");var s=e.attr(c.srcsetAttr);s&&(!c.srcsetExtended&&i?(e.attr("srcset",s),e.attr("data-srcset","")):e.lazyLoadXT.srcAttr=g)})}(window.jQuery||window.Zepto||window.$,window,document);
jQuery.lazyLoadXT.updateEvent='load orientationchange resize scroll touchmove focus click customlazyloadxtevent';
jQuery.lazyLoadXT.edgeY=a3_lazyload_extend_params.edgeY;
jQuery.lazyLoadXT.srcsetExtended=false;
if(typeof a3_lazyload_extend_params.horizontal_container_classnames!=='undefined'&&''!==a3_lazyload_extend_params.horizontal_container_classnames){
jQuery.lazyLoadXT.scrollContainer=a3_lazyload_extend_params.horizontal_container_classnames;
}
jQuery(document).ready(function($){
jQuery(document).on('mouseenter', '.site-header-cart', function(){
jQuery(document).trigger('customlazyloadxtevent');
});
jQuery(document).on('mouseenter', '.widget_shopping_cart', function(){
jQuery(document).trigger('customlazyloadxtevent');
});
jQuery(document).on('mouseover', '#wp-admin-bar-top-secondary', function(){
jQuery(document).trigger('customlazyloadxtevent');
});
});
jQuery(document).ajaxComplete(function(){
setTimeout(function(){
jQuery(window).lazyLoadXT();
}, 1000);
});
(function($){$.fn.touchwipe=function(settings){var config={min_move_x:20,min_move_y:20,wipeLeft:function(){},wipeRight:function(){},wipeUp:function(){},wipeDown:function(){},preventDefaultEvents:true};if(settings)$.extend(config,settings);this.each(function(){var startX;var startY;var isMoving=false;function cancelTouch(){this.removeEventListener('touchmove',onTouchMove);startX=null;isMoving=false}function onTouchMove(e){if(config.preventDefaultEvents){e.preventDefault()}if(isMoving){var x=e.touches[0].pageX;var y=e.touches[0].pageY;var dx=startX-x;var dy=startY-y;if(Math.abs(dx)>=config.min_move_x){cancelTouch();if(dx>0){config.wipeLeft()}else{config.wipeRight()}}else if(Math.abs(dy)>=config.min_move_y){cancelTouch();if(dy>0){config.wipeDown()}else{config.wipeUp()}}}}function onTouchStart(e){if(e.touches.length==1){startX=e.touches[0].pageX;startY=e.touches[0].pageY;isMoving=true;this.addEventListener('touchmove',onTouchMove,false)}}if('ontouchstart'in document.documentElement){this.addEventListener('touchstart',onTouchStart,false)}});return this}})(jQuery);
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DOMPurify=t()}(this,(function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:o,getOwnPropertyDescriptor:r}=Object;let{freeze:i,seal:a,create:l}=Object,{apply:c,construct:s}="undefined"!=typeof Reflect&&Reflect;i||(i=function(e){return e}),a||(a=function(e){return e}),c||(c=function(e,t,n){return e.apply(t,n)}),s||(s=function(e,t){return new e(...t)});const u=R(Array.prototype.forEach),m=R(Array.prototype.lastIndexOf),p=R(Array.prototype.pop),f=R(Array.prototype.push),d=R(Array.prototype.splice),h=R(String.prototype.toLowerCase),g=R(String.prototype.toString),T=R(String.prototype.match),y=R(String.prototype.replace),E=R(String.prototype.indexOf),A=R(String.prototype.trim),_=R(Object.prototype.hasOwnProperty),S=R(RegExp.prototype.test),b=(N=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(N,t)});var N;function R(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return c(e,t,o)}}function w(e,o){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;t&&t(e,null);let i=o.length;for(;i--;){let t=o[i];if("string"==typeof t){const e=r(t);e!==t&&(n(o)||(o[i]=e),t=e)}e[t]=!0}return e}function O(e){for(let t=0;t<e.length;t++){_(e,t)||(e[t]=null)}return e}function D(t){const n=l(null);for(const[o,r]of e(t)){_(t,o)&&(Array.isArray(r)?n[o]=O(r):r&&"object"==typeof r&&r.constructor===Object?n[o]=D(r):n[o]=r)}return n}function v(e,t){for(;null!==e;){const n=r(e,t);if(n){if(n.get)return R(n.get);if("function"==typeof n.value)return R(n.value)}e=o(e)}return function(){return null}}const L=i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),C=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),x=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I=i(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),M=i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),k=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),U=i(["#text"]),z=i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),P=i(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),H=i(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),F=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),W=a(/<%[\w\W]*|[\w\W]*%>/gm),G=a(/\$\{[\w\W]*/gm),Y=a(/^data-[\-\w.\u00B7-\uFFFF]+$/),j=a(/^aria-[\-\w]+$/),X=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),q=a(/^(?:\w+script|data):/i),$=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=a(/^html$/i),V=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var Z=Object.freeze({__proto__:null,ARIA_ATTR:j,ATTR_WHITESPACE:$,CUSTOM_ELEMENT:V,DATA_ATTR:Y,DOCTYPE_NAME:K,ERB_EXPR:W,IS_ALLOWED_URI:X,IS_SCRIPT_OR_DATA:q,MUSTACHE_EXPR:B,TMPLIT_EXPR:G});const J=1,Q=3,ee=7,te=8,ne=9,oe=function(){return"undefined"==typeof window?null:window};var re=function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oe();const o=e=>t(e);if(o.version="3.2.5",o.removed=[],!n||!n.document||n.document.nodeType!==ne||!n.Element)return o.isSupported=!1,o;let{document:r}=n;const a=r,c=a.currentScript,{DocumentFragment:s,HTMLTemplateElement:N,Node:R,Element:O,NodeFilter:B,NamedNodeMap:W=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:G,DOMParser:Y,trustedTypes:j}=n,q=O.prototype,$=v(q,"cloneNode"),V=v(q,"remove"),re=v(q,"nextSibling"),ie=v(q,"childNodes"),ae=v(q,"parentNode");if("function"==typeof N){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let le,ce="";const{implementation:se,createNodeIterator:ue,createDocumentFragment:me,getElementsByTagName:pe}=r,{importNode:fe}=a;let de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};o.isSupported="function"==typeof e&&"function"==typeof ae&&se&&void 0!==se.createHTMLDocument;const{MUSTACHE_EXPR:he,ERB_EXPR:ge,TMPLIT_EXPR:Te,DATA_ATTR:ye,ARIA_ATTR:Ee,IS_SCRIPT_OR_DATA:Ae,ATTR_WHITESPACE:_e,CUSTOM_ELEMENT:Se}=Z;let{IS_ALLOWED_URI:be}=Z,Ne=null;const Re=w({},[...L,...C,...x,...M,...U]);let we=null;const Oe=w({},[...z,...P,...H,...F]);let De=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ve=null,Le=null,Ce=!0,xe=!0,Ie=!1,Me=!0,ke=!1,Ue=!0,ze=!1,Pe=!1,He=!1,Fe=!1,Be=!1,We=!1,Ge=!0,Ye=!1,je=!0,Xe=!1,qe={},$e=null;const Ke=w({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ve=null;const Ze=w({},["audio","video","img","source","image","track"]);let Je=null;const Qe=w({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml";let ot=nt,rt=!1,it=null;const at=w({},[et,tt,nt],g);let lt=w({},["mi","mo","mn","ms","mtext"]),ct=w({},["annotation-xml"]);const st=w({},["title","style","font","a","script"]);let ut=null;const mt=["application/xhtml+xml","text/html"];let pt=null,ft=null;const dt=r.createElement("form"),ht=function(e){return e instanceof RegExp||e instanceof Function},gt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ft||ft!==e){if(e&&"object"==typeof e||(e={}),e=D(e),ut=-1===mt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,pt="application/xhtml+xml"===ut?g:h,Ne=_(e,"ALLOWED_TAGS")?w({},e.ALLOWED_TAGS,pt):Re,we=_(e,"ALLOWED_ATTR")?w({},e.ALLOWED_ATTR,pt):Oe,it=_(e,"ALLOWED_NAMESPACES")?w({},e.ALLOWED_NAMESPACES,g):at,Je=_(e,"ADD_URI_SAFE_ATTR")?w(D(Qe),e.ADD_URI_SAFE_ATTR,pt):Qe,Ve=_(e,"ADD_DATA_URI_TAGS")?w(D(Ze),e.ADD_DATA_URI_TAGS,pt):Ze,$e=_(e,"FORBID_CONTENTS")?w({},e.FORBID_CONTENTS,pt):Ke,ve=_(e,"FORBID_TAGS")?w({},e.FORBID_TAGS,pt):{},Le=_(e,"FORBID_ATTR")?w({},e.FORBID_ATTR,pt):{},qe=!!_(e,"USE_PROFILES")&&e.USE_PROFILES,Ce=!1!==e.ALLOW_ARIA_ATTR,xe=!1!==e.ALLOW_DATA_ATTR,Ie=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Me=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,ke=e.SAFE_FOR_TEMPLATES||!1,Ue=!1!==e.SAFE_FOR_XML,ze=e.WHOLE_DOCUMENT||!1,Fe=e.RETURN_DOM||!1,Be=e.RETURN_DOM_FRAGMENT||!1,We=e.RETURN_TRUSTED_TYPE||!1,He=e.FORCE_BODY||!1,Ge=!1!==e.SANITIZE_DOM,Ye=e.SANITIZE_NAMED_PROPS||!1,je=!1!==e.KEEP_CONTENT,Xe=e.IN_PLACE||!1,be=e.ALLOWED_URI_REGEXP||X,ot=e.NAMESPACE||nt,lt=e.MATHML_TEXT_INTEGRATION_POINTS||lt,ct=e.HTML_INTEGRATION_POINTS||ct,De=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(De.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(De.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(De.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ke&&(xe=!1),Be&&(Fe=!0),qe&&(Ne=w({},U),we=[],!0===qe.html&&(w(Ne,L),w(we,z)),!0===qe.svg&&(w(Ne,C),w(we,P),w(we,F)),!0===qe.svgFilters&&(w(Ne,x),w(we,P),w(we,F)),!0===qe.mathMl&&(w(Ne,M),w(we,H),w(we,F))),e.ADD_TAGS&&(Ne===Re&&(Ne=D(Ne)),w(Ne,e.ADD_TAGS,pt)),e.ADD_ATTR&&(we===Oe&&(we=D(we)),w(we,e.ADD_ATTR,pt)),e.ADD_URI_SAFE_ATTR&&w(Je,e.ADD_URI_SAFE_ATTR,pt),e.FORBID_CONTENTS&&($e===Ke&&($e=D($e)),w($e,e.FORBID_CONTENTS,pt)),je&&(Ne["#text"]=!0),ze&&w(Ne,["html","head","body"]),Ne.table&&(w(Ne,["tbody"]),delete ve.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');le=e.TRUSTED_TYPES_POLICY,ce=le.createHTML("")}else void 0===le&&(le=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(j,c)),null!==le&&"string"==typeof ce&&(ce=le.createHTML(""));i&&i(e),ft=e}},Tt=w({},[...C,...x,...I]),yt=w({},[...M,...k]),Et=function(e){f(o.removed,{element:e});try{ae(e).removeChild(e)}catch(t){V(e)}},At=function(e,t){try{f(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){f(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Fe||Be)try{Et(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},_t=function(e){let t=null,n=null;if(He)e="<remove></remove>"+e;else{const t=T(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ut&&ot===nt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=le?le.createHTML(e):e;if(ot===nt)try{t=(new Y).parseFromString(o,ut)}catch(e){}if(!t||!t.documentElement){t=se.createDocument(ot,"template",null);try{t.documentElement.innerHTML=rt?ce:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),ot===nt?pe.call(t,ze?"html":"body")[0]:ze?t.documentElement:i},St=function(e){return ue.call(e.ownerDocument||e,e,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT|B.SHOW_PROCESSING_INSTRUCTION|B.SHOW_CDATA_SECTION,null)},bt=function(e){return e instanceof G&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof W)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Nt=function(e){return"function"==typeof R&&e instanceof R};function Rt(e,t,n){u(e,(e=>{e.call(o,t,n,ft)}))}const wt=function(e){let t=null;if(Rt(de.beforeSanitizeElements,e,null),bt(e))return Et(e),!0;const n=pt(e.nodeName);if(Rt(de.uponSanitizeElement,e,{tagName:n,allowedTags:Ne}),e.hasChildNodes()&&!Nt(e.firstElementChild)&&S(/<[/\w!]/g,e.innerHTML)&&S(/<[/\w!]/g,e.textContent))return Et(e),!0;if(e.nodeType===ee)return Et(e),!0;if(Ue&&e.nodeType===te&&S(/<[/\w]/g,e.data))return Et(e),!0;if(!Ne[n]||ve[n]){if(!ve[n]&&Dt(n)){if(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,n))return!1;if(De.tagNameCheck instanceof Function&&De.tagNameCheck(n))return!1}if(je&&!$e[n]){const t=ae(e)||e.parentNode,n=ie(e)||e.childNodes;if(n&&t){for(let o=n.length-1;o>=0;--o){const r=$(n[o],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,re(e))}}}return Et(e),!0}return e instanceof O&&!function(e){let t=ae(e);t&&t.tagName||(t={namespaceURI:ot,tagName:"template"});const n=h(e.tagName),o=h(t.tagName);return!!it[e.namespaceURI]&&(e.namespaceURI===tt?t.namespaceURI===nt?"svg"===n:t.namespaceURI===et?"svg"===n&&("annotation-xml"===o||lt[o]):Boolean(Tt[n]):e.namespaceURI===et?t.namespaceURI===nt?"math"===n:t.namespaceURI===tt?"math"===n&&ct[o]:Boolean(yt[n]):e.namespaceURI===nt?!(t.namespaceURI===tt&&!ct[o])&&!(t.namespaceURI===et&&!lt[o])&&!yt[n]&&(st[n]||!Tt[n]):!("application/xhtml+xml"!==ut||!it[e.namespaceURI]))}(e)?(Et(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!S(/<\/no(script|embed|frames)/i,e.innerHTML)?(ke&&e.nodeType===Q&&(t=e.textContent,u([he,ge,Te],(e=>{t=y(t,e," ")})),e.textContent!==t&&(f(o.removed,{element:e.cloneNode()}),e.textContent=t)),Rt(de.afterSanitizeElements,e,null),!1):(Et(e),!0)},Ot=function(e,t,n){if(Ge&&("id"===t||"name"===t)&&(n in r||n in dt))return!1;if(xe&&!Le[t]&&S(ye,t));else if(Ce&&S(Ee,t));else if(!we[t]||Le[t]){if(!(Dt(e)&&(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,e)||De.tagNameCheck instanceof Function&&De.tagNameCheck(e))&&(De.attributeNameCheck instanceof RegExp&&S(De.attributeNameCheck,t)||De.attributeNameCheck instanceof Function&&De.attributeNameCheck(t))||"is"===t&&De.allowCustomizedBuiltInElements&&(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,n)||De.tagNameCheck instanceof Function&&De.tagNameCheck(n))))return!1}else if(Je[t]);else if(S(be,y(n,_e,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==E(n,"data:")||!Ve[e]){if(Ie&&!S(Ae,y(n,_e,"")));else if(n)return!1}else;return!0},Dt=function(e){return"annotation-xml"!==e&&T(e,Se)},vt=function(e){Rt(de.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||bt(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:we,forceKeepAttr:void 0};let r=t.length;for(;r--;){const i=t[r],{name:a,namespaceURI:l,value:c}=i,s=pt(a),m=c;let f="value"===a?m:A(m);if(n.attrName=s,n.attrValue=f,n.keepAttr=!0,n.forceKeepAttr=void 0,Rt(de.uponSanitizeAttribute,e,n),f=n.attrValue,!Ye||"id"!==s&&"name"!==s||(At(a,e),f="user-content-"+f),Ue&&S(/((--!?|])>)|<\/(style|title)/i,f)){At(a,e);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){At(a,e);continue}if(!Me&&S(/\/>/i,f)){At(a,e);continue}ke&&u([he,ge,Te],(e=>{f=y(f,e," ")}));const d=pt(e.nodeName);if(Ot(d,s,f)){if(le&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(l);else switch(j.getAttributeType(d,s)){case"TrustedHTML":f=le.createHTML(f);break;case"TrustedScriptURL":f=le.createScriptURL(f)}if(f!==m)try{l?e.setAttributeNS(l,a,f):e.setAttribute(a,f),bt(e)?Et(e):p(o.removed)}catch(t){At(a,e)}}else At(a,e)}Rt(de.afterSanitizeAttributes,e,null)},Lt=function e(t){let n=null;const o=St(t);for(Rt(de.beforeSanitizeShadowDOM,t,null);n=o.nextNode();)Rt(de.uponSanitizeShadowNode,n,null),wt(n),vt(n),n.content instanceof s&&e(n.content);Rt(de.afterSanitizeShadowDOM,t,null)};return o.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=null,i=null,l=null;if(rt=!e,rt&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Nt(e)){if("function"!=typeof e.toString)throw b("toString is not a function");if("string"!=typeof(e=e.toString()))throw b("dirty is not a string, aborting")}if(!o.isSupported)return e;if(Pe||gt(t),o.removed=[],"string"==typeof e&&(Xe=!1),Xe){if(e.nodeName){const t=pt(e.nodeName);if(!Ne[t]||ve[t])throw b("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof R)n=_t("\x3c!----\x3e"),r=n.ownerDocument.importNode(e,!0),r.nodeType===J&&"BODY"===r.nodeName||"HTML"===r.nodeName?n=r:n.appendChild(r);else{if(!Fe&&!ke&&!ze&&-1===e.indexOf("<"))return le&&We?le.createHTML(e):e;if(n=_t(e),!n)return Fe?null:We?ce:""}n&&He&&Et(n.firstChild);const c=St(Xe?e:n);for(;i=c.nextNode();)wt(i),vt(i),i.content instanceof s&&Lt(i.content);if(Xe)return e;if(Fe){if(Be)for(l=me.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(we.shadowroot||we.shadowrootmode)&&(l=fe.call(a,l,!0)),l}let m=ze?n.outerHTML:n.innerHTML;return ze&&Ne["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&S(K,n.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+m),ke&&u([he,ge,Te],(e=>{m=y(m,e," ")})),le&&We?le.createHTML(m):m},o.setConfig=function(){gt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Pe=!0},o.clearConfig=function(){ft=null,Pe=!1},o.isValidAttribute=function(e,t,n){ft||gt({});const o=pt(e),r=pt(t);return Ot(o,r,n)},o.addHook=function(e,t){"function"==typeof t&&f(de[e],t)},o.removeHook=function(e,t){if(void 0!==t){const n=m(de[e],t);return-1===n?void 0:d(de[e],n,1)[0]}return p(de[e])},o.removeHooks=function(e){de[e]=[]},o.removeAllHooks=function(){de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},o}();return re}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Panzoom=e()}(this,function(){"use strict";var Y=function(){return(Y=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function C(t,e){for(var n=t.length;n--;)if(t[n].pointerId===e.pointerId)return n;return-1}function T(t,e){if(e.touches)for(var n=0,o=0,r=e.touches;o<r.length;o++){var a=r[o];a.pointerId=n++,T(t,a)}else-1<(n=C(t,e))&&t.splice(n,1),t.push(e)}function N(t){for(var e,n=(t=t.slice(0)).pop();e=t.pop();)n={clientX:(e.clientX-n.clientX)/2+n.clientX,clientY:(e.clientY-n.clientY)/2+n.clientY};return n}function L(t){var e;return t.length<2?0:(e=t[0],t=t[1],Math.sqrt(Math.pow(Math.abs(t.clientX-e.clientX),2)+Math.pow(Math.abs(t.clientY-e.clientY),2)))}"undefined"!=typeof window&&(window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(t,e){e=e||{bubbles:!1,cancelable:!1,detail:null};var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}));var V={down:"mousedown",move:"mousemove",up:"mouseup mouseleave"};function D(t,e,n,o){V[t].split(" ").forEach(function(t){e.addEventListener(t,n,o)})}function G(t,e,n){V[t].split(" ").forEach(function(t){e.removeEventListener(t,n)})}"undefined"!=typeof window&&("function"==typeof window.PointerEvent?V={down:"pointerdown",move:"pointermove",up:"pointerup pointerleave pointercancel"}:"function"==typeof window.TouchEvent&&(V={down:"touchstart",move:"touchmove",up:"touchend touchcancel"}));var a,i="undefined"!=typeof document&&!!document.documentMode;var c=["webkit","moz","ms"],l={};function I(t){if(l[t])return l[t];var e=a=a||document.createElement("div").style;if(t in e)return l[t]=t;for(var n=t[0].toUpperCase()+t.slice(1),o=c.length;o--;){var r="".concat(c[o]).concat(n);if(r in e)return l[t]=r}}function o(t,e){return parseFloat(e[I(t)])||0}function s(t,e,n){void 0===n&&(n=window.getComputedStyle(t));t="border"===e?"Width":"";return{left:o("".concat(e,"Left").concat(t),n),right:o("".concat(e,"Right").concat(t),n),top:o("".concat(e,"Top").concat(t),n),bottom:o("".concat(e,"Bottom").concat(t),n)}}function W(t,e,n){t.style[I(e)]=n}function Z(t){var e=t.parentNode,n=window.getComputedStyle(t),o=window.getComputedStyle(e),r=t.getBoundingClientRect(),a=e.getBoundingClientRect();return{elem:{style:n,width:r.width,height:r.height,top:r.top,bottom:r.bottom,left:r.left,right:r.right,margin:s(t,"margin",n),border:s(t,"border",n)},parent:{style:o,width:a.width,height:a.height,top:a.top,bottom:a.bottom,left:a.left,right:a.right,padding:s(e,"padding",o),border:s(e,"border",o)}}}var q=/^http:[\w\.\/]+svg$/;var B={animate:!1,canvas:!1,cursor:"move",disablePan:!1,disableZoom:!1,disableXAxis:!1,disableYAxis:!1,duration:200,easing:"ease-in-out",exclude:[],excludeClass:"panzoom-exclude",handleStartEvent:function(t){t.preventDefault(),t.stopPropagation()},maxScale:4,minScale:.125,overflow:"hidden",panOnlyWhenZoomed:!1,pinchAndPan:!1,relative:!1,setTransform:function(t,e,n){var o=e.x,r=e.y,a=e.scale,e=e.isSVG;W(t,"transform","scale(".concat(a,") translate(").concat(o,"px, ").concat(r,"px)")),e&&i&&(a=window.getComputedStyle(t).getPropertyValue("transform"),t.setAttribute("transform",a))},startX:0,startY:0,startScale:1,step:.3,touchAction:"none"};function t(u,f){if(!u)throw new Error("Panzoom requires an element as an argument");if(1!==u.nodeType)throw new Error("Panzoom requires an element with a nodeType of 1");if(e=(t=u).ownerDocument,t=t.parentNode,!(e&&t&&9===e.nodeType&&1===t.nodeType&&e.documentElement.contains(t)))throw new Error("Panzoom should be called on elements that have been attached to the DOM");f=Y(Y({},B),f),e=u;var t,e,l=q.test(e.namespaceURI)&&"svg"!==e.nodeName.toLowerCase(),n=u.parentNode;n.style.overflow=f.overflow,n.style.userSelect="none",n.style.touchAction=f.touchAction,(f.canvas?n:u).style.cursor=f.cursor,u.style.userSelect="none",u.style.touchAction=f.touchAction,W(u,"transformOrigin","string"==typeof f.origin?f.origin:l?"0 0":"50% 50%");var r,a,i,c,s,d,m=0,h=0,v=1,p=!1;function g(t,e,n){n.silent||(n=new CustomEvent(t,{detail:e}),u.dispatchEvent(n))}function y(o,r,t){var a={x:m,y:h,scale:v,isSVG:l,originalEvent:t};return requestAnimationFrame(function(){var t,e,n;"boolean"==typeof r.animate&&(r.animate?(t=u,e=r,n=I("transform"),W(t,"transition","".concat(n," ").concat(e.duration,"ms ").concat(e.easing))):W(u,"transition","none")),r.setTransform(u,a,r),g(o,a,r),g("panzoomchange",a,r)}),a}function w(t,e,n,o){var r,a,i,c,l,s,d,o=Y(Y({},f),o),p={x:m,y:h,opts:o};return!o.force&&(o.disablePan||o.panOnlyWhenZoomed&&v===o.startScale)||(t=parseFloat(t),e=parseFloat(e),o.disableXAxis||(p.x=(o.relative?m:0)+t),o.disableYAxis||(p.y=(o.relative?h:0)+e),o.contain&&(e=((r=(e=(t=Z(u)).elem.width/v)*n)-e)/2,i=((a=(i=t.elem.height/v)*n)-i)/2,"inside"===o.contain?(c=(-t.elem.margin.left-t.parent.padding.left+e)/n,l=(t.parent.width-r-t.parent.padding.left-t.elem.margin.left-t.parent.border.left-t.parent.border.right+e)/n,p.x=Math.max(Math.min(p.x,l),c),s=(-t.elem.margin.top-t.parent.padding.top+i)/n,d=(t.parent.height-a-t.parent.padding.top-t.elem.margin.top-t.parent.border.top-t.parent.border.bottom+i)/n,p.y=Math.max(Math.min(p.y,d),s)):"outside"===o.contain&&(c=(-(r-t.parent.width)-t.parent.padding.left-t.parent.border.left-t.parent.border.right+e)/n,l=(e-t.parent.padding.left)/n,p.x=Math.max(Math.min(p.x,l),c),s=(-(a-t.parent.height)-t.parent.padding.top-t.parent.border.top-t.parent.border.bottom+i)/n,d=(i-t.parent.padding.top)/n,p.y=Math.max(Math.min(p.y,d),s))),o.roundPixels&&(p.x=Math.round(p.x),p.y=Math.round(p.y))),p}function b(t,e){var n,o,r,a,e=Y(Y({},f),e),i={scale:v,opts:e};return!e.force&&e.disableZoom||(n=f.minScale,o=f.maxScale,e.contain&&(a=(e=Z(u)).elem.width/v,r=e.elem.height/v,1<a&&1<r&&(a=(e.parent.width-e.parent.border.left-e.parent.border.right)/a,e=(e.parent.height-e.parent.border.top-e.parent.border.bottom)/r,"inside"===f.contain?o=Math.min(o,a,e):"outside"===f.contain&&(n=Math.max(n,a,e)))),i.scale=Math.min(Math.max(t,n),o)),i}function x(t,e,n,o){t=w(t,e,v,n);return m!==t.x||h!==t.y?(m=t.x,h=t.y,y("panzoompan",t.opts,o)):{x:m,y:h,scale:v,isSVG:l,originalEvent:o}}function E(t,e,n){var o,r,e=b(t,e),a=e.opts;if(a.force||!a.disableZoom)return t=e.scale,e=m,o=h,a.focal&&(e=((r=a.focal).x/t-r.x/v+m*t)/t,o=(r.y/t-r.y/v+h*t)/t),r=w(e,o,t,{relative:!1,force:!0}),m=r.x,h=r.y,v=t,y("panzoomzoom",a,n)}function o(t,e){e=Y(Y(Y({},f),{animate:!0}),e);return E(v*Math.exp((t?1:-1)*e.step),e)}function S(t,e,n,o){var r=Z(u),a=r.parent.width-r.parent.padding.left-r.parent.padding.right-r.parent.border.left-r.parent.border.right,i=r.parent.height-r.parent.padding.top-r.parent.padding.bottom-r.parent.border.top-r.parent.border.bottom,c=e.clientX-r.parent.left-r.parent.padding.left-r.parent.border.left-r.elem.margin.left,e=e.clientY-r.parent.top-r.parent.padding.top-r.parent.border.top-r.elem.margin.top,r=(l||(c-=r.elem.width/v/2,e-=r.elem.height/v/2),{x:c/a*(a*t),y:e/i*(i*t)});return E(t,Y(Y({},n),{animate:!1,focal:r}),o)}E(f.startScale,{animate:!1,force:!0}),setTimeout(function(){x(f.startX,f.startY,{animate:!1,force:!0})});var M=[];function A(t){!function(t,e){for(var n,o,r=t;null!=r;r=r.parentNode)if(n=r,o=e.excludeClass,1===n.nodeType&&-1<" ".concat((n.getAttribute("class")||"").trim()," ").indexOf(" ".concat(o," "))||-1<e.exclude.indexOf(r))return 1}(t.target,f)&&(T(M,t),p=!0,f.handleStartEvent(t),g("panzoomstart",{x:r=m,y:a=h,scale:v,isSVG:l,originalEvent:t},f),t=N(M),i=t.clientX,c=t.clientY,s=v,d=L(M))}function P(t){var e,n,o;p&&void 0!==r&&void 0!==a&&void 0!==i&&void 0!==c&&(T(M,t),e=N(M),n=1<M.length,o=v,n&&(0===d&&(d=L(M)),S(o=b((L(M)-d)*f.step/80+s).scale,e,{animate:!1},t)),n&&!f.pinchAndPan||x(r+(e.clientX-i)/o,a+(e.clientY-c)/o,{animate:!1},t))}function O(t){1===M.length&&g("panzoomend",{x:m,y:h,scale:v,isSVG:l,originalEvent:t},f);var e=M;if(t.touches)for(;e.length;)e.pop();else{t=C(e,t);-1<t&&e.splice(t,1)}p&&(p=!1,r=a=i=c=void 0)}var z=!1;function X(){z||(z=!0,D("down",f.canvas?n:u,A),D("move",document,P,{passive:!0}),D("up",document,O,{passive:!0}))}return f.noBind||X(),{bind:X,destroy:function(){z=!1,G("down",f.canvas?n:u,A),G("move",document,P),G("up",document,O)},eventNames:V,getPan:function(){return{x:m,y:h}},getScale:function(){return v},getOptions:function(){var t,e=f,n={};for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n},handleDown:A,handleMove:P,handleUp:O,pan:x,reset:function(t){var t=Y(Y(Y({},f),{animate:!0,force:!0}),t),e=(v=b(t.startScale,t).scale,w(t.startX,t.startY,v,t));return m=e.x,h=e.y,y("panzoomreset",t)},resetStyle:function(){n.style.overflow="",n.style.userSelect="",n.style.touchAction="",n.style.cursor="",u.style.cursor="",u.style.userSelect="",u.style.touchAction="",W(u,"transformOrigin","")},setOptions:function(t){for(var e in t=void 0===t?{}:t)t.hasOwnProperty(e)&&(f[e]=t[e]);(t.hasOwnProperty("cursor")||t.hasOwnProperty("canvas"))&&(n.style.cursor=u.style.cursor="",(f.canvas?n:u).style.cursor=f.cursor),t.hasOwnProperty("overflow")&&(n.style.overflow=t.overflow),t.hasOwnProperty("touchAction")&&(n.style.touchAction=t.touchAction,u.style.touchAction=t.touchAction)},setStyle:function(t,e){return W(u,t,e)},zoom:E,zoomIn:function(t){return o(!0,t)},zoomOut:function(t){return o(!1,t)},zoomToPoint:S,zoomWithWheel:function(t,e){t.preventDefault();var e=Y(Y(Y({},f),e),{animate:!1}),n=0===t.deltaY&&t.deltaX?t.deltaX:t.deltaY;return S(b(v*Math.exp((n<0?1:-1)*e.step/3),e).scale,t,e,t)}}}return t.defaultOptions=B,t});
(function($){
function versionCompare(a, b){
var i, l, d;
a=a.split('.');
b=b.split('.');
l=Math.min(a.length, b.length);
for (i=0; i<l; i++){
d=parseInt(a[i], 10) - parseInt(b[i], 10);
if(d!==0){
return d;
}}
return a.length - b.length;
}
$.fn.lightbox=function(options){
var opts=$.extend({}, $.fn.lightbox.defaults, options);
if($("#overlay").is(':visible')){
$(window).trigger('resize');
}
function onClick(){
initialize();
start(this);
return false;
}
if(versionCompare($.fn.jquery, '1.7') > 0){
return $(this).on("click", onClick);
}else{
return $(this).live("click", onClick);
}
function initialize(){
$(window).on('orientationchange', resizeListener);
$(window).on('resize', resizeListener);
$('#overlay').remove();
$('#lightbox').remove();
opts.inprogress=false;
opts.auto=-1;
var txt=opts.strings;
var arrowLeft='<svg id="prevArrow" width="60px" height="60px" viewBox="-5.5 0 26 26" xmlns="http://www.w3.org/2000/svg"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g transform="translate(-423.000000, -1196.000000)" fill="currentColor"><path d="M428.115,1209 L437.371,1200.6 C438.202,1199.77 438.202,1198.43 437.371,1197.6 C436.541,1196.76 435.194,1196.76 434.363,1197.6 L423.596,1207.36 C423.146,1207.81 422.948,1208.41 422.985,1209 C422.948,1209.59 423.146,1210.19 423.596,1210.64 L434.363,1220.4 C435.194,1221.24 436.541,1221.24 437.371,1220.4 C438.202,1219.57 438.202,1218.23 437.371,1217.4 L428.115,1209" id="chevron-left"></path></g></g></svg>';
var arrowRight='<svg id="nextArrow" width="60px" height="60px" viewBox="-5.5 0 26 26" xmlns="http://www.w3.org/2000/svg"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g transform="translate(-474.000000, -1196.000000)" fill="currentColor"><path d="M488.404,1207.36 L477.637,1197.6 C476.806,1196.76 475.459,1196.76 474.629,1197.6 C473.798,1198.43 473.798,1199.77 474.629,1200.6 L483.885,1209 L474.629,1217.4 C473.798,1218.23 473.798,1219.57 474.629,1220.4 C475.459,1221.24 476.806,1221.24 477.637,1220.4 L488.404,1210.64 C488.854,1210.19 489.052,1209.59 489.015,1209 C489.052,1208.41 488.854,1207.81 488.404,1207.36"></path></g></g></svg>';
var navigation=opts.newNavStyle
? '<div id="newHoverNav">' + arrowLeft + arrowRight + '</div>'
: '<div id="hoverNav"><a href="javascript://" title="' + txt.prevLinkTitle + '" id="prevLink"></a><a href="javascript://" id="nextLink" title="' + txt.nextLinkTitle + '"></a></div>';
var swipeNavigation=opts.newNavStyle
? arrowLeft + arrowRight
: '<a href="javascript://" title="' + txt.prevLinkTitle + '" id="prevLink" class="touch-device"></a><a href="javascript://" id="nextLink" class="touch-device" title="' + txt.nextLinkTitle + '"></a>';
var outerImage='<div id="outerImageContainer"><div id="imageContainer"><img id="lightboxImage">' + navigation + '<div id="jqlb_loading"><a href="javascript://" id="loadingLink"><div id="jqlb_spinner"></div></a></div></div></div>';
if(jqlbIsTouchDevice()){
outerImage='<div id="outerImageContainer"><div id="imageContainer"><img id="lightboxImage">' + swipeNavigation + '<div id="jqlb_loading"><a href="javascript://" id="loadingLink"><div id="jqlb_spinner"></div></a></div></div></div>';
}
var imageData='<div id="imageDataContainer" class="clearfix"><div id="imageData"><div id="imageDetails"><span id="titleAndCaption"></span><div id="controls"><span id="numberDisplay"></span> <a id="playPause" href="#"></a> <span id="downloadLink"></span></div></div><div id="bottomNav">';
imageData +='<a href="javascript://" id="bottomNavClose" title="' + txt.closeTitle + '"><div id="jqlb_closelabel"></div></a></div></div></div>';
var string;
if(opts.navbarOnTop){
string='<div id="overlay"></div><div id="lightbox">' + imageData + outerImage + '</div>';
$("body").append(string);
$("#imageDataContainer").addClass('ontop');
}else{
string='<div id="overlay"></div><div id="lightbox">' + outerImage + imageData + '</div>';
$("body").append(string);
}
$("#overlay").on("click", function (){ end(); }).hide();
$("#lightbox").on("click", function (){ end(); }).hide();
$("#loadingLink").on("click", function (){ end(); return false; });
$("#bottomNavClose").on("click", function (){ end(); return false; });
$('#outerImageContainer').width(opts.widthCurrent).height(opts.heightCurrent);
$('#imageDataContainer').width(opts.widthCurrent);
if(!opts.imageClickClose){
$("#lightboxImage").on("click", function (){ return false; });
$("#hoverNav").on("click", function (){ return false; });
}
$("#outerImageContainer").css({ "background-color": opts.borderColor });
$("#overlay").css({
"background-color": opts.overlayColor ?? '#000',
"opacity": opts.overlayOpacity ?? '.6',
"font-style": "italic"
});
if(! opts.showInfoBar){
$('#imageDataContainer').addClass('hide');
}
if(opts.fixedNav){
$('#prevArrow').addClass('fixed');
$('#nextArrow').addClass('fixed');
}};
function resizeListener(e){
if(opts.resizeTimeout){
clearTimeout(opts.resizeTimeout);
opts.resizeTimeout=false;
}
opts.resizeTimeout=setTimeout(function (){ doScale(); }, 50);
}
function getPageSize(){
return {
pageWidth:$(document).width(),
pageHeight:$(document).height(),
viewportWidth:$(window).width(),
viewportHeight:$(window).height()-opts.adminBarHeight,
};};
function getPageScroll(){
var yScroll=$(document).scrollTop();
if(opts.adminBarHeight&&parseInt($('#wpadminbar').css('top'), 10)===0){
yScroll +=opts.adminBarHeight;
}
return {x:$(document).scrollLeft(), y:yScroll};};
function start(imageLink){
var pageSize=getPageSize();
var newTop=0;
$("#overlay").hide().css({width: pageSize.pageWidth + 'px', height: pageSize.pageHeight + 'px', opacity: opts.overlayOpacity*100 + '%'}).fadeIn(400);
var imageNum=0;
var images=[];
opts.downloads={};
$("a").each(function(){
if(!this.href||(this.rel!=imageLink.rel)){
return;
}
var jqThis=$(this);
var title=opts.showTitle ? getTitle(jqThis):'';
var caption={html:'',text:''};
if(opts.showCaption){
var figureCaption=jqThis.parent().children('figcaption')[0];
if(figureCaption!==undefined){
caption.html=figureCaption.innerHTML;
}else{
var caption=getCaption(jqThis);
}}
if(opts.showTitle&&title.toLowerCase()==caption.text.toLowerCase()){
title=caption.html;
caption.html='';
}
var s=(title!='') ? '<span id="titleText">' + title + '</span>':'';
s +=(title!=''&&caption.html)? '<br />':'';
s +=(caption.html!='') ? '<span id="captionText">' + caption.html +'</span>':'';
if(opts.showDownload||jqThis.attr("data-download")){
opts.downloads[images.length]=jqThis.attr("data-download");
}
images.push(new Array(this.href, s, images.length));
});
if(images.length > 1){
for (i=0; i < images.length; i++){
for (j=images.length - 1; j > i; j--){
if(images[i][0]==images[j][0]){
images.splice(j, 1);
}}
}
while (images[imageNum][0]!=imageLink.href){ imageNum++; }}
opts.imageArray=images;
var scroll=getPageScroll();
setLightBoxPos(scroll.y, scroll.x).show();
changeImage(imageNum);
if(jqlbIsZoomEnabled()){
var lightboxImage=document.getElementById('lightboxImage');
panzoom=Panzoom(lightboxImage, { maxScale: 5, minScale: 1, panOnlyWhenZoomed: true });
}
setNav();
};
function getTitle(jqLink){
var title=jqLink.attr("title")||'';
var jqImg=jqLink.children('img:first-child');
if(opts.useAltForTitle&&(jqLink.attr('alt')||jqImg.attr('alt')) ){
title=jqLink.attr('alt') ? jqLink.attr('alt'):jqImg.attr('alt');
}
if(!title){
var jqImg=jqLink.children('img:first-child');
if(jqImg.attr('title')){
title=jqImg.attr('title');
}else if(jqImg.attr('alt')){
title=jqImg.attr('alt');
}}
return DOMPurify.sanitize(title);
}
function getCaption(jqLink){
var caption={html:'',text:''};
if(jqLink.parent().next('.gallery-caption').html()){
var jq=jqLink.parent().next('.gallery-caption');
caption.html=jq.html();
caption.text=jq.text();
}else if(jqLink.next('.wp-caption-text').html()){
caption.html=jqLink.next('.wp-caption-text').html();
caption.text=jqLink.next('.wp-caption-text').text();
}
caption.text=caption.text.trim().replace('&#8217;', '&#039;').replace('’', '\'').replace('…', '...');//http://nickjohnson.com/b/wordpress-apostrophe-vs-right-single-quote
return caption;
}
function setLightBoxPos(newTop, newLeft){
if(opts.resizeSpeed > 0){
return $('#lightbox').animate({ top: newTop+ 'px', left: newLeft+ 'px' }, opts.resizeSpeed, 'linear');
}
return $('#lightbox').css({ top: newTop + 'px', left: newLeft + 'px' });
};
function changeImage(imageNum){
if(opts.inprogress!=false){
return;
}
opts.inprogress=true;
opts.activeImage=imageNum;
$('#jqlb_loading').show();
$('#lightboxImage').hide();
$('#hoverNav').hide();
$('#prevLink').hide();
$('#nextLink').hide();
$('#prevArrow').hide();
$('#nextArrow').hide();
doChangeImage();
};
function doChangeImage(){
opts.imgPreloader=new Image();
opts.imgPreloader.onload=function (){
$('#lightboxImage').attr('src', opts.imageArray[opts.activeImage][0]);
updateDetails();
doScale();
preloadNeighborImages();
};
opts.imgPreloader.src=opts.imageArray[opts.activeImage][0];
};
function doScale(){
if(!opts.imgPreloader){
return;
}
var newWidth=opts.imgPreloader.width;
var newHeight=opts.imgPreloader.height;
var pageSize=getPageSize();
var noScrollWidth=(pageSize.viewportWidth < pageSize.pageWidth) ? pageSize.pageWidth:pageSize.viewportWidth;
$("#overlay").css({ width: noScrollWidth + 'px', height: pageSize.pageHeight + 'px' });
var maxHeight=(pageSize.viewportHeight) - ($("#imageDataContainer").outerHeight(true) + (2 * opts.borderSize));
var maxWidth=(pageSize.viewportWidth) - (2*opts.borderSize);
if(opts.fitToScreen){
var displayHeight=maxHeight-opts.marginSize;
var displayWidth=maxWidth-opts.marginSize;
var ratio=1;
if(newHeight > displayHeight){
ratio=displayHeight / newHeight;
}
newWidth=newWidth * ratio;
newHeight=newHeight * ratio;
ratio=1;
if(newWidth > displayWidth){
ratio=displayWidth / newWidth;
}
newWidth=Math.round(newWidth * ratio);
newHeight=Math.round(newHeight * ratio);
}
var scroll=getPageScroll();
var centerY=scroll.y + (maxHeight * 0.5);
var newTop=centerY - (newHeight * 0.5);
var newLeft=scroll.x;
$('#lightboxImage').width(newWidth).height(newHeight);
resizeImageContainer(newWidth, newHeight, newTop, newLeft);
}
function resizeImageContainer(imgWidth, imgHeight, lightboxTop, lightboxLeft){
opts.widthCurrent=$("#outerImageContainer").outerWidth();
opts.heightCurrent=$("#outerImageContainer").outerHeight();
var widthNew=Math.max(300, imgWidth + (opts.borderSize * 2)); //300=iphone. http://wordpress.org/support/topic/image-not-resized-correctly-with-wptouch?replies=6#post-4205735
var heightNew=(imgHeight + (opts.borderSize * 2));
setLightBoxPos(lightboxTop, lightboxLeft);
$('#imageDataContainer').animate({width:widthNew}, opts.resizeSpeed, 'linear');
$('#outerImageContainer').animate({width:widthNew,height:heightNew}, opts.resizeSpeed, 'linear', function (){
showImage();
});
if(opts.imageArray.length > 1){
$('#hoverNav').show();
$('#prevLink').show();
$('#nextLink').show();
$('#prevArrow').show();
$('#nextArrow').show();
}
$('#prevLink,#nextLink').height(imgHeight);
};
function showImage(){
$('#jqlb_loading').hide();
showDetails();
if(opts.resizeSpeed > 0){
$('#lightboxImage').fadeIn("fast", function(){
onImageVisible();
});
}else{
$('#lightboxImage').show();
onImageVisible();
}
opts.inprogress=false;
};
function showDetails(){
$('#titleAndCaption').css("opacity", '100%');
if(opts.showDownload){
$('#downloadLink').css('opacity', '100%');
}
if(opts.showNumbers){
$('#numberDisplay').css('opacity', '100%');
}
if(opts.slidehowSpeed){
$('#playPause').css('opacity', '100%');
}
if(opts.resizeSpeed > 0){
$("#imageDetails").animate({opacity: '100%'}, 'fast');
}else{
$("#imageDetails").css('opacity', '100%');
}}
function onImageVisible(){
if(opts.auto!=-1){
clearTimeout(opts.auto);
opts.auto=setTimeout(function(){changeImage((opts.activeImage==(opts.imageArray.length - 1)) ? 0:opts.activeImage + 1);}, opts.slidehowSpeed);
}
enableKeyboardNav();
if(jqlbIsZoomEnabled()){
panzoom?.destroy();
var lightboxImage=document.getElementById('lightboxImage');
panzoom=Panzoom(lightboxImage, { maxScale: 5, minScale: 1, panOnlyWhenZoomed: true });
}}
function preloadNeighborImages(){
if(opts.imageArray.length > 1){
preloadNextImage=new Image();
preloadNextImage.src=opts.imageArray[(opts.activeImage==(opts.imageArray.length - 1)) ? 0:opts.activeImage + 1][0]
preloadPrevImage=new Image();
preloadPrevImage.src=opts.imageArray[(opts.activeImage==0) ? (opts.imageArray.length - 1):opts.activeImage - 1][0]
}else{
if((opts.imageArray.length - 1) > opts.activeImage){
preloadNextImage=new Image();
preloadNextImage.src=opts.imageArray[opts.activeImage + 1][0];
}
if(opts.activeImage > 0){
preloadPrevImage=new Image();
preloadPrevImage.src=opts.imageArray[opts.activeImage - 1][0];
}}
};
function updateDetails(){
var images=opts.imageArray;
var txt=opts.strings;
var i=opts.activeImage;
var downloadIndex=images[i][2];
var pos=(opts.showNumbers&&images.length > 1) ? txt.image + (i + 1) + txt.of + images.length:'';
$("#imageDetails").css("opacity", '100%');
if(images[i][1]!=''){
$('#titleAndCaption').css('opacity', '100%').html(images[i][1]);
}else{
$('#titleAndCaption').empty();
}
if(opts.showNumbers){
$('#numberDisplay').css('opacity', '100%').html(pos);
}else{
$('#numberDisplay').empty();
}
if(opts.slidehowSpeed&&images.length > 1){
var pp=(opts.auto===-1) ? txt.play:txt.pause;
$('#playPause').css('opacity', '100%').attr('href', '#').text(pp);
}else{
$('#playPause').empty();
}
if(opts.showDownload||opts.downloads[downloadIndex]){
var url=opts.downloads[downloadIndex] ? opts.downloads[downloadIndex]:images[i][0];
url=DOMPurify.sanitize(url);
if(url.startsWith('http://')||url.startsWith('https://')){
$('#downloadLink').css('opacity', '100%').html($('<a>').attr('href', url).attr('target', '_blank').attr('download', '').text(txt.download));
}}else{
$('#downloadLink').empty();
}
var position=$('#downloadLink').position();
};
function setNav(){
if(opts.imageArray.length > 1){
$('#prevLink').on("click", function (){
changeImage((opts.activeImage==0) ? (opts.imageArray.length - 1):opts.activeImage - 1);
return false;
});
$('#nextLink').on("click", function (){
changeImage((opts.activeImage==(opts.imageArray.length - 1)) ? 0:opts.activeImage + 1);
return false;
});
$('#prevArrow').on("click", function (){
changeImage((opts.activeImage==0) ? (opts.imageArray.length - 1):opts.activeImage - 1);
return false;
});
$('#nextArrow').on("click", function (){
changeImage((opts.activeImage==(opts.imageArray.length - 1)) ? 0:opts.activeImage + 1);
return false;
});
if($.fn.touchwipe){
$('#imageContainer').touchwipe({
wipeLeft: function(){
if(! isImageZoomed()){
changeImage((opts.activeImage==(opts.imageArray.length - 1)) ? 0:opts.activeImage + 1);
}},
wipeRight: function(){
if(! isImageZoomed()){
changeImage((opts.activeImage==0) ? (opts.imageArray.length - 1):opts.activeImage - 1);
}},
min_move_x: 20,
preventDefaultEvents: true
});
}
if(opts.slidehowSpeed){
$('#playPause').off('click').on("click", function(){
if(opts.auto!=-1){
$(this).text(opts.strings.play);
clearTimeout(opts.auto);
opts.auto=-1;
}else{
$(this).text(opts.strings.pause);
opts.auto=setTimeout(function(){changeImage((opts.activeImage==(opts.imageArray.length - 1)) ? 0:opts.activeImage + 1);}, opts.slidehowSpeed);
}
return false;
});
}
enableKeyboardNav();
}};
function end(){
disableKeyboardNav();
clearTimeout(opts.auto);
opts.auto=-1;
$('#lightbox').hide();
$('#overlay').fadeOut();
};
function keyboardAction(e){
var o=e.data.opts;
var keycode=e.keyCode;
var escapeKey=27;
var key=String.fromCharCode(keycode).toLowerCase();
if((key=='x')||(key=='o')||(key=='c')||(keycode==escapeKey)){
end();
}else if((key=='p')||(keycode==37)){
disableKeyboardNav();
changeImage((o.activeImage==0) ? (o.imageArray.length - 1):o.activeImage - 1);
}else if((key=='n')||(keycode==39)){
disableKeyboardNav();
changeImage((o.activeImage==(o.imageArray.length - 1)) ? 0:o.activeImage + 1);
}
return false;
};
function enableKeyboardNav(){
$(document).off('keydown').on('keydown', {opts: opts}, keyboardAction);
};
function disableKeyboardNav(){
$(document).off('keydown');
};
function isImageZoomed(){
if(jqlbIsZoomEnabled()&&panzoom?.getScale() > 1){
return true;
}
return false;
}};
$.fn.lightbox.defaults={
showCaption:false,
showNumbers:true,
adminBarHeight:0,
overlayOpacity: '80%',
borderSize: 10,
imageArray: new Array,
activeImage: null,
inprogress: false,
widthCurrent: 300,
heightCurrent: 300,
showTitle: true,
imageClickClose: true
};
$(document).ready(doLightBox);
})(jQuery);
var panzoom={};
function jqlbIsTouchDevice(){
return (('ontouchstart' in window) ||
(navigator.maxTouchPoints > 0) ||
(navigator.msMaxTouchPoints > 0));
}
function jqlbIsZoomEnabled(){
return JQLBSettings.allowPinchZoom==='1'
}
function doLightBox(){
var haveConf=(typeof JQLBSettings=='object');
var ss, rs, ms=0;
if(haveConf&&JQLBSettings.slideshowSpeed){
ss=parseInt(JQLBSettings.slideshowSpeed);
}
if(haveConf&&JQLBSettings.resizeSpeed){
rs=parseInt(JQLBSettings.resizeSpeed);
}
if(haveConf&&JQLBSettings.marginSize){
ms=parseInt(JQLBSettings.marginSize);
}
if(haveConf&&jqlbIsTouchDevice()&&JQLBSettings.mobileMarginSize){
ms=parseInt(JQLBSettings.mobileMarginSize)
}
var default_strings={
prevLinkTitle: 'previous image',
nextLinkTitle: 'next image',
closeTitle: 'close image gallery',
image: 'Image ',
of: ' of ',
download: 'Download',
pause: '(pause slideshow)',
play: '(play slideshow)'
};
jQuery('a[rel^="lightbox"]').lightbox({
adminBarHeight: jQuery('#wpadminbar').height()||0,
showNumbers: (haveConf&&JQLBSettings.showNumbers=='1') ? true:false,
showCaption: (haveConf&&JQLBSettings.showCaption=='1') ? true:false,
showTitle: (haveConf&&JQLBSettings.showTitle=='1') ? true:false,
useAltForTitle: (haveConf&&JQLBSettings.useAltForTitle=='1') ? true:false,
marginSize: (haveConf&&ms) ? ms:0,
fitToScreen: (haveConf&&JQLBSettings.fitToScreen=='1') ? true:false,
resizeSpeed: (haveConf&&rs >=0) ? rs:400,
slidehowSpeed: (haveConf&&ss >=0) ? ss:4000,
showDownload: (haveConf&&JQLBSettings.showDownload=='1') ? true:false,
navbarOnTop: (haveConf&&JQLBSettings.navbarOnTop=='1') ? true:false,
strings: (haveConf&&typeof JQLBSettings.prevLinkTitle=='string') ? JQLBSettings:default_strings,
borderSize: (haveConf&&JQLBSettings?.borderSize ? JQLBSettings?.borderSize:10),
borderColor: (haveConf&&JQLBSettings?.borderColor),
overlayColor: (haveConf&&JQLBSettings?.overlayColor),
overlayOpacity: (haveConf&&JQLBSettings?.overlayOpacity),
newNavStyle: (haveConf&&JQLBSettings?.newNavStyle=='1' ? true:false),
fixedNav: (haveConf&&JQLBSettings?.fixedNav=='1' ? true:false),
navArrowColor: (haveConf&&JQLBSettings?.navArrowColor),
navBackgroundColor: (haveConf&&JQLBSettings?.navBackgroundColor),
showInfoBar: (haveConf&&JQLBSettings?.showInfoBar=='1' ? true:false)
});
};