1/*! formstone v1.4.22 [core.js] 2021-10-01 | GPL-3.0 License | formstone.it */ 2!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(w){"use strict";function e(){this.Version="1.4.22",this.Plugins={},this.DontConflict=!1,this.Conflicts={fn:{}},this.ResizeHandlers=[],this.RAFHandlers=[],this.window=i,this.$window=w(i),this.document=r,this.$document=w(r),this.$body=null,this.windowWidth=0,this.windowHeight=0,this.fallbackWidth=1024,this.fallbackHeight=768,this.userAgent=window.navigator.userAgent||window.navigator.vendor||window.opera,this.isFirefox=/Firefox/i.test(this.userAgent),this.isChrome=/Chrome/i.test(this.userAgent),this.isSafari=/Safari/i.test(this.userAgent)&&!this.isChrome,this.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(this.userAgent),this.isIEMobile=/IEMobile/i.test(this.userAgent),this.isFirefoxMobile=this.isFirefox&&this.isMobile,this.transform=null,this.transition=null,this.support={file:!!(window.File&&window.FileList&&window.FileReader),history:!!(window.history&&window.history.pushState&&window.history.replaceState),matchMedia:!(!window.matchMedia&&!window.msMatchMedia),pointer:!!window.PointerEvent,raf:!(!window.requestAnimationFrame||!window.cancelAnimationFrame),touch:!!("ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),transition:!1,transform:!1}}var t,n,s,i="undefined"!=typeof window?window:this,r=i.document,o={killEvent:function(e,t){try{e.preventDefault(),e.stopPropagation(),t&&e.stopImmediatePropagation()}catch(e){}},killGesture:function(e){try{e.preventDefault()}catch(e){}},lockViewport:function(e){h[e]=!0,w.isEmptyObject(h)||p||(t.length?t.attr("content",s):t=w("head").append('<meta name="viewport" content="'+s+'">'),c.$body.on(u.gestureChange,o.killGesture).on(u.gestureStart,o.killGesture).on(u.gestureEnd,o.killGesture),p=!0)},unlockViewport:function(e){void 0!==h[e]&&delete h[e],w.isEmptyObject(h)&&p&&(t.length&&(n?t.attr("content",n):t.remove()),c.$body.off(u.gestureChange).off(u.gestureStart).off(u.gestureEnd),p=!1)},startTimer:function(e,t,n,s){return o.clearTimer(e),s?setInterval(n,t):setTimeout(n,t)},clearTimer:function(e,t){e&&(t?clearInterval(e):clearTimeout(e),e=null)},sortAsc:function(e,t){return parseInt(e,10)-parseInt(t,10)},sortDesc:function(e,t){return parseInt(t,10)-parseInt(e,10)},decodeEntities:function(e){var t=c.document.createElement("textarea");return t.innerHTML=e,t.value},parseQueryString:function(e){for(var t={},n=e.slice(e.indexOf("?")+1).split("&"),s=0;s<n.length;s++){var i=n[s].split("=");t[i[0]]=i[1]}return t}},c=new e,a=w.Deferred(),l={base:"{ns}",element:"{ns}-element"},u={namespace:".{ns}",beforeUnload:"beforeunload.{ns}",blur:"blur.{ns}",change:"change.{ns}",click:"click.{ns}",dblClick:"dblclick.{ns}",drag:"drag.{ns}",dragEnd:"dragend.{ns}",dragEnter:"dragenter.{ns}",dragLeave:"dragleave.{ns}",dragOver:"dragover.{ns}",dragStart:"dragstart.{ns}",drop:"drop.{ns}",error:"error.{ns}",focus:"focus.{ns}",focusIn:"focusin.{ns}",focusOut:"focusout.{ns}",gestureChange:"gesturechange.{ns}",gestureStart:"gesturestart.{ns}",gestureEnd:"gestureend.{ns}",input:"input.{ns}",keyDown:"keydown.{ns}",keyPress:"keypress.{ns}",keyUp:"keyup.{ns}",load:"load.{ns}",mouseDown:"mousedown.{ns}",mouseEnter:"mouseenter.{ns}",mouseLeave:"mouseleave.{ns}",mouseMove:"mousemove.{ns}",mouseOut:"mouseout.{ns}",mouseOver:"mouseover.{ns}",mouseUp:"mouseup.{ns}",panStart:"panstart.{ns}",pan:"pan.{ns}",panEnd:"panend.{ns}",resize:"resize.{ns}",scaleStart:"scalestart.{ns}",scaleEnd:"scaleend.{ns}",scale:"scale.{ns}",scroll:"scroll.{ns}",select:"select.{ns}",swipe:"swipe.{ns}",touchCancel:"touchcancel.{ns}",touchEnd:"touchend.{ns}",touchLeave:"touchleave.{ns}",touchMove:"touchmove.{ns}",touchStart:"touchstart.{ns}"},d=null,f=20,h=[],p=!1;function m(e,t,n,s){var i,r={raw:{}};for(i in s=s||{})s.hasOwnProperty(i)&&("classes"===e?(r.raw[s[i]]=t+"-"+s[i],r[s[i]]="."+t+"-"+s[i]):(r.raw[i]=s[i],r[i]=s[i]+"."+t));for(i in n)n.hasOwnProperty(i)&&("classes"===e?(r.raw[i]=n[i].replace(/{ns}/g,t),r[i]=n[i].replace(/{ns}/g,"."+t)):(r.raw[i]=n[i].replace(/.{ns}/g,""),r[i]=n[i].replace(/{ns}/g,t)));return r}function g(){c.windowWidth=c.$window.width(),c.windowHeight=c.$window.height(),d=o.startTimer(d,f,y)}function y(){for(var e in c.ResizeHandlers)c.ResizeHandlers.hasOwnProperty(e)&&c.ResizeHandlers[e].callback.call(window,c.windowWidth,c.windowHeight)}function v(e,t){return parseInt(e.priority)-parseInt(t.priority)}return e.prototype.NoConflict=function(){for(var e in c.DontConflict=!0,c.Plugins)c.Plugins.hasOwnProperty(e)&&(w[e]=c.Conflicts[e],w.fn[e]=c.Conflicts.fn[e])},e.prototype.Ready=function(e){"complete"===c.document.readyState||"loading"!==c.document.readyState&&!c.document.documentElement.doScroll?e():c.document.addEventListener("DOMContentLoaded",e)},e.prototype.Plugin=function(e,t){function d(e){return e.data(p)}var f,h,n,p;return c.Plugins[e]=(h=t,n="fs-"+(f=e),p="fs"+f.replace(/(^|\s)([a-z])/g,function(e,t,n){return t+n.toUpperCase()}),h.initialized=!1,h.priority=h.priority||10,h.classes=m("classes",n,l,h.classes),h.events=m("events",f,u,h.events),h.functions=w.extend({getData:d,iterate:function(e){for(var t=Array.prototype.slice.call(arguments,1
2),n=0,s=this.length;n<s;n++){var i=this.eq(n),r=d(i)||{};void 0!==r.$el&&e.apply(i,[r].concat(t))}return this}},o,h.functions),h.methods=w.extend(!0,{_construct:w.noop,_postConstruct:w.noop,_destruct:w.noop,_resize:!1,destroy:function(e){h.functions.iterate.apply(this,[h.methods._destruct].concat(Array.prototype.slice.call(arguments,1))),this.removeClass(h.classes.raw.element).removeData(p)}},h.methods),h.utilities=w.extend(!0,{_initialize:!1,_delegate:!1,defaults:function(e){h.defaults=w.extend(!0,h.defaults,e||{})}},h.utilities),h.widget&&(c.Conflicts.fn[f]=w.fn[f],w.fn[p]=function(e){if(this instanceof w){var t=h.methods[e];if("object"==typeof e||!e)return function(e){var t,n,s,i="object"==typeof e,r=Array.prototype.slice.call(arguments,i?1:0),o=w();for(e=w.extend(!0,{},h.defaults||{},i?e:{}),n=0,s=this.length;n<s;n++)if(!d(t=this.eq(n))){h.guid++;var a="__"+h.guid,c=h.classes.raw.base+a,l=t.data(f+"-options"),u=w.extend(!0,{$el:t,guid:a,numGuid:h.guid,rawGuid:c,dotGuid:"."+c},e,"object"==typeof l?l:{});t.addClass(h.classes.raw.element).data(p,u),h.methods._c
2onstruct.apply(t,[u].concat(r)),o=o.add(t)}for(n=0,s=o.length;n<s;n++)t=o.eq(n),h.methods._postConstruct.apply(t,[d(t)]);return this}.apply(this,arguments);if(t&&0!==e.indexOf("_")){var n=[t].concat(Array.prototype.slice.call(arguments,1));return h.functions.iterate.apply(this,n)}return this}},c.DontConflict||(w.fn[f]=w.fn[p])),c.Conflicts[f]=w[f],w[p]=h.utilities._delegate||function(e){var t=h.utilities[e]||h.utilities._initialize||!1;if(t){var n=Array.prototype.slice.call(arguments,"object"==typeof e?0:1);return t.apply(window,n)}},c.DontConflict||(w[f]=w[p]),h.namespace=f,h.namespaceClean=p,h.guid=0,h.methods._resize&&(c.ResizeHandlers.push({namespace:f,priority:h.priority,callback:h.methods._resize}),c.ResizeHandlers.sort(v)),h.methods._raf&&(c.RAFHandlers.push({namespace:f,priority:h.priority,callback:h.methods._raf}),c.RAFHandlers.sort(v)),h),c.Plugins[e]},c.$window.on("resize.fs",g),g(),function e(){if(c.support.raf)for(var t in c.window.requestAnimationFrame(e),c.RAFHandlers)c.RAFHandlers.hasOwnProperty(t)&&c.RAFHandlers[t].callback.call(window)}(),c.Ready(function(){c.$body=w("body"),w("html").addClass(c.support.touch?"touchevents":"no-touchevents"),t=w('meta[name="viewport"]'),n=!!t.length&&t.attr("content"),s="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0",a.resolve()}),u.clickTouchStart=u.click+" "+u.touchStart,function(){var e,t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"},n=["transition","-webkit-transition"],s={transform:"transform",MozTransform:"-moz-transform",OTransform:"-o-transform",msTransform:"-ms-transform",webkitTransform:"-webkit-transform"},i="transitionend",r="",o="",a=document.createElement("div");for(e in t)if(t.hasOwnProperty(e)&&e in a.style){i=t[e],c.support.transition=!0;break}for(e in u.transitionEnd=i+".{ns}",n)if(n.hasOwnProperty(e)&&n[e]in a.style){r=n[e];break}for(e in c.transition=r,s)if(s.hasOwnProperty(e)&&s[e]in a.style){c.support.transform=!0,o=s[e];break}c.transform=o}(),window.Formstone=c}); 3/*! formstone v1.4.22 [mediaquery.js] 2021-10-01 | GPL-3.0 License | formstone.it */ 4!function(e){"function"==typeof define&&define.amd?define(["jquery","./core"],e):e(jQuery,Formstone)}(function(a,e){"use strict";function o(){!function(){for(var e in r={unit:s.unit},u)if(u.hasOwnProperty(e))for(var t in l[e])if(l[e].hasOwnProperty(t)){var n="Infinity"===t?1/0:parseInt(t,10),i=-1<e.indexOf("max");l[e][t].matches&&(i?(!r[e]||n<r[e])&&(r[e]=n):(!r[e]||n>r[e])&&(r[e]=n))}}(),n.trigger(c.mqChange,[r])}function h(e){var t=m(e.media),n=d[t],i=e.matches,r=i?c.enter:c.leave;if(n&&(n.active||!n.active&&i)){for(var a in n[r])n[r].hasOwnProperty(a)&&n[r][a].apply(n.mq);n.active=!0}}function m(e){return e.replace(/[^a-z0-9\s]/gi,"").replace(/[_\s]/g,"").replace(/^\s+|\s+$/g,"")}var t=e.Plugin("mediaquery",{utilities:{_initialize:function(e){for(var t in e=e||{},u)u.hasOwnProperty(t)&&(s[t]=e[t]?a.merge(e[t],s[t]):s[t]);for(var n in(s=a.extend(s,e)).minWidth.sort(v.sortDesc),s.maxWidth.sort(v.sortAsc),s.minHeight.sort(v.sortDesc),s.maxHeight.sort(v.sortAsc),u)if(u.hasOwnProperty(n))for(var i in l[n]={},s[n])if(s[n].hasOwnProperty(i)){var r=window.matchMedia("("+u[n]+": "+(s[n][i]===1/0?1e5:s[n][i])+s.unit+")");r.addListener(o),l[n][s[n][i]]=r}o()},state:function(){return r},bind:function(e,t,n){var i=f.matchMedia(t),r=m(i.media);for(var a in d[r]||(d[r]={mq:i,active:!0,enter:{},leave:{}},d[r].mq.addListener(h)),n)n.hasOwnProperty(a)&&d[r].hasOwnProperty(a)&&(d[r][a][e]=n[a]);var o=d[r],s=i.matches;s&&o[c.enter].hasOwnProperty(e)?(o[c.enter][e].apply(i),o.active=!0):!s&&o[c.leave].hasOwnProperty(e)&&(o[c.leave][e].apply(i),o.active=!1)},unbind:function(e,t){if(e)if(t){var n=m(t);d[n]&&(d[n].enter[e]&&delete d[n].enter[e],d[n].leave[e]&&delete d[n].leave[e])}else for(var i in d)d.hasOwnProperty(i)&&(d[i].enter[e]&&delete d[i].enter[e],d[i].leave[e]&&delete d[i].leave[e])}},events:{mqChange:"mqchange"}}),s={minWidth:[0],maxWidth:[1/0],minHeight:[0],maxHeight:[1/0],unit:"px"}
4,c=a.extend(t.events,{enter:"enter",leave:"leave"}),n=e.$window,f=n[0],v=t.functions,r=null,d=[],l={},u={minWidth:"min-width",maxWidth:"max-width",minHeight:"min-height",maxHeight:"max-height"}}); 5/*! formstone v1.4.22 [analytics.js] 2021-10-01 | GPL-3.0 License | formstone.it */ 6!function(e){"function"==typeof define&&define.amd?define(["jquery","./core","./mediaquery"],e):e(jQuery,Formstone)}(function(c,a){"use strict";function t(){p.scrollDepth&&l()}function n(){var e,t=c(this),n=void 0!==t[0].href?t[0].href:"",i=document.domain.split(".").reverse(),o=null!==n.match(i[1]+"."+i[0]);if(n.match(/^mailto\:/i))e="Email, Click, "+n.replace(/^mailto\:/i,"");else if(n.match(/^tel\:/i))e="Telephone, Click, "+n.replace(/^tel\:/i,"");else if(n.match(p.fileTypes)){e="File, Download:"+(/[.]/.exec(n)?/[^.]+$/.exec(n):void 0)[0]+", "+n.replace(/ /g,"-")}else o||(e="ExternalLink, Click, "+n);e&&t.attr(w,e)}function i(e){h.startTimer(T,250,o)}function o(){for(var e,t=u.scrollTop()+a.windowHeight,n=1/p.scrollStops,i=n,o=1;o<=p.scrollStops;o++){if(e=Math.round(100*i).toString(),!x[k][e].passed&&t>x[k][e].edge)x[k][e].passed=!0,s(c.extend(p.scrollFields,{eventCategory:"ScrollDepth",eventAction:k,eventLabel:e,nonInteraction:!0}));i+=n}}function l(){var e,t=c.mediaquery("state"),n=v.outerHeight(),i={},o=1/p.scrollStops,a=o,l=0;
6t.minWidth&&(k="MinWidth:"+t.minWidth+"px");for(var r=1;r<=p.scrollStops;r++)l=parseInt(n*a),i[e=Math.round(100*a).toString()]={edge:"100"===e?l-10:l,passsed:!(!x[k]||!x[k][e])&&x[k][e].passed},a+=o;x[k]=i}function r(e){var t=c(this),n=t.attr("href"),i=t.data(g).split(",");for(var o in p.eventCallback&&e.preventDefault(),i)i.hasOwnProperty(o)&&(i[o]=c.trim(i[o]));s({eventCategory:i[0],eventAction:i[1],eventLabel:i[2]||n,eventValue:i[3],nonInteraction:i[4]},t)}function s(e,t){d.location;var n=c.extend({hitType:"event"},e);if(void 0!==t&&!t.attr("data-analytics-stop")){var i=void 0!==t[0].href?t[0].href:"",o=!i.match(/^mailto\:/i)&&!i.match(/^tel\:/i)&&i.indexOf(":")<0?d.location.protocol+"//"+d.location.hostname+"/"+i:i;if(""!==o){var a=t.attr("target");if(a)d.open(o,a);else if(p.eventCallback){var l="hitCallback";n[l]=function(){b&&(h.clearTimer(b),function(e){document.location=e}(o))},b=h.startTimer(b,p.eventTimeout,n[l])}}}f(n)}function f(e){if("function"==typeof d.ga&&"function"==typeof d.ga.getAll)for(var t=d.ga.getAll(),n=0,i=t.length;n<i;n++)d.ga(t[n].get("name")+".send",e)}var e=a.Plugin("analytics",{methods:{_resize:t},utilities:{_delegate:function(){if(arguments.length&&"object"!=typeof arguments[0])if("destroy"===arguments[0])(function(){y&&v&&v.length&&(u.off(m.namespace),v.off(m.namespace),y=!1)}).apply(this);else{var e=Array.prototype.slice.call(arguments,1);switch(arguments[0]){case"pageview":(function(e){f(c.extend({hitType:"pageview"},e))}).apply(this,e);break;case"event":s.apply(this,e)}}else(function(e){!y&&v&&v.length&&(y=!0,(p=c.extend(p,e||{})).autoEvents&&v.find("a").not("["+w+"]").each(n),p.scrollDepth&&(l(),u.on(m.scroll,i).one(m.load,t)),v.on(m.click,"*["+w+"]",r))}).apply(this,arguments);return null}}}),p={autoEvents:!1,fileTypes:/\.(zip|exe|dmg|pdf|doc.*|xls.*|ppt.*|mp3|txt|rar|wma|mov|avi|wmv|flv|wav)$/i,eventCallback:!1,eventTimeout:1e3,scrollDepth:!1,scrollStops:5,scrollFields:{}},d=a.window,u=a.$window,v=null,h=e.functions,m=e.events,y=!1,g="analytics-event",w="data-"+g,x={},T=null,k="Site",b=null;a.Ready(function(){v=a.$body})}); 7/*! formstone v1.4.22 [background.js] 2021-10-01 | GPL-3.0 License | formstone.it */ 8!function(e){"function"==typeof define&&define.amd?define(["jquery","./core","./transition"],e):e(jQuery,Formstone)}(function(u,t){"use strict";function e(){(Y=$.scrollTop()+t.windowHeight)<0&&(Y=0),T.iterate.call(j,s)}function i(){C=u(m.base),j=u(m.lazy),T.iterate.call(j,r)}function o(e){if(e.visible){var i=e.source;e.source=null,a(e,i,!0)}}function a(e,i,o){if(i!==e.source&&e.visible){if(e.source=i,e.responsive=!1,e.isYouTube=!1,"object"==typeof i&&"string"==typeof i.video){var t=i.video.match(/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/ ]{11})/i);t&&1<=t.length&&(e.isYouTube=!0,e.videoId=t[1])}var a=!e.isYouTube&&"object"==typeof i&&(i.hasOwnProperty("mp4")||i.hasOwnProperty("ogg")||i.hasOwnProperty("webm"));if(e.video=e.isYouTube||a,e.playing=!1,e.isYouTube)e.playerReady=!1,e.posterLoaded=!1,p(e,i,o);else if("object"==typeof i&&i.hasOwnProperty("poster"))!function(i,e,o){i.source&&i.source.poster&&(c(i,i.source.poster,!0,!0),o=!1);var t='<div class="'+[b.media,b.video,!0!==o?b.animated:""].join(" ")+'" aria-hidden="true">';t+="<video playsinline",i.loop&&(t+=" loop");i.mute&&(t+=" muted");i.autoPlay&&(t+=" autoplay");t+=">",i.source.webm&&(t+='<source src="'+i.source.webm+'" type="video/webm" />');i.source.mp4&&(t+='<source src="'+i.source.mp4+'" type="video/mp4" />');i.source.ogg&&(t+='<source src="'+i.source.ogg+'" type="video/ogg" />');t+="</video>";var a=u(t+="</div>");a.find("video").one(w.loadedMetaData,function(e){a.fsTransition({property:"opacity"},function(){y(i)}).css({opacity:1}),h(i),i.$el.trigger(w.loaded),i.autoPlay&&f(i)}),i.$container.append(a)}(e,0,o);else{var n=i;if("object"==typeof i){var r,s=[],d=[];for(r in i)i.hasOwnProperty(r)&&d.push(r);for(r in d.sort(T.sortAsc),d)d.hasOwnProperty(r)&&s.push({width:parseInt(d[r]),url:i[d[r]],mq:P.matchMedia("(min-width: "+parseInt(d[r])+"px)")});e.responsive=!0,e.sources=s,n=l(e)}c(e,n,!1,o)}}else e.$el.trigger(w.loaded)}function l(e){var i=e.source;if(e.responsive)for(var o in i=e.sources[0].url,e.sources)e.sources.hasOwnProperty(o)&&(t.supp
8ort.matchMedia?e.sources[o].mq.matches&&(i=e.sources[o].url):e.sources[o].width<t.fallbackWidth&&(i=e.sources[o].url));return i}function c(e,i,o,t){var a=[b.media,b.image,!0!==t?b.animated:""].join(" "),n=u('<div class="'+a+'" aria-hidden="true"><img alt="'+e.alt+'"></div>'),r=n.find("img"),s=i;r.one(w.load,function(){I&&n.addClass(b.native).css({backgroundImage:"url('"+s+"')"}),n.fsTransition({property:"opacity"},function(){o||y(e)}).css({opacity:1}),h(e),o&&!t||e.$el.trigger(w.loaded)}).one(w.error,e,d).attr("src",s),e.responsive&&n.addClass(b.responsive),e.$container.append(n),!r[0].complete&&4!==r[0].readyState||r.trigger(w.load),e.currentSource=s}function p(i,e,o){if(!i.videoId){var t=e.match(/^.*(?:youtu.be\/|v\/|e\/|u\/\w+\/|embed\/|v=)([^#\&\?]*).*/);i.videoId=t[1]}if(i.posterLoaded||(i.source.poster||(i.source.poster="//img.youtube.com/vi/"+i.videoId+"/0.jpg"),i.posterLoaded=!0,c(i,i.source.poster,!0,o),o=!1),u("script[src*='youtube.com/iframe_api']").length||u("head").append('<script src="//www.youtube.com/iframe_api"><\/script>'),R){var a=i.guid+"_"+i.youTubeGuid++,n='<div class="'+[b.media,b.embed,!0!==o?b.animated:""].join(" ")+'" aria-hidden="true">';n+='<div id="'+a+'"></div>';var r=u(n+="</div>"),s=u.extend(!0,{},{controls:0,rel:0,showinfo:0,wmode:"transparent",enablejsapi:1,version:3,playerapiid:a,loop:i.loop?1:0,autoplay:1,mute:1,origin:P.location.protocol+"//"+P.location.host},i.youtubeOptions);s.autoplay=1,i.$container.append(r),i.player&&(i.oldPlayer=i.player,i.player=null),i.player=new P.YT.Player(a,{videoId:i.videoId,playerVars:s,events:{onReady:function(e){i.playerReady=!0,i.mute&&i.player.mute(),i.autoPlay?i.player.playVideo():i.player.pauseVideo()},onStateChange:function(e){i.playing||e.data!==P.YT.PlayerState.PLAYING?i.loop&&i.playing&&e.data===P.YT.PlayerState.ENDED&&i.player.playVideo():(i.playing=!0,r.fsTransition({property:"opacity"},function(){y(i)}).css({opacity:1}),h(i),i.$el.trigger(w.loaded)),i.$el.find(m.embed).addClass(b.ready)},onPlaybackQualityChange:function(e){},onPlaybackRateChange:function(e){},onError:function(e){d({data:i})},onApiChange:function(e){}}}),h(i)}else z.push({data:i,source:e})}function y(e){var i=e.$container.find(m.media);1<=i.length&&(i.not(":last").remove(),e.oldPlayer=null)}function d(e){e.data.$el.trigger(w.error)}function f(e){if(e.video&&!e.playing)if(e.isYouTube)e.playerReady?e.player.playVideo():e.autoPlay=!0;else{var i=e.$container.find("video");i.length&&i[0].play(),e.playing=!0}}function n(e){if(e.visible)if(e.responsive){var i=l(e);i!==e.currentSource?c(e,i,!1,!0):h(e)}else h(e)}function h(e){for(var i=e.$container.find(m.media),o=0,t=i.length;o<t;o++){var a=i.eq(o),n=e.isYouTube?"iframe":a.find("video").length?"video":"img",r=a.find(n);if(r.length&&("img"!=n||!I)){var s=e.$el.outerWidth(),d=e.$el.outerHeight(),u=v(e,r);e.width=u.width,e.height=u.height,e.left=0,e.top=0;var l=e.isYouTube?e.embedRatio:e.width/e.height;e.height=d,e.width=e.height*l,e.width<s&&(e.width=s,e.height=e.width/l),e.left=-(e.width-s)/2,e.top=-(e.height-d)/2,a.css({height:e.height,width:e.width,left:e.left,top:e.top})}}}function r(e){e.scrollTop=e.$el.offset().top}function s(e){!e.visible&&e.scrollTop<Y+e.lazyEdge&&(e.visible=!0,o(e))}function v(e,i){if(e.isYouTube)return{height:500,width:500/e.embedRatio};if(i.is("img")){var o=i[0];if(void 0!==o.naturalHeight)return{height:o.naturalHeight,width:o.naturalWidth};var t=new Image;return t.src=o.src,{height:t.height,width:t.width}}return{height:i[0].videoHeight,width:i[0].videoWidth}}var g=t.Plugin("background",{widget:!0,defaults:{alt:"",autoPlay:!0,customClass:"",embedRatio:1.777777,lazy:!1,lazyEdge:100,loop:!0,mute:!0,source:null,youtubeOptions:{}},classes:["container","media","animated","responsive","native","fixed","ready","lazy"],events:{loaded:"loaded",ready:"ready",loadedMetaData:"loadedmetadata"},methods:{_construct:function(e){e.youTubeGuid=0,e.$container=u('<div class="'+b.container+'"></div>').appendTo(this),e.thisClasses=[b.base,e.customClass],e.visible=!0,e.lazy&&(e.visible=!1,e.thisClasses.push(b.lazy)),this.addClass(e.thisClasse
8s.join(" ")),i(),e.lazy?(r(e),s(e)):o(e)},_destruct:function(e){e.$container.remove(),this.removeClass(e.thisClasses.join(" ")).off(w.namespace),i()},_resize:function(){T.iterate.call(C,n),T.iterate.call(j,r),T.iterate.call(j,s)},play:f,pause:function(e){if(e.video&&e.playing){if(e.isYouTube)e.playerReady?e.player.pauseVideo():e.autoPlay=!1;else{var i=e.$container.find("video");i.length&&i[0].pause()}e.playing=!1}},mute:function(e){if(e.video)if(e.isYouTube&&e.playerReady)e.player.mute();else{var i=e.$container.find("video");i.length&&(i[0].muted=!0)}e.mute=!0},unmute:function(e){if(e.video){if(e.isYouTube&&e.playerReady)e.player.unMute();else{var i=e.$container.find("video");i.length&&(i[0].muted=!1)}e.playing=!0}e.mute=!1},resize:h,load:a,unload:function(e){var i=e.$container.find(m.media);1<=i.length&&i.fsTransition({property:"opacity"},function(){i.remove(),delete e.source}).css({opacity:0})}}}),m=g.classes,b=m.raw,w=g.events,T=g.functions,P=t.window,$=t.$window,Y=0,C=[],j=[],I="backgroundSize"in t.document.documentElement.style,R=!1,z=[];t.Ready(function(){e(),$.on("scroll",e)}),P.onYouTubeIframeAPIReady=function(){for(var e in R=!0,z)z.hasOwnProperty(e)&&p(z[e].data,z[e].source);z=[]}}); 9/* global define */ 10 11(function(factory) { 12 if (typeof define === "function" && define.amd) { 13 define([ 14 "jquery", 15 "./core", 16 "./mediaquery", 17 "./touch" 18 ], factory); 19 } else { 20 factory(jQuery, Formstone); 21 } 22}(function($, Formstone) { 23 24 "use strict"; 25 26 /** 27 * @method private 28 * @name resize 29 * @description Handles window resize 30 */ 31 32 function resize(windowWidth) { 33 Functions.iterate.call($Instances, resizeInstance); 34 } 35 36 /** 37 * @method private 38 * @name cacheInstances 39 * @description Caches active instances 40 */ 41 42 function cacheInstances() { 43 $Instances = $(Classes.base); 44 } 45 46 /** 47 * @method private 48 * @name construct 49 * @description Builds instance. 50 * @param data [object] "Instance data" 51 */ 52 53 function construct(data) { 54 var i; 55 56 data.didPan = false; 57 58 data.carouselClasses = [ 59 RawClasses.base, 60 data.theme, 61 data.customClass, 62 (data.rtl ? RawClasses.rtl : RawClasses.ltr) 63 ]; 64 65 data.maxWidth = (data.maxWidth === Infinity ? "100000px" : data.maxWidth); 66 data.mq = "(min-width:" + data.minWidth + ") and (max-width:" + data.maxWidth + ")"; 67 68 data.customControls = ($.type(data.controls) === "object" && data.controls.previous && data.controls.next); 69 data.customPagination = ($.type(data.pagination) === "string"); 70 71 data.id = this.attr("id"); 72 73 if (data.id) { 74 data.ariaId = data.id; 75 } else { 76 data.ariaId = data.rawGuid; 77 this.attr("id", data.ariaId); 78 } 79 80 // Legacy browser support 81 if (!Formstone.support.transform) { 82 data.useMargin = true; 83 } 84 85 // Build controls and pagination 86 var controlsHtml = '', 87 paginationHtml = '', 88 controlPrevClasses = [RawClasses.control, RawClasses.control_previous].join(" "), 89 controlNextClasses = [RawClasses.control, RawClasses.control_next].join(" "); 90 91 if (data.controls && !data.customControls) { 92 controlsHtml += '<div class="' + RawClasses.controls + '" aria-label="carousel controls" aria-controls="' + data.ariaId + '">'; 93 controlsHtml += '<button type="button" class="' + controlPrevClasses + '" aria-label="Previous">' + data.labels.previous + '</button>'; 94 controlsHtml += '<button type="button" class="' + controlNextClasses + '" aria-label="Next">' + data.labels.next + '</button>'; 95 controlsHtml += '</div>'; 96 } 97 98 if (data.pagination && !data.customPagination) { 99 paginationHtml += '<div class="' + RawClasses.pagination + '" aria-label="carousel pagination" aria-controls="' + data.ariaId + '" role="navigation">'; 100 paginationHtml += '</div>'; 101 } 102 103 if (data.autoHeight) { 104 data.carouselClasses.push(RawClasses.auto_height); 105 } 106 107 if (data.contained) { 108 data.carouselClasses.push(RawClasses.contained); 109 } 110 111 if (data.single) { 112 data.carouselClasses.push(RawClasses.single); 113 } 114 115 // Modify dom 116 this.addClass( data.carouselClasses.join(" ") ) 117 .wrapInner('<div class="' + RawClasses.wrapper + '" aria-live="polite"><div class="' + RawClasses.container + '"><div class="' + RawClasses.canister + '"></div></div></div>') 118 .append(controlsHtml) 119 .wrapInner('<div class="' + RawClasses.viewport + '"></div>') 120 .append(paginationHtml); 121
122 data.$viewport = this.find(Classes.viewport).eq(0); 123 data.$container = this.find(Classes.container).eq(0); 124 data.$canister = this.find(Classes.canister).eq(0); 125 data.$pagination = this.find(Classes.pagination).eq(0); 126 127 data.$controlPrevious = data.$controlNext = $(''); 128 129 if (data.customControls) { 130 data.$controls = $(data.controls.container).addClass( [RawClasses.controls, RawClasses.controls_custom].join(" ") ); 131 data.$controlPrevious = $(data.controls.previous).addClass(controlPrevClasses); 132 data.$controlNext = $(data.controls.next).addClass(controlNextClasses); 133 } else { 134 data.$controls = this.find(Classes.controls).eq(0); 135 data.$controlPrevious = data.$controls.find(Classes.control_previous); 136 data.$controlNext = data.$controls.find(Classes.control_next); 137 } 138 139 data.$controlItems = data.$controlPrevious.add(data.$controlNext); 140 141 if (data.customPagination) { 142 data.$pagination = $(data.pagination).addClass( [RawClasses.pagination] ); 143 } 144 145 data.$paginationItems = data.$pagination.find(Classes.page); 146 147 data.index = 0; 148 data.enabled = false; 149 data.leftPosition = 0; 150 data.autoTimer = null; 151 data.resizeTimer = null; 152 153 // live query for linked to avoid missing new elements 154 var linked = this.data(Namespace + "-linked"); 155 data.linked = linked ? '[data-' + Namespace + '-linked="' + linked + '"]' : false; 156 157 // force paged if linked, keeps counts accurate 158 if (data.linked) { 159 data.paged = true; 160 } 161 162 // live query for controlled to avoid missing new elements 163 var subordinate = this.data(Namespace + "-controller-for") || ''; 164 data.$subordinate = $(subordinate); 165 166 if (data.$subordinate.length) { 167 data.controller = true; 168 } 169 170 // Responsive count handling 171 if ($.type(data.show) === "object") { 172 var show = data.show, 173 cache = [], 174 keys = []; 175 176 for (i in show) { 177 if (show.hasOwnProperty(i)) { 178 keys.push(i); 179 } 180 } 181 182 keys.sort(Functions.sortAsc); 183 184 for (i in keys) { 185 if (keys.hasOwnProperty(i)) { 186 cache.push({ 187 width : parseInt( keys[i] ), 188 count : show[ keys[i] ], 189 mq : window.matchMedia( "(min-width: " + parseInt( keys[i] ) + "px)" ) 190 }); 191 } 192 } 193 194 data.show = cache; 195 } 196 197 cacheValues(data); 198 199 // Media Query support 200 $.fsMediaquery("bind", data.rawGuid, data.mq, { 201 enter: function() { 202 enable.call(data.$el, data); 203 }, 204 leave: function() { 205 disable.call(data.$el, data); 206 } 207 }); 208 209 cacheInstances(); 210 211 data.carouselClasses.push(RawClasses.enabled); 212 data.carouselClasses.push(RawClasses.animated); 213 } 214 215 /** 216 * @method private 217 * @name destruct 218 * @description Tears down instance. 219 * @param data [object] "Instance data" 220 */ 221 222 function destruct(data) { 223 Functions.clearTimer(data.autoTimer); 224 Functions.clearTimer(data.resizeTimer); 225 226 disable.call(this, data); 227 228 $.fsMediaquery("unbind", data.rawGuid); 229 230 if (data.id !== data.ariaId) { 231 this.removeAttr("id"); 232 } 233 234 data.$controlItems.removeClass( [Classes.control, RawClasses.control_previous, Classes.control_next, Classes.visible].join(" ") ) 235 .off(Events.namespace); 236 237 data.$images.off(Events.namespace); 238 data.$canister.fsTouch("destroy"); 239 240 data.$items.removeClass( [RawClasses.item, RawClasses.visible, Classes.item_previous, Classes.item_next].join(" ") ) 241 .unwrap() 242 .unwrap() 243 .unwrap() 244 .unwrap(); 245 246 if (data.controls && !data.customControls) { 247 data.$controls.remove(); 248 } 249 250 if (data.customControls) { 251 data.$controls.removeClass( [RawClasses.controls, RawClasses.controls_custom, RawClasses.visible ].join(" ") ); 252 } 253 254 if (data.pagination && !data.customPagination) { 255 data.$pagination.remove(); 256 } 257 258 if (data.customPagination) { 259 data.$pagination.html("").removeClass( [ RawClasses.pagination, RawClasses.visible ].join(" ") ); 260 } 261 262 this.removeClass(data.carouselClasses.join(" ")); 263 264 cacheInstances(); 265 } 266 267 /** 268 * @method 269 * @name disable 270 * @description Disables instance of plugin 271 * @example $(".target").carousel("disable"); 272 */ 273 274 function disable(data) { 275 if (data.enabled) { 276 Functions.clearTimer(data.autoTimer); 277 278 data.enabled = false;
279 280 data.$subordinate.off(Events.update); 281 282 this.removeClass( [RawClasses.enabled, RawClasses.animated].join(" ") ) 283 .off(Events.namespace); 284 285 data.$canister.fsTouch("destroy") 286 .off(Events.namespace) 287 .attr("style", "") 288 .css(TransitionProperty, "none"); 289 290 data.$items.css({ 291 width: "", 292 height: "" 293 }).removeClass( [RawClasses.visible, Classes.item_previous, Classes.item_next].join(" ") ); 294 295 data.$images.off(Events.namespace); 296 data.$controlItems.off(Events.namespace); 297 data.$pagination.html("").off(Events.namespace); 298 299 hideControls(data); 300 301 if (data.useMargin) { 302 data.$canister.css({ 303 marginLeft: "" 304 }); 305 } else { 306 data.$canister.css(TransformProperty, ""); 307 } 308 309 data.index = 0; 310 } 311 } 312 313 /** 314 * @method 315 * @name enable 316 * @description Enables instance of plugin 317 * @example $(".target").carousel("enable"); 318 */ 319 320 function enable(data) { 321 if (!data.enabled) { 322 data.enabled = true; 323 324 this.addClass(RawClasses.enabled); 325 326 data.$controlItems.on(Events.click, data, onAdvance); 327 data.$pagination.on(Events.click, Classes.page, data, onSelect); 328 329 data.$items.on(Events.click, data, onItemClick); 330 data.$subordinate.on(Events.update, data, onSubordinateUpdate); 331 332 onSubordinateUpdate({ data: data }, 0); 333 334 data.$canister.fsTouch({ 335 axis: "x", 336 pan: true, 337 swipe: true 338 }).on(Events.panStart, data, onPanStart) 339 .on(Events.pan, data, onPan) 340 .on(Events.panEnd, data, onPanEnd) 341 .on(Events.swipe, data, onSwipe) 342 .on(Events.focusIn, data, onItemFocus) 343 .css(TransitionProperty, ""); 344 345 cacheValues(data); 346 347 // Watch Images 348 data.$images.on(Events.load, data, onImageLoad); 349 350 // Auto timer 351 if (data.autoAdvance) { 352 data.autoTimer = Functions.startTimer(data.autoTimer, data.autoTime, function() { 353 autoAdvance(data); 354 }, true); 355 } 356 357 resizeInstance.call(this, data); 358 } 359 } 360 361 /** 362 * @method 363 * @name resize 364 * @description Resizes instance 365 * @example $(".target").carousel("resize"); 366 */ 367 368 /** 369 * @method private 370 * @name resizeInstance 371 * @description Resizes each instance 372 * @param data [object] "Instance data" 373 */ 374 375 function resizeInstance(data) { 376 if (data.enabled) { 377 var h, i, j, k, w, 378 $items, 379 $first, 380 width, 381 height, 382 left; 383 384 data.count = data.$items.length; 385 386 if (data.count < 1) { // avoid empty carousels 387 hideControls(data); 388 data.$canister.css({ 389 height: "" 390 }); 391 392 return; 393 } 394 395 this.removeClass(RawClasses.animated); 396 397 data.containerWidth = data.$container.outerWidth(false); 398 399 data.visible = calculateVisible(data); 400 data.perPage = data.paged ? 1 : data.visible; 401 402 data.itemMarginLeft = parseInt(data.$items.eq(0).css("marginLeft")); 403 data.itemMarginRight = parseInt(data.$items.eq(0).css("marginRight")); 404 405 data.itemMargin = data.itemMarginLeft + data.itemMarginRight; 406 407 if (isNaN(data.itemMargin)) { 408 data.itemMargin = 0; 409 } 410 411 data.itemWidth = (data.containerWidth - (data.itemMargin * (data.visible - 1))) / data.visible; 412 data.itemHeight = 0; 413 414 data.pageWidth = data.paged ? data.itemWidth : data.containerWidth; 415 data.pageCount = Math.ceil(data.count / data.perPage); 416 417 data.canisterWidth = data.single ? data.containerWidth : ((data.pageWidth + data.itemMargin) * data.pageCount); 418 data.$canister.css({ 419 width: (data.matchWidth) ? data.canisterWidth : 1000000, 420 height: "" 421 }); 422 423 data.$items.css({ 424 width: (data.matchWidth) ? data.itemWidth : "", 425 height: "" 426 }).removeClass( [RawClasses.visible, RawClasses.item_previous, RawClasses.item_next].join(" ") ); 427 428 // initial page 429 data.pages = []; 430 431 for (i = 0, j = 0; i < data.count; i += data.perPage) { 432 $items = data.$items.slice(i, i + data.perPage); 433 width = 0; 434 height = 0; 435 436 if ($items.length < data.perPage) { 437 if (i === 0) { 438 $items = data.$items; 439 } else { 440 $items = data.$items.slice(data.$items.length - data.perPage); 441 } 442 } 443 444 $first = data.rtl ? $items.eq( $items.length - 1 ) : $items.eq(0); 445 left = $first.position().left; 446 447 // if (data.autoHeight) { 448 for (k = 0; k < $items.length; k++) { 449 w = $items.eq(k).outerWidth(true); 450 h = $items.eq(k).outerHeight(); 451 452 width += w; 453 454 if (h > height) { 455 height = h; 456 } 457 } 458 // } else { 459 // height = $first.outerHeight(); 460 // } 461 462 data.pages.push({ 463 left : data.rtl ? left - (data.canisterWidth - width) : left, 464 height : height, 465 width : width, 466 $items : $items 467 }); 468 469 if (height > data.itemHeight) { 470 data.itemHeight = height; 471 } 472 473 j++; 474 } 475 476 if (data.paged) { 477 data.pageCount -= (data.count % data.visible); 478 } 479 480 if (data.pageCount <= 0) { 481 data.pageCount = 1; 482 } 483
484 data.maxMove = -data.pages[ data.pageCount - 1 ].left; 485 486 // auto / match height 487 if (data.autoHeight) { 488 data.$canister.css({ 489 height: data.pages[0].height 490 }); 491 } else if (data.matchHeight) { 492 data.$items.css({ 493 height: data.itemHeight 494 }); 495 } 496 497 // Reset Page Count 498 var html = ''; 499 for (i = 0; i < data.pageCount; i++) { 500 html += '<button type="button" class="' + RawClasses.page + '">' + (i + 1) + '</button>'; 501 } 502 data.$pagination.html(html); 503 504 // update pagination 505 if (data.pageCount <= 1) { 506 hideControls(data); 507 } else { 508 showControls(data); 509 } 510 data.$paginationItems = data.$pagination.find(Classes.page); 511 512 positionCanister(data, data.index, false); 513 514 setTimeout(function() { 515 data.$el.addClass(RawClasses.animated); 516 }, 5); 517 } 518 } 519 520 /** 521 * @method private 522 * @name cacheValues 523 * @description Caches internal values after item change 524 * @param data [object] "Instance data" 525 */ 526 527 function cacheValues(data) { 528 // Cache vaules 529 data.$items = data.$canister.children().not(":hidden").addClass(RawClasses.item); 530 data.$images = data.$canister.find("img"); 531 532 data.totalImages = data.$images.length; 533 } 534 535 /** 536 * @method 537 * @name reset 538 * @description Resets instance after item change 539 * @example $(".target").carousel("reset"); 540 */ 541 542 /** 543 * @method private 544 * @name resetInstance 545 * @description Resets instance after item change 546 * @param data [object] "Instance data" 547 */ 548 549 function resetInstance(data) { 550 if (data.enabled) { 551 updateItems.call(this, data, false); 552 } 553 } 554 555 /** 556 * @method 557 * @name update 558 * @description Updates carousel items 559 * @example $(".target").carousel("update", "..."); 560 */ 561 562 /** 563 * @method private 564 * @name updateItems 565 * @description Updates carousel items for each instance 566 * @param data [object] "Instance data" 567 * @param html [string] "New carousel contents" 568 */ 569 570 function updateItems(data, html) { 571 data.$images.off(Events.namespace); 572 573 if (html !== false) { 574 data.$canister.html(html); 575 } 576 577 data.index = 0; 578 579 cacheValues(data); 580 581 resizeInstance.call(this, data); 582 } 583 584 /** 585 * @method 586 * @name jumpPage 587 * @description Jump instance of plugin to specific page 588 * @example $(".target").carousel("jumpPage", 1); 589 * @param index [int] "New index" 590 * @param silent [boolean] "Flag to prevent triggering update event" 591 */ 592 /** 593 * @method 594 * @name jump 595 * @description Jump instance of plugin to specific page; Alias of `jumpPage` 596 * @example $(".target").carousel("jump", 1); 597 * @param index [int] "New index" 598 * @param silent [boolean] "Flag to prevent triggering update event" 599 */ 600 601 /** 602 * @method private 603 * @name jumpPage 604 * @description Jump instance of plugin to specific page 605 * @param data [object] "Instance data" 606 * @param index [int] "New index" 607 * @param silent [boolean] "" 608 * @param animated [boolean] "" 609 */ 610 611 function jumpPage(data, index, silent, fromLinked, animated) { 612 if (data.enabled) { 613 Functions.clearTimer(data.autoTimer); 614 615 if (typeof animated === "undefined") { 616 animated = true; 617 } 618 619 positionCanister(data, index - 1, animated, silent, fromLinked); 620 } 621 } 622 623 /** 624 * @method 625 * @name previousPage 626 * @description Move to the previous page 627 * @example $(".target").carousel("previousPage"); 628 */ 629 /** 630 * @method 631 * @name previous 632 * @description Move to the previous page; Alias of `previousPage` 633 * @example $(".target").carousel("previous"); 634 */ 635 636 /** 637 * @method private 638 * @name previousPage 639 * @description Move to previous page 640 * @param data [object] "Instance data" 641 */ 642 643 function previousPage(data) { 644 var index = data.index - 1; 645 646 if (data.infinite && index < 0) { 647 index = data.pageCount - 1; 648 } 649 650 positionCanister(data, index); 651 } 652 653 /** 654 * @method 655 * @name nextPage 656 * @description Move to next page 657 * @example $(".target").carousel("nextPage"); 658 */ 659 /** 660 * @method 661 * @name next 662 * @description Move to next page; Alias of `nextPage` 663 * @example $(".target").carousel("next"); 664 */ 665 666 /** 667 * @method private 668 * @name nextPage 669 * @description Move to next page 670 * @param data [object] "Instance data" 671 */ 672 673 function nextPage(data) { 674 var index = data.index + 1; 675 676 if (data.infinite && index >= data.pageCount) { 677 index = 0; 678 } 679 680 positionCanister(data, index); 681 } 682 683 684 /** 685 * @method 686 * @name jumpItem 687 * @description Jump instance of plugin to specific item 688 * @example $(".target").carousel("jumpItem", 1); 689 * @param index [int] "New item index" 690 * @param silent [boolean] "Flag to prevent triggering update event" 691 */ 692 693 /** 694 * @method private 695 * @name jumpItem 696 * @description Jump instance of plugin to specific page 697 * @param data [object] "Instance data" 698 * @param index [int] "New index" 699 * @param silent [boolean] "" 700 * @param animated [boolean] "" 701 */ 702 703 function jumpItem(data, index, silent, fromLinked, animated) { 704 if (data.enabled) { 705 Functions.clearTimer(data.autoTimer); 706 707 var $active = data.$items.eq(index - 1); 708 709 if (typeof animated === "undefined") { 710 animated = true; 711 } 712 713 for (var i = 0; i < data.pageCount; i++) { 714 if (data.pages[i].$items.is($active)) { 715 positionCanister(data, i, animated, silent, fromLinked); 716 break; 717 } 718 } 719 } 720 } 721
722 /** 723 * @method private 724 * @name onImageLoad 725 * @description Handles child image load 726 * @param e [object] "Event data" 727 */ 728 729 function onImageLoad(e) { 730 var data = e.data; 731 732 data.resizeTimer = Functions.startTimer(data.resizeTimer, 20, function() { 733 resizeInstance.call(data.$el, data); 734 }); 735 } 736 737 /** 738 * @method private 739 * @name autoAdvance 740 * @description Handles auto advancement 741 * @param data [object] "Instance data" 742 */ 743 744 function autoAdvance(data) { 745 var index = data.index + 1; 746 747 if (index >= data.pageCount) { 748 index = 0; 749 } 750 751 positionCanister(data, index); 752 } 753 754 /** 755 * @method private 756 * @name onAdvance 757 * @description Handles item advancement 758 * @param e [object] "Event data" 759 */ 760 761 function onAdvance(e) { 762 Functions.killEvent(e); 763 764 var data = e.data, 765 index = data.index + ($(e.currentTarget).hasClass(RawClasses.control_next) ? 1 : -1); 766 767 Functions.clearTimer(data.autoTimer); 768 positionCanister(data, index); 769 } 770 771 /** 772 * @method private 773 * @name onSelect 774 * @description Handles item select 775 * @param e [object] "Event data" 776 */ 777 778 function onSelect(e) { 779 Functions.killEvent(e); 780 781 var data = e.data, 782 index = data.$paginationItems.index($(e.currentTarget)); 783 784 Functions.clearTimer(data.autoTimer); 785 positionCanister(data, index); 786 } 787 788 /** 789 * @method private 790 * @name position 791 * @description Handles updating instance position 792 * @param data [object] "Instance data" 793 * @param index [int] "Item index" 794 */ 795 796 function positionCanister(data, index, animate, silent, fromLinked) { 797 if (index < 0) { 798 index = (data.infinite) ? data.pageCount-1 : 0; 799 } 800 if (index >= data.pageCount) { 801 index = (data.infinite) ? 0 : data.pageCount-1; 802 } 803 804 if (data.count < 1) { 805 return; 806 } 807 808 if (data.pages[index]) { 809 data.leftPosition = -data.pages[index].left; 810 } 811 812 data.leftPosition = checkPosition(data, data.leftPosition); 813 814 if (data.useMargin) { 815 data.$canister.css({ 816 marginLeft: data.leftPosition 817 }); 818 } else { 819 if (animate === false) { 820 data.$canister.css(TransitionProperty, "none") 821 .css(TransformProperty, "translateX(" + data.leftPosition + "px)"); 822 823 // Slight delay before adding transitions back 824 setTimeout(function() { 825 data.$canister.css(TransitionProperty, ""); 826 }, 5); 827 } else { 828 data.$canister.css(TransformProperty, "translateX(" + data.leftPosition + "px)"); 829 } 830 } 831 832 // Update classes 833 data.$items.removeClass( [RawClasses.visible, RawClasses.item_previous, RawClasses.item_next].join(" ") ); 834 835 for (var i = 0, count = data.pages.length; i < count; i++) { 836 if (i === index) { 837 data.pages[i].$items.addClass(RawClasses.visible).attr("aria-hidden", "false"); 838 } else { 839 data.pages[i].$items.not( data.pages[index].$items ).addClass( (i < index) ? RawClasses.item_previous : RawClasses.item_next ).attr("aria-hidden", "true"); 840 } 841 } 842 843 // Auto Height 844 if (data.autoHeight) { 845 data.$canister.css({ 846 height: data.pages[index].height 847 }); 848 } 849 850 if (animate !== false && silent !== true && index !== data.index && (data.infinite || (index > -1 && index < data.pageCount)) ) { 851 data.$el.trigger(Events.update, [ index ]); 852 } 853 854 data.index = index; 855 856 // Linked 857 if (data.linked && fromLinked !== true) { 858 $(data.linked).not(data.$el)[NamespaceClean]("jumpPage", data.index + 1, true, true); 859 } 860 861 updateControls(data); 862 } 863 864 /** 865 * @method private 866 * @name hideControls 867 * @description Hides instance controls 868 * @param data [object] "Instance data" 869 */ 870 871 function hideControls(data) { 872 data.$controls.removeClass(RawClasses.visible); 873 data.$controlItems.removeClass(RawClasses.visible); 874 data.$pagination.removeClass(RawClasses.visible); 875 } 876 877 /** 878 * @method private 879 * @name showControls 880 * @description Shows instance controls 881 * @param data [object] "Instance data" 882 */ 883 884 function showControls(data) { 885 data.$controls.addClass(RawClasses.visible); 886 data.$controlItems.addClass(RawClasses.visible); 887 data.$pagination.addClass(RawClasses.visible); 888 } 889 890 /** 891 * @method private 892 * @name updateControls 893 * @description Handles updating instance controls 894 * @param data [object] "Instance data" 895 */ 896 897 function updateControls(data) { 898 data.$paginationItems.removeClass(RawClasses.active) 899 .eq(data.index) 900 .addClass(RawClasses.active); 901 902 if (data.infinite) { 903 data.$controlItems.addClass(RawClasses.visible); 904 } else if (data.pageCount < 1) { 905 data.$controlItems.removeClass(RawClasses.visible); 906 } else { 907 data.$controlItems.addClass(RawClasses.visible); 908 909 if (data.index <= 0) { 910 data.$controlPrevious.removeClass(RawClasses.visible); 911 } else if (data.index >= data.pageCount - 1 || (!data.single && data.leftPosition === data.maxMove)) { 912 data.$controlNext.removeClass(RawClasses.visible); 913 } 914 } 915 } 916
917 /** 918 * @method private 919 * @name calculateVisible 920 * @description Determines how many items should show at screen width 921 * @param data [object] "Instance data" 922 * @return [int] "New visible count" 923 */ 924 925 function calculateVisible(data) { 926 var show = 1; 927 928 if (data.single) { 929 return show; 930 } else if ($.type(data.show) === "array") { 931 for (var i in data.show) { 932 if (data.show.hasOwnProperty(i)) { 933 if (Formstone.support.nativeMatchMedia) { 934 if (data.show[i].mq.matches) { 935 show = data.show[i].count; 936 } 937 } else { 938 // ie8 fallback, grab the first breakpoint that's large enough 939 if (data.show[i].width < Formstone.fallbackWidth) { 940 show = data.show[i].count; 941 } 942 } 943 } 944 } 945 } else { 946 show = data.show; 947 } 948 949 return (data.fill && data.count < show) ? data.count : show; 950 } 951 952 /** 953 * @method private 954 * @name onPanStart 955 * @description Handles pan start event 956 * @param e [object] "Event data" 957 */ 958 959 function onPanStart(e, fromLinked) { 960 var data = e.data; 961 962 Functions.clearTimer(data.autoTimer); 963 964 if (!data.single) { 965 if (data.useMargin) { 966 data.leftPosition = parseInt(data.$canister.css("marginLeft")); 967 } else { 968 var matrix = data.$canister.css(TransformProperty).split(","); 969 data.leftPosition = parseInt(matrix[4]); // ? 970 } 971 972 data.$canister.css(TransitionProperty, "none"); 973 974 onPan(e); 975 976 // Linked 977 if (data.linked && fromLinked !== true) { 978 var percent = e.deltaX / data.pageWidth; 979 980 if (data.rtl) { 981 percent *= -1; 982 } 983 984 $(data.linked).not(data.$el)[NamespaceClean]("panStart", percent); 985 } 986 } 987 988 data.isTouching = true; 989 } 990 991 /** 992 * @method private 993 * @name onPan 994 * @description Handles pan event 995 * @param e [object] "Event data" 996 */ 997 998 function onPan(e, fromLinked) { 999 var data = e.data; 1000 1001 if (!data.single) { 1002 data.touchLeft = checkPosition(data, data.leftPosition + e.deltaX); 1003 1004 if (data.useMargin) { 1005 data.$canister.css({ 1006 marginLeft: data.touchLeft 1007 }); 1008 } else { 1009 data.$canister.css(TransformProperty, "translateX(" + data.touchLeft + "px)"); 1010 } 1011 1012 // Linked 1013 if (data.linked && fromLinked !== true) { 1014 var percent = e.deltaX / data.pageWidth; 1015 1016 if (data.rtl) { 1017 percent *= -1; 1018 } 1019 1020 $(data.linked).not(data.$el)[NamespaceClean]("pan", percent); 1021 } 1022 } 1023 } 1024 1025 /** 1026 * @method private 1027 * @name onPanEnd 1028 * @description Handles pan end event 1029 * @param e [object] "Event data" 1030 */ 1031 1032 function onPanEnd(e, fromLinked) { 1033 var data = e.data, 1034 delta = Math.abs(e.deltaX), 1035 increment = getIncrement(data, e), 1036 index = false; 1037 1038 data.didPan = false; 1039 1040 if (!data.single) { 1041 var i, count, 1042 left = Math.abs(data.touchLeft), 1043 page = false, 1044 dir = (data.rtl) ? "right" : "left"; 1045 1046 if (e.directionX === dir) { 1047 // Left (RTL Right) 1048 for (i = 0, count = data.pages.length; i < count; i++) { 1049 page = data.pages[i]; 1050 1051 if (left > Math.abs(page.left) + 20) { 1052 index = i + 1; 1053 } 1054 } 1055 } else { 1056 // Right (RTL Left) 1057 for (i = data.pages.length - 1, count = 0; i >= count; i--) { 1058 page = data.pages[i]; 1059 1060 if (left < Math.abs(page.left)) { 1061 index = i - 1; 1062 } 1063 } 1064 } 1065 } 1066 1067 if (index === false) { 1068 index = (delta < 50) ? data.index : data.index + increment; 1069 } 1070 1071 if (index !== data.index) { 1072 data.didPan = true; 1073 } 1074 1075 // Linked 1076 if (data.linked && fromLinked !== true) { 1077 $(data.linked).not(data.$el)[NamespaceClean]("panEnd", index); 1078 } 1079 1080 endTouch(data, index); 1081 } 1082 1083 /** 1084 * @method private 1085 * @name linkedPanStart 1086 * @description Handles linked pan start 1087 * @param data [object] "Instance data" 1088 * @param percent [float] "Percentage moved" 1089 */ 1090 1091 function linkedPanStart(data, percent) { 1092 Functions.clearTimer(data.autoTimer); 1093 1094 if (!data.single) { 1095 if (data.rtl) { 1096 percent *= -1; 1097 } 1098 1099 if (data.useMargin) { 1100 data.leftPosition = parseInt(data.$canister.css("marginLeft")); 1101 } else { 1102 var matrix = data.$canister.css(TransformProperty).split(","); 1103 data.leftPosition = parseInt(matrix[4]); // ? 1104 } 1105 1106 data.$canister.css(TransitionProperty, "none"); 1107 1108 var e = { 1109 data: data, 1110 deltaX: (data.pageWidth * percent) 1111 }; 1112 1113 onPan(e, true); 1114 } 1115 1116 data.isTouching = true; 1117 } 1118 1119 /** 1120 * @method private 1121 * @name linkedPan 1122 * @description Handles linked pan 1123 * @param data [object] "Instance data" 1124 * @param percent [float] "Percentage moved" 1125 */ 1126 1127 function linkedPan(data, percent) { 1128 if (!data.single) { 1129 if (data.rtl) { 1130 percent *= -1; 1131 } 1132 1133 var delta = (data.pageWidth * percent); 1134 1135 data.touchLeft = checkPosition(data, data.leftPosition + delta); 1136 1137 if (data.useMargin) { 1138 data.$canister.css({ 1139 marginLeft: data.touchLeft 1140 }); 1141 } else {
1142 data.$canister.css(TransformProperty, "translateX(" + data.touchLeft + "px)"); 1143 } 1144 } 1145 } 1146 1147 /** 1148 * @method private 1149 * @name linkedPanEnd 1150 * @description Handles linked pan end 1151 * @param data [object] "Instance data" 1152 * @param index [int] "New Index" 1153 */ 1154 1155 function linkedPanEnd(data, index) { 1156 endTouch(data, index, true); 1157 } 1158 1159 /** 1160 * @method private 1161 * @name onSwipe 1162 * @description Handles swipe event 1163 * @param e [object] "Event data" 1164 */ 1165 1166 function onSwipe(e, fromLinked) { 1167 var data = e.data, 1168 increment = getIncrement(data, e), 1169 index = data.index + increment; 1170 1171 // Linked 1172 if (data.linked && fromLinked !== true) { 1173 $(data.linked).not(data.$el)[NamespaceClean]("swipe", e.directionX); 1174 } 1175 1176 endTouch(data, index); 1177 } 1178 1179 /** 1180 * @method private 1181 * @name linkedSwipe 1182 * @description Handles swipe event 1183 * @param data [object] "Instance data" 1184 * @param direction [string] "Swipe direction" 1185 */ 1186 1187 function linkedSwipe(data, direction) { 1188 var e = { 1189 data: data, 1190 directionX: direction 1191 }; 1192 1193 onSwipe(e, true); 1194 } 1195 1196 /** 1197 * @method private 1198 * @name endTouch 1199 * @description Cleans up touch interactions 1200 * @param data [object] "Instance data" 1201 * @param index [object] "New index" 1202 */ 1203 1204 function endTouch(data, index) { 1205 data.$canister.css(TransitionProperty, ""); 1206 1207 positionCanister(data, index); 1208 1209 data.isTouching = false; 1210 } 1211 1212 /** 1213 * @method private 1214 * @name onItemClick 1215 * @description Handles click to item 1216 * @param e [object] "Event data" 1217 */ 1218 1219 function onItemClick(e) { 1220 var data = e.data, 1221 $target = $(e.currentTarget); 1222 1223 if (!data.didPan) { 1224 $target.trigger(Events.itemClick); 1225 1226 if (data.controller) { 1227 var index = data.$items.index($target); 1228 1229 onSubordinateUpdate(e, index); 1230 1231 data.$subordinate[NamespaceClean]("jumpPage", index + 1, true); 1232 } 1233 } 1234 } 1235 1236 /** 1237 * @method private 1238 * @name onItemFocus 1239 * @description Handles focus to item/element in item 1240 * @param e [object] "Event data" 1241 */ 1242 1243 function onItemFocus(e) { 1244 var data = e.data; 1245 1246 if (data.enabled && !data.isTouching) { 1247 Functions.clearTimer(data.autoTimer); 1248 1249 data.$container.scrollLeft(0); 1250 1251 var $target = $(e.target), 1252 $active; 1253 1254 if ( $target.hasClass(RawClasses.item) ) { 1255 $active = $target; 1256 } else if ($target.parents(Classes.item).length) { 1257 $active = $target.parents(Classes.item).eq(0); 1258 } 1259 1260 for (var i = 0; i < data.pageCount; i++) { 1261 if (data.pages[i].$items.is($active)) { 1262 positionCanister(data, i); 1263 break; 1264 } 1265 } 1266 } 1267 } 1268 1269 /** 1270 * @method private 1271 * @name onSubordinateUpdate 1272 * @description Handles update from subordinate 1273 * @param e [object] "Event data" 1274 * @param index [int] "Index" 1275 */ 1276 1277 function onSubordinateUpdate(e, index) { 1278 var data = e.data; 1279 1280 if (data.controller) { 1281 var $active = data.$items.eq(index); 1282 1283 data.$items.removeClass(RawClasses.active); 1284 $active.addClass(RawClasses.active); 1285 1286 for (var i = 0; i < data.pageCount; i++) { 1287 if (data.pages[i].$items.is($active)) { 1288 positionCanister(data, i, true, true); 1289 break; 1290 } 1291 } 1292 } 1293 } 1294 1295 /** 1296 * @method private 1297 * @name checkPosition 1298 * @description Checks if left pos is in range 1299 * @param data [object] "Event data" 1300 * @param e [object] "Event data" 1301 * @return [int] "Corrected left position" 1302 */ 1303 1304 function checkPosition(data, pos) { 1305 if (isNaN(pos)) { 1306 pos = 0; 1307 } else if (data.rtl) { 1308 if (pos > data.maxMove) { 1309 pos = data.maxMove; 1310 } 1311 if (pos < 0) { 1312 pos = 0; 1313 } 1314 } else { 1315 if (pos < data.maxMove) { 1316 pos = data.maxMove; 1317 } 1318 if (pos > 0) { 1319 pos = 0; 1320 } 1321 } 1322 1323 return pos; 1324 } 1325 1326 /** 1327 * @method private 1328 * @name getIncrement 1329 * @description Returns touch increment 1330 * @param data [object] "Instance data" 1331 * @param e [object] "Event data" 1332 * @return [int] "Target direction" 1333 */ 1334 1335 function getIncrement(data, e) { 1336 return data.rtl ? ((e.directionX === "right") ? 1 : -1) : ((e.directionX === "left") ? 1 : -1); 1337 } 1338 1339 /** 1340 * @plugin 1341 * @name Carousel
1342 * @description A jQuery plugin for simple content carousels. 1343 * @type widget 1344 * @main carousel.js 1345 * @main carousel.css 1346 * @dependency jQuery 1347 * @dependency core.js 1348 * @dependency mediaquery.js 1349 * @dependency touch.js 1350 */ 1351 1352 var Plugin = Formstone.Plugin("carousel", { 1353 widget: true, 1354 1355 /** 1356 * @options 1357 * @param autoAdvance [boolean] <false> "Flag to auto advance items" 1358 * @param autoHeight [boolean] <false> "Flag to adjust carousel height to visible item(s)" 1359 * @param autoTime [int] <8000> "Auto advance time" 1360 * @param contained [boolean] <true> "Flag for 'overflow: visible'" 1361 * @param controls [boolean or object] <true> "Flag to draw controls OR object containing container, next and previous control selectors (Must be fully qualified selectors)" 1362 * @param customClass [string] <''> "Class applied to instance" 1363 * @param fill [boolean] <false> "Flag to fill viewport if item count is less then show count" 1364 * @param infinite [boolean] <false> "Flag for looping items" 1365 * @param labels.next [string] <'Next'> "Control text" 1366 * @param labels.previous [string] <'Previous'> "Control text" 1367 * @param matchHeight [boolean] <false> "Flag to match item heights" 1368 * @param matchWidth [boolean] <true> "Flag to match item widths; Requires CSS widths if false" 1369 * @param maxWidth [string] <'Infinity'> "Width at which to auto-disable plugin" 1370 * @param minWidth [string] <'0'> "Width at which to auto-disable plugin" 1371 * @param paged [boolean] <false> "Flag for paged items" 1372 * @param pagination [boolean or string] <true> "Flag to draw pagination OR string containing pagination target selector (Must be fully qualified selector)" 1373 * @param rtl [boolean] <false> "Right to Left display" 1374 * @param show [int / object] <1> "Items visible per page; Object for responsive counts" 1375 * @param single [boolean] <false> "Flag to display single item at a time" 1376 * @param theme [string] <"fs-light"> "Theme class name" 1377 * @param useMargin [boolean] <false> "Use margins instead of css transitions (legacy browser support)" 1378 */ 1379 1380 defaults: { 1381 autoAdvance : false, 1382 autoHeight : false, 1383 autoTime : 8000, 1384 contained : true, 1385 controls : true, 1386 customClass : "", 1387 fill : false, 1388 infinite : false, 1389 labels: { 1390 next : "Next", 1391 previous : "Previous" 1392 }, 1393 matchHeight : false, 1394 matchWidth : true, 1395 maxWidth : Infinity, 1396 minWidth : '0px', 1397 paged : false, 1398 pagination : true, 1399 rtl : false, 1400 show : 1, 1401 single : false, 1402 theme : "fs-light", 1403 useMargin : false 1404 }, 1405 1406 classes: [ 1407 "ltr", 1408 "rtl", 1409 1410 "viewport", 1411 "wrapper", 1412 "container", 1413 "canister", 1414 1415 "item", 1416 "item_previous", 1417 "item_next", 1418 1419 "controls", 1420 "controls_custom", 1421 1422 "control", 1423 "control_previous", 1424 "control_next", 1425 1426 "pagination", 1427 "page", 1428 1429 "animated", 1430 "enabled", 1431 "visible", 1432 "active", 1433 "auto_height", 1434 "contained", 1435 "single" 1436 ], 1437 1438 /** 1439 * @events 1440 * @event itemClick.carousel "Item clicked; Triggered on carousel item" 1441 * @event update.carousel "Carousel position updated" 1442 */ 1443 1444 events: { 1445 itemClick : "itemClick", 1446 update : "update" 1447 }, 1448 1449 methods: { 1450 _construct : construct, 1451 _destruct : destruct, 1452 _resize : resize, 1453 1454 disable : disable, 1455 enable : enable, 1456 1457 // Backwards compat? 1458 jump : jumpPage, 1459 previous : previousPage, 1460 next : nextPage, 1461 // Pages 1462 jumpPage : jumpPage, 1463 previousPage : previousPage, 1464 nextPage : nextPage, 1465 // Items 1466 jumpItem : jumpItem, 1467 1468 reset : resetInstance, 1469 resize : resizeInstance, 1470 update : updateItems, 1471 1472 panStart : linkedPanStart, 1473 pan : linkedPan, 1474 panEnd : linkedPanEnd, 1475 swipe : linkedSwipe 1476 } 1477 }), 1478 1479 // Localize References 1480 1481 Namespace = Plugin.namespace, 1482 NamespaceClean = Plugin.namespaceClean, 1483 Classes = Plugin.classes, 1484 RawClasses = Classes.raw, 1485 Events = Plugin.events, 1486 Functions = Plugin.functions, 1487 1488 $Instances = [], 1489 1490 TransformProperty = Formstone.transform, 1491 TransitionProperty = Formstone.transition; 1492 1493}) 1494 1495); 1496
1497/*! formstone v1.4.22 [checkbox.js] 2021-10-01 | GPL-3.0 License | formstone.it */ 1498!function(e){"function"==typeof define&&define.amd?define(["jquery","./core"],e):e(jQuery,Formstone)}(function(c,e){"use strict";function o(e){var a=e.data;c(e.target).is(a.$el)||(e.preventDefault(),a.$el.trigger("click"))}function i(e){var a=e.data,s=a.$el.is(":disabled"),l=a.$el.is(":checked");s||(a.radio?l&&t(e):l?t(e):n(e))}function t(e){e.data.radio&&c('input[name="'+e.data.group+'"]').not(e.data.$el).trigger("deselect"),e.data.$el.trigger(u.focus),e.data.$classable.addClass(h.checked)}function n(e){e.data.$classable.removeClass(h.checked)}function r(e){e.data.$classable.addClass(h.focus)}function b(e){e.data.$classable.removeClass(h.focus)}var a=e.Plugin("checkbox",{widget:!0,defaults:{customClass:"",toggle:!1,labels:{on:"ON",off:"OFF"},theme:"fs-light"},classes:["element_placeholder","label","marker","flag","radio","focus","checked","disabled","toggle","state","state_on","state_off"],methods:{_construct:function(e){var a=this.closest("label"),s=a.length?a.eq(0):c('label[for="'+this.attr("id")+'"]'),l=[h.base,e.theme,e.customClass].join(" "),t=[h.label,e.theme,e.customClass].join(" "),d="";e.radio="radio"===this.attr("type"),e.group=this.attr("name"),d+='<div class="'+h.marker+'" aria-hidden="true">',d+='<div class="'+h.flag+'"></div>',e.toggle&&(l+=" "+h.toggle,t+=" "+h.toggle,d+='<span class="'+[h.state,h.state_on].join(" ")+'">'+e.labels.on+"</span>",d+='<span class="'+[h.state,h.state_off].join(" ")+'">'+e.labels.off+"</span>"),e.radio&&(l+=" "+h.radio,t+=" "+h.radio),d+="</div>",e.$placeholder=c('<span class="'+h.element_placeholder+'"></span>'),this.before(e.$placeholder),e.labelParent=s.find(this).length,e.labelClass=t,s.addClass(t),e.labelParent?s.wrap('<div class="'+l+'"></div>').before(d):this.before('<div class=" '+l+'">'+d+"</div>"),e.$checkbox=e.labelParent?s.parents(f.base):this.prev(f.base),e.$marker=e.$checkbox.find(f.marker),e.$states=e.$checkbox.find(f.state),e.$label=s,e.$classable=c().add(e.$checkbox).add(e.$label),this.is(":checked")&&e.$classable.addClass(h.checked),this.is(":disabled")&&e.$classable.addClass(h.disabled),this.appendTo(e.$marker),this.on(u.focus,e,r).on(u.blur,e,b).on(u.change,e,i).on(u.click,e,o).on(u.deselect,e,n),e.$checkbox.on(u.click,e,o)},_destruct:function(e){e.$checkbox.off(u.namespace),e.$marker.remove(),e.$states.remove(),e.$label.removeClass(e.labelClass),e.labelParent?e.$label.unwrap():this.unwrap(),e.$placeholder.before(this),e.$placeholder.remove(),this.off(u.namespace)},enable:function(e){this.prop("disabled",!1),e.$classable.removeClass(h.disabled)},disable:function(e){this.prop("disabled",!0),e.$classable.addClass(h.disabled)},update:function(e){var a=e.$el.is(":disabled"),s=e.$el.is(":checked");a||(s?t({data:e}):n({data:e}))}},events:{deselect:"deselect"}}),f=a.classes,h=f.raw,u=a.events;a.functions}); 1499/*! formstone v1.4.22 [cookie.js] 2021-10-01 | GPL-3.0 License | formstone.it */ 1500!function(e){"function"==typeof define&&define.amd?define(["jquery","./core"],e):e(jQuery,Formstone)}(function(t,e){"use strict";function r(e,n,i){var t=!1,r=new Date;i.expires&&"number"==typeof i.expires&&(r.setTime(r.getTime()+i.expires),t=r.toGMTString());var o=i.domain?"; domain="+i.domain:"",u=t?"; expires="+t:"",l=t?"; max-age="+i.expires/1e3:"",s=i.path?"; path="+i.path:"",f=i.secure?"; secure":"";a.cookie=e+"="+n+u+l+o+s+f}e.Plugin("cookie",{utilities:{_delegate:function(e,n,i){if("object"==typeof e)o=t.extend(o,e);else if(i=t.extend({},o,i||{}),void 0!==e){if(void 0===n)return function(e){for(var n=e+"=",i=a.cookie.split(";"),t=0;t<i.length;t++){for(var r=i[t];" "===r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(n))return r.substring(n.length,r.length)}return null}(e);null===n?function(e,n){r(e,"",t.extend({},n,{expires:-6048e5}))}(e,i):r(e,n,i)}return null}}});var o={domain:null,expires:6048e5,path:null,secure:null},a=e.document}); 1501/*! formstone v1.4.22 [dropdown.js] 2021-10-01 | GPL-3.0 License | formstone.it */ 1502!function(e){"function"==typeof define&&define.amd?define(["jquery","./core","./scrollbar","./touch"],e):e(jQuery,Formstone)}(function(c,u){"use strict";function f(e){for(var t="",l=0,i=e.$allOptions.length;l<i;l++){var s=e.$allOptions.eq(l),o=[];if("OPTGROUP"===s[0].tagName)o.push(I.group),s.prop("disabled")&&o.push(I.disabled),t+='<span class="'+o.join(" ")+'">'+s.attr("label")+"</span>";else{var a=s.val(),d=s.data("label"),n=e.links?"a":'button type="button"';s.attr("value")||s.attr("value",a),o.push(I.item),s.hasClass(I.item_placeholder)&&(o.push(I.item_placeholder),n="span"),s.prop("selected")&&o.push(I.item_selected),s.prop("disabled")&&o.push(I.item_disabled),t+="<"+n+' class="'+o.join(" ")+'"',e.links?"span"===n?t+=' aria-hidden="true"':(t+=' href="'+a+'"',e.external&&(t+=' target="_blank"')):t+=' data-value="'+a+'"',t+=' role="option"',s.prop("selected")&&(t+=' "aria-selected"="true"'),t+=">",t+=d||r.decodeEntities(g(s.text(),e.trim)),t+="</"+n+">",0}}e.$items=e.$wrapper.html(c.parseHTML(t)).find(C.item)}function m(e){r.killEvent(e);var t=e.data;t.disabled||t.useNative||(t.closed?i(t):a(t)),l(t)}function l(e){c(C.base).not(e.$dropdown).trigger(k.close,[e])}function i(e){if(e.closed){var t=_.height(),l=e.$wrapper.outerHeight(!0);e.$dropdown[0].getBoundingClientRect().bottom+l>
1502t-e.bottomEdge&&e.$dropdown.addClass(I.bottom),y.on(k.click+e.dotGuid,":not("+C.options+")",e,s),e.$dropdown.trigger(k.focusIn),e.$dropdown.addClass(I.open),d(e),e.closed=!1}}function a(e){e&&!e.closed&&(y.off(k.click+e.dotGuid),e.$dropdown.removeClass([I.open,I.bottom].join(" ")),e.closed=!0)}function s(e){r.killEvent(e);var t=e.data;t&&0===c(e.currentTarget).parents(C.base).length&&(a(t),t.$dropdown.trigger(k.focusOut))}function b(e){var t=e.data;t&&(a(t),t.$dropdown.trigger(k.focusOut))}function $(e){var t=c(this),l=e.data;if(r.killEvent(e),!l.disabled){var i=l.$items.index(t);l.focusIndex=i,l.$wrapper.is(":visible")&&(w(i,l,e.shiftKey,e.metaKey||e.ctrlKey),n(l)),l.multiple||a(l),l.$dropdown.trigger(k.focus)}}function v(e,t){c(this);var l=e.data;if(!t&&!l.multiple){var i=l.$options.index(l.$options.filter(":selected"));w(l.focusIndex=i,l),n(l,!0)}}function h(e){r.killEvent(e);c(e.currentTarget);var t=e.data;t.disabled||t.multiple||t.focused||(l(t),t.focused=!0,t.focusIndex=t.index,t.input="",t.$dropdown.addClass(I.focus).on(k.keyDown+t.dotGuid,t,o))}function x(e){r.killEvent(e);c(e.currentTarget);var t=e.data;t.focused&&t.closed&&(t.focused=!1,t.$dropdown.removeClass(I.focus).off(k.keyDown+t.dotGuid),t.multiple||(a(t),t.index!==t.focusIndex&&(n(t),t.focusIndex=t.index)))}function o(e){var t=e.data;if(t.keyTimer=r.startTimer(t.keyTimer,1e3,function(){t.input=""}),13===e.keyCode)t.closed||(a(t),w(t.index,t)),n(t);else if(!(9===e.keyCode||e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)){r.killEvent(e);var l=t.$items.length-1,i=t.index<0?0:t.index;if(-1<c.inArray(e.keyCode,u.isFirefox?[38,40,37,39]:[38,40]))(i+=38===e.keyCode||u.isFirefox&&37===e.keyCode?-1:1)<0&&(i=0),l<i&&(i=l);else{var s,o=String.fromCharCode(e.keyCode).toUpperCase();for(t.input+=o,s=t.index+1;s<=l;s++)if(t.$options.eq(s).text().substr(0,t.input.length).toUpperCase()===t.input){i=s;break}if(i<0||i===t.index)for(s=0;s<=l;s++)if(t.$options.eq(s).text().substr(0,t.input.length).toUpperCase()===t.input){i=s;break}}0<=i&&(w(i,t),d(t))}}function w(e,t,l,i){var s=t.$items.eq(e),o=t.$options.eq(e),a=s.hasClass(I.item_selected);if(!s.hasClass(I.item_disabled))if(t.multiple)if(t.useNative)a?(o.prop("selected",null).attr("aria-selected",null),s.removeClass(I.item_selected)):(o.prop("selected",!0).attr("aria-selected",!0),s.addClass(I.item_selected));else if(l&&!1!==t.lastIndex){var d=t.lastIndex>e?e:t.lastIndex,n=(t.lastIndex>e?t.lastIndex:e)+1;t.$options.prop("selected",null).attr("aria-selected",null),t.$items.filter(C.item_selected).removeClass(I.item_selected),t.$options.slice(d,n).not("[disabled]").prop("selected",!0),t.$items.slice(d,n).not(C.item_disabled).addClass(I.item_selected)}else i||t.selectMultiple?a?(o.prop("selected",null).attr("aria-selected",null),s.removeClass(I.item_selected)):(o.prop("selected",!0).attr("aria-selected",!0),s.addClass(I.item_selected)):(t.$options.prop("selected",null).attr("aria-selected",null),t.$items.filter(C.item_selected).removeClass(I.item_selected),o.prop("selected",!0).attr("aria-selected",!0),s.addClass(I.item_selected)),t.lastIndex=e;else if(-1<e&&e<t.$items.length){if(e!==t.index){var r=o.data("label")||s.html();t.$selected.html(r).removeClass(C.item_placeholder),t.$items.filter(C.item_selected).removeClass(I.item_selected),t.$el[0].selectedIndex=e,s.addClass(I.item_selected),t.index=e}}else""!==t.label&&t.$selected.html(t.label)}function d(e){var t=e.$items.eq(e.index),l=0<=e.index&&!t.hasClass(I.item_placeholder)?t.position():{left:0,top:0},i=(e.$wrapper.outerHeight()-t.outerHeight())/2;void 0!==c.fn.fsScrollbar?e.$wrapper.fsScrollbar("resize").fsScrollbar("scroll",e.$wrapper.find(".fs-scrollbar-content").scrollTop()+l.top):e.$wrapper.scrollTop(e.$wrapper.scrollTop()+l.top-i)}function n(e,t){e.links?function(e){var t=e.$el.val();e.external?p.open(t):p.location.href=t}(e):t||e.$el.trigger(k.raw.change,[!0])}function g(e,t){return 0===t?e:e.length>t?e.substring(0,t)+"...":e}var e=u.Plugin("dropdown",{widget:!0,defaults:{bottomEdge:0,cover:!1,customClass:"",label:"",external:!1,links:!1,mobile:!1,native:!1,theme:"fs-light",trim:0,selectMultiple:!1},methods:{_construct:function(e){e.multiple=this.prop("multiple"),e.disabled=this.prop("disabled")||this.is("[readonly]"),e.lastIndex=!1,e.native=e.mobile||e.native,e.useNative=e.native||u.isMobile,e.multiple?e.links=!1:e.external&&(e.links=!0);var t=this.find("[selected]").not(":disabled"),l=this.find(":selected").not(":disabled"),i=l.text(),s=this.find("option").index(l);e.multiple||""===e.label||t.length?e.label="":(l=this.prepend('<option value="" class="'+
1502I.item_placeholder+'" selected>'+e.label+"</option>"),i=e.label,s=0);var o=this.find("option, optgroup"),a=o.filter("option"),d=c('[for="'+this.attr("id")+'"]');e.tabIndex=this[0].tabIndex,this[0].tabIndex=-1,d.length&&(d[0].tabIndex=-1);var n=[I.base,e.theme,e.customClass];e.useNative?n.push(I.native):e.cover&&n.push(I.cover),e.multiple&&n.push(I.multiple),e.disabled&&n.push(I.disabled),e.id=this.attr("id"),e.id?e.ariaId=e.id:e.ariaId=e.rawGuid,e.ariaId+="-dropdown",e.selectedAriaId=e.ariaId+"-selected";var r="",p="";r+='<div class="'+n.join(" ")+'"id="'+e.ariaId+'" tabindex="'+e.tabIndex+'" role="listbox"',e.multiple?r+=' aria-label="multi select"':r+=' aria-haspopup="true" aria-live="polite" aria-labelledby="'+e.selectedAriaId+'"',r+="></div>",e.multiple||(p+='<button type="button" class="'+I.selected+'" id="'+e.selectedAriaId+'" tabindex="-1">',p+=c("<span></span>").text(g(i,e.trim)).html(),p+="</button>"),p+='<div class="'+I.options+'">',p+="</div>",this.wrap(r).after(p),e.$dropdown=this.parent(C.base),e.$label=d,e.$allOptions=o,e.$options=a,e.$selected=e.$dropdown.find(C.selected),e.$wrapper=e.$dropdown.find(C.options),e.$placeholder=e.$dropdown.find(C.placeholder),e.index=-1,e.closed=!0,e.focused=!1,f(e),e.multiple||w(s,e),void 0!==c.fn.fsScrollbar&&e.$wrapper.fsScrollbar({theme:e.theme}).find(".fs-scrollbar-content").attr("tabindex",null),e.$dropdown.on(k.click,e,m),e.$selected.on(k.click,e,m),e.$dropdown.on(k.click,C.item,e,$).on(k.close,e,b),this.on(k.change,e,v),e.useNative||(this.on(k.focusIn,e,function(e){e.data.$dropdown.trigger(k.raw.focus)}),e.$dropdown.on(k.focusIn,e,h).on(k.focusOut,e,x))},_destruct:function(e){e.$dropdown.hasClass(I.open)&&e.$selected.trigger(k.click),void 0!==c.fn.fsScrollbar&&e.$wrapper.fsScrollbar("destroy"),e.$el[0].tabIndex=e.tabIndex,e.$label.length&&(e.$label[0].tabIndex=e.tabIndex),e.$dropdown.off(k.namespace),e.$options.off(k.namespace),e.$placeholder.remove(),e.$selected.remove(),e.$wrapper.remove(),e.$el.off(k.namespace).show().unwrap()},disable:function(e,t){if(void 0!==t){var l=e.$items.index(e.$items.filter("[data-value="+t+"]"));e.$items.eq(l).addClass(I.item_disabled),e.$options.eq(l).prop("disabled",!0)}else e.$dropdown.hasClass(I.open)&&e.$selected.trigger(k.click),e.$dropdown.addClass(I.disabled),e.$el.prop("disabled",!0),e.disabled=!0},enable:function(e,t){if(void 0!==t){var l=e.$items.index(e.$items.filter("[data-value="+t+"]"));e.$items.eq(l).removeClass(I.item_disabled),e.$options.eq(l).prop("disabled",!1)}else e.$dropdown.removeClass(I.disabled),e.$el.prop("disabled",!1),e.disabled=!1},update:function(e){void 0!==c.fn.fsScrollbar&&e.$wrapper.fsScrollbar("destroy");var t=e.index;e.$allOptions=e.$el.find("option, optgroup"),e.$options=e.$allOptions.filter("option"),e.index=-1,t=e.$options.index(e.$options.filter(":selected")),f(e),e.multiple||w(t,e),void 0!==c.fn.fsScrollbar&&e.$wrapper.fsScrollbar({theme:e.theme}).find(".fs-scrollbar-content").attr("tabindex",null)},open:i,close:a},classes:["cover","bottom","multiple","mobile","native","open","disabled","focus","selected","options","group","item","item_disabled","item_selected","item_placeholder"],events:{close:"close"}}),C=e.classes,I=C.raw,k=e.events,r=e.functions,p=u.window,_=u.$window,y=(u.document,null);u.Ready(function(){y=u.$body})}); 1503/*! formstone v1.4.22 [equalize.js] 2021-10-01 | GPL-3.0 License | formstone.it */ 1504!function(e){"function"==typeof define&&define.amd?define(["jquery","./core","./mediaquery"],e):e(jQuery,Formstone)}(function(t,e){"use strict";function n(){u=t(d.element)}function i(e){if(e.data&&(e=e.data),e.enabled)for(var t,n,i,r=0;r<e.target.length;r++){n=t=0,(i=e.$el.find(e.target[r])).css(e.property,"");for(var a=0;a<i.length;a++)t<(n=i.eq(a)[e.type]())&&(t=n);i.css(e.property,t)}}function r(e){for(var t=0;t<e.target.length;t++)e.$el.find(e.target[t]).css(e.property,"");e.$el.find("img").off(o.namespace)}var a=e.Plugin("equalize",{widget:!0,priority:5,defaults:{maxWidth:1/0,minWidth:"0px",property:"height",target:null},methods:{_construct:function(e){e.maxWidth=e.maxWidth===1/0?"100000px":e.maxWidth,e.mq="(min-width:"+e.minWidth+") and (max-width:"+e.maxWidth+")",e.type="height"===e.property?"outerHeight":"outerWidth",e.target?t.isArray(e.target)||(e.target=[e.target]):e.target=["> *"],n(),t.fsMediaquery("bind",e.rawGuid,e.mq,{enter:function(){(function(e){if(!e.enabled){e.enabled=!0;var t=e.$el.find("img");t.length&&t.on(o.load,e,i),i(e)}}).call(e.$el,e)},leave:function(){(function(e){e.enabled&&(e.enabled=!1,r(e))}).call(e.$el,e)}})},_destruct:function(e){r(e),t.fsMediaquery("unbind",e.rawGuid),n()},_resize:function(e){f.iterate.call(u,i)},resize:i}}),d=a.classes,o=(d.raw,a.events),f=a.functions,u=[]});
1505/*! formstone v1.4.22 [lightbox.js] 2021-10-01 | GPL-3.0 License | formstone.it */ 1506!function(t){"function"==typeof define&&define.amd?define(["jquery","./core","./touch","./transition","./viewer"],t):t(jQuery,Formstone)}(function($,f){"use strict";function e(t){if(!K){var i=t.data;(K=$.extend({},{visible:!1,gallery:{active:!1},isMobile:f.isMobile&&!1!==i.mobile||i.overlay,isTouch:f.support.touch,isAnimating:!0,isZooming:!1,oldContentHeight:0,oldContentWidth:0,metaHeight:0,thumbnailHeight:0,captionOpen:!1,thumbnailsOpen:!1,tapTimer:null},i)).isViewer=K.isMobile&&i.viewer&&void 0!==$.fn.fsViewer;var e=i.$el,n=i.$object,o=e&&e[0].href&&e[0].href||"",a=e&&e[0].hash&&e[0].hash||"",l=(o.toLowerCase().split(".").pop().split(/\#|\?/),e?e.data(P+"-type"):""),r="image"===l||o.match(i.fileTypes)||"data:image"===o.substr(0,10),g=L(o),s="url"===l||!r&&!g&&"http"===o.substr(0,4)&&!a,d="element"===l||!r&&!g&&!s&&"#"===a.substr(0,1),h=void 0!==n;if(d&&(o=a),!(r||g||s||d||h))return void(K=null);if(A.killEvent(t),K.margin*=2,K.type=r?"image":g?"video":"element",e&&e.length){var c=e.data(P+"-gallery");c&&(K.gallery.active=!0,K.gallery.id=c,K.gallery.$items=$("a[data-lightbox-gallery= "+K.gallery.id+"], a[rel= "+K.gallery.id+"]"),K.gallery.index=K.gallery.$items.index(K.$el),K.gallery.total=K.gallery.$items.length-1)}K.thumbnails&&(r||g)&&K.gallery.active||(K.thumbnails=!1);var m="";K.isMobile||(m+='<div class="'+[E.overlay,K.theme,K.customClass].join(" ")+'"></div>');var p=[E.base,E.loading,E.animating,K.theme,K.customClass];if(K.fixed&&p.push(E.fixed),K.isMobile&&p.push(E.mobile),K.isTouch&&p.push(E.touch),s&&p.push(E.iframed),(d||h)&&p.push(E.inline),K.thumbnails&&p.push(E.thumbnailed),K.labels.lightbox=K.labels.lightbox.replace("{guid}",i.numGuid),m+='<div class="'+p.join(" ")+'" role="dialog" aria-label="'+K.labels.lightbox+'" tabindex="-1">',m+='<button type="button" class="'+E.close+'">'+K.labels.close+"</button>",m+='<span class="'+E.loading_icon+'"></span>',m+='<div class="'+E.container+'">',K.gallery.active&&K.thumbnails){var u,b;m+='<div class="'+[E.thumbnails]+'">',m+='<div class="'+[E.thumbnail_container]+'">';for(var v=0,H=K.gallery.$items.length;v<H;v++)b=(b=(u=K.gallery.$items.eq(v)).data("lightbox-thumbnail"))||u.find("img").attr("src"),m+='<button class="'+[E.thumbnail_item]+'">',m+='<img src="'+b+'" alt="">',m+="</button>";m+="</div></div>"}m+='<div class="'+E.content+'"></div>',r||g?(m+='<div class="'+E.tools+'">',m+='<div class="'+E.controls+'">',K.gallery.active&&(m+='<button type="button" class="'+[E.control,E.control_previous].join(" ")+'">'+K.labels.previous+"</button>",m+='<button type="button" class="'+[E.control,E.control_next].join(" ")+'">'+K.labels.next+"</button>"),K.isMobile&&K.isTouch&&(m+='<button type="button" class="'+[E.toggle,E.caption_toggle].join(" ")+'">'+K.labels.captionClosed+"</button>",K.gallery.active&&K.thumbnails&&(m+='<button type="button" class="'+[E.toggle,E.thumbnail_toggle].join(" ")+'">'+K.labels.thumbnailsClosed+"</button>")),m+="</div>",m+='<div class="'+E.meta+'">',m+='<div class="'+E.meta_content+'">',K.gallery.active&&(m+='<p class="'+E.position+'"',K.gallery.total<1&&(m+=' style="display: none;"'),m+=">",m+='<span class="'+E.position_current+'">'+(K.gallery.index+1)+"</span> ",m+=K.labels.count,m+=' <span class="'+E.position_total+'">'+(K.gallery.total+1)+"</span>",m+="</p>"),m+='<div class="'+E.caption+'">',m+=K.formatter.call(e,i),m+="</div></div></div>",m+="</div>"):K.gallery.active&&(m+='<div class="'+E.tools+'">',m+='<div class="'+E.controls+'">',m+='<button type="button" class="'+[E.control,E.control_previous].join(" ")+'">'+K.labels.previous+"</button>",m+='<button type="button" class="'+[E.control,E.control_next].join(" ")+'">'+K.labels.next+"</button>",m+="</div>",m+="</div>"),m+="</div></div>",F.append(m),K.$overlay=$(q.overlay),K.$lightbox=$(q.base),K.$close=$(q.close),K.$container=$(q.container),K.$content=$(q.content),K.$tools=$(q.tools),K.$meta=$(q.meta),K.$metaContent=$(q.meta_content),K.$position=$(q.position),K.$caption=$(q.caption),K.$controlBox=$(q.controls),K.$controls=$(q.control),K.$thumbnails=$(q.thumbnails),K.$thumbnailContainer=$(q.thumbnail_container),K.$thumbnailItems=$(q.thumbnail_item),K.isMobile?(K.paddingVertical=K.$close.outerHeight(),K.paddingHorizontal=0,K.mobilePaddingVertical=parseInt(K.$content.css("paddingTop"),10)+parseInt(K.$content.css("paddingBottom"),10),K.mobilePaddingHorizontal=parseInt(K.$content.css("paddingLeft"),10)+parseInt(K.$content.css("paddingRight"),10)):(K.paddingVertical=parseInt(K.$lightbox.css("paddingTop"),10)+parseInt(K.$lightbox.css("paddingBottom"),10),K.paddingHorizontal=parseInt(K.$lightbox.css("paddingLeft"),10)+parseInt(K.$lightbox.css("paddingRight"),10),K.mobilePaddingVertical=0,K.mobilePaddingHorizontal=0),K.contentHeight=K.$lightbox.outerHeight()-K.paddingVertical,K.contentWidth=K.$lightbox.outerWidth()-K.paddingHorizontal,K.controlHeight=K.$controls.outerHeight(),function(){var t=W();K.$lightbox.css({top:K.fixed?0:t.top})}(),K.gallery.active&&(K.$lightbox.addClass(E.has_controls),T()),B.on(R.keyDown,M),F.on(R.click,[q.overlay,q.close].join(", "),w).on([R.focus,R.focusIn].join(" "),O),K.gallery.active&&K.$lightbox.on(R.click,q.control,I),K.thumbnails&&K.$lightbox.on(R.click,q.thumbnail_item,V),K.isMobile&&K.isTouch&&K.$lightbox.on(R.click,q.caption_toggle,y).on(R.click,q.thumbnail_toggle,x),K.$lightbox.fsTransition({property:"opacity"}
1506,function(){r?C(o):g?_(o):s?k(o):d?j(o):h&&z(K.$object)}).addClass(E.open),K.$overlay.addClass(E.open)}}function t(t){"object"!=typeof t&&(K.targetHeight=t,K.targetWidth=arguments[1]),"element"===K.type?h(K.$content.find("> :first-child")):"image"===K.type?i():"video"===K.type&&r(),function(){if(K.visible&&!K.isMobile){var t=W();K.$controls.css({marginTop:(K.contentHeight-K.controlHeight-K.metaHeight+K.thumbnailHeight)/2}),K.$lightbox.css({height:K.contentHeight+K.paddingVertical,width:K.contentWidth+K.paddingHorizontal,top:K.fixed?0:t.top}),K.oldContentHeight=K.contentHeight,K.oldContentWidth=K.contentWidth}}()}function w(t){A.killEvent(t),K&&(K.$lightbox.fsTransition("destroy"),K.$content.fsTransition("destroy"),K.$lightbox.addClass(E.animating).fsTransition({property:"opacity"},function(t){void 0!==K.$inlineTarget&&K.$inlineTarget.length&&d(),K.isViewer&&K.$imageContainer&&K.$imageContainer.length&&K.$imageContainer.fsViewer("destroy"),K.$lightbox.off(R.namespace),K.$container.off(R.namespace),B.off(R.keyDown),F.off(R.namespace),F.off(R.namespace),K.$overlay.remove(),K.$lightbox.remove(),void 0!==K.$el&&K.$el&&K.$el.length&&K.$el.focus(),K=null,B.trigger(R.close)}),K.$lightbox.removeClass(E.open),K.$overlay.removeClass(E.open),K.isMobile&&(b.removeClass(E.lock),A.unlockViewport(P)))}function o(){var t=W();K.isMobile||K.duration;K.isMobile?A.lockViewport(P):K.$controls.css({marginTop:(K.contentHeight-K.controlHeight-K.metaHeight+K.thumbnailHeight)/2}),""===K.$caption.html()?(K.$caption.hide(),K.$lightbox.removeClass(E.has_caption),K.gallery.active||K.$tools.hide()):(K.$caption.show(),K.$lightbox.addClass(E.has_caption)),K.$lightbox.fsTransition({property:K.contentHeight!==K.oldContentHeight?"height":"width"},function(){K.$content.fsTransition({property:"opacity"},function(){K.$lightbox.removeClass(E.animating),K.isAnimating=!1}),K.$lightbox.removeClass(E.loading).addClass(E.ready),K.visible=!0,B.trigger(R.open,[{instance:K}]),K.gallery.active&&("element"==K.type||(function(){var t="";0<K.gallery.index&&(L(t=K.gallery.$items.eq(K.gallery.index-1).attr("href"))||$('<img src="'+t+'">'));K.gallery.index<K.gallery.total&&(L(t=K.gallery.$items.eq(K.gallery.index+1).attr("href"))||$('<img src="'+t+'">'))}(),g(),function(){if(K.thumbnails){var t=K.$thumbnailItems.eq(K.gallery.index),i=t.position().left+t.outerWidth(!1)/2-K.$thumbnailContainer.outerWidth(!0)/2;K.$thumbnailContainer.stop().animate({scrollLeft:i},200,"linear")}}())),K.$lightbox.focus()}),K.isMobile||K.$lightbox.css({height:K.contentHeight+K.paddingVertical,width:K.contentWidth+K.paddingHorizontal,top:K.fixed?0:t.top});var i=K.oldContentHeight!==K.contentHeight||K.oldContentWidth!==K.contentWidth;!K.isMobile&&i||K.$lightbox.fsTransition("resolve"),K.oldContentHeight=K.contentHeight,K.oldContentWidth=K.contentWidth,K.isMobile&&b.addClass(E.lock)}function W(){if(K.isMobile)return{left:0,top:0};var t={left:(f.windowWidth-K.contentWidth-K.paddingHorizontal)/2,top:K.top<=0?(f.windowHeight-K.contentHeight-K.paddingVertical)/2:K.top};return!0!==K.fixed&&(t.top+=B.scrollTop()),t}function y(t){if(A.killEvent(t),K.captionOpen)n();else{a();var i=parseInt(K.$metaContent.outerHeight(!0));i+=parseInt(K.$meta.css("padding-top")),i+=parseInt(K.$meta.css("padding-bottom")),K.$meta.css({height:i}),K.$lightbox.addClass(E.caption_open).find(q.caption_toggle).text(K.labels.captionOpen),K.captionOpen=!0}}function n(){K.$lightbox.removeClass(E.caption_open).find(q.caption_toggle).text(K.labels.captionClosed),K.captionOpen=!1}function x(t){A.killEvent(t),K.thumbnailsOpen?a():(n(),K.$lightbox.addClass(E.thumbnails_open).find(q.thumbnail_toggle).text(K.labels.thumbnailsOpen),K.thumbnailsOpen=!0)}function a(){K.$lightbox.removeClass(E.thumbnails_open).find(q.thumbnail_toggle).text(K.labels.thumbnailsClosed),K.thumbnailsOpen=!1}function C(t){K.isViewer?(K.$imageContainer=$('<div class="'+E.image_container+'"><img></div>'),K.$image=K.$imageContainer.find("img"),K.$image.attr("src",t).addClass(E.image),K.$content.prepend(K.$imageContainer),i(),K.$imageContainer.one("loaded.viewer",function(){o()}).fsViewer({theme:K.theme})):(K.$imageContainer=$('<div class="'+E.image_container+'"><img></div>'),K.$image=K.$imageContainer.find("img"),K.$image.one(R.load,function(){var t=function(t){var i=t[0],e=new Image;{if(void 0!==i.naturalHeight)return{naturalHeight:i.naturalHeight,naturalWi
1506dth:i.naturalWidth};if("img"===i.tagName.toLowerCase())return e.src=i.src,{naturalHeight:e.height,naturalWidth:e.width}}return!1}(K.$image);K.naturalHeight=t.naturalHeight,K.naturalWidth=t.naturalWidth,K.retina&&(K.naturalHeight/=2,K.naturalWidth/=2),K.$content.prepend(K.$imageContainer),i(),o()}).on(R.error,c).attr("src",t).addClass(E.image),!K.$image[0].complete&&4!==K.$image[0].readyState||K.$image.trigger(R.load))}function i(){if(K.$image){var t=0;for(K.windowHeight=K.viewportHeight=f.windowHeight-K.mobilePaddingVertical-K.paddingVertical,K.windowWidth=K.viewportWidth=f.windowWidth-K.mobilePaddingHorizontal-K.paddingHorizontal,K.contentHeight=1/0,K.contentWidth=1/0,K.imageMarginTop=0,K.imageMarginLeft=0;K.contentHeight>K.viewportHeight&&t<2;)K.imageHeight=0===t?K.naturalHeight:K.$image.outerHeight(),K.imageWidth=0===t?K.naturalWidth:K.$image.outerWidth(),K.metaHeight=0===t?0:K.metaHeight,K.spacerHeight=0===t?0:K.spacerHeight,K.thumbnailHeight=0===t?0:K.thumbnailHeight,0===t&&(K.ratioHorizontal=K.imageHeight/K.imageWidth,K.ratioVertical=K.imageWidth/K.imageHeight,K.isWide=K.imageWidth>K.imageHeight),K.imageHeight<K.minHeight&&(K.minHeight=K.imageHeight),K.imageWidth<K.minWidth&&(K.minWidth=K.imageWidth),K.isMobile?(K.isTouch?(K.$controlBox.css({width:f.windowWidth}),K.spacerHeight=K.$controls.outerHeight(!0)):(K.$tools.css({width:f.windowWidth}),K.spacerHeight=K.$tools.outerHeight(!0)),K.contentHeight=K.viewportHeight,K.contentWidth=K.viewportWidth,K.isTouch||K.$content.css({height:K.contentHeight-K.spacerHeight}),K.$thumbnails.length&&(K.spacerHeight+=K.$thumbnails.outerHeight(!0)),K.spacerHeight+=10,l(),K.imageMarginTop=(K.contentHeight-K.targetImageHeight-K.spacerHeight)/2,K.imageMarginLeft=(K.contentWidth-K.targetImageWidth)/2):(0===t&&(K.viewportHeight-=K.margin+K.paddingVertical,K.viewportWidth-=K.margin+K.paddingHorizontal),K.viewportHeight-=K.metaHeight,K.thumbnails&&(K.viewportHeight-=K.thumbnailHeight),l(),K.contentHeight=K.targetImageHeight,K.contentWidth=K.targetImageWidth),K.isMobile||K.isTouch||K.$meta.css({width:K.contentWidth}),K.$image.css({height:K.targetImageHeight,width:K.targetImageWidth,marginTop:K.imageMarginTop,marginLeft:K.imageMarginLeft}),K.isMobile||(K.metaHeight=K.$meta.outerHeight(!0),K.contentHeight+=K.metaHeight),K.thumbnails&&(K.thumbnailHeight=K.$thumbnails.outerHeight(!0),K.contentHeight+=K.thumbnailHeight),t++}}function l(){var t=K.isMobile?K.contentHeight-K.spacerHeight:K.viewportHeight,i=K.isMobile?K.contentWidth:K.viewportWidth;K.isWide?(K.targetImageWidth=i,K.targetImageHeight=K.targetImageWidth*K.ratioHorizontal,K.targetImageHeight>t&&(K.targetImageHeight=t,K.targetImageWidth=K.targetImageHeight*K.ratioVertical)):(K.targetImageHeight=t,K.targetImageWidth=K.targetImageHeight*K.ratioVertical,K.targetImageWidth>i&&(K.targetImageWidth=i,K.targetImageHeight=K.targetImageWidth*K.ratioHorizontal)),(K.targetImageWidth>K.imageWidth||K.targetImageHeight>K.imageHeight)&&(K.targetImageHeight=K.imageHeight,K.targetImageWidth=K.imageWidth),(K.targetImageWidth<K.minWidth||K.targetImageHeight<K.minHeight)&&(K.targetImageWidth<K.minWidth?(K.targetImageWidth=K.minWidth,K.targetImageHeight=K.targetImageWidth*K.ratioHorizontal):(K.targetImageHeight=K.minHeight,K.targetImageWidth=K.targetImageHeight*K.ratioVertical))}function _(t){var i=L(t),e=t.split("?"),n="&origin="+encodeURIComponent(window.location.protocol+"//"+window.location.hostname);i?(2<=e.length&&(i+="?"+e.slice(1)[0].trim()),K.$videoWrapper=$('<div class="'+E.video_wrapper+'"></div>'),K.$video=$('<iframe class="'+E.video+'" frameborder="0" seamless="seamless" allowfullscreen></iframe>'),K.$video.attr("src",i+"&enablejsapi=1"+n).addClass(E.video).prependTo(K.$videoWrapper),K.$content.prepend(K.$videoWrapper),r(),o()):c()}function r(){K.windowHeight=K.viewportHeight=f.windowHeight-K.mobilePaddingVertical-K.paddingVertical,K.windowWidth=K.viewportWidth=f.windowWidth-K.mobilePaddingHorizontal-K.paddingHorizontal,K.videoMarginTop=0,K.videoMarginLeft=0,K.isMobile?(K.isTouch?(K.$controlBox.css({width:f.windowWidth}),K.spacerHeight=K.$controls.outerHeight(!0)+10):(K.$tools.css({width:f.windowWidth}),K.spacerHeight=K.$tools.outerHeight(!0),K.spacerHeight+=K.$thumbnails.outerHeight(!0)+10),K.viewportHe
1506ight-=K.spacerHeight,K.targetVideoWidth=K.viewportWidth,K.targetVideoHeight=K.targetVideoWidth*K.videoRatio,K.targetVideoHeight>K.viewportHeight&&(K.targetVideoHeight=K.viewportHeight,K.targetVideoWidth=K.targetVideoHeight/K.videoRatio),K.videoMarginTop=(K.viewportHeight-K.targetVideoHeight)/2,K.videoMarginLeft=(K.viewportWidth-K.targetVideoWidth)/2):(K.viewportHeight=K.windowHeight-K.margin,K.viewportWidth=K.windowWidth-K.margin,K.targetVideoWidth=K.videoWidth>K.viewportWidth?K.viewportWidth:K.videoWidth,K.targetVideoWidth<K.minWidth&&(K.targetVideoWidth=K.minWidth),K.targetVideoHeight=K.targetVideoWidth*K.videoRatio,K.contentHeight=K.targetVideoHeight,K.contentWidth=K.targetVideoWidth),K.isMobile||K.isTouch||K.$meta.css({width:K.contentWidth}),K.$videoWrapper.css({height:K.targetVideoHeight,width:K.targetVideoWidth,marginTop:K.videoMarginTop,marginLeft:K.videoMarginLeft}),K.isMobile||(K.metaHeight=K.$meta.outerHeight(!0),K.contentHeight+=K.metaHeight),K.thumbnails&&(K.thumbnailHeight=K.$thumbnails.outerHeight(!0),K.contentHeight+=K.thumbnailHeight)}function I(t){A.killEvent(t);var i=$(t.currentTarget);K.isAnimating||i.hasClass(E.control_disabled)||(K.isAnimating=!0,n(),K.gallery.index+=i.hasClass(E.control_next)?1:-1,K.gallery.index>K.gallery.total&&(K.gallery.index=K.infinite?0:K.gallery.total),K.gallery.index<0&&(K.gallery.index=K.infinite?K.gallery.total:0),g(),K.$lightbox.addClass(E.animating),K.$content.fsTransition({property:"opacity"},s),K.$lightbox.addClass(E.loading))}function V(t){A.killEvent(t);var i=$(t.currentTarget);K.isAnimating||i.hasClass(E.active)||(K.isAnimating=!0,n(),K.gallery.index=K.$thumbnailItems.index(i),g(),K.$lightbox.addClass(E.animating),K.$content.fsTransition({property:"opacity"},s),K.$lightbox.addClass(E.loading))}function g(){if(K.thumbnails){var t=K.$thumbnailItems.eq(K.gallery.index);K.$thumbnailItems.removeClass(E.active),t.addClass(E.active)}}function s(){if("element"==K.type?void 0!==K.$inlineTarget&&K.$inlineTarget.length&&d():(void 0!==K.$imageContainer&&(K.isViewer&&K.$imageContainer.fsViewer("destroy"),K.$imageContainer.remove()),void 0!==K.$videoWrapper&&K.$videoWrapper.remove()),K.$el=K.gallery.$items.eq(K.gallery.index),"element"==K.type){var t=K.$el[0].href,i=K.$el&&K.$el[0].hash&&K.$el[0].hash||"";"http"===t.substr(0,4)&&!i?k(t):j(i)}else{K.$caption.html(K.formatter.call(K.$el,K)),K.$position.find(q.position_current).html(K.gallery.index+1),L(t=K.$el[0].href)?(K.type="video",_(t)):(K.type="image",C(t))}T()}function T(){K.$controls.removeClass(E.control_disabled),K.infinite||(0===K.gallery.index&&K.$controls.filter(q.control_previous).addClass(E.control_disabled),K.gallery.index===K.gallery.total&&K.$controls.filter(q.control_next).addClass(E.control_disabled))}function M(t){!K.gallery.active||37!==t.keyCode&&39!==t.keyCode?27===t.keyCode&&K.$close.trigger(R.click):(A.killEvent(t),K.$controls.filter(37===t.keyCode?q.control_previous:q.control_next).trigger(R.click))}function j(t){K.$inlineTarget=$(t),K.$inlineContents=K.$inlineTarget.children().detach(),z(K.$inlineContents)}function d(){K.$inlineTarget.append(K.$inlineContents.detach())}
1506function k(t){t+=-1<t.indexOf("?")?"&"+K.requestKey+"=true":"?"+K.requestKey+"=true",z($('<iframe class="'+E.iframe+'" src="'+t+'"></iframe>'))}function z(t){K.$content.append(t),h(t),o()}function h(t){K.windowHeight=f.windowHeight-K.mobilePaddingVertical-K.paddingVertical,K.windowWidth=f.windowWidth-K.mobilePaddingHorizontal-K.paddingHorizontal,K.objectHeight=t.outerHeight(!0),K.objectWidth=t.outerWidth(!0),K.targetHeight=K.targetHeight||(K.$el?K.$el.data(P+"-height"):null),K.targetWidth=K.targetWidth||(K.$el?K.$el.data(P+"-width"):null),K.maxHeight=K.windowHeight<0?K.minHeight:K.windowHeight,K.isIframe=t.is("iframe"),K.objectMarginTop=0,K.objectMarginLeft=0,K.isMobile||(K.windowHeight-=K.margin,K.windowWidth-=K.margin),K.contentHeight=K.targetHeight?K.targetHeight:K.isIframe||K.isMobile?K.windowHeight:K.objectHeight,K.contentWidth=K.targetWidth?K.targetWidth:K.isIframe||K.isMobile?K.windowWidth:K.objectWidth,(K.isIframe||K.isObject)&&K.isMobile?(K.contentHeight=K.windowHeight,K.contentWidth=K.windowWidth):K.isObject&&(K.contentHeight=K.contentHeight>K.windowHeight?K.windowHeight:K.contentHeight,K.contentWidth=K.contentWidth>K.windowWidth?K.windowWidth:K.contentWidth),K.isMobile||(K.contentHeight>K.maxHeight&&(K.contentHeight=K.maxHeight),K.contentWidth>K.maxWidth&&(K.contentWidth=K.maxWidth))}function c(){var t=$('<div class="'+E.error+'"><p>Error Loading Resource</p></div>');K.type="element",K.$tools.remove(),K.$image.off(R.namespace),z(t),B.trigger(R.error)}function L(t){var i,e=K.videoFormatter;for(var n in e)if(e.hasOwnProperty(n)&&null!==(i=t.match(e[n].pattern)))return e[n].format.call(K,i);return!1}function O(t){var i=t.target;$.contains(K.$lightbox[0],i)||i===K.$lightbox[0]||i===K.$overlay[0]||(A.killEvent(t),K.$lightbox.focus())}var m=f.Plugin("lightbox",{widget:!0,defaults:{customClass:"",fileTypes:/\.(jpg|sjpg|jpeg|png|gif)/i,fixed:!1,formatter:function(){var t=this.attr("title"),i=!(void 0===t||!t)&&t.replace(/^\s+|\s+$/g,"");return i?'<p class="caption">'+i+"</p>":""},infinite:!1,labels:{close:"Close",count:"of",next:"Next",previous:"Previous",captionClosed:"View Caption",captionOpen:"Close Caption",thumbnailsClosed:"View Thumbnails",thumbnailsOpen:"Close Thumbnails",lightbox:"Lightbox {guid}"},margin:50,maxHeight:1e4,maxWidth:1e4,minHeight:100,minWidth:100,mobile:null,overlay:!1,retina:!1,requestKey:"fs-lightbox",theme:"fs-light",thumbnails:!1,top:0,videoFormatter:{youtube:{pattern:/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/ ]{11})/,format:function(t){return"//www.youtube.com/embed/"+t[1]}},vimeo:{pattern:/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)/,format:function(t){return"//player.vimeo.com/video/"+t[3]}}},videoRatio:.5625,videoWidth:800,viewer:!0},classes:["loading","animating","fixed","mobile","touch","inline","iframed","open","ready","overlay","close","loading_icon","container","content","image","image_container","video","video_wrapper","tools","meta","meta_content","controls","control","control_previous","control_next","control_disabled","position","position_current","position_total","toggle","caption_toggle","caption","caption_open","thumbnailed","thumbnails_open","thumbnail_toggle","thumbnails","thumbnail_container","thumbnail_item","active","has_controls","has_caption","iframe","error","active","lock"],events:{open:"open",close:"close"},methods:{_construct:function(t){this.on(R.click,t,e);var i=this.data(P+"-gallery");!H&&v&&i===v&&(H=!0,this.trigger(R.click))},_destruct:function(t){w(),this.off(R.namespace)},_resize:function(){K&&t()},resize:t},utilities:{_initialize:function(t,i){t instanceof $&&e.apply(u,[{data:$.extend(!0,{},{$object:t},p,i||{})}])},close:w}}),P=m.namespace,p=m.defaults,q=m.classes,E=q.raw,R=m.events,A=m.functions,u=f.window,B=f.$window,F=null,b=null,v=!1,H=!1,K=null;f.Ready(function(){F=f.$body,b=$("html, body"),v=f.window.location.hash.replace("#","")})}); 1507/*! formstone v1.4.22 [navigation.js] 2021-10-01 | GPL-3.0 License | formstone.it */ 1508!function(a){"function"==typeof define&&define.amd?define(["jquery","./core","./mediaquery","./swap"],a):a(jQuery,Formstone)}(function(d,a){"use strict";function t(a){a.$handle.fsSwap("deactivate")}function o(a){a.data.$handle.addClass(v.focus)}function i(a){a.data.$handle.removeClass(v.focus)}function s(a){var e=a.data;13!==a.keyCode&&32!==a.keyCode||(g.killEvent(a),e.$handle.trigger(m.raw.click))}function r(a){if(!a.originalEvent){var e=a.data;e.open||(e.$el.trigger(m.open).attr("aria-hidden",!1),e.$content.addClass(e.contentClassesOpen).one(m.click,function(){t(e)}),e.$handle.attr("aria-expanded",!0),e.label&&e.$handle.html(e.labels.open),function(a){a.isToggle||$.addClass(v.lock)}(e),e.open=!0,e.$nav.focus())}}function c(a){if(!a.originalEvent){var e=a.data;e.open&&(e.$el.trigger(m.close).attr("aria-hidden",!0),e.$content.removeClass(e.contentClassesOpen).off(m.namespace),e.$handle.attr("aria-expanded",!1),e.label&&e.$handle.html(e.labels.closed),n(e),e.open=!1,e.$el.focus())}}function h(a){var e=a.data;e.$el.attr("aria-hidden",!0),e.$handle.attr("aria-controls",e.ariaId).attr("aria-expanded",!1),e.$content.addClass(v.enabled),setTimeout(function(){e.$animate.addClass(v.animated)},0),e.label&&e.$handle.html(e.labels.closed)}function u(a){var e=a.data;e.$el.removeAttr("aria-hidden"),e.$handle.removeAttr("aria-controls").removeAttr("aria-expanded"),e.$content.removeClass(v.enabled,v.animated),e.$animate.removeClass(v.animated),l(e),n(e)}function n(a){a.isToggle||$.removeClass(v.lock)}function l(a){if(a.label)if(1<a.$handle.length)for(var e=0,t=a.$handle.length;e<t;
1508e++)a.$handle.eq(e).html(a.originalLabel[e]);else a.$handle.html(a.originalLabel)}var e=a.Plugin("navigation",{widget:!0,defaults:{customClass:"",gravity:"left",label:!0,labels:{closed:"Menu",open:"Close"},maxWidth:"980px",theme:"fs-light",type:"toggle"},classes:["handle","nav","content","animated","enabled","focus","open","toggle","push","reveal","overlay","left","right","lock"],events:{open:"open",close:"close"},methods:{_construct:function(a){a.handleGuid=v.handle+a.guid,a.isToggle="toggle"===a.type,a.open=!1,a.isToggle&&(a.gravity="");var e=v.base,t=[e,a.type].join("-"),n=a.gravity?[t,a.gravity].join("-"):"",l=[a.rawGuid,a.theme,a.customClass].join(" ");a.handle=this.data(p+"-handle"),a.content=this.data(p+"-content"),a.handleClasses=[v.handle,v.handle.replace(e,t),n?v.handle.replace(e,n):"",a.handleGuid,l].join(" "),a.thisClasses=[v.nav.replace(e,t),n?v.nav.replace(e,n):"",l],a.contentClasses=[v.content.replace(e,t),l].join(" "),a.contentClassesOpen=[n?v.content.replace(e,n):"",v.open].join(" "),a.$nav=this.addClass(a.thisClasses.join(" ")).attr("role","navigation"),a.$handle=d(a.handle).addClass(a.handleClasses),a.$content=d(a.content).addClass(a.contentClasses),a.$animate=d().add(a.$nav).add(a.$content),function(a){if(a.label)if(1<a.$handle.length){a.originalLabel=[];for(var e=0,t=a.$handle.length;e<t;e++)a.originalLabel[e]=a.$handle.eq(e).html()}else a.originalLabel=a.$handle.html()}(a),a.navTabIndex=a.$nav.attr("tabindex"),a.$nav.attr("tabindex",-1),a.id=this.attr("id"),a.id?a.ariaId=a.id:(a.ariaId=a.rawGuid,this.attr("id",a.ariaId)),a.$handle.attr("data-swap-target",a.dotGuid).attr("data-swap-linked",a.handleGuid).attr("data-swap-group",v.base).attr("tabindex",0).on("activate.swap"+a.dotGuid,a,r).on("deactivate.swap"+a.dotGuid,a,c).on("enable.swap"+a.dotGuid,a,h).on("disable.swap"+a.dotGuid,a,u).on(m.focus+a.dotGuid,a,o).on(m.blur+a.dotGuid,a,i).fsSwap({maxWidth:a.maxWidth,classes:{target:a.dotGuid,enabled:f.enabled,active:f.open,raw:{target:a.rawGuid,enabled:v.enabled,active:v.open}}}),a.$handle.is("a, button")||a.$handle.on(m.keyPress+a.dotGuid,a,s)},_destruct:function(a){a.$content.removeClass([a.contentClasses,a.contentClassesOpen].join(" ")).off(m.namespace),a.$handle.removeAttr("aria-controls").removeAttr("aria-expanded").removeAttr("data-swap-target").removeData("swap-target").removeAttr("data-swap-linked").removeAttr("data-swap-group").removeData("swap-linked").removeData("tabindex").removeClass(a.handleClasses).off(a.dotGuid).html(a.originalLabel).fsSwap("destroy"),a.$nav.attr("tabindex",a.navTabIndex),l(a),n(a),this.removeAttr("aria-hidden").removeClass(a.thisClasses.join(" ")).off(m.namespace),this.attr("id")===a.rawGuid&&this.removeAttr("id")},open:function(a){a.$handle.fsSwap("activate")},close:t,enable:function(a){a.$handle.fsSwap("enable")},disable:function(a){a.$handle.fsSwap("disable")}}}),p=e.namespace,f=e.classes,v=f.raw,m=e.events,g=e.functions,$=null;a.Ready(function(){$=d("html, body")})}); 1509/*! formstone v1.4.22 [pagination.js] 2021-10-01 | GPL-3.0 License | formstone.it */ 1510!function(e){"function"==typeof define&&define.amd?define(["jquery","./core","./mediaquery"],e):e(jQuery,Formstone)}(function(a,e){"use strict";function t(e){v.killEvent(e);var s=e.data,i=s.index+(a(e.currentTarget).hasClass(c.control_previous)?-1:1);0<=i&&s.$items.eq(i).trigger(p.raw.click)}function l(e){v.killEvent(e);var s=e.data,i=a(e.currentTarget),t=parseInt(i.val(),10);s.$items.eq(t).trigger(p.raw.click)}function n(e){var s=e.data,i=a(e.currentTarget),t=s.$items.index(i);s.ajax?v.killEvent(e):i[0].click(),o(s,t)}function o(e,s){if(s<0&&(s=0),s>e.total&&(s=e.total),s!==e.index){e.index=s;var i=e.index-e.visible,t=e.index+(e.visible+1);i<0&&(i=0),t>e.total&&(t=e.total),e.$items.removeClass(c.visible).removeClass(c.hidden).filter(d.active).removeClass(c.active).end().eq(e.index).addClass(c.active).end().slice(i,t).addClass(c.visible),e.$items.not(d.visible).addClass(c.hidden),e.$position.find(d.current).text(e.index+1).end().find(d.total).text(e.total+1),e.$select.val(e.index),e.$controls.removeClass(c.visible),0<s&&e.$controls.filter(d.control_previous).addClass(c.visible),s<e.total&&e.$controls.filter(d.control_next).addClass(c.visible),e.$ellipsis.removeClass(c.visible),s>e.visible+1&&e.$ellipsis.eq(0).addClass(c.visible),s<e.total-e.visible-1&&e.$ellipsis.eq(1).addClass(c.visible),e.$el.trigger(p.update,[e.index])}}
1510var r=e.Plugin("pagination",{widget:!0,defaults:{ajax:!1,customClass:"",labels:{count:"of",next:"Next",previous:"Previous",select:"Select Page",pagination:"Pagination {guid}"},maxWidth:"740px",theme:"fs-light",visible:2},classes:["pages","page","active","first","last","ellipsis","visible","hidden","control","control_previous","control_next","position","select","mobile","current","total"],events:{update:"update"},methods:{_construct:function(e){e.mq="(max-width:"+(e.maxWidth===1/0?"100000px":e.maxWidth)+")";var s="";s+='<button type="button" class="'+[c.control,c.control_previous].join(" ")+'">'+e.labels.previous+"</button>",s+='<button type="button" class="'+[c.control,c.control_next].join(" ")+'">'+e.labels.next+"</button>",s+='<div class="'+c.position+'" aria-hidden="true">',s+='<span class="'+c.current+'">0</span>',s+=" "+e.labels.count+" ",s+='<span class="'+c.total+'">0</span>',s+='<select class="'+c.select+'" title="'+e.labels.select+'" tabindex="-1" aria-hidden="true"></select>',s+="</div>",e.thisClasses=[c.base,e.theme,e.customClass],e.labels.pagination=e.labels.pagination.replace("{guid}",e.numGuid),this.addClass(e.thisClasses.join(" ")).wrapInner('<div class="'+c.pages+'" aria-label="'+e.labels.pagination+'"></div>').prepend(s),e.$controls=this.find(d.control),e.$pages=this.find(d.pages),e.$items=e.$pages.children().addClass(c.page),e.$position=this.find(d.position),e.$select=this.find(d.select),e.index=-1,e.total=e.$items.length-1;var i=e.$items.index(e.$items.filter("[data-"+r.namespace+"-active]"));i<0&&(i=e.$items.index(e.$items.filter(d.active))),e.$items.eq(0).addClass(c.first).after('<span class="'+c.ellipsis+'">…</span>').end().eq(e.total).addClass(c.last).before('<span class="'+c.ellipsis+'">…</span>'),e.$ellipsis=e.$pages.find(d.ellipsis),function(e){for(var s="",i=0;i<=e.total;i++)s+='<option value="'+i+'"',i===e.index&&(s+='selected="selected"'),s+=">Page "+(i+1)+"</option>";e.$select.html(s)}(e),this.on(p.click,d.page,e,n).on(p.click,d.control,e,t).on(p.change,d.select,e,l),a.fsMediaquery("bind",e.rawGuid,e.mq,{enter:function(){e.$el.addClass(c.mobile)},leave:function(){e.$el.removeClass(c.mobile)}}),o(e,i)},_destruct:function(e){a.fsMediaquery("unbind",e.rawGuid),e.$controls.remove(),e.$ellipsis.remove(),e.$select.remove(),e.$position.remove(),e.$items.removeClass([c.page,c.active,c.visible,c.first,c.last].join(" ")).unwrap(),this.removeClass(e.thisClasses.join(" ")).off(p.namespace)}}}),d=r.classes,c=d.raw,p=r.events,v=r.functions}); 1511/*! formstone v1.4.22 [swap.js] 2021-10-01 | GPL-3.0 License | formstone.it */ 1512!function(e){"function"==typeof define&&define.amd?define(["jquery","./core","./mediaquery"],e):e(jQuery,Formstone)}(function(s,e){"use strict";function t(e,a){if(e.enabled&&!e.active){e.group&&!a&&s(e.group).not(e.$el).not(e.linked)[c.namespaceClean]("deactivate",!0);var t=e.group?s(e.group).index(e.$el):null;e.$swaps.addClass(e.classes.raw.active),a||e.linked&&s(e.linked).not(e.$el)[c.namespaceClean]("activate",!0),this.trigger(o.activate,[t]),e.active=!0}}function i(e,a){e.enabled&&e.active&&(e.$swaps.removeClass(e.classes.raw.active),a||e.linked&&s(e.linked).not(e.$el)[c.namespaceClean]("deactivate",!0),this.trigger(o.deactivate),e.active=!1)}function a(e,a){e.enabled||(e.enabled=!0,e.$swaps.addClass(e.classes.raw.enabled),a||s(e.linked).not(e.$el)[c.namespaceClean]("enable"),this.trigger(o.enable),e.onEnable?(e.active=!1,t.call(this,e)):(e.active=!0,i.call(this,e)))}function n(e,a){e.enabled&&(e.enabled=!1,e.$swaps.removeClass([e.classes.raw.enabled,e.classes.raw.active].join(" ")),a||s(e.linked).not(e.$el)[c.namespaceClean]("disable"),this.trigger(o.disable))}function l(e){u.killEvent(e);var a=e.data;a.active&&a.collapse?i.call(a.$el,a):t.call(a.$el,a)}var c=e.Plugin("swap",{widget:!0,defaults:{collapse:!0,maxWidth:1/0},classes:["target","enabled","active"],events:{activate:"activate",deactivate:"deactivate",enable:"enable",disable:"disable"},methods:{_construct:function(e){e.enabled=!1,e.active=!1,e.classes=s.extend(!0,{},r,e.classes),e.target=this.data(d+"-target"),e.$target=s(e.target).addClass(e.classes.raw.target),e.mq="(max-width:"+(e.maxWidth===1/0?"100000px":e.maxWidth)+")";var a=this.data(d+"-linked");e.linked=!!a&&"[data-"+d+'-linked="'+a+'"]';var t=this.data(d+"-group");e.group=!!t&&"[data-"+d+'-group="'+t+'"]',e.$swaps=s().add(this).add(e.$target),this.on(o.click+e.dotGuid,e,l)},_postConstruct:function(e){e.collapse||!e.group||s(e.group).filter("[data-"+d+"-active]").length||s(e.group).eq(0).attr("data-"+d+"-active","true"),e.onEnable=this.data(d+"-active")||!1,s.fsMediaquery("bind",e.rawGuid,e.mq,{enter:function(){a.call(e.$el,e,!0)},leave:function(){n.call(e.$el,e,!0)}})},_destruct:function(e){s.fsMediaquery("unbind",e.rawGuid),e.$swaps.removeClass([e.classes.raw.enabled,e.classes.raw.active].join(" ")).off(o.namespace)},activate:t,deactivate:i,enable:a,disable:n}}),d=c.namespace,r=c.classes,o=c.events,u=c.functions});
1513/*! formstone v1.4.22 [touch.js] 2021-10-01 | GPL-3.0 License | formstone.it */ 1514!function(e){"function"==typeof define&&define.amd?define(["jquery","./core"],e):e(jQuery,Formstone)}(function(r,s){"use strict";function o(e){e.preventManipulation&&e.preventManipulation();var t=e.data,a=e.originalEvent;if(a.type.match(/(up|end|cancel)$/i))d(e);else{if(a.pointerId){var n=!1;for(var i in t.touches)t.touches[i].id===a.pointerId&&(n=!0,t.touches[i].pageX=a.pageX,t.touches[i].pageY=a.pageY);n||t.touches.push({id:a.pointerId,pageX:a.pageX,pageY:a.pageY})}else t.touches=a.touches;a.type.match(/(down|start)$/i)?v(e):a.type.match(/move$/i)&&c(e)}}function v(e){var t=e.data,a=void 0!==t.touches&&t.touches.length?t.touches[0]:null;a&&t.$el.off(m.mouseDown),t.touching||(t.startE=e.originalEvent,t.startX=a?a.pageX:e.pageX,t.startY=a?a.pageY:e.pageY,t.startT=(new Date).getTime(),t.scaleD=1,t.passedAxis=!1),t.$links&&t.$links.off(m.click);var n=Y(t.scale?m.scaleStart:m.panStart,e,t.startX,t.startY,t.scaleD,0,0,"","");if(t.scale&&t.touches&&2<=t.touches.length){var i=t.touches;t.pinch={startX:f(i[0].pageX,i[1].pageX),startY:f(i[0].pageY,i[1].pageY),startD:x(i[1].pageX-i[0].pageX,i[1].pageY-i[0].pageY)},n.pageX=t.startX=t.pinch.startX,n.pageY=t.startY=t.pinch.startY}t.touching||(t.touching=!0,t.pan&&!a&&M.on(m.mouseMove,t,c).on(m.mouseUp,t,d),s.support.pointer?M.on([m.pointerMove,m.pointerUp,m.pointerCancel].join(" "),t,o):M.on([m.touchMove,m.touchEnd,m.touchCancel].join(" "),t,o),t.$el.trigger(n))}function c(e){var t=e.data,a=void 0!==t.touches&&t.touches.length?t.touches[0]:null,n=a?a.pageX:e.pageX,i=a?a.pageY:e.pageY,s=n-t.startX,o=i-t.startY,c=0<s?"right":"left",p=0<o?"down":"up",r=Math.abs(s)>t.threshold,l=Math.abs(o)>t.threshold;if(!t.passedAxis&&t.axis&&(t.axisX&&l||t.axisY&&r))d(e);else{!t.passedAxis&&(!t.axis||t.axis&&t.axisX&&r||t.axisY&&l)&&(t.passedAxis=!0),t.passedAxis&&(w.killEvent(e),w.killEvent(t.startE));var h=!0,u=Y(t.scale?m.scale:m.pan,e,n,i,t.scaleD,s,o,c,p);if(t.scale)if(t.touches&&2<=t.touches.length){var g=t.touches;t.pinch.endX=f(g[0].pageX,g[1].pageX),t.pinch.endY=f(g[0].pageY,g[1].pageY),t.pinch.endD=x(g[1].pageX-g[0].pageX,g[1].pageY-g[0].pageY),t.scaleD=t.pinch.endD/t.pinch.startD,u.pageX=t.pinch.endX,u.pageY=t.pinch.endY,u.scale=t.scaleD,u.deltaX=t.pinch.endX-t.pinch.startX,u.deltaY=t.pinch.endY-t.pinch.startY}else t.pan||(h=!1);h&&t.$el.trigger(u)}}function d(e){var t=e.data,a=void 0!==t.touches&&t.touches.length?t.touches[0]:null,n=a?a.pageX:e.pageX,i=a?a.pageY:e.pageY,s=n-t.startX,o=i-t.startY,c=(new Date).getTime(),p=t.scale?m.scaleEnd:m.panEnd,r=0<s?"right":"left",l=0<o?"down":"up",h=1<Math.abs(s),u=1<Math.abs(o);if(t.swipe&&c-t.startT<t.time&&Math.abs(s)>t.threshold&&(p=m.swipe),t.axis&&(t.axisX&&u||t.axisY&&h)||h||u){t.$links=t.$el.find("a");for(var g=0,d=t.$links.length;g<d;g++)X(t.$links.eq(g),t)}var f=Y(p,e,n,i,t.scaleD,s,o,r,l);M.off([m.touchMove,m.touchEnd,m.touchCancel,m.mouseMove,m.mouseUp,m.pointerMove,m.pointerUp,m.pointerCancel].join(" ")),t.$el.trigger(f),t.touches=[],t.scale,a&&(t.touchTimer=w.startTimer(t.touchTimer,5,function(){t.$el.on(m.mouseDown,t,v)})),t.touching=!1}function X(e,t){e.on(m.click,t,n);var a=r._data(e[0],"events").click;a.unshift(a.pop())}function n(e){w.killEvent(e,!0),e.data.$links.off(m.click)}function Y(e,t,a,n,i,s,o,c,p){return r.Event(e,{originalEvent:t,bubbles:!0,pageX:a,pageY:n,scale:i,deltaX:s,deltaY:o,directionX:c,directionY:p})}function f(e,t){return(e+t)/2}function x(e,t){return Math.sqrt(e*e+t*t)}function a(e,t){e.css({"-ms-touch-action":t,"touch-action":t})}var e=!s.window.PointerEvent,t=s.Plugin("touch",{widget:!0,defaults:{axis:!1,pan:!1,scale:!1,swipe:!1,threshold:10,time:50},methods:{_construct:function(e){if(e.touches=[],e.touching=!1,this.on(m.dragStart,w.killEvent),e.swipe&&(e.pan=!0),e.scale&&(e.axis=!1),e.axisX="x"===e.axis,e.axisY="y"===e.axis,s.support.pointer){var t="";!e.axis||e.axisX&&e.axisY?t="none":(e.axisX&&(t+=" pan-y"),e.axisY&&(t+=" pan-x")),a(this,t),this.on(m.pointerDown,e,o)}else this.on(m.touchStart,e,o).on(m.mouseDown,e,v)},_destruct:function(e){this.off(m.namespace),a(this,"")}},events:{pointerDown:e?"MSPointerDown":"pointerdown",pointerUp:e?"MSPointerUp":"pointerup",pointerMove:e?"MSPointerMove":"pointermove",pointerCancel:e?"MSPointerCancel":"pointercancel"}}),m=t.events,w=t.functions,M=s.$window;m.pan="pan",m.panStart="panstart",m.panEnd="panend",m.scale="scale",m.scaleStart="scalestart",m.scaleEnd="scaleend",m.swipe="swipe"});
1515/*! formstone v1.4.22 [transition.js] 2021-10-01 | GPL-3.0 License | formstone.it */ 1516!function(t){"function"==typeof define&&define.amd?define(["jquery","./core"],t):t(jQuery,Formstone)}(function(s,a){"use strict";function i(t){t.stopPropagation(),t.preventDefault();var e=t.data,r=t.originalEvent,n=e.target?e.$target:e.$el;e.property&&r.propertyName!==e.property||!s(r.target).is(n)||o(e)}function o(t){t.always||t.$el[e.namespaceClean]("destroy"),t.callback.apply(t.$el)}function c(t){var e,r,n,a={};if(t instanceof s&&(t=t[0]),f.getComputedStyle)for(var i=0,o=(e=f.getComputedStyle(t,null)).length;i<o;i++)r=e[i],n=e.getPropertyValue(r),a[r]=n;else if(t.currentStyle)for(r in e=t.currentStyle)a[r]=e[r];return a}var e=a.Plugin("transition",{widget:!0,defaults:{always:!1,property:null,target:null},methods:{_construct:function(t,e){if(e){t.$target=this.find(t.target),t.$check=t.target?t.$target:this,t.callback=e,t.styles=c(t.$check),t.timer=null;var r=t.$check.css(a.transition+"-duration"),n=parseFloat(r);a.support.transition&&r&&n?this.on(l.transitionEnd,t,i):t.timer=u.startTimer(t.timer,50,function(){!function(t){var e=c(t.$check);!function(t,e){if(typeof t!=typeof e)return!1;for(var r in t){if(!t.hasOwnProperty(r))return!1;if(!t.hasOwnProperty(r)||!e.hasOwnProperty(r)||t[r]!==e[r])return!1}return!0}(t.styles,e)&&o(t);t.styles=e}(t)},!0)}},_destruct:function(t){u.clearTimer(t.timer,!0),this.off(l.namespace)},resolve:o}}),l=e.events,u=e.functions,f=a.window}); 1517/*! formstone v1.4.22 [viewer.js] 2021-10-01 | GPL-3.0 License | formstone.it */ 1518!function(t){"function"==typeof define&&define.amd?define(["jquery","./core","./transition"],t):t(jQuery,Formstone)}(function(s,n){"use strict";function t(){Z.scrollTop()+n.windowHeight<0&&0}function l(){(E=s(I.base)).length?j.lockViewport(z):j.unlockViewport(z)}function c(t,e){t.isAnimating||(t.isAnimating=!0,t.$container=s('<div class="'+y.container+'"><img></div>'),t.$image=t.$container.find("img"),t.$viewport.append(t.$container),t.$image.one(b.load,function(){!function(t){(function(t){var e=function(t){var e=t[0],i=new Image;{if(void 0!==e.naturalHeight)return{naturalHeight:e.naturalHeight,naturalWidth:e.naturalWidth};if("img"===e.tagName.toLowerCase())return i.src=e.src,{naturalHeight:i.height,naturalWidth:i.width}}return!1}(t.$image);t.naturalHeight=e.naturalHeight,t.naturalWidth=e.naturalWidth,t.ratioHorizontal=t.naturalHeight/t.naturalWidth,t.ratioVertical=t.naturalWidth/t.naturalHeight,t.isWide=t.naturalWidth>t.naturalHeight})(t),o(t),t.containerTop=t.viewportHeight/2,t.containerLeft=t.viewportWidth/2,r(t),t.imageHeight=t.naturalHeight,t.imageWidth=t.naturalWidth,function(t){t.imageHeight=t.imageMinHeight,t.imageWidth=t.imageMinWidth}(t),a(t),g(t),m(t),d(t);var e={containerTop:t.containerTop,containerLeft:t.containerLeft,imageHeight:t.imageHeight,imageWidth:t.imageWidth,imageTop:t.imageTop,imageLeft:t.imageLeft};H(t,e),t.isRendering=!0}(t),t.isAnimating=!1,t.$container.fsTransition({property:"opacity"},function(){}),t.$el.removeClass(y.loading),t.$container.fsTouch({pan:!0,scale:!0}).on(b.scaleStart,t,v).on(b.scaleEnd,t,T).on(b.scale,t,W),t.$el.trigger(b.loaded)}).one(b.error,t,i).attr("src",e).addClass(y.image),!t.$image[0].complete&&4!==t.$image[0].readyState||t.$image.trigger(b.load),t.source=e)}function i(t){t.data.$el.trigger(b.error)}function o(t){t.viewportHeight=t.$viewport.outerHeight(),t.viewportWidth=t.$viewport.outerWidth()}function a(t){t.imageHeight<=t.viewportHeight?(t.containerMinTop=t.viewportHeight/2,t.containerMaxTop=t.viewportHeight/2):(t.containerMinTop=t.viewportHeight-t.imageHeight/2,t.containerMaxTop=t.imageHeight/2),t.imageWidth<=t.viewportWidth?(t.containerMinLeft=t.viewportWidth/2,t.containerMaxLeft=t.viewportWidth/2):(t.containerMinLeft=t.viewportWidth-t.imageWidth/2,t.containerMaxLeft=t.imageWidth/2)}function r(t){t.isWide?(t.imageMinWidth=t.viewportWidth,t.imageMinHeight=t.imageMinWidth*t.ratioHorizontal,t.imageMinHeight>t.viewportHeight&&(t.imageMinHeight=t.viewportHeight,t.imageMinWidth=t.imageMinHeight*t.ratioVertical)):(t.imageMinHeight=t.viewportHe
1518ight,t.imageMinWidth=t.imageMinHeight*t.ratioVertical,t.imageMinWidth>t.viewportWidth&&(t.imageMinWidth=t.viewportWidth,t.imageMinHeight=t.imageMinWidth*t.ratioHorizontal)),(t.imageMinWidth>t.naturalWidth||t.imageMinHeight>t.naturalHeight)&&(t.imageMinHeight=t.naturalHeight,t.imageMinWidth=t.naturalWidth),t.imageMaxHeight=t.naturalHeight,t.imageMaxWidth=t.naturalWidth}function g(t){t.imageTop=-t.imageHeight/2,t.imageLeft=-t.imageWidth/2}function m(t){t.lastContainerTop=t.containerTop,t.lastContainerLeft=t.containerLeft,t.lastImageHeight=t.imageHeight,t.lastImageWidth=t.imageWidth,t.lastImageTop=t.imageTop,t.lastImageLeft=t.imageLeft}function d(t){t.renderContainerTop=t.lastContainerTop,t.renderContainerLeft=t.lastContainerLeft,t.renderImageTop=t.lastImageTop,t.renderImageLeft=t.lastImageLeft,t.renderImageHeight=t.lastImageHeight,t.renderImageWidth=t.lastImageWidth}function h(t){t.imageHeight<t.imageMinHeight&&(t.imageHeight=t.imageMinHeight),t.imageHeight>t.imageMaxHeight&&(t.imageHeight=t.imageMaxHeight),t.imageWidth<t.imageMinWidth&&(t.imageWidth=t.imageMinWidth),t.imageWidth>t.imageMaxWidth&&(t.imageWidth=t.imageMaxWidth)}function u(t){t.containerTop<t.containerMinTop&&(t.containerTop=t.containerMinTop),t.containerTop>t.containerMaxTop&&(t.containerTop=t.containerMaxTop),t.containerLeft<t.containerMinLeft&&(t.containerLeft=t.containerMinLeft),t.containerLeft>t.containerMaxLeft&&(t.containerLeft=t.containerMaxLeft)}function f(t){null===t.tapTimer?t.tapTimer=j.startTimer(t.tapTimer,500,function(){p(t)}):(p(t),function(t){var e=t.imageHeight>t.imageMinHeight+1;t.isZooming=!0,m(t),d(t),e?(t.imageHeight=t.imageMinHeight,t.imageWidth=t.imageMinWidth):(t.imageHeight=t.imageMaxHeight,t.imageWidth=t.imageMaxWidth);a(t),u(t),g(t),t.isRendering=!0}(t))}function p(t){j.clearTimer(t.tapTimer),t.tapTimer=null}function H(t,e){if(n.transform){var i=e.imageWidth/t.naturalWidth,o=e.imageHeight/t.naturalHeight;t.$container.css(n.transform,"translate3d("+e.containerLeft+"px, "+e.containerTop+"px, 0)"),t.$image.css(n.transform,"translate3d(-50%, -50%, 0) scale("+i+","+o+")")}else t.$container.css({top:e.containerTop,left:e.containerLeft}),t.$image.css({height:e.imageHeight,width:e.imageWidth,top:e.imageTop,left:e.imageLeft})}function v(t){var e=t.data;f(e),m(e)}function W(t){var e=t.data;p(e),e.isRendering=!1,e.isZooming=!1;e.imageHeight,e.imageMinHeight;e.containerTop=e.lastContainerTop+t.deltaY,e.containerLeft=e.lastContainerLeft+t.deltaX,e.imageHeight=e.lastImageHeight*t.scale,e.imageWidth=e.lastImageWidth*t.scale,a(e),u(e),h(e),g(e),H(e,{containerTop:e.containerTop,containerLeft:e.containerLeft,imageHeight:e.imageHeight,imageWidth:e.imageWidth,imageTop:e.imageTop,imageLeft:e.imageLeft})}function T(t){var e=t.data;e.isZooming||(m(e),d(e),e.isRendering=!0)}function $(t){j.killEvent(t);var e=s(t.currentTarget),i=t.data;"out"==(e.hasClass(y.control_zoom_out)?"out":"in")?function(t){t.keyDownTime=1,t.action="zoom_out"}(i):function(t){t.keyDownTime=1,t.action="zoom_in"}(i)}function M(t){t.data.action=!1}function e(t){if(t.isRendering){if(t.action){t.keyDownTime+=t.zoomIncrement;var e=("zoom_out"===t.action?-1:1)*Math.round(t.imageWidth*t.keyDownTime-t.imageWidth);e>t.zoomDelta&&(e=t.zoomDelta),t.isWide?(t.imageWidth+=e,t.imageHeight=Math.round(t.imageWidth/t.ratioVertical)):(t.imageHeight+=e,t.imageWidth=Math.round(t.imageHeight/t.ratioHorizontal)),h(t),g(t),a(t),u(t)}t.renderContainerTop+=Math.round((t.containerTop-t.renderContainerTop)*t.zoomEnertia),t.renderContainerLeft+=Math.round((t.containerLeft-t.renderContainerLeft)*t.zoomEnertia),t.renderImageTop+=Math.round((t.imageTop-t.renderImageTop)*t.zoomEnertia),t.renderImageLeft+=Math.round((t.imageLeft-t.renderImageLeft)*t.zoomEnertia),t.renderImageHeight+=Math.round((t.imageHeight-t.renderImageHeight)*t.zoomEnertia),t.renderImageWidth+=Math.round((t.imageWidth-t.renderImageWidth)*t.zoomEnertia),H(t,{containerTop:t.renderContainerTop,containerLeft:t.renderContainerLeft,imageHeight:t.renderImageHeight,imageWidth:t.renderImageWidth,imageTop:t.renderImageTop,imageLeft:t.renderImageLeft})}}function w(t,e){t.isAnimating||(p(t),t.isAnimating=!0,t.isRendering=!1,t.isZooming=!1,function(t){t.$container&&t.$container.length&&t.$container.fsTouch("destroy").off(b.scaleStart,v).off(b.scaleEnd,T).off(b.scale,W)}(t),t.$container.fsTransition({property:"opacity"},function(){t.isAnimating=!1,t.$container.remove(),"function"==typeof e&&e.call(window,t)}),t.$el.addClass(y.loading))}function _(t){j.killEvent(t);var e=s(t.currentTarget),i=t.data,o=i.index+(e.hasClass(y.control_next)?1:-1);i.isAnimating||(o<0&&(o=0),o>
1518i.total&&(o=i.total),o!==i.index&&(i.index=o,w(i,function(){c(i,i.images[i.index])})),C(i))}function C(t){t.$controlItems.removeClass(y.control_disabled),0===t.index&&t.$controlPrevious.addClass(y.control_disabled),t.index===t.images.length-1&&t.$controlNext.addClass(y.control_disabled)}function L(t){o(t),a(t),r(t),g(t),a(t),u(t),h(t)}var x=n.Plugin("viewer",{widget:!0,defaults:{controls:!0,customClass:"",labels:{count:"of",next:"Next",previous:"Previous",zoom_in:"Zoom In",zoom_out:"Zoom Out"},theme:"fs-light",zoomDelta:100,zoomEnertia:.2,zoomIncrement:.01},classes:["source","wrapper","viewport","container","image","gallery","loading_icon","controls","controls_custom","control","control_previous","control_next","control_zoom_in","control_zoom_out","control_disabled","loading"],events:{loaded:"loaded",ready:"ready"},methods:{_construct:function(t){var e,i="",o=[y.control,y.control_previous].join(" "),n=[y.control,y.control_next].join(" "),a=[y.control,y.control_zoom_in].join(" "),r=[y.control,y.control_zoom_out].join(" ");t.thisClasses=[y.base,y.loading,t.customClass,t.theme],t.images=[],t.source=!1,t.gallery=!1,t.tapTimer=null,t.action=!1,t.isRendering=!1,t.isZooming=!1,t.isAnimating=!1,t.keyDownTime=1,t.$images=this.find("img").addClass(y.source),t.index=0,t.total=t.$images.length-1,t.customControls="object"==typeof t.controls&&t.controls.zoom_in&&t.controls.zoom_out,1<t.$images.length&&(t.gallery=!0,t.thisClasses.push(y.gallery),!t.customControls||t.controls.previous&&t.controls.next||(t.customControls=!1));for(var g=0;g<t.$images.length;g++)e=t.$images.eq(g),t.images.push(e.attr("src"));i+='<div class="'+y.wrapper+'">',i+='<div class="'+y.loading_icon+'"></div>',i+='<div class="'+y.viewport+'"></div>',i+="</div>",t.controls&&!t.customControls&&(i+='<div class="'+y.controls+'">',i+='<button type="button" class="'+o+'">'+t.labels.previous+"</button>",i+='<button type="button" class="'+r+'">'+t.labels.zoom_out+"</button>",i+='<button type="button" class="'+a+'">'+t.labels.zoom_in+"</button>",i+='<button type="button" class="'+n+'">'+t.labels.next+"</button>",i+="</div>"),this.addClass(t.thisClasses.join(" ")).prepend(i),t.$wrapper=this.find(I.wrapper),t.$viewport=this.find(I.viewport),t.customControls?(t.$controls=s(t.controls.container).addClass([y.controls,y.controls_custom].join(" ")),t.$controlPrevious=s(t.controls.previous).addClass(o),t.$controlNext=s(t.controls.next).addClass(n),t.$controlZoomIn=s(t.controls.zoom_in).addClass(a),t.$controlZoomOut=s(t.controls.zoom_out).addClass(r)):(t.$controls=this.find(I.controls),t.$controlPrevious=this.find(I.control_previous),t.$controlNext=this.find(I.control_next),t.$controlZoomIn=this.find(I.control_zoom_in),t.$controlZoomOut=this.find(I.control_zoom_out)),t.$controlItems=t.$controlPrevious.add(t.$controlNext),t.$controlZooms=t.$controlZoomIn.add(t.$controlZoomOut),l(),t.$controlItems.on(b.click,t,_),t.$controlZooms.on([b.touchStart,b.mouseDown].join(" "),t,$).on([b.touchEnd,b.mouseUp].join(" "),t,M),c(t,t.images[t.index],!0),C(t)},_destruct:function(t){t.$wrapper.remove(),t.$image.removeClass(y.source),t.controls&&!t.customControls&&t.$controls.remove(),t.customControls&&(t.$controls.removeClass([y.controls,y.controls_custom].join(" ")),t.$controlItems.off(b.click).removeClass([y.control,y.control_previous,y.control_next].join(" ")),t.$controlZooms.off([b.touchStart,b.mouseDown].join(" ")).off([b.touchStart,b.mouseDown].join(" ")).off([b.touchEnd,b.mouseUp].join(" ")).removeClass([y.control,y.control_zoom_in,y.control_zoom_out].join(" "))),this.removeClass(t.thisClasses.join(" ")).off(b.namespace),l()},_resize:function(){j.iterate.call(E,L)},_raf:function(){j.iterate.call(E,e)},resize:L,load:function(t,e){t.index=0,"string"==typeof e?(t.total=0,t.images=[e],t.gallery=!1,t.$el.removeClass(y.gallery)):(t.total=e.length-1,1<(t.images=e).length&&(t.gallery=!0,t.$el.addClass(y.gallery)),e=t.images[t.index]),w(t,function(){c(t,e)})},unload:function(t){w(t)}}}),z=x.namespace,I=x.classes,y=I.raw,b=x.events,j=x.functions,Z=(n.window,n.$window),E=[];n.Ready(function(){t(),Z.on("scroll",t),n.$body})});
vendor: 44,683 bytes, lines 1519-3062
1519/*! picturefill - v3.0.2 - 2016-02-12 1520 * https://scottjehl.github.io/picturefill/ 1521 * Copyright (c) 2016 https://github.com/scottjehl/picturefill/blob/master/Authors.txt; Licensed MIT 1522 */ 1523/*! Gecko-Picture - v1.0 1524 * https://github.com/scottjehl/picturefill/tree/3.0/src/plugins/gecko-picture 1525 * Firefox's early picture implementation (prior to FF41) is static and does 1526 * not react to viewport changes. This tiny module fixes this. 1527 */ 1528(function(window) { 1529 /*jshint eqnull:true */ 1530 var ua = navigator.userAgent; 1531 1532 if ( window.HTMLPictureElement && ((/ecko/).test(ua) && ua.match(/rv\:(\d+)/) && RegExp.$1 < 45) ) { 1533 addEventListener("resize", (function() { 1534 var timer; 1535 1536 var dummySrc = document.createElement("source"); 1537 1538 var fixRespimg = function(img) { 1539 var source, sizes; 1540 var picture = img.parentNode; 1541 1542 if (picture.nodeName.toUpperCase() === "PICTURE") { 1543 source = dummySrc.cloneNode(); 1544 1545 picture.insertBefore(source, picture.firstElementChild); 1546 setTimeout(function() { 1547 picture.removeChild(source); 1548 }); 1549 } else if (!img._pfLastSize || img.offsetWidth > img._pfLastSize) { 1550 img._pfLastSize = img.offsetWidth; 1551 sizes = img.sizes; 1552 img.sizes += ",100vw"; 1553 setTimeout(function() { 1554 img.sizes = sizes; 1555 }); 1556 } 1557 }; 1558 1559 var findPictureImgs = function() { 1560 var i; 1561 var imgs = document.querySelectorAll("picture > img, img[srcset][sizes]"); 1562 for (i = 0; i < imgs.length; i++) { 1563 fixRespimg(imgs[i]); 1564 } 1565 }; 1566 var onResize = function() { 1567 clearTimeout(timer); 1568 timer = setTimeout(findPictureImgs, 99); 1569 }; 1570 var mq = window.matchMedia && matchMedia("(orientation: landscape)"); 1571 var init = function() { 1572 onResize(); 1573 1574 if (mq && mq.addListener) { 1575 mq.addListener(onResize); 1576 } 1577 }; 1578 1579 dummySrc.srcset = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; 1580 1581 if (/^[c|i]|d$/.test(document.readyState || "")) { 1582 init(); 1583 } else { 1584 document.addEventListener("DOMContentLoaded", init); 1585 } 1586 1587 return onResize; 1588 })()); 1589 } 1590})(window); 1591 1592/*! Picturefill - v3.0.2 1593 * http://scottjehl.github.io/picturefill 1594 * Copyright (c) 2015 https://github.com/scottjehl/picturefill/blob/master/Authors.txt; 1595 * License: MIT 1596 */ 1597 1598(function( window, document, undefined ) { 1599 // Enable strict mode 1600 "use strict"; 1601 1602 // HTML shim|v it for old IE (IE9 will still need the HTML video tag workaround) 1603 document.createElement( "picture" ); 1604 1605 var warn, eminpx, alwaysCheckWDescriptor, evalId; 1606 // local object for method references and testing exposure 1607 var pf = {}; 1608 var isSupportTestReady = false; 1609 var noop = function() {}; 1610 var image = document.createElement( "img" ); 1611 var getImgAttr = image.getAttribute; 1612 var setImgAttr = image.setAttribute; 1613 var removeImgAttr = image.removeAttribute; 1614 var docElem = document.documentElement; 1615 var types = {}; 1616 var cfg = { 1617 //resource selection: 1618 algorithm: "" 1619 }; 1620 var srcAttr = "data-pfsrc"; 1621 var srcsetAttr = srcAttr + "set"; 1622 // ua sniffing is done for undetectable img loading features, 1623 // to do some non crucial perf optimizations 1624 var ua = navigator.userAgent; 1625 var supportAbort = (/rident/).test(ua) || ((/ecko/).test(ua) && ua.match(/rv\:(\d+)/) && RegExp.$1 > 35 ); 1626 var curSrcProp = "currentSrc"; 1627 var regWDesc = /\s+\+?\d+(e\d+)?w/; 1628 var regSize = /(\([^)]+\))?\s*(.+)/; 1629 var setOptions = window.picturefillCFG; 1630 /** 1631 * Shortcut property for https://w3c.github.io/webappsec/specs/mixedcontent/#restricts-mixed-content ( for easy overriding in tests ) 1632 */ 1633 // baseStyle also used by getEmValue (i.e.: width: 1em is important) 1634 var baseStyle = "position:absolute;left:0;visibility:hidden;display:block;padding:0;border:none;font-size:1em;width:1em;overflow:hidden;clip:rect(0px, 0px, 0px, 0px)"; 1635 var fsCss = "font-size:100%!important;"; 1636 var isVwDirty = true; 1637 1638 var cssCache = {}; 1639 var sizeLengthCache = {}; 1640 var DPR = window.devicePixelRatio; 1641 var units = { 1642 px: 1, 1643 "in": 96 1644 }; 1645 var anchor = document.createElement( "a" ); 1646 /** 1647 * alreadyRun flag used for setOptions. is it true setOptions will reevaluate 1648 * @type {boolean} 1649 */ 1650 var alreadyRun = false; 1651 1652 // Reusable, non-"g" Regexes 1653 1654 // (Don't use \s, to avoid matching non-breaking space.) 1655 var regexLeadingSpaces = /^[ \t\n\r\u000c]+/, 1656 regexLeadingCommasOrSpaces = /^[, \t\n\r\u000c]+/, 1657 regexLeadingNotSpaces = /^[^ \t\n\r\u000c]+/, 1658 regexTrailingCommas = /[,]+$/, 1659 regexNonNegativeInteger = /^\d+$/, 1660 1661 // ( Positive or negative or unsigned integers or decimals, without or without exponents. 1662 // Must include at least one digit. 1663 // According to spec tests any decimal point must be followed by a digit. 1664 // No leading plus sign is allowed.) 1665 // https://html.spec.whatwg.org/multipage/infrastructure.html#valid-floating-point-number 1666 regexFloatingPoint = /^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/; 1667 1668 var on = function(obj, evt, fn, capture) { 1669 if ( obj.addEventListener ) { 1670 obj.addEventListener(evt, fn, capture || false); 1671 } else if ( obj.attachEvent ) { 1672 obj.attachEvent( "on" + evt, fn); 1673 } 1674 }; 1675 1676 /** 1677 * simple memoize function: 1678 */ 1679 1680 var memoize = function(fn) { 1681 var cache = {}; 1682 return function(input) { 1683 if ( !(input in cache) ) { 1684 cache[ input ] = fn(input); 1685 } 1686 return cache[ input ]; 1687 }; 1688 }; 1689 1690 // UTILITY FUNCTIONS 1691 1692 // Manual is faster than RegEx 1693 // http://jsperf.com/whitespace-character/5 1694 function isSpace(c) { 1695 return (c === "\u0020" || // space 1696 c === "\u0009" || // horizontal tab 1697 c === "\u000A" || // new line 1698 c === "\u000C" || // form feed 1699 c === "\u000D"); // carriage return 1700 } 1701 1702 /** 1703 * gets a mediaquery and returns a boolean or gets a css length and returns a number 1704 * @param css mediaqueries or css length 1705 * @returns {boolean|number} 1706 * 1707 * based on: https://gist.github.com/jonathantneal/db4f77009b155f083738 1708 */ 1709 var evalCSS = (function() { 1710 1711 var regLength = /^([\d\.]+)(em|vw|px)$/; 1712 var replace = function() { 1713 var args = arguments, index = 0, string = args[0]; 1714 while (++index in args) { 1715 string = string.replace(args[index], args[++index]); 1716 } 1717 return string; 1718 }; 1719 1720 var buildStr = memoize(function(css) { 1721 1722 return "return " + replace((css || "").toLowerCase(), 1723 // interpret `and` 1724 /\band\b/g, "&&", 1725 1726 // interpret `,` 1727 /,/g, "||", 1728 1729 // interpret `min-` as >= 1730 /min-([a-z-\s]+):/g, "e.$1>=", 1731 1732 // interpret `max-` as <= 1733 /max-([a-z-\s]+):/g, "e.$1<=", 1734 1735 //calc value 1736 /calc([^)]+)/g, "($1)", 1737 1738 // interpret css values 1739 /(\d+[\.]*[\d]*)([a-z]+)/g, "($1 * e.$2)", 1740 //make eval less evil 1741 /^(?!(e.[a-z]|[0-9\.&=|><\+\-\*\(\)\/])).*/ig, "" 1742 ) + ";"; 1743 }); 1744 1745 return function(css, length) { 1746 var parsedLength; 1747 if (!(css in cssCache)) { 1748 cssCache[css] = false; 1749 if (length && (parsedLength = css.match( regLength ))) { 1750 cssCache[css] = parsedLength[ 1 ] * units[parsedLength[ 2 ]]; 1751 } else { 1752 /*jshint evil:true */ 1753 try{ 1754 cssCache[css] = new Function("e", buildStr(css))(units); 1755 } catch(e) {} 1756 /*jshint evil:false */ 1757 } 1758 } 1759 return cssCache[css]; 1760 }; 1761 })(); 1762 1763 var setResolution = function( candidate, sizesattr ) { 1764 if ( candidate.w ) { // h = means height: || descriptor.type === 'h' do not handle yet... 1765 candidate.cWidth = pf.calcListLength( sizesattr || "100vw" ); 1766 candidate.res = candidate.w / candidate.cWidth ; 1767 } else { 1768 candidate.res = candidate.d; 1769 } 1770 return candidate; 1771 }; 1772 1773 /** 1774 * 1775 * @param opt 1776 */ 1777 var picturefill = function( opt ) { 1778 1779 if (!isSupportTestReady) {return;} 1780 1781 var elements, i, plen; 1782 1783 var options = opt || {}; 1784 1785 if ( options.elements && options.elements.nodeType === 1 ) { 1786 if ( options.elements.nodeName.toUpperCase() === "IMG" ) { 1787 options.elements = [ options.elements ]; 1788 } else { 1789 options.context = options.elements; 1790 options.elements = null; 1791 } 1792 } 1793 1794 elements = options.elements || pf.qsa( (options.context || document), ( options.reevaluate || options.reselect ) ? pf.sel : pf.selShort ); 1795 1796 if ( (plen = elements.length) ) { 1797 1798 pf.setupRun( options ); 1799 alreadyRun = true; 1800 1801 // Loop through all elements 1802 for ( i = 0; i < plen; i++ ) { 1803 pf.fillImg(elements[ i ], options); 1804 } 1805 1806 pf.teardownRun( options ); 1807 } 1808 }; 1809 1810 /** 1811 * outputs a warning for the developer 1812 * @param {message} 1813 * @type {Function} 1814 */ 1815 warn = ( window.console && console.warn ) ? 1816 function( message ) { 1817 console.warn( message ); 1818 } : 1819 noop 1820 ; 1821 1822 if ( !(curSrcProp in image) ) { 1823 curSrcProp = "src"; 1824 } 1825 1826 // Add support for standard mime types. 1827 types[ "image/jpeg" ] = true; 1828 types[ "image/gif" ] = true; 1829 types[ "image/png" ] = true; 1830 1831 function detectTypeSupport( type, typeUri ) { 1832 // based on Modernizr's lossless img-webp test 1833 // note: asynchronous 1834 var image = new window.Image(); 1835 image.onerror = function() { 1836 types[ type ] = false; 1837 picturefill(); 1838 }; 1839 image.onload = function() { 1840 types[ type ] = image.width === 1; 1841 picturefill(); 1842 }; 1843 image.src = typeUri; 1844 return "pending"; 1845 } 1846 1847 // test svg support 1848 types[ "image/svg+xml" ] = document.implementation.hasFeature( "http://www.w3.org/TR/SVG11/feature#Image", "1.1" ); 1849 1850 /** 1851 * updates the internal vW property with the current viewport width in px 1852 */ 1853 function updateMetrics() { 1854 1855 isVwDirty = false; 1856 DPR = window.devicePixelRatio; 1857 cssCache = {}; 1858 sizeLengthCache = {}; 1859 1860 pf.DPR = DPR || 1; 1861 1862 units.width = Math.max(window.innerWidth || 0, docElem.clientWidth); 1863 units.height = Math.max(window.innerHeight || 0, docElem.clientHeight); 1864 1865 units.vw = units.width / 100; 1866 units.vh = units.height / 100; 1867 1868 evalId = [ units.height, units.width, DPR ].join("-"); 1869 1870 units.em = pf.getEmValue(); 1871 units.rem = units.em; 1872 } 1873 1874 function chooseLowRes( lowerValue, higherValue, dprValue, isCached ) { 1875 var bonusFactor, tooMuch, bonus, meanDensity; 1876 1877 //experimental 1878 if (cfg.algorithm === "saveData" ){ 1879 if ( lowerValue > 2.7 ) { 1880 meanDensity = dprValue + 1; 1881 } else { 1882 tooMuch = higherValue - dprValue; 1883 bonusFactor = Math.pow(lowerValue - 0.6, 1.5); 1884 1885 bonus = tooMuch * bonusFactor; 1886 1887 if (isCached) { 1888 bonus += 0.1 * bonusFactor; 1889 } 1890 1891 meanDensity = lowerValue + bonus; 1892 } 1893 } else { 1894 meanDensity = (dprValue > 1) ? 1895 Math.sqrt(lowerValue * higherValue) : 1896 lowerValue; 1897 } 1898 1899 return meanDensity > dprValue; 1900 } 1901 1902 function applyBestCandidate( img ) { 1903 var srcSetCandidates; 1904 var matchingSet = pf.getSet( img ); 1905 var evaluated = false; 1906 if ( matchingSet !== "pending" ) { 1907 evaluated = evalId; 1908 if ( matchingSet ) { 1909 srcSetCandidates = pf.setRes( matchingSet ); 1910 pf.applySetCandidate( srcSetCandidates, img ); 1911 } 1912 } 1913 img[ pf.ns ].evaled = evaluated; 1914 } 1915 1916 function ascendingSort( a, b ) { 1917 return a.res - b.res; 1918 } 1919 1920 function setSrcToCur( img, src, set ) { 1921 var candidate; 1922 if ( !set && src ) { 1923 set = img[ pf.ns ].sets; 1924 set = set && set[set.length - 1]; 1925 } 1926 1927 candidate = getCandidateForSrc(src, set); 1928 1929 if ( candidate ) { 1930 src = pf.makeUrl(src); 1931 img[ pf.ns ].curSrc = src; 1932 img[ pf.ns ].curCan = candidate; 1933 1934 if ( !candidate.res ) { 1935 setResolution( candidate, candidate.set.sizes ); 1936 } 1937 } 1938 return candidate; 1939 } 1940 1941 function getCandidateForSrc( src, set ) { 1942 var i, candidate, candidates; 1943 if ( src && set ) { 1944 candidates = pf.parseSet( set ); 1945 src = pf.makeUrl(src); 1946 for ( i = 0; i < candidates.length; i++ ) { 1947 if ( src === pf.makeUrl(candidates[ i ].url) ) { 1948 candidate = candidates[ i ]; 1949 break; 1950 } 1951 } 1952 } 1953 return candidate; 1954 } 1955 1956 function getAllSourceElements( picture, candidates ) { 1957 var i, len, source, srcset; 1958 1959 // SPEC mismatch intended for size and perf: 1960 // actually only source elements preceding the img should be used 1961 // also note: don't use qsa here, because IE8 sometimes doesn't like source as the key part in a selector 1962 var sources = picture.getElementsByTagName( "source" ); 1963 1964 for ( i = 0, len = sources.length; i < len; i++ ) { 1965 source = sources[ i ]; 1966 source[ pf.ns ] = true; 1967 srcset = source.getAttribute( "srcset" ); 1968 1969 // if source does not have a srcset attribute, skip 1970 if ( srcset ) { 1971 candidates.push( { 1972 srcset: srcset, 1973 media: source.getAttribute( "media" ), 1974 type: source.getAttribute( "type" ), 1975 sizes: source.getAttribute( "sizes" ) 1976 } ); 1977 } 1978 } 1979 } 1980 1981 /** 1982 * Srcset Parser 1983 * By Alex Bell | MIT License 1984 * 1985 * @returns Array [{url: _, d: _, w: _, h:_, set:_(????)}, ...] 1986 * 1987 * Based super duper closely on the reference algorithm at: 1988 * https://html.spec.whatwg.org/multipage/embedded-content.html#parse-a-srcset-attribute 1989 */ 1990 1991 // 1. Let input be the value passed to this algorithm. 1992 // (TO-DO : Explain what "set" argument is here. Maybe choose a more 1993 // descriptive & more searchable name. Since passing the "set" in really has 1994 // nothing to do with parsing proper, I would prefer this assignment eventually 1995 // go in an external fn.) 1996 function parseSrcset(input, set) { 1997 1998 function collectCharacters(regEx) { 1999 var chars, 2000 match = regEx.exec(input.substring(pos)); 2001 if (match) { 2002 chars = match[ 0 ]; 2003 pos += chars.length; 2004 return chars; 2005 } 2006 } 2007 2008 var inputLength = input.length, 2009 url, 2010 descriptors, 2011 currentDescriptor, 2012 state, 2013 c, 2014 2015 // 2. Let position be a pointer into input, initially pointing at the start 2016 // of the string. 2017 pos = 0, 2018 2019 // 3. Let candidates be an initially empty source set. 2020 candidates = []; 2021 2022 /** 2023 * Adds descriptor properties to a candidate, pushes to the candidates array 2024 * @return undefined 2025 */ 2026 // (Declared outside of the while loop so that it's only created once. 2027 // (This fn is defined before it is used, in order to pass JSHINT. 2028 // Unfortunately this breaks the sequencing of the spec comments. :/ ) 2029 function parseDescriptors() { 2030 2031 // 9. Descriptor parser: Let error be no. 2032 var pError = false, 2033 2034 // 10. Let width be absent. 2035 // 11. Let density be absent. 2036 // 12. Let future-compat-h be absent. (We're implementing it now as h) 2037 w, d, h, i, 2038 candidate = {}, 2039 desc, lastChar, value, intVal, floatVal; 2040 2041 // 13. For each descriptor in descriptors, run the appropriate set of steps 2042 // from the following list: 2043 for (i = 0 ; i < descriptors.length; i++) { 2044 desc = descriptors[ i ]; 2045 2046 lastChar = desc[ desc.length - 1 ]; 2047 value = desc.substring(0, desc.length - 1); 2048 intVal = parseInt(value, 10); 2049 floatVal = parseFloat(value); 2050 2051 // If the descriptor consists of a valid non-negative integer followed by 2052 // a U+0077 LATIN SMALL LETTER W character 2053 if (regexNonNegativeInteger.test(value) && (lastChar === "w")) { 2054 2055 // If width and density are not both absent, then let error be yes. 2056 if (w || d) {pError = true;} 2057 2058 // Apply the rules for parsing non-negative integers to the descriptor. 2059 // If the result is zero, let error be yes. 2060 // Otherwise, let width be the result. 2061 if (intVal === 0) {pError = true;} else {w = intVal;} 2062 2063 // If the descriptor consists of a valid floating-point number followed by 2064 // a U+0078 LATIN SMALL LETTER X character 2065 } else if (regexFloatingPoint.test(value) && (lastChar === "x")) { 2066 2067 // If width, density and future-compat-h are not all absent, then let error 2068 // be yes. 2069 if (w || d || h) {pError = true;} 2070 2071 // Apply the rules for parsing floating-point number values to the descriptor. 2072 // If the result is less than zero, let error be yes. Otherwise, let density 2073 // be the result. 2074 if (floatVal < 0) {pError = true;} else {d = floatVal;} 2075 2076 // If the descriptor consists of a valid non-negative integer followed by 2077 // a U+0068 LATIN SMALL LETTER H character 2078 } else if (regexNonNegativeInteger.test(value) && (lastChar === "h")) { 2079 2080 // If height and density are not both absent, then let error be yes. 2081 if (h || d) {pError = true;} 2082 2083 // Apply the rules for parsing non-negative integers to the descriptor. 2084 // If the result is zero, let error be yes. Otherwise, let future-compat-h 2085 // be the result. 2086 if (intVal === 0) {pError = true;} else {h = intVal;} 2087 2088 // Anything else, Let error be yes. 2089 } else {pError = true;} 2090 } // (close step 13 for loop) 2091 2092 // 15. If error is still no, then append a new image source to candidates whose 2093 // URL is url, associated with a width width if not absent and a pixel 2094 // density density if not absent. Otherwise, there is a parse error. 2095 if (!pError) { 2096 candidate.url = url; 2097 2098 if (w) { candidate.w = w;} 2099 if (d) { candidate.d = d;} 2100 if (h) { candidate.h = h;} 2101 if (!h && !d && !w) {candidate.d = 1;} 2102 if (candidate.d === 1) {set.has1x = true;} 2103 candidate.set = set; 2104 2105 candidates.push(candidate); 2106 } 2107 } // (close parseDescriptors fn) 2108 2109 /** 2110 * Tokenizes descriptor properties prior to parsing 2111 * Returns undefined. 2112 * (Again, this fn is defined before it is used, in order to pass JSHINT. 2113 * Unfortunately this breaks the logical sequencing of the spec comments. :/ ) 2114 */ 2115 function tokenize() { 2116 2117 // 8.1. Descriptor tokeniser: Skip whitespace 2118 collectCharacters(regexLeadingSpaces); 2119 2120 // 8.2. Let current descriptor be the empty string. 2121 currentDescriptor = ""; 2122 2123 // 8.3. Let state be in descriptor. 2124 state = "in descriptor"; 2125 2126 while (true) { 2127 2128 // 8.4. Let c be the character at position. 2129 c = input.charAt(pos); 2130 2131 // Do the following depending on the value of state. 2132 // For the purpose of this step, "EOF" is a special character representing 2133 // that position is past the end of input. 2134 2135 // In descriptor 2136 if (state === "in descriptor") { 2137 // Do the following, depending on the value of c: 2138 2139 // Space character 2140 // If current descriptor is not empty, append current descriptor to 2141 // descriptors and let current descriptor be the empty string. 2142 // Set state to after descriptor. 2143 if (isSpace(c)) { 2144 if (currentDescriptor) { 2145 descriptors.push(currentDescriptor); 2146 currentDescriptor = ""; 2147 state = "after descriptor"; 2148 } 2149 2150 // U+002C COMMA (,) 2151 // Advance position to the next character in input. If current descriptor 2152 // is not empty, append current descriptor to descriptors. Jump to the step 2153 // labeled descriptor parser. 2154 } else if (c === ",") { 2155 pos += 1; 2156 if (currentDescriptor) { 2157 descriptors.push(currentDescriptor); 2158 } 2159 parseDescriptors(); 2160 return; 2161 2162 // U+0028 LEFT PARENTHESIS (() 2163 // Append c to current descriptor. Set state to in parens. 2164 } else if (c === "\u0028") { 2165 currentDescriptor = currentDescriptor + c; 2166 state = "in parens"; 2167 2168 // EOF 2169 // If current descriptor is not empty, append current descriptor to 2170 // descriptors. Jump to the step labeled descriptor parser. 2171 } else if (c === "") { 2172 if (currentDescriptor) { 2173 descriptors.push(currentDescriptor); 2174 } 2175 parseDescriptors(); 2176 return; 2177 2178 // Anything else 2179 // Append c to current descriptor. 2180 } else { 2181 currentDescriptor = currentDescriptor + c; 2182 } 2183 // (end "in descriptor" 2184 2185 // In parens 2186 } else if (state === "in parens") { 2187 2188 // U+0029 RIGHT PARENTHESIS ()) 2189 // Append c to current descriptor. Set state to in descriptor. 2190 if (c === ")") { 2191 currentDescriptor = currentDescriptor + c; 2192 state = "in descriptor"; 2193 2194 // EOF 2195 // Append current descriptor to descriptors. Jump to the step labeled 2196 // descriptor parser. 2197 } else if (c === "") { 2198 descriptors.push(currentDescriptor); 2199 parseDescriptors(); 2200 return; 2201 2202 // Anything else 2203 // Append c to current descriptor. 2204 } else { 2205 currentDescriptor = currentDescriptor + c; 2206 } 2207 2208 // After descriptor 2209 } else if (state === "after descriptor") { 2210 2211 // Do the following, depending on the value of c: 2212 // Space character: Stay in this state. 2213 if (isSpace(c)) { 2214 2215 // EOF: Jump to the step labeled descriptor parser. 2216 } else if (c === "") { 2217 parseDescriptors(); 2218 return; 2219 2220 // Anything else 2221 // Set state to in descriptor. Set position to the previous character in input. 2222 } else { 2223 state = "in descriptor"; 2224 pos -= 1; 2225 2226 } 2227 } 2228 2229 // Advance position to the next character in input. 2230 pos += 1; 2231 2232 // Repeat this step. 2233 } // (close while true loop) 2234 } 2235 2236 // 4. Splitting loop: Collect a sequence of characters that are space 2237 // characters or U+002C COMMA characters. If any U+002C COMMA characters 2238 // were collected, that is a parse error. 2239 while (true) { 2240 collectCharacters(regexLeadingCommasOrSpaces); 2241 2242 // 5. If position is past the end of input, return candidates and abort these steps. 2243 if (pos >= inputLength) { 2244 return candidates; // (we're done, this is the sole return path) 2245 } 2246 2247 // 6. Collect a sequence of characters that are not space characters, 2248 // and let that be url. 2249 url = collectCharacters(regexLeadingNotSpaces); 2250 2251 // 7. Let descriptors be a new empty list. 2252 descriptors = []; 2253 2254 // 8. If url ends with a U+002C COMMA character (,), follow these substeps: 2255 // (1). Remove all trailing U+002C COMMA characters from url. If this removed 2256 // more than one character, that is a parse error. 2257 if (url.slice(-1) === ",") { 2258 url = url.replace(regexTrailingCommas, ""); 2259 // (Jump ahead to step 9 to skip tokenization and just push the candidate). 2260 parseDescriptors(); 2261 2262 // Otherwise, follow these substeps: 2263 } else { 2264 tokenize(); 2265 } // (close else of step 8) 2266 2267 // 16. Return to the step labeled splitting loop. 2268 } // (Close of big while loop.) 2269 } 2270 2271 /* 2272 * Sizes Parser 2273 * 2274 * By Alex Bell | MIT License 2275 * 2276 * Non-strict but accurate and lightweight JS Parser for the string value <img sizes="here"> 2277 * 2278 * Reference algorithm at: 2279 * https://html.spec.whatwg.org/multipage/embedded-content.html#parse-a-sizes-attribute 2280 * 2281 * Most comments are copied in directly from the spec 2282 * (except for comments in parens). 2283 * 2284 * Grammar is: 2285 * <source-size-list> = <source-size># [ , <source-size-value> ]? | <source-size-value> 2286 * <source-size> = <media-condition> <source-size-value> 2287 * <source-size-value> = <length> 2288 * http://www.w3.org/html/wg/drafts/html/master/embedded-content.html#attr-img-sizes 2289 * 2290 * E.g. "(max-width: 30em) 100vw, (max-width: 50em) 70vw, 100vw" 2291 * or "(min-width: 30em), calc(30vw - 15px)" or just "30vw" 2292 * 2293 * Returns the first valid <css-length> with a media condition that evaluates to true, 2294 * or "100vw" if all valid media conditions evaluate to false. 2295 * 2296 */ 2297 2298 function parseSizes(strValue) { 2299 2300 // (Percentage CSS lengths are not allowed in this case, to avoid confusion: 2301 // https://html.spec.whatwg.org/multipage/embedded-content.html#valid-source-size-list 2302 // CSS allows a single optional plus or minus sign: 2303 // http://www.w3.org/TR/CSS2/syndata.html#numbers 2304 // CSS is ASCII case-insensitive: 2305 // http://www.w3.org/TR/CSS2/syndata.html#characters ) 2306 // Spec allows exponential notation for <number> type: 2307 // http://dev.w3.org/csswg/css-values/#numbers 2308 var regexCssLengthWithUnits = /^(?:[+-]?[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?(?:ch|cm|em|ex|in|mm|pc|pt|px|rem|vh|vmin|vmax|vw)$/i; 2309 2310 // (This is a quick and lenient test. Because of optional unlimited-depth internal 2311 // grouping parens and strict spacing rules, this could get very complicated.) 2312 var regexCssCalc = /^calc\((?:[0-9a-z \.\+\-\*\/\(\)]+)\)$/i; 2313 2314 var i; 2315 var unparsedSizesList; 2316 var unparsedSizesListLength; 2317 var unparsedSize; 2318 var lastComponentValue; 2319 var size; 2320 2321 // UTILITY FUNCTIONS 2322 2323 // (Toy CSS parser. The goals here are: 2324 // 1) expansive test coverage without the weight of a full CSS parser. 2325 // 2) Avoiding regex wherever convenient. 2326 // Quick tests: http://jsfiddle.net/gtntL4gr/3/ 2327 // Returns an array of arrays.) 2328 function parseComponentValues(str) { 2329 var chrctr; 2330 var component = ""; 2331 var componentArray = []; 2332 var listArray = []; 2333 var parenDepth = 0; 2334 var pos = 0; 2335 var inComment = false; 2336 2337 function pushComponent() { 2338 if (component) { 2339 componentArray.push(component); 2340 component = ""; 2341 } 2342 } 2343 2344 function pushComponentArray() { 2345 if (componentArray[0]) { 2346 listArray.push(componentArray); 2347 componentArray = []; 2348 } 2349 } 2350 2351 // (Loop forwards from the beginning of the string.) 2352 while (true) { 2353 chrctr = str.charAt(pos); 2354 2355 if (chrctr === "") { // ( End of string reached.) 2356 pushComponent(); 2357 pushComponentArray(); 2358 return listArray; 2359 } else if (inComment) { 2360 if ((chrctr === "*") && (str[pos + 1] === "/")) { // (At end of a comment.) 2361 inComment = false; 2362 pos += 2; 2363 pushComponent(); 2364 continue; 2365 } else { 2366 pos += 1; // (Skip all characters inside comments.) 2367 continue; 2368 } 2369 } else if (isSpace(chrctr)) { 2370 // (If previous character in loop was also a space, or if 2371 // at the beginning of the string, do not add space char to 2372 // component.) 2373 if ( (str.charAt(pos - 1) && isSpace( str.charAt(pos - 1) ) ) || !component ) { 2374 pos += 1; 2375 continue; 2376 } else if (parenDepth === 0) { 2377 pushComponent(); 2378 pos +=1; 2379 continue; 2380 } else { 2381 // (Replace any space character with a plain space for legibility.) 2382 chrctr = " "; 2383 } 2384 } else if (chrctr === "(") { 2385 parenDepth += 1; 2386 } else if (chrctr === ")") { 2387 parenDepth -= 1; 2388 } else if (chrctr === ",") { 2389 pushComponent(); 2390 pushComponentArray(); 2391 pos += 1; 2392 continue; 2393 } else if ( (chrctr === "/") && (str.charAt(pos + 1) === "*") ) { 2394 inComment = true; 2395 pos += 2; 2396 continue; 2397 } 2398 2399 component = component + chrctr; 2400 pos += 1; 2401 } 2402 } 2403 2404 function isValidNonNegativeSourceSizeValue(s) { 2405 if (regexCssLengthWithUnits.test(s) && (parseFloat(s) >= 0)) {return true;} 2406 if (regexCssCalc.test(s)) {return true;} 2407 // ( http://www.w3.org/TR/CSS2/syndata.html#numbers says: 2408 // "-0 is equivalent to 0 and is not a negative number." which means that 2409 // unitless zero and unitless negative zero must be accepted as special cases.) 2410 if ((s === "0") || (s === "-0") || (s === "+0")) {return true;} 2411 return false; 2412 } 2413 2414 // When asked to parse a sizes attribute from an element, parse a 2415 // comma-separated list of component values from the value of the element's 2416 // sizes attribute (or the empty string, if the attribute is absent), and let 2417 // unparsed sizes list be the result. 2418 // http://dev.w3.org/csswg/css-syntax/#parse-comma-separated-list-of-component-values 2419 2420 unparsedSizesList = parseComponentValues(strValue); 2421 unparsedSizesListLength = unparsedSizesList.length; 2422 2423 // For each unparsed size in unparsed sizes list: 2424 for (i = 0; i < unparsedSizesListLength; i++) { 2425 unparsedSize = unparsedSizesList[i]; 2426 2427 // 1. Remove all consecutive <whitespace-token>s from the end of unparsed size. 2428 // ( parseComponentValues() already omits spaces outside of parens. ) 2429 2430 // If unparsed size is now empty, that is a parse error; continue to the next 2431 // iteration of this algorithm. 2432 // ( parseComponentValues() won't push an empty array. ) 2433 2434 // 2. If the last component value in unparsed size is a valid non-negative 2435 // <source-size-value>, let size be its value and remove the component value 2436 // from unparsed size. Any CSS function other than the calc() function is 2437 // invalid. Otherwise, there is a parse error; continue to the next iteration 2438 // of this algorithm. 2439 // http://dev.w3.org/csswg/css-syntax/#parse-component-value 2440 lastComponentValue = unparsedSize[unparsedSize.length - 1]; 2441 2442 if (isValidNonNegativeSourceSizeValue(lastComponentValue)) { 2443 size = lastComponentValue; 2444 unparsedSize.pop(); 2445 } else { 2446 continue; 2447 } 2448 2449 // 3. Remove all consecutive <whitespace-token>s from the end of unparsed 2450 // size. If unparsed size is now empty, return size and exit this algorithm. 2451 // If this was not the last item in unparsed sizes list, that is a parse error. 2452 if (unparsedSize.length === 0) { 2453 return size; 2454 } 2455 2456 // 4. Parse the remaining component values in unparsed size as a 2457 // <media-condition>. If it does not parse correctly, or it does parse 2458 // correctly but the <media-condition> evaluates to false, continue to the 2459 // next iteration of this algorithm. 2460 // (Parsing all possible compound media conditions in JS is heavy, complicated, 2461 // and the payoff is unclear. Is there ever an situation where the 2462 // media condition parses incorrectly but still somehow evaluates to true? 2463 // Can we just rely on the browser/polyfill to do it?) 2464 unparsedSize = unparsedSize.join(" "); 2465 if (!(pf.matchesMedia( unparsedSize ) ) ) { 2466 continue; 2467 } 2468 2469 // 5. Return size and exit this algorithm. 2470 return size; 2471 } 2472 2473 // If the above algorithm exhausts unparsed sizes list without returning a 2474 // size value, return 100vw. 2475 return "100vw"; 2476 } 2477 2478 // namespace 2479 pf.ns = ("pf" + new Date().getTime()).substr(0, 9); 2480 2481 // srcset support test 2482 pf.supSrcset = "srcset" in image; 2483 pf.supSizes = "sizes" in image; 2484 pf.supPicture = !!window.HTMLPictureElement; 2485 2486 // UC browser does claim to support srcset and picture, but not sizes, 2487 // this extended test reveals the browser does support nothing 2488 if (pf.supSrcset && pf.supPicture && !pf.supSizes) { 2489 (function(image2) { 2490 image.srcset = "data:,a"; 2491 image2.src = "data:,a"; 2492 pf.supSrcset = image.complete === image2.complete; 2493 pf.supPicture = pf.supSrcset && pf.supPicture; 2494 })(document.createElement("img")); 2495 } 2496 2497 // Safari9 has basic support for sizes, but does't expose the `sizes` idl attribute 2498 if (pf.supSrcset && !pf.supSizes) { 2499 2500 (function() { 2501 var width2 = "data:image/gif;base64,R0lGODlhAgABAPAAAP///wAAACH5BAAAAAAALAAAAAACAAEAAAICBAoAOw=="; 2502 var width1 = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; 2503 var img = document.createElement("img"); 2504 var test = function() { 2505 var width = img.width; 2506 2507 if (width === 2) { 2508 pf.supSizes = true; 2509 } 2510 2511 alwaysCheckWDescriptor = pf.supSrcset && !pf.supSizes; 2512 2513 isSupportTestReady = true; 2514 // force async 2515 setTimeout(picturefill); 2516 }; 2517 2518 img.onload = test; 2519 img.onerror = test; 2520 img.setAttribute("sizes", "9px"); 2521 2522 img.srcset = width1 + " 1w," + width2 + " 9w"; 2523 img.src = width1; 2524 })(); 2525 2526 } else { 2527 isSupportTestReady = true; 2528 } 2529 2530 // using pf.qsa instead of dom traversing does scale much better, 2531 // especially on sites mixing responsive and non-responsive images 2532 pf.selShort = "picture>img,img[srcset]"; 2533 pf.sel = pf.selShort; 2534 pf.cfg = cfg; 2535 2536 /** 2537 * Shortcut property for `devicePixelRatio` ( for easy overriding in tests ) 2538 */ 2539 pf.DPR = (DPR || 1 ); 2540 pf.u = units; 2541 2542 // container of supported mime types that one might need to qualify before using 2543 pf.types = types; 2544 2545 pf.setSize = noop; 2546 2547 /** 2548 * Gets a string and returns the absolute URL 2549 * @param src 2550 * @returns {String} absolute URL 2551 */ 2552 2553 pf.makeUrl = memoize(function(src) { 2554 anchor.href = src; 2555 return anchor.href; 2556 }); 2557 2558 /** 2559 * Gets a DOM element or document and a selctor and returns the found matches 2560 * Can be extended with jQuery/Sizzle for IE7 support 2561 * @param context 2562 * @param sel 2563 * @returns {NodeList|Array} 2564 */ 2565 pf.qsa = function(context, sel) { 2566 return ( "querySelector" in context ) ? context.querySelectorAll(sel) : []; 2567 }; 2568 2569 /** 2570 * Shortcut method for matchMedia ( for easy overriding in tests ) 2571 * wether native or pf.mMQ is used will be decided lazy on first call 2572 * @returns {boolean} 2573 */ 2574 pf.matchesMedia = function() { 2575 if ( window.matchMedia && (matchMedia( "(min-width: 0.1em)" ) || {}).matches ) { 2576 pf.matchesMedia = function( media ) { 2577 return !media || ( matchMedia( media ).matches ); 2578 }; 2579 } else { 2580 pf.matchesMedia = pf.mMQ; 2581 } 2582 2583 return pf.matchesMedia.apply( this, arguments ); 2584 }; 2585 2586 /** 2587 * A simplified matchMedia implementation for IE8 and IE9 2588 * handles only min-width/max-width with px or em values 2589 * @param media 2590 * @returns {boolean} 2591 */ 2592 pf.mMQ = function( media ) { 2593 return media ? evalCSS(media) : true; 2594 }; 2595 2596 /** 2597 * Returns the calculated length in css pixel from the given sourceSizeValue 2598 * http://dev.w3.org/csswg/css-values-3/#length-value 2599 * intended Spec mismatches: 2600 * * Does not check for invalid use of CSS functions 2601 * * Does handle a computed length of 0 the same as a negative and therefore invalid value 2602 * @param sourceSizeValue 2603 * @returns {Number} 2604 */ 2605 pf.calcLength = function( sourceSizeValue ) { 2606 2607 var value = evalCSS(sourceSizeValue, true) || false; 2608 if (value < 0) { 2609 value = false; 2610 } 2611 2612 return value; 2613 }; 2614 2615 /** 2616 * Takes a type string and checks if its supported 2617 */ 2618 2619 pf.supportsType = function( type ) { 2620 return ( type ) ? types[ type ] : true; 2621 }; 2622 2623 /** 2624 * Parses a sourceSize into mediaCondition (media) and sourceSizeValue (length) 2625 * @param sourceSizeStr 2626 * @returns {*} 2627 */ 2628 pf.parseSize = memoize(function( sourceSizeStr ) { 2629 var match = ( sourceSizeStr || "" ).match(regSize); 2630 return { 2631 media: match && match[1], 2632 length: match && match[2] 2633 }; 2634 }); 2635 2636 pf.parseSet = function( set ) { 2637 if ( !set.cands ) { 2638 set.cands = parseSrcset(set.srcset, set); 2639 } 2640 return set.cands; 2641 }; 2642 2643 /** 2644 * returns 1em in css px for html/body default size 2645 * function taken from respondjs 2646 * @returns {*|number} 2647 */ 2648 pf.getEmValue = function() { 2649 var body; 2650 if ( !eminpx && (body = document.body) ) { 2651 var div = document.createElement( "div" ), 2652 originalHTMLCSS = docElem.style.cssText, 2653 originalBodyCSS = body.style.cssText; 2654 2655 div.style.cssText = baseStyle; 2656 2657 // 1em in a media query is the value of the default font size of the browser 2658 // reset docElem and body to ensure the correct value is returned 2659 docElem.style.cssText = fsCss; 2660 body.style.cssText = fsCss; 2661 2662 body.appendChild( div ); 2663 eminpx = div.offsetWidth; 2664 body.removeChild( div ); 2665 2666 //also update eminpx before returning 2667 eminpx = parseFloat( eminpx, 10 ); 2668 2669 // restore the original values 2670 docElem.style.cssText = originalHTMLCSS; 2671 body.style.cssText = originalBodyCSS; 2672 2673 } 2674 return eminpx || 16; 2675 }; 2676 2677 /** 2678 * Takes a string of sizes and returns the width in pixels as a number 2679 */ 2680 pf.calcListLength = function( sourceSizeListStr ) { 2681 // Split up source size list, ie ( max-width: 30em ) 100%, ( max-width: 50em ) 50%, 33% 2682 // 2683 // or (min-width:30em) calc(30% - 15px) 2684 if ( !(sourceSizeListStr in sizeLengthCache) || cfg.uT ) { 2685 var winningLength = pf.calcLength( parseSizes( sourceSizeListStr ) ); 2686 2687 sizeLengthCache[ sourceSizeListStr ] = !winningLength ? units.width : winningLength; 2688 } 2689 2690 return sizeLengthCache[ sourceSizeListStr ]; 2691 }; 2692 2693 /** 2694 * Takes a candidate object with a srcset property in the form of url/ 2695 * ex. "images/pic-medium.png 1x, images/pic-medium-2x.png 2x" or 2696 * "images/pic-medium.png 400w, images/pic-medium-2x.png 800w" or 2697 * "images/pic-small.png" 2698 * Get an array of image candidates in the form of 2699 * {url: "/foo/bar.png", resolution: 1} 2700 * where resolution is http://dev.w3.org/csswg/css-values-3/#resolution-value 2701 * If sizes is specified, res is calculated 2702 */ 2703 pf.setRes = function( set ) { 2704 var candidates; 2705 if ( set ) { 2706 2707 candidates = pf.parseSet( set ); 2708 2709 for ( var i = 0, len = candidates.length; i < len; i++ ) { 2710 setResolution( candidates[ i ], set.sizes ); 2711 } 2712 } 2713 return candidates; 2714 }; 2715 2716 pf.setRes.res = setResolution; 2717 2718 pf.applySetCandidate = function( candidates, img ) { 2719 if ( !candidates.length ) {return;} 2720 var candidate, 2721 i, 2722 j, 2723 length, 2724 bestCandidate, 2725 curSrc, 2726 curCan, 2727 candidateSrc, 2728 abortCurSrc; 2729 2730 var imageData = img[ pf.ns ]; 2731 var dpr = pf.DPR; 2732 2733 curSrc = imageData.curSrc || img[curSrcProp]; 2734 2735 curCan = imageData.curCan || setSrcToCur(img, curSrc, candidates[0].set); 2736 2737 // if we have a current source, we might either become lazy or give this source some advantage 2738 if ( curCan && curCan.set === candidates[ 0 ].set ) { 2739 2740 // if browser can abort image request and the image has a higher pixel density than needed 2741 // and this image isn't downloaded yet, we skip next part and try to save bandwidth 2742 abortCurSrc = (supportAbort && !img.complete && curCan.res - 0.1 > dpr); 2743 2744 if ( !abortCurSrc ) { 2745 curCan.cached = true; 2746 2747 // if current candidate is "best", "better" or "okay", 2748 // set it to bestCandidate 2749 if ( curCan.res >= dpr ) { 2750 bestCandidate = curCan; 2751 } 2752 } 2753 } 2754 2755 if ( !bestCandidate ) { 2756 2757 candidates.sort( ascendingSort ); 2758 2759 length = candidates.length; 2760 bestCandidate = candidates[ length - 1 ]; 2761 2762 for ( i = 0; i < length; i++ ) { 2763 candidate = candidates[ i ]; 2764 if ( candidate.res >= dpr ) { 2765 j = i - 1; 2766 2767 // we have found the perfect candidate, 2768 // but let's improve this a little bit with some assumptions ;-) 2769 if (candidates[ j ] && 2770 (abortCurSrc || curSrc !== pf.makeUrl( candidate.url )) && 2771 chooseLowRes(candidates[ j ].res, candidate.res, dpr, candidates[ j ].cached)) { 2772 2773 bestCandidate = candidates[ j ]; 2774 2775 } else { 2776 bestCandidate = candidate; 2777 } 2778 break; 2779 } 2780 } 2781 } 2782 2783 if ( bestCandidate ) { 2784 2785 candidateSrc = pf.makeUrl( bestCandidate.url ); 2786 2787 imageData.curSrc = candidateSrc; 2788 imageData.curCan = bestCandidate; 2789 2790 if ( candidateSrc !== curSrc ) { 2791 pf.setSrc( img, bestCandidate ); 2792 } 2793 pf.setSize( img ); 2794 } 2795 }; 2796 2797 pf.setSrc = function( img, bestCandidate ) { 2798 var origWidth; 2799 img.src = bestCandidate.url; 2800 2801 // although this is a specific Safari issue, we don't want to take too much different code paths 2802 if ( bestCandidate.set.type === "image/svg+xml" ) { 2803 origWidth = img.style.width; 2804 img.style.width = (img.offsetWidth + 1) + "px"; 2805 2806 // next line only should trigger a repaint 2807 // if... is only done to trick dead code removal 2808 if ( img.offsetWidth + 1 ) { 2809 img.style.width = origWidth; 2810 } 2811 } 2812 }; 2813 2814 pf.getSet = function( img ) { 2815 var i, set, supportsType; 2816 var match = false; 2817 var sets = img [ pf.ns ].sets; 2818 2819 for ( i = 0; i < sets.length && !match; i++ ) { 2820 set = sets[i]; 2821 2822 if ( !set.srcset || !pf.matchesMedia( set.media ) || !(supportsType = pf.supportsType( set.type )) ) { 2823 continue; 2824 } 2825 2826 if ( supportsType === "pending" ) { 2827 set = supportsType; 2828 } 2829 2830 match = set; 2831 break; 2832 } 2833 2834 return match; 2835 }; 2836 2837 pf.parseSets = function( element, parent, options ) { 2838 var srcsetAttribute, imageSet, isWDescripor, srcsetParsed; 2839 2840 var hasPicture = parent && parent.nodeName.toUpperCase() === "PICTURE"; 2841 var imageData = element[ pf.ns ]; 2842 2843 if ( imageData.src === undefined || options.src ) { 2844 imageData.src = getImgAttr.call( element, "src" ); 2845 if ( imageData.src ) { 2846 setImgAttr.call( element, srcAttr, imageData.src ); 2847 } else { 2848 removeImgAttr.call( element, srcAttr ); 2849 } 2850 } 2851 2852 if ( imageData.srcset === undefined || options.srcset || !pf.supSrcset || element.srcset ) { 2853 srcsetAttribute = getImgAttr.call( element, "srcset" ); 2854 imageData.srcset = srcsetAttribute; 2855 srcsetParsed = true; 2856 } 2857 2858 imageData.sets = []; 2859 2860 if ( hasPicture ) { 2861 imageData.pic = true; 2862 getAllSourceElements( parent, imageData.sets ); 2863 } 2864 2865 if ( imageData.srcset ) { 2866 imageSet = { 2867 srcset: imageData.srcset, 2868 sizes: getImgAttr.call( element, "sizes" ) 2869 }; 2870 2871 imageData.sets.push( imageSet ); 2872 2873 isWDescripor = (alwaysCheckWDescriptor || imageData.src) && regWDesc.test(imageData.srcset || ""); 2874 2875 // add normal src as candidate, if source has no w descriptor 2876 if ( !isWDescripor && imageData.src && !getCandidateForSrc(imageData.src, imageSet) && !imageSet.has1x ) { 2877 imageSet.srcset += ", " + imageData.src; 2878 imageSet.cands.push({ 2879 url: imageData.src, 2880 d: 1, 2881 set: imageSet 2882 }); 2883 } 2884 2885 } else if ( imageData.src ) { 2886 imageData.sets.push( { 2887 srcset: imageData.src, 2888 sizes: null 2889 } ); 2890 } 2891 2892 imageData.curCan = null; 2893 imageData.curSrc = undefined; 2894 2895 // if img has picture or the srcset was removed or has a srcset and does not support srcset at all 2896 // or has a w descriptor (and does not support sizes) set support to false to evaluate 2897 imageData.supported = !( hasPicture || ( imageSet && !pf.supSrcset ) || (isWDescripor && !pf.supSizes) ); 2898 2899 if ( srcsetParsed && pf.supSrcset && !imageData.supported ) { 2900 if ( srcsetAttribute ) { 2901 setImgAttr.call( element, srcsetAttr, srcsetAttribute ); 2902 element.srcset = ""; 2903 } else { 2904 removeImgAttr.call( element, srcsetAttr ); 2905 } 2906 } 2907 2908 if (imageData.supported && !imageData.srcset && ((!imageData.src && element.src) || element.src !== pf.makeUrl(imageData.src))) { 2909 if (imageData.src === null) { 2910 element.removeAttribute("src"); 2911 } else { 2912 element.src = imageData.src; 2913 } 2914 } 2915 2916 imageData.parsed = true; 2917 }; 2918 2919 pf.fillImg = function(element, options) { 2920 var imageData; 2921 var extreme = options.reselect || options.reevaluate; 2922 2923 // expando for caching data on the img 2924 if ( !element[ pf.ns ] ) { 2925 element[ pf.ns ] = {}; 2926 } 2927 2928 imageData = element[ pf.ns ]; 2929 2930 // if the element has already been evaluated, skip it 2931 // unless `options.reevaluate` is set to true ( this, for example, 2932 // is set to true when running `picturefill` on `resize` ). 2933 if ( !extreme && imageData.evaled === evalId ) { 2934 return; 2935 } 2936 2937 if ( !imageData.parsed || options.reevaluate ) { 2938 pf.parseSets( element, element.parentNode, options ); 2939 } 2940 2941 if ( !imageData.supported ) { 2942 applyBestCandidate( element ); 2943 } else { 2944 imageData.evaled = evalId; 2945 } 2946 }; 2947 2948 pf.setupRun = function() { 2949 if ( !alreadyRun || isVwDirty || (DPR !== window.devicePixelRatio) ) { 2950 updateMetrics(); 2951 } 2952 }; 2953 2954 // If picture is supported, well, that's awesome. 2955 if ( pf.supPicture ) { 2956 picturefill = noop; 2957 pf.fillImg = noop; 2958 } else { 2959 2960 // Set up picture polyfill by polling the document 2961 (function() { 2962 var isDomReady; 2963 var regReady = window.attachEvent ? /d$|^c/ : /d$|^c|^i/; 2964 2965 var run = function() { 2966 var readyState = document.readyState || ""; 2967 2968 timerId = setTimeout(run, readyState === "loading" ? 200 : 999); 2969 if ( document.body ) { 2970 pf.fillImgs(); 2971 isDomReady = isDomReady || regReady.test(readyState); 2972 if ( isDomReady ) { 2973 clearTimeout( timerId ); 2974 } 2975 2976 } 2977 }; 2978 2979 var timerId = setTimeout(run, document.body ? 9 : 99); 2980 2981 // Also attach picturefill on resize and readystatechange 2982 // http://modernjavascript.blogspot.com/2013/08/building-better-debounce.html 2983 var debounce = function(func, wait) { 2984 var timeout, timestamp; 2985 var later = function() { 2986 var last = (new Date()) - timestamp; 2987 2988 if (last < wait) { 2989 timeout = setTimeout(later, wait - last); 2990 } else { 2991 timeout = null; 2992 func(); 2993 } 2994 }; 2995 2996 return function() { 2997 timestamp = new Date(); 2998 2999 if (!timeout) { 3000 timeout = setTimeout(later, wait); 3001 } 3002 }; 3003 }; 3004 var lastClientWidth = docElem.clientHeight; 3005 var onResize = function() { 3006 isVwDirty = Math.max(window.innerWidth || 0, docElem.clientWidth) !== units.width || docElem.clientHeight !== lastClientWidth; 3007 lastClientWidth = docElem.clientHeight; 3008 if ( isVwDirty ) { 3009 pf.fillImgs(); 3010 } 3011 }; 3012 3013 on( window, "resize", debounce(onResize, 99 ) ); 3014 on( document, "readystatechange", run ); 3015 })(); 3016 } 3017 3018 pf.picturefill = picturefill; 3019 //use this internally for easy monkey patching/performance testing 3020 pf.fillImgs = picturefill; 3021 pf.teardownRun = noop; 3022 3023 /* expose methods for testing */ 3024 picturefill._ = pf; 3025 3026 window.picturefillCFG = { 3027 pf: pf, 3028 push: function(args) { 3029 var name = args.shift(); 3030 if (typeof pf[name] === "function") { 3031 pf[name].apply(pf, args); 3032 } else { 3033 cfg[name] = args[0]; 3034 if (alreadyRun) { 3035 pf.fillImgs( { reselect: true } ); 3036 } 3037 } 3038 } 3039 }; 3040 3041 while (setOptions && setOptions.length) { 3042 window.picturefillCFG.push(setOptions.shift()); 3043 } 3044 3045 /* expose picturefill */ 3046 window.picturefill = picturefill; 3047 3048 /* expose picturefill */ 3049 if ( typeof module === "object" && typeof module.exports === "object" ) { 3050 // CommonJS, just export 3051 module.exports = picturefill; 3052 } else if ( typeof define === "function" && define.amd ) { 3053 // AMD support 3054 define( "picturefill", function() { return picturefill; } ); 3055 } 3056 3057 // IE8 evals this sync, so it must be the last thing we do 3058 if ( !pf.supPicture ) { 3059 types[ "image/webp" ] = detectTypeSupport("image/webp", "data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA==" ); 3060 } 3061 3062} )( window, document );
vendor: 12,542 bytes, lines 3063-3483
3063 3064/** 3065 * what-input - A global utility for tracking the current input method (mouse, keyboard or touch). 3066 * @version v5.2.12 3067 * @link https://github.com/ten1seven/what-input 3068 * @license MIT 3069 */ 3070(function webpackUniversalModuleDefinition(root, factory) { 3071 if(typeof exports === 'object' && typeof module === 'object') 3072 module.exports = factory(); 3073 else if(typeof define === 'function' && define.amd) 3074 define("whatInput", [], factory); 3075 else if(typeof exports === 'object') 3076 exports["whatInput"] = factory(); 3077 else 3078 root["whatInput"] = factory(); 3079})(this, function() { 3080return /******/ (function(modules) { // webpackBootstrap 3081/******/ // The module cache 3082/******/ var installedModules = {}; 3083 3084/******/ // The require function 3085/******/ function __webpack_require__(moduleId) { 3086 3087/******/ // Check if module is in cache 3088/******/ if(installedModules[moduleId]) 3089/******/ return installedModules[moduleId].exports; 3090 3091/******/ // Create a new module (and put it into the cache) 3092/******/ var module = installedModules[moduleId] = { 3093/******/ exports: {}, 3094/******/ id: moduleId, 3095/******/ loaded: false 3096/******/ }; 3097 3098/******/ // Execute the module function 3099/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 3100 3101/******/ // Flag the module as loaded 3102/******/ module.loaded = true; 3103 3104/******/ // Return the exports of the module 3105/******/ return module.exports; 3106/******/ } 3107 3108 3109/******/ // expose the modules object (__webpack_modules__) 3110/******/ __webpack_require__.m = modules; 3111 3112/******/ // expose the module cache 3113/******/ __webpack_require__.c = installedModules; 3114 3115/******/ // __webpack_public_path__ 3116/******/ __webpack_require__.p = ""; 3117 3118/******/ // Load entry module and return exports 3119/******/ return __webpack_require__(0); 3120/******/ }) 3121/************************************************************************/ 3122/******/ ([ 3123/* 0 */ 3124/***/ (function(module, exports) { 3125 3126 'use strict'; 3127 3128 module.exports = function () { 3129 /* 3130 * bail out if there is no document or window 3131 * (i.e. in a node/non-DOM environment) 3132 * 3133 * Return a stubbed API instead 3134 */ 3135 if (typeof document === 'undefined' || typeof window === 'undefined') { 3136 return { 3137 // always return "initial" because no interaction will ever be detected 3138 ask: function ask() { 3139 return 'initial'; 3140 }, 3141 3142 // always return null 3143 element: function element() { 3144 return null; 3145 }, 3146 3147 // no-op 3148 ignoreKeys: function ignoreKeys() {}, 3149 3150 // no-op 3151 specificKeys: function specificKeys() {}, 3152 3153 // no-op 3154 registerOnChange: function registerOnChange() {}, 3155 3156 // no-op 3157 unRegisterOnChange: function unRegisterOnChange() {} 3158 }; 3159 } 3160 3161 /* 3162 * variables 3163 */ 3164 3165 // cache document.documentElement 3166 var docElem = document.documentElement; 3167 3168 // currently focused dom element 3169 var currentElement = null; 3170 3171 // last used input type 3172 var currentInput = 'initial'; 3173 3174 // last used input intent 3175 var currentIntent = currentInput; 3176 3177 // UNIX timestamp of current event 3178 var currentTimestamp = Date.now(); 3179 3180 // check for a `data-whatpersist` attribute on either the `html` or `body` elements, defaults to `true` 3181 var shouldPersist = false; 3182 3183 // form input types 3184 var formInputs = ['button', 'input', 'select', 'textarea']; 3185 3186 // empty array for holding callback functions 3187 var functionList = []; 3188 3189 // list of modifier keys commonly used with the mouse and 3190 // can be safely ignored to prevent false keyboard detection 3191 var ignoreMap = [16, // shift 3192 17, // control 3193 18, // alt 3194 91, // Windows key / left Apple cmd 3195 93 // Windows menu / right Apple cmd 3196 ]; 3197 3198 var specificMap = []; 3199 3200 // mapping of events to input types 3201 var inputMap = { 3202 keydown: 'keyboard', 3203 keyup: 'keyboard', 3204 mousedown: 'mouse', 3205 mousemove: 'mouse', 3206 MSPointerDown: 'pointer', 3207 MSPointerMove: 'pointer', 3208 pointerdown: 'pointer', 3209 pointermove: 'pointer', 3210 touchstart: 'touch', 3211 touchend: 'touch' 3212 3213 // boolean: true if the page is being scrolled 3214 };var isScrolling = false; 3215 3216 // store current mouse position 3217 var mousePos = { 3218 x: null, 3219 y: null 3220 3221 // map of IE 10 pointer events 3222 };var pointerMap = { 3223 2: 'touch', 3224 3: 'touch', // treat pen like touch 3225 4: 'mouse' 3226 3227 // check support for passive event listeners 3228 };var supportsPassive = false; 3229 3230 try { 3231 var opts = Object.defineProperty({}, 'passive', { 3232 get: function get() { 3233 supportsPassive = true; 3234 } 3235 }); 3236 3237 window.addEventListener('test', null, opts); 3238 } catch (e) {} 3239 // fail silently 3240 3241 3242 /* 3243 * set up 3244 */ 3245 3246 var setUp = function setUp() { 3247 // add correct mouse wheel event mapping to `inputMap` 3248 inputMap[detectWheel()] = 'mouse'; 3249 3250 addListeners(); 3251 }; 3252 3253 /* 3254 * events 3255 */ 3256 3257 var addListeners = function addListeners() { 3258 // `pointermove`, `MSPointerMove`, `mousemove` and mouse wheel event binding 3259 // can only demonstrate potential, but not actual, interaction 3260 // and are treated separately 3261 var options = supportsPassive ? { passive: true, capture: true } : true; 3262 3263 document.addEventListener('DOMContentLoaded', setPersist, true); 3264 3265 // pointer events (mouse, pen, touch) 3266 if (window.PointerEvent) { 3267 window.addEventListener('pointerdown', setInput, true); 3268 window.addEventListener('pointermove', setIntent, true); 3269 } else if (window.MSPointerEvent) { 3270 window.addEventListener('MSPointerDown', setInput, true); 3271 window.addEventListener('MSPointerMove', setIntent, true); 3272 } else { 3273 // mouse events 3274 window.addEventListener('mousedown', setInput, true); 3275 window.addEventListener('mousemove', setIntent, true); 3276 3277 // touch events 3278 if ('ontouchstart' in window) { 3279 window.addEventListener('touchstart', setInput, options); 3280 window.addEventListener('touchend', setInput, true); 3281 } 3282 } 3283 3284 // mouse wheel 3285 window.addEventListener(detectWheel(), setIntent, options); 3286 3287 // keyboard events 3288 window.addEventListener('keydown', setInput, true); 3289 window.addEventListener('keyup', setInput, true); 3290 3291 // focus events 3292 window.addEventListener('focusin', setElement, true); 3293 window.addEventListener('focusout', clearElement, true); 3294 }; 3295 3296 // checks if input persistence should happen and 3297 // get saved state from session storage if true (defaults to `false`) 3298 var setPersist = function setPersist() { 3299 shouldPersist = !(docElem.getAttribute('data-whatpersist') === 'false' || document.body.getAttribute('data-whatpersist') === 'false'); 3300 3301 if (shouldPersist) { 3302 // check for session variables and use if available 3303 try { 3304 if (window.sessionStorage.getItem('what-input')) { 3305 currentInput = window.sessionStorage.getItem('what-input'); 3306 } 3307 3308 if (window.sessionStorage.getItem('what-intent')) { 3309 currentIntent = window.sessionStorage.getItem('what-intent'); 3310 } 3311 } catch (e) { 3312 // fail silently 3313 } 3314 } 3315 3316 // always run these so at least `initial` state is set 3317 doUpdate('input'); 3318 doUpdate('intent'); 3319 }; 3320 3321 // checks conditions before updating new input 3322 var setInput = function setInput(event) { 3323 var eventKey = event.which; 3324 var value = inputMap[event.type]; 3325 3326 if (value === 'pointer') { 3327 value = pointerType(event); 3328 } 3329 3330 var ignoreMatch = !specificMap.length && ignoreMap.indexOf(eventKey) === -1; 3331 3332 var specificMatch = specificMap.length && specificMap.indexOf(eventKey) !== -1; 3333 3334 var shouldUpdate = value === 'keyboard' && eventKey && (ignoreMatch || specificMatch) || value === 'mouse' || value === 'touch'; 3335 3336 // prevent touch detection from being overridden by event execution order 3337 if (validateTouch(value)) { 3338 shouldUpdate = false; 3339 } 3340 3341 if (shouldUpdate && currentInput !== value) { 3342 currentInput = value; 3343 3344 persistInput('input', currentInput); 3345 doUpdate('input'); 3346 } 3347 3348 if (shouldUpdate && currentIntent !== value) { 3349 // preserve intent for keyboard interaction with form fields 3350 var activeElem = document.activeElement; 3351 var notFormInput = activeElem && activeElem.nodeName && (formInputs.indexOf(activeElem.nodeName.toLowerCase()) === -1 || activeElem.nodeName.toLowerCase() === 'button' && !checkClosest(activeElem, 'form')); 3352 3353 if (notFormInput) { 3354 currentIntent = value; 3355 3356 persistInput('intent', currentIntent); 3357 doUpdate('intent'); 3358 } 3359 } 3360 }; 3361 3362 // updates the doc and `inputTypes` array with new input 3363 var doUpdate = function doUpdate(which) { 3364 docElem.setAttribute('data-what' + which, which === 'input' ? currentInput : currentIntent); 3365 3366 fireFunctions(which); 3367 }; 3368 3369 // updates input intent for `mousemove` and `pointermove` 3370 var setIntent = function setIntent(event) { 3371 var value = inputMap[event.type]; 3372 3373 if (value === 'pointer') { 3374 value = pointerType(event); 3375 } 3376 3377 // test to see if `mousemove` happened relative to the screen to detect scrolling versus mousemove 3378 detectScrolling(event); 3379 3380 // only execute if scrolling isn't happening 3381 if ((!isScrolling && !validateTouch(value) || isScrolling && event.type === 'wheel' || event.type === 'mousewheel' || event.type === 'DOMMouseScroll') && currentIntent !== value) { 3382 currentIntent = value; 3383 3384 persistInput('intent', currentIntent); 3385 doUpdate('intent'); 3386 } 3387 }; 3388 3389 var setElement = function setElement(event) { 3390 if (!event.target.nodeName) { 3391 // If nodeName is undefined, clear the element 3392 // This can happen if click inside an <svg> element. 3393 clearElement(); 3394 return; 3395 } 3396 3397 currentElement = event.target.nodeName.toLowerCase(); 3398 docElem.setAttribute('data-whatelement', currentElement); 3399 3400 if (event.target.classList && event.target.classList.length) { 3401 docElem.setAttribute('data-whatclasses', event.target.classList.toString().replace(' ', ',')); 3402 } 3403 }; 3404 3405 var clearElement = function clearElement() { 3406 currentElement = null; 3407 3408 docElem.removeAttribute('data-whatelement'); 3409 docElem.removeAttribute('data-whatclasses'); 3410 }; 3411 3412 var persistInput = function persistInput(which, value) { 3413 if (shouldPersist) { 3414 try { 3415 window.sessionStorage.setItem('what-' + which, value); 3416 } catch (e) { 3417 // fail silently 3418 } 3419 } 3420 }; 3421 3422 /* 3423 * utilities 3424 */ 3425 3426 var pointerType = function pointerType(event) { 3427 if (typeof event.pointerType === 'number') { 3428 return pointerMap[event.pointerType]; 3429 } else { 3430 // treat pen like touch 3431 return event.pointerType === 'pen' ? 'touch' : event.pointerType; 3432 } 3433 }; 3434 3435 // prevent touch detection from being overridden by event execution order 3436 var validateTouch = function validateTouch(value) { 3437 var timestamp = Date.now(); 3438 3439 var touchIsValid = value === 'mouse' && currentInput === 'touch' && timestamp - currentTimestamp < 200; 3440 3441 currentTimestamp = timestamp; 3442 3443 return touchIsValid; 3444 }; 3445 3446 // detect version of mouse wheel event to use 3447 // via https://developer.mozilla.org/en-US/docs/Web/API/Element/wheel_event 3448 var detectWheel = function detectWheel() { 3449 var wheelType = null; 3450 3451 // Modern browsers support "wheel" 3452 if ('onwheel' in document.createElement('div')) { 3453 wheelType = 'wheel'; 3454 } else { 3455 // Webkit and IE support at least "mousewheel" 3456 // or assume that remaining browsers are older Firefox 3457 wheelType = document.onmousewheel !== undefined ? 'mousewheel' : 'DOMMouseScroll'; 3458 } 3459 3460 return wheelType; 3461 }; 3462 3463 // runs callback functions 3464 var fireFunctions = function fireFunctions(type) { 3465 for (var i = 0, len = functionList.length; i < len; i++) { 3466 if (functionList[i].type === type) { 3467 functionList[i].fn.call(undefined, type === 'input' ? currentInput : currentIntent); 3468 } 3469 } 3470 }; 3471 3472 // finds matching element in an object 3473 var objPos = function objPos(match) { 3474 for (var i = 0, len = functionList.length; i < len; i++) { 3475 if (functionList[i].fn === match) { 3476 return i; 3477 } 3478 } 3479 }; 3480 3481 var detectScrolling = function detectScrolling(event) { 3482 if (mousePos.x !== event.screenX || mousePos.y !== event.screenY) { 3483 isScrolling = false;
3484 3485 mousePos.x = event.screenX; 3486 mousePos.y = event.screenY; 3487 } else { 3488 isScrolling = true; 3489 } 3490 }; 3491 3492 // manual version of `closest()` 3493 var checkClosest = function checkClosest(elem, tag) { 3494 var ElementPrototype = window.Element.prototype; 3495 3496 if (!ElementPrototype.matches) { 3497 ElementPrototype.matches = ElementPrototype.msMatchesSelector || ElementPrototype.webkitMatchesSelector; 3498 } 3499 3500 if (!ElementPrototype.closest) { 3501 do { 3502 if (elem.matches(tag)) { 3503 return elem; 3504 } 3505 3506 elem = elem.parentElement || elem.parentNode; 3507 } while (elem !== null && elem.nodeType === 1); 3508 3509 return null; 3510 } else { 3511 return elem.closest(tag); 3512 } 3513 }; 3514 3515 /* 3516 * init 3517 */ 3518 3519 // don't start script unless browser cuts the mustard 3520 // (also passes if polyfills are used) 3521 if ('addEventListener' in window && Array.prototype.indexOf) { 3522 setUp(); 3523 } 3524 3525 /* 3526 * api 3527 */ 3528 3529 return { 3530 // returns string: the current input type 3531 // opt: 'intent'|'input' 3532 // 'input' (default): returns the same value as the `data-whatinput` attribute 3533 // 'intent': includes `data-whatintent` value if it's different than `data-whatinput` 3534 ask: function ask(opt) { 3535 return opt === 'intent' ? currentIntent : currentInput; 3536 }, 3537 3538 // returns string: the currently focused element or null 3539 element: function element() { 3540 return currentElement; 3541 }, 3542 3543 // overwrites ignored keys with provided array 3544 ignoreKeys: function ignoreKeys(arr) { 3545 ignoreMap = arr; 3546 }, 3547 3548 // overwrites specific char keys to update on 3549 specificKeys: function specificKeys(arr) { 3550 specificMap = arr; 3551 }, 3552 3553 // attach functions to input and intent "events" 3554 // funct: function to fire on change 3555 // eventType: 'input'|'intent' 3556 registerOnChange: function registerOnChange(fn, eventType) { 3557 functionList.push({ 3558 fn: fn, 3559 type: eventType || 'input' 3560 }); 3561 }, 3562 3563 unRegisterOnChange: function unRegisterOnChange(fn) { 3564 var position = objPos(fn); 3565 3566 if (position || position === 0) { 3567 functionList.splice(position, 1); 3568 } 3569 }, 3570 3571 clearStorage: function clearStorage() { 3572 window.sessionStorage.clear(); 3573 } 3574 }; 3575 }(); 3576 3577/***/ }) 3578/******/ ]) 3579}); 3580; 3581!function(a,b){"function"==typeof define&&define.amd?define([],function(){return a.svg4everybody=b()}):"object"==typeof module&&module.exports?module.exports=b():a.svg4everybody=b()}(this,function(){function a(a,b,c){if(c){var d=document.createDocumentFragment(),e=!b.hasAttribute("viewBox")&&c.getAttribute("viewBox");e&&b.setAttribute("viewBox",e);for(var f=c.cloneNode(!0);f.childNodes.length;)d.appendChild(f.firstChild);a.appendChild(d)}}function b(b){b.onreadystatechange=function(){if(4===b.readyState){var c=b._cachedDocument;c||(c=b._cachedDocument=document.implementation.createHTMLDocument(""),c.body.innerHTML=b.responseText,b._cachedTarget={}),b._embeds.splice(0).map(function(d){var e=b._cachedTarget[d.id];e||(e=b._cachedTarget[d.id]=c.getElementById(d.id)),a(d.parent,d.svg,e)})}},b.onreadystatechange()}function c(c){function e(){for(var c=0;c<o.length;){var h=o[c],i=h.parentNode,j=d(i),k=h.getAttribute("xlink:href")||h.getAttribute("href");if(!k&&g.attributeName&&(k=h.getAttribute(g.attributeName)),j&&k){if(f)if(!g.validate||g.validate(k,j,h)){i.removeChild(h);var l=k.split("#"),q=l.shift(),r=l.join("#");if(q.length){var s=m[q];s||(s=m[q]=new XMLHttpRequest,s.open("GET",q),s.send(),s._embeds=[]),s._embeds.push({parent:i,svg:j,id:r}),b(s)}else a(i,j,document.getElementById(r))}else++c,++p}else++c}(!o.length||o.length-p>0)&&n(e,67)}var f,g=Object(c),h=/\bTrident\/[567]\b|\bMSIE (?:9|10)\.0\b/,i=/\bAppleWebKit\/(\d+)\b/,j=/\bEdge\/12\.(\d+)\b/,k=/\bEdge\/.(\d+)\b/,l=window.top!==window.self;f="polyfill"in g?g.polyfill:h.test(navigator.userAgent)||(navigator.userAgent.match(j)||[])[1]<10547||(navigator.userAgent.match(i)||[])[1]<537||k.test(navigator.userAgent)&&l;var m={},n=window.requestAnimationFrame||setTimeout,o=document.getElementsByTagName("use"),p=0;f&&e()}function d(a){for(var b=a;"svg"!==b.nodeName.toLowerCase()&&(b=b.parentNode););return b}return c}); 3582/*------------------------------------------- 3583 Site 3584-------------------------------------------*/ 3585 3586 // !Site 3587 var Site = (function($, window) { 3588 3589 // !BaseController 3590 var BaseController = function() { 3591 this.namespace = ""; 3592 3593 this.minWidth = 320; 3594 this.maxWidth = Infinity; 3595 this.scrollTop = 0; 3596 this.windowHeight = 0; 3597 this.windowWidth = 0; 3598 3599 this.window = null; 3600 this.doc = null; 3601 3602 this.$window = null; 3603 this.$doc = null; 3604 this.$body = null; 3605 3606 // Public modules 3607 this.modules = []; 3608 3609 this.onInit = []; 3610 this.onRespond = []; 3611 this.onResize = []; 3612 this.onScroll = []; 3613 3614 this.minXS = "320"; 3615 this.minSM = "500"; 3616 this.minMD = "740"; 3617 this.minLG = "980"; 3618 this.minXL = "1220"; 3619 3620 this.maxXS = this.minXS - 1; 3621 this.maxSM = this.minSM - 1; 3622 this.maxMD = this.minMD - 1; 3623 this.maxLG = this.minLG - 1; 3624 this.maxXL = this.minXL - 1; 3625 3626 this.minHTsm = parseInt("800", 10); 3627 this.minHT = parseInt("800", 10); 3628 3629 this.maxHTsm = this.minHTsm - 1; 3630 this.maxHT = this.minHT - 1; 3631 3632 this.touch = false;
3633 }; 3634 3635 $.extend(BaseController.prototype, { 3636 // Init 3637 init: function(namespace) { 3638 // Objects 3639 this.namespace = namespace; 3640 this.window = window; 3641 this.doc = document; 3642 this.$window = $(window); 3643 this.$doc = $(document); 3644 this.$body = $("body"); 3645 this.touch = $("html").hasClass("touchevents"); 3646 3647 if ($.mediaquery) { 3648 $.mediaquery({ 3649 minWidth: [ 3650 this.minXS, 3651 this.minSM, 3652 this.minMD, 3653 this.minLG, 3654 this.minXL 3655 ], 3656 maxWidth: [ 3657 this.maxXL, 3658 this.maxLG, 3659 this.maxMD, 3660 this.maxSM, 3661 this.maxXS 3662 ], 3663 minHeight: [ 3664 this.minHTsm, 3665 this.minHT 3666 ] 3667 }); 3668 } 3669 3670 if ($.cookie) { 3671 $.cookie({ 3672 path: "/" 3673 }); 3674 } 3675 3676 // Init modules before scroll/resize/respond 3677 iterate(this.onInit); 3678 3679 this.$window 3680 .on("mqchange.mediaquery", onRespond) 3681 .on(Controller.ns("resize"), onResize) 3682 .on(Controller.ns("scroll"), onScroll); 3683 3684 this.resize(); 3685 }, 3686 // Namespace Text 3687 ns: function(text) { 3688 return text + "." + this.namespace; 3689 }, 3690 // Resize Trigger 3691 resize: function() { 3692 this.$window.trigger(Controller.ns("resize")); 3693 }, 3694 // Scroll Trigger 3695 scroll: function() { 3696 this.$window.trigger(Controller.ns("scroll")); 3697 }, 3698 // Kill event 3699 killEvent: function(e) { 3700 if (e && e.preventDefault) { 3701 e.preventDefault(); 3702 e.stopPropagation(); 3703 } 3704 }, 3705 // Start timer 3706 startTimer: function(timer, time, callback, interval) { 3707 this.clearTimer(timer); 3708 return (interval) ? setInterval(callback, time) : setTimeout(callback, time); 3709 }, 3710 // Clear timer 3711 clearTimer: function(timer, interval) { 3712 if (timer) { 3713 if (interval) { 3714 clearInterval(timer); 3715 } else { 3716 clearTimeout(timer); 3717 } 3718 3719 timer = null; 3720 } 3721 }, 3722 // Returns symbol markup 3723 symbol: function(symbol) { 3724 var markup = '<svg class="symbol symbol_' + symbol + '">'; 3725 var ua = window.navigator.userAgent; 3726 var msie = ua.indexOf("MSIE "); 3727 3728 if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) { 3729 markup += '<use xlink:href="#' + symbol + '">'; 3730 } else { 3731 markup += '<use xlink:href="' + STATIC_ROOT + 'images/icons.svg#' + symbol + '">'; 3732 } 3733 3734 return markup + '</use></svg>'; 3735 } 3736 }); 3737 3738 // Internal Instance 3739 var Controller = new BaseController(); 3740 3741 // Loop through callbacks 3742 function iterate(items) { 3743 for (var i in items) { 3744 if (items.hasOwnProperty(i)) { 3745 items[i].apply(Controller, Array.prototype.slice.call(arguments, 1)); 3746 } 3747 } 3748 } 3749 3750 // Media Query Change Handler 3751 function onRespond(e, state) { 3752 iterate(Controller.onRespond, state); 3753 } 3754 3755 // Resize Handler 3756 function onResize() { 3757 iterate(Controller.onResize); 3758 } 3759 3760 // Scroll Handler 3761 function onScroll() { 3762 iterate(Controller.onScroll); 3763 } 3764 3765 // Return Internal Instance 3766 return Controller; 3767 })(jQuery, window); 3768 3769 // !Ready 3770 jQuery(document).ready(function() { 3771 Site.init("@namespace"); 3772 }); 3773 3774/*------------------------------------------- 3775 Page 3776-------------------------------------------*/ 3777 3778/* global picturefill */ 3779/* global WWW_ROOT */ 3780 3781Site.modules.Page = (function ($, Site) { 3782 var $mainNav = $('.js-main-nav'); 3783 var $subNav = $('.js-sub-nav'); 3784 var prev = 'arrow_left'; 3785 var next = 'arrow_right';
3786 var BackgroundOptions = { 3787 labels: { 3788 play: 'Play Video', 3789 pause: 'Pause Video' 3790 }, 3791 icons: { 3792 play: Site.symbol('video_play'), 3793 pause: Site.symbol('video_pause') 3794 } 3795 }; 3796 3797 function init() { 3798 // Plugins 3799 picturefill(); 3800 3801 var ua = window.navigator.userAgent; 3802 var msie = ua.indexOf('MSIE '); 3803 3804 if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) { 3805 $.get(WWW_ROOT + 'images/icons.svg', function (data) { 3806 var div = document.createElement('div'); 3807 $(div).hide(); 3808 div.innerHTML = new XMLSerializer().serializeToString(data.documentElement); 3809 document.body.insertBefore(div, document.body.childNodes[0]); 3810 3811 $('svg use').each(function () { 3812 var parts = $(this).attr('xlink:href').split('#'); 3813 $(this).attr('xlink:href', '#' + parts[1]); 3814 }); 3815 }); 3816 } 3817 3818 Site.$body 3819 .find('.js-background') 3820 .on('loaded.background', function () { 3821 $(this).addClass('fs-background-loaded'); 3822 3823 $(this).background('mute'); 3824 $(this).background('play'); 3825 3826 backgroundVideo(this); 3827 resizeBackgroundControl(); 3828 }) 3829 .background({ 3830 youtubeOptions: { 3831 autoplay: 0, 3832 disable: 1, 3833 controls: 0, 3834 showinfo: 0, 3835 modestbranding: 1, 3836 loop: 1, 3837 fs: 0, 3838 rel: 0, 3839 playsinline: 1 3840 } 3841 }); 3842 Site.$body.find('.js-carousel').carousel({ 3843 labels: { 3844 previous: "<span class='fs-carousel-control-icon'>" + Site.symbol(prev) + '</span>', 3845 next: "<span class='fs-carousel-control-icon'>" + Site.symbol(next) + '</span>' 3846 } 3847 }); 3848 Site.$body.find('.js-checkbox, .js-radio, input[type=checkbox], input[type=radio]').checkbox(); 3849 Site.$body.find('.js-dropdown').dropdown(); 3850 Site.$body.find('.js-equalize').equalize(); 3851 Site.$body.find('.js-lightbox').lightbox({ 3852 mobile: false, 3853 theme: 'fs-light', 3854 labels: { 3855 close: "<span class='fs-lightbox-icon-close'>" + Site.symbol('close_alternate') + '</span>', 3856 previous: "<span class='fs-lightbox-icon-previous'>" + Site.symbol(prev) + '</span>', 3857 count: "<span class='fs-lightbox-meta-divider'> / </span>", 3858 next: "<span class='fs-lightbox-icon-next'>" + Site.symbol(next) + '</span>' 3859 } 3860 }); 3861 Site.$body 3862 .find('.js-navigation') 3863 .navigation({ 3864 maxWidth: Site.maxLG + 'px' 3865 }) 3866 .on('open.navigation', function () { 3867 trackEvent($(this).data('analytics-open')); 3868 Site.$body.find('.js-navigation').attr('aria-hidden', 'false').removeAttr('hidden'); 3869 }) 3870 .on('close.navigation', function () { 3871 trackEvent($(this).data('analytics-close')); 3872 Site.$body.find('.js-navigation').attr('aria-hidden', 'true').attr('hidden', ''); 3873 }); 3874 Site.$body.find('.js-swap').swap(); 3875 3876 $.mediaquery('bind', 'mq-key', '(min-width: ' + Site.minLG + 'px)', { 3877 enter: function () { 3878 $subNav.attr('aria-hidden', 'false').removeAttr('hidden'); 3879 }, 3880 leave: function () { 3881 $subNav.attr('aria-hidden', 'true').attr('hidden', ''); 3882 } 3883 }); 3884 3885 $(window).on('open.lightbox', function () { 3886 $('.js-lightbox').lightbox('resize'); 3887 }); 3888 3889 // Display children of focused nav items 3890 3891 $mainNav 3892 .find('a') 3893 .focus(function () { 3894 $(this).closest('.main_nav_item').addClass('focused'); 3895 }) 3896 .blur(function () { 3897 $(this).closest('.main_nav_item').removeClass('focused'); 3898 }); 3899 3900 // Analytics 3901 3902 $.analytics({ 3903 scrollDepth: true 3904 }); 3905 3906 // Select all links with hashes 3907 $('a[href*="#"]') 3908 // Remove links that don't actually link to anything 3909 .not('[href="#"]') 3910 .not('[href="#0"]') 3911 .not('[href*="#trello"]') 3912 .click(function (event) { 3913 // On-page links 3914 if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { 3915 // Figure out element to scroll to 3916 var target = $(this.hash); 3917 target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); 3918 // Does a scroll target exist? 3919 if (target.length) { 3920 // Only prevent default if animation is actually gonna happen 3921 event.preventDefault(); 3922 $('html, body').animate( 3923 { 3924 scrollTop: target.offset().top 3925 }, 3926 1000, 3927 function () { 3928 // Callback after animation 3929 // Must change focus! 3930 var $target = $(target);
3931 $target.focus(); 3932 if ($target.is(':focus')) { 3933 // Checking if the target was focused 3934 return false; 3935 } else { 3936 $target.attr('tabindex', '-1'); // Adding tabindex for elements not focusable 3937 $target.focus(); // Set focus again 3938 } 3939 } 3940 ); 3941 } 3942 } 3943 }); 3944 3945 // Theming 3946 3947 if ($('.sub_nav').length) { 3948 $('body').addClass('theme_sub_nav'); 3949 } 3950 3951 if ($('.filter, .site_search_results').length) { 3952 $('body').addClass('theme_centered'); 3953 } 3954 3955 if ($('.cover_image_block').length || $('.cover_video_block').length) { 3956 $('body').addClass('theme_image'); 3957 } 3958 3959 if ($('.cover_detail_image_block').length) { 3960 $('body').addClass('theme_detail_image'); 3961 } 3962 3963 if ($('.news_feature').length) { 3964 $('body').addClass('theme_news'); 3965 } 3966 3967 if ($('.blog_feature').length) { 3968 $('body').addClass('theme_news'); 3969 } 3970 3971 // Generic Toggles 3972 3973 Site.$body.find('.js-toggle').not('.js-bound').on('click', '.js-toggle-handle', onToggleClick).addClass('js-bound'); 3974 3975 // Scroll Nav 3976 3977 Site.$body.find('.js-scroll-to').not('.js-bound').on('click', onScrollTo).addClass('js-bound'); 3978 3979 // Wrapper for Tables 3980 3981 Site.$body.find('.typography table').wrap('<div class="table_wrapper"><div class="table_wrapper_inner"></div></div>'); 3982 tableOverflow(); 3983 3984 // Responsive Video 3985 3986 $("iframe[src*='vimeo.com'], iframe[src*='youtube.com']", '.typography').each(function () { 3987 $(this).wrap('<div class="video_frame"></div>'); 3988 }); 3989 3990 $('img').each(function () { 3991 if ($(this).parent().is('a')) { 3992 $(this).parent().addClass('image_link'); 3993 } 3994 }); 3995 3996 // Scrolling 3997 3998 Site.onScroll.push(scroll); 3999 Site.onResize.push(resize); 4000 Site.onRespond.push(respond); 4001 4002 Site.scroll(); 4003 Site.resize(); 4004 } 4005 4006 function scroll() {} 4007 4008 function resize() { 4009 tableOverflow(); 4010 assessSlides(); 4011 getGutter(); 4012 openGoal(); 4013 resizeStats(); 4014 resizePageOffset(); 4015 resizeBackgroundControl(); 4016 } 4017 4018 function respond() {} 4019 4020 function backgroundVideo(element) { 4021 var $background = $(element); 4022 4023 if ($background.hasClass('js-background-video')) { 4024 if ($background.find('.fs-background-controls').length == 0) { 4025 $( 4026 "<div class='fs-background-controls'><button class='fs-background-control fs-background-control-play fs-background-control-active' aria-pressed='true' aria-label='play'><span class='fs-background-control-icon'>" + 4027 BackgroundOptions.icons.play + 4028 "</span><span class='fs-background-control-label'>" + 4029 BackgroundOptions.labels.play + 4030 "<span></button><button class='fs-background-control fs-background-control-pause' aria-pressed='false' aria-label='pause'><span class='fs-background-control-icon'>" + 4031 BackgroundOptions.icons.pause + 4032 "</span><span class='fs-background-control-label'>" + 4033 BackgroundOptions.labels.pause + 4034 '<span></button></div>' 4035 ).appendTo($background); 4036 } 4037 4038 $background.find('.fs-background-control-play').on('click', onPlayClick); 4039 $background.find('.fs-background-control-pause').on('click', onPauseClick); 4040 } 4041 } 4042 4043 function getGutter() { 4044 if ($('.fs-cell').length) { 4045 $('body').css('--gutter-width', $('.header_ribbon .fs-cell')[0].getBoundingClientRect().left + 'px'); 4046 } 4047 } 4048 4049 function openGoal() { 4050 if ($('.goals').length) { 4051 var target = new URLSearchParams(window.location.search).get('goal'); 4052 4053 if (target) { 4054 $('.js-goals-item-' + target) 4055 .find('h3') 4056 .swap('activate'); 4057 } 4058 } 4059 } 4060 4061 function onPlayClick() { 4062 var $background = $(this).closest('.js-background-video'); 4063 4064 $background.background('play'); 4065 $background.find('.fs-background-control-play').addClass('fs-background-control-active').attr('aria-pressed', 'true'); 4066 $background.find('.fs-background-control-pause').removeClass('fs-background-control-active').attr('aria-pressed', 'false'); 4067 } 4068 4069 function onPauseClick() { 4070 var $background = $(this).closest('.js-background-video'); 4071 4072 $background.background('pause'); 4073 $background.find('.fs-background-control-pause').addClass('fs-background-control-active').attr('aria-pressed', 'true'); 4074 $background.find('.fs-background-control-play').removeClass('fs-background-control-active').attr('aria-pressed', 'false'); 4075 } 4076
4077 function resizeBackgroundControl() { 4078 if ($('.fs-background-controls').length) { 4079 $('.fs-background-controls').css('left', $('.logo_header')[0].getBoundingClientRect().left); 4080 } 4081 } 4082 4083 function resizeStats() { 4084 if ($('.stats').length) { 4085 if ($('.stats_spot_title').css('text-align') == 'left') { 4086 $('.stats_spot_title').css('margin-top', ($('.stats_spot_title').outerHeight() / 1) * -1 + 45); 4087 } else { 4088 $('.stats_spot_title').css('margin-top', ''); 4089 } 4090 } 4091 } 4092 4093 function resizePageOffset() { 4094 if ($('.cover_image_block').length || $('.cover_video_block').length) { 4095 if ($('.logo_header').css('position') == 'absolute') { 4096 $('.subnav_cell').css('margin-top', ''); 4097 let offset = 0; 4098 if ($('.page_intro').length) { 4099 offset = $('.page_header').innerHeight() - $('.page_intro').outerHeight() + parseInt($('.page_content').css('padding-top').replace('px', '')) - 20 4100 $('.content_cell').css( 4101 'margin-top', 4102 offset * -1 4103 ); 4104 } else { 4105 offset = $('.page_header').innerHeight() + (parseInt($('.page_content').css('padding-top').replace('px', '')) - 20); 4106 $('.content_cell').css('margin-top', offset * -1); 4107 } 4108 4109 if ($('.content_cell').length) { 4110 $('.page_feature').css('--controls-offset', offset + 'px'); 4111 } 4112 } else { 4113 $('.subnav_cell').css('margin-top', $('.subnav_cell').height() * -1); 4114 $('.content_cell').css('margin-top', ''); 4115 if ($('.content_cell').length) { 4116 $('.page_feature').css('--controls-offset', ''); 4117 } 4118 } 4119 } 4120 4121 if ($('.cover_detail_image_block').length) { 4122 if ($('.logo_header').css('position') == 'absolute') { 4123 $('.page').css('padding-top', $('.header').height() + 50); 4124 $('.content_cell').css('margin-top', parseInt($('.page_content').css('padding-top').replace('px', '')) * -1 - 60); 4125 } else { 4126 $('.page').css('padding-top', ''); 4127 $('.content_cell').css('margin-top', ''); 4128 } 4129 } 4130 } 4131 4132 function assessSlides() { 4133 $('.js-carousel').each(function () { 4134 if ($(this).css('text-align') == 'left') { 4135 $(this).carousel('disable'); 4136 } else { 4137 $(this).carousel('enable'); 4138 } 4139 }); 4140 } 4141 4142 function onScrollTo(e) { 4143 Site.killEvent(e); 4144 4145 var $target = $(e.delegateTarget), 4146 id = $target.attr('href'); 4147 4148 scrollToElement(id); 4149 } 4150 4151 function scrollToElement(id) { 4152 var $to = $(id); 4153 4154 if ($to.length) { 4155 var offset = $to.offset(); 4156 4157 scrollToPosition(offset.top); 4158 } 4159 } 4160 4161 function scrollToPosition(top) { 4162 $('html, body').animate({ 4163 scrollTop: top 4164 }); 4165 } 4166 4167 function onToggleClick(e) { 4168 Site.killEvent(e); 4169 4170 var $target = $(e.delegateTarget), 4171 activeClass = 'js-toggle-active'; 4172 4173 if ($target.hasClass(activeClass)) { 4174 $target.removeClass(activeClass); 4175 } else { 4176 $target.addClass(activeClass); 4177 } 4178 } 4179 4180 function trackEvent(data) { 4181 if ($.type(data) === 'string') { 4182 data = data.split(','); 4183 4184 $.analytics.apply(this, data); 4185 } 4186 } 4187 4188 function tableOverflow() { 4189 $('.table_wrapper').each(function () { 4190 $(this).removeClass('table_wrapper_overflow'); 4191 if ($(this).prop('scrollWidth') > $(this).width() + 1) { 4192 $(this).addClass('table_wrapper_overflow'); 4193 } else { 4194 $(this).removeClass('table_wrapper_overflow'); 4195 } 4196 }); 4197 } 4198 4199 // Hook Into Main init Routine 4200 4201 Site.onInit.push(init); 4202 4203 return {}; 4204})(jQuery, Site); 4205 4206/*------------------------------------------- 4207 Stories 4208-------------------------------------------*/ 4209 4210Site.modules.Stories = (function($, Site) { 4211 4212 var $select; 4213 var $options; 4214 var $carousel; 4215 var $items; 4216 var $holders; 4217 var itemsAmount; 4218 var itemsLimit; 4219 var selectionTimeout; 4220 var animationTimeout; 4221 4222 function init() { 4223 if($(".stories").length) { 4224 $select = $(".js-dropdown"); 4225 $options = $(".stories_option"); 4226 $carousel = $(".stories_group"); 4227 $items = $(".story_item"); 4228 $holders = $(".story_holder"); 4229 itemsAmount = $items.length; 4230 itemsLimit = 6; 4231 selectionTimeout; 4232 animationTimeout; 4233 4234 if ($items.length < itemsLimit) { 4235 itemsLimit = $items.length; 4236 } 4237 4238 shuffle(); 4239 initDropdown(); 4240 pullAllRandom(); 4241 bindUI(); 4242 updateSelection(); 4243 resizeItems(); 4244 } 4245 } 4246 4247 function shuffle() { 4248 for(var i = 0; i < itemsAmount; i++) { 4249 $items.parent().append($items.eq(randomItem())); 4250 } 4251 } 4252 4253 function initDropdown() { 4254 $select.val("All Stories").trigger("change"); 4255 } 4256 4257 function bindUI() { 4258 $options.on("click", function() { 4259 updateOptions($(this)); 4260 resetItems(); 4261 4262 if($(this).data("id") == "All Stories") { 4263 pullAllRandom(); 4264 } else { 4265 pullSelection($(this).data("id")); 4266 } 4267 4268 updateSelection(); 4269 }); 4270 4271 $select.on("change", function() { 4272 var value = $(this).val(); 4273 4274 resetItems(); 4275 4276 if(value == "All Stories") { 4277 pullAllRandom(); 4278 } else { 4279 pullSelection(value); 4280 } 4281 4282 updateSelection(); 4283 }); 4284 4285 Site.onResize.push(resizeItems); 4286 } 4287 4288 function updateOptions($option) { 4289 $options.removeClass("active"); 4290 $option.addClass("active"); 4291 } 4292 4293 function resetItems() { 4294 $items.removeClass("chosen"); 4295 } 4296 4297 function randomItem() { 4298 return Math.round(Math.random() * (itemsAmount - 0) + 0); 4299 } 4300 4301 function pullAllRandom() { 4302 while ($(".story_item.chosen").length < itemsLimit) { 4303 $items.eq(randomItem()).addClass("chosen"); 4304 } 4305 } 4306 4307 function pullSelection(selection) { 4308 var $currentSelection = $(".story_item[data-id=" + selection + "]"); 4309
4310 if($currentSelection.length <= itemsLimit) { 4311 $currentSelection.addClass("chosen"); 4312 } else { 4313 while($(".story_item.chosen[data-id=" + selection + "]").length < itemsLimit) { 4314 var random = randomItem(); 4315 4316 if($items.eq(random).data("id") == selection) { 4317 $items.eq(random).addClass("chosen"); 4318 } 4319 } 4320 } 4321 } 4322 4323 function resizeItems() {} 4324 4325 function updateSelection() { 4326 replaceHolders(); 4327 animateSelection(); 4328 4329 var selectionTimeout = setTimeout(function() { 4330 replaceSelection(); 4331 }, 1150); 4332 } 4333 4334 function replaceHolders() { 4335 $holders = $(".story_holder"); 4336 4337 if($(".story_item.chosen").length > $holders.length) { 4338 var difference = $(".story_item.chosen").length - $holders.length; 4339 4340 for(var x = 0; x < difference; x++) { 4341 $(".stories_group .fs-carousel-canister").append('<article class="story story_holder"></article>'); 4342 } 4343 } 4344 } 4345 4346 function replaceSelection() { 4347 $holders = $(".story_holder"); 4348 $holders.html(""); 4349 4350 $(".story_item.chosen").each(function(index) { 4351 $holders.eq(index).append($(this).clone().find(".story_link")); 4352 }); 4353 4354 $holders.each(function() { 4355 if($(this).is(':empty')) { 4356 $(this).remove(); 4357 } 4358 }); 4359 4360 $carousel.carousel("reset"); 4361 } 4362 4363 function animateSelection() { 4364 $(".stories").addClass("animating"); 4365 4366 animationTimeout = setTimeout(function() { 4367 resetAnimation(); 4368 }, 2000); 4369 4370 $carousel.carousel("reset"); 4371 } 4372 4373 function resetAnimation() { 4374 $(".stories").removeClass("animating"); 4375 4376 clearTimeout(animationTimeout); 4377 4378 $carousel.carousel("reset"); 4379 } 4380 4381 Site.onInit.push(init); 4382 4383 return {}; 4384 4385})(jQuery, Site); 4386 4387Site.modules.Cover = (function($, Site) { 4388 4389 function init() { 4390 if($(".cover").length) { 4391 adjustSize(); 4392 4393 Site.onResize.push(adjustSize); 4394 } 4395 } 4396 4397 function adjustSize() { 4398 var size; 4399 4400 if(!($(".cover").hasClass("theme_sm"))) { 4401 size = parseInt($(".page").css("padding-top").replace("px", "")) + parseInt($(".page_content").css("padding-top").replace("px", "")) + $(".page_header_wrapper").outerHeight(true); 4402 4403 if($(".sidebar > *").length) { 4404 $(".subnav_cell").css("padding-top", $(".page_header_wrapper").outerHeight(true) + 60); 4405 } 4406 4407 if($(".in_content_callouts .filter").length) { 4408 $("body").addClass("theme_covered_filter"); 4409 } 4410 } else { 4411 size = $(".header").outerHeight() + $(".sub_nav").outerHeight(true); 4412 } 4413 4414 if($(".full_width_callouts .filter").length || $(".site_search_results").length) { 4415 size = size + 70; 4416 } 4417 4418 $(".cover").css("height", size); 4419 }; 4420 4421 Site.onInit.push(init); 4422 4423 return {}; 4424 4425})(jQuery, Site); 4426 4427/*------------------------------------------- 4428 Maps 4429-------------------------------------------*/ 4430 4431Site.modules.Maps = (function($, Site) { 4432 4433 function init() { 4434 bindUI(); 4435 } 4436 4437 function bindUI() { 4438 $(".mini_map_points .mini_map_button_open").on("click", function() { 4439 $(this).closest(".mini_map").addClass("visible-marker"); 4440 }); 4441 4442 $(".mini_map_points .mini_map_button_close").on("click", function() { 4443 $(this).closest(".mini_map").removeClass("visible-marker"); 4444 }); 4445 4446 $(".big_map_points .mini_map_button_open, .big_map_list_item").on("click", function() { 4447 $(this).closest(".big_map").addClass("visible-marker"); 4448 }); 4449 4450 $(".big_map_points .mini_map_button_close").on("click", function() { 4451 $(this).closest(".big_map").removeClass("visible-marker"); 4452 }); 4453 4454 $(".big_map_dropdown").on("change", function() { 4455 var value = $(this).val(); 4456 4457 $("[data-id='" + value + "']").swap("activate"); 4458 }); 4459 } 4460 4461 Site.onInit.push(init); 4462 4463 return {}; 4464 4465})(jQuery, Site); 4466 4467Site.modules.Circles = (function($, Site) { 4468 4469 function init() { 4470 var canvasCircles = document.getElementById("circles-canvas"); 4471 4472 if (typeof(canvasCircles) != 'undefined' && canvasCircles != null) { 4473 var ctx = canvasCircles.getContext("2d"); 4474 var cw = canvasCircles.width = window.innerWidth, 4475 cx = cw / 2; 4476 var ch = canvasCircles.height = window.innerHeight, 4477 cy = ch / 2; 4478 4479 ctx.fillStyle = "#fff"; 4480 var circlesRy = []; 4481 var circlesNum = 15; 4482 var requestId = null; 4483 4484 function Circle() { 4485 this.r = randomIntFromInterval(25, 170); 4486 this.x = randomIntFromInterval(this.r, cw - this.r); 4487 this.y = randomIntFromInterval(this.r, ch - this.r); 4488 4489 this.vx = randomIntFromInterval(25, 100)/100; 4490 this.vy = randomIntFromInterval(25, 100)/100; 4491 4492 this.update = function() { 4493 this.edges(); 4494 this.x += this.vx; 4495 this.y += this.vy; 4496 } 4497 4498 this.edges = function() { 4499 if (this.x < this.r || this.x > cw - this.r) { 4500 this.vx *= -1; 4501 } 4502 if (this.y < this.r || this.y > ch - this.r) { 4503 this.vy *= -1; 4504 } 4505 } 4506 4507 this.draw = function() { 4508 ctx.strokeStyle = "#353535"; 4509 ctx.beginPath(); 4510 ctx.arc(this.x, this.y, this.r, 0, 2 * Math.PI); 4511 ctx.stroke(); 4512 } 4513 4514 } 4515 4516 for (var i = 0; i < circlesNum; i++) { 4517 var circle = new Circle(); 4518 circlesRy.push(circle); 4519 } 4520 4521 function Draw() { 4522 requestId = window.requestAnimationFrame(Draw); 4523 ctx.clearRect(0, 0, cw, ch); 4524 for (var i = 0; i < circlesRy.length; i++) { 4525 var c = circlesRy[i]; 4526 c.update(); 4527 c.draw(); 4528 } 4529 for (var i = 0; i < circlesRy.length; i++) { 4530 var c = circlesRy[i]; 4531 for (var j = i + 1; j < circlesRy.length; j++) { 4532 var c1 = circlesRy[j]; 4533 var d = dist(c, c1); 4534 if ((d < c.r + c1.r) && (d > Math.abs(c.r - c1.r))) { 4535 getIntersection(c, c1, d); 4536 } 4537 } 4538 } 4539 } 4540 4541 function Init() { 4542 circlesRy.length = 0; 4543 for (var i = 0; i < circlesNum; i++) { 4544 var circle = new Circle(); 4545 circlesRy.push(circle); 4546 } 4547 4548 if (requestId) { 4549 window.cancelAnimationFrame(requestId); 4550 requestId = null; 4551 } 4552 4553 cw = canvasCircles.width = window.innerWidth, 4554 cx = cw / 2; 4555 ch = canvasCircles.height = window.innerHeight, 4556 cy = ch / 2; 4557 4558 Draw(); 4559 }; 4560 4561 setTimeout(function() { 4562 Init(); 4563 4564 // addEventListener('resize', Init, false); 4565 }, 15); 4566 4567 function getIntersection(p1, p2, d) { 4568 4569 var p3 = {}; // middle point 4570 var p4 = {}; // intersection 1 4571 var p5 = {}; // intersection 2 4572 4573 var a = (Math.pow(p1.r, 2) - Math.pow(p2.r, 2) + Math.pow(d, 2)) / (2 * d) 4574 var h = Math.sqrt(Math.pow(p1.r, 2) - Math.pow(a, 2)); 4575 4576 p3.x = p1.x + a * (p2.x - p1.x) / d; 4577 p3.y = p1.y + a * (p2.y - p1.y) / d; 4578 4579 p4.x = p3.x + h * (p2.y - p1.y) / d; 4580 p4.y = p3.y - h * (p2.x - p1.x) / d; 4581 4582 p5.x = p3.x - h * (p2.y - p1.y) / d; 4583 p5.y = p3.y + h * (p2.x - p1.x) / d; 4584 4585 markPoint(p4); 4586 markPoint(p5); 4587 4588 } 4589 4590 function dist(p1, p2) { 4591 var dx = p2.x - p1.x; 4592 var dy = p2.y - p1.y; 4593 return Math.sqrt(dx * dx + dy * dy); 4594 } 4595 4596 function randomIntFromInterval(mn, mx) { 4597 return ~~(Math.random() * (mx - mn + 1) + mn) 4598 } 4599 4600 function markPoint(p) { 4601 ctx.fillStyle = "#fff"; 4602 ctx.beginPath();
4603 ctx.arc(p.x, p.y, 2, 0, 2 * Math.PI); 4604 ctx.fill(); 4605 } 4606 } 4607 } 4608 4609 Site.onInit.push(init); 4610 4611 return {}; 4612 4613})(jQuery, Site); 4614 4615Site.modules.Lines = (function($, Site) { 4616 4617 function init() { 4618 var canvasLines = document.getElementById("lines-canvas"); 4619 4620 if (typeof(canvasLines) != 'undefined' && canvasLines != null) { 4621 var ctx = canvasLines.getContext("2d"); 4622 var cw = canvasLines.width = window.innerWidth, 4623 cx = cw / 2; 4624 var ch = canvasLines.height = window.innerHeight, 4625 cy = ch / 2; 4626 4627 ctx.fillStyle = "#F7F7F7"; 4628 var linesNum = 8; 4629 var linesRy = []; 4630 var requestId = null; 4631 4632 function Line(flag) { 4633 this.flag = flag; 4634 this.a = {}; 4635 this.b = {}; 4636 if (flag == "v") { 4637 this.a.y = 0; 4638 this.b.y = ch; 4639 this.a.x = randomIntFromInterval(0, ch); 4640 this.b.x = randomIntFromInterval(0, ch); 4641 } else if (flag == "h") { 4642 this.a.x = 0; 4643 this.b.x = cw; 4644 this.a.y = randomIntFromInterval(0, cw); 4645 this.b.y = randomIntFromInterval(0, cw); 4646 } 4647 this.va = randomIntFromInterval(25, 100) / 100; 4648 this.vb = randomIntFromInterval(25, 100) / 100; 4649 4650 this.draw = function() { 4651 ctx.strokeStyle = "#E3E3E3"; 4652 ctx.beginPath(); 4653 ctx.moveTo(this.a.x, this.a.y); 4654 ctx.lineTo(this.b.x, this.b.y); 4655 ctx.stroke(); 4656 } 4657 4658 this.update = function() { 4659 if (this.flag == "v") { 4660 this.a.x += this.va; 4661 this.b.x += this.vb; 4662 } else if (flag == "h") { 4663 this.a.y += this.va; 4664 this.b.y += this.vb; 4665 } 4666 4667 this.edges(); 4668 } 4669 4670 this.edges = function() { 4671 if (this.flag == "v") { 4672 if (this.a.x < 0 || this.a.x > cw) { 4673 this.va *= -1; 4674 } 4675 if (this.b.x < 0 || this.b.x > cw) { 4676 this.vb *= -1; 4677 } 4678 } else if (this.flag == "h") { 4679 if (this.a.y < 0 || this.a.y > ch) { 4680 this.va *= -1; 4681 } 4682 if (this.b.y < 0 || this.b.y > ch) { 4683 this.vb *= -1; 4684 } 4685 } 4686 } 4687 4688 } 4689 4690 for (var i = 0; i < linesNum; i++) { 4691 var flag = i % 2 == 0 ? "h" : "v"; 4692 var l = new Line(flag); 4693 linesRy.push(l); 4694 } 4695 4696 function Draw() { 4697 requestId = window.requestAnimationFrame(Draw); 4698 ctx.clearRect(0, 0, cw, ch); 4699 4700 for (var i = 0; i < linesRy.length; i++) { 4701 var l = linesRy[i]; 4702 l.draw(); 4703 l.update(); 4704 } 4705 for (var i = 0; i < linesRy.length; i++) { 4706 var l = linesRy[i]; 4707 for (var j = i + 1; j < linesRy.length; j++) { 4708 var l1 = linesRy[j] 4709 Intersect2lines(l, l1); 4710 } 4711 } 4712 } 4713 4714 function Init() { 4715 for (var i = 0; i < linesNum; i++) { 4716 var flag = i % 2 == 0 ? "h" : "v"; 4717 var l = new Line(flag); 4718 linesRy.push(l); 4719 } 4720 4721 if (requestId) { 4722 window.cancelAnimationFrame(requestId); 4723 requestId = null; 4724 } 4725 4726 cw = canvasLines.width = window.innerWidth, 4727 cx = cw / 2; 4728 ch = canvasLines.height = window.innerHeight, 4729 cy = ch / 2; 4730 4731 Draw(); 4732 }; 4733 4734 setTimeout(function() { 4735 Init(); 4736 4737 //addEventListener('resize', Init, false); 4738 }, 15); 4739 4740 function Intersect2lines(l1, l2) { 4741 var p1 = l1.a, 4742 p2 = l1.b, 4743 p3 = l2.a, 4744 p4 = l2.b; 4745 var denominator = (p4.y - p3.y) * (p2.x - p1.x) - (p4.x - p3.x) * (p2.y - p1.y); 4746 var ua = ((p4.x - p3.x) * (p1.y - p3.y) - (p4.y - p3.y) * (p1.x - p3.x)) / denominator; 4747 var ub = ((p2.x - p1.x) * (p1.y - p3.y) - (p2.y - p1.y) * (p1.x - p3.x)) / denominator; 4748 var x = p1.x + ua * (p2.x - p1.x); 4749 var y = p1.y + ua * (p2.y - p1.y); 4750 if (ua > 0 && ub > 0) { 4751 markPoint({ 4752 x: x, 4753 y: y 4754 }) 4755 } 4756 } 4757 4758 function markPoint(p) { 4759 ctx.fillStyle = "#838383"; 4760 ctx.beginPath();
4761 ctx.arc(p.x, p.y, 2, 0, 2 * Math.PI); 4762 ctx.fill(); 4763 } 4764 4765 function randomIntFromInterval(mn, mx) { 4766 return ~~(Math.random() * (mx - mn + 1) + mn); 4767 } 4768 } 4769 } 4770 4771 Site.onInit.push(init); 4772 4773 return {}; 4774 4775})(jQuery, Site); 4776 4777/*------------------------------------------- 4778 Alert 4779-------------------------------------------*/ 4780 4781Site.modules.Alert = (function($, Site) { 4782 4783 var $alert = $(".alert"); 4784 var $alertClose = $(".alert_close"); 4785 var $alertTime = $alert.data("time"); 4786 var cookieName = "alert-cookie"; 4787 4788 function init() { 4789 if($alert.length) { 4790 4791 if ($.cookie(cookieName) === $alertTime) { 4792 hideAlert(); 4793 } else { 4794 showAlert(); 4795 } 4796 4797 bindUI(); 4798 } 4799 } 4800 4801 function bindUI() { 4802 $alertClose.on("click", function() { 4803 $.cookie(cookieName, $alertTime); 4804 4805 hideAlert(); 4806 }); 4807 } 4808 4809 function showAlert() { 4810 $alert.addClass("show_alert"); 4811 if ($("body").hasClass("theme_image") || $("body").hasClass("layout_home")) { 4812 $(".page").css("padding-top", $alert.innerHeight()); 4813 } else { 4814 $(".page").css("padding-top", $(".header").innerHeight() + 0); 4815 } 4816 } 4817 4818 function hideAlert() { 4819 $alert.removeClass("show_alert"); 4820 $(".page").css("padding-top", ""); 4821 } 4822 4823 Site.onInit.push(init); 4824 4825 return {}; 4826 4827})(jQuery, Site);
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.