PageSourceSearch

https://www.koppop.nl/lib/bootstrap/js/bootstrap.min~/js/qlobber~p…/js/mail-decode~masthead-map~1447945523.js

js koppop.nl collected 2026-10-02 14:19:02 UTC 196,210 bytes, 2,718 lines download raw bytes

vendor: 39,680 bytes, lines 1-6
1/*!
2 * Bootstrap v3.4.1 (https://getbootstrap.com/)
3 * Copyright 2011-2019 Twitter, Inc.
4 * Licensed under the MIT license
5 */
6if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");!function(t){"use strict";var e=jQuery.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1||3<e[0])throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(),function(n){"use strict";n.fn.emulateTransitionEnd=function(t){var e=!1,i=this;n(this).one("bsTransitionEnd",function(){e=!0});return setTimeout(function(){e||n(i).trigger(n.support.transition.end)},t),this},n(function(){n.support.transition=function o(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(t.style[i]!==undefined)return{end:e[i]};return!1}(),n.support.transition&&(n.event.special.bsTransitionEnd={bindType:n.support.transition.end,delegateType:n.support.transition.end,handle:function(t){if(n(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})})}(jQuery),function(s){"use strict";var e='[data-dismiss="alert"]',a=function(t){s(t).on("click",e,this.close)};a.VERSION="3.4.1",a.TRANSITION_DURATION=150,a.prototype.close=function(t){var e=s(this),i=e.attr("data-target");i||(i=(i=e.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,"")),i="#"===i?[]:i;var o=s(document).find(i);function n(){o.detach().trigger("closed.bs.alert").remove()}t&&t.preventDefault(),o.length||(o=e.closest(".alert")),o.trigger(t=s.Event("close.bs.alert")),t.isDefaultPrevented()||(o.removeClass("in"),s.support.transition&&o.hasClass("fade")?o.one("bsTransitionEnd",n).emulateTransitionEnd(a.TRANSITION_DURATION):n())};var t=s.fn.alert;s.fn.alert=function o(i){return this.each(function(){var t=s(this),e=t.data("bs.alert");e||t.data("bs.alert",e=new a(this)),"string"==typeof i&&e[i].call(t)})},s.fn.alert.Constructor=a,s.fn.alert.noConflict=function(){return s.fn.alert=t,this},s(document).on("click.bs.alert.data-api",e,a.prototype.close)}(jQuery),function(s){"use strict";var n=function(t,e){this.$element=s(t),this.options=s.extend({},n.DEFAULTS,e),this.isLoading=!1};function i(o){return this.each(function(){var t=s(this),e=t.data("bs.button"),i="object"==typeof o&&o;e||t.data("bs.button",e=new n(this,i)),"toggle"==o?e.toggle():o&&e.setState(o)})}n.VERSION="3.4.1",n.DEFAULTS={loadingText:"loading..."},n.prototype.setState=function(t){var e="disabled",i=this.$element,o=i.is("input")?"val":"html",n=i.data();t+="Text",null==n.resetText&&i.data("resetText",i[o]()),setTimeout(s.proxy(function(){i[o](null==n[t]?this.options[t]:n[t]),"loadingText"==t?(this.isLoading=!0,i.addClass(e).attr(e,e).prop(e,!0)):this.isLoading&&(this.isLoading=!1,i.removeClass(e).removeAttr(e).prop(e,!1))},this),0)},n.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")?(i.prop("checked")&&(t=!1),e.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==i.prop("type")&&(i.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),i.prop("checked",this.$element.hasClass("active")),t&&i.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var t=s.fn.button;s.fn.button=i,s.fn.button.Constructor=n,s.fn.button.noConflict=function(){return s.fn.button=t,this},s(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(t){var e=s(t.target).closest(".btn");i.call(e,"toggle"),s(t.target).is('input[type="radio"], input[type="checkbox"]')||(t.preventDefault(),e.is("input,button")?e.trigger("focus"):e.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(t){s(t.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(t.type))})}(jQuery),function(p){"use strict";var c=function(t,e){this.$element=p(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=e,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",p.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",p.proxy(this.pause,this)).on("mouseleave.bs.carousel",p.proxy(this.cycle,this))};function r(n){return this.each(function(){var t=p(this),e=t.data("bs.carousel"),i=p.extend({},c.DEFAULTS,t.data(),"object"==typeof n&&n),o="string"==typeof n?n:i.slide;e||t.data("bs.carousel",e=new c(this,i)),"number"==typeof n?e.to(n):o?e[o]():i.interval&&e.pause().cycle()})}c.VERSION="3.4.1",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(t){if(!/input|textarea/i.test(t.target.tagName)){switch(t.which){case 37:this.prev();break;case 39:this.next();break;default:return}t.preventDefault()}},c.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(p.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(t){return this.$items=t.parent().children(".item"),this.$items.index(t||this.$active)},c.prototype.getItemForDirection=function(t,e){var i=this.getItemIndex(e);if(("prev"==t&&0===i||"next"==t&&i==this.$items.length-1)&&!this.options.wrap)return e;var o=(i+("prev"==t?-1:1))%this.$items.length;return this.$items.eq(o)},c.prototype.to=function(t){var e=this,i=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(t>this.$items.length-1||t<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){e.to(t)}):i==t?this.pause().cycle():this.slide(i<t?"next":"prev",this.$items.eq(t))},c.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&p.support.transition&&(this.$element.trigger(p.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(t,e){var i=this.$element.find(".item.active"),o=e||this.getItemForDirection(t,i),n=this.interval,s="next"==t?"left":"right",a=this;if(o.hasClass("active"))return this.sliding=!1;var r=o[0],l=p.Event("slide.bs.carousel",{relatedTarget:r,direction:s});if(this.$element.trigger(l),!l.isDefaultPrevented()){if(this.sliding=!0,n&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var h=p(this.$indicators.children()[this.getItemIndex(o)]);h&&h.addClass("active")}var d=p.Event("slid.bs.carousel",{relatedTarget:r,direction:s});return p.support.transition&&this.$element.hasClass("slide")?(o.addClass(t),"object"==typeof o&&o.length&&o[0].offsetWidth,i.addClass(s),o.addClass(s),i.one("bsTransitionEnd",function(){o.removeClass([t,s].join(" ")).addClass("active"),i.removeClass(["active",s].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger(d)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(i.removeClass("active"),o.addClass("active"),this.sliding=!1,this.$element.trigger(d)),n&&this.cycle(),this}};var t=p.fn.carousel;p.fn.carousel=r,p.fn.carousel.Constructor=c,p.fn.carousel.noConflict=function(){return p.fn.carousel=t,this};var e=function(t){var e=p(this),i=e.attr("href");i&&(i=i.replace(/.*(?=#[^\s]+$)/,""));var o=e.attr("data-target")||i,n=p(document).find(o);if(n.hasClass("carousel")){var s=p.extend({},n.data(),e.data()),a=e.attr("data-slide-to");a&&(s.interval=!1),r.call(n,s),a&&n.data("bs.carousel").to(a),t.preventDefault()}};p(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),p(window).on("load",function(){p('[data-ride="carousel"]').each(function(){var t=p(this);r.call(t,t.data())})})}(jQuery),function(a){"use strict";var r=function(t,e){this.$element=a(t),this.options=a.extend({},r.DEFAULTS,e),this.$trigger=a('[data-toggle="collapse"][href="#'+t.id+'"],[data-toggle="collapse"][data-target="#'+t.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};function n(t){var e,i=t.attr("data-target")||(e=t.attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"");return a(document).find(i)}function l(o){return this.each(function(){var t=a(this),e=t.data("bs.collapse"),i=a.extend({},r.DEFAULTS,t.data(),"object"==typeof o&&o);!e&&i.toggle&&/show|hide/.test(o)&&(i.toggle=!1),e||t.data("bs.collapse",e=new r(this,i)),"string"==typeof o&&e[o]()})}r.VERSION="3.4.1",r.TRANSITION_DURATION=350,r.DEFAULTS={toggle:!0},r.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"},r.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var t,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(t=e.data("bs.collapse"))&&t.transitioning)){var i=a.Event("show.bs.collapse");if(this.$element.trigger(i),!i.isDefaultPrevented()){e&&e.length&&(l.call(e,"hide"),t||e.data("bs.collapse",null));var o=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[o](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var n=function(){this.$element.removeClass("collapsing").addClass("collapse in")[o](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return n.call(this);var s=a.camelCase(["scroll",o].join("-"));this.$element.one("bsTransitionEnd",a.proxy(n,this)).emulateTransitionEnd(r.TRANSITION_DURATION)[o](this.$element[0][s])}}}},r.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var t=a.Event("hide.bs.collapse");if(this.$element.trigger(t),!t.isDefaultPrevented()){var e=this.dimension();this.$element[e](this.$element[e]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var i=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};if(!a.support.transition)return i.call(this);this.$element[e](0).one("bsTransitionEnd",a.proxy(i,this)).emulateTransitionEnd(r.TRANSITION_DURATION)}}},r.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},r.prototype.getParent=function(){return a(document).find(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(t,e){var i=a(e);this.addAriaAndCollapsedClass(n(i),i)},this)).end()},r.prototype.addAriaAndCollapsedClass=function(t,e){var i=t.hasClass("in");t.attr("aria-expanded",i),e.toggleClass("collapsed",!i).attr("aria-expanded",i)};var t=a.fn.collapse;a.fn.collapse=l,a.fn.collapse.Constructor=r,a.fn.collapse.noConflict=function(){return a.fn.collapse=t,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(t){var e=a(this);e.attr("data-target")||t.preventDefault();var i=n(e),o=i.data("bs.collapse")?"toggle":e.data();l.call(i,o)})}(jQuery),function(a){"use strict";var r='[data-toggle="dropdown"]',o=function(t){a(t).on("click.bs.dropdown",this.toggle)};function l(t){var e=t.attr("data-target");e||(e=(e=t.attr("href"))&&/#[A-Za-z]/.test(e)&&e.replace(/.*(?=#[^\s]*$)/,""));var i="#"!==e?a(document).find(e):null;return i&&i.length?i:t.parent()}function s(o){o&&3===o.which||(a(".dropdown-backdrop").remove(),a(r).each(function(){var t=a(this),e=l(t),i={relatedTarget:this};e.hasClass("open")&&(o&&"click"==o.type&&/input|textarea/i.test(o.target.tagName)&&a.contains(e[0],o.target)||(e.trigger(o=a.Event("hide.bs.dropdown",i)),o.isDefaultPrevented()||(t.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",i)))))}))}o.VERSION="3.4.1",o.prototype.toggle=function(t){var e=a(this);if(!e.is(".disabled, :disabled")){var i=l(e),o=i.hasClass("open");if(s(),!o){"ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",s);var n={relatedTarget:this};if(i.trigger(t=a.Event("show.bs.dropdown",n)),t.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),i.toggleClass("open").trigger(a.Event("shown.bs.dropdown",n))}return!1}},o.prototype.keydown=function(t){if(/(38|40|27|32)/.test(t.which)&&!/input|textarea/i.test(t.target.tagName)){var e=a(this);if(t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled")){var i=l(e),o=i.hasClass("open");if(!o&&27!=t.which||o&&27==t.which)return 27==t.which&&i.find(r).trigger("focus"),e.trigger("click");var n=i.find(".dropdown-menu li:not(.disabled):visible a");if(n.length){var s=n.index(t.target);38==t.which&&0<s&&s--,40==t.which&&s<n.length-1&&s++,~s||(s=0),n.eq(s).trigger("focus")}}}};var t=a.fn.dropdown;a.fn.dropdown=function e(i){return this.each(function(){var t=a(this),e=t.data("bs.dropdown");e||t.data("bs.dropdown",e=new o(this)),"string"==typeof i&&e[i].call(t)})},a.fn.dropdown.Constructor=o,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=t,this},a(document).on("click.bs.dropdown.data-api",s).on("click.bs.dropdown.data-api",".dropdown form",function(t){t.stopPropagation()}).on("click.bs.dropdown.data-api",r,o.prototype.toggle).on("keydown.bs.dropdown.data-api",r,o.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",o.prototype.keydown)}(jQuery),function(a){"use strict";var s=function(t,e){this.options=e,this.$body=a(document.body),this.$element=a(t),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.fixedContent=".navbar-fixed-top, .navbar-fixed-bottom",this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};function r(o,n){return this.each(function(){var t=a(this),e=t.data("bs.modal"),i=a.extend({},s.DEFAULTS,t.data(),"object"==typeof o&&o);e||t.data("bs.modal",e=new s(this,i)),"string"==typeof o?e[o](n):i.show&&e.show(n)})}s.VERSION="3.4.1",s.TRANSITION_DURATION=300,s.BACKDROP_TRANSITION_DURATION=150,s.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},s.prototype.toggle=function(t){return this.isShown?this.hide():this.show(t)},s.prototype.show=function(i){var o=this,t=a.Event("show.bs.modal",{relatedTarget:i});this.$element.trigger(t),this.isShown||t.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){o.$element.one("mouseup.dismiss.bs.modal",function(t){a(t.target).is(o.$element)&&(o.ignoreBackdropClick=!0)})}),this.backdrop(function(){var t=a.support.transition&&o.$element.hasClass("fade");o.$element.parent().length||o.$element.appendTo(o.$body),o.$element.show().scrollTop(0),o.adjustDialog(),t&&o.$element[0].offsetWidth,o.$element.addClass("in"),o.enforceFocus();var e=a.Event("shown.bs.modal",{relatedTarget:i});t?o.$dialog.one("bsTransitionEnd",function(){o.$element.trigger("focus").trigger(e)}).emulateTransitionEnd(s.TRANSITION_DURATION):o.$element.trigger("focus").trigger(e)}))},s.prototype.hide=function(t){t&&t.preventDefault(),t=a.Event("hide.bs.modal"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(s.TRANSITION_DURATION):this.hideModal())},s.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(t){document===t.target||this.$element[0]===t.target||this.$element.has(t.target).length||this.$element.trigger("focus")},this))},s.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(t){27==t.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},s.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},s.prototype.hideModal=function(){var t=this;this.$element.hide(),this.backdrop(function(){t.$body.removeClass("modal-open"),t.resetAdjustments(),t.resetScrollbar(),t.$element.trigger("hidden.bs.modal")})},s.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},s.prototype.backdrop=function(t){var e=this,i=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var o=a.support.transition&&i;if(this.$backdrop=a(document.createElement("div")).addClass("modal-backdrop "+i).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(t){this.ignoreBackdropClick?this.ignoreBackdropClick=!1:t.target===t.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide())},this)),o&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!t)return;o?this.$backdrop.one("bsTransitionEnd",t).emulateTransitionEnd(s.BACKDROP_TRANSITION_DURATION):t()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var n=function(){e.removeBackdrop(),t&&t()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",n).emulateTransitionEnd(s.BACKDROP_TRANSITION_DURATION):n()}else t&&t()},s.prototype.handleUpdate=function(){this.adjustDialog()},s.prototype.adjustDialog=function(){var t=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&t?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!t?this.scrollbarWidth:""})},s.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},s.prototype.checkScrollbar=function(){var t=window.innerWidth;if(!t){var e=document.documentElement.getBoundingClientRect();t=e.right-Math.abs(e.left)}this.bodyIsOverflowing=document.body.clientWidth<t,this.scrollbarWidth=this.measureScrollbar()},s.prototype.setScrollbar=function(){var t=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"";var n=this.scrollbarWidth;this.bodyIsOverflowing&&(this.$body.css("padding-right",t+n),a(this.fixedContent).each(function(t,e){var i=e.style.paddingRight,o=a(e).css("padding-right");a(e).data("padding-right",i).css("padding-right",parseFloat(o)+n+"px")}))},s.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad),a(this.fixedContent).each(function(t,e){var i=a(e).data("padding-right");a(e).removeData("padding-right"),e.style.paddingRight=i||""})},s.prototype.measureScrollbar=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",this.$body.append(t);var e=t.offsetWidth-t.clientWidth;return this.$body[0].removeChild(t),e};var t=a.fn.modal;a.fn.modal=r,a.fn.modal.Constructor=s,a.fn.modal.noConflict=function(){return a.fn.modal=t,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var e=a(this),i=e.attr("href"),o=e.attr("data-target")||i&&i.replace(/.*(?=#[^\s]+$)/,""),n=a(document).find(o),s=n.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(i)&&i},n.data(),e.data());e.is("a")&&t.preventDefault(),n.one("show.bs.modal",function(t){t.isDefaultPrevented()||n.one("hidden.bs.modal",function(){e.is(":visible")&&e.trigger("focus")})}),r.call(n,s,this)})}(jQuery),function(g){"use strict";var o=["sanitize","whiteList","sanitizeFn"],a=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],t={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},r=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,l=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function u(t,e){var i=t.nodeName.toLowerCase();if(-1!==g.inArray(i,e))return-1===g.inArray(i,a)||Boolean(t.nodeValue.match(r)||t.nodeValue.match(l));for(var o=g(e).filter(function(t,e){return e instanceof RegExp}),n=0,s=o.length;n<s;n++)if(i.match(o[n]))return!0;return!1}function n(t,e,i){if(0===t.length)return t;if(i&&"function"==typeof i)return i(t);if(!document.implementation||!document.implementation.createHTMLDocument)return t;var o=document.implementation.createHTMLDocument("sanitization");o.body.innerHTML=t;for(var n=g.map(e,function(t,e){return e}),s=g(o.body).find("*"),a=0,r=s.length;a<r;a++){var l=s[a],h=l.nodeName.toLowerCase();if(-1!==g.inArray(h,n))for(var d=g.map(l.attributes,function(t){return t}),p=[].concat(e["*"]||[],e[h]||[]),c=0,f=d.length;c<f;c++)u(d[c],p)||l.removeAttribute(d[c].nodeName);else l.parentNode.removeChild(l)}return o.body.innerHTML}var m=function(t,e){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",t,e)};m.VERSION="3.4.1",m.TRANSITION_DURATION=150,m.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0},sanitize:!0,sanitizeFn:null,whiteList:t},m.prototype.init=function(t,e,i){if(this.enabled=!0,this.type=t,this.$element=g(e),this.options=this.getOptions(i),this.$viewport=this.options.viewport&&g(document).find(g.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var o=this.options.trigger.split(" "),n=o.length;n--;){var s=o[n];if("click"==s)this.$element.on("click."+this.type,this.options.selector,g.proxy(this.toggle,this));else if("manual"!=s){var a="hover"==s?"mouseenter":"focusin",r="hover"==s?"mouseleave":"focusout";this.$element.on(a+"."+this.type,this.options.selector,g.proxy(this.enter,this)),this.$element.on(r+"."+this.type,this.options.selector,g.proxy(this.leave,this))}}this.options.selector?this._options=g.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},m.prototype.getDefaults=function(){return m.DEFAULTS},m.prototype.getOptions=function(t){var e=this.$element.data();for(var i in e)e.hasOwnProperty(i)&&-1!==g.inArray(i,o)&&delete e[i];return(t=g.extend({},this.getDefaults(),e,t)).delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t.sanitize&&(t.template=n(t.template,t.whiteList,t.sanitizeFn)),t},m.prototype.getDelegateOptions=function(){var i={},o=this.getDefaults();return this._options&&g.each(this._options,function(t,e){o[t]!=e&&(i[t]=e)}),i},m.prototype.enter=function(t){var e=t instanceof this.constructor?t:g(t.currentTarget).data("bs."+this.type);if(e||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e)),t instanceof g.Event&&(e.inState["focusin"==t.type?"focus":"hover"]=!0),e.tip().hasClass("in")||"in"==e.hoverState)e.hoverState="in";else{if(clearTimeout(e.timeout),e.hoverState="in",!e.options.delay||!e.options.delay.show)return e.show();e.timeout=setTimeout(function(){"in"==e.hoverState&&e.show()},e.options.delay.show)}},m.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},m.prototype.leave=function(t){var e=t instanceof this.constructor?t:g(t.currentTarget).data("bs."+this.type);if(e||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e)),t instanceof g.Event&&(e.inState["focusout"==t.type?"focus":"hover"]=!1),!e.isInStateTrue()){if(clearTimeout(e.timeout),e.hoverState="out",!e.options.delay||!e.options.delay.hide)return e.hide();e.timeout=setTimeout(function(){"out"==e.hoverState&&e.hide()},e.options.delay.hide)}},m.prototype.show=function(){var t=g.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);var e=g.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(t.isDefaultPrevented()||!e)return;var i=this,o=this.tip(),n=this.getUID(this.type);this.setContent(),o.attr("id",n),this.$element.attr("aria-describedby",n),this.options.animation&&o.addClass("fade");var s="function"==typeof this.options.placement?this.options.placement.call(this,o[0],this.$element[0]):this.options.placement,a=/\s?auto?\s?/i,r=a.test(s);r&&(s=s.replace(a,"")||"top"),o.detach().css({top:0,left:0,display:"block"}).addClass(s).data("bs."+this.type,this),this.options.container?o.appendTo(g(document).find(this.options.container)):o.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var l=this.getPosition(),h=o[0].offsetWidth,d=o[0].offsetHeight;if(r){var p=s,c=this.getPosition(this.$viewport);s="bottom"==s&&l.bottom+d>c.bottom?"top":"top"==s&&l.top-d<c.top?"bottom":"right"==s&&l.right+h>c.width?"left":"left"==s&&l.left-h<c.left?"right":s,o.removeClass(p).addClass(s)}var f=this.getCalculatedOffset(s,l,h,d);this.applyPlacement(f,s);var u=function(){var t=i.hoverState;i.$element.trigger("shown.bs."+i.type),i.hoverState=null,"out"==t&&i.leave(i)};g.support.transition&&this.$tip.hasClass("fade")?o.one("bsTransitionEnd",u).emulateTransitionEnd(m.TRANSITION_DURATION):u()}},m.prototype.applyPlacement=function(t,e){var i=this.tip(),o=i[0].offsetWidth,n=i[0].offsetHeight,s=parseInt(i.css("margin-top"),10),a=parseInt(i.css("margin-left"),10);isNaN(s)&&(s=0),isNaN(a)&&(a=0),t.top+=s,t.left+=a,g.offset.setOffset(i[0],g.extend({using:function(t){i.css({top:Math.round(t.top),left:Math.round(t.left)})}},t),0),i.addClass("in");var r=i[0].offsetWidth,l=i[0].offsetHeight;"top"==e&&l!=n&&(t.top=t.top+n-l);var h=this.getViewportAdjustedDelta(e,t,r,l);h.left?t.left+=h.left:t.top+=h.top;var d=/top|bottom/.test(e),p=d?2*h.left-o+r:2*h.top-n+l,c=d?"offsetWidth":"offsetHeight";i.offset(t),this.replaceArrow(p,i[0][c],d)},m.prototype.replaceArrow=function(t,e,i){this.arrow().css(i?"left":"top",50*(1-t/e)+"%").css(i?"top":"left","")},m.prototype.setContent=function(){var t=this.tip(),e=this.getTitle();this.options.html?(this.options.sanitize&&(e=n(e,this.options.whiteList,this.options.sanitizeFn)),t.find(".tooltip-inner").html(e)):t.find(".tooltip-inner").text(e),t.removeClass("fade in top bottom left right")},m.prototype.hide=function(t){var e=this,i=g(this.$tip),o=g.Event("hide.bs."+this.type);function n(){"in"!=e.hoverState&&i.detach(),e.$element&&e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),t&&t()}if(this.$element.trigger(o),!o.isDefaultPrevented())return i.removeClass("in"),g.support.transition&&i.hasClass("fade")?i.one("bsTransitionEnd",n).emulateTransitionEnd(m.TRANSITION_DURATION):n(),this.hoverState=null,this},m.prototype.fixTitle=function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").attr("title","")},m.prototype.hasContent=function(){return this.getTitle()},m.prototype.getPosition=function(t){var e=(t=t||this.$element)[0],i="BODY"==e.tagName,o=e.getBoundingClientRect();null==o.width&&(o=g.extend({},o,{width:o.right-o.left,height:o.bottom-o.top}));var n=window.SVGElement&&e instanceof window.SVGElement,s=i?{top:0,left:0}:n?null:t.offset(),a={scroll:i?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop()},r=i?{width:g(window).width(),height:g(window).height()}:null;return g.extend({},o,a,r,s)},m.prototype.getCalculatedOffset=function(t,e,i,o){return"bottom"==t?{top:e.top+e.height,left:e.left+e.width/2-i/2}:"top"==t?{top:e.top-o,left:e.left+e.width/2-i/2}:"left"==t?{top:e.top+e.height/2-o/2,left:e.left-i}:{top:e.top+e.height/2-o/2,left:e.left+e.width}},m.prototype.getViewportAdjustedDelta=function(t,e,i,o){var n={top:0,left:0};if(!this.$viewport)return n;var s=this.options.viewport&&this.options.viewport.padding||0,a=this.getPosition(this.$viewport);if(/right|left/.test(t)){var r=e.top-s-a.scroll,l=e.top+s-a.scroll+o;r<a.top?n.top=a.top-r:l>a.top+a.height&&(n.top=a.top+a.height-l)}else{var h=e.left-s,d=e.left+s+i;h<a.left?n.left=a.left-h:d>a.right&&(n.left=a.left+a.width-d)}return n},m.prototype.getTitle=function(){var t=this.$element,e=this.options;return t.attr("data-original-title")||("function"==typeof e.title?e.title.call(t[0]):e.title)},m.prototype.getUID=function(t){for(;t+=~~(1e6*Math.random()),document.getElementById(t););return t},m.prototype.tip=function(){if(!this.$tip&&(this.$tip=g(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},m.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},m.prototype.enable=function(){this.enabled=!0},m.prototype.disable=function(){this.enabled=!1},m.prototype.toggleEnabled=function(){this.enabled=!this.enabled},m.prototype.toggle=function(t){var e=this;t&&((e=g(t.currentTarget).data("bs."+this.type))||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e))),t?(e.inState.click=!e.inState.click,e.isInStateTrue()?e.enter(e):e.leave(e)):e.tip().hasClass("in")?e.leave(e):e.enter(e)},m.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide(function(){t.$element.off("."+t.type).removeData("bs."+t.type),t.$tip&&t.$tip.detach(),t.$tip=null,t.$arrow=null,t.$viewport=null,t.$element=null})},m.prototype.sanitizeHtml=function(t){return n(t,this.options.whiteList,this.options.sanitizeFn)};var e=g.fn.tooltip;g.fn.tooltip=function i(o){return this.each(function(){var t=g(this),e=t.data("bs.tooltip"),i="object"==typeof o&&o;!e&&/destroy|hide/.test(o)||(e||t.data("bs.tooltip",e=new m(this,i)),"string"==typeof o&&e[o]())})},g.fn.tooltip.Constructor=m,g.fn.tooltip.noConflict=function(){return g.fn.tooltip=e,this}}(jQuery),function(n){"use strict";var s=function(t,e){this.init("popover",t,e)};if(!n.fn.tooltip)throw new Error("Popover requires tooltip.js");s.VERSION="3.4.1",s.DEFAULTS=n.extend({},n.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),((s.prototype=n.extend({},n.fn.tooltip.Constructor.prototype)).constructor=s).prototype.getDefaults=function(){return s.DEFAULTS},s.prototype.setContent=function(){var t=this.tip(),e=this.getTitle(),i=this.getContent();if(this.options.html){var o=typeof i;this.options.sanitize&&(e=this.sanitizeHtml(e),"string"===o&&(i=this.sanitizeHtml(i))),t.find(".popover-title").html(e),t.find(".popover-content").children().detach().end()["string"===o?"html":"append"](i)}else t.find(".popover-title").text(e),t.find(".popover-content").children().detach().end().text(i);t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},s.prototype.hasContent=function(){return this.getTitle()||this.getContent()},s.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},s.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var t=n.fn.popover;n.fn.popover=function e(o){return this.each(function(){var t=n(this),e=t.data("bs.popover"),i="object"==typeof o&&o;!e&&/destroy|hide/.test(o)||(e||t.data("bs.popover",e=new s(this,i)),"string"==typeof o&&e[o]())})},n.fn.popover.Constructor=s,n.fn.popover.noConflict=function(){return n.fn.popover=t,this}}(jQuery),function(s){"use strict";function n(t,e){this.$body=s(document.body),this.$scrollElement=s(t).is(document.body)?s(window):s(t),this.options=s.extend({},n.DEFAULTS,e),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",s.proxy(this.process,this)),this.refresh(),this.process()}function e(o){return this.each(function(){var t=s(this),e=t.data("bs.scrollspy"),i="object"==typeof o&&o;e||t.data("bs.scrollspy",e=new n(this,i)),"string"==typeof o&&e[o]()})}n.VERSION="3.4.1",n.DEFAULTS={offset:10},n.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},n.prototype.refresh=function(){var t=this,o="offset",n=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),s.isWindow(this.$scrollElement[0])||(o="position",n=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var t=s(this),e=t.data("target")||t.attr("href"),i=/^#./.test(e)&&s(e);return i&&i.length&&i.is(":visible")&&[[i[o]().top+n,e]]||null}).sort(function(t,e){return t[0]-e[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},n.prototype.process=function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,i=this.getScrollHeight(),o=this.options.offset+i-this.$scrollElement.height(),n=this.offsets,s=this.targets,a=this.activeTarget;if(this.scrollHeight!=i&&this.refresh(),o<=e)return a!=(t=s[s.length-1])&&this.activate(t);if(a&&e<n[0])return this.activeTarget=null,this.clear();for(t=n.length;t--;)a!=s[t]&&e>=n[t]&&(n[t+1]===undefined||e<n[t+1])&&this.activate(s[t])},n.prototype.activate=function(t){this.activeTarget=t,this.clear();var e=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',i=s(e).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active")),i.trigger("activate.bs.scrollspy")},n.prototype.clear=function(){s(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var t=s.fn.scrollspy;s.fn.scrollspy=e,s.fn.scrollspy.Constructor=n,s.fn.scrollspy.noConflict=function(){return s.fn.scrollspy=t,this},s(window).on("load.bs.scrollspy.data-api",function(){s('[data-spy="scroll"]').each(function(){var t=s(this);e.call(t,t.data())})})}(jQuery),function(r){"use strict";var a=function(t){this.element=r(t)};function e(i){return this.each(function(){var t=r(this),e=t.data("bs.tab");e||t.data("bs.tab",e=new a(this)),"string"==typeof i&&e[i]()})}a.VERSION="3.4.1",a.TRANSITION_DURATION=150,a.prototype.show=function(){var t=this.element,e=t.closest("ul:not(.dropdown-menu)"),i=t.data("target");if(i||(i=(i=t.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,"")),!t.parent("li").hasClass("active")){var o=e.find(".active:last a"),n=r.Event("hide.bs.tab",{relatedTarget:t[0]}),s=r.Event("show.bs.tab",{relatedTarget:o[0]});if(o.trigger(n),t.trigger(s),!s.isDefaultPrevented()&&!n.isDefaultPrevented()){var a=r(document).find(i);this.activate(t.closest("li"),e),this.activate(a,a.parent(),function(){o.trigger({type:"hidden.bs.tab",relatedTarget:t[0]}),t.trigger({type:"shown.bs.tab",relatedTarget:o[0]})})}}},a.prototype.activate=function(t,e,i){var o=e.find("> .active"),n=i&&r.support.transition&&(o.length&&o.hasClass("fade")||!!e.find("> .fade").length);function s(){o.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),t.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),n?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu").length&&t.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),i&&i()}o.length&&n?o.one("bsTransitionEnd",s).emulateTransitionEnd(a.TRANSITION_DURATION):s(),o.removeClass("in")};var t=r.fn.tab;r.fn.tab=e,r.fn.tab.Constructor=a,r.fn.tab.noConflict=function(){return r.fn.tab=t,this};var i=function(t){t.preventDefault(),e.call(r(this),"show")};r(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',i).on("click.bs.tab.data-api",'[data-toggle="pill"]',i)}(jQuery),function(l){"use strict";var h=function(t,e){this.options=l.extend({},h.DEFAULTS,e);var i=this.options.target===h.DEFAULTS.target?l(this.options.target):l(document).find(this.options.target);this.$target=i.on("scroll.bs.affix.data-api",l.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",l.proxy(this.checkPositionWithEventLoop,this)),this.$element=l(t),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};function i(o){return this.each(function(){var t=l(this),e=t.data("bs.affix"),i="object"==typeof o&&o;e||t.data("bs.affix",e=new h(this,i)),"string"==typeof o&&e[o]()})}h.VERSION="3.4.1",h.RESET="affix affix-top affix-bottom",h.DEFAULTS={offset:0,target:window},h.prototype.getState=function(t,e,i,o){var n=this.$target.scrollTop(),s=this.$element.offset(),a=this.$target.height();if(null!=i&&"top"==this.affixed)return n<i&&"top";if("bottom"==this.affixed)return null!=i?!(n+this.unpin<=s.top)&&"bottom":!(n+a<=t-o)&&"bottom";var r=null==this.affixed,l=r?n:s.top;return null!=i&&n<=i?"top":null!=o&&t-o<=l+(r?a:e)&&"bottom"},h.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(h.RESET).addClass("affix");var t=this.$target.scrollTop(),e=this.$element.offset();return this.pinnedOffset=e.top-t},h.prototype.checkPositionWithEventLoop=function(){setTimeout(l.proxy(this.checkPosition,this),1)},h.prototype.checkPosition=function(){if(this.$element.is(":visible")){var t=this.$element.height(),e=this.options.offset,i=e.top,o=e.bottom,n=Math.max(l(document).height(),l(document.body).height());"object"!=typeof e&&(o=i=e),"function"==typeof i&&(i=e.top(this.$element)),"function"==typeof o&&(o=e.bottom(this.$element));var s=this.getState(n,t,i,o);if(this.affixed!=s){null!=this.unpin&&this.$element.css("top","");var a="affix"+(s?"-"+s:""),r=l.Event(a+".bs.affix");if(this.$element.trigger(r),r.isDefaultPrevented())return;this.affixed=s,this.unpin="bottom"==s?this.getPinnedOffset():null,this.$element.removeClass(h.RESET).addClass(a).trigger(a.replace("affix","affixed")+".bs.affix")}"bottom"==s&&this.$element.offset({top:n-t-o})}};var t=l.fn.affix;l.fn.affix=i,l.fn.affix.Constructor=h,l.fn.affix.noConflict=function(){return l.fn.affix=t,this},l(window).on("load",function(){l('[data-spy="affix"]').each(function(){var t=l(this),e=t.data();e.offset=e.offset||{},null!=e.offsetBottom&&(e.offset.bottom=e.offsetBottom),null!=e.offsetTop&&(e.offset.top=e.offsetTop),i.call(t,e)})})}(jQuery);
6/**
7# qlobber&nbsp;&nbsp;&nbsp;[![Build Status](https://travis-ci.org/davedoesdev/qlobber.png)](https://travis-ci.org/davedoesdev/qlobber) [![Coverage Status](https://coveralls.io/repos/davedoesdev/qlobber/badge.png?branch=master)](https://coveralls.io/r/davedoesdev/qlobber?branch=master) [![NPM version](https://badge.fury.io/js/qlobber.png)](http://badge.fury.io/js/qlobber)
8
9Node.js globbing for amqp-like topics.
10
11Example:
12
13```javascript
14var Qlobber = require('qlobber').Qlobber;
15var matcher = new Qlobber();
16matcher.add('foo.*', 'it matched!');
17assert.deepEqual(matcher.match('foo.bar'), ['it matched!']);
18```
19
20The API is described [here](#tableofcontents).
21
22qlobber is implemented using a trie, as described in the RabbitMQ blog posts [here](http://www.rabbitmq.com/blog/2010/09/14/very-fast-and-scalable-topic-routing-part-1/) and [here](http://www.rabbitmq.com/blog/2011/03/28/very-fast-and-scalable-topic-routing-part-2/).
23
24## Installation
25
26```shell
27npm install qlobber
28```
29
30## Another Example
31
32A more advanced example using topics from the [RabbitMQ topic tutorial](http://www.rabbitmq.com/tutorials/tutorial-five-python.html):
33
34```javascript
35var matcher = new Qlobber();
36matcher.add('*.orange.*', 'Q1');
37matcher.add('*.*.rabbit', 'Q2');
38matcher.add('lazy.#', 'Q2');
39assert.deepEqual(['quick.orange.rabbit',
40                  'lazy.orange.elephant',
41                  'quick.orange.fox',
42                  'lazy.brown.fox',
43                  'lazy.pink.rabbit',
44                  'quick.brown.fox',
45                  'orange',
46                  'quick.orange.male.rabbit',
47                  'lazy.orange.male.rabbit'].map(function (topic)
48                  {
49                      return matcher.match(topic).sort();
50                  }),
51                 [['Q1', 'Q2'],
52                  ['Q1', 'Q2'],
53                  ['Q1'],
54                  ['Q2'],
55                  ['Q2', 'Q2'],
56                  [],
57                  [],
58                  [],
59                  ['Q2']]);
60```
61
62## Licence
63
64[MIT](LICENCE)
65
66## Tests
67
68qlobber passes the [RabbitMQ topic tests](https://github.com/rabbitmq/rabbitmq-server/blob/master/src/rabbit_tests.erl) (I converted them from Erlang to Javascript).
69
70To run the tests:
71
72```javascript
73grunt test
74```
75
76## Lint
77
78```javascript
79grunt lint
80```
81
82## Code Coverage
83
84```javascript
85grunt coverage
86```
87
88[Instanbul](http://gotwarlost.github.io/istanbul/) results are available [here](http://htmlpreview.github.io/?https://github.com/davedoesdev/qlobber/blob/master/coverage/lcov-report/index.html).
89
90Coveralls page is [here](https://coveralls.io/r/davedoesdev/qlobber).
91
92## Benchmarks
93
94```javascript
95grunt bench
96```
97
98qlobber is also benchmarked in [ascoltatori](https://github.com/mcollina/ascoltatori).
99
100# API
101*/
102
103/*jslint node: true, nomen: true */
104"use strict";
105
106/**
107Creates a new qlobber.
108
109@constructor
110@param {Object} [options] Configures the qlobber. Use the following properties:
111
112- `{String} separator` The character to use for separating words in topics. Defaults to '.'. MQTT uses '/' as the separator, for example.
113
114- `{String} wildcard_one` The character to use for matching exactly one word in a topic. Defaults to '*'. MQTT uses '+', for example.
115
116- `{String} wildcard_some` The character to use for matching zero or more words in a topic. Defaults to '#'. MQTT uses '#' too.
117*/
118function Qlobber (options)
119{
120    options = options || {};
121
122    this._separator = options.separator || '.';
123    this._wildcard_one = options.wildcard_one || '*';
124    this._wildcard_some = options.wildcard_some || '#';
125    this._trie = {};
126}
127
128Qlobber.prototype._add = function (val, i, words, sub_trie)
129{
130    var st, word;
131
132    if (i === words.length)
133    {
134        st = sub_trie[this._separator];
135        
136        if (st)
137        {
138            st.push(val);
139        }
140        else
141        {
142            sub_trie[this._separator] = [val];
143        }
144        
145        return;
146    }
147
148    word = words[i];
149    st = sub_trie[word];
150    
151    if (!st)
152    {
153        st = sub_trie[word] = {};
154    }
155    
156    this._add(val, i + 1, words, st);
157};
158
159Qlobber.prototype._remove = function (val, i, words, sub_trie)
160{
161    var st, index, word;
162
163    if (i === words.length)
164    {
165        st = sub_trie[this._separator];
166
167        if (st)
168        {
169            if (val === undefined)
170            {
171                st = [];
172            }
173            else
174            {
175                index = st.lastIndexOf(val);
176
177                if (index >= 0)
178                {
179                    st.splice(index, 1);
180                }
181            }
182
183            if (st.length === 0)
184            {
185                delete sub_trie[this._separator];
186            }
187        }
188
189        return;
190    }
191    
192    word = words[i];
193    st = sub_trie[word];
194
195    if (!st)
196    {
197        return;
198    }
199
200    this._remove(val, i + 1, words, st);
201
202    /*jslint forin: true */
203    for (word in st)
204    {
205        return;
206    }
207    /*jslint forin: false */
208
209    delete sub_trie[word];
210};
211
212Qlobber.prototype._match = function (v, i, words, sub_trie)
213{
214    var word, st, w, j;
215
216    st = sub_trie[this._wildcard_some];
217
218    if (st)
219    {
220        // common case: no more levels
221
222        /*jslint forin: true */
223        for (w in st)
224        {
225            if (w !== this._separator)
226            {
227                for (j = i; j < words.length; j += 1)
228                {
229                    v = this._match(v, j, words, st);
230                }
231
232                break;
233            }
234        }
235        /*jslint forin: false */
236
237        v = this._match(v, words.length, words, st);
238    }
239
240    if (i === words.length)
241    {
242        st = sub_trie[this._separator];
243
244        if (st)
245        {
246            v = v.concat(st);
247        }
248    }
249    else
250    {
251        word = words[i];
252
253        if ((word !== this._wildcard_one) && (word !== this._wildcard_some))
254        {
255            st = sub_trie[word];
256
257            if (st)
258            {
259                v = this._match(v, i + 1, words, st);
260            }
261        }
262
263        if (word)
264        {
265            st = sub_trie[this._wildcard_one];
266
267            if (st)
268            {
269                v = this._match(v, i + 1, words, st);
270            }
271        }
272    }
273
274    return v;
275};
276
277/**
278Add a topic matcher to the qlobber.
279
280Note you can match more than one value against a topic by calling `add` multiple times with the same topic and different values.
281
282@param {String} topic The topic to match against.
283@param {Any} val The value to return if the topic is matched. `undefined` is not supported.
284@return {Qlobber} The qlobber (for chaining).
285*/
286Qlobber.prototype.add = function (topic, val)
287{
288    this._add(val, 0, topic.split(this._separator), this._trie);
289    return this;
290};
291
292/**
293Remove a topic matcher from the qlobber.
294
295@param {String} topic The topic that's being matched against.
296@param {Any} [val] The value that's being matched. If you don't specify `val` then all matchers for `topic` are removed.
297@return {Qlobber} The qlobber (for chaining).
298*/
299Qlobber.prototype.remove = function (topic, val)
300{
301    this._remove(val, 0, topic.split(this._separator), this._trie);
302    return this;
303};
304
305/**
306Match a topic.
307
308@param {String} topic The topic to match against.
309@return {Array} List of values that matched the topic. This may contain duplicates.
310*/
311Qlobber.prototype.match = function (topic)
312{
313    return this._match([], 0, topic.split(this._separator), this._trie);
314};
315
316/**
317Reset the qlobber.
318
319Removes all topic matchers from the qlobber.
320
321@return {Qlobber} The qlobber (for chaining).
322*/
323Qlobber.prototype.clear = function ()
324{
325    this._trie = {};
326    return this;
327};
328
329// for debugging
330Qlobber.prototype.get_trie = function ()
331{
332    return this._trie;
333};
334/* Zotonic's Pubsub using qmtt over websockets/comet 
335
336Special topics:
337
338    "~pagesession"    within this page
339    "~site/foo/bar"   within the site, handled on the server
340    "foo/bar"  the root of the server's mqtt router
341
342TODO:
343
344    * add relay from page topics to server topics
345    * add QoS levels
346        - default level 0
347        - add level 0 and 1, needs local puback
348        - add dup flag to messages 
349    * retain local messages for topics
350*/
351
352function Pubzub ()
353{
354    this._new_matcher = function() {
355        return new Qlobber({
356            separator: '/',
357            wildcard_one: '+',
358            wildcard_some: '#'
359        });
360    };
361    this._matcher = this._new_matcher();
362    this._subs = {};
363    this._subs_relayed = {};
364    this._retained = {};
365
366    this._will_id = 0;
367    ubf.add_spec("mqtt_msg", [
368            "retain", "qos", "topic", "dup", "message_id", "payload",
369            "encoder"
370        ]);
371    ubf.add_spec("z_mqtt_payload", [
372            "site", "user_id", "payload"
373        ]);
374    ubf.add_spec("z_mqtt_cmd", [
375            "cmd", "topic", "payload", "extra"
376        ]);
377
378    var self = this;
379    z_transport_delegate_register(
380            'mqtt_route',
381            function(mqtt_msg, msg) {
382                self.relayed(mqtt_msg, msg);
383            });
384}
385
386Pubzub.prototype.me = function () {
387    return "~site/pagesession/" + z_pageid;
388};
389
390Pubzub.prototype.subscribe_multi = function (topics, fun) {
391    for(var i=topics.length-1; i >= 0; i--) {
392        this.subscribe(topics[i], fun);
393    }
394};
395
396Pubzub.prototype.subscribe = function (topic, fun, ack) {
397    var id = this.unique_id();
398    var async_ack = false;
399    this._matcher.add(topic, id);
400    this._subs[id] = {fun: fun, topic: topic};
401    if (!this.is_local_topic(topic)) {
402        var ct = this._subs_relayed[topic] || 0;
403        if (ct === 0) {
404            async_ack = true;
405            this.transport("subscribe", topic, undefined, undefined, ack);
406        }
407        this._subs_relayed[topic] = ct + 1;
408    } else {
409        this.handle_retained(topic, fun, id);
410    }
411    if(ack && !async_ack) { setTimeout(ack, 0); }
412    return id;
413};
414
415Pubzub.prototype.unsubscribe = function (id) {
416    if (this._subs[id]) {
417        var sub = this._subs[id];
418        var topic = sub.topic;
419
420        this._matcher.remove(topic, id);
421        if (!this.is_local_topic(topic)) {
422            var ct = this._subs_relayed[topic] - 1;
423            if (ct === 0) {
424                this.transport("unsubscribe", topic);
425            }
426            this._subs_relayed[topic] = ct;
427        }
428        delete this._subs[id];
429    }
430};
431
432Pubzub.prototype.publish = function (topic, message, options) {
433    options = options || {retained: false};
434    
435    if (this.is_local_topic(topic)) {
436        if (message === undefined && options.retained) {
437             delete this._retained[topic];
438             return;
439        }
440        
441        var subs = this._matcher.match(topic);
442        for (var i in subs) {
443            var id = subs[i];
444            if (this._subs[id]) {
445                this._subs[id].fun(topic, message, id);
446            }
447        }
448
449        if (options.retained) {
450            this._retained[topic] = message;
451        }
452    } else {
453        if(options.retained)
454            throw "Error: retained messages are not supported for non-local topics";
455            
456        this.transport("publish", topic, message);
457    }
458};
459
460Pubzub.prototype.subscribers = function (topic) {
461    return this._matcher.match(topic);
462};
463
464Pubzub.prototype.reply_topic = function (sub_topic) {
465    if (!sub_topic) {
466        return "~site/reply/"+this.unique_id();
467    } else if (sub_topic.substr(0,1) == "/") {
468        return "~site/reply/"+this.unique_id()+sub_topic;
469    } else {
470        return "~site/reply/"+this.unique_id()+"/"+sub_topic;
471    }
472};
473
474Pubzub.prototype.lastwill = function (topic, message) {
475    this._will_id = this.unique_id();
476    this.transport("lastwill", topic, message, this._will_id);
477};
478
479Pubzub.prototype.remove_lastwill = function () {
480    this.transport("lastwill", undefined, undefined, this._will_id);
481    this._will_id = undefined;
482};
483
484Pubzub.prototype.is_local_topic = function (topic) {
485    var me = this.me();
486
487    return topic == '~pagesession' ||
488           topic == me ||
489           topic.substr(0,13) == "~pagesession/" ||
490           topic.substr(0,me.length+1) == me+"/";
491};
492
493Pubzub.prototype.relayed = function (mqtt_msg, _msg) {
494    var subs = this._matcher.match(mqtt_msg.topic);
495    for (var i in subs) {
496        var id = subs[i];
497        if (this._subs[id]) {
498            this._subs[id].fun(mqtt_msg.topic, mqtt_msg.payload, id);
499        }
500    }
501};
502
503Pubzub.prototype.handle_retained = function(topic, fun, id) {
504    var retained_matcher = this._new_matcher();
505    retained_matcher.add(topic, true);
506    
507    function publish(topic, msg) {
508        setTimeout(function() { fun(topic, msg, id); }, 0);
509    }
510        
511    for(var retained_topic in this._retained) {
512        for(var matches in retained_matcher.match(retained_topic)) {
513            if(matches.length) {
514                publish(retained_topic, this._retained[retained_topic]);
515            }
516        }
517    }
518};
519
520Pubzub.prototype.transport = function (cmd, topic, payload, extra, ack) {
521    var msg = {
522        _record: 'z_mqtt_cmd',
523        cmd: cmd,
524        topic: topic,
525        payload: payload,
526        extra: extra
527    };
528    var options = {
529        qos: 1,
530        ack: ack
531    };
532    z_transport('mqtt', 'ubf', msg, options);
533};
534
535Pubzub.prototype.unique_id = function () {
536    var t = (new Date()).getTime() + "-";
537    var cs = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
538    for( var i=0; i < 20; i++ )
539        t += cs.charAt(Math.floor(Math.random() * cs.length));
540    return t;
541};
542
543Pubzub.prototype.make_zEvtArgs = function (topic, msg, sub_id) {
544    if(typeof msg == 'object') {
545        var args = ensure_name_value(msg);
546        args.unshift({name: "topic", value: topic});
547        args.unshift({name: "sub_id", value: sub_id});
548        return args;
549    }
550
551    return undefined;
552};
553
554(function($) {
555    window.pubzub = new Pubzub();
556})(jQuery);
557/* live js
558----------------------------------------------------------
559
560@package:   Zotonic 2014    
561@Author:    Marc Worrell <[email protected]>
562
563Copyright 2014 Marc Worrell
564
565Licensed under the Apache License, Version 2.0 (the "License");
566you may not use this file except in compliance with the License.
567You may obtain a copy of the License at
568 
569http://www.apache.org/licenses/LICENSE-2.0
570 
571Unless required by applicable law or agreed to in writing, softw
571are
572distributed under the License is distributed on an "AS IS" BASIS,
573WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
574See the License for the specific language governing permissions and
575limitations under the License.
576
577---------------------------------------------------------- */
578
579function ZLive ()
580{
581    this._subscriptions = [];
582    this._prune_timeout = 10000;
583    var self = this;
584    setTimeout(function() { self.prune(); }, this._prune_timeout);
585}
586
587ZLive.prototype.subscribe = function(topics, target, postback) {
588    var self = this;
589    for(var i=topics.length-1; i >= 0; i--) {
590        var topic = topics[i];
591        var sub_id = pubzub.subscribe(
592                            topic,
593                            function(_topic, msg, id) {
594                                self.update(topic, target, postback, msg, id);
595                            });
596
597        this._subscriptions.push({
598            sub_id: sub_id,
599            topic: topic,
600            target: target,
601            postback: postback
602        });
603    }
604};
605
606ZLive.prototype.update = function(topic, target, postback, payload, sub_id) {
607    if ($('#'+target).length) {
608        if (typeof payload._record != 'undefined' && payload._record == 'z_mqtt_payload') {
609            payload = payload.payload;
610        }
611        z_queue_postback(target, postback, {topic: topic, message: payload});
612    } else {
613        this.unsubscribe(sub_id);
614    }
615};
616
617ZLive.prototype.unsubscribe = function(sub_id) {
618    for (var i=0; i<= this._subscriptions.length; i++) {
619        if (this._subscriptions[i].sub_id == sub_id) {
620            this._subscriptions.splice(i,1);
621            break;
622        }
623    }
624    pubzub.unsubscribe(sub_id);
625};
626
627ZLive.prototype.prune = function() {
628    for (var i=this._subscriptions.length-1; i >= 0; i--) {
629        var target = this._subscriptions[i].target;
630        if ($('#'+target).length === 0) {
631            pubzub.unsubscribe(this._subscriptions[i].sub_id);
632            this._subscriptions.splice(i,1);
633        }
634    }
635    var self = this;
636    setTimeout(function() { self.prune(); }, this._prune_timeout);
637};
638
639window.z_live = new ZLive();
640/*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */
641(function(r,G,f,v){var J=f("html"),n=f(r),p=f(G),b=f.fancybox=function(){b.open.apply(this,arguments)},I=navigator.userAgent.match(/msie/i),B=null,s=G.createTouch!==v,t=function(a){return a&&a.hasOwnProperty&&a instanceof f},q=function(a){return a&&"string"===f.type(a)},E=function(a){return q(a)&&0<a.indexOf("%")},l=function(a,d){var e=parseInt(a,10)||0;d&&E(a)&&(e*=b.getViewport()[d]/100);return Math.ceil(e)},w=function(a,b){return l(a,b)+"px"};f.extend(b,{version:"2.1.5",defaults:{padding:15,margin:20,
642width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,pixelRatio:1,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!s,fitToView:!0,aspectRatio:!1,topRatio:0.5,leftRatio:0.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3E3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},
643keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+
644(I?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,
645openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,
vendor: 19,312 bytes, lines 646-683
646isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))return f.isArray(a)||(a=t(a)?f(a).get():[a]),f.each(a,function(e,c){var k={},g,h,j,m,l;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),t(c)?(k={href:c.data("fancybox-href")||c.attr("href"),title:c.data("fancybox-title")||c.attr("title"),isDom:!0,element:c},f.metadata&&f.extend(!0,k,
647c.metadata())):k=c);g=d.href||k.href||(q(c)?c:null);h=d.title!==v?d.title:k.title||"";m=(j=d.content||k.content)?"html":d.type||k.type;!m&&k.isDom&&(m=c.data("fancybox-type"),m||(m=(m=c.prop("class").match(/fancybox\.(\w+)/))?m[1]:null));q(g)&&(m||(b.isImage(g)?m="image":b.isSWF(g)?m="swf":"#"===g.charAt(0)?m="inline":q(c)&&(m="html",j=c)),"ajax"===m&&(l=g.split(/\s+/,2),g=l.shift(),l=l.shift()));j||("inline"===m?g?j=f(q(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):k.isDom&&(j=c):"html"===m?j=g:!m&&(!g&&
648k.isDom)&&(m="inline",j=c));f.extend(k,{href:g,type:m,content:j,title:h,selector:l});a[e]=k}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==v&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current||
649b._afterZoomOut(a))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(!b.isOpen||!0===a?(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut()):(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&&(b.player.timer=
650setTimeout(b.next,b.current.playSpeed))},c=function(){d();p.unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};if(!0===a||!b.player.isActive&&!1!==a){if(b.current&&(b.current.loop||b.current.index<b.group.length-1))b.player.isActive=!0,p.bind({"onCancel.player beforeClose.player":c,"onUpdate.player":e,"beforeLoad.player":d}),e(),b.trigger("onPlayStart")}else c()},next:function(a){var d=b.current;d&&(q(a)||(a=d.direction.next),b.jumpto(d.index+1,a,"next"))},prev:function(a){var d=b.current;
651d&&(q(a)||(a=d.direction.prev),b.jumpto(d.index-1,a,"prev"))},jumpto:function(a,d,e){var c=b.current;c&&(a=l(a),b.direction=d||c.direction[a>=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==v&&(b.cancel(),b._start(a)))},reposition:function(a,d){var e=b.current,c=e?e.wrap:null,k;c&&(k=b._getPosition(d),a&&"scroll"===a.type?(delete k.position,c.stop(!0,!0).animate(k,200)):(c.css(k),e.pos=f.extend({},e.dim,k)))},update:function(a){var d=
652a&&a.type,e=!d||"orientationchange"===d;e&&(clearTimeout(B),B=null);b.isOpen&&!B&&(B=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),B=null)},e&&!s?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,s&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"),b.trigger("onUpdate")),
653b.update())},hideLoading:function(){p.unbind(".loading");f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading();a=f('<div id="fancybox-loading"><div></div></div>').click(b.cancel).appendTo("body");p.bind("keydown.loading",function(a){if(27===(a.which||a.keyCode))a.preventDefault(),b.cancel()});b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:0.5*d.h+d.y,left:0.5*d.w+d.x}))},getViewport:function(){var a=b.current&&b.current.locked||!1,d={x:n.scrollLeft(),
654y:n.scrollTop()};a?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=s&&r.innerWidth?r.innerWidth:n.width(),d.h=s&&r.innerHeight?r.innerHeight:n.height());return d},unbindEvents:function(){b.wrap&&t(b.wrap)&&b.wrap.unbind(".fb");p.unbind(".fb");n.unbind(".fb")},bindEvents:function(){var a=b.current,d;a&&(n.bind("orientationchange.fb"+(s?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&p.bind("keydown.fb",function(e){var c=e.which||e.keyCode,k=e.target||e.srcElement;
655if(27===c&&b.coming)return!1;!e.ctrlKey&&(!e.altKey&&!e.shiftKey&&!e.metaKey&&(!k||!k.type&&!f(k).is("[contenteditable]")))&&f.each(d,function(d,k){if(1<a.group.length&&k[c]!==v)return b[d](k[c]),e.preventDefault(),!1;if(-1<f.inArray(c,k))return b[d](),e.preventDefault(),!1})}),f.fn.mousewheel&&a.mouseWheel&&b.wrap.bind("mousewheel.fb",function(d,c,k,g){for(var h=f(d.target||null),j=!1;h.length&&!j&&!h.is(".fancybox-skin")&&!h.is(".fancybox-wrap");)j=h[0]&&!(h[0].style.overflow&&"hidden"===h[0].style.overflow)&&
656(h[0].clientWidth&&h[0].scrollWidth>h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();if(0!==c&&!j&&1<b.group.length&&!a.canShrink){if(0<g||0<k)b.prev(0<g?"down":"left");else if(0>g||0>k)b.next(0>g?"up":"right");d.preventDefault()}}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1)));if(!1===e)return!1;c.helpers&&f.each(c.helpers,function(d,e){if(e&&b.helpers[d]&&f.isFunction(b.helpers[d][a]))b.helpers[d][a](f.extend(!0,
657{},b.helpers[d].defaults,e),c)});p.trigger(a)}},isImage:function(a){return q(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(a){return q(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var d={},e,c;a=l(a);e=b.group[a]||null;if(!e)return!1;d=f.extend(!0,{},b.opts,e);e=d.margin;c=d.padding;"number"===f.type(e)&&(d.margin=[e,e,e,e]);"number"===f.type(c)&&(d.padding=[c,c,c,c]);d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,
658mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});d.autoSize&&(d.autoWidth=d.autoHeight=!0);"auto"===d.width&&(d.autoWidth=!0);"auto"===d.height&&(d.autoHeight=!0);d.group=b.group;d.index=a;b.coming=d;if(!1===b.trigger("beforeLoad"))b.coming=null;else{c=d.type;e=d.href;if(!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive=!0;if("image"===c||"swf"===c)d.autoHeight=d.autoWidth=!1,d.scrolling="visible";"image"===c&&(d.aspectRatio=
659!0);"iframe"===c&&s&&(d.scrolling="scroll");d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(s?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body");f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,w(d.padding[a]))});b.trigger("onReady");if("inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href");
660"image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width=this.width/b.opts.pixelRatio;b.coming.height=this.height/b.opts.pixelRatio;b._afterLoad()};a.onerror=function(){this.onload=
661this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,d=f(a.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",s?"auto":a.iframe.scrolling).attr("src",a.href);
662f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1);s||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=d.appendTo(a.inner);a.iframe.preload||b._afterLoad()},_preloadImages:function(){var a=b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload,
663e-1):0,f,g;for(g=1;g<=c;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,d=b.current,e,c,k,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());b.unbindEvents();e=a.content;c=a.type;k=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin,
664outer:a.outer,inner:a.inner,current:a,previous:d});g=a.href;switch(c){case "inline":case "ajax":case "html":a.selector?e=f("<div>").html(e).find(a.selector):t(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('<div class="fancybox-placeholder"></div>').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",!1)}));break;case "image":e=a.tpl.image.replace("{href}",
665g);break;case "swf":e='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+g+'"></param>',h="",f.each(a.swf,function(a,b){e+='<param name="'+a+'" value="'+b+'"></param>';h+=" "+a+'="'+b+'"'}),e+='<embed src="'+g+'" type="application/x-shockwave-flash" width="100%" height="100%"'+h+"></embed></object>"}(!t(e)||!e.parent().is(a.inner))&&a.inner.append(e);b.trigger("beforeShow");a.inner.css("overflow","yes"===k?"scroll":
666"no"===k?"hidden":k);b._setDimension();b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(b.isOpened){if(d.prevMethod)b.transitions[d.prevMethod]()}else f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,k=b.skin,g=b.inner,h=b.current,c=h.width,j=h.height,m=h.minWidth,u=h.minHeight,n=h.maxWidth,p=h.maxHeight,s=h.scrolling,q=h.scrollOutside?
667h.scrollbarWidth:0,x=h.margin,y=l(x[1]+x[3]),r=l(x[0]+x[2]),v,z,t,C,A,F,B,D,H;e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp");x=l(k.outerWidth(!0)-k.width());v=l(k.outerHeight(!0)-k.height());z=y+x;t=r+v;C=E(c)?(a.w-z)*l(c)/100:c;A=E(j)?(a.h-t)*l(j)/100:j;if("iframe"===h.type){if(H=h.content,h.autoHeight&&1===H.data("ready"))try{H[0].contentWindow.document.location&&(g.width(C).height(9999),F=H.contents().find("body"),q&&F.css("overflow-x","hidden"),A=F.outerHeight(!0))}catch(G){}}else if(h.autoWidth||
668h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(C),h.autoHeight||g.height(A),h.autoWidth&&(C=g.width()),h.autoHeight&&(A=g.height()),g.removeClass("fancybox-tmp");c=l(C);j=l(A);D=C/A;m=l(E(m)?l(m,"w")-z:m);n=l(E(n)?l(n,"w")-z:n);u=l(E(u)?l(u,"h")-t:u);p=l(E(p)?l(p,"h")-t:p);F=n;B=p;h.fitToView&&(n=Math.min(a.w-z,n),p=Math.min(a.h-t,p));z=a.w-y;r=a.h-r;h.aspectRatio?(c>n&&(c=n,j=l(c/D)),j>p&&(j=p,c=l(j*D)),c<m&&(c=m,j=l(c/D)),j<u&&(j=u,c=l(j*D))):(c=Math.max(m,Math.min(c,n)),h.autoHeight&&
669"iframe"!==h.type&&(g.width(c),j=g.height()),j=Math.max(u,Math.min(j,p)));if(h.fitToView)if(g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height(),h.aspectRatio)for(;(a>z||y>r)&&(c>m&&j>u)&&!(19<d++);)j=Math.max(u,Math.min(p,j-10)),c=l(j*D),c<m&&(c=m,j=l(c/D)),c>n&&(c=n,j=l(c/D)),g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height();else c=Math.max(m,Math.min(c,c-(a-z))),j=Math.max(u,Math.min(j,j-(y-r)));q&&("auto"===s&&j<A&&c+x+q<z)&&(c+=q);g.width(c).height(j);e.width(c+x);a=e.width();
670y=e.height();e=(a>z||y>r)&&c>m&&j>u;c=h.aspectRatio?c<F&&j<B&&c<C&&j<A:(c<F||j<B)&&(c<C||j<A);f.extend(h,{dim:{width:w(a),height:w(y)},origWidth:C,origHeight:A,canShrink:e,canExpand:c,wPadding:x,hPadding:v,wrapSpace:y-k.outerHeight(!0),skinSpace:k.height()-j});!H&&(h.autoHeight&&j>u&&j<p&&!c)&&g.height("auto")},_getPosition:function(a){var d=b.current,e=b.getViewport(),c=d.margin,f=b.wrap.width()+c[1]+c[3],g=b.wrap.height()+c[0]+c[2],c={position:"absolute",top:c[0],left:c[3]};d.autoCenter&&d.fixed&&
671!a&&g<=e.h&&f<=e.w?c.position="fixed":d.locked||(c.top+=e.y,c.left+=e.x);c.top=w(Math.max(c.top,c.top+(e.h-g)*d.topRatio));c.left=w(Math.max(c.left,c.left+(e.w-f)*d.leftRatio));return c},_afterZoomIn:function(){var a=b.current;a&&(b.isOpen=b.isOpened=!0,b.wrap.css("overflow","visible").addClass("fancybox-opened"),b.update(),(a.closeClick||a.nextClick&&1<b.group.length)&&b.inner.css("cursor","pointer").bind("click.fb",function(d){!f(d.target).is("a")&&!f(d.target).parent().is("a")&&(d.preventDefault(),
672b[a.closeClick?"close":"next"]())}),a.closeBtn&&f(a.tpl.closeBtn).appendTo(b.skin).bind("click.fb",function(a){a.preventDefault();b.close()}),a.arrows&&1<b.group.length&&((a.loop||0<a.index)&&f(a.tpl.prev).appendTo(b.outer).bind("click.fb",b.prev),(a.loop||a.index<b.group.length-1)&&f(a.tpl.next).appendTo(b.outer).bind("click.fb",b.next)),b.trigger("afterShow"),!a.loop&&a.index===a.group.length-1?b.play(!1):b.opts.autoPlay&&!b.player.isActive&&(b.opts.autoPlay=!1,b.play()))},_afterZoomOut:function(a){a=
673a||b.current;f(".fancybox-wrap").trigger("onReset").remove();f.extend(b,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null});b.trigger("afterClose",a)}});b.transitions={getOrigPosition:function(){var a=b.current,d=a.element,e=a.orig,c={},f=50,g=50,h=a.hPadding,j=a.wPadding,m=b.getViewport();!e&&(a.isDom&&d.is(":visible"))&&(e=d.find("img:first"),e.length||(e=d));t(e)?(c=e.offset(),e.is("img")&&(f=e.outerWidth(),g=e.outerHeight())):
674(c.top=m.y+(m.h-g)*a.topRatio,c.left=m.x+(m.w-f)*a.leftRatio);if("fixed"===b.wrap.css("position")||a.locked)c.top-=m.y,c.left-=m.x;return c={top:w(c.top-h*a.topRatio),left:w(c.left-j*a.leftRatio),width:w(f+j),height:w(g+h)}},step:function(a,d){var e,c,f=d.prop;c=b.current;var g=c.wrapSpace,h=c.skinSpace;if("width"===f||"height"===f)e=d.end===d.start?1:(a-d.start)/(d.end-d.start),b.isClosing&&(e=1-e),c="width"===f?c.wPadding:c.hPadding,c=a-c,b.skin[f](l("width"===f?c:c-g*e)),b.inner[f](l("width"===
675f?c:c-g*e-h*e))},zoomIn:function(){var a=b.current,d=a.pos,e=a.openEffect,c="elastic"===e,k=f.extend({opacity:1},d);delete k.position;c?(d=this.getOrigPosition(),a.openOpacity&&(d.opacity=0.1)):"fade"===e&&(d.opacity=0.1);b.wrap.css(d).animate(k,{duration:"none"===e?0:a.openSpeed,easing:a.openEasing,step:c?this.step:null,complete:b._afterZoomIn})},zoomOut:function(){var a=b.current,d=a.closeEffect,e="elastic"===d,c={opacity:0.1};e&&(c=this.getOrigPosition(),a.closeOpacity&&(c.opacity=0.1));b.wrap.animate(c,
676{duration:"none"===d?0:a.closeSpeed,easing:a.closeEasing,step:e?this.step:null,complete:b._afterZoomOut})},changeIn:function(){var a=b.current,d=a.nextEffect,e=a.pos,c={opacity:1},f=b.direction,g;e.opacity=0.1;"elastic"===d&&(g="down"===f||"up"===f?"top":"left","down"===f||"right"===f?(e[g]=w(l(e[g])-200),c[g]="+=200px"):(e[g]=w(l(e[g])+200),c[g]="-=200px"));"none"===d?b._afterZoomIn():b.wrap.css(e).animate(c,{duration:a.nextSpeed,easing:a.nextEasing,complete:b._afterZoomIn})},changeOut:function(){var a=
677b.previous,d=a.prevEffect,e={opacity:0.1},c=b.direction;"elastic"===d&&(e["down"===c||"up"===c?"top":"left"]=("up"===c||"left"===c?"-":"+")+"=200px");a.wrap.animate(e,{duration:"none"===d?0:a.prevSpeed,easing:a.prevEasing,complete:function(){f(this).trigger("onReset").remove()}})}};b.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!s,fixed:!0},overlay:null,fixed:!1,el:f("html"),create:function(a){a=f.extend({},this.defaults,a);this.overlay&&this.close();this.overlay=
678f('<div class="fancybox-overlay"></div>').appendTo(b.coming?b.coming.parent:a.parent);this.fixed=!1;a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);this.fixed||(n.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.closeClick&&this.overlay.bind("click.overlay",function(a){if(f(a.target).hasClass("fancybox-overlay"))return b.isActive?
679b.close():d.close(),!1});this.overlay.css(a.css).show()},close:function(){var a,b;n.unbind("resize.overlay");this.el.hasClass("fancybox-lock")&&(f(".fancybox-margin").removeClass("fancybox-margin"),a=n.scrollTop(),b=n.scrollLeft(),this.el.removeClass("fancybox-lock"),n.scrollTop(a).scrollLeft(b));f(".fancybox-overlay").remove().hide();f.extend(this,{overlay:null,fixed:!1})},update:function(){var a="100%",b;this.overlay.width(a).height("100%");I?(b=Math.max(G.documentElement.offsetWidth,G.body.offsetWidth),
680p.width()>b&&(a=p.width())):p.width()>n.width()&&(a=p.width());this.overlay.width(a).height(p.height())},onReady:function(a,b){var e=this.overlay;f(".fancybox-overlay").stop(!0,!0);e||this.create(a);a.locked&&(this.fixed&&b.fixed)&&(e||(this.margin=p.height()>n.height()?f("html").css("margin-right").replace("px",""):!1),b.locked=this.overlay.append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){var e,c;b.locked&&(!1!==this.margin&&(f("*").filter(function(){return"fixed"===
681f(this).css("position")&&!f(this).hasClass("fancybox-overlay")&&!f(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin")),e=n.scrollTop(),c=n.scrollLeft(),this.el.addClass("fancybox-lock"),n.scrollTop(e).scrollLeft(c));this.open(a)},onUpdate:function(){this.fixed||this.update()},afterClose:function(a){this.overlay&&!b.coming&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}};b.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(a){var d=
682b.current,e=d.title,c=a.type;f.isFunction(e)&&(e=e.call(d.element,d));if(q(e)&&""!==f.trim(e)){d=f('<div class="fancybox-title fancybox-title-'+c+'-wrap">'+e+"</div>");switch(c){case "inside":c=b.skin;break;case "outside":c=b.wrap;break;case "over":c=b.inner;break;default:c=b.skin,d.appendTo("body"),I&&d.width(d.width()),d.wrapInner('<span class="child"></span>'),b.current.margin[2]+=Math.abs(l(d.css("margin-bottom")))}d["top"===a.position?"prependTo":"appendTo"](c)}}};f.fn.fancybox=function(a){var d,
683e=f(this),c=this.selector||"",k=function(g){var h=f(this).blur(),j=d,k,l;!g.ctrlKey&&(!g.altKey&&!g.shiftKey&&!g.metaKey)&&!h.is(".fancybox-wrap")&&(k=a.groupAttr||"data-fancybox-group",l=h.attr(k),l||(k="rel",l=h.get(0)[k]),l&&(""!==l&&"nofollow"!==l)&&(h=c.length?f(c):e,h=h.filter("["+k+'="'+l+'"]'),j=h.index(this)),a.index=j,!1!==b.o
683pen(h,a)&&g.preventDefault())};a=a||{};d=a.index||0;!c||!1===a.live?e.unbind("click.fb-start").bind("click.fb-start",k):p.undelegate(c,"click.fb-start").delegate(c+
684":not('.fancybox-item, .fancybox-nav')","click.fb-start",k);this.filter("[data-fancybox-start=1]").trigger("click");return this};p.ready(function(){var a,d;f.scrollbarWidth===v&&(f.scrollbarWidth=function(){var a=f('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),b=a.children(),b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});if(f.support.fixedPosition===v){a=f.support;d=f('<div style="position:fixed;top:20px;"></div>').appendTo("body");var e=20===
685d[0].offsetTop||15===d[0].offsetTop;d.remove();a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")});a=f(r).width();J.addClass("fancybox-lock-test");d=f(r).width();J.removeClass("fancybox-lock-test");f("<style type='text/css'>.fancybox-margin{margin-right:"+(d-a)+"px;}</style>").appendTo("head")})})(window,document,jQuery);/*!
686 * Media helper for fancyBox
687 * version: 1.0.6 (Fri, 14 Jun 2013)
688 * @requires fancyBox v2.0 or later
689 *
690 * Usage:
691 *     $(".fancybox").fancybox({
692 *         helpers : {
693 *             media: true
694 *         }
695 *     });
696 *
697 * Set custom URL parameters:
698 *     $(".fancybox").fancybox({
699 *         helpers : {
700 *             media: {
701 *                 youtube : {
702 *                     params : {
703 *                         autoplay : 0
704 *                     }
705 *                 }
706 *             }
707 *         }
708 *     });
709 *
710 * Or:
711 *     $(".fancybox").fancybox({,
712 *         helpers : {
713 *             media: true
714 *         },
715 *         youtube : {
716 *             autoplay: 0
717 *         }
718 *     });
719 *
720 *  Supports:
721 *
722 *      Youtube
723 *          http://www.youtube.com/watch?v=opj24KnzrWo
724 *          http://www.youtube.com/embed/opj24KnzrWo
725 *          http://youtu.be/opj24KnzrWo
726 *			http://www.youtube-nocookie.com/embed/opj24KnzrWo
727 *      Vimeo
728 *          http://vimeo.com/40648169
729 *          http://vimeo.com/channels/staffpicks/38843628
730 *          http://vimeo.com/groups/surrealism/videos/36516384
731 *          http://player.vimeo.com/video/45074303
732 *      Metacafe
733 *          http://www.metacafe.com/watch/7635964/dr_seuss_the_lorax_movie_trailer/
734 *          http://www.metacafe.com/watch/7635964/
735 *      Dailymotion
736 *          http://www.dailymotion.com/video/xoytqh_dr-seuss-the-lorax-premiere_people
737 *      Twitvid
738 *          http://twitvid.com/QY7MD
739 *      Twitpic
740 *          http://twitpic.com/7p93st
741 *      Instagram
742 *          http://instagr.am/p/IejkuUGxQn/
743 *          http://instagram.com/p/IejkuUGxQn/
744 *      Google maps
745 *          http://maps.google.com/maps?q=Eiffel+Tower,+Avenue+Gustave+Eiffel,+Paris,+France&t=h&z=17
746 *          http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16
747 *          http://maps.google.com/?ll=48.859463,2.292626&spn=0.000965,0.002642&t=m&z=19&layer=c&cbll=48.859524,2.292532&panoid=YJ0lq28OOy3VT2IqIuVY0g&cbp=12,151.58,,0,-15.56
748 */
749(function ($) {
750	"use strict";
751
752	//Shortcut for fancyBox object
753	var F = $.fancybox,
754		format = function( url, rez, params ) {
755			params = params || '';
756
757			if ( $.type( params ) === "object" ) {
758				params = $.param(params, true);
759			}
760
761			$.each(rez, function(key, value) {
762				url = url.replace( '$' + key, value || '' );
763			});
764
765			if (params.length) {
766				url += ( url.indexOf('?') > 0 ? '&' : '?' ) + params;
767			}
768
769			return url;
770		};
771
772	//Add helper object
773	F.helpers.media = {
774		defaults : {
775			youtube : {
776				matcher : /(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(watch\?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*)).*/i,
777				params  : {
778					autoplay    : 1,
779					autohide    : 1,
780					fs          : 1,
781					rel         : 0,
782					hd          : 1,
783					wmode       : 'opaque',
784					enablejsapi : 1
785				},
786				type : 'iframe',
787				url  : '//www.youtube.com/embed/$3'
788			},
789			vimeo : {
790				matcher : /(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/,
791				params  : {
792					autoplay      : 1,
793					hd            : 1,
794					show_title    : 1,
795					show_byline   : 1,
796					show_portrait : 0,
797					fullscreen    : 1
798				},
799				type : 'iframe',
800				url  : '//player.vimeo.com/video/$1'
801			},
802			metacafe : {
803				matcher : /metacafe.com\/(?:watch|fplayer)\/([\w\-]{1,10})/,
804				params  : {
805					autoPlay : 'yes'
806				},
807				type : 'swf',
808				url  : function( rez, params, obj ) {
809					obj.swf.flashVars = 'playerVars=' + $.param( params, true );
810
811					return '//www.metacafe.com/fplayer/' + rez[1] + '/.swf';
812				}
813			},
814			dailymotion : {
815				matcher : /dailymotion.com\/video\/(.*)\/?(.*)/,
816				params  : {
817					additionalInfos : 0,
818					autoStart : 1
819				},
820				type : 'swf',
821				url  : '//www.dailymotion.com/swf/video/$1'
822			},
823			twitvid : {
824				matcher : /twitvid\.com\/([a-zA-Z0-9_\-\?\=]+)/i,
825				params  : {
826					autoplay : 0
827				},
828				type : 'iframe',
829				url  : '//www.twitvid.com/embed.php?guid=$1'
830			},
831			twitpic : {
832				matcher : /twitpic\.com\/(?!(?:place|photos|events)\/)([a-zA-Z0-9\?\=\-]+)/i,
833				type : 'image',
834				url  : '//twitpic.com/show/full/$1/'
835			},
836			instagram : {
837				matcher : /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,
838				type : 'image',
839				url  : '//$1/p/$2/media/?size=l'
840			},
841			google_maps : {
842				matcher : /maps\.google\.([a-z]{2,3}(\.[a-z]{2})?)\/(\?ll=|maps\?)(.*)/i,
843				type : 'iframe',
844				url  : function( rez ) {
845					return '//maps.google.' + rez[1] + '/' + rez[3] + '' + rez[4] + '&output=' + (rez[4].indexOf('layer=c') > 0 ? 'svembed' : 'embed');
846				}
847			}
848		},
849
850		beforeLoad : function(opts, obj) {
851			var url   = obj.href || '',
852				type  = false,
853				what,
854				item,
855				rez,
856				params;
857
858			for (what in opts) {
859				if (opts.hasOwnProperty(what)) {
860					item = opts[ what ];
861					rez  = url.match( item.matcher );
862
863					if (rez) {
864						type   = item.type;
865						params = $.extend(true, {}, item.params, obj[ what ] || ($.isPlainObject(opts[ what ]) ? opts[ what ].params : null));
866
867						url = $.type( item.url ) === "function" ? item.url.call( this, rez, params, obj ) : format( item.url, rez, params );
868
869						break;
870					}
871				}
872			}
873
874			if (type) {
875				obj.href = url;
876				obj.type = type;
877
878				obj.autoHeight = false;
879			}
880		}
881	};
882
883}(jQuery));(function($) {
884    'use strict';
885
886    $.widget("ui.base", {
887
888        _init: function() {
889            this.init();
890        },
891
892        init: function() {
893            var me = this,
894                element = me.element;
895
896            //fancybox
897            $(".lightbox").fancybox({
898                'openEffect': "fade",
899                'autoSize': true,
900                'autoScale': true,
901                'margin': 50,
902                'autoCenter': true,
903                'autoResize': true,
904                'fitToView': true,
905                'tpl': {
906                        error    : '<p class="fancybox-error"></p>'
907                },
908                'helpers': {
909                    'overlay': {
910                        'css': {
911                            'background': 'rgba(246, 246, 246, 0.75)'
912                        },
913                        locked: false
914                    },
915                    media: {},
916                    'title': {
917                        type: 'inside'
918                    }
919                },
920                afterShow: function() {
921
922                    var el = $(this.element),
923                        fbInner = $(".fancybox-inner");
924
925                    if (el.hasClass('default-video-player')) {
926                        var url = el.data('video-url'),
927                            height = el.data('video-height'),
928                            width = el.data('video-width'),
929                            videoHTML = '<video width="' + width +'" height="' + height + '" controls>' +
930                              '<source src="' + url + '">' +
931                              '</video>';
932
933                        $('.fancybox-inner').hide();
934                        $(".fancybox-inner").html(videoHTML);
935                        $('.fancybox-inner').show();
936                        $.fancybox.update();
937                    }
938                }
939            });
940
941            $(document).on('click', $.proxy(me._documentClick, me));
942            $(document).on('touchend', $.proxy(me._documentClick, me));
943            $(document).on('keyup', $.proxy(me._documentKeyUp, me));
944
945            // Dirty hack to fix input highlight on ios safari, please remove when ios 11.3 is in use
946
947
948            // Detect ios 11_x_x affected
949            // NEED TO BE UPDATED if new versions are affected
950            (function iOS_CaretBug() {
951
952                var ua = navigator.userAgent,
953                scrollTopPosition,
954                iOS = /iPad|iPhone|iPod/.test(ua),
955                iOS11 = /OS 11_0_1|OS 11_0_2|OS 11_0_3|OS 11_1|OS 11_1_1|OS 11_1_2|OS 11_2|OS 11_2_1/.test(ua);
956
957                // ios 11 bug caret position
958                if ( iOS && iOS11 ) {
959
960                    $("#zmodal").live('show.bs.modal', function(e) {
961                        // Get scroll position before moving top
962                        scrollTopPosition = $(document).scrollTop();
963
964                        // Add CSS to body "position: fixed"
965                        $("body").css("position", "fixed");
966                        $("body").css("width", "100%");
967                    });
968
969                    $("zmodal").live('hide.bs.modal', function(e) {
970
971                        $("body").css("position", "static");
972
973                        //Go back to initial position in document
974                        $(document).scrollTop(scrollTopPosition);
975
976                    });
977
978                }
979            })();
980        },
981
982        _documentClick: function(event) {
983
984            var me = this;
985
986            if (!$(event.target).closest('form[role="search"]').length) {
987
988                var searchWidgets = $(':ui-search_suggestions'),
989                    isOpen = false;
990
991                $.each(searchWidgets, function(i, widget) {
992
993                    var inst = $(widget).data('ui-search_suggestions');
994                    if (inst && inst.isVisible()) {
995                        isOpen = true;
996                    }
997                });
998
999                if (isOpen) {
1000                    $(document).trigger('search:close');
1001                }
1002            }
1003
1004        },
1005
1006        _documentKeyUp: function(event) {
1007
1008            if (event.keyCode == 27) {
1009                $(document).trigger('search:close');
1010                $(document).trigger('menu:close');
1011            }
1012        }
1013
1014
1015    });
1016})(jQuery);
1017(function ($) {
1018   'use strict';
1019
1020    $.widget( "ui.global_nav", {
1021        _init: function() {
1022            this.init();
1023        },
1024
1025        init: function() {
1026            var me = this;
1027
1028            me.document            = $(document),
1029            me.body                = $('body:eq(0)'),
1030            me.menuButton          = $(me.element.find('#toggle-menu')[0]);
1031
1032            me.document.on('click', me._handleDocumentClick.bind(me));
1033            me.document.on('menu:close', me._closeMenu.bind(me));
1034
1035            if ('ontouchstart' in document.documentElement) {
1036                if ($('.global-nav__menu__dropdown').length > 0) {
1037                    var openLink = false;
1038                    $('body').prepend('<div class="global-nav__menu__dropdown_close"> </div>');
1039                    $('.global-nav__menu__dropdown_close').on('touchstart', function(e) {
1040                        $('.global-nav__menu__dropdown').removeClass('touch-open');
1041                        $(this).hide();
1042                        openLink = false;
1043                    });
1044                    $('.global-nav__menu__dropdown').each(function(i) {
1045                        $(this).find('a:first').on('touchstart', function(e) {
1046                            if (openLink == false) {
1047                                e.preventDefault();
1048                                $(this).parent().addClass('touch-open');
1049                                $('.global-nav__menu__dropdown_close').show();
1050                                openLink = true;
1051                            } else {
1052                                if ($(this).parent().hasClass('touch-open') == false) {
1053                                    $('.global-nav__menu__dropdown').removeClass('touch-open');
1054                                    e.preventDefault();
1055                                    $(this).parent().addClass('touch-open');
1056                                }
1057                            }
1058                        });
1059                    });
1060                }
1061            }
1062        },
1063
1064        _handleDocumentClick: function(event) {
1065            event.stopPropagation();
1066
1067            var the_event = event.originalEvent || event,
1068                $target = $(the_event.target),
1069                isOpen = $('.global-nav:eq(0)').hasClass('is-open'),
1070                me = this;
1071
1072            // Clicked on/in toggle menu button
1073            if ($target.closest('[class*="toggle-menu"]').length > 0) {
1074                me._toggleMenu(event);
1075                event.preventDefault();
1076                return;
1077            }
1078
1079            // Clicked on/in menu close button
1080            if ($target.closest('[class*="nav__close"]').length > 0) {
1081                me._closeMenu(event);
1082                event.preventDefault();
1083                return;
1084            }
1085
1086            //Clicked outside of menu
1087            if ($target.closest('[class*="global-nav"]').length == 0) {
1088                if (isOpen) {
1089                    me._closeMenu(event);
1090                    event.preventDefault();
1091                    return;
1092                }
1093            }
1094        },
1095
1096        _closeMenu: function(event) {
1097            var me = this;
1098            me._toggleMenu(event, true);
1099        },
1100
1101        _toggleMenu: function(event, close) {
1102
1103            var me = this;
1104
1105            me.menuButton.toggleClass('is-active');
1106
1107            if (close) {
1108                me.body.removeClass('is-menu-visible');
1109                me.element.removeClass('is-open');
1110                me.menuButton.removeClass('is-active');
1111            } else {
1112                if(me.menuButton.hasClass('is-active')) {
1113                    me.element.addClass('is-open');
1114                    me.body.addClass('is-menu-visible');
1115                } else {
1116                    me.element.removeClass('is-open');
1117                    me.body.removeClass('is-menu-visible');
1118                }
1119            }
1120
1121            event.preventDefault();
1122
1123        }
1124    });
1125
1126})(jQuery);
1127(function ($) {
1128   'use strict';
1129
1130    $.widget("ui.search_suggestions", {
1131
1132        model: {
1133            index: -1,
1134            suggestions: [],
1135            input: ''
1136        },
1137
1138         update: function(type, value) {
1139            switch (type) {
1140                case 'SetSuggestions': {
1141                    this.model.index = -1;
1142                    this.model.suggestions = Array.prototype.slice.call(value);
1143                    this.render();
1144                }
1145                break;
1146
1147                case 'MoveDown': {
1148                    if (this.model.index === this.model.suggestions.length - 1) {
1149                        this.model.index = 0;
1150                    } else {
1151                        this.model.index = this.model.index + 1;
1152                        this.model.value = value;
1153                    }
1154                    this.render();
1155                }
1156                break;
1157
1158                case 'MoveUp': {
1159                    if (this.model.index === -1) {
1160                         this.model.index = this.model.suggestions.length - 1;
1161                    } else {
1162                        this.model.index = this.model.index - 1;
1163                        this.model.value = value;
1164                    }
1165                    this.render();
1166                }
1167                break;
1168
1169                case 'SetInput': {
1170                    this.model.input = value;
1171                }
1172                break;
1173
1174                case 'OnReturnPressed': {
1175                    this._closeSearch();
1176                }
1177                break;
1178
1179                /*
1180                 * Tab should always move focus out of the search form.
1181                 * If there are no search suggestions, only blur will be triggered (no keyup for tab)
1182                 * If there are search suggestions, OnBlur will not move focus because the focus moved inside of the search form, so we move it after `_closeSearch`
1183                 * If the user navigates to a search suggestion with the arrow keys, only blur will be triggered and we should not do anything
1184                 */
1185                case 'OnBlur': {
1186                    const event = value;
1187
1188                    // Check that the new focus is outside of the search form
1189                    if(event.relatedTarget && $(event.relatedTarget).parents('.search-suggestions__searchform').length === 0){
1190                        this._closeSearch();
1191
1192                        const relativePosition = event.target.compareDocumentPosition(event.relatedTarget)
1193                        if (relativePosition & Node.DOCUMENT_POSITION_FOLLOWING){
1194                            $('#toggle-search').next().focus();
1195                        } else if (relativePosition & Node.DOCUMENT_POSITION_PRECEDING) {
1196                            $('#toggle-search').prev().focus();
1197                        }
1198                    }
1199                }
1200                break;
1201
1202                case 'OnTab': {
1203                    const event = value;
1204
1205                    this._closeSearch();
1206
1207                    if (event.shiftkey){
1208                        $('#toggle-search').prev().focus();
1209                    } else {
1210                        $('#toggle-search').next().focus();
1211                    }
1212                }
1213                break;
1214            }
1215        },
1216
1217        render: function() {
1218            this._removeHighlight();
1219
1220            if (this.model.index === -1 || this.model.suggestions.length === 0) {
1221                return;
1222            }
1223
1224            this.model.suggestions[this.model.index].style.textDecoration = 'underline';
1225            this.model.suggestions[this.model.index].style.fontWeight = '800';
1226
1227            this.element[0].value = this.model.suggestions[this.model.index].textContent.trim();
1228        },
1229
1230        _init: function() {
1231            this.init();
1232        },
1233
1234        init: function() {
1235
1236            var me = this,
1237                element = me.element,
1238                timer = null,
1239                prevVal = null,
1240                paramResults = element.data('param-results'),
1241                paramWire = element.data('param-wire'),
1242                paramToggleButton = '#' + element.data('param-togglebutton'),
1243                windowHeight = $(window).height();
1244
1245                me.toggleButton         = $(paramToggleButton),
1246                me.searchForm           = $(element.closest('form')),
1247                me.searchInput          = element,
1248                me.suggestions          = $('#' + paramResults);
1249
1250            me.suggestions.removeClass('is-scrolable');
1251            me.suggestions.hide();
1252
1253            if (element.data("param-auto-disable") === true){
1254                me.searchInput.prop('disabled', true);
1255            }
1256
1257            var observer = new MutationObserver(function(mutations) {
1258                mutations.forEach(function(mutation) {
1259                    me.update('SetSuggestions', mutation.target.querySelectorAll('a'));
1260                });
1261            });
1262
1263            // configuration of the observer:
1264            var config = { attributes: true, childList: true, characterData: true };
1265
1266            // pass in the target node, as well as the observer options
1267            observer.observe(me.suggestions[0], config);
1268
1269
1270            function doSearch() {
1271
1272                var val = me.element.val();
1273
1274                if (val.length == 0) {
1275                    me.suggestions.hide();
1276                    return;
1277                }
1278
1279                z_event(paramWire, {value: val});
1280
1281                setTimeout(function(){
1282                    me.suggestions.show(0, function() {
1283                        if (me.suggestions.outerHeight() > windowHeight) {
1284                            me.suggestions.addClass('is-scrollable');
1285                        }
1286                    });
1287                }, 500);
1288
1289            }
1290
1291            me.element.on('blur', function(e) {
1292                me.update('OnBlur', e);
1293            })
1294
1295            me.element.on('keyup', function(e) {
1296                var key = e.keyCode;
1297                var inputValue = e.currentTarget.value;
1298
1299                if (key === 38) {
1300                    me.update('MoveUp', inputValue);
1301                } else if (key === 40) {
1302                    me.update('MoveDown', inputValue);
1303                } else if (key === 13) {
1304                    me.update('OnReturnPressed');
1305                } else if (key === 9) {
1306                    me.update('OnTab', e);
1307                } else {
1308                    me.update('SetInput', inputValue);
1309                    doSearch();
1310                }
1311            });
1312
1313            $(document).on('search:close', $.proxy(me._closeSearch, me));
1314            $(document).on('search:toggle', $.proxy(me._toggleSearch, me));
1315
1316            if (me.toggleButton != undefined) me.toggleButton.on('click', $.proxy(me._toggleSearch, me));
1317
1318        },
1319
1320        _removeHighlight: function() {
1321            this.model.suggestions.forEach(function(x) {
1322                x.style.textDecoration = 'none';
1323                x.style.fontWeight = '400';
1324            });
1325        },
1326
1327        _closeSearch: function(event) {
1328            var me = this;
1329            me._toggleSearch(event, true);
1330        },
1331
1332        _toggleSearch: function(event, close) {
1333            var me = this;
1334
1335            if (me.toggleButton) me.toggleButton.toggleClass('is-active');
1336
1337            if(close) {
1338                me.suggestions.hide();
1339                me.searchForm.removeClass('is-visible');
1340                if (me.toggleButton) me.toggleButton.removeClass('is-active');
1341
1342                if (me.element.data("param-auto-disable") === true){
1343                    me.searchInput.prop('disabled', true);
1344                }
1345            } else {
1346                me.searchForm.toggleClass('is-visible');
1347
1348                if (me.element.data("param-auto-disable") === true){
1349                    me.searchInput.prop('disabled', false);
1350                }
1351            }
1352
1353            me.searchInput.val('');
1354            me.suggestions.hide();
1355
1356            if (me.isVisible()) {
1357                me.searchForm.on('transitionend', function () {
1358                    me.searchInput.focus();
1359                });
1360            }
1361
1362            $(document).trigger('search:toggled');
1363
1364            return false;
1365        },
1366
1367        isVisible: function() {
1368
1369            var me = this;
1370
1371            if (me.suggestions.css('display') == 'block' || me.searchForm.hasClass('is-visible')) {
1372                return true;
1373            } else {
1374                return false;
1375            }
1376        }
1377    });
1378})(jQuery);
1379
1380$.widget( "ui.content_group_nav", {
1381
1382    options: {
1383    },
1384
1385    _create: function() {
1386
1387        var me = this,
1388            widgetElement = $(me.element);
1389
1390        me.body = $('body:eq(0)');
1391        me.banner = $(widgetElement.find('.content-group-nav__banner')[0]);
1392        me.subnav = $(widgetElement.find('.content-group-nav__menu')[0]);
1393
1394        me.banner.on('click', $.proxy(me._scrollToTop, me));
1395
1396        $(window).scroll($.proxy(me._scrolled, me));
1397
1398        if(me.banner.length > 0) {
1399            me.body.addClass('has-content-group');
1400        }
1401
1402    },
1403
1404    _scrollToTop: function() {
1405        $("html, body").animate({ scrollTop: 0 }, "slow");
1406        return false;
1407    },
1408
1409    _scrolled: function(event) {
1410
1411        var me = this,
1412            scrollTop = $(window).scrollTop(),
1413            minPoint = me.subnav.outerHeight() + 20,
1414            isMinified = $(this.banner).hasClass('is-minified');
1415
1416        if (scrollTop > minPoint) {
1417            if(!isMinified) me.banner.addClass('is-minified');
1418        } else {
1419            me.banner.removeClass('is-minified');
1420        }
1421    }
1422
1423});
1424
1425(function($) {
1426    'use strict';
1427
1428    $.widget('ui.foldout', {
1429        options: {
1430            collapsedClass: 'is-collapsed',
1431            expandedClass: 'is-expanded',
1432            cutoff: 700
1433        },
1434
1435        _create: function() {
1436
1437            var me = this,
1438                element = $(me.element),
1439                button = element.find('.foldout__button'),
1440                elementHeight = element.height(),
1441                commentsHeight = element.find('.comments').height();
1442
1443            if (element.data('height')) {
1444                me.options.cutoff = element.data('height');
1445            }
1446
1447            button.on('click', function (evt) {
1448                me.toggle();
1449                evt.preventDefault();
1450            });
1451
1452            $('#comments-button').on('click', function () {
1453                me.expand();
1454            });
1455
1456            var contentHeight = elementHeight - commentsHeight;
1457            var heightDiff = contentHeight - me.options.cutoff;
1458            if (contentHeight > me.options.cutoff && heightDiff > 100) {
1459                me.collapse();
1460            }
1461
1462            $(document).on('foldout:expand', $.proxy(me.expand, me));
1463            $(document).on('foldout:collapse', $.proxy(me.collapse, me));
1464        },
1465
1466        toggle: function () {
1467
1468            var me = this,
1469                element = me.element,
1470                collapsedClass = me.options.collapsedClass;
1471
1472            if (element.hasClass(collapsedClass)) {
1473                me.expand();
1474            } else {
1475                me.collapse();
1476                $('html,body').animate({scrollTop:0}, 800);
1477            }
1478        },
1479
1480        collapse: function () {
1481            this.element.removeClass(this.options.expandedClass);
1482            this.element.addClass(this.options.collapsedClass);
1483        },
1484
1485        expand: function () {
1486            this.element.addClass(this.options.expandedClass);
1487            this.element.removeClass(this.options.collapsedClass);
1488        }
1489    });
1490})(jQuery);
1491
1492(function ($) {
1493   'use strict';
1494
1495    $.widget("ui.foundation", {
1496
1497        _init: function() {
1498            this.init();
1499        },
1500
1501        init: function() {
1502            var me = this,
1503                element = me.element;
1504        }
1505
1506    });
1507})(jQuery);
1508$.widget("ui.carousel", {
1509
1510    _create: function () {
1511        function MergeRecursive(defaultSettings, currentSettings) {
1512            for (var p in currentSettings) {
1513                try {
1514                    // Property in destination object set; update its value.
1515                    if ( currentSettings[p].constructor==Object ) {
1516                        defaultSettings[p] = MergeRecursive(defaultSettings[p], currentSettings[p]);
1517                    } else {
1518                        defaultSettings[p] = currentSettings[p];
1519                    }
1520                } catch(e) {
1521                    // Property in destination object not set; create it and set its value.
1522                    defaultSettings[p] = currentSettings[p];
1523                }
1524            }
1525            return defaultSettings;
1526        }
1527
1528        var me = this,
1529            widgetElement = $(me.element),
1530            id = widgetElement.attr('id'),
1531            settings = this.options;  // Is this used?
1532
1533        settings = MergeRecursive({dots: true, autoplay: true}, settings); // this would be default behavior
1534
1535        if (widgetElement.data('carousel-options')) {
1536            var options =  widgetElement.data('carousel-options');
1537            settings = MergeRecursive(settings, options);
1538        }
1539
1540        if (settings) {
1541            $(widgetElement).slick(settings);
1542        } else {
1543            $(widgetElement).slick();
1544        }
1545    }
1546});
1547(function ($) {
1548    'use strict';
1549
1550    $.widget('ui.map_location', {
1551        _create: function () {
1552
1553        var element = $(this.element),
1554                me = this,
1555                options = jQuery.parseJSON(element.data('options')),
1556                map,
1557                panorama;
1558
1559            me.options = options;
1560            me.element = element;
1561
1562            me.panorama = panorama;
1563            me.map = map;
1564
1565            me.checkGoogleVar();
1566        },
1567
1568        checkGoogleVar: function() {
1569
1570            var me = this;
1571
1572            window.setTimeout(function () {
1573
1574                if (window.google) {
1575
1576                    var lat = me.element.data('lat'),
1577                        lng = me.element.data('lng'),
1578                        street = me.element.data('street').trim();
1579
1580                    //if only the lat/lng values are known and no address is known, start the map with the given coordinates
1581                    //otherwise, look up the coordinates first
1582
1583                    if (lat && lat != '' && lng && lng != '' && (!street || street=='') ) {
1584
1585                        var latLng = new google.maps.LatLng(lat,lng);
1586                        me.initView(latLng);
1587                    } else {
1588                        me.geocodeAddress();
1589                    }
1590
1591                } else {
1592                    me.checkGoogleVar();
1593                }
1594            }, 100);
1595
1596        },
1597
1598        geocodeAddress: function () {
1599            var me = this,
1600                geocoder = new google.maps.Geocoder(),
1601                address,
1602                street = me.element.attr('data-street').trim();
1603
1604            if (!street || street == '') {
1605                address = [
1606                    me.element.attr('data-postcode'),
1607                    me.element.attr('data-city'),
1608                    me.element.attr('data-country')
1609                ];
1610            } else {
1611                address = [
1612                    /\s*[^0-9]+\d*/.exec(street)[0],
1613                    me.element.attr('data-postcode'),
1614                    me.element.attr('data-city'),
1615                    me.element.attr('data-country')
1616                ];
1617            }
1618
1619            geocoder.geocode({
1620                address: address.join(', ')
1621            }, function(results, status) {
1622                if (status === google.maps.GeocoderStatus.OK && results.length > 0) {
1623                    me.initView(results[0].geometry.location);
1624                }
1625            });
1626
1627        },
1628
1629        initView: function(latLng) {
1630            var me = this,
1631                marker;
1632
1633            if (me.options.type.toLowerCase() == "streetview") {
1634                me.buildStreetView(latLng);
1635            } else if (me.options.type.toLowerCase() == "map") {
1636                me.buildMap(latLng);
1637            }
1638
1639        },
1640
1641        buildMap: function(latLng) {
1642
1643            var me = this,
1644                marker,
1645                options = {
1646                    zoom: 14,
1647                    center: latLng,
1648                    disableDoubleClickZoom: true,
1649                    disableDefaultUI: true,
1650                    keyboardShortcuts: false,
1651                    draggable: false,
1652                    scrollwheel: false,
1653                    panControl: false,
1654                    rotateControl: false,
1655                    scaleControl: false,
1656                    componentRestrictions: {}
1657                };
1658
1659            if (me.options.blackwhite == true) {
1660                options.styles = [{
1661                   "stylers": [
1662                         { "saturation": -100 },
1663                         { "lightness": -8 },
1664                         { "gamma": 1.18 }
1665                     ]
1666                  }
1667                ];
1668            }
1669
1670            options.draggable = false;
1671
1672            me.map = new google.maps.Map(me.element[0], options);
1673
1674            marker = new google.maps.Marker({
1675                map: me.map,
1676                draggable: false,
1677                position: latLng,
1678                icon: '/lib/images/marker-default.png'
1679            });
1680
1681            if (me.options.recenter == true) {
1682                google.maps.event.addListenerOnce(me.map, "projection_changed", function() {
1683                    me.recenterMap(me.map);
1684                });
1685            }
1686
1687        },
1688
1689
1690        buildStreetView: function(latLng) {
1691
1692            var me = this,
1693                streetViewService = new google.maps.StreetViewService(),
1694                STREETVIEW_MAX_DISTANCE = 100;
1695
1696                streetViewService.getPanoramaByLocation(latLng, STREETVIEW_MAX_DISTANCE, function (streetViewPanoramaData, status) {
1697
1698                var panoramaLatLng = streetViewPanoramaData.location.latLng,
1699                    heading = google.maps.geometry.spherical.computeHeading(panoramaLatLng, latLng);
1700
1701                if (status === google.maps.StreetViewStatus.OK) {
1702
1703                      me.panorama = new google.maps.StreetViewPanorama(
1704                      me.element[0], {
1705                        position: latLng,
1706                        pov: {
1707                            heading: heading,
1708                            pitch: 0
1709                        },
1710                        zoom: 1,
1711                        disableDefaultUI: true,
1712                        panControl: false,
1713                        addressControl: false,
1714                        linksControl: false,
1715                        zoomControlOptions: false
1716                      });
1717                } else {
1718                    if (me.options.fallback == true) {
1719                        me.buildMap(latLng);
1720                    }
1721                }
1722            });
1723
1724        },
1725
1726
1727        recenterMap: function(map) {
1728
1729            var me = this,
1730                mainContentEl = $('.' + me.element.data('main-content-class'));
1731
1732                if (mainContentEl.length == 0) return false;
1733
1734                var masthead = $(me.element),
1735                mastheadHeight = masthead[0].clientHeight,
1736                mastheadOffsetTop = masthead[0].offsetTop,
1737                mainContentOffsetTop = mainContentEl[0].offsetTop,
1738                offsetY = (mastheadHeight / 2) - ((mainContentOffsetTop - mastheadOffsetTop) / 2),
1739                centerPoint = map.getProjection().fromLatLngToPoint(map.getCenter()),
1740                offsetPoint = new google.maps.Point(0, offsetY / Math.pow(2, map.getZoom())),
1741                newCenterPoint = new google.maps.Point(centerPoint.x, centerPoint.y + offsetPoint.y);
1742
1743                map.setCenter(map.getProjection().fromPointToLatLng(newCenterPoint));
1744        }
1745
1746    });
1747})(jQuery);
1748(function ($) {
1749    'use strict';
1750
1751    var normalizedRequestAnimationFrame,
1752        normalizedCancelAnimationFrame;
1753
1754    (function () {
1755        var requestPrefixes = ['webkitR', 'mozR', 'msR', 'oR', 'r'],
1756            cancelPrefixes = ['webkitC', 'mozC', 'msC', 'oC', 'c'],
1757            functionName,
1758            i;
1759
1760        for (i=0; i<requestPrefixes.length; i++) {
1761            functionName = requestPrefixes[i] + 'equestAnimationFrame';
1762
1763            if (functionName in window) {
1764                normalizedRequestAnimationFrame = window[functionName];
1765                normalizedCancelAnimationFrame = window[cancelPrefixes[i] + 'ancelAnimationFrame'];
1766            }
1767        }
1768
1769        if (!normalizedRequestAnimationFrame) {
1770            normalizedRequestAnimationFrame = function (callback) {
1771                return window.setTimeout(callback, 1000/60);
1772            };
1773
1774            normalizedCancelAnimationFrame = function (timeoutId) {
1775                window.clearTimeout(timeoutId);
1776            };
1777        }
1778    })();
1779
1780    $.widget('ui.parallax', {
1781        _create: function () {
1782            var me               = this,
1783                element          = me.element,
1784                id,
1785                timeoutId;
1786
1787            jQuery(window).on('scroll', function () {
1788                setAnim();
1789
1790                window.clearTimeout(timeoutId);
1791
1792                timeoutId = window.setTimeout(function () {
1793                    normalizedCancelAnimationFrame(id);
1794                });
1795            });
1796
1797            function setAnim () {
1798                id = normalizedRequestAnimationFrame(function () {
1799                    element.css({
1800                        'background-position': 'center ' + ( (jQuery(window).scrollTop() / 2)) + 'px'
1801                    });
1802
1803                    setAnim();
1804                });
1805            }
1806        }
1807    });
1808})(jQuery);
1809(function($) {
1810    'use strict';
1811
1812    $.widget('ui.anchor', {
1813        _create: function() {
1814            var me = this,
1815                element = $(me.element),
1816                anchor = element.attr('href'),
1817                offset = 0;
1818
1819            if (element.data('offset')) {
1820                offset = element.data('offset');
1821            }
1822
1823            element.on('click', function (evt) {
1824                evt.preventDefault();
1825
1826                $('html, body').animate({
1827                    scrollTop: ($(anchor).offset().top - offset)
1828                }, 1000);
1829            });
1830        }
1831    });
1832})(jQuery);
1833(function($) {
1834    'use strict';
1835
1836    $.widget('ui.expand', {
1837        _create: function() {
1838            var me = this,
1839                element = $(me.element),
1840                type = element.data('type'),
1841                parentAll = '.' + element.data('parent'),
1842                parent = '#' + element.data('parent'),
1843                contentAll = '.' + element.data('content'),
1844                contentId = '#' + element.data('content');
1845
1846            if (type == 'all') {
1847                element.on('click', function (evt) {
1848                    evt.preventDefault();
1849
1850                    if (element.hasClass('is-open')) {
1851                        element.removeClass('is-open');
1852                        $(parentAll).removeClass('is-open');
1853                        $(contentAll).slideUp();
1854
1855                        $(document).trigger('foldout:collapse');
1856                    } else {
1857                        element.addClass('is-open');
1858                        $(parentAll).addClass('is-open');
1859                        $(contentAll).slideDown();
1860
1861                        $(document).trigger('foldout:expand');
1862                    }
1863                });
1864
1865            } else {
1866                element.on('click', function (evt) {
1867                    evt.preventDefault();
1868
1869                    $(parent).toggleClass('is-open');
1870                    $(element).toggleClass('is-open');
1871                    $(contentId).slideToggle();
1872                });
1873            }
1874        }
1875    });
1876})(jQuery);
1877/*
1878 * flowplayer.js 3.2.12. The Flowplayer API
1879 *
1880 * Copyright 2009-2011 Flowplayer Oy
1881 *
1882 * This file is part of Flowplayer.
1883 *
1884 * Flowplayer is free software: you can redistribute it and/or modify
1885 * it under the terms of the GNU General Public License as published by
1886 * the Free Software Foundation, either version 3 of the License, or
1887 * (at your option) any later version.
1888 *
1889 * Flowplayer is distributed in the hope that it will be useful,
1890 * but WITHOUT ANY WARRANTY; without even the implied warranty of
1891 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1892 * GNU General Public License for more details.
1893 *
1894 * You should have received a copy of the GNU General Public License
1895 * along with Flowplayer.  If not, see <http://www.gnu.org/licenses/>.
1896 *
1897 * Date: ${date}
1898 * Revision: ${revision}
1899 */
1900!function(){function h(p){console.log("$f.fireEvent",[].slice.call(p))}function l(r){if(!r||typeof r!="object"){return r}var p=new r.constructor();for(var q in r){if(r.hasOwnProperty(q)){p[q]=l(r[q])}}return p}function n(u,r){if(!u){return}var p,q=0,s=u.length;if(s===undefined){for(p in u){if(r.call(u[p],p,u[p])===false){break}}}else{for(var t=u[0];q<s&&r.call(t,q,t)!==false;t=u[++q]){}}return u}function c(p){return document.getElementById(p)}function j(r,q,p){if(typeof q!="object"){return r}if(r&&q){n(q,function(s,t){if(!p||typeof t!="function"){r[s]=t}})}return r}function o(t){var r=t.indexOf(".");if(r!=-1){var q=t.slice(0,r)||"*";var p=t.slice(r+1,t.length);var s=[];n(document.getElementsByTagName(q),function(){if(this.className&&this.className.indexOf(p)!=-1){s.push(this)}});return s}}function g(p){p=p||window.event;if(p.preventDefault){p.stopPropagation();p.preventDefault()}else{p.returnValue=false;p.cancelBubble=true}return false}function k(r,p,q){r[p]=r[p]||[];r[p].push(q)}function e(p){return p.replace(/&amp;/g,"%26").replace(/&/g,"%26").replace(/=/g,"%3D")}function f(){return"_"+(""+Math.random()).slice(2,10)}var i=function(u,s,t){var r=this,q={},v={};r.index=s;if(typeof u=="string"){u={url:u}}j(this,u,true);n(("Begin*,Start,Pause*,Resume*,Seek*,Stop*,Finish*,LastSecond,Update,BufferFull,BufferEmpty,BufferStop").split(","),function(){var w="on"+this;if(w.indexOf("*")!=-1){w=w.slice(0,w.length-1);var x="onBefore"+w.slice(2);r[x]=function(y){k(v,x,y);return r}}r[w]=function(y){k(v,w,y);return r};if(s==-1){if(r[x]){t[x]=r[x]}if(r[w]){t[w]=r[w]}}});j(this,{onCuepoint:function(y,x){if(arguments.length==1){q.embedded=[null,y];return r}if(typeof y=="number"){y=[y]}var w=f();q[w]=[y,x];if(t.isLoaded()){t._api().fp_addCuepoints(y,s,w)}return r},update:function(x){j(r,x);if(t.isLoaded()){t._api().fp_updateClip(x,s)}var w=t.getConfig();var y=(s==-1)?w.clip:w.playlist[s];j(y,x,true)},_fireEvent:function(w,z,x,B){if(w=="onLoad"){n(q,function(C,D){if(D[0]){t._api().fp_addCuepoints(D[0],s,C)}});return false}B=B||r;if(w=="onCuepoint"){var A=q[z];if(A){return A[1].call(t,B,x)}}if(z&&"onBeforeBegin,onMetaData,onStart,onUpdate,onResume".indexOf(w)!=-1){j(B,z);if(z.metaData){if(!B.duration){B.duration=z.metaData.duration}else{B.fullDuration=z.metaData.duration}}}var y=true;n(v[w],function(){y=this.call(t,B,z,x)});return y}});if(u.onCuepoint){var p=u.onCuepoint;r.onCuepoint.apply(r,typeof p=="function"?[p]:p);delete u.onCuepoint}n(u,function(w,x){if(typeof x=="function"){k(v,w,x);delete u[w]}});if(s==-1){t.onCuepoint=this.onCuepoint}};var m=function(q,s,r,u){var p=this,t={},v=false;if(u){j(t,u)}n(s,function(w,x){if(typeof x=="function"){t[w]=x;delete s[w]}});j(this,{animate:function(z,A,y){if(!z){return p}if(typeof A=="function"){y=A;A=500}if(typeof z=="string"){var x=z;z={};z[x]=A;A=500}if(y){var w=f();t[w]=y}if(A===undefined){A=500}s=r._api().fp_animate(q,z,A,w);return p},css:function(x,y){if(y!==undefined){var w={};w[x]=y;x=w}s=r._api().fp_css(q,x);j(p,s);return p},show:function(){this.display="block";r._api().fp_showPlugin(q);return p},hide:function(){this.display="none";r._api().fp_hidePlugin(q);return p},toggle:function(){this.display=r._api().fp_togglePlugin(q);return p},fadeTo:function(z,y,x){if(typeof y=="function"){x=y;y=500}if(x){var w=f();t[w]=x}this.display=r._api().fp_fadeTo(q,z,y,w);this.opacity=z;return p},fadeIn:function(x,w){return p.fadeTo(1,x,w)},fadeOut:function(x,w){return p.fadeTo(0,x,w)},getName:function(){return q},getPlayer:function(){return r},_fireEvent:function(x,w,y){if(x=="onUpdate"){var A=r._api().fp_getPlugin(q);
1900if(!A){return}j(p,A);delete p.methods;if(!v){n(A.methods,function(){var C=""+this;p[C]=function(){var D=[].slice.call(arguments);var E=r._api().fp_invoke(q,C,D);return E==="undefined"||E===undefined?p:E}});v=true}}var B=t[x];if(B){var z=B.apply(p,w);if(x.slice(0,1)=="_"){delete t[x]}return z}return p}})};function b(r,H,u){var x=this,w=null,E=false,v,t,G=[],z={},y={},F,s,q,D,p,B;j(x,{id:function(){return F},isLoaded:function(){return(w!==null&&w.fp_play!==undefined&&!E)},getParent:function(){return r},hide:function(I){if(I){r.style.height="0px"}if(x.isLoaded()){w.style.height="0px"}return x},show:function(){r.style.height=B+"px";if(x.isLoaded()){w.style.height=p+"px"}return x},isHidden:function(){return x.isLoaded()&&parseInt(w.style.height,10)===0},load:function(K){if(!x.isLoaded()&&x._fireEvent("onBeforeLoad")!==false){var I=function(){if(v&&!flashembed.isSupported(H.version)){r.innerHTML=""}if(K){K.cached=true;k(y,"onLoad",K)}flashembed(r,H,{config:u})};var J=0;n(a,function(){this.unload(function(L){if(++J==a.length){I()}})})}return x},unload:function(K){if(v.replace(/\s/g,"")!==""){if(x._fireEvent("onBeforeUnload")===false){if(K){K(false)}return x}E=true;try{if(w){if(w.fp_isFullscreen()){w.fp_toggleFullscreen()}w.fp_close();x._fireEvent("onUnload")}}catch(I){}var J=function(){w=null;r.innerHTML=v;E=false;if(K){K(true)}};if(/WebKit/i.test(navigator.userAgent)&&!/Chrome/i.test(navigator.userAgent)){setTimeout(J,0)}else{J()}}else{if(K){K(false)}}return x},getClip:function(I){if(I===undefined){I=D}return G[I]},getCommonClip:function(){return t},getPlaylist:function(){return G},getPlugin:function(I){var K=z[I];if(!K&&x.isLoaded()){var J=x._api().fp_getPlugin(I);if(J){K=new m(I,J,x);z[I]=K}}return K},getScreen:function(){return x.getPlugin("screen")},getControls:function(){return x.getPlugin("controls")._fireEvent("onUpdate")},getLogo:function(){try{return x.getPlugin("logo")._fireEvent("onUpdate")}catch(I){}},getPlay:function(){return x.getPlugin("play")._fireEvent("onUpdate")},getConfig:function(I){return I?l(u):u},getFlashParams:function(){return H},loadPlugin:function(L,K,N,M){if(typeof N=="function"){M=N;N={}}var J=M?f():"_";x._api().fp_loadPlugin(L,K,N,J);var I={};I[J]=M;var O=new m(L,null,x,I);z[L]=O;return O},getState:function(){return x.isLoaded()?w.fp_getState():-1},play:function(J,I){var K=function(){if(J!==undefined){x._api().fp_play(J,I)}else{x._api().fp_play()}};if(x.isLoaded()){K()}else{if(E){setTimeout(function(){x.play(J,I)},50)}else{x.load(function(){K()})}}return x},getVersion:function(){var J="flowplayer.js 3.2.12";if(x.isLoaded()){var I=w.fp_getVersion();I.push(J);return I}return J},_api:function(){if(!x.isLoaded()){throw"Flowplayer "+x.id()+" not loaded when calling an API method"}return w},setClip:function(I){n(I,function(J,K){if(typeof K=="function"){k(y,J,K);delete I[J]}else{if(J=="onCuepoint"){$f(r).getCommonClip().onCuepoint(I[J][0],I[J][1])}}});x.setPlaylist([I]);return x},getIndex:function(){return q},bufferAnimate:function(I){w.fp_bufferAnimate(I===undefined||I);return x},_swfHeight:function(){return w.clientHeight}});n(("Click*,Load*,Unload*,Keypress*,Volume*,Mute*,Unmute*,PlaylistReplace,ClipAdd,Fullscreen*,FullscreenExit,Error,MouseOver,MouseOut").split(","),function(){var I="on"+this;if(I.indexOf("*")!=-1){I=I.slice(0,I.length-1);var J="onBefore"+I.slice(2);x[J]=function(K){k(y,J,K);return x}}x[I]=function(K){k(y,I,K);return x}});n(("pause,resume,mute,unmute,stop,toggle,seek,getStatus,getVolume,setVolume,getTime,isPaused,isPlaying,startBuffer
1900ing,stopBuffering,isFullscreen,toggleFullscreen,reset,close,setPlaylist,addClip,playFeed,setKeyboardShortcutsEnabled,isKeyboardShortcutsEnabled").split(","),function(){var I=this;x[I]=function(K,J){if(!x.isLoaded()){return x}var L=null;if(K!==undefined&&J!==undefined){L=w["fp_"+I](K,J)}else{L=(K===undefined)?w["fp_"+I]():w["fp_"+I](K)}return L==="undefined"||L===undefined?x:L}});x._fireEvent=function(R){if(typeof R=="string"){R=[R]}var S=R[0],P=R[1],N=R[2],M=R[3],L=0;if(u.debug){h(R)}if(!x.isLoaded()&&S=="onLoad"&&P=="player"){w=w||c(s);p=x._swfHeight();n(G,function(){this._fireEvent("onLoad")});n(z,function(T,U){U._fireEvent("onUpdate")});t._fireEvent("onLoad")}if(S=="onLoad"&&P!="player"){return}if(S=="onError"){if(typeof P=="string"||(typeof P=="number"&&typeof N=="number")){P=N;N=M}}if(S=="onContextMenu"){n(u.contextMenu[P],function(T,U){U.call(x)});return}if(S=="onPluginEvent"||S=="onBeforePluginEvent"){var I=P.name||P;var J=z[I];if(J){J._fireEvent("onUpdate",P);return J._fireEvent(N,R.slice(3))}return}if(S=="onPlaylistReplace"){G=[];var O=0;n(P,function(){G.push(new i(this,O++,x))})}if(S=="onClipAdd"){if(P.isInStream){return}P=new i(P,N,x);G.splice(N,0,P);for(L=N+1;L<G.length;L++){G[L].index++}}var Q=true;if(typeof P=="number"&&P<G.length){D=P;var K=G[P];if(K){Q=K._fireEvent(S,N,M)}if(!K||Q!==false){Q=t._fireEvent(S,N,M,K)}}n(y[S],function(){Q=this.call(x,P,N);if(this.cached){y[S].splice(L,1)}if(Q===false){return false}L++});return Q};function C(){if($f(r)){$f(r).getParent().innerHTML="";q=$f(r).getIndex();a[q]=x}else{a.push(x);q=a.length-1}B=parseInt(r.style.height,10)||r.clientHeight;F=r.id||"fp"+f();s=H.id||F+"_api";H.id=s;v=r.innerHTML;if(typeof u=="string"){u={clip:{url:u}}}u.playerId=F;u.clip=u.clip||{};if(r.getAttribute("href",2)&&!u.clip.url){u.clip.url=r.getAttribute("href",2)}if(u.clip.url){u.clip.url=e(u.clip.url)}t=new i(u.clip,-1,x);u.playlist=u.playlist||[u.clip];var J=0;n(u.playlist,function(){var M=this;if(typeof M=="object"&&M.length){M={url:""+M}}if(M.url){M.url=e(M.url)}n(u.clip,function(N,O){if(O!==undefined&&M[N]===undefined&&typeof O!="function"){M[N]=O}});u.playlist[J]=M;M=new i(M,J,x);G.push(M);J++});n(u,function(M,N){if(typeof N=="function"){if(t[M]){t[M](N)}else{k(y,M,N)}delete u[M]}});n(u.plugins,function(M,N){if(N){z[M]=new m(M,N,x)}});if(!u.plugins||u.plugins.controls===undefined){z.controls=new m("controls",null,x)}z.canvas=new m("canvas",null,x);v=r.innerHTML;function L(M){if(/iPad|iPhone|iPod/i.test(navigator.userAgent)&&!/.flv$/i.test(G[0].url)&&!K()){return true}if(!x.isLoaded()&&x._fireEvent("onBeforeClick")!==false){x.load()}return g(M)}function K(){return x.hasiPadSupport&&x.hasiPadSupport()}function I(){if(v.replace(/\s/g,"")!==""){if(r.addEventListener){r.addEventListener("click",L,false)}else{if(r.attachEvent){r.attachEvent("onclick",L)}}}else{if(r.addEventListener&&!K()){r.addEventListener("click",g,false)}x.load()}}setTimeout(I,0)}if(typeof r=="string"){var A=c(r);if(!A){throw"Flowplayer cannot access element: "+r}r=A;C()}else{C()}}var a=[];function d(p){this.length=p.length;this.each=function(r){n(p,r)};this.size=function(){return p.length};var q=this;for(name in b.prototype){q[name]=function(){var r=arguments;q.each(function(){this[name].apply(this,r)})}}}window.flowplayer=window.$f=function(){var q=null;var p=arguments[0];if(!arguments.length){n(a,function(){if(this.isLoaded()){q=this;return false}});return q||a[0]}if(arguments.length==1){if(typeof p=="number"){return a[p]}else{if(p=="*"){return new d(a)}n(a,function(){if(this.id()==p.id||this.id()==p||this.getParent()==p){q=this;return false}});return q}}if(arguments.length>1){var u=arguments[1],r=(arguments.length==3)?arguments[2]:{};if(typeof u=="string"){u={src:u}}u=j({bgcolor:"#000000",version:[10,1],expressInstall:"http://releases.flowplayer.org/swf/expressinstall.swf",cachebusting:false},u);if(typeof p=="string"){if(p.indexOf(".")!=-1){var t=[];n(o(p),function(){t.push(new b(this,l(u),l(r)))});return new d(t)}else{var s=c(p);return new b(s!==null?s:l(p),l(u),l(r))}}else{if(p){return new b(p,l(u),l(r))}}}return null};j(window.$f,{fireEvent:function(){var q=[].slice.call(arguments);var r=$f(q[0]);return r?r._fireEvent(q.slice(1)):null},addPlugin:function(p,q){b.prototype[p]=q;return $f},each:n,extend:j});if(typeof jQuery=="function"){jQuery.fn.flowplayer=function(r,q){if(!arguments.length||typeof arguments[0]=="number"){var p=[];this.each(function(){var s=$f(this);if(s){p.push(s)}});return arguments.length?p[arguments[0]]:new d(p)}return this.each(function(){$f(this,l(r),q?l(q):{})})}}}();!function(){var h=document.all,j="http://get.adobe.com/flashplayer",c=typeof jQuery=="function",e=/(\d+)[^\d]+(\d+)[^\d]*(\d*)/,b={width:"100%",height:"100%",id:"_"+(""+Math.random()).slice(9),allowfullscreen:true,allowscriptaccess:"always",quality:"high",version:[3,0],onFail:null,expressInstall:null,w3c:false,cachebusting:false};if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}})}function i(m,l){if(l){for(var f in l){if(l.hasOwnProperty(f)){m[f]=l[f]}}}return m}function a(f,n){var m=[];for(var l in f){if(f.hasOwnProperty(l)){m[l]=n(f[l])}}return m}window.flashembed=function(f,m,l){if(typeof f=="string"){f=document.getElementById(f.replace("#",""))}if(!f){return}if(typeof m=="string"){m={src:m}}return new d(f,i(i({},b),m),l)};var g=i(window.flashembed,{conf:b,getVersion:function(){var m,f;try{f=navigator.plugins["Shockwave Flash"].description.slice(16)}catch(o){try{m=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");f=m&&m.GetVariable("$version")}catch(n){try{m=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");f=m&&m.GetVariable("$version")}catch(l){}}}f=e.exec(f);return f?[1*f[1],1*f[(f[1]*1>9?2:3)]*1]:[0,0]},asString:function(l){if(l===null||l===undefined){return null}var f=typeof l;if(f=="object"&&l.push){f="array"}switch(f){case"string":l=l.replace(new RegExp('(["\\\\])',"g"),"\\$1");l=l.replace(/^\s?(\d+\.?\d*)%/,"$1pct");return'"'+l+'"';case"array":return"["+a(l,function(o){return g.asString(o)}).join(",")+"]";case"function":return'"function()"';case"object":var m=[];for(var n in l){if(l.hasOwnProperty(n)){m.push('"'+n+'":'+g.asString(l[n]))}}return"{"+m.join(",")+"}"}return String(l).replace(/\s/g," ").replace(/\'/g,'"')},getHTML:function(o,l){o=i({},o);var n='<object width="'+o.width+'" height="'+o.height+'" id="'+o.id+'" name="'+o.id+'"';if(o.cachebusting){o.src+=((o.src.indexOf("?")!=-1?"&":"?")+Math.random())}if(o.w3c||!h){n+=' data="'+o.src+'" type="application/x-shockwave-flash"'}else{n+=' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'}n+=">";if(o.w3c||h){n+='<param name="movie" value="'+o.src+'" />'}o.width=o.height=o.id=o.w3c=o.src=null;o.onFail=o.version=o.expressInstall=null;for(var m in o){if(o[m]){n+='<param name="'+m+'" value="'+o[m]+'" />'}}var p="";if(l){for(var f in l){if(l[f]){var q=l[f];p+=f+"="+(/function|object/.test(typeof q)?g.asString(q):q)+"&"}}p=p.slice(0,-1);n+='<param name="flashvars" value=\''+p+"' />"}n+="</object>";return n},isSupported:function(f){return k[0]>f[0]||k[0]==f[0]&&k[1]>=f[1]}});var k=g.getVersion();function d(f,n,m){if(g.isSupported(n.version)){f.innerHTML=g.getHTML(n,m)}else{if(n.expressInstall&&g.isSupported([6,65])){f.innerHTML=g.getHTML(i(n,{src:n.expressInstall}),{MMredirectURL:encodeURIComponent(location.href),MMplayerType:"PlugIn",MMdoctitle:document.title})}else{if(!f.innerHTML.replace(/\s/g,"")){f.innerHTML="<h2>Flash version "+n.version+" or greater is required</h2><h3>"+(k[0]>0?"Your version is "+k:"You have no flash plugin installed")+"</h3>"+(f.tagName=="A"?"<p>Click here to download latest version</p>":"<p>Download latest version from <a href='"+j+"'>here</a></p>");
vendor: 11,970 bytes, lines 1900-1916
1900if(f.tagName=="A"||f.tagName=="DIV"){f.onclick=function(){location.href=j}}}if(n.onFail){var l=n.onFail.call(this);if(typeof l=="string"){f.innerHTML=l}}}}if(h){window[n.id]=document.getElementById(n.id)}i(this,{getRoot:function(){return f},getOptions:function(){return n},getConf:function(){return m},getApi:function(){return f.firstChild}})}if(c){jQuery.tools=jQuery.tools||{version:"3.2.12"};jQuery.tools.flashembed={conf:b};jQuery.fn.flashembed=function(l,f){return this.each(function(){$(this).data("flashembed",flashembed(this,l,f))})}}}();/*
1901     _ _      _       _
1902 ___| (_) ___| | __  (_)___
1903/ __| | |/ __| |/ /  | / __|
1904\__ \ | | (__|   < _ | \__ \
1905|___/_|_|\___|_|\_(_)/ |___/
1906                   |__/
1907
1908 Version: 1.6.0
1909  Author: Ken Wheeler
1910 Website: http://kenwheeler.github.io
1911    Docs: http://kenwheeler.github.io/slick
1912    Repo: http://github.com/kenwheeler/slick
1913  Issues: http://github.com/kenwheeler/slick/issues
1914
1915 */
1916!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):"undefined"!=typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){"use strict";var b=window.Slick||{};b=function(){function c(c,d){var f,e=this;e.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:a(c),appendDots:a(c),arrows:!0,asNavFor:null,prevArrow:'<button type="button" data-role="none" class="slick-prev" aria-label="Previous" tabindex="0" role="button">Previous</button>',nextArrow:'<button type="button" data-role="none" class="slick-next" aria-label="Next" tabindex="0" role="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(b,c){return a('<button type="button" data-role="none" role="button" tabindex="0" />').text(c+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},e.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},a.extend(e,e.initials),e.activeBreakpoint=null,e.animType=null,e.animProp=null,e.breakpoints=[],e.breakpointSettings=[],e.cssTransitions=!1,e.focussed=!1,e.interrupted=!1,e.hidden="hidden",e.paused=!0,e.positionProp=null,e.respondTo=null,e.rowCount=1,e.shouldClick=!0,e.$slider=a(c),e.$slidesCache=null,e.transformType=null,e.transitionType=null,e.visibilityChange="visibilitychange",e.windowWidth=0,e.windowTimer=null,f=a(c).data("slick")||{},e.options=a.extend({},e.defaults,d,f),e.currentSlide=e.options.initialSlide,e.originalSettings=e.options,"undefined"!=typeof document.mozHidden?(e.hidden="mozHidden",e.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(e.hidden="webkitHidden",e.visibilityChange="webkitvisibilitychange"),e.autoPlay=a.proxy(e.autoPlay,e),e.autoPlayClear=a.proxy(e.autoPlayClear,e),e.autoPlayIterator=a.proxy(e.autoPlayIterator,e),e.changeSlide=a.proxy(e.changeSlide,e),e.clickHandler=a.proxy(e.clickHandler,e),e.selectHandler=a.proxy(e.selectHandler,e),e.setPosition=a.proxy(e.setPosition,e),e.swipeHandler=a.proxy(e.swipeHandler,e),e.dragHandler=a.proxy(e.dragHandler,e),e.keyHandler=a.proxy(e.keyHandler,e),e.instanceUid=b++,e.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,e.registerBreakpoints(),e.init(!0)}var b=0;return c}(),b.prototype.activateADA=function(){var a=this;a.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},b.prototype.addSlide=b.prototype.slickAdd=function(b,c,d){var e=this;if("boolean"==typeof c)d=c,c=null;else if(0>c||c>=e.slideCount)return!1;e.unload(),"number"==typeof c?0===c&&0===e.$slides.length?a(b).appendTo(e.$slideTrack):d?a(b).insertBefore(e.$slides.eq(c)):a(b).insertAfter(e.$slides.eq(c)):d===!0?a(b).prependTo(e.$slideTrack):a(b).appendTo(e.$slideTrack),e.$slides=e.$slideTrack.children(this.options.slide),e.$slideTrack.children(this.options.slide).detach(),e.$slideTrack.append(e.$slides),e.$slides.each(function(b,c){a(c).attr("data-slick-index",b)}),e.$slidesCache=e.$slides,e.reinit()},b.prototype.animateHeight=function(){var a=this;if(1===a.options.slidesToShow&&a.options.adaptiveHeight===!0&&a.options.vertical===!1){var b=a.$slides.eq(a.currentSlide).outerHeight(!0);a.$list.animate({height:b},a.options.speed)}},b.prototype.animateSlide=function(b,c){var d={},e=this;e.animateHeight(),e.options.rtl===!0&&e.options.vertical===!1&&(b=-b),e.transformsEnabled===!1?e.options.vertical===!1?e.$slideTrack.animate({left:b},e.options.speed,e.options.easing,c):e.$slideTrack.animate({top:b},e.options.speed,e.options.easing,c):e.cssTransitions===!1?(e.options.rtl===!0&&(e.currentLeft=-e.currentLeft),a({animStart:e.currentLeft}).animate({animStart:b},{duration:e.options.speed,easing:e.options.easing,step:function(a){a=Math.ceil(a),e.options.vertical===!1?(d[e.animType]="translate("+a+"px, 0px)",e.$slideTrack.css(d)):(d[e.animType]="translate(0px,"+a+"px)",e.$slideTrack.css(d))},complete:function(){c&&c.call()}})):(e.applyTransition(),b=Math.ceil(b),e.options.vertical===!1?d[e.animType]="translate3d("+b+"px, 0px, 0px)":d[e.animType]="translate3d(0px,"+b+"px, 0px)",e.$slideTrack.css(d),c&&setTimeout(function(){e.disableTransition(),c.call()},e.options.speed))},b.prototype.getNavTarget=function(){var b=this,c=b.options.asNavFor;return c&&null!==c&&(c=a(c).not(b.$slider)),c},b.prototype.asNavFor=function(b){var c=this,d=c.getNavTarget();null!==d&&"object"==typeof d&&d.each(function(){var c=a(this).slick("getSlick");c.unslicked||c.slideHandler(b,!0)})},b.prototype.applyTransition=function(a){var b=this,c={};b.options.fade===!1?c[b.transitionType]=b.transformType+" "+b.options.speed+"ms "+b.options.cssEase:c[b.transitionType]="opacity "+b.options.speed+"ms "+b.options.cssEase,b.options.fade===!1?b.$slideTrack.css(c):b.$slides.eq(a).css(c)},b.prototype.autoPlay=function(){var a=this;a.autoPlayClear(),a.slideCount>a.options.slidesToShow&&(a.autoPlayTimer=setInterval(a.autoPlayIterator,a.options.autoplaySpeed))},b.prototype.autoPlayClear=function(){var a=this;a.autoPlayTimer&&clearInterval(a.autoPlayTimer)},b.prototype.autoPlayIterator=function(){var a=this,b=a.currentSlide+a.options.slidesToScroll;a.paused||a.interrupted||a.focussed||(a.options.infinite===!1&&(1===a.direction&&a.currentSlide+1===a.slideCount-1?a.direction=0:0===a.direction&&(b=a.currentSlide-a.options.slidesToScroll,a.currentSlide-1===0&&(a.direction=1))),a.slideHandler(b))},b.prototype.buildArrows=function(){var b=this;b.options.arrows===!0&&(b.$prevArrow=a(b.options.prevArrow).addClass("slick-arrow"),b.$nextArrow=a(b.options.nextArrow).addClass("slick-arrow"),b.slideCount>b.options.slidesToShow?(b.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),b.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),b.htmlExpr.test(b.options.prevArrow)&&b.$prevArrow.prependTo(b.options.appendArrows),b.htmlExpr.test(b.options.nextArrow)&&b.$nextArrow.appendTo(b.options.appendArrows),b.options.infinite!==!0&&b.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):b.$prevArrow.add(b.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},b.prototype.buildDots=function(){var c,d,b=this;if(b.options.dots===!0&&b.slideCount>b.options.slidesToShow){for(b.$slider.addClass("slick-dotted"),d=a("<ul />").addClass(b.options.dotsClass),c=0;c<=b.getDotCount();c+=1)d.append(a("<li />").append(b.options.customPaging.call(this,b,c)));b.$dots=d.appendTo(b.options.appendDots),b.$dots.find("li").first().addClass("slick-active").attr("aria-hidden","false")}},b.prototype.buildOut=function(){var b=this;b.$slides=b.$slider.children(b.options.slide+":not(.slick-cloned)").addClass("slick-slide"),b.slideCount=b.$slides.length,b.$slides.each(function(b,c){a(c).attr("data-slick-index",b).data("originalStyling",a(c).attr("style")||"")}),b.$slider.addClass("slick-slider"),b.$slideTrack=0===b.slideCount?a('<div class="slick-track"/>').appendTo(b.$slider):b.$slides.wrapAll('<div class="slick-track"/>').parent(),b.$list=b.$slideTrack.wrap('<div aria-live="polite" class="slick-list"/>').parent(),b.$slideTrack.css("opacity",0),(b.options.centerMode===!0||b.options.swipeToSlide===!0)&&(b.options.slidesToScroll=1),a("img[data-lazy]",b.$slider).not("[src]").addClass("slick-loading"),b.setupInfinite(),b.buildArrows(),b.buildDots(),b.updateDots(),b.setSlideClasses("number"==typeof b.currentSlide?b.currentSlide:0),b.options.draggable===!0&&b.$list.addClass("draggable")},b.prototype.buildRows=function(){var b,c,d,e,f,g,h,a=this;if(e=document.createDocumentFragment(),g=a.$slider.children(),a.options.rows>1){for(h=a.options.slidesPerRow*a.options.rows,f=Math.ceil(g.length/h),b=0;f>b;b++){var i=document.createElement("div");for(c=0;c<a.options.rows;c++){var j=document.createElement("div");for(d=0;d<a.options.slidesPerRow;d++){var k=b*h+(c*a.options.slidesPerRow+d);g.get(k)&&j.appendChild(g.get(k))}i.appendChild(j)}e.appendChild(i)}a.$slider.empty().append(e),a.$slider.children().children().children().css({width:100/a.options.slidesPerRow+"%",display:"inline-block"})}},b.prototype.checkResponsive=function(b,c){var e,f,g,d=this,h=!1,i=d.$slider.width(),j=window.innerWidth||a(window).width();if("window"===d.respondTo?g=j:"slider"===d.respondTo?g=i:"min"===d.respondTo&&(g=Math.min(j,i)),d.options.responsive&&d.options.responsive.length&&null!==d.options.responsive){f=null;for(e in d.breakpoints)d.breakpoints.hasOwnProperty(e)&&(d.originalSettings.mobileFirst===!1?g<d.breakpoints[e]&&(f=d.breakpoints[e]):g>d.breakpoints[e]&&(f=d.breakpoints[e]));null!==f?null!==d.activeBreakpoint?(f!==d.activeBreakpoint||c)&&(d.activeBreakpoint=f,"unslick"===d.breakpointSettings[f]?d.unslick(f):(d.options=a.extend({},d.originalSettings,d.breakpointSettings[f]),b===!0&&(d.currentSlide=d.options.initialSlide),d.refresh(b)),h=f):(d.activeBreakpoint=f,"unslick"===d.breakpointSettings[f]?d.unslick(f):(d.options=a.extend({},d.originalSettings,d.breakpointSettings[f]),b===!0&&(d.currentSlide=d.options.initialSlide),d.refresh(b)),h=f):null!==d.activeBreakpoint&&(d.activeBreakpoint=null,d.options=d.originalSettings,b===!0&&(d.currentSlide=d.options.initialSlide),d.refresh(b),h=f),b||h===!1||d.$slider.trigger("breakpoint",[d,h])}},b.prototype.changeSlide=function(b,c){var f,g,h,d=this,e=a(b.currentTarget);switch(e.is("a")&&b.preventDefault(),e.is("li")||(e=e.closest("li")),h=d.slideCount%d.options.slidesToScroll!==0,f=h?0:(d.slideCount-d.currentSlide)%d.options.slidesToScroll,b.data.message){case"previous":g=0===f?d.options.slidesToScroll:d.options.slidesToShow-f,d.slideCount>d.options.slidesToShow&&d.slideHandler(d.currentSlide-g,!1,c);break;case"next":g=0===f?d.options.slidesToScroll:f,d.slideCount>d.options.slidesToShow&&d.slideHandler(d.currentSlide+g,!1,c);break;case"index":var i=0===b.data.index?0:b.data.index||e.index()*d.options.slidesToScroll;d.slideHandler(d.checkNavigable(i),!1,c),e.children().trigger("focus");break;default:return}},b.prototype.checkNavigable=function(a){var c,d,b=this;if(c=b.getNavigableIndexes(),d=0,a>c[c.length-1])a=c[c.length-1];else for(var e in c){if(a<c[e]){a=d;break}d=c[e]}return a},b.prototype.cleanUpEvents=function(){var b=this;b.options.dots&&null!==b.$dots&&a("li",b.$dots).off("click.slick",b.changeSlide).off("mouseenter.slick",a.proxy(b.interrupt,b,!0)).off("mouseleave.
1916slick",a.proxy(b.interrupt,b,!1)),b.$slider.off("focus.slick blur.slick"),b.options.arrows===!0&&b.slideCount>b.options.slidesToShow&&(b.$prevArrow&&b.$prevArrow.off("click.slick",b.changeSlide),b.$nextArrow&&b.$nextArrow.off("click.slick",b.changeSlide)),b.$list.off("touchstart.slick mousedown.slick",b.swipeHandler),b.$list.off("touchmove.slick mousemove.slick",b.swipeHandler),b.$list.off("touchend.slick mouseup.slick",b.swipeHandler),b.$list.off("touchcancel.slick mouseleave.slick",b.swipeHandler),b.$list.off("click.slick",b.clickHandler),a(document).off(b.visibilityChange,b.visibility),b.cleanUpSlideEvents(),b.options.accessibility===!0&&b.$list.off("keydown.slick",b.keyHandler),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().off("click.slick",b.selectHandler),a(window).off("orientationchange.slick.slick-"+b.instanceUid,b.orientationChange),a(window).off("resize.slick.slick-"+b.instanceUid,b.resize),a("[draggable!=true]",b.$slideTrack).off("dragstart",b.preventDefault),a(window).off("load.slick.slick-"+b.instanceUid,b.setPosition),a(document).off("ready.slick.slick-"+b.instanceUid,b.setPosition)},b.prototype.cleanUpSlideEvents=function(){var b=this;b.$list.off("mouseenter.slick",a.proxy(b.interrupt,b,!0)),b.$list.off("mouseleave.slick",a.proxy(b.interrupt,b,!1))},b.prototype.cleanUpRows=function(){var b,a=this;a.options.rows>1&&(b=a.$slides.children().children(),b.removeAttr("style"),a.$slider.empty().append(b))},b.prototype.clickHandler=function(a){var b=this;b.shouldClick===!1&&(a.stopImmediatePropagation(),a.stopPropagation(),a.preventDefault())},b.prototype.destroy=function(b){var c=this;c.autoPlayClear(),c.touchObject={},c.cleanUpEvents(),a(".slick-cloned",c.$slider).detach(),c.$dots&&c.$dots.remove(),c.$prevArrow&&c.$prevArrow.length&&(c.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),c.htmlExpr.test(c.options.prevArrow)&&c.$prevArrow.remove()),c.$nextArrow&&c.$nextArrow.length&&(c.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),c.htmlExpr.test(c.options.nextArrow)&&c.$nextArrow.remove()),c.$slides&&(c.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){a(this).attr("style",a(this).data("originalStyling"))}),c.$slideTrack.children(this.options.slide).detach(),c.$slideTrack.detach(),c.$list.detach(),c.$slider.append(c.$slides)),c.cleanUpRows(),c.$slider.removeClass("slick-slider"),c.$slider.removeClass("slick-initialized"),c.$slider.removeClass("slick-dotted"),c.unslicked=!0,b||c.$slider.trigger("destroy",[c])},b.prototype.disableTransition=function(a){var b=this,c={};c[b.transitionType]="",b.options.fade===!1?b.$slideTrack.css(c):b.$slides.eq(a).css(c)},b.prototype.fadeSlide=function(a,b){var c=this;c.cssTransitions===!1?(c.$slides.eq(a).css({zIndex:c.options.zIndex}),c.$slides.eq(a).animate({opacity:1},c.options.speed,c.options.easing,b)):(c.applyTransition(a),c.$slides.eq(a).css({opacity:1,zIndex:c.options.zIndex}),b&&setTimeout(function(){c.disableTransition(a),b.call()},c.options.speed))},b.prototype.fadeSlideOut=function(a){var b=this;b.cssTransitions===!1?b.$slides.eq(a).animate({opacity:0,zIndex:b.options.zIndex-2},b.options.speed,b.options.easing):(b.applyTransition(a),b.$slides.eq(a).css({opacity:0,zIndex:b.options.zIndex-2}))},b.prototype.filterSlides=b.prototype.slickFilter=function(a){var b=this;null!==a&&(b.$slidesCache=b.$slides,b.unload(),b.$slideTrack.children(this.options.slide).detach(),b.$slidesCache.filter(a).appendTo(b.$slideTrack),b.reinit())},b.prototype.focusHandler=function(){var b=this;b.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick","*:not(.slick-arrow)",function(c){c.stopImmediatePropagation();var d=a(this);setTimeout(function(){b.options.pauseOnFocus&&(b.focussed=d.is(":focus"),b.autoPlay())},0)})},b.prototype.getCurrent=b.prototype.slickCurrentSlide=function(){var a=this;return a.currentSlide},b.prototype.getDotCount=function(){var a=this,b=0,c=0,d=0;if(a.options.infinite===!0)for(;b<a.slideCount;)++d,b=c+a.options.slidesToScroll,c+=a.options.slidesToScroll<=a.options.slidesToShow?a.options.slidesToScroll:a.options.slidesToShow;else if(a.options.centerMode===!0)d=a.slideCount;else if(a.options.asNavFor)for(;b<a.slideCount;)++d,b=c+a.options.slidesToScroll,c+=a.options.slidesToScroll<=a.options.slidesToShow?a.options.slidesToScroll:a.options.slidesToShow;else d=1+Math.ceil((a.slideCount-a.options.slidesToShow)/a.options.slidesToScroll);return d-1},b.prototype.getLeft=function(a){var c,d,f,b=this,e=0;return b.slideOffset=0,d=b.$slides.first().outerHeight(!0),b.options.infinite===!0?(b.slideCount>b.options.slidesToShow&&(b.slideOffset=b.slideWidth*b.options.slidesToShow*-1,e=d*b.options.slidesToShow*-1),b.slideCount%b.options.slidesToScroll!==0&&a+b.options.slidesToScroll>b.slideCount&&b.slideCount>b.options.slidesToShow&&(a>b.slideCount?(b.slideOffset=(b.options.slidesToShow-(a-b.slideCount))*b.slideWidth*-1,e=(b.options.slidesToShow-(a-b.slideCount))*d*-1):(b.slideOffset=b.slideCount%b.options.slidesToScroll*b.slideWidth*-1,e=b.slideCount%b.options.slidesToScroll*d*-1))):a+b.o
vendor: 4,100 bytes, line 1916
1916ptions.slidesToShow>b.slideCount&&(b.slideOffset=(a+b.options.slidesToShow-b.slideCount)*b.slideWidth,e=(a+b.options.slidesToShow-b.slideCount)*d),b.slideCount<=b.options.slidesToShow&&(b.slideOffset=0,e=0),b.options.centerMode===!0&&b.options.infinite===!0?b.slideOffset+=b.slideWidth*Math.floor(b.options.slidesToShow/2)-b.slideWidth:b.options.centerMode===!0&&(b.slideOffset=0,b.slideOffset+=b.slideWidth*Math.floor(b.options.slidesToShow/2)),c=b.options.vertical===!1?a*b.slideWidth*-1+b.slideOffset:a*d*-1+e,b.options.variableWidth===!0&&(f=b.slideCount<=b.options.slidesToShow||b.options.infinite===!1?b.$slideTrack.children(".slick-slide").eq(a):b.$slideTrack.children(".slick-slide").eq(a+b.options.slidesToShow),c=b.options.rtl===!0?f[0]?-1*(b.$slideTrack.width()-f[0].offsetLeft-f.width()):0:f[0]?-1*f[0].offsetLeft:0,b.options.centerMode===!0&&(f=b.slideCount<=b.options.slidesToShow||b.options.infinite===!1?b.$slideTrack.children(".slick-slide").eq(a):b.$slideTrack.children(".slick-slide").eq(a+b.options.slidesToShow+1),c=b.options.rtl===!0?f[0]?-1*(b.$slideTrack.width()-f[0].offsetLeft-f.width()):0:f[0]?-1*f[0].offsetLeft:0,c+=(b.$list.width()-f.outerWidth())/2)),c},b.prototype.getOption=b.prototype.slickGetOption=function(a){var b=this;return b.options[a]},b.prototype.getNavigableIndexes=function(){var e,a=this,b=0,c=0,d=[];for(a.options.infinite===!1?e=a.slideCount:(b=-1*a.options.slidesToScroll,c=-1*a.options.slidesToScroll,e=2*a.slideCount);e>b;)d.push(b),b=c+a.options.slidesToScroll,c+=a.options.slidesToScroll<=a.options.slidesToShow?a.options.slidesToScroll:a.options.slidesToShow;return d},b.prototype.getSlick=function(){return this},b.prototype.getSlideCount=function(){var c,d,e,b=this;return e=b.options.centerMode===!0?b.slideWidth*Math.floor(b.options.slidesToShow/2):0,b.options.swipeToSlide===!0?(b.$slideTrack.find(".slick-slide").each(function(c,f){return f.offsetLeft-e+a(f).outerWidth()/2>-1*b.swipeLeft?(d=f,!1):void 0}),c=Math.abs(a(d).attr("data-slick-index")-b.currentSlide)||1):b.options.slidesToScroll},b.prototype.goTo=b.prototype.slickGoTo=function(a,b){var c=this;c.changeSlide({data:{message:"index",index:parseInt(a)}},b)},b.prototype.init=function(b){var c=this;a(c.$slider).hasClass("slick-initialized")||(a(c.$slider).addClass("slick-initialized"),c.buildRows(),c.buildOut(),c.setProps(),c.startLoad(),c.loadSlider(),c.initializeEvents(),c.updateArrows(),c.updateDots(),c.checkResponsive(!0),c.focusHandler()),b&&c.$slider.trigger("init",[c]),c.options.accessibility===!0&&c.initADA(),c.options.autoplay&&(c.paused=!1,c.autoPlay())},b.prototype.initADA=function(){var b=this;b.$slides.add(b.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),b.$slideTrack.attr("role","listbox"),b.$slides.not(b.$slideTrack.find(".slick-cloned")).each(function(c){a(this).attr({role:"option","aria-describedby":"slick-slide"+b.instanceUid+c})}),null!==b.$dots&&b.$dots.attr("role","tablist").find("li").each(function(c){a(this).attr({role:"presentation","aria-selected":"false","aria-controls":"navigation"+b.instanceUid+c,id:"slick-slide"+b.instanceUid+c})}).first().attr("aria-selected","true").end().find("button").attr("role","button").end().closest("div").attr("role","toolbar"),b.activateADA()},b.prototype.initArrowEvents=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},a.changeSlide),a.$nextArrow.off("click.slick").on("click.slick",{message:"next"},a.changeSlide))},b.prototype.initDotEvents=function(){var b=this;b.options.dots===!0&&b.slideCount>b.options.slidesToShow&&a("li",b.$dots).on("click.slick",{message:"index"},b.changeSlide),b.options.dots===!0&&b.options.pauseOnDotsHover===!0&&a("li",b.$dots).on("mouseenter.slick",a.proxy(b.interrupt,b,!0)).on("mouseleave.slick",a.proxy(b.interrupt,b,!1))},b.prototype.initSlideEvents=function(){var b=this;b.options.pauseOnHover&&(b.$list.on("mouseenter.slick",a.proxy(b.interrupt,b,!0)),b.$list.on("mouseleave.
1916slick",a.proxy(b.interrupt,b,!1)))},b.prototype.initializeEvents=function(){var b=this;b.initArrowEvents(),b.initDotEvents(),b.initSlideEvents(),b.$list.on("touchstart.slick mousedown.slick",{action:"start"},b.swipeHandler),b.$list.on("touchmove.slick mousemove.slick",{action:"move"},b.swipeHandler),b.$list.on("touchend.slick mouseup.slick",{action:"end"},b.swipeHandler),b.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},b.swipeHandler),b.$list.on("click.slick",b.clickHandler),a(document).on(b.visibilityChange,a.proxy(b.visibility,b)),b.options.accessibility===!0&&b.$list.on("keydown.slick",b.keyHandler),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().on("click.slick",b.selectHandler),a(window).on("orientationchange.slick.slick-"+b.instanceUid,a.proxy(b.orientationChange,b)),a(window).on("resize.slick.slick-"+b.instanceUid,a.proxy(b.resize,b)),a("[draggable!=true]",b.$slideTrack).on("dragstart",b.preventDefault),a(window).on("load.slick.slick-"+b.instanceUid,b.setPosition),a(document).on("ready.slick.slick-"+b.instanceUid,b.setPosition)},b.prototype.initUI=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.show(),a.$nextArrow.show()),a.options.dots===!0&&a.slideCount>a.options.slidesToShow&&a.$dots.show()},b.prototype.keyHandler=function(a){var b=this;a.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===a.keyCode&&b.options.accessibility===!0?b.changeSlide({data:{message:b.options.rtl===!0?"next":"previous"}}):39===a.keyCode&&b.options.accessibility===!0&&b.changeSlide({data:{message:b.options.rtl===!0?"previous":"next"}}))},b.prototype.lazyLoad=function(){function g(c){a("img[data-lazy]",c).each(function(){var c=a(this),d=a(this).attr("data-lazy"),e=document.createElement("img");e.onload=function(){c.animate({opacity:0}
vendor: 4,284 bytes, line 1916
1916,100,function(){c.attr("src",d).animate({opacity:1},200,function(){c.removeAttr("data-lazy").removeClass("slick-loading")}),b.$slider.trigger("lazyLoaded",[b,c,d])})},e.onerror=function(){c.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),b.$slider.trigger("lazyLoadError",[b,c,d])},e.src=d})}var c,d,e,f,b=this;b.options.centerMode===!0?b.options.infinite===!0?(e=b.currentSlide+(b.options.slidesToShow/2+1),f=e+b.options.slidesToShow+2):(e=Math.max(0,b.currentSlide-(b.options.slidesToShow/2+1)),f=2+(b.options.slidesToShow/2+1)+b.currentSlide):(e=b.options.infinite?b.options.slidesToShow+b.currentSlide:b.currentSlide,f=Math.ceil(e+b.options.slidesToShow),b.options.fade===!0&&(e>0&&e--,f<=b.slideCount&&f++)),c=b.$slider.find(".slick-slide").slice(e,f),g(c),b.slideCount<=b.options.slidesToShow?(d=b.$slider.find(".slick-slide"),g(d)):b.currentSlide>=b.slideCount-b.options.slidesToShow?(d=b.$slider.find(".slick-cloned").slice(0,b.options.slidesToShow),g(d)):0===b.currentSlide&&(d=b.$slider.find(".slick-cloned").slice(-1*b.options.slidesToShow),g(d))},b.prototype.loadSlider=function(){var a=this;a.setPosition(),a.$slideTrack.css({opacity:1}),a.$slider.removeClass("slick-loading"),a.initUI(),"progressive"===a.options.lazyLoad&&a.progressiveLazyLoad()},b.prototype.next=b.prototype.slickNext=function(){var a=this;a.changeSlide({data:{message:"next"}})},b.prototype.orientationChange=function(){var a=this;a.checkResponsive(),a.setPosition()},b.prototype.pause=b.prototype.slickPause=function(){var a=this;a.autoPlayClear(),a.paused=!0},b.prototype.play=b.prototype.slickPlay=function(){var a=this;a.autoPlay(),a.options.autoplay=!0,a.paused=!1,a.focussed=!1,a.interrupted=!1},b.prototype.postSlide=function(a){var b=this;b.unslicked||(b.$slider.trigger("afterChange",[b,a]),b.animating=!1,b.setPosition(),b.swipeLeft=null,b.options.autoplay&&b.autoPlay(),b.options.accessibility===!0&&b.initADA())},b.prototype.prev=b.prototype.slickPrev=function(){var a=this;a.changeSlide({data:{message:"previous"}})},b.prototype.preventDefault=function(a){a.preventDefault()},b.prototype.progressiveLazyLoad=function(b){b=b||1;var e,f,g,c=this,d=a("img[data-lazy]",c.$slider);d.length?(e=d.first(),f=e.attr("data-lazy"),g=document.createElement("img"),g.onload=function(){e.attr("src",f).removeAttr("data-lazy").removeClass("slick-loading"),c.options.adaptiveHeight===!0&&c.setPosition(),c.$slider.trigger("lazyLoaded",[c,e,f]),c.progressiveLazyLoad()},g.onerror=function(){3>b?setTimeout(function(){c.progressiveLazyLoad(b+1)},500):(e.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),c.$slider.trigger("lazyLoadError",[c,e,f]),c.progressiveLazyLoad())},g.src=f):c.$slider.trigger("allImagesLoaded",[c])},b.prototype.refresh=function(b){var d,e,c=this;e=c.slideCount-c.options.slidesToShow,!c.options.infinite&&c.currentSlide>e&&(c.currentSlide=e),c.slideCount<=c.options.slidesToShow&&(c.currentSlide=0),d=c.currentSlide,c.destroy(!0),a.extend(c,c.initials,{currentSlide:d}),c.init(),b||c.changeSlide({data:{message:"index",index:d}},!1)},b.prototype.registerBreakpoints=function(){var c,d,e,b=this,f=b.options.responsive||null;if("array"===a.type(f)&&f.length){b.respondTo=b.options.respondTo||"window";for(c in f)if(e=b.breakpoints.length-1,d=f[c].breakpoint,f.hasOwnProperty(c)){for(;e>=0;)b.breakpoints[e]&&b.breakpoints[e]===d&&b.breakpoints.splice(e,1),e--;b.breakpoints.push(d),b.breakpointSettings[d]=f[c].settings}b.breakpoints.sort(function(a,c){return b.options.mobileFirst?a-c:c-a})}},b.prototype.reinit=function(){var b=this;b.$slides=b.$slideTrack.children(b.options.slide).addClass("slick-slide"),b.slideCount=b.$slides.length,b.currentSlide>=b.slideCount&&0!==b.currentSlide&&(b.currentSlide=b.currentSlide-b.options.slidesToScroll),b.slideCount<=b.options.slidesToShow&&(b.currentSlide=0),b.registerBreakpoints(),b.setProps(),b.setupInfinite(),b.buildArrows(),b.updateArrows(),b.initArrowEvents(),b.buildDots(),b.updateDots(),b.initDotEvents(),b.cleanUpSlideEvents(),b.initSlideEvents(),b.checkResponsive(!1,!0),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().on("click.slick",b.selectHandler),b.setSlideClasses("number"==typeof b.currentSlide?b.currentSlide:0),b.setPosition(),b.focu
vendor: 2,346 bytes, line 1916
1916sHandler(),b.paused=!b.options.autoplay,b.autoPlay(),b.$slider.trigger("reInit",[b])},b.prototype.resize=function(){var b=this;a(window).width()!==b.windowWidth&&(clearTimeout(b.windowDelay),b.windowDelay=window.setTimeout(function(){b.windowWidth=a(window).width(),b.checkResponsive(),b.unslicked||b.setPosition()},50))},b.prototype.removeSlide=b.prototype.slickRemove=function(a,b,c){var d=this;return"boolean"==typeof a?(b=a,a=b===!0?0:d.slideCount-1):a=b===!0?--a:a,d.slideCount<1||0>a||a>d.slideCount-1?!1:(d.unload(),c===!0?d.$slideTrack.children().remove():d.$slideTrack.children(this.options.slide).eq(a).remove(),d.$slides=d.$slideTrack.children(this.options.slide),d.$slideTrack.children(this.options.slide).detach(),d.$slideTrack.append(d.$slides),d.$slidesCache=d.$slides,void d.reinit())},b.prototype.setCSS=function(a){var d,e,b=this,c={};b.options.rtl===!0&&(a=-a),d="left"==b.positionProp?Math.ceil(a)+"px":"0px",e="top"==b.positionProp?Math.ceil(a)+"px":"0px",c[b.positionProp]=a,b.transformsEnabled===!1?b.$slideTrack.css(c):(c={},b.cssTransitions===!1?(c[b.animType]="translate("+d+", "+e+")",b.$slideTrack.css(c)):(c[b.animType]="translate3d("+d+", "+e+", 0px)",b.$slideTrack.css(c)))},b.prototype.setDimensions=function(){var a=this;a.options.vertical===!1?a.options.centerMode===!0&&a.$list.css({padding:"0px "+a.options.centerPadding}):(a.$list.height(a.$slides.first().outerHeight(!0)*a.options.slidesToShow),a.options.centerMode===!0&&a.$list.css({padding:a.options.centerPadding+" 0px"})),a.listWidth=a.$list.width(),a.listHeight=a.$list.height(),a.options.vertical===!1&&a.options.variableWidth===!1?(a.slideWidth=Math.ceil(a.listWidth/a.options.slidesToShow),a.$slideTrack.width(Math.ceil(a.slideWidth*a.$slideTrack.children(".slick-slide").length))):a.options.variableWidth===!0?a.$slideTrack.width(5e3*a.slideCount):(a.slideWidth=Math.ceil(a.listWidth),a.$slideTrack.height(Math.ceil(a.$slides.first().outerHeight(!0)*a.$slideTrack.children(".slick-slide").length)));var b=a.$slides.first().outerWidth(!0)-a.$slides.first().width();a.options.variableWidth===!1&&a.$slideTrack.children(".slick-slide").width(a.slideWidth-b)},b.prototype.setFade=function(){var c,b=this;b.$slides.each(function(d,e){c=b.slideWidth*d*-1,b.options.rtl===!0?a(e).css({position:"relative",right:c,top:0,zIndex:b.options.zIndex-2,opacity:0}
vendor: 3,177 bytes, line 1916
1916):a(e).css({position:"relative",left:c,top:0,zIndex:b.options.zIndex-2,opacity:0})}),b.$slides.eq(b.currentSlide).css({zIndex:b.options.zIndex-1,opacity:1})},b.prototype.setHeight=function(){var a=this;if(1===a.options.slidesToShow&&a.options.adaptiveHeight===!0&&a.options.vertical===!1){var b=a.$slides.eq(a.currentSlide).outerHeight(!0);a.$list.css("height",b)}},b.prototype.setOption=b.prototype.slickSetOption=function(){var c,d,e,f,h,b=this,g=!1;if("object"===a.type(arguments[0])?(e=arguments[0],g=arguments[1],h="multiple"):"string"===a.type(arguments[0])&&(e=arguments[0],f=arguments[1],g=arguments[2],"responsive"===arguments[0]&&"array"===a.type(arguments[1])?h="responsive":"undefined"!=typeof arguments[1]&&(h="single")),"single"===h)b.options[e]=f;else if("multiple"===h)a.each(e,function(a,c){b.options[a]=c});else if("responsive"===h)for(d in f)if("array"!==a.type(b.options.responsive))b.options.responsive=[f[d]];else{for(c=b.options.responsive.length-1;c>=0;)b.options.responsive[c].breakpoint===f[d].breakpoint&&b.options.responsive.splice(c,1),c--;b.options.responsive.push(f[d])}g&&(b.unload(),b.reinit())},b.prototype.setPosition=function(){var a=this;a.setDimensions(),a.setHeight(),a.options.fade===!1?a.setCSS(a.getLeft(a.currentSlide)):a.setFade(),a.$slider.trigger("setPosition",[a])},b.prototype.setProps=function(){var a=this,b=document.body.style;a.positionProp=a.options.vertical===!0?"top":"left","top"===a.positionProp?a.$slider.addClass("slick-vertical"):a.$slider.removeClass("slick-vertical"),(void 0!==b.WebkitTransition||void 0!==b.MozTransition||void 0!==b.msTransition)&&a.options.useCSS===!0&&(a.cssTransitions=!0),a.options.fade&&("number"==typeof a.options.zIndex?a.options.zIndex<3&&(a.options.zIndex=3):a.options.zIndex=a.defaults.zIndex),void 0!==b.OTransform&&(a.animType="OTransform",a.transformType="-o-transform",a.transitionType="OTransition",void 0===b.perspectiveProperty&&void 0===b.webkitPerspective&&(a.animType=!1)),void 0!==b.MozTransform&&(a.animType="MozTransform",a.transformType="-moz-transform",a.transitionType="MozTransition",void 0===b.perspectiveProperty&&void 0===b.MozPerspective&&(a.animType=!1)),void 0!==b.webkitTransform&&(a.animType="webkitTransform",a.transformType="-webkit-transform",a.transitionType="webkitTransition",void 0===b.perspectiveProperty&&void 0===b.webkitPerspective&&(a.animType=!1)),void 0!==b.msTransform&&(a.animType="msTransform",a.transformType="-ms-transform",a.transitionType="msTransition",void 0===b.msTransform&&(a.animType=!1)),void 0!==b.transform&&a.animType!==!1&&(a.animType="transform",a.transformType="transform",a.transitionType="transition"),a.transformsEnabled=a.options.useTransform&&null!==a.animType&&a.animType!==!1},b.prototype.setSlideClasses=function(a){var c,d,e,f,b=this;d=b.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),b.$slides.eq(a).addClass("slick-current"),b.options.centerMode===!0?(c=Math.floor(b.options.slidesToShow/2),b.options.infinite===!0&&(a>=c&&a<=b.slideCount-1-c?b.$slides.slice(a-c,a+c+1).addClass("slick-active").attr("aria-hidden","false"):(e=b.options.slidesToShow+a,
vendor: 1,607 bytes, line 1917
1917d.slice(e-c+1,e+c+2).addClass("slick-active").attr("aria-hidden","false")),0===a?d.eq(d.length-1-b.options.slidesToShow).addClass("slick-center"):a===b.slideCount-1&&d.eq(b.options.slidesToShow).addClass("slick-center")),b.$slides.eq(a).addClass("slick-center")):a>=0&&a<=b.slideCount-b.options.slidesToShow?b.$slides.slice(a,a+b.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):d.length<=b.options.slidesToShow?d.addClass("slick-active").attr("aria-hidden","false"):(f=b.slideCount%b.options.slidesToShow,e=b.options.infinite===!0?b.options.slidesToShow+a:a,b.options.slidesToShow==b.options.slidesToScroll&&b.slideCount-a<b.options.slidesToShow?d.slice(e-(b.options.slidesToShow-f),e+f).addClass("slick-active").attr("aria-hidden","false"):d.slice(e,e+b.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false")),"ondemand"===b.options.lazyLoad&&b.lazyLoad()},b.prototype.setupInfinite=function(){var c,d,e,b=this;if(b.options.fade===!0&&(b.options.centerMode=!1),b.options.infinite===!0&&b.options.fade===!1&&(d=null,b.slideCount>b.options.slidesToShow)){for(e=b.options.centerMode===!0?b.options.slidesToShow+1:b.options.slidesToShow,c=b.slideCount;c>b.slideCount-e;c-=1)d=c-1,a(b.$slides[d]).clone(!0).attr("id","").attr("data-slick-index",d-b.slideCount).prependTo(b.$slideTrack).addClass("slick-cloned");for(c=0;e>c;c+=1)d=c,a(b.$slides[d]).clone(!0).attr("id","").attr("data-slick-index",d+b.slideCount).appendTo(b.$slideTrack).addClass("slick-cloned");b.$slideTrack.find(".slick-cloned").find("[id]").each(function(){a(this).attr("id","")})}},b.prototype.
vendor: 8,956 bytes, lines 1917-1948
1917interrupt=function(a){var b=this;a||b.autoPlay(),b.interrupted=a},b.prototype.selectHandler=function(b){var c=this,d=a(b.target).is(".slick-slide")?a(b.target):a(b.target).parents(".slick-slide"),e=parseInt(d.attr("data-slick-index"));return e||(e=0),c.slideCount<=c.options.slidesToShow?(c.setSlideClasses(e),void c.asNavFor(e)):void c.slideHandler(e)},b.prototype.slideHandler=function(a,b,c){var d,e,f,g,j,h=null,i=this;return b=b||!1,i.animating===!0&&i.options.waitForAnimate===!0||i.options.fade===!0&&i.currentSlide===a||i.slideCount<=i.options.slidesToShow?void 0:(b===!1&&i.asNavFor(a),d=a,h=i.getLeft(d),g=i.getLeft(i.currentSlide),i.currentLeft=null===i.swipeLeft?g:i.swipeLeft,i.options.infinite===!1&&i.options.centerMode===!1&&(0>a||a>i.getDotCount()*i.options.slidesToScroll)?void(i.options.fade===!1&&(d=i.currentSlide,c!==!0?i.animateSlide(g,function(){i.postSlide(d)}):i.postSlide(d))):i.options.infinite===!1&&i.options.centerMode===!0&&(0>a||a>i.slideCount-i.options.slidesToScroll)?void(i.options.fade===!1&&(d=i.currentSlide,c!==!0?i.animateSlide(g,function(){i.postSlide(d)}):i.postSlide(d))):(i.options.autoplay&&clearInterval(i.autoPlayTimer),e=0>d?i.slideCount%i.options.slidesToScroll!==0?i.slideCount-i.slideCount%i.options.slidesToScroll:i.slideCount+d:d>=i.slideCount?i.slideCount%i.options.slidesToScroll!==0?0:d-i.slideCount:d,i.animating=!0,i.$slider.trigger("beforeChange",[i,i.currentSlide,e]),f=i.currentSlide,i.currentSlide=e,i.setSlideClasses(i.currentSlide),i.options.asNavFor&&(j=i.getNavTarget(),j=j.slick("getSlick"),j.slideCount<=j.options.slidesToShow&&j.setSlideClasses(i.currentSlide)),i.updateDots(),i.updateArrows(),i.options.fade===!0?(c!==!0?(i.fadeSlideOut(f),i.fadeSlide(e,function(){i.postSlide(e)})):i.postSlide(e),void i.animateHeight()):void(c!==!0?i.animateSlide(h,function(){i.postSlide(e)}):i.postSlide(e))))},b.prototype.startLoad=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.hide(),a.$nextArrow.hide()),a.options.dots===!0&&a.slideCount>a.options.slidesToShow&&a.$dots.hide(),a.$slider.addClass("slick-loading")},b.prototype.swipeDirection=function(){var a,b,c,d,e=this;return a=e.touchObject.startX-e.touchObject.curX,b=e.touchObject.startY-e.touchObject.curY,c=Math.atan2(b,a),d=Math.round(180*c/Math.PI),0>d&&(d=360-Math.abs(d)),45>=d&&d>=0?e.options.rtl===!1?"left":"right":360>=d&&d>=315?e.options.rtl===!1?"left":"right":d>=135&&225>=d?e.options.rtl===!1?"right":"left":e.options.verticalSwiping===!0?d>=35&&135>=d?"down":"up":"vertical"},b.prototype.swipeEnd=function(a){var c,d,b=this;if(b.dragging=!1,b.interrupted=!1,b.shouldClick=b.touchObject.swipeLength>10?!1:!0,void 0===b.touchObject.curX)return!1;if(b.touchObject.edgeHit===!0&&b.$slider.trigger("edge",[b,b.swipeDirection()]),b.touchObject.swipeLength>=b.touchObject.minSwipe){switch(d=b.swipeDirection()){case"left":case"down":c=b.options.swipeToSlide?b.checkNavigable(b.currentSlide+b.getSlideCount()):b.currentSlide+b.getSlideCount(),b.currentDirection=0;break;case"right":case"up":c=b.options.swipeToSlide?b.checkNavigable(b.currentSlide-b.getSlideCount()):b.currentSlide-b.getSlideCount(),b.currentDirection=1}"vertical"!=d&&(b.slideHandler(c),b.touchObject={},b.$slider.trigger("swipe",[b,d]))}else b.touchObject.startX!==b.touchObject.curX&&(b.slideHandler(b.currentSlide),b.touchObject={})},b.prototype.swipeHandler=function(a){var b=this;if(!(b.options.swipe===!1||"ontouchend"in document&&b.options.swipe===!1||b.options.draggable===!1&&-1!==a.type.indexOf("mouse")))switch(b.touchObject.fingerCount=a.originalEvent&&void 0!==a.originalEvent.touches?a.originalEvent.touches.length:1,b.touchObject.minSwipe=b.listWidth/b.options.touchThreshold,b.options.verticalSwiping===!0&&(b.touchObject.minSwipe=b.listHeight/b.options.touchThreshold),a.data.action){case"start":b.swipeStart(a);break;case"move":b.swipeMove(a);break;case"end":b.swipeEnd(a)}},b.prototype.swipeMove=function(a){var d,e,f,g,h,b=this;return h=void 0!==a.originalEvent?a.originalEvent.touches:null,!b.dragging||h&&1!==h.length?!1:(d=b.getLeft(b.currentSlide),b.touchObject.curX=void 0!==h?h[0].pageX:a.clientX,b.touchObject.curY=void 0!==h?h[0].pageY:a.clientY,b.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(b.touchObject.curX-b.touchObject.startX,2))),b.options.verticalSwiping===!0&&(b.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(b.touchObject.curY-b.touchObject.startY,2)))),e=b.swipeDirection(),"vertical"!==e?(void 0!==a.originalEvent&&b.touchObject.swipeLength>4&&a.preventDefault(),g=(b.options.rtl===!1?1:-1)*(b.touchObject.curX>b.touchObject.startX?1:-1),b.options.verticalSwiping===!0&&(g=b.touchObject.curY>b.touchObject.startY?1:-1),f=b.touchObject.swipeLength,b.touchObject.edgeHit=!1,b.options.infinite===!1&&(0===b.currentSlide&&"right"===e||b.currentSlide>=b.getDotCount()&&"left"===e)&&(f=b.touchObject.swipeLength*b.options.edgeFriction,b.touchObject.edgeHit=!0),b.options.vertical===!1?b.swipeLeft=d+f*g:b.swipeLeft=d+f*(b.$list.height()/b.listWidth)*g,b.options.verticalSwiping===!0&&(b.swipeLeft=d+f*g),b.options.fade===!0||b.options.touchMove===!1?!1:b.animating===!0?(b.swipeLeft=null,!1):void b.setCSS(b.swipeLeft)):void 0)},b.prototype.swipeStart=function(a){var c,b=this;return b.interrupted=!0,1!==b.touchObject.fingerCount||b.slideCount<=b.options.slidesToShow?(b.touchObject={},!1):(void 0!==a.originalEvent&&void 0!==a.originalEvent.touches&&(c=a.originalEvent.touches[0]),b.touchObject.startX=b.touchObject.curX=void 0!==c?c.pageX:a.clientX,b.touchObject.startY=b.touchObject.curY=void 0!==c?c.pageY:a.clientY,void(b.dragging=!0))},b.prototype.unfilterSlides=b.prototype.slickUnfilter=function(){var a=this;null!==a.$slidesCache&&(a.unload(),a.$slideTrack.children(this.options.slide).detach(),a.$slidesCache.appendTo(a.$slideTrack),a.reinit())},b.prototype.unload=function(){var b=this;a(".slick-cloned",b.$slider).remove(),b.$dots&&b.$dots.remove(),b.$prevArrow&&b.htmlExpr.test(b.options.prevArrow)&&b.$prevArrow.remove(),b.$nextArrow&&b.htmlExpr.test(b.options.nextArrow)&&b.$nextArrow.remove(),b.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")},b.prototype.unslick=function(a){var b=this;b.$slider.trigger("unslick",[b,a]),b.destroy()},b.prototype.updateArrows=function(){var b,a=this;b=Math.floor(a.options.slidesToShow/2),a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&!a.options.infinite&&(a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),a.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===a.currentSlide?(a.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),a.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):a.currentSlide>=a.slideCount-a.options.slidesToShow&&a.options.centerMode===!1?(a.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):a.currentSlide>=a.slideCount-1&&a.options.centerMode===!0&&(a.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},b.prototype.updateDots=function(){var a=this;null!==a.$dots&&(a.$dots.find("li").removeClass("slick-active").attr("aria-hidden","true"),a.$dots.find("li").eq(Math.floor(a.currentSlide/a.options.slidesToScroll)).addClass("slick-active").attr("aria-hidden","false"))},b.prototype.visibility=function(){var a=this;a.options.autoplay&&(document[a.hidden]?a.interrupted=!0:a.interrupted=!1)},a.fn.slick=function(){var f,g,a=this,c=arguments[0],d=Array.prototype.slice.call(arguments,1),e=a.length;for(f=0;e>f;f++)if("object"==typeof c||"undefined"==typeof c?a[f].slick=new b(a[f],c):g=a[f].slick[c].apply(a[f].slick,d),"undefined"!=typeof g)return g;return a}});/*
1918 * Purl (A JavaScript URL parser) v2.3.1
1919 * Developed and maintanined by Mark Perkins, [email protected]
1920 * Source repository: https://github.com/allmarkedup/jQuery-URL-Parser
1921 * Licensed under an MIT-style license. See https://github.com/allmarkedup/jQuery-URL-Parser/blob/master/LICENSE for details.
1922 */
1923
1924;(function(factory) {
1925    if (typeof define === 'function' && define.amd) {
1926        define(factory);
1927    } else {
1928        window.purl = factory();
1929    }
1930})(function() {
1931
1932    var tag2attr = {
1933            a       : 'href',
1934            img     : 'src',
1935            form    : 'action',
1936            base    : 'href',
1937            script  : 'src',
1938            iframe  : 'src',
1939            link    : 'href',
1940            embed   : 'src',
1941            object  : 'data'
1942        },
1943
1944        key = ['source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'fragment'], // keys available to query
1945
1946        aliases = { 'anchor' : 'fragment' }, // aliases for backwards compatability
1947
1948        parser = {
1949            strict : /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,  //less intuitive, more accurate to the specs
1950            loose :  /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ // more intuitive, fails on relative paths and deviates from specs
1951        },
1952
1953        isint = /^[0-9]+$/;
1954
1955    function parseUri( url, strictMode ) {
1956        var str = decodeURI( url ),
1957        res   = parser[ strictMode || false ? 'strict' : 'loose' ].exec( str ),
1958        uri = { attr : {}, param : {}, seg : {} },
1959        i   = 14;
1960
1961        while ( i-- ) {
1962            uri.attr[ key[i] ] = res[i] || '';
1963        }
1964
1965        // build query and fragment parameters
1966        uri.param['query'] = parseString(uri.attr['query']);
1967        uri.param['fragment'] = parseString(uri.attr['fragment']);
1968
1969        // split path and fragement into segments
1970        uri.seg['path'] = uri.attr.path.replace(/^\/+|\/+$/g,'').split('/');
1971        uri.seg['fragment'] = uri.attr.fragment.replace(/^\/+|\/+$/g,'').split('/');
1972
1973        // compile a 'base' domain attribute
1974        uri.attr['base'] = uri.attr.host ? (uri.attr.protocol ?  uri.attr.protocol+'://'+uri.attr.host : uri.attr.host) + (uri.attr.port ? ':'+uri.attr.port : '') : '';
1975
1976        return uri;
1977    }
1978
1979    function getAttrName( elm ) {
1980        var tn = elm.tagName;
1981        if ( typeof tn !== 'undefined' ) return tag2attr[tn.toLowerCase()];
1982        return tn;
1983    }
1984
1985    function promote(parent, key) {
1986        if (parent[key].length === 0) return parent[key] = {};
1987        var t = {};
1988        for (var i in parent[key]) t[i] = parent[key][i];
1989        parent[key] = t;
1990        return t;
1991    }
1992
1993    function parse(parts, parent, key, val) {
1994        var part = parts.shift();
1995        if (!part) {
1996            if (isArray(parent[key])) {
1997                parent[key].push(val);
1998            } else if ('object' == typeof parent[key]) {
1999                parent[key] = val;
2000            } else if ('undefined' == typeof parent[key]) {
2001                parent[key] = val;
2002            } else {
2003                parent[key] = [parent[key], val];
2004            }
2005        } else {
2006            var obj = parent[key] = parent[key] || [];
2007            if (']' == part) {
2008                if (isArray(obj)) {
2009                    if ('' !== val) obj.push(val);
2010                } else if ('object' == typeof obj) {
2011                    obj[keys(obj).length] = val;
2012                } else {
2013                    obj = parent[key] = [parent[key], val];
2014                }
2015            } else if (~part.indexOf(']')) {
2016                part = part.substr(0, part.length - 1);
2017                if (!isint.test(part) && isArray(obj)) obj = promote(parent, key);
2018                parse(parts, obj, part, val);
2019                // key
2020            } else {
2021                if (!isint.test(part) && isArray(obj)) obj = promote(parent, key);
2022                parse(parts, obj, part, val);
2023            }
2024        }
2025    }
2026
2027    function merge(parent, key, val) {
2028        if (~key.indexOf(']')) {
2029            var parts = key.split('[');
2030            parse(parts, parent, 'base', val);
2031        } else {
2032            if (!isint.test(key) && isArray(parent.base)) {
2033                var t = {};
2034                for (var k in parent.base) t[k] = parent.base[k];
2035                parent.base = t;
2036            }
2037            if (key !== '') {
2038                set(parent.base, key, val);
2039            }
2040        }
2041        return parent;
2042    }
2043
2044    function parseString(str) {
2045        return reduce(String(str).split(/&|;/), function(ret, pair) {
2046            try {
2047                pair = decodeURIComponent(pair.replace(/\+/g, ' '));
2048            } catch(e) {
2049                // ignore
2050            }
2051            var eql = pair.indexOf('='),
2052                brace = lastBraceInKey(pair),
2053                key = pair.substr(0, brace || eql),
2054                val = pair.substr(brace || eql, pair.length);
2055
2056            val = val.substr(val.indexOf('=') + 1, val.length);
2057
2058            if (key === '') {
2059                key = pair;
2060                val = '';
2061            }
2062
2063            return merge(ret, key, val);
2064        }, { base: {} }).base;
2065    }
2066
2067    function set(obj, key, val) {
2068        var v = obj[key];
2069        if (typeof v === 'undefined') {
2070            obj[key] = val;
2071        } else if (isArray(v)) {
2072            v.push(val);
2073        } else {
2074            obj[key] = [v, val];
2075        }
2076    }
2077
2078    function lastBraceInKey(str) {
2079        var len = str.length,
2080            brace,
2081            c;
2082        for (var i = 0; i < len; ++i) {
2083            c = str[i];
2084            if (']' == c) brace = false;
2085            if ('[' == c) brace = true;
2086            if ('=' == c && !brace) return i;
2087        }
2088    }
2089
2090    function reduce(obj, accumulator){
2091        var i = 0,
2092            l = obj.length >> 0,
2093            curr = arguments[2];
2094        while (i < l) {
2095            if (i in obj) curr = accumulator.call(undefined, curr, obj[i], i, obj);
2096            ++i;
2097        }
2098        return curr;
2099    }
2100
2101    function isArray(vArg) {
2102        return Object.prototype.toString.call(vArg) === "[object Array]";
2103    }
2104
2105    function keys(obj) {
2106        var key_array = [];
2107        for ( var prop in obj ) {
2108            if ( obj.hasOwnProperty(prop) ) key_array.push(prop);
2109        }
2110        return key_array;
2111    }
2112
2113    function purl( url, strictMode ) {
2114        if ( arguments.length === 1 && url === true ) {
2115            strictMode = true;
2116            url = undefined;
2117        }
2118        strictMode = strictMode || false;
2119        url = url || window.location.toString();
2120
2121        return {
2122
2123            data : parseUri(url, strictMode),
2124
2125            // get various attributes from the URI
2126            attr : function( attr ) {
2127                attr = aliases[attr] || attr;
2128                return typeof attr !== 'undefined' ? this.data.attr[attr] : this.data.attr;
2129            },
2130
2131            // return query string parameters
2132            param : function( param ) {
2133                return typeof param !== 'undefined' ? this.data.param.query[param] : this.data.param.query;
2134            },
2135
2136            // return fragment parameters
2137            fparam : function( param ) {
2138                return typeof param !== 'undefined' ? this.data.param.fragment[param] : this.data.param.fragment;
2139            },
2140
2141            // return path segments
2142            segment : function( seg ) {
2143                if ( typeof seg === 'undefined' ) {
2144                    return this.data.seg.path;
2145                } else {
2146                    seg = seg < 0 ? this.data.seg.path.length + seg : seg - 1; // negative segments count from the end
2147                    return this.data.seg.path[seg];
2148                }
2149            },
2150
2151            // return fragment segments
2152            fsegment : function( seg ) {
2153                if ( typeof seg === 'undefined' ) {
2154                    return this.data.seg.fragment;
2155                } else {
2156                    seg = seg < 0 ? this.data.seg.fragment.length + seg : seg - 1; // negative segments count from the end
2157                    return this.data.seg.fragment[seg];
2158                }
2159            }
2160
2161        };
2162
2163    }
2164    
2165    purl.jQuery = function($){
2166        if ($ != null) {
2167            $.fn.url = function( strictMode ) {
2168                var url = '';
2169                if ( this.length ) {
2170                    url = $(this).attr( getAttrName(this[0]) ) || '';
2171                }
2172                return purl( url, strictMode );
2173            };
2174
2175            $.url = purl;
2176        }
2177    };
2178
2179    purl.jQuery(window.jQuery);
2180
2181    return purl;
2182
2183});
2184$.widget("ui.search_ui", {
2185
2186    _create: function() {
2187
2188        var me = this;
2189
2190        $(document).on('widgetmanager:loaded', $.proxy(me.init, this));
2191
2192        me.source = null;
2193
2194    },
2195
2196    init: function() {
2197
2198        //after all widget's _create function
2199
2200        var me = this,
2201            inputSearch = $(document).find('.input-search'),
2202            documentWidth = $(document).width(),
2203            element = me.element;
2204
2205        window.onhashchange = $.proxy(me.hashChanged, me);
2206
2207        me.searchOnLoad = (element.data('search-on-load') != undefined) ? element.data('search-on-load') : true;
2208
2209        inputSearch.focus();
2210
2211        $('.global-search__submit').on('click', function(event) {
2212            event.preventDefault();
2213            $(document).trigger('search:doSearch');
2214        });
2215
2216        $(document).on('search:inputChanged search:doSearch', function(event, source) {
2217            if (source) {
2218                me.source = source;
2219            } else {
2220                me.source = null;
2221            }
2222
2223            me.setHash();
2224
2225        });
2226
2227
2228        $('.search__filters__mobile').on('click', function(event) {
2229            event.preventDefault();
2230            me.toggleSearchOptions();
2231        });
2232
2233        $(document).on('search:doSearch', function(event, source) {
2234            me.toggleSearchOptions(true);
2235        });
2236
2237        $('.search__filters__title').on('click', function(event) {
2238            event.preventDefault();
2239            me.toggleSearchSection($(this));
2240        });
2241
2242        var hash = window.location.hash;
2243
2244        if (!hash || hash == '') {
2245
2246            if (!window.location.search) {
2247                me.blankSearchStarted = true;
2248            }
2249
2250            me.setHash();
2251        } else {
2252            me.hashChanged();
2253        }
2254
2255        // This should be ~pagesession, but see https://github.com/zotonic/zotonic/issues/1622
2256        pubzub.subscribe("~session/search/facets", function (topic, msg) {
2257            if (msg.payload) {
2258                me.setFacets(msg.payload);
2259            }
2260        });
2261
2262    },
2263
2264
2265    getWidgets: function() {
2266
2267        var me = this,
2268            widgetEls = $("[class*='do_search_cmp']"),
2269            widgetRefs = []
2270
2271        $.each(widgetEls, function(i, element) {
2272
2273            var classnames = element.className.split(/\s+/),
2274                element = $(element);
2275
2276            $.each(classnames, function(j, classname) {
2277                if (classname.match(/do_search_cmp/)) {
2278
2279                    var widgetName = classname.replace(/^do_/, '');
2280                    widgetRefs.push(element.data('ui-' + widgetName));
2281                }
2282            });
2283        });
2284
2285        return widgetRefs;
2286
2287    },
2288
2289    getMergedValues: function(reset) {
2290
2291        var me = this,
2292            mergedValues = {},
2293            widgetRefs = me.getWidgets();
2294
2295        $.each(widgetRefs, function(i, widget) {
2296
2297            if (!widget.getValues || typeof widget.getValues != 'function') return;
2298
2299            var widgetVals = widget.getValues();
2300
2301            if (widgetVals && Array.isArray(widgetVals) && widgetVals.length > 0) {
2302
2303                $.each(widgetVals, function(j, val) {
2304
2305                    if (!mergedValues[val.type]) {
2306                        if (Array.isArray(val.values)) {
2307                            mergedValues[val.type] = [];
2308                        }
2309                    }
2310
2311                    if (Array.isArray(val.values)) {
2312                        mergedValues[val.type] = mergedValues[val.type].concat(val.values);
2313                    } else {
2314                        mergedValues[val.type] = val.values;
2315                    }
2316
2317                });
2318            }
2319        });
2320
2321        mergedValues.facets = this.getMergedFacets();
2322
2323        return mergedValues;
2324    },
2325
2326    /**
2327     * Get facets (a.k.a. aggregations) to segment the search results by.
2328     */
2329    getMergedFacets: function() {
2330        return this.getWidgets()
2331            .filter(function(widget) {
2332                return typeof widget.getFacets == 'function';
2333            })
2334            .reduce(
2335                function(acc, widget) {
2336                    return widget.getFacets(acc);
2337                },
2338                {}
2339            );
2340    },
2341
2342    setHash: function(force) {
2343
2344        var me = this,
2345            mergedValues = me.getMergedValues();
2346
2347        var json = JSON.stringify(mergedValues);
2348        var hash = encodeURIComponent(json);
2349
2350        window.location.hash = hash;
2351
2352        if (force) {
2353            me.hashChanged();
2354        }
2355    },
2356
2357    hashChanged: function() {
2358
2359        var me = this,
2360            hash = window.location.hash.substring(1, window.location.hash.length);
2361
2362        var json, values;
2363        try {
2364            json = decodeURIComponent(hash);
2365            values = jQuery.parseJSON(json);
2366        } catch {
2367            // Try base64 encoding for backwards compatibility
2368            json = atob(hash);
2369            values = jQuery.parseJSON(json);
2370        }
2371
2372        // When pages link to the search page with certain filters enabled, facets are not present in the hash, so we add them here.
2373        // If they would not be added, they would not be requested from the server and they cannot be displayed.
2374        values.facets = this.getMergedFacets();
2375
2376        $.proxy(me.setWidgetsState(values), me);
2377
2378        if (me.blankSearchStarted && me.searchOnLoad == false) {
2379            return false;
2380         }
2381
2382        $.proxy(me.doSearch(values), me);
2383
2384        $('.search__filters').css('opacity', '1');
2385
2386    },
2387
2388    setWidgetsState: function(values) {
2389
2390        var me = this,
2391            widgets = me.getWidgets();
2392
2393        $.each(widgets, function(i, widget) {
2394
2395            if (widget.setValues && typeof widget.setValues == 'function') {
2396              widget.setValues(values);
2397            }
2398        });
2399    },
2400
2401    setFacets: function(facets) {
2402        if (typeof facets !== 'object') {
2403            facets = JSON.parse(facets);
2404        }
2405
2406        $.each(this.getWidgets(), function(i, widget) {
2407            if (widget.setFacets && typeof widget.setFacets == 'function') {
2408                widget.setFacets(facets);
2409            }
2410        });
2411    },
2412
2413    doSearch: function(values) {
2414        var me = this;
2415        $(document).trigger("search:doSearchWire", {
2416            'values': values
2417        });
2418    },
2419
2420    toggleSearchOptions: function(forceClose) {
2421
2422        var el = $('.search__filters');
2423
2424        if (!forceClose) {
2425            el.toggleClass('is-open');
2426        } else {
2427            el.removeClass('is-open');
2428        }
2429
2430    },
2431
2432    toggleSearchSection: function(title) {
2433        title.closest('.search__filters__section').toggleClass('is-open');
2434    }
2435
2436});
2437$.widget("ui.search", {
2438
2439    _create: function() {
2440
2441        var me = this;
2442
2443        $(document).on('search:doSearchWire', function(event, searchParameters) {
2444
2445            if (!searchParameters.values) {
2446                searchParameters.values = {};
2447            }
2448
2449            z_event('search-' + searchParameters.values.type, searchParameters.values);
2450        });
2451    }
2452});
2453$.widget("ui.search_cmp_input_text", {
2454
2455    _create: function() {
2456
2457        var me = this,
2458            widgetElement = $(me.element);
2459
2460        me.widgetElement = widgetElement;
2461        me.type = 'qs';
2462
2463        me.widgetElement.keypress(function(event) {
2464            if (event.keyCode === 13) {
2465                event.preventDefault();
2466                $(document).trigger('search:inputChanged');
2467            }
2468        });
2469
2470        if (widgetElement.data('instant')) {
2471            var timer = null;
2472
2473            me.widgetElement.on('keyup', function() {
2474                if (timer) clearTimeout(timer);
2475                timer = setTimeout(
2476                    function() {
2477                        $(document).trigger('search:inputChanged')
2478                    },
2479                    300
2480                );
2481            });
2482        }
2483    },
2484
2485    getValues: function() {
2486
2487        var me = this,
2488            value = ($.url().param('qs') != '' && !window.location.hash) ? value = $.url().param('qs') : me.widgetElement.val();
2489
2490        return [{
2491            'type': me.type,
2492            'values': value
2493        }]
2494    },
2495
2496    setValues: function(values) {
2497
2498        var me = this,
2499            widgetValues;
2500
2501        try {
2502           widgetValues = values[me.type];
2503        } catch(e) {}
2504
2505        me.widgetElement.val('');
2506
2507        if (widgetValues) {
2508            me.widgetElement.val(widgetValues);
2509        }
2510    }
2511
2512});
2513$.widget("ui.search_cmp_sort", {
2514
2515    _create: function() {
2516
2517        var me = this,
2518            widgetElement = $(me.element);
2519
2520        me.widgetElement = widgetElement;
2521        me.type = 'sort';
2522
2523        me.widgetElement.on('change', function() {
2524            $(document).trigger('search:inputChanged');
2525        });
2526
2527    },
2528
2529    getValues: function() {
2530
2531        var me = this;
2532
2533        if (me.widgetElement.val()) {
2534             return [{
2535                'type': me.type,
2536                'values': me.widgetElement.val()
2537            }]
2538        }
2539
2540    },
2541
2542    setValues: function(values) {
2543
2544      var me = this,
2545          widgetValues;
2546
2547      try {
2548         widgetValues = values[me.type];
2549      } catch(e) {}
2550
2551      me.widgetElement.val(widgetValues);
2552
2553    }
2554
2555
2556});
2557
2558$.widget("ui.search_cmp_pager", {
2559
2560    _create: function() {
2561
2562        var me = this,
2563            widgetElement = $(me.element);
2564
2565        me.widgetElement = widgetElement,
2566        me.value = null;
2567
2568        me.widgetElement.on('click', 'a', function(event) {
2569
2570           var  matches = $(this).attr('href').match(/page=(\d*)[^\d]/),
2571                page = (matches && matches[1]) ? matches[1] : 1;
2572
2573           me.value = page;
2574
2575           $(document).trigger('search:inputChanged');
2576
2577           event.stopPropagation();
2578           return false;
2579
2580        });
2581
2582    },
2583
2584    getValues: function() {
2585
2586
2587         var me = this,
2588             values;
2589
2590        if (!me.value) return false;
2591
2592        return [{
2593                'type': 'page',
2594                'values': parseInt(me.value)
2595            }
2596        ]
2597    }
2598
2599
2600
2601});
2602$.widget("ui.search_cmp_types", {
2603
2604    _create: function() {
2605
2606        var me = this,
2607            widgetElement = $(me.element);
2608
2609        me.widgetElement = widgetElement;
2610        me.type = 'type';
2611
2612        me.widgetElement.on('click', '.btn--result-option', function() {
2613            var type = $(this).attr('href').replace(/#/, '');
2614            me.setType(type);
2615            $(document).trigger('search:inputChanged');
2616            return false;
2617        });
2618
2619    },
2620
2621    getValues: function() {
2622
2623        var me = this,
2624            el = $('.btn--result-option.is-active');
2625
2626        return [{
2627            'type': me.type,
2628            'values': el.attr('href').replace(/#/, '')
2629        }]
2630    },
2631
2632    setValues: function(values) {
2633
2634        var me = this,
2635            type;
2636
2637        try {
2638            type = (values[me.type]) ? values[me.type] : 'list';
2639        } catch (e) {}
2640
2641        if (type) me.setType(type);
2642
2643    },
2644
2645    setType: function(type) {
2646
2647        var buttonEl = $('[href="#' + type + '"]');
2648
2649        $('.btn--result-option').removeClass('is-active');
2650
2651        buttonEl.addClass('is-active');
2652
2653        $('.search__result__container').hide();
2654        $('#search-' + type).show();
2655        $('#search-' + type).css('visibility', 'visible');
2656
2657    }
2658
2659});
2660(function ($) {
2661   'use strict';
2662
2663    $.widget( "ui.mail_decode", {
2664        _init: function() {
2665            this.init();
2666        },
2667
2668        _decode: function(a) {
2669            // ROT13 : a Caesar cipher
2670            // letter -> letter' such that code(letter') = (code(letter) + 13) modulo 26
2671            return a.replace(/[a-zA-Z]/g, function(c){
2672              return String.fromCharCode((c <= "Z" ? 90 : 122) >= (c = c.charCodeAt(0) + 13) ? c : c - 26);
2673            });
2674        },
2675
2676        _open: function(elm) {
2677            var me = this,
2678                encAddr = elm.attr("address"),
2679                decAddr = me._decode(encAddr),
2680                mailto = "mailto:" + decAddr;
2681
2682            elm[0].setAttribute("href", mailto);
2683        },
2684
2685        init: function() {
2686
2687            var me = this,
2688                element = me.element;
2689
2690            element.on('click', function() {
2691                me._open(element);
2692            });
2693
2694        }
2695    });
2696
2697})(jQuery);
2698(function($) {
2699    'use strict';
2700
2701    $.widget("ui.masthead_map", {
2702
2703        _init: function() {
2704            this.init();
2705        },
2706
2707        init: function() {
2708            var me = this,
2709                element = me.element;
2710
2711            element.on('click', function(){
2712            	element.addClass('is-active');
2713            });
2714
2715        }
2716
2717    });
2718})(jQuery);

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.