(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?factory():typeof define==='function'&&define.amd?define('inert',factory):(factory())}(this,(function(){'use strict';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1;descriptor.configurable=!0;if("value" in descriptor)descriptor.writable=!0;Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor}}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}
var slice=Array.prototype.slice;var matches=Element.prototype.matches||Element.prototype.msMatchesSelector;var _focusableElementsString=['a[href]','area[href]','input:not([disabled])','select:not([disabled])','textarea:not([disabled])','button:not([disabled])','iframe','object','embed','[contenteditable]'].join(',');var InertRoot=function(){function InertRoot(rootElement,inertManager){_classCallCheck(this,InertRoot);this._inertManager=inertManager;this._rootElement=rootElement;this._managedNodes=new Set();if(this._rootElement.hasAttribute('aria-hidden')){this._savedAriaHidden=this._rootElement.getAttribute('aria-hidden')}else{this._savedAriaHidden=null}
this._rootElement.setAttribute('aria-hidden','true');this._makeSubtreeUnfocusable(this._rootElement);this._observer=new MutationObserver(this._onMutation.bind(this));this._observer.observe(this._rootElement,{attributes:!0,childList:!0,subtree:!0})}
_createClass(InertRoot,[{key:'destructor',value:function destructor(){this._observer.disconnect();if(this._rootElement){if(this._savedAriaHidden!==null){this._rootElement.setAttribute('aria-hidden',this._savedAriaHidden)}else{this._rootElement.removeAttribute('aria-hidden')}}
this._managedNodes.forEach(function(inertNode){this._unmanageNode(inertNode.node)},this);this._observer=null;this._rootElement=null;this._managedNodes=null;this._inertManager=null}},{key:'_makeSubtreeUnfocusable',value:function _makeSubtreeUnfocusable(startNode){var _this2=this;composedTreeWalk(startNode,function(node){return _this2._visitNode(node)});var activeElement=document.activeElement;if(!document.body.contains(startNode)){var node=startNode;var root=undefined;while(node){if(node.nodeType===Node.DOCUMENT_FRAGMENT_NODE){root=node;break}
node=node.parentNode}
if(root){activeElement=root.activeElement}}
if(startNode.contains(activeElement)){activeElement.blur();if(activeElement===document.activeElement){document.body.focus()}}}},{key:'_visitNode',value:function _visitNode(node){if(node.nodeType!==Node.ELEMENT_NODE){return}
var element=node;if(element!==this._rootElement&&element.hasAttribute('inert')){this._adoptInertRoot(element)}
if(matches.call(element,_focusableElementsString)||element.hasAttribute('tabindex')){this._manageNode(element)}}},{key:'_manageNode',value:function _manageNode(node){var inertNode=this._inertManager.register(node,this);this._managedNodes.add(inertNode)}},{key:'_unmanageNode',value:function _unmanageNode(node){var inertNode=this._inertManager.deregister(node,this);if(inertNode){this._managedNodes['delete'](inertNode)}}},{key:'_unmanageSubtree',value:function _unmanageSubtree(startNode){var _this3=this;composedTreeWalk(startNode,function(node){return _this3._unmanageNode(node)})}},{key:'_adoptInertRoot',value:function _adoptInertRoot(node){var inertSubroot=this._inertManager.getInertRoot(node);if(!inertSubroot){this._inertManager.setInert(node,!0);inertSubroot=this._inertManager.getInertRoot(node)}
inertSubroot.managedNodes.forEach(function(savedInertNode){this._manageNode(savedInertNode.node)},this)}},{key:'_onMutation',value:function _onMutation(records,self){records.forEach(function(record){var target=record.target;if(record.type==='childList'){slice.call(record.addedNodes).forEach(function(node){this._makeSubtreeUnfocusable(node)},this);slice.call(record.removedNodes).forEach(function(node){this._unmanageSubtree(node)},this)}else if(record.type==='attributes'){if(record.attributeName==='tabindex'){this._manageNode(target)}else if(target!==this._rootElement&&record.attributeName==='inert'&&target.hasAttribute('inert')){this._adoptInertRoot(target);var inertSubroot=this._inertManager.getInertRoot(target);this._managedNodes.forEach(function(managedNode){if(target.contains(managedNode.node)){inertSubroot._manageNode(managedNode.node)}})}}},this)}},{key:'managedNodes',get:function get(){return new Set(this._managedNodes)}},{key:'hasSavedAriaHidden',get:function get(){return this._savedAriaHidden!==null}},{key:'savedAriaHidden',set:function set(ariaHidden){this._savedAriaHidden=ariaHidden},get:function get(){return this._savedAriaHidden}}]);return InertRoot}();var InertNode=function(){function InertNode(node,inertRoot){_classCallCheck(this,InertNode);this._node=node;this._overrodeFocusMethod=!1;this._inertRoots=new Set([inertRoot]);this._savedTabIndex=null;this._destroyed=!1;this.ensureUntabbable()}
_createClass(InertNode,[{key:'destructor',value:function destructor(){this._throwIfDestroyed();if(this._node&&this._node.nodeType===Node.ELEMENT_NODE){var element=this._node;if(this._savedTabIndex!==null){element.setAttribute('tabindex',this._savedTabIndex)}else{element.removeAttribute('tabindex')}
if(this._overrodeFocusMethod){delete element.focus}}
this._node=null;this._inertRoots=null;this._destroyed=!0}},{key:'_throwIfDestroyed',value:function _throwIfDestroyed(){if(this.destroyed){throw new Error('Trying to access destroyed InertNode')}}},{key:'ensureUntabbable',value:function ensureUntabbable(){if(this.node.nodeType!==Node.ELEMENT_NODE){return}
var element=this.node;if(matches.call(element,_focusableElementsString)){if(element.tabIndex===-1&&this.hasSavedTabIndex){return}
if(element.hasAttribute('tabindex')){this._savedTabIndex=element.tabIndex}
element.setAttribute('tabindex','-1');if(element.nodeType===Node.ELEMENT_NODE){element.focus=function(){};this._overrodeFocusMethod=!0}}else if(element.hasAttribute('tabindex')){this._savedTabIndex=element.tabIndex;element.removeAttribute('tabindex')}}},{key:'addInertRoot',value:function addInertRoot(inertRoot){this._throwIfDestroyed();this._inertRoots.add(inertRoot)}},{key:'removeInertRoot',value:function removeInertRoot(inertRoot){this._throwIfDestroyed();this._inertRoots['delete'](inertRoot);if(this._inertRoots.size===0){this.destructor()}}},{key:'destroyed',get:function get(){return(this._destroyed)}},{key:'hasSavedTabIndex',get:function get(){return this._savedTabIndex!==null}},{key:'node',get:function get(){this._throwIfDestroyed();return this._node}},{key:'savedTabIndex',set:function set(tabIndex){this._throwIfDestroyed();this._savedTabIndex=tabIndex},get:function get(){this._throwIfDestroyed();return this._savedTabIndex}}]);return InertNode}();var InertManager=function(){function InertManager(document){_classCallCheck(this,InertManager);if(!document){throw new Error('Missing required argument; InertManager needs to wrap a document.')}
this._document=document;this._managedNodes=new Map();this._inertRoots=new Map();this._observer=new MutationObserver(this._watchForInert.bind(this));addInertStyle(document.head||document.body||document.documentElement);if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',this._onDocumentLoaded.bind(this))}else{this._onDocumentLoaded()}}
_createClass(InertManager,[{key:'setInert',value:function setInert(root,inert){if(inert){if(this._inertRoots.has(root)){return}
var inertRoot=new InertRoot(root,this);root.setAttribute('inert','');this._inertRoots.set(root,inertRoot);if(!this._document.body.contains(root)){var parent=root.parentNode;while(parent){if(parent.nodeType===11){addInertStyle(parent)}
parent=parent.parentNode}}}else{if(!this._inertRoots.has(root)){return}
var _inertRoot=this._inertRoots.get(root);_inertRoot.destructor();this._inertRoots['delete'](root);root.removeAttribute('inert')}}},{key:'getInertRoot',value:function getInertRoot(element){return this._inertRoots.get(element)}},{key:'register',value:function register(node,inertRoot){var inertNode=this._managedNodes.get(node);if(inertNode!==undefined){inertNode.addInertRoot(inertRoot)}else{inertNode=new InertNode(node,inertRoot)}
this._managedNodes.set(node,inertNode);return inertNode}},{key:'deregister',value:function deregister(node,inertRoot){var inertNode=this._managedNodes.get(node);if(!inertNode){return null}
inertNode.removeInertRoot(inertRoot);if(inertNode.destroyed){this._managedNodes['delete'](node)}
return inertNode}},{key:'_onDocumentLoaded',value:function _onDocumentLoaded(){var inertElements=slice.call(this._document.querySelectorAll('[inert]'));inertElements.forEach(function(inertElement){this.setInert(inertElement,!0)},this);this._observer.observe(this._document.body,{attributes:!0,subtree:!0,childList:!0})}},{key:'_watchForInert',value:function _watchForInert(records,self){var _this=this;records.forEach(function(record){switch(record.type){case 'childList':slice.call(record.addedNodes).forEach(function(node){if(node.nodeType!==Node.ELEMENT_NODE){return}
var inertElements=slice.call(node.querySelectorAll('[inert]'));if(matches.call(node,'[inert]')){inertElements.unshift(node)}
inertElements.forEach(function(inertElement){this.setInert(inertElement,!0)},_this)},_this);break;case 'attributes':if(record.attributeName!=='inert'){return}
var target=record.target;var inert=target.hasAttribute('inert');_this.setInert(target,inert);break}},this)}}]);return InertManager}();function composedTreeWalk(node,callback,shadowRootAncestor){if(node.nodeType==Node.ELEMENT_NODE){var element=node;if(callback){callback(element)}
var shadowRoot=element.shadowRoot;if(shadowRoot){composedTreeWalk(shadowRoot,callback,shadowRoot);return}
if(element.localName=='content'){var content=element;var distributedNodes=content.getDistributedNodes?content.getDistributedNodes():[];for(var i=0;i<distributedNodes.length;i++){composedTreeWalk(distributedNodes[i],callback,shadowRootAncestor)}
return}
if(element.localName=='slot'){var slot=element;var _distributedNodes=slot.assignedNodes?slot.assignedNodes({flatten:!0}):[];for(var _i=0;_i<_distributedNodes.length;_i++){composedTreeWalk(_distributedNodes[_i],callback,shadowRootAncestor)}
return}}
var child=node.firstChild;while(child!=null){composedTreeWalk(child,callback,shadowRootAncestor);child=child.nextSibling}}
function addInertStyle(node){if(node.querySelector('style#inert-style')){return}
var style=document.createElement('style');style.setAttribute('id','inert-style');style.textContent='\n'+'[inert] {\n'+'  pointer-events: none;\n'+'  cursor: default;\n'+'}\n'+'\n'+'[inert], [inert] * {\n'+'  user-select: none;\n'+'  -webkit-user-select: none;\n'+'  -moz-user-select: none;\n'+'  -ms-user-select: none;\n'+'}\n';node.appendChild(style)}
var inertManager=new InertManager(document);if(!Element.prototype.hasOwnProperty('inert')){Object.defineProperty(Element.prototype,'inert',{enumerable:!0,get:function get(){return this.hasAttribute('inert')},set:function set(inert){inertManager.setInert(this,inert)}})}})));function applyFocusVisiblePolyfill(scope){var hadKeyboardEvent=!0;var hadFocusVisibleRecently=!1;var hadFocusVisibleRecentlyTimeout=null;var inputTypesAllowlist={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,'datetime-local':!0};function isValidFocusTarget(el){if(el&&el!==document&&el.nodeName!=='HTML'&&el.nodeName!=='BODY'&&'classList' in el&&'contains' in el.classList){return!0}
return!1}
function focusTriggersKeyboardModality(el){var type=el.type;var tagName=el.tagName;if(tagName==='INPUT'&&inputTypesAllowlist[type]&&!el.readOnly){return!0}
if(tagName==='TEXTAREA'&&!el.readOnly){return!0}
if(el.isContentEditable){return!0}
return!1}
function addFocusVisibleClass(el){if(el.classList.contains('focus-visible')){return}
el.classList.add('focus-visible');el.setAttribute('data-focus-visible-added','')}
function removeFocusVisibleClass(el){if(!el.hasAttribute('data-focus-visible-added')){return}
el.classList.remove('focus-visible');el.removeAttribute('data-focus-visible-added')}
function onKeyDown(e){if(e.metaKey||e.altKey||e.ctrlKey){return}
if(isValidFocusTarget(scope.activeElement)){addFocusVisibleClass(scope.activeElement)}
hadKeyboardEvent=!0}
function onPointerDown(e){hadKeyboardEvent=!1}
function onFocus(e){if(!isValidFocusTarget(e.target)){return}
if(hadKeyboardEvent||focusTriggersKeyboardModality(e.target)){addFocusVisibleClass(e.target)}}
function onBlur(e){if(!isValidFocusTarget(e.target)){return}
if(e.target.classList.contains('focus-visible')||e.target.hasAttribute('data-focus-visible-added')){hadFocusVisibleRecently=!0;window.clearTimeout(hadFocusVisibleRecentlyTimeout);hadFocusVisibleRecentlyTimeout=window.setTimeout(function(){hadFocusVisibleRecently=!1},100);removeFocusVisibleClass(e.target)}}
function onVisibilityChange(e){if(document.visibilityState==='hidden'){if(hadFocusVisibleRecently){hadKeyboardEvent=!0}
addInitialPointerMoveListeners()}}
function addInitialPointerMoveListeners(){document.addEventListener('mousemove',onInitialPointerMove);document.addEventListener('mousedown',onInitialPointerMove);document.addEventListener('mouseup',onInitialPointerMove);document.addEventListener('pointermove',onInitialPointerMove);document.addEventListener('pointerdown',onInitialPointerMove);document.addEventListener('pointerup',onInitialPointerMove);document.addEventListener('touchmove',onInitialPointerMove);document.addEventListener('touchstart',onInitialPointerMove);document.addEventListener('touchend',onInitialPointerMove)}
function removeInitialPointerMoveListeners(){document.removeEventListener('mousemove',onInitialPointerMove);document.removeEventListener('mousedown',onInitialPointerMove);document.removeEventListener('mouseup',onInitialPointerMove);document.removeEventListener('pointermove',onInitialPointerMove);document.removeEventListener('pointerdown',onInitialPointerMove);document.removeEventListener('pointerup',onInitialPointerMove);document.removeEventListener('touchmove',onInitialPointerMove);document.removeEventListener('touchstart',onInitialPointerMove);document.removeEventListener('touchend',onInitialPointerMove)}
function onInitialPointerMove(e){if(e.target.nodeName&&e.target.nodeName.toLowerCase()==='html'){return}
hadKeyboardEvent=!1;removeInitialPointerMoveListeners()}
document.addEventListener('keydown',onKeyDown,!0);document.addEventListener('mousedown',onPointerDown,!0);document.addEventListener('pointerdown',onPointerDown,!0);document.addEventListener('touchstart',onPointerDown,!0);document.addEventListener('visibilitychange',onVisibilityChange,!0);addInitialPointerMoveListeners();scope.addEventListener('focus',onFocus,!0);scope.addEventListener('blur',onBlur,!0);if(scope.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&scope.host){scope.host.setAttribute('data-js-focus-visible','')}else if(scope.nodeType===Node.DOCUMENT_NODE){document.documentElement.classList.add('js-focus-visible');document.documentElement.setAttribute('data-js-focus-visible','')}}
if(typeof window!=='undefined'&&typeof document!=='undefined'){window.applyFocusVisiblePolyfill=applyFocusVisiblePolyfill;var event;try{event=new CustomEvent('focus-visible-polyfill-ready')}catch(error){event=document.createEvent('CustomEvent');event.initCustomEvent('focus-visible-polyfill-ready',!1,!1,{})}
window.dispatchEvent(event)}
if(typeof document!=='undefined'){applyFocusVisiblePolyfill(document)}
/*!
 * JavaScript Cookie v2.2.1
 * https://github.com/js-cookie/js-cookie
 *
 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
 * Released under the MIT license
 */
;(function(factory){var registeredInModuleLoader;if(typeof define==='function'&&define.amd){define(factory);registeredInModuleLoader=!0}
if(typeof exports==='object'){module.exports=factory();registeredInModuleLoader=!0}
if(!registeredInModuleLoader){var OldCookies=window.Cookies;var api=window.Cookies=factory();api.noConflict=function(){window.Cookies=OldCookies;return api}}}(function(){function extend(){var i=0;var result={};for(;i<arguments.length;i++){var attributes=arguments[i];for(var key in attributes){result[key]=attributes[key]}}
return result}
function decode(s){return s.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}
function init(converter){function api(){}
function set(key,value,attributes){if(typeof document==='undefined'){return}
attributes=extend({path:'/'},api.defaults,attributes);if(typeof attributes.expires==='number'){attributes.expires=new Date(new Date()*1+attributes.expires*864e+5)}
attributes.expires=attributes.expires?attributes.expires.toUTCString():'';try{var result=JSON.stringify(value);if(/^[\{\[]/.test(result)){value=result}}catch(e){}
value=converter.write?converter.write(value,key):encodeURIComponent(String(value)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent);key=encodeURIComponent(String(key)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var stringifiedAttributes='';for(var attributeName in attributes){if(!attributes[attributeName]){continue}
stringifiedAttributes+='; '+attributeName;if(attributes[attributeName]===!0){continue}
stringifiedAttributes+='='+attributes[attributeName].split(';')[0]}
return(document.cookie=key+'='+value+stringifiedAttributes)}
function get(key,json){if(typeof document==='undefined'){return}
var jar={};var cookies=document.cookie?document.cookie.split('; '):[];var i=0;for(;i<cookies.length;i++){var parts=cookies[i].split('=');var cookie=parts.slice(1).join('=');if(!json&&cookie.charAt(0)==='"'){cookie=cookie.slice(1,-1)}
try{var name=decode(parts[0]);cookie=(converter.read||converter)(cookie,name)||decode(cookie);if(json){try{cookie=JSON.parse(cookie)}catch(e){}}
jar[name]=cookie;if(key===name){break}}catch(e){}}
return key?jar[key]:jar}
api.set=set;api.get=function(key){return get(key,!1)};api.getJSON=function(key){return get(key,!0)};api.remove=function(key,attributes){set(key,'',extend(attributes,{expires:-1}))};api.defaults={};api.withConverter=init;return api}
return init(function(){})}));(function($){$.fn.csCookieBanner=function(options){let settings=$.extend({slideSpeed:250,expireDays:30,cookieName:'cs_cookie_first',language:'de',openOnStart:!1,showCloseButton:!0,closedPosition:'center',useIframes:!0,useIframeOpenModalByClick:!1,useOwnIframeMessageBox:!1,tagManagerLoaded:!1,gtmCookieText:'gtm',useJavaSscriptConfigArray:!1,javaScriptConfigArray:[],pathToGtmScript:'https://www.clickstorm.de/blog/wp-content/plugins/clickstorm-cookie-consent/js/csTagManager.js',pathToConfigJson:'https://www.clickstorm.de/blog/wp-content/plugins/clickstorm-cookie-consent/config/config-cookie-banner.json',gtmArray:['statistics','marketing'],iframeTypes:[{key:'video',cookie_key:'videos_youtube',},{key:'map',cookie_key:'maps_google',},],focusFirstElement:$($('body a:first-of-type')[0]),},options||{});const COOKIE_BANNER_NAME=settings.cookieName;const PLUGIN=this;let setNewFocus=function($newTarget){$newTarget.attr('tabindex','-1');$newTarget.focus();$newTarget.removeAttr('tabindex')};let closeModal=function(){document.querySelector('.cs-cookie__wrapper').classList.add('cs-close-modal');document.body.classList.remove('cs-cookie__open');window.setTimeout(function(){document.querySelector('.cs-cookie__wrapper').style.display='none';document.querySelector('.cs-cookie__wrapper').classList.remove('cs-show-modal')},200,);if(!Cookies.get(COOKIE_BANNER_NAME)){PLUGIN.openCookieLayer()}else{setNewFocus(settings.focusFirstElement)}
const closeCookieBannerEvent=document.createEvent('Event');closeCookieBannerEvent.initEvent('close-cookie-banner',!0,!0);document.dispatchEvent(closeCookieBannerEvent)};PLUGIN.openCookieModal=function(e,d){let cookieWrapper=$('.cs-cookie__wrapper');document.body.classList.add('cs-cookie__open');cookieWrapper.removeAttr('style');cookieWrapper.addClass('cs-show-modal');let $checkbox;if(e&&$(e.target).data('cs-cookie-anchor')){let anchor=$(e.target).data('cs-cookie-anchor');document.querySelector('#'+anchor+'_anchor').classList.add('cs-cookie__switch-label--open');$('#'+anchor+'_anchor').closest('.cs-cookie__checkbox-wrapper').find('.js-toggle-accordion-content').css('display','block');e.preventDefault()}
window.setTimeout(function(){document.querySelector('.cs-cookie__wrapper').classList.remove('cs-close-modal');setNewFocus($('.cs-cookie__box .cs-cookie__button.js-save-all-cookies'));if(e&&$(e.target).data('cs-cookie-key')){$checkbox=$('.js-cookie-inner-checkbox[for="'+$(e.target).data('cs-cookie-key')+'"]');if($checkbox.length){$checkbox.focus()}}},200,)};PLUGIN.openCookieLayer=function(){adjustMarginBottom();$('.js-cookie-layer').fadeIn(250);setNewFocus($('.cs-cookie__button--layer.js-save-all-cookies'))};let closeCookieLayer=function(){if(!Cookies.get(COOKIE_BANNER_NAME)){document.querySelector('body').style.removeProperty('margin-bottom');$('.js-cookie-layer').fadeOut(250)}};let loadTagManager=function(){let elementValues=Cookies.get(COOKIE_BANNER_NAME);if(elementValues&&elementValues.indexOf(settings.gtmCookieText)>-1){let elementValuesArray=elementValues.split('|');for(let i=0;i<elementValuesArray.length;i++){if(elementValuesArray[i]===settings.gtmCookieText){if(window.gtmKey){$.ajax({url:settings.pathToGtmScript,dataType:'script',async:!0,})}}}}};let saveCookieButtonAll=function(){$('.js-cookie-input-checkbox').prop('checked',!0);let saveAll=!0;updateCookie(saveAll);clickIframePrivacy_init();closeModal()};let saveCookieButton=function(){updateCookie();clickIframePrivacy_init();closeModal()};let adjustMarginBottom=function(){let cookieBannerHeight=$('.js-cookie-layer').outerHeight();document.body.style.marginBottom=cookieBannerHeight+'px'};let updateCookie=function(saveAll){let elementValues='';saveAll=saveAll||!1;$('.js-cookie-input-checkbox').each(function(){if(this.checked){elementValues+='|'+this.id;if($(this).data('cs-tag-manager')==='active'&&!settings.tagManagerLoaded){$.ajax({url:settings.pathToGtmScript,dataType:'script',async:!0,});settings.tagManagerLoaded=!0}
if($(this).data('cs-tag-manager')==='active'&&elementValues.indexOf(settings.gtmCookieText)<0){elementValues+='|'+settings.gtmCookieText}}
if(saveAll){$('.js-cookie-toggle-media').prop('checked',!0)}});elementValues+='|';Cookies.set(COOKIE_BANNER_NAME,elementValues,{expires:settings.expireDays,path:'/'});loadExternalFunctions();let updatedCookieBannerEvent=document.createEvent('Event');updatedCookieBannerEvent.initEvent('updatedCookieBanner',!0,!0);document.dispatchEvent(updatedCookieBannerEvent)};let initSetCookies=function(){let elementValues=Cookies.get(COOKIE_BANNER_NAME);if(elementValues){let elementValuesArray=elementValues.split('|');for(let i=0;i<elementValuesArray.length;i++){if(elementValuesArray[i]&&$('#'+elementValuesArray[i])&&elementValuesArray[i]!=='gtm'){$('#'+elementValuesArray[i]).prop('checked',!0)}}}else if(settings.openOnStart){if(settings.useJavaSscriptConfigArray){let isIgnored=getIgnoredUrlStatus(settings.javaScriptConfigArray);if(!isIgnored){$('.cs-cookie__wrapper').addClass('cs-show-modal')}}else{$.getJSON(settings.pathToConfigJson,function(json){let isIgnored=getIgnoredUrlStatus(json);if(!isIgnored){$('.cs-cookie__wrapper').addClass('cs-show-modal')}})}}else{adjustMarginBottom()}};let getIgnoredUrlStatus=function(json){let ignoredUrls=json['default'].ignoredUrls;let isIgnored=!1;if(ignoredUrls){ignoredUrls.forEach(function(item){if(item===window.location.pathname){isIgnored=!0}})}
return isIgnored};PLUGIN.getCookieKeyExist=function(key){let elementValues=Cookies.get(COOKIE_BANNER_NAME);if(elementValues){let elementValuesArray=elementValues.split('|');for(let s=0;s<elementValuesArray.length;s++){if(elementValuesArray[s]==key){return!0}}}
return!1};let getIframeContent=function(typeArray){$.ajax({url:settings.pathToConfigJson,dataType:'json',global:!1,success:function(json){let language=settings.language;let data=json['default'].language[language].iframe[typeArray];$('.js-cookie-iframe-description-'+typeArray).text(data.description);$('.js-cookie-iframe-button-'+typeArray).text(data.button)},})};let clickIframePrivacy_init=function(){for(let i=0;i<settings.iframeTypes.length;i++){let typeArray=settings.iframeTypes[i];let iFrameSelector='js-iframe-privacy-'+typeArray.key;let iFrameMsgSelector='js-privacy-msg-'+typeArray.key;let cookie_exist=PLUGIN.getCookieKeyExist(typeArray.cookie_key);$('iFrame.'+iFrameSelector).each(function(index,value){let $this=$(this);if(!cookie_exist){$this.closest('.iframe').hide();if(settings.useOwnIframeMessageBox){if($('.'+iFrameMsgSelector).length&&$this.parent().find('.'+iFrameMsgSelector).length){$('.'+iFrameMsgSelector).show()}else if(settings.useIframeOpenModalByClick){$this.after('<div class="cs-cookie__no-cookies-box '+iFrameMsgSelector+'">'+'<p class="js-cookie-iframe-description-'+typeArray.key+'"></p>'+'<a href="javascript:;" data-cs-cookie-anchor="externalMedia" data-cs-cookie-key="'+typeArray.key+'" class="cs-cookie__no-cookies-box-button js-cookie-iframe-button-'+typeArray.key+' js-cookie-open-modal"></a>');getIframeContent(typeArray.key)}else{$this.after('<div class="cs-cookie__no-cookies-box '+iFrameMsgSelector+'">'+'<p class="js-cookie-iframe-description-'+typeArray.key+'"></p>'+'<a href="javascript:;" data-cs-cookie-key="'+typeArray.key+'" class="cs-cookie__no-cookies-box-button js-cookie-iframe-button-'+typeArray.key+' js-accept-privacy-button"></a>');getIframeContent(typeArray.key)}}else{$('.'+iFrameMsgSelector).show()}}else{$(this).on('load',function(){$this.closest('.frame-wrapper').removeClass('loading')});$this.attr('src',$this.data('src'));$this.show();$this.closest('.iframe').show();$('.'+iFrameMsgSelector).hide();$this.closest('.frame-wrapper').addClass('loading')}})}};PLUGIN.reinitClickIframePrivacyAndEvents=function(){clickIframePrivacy_init();initOnClickOpenCookieModal()};let clickIframePrivacy_displayIframe=function(event){let type=$(event.target).data('cs-cookie-key');for(let i=0;i<settings.iframeTypes.length;i++){if(type==settings.iframeTypes[i].key){$('#'+settings.iframeTypes[i].cookie_key).prop('checked',!0);saveCookieButton()}}};let createDOMElement=function(tagName,className){let newElement=document.createElement(tagName);newElement.setAttribute('class',className);return newElement};let loadExternalFunctions=function(){let language=settings.language;if(settings.useJavaSscriptConfigArray){let cookies=settings.javaScriptConfigArray['default'].language[language].cookieSettings;executeExternalFunction(cookies)}else{$.getJSON(settings.pathToConfigJson,function(json){let cookies=json['default'].language[language].cookieSettings;executeExternalFunction(cookies)})}};let executeExternalFunction=function(cookies){for(let key in cookies){let elementValues=Cookies.get(COOKIE_BANNER_NAME);if(elementValues&&elementValues.indexOf(key)>-1){if(cookies[key].cookieFunction&&(typeof window[cookies[key].cookieFunction]==='function')){window[cookies[key].cookieFunction]()}}}};let loadSettings=function(){if(settings.useJavaSscriptConfigArray){getSettings(settings.javaScriptConfigArray)}else{$.ajax({dataType:'json',url:settings.pathToConfigJson,global:!1,success:function(json){getSettings(json)},})}};let getSettings=function(cookieConfig){let language=settings.language;let data=cookieConfig['default'].language[language];let cookies=cookieConfig['default'].language[language].cookieSettings;let gtmDomains=cookieConfig['default'].googleTagManagerKey;let cookieWrapper=createDOMElement('div','cs-cookie__wrapper');let cookieBox=createDOMElement('div','cs-cookie__box');cookieWrapper.appendChild(cookieBox);let cookieInner=createDOMElement('div','cs-cookie__inner');cookieBox.appendChild(cookieInner);if(settings.showCloseButton){let cookieCloseButton=createDOMElement('div','cs-cookie__close-modal js-cookie-close-modal');cookieCloseButton.tabIndex=0;cookieInner.appendChild(cookieCloseButton)}
let cookieTitle=createDOMElement('h2','cs-cookie__title');cookieInner.appendChild(cookieTitle);let cookieTitleInner=createDOMElement('span','cs-cookie__title-inner js-cookie-title');cookieTitleInner.innerText=data.content.headline;cookieTitle.appendChild(cookieTitleInner);let cookieDescription=createDOMElement('p','cs-cookie__description js-cookie-content');cookieDescription.textContent=data.content.infoText;cookieInner.appendChild(cookieDescription);let cookieChecklistWrapper=createDOMElement('div','cs-cookie__checklist-wrapper');cookieInner.appendChild(cookieChecklistWrapper);for(let key in cookies){let elementValues=Cookies.get(COOKIE_BANNER_NAME);if(elementValues&&elementValues.indexOf(key)>-1){if(cookies[key].cookieFunction&&(typeof window[cookies[key].cookieFunction]==='function')){window[cookies[key].cookieFunction]()}}
let cookieCheckboxWrapper=createDOMElement('div','cs-cookie__checkbox-wrapper');cookieChecklistWrapper.appendChild(cookieCheckboxWrapper);(key==='essential')?className='cs-cookie__checkbox cs-cookie__checkbox--locked':className='cs-cookie__checkbox';let cookieCheckbox=createDOMElement('div',className);cookieCheckboxWrapper.appendChild(cookieCheckbox);(key==='externalMedia'?className='js-cookie-input-checkbox js-cookie-toggle-media':className='js-cookie-input-checkbox');let cookieInput=createDOMElement('input',className);cookieInput.setAttribute('id',key);cookieInput.type='checkbox';if(key==='essential'){cookieInput.checked=!0;cookieInput.disabled=!0}
if(key==='statistics'){let domainName=window.location.hostname;window.gtmKey=gtmDomains[domainName]}
if(settings.gtmArray.indexOf(key)>-1){cookieInput.setAttribute('data-cs-tag-manager','active')}
cookieCheckbox.appendChild(cookieInput);(key==='externalMedia'?className='cs-cookie__label js-toggle-switch-by-keypress':className='cs-cookie__label');let cookieLabel=createDOMElement('label',className);cookieLabel.setAttribute('for',key);cookieLabel.tabIndex=0;cookieCheckbox.appendChild(cookieLabel);let cookieToggle=createDOMElement('a','cs-cookie__switch-label js-toggle-setting-accordion');cookieToggle.setAttribute('id',key+'_anchor');cookieToggle.href='javascript:;';cookieToggle.innerText=cookies[key].title;cookieCheckbox.appendChild(cookieToggle);let cookieToggleContent=createDOMElement('div','cs-cookie__accordion-content js-toggle-accordion-content');cookieToggleContent.innerText=cookies[key].description;cookieCheckboxWrapper.appendChild(cookieToggleContent);let cookieToggleText=createDOMElement('p','cs-cookie__accordion-text');cookieToggleContent.appendChild(cookieToggleText);if(key==='externalMedia'){for(let media in cookies[key].media){let cookieInnerCheckbox=createDOMElement('div','cs-cookie__checkbox');cookieToggleContent.appendChild(cookieInnerCheckbox);let cookieInnerInput=createDOMElement('input','js-cookie-input-checkbox js-cookie-inner-input-checkbox');cookieInnerInput.setAttribute('id',media);cookieInnerInput.type='checkbox';cookieInnerCheckbox.appendChild(cookieInnerInput);let cookieInnerLabel=createDOMElement('label','cs-cookie__label js-cookie-inner-checkbox');cookieInnerLabel.setAttribute('for',media);cookieInnerLabel.tabIndex=0;cookieInnerCheckbox.appendChild(cookieInnerLabel);let cookieInnerWrapper=createDOMElement('div','cs-cookie__switch-label-inner-wrapper');cookieInnerCheckbox.appendChild(cookieInnerWrapper);let cookieInnerToggle=createDOMElement('span','cs-cookie__switch-label cs-cookie__switch-label--inner');cookieInnerToggle.innerText=cookies[key].media[media];cookieInnerWrapper.appendChild(cookieInnerToggle);let cookieInnerLink=createDOMElement('a','cs-cookie__switch-label-inner-link');cookieInnerLink.href=cookies[key].links[media+'_link'];cookieInnerLink.setAttribute('target','_blank');cookieInnerLink.innerText='('+data.dataProtectionExternalName+')';cookieInnerWrapper.appendChild(cookieInnerLink)}}
if(cookies[key].cookies){let cookieSetting=cookies[key].cookies;for(cookie in cookieSetting){if(!cookieSetting.hasOwnProperty(cookie)){continue}
let cookieWrapper=createDOMElement('div','');cookieToggleContent.appendChild(cookieWrapper);let cookieHTML='<table class="cs-cookie__table"><tbody>';cookieHTML+='<tr><td>'+data.nameTitle+'</td><td><span class="cs-cookie__table-item">'+cookieSetting[cookie].name+'</span> <a href="'+cookieSetting[cookie].link+'" target="_blank" class="cs-cookie__table-link"> ('+data.dataProtectionExternalName+')</a></td></tr>';cookieHTML+='</tbody></table>';cookieWrapper.innerHTML=cookieHTML}}}
let cookieAcceptButton=createDOMElement('button','cs-cookie__button js-save-all-cookies');cookieAcceptButton.innerText=data.buttonAcceptText;cookieInner.appendChild(cookieAcceptButton);let cookieSettingsButton=createDOMElement('button','cs-cookie__button cs-cookie__button--secondary js-save-cookie-settings');cookieSettingsButton.innerText=data.buttonSaveText;cookieInner.appendChild(cookieSettingsButton);let cookieLinkWrapper=createDOMElement('div','cs-cookie__link-wrapper');cookieInner.appendChild(cookieLinkWrapper);let cookieSecurityLink=createDOMElement('a','cs-cookie__link cs-cookie__link--separator js-data-protection-link');cookieSecurityLink.href=data.dataProtectionLink;cookieSecurityLink.innerText=data.dataProtectionName;cookieLinkWrapper.appendChild(cookieSecurityLink);let cookieImprintLink=createDOMElement('a','cs-cookie__link js-data-protection-link');cookieImprintLink.href=data.imprintLink;cookieImprintLink.innerText=data.imprintName;cookieLinkWrapper.appendChild(cookieImprintLink);document.body.appendChild(cookieWrapper);let cookieLayer=createDOMElement('div','cs-cookie-layer cs-cookie-layer--'+settings.closedPosition+' js-cookie-layer');let cookieLayerWrapper=createDOMElement('div','cs-cookie-layer__text-wrapper');cookieLayer.appendChild(cookieLayerWrapper);let cookieLayerText=createDOMElement('div','js-cookie-layer-text cs-cookie-layer__text');cookieLayerText.innerText=data.content.layerInfoText;cookieLayerWrapper.appendChild(cookieLayerText);let cookieLayerAccept=createDOMElement('a','cs-cookie__button cs-cookie__button--layer js-save-all-cookies');cookieLayerAccept.innerText=data.buttonAcceptText;cookieLayerAccept.href='javascript:;';cookieLayerWrapper.appendChild(cookieLayerAccept);let cookieLayerSettings=createDOMElement('a','cs-cookie__button cs-cookie__button--layer cs-cookie__button--secondary js-cookie-open-modal');cookieLayerSettings.innerText=data.buttonDenyText;cookieLayerSettings.href='javascript:;';cookieLayerWrapper.appendChild(cookieLayerSettings);document.body.appendChild(cookieLayer);if(!Cookies.get(COOKIE_BANNER_NAME)&&!settings.openOnStart){$('.js-cookie-layer').show();setNewFocus($('.cs-cookie__button--layer.js-save-all-cookies'))}
initClickEvents();initSetCookies();loadTagManager();if(settings.openOnStart&&!Cookies.get(COOKIE_BANNER_NAME)){$.ajax({url:settings.pathToConfigJson,dataType:'json',global:!1,success:function(json){let isIgnored=getIgnoredUrlStatus(json);if(!isIgnored&&!Cookies.get(COOKIE_BANNER_NAME)){PLUGIN.openCookieModal()}},})}};let initOnClickOpenCookieModal=function(){$('.js-cookie-open-modal').on('click.cookieOpenModal',function(event,data){event.preventDefault();closeCookieLayer();PLUGIN.openCookieModal(event,data)})};let initClickEvents=function(){$('.js-toggle-setting-accordion').on('click',function(){$(this).hasClass('cs-cookie__switch-label--open')?accordionOpen=!0:accordionOpen=!1;$('.js-toggle-setting-accordion').removeClass('cs-cookie__switch-label--open');$('.js-toggle-accordion-content').slideUp(settings.slideSpeed);if(accordionOpen===!1){$(this).addClass('cs-cookie__switch-label--open');$(this).closest('.cs-cookie__checkbox-wrapper').find('.js-toggle-accordion-content').slideDown(settings.slideSpeed)}});$('.js-save-all-cookies').on('click',function(event){event.preventDefault();closeCookieLayer();saveCookieButtonAll()});$('.js-save-cookie-settings').on('click',function(event){event.preventDefault();saveCookieButton()});initOnClickOpenCookieModal();$('.js-cookie-close-modal').on('keypress',function(event,data){if(event.which===13){event.preventDefault();closeModal()}});$('.js-cookie-inner-input-checkbox').on('change',function(){let $this=$(this);let $parentWrapper=$this.closest('.cs-cookie__checkbox-wrapper');let $parentSwitch=$parentWrapper.find('.js-cookie-toggle-media');let $innerSwitches=$parentWrapper.find('.js-cookie-inner-input-checkbox');if($innerSwitches.length===$innerSwitches.filter(':checked').length){$parentSwitch.prop('checked',!0)}else{$parentSwitch.prop('checked',!1)}});$('.cs-cookie__label').on('keypress',function(){$(this).trigger('click');if($(this).hasClass('js-toggle-switch-by-keypress')){let $this=$(this).closest('.cs-cookie__checkbox').find('.js-cookie-toggle-media');if($this.prop('checked')){$this.closest('.cs-cookie__checkbox-wrapper').find('.js-cookie-input-checkbox').prop('checked',!0)}else{$this.closest('.cs-cookie__checkbox-wrapper').find('.js-cookie-input-checkbox').prop('checked',!1)}}});$('.js-cookie-close-modal').on('click',function(event){event.preventDefault();closeModal()});$(window).on('resize',function(){if(!Cookies.get(COOKIE_BANNER_NAME)){adjustMarginBottom()}});$('.js-cookie-toggle-media').on('click',function(){let $this=$(this);if($this.prop('checked')){$this.closest('.cs-cookie__checkbox-wrapper').find('.js-cookie-input-checkbox').prop('checked',!0)}else{$this.closest('.cs-cookie__checkbox-wrapper').find('.js-cookie-input-checkbox').prop('checked',!1)}});$('.js-accept-privacy-button').on('click',function(e){clickIframePrivacy_displayIframe(e)})};loadSettings();initSetCookies();if(settings.useIframes){clickIframePrivacy_init()}
return this}})(jQuery);function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}var _slice=Array.prototype.slice,_slicedToArray=function(){function e(e,t){var i=[],n=!0,r=!1,s=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);n=!0);}catch(l){r=!0,s=l}finally{try{!n&&o["return"]&&o["return"]()}finally{if(r)throw s}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e};!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],t):e.parsley=t(e.jQuery)}(this,function(e){"use strict";function t(e,t){return e.parsleyAdaptedCallback||(e.parsleyAdaptedCallback=function(){var i=Array.prototype.slice.call(arguments,0);i.unshift(this),e.apply(t||T,i)}),e.parsleyAdaptedCallback}function i(e){return 0===e.lastIndexOf(D,0)?e.substr(D.length):e}function n(){var t=this,i=window||global;_extends(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger("input")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on("change.inputevent",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off("input.inputevent",i.data.selector,t.behavesOk).off("change.inputevent",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched="0.0.3";for(var n=["select",'input[type="checkbox"]','input[type="radio"]','input[type="file"]'],r=0;r<n.length;r++){var s=n[r];e(document).on("input.inputevent",s,{selector:s},t.behavesOk).on("change.inputevent",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(".inputevent")}})}var r=1,s={},a={attr:function(e,t,i){var n,r,s,a=new RegExp("^"+t,"i");if("undefined"==typeof i)i={};else for(n in i)i.hasOwnProperty(n)&&delete i[n];if(!e)return i;for(s=e.attributes,n=s.length;n--;)r=s[n],r&&r.specified&&a.test(r.name)&&(i[this.camelize(r.name.slice(t.length))]=this.deserializeValue(r.value));return i},checkAttr:function(e,t,i){return e.hasAttribute(t+i)},setAttr:function(e,t,i,n){e.setAttribute(this.dasherize(t+i),String(n))},generateID:function(){return""+r++},deserializeValue:function(t){var i;try{return t?"true"==t||"false"!=t&&("null"==t?null:isNaN(i=Number(t))?/^[\[\{]/.test(t)?e.parseJSON(t):t:i):t}catch(n){return t}},camelize:function(e){return e.replace(/-+(.)?/g,function(e,t){return t?t.toUpperCase():""})},dasherize:function(e){return e.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()},warn:function(){var e;window.console&&"function"==typeof window.console.warn&&(e=window.console).warn.apply(e,arguments)},warnOnce:function(e){s[e]||(s[e]=!0,this.warn.apply(this,arguments))},_resetWarnings:function(){s={}},trimString:function(e){return e.replace(/^\s+|\s+$/g,"")},parse:{date:function S(e){var t=e.match(/^(\d{4,})-(\d\d)-(\d\d)$/);if(!t)return null;var i=t.map(function(e){return parseInt(e,10)}),n=_slicedToArray(i,4),r=(n[0],n[1]),s=n[2],a=n[3],S=new Date(r,s-1,a);return S.getFullYear()!==r||S.getMonth()+1!==s||S.getDate()!==a?null:S},string:function(e){return e},integer:function(e){return isNaN(e)?null:parseInt(e,10)},number:function(e){if(isNaN(e))throw null;return parseFloat(e)},"boolean":function(e){return!/^\s*false\s*$/i.test(e)},object:function(e){return a.deserializeValue(e)},regexp:function(e){var t="";return/^\/.*\/(?:[gimy]*)$/.test(e)?(t=e.replace(/.*\/([gimy]*)$/,"$1"),e=e.replace(new RegExp("^/(.*?)/"+t+"$"),"$1")):e="^"+e+"$",new RegExp(e,t)}},parseRequirement:function(e,t){var i=this.parse[e||"string"];if(!i)throw'Unknown requirement specification: "'+e+'"';var n=i(t);if(null===n)throw"Requirement is not a "+e+': "'+t+'"';return n},namespaceEvents:function(t,i){return t=this.trimString(t||"").split(/\s+/),t[0]?e.map(t,function(e){return e+"."+i}).join(" "):""},difference:function(t,i){var n=[];return e.each(t,function(e,t){i.indexOf(t)==-1&&n.push(t)}),n},all:function(t){return e.when.apply(e,_toConsumableArray(t).concat([42,42]))},objectCreate:Object.create||function(){var e=function(){};return function(t){if(arguments.length>1)throw Error("Second argument not supported");if("object"!=typeof t)throw TypeError("Argument must be an object");e.prototype=t;var i=new e;return e.prototype=null,i}}(),_SubmitSelector:'input[type="submit"], button:submit'},o={namespace:"data-parsley-",inputs:"input, textarea, select",excluded:"input[type=button], input[type=submit], input[type=reset], input[type=hidden]",priorityEnabled:!0,multiple:null,group:null,uiEnabled:!0,validationThreshold:3,focus:"first",trigger:!1,triggerAfterFailure:"input",errorClass:"parsley-error",successClass:"parsley-success",classHandler:function(e){},errorsContainer:function(e){},errorsWrapper:'<ul class="parsley-errors-list"></ul>',errorTemplate:"<li></li>"},l=function(){this.__id__=a.generateID()};l.prototype={asyncSupport:!0,_pipeAccordingToValidationResult:function(){var t=this,i=function(){var i=e.Deferred();return!0!==t.validationResult&&i.reject(),i.resolve().promise()};return[i,i]},actualizeOptions:function(){return a.attr(this.element,this.options.namespace,this.domOptions),this.parent&&this.parent.actualizeOptions&&this.parent.actualizeOptions(),this},_resetOptions:function(e){this.domOptions=a.objectCreate(this.parent.options),this.options=a.objectCreate(this.domOptions);for(var t in e)e.hasOwnProperty(t)&&(this.options[t]=e[t]);this.actualizeOptions()},_listeners:null,on:function(e,t){this._listeners=this._listeners||{};var i=this._listeners[e]=this._listeners[e]||[];return i.push(t),this},subscribe:function(t,i){e.listenTo(this,t.toLowerCase(),i)},off:function(e,t){var i=this._listeners&&this._listeners[e];if(i)if(t)for(var n=i.length;n--;)i[n]===t&&i.splice(n,1);else delete this._listeners[e];return this},unsubscribe:function(t,i){e.unsubscribeTo(this,t.toLowerCase())},trigger:function(e,t,i){t=t||this;var n,r=this._listeners&&this._listeners[e];if(r)for(var s=r.length;s--;)if(n=r[s].call(t,t,i),n===!1)return n;return!this.parent||this.parent.trigger(e,t,i)},asyncIsValid:function(e,t){return a.warnOnce("asyncIsValid is deprecated; please use whenValid instead"),this.whenValid({group:e,force:t})},_findRelated:function(){return this.options.multiple?e(this.parent.element.querySelectorAll("["+this.options.namespace+'multiple="'+this.options.multiple+'"]')):this.$element}};var u=function(e,t){var i=e.match(/^\s*\[(.*)\]\s*$/);if(!i)throw'Requirement is not an array: "'+e+'"';var n=i[1].split(",").map(a.trimString);if(n.length!==t)throw"Requirement has "+n.length+" values when "+t+" are needed";return n},d=function(e,t,i){var n=null,r={};for(var s in e)if(s){var o=i(s);"string"==typeof o&&(o=a.parseRequirement(e[s],o)),r[s]=o}else n=a.parseRequirement(e[s],t);return[n,r]},h=function(t){e.extend(!0,this,t)};h.prototype={validate:function(e,t){if(this.fn)return arguments.length>3&&(t=[].slice.call(arguments,1,-1)),this.fn(e,t);if(Array.isArray(e)){if(!this.validateMultiple)throw"Validator `"+this.name+"` does not handle multiple values";return this.validateMultiple.apply(this,arguments)}var i=arguments[arguments.length-1];if(this.validateDate&&i._isDateInput())return arguments[0]=a.parse.date(arguments[0]),null!==arguments[0]&&this.validateDate.apply(this,arguments);if(this.validateNumber)return!isNaN(e)&&(arguments[0]=parseFloat(arguments[0]),this.validateNumber.apply(this,arguments));if(this.validateString)return this.validateString.apply(this,arguments);throw"Validator `"+this.name+"` only handles multiple values"},parseRequirements:function(t,i){if("string"!=typeof t)return Array.isArray(t)?t:[t];var n=this.requirementType;if(Array.isArray(n)){for(var r=u(t,n.length),s=0;s<r.length;s++)r[s]=a.parseRequirement(n[s],r[s]);return r}return e.isPlainObject(n)?d(n,t,i):[a.parseRequirement(n,t)]},requirementType:"string",priority:2};var p=function(e,t){this.__class__="ValidatorRegistry",this.locale="en",this.init(e||{},t||{})},c={email:/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,number:/^-?(\d*\.)?\d+(e[-+]?\d+)?$/i,integer:/^-?\d+$/,digits:/^\d+$/,alphanum:/^\w+$/i,date:{test:function(e){return null!==a.parse.date(e)}},url:new RegExp("^(?:(?:https?|ftp)://)?(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:/\\S*)?$","i")};c.range=c.number;var f=function(e){var t=(""+e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0},m=function(e,t){return t.map(a.parse[e])},g=function(e,t){return function(i){for(var n=arguments.length,r=Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.pop(),t.apply(void 0,[i].concat(_toConsumableArray(m(e,r))))}},v=function(e){return{validateDate:g("date",e),validateNumber:g("number",e),requirementType:e.length<=2?"string":["string","string"],priority:30}};p.prototype={init:function(e,t){this.catalog=t,this.validators=_extends({},this.validators);for(var i in e)this.addValidator(i,e[i].fn,e[i].priority);window.Parsley.trigger("parsley:validator:init")},setLocale:function(e){if("undefined"==typeof this.catalog[e])throw new Error(e+" is not available in the catalog");return this.locale=e,this},addCatalog:function(e,t,i){return"object"==typeof t&&(this.catalog[e]=t),!0===i?this.setLocale(e):this},addMessage:function(e,t,i){return"undefined"==typeof this.catalog[e]&&(this.catalog[e]={}),this.catalog[e][t]=i,this},addMessages:function(e,t){for(var i in t)this.addMessage(e,i,t[i]);return this},addValidator:function(e,t,i){if(this.validators[e])a.warn('Validator "'+e+'" is already defined.');else if(o.hasOwnProperty(e))return void a.warn('"'+e+'" is a restricted keyword and is not a valid validator name.');return this._setValidator.apply(this,arguments)},updateValidator:function(e,t,i){return this.validators[e]?this._setValidator.apply(this,arguments):(a.warn('Validator "'+e+'" is not already defined.'),this.addValidator.apply(this,arguments))},removeValidator:function(e){return this.validators[e]||a.warn('Validator "'+e+'" is not defined.'),delete this.validators[e],this},_setValidator:function(e,t,i){"object"!=typeof t&&(t={fn:t,priority:i}),t.validate||(t=new h(t)),this.validators[e]=t;for(var n in t.messages||{})this.addMessage(n,e,t.messages[n]);return this},getErrorMessage:function(e){var t;if("type"===e.name){var i=this.catalog[this.locale][e.name]||{};t=i[e.requirements]}else t=this.formatMessage(this.catalog[this.locale][e.name],e.requirements);return t||this.catalog[this.locale].defaultMessage||this.catalog.en.defaultMessage},formatMessage:function(e,t){if("object"==typeof t){for(var i in t)e=this.formatMessage(e,t[i]);return e}return"string"==typeof e?e.replace(/%s/i,t):""},validators:{notblank:{validateString:function(e){return/\S/.test(e)},priority:2},required:{validateMultiple:function(e){return e.length>0},validateString:function(e){return/\S/.test(e)},priority:512},type:{validateString:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],n=i.step,r=void 0===n?"any":n,s=i.base,a=void 0===s?0:s,o=c[t];if(!o)throw new Error("validator type `"+t+"` is not supported");if(!o.test(e))return!1;if("number"===t&&!/^any$/i.test(r||"")){var l=Number(e),u=Math.max(f(r),f(a));if(f(l)>u)return!1;var d=function(e){return Math.round(e*Math.pow(10,u))};if((d(l)-d(a))%d(r)!=0)return!1}return!0},requirementType:{"":"string",step:"string",base:"number"},priority:256},pattern:{validateString:function(e,t){return t.test(e)},requirementType:"regexp",priority:64},minlength:{validateString:function(e,t){return e.length>=t},requirementType:"integer",priority:30},maxlength:{validateString:function(e,t){return e.length<=t},requirementType:"integer",priority:30},length:{validateString:function(e,t,i){return e.length>=t&&e.length<=i},requirementType:["integer","integer"],priority:30},mincheck:{validateMultiple:function(e,t){return e.length>=t},requirementType:"integer",priority:30},maxcheck:{validateMultiple:function(e,t){return e.length<=t},requirementType:"integer",priority:30},check:{validateMultiple:function(e,t,i){return e.length>=t&&e.length<=i},requirementType:["integer","integer"],priority:30},min:v(function(e,t){return e>=t}),max:v(function(e,t){return e<=t}),range:v(function(e,t,i){return e>=t&&e<=i}),equalto:{validateString:function(t,i){var n=e(i);return n.length?t===n.val():t===i},priority:256}}};var y={},_=function k(e,t,i){for(var n=[],r=[],s=0;s<e.length;s++){for(var a=!1,o=0;o<t.length;o++)if(e[s].assert.name===t[o].assert.name){a=!0;break}a?r.push(e[s]):n.push(e[s])}return{kept:r,added:n,removed:i?[]:k(t,e,!0).added}};y.Form={_actualizeTriggers:function(){var e=this;this.$element.on("submit.Parsley",function(t){e.onSubmitValidate(t)}),this.$element.on("click.Parsley",a._SubmitSelector,function(t){e.onSubmitButton(t)}),!1!==this.options.uiEnabled&&this.element.setAttribute("novalidate","")},focus:function(){if(this._focusedField=null,!0===this.validationResult||"none"===this.options.focus)return null;for(var e=0;e<this.fields.length;e++){var t=this.fields[e];if(!0!==t.validationResult&&t.validationResult.length>0&&"undefined"==typeof t.options.noFocus&&(this._focusedField=t.$element,"first"===this.options.focus))break}return null===this._focusedField?null:this._focusedField.focus()},_destroyUI:function(){this.$element.off(".Parsley")}},y.Field={_reflowUI:function(){if(this._buildUI(),this._ui){var e=_(this.validationResult,this._ui.lastValidationResult);this._ui.lastValidationResult=this.validationResult,this._manageStatusClass(),this._manageErrorsMessages(e),this._actualizeTriggers(),!e.kept.length&&!e.added.length||this._failedOnce||(this._failedOnce=!0,this._actualizeTriggers())}},getErrorsMessages:function(){if(!0===this.validationResult)return[];for(var e=[],t=0;t<this.validationResult.length;t++)e.push(this.validationResult[t].errorMessage||this._getErrorMessage(this.validationResult[t].assert));return e},addError:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=t.message,n=t.assert,r=t.updateClass,s=void 0===r||r;this._buildUI(),this._addError(e,{message:i,assert:n}),s&&this._errorClass()},updateError:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=t.message,n=t.assert,r=t.updateClass,s=void 0===r||r;this._buildUI(),this._updateError(e,{message:i,assert:n}),s&&this._errorClass()},removeError:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=t.updateClass,n=void 0===i||i;this._buildUI(),this._removeError(e),n&&this._manageStatusClass()},_manageStatusClass:function(){this.hasConstraints()&&this.needsValidation()&&!0===this.validationResult?this._successClass():this.validationResult.length>0?this._errorClass():this._resetClass()},_manageErrorsMessages:function(t){if("undefined"==typeof this.options.errorsMessagesDisabled){if("undefined"!=typeof this.options.errorMessage)return t.added.length||t.kept.length?(this._insertErrorWrapper(),0===this._ui.$errorsWrapper.find(".parsley-custom-error-message").length&&this._ui.$errorsWrapper.append(e(this.options.errorTemplate).addClass("parsley-custom-error-message")),this._ui.$errorsWrapper.addClass("filled").find(".parsley-custom-error-message").html(this.options.errorMessage)):this._ui.$errorsWrapper.removeClass("filled").find(".parsley-custom-error-message").remove();for(var i=0;i<t.removed.length;i++)this._removeError(t.removed[i].assert.name);for(i=0;i<t.added.length;i++)this._addError(t.added[i].assert.name,{message:t.added[i].errorMessage,assert:t.added[i].assert});for(i=0;i<t.kept.length;i++)this._updateError(t.kept[i].assert.name,{message:t.kept[i].errorMessage,assert:t.kept[i].assert})}},_addError:function(t,i){var n=i.message,r=i.assert;this._insertErrorWrapper(),this._ui.$errorsWrapper.addClass("filled").append(e(this.options.errorTemplate).addClass("parsley-"+t).html(n||this._getErrorMessage(r)))},_updateError:function(e,t){var i=t.message,n=t.assert;this._ui.$errorsWrapper.addClass("filled").find(".parsley-"+e).html(i||this._getErrorMessage(n))},_removeError:function(e){this._ui.$errorsWrapper.removeClass("filled").find(".parsley-"+e).remove()},_getErrorMessage:function(e){var t=e.name+"Message";return"undefined"!=typeof this.options[t]?window.Parsley.formatMessage(this.options[t],e.requirements):window.Parsley.getErrorMessage(e)},_buildUI:function(){if(!this._ui&&!1!==this.options.uiEnabled){var t={};this.element.setAttribute(this.options.namespace+"id",this.__id__),t.$errorClassHandler=this._manageClassHandler(),t.errorsWrapperId="parsley-id-"+(this.options.multiple?"multiple-"+this.options.multiple:this.__id__),t.$errorsWrapper=e(this.options.errorsWrapper).attr("id",t.errorsWrapperId),t.lastValidationResult=[],t.validationInformationVisible=!1,this._ui=t}},_manageClassHandler:function(){if("string"==typeof this.options.classHandler)return 0===e(this.options.classHandler).length&&ParsleyUtils.warn("No elements found that match the selector `"+this.options.classHandler+"` set in options.classHandler or data-parsley-class-handler"),e(this.options.classHandler);if("function"==typeof this.options.classHandler)var t=this.options.classHandler.call(this,this);return"undefined"!=typeof t&&t.length?t:this._inputHolder()},_inputHolder:function(){return this.options.multiple&&"SELECT"!==this.element.nodeName?this.$element.parent():this.$element},_insertErrorWrapper:function(){var t;if(0!==this._ui.$errorsWrapper.parent().length)return this._ui.$errorsWrapper.parent();if("string"==typeof this.options.errorsContainer){if(e(this.options.errorsContainer).length)return e(this.options.errorsContainer).append(this._ui.$errorsWrapper);a.warn("The errors container `"+this.options.errorsContainer+"` does not exist in DOM")}else"function"==typeof this.options.errorsContainer&&(t=this.options.errorsContainer.call(this,this));return"undefined"!=typeof t&&t.length?t.append(this._ui.$errorsWrapper):this._inputHolder().after(this._ui.$errorsWrapper)},_actualizeTriggers:function(){var e,t=this,i=this._findRelated();i.off(".Parsley"),this._failedOnce?i.on(a.namespaceEvents(this.options.triggerAfterFailure,"Parsley"),function(){t._validateIfNeeded()}):(e=a.namespaceEvents(this.options.trigger,"Parsley"))&&i.on(e,function(e){t._validateIfNeeded(e)})},_validateIfNeeded:function(e){var t=this;e&&/key|input/.test(e.type)&&(!this._ui||!this._ui.validationInformationVisible)&&this.getValue().length<=this.options.validationThreshold||(this.options.debounce?(window.clearTimeout(this._debounced),this._debounced=window.setTimeout(function(){return t.validate()},this.options.debounce)):this.validate())},_resetUI:function(){this._failedOnce=!1,this._actualizeTriggers(),"undefined"!=typeof this._ui&&(this._ui.$errorsWrapper.removeClass("filled").children().remove(),this._resetClass(),this._ui.lastValidationResult=[],this._ui.validationInformationVisible=!1)},_destroyUI:function(){this._resetUI(),"undefined"!=typeof this._ui&&this._ui.$errorsWrapper.remove(),delete this._ui},_successClass:function(){this._ui.validationInformationVisible=!0,this._ui.$errorClassHandler.removeClass(this.options.errorClass).addClass(this.options.successClass)},_errorClass:function(){this._ui.validationInformationVisible=!0,this._ui.$errorClassHandler.removeClass(this.options.successClass).addClass(this.options.errorClass)},_resetClass:function(){this._ui.$errorClassHandler.removeClass(this.options.successClass).removeClass(this.options.errorClass)}};var w=function(t,i,n){this.__class__="Form",this.element=t,this.$element=e(t),this.domOptions=i,this.options=n,this.parent=window.Parsley,this.fields=[],this.validationResult=null},b={pending:null,resolved:!0,rejected:!1};w.prototype={onSubmitValidate:function(e){var t=this;if(!0!==e.parsley){var i=this._submitSource||this.$element.find(a._SubmitSelector)[0];if(this._submitSource=null,this.$element.find(".parsley-synthetic-submit-button").prop("disabled",!0),!i||null===i.getAttribute("formnovalidate")){window.Parsley._remoteCache={};var n=this.whenValidate({event:e});"resolved"===n.state()&&!1!==this._trigger("submit")||(e.stopImmediatePropagation(),e.preventDefault(),"pending"===n.state()&&n.done(function(){t._submit(i)}))}}},onSubmitButton:function(e){this._submitSource=e.currentTarget},_submit:function(t){if(!1!==this._trigger("submit")){if(t){var i=this.$element.find(".parsley-synthetic-submit-button").prop("disabled",!1);0===i.length&&(i=e('<input class="parsley-synthetic-submit-button" type="hidden">').appendTo(this.$element)),i.attr({name:t.getAttribute("name"),value:t.getAttribute("value")})}this.$element.trigger(_extends(e.Event("submit"),{parsley:!0}))}},validate:function(t){if(arguments.length>=1&&!e.isPlainObject(t)){a.warnOnce("Calling validate on a parsley form without passing arguments as an object is deprecated.");var i=_slice.call(arguments),n=i[0],r=i[1],s=i[2];t={group:n,force:r,event:s}}return b[this.whenValidate(t).state()]},whenValidate:function(){var t,i=this,n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],r=n.group,s=n.force,o=n.event;this.submitEvent=o,o&&(this.submitEvent=_extends({},o,{preventDefault:function(){a.warnOnce("Using `this.submitEvent.preventDefault()` is deprecated; instead, call `this.validationResult = false`"),i.validationResult=!1}})),this.validationResult=!0,this._trigger("validate"),this._refreshFields();var l=this._withoutReactualizingFormOptions(function(){return e.map(i.fields,function(e){return e.whenValidate({force:s,group:r})})});return(t=a.all(l).done(function(){i._trigger("success")}).fail(function(){i.validationResult=!1,i.focus(),i._trigger("error")}).always(function(){i._trigger("validated")})).pipe.apply(t,_toConsumableArray(this._pipeAccordingToValidationResult()))},isValid:function(t){if(arguments.length>=1&&!e.isPlainObject(t)){a.warnOnce("Calling isValid on a parsley form without passing arguments as an object is deprecated.");var i=_slice.call(arguments),n=i[0],r=i[1];t={group:n,force:r}}return b[this.whenValid(t).state()]},whenValid:function(){var t=this,i=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=i.group,r=i.force;this._refreshFields();var s=this._withoutReactualizingFormOptions(function(){return e.map(t.fields,function(e){return e.whenValid({group:n,force:r})})});return a.all(s)},reset:function(){for(var e=0;e<this.fields.length;e++)this.fields[e].reset();this._trigger("reset")},destroy:function(){this._destroyUI();for(var e=0;e<this.fields.length;e++)this.fields[e].destroy();this.$element.removeData("Parsley"),this._trigger("destroy")},_refreshFields:function(){return this.actualizeOptions()._bindFields()},_bindFields:function(){var t=this,i=this.fields;return this.fields=[],this.fieldsMappedById={},this._withoutReactualizingFormOptions(function(){t.$element.find(t.options.inputs).not(t.options.excluded).each(function(e,i){var n=new window.Parsley.Factory(i,{},t);if(("Field"===n.__class__||"FieldMultiple"===n.__class__)&&!0!==n.options.excluded){var r=n.__class__+"-"+n.__id__;"undefined"==typeof t.fieldsMappedById[r]&&(t.fieldsMappedById[r]=n,t.fields.push(n))}}),e.each(a.difference(i,t.fields),function(e,t){t.reset()})}),this},_withoutReactualizingFormOptions:function(e){var t=this.actualizeOptions;this.actualizeOptions=function(){return this};var i=e();return this.actualizeOptions=t,i},_trigger:function(e){return this.trigger("form:"+e)}};var F=function(e,t,i,n,r){var s=window.Parsley._validatorRegistry.validators[t],a=new h(s);n=n||e.options[t+"Priority"]||a.priority,r=!0===r,_extends(this,{validator:a,name:t,requirements:i,priority:n,isDomConstraint:r}),this._parseRequirements(e.options)},C=function(e){var t=e[0].toUpperCase();return t+e.slice(1)};F.prototype={validate:function(e,t){var i;return(i=this.validator).validate.apply(i,[e].concat(_toConsumableArray(this.requirementList),[t]))},_parseRequirements:function(e){var t=this;this.requirementList=this.validator.parseRequirements(this.requirements,function(i){return e[t.name+C(i)]})}};var E=function(t,i,n,r){this.__class__="Field",this.element=t,this.$element=e(t),"undefined"!=typeof r&&(this.parent=r),this.options=n,this.domOptions=i,this.constraints=[],this.constraintsByName={},this.validationResult=!0,this._bindConstraints()},A={pending:null,resolved:!0,rejected:!1};E.prototype={validate:function(t){arguments.length>=1&&!e.isPlainObject(t)&&(a.warnOnce("Calling validate on a parsley field without passing arguments as an object is deprecated."),t={options:t});var i=this.whenValidate(t);if(!i)return!0;switch(i.state()){case"pending":return null;case"resolved":return!0;case"rejected":return this.validationResult}},whenValidate:function(){var e,t=this,i=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=i.force,r=i.group;if(this.refreshConstraints(),!r||this._isInGroup(r))return this.value=this.getValue(),this._trigger("validate"),(e=this.whenValid({force:n,value:this.value,_refreshed:!0}).always(function(){t._reflowUI()}).done(function(){t._trigger("success")}).fail(function(){t._trigger("error")}).always(function(){t._trigger("validated")})).pipe.apply(e,_toConsumableArray(this._pipeAccordingToValidationResult()))},hasConstraints:function(){return 0!==this.constraints.length},needsValidation:function(e){return"undefined"==typeof e&&(e=this.getValue()),!(!e.length&&!this._isRequired()&&"undefined"==typeof this.options.validateIfEmpty)},_isInGroup:function(t){return Array.isArray(this.options.group)?-1!==e.inArray(t,this.options.group):this.options.group===t},isValid:function(t){if(arguments.length>=1&&!e.isPlainObject(t)){a.warnOnce("Calling isValid on a parsley field without passing arguments as an object is deprecated.");var i=_slice.call(arguments),n=i[0],r=i[1];t={force:n,value:r}}var s=this.whenValid(t);return!s||A[s.state()]},whenValid:function(){var t=this,i=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=i.force,r=void 0!==n&&n,s=i.value,o=i.group,l=i._refreshed;if(l||this.refreshConstraints(),!o||this._isInGroup(o)){if(this.validationResult=!0,!this.hasConstraints())return e.when();if("undefined"!=typeof s&&null!==s||(s=this.getValue()),!this.needsValidation(s)&&!0!==r)return e.when();var u=this._getGroupedConstraints(),d=[];return e.each(u,function(i,n){var r=a.all(e.map(n,function(e){return t._validateConstraint(s,e)}));if(d.push(r),"rejected"===r.state())return!1}),a.all(d)}},_validateConstraint:function(t,i){var n=this,r=i.validate(t,this);return!1===r&&(r=e.Deferred().reject()),a.all([r]).fail(function(e){n.validationResult instanceof Array||(n.validationResult=[]),n.validationResult.push({assert:i,errorMessage:"string"==typeof e&&e})})},getValue:function(){var e;return e="function"==typeof this.options.value?this.options.value(this):"undefined"!=typeof this.options.value?this.options.value:this.$element.val(),"undefined"==typeof e||null===e?"":this._handleWhitespace(e)},reset:function(){return this._resetUI(),this._trigger("reset")},destroy:function(){this._destroyUI(),this.$element.removeData("Parsley"),this.$element.removeData("FieldMultiple"),this._trigger("destroy")},refreshConstraints:function(){return this.actualizeOptions()._bindConstraints()},addConstraint:function(e,t,i,n){if(window.Parsley._validatorRegistry.validators[e]){var r=new F(this,e,t,i,n);"undefined"!==this.constraintsByName[r.name]&&this.removeConstraint(r.name),this.constraints.push(r),this.constraintsByName[r.name]=r}return this},removeConstraint:function(e){for(var t=0;t<this.constraints.length;t++)if(e===this.constraints[t].name){this.constraints.splice(t,1);break}return delete this.constraintsByName[e],this},updateConstraint:function(e,t,i){return this.removeConstraint(e).addConstraint(e,t,i)},_bindConstraints:function(){for(var e=[],t={},i=0;i<this.constraints.length;i++)!1===this.constraints[i].isDomConstraint&&(e.push(this.constraints[i]),t[this.constraints[i].name]=this.constraints[i]);this.constraints=e,this.constraintsByName=t;for(var n in this.options)this.addConstraint(n,this.options[n],void 0,!0);return this._bindHtml5Constraints()},_bindHtml5Constraints:function(){null!==this.element.getAttribute("required")&&this.addConstraint("required",!0,void 0,!0),null!==this.element.getAttribute("pattern")&&this.addConstraint("pattern",this.element.getAttribute("pattern"),void 0,!0);var e=this.element.getAttribute("min"),t=this.element.getAttribute("max");null!==e&&null!==t?this.addConstraint("range",[e,t],void 0,!0):null!==e?this.addConstraint("min",e,void 0,!0):null!==t&&this.addConstraint("max",t,void 0,!0),null!==this.element.getAttribute("minlength")&&null!==this.element.getAttribute("maxlength")?this.addConstraint("length",[this.element.getAttribute("minlength"),this.element.getAttribute("maxlength")],void 0,!0):null!==this.element.getAttribute("minlength")?this.addConstraint("minlength",this.element.getAttribute("minlength"),void 0,!0):null!==this.element.getAttribute("maxlength")&&this.addConstraint("maxlength",this.element.getAttribute("maxlength"),void 0,!0);var i=this.element.type;return"number"===i?this.addConstraint("type",["number",{step:this.element.getAttribute("step")||"1",base:e||this.element.getAttribute("value")}],void 0,!0):/^(email|url|range|date)$/i.test(i)?this.addConstraint("type",i,void 0,!0):this},_isRequired:function(){return"undefined"!=typeof this.constraintsByName.required&&!1!==this.constraintsByName.required.requirements},_trigger:function(e){return this.trigger("field:"+e)},_handleWhitespace:function(e){return!0===this.options.trimValue&&a.warnOnce('data-parsley-trim-value="true" is deprecated, please use data-parsley-whitespace="trim"'),"squish"===this.options.whitespace&&(e=e.replace(/\s{2,}/g," ")),"trim"!==this.options.whitespace&&"squish"!==this.options.whitespace&&!0!==this.options.trimValue||(e=a.trimString(e)),e},_isDateInput:function(){var e=this.constraintsByName.type;return e&&"date"===e.requirements},_getGroupedConstraints:function(){if(!1===this.options.priorityEnabled)return[this.constraints];for(var e=[],t={},i=0;i<this.constraints.length;i++){var n=this.constraints[i].priority;t[n]||e.push(t[n]=[]),t[n].push(this.constraints[i])}return e.sort(function(e,t){return t[0].priority-e[0].priority}),e}};var x=E,$=function(){this.__class__="FieldMultiple"};$.prototype={addElement:function(e){return this.$elements.push(e),this},refreshConstraints:function(){var t;if(this.constraints=[],"SELECT"===this.element.nodeName)return this.actualizeOptions()._bindConstraints(),this;for(var i=0;i<this.$elements.length;i++)if(e("html").has(this.$elements[i]).length){t=this.$elements[i].data("FieldMultiple").refreshConstraints().constraints;for(var n=0;n<t.length;n++)this.addConstraint(t[n].name,t[n].requirements,t[n].priority,t[n].isDomConstraint)}else this.$elements.splice(i,1);return this},getValue:function(){if("function"==typeof this.options.value)return this.options.value(this);if("undefined"!=typeof this.options.value)return this.options.value;if("INPUT"===this.element.nodeName){if("radio"===this.element.type)return this._findRelated().filter(":checked").val()||"";if("checkbox"===this.element.type){var t=[];return this._findRelated().filter(":checked").each(function(){t.push(e(this).val())}),t}}return"SELECT"===this.element.nodeName&&null===this.$element.val()?[]:this.$element.val()},_init:function(){return this.$elements=[this.$element],this}};var P=function(t,i,n){this.element=t,this.$element=e(t);var r=this.$element.data("Parsley");if(r)return"undefined"!=typeof n&&r.parent===window.Parsley&&(r.parent=n,r._resetOptions(r.options)),"object"==typeof i&&_extends(r.options,i),r;if(!this.$element.length)throw new Error("You must bind Parsley on an existing element.");if("undefined"!=typeof n&&"Form"!==n.__class__)throw new Error("Parent instance must be a Form instance");return this.parent=n||window.Parsley,this.init(i)};P.prototype={init:function(e){return this.__class__="Parsley",this.__version__="2.7.2",this.__id__=a.generateID(),this._resetOptions(e),"FORM"===this.element.nodeName||a.checkAttr(this.element,this.options.namespace,"validate")&&!this.$element.is(this.options.inputs)?this.bind("parsleyForm"):this.isMultiple()?this.handleMultiple():this.bind("parsleyField")},isMultiple:function(){return"radio"===this.element.type||"checkbox"===this.element.type||"SELECT"===this.element.nodeName&&null!==this.element.getAttribute("multiple")},handleMultiple:function(){var t,i,n=this;if(this.options.multiple=this.options.multiple||(t=this.element.getAttribute("name"))||this.element.getAttribute("id"),"SELECT"===this.element.nodeName&&null!==this.element.getAttribute("multiple"))return this.options.multiple=this.options.multiple||this.__id__,this.bind("parsleyFieldMultiple");if(!this.options.multiple)return a.warn("To be bound by Parsley, a radio, a checkbox and a multiple select input must have either a name or a multiple option.",this.$element),this;this.options.multiple=this.options.multiple.replace(/(:|\.|\[|\]|\{|\}|\$)/g,""),t&&e('input[name="'+t+'"]').each(function(e,t){"radio"!==t.type&&"checkbox"!==t.type||t.setAttribute(n.options.namespace+"multiple",n.options.multiple)});for(var r=this._findRelated(),s=0;s<r.length;s++)if(i=e(r.get(s)).data("Parsley"),"undefined"!=typeof i){this.$element.data("FieldMultiple")||i.addElement(this.$element);break}return this.bind("parsleyField",!0),i||this.bind("parsleyFieldMultiple")},bind:function(t,i){var n;switch(t){case"parsleyForm":n=e.extend(new w(this.element,this.domOptions,this.options),new l,window.ParsleyExtend)._bindFields();break;case"parsleyField":n=e.extend(new x(this.element,this.domOptions,this.options,this.parent),new l,window.ParsleyExtend);break;case"parsleyFieldMultiple":n=e.extend(new x(this.element,this.domOptions,this.options,this.parent),new $,new l,window.ParsleyExtend)._init();break;default:throw new Error(t+"is not a supported Parsley type")}return this.options.multiple&&a.setAttr(this.element,this.options.namespace,"multiple",this.options.multiple),"undefined"!=typeof i?(this.$element.data("FieldMultiple",n),n):(this.$element.data("Parsley",n),n._actualizeTriggers(),n._trigger("init"),n)}};var V=e.fn.jquery.split(".");if(parseInt(V[0])<=1&&parseInt(V[1])<8)throw"The loaded version of jQuery is too old. Please upgrade to 1.8.x or better.";V.forEach||a.warn("Parsley requires ES5 to run properly. Please include https://github.com/es-shims/es5-shim");var O=_extends(new l,{element:document,$element:e(document),actualizeOptions:null,_resetOptions:null,Factory:P,version:"2.7.2"});_extends(x.prototype,y.Field,l.prototype),_extends(w.prototype,y.Form,l.prototype),_extends(P.prototype,l.prototype),e.fn.parsley=e.fn.psly=function(t){if(this.length>1){var i=[];return this.each(function(){i.push(e(this).parsley(t))}),i}return e(this).length?new P(this[0],t):void a.warn("You must bind Parsley on an existing element.")},"undefined"==typeof window.ParsleyExtend&&(window.ParsleyExtend={}),O.options=_extends(a.objectCreate(o),window.ParsleyConfig),window.ParsleyConfig=O.options,window.Parsley=window.psly=O,O.Utils=a,window.ParsleyUtils={},e.each(a,function(e,t){"function"==typeof t&&(window.ParsleyUtils[e]=function(){return a.warnOnce("Accessing `window.ParsleyUtils` is deprecated. Use `window.Parsley.Utils` instead."),a[e].apply(a,arguments)})});var M=window.Parsley._validatorRegistry=new p(window.ParsleyConfig.validators,window.ParsleyConfig.i18n);window.ParsleyValidator={},e.each("setLocale addCatalog addMessage addMessages getErrorMessage formatMessage addValidator updateValidator removeValidator".split(" "),function(e,t){window.Parsley[t]=function(){return M[t].apply(M,arguments)},window.ParsleyValidator[t]=function(){var e;return a.warnOnce("Accessing the method '"+t+"' through Validator is deprecated. Simply call 'window.Parsley."+t+"(...)'"),(e=window.Parsley)[t].apply(e,arguments)}}),window.Parsley.UI=y,window.ParsleyUI={removeError:function(e,t,i){var n=!0!==i;return a.warnOnce("Accessing UI is deprecated. Call 'removeError' on the instance directly. Please comment in issue 1073 as to your need to call this method."),e.removeError(t,{updateClass:n})},getErrorsMessages:function(e){return a.warnOnce("Accessing UI is deprecated. Call 'getErrorsMessages' on the instance directly."),e.getErrorsMessages()}},e.each("addError updateError".split(" "),function(e,t){window.ParsleyUI[t]=function(e,i,n,r,s){var o=!0!==s;return a.warnOnce("Accessing UI is deprecated. Call '"+t+"' on the instance directly. Please comment in issue 1073 as to your need to call this method."),e[t](i,{message:n,assert:r,updateClass:o})}}),!1!==window.ParsleyConfig.autoBind&&e(function(){e("[data-parsley-validate]").length&&e("[data-parsley-validate]").parsley()});var T=e({}),R=function(){a.warnOnce("Parsley's pubsub module is deprecated; use the 'on' and 'off' methods on parsley instances or window.Parsley")},D="parsley:";e.listen=function(e,n){var r;if(R(),"object"==typeof arguments[1]&&"function"==typeof arguments[2]&&(r=arguments[1],n=arguments[2]),"function"!=typeof n)throw new Error("Wrong parameters");window.Parsley.on(i(e),t(n,r))},e.listenTo=function(e,n,r){if(R(),!(e instanceof x||e instanceof w))throw new Error("Must give Parsley instance");if("string"!=typeof n||"function"!=typeof r)throw new Error("Wrong parameters");e.on(i(n),t(r))},e.unsubscribe=function(e,t){if(R(),"string"!=typeof e||"function"!=typeof t)throw new Error("Wrong arguments");window.Parsley.off(i(e),t.parsleyAdaptedCallback)},e.unsubscribeTo=function(e,t){if(R(),!(e instanceof x||e instanceof w))throw new Error("Must give Parsley instance");e.off(i(t))},e.unsubscribeAll=function(t){R(),window.Parsley.off(i(t)),e("form,input,textarea,select").each(function(){var n=e(this).data("Parsley");n&&n.off(i(t))})},e.emit=function(e,t){var n;R();var r=t instanceof x||t instanceof w,s=Array.prototype.slice.call(arguments,r?2:1);s.unshift(i(e)),r||(t=window.Parsley),(n=t).trigger.apply(n,_toConsumableArray(s))};e.extend(!0,O,{asyncValidators:{"default":{fn:function(e){return e.status>=200&&e.status<300},url:!1},reverse:{fn:function(e){return e.status<200||e.status>=300},url:!1}},addAsyncValidator:function(e,t,i,n){return O.asyncValidators[e]={fn:t,url:i||!1,options:n||{}},this}}),O.addValidator("remote",{requirementType:{"":"string",validator:"string",reverse:"boolean",options:"object"},validateString:function(t,i,n,r){var s,a,o={},l=n.validator||(!0===n.reverse?"reverse":"default");if("undefined"==typeof O.asyncValidators[l])throw new Error("Calling an undefined async validator: `"+l+"`");i=O.asyncValidators[l].url||i,i.indexOf("{value}")>-1?i=i.replace("{value}",encodeURIComponent(t)):o[r.element.getAttribute("name")||r.element.getAttribute("id")]=t;var u=e.extend(!0,n.options||{},O.asyncValidators[l].options);s=e.extend(!0,{},{url:i,data:o,type:"GET"},u),r.trigger("field:ajaxoptions",r,s),a=e.param(s),"undefined"==typeof O._remoteCache&&(O._remoteCache={});var d=O._remoteCache[a]=O._remoteCache[a]||e.ajax(s),h=function(){var t=O.asyncValidators[l].fn.call(r,d,i,n);return t||(t=e.Deferred().reject()),e.when(t)};return d.then(h,h)},priority:-1}),O.on("form:submit",function(){O._remoteCache={}}),l.prototype.addAsyncValidator=function(){return a.warnOnce("Accessing the method `addAsyncValidator` through an instance is deprecated. Simply call `Parsley.addAsyncValidator(...)`"),O.addAsyncValidator.apply(O,arguments)},O.addMessages("en",{defaultMessage:"This value seems to be invalid.",type:{email:"This value should be a valid email.",url:"This value should be a valid url.",number:"This value should be a valid number.",integer:"This value should be a valid integer.",digits:"This value should be digits.",alphanum:"This value should be alphanumeric."},notblank:"This value should not be blank.",required:"This value is required.",pattern:"This value seems to be invalid.",min:"This value should be greater than or equal to %s.",max:"This value should be lower than or equal to %s.",range:"This value should be between %s and %s.",minlength:"This value is too short. It should have %s characters or more.",maxlength:"This value is too long. It should have %s characters or fewer.",length:"This value length is invalid. It should be between %s and %s characters long.",mincheck:"You must select at least %s choices.",maxcheck:"You must select %s choices or fewer.",check:"You must select between %s and %s choices.",equalto:"This value should be the same."}),O.setLocale("en");var I=new n;I.install();var q=O;return q});function PowermailForm(e){"use strict";this.initialize=function(){t(),a(),i(),r(),o(),n(),f(),l()};var t=function(){e.fn.powermailTabs&&e(".powermail_morestep").each(function(){e(this).powermailTabs()})},a=function(){e("form[data-powermail-ajax]").length&&p()},i=function(){if(e('*[data-powermail-location="prefill"]').length&&navigator.geolocation){e(this);navigator.geolocation.getCurrentPosition(function(t){var a=t.coords.latitude,i=t.coords.longitude,r=C()+"/index.php?eID=powermailEidGetLocation";jQuery.ajax({url:r,data:"lat="+a+"&lng="+i,cache:!1,success:function(t){t&&e('*[data-powermail-location="prefill"]').val(t)}})})}},r=function(){e.fn.datetimepicker&&e(".powermail_date").each(function(){var t=e(this);if("date"===t.prop("type")||"datetime-local"===t.prop("type")||"time"===t.prop("type")){if(!t.data("datepicker-force")){if(e(this).data("date-value")){var a=g(e(this).data("date-value"),e(this).data("datepicker-format"),t.prop("type"));null!==a&&e(this).val(a)}return}t.prop("type","text"),t.val(e(this).data("date-value"))}var i=!0,r=!0;"date"===t.data("datepicker-settings")?r=!1:"time"===t.data("datepicker-settings")&&(i=!1),t.datetimepicker({format:t.data("datepicker-format"),timepicker:r,datepicker:i,lang:"en",i18n:{en:{months:t.data("datepicker-months").split(","),dayOfWeek:t.data("datepicker-days").split(",")}}})})},o=function(){e(".powermail_all_type_password.powermail_all_value").html("********")},n=function(){e.fn.parsley&&e(".powermail_reset").on("click","",function(){e('form[data-parsley-validate="data-parsley-validate"]').parsley().reset()})},l=function(){window.Parsley&&(x(),b())},p=function(){var t,a=!1;e(document).on("submit","form[data-powermail-ajax]",function(i){var r=e(this),o=r.closest(".tx-powermail");r.data("powermail-ajax-uri")&&(t=r.data("powermail-ajax-uri"));var n=r.data("powermail-form");a||(e.ajax({type:"POST",url:r.prop("action"),data:new FormData(r.get(0)),contentType:!1,processData:!1,beforeSend:function(){s(r)},complete:function(){d(r),f(),c(o)},success:function(i){var o=e('*[data-powermail-form="'+n+'"]:first',i);o.length?(e('*[data-powermail-form="'+n+'"]:first').closest(".tx-powermail").html(o),e.fn.powermailTabs&&e(".powermail_morestep").powermailTabs(),e.fn.parsley&&e('form[data-parsley-validate="data-parsley-validate"]').parsley(),w()):(t?D(t):r.submit(),a=!0)}}),i.preventDefault())})},s=function(t){d(t),e(".powermail_submit",t).length?e(".powermail_submit",t).parent().append(y()):t.closest(".tx-powermail").append(y())},d=function(e){e.closest(".tx-powermail").find(".powermail_progressbar").remove()},c=function(t){var a=e.Event("submitted.powermail.form");t.trigger(a)},f=function(){e(".powermail_fieldwrap_file").find(".deleteAllFiles").each(function(){u(e(this).closest(".powermail_fieldwrap_file").find('input[type="file"]'))}),e(".deleteAllFiles").click(function(){m(e(this).closest(".powermail_fieldwrap_file").find('input[type="hidden"]')),e(this).closest("ul").fadeOut(function(){e(this).remove()})})},u=function(e){e.prop("disabled","disabled").addClass("hide").prop("type","hidden")},m=function(e){e.prop("disabled",!1).removeClass("hide").prop("type","file")},w=function(){e("img.powermail_captchaimage").each(function(){var t=h(e(this).prop("src"));e(this).prop("src",t+"?hash="+v(5))})},h=function(e){var t=e.split("?");return t[0]},v=function(e){for(var t="",a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=0;i<e;i++)t+=a.charAt(Math.floor(Math.random()*a.length));return t},g=function(e,t,a){var i=Date.parseDate(e,t);if(null===i)return null;var r=new Date(i),o=r.getFullYear()+"-";o+=("0"+(r.getMonth()+1)).slice(-2)+"-",o+=("0"+r.getDate()).slice(-2);var n=("0"+r.getHours()).slice(-2)+":"+("0"+r.getMinutes()).slice(-2),l=o+"T"+n;return"date"===a?o:"datetime-local"===a?l:"time"===a?n:null},y=function(){return e("<div />").addClass("powermail_progressbar").html(e("<div />").addClass("powermail_progress").html(e("<div />").addClass("powermail_progress_inner")))},_=function(e){for(var t=e.get(0),a=0,i=0;i<t.files.length;i++){var r=t.files[i];r.size>a&&(a=r.size)}return parseInt(a)},x=function(){window.Parsley.addValidator("powermailfilesize",function(t,a){if(a.indexOf(",")!==-1){var i=a.split(","),r=parseInt(i[0]),o=e('*[name="tx_powermail_pi1[field]['+i[1]+'][]"]');if(o.length&&_(o)>r)return!1}return!0},32).addMessage("en","powermailfilesize","Error")},b=function(){window.Parsley.addValidator("powermailfileextensions",function(t,a){var i=e('*[name="tx_powermail_pi1[field]['+a+'][]"]');return!i.length||k(j(t),i.prop("accept"))},32).addMessage("en","powermailfileextensions","Error")},k=function(e,t){return t.indexOf("."+e)!==-1},j=function(e){return e.split(".").pop().toLowerCase()},D=function(e){e.indexOf("http")!==-1?window.location=e:window.location.pathname=e},C=function(){var t;return t=e("base").length>0?jQuery("base").prop("href"):"https:"!=window.location.protocol?"http://"+window.location.hostname:"https://"+window.location.hostname}}jQuery(document).ready(function(e){"use strict";var t=new window.PowermailForm(e);t.initialize()});
/*! lazysizes - v5.3.0 */
!function(e,t){var r;e&&(r=function(){t(e.lazySizes),e.removeEventListener("lazyunveilread",r,!0)},t=t.bind(null,e,e.document),"object"==typeof module&&module.exports?t(require("lazysizes")):"function"==typeof define&&define.amd?define(["lazysizes"],t):e.lazySizes?r():e.addEventListener("lazyunveilread",r,!0))}("undefined"!=typeof window?window:0,function(d,n,p){"use strict";var i,a,s,l,t,r,f,o,c,m,u,y=p.cfg,e=n.createElement("img"),g="sizes"in e&&"srcset"in e,h=/\s+\d+h/g,z=(a=/\s+(\d+)(w|h)\s+(\d+)(w|h)/,s=Array.prototype.forEach,function(){function r(e){var t,r,i=e.getAttribute(y.srcsetAttr);i&&(r=i.match(a))&&((t="w"==r[2]?r[1]/r[3]:r[3]/r[1])&&e.setAttribute("data-aspectratio",t),e.setAttribute(y.srcsetAttr,i.replace(h,"")))}function e(e){var t;e.detail.instance==p&&((t=e.target.parentNode)&&"PICTURE"==t.nodeName&&s.call(t.getElementsByTagName("source"),r),r(e.target))}function t(){i.currentSrc&&n.removeEventListener("lazybeforeunveil",e)}var i=n.createElement("img");n.addEventListener("lazybeforeunveil",e),i.onload=t,i.onerror=t,i.srcset="data:,a 1w 1h",i.complete&&t()});function v(e,t){return e.w-t.w}function w(e,t,r,i){l.push({c:t,u:r,w:+i})}function b(e,t){var r,i=e.getAttribute("srcset")||e.getAttribute(y.srcsetAttr);!i&&t&&(i=e._lazypolyfill?e._lazypolyfill._set:e.getAttribute(y.srcAttr)||e.getAttribute("src")),e._lazypolyfill&&e._lazypolyfill._set==i||(r=o(i||""),t&&e.parentNode&&(r.isPicture="PICTURE"==e.parentNode.nodeName.toUpperCase(),r.isPicture&&d.matchMedia&&(p.aC(e,"lazymatchmedia"),c())),r._set=i,Object.defineProperty(e,"_lazypolyfill",{value:r,writable:!0}))}function A(e){var t,r,i,n,a,s,l,o,c,u=e;if(b(u,!0),(n=u._lazypolyfill).isPicture)for(r=0,i=(t=e.parentNode.getElementsByTagName("source")).length;r<i;r++)if(y.supportsType(t[r].getAttribute("type"),e)&&m(t[r].getAttribute("media"))){u=t[r],b(u),n=u._lazypolyfill;break}return 1<n.length?(s=u.getAttribute("sizes")||"",s=f.test(s)&&parseInt(s,10)||p.gW(e,e.parentNode),n.d=(l=e,o=d.devicePixelRatio||1,c=p.getX&&p.getX(l),Math.min(c||o,2.5,o)),!n.src||!n.w||n.w<s?(n.w=s,a=function(e){for(var t,r,i=e.length,n=e[i-1],a=0;a<i;a++)if((n=e[a]).d=n.w/e.w,n.d>=e.d){!n.cached&&(t=e[a-1])&&t.d>e.d-.13*Math.pow(e.d,2.2)&&(r=Math.pow(t.d-.6,1.6),t.cached&&(t.d+=.15*r),t.d+(n.d-e.d)*r>e.d&&(n=t));break}return n}(n.sort(v)),n.src=a):a=n.src):a=n[0],a}function E(e){var t;g&&e.parentNode&&"PICTURE"!=e.parentNode.nodeName.toUpperCase()||(t=A(e))&&t.u&&e._lazypolyfill.cur!=t.u&&(e._lazypolyfill.cur=t.u,t.cached=!0,e.setAttribute(y.srcAttr,t.u),e.setAttribute("src",t.u))}y.supportsType||(y.supportsType=function(e){return!e}),d.HTMLPictureElement&&g?!p.hasHDescriptorFix&&n.msElementsFromPoint&&(p.hasHDescriptorFix=!0,z()):d.picturefill||y.pf||(y.pf=function(e){var t,r;if(!d.picturefill)for(t=0,r=e.elements.length;t<r;t++)i(e.elements[t])},f=/^\s*\d+\.*\d*px\s*$/,t=/(([^,\s].[^\s]+)\s+(\d+)w)/g,r=/\s/,c=function(){var e,r;function t(){for(var e=0,t=r.length;e<t;e++)i(r[e])}c.init||(c.init=!0,addEventListener("resize",(r=n.getElementsByClassName("lazymatchmedia"),function(){clearTimeout(e),e=setTimeout(t,66)})))},m=function(e){return d.matchMedia?(m=function(e){return!e||(matchMedia(e)||{}).matches})(e):!e},E.parse=o=function(e){return l=[],(e=e.trim()).replace(h,"").replace(t,w),l.length||!e||r.test(e)||l.push({c:e,u:e,w:99}),l},i=E,y.loadedClass&&y.loadingClass&&(u=[],['img[sizes$="px"][srcset].',"picture > img:not([srcset])."].forEach(function(e){u.push(e+y.loadedClass),u.push(e+y.loadingClass)}),y.pf({elements:n.querySelectorAll(u.join(", "))})))});
/*! lazysizes - v5.3.0 */
!function(e){var t=function(u,D,f){"use strict";var k,H;if(function(){var e;var t={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",errorClass:"lazyerror",autosizesClass:"lazyautosizes",fastLoadedClass:"ls-is-cached",iframeLoadMode:0,srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:!0,ricTimeout:0,throttleDelay:125};H=u.lazySizesConfig||u.lazysizesConfig||{};for(e in t){if(!(e in H)){H[e]=t[e]}}}(),!D||!D.getElementsByClassName){return{init:function(){},cfg:H,noSupport:!0}}var O=D.documentElement,i=u.HTMLPictureElement,P="addEventListener",$="getAttribute",q=u[P].bind(u),I=u.setTimeout,U=u.requestAnimationFrame||I,o=u.requestIdleCallback,j=/^picture$/i,r=["load","error","lazyincluded","_lazyloaded"],a={},G=Array.prototype.forEach,J=function(e,t){if(!a[t]){a[t]=new RegExp("(\\s|^)"+t+"(\\s|$)")}return a[t].test(e[$]("class")||"")&&a[t]},K=function(e,t){if(!J(e,t)){e.setAttribute("class",(e[$]("class")||"").trim()+" "+t)}},Q=function(e,t){var a;if(a=J(e,t)){e.setAttribute("class",(e[$]("class")||"").replace(a," "))}},V=function(t,a,e){var i=e?P:"removeEventListener";if(e){V(t,a)}r.forEach(function(e){t[i](e,a)})},X=function(e,t,a,i,r){var n=D.createEvent("Event");if(!a){a={}}a.instance=k;n.initEvent(t,!i,!r);n.detail=a;e.dispatchEvent(n);return n},Y=function(e,t){var a;if(!i&&(a=u.picturefill||H.pf)){if(t&&t.src&&!e[$]("srcset")){e.setAttribute("srcset",t.src)}a({reevaluate:!0,elements:[e]})}else if(t&&t.src){e.src=t.src}},Z=function(e,t){return(getComputedStyle(e,null)||{})[t]},s=function(e,t,a){a=a||e.offsetWidth;while(a<H.minSize&&t&&!e._lazysizesWidth){a=t.offsetWidth;t=t.parentNode}return a},ee=function(){var a,i;var t=[];var r=[];var n=t;var s=function(){var e=n;n=t.length?r:t;a=!0;i=!1;while(e.length){e.shift()()}a=!1};var e=function(e,t){if(a&&!t){e.apply(this,arguments)}else{n.push(e);if(!i){i=!0;(D.hidden?I:U)(s)}}};e._lsFlush=s;return e}(),te=function(a,e){return e?function(){ee(a)}:function(){var e=this;var t=arguments;ee(function(){a.apply(e,t)})}},ae=function(e){var a;var i=0;var r=H.throttleDelay;var n=H.ricTimeout;var t=function(){a=!1;i=f.now();e()};var s=o&&n>49?function(){o(t,{timeout:n});if(n!==H.ricTimeout){n=H.ricTimeout}}:te(function(){I(t)},!0);return function(e){var t;if(e=e===!0){n=33}if(a){return}a=!0;t=r-(f.now()-i);if(t<0){t=0}if(e||t<9){s()}else{I(s,t)}}},ie=function(e){var t,a;var i=99;var r=function(){t=null;e()};var n=function(){var e=f.now()-a;if(e<i){I(n,i-e)}else{(o||r)(r)}};return function(){a=f.now();if(!t){t=I(n,i)}}},e=function(){var v,m,c,h,e;var y,z,g,p,C,b,A;var n=/^img$/i;var d=/^iframe$/i;var E="onscroll"in u&&!/(gle|ing)bot/.test(navigator.userAgent);var _=0;var w=0;var M=0;var N=-1;var L=function(e){M--;if(!e||M<0||!e.target){M=0}};var x=function(e){if(A==null){A=Z(D.body,"visibility")=="hidden"}return A||!(Z(e.parentNode,"visibility")=="hidden"&&Z(e,"visibility")=="hidden")};var W=function(e,t){var a;var i=e;var r=x(e);g-=t;b+=t;p-=t;C+=t;while(r&&(i=i.offsetParent)&&i!=D.body&&i!=O){r=(Z(i,"opacity")||1)>0;if(r&&Z(i,"overflow")!="visible"){a=i.getBoundingClientRect();r=C>a.left&&p<a.right&&b>a.top-1&&g<a.bottom+1}}return r};var t=function(){var e,t,a,i,r,n,s,o,l,u,f,c;var d=k.elements;if((h=H.loadMode)&&M<8&&(e=d.length)){t=0;N++;for(;t<e;t++){if(!d[t]||d[t]._lazyRace){continue}if(!E||k.prematureUnveil&&k.prematureUnveil(d[t])){R(d[t]);continue}if(!(o=d[t][$]("data-expand"))||!(n=o*1)){n=w}if(!u){u=!H.expand||H.expand<1?O.clientHeight>500&&O.clientWidth>500?500:370:H.expand;k._defEx=u;f=u*H.expFactor;c=H.hFac;A=null;if(w<f&&M<1&&N>2&&h>2&&!D.hidden){w=f;N=0}else if(h>1&&N>1&&M<6){w=u}else{w=_}}if(l!==n){y=innerWidth+n*c;z=innerHeight+n;s=n*-1;l=n}a=d[t].getBoundingClientRect();if((b=a.bottom)>=s&&(g=a.top)<=z&&(C=a.right)>=s*c&&(p=a.left)<=y&&(b||C||p||g)&&(H.loadHidden||x(d[t]))&&(m&&M<3&&!o&&(h<3||N<4)||W(d[t],n))){R(d[t]);r=!0;if(M>9){break}}else if(!r&&m&&!i&&M<4&&N<4&&h>2&&(v[0]||H.preloadAfterLoad)&&(v[0]||!o&&(b||C||p||g||d[t][$](H.sizesAttr)!="auto"))){i=v[0]||d[t]}}if(i&&!r){R(i)}}};var a=ae(t);var S=function(e){var t=e.target;if(t._lazyCache){delete t._lazyCache;return}L(e);K(t,H.loadedClass);Q(t,H.loadingClass);V(t,B);X(t,"lazyloaded")};var i=te(S);var B=function(e){i({target:e.target})};var T=function(e,t){var a=e.getAttribute("data-load-mode")||H.iframeLoadMode;if(a==0){e.contentWindow.location.replace(t)}else if(a==1){e.src=t}};var F=function(e){var t;var a=e[$](H.srcsetAttr);if(t=H.customMedia[e[$]("data-media")||e[$]("media")]){e.setAttribute("media",t)}if(a){e.setAttribute("srcset",a)}};var s=te(function(t,e,a,i,r){var n,s,o,l,u,f;if(!(u=X(t,"lazybeforeunveil",e)).defaultPrevented){if(i){if(a){K(t,H.autosizesClass)}else{t.setAttribute("sizes",i)}}s=t[$](H.srcsetAttr);n=t[$](H.srcAttr);if(r){o=t.parentNode;l=o&&j.test(o.nodeName||"")}f=e.firesLoad||"src"in t&&(s||n||l);u={target:t};K(t,H.loadingClass);if(f){clearTimeout(c);c=I(L,2500);V(t,B,!0)}if(l){G.call(o.getElementsByTagName("source"),F)}if(s){t.setAttribute("srcset",s)}else if(n&&!l){if(d.test(t.nodeName)){T(t,n)}else{t.src=n}}if(r&&(s||l)){Y(t,{src:n})}}if(t._lazyRace){delete t._lazyRace}Q(t,H.lazyClass);ee(function(){var e=t.complete&&t.naturalWidth>1;if(!f||e){if(e){K(t,H.fastLoadedClass)}S(u);t._lazyCache=!0;I(function(){if("_lazyCache"in t){delete t._lazyCache}},9)}if(t.loading=="lazy"){M--}},!0)});var R=function(e){if(e._lazyRace){return}var t;var a=n.test(e.nodeName);var i=a&&(e[$](H.sizesAttr)||e[$]("sizes"));var r=i=="auto";if((r||!m)&&a&&(e[$]("src")||e.srcset)&&!e.complete&&!J(e,H.errorClass)&&J(e,H.lazyClass)){return}t=X(e,"lazyunveilread").detail;if(r){re.updateElem(e,!0,e.offsetWidth)}e._lazyRace=!0;M++;s(e,t,r,i,a)};var r=ie(function(){H.loadMode=3;a()});var o=function(){if(H.loadMode==3){H.loadMode=2}r()};var l=function(){if(m){return}if(f.now()-e<999){I(l,999);return}m=!0;H.loadMode=3;a();q("scroll",o,!0)};return{_:function(){e=f.now();k.elements=D.getElementsByClassName(H.lazyClass);v=D.getElementsByClassName(H.lazyClass+" "+H.preloadClass);q("scroll",a,!0);q("resize",a,!0);q("pageshow",function(e){if(e.persisted){var t=D.querySelectorAll("."+H.loadingClass);if(t.length&&t.forEach){U(function(){t.forEach(function(e){if(e.complete){R(e)}})})}}});if(u.MutationObserver){new MutationObserver(a).observe(O,{childList:!0,subtree:!0,attributes:!0})}else{O[P]("DOMNodeInserted",a,!0);O[P]("DOMAttrModified",a,!0);setInterval(a,999)}q("hashchange",a,!0);["focus","mouseover","click","load","transitionend","animationend"].forEach(function(e){D[P](e,a,!0)});if(/d$|^c/.test(D.readyState)){l()}else{q("load",l);D[P]("DOMContentLoaded",a);I(l,2e4)}if(k.elements.length){t();ee._lsFlush()}else{a()}},checkElems:a,unveil:R,_aLSL:o}}(),re=function(){var a;var n=te(function(e,t,a,i){var r,n,s;e._lazysizesWidth=i;i+="px";e.setAttribute("sizes",i);if(j.test(t.nodeName||"")){r=t.getElementsByTagName("source");for(n=0,s=r.length;n<s;n++){r[n].setAttribute("sizes",i)}}if(!a.detail.dataAttr){Y(e,a.detail)}});var i=function(e,t,a){var i;var r=e.parentNode;if(r){a=s(e,r,a);i=X(e,"lazybeforesizes",{width:a,dataAttr:!!t});if(!i.defaultPrevented){a=i.detail.width;if(a&&a!==e._lazysizesWidth){n(e,r,i,a)}}}};var e=function(){var e;var t=a.length;if(t){e=0;for(;e<t;e++){i(a[e])}}};var t=ie(e);return{_:function(){a=D.getElementsByClassName(H.autosizesClass);q("resize",t)},checkElems:t,updateElem:i}}(),t=function(){if(!t.i&&D.getElementsByClassName){t.i=!0;re._();e._()}};return I(function(){H.init&&t()}),k={cfg:H,autoSizer:re,loader:e,init:t,uP:Y,aC:K,rC:Q,hC:J,fire:X,gW:s,rAF:ee}}(e,e.document,Date);e.lazySizes=t,"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:{});
/*!
 * SelectWoo 1.0.10
 * https://github.com/woocommerce/selectWoo
 *
 * Released under the MIT license
 * https://github.com/woocommerce/selectWoo/blob/master/LICENSE.md
 */
(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory)}else if(typeof module==='object'&&module.exports){module.exports=function(root,jQuery){if(jQuery===undefined){if(typeof window!=='undefined'){jQuery=require('jquery')}else{jQuery=require('jquery')(root)}}
factory(jQuery);return jQuery}}else{factory(jQuery)}}(function(jQuery){var S2=(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd){var S2=jQuery.fn.select2.amd}
var S2;(function(){if(!S2||!S2.requirejs){if(!S2){S2={}}else{require=S2}/**
       * @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
       * Released under MIT license, http://github.com/requirejs/almond/LICENSE
       */
var requirejs,require,define;(function(undef){var main,req,makeMap,handlers,defined={},waiting={},config={},defining={},hasOwn=Object.prototype.hasOwnProperty,aps=[].slice,jsSuffixRegExp=/\.js$/;function hasProp(obj,prop){return hasOwn.call(obj,prop)}
function normalize(name,baseName){var nameParts,nameSegment,mapValue,foundMap,lastIndex,foundI,foundStarMap,starI,i,j,part,normalizedBaseParts,baseParts=baseName&&baseName.split("/"),map=config.map,starMap=(map&&map['*'])||{};if(name){name=name.split('/');lastIndex=name.length-1;if(config.nodeIdCompat&&jsSuffixRegExp.test(name[lastIndex])){name[lastIndex]=name[lastIndex].replace(jsSuffixRegExp,'')}
if(name[0].charAt(0)==='.'&&baseParts){normalizedBaseParts=baseParts.slice(0,baseParts.length-1);name=normalizedBaseParts.concat(name)}
for(i=0;i<name.length;i++){part=name[i];if(part==='.'){name.splice(i,1);i-=1}else if(part==='..'){if(i===0||(i===1&&name[2]==='..')||name[i-1]==='..'){continue}else if(i>0){name.splice(i-1,2);i-=2}}}
name=name.join('/')}
if((baseParts||starMap)&&map){nameParts=name.split('/');for(i=nameParts.length;i>0;i-=1){nameSegment=nameParts.slice(0,i).join("/");if(baseParts){for(j=baseParts.length;j>0;j-=1){mapValue=map[baseParts.slice(0,j).join('/')];if(mapValue){mapValue=mapValue[nameSegment];if(mapValue){foundMap=mapValue;foundI=i;break}}}}
if(foundMap){break}
if(!foundStarMap&&starMap&&starMap[nameSegment]){foundStarMap=starMap[nameSegment];starI=i}}
if(!foundMap&&foundStarMap){foundMap=foundStarMap;foundI=starI}
if(foundMap){nameParts.splice(0,foundI,foundMap);name=nameParts.join('/')}}
return name}
function makeRequire(relName,forceSync){return function(){var args=aps.call(arguments,0);if(typeof args[0]!=='string'&&args.length===1){args.push(null)}
return req.apply(undef,args.concat([relName,forceSync]))}}
function makeNormalize(relName){return function(name){return normalize(name,relName)}}
function makeLoad(depName){return function(value){defined[depName]=value}}
function callDep(name){if(hasProp(waiting,name)){var args=waiting[name];delete waiting[name];defining[name]=!0;main.apply(undef,args)}
if(!hasProp(defined,name)&&!hasProp(defining,name)){throw new Error('No '+name)}
return defined[name]}
function splitPrefix(name){var prefix,index=name?name.indexOf('!'):-1;if(index>-1){prefix=name.substring(0,index);name=name.substring(index+1,name.length)}
return[prefix,name]}
function makeRelParts(relName){return relName?splitPrefix(relName):[]}
makeMap=function(name,relParts){var plugin,parts=splitPrefix(name),prefix=parts[0],relResourceName=relParts[1];name=parts[1];if(prefix){prefix=normalize(prefix,relResourceName);plugin=callDep(prefix)}
if(prefix){if(plugin&&plugin.normalize){name=plugin.normalize(name,makeNormalize(relResourceName))}else{name=normalize(name,relResourceName)}}else{name=normalize(name,relResourceName);parts=splitPrefix(name);prefix=parts[0];name=parts[1];if(prefix){plugin=callDep(prefix)}}
return{f:prefix?prefix+'!'+name:name,n:name,pr:prefix,p:plugin}};function makeConfig(name){return function(){return(config&&config.config&&config.config[name])||{}}}
handlers={require:function(name){return makeRequire(name)},exports:function(name){var e=defined[name];if(typeof e!=='undefined'){return e}else{return(defined[name]={})}},module:function(name){return{id:name,uri:'',exports:defined[name],config:makeConfig(name)}}};main=function(name,deps,callback,relName){var cjsModule,depName,ret,map,i,relParts,args=[],callbackType=typeof callback,usingExports;relName=relName||name;relParts=makeRelParts(relName);if(callbackType==='undefined'||callbackType==='function'){deps=!deps.length&&callback.length?['require','exports','module']:deps;for(i=0;i<deps.length;i+=1){map=makeMap(deps[i],relParts);depName=map.f;if(depName==="require"){args[i]=handlers.require(name)}else if(depName==="exports"){args[i]=handlers.exports(name);usingExports=!0}else if(depName==="module"){cjsModule=args[i]=handlers.module(name)}else if(hasProp(defined,depName)||hasProp(waiting,depName)||hasProp(defining,depName)){args[i]=callDep(depName)}else if(map.p){map.p.load(map.n,makeRequire(relName,!0),makeLoad(depName),{});args[i]=defined[depName]}else{throw new Error(name+' missing '+depName)}}
ret=callback?callback.apply(defined[name],args):undefined;if(name){if(cjsModule&&cjsModule.exports!==undef&&cjsModule.exports!==defined[name]){defined[name]=cjsModule.exports}else if(ret!==undef||!usingExports){defined[name]=ret}}}else if(name){defined[name]=callback}};requirejs=require=req=function(deps,callback,relName,forceSync,alt){if(typeof deps==="string"){if(handlers[deps]){return handlers[deps](callback)}
return callDep(makeMap(deps,makeRelParts(callback)).f)}else if(!deps.splice){config=deps;if(config.deps){req(config.deps,config.callback)}
if(!callback){return}
if(callback.splice){deps=callback;callback=relName;relName=null}else{deps=undef}}
callback=callback||function(){};if(typeof relName==='function'){relName=forceSync;forceSync=alt}
if(forceSync){main(undef,deps,callback,relName)}else{setTimeout(function(){main(undef,deps,callback,relName)},4)}
return req};req.config=function(cfg){return req(cfg)};requirejs._defined=defined;define=function(name,deps,callback){if(typeof name!=='string'){throw new Error('See almond README: incorrect module build, no module name')}
if(!deps.splice){callback=deps;deps=[]}
if(!hasProp(defined,name)&&!hasProp(waiting,name)){waiting[name]=[name,deps,callback]}};define.amd={jQuery:!0}}());S2.requirejs=requirejs;S2.require=require;S2.define=define}}());S2.define("almond",function(){});S2.define('jquery',[],function(){var _$=jQuery||$;if(_$==null&&console&&console.error){console.error('Select2: An instance of jQuery or a jQuery-compatible library was not '+'found. Make sure that you are including jQuery before Select2 on your '+'web page.')}
return _$});S2.define('select2/utils',['jquery'],function($){var Utils={};Utils.Extend=function(ChildClass,SuperClass){var __hasProp={}.hasOwnProperty;function BaseConstructor(){this.constructor=ChildClass}
for(var key in SuperClass){if(__hasProp.call(SuperClass,key)){ChildClass[key]=SuperClass[key]}}
BaseConstructor.prototype=SuperClass.prototype;ChildClass.prototype=new BaseConstructor();ChildClass.__super__=SuperClass.prototype;return ChildClass};function getMethods(theClass){var proto=theClass.prototype;var methods=[];for(var methodName in proto){var m=proto[methodName];if(typeof m!=='function'){continue}
if(methodName==='constructor'){continue}
methods.push(methodName)}
return methods}
Utils.Decorate=function(SuperClass,DecoratorClass){var decoratedMethods=getMethods(DecoratorClass);var superMethods=getMethods(SuperClass);function DecoratedClass(){var unshift=Array.prototype.unshift;var argCount=DecoratorClass.prototype.constructor.length;var calledConstructor=SuperClass.prototype.constructor;if(argCount>0){unshift.call(arguments,SuperClass.prototype.constructor);calledConstructor=DecoratorClass.prototype.constructor}
calledConstructor.apply(this,arguments)}
DecoratorClass.displayName=SuperClass.displayName;function ctr(){this.constructor=DecoratedClass}
DecoratedClass.prototype=new ctr();for(var m=0;m<superMethods.length;m++){var superMethod=superMethods[m];DecoratedClass.prototype[superMethod]=SuperClass.prototype[superMethod]}
var calledMethod=function(methodName){var originalMethod=function(){};if(methodName in DecoratedClass.prototype){originalMethod=DecoratedClass.prototype[methodName]}
var decoratedMethod=DecoratorClass.prototype[methodName];return function(){var unshift=Array.prototype.unshift;unshift.call(arguments,originalMethod);return decoratedMethod.apply(this,arguments)}};for(var d=0;d<decoratedMethods.length;d++){var decoratedMethod=decoratedMethods[d];DecoratedClass.prototype[decoratedMethod]=calledMethod(decoratedMethod)}
return DecoratedClass};var Observable=function(){this.listeners={}};Observable.prototype.on=function(event,callback){this.listeners=this.listeners||{};if(event in this.listeners){this.listeners[event].push(callback)}else{this.listeners[event]=[callback]}};Observable.prototype.trigger=function(event){var slice=Array.prototype.slice;var params=slice.call(arguments,1);this.listeners=this.listeners||{};if(params==null){params=[]}
if(params.length===0){params.push({})}
params[0]._type=event;if(event in this.listeners){this.invoke(this.listeners[event],slice.call(arguments,1))}
if('*' in this.listeners){this.invoke(this.listeners['*'],arguments)}};Observable.prototype.invoke=function(listeners,params){for(var i=0,len=listeners.length;i<len;i++){listeners[i].apply(this,params)}};Utils.Observable=Observable;Utils.generateChars=function(length){var chars='';for(var i=0;i<length;i++){var randomChar=Math.floor(Math.random()*36);chars+=randomChar.toString(36)}
return chars};Utils.bind=function(func,context){return function(){func.apply(context,arguments)}};Utils._convertData=function(data){for(var originalKey in data){var keys=originalKey.split('-');var dataLevel=data;if(keys.length===1){continue}
for(var k=0;k<keys.length;k++){var key=keys[k];key=key.substring(0,1).toLowerCase()+key.substring(1);if(!(key in dataLevel)){dataLevel[key]={}}
if(k==keys.length-1){dataLevel[key]=data[originalKey]}
dataLevel=dataLevel[key]}
delete data[originalKey]}
return data};Utils.hasScroll=function(index,el){var $el=$(el);var overflowX=el.style.overflowX;var overflowY=el.style.overflowY;if(overflowX===overflowY&&(overflowY==='hidden'||overflowY==='visible')){return!1}
if(overflowX==='scroll'||overflowY==='scroll'){return!0}
return($el.innerHeight()<el.scrollHeight||$el.innerWidth()<el.scrollWidth)};Utils.escapeMarkup=function(markup){var replaceMap={'\\':'&#92;','&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;','\'':'&#39;','/':'&#47;'};if(typeof markup!=='string'){return markup}
return String(markup).replace(/[&<>"'\/\\]/g,function(match){return replaceMap[match]})};Utils.entityDecode=function(html){var txt=document.createElement('textarea');txt.innerHTML=html;return txt.value}
Utils.appendMany=function($element,$nodes){if($.fn.jquery.substr(0,3)==='1.7'){var $jqNodes=$();$.map($nodes,function(node){$jqNodes=$jqNodes.add(node)});$nodes=$jqNodes}
$element.append($nodes)};Utils.isTouchscreen=function(){if('undefined'===typeof Utils._isTouchscreenCache){Utils._isTouchscreenCache='ontouchstart' in document.documentElement}
return Utils._isTouchscreenCache}
return Utils});S2.define('select2/results',['jquery','./utils'],function($,Utils){function Results($element,options,dataAdapter){this.$element=$element;this.data=dataAdapter;this.options=options;Results.__super__.constructor.call(this)}
Utils.Extend(Results,Utils.Observable);Results.prototype.render=function(){var $results=$('<ul class="select2-results__options" role="listbox" tabindex="-1"></ul>');if(this.options.get('multiple')){$results.attr('aria-multiselectable','true')}
this.$results=$results;return $results};Results.prototype.clear=function(){this.$results.empty()};Results.prototype.displayMessage=function(params){var escapeMarkup=this.options.get('escapeMarkup');this.clear();this.hideLoading();var $message=$('<li role="alert" aria-live="assertive"'+' class="select2-results__option"></li>');var message=this.options.get('translations').get(params.message);$message.append(escapeMarkup(message(params.args)));$message[0].className+=' select2-results__message';this.$results.append($message)};Results.prototype.hideMessages=function(){this.$results.find('.select2-results__message').remove()};Results.prototype.append=function(data){this.hideLoading();var $options=[];if(data.results==null||data.results.length===0){if(this.$results.children().length===0){this.trigger('results:message',{message:'noResults'})}
return}
data.results=this.sort(data.results);for(var d=0;d<data.results.length;d++){var item=data.results[d];var $option=this.option(item);$options.push($option)}
this.$results.append($options)};Results.prototype.position=function($results,$dropdown){var $resultsContainer=$dropdown.find('.select2-results');$resultsContainer.append($results)};Results.prototype.sort=function(data){var sorter=this.options.get('sorter');return sorter(data)};Results.prototype.highlightFirstItem=function(){var $options=this.$results.find('.select2-results__option[data-selected]');var $selected=$options.filter('[data-selected=true]');if($selected.length>0){$selected.first().trigger('mouseenter')}else{$options.first().trigger('mouseenter')}
this.ensureHighlightVisible()};Results.prototype.setClasses=function(){var self=this;this.data.current(function(selected){var selectedIds=$.map(selected,function(s){return s.id.toString()});var $options=self.$results.find('.select2-results__option[data-selected]');$options.each(function(){var $option=$(this);var item=$.data(this,'data');var id=''+item.id;if((item.element!=null&&item.element.selected)||(item.element==null&&$.inArray(id,selectedIds)>-1)){$option.attr('data-selected','true')}else{$option.attr('data-selected','false')}})})};Results.prototype.showLoading=function(params){this.hideLoading();var loadingMore=this.options.get('translations').get('searching');var loading={disabled:!0,loading:!0,text:loadingMore(params)};var $loading=this.option(loading);$loading.className+=' loading-results';this.$results.prepend($loading)};Results.prototype.hideLoading=function(){this.$results.find('.loading-results').remove()};Results.prototype.option=function(data){var option=document.createElement('li');option.className='select2-results__option';var attrs={'role':'option','data-selected':'false','tabindex':-1};if(data.disabled){delete attrs['data-selected'];attrs['aria-disabled']='true'}
if(data.id==null){delete attrs['data-selected']}
if(data._resultId!=null){option.id=data._resultId}
if(data.title){option.title=data.title}
if(data.children){attrs['aria-label']=data.text;delete attrs['data-selected']}
for(var attr in attrs){var val=attrs[attr];option.setAttribute(attr,val)}
if(data.children){var $option=$(option);var label=document.createElement('strong');label.className='select2-results__group';var $label=$(label);this.template(data,label);$label.attr('role','presentation');var $children=[];for(var c=0;c<data.children.length;c++){var child=data.children[c];var $child=this.option(child);$children.push($child)}
var $childrenContainer=$('<ul></ul>',{'class':'select2-results__options select2-results__options--nested','role':'listbox'});$childrenContainer.append($children);$option.attr('role','list');$option.append(label);$option.append($childrenContainer)}else{this.template(data,option)}
$.data(option,'data',data);return option};Results.prototype.bind=function(container,$container){var self=this;var id=container.id+'-results';this.$results.attr('id',id);container.on('results:all',function(params){self.clear();self.append(params.data);if(container.isOpen()){self.setClasses();self.highlightFirstItem()}});container.on('results:append',function(params){self.append(params.data);if(container.isOpen()){self.setClasses()}});container.on('query',function(params){self.hideMessages();self.showLoading(params)});container.on('select',function(){if(!container.isOpen()){return}
self.setClasses();self.highlightFirstItem()});container.on('unselect',function(){if(!container.isOpen()){return}
self.setClasses();self.highlightFirstItem()});container.on('open',function(){self.$results.attr('aria-expanded','true');self.$results.attr('aria-hidden','false');self.setClasses();self.ensureHighlightVisible()});container.on('close',function(){self.$results.attr('aria-expanded','false');self.$results.attr('aria-hidden','true');self.$results.removeAttr('aria-activedescendant')});container.on('results:toggle',function(){var $highlighted=self.getHighlightedResults();if($highlighted.length===0){return}
$highlighted.trigger('mouseup')});container.on('results:select',function(){var $highlighted=self.getHighlightedResults();if($highlighted.length===0){return}
var data=$highlighted.data('data');if($highlighted.attr('data-selected')=='true'){self.trigger('close',{})}else{self.trigger('select',{data:data})}});container.on('results:previous',function(){var $highlighted=self.getHighlightedResults();var $options=self.$results.find('[data-selected]');var currentIndex=$options.index($highlighted);if(currentIndex===0){return}
var nextIndex=currentIndex-1;if($highlighted.length===0){nextIndex=0}
var $next=$options.eq(nextIndex);$next.trigger('mouseenter');var currentOffset=self.$results.offset().top;var nextTop=$next.offset().top;var nextOffset=self.$results.scrollTop()+(nextTop-currentOffset);if(nextIndex===0){self.$results.scrollTop(0)}else if(nextTop-currentOffset<0){self.$results.scrollTop(nextOffset)}});container.on('results:next',function(){var $highlighted=self.getHighlightedResults();var $options=self.$results.find('[data-selected]');var currentIndex=$options.index($highlighted);var nextIndex=currentIndex+1;if(nextIndex>=$options.length){return}
var $next=$options.eq(nextIndex);$next.trigger('mouseenter');var currentOffset=self.$results.offset().top+self.$results.outerHeight(!1);var nextBottom=$next.offset().top+$next.outerHeight(!1);var nextOffset=self.$results.scrollTop()+nextBottom-currentOffset;if(nextIndex===0){self.$results.scrollTop(0)}else if(nextBottom>currentOffset){self.$results.scrollTop(nextOffset)}});container.on('results:focus',function(params){params.element.addClass('select2-results__option--highlighted').attr('aria-selected','true');self.$results.attr('aria-activedescendant',params.element.attr('id'))});container.on('results:message',function(params){self.displayMessage(params)});if($.fn.mousewheel){this.$results.on('mousewheel',function(e){var top=self.$results.scrollTop();var bottom=self.$results.get(0).scrollHeight-top+e.deltaY;var isAtTop=e.deltaY>0&&top-e.deltaY<=0;var isAtBottom=e.deltaY<0&&bottom<=self.$results.height();if(isAtTop){self.$results.scrollTop(0);e.preventDefault();e.stopPropagation()}else if(isAtBottom){self.$results.scrollTop(self.$results.get(0).scrollHeight-self.$results.height());e.preventDefault();e.stopPropagation()}})}
this.$results.on('mouseup','.select2-results__option[data-selected]',function(evt){var $this=$(this);var data=$this.data('data');if($this.attr('data-selected')==='true'){if(self.options.get('multiple')){self.trigger('unselect',{originalEvent:evt,data:data})}else{self.trigger('close',{})}
return}
self.trigger('select',{originalEvent:evt,data:data})});this.$results.on('mouseenter','.select2-results__option[data-selected]',function(evt){var data=$(this).data('data');self.getHighlightedResults().removeClass('select2-results__option--highlighted').attr('aria-selected','false');self.trigger('results:focus',{data:data,element:$(this)})})};Results.prototype.getHighlightedResults=function(){var $highlighted=this.$results.find('.select2-results__option--highlighted');return $highlighted};Results.prototype.destroy=function(){this.$results.remove()};Results.prototype.ensureHighlightVisible=function(){var $highlighted=this.getHighlightedResults();if($highlighted.length===0){return}
var $options=this.$results.find('[data-selected]');var currentIndex=$options.index($highlighted);var currentOffset=this.$results.offset().top;var nextTop=$highlighted.offset().top;var nextOffset=this.$results.scrollTop()+(nextTop-currentOffset);var offsetDelta=nextTop-currentOffset;nextOffset-=$highlighted.outerHeight(!1)*2;if(currentIndex<=2){this.$results.scrollTop(0)}else if(offsetDelta>this.$results.outerHeight()||offsetDelta<0){this.$results.scrollTop(nextOffset)}};Results.prototype.template=function(result,container){var template=this.options.get('templateResult');var escapeMarkup=this.options.get('escapeMarkup');var content=template(result,container);if(content==null){container.style.display='none'}else if(typeof content==='string'){container.innerHTML=escapeMarkup(content)}else{$(container).append(content)}};return Results});S2.define('select2/keys',[],function(){var KEYS={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return KEYS});S2.define('select2/selection/base',['jquery','../utils','../keys'],function($,Utils,KEYS){function BaseSelection($element,options){this.$element=$element;this.options=options;BaseSelection.__super__.constructor.call(this)}
Utils.Extend(BaseSelection,Utils.Observable);BaseSelection.prototype.render=function(){var $selection=$('<span class="select2-selection" '+' aria-haspopup="true" aria-expanded="false">'+'</span>');this._tabindex=0;if(this.$element.data('old-tabindex')!=null){this._tabindex=this.$element.data('old-tabindex')}else if(this.$element.attr('tabindex')!=null){this._tabindex=this.$element.attr('tabindex')}
$selection.attr('title',this.$element.attr('title'));$selection.attr('tabindex',this._tabindex);this.$selection=$selection;return $selection};BaseSelection.prototype.bind=function(container,$container){var self=this;var id=container.id+'-container';var resultsId=container.id+'-results';var searchHidden=this.options.get('minimumResultsForSearch')===Infinity;this.container=container;this.$selection.on('focus',function(evt){self.trigger('focus',evt)});this.$selection.on('blur',function(evt){self._handleBlur(evt)});this.$selection.on('keydown',function(evt){self.trigger('keypress',evt);if(evt.which===KEYS.SPACE){evt.preventDefault()}});container.on('results:focus',function(params){self.$selection.attr('aria-activedescendant',params.data._resultId)});container.on('selection:update',function(params){self.update(params.data)});container.on('open',function(){self.$selection.attr('aria-expanded','true');self.$selection.attr('aria-owns',resultsId);self._attachCloseHandler(container)});container.on('close',function(){self.$selection.attr('aria-expanded','false');self.$selection.removeAttr('aria-activedescendant');self.$selection.removeAttr('aria-owns');window.setTimeout(function(){self.$selection.focus()},1);self._detachCloseHandler(container)});container.on('enable',function(){self.$selection.attr('tabindex',self._tabindex)});container.on('disable',function(){self.$selection.attr('tabindex','-1')})};BaseSelection.prototype._handleBlur=function(evt){var self=this;window.setTimeout(function(){if((document.activeElement==self.$selection[0])||($.contains(self.$selection[0],document.activeElement))){return}
self.trigger('blur',evt)},1)};BaseSelection.prototype._attachCloseHandler=function(container){var self=this;$(document.body).on('mousedown.select2.'+container.id,function(e){var $target=$(e.target);var $select=$target.closest('.select2');var $all=$('.select2.select2-container--open');$all.each(function(){var $this=$(this);if(this==$select[0]){return}
var $element=$this.data('element');$element.select2('close');setTimeout(function(){$this.find('*:focus').blur();$target.focus()},1)})})};BaseSelection.prototype._detachCloseHandler=function(container){$(document.body).off('mousedown.select2.'+container.id)};BaseSelection.prototype.position=function($selection,$container){var $selectionContainer=$container.find('.selection');$selectionContainer.append($selection)};BaseSelection.prototype.destroy=function(){this._detachCloseHandler(this.container)};BaseSelection.prototype.update=function(data){throw new Error('The `update` method must be defined in child classes.')};return BaseSelection});S2.define('select2/selection/single',['jquery','./base','../utils','../keys'],function($,BaseSelection,Utils,KEYS){function SingleSelection(){SingleSelection.__super__.constructor.apply(this,arguments)}
Utils.Extend(SingleSelection,BaseSelection);SingleSelection.prototype.render=function(){var $selection=SingleSelection.__super__.render.call(this);$selection.addClass('select2-selection--single');$selection.html('<span class="select2-selection__rendered"></span>'+'<span class="select2-selection__arrow" role="presentation">'+'<b role="presentation"></b>'+'</span>');return $selection};SingleSelection.prototype.bind=function(container,$container){var self=this;SingleSelection.__super__.bind.apply(this,arguments);var id=container.id+'-container';this.$selection.find('.select2-selection__rendered').attr('id',id).attr('role','textbox').attr('aria-readonly','true');var label=this.options.get('label');if(typeof(label)==='string'){this.$selection.attr('aria-label',label)}else{this.$selection.attr('aria-labelledby',id)}
this.$selection.attr('role','combobox');this.$selection.on('mousedown',function(evt){if(evt.which!==1){return}
self.trigger('toggle',{originalEvent:evt})});this.$selection.on('focus',function(evt){});this.$selection.on('keydown',function(evt){if(!container.isOpen()&&evt.which>=48&&evt.which<=90){container.open()}});this.$selection.on('blur',function(evt){});container.on('focus',function(evt){if(!container.isOpen()){self.$selection.focus()}});container.on('selection:update',function(params){self.update(params.data)})};SingleSelection.prototype.clear=function(){this.$selection.find('.select2-selection__rendered').empty()};SingleSelection.prototype.display=function(data,container){var template=this.options.get('templateSelection');var escapeMarkup=this.options.get('escapeMarkup');return escapeMarkup(template(data,container))};SingleSelection.prototype.selectionContainer=function(){return $('<span></span>')};SingleSelection.prototype.update=function(data){if(data.length===0){this.clear();return}
var selection=data[0];var $rendered=this.$selection.find('.select2-selection__rendered');var formatted=Utils.entityDecode(this.display(selection,$rendered));$rendered.empty().text(formatted);$rendered.prop('title',selection.title||selection.text)};return SingleSelection});S2.define('select2/selection/multiple',['jquery','./base','../utils'],function($,BaseSelection,Utils){function MultipleSelection($element,options){MultipleSelection.__super__.constructor.apply(this,arguments)}
Utils.Extend(MultipleSelection,BaseSelection);MultipleSelection.prototype.render=function(){var $selection=MultipleSelection.__super__.render.call(this);$selection.addClass('select2-selection--multiple');$selection.html('<ul class="select2-selection__rendered" aria-live="polite" aria-relevant="additions removals" aria-atomic="true"></ul>');return $selection};MultipleSelection.prototype.bind=function(container,$container){var self=this;MultipleSelection.__super__.bind.apply(this,arguments);this.$selection.on('click',function(evt){self.trigger('toggle',{originalEvent:evt})});this.$selection.on('click','.select2-selection__choice__remove',function(evt){if(self.options.get('disabled')){return}
var $remove=$(this);var $selection=$remove.parent();var data=$selection.data('data');self.trigger('unselect',{originalEvent:evt,data:data})});this.$selection.on('keydown',function(evt){if(!container.isOpen()&&evt.which>=48&&evt.which<=90){container.open()}});container.on('focus',function(){self.focusOnSearch()})};MultipleSelection.prototype.clear=function(){this.$selection.find('.select2-selection__rendered').empty()};MultipleSelection.prototype.display=function(data,container){var template=this.options.get('templateSelection');var escapeMarkup=this.options.get('escapeMarkup');return escapeMarkup(template(data,container))};MultipleSelection.prototype.selectionContainer=function(){var $container=$('<li class="select2-selection__choice">'+'<span class="select2-selection__choice__remove" role="presentation" aria-hidden="true">'+'&times;'+'</span>'+'</li>');return $container};MultipleSelection.prototype.focusOnSearch=function(){var self=this;if('undefined'!==typeof self.$search){setTimeout(function(){self._keyUpPrevented=!0;self.$search.focus()},1)}}
MultipleSelection.prototype.update=function(data){this.clear();if(data.length===0){return}
var $selections=[];for(var d=0;d<data.length;d++){var selection=data[d];var $selection=this.selectionContainer();var removeItemTag=$selection.html();var formatted=this.display(selection,$selection);if('string'===typeof formatted){formatted=Utils.entityDecode(formatted.trim())}
$selection.text(formatted);$selection.prepend(removeItemTag);$selection.prop('title',selection.title||selection.text);$selection.data('data',selection);$selections.push($selection)}
var $rendered=this.$selection.find('.select2-selection__rendered');Utils.appendMany($rendered,$selections)};return MultipleSelection});S2.define('select2/selection/placeholder',['../utils'],function(Utils){function Placeholder(decorated,$element,options){this.placeholder=this.normalizePlaceholder(options.get('placeholder'));decorated.call(this,$element,options)}
Placeholder.prototype.normalizePlaceholder=function(_,placeholder){if(typeof placeholder==='string'){placeholder={id:'',text:placeholder}}
return placeholder};Placeholder.prototype.createPlaceholder=function(decorated,placeholder){var $placeholder=this.selectionContainer();$placeholder.text(Utils.entityDecode(this.display(placeholder)));$placeholder.addClass('select2-selection__placeholder').removeClass('select2-selection__choice');return $placeholder};Placeholder.prototype.update=function(decorated,data){var singlePlaceholder=(data.length==1&&data[0].id!=this.placeholder.id);var multipleSelections=data.length>1;if(multipleSelections||singlePlaceholder){return decorated.call(this,data)}
this.clear();var $placeholder=this.createPlaceholder(this.placeholder);this.$selection.find('.select2-selection__rendered').append($placeholder)};return Placeholder});S2.define('select2/selection/allowClear',['jquery','../keys'],function($,KEYS){function AllowClear(){}
AllowClear.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container);if(this.placeholder==null){if(this.options.get('debug')&&window.console&&console.error){console.error('Select2: The `allowClear` option should be used in combination '+'with the `placeholder` option.')}}
this.$selection.on('mousedown','.select2-selection__clear',function(evt){self._handleClear(evt)});container.on('keypress',function(evt){self._handleKeyboardClear(evt,container)})};AllowClear.prototype._handleClear=function(_,evt){if(this.options.get('disabled')){return}
var $clear=this.$selection.find('.select2-selection__clear');if($clear.length===0){return}
evt.stopPropagation();var data=$clear.data('data');for(var d=0;d<data.length;d++){var unselectData={data:data[d]};this.trigger('unselect',unselectData);if(unselectData.prevented){return}}
this.$element.val(this.placeholder.id).trigger('change');this.trigger('toggle',{})};AllowClear.prototype._handleKeyboardClear=function(_,evt,container){if(container.isOpen()){return}
if(evt.which==KEYS.DELETE||evt.which==KEYS.BACKSPACE){this._handleClear(evt)}};AllowClear.prototype.update=function(decorated,data){decorated.call(this,data);if(this.$selection.find('.select2-selection__placeholder').length>0||data.length===0){return}
var $remove=$('<span class="select2-selection__clear">'+'&times;'+'</span>');$remove.data('data',data);this.$selection.find('.select2-selection__rendered').prepend($remove)};return AllowClear});S2.define('select2/selection/search',['jquery','../utils','../keys'],function($,Utils,KEYS){function Search(decorated,$element,options){decorated.call(this,$element,options)}
Search.prototype.render=function(decorated){var $search=$('<li class="select2-search select2-search--inline">'+'<input class="select2-search__field" type="text" tabindex="-1"'+' autocomplete="off" autocorrect="off" autocapitalize="none"'+' spellcheck="false" role="textbox" aria-autocomplete="list" />'+'</li>');this.$searchContainer=$search;this.$search=$search.find('input');var $rendered=decorated.call(this);this._transferTabIndex();return $rendered};Search.prototype.bind=function(decorated,container,$container){var self=this;var resultsId=container.id+'-results';decorated.call(this,container,$container);container.on('open',function(){self.$search.attr('aria-owns',resultsId);self.$search.trigger('focus')});container.on('close',function(){self.$search.val('');self.$search.removeAttr('aria-activedescendant');self.$search.removeAttr('aria-owns');self.$search.trigger('focus')});container.on('enable',function(){self.$search.prop('disabled',!1);self._transferTabIndex()});container.on('disable',function(){self.$search.prop('disabled',!0)});container.on('focus',function(evt){self.$search.trigger('focus')});container.on('results:focus',function(params){self.$search.attr('aria-activedescendant',params.data._resultId)});this.$selection.on('focusin','.select2-search--inline',function(evt){self.trigger('focus',evt)});this.$selection.on('focusout','.select2-search--inline',function(evt){self._handleBlur(evt)});this.$selection.on('keydown','.select2-search--inline',function(evt){evt.stopPropagation();self.trigger('keypress',evt);self._keyUpPrevented=evt.isDefaultPrevented();var key=evt.which;if(key===KEYS.BACKSPACE&&self.$search.val()===''){var $previousChoice=self.$searchContainer.prev('.select2-selection__choice');if($previousChoice.length>0){var item=$previousChoice.data('data');self.searchRemoveChoice(item);evt.preventDefault()}}else if(evt.which===KEYS.ENTER){container.open();evt.preventDefault()}});var msie=document.documentMode;var disableInputEvents=msie&&msie<=11;this.$selection.on('input.searchcheck','.select2-search--inline',function(evt){if(disableInputEvents){self.$selection.off('input.search input.searchcheck');return}
self.$selection.off('keyup.search')});this.$selection.on('keyup.search input.search','.select2-search--inline',function(evt){if(disableInputEvents&&evt.type==='input'){self.$selection.off('input.search input.searchcheck');return}
var key=evt.which;if(key==KEYS.SHIFT||key==KEYS.CTRL||key==KEYS.ALT){return}
if(key==KEYS.TAB){return}
self.handleSearch(evt)})};Search.prototype._transferTabIndex=function(decorated){this.$search.attr('tabindex',this.$selection.attr('tabindex'));this.$selection.attr('tabindex','-1')};Search.prototype.createPlaceholder=function(decorated,placeholder){this.$search.attr('placeholder',placeholder.text)};Search.prototype.update=function(decorated,data){var searchHadFocus=this.$search[0]==document.activeElement;this.$search.attr('placeholder','');decorated.call(this,data);this.$selection.find('.select2-selection__rendered').append(this.$searchContainer);this.resizeSearch();if(searchHadFocus){this.$search.focus()}};Search.prototype.handleSearch=function(){this.resizeSearch();if(!this._keyUpPrevented){var input=this.$search.val();this.trigger('query',{term:input})}
this._keyUpPrevented=!1};Search.prototype.searchRemoveChoice=function(decorated,item){this.trigger('unselect',{data:item});this.$search.val(item.text);this.handleSearch()};Search.prototype.resizeSearch=function(){this.$search.css('width','25px');var width='';if(this.$search.attr('placeholder')!==''){width=this.$selection.find('.select2-selection__rendered').innerWidth()}else{var minimumWidth=this.$search.val().length+1;width=(minimumWidth*0.75)+'em'}
this.$search.css('width',width)};return Search});S2.define('select2/selection/eventRelay',['jquery'],function($){function EventRelay(){}
EventRelay.prototype.bind=function(decorated,container,$container){var self=this;var relayEvents=['open','opening','close','closing','select','selecting','unselect','unselecting'];var preventableEvents=['opening','closing','selecting','unselecting'];decorated.call(this,container,$container);container.on('*',function(name,params){if($.inArray(name,relayEvents)===-1){return}
params=params||{};var evt=$.Event('select2:'+name,{params:params});self.$element.trigger(evt);if($.inArray(name,preventableEvents)===-1){return}
params.prevented=evt.isDefaultPrevented()})};return EventRelay});S2.define('select2/translation',['jquery','require'],function($,require){function Translation(dict){this.dict=dict||{}}
Translation.prototype.all=function(){return this.dict};Translation.prototype.get=function(key){return this.dict[key]};Translation.prototype.extend=function(translation){this.dict=$.extend({},translation.all(),this.dict)};Translation._cache={};Translation.loadPath=function(path){if(!(path in Translation._cache)){var translations=require(path);Translation._cache[path]=translations}
return new Translation(Translation._cache[path])};return Translation});S2.define('select2/diacritics',[],function(){var diacritics={'\u24B6':'A','\uFF21':'A','\u00C0':'A','\u00C1':'A','\u00C2':'A','\u1EA6':'A','\u1EA4':'A','\u1EAA':'A','\u1EA8':'A','\u00C3':'A','\u0100':'A','\u0102':'A','\u1EB0':'A','\u1EAE':'A','\u1EB4':'A','\u1EB2':'A','\u0226':'A','\u01E0':'A','\u00C4':'A','\u01DE':'A','\u1EA2':'A','\u00C5':'A','\u01FA':'A','\u01CD':'A','\u0200':'A','\u0202':'A','\u1EA0':'A','\u1EAC':'A','\u1EB6':'A','\u1E00':'A','\u0104':'A','\u023A':'A','\u2C6F':'A','\uA732':'AA','\u00C6':'AE','\u01FC':'AE','\u01E2':'AE','\uA734':'AO','\uA736':'AU','\uA738':'AV','\uA73A':'AV','\uA73C':'AY','\u24B7':'B','\uFF22':'B','\u1E02':'B','\u1E04':'B','\u1E06':'B','\u0243':'B','\u0182':'B','\u0181':'B','\u24B8':'C','\uFF23':'C','\u0106':'C','\u0108':'C','\u010A':'C','\u010C':'C','\u00C7':'C','\u1E08':'C','\u0187':'C','\u023B':'C','\uA73E':'C','\u24B9':'D','\uFF24':'D','\u1E0A':'D','\u010E':'D','\u1E0C':'D','\u1E10':'D','\u1E12':'D','\u1E0E':'D','\u0110':'D','\u018B':'D','\u018A':'D','\u0189':'D','\uA779':'D','\u01F1':'DZ','\u01C4':'DZ','\u01F2':'Dz','\u01C5':'Dz','\u24BA':'E','\uFF25':'E','\u00C8':'E','\u00C9':'E','\u00CA':'E','\u1EC0':'E','\u1EBE':'E','\u1EC4':'E','\u1EC2':'E','\u1EBC':'E','\u0112':'E','\u1E14':'E','\u1E16':'E','\u0114':'E','\u0116':'E','\u00CB':'E','\u1EBA':'E','\u011A':'E','\u0204':'E','\u0206':'E','\u1EB8':'E','\u1EC6':'E','\u0228':'E','\u1E1C':'E','\u0118':'E','\u1E18':'E','\u1E1A':'E','\u0190':'E','\u018E':'E','\u24BB':'F','\uFF26':'F','\u1E1E':'F','\u0191':'F','\uA77B':'F','\u24BC':'G','\uFF27':'G','\u01F4':'G','\u011C':'G','\u1E20':'G','\u011E':'G','\u0120':'G','\u01E6':'G','\u0122':'G','\u01E4':'G','\u0193':'G','\uA7A0':'G','\uA77D':'G','\uA77E':'G','\u24BD':'H','\uFF28':'H','\u0124':'H','\u1E22':'H','\u1E26':'H','\u021E':'H','\u1E24':'H','\u1E28':'H','\u1E2A':'H','\u0126':'H','\u2C67':'H','\u2C75':'H','\uA78D':'H','\u24BE':'I','\uFF29':'I','\u00CC':'I','\u00CD':'I','\u00CE':'I','\u0128':'I','\u012A':'I','\u012C':'I','\u0130':'I','\u00CF':'I','\u1E2E':'I','\u1EC8':'I','\u01CF':'I','\u0208':'I','\u020A':'I','\u1ECA':'I','\u012E':'I','\u1E2C':'I','\u0197':'I','\u24BF':'J','\uFF2A':'J','\u0134':'J','\u0248':'J','\u24C0':'K','\uFF2B':'K','\u1E30':'K','\u01E8':'K','\u1E32':'K','\u0136':'K','\u1E34':'K','\u0198':'K','\u2C69':'K','\uA740':'K','\uA742':'K','\uA744':'K','\uA7A2':'K','\u24C1':'L','\uFF2C':'L','\u013F':'L','\u0139':'L','\u013D':'L','\u1E36':'L','\u1E38':'L','\u013B':'L','\u1E3C':'L','\u1E3A':'L','\u0141':'L','\u023D':'L','\u2C62':'L','\u2C60':'L','\uA748':'L','\uA746':'L','\uA780':'L','\u01C7':'LJ','\u01C8':'Lj','\u24C2':'M','\uFF2D':'M','\u1E3E':'M','\u1E40':'M','\u1E42':'M','\u2C6E':'M','\u019C':'M','\u24C3':'N','\uFF2E':'N','\u01F8':'N','\u0143':'N','\u00D1':'N','\u1E44':'N','\u0147':'N','\u1E46':'N','\u0145':'N','\u1E4A':'N','\u1E48':'N','\u0220':'N','\u019D':'N','\uA790':'N','\uA7A4':'N','\u01CA':'NJ','\u01CB':'Nj','\u24C4':'O','\uFF2F':'O','\u00D2':'O','\u00D3':'O','\u00D4':'O','\u1ED2':'O','\u1ED0':'O','\u1ED6':'O','\u1ED4':'O','\u00D5':'O','\u1E4C':'O','\u022C':'O','\u1E4E':'O','\u014C':'O','\u1E50':'O','\u1E52':'O','\u014E':'O','\u022E':'O','\u0230':'O','\u00D6':'O','\u022A':'O','\u1ECE':'O','\u0150':'O','\u01D1':'O','\u020C':'O','\u020E':'O','\u01A0':'O','\u1EDC':'O','\u1EDA':'O','\u1EE0':'O','\u1EDE':'O','\u1EE2':'O','\u1ECC':'O','\u1ED8':'O','\u01EA':'O','\u01EC':'O','\u00D8':'O','\u01FE':'O','\u0186':'O','\u019F':'O','\uA74A':'O','\uA74C':'O','\u01A2':'OI','\uA74E':'OO','\u0222':'OU','\u24C5':'P','\uFF30':'P','\u1E54':'P','\u1E56':'P','\u01A4':'P','\u2C63':'P','\uA750':'P','\uA752':'P','\uA754':'P','\u24C6':'Q','\uFF31':'Q','\uA756':'Q','\uA758':'Q','\u024A':'Q','\u24C7':'R','\uFF32':'R','\u0154':'R','\u1E58':'R','\u0158':'R','\u0210':'R','\u0212':'R','\u1E5A':'R','\u1E5C':'R','\u0156':'R','\u1E5E':'R','\u024C':'R','\u2C64':'R','\uA75A':'R','\uA7A6':'R','\uA782':'R','\u24C8':'S','\uFF33':'S','\u1E9E':'S','\u015A':'S','\u1E64':'S','\u015C':'S','\u1E60':'S','\u0160':'S','\u1E66':'S','\u1E62':'S','\u1E68':'S','\u0218':'S','\u015E':'S','\u2C7E':'S','\uA7A8':'S','\uA784':'S','\u24C9':'T','\uFF34':'T','\u1E6A':'T','\u0164':'T','\u1E6C':'T','\u021A':'T','\u0162':'T','\u1E70':'T','\u1E6E':'T','\u0166':'T','\u01AC':'T','\u01AE':'T','\u023E':'T','\uA786':'T','\uA728':'TZ','\u24CA':'U','\uFF35':'U','\u00D9':'U','\u00DA':'U','\u00DB':'U','\u0168':'U','\u1E78':'U','\u016A':'U','\u1E7A':'U','\u016C':'U','\u00DC':'U','\u01DB':'U','\u01D7':'U','\u01D5':'U','\u01D9':'U','\u1EE6':'U','\u016E':'U','\u0170':'U','\u01D3':'U','\u0214':'U','\u0216':'U','\u01AF':'U','\u1EEA':'U','\u1EE8':'U','\u1EEE':'U','\u1EEC':'U','\u1EF0':'U','\u1EE4':'U','\u1E72':'U','\u0172':'U','\u1E76':'U','\u1E74':'U','\u0244':'U','\u24CB':'V','\uFF36':'V','\u1E7C':'V','\u1E7E':'V','\u01B2':'V','\uA75E':'V','\u0245':'V','\uA760':'VY','\u24CC':'W','\uFF37':'W','\u1E80':'W','\u1E82':'W','\u0174':'W','\u1E86':'W','\u1E84':'W','\u1E88':'W','\u2C72':'W','\u24CD':'X','\uFF38':'X','\u1E8A':'X','\u1E8C':'X','\u24CE':'Y','\uFF39':'Y','\u1EF2':'Y','\u00DD':'Y','\u0176':'Y','\u1EF8':'Y','\u0232':'Y','\u1E8E':'Y','\u0178':'Y','\u1EF6':'Y','\u1EF4':'Y','\u01B3':'Y','\u024E':'Y','\u1EFE':'Y','\u24CF':'Z','\uFF3A':'Z','\u0179':'Z','\u1E90':'Z','\u017B':'Z','\u017D':'Z','\u1E92':'Z','\u1E94':'Z','\u01B5':'Z','\u0224':'Z','\u2C7F':'Z','\u2C6B':'Z','\uA762':'Z','\u24D0':'a','\uFF41':'a','\u1E9A':'a','\u00E0':'a','\u00E1':'a','\u00E2':'a','\u1EA7':'a','\u1EA5':'a','\u1EAB':'a','\u1EA9':'a','\u00E3':'a','\u0101':'a','\u0103':'a','\u1EB1':'a','\u1EAF':'a','\u1EB5':'a','\u1EB3':'a','\u0227':'a','\u01E1':'a','\u00E4':'a','\u01DF':'a','\u1EA3':'a','\u00E5':'a','\u01FB':'a','\u01CE':'a','\u0201':'a','\u0203':'a','\u1EA1':'a','\u1EAD':'a','\u1EB7':'a','\u1E01':'a','\u0105':'a','\u2C65':'a','\u0250':'a','\uA733':'aa','\u00E6':'ae','\u01FD':'ae','\u01E3':'ae','\uA735':'ao','\uA737':'au','\uA739':'av','\uA73B':'av','\uA73D':'ay','\u24D1':'b','\uFF42':'b','\u1E03':'b','\u1E05':'b','\u1E07':'b','\u0180':'b','\u0183':'b','\u0253':'b','\u24D2':'c','\uFF43':'c','\u0107':'c','\u0109':'c','\u010B':'c','\u010D':'c','\u00E7':'c','\u1E09':'c','\u0188':'c','\u023C':'c','\uA73F':'c','\u2184':'c','\u24D3':'d','\uFF44':'d','\u1E0B':'d','\u010F':'d','\u1E0D':'d','\u1E11':'d','\u1E13':'d','\u1E0F':'d','\u0111':'d','\u018C':'d','\u0256':'d','\u0257':'d','\uA77A':'d','\u01F3':'dz','\u01C6':'dz','\u24D4':'e','\uFF45':'e','\u00E8':'e','\u00E9':'e','\u00EA':'e','\u1EC1':'e','\u1EBF':'e','\u1EC5':'e','\u1EC3':'e','\u1EBD':'e','\u0113':'e','\u1E15':'e','\u1E17':'e','\u0115':'e','\u0117':'e','\u00EB':'e','\u1EBB':'e','\u011B':'e','\u0205':'e','\u0207':'e','\u1EB9':'e','\u1EC7':'e','\u0229':'e','\u1E1D':'e','\u0119':'e','\u1E19':'e','\u1E1B':'e','\u0247':'e','\u025B':'e','\u01DD':'e','\u24D5':'f','\uFF46':'f','\u1E1F':'f','\u0192':'f','\uA77C':'f','\u24D6':'g','\uFF47':'g','\u01F5':'g','\u011D':'g','\u1E21':'g','\u011F':'g','\u0121':'g','\u01E7':'g','\u0123':'g','\u01E5':'g','\u0260':'g','\uA7A1':'g','\u1D79':'g','\uA77F':'g','\u24D7':'h','\uFF48':'h','\u0125':'h','\u1E23':'h','\u1E27':'h','\u021F':'h','\u1E25':'h','\u1E29':'h','\u1E2B':'h','\u1E96':'h','\u0127':'h','\u2C68':'h','\u2C76':'h','\u0265':'h','\u0195':'hv','\u24D8':'i','\uFF49':'i','\u00EC':'i','\u00ED':'i','\u00EE':'i','\u0129':'i','\u012B':'i','\u012D':'i','\u00EF':'i','\u1E2F':'i','\u1EC9':'i','\u01D0':'i','\u0209':'i','\u020B':'i','\u1ECB':'i','\u012F':'i','\u1E2D':'i','\u0268':'i','\u0131':'i','\u24D9':'j','\uFF4A':'j','\u0135':'j','\u01F0':'j','\u0249':'j','\u24DA':'k','\uFF4B':'k','\u1E31':'k','\u01E9':'k','\u1E33':'k','\u0137':'k','\u1E35':'k','\u0199':'k','\u2C6A':'k','\uA741':'k','\uA743':'k','\uA745':'k','\uA7A3':'k','\u24DB':'l','\uFF4C':'l','\u0140':'l','\u013A':'l','\u013E':'l','\u1E37':'l','\u1E39':'l','\u013C':'l','\u1E3D':'l','\u1E3B':'l','\u017F':'l','\u0142':'l','\u019A':'l','\u026B':'l','\u2C61':'l','\uA749':'l','\uA781':'l','\uA747':'l','\u01C9':'lj','\u24DC':'m','\uFF4D':'m','\u1E3F':'m','\u1E41':'m','\u1E43':'m','\u0271':'m','\u026F':'m','\u24DD':'n','\uFF4E':'n','\u01F9':'n','\u0144':'n','\u00F1':'n','\u1E45':'n','\u0148':'n','\u1E47':'n','\u0146':'n','\u1E4B':'n','\u1E49':'n','\u019E':'n','\u0272':'n','\u0149':'n','\uA791':'n','\uA7A5':'n','\u01CC':'nj','\u24DE':'o','\uFF4F':'o','\u00F2':'o','\u00F3':'o','\u00F4':'o','\u1ED3':'o','\u1ED1':'o','\u1ED7':'o','\u1ED5':'o','\u00F5':'o','\u1E4D':'o','\u022D':'o','\u1E4F':'o','\u014D':'o','\u1E51':'o','\u1E53':'o','\u014F':'o','\u022F':'o','\u0231':'o','\u00F6':'o','\u022B':'o','\u1ECF':'o','\u0151':'o','\u01D2':'o','\u020D':'o','\u020F':'o','\u01A1':'o','\u1EDD':'o','\u1EDB':'o','\u1EE1':'o','\u1EDF':'o','\u1EE3':'o','\u1ECD':'o','\u1ED9':'o','\u01EB':'o','\u01ED':'o','\u00F8':'o','\u01FF':'o','\u0254':'o','\uA74B':'o','\uA74D':'o','\u0275':'o','\u01A3':'oi','\u0223':'ou','\uA74F':'oo','\u24DF':'p','\uFF50':'p','\u1E55':'p','\u1E57':'p','\u01A5':'p','\u1D7D':'p','\uA751':'p','\uA753':'p','\uA755':'p','\u24E0':'q','\uFF51':'q','\u024B':'q','\uA757':'q','\uA759':'q','\u24E1':'r','\uFF52':'r','\u0155':'r','\u1E59':'r','\u0159':'r','\u0211':'r','\u0213':'r','\u1E5B':'r','\u1E5D':'r','\u0157':'r','\u1E5F':'r','\u024D':'r','\u027D':'r','\uA75B':'r','\uA7A7':'r','\uA783':'r','\u24E2':'s','\uFF53':'s','\u00DF':'s','\u015B':'s','\u1E65':'s','\u015D':'s','\u1E61':'s','\u0161':'s','\u1E67':'s','\u1E63':'s','\u1E69':'s','\u0219':'s','\u015F':'s','\u023F':'s','\uA7A9':'s','\uA785':'s','\u1E9B':'s','\u24E3':'t','\uFF54':'t','\u1E6B':'t','\u1E97':'t','\u0165':'t','\u1E6D':'t','\u021B':'t','\u0163':'t','\u1E71':'t','\u1E6F':'t','\u0167':'t','\u01AD':'t','\u0288':'t','\u2C66':'t','\uA787':'t','\uA729':'tz','\u24E4':'u','\uFF55':'u','\u00F9':'u','\u00FA':'u','\u00FB':'u','\u0169':'u','\u1E79':'u','\u016B':'u','\u1E7B':'u','\u016D':'u','\u00FC':'u','\u01DC':'u','\u01D8':'u','\u01D6':'u','\u01DA':'u','\u1EE7':'u','\u016F':'u','\u0171':'u','\u01D4':'u','\u0215':'u','\u0217':'u','\u01B0':'u','\u1EEB':'u','\u1EE9':'u','\u1EEF':'u','\u1EED':'u','\u1EF1':'u','\u1EE5':'u','\u1E73':'u','\u0173':'u','\u1E77':'u','\u1E75':'u','\u0289':'u','\u24E5':'v','\uFF56':'v','\u1E7D':'v','\u1E7F':'v','\u028B':'v','\uA75F':'v','\u028C':'v','\uA761':'vy','\u24E6':'w','\uFF57':'w','\u1E81':'w','\u1E83':'w','\u0175':'w','\u1E87':'w','\u1E85':'w','\u1E98':'w','\u1E89':'w','\u2C73':'w','\u24E7':'x','\uFF58':'x','\u1E8B':'x','\u1E8D':'x','\u24E8':'y','\uFF59':'y','\u1EF3':'y','\u00FD':'y','\u0177':'y','\u1EF9':'y','\u0233':'y','\u1E8F':'y','\u00FF':'y','\u1EF7':'y','\u1E99':'y','\u1EF5':'y','\u01B4':'y','\u024F':'y','\u1EFF':'y','\u24E9':'z','\uFF5A':'z','\u017A':'z','\u1E91':'z','\u017C':'z','\u017E':'z','\u1E93':'z','\u1E95':'z','\u01B6':'z','\u0225':'z','\u0240':'z','\u2C6C':'z','\uA763':'z','\u0386':'\u0391','\u0388':'\u0395','\u0389':'\u0397','\u038A':'\u0399','\u03AA':'\u0399','\u038C':'\u039F','\u038E':'\u03A5','\u03AB':'\u03A5','\u038F':'\u03A9','\u03AC':'\u03B1','\u03AD':'\u03B5','\u03AE':'\u03B7','\u03AF':'\u03B9','\u03CA':'\u03B9','\u0390':'\u03B9','\u03CC':'\u03BF','\u03CD':'\u03C5','\u03CB':'\u03C5','\u03B0':'\u03C5','\u03C9':'\u03C9','\u03C2':'\u03C3'};return diacritics});S2.define('select2/data/base',['../utils'],function(Utils){function BaseAdapter($element,options){BaseAdapter.__super__.constructor.call(this)}
Utils.Extend(BaseAdapter,Utils.Observable);BaseAdapter.prototype.current=function(callback){throw new Error('The `current` method must be defined in child classes.')};BaseAdapter.prototype.query=function(params,callback){throw new Error('The `query` method must be defined in child classes.')};BaseAdapter.prototype.bind=function(container,$container){};BaseAdapter.prototype.destroy=function(){};BaseAdapter.prototype.generateResultId=function(container,data){var id='';if(container!=null){id+=container.id}else{id+=Utils.generateChars(4)}
id+='-result-';id+=Utils.generateChars(4);if(data.id!=null){id+='-'+data.id.toString()}else{id+='-'+Utils.generateChars(4)}
return id};return BaseAdapter});S2.define('select2/data/select',['./base','../utils','jquery'],function(BaseAdapter,Utils,$){function SelectAdapter($element,options){this.$element=$element;this.options=options;SelectAdapter.__super__.constructor.call(this)}
Utils.Extend(SelectAdapter,BaseAdapter);SelectAdapter.prototype.current=function(callback){var data=[];var self=this;this.$element.find(':selected').each(function(){var $option=$(this);var option=self.item($option);data.push(option)});callback(data)};SelectAdapter.prototype.select=function(data){var self=this;data.selected=!0;if($(data.element).is('option')){data.element.selected=!0;this.$element.trigger('change');return}
if(this.$element.prop('multiple')){this.current(function(currentData){var val=[];data=[data];data.push.apply(data,currentData);for(var d=0;d<data.length;d++){var id=data[d].id;if($.inArray(id,val)===-1){val.push(id)}}
self.$element.val(val);self.$element.trigger('change')})}else{var val=data.id;this.$element.val(val);this.$element.trigger('change')}};SelectAdapter.prototype.unselect=function(data){var self=this;if(!this.$element.prop('multiple')){return}
data.selected=!1;if($(data.element).is('option')){data.element.selected=!1;this.$element.trigger('change');return}
this.current(function(currentData){var val=[];for(var d=0;d<currentData.length;d++){var id=currentData[d].id;if(id!==data.id&&$.inArray(id,val)===-1){val.push(id)}}
self.$element.val(val);self.$element.trigger('change')})};SelectAdapter.prototype.bind=function(container,$container){var self=this;this.container=container;container.on('select',function(params){self.select(params.data)});container.on('unselect',function(params){self.unselect(params.data)})};SelectAdapter.prototype.destroy=function(){this.$element.find('*').each(function(){$.removeData(this,'data')})};SelectAdapter.prototype.query=function(params,callback){var data=[];var self=this;var $options=this.$element.children();$options.each(function(){var $option=$(this);if(!$option.is('option')&&!$option.is('optgroup')){return}
var option=self.item($option);var matches=self.matches(params,option);if(matches!==null){data.push(matches)}});callback({results:data})};SelectAdapter.prototype.addOptions=function($options){Utils.appendMany(this.$element,$options)};SelectAdapter.prototype.option=function(data){var option;if(data.children){option=document.createElement('optgroup');option.label=data.text}else{option=document.createElement('option');if(option.textContent!==undefined){option.textContent=data.text}else{option.innerText=data.text}}
if(data.id!==undefined){option.value=data.id}
if(data.disabled){option.disabled=!0}
if(data.selected){option.selected=!0}
if(data.title){option.title=data.title}
var $option=$(option);var normalizedData=this._normalizeItem(data);normalizedData.element=option;$.data(option,'data',normalizedData);return $option};SelectAdapter.prototype.item=function($option){var data={};data=$.data($option[0],'data');if(data!=null){return data}
if($option.is('option')){data={id:$option.val(),text:$option.text(),disabled:$option.prop('disabled'),selected:$option.prop('selected'),title:$option.prop('title')}}else if($option.is('optgroup')){data={text:$option.prop('label'),children:[],title:$option.prop('title')};var $children=$option.children('option');var children=[];for(var c=0;c<$children.length;c++){var $child=$($children[c]);var child=this.item($child);children.push(child)}
data.children=children}
data=this._normalizeItem(data);data.element=$option[0];$.data($option[0],'data',data);return data};SelectAdapter.prototype._normalizeItem=function(item){if(!$.isPlainObject(item)){item={id:item,text:item}}
item=$.extend({},{text:''},item);var defaults={selected:!1,disabled:!1};if(item.id!=null){item.id=item.id.toString()}
if(item.text!=null){item.text=item.text.toString()}
if(item._resultId==null&&item.id){item._resultId=this.generateResultId(this.container,item)}
return $.extend({},defaults,item)};SelectAdapter.prototype.matches=function(params,data){var matcher=this.options.get('matcher');return matcher(params,data)};return SelectAdapter});S2.define('select2/data/array',['./select','../utils','jquery'],function(SelectAdapter,Utils,$){function ArrayAdapter($element,options){var data=options.get('data')||[];ArrayAdapter.__super__.constructor.call(this,$element,options);this.addOptions(this.convertToOptions(data))}
Utils.Extend(ArrayAdapter,SelectAdapter);ArrayAdapter.prototype.select=function(data){var $option=this.$element.find('option').filter(function(i,elm){return elm.value==data.id.toString()});if($option.length===0){$option=this.option(data);this.addOptions($option)}
ArrayAdapter.__super__.select.call(this,data)};ArrayAdapter.prototype.convertToOptions=function(data){var self=this;var $existing=this.$element.find('option');var existingIds=$existing.map(function(){return self.item($(this)).id}).get();var $options=[];function onlyItem(item){return function(){return $(this).val()==item.id}}
for(var d=0;d<data.length;d++){var item=this._normalizeItem(data[d]);if($.inArray(item.id,existingIds)>=0){var $existingOption=$existing.filter(onlyItem(item));var existingData=this.item($existingOption);var newData=$.extend(!0,{},item,existingData);var $newOption=this.option(newData);$existingOption.replaceWith($newOption);continue}
var $option=this.option(item);if(item.children){var $children=this.convertToOptions(item.children);Utils.appendMany($option,$children)}
$options.push($option)}
return $options};return ArrayAdapter});S2.define('select2/data/ajax',['./array','../utils','jquery'],function(ArrayAdapter,Utils,$){function AjaxAdapter($element,options){this.ajaxOptions=this._applyDefaults(options.get('ajax'));if(this.ajaxOptions.processResults!=null){this.processResults=this.ajaxOptions.processResults}
AjaxAdapter.__super__.constructor.call(this,$element,options)}
Utils.Extend(AjaxAdapter,ArrayAdapter);AjaxAdapter.prototype._applyDefaults=function(options){var defaults={data:function(params){return $.extend({},params,{q:params.term})},transport:function(params,success,failure){var $request=$.ajax(params);$request.then(success);$request.fail(failure);return $request}};return $.extend({},defaults,options,!0)};AjaxAdapter.prototype.processResults=function(results){return results};AjaxAdapter.prototype.query=function(params,callback){var matches=[];var self=this;if(this._request!=null){if($.isFunction(this._request.abort)){this._request.abort()}
this._request=null}
var options=$.extend({type:'GET'},this.ajaxOptions);if(typeof options.url==='function'){options.url=options.url.call(this.$element,params)}
if(typeof options.data==='function'){options.data=options.data.call(this.$element,params)}
function request(){var $request=options.transport(options,function(data){var results=self.processResults(data,params);if(self.options.get('debug')&&window.console&&console.error){if(!results||!results.results||!$.isArray(results.results)){console.error('Select2: The AJAX results did not return an array in the '+'`results` key of the response.')}}
callback(results);self.container.focusOnActiveElement()},function(){if($request.status&&$request.status==='0'){return}
self.trigger('results:message',{message:'errorLoading'})});self._request=$request}
if(this.ajaxOptions.delay&&params.term!=null){if(this._queryTimeout){window.clearTimeout(this._queryTimeout)}
this._queryTimeout=window.setTimeout(request,this.ajaxOptions.delay)}else{request()}};return AjaxAdapter});S2.define('select2/data/tags',['jquery'],function($){function Tags(decorated,$element,options){var tags=options.get('tags');var createTag=options.get('createTag');if(createTag!==undefined){this.createTag=createTag}
var insertTag=options.get('insertTag');if(insertTag!==undefined){this.insertTag=insertTag}
decorated.call(this,$element,options);if($.isArray(tags)){for(var t=0;t<tags.length;t++){var tag=tags[t];var item=this._normalizeItem(tag);var $option=this.option(item);this.$element.append($option)}}}
Tags.prototype.query=function(decorated,params,callback){var self=this;this._removeOldTags();if(params.term==null||params.page!=null){decorated.call(this,params,callback);return}
function wrapper(obj,child){var data=obj.results;for(var i=0;i<data.length;i++){var option=data[i];var checkChildren=(option.children!=null&&!wrapper({results:option.children},!0));var optionText=(option.text||'').toUpperCase();var paramsTerm=(params.term||'').toUpperCase();var checkText=optionText===paramsTerm;if(checkText||checkChildren){if(child){return!1}
obj.data=data;callback(obj);return}}
if(child){return!0}
var tag=self.createTag(params);if(tag!=null){var $option=self.option(tag);$option.attr('data-select2-tag',!0);self.addOptions([$option]);self.insertTag(data,tag)}
obj.results=data;callback(obj)}
decorated.call(this,params,wrapper)};Tags.prototype.createTag=function(decorated,params){var term=$.trim(params.term);if(term===''){return null}
return{id:term,text:term}};Tags.prototype.insertTag=function(_,data,tag){data.unshift(tag)};Tags.prototype._removeOldTags=function(_){var tag=this._lastTag;var $options=this.$element.find('option[data-select2-tag]');$options.each(function(){if(this.selected){return}
$(this).remove()})};return Tags});S2.define('select2/data/tokenizer',['jquery'],function($){function Tokenizer(decorated,$element,options){var tokenizer=options.get('tokenizer');if(tokenizer!==undefined){this.tokenizer=tokenizer}
decorated.call(this,$element,options)}
Tokenizer.prototype.bind=function(decorated,container,$container){decorated.call(this,container,$container);this.$search=container.dropdown.$search||container.selection.$search||$container.find('.select2-search__field')};Tokenizer.prototype.query=function(decorated,params,callback){var self=this;function createAndSelect(data){var item=self._normalizeItem(data);var $existingOptions=self.$element.find('option').filter(function(){return $(this).val()===item.id});if(!$existingOptions.length){var $option=self.option(item);$option.attr('data-select2-tag',!0);self._removeOldTags();self.addOptions([$option])}
select(item)}
function select(data){self.trigger('select',{data:data})}
params.term=params.term||'';var tokenData=this.tokenizer(params,this.options,createAndSelect);if(tokenData.term!==params.term){if(this.$search.length){this.$search.val(tokenData.term);this.$search.focus()}
params.term=tokenData.term}
decorated.call(this,params,callback)};Tokenizer.prototype.tokenizer=function(_,params,options,callback){var separators=options.get('tokenSeparators')||[];var term=params.term;var i=0;var createTag=this.createTag||function(params){return{id:params.term,text:params.term}};while(i<term.length){var termChar=term[i];if($.inArray(termChar,separators)===-1){i++;continue}
var part=term.substr(0,i);var partParams=$.extend({},params,{term:part});var data=createTag(partParams);if(data==null){i++;continue}
callback(data);term=term.substr(i+1)||'';i=0}
return{term:term}};return Tokenizer});S2.define('select2/data/minimumInputLength',[],function(){function MinimumInputLength(decorated,$e,options){this.minimumInputLength=options.get('minimumInputLength');decorated.call(this,$e,options)}
MinimumInputLength.prototype.query=function(decorated,params,callback){params.term=params.term||'';if(params.term.length<this.minimumInputLength){this.trigger('results:message',{message:'inputTooShort',args:{minimum:this.minimumInputLength,input:params.term,params:params}});return}
decorated.call(this,params,callback)};return MinimumInputLength});S2.define('select2/data/maximumInputLength',[],function(){function MaximumInputLength(decorated,$e,options){this.maximumInputLength=options.get('maximumInputLength');decorated.call(this,$e,options)}
MaximumInputLength.prototype.query=function(decorated,params,callback){params.term=params.term||'';if(this.maximumInputLength>0&&params.term.length>this.maximumInputLength){this.trigger('results:message',{message:'inputTooLong',args:{maximum:this.maximumInputLength,input:params.term,params:params}});return}
decorated.call(this,params,callback)};return MaximumInputLength});S2.define('select2/data/maximumSelectionLength',[],function(){function MaximumSelectionLength(decorated,$e,options){this.maximumSelectionLength=options.get('maximumSelectionLength');decorated.call(this,$e,options)}
MaximumSelectionLength.prototype.query=function(decorated,params,callback){var self=this;this.current(function(currentData){var count=currentData!=null?currentData.length:0;if(self.maximumSelectionLength>0&&count>=self.maximumSelectionLength){self.trigger('results:message',{message:'maximumSelected',args:{maximum:self.maximumSelectionLength}});return}
decorated.call(self,params,callback)})};return MaximumSelectionLength});S2.define('select2/dropdown',['jquery','./utils'],function($,Utils){function Dropdown($element,options){this.$element=$element;this.options=options;Dropdown.__super__.constructor.call(this)}
Utils.Extend(Dropdown,Utils.Observable);Dropdown.prototype.render=function(){var $dropdown=$('<span class="select2-dropdown">'+'<span class="select2-results"></span>'+'</span>');$dropdown.attr('dir',this.options.get('dir'));this.$dropdown=$dropdown;return $dropdown};Dropdown.prototype.bind=function(){};Dropdown.prototype.position=function($dropdown,$container){};Dropdown.prototype.destroy=function(){this.$dropdown.remove()};return Dropdown});S2.define('select2/dropdown/search',['jquery','../utils'],function($,Utils){function Search(){}
Search.prototype.render=function(decorated){var $rendered=decorated.call(this);var $search=$('<span class="select2-search select2-search--dropdown">'+'<input class="select2-search__field" type="text" tabindex="-1"'+' autocomplete="off" autocorrect="off" autocapitalize="none"'+' spellcheck="false" role="combobox" aria-autocomplete="list" aria-expanded="true" />'+'</span>');this.$searchContainer=$search;this.$search=$search.find('input');$rendered.prepend($search);return $rendered};Search.prototype.bind=function(decorated,container,$container){var self=this;var resultsId=container.id+'-results';decorated.call(this,container,$container);this.$search.on('keydown',function(evt){self.trigger('keypress',evt);self._keyUpPrevented=evt.isDefaultPrevented()});this.$search.on('input',function(evt){$(this).off('keyup')});this.$search.on('keyup input',function(evt){self.handleSearch(evt)});container.on('open',function(){self.$search.attr('tabindex',0);self.$search.attr('aria-owns',resultsId);self.$search.focus();window.setTimeout(function(){self.$search.focus()},0)});container.on('close',function(){self.$search.attr('tabindex',-1);self.$search.removeAttr('aria-activedescendant');self.$search.removeAttr('aria-owns');self.$search.val('')});container.on('focus',function(){if(!container.isOpen()){self.$search.focus()}});container.on('results:all',function(params){if(params.query.term==null||params.query.term===''){var showSearch=self.showSearch(params);if(showSearch){self.$searchContainer.removeClass('select2-search--hide')}else{self.$searchContainer.addClass('select2-search--hide')}}});container.on('results:focus',function(params){self.$search.attr('aria-activedescendant',params.data._resultId)})};Search.prototype.handleSearch=function(evt){if(!this._keyUpPrevented){var input=this.$search.val();this.trigger('query',{term:input})}
this._keyUpPrevented=!1};Search.prototype.showSearch=function(_,params){return!0};return Search});S2.define('select2/dropdown/hidePlaceholder',[],function(){function HidePlaceholder(decorated,$element,options,dataAdapter){this.placeholder=this.normalizePlaceholder(options.get('placeholder'));decorated.call(this,$element,options,dataAdapter)}
HidePlaceholder.prototype.append=function(decorated,data){data.results=this.removePlaceholder(data.results);decorated.call(this,data)};HidePlaceholder.prototype.normalizePlaceholder=function(_,placeholder){if(typeof placeholder==='string'){placeholder={id:'',text:placeholder}}
return placeholder};HidePlaceholder.prototype.removePlaceholder=function(_,data){var modifiedData=data.slice(0);for(var d=data.length-1;d>=0;d--){var item=data[d];if(this.placeholder.id===item.id){modifiedData.splice(d,1)}}
return modifiedData};return HidePlaceholder});S2.define('select2/dropdown/infiniteScroll',['jquery'],function($){function InfiniteScroll(decorated,$element,options,dataAdapter){this.lastParams={};decorated.call(this,$element,options,dataAdapter);this.$loadingMore=this.createLoadingMore();this.loading=!1}
InfiniteScroll.prototype.append=function(decorated,data){this.$loadingMore.remove();this.loading=!1;decorated.call(this,data);if(this.showLoadingMore(data)){this.$results.append(this.$loadingMore)}};InfiniteScroll.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container);container.on('query',function(params){self.lastParams=params;self.loading=!0});container.on('query:append',function(params){self.lastParams=params;self.loading=!0});this.$results.on('scroll',function(){var isLoadMoreVisible=$.contains(document.documentElement,self.$loadingMore[0]);if(self.loading||!isLoadMoreVisible){return}
var currentOffset=self.$results.offset().top+self.$results.outerHeight(!1);var loadingMoreOffset=self.$loadingMore.offset().top+self.$loadingMore.outerHeight(!1);if(currentOffset+50>=loadingMoreOffset){self.loadMore()}})};InfiniteScroll.prototype.loadMore=function(){this.loading=!0;var params=$.extend({},{page:1},this.lastParams);params.page++;this.trigger('query:append',params)};InfiniteScroll.prototype.showLoadingMore=function(_,data){return data.pagination&&data.pagination.more};InfiniteScroll.prototype.createLoadingMore=function(){var $option=$('<li '+'class="select2-results__option select2-results__option--load-more"'+'role="option" aria-disabled="true"></li>');var message=this.options.get('translations').get('loadingMore');$option.html(message(this.lastParams));return $option};return InfiniteScroll});S2.define('select2/dropdown/attachBody',['jquery','../utils'],function($,Utils){function AttachBody(decorated,$element,options){this.$dropdownParent=options.get('dropdownParent')||$(document.body);decorated.call(this,$element,options)}
AttachBody.prototype.bind=function(decorated,container,$container){var self=this;var setupResultsEvents=!1;decorated.call(this,container,$container);container.on('open',function(){self._showDropdown();self._attachPositioningHandler(container);if(!setupResultsEvents){setupResultsEvents=!0;container.on('results:all',function(){self._positionDropdown();self._resizeDropdown()});container.on('results:append',function(){self._positionDropdown();self._resizeDropdown()})}});container.on('close',function(){self._hideDropdown();self._detachPositioningHandler(container)});this.$dropdownContainer.on('mousedown',function(evt){evt.stopPropagation()})};AttachBody.prototype.destroy=function(decorated){decorated.call(this);this.$dropdownContainer.remove()};AttachBody.prototype.position=function(decorated,$dropdown,$container){$dropdown.attr('class',$container.attr('class'));$dropdown.removeClass('select2');$dropdown.addClass('select2-container--open');$dropdown.css({position:'absolute',top:-999999});this.$container=$container};AttachBody.prototype.render=function(decorated){var $container=$('<span></span>');var $dropdown=decorated.call(this);$container.append($dropdown);this.$dropdownContainer=$container;return $container};AttachBody.prototype._hideDropdown=function(decorated){this.$dropdownContainer.detach()};AttachBody.prototype._attachPositioningHandler=function(decorated,container){var self=this;var scrollEvent='scroll.select2.'+container.id;var resizeEvent='resize.select2.'+container.id;var orientationEvent='orientationchange.select2.'+container.id;var $watchers=this.$container.parents().filter(Utils.hasScroll);$watchers.each(function(){$(this).data('select2-scroll-position',{x:$(this).scrollLeft(),y:$(this).scrollTop()})});$watchers.on(scrollEvent,function(ev){var position=$(this).data('select2-scroll-position');$(this).scrollTop(position.y)});$(window).on(scrollEvent+' '+resizeEvent+' '+orientationEvent,function(e){self._positionDropdown();self._resizeDropdown()})};AttachBody.prototype._detachPositioningHandler=function(decorated,container){var scrollEvent='scroll.select2.'+container.id;var resizeEvent='resize.select2.'+container.id;var orientationEvent='orientationchange.select2.'+container.id;var $watchers=this.$container.parents().filter(Utils.hasScroll);$watchers.off(scrollEvent);$(window).off(scrollEvent+' '+resizeEvent+' '+orientationEvent)};AttachBody.prototype._positionDropdown=function(){var $window=$(window);var isCurrentlyAbove=this.$dropdown.hasClass('select2-dropdown--above');var isCurrentlyBelow=this.$dropdown.hasClass('select2-dropdown--below');var newDirection=null;var offset=this.$container.offset();offset.bottom=offset.top+this.$container.outerHeight(!1);var container={height:this.$container.outerHeight(!1)};container.top=offset.top;container.bottom=offset.top+container.height;var dropdown={height:this.$dropdown.outerHeight(!1)};var viewport={top:$window.scrollTop(),bottom:$window.scrollTop()+$window.height()};var enoughRoomAbove=viewport.top<(offset.top-dropdown.height);var enoughRoomBelow=viewport.bottom>(offset.bottom+dropdown.height);var css={left:offset.left,top:container.bottom};var $offsetParent=this.$dropdownParent;if($offsetParent.css('position')==='static'){$offsetParent=$offsetParent.offsetParent()}
var parentOffset=$offsetParent.offset();css.left-=parentOffset.left;if(!isCurrentlyAbove&&!isCurrentlyBelow){newDirection='below'}
if(!enoughRoomBelow&&enoughRoomAbove&&!isCurrentlyAbove){newDirection='above'}else if(!enoughRoomAbove&&enoughRoomBelow&&isCurrentlyAbove){newDirection='below'}
if(newDirection=='above'||(isCurrentlyAbove&&newDirection!=='below')){css.top=container.top-dropdown.height}
if(newDirection!=null){this.$dropdown.removeClass('select2-dropdown--below select2-dropdown--above').addClass('select2-dropdown--'+newDirection);this.$container.removeClass('select2-container--below select2-container--above').addClass('select2-container--'+newDirection)}
this.$dropdownContainer.css(css)};AttachBody.prototype._resizeDropdown=function(){var css={width:this.$container.outerWidth(!1)+'px'};if(this.options.get('dropdownAutoWidth')){css.minWidth=css.width;css.position='relative';css.width='auto'}
this.$dropdown.css(css)};AttachBody.prototype._showDropdown=function(decorated){this.$dropdownContainer.appendTo(this.$dropdownParent);this._positionDropdown();this._resizeDropdown()};return AttachBody});S2.define('select2/dropdown/minimumResultsForSearch',[],function(){function countResults(data){var count=0;for(var d=0;d<data.length;d++){var item=data[d];if(item.children){count+=countResults(item.children)}else{count++}}
return count}
function MinimumResultsForSearch(decorated,$element,options,dataAdapter){this.minimumResultsForSearch=options.get('minimumResultsForSearch');if(this.minimumResultsForSearch<0){this.minimumResultsForSearch=Infinity}
decorated.call(this,$element,options,dataAdapter)}
MinimumResultsForSearch.prototype.showSearch=function(decorated,params){if(countResults(params.data.results)<this.minimumResultsForSearch){return!1}
return decorated.call(this,params)};return MinimumResultsForSearch});S2.define('select2/dropdown/selectOnClose',[],function(){function SelectOnClose(){}
SelectOnClose.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container);container.on('close',function(params){self._handleSelectOnClose(params)})};SelectOnClose.prototype._handleSelectOnClose=function(_,params){if(params&&params.originalSelect2Event!=null){var event=params.originalSelect2Event;if(event._type==='select'||event._type==='unselect'){return}}
var $highlightedResults=this.getHighlightedResults();if($highlightedResults.length<1){return}
var data=$highlightedResults.data('data');if((data.element!=null&&data.element.selected)||(data.element==null&&data.selected)){return}
this.trigger('select',{data:data})};return SelectOnClose});S2.define('select2/dropdown/closeOnSelect',[],function(){function CloseOnSelect(){}
CloseOnSelect.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container);container.on('select',function(evt){self._selectTriggered(evt)});container.on('unselect',function(evt){self._selectTriggered(evt)})};CloseOnSelect.prototype._selectTriggered=function(_,evt){var originalEvent=evt.originalEvent;if(originalEvent&&originalEvent.ctrlKey){return}
this.trigger('close',{originalEvent:originalEvent,originalSelect2Event:evt})};return CloseOnSelect});S2.define('select2/i18n/en',[],function(){return{errorLoading:function(){return'The results could not be loaded.'},inputTooLong:function(args){var overChars=args.input.length-args.maximum;var message='Please delete '+overChars+' character';if(overChars!=1){message+='s'}
return message},inputTooShort:function(args){var remainingChars=args.minimum-args.input.length;var message='Please enter '+remainingChars+' or more characters';return message},loadingMore:function(){return'Loading more results…'},maximumSelected:function(args){var message='You can only select '+args.maximum+' item';if(args.maximum!=1){message+='s'}
return message},noResults:function(){return'No results found'},searching:function(){return'Searching…'}}});S2.define('select2/defaults',['jquery','require','./results','./selection/single','./selection/multiple','./selection/placeholder','./selection/allowClear','./selection/search','./selection/eventRelay','./utils','./translation','./diacritics','./data/select','./data/array','./data/ajax','./data/tags','./data/tokenizer','./data/minimumInputLength','./data/maximumInputLength','./data/maximumSelectionLength','./dropdown','./dropdown/search','./dropdown/hidePlaceholder','./dropdown/infiniteScroll','./dropdown/attachBody','./dropdown/minimumResultsForSearch','./dropdown/selectOnClose','./dropdown/closeOnSelect','./i18n/en'],function($,require,ResultsList,SingleSelection,MultipleSelection,Placeholder,AllowClear,SelectionSearch,EventRelay,Utils,Translation,DIACRITICS,SelectData,ArrayData,AjaxData,Tags,Tokenizer,MinimumInputLength,MaximumInputLength,MaximumSelectionLength,Dropdown,DropdownSearch,HidePlaceholder,InfiniteScroll,AttachBody,MinimumResultsForSearch,SelectOnClose,CloseOnSelect,EnglishTranslation){function Defaults(){this.reset()}
Defaults.prototype.apply=function(options){options=$.extend(!0,{},this.defaults,options);if(options.dataAdapter==null){if(options.ajax!=null){options.dataAdapter=AjaxData}else if(options.data!=null){options.dataAdapter=ArrayData}else{options.dataAdapter=SelectData}
if(options.minimumInputLength>0){options.dataAdapter=Utils.Decorate(options.dataAdapter,MinimumInputLength)}
if(options.maximumInputLength>0){options.dataAdapter=Utils.Decorate(options.dataAdapter,MaximumInputLength)}
if(options.maximumSelectionLength>0){options.dataAdapter=Utils.Decorate(options.dataAdapter,MaximumSelectionLength)}
if(options.tags){options.dataAdapter=Utils.Decorate(options.dataAdapter,Tags)}
if(options.tokenSeparators!=null||options.tokenizer!=null){options.dataAdapter=Utils.Decorate(options.dataAdapter,Tokenizer)}
if(options.query!=null){var Query=require(options.amdBase+'compat/query');options.dataAdapter=Utils.Decorate(options.dataAdapter,Query)}
if(options.initSelection!=null){var InitSelection=require(options.amdBase+'compat/initSelection');options.dataAdapter=Utils.Decorate(options.dataAdapter,InitSelection)}}
if(options.resultsAdapter==null){options.resultsAdapter=ResultsList;if(options.ajax!=null){options.resultsAdapter=Utils.Decorate(options.resultsAdapter,InfiniteScroll)}
if(options.placeholder!=null){options.resultsAdapter=Utils.Decorate(options.resultsAdapter,HidePlaceholder)}
if(options.selectOnClose){options.resultsAdapter=Utils.Decorate(options.resultsAdapter,SelectOnClose)}}
if(options.dropdownAdapter==null){if(options.multiple){options.dropdownAdapter=Dropdown}else{var SearchableDropdown=Utils.Decorate(Dropdown,DropdownSearch);options.dropdownAdapter=SearchableDropdown}
if(options.minimumResultsForSearch!==0){options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,MinimumResultsForSearch)}
if(options.closeOnSelect){options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,CloseOnSelect)}
if(options.dropdownCssClass!=null||options.dropdownCss!=null||options.adaptDropdownCssClass!=null){var DropdownCSS=require(options.amdBase+'compat/dropdownCss');options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,DropdownCSS)}
options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,AttachBody)}
if(options.selectionAdapter==null){if(options.multiple){options.selectionAdapter=MultipleSelection}else{options.selectionAdapter=SingleSelection}
if(options.placeholder!=null){options.selectionAdapter=Utils.Decorate(options.selectionAdapter,Placeholder)}
if(options.allowClear){options.selectionAdapter=Utils.Decorate(options.selectionAdapter,AllowClear)}
if(options.multiple){options.selectionAdapter=Utils.Decorate(options.selectionAdapter,SelectionSearch)}
if(options.containerCssClass!=null||options.containerCss!=null||options.adaptContainerCssClass!=null){var ContainerCSS=require(options.amdBase+'compat/containerCss');options.selectionAdapter=Utils.Decorate(options.selectionAdapter,ContainerCSS)}
options.selectionAdapter=Utils.Decorate(options.selectionAdapter,EventRelay)}
if(typeof options.language==='string'){if(options.language.indexOf('-')>0){var languageParts=options.language.split('-');var baseLanguage=languageParts[0];options.language=[options.language,baseLanguage]}else{options.language=[options.language]}}
if($.isArray(options.language)){var languages=new Translation();options.language.push('en');var languageNames=options.language;for(var l=0;l<languageNames.length;l++){var name=languageNames[l];var language={};try{language=Translation.loadPath(name)}catch(e){try{name=this.defaults.amdLanguageBase+name;language=Translation.loadPath(name)}catch(ex){if(options.debug&&window.console&&console.warn){console.warn('Select2: The language file for "'+name+'" could not be '+'automatically loaded. A fallback will be used instead.')}
continue}}
languages.extend(language)}
options.translations=languages}else{var baseTranslation=Translation.loadPath(this.defaults.amdLanguageBase+'en');var customTranslation=new Translation(options.language);customTranslation.extend(baseTranslation);options.translations=customTranslation}
return options};Defaults.prototype.reset=function(){function stripDiacritics(text){function match(a){return DIACRITICS[a]||a}
return text.replace(/[^\u0000-\u007E]/g,match)}
function matcher(params,data){if($.trim(params.term)===''){return data}
if(data.children&&data.children.length>0){var match=$.extend(!0,{},data);for(var c=data.children.length-1;c>=0;c--){var child=data.children[c];var matches=matcher(params,child);if(matches==null){match.children.splice(c,1)}}
if(match.children.length>0){return match}
return matcher(params,match)}
var original=stripDiacritics(data.text).toUpperCase();var term=stripDiacritics(params.term).toUpperCase();if(original.indexOf(term)>-1){return data}
return null}
this.defaults={amdBase:'./',amdLanguageBase:'./i18n/',closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:Utils.escapeMarkup,language:EnglishTranslation,matcher:matcher,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(data){return data},templateResult:function(result){return result.text},templateSelection:function(selection){return selection.text},theme:'default',width:'resolve'}};Defaults.prototype.set=function(key,value){var camelKey=$.camelCase(key);var data={};data[camelKey]=value;var convertedData=Utils._convertData(data);$.extend(this.defaults,convertedData)};var defaults=new Defaults();return defaults});S2.define('select2/options',['require','jquery','./defaults','./utils'],function(require,$,Defaults,Utils){function Options(options,$element){this.options=options;if($element!=null){this.fromElement($element)}
this.options=Defaults.apply(this.options);if($element&&$element.is('input')){var InputCompat=require(this.get('amdBase')+'compat/inputData');this.options.dataAdapter=Utils.Decorate(this.options.dataAdapter,InputCompat)}}
Options.prototype.fromElement=function($e){var excludedData=['select2'];if(this.options.multiple==null){this.options.multiple=$e.prop('multiple')}
if(this.options.disabled==null){this.options.disabled=$e.prop('disabled')}
if(this.options.language==null){if($e.prop('lang')){this.options.language=$e.prop('lang').toLowerCase()}else if($e.closest('[lang]').prop('lang')){this.options.language=$e.closest('[lang]').prop('lang')}}
if(this.options.dir==null){if($e.prop('dir')){this.options.dir=$e.prop('dir')}else if($e.closest('[dir]').prop('dir')){this.options.dir=$e.closest('[dir]').prop('dir')}else{this.options.dir='ltr'}}
$e.prop('disabled',this.options.disabled);$e.prop('multiple',this.options.multiple);if($e.data('select2Tags')){if(this.options.debug&&window.console&&console.warn){console.warn('Select2: The `data-select2-tags` attribute has been changed to '+'use the `data-data` and `data-tags="true"` attributes and will be '+'removed in future versions of Select2.')}
$e.data('data',$e.data('select2Tags'));$e.data('tags',!0)}
if($e.data('ajaxUrl')){if(this.options.debug&&window.console&&console.warn){console.warn('Select2: The `data-ajax-url` attribute has been changed to '+'`data-ajax--url` and support for the old attribute will be removed'+' in future versions of Select2.')}
$e.attr('ajax--url',$e.data('ajaxUrl'));$e.data('ajax--url',$e.data('ajaxUrl'))}
var dataset={};if($.fn.jquery&&$.fn.jquery.substr(0,2)=='1.'&&$e[0].dataset){dataset=$.extend(!0,{},$e[0].dataset,$e.data())}else{dataset=$e.data()}
var data=$.extend(!0,{},dataset);data=Utils._convertData(data);for(var key in data){if($.inArray(key,excludedData)>-1){continue}
if($.isPlainObject(this.options[key])){$.extend(this.options[key],data[key])}else{this.options[key]=data[key]}}
return this};Options.prototype.get=function(key){return this.options[key]};Options.prototype.set=function(key,val){this.options[key]=val};return Options});S2.define('select2/core',['jquery','./options','./utils','./keys'],function($,Options,Utils,KEYS){var Select2=function($element,options){if($element.data('select2')!=null){$element.data('select2').destroy()}
this.$element=$element;this.id=this._generateId($element);options=options||{};this.options=new Options(options,$element);Select2.__super__.constructor.call(this);var tabindex=$element.attr('tabindex')||0;$element.data('old-tabindex',tabindex);$element.attr('tabindex','-1');var DataAdapter=this.options.get('dataAdapter');this.dataAdapter=new DataAdapter($element,this.options);var $container=this.render();this._placeContainer($container);var SelectionAdapter=this.options.get('selectionAdapter');this.selection=new SelectionAdapter($element,this.options);this.$selection=this.selection.render();this.selection.position(this.$selection,$container);var DropdownAdapter=this.options.get('dropdownAdapter');this.dropdown=new DropdownAdapter($element,this.options);this.$dropdown=this.dropdown.render();this.dropdown.position(this.$dropdown,$container);var ResultsAdapter=this.options.get('resultsAdapter');this.results=new ResultsAdapter($element,this.options,this.dataAdapter);this.$results=this.results.render();this.results.position(this.$results,this.$dropdown);var self=this;this._bindAdapters();this._registerDomEvents();this._registerDataEvents();this._registerSelectionEvents();this._registerDropdownEvents();this._registerResultsEvents();this._registerEvents();this.dataAdapter.current(function(initialData){self.trigger('selection:update',{data:initialData})});$element.addClass('select2-hidden-accessible');$element.attr('aria-hidden','true');this._syncAttributes();$element.data('select2',this)};Utils.Extend(Select2,Utils.Observable);Select2.prototype._generateId=function($element){var id='';if($element.attr('id')!=null){id=$element.attr('id')}else if($element.attr('name')!=null){id=$element.attr('name')+'-'+Utils.generateChars(2)}else{id=Utils.generateChars(4)}
id=id.replace(/(:|\.|\[|\]|,)/g,'');id='select2-'+id;return id};Select2.prototype._placeContainer=function($container){$container.insertAfter(this.$element);var width=this._resolveWidth(this.$element,this.options.get('width'));if(width!=null){$container.css('width',width)}};Select2.prototype._resolveWidth=function($element,method){var WIDTH=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if(method=='resolve'){var styleWidth=this._resolveWidth($element,'style');if(styleWidth!=null){return styleWidth}
return this._resolveWidth($element,'element')}
if(method=='element'){var elementWidth=$element.outerWidth(!1);if(elementWidth<=0){return'auto'}
return elementWidth+'px'}
if(method=='style'){var style=$element.attr('style');if(typeof(style)!=='string'){return null}
var attrs=style.split(';');for(var i=0,l=attrs.length;i<l;i=i+1){var attr=attrs[i].replace(/\s/g,'');var matches=attr.match(WIDTH);if(matches!==null&&matches.length>=1){return matches[1]}}
return null}
return method};Select2.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container);this.selection.bind(this,this.$container);this.dropdown.bind(this,this.$container);this.results.bind(this,this.$container)};Select2.prototype._registerDomEvents=function(){var self=this;this.$element.on('change.select2',function(){self.dataAdapter.current(function(data){self.trigger('selection:update',{data:data})})});this.$element.on('focus.select2',function(evt){self.trigger('focus',evt)});this._syncA=Utils.bind(this._syncAttributes,this);this._syncS=Utils.bind(this._syncSubtree,this);if(this.$element[0].attachEvent){this.$element[0].attachEvent('onpropertychange',this._syncA)}
var observer=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(observer!=null){this._observer=new observer(function(mutations){$.each(mutations,self._syncA);$.each(mutations,self._syncS)});this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})}else if(this.$element[0].addEventListener){this.$element[0].addEventListener('DOMAttrModified',self._syncA,!1);this.$element[0].addEventListener('DOMNodeInserted',self._syncS,!1);this.$element[0].addEventListener('DOMNodeRemoved',self._syncS,!1)}};Select2.prototype._registerDataEvents=function(){var self=this;this.dataAdapter.on('*',function(name,params){self.trigger(name,params)})};Select2.prototype._registerSelectionEvents=function(){var self=this;var nonRelayEvents=['toggle','focus'];this.selection.on('toggle',function(){self.toggleDropdown()});this.selection.on('focus',function(params){self.focus(params)});this.selection.on('*',function(name,params){if($.inArray(name,nonRelayEvents)!==-1){return}
self.trigger(name,params)})};Select2.prototype._registerDropdownEvents=function(){var self=this;this.dropdown.on('*',function(name,params){self.trigger(name,params)})};Select2.prototype._registerResultsEvents=function(){var self=this;this.results.on('*',function(name,params){self.trigger(name,params)})};Select2.prototype._registerEvents=function(){var self=this;this.on('open',function(){self.$container.addClass('select2-container--open')});this.on('close',function(){self.$container.removeClass('select2-container--open')});this.on('enable',function(){self.$container.removeClass('select2-container--disabled')});this.on('disable',function(){self.$container.addClass('select2-container--disabled')});this.on('blur',function(){self.$container.removeClass('select2-container--focus')});this.on('query',function(params){if(!self.isOpen()){self.trigger('open',{})}
this.dataAdapter.query(params,function(data){self.trigger('results:all',{data:data,query:params})})});this.on('query:append',function(params){this.dataAdapter.query(params,function(data){self.trigger('results:append',{data:data,query:params})})});this.on('open',function(){setTimeout(function(){self.focusOnActiveElement()},1)});$(document).on('keydown',function(evt){var key=evt.which;if(self.isOpen()){if(key===KEYS.ESC||(key===KEYS.UP&&evt.altKey)){self.close();evt.preventDefault()}else if(key===KEYS.ENTER||key===KEYS.TAB){self.trigger('results:select',{});evt.preventDefault()}else if((key===KEYS.SPACE&&evt.ctrlKey)){self.trigger('results:toggle',{});evt.preventDefault()}else if(key===KEYS.UP){self.trigger('results:previous',{});evt.preventDefault()}else if(key===KEYS.DOWN){self.trigger('results:next',{});evt.preventDefault()}
var $searchField=self.$dropdown.find('.select2-search__field');if(!$searchField.length){$searchField=self.$container.find('.select2-search__field')}
if(key===KEYS.DOWN||key===KEYS.UP){self.focusOnActiveElement()}else{$searchField.focus();setTimeout(function(){self.focusOnActiveElement()},1000)}}else if(self.hasFocus()){if(key===KEYS.ENTER||key===KEYS.SPACE||key===KEYS.DOWN){self.open();evt.preventDefault()}}})};Select2.prototype.focusOnActiveElement=function(){if(this.isOpen()&&!Utils.isTouchscreen()){this.$results.find('li.select2-results__option--highlighted').focus()}};Select2.prototype._syncAttributes=function(){this.options.set('disabled',this.$element.prop('disabled'));if(this.options.get('disabled')){if(this.isOpen()){this.close()}
this.trigger('disable',{})}else{this.trigger('enable',{})}};Select2.prototype._syncSubtree=function(evt,mutations){var changed=!1;var self=this;if(evt&&evt.target&&(evt.target.nodeName!=='OPTION'&&evt.target.nodeName!=='OPTGROUP')){return}
if(!mutations){changed=!0}else if(mutations.addedNodes&&mutations.addedNodes.length>0){for(var n=0;n<mutations.addedNodes.length;n++){var node=mutations.addedNodes[n];if(node.selected){changed=!0}}}else if(mutations.removedNodes&&mutations.removedNodes.length>0){changed=!0}
if(changed){this.dataAdapter.current(function(currentData){self.trigger('selection:update',{data:currentData})})}};Select2.prototype.trigger=function(name,args){var actualTrigger=Select2.__super__.trigger;var preTriggerMap={'open':'opening','close':'closing','select':'selecting','unselect':'unselecting'};if(args===undefined){args={}}
if(name in preTriggerMap){var preTriggerName=preTriggerMap[name];var preTriggerArgs={prevented:!1,name:name,args:args};actualTrigger.call(this,preTriggerName,preTriggerArgs);if(preTriggerArgs.prevented){args.prevented=!0;return}}
actualTrigger.call(this,name,args)};Select2.prototype.toggleDropdown=function(){if(this.options.get('disabled')){return}
if(this.isOpen()){this.close()}else{this.open()}};Select2.prototype.open=function(){if(this.isOpen()){return}
this.trigger('query',{})};Select2.prototype.close=function(){if(!this.isOpen()){return}
this.trigger('close',{})};Select2.prototype.isOpen=function(){return this.$container.hasClass('select2-container--open')};Select2.prototype.hasFocus=function(){return this.$container.hasClass('select2-container--focus')};Select2.prototype.focus=function(data){if(this.hasFocus()){return}
this.$container.addClass('select2-container--focus');this.trigger('focus',{})};Select2.prototype.enable=function(args){if(this.options.get('debug')&&window.console&&console.warn){console.warn('Select2: The `select2("enable")` method has been deprecated and will'+' be removed in later Select2 versions. Use $element.prop("disabled")'+' instead.')}
if(args==null||args.length===0){args=[!0]}
var disabled=!args[0];this.$element.prop('disabled',disabled)};Select2.prototype.data=function(){if(this.options.get('debug')&&arguments.length>0&&window.console&&console.warn){console.warn('Select2: Data can no longer be set using `select2("data")`. You '+'should consider setting the value instead using `$element.val()`.')}
var data=[];this.dataAdapter.current(function(currentData){data=currentData});return data};Select2.prototype.val=function(args){if(this.options.get('debug')&&window.console&&console.warn){console.warn('Select2: The `select2("val")` method has been deprecated and will be'+' removed in later Select2 versions. Use $element.val() instead.')}
if(args==null||args.length===0){return this.$element.val()}
var newVal=args[0];if($.isArray(newVal)){newVal=$.map(newVal,function(obj){return obj.toString()})}
this.$element.val(newVal).trigger('change')};Select2.prototype.destroy=function(){this.$container.remove();if(this.$element[0].detachEvent){this.$element[0].detachEvent('onpropertychange',this._syncA)}
if(this._observer!=null){this._observer.disconnect();this._observer=null}else if(this.$element[0].removeEventListener){this.$element[0].removeEventListener('DOMAttrModified',this._syncA,!1);this.$element[0].removeEventListener('DOMNodeInserted',this._syncS,!1);this.$element[0].removeEventListener('DOMNodeRemoved',this._syncS,!1)}
this._syncA=null;this._syncS=null;this.$element.off('.select2');this.$element.attr('tabindex',this.$element.data('old-tabindex'));this.$element.removeClass('select2-hidden-accessible');this.$element.attr('aria-hidden','false');this.$element.removeData('select2');this.dataAdapter.destroy();this.selection.destroy();this.dropdown.destroy();this.results.destroy();this.dataAdapter=null;this.selection=null;this.dropdown=null;this.results=null};Select2.prototype.render=function(){var $container=$('<span class="select2 select2-container">'+'<span class="selection"></span>'+'<span class="dropdown-wrapper" aria-hidden="true"></span>'+'</span>');$container.attr('dir',this.options.get('dir'));this.$container=$container;this.$container.addClass('select2-container--'+this.options.get('theme'));$container.data('element',this.$element);return $container};return Select2});S2.define('select2/compat/utils',['jquery'],function($){function syncCssClasses($dest,$src,adapter){var classes,replacements=[],adapted;classes=$.trim($dest.attr('class'));if(classes){classes=''+classes;$(classes.split(/\s+/)).each(function(){if(this.indexOf('select2-')===0){replacements.push(this)}})}
classes=$.trim($src.attr('class'));if(classes){classes=''+classes;$(classes.split(/\s+/)).each(function(){if(this.indexOf('select2-')!==0){adapted=adapter(this);if(adapted!=null){replacements.push(adapted)}}})}
$dest.attr('class',replacements.join(' '))}
return{syncCssClasses:syncCssClasses}});S2.define('select2/compat/containerCss',['jquery','./utils'],function($,CompatUtils){function _containerAdapter(clazz){return null}
function ContainerCSS(){}
ContainerCSS.prototype.render=function(decorated){var $container=decorated.call(this);var containerCssClass=this.options.get('containerCssClass')||'';if($.isFunction(containerCssClass)){containerCssClass=containerCssClass(this.$element)}
var containerCssAdapter=this.options.get('adaptContainerCssClass');containerCssAdapter=containerCssAdapter||_containerAdapter;if(containerCssClass.indexOf(':all:')!==-1){containerCssClass=containerCssClass.replace(':all:','');var _cssAdapter=containerCssAdapter;containerCssAdapter=function(clazz){var adapted=_cssAdapter(clazz);if(adapted!=null){return adapted+' '+clazz}
return clazz}}
var containerCss=this.options.get('containerCss')||{};if($.isFunction(containerCss)){containerCss=containerCss(this.$element)}
CompatUtils.syncCssClasses($container,this.$element,containerCssAdapter);$container.css(containerCss);$container.addClass(containerCssClass);return $container};return ContainerCSS});S2.define('select2/compat/dropdownCss',['jquery','./utils'],function($,CompatUtils){function _dropdownAdapter(clazz){return null}
function DropdownCSS(){}
DropdownCSS.prototype.render=function(decorated){var $dropdown=decorated.call(this);var dropdownCssClass=this.options.get('dropdownCssClass')||'';if($.isFunction(dropdownCssClass)){dropdownCssClass=dropdownCssClass(this.$element)}
var dropdownCssAdapter=this.options.get('adaptDropdownCssClass');dropdownCssAdapter=dropdownCssAdapter||_dropdownAdapter;if(dropdownCssClass.indexOf(':all:')!==-1){dropdownCssClass=dropdownCssClass.replace(':all:','');var _cssAdapter=dropdownCssAdapter;dropdownCssAdapter=function(clazz){var adapted=_cssAdapter(clazz);if(adapted!=null){return adapted+' '+clazz}
return clazz}}
var dropdownCss=this.options.get('dropdownCss')||{};if($.isFunction(dropdownCss)){dropdownCss=dropdownCss(this.$element)}
CompatUtils.syncCssClasses($dropdown,this.$element,dropdownCssAdapter);$dropdown.css(dropdownCss);$dropdown.addClass(dropdownCssClass);return $dropdown};return DropdownCSS});S2.define('select2/compat/initSelection',['jquery'],function($){function InitSelection(decorated,$element,options){if(options.get('debug')&&window.console&&console.warn){console.warn('Select2: The `initSelection` option has been deprecated in favor'+' of a custom data adapter that overrides the `current` method. '+'This method is now called multiple times instead of a single '+'time when the instance is initialized. Support will be removed '+'for the `initSelection` option in future versions of Select2')}
this.initSelection=options.get('initSelection');this._isInitialized=!1;decorated.call(this,$element,options)}
InitSelection.prototype.current=function(decorated,callback){var self=this;if(this._isInitialized){decorated.call(this,callback);return}
this.initSelection.call(null,this.$element,function(data){self._isInitialized=!0;if(!$.isArray(data)){data=[data]}
callback(data)})};return InitSelection});S2.define('select2/compat/inputData',['jquery'],function($){function InputData(decorated,$element,options){this._currentData=[];this._valueSeparator=options.get('valueSeparator')||',';if($element.prop('type')==='hidden'){if(options.get('debug')&&console&&console.warn){console.warn('Select2: Using a hidden input with Select2 is no longer '+'supported and may stop working in the future. It is recommended '+'to use a `<select>` element instead.')}}
decorated.call(this,$element,options)}
InputData.prototype.current=function(_,callback){function getSelected(data,selectedIds){var selected=[];if(data.selected||$.inArray(data.id,selectedIds)!==-1){data.selected=!0;selected.push(data)}else{data.selected=!1}
if(data.children){selected.push.apply(selected,getSelected(data.children,selectedIds))}
return selected}
var selected=[];for(var d=0;d<this._currentData.length;d++){var data=this._currentData[d];selected.push.apply(selected,getSelected(data,this.$element.val().split(this._valueSeparator)))}
callback(selected)};InputData.prototype.select=function(_,data){if(!this.options.get('multiple')){this.current(function(allData){$.map(allData,function(data){data.selected=!1})});this.$element.val(data.id);this.$element.trigger('change')}else{var value=this.$element.val();value+=this._valueSeparator+data.id;this.$element.val(value);this.$element.trigger('change')}};InputData.prototype.unselect=function(_,data){var self=this;data.selected=!1;this.current(function(allData){var values=[];for(var d=0;d<allData.length;d++){var item=allData[d];if(data.id==item.id){continue}
values.push(item.id)}
self.$element.val(values.join(self._valueSeparator));self.$element.trigger('change')})};InputData.prototype.query=function(_,params,callback){var results=[];for(var d=0;d<this._currentData.length;d++){var data=this._currentData[d];var matches=this.matches(params,data);if(matches!==null){results.push(matches)}}
callback({results:results})};InputData.prototype.addOptions=function(_,$options){var options=$.map($options,function($option){return $.data($option[0],'data')});this._currentData.push.apply(this._currentData,options)};return InputData});S2.define('select2/compat/matcher',['jquery'],function($){function oldMatcher(matcher){function wrappedMatcher(params,data){var match=$.extend(!0,{},data);if(params.term==null||$.trim(params.term)===''){return match}
if(data.children){for(var c=data.children.length-1;c>=0;c--){var child=data.children[c];var doesMatch=matcher(params.term,child.text,child);if(!doesMatch){match.children.splice(c,1)}}
if(match.children.length>0){return match}}
if(matcher(params.term,data.text,data)){return match}
return null}
return wrappedMatcher}
return oldMatcher});S2.define('select2/compat/query',[],function(){function Query(decorated,$element,options){if(options.get('debug')&&window.console&&console.warn){console.warn('Select2: The `query` option has been deprecated in favor of a '+'custom data adapter that overrides the `query` method. Support '+'will be removed for the `query` option in future versions of '+'Select2.')}
decorated.call(this,$element,options)}
Query.prototype.query=function(_,params,callback){params.callback=callback;var query=this.options.get('query');query.call(null,params)};return Query});S2.define('select2/dropdown/attachContainer',[],function(){function AttachContainer(decorated,$element,options){decorated.call(this,$element,options)}
AttachContainer.prototype.position=function(decorated,$dropdown,$container){var $dropdownContainer=$container.find('.dropdown-wrapper');$dropdownContainer.append($dropdown);$dropdown.addClass('select2-dropdown--below');$container.addClass('select2-container--below')};return AttachContainer});S2.define('select2/dropdown/stopPropagation',[],function(){function StopPropagation(){}
StopPropagation.prototype.bind=function(decorated,container,$container){decorated.call(this,container,$container);var stoppedEvents=['blur','change','click','dblclick','focus','focusin','focusout','input','keydown','keyup','keypress','mousedown','mouseenter','mouseleave','mousemove','mouseover','mouseup','search','touchend','touchstart'];this.$dropdown.on(stoppedEvents.join(' '),function(evt){evt.stopPropagation()})};return StopPropagation});S2.define('select2/selection/stopPropagation',[],function(){function StopPropagation(){}
StopPropagation.prototype.bind=function(decorated,container,$container){decorated.call(this,container,$container);var stoppedEvents=['blur','change','click','dblclick','focus','focusin','focusout','input','keydown','keyup','keypress','mousedown','mouseenter','mouseleave','mousemove','mouseover','mouseup','search','touchend','touchstart'];this.$selection.on(stoppedEvents.join(' '),function(evt){evt.stopPropagation()})};return StopPropagation});/*!
 * jQuery Mousewheel 3.1.13
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license
 * http://jquery.org/license
 */
(function(factory){if(typeof S2.define==='function'&&S2.define.amd){S2.define('jquery-mousewheel',['jquery'],factory)}else if(typeof exports==='object'){module.exports=factory}else{factory(jQuery)}}(function($){var toFix=['wheel','mousewheel','DOMMouseScroll','MozMousePixelScroll'],toBind=('onwheel' in document||document.documentMode>=9)?['wheel']:['mousewheel','DomMouseScroll','MozMousePixelScroll'],slice=Array.prototype.slice,nullLowestDeltaTimeout,lowestDelta;if($.event.fixHooks){for(var i=toFix.length;i;){$.event.fixHooks[toFix[--i]]=$.event.mouseHooks}}
var special=$.event.special.mousewheel={version:'3.1.12',setup:function(){if(this.addEventListener){for(var i=toBind.length;i;){this.addEventListener(toBind[--i],handler,!1)}}else{this.onmousewheel=handler}
$.data(this,'mousewheel-line-height',special.getLineHeight(this));$.data(this,'mousewheel-page-height',special.getPageHeight(this))},teardown:function(){if(this.removeEventListener){for(var i=toBind.length;i;){this.removeEventListener(toBind[--i],handler,!1)}}else{this.onmousewheel=null}
$.removeData(this,'mousewheel-line-height');$.removeData(this,'mousewheel-page-height')},getLineHeight:function(elem){var $elem=$(elem),$parent=$elem['offsetParent' in $.fn?'offsetParent':'parent']();if(!$parent.length){$parent=$('body')}
return parseInt($parent.css('fontSize'),10)||parseInt($elem.css('fontSize'),10)||16},getPageHeight:function(elem){return $(elem).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};$.fn.extend({mousewheel:function(fn){return fn?this.bind('mousewheel',fn):this.trigger('mousewheel')},unmousewheel:function(fn){return this.unbind('mousewheel',fn)}});function handler(event){var orgEvent=event||window.event,args=slice.call(arguments,1),delta=0,deltaX=0,deltaY=0,absDelta=0,offsetX=0,offsetY=0;event=$.event.fix(orgEvent);event.type='mousewheel';if('detail' in orgEvent){deltaY=orgEvent.detail*-1}
if('wheelDelta' in orgEvent){deltaY=orgEvent.wheelDelta}
if('wheelDeltaY' in orgEvent){deltaY=orgEvent.wheelDeltaY}
if('wheelDeltaX' in orgEvent){deltaX=orgEvent.wheelDeltaX*-1}
if('axis' in orgEvent&&orgEvent.axis===orgEvent.HORIZONTAL_AXIS){deltaX=deltaY*-1;deltaY=0}
delta=deltaY===0?deltaX:deltaY;if('deltaY' in orgEvent){deltaY=orgEvent.deltaY*-1;delta=deltaY}
if('deltaX' in orgEvent){deltaX=orgEvent.deltaX;if(deltaY===0){delta=deltaX*-1}}
if(deltaY===0&&deltaX===0){return}
if(orgEvent.deltaMode===1){var lineHeight=$.data(this,'mousewheel-line-height');delta*=lineHeight;deltaY*=lineHeight;deltaX*=lineHeight}else if(orgEvent.deltaMode===2){var pageHeight=$.data(this,'mousewheel-page-height');delta*=pageHeight;deltaY*=pageHeight;deltaX*=pageHeight}
absDelta=Math.max(Math.abs(deltaY),Math.abs(deltaX));if(!lowestDelta||absDelta<lowestDelta){lowestDelta=absDelta;if(shouldAdjustOldDeltas(orgEvent,absDelta)){lowestDelta/=40}}
if(shouldAdjustOldDeltas(orgEvent,absDelta)){delta/=40;deltaX/=40;deltaY/=40}
delta=Math[delta>=1?'floor':'ceil'](delta/lowestDelta);deltaX=Math[deltaX>=1?'floor':'ceil'](deltaX/lowestDelta);deltaY=Math[deltaY>=1?'floor':'ceil'](deltaY/lowestDelta);if(special.settings.normalizeOffset&&this.getBoundingClientRect){var boundingRect=this.getBoundingClientRect();offsetX=event.clientX-boundingRect.left;offsetY=event.clientY-boundingRect.top}
event.deltaX=deltaX;event.deltaY=deltaY;event.deltaFactor=lowestDelta;event.offsetX=offsetX;event.offsetY=offsetY;event.deltaMode=0;args.unshift(event,delta,deltaX,deltaY);if(nullLowestDeltaTimeout){clearTimeout(nullLowestDeltaTimeout)}
nullLowestDeltaTimeout=setTimeout(nullLowestDelta,200);return($.event.dispatch||$.event.handle).apply(this,args)}
function nullLowestDelta(){lowestDelta=null}
function shouldAdjustOldDeltas(orgEvent,absDelta){return special.settings.adjustOldDeltas&&orgEvent.type==='mousewheel'&&absDelta%120===0}}));S2.define('jquery.select2',['jquery','jquery-mousewheel','./select2/core','./select2/defaults'],function($,_,Select2,Defaults){if($.fn.selectWoo==null){var thisMethods=['open','close','destroy'];$.fn.selectWoo=function(options){options=options||{};if(typeof options==='object'){this.each(function(){var instanceOptions=$.extend(!0,{},options);var instance=new Select2($(this),instanceOptions)});return this}else if(typeof options==='string'){var ret;var args=Array.prototype.slice.call(arguments,1);this.each(function(){var instance=$(this).data('select2');if(instance==null&&window.console&&console.error){console.error('The select2(\''+options+'\') method was called on an '+'element that is not using Select2.')}
ret=instance[options].apply(instance,args)});if($.inArray(options,thisMethods)>-1){return this}
return ret}else{throw new Error('Invalid arguments for Select2: '+options)}}}
if($.fn.select2!=null&&$.fn.select2.defaults!=null){$.fn.selectWoo.defaults=$.fn.select2.defaults}
if($.fn.selectWoo.defaults==null){$.fn.selectWoo.defaults=Defaults}
$.fn.select2=$.fn.select2||$.fn.selectWoo;return Select2});return{define:S2.define,require:S2.require}}());var select2=S2.require('jquery.select2');jQuery.fn.select2.amd=S2;jQuery.fn.selectWoo.amd=S2;return select2}));
/*! Select2 4.0.4 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/de",[],function(){return{errorLoading:function(){return"Die Ergebnisse konnten nicht geladen werden."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Bitte "+t+" Zeichen weniger eingeben"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Bitte "+t+" Zeichen mehr eingeben"},loadingMore:function(){return"Lade mehr Ergebnisse…"},maximumSelected:function(e){var t="Sie können nur "+e.maximum+" Eintr";return e.maximum===1?t+="ag":t+="äge",t+=" auswählen",t},noResults:function(){return"Keine Übereinstimmungen gefunden"},searching:function(){return"Suche…"}}}),{define:e.define,require:e.require}})();
/*! Select2 4.0.4 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Please enter "+t+" or more characters";return n},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),{define:e.define,require:e.require}})();
/*!
	Modaal - accessible modals - v0.4.4
	by Humaan, for all humans.
	http://humaan.com
 */
(function($){var modaal_loading_spinner='<div class="modaal-loading-spinner"><div><div></div></div><div><div></div></div><div><div></div></div><div><div></div></div><div><div></div></div><div><div></div></div><div><div></div></div><div><div></div></div></div>'
var Modaal={init:function(options,elem){var self=this;self.dom=$('body');self.$elem=$(elem);self.options=$.extend({},$.fn.modaal.options,self.$elem.data(),options);self.xhr=null;self.scope={is_open:!1,id:'modaal_'+(new Date().getTime())+(Math.random().toString(16).substring(2)),source:self.options.content_source?self.options.content_source:self.$elem.attr('href')};self.$elem.attr('data-modaal-scope',self.scope.id);self.private_options={active_class:'is_active'};self.lastFocus=null;if(self.options.is_locked||self.options.type=='confirm'||self.options.hide_close){self.scope.close_btn=''}else{self.scope.close_btn='<button type="button" class="modaal-close" id="modaal-close" aria-label="'+self.options.close_aria_label+'"><span>'+self.options.close_text+'</span></button>'}
if(self.options.animation==='none'){self.options.animation_speed=0;self.options.after_callback_delay=0}
$(elem).on('click.Modaal',function(e){e.preventDefault();self.create_modaal(self,e)});if(self.options.outer_controls===!0){var mod_class='outer'}else{var mod_class='inner'}
self.scope.prev_btn='<button type="button" class="modaal-gallery-control modaal-gallery-prev modaal-gallery-prev-'+mod_class+'" id="modaal-gallery-prev" aria-label="'+self.options.prev_aria_label+'"><span>'+self.options.prev_text+'</span></button>';self.scope.next_btn='<button type="button" class="modaal-gallery-control modaal-gallery-next modaal-gallery-next-'+mod_class+'" id="modaal-gallery-next" aria-label="'+self.options.next_aria_label+'"><span>'+self.options.next_text+'</span></button>';if(self.options.start_open===!0){self.create_modaal(self)}},create_modaal:function(self,e){var self=this;var source;self.lastFocus=self.$elem;if(self.options.should_open===!1||(typeof self.options.should_open==='function'&&self.options.should_open()===!1)){return}
self.options.before_open.call(self,e);switch(self.options.type){case 'inline':self.create_basic();break;case 'ajax':source=self.options.source(self.$elem,self.scope.source);self.fetch_ajax(source);break;case 'confirm':self.options.is_locked=!0;self.create_confirm();break;case 'image':self.create_image();break;case 'iframe':source=self.options.source(self.$elem,self.scope.source);self.create_iframe(source);break;case 'video':self.create_video(self.scope.source);break;case 'instagram':self.create_instagram();break}
self.watch_events()},watch_events:function(){var self=this;self.dom.off('click.Modaal keyup.Modaal keydown.Modaal');self.dom.on('keydown.Modaal',function(e){var key=e.keyCode;var target=e.target;if(key==9&&self.scope.is_open){if(!$.contains(document.getElementById(self.scope.id),target)){$('#'+self.scope.id).find('*[tabindex="0"]').focus()}}});self.dom.on('keyup.Modaal',function(e){var key=e.keyCode;var target=e.target;if((e.shiftKey&&e.keyCode==9)&&self.scope.is_open){if(!$.contains(document.getElementById(self.scope.id),target)){$('#'+self.scope.id).find('.modaal-close').focus()}}
if(!self.options.is_locked){if(key==27&&self.scope.is_open){if($(document.activeElement).is('input:not(:checkbox):not(:radio)')){return!1}
self.modaal_close();return}}
if(self.options.type=='image'){if(key==37&&self.scope.is_open&&(!$('#'+self.scope.id+' .modaal-gallery-prev').hasClass('is_hidden'))){self.gallery_update('prev')}
if(key==39&&self.scope.is_open&&(!$('#'+self.scope.id+' .modaal-gallery-next').hasClass('is_hidden'))){self.gallery_update('next')}
return}});self.dom.on('click.Modaal',function(e){var trigger=$(e.target);if(!self.options.is_locked){if((self.options.overlay_close&&trigger.is('.modaal-inner-wrapper'))||trigger.is('.modaal-close')||trigger.closest('.modaal-close').length){self.modaal_close();return}}
if(trigger.is('.modaal-confirm-btn')){if(trigger.is('.modaal-ok')){self.options.confirm_callback.call(self,self.lastFocus)}
if(trigger.is('.modaal-cancel')){self.options.confirm_cancel_callback.call(self,self.lastFocus)}
self.modaal_close();return}
if(trigger.is('.modaal-gallery-control')){if(trigger.hasClass('is_hidden')){return}
if(trigger.is('.modaal-gallery-prev')){self.gallery_update('prev')}
if(trigger.is('.modaal-gallery-next')){self.gallery_update('next')}
return}})},build_modal:function(content){var self=this;var igClass='';if(self.options.type=='instagram'){igClass=' modaal-instagram'}
var wrap_class=(self.options.type=='video')?'modaal-video-wrap':'modaal-content';var animation_class;switch(self.options.animation){case 'fade':animation_class=' modaal-start_fade';break;case 'slide-down':animation_class=' modaal-start_slidedown';break;default:animation_class=' modaal-start_none'}
var fullscreen_class='';if(self.options.fullscreen){fullscreen_class=' modaal-fullscreen'}
if(self.options.custom_class!==''||typeof(self.options.custom_class)!=='undefined'){self.options.custom_class=' '+self.options.custom_class}
var dimensionsStyle='';if(self.options.width&&self.options.height&&typeof self.options.width=='number'&&typeof self.options.height=='number'){dimensionsStyle=' style="max-width:'+self.options.width+'px;height:'+self.options.height+'px;overflow:auto;"'}else if(self.options.width&&typeof self.options.width=='number'){dimensionsStyle=' style="max-width:'+self.options.width+'px;"'}else if(self.options.height&&typeof self.options.height=='number'){dimensionsStyle=' style="height:'+self.options.height+'px;overflow:auto;"'}
if(self.options.type=='image'||self.options.type=='video'||self.options.type=='instagram'||self.options.fullscreen){dimensionsStyle=''}
var touchTrigger='';if(self.is_touch()){touchTrigger=' style="cursor:pointer;"'}
var build_markup='<div class="modaal-wrapper modaal-'+self.options.type+animation_class+igClass+fullscreen_class+self.options.custom_class+'" id="'+self.scope.id+'"><div class="modaal-outer-wrapper"><div class="modaal-inner-wrapper"'+touchTrigger+'>';if(self.options.type!='video'){build_markup+='<div class="modaal-container"'+dimensionsStyle+'>'}
build_markup+='<div class="'+wrap_class+' modaal-focus" aria-hidden="false" aria-label="'+self.options.accessible_title+' - '+self.options.close_aria_label+'" role="dialog">';if(self.options.type=='inline'){build_markup+='<div class="modaal-content-container" role="document"></div>'}else{build_markup+=content}
build_markup+='</div>'+self.scope.close_btn;if(self.options.type!='video'){build_markup+='</div>'}
build_markup+='</div>';if(self.options.type=='image'&&self.options.outer_controls===!0){build_markup+=self.scope.prev_btn+self.scope.next_btn}
build_markup+='</div></div>';if($('#'+self.scope.id+'_overlay').length<1){self.dom.append(build_markup)}
if(self.options.type=='inline'){content.appendTo('#'+self.scope.id+' .modaal-content-container')}
self.modaal_overlay('show')},create_basic:function(){var self=this;var target=$(self.scope.source);var content='';if(target.length){content=target.contents().detach();target.empty()}else{content='Content could not be loaded. Please check the source and try again.'}
self.build_modal(content)},create_instagram:function(){var self=this;var id=self.options.instagram_id;var content='';var error_msg='Instagram photo couldn\'t be loaded, please check the embed code and try again.';self.build_modal('<div class="modaal-content-container'+(self.options.loading_class!=''?' '+self.options.loading_class:'')+'">'+self.options.loading_content+'</div>');if(id!=''&&id!==null&&id!==undefined){var ig_url='https://api.instagram.com/oembed?url=http://instagr.am/p/'+id+'/';$.ajax({url:ig_url,dataType:"jsonp",cache:!1,success:function(data){self.dom.append('<div id="temp-ig" style="width:0;height:0;overflow:hidden;">'+data.html+'</div>');if(self.dom.attr('data-igloaded')){window.instgrm.Embeds.process()}else{self.dom.attr('data-igloaded','true')}
var target='#'+self.scope.id+' .modaal-content-container';if($(target).length>0){setTimeout(function(){$('#temp-ig').contents().clone().appendTo(target);$('#temp-ig').remove()},1000)}},error:function(){content=error_msg;var target=$('#'+self.scope.id+' .modaal-content-container');if(target.length>0){target.removeClass(self.options.loading_class).addClass(self.options.ajax_error_class);target.html(content)}}})}else{content=error_msg}
return!1},fetch_ajax:function(url){var self=this;var content='';if(self.options.accessible_title==null){self.options.accessible_title='Dialog Window'}
if(self.xhr!==null){self.xhr.abort();self.xhr=null}
self.build_modal('<div class="modaal-content-container'+(self.options.loading_class!=''?' '+self.options.loading_class:'')+'">'+self.options.loading_content+'</div>');self.xhr=$.ajax(url,{success:function(data){var target=$('#'+self.scope.id).find('.modaal-content-container');if(target.length>0){target.removeClass(self.options.loading_class);target.html(data);self.options.ajax_success.call(self,target)}},error:function(xhr){if(xhr.statusText=='abort'){return}
var target=$('#'+self.scope.id+' .modaal-content-container');if(target.length>0){target.removeClass(self.options.loading_class).addClass(self.options.ajax_error_class);target.html('Content could not be loaded. Please check the source and try again.')}}})},create_confirm:function(){var self=this;var content;content='<div class="modaal-content-container">'+'<h1 id="modaal-title">'+self.options.confirm_title+'</h1>'+'<div class="modaal-confirm-content">'+self.options.confirm_content+'</div>'+'<div class="modaal-confirm-wrap">'+'<button type="button" class="modaal-confirm-btn modaal-ok" aria-label="Confirm">'+self.options.confirm_button_text+'</button>'+'<button type="button" class="modaal-confirm-btn modaal-cancel" aria-label="Cancel">'+self.options.confirm_cancel_button_text+'</button>'+'</div>'+'</div>'+'</div>';self.build_modal(content)},create_image:function(){var self=this;var content;var modaal_image_markup='';var gallery_total;if(self.$elem.is('[data-group]')||self.$elem.is('[rel]')){var use_group=self.$elem.is('[data-group]');var gallery_group=use_group?self.$elem.attr('data-group'):self.$elem.attr('rel');var gallery_group_items=use_group?$('[data-group="'+gallery_group+'"]'):$('[rel="'+gallery_group+'"]');gallery_group_items.removeAttr('data-gallery-active','is_active');self.$elem.attr('data-gallery-active','is_active');gallery_total=gallery_group_items.length-1;var gallery=[];modaal_image_markup='<div class="modaal-gallery-item-wrap">';gallery_group_items.each(function(i,item){var img_src='';var img_alt='';var img_description='';var img_active=!1;var img_src_error=!1;var data_modaal_desc=item.getAttribute('data-modaal-desc');var data_item_active=item.getAttribute('data-gallery-active');if($(item).attr('data-modaal-content-source')){img_src=$(item).attr('data-modaal-content-source')}else if($(item).attr('href')){img_src=$(item).attr('href')}else if($(item).attr('src')){img_src=$(item).attr('src')}else{img_src='trigger requires href or data-modaal-content-source attribute';img_src_error=!0}
if(data_modaal_desc!=''&&data_modaal_desc!==null&&data_modaal_desc!==undefined){img_alt=data_modaal_desc;img_description='<div class="modaal-gallery-label"><span class="modaal-accessible-hide">Image '+(i+1)+' - </span>'+data_modaal_desc.replace(/</g,"&lt;").replace(/>/g,"&gt;")+'</div>'}else{img_description='<div class="modaal-gallery-label"><span class="modaal-accessible-hide">Image '+(i+1)+'</span></div>'}
if(data_item_active){img_active=!0}
var gallery_item={'url':img_src,'alt':img_alt,'rawdesc':data_modaal_desc,'desc':img_description,'active':img_active,'src_error':img_src_error};gallery.push(gallery_item)});for(var i=0;i<gallery.length;i++){var is_active='';var aria_label=gallery[i].rawdesc?self.options.image_text+': '+gallery[i].rawdesc:self.options.image_text+' '+i+self.options.no_description_text;if(gallery[i].active){is_active=' '+self.private_options.active_class}
var image_output=gallery[i].src_error?gallery[i].url:'<img src="'+gallery[i].url+'" alt=" " style="width:100%">';modaal_image_markup+='<div class="modaal-gallery-item gallery-item-'+i+is_active+'" aria-label="'+aria_label+'">'+image_output+gallery[i].desc+'</div>'}
modaal_image_markup+='</div>';if(self.options.outer_controls!=!0){modaal_image_markup+=self.scope.prev_btn+self.scope.next_btn}}else{var this_img_src;var img_src_error=!1;if(self.$elem.attr('data-modaal-content-source')){this_img_src=self.$elem.attr('data-modaal-content-source')}else if(self.$elem.attr('href')){this_img_src=self.$elem.attr('href')}else if(self.$elem.attr('src')){this_img_src=self.$elem.attr('src')}else{this_img_src='trigger requires href or data-modaal-content-source attribute';img_src_error=!0}
var this_img_alt_txt='';var this_img_alt='';var aria_label='';if(self.$elem.attr('data-modaal-desc')){aria_label=self.$elem.attr('data-modaal-desc');this_img_alt_txt=self.$elem.attr('data-modaal-desc');this_img_alt='<div class="modaal-gallery-label"><span class="modaal-accessible-hide">'+self.options.image_text+' - </span>'+this_img_alt_txt.replace(/</g,"&lt;").replace(/>/g,"&gt;")+'</div>'}else{aria_label=self.options.image_text+self.options.no_description_text}
var image_output=img_src_error?this_img_src:'<img src="'+this_img_src+'" alt=" " style="width:100%">';modaal_image_markup='<div class="modaal-gallery-item is_active" aria-label="'+aria_label+'">'+image_output+this_img_alt+'</div>'}
content=modaal_image_markup;self.build_modal(content);if($('.modaal-gallery-item.is_active').is('.gallery-item-0')){$('.modaal-gallery-prev').hide()}
if($('.modaal-gallery-item.is_active').is('.gallery-item-'+gallery_total)){$('.modaal-gallery-next').hide()}},gallery_update:function(direction){var self=this;var this_gallery=$('#'+self.scope.id);var this_gallery_item=this_gallery.find('.modaal-gallery-item');var this_gallery_total=this_gallery_item.length-1;if(this_gallery_total==0){return!1}
var prev_btn=this_gallery.find('.modaal-gallery-prev'),next_btn=this_gallery.find('.modaal-gallery-next');var duration=250;var new_img_w=0,new_img_h=0;var current_item=this_gallery.find('.modaal-gallery-item.'+self.private_options.active_class),incoming_item=(direction=='next'?current_item.next('.modaal-gallery-item'):current_item.prev('.modaal-gallery-item'));self.options.before_image_change.call(self,current_item,incoming_item);if(direction=='prev'&&this_gallery.find('.gallery-item-0').hasClass('is_active')){return!1}else if(direction=='next'&&this_gallery.find('.gallery-item-'+this_gallery_total).hasClass('is_active')){return!1}
current_item.stop().animate({opacity:0},duration,function(){incoming_item.addClass('is_next').css({'position':'absolute','display':'block','opacity':0});var doc_width=$(document).width();var width_threshold=doc_width>1140?280:50;new_img_w=this_gallery.find('.modaal-gallery-item.is_next').width();new_img_h=this_gallery.find('.modaal-gallery-item.is_next').height();var new_natural_w=this_gallery.find('.modaal-gallery-item.is_next img').prop('naturalWidth');var new_natural_h=this_gallery.find('.modaal-gallery-item.is_next img').prop('naturalHeight');if(new_natural_w>(doc_width-width_threshold)){new_img_w=doc_width-width_threshold;this_gallery.find('.modaal-gallery-item.is_next').css({'width':new_img_w});this_gallery.find('.modaal-gallery-item.is_next img').css({'width':new_img_w});new_img_h=this_gallery.find('.modaal-gallery-item.is_next').find('img').height()}else{new_img_w=new_natural_w;new_img_h=new_natural_h}
this_gallery.find('.modaal-gallery-item-wrap').stop().animate({'width':new_img_w,'height':new_img_h},duration,function(){current_item.removeClass(self.private_options.active_class+' '+self.options.gallery_active_class).removeAttr('style');current_item.find('img').removeAttr('style');incoming_item.addClass(self.private_options.active_class+' '+self.options.gallery_active_class).removeClass('is_next').css('position','');incoming_item.stop().animate({opacity:1},duration,function(){$(this).removeAttr('style').css({'width':'100%'});$(this).find('img').css('width','100%');this_gallery.find('.modaal-gallery-item-wrap').removeAttr('style');self.options.after_image_change.call(self,incoming_item)});this_gallery.find('.modaal-gallery-item').removeAttr('tabindex');this_gallery.find('.modaal-gallery-item.'+self.private_options.active_class+'').attr('tabindex','0').focus();if(this_gallery.find('.modaal-gallery-item.'+self.private_options.active_class).is('.gallery-item-0')){prev_btn.stop().animate({opacity:0},150,function(){$(this).hide()})}else{prev_btn.stop().css({'display':'block','opacity':prev_btn.css('opacity')}).animate({opacity:1},150)}
if(this_gallery.find('.modaal-gallery-item.'+self.private_options.active_class).is('.gallery-item-'+this_gallery_total)){next_btn.stop().animate({opacity:0},150,function(){$(this).hide()})}else{next_btn.stop().css({'display':'block','opacity':prev_btn.css('opacity')}).animate({opacity:1},150)}})})},create_video:function(url){var self=this;var content;content='<iframe src="'+url+'" class="modaal-video-frame" frameborder="0" allowfullscreen></iframe>';self.build_modal('<div class="modaal-video-container">'+content+'</div>')},create_iframe:function(url){var self=this;var content;if(self.options.width!==null||self.options.width!==undefined||self.options.height!==null||self.options.height!==undefined){content='<iframe src="'+url+'" class="modaal-iframe-elem" frameborder="0" allowfullscreen></iframe>'}else{content='<div class="modaal-content-container">Please specify a width and height for your iframe</div>'}
self.build_modal(content)},modaal_open:function(){var self=this;var modal_wrapper=$('#'+self.scope.id);var animation_type=self.options.animation;if(animation_type==='none'){modal_wrapper.removeClass('modaal-start_none');self.options.after_open.call(self,modal_wrapper)}
if(animation_type==='fade'){modal_wrapper.removeClass('modaal-start_fade')}
if(animation_type==='slide-down'){modal_wrapper.removeClass('modaal-start_slide_down')}
var focusTarget=modal_wrapper;$('.modaal-wrapper *[tabindex=0]').removeAttr('tabindex');if(self.options.type=='image'){focusTarget=$('#'+self.scope.id).find('.modaal-gallery-item.'+self.private_options.active_class)}else if(modal_wrapper.find('.modaal-iframe-elem').length){focusTarget=modal_wrapper.find('.modaal-iframe-elem')}else if(modal_wrapper.find('.modaal-video-wrap').length){focusTarget=modal_wrapper.find('.modaal-video-wrap')}else{focusTarget=modal_wrapper.find('.modaal-focus')}
focusTarget.attr('tabindex','0').focus();if(animation_type!=='none'){setTimeout(function(){self.options.after_open.call(self,modal_wrapper)},self.options.after_callback_delay)}},modaal_close:function(){var self=this;var modal_wrapper=$('#'+self.scope.id);self.options.before_close.call(self,modal_wrapper);if(self.xhr!==null){self.xhr.abort();self.xhr=null}
if(self.options.animation==='none'){modal_wrapper.addClass('modaal-start_none')}
if(self.options.animation==='fade'){modal_wrapper.addClass('modaal-start_fade')}
if(self.options.animation==='slide-down'){modal_wrapper.addClass('modaal-start_slide_down')}
setTimeout(function(){if(self.options.type=='inline'){$('#'+self.scope.id+' .modaal-content-container').contents().detach().appendTo(self.scope.source)}
modal_wrapper.remove();self.options.after_close.call(self);self.scope.is_open=!1},self.options.after_callback_delay);self.modaal_overlay('hide');if(self.lastFocus!=null){self.lastFocus.focus()}},modaal_overlay:function(action){var self=this;if(action=='show'){self.scope.is_open=!0;if(!self.options.background_scroll){self.dom.addClass('modaal-noscroll')}
if($('#'+self.scope.id+'_overlay').length<1){self.dom.append('<div class="modaal-overlay" id="'+self.scope.id+'_overlay"></div>')}
$('#'+self.scope.id+'_overlay').css('background',self.options.background).stop().animate({opacity:self.options.overlay_opacity},self.options.animation_speed,function(){self.modaal_open()})}else if(action=='hide'){$('#'+self.scope.id+'_overlay').stop().animate({opacity:0},self.options.animation_speed,function(){$(this).remove();self.dom.removeClass('modaal-noscroll')})}},is_touch:function(){return'ontouchstart' in window||navigator.maxTouchPoints}};var modaal_existing_selectors=[];$.fn.modaal=function(options){return this.each(function(i){var existing_modaal=$(this).data('modaal');if(existing_modaal){if(typeof(options)=='string'){switch(options){case 'open':existing_modaal.create_modaal(existing_modaal);break;case 'close':existing_modaal.modaal_close();break}}}else{var modaal=Object.create(Modaal);modaal.init(options,this);$.data(this,"modaal",modaal);modaal_existing_selectors.push({'element':$(this).attr('class'),'options':options})}})};$.fn.modaal.options={type:'inline',content_source:null,animation:'fade',animation_speed:300,after_callback_delay:350,is_locked:!1,hide_close:!1,background:'#000',overlay_opacity:'0.8',overlay_close:!0,accessible_title:'Dialog Window',start_open:!1,fullscreen:!1,custom_class:'',background_scroll:!1,should_open:!0,image_text:'Image',no_description_text:' has no description.',close_text:'Close',close_aria_label:'Close (Press escape to close)',prev_text:'Previous Image',prev_aria_label:'Previous image (use left arrow to change)',next_text:'Next Image',next_aria_label:'Next image (use right arrow to change)',width:null,height:null,before_open:function(){},after_open:function(){},before_close:function(){},after_close:function(){},source:function(element,src){return src},confirm_button_text:'Confirm',confirm_cancel_button_text:'Cancel',confirm_title:'Confirm Title',confirm_content:'<p>This is the default confirm dialog content. Replace me through the options</p>',confirm_callback:function(){},confirm_cancel_callback:function(){},gallery_active_class:'gallery_active_item',outer_controls:!1,before_image_change:function(current_item,incoming_item){},after_image_change:function(current_item){},loading_content:modaal_loading_spinner,loading_class:'is_loading',ajax_error_class:'modaal-error',ajax_success:function(){},instagram_id:null};function modaal_inline_options(self){var options={};var inline_options=!1;if(self.attr('data-modaal-type')){inline_options=!0;options.type=self.attr('data-modaal-type')}
if(self.attr('data-modaal-content-source')){inline_options=!0;options.content_source=self.attr('data-modaal-content-source')}
if(self.attr('data-modaal-animation')){inline_options=!0;options.animation=self.attr('data-modaal-animation')}
if(self.attr('data-modaal-animation-speed')){inline_options=!0;options.animation_speed=self.attr('data-modaal-animation-speed')}
if(self.attr('data-modaal-after-callback-delay')){inline_options=!0;options.after_callback_delay=self.attr('data-modaal-after-callback-delay')}
if(self.attr('data-modaal-is-locked')){inline_options=!0;options.is_locked=(self.attr('data-modaal-is-locked')==='true'?!0:!1)}
if(self.attr('data-modaal-hide-close')){inline_options=!0;options.hide_close=(self.attr('data-modaal-hide-close')==='true'?!0:!1)}
if(self.attr('data-modaal-background')){inline_options=!0;options.background=self.attr('data-modaal-background')}
if(self.attr('data-modaal-overlay-opacity')){inline_options=!0;options.overlay_opacity=self.attr('data-modaal-overlay-opacity')}
if(self.attr('data-modaal-overlay-close')){inline_options=!0;options.overlay_close=(self.attr('data-modaal-overlay-close')==='false'?!1:!0)}
if(self.attr('data-modaal-accessible-title')){inline_options=!0;options.accessible_title=self.attr('data-modaal-accessible-title')}
if(self.attr('data-modaal-start-open')){inline_options=!0;options.start_open=(self.attr('data-modaal-start-open')==='true'?!0:!1)}
if(self.attr('data-modaal-fullscreen')){inline_options=!0;options.fullscreen=(self.attr('data-modaal-fullscreen')==='true'?!0:!1)}
if(self.attr('data-modaal-custom-class')){inline_options=!0;options.custom_class=self.attr('data-modaal-custom-class')}
if(self.attr('data-modaal-close-text')){inline_options=!0;options.close_text=self.attr('data-modaal-close-text')}
if(self.attr('data-modaal-close-aria-label')){inline_options=!0;options.close_aria_label=self.attr('data-modaal-close-aria-label')}
if(self.attr('data-modaal-prev-text')){inline_options=!0;options.prev_text=self.attr('data-modaal-prev-text')}
if(self.attr('data-modaal-prev-aria-label')){inline_options=!0;options.prev_aria_label=self.attr('data-modaal-prev-aria-label')}
if(self.attr('data-modaal-next-text')){inline_options=!0;options.next_text=self.attr('data-modaal-next-text')}
if(self.attr('data-modaal-next-aria-label')){inline_options=!0;options.next_aria_label=self.attr('data-modaal-next-aria-label')}
if(self.attr('data-modaal-background-scroll')){inline_options=!0;options.background_scroll=(self.attr('data-modaal-background-scroll')==='true'?!0:!1)}
if(self.attr('data-modaal-width')){inline_options=!0;options.width=parseInt(self.attr('data-modaal-width'))}
if(self.attr('data-modaal-height')){inline_options=!0;options.height=parseInt(self.attr('data-modaal-height'))}
if(self.attr('data-modaal-confirm-button-text')){inline_options=!0;options.confirm_button_text=self.attr('data-modaal-confirm-button-text')}
if(self.attr('data-modaal-confirm-cancel-button-text')){inline_options=!0;options.confirm_cancel_button_text=self.attr('data-modaal-confirm-cancel-button-text')}
if(self.attr('data-modaal-confirm-title')){inline_options=!0;options.confirm_title=self.attr('data-modaal-confirm-title')}
if(self.attr('data-modaal-confirm-content')){inline_options=!0;options.confirm_content=self.attr('data-modaal-confirm-content')}
if(self.attr('data-modaal-gallery-active-class')){inline_options=!0;options.gallery_active_class=self.attr('data-modaal-gallery-active-class')}
if(self.attr('data-modaal-loading-content')){inline_options=!0;options.loading_content=self.attr('data-modaal-loading-content')}
if(self.attr('data-modaal-loading-class')){inline_options=!0;options.loading_class=self.attr('data-modaal-loading-class')}
if(self.attr('data-modaal-ajax-error-class')){inline_options=!0;options.ajax_error_class=self.attr('data-modaal-ajax-error-class')}
if(self.attr('data-modaal-instagram-id')){inline_options=!0;options.instagram_id=self.attr('data-modaal-instagram-id')}
if(inline_options){self.modaal(options)}};$(function(){var single_modaal=$('.modaal');if(single_modaal.length){single_modaal.each(function(){var self=$(this);modaal_inline_options(self)})}
var modaal_dom_observer=new MutationObserver(function(mutations){mutations.forEach(function(mutation){if(mutation.addedNodes&&mutation.addedNodes.length>0){var findElement=[].some.call(mutation.addedNodes,function(el){var elm=$(el);if(elm.is('a')||elm.is('button')){if(elm.hasClass('modaal')){modaal_inline_options(elm)}else{modaal_existing_selectors.forEach(function(modaalSelector){if(modaalSelector.element==elm.attr('class')){$(elm).modaal(modaalSelector.options);return!1}})}}})}})});var observer_config={subtree:!0,attributes:!0,childList:!0,characterData:!0};setTimeout(function(){modaal_dom_observer.observe(document.body,observer_config)},500)})}(jQuery,window,document));(function($){$.csLightbox=function(el,options){var base=this;base.$el=$(el);base.el=el;base.$el.data("csLightbox",base);base.baseLightbox=function(){if(base.$el.find('.js-lightbox').length){base.$el.find('.js-lightbox').modaal({type:'image',overlay_opacity:base.options.overlay_opacity,image_text:base.options.image_text,no_description_text:base.options.no_description_text,accessible_title:base.options.accessible_title,close_text:base.options.close_text,close_aria_label:base.options.close_aria_label,prev_text:base.options.prev_text,prev_aria_label:base.options.prev_aria_label,next_text:base.options.next_text,next_aria_label:base.options.next_aria_label,})}};base.baseVideoLightbox=function(){if(base.$el.find('.js-video').length){base.$el.find('.js-video').each(function(){let $video=$(this);if($.csLightbox.checkCookieIsSet($video)){if($video.hasClass('js-video--lightbox')){$video.modaal({type:'video',content_source:$video.attr('data-modaal-content-source')?$video.attr('data-modaal-content-source'):$video.attr('href'),overlay_opacity:base.options.overlay_opacity,image_text:base.options.image_text,no_description_text:base.options.no_description_text,accessible_title:base.options.accessible_title,close_text:base.options.close_text,close_aria_label:base.options.close_aria_label,prev_text:base.options.prev_text,prev_aria_label:base.options.prev_aria_label,next_text:base.options.next_text,next_aria_label:base.options.next_aria_label,})}else{$video.off().on('click',function(e){e.preventDefault();$video.replaceWith('<div class="frame-wrapper"><iframe src="'+$video.attr('href')+'" allowfullscreen/></div>')})}}else{$video.modaal({type:'confirm',confirm_title:$video.data('confirm_title'),confirm_content:$video.data('confirm_content'),confirm_button_text:$video.data('confirm_button_text'),confirm_cancel_button_text:$video.data('confirm_cancel_button_text'),width:500,confirm_callback:function(){let e=jQuery.Event('click');e.target=$video;$csCookieBanner.openCookieModal(e);$lastClickedElement=$video}})}})}};base.baseInlineLightbox=function(){if(base.$el.find('.js-inline-lightbox').length){base.$el.find('.js-inline-lightbox').modaal({type:'inline',overlay_opacity:base.options.overlay_opacity,image_text:base.options.image_text,no_description_text:base.options.no_description_text,accessible_title:base.options.accessible_title,close_text:base.options.close_text,close_aria_label:base.options.close_aria_label,prev_text:base.options.prev_text,prev_aria_label:base.options.prev_aria_label,next_text:base.options.next_text,next_aria_label:base.options.next_aria_label,})}};base.baseIframeLightbox=function(){if(base.$el.find('.js-iframe').length){base.$el.find('.js-iframe').each(function(){let $iframeEl=$(this);if($.csLightbox.checkCookieIsSet($iframeEl)){if($iframeEl.hasClass('js-iframe--lightbox')){$iframeEl.modaal({width:1120,height:800,type:'iframe',no_description_text:base.options.no_description_text,accessible_title:base.options.accessible_title,close_text:base.options.close_text,close_aria_label:base.options.close_aria_label})}else{$iframeEl.off().on('click',function(e){e.preventDefault();$iframeEl.replaceWith('<div class="frame-wrapper"><iframe src="'+$iframeEl.attr('href')+'" allowfullscreen/></div>')})}}else{$iframeEl.modaal({type:'confirm',confirm_title:$iframeEl.data('confirm_title'),confirm_content:$iframeEl.data('confirm_content'),confirm_button_text:$iframeEl.data('confirm_button_text'),confirm_cancel_button_text:$iframeEl.data('confirm_cancel_button_text'),width:500,confirm_callback:function(){let e=jQuery.Event('click');e.target=$iframeEl;$csCookieBanner.openCookieModal(e);$lastClickedElement=$iframeEl}})}})}};base.init=function(){base.options=$.extend({},$.csLightbox.defaultOptions,options);base.baseLightbox();base.baseVideoLightbox();base.baseInlineLightbox();base.baseIframeLightbox()};base.init()};$.csLightbox.checkCookieIsSet=function($el){let classToCookieMapper={'js-video--vimeo':'videos_vimeo','js-video--youtube':'videos_youtube','js-iframe--yumpu':'yumpu','js-video--nc3':'videos_nc3'};let cookieIsSet=!1;Object.keys(classToCookieMapper).forEach(function(key){if($el.hasClass(key)&&$csCookieBanner.getCookieKeyExist(classToCookieMapper[key])){cookieIsSet=!0}});return cookieIsSet};$.csLightbox.defaultOptions={overlay_opacity:0.5,image_text:'Bild',no_description_text:' hat keine Beschreibung.',accessible_title:'Dialog Fenster',close_text:'Schließen',close_aria_label:'Schließen (drücken Sie zum Schließen die Esc-Taste)',prev_text:'Vorheriges Bild',prev_aria_label:'Vorheriges Bild (verwenden Sie zum Ändern den Pfeil nach links)',next_text:'Nächstes Bild',next_aria_label:'Nächstes Bild (verwenden Sie zum Ändern den Pfeil nach rechts)',};$.fn.csLightbox=function(options){return this.each(function(){(new $.csLightbox(this,options))})}}(jQuery));!function(i){"use strict";"function"==typeof define&&define.amd?define(["jquery"],i):"undefined"!=typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function(d){"use strict";var o,l=window.Slick||{};o=0,(l=function(i,e){var t=this;t.defaults={adaptiveHeight:!1,appendArrows:d(i),appendDots:d(i),arrows:!0,arrowsPlacement:null,asNavFor:null,prevArrow:'<button class="slick-prev" type="button"><span class="slick-prev-icon" aria-hidden="true"></span><span class="slick-sr-only">Previous</span></button>',nextArrow:'<button class="slick-next" type="button"><span class="slick-next-icon" aria-hidden="true"></span><span class="slick-sr-only">Next</span></button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(i,e){return d('<button type="button"><span class="slick-dot-icon" aria-hidden="true"></span><span class="slick-sr-only">Go to slide '+(e+1)+"</span></button>")},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,infinite:!0,initialSlide:0,instructionsText:null,lazyLoad:"ondemand",mobileFirst:!1,playIcon:'<span class="slick-play-icon" aria-hidden="true"></span>',pauseIcon:'<span class="slick-pause-icon" aria-hidden="true"></span>',pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,regionLabel:"carousel",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,useAutoplayToggleButton:!0,useCSS:!0,useGroupRole:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},t.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,$instructionsText:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$pauseButton:null,$pauseIcon:null,$playIcon:null,$prevArrow:null,scrolling:!1,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,swiping:!1,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},d.extend(t,t.initials),t.activeBreakpoint=null,t.animType=null,t.animProp=null,t.breakpoints=[],t.breakpointSettings=[],t.cssTransitions=!1,t.focussed=!1,t.interrupted=!1,t.hidden="hidden",t.paused=!0,t.positionProp=null,t.respondTo=null,t.rowCount=1,t.shouldClick=!0,t.$slider=d(i),t.$slidesCache=null,t.transformType=null,t.transitionType=null,t.visibilityChange="visibilitychange",t.windowWidth=0,t.windowTimer=null,i=d(i).data("slick")||{},t.options=d.extend({},t.defaults,e,i),t.currentSlide=t.options.initialSlide,t.originalSettings=t.options,void 0!==document.mozHidden?(t.hidden="mozHidden",t.visibilityChange="mozvisibilitychange"):void 0!==document.webkitHidden&&(t.hidden="webkitHidden",t.visibilityChange="webkitvisibilitychange"),t.autoPlay=d.proxy(t.autoPlay,t),t.autoPlayClear=d.proxy(t.autoPlayClear,t),t.autoPlayIterator=d.proxy(t.autoPlayIterator,t),t.autoPlayToggleHandler=d.proxy(t.autoPlayToggleHandler,t),t.changeSlide=d.proxy(t.changeSlide,t),t.clickHandler=d.proxy(t.clickHandler,t),t.selectHandler=d.proxy(t.selectHandler,t),t.setPosition=d.proxy(t.setPosition,t),t.swipeHandler=d.proxy(t.swipeHandler,t),t.dragHandler=d.proxy(t.dragHandler,t),t.instanceUid=o++,t.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,t.registerBreakpoints(),t.init(!0)}).prototype.addSlide=l.prototype.slickAdd=function(i,e,t){var o=this;if("boolean"==typeof e)t=e,e=null;else if(e<0||e>=o.slideCount)return!1;o.unload(),"number"==typeof e?0===e&&0===o.$slides.length?d(i).appendTo(o.$slideTrack):t?d(i).insertBefore(o.$slides.eq(e)):d(i).insertAfter(o.$slides.eq(e)):!0===t?d(i).prependTo(o.$slideTrack):d(i).appendTo(o.$slideTrack),o.$slides=o.$slideTrack.children(this.options.slide),o.$slideTrack.children(this.options.slide).detach(),o.$slideTrack.append(o.$slides),o.$slides.each(function(i,e){d(e).attr("data-slick-index",i)}),o.$slidesCache=o.$slides,o.reinit()},l.prototype.animateHeight=function(){var i,e=this;1===e.options.slidesToShow&&!0===e.options.adaptiveHeight&&!1===e.options.vertical&&(i=e.$slides.eq(e.currentSlide).outerHeight(!0),e.$list.animate({height:i},e.options.speed))},l.prototype.animateSlide=function(i,e){var t={},o=this;o.animateHeight(),!0===o.options.rtl&&!1===o.options.vertical&&(i=-i),!1===o.transformsEnabled?!1===o.options.vertical?o.$slideTrack.animate({left:i},o.options.speed,o.options.easing,e):o.$slideTrack.animate({top:i},o.options.speed,o.options.easing,e):!1===o.cssTransitions?(!0===o.options.rtl&&(o.currentLeft=-o.currentLeft),d({animStart:o.currentLeft}).animate({animStart:i},{duration:o.options.speed,easing:o.options.easing,step:function(i){i=Math.ceil(i),!1===o.options.vertical?t[o.animType]="translate("+i+"px, 0px)":t[o.animType]="translate(0px,"+i+"px)",o.$slideTrack.css(t)},complete:function(){e&&e.call()}})):(o.applyTransition(),i=Math.ceil(i),!1===o.options.vertical?t[o.animType]="translate3d("+i+"px, 0px, 0px)":t[o.animType]="translate3d(0px,"+i+"px, 0px)",o.$slideTrack.css(t),e&&setTimeout(function(){o.disableTransition(),e.call()},o.options.speed))},l.prototype.getNavTarget=function(){var i=this.options.asNavFor;return i&&null!==i&&(i=d(i).not(this.$slider)),i},l.prototype.asNavFor=function(e){var i=this.getNavTarget();null!==i&&"object"==typeof i&&i.each(function(){var i=d(this).slick("getSlick");i.unslicked||i.slideHandler(e,!0)})},l.prototype.applyTransition=function(i){var e=this,t={};!1===e.options.fade?t[e.transitionType]=e.transformType+" "+e.options.speed+"ms "+e.options.cssEase:t[e.transitionType]="opacity "+e.options.speed+"ms "+e.options.cssEase,(!1===e.options.fade?e.$slideTrack:e.$slides.eq(i)).css(t)},l.prototype.autoPlay=function(){var i=this;i.autoPlayClear(),i.slideCount>i.options.slidesToShow&&(i.autoPlayTimer=setInterval(i.autoPlayIterator,i.options.autoplaySpeed))},l.prototype.autoPlayClear=function(){this.autoPlayTimer&&clearInterval(this.autoPlayTimer)},l.prototype.autoPlayIterator=function(){var i=this,e=i.currentSlide+i.options.slidesToScroll;i.paused||i.interrupted||i.focussed||(!1===i.options.infinite&&(1===i.direction&&i.currentSlide+1===i.slideCount-1?i.direction=0:0===i.direction&&(e=i.currentSlide-i.options.slidesToScroll,i.currentSlide-1==0&&(i.direction=1))),i.slideHandler(e))},l.prototype.autoPlayToggleHandler=function(){var i=this;i.paused?(i.$playIcon.css("display","none"),i.$pauseIcon.css("display","inline"),i.$pauseButton.find(".slick-play-text").attr("style","display: none"),i.$pauseButton.find(".slick-pause-text").removeAttr("style"),i.slickPlay()):(i.$playIcon.css("display","inline"),i.$pauseIcon.css("display","none"),i.$pauseButton.find(".slick-play-text").removeAttr("style"),i.$pauseButton.find(".slick-pause-text").attr("style","display: none"),i.slickPause())},l.prototype.buildArrows=function(){var i=this;if(!0===i.options.arrows)if(i.$prevArrow=d(i.options.prevArrow).addClass("slick-arrow"),i.$nextArrow=d(i.options.nextArrow).addClass("slick-arrow"),i.slideCount>i.options.slidesToShow){if(i.htmlExpr.test(i.options.prevArrow))if(null!=i.options.arrowsPlacement)switch(i.options.arrowsPlacement){case"beforeSlides":case"split":console.log("test"),i.$prevArrow.prependTo(i.options.appendArrows);break;case"afterSlides":i.$prevArrow.appendTo(i.options.appendArrows)}else i.$prevArrow.prependTo(i.options.appendArrows);if(i.htmlExpr.test(i.options.nextArrow))if(null!=i.options.arrowsPlacement)switch(i.options.arrowsPlacement){case"beforeSlides":console.log("test2"),i.$prevArrow.after(i.$nextArrow);break;case"afterSlides":case"split":i.$nextArrow.appendTo(i.options.appendArrows)}else i.$nextArrow.appendTo(i.options.appendArrows);!0!==i.options.infinite&&i.$prevArrow.addClass("slick-disabled").prop("disabled",!0)}else i.$prevArrow.add(i.$nextArrow).addClass("slick-hidden").prop("disabled",!0)},l.prototype.buildDots=function(){var i,e,t=this;if(!0===t.options.dots&&t.slideCount>t.options.slidesToShow){for(t.$slider.addClass("slick-dotted"),e=d("<ul />").addClass(t.options.dotsClass),i=0;i<=t.getDotCount();i+=1)e.append(d("<li />").append(t.options.customPaging.call(this,t,i)));t.$dots=e.appendTo(t.options.appendDots),t.$dots.find("li").first().addClass("slick-active")}},l.prototype.buildOut=function(){var t=this;t.$slides=t.$slider.children(t.options.slide+":not(.slick-cloned)").addClass("slick-slide"),t.slideCount=t.$slides.length,t.$slides.each(function(i,e){d(e).attr("data-slick-index",i).data("originalStyling",d(e).attr("style")||""),t.options.useGroupRole&&d(e).attr("role","group").attr("aria-label","slide "+(i+1))}),t.$slider.addClass("slick-slider"),t.$slider.attr("role","region"),t.$slider.attr("aria-label",t.options.regionLabel),t.$slideTrack=0===t.slideCount?d('<div class="slick-track"/>').appendTo(t.$slider):t.$slides.wrapAll('<div class="slick-track"/>').parent(),t.$list=t.$slideTrack.wrap('<div class="slick-list"/>').parent(),t.$slideTrack.css("opacity",0),!0!==t.options.centerMode&&!0!==t.options.swipeToSlide||(t.options.slidesToScroll=1),d("img[data-lazy]",t.$slider).not("[src]").addClass("slick-loading"),t.setupInfinite(),t.buildArrows(),t.buildDots(),t.updateDots(),t.setSlideClasses("number"==typeof t.currentSlide?t.currentSlide:0),!0===t.options.draggable&&t.$list.addClass("draggable"),t.options.autoplay&&t.options.useAutoplayToggleButton&&(t.$pauseIcon=d(t.options.pauseIcon).attr("aria-hidden",!0),t.$playIcon=d(t.options.playIcon).attr("aria-hidden",!0),t.$pauseButton=d('<button type="button" class="slick-autoplay-toggle-button">'),t.$pauseButton.append(t.$pauseIcon),t.$pauseButton.append(t.$playIcon.css("display","none")),t.$pauseButton.append(d('<span class="slick-pause-text slick-sr-only">Pause</span>')),t.$pauseButton.append(d('<span class="slick-play-text slick-sr-only" style="display: none">Play</span>')),t.$pauseButton.prependTo(t.$slider)),null!=t.options.instructionsText&&""!=t.options.instructionsText&&(t.$instructionsText=d('<p class="slick-instructions slick-sr-only">'+t.options.instructionsText+"</p>"),t.$instructionsText.prependTo(t.$slider))},l.prototype.buildRows=function(){var i,e,t,o=this,s=document.createDocumentFragment(),n=o.$slider.children();if(0<o.options.rows){for(t=o.options.slidesPerRow*o.options.rows,e=Math.ceil(n.length/t),i=0;i<e;i++){for(var l=document.createElement("div"),r=0;r<o.options.rows;r++){for(var a=document.createElement("div"),d=0;d<o.options.slidesPerRow;d++){var p=i*t+(r*o.options.slidesPerRow+d);n.get(p)&&a.appendChild(n.get(p))}l.appendChild(a)}s.appendChild(l)}o.$slider.empty().append(s),o.$slider.children().children().children().css({width:100/o.options.slidesPerRow+"%",display:"inline-block"})}},l.prototype.checkResponsive=function(i,e){var t,o,s,n=this,l=!1,r=n.$slider.width(),a=window.innerWidth||d(window).width();if("window"===n.respondTo?s=a:"slider"===n.respondTo?s=r:"min"===n.respondTo&&(s=Math.min(a,r)),n.options.responsive&&n.options.responsive.length&&null!==n.options.responsive){for(t in o=null,n.breakpoints)n.breakpoints.hasOwnProperty(t)&&(!1===n.originalSettings.mobileFirst?s<n.breakpoints[t]&&(o=n.breakpoints[t]):s>n.breakpoints[t]&&(o=n.breakpoints[t]));null!==o?null!==n.activeBreakpoint&&o===n.activeBreakpoint&&!e||(n.activeBreakpoint=o,"unslick"===n.breakpointSettings[o]?n.unslick(o):(n.options=d.extend({},n.originalSettings,n.breakpointSettings[o]),!0===i&&(n.currentSlide=n.options.initialSlide),n.refresh(i)),l=o):null!==n.activeBreakpoint&&(n.activeBreakpoint=null,n.options=n.originalSettings,!0===i&&(n.currentSlide=n.options.initialSlide),n.refresh(i),l=o),i||!1===l||n.$slider.trigger("breakpoint",[n,l])}},l.prototype.changeSlide=function(i,e){var t,o,s=this,n=d(i.currentTarget);switch(n.is("a")&&i.preventDefault(),n.is("li")||(n=n.closest("li")),t=s.slideCount%s.options.slidesToScroll!=0?0:(s.slideCount-s.currentSlide)%s.options.slidesToScroll,i.data.message){case"previous":o=0==t?s.options.slidesToScroll:s.options.slidesToShow-t,s.slideCount>s.options.slidesToShow&&s.slideHandler(s.currentSlide-o,!1,e);break;case"next":o=0==t?s.options.slidesToScroll:t,s.slideCount>s.options.slidesToShow&&s.slideHandler(s.currentSlide+o,!1,e);break;case"index":i=0===i.data.index?0:i.data.index||n.index()*s.options.slidesToScroll;s.slideHandler(s.checkNavigable(i),!1,e),n.children().trigger("focus");break;default:return}},l.prototype.checkNavigable=function(i){var e=this.getNavigableIndexes(),t=0;if(i>e[e.length-1])i=e[e.length-1];else for(var o in e){if(i<e[o]){i=t;break}t=e[o]}return i},l.prototype.cleanUpEvents=function(){var i=this;i.options.autoplay&&i.options.useAutoplayToggleButton&&i.$pauseButton.off("click.slick",i.autoPlayToggleHandler),i.options.dots&&null!==i.$dots&&d("li",i.$dots).off("click.slick",i.changeSlide).off("mouseenter.slick",d.proxy(i.interrupt,i,!0)).off("mouseleave.slick",d.proxy(i.interrupt,i,!1)),i.$slider.off("focus.slick blur.slick"),!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow&&i.$prevArrow.off("click.slick",i.changeSlide),i.$nextArrow&&i.$nextArrow.off("click.slick",i.changeSlide)),i.$list.off("touchstart.slick mousedown.slick",i.swipeHandler),i.$list.off("touchmove.slick mousemove.slick",i.swipeHandler),i.$list.off("touchend.slick mouseup.slick",i.swipeHandler),i.$list.off("touchcancel.slick mouseleave.slick",i.swipeHandler),i.$list.off("click.slick",i.clickHandler),d(document).off(i.visibilityChange,i.visibility),i.cleanUpSlideEvents(),d(window).off("orientationchange.slick.slick-"+i.instanceUid,i.orientationChange),d(window).off("resize.slick.slick-"+i.instanceUid,i.resize),d("[draggable!=true]",i.$slideTrack).off("dragstart",i.preventDefault),d(window).off("load.slick.slick-"+i.instanceUid,i.setPosition)},l.prototype.cleanUpSlideEvents=function(){var i=this;i.$list.off("mouseenter.slick",d.proxy(i.interrupt,i,!0)),i.$list.off("mouseleave.slick",d.proxy(i.interrupt,i,!1))},l.prototype.cleanUpRows=function(){var i;0<this.options.rows&&((i=this.$slides.children().children()).removeAttr("style"),this.$slider.empty().append(i))},l.prototype.clickHandler=function(i){!1===this.shouldClick&&(i.stopImmediatePropagation(),i.stopPropagation(),i.preventDefault())},l.prototype.destroy=function(i){var e=this;e.autoPlayClear(),e.touchObject={},e.cleanUpEvents(),d(".slick-cloned",e.$slider).detach(),e.options.autoplay&&e.options.useAutoplayToggleButton&&e.$pauseButton.remove(),e.$dots&&e.$dots.remove(),e.$prevArrow&&e.$prevArrow.length&&(e.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").prop("disabled",!1).css("display",""),e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.remove()),e.$nextArrow&&e.$nextArrow.length&&(e.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").prop("disabled",!1).css("display",""),e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.remove()),e.$slides&&(e.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){d(this).attr("style",d(this).data("originalStyling"))}),e.$slideTrack.children(this.options.slide).detach(),e.$slideTrack.detach(),e.$list.detach(),e.$slider.append(e.$slides)),e.cleanUpRows(),e.$slider.removeClass("slick-slider"),e.$slider.removeClass("slick-initialized"),e.$slider.removeClass("slick-dotted"),e.unslicked=!0,i||e.$slider.trigger("destroy",[e])},l.prototype.disableTransition=function(i){var e={};e[this.transitionType]="",(!1===this.options.fade?this.$slideTrack:this.$slides.eq(i)).css(e)},l.prototype.fadeSlide=function(i,e){var t=this;!1===t.cssTransitions?(t.$slides.eq(i).css({zIndex:t.options.zIndex}),t.$slides.eq(i).animate({opacity:1},t.options.speed,t.options.easing,e)):(t.applyTransition(i),t.$slides.eq(i).css({opacity:1,zIndex:t.options.zIndex}),e&&setTimeout(function(){t.disableTransition(i),e.call()},t.options.speed))},l.prototype.fadeSlideOut=function(i){var e=this;!1===e.cssTransitions?e.$slides.eq(i).animate({opacity:0,zIndex:e.options.zIndex-2},e.options.speed,e.options.easing):(e.applyTransition(i),e.$slides.eq(i).css({opacity:0,zIndex:e.options.zIndex-2}))},l.prototype.filterSlides=l.prototype.slickFilter=function(i){var e=this;null!==i&&(e.$slidesCache=e.$slides,e.unload(),e.$slideTrack.children(this.options.slide).detach(),e.$slidesCache.filter(i).appendTo(e.$slideTrack),e.reinit())},l.prototype.focusHandler=function(){var t=this;t.$slider.off("focus.slick blur.slick").on("focus.slick","*",function(i){var e=d(this);setTimeout(function(){t.options.pauseOnFocus&&e.is(":focus")&&(t.focussed=!0,t.autoPlay())},0)}).on("blur.slick","*",function(i){d(this);t.options.pauseOnFocus&&(t.focussed=!1,t.autoPlay())})},l.prototype.getCurrent=l.prototype.slickCurrentSlide=function(){return this.currentSlide},l.prototype.getDotCount=function(){var i=this,e=0,t=0,o=0;if(!0===i.options.infinite)if(i.slideCount<=i.options.slidesToShow)++o;else for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else if(!0===i.options.centerMode)o=i.slideCount;else if(i.options.asNavFor)for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else o=1+Math.ceil((i.slideCount-i.options.slidesToShow)/i.options.slidesToScroll);return o-1},l.prototype.getLeft=function(i){var e,t,o=this,s=0;return o.slideOffset=0,e=o.$slides.first().outerHeight(!0),!0===o.options.infinite?(o.slideCount>o.options.slidesToShow&&(o.slideOffset=o.slideWidth*o.options.slidesToShow*-1,t=-1,!0===o.options.vertical&&!0===o.options.centerMode&&(2===o.options.slidesToShow?t=-1.5:1===o.options.slidesToShow&&(t=-2)),s=e*o.options.slidesToShow*t),o.slideCount%o.options.slidesToScroll!=0&&i+o.options.slidesToScroll>o.slideCount&&o.slideCount>o.options.slidesToShow&&(s=i>o.slideCount?(o.slideOffset=(o.options.slidesToShow-(i-o.slideCount))*o.slideWidth*-1,(o.options.slidesToShow-(i-o.slideCount))*e*-1):(o.slideOffset=o.slideCount%o.options.slidesToScroll*o.slideWidth*-1,o.slideCount%o.options.slidesToScroll*e*-1))):i+o.options.slidesToShow>o.slideCount&&(o.slideOffset=(i+o.options.slidesToShow-o.slideCount)*o.slideWidth,s=(i+o.options.slidesToShow-o.slideCount)*e),o.slideCount<=o.options.slidesToShow&&(s=o.slideOffset=0),!0===o.options.centerMode&&o.slideCount<=o.options.slidesToShow?o.slideOffset=o.slideWidth*Math.floor(o.options.slidesToShow)/2-o.slideWidth*o.slideCount/2:!0===o.options.centerMode&&!0===o.options.infinite?o.slideOffset+=o.slideWidth*Math.floor(o.options.slidesToShow/2)-o.slideWidth:!0===o.options.centerMode&&(o.slideOffset=0,o.slideOffset+=o.slideWidth*Math.floor(o.options.slidesToShow/2)),e=!1===o.options.vertical?i*o.slideWidth*-1+o.slideOffset:i*e*-1+s,!0===o.options.variableWidth&&(s=o.slideCount<=o.options.slidesToShow||!1===o.options.infinite?o.$slideTrack.children(".slick-slide").eq(i):o.$slideTrack.children(".slick-slide").eq(i+o.options.slidesToShow),e=!0===o.options.rtl?s[0]?-1*(o.$slideTrack.width()-s[0].offsetLeft-s.width()):0:s[0]?-1*s[0].offsetLeft:0,!0===o.options.centerMode&&(s=o.slideCount<=o.options.slidesToShow||!1===o.options.infinite?o.$slideTrack.children(".slick-slide").eq(i):o.$slideTrack.children(".slick-slide").eq(i+o.options.slidesToShow+1),e=!0===o.options.rtl?s[0]?-1*(o.$slideTrack.width()-s[0].offsetLeft-s.width()):0:s[0]?-1*s[0].offsetLeft:0,e+=(o.$list.width()-s.outerWidth())/2)),e},l.prototype.getOption=l.prototype.slickGetOption=function(i){return this.options[i]},l.prototype.getNavigableIndexes=function(){for(var i=this,e=0,t=0,o=[],s=!1===i.options.infinite?i.slideCount:(e=-1*i.options.slidesToScroll,t=-1*i.options.slidesToScroll,2*i.slideCount);e<s;)o.push(e),e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;return o},l.prototype.getSlick=function(){return this},l.prototype.getSlideCount=function(){var s,n=this,i=!0===n.options.centerMode?Math.floor(n.$list.width()/2):0,l=-1*n.swipeLeft+i;return!0===n.options.swipeToSlide?(n.$slideTrack.find(".slick-slide").each(function(i,e){var t=d(e).outerWidth(),o=e.offsetLeft;if(!0!==n.options.centerMode&&(o+=t/2),l<o+t)return s=e,!1}),Math.abs(d(s).attr("data-slick-index")-n.currentSlide)||1):n.options.slidesToScroll},l.prototype.goTo=l.prototype.slickGoTo=function(i,e){this.changeSlide({data:{message:"index",index:parseInt(i)}},e)},l.prototype.init=function(i){var e=this;d(e.$slider).hasClass("slick-initialized")||(d(e.$slider).addClass("slick-initialized"),e.buildRows(),e.buildOut(),e.setProps(),e.startLoad(),e.loadSlider(),e.initializeEvents(),e.updateArrows(),e.updateDots(),e.checkResponsive(!0),e.focusHandler()),i&&e.$slider.trigger("init",[e]),e.options.autoplay&&(e.paused=!1,e.autoPlay()),e.updateSlideVisibility(),null!=e.options.accessibility&&console.warn("accessibility setting is no longer supported."),null!=e.options.focusOnChange&&console.warn("focusOnChange is no longer supported."),null!=e.options.focusOnSelect&&console.warn("focusOnSelect is no longer supported.")},l.prototype.initArrowEvents=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},i.changeSlide),i.$nextArrow.off("click.slick").on("click.slick",{message:"next"},i.changeSlide))},l.prototype.initDotEvents=function(){var i=this;!0===i.options.dots&&i.slideCount>i.options.slidesToShow&&d("li",i.$dots).on("click.slick",{message:"index"},i.changeSlide),!0===i.options.dots&&!0===i.options.pauseOnDotsHover&&i.slideCount>i.options.slidesToShow&&d("li",i.$dots).on("mouseenter.slick",d.proxy(i.interrupt,i,!0)).on("mouseleave.slick",d.proxy(i.interrupt,i,!1))},l.prototype.initSlideEvents=function(){var i=this;i.options.pauseOnHover&&(i.$list.on("mouseenter.slick",d.proxy(i.interrupt,i,!0)),i.$list.on("mouseleave.slick",d.proxy(i.interrupt,i,!1)))},l.prototype.initializeEvents=function(){var i=this;i.initArrowEvents(),i.initDotEvents(),i.initSlideEvents(),i.options.autoplay&&i.options.useAutoplayToggleButton&&i.$pauseButton.on("click.slick",i.autoPlayToggleHandler),i.$list.on("touchstart.slick mousedown.slick",{action:"start"},i.swipeHandler),i.$list.on("touchmove.slick mousemove.slick",{action:"move"},i.swipeHandler),i.$list.on("touchend.slick mouseup.slick",{action:"end"},i.swipeHandler),i.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},i.swipeHandler),i.$list.on("click.slick",i.clickHandler),d(document).on(i.visibilityChange,d.proxy(i.visibility,i)),d(window).on("orientationchange.slick.slick-"+i.instanceUid,d.proxy(i.orientationChange,i)),d(window).on("resize.slick.slick-"+i.instanceUid,d.proxy(i.resize,i)),d("[draggable!=true]",i.$slideTrack).on("dragstart",i.preventDefault),d(window).on("load.slick.slick-"+i.instanceUid,i.setPosition),d(i.setPosition)},l.prototype.initUI=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.show(),i.$nextArrow.show()),!0===i.options.dots&&i.slideCount>i.options.slidesToShow&&i.$dots.show()},l.prototype.lazyLoad=function(){var i,e,t,n=this;function o(i){d("img[data-lazy]",i).each(function(){var i=d(this),e=d(this).attr("data-lazy"),t=d(this).attr("data-srcset"),o=d(this).attr("data-sizes")||n.$slider.attr("data-sizes"),s=document.createElement("img");s.onload=function(){i.animate({opacity:0},100,function(){t&&(i.attr("srcset",t),o&&i.attr("sizes",o)),i.attr("src",e).animate({opacity:1},200,function(){i.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading")}),n.$slider.trigger("lazyLoaded",[n,i,e])})},s.onerror=function(){i.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),n.$slider.trigger("lazyLoadError",[n,i,e])},s.src=e})}if(!0===n.options.centerMode?t=!0===n.options.infinite?(e=n.currentSlide+(n.options.slidesToShow/2+1))+n.options.slidesToShow+2:(e=Math.max(0,n.currentSlide-(n.options.slidesToShow/2+1)),n.options.slidesToShow/2+1+2+n.currentSlide):(e=n.options.infinite?n.options.slidesToShow+n.currentSlide:n.currentSlide,t=Math.ceil(e+n.options.slidesToShow),!0===n.options.fade&&(0<e&&e--,t<=n.slideCount&&t++)),i=n.$slider.find(".slick-slide").slice(e,t),"anticipated"===n.options.lazyLoad)for(var s=e-1,l=t,r=n.$slider.find(".slick-slide"),a=0;a<n.options.slidesToScroll;a++)s<0&&(s=n.slideCount-1),i=(i=i.add(r.eq(s))).add(r.eq(l)),s--,l++;o(i),n.slideCount<=n.options.slidesToShow?o(n.$slider.find(".slick-slide")):n.currentSlide>=n.slideCount-n.options.slidesToShow?o(n.$slider.find(".slick-cloned").slice(0,n.options.slidesToShow)):0===n.currentSlide&&o(n.$slider.find(".slick-cloned").slice(-1*n.options.slidesToShow))},l.prototype.loadSlider=function(){var i=this;i.setPosition(),i.$slideTrack.css({opacity:1}),i.$slider.removeClass("slick-loading"),i.initUI(),"progressive"===i.options.lazyLoad&&i.progressiveLazyLoad()},l.prototype.next=l.prototype.slickNext=function(){this.changeSlide({data:{message:"next"}})},l.prototype.orientationChange=function(){this.checkResponsive(),this.setPosition()},l.prototype.pause=l.prototype.slickPause=function(){this.autoPlayClear(),this.paused=!0},l.prototype.play=l.prototype.slickPlay=function(){var i=this;i.autoPlay(),i.options.autoplay=!0,i.paused=!1,i.focussed=!1,i.interrupted=!1},l.prototype.postSlide=function(i){var e=this;e.unslicked||(e.$slider.trigger("afterChange",[e,i]),e.animating=!1,e.slideCount>e.options.slidesToShow&&e.setPosition(),e.swipeLeft=null,e.options.autoplay&&e.autoPlay(),e.updateSlideVisibility())},l.prototype.prev=l.prototype.slickPrev=function(){this.changeSlide({data:{message:"previous"}})},l.prototype.preventDefault=function(i){i.preventDefault()},l.prototype.progressiveLazyLoad=function(i){i=i||1;var e,t,o,s,n=this,l=d("img[data-lazy]",n.$slider);l.length?(e=l.first(),t=e.attr("data-lazy"),o=e.attr("data-srcset"),s=e.attr("data-sizes")||n.$slider.attr("data-sizes"),(l=document.createElement("img")).onload=function(){o&&(e.attr("srcset",o),s&&e.attr("sizes",s)),e.attr("src",t).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading"),!0===n.options.adaptiveHeight&&n.setPosition(),n.$slider.trigger("lazyLoaded",[n,e,t]),n.progressiveLazyLoad()},l.onerror=function(){i<3?setTimeout(function(){n.progressiveLazyLoad(i+1)},500):(e.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),n.$slider.trigger("lazyLoadError",[n,e,t]),n.progressiveLazyLoad())},l.src=t):n.$slider.trigger("allImagesLoaded",[n])},l.prototype.refresh=function(i){var e=this,t=e.slideCount-e.options.slidesToShow;!e.options.infinite&&e.currentSlide>t&&(e.currentSlide=t),e.slideCount<=e.options.slidesToShow&&(e.currentSlide=0),t=e.currentSlide,e.destroy(!0),d.extend(e,e.initials,{currentSlide:t}),e.init(),i||e.changeSlide({data:{message:"index",index:t}},!1)},l.prototype.registerBreakpoints=function(){var i,e,t,o=this,s=o.options.responsive||null;if("array"===d.type(s)&&s.length){for(i in o.respondTo=o.options.respondTo||"window",s)if(t=o.breakpoints.length-1,s.hasOwnProperty(i)){for(e=s[i].breakpoint;0<=t;)o.breakpoints[t]&&o.breakpoints[t]===e&&o.breakpoints.splice(t,1),t--;o.breakpoints.push(e),o.breakpointSettings[e]=s[i].settings}o.breakpoints.sort(function(i,e){return o.options.mobileFirst?i-e:e-i})}},l.prototype.reinit=function(){var i=this;i.$slides=i.$slideTrack.children(i.options.slide).addClass("slick-slide"),i.slideCount=i.$slides.length,i.currentSlide>=i.slideCount&&0!==i.currentSlide&&(i.currentSlide=i.currentSlide-i.options.slidesToScroll),i.slideCount<=i.options.slidesToShow&&(i.currentSlide=0),i.registerBreakpoints(),i.setProps(),i.setupInfinite(),i.buildArrows(),i.updateArrows(),i.initArrowEvents(),i.buildDots(),i.updateDots(),i.initDotEvents(),i.cleanUpSlideEvents(),i.initSlideEvents(),i.checkResponsive(!1,!0),i.setSlideClasses("number"==typeof i.currentSlide?i.currentSlide:0),i.setPosition(),i.focusHandler(),i.paused=!i.options.autoplay,i.autoPlay(),i.$slider.trigger("reInit",[i])},l.prototype.resize=function(){var i=this;d(window).width()!==i.windowWidth&&(clearTimeout(i.windowDelay),i.windowDelay=window.setTimeout(function(){i.windowWidth=d(window).width(),i.checkResponsive(),i.unslicked||i.setPosition()},50))},l.prototype.removeSlide=l.prototype.slickRemove=function(i,e,t){var o=this;if(i="boolean"==typeof i?!0===(e=i)?0:o.slideCount-1:!0===e?--i:i,o.slideCount<1||i<0||i>o.slideCount-1)return!1;o.unload(),(!0===t?o.$slideTrack.children():o.$slideTrack.children(this.options.slide).eq(i)).remove(),o.$slides=o.$slideTrack.children(this.options.slide),o.$slideTrack.children(this.options.slide).detach(),o.$slideTrack.append(o.$slides),o.$slidesCache=o.$slides,o.reinit()},l.prototype.setCSS=function(i){var e,t,o=this,s={};!0===o.options.rtl&&(i=-i),e="left"==o.positionProp?Math.ceil(i)+"px":"0px",t="top"==o.positionProp?Math.ceil(i)+"px":"0px",s[o.positionProp]=i,!1===o.transformsEnabled||(!(s={})===o.cssTransitions?s[o.animType]="translate("+e+", "+t+")":s[o.animType]="translate3d("+e+", "+t+", 0px)"),o.$slideTrack.css(s)},l.prototype.setDimensions=function(){var i=this;!1===i.options.vertical?!0===i.options.centerMode&&i.$list.css({padding:"0px "+i.options.centerPadding}):(i.$list.height(i.$slides.first().outerHeight(!0)*i.options.slidesToShow),!0===i.options.centerMode&&i.$list.css({padding:i.options.centerPadding+" 0px"})),i.listWidth=i.$list.width(),i.listHeight=i.$list.height(),!1===i.options.vertical&&!1===i.options.variableWidth?(i.slideWidth=Math.ceil(i.listWidth/i.options.slidesToShow),i.$slideTrack.width(Math.ceil(i.slideWidth*i.$slideTrack.children(".slick-slide").length))):!0===i.options.variableWidth?i.$slideTrack.width(5e3*i.slideCount):(i.slideWidth=Math.ceil(i.listWidth),i.$slideTrack.height(Math.ceil(i.$slides.first().outerHeight(!0)*i.$slideTrack.children(".slick-slide").length)));var e=i.$slides.first().outerWidth(!0)-i.$slides.first().width();!1===i.options.variableWidth&&i.$slideTrack.children(".slick-slide").width(i.slideWidth-e)},l.prototype.setFade=function(){var t,o=this;o.$slides.each(function(i,e){t=o.slideWidth*i*-1,!0===o.options.rtl?d(e).css({position:"relative",right:t,top:0,zIndex:o.options.zIndex-2,opacity:0}):d(e).css({position:"relative",left:t,top:0,zIndex:o.options.zIndex-2,opacity:0})}),o.$slides.eq(o.currentSlide).css({zIndex:o.options.zIndex-1,opacity:1})},l.prototype.setHeight=function(){var i,e=this;1===e.options.slidesToShow&&!0===e.options.adaptiveHeight&&!1===e.options.vertical&&(i=e.$slides.eq(e.currentSlide).outerHeight(!0),e.$list.css("height",i))},l.prototype.setOption=l.prototype.slickSetOption=function(){var i,e,t,o,s,n=this,l=!1;if("object"===d.type(arguments[0])?(t=arguments[0],l=arguments[1],s="multiple"):"string"===d.type(arguments[0])&&(o=arguments[1],l=arguments[2],"responsive"===(t=arguments[0])&&"array"===d.type(arguments[1])?s="responsive":void 0!==arguments[1]&&(s="single")),"single"===s)n.options[t]=o;else if("multiple"===s)d.each(t,function(i,e){n.options[i]=e});else if("responsive"===s)for(e in o)if("array"!==d.type(n.options.responsive))n.options.responsive=[o[e]];else{for(i=n.options.responsive.length-1;0<=i;)n.options.responsive[i].breakpoint===o[e].breakpoint&&n.options.responsive.splice(i,1),i--;n.options.responsive.push(o[e])}l&&(n.unload(),n.reinit())},l.prototype.setPosition=function(){var i=this;i.setDimensions(),i.setHeight(),!1===i.options.fade?i.setCSS(i.getLeft(i.currentSlide)):i.setFade(),i.$slider.trigger("setPosition",[i])},l.prototype.setProps=function(){var i=this,e=document.body.style;i.positionProp=!0===i.options.vertical?"top":"left","top"===i.positionProp?i.$slider.addClass("slick-vertical"):i.$slider.removeClass("slick-vertical"),void 0===e.WebkitTransition&&void 0===e.MozTransition&&void 0===e.msTransition||!0===i.options.useCSS&&(i.cssTransitions=!0),i.options.fade&&("number"==typeof i.options.zIndex?i.options.zIndex<3&&(i.options.zIndex=3):i.options.zIndex=i.defaults.zIndex),void 0!==e.OTransform&&(i.animType="OTransform",i.transformType="-o-transform",i.transitionType="OTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.MozTransform&&(i.animType="MozTransform",i.transformType="-moz-transform",i.transitionType="MozTransition",void 0===e.perspectiveProperty&&void 0===e.MozPerspective&&(i.animType=!1)),void 0!==e.webkitTransform&&(i.animType="webkitTransform",i.transformType="-webkit-transform",i.transitionType="webkitTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.msTransform&&(i.animType="msTransform",i.transformType="-ms-transform",i.transitionType="msTransition",void 0===e.msTransform&&(i.animType=!1)),void 0!==e.transform&&!1!==i.animType&&(i.animType="transform",i.transformType="transform",i.transitionType="transition"),i.transformsEnabled=i.options.useTransform&&null!==i.animType&&!1!==i.animType},l.prototype.setSlideClasses=function(i){var e,t,o,s=this,n=s.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true");s.$slides.eq(i).addClass("slick-current"),!0===s.options.centerMode?(t=s.options.slidesToShow%2==0?1:0,o=Math.floor(s.options.slidesToShow/2),!0===s.options.infinite&&(o<=i&&i<=s.slideCount-1-o?s.$slides.slice(i-o+t,i+o+1).addClass("slick-active").removeAttr("aria-hidden"):(e=s.options.slidesToShow+i,n.slice(e-o+1+t,e+o+2).addClass("slick-active").removeAttr("aria-hidden")),0===i?n.eq(s.options.slidesToShow+s.slideCount+1).addClass("slick-center"):i===s.slideCount-1&&n.eq(s.options.slidesToShow).addClass("slick-center")),s.$slides.eq(i).addClass("slick-center")):0<=i&&i<=s.slideCount-s.options.slidesToShow?s.$slides.slice(i,i+s.options.slidesToShow).addClass("slick-active").removeAttr("aria-hidden"):n.length<=s.options.slidesToShow?n.addClass("slick-active").removeAttr("aria-hidden"):(o=s.slideCount%s.options.slidesToShow,e=!0===s.options.infinite?s.options.slidesToShow+i:i,(s.options.slidesToShow==s.options.slidesToScroll&&s.slideCount-i<s.options.slidesToShow?n.slice(e-(s.options.slidesToShow-o),e+o):n.slice(e,e+s.options.slidesToShow)).addClass("slick-active").removeAttr("aria-hidden")),"ondemand"!==s.options.lazyLoad&&"anticipated"!==s.options.lazyLoad||s.lazyLoad()},l.prototype.setupInfinite=function(){var i,e,t,o=this;if(!0===o.options.fade&&(o.options.centerMode=!1),!0===o.options.infinite&&!1===o.options.fade&&(e=null,o.slideCount>o.options.slidesToShow)){for(t=!0===o.options.centerMode?o.options.slidesToShow+1:o.options.slidesToShow,i=o.slideCount;i>o.slideCount-t;--i)e=i-1,d(o.$slides[e]).clone(!0).attr("id","").attr("data-slick-index",e-o.slideCount).prependTo(o.$slideTrack).addClass("slick-cloned");for(i=0;i<t+o.slideCount;i+=1)e=i,d(o.$slides[e]).clone(!0).attr("id","").attr("data-slick-index",e+o.slideCount).appendTo(o.$slideTrack).addClass("slick-cloned");o.$slideTrack.find(".slick-cloned").find("[id]").each(function(){d(this).attr("id","")})}},l.prototype.interrupt=function(i){i||this.autoPlay(),this.interrupted=i},l.prototype.selectHandler=function(i){i=d(i.target).is(".slick-slide")?d(i.target):d(i.target).parents(".slick-slide"),i=(i=parseInt(i.attr("data-slick-index")))||0;this.slideCount<=this.options.slidesToShow?this.slideHandler(i,!1,!0):this.slideHandler(i)},l.prototype.slideHandler=function(i,e,t){var o,s,n,l,r=this;if(e=e||!1,!(!0===r.animating&&!0===r.options.waitForAnimate||!0===r.options.fade&&r.currentSlide===i))if(!1===e&&r.asNavFor(i),o=i,n=r.getLeft(o),e=r.getLeft(r.currentSlide),r.currentLeft=null===r.swipeLeft?e:r.swipeLeft,!1===r.options.infinite&&!1===r.options.centerMode&&(i<0||i>r.getDotCount()*r.options.slidesToScroll))!1===r.options.fade&&(o=r.currentSlide,!0!==t&&r.slideCount>r.options.slidesToShow?r.animateSlide(e,function(){r.postSlide(o)}):r.postSlide(o));else if(!1===r.options.infinite&&!0===r.options.centerMode&&(i<0||i>r.slideCount-r.options.slidesToScroll))!1===r.options.fade&&(o=r.currentSlide,!0!==t&&r.slideCount>r.options.slidesToShow?r.animateSlide(e,function(){r.postSlide(o)}):r.postSlide(o));else{if(r.options.autoplay&&clearInterval(r.autoPlayTimer),s=o<0?r.slideCount%r.options.slidesToScroll!=0?r.slideCount-r.slideCount%r.options.slidesToScroll:r.slideCount+o:o>=r.slideCount?r.slideCount%r.options.slidesToScroll!=0?0:o-r.slideCount:o,r.animating=!0,r.$slider.trigger("beforeChange",[r,r.currentSlide,s]),e=r.currentSlide,r.currentSlide=s,r.setSlideClasses(r.currentSlide),r.options.asNavFor&&(l=(l=r.getNavTarget()).slick("getSlick")).slideCount<=l.options.slidesToShow&&l.setSlideClasses(r.currentSlide),r.updateDots(),r.updateArrows(),!0===r.options.fade)return!0!==t?(r.fadeSlideOut(e),r.fadeSlide(s,function(){r.postSlide(s)})):r.postSlide(s),void r.animateHeight();!0!==t&&r.slideCount>r.options.slidesToShow?r.animateSlide(n,function(){r.postSlide(s)}):r.postSlide(s)}},l.prototype.startLoad=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.hide(),i.$nextArrow.hide()),!0===i.options.dots&&i.slideCount>i.options.slidesToShow&&i.$dots.hide(),i.$slider.addClass("slick-loading")},l.prototype.swipeDirection=function(){var i=this,e=i.touchObject.startX-i.touchObject.curX,t=i.touchObject.startY-i.touchObject.curY,e=Math.atan2(t,e),e=Math.round(180*e/Math.PI);return e<0&&(e=360-Math.abs(e)),e<=45&&0<=e||e<=360&&315<=e?!1===i.options.rtl?"left":"right":135<=e&&e<=225?!1===i.options.rtl?"right":"left":!0===i.options.verticalSwiping?35<=e&&e<=135?"down":"up":"vertical"},l.prototype.swipeEnd=function(i){var e,t,o=this;if(o.dragging=!1,o.swiping=!1,o.scrolling)return o.scrolling=!1;if(o.interrupted=!1,o.shouldClick=!(10<o.touchObject.swipeLength),void 0===o.touchObject.curX)return!1;if(!0===o.touchObject.edgeHit&&o.$slider.trigger("edge",[o,o.swipeDirection()]),o.touchObject.swipeLength>=o.touchObject.minSwipe){switch(t=o.swipeDirection()){case"left":case"down":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide+o.getSlideCount()):o.currentSlide+o.getSlideCount(),o.currentDirection=0;break;case"right":case"up":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide-o.getSlideCount()):o.currentSlide-o.getSlideCount(),o.currentDirection=1}"vertical"!=t&&(o.slideHandler(e),o.touchObject={},o.$slider.trigger("swipe",[o,t]))}else o.touchObject.startX!==o.touchObject.curX&&(o.slideHandler(o.currentSlide),o.touchObject={})},l.prototype.swipeHandler=function(i){var e=this;if(!(!1===e.options.swipe||"ontouchend"in document&&!1===e.options.swipe||!1===e.options.draggable&&-1!==i.type.indexOf("mouse")))switch(e.touchObject.fingerCount=i.originalEvent&&void 0!==i.originalEvent.touches?i.originalEvent.touches.length:1,e.touchObject.minSwipe=e.listWidth/e.options.touchThreshold,!0===e.options.verticalSwiping&&(e.touchObject.minSwipe=e.listHeight/e.options.touchThreshold),i.data.action){case"start":e.swipeStart(i);break;case"move":e.swipeMove(i);break;case"end":e.swipeEnd(i)}},l.prototype.swipeMove=function(i){var e,t,o=this,s=void 0!==i.originalEvent?i.originalEvent.touches:null;return!(!o.dragging||o.scrolling||s&&1!==s.length)&&(e=o.getLeft(o.currentSlide),o.touchObject.curX=void 0!==s?s[0].pageX:i.clientX,o.touchObject.curY=void 0!==s?s[0].pageY:i.clientY,o.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(o.touchObject.curX-o.touchObject.startX,2))),t=Math.round(Math.sqrt(Math.pow(o.touchObject.curY-o.touchObject.startY,2))),!o.options.verticalSwiping&&!o.swiping&&4<t?!(o.scrolling=!0):(!0===o.options.verticalSwiping&&(o.touchObject.swipeLength=t),s=o.swipeDirection(),void 0!==i.originalEvent&&4<o.touchObject.swipeLength&&(o.swiping=!0,i.preventDefault()),t=(!1===o.options.rtl?1:-1)*(o.touchObject.curX>o.touchObject.startX?1:-1),!0===o.options.verticalSwiping&&(t=o.touchObject.curY>o.touchObject.startY?1:-1),i=o.touchObject.swipeLength,(o.touchObject.edgeHit=!1)===o.options.infinite&&(0===o.currentSlide&&"right"===s||o.currentSlide>=o.getDotCount()&&"left"===s)&&(i=o.touchObject.swipeLength*o.options.edgeFriction,o.touchObject.edgeHit=!0),!1===o.options.vertical?o.swipeLeft=e+i*t:o.swipeLeft=e+i*(o.$list.height()/o.listWidth)*t,!0===o.options.verticalSwiping&&(o.swipeLeft=e+i*t),!0!==o.options.fade&&!1!==o.options.touchMove&&(!0===o.animating?(o.swipeLeft=null,!1):void o.setCSS(o.swipeLeft))))},l.prototype.swipeStart=function(i){var e,t=this;if(t.interrupted=!0,1!==t.touchObject.fingerCount||t.slideCount<=t.options.slidesToShow)return!(t.touchObject={});void 0!==i.originalEvent&&void 0!==i.originalEvent.touches&&(e=i.originalEvent.touches[0]),t.touchObject.startX=t.touchObject.curX=void 0!==e?e.pageX:i.clientX,t.touchObject.startY=t.touchObject.curY=void 0!==e?e.pageY:i.clientY,t.dragging=!0},l.prototype.unfilterSlides=l.prototype.slickUnfilter=function(){var i=this;null!==i.$slidesCache&&(i.unload(),i.$slideTrack.children(this.options.slide).detach(),i.$slidesCache.appendTo(i.$slideTrack),i.reinit())},l.prototype.unload=function(){var i=this;d(".slick-cloned",i.$slider).remove(),i.$dots&&i.$dots.remove(),i.$prevArrow&&i.htmlExpr.test(i.options.prevArrow)&&i.$prevArrow.remove(),i.$nextArrow&&i.htmlExpr.test(i.options.nextArrow)&&i.$nextArrow.remove(),i.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")},l.prototype.unslick=function(i){this.$slider.trigger("unslick",[this,i]),this.destroy()},l.prototype.updateArrows=function(){var i=this;Math.floor(i.options.slidesToShow/2);!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&!i.options.infinite&&(i.$prevArrow.removeClass("slick-disabled").prop("disabled",!1),i.$nextArrow.removeClass("slick-disabled").prop("disabled",!1),0===i.currentSlide?(i.$prevArrow.addClass("slick-disabled").prop("disabled",!0),i.$nextArrow.removeClass("slick-disabled").prop("disabled",!1)):(i.currentSlide>=i.slideCount-i.options.slidesToShow&&!1===i.options.centerMode||i.currentSlide>=i.slideCount-1&&!0===i.options.centerMode)&&(i.$nextArrow.addClass("slick-disabled").prop("disabled",!0),i.$prevArrow.removeClass("slick-disabled").prop("disabled",!1)))},l.prototype.updateDots=function(){var i=this;null!==i.$dots&&(i.$dots.find("li").removeClass("slick-active").find("button").removeAttr("aria-current").end().end(),i.$dots.find("li").eq(Math.floor(i.currentSlide/i.options.slidesToScroll)).addClass("slick-active").find("button").attr("aria-current",!0).end().end())},l.prototype.updateSlideVisibility=function(){this.$slideTrack.find(".slick-slide").attr("aria-hidden","true").find("a, input, button, select").attr("tabindex","-1"),this.$slideTrack.find(".slick-active").removeAttr("aria-hidden").find("a, input, button, select").removeAttr("tabindex")},l.prototype.visibility=function(){this.options.autoplay&&(document[this.hidden]?this.interrupted=!0:this.interrupted=!1)},d.fn.slick=function(){for(var i,e=this,t=arguments[0],o=Array.prototype.slice.call(arguments,1),s=e.length,n=0;n<s;n++)if("object"==typeof t||void 0===t?e[n].slick=new l(e[n],t):i=e[n].slick[t].apply(e[n].slick,o),void 0!==i)return i;return e}});(function($){$.csSlider=function(el,options){var base=this;base.$el=$(el);base.el=el;base.$el.data("csSlider",base);base.initSlider3Items=function(){if(base.$el.find('.js-slider-3-items').length){base.$el.find('.js-slider-3-items').each(function(){$(this).slick({infinite:!1,dots:!0,dotsClass:'slick-dots h-clean',regionLabel:base.options.sliderRegionLabel,prevArrow:base.options.sliderPrevArrow,nextArrow:base.options.sliderNextArrow,slidesToShow:3,slidesToScroll:3,responsive:[{breakpoint:921,settings:{slidesToShow:2,slidesToScroll:2}},{breakpoint:641,settings:{slidesToShow:1,slidesToScroll:1}}]})})}};base.initSlider4Items=function(){if(base.$el.find('.js-slider-4-items').length){base.$el.find('.js-slider-4-items').each(function(){$(this).slick({dots:!1,infinite:!1,slidesToShow:4,slidesToScroll:1,responsive:[{breakpoint:1161,settings:{slidesToShow:3}},{breakpoint:921,settings:{slidesToShow:2}},{breakpoint:769,settings:{slidesToShow:1}}]})})}};base.initSlider2Items=function(){if(base.$el.find('.js-slider-2-items').length){base.$el.find('.js-slider-2-items').each(function(){$(this).slick({dots:!1,infinite:!1,slidesToShow:2,slidesToScroll:1,responsive:[{breakpoint:769,settings:{slidesToShow:1}}]})})}};base.init=function(){base.options=$.extend({},$.csSlider.defaultOptions,options);base.initSlider3Items();base.initSlider4Items();base.initSlider2Items()};base.init()};$.csSlider.defaultOptions={sliderRegionLabel:'Slider',sliderNextArrow:'<button class="slick-next" type="button"><span class="slick-next-icon" aria-hidden="true"></span><span class="slick-sr-only">'+$('.js-slider-3-items').data('next-text')+'</span></button>',sliderPrevArrow:'<button class="slick-prev" type="button"><span class="slick-prev-icon" aria-hidden="true"></span><span class="slick-sr-only">'+$('.js-slider-3-items').data('prev-text')+'</span></button>'};$.fn.csSlider=function(options){return this.each(function(){(new $.csSlider(this,options))})}}(jQuery));(function($){$.csSectionLinks=function(el,options){var base=this;base.$el=$(el);base.el=el;base.$el.data('csSectionLinks',base);base.filterPath=function(string){return string.replace(/^\//,'').replace(/(index|default).[a-zA-Z]{3,4}$/,'').replace(/\/$/,'')};base.setOffset=function(){var offset=$('.js-header').outerHeight()+parseInt($('.js-header').css('top'),10);if(window.matchMedia('(min-width: '+(base.options.breakpointActiveSectionLinks+1)+'px)').matches&&$('.js-fixed-button-menu').length){offset+=$('.js-fixed-button-menu').outerHeight()+parseInt($('.js-fixed-button-menu').css('margin-bottom'))}
base.offset=offset*1.35};base.scrollToSection=function(hash,setHashToUrl,preventFocus,visibilityCheck){var $target;if(hash==''){$target=$('#main-content');hash='main-content'}else if(hash instanceof jQuery){$target=hash}else{$target=$('#'+hash)}
var targetTop=$target.offset().top;if(document.querySelector('.js-audio-stream-active')){targetTop=targetTop-48}
if(visibilityCheck==1){var windowTop=$(window).scrollTop();var windowBottom=windowTop+$(window).height();if(targetTop>=windowTop&&targetTop<windowBottom){return!1}}
$('html, body').animate({scrollTop:targetTop-base.offset,},1000,function(){if(setHashToUrl==1){history.pushState(null,null,'#'+hash)}
if(preventFocus==1||window.matchMedia('(max-width: '+base.options.breakpointMobile+'px)').matches){return!1}else{document.getElementById(hash).focus({preventScroll:!0});if($target.is(':focus')){return!1}else{$target.attr('tabindex','-1');document.getElementById(hash).focus({preventScroll:!0});return!1}}})};base.clickEvent=function(){var locationPath=base.filterPath(location.pathname);base.$el.find('a[href*="#"]:not([href="#"]):not(.js-inline-lightbox):not(.js-toggle-sidebar-content):not(.js-go-to-main-content)').each(function(){var thisPath=base.filterPath(this.pathname)||locationPath;var hash=this.hash;if($(hash).length){var targetName=this.hash.replace(/#/,'');if(locationPath==thisPath&&(location.hostname==this.hostname||!this.hostname)&&targetName){if(this.hash){$(this).click(function(e){e.preventDefault();$('.js-header').data('csHeader').toggleMenu('deactivate');base.scrollToSection(targetName,1);return!1})}}}})};base.initUrlWithHash=function(){if($(window.location.hash).length){setTimeout(function(){base.scrollToSection(window.location.hash.replace(/#/,''),0)},700)}};base.initScrollArray=function(){base.sectionLinkContents=$('.js-section-menu-link').map(function(index){if($($(this).attr('href')).length){return $($(this).attr('href'))}})};base.scroll=function(){window.addEventListener('scroll',function(){if(window.matchMedia('(min-width: '+(base.options.breakpointActiveSectionLinks+1)+'px)').matches){var scrollTop=$(this).scrollTop();var $currentContent=base.sectionLinkContents.map(function(){if(($(this).offset().top-base.offset-5)<scrollTop){return $(this)}});$currentContent=$currentContent[$currentContent.length-1];var currentContentId=$currentContent&&$currentContent.length?$currentContent[0].id:'';$('.js-section-menu-link').removeClass('button--active');$('.js-section-menu-link[href="#'+currentContentId+'"]').addClass('button--active')}else{$('.js-section-menu-link').removeClass('button--active')}})};base.resize=function(){$(window).resize(function(){base.setOffset()})};base.init=function(){base.options=$.extend({},$.csSectionLinks.defaultOptions,options);base.setOffset();base.clickEvent();base.initUrlWithHash();base.initScrollArray();base.scroll();base.resize()};base.init()};$.csSectionLinks.defaultOptions={breakpointActiveSectionLinks:1160,breakpointMobile:768,};$.fn.csSectionLinks=function(options){return this.each(function(){(new $.csSectionLinks(this,options))})}}(jQuery));(function($){$.csGlobalNewsticker=function(el,options){var base=this;base.$el=$(el);base.el=el;base.$el.data("csGlobalNewsticker",base);base.baseGlobalNewsticker=function(){if(base.$el.find('.js-global-newsticker').length){base.$el.find('.js-global-newsticker').each(function(){var $this=$(this);if(Cookies.get('hide-global-newsticker')){let currentStateOfElements=$this.data('state');let cookieStateOfElements=Cookies.get('hide-global-newsticker');if(currentStateOfElements===cookieStateOfElements){return}}
$('body').addClass('global-news-ticker-is-active');$('.js-global-newsticker').slideDown(400,'linear',function(){if($('.js-global-wrapper').data("csFixedButtonMenu")){$('.js-global-wrapper').data("csFixedButtonMenu").setBreakpoint()}
if($('.js-global-wrapper').data("csSectionLinks")){$('.js-global-wrapper').data("csSectionLinks").setOffset()}})})}};base.closeGlobalNewsticker=function(){if(base.$el.find('.js-close-global-newsticker').length){base.$el.find('.js-close-global-newsticker').each(function(){let $closeLink=$(this);$closeLink.click(function(){Cookies.set('hide-global-newsticker',$closeLink.closest('.js-global-newsticker').data('state'));$('body').removeClass('global-news-ticker-is-active');$('.js-global-newsticker').slideUp(400,'linear',function(){if($('.js-global-wrapper').data("csFixedButtonMenu")){$('.js-global-wrapper').data("csFixedButtonMenu").setBreakpoint()}
if($('.js-global-wrapper').data("csSectionLinks")){$('.js-global-wrapper').data("csSectionLinks").setOffset()}})})})}};base.init=function(){base.options=$.extend({},$.csGlobalNewsticker.defaultOptions,options);base.baseGlobalNewsticker();base.closeGlobalNewsticker()};base.init()};$.csGlobalNewsticker.defaultOptions={};$.fn.csGlobalNewsticker=function(options){return this.each(function(){(new $.csGlobalNewsticker(this,options))})}}(jQuery));(function(){'use strict';function AccordionTabs(el,options){if(!el){return}
this.el=el;this.id=this.el.id;this.tabTriggers=document.querySelectorAll('#'+this.id+' > .js-tabs-list .js-tabs-trigger');this.tabPanels=document.querySelectorAll('#'+this.id+' > .js-tabs-panel');this.accordeonTriggers=document.querySelectorAll('#'+this.id+' > .js-tabs-panel > .js-accordeon-trigger');this.options=this._extend({breakpoint:768,tabsAllowed:!0,selectedTab:0,},options);if(el.getAttribute('data-tabs-allowed')=='true'){this.options.tabsAllowed=!0}else if(el.getAttribute('data-tabs-allowed')=='false'){this.options.tabsAllowed=!1}
if(el.getAttribute('data-breakpoint')){this.options.breakpoint=parseInt(el.getAttribute('data-breakpoint'))}
if(el.getAttribute('data-selected-tab')){this.options.selectedTab=parseInt(el.getAttribute('data-selected-tab'))}
if(this.tabTriggers.length===0||this.tabTriggers.length!==this.tabPanels.length){return}
if(el.getAttribute('data-all-closed-on-init')=='true'){this.options.allClosedOnInit=!0}else if(el.getAttribute('data-all-closed-on-init')=='false'){this.options.allClosedOnInit=!1}
this._init()}
AccordionTabs.prototype._init=function(){var _this=this;this.tabTriggersLength=this.tabTriggers.length;this.accordeonTriggersLength=this.accordeonTriggers.length;this.selectedTab=0;this.prevSelectedTab=null;this.clickListener=this._clickEvent.bind(this);this.keydownListener=this._keydownEvent.bind(this);this.keys={prev:37,next:39,space:32,enter:13,};if(window.innerWidth>=this.options.breakpoint&&this.options.tabsAllowed){this.isAccordeon=!1}else{this.isAccordeon=!0}
for(var i=0;i<this.tabTriggersLength;i++){this.tabTriggers[i].index=i;this.tabTriggers[i].addEventListener('click',this.clickListener,!1);this.tabTriggers[i].addEventListener('keydown',this.keydownListener,!1);if(this.tabTriggers[i].classList.contains('is-selected')){this.selectedTab=i}
this._hide(i)}
for(var z=0;z<this.accordeonTriggersLength;z++){this.accordeonTriggers[z].index=z;this.accordeonTriggers[z].addEventListener('click',this.clickListener,!1);this.accordeonTriggers[z].addEventListener('keydown',this.keydownListener,!1);if(this.accordeonTriggers[z].classList.contains('is-selected')){this.selectedTab=z}}
if(!isNaN(this.options.selectedTab)){this.selectedTab=this.options.selectedTab<this.tabTriggersLength?this.options.selectedTab:this.tabTriggersLength-1}
this.el.classList.add('is-initialized');if(this.options.tabsAllowed){this.el.classList.add('tabs-allowed')}
if(!this.options.allClosedOnInit){this.selectTab(this.selectedTab,!1)}
var resizeTabs=this._debounce(function(){if(window.innerWidth>=_this.options.breakpoint&&_this.options.tabsAllowed){_this.isAccordeon=!1;if(_this.options.tabsAllowed){_this.el.classList.add('tabs-allowed')}
_this.selectTab(_this.selectedTab)}else{_this.isAccordeon=!0;_this.el.classList.remove('tabs-allowed');if(!_this.options.allClosedOnInit){_this.selectTab(_this.selectedTab)}}},50);window.addEventListener('resize',resizeTabs)};AccordionTabs.prototype._clickEvent=function(e){e.preventDefault();var closestTrigger=this._getClosest(e.target,'.js-tabs-trigger');var closestTab=0;if(closestTrigger==null){closestTrigger=this._getClosest(e.target,'.js-accordeon-trigger');closestTab=this._getClosest(closestTrigger,'.js-tabs-panel');this.isAccordeon=!0}else{this.isAccordeon=!1}
var targetIndex=e.target.index!=null?e.target.index:closestTab.index;this.selectTab(targetIndex,!0)};AccordionTabs.prototype._keydownEvent=function(e){var targetIndex;if(e.keyCode===this.keys.prev||e.keyCode===this.keys.next||e.keyCode===this.keys.space||e.keyCode===this.keys.enter){e.preventDefault()}else{return}
if(e.keyCode===this.keys.prev&&e.target.index>0&&!this.isAccordeon){targetIndex=e.target.index-1}else if(e.keyCode===this.keys.next&&e.target.index<this.tabTriggersLength-1&&!this.isAccordeon){targetIndex=e.target.index+1}else if(e.keyCode===this.keys.space||e.keyCode===this.keys.enter){targetIndex=e.target.index}else{return}
this.selectTab(targetIndex,!0)};AccordionTabs.prototype._show=function(index,userInvoked){this.tabPanels[index].removeAttribute('tabindex');this.tabTriggers[index].removeAttribute('tabindex');this.tabTriggers[index].classList.add('is-selected');this.tabTriggers[index].setAttribute('aria-selected',!0);this.accordeonTriggers[index].setAttribute('aria-expanded',!0);var panelContent=this.tabPanels[index].getElementsByClassName('js-tabs-content')[0];panelContent.classList.remove('is-hidden');panelContent.classList.add('is-open');panelContent.removeAttribute('inert');this.tabPanels[index].classList.remove('is-hidden');this.tabPanels[index].classList.add('is-open');if(userInvoked){this.tabTriggers[index].focus()}};AccordionTabs.prototype._hide=function(index){this.tabTriggers[index].classList.remove('is-selected');this.tabTriggers[index].setAttribute('aria-selected',!1);this.tabTriggers[index].setAttribute('tabindex',-1);if(this.options.allClosedOnInit&&!this.selectedTab){this.tabTriggers[0].setAttribute('tabindex',0)}
this.accordeonTriggers[index].setAttribute('aria-expanded',!1);var panelContent=this.tabPanels[index].getElementsByClassName('js-tabs-content')[0];panelContent.classList.remove('is-open');panelContent.setAttribute('inert','');panelContent.classList.add('is-hidden');this.tabPanels[index].classList.remove('is-open');this.tabPanels[index].classList.add('is-hidden');this.tabPanels[index].setAttribute('tabindex',-1)};AccordionTabs.prototype.selectTab=function(index,userInvoked){if(index===null){if(this.isAccordeon){return}else{index=0}}
if(!this.tabPanels[index].classList.contains('is-hidden')&&userInvoked){if(index===this.selectedTab){this.selectedTab=null}else{this.selectedTab=null;this.prevSelectedTab=index}
this._hide(index);return}
if(this.isAccordeon){this.prevSelectedTab=this.selectedTab;this.selectedTab=index}else{if(this.prevSelectedTab===null||!this.isAccordeon){for(var i=0;i<this.tabTriggersLength;i++){if(i!==index){this._hide(i)}}}else{if(this.selectedTab!==null){this._hide(this.selectedTab)}}
this.prevSelectedTab=this.selectedTab;this.selectedTab=index}
this._show(this.selectedTab,userInvoked)};AccordionTabs.prototype.destroy=function(){for(var i=0;i<this.tabTriggersLength;i++){this.tabTriggers[i].classList.remove('is-selected');this.tabTriggers[i].removeAttribute('aria-selected');this.tabTriggers[i].removeAttribute('tabindex');this.tabPanels[i].classList.remove('is-hidden');this.tabPanels[i].removeAttribute('tabindex');this.tabTriggers[i].removeEventListener('click',this.clickListener,!1);this.tabTriggers[i].removeEventListener('keydown',this.keydownListener,!1);delete this.tabTriggers[i].index}
this.el.classList.remove('is-initialized')};AccordionTabs.prototype._getClosest=function(elem,selector){if(!Element.prototype.matches){Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(s){var matches=(this.document||this.ownerDocument).querySelectorAll(s),i=matches.length;while(--i>=0&&matches.item(i)!==this){}
return i>-1}}
for(;elem&&elem!==document;elem=elem.parentNode){if(elem.matches(selector))return elem}
return null};AccordionTabs.prototype._extend=function(){var extended={};var deep=!1;var i=0;var length=arguments.length;if(Object.prototype.toString.call(arguments[0])==='[object Boolean]'){deep=arguments[0];i++}
var merge=function(obj){for(var prop in obj){if(Object.prototype.hasOwnProperty.call(obj,prop)){if(deep&&Object.prototype.toString.call(obj[prop])==='[object Object]'){extended[prop]=extend(!0,extended[prop],obj[prop])}else{extended[prop]=obj[prop]}}}};for(;i<length;i++){var obj=arguments[i];merge(obj)}
return extended};AccordionTabs.prototype._debounce=function(func,wait,immediate){var timeout;return function(){var context=this,args=arguments;var later=function(){timeout=null;if(!immediate){func.apply(context,args)}};var callNow=immediate&&!timeout;clearTimeout(timeout);timeout=setTimeout(later,wait);if(callNow){func.apply(context,args)}}};var slice=Array.prototype.slice;function $(expr,con){return typeof expr==='string'?(con||document).querySelector(expr):expr||null}
function $$(expr,con){return slice.call((con||document).querySelectorAll(expr))}
function init(){$$('.js-tabs').forEach(function(input){new AccordionTabs(input)})}
if(typeof Document!=='undefined'){if(document.readyState!=='loading'){init()}else{document.addEventListener('DOMContentLoaded',init)}}
if(typeof self!=='undefined'){self.AccordionTabs=AccordionTabs}
if(typeof module==='object'&&module.exports){module.exports=AccordionTabs}
return AccordionTabs})();"use strict";var AblePlayerInstances=[];(function($){$(document).ready(function(){function initAbleplayer(){$('video:not(.able-player-initialized), audio:not(.able-player-initialized)').each(function(index,element){if($(element).data('able-player')!==undefined){$(element).addClass('able-player-initialized');AblePlayerInstances.push(new AblePlayer($(this),$(element)))}})}
initAbleplayer();$(document).ajaxComplete(function(){AblePlayerInstances=[];initAbleplayer()});document.addEventListener('csAjaxComplete',function(e){AblePlayerInstances=[];initAbleplayer()},!1)});window.onYouTubeIframeAPIReady=function(){AblePlayer.youtubeIframeAPIReady=!0;$('body').trigger('youtubeIframeAPIReady',[])};$(window).keydown(function(e){if(AblePlayer.nextIndex===1){AblePlayer.lastCreated.onPlayerKeyPress(e)}});window.AblePlayer=function(media){AblePlayer.lastCreated=this;this.media=media;if($(media).length===0){this.provideFallback();return}
if($(media).attr('autoplay')!==undefined){this.autoplay=!0;this.okToPlay=!0}else{this.autoplay=!1;this.okToPlay=!1}
if($(media).attr('loop')!==undefined){this.loop=!0}else{this.loop=!1}
if($(media).attr('playsinline')!==undefined){this.playsInline='1'}else{this.playsInline='0'}
if($(media).attr('poster')){this.hasPoster=!0}else{this.hasPoster=!1}
if($(media).data('start-time')!==undefined&&$.isNumeric($(media).data('start-time'))){this.startTime=$(media).data('start-time')}else{this.startTime=0}
if($(media).data('debug')!==undefined&&$(media).data('debug')!==!1){this.debug=!0}else{this.debug=!1}
if($(media).data('root-path')!==undefined){this.rootPath=$(media).data('root-path').replace(/\/?$/,'/')}else{this.rootPath=this.getRootPath()}
this.defaultVolume=7;if($(media).data('volume')!==undefined&&$(media).data('volume')!==""){var volume=$(media).data('volume');if(volume>=0&&volume<=10){this.defaultVolume=volume}}
this.volume=this.defaultVolume;if($(media).data('use-chapters-button')!==undefined&&$(media).data('use-chapters-button')===!1){this.useChaptersButton=!1}else{this.useChaptersButton=!0}
if($(media).data('use-descriptions-button')!==undefined&&$(media).data('use-descriptions-button')===!1){this.useDescriptionsButton=!1}else{this.useDescriptionsButton=!0}
if($(media).data('descriptions-audible')!==undefined&&$(media).data('descriptions-audible')===!1){this.exposeTextDescriptions=!1}else if($(media).data('description-audible')!==undefined&&$(media).data('description-audible')===!1){this.exposeTextDescriptions=!1}else{this.exposeTextDescriptions=!0}
if($(media).data('heading-level')!==undefined&&$(media).data('heading-level')!==""){var headingLevel=$(media).data('heading-level');if(/^[0-6]*$/.test(headingLevel)){this.playerHeadingLevel=headingLevel}}
if($(media).data('transcript-div')!==undefined&&$(media).data('transcript-div')!==""){this.transcriptDivLocation=$(media).data('transcript-div')}else{this.transcriptDivLocation=null}
if($(media).data('include-transcript')!==undefined&&$(media).data('include-transcript')===!1){this.hideTranscriptButton=!0}else{this.hideTranscriptButton=null}
this.transcriptType=null;if($(media).data('transcript-src')!==undefined){this.transcriptSrc=$(media).data('transcript-src');if(this.transcriptSrcHasRequiredParts()){this.transcriptType='manual'}}else if($(media).find('track[kind="captions"], track[kind="subtitles"]').length>0){if(this.transcriptDivLocation){this.transcriptType='external'}else{this.transcriptType='popup'}}
if($(media).data('lyrics-mode')!==undefined&&$(media).data('lyrics-mode')!==!1){this.lyricsMode=!0}else{this.lyricsMode=!1}
if($(media).data('transcript-title')!==undefined&&$(media).data('transcript-title')!==""){this.transcriptTitle=$(media).data('transcript-title')}else{}
if($(media).data('captions-position')==='overlay'){this.defaultCaptionsPosition='overlay'}else{this.defaultCaptionsPosition='below'}
if($(media).data('chapters-div')!==undefined&&$(media).data('chapters-div')!==""){this.chaptersDivLocation=$(media).data('chapters-div')}
if($(media).data('chapters-title')!==undefined){this.chaptersTitle=$(media).data('chapters-title')}
if($(media).data('chapters-default')!==undefined&&$(media).data('chapters-default')!==""){this.defaultChapter=$(media).data('chapters-default')}else{this.defaultChapter=null}
if($(media).data('speed-icons')==='arrows'){this.speedIcons='arrows'}else{this.speedIcons='animals'}
if($(media).data('seekbar-scope')==='chapter'||$(media).data('seekbar-scope')==='chapters'){this.seekbarScope='chapter'}else{this.seekbarScope='video'}
if($(media).data('youtube-id')!==undefined&&$(media).data('youtube-id')!==""){this.youTubeId=$(media).data('youtube-id')}
if($(media).data('youtube-desc-id')!==undefined&&$(media).data('youtube-desc-id')!==""){this.youTubeDescId=$(media).data('youtube-desc-id')}
if($(media).data('youtube-nocookie')!==undefined&&$(media).data('youtube-nocookie')){this.youTubeNoCookie=!0}else{this.youTubeNoCookie=!1}
if($(media).data('vimeo-id')!==undefined&&$(media).data('vimeo-id')!==""){this.vimeoId=$(media).data('vimeo-id')}
if($(media).data('vimeo-desc-id')!==undefined&&$(media).data('vimeo-desc-id')!==""){this.vimeoDescId=$(media).data('vimeo-desc-id')}
if($(media).data('skin')=='2020'){this.skin='2020'}else{this.skin='legacy'}
this.iconType='font';this.forceIconType=!1;if($(media).data('icon-type')!==undefined&&$(media).data('icon-type')!==""){var iconType=$(media).data('icon-type');if(iconType==='font'||iconType=='image'||iconType=='svg'){this.iconType=iconType;this.forceIconType=!0}}
if($(media).data('allow-fullscreen')!==undefined&&$(media).data('allow-fullscreen')===!1){this.allowFullScreen=!1}else{this.allowFullScreen=!0}
this.defaultSeekInterval=10;this.useFixedSeekInterval=!1;if($(media).data('seek-interval')!==undefined&&$(media).data('seek-interval')!==""){var seekInterval=$(media).data('seek-interval');if(/^[1-9][0-9]*$/.test(seekInterval)){this.seekInterval=seekInterval;this.useFixedSeekInterval=!0}}
if($(media).data('show-now-playing')!==undefined&&$(media).data('show-now-playing')===!1){this.showNowPlaying=!1}else{this.showNowPlaying=!0}
if($(media).data('use-ttml')!==undefined){this.useTtml=!0;this.convert=require('xml-js')}else{this.useTtml=!1}
if($(media).data('test-fallback')!==undefined&&$(media).data('test-fallback')!==!1){this.testFallback=!0}
this.lang='en';if($(media).data('lang')!==undefined&&$(media).data('lang')!==""){var lang=$(media).data('lang');if(lang.length==2){this.lang=lang}}
if($(media).data('force-lang')!==undefined&&$(media).data('force-lang')!==!1){this.forceLang=!0}else{this.forceLang=!1}
if($(media).data('meta-type')!==undefined&&$(media).data('meta-type')!==""){this.metaType=$(media).data('meta-type')}
if($(media).data('meta-div')!==undefined&&$(media).data('meta-div')!==""){this.metaDiv=$(media).data('meta-div')}
if($(media).data('search')!==undefined&&$(media).data('search')!==""){if($(media).data('search-div')!==undefined&&$(media).data('search-div')!==""){this.searchString=$(media).data('search');this.searchDiv=$(media).data('search-div')}
if($(media).data('search-lang')!==undefined&&$(media).data('search-lang')!==""){this.searchLang=$(media).data('search-lang')}else{this.searchLang=null}
if($(media).data('search-div')!==undefined&&$(media).data('search-div')!==""){this.searchString=$(media).data('search');this.searchDiv=$(media).data('search-div')}}
if($(media).data('hide-controls')!==undefined&&$(media).data('hide-controls')!==!1){this.hideControls=!0;this.hideControlsOriginal=!0}else{this.hideControls=!1;this.hideControlsOriginal=!1}
if($(media).data('steno-mode')!==undefined&&$(media).data('steno-mode')!==!1){this.stenoMode=!0}else{this.stenoMode=!1}
this.setDefaults();this.ableIndex=AblePlayer.nextIndex;AblePlayer.nextIndex+=1;this.title=$(media).attr('title');this.tt={};var thisObj=this;$.when(this.getTranslationText()).then(function(){if(thisObj.countProperties(thisObj.tt)>50){thisObj.setup()}else{thisObj.provideFallback()}})};AblePlayer.nextIndex=0;AblePlayer.prototype.setup=function(){var thisObj=this;this.initializing=!0;this.reinitialize().then(function(){if(!thisObj.player){thisObj.provideFallback()}else{thisObj.setupInstance().then(function(){thisObj.setupInstancePlaylist();if(!thisObj.hasPlaylist){thisObj.recreatePlayer()}
thisObj.initializing=!1;thisObj.playerCreated=!0})}})};AblePlayer.getActiveDOMElement=function(){var activeElement=document.activeElement;while(activeElement.shadowRoot&&activeElement.shadowRoot.activeElement){activeElement=activeElement.shadowRoot.activeElement}
return activeElement};AblePlayer.localGetElementById=function(element,id){if(element.getRootNode){return $(element.getRootNode().querySelector('#'+id))}else{return $(document.getElementById(id))}};AblePlayer.youtubeIframeAPIReady=!1;AblePlayer.loadingYoutubeIframeAPI=!1})(jQuery);(function($){AblePlayer.prototype.setDefaults=function(){this.playerCreated=!1;this.playing=!1;this.paused=!0;this.clickedPlay=!1;this.fullscreen=!1;this.swappingSrc=!1;this.initializing=!1;this.cueingPlaylistItems=!1;this.okToPlay=!1;this.buttonWithFocus=null;this.getUserAgent();this.setIconColor();this.setButtonImages()};AblePlayer.prototype.getRootPath=function(){var scripts,i,scriptSrc,scriptFile,fullPath,ablePath,parentFolderIndex,rootPath;scripts=document.getElementsByTagName('script');for(i=0;i<scripts.length;i++){scriptSrc=scripts[i].src;scriptFile=scriptSrc.substr(scriptSrc.lastIndexOf('/'));if(scriptFile.indexOf('ableplayer')!==-1){fullPath=scriptSrc.split('?')[0];break}}
ablePath=fullPath.split('/').slice(0,-1).join('/');parentFolderIndex=ablePath.lastIndexOf('/');rootPath=ablePath.substring(0,parentFolderIndex)+'/';return rootPath}
AblePlayer.prototype.setIconColor=function(){var $elements,i,$el,bgColor,rgb,red,green,blue,luminance,iconColor;$elements=['controller','toolbar'];for(i=0;i<$elements.length;i++){if($elements[i]=='controller'){$el=$('<div>',{'class':'able-controller'}).hide()}else if($elements[i]==='toolbar'){$el=$('<div>',{'class':'able-window-toolbar'}).hide()}
$('body').append($el);bgColor=$el.css('background-color');rgb=bgColor.replace(/[^\d,]/g,'').split(',');red=rgb[0];green=rgb[1];blue=rgb[2];luminance=(0.2126*red)+(0.7152*green)+(0.0722*blue);if(luminance<125){iconColor='white'}else{iconColor='black'}
if($elements[i]==='controller'){this.iconColor=iconColor}else if($elements[i]==='toolbar'){this.toolbarIconColor=iconColor}
$el.remove()}};AblePlayer.prototype.setButtonImages=function(){this.imgPath=this.rootPath+'button-icons/'+this.iconColor+'/';this.playButtonImg=this.imgPath+'play.png';this.pauseButtonImg=this.imgPath+'pause.png';this.restartButtonImg=this.imgPath+'restart.png';this.rewindButtonImg=this.imgPath+'rewind.png';this.forwardButtonImg=this.imgPath+'forward.png';this.previousButtonImg=this.imgPath+'previous.png';this.nextButtonImg=this.imgPath+'next.png';if(this.speedIcons==='arrows'){this.fasterButtonImg=this.imgPath+'slower.png';this.slowerButtonImg=this.imgPath+'faster.png'}else if(this.speedIcons==='animals'){this.fasterButtonImg=this.imgPath+'rabbit.png';this.slowerButtonImg=this.imgPath+'turtle.png'}
this.captionsButtonImg=this.imgPath+'captions.png';this.chaptersButtonImg=this.imgPath+'chapters.png';this.signButtonImg=this.imgPath+'sign.png';this.transcriptButtonImg=this.imgPath+'transcript.png';this.descriptionsButtonImg=this.imgPath+'descriptions.png';this.fullscreenExpandButtonImg=this.imgPath+'fullscreen-expand.png';this.fullscreenCollapseButtonImg=this.imgPath+'fullscreen-collapse.png';this.prefsButtonImg=this.imgPath+'preferences.png';this.helpButtonImg=this.imgPath+'help.png'};AblePlayer.prototype.getSvgData=function(button){var svg=Array();switch(button){case 'play':svg[0]='0 0 16 20';svg[1]='M0 18.393v-16.429q0-0.29 0.184-0.402t0.441 0.033l14.821 8.237q0.257 0.145 0.257 0.346t-0.257 0.346l-14.821 8.237q-0.257 0.145-0.441 0.033t-0.184-0.402z';break;case 'pause':svg[0]='0 0 20 20';svg[1]='M0 18.036v-15.714q0-0.29 0.212-0.502t0.502-0.212h5.714q0.29 0 0.502 0.212t0.212 0.502v15.714q0 0.29-0.212 0.502t-0.502 0.212h-5.714q-0.29 0-0.502-0.212t-0.212-0.502zM10 18.036v-15.714q0-0.29 0.212-0.502t0.502-0.212h5.714q0.29 0 0.502 0.212t0.212 0.502v15.714q0 0.29-0.212 0.502t-0.502 0.212h-5.714q-0.29 0-0.502-0.212t-0.212-0.502z';break;case 'stop':svg[0]='0 0 20 20';svg[1]='M0 18.036v-15.714q0-0.29 0.212-0.502t0.502-0.212h15.714q0.29 0 0.502 0.212t0.212 0.502v15.714q0 0.29-0.212 0.502t-0.502 0.212h-15.714q-0.29 0-0.502-0.212t-0.212-0.502z';break;case 'restart':svg[0]='0 0 20 20';svg[1]='M18 8h-6l2.243-2.243c-1.133-1.133-2.64-1.757-4.243-1.757s-3.109 0.624-4.243 1.757c-1.133 1.133-1.757 2.64-1.757 4.243s0.624 3.109 1.757 4.243c1.133 1.133 2.64 1.757 4.243 1.757s3.109-0.624 4.243-1.757c0.095-0.095 0.185-0.192 0.273-0.292l1.505 1.317c-1.466 1.674-3.62 2.732-6.020 2.732-4.418 0-8-3.582-8-8s3.582-8 8-8c2.209 0 4.209 0.896 5.656 2.344l2.344-2.344v6z';break;case 'rewind':svg[0]='0 0 20 20';svg[1]='M11.25 3.125v6.25l6.25-6.25v13.75l-6.25-6.25v6.25l-6.875-6.875z';break;case 'forward':svg[0]='0 0 20 20';svg[1]='M10 16.875v-6.25l-6.25 6.25v-13.75l6.25 6.25v-6.25l6.875 6.875z';break;case 'previous':svg[0]='0 0 20 20';svg[1]='M5 17.5v-15h2.5v6.875l6.25-6.25v13.75l-6.25-6.25v6.875z';break;case 'next':svg[0]='0 0 20 20';svg[1]='M15 2.5v15h-2.5v-6.875l-6.25 6.25v-13.75l6.25 6.25v-6.875z';break;case 'slower':svg[0]='0 0 20 20';svg[1]='M0 7.321q0-0.29 0.212-0.502t0.502-0.212h10q0.29 0 0.502 0.212t0.212 0.502-0.212 0.502l-5 5q-0.212 0.212-0.502 0.212t-0.502-0.212l-5-5q-0.212-0.212-0.212-0.502z';break;case 'faster':svg[0]='0 0 11 20';svg[1]='M0 12.411q0-0.29 0.212-0.502l5-5q0.212-0.212 0.502-0.212t0.502 0.212l5 5q0.212 0.212 0.212 0.502t-0.212 0.502-0.502 0.212h-10q-0.29 0-0.502-0.212t-0.212-0.502z';break;case 'turtle':svg[0]='0 0 20 20';svg[1]='M17.212 3.846c-0.281-0.014-0.549 0.025-0.817 0.144-1.218 0.542-1.662 2.708-2.163 3.942-1.207 2.972-7.090 4.619-11.755 5.216-0.887 0.114-1.749 0.74-2.428 1.466 0.82-0.284 2.126-0.297 2.74 0.144 0.007 0.488-0.376 1.062-0.625 1.37-0.404 0.5-0.398 0.793 0.12 0.793 0.473 0 0.752 0.007 1.635 0 0.393-0.003 0.618-0.16 1.49-1.49 3.592 0.718 5.986-0.264 5.986-0.264s0.407 1.755 1.418 1.755h1.49c0.633 0 0.667-0.331 0.625-0.433-0.448-1.082-0.68-1.873-0.769-2.5-0.263-1.857 0.657-3.836 2.524-5.457 0.585 0.986 2.253 0.845 2.909-0.096s0.446-2.268-0.192-3.221c-0.49-0.732-1.345-1.327-2.188-1.37zM8.221 4.663c-0.722-0.016-1.536 0.111-2.5 0.409-4.211 1.302-4.177 4.951-3.51 5.745 0 0-0.955 0.479-0.409 1.274 0.448 0.652 3.139 0.191 5.409-0.529s4.226-1.793 5.312-2.692c0.948-0.785 0.551-2.106-0.505-1.947-0.494-0.98-1.632-2.212-3.798-2.26zM18.846 5.962c0.325 0 0.577 0.252 0.577 0.577s-0.252 0.577-0.577 0.577c-0.325 0-0.577-0.252-0.577-0.577s0.252-0.577 0.577-0.577z';break;case 'rabbit':svg[0]='0 0 20 20';svg[1]='M10.817 0c-2.248 0-1.586 0.525-1.154 0.505 1.551-0.072 5.199 0.044 6.851 2.428 0 0-1.022-2.933-5.697-2.933zM10.529 0.769c-2.572 0-2.837 0.51-2.837 1.106 0 0.545 1.526 0.836 2.524 0.697 2.778-0.386 4.231-0.12 5.264 0.865-1.010 0.779-0.75 1.401-1.274 1.851-1.093 0.941-2.643-0.673-4.976-0.673-2.496 0-4.712 1.92-4.712 4.76-0.157-0.537-0.769-0.913-1.442-0.913-0.974 0-1.514 0.637-1.514 1.49 0 0.769 1.13 1.791 2.861 0.938 0.499 1.208 2.265 1.364 2.452 1.418 0.538 0.154 1.875 0.098 1.875 0.865 0 0.794-1.034 1.094-1.034 1.707 0 1.070 1.758 0.873 2.284 1.034 1.683 0.517 2.103 1.214 2.788 2.212 0.771 1.122 2.572 1.408 2.572 0.625 0-3.185-4.413-4.126-4.399-4.135 0.608-0.382 2.139-1.397 2.139-3.534 0-1.295-0.703-2.256-1.755-2.861 1.256 0.094 2.572 1.205 2.572 2.74 0 1.877-0.653 2.823-0.769 2.957 1.975-1.158 3.193-3.91 3.029-6.37 0.61 0.401 1.27 0.577 1.971 0.625 0.751 0.052 1.475-0.225 1.635-0.529 0.38-0.723 0.162-2.321-0.12-2.837-0.763-1.392-2.236-1.73-3.606-1.683-1.202-1.671-3.812-2.356-5.529-2.356zM1.37 3.077l-0.553 1.538h3.726c0.521-0.576 1.541-1.207 2.284-1.538h-5.457zM18.846 5.192c0.325 0 0.577 0.252 0.577 0.577s-0.252 0.577-0.577 0.577c-0.325 0-0.577-0.252-0.577-0.577s0.252-0.577 0.577-0.577zM0.553 5.385l-0.553 1.538h3.197c0.26-0.824 0.586-1.328 0.769-1.538h-3.413z';break;case 'ellipsis':svg[0]='0 0 20 20';svg[1]='M10.001 7.8c-1.215 0-2.201 0.985-2.201 2.2s0.986 2.2 2.201 2.2c1.215 0 2.199-0.985 2.199-2.2s-0.984-2.2-2.199-2.2zM3.001 7.8c-1.215 0-2.201 0.985-2.201 2.2s0.986 2.2 2.201 2.2c1.215 0 2.199-0.986 2.199-2.2s-0.984-2.2-2.199-2.2zM17.001 7.8c-1.215 0-2.201 0.985-2.201 2.2s0.986 2.2 2.201 2.2c1.215 0 2.199-0.985 2.199-2.2s-0.984-2.2-2.199-2.2z';break;case 'pipe':svg[0]='0 0 20 20';svg[1]='M10.15 0.179h0.623c0.069 0 0.127 0.114 0.127 0.253v19.494c0 0.139-0.057 0.253-0.127 0.253h-1.247c-0.069 0-0.126-0.114-0.126-0.253v-19.494c0-0.139 0.057-0.253 0.126-0.253h0.623z';break;case 'captions':svg[0]='0 0 20 20';svg[1]='M0.033 3.624h19.933v12.956h-19.933v-12.956zM18.098 10.045c-0.025-2.264-0.124-3.251-0.743-3.948-0.112-0.151-0.322-0.236-0.496-0.344-0.606-0.386-3.465-0.526-6.782-0.526s-6.313 0.14-6.907 0.526c-0.185 0.108-0.396 0.193-0.519 0.344-0.607 0.697-0.693 1.684-0.731 3.948 0.037 2.265 0.124 3.252 0.731 3.949 0.124 0.161 0.335 0.236 0.519 0.344 0.594 0.396 3.59 0.526 6.907 0.547 3.317-0.022 6.176-0.151 6.782-0.547 0.174-0.108 0.384-0.183 0.496-0.344 0.619-0.697 0.717-1.684 0.743-3.949v0 0zM9.689 9.281c-0.168-1.77-1.253-2.813-3.196-2.813-1.773 0-3.168 1.387-3.168 3.617 0 2.239 1.271 3.636 3.372 3.636 1.676 0 2.851-1.071 3.035-2.852h-2.003c-0.079 0.661-0.397 1.168-1.068 1.168-1.059 0-1.253-0.91-1.253-1.876 0-1.33 0.442-2.010 1.174-2.010 0.653 0 1.068 0.412 1.13 1.129h1.977zM16.607 9.281c-0.167-1.77-1.252-2.813-3.194-2.813-1.773 0-3.168 1.387-3.168 3.617 0 2.239 1.271 3.636 3.372 3.636 1.676 0 2.851-1.071 3.035-2.852h-2.003c-0.079 0.661-0.397 1.168-1.068 1.168-1.059 0-1.253-0.91-1.253-1.876 0-1.33 0.441-2.010 1.174-2.010 0.653 0 1.068 0.412 1.13 1.129h1.976z';break;case 'descriptions':svg[0]='0 0 20 20';svg[1]='M17.623 3.57h-1.555c1.754 1.736 2.763 4.106 2.763 6.572 0 2.191-0.788 4.286-2.189 5.943h1.484c1.247-1.704 1.945-3.792 1.945-5.943-0-2.418-0.886-4.754-2.447-6.572v0zM14.449 3.57h-1.55c1.749 1.736 2.757 4.106 2.757 6.572 0 2.191-0.788 4.286-2.187 5.943h1.476c1.258-1.704 1.951-3.792 1.951-5.943-0-2.418-0.884-4.754-2.447-6.572v0zM11.269 3.57h-1.542c1.752 1.736 2.752 4.106 2.752 6.572 0 2.191-0.791 4.286-2.181 5.943h1.473c1.258-1.704 1.945-3.792 1.945-5.943 0-2.418-0.876-4.754-2.447-6.572v0zM10.24 9.857c0 3.459-2.826 6.265-6.303 6.265v0.011h-3.867v-12.555h3.896c3.477 0 6.274 2.806 6.274 6.279v0zM6.944 9.857c0-1.842-1.492-3.338-3.349-3.338h-0.876v6.686h0.876c1.858 0 3.349-1.498 3.349-3.348v0z';break;case 'sign':svg[0]='0 0 20 20';svg[1]='M10.954 10.307c0.378 0.302 0.569 1.202 0.564 1.193 0.697 0.221 1.136 0.682 1.136 0.682 1.070-0.596 1.094-0.326 1.558-0.682 0.383-0.263 0.366-0.344 0.567-1.048 0.187-0.572-0.476-0.518-1.021-1.558-0.95 0.358-1.463 0.196-1.784 0.167-0.145-0.020-0.12 0.562-1.021 1.247zM14.409 17.196c-0.133 0.182-0.196 0.218-0.363 0.454-0.28 0.361 0.076 0.906 0.253 0.82 0.206-0.076 0.341-0.488 0.567-0.623 0.115-0.061 0.422-0.513 0.709-0.82 0.211-0.238 0.363-0.344 0.564-0.594 0.341-0.422 0.412-0.744 0.709-1.193 0.184-0.236 0.312-0.307 0.481-0.594 0.886-1.679 0.628-2.432 1.475-3.629 0.26-0.353 0.552-0.442 0.964-0.653 0.383-2.793-0.888-4.356-0.879-4.361-1.067 0.623-1.644 0.879-2.751 0.82-0.417-0.005-0.636-0.182-1.048-0.145-0.385 0.015-0.582 0.159-0.964 0.29-0.589 0.182-0.91 0.344-1.529 0.535-0.393 0.11-0.643 0.115-1.050 0.255-0.348 0.147-0.182 0.029-0.427 0.312-0.317 0.348-0.238 0.623-0.535 1.222-0.371 0.785-0.326 0.891-0.115 0.987-0.14 0.402-0.174 0.672-0.14 1.107 0.039 0.331-0.101 0.562 0.255 0.825 0.483 0.361 1.499 1.205 1.757 1.217 0.39-0.012 1.521 0.029 2.096-0.368 0.13-0.081 0.167-0.162 0.056 0.145-0.022 0.037-1.433 1.136-1.585 1.131-1.794 0.056-1.193 0.157-1.303 0.115-0.091 0-0.955-1.055-1.477-0.682-0.196 0.12-0.287 0.236-0.363 0.452 0.066 0.137 0.383 0.358 0.675 0.54 0.422 0.27 0.461 0.552 0.881 0.653 0.513 0.115 1.060 0.039 1.387 0.081 0.125 0.034 1.256-0.297 1.961-0.675 0.65-0.336-0.898 0.648-1.276 1.131-1.141 0.358-0.82 0.373-1.362 0.483-0.503 0.115-0.479 0.086-0.822 0.196-0.356 0.086-0.648 0.572-0.312 0.825 0.201 0.167 0.827-0.066 1.445-0.086 0.275-0.005 1.391-0.518 1.644-0.653 0.633-0.339 1.099-0.81 1.472-1.077 0.518-0.361-0.584 0.991-1.050 1.558zM8.855 9.799c-0.378-0.312-0.569-1.212-0.564-1.217-0.697-0.206-1.136-0.667-1.136-0.653-1.070 0.582-1.099 0.312-1.558 0.653-0.388 0.277-0.366 0.363-0.567 1.045-0.187 0.594 0.471 0.535 1.021 1.561 0.95-0.344 1.463-0.182 1.784-0.142 0.145 0.010 0.12-0.572 1.021-1.247zM5.4 2.911c0.133-0.191 0.196-0.228 0.368-0.454 0.27-0.371-0.081-0.915-0.253-0.849-0.211 0.096-0.346 0.508-0.599 0.653-0.093 0.052-0.4 0.503-0.682 0.82-0.211 0.228-0.363 0.334-0.564 0.599-0.346 0.407-0.412 0.729-0.709 1.161-0.184 0.258-0.317 0.324-0.481 0.621-0.886 1.669-0.631 2.422-1.475 3.6-0.26 0.38-0.552 0.461-0.964 0.682-0.383 2.788 0.883 4.346 0.879 4.336 1.068-0.609 1.639-0.861 2.751-0.825 0.417 0.025 0.636 0.201 1.048 0.174 0.385-0.025 0.582-0.169 0.964-0.285 0.589-0.196 0.91-0.358 1.499-0.54 0.422-0.12 0.672-0.125 1.080-0.285 0.348-0.128 0.182-0.010 0.427-0.282 0.312-0.358 0.238-0.633 0.508-1.217 0.398-0.8 0.353-0.906 0.142-0.991 0.135-0.412 0.174-0.677 0.14-1.107-0.044-0.336 0.101-0.572-0.255-0.82-0.483-0.375-1.499-1.22-1.752-1.222-0.395 0.002-1.526-0.039-2.101 0.339-0.13 0.101-0.167 0.182-0.056-0.11 0.022-0.052 1.433-1.148 1.585-1.163 1.794-0.039 1.193-0.14 1.303-0.088 0.091-0.007 0.955 1.045 1.477 0.682 0.191-0.13 0.287-0.245 0.368-0.452-0.071-0.147-0.388-0.368-0.68-0.537-0.422-0.282-0.464-0.564-0.881-0.655-0.513-0.125-1.065-0.049-1.387-0.11-0.125-0.015-1.256 0.317-1.956 0.68-0.66 0.351 0.893-0.631 1.276-1.136 1.136-0.339 0.81-0.353 1.36-0.479 0.501-0.101 0.476-0.071 0.82-0.172 0.351-0.096 0.648-0.577 0.312-0.849-0.206-0.152-0.827 0.081-1.44 0.086-0.28 0.020-1.396 0.533-1.649 0.677-0.633 0.329-1.099 0.8-1.472 1.048-0.523 0.38 0.584-0.967 1.050-1.529z';break;case 'mute':case 'volume-mute':svg[0]='0 0 20 20';svg[1]='M7.839 1.536c0.501-0.501 0.911-0.331 0.911 0.378v16.172c0 0.709-0.41 0.879-0.911 0.378l-4.714-4.713h-3.125v-7.5h3.125l4.714-4.714zM18.75 12.093v1.657h-1.657l-2.093-2.093-2.093 2.093h-1.657v-1.657l2.093-2.093-2.093-2.093v-1.657h1.657l2.093 2.093 2.093-2.093h1.657v1.657l-2.093 2.093z';break;case 'volume-soft':svg[0]='0 0 20 20';svg[1]='M10.723 14.473c-0.24 0-0.48-0.092-0.663-0.275-0.366-0.366-0.366-0.96 0-1.326 1.584-1.584 1.584-4.161 0-5.745-0.366-0.366-0.366-0.96 0-1.326s0.96-0.366 1.326 0c2.315 2.315 2.315 6.082 0 8.397-0.183 0.183-0.423 0.275-0.663 0.275zM7.839 1.536c0.501-0.501 0.911-0.331 0.911 0.378v16.172c0 0.709-0.41 0.879-0.911 0.378l-4.714-4.713h-3.125v-7.5h3.125l4.714-4.714z';break;case 'volume-medium':svg[0]='0 0 20 20';svg[1]='M14.053 16.241c-0.24 0-0.48-0.092-0.663-0.275-0.366-0.366-0.366-0.96 0-1.326 2.559-2.559 2.559-6.722 0-9.281-0.366-0.366-0.366-0.96 0-1.326s0.96-0.366 1.326 0c1.594 1.594 2.471 3.712 2.471 5.966s-0.878 4.373-2.471 5.966c-0.183 0.183-0.423 0.275-0.663 0.275zM10.723 14.473c-0.24 0-0.48-0.092-0.663-0.275-0.366-0.366-0.366-0.96 0-1.326 1.584-1.584 1.584-4.161 0-5.745-0.366-0.366-0.366-0.96 0-1.326s0.96-0.366 1.326 0c2.315 2.315 2.315 6.082 0 8.397-0.183 0.183-0.423 0.275-0.663 0.275zM7.839 1.536c0.501-0.501 0.911-0.331 0.911 0.378v16.172c0 0.709-0.41 0.879-0.911 0.378l-4.714-4.713h-3.125v-7.5h3.125l4.714-4.714z';break;case 'volume-loud':svg[0]='0 0 21 20';svg[1]='M17.384 18.009c-0.24 0-0.48-0.092-0.663-0.275-0.366-0.366-0.366-0.96 0-1.326 1.712-1.712 2.654-3.988 2.654-6.408s-0.943-4.696-2.654-6.408c-0.366-0.366-0.366-0.96 0-1.326s0.96-0.366 1.326 0c2.066 2.066 3.204 4.813 3.204 7.734s-1.138 5.668-3.204 7.734c-0.183 0.183-0.423 0.275-0.663 0.275zM14.053 16.241c-0.24 0-0.48-0.092-0.663-0.275-0.366-0.366-0.366-0.96 0-1.326 2.559-2.559 2.559-6.722 0-9.281-0.366-0.366-0.366-0.96 0-1.326s0.96-0.366 1.326 0c1.594 1.594 2.471 3.712 2.471 5.966s-0.878 4.373-2.471 5.966c-0.183 0.183-0.423 0.275-0.663 0.275zM10.723 14.473c-0.24 0-0.48-0.092-0.663-0.275-0.366-0.366-0.366-0.96 0-1.326 1.584-1.584 1.584-4.161 0-5.745-0.366-0.366-0.366-0.96 0-1.326s0.96-0.366 1.326 0c2.315 2.315 2.315 6.082 0 8.397-0.183 0.183-0.423 0.275-0.663 0.275zM7.839 1.536c0.501-0.501 0.911-0.331 0.911 0.378v16.172c0 0.709-0.41 0.879-0.911 0.378l-4.714-4.713h-3.125v-7.5h3.125l4.714-4.714z';break;case 'chapters':svg[0]='0 0 20 20';svg[1]='M5 2.5v17.5l6.25-6.25 6.25 6.25v-17.5zM15 0h-12.5v17.5l1.25-1.25v-15h11.25z';break;case 'transcript':svg[0]='0 0 20 20';svg[1]='M0 19.107v-17.857q0-0.446 0.313-0.759t0.759-0.313h8.929v6.071q0 0.446 0.313 0.759t0.759 0.313h6.071v11.786q0 0.446-0.313 0.759t-0.759 0.312h-15q-0.446 0-0.759-0.313t-0.313-0.759zM4.286 15.536q0 0.156 0.1 0.257t0.257 0.1h7.857q0.156 0 0.257-0.1t0.1-0.257v-0.714q0-0.156-0.1-0.257t-0.257-0.1h-7.857q-0.156 0-0.257 0.1t-0.1 0.257v0.714zM4.286 12.679q0 0.156 0.1 0.257t0.257 0.1h7.857q0.156 0 0.257-0.1t0.1-0.257v-0.714q0-0.156-0.1-0.257t-0.257-0.1h-7.857q-0.156 0-0.257 0.1t-0.1 0.257v0.714zM4.286 9.821q0 0.156 0.1 0.257t0.257 0.1h7.857q0.156 0 0.257-0.1t0.1-0.257v-0.714q0-0.156-0.1-0.257t-0.257-0.1h-7.857q-0.156 0-0.257 0.1t-0.1 0.257v0.714zM11.429 5.893v-5.268q0.246 0.156 0.402 0.313l4.554 4.554q0.156 0.156 0.313 0.402h-5.268z';break;case 'preferences':svg[0]='0 0 20 20';svg[1]='M18.238 11.919c-1.049-1.817-0.418-4.147 1.409-5.205l-1.965-3.404c-0.562 0.329-1.214 0.518-1.911 0.518-2.1 0-3.803-1.714-3.803-3.828h-3.931c0.005 0.653-0.158 1.314-0.507 1.919-1.049 1.818-3.382 2.436-5.212 1.382l-1.965 3.404c0.566 0.322 1.056 0.793 1.404 1.396 1.048 1.815 0.42 4.139-1.401 5.2l1.965 3.404c0.56-0.326 1.209-0.513 1.902-0.513 2.094 0 3.792 1.703 3.803 3.808h3.931c-0.002-0.646 0.162-1.3 0.507-1.899 1.048-1.815 3.375-2.433 5.203-1.387l1.965-3.404c-0.562-0.322-1.049-0.791-1.395-1.391zM10 14.049c-2.236 0-4.050-1.813-4.050-4.049s1.813-4.049 4.050-4.049 4.049 1.813 4.049 4.049c-0 2.237-1.813 4.049-4.049 4.049z';break;case 'close':svg[0]='0 0 16 20';svg[1]='M1.228 14.933q0-0.446 0.312-0.759l3.281-3.281-3.281-3.281q-0.313-0.313-0.313-0.759t0.313-0.759l1.518-1.518q0.313-0.313 0.759-0.313t0.759 0.313l3.281 3.281 3.281-3.281q0.313-0.313 0.759-0.313t0.759 0.313l1.518 1.518q0.313 0.313 0.313 0.759t-0.313 0.759l-3.281 3.281 3.281 3.281q0.313 0.313 0.313 0.759t-0.313 0.759l-1.518 1.518q-0.313 0.313-0.759 0.313t-0.759-0.313l-3.281-3.281-3.281 3.281q-0.313 0.313-0.759 0.313t-0.759-0.313l-1.518-1.518q-0.313-0.313-0.313-0.759z';break;case 'fullscreen-expand':svg[0]='0 0 20 20';svg[1]='M0 18.036v-5q0-0.29 0.212-0.502t0.502-0.212 0.502 0.212l1.607 1.607 3.705-3.705q0.112-0.112 0.257-0.112t0.257 0.112l1.272 1.272q0.112 0.112 0.112 0.257t-0.112 0.257l-3.705 3.705 1.607 1.607q0.212 0.212 0.212 0.502t-0.212 0.502-0.502 0.212h-5q-0.29 0-0.502-0.212t-0.212-0.502zM8.717 8.393q0-0.145 0.112-0.257l3.705-3.705-1.607-1.607q-0.212-0.212-0.212-0.502t0.212-0.502 0.502-0.212h5q0.29 0 0.502 0.212t0.212 0.502v5q0 0.29-0.212 0.502t-0.502 0.212-0.502-0.212l-1.607-1.607-3.705 3.705q-0.112 0.112-0.257 0.112t-0.257-0.112l-1.272-1.272q-0.112-0.112-0.112-0.257z';break;case 'fullscreen-collapse':svg[0]='0 0 20 20';svg[1]='M0.145 16.964q0-0.145 0.112-0.257l3.705-3.705-1.607-1.607q-0.212-0.212-0.212-0.502t0.212-0.502 0.502-0.212h5q0.29 0 0.502 0.212t0.212 0.502v5q0 0.29-0.212 0.502t-0.502 0.212-0.502-0.212l-1.607-1.607-3.705 3.705q-0.112 0.112-0.257 0.112t-0.257-0.112l-1.272-1.272q-0.112-0.112-0.112-0.257zM8.571 9.464v-5q0-0.29 0.212-0.502t0.502-0.212 0.502 0.212l1.607 1.607 3.705-3.705q0.112-0.112 0.257-0.112t0.257 0.112l1.272 1.272q0.112 0.112 0.112 0.257t-0.112 0.257l-3.705 3.705 1.607 1.607q0.212 0.212 0.212 0.502t-0.212 0.502-0.502 0.212h-5q-0.29 0-0.502-0.212t-0.212-0.502z';break;case 'help':svg[0]='0 0 11 20';svg[1]='M0.577 6.317q-0.028-0.167 0.061-0.313 1.786-2.969 5.179-2.969 0.893 0 1.797 0.346t1.629 0.926 1.183 1.423 0.458 1.769q0 0.603-0.173 1.127t-0.391 0.854-0.614 0.664-0.642 0.485-0.681 0.396q-0.458 0.257-0.765 0.725t-0.307 0.748q0 0.19-0.134 0.363t-0.313 0.173h-2.679q-0.167 0-0.285-0.206t-0.117-0.419v-0.502q0-0.926 0.725-1.747t1.596-1.211q0.658-0.301 0.938-0.625t0.279-0.848q0-0.469-0.519-0.826t-1.2-0.357q-0.725 0-1.205 0.324-0.391 0.279-1.194 1.283-0.145 0.179-0.346 0.179-0.134 0-0.279-0.089l-1.83-1.395q-0.145-0.112-0.173-0.279zM3.786 16.875v-2.679q0-0.179 0.134-0.313t0.313-0.134h2.679q0.179 0 0.313 0.134t0.134 0.313v2.679q0 0.179-0.134 0.313t-0.313 0.134h-2.679q-0.179 0-0.313-0.134t-0.134-0.313z';break}
return svg};AblePlayer.prototype.reinitialize=function(){var deferred,promise,thisObj,errorMsg,srcFile;deferred=new $.Deferred();promise=deferred.promise();thisObj=this;if(!window.console){this.debug=!1}
this.startedPlaying=!1;this.autoScrollTranscript=!0;this.$media=$(this.media).first();this.media=this.$media[0];if(this.$media.is('audio')){this.mediaType='audio'}else if(this.$media.is('video')){this.mediaType='video'}else{this.provideFallback();deferred.fail();return promise}
this.$sources=this.$media.find('source');this.player=this.getPlayer();if(!this.player){this.provideFallback()}
this.setIconType();this.setDimensions();deferred.resolve();return promise};AblePlayer.prototype.setDimensions=function(){if(this.$media.attr('width')&&this.$media.attr('height')){this.playerMaxWidth=parseInt(this.$media.attr('width'),10);this.playerMaxHeight=parseInt(this.$media.attr('height'),10)}else if(this.$media.attr('width')){this.playerMaxWidth=parseInt(this.$media.attr('width'),10)}else{this.playerMaxWidth=this.$media.parent().width();this.playerMaxHeight=this.getMatchingHeight(this.playerMaxWidth)}
this.$media.css({'width':'100%','height':'auto'})};AblePlayer.prototype.getMatchingHeight=function(width){var widths,heights,closestWidth,closestIndex,closestHeight,height;widths=[3840,2560,1920,1280,854,640,426];heights=[2160,1440,1080,720,480,360,240];closestWidth=null;closestIndex=null;$.each(widths,function(index){if(closestWidth==null||Math.abs(this-width)<Math.abs(closestWidth-width)){closestWidth=this;closestIndex=index}});closestHeight=heights[closestIndex];this.aspectRatio=closestWidth/closestHeight;height=Math.round(width/this.aspectRatio);return height};AblePlayer.prototype.setIconType=function(){var $tempButton,$testButton,controllerFont;if(this.forceIconType){return!1}
if(!!(document.createElementNS&&document.createElementNS('http://www.w3.org/2000/svg','svg').createSVGRect)){this.iconType='svg'}else{if(window.getComputedStyle){if($('span.icon-play').length){$testButton=$('span.icon-play')}else{$tempButton=$('<span>',{'class':'icon-play able-clipped'});$('body').append($tempButton);$testButton=$tempButton}
controllerFont=window.getComputedStyle($testButton.get(0),null).getPropertyValue('font-family');if(typeof controllerFont!=='undefined'){if(controllerFont.indexOf('able')!==-1){this.iconType='font'}else{this.iconType='image'}}else{this.iconType='image'}}else{this.iconType='image'}
if(this.debug){console.log('Using '+this.iconType+'s for player controls')}
if(typeof $tempButton!=='undefined'){$tempButton.remove()}}};AblePlayer.prototype.setupInstance=function(){var deferred=new $.Deferred();var promise=deferred.promise();if(this.$media.attr('id')){this.mediaId=this.$media.attr('id')}else{this.mediaId="ableMediaId_"+this.ableIndex;this.$media.attr('id',this.mediaId)}
deferred.resolve();return promise};AblePlayer.prototype.setupInstancePlaylist=function(){var thisObj=this;this.hasPlaylist=!1;$('.able-playlist').each(function(){if($(this).data('player')===thisObj.mediaId){thisObj.hasPlaylist=!0;thisObj.$playlist=$(this).find('li');var $youTubeVideos=$(this).find('li[data-youtube-id]');$youTubeVideos.each(function(){var youTubeId=$(this).attr('data-youtube-id');var youTubePoster=thisObj.getYouTubePosterUrl(youTubeId,'120');var $youTubeImg=$('<img>',{'src':youTubePoster,'alt':''});$(this).find('button').prepend($youTubeImg)});$(this).find('li span').attr('aria-hidden','true');thisObj.playlistIndex=0;var dataEmbedded=$(this).data('embedded');if(typeof dataEmbedded!=='undefined'&&dataEmbedded!==!1){thisObj.playlistEmbed=!0}else{thisObj.playlistEmbed=!1}}});if(this.hasPlaylist&&this.loop){this.media.removeAttribute('loop')}
if(this.hasPlaylist&&this.playlistEmbed){var parent=this.$playlist.parent();this.$playlistDom=parent.clone();parent.remove()}
if(this.hasPlaylist&&this.$sources.length===0){this.cuePlaylistItem(0);this.$sources=this.$media.find('source')}};AblePlayer.prototype.recreatePlayer=function(){var thisObj,prefsGroups,i;thisObj=this;if(!this.player){console.log("Can't create player; no appropriate player type detected.");return}
if(!this.playerCreated){this.loadCurrentPreferences();this.injectPlayerCode()}
this.initSignLanguage();this.initPlayer().then(function(){thisObj.setupTracks().then(function(){thisObj.setupAltCaptions().then(function(){thisObj.setupTranscript().then(function(){thisObj.getMediaTimes().then(function(mediaTimes){thisObj.duration=mediaTimes.duration;thisObj.elapsed=mediaTimes.elapsed;thisObj.setFullscreen(!1);if(typeof thisObj.volume==='undefined'){thisObj.volume=thisObj.defaultVolume}
if(thisObj.volume){thisObj.setVolume(thisObj.volume)}
if(thisObj.transcriptType){thisObj.addTranscriptAreaEvents();thisObj.updateTranscript()}
if(thisObj.mediaType==='video'){thisObj.initDescription()}
if(thisObj.captions.length){thisObj.initDefaultCaption()}
thisObj.setMediaAttributes();thisObj.addControls();thisObj.addEventListeners();prefsGroups=thisObj.getPreferencesGroups();for(i=0;i<prefsGroups.length;i++){thisObj.injectPrefsForm(prefsGroups[i])}
thisObj.setupPopups();thisObj.updateCaption();thisObj.injectVTS();if(thisObj.chaptersDivLocation){thisObj.populateChaptersDiv()}
thisObj.showSearchResults();if(thisObj.player==='html5'){thisObj.$media[0].load()}
setTimeout(function(){thisObj.refreshControls('init')},100)})},function(){thisObj.provideFallback()})})})})};AblePlayer.prototype.initPlayer=function(){var thisObj=this;var playerPromise;if(this.player==='html5'){playerPromise=this.initHtml5Player()}else if(this.player==='youtube'){playerPromise=this.initYouTubePlayer()}else if(this.player==='vimeo'){playerPromise=this.initVimeoPlayer()}
var deferred=new $.Deferred();var promise=deferred.promise();playerPromise.done(function(){if(thisObj.useFixedSeekInterval){if(!thisObj.seekInterval){thisObj.seekInterval=thisObj.defaultSeekInterval}else{}
thisObj.seekIntervalCalculated=!0}else{thisObj.setSeekInterval()}
deferred.resolve()}).fail(function(){deferred.reject()});return promise};AblePlayer.prototype.setSeekInterval=function(){var thisObj,duration;thisObj=this;this.seekInterval=this.defaultSeekInterval;if(this.useChapterTimes){duration=this.chapterDuration}else{duration=this.duration}
if(typeof duration==='undefined'||duration<1){this.seekIntervalCalculated=!1;return}else{if(duration<=20){this.seekInterval=5}else if(duration<=30){this.seekInterval=6}else if(duration<=40){this.seekInterval=8}else if(duration<=100){this.seekInterval=10}else{this.seekInterval=(duration/10)}
this.seekIntervalCalculated=!0}};AblePlayer.prototype.initDefaultCaption=function(){var captions,i;captions=this.captions;if(captions.length>0){for(i=0;i<captions.length;i++){if(captions[i].def===!0){this.captionLang=captions[i].language;this.selectedCaptions=captions[i]}}
if(typeof this.captionLang==='undefined'){for(i=0;i<captions.length;i++){if(captions[i].language===this.lang){this.captionLang=captions[i].language;this.selectedCaptions=captions[i]}}}
if(typeof this.captionLang==='undefined'){this.captionLang=captions[0].language;this.selectedCaptions=captions[0]}
if(typeof this.captionLang!=='undefined'){if(this.$transcriptLanguageSelect){this.$transcriptLanguageSelect.find('option[lang='+this.captionLang+']').prop('selected',!0)}
this.syncTrackLanguages('init',this.captionLang)}
if(this.player==='vimeo'){if(this.usingVimeoCaptions&&this.prefCaptions==1){this.vimeoPlayer.enableTextTrack(this.captionLang).then(function(track){}).catch(function(error){switch(error.name){case 'InvalidTrackLanguageError':console.log('No '+track.kind+' track is available in the specified language ('+track.label+')');break;case 'InvalidTrackError':console.log('No '+track.kind+' track is available in the specified language ('+track.label+')');break;default:console.log('Error loading '+track.label+' '+track.kind+' track');break}})}else{this.vimeoPlayer.disableTextTrack().then(function(){}).catch(function(error){console.log('Error disabling Vimeo text track: ',error)})}}}};AblePlayer.prototype.initHtml5Player=function(){var deferred=new $.Deferred();var promise=deferred.promise();deferred.resolve();return promise};AblePlayer.prototype.setMediaAttributes=function(){this.$media.attr('tabindex',-1);var textTracks=this.$media.get(0).textTracks;if(textTracks){var i=0;while(i<textTracks.length){textTracks[i].mode='disabled';i+=1}}};AblePlayer.prototype.getPlayer=function(){var i,sourceType,$newItem;if(this.youTubeId){if(this.mediaType!=='video'){return null}else{return'youtube'}}else if(this.vimeoId){if(this.mediaType!=='video'){return null}else{return'vimeo'}}else if(this.testFallback||((this.isUserAgent('msie 7')||this.isUserAgent('msie 8')||this.isUserAgent('msie 9'))&&this.mediaType==='video')||(this.isIOS()&&(this.isIOS(4)||this.isIOS(5)||this.isIOS(6)))){return null}else if(this.media.canPlayType){return'html5'}else{return null}}})(jQuery);(function($){AblePlayer.prototype.setCookie=function(cookieValue){Cookies.set('Able-Player',cookieValue,{expires:90})};AblePlayer.prototype.getCookie=function(){var defaultCookie={preferences:{},sign:{},transcript:{}};var cookie;try{cookie=Cookies.getJSON('Able-Player')}catch(err){Cookies.getJSON(defaultCookie);cookie=defaultCookie}
if(cookie){return cookie}else{return defaultCookie}};AblePlayer.prototype.updateCookie=function(setting){var cookie,$window,windowPos,available,i,prefName;cookie=this.getCookie();if(setting==='transcript'||setting==='sign'){if(setting==='transcript'){$window=this.$transcriptArea;windowPos=$window.position();if(typeof cookie.transcript==='undefined'){cookie.transcript={}}
cookie.transcript.position=$window.css('position');cookie.transcript.zindex=$window.css('z-index');cookie.transcript.top=windowPos.top;cookie.transcript.left=windowPos.left;cookie.transcript.width=$window.width();cookie.transcript.height=$window.height()}else if(setting==='sign'){$window=this.$signWindow;windowPos=$window.position();if(typeof cookie.sign==='undefined'){cookie.sign={}}
cookie.sign.position=$window.css('position');cookie.sign.zindex=$window.css('z-index');cookie.sign.top=windowPos.top;cookie.sign.left=windowPos.left;cookie.sign.width=$window.width();cookie.sign.height=$window.height()}}else{available=this.getAvailablePreferences();for(i=0;i<available.length;i++){prefName=available[i].name;if(prefName==setting){cookie.preferences[prefName]=this[prefName]}}}
this.setCookie(cookie)};AblePlayer.prototype.getPreferencesGroups=function(){if(this.mediaType==='video'){return['captions','descriptions','keyboard','transcript']}else if(this.mediaType==='audio'){var groups=[];groups.push('keyboard');if(this.lyricsMode){groups.push('transcript')}
return groups}}
AblePlayer.prototype.getAvailablePreferences=function(){var prefs=[];prefs.push({'name':'prefAltKey','label':this.tt.prefAltKey,'group':'keyboard','default':1});prefs.push({'name':'prefCtrlKey','label':this.tt.prefCtrlKey,'group':'keyboard','default':1});prefs.push({'name':'prefShiftKey','label':this.tt.prefShiftKey,'group':'keyboard','default':0});prefs.push({'name':'prefTranscript','label':null,'group':'transcript','default':0});prefs.push({'name':'prefHighlight','label':this.tt.prefHighlight,'group':'transcript','default':1});prefs.push({'name':'prefAutoScrollTranscript','label':null,'group':'transcript','default':1});prefs.push({'name':'prefTabbable','label':this.tt.prefTabbable,'group':'transcript','default':0});if(this.mediaType==='video'){prefs.push({'name':'prefCaptions','label':null,'group':'captions','default':1});prefs.push({'name':'prefCaptionsPosition','label':this.tt.prefCaptionsPosition,'group':'captions','default':this.defaultCaptionsPosition});prefs.push({'name':'prefCaptionsFont','label':this.tt.prefCaptionsFont,'group':'captions','default':'sans'});prefs.push({'name':'prefCaptionsSize','label':this.tt.prefCaptionsSize,'group':'captions','default':'100%'});prefs.push({'name':'prefCaptionsColor','label':this.tt.prefCaptionsColor,'group':'captions','default':'white'});prefs.push({'name':'prefCaptionsBGColor','label':this.tt.prefCaptionsBGColor,'group':'captions','default':'black'});prefs.push({'name':'prefCaptionsOpacity','label':this.tt.prefCaptionsOpacity,'group':'captions','default':'100%'});prefs.push({'name':'prefDesc','label':null,'group':'descriptions','default':0});prefs.push({'name':'prefDescFormat','label':null,'group':'descriptions','default':'video'});prefs.push({'name':'prefDescPause','label':this.tt.prefDescPause,'group':'descriptions','default':0});prefs.push({'name':'prefVisibleDesc','label':this.tt.prefVisibleDesc,'group':'descriptions','default':1});prefs.push({'name':'prefSign','label':null,'group':null,'default':0})}
return prefs};AblePlayer.prototype.loadCurrentPreferences=function(){var available=this.getAvailablePreferences();var cookie=this.getCookie();for(var ii=0;ii<available.length;ii++){var prefName=available[ii].name;var defaultValue=available[ii]['default'];if(cookie.preferences[prefName]!==undefined){this[prefName]=cookie.preferences[prefName]}else{cookie.preferences[prefName]=defaultValue;this[prefName]=defaultValue}}
this.setCookie(cookie)};AblePlayer.prototype.injectPrefsForm=function(form){var available,thisObj,$prefsDiv,formTitle,introText,$prefsIntro,$prefsIntroP2,p3Text,$prefsIntroP3,i,j,$fieldset,fieldsetClass,fieldsetId,$descFieldset,$descLegend,$legend,thisPref,$thisDiv,thisClass,thisId,$thisLabel,$thisField,$div1,id1,$radio1,$label1,$div2,id2,$radio2,$label2,options,$thisOption,optionValue,optionText,sampleCapsDiv,changedPref,changedSpan,changedText,currentDescState,$kbHeading,$kbList,kbLabels,keys,kbListText,$kbListItem,dialog,saveButton,cancelButton;thisObj=this;available=this.getAvailablePreferences();$prefsDiv=$('<div>',{'class':'able-prefs-form '});var customClass='able-prefs-form-'+form;$prefsDiv.addClass(customClass);if(form=='captions'){formTitle=this.tt.prefTitleCaptions;introText=this.tt.prefIntroCaptions;$prefsIntro=$('<p>',{text:introText});$prefsDiv.append($prefsIntro)}else if(form=='descriptions'){formTitle=this.tt.prefTitleDescriptions;var $prefsIntro=$('<p>',{text:this.tt.prefIntroDescription1});var $prefsIntroUL=$('<ul>');var $prefsIntroLI1=$('<li>',{text:this.tt.prefDescFormatOption1});var $prefsIntroLI2=$('<li>',{text:this.tt.prefDescFormatOption2});$prefsIntroUL.append($prefsIntroLI1,$prefsIntroLI2);if(this.hasOpenDesc&&this.hasClosedDesc){currentDescState=this.tt.prefIntroDescription2+' ';currentDescState+='<strong>'+this.tt.prefDescFormatOption1b+'</strong>';currentDescState+=' <em>'+this.tt.and+'</em> <strong>'+this.tt.prefDescFormatOption2b+'</strong>.'}else if(this.hasOpenDesc){currentDescState=this.tt.prefIntroDescription2;currentDescState+=' <strong>'+this.tt.prefDescFormatOption1b+'</strong>.'}else if(this.hasClosedDesc){currentDescState=this.tt.prefIntroDescription2;currentDescState+=' <strong>'+this.tt.prefDescFormatOption2b+'</strong>.'}else{currentDescState=this.tt.prefIntroDescriptionNone}
$prefsIntroP2=$('<p>',{html:currentDescState});p3Text=this.tt.prefIntroDescription3;if(this.hasOpenDesc||this.hasClosedDesc){p3Text+=' '+this.tt.prefIntroDescription4}
$prefsIntroP3=$('<p>',{text:p3Text});$prefsDiv.append($prefsIntro,$prefsIntroUL,$prefsIntroP2,$prefsIntroP3)}else if(form=='keyboard'){formTitle=this.tt.prefTitleKeyboard;introText=this.tt.prefIntroKeyboard1;introText+=' '+this.tt.prefIntroKeyboard2;introText+=' '+this.tt.prefIntroKeyboard3;$prefsIntro=$('<p>',{text:introText});$prefsDiv.append($prefsIntro)}else if(form=='transcript'){formTitle=this.tt.prefTitleTranscript;introText=this.tt.prefIntroTranscript;$prefsIntro=$('<p>',{text:introText});$prefsDiv.append($prefsIntro)}
$fieldset=$('<fieldset>');fieldsetClass='able-prefs-'+form;fieldsetId=this.mediaId+'-prefs-'+form;$fieldset.addClass(fieldsetClass).attr('id',fieldsetId);if(form==='keyboard'){$legend=$('<legend>'+this.tt.prefHeadingKeyboard1+'</legend>');$fieldset.append($legend)}else if(form==='descriptions'){$legend=$('<legend>'+this.tt.prefHeadingTextDescription+'</legend>');$fieldset.append($legend)}
for(i=0;i<available.length;i++){if((available[i].group==form)&&available[i].label){thisPref=available[i].name;thisClass='able-'+thisPref;thisId=this.mediaId+'_'+thisPref;$thisDiv=$('<div>').addClass(thisClass);if(form==='captions'){$thisLabel=$('<label for="'+thisId+'"> '+available[i].label+'</label>');$thisField=$('<select>',{name:thisPref,id:thisId,});if(thisPref!=='prefCaptions'&&thisPref!=='prefCaptionsStyle'){$thisField.change(function(){changedPref=$(this).attr('name');thisObj.stylizeCaptions(thisObj.$sampleCapsDiv,changedPref)})}
options=this.getCaptionsOptions(thisPref);for(j=0;j<options.length;j++){if(thisPref==='prefCaptionsPosition'){optionValue=options[j];if(optionValue==='overlay'){optionText=this.tt.captionsPositionOverlay}else if(optionValue==='below'){optionValue=options[j];optionText=this.tt.captionsPositionBelow}}else if(thisPref==='prefCaptionsFont'||thisPref==='prefCaptionsColor'||thisPref==='prefCaptionsBGColor'){optionValue=options[j][0];optionText=options[j][1]}else if(thisPref==='prefCaptionsOpacity'){optionValue=options[j];optionText=options[j];if(optionValue==='0%'){optionText+=' ('+this.tt.transparent+')'}else if(optionValue==='100%'){optionText+=' ('+this.tt.solid+')'}}else{optionValue=options[j];optionText=options[j]}
$thisOption=$('<option>',{value:optionValue,text:optionText});if(this[thisPref]===optionValue){$thisOption.prop('selected',!0)}
$thisField.append($thisOption)}
$thisDiv.append($thisLabel,$thisField)}else{$thisLabel=$('<label for="'+thisId+'"> '+available[i].label+'</label>');$thisField=$('<input>',{type:'checkbox',name:thisPref,id:thisId,value:'true'});if(this[thisPref]===1){$thisField.prop('checked',!0)}
if(form==='keyboard'){$thisField.change(function(){changedPref=$(this).attr('name');if(changedPref==='prefAltKey'){changedSpan='.able-modkey-alt';changedText=thisObj.tt.prefAltKey+' + '}else if(changedPref==='prefCtrlKey'){changedSpan='.able-modkey-ctrl';changedText=thisObj.tt.prefCtrlKey+' + '}else if(changedPref==='prefShiftKey'){changedSpan='.able-modkey-shift';changedText=thisObj.tt.prefShiftKey+' + '}
if($(this).is(':checked')){$(changedSpan).text(changedText)}else{$(changedSpan).text('')}})}
$thisDiv.append($thisField,$thisLabel)}
$fieldset.append($thisDiv)}}
$prefsDiv.append($fieldset);if(form==='captions'){if(this.mediaType==='video'){this.$sampleCapsDiv=$('<div>',{'class':'able-captions-sample'}).text(this.tt.sampleCaptionText);$prefsDiv.append(this.$sampleCapsDiv);this.stylizeCaptions(this.$sampleCapsDiv)}}else if(form==='keyboard'){$kbHeading=$('<h2>',{text:this.tt.prefHeadingKeyboard2});$kbList=$('<ul>');kbLabels=[];keys=[];for(i=0;i<this.controls.length;i++){if(this.controls[i]==='play'){kbLabels.push(this.tt.play+'/'+this.tt.pause);keys.push('p</span> <em>'+this.tt.or+'</em> <span class="able-help-modifiers"> '+this.tt.spacebar)}else if(this.controls[i]==='restart'){kbLabels.push(this.tt.restart);keys.push('s')}else if(this.controls[i]==='previous'){kbLabels.push(this.tt.prevTrack);keys.push('b')}else if(this.controls[i]==='next'){kbLabels.push(this.tt.nextTrack);keys.push('n')}else if(this.controls[i]==='rewind'){kbLabels.push(this.tt.rewind);keys.push('r')}else if(this.controls[i]==='forward'){kbLabels.push(this.tt.forward);keys.push('f')}else if(this.controls[i]==='volume'){kbLabels.push(this.tt.volume);keys.push('v</span> <em>'+this.tt.or+'</em> <span class="able-modkey">1-9');kbLabels.push(this.tt.mute+'/'+this.tt.unmute);keys.push('m')}else if(this.controls[i]==='captions'){if(this.captions.length>1){kbLabels.push(this.tt.captions)}else{if(this.captionsOn){kbLabels.push(this.tt.hideCaptions)}else{kbLabels.push(this.tt.showCaptions)}}
keys.push('c')}else if(this.controls[i]==='descriptions'){if(this.descOn){kbLabels.push(this.tt.turnOffDescriptions)}else{kbLabels.push(this.tt.turnOnDescriptions)}
keys.push('d')}else if(this.controls[i]==='prefs'){kbLabels.push(this.tt.preferences);keys.push('e')}else if(this.controls[i]==='help'){kbLabels.push(this.tt.help);keys.push('h')}}
for(i=0;i<keys.length;i++){kbListText='<span class="able-modkey-alt">';if(this.prefAltKey===1){kbListText+=this.tt.prefAltKey+' + '}
kbListText+='</span>';kbListText+='<span class="able-modkey-ctrl">';if(this.prefCtrlKey===1){kbListText+=this.tt.prefCtrlKey+' + '}
kbListText+='</span>';kbListText+='<span class="able-modkey-shift">';if(this.prefShiftKey===1){kbListText+=this.tt.prefShiftKey+' + '}
kbListText+='</span>';kbListText+='<span class="able-modkey">'+keys[i]+'</span>';kbListText+=' = '+kbLabels[i];$kbListItem=$('<li>',{html:kbListText});$kbList.append($kbListItem)}
kbListText='<span class="able-modkey">'+this.tt.escapeKey+'</span>';kbListText+=' = '+this.tt.escapeKeyFunction;$kbListItem=$('<li>',{html:kbListText});$kbList.append($kbListItem);$prefsDiv.append($kbHeading,$kbList)}
$('body').append($prefsDiv);dialog=new AccessibleDialog($prefsDiv,this.$prefsButton,'dialog',formTitle,$prefsIntro,thisObj.tt.closeButtonLabel,'32em');$prefsDiv.append('<hr>');saveButton=$('<button class="modal-button">'+this.tt.save+'</button>');cancelButton=$('<button class="modal-button">'+this.tt.cancel+'</button>');saveButton.click(function(){dialog.hide();thisObj.savePrefsFromForm()});cancelButton.click(function(){dialog.hide();thisObj.resetPrefsForm()});$prefsDiv.append(saveButton);$prefsDiv.append(cancelButton);if(form==='captions'){this.captionPrefsDialog=dialog}else if(form==='descriptions'){this.descPrefsDialog=dialog}else if(form==='keyboard'){this.keyboardPrefsDialog=dialog}else if(form==='transcript'){this.transcriptPrefsDialog=dialog}
$('div.able-prefs-form button.modalCloseButton').click(function(){thisObj.resetPrefsForm()})
$('div.able-prefs-form').keydown(function(e){if(e.which===27){thisObj.resetPrefsForm()}})};AblePlayer.prototype.resetPrefsForm=function(){var thisObj,cookie,available,i,prefName,prefId,thisDiv,thisId;thisObj=this;cookie=this.getCookie();available=this.getAvailablePreferences();for(i=0;i<available.length;i++){prefName=available[i].name;prefId=this.mediaId+'_'+prefName;if((prefName.indexOf('Captions')!==-1)&&(prefName!=='prefCaptions')){$('select[name="'+prefName+'"]').val(cookie.preferences[prefName])}else{if(this[prefName]===1){$('input[name="'+prefName+'"]').prop('checked',!0)}else{$('input[name="'+prefName+'"]').prop('checked',!1)}}}
this.stylizeCaptions(this.$sampleCapsDiv)};AblePlayer.prototype.savePrefsFromForm=function(){var cookie,available,prefName,prefId,numChanges,numCapChanges,capSizeChanged,capSizeValue,newValue;numChanges=0;numCapChanges=0;capSizeChanged=!1;cookie=this.getCookie();available=this.getAvailablePreferences();for(var i=0;i<available.length;i++){if(available[i].label){prefName=available[i].name;prefId=this.mediaId+'_'+prefName;if(prefName=='prefDescFormat'){this.prefDescFormat='video';if(this.prefDescFormat!==cookie.preferences.prefDescFormat){cookie.preferences.prefDescFormat=this.prefDescFormat;numChanges++}}else if((prefName.indexOf('Captions')!==-1)&&(prefName!=='prefCaptions')){newValue=$('select[id="'+prefId+'"]').val();if(cookie.preferences[prefName]!==newValue){cookie.preferences[prefName]=newValue;this[prefName]=newValue;numChanges++;numCapChanges++}
if(prefName==='prefCaptionsSize'){capSizeChanged=!0;capSizeValue=newValue}}else{if($('input[id="'+prefId+'"]').is(':checked')){cookie.preferences[prefName]=1;if(this[prefName]===1){}else{this[prefName]=1;numChanges++}}else{cookie.preferences[prefName]=0;if(this[prefName]===1){this[prefName]=0;numChanges++}else{}}}}}
if(numChanges>0){this.setCookie(cookie);this.showAlert(this.tt.prefSuccess)}else{this.showAlert(this.tt.prefNoChange)}
if(this.player==='youtube'&&(typeof this.usingYouTubeCaptions!=='undefined'&&this.usingYouTubeCaptions)&&capSizeChanged){this.youTubePlayer.setOption(this.ytCaptionModule,'fontSize',this.translatePrefs('size',capSizeValue,'youtube'))}
if(AblePlayerInstances.length>1){for(var i=0;i<AblePlayerInstances.length;i++){AblePlayerInstances[i].updatePrefs();AblePlayerInstances[i].loadCurrentPreferences();AblePlayerInstances[i].resetPrefsForm();if(numCapChanges>0){AblePlayerInstances[i].stylizeCaptions(AblePlayerInstances[i].$captionsDiv);if(typeof AblePlayerInstances[i].$descDiv!=='undefined'){AblePlayerInstances[i].stylizeCaptions(AblePlayerInstances[i].$descDiv)}}}}else{this.updatePrefs();if(numCapChanges>0){this.stylizeCaptions(this.$captionsDiv);if(typeof this.$descDiv!=='undefined'){this.stylizeCaptions(this.$descDiv)}}}}
AblePlayer.prototype.updatePrefs=function(){if(this.prefTabbable===1){this.$transcriptDiv.find('span.able-transcript-seekpoint').attr('tabindex','0')}else{this.$transcriptDiv.find('span.able-transcript-seekpoint').removeAttr('tabindex')}
if(this.prefHighlight===0){this.$transcriptDiv.find('span').removeClass('able-highlight')}
this.updateCaption();this.refreshingDesc=!0;this.initDescription()};AblePlayer.prototype.usingModifierKeys=function(e){if((this.prefAltKey===1)&&!e.altKey){return!1}
if((this.prefCtrlKey===1)&&!e.ctrlKey){return!1}
if((this.prefShiftKey===1)&&!e.shiftKey){return!1}
return!0}})(jQuery);(function($){AblePlayer.prototype.parseWebVTT=function(srcFile,text){text=text.replace(/(\r\n|\n|\r)/g,'\n');var parserState={src:srcFile,text:text,error:null,metadata:{},cues:[],line:1,column:1};try{act(parserState,parseFileBody)}catch(err){var errString='Invalid WebVTT file: '+parserState.src+'\n';errString+='Line: '+parserState.line+', ';errString+='Column: '+parserState.column+'\n';errString+=err;if(console.warn){console.warn(errString)}else if(console.log){console.log(errString)}}
return parserState}
function actList(state,list){var results=[];for(var ii=0;ii<list.length;ii++){results.push(act(state,list[ii]))}
return results}
function act(state,action){var val=action(state);if(state.error!==null){throw state.error}
return val}
function updatePosition(state,cutText){for(var ii=0;ii<cutText.length;ii++){if(cutText[ii]==='\n'){state.column=1;state.line+=1}else{state.column+=1}}}
function cut(state,length){var returnText=state.text.substring(0,length);updatePosition(state,returnText);state.text=state.text.substring(length);return returnText}
function cutLine(state,length){var nextEOL=state.text.indexOf('\n');var returnText;if(nextEOL===-1){returnText=state.text;updatePosition(state,returnText);state.text=''}else{returnText=state.text.substring(0,nextEOL);updatePosition(state,returnText+'\n');state.text=state.text.substring(nextEOL+1)}
return returnText}
function peekLine(state){var nextEOL=state.text.indexOf('\n');if(nextEOL===-1){return state.text}else{return state.text.substring(0,nextEOL)}}
function parseFileBody(state){actList(state,[eatOptionalBOM,eatSignature]);var c=state.text[0];if(c===' '||c==='\t'||c==='\n'){actList(state,[eatUntilEOLInclusive,parseMetadataHeaders,eatAtLeast1EmptyLines,parseCuesAndComments])}else{state.error="WEBVTT signature not followed by whitespace."}}
function parseMetadataHeaders(state){while(!0){var nextLine=peekLine(state);if(nextLine.indexOf('-->')!==-1){return}else if(nextLine.length===0){return}else{var keyValue=act(state,getMetadataKeyValue);state.metadata[keyValue[0]]=keyValue[1];act(state,eatUntilEOLInclusive)}}}
function nextSpaceOrNewline(s){var possible=[];var spaceIndex=s.indexOf(' ');if(spaceIndex>=0){possible.push(spaceIndex)}
var tabIndex=s.indexOf('\t');if(tabIndex>=0){possible.push(tabIndex)}
var lineIndex=s.indexOf('\n');if(lineIndex>=0){possible.push(lineIndex)}
return Math.min.apply(null,possible)}
function getMetadataKeyValue(state){var next=state.text.indexOf('\n');var pair=cut(state,next);var colon=pair.indexOf(':');if(colon===-1){state.error='Missing colon.';return}else{var pairName=pair.substring(0,colon);var pairValue=pair.substring(colon+1);return[pairName,pairValue]}}
function getSettingsKeyValue(state){var next=nextSpaceOrNewline(state.text);var pair=cut(state,next);var colon=pair.indexOf(':');if(colon===-1){state.error='Missing colon.';return}else{var pairName=pair.substring(0,colon);var pairValue=pair.substring(colon+1);return[pairName,pairValue]}}
function parseCuesAndComments(state){while(!0){var nextLine=peekLine(state);if(nextLine.indexOf('NOTE')===0&&((nextLine.length===4)||(nextLine[4]===' ')||(nextLine[4]==='\t'))){actList(state,[eatComment,eatEmptyLines])}else if($.trim(nextLine).length===0&&state.text.length>0){act(state,eatEmptyLines)}else if($.trim(nextLine).length>0){act(state,parseCue)}else{return}}}
function parseCue(state){var nextLine=peekLine(state);var cueId;var errString;if(nextLine.indexOf('-->')===-1){cueId=cutLine(state);nextLine=peekLine(state);if(nextLine.indexOf('-->')===-1){errString='Invalid WebVTT file: '+state.src+'\n';errString+='Line: '+state.line+', ';errString+='Column: '+state.column+'\n';errString+='Expected cue timing for cueId \''+cueId+'\' but found: '+nextLine+'\n';if(console.warn){console.warn(errString)}else if(console.log){console.log(errString)}
return}}
var cueTimings=actList(state,[getTiming,eatAtLeast1SpacesOrTabs,eatArrow,eatAtLeast1SpacesOrTabs,getTiming]);var startTime=cueTimings[0];var endTime=cueTimings[4];if(startTime>=endTime){state.error='Start time is not sooner than end time.';return}
act(state,eatSpacesOrTabs);var cueSettings=act(state,getCueSettings);cut(state,1);var components=act(state,getCuePayload);if(typeof cueId==='undefined'){cueId=state.cues.length+1}
state.cues.push({id:cueId,start:startTime,end:endTime,settings:cueSettings,components:components})}
function getCueSettings(state){var cueSettings={};while(state.text.length>0&&state.text[0]!=='\n'){var keyValue=act(state,getSettingsKeyValue);cueSettings[keyValue[0]]=keyValue[1];act(state,eatSpacesOrTabs)}
return cueSettings}
function getCuePayload(state){var result={type:'internal',tagName:'',value:'',classes:[],annotation:'',parent:null,children:[],language:''};var current=result;var languageStack=[];while(state.text.length>0){var nextLine=peekLine(state);if(nextLine.indexOf('-->')!==-1||/^\s*$/.test(nextLine)){break}
if(state.text.length>=2&&state.text[0]==='\n'&&state.text[1]==='\n'){cut(state,2);break}
var token=getCueToken(state);if(token.type==='string'){current.children.push(token)}else if(token.type==='startTag'){token.type=token.tagName;token.parent=current;if($.inArray(token.tagName,['i','b','u','ruby'])!==-1){if(languageStack.length>0){current.language=languageStack[languageStack.length-1]}
current.children.push(token);current=token}else if(token.tagName==='rt'&&current.tagName==='ruby'){if(languageStack.length>0){current.language=languageStack[languageStack.length-1]}
current.children.push(token);current=token}else if(token.tagName==='c'){token.value=token.annotation;if(languageStack.length>0){current.language=languageStack[languageStack.length-1]}
current.children.push(token);current=token}else if(token.tagName==='v'){token.value=token.annotation;if(languageStack.length>0){current.language=languageStack[languageStack.length-1]}
current.children.push(token);current=token}else if(token.tagName==='lang'){languageStack.push(token.annotation);if(languageStack.length>0){current.language=languageStack[languageStack.length-1]}
current.children.push(token);current=token}}else if(token.type==='endTag'){if(token.tagName===current.type&&$.inArray(token.tagName,['c','i','b','u','ruby','rt','v'])!==-1){current=current.parent}else if(token.tagName==='lang'&&current.type==='lang'){current=current.parent;languageStack.pop()}else if(token.tagName==='ruby'&&current.type==='rt'){current=current.parent.parent}}else if(token.type==='timestampTag'){var tempState={text:token.value,error:null,metadata:{},cues:[],line:1,column:1};try{var timing=act(tempState,getTiming);if(tempState.text.length===0){token.value=timing;current.push(token)}}catch(err){}}}
return result}
function getCueToken(state){var tokenState='data';var result=[];var buffer='';var token={type:'',tagName:'',value:'',classes:[],annotation:'',children:[]}
while(!0){var c;if(state.text.length>=2&&state.text[0]==='\n'&&state.text[1]==='\n'){c='\u0004'}else if(state.text.length>0){c=state.text[0]}else{c='\u0004'}
if(tokenState==='data'){if(c==='&'){buffer='&';tokenState='escape'}else if(c==='<'){if(result.length===0){tokenState='tag'}else{token.type='string';token.value=result.join('');return token}}else if(c==='\u0004'){return{type:'string',value:result.join('')}}else{result.push(c)}}else if(tokenState==='escape'){if(c==='&'){result.push(buffer);buffer='&'}else if(c.match(/[0-9a-z]/)){buffer+=c}else if(c===';'){if(buffer==='&amp'){result.push('&')}else if(buffer==='&lt'){result.push('<')}else if(buffer==='&gt'){result.push('>')}else if(buffer==='&lrm'){result.push('\u200e')}else if(buffer==='&rlm'){result.push('\u200f')}else if(buffer==='&nbsp'){result.push('\u00a0')}else{result.push(buffer);result.push(';')}
tokenState='data'}else if(c==='<'||c==='\u0004'){result.push(buffer);token.type='string';token.value=result.join('');return token}else if(c==='\t'||c==='\n'||c==='\u000c'||c===' '){result.push(buffer);token.type='string';token.value=result.join('');return token}else{result.push(buffer);tokenState='data'}}else if(tokenState==='tag'){if(c==='\t'||c==='\n'||c==='\u000c'||c===' '){tokenState='startTagAnnotation'}else if(c==='.'){tokenState='startTagClass'}else if(c==='/'){tokenState='endTag'}else if(c.match('[0-9]')){tokenState='timestampTag';result.push(c)}else if(c==='>'){cut(state,1);break}else if(c==='\u0004'){token.tagName='';token.type='startTag';return token}else{result.push(c);tokenState='startTag'}}else if(tokenState==='startTag'){if(c==='\t'||c==='\u000c'||c===' '){tokenState='startTagAnnotation'}else if(c==='\n'){buffer=c;tokenState='startTagAnnotation'}else if(c==='.'){tokenState='startTagClass'}else if(c==='>'){cut(state,1);token.tagName=result.join('');token.type='startTag';return token}else if(c==='\u0004'){token.tagName=result.join('');token.type='startTag';return token}else{result.push(c)}}else if(tokenState==='startTagClass'){if(c==='\t'||c==='\u000c'||c===' '){token.classes.push(buffer);buffer='';tokenState='startTagAnnotation'}else if(c==='\n'){token.classes.push(buffer);buffer=c;tokenState='startTagAnnotation'}else if(c==='.'){token.classes.push(buffer);buffer=""}else if(c==='>'){cut(state,1);token.classes.push(buffer);token.type='startTag';token.tagName=result.join('');return token}else if(c==='\u0004'){token.classes.push(buffer);token.type='startTag';token.tagName=result.join('');return token}else{buffer+='c'}}else if(tokenState==='startTagAnnotation'){if(c==='>'){cut(state,1);buffer=$.trim(buffer).replace(/ +/,' ');token.type='startTag';token.tagName=result.join('');token.annotation=buffer;return token}else if(c==='\u0004'){buffer=$.trim(buffer).replace(/ +/,' ');token.type='startTag';token.tagName=result.join('');token.annotation=buffer;return token}else{buffer+=c}}else if(tokenState==='endTag'){if(c==='>'){cut(state,1);token.type='endTag';token.tagName=result.join('');return token}else if(c==='\u0004'){token.type='endTag';token.tagName=result.join('');return token}else{result.push(c)}}else if(tokenState==='timestampTag'){if(c==='>'){cut(state,1);token.type='timestampTag';token.name=result.join('');return token}else if(c==='\u0004'){token.type='timestampTag';token.name=result.join('');return token}else{result.push(c)}}else{throw 'Unknown tokenState '+tokenState}
cut(state,1)}}
function eatComment(state){var noteLine=cutLine(state);if(noteLine.indexOf('-->')!==-1){state.error='Invalid syntax: --> in NOTE line.';return}
while(!0){var nextLine=peekLine(state);if($.trim(nextLine).length===0){return}else if(nextLine.indexOf('-->')!==-1){state.error='Invalid syntax: --> in comment.';return}else{cutLine(state)}}}
function eatOptionalBOM(state){if(state.text[0]==='\ufeff'){cut(state,1)}}
function eatSignature(state){if(state.text.substring(0,6)==='WEBVTT'){cut(state,6)}else{state.error='Invalid signature.'}}
function eatArrow(state){if(state.text.length<3||state.text.substring(0,3)!=='-->'){state.error='Missing -->'}else{cut(state,3)}}
function eatSingleSpaceOrTab(state){if(state.text[0]==='\t'||state.text[0]===' '){cut(state,1)}else{state.error='Missing space.'}}
function eatSpacesOrTabs(state){while(state.text[0]==='\t'||state.text[0]===' '){cut(state,1)}}
function eatAtLeast1SpacesOrTabs(state){var numEaten=0;while(state.text[0]==='\t'||state.text[0]===' '){cut(state,1);numEaten+=1}
if(numEaten===0){state.error='Missing space.'}}
function eatUntilEOLInclusive(state){var nextEOL=state.text.indexOf('\n');if(nextEOL===-1){state.error='Missing EOL.'}else{cut(state,nextEOL+1)}}
function eatEmptyLines(state){while(state.text.length>0){var nextLine=peekLine(state);if($.trim(nextLine).length===0){cutLine(state)}else{break}}}
function eatAtLeast1EmptyLines(state){var linesEaten=0;while(state.text.length>0){var nextLine=peekLine(state);if($.trim(nextLine).length===0){cutLine(state);linesEaten+=1}else{break}}
if(linesEaten===0){state.error='Missing empty line.'}}
function getTiming(state){var nextSpace=nextSpaceOrNewline(state.text);if(nextSpace===-1){state.error('Missing timing.');return}
var timestamp=cut(state,nextSpace);var results=/((\d\d):)?((\d\d):)(\d\d).(\d\d\d)|(\d+).(\d\d\d)/.exec(timestamp);if(!results){state.error='Unable to parse timestamp';return}
var time=0;var hours=results[2];var minutes=results[4];if(minutes){if(parseInt(minutes,10)>59){state.error='Invalid minute range';return}
if(hours){time+=3600*parseInt(hours,10)}
time+=60*parseInt(minutes,10);var seconds=results[5];if(parseInt(seconds,10)>59){state.error='Invalid second range';return}
time+=parseInt(seconds,10);time+=parseInt(results[6],10)/1000}else{time+=parseInt(results[7],10);time+=parseInt(results[8],10)/1000}
return time}})(jQuery);(function($){AblePlayer.prototype.injectPlayerCode=function(){var thisObj,vidcapContainer,prefsGroups,i;thisObj=this;this.$mediaContainer=this.$media.wrap('<div class="able-media-container"></div>').parent();this.$ableDiv=this.$mediaContainer.wrap('<div class="able"></div>').parent();this.$ableWrapper=this.$ableDiv.wrap('<div class="able-wrapper"></div>').parent();this.$ableWrapper.addClass('able-skin-'+this.skin);this.$ableWrapper.css({'max-width':this.playerMaxWidth+'px'});this.injectOffscreenHeading();if(this.mediaType==='video'){if(this.iconType!='image'&&(this.player!=='youtube'||this.hasPoster)){this.injectBigPlayButton()}
vidcapContainer=$('<div>',{'class':'able-vidcap-container'});this.$vidcapContainer=this.$mediaContainer.wrap(vidcapContainer).parent()}
this.injectPlayerControlArea();this.injectTextDescriptionArea();this.injectAlert();this.injectPlaylist()};AblePlayer.prototype.injectOffscreenHeading=function(){var headingType;if(this.playerHeadingLevel=='0'){}else{if(typeof this.playerHeadingLevel==='undefined'){this.playerHeadingLevel=this.getNextHeadingLevel(this.$ableDiv)}
headingType='h'+this.playerHeadingLevel.toString();this.$headingDiv=$('<'+headingType+'>');this.$ableDiv.prepend(this.$headingDiv);this.$headingDiv.addClass('able-offscreen');this.$headingDiv.text(this.tt.playerHeading)}};AblePlayer.prototype.injectBigPlayButton=function(){this.$bigPlayButton=$('<button>',{'class':'able-big-play-button icon-play','aria-hidden':!0,'tabindex':-1});var thisObj=this;this.$bigPlayButton.click(function(){thisObj.handlePlay()});this.$mediaContainer.append(this.$bigPlayButton)};AblePlayer.prototype.injectPlayerControlArea=function(){this.$playerDiv=$('<div>',{'class':'able-player','role':'region','aria-label':this.mediaType+' player'});this.$playerDiv.addClass('able-'+this.mediaType);this.$nowPlayingDiv=$('<div>',{'class':'able-now-playing','aria-live':'assertive','aria-atomic':'true'});this.$controllerDiv=$('<div>',{'class':'able-controller'});this.$controllerDiv.addClass('able-'+this.iconColor+'-controls');this.$statusBarDiv=$('<div>',{'class':'able-status-bar'});this.$timer=$('<span>',{'class':'able-timer'});this.$elapsedTimeContainer=$('<span>',{'class':'able-elapsedTime',text:'0:00'});this.$durationContainer=$('<span>',{'class':'able-duration'});this.$timer.append(this.$elapsedTimeContainer).append(this.$durationContainer);this.$speed=$('<span>',{'class':'able-speed','aria-live':'assertive'}).text(this.tt.speed+': 1x');this.$status=$('<span>',{'class':'able-status','aria-live':'polite'});this.$statusBarDiv.append(this.$timer,this.$speed,this.$status);this.$playerDiv.append(this.$nowPlayingDiv,this.$controllerDiv,this.$statusBarDiv);this.$ableDiv.append(this.$playerDiv)};AblePlayer.prototype.injectTextDescriptionArea=function(){this.$descDiv=$('<div>',{'class':'able-descriptions'});if(this.exposeTextDescriptions){this.$descDiv.attr({'aria-live':'assertive','aria-atomic':'true'})}
this.$descDiv.hide();this.$ableDiv.append(this.$descDiv)};AblePlayer.prototype.getDefaultWidth=function(which){if(which==='transcript'){return 450}else if(which==='sign'){return 400}};AblePlayer.prototype.positionDraggableWindow=function(which,width){var cookie,cookiePos,$window,dragged,windowPos,currentWindowPos,firstTime,zIndex;cookie=this.getCookie();if(which==='transcript'){$window=this.$transcriptArea;if(typeof cookie.transcript!=='undefined'){cookiePos=cookie.transcript}}else if(which==='sign'){$window=this.$signWindow;if(typeof cookie.transcript!=='undefined'){cookiePos=cookie.sign}}
if(typeof cookiePos!=='undefined'&&!($.isEmptyObject(cookiePos))){$window.css({'position':cookiePos.position,'width':cookiePos.width,'z-index':cookiePos.zindex});if(cookiePos.position==='absolute'){$window.css({'top':cookiePos.top,'left':cookiePos.left})}
this.updateZIndex(which)}else{windowPos=this.getOptimumPosition(which,width);if(typeof width==='undefined'){width=this.getDefaultWidth(which)}
$window.css({'position':windowPos[0],'width':width,'z-index':windowPos[3]});if(windowPos[0]==='absolute'){$window.css({'top':windowPos[1]+'px','left':windowPos[2]+'px',})}}};AblePlayer.prototype.getOptimumPosition=function(targetWindow,targetWidth){var gap,position,ableWidth,ableHeight,ableOffset,ableTop,ableLeft,windowWidth,otherWindowWidth,zIndex;if(typeof targetWidth==='undefined'){targetWidth=this.getDefaultWidth(targetWindow)}
gap=5;position=[];ableWidth=this.$ableDiv.width();ableHeight=this.$ableDiv.height();ableOffset=this.$ableDiv.offset();ableTop=ableOffset.top;ableLeft=ableOffset.left;windowWidth=$(window).width();otherWindowWidth=0;if(targetWindow==='transcript'){if(typeof this.$signWindow!=='undefined'){if(this.$signWindow.is(':visible')){otherWindowWidth=this.$signWindow.width()+gap}}}else if(targetWindow==='sign'){if(typeof this.$transcriptArea!=='undefined'){if(this.$transcriptArea.is(':visible')){otherWindowWidth=this.$transcriptArea.width()+gap}}}
if(targetWidth<(windowWidth-(ableLeft+ableWidth+gap+otherWindowWidth))){position[0]='absolute';position[1]=0;position[2]=ableWidth+otherWindowWidth+gap}else if(targetWidth+gap<ableLeft){position[0]='absolute';position[1]=0;position[2]=ableLeft-targetWidth-gap}else{position[0]='relative'}
return position};AblePlayer.prototype.injectPoster=function($element,context){var poster,width,height;if(context==='youtube'){if(typeof this.ytWidth!=='undefined'){width=this.ytWidth;height=this.ytHeight}else if(typeof this.playerMaxWidth!=='undefined'){width=this.playerMaxWidth;height=this.playerMaxHeight}else if(typeof this.playerWidth!=='undefined'){width=this.playerWidth;height=this.playerHeight}}else if(context==='fallback'){width='100%';height='auto'}
if(this.hasPoster){poster=this.$media.attr('poster');this.$posterImg=$('<img>',{'class':'able-poster','src':poster,'alt':"",'role':"presentation",'width':width,'height':height});$element.append(this.$posterImg)}};AblePlayer.prototype.injectAlert=function(){var top;this.$alertBox=$('<div role="alert"></div>');this.$alertBox.addClass('able-alert');this.$alertBox.hide();this.$alertBox.appendTo(this.$ableDiv);if(this.mediaType=='audio'){top='-10'}else{top=Math.round(this.$mediaContainer.height()/3)*2}
this.$alertBox.css({top:top+'px'});this.$srAlertBox=$('<div role="alert"></div>');this.$srAlertBox.addClass('able-screenreader-alert');this.$srAlertBox.appendTo(this.$ableDiv)};AblePlayer.prototype.injectPlaylist=function(){if(this.playlistEmbed===!0){var playlistClone=this.$playlistDom.clone();playlistClone.insertBefore(this.$statusBarDiv);this.$playlist=playlistClone.find('li')}};AblePlayer.prototype.createPopup=function(which,tracks){var thisObj,$menu,prefCats,i,$menuItem,prefCat,whichPref,hasDefault,track,windowOptions,whichPref,whichMenu,$thisItem,$prevItem,$nextItem;thisObj=this;$menu=$('<ul>',{'id':this.mediaId+'-'+which+'-menu','class':'able-popup','role':'menu'}).hide();if(which==='captions'){$menu.addClass('able-popup-captions')}
if(which==='prefs'){if(this.prefCats.length>1){for(i=0;i<this.prefCats.length;i++){$menuItem=$('<li></li>',{'role':'menuitem','tabindex':'-1'});prefCat=this.prefCats[i];if(prefCat==='captions'){$menuItem.text(this.tt.prefMenuCaptions)}else if(prefCat==='descriptions'){$menuItem.text(this.tt.prefMenuDescriptions)}else if(prefCat==='keyboard'){$menuItem.text(this.tt.prefMenuKeyboard)}else if(prefCat==='transcript'){$menuItem.text(this.tt.prefMenuTranscript)}
$menuItem.on('click',function(){whichPref=$(this).text();thisObj.showingPrefsDialog=!0;thisObj.setFullscreen(!1);if(whichPref===thisObj.tt.prefMenuCaptions){thisObj.captionPrefsDialog.show()}else if(whichPref===thisObj.tt.prefMenuDescriptions){thisObj.descPrefsDialog.show()}else if(whichPref===thisObj.tt.prefMenuKeyboard){thisObj.keyboardPrefsDialog.show()}else if(whichPref===thisObj.tt.prefMenuTranscript){thisObj.transcriptPrefsDialog.show()}
thisObj.closePopups();thisObj.showingPrefsDialog=!1});$menu.append($menuItem)}
this.$prefsButton.attr('data-prefs-popup','menu')}else if(this.prefCats.length==1){this.$prefsButton.attr('data-prefs-popup',this.prefCats[0])}}else if(which==='captions'||which==='chapters'){hasDefault=!1;for(i=0;i<tracks.length;i++){track=tracks[i];$menuItem=$('<li></li>',{'role':'menuitemradio','tabindex':'-1','lang':track.language});if(track.def&&this.prefCaptions==1){$menuItem.attr('aria-checked','true');hasDefault=!0}else{$menuItem.attr('aria-checked','false')}
if(which=='captions'){$menuItem.text(track.label);$menuItem.on('click',this.getCaptionClickFunction(track))}else if(which=='chapters'){$menuItem.text(this.flattenCueForCaption(track)+' - '+this.formatSecondsAsColonTime(track.start));$menuItem.on('click',this.getChapterClickFunction(track.start))}
$menu.append($menuItem)}
if(which==='captions'){$menuItem=$('<li></li>',{'role':'menuitemradio','tabindex':'-1',}).text(this.tt.captionsOff);if(this.prefCaptions===0){$menuItem.attr('aria-checked','true');hasDefault=!0}
$menuItem.on('click',this.getCaptionOffFunction());$menu.append($menuItem)}}else if(which==='transcript-window'||which==='sign-window'){windowOptions=[];windowOptions.push({'name':'move','label':this.tt.windowMove});windowOptions.push({'name':'resize','label':this.tt.windowResize});windowOptions.push({'name':'close','label':this.tt.windowClose});for(i=0;i<windowOptions.length;i++){$menuItem=$('<li></li>',{'role':'menuitem','tabindex':'-1','data-choice':windowOptions[i].name});$menuItem.text(windowOptions[i].label);$menuItem.on('click mousedown',function(e){e.stopPropagation();if(typeof e.button!=='undefined'&&e.button!==0){return!1}
if(!thisObj.windowMenuClickRegistered&&!thisObj.finishingDrag){thisObj.windowMenuClickRegistered=!0;thisObj.handleMenuChoice(which.substr(0,which.indexOf('-')),$(this).attr('data-choice'),e)}});$menu.append($menuItem)}}
if(which==='captions'&&!hasDefault){if($menu.find('li[lang='+this.captionLang+']')){$menu.find('li[lang='+this.captionLang+']').attr('aria-checked','true')}else{$menu.find('li').last().attr('aria-checked','true')}}else if(which==='chapters'){if($menu.find('li:contains("'+this.defaultChapter+'")')){$menu.find('li:contains("'+this.defaultChapter+'")').attr('aria-checked','true').addClass('able-focus')}else{$menu.find('li').first().attr('aria-checked','true').addClass('able-focus')}}
$menu.on('keydown',function(e){whichMenu=$(this).attr('id').split('-')[1];$thisItem=$(this).find('li:focus');if($thisItem.is(':first-child')){$prevItem=$(this).find('li').last();$nextItem=$thisItem.next()}else if($thisItem.is(':last-child')){$prevItem=$thisItem.prev();$nextItem=$(this).find('li').first()}else{$prevItem=$thisItem.prev();$nextItem=$thisItem.next()}
if(e.which===9){if(e.shiftKey){$thisItem.removeClass('able-focus');$prevItem.focus().addClass('able-focus')}else{$thisItem.removeClass('able-focus');$nextItem.focus().addClass('able-focus')}}else if(e.which===40||e.which===39){$thisItem.removeClass('able-focus');$nextItem.focus().addClass('able-focus')}else if(e.which==38||e.which===37){$thisItem.removeClass('able-focus');$prevItem.focus().addClass('able-focus')}else if(e.which===32||e.which===13){$thisItem.click()}else if(e.which===27){$thisItem.removeClass('able-focus');thisObj.closePopups()}
e.preventDefault()});this.$controllerDiv.append($menu);return $menu};AblePlayer.prototype.closePopups=function(){var thisObj=this;if(this.chaptersPopup&&this.chaptersPopup.is(':visible')){this.chaptersPopup.hide();this.$chaptersButton.removeAttr('aria-expanded').focus()}
if(this.captionsPopup&&this.captionsPopup.is(':visible')){this.captionsPopup.hide();this.$ccButton.removeAttr('aria-expanded').focus()}
if(this.prefsPopup&&this.prefsPopup.is(':visible')&&!this.hidingPopup){this.hidingPopup=!0;this.prefsPopup.hide();this.prefsPopup.find('li').removeClass('able-focus').attr('tabindex','-1');this.$prefsButton.removeAttr('aria-expanded');if(!this.showingPrefsDialog){this.$prefsButton.focus()}
setTimeout(function(){thisObj.hidingPopup=!1},100)}
if(this.$volumeSlider&&this.$volumeSlider.is(':visible')){this.$volumeSlider.hide().attr('aria-hidden','true');this.$volumeAlert.text(this.tt.volumeSliderClosed);this.$volumeButton.removeAttr('aria-expanded').focus()}
if(this.$transcriptPopup&&this.$transcriptPopup.is(':visible')){this.$transcriptPopup.hide();this.$transcriptPopup.find('li').removeClass('able-focus').attr('tabindex','-1');this.$transcriptPopupButton.removeAttr('aria-expanded').focus()}
if(this.$signPopup&&this.$signPopup.is(':visible')){this.$signPopup.hide();this.$signPopup.find('li').removeClass('able-focus').attr('tabindex','-1');this.$signPopupButton.removeAttr('aria-expanded').focus()}};AblePlayer.prototype.setupPopups=function(which){var popups,thisObj,hasDefault,i,j,tracks,track,$trackButton,$trackLabel,radioName,radioId,$menu,$menuItem,prefCats,prefCat,prefLabel;popups=[];if(typeof which==='undefined'){popups.push('prefs')}
if(which==='captions'||(typeof which==='undefined')){if(this.captions.length>0){popups.push('captions')}}
if(which==='chapters'||(typeof which==='undefined')){if(this.chapters.length>0&&this.useChaptersButton){popups.push('chapters')}}
if(which==='transcript-window'&&this.transcriptType==='popup'){popups.push('transcript-window')}
if(which==='sign-window'&&this.hasSignLanguage){popups.push('sign-window')}
if(popups.length>0){thisObj=this;for(var i=0;i<popups.length;i++){var popup=popups[i];hasDefault=!1;if(popup=='prefs'){this.prefsPopup=this.createPopup('prefs')}else if(popup=='captions'){if(typeof this.captionsPopup==='undefined'||!this.captionsPopup){this.captionsPopup=this.createPopup('captions',this.captions)}}else if(popup=='chapters'){if(this.selectedChapters){tracks=this.selectedChapters.cues}else if(this.chapters.length>=1){tracks=this.chapters[0].cues}else{tracks=[]}
if(typeof this.chaptersPopup==='undefined'||!this.chaptersPopup){this.chaptersPopup=this.createPopup('chapters',tracks)}}else if(popup=='transcript-window'){return this.createPopup('transcript-window')}else if(popup=='sign-window'){return this.createPopup('sign-window')}}}};AblePlayer.prototype.provideFallback=function(){var $fallbackDiv,width,mediaClone,fallback,fallbackText,showBrowserList,browsers,i,b,browserList;showBrowserList=!1;$fallbackDiv=$('<div>',{'class':'able-fallback','role':'alert',});if(typeof this.playerMaxWidth!=='undefined'){width=this.playerMaxWidth+'px'}else if(this.$media.attr('width')){width=parseInt(this.$media.attr('width'),10)+'px'}else{width='100%'}
$fallbackDiv.css('max-width',width);mediaClone=this.$media.clone();$('source, track',mediaClone).remove();fallback=mediaClone.html().trim();if(fallback.length){$fallbackDiv.html(fallback)}else{fallbackText=this.tt.fallbackError1+' '+this.tt[this.mediaType]+'. ';fallbackText+=this.tt.fallbackError2+':';fallback=$('<p>').text(fallbackText);$fallbackDiv.html(fallback);showBrowserList=!0}
if(showBrowserList){browserList=$('<ul>');browsers=this.getSupportingBrowsers();for(i=0;i<browsers.length;i++){b=$('<li>');b.text(browsers[i].name+' '+browsers[i].minVersion+' '+this.tt.orHigher);browserList.append(b)}
$fallbackDiv.append(browserList)}
this.injectPoster($fallbackDiv,'fallback');if(typeof this.$ableWrapper!=='undefined'){this.$ableWrapper.before($fallbackDiv);this.$ableWrapper.remove()}else if(typeof this.$media!=='undefined'){this.$media.before($fallbackDiv);this.$media.remove()}else{$('body').prepend($fallbackDiv)}};AblePlayer.prototype.getSupportingBrowsers=function(){var browsers=[];browsers[0]={name:'Chrome',minVersion:'31'};browsers[1]={name:'Firefox',minVersion:'34'};browsers[2]={name:'Internet Explorer',minVersion:'10'};browsers[3]={name:'Opera',minVersion:'26'};browsers[4]={name:'Safari for Mac OS X',minVersion:'7.1'};browsers[5]={name:'Safari for iOS',minVersion:'7.1'};browsers[6]={name:'Android Browser',minVersion:'4.1'};browsers[7]={name:'Chrome for Android',minVersion:'40'};return browsers}
AblePlayer.prototype.calculateControlLayout=function(){var controlLayout,volumeSupported,playbackSupported,totalButtonWidth,numA11yButtons;controlLayout=[];controlLayout[0]=[];controlLayout[1]=[];if(this.skin==='legacy'){controlLayout[2]=[];controlLayout[3]=[]}
controlLayout[0].push('play');controlLayout[0].push('restart');controlLayout[0].push('rewind');controlLayout[0].push('forward');if(this.skin==='legacy'){controlLayout[1].push('seek')}
if(this.hasPlaylist){if(this.skin==='legacy'){controlLayout[0].push('previous');controlLayout[0].push('next')}else if(this.skin=='2020'){controlLayout[0].push('previous');controlLayout[0].push('next')}}
if(this.isPlaybackRateSupported()){playbackSupported=!0;if(this.skin==='legacy'){controlLayout[2].push('slower');controlLayout[2].push('faster')}}else{playbackSupported=!1}
if(this.mediaType==='video'){numA11yButtons=0;if(this.hasCaptions){numA11yButtons++;if(this.skin==='legacy'){controlLayout[2].push('captions')}else if(this.skin=='2020'){controlLayout[1].push('captions')}}
if(this.hasSignLanguage){numA11yButtons++;if(this.skin==='legacy'){controlLayout[2].push('sign')}else if(this.skin=='2020'){controlLayout[1].push('sign')}}
if((this.hasOpenDesc||this.hasClosedDesc)&&(this.useDescriptionsButton)){numA11yButtons++;if(this.skin==='legacy'){controlLayout[2].push('descriptions')}else if(this.skin=='2020'){controlLayout[1].push('descriptions')}}}
if(this.transcriptType==='popup'&&!(this.hideTranscriptButton)){numA11yButtons++;if(this.skin==='legacy'){controlLayout[2].push('transcript')}else if(this.skin=='2020'){controlLayout[1].push('transcript')}}
if(this.mediaType==='video'&&this.hasChapters&&this.useChaptersButton){numA11yButtons++;if(this.skin==='legacy'){controlLayout[2].push('chapters')}else if(this.skin=='2020'){controlLayout[1].push('chapters')}}
if(this.skin=='2020'&&numA11yButtons>0){controlLayout[1].push('pipe')}
if(playbackSupported&&this.skin==='2020'){controlLayout[1].push('faster');controlLayout[1].push('slower');controlLayout[1].push('pipe')}
if(this.skin==='legacy'){controlLayout[3].push('preferences')}else if(this.skin=='2020'){controlLayout[1].push('preferences')}
if(this.mediaType==='video'&&this.allowFullScreen){if(this.skin==='legacy'){controlLayout[3].push('fullscreen')}else{controlLayout[1].push('fullscreen')}}
if(this.browserSupportsVolume()){volumeSupported=!0;this.volumeButton='volume-'+this.getVolumeName(this.volume);if(this.skin==='legacy'){controlLayout[1].push('volume')}else if(this.skin=='2020'){controlLayout[1].push('volume')}}else{volumeSupported=!1;this.volume=!1}
return controlLayout};AblePlayer.prototype.addControls=function(){var thisObj,baseSliderWidth,controlLayout,numSections,i,j,k,controls,$controllerSpan,$sliderDiv,sliderLabel,$pipe,$pipeImg,svgData,svgPath,control,$buttonLabel,$buttonImg,buttonImgSrc,buttonTitle,$newButton,iconClass,buttonIcon,buttonUse,buttonText,position,buttonHeight,buttonWidth,buttonSide,controllerWidth,tooltipId,tooltipY,tooltipX,tooltipWidth,tooltipStyle,tooltip,captionLabel,popupMenuId;thisObj=this;baseSliderWidth=100;controlLayout=this.calculateControlLayout();numSections=controlLayout.length;tooltipId=this.mediaId+'-tooltip';this.$tooltipDiv=$('<div>',{'id':tooltipId,'class':'able-tooltip'}).hide();this.$controllerDiv.append(this.$tooltipDiv);if(this.skin=='2020'){$sliderDiv=$('<div class="able-seekbar"></div>');sliderLabel=this.mediaType+' '+this.tt.seekbarLabel;this.$controllerDiv.append($sliderDiv);this.seekBar=new AccessibleSlider(this.mediaType,$sliderDiv,'horizontal',baseSliderWidth,0,this.duration,this.seekInterval,sliderLabel,'seekbar',!0,'visible')}
for(i=0;i<numSections;i++){controls=controlLayout[i];if((i%2)===0){$controllerSpan=$('<div>',{'class':'able-left-controls'})}else{$controllerSpan=$('<div>',{'class':'able-right-controls'})}
this.$controllerDiv.append($controllerSpan);for(j=0;j<controls.length;j++){control=controls[j];if(control==='seek'){$sliderDiv=$('<div class="able-seekbar"></div>');sliderLabel=this.mediaType+' '+this.tt.seekbarLabel;$controllerSpan.append($sliderDiv);if(typeof this.duration==='undefined'||this.duration===0){this.duration=60;this.elapsed=0}
this.seekBar=new AccessibleSlider(this.mediaType,$sliderDiv,'horizontal',baseSliderWidth,0,this.duration,this.seekInterval,sliderLabel,'seekbar',!0,'visible')}else if(control==='pipe'){$pipe=$('<span>',{'tabindex':'-1','aria-hidden':'true'});if(this.iconType==='font'){$pipe.addClass('icon-pipe')}else{$pipeImg=$('<img>',{src:this.rootPath+'button-icons/'+this.iconColor+'/pipe.png',alt:'',role:'presentation'});$pipe.append($pipeImg)}
$controllerSpan.append($pipe)}else{if(control==='volume'){buttonImgSrc=this.rootPath+'button-icons/'+this.iconColor+'/'+this.volumeButton+'.png'}else if(control==='fullscreen'){buttonImgSrc=this.rootPath+'button-icons/'+this.iconColor+'/fullscreen-expand.png'}else if(control==='slower'){if(this.speedIcons==='animals'){buttonImgSrc=this.rootPath+'button-icons/'+this.iconColor+'/turtle.png'}else{buttonImgSrc=this.rootPath+'button-icons/'+this.iconColor+'/slower.png'}}else if(control==='faster'){if(this.speedIcons==='animals'){buttonImgSrc=this.rootPath+'button-icons/'+this.iconColor+'/rabbit.png'}else{buttonImgSrc=this.rootPath+'button-icons/'+this.iconColor+'/faster.png'}}else{buttonImgSrc=this.rootPath+'button-icons/'+this.iconColor+'/'+control+'.png'}
buttonTitle=this.getButtonTitle(control);$newButton=$('<div>',{'role':'button','tabindex':'0','aria-label':buttonTitle,'class':'able-button-handler-'+control});if(control==='volume'||control==='preferences'){if(control=='preferences'){this.prefCats=this.getPreferencesGroups();if(this.prefCats.length>1){popupMenuId=this.mediaId+'-prefs-menu';$newButton.attr({'aria-controls':popupMenuId,'aria-haspopup':'menu'})}else if(this.prefCats.length===1){$newButton.attr({'aria-haspopup':'dialog'})}}else if(control==='volume'){popupMenuId=this.mediaId+'-volume-slider';$newButton.attr({'aria-controls':popupMenuId,'aria-expanded':'false'})}}
if(this.iconType==='font'){if(control==='volume'){iconClass='icon-'+this.volumeButton}else if(control==='slower'){if(this.speedIcons==='animals'){iconClass='icon-turtle'}else{iconClass='icon-slower'}}else if(control==='faster'){if(this.speedIcons==='animals'){iconClass='icon-rabbit'}else{iconClass='icon-faster'}}else{iconClass='icon-'+control}
buttonIcon=$('<span>',{'class':iconClass,'aria-hidden':'true'});$newButton.append(buttonIcon)}else if(this.iconType==='svg'){var svgData;if(control==='volume'){svgData=this.getSvgData(this.volumeButton)}else if(control==='fullscreen'){svgData=this.getSvgData('fullscreen-expand')}else if(control==='slower'){if(this.speedIcons==='animals'){svgData=this.getSvgData('turtle')}else{svgData=this.getSvgData('slower')}}else if(control==='faster'){if(this.speedIcons==='animals'){svgData=this.getSvgData('rabbit')}else{svgData=this.getSvgData('faster')}}else{svgData=this.getSvgData(control)}
buttonIcon=$('<svg>',{'focusable':'false','aria-hidden':'true','viewBox':svgData[0]});svgPath=$('<path>',{'d':svgData[1]});buttonIcon.append(svgPath);$newButton.html(buttonIcon);$newButton.html($newButton.html())}else{$buttonImg=$('<img>',{'src':buttonImgSrc,'alt':'','role':'presentation'});$newButton.append($buttonImg)}
var $buttonLabel=$('<span>',{'class':'able-clipped'}).text(buttonTitle);$newButton.append($buttonLabel);$newButton.on('mouseenter focus',function(e){var buttonText=$(this).attr('aria-label');var position=$(this).position();var buttonHeight=$(this).height();var buttonWidth=$(this).width();var controllerWidth=thisObj.$controllerDiv.width();position.right=controllerWidth-position.left-buttonWidth;var tooltipY=position.top-buttonHeight-15;if($(this).parent().hasClass('able-right-controls')){var buttonSide='right'}else{var buttonSide='left'}
var tooltipWidth=AblePlayer.localGetElementById($newButton[0],tooltipId).text(buttonText).width();if(buttonSide=='left'){var tooltipX=position.left-tooltipWidth/2;if(tooltipX<0){tooltipX=2}
var tooltipStyle={left:tooltipX+'px',right:'',top:tooltipY+'px'}}else{var tooltipX=position.right-tooltipWidth/2;if(tooltipX<0){tooltipX=2}
var tooltipStyle={left:'',right:tooltipX+'px',top:tooltipY+'px'}}
var tooltip=AblePlayer.localGetElementById($newButton[0],tooltipId).text(buttonText).css(tooltipStyle);thisObj.showTooltip(tooltip);$(this).on('mouseleave blur',function(){AblePlayer.localGetElementById($newButton[0],tooltipId).text('').hide()})});if(control==='captions'){if(!this.prefCaptions||this.prefCaptions!==1){if(this.captions.length>1){captionLabel=this.tt.captions}else{captionLabel=this.tt.showCaptions}
$newButton.addClass('buttonOff').attr('title',captionLabel)}}else if(control==='descriptions'){if(!this.prefDesc||this.prefDesc!==1){$newButton.addClass('buttonOff').attr('title',this.tt.turnOnDescriptions)}}
$controllerSpan.append($newButton);if(control==='play'){this.$playpauseButton=$newButton}else if(control=='previous'){this.$prevButton=$newButton;if(this.buttonWithFocus=='previous'){this.$prevButton.focus();this.buttonWithFocus=null}}else if(control=='next'){this.$nextButton=$newButton;if(this.buttonWithFocus=='next'){this.$nextButton.focus();this.buttonWithFocus=null}}else if(control==='captions'){this.$ccButton=$newButton}else if(control==='sign'){this.$signButton=$newButton;if(!(this.$signWindow.is(':visible'))){this.$signButton.addClass('buttonOff')}}else if(control==='descriptions'){this.$descButton=$newButton}else if(control==='mute'){this.$muteButton=$newButton}else if(control==='transcript'){this.$transcriptButton=$newButton;if(!(this.$transcriptDiv.is(':visible'))){this.$transcriptButton.addClass('buttonOff').attr('title',this.tt.showTranscript)}}else if(control==='fullscreen'){this.$fullscreenButton=$newButton}else if(control==='chapters'){this.$chaptersButton=$newButton}else if(control==='preferences'){this.$prefsButton=$newButton}else if(control==='volume'){this.$volumeButton=$newButton}}
if(control==='volume'){this.addVolumeSlider($controllerSpan)}}
if((i%2)==1){this.$controllerDiv.append('<div style="clear:both;"></div>')}}
if(this.mediaType==='video'){if(typeof this.$captionsDiv!=='undefined'){this.stylizeCaptions(this.$captionsDiv)}
if(typeof this.$descDiv!=='undefined'){this.stylizeCaptions(this.$descDiv)}}
this.controls=[];for(var sec in controlLayout)if(controlLayout.hasOwnProperty(sec)){this.controls=this.controls.concat(controlLayout[sec])}
this.refreshControls('init')};AblePlayer.prototype.useSvg=function(){var cache=Object.create(null);var checkUseElems,tid;var debouncedCheck=function(){clearTimeout(tid);tid=setTimeout(checkUseElems,100)};var unobserveChanges=function(){return};var observeChanges=function(){var observer;window.addEventListener('resize',debouncedCheck,!1);window.addEventListener('orientationchange',debouncedCheck,!1);if(window.MutationObserver){observer=new MutationObserver(debouncedCheck);observer.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0});unobserveChanges=function(){try{observer.disconnect();window.removeEventListener('resize',debouncedCheck,!1);window.removeEventListener('orientationchange',debouncedCheck,!1)}catch(ignore){}}}else{document.documentElement.addEventListener('DOMSubtreeModified',debouncedCheck,!1);unobserveChanges=function(){document.documentElement.removeEventListener('DOMSubtreeModified',debouncedCheck,!1);window.removeEventListener('resize',debouncedCheck,!1);window.removeEventListener('orientationchange',debouncedCheck,!1)}}};var xlinkNS='http://www.w3.org/1999/xlink';checkUseElems=function(){var base,bcr,fallback='',hash,i,Request,inProgressCount=0,isHidden,url,uses,xhr;if(window.XMLHttpRequest){Request=new XMLHttpRequest();if(Request.withCredentials!==undefined){Request=XMLHttpRequest}else{Request=XDomainRequest||undefined}}
if(Request===undefined){return}
function observeIfDone(){inProgressCount-=1;if(inProgressCount===0){observeChanges()}}
function attrUpdateFunc(spec){return function(){if(cache[spec.base]!==!0){spec.useEl.setAttributeNS(xlinkNS,'xlink:href','#'+spec.hash)}}}
function onloadFunc(xhr){return function(){var body=document.body;var x=document.createElement('x');var svg;xhr.onload=null;x.innerHTML=xhr.responseText;svg=x.getElementsByTagName('svg')[0];if(svg){svg.setAttribute('aria-hidden','true');svg.style.position='absolute';svg.style.width=0;svg.style.height=0;svg.style.overflow='hidden';body.insertBefore(svg,body.firstChild)}
observeIfDone()}}
function onErrorTimeout(xhr){return function(){xhr.onerror=null;xhr.ontimeout=null;observeIfDone()}}
unobserveChanges();uses=document.getElementsByTagName('use');for(i=0;i<uses.length;i+=1){try{bcr=uses[i].getBoundingClientRect()}catch(ignore){bcr=!1}
url=uses[i].getAttributeNS(xlinkNS,'href').split('#');base=url[0];hash=url[1];isHidden=bcr&&bcr.left===0&&bcr.right===0&&bcr.top===0&&bcr.bottom===0;if(bcr&&bcr.width===0&&bcr.height===0&&!isHidden){if(fallback&&!base.length&&hash&&!document.getElementById(hash)){base=fallback}
if(base.length){xhr=cache[base];if(xhr!==!0){setTimeout(attrUpdateFunc({useEl:uses[i],base:base,hash:hash}),0)}
if(xhr===undefined){xhr=new Request();cache[base]=xhr;xhr.onload=onloadFunc(xhr);xhr.onerror=onErrorTimeout(xhr);xhr.ontimeout=onErrorTimeout(xhr);xhr.open('GET',base);xhr.send();inProgressCount+=1}}}else{if(!isHidden){if(cache[base]===undefined){cache[base]=!0}else if(cache[base].onload){cache[base].abort();cache[base].onload=undefined;cache[base]=!0}}}}
uses='';inProgressCount+=1;observeIfDone()}};AblePlayer.prototype.cuePlaylistItem=function(sourceIndex){var $newItem,prevPlayer,newPlayer,itemTitle,itemLang,sources,s,i,$newSource,nowPlayingSpan;var thisObj=this;prevPlayer=this.player;if(this.initializing){}else{if(this.playerCreated){this.deletePlayer()}}
$newItem=this.$playlist.eq(sourceIndex);if(this.hasAttr($newItem,'data-youtube-id')){this.youTubeId=$newItem.attr('data-youtube-id');newPlayer='youtube'}else{newPlayer='html5'}
if(newPlayer==='youtube'){if(prevPlayer==='html5'){if(this.playing){this.pauseMedia()}
this.$media.hide()}}else{this.youTubeId=!1;if(prevPlayer==='youtube'){this.$media.show()}}
this.player=newPlayer;this.swappingSrc=!0;if(this.hasAttr($newItem,'data-poster')){this.$media.attr('poster',$newItem.attr('data-poster'))}
if(this.hasAttr($newItem,'data-width')){this.$media.attr('width',$newItem.attr('data-width'))}
if(this.hasAttr($newItem,'data-height')){this.$media.attr('height',$newItem.attr('data-height'))}
if(this.hasAttr($newItem,'data-youtube-desc-id')){this.$media.attr('data-youtube-desc-id',$newItem.attr('data-youtube-desc-id'))}
if(this.youTubeId){this.$media.attr('data-youtube-id',$newItem.attr('data-youtube-id'))}
var $sourceSpans=$newItem.children('span.able-source');if($sourceSpans.length){$sourceSpans.each(function(){if(thisObj.hasAttr($(this),'data-src')){var $newSource=$('<source>',{'src':$(this).attr('data-src')});if(thisObj.hasAttr($(this),'data-type')){$newSource.attr('type',$(this).attr('data-type'))}
if(thisObj.hasAttr($(this),'data-desc-src')){$newSource.attr('data-desc-src',$(this).attr('data-desc-src'))}
if(thisObj.hasAttr($(this),'data-sign-src')){$newSource.attr('data-sign-src',$(this).attr('data-sign-src'))}
thisObj.$media.append($newSource)}})}
var $trackSpans=$newItem.children('span.able-track');if($trackSpans.length){$trackSpans.each(function(){if(thisObj.hasAttr($(this),'data-src')&&thisObj.hasAttr($(this),'data-kind')&&thisObj.hasAttr($(this),'data-srclang')){var $newTrack=$('<track>',{'src':$(this).attr('data-src'),'kind':$(this).attr('data-kind'),'srclang':$(this).attr('data-srclang')});if(thisObj.hasAttr($(this),'data-label')){$newTrack.attr('label',$(this).attr('data-label'))}
thisObj.$media.append($newTrack)}})}
itemTitle=$newItem.text();if(this.hasAttr($newItem,'lang')){itemLang=$newItem.attr('lang')}
this.$sources=this.$media.find('source');this.recreatePlayer();this.$playlist.removeClass('able-current');this.$playlist.eq(sourceIndex).addClass('able-current');if(this.showNowPlaying===!0){if(typeof this.$nowPlayingDiv!=='undefined'){nowPlayingSpan=$('<span>');if(typeof itemLang!=='undefined'){nowPlayingSpan.attr('lang',itemLang)}
nowPlayingSpan.html('<span>'+this.tt.selectedTrack+':</span>'+itemTitle);this.$nowPlayingDiv.html(nowPlayingSpan)}}
if(this.initializing){this.swappingSrc=!1}else{this.swappingSrc=!0;if(this.player==='html5'){this.media.load()}else if(this.player==='youtube'){this.okToPlay=!0}}};AblePlayer.prototype.deletePlayer=function(){if(this.player=='youtube'){var $youTubeIframe=this.$mediaContainer.find('iframe');$youTubeIframe.remove()}
this.$media.removeAttr('poster width height');this.$media.empty();this.$controllerDiv.empty();this.$elapsedTimeContainer.empty().text('0:00');this.$durationContainer.empty();if(this.$signWindow){this.$signWindow.remove()}
if(this.$transcriptArea){this.$transcriptArea.remove()}
$('.able-modal-dialog').remove();this.hasCaptions=!1;this.hasChapters=!1;this.captionsPopup=null;this.chaptersPopup=null};AblePlayer.prototype.getButtonTitle=function(control){if(control==='playpause'){return this.tt.play}else if(control==='play'){return this.tt.play}else if(control==='pause'){return this.tt.pause}else if(control==='restart'){return this.tt.restart}else if(control==='previous'){return this.tt.prevTrack}else if(control==='next'){return this.tt.nextTrack}else if(control==='rewind'){return this.tt.rewind}else if(control==='forward'){return this.tt.forward}else if(control==='captions'){if(this.captions.length>1){return this.tt.captions}else{if(this.captionsOn){return this.tt.hideCaptions}else{return this.tt.showCaptions}}}else if(control==='descriptions'){if(this.descOn){return this.tt.turnOffDescriptions}else{return this.tt.turnOnDescriptions}}else if(control==='transcript'){if(this.$transcriptDiv.is(':visible')){return this.tt.hideTranscript}else{return this.tt.showTranscript}}else if(control==='chapters'){return this.tt.chapters}else if(control==='sign'){return this.tt.sign}else if(control==='volume'){return this.tt.volume}else if(control==='faster'){return this.tt.faster}else if(control==='slower'){return this.tt.slower}else if(control==='preferences'){return this.tt.preferences}else if(control==='help'){}else{if(this.debug){console.log('Found an untranslated label: '+control)}
return control.charAt(0).toUpperCase()+control.slice(1)}}})(jQuery);(function($){AblePlayer.prototype.setupTracks=function(){var thisObj,deferred,promise,loadingPromises,loadingPromise,i,tracks,track;thisObj=this;deferred=new $.Deferred();promise=deferred.promise();loadingPromises=[];this.captions=[];this.captionLabels=[];this.descriptions=[];this.chapters=[];this.meta=[];if($('#able-vts').length){this.vtsTracks=[];this.hasVts=!0}else{this.hasVts=!1}
this.getTracks().then(function(){tracks=thisObj.tracks;if(thisObj.player==='youtube'){if(tracks.length){thisObj.usingYouTubeCaptions=!1}}
for(i=0;i<tracks.length;i++){track=tracks[i];var kind=track.kind;var trackLang=track.language;var trackLabel=track.label;if(!track.src){if(thisObj.usingYouTubeCaptions||thisObj.usingVimeoCaptions){thisObj.setupCaptions(track,trackLang,trackLabel)}else{}
continue}
var trackSrc=track.src;loadingPromise=thisObj.loadTextObject(trackSrc);loadingPromises.push(loadingPromise);loadingPromise.then((function(track,kind){var trackSrc=track.src;var trackLang=track.language;var trackLabel=track.label;return function(trackSrc,trackText){var trackContents=trackText;var cues=thisObj.parseWebVTT(trackSrc,trackContents).cues;if(thisObj.hasVts){thisObj.setupVtsTracks(kind,trackLang,trackLabel,trackSrc,trackContents)}
if(kind==='captions'||kind==='subtitles'){thisObj.setupCaptions(track,trackLang,trackLabel,cues)}else if(kind==='descriptions'){thisObj.setupDescriptions(track,cues,trackLang)}else if(kind==='chapters'){thisObj.setupChapters(track,cues,trackLang)}else if(kind==='metadata'){thisObj.setupMetadata(track,cues)}}})(track,kind))}
$.when.apply($,loadingPromises).then(function(){deferred.resolve()})});return promise};AblePlayer.prototype.getTracks=function(){var thisObj,deferred,promise,captionTracks,trackLang,trackLabel,isDefault;thisObj=this;deferred=new $.Deferred();promise=deferred.promise();this.$tracks=this.$media.find('track');this.tracks=[];if(this.$tracks.length){this.$tracks.each(function(){if($(this).attr('srclang')){trackLang=$(this).attr('srclang')}else{trackLang=thisObj.lang}
if($(this).attr('label')){trackLabel=$(this).attr('label')}else{trackLabel=thisObj.getLanguageName(trackLang)}
if($(this).attr('default')){isDefault=!0}else if(trackLang===thisObj.lang){isDefault=!0}else{isDefault=!1}
if(isDefault){thisObj.captionLang=trackLang}
thisObj.tracks.push({'kind':$(this).attr('kind'),'src':$(this).attr('src'),'language':trackLang,'label':trackLabel,'def':isDefault})})}
captionTracks=this.$media.find('track[kind="captions"],track[kind="subtitles"]');if(captionTracks.length){deferred.resolve()}else{if(this.player==='youtube'){this.getYouTubeCaptionTracks(this.youTubeId).then(function(){deferred.resolve()})}else if(this.player==='vimeo'){this.getVimeoCaptionTracks().then(function(){deferred.resolve()})}else{deferred.resolve()}}
return promise};AblePlayer.prototype.setupCaptions=function(track,trackLang,trackLabel,cues){var thisObj,inserted,i,capLabel;thisObj=this;if(typeof cues==='undefined'){cues=null}
this.hasCaptions=!0;this.$media.find('track').removeAttr('default');if(this.mediaType==='video'){if(!(this.usingYouTubeCaptions||this.usingVimeoCaptions)){if(!this.$captionsDiv){this.$captionsDiv=$('<div>',{'class':'able-captions',});this.$captionsWrapper=$('<div>',{'class':'able-captions-wrapper','aria-hidden':'true'}).hide();if(this.prefCaptionsPosition==='below'){this.$captionsWrapper.addClass('able-captions-below')}else{this.$captionsWrapper.addClass('able-captions-overlay')}
this.$captionsWrapper.append(this.$captionsDiv);this.$vidcapContainer.append(this.$captionsWrapper)}}}
this.currentCaption=-1;if(this.prefCaptions===1){this.captionsOn=!0}else{this.captionsOn=!1}
if(this.captions.length===0){this.captions.push({'cues':cues,'language':trackLang,'label':trackLabel,'def':track.def});this.captionLabels.push(trackLabel)}else{inserted=!1;for(i=0;i<this.captions.length;i++){capLabel=this.captionLabels[i];if(trackLabel.toLowerCase()<this.captionLabels[i].toLowerCase()){this.captions.splice(i,0,{'cues':cues,'language':trackLang,'label':trackLabel,'def':track.def});this.captionLabels.splice(i,0,trackLabel);inserted=!0;break}}
if(!inserted){this.captions.push({'cues':cues,'language':trackLang,'label':trackLabel,'def':track.def});this.captionLabels.push(trackLabel)}}};AblePlayer.prototype.setupDescriptions=function(track,cues,trackLang){this.hasClosedDesc=!0;this.currentDescription=-1;this.descriptions.push({cues:cues,language:trackLang})};AblePlayer.prototype.setupChapters=function(track,cues,trackLang){this.hasChapters=!0;this.chapters.push({cues:cues,language:trackLang})};AblePlayer.prototype.setupMetadata=function(track,cues){if(this.metaType==='text'){if(this.metaDiv){if($('#'+this.metaDiv)){this.$metaDiv=$('#'+this.metaDiv);this.hasMeta=!0;this.meta=cues}}}else if(this.metaType==='selector'){this.hasMeta=!0;this.visibleSelectors=[];this.meta=cues}};AblePlayer.prototype.loadTextObject=function(src){var deferred,promise,thisObj,$tempDiv;deferred=new $.Deferred();promise=deferred.promise();thisObj=this;$tempDiv=$('<div>',{style:'display:none'});$tempDiv.load(src,function(trackText,status,req){if(status==='error'){if(thisObj.debug){console.log('error reading file '+src+': '+status)}
deferred.fail()}else{deferred.resolve(src,trackText)}
$tempDiv.remove()});return promise};AblePlayer.prototype.setupAltCaptions=function(){var deferred=new $.Deferred();var promise=deferred.promise();if(this.captions.length===0){if(this.player==='youtube'&&this.usingYouTubeCaptions){this.setupYouTubeCaptions().done(function(){deferred.resolve()})}else if(this.player==='vimeo'&&this.usingVimeoCaptions){this.setupVimeoCaptions().done(function(){deferred.resolve()})}else{deferred.resolve()}}else{deferred.resolve()}
return promise}})(jQuery);(function($){AblePlayer.prototype.initYouTubePlayer=function(){var thisObj,deferred,promise,youTubeId,googleApiPromise,json;thisObj=this;deferred=new $.Deferred();promise=deferred.promise();if(this.youTubeDescId&&this.prefDesc){youTubeId=this.youTubeDescId}else{youTubeId=this.youTubeId}
this.activeYouTubeId=youTubeId;if(AblePlayer.youtubeIframeAPIReady){this.finalizeYoutubeInit().then(function(){deferred.resolve()})}else{if(!AblePlayer.loadingYoutubeIframeAPI){$.getScript('https://www.youtube.com/iframe_api').fail(function(){deferred.fail()})}
$('body').on('youtubeIframeAPIReady',function(){thisObj.finalizeYoutubeInit().then(function(){deferred.resolve()})})}
return promise};AblePlayer.prototype.finalizeYoutubeInit=function(){var deferred,promise,thisObj,containerId,ccLoadPolicy,videoDimensions,autoplay;deferred=new $.Deferred();promise=deferred.promise();thisObj=this;containerId=this.mediaId+'_youtube';this.$mediaContainer.prepend($('<div>').attr('id',containerId));ccLoadPolicy=0;videoDimensions=this.getYouTubeDimensions(this.activeYouTubeId,containerId);if(videoDimensions){this.ytWidth=videoDimensions[0];this.ytHeight=videoDimensions[1];this.aspectRatio=thisObj.ytWidth/thisObj.ytHeight}else{this.ytWidth=null;this.ytHeight=null}
if(this.okToPlay){autoplay=1}else{autoplay=0}
this.youTubePlayer=new YT.Player(containerId,{videoId:this.activeYouTubeId,host:this.youTubeNoCookie?'https://www.youtube-nocookie.com':'https://www.youtube.com',width:this.ytWidth,height:this.ytHeight,playerVars:{autoplay:autoplay,enablejsapi:1,disableKb:1,playsinline:this.playsInline,start:this.startTime,controls:0,cc_load_policy:ccLoadPolicy,hl:this.lang,modestbranding:1,rel:0,html5:1,iv_load_policy:3},events:{onReady:function(){if(thisObj.swappingSrc){thisObj.swappingSrc=!1;thisObj.cueingPlaylistItem=!1;if(thisObj.playing){thisObj.playMedia()}}
if(thisObj.userClickedPlaylist){thisObj.userClickedPlaylist=!1}
if(typeof thisObj.aspectRatio==='undefined'){thisObj.resizeYouTubePlayer(thisObj.activeYouTubeId,containerId)}
deferred.resolve()},onError:function(x){deferred.fail()},onStateChange:function(x){thisObj.getPlayerState().then(function(playerState){if(playerState==='playing'){thisObj.playing=!0;thisObj.startedPlaying=!0;thisObj.paused=!1}else if(playerState=='ended'){thisObj.onMediaComplete()}else{thisObj.playing=!1;thisObj.paused=!0}
if(thisObj.stoppingYouTube&&playerState==='paused'){if(typeof thisObj.$posterImg!=='undefined'){thisObj.$posterImg.show()}
thisObj.stoppingYouTube=!1;thisObj.seeking=!1;thisObj.playing=!1;thisObj.paused=!0}})},onPlaybackQualityChange:function(){},onApiChange:function(x){thisObj.initYouTubeCaptionModule()}}});this.injectPoster(this.$mediaContainer,'youtube');if(!this.hasPlaylist){this.$media.remove()}
return promise};AblePlayer.prototype.getYouTubeDimensions=function(youTubeContainerId){var d,url,$iframe,width,height;d=[];if(typeof this.playerMaxWidth!=='undefined'){d[0]=this.playerMaxWidth;if(typeof this.playerMaxHeight!=='undefined'){d[1]=this.playerMaxHeight}
return d}else{if(typeof $('#'+youTubeContainerId)!=='undefined'){$iframe=$('#'+youTubeContainerId);width=$iframe.width();height=$iframe.height();if(width>0&&height>0){d[0]=width;d[1]=height;return d}}}
return!1};AblePlayer.prototype.resizeYouTubePlayer=function(youTubeId,youTubeContainerId){var d,width,height;if(typeof this.aspectRatio!=='undefined'){if(this.restoringAfterFullScreen){if(this.youTubePlayer){this.youTubePlayer.setSize(this.ytWidth,this.ytHeight)}
this.restoringAfterFullScreen=!1}else{width=this.$ableWrapper.parent().width();height=Math.round(width/this.aspectRatio);this.$ableWrapper.css({'max-width':width+'px','width':''});this.youTubePlayer.setSize(width,height);if(this.fullscreen){this.youTubePlayer.setSize(width,height)}else{this.youTubePlayer.setSize(this.ytWidth,this.ytHeight)}}}else{d=this.getYouTubeDimensions(youTubeContainerId);if(d){width=d[0];height=d[1];if(width>0&&height>0){this.aspectRatio=width/height;this.ytWidth=width;this.ytHeight=height;if(width!==this.$ableWrapper.width()){width=this.$ableWrapper.width();height=Math.round(width/this.aspectRatio);if(this.youTubePlayer){this.youTubePlayer.setSize(width,height)}}}}}};AblePlayer.prototype.setupYouTubeCaptions=function(){var deferred=new $.Deferred();var promise=deferred.promise();var thisObj,googleApiPromise,youTubeId,i;thisObj=this;if(this.youTubeDescId&&this.prefDesc){youTubeId=this.youTubeDescId}else{youTubeId=this.youTubeId}
if(typeof youTubeDataAPIKey!=='undefined'){$.doWhen({when:function(){return googleApiReady},interval:100,attempts:1000}).done(function(){deferred.resolve()}).fail(function(){console.log('Unable to initialize Google API. YouTube captions are currently unavailable.')})}else{deferred.resolve()}
return promise};AblePlayer.prototype.waitForGapi=function(){var thisObj,deferred,promise,maxWaitTime,maxTries,tries,timer,interval;thisObj=this;deferred=new $.Deferred();promise=deferred.promise();maxWaitTime=5000;maxTries=100;tries=0;interval=Math.floor(maxWaitTime/maxTries);timer=setInterval(function(){tries++;if(googleApiReady||tries>=maxTries){clearInterval(timer);if(googleApiReady){deferred.resolve(!0)}else{deferred.resolve(!1)}}else{thisObj.waitForGapi()}},interval);return promise};AblePlayer.prototype.getYouTubeCaptionTracks=function(youTubeId){var deferred=new $.Deferred();var promise=deferred.promise();var thisObj,useGoogleApi,i,trackId,trackLang,trackName,trackLabel,trackKind,isDraft,isDefaultTrack;thisObj=this;if(typeof youTubeDataAPIKey!=='undefined'){this.waitForGapi().then(function(waitResult){useGoogleApi=waitResult;if(useGoogleApi===!0){gapi.client.setApiKey(youTubeDataAPIKey);gapi.client.load('youtube','v3').then(function(){var request=gapi.client.youtube.captions.list({'part':'id, snippet','videoId':youTubeId});request.then(function(json){if(json.result.items.length){thisObj.hasCaptions=!0;thisObj.usingYouTubeCaptions=!0;if(thisObj.prefCaptions===1){thisObj.captionsOn=!0}else{thisObj.captionsOn=!1}
for(i=0;i<json.result.items.length;i++){trackName=json.result.items[i].snippet.name;trackLang=json.result.items[i].snippet.language;trackKind=json.result.items[i].snippet.trackKind;isDraft=json.result.items[i].snippet.isDraft;var srcUrl=thisObj.getYouTubeTimedTextUrl(youTubeId,trackName,trackLang);if(trackKind!=='ASR'&&!isDraft){if(trackName!==''){trackLabel=trackName}else{trackLabel=thisObj.getLanguageName(trackLang)}
if(trackLang===thisObj.lang){isDefaultTrack=!0}else{isDefaultTrack=!1}
thisObj.tracks.push({'kind':'captions','src':srcUrl,'language':trackLang,'label':trackLabel,'def':isDefaultTrack})}}
thisObj.setupPopups('captions');deferred.resolve()}else{thisObj.hasCaptions=!1;thisObj.usingYouTubeCaptions=!1;deferred.resolve()}},function(reason){console.log('Error retrieving captions.');console.log('Check your video on YouTube to be sure captions are available and published.');thisObj.hasCaptions=!1;thisObj.usingYouTubeCaptions=!1;deferred.resolve()})})}else{this.getYouTubeCaptionTracks2(youTubeId).then(function(){deferred.resolve()})}})}else{this.getYouTubeCaptionTracks2(youTubeId).then(function(){deferred.resolve()})}
return promise};AblePlayer.prototype.getYouTubeCaptionTracks2=function(youTubeId){var deferred=new $.Deferred();var promise=deferred.promise();var thisObj,useGoogleApi,i,trackId,trackLang,trackName,trackLabel,trackKind,isDraft,isDefaultTrack;thisObj=this;$.ajax({type:'get',url:'https://www.youtube.com/api/timedtext?type=list&v='+youTubeId,dataType:'xml',success:function(xml){var $tracks=$(xml).find('track');if($tracks.length>0){thisObj.hasCaptions=!0;thisObj.usingYouTubeCaptions=!0;if(thisObj.prefCaptions===1){thisObj.captionsOn=!0}else{thisObj.captionsOn=!1}
$tracks.each(function(){trackId=$(this).attr('id');trackLang=$(this).attr('lang_code');if($(this).attr('name')!==''){trackName=$(this).attr('name');trackLabel=trackName}else{trackName='';trackLabel=$(this).attr('lang_translated')}
if(trackLabel===''){trackLabel=thisObj.getLanguageName(trackLang)}
if(trackLang===thisObj.lang){isDefaultTrack=!0}else{isDefaultTrack=!1}
var srcUrl=thisObj.getYouTubeTimedTextUrl(youTubeId,trackName,trackLang);thisObj.tracks.push({'kind':'captions','src':srcUrl,'language':trackLang,'label':trackLabel,'def':isDefaultTrack})});thisObj.setupPopups('captions');deferred.resolve()}else{thisObj.hasCaptions=!1;thisObj.usingYouTubeCaptions=!1;deferred.resolve()}},error:function(xhr,status){console.log('Error retrieving YouTube caption data for video '+youTubeId);deferred.resolve()}});return promise};AblePlayer.prototype.getYouTubeTimedTextUrl=function(youTubeId,trackName,trackLang){var url='https://www.youtube.com/api/timedtext?fmt=vtt';url+='&v='+youTubeId;url+='&lang='+trackLang;if(trackName!==''){url+='&name='+trackName}
return url};AblePlayer.prototype.getYouTubeCaptionCues=function(youTubeId){var deferred,promise,thisObj;var deferred=new $.Deferred();var promise=deferred.promise();thisObj=this;this.tracks=[];this.tracks.push({'kind':'captions','src':'some_file.vtt','language':'en','label':'Fake English captions'});deferred.resolve();return promise};AblePlayer.prototype.initYouTubeCaptionModule=function(){var options,fontSize,displaySettings;options=this.youTubePlayer.getOptions();if(options.length){for(var i=0;i<options.length;i++){if(options[i]=='cc'){this.ytCaptionModule='cc';if(!this.hasCaptions){this.hasCaptions=!0;this.usingYouTubeCaptions=!0}
break}else if(options[i]=='captions'){this.ytCaptionModule='captions';if(!this.hasCaptions){this.hasCaptions=!0;this.usingYouTubeCaptions=!0}
break}}
if(typeof this.ytCaptionModule!=='undefined'){if(this.usingYouTubeCaptions){this.youTubePlayer.setOption(this.ytCaptionModule,'track',{'languageCode':this.captionLang});this.youTubePlayer.setOption(this.ytCaptionModule,'fontSize',this.translatePrefs('size',this.prefCaptionsSize,'youtube'))}else{this.youTubePlayer.unloadModule(this.ytCaptionModule)}}}else{this.hasCaptions=!1;this.usingYouTubeCaptions=!1}
this.refreshControls('captions')};AblePlayer.prototype.getYouTubePosterUrl=function(youTubeId,width){var url='https://img.youtube.com/vi/'+youTubeId;if(width=='120'){return url+'/default.jpg'}else if(width=='320'){return url+'/hqdefault.jpg'}else if(width=='480'){return url+'/hqdefault.jpg'}else if(width=='640'){return url+'/sddefault.jpg'}
return!1}})(jQuery);(function($){window.AccessibleSlider=function(mediaType,div,orientation,length,min,max,bigInterval,label,className,trackingMedia,initialState){var thisObj,coords;thisObj=this;this.position=0;this.tracking=!1;this.trackDevice=null;this.keyTrackPosition=0;this.lastTrackPosition=0;this.nextStep=1;this.inertiaCount=0;this.bodyDiv=$(div);if(trackingMedia){this.loadedDiv=$('<div></div>');this.playedDiv=$('<div></div>')}
this.seekHead=$('<div>',{'orientation':orientation,'class':'able-'+className+'-head'});if(initialState==='visible'){this.seekHead.attr('tabindex','0')}else{this.seekHead.attr('tabindex','-1')}
this.seekHead.attr({'role':'slider','aria-label':label,'aria-valuemin':min,'aria-valuemax':max});this.timeTooltip=$('<div>');this.bodyDiv.append(this.timeTooltip);this.timeTooltip.attr('role','tooltip');this.timeTooltip.addClass('able-tooltip');this.timeTooltip.hide();this.bodyDiv.append(this.loadedDiv);this.bodyDiv.append(this.playedDiv);this.bodyDiv.append(this.seekHead);this.bodyDiv.wrap('<div></div>');this.wrapperDiv=this.bodyDiv.parent();if(this.skin==='legacy'){if(orientation==='horizontal'){this.wrapperDiv.width(length);this.loadedDiv.width(0)}else{this.wrapperDiv.height(length);this.loadedDiv.height(0)}}
this.wrapperDiv.addClass('able-'+className+'-wrapper');if(trackingMedia){this.loadedDiv.addClass('able-'+className+'-loaded');this.playedDiv.width(0);this.playedDiv.addClass('able-'+className+'-played');this.setDuration(max)}
this.seekHead.on('mouseenter mouseleave mousemove mousedown mouseup focus blur touchstart touchmove touchend',function(e){coords=thisObj.pointerEventToXY(e);if(e.type==='mouseenter'||e.type==='focus'){thisObj.overHead=!0}else if(e.type==='mouseleave'||e.type==='blur'){thisObj.overHead=!1;if(!thisObj.overBody&&thisObj.tracking&&thisObj.trackDevice==='mouse'){thisObj.stopTracking(thisObj.pageXToPosition(coords.x))}}else if(e.type==='mousemove'||e.type==='touchmove'){if(thisObj.tracking&&thisObj.trackDevice==='mouse'){thisObj.trackHeadAtPageX(coords.x)}}else if(e.type==='mousedown'||e.type==='touchstart'){thisObj.startTracking('mouse',thisObj.pageXToPosition(thisObj.seekHead.offset()+(thisObj.seekHead.width()/2)));if(!thisObj.bodyDiv.is(':focus')){thisObj.bodyDiv.focus()}
e.preventDefault()}else if(e.type==='mouseup'||e.type==='touchend'){if(thisObj.tracking&&thisObj.trackDevice==='mouse'){thisObj.stopTracking(thisObj.pageXToPosition(coords.x))}}
if(e.type!=='mousemove'&&e.type!=='mousedown'&&e.type!=='mouseup'&&e.type!=='touchstart'&&e.type!=='touchend'){thisObj.refreshTooltip()}});this.bodyDiv.on('mouseenter mouseleave mousemove mousedown mouseup keydown keyup touchstart touchmove touchend',function(e){coords=thisObj.pointerEventToXY(e);if(e.type==='mouseenter'){thisObj.overBody=!0}else if(e.type==='mouseleave'){thisObj.overBody=!1;thisObj.overBodyMousePos=null;if(!thisObj.overHead&&thisObj.tracking&&thisObj.trackDevice==='mouse'){thisObj.stopTracking(thisObj.pageXToPosition(coords.x))}}else if(e.type==='mousemove'||e.type==='touchmove'){thisObj.overBodyMousePos={x:coords.x,y:coords.y};if(thisObj.tracking&&thisObj.trackDevice==='mouse'){thisObj.trackHeadAtPageX(coords.x)}}else if(e.type==='mousedown'||e.type==='touchstart'){thisObj.startTracking('mouse',thisObj.pageXToPosition(coords.x));thisObj.trackHeadAtPageX(coords.x);if(!thisObj.seekHead.is(':focus')){thisObj.seekHead.focus()}
e.preventDefault()}else if(e.type==='mouseup'||e.type==='touchend'){if(thisObj.tracking&&thisObj.trackDevice==='mouse'){thisObj.stopTracking(thisObj.pageXToPosition(coords.x))}}else if(e.type==='keydown'){if(e.which===36){thisObj.trackImmediatelyTo(0)}else if(e.which===35){thisObj.trackImmediatelyTo(thisObj.duration)}else if(e.which===37||e.which===40){thisObj.arrowKeyDown(-1)}else if(e.which===39||e.which===38){thisObj.arrowKeyDown(1)}else if(e.which===33&&bigInterval>0){thisObj.arrowKeyDown(bigInterval)}else if(e.which===34&&bigInterval>0){thisObj.arrowKeyDown(-bigInterval)}else{return}
e.preventDefault()}else if(e.type==='keyup'){if(e.which>=33&&e.which<=40){if(thisObj.tracking&&thisObj.trackDevice==='keyboard'){thisObj.stopTracking(thisObj.keyTrackPosition)}
e.preventDefault()}}
if(e.type!=='mouseup'&&e.type!=='keydown'&&e.type!=='keydown'){thisObj.refreshTooltip()}})}
AccessibleSlider.prototype.arrowKeyDown=function(multiplier){if(this.tracking&&this.trackDevice==='keyboard'){this.keyTrackPosition=this.boundPos(this.keyTrackPosition+(this.nextStep*multiplier));this.inertiaCount+=1;if(this.inertiaCount===20){this.inertiaCount=0;this.nextStep*=2}
this.trackHeadAtPosition(this.keyTrackPosition)}else{this.nextStep=1;this.inertiaCount=0;this.keyTrackPosition=this.boundPos(this.position+(this.nextStep*multiplier));this.startTracking('keyboard',this.keyTrackPosition);this.trackHeadAtPosition(this.keyTrackPosition)}};AccessibleSlider.prototype.pageXToPosition=function(pageX){var offset=pageX-this.bodyDiv.offset().left;var position=this.duration*(offset/this.bodyDiv.width());return this.boundPos(position)};AccessibleSlider.prototype.boundPos=function(position){return Math.max(0,Math.min(position,this.duration))}
AccessibleSlider.prototype.setDuration=function(duration){if(duration!==this.duration){this.duration=duration;this.resetHeadLocation();this.seekHead.attr('aria-valuemax',duration)}};AccessibleSlider.prototype.setWidth=function(width){this.wrapperDiv.width(width);this.resizeDivs();this.resetHeadLocation()};AccessibleSlider.prototype.getWidth=function(){return this.wrapperDiv.width()};AccessibleSlider.prototype.resizeDivs=function(){this.playedDiv.width(this.bodyDiv.width()*(this.position/this.duration));this.loadedDiv.width(this.bodyDiv.width()*this.buffered)};AccessibleSlider.prototype.resetHeadLocation=function(){var ratio=this.position/this.duration;var center=this.bodyDiv.width()*ratio;this.seekHead.css('left',center-(this.seekHead.width()/2));if(this.tracking){this.stopTracking(this.position)}};AccessibleSlider.prototype.setPosition=function(position,updateLive){this.position=position;this.resetHeadLocation();this.refreshTooltip();this.resizeDivs();this.updateAriaValues(position,updateLive)}
AccessibleSlider.prototype.setBuffered=function(ratio){if(!isNaN(ratio)){this.buffered=ratio;this.redrawDivs}}
AccessibleSlider.prototype.startTracking=function(device,position){if(!this.tracking){this.trackDevice=device;this.tracking=!0;this.bodyDiv.trigger('startTracking',[position])}};AccessibleSlider.prototype.stopTracking=function(position){this.trackDevice=null;this.tracking=!1;this.bodyDiv.trigger('stopTracking',[position]);this.setPosition(position,!0)};AccessibleSlider.prototype.trackHeadAtPageX=function(pageX){var position=this.pageXToPosition(pageX);var newLeft=pageX-this.bodyDiv.offset().left-(this.seekHead.width()/2);newLeft=Math.max(0,Math.min(newLeft,this.bodyDiv.width()-this.seekHead.width()));this.lastTrackPosition=position;this.seekHead.css('left',newLeft);this.reportTrackAtPosition(position)};AccessibleSlider.prototype.trackHeadAtPosition=function(position){var ratio=position/this.duration;var center=this.bodyDiv.width()*ratio;this.lastTrackPosition=position;this.seekHead.css('left',center-(this.seekHead.width()/2));this.reportTrackAtPosition(position)};AccessibleSlider.prototype.reportTrackAtPosition=function(position){this.bodyDiv.trigger('tracking',[position]);this.updateAriaValues(position,!0)};AccessibleSlider.prototype.updateAriaValues=function(position,updateLive){var pHours=Math.floor(position/3600);var pMinutes=Math.floor((position%3600)/60);var pSeconds=Math.floor(position%60);var pHourWord=pHours===1?'hour':'hours';var pMinuteWord=pMinutes===1?'minute':'minutes';var pSecondWord=pSeconds===1?'second':'seconds';var descriptionText;if(pHours>0){descriptionText=pHours+' '+pHourWord+', '+pMinutes+' '+pMinuteWord+', '+pSeconds+' '+pSecondWord}else if(pMinutes>0){descriptionText=pMinutes+' '+pMinuteWord+', '+pSeconds+' '+pSecondWord}else{descriptionText=pSeconds+' '+pSecondWord}
if(!this.liveAriaRegion){this.liveAriaRegion=$('<span>',{'class':'able-offscreen','aria-live':'polite'});this.wrapperDiv.append(this.liveAriaRegion)}
if(updateLive&&(this.liveAriaRegion.text()!==descriptionText)){this.liveAriaRegion.text(descriptionText)}
this.seekHead.attr('aria-valuetext',descriptionText);this.seekHead.attr('aria-valuenow',Math.floor(position).toString())};AccessibleSlider.prototype.trackImmediatelyTo=function(position){this.startTracking('keyboard',position);this.trackHeadAtPosition(position);this.keyTrackPosition=position};AccessibleSlider.prototype.refreshTooltip=function(){if(this.overHead){this.timeTooltip.show();if(this.tracking){this.timeTooltip.text(this.positionToStr(this.lastTrackPosition))}else{this.timeTooltip.text(this.positionToStr(this.position))}
this.setTooltipPosition(this.seekHead.position().left+(this.seekHead.width()/2))}else if(this.overBody&&this.overBodyMousePos){this.timeTooltip.show();this.timeTooltip.text(this.positionToStr(this.pageXToPosition(this.overBodyMousePos.x)));this.setTooltipPosition(this.overBodyMousePos.x-this.bodyDiv.offset().left)}else{this.timeTooltip.hide()}};AccessibleSlider.prototype.setTooltipPosition=function(x){this.timeTooltip.css({left:x-(this.timeTooltip.width()/2)-10,bottom:this.seekHead.height()+10})};AccessibleSlider.prototype.positionToStr=function(seconds){var dHours=Math.floor(seconds/3600);var dMinutes=Math.floor(seconds/60)%60;var dSeconds=Math.floor(seconds%60);if(dSeconds<10){dSeconds='0'+dSeconds}
if(dHours>0){if(dMinutes<10){dMinutes='0'+dMinutes}
return dHours+':'+dMinutes+':'+dSeconds}else{return dMinutes+':'+dSeconds}};AccessibleSlider.prototype.pointerEventToXY=function(e){var out={x:0,y:0};if(e.type=='touchstart'||e.type=='touchmove'||e.type=='touchend'||e.type=='touchcancel'){var touch=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0];out.x=touch.pageX;out.y=touch.pageY}else if(e.type=='mousedown'||e.type=='mouseup'||e.type=='mousemove'||e.type=='mouseover'||e.type=='mouseout'||e.type=='mouseenter'||e.type=='mouseleave'){out.x=e.pageX;out.y=e.pageY}
return out}})(jQuery);(function($){AblePlayer.prototype.addVolumeSlider=function($div){var thisObj,volumeSliderId,volumeHelpId,x,y,volumePct;thisObj=this;volumeSliderId=this.mediaId+'-volume-slider';volumeHelpId=this.mediaId+'-volume-help';this.volumeTrackHeight=50;this.volumeHeadHeight=7;this.volumeTickHeight=this.volumeTrackHeight/10;this.$volumeSlider=$('<div>',{'id':volumeSliderId,'class':'able-volume-slider','aria-hidden':'true'}).hide();this.$volumeSliderTooltip=$('<div>',{'class':'able-tooltip','role':'tooltip'}).hide();this.$volumeSliderTrack=$('<div>',{'class':'able-volume-track'});this.$volumeSliderTrackOn=$('<div>',{'class':'able-volume-track able-volume-track-on'});this.$volumeSliderHead=$('<div>',{'class':'able-volume-head','role':'slider','aria-orientation':'vertical','aria-label':this.tt.volumeUpDown,'aria-valuemin':0,'aria-valuemax':10,'aria-valuenow':this.volume,'tabindex':-1});this.$volumeSliderTrack.append(this.$volumeSliderTrackOn,this.$volumeSliderHead);this.$volumeAlert=$('<div>',{'class':'able-offscreen','aria-live':'assertive','aria-atomic':'true'});volumePct=parseInt(thisObj.volume)/10*100;this.$volumeHelp=$('<div>',{'id':volumeHelpId,'class':'able-volume-help'}).text(volumePct+'%, '+this.tt.volumeHelp);this.$volumeButton.attr({'aria-describedby':volumeHelpId});this.$volumeSlider.append(this.$volumeSliderTooltip,this.$volumeSliderTrack,this.$volumeAlert,this.$volumeHelp)
$div.append(this.$volumeSlider);this.refreshVolumeSlider(this.volume);this.$volumeSliderHead.on('mousedown',function(e){e.preventDefault();thisObj.draggingVolume=!0;thisObj.volumeHeadPositionTop=$(this).offset().top});this.$mediaContainer.on('mouseover',function(e){if(thisObj.player=='youtube'){thisObj.draggingVolume=!1}});$(document).on('mouseup',function(e){thisObj.draggingVolume=!1});$(document).on('mousemove',function(e){if(thisObj.draggingVolume){x=e.pageX;y=e.pageY;thisObj.moveVolumeHead(y)}});this.$volumeSliderHead.on('keydown',function(e){if(e.which===37||e.which===40){thisObj.handleVolume('down')}else if(e.which===39||e.which===38){thisObj.handleVolume('up')}else if(e.which===27||e.which===13||e.which===9){if(thisObj.$volumeSlider.is(':visible')){thisObj.closingVolume=!0;thisObj.hideVolumePopup()}else{if(!thisObj.closingVolume){thisObj.showVolumePopup()}}}else{return}
e.preventDefault()})};AblePlayer.prototype.refreshVolumeSlider=function(volume){var volumePct,volumePctText;volumePct=(volume/10)*100;volumePctText=volumePct+'%';var trackOnHeight,trackOnTop,headTop;trackOnHeight=volume*this.volumeTickHeight;trackOnTop=this.volumeTrackHeight-trackOnHeight;headTop=trackOnTop-this.volumeHeadHeight;if(this.$volumeSliderTrackOn){this.$volumeSliderTrackOn.css({'height':trackOnHeight+'px','top':trackOnTop+'px'})}
if(this.$volumeSliderHead){this.$volumeSliderHead.attr({'aria-valuenow':volume,'aria-valuetext':volumePctText});this.$volumeSliderHead.css({'top':headTop+'px'})}
if(this.$volumeAlert){this.$volumeAlert.text(volumePct+'%')}};AblePlayer.prototype.refreshVolumeButton=function(volume){var volumeName,volumePct,volumeLabel,volumeIconClass,volumeImg,newSvgData;volumeName=this.getVolumeName(volume);volumePct=(volume/10)*100;volumeLabel=this.tt.volume+' '+volumePct+'%';if(this.iconType==='font'){volumeIconClass='icon-volume-'+volumeName;this.$volumeButton.find('span').first().removeClass().addClass(volumeIconClass);this.$volumeButton.find('span.able-clipped').text(volumeLabel)}else if(this.iconType==='image'){volumeImg=this.imgPath+'volume-'+volumeName+'.png';this.$volumeButton.find('img').attr('src',volumeImg)}else if(this.iconType==='svg'){if(volumeName!=='mute'){volumeName='volume-'+volumeName}
newSvgData=this.getSvgData(volumeName);this.$volumeButton.find('svg').attr('viewBox',newSvgData[0]);this.$volumeButton.find('path').attr('d',newSvgData[1])}};AblePlayer.prototype.moveVolumeHead=function(y){var diff,direction,ticksDiff,newVolume,maxedOut;var diff=this.volumeHeadPositionTop-y;if(Math.abs(diff)>this.volumeTickHeight){if(diff>0){direction='up'}else{direction='down'}
if(direction=='up'&&this.volume==10){return}else if(direction=='down'&&this.volume==0){return}else{ticksDiff=Math.round(Math.abs(diff)/this.volumeTickHeight);if(direction=='up'){newVolume=this.volume+ticksDiff;if(newVolume>10){newVolume=10}}else{newVolume=this.volume-ticksDiff;if(newVolume<0){newVolume=0}}
this.setVolume(newVolume);this.refreshVolumeSlider(newVolume);this.refreshVolumeButton(newVolume);this.volumeHeadPositionTop=y}}};AblePlayer.prototype.handleVolume=function(direction){var volume;if(typeof direction==='undefined'){if(this.$volumeSlider.is(':visible')){this.hideVolumePopup()}else{if(!this.closingVolume){this.showVolumePopup()}}
return}
if(direction>=49&&direction<=57){volume=direction-48}else{volume=this.getVolume();if(direction==='up'&&volume<10){volume+=1}else if(direction==='down'&&volume>0){volume-=1}}
if(this.isMuted()&&volume>0){this.setMute(!1)}else if(volume===0){this.setMute(!0)}else{this.setVolume(volume);this.refreshVolumeSlider(volume);this.refreshVolumeButton(volume)}};AblePlayer.prototype.handleMute=function(){if(this.isMuted()){this.setMute(!1)}else{this.setMute(!0)}};AblePlayer.prototype.showVolumePopup=function(){this.closePopups();this.$tooltipDiv.hide();this.$volumeSlider.show().attr('aria-hidden','false');this.$volumeButton.attr('aria-expanded','true');this.$volumeSliderHead.attr('tabindex','0').focus()};AblePlayer.prototype.hideVolumePopup=function(){var thisObj=this;this.$volumeSlider.hide().attr('aria-hidden','true');this.$volumeSliderHead.attr('tabindex','-1');this.$volumeButton.attr('aria-expanded','false').focus();setTimeout(function(){thisObj.closingVolume=!1},1000)};AblePlayer.prototype.isMuted=function(){if(this.player==='html5'){return this.media.muted}else if(this.player==='jw'&&this.jwPlayer){return this.jwPlayer.getMute()}else if(this.player==='youtube'){return this.youTubePlayer.isMuted()}};AblePlayer.prototype.setMute=function(mute){if(mute){this.lastVolume=this.volume;this.volume=0}else{if(typeof this.lastVolume!=='undefined'){this.volume=this.lastVolume}}
if(this.player==='html5'){this.media.muted=mute}else if(this.player==='jw'&&this.jwPlayer){this.jwPlayer.setMute(mute)}else if(this.player==='youtube'){if(mute){this.youTubePlayer.mute()}else{this.youTubePlayer.unMute()}}
this.refreshVolumeSlider(this.volume);this.refreshVolumeButton(this.volume)};AblePlayer.prototype.setVolume=function(volume){if(this.player==='html5'){this.media.volume=volume/10;if(this.hasSignLanguage&&this.signVideo){this.signVideo.volume=0}}else if(this.player==='youtube'){this.youTubePlayer.setVolume(volume*10);this.volume=volume}else if(this.player==='vimeo'){this.vimeoPlayer.setVolume(volume/10).then(function(){})}else if(this.player==='jw'&&this.jwPlayer){this.jwPlayer.setVolume(volume*10)}
this.lastVolume=volume};AblePlayer.prototype.getVolume=function(volume){if(this.player==='html5'){return this.media.volume*10}else if(this.player==='youtube'){return this.youTubePlayer.getVolume()/10}
if(this.player==='vimeo'){return this.volume}else if(this.player==='jw'&&this.jwPlayer){return this.jwPlayer.getVolume()/10}};AblePlayer.prototype.getVolumeName=function(volume){if(volume==0){return'mute'}else if(volume==10){return'loud'}else if(volume<5){return'soft'}else{return'medium'}}})(jQuery);(function($){var focusableElementsSelector="a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]";window.AccessibleDialog=function(modalDiv,$returnElement,dialogRole,title,$descDiv,closeButtonLabel,width,fullscreen,escapeHook){this.title=title;this.closeButtonLabel=closeButtonLabel;this.focusedElementBeforeModal=$returnElement;this.escapeHook=escapeHook;this.baseId=$(modalDiv).attr('id')||Math.floor(Math.random()*1000000000).toString();var thisObj=this;var modal=modalDiv;this.modal=modal;modal.css({'width':width||'50%','top':(fullscreen?'0':'5%')});modal.addClass('able-modal-dialog');if(!fullscreen){var closeButton=$('<button>',{'class':'modalCloseButton','title':thisObj.closeButtonLabel,'aria-label':thisObj.closeButtonLabel}).text('X');closeButton.keydown(function(e){if(e.which===32){thisObj.hide()}}).click(function(){thisObj.hide()});var titleH1=$('<h1></h1>');titleH1.attr('id','modalTitle-'+this.baseId);titleH1.css('text-align','center');titleH1.text(title);$descDiv.attr('id','modalDesc-'+this.baseId);modal.attr({'aria-labelledby':'modalTitle-'+this.baseId,'aria-describedby':'modalDesc-'+this.baseId});modal.prepend(titleH1);modal.prepend(closeButton)}
modal.attr({'aria-hidden':'true','role':dialogRole});modal.keydown(function(e){if(e.which===27){if(thisObj.escapeHook){thisObj.escapeHook(e,this)}else{thisObj.hide();e.preventDefault()}}else if(e.which===9){var parts=modal.find('*');var focusable=parts.filter(focusableElementsSelector).filter(':visible');if(focusable.length===0){return}
var focused=$(':focus');var currentIndex=focusable.index(focused);if(e.shiftKey){if(currentIndex===0){focusable.get(focusable.length-1).focus();e.preventDefault()}}else{if(currentIndex===focusable.length-1){focusable.get(0).focus();e.preventDefault()}}}
e.stopPropagation()});$('body > *').not('.able-modal-overlay').not('.able-modal-dialog').removeAttr('aria-hidden')};AccessibleDialog.prototype.show=function(){if(!this.overlay){var overlay=$('<div></div>').attr({'class':'able-modal-overlay','tabindex':'-1'});this.overlay=overlay;$('body').append(overlay);overlay.on('mousedown.accessibleModal',function(e){e.preventDefault()})}
$('body > *').not('.able-modal-overlay').not('.able-modal-dialog').attr('aria-hidden','true');this.overlay.css('display','block');this.modal.css('display','block');this.modal.attr({'aria-hidden':'false','tabindex':'-1'});var focusable=this.modal.find("*").filter(focusableElementsSelector).filter(':visible');if(focusable.length===0){this.focusedElementBeforeModal.blur()}
var thisObj=this;setTimeout(function(){thisObj.modal.find('button.modalCloseButton').first().focus()},300)};AccessibleDialog.prototype.hide=function(){if(this.overlay){this.overlay.css('display','none')}
this.modal.css('display','none');this.modal.attr('aria-hidden','true');$('body > *').not('.able-modal-overlay').not('.able-modal-dialog').removeAttr('aria-hidden');this.focusedElementBeforeModal.focus()};AccessibleDialog.prototype.getInputs=function(){if(this.modal){var inputs=this.modal.find('input');return inputs}
return!1}})(jQuery);(function($){AblePlayer.prototype.getNextHeadingLevel=function($element){var $parents,$foundHeadings,numHeadings,headingType,headingNumber;$parents=$element.parents();$parents.each(function(){$foundHeadings=$(this).children(':header');numHeadings=$foundHeadings.length;if(numHeadings){headingType=$foundHeadings.eq(numHeadings-1).prop('tagName');return!1}});if(typeof headingType==='undefined'){headingNumber=1}else{headingNumber=parseInt(headingType[1]);headingNumber+=1;if(headingNumber>6){headingNumber=6}}
return headingNumber};AblePlayer.prototype.countProperties=function(obj){var count,prop;count=0;for(prop in obj){if(obj.hasOwnProperty(prop)){++count}}
return count};AblePlayer.prototype.formatSecondsAsColonTime=function(seconds,showFullTime){var dHours,dMinutes,dSeconds,parts,milliSeconds,numShort,i;if(showFullTime){parts=seconds.toString().split('.');if(parts.length===2){milliSeconds=parts[1];if(milliSeconds.length<3){numShort=3-milliSeconds.length;for(i=1;i<=numShort;i++){milliSeconds+='0'}}}else{milliSeconds='000'}}
dHours=Math.floor(seconds/3600);dMinutes=Math.floor(seconds/60)%60;dSeconds=Math.floor(seconds%60);if(dSeconds<10){dSeconds='0'+dSeconds}
if(dHours>0){if(dMinutes<10){dMinutes='0'+dMinutes}
if(showFullTime){return dHours+':'+dMinutes+':'+dSeconds+'.'+milliSeconds}else{return dHours+':'+dMinutes+':'+dSeconds}}else{if(showFullTime){if(dHours<1){dHours='00'}else if(dHours<10){dHours='0'+dHours}
if(dMinutes<1){dMinutes='00'}else if(dMinutes<10){dMinutes='0'+dMinutes}
return dHours+':'+dMinutes+':'+dSeconds+'.'+milliSeconds}else{return dMinutes+':'+dSeconds}}};AblePlayer.prototype.getSecondsFromColonTime=function(timeStr){var timeParts,hours,minutes,seconds,newTime;timeParts=timeStr.split(':');if(timeParts.length===3){hours=parseInt(timeParts[0]);minutes=parseInt(timeParts[1]);seconds=parseFloat(timeParts[2]);return((hours*3600)+(minutes*60)+(seconds))}else if(timeParts.length===2){minutes=parseInt(timeParts[0]);seconds=parseFloat(timeParts[1]);return((minutes*60)+(seconds))}else if(timeParts.length===1){seconds=parseFloat(timeParts[0]);return seconds}};AblePlayer.prototype.capitalizeFirstLetter=function(string){return string.charAt(0).toUpperCase()+string.slice(1)};AblePlayer.prototype.roundDown=function(value,decimals){return Number(Math.floor(value+'e'+decimals)+'e-'+decimals)};AblePlayer.prototype.hasAttr=function(object,attribute){var attr=object.attr(attribute);if(typeof attr!==typeof undefined&&attr!==!1){return!0}else{return!1}};Number.isInteger=Number.isInteger||function(value){return typeof value==="number"&&isFinite(value)&&Math.floor(value)===value}})(jQuery);(function($){AblePlayer.prototype.initDescription=function(){var thisObj=this;if(this.refreshingDesc){this.prevDescFormat=this.useDescFormat}else{this.descFile=this.$sources.first().attr('data-desc-src');if(typeof this.descFile!=='undefined'){this.hasOpenDesc=!0}else{if(this.youTubeDescId||this.vimeoDescId){this.hasOpenDesc=!0}else{this.hasOpenDesc=!1}}}
if(this.prefDesc){if(this.hasOpenDesc&&this.hasClosedDesc){this.useDescFormat=this.prefDescFormat;this.descOn=!0;this.prefDescPause=!1}else if(this.hasOpenDesc){this.useDescFormat='video';this.descOn=!0}else if(this.hasClosedDesc){this.useDescFormat='text';this.descOn=!0}}else{this.useDescFormat=!1;this.descOn=!1}
if(this.useDescFormat==='text'){if(window.speechSynthesis){this.synth=window.speechSynthesis;this.descVoices=this.synth.getVoices();this.descVoiceIndex=0;for(var i=0;i<this.descVoices.length;i++){if(this.captionLang.length===2){if(this.descVoices[i].lang.substr(0,2).toLowerCase()===this.captionLang.toLowerCase()){this.descVoiceIndex=i;break}}else{if(this.descVoices[i].lang.toLowerCase()===this.captionLang.toLowerCase()){this.descVoiceIndex=i;break}}}}}
if(this.descOn){if(this.useDescFormat==='video'){if(!this.usingAudioDescription()){this.swapDescription()}}
if(this.hasClosedDesc){if(this.prefVisibleDesc){this.$descDiv.show();this.$descDiv.removeClass('able-clipped')}else{this.$descDiv.addClass('able-clipped')}
if(!this.swappingSrc){this.showDescription(this.elapsed)}}}else{if(this.prevDescFormat==='video'){if(this.usingAudioDescription()){this.swapDescription()}}else if(this.prevDescFormat==='text'){this.$descDiv.hide();this.$descDiv.removeClass('able-clipped')}}
this.refreshingDesc=!1};AblePlayer.prototype.usingAudioDescription=function(){if(this.player==='youtube'){return(this.activeYouTubeId===this.youTubeDescId)}else if(this.player==='vimeo'){return(this.activeVimeoId===this.vimeoDescId)}else{return(this.$sources.first().attr('data-desc-src')===this.$sources.first().attr('src'))}};AblePlayer.prototype.swapDescription=function(){var thisObj,i,origSrc,descSrc,srcType,newSource;thisObj=this;this.swapTime=this.elapsed;if(this.descOn){this.showAlert(this.tt.alertDescribedVersion)}else{this.showAlert(this.tt.alertNonDescribedVersion)}
if(this.player==='html5'){if(this.usingAudioDescription()){for(i=0;i<this.$sources.length;i++){origSrc=this.$sources[i].getAttribute('data-orig-src');srcType=this.$sources[i].getAttribute('type');if(origSrc){this.$sources[i].setAttribute('src',origSrc)}}
this.swappingSrc=!0}else{for(i=0;i<this.$sources.length;i++){origSrc=this.$sources[i].getAttribute('src');descSrc=this.$sources[i].getAttribute('data-desc-src');srcType=this.$sources[i].getAttribute('type');if(descSrc){this.$sources[i].setAttribute('src',descSrc);this.$sources[i].setAttribute('data-orig-src',origSrc)}}
this.swappingSrc=!0}
if(this.player==='html5'){this.media.load()}}else if(this.player==='youtube'){if(this.usingAudioDescription()){this.activeYouTubeId=this.youTubeId;this.showAlert(this.tt.alertNonDescribedVersion)}else{this.activeYouTubeId=this.youTubeDescId;this.showAlert(this.tt.alertDescribedVersion)}
if(typeof this.youTubePlayer!=='undefined'){this.setupAltCaptions().then(function(){if(thisObj.playing){thisObj.youTubePlayer.loadVideoById(thisObj.activeYouTubeId,thisObj.swapTime)}else{thisObj.youTubePlayer.cueVideoById(thisObj.activeYouTubeId,thisObj.swapTime)}})}}else if(this.player==='vimeo'){if(this.usingAudioDescription()){this.activeVimeoId=this.vimeoId;this.showAlert(this.tt.alertNonDescribedVersion)}else{this.activeVimeoId=this.vimeoDescId;this.showAlert(this.tt.alertDescribedVersion)}
this.vimeoPlayer.loadVideo(this.activeVimeoId).then(function(){if(thisObj.playing){thisObj.vimeoPlayer.setCurrentTime(thisObj.swapTime)}else{thisObj.vimeoPlayer.pause()}})}};AblePlayer.prototype.showDescription=function(now){if(this.swappingSrc||!this.descOn){return}
var thisObj,i,cues,d,thisDescription,descText,msg;thisObj=this;var flattenComponentForDescription=function(component){var result=[];if(component.type==='string'){result.push(component.value)}else{for(var i=0;i<component.children.length;i++){result.push(flattenComponentForDescription(component.children[i]))}}
return result.join('')};if(this.selectedDescriptions){cues=this.selectedDescriptions.cues}else if(this.descriptions.length>=1){cues=this.descriptions[0].cues}else{cues=[]}
for(d=0;d<cues.length;d++){if((cues[d].start<=now)&&(cues[d].end>now)){thisDescription=d;break}}
if(typeof thisDescription!=='undefined'){if(this.currentDescription!==thisDescription){this.$status.removeAttr('aria-live');descText=flattenComponentForDescription(cues[thisDescription].components);if(this.exposeTextDescriptions&&typeof this.synth!=='undefined'&&typeof this.descVoiceIndex!=='undefined'){msg=new SpeechSynthesisUtterance();msg.voice=this.descVoices[this.descVoiceIndex];msg.voiceURI='native';msg.volume=1;msg.rate=1.5;msg.pitch=1;msg.text=descText;msg.lang=this.captionLang;msg.onend=function(e){if(thisObj.pausedForDescription){thisObj.playMedia()}};this.synth.speak(msg);if(this.prefVisibleDesc){this.$descDiv.html(descText).removeAttr('aria-live aria-atomic')}}else{this.$descDiv.html(descText)}
if(this.prefDescPause&&this.exposeTextDescriptions){this.pauseMedia();this.pausedForDescription=!0}
this.currentDescription=thisDescription}}else{this.$descDiv.html('');this.currentDescription=-1;this.$status.attr('aria-live','polite')}}})(jQuery);(function($){AblePlayer.prototype.getUserAgent=function(){this.userAgent={};this.userAgent.browser={};if(/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){this.userAgent.browser.name='Firefox';this.userAgent.browser.version=RegExp.$1}else if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){this.userAgent.browser.name='Internet Explorer';this.userAgent.browser.version=RegExp.$1}else if(/Trident.*rv[ :]*(\d+\.\d+)/.test(navigator.userAgent)){this.userAgent.browser.name='Internet Explorer';this.userAgent.browser.version=RegExp.$1}else if(/Edge[\/\s](\d+\.\d+)/.test(navigator.userAgent)){this.userAgent.browser.name='Edge';this.userAgent.browser.version=RegExp.$1}else if(/OPR\/(\d+\.\d+)/i.test(navigator.userAgent)){this.userAgent.browser.name='Opera';this.userAgent.browser.version=RegExp.$1}else if(/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)){this.userAgent.browser.name='Chrome';if(/Chrome[\/\s](\d+\.\d+)/.test(navigator.userAgent)){this.userAgent.browser.version=RegExp.$1}}else if(/Safari/.test(navigator.userAgent)&&/Apple Computer/.test(navigator.vendor)){this.userAgent.browser.name='Safari';if(/Version[\/\s](\d+\.\d+)/.test(navigator.userAgent)){this.userAgent.browser.version=RegExp.$1}}else{this.userAgent.browser.name='Unknown';this.userAgent.browser.version='Unknown'}
if(window.navigator.userAgent.indexOf("Windows NT 6.2")!=-1){this.userAgent.os="Windows 8"}else if(window.navigator.userAgent.indexOf("Windows NT 6.1")!=-1){this.userAgent.os="Windows 7"}else if(window.navigator.userAgent.indexOf("Windows NT 6.0")!=-1){this.userAgent.os="Windows Vista"}else if(window.navigator.userAgent.indexOf("Windows NT 5.1")!=-1){this.userAgent.os="Windows XP"}else if(window.navigator.userAgent.indexOf("Windows NT 5.0")!=-1){this.userAgent.os="Windows 2000"}else if(window.navigator.userAgent.indexOf("Mac")!=-1){this.userAgent.os="Mac/iOS"}else if(window.navigator.userAgent.indexOf("X11")!=-1){this.userAgent.os="UNIX"}else if(window.navigator.userAgent.indexOf("Linux")!=-1){this.userAgent.os="Linux"}
if(this.debug){console.log('User agent:'+navigator.userAgent);console.log('Vendor: '+navigator.vendor);console.log('Browser: '+this.userAgent.browser.name);console.log('Version: '+this.userAgent.browser.version);console.log('OS: '+this.userAgent.os)}};AblePlayer.prototype.isUserAgent=function(which){var userAgent=navigator.userAgent.toLowerCase();if(this.debug){console.log('User agent: '+userAgent)}
if(userAgent.indexOf(which.toLowerCase())!==-1){return!0}else{return!1}};AblePlayer.prototype.isIOS=function(version){var userAgent,iOS;userAgent=navigator.userAgent.toLowerCase();iOS=/ipad|iphone|ipod/.exec(userAgent);if(iOS){if(typeof version!=='undefined'){if(userAgent.indexOf('os '+version)!==-1){return!0}else{return!1}}else{return!0}}else{return!1}};AblePlayer.prototype.browserSupportsVolume=function(){var userAgent,noVolume;userAgent=navigator.userAgent.toLowerCase();noVolume=/ipad|iphone|ipod|android|blackberry|windows ce|windows phone|webos|playbook/.exec(userAgent);if(noVolume){if(noVolume[0]==='android'&&/firefox/.test(userAgent)){return!0}else{return!1}}else{return!0}};AblePlayer.prototype.nativeFullscreenSupported=function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled}})(jQuery);(function($){AblePlayer.prototype.seekTo=function(newTime){var thisObj=this;this.seekFromTime=this.media.currentTime;this.seekToTime=newTime;this.seeking=!0;this.liveUpdatePending=!0;if(this.player==='html5'){var seekable;this.startTime=newTime;seekable=this.media.seekable;if(seekable.length>0&&this.startTime>=seekable.start(0)&&this.startTime<=seekable.end(0)){this.media.currentTime=this.startTime;if(this.hasSignLanguage&&this.signVideo){this.signVideo.currentTime=this.startTime}}}else if(this.player==='youtube'){this.youTubePlayer.seekTo(newTime,!0);if(newTime>0){if(typeof this.$posterImg!=='undefined'){this.$posterImg.hide()}}}else if(this.player==='vimeo'){this.vimeoPlayer.setCurrentTime(newTime).then(function(){thisObj.elapsed=newTime;thisObj.refreshControls('timeline')})}
this.refreshControls('timeline')};AblePlayer.prototype.getMediaTimes=function(duration,elapsed){var deferred,promise,thisObj,mediaTimes;mediaTimes={};deferred=new $.Deferred();promise=deferred.promise();thisObj=this;if(typeof duration!=='undefined'&&typeof elapsed!=='undefined'){mediaTimes.duration=duration;mediaTimes.elapsed=elapsed;deferred.resolve(mediaTimes)}else{this.getDuration().then(function(duration){mediaTimes.duration=thisObj.roundDown(duration,6);thisObj.getElapsed().then(function(elapsed){mediaTimes.elapsed=thisObj.roundDown(elapsed,6);deferred.resolve(mediaTimes)})})}
return promise};AblePlayer.prototype.getDuration=function(){var deferred,promise,thisObj;deferred=new $.Deferred();promise=deferred.promise();thisObj=this;if(this.player==='vimeo'){if(this.vimeoPlayer){this.vimeoPlayer.getDuration().then(function(duration){if(duration===undefined||isNaN(duration)||duration===-1){deferred.resolve(0)}else{deferred.resolve(duration)}})}else{deferred.resolve(0)}}else{var duration;if(this.player==='html5'){duration=this.media.duration}else if(this.player==='youtube'){if(this.youTubePlayer){duration=this.youTubePlayer.getDuration()}else{duration=0}}
if(duration===undefined||isNaN(duration)||duration===-1){deferred.resolve(0)}else{deferred.resolve(duration)}}
return promise};AblePlayer.prototype.getElapsed=function(){var deferred,promise,thisObj;deferred=new $.Deferred();promise=deferred.promise();thisObj=this;if(this.player==='vimeo'){if(this.vimeoPlayer){this.vimeoPlayer.getCurrentTime().then(function(elapsed){if(elapsed===undefined||isNaN(elapsed)||elapsed===-1){deferred.resolve(0)}else{deferred.resolve(elapsed)}})}else{deferred.resolve(0)}}else{var elapsed;if(this.player==='html5'){elapsed=this.media.currentTime}else if(this.player==='youtube'){if(this.youTubePlayer){elapsed=this.youTubePlayer.getCurrentTime()}else{elapsed=0}}
if(elapsed===undefined||isNaN(elapsed)||elapsed===-1){deferred.resolve(0)}else{deferred.resolve(elapsed)}}
return promise};AblePlayer.prototype.getPlayerState=function(){var deferred,promise,thisObj,duration,elapsed;deferred=new $.Deferred();promise=deferred.promise();thisObj=this;if(this.player==='html5'){if(this.media.ended){deferred.resolve('ended')}else if(this.media.paused){deferred.resolve('paused')}else if(this.media.readyState!==4){deferred.resolve('buffering')}else{deferred.resolve('playing')}}else if(this.player==='youtube'&&this.youTubePlayer){var state=this.youTubePlayer.getPlayerState();if(state===-1||state===5){deferred.resolve('stopped')}else if(state===0){deferred.resolve('ended')}else if(state===1){deferred.resolve('playing')}else if(state===2){deferred.resolve('paused')}else if(state===3){deferred.resolve('buffering')}}else if(this.player==='vimeo'&&this.vimeoPlayer){this.vimeoPlayer.getPaused().then(function(paused){if(paused){deferred.resolve('paused')}else{thisObj.vimeoPlayer.getEnded().then(function(ended){if(ended){deferred.resolve('ended')}else{deferred.resolve('playing')}})}})}
return promise};AblePlayer.prototype.isPlaybackRateSupported=function(){if(this.player==='html5'){if(this.media.playbackRate){return!0}else{return!1}}else if(this.player==='youtube'){if(this.youTubePlayer.getAvailablePlaybackRates().length>1){return!0}else{return!1}}else if(this.player==='vimeo'){return this.vimeoSupportsPlaybackRateChange}};AblePlayer.prototype.setPlaybackRate=function(rate){rate=Math.max(0.5,rate);if(this.player==='html5'){this.media.playbackRate=rate}else if(this.player==='youtube'){this.youTubePlayer.setPlaybackRate(rate)}else if(this.player==='vimeo'){this.vimeoPlayer.setPlaybackRate(rate)}
if(this.hasSignLanguage&&this.signVideo){this.signVideo.playbackRate=rate}
this.playbackRate=rate;this.$speed.text(this.tt.speed+': '+rate.toFixed(2).toString()+'x')};AblePlayer.prototype.getPlaybackRate=function(){if(this.player==='html5'){return this.media.playbackRate}else if(this.player==='youtube'){return this.youTubePlayer.getPlaybackRate()}};AblePlayer.prototype.isPaused=function(){var state;if(this.player==='vimeo'){if(this.playing){return!1}else{return!0}}else{this.getPlayerState().then(function(state){return state==='paused'||state==='stopped'||state==='ended'})}};AblePlayer.prototype.pauseMedia=function(){var thisObj=this;if(this.player==='html5'){this.media.pause(!0);if(this.hasSignLanguage&&this.signVideo){this.signVideo.pause(!0)}}else if(this.player==='youtube'){this.youTubePlayer.pauseVideo()}else if(this.player==='vimeo'){this.vimeoPlayer.pause()}};AblePlayer.prototype.playMedia=function(){var thisObj=this;if(this.player==='html5'){this.media.play(!0);if(this.hasSignLanguage&&this.signVideo){this.signVideo.play(!0)}}else if(this.player==='youtube'){this.youTubePlayer.playVideo();if(typeof this.$posterImg!=='undefined'){this.$posterImg.hide()}
this.stoppingYouTube=!1}else if(this.player==='vimeo'){this.vimeoPlayer.play()}
this.startedPlaying=!0;if(this.hideControls){this.hidingControls=!0;this.invokeHideControlsTimeout()}};AblePlayer.prototype.fadeControls=function(direction){var thisObj,mediaHeight,playerHeight,newMediaHeight;var thisObj=this;if(direction=='out'){mediaHeight=this.$mediaContainer.height();playerHeight=this.$playerDiv.height();newMediaHeight=mediaHeight+playerHeight;this.$playerDiv.fadeTo(2000,0,function(){})}else if(direction=='in'){this.$playerDiv.fadeTo(100,1)}};AblePlayer.prototype.invokeHideControlsTimeout=function(){var thisObj=this;this.hideControlsTimeout=window.setTimeout(function(){if(typeof thisObj.playing!=='undefined'&&thisObj.playing===!0&&thisObj.hideControls){thisObj.fadeControls('out');thisObj.controlsHidden=!0}},5000);this.hideControlsTimeoutStatus='active'};AblePlayer.prototype.refreshControls=function(context,duration,elapsed){context='init';var thisObj,duration,elapsed,lastChapterIndex,displayElapsed,updateLive,textByState,timestamp,widthUsed,leftControls,rightControls,seekbarWidth,seekbarSpacer,captionsCount,buffered,newTop,statusBarHeight,speedHeight,statusBarWidthBreakpoint,newSvgData;thisObj=this;if(this.swappingSrc){if(this.playing){return}}
if(context==='timeline'||context==='init'){if(typeof this.duration==='undefined'){return}
if(this.useChapterTimes){this.chapterDuration=this.getChapterDuration();this.chapterElapsed=this.getChapterElapsed()}
if(this.useFixedSeekInterval===!1&&this.seekIntervalCalculated===!1&&this.duration>0){this.setSeekInterval()}
if(this.seekBar){if(this.useChapterTimes){lastChapterIndex=this.selectedChapters.cues.length-1;if(this.selectedChapters.cues[lastChapterIndex]==this.currentChapter){if(this.currentChapter.end!==this.duration){this.seekBar.setDuration(this.duration-this.currentChapter.start)}else{this.seekBar.setDuration(this.chapterDuration)}}else{this.seekBar.setDuration(this.chapterDuration)}}else{if(!(this.duration===undefined||isNaN(this.duration)||this.duration===-1)){this.seekBar.setDuration(this.duration)}}
if(!(this.seekBar.tracking)){updateLive=this.liveUpdatePending||this.seekBar.seekHead.is($(document.activeElement));this.liveUpdatePending=!1;if(this.useChapterTimes){this.seekBar.setPosition(this.chapterElapsed,updateLive)}else{this.seekBar.setPosition(this.elapsed,updateLive)}}
if(this.seekBar.tracking){displayElapsed=this.seekBar.lastTrackPosition}else{if(this.useChapterTimes){displayElapsed=this.chapterElapsed}else{displayElapsed=this.elapsed}}}
if(typeof this.$durationContainer!=='undefined'){if(this.useChapterTimes){this.$durationContainer.text(' / '+this.formatSecondsAsColonTime(this.chapterDuration))}else{this.$durationContainer.text(' / '+this.formatSecondsAsColonTime(this.duration))}}
if(typeof this.$elapsedTimeContainer!=='undefined'){this.$elapsedTimeContainer.text(this.formatSecondsAsColonTime(displayElapsed))}
if(this.skin==='legacy'){if(this.seekBar){widthUsed=0;leftControls=this.seekBar.wrapperDiv.parent().prev('div.able-left-controls');rightControls=leftControls.next('div.able-right-controls');leftControls.children().each(function(){if($(this).attr('role')=='button'){widthUsed+=$(this).outerWidth(!0)}});rightControls.children().each(function(){if($(this).attr('role')=='button'){widthUsed+=$(this).outerWidth(!0)}});if(this.fullscreen){seekbarWidth=$(window).width()-widthUsed}else{seekbarWidth=this.$ableWrapper.width()-widthUsed}
if(Math.abs(seekbarWidth-this.seekBar.getWidth())>5){this.seekBar.setWidth(seekbarWidth)}}}
if(this.player==='html5'){if(this.media.buffered.length>0){buffered=this.media.buffered.end(0);if(this.useChapterTimes){if(buffered>this.chapterDuration){buffered=this.chapterDuration}
if(this.seekBar){this.seekBar.setBuffered(buffered/this.chapterDuration)}}else{if(this.seekBar){if(!isNaN(buffered)){this.seekBar.setBuffered(buffered/duration)}}}}}else if(this.player==='youtube'){if(this.seekBar){this.seekBar.setBuffered(this.youTubePlayer.getVideoLoadedFraction())}}else if(this.player==='vimeo'){}}
if(context==='descriptions'||context=='init'){if(this.$descButton){if(this.descOn){this.$descButton.removeClass('buttonOff').attr('aria-label',this.tt.turnOffDescriptions);this.$descButton.find('span.able-clipped').text(this.tt.turnOffDescriptions)}else{this.$descButton.addClass('buttonOff').attr('aria-label',this.tt.turnOnDescriptions);this.$descButton.find('span.able-clipped').text(this.tt.turnOnDescriptions)}}}
if(context==='captions'||context=='init'){if(this.$ccButton){captionsCount=this.captions.length;if(!this.captionsOn){this.$ccButton.addClass('buttonOff');if(captionsCount===1){this.$ccButton.attr('aria-label',this.tt.showCaptions);this.$ccButton.find('span.able-clipped').text(this.tt.showCaptions)}}else{this.$ccButton.removeClass('buttonOff');if(captionsCount===1){this.$ccButton.attr('aria-label',this.tt.hideCaptions);this.$ccButton.find('span.able-clipped').text(this.tt.hideCaptions)}}
if(captionsCount>1){this.$ccButton.attr({'aria-label':this.tt.captions,'aria-haspopup':'true','aria-controls':this.mediaId+'-captions-menu'});this.$ccButton.find('span.able-clipped').text(this.tt.captions)}}}
if(context==='fullscreen'||context=='init'){if(this.$fullscreenButton){if(!this.fullscreen){this.$fullscreenButton.attr('aria-label',this.tt.enterFullScreen);if(this.iconType==='font'){this.$fullscreenButton.find('span').first().removeClass('icon-fullscreen-collapse').addClass('icon-fullscreen-expand');this.$fullscreenButton.find('span.able-clipped').text(this.tt.enterFullScreen)}else if(this.iconType==='svg'){newSvgData=this.getSvgData('fullscreen-expand');this.$fullscreenButton.find('svg').attr('viewBox',newSvgData[0]);this.$fullscreenButton.find('path').attr('d',newSvgData[1])}else{this.$fullscreenButton.find('img').attr('src',this.fullscreenExpandButtonImg)}}else{this.$fullscreenButton.attr('aria-label',this.tt.exitFullScreen);if(this.iconType==='font'){this.$fullscreenButton.find('span').first().removeClass('icon-fullscreen-expand').addClass('icon-fullscreen-collapse');this.$fullscreenButton.find('span.able-clipped').text(this.tt.exitFullScreen)}else if(this.iconType==='svg'){newSvgData=this.getSvgData('fullscreen-collapse');this.$fullscreenButton.find('svg').attr('viewBox',newSvgData[0]);this.$fullscreenButton.find('path').attr('d',newSvgData[1])}else{this.$fullscreenButton.find('img').attr('src',this.fullscreenCollapseButtonImg)}}}}
if(context==='playpause'||context=='init'){if(typeof this.$bigPlayButton!=='undefined'&&typeof this.seekBar!=='undefined'){if(this.paused&&!this.seekBar.tracking){if(!this.hideBigPlayButton){this.$bigPlayButton.show()}
if(this.fullscreen){this.$bigPlayButton.width($(window).width());this.$bigPlayButton.height($(window).height())}else{this.$bigPlayButton.width(this.$mediaContainer.width());this.$bigPlayButton.height(this.$mediaContainer.height())}}else{this.$bigPlayButton.hide()}}}
if(context==='transcript'||context=='init'){if(this.transcriptType){if(this.prefAutoScrollTranscript===1){this.autoScrollTranscript=!0;this.$autoScrollTranscriptCheckbox.prop('checked',!0)}else{this.autoScrollTranscript=!1;this.$autoScrollTranscriptCheckbox.prop('checked',!1)}
if(this.autoScrollTranscript&&this.currentHighlight){newTop=Math.floor(this.$transcriptDiv.scrollTop()+$(this.currentHighlight).position().top-(this.$transcriptDiv.height()/2)+($(this.currentHighlight).height()/2));if(newTop!==Math.floor(this.$transcriptDiv.scrollTop())){this.scrollingTranscript=!0;if(this.movingHighlight){this.$transcriptDiv.scrollTop(newTop);this.movingHighlight=!1}}}}}
if(context==='init'){if(this.$chaptersButton){this.$chaptersButton.attr({'aria-label':this.tt.chapters,'aria-haspopup':'true','aria-controls':this.mediaId+'-chapters-menu'})}}
if(context==='timeline'||context==='playpause'||context==='init'){textByState={'stopped':this.tt.statusStopped,'paused':this.tt.statusPaused,'playing':this.tt.statusPlaying,'buffering':this.tt.statusBuffering,'ended':this.tt.statusEnd};if(this.stoppingYouTube){if(this.$status.text()!==this.tt.statusStopped){this.$status.text(this.tt.statusStopped)}
if(this.$playpauseButton.find('span').first().hasClass('icon-pause')){if(this.iconType==='font'){this.$playpauseButton.find('span').first().removeClass('icon-pause').addClass('icon-play');this.$playpauseButton.find('span.able-clipped').text(this.tt.play)}else if(this.iconType==='svg'){newSvgData=this.getSvgData('play');this.$playpauseButton.find('svg').attr('viewBox',newSvgData[0]);this.$playpauseButton.find('path').attr('d',newSvgData[1])}else{this.$playpauseButton.find('img').attr('src',this.playButtonImg)}}}else{if(typeof this.$status!=='undefined'&&typeof this.seekBar!=='undefined'){this.getPlayerState().then(function(currentState){if(thisObj.$status.text()!==textByState[currentState]&&!thisObj.seekBar.tracking){if(thisObj.swappingSrc){if(!thisObj.debouncingStatus){thisObj.statusMessageThreshold=2000}}else{if(!thisObj.debouncingStatus){thisObj.statusMessageThreshold=250}}
timestamp=(new Date()).getTime();if(!thisObj.statusDebounceStart){thisObj.statusDebounceStart=timestamp;thisObj.debouncingStatus=!0;thisObj.statusTimeout=setTimeout(function(){thisObj.debouncingStatus=!1;thisObj.refreshControls(context)},thisObj.statusMessageThreshold)}else if((timestamp-thisObj.statusDebounceStart)>thisObj.statusMessageThreshold){thisObj.$status.text(textByState[currentState]);thisObj.statusDebounceStart=null;clearTimeout(thisObj.statusTimeout);thisObj.statusTimeout=null}}else{thisObj.statusDebounceStart=null;thisObj.debouncingStatus=!1;clearTimeout(thisObj.statusTimeout);thisObj.statusTimeout=null}
if(!thisObj.seekBar.tracking&&!thisObj.stoppingYouTube){if(currentState==='paused'||currentState==='stopped'||currentState==='ended'){thisObj.$playpauseButton.attr('aria-label',thisObj.tt.play);if(thisObj.iconType==='font'){thisObj.$playpauseButton.find('span').first().removeClass('icon-pause').addClass('icon-play');thisObj.$playpauseButton.find('span.able-clipped').text(thisObj.tt.play)}else if(thisObj.iconType==='svg'){newSvgData=thisObj.getSvgData('play');thisObj.$playpauseButton.find('svg').attr('viewBox',newSvgData[0]);thisObj.$playpauseButton.find('path').attr('d',newSvgData[1])}else{thisObj.$playpauseButton.find('img').attr('src',thisObj.playButtonImg)}}else{thisObj.$playpauseButton.attr('aria-label',thisObj.tt.pause);if(thisObj.iconType==='font'){thisObj.$playpauseButton.find('span').first().removeClass('icon-play').addClass('icon-pause');thisObj.$playpauseButton.find('span.able-clipped').text(thisObj.tt.pause)}else if(thisObj.iconType==='svg'){newSvgData=thisObj.getSvgData('pause');thisObj.$playpauseButton.find('svg').attr('viewBox',newSvgData[0]);thisObj.$playpauseButton.find('path').attr('d',newSvgData[1])}else{thisObj.$playpauseButton.find('img').attr('src',thisObj.pauseButtonImg)}}}})}}}
if(!this.fullscreen){statusBarWidthBreakpoint=300;statusBarHeight=this.$statusBarDiv.height();speedHeight=this.$statusBarDiv.find('span.able-speed').height();if(speedHeight>(statusBarHeight+5)){this.$statusBarDiv.find('span.able-speed').hide();this.hidingSpeed=!0}else{if(this.hidingSpeed){this.$statusBarDiv.find('span.able-speed').show();this.hidingSpeed=!1}
if(this.$statusBarDiv.width()<statusBarWidthBreakpoint){this.$statusBarDiv.find('span.able-speed').hide();this.hidingSpeed=!0}else{if(this.hidingSpeed){this.$statusBarDiv.find('span.able-speed').show();this.hidingSpeed=!1}}}}};AblePlayer.prototype.getHiddenWidth=function($el){var $hiddenElement=$el.clone().appendTo('body');var width=$hiddenElement.outerWidth();$hiddenElement.remove();return width};AblePlayer.prototype.handlePlay=function(e){if(this.paused){this.playMedia()}else{this.pauseMedia()}};AblePlayer.prototype.handleRestart=function(){this.seekTo(0)};AblePlayer.prototype.handlePrevTrack=function(){if(this.playlistIndex===0){this.playlistIndex=this.$playlist.length-1}else{this.playlistIndex--}
this.cueingPlaylistItem=!0;this.cuePlaylistItem(this.playlistIndex)};AblePlayer.prototype.handleNextTrack=function(){if(this.playlistIndex===this.$playlist.length-1){this.playlistIndex=0}else{this.playlistIndex++}
this.cueingPlaylistItem=!0;this.cuePlaylistItem(this.playlistIndex)};AblePlayer.prototype.handleRewind=function(){var targetTime;targetTime=this.elapsed-this.seekInterval;if(this.useChapterTimes){if(targetTime<this.currentChapter.start){targetTime=this.currentChapter.start}}else{if(targetTime<0){targetTime=0}}
this.seekTo(targetTime)};AblePlayer.prototype.handleFastForward=function(){var targetTime,lastChapterIndex;lastChapterIndex=this.chapters.length-1;targetTime=this.elapsed+this.seekInterval;if(this.useChapterTimes){if(this.chapters[lastChapterIndex]==this.currentChapter){if(targetTime>this.duration||targetTime>this.currentChapter.end){targetTime=Math.min(this.duration,this.currentChapter.end)}else if(this.duration%targetTime<this.seekInterval){targetTime=Math.min(this.duration,this.currentChapter.end)}}else{if(targetTime>this.currentChapter.end){targetTime=this.currentChapter.end}}}else{if(targetTime>this.duration){targetTime=this.duration}}
this.seekTo(targetTime)};AblePlayer.prototype.handleRateIncrease=function(){this.changeRate(1)};AblePlayer.prototype.handleRateDecrease=function(){this.changeRate(-1)};AblePlayer.prototype.changeRate=function(dir){var rates,currentRate,index,newRate,vimeoMin,vimeoMax;if(this.player==='html5'){this.setPlaybackRate(this.getPlaybackRate()+(0.25*dir))}else if(this.player==='youtube'){rates=this.youTubePlayer.getAvailablePlaybackRates();currentRate=this.getPlaybackRate();index=rates.indexOf(currentRate);if(index===-1){console.log('ERROR: Youtube returning unknown playback rate '+currentRate.toString())}else{index+=dir;if(index<rates.length&&index>=0){this.setPlaybackRate(rates[index])}}}else if(this.player==='vimeo'){vimeoMin=0.5;vimeoMax=2;if(dir===1){if(this.vimeoPlaybackRate+0.5<=vimeoMax){newRate=this.vimeoPlaybackRate+0.5}else{newRate=vimeoMax}}else if(dir===-1){if(this.vimeoPlaybackRate-0.5>=vimeoMin){newRate=this.vimeoPlaybackRate-0.5}else{newRate=vimeoMin}}
this.setPlaybackRate(newRate)}};AblePlayer.prototype.handleCaptionToggle=function(){var captions;if(this.hidingPopup){this.hidingPopup=!1;return!1}
if(this.captions.length){captions=this.captions}else{captions=[]}
if(captions.length===1){if(this.captionsOn===!0){this.captionsOn=!1;this.prefCaptions=0;this.updateCookie('prefCaptions');if(this.usingYouTubeCaptions){this.youTubePlayer.unloadModule(this.ytCaptionModule)}else{this.$captionsWrapper.hide()}}else{this.captionsOn=!0;this.prefCaptions=1;this.updateCookie('prefCaptions');if(this.usingYouTubeCaptions){if(typeof this.ytCaptionModule!=='undefined'){this.youTubePlayer.loadModule(this.ytCaptionModule)}}else{this.$captionsWrapper.show()}
for(var i=0;i<captions.length;i++){if(captions[i].def===!0){this.selectedCaptions=captions[i]}}
this.selectedCaptions=this.captions[0];if(this.descriptions.length>=0){this.selectedDescriptions=this.descriptions[0]}}
this.refreshControls('captions')}else{if(this.captionsPopup&&this.captionsPopup.is(':visible')){this.captionsPopup.hide();this.hidingPopup=!1;this.$ccButton.removeAttr('aria-expanded').focus()}else{this.closePopups();if(this.captionsPopup){this.captionsPopup.show();this.$ccButton.attr('aria-expanded','true');this.captionsPopup.css('top',this.$ccButton.position().top-this.captionsPopup.outerHeight());this.captionsPopup.css('left',this.$ccButton.position().left)
this.captionsPopup.find('li').removeClass('able-focus');this.captionsPopup.find('li').first().focus().addClass('able-focus')}}}};AblePlayer.prototype.handleChapters=function(){if(this.hidingPopup){this.hidingPopup=!1;return!1}
if(this.chaptersPopup.is(':visible')){this.chaptersPopup.hide();this.hidingPopup=!1;this.$chaptersButton.removeAttr('aria-expanded').focus()}else{this.closePopups();this.chaptersPopup.show();this.$chaptersButton.attr('aria-expanded','true');this.chaptersPopup.css('top',this.$chaptersButton.position().top-this.chaptersPopup.outerHeight());this.chaptersPopup.css('left',this.$chaptersButton.position().left)
this.chaptersPopup.find('li').removeClass('able-focus');if(this.chaptersPopup.find('li[aria-checked="true"]').length){this.chaptersPopup.find('li[aria-checked="true"]').focus().addClass('able-focus')}else{this.chaptersPopup.find('li').first().addClass('able-focus').attr('aria-checked','true').focus()}}};AblePlayer.prototype.handleDescriptionToggle=function(){this.descOn=!this.descOn;this.prefDesc=+this.descOn;this.updateCookie('prefDesc');if(!this.$descDiv.is(':hidden')){this.$descDiv.hide()}
this.refreshingDesc=!0;this.initDescription();this.refreshControls('descriptions')};AblePlayer.prototype.handlePrefsClick=function(pref){var thisObj,prefsButtonPosition,prefsMenuRight,prefsMenuLeft;thisObj=this;if(this.hidingPopup){this.hidingPopup=!1;return!1}
if(this.prefsPopup.is(':visible')){this.prefsPopup.hide();this.$prefsButton.removeAttr('aria-expanded');this.prefsPopup.find('li').removeClass('able-focus').attr('tabindex','-1');if(!this.showingPrefsDialog){this.$prefsButton.focus()}
setTimeout(function(){thisObj.hidingPopup=!1},100)}else{this.closePopups();this.prefsPopup.show();this.$prefsButton.attr('aria-expanded','true');prefsButtonPosition=this.$prefsButton.position();prefsMenuRight=this.$ableDiv.width()-5;prefsMenuLeft=prefsMenuRight-this.prefsPopup.width();this.prefsPopup.css('top',prefsButtonPosition.top-this.prefsPopup.outerHeight());this.prefsPopup.css('left',prefsMenuLeft);this.prefsPopup.find('li').removeClass('able-focus').attr('tabindex','0');this.prefsPopup.find('li').first().focus().addClass('able-focus')}};AblePlayer.prototype.handleHelpClick=function(){this.setFullscreen(!1);this.helpDialog.show()};AblePlayer.prototype.handleTranscriptToggle=function(){var thisObj=this;if(this.$transcriptDiv.is(':visible')){this.$transcriptArea.hide();this.$transcriptButton.addClass('buttonOff').attr('aria-label',this.tt.showTranscript);this.$transcriptButton.find('span.able-clipped').text(this.tt.showTranscript);this.prefTranscript=0;this.$transcriptButton.focus().addClass('able-focus');setTimeout(function(){thisObj.closingTranscript=!1},100)}else{this.positionDraggableWindow('transcript');this.$transcriptArea.show();this.$transcriptPopup.hide();this.$transcriptButton.removeClass('buttonOff').attr('aria-label',this.tt.hideTranscript);this.$transcriptButton.find('span.able-clipped').text(this.tt.hideTranscript);this.prefTranscript=1;this.focusNotClick=!0;this.$transcriptArea.find('button').first().focus();setTimeout(function(){thisObj.focusNotClick=!1},100)}
this.updateCookie('prefTranscript')};AblePlayer.prototype.handleSignToggle=function(){var thisObj=this;if(this.$signWindow.is(':visible')){this.$signWindow.hide();this.$signButton.addClass('buttonOff').attr('aria-label',this.tt.showSign);this.$signButton.find('span.able-clipped').text(this.tt.showSign);this.prefSign=0;this.$signButton.focus().addClass('able-focus');setTimeout(function(){thisObj.closingSign=!1},100)}else{this.positionDraggableWindow('sign');this.$signWindow.show();this.$signPopup.hide();this.$signButton.removeClass('buttonOff').attr('aria-label',this.tt.hideSign);this.$signButton.find('span.able-clipped').text(this.tt.hideSign);this.prefSign=1;this.focusNotClick=!0;this.$signWindow.find('button').first().focus();setTimeout(function(){thisObj.focusNotClick=!1},100)}
this.updateCookie('prefSign')};AblePlayer.prototype.isFullscreen=function(){if(this.nativeFullscreenSupported()){return(document.fullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement||document.mozFullScreenElement||document.msFullscreenElement)?!0:!1}else{return this.modalFullscreenActive?!0:!1}}
AblePlayer.prototype.setFullscreen=function(fullscreen){if(this.fullscreen==fullscreen){return}
var thisObj=this;var $el=this.$ableWrapper;var el=$el[0];if(this.nativeFullscreenSupported()){if(fullscreen){this.preFullScreenWidth=this.$ableWrapper.width();this.preFullScreenHeight=this.$ableWrapper.height();if(el.requestFullscreen){el.requestFullscreen()}else if(el.webkitRequestFullscreen){el.webkitRequestFullscreen()}else if(el.mozRequestFullScreen){el.mozRequestFullScreen()}else if(el.msRequestFullscreen){el.msRequestFullscreen()}
this.fullscreen=!0}else{if(document.exitFullscreen){document.exitFullscreen()}else if(document.webkitExitFullscreen){document.webkitExitFullscreen()}else if(document.webkitCancelFullScreen){document.webkitCancelFullScreen()}else if(document.mozCancelFullScreen){document.mozCancelFullScreen()}else if(document.msExitFullscreen){document.msExitFullscreen()}
this.fullscreen=!1}
$(document).on('webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange',function(e){if(!thisObj.fullscreen){thisObj.restoringAfterFullScreen=!0;thisObj.resizePlayer(thisObj.preFullScreenWidth,thisObj.preFullScreenHeight)}else if(!thisObj.clickedFullscreenButton){thisObj.fullscreen=!1;thisObj.restoringAfterFullScreen=!0;thisObj.resizePlayer(thisObj.preFullScreenWidth,thisObj.preFullScreenHeight)}
setTimeout(function(){thisObj.clickedFullscreenButton=!1},1000)})}else{if(!this.fullscreenDialog){var $dialogDiv=$('<div>');var $fsDialogAlert=$('<p>',{'class':'able-screenreader-alert'}).text(this.tt.fullscreen);$dialogDiv.append($fsDialogAlert);this.fullscreenDialog=new AccessibleDialog($dialogDiv,this.$fullscreenButton,'dialog','Fullscreen video player',$fsDialogAlert,this.tt.exitFullScreen,'100%',!0,function(){thisObj.handleFullscreenToggle()});$('body').append($dialogDiv)}
var wasPaused=this.paused;if(fullscreen){this.modalFullscreenActive=!0;this.fullscreenDialog.show();this.$modalFullscreenPlaceholder=$('<div class="placeholder">');this.$modalFullscreenPlaceholder.insertAfter($el);$el.appendTo(this.fullscreenDialog.modal);if($el===this.$ableColumnLeft){$el.width('100%')}
var newHeight=$(window).height()-this.$playerDiv.height();if(!this.$descDiv.is(':hidden')){newHeight-=this.$descDiv.height()}
this.resizePlayer($(window).width(),newHeight)}else{this.modalFullscreenActive=!1;if($el===this.$ableColumnLeft){$el.width('50%')}
$el.insertAfter(this.$modalFullscreenPlaceholder);this.$modalFullscreenPlaceholder.remove();this.fullscreenDialog.hide();this.resizePlayer(this.$ableWrapper.width(),this.$ableWrapper.height())}
if(!wasPaused&&this.paused){this.playMedia()}}
this.refreshControls('fullscreen')};AblePlayer.prototype.handleFullscreenToggle=function(){var stillPaused=this.paused;this.setFullscreen(!this.fullscreen);if(stillPaused){this.pauseMedia()}else if(!stillPaused){this.playMedia()}
if(this.fullscreen){this.hideControls=!0;if(this.playing){this.fadeControls('out');this.controlsHidden=!0}}else{this.hideControls=this.hideControlsOriginal;if(!this.hideControls){if(this.controlsHidden){this.fadeControls('in');this.controlsHidden=!1}
if(this.hideControlsTimeoutStatus==='active'){window.clearTimeout(this.hideControlsTimeout);this.hideControlsTimeoutStatus='clear'}}}};AblePlayer.prototype.handleTranscriptLockToggle=function(val){this.autoScrollTranscript=val;this.prefAutoScrollTranscript=+val;this.updateCookie('prefAutoScrollTranscript');this.refreshControls('transcript')};AblePlayer.prototype.showTooltip=function($tooltip){if(($tooltip).is(':animated')){$tooltip.stop(!0,!0).show().delay(4000).fadeOut(1000)}else{$tooltip.stop().show().delay(4000).fadeOut(1000)}};AblePlayer.prototype.showAlert=function(msg,location){var thisObj,$alertBox,$parentWindow,alertLeft,alertTop;thisObj=this;if(location==='transcript'){$alertBox=this.$transcriptAlert;$parentWindow=this.$transcriptArea}else if(location==='sign'){$alertBox=this.$signAlert;$parentWindow=this.$signWindow}else if(location==='screenreader'){$alertBox=this.$srAlertBox}else{$alertBox=this.$alertBox}
$alertBox.text(msg).show();if(location=='transcript'||location==='sign'){if($parentWindow.width()>$alertBox.width()){alertLeft=$parentWindow.width()/2-$alertBox.width()/2}else{alertLeft=10}
if(location==='sign'){alertTop=($parentWindow.height()/3)*2}else if(location==='transcript'){alertTop=this.$transcriptToolbar.height()+30}
$alertBox.css({top:alertTop+'px',left:alertLeft+'px'})}else if(location!=='screenreader'){$alertBox.css({left:(this.$playerDiv.width()/2)-($alertBox.width()/2)})}
if(location!=='screenreader'){setTimeout(function(){$alertBox.fadeOut(300)},3000)}};AblePlayer.prototype.showedAlert=function(which){if(which==='transcript'){if(this.showedTranscriptAlert){return!0}else{return!1}}else if(which==='sign'){if(this.showedSignAlert){return!0}else{return!1}}
return!1}
AblePlayer.prototype.resizePlayer=function(width,height){var captionSizeOkMin,captionSizeOkMax,captionSize,newCaptionSize,newLineHeight;if(this.fullscreen){if(typeof this.$vidcapContainer!=='undefined'){this.$ableWrapper.css({'width':width+'px','max-width':''})
this.$vidcapContainer.css({'height':height+'px','width':width});this.$media.css({'height':height+'px','width':width})}
if(typeof this.$transcriptArea!=='undefined'){this.retrieveOffscreenWindow('transcript',width,height)}
if(typeof this.$signWindow!=='undefined'){this.retrieveOffscreenWindow('sign',width,height)}}else{if(this.restoringAfterFullScreen){width=this.preFullScreenWidth;height=this.preFullScreenHeight;this.restoringAfterFullScreen=!1;this.$ableWrapper.css({'max-width':width+'px','width':''});if(typeof this.$vidcapContainer!=='undefined'){this.$vidcapContainer.css({'height':'','width':''})}
this.$media.css({'width':'100%','height':'auto'})}}
if(this.player==='youtube'&&this.youTubePlayer){this.youTubePlayer.setSize(width,height)}
if(typeof this.$captionsDiv!=='undefined'){captionSizeOkMin=400;captionSizeOkMax=1000;captionSize=parseInt(this.prefCaptionsSize,10);if(width>captionSizeOkMax){newCaptionSize=captionSize*1.5}else if(width<captionSizeOkMin){newCaptionSize=captionSize/1.5}else{newCaptionSize=captionSize}
newLineHeight=newCaptionSize+25;this.$captionsDiv.css('font-size',newCaptionSize+'%');this.$captionsWrapper.css('line-height',newLineHeight+'%')}
this.refreshControls('captions')};AblePlayer.prototype.retrieveOffscreenWindow=function(which,width,height){var window,windowPos,windowTop,windowLeft,windowRight,windowWidth,windowBottom,windowHeight;if(which=='transcript'){window=this.$transcriptArea}else if(which=='sign'){window=this.$signWindow}
windowWidth=window.width();windowHeight=window.height();windowPos=window.position();windowTop=windowPos.top;windowLeft=windowPos.left;windowRight=windowLeft+windowWidth;windowBottom=windowTop+windowHeight;if(windowTop<0){windowTop=10;window.css('top',windowTop)}
if(windowLeft<0){windowLeft=10;window.css('left',windowLeft)}
if(windowRight>width){windowLeft=(width-20)-windowWidth;window.css('left',windowLeft)}
if(windowBottom>height){windowTop=(height-10)-windowHeight;window.css('top',windowTop)}};AblePlayer.prototype.getHighestZIndex=function(){var max,$elements,z;max=0;$elements=$('body *').not('.able-modal-dialog,.able-modal-dialog *,.able-modal-overlay,.able-modal-overlay *,.able-sign-window,.able-transcript-area');$elements.each(function(){z=$(this).css('z-index');if(Number.isInteger(+z)){if(parseInt(z)>max){max=parseInt(z)}}});return max};AblePlayer.prototype.updateZIndex=function(which){var defHighZ,defLowZ,highestZ,transcriptZ,signZ,newHighZ,newLowZ;defHighZ=8000;defLowZ=7000;highestZ=this.getHighestZIndex();if(typeof this.$transcriptArea==='undefined'||typeof this.$signWindow==='undefined'){if(typeof this.$transcriptArea!=='undefined'){transcriptZ=parseInt(this.$transcriptArea.css('z-index'));if(transcriptZ>defLowZ){this.$transcriptArea.css('z-index',defLowZ)}}else if(typeof this.$signWindow!=='undefined'){signZ=parseInt(this.$signWindow.css('z-index'));if(signZ>defHighZ){this.$signWindow.css('z-index',defHighZ)}}
return!1}
transcriptZ=parseInt(this.$transcriptArea.css('z-index'));signZ=parseInt(this.$signWindow.css('z-index'));if(transcriptZ===signZ){newHighZ=defHighZ;newLowZ=defLowZ}else if(transcriptZ>signZ){if(which==='transcript'){return!1}else{newHighZ=transcriptZ;newLowZ=signZ}}else{if(which==='sign'){return!1}else{newHighZ=signZ;newLowZ=transcriptZ}}
if(which==='transcript'){this.$transcriptArea.css('z-index',newHighZ);this.$signWindow.css('z-index',newLowZ)}else if(which==='sign'){this.$signWindow.css('z-index',newHighZ);this.$transcriptArea.css('z-index',newLowZ)}};AblePlayer.prototype.syncTrackLanguages=function(source,language){var i,captions,descriptions,chapters,meta;for(i=0;i<this.captions.length;i++){if(this.captions[i].language===language){captions=this.captions[i]}}
for(i=0;i<this.chapters.length;i++){if(this.chapters[i].language===language){chapters=this.chapters[i]}}
for(i=0;i<this.descriptions.length;i++){if(this.descriptions[i].language===language){descriptions=this.descriptions[i]}}
for(i=0;i<this.meta.length;i++){if(this.meta[i].language===language){meta=this.meta[i]}}
this.transcriptLang=language;if(source==='init'||source==='captions'){this.captionLang=language;this.selectedCaptions=captions;this.selectedChapters=chapters;this.selectedDescriptions=descriptions;this.selectedMeta=meta;this.transcriptCaptions=captions;this.transcriptChapters=chapters;this.transcriptDescriptions=descriptions;this.updateChaptersList()}else if(source==='transcript'){this.transcriptCaptions=captions;this.transcriptChapters=chapters;this.transcriptDescriptions=descriptions}
this.updateTranscript()}})(jQuery);(function($){AblePlayer.prototype.updateCaption=function(time){if(!this.usingYouTubeCaptions&&(typeof this.$captionsWrapper!=='undefined')){if(this.captionsOn){this.$captionsWrapper.show();if(typeof time!=='undefined'){this.showCaptions(time)}}else if(this.$captionsWrapper){this.$captionsWrapper.hide();this.prefCaptions=0}}};AblePlayer.prototype.updateCaptionsMenu=function(lang){this.captionsPopup.find('li').attr('aria-checked','false');if(typeof lang==='undefined'){this.captionsPopup.find('li').last().attr('aria-checked','true')}else{this.captionsPopup.find('li[lang='+lang+']').attr('aria-checked','true')}};AblePlayer.prototype.getCaptionClickFunction=function(track){var thisObj=this;return function(){thisObj.selectedCaptions=track;thisObj.captionLang=track.language;thisObj.currentCaption=-1;if(thisObj.usingYouTubeCaptions){if(thisObj.captionsOn){if(typeof thisObj.ytCaptionModule!=='undefined'){thisObj.youTubePlayer.setOption(thisObj.ytCaptionModule,'track',{'languageCode':thisObj.captionLang})}else{}}else{thisObj.resettingYouTubeCaptions=!0;thisObj.youTubePlayer.loadModule(thisObj.ytCaptionModule)}}else if(thisObj.usingVimeoCaptions){thisObj.vimeoPlayer.enableTextTrack(thisObj.captionLang).then(function(track){}).catch(function(error){switch(error.name){case 'InvalidTrackLanguageError':console.log('No '+track.kind+' track is available in the specified language ('+track.label+')');break;case 'InvalidTrackError':console.log('No '+track.kind+' track is available in the specified language ('+track.label+')');break;default:console.log('Error loading '+track.label+' '+track.kind+' track');break}})}else{thisObj.syncTrackLanguages('captions',thisObj.captionLang);if(!thisObj.swappingSrc){thisObj.updateCaption(thisObj.elapsed);thisObj.showDescription(thisObj.elapsed)}}
thisObj.captionsOn=!0;thisObj.hidingPopup=!0;thisObj.captionsPopup.hide();setTimeout(function(){thisObj.hidingPopup=!1},100);thisObj.updateCaptionsMenu(thisObj.captionLang);thisObj.$ccButton.focus();thisObj.prefCaptions=1;thisObj.updateCookie('prefCaptions');thisObj.refreshControls('captions')}};AblePlayer.prototype.getCaptionOffFunction=function(){var thisObj=this;return function(){if(thisObj.player=='youtube'){thisObj.youTubePlayer.unloadModule(thisObj.ytCaptionModule)}else if(thisObj.usingVimeoCaptions){thisObj.vimeoPlayer.disableTextTrack()}
thisObj.captionsOn=!1;thisObj.currentCaption=-1;thisObj.hidingPopup=!0;thisObj.captionsPopup.hide();setTimeout(function(){thisObj.hidingPopup=!1},100);thisObj.updateCaptionsMenu();thisObj.$ccButton.focus();thisObj.prefCaptions=0;thisObj.updateCookie('prefCaptions');if(!this.swappingSrc){thisObj.refreshControls('captions');thisObj.updateCaption()}}};AblePlayer.prototype.showCaptions=function(now){var c,thisCaption,captionText;var cues;if(this.selectedCaptions){cues=this.selectedCaptions.cues}else if(this.captions.length>=1){cues=this.captions[0].cues}else{cues=[]}
for(c=0;c<cues.length;c++){if((cues[c].start<=now)&&(cues[c].end>now)){thisCaption=c;break}}
if(typeof thisCaption!=='undefined'){if(this.currentCaption!==thisCaption){captionText=this.flattenCueForCaption(cues[thisCaption]).replace('\n','<br>');this.$captionsDiv.html(captionText);this.currentCaption=thisCaption;if(captionText.length===0){this.$captionsDiv.css('display','none')}else{this.$captionsDiv.css('display','inline-block')}}}else{this.$captionsDiv.html('');this.currentCaption=-1}};AblePlayer.prototype.flattenCueForCaption=function(cue){var result=[];var flattenComponent=function(component){var result=[],ii;if(component.type==='string'){result.push(component.value)}else if(component.type==='v'){result.push('('+component.value+')');for(ii=0;ii<component.children.length;ii++){result.push(flattenComponent(component.children[ii]))}}else if(component.type==='i'){result.push('<em>');for(ii=0;ii<component.children.length;ii++){result.push(flattenComponent(component.children[ii]))}
result.push('</em>')}else if(component.type==='b'){result.push('<strong>');for(ii=0;ii<component.children.length;ii++){result.push(flattenComponent(component.children[ii]))}
result.push('</strong>')}else{for(ii=0;ii<component.children.length;ii++){result.push(flattenComponent(component.children[ii]))}}
return result.join('')};if(typeof cue.components!=='undefined'){for(var ii=0;ii<cue.components.children.length;ii++){result.push(flattenComponent(cue.components.children[ii]))}}
return result.join('')};AblePlayer.prototype.getCaptionsOptions=function(pref){var options=[];switch(pref){case 'prefCaptionsFont':options[0]=['serif',this.tt.serif];options[1]=['sans-serif',this.tt.sans];options[2]=['cursive',this.tt.cursive];options[3]=['fantasy',this.tt.fantasy];options[4]=['monospace',this.tt.monospace];break;case 'prefCaptionsColor':case 'prefCaptionsBGColor':options[0]=['white',this.tt.white];options[1]=['yellow',this.tt.yellow];options[2]=['green',this.tt.green];options[3]=['cyan',this.tt.cyan];options[4]=['blue',this.tt.blue];options[5]=['magenta',this.tt.magenta];options[6]=['red',this.tt.red];options[7]=['black',this.tt.black];break;case 'prefCaptionsSize':options[0]='75%';options[1]='100%';options[2]='125%';options[3]='150%';options[4]='200%';break;case 'prefCaptionsOpacity':options[0]='0%';options[1]='25%';options[2]='50%';options[3]='75%';options[4]='100%';break;case 'prefCaptionsStyle':options[0]=this.tt.captionsStylePopOn;options[1]=this.tt.captionsStyleRollUp;break;case 'prefCaptionsPosition':options[0]='overlay';options[1]='below';break}
return options};AblePlayer.prototype.translatePrefs=function(pref,value,outputFormat){if(outputFormat=='youtube'){if(pref==='size'){switch(value){case '75%':return-1;case '100%':return 0;case '125%':return 1;case '150%':return 2;case '200%':return 3}}}
return!1}
AblePlayer.prototype.stylizeCaptions=function($element,pref){var property,newValue,opacity,lineHeight;if(typeof $element!=='undefined'){if(pref=='prefCaptionsPosition'){this.positionCaptions()}else if(typeof pref!=='undefined'){if(pref==='prefCaptionsFont'){property='font-family'}else if(pref==='prefCaptionsSize'){property='font-size'}else if(pref==='prefCaptionsColor'){property='color'}else if(pref==='prefCaptionsBGColor'){property='background-color'}else if(pref==='prefCaptionsOpacity'){property='opacity'}
if(pref==='prefCaptionsOpacity'){newValue=parseFloat($('#'+this.mediaId+'_'+pref).val())/100.0}else{newValue=$('#'+this.mediaId+'_'+pref).val()}
$element.css(property,newValue)}else{opacity=parseFloat(this.prefCaptionsOpacity)/100.0;$element.css({'font-family':this.prefCaptionsFont,'color':this.prefCaptionsColor,'background-color':this.prefCaptionsBGColor,'opacity':opacity});if($element===this.$captionsDiv){if(typeof this.$captionsWrapper!=='undefined'){this.$captionsWrapper.css({'font-size':this.prefCaptionsSize})}}
if(this.prefCaptionsPosition==='below'){if(typeof this.$captionsWrapper!=='undefined'){this.$captionsWrapper.css({'background-color':this.prefCaptionsBGColor,'opacity':'1'})}}else if(this.prefCaptionsPosition==='overlay'){if(typeof this.$captionsWrapper!=='undefined'){this.$captionsWrapper.css({'background-color':'transparent','opacity':''})}}
this.positionCaptions()}}};AblePlayer.prototype.positionCaptions=function(position){if(typeof position==='undefined'){position=this.prefCaptionsPosition}
if(typeof this.$captionsWrapper!=='undefined'){if(position=='below'){this.$captionsWrapper.removeClass('able-captions-overlay').addClass('able-captions-below');this.$captionsWrapper.css({'background-color':this.prefCaptionsBGColor,'opacity':'1'})}else{this.$captionsWrapper.removeClass('able-captions-below').addClass('able-captions-overlay');this.$captionsWrapper.css({'background-color':'transparent','opacity':''})}}}})(jQuery);(function($){AblePlayer.prototype.populateChaptersDiv=function(){var headingLevel,headingType,headingId,$chaptersHeading,$chaptersList;if($('#'+this.chaptersDivLocation)){this.$chaptersDiv=$('#'+this.chaptersDivLocation);this.$chaptersDiv.addClass('able-chapters-div');if(this.chaptersTitle){headingLevel=this.getNextHeadingLevel(this.$chaptersDiv);headingType='h'+headingLevel.toString();headingId=this.mediaId+'-chapters-heading';$chaptersHeading=$('<'+headingType+'>',{'class':'able-chapters-heading','id':headingId}).text(this.chaptersTitle);this.$chaptersDiv.append($chaptersHeading)}
this.$chaptersNav=$('<nav>');if(this.chaptersTitle){this.$chaptersNav.attr('aria-labelledby',headingId)}else{this.$chaptersNav.attr('aria-label',this.tt.chapters)}
this.$chaptersDiv.append(this.$chaptersNav);this.updateChaptersList()}};AblePlayer.prototype.updateChaptersList=function(){var thisObj,cues,$chaptersList,c,thisChapter,$chapterItem,$chapterButton,buttonId,hasDefault,getClickFunction,$clickedItem,$chaptersList,thisChapterIndex;thisObj=this;if(!this.$chaptersNav){return!1}
if(typeof this.useChapterTimes==='undefined'){if(this.seekbarScope==='chapter'&&this.selectedChapters.cues.length){this.useChapterTimes=!0}else{this.useChapterTimes=!1}}
if(this.useChapterTimes){cues=this.selectedChapters.cues}else if(this.chapters.length>=1){cues=this.chapters[0].cues}else{cues=[]}
if(cues.length>0){$chaptersList=$('<ul>');for(c=0;c<cues.length;c++){thisChapter=c;$chapterItem=$('<li></li>');$chapterButton=$('<button>',{'type':'button','val':thisChapter}).text(this.flattenCueForCaption(cues[thisChapter]));getClickFunction=function(time){return function(){thisObj.seekTrigger='chapter';$clickedItem=$(this).closest('li');$chaptersList=$(this).closest('ul').find('li');thisChapterIndex=$chaptersList.index($clickedItem);$chaptersList.removeClass('able-current-chapter').attr('aria-selected','');$clickedItem.addClass('able-current-chapter').attr('aria-selected','true');thisObj.updateChapter(time);thisObj.seekTo(time)}};$chapterButton.on('click',getClickFunction(cues[thisChapter].start));$chapterButton.on('focus',function(){$(this).closest('ul').find('li').removeClass('able-focus');$(this).closest('li').addClass('able-focus')});$chapterItem.on('hover',function(){$(this).closest('ul').find('li').removeClass('able-focus');$(this).addClass('able-focus')});$chapterItem.on('mouseleave',function(){$(this).removeClass('able-focus')});$chapterButton.on('blur',function(){$(this).closest('li').removeClass('able-focus')});$chapterItem.append($chapterButton);$chaptersList.append($chapterItem);if(this.defaultChapter===cues[thisChapter].id){$chapterButton.attr('aria-selected','true').parent('li').addClass('able-current-chapter');this.currentChapter=cues[thisChapter];hasDefault=!0}}
if(!hasDefault){this.currentChapter=cues[0];$chaptersList.find('button').first().attr('aria-selected','true').parent('li').addClass('able-current-chapter')}
this.$chaptersNav.html($chaptersList)}
return!1};AblePlayer.prototype.seekToChapter=function(chapterId){var i=0;while(i<this.selectedChapters.cues.length){if(this.selectedChapters.cues[i].id==chapterId){this.seekTo(this.selectedChapters.cues[i].start);this.updateChapter(this.selectedChapters.cues[i].start);break}
i++}};AblePlayer.prototype.updateChapter=function(now){if(typeof this.selectedChapters==='undefined'){return}
var chapters,i,thisChapterIndex,chapterLabel;chapters=this.selectedChapters.cues;for(i=0;i<chapters.length;i++){if((chapters[i].start<=now)&&(chapters[i].end>now)){thisChapterIndex=i;break}}
if(typeof thisChapterIndex!=='undefined'){if(this.currentChapter!==chapters[thisChapterIndex]){this.currentChapter=chapters[thisChapterIndex];if(this.useChapterTimes){this.chapterDuration=this.getChapterDuration();this.seekIntervalCalculated=!1}
if(typeof this.$chaptersDiv!=='undefined'){this.$chaptersDiv.find('ul').find('li').removeClass('able-current-chapter').attr('aria-selected','');this.$chaptersDiv.find('ul').find('li').eq(thisChapterIndex).addClass('able-current-chapter').attr('aria-selected','true')}}}};AblePlayer.prototype.getChapterDuration=function(){var lastChapterIndex,chapterEnd;if(typeof this.currentChapter==='undefined'){return 0}
if(typeof this.duration==='undefined'){return 0}
lastChapterIndex=this.selectedChapters.cues.length-1;if(this.selectedChapters.cues[lastChapterIndex]==this.currentChapter){if(this.currentChapter.end!==this.duration){chapterEnd=this.duration;this.currentChapter.end=this.duration}else{chapterEnd=this.currentChapter.end}}else{chapterEnd=this.currentChapter.end}
return chapterEnd-this.currentChapter.start};AblePlayer.prototype.getChapterElapsed=function(){if(typeof this.currentChapter==='undefined'){return 0}
if(this.elapsed>this.currentChapter.start){return this.elapsed-this.currentChapter.start}else{return 0}};AblePlayer.prototype.convertChapterTimeToVideoTime=function(chapterTime){if(typeof this.currentChapter!=='undefined'){var newTime=this.currentChapter.start+chapterTime;if(newTime>this.currentChapter.end){return this.currentChapter.end}else{return newTime}}else{return chapterTime}};AblePlayer.prototype.getChapterClickFunction=function(time){var thisObj=this;return function(){thisObj.seekTrigger='chapter';thisObj.seekTo(time);thisObj.hidingPopup=!0;thisObj.chaptersPopup.hide();setTimeout(function(){thisObj.hidingPopup=!1},100);thisObj.$chaptersButton.focus()}}})(jQuery);(function($){AblePlayer.prototype.updateMeta=function(time){if(this.hasMeta){if(this.metaType==='text'){this.$metaDiv.show();this.showMeta(time||this.elapsed)}else{this.showMeta(time||this.elapsed)}}};AblePlayer.prototype.showMeta=function(now){var tempSelectors,m,thisMeta,cues,cueText,cueLines,i,line,showDuration,focusTarget;tempSelectors=[];if(this.meta.length>=1){cues=this.meta}else{cues=[]}
for(m=0;m<cues.length;m++){if((cues[m].start<=now)&&(cues[m].end>now)){thisMeta=m;break}}
if(typeof thisMeta!=='undefined'){if(this.currentMeta!==thisMeta){if(this.metaType==='text'){this.$metaDiv.html(this.flattenCueForMeta(cues[thisMeta]).replace('\n','<br>'))}else if(this.metaType==='selector'){cueText=this.flattenCueForMeta(cues[thisMeta]);cueLines=cueText.split('\n');for(i=0;i<cueLines.length;i++){line=$.trim(cueLines[i]);if(line.toLowerCase().trim()==='pause'){this.hideBigPlayButton=!0;this.pauseMedia()}else if(line.toLowerCase().substring(0,6)=='focus:'){focusTarget=line.substring(6).trim();if($(focusTarget).length){$(focusTarget).focus()}}else{if($(line).length){this.currentMeta=thisMeta;showDuration=parseInt($(line).attr('data-duration'));if(typeof showDuration!=='undefined'&&!isNaN(showDuration)){$(line).show().delay(showDuration).fadeOut()}else{$(line).show()}
this.visibleSelectors.push(line);tempSelectors.push(line)}}}
if(this.visibleSelectors&&this.visibleSelectors.length){if(this.visibleSelectors.length!==tempSelectors.length){for(i=this.visibleSelectors.length-1;i>=0;i--){if($.inArray(this.visibleSelectors[i],tempSelectors)==-1){$(this.visibleSelectors[i]).hide();this.visibleSelectors.splice(i,1)}}}}}}}else{if(typeof this.$metaDiv!=='undefined'){this.$metaDiv.html('')}
if(this.visibleSelectors&&this.visibleSelectors.length){for(i=0;i<this.visibleSelectors.length;i++){$(this.visibleSelectors[i]).hide()}
this.visibleSelectors=[]}
this.currentMeta=-1}};AblePlayer.prototype.flattenCueForMeta=function(cue){var result=[];var flattenComponent=function(component){var result=[],ii;if(component.type==='string'){result.push(component.value)}else if(component.type==='v'){result.push('['+component.value+']');for(ii=0;ii<component.children.length;ii++){result.push(flattenComponent(component.children[ii]))}}else{for(ii=0;ii<component.children.length;ii++){result.push(flattenComponent(component.children[ii]))}}
return result.join('')}
for(var ii=0;ii<cue.components.children.length;ii++){result.push(flattenComponent(cue.components.children[ii]))}
return result.join('')}})(jQuery);(function($){AblePlayer.prototype.setupTranscript=function(){var deferred=new $.Deferred();var promise=deferred.promise();if(!this.transcriptType){if(this.captions.length&&(!(this.usingYouTubeCaptions||this.usingVimeoCaptions))){this.transcriptType='popup'}}
if(this.transcriptType){if(this.transcriptType==='popup'||this.transcriptType==='external'){this.injectTranscriptArea();deferred.resolve()}else if(this.transcriptType==='manual'){this.setupManualTranscript();deferred.resolve()}}else{deferred.resolve()}
return promise};AblePlayer.prototype.injectTranscriptArea=function(){var thisObj,$autoScrollLabel,$languageSelectWrapper,$languageSelectLabel,i,$option;thisObj=this;this.$transcriptArea=$('<div>',{'class':'able-transcript-area','role':'dialog','aria-label':this.tt.transcriptTitle});this.$transcriptToolbar=$('<div>',{'class':'able-window-toolbar able-'+this.toolbarIconColor+'-controls'});this.$transcriptDiv=$('<div>',{'class':'able-transcript'});this.$autoScrollTranscriptCheckbox=$('<input>',{'id':'autoscroll-transcript-checkbox','type':'checkbox'});$autoScrollLabel=$('<label>',{'for':'autoscroll-transcript-checkbox'}).text(this.tt.autoScroll);this.$transcriptToolbar.append($autoScrollLabel,this.$autoScrollTranscriptCheckbox);if(this.captions.length>1){$languageSelectWrapper=$('<div>',{'class':'transcript-language-select-wrapper'});$languageSelectLabel=$('<label>',{'for':'transcript-language-select'}).text(this.tt.language);this.$transcriptLanguageSelect=$('<select>',{'id':'transcript-language-select'});for(i=0;i<this.captions.length;i++){$option=$('<option></option>',{value:this.captions[i].language,lang:this.captions[i].language}).text(this.captions[i].label);if(this.captions[i].def){$option.prop('selected',!0)}
this.$transcriptLanguageSelect.append($option)}}
if($languageSelectWrapper){$languageSelectWrapper.append($languageSelectLabel,this.$transcriptLanguageSelect);this.$transcriptToolbar.append($languageSelectWrapper)}
this.$transcriptArea.append(this.$transcriptToolbar,this.$transcriptDiv);if(this.transcriptDivLocation){$('#'+this.transcriptDivLocation).append(this.$transcriptArea)}else{this.$ableWrapper.append(this.$transcriptArea)}
if(!this.transcriptDivLocation){this.initDragDrop('transcript');if(this.prefTranscript===1){this.positionDraggableWindow('transcript',this.getDefaultWidth('transcript'))}}
if(!this.prefTranscript&&!this.transcriptDivLocation){this.$transcriptArea.hide()}};AblePlayer.prototype.addTranscriptAreaEvents=function(){var thisObj=this;this.$autoScrollTranscriptCheckbox.click(function(){thisObj.handleTranscriptLockToggle(thisObj.$autoScrollTranscriptCheckbox.prop('checked'))});this.$transcriptDiv.on('mousewheel DOMMouseScroll click scroll',function(e){if(!thisObj.scrollingTranscript){thisObj.autoScrollTranscript=!1;thisObj.refreshControls('transcript')}
thisObj.scrollingTranscript=!1});if(typeof this.$transcriptLanguageSelect!=='undefined'){this.$transcriptLanguageSelect.on('click mousedown',function(e){e.stopPropagation()});this.$transcriptLanguageSelect.on('change',function(){var language=thisObj.$transcriptLanguageSelect.val();thisObj.syncTrackLanguages('transcript',language)})}};AblePlayer.prototype.transcriptSrcHasRequiredParts=function(){if($('#'+this.transcriptSrc).length){this.$transcriptArea=$('#'+this.transcriptSrc);if(this.$transcriptArea.find('.able-window-toolbar').length){this.$transcriptToolbar=this.$transcriptArea.find('.able-window-toolbar').eq(0);if(this.$transcriptArea.find('.able-transcript').length){this.$transcriptDiv=this.$transcriptArea.find('.able-transcript').eq(0);if(this.$transcriptArea.find('.able-transcript-seekpoint').length){this.$transcriptSeekpoints=this.$transcriptArea.find('.able-transcript-seekpoint');return!0}}}}
return!1}
AblePlayer.prototype.setupManualTranscript=function(){this.$autoScrollTranscriptCheckbox=$('<input id="autoscroll-transcript-checkbox" type="checkbox">');this.$transcriptToolbar.append($('<label for="autoscroll-transcript-checkbox">'+this.tt.autoScroll+': </label>'),this.$autoScrollTranscriptCheckbox)};AblePlayer.prototype.updateTranscript=function(){if(!this.transcriptType){return}
if(this.transcriptType==='external'||this.transcriptType==='popup'){var chapters,captions,descriptions;if(this.transcriptLang){captions=this.transcriptCaptions.cues}else{if(this.transcriptCaptions){this.transcriptLang=this.transcriptCaptions.language;captions=this.transcriptCaptions.cues}else if(this.selectedCaptions){this.transcriptLang=this.captionLang;captions=this.selectedCaptions.cues}}
if(this.transcriptChapters){chapters=this.transcriptChapters.cues}else if(this.chapters.length>0){if(this.transcriptLang){for(var i=0;i<this.chapters.length;i++){if(this.chapters[i].language===this.transcriptLang){chapters=this.chapters[i].cues}}}
if(typeof chapters==='undefined'){chapters=this.chapters[0].cues||[]}}
if(this.transcriptDescriptions){descriptions=this.transcriptDescriptions.cues}else if(this.descriptions.length>0){if(this.transcriptLang){for(var i=0;i<this.descriptions.length;i++){if(this.descriptions[i].language===this.transcriptLang){descriptions=this.descriptions[i].cues}}}
if(!descriptions){descriptions=this.descriptions[0].cues||[]}}
var div=this.generateTranscript(chapters||[],captions||[],descriptions||[]);this.$transcriptDiv.html(div);if(this.$transcriptLanguageSelect){this.$transcriptLanguageSelect.find('option:selected').prop('selected',!1);this.$transcriptLanguageSelect.find('option[lang='+this.transcriptLang+']').prop('selected',!0)}}
var thisObj=this;if(this.prefTabbable===1){this.$transcriptDiv.find('span.able-transcript-seekpoint').attr('tabindex','0')}
if(this.$transcriptArea.length>0){this.$transcriptArea.find('span.able-transcript-seekpoint').click(function(e){thisObj.seekTrigger='transcript';var spanStart=parseFloat($(this).attr('data-start'));spanStart+=.01;if(!thisObj.seekingFromTranscript){thisObj.seekingFromTranscript=!0;thisObj.seekTo(spanStart)}else{thisObj.seekingFromTranscript=!1}})}};AblePlayer.prototype.highlightTranscript=function(currentTime){if(!this.transcriptType){return}
var start,end,isChapterHeading;var thisObj=this;currentTime=parseFloat(currentTime);this.$transcriptArea.find('span.able-transcript-seekpoint').each(function(){start=parseFloat($(this).attr('data-start'));end=parseFloat($(this).attr('data-end'));if($(this).parent().hasClass('able-transcript-chapter-heading')){isChapterHeading=!0}else{isChapterHeading=!1}
if(currentTime>=start&&currentTime<=end&&!isChapterHeading){if(!($(this).hasClass('able-highlight'))){thisObj.$transcriptArea.find('.able-highlight').removeClass('able-highlight');$(this).addClass('able-highlight');thisObj.movingHighlight=!0}
return!1}});thisObj.currentHighlight=thisObj.$transcriptArea.find('.able-highlight');if(thisObj.currentHighlight.length===0){thisObj.currentHighlight=null}};AblePlayer.prototype.generateTranscript=function(chapters,captions,descriptions){var thisObj=this;var $main=$('<div class="able-transcript-container"></div>');var transcriptTitle;$main.attr('lang',this.transcriptLang);if(typeof this.transcriptTitle!=='undefined'){transcriptTitle=this.transcriptTitle}else if(this.lyricsMode){transcriptTitle=this.tt.lyricsTitle}else{transcriptTitle=this.tt.transcriptTitle}
if(typeof this.transcriptDivLocation==='undefined'){var headingNumber=this.playerHeadingLevel;headingNumber+=1;var chapterHeadingNumber=headingNumber+1;if(headingNumber<=6){var transcriptHeading='h'+headingNumber.toString()}else{var transcriptHeading='div'}
var $transcriptHeadingTag=$('<'+transcriptHeading+'>');$transcriptHeadingTag.addClass('able-transcript-heading');if(headingNumber>6){$transcriptHeadingTag.attr({'role':'heading','aria-level':headingNumber})}
$transcriptHeadingTag.text(transcriptTitle);$transcriptHeadingTag.attr('lang',this.lang);$main.append($transcriptHeadingTag)}
var nextChapter=0;var nextCap=0;var nextDesc=0;var addChapter=function(div,chap){if(chapterHeadingNumber<=6){var chapterHeading='h'+chapterHeadingNumber.toString()}else{var chapterHeading='div'}
var $chapterHeadingTag=$('<'+chapterHeading+'>',{'class':'able-transcript-chapter-heading'});if(chapterHeadingNumber>6){$chapterHeadingTag.attr({'role':'heading','aria-level':chapterHeadingNumber})}
var flattenComponentForChapter=function(comp){var result=[];if(comp.type==='string'){result.push(comp.value)}else{for(var i=0;i<comp.children.length;i++){result=result.concat(flattenComponentForChapter(comp.children[i]))}}
return result}
var $chapSpan=$('<span>',{'class':'able-transcript-seekpoint'});for(var i=0;i<chap.components.children.length;i++){var results=flattenComponentForChapter(chap.components.children[i]);for(var jj=0;jj<results.length;jj++){$chapSpan.append(results[jj])}}
$chapSpan.attr('data-start',chap.start.toString());$chapSpan.attr('data-end',chap.end.toString());$chapterHeadingTag.append($chapSpan);div.append($chapterHeadingTag)};var addDescription=function(div,desc){var $descDiv=$('<div>',{'class':'able-transcript-desc'});var $descHiddenSpan=$('<span>',{'class':'able-hidden'});$descHiddenSpan.attr('lang',thisObj.lang);$descHiddenSpan.text(thisObj.tt.prefHeadingDescription+': ');$descDiv.append($descHiddenSpan);var flattenComponentForDescription=function(comp){var result=[];if(comp.type==='string'){result.push(comp.value)}else{for(var i=0;i<comp.children.length;i++){result=result.concat(flattenComponentForDescription(comp.children[i]))}}
return result}
var $descSpan=$('<span>',{'class':'able-transcript-seekpoint'});for(var i=0;i<desc.components.children.length;i++){var results=flattenComponentForDescription(desc.components.children[i]);for(var jj=0;jj<results.length;jj++){$descSpan.append(results[jj])}}
$descSpan.attr('data-start',desc.start.toString());$descSpan.attr('data-end',desc.end.toString());$descDiv.append($descSpan);div.append($descDiv)};var addCaption=function(div,cap){var $capSpan=$('<span>',{'class':'able-transcript-seekpoint able-transcript-caption'});var flattenComponentForCaption=function(comp){var result=[];var parts=0;var flattenString=function(str){parts++;var flatStr;var result=[];if(str===''){return result}
var openBracket=str.indexOf('[');var closeBracket=str.indexOf(']');var openParen=str.indexOf('(');var closeParen=str.indexOf(')');var hasBrackets=openBracket!==-1&&closeBracket!==-1;var hasParens=openParen!==-1&&closeParen!==-1;if(hasParens||hasBrackets){if(parts>1){var silentSpanBreak='<br/>'}else{var silentSpanBreak=''}
var silentSpanOpen=silentSpanBreak+'<span class="able-unspoken">';var silentSpanClose='</span>';if(hasParens&&hasBrackets){if(openBracket<openParen){hasParens=!1}else{hasBrackets=!1}}}
if(hasParens){flatStr=str.substring(0,openParen);flatStr+=silentSpanOpen;flatStr+=str.substring(openParen,closeParen+1);flatStr+=silentSpanClose;flatStr+=flattenString(str.substring(closeParen+1));result.push(flatStr)}else if(hasBrackets){flatStr=str.substring(0,openBracket);flatStr+=silentSpanOpen;flatStr+=str.substring(openBracket,closeBracket+1);flatStr+=silentSpanClose;flatStr+=flattenString(str.substring(closeBracket+1));result.push(flatStr)}else{result.push(str)}
return result};if(comp.type==='string'){result=result.concat(flattenString(comp.value))}else if(comp.type==='v'){var $vSpan=$('<span>',{'class':'able-unspoken'});$vSpan.text('('+comp.value+')');result.push($vSpan);for(var i=0;i<comp.children.length;i++){var subResults=flattenComponentForCaption(comp.children[i]);for(var jj=0;jj<subResults.length;jj++){result.push(subResults[jj])}}}else if(comp.type==='b'||comp.type==='i'){if(comp.type==='b'){var $tag=$('<strong>')}else if(comp.type==='i'){var $tag=$('<em>')}
for(var i=0;i<comp.children.length;i++){var subResults=flattenComponentForCaption(comp.children[i]);for(var jj=0;jj<subResults.length;jj++){$tag.append(subResults[jj])}}
if(comp.type==='b'||comp.type=='i'){result.push($tag,' ')}}else{for(var i=0;i<comp.children.length;i++){result=result.concat(flattenComponentForCaption(comp.children[i]))}}
return result};for(var i=0;i<cap.components.children.length;i++){var results=flattenComponentForCaption(cap.components.children[i]);for(var jj=0;jj<results.length;jj++){var result=results[jj];if(typeof result==='string'){if(thisObj.lyricsMode){result=result.replace('\n','<br>')+'<br>'}else{result+=' '}}
$capSpan.append(result)}}
$capSpan.attr('data-start',cap.start.toString());$capSpan.attr('data-end',cap.end.toString());div.append($capSpan);div.append(' \n')};while((nextChapter<chapters.length)||(nextDesc<descriptions.length)||(nextCap<captions.length)){if((nextChapter<chapters.length)&&(nextDesc<descriptions.length)&&(nextCap<captions.length)){var firstStart=Math.min(chapters[nextChapter].start,descriptions[nextDesc].start,captions[nextCap].start)}else if((nextChapter<chapters.length)&&(nextDesc<descriptions.length)){var firstStart=Math.min(chapters[nextChapter].start,descriptions[nextDesc].start)}else if((nextChapter<chapters.length)&&(nextCap<captions.length)){var firstStart=Math.min(chapters[nextChapter].start,captions[nextCap].start)}else if((nextDesc<descriptions.length)&&(nextCap<captions.length)){var firstStart=Math.min(descriptions[nextDesc].start,captions[nextCap].start)}else{var firstStart=null}
if(firstStart!==null){if(typeof chapters[nextChapter]!=='undefined'&&chapters[nextChapter].start===firstStart){addChapter($main,chapters[nextChapter]);nextChapter+=1}else if(typeof descriptions[nextDesc]!=='undefined'&&descriptions[nextDesc].start===firstStart){addDescription($main,descriptions[nextDesc]);nextDesc+=1}else{addCaption($main,captions[nextCap]);nextCap+=1}}else{if(nextChapter<chapters.length){addChapter($main,chapters[nextChapter]);nextChapter+=1}else if(nextDesc<descriptions.length){addDescription($main,descriptions[nextDesc]);nextDesc+=1}else if(nextCap<captions.length){addCaption($main,captions[nextCap]);nextCap+=1}}}
var $components=$main.children();var spanCount=0;var openBlock=!0;$components.each(function(){if($(this).hasClass('able-transcript-caption')){if($(this).text().indexOf('[')!==-1||$(this).text().indexOf('(')!==-1){if(spanCount>0){$main.find('.able-block-temp').removeClass('able-block-temp').wrapAll('<div class="able-transcript-block"></div>');spanCount=0}}
$(this).addClass('able-block-temp');spanCount++}else{if(spanCount>0){$main.find('.able-block-temp').removeClass('able-block-temp').wrapAll('<div class="able-transcript-block"></div>');spanCount=0}}});return $main}})(jQuery);(function($){AblePlayer.prototype.showSearchResults=function(){var thisObj=this;if(this.searchDiv&&this.searchString){if($('#'+this.SearchDiv)){var searchStringHtml='<p>'+this.tt.resultsSummary1+' ';searchStringHtml+='<span id="able-search-term-echo">'+this.searchString+'</span>';searchStringHtml+='</p>';var resultsArray=this.searchFor(this.searchString);if(resultsArray.length>0){var $resultsSummary=$('<p>',{'class':'able-search-results-summary'});var resultsSummaryText=this.tt.resultsSummary2;resultsSummaryText+=' <strong>'+resultsArray.length+'</strong> ';resultsSummaryText+=this.tt.resultsSummary3+' ';resultsSummaryText+=this.tt.resultsSummary4;$resultsSummary.html(resultsSummaryText);var $resultsList=$('<ul>');for(var i=0;i<resultsArray.length;i++){var resultId='aria-search-result-'+i;var $resultsItem=$('<li>',{});var itemStartTime=this.secondsToTime(resultsArray[i].start);var itemLabel=this.tt.searchButtonLabel+' '+itemStartTime.title;var itemStartSpan=$('<button>',{'class':'able-search-results-time','data-start':resultsArray[i].start,'title':itemLabel,'aria-label':itemLabel,'aria-describedby':resultId});itemStartSpan.text(itemStartTime.value);itemStartSpan.on('click',function(e){thisObj.seekTrigger='search';var spanStart=parseFloat($(this).attr('data-start'));spanStart+=.01;thisObj.seeking=!0;thisObj.seekTo(spanStart)});var itemText=$('<span>',{'class':'able-search-result-text','id':resultId})
itemText.html('...'+resultsArray[i].caption+'...');$resultsItem.append(itemStartSpan,itemText);$resultsList.append($resultsItem)}
$('#'+this.searchDiv).append(searchStringHtml,$resultsSummary,$resultsList)}else{var noResults=$('<p>').text(this.tt.noResultsFound);$('#'+this.searchDiv).append(noResults)}}}};AblePlayer.prototype.searchFor=function(searchString){var captionLang,captions,results,caption,c,i,j;results=[];var searchTerms=searchString.split(' ');if(this.captions.length>0){for(i=0;i<this.captions.length;i++){if(this.captions[i].language===this.searchLang){captionLang=this.searchLang;captions=this.captions[i].cues}}
if(captions.length>0){c=0;for(i=0;i<captions.length;i++){if($.inArray(captions[i].components.children[0].type,['string','i','b','u','v','c'])!==-1){caption=this.flattenCueForCaption(captions[i]);for(j=0;j<searchTerms.length;j++){if(caption.indexOf(searchTerms[j])!==-1){results[c]=[];results[c].start=captions[i].start;results[c].lang=captionLang;results[c].caption=this.highlightSearchTerm(searchTerms,j,caption);c++;break}}}}}}
return results};AblePlayer.prototype.highlightSearchTerm=function(searchTerms,index,resultString){var i,searchTerm,termIndex,termLength,str1,str2,str3;for(i=index;i<searchTerms.length;i++){searchTerm=searchTerms[i];termIndex=resultString.indexOf(searchTerm);if(termIndex!==-1){termLength=searchTerm.length;if(termLength>0){str1=resultString.substring(0,termIndex);str2='<span class="able-search-term">'+searchTerm+'</span>';str3=resultString.substring(termIndex+termLength);resultString=str1+str2+str3}else{str1='<span class="able-search-term">'+searchTerm+'</span>';str2=resultString.substring(termIndex+termLength);resultString=str1+str2}}}
return resultString};AblePlayer.prototype.secondsToTime=function(totalSeconds){var totalSeconds=Math.floor(totalSeconds);var hours=parseInt(totalSeconds/3600,10)%24;var minutes=parseInt(totalSeconds/60,10)%60;var seconds=totalSeconds%60;var value='';var title='';if(hours>0){value+=hours+':';if(hours==1){title+='1 '+this.tt.hour+' '}else{title+=hours+' '+this.tt.hours+' '}}
if(minutes<10){value+='0'+minutes+':';if(minutes>0){if(minutes==1){title+='1 '+this.tt.minute+' '}else{title+=minutes+' '+this.tt.minutes+' '}}}else{value+=minutes+':';title+=minutes+' '+this.tt.minutes+' '}
if(seconds<10){value+='0'+seconds;if(seconds>0){if(seconds==1){title+='1 '+this.tt.second+' '}else{title+=seconds+' '+this.tt.seconds+' '}}}else{value+=seconds;title+=seconds+' '+this.tt.seconds+' '}
var time=[];time.value=value;time.title=title;return time}})(jQuery);(function($){AblePlayer.prototype.onMediaUpdateTime=function(duration,elapsed){var thisObj=this;this.getMediaTimes(duration,elapsed).then(function(mediaTimes){thisObj.duration=mediaTimes.duration;thisObj.elapsed=mediaTimes.elapsed;if(thisObj.swappingSrc&&(typeof thisObj.swapTime!=='undefined')){if(thisObj.swapTime===thisObj.elapsed){if(thisObj.playing){thisObj.playMedia();thisObj.swappingSrc=!1;thisObj.swapTime=null}}}else{if(thisObj.prefHighlight===1){thisObj.highlightTranscript(thisObj.elapsed)}
thisObj.updateCaption(thisObj.elapsed);thisObj.showDescription(thisObj.elapsed);thisObj.updateChapter(thisObj.elapsed);thisObj.updateMeta(thisObj.elapsed);thisObj.refreshControls('timeline',thisObj.duration,thisObj.elapsed)}})};AblePlayer.prototype.onMediaPause=function(){if(this.controlsHidden){this.fadeControls('in');this.controlsHidden=!1}
if(this.hideControlsTimeoutStatus==='active'){window.clearTimeout(this.hideControlsTimeout);this.hideControlsTimeoutStatus='clear'}
this.refreshControls('playpause')};AblePlayer.prototype.onMediaComplete=function(){if(this.hasPlaylist&&!this.cueingPlaylistItem){if(this.playlistIndex===(this.$playlist.length-1)){if(this.loop){this.playlistIndex=0;this.cueingPlaylistItem=!0;this.cuePlaylistItem(0)}else{this.playing=!1;this.paused=!0}}else{this.playlistIndex++;this.cueingPlaylistItem=!0;this.cuePlaylistItem(this.playlistIndex)}}
this.refreshControls('init')};AblePlayer.prototype.onMediaNewSourceLoad=function(){if(this.cueingPlaylistItem){this.cueingPlaylistItem=!1}
if(this.swappingSrc===!0){if(this.swapTime>0){this.seekTo(this.swapTime)}else{if(this.playing){this.playMedia()}
this.swappingSrc=!1}}
this.refreshControls('init')};AblePlayer.prototype.onWindowResize=function(){if(this.fullscreen){var newWidth,newHeight;newWidth=$(window).width();if(this.isUserAgent('Firefox')||this.isUserAgent('Trident')||this.isUserAgent('Edge')){newHeight=window.innerHeight-this.$playerDiv.outerHeight()-20}else if(window.outerHeight>=window.innerHeight){newHeight=window.innerHeight-this.$playerDiv.outerHeight()}else{newHeight=window.outerHeight}
if(!this.$descDiv.is(':hidden')){newHeight-=this.$descDiv.height()}
this.positionCaptions('overlay')}else{if(this.restoringAfterFullScreen){newWidth=this.preFullScreenWidth;newHeight=this.preFullScreenHeight}else{newWidth=this.$ableWrapper.width();if(typeof this.aspectRatio!=='undefined'){newHeight=Math.round(newWidth/this.aspectRatio)}else{newHeight=this.$ableWrapper.height()}
this.positionCaptions()}}
this.resizePlayer(newWidth,newHeight)};AblePlayer.prototype.addSeekbarListeners=function(){var thisObj=this;this.seekBar.bodyDiv.on('startTracking',function(e){thisObj.pausedBeforeTracking=thisObj.paused;thisObj.pauseMedia()}).on('tracking',function(e,position){thisObj.highlightTranscript(position);thisObj.updateCaption(position);thisObj.showDescription(position);thisObj.updateChapter(thisObj.convertChapterTimeToVideoTime(position));thisObj.updateMeta(position);thisObj.refreshControls('init')}).on('stopTracking',function(e,position){if(thisObj.useChapterTimes){thisObj.seekTo(thisObj.convertChapterTimeToVideoTime(position))}else{thisObj.seekTo(position)}
if(!thisObj.pausedBeforeTracking){setTimeout(function(){thisObj.playMedia()},200)}})};AblePlayer.prototype.onClickPlayerButton=function(el){var whichButton,prefsPopup;whichButton=$(el).attr('class').split(' ')[0].substr(20);if(whichButton==='play'){this.clickedPlay=!0;this.handlePlay()}else if(whichButton==='restart'){this.seekTrigger='restart';this.handleRestart()}else if(whichButton==='previous'){this.userClickedPlaylist=!0;this.seekTrigger='previous';this.buttonWithFocus='previous';this.handlePrevTrack()}else if(whichButton==='next'){this.userClickedPlaylist=!0;this.seekTrigger='next';this.buttonWithFocus='next';this.handleNextTrack()}else if(whichButton==='rewind'){this.seekTrigger='rewind';this.handleRewind()}else if(whichButton==='forward'){this.seekTrigger='forward';this.handleFastForward()}else if(whichButton==='mute'){this.handleMute()}else if(whichButton==='volume'){this.handleVolume()}else if(whichButton==='faster'){this.handleRateIncrease()}else if(whichButton==='slower'){this.handleRateDecrease()}else if(whichButton==='captions'){this.handleCaptionToggle()}else if(whichButton==='chapters'){this.handleChapters()}else if(whichButton==='descriptions'){this.handleDescriptionToggle()}else if(whichButton==='sign'){if(!this.closingSign){this.handleSignToggle()}}else if(whichButton==='preferences'){if($(el).attr('data-prefs-popup')==='menu'){this.handlePrefsClick()}else{this.showingPrefsDialog=!0;this.closePopups();prefsPopup=$(el).attr('data-prefs-popup');if(prefsPopup==='keyboard'){this.keyboardPrefsDialog.show()}else if(prefsPopup==='captions'){this.captionPrefsDialog.show()}else if(prefsPopup==='descriptions'){this.descPrefsDialog.show()}else if(prefsPopup==='transcript'){this.transcriptPrefsDialog.show()}
this.showingPrefsDialog=!1}}else if(whichButton==='help'){this.handleHelpClick()}else if(whichButton==='transcript'){if(!this.closingTranscript){this.handleTranscriptToggle()}}else if(whichButton==='fullscreen'){this.clickedFullscreenButton=!0;this.handleFullscreenToggle()}};AblePlayer.prototype.okToHandleKeyPress=function(){var activeElement=AblePlayer.getActiveDOMElement();if($(activeElement).prop('tagName')==='INPUT'){return!1}else{return!0}};AblePlayer.prototype.onPlayerKeyPress=function(e){var which,$thisElement;which=e.which;if(which>=65&&which<=90){which+=32}
$thisElement=$(document.activeElement);if(which===27){console.log('onPlayerKeyPress, you pressed Escape');if($.contains(this.$transcriptArea[0],$thisElement[0])){console.log('element is part of the transcript area');this.handleTranscriptToggle();return!1}}
if(!this.okToHandleKeyPress()){console.log('NOT ok!');return!1}
if(!($(':focus').is('[contenteditable]')||$(':focus').is('input')||($(':focus').is('textarea')&&!this.stenoMode)||$(':focus').is('select')||e.target.hasAttribute('contenteditable')||e.target.tagName==='INPUT'||(e.target.tagName==='TEXTAREA'&&!this.stenoMode)||e.target.tagName==='SELECT')){if(which===27){console.log('You pushed ESC');this.closePopups()}else if(which===32){if($thisElement.attr('role')==='button'){e.preventDefault();$thisElement.click()}}else if(which===112){if(this.usingModifierKeys(e)){e.preventDefault();this.handlePlay()}}else if(which===115){if(this.usingModifierKeys(e)){e.preventDefault();this.handleRestart()}}else if(which===109){if(this.usingModifierKeys(e)){e.preventDefault();this.handleMute()}}else if(which===118){if(this.usingModifierKeys(e)){e.preventDefault();this.handleVolume()}}else if(which>=49&&which<=57){if(this.usingModifierKeys(e)){e.preventDefault();this.handleVolume(which)}}else if(which===99){if(this.usingModifierKeys(e)){e.preventDefault();this.handleCaptionToggle()}}else if(which===100){if(this.usingModifierKeys(e)){e.preventDefault();this.handleDescriptionToggle()}}else if(which===102){if(this.usingModifierKeys(e)){e.preventDefault();this.handleFastForward()}}else if(which===114){if(this.usingModifierKeys(e)){e.preventDefault();this.handleRewind()}}else if(which===98){if(this.usingModifierKeys(e)){e.preventDefault();this.handlePrevTrack()}}else if(which===110){if(this.usingModifierKeys(e)){e.preventDefault();this.handleNextTrack()}}else if(which===101){if(this.usingModifierKeys(e)){e.preventDefault();this.handlePrefsClick()}}else if(which===13){if($thisElement.attr('role')==='button'||$thisElement.prop('tagName')==='SPAN'){$thisElement.click()}else if($thisElement.prop('tagName')==='LI'){$thisElement.click()}}}};AblePlayer.prototype.addHtml5MediaListeners=function(){var thisObj=this;this.$media.on('emptied',function(){}).on('loadedmetadata',function(){thisObj.duration=thisObj.media.duration;thisObj.onMediaNewSourceLoad()}).on('canplay',function(){}).on('canplaythrough',function(){if(thisObj.playbackRate){thisObj.setPlaybackRate(thisObj.playbackRate)}
if(thisObj.userClickedPlaylist){if(!thisObj.startedPlaying){thisObj.playMedia()}
thisObj.userClickedPlaylist=!1}
if(thisObj.seekTrigger=='restart'||thisObj.seekTrigger=='chapter'||thisObj.seekTrigger=='transcript'||thisObj.seekTrigger=='search'){thisObj.playMedia()}else if(!thisObj.startedPlaying){if(thisObj.startTime>0){if(thisObj.seeking){thisObj.seeking=!1;if(thisObj.autoplay||thisObj.okToPlay){thisObj.playMedia()}}else{thisObj.seekTo(thisObj.startTime)}}else if(thisObj.defaultChapter&&typeof thisObj.selectedChapters!=='undefined'){thisObj.seekToChapter(thisObj.defaultChapter)}else{if(thisObj.autoplay||thisObj.okToPlay){thisObj.playMedia()}}}else if(thisObj.hasPlaylist){if((thisObj.playlistIndex!==thisObj.$playlist.length)||thisObj.loop){thisObj.playMedia()}}else{thisObj.getPlayerState().then(function(currentState){if(thisObj.swappingSrc&&(currentState==='stopped'||currentState==='paused')){thisObj.startedPlaying=!1;if(thisObj.swapTime>0){thisObj.seekTo(thisObj.swapTime)}else{thisObj.playMedia()}}})}}).on('play',function(){thisObj.refreshControls('playpause')}).on('playing',function(){thisObj.playing=!0;thisObj.paused=!1;thisObj.refreshControls('playpause')}).on('ended',function(){thisObj.playing=!1;thisObj.paused=!0;thisObj.onMediaComplete()}).on('progress',function(){thisObj.refreshControls('timeline')}).on('waiting',function(){}).on('durationchange',function(){thisObj.refreshControls('timeline')}).on('timeupdate',function(){thisObj.onMediaUpdateTime()}).on('pause',function(){if(!thisObj.clickedPlay){if(thisObj.hasPlaylist||thisObj.swappingSrc){}else{thisObj.playing=!1;thisObj.paused=!0}}else{thisObj.playing=!1;thisObj.paused=!0}
thisObj.clickedPlay=!1;thisObj.onMediaPause()}).on('ratechange',function(){}).on('volumechange',function(){thisObj.volume=thisObj.getVolume();if(thisObj.debug){console.log('media volume change to '+thisObj.volume+' ('+thisObj.volumeButton+')')}}).on('error',function(){if(thisObj.debug){switch(thisObj.media.error.code){case 1:console.log('HTML5 Media Error: MEDIA_ERR_ABORTED');break;case 2:console.log('HTML5 Media Error: MEDIA_ERR_NETWORK ');break;case 3:console.log('HTML5 Media Error: MEDIA_ERR_DECODE ');break;case 4:console.log('HTML5 Media Error: MEDIA_ERR_SRC_NOT_SUPPORTED ');break}}})};AblePlayer.prototype.addVimeoListeners=function(){var thisObj=this;this.vimeoPlayer.on('loaded',function(vimeoId){thisObj.onMediaNewSourceLoad()});this.vimeoPlayer.on('play',function(data){thisObj.playing=!0;thisObj.startedPlaying=!0;thisObj.paused=!1;thisObj.refreshControls('playpause')});this.vimeoPlayer.on('ended',function(data){thisObj.playing=!1;thisObj.paused=!0;thisObj.onMediaComplete()});this.vimeoPlayer.on('bufferstart',function(){});this.vimeoPlayer.on('bufferend',function(){});this.vimeoPlayer.on('progress',function(data){});this.vimeoPlayer.on('seeking',function(data){});this.vimeoPlayer.on('seeked',function(data){});this.vimeoPlayer.on('timeupdate',function(data){thisObj.onMediaUpdateTime(data.duration,data.seconds)});this.vimeoPlayer.on('pause',function(data){if(!thisObj.clickedPlay){if(thisObj.hasPlaylist||thisObj.swappingSrc){}else{thisObj.playing=!1;thisObj.paused=!0}}else{thisObj.playing=!1;thisObj.paused=!0}
thisObj.clickedPlay=!1;thisObj.onMediaPause();thisObj.refreshControls('playpause')});this.vimeoPlayer.on('playbackratechange',function(data){thisObj.vimeoPlaybackRate=data.playbackRate});this.vimeoPlayer.on('texttrackchange',function(data){});this.vimeoPlayer.on('volumechange',function(data){thisObj.volume=data.volume*10});this.vimeoPlayer.on('error',function(data){})};AblePlayer.prototype.addEventListeners=function(){var thisObj,whichButton,thisElement;thisObj=this;$(window).resize(function(){thisObj.onWindowResize()});if(window.MutationObserver){var target=this.$ableDiv[0];var observer=new MutationObserver(function(mutations){mutations.forEach(function(mutation){if(mutation.type==='attributes'&&mutation.attributeName==='style'){if(thisObj.$ableDiv.is(':visible')){thisObj.refreshControls('init')}}})});var config={attributes:!0,childList:!0,characterData:!0};observer.observe(target,config)}else{}
if(typeof this.seekBar!=='undefined'){this.addSeekbarListeners()}else{setTimeout(function(){if(typeof thisObj.seekBar!=='undefined'){thisObj.addSeekbarListeners()}},2000)}
this.$controllerDiv.find('div[role="button"]').on('click',function(e){e.stopPropagation();thisObj.onClickPlayerButton(this)});$(document).on('click',function(e){if(e.button!==0){return!1}
if($('.able-popup:visible').length||$('.able-volume-popup:visible')){thisObj.closePopups()}});this.$ableDiv.on('mousemove',function(){if(thisObj.controlsHidden){thisObj.fadeControls('in');thisObj.controlsHidden=!1;if(thisObj.hideControlsTimeoutStatus==='active'){window.clearTimeout(thisObj.hideControlsTimeout);thisObj.hideControlsTimeoutStatus='clear'}
if(thisObj.hideControls){thisObj.invokeHideControlsTimeout()}}else{if(thisObj.hideControlsTimeoutStatus==='active'){window.clearTimeout(thisObj.hideControlsTimeout);thisObj.hideControlsTimeoutStatus='clear';if(thisObj.hideControls){thisObj.invokeHideControlsTimeout()}}}});$(document).keydown(function(e){if(thisObj.controlsHidden){thisObj.fadeControls('in');thisObj.controlsHidden=!1;if(thisObj.hideControlsTimeoutStatus==='active'){window.clearTimeout(thisObj.hideControlsTimeout);thisObj.hideControlsTimeoutStatus='clear'}
if(thisObj.hideControls){thisObj.invokeHideControlsTimeout()}}else{if(thisObj.hideControlsTimeoutStatus==='active'){window.clearTimeout(thisObj.hideControlsTimeout);thisObj.hideControlsTimeoutStatus='clear';if(thisObj.hideControls){thisObj.invokeHideControlsTimeout()}}}});this.$ableDiv.keydown(function(e){if(AblePlayer.nextIndex>1){thisObj.onPlayerKeyPress(e)}});if(this.$transcriptArea){this.$transcriptArea.on('keydown',function(e){if(AblePlayer.nextIndex>1){thisObj.onPlayerKeyPress(e)}})}
if(this.$playlist){this.$playlist.click(function(e){if(!thisObj.userClickedPlaylist){thisObj.userClickedPlaylist=!0;thisObj.playlistIndex=$(this).index();thisObj.cuePlaylistItem(thisObj.playlistIndex)}})}
this.$media.click(function(){thisObj.handlePlay()});if(this.player==='html5'){this.addHtml5MediaListeners()}else if(this.player==='vimeo'){this.addVimeoListeners()}else if(this.player==='youtube'){setInterval(function(){thisObj.onMediaUpdateTime()},300)}}})(jQuery);(function($){AblePlayer.prototype.initDragDrop=function(which){var thisObj,$window,$toolbar,windowName,$resizeHandle,resizeZIndex;thisObj=this;if(which==='transcript'){$window=this.$transcriptArea;windowName='transcript-window';$toolbar=this.$transcriptToolbar}else if(which==='sign'){$window=this.$signWindow;windowName='sign-window';$toolbar=this.$signToolbar}
$toolbar.addClass('able-draggable');$resizeHandle=$('<div>',{'class':'able-resizable'});resizeZIndex=parseInt($window.css('z-index'))+100;$resizeHandle.css('z-index',resizeZIndex);$window.append($resizeHandle);$toolbar.on('mousedown mouseup touchstart touchend',function(e){e.stopPropagation();if(e.type==='mousedown'||e.type==='touchstart'){if(!thisObj.windowMenuClickRegistered){thisObj.windowMenuClickRegistered=!0;thisObj.startMouseX=e.pageX;thisObj.startMouseY=e.pageY;thisObj.dragDevice='mouse';thisObj.startDrag(which,$window)}}else if(e.type==='mouseup'||e.type==='touchend'){if(thisObj.dragging&&thisObj.dragDevice==='mouse'){thisObj.endDrag(which)}}
return!1});$resizeHandle.on('mousedown mouseup touchstart touchend',function(e){e.stopPropagation();if(e.type==='mousedown'||e.type==='touchstart'){if(!thisObj.windowMenuClickRegistered){thisObj.windowMenuClickRegistered=!0;thisObj.startMouseX=e.pageX;thisObj.startMouseY=e.pageY;thisObj.startResize(which,$window)}}else if(e.type==='mouseup'||e.type==='touchend'){if(thisObj.resizing){thisObj.endResize(which)}}
return!1});$window.on('click',function(){if(!thisObj.windowMenuClickRegistered&&!thisObj.finishingDrag){thisObj.updateZIndex(which)}
thisObj.finishingDrag=!1});this.addWindowMenu(which,$window,windowName)};AblePlayer.prototype.addWindowMenu=function(which,$window,windowName){var thisObj,$windowAlert,menuId,$newButton,$buttonIcon,buttonImgSrc,$buttonImg,$buttonLabel,tooltipId,$tooltip,$popup,label,position,buttonHeight,buttonWidth,tooltipY,tooltipX,tooltipStyle,tooltip,$optionList,menuBaseId,options,i,$optionItem,option,menuId;thisObj=this;this.windowMenuClickRegistered=!1;this.finishingDrag=!1;$windowAlert=$('<div role="alert"></div>');$windowAlert.addClass('able-alert');$windowAlert.hide();$windowAlert.appendTo(this.$activeWindow);$windowAlert.css({top:$window.offset().top});menuId=this.mediaId+'-'+windowName+'-menu';$newButton=$('<button>',{'type':'button','tabindex':'0','aria-label':this.tt.windowButtonLabel,'aria-haspopup':'true','aria-controls':menuId,'class':'able-button-handler-preferences'});if(this.iconType==='font'){$buttonIcon=$('<span>',{'class':'icon-preferences','aria-hidden':'true'});$newButton.append($buttonIcon)}else{buttonImgSrc=this.rootPath+'button-icons/'+this.toolbarIconColor+'/preferences.png';$buttonImg=$('<img>',{'src':buttonImgSrc,'alt':'','role':'presentation'});$newButton.append($buttonImg)}
$buttonLabel=$('<span>',{'class':'able-clipped'}).text(this.tt.windowButtonLabel);$newButton.append($buttonLabel);tooltipId=this.mediaId+'-'+windowName+'-tooltip';$tooltip=$('<div>',{'class':'able-tooltip','id':tooltipId}).hide();$newButton.on('mouseenter focus',function(e){var label=$(this).attr('aria-label');var position=$(this).position();var buttonHeight=$(this).height();var buttonWidth=$(this).width();var tooltipY=position.top-buttonHeight-5;var tooltipX=0;var tooltipStyle={left:'',right:tooltipX+'px',top:tooltipY+'px'};var tooltip=AblePlayer.localGetElementById($newButton[0],tooltipId).text(label).css(tooltipStyle);thisObj.showTooltip(tooltip);$(this).on('mouseleave blur',function(){AblePlayer.localGetElementById($newButton[0],tooltipId).text('').hide()})});$popup=this.setupPopups(windowName);if(which==='transcript'){this.$transcriptAlert=$windowAlert;this.$transcriptPopupButton=$newButton;this.$transcriptPopup=$popup;this.$transcriptToolbar.prepend($windowAlert,$newButton,$tooltip,$popup)}else if(which==='sign'){this.$signAlert=$windowAlert;this.$signPopupButton=$newButton;this.$signPopup=$popup;this.$signToolbar.append($windowAlert,$newButton,$tooltip,$popup)}
$newButton.on('click mousedown keydown',function(e){if(thisObj.focusNotClick){return!1}
if(thisObj.dragging){thisObj.dragKeys(which,e);return!1}
e.stopPropagation();if(!thisObj.windowMenuClickRegistered&&!thisObj.finishingDrag){thisObj.handleWindowButtonClick(which,e)}
thisObj.finishingDrag=!1});this.addResizeDialog(which,$window)};AblePlayer.prototype.addResizeDialog=function(which,$window){var thisObj,$windowPopup,$windowButton,widthId,heightId,startingWidth,startingHeight,aspectRatio,$resizeForm,$resizeWrapper,$resizeWidthDiv,$resizeWidthInput,$resizeWidthLabel,$resizeHeightDiv,$resizeHeightInput,$resizeHeightLabel,tempWidth,tempHeight,$saveButton,$cancelButton,newWidth,newHeight,resizeDialog;thisObj=this;if(which==='transcript'){$windowPopup=this.$transcriptPopup;$windowButton=this.$transcriptPopupButton}else if(which==='sign'){$windowPopup=this.$signPopup;$windowButton=this.$signPopupButton}
widthId=this.mediaId+'-resize-'+which+'-width';heightId=this.mediaId+'-resize-'+which+'-height';startingWidth=$window.width();startingHeight=$window.height();aspectRatio=startingWidth/startingHeight;$resizeForm=$('<div></div>',{'class':'able-resize-form'});$resizeWrapper=$('<div></div>');$resizeWidthDiv=$('<div></div>');$resizeWidthInput=$('<input>',{'type':'text','id':widthId,'value':startingWidth});$resizeWidthLabel=$('<label>',{'for':widthId}).text(this.tt.width);$resizeHeightDiv=$('<div></div>');$resizeHeightInput=$('<input>',{'type':'text','id':heightId,'value':startingHeight});$resizeHeightLabel=$('<label>',{'for':heightId}).text(this.tt.height);if(which==='sign'){$resizeHeightInput.prop('readonly',!0);$resizeWidthInput.on('input',function(){tempWidth=$(this).val();tempHeight=Math.round(tempWidth/aspectRatio,0);$resizeHeightInput.val(tempHeight)})}
$saveButton=$('<button class="modal-button">'+this.tt.save+'</button>');$cancelButton=$('<button class="modal-button">'+this.tt.cancel+'</button>');$saveButton.on('click',function(){newWidth=$('#'+widthId).val();newHeight=$('#'+heightId).val();if(newWidth!==startingWidth||newHeight!==startingHeight){thisObj.resizeObject(which,newWidth,newHeight);thisObj.updateCookie(which)}
resizeDialog.hide();$windowPopup.hide();$windowButton.focus()});$cancelButton.on('click',function(){resizeDialog.hide();$windowPopup.hide();$windowButton.focus()});$resizeWidthDiv.append($resizeWidthLabel,$resizeWidthInput);$resizeHeightDiv.append($resizeHeightLabel,$resizeHeightInput);$resizeWrapper.append($resizeWidthDiv,$resizeHeightDiv);$resizeForm.append($resizeWrapper,'<hr>',$saveButton,$cancelButton);$('body').append($resizeForm);resizeDialog=new AccessibleDialog($resizeForm,$windowButton,'alert',this.tt.windowResizeHeading,$resizeWrapper,this.tt.closeButtonLabel,'20em');if(which==='transcript'){this.transcriptResizeDialog=resizeDialog}else if(which==='sign'){this.signResizeDialog=resizeDialog}};AblePlayer.prototype.handleWindowButtonClick=function(which,e){var thisObj,$windowPopup,$windowButton,$toolbar,popupTop;thisObj=this;if(this.focusNotClick){return!1}
if(which==='transcript'){$windowPopup=this.$transcriptPopup;$windowButton=this.$transcriptPopupButton;$toolbar=this.$transcriptToolbar}else if(which==='sign'){$windowPopup=this.$signPopup;$windowButton=this.$signPopupButton;$toolbar=this.$signToolbar}
if(e.type==='keydown'){if(e.which===32||e.which===13){this.windowMenuClickRegistered=!0}else if(e.which===27){if($windowPopup.is(':visible')){$windowPopup.hide('fast',function(){thisObj.windowMenuClickRegistered=!1;$windowPopup.find('li').removeClass('able-focus').attr('tabindex','-1');$windowButton.focus()})}else{if(which==='sign'){this.handleSignToggle()}else if(which==='transcript'){this.handleTranscriptToggle()}}}else{return!1}}else{this.windowMenuClickRegistered=!0}
if($windowPopup.is(':visible')){$windowPopup.hide(200,'',function(){thisObj.windowMenuClickRegistered=!1});$windowPopup.find('li').removeClass('able-focus');$windowButton.attr('aria-expanded','false').focus()}else{this.updateZIndex(which);popupTop=$windowButton.position().top+$windowButton.outerHeight();$windowPopup.css('top',popupTop);$windowPopup.show(200,'',function(){$windowButton.attr('aria-expanded','true');$(this).find('li').first().focus().addClass('able-focus');thisObj.windowMenuClickRegistered=!1})}};AblePlayer.prototype.handleMenuChoice=function(which,choice,e){var thisObj,$window,$windowPopup,$windowButton,resizeDialog,width,height,$thisRadio;thisObj=this;if(which==='transcript'){$window=this.$transcriptArea;$windowPopup=this.$transcriptPopup;$windowButton=this.$transcriptPopupButton;resizeDialog=this.transcriptResizeDialog}else if(which==='sign'){$window=this.$signWindow;$windowPopup=this.$signPopup;$windowButton=this.$signPopupButton;resizeDialog=this.signResizeDialog}
this.$activeWindow=$window;if(e.type==='keydown'){if(e.which===27){$windowPopup.hide('fast',function(){thisObj.windowMenuClickRegistered=!1;$windowPopup.find('li').removeClass('able-focus').attr('tabindex','-1');$windowButton.focus()});return!1}else{if(choice!=='close'){this.$activeWindow=$window}
return!1}}
$windowPopup.hide('fast',function(){thisObj.windowMenuClickRegistered=!1;$windowPopup.find('li').removeClass('able-focus').attr('tabindex','-1')});if(choice!=='close'){$windowButton.focus()}
if(choice==='move'){this.$activeWindow.attr('role','application');if(!this.showedAlert(which)){this.showAlert(this.tt.windowMoveAlert,which);if(which==='transcript'){this.showedTranscriptAlert=!0}else if(which==='sign'){this.showedSignAlert=!0}}
if(e.type==='keydown'){this.dragDevice='keyboard'}else{this.dragDevice='mouse'}
this.startDrag(which,$window);$windowPopup.hide().parent().focus()}else if(choice=='resize'){var resizeFields=resizeDialog.getInputs();if(resizeFields){resizeFields[0].value=$window.width();resizeFields[1].value=$window.height()}
resizeDialog.show()}else if(choice=='close'){if(which==='transcript'){this.closingTranscript=!0;this.handleTranscriptToggle()}else if(which==='sign'){this.closingSign=!0;this.handleSignToggle()}}};AblePlayer.prototype.startDrag=function(which,$element){var thisObj,$windowPopup,zIndex,startPos,newX,newY;thisObj=this;if(!this.$activeWindow){this.$activeWindow=$element}
this.dragging=!0;if(which==='transcript'){$windowPopup=this.$transcriptPopup}else if(which==='sign'){$windowPopup=this.$signPopup}
if(!this.showedAlert(which)){this.showAlert(this.tt.windowMoveAlert,which);if(which==='transcript'){this.showedTranscriptAlert=!0}else if(which==='sign'){this.showedSignAlert=!0}}
if($windowPopup.is(':visible')){$windowPopup.hide()}
this.updateZIndex(which);startPos=this.$activeWindow.position();this.dragStartX=startPos.left;this.dragStartY=startPos.top;if(typeof this.startMouseX==='undefined'){this.dragDevice='keyboard';this.dragKeyX=this.dragStartX;this.dragKeyY=this.dragStartY;this.startingDrag=!0}else{this.dragDevice='mouse';this.dragOffsetX=this.startMouseX-this.dragStartX;this.dragOffsetY=this.startMouseY-this.dragStartY}
this.$activeWindow.addClass('able-drag').css({'position':'absolute','top':this.dragStartY+'px','left':this.dragStartX+'px'}).focus();if(this.dragDevice==='mouse'){$(document).on('mousemove touchmove',function(e){if(thisObj.dragging){newX=e.pageX-thisObj.dragOffsetX;newY=e.pageY-thisObj.dragOffsetY;thisObj.resetDraggedObject(newX,newY)}})}else if(this.dragDevice==='keyboard'){this.$activeWindow.on('keydown',function(e){if(thisObj.dragging){thisObj.dragKeys(which,e)}})}
return!1};AblePlayer.prototype.dragKeys=function(which,e){var key,keySpeed;var thisObj=this;if(this.startingDrag){this.startingDrag=!1;return!1}
key=e.which;keySpeed=10;switch(key){case 37:case 63234:this.dragKeyX-=keySpeed;break;case 38:case 63232:this.dragKeyY-=keySpeed;break;case 39:case 63235:this.dragKeyX+=keySpeed;break;case 40:case 63233:this.dragKeyY+=keySpeed;break;case 13:case 27:this.endDrag(which);return!1;default:return!1}
this.resetDraggedObject(this.dragKeyX,this.dragKeyY);if(e.preventDefault){e.preventDefault()}
return!1};AblePlayer.prototype.resetDraggedObject=function(x,y){this.$activeWindow.css({'left':x+'px','top':y+'px'})},AblePlayer.prototype.resizeObject=function(which,width,height){var innerHeight;this.$activeWindow.css({'width':width+'px','height':height+'px'});if(which==='transcript'){innerHeight=height-50;this.$transcriptDiv.css('height',innerHeight+'px')}};AblePlayer.prototype.endDrag=function(which){var thisObj,$window,$windowPopup,$windowButton;thisObj=this;if(which==='transcript'){$windowPopup=this.$transcriptPopup;$windowButton=this.$transcriptPopupButton}else if(which==='sign'){$windowPopup=this.$signPopup;$windowButton=this.$signPopupButton}
$(document).off('mousemove mouseup touchmove touchup');this.$activeWindow.off('keydown').removeClass('able-drag');this.$activeWindow.attr('role','dialog');this.$activeWindow=null;if(this.dragDevice==='keyboard'){$windowButton.focus()}
this.dragging=!1;this.updateCookie(which);this.startMouseX=undefined;this.startMouseY=undefined;this.windowMenuClickRegistered=!1;this.finishingDrag=!0;setTimeout(function(){thisObj.finishingDrag=!1},100)};AblePlayer.prototype.isCloseToCorner=function($window,mouseX,mouseY){var tolerance,position,top,left,width,height,bottom,right;tolerance=10;position=$window.offset();top=position.top;left=position.left;width=$window.width();height=$window.height();bottom=top+height;right=left+width;if((Math.abs(bottom-mouseY)<=tolerance)&&(Math.abs(right-mouseX)<=tolerance)){return!0}
return!1};AblePlayer.prototype.startResize=function(which,$element){var thisObj,$windowPopup,zIndex,startPos,newWidth,newHeight;thisObj=this;this.$activeWindow=$element;this.resizing=!0;if(which==='transcript'){$windowPopup=this.$transcriptPopup}else if(which==='sign'){$windowPopup=this.$signPopup}
if($windowPopup.is(':visible')){$windowPopup.hide().parent().focus()}
startPos=this.$activeWindow.position();this.dragKeyX=this.dragStartX;this.dragKeyY=this.dragStartY;this.dragStartWidth=this.$activeWindow.width();this.dragStartHeight=this.$activeWindow.height();$(document).on('mousemove touchmove',function(e){if(thisObj.resizing){newWidth=thisObj.dragStartWidth+(e.pageX-thisObj.startMouseX);newHeight=thisObj.dragStartHeight+(e.pageY-thisObj.startMouseY);thisObj.resizeObject(which,newWidth,newHeight)}});return!1};AblePlayer.prototype.endResize=function(which){var $window,$windowPopup,$windowButton;if(which==='transcript'){$windowPopup=this.$transcriptPopup;$windowButton=this.$transcriptPopupButton}else if(which==='sign'){$windowPopup=this.$signPopup;$windowButton=this.$signPopupButton}
$(document).off('mousemove mouseup touchmove touchup');this.$activeWindow.off('keydown');$windowButton.show().focus();this.resizing=!1;this.$activeWindow.removeClass('able-resize');this.updateCookie(which);this.windowMenuClickRegistered=!1;this.finishingDrag=!0;setTimeout(function(){this.finishingDrag=!1},100)}})(jQuery);(function($){AblePlayer.prototype.initSignLanguage=function(){if(this.player==='html5'){this.signFile=this.$sources.first().attr('data-sign-src');if(this.signFile){if(this.isIOS()){this.hasSignLanguage=!1;if(this.debug){console.log('Sign language has been disabled due to IOS restrictions')}}else{if(this.debug){console.log('This video has an accompanying sign language video: '+this.signFile)}
this.hasSignLanguage=!0;this.injectSignPlayerCode()}}else{this.hasSignLanguage=!1}}else{this.hasSignLanguage=!1}};AblePlayer.prototype.injectSignPlayerCode=function(){var thisObj,signVideoId,signVideoWidth,i,signSrc,srcType,$signSource;thisObj=this;signVideoWidth=this.getDefaultWidth('sign');signVideoId=this.mediaId+'-sign';this.$signVideo=$('<video>',{'id':signVideoId,'tabindex':'-1'});this.signVideo=this.$signVideo[0];for(i=0;i<this.$sources.length;i++){signSrc=this.$sources[i].getAttribute('data-sign-src');srcType=this.$sources[i].getAttribute('type');if(signSrc){$signSource=$('<source>',{'src':signSrc,'type':srcType});this.$signVideo.append($signSource)}else{this.hasSignLanguage=!1;break}}
this.$signWindow=$('<div>',{'class':'able-sign-window','role':'dialog','aria-label':this.tt.sign});this.$signToolbar=$('<div>',{'class':'able-window-toolbar able-'+this.toolbarIconColor+'-controls'});this.$signWindow.append(this.$signToolbar,this.$signVideo);this.$ableWrapper.append(this.$signWindow);this.initDragDrop('sign');if(this.prefSign===1){this.positionDraggableWindow('sign',this.getDefaultWidth('sign'))}else{this.$signWindow.hide()}}})(jQuery);(function($){var isoLangs={"ab":{"name":"Abkhaz","nativeName":"аҧсуа"},"aa":{"name":"Afar","nativeName":"Afaraf"},"af":{"name":"Afrikaans","nativeName":"Afrikaans"},"ak":{"name":"Akan","nativeName":"Akan"},"sq":{"name":"Albanian","nativeName":"Shqip"},"am":{"name":"Amharic","nativeName":"አማርኛ"},"ar":{"name":"Arabic","nativeName":"العربية"},"an":{"name":"Aragonese","nativeName":"Aragonés"},"hy":{"name":"Armenian","nativeName":"Հայերեն"},"as":{"name":"Assamese","nativeName":"অসমীয়া"},"av":{"name":"Avaric","nativeName":"авар мацӀ, магӀарул мацӀ"},"ae":{"name":"Avestan","nativeName":"avesta"},"ay":{"name":"Aymara","nativeName":"aymar aru"},"az":{"name":"Azerbaijani","nativeName":"azərbaycan dili"},"bm":{"name":"Bambara","nativeName":"bamanankan"},"ba":{"name":"Bashkir","nativeName":"башҡорт теле"},"eu":{"name":"Basque","nativeName":"euskara, euskera"},"be":{"name":"Belarusian","nativeName":"Беларуская"},"bn":{"name":"Bengali","nativeName":"বাংলা"},"bh":{"name":"Bihari","nativeName":"भोजपुरी"},"bi":{"name":"Bislama","nativeName":"Bislama"},"bs":{"name":"Bosnian","nativeName":"bosanski jezik"},"br":{"name":"Breton","nativeName":"brezhoneg"},"bg":{"name":"Bulgarian","nativeName":"български език"},"my":{"name":"Burmese","nativeName":"ဗမာစာ"},"ca":{"name":"Catalan","nativeName":"Català"},"ch":{"name":"Chamorro","nativeName":"Chamoru"},"ce":{"name":"Chechen","nativeName":"нохчийн мотт"},"ny":{"name":"Chichewa","nativeName":"chiCheŵa, chinyanja"},"zh":{"name":"Chinese","nativeName":"中文 (Zhōngwén), 汉语, 漢語"},"cv":{"name":"Chuvash","nativeName":"чӑваш чӗлхи"},"kw":{"name":"Cornish","nativeName":"Kernewek"},"co":{"name":"Corsican","nativeName":"corsu, lingua corsa"},"cr":{"name":"Cree","nativeName":"ᓀᐦᐃᔭᐍᐏᐣ"},"hr":{"name":"Croatian","nativeName":"hrvatski"},"cs":{"name":"Czech","nativeName":"česky, čeština"},"da":{"name":"Danish","nativeName":"dansk"},"dv":{"name":"Divehi","nativeName":"ދިވެހި"},"nl":{"name":"Dutch","nativeName":"Nederlands, Vlaams"},"en":{"name":"English","nativeName":"English"},"eo":{"name":"Esperanto","nativeName":"Esperanto"},"et":{"name":"Estonian","nativeName":"eesti, eesti keel"},"ee":{"name":"Ewe","nativeName":"Eʋegbe"},"fo":{"name":"Faroese","nativeName":"føroyskt"},"fj":{"name":"Fijian","nativeName":"vosa Vakaviti"},"fi":{"name":"Finnish","nativeName":"suomi, suomen kieli"},"fr":{"name":"French","nativeName":"français, langue française"},"ff":{"name":"Fula","nativeName":"Fulfulde, Pulaar, Pular"},"gl":{"name":"Galician","nativeName":"Galego"},"ka":{"name":"Georgian","nativeName":"ქართული"},"de":{"name":"German","nativeName":"Deutsch"},"el":{"name":"Greek","nativeName":"Ελληνικά"},"gn":{"name":"Guaraní","nativeName":"Avañeẽ"},"gu":{"name":"Gujarati","nativeName":"ગુજરાતી"},"ht":{"name":"Haitian","nativeName":"Kreyòl ayisyen"},"ha":{"name":"Hausa","nativeName":"Hausa, هَوُسَ"},"he":{"name":"Hebrew","nativeName":"עברית"},"hz":{"name":"Herero","nativeName":"Otjiherero"},"hi":{"name":"Hindi","nativeName":"हिन्दी, हिंदी"},"ho":{"name":"Hiri Motu","nativeName":"Hiri Motu"},"hu":{"name":"Hungarian","nativeName":"Magyar"},"ia":{"name":"Interlingua","nativeName":"Interlingua"},"id":{"name":"Indonesian","nativeName":"Bahasa Indonesia"},"ie":{"name":"Interlingue","nativeName":"Originally called Occidental; then Interlingue after WWII"},"ga":{"name":"Irish","nativeName":"Gaeilge"},"ig":{"name":"Igbo","nativeName":"Asụsụ Igbo"},"ik":{"name":"Inupiaq","nativeName":"Iñupiaq, Iñupiatun"},"io":{"name":"Ido","nativeName":"Ido"},"is":{"name":"Icelandic","nativeName":"Íslenska"},"it":{"name":"Italian","nativeName":"Italiano"},"iu":{"name":"Inuktitut","nativeName":"ᐃᓄᒃᑎᑐᑦ"},"ja":{"name":"Japanese","nativeName":"日本語 (にほんご／にっぽんご)"},"jv":{"name":"Javanese","nativeName":"basa Jawa"},"kl":{"name":"Kalaallisut","nativeName":"kalaallisut, kalaallit oqaasii"},"kn":{"name":"Kannada","nativeName":"ಕನ್ನಡ"},"kr":{"name":"Kanuri","nativeName":"Kanuri"},"ks":{"name":"Kashmiri","nativeName":"कश्मीरी, كشميري‎"},"kk":{"name":"Kazakh","nativeName":"Қазақ тілі"},"km":{"name":"Khmer","nativeName":"ភាសាខ្មែរ"},"ki":{"name":"Kikuyu","nativeName":"Gĩkũyũ"},"rw":{"name":"Kinyarwanda","nativeName":"Ikinyarwanda"},"ky":{"name":"Kyrgyz","nativeName":"кыргыз тили"},"kv":{"name":"Komi","nativeName":"коми кыв"},"kg":{"name":"Kongo","nativeName":"KiKongo"},"ko":{"name":"Korean","nativeName":"한국어 (韓國語), 조선말 (朝鮮語)"},"ku":{"name":"Kurdish","nativeName":"Kurdî, كوردی‎"},"kj":{"name":"Kuanyama","nativeName":"Kuanyama"},"la":{"name":"Latin","nativeName":"latine, lingua latina"},"lb":{"name":"Luxembourgish","nativeName":"Lëtzebuergesch"},"lg":{"name":"Luganda","nativeName":"Luganda"},"li":{"name":"Limburgish","nativeName":"Limburgs"},"ln":{"name":"Lingala","nativeName":"Lingála"},"lo":{"name":"Lao","nativeName":"ພາສາລາວ"},"lt":{"name":"Lithuanian","nativeName":"lietuvių kalba"},"lu":{"name":"Luba-Katanga","nativeName":""},"lv":{"name":"Latvian","nativeName":"latviešu valoda"},"gv":{"name":"Manx","nativeName":"Gaelg, Gailck"},"mk":{"name":"Macedonian","nativeName":"македонски јазик"},"mg":{"name":"Malagasy","nativeName":"Malagasy fiteny"},"ms":{"name":"Malay","nativeName":"bahasa Melayu, بهاس ملايو‎"},"ml":{"name":"Malayalam","nativeName":"മലയാളം"},"mt":{"name":"Maltese","nativeName":"Malti"},"mi":{"name":"Māori","nativeName":"te reo Māori"},"mr":{"name":"Marathi","nativeName":"मराठी"},"mh":{"name":"Marshallese","nativeName":"Kajin M̧ajeļ"},"mn":{"name":"Mongolian","nativeName":"монгол"},"na":{"name":"Nauru","nativeName":"Ekakairũ Naoero"},"nv":{"name":"Navajo","nativeName":"Diné bizaad, Dinékʼehǰí"},"nb":{"name":"Norwegian Bokmål","nativeName":"Norsk bokmål"},"nd":{"name":"North Ndebele","nativeName":"isiNdebele"},"ne":{"name":"Nepali","nativeName":"नेपाली"},"ng":{"name":"Ndonga","nativeName":"Owambo"},"nn":{"name":"Norwegian Nynorsk","nativeName":"Norsk nynorsk"},"no":{"name":"Norwegian","nativeName":"Norsk"},"ii":{"name":"Nuosu","nativeName":"ꆈꌠ꒿ Nuosuhxop"},"nr":{"name":"South Ndebele","nativeName":"isiNdebele"},"oc":{"name":"Occitan","nativeName":"Occitan"},"oj":{"name":"Ojibwe","nativeName":"ᐊᓂᔑᓈᐯᒧᐎᓐ"},"cu":{"name":"Church Slavonic","nativeName":"ѩзыкъ словѣньскъ"},"om":{"name":"Oromo","nativeName":"Afaan Oromoo"},"or":{"name":"Oriya","nativeName":"ଓଡ଼ିଆ"},"os":{"name":"Ossetian","nativeName":"ирон æвзаг"},"pa":{"name":"Punjabi","nativeName":"ਪੰਜਾਬੀ, پنجابی‎"},"pi":{"name":"Pāli","nativeName":"पाऴि"},"fa":{"name":"Persian","nativeName":"فارسی"},"pl":{"name":"Polish","nativeName":"polski"},"ps":{"name":"Pashto","nativeName":"پښتو"},"pt":{"name":"Portuguese","nativeName":"Português"},"qu":{"name":"Quechua","nativeName":"Runa Simi, Kichwa"},"rm":{"name":"Romansh","nativeName":"rumantsch grischun"},"rn":{"name":"Kirundi","nativeName":"kiRundi"},"ro":{"name":"Romanian","nativeName":"română"},"ru":{"name":"Russian","nativeName":"русский язык"},"sa":{"name":"Sanskrit","nativeName":"संस्कृतम्"},"sc":{"name":"Sardinian","nativeName":"sardu"},"sd":{"name":"Sindhi","nativeName":"सिन्धी, سنڌي، سندھی‎"},"se":{"name":"Northern Sami","nativeName":"Davvisámegiella"},"sm":{"name":"Samoan","nativeName":"gagana faa Samoa"},"sg":{"name":"Sango","nativeName":"yângâ tî sängö"},"sr":{"name":"Serbian","nativeName":"српски језик"},"gd":{"name":"Gaelic","nativeName":"Gàidhlig"},"sn":{"name":"Shona","nativeName":"chiShona"},"si":{"name":"Sinhalese","nativeName":"සිංහල"},"sk":{"name":"Slovak","nativeName":"slovenčina"},"sl":{"name":"Slovene","nativeName":"slovenščina"},"so":{"name":"Somali","nativeName":"Soomaaliga, af Soomaali"},"st":{"name":"Southern Sotho","nativeName":"Sesotho"},"es":{"name":"Spanish","nativeName":"español, castellano"},"su":{"name":"Sundanese","nativeName":"Basa Sunda"},"sw":{"name":"Swahili","nativeName":"Kiswahili"},"ss":{"name":"Swati","nativeName":"SiSwati"},"sv":{"name":"Swedish","nativeName":"svenska"},"ta":{"name":"Tamil","nativeName":"தமிழ்"},"te":{"name":"Telugu","nativeName":"తెలుగు"},"tg":{"name":"Tajik","nativeName":"тоҷикӣ, toğikī, تاجیکی‎"},"th":{"name":"Thai","nativeName":"ไทย"},"ti":{"name":"Tigrinya","nativeName":"ትግርኛ"},"bo":{"name":"Tibetan","nativeName":"བོད་ཡིག"},"tk":{"name":"Turkmen","nativeName":"Türkmen, Түркмен"},"tl":{"name":"Tagalog","nativeName":"Wikang Tagalog, ᜏᜒᜃᜅ᜔ ᜆᜄᜎᜓᜄ᜔"},"tn":{"name":"Tswana","nativeName":"Setswana"},"to":{"name":"Tonga","nativeName":"faka Tonga"},"tr":{"name":"Turkish","nativeName":"Türkçe"},"ts":{"name":"Tsonga","nativeName":"Xitsonga"},"tt":{"name":"Tatar","nativeName":"татарча, tatarça, تاتارچا‎"},"tw":{"name":"Twi","nativeName":"Twi"},"ty":{"name":"Tahitian","nativeName":"Reo Tahiti"},"ug":{"name":"Uyghur","nativeName":"Uyƣurqə, ئۇيغۇرچە‎"},"uk":{"name":"Ukrainian","nativeName":"українська"},"ur":{"name":"Urdu","nativeName":"اردو"},"uz":{"name":"Uzbek","nativeName":"zbek, Ўзбек, أۇزبېك‎"},"ve":{"name":"Venda","nativeName":"Tshivenḓa"},"vi":{"name":"Vietnamese","nativeName":"Tiếng Việt"},"vo":{"name":"Volapük","nativeName":"Volapük"},"wa":{"name":"Walloon","nativeName":"Walon"},"cy":{"name":"Welsh","nativeName":"Cymraeg"},"wo":{"name":"Wolof","nativeName":"Wollof"},"fy":{"name":"Western Frisian","nativeName":"Frysk"},"xh":{"name":"Xhosa","nativeName":"isiXhosa"},"yi":{"name":"Yiddish","nativeName":"ייִדיש"},"yo":{"name":"Yoruba","nativeName":"Yorùbá"},"za":{"name":"Zhuang","nativeName":"Saɯ cueŋƅ, Saw cuengh"},"ar-dz":{"name":"Arabic (Algeria)","nativeName":"العربية (الجزائر)"},"ar-bh":{"name":"Arabic (Bahrain)","nativeName":"العربية (البحرين)"},"ar-eg":{"name":"Arabic (Egypt)","nativeName":"العربية (مصر)"},"ar-iq":{"name":"Arabic (Iraq)","nativeName":"العربية (العراق)"},"ar-jo":{"name":"Arabic (Jordan)","nativeName":"العربية (الأردن)"},"ar-kw":{"name":"Arabic (Kuwait)","nativeName":"العربية (الكويت)"},"ar-lb":{"name":"Arabic (Lebanon)","nativeName":"العربية (لبنان)"},"ar-ly":{"name":"Arabic (Libya)","nativeName":"العربية (ليبيا)"},"ar-ma":{"name":"Arabic (Morocco)","nativeName":"العربية (المملكة المغربية)"},"ar-om":{"name":"Arabic (Oman)","nativeName":"العربية (عمان)"},"ar-qa":{"name":"Arabic (Qatar)","nativeName":"العربية (قطر)"},"ar-sa":{"name":"Arabic (Saudi Arabia)","nativeName":"العربية (المملكة العربية السعودية)"},"ar-sy":{"name":"Arabic (Syria)","nativeName":"العربية (سوريا)"},"ar-tn":{"name":"Arabic (Tunisia)","nativeName":"العربية (تونس)"},"ar-ae":{"name":"Arabic (U.A.E.)","nativeName":"العربية (الإمارات العربية المتحدة)"},"ar-ye":{"name":"Arabic (Yemen)","nativeName":"العربية (اليمن)"},"de-at":{"name":"German (Austria)","nativeName":"Deutsch (Österreich)"},"de-li":{"name":"German (Liechtenstein)","nativeName":"Deutsch (Liechtenstein)"},"de-lu":{"name":"German (Luxembourg)","nativeName":"Deutsch (Luxemburg)"},"de-ch":{"name":"German (Switzerland)","nativeName":"Deutsch (Schweiz)"},"en-au":{"name":"English (Australia)","nativeName":"English (Australia)"},"en-bz":{"name":"English (Belize)","nativeName":"English (Belize)"},"en-ca":{"name":"English (Canada)","nativeName":"English (Canada)"},"en-ie":{"name":"English (Ireland)","nativeName":"English (Ireland)"},"en-jm":{"name":"English (Jamaica)","nativeName":"English (Jamaica)"},"en-nz":{"name":"English (New Zealand)","nativeName":""},"en-za":{"name":"English (South Africa)","nativeName":"English (South Africa)"},"en-tt":{"name":"English (Trinidad)","nativeName":"English (Trinidad y Tobago)"},"en-gb":{"name":"English (United Kingdom)","nativeName":"English (United Kingdom)"},"en-us":{"name":"English (United States)","nativeName":"English (United States)"},"es-ar":{"name":"Spanish (Argentina)","nativeName":"Español (Argentina)"},"es-bo":{"name":"Spanish (Bolivia)","nativeName":"Español (Bolivia)"},"es-cl":{"name":"Spanish (Chile)","nativeName":"Español (Chile)"},"es-co":{"name":"Spanish (Colombia)","nativeName":"Español (Colombia)"},"es-cr":{"name":"Spanish (Costa Rica)","nativeName":"Español (Costa Rica)"},"es-do":{"name":"Spanish (Dominican Republic)","nativeName":"Español (República Dominicana)"},"es-ec":{"name":"Spanish (Ecuador)","nativeName":"Español (Ecuador)"},"es-sv":{"name":"Spanish (El Salvador)","nativeName":"Español (El Salvador)"},"es-gt":{"name":"Spanish (Guatemala)","nativeName":"Español (Guatemala)"},"es-hn":{"name":"Spanish (Honduras)","nativeName":"Español (Honduras)"},"es-mx":{"name":"Spanish (Mexico)","nativeName":"Español (México)"},"es-ni":{"name":"Spanish (Nicaragua)","nativeName":"Español (Nicaragua)"},"es-pa":{"name":"Spanish (Panama)","nativeName":"Español (Panamá)"},"es-py":{"name":"Spanish (Paraguay)","nativeName":"Español (Paraguay)"},"es-pe":{"name":"Spanish (Peru)","nativeName":"Español (Perú)"},"es-pr":{"name":"Spanish (Puerto Rico)","nativeName":"Español (Puerto Rico)"},"es-uy":{"name":"Spanish (Uruguay)","nativeName":"Español (Uruguay)"},"es-ve":{"name":"Spanish (Venezuela)","nativeName":"Español (Venezuela)"},"fr-be":{"name":"French (Belgium)","nativeName":"français (Belgique)"},"fr-ca":{"name":"French (Canada)","nativeName":"français (Canada)"},"fr-lu":{"name":"French (Luxembourg)","nativeName":"français (Luxembourg)"},"fr-ch":{"name":"French (Switzerland)","nativeName":"français (Suisse)"},"it-ch":{"name":"Italian (Switzerland)","nativeName":"italiano (Svizzera)"},"nl-be":{"name":"Dutch (Belgium)","nativeName":"Nederlands (België)"},"pt-br":{"name":"Portuguese (Brazil)","nativeName":"Português (Brasil)"},"sv-fi":{"name":"Swedish (Finland)","nativeName":"svenska (Finland)"},"zh-hk":{"name":"Chinese (Hong Kong)","nativeName":"中文(香港特别行政區)"},"zh-cn":{"name":"Chinese (PRC)","nativeName":"中文(中华人民共和国)"},"zh-sg":{"name":"Chinese (Singapore)","nativeName":"中文(新加坡)"},"zh-tw":{"name":"Chinese Traditional (Taiwan)","nativeName":"中文（台灣）"}}
AblePlayer.prototype.getLanguageName=function(key){var lang=isoLangs[key];return lang?lang.name:undefined};AblePlayer.prototype.getLanguageNativeName=function(key){var lang=isoLangs[key];return lang?lang.nativeName:undefined}})(jQuery);(function($){AblePlayer.prototype.getSupportedLangs=function(){var langs=['ca','de','en','es','fr','he','it','ja','nb','nl','pt-br','tr','zh-tw'];return langs};AblePlayer.prototype.getTranslationText=function(){var deferred,thisObj,lang,thisObj,msg,translationFile,collapsedLang;deferred=$.Deferred();thisObj=this;if($('body').attr('lang')){lang=$('body').attr('lang').toLowerCase()}else if($('html').attr('lang')){lang=$('html').attr('lang').toLowerCase()}else{lang=null}
if(!this.forceLang){if(lang){if(lang!==this.lang){if($.inArray(lang,this.getSupportedLangs())!==-1){this.lang=lang}else{msg=lang+' is not currently supported. Using default language ('+this.lang+')';if(this.debug){console.log(msg)}}}}}
if(!this.searchLang){this.searchLang=this.lang}
translationFile=this.rootPath+'translations/'+this.lang+'.js';this.importTranslationFile(translationFile).then(function(result){collapsedLang=thisObj.lang.replace('-','');thisObj.tt=eval(collapsedLang);deferred.resolve()});return deferred.promise()};AblePlayer.prototype.importTranslationFile=function(translationFile){var deferred=$.Deferred();$.getScript(translationFile).done(function(translationVar,textStatus){deferred.resolve(translationVar)}).fail(function(jqxhr,settings,exception){deferred.fail()});return deferred.promise()}})(jQuery);(function($){AblePlayer.prototype.computeEndTime=function(startTime,durationTime){var SECONDS=0;var MINUTES=1;var HOURS=2;var startParts=startTime.split(':').reverse().map(function(value){return parseFloat(value)});var durationParts=durationTime.split(':').reverse().map(function(value){return parseFloat(value)});var endTime=startParts.reduce(function(acc,val,index){var sum=val+durationParts[index];if(index===SECONDS){if(sum>60){durationParts[index+1]+=1;sum-=60}
sum=sum.toFixed(3)}
if(index===MINUTES){if(sum>60){durationParts[index+1]+=1;sum-=60}}
if(sum<10){sum='0'+sum}
acc.push(sum);return acc},[]).reverse().join(':');return endTime};AblePlayer.prototype.ttml2webvtt=function(contents){var thisObj=this;var xml=thisObj.convert.xml2json(contents,{ignoreComment:!0,alwaysChildren:!0,compact:!0,spaces:2});var vttHeader='WEBVTT\n\n\n';var captions=JSON.parse(xml).tt.body.div.p;var vttCaptions=captions.reduce(function(acc,value,index){var text=value._text;var isArray=Array.isArray(text);var attributes=value._attributes;var endTime=thisObj.computeEndTime(attributes.begin,attributes.dur);var caption=thisObj.computeEndTime(attributes.begin,'00:00:0')+' --> '+thisObj.computeEndTime(attributes.begin,attributes.dur)+'\n'+(isArray?text.join('\n'):text)+'\n\n';return acc+caption},vttHeader);return vttCaptions}})(jQuery);
/*! Copyright (c) 2014 - Paul Tavares - purtuga - @paul_tavares - MIT License */
;(function($){$.doWhen=function(options){return $.Deferred(function(dfd){var opt=$.extend({},{when:null,exec:function(){},interval:100,attempts:100,delayed:0},options,{checkId:null}),startChecking=function(){if(opt.when()===!0){opt.exec.call(dfd.promise());dfd.resolve();return}
opt.checkId=setInterval(function(){if(opt.attempts===0){clearInterval(opt.checkId);dfd.reject()}else{--opt.attempts;if(opt.when()===!0){opt.attempts=0;clearInterval(opt.checkId);opt.exec.call(dfd.promise());dfd.resolve()}}},opt.interval)};if(opt.delayed>0){setTimeout(startChecking,Number(opt.delayed))}else{startChecking()}}).promise()}})(jQuery);(function($){AblePlayer.prototype.injectVTS=function(){var thisObj,tracks,$heading;var $instructions,$p1,$p2,$ul,$li1,$li2,$li3;var $fieldset,$legend,i,$radioDiv,radioId,$label,$radio;var $saveButton,$savedTable;thisObj=this;if($('#able-vts').length){if(this.vtsTracks.length){this.langs=[];this.getAllLangs(this.vtsTracks);this.vtsLang=this.lang;$heading=$('<h2>').text('Video Transcript Sorter');$('#able-vts').append($heading);this.$vtsAlert=$('<div>',{'id':'able-vts-alert','aria-live':'polite','aria-atomic':'true'})
$('#able-vts').append(this.$vtsAlert);$instructions=$('<div>',{'id':'able-vts-instructions'});$p1=$('<p>').text('Use the Video Transcript Sorter to perform any of the following tasks:');$ul=$('<ul>');$li1=$('<li>').text('Reorder chapters, descriptions, captions, and/or subtitles so they appear in the proper sequence in Able Player\'s auto-generated transcript.');$li2=$('<li>').text('Modify content or start/end times (all are directly editable within the table).');$li3=$('<li>').text('Insert new content, such as chapters or descriptions.');$p2=$('<p>').text('When finished editing, click the "Save Changes" button. This will auto-generate new content for all relevant timed text files (chapters, descriptions, captions, and/or subtitles), which can be copied and pasted into separate WebVTT files for use by Able Player.');$ul.append($li1,$li2,$li3);$instructions.append($p1,$ul,$p2);$('#able-vts').append($instructions);$fieldset=$('<fieldset>');$legend=$('<legend>').text('Select a language');$fieldset.append($legend)
for(i in this.langs){radioId='vts-lang-radio-'+this.langs[i];$radioDiv=$('<div>',{});$radio=$('<input>',{'type':'radio','name':'vts-lang','id':radioId,'value':this.langs[i]}).on('click',function(){thisObj.vtsLang=$(this).val();thisObj.showVtsAlert('Loading '+thisObj.getLanguageName(thisObj.vtsLang)+' tracks');thisObj.injectVtsTable('update',thisObj.vtsLang)});if(this.langs[i]==this.lang){$radio.prop('checked',!0)}
$label=$('<label>',{'for':radioId}).text(this.getLanguageName(this.langs[i]));$radioDiv.append($radio,$label);$fieldset.append($radioDiv)}
$('#able-vts').append($fieldset);$saveButton=$('<button>',{'type':'button','id':'able-vts-save','value':'save'}).text('Save Changes');$('#able-vts').append($saveButton);this.injectVtsTable('add',this.vtsLang);var kindOptions,beforeEditing,editedCell,editedContent,i,closestKind;kindOptions=['captions','chapters','descriptions','subtitles'];$('td[contenteditable="true"]').on('focus',function(){beforeEditing=$(this).text()}).on('blur',function(){if(beforeEditing!=$(this).text()){editedCell=$(this).index();editedContent=$(this).text();if(editedCell===1){if($.inArray(editedContent,kindOptions)===-1){if(editedContent.substr(0,1)==='s'){$(this).text('subtitles')}else if(editedContent.substr(0,1)==='d'){$(this).text('descriptions')}else if(editedContent.substr(0,2)==='ch'){$(this).text('chapters')}else{$(this).text('captions')}}}else if(editedCell===2||editedCell===3){$(this).text(thisObj.formatTimestamp(editedContent))}}}).on('keydown',function(e){e.stopPropagation()});$('#able-vts-save').on('click',function(e){e.stopPropagation();if($(this).attr('value')=='save'){$(this).attr('value','cancel').text('Return to Editor');$savedTable=$('#able-vts table');$('#able-vts-instructions').hide();$('#able-vts > fieldset').hide();$('#able-vts table').remove();$('#able-vts-icon-credit').remove();thisObj.parseVtsOutput($savedTable)}else{$(this).attr('value','save').text('Save Changes');$('#able-vts-output').remove();$('#able-vts-instructions').show();$('#able-vts > fieldset').show();$('#able-vts').append($savedTable);$('#able-vts').append(thisObj.getIconCredit());thisObj.showVtsAlert('Cancelling saving. Any edits you made have been restored in the VTS table.')}})}}};AblePlayer.prototype.setupVtsTracks=function(kind,lang,label,src,contents){var srcFile,vtsCues;srcFile=this.getFilenameFromPath(src);vtsCues=this.parseVtsTracks(contents);this.vtsTracks.push({'kind':kind,'language':lang,'label':label,'srcFile':srcFile,'cues':vtsCues})};AblePlayer.prototype.getFilenameFromPath=function(path){var lastSlash;lastSlash=path.lastIndexOf('/');if(lastSlash===-1){return path}else{return path.substr(lastSlash+1)}};AblePlayer.prototype.getFilenameFromTracks=function(kind,lang){for(var i=0;i<this.vtsTracks.length;i++){if(this.vtsTracks[i].kind===kind&&this.vtsTracks[i].language===lang){return this.vtsTracks[i].srcFile}}
return!1};AblePlayer.prototype.parseVtsTracks=function(contents){var rows,timeParts,cues,i,j,thisRow,nextRow,content,blankRow;rows=contents.split("\n");cues=[];i=0;while(i<rows.length){thisRow=rows[i];if(thisRow.indexOf(' --> ')!==-1){timeParts=thisRow.trim().split(' ');if(this.isValidTimestamp(timeParts[0])&&this.isValidTimestamp(timeParts[2])){content='';j=i+1;blankRow=!1;while(j<rows.length&&!blankRow){nextRow=rows[j].trim();if(nextRow.length>0){if(content.length>0){content+="\n"+nextRow}else{content+=nextRow}}else{blankRow=!0}
j++}
cues.push({'start':timeParts[0],'end':timeParts[2],'content':content});i=j}}else{i++}}
return cues};AblePlayer.prototype.isValidTimestamp=function(timestamp){if(/^[0-9:,.]*$/.test(timestamp)){return!0}else{return!1}};AblePlayer.prototype.formatTimestamp=function(timestamp){var firstPart,lastPart;var firstPart=timestamp.substr(0,timestamp.lastIndexOf('.')+1);var lastPart=timestamp.substr(timestamp.lastIndexOf('.')+1);if(lastPart.length>3){lastPart=lastPart.substr(0,3)}else if(lastPart.length<3){while(lastPart.length<3){lastPart+='0'}}
return firstPart+lastPart};AblePlayer.prototype.injectVtsTable=function(action,lang){var $table,headers,i,$tr,$th,$td,rows,rowNum,rowId;if(action==='update'){$('#able-vts table').remove();$('#able-vts-icon-credit').remove()}
$table=$('<table>',{'lang':lang});$tr=$('<tr>',{'lang':'en'});headers=['Row #','Kind','Start','End','Content','Actions'];for(i=0;i<headers.length;i++){$th=$('<th>',{'scope':'col'}).text(headers[i]);if(headers[i]==='Actions'){$th.addClass('actions')}
$tr.append($th)}
$table.append($tr);rows=this.getAllRows(lang);for(i=0;i<rows.length;i++){rowNum=i+1;rowId='able-vts-row-'+rowNum;$tr=$('<tr>',{'id':rowId,'class':'kind-'+rows[i].kind});$td=$('<td>').text(rowNum);$tr.append($td);$td=$('<td>',{'contenteditable':'true'}).text(rows[i].kind);$tr.append($td);$td=$('<td>',{'contenteditable':'true'}).text(rows[i].start);$tr.append($td);$td=$('<td>',{'contenteditable':'true'}).text(rows[i].end);$tr.append($td);$td=$('<td>',{'contenteditable':'true'}).text(rows[i].content);$tr.append($td);$td=this.addVtsActionButtons(rowNum,rows.length);$tr.append($td);$table.append($tr)}
$('#able-vts').append($table);$('#able-vts').append(this.getIconCredit())};AblePlayer.prototype.addVtsActionButtons=function(rowNum,numRows){var thisObj,$td,buttons,i,button,$button,$svg,$g,pathString,pathString2,$path,$path2;thisObj=this;$td=$('<td>');buttons=['up','down','insert','delete'];for(i=0;i<buttons.length;i++){button=buttons[i];if(button==='up'){if(rowNum>1){$button=$('<button>',{'id':'able-vts-button-up-'+rowNum,'title':'Move up','aria-label':'Move Row '+rowNum+' up'}).on('click',function(el){thisObj.onClickVtsActionButton(el.currentTarget)});$svg=$('<svg>',{'focusable':'false','aria-hidden':'true','x':'0px','y':'0px','width':'254.296px','height':'254.296px','viewBox':'0 0 254.296 254.296','style':'enable-background:new 0 0 254.296 254.296'});pathString='M249.628,176.101L138.421,52.88c-6.198-6.929-16.241-6.929-22.407,0l-0.381,0.636L4.648,176.101'+'c-6.198,6.897-6.198,18.052,0,24.981l0.191,0.159c2.892,3.305,6.865,5.371,11.346,5.371h221.937c4.577,0,8.613-2.161,11.41-5.594'+'l0.064,0.064C255.857,194.153,255.857,182.998,249.628,176.101z';$path=$('<path>',{'d':pathString});$g=$('<g>').append($path);$svg.append($g);$button.append($svg);$button.html($button.html());$td.append($button)}}else if(button==='down'){if(rowNum<numRows){$button=$('<button>',{'id':'able-vts-button-down-'+rowNum,'title':'Move down','aria-label':'Move Row '+rowNum+' down'}).on('click',function(el){thisObj.onClickVtsActionButton(el.currentTarget)});$svg=$('<svg>',{'focusable':'false','aria-hidden':'true','x':'0px','y':'0px','width':'292.362px','height':'292.362px','viewBox':'0 0 292.362 292.362','style':'enable-background:new 0 0 292.362 292.362'});pathString='M286.935,69.377c-3.614-3.617-7.898-5.424-12.848-5.424H18.274c-4.952,0-9.233,1.807-12.85,5.424'+'C1.807,72.998,0,77.279,0,82.228c0,4.948,1.807,9.229,5.424,12.847l127.907,127.907c3.621,3.617,7.902,5.428,12.85,5.428'+'s9.233-1.811,12.847-5.428L286.935,95.074c3.613-3.617,5.427-7.898,5.427-12.847C292.362,77.279,290.548,72.998,286.935,69.377z';$path=$('<path>',{'d':pathString});$g=$('<g>').append($path);$svg.append($g);$button.append($svg);$button.html($button.html());$td.append($button)}}else if(button==='insert'){$button=$('<button>',{'id':'able-vts-button-insert-'+rowNum,'title':'Insert row below','aria-label':'Insert row before Row '+rowNum}).on('click',function(el){thisObj.onClickVtsActionButton(el.currentTarget)});$svg=$('<svg>',{'focusable':'false','aria-hidden':'true','x':'0px','y':'0px','width':'401.994px','height':'401.994px','viewBox':'0 0 401.994 401.994','style':'enable-background:new 0 0 401.994 401.994'});pathString='M394,154.175c-5.331-5.33-11.806-7.994-19.417-7.994H255.811V27.406c0-7.611-2.666-14.084-7.994-19.414'+'C242.488,2.666,236.02,0,228.398,0h-54.812c-7.612,0-14.084,2.663-19.414,7.993c-5.33,5.33-7.994,11.803-7.994,19.414v118.775'+'H27.407c-7.611,0-14.084,2.664-19.414,7.994S0,165.973,0,173.589v54.819c0,7.618,2.662,14.086,7.992,19.411'+'c5.33,5.332,11.803,7.994,19.414,7.994h118.771V374.59c0,7.611,2.664,14.089,7.994,19.417c5.33,5.325,11.802,7.987,19.414,7.987'+'h54.816c7.617,0,14.086-2.662,19.417-7.987c5.332-5.331,7.994-11.806,7.994-19.417V255.813h118.77'+'c7.618,0,14.089-2.662,19.417-7.994c5.329-5.325,7.994-11.793,7.994-19.411v-54.819C401.991,165.973,399.332,159.502,394,154.175z';$path=$('<path>',{'d':pathString});$g=$('<g>').append($path);$svg.append($g);$button.append($svg);$button.html($button.html());$td.append($button)}else if(button==='delete'){$button=$('<button>',{'id':'able-vts-button-delete-'+rowNum,'title':'Delete row ','aria-label':'Delete Row '+rowNum}).on('click',function(el){thisObj.onClickVtsActionButton(el.currentTarget)});$svg=$('<svg>',{'focusable':'false','aria-hidden':'true','x':'0px','y':'0px','width':'508.52px','height':'508.52px','viewBox':'0 0 508.52 508.52','style':'enable-background:new 0 0 508.52 508.52'});pathString='M397.281,31.782h-63.565C333.716,14.239,319.478,0,301.934,0h-95.347'+'c-17.544,0-31.782,14.239-31.782,31.782h-63.565c-17.544,0-31.782,14.239-31.782,31.782h349.607'+'C429.063,46.021,414.825,31.782,397.281,31.782z';$path=$('<path>',{'d':pathString});pathString2='M79.456,476.737c0,17.544,14.239,31.782,31.782,31.782h286.042'+'c17.544,0,31.782-14.239,31.782-31.782V95.347H79.456V476.737z M333.716,174.804c0-8.772,7.151-15.891,15.891-15.891'+'c8.74,0,15.891,7.119,15.891,15.891v254.26c0,8.74-7.151,15.891-15.891,15.891c-8.74,0-15.891-7.151-15.891-15.891V174.804z'+'M238.369,174.804c0-8.772,7.119-15.891,15.891-15.891c8.74,0,15.891,7.119,15.891,15.891v254.26'+'c0,8.74-7.151,15.891-15.891,15.891c-8.772,0-15.891-7.151-15.891-15.891V174.804z M143.021,174.804'+'c0-8.772,7.119-15.891,15.891-15.891c8.772,0,15.891,7.119,15.891,15.891v254.26c0,8.74-7.119,15.891-15.891,15.891'+'c-8.772,0-15.891-7.151-15.891-15.891V174.804z';$path2=$('<path>',{'d':pathString2});$g=$('<g>').append($path,$path2);$svg.append($g);$button.append($svg);$button.html($button.html());$td.append($button)}}
return $td};AblePlayer.prototype.updateVtsActionButtons=function($buttons,nextRowNum){var i,$thisButton,id,label,newId,newLabel;for(i=0;i<$buttons.length;i++){$thisButton=$buttons.eq(i);id=$thisButton.attr('id');label=$thisButton.attr('aria-label');newId=id.replace(/[0-9]+/g,nextRowNum);newLabel=label.replace(/[0-9]+/g,nextRowNum);$thisButton.attr('id',newId);$thisButton.attr('aria-label',newLabel)}}
AblePlayer.prototype.getIconCredit=function(){var credit;credit='<div id="able-vts-icon-credit">'+'Action buttons made by <a href="https://www.flaticon.com/authors/elegant-themes">Elegant Themes</a> '+'from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a> '+'are licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" '+'target="_blank">CC 3.0 BY</a>'+'</div>';return credit};AblePlayer.prototype.getAllLangs=function(tracks){var i;for(i in tracks){if(tracks[i].hasOwnProperty('language')){if($.inArray(tracks[i].language,this.langs)===-1){this.langs[this.langs.length]=tracks[i].language}}}};AblePlayer.prototype.getAllRows=function(lang){var i,track,c,cues;cues=[];for(i=0;i<this.vtsTracks.length;i++){track=this.vtsTracks[i];if(track.language==lang){for(c in track.cues){cues.push({'kind':track.kind,'lang':lang,'id':track.cues[c].id,'start':track.cues[c].start,'end':track.cues[c].end,'content':track.cues[c].content})}}}
cues.sort(function(a,b){return a.start>b.start?1:-1});return cues};AblePlayer.prototype.onClickVtsActionButton=function(el){var idParts,action,rowNum;idParts=$(el).attr('id').split('-');action=idParts[3];rowNum=idParts[4];if(action=='up'){this.moveRow(rowNum,'up')}else if(action=='down'){this.moveRow(rowNum,'down')}else if(action=='insert'){this.insertRow(rowNum)}else if(action=='delete'){this.deleteRow(rowNum)}};AblePlayer.prototype.insertRow=function(rowNum){var $table,$rows,numRows,newRowNum,newRowId,newTimes,$tr,$td;var $select,options,i,$option,newKind,newClass,$parentRow;var i,nextRowNum,$buttons;$table=$('#able-vts table');$rows=$table.find('tr');numRows=$rows.length-1;newRowNum=parseInt(rowNum)+1;newRowId='able-vts-row-'+newRowNum;$tr=$('<tr>',{'id':newRowId});$td=$('<td>').text(newRowNum);$tr.append($td);newKind=null;$select=$('<select>',{'id':'able-vts-kind-'+newRowNum,'aria-label':'What kind of track is this?','placeholder':'Select a kind'}).on('change',function(){newKind=$(this).val();newClass='kind-'+newKind;$parentRow=$(this).closest('tr');$(this).parent().text(newKind);$parentRow.addClass(newClass)});options=['','captions','chapters','descriptions','subtitles'];for(i=0;i<options.length;i++){$option=$('<option>',{'value':options[i]}).text(options[i]);$select.append($option)}
$td=$('<td>').append($select);$tr.append($td);$td=$('<td>',{'contenteditable':'true'});$tr.append($td);$td=$('<td>',{'contenteditable':'true'});$tr.append($td);$td=$('<td>',{'contenteditable':'true'});$tr.append($td);$td=this.addVtsActionButtons(newRowNum,numRows);$tr.append($td);$table.find('tr').eq(rowNum).after($tr);for(i=newRowNum;i<=numRows;i++){nextRowNum=i+1;$rows.eq(i).attr('id','able-vts-row-'+nextRowNum);$rows.eq(i).find('td').eq(0).text(nextRowNum);$buttons=$rows.eq(i).find('button');this.updateVtsActionButtons($buttons,nextRowNum)}
this.adjustTimes(newRowNum);this.showVtsAlert('A new row '+newRowNum+' has been inserted');$select.focus()};AblePlayer.prototype.deleteRow=function(rowNum){var $table,$rows,numRows,i,nextRowNum,$buttons;$table=$('#able-vts table');$table[0].deleteRow(rowNum);$rows=$table.find('tr');numRows=$rows.length-1;for(i=rowNum;i<=numRows;i++){nextRowNum=i;$rows.eq(i).attr('id','able-vts-row-'+nextRowNum);$rows.eq(i).find('td').eq(0).text(nextRowNum);$buttons=$rows.eq(i).find('button');this.updateVtsActionButtons($buttons,nextRowNum)}
this.showVtsAlert('Row '+rowNum+' has been deleted')};AblePlayer.prototype.moveRow=function(rowNum,direction){var $rows,$thisRow,otherRowNum,$otherRow,newTimes,msg;$rows=$('#able-vts table').find('tr');$thisRow=$('#able-vts table').find('tr').eq(rowNum);if(direction=='up'){otherRowNum=parseInt(rowNum)-1;$otherRow=$('#able-vts table').find('tr').eq(otherRowNum);$otherRow.before($thisRow)}else if(direction=='down'){otherRowNum=parseInt(rowNum)+1;$otherRow=$('#able-vts table').find('tr').eq(otherRowNum);$otherRow.after($thisRow)}
$thisRow.attr('id','able-vts-row-'+otherRowNum);$thisRow.find('td').eq(0).text(otherRowNum);this.updateVtsActionButtons($thisRow.find('button'),otherRowNum);$otherRow.attr('id','able-vts-row-'+rowNum);$otherRow.find('td').eq(0).text(rowNum);this.updateVtsActionButtons($otherRow.find('button'),rowNum);this.adjustTimes(otherRowNum);msg='Row '+rowNum+' has been moved '+direction;msg+=' and is now Row '+otherRowNum;this.showVtsAlert(msg)};AblePlayer.prototype.adjustTimes=function(rowNum){var minDuration,$rows,prevRowNum,nextRowNum,$row,$prevRow,$nextRow,kind,prevKind,nextKind,start,prevStart,nextStart,end,prevEnd,nextEnd;minDuration=[];minDuration.captions=.001;minDuration.descriptions=.001;minDuration.chapters=.001;$rows=$('#able-vts table').find('tr');$row=$rows.eq(rowNum);if($row.is('[class^="kind-"]')){kind=this.getKindFromClass($row.attr('class'))}else{kind='captions'}
start=this.getSecondsFromColonTime($row.find('td').eq(2).text());end=this.getSecondsFromColonTime($row.find('td').eq(3).text());if(rowNum>1){prevRowNum=rowNum-1;$prevRow=$rows.eq(prevRowNum);if($prevRow.is('[class^="kind-"]')){prevKind=this.getKindFromClass($prevRow.attr('class'))}else{prevKind=null}
prevStart=this.getSecondsFromColonTime($prevRow.find('td').eq(2).text());prevEnd=this.getSecondsFromColonTime($prevRow.find('td').eq(3).text())}else{prevRowNum=null;$prevRow=null;prevKind=null;prevStart=null;prevEnd=null}
if(rowNum<($rows.length-1)){nextRowNum=rowNum+1;$nextRow=$rows.eq(nextRowNum);if($nextRow.is('[class^="kind-"]')){nextKind=this.getKindFromClass($nextRow.attr('class'))}else{nextKind=null}
nextStart=this.getSecondsFromColonTime($nextRow.find('td').eq(2).text());nextEnd=this.getSecondsFromColonTime($nextRow.find('td').eq(3).text())}else{nextRowNum=null;$nextRow=null;nextKind=null;nextStart=null;nextEnd=null}
if(isNaN(start)){if(prevKind==null){prevKind='captions';$prevRow.attr('class','kind-captions');$prevRow.find('td').eq(1).html('captions')}
if(prevKind==='captions'){start=(parseFloat(prevEnd)+.001).toFixed(3);if(nextStart){end=(parseFloat(nextStart)-.001).toFixed(3)}else{end=(parseFloat(start)+minDuration[kind]).toFixed(3)}}else if(prevKind==='chapters'){start=(parseFloat(prevStart)+.001).toFixed(3);if(nextStart){end=(parseFloat(nextStart)-.001).toFixed(3)}else{end=(parseFloat(start)+minDurartion[kind]).toFixed(3)}}else if(prevKind==='descriptions'){start=(parseFloat(prevStart)+minDuration.descriptions).toFixed(3);end=(parseFloat(start)+minDuration.descriptions).toFixed(3)}}else{if(prevStart){if(prevStart<start){if(start<nextStart){}else{nextStart=(parseFloat(start)+minDuration[kind]).toFixed(3);nextEnd=(parseFloat(nextStart)+minDuration[nextKind]).toFixed(3)}}else{start=(parseFloat(prevStart)+minDuration[prevKind]).toFixed(3);end=(parseFloat(start)+minDuration[kind]).toFixed(3)}}else{if(start<nextStart){}else{nextStart=(parseFloat(start)+minDuration[kind]).toFixed(3);nextEnd=(parseFloat(nextStart)+minDuration[nextKind]).toFixed(3)}}}
if(end-start<minDuration[kind]){end=(parseFloat(start)+minDuration[kind]).toFixed(3);if(nextStart){nextStart=(parseFloat(end)+.001).toFixed(3)}}
$row.find('td').eq(2).text(this.formatSecondsAsColonTime(start,!0));$row.find('td').eq(3).text(this.formatSecondsAsColonTime(end,!0));if($prevRow){$prevRow.find('td').eq(2).text(this.formatSecondsAsColonTime(prevStart,!0));$prevRow.find('td').eq(3).text(this.formatSecondsAsColonTime(prevEnd,!0))}
if($nextRow){$nextRow.find('td').eq(2).text(this.formatSecondsAsColonTime(nextStart,!0));$nextRow.find('td').eq(3).text(this.formatSecondsAsColonTime(nextEnd,!0))}};AblePlayer.prototype.getKindFromClass=function(myclass){var kindStart,kindEnd,kindLength,kind;kindStart=myclass.indexOf('kind-')+5;kindEnd=myclass.indexOf(' ',kindStart);if(kindEnd==-1){kindLength=myclass.length-kindStart}else{kindLength=kindEnd-kindStart}
kind=myclass.substr(kindStart,kindLength);return kind};AblePlayer.prototype.showVtsAlert=function(message){this.$vtsAlert.text(message).show().delay(3000).fadeOut('slow')};AblePlayer.prototype.parseVtsOutput=function($table){var lang,i,kinds,kind,vtt,$rows,start,end,content,$output;lang=$table.attr('lang');kinds=['captions','chapters','descriptions','subtitles'];vtt={};for(i=0;i<kinds.length;i++){kind=kinds[i];vtt[kind]='WEBVTT'+"\n\n"}
$rows=$table.find('tr');if($rows.length>0){for(i=0;i<$rows.length;i++){kind=$rows.eq(i).find('td').eq(1).text();if($.inArray(kind,kinds)!==-1){start=$rows.eq(i).find('td').eq(2).text();end=$rows.eq(i).find('td').eq(3).text();content=$rows.eq(i).find('td').eq(4).text();if(start!==undefined&&end!==undefined){vtt[kind]+=start+' --> '+end+"\n";if(content!=='undefined'){vtt[kind]+=content}
vtt[kind]+="\n\n"}}}}
$output=$('<div>',{'id':'able-vts-output'})
$('#able-vts').append($output);for(i=0;i<kinds.length;i++){kind=kinds[i];if(vtt[kind].length>8){this.showWebVttOutput(kind,vtt[kind],lang)}}};AblePlayer.prototype.showWebVttOutput=function(kind,vttString,lang){var $heading,filename,$p,pText,$textarea;$heading=$('<h3>').text(kind.charAt(0).toUpperCase()+kind.slice(1));filename=this.getFilenameFromTracks(kind,lang);pText='If you made changes, copy/paste the following content ';if(filename){pText+='to replace the original content of your '+this.getLanguageName(lang)+' ';pText+='<em>'+kind+'</em> WebVTT file (<strong>'+filename+'</strong>).'}else{pText+='into a new '+this.getLanguageName(lang)+' <em>'+kind+'</em> WebVTT file.'}
$p=$('<p>',{'class':'able-vts-output-instructions'}).html(pText);$textarea=$('<textarea>').text(vttString);$('#able-vts-output').append($heading,$p,$textarea)}})(jQuery);(function($){AblePlayer.prototype.initVimeoPlayer=function(){var thisObj,deferred,promise,containerId,vimeoId,autoplay,videoDimensions,options;thisObj=this;deferred=new $.Deferred();promise=deferred.promise();containerId=this.mediaId+'_vimeo';this.$mediaContainer.prepend($('<div>').attr('id',containerId));if(this.vimeoDescId&&this.prefDesc){vimeoId=this.vimeoDescId}else{vimeoId=this.vimeoId}
this.activeVimeoId=vimeoId;if(this.autoplay&&this.okToPlay){autoplay='true'}else{autoplay='false'}
videoDimensions=this.getVimeoDimensions(this.activeVimeoId,containerId);if(videoDimensions){this.vimeoWidth=videoDimensions[0];this.vimeoHeight=videoDimensions[1];this.aspectRatio=thisObj.ytWidth/thisObj.ytHeight}else{this.vimeoWidth=null;this.vimeoHeight=null}
options={id:vimeoId,width:this.vimeoWidth,controls:!1};this.vimeoPlayer=new Vimeo.Player(containerId,options);this.vimeoPlayer.ready().then(function(){if(!thisObj.hasPlaylist){thisObj.$media.remove();thisObj.vimeoPlaybackRate=1;thisObj.vimeoPlayer.setPlaybackRate(thisObj.vimeoPlaybackRate).then(function(playbackRate){thisObj.vimeoSupportsPlaybackRateChange=!0}).catch(function(error){thisObj.vimeoSupportsPlaybackRateChange=!1});deferred.resolve()}});return promise};AblePlayer.prototype.getVimeoPaused=function(){var deferred,promise;deferred=new $.Deferred();promise=deferred.promise();this.vimeoPlayer.getPaused().then(function(paused){deferred.resolve(paused)});return promise}
AblePlayer.prototype.getVimeoEnded=function(){var deferred,promise;deferred=new $.Deferred();promise=deferred.promise();this.vimeoPlayer.getEnded().then(function(ended){deferred.resolve(ended)});return promise}
AblePlayer.prototype.getVimeoState=function(){var thisObj,deferred,promise,promises,gettingPausedPromise,gettingEndedPromise;thisObj=this;deferred=new $.Deferred();promise=deferred.promise();promises=[];gettingPausedPromise=this.vimeoPlayer.getPaused();gettingEndedPromise=this.vimeoPlayer.getEnded();promises.push(gettingPausedPromise);promises.push(gettingEndedPromise);gettingPausedPromise.then(function(paused){deferred.resolve(paused)});gettingEndedPromise.then(function(ended){deferred.resolve(ended)});$.when.apply($,promises).then(function(){deferred.resolve()});return promise}
AblePlayer.prototype.getVimeoDimensions=function(vimeoContainerId){var d,url,$iframe,width,height;d=[];if(typeof this.playerMaxWidth!=='undefined'){d[0]=this.playerMaxWidth;if(typeof this.playerMaxHeight!=='undefined'){d[1]=this.playerMaxHeight}
return d}else{if(typeof $('#'+vimeoContainerId)!=='undefined'){$iframe=$('#'+vimeoContainerId);width=$iframe.width();height=$iframe.height();if(width>0&&height>0){d[0]=width;d[1]=height;return d}}}
return!1};AblePlayer.prototype.resizeVimeoPlayer=function(youTubeId,youTubeContainerId){var d,width,height;if(typeof this.aspectRatio!=='undefined'){if(this.restoringAfterFullScreen){if(this.youTubePlayer){this.youTubePlayer.setSize(this.ytWidth,this.ytHeight)}
this.restoringAfterFullScreen=!1}else{width=this.$ableWrapper.parent().width();height=Math.round(width/this.aspectRatio);this.$ableWrapper.css({'max-width':width+'px','width':''});this.youTubePlayer.setSize(width,height);if(this.fullscreen){this.youTubePlayer.setSize(width,height)}else{this.youTubePlayer.setSize(this.ytWidth,this.ytHeight)}}}else{d=this.getYouTubeDimensions(youTubeId,youTubeContainerId);if(d){width=d[0];height=d[1];if(width>0&&height>0){this.aspectRatio=width/height;this.ytWidth=width;this.ytHeight=height;if(width!==this.$ableWrapper.width()){width=this.$ableWrapper.width();height=Math.round(width/this.aspectRatio);if(this.youTubePlayer){this.youTubePlayer.setSize(width,height)}}}}}};AblePlayer.prototype.setupVimeoCaptions=function(){var deferred=new $.Deferred();var promise=deferred.promise();var thisObj,googleApiPromise,youTubeId,i;thisObj=this;if(this.youTubeDescId&&this.prefDesc){youTubeId=this.youTubeDescId}else{youTubeId=this.youTubeId}
if(typeof youTubeDataAPIKey!=='undefined'){$.doWhen({when:function(){return googleApiReady},interval:100,attempts:1000}).done(function(){deferred.resolve()}).fail(function(){console.log('Unable to initialize Google API. YouTube captions are currently unavailable.')})}else{deferred.resolve()}
return promise};AblePlayer.prototype.getVimeoCaptionTracks=function(){var deferred=new $.Deferred();var promise=deferred.promise();var thisObj,i,trackId,isDefaultTrack;thisObj=this;this.vimeoPlayer.getTextTracks().then(function(tracks){if(tracks.length){for(i=0;i<tracks.length;i++){thisObj.hasCaptions=!0;thisObj.usingVimeoCaptions=!0;if(thisObj.prefCaptions===1){thisObj.captionsOn=!0}else{thisObj.captionsOn=!1}
if(tracks[i].language===thisObj.lang){isDefaultTrack=!0}else{isDefaultTrack=!1}
thisObj.tracks.push({'kind':tracks[i].kind,'language':tracks[i].language,'label':tracks[i].label,'def':isDefaultTrack})}
thisObj.setupPopups('captions');deferred.resolve()}else{thisObj.hasCaptions=!1;thisObj.usingVimeoCaptions=!1;deferred.resolve()}});return promise};AblePlayer.prototype.initVimeoCaptionModule=function(){var options,fontSize,displaySettings;options=this.youTubePlayer.getOptions();if(options.length){for(var i=0;i<options.length;i++){if(options[i]=='cc'){this.ytCaptionModule='cc';if(!this.hasCaptions){this.hasCaptions=!0;this.usingYouTubeCaptions=!0}
break}else if(options[i]=='captions'){this.ytCaptionModule='captions';if(!this.hasCaptions){this.hasCaptions=!0;this.usingYouTubeCaptions=!0}
break}}
if(typeof this.ytCaptionModule!=='undefined'){if(this.usingYouTubeCaptions){this.youTubePlayer.setOption(this.ytCaptionModule,'track',{'languageCode':this.captionLang});this.youTubePlayer.setOption(this.ytCaptionModule,'fontSize',this.translatePrefs('size',this.prefCaptionsSize,'youtube'))}else{this.youTubePlayer.unloadModule(this.ytCaptionModule)}}}else{this.hasCaptions=!1;this.usingYouTubeCaptions=!1}
this.refreshControls('captions')};AblePlayer.prototype.getVimeoPosterUrl=function(youTubeId,width){var url='https://img.youtube.com/vi/'+youTubeId;if(width=='120'){return url+'/default.jpg'}else if(width=='320'){return url+'/hqdefault.jpg'}else if(width=='480'){return url+'/hqdefault.jpg'}else if(width=='640'){return url+'/sddefault.jpg'}
return!1}})(jQuery);!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.dayjs=e()}(this,function(){"use strict";var t="millisecond",e="second",n="minute",r="hour",s="day",i="week",a="month",u="year",c=/^(\d{4})-?(\d{1,2})-?(\d{0,2})(.*?(\d{1,2}):(\d{1,2}):(\d{1,2}))?.?(\d{1,3})?$/,o=/\[.*?\]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,h={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},d=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},f={padStart:d,padZoneStr:function(t){var e=Math.abs(t),n=Math.floor(e/60),r=e%60;return(t<=0?"+":"-")+d(n,2,"0")+":"+d(r,2,"0")},monthDiff:function(t,e){var n=12*(e.year()-t.year())+(e.month()-t.month()),r=t.clone().add(n,"months"),s=e-r<0,i=t.clone().add(n+(s?-1:1),"months");return Number(-(n+(e-r)/(s?r-i:i-r)))},absFloor:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},prettyUnit:function(c){return{M:a,y:u,w:i,d:s,h:r,m:n,s:e,ms:t}[c]||String(c||"").toLowerCase().replace(/s$/,"")},isUndefined:function(t){return void 0===t}},$="en",l={};l[$]=h;var m=function(t){return t instanceof D},y=function(t,e,n){var r;if(!t)return null;if("string"==typeof t)l[t]&&(r=t),e&&(l[t]=e,r=t);else{var s=t.name;l[s]=t,r=s}return n||($=r),r},M=function(t,e){if(m(t))return t.clone();var n=e||{};return n.date=t,new D(n)},S=function(t,e){return M(t,{locale:e.$L})},p=f;p.parseLocale=y,p.isDayjs=m,p.wrapper=S;var D=function(){function h(t){this.parse(t)}var d=h.prototype;return d.parse=function(t){var e,n;this.$d=null===(e=t.date)?new Date(NaN):p.isUndefined(e)?new Date:e instanceof Date?e:"string"==typeof e&&/.*[^Z]$/i.test(e)&&(n=e.match(c))?new Date(n[1],n[2]-1,n[3]||1,n[5]||0,n[6]||0,n[7]||0,n[8]||0):new Date(e),this.init(t)},d.init=function(t){this.$y=this.$d.getFullYear(),this.$M=this.$d.getMonth(),this.$D=this.$d.getDate(),this.$W=this.$d.getDay(),this.$H=this.$d.getHours(),this.$m=this.$d.getMinutes(),this.$s=this.$d.getSeconds(),this.$ms=this.$d.getMilliseconds(),this.$L=this.$L||y(t.locale,null,!0)||$},d.$utils=function(){return p},d.isValid=function(){return!("Invalid Date"===this.$d.toString())},d.$compare=function(t){return this.valueOf()-M(t).valueOf()},d.isSame=function(t){return 0===this.$compare(t)},d.isBefore=function(t){return this.$compare(t)<0},d.isAfter=function(t){return this.$compare(t)>0},d.year=function(){return this.$y},d.month=function(){return this.$M},d.day=function(){return this.$W},d.date=function(){return this.$D},d.hour=function(){return this.$H},d.minute=function(){return this.$m},d.second=function(){return this.$s},d.millisecond=function(){return this.$ms},d.unix=function(){return Math.floor(this.valueOf()/1e3)},d.valueOf=function(){return this.$d.getTime()},d.startOf=function(t,c){var o=this,h=!!p.isUndefined(c)||c,d=function(t,e){var n=S(new Date(o.$y,e,t),o);return h?n:n.endOf(s)},f=function(t,e){return S(o.toDate()[t].apply(o.toDate(),h?[0,0,0,0].slice(e):[23,59,59,999].slice(e)),o)};switch(p.prettyUnit(t)){case u:return h?d(1,0):d(31,11);case a:return h?d(1,this.$M):d(0,this.$M+1);case i:return d(h?this.$D-this.$W:this.$D+(6-this.$W),this.$M);case s:case"date":return f("setHours",0);case r:return f("setMinutes",1);case n:return f("setSeconds",2);case e:return f("setMilliseconds",3);default:return this.clone()}},d.endOf=function(t){return this.startOf(t,!1)},d.$set=function(i,c){switch(p.prettyUnit(i)){case s:this.$d.setDate(this.$D+(c-this.$W));break;case"date":this.$d.setDate(c);break;case a:this.$d.setMonth(c);break;case u:this.$d.setFullYear(c);break;case r:this.$d.setHours(c);break;case n:this.$d.setMinutes(c);break;case e:this.$d.setSeconds(c);break;case t:this.$d.setMilliseconds(c)}return this.init(),this},d.set=function(t,e){return this.clone().$set(t,e)},d.add=function(t,c){var o=this;t=Number(t);var h,d=p.prettyUnit(c),f=function(e,n){var r=o.set("date",1).set(e,n+t);return r.set("date",Math.min(o.$D,r.daysInMonth()))},$=function(e){var n=new Date(o.$d);return n.setDate(n.getDate()+e*t),S(n,o)};if(d===a)return f(a,this.$M);if(d===u)return f(u,this.$y);if(d===s)return $(1);if(d===i)return $(7);switch(d){case n:h=6e4;break;case r:h=36e5;break;case e:h=1e3;break;default:h=1}var l=this.valueOf()+t*h;return S(l,this)},d.subtract=function(t,e){return this.add(-1*t,e)},d.format=function(t){var e=this,n=t||"YYYY-MM-DDTHH:mm:ssZ",r=p.padZoneStr(this.$d.getTimezoneOffset()),s=this.$locale(),i=s.weekdays,a=s.months,u=function(t,e,n,r){return t&&t[e]||n[e].substr(0,r)};return n.replace(o,function(t){if(t.indexOf("[")>-1)return t.replace(/\[|\]/g,"");switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return String(e.$y);case"M":return String(e.$M+1);case"MM":return p.padStart(e.$M+1,2,"0");case"MMM":return u(s.monthsShort,e.$M,a,3);case"MMMM":return a[e.$M];case"D":return String(e.$D);case"DD":return p.padStart(e.$D,2,"0");case"d":return String(e.$W);case"dd":return u(s.weekdaysMin,e.$W,i,2);case"ddd":return u(s.weekdaysShort,e.$W,i,3);case"dddd":return i[e.$W];case"H":return String(e.$H);case"HH":return p.padStart(e.$H,2,"0");case"h":case"hh":return 0===e.$H?12:p.padStart(e.$H<13?e.$H:e.$H-12,"hh"===t?2:1,"0");case"a":return e.$H<12?"am":"pm";case"A":return e.$H<12?"AM":"PM";case"m":return String(e.$m);case"mm":return p.padStart(e.$m,2,"0");case"s":return String(e.$s);case"ss":return p.padStart(e.$s,2,"0");case"SSS":return p.padStart(e.$ms,3,"0");case"Z":return r;default:return r.replace(":","")}})},d.diff=function(t,c,o){var h=p.prettyUnit(c),d=M(t),f=this-d,$=p.monthDiff(this,d);switch(h){case u:$/=12;break;case a:break;case"quarter":$/=3;break;case i:$=f/6048e5;break;case s:$=f/864e5;break;case r:$=f/36e5;break;case n:$=f/6e4;break;case e:$=f/1e3;break;default:$=f}return o?$:p.absFloor($)},d.daysInMonth=function(){return this.endOf(a).$D},d.$locale=function(){return l[this.$L]},d.locale=function(t,e){var n=this.clone();return n.$L=y(t,e,!0),n},d.clone=function(){return S(this.toDate(),this)},d.toDate=function(){return new Date(this.$d)},d.toArray=function(){return[this.$y,this.$M,this.$D,this.$H,this.$m,this.$s,this.$ms]},d.toJSON=function(){return this.toISOString()},d.toISOString=function(){return this.toDate().toISOString()},d.toObject=function(){return{years:this.$y,months:this.$M,date:this.$D,hours:this.$H,minutes:this.$m,seconds:this.$s,milliseconds:this.$ms}},d.toString=function(){return this.$d.toUTCString()},h}();return M.extend=function(t,e){return t(e,D,M),M},M.locale=y,M.isDayjs=m,M.unix=function(t){return M(1e3*t)},M.en=l[$],M});var texts={s:'ein paar Sekunden',m:['eine Minute','einer Minute'],mm:'%d Minuten',h:['eine Stunde','einer Stunde'],hh:'%d Stunden',d:['ein Tag','einem Tag'],dd:['%d Tage','%d Tagen'],M:['ein Monat','einem Monat'],MM:['%d Monate','%d Monaten'],y:['ein Jahr','einem Jahr'],yy:['%d Jahre','%d Jahren']};function relativeTimeFormatter(number,withoutSuffix,key){var l=texts[key];if(Array.isArray(l)){l=l[withoutSuffix?0:1]}
return l.replace('%d',number)}
var locale={name:'de',weekdays:'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),weekdaysShort:'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),weekdaysMin:'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),months:'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),monthsShort:'Jan_Feb_März_Apr_Mai_Juni_Juli_Aug_Sept_Okt_Nov_Dez'.split('_'),ordinal:function ordinal(n){return"".concat(n,".")},weekStart:1,yearStart:4,formats:{LTS:'HH:mm:ss',LT:'HH:mm',L:'DD.MM.YYYY',LL:'D. MMMM YYYY',LLL:'D. MMMM YYYY HH:mm',LLLL:'dddd, D. MMMM YYYY HH:mm'},relativeTime:{future:'in %s',past:'vor %s',s:relativeTimeFormatter,m:relativeTimeFormatter,mm:relativeTimeFormatter,h:relativeTimeFormatter,hh:relativeTimeFormatter,d:relativeTimeFormatter,dd:relativeTimeFormatter,M:relativeTimeFormatter,MM:relativeTimeFormatter,y:relativeTimeFormatter,yy:relativeTimeFormatter}};dayjs.locale(locale,null,!0);(function($){function PowermailCondition(formElement){'use strict';var $formElement=$(formElement);var defaultFieldClassNames=['powermail_input','powermail_textarea','powermail_select','powermail_radio','powermail_checkbox'];this.ajaxListener=function(){sendFormValuesToPowermailCond();$(getDefaultFieldClassNamesList()).on('change',function(){sendFormValuesToPowermailCond()})};var processActions=function(data){if(data.todo!==undefined){for(var formUid in data.todo){var $form=$('.powermail_form_'+formUid)
for(var pageUid in data.todo[formUid]){var $page=$form.find('.powermail_fieldset_'+pageUid);if(data.todo[formUid][pageUid]['#action']==='hide'){hidePage(getFieldsetByUid(pageUid,$form))}
if(data.todo[formUid][pageUid]['#action']==='un_hide'){showPage(getFieldsetByUid(pageUid,$form))}
for(var fieldMarker in data.todo[formUid][pageUid]){if(data.todo[formUid][pageUid][fieldMarker]['#action']==='hide'){hideField(fieldMarker,$form)}
if(data.todo[formUid][pageUid][fieldMarker]['#action']==='un_hide'){showField(fieldMarker,$form)}}}}
reInitializeParsleyValidation()}};var sendFormValuesToPowermailCond=function(){var formToSend=$($formElement.get(0));var tempEnabledFields=formToSend.find(':disabled').prop('disabled',!1);var dataToSend=new FormData($formElement.get(0));tempEnabledFields.prop('disabled',!0);$.ajax({type:'POST',url:getAjaxUri(),data:dataToSend,contentType:!1,processData:!1,global:!1,success:function(data){if(data.loops===100){log('100 loops reached by parsing conditions and rules. Maybe there are conflicting conditions.')}
processActions(data)}})};var derequireField=function($field){if($field.prop('required')||$field.data('parsley-required')){$field.prop('required',!1);$field.removeAttr('data-parsley-required');$field.data('powermailcond-required','required')}};var rerequireField=function($field){if($field.data('powermailcond-required')==='required'){if(isHtml5ValidationActivated()){$field.prop('required','required')}else if(isParsleyValidationActivated()){$field.prop('required','required')}}
$field.removeData('powermailcond-required')};var showField=function(fieldMarker,$form){var $wrappingContainer=$form.find('.powermail_fieldwrap_'+fieldMarker);$wrappingContainer.show();var $field=getFieldByMarker(fieldMarker,$form);$field.prop('disabled',!1);rerequireField($field)};var hideField=function(fieldMarker,$form){var $wrappingContainer=$form.find('.powermail_fieldwrap_'+fieldMarker);$wrappingContainer.hide();var $field=getFieldByMarker(fieldMarker,$form);$field.prop('disabled',!0);derequireField($field)};var showPage=function($page){$page.show()};var hidePage=function($page){$page.hide()};var getAjaxUri=function(){var uri=$('*[data-condition-uri]').data('condition-uri');if(uri===undefined){log('Tag with data-condition-uri not found. Maybe TypoScript was not included.')}
return uri};var getFieldByMarker=function(fieldMarker,$form){return $form.find('[name^="tx_powermail_pi1[field]['+fieldMarker+']"]').not('[type="hidden"]')};var getFieldsetByUid=function(pageUid,$form){return $form.find('.powermail_fieldset_'+pageUid)};var listFromArray=function(array,itemPrefix,glue){itemPrefix=typeof itemPrefix!=='undefined'?itemPrefix:'';glue=typeof glue!=='undefined'?glue:',';var string='';for(var i=0;i<array.length;i++){if(i>0){string+=glue}
string+=itemPrefix+array[i]}
return string};var getDefaultFieldClassNamesList=function(){return listFromArray(defaultFieldClassNames,'.')};var isParsleyValidationActivated=function(){return $formElement.data('parsley-validate')==='data-parsley-validate'};var isHtml5ValidationActivated=function(){return $formElement.data('validate')==='html5'};var reInitializeParsleyValidation=function(){if(isParsleyValidationActivated()){$formElement.parsley().destroy();$formElement.parsley()}};var log=function(message){if(typeof console=='object'){if(typeof message==='string'){message='powermail_cond: '+message}
console.log(message)}}}
$(document).ready(function(){$('form.powermail_form').each(function(){(new PowermailCondition(this)).ajaxListener()})})})(jQuery);!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports&&"function"==typeof require?require("jquery"):jQuery)}(function(a){"use strict";function b(c,d){var e=this;e.element=c,e.el=a(c),e.suggestions=[],e.badQueries=[],e.selectedIndex=-1,e.currentValue=e.element.value,e.timeoutId=null,e.cachedResponse={},e.onChangeTimeout=null,e.onChange=null,e.isLocal=!1,e.suggestionsContainer=null,e.noSuggestionsContainer=null,e.options=a.extend({},b.defaults,d),e.classes={selected:"autocomplete-selected",suggestion:"autocomplete-suggestion"},e.hint=null,e.hintValue="",e.selection=null,e.initialize(),e.setOptions(d)}function c(a,b,c){return-1!==a.value.toLowerCase().indexOf(c)}function d(b){return"string"==typeof b?a.parseJSON(b):b}function e(a,b){if(!b)return a.value;var c="("+g.escapeRegExChars(b)+")";return a.value.replace(new RegExp(c,"gi"),"<strong>$1</strong>").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/&lt;(\/?strong)&gt;/g,"<$1>")}function f(a,b){return'<div class="autocomplete-group">'+b+"</div>"}var g=function(){return{escapeRegExChars:function(a){return a.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")},createNode:function(a){var b=document.createElement("div");return b.className=a,b.style.position="absolute",b.style.display="none",b}}}(),h={ESC:27,TAB:9,RETURN:13,LEFT:37,UP:38,RIGHT:39,DOWN:40},i=a.noop;b.utils=g,a.Autocomplete=b,b.defaults={ajaxSettings:{},autoSelectFirst:!1,appendTo:"body",serviceUrl:null,lookup:null,onSelect:null,width:"auto",minChars:1,maxHeight:300,deferRequestBy:0,params:{},formatResult:e,formatGroup:f,delimiter:null,zIndex:9999,type:"GET",noCache:!1,onSearchStart:i,onSearchComplete:i,onSearchError:i,preserveInput:!1,containerClass:"autocomplete-suggestions",tabDisabled:!1,dataType:"text",currentRequest:null,triggerSelectOnValidInput:!0,preventBadQueries:!0,lookupFilter:c,paramName:"query",transformResult:d,showNoSuggestionNotice:!1,noSuggestionNotice:"No results",orientation:"bottom",forceFixPosition:!1},b.prototype={initialize:function(){var c,d=this,e="."+d.classes.suggestion,f=d.classes.selected,g=d.options;d.element.setAttribute("autocomplete","off"),d.noSuggestionsContainer=a('<div class="autocomplete-no-suggestion"></div>').html(this.options.noSuggestionNotice).get(0),d.suggestionsContainer=b.utils.createNode(g.containerClass),c=a(d.suggestionsContainer),c.appendTo(g.appendTo||"body"),"auto"!==g.width&&c.css("width",g.width),c.on("mouseover.autocomplete",e,function(){d.activate(a(this).data("index"))}),c.on("mouseout.autocomplete",function(){d.selectedIndex=-1,c.children("."+f).removeClass(f)}),c.on("click.autocomplete",e,function(){d.select(a(this).data("index"))}),c.on("click.autocomplete",function(){clearTimeout(d.blurTimeoutId)}),d.fixPositionCapture=function(){d.visible&&d.fixPosition()},a(window).on("resize.autocomplete",d.fixPositionCapture),d.el.on("keydown.autocomplete",function(a){d.onKeyPress(a)}),d.el.on("keyup.autocomplete",function(a){d.onKeyUp(a)}),d.el.on("blur.autocomplete",function(){d.onBlur()}),d.el.on("focus.autocomplete",function(){d.onFocus()}),d.el.on("change.autocomplete",function(a){d.onKeyUp(a)}),d.el.on("input.autocomplete",function(a){d.onKeyUp(a)})},onFocus:function(){var a=this;a.fixPosition(),a.el.val().length>=a.options.minChars&&a.onValueChange()},onBlur:function(){var a=this;a.blurTimeoutId=setTimeout(function(){a.hide()},200)},abortAjax:function(){var a=this;a.currentRequest&&(a.currentRequest.abort(),a.currentRequest=null)},setOptions:function(b){var c=this,d=c.options;this.options=a.extend({},d,b),c.isLocal=Array.isArray(d.lookup),c.isLocal&&(d.lookup=c.verifySuggestionsFormat(d.lookup)),d.orientation=c.validateOrientation(d.orientation,"bottom"),a(c.suggestionsContainer).css({"max-height":d.maxHeight+"px",width:d.width+"px","z-index":d.zIndex})},clearCache:function(){this.cachedResponse={},this.badQueries=[]},clear:function(){this.clearCache(),this.currentValue="",this.suggestions=[]},disable:function(){var a=this;a.disabled=!0,clearTimeout(a.onChangeTimeout),a.abortAjax()},enable:function(){this.disabled=!1},fixPosition:function(){var b=this,c=a(b.suggestionsContainer),d=c.parent().get(0);if(d===document.body||b.options.forceFixPosition){var e=b.options.orientation,f=c.outerHeight(),g=b.el.outerHeight(),h=b.el.offset(),i={top:h.top,left:h.left};if("auto"===e){var j=a(window).height(),k=a(window).scrollTop(),l=-k+h.top-f,m=k+j-(h.top+g+f);e=Math.max(l,m)===l?"top":"bottom"}if("top"===e?i.top+=-f:i.top+=g,d!==document.body){var n,o=c.css("opacity");b.visible||c.css("opacity",0).show(),n=c.offsetParent().offset(),i.top-=n.top,i.left-=n.left,b.visible||c.css("opacity",o).hide()}"auto"===b.options.width&&(i.width=b.el.outerWidth()+"px"),c.css(i)}},isCursorAtEnd:function(){var a,b=this,c=b.el.val().length,d=b.element.selectionStart;return"number"==typeof d?d===c:document.selection?(a=document.selection.createRange(),a.moveStart("character",-c),c===a.text.length):!0},onKeyPress:function(a){var b=this;if(!b.disabled&&!b.visible&&a.which===h.DOWN&&b.currentValue)return void b.suggest();if(!b.disabled&&b.visible){switch(a.which){case h.ESC:b.el.val(b.currentValue),b.hide();break;case h.RIGHT:if(b.hint&&b.options.onHint&&b.isCursorAtEnd()){b.selectHint();break}return;case h.TAB:if(b.hint&&b.options.onHint)return void b.selectHint();if(-1===b.selectedIndex)return void b.hide();if(b.select(b.selectedIndex),b.options.tabDisabled===!1)return;break;case h.RETURN:if(-1===b.selectedIndex)return void b.hide();b.select(b.selectedIndex);break;case h.UP:b.moveUp();break;case h.DOWN:b.moveDown();break;default:return}a.stopImmediatePropagation(),a.preventDefault()}},onKeyUp:function(a){var b=this;if(!b.disabled){switch(a.which){case h.UP:case h.DOWN:return}clearTimeout(b.onChangeTimeout),b.currentValue!==b.el.val()&&(b.findBestHint(),b.options.deferRequestBy>0?b.onChangeTimeout=setTimeout(function(){b.onValueChange()},b.options.deferRequestBy):b.onValueChange())}},onValueChange:function(){var b=this,c=b.options,d=b.el.val(),e=b.getQuery(d);return b.selection&&b.currentValue!==e&&(b.selection=null,(c.onInvalidateSelection||a.noop).call(b.element)),clearTimeout(b.onChangeTimeout),b.currentValue=d,b.selectedIndex=-1,c.triggerSelectOnValidInput&&b.isExactMatch(e)?void b.select(0):void(e.length<c.minChars?b.hide():b.getSuggestions(e))},isExactMatch:function(a){var b=this.suggestions;return 1===b.length&&b[0].value.toLowerCase()===a.toLowerCase()},getQuery:function(b){var c,d=this.options.delimiter;return d?(c=b.split(d),a.trim(c[c.length-1])):b},getSuggestionsLocal:function(b){var c,d=this,e=d.options,f=b.toLowerCase(),g=e.lookupFilter,h=parseInt(e.lookupLimit,10);return c={suggestions:a.grep(e.lookup,function(a){return g(a,b,f)})},h&&c.suggestions.length>h&&(c.suggestions=c.suggestions.slice(0,h)),c},getSuggestions:function(b){var c,d,e,f,g=this,h=g.options,i=h.serviceUrl;if(h.params[h.paramName]=b,h.onSearchStart.call(g.element,h.params)!==!1){if(d=h.ignoreParams?null:h.params,a.isFunction(h.lookup))return void h.lookup(b,function(a){g.suggestions=a.suggestions,g.suggest(),h.onSearchComplete.call(g.element,b,a.suggestions)});g.isLocal?c=g.getSuggestionsLocal(b):(a.isFunction(i)&&(i=i.call(g.element,b)),e=i+"?"+a.param(d||{}),c=g.cachedResponse[e]),c&&Array.isArray(c.suggestions)?(g.suggestions=c.suggestions,g.suggest(),h.onSearchComplete.call(g.element,b,c.suggestions)):g.isBadQuery(b)?h.onSearchComplete.call(g.element,b,[]):(g.abortAjax(),f={url:i,data:d,type:h.type,dataType:h.dataType},a.extend(f,h.ajaxSettings),g.currentRequest=a.ajax(f).done(function(a){var c;g.currentRequest=null,c=h.transformResult(a,b),g.processResponse(c,b,e),h.onSearchComplete.call(g.element,b,c.suggestions)}).fail(function(a,c,d){h.onSearchError.call(g.element,b,a,c,d)}))}},isBadQuery:function(a){if(!this.options.preventBadQueries)return!1;for(var b=this.badQueries,c=b.length;c--;)if(0===a.indexOf(b[c]))return!0;return!1},hide:function(){var b=this,c=a(b.suggestionsContainer);a.isFunction(b.options.onHide)&&b.visible&&b.options.onHide.call(b.element,c),b.visible=!1,b.selectedIndex=-1,clearTimeout(b.onChangeTimeout),a(b.suggestionsContainer).hide(),b.signalHint(null)},suggest:function(){if(!this.suggestions.length)return void(this.options.showNoSuggestionNotice?this.noSuggestions():this.hide());var b,c=this,d=c.options,e=d.groupBy,f=d.formatResult,g=c.getQuery(c.currentValue),h=c.classes.suggestion,i=c.classes.selected,j=a(c.suggestionsContainer),k=a(c.noSuggestionsContainer),l=d.beforeRender,m="",n=function(a,c){var f=a.data[e];return b===f?"":(b=f,d.formatGroup(a,b))};return d.triggerSelectOnValidInput&&c.isExactMatch(g)?void c.select(0):(a.each(c.suggestions,function(a,b){e&&(m+=n(b,g,a)),m+='<div class="'+h+'" data-index="'+a+'">'+f(b,g,a)+"</div>"}),this.adjustContainerWidth(),k.detach(),j.html(m),a.isFunction(l)&&l.call(c.element,j,c.suggestions),c.fixPosition(),j.show(),d.autoSelectFirst&&(c.selectedIndex=0,j.scrollTop(0),j.children("."+h).first().addClass(i)),c.visible=!0,void c.findBestHint())},noSuggestions:function(){var b=this,c=b.options.beforeRender,d=a(b.suggestionsContainer),e=a(b.noSuggestionsContainer);this.adjustContainerWidth(),e.detach(),d.empty(),d.append(e),a.isFunction(c)&&c.call(b.element,d,b.suggestions),b.fixPosition(),d.show(),b.visible=!0},adjustContainerWidth:function(){var b,c=this,d=c.options,e=a(c.suggestionsContainer);"auto"===d.width?(b=c.el.outerWidth(),e.css("width",b>0?b:300)):"flex"===d.width&&e.css("width","")},findBestHint:function(){var b=this,c=b.el.val().toLowerCase(),d=null;c&&(a.each(b.suggestions,function(a,b){var e=0===b.value.toLowerCase().indexOf(c);return e&&(d=b),!e}),b.signalHint(d))},signalHint:function(b){var c="",d=this;b&&(c=d.currentValue+b.value.substr(d.currentValue.length)),d.hintValue!==c&&(d.hintValue=c,d.hint=b,(this.options.onHint||a.noop)(c))},verifySuggestionsFormat:function(b){return b.length&&"string"==typeof b[0]?a.map(b,function(a){return{value:a,data:null}}):b},validateOrientation:function(b,c){return b=a.trim(b||"").toLowerCase(),-1===a.inArray(b,["auto","bottom","top"])&&(b=c),b},processResponse:function(a,b,c){var d=this,e=d.options;a.suggestions=d.verifySuggestionsFormat(a.suggestions),e.noCache||(d.cachedResponse[c]=a,e.preventBadQueries&&!a.suggestions.length&&d.badQueries.push(b)),b===d.getQuery(d.currentValue)&&(d.suggestions=a.suggestions,d.suggest())},activate:function(b){var c,d=this,e=d.classes.selected,f=a(d.suggestionsContainer),g=f.find("."+d.classes.suggestion);return f.find("."+e).removeClass(e),d.selectedIndex=b,-1!==d.selectedIndex&&g.length>d.selectedIndex?(c=g.get(d.selectedIndex),a(c).addClass(e),c):null},selectHint:function(){var b=this,c=a.inArray(b.hint,b.suggestions);b.select(c)},select:function(a){var b=this;b.hide(),b.onSelect(a)},moveUp:function(){var b=this;if(-1!==b.selectedIndex)return 0===b.selectedIndex?(a(b.suggestionsContainer).children().first().removeClass(b.classes.selected),b.selectedIndex=-1,b.el.val(b.currentValue),void b.findBestHint()):void b.adjustScroll(b.selectedIndex-1)},moveDown:function(){var a=this;a.selectedIndex!==a.suggestions.length-1&&a.adjustScroll(a.selectedIndex+1)},adjustScroll:function(b){var c=this,d=c.activate(b);if(d){var e,f,g,h=a(d).outerHeight();e=d.offsetTop,f=a(c.suggestionsContainer).scrollTop(),g=f+c.options.maxHeight-h,f>e?a(c.suggestionsContainer).scrollTop(e):e>g&&a(c.suggestionsContainer).scrollTop(e-c.options.maxHeight+h),c.options.preserveInput||c.el.val(c.getValue(c.suggestions[b].value)),c.signalHint(null)}},onSelect:function(b){var c=this,d=c.options.onSelect,e=c.suggestions[b];c.currentValue=c.getValue(e.value),c.currentValue===c.el.val()||c.options.preserveInput||c.el.val(c.currentValue),c.signalHint(null),c.suggestions=[],c.selection=e,a.isFunction(d)&&d.call(c.element,e)},getValue:function(a){var b,c,d=this,e=d.options.delimiter;return e?(b=d.currentValue,c=b.split(e),1===c.length?a:b.substr(0,b.length-c[c.length-1].length)+a):a},dispose:function(){var b=this;b.el.off(".autocomplete").removeData("autocomplete"),a(window).off("resize.autocomplete",b.fixPositionCapture),a(b.suggestionsContainer).remove()}},a.fn.devbridgeAutocomplete=function(c,d){var e="autocomplete";return arguments.length?this.each(function(){var f=a(this),g=f.data(e);"string"==typeof c?g&&"function"==typeof g[c]&&g[c](d):(g&&g.dispose&&g.dispose(),g=new b(this,c),f.data(e,g))}):this.first().data(e)},a.fn.autocomplete||(a.fn.autocomplete=a.fn.devbridgeAutocomplete)});function SuggestController(){this.init=function(){jQuery('form[data-suggest]').each(function(){var $form=$(this),$searchBox=$form.find('.tx-solr-suggest');$form.find('.tx-solr-suggest-focus').focus();jQuery.ajaxSetup({jsonp:"tx_solr[callback]"});if($searchBox.length===0){$searchBox=$form}
$searchBox.css('position','relative');$form.on('submit',function(e){if($form.find('.tx-solr-suggest').val()===''){e.preventDefault();$form.find('.tx-solr-suggest').focus()}});$form.find('.tx-solr-suggest').devbridgeAutocomplete({serviceUrl:$form.data('suggest'),dataType:'jsonp',paramName:'tx_solr[queryString]',groupBy:'category',maxHeight:1000,autoSelectFirst:!1,triggerSelectOnValidInput:!1,width:$searchBox.outerWidth(),onSelect:function(suggestion){if(suggestion.data.link){if(suggestion.data.link.indexOf('https://www.youtube.com')===0){openVideoOverlay(suggestion.data.link)}else{location.href=suggestion.data.link}}else{$form.trigger('submit')}},transformResult:function(response){if(!response.suggestions)return{suggestions:[]};var firstSuggestion,result={suggestions:$.map(response.suggestions,function(count,suggestion){if(!firstSuggestion)firstSuggestion=suggestion;return{value:suggestion,data:{category:'suggestion',count:count}}})};$.each(response.documents,function(key,value){var dataObject=value;var defaultGroup=$form.data('suggest-header')?$form.data('suggest-header'):'Top results';dataObject.category=defaultGroup;if(dataObject.group){dataObject.category=$form.data('suggest-header-'+dataObject.group)?$form.data('suggest-header-'+dataObject.group):dataObject.group}
result.suggestions.push({value:firstSuggestion,data:dataObject})});return result},beforeRender:function(container){container.find('.autocomplete-group:first').remove();container.addClass('tx-solr-autosuggest');$searchBox.parent().addClass('autocomplete-active').fadeIn()},formatResult:function(suggestion,currentValue){if(!currentValue){return suggestion.value}
var pattern='('+$.Autocomplete.utils.escapeRegExChars(currentValue.trim())+')';if(suggestion.data.category==='suggestion'){return suggestion.value.replace(new RegExp(pattern,'gi'),'<strong>$1<\/strong>').replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/&lt;(\/?strong)&gt;/g,'<$1>')}else{var title=suggestion.data.title.replace(new RegExp(pattern,'gi'),'<em>$1<\/em>').replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/&lt;(\/?em)&gt;/g,'<$1>'),link=suggestion.data.link;if(suggestion.data.altType_stringS==='file'&&link.indexOf('://')===-1){link='/'+link}
return'<div class="'+suggestion.data.altType_stringS+'">'+(!!suggestion.data.previewImage?'<figure '+(!!suggestion.data.hasVideo?'class="hasVideo"':'')+'><img src="'+suggestion.data.previewImage+'" /></figure>':'')+'<a href="'+link+'" class="internal-link">'+title+'</a>'+'</div>'}}}).on('blur',function(){$searchBox.parent().removeClass('autocomplete-active');var $box=$(this);setTimeout(function(){$box.devbridgeAutocomplete('hide')},200)})})}}
jQuery(document).ready(function(){var solrSuggestController=new SuggestController();solrSuggestController.init();jQuery("body").on("tx_solr_updated",function(){solrSuggestController.init()})});if(!Object.assign){Object.defineProperty(Object,'assign',{enumerable:!1,configurable:!0,writable:!0,value:function(target){'use strict';if(target===undefined||target===null){throw new TypeError('Cannot convert first argument to object')}
var to=Object(target);for(var i=1;i<arguments.length;i++){var nextSource=arguments[i];if(nextSource===undefined||nextSource===null){continue}
nextSource=Object(nextSource);var keysArray=Object.keys(Object(nextSource));for(var nextIndex=0,len=keysArray.length;nextIndex<len;nextIndex++){var nextKey=keysArray[nextIndex];var desc=Object.getOwnPropertyDescriptor(nextSource,nextKey);if(desc!==undefined&&desc.enumerable){to[nextKey]=nextSource[nextKey]}}}
return to}})}
!function(t,e){void 0===t&&void 0!==window&&(t=window),"function"==typeof define&&define.amd?define([],function(){return t.jCaptcha=e()}):"object"==typeof module&&module.exports?module.exports=e():t.jCaptcha=e()}(this,function(){"use strict";function t(){i=Math.round(8*Math.random())+1,n=Math.round(8*Math.random())+1,c=i+n}function e(t,e,a){a||(t.insertAdjacentHTML("beforebegin",'<canvas aria-label="'+i+' + '+n+' =" class="'.concat(e.canvasClass,'"\n                    width="').concat(e.canvasStyle.width,'" height="').concat(e.canvasStyle.height,'">\n                </canvas>\n            ')),this.$captchaEl=document.querySelector(".".concat(e.canvasClass)),this.$captchaTextContext=this.$captchaEl.getContext("2d"),this.$captchaTextContext=Object.assign(this.$captchaTextContext,e.canvasStyle)),this.$captchaTextContext.clearRect(0,0,e.canvasStyle.width,e.canvasStyle.height),this.$captchaTextContext.fillText("".concat(i," + ").concat(n," = "),0,0)}function a(t){var e=0<arguments.length&&void 0!==t?t:{};this.options=Object.assign({},{el:".jCaptcha",canvasClass:"jCaptchaCanvas",requiredValue:"*",resetOnError:!0,focusOnError:!0,clearOnSubmit:!0,callback:null,canvasStyle:{}},e),this._init()}var c,i,n,s=0;return a.prototype={_init:function(){this.$el=document.querySelector(this.options.el),t(),e.call(this,this.$el,this.options)},validate:function(){s++,this.callbackReceived=this.callbackReceived||"function"==typeof this.options.callback,this.$el.value!=c?(this.callbackReceived&&this.options.callback("error",this.$el,s),!0===this.options.resetOnError&&this.reset(),!0===this.options.focusOnError&&this.$el.focus()):this.callbackReceived&&this.options.callback("success",this.$el,s),!0===this.options.clearOnSubmit&&(this.$el.value="")},reset:function(){t(),e.call(this,this.$el,this.options,!0)}},a});(function($){$.csCaptcha=function(el,options){var base=this;base.$el=$(el);base.el=el;base.myCaptcha=null;base.jcaptchaResult=null;base.$el.data("csCaptcha",base);base.baseCaptcha=function(){if((base.$el.find('.js-captcha').length)){base.myCaptcha=new jCaptcha({el:'.js-captcha',canvasClass:'jCaptchaCanvas',canvasStyle:{width:70,height:20,textBaseline:'top',font:'1rem Arial',textAlign:'left',fillStyle:'#000'},callback:function(response,$captchaInputElement,numberOfTries){if(response==='success'){base.jcaptchaResult=!0;$('.js-captcha-error').hide()}
if(response==='error'){base.jcaptchaResult=!1;base.myCaptcha.reset();$('.js-captcha-error').show()}}})}};base.baseForm=function(){if(base.$el.find('.js-captcha-form').length){base.$el.find('.js-captcha-form').on('submit',function(event){event.preventDefault();base.myCaptcha.validate();if(base.jcaptchaResult||$('html').hasClass('test-runner')){$(this).unbind('submit');$(this).submit()}})}};base.init=function(){base.options=$.extend({},$.csLightbox.defaultOptions,options);base.baseCaptcha();base.baseForm()};base.init();let txt=$('label[for="cst-f-captcha"]').text();txt=txt.replace("*","");let arialabel=$('.jCaptchaCanvas').attr('aria-label');$('.ticket--form-label').attr('aria-label',txt+arialabel)};$.csCaptcha.defaultOptions={};$.fn.csCaptcha=function(options){return this.each(function(){(new $.csCaptcha(this,options))})}}(jQuery));(function($){$.csAudioStream=function(el,options){let base=this;base.$el=$(el);base.el=el;base.$el.data('csAudioStream',base);const $audioPlayerMobileToggle=base.$el.find('.js-audio-player-mobile-toggle');const $audioPlayerMobileClose=base.$el.find('.js-audio-layer-close');const $audioPlayerMobileToggleIcon=$audioPlayerMobileToggle.find('.js-audio-player-mobile-toggle-icon');const $audioPlayer=base.$el.find('.js-audio-player');const $audioPlayerControlButton=$audioPlayer.children('.js-audio-control');const $audioPlayerCloseAltText=$audioPlayer.find('.js-audio-player-close-alt-text');const $audioPlayerDesktopToggle=$audioPlayer.find('.js-audio-layer-toggle');const $audioPlayerDesktopToggleIcon=$audioPlayerDesktopToggle.children('.js-audio-layer-toggle-icon');const audioActiveClass='playing';const streamTime=$audioPlayer.data('availability-time');let audio;base.toggleAudio=function($audioControl,audio){let controlButtonAriaLabelDataString;if($lastClickedElement!==null&&$lastClickedElement.hasClass('js-link-audio-stream')){$audioControl.addClass(audioActiveClass);$audioControl.attr('aria-label',$audioControl.data('aria-label-play'));$audioControl.find('.js-audio-control-icon').removeClass('cs-icon-play-1');$audioControl.find('.js-audio-control-icon').addClass('cs-icon-pause');audio.play();$lastClickedElement=null}else{if($audioControl.hasClass(audioActiveClass)){audio.pause();controlButtonAriaLabelDataString='aria-label-play'}else{audio.play();controlButtonAriaLabelDataString='aria-label-pause'}
$audioControl.toggleClass(audioActiveClass);$audioControl.attr('aria-label',$audioControl.data(controlButtonAriaLabelDataString));$audioControl.find('.js-audio-control-icon').toggleClass('cs-icon-play-1 cs-icon-pause')}};base.refreshAudioPlayerMobileToggleIcon=function(){let mobileAudioIsPlayingClass='audio-player__icon--active';$audioPlayerMobileToggleIcon.removeClass(mobileAudioIsPlayingClass);if(!$audioPlayer.is(':visible')){let iconClass=$audioPlayerControlButton.hasClass('playing')?mobileAudioIsPlayingClass:'';$audioPlayerMobileToggleIcon.addClass(iconClass)}};base.isGDPRcompliant=function($audioObj){let isExternalUrl=location.hostname!=$audioObj.get(0).hostname;if(isExternalUrl&&($audioObj.get(0).hostname.includes('nc3'))&&!$csCookieBanner.getCookieKeyExist('videos_nc3')){$audioObj.attr('data-cookie-name','videos_nc3');return!1}else if(isExternalUrl&&$audioObj.get(0).hostname.includes('quantumcast')&&!$csCookieBanner.getCookieKeyExist('audio_quantumcast')){$audioObj.attr('data-cookie-name','audio_quantumcast');return!1}
return!0};base.isM3U8format=function($audioObj){let audioSrc=$audioObj.attr('href');return audioSrc.indexOf('.m3u8')>-1};base.handleAudioFormat=function($audioObj,audioVar,lastClicktEle){if(base.isGDPRcompliant($audioObj)){if(!audioVar){if(base.isM3U8format($audioObj)){let domVideo=document.createElement('video');domVideo.id=$audioObj.data('audio-id')?$audioObj.data('audio-id'):'cs-global-video';domVideo.style='display:none;';domVideo.setAttribute('playsinline','playsinline');domVideo.setAttribute('nodownload','nodownload');$audioObj.append(domVideo);audioVar=videojs(domVideo.id);audioVar.src({type:'application/x-mpegURL',src:$audioObj.attr('href'),})}else{audioVar=new Audio($audioObj.attr('href'));audioVar.addEventListener('ended',function(){base.toggleAudio($audioObj,audioVar);base.refreshAudioPlayerMobileToggleIcon();$audioObj.removeData('itemAudio');audioVar=null});$audioObj.data('itemAudio',audioVar)}}
base.toggleAudio($audioObj,audioVar);base.refreshAudioPlayerMobileToggleIcon()}else{let cookieName=$audioObj.attr('data-cookie-name');openCookieModal(cookieName);$lastClickedElement=lastClicktEle;$(document).on('updatedCookieBanner',function(event){if($lastClickedElement){base.handleAudioFormat($audioObj,audioVar,$lastClickedElement)}})}};base.handleToggleAudio=function(){$audioPlayerControlButton.click(function(e){e.preventDefault();let currentTime=Math.floor(+new Date()/1000);if(streamTime>currentTime){$audioPlayer.addClass('not-available');$audioPlayerCloseAltText.off().on('click',function(e){e.preventDefault();$audioPlayer.removeClass('not-available')})}else{base.handleAudioFormat($audioPlayerControlButton,audio,$(this))}})};base.handleToggleItemAudio=function(){$(document).off('click','.js-audio-item-control');$(document).on('click','.js-audio-item-control',{},function(e){e.preventDefault();let $audioItemControl=$(this);let itemAudio=$audioItemControl.data('itemAudio');base.handleAudioFormat($audioItemControl,itemAudio,$(this))})};base.handleToggleDesktopLayer=function(){$audioPlayerDesktopToggle.on('click',function(e){e.preventDefault();$audioPlayer.toggleClass('open');$audioPlayerDesktopToggleIcon.toggleClass('cs-icon-small-angle-right cs-icon-small-angle-down')})};base.handleToggleMobileLayer=function(){$audioPlayerMobileToggle.on('click',function(e){$(this).toggleClass('cs-visibilty');e.preventDefault();$audioPlayer.slideToggle(0,function(){let $el=$(this);if($el.is(':visible')){$el.css('display','flex')}
base.refreshAudioPlayerMobileToggleIcon()})})};base.handleMobileClose=function(){$audioPlayerMobileClose.on('click',function(e){e.preventDefault();$audioPlayerMobileToggle.trigger('click')})};base.handleClickLinkToGlobalPlayerEvent=function(){$(document).on('click','.js-link-audio-stream',{},function(e){e.preventDefault();if(window.matchMedia('(min-width: 921px)').matches){document.querySelector('#audio-stream').querySelector('.js-audio-control').focus()}else{document.querySelector('.js-audio-stream--mobile').querySelector('.js-audio-control').focus()}
$lastClickedElement=$(this);base.handleAudioFormat($('.js-audio-control'),audio,$(this))})};base.initOpenClass=function(){if(window.matchMedia('(max-width: 920px)').matches){$audioPlayer.addClass('open')}else{$audioPlayer.removeClass('open')}};base.handleResizeEvent=function(){$(window).on('resize',function(){base.initOpenClass();$audioPlayer.removeAttr('style');$audioPlayerDesktopToggleIcon.removeClass('cs-icon-small-angle-down');$audioPlayerDesktopToggleIcon.addClass('cs-icon-small-angle-right');base.refreshAudioPlayerMobileToggleIcon()})};base.init=function(){base.options=$.extend({},$.csAudioStream.defaultOptions,options);base.initOpenClass();base.handleToggleAudio();base.handleToggleItemAudio();base.handleToggleDesktopLayer();base.handleToggleMobileLayer();base.handleMobileClose();base.handleResizeEvent();base.handleClickLinkToGlobalPlayerEvent()};base.init()};$.csAudioStream.defaultOptions={};$.fn.csAudioStream=function(options){return this.each(function(){(new $.csAudioStream(this,options))})}}(jQuery));(function($){$.csChatbot=function(el,options){var base=this;base.$el=$(el);base.el=el;base.$el.data("csChatbot",base);base.chatbotIconToggle=function(){$('.js-show-box').keyup(function(event){if(event.which===13){$(this).click()}});$('.js-show-box').click(function(){$('.js-box').addClass('chatbot__box--show');if($('.js-call-chatbot').children().length===0){$('.js-global-wrapper').csCallChatbot();$.getScript('plugin.cs-call-chatbot.js')}});$('.js-close-box').click(function(){$('.js-box').removeClass('chatbot__box--show')})};base.init=function(){base.options=$.extend({},$.csCalendar.defaultOptions,options);base.chatbotIconToggle()};base.init()};$.csChatbot.defaultOptions={};$.fn.csChatbot=function(options){return this.each(function(){(new $.csChatbot(this,options))})}}(jQuery));(function($){$.csCallChatbot=function(el,options){var base=this;base.$el=$(el);base.el=el;base.$el.data("csCallChatbot",base);base.addFirstScript=function(){var firstScript=$('<script></script>');$('.js-call-chatbot').append(firstScript);$('.js-call-chatbot script:first-child').attr({"crossorigin":"anonymous","src":"https://cdn.botframework.com/botframework-webchat/latest/webchat.js"})};base.addDiv=function(){var divChatbot=$('<div></div>');$('.js-call-chatbot').append(divChatbot);$('.js-call-chatbot div').attr({"id":"webchat","role":"main"})};base.addSecondScript=function(){var secondScript=$('<script></script>');secondScript.append("(async function () {\n"+"                        var authorizationToken;\n"+"                        var token;\n"+"                        var userId;\n"+"                        var region;\n"+"                        const tokenRes = await fetch('https://gewandhaus-tokenserver.azurewebsites.net/api/token');\n"+"                        if (tokenRes.status === 200) {\n"+"                            region = 'westeurope',\n"+"                                res = await tokenRes.json(),\n"+"                                authorizationToken = res.speechservicetoken,\n"+"                                token = res.directlinetoken,\n"+"                                userId = res.userId;\n"+"                        } else {\n"+"                            return (new Error('error!'))\n"+"                        }\n"+"\n"+"                        async function createSpeechRecognitionOnlyPonyfillFactory() {\n"+"                            const webSpeechPonyfillFactory = await window.WebChat.createCognitiveServicesSpeechServicesPonyfillFactory({\n"+"                                credentials: {\n"+"                                    authorizationToken: authorizationToken,\n"+"                                    region: region\n"+"                                }\n"+"                            });\n"+"\n"+"                            return options => {\n"+"                                const speechServicesPonyfill = webSpeechPonyfillFactory(options);\n"+"                                return {\n"+"                                    SpeechGrammarList: speechServicesPonyfill.SpeechGrammarList,\n"+"                                    SpeechRecognition: speechServicesPonyfill.SpeechRecognition\n"+"                                };\n"+"                            };\n"+"                        }\n"+"\n"+"                        window.WebChat.renderWebChat({\n"+"                            directLine: window.WebChat.createDirectLine({ token }),\n"+"                            webSpeechPonyfillFactory: await createSpeechRecognitionOnlyPonyfillFactory(),\n"+"                            userID: userId,\n"+"                            locale: \"de-DE\"\n"+"                        }, document.getElementById('webchat'));\n"+"                    })().catch(err => console.error(err));");$('.js-call-chatbot').append(secondScript)};base.init=function(){base.options=$.extend({},$.csCalendar.defaultOptions,options);base.addFirstScript();base.addDiv();base.addSecondScript()};base.init()};$.csCallChatbot.defaultOptions={};$.fn.csCallChatbot=function(options){return this.each(function(){(new $.csCallChatbot(this,options))})}}(jQuery));
/*!
* FitVids 1.1
*
* Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
* Released under the WTFPL license - http://sam.zoy.org/wtfpl/
*
*/
;(function($){'use strict';$.fn.fitVids=function(options){var settings={customSelector:null,ignore:null};if(!document.getElementById('fit-vids-style')){var head=document.head||document.getElementsByTagName('head')[0];var css='.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}';var div=document.createElement("div");div.innerHTML='<p>x</p><style id="fit-vids-style">'+css+'</style>';head.appendChild(div.childNodes[1])}
if(options){$.extend(settings,options)}
return this.each(function(){var selectors=['iframe[src*="player.vimeo.com"]','iframe[src*="youtube.com"]','iframe[src*="youtube-nocookie.com"]','iframe[src*="kickstarter.com"][src*="video.html"]','object','embed'];if(settings.customSelector){selectors.push(settings.customSelector)}
var ignoreList='.fitvidsignore';if(settings.ignore){ignoreList=ignoreList+', '+settings.ignore}
var $allVideos=$(this).find(selectors.join(','));$allVideos=$allVideos.not('object object');$allVideos=$allVideos.not(ignoreList);$allVideos.each(function(){var $this=$(this);if($this.parents(ignoreList).length>0){return}
if(this.tagName.toLowerCase()==='embed'&&$this.parent('object').length||$this.parent('.fluid-width-video-wrapper').length){return}
if((!$this.css('height')&&!$this.css('width'))&&(isNaN($this.attr('height'))||isNaN($this.attr('width')))){$this.attr('height',9);$this.attr('width',16)}
var height=(this.tagName.toLowerCase()==='object'||($this.attr('height')&&!isNaN(parseInt($this.attr('height'),10))))?parseInt($this.attr('height'),10):$this.height(),width=!isNaN(parseInt($this.attr('width'),10))?parseInt($this.attr('width'),10):$this.width(),aspectRatio=height/width;if(!$this.attr('name')){var videoName='fitvid'+$.fn.fitVids._count;$this.attr('name',videoName);$.fn.fitVids._count++}
$this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top',(aspectRatio*100)+'%');$this.removeAttr('height').removeAttr('width')})})};$.fn.fitVids._count=0})(window.jQuery||window.Zepto);if(!Array.prototype.fill){Object.defineProperty(Array.prototype,'fill',{value:function(value){if(this==null){throw new TypeError('this is null or not defined')}
var O=Object(this);var len=O.length>>>0;var start=arguments[1];var relativeStart=start>>0;var k=relativeStart<0?Math.max(len+relativeStart,0):Math.min(relativeStart,len);var end=arguments[2];var relativeEnd=end===undefined?len:end>>0;var final=relativeEnd<0?Math.max(len+relativeEnd,0):Math.min(relativeEnd,len);while(k<final){O[k]=value;k++}
return O}})}(function($){$.csCalendar=function(el,options){var base=this;base.$el=$(el);base.el=el;base.$el.data("csCalendar",base);base.getDateTemplate=function(day,month,isToday){const hasEvent=base.getEvent(day);const yearNum=day.year();let monthNum=day.month()+1;let dayNum=day.date();const isDisabled=(day.$M!==month.$M)||(!hasEvent&&!isToday);const isSelected=day.isSame(base.selected);if(monthNum.length===1){monthNum=0+monthNum}
if(dayNum.length===1){dayNum=0+dayNum}
var hrefString=isToday?'/':base.hrefPrefix+yearNum+'-'+monthNum+'-'+dayNum+'/';var classString='calendar__day-item '+(isDisabled?'calendar__day-item--blocked':'calendar__day-item--active')+(hasEvent?' calendar__day-item--has-events':'');classString+=isToday?' calendar__day-item--today':'';var ariaLabelString=dayjs(day).locale(base.locale).format('D, dddd MMMM YYYY')+(isDisabled?', '+base.textNoEvents:'');return'<a href="'+hrefString+'" class="'+classString+'" aria-pressed="'+isSelected+'" aria-label="'+ariaLabelString+'" '+(isDisabled?'tabindex="-1" ':'')+(isToday?'aria-current="date" ':'')+'data-timestamp="'+day.unix()+'">'+day.$D+'</a>'};base.getEvent=function(date){if(base.events[date.$y]){if(base.events[date.$y][date.$M]){if(base.events[date.$y][date.$M][date.$D]){return base.events[date.$y][date.$M][date.$D]}}}};base.getDisplayedMonth=function(){return dayjs(new Date(base.activeYear,base.activeMonth-1,'1'))};base.renderDates=function(date){let start=dayjs(date).startOf('month').startOf('week');let end=dayjs(date).endOf('month').endOf('week');let calendar=[];if(start.date()==1&&start.day()==0){let newStart=start;start=newStart.subtract(1,'week')}
while(start.isBefore(end)){calendar.push(Array(7).fill(0).map(function(){start=start.add(1,'day');return start}))}
let countNumberOfRows=0;let fixedNumberOfRows=6;let templateBlocked='<span class="calendar__day-item calendar__day-item--empty calendar__day-item--blocked"></span>';var grid=calendar.reduce(function(rowAcc,row){var days=row.reduce(function(dayAcc,day){day=day.set('hour',0).set('minute',0).set('second',0).set('millisecond',0);let isToday=day.isSame(base.today);if(!isToday&&day.$M!==date.$M){return dayAcc+templateBlocked}else{return dayAcc+base.getDateTemplate(day,date,isToday)}},'');countNumberOfRows++;return rowAcc+'<div class="calendar__day-row">'+days+'</div>'},'');if(countNumberOfRows<fixedNumberOfRows){grid+='<div class="calendar__day-row">'+templateBlocked+'</div>'}
base.calendarSection.html(grid)};base.announce=function(content){base.calendarUpdates.text(content);setTimeout(function(){base.calendarUpdates.text('')},1000)};base.updateUi=function(){base.activeMonth=parseInt(base.monthSelect.select2('data')[0].id);base.activeMonthLabel=base.monthSelect.select2('data')[0].text;base.activeYear=parseInt(base.yearSelect.select2('data')[0].id);base.activeYearLabel=base.activeYear;base.prevMonth=base.activeMonth-1;if(base.prevMonth===0){base.prevMonth=12}
base.prevMonthLabel=$(base.monthSelect[0][base.prevMonth-1])[0].label;base.prevYear=(base.prevMonth===12)?base.activeYear-1:base.activeYear;base.prevYearLabel=base.prevYear;base.nextMonth=base.activeMonth+1;if(base.nextMonth===13){base.nextMonth=1}
base.nextMonthLabel=$(base.monthSelect[0][base.nextMonth-1])[0].label;base.nextYear=(base.nextMonth===1)?base.activeYear+1:base.activeYear;base.nextYearLabel=base.nextYear;base.prevButtonYear=base.prevYear;if(base.prevMonth===12&&!base.yearSelect.find('option[value="'+base.prevButtonYear+'"]').length){base.prevButton.attr('disabled','disabled');base.prevButton.attr('aria-label','')}else{base.prevButton.removeAttr('disabled');base.prevButton.attr('aria-label',base.textPrevMonth+', '+base.prevMonthLabel+' '+base.prevYearLabel)}
base.nextButtonYear=base.nextYear;if(base.nextMonth===1&&!base.yearSelect.find('option[value="'+base.nextButtonYear+'"]').length){base.nextButton.attr('disabled','disabled');base.nextButton.attr('aria-label','')}else{base.nextButton.removeAttr('disabled');base.nextButton.attr('aria-label',base.textNextMonth+', '+base.nextMonthLabel+' '+base.nextYearLabel)}
var update=base.activeMonthLabel+' '+base.activeYearLabel;base.announce(update);base.renderDates(base.getDisplayedMonth())};base.selectDate=function(date){const $selection=base.calendarSection.find('[aria-pressed="true"]');if($selection.length){$selection.attr('aria-pressed','false');$selection.attr('tabindex','-1')}
date.setAttribute('aria-pressed','true');date.removeAttribute('tabindex');base.selected=dayjs.unix(date.getAttribute('data-timestamp'));base.announce(base.textSelected+' '+date.getAttribute('aria-label'))};base.initClickDay=function(){base.calendarSection.on('click',function(event){const target=event.target;if(target.classList.contains('calendar__day-item--active')){base.selectDate(target)}})};base.initClickPrevMonth=function(){base.prevButton.click(function(){base.getPrevMonth()})};base.getPrevMonth=function(){base.monthSelect.val(base.prevMonth);base.monthSelect.trigger('change');if(base.prevMonth===12){base.yearSelect.val(base.prevYear);base.yearSelect.trigger('change')}
base.updateUi()};base.showMonthOfDay=function(filteredDate){base.monthSelect.val(filteredDate.month()+1);base.monthSelect.trigger('change');base.yearSelect.val(filteredDate.year());base.yearSelect.trigger('change');base.updateUi()};base.initClickNextMonth=function(){base.nextButton.click(function(){base.getNextMonth()})};base.getNextMonth=function(){base.monthSelect.val(base.nextMonth);base.monthSelect.trigger('change');if(base.nextMonth===1){base.yearSelect.val(base.nextYear);base.yearSelect.trigger('change')}
base.updateUi()};base.initSelect=function(){base.monthSelect.select2({minimumResultsForSearch:-1,dropdownCssClass:"select2-dropdown--calendar"});base.monthSelect.on('select2:select',function(e){base.updateUi()});base.yearSelect.select2({minimumResultsForSearch:-1,dropdownCssClass:"select2-dropdown--calendar"});base.yearSelect.on('select2:select',function(e){base.updateUi()})};base.getLastDate=function(){var lastDate=base.calendarSection.find('.calendar__day-row:last-child .calendar__day-item:last-of-type:not(.calendar__day-item--empty)');if(!lastDate.length){lastDate=base.calendarSection.find('.calendar__day-row:last-child').prev().find('.calendar__day-item:last-of-type:not(.calendar__day-item--empty)')}
return lastDate};base.getFirstDate=function(){return base.calendarSection.find('.calendar__day-row:first-child .calendar__day-item:first-of-type:not(.calendar__day-item--empty)')};base.initKeyDownEvents=function(){base.calendarSection.on('keydown',function(event){const target=event.target;const key=event.key.replace('Arrow','');let next='';if(target.classList.contains('calendar__day-item')&&key.match(/Up|Down|Left|Right|Home|End|PageUp|PageDown/)){switch(key){case 'Right':if(target===base.getLastDate()[0]){if(base.nextButton.attr('disabled')){break}
base.getNextMonth();next=base.getFirstDate()}else{next=target.nextElementSibling||target.parentElement.nextElementSibling.firstElementChild}
break;case 'Left':if(target===base.getFirstDate()[0]){if(base.prevButton.attr('disabled')){break}
base.getPrevMonth();next=base.getLastDate()}else{next=target.previousElementSibling||target.parentElement.previousElementSibling.lastElementChild}
break;case 'Up':if(target===base.getFirstDate()[0]){if(base.prevButton.attr('disabled')){break}
base.getPrevMonth();next=base.getLastDate()}else{const parent=target.parentElement;const index=Array.from(parent.children).indexOf(target);const row=parent.previousElementSibling;if(row){next=row.children.item(index)}}
break;case 'Down':if(target===base.getLastDate()[0]){if(base.nextButton.attr('disabled')){break}
base.getNextMonth();next=base.getFirstDate()}else{const parent=target.parentElement;const index=Array.from(parent.children).indexOf(target);const row=parent.nextElementSibling;if(row){next=row.children.item(index)}}
break;case 'Home':next=base.getFirstDate();break;case 'End':next=base.getLastDate();break;case 'PageUp':case 'PageDown':if(key==='PageUp'){if(base.prevButton.attr('disabled')){break}
base.getPrevMonth()}else{if(base.nextButton.attr('disabled')){break}
base.getNextMonth()}
next=base.calendarSection.find('.calendar__day-item:contains("'+target.textContent+'")');break;default:}
event.preventDefault();if(next){next.focus()}else{base.announce(base.textEndOfCalendar)}}})};base.initCalendar=function(){if(base.$el.find('.js-calendar').length){if($('html').attr('lang').indexOf("de")>=0){base.locale='de'}else if($('html').attr('lang').indexOf("en")>=0){base.locale='en'}
base.$el.find('.js-calendar').each(function(){base.prevButton=$(this).find('.js-calendar-previous-month');base.nextButton=$(this).find('.js-calendar-next-month');base.monthSelect=$(this).find('.js-calendar-month');base.yearSelect=$(this).find('.js-calendar-year');base.calendarSection=$(this).find('.js-calendar-dates');base.calendarUpdates=$(this).find('.js-calendar-updates');base.currentDate=dayjs();base.hrefPrefix=$(this).data('href-prefix');base.selected=$(this).data('selected')?dayjs.unix($(this).data('selected')):null;base.today=dayjs().set('hour',0).set('minute',0).set('second',0).set('millisecond',0);base.events=window.calendarData;base.textNextMonth=$(this).data('text-next-month');base.textPrevMonth=$(this).data('text-prev-month');base.textNoEvents=$(this).data('text-no-events');base.textEndOfCalendar=$(this).data('text-end-of-calendar');base.textSelected=$(this).data('text-selected');base.initSelect();base.updateUi();base.initClickPrevMonth();base.initClickNextMonth();base.initClickDay();base.initKeyDownEvents()})}};base.init=function(){base.options=$.extend({},$.csCalendar.defaultOptions,options);base.initCalendar()};base.init()};$.csCalendar.defaultOptions={};$.fn.csCalendar=function(options){return this.each(function(){(new $.csCalendar(this,options))})}}(jQuery));var csAjaxComplete;if(typeof(Event)==='function'){csAjaxComplete=new Event('csAjaxComplete')}else{csAjaxComplete=document.createEvent('Event');csAjaxComplete.initEvent('csAjaxComplete',!0,!0)}
$(function(){CsAjax.init()});CsAjax={loadingSelector:'.js-loading',readyToLoad:!0,onPageReloadClickSelector:'a:not([class*="js-"]):not([target="_blank"]):not([href*="#"]):not([href^="http"]):not([href^="tel:"]):not([href^="mailto:"]):not([href^="javascript:"]):not([download]), a.js-menu-main__link, a.js-logo-link',onPageReloadContainerSelector:'.js-main-content-wrapper',onClickSelector:'.js-ajax-on-click',onClickParentSelector:'.js-ajax-on-click-parent',onClickParentActiveClass:'active',onClickCloseSelector:'.js-ajax-revert-on-click',onChangeSelector:'.js-submit-on-change',onClickSubmitSelector:'.js-submit-on-click',onClickResetSelector:'.js-reset-on-click',onSubmitSelector:'.js-ajax-on-submit',ajaxPageSelector:'.js-ajax-page',ajaxLoadContainerSelector:'.js-ajax-load-container',onScrollCounter:1,onScrollMax:3,onScrollUrl:'',onScrollSelector:'.js-ajax-on-scroll',initGlobalAjax:function(){$(document).ajaxStart(function(){var $activeEl=$(document.activeElement);if($activeEl.attr('name')!=='tx_solr[q]'){$('body').addClass('ajax-loading')}});$(document).ajaxComplete(function(){$('body').removeClass('ajax-loading')})},beforeAjax:function(){$('body').addClass('ajax-loading')},fireAjaxSubmitEvent:function(url,data,response){let csAjaxSubmitEvent=new CustomEvent('csAjaxSubmit',{detail:{url:url,data:data,response:response}});document.dispatchEvent(csAjaxSubmitEvent)},afterAjaxAndReformating:function(){$('body').removeClass('ajax-loading');document.dispatchEvent(csAjaxComplete);CsAjax.initAjaxOnScroll()},initAjaxOnClick:function(){$(document).on('click.ajax',this.onClickSelector,{},function(e){CsAjax.ajaxOnClick($(this),e)})},initAjaxPageReloadOnClick:function(){$(document).on('click.ajax',this.onPageReloadClickSelector,{},function(e){CsAjax.ajaxPageReloadOnClick($(this),e)})},initAjaxOnClickClose:function(){$(document).on('click.ajax',this.onClickCloseSelector,{},function(e){CsAjax.ajaxOnClickClose($(this),e)})},initAjaxOnSubmit:function(){$(document).on('submit.ajax',this.onSubmitSelector,{},function(e){CsAjax.ajaxOnSubmit($(this),e)})},initAjaxOnScroll:function(){if(CsAjax.onScrollUrl!==location.href){CsAjax.onScrollCounter=1;CsAjax.onScrollUrl=location.href;$(window).off('scroll.ajax').on('scroll.ajax',function(){CsAjax.ajaxOnScroll()})}},initSubmitOnChange:function(){$(document).on('change.ajax',this.onChangeSelector,{},function(e){$(this).closest('form').trigger('submit')})},removeSubmitOnChange:function(){$(document).off('change.ajax')},initAjaxSubmitOnClick:function(){$(document).on('click.ajax',this.onClickSubmitSelector,{},function(e){CsAjax.ajaxSubmitOnClick($(this),e)})},initAjaxResetOnClick:function(){$(document).on('click.ajax',this.onClickResetSelector,{},function(e){CsAjax.resetForm($(this).data('form'),e)})},initAjaxPageClick:function(){$(document).on('click.ajax',this.ajaxPageSelector+' a',{},function(e){var $page=$(this).closest(CsAjax.ajaxPageSelector),pageHref=$page.data('url'),stateObj={url:pageHref};if(pageHref){CsAjax.modifyBrowserHistory(pageHref,stateObj)}})},onUpdatedGridItemsInARow:function(){$(document).on('updated-grid-items-in-a-row',function(e,$list,itemsInRow){var $activeItem=$($list.find(CsAjax.onClickParentSelector+'.'+CsAjax.onClickParentActiveClass)[0]);if($activeItem.length){var $activeLink=$($activeItem.find(CsAjax.onClickSelector)[0]);var $container=$list.find($activeLink.data('ajax-container'));if($activeLink.data('ajax-replace-detail-box')==1){CsAjax.replaceDetailBox($activeLink,$container,$list,itemsInRow)}}})},ajaxSubmitOnClick:function($clickedEl,event){event.preventDefault();var $form=$clickedEl.closest('form'),url=$form.data('ajax-url'),data=$form.serialize();CsAjax.beforeAjax();$.post({url:url,data:data,global:!1,success:function(response){CsAjax.fireAjaxSubmitEvent(url,data,response);$clickedEl.closest(CsAjax.ajaxLoadContainerSelector).remove();CsAjax.insertNewData(response,$(body).find($clickedEl.data('ajax-container')),$clickedEl.data('ajax-insert'),$clickedEl.data('ajax-animation'),$clickedEl.data('ajax-container'));CsAjax.readyToLoad=!0},})},ajaxPageReloadOnClick:function($clickedEl,event){event.preventDefault();CsAjax.loadAjaxOnClick($clickedEl,$(CsAjax.onPageReloadContainerSelector))},ajaxOnClick:function($clickedEl,event){event.preventDefault();var listSelector=$clickedEl.data('ajax-list');var $list=$clickedEl.closest(listSelector);var $container=$list.find($clickedEl.data('ajax-container'));var loadContent=1;if($list.find(CsAjax.onClickParentSelector+'.'+CsAjax.onClickParentActiveClass).length){if($clickedEl.closest(CsAjax.onClickParentSelector).hasClass(CsAjax.onClickParentActiveClass)){CsAjax.ajaxOnClickClose($clickedEl,event);return!1}else{loadContent=0;CsAjax.ajaxOnClickClose($clickedEl,event,1)}}
if($clickedEl.data('ajax-leave-active-state')!=1){$clickedEl.closest(CsAjax.onClickParentSelector).addClass(CsAjax.onClickParentActiveClass)}
if(loadContent==1){CsAjax.loadAjaxOnClick($clickedEl,$container,listSelector)}},loadAjaxOnClick:function($clickedEl,$container,listSelector){if(!listSelector){var listSelector=''}
if($clickedEl.is(this.onPageReloadClickSelector)){var url=$clickedEl.attr('href');var pageReloadAjax=1}else{var url=$clickedEl.data('ajax-url')?$clickedEl.data('ajax-url'):$clickedEl.attr('href');var pageReloadAjax=0}
if($clickedEl.data('ajax-insert')){var ajaxInsert=$clickedEl.data('ajax-insert')}else{var ajaxInsert='replace'}
if($clickedEl.data('ajax-animation')){var ajaxAnimation=$clickedEl.data('ajax-animation')}else{var ajaxAnimation=''}
if($clickedEl.data('ajax-container')){var ajaxContainer=$clickedEl.data('ajax-container')}else{var ajaxContainer=CsAjax.onPageReloadContainerSelector}
CsAjax.beforeAjax();$.post({url:url,global:!1,success:function(response){if(pageReloadAjax==0){$clickedEl.closest(CsAjax.ajaxLoadContainerSelector).remove()}
if($clickedEl.data('ajax-replace-detail-box')==1&&listSelector!=''){CsAjax.replaceDetailBox($clickedEl,$container,listSelector)}
CsAjax.insertNewData(response,$container,ajaxInsert,ajaxAnimation,ajaxContainer,pageReloadAjax,$clickedEl);if(pageReloadAjax==1){var stateObj={url:url};CsAjax.modifyBrowserHistory(url,stateObj,$(response).filter('title').text());if(window.location.hash){$('.js-global-wrapper').data('csSectionLinks').initUrlWithHash()}}
CsAjax.readyToLoad=!0},error:function(xhr,status,error){if(xhr.status=='404'){console.log(location.protocol+'//'+location.host+url);location.href=location.protocol+'//'+location.host+url}},})},ajaxOnClickClose:function($clickedEl,event,loadNewContent){event.preventDefault();var listSelector=$clickedEl.data('ajax-list');var $list=$clickedEl.closest(listSelector);var $activeItem=$list.find(CsAjax.onClickParentSelector+'.'+CsAjax.onClickParentActiveClass);var $container=$list.find($clickedEl.data('ajax-container'));CsAjax.removeNewData($container,$activeItem,loadNewContent,$clickedEl);if($clickedEl.data('ajax-leave-active-state')!=1){$activeItem.removeClass(CsAjax.onClickParentActiveClass)}},ajaxOnSubmit:function($form,event){event.preventDefault();var url=$form.data('ajax-url')?$form.data('ajax-url'):$form.attr('action'),data=$form.serialize();CsAjax.beforeAjax();$.post({url:url,data:data,global:!1,success:function(response){CsAjax.fireAjaxSubmitEvent(url,data,response);CsAjax.insertNewData(response,$('body').find($form.data('ajax-container')),$form.data('ajax-insert'),$form.data('ajax-animation'),$form.data('ajax-container'))},})},ajaxOnScroll:function(){let $button=$($(this.onScrollSelector).get(0));if($button.length>0){$button.closest(CsAjax.ajaxLoadContainerSelector).css('overflow','hidden').css('height',0);if(($(window).scrollTop()+$(window).height())>$button.offset().top&&CsAjax.readyToLoad){CsAjax.readyToLoad=!1;$button.trigger('click');CsAjax.onScrollCounter++;if(CsAjax.onScrollCounter>CsAjax.onScrollMax){$(window).off('scroll.ajax')}}}},replaceDetailBox:function($clickedLink,$detailBox,gridListSelector,itemsInRow){var detailBoxSelector=$clickedLink.data('ajax-container');var gridItemSelector=$clickedLink.closest(gridListSelector).data('grid-item');var $clickedItem=$clickedLink.closest(gridItemSelector);var clickedIndex=$clickedItem.index();if(!itemsInRow){itemsInRow=$clickedLink.closest(gridListSelector).attr('data-grid-items-in-a-row')}
if($clickedItem.prevAll(detailBoxSelector).length){clickedIndex=clickedIndex-1}
var $allItems=$clickedLink.closest(gridListSelector).find(gridItemSelector);var indexOfAllItems=$allItems.length;var pos=((1+parseInt(clickedIndex/itemsInRow))*itemsInRow)-1;if(pos>=indexOfAllItems){pos=indexOfAllItems-1}
if($detailBox.index()!=(pos+1)){var $posEl=$allItems.get(pos);$detailBox.insertAfter($posEl)}},insertNewData:function(newHtml,$container,mode,animation,containerSelector,pageReloadAjax,$clickedEl){var $newHtml=$(newHtml);if(pageReloadAjax===undefined){var pageReloadAjax=0}
if($newHtml.find('.js-language-link').length>0){var $languageLink=$newHtml.find('.js-language-link');$('body').find('.js-language-link').replaceWith($languageLink)}
let newHtmlObject=document.createElement('html');newHtmlObject.innerHTML=newHtml;let $body=$(newHtmlObject).find('body');if($body&&$body.attr('data-menu-item-active')){$('body').attr('data-menu-item-active',$body.attr('data-menu-item-active'))}
if($newHtml.find(containerSelector).length>0){$newHtml=$newHtml.find(containerSelector)}
if(mode==='prepend'||mode==='append'){if(mode==='prepend'){$newHtml.find('[data-ajax-insert="append"]').closest(CsAjax.ajaxLoadContainerSelector).remove();$container.find('a:first')[0].focus();$container.prepend($newHtml.html())}
if(mode==='append'){$newHtml.find('[data-ajax-insert="prepend"]').closest(CsAjax.ajaxLoadContainerSelector).remove();$container.find('a:last')[0].focus();$container.append($newHtml.html())}
$container.csGlobalScripts({ajaxInit:1});CsAjax.afterAjaxAndReformating();return!0}
$container.html($newHtml.html());if(animation=='slideDown'){if($clickedEl.data('ajax-scroll-to-list-top')==1){var listSelector=$clickedEl.data('ajax-list');$('.js-global-wrapper').data('csSectionLinks').scrollToSection($clickedEl.closest(listSelector).attr('id'),0,1)}
if($clickedEl.data('ajax-close-link-teaser')==1){$clickedEl.parents(CsAjax.onClickParentSelector).slideUp(400)}
$container.slideDown(400,function(){if($clickedEl.data('ajax-scroll-to-detail-top')==1){$('.js-global-wrapper').data('csSectionLinks').scrollToSection($container,0,1,1)}})}
if($container.find('a').length){$container.find('a')[0].focus()}
$container.csGlobalScripts({ajaxInit:1});if(pageReloadAjax){$('.js-global-wrapper').data('csSidebar').closeMobileSidebar();$('.js-header').data('csHeader').toggleMenu('deactivate');$('.js-global-wrapper').data('csSidebar').checkHeight();$('.js-global-wrapper').data('csSectionLinks').scrollToSection('',0,1);$(document).trigger('nav_page_load');setTimeout(function(){CsAjax.afterAjaxAndReformating()},1000)}else{CsAjax.afterAjaxAndReformating()}},removeNewData:function($container,$activeItem,loadNewContent,$clickedEl){var animation=$clickedEl.data('ajax-animation');var listSelector=$clickedEl.data('ajax-list');if($activeItem){$activeItem.find('a')[0].focus()}
if(animation=='slideDown'){if($clickedEl.data('ajax-close-link-teaser')==1){$clickedEl.closest(listSelector).find(CsAjax.onClickParentSelector).slideDown(400)}
$container.slideUp(400,function(){if(loadNewContent==1){CsAjax.loadAjaxOnClick($clickedEl,$container,listSelector)}
if($clickedEl.data('ajax-scroll-to-list-top')==1){$('.js-global-wrapper').data('csSectionLinks').scrollToSection($clickedEl.closest(listSelector).attr('id'))}})}else if(loadNewContent==1){CsAjax.loadAjaxOnClick($clickedEl,$container,listSelector)}else if($clickedEl.data('ajax-scroll-to-list-top')==1){$('.js-global-wrapper').data('csSectionLinks').scrollToSection($clickedEl.closest(listSelector).attr('id'))}},modifyBrowserHistory:function(pageHref,stateObj,title){if(title!=''){document.title=title}
CsAjax.onScrollUrl='';if(typeof window.history.pushState=='function'){if(history.state&&history.state.product){history.replaceState(stateObj,document.title,pageHref)}else{history.pushState(stateObj,document.title,pageHref)}}},onPopState:function(){window.addEventListener('popstate',function(event){if((event.state===null||!event.state.url)&&window.location.hash===''){location.href=document.location}else if((event.state===null||!event.state.url)&&window.location.hash!=''){location.href=document.location;location.reload()}else{var url=event.state.url;if(url.toLowerCase().search('http')==-1){url=location.protocol+'//'+location.host+url}
location.href=url}},!1)},resetForm:function(formSelector,event){event.preventDefault();var $form=$(formSelector);CsAjax.removeSubmitOnChange();$form.find('.js-select').val('').trigger('change');$form.get(0).reset();CsAjax.initSubmitOnChange();$form.trigger('change')},init:function(){this.initGlobalAjax();this.initAjaxPageReloadOnClick();this.initSubmitOnChange();this.initAjaxSubmitOnClick();this.initAjaxPageClick();this.initAjaxOnSubmit();this.initAjaxOnClick();this.initAjaxOnClickClose();this.initAjaxOnScroll();this.initAjaxResetOnClick();this.onUpdatedGridItemsInARow();this.onPopState()},};(function($){$.csCountGridItemsInARow=function(el,options){var base=this;base.$el=$(el);base.el=el;base.$el.data("csCountGridItemsInARow",base);base.countGridItemsInARow=function(){if(base.$el.find('.js-count-grid-items-in-a-row').length){base.$el.find('.js-count-grid-items-in-a-row').each(function(){var itemSelector=$(this).data('grid-item');var width=$(this).width();var itemsInRow=Math.round(width/$(this).find(itemSelector).first().outerWidth());if(itemsInRow!=$(this).attr('data-grid-items-in-a-row')){$(this).attr('data-grid-items-in-a-row',itemsInRow);$(document).trigger("updated-grid-items-in-a-row",[$(this),itemsInRow])}})}};base.resize=function(){if(base.$el.find('.js-count-grid-items-in-a-row').length){$(window).on('resize',function(){base.countGridItemsInARow()})}};base.init=function(){base.options=$.extend({},$.csCountGridItemsInARow.defaultOptions,options);base.countGridItemsInARow();base.resize()};base.init()};$.csCountGridItemsInARow.defaultOptions={};$.fn.csCountGridItemsInARow=function(options){return this.each(function(){(new $.csCountGridItemsInARow(this,options))})}}(jQuery));(function($){$.csFormFields=function(el,options){var base=this;base.$el=$(el);base.el=el;base.$el.data("csFormFields",base);base.setDateTimeError=function(field){if(field.validationResult!==!0){field.$element.parent('.js-datetime-wrapper').addClass('parsley-error')}else{field.$element.parent('.js-datetime-wrapper').removeClass('parsley-error')}};base.initSelect=function(){if(base.$el.find('.js-select').length){base.$el.find('.js-select').each(function(){$(this).select2({placeholder:$(this).data('placeholder'),minimumResultsForSearch:-1});$(this).on('select2:select',function(e){$(this).parsley().validate()})})}}
base.initFileUpload=function(){if(base.$el.find('.js-file-upload').length){base.$el.find('.js-file-upload').each(function(){$(this).find('.js-file-upload-button').bind('keypress keyup',function(e){if(e.which===32||e.which===13){e.preventDefault();$(this).parents('.js-file-upload').find('input[type="file"]').click()}});$(this).find('.js-file-upload-input').change(function(e){var filename=$(this).val().split('\\').pop();var $filename=$(this).parents('.js-file-upload').find('.js-file-upload-filename');$filename.val(filename);$filename.attr('placeholder',filename);$filename.focus()})})}}
base.initParsleyValidation=function(){if(base.$el.find('form.powermail_form[data-parsley-validate]').length){base.$el.find('form.powermail_form[data-parsley-validate]').each(function(){$(this).parsley().on('field:validated',function(){switch(this.$element.attr('type')){case 'date':base.setDateTimeError(this);break;case 'time':base.setDateTimeError(this);break;case 'datetime-local':base.setDateTimeError(this);break}})})}}
base.init=function(){base.options=$.extend({},$.csFormFields.defaultOptions,options);base.initSelect();base.initFileUpload();base.initParsleyValidation()};base.init()};$.csFormFields.defaultOptions={};$.fn.csFormFields=function(options){return this.each(function(){(new $.csFormFields(this,options))})}}(jQuery));(function($){$.csToTopButton=function(el,options){var base=this;base.$el=$(el);base.el=el;base.$el.data("csToTopButton",base);base.clickEvent=function(){base.$el.click(function(){$('html,body').animate({scrollTop:0},800,function(){$('.js-open-menu-main').focus()});return!1})};base.init=function(){base.options=$.extend({},$.csToTopButton.defaultOptions,options);base.clickEvent()};base.init()};$.csToTopButton.defaultOptions={};$.fn.csToTopButton=function(options){return this.each(function(){(new $.csToTopButton(this,options))})}}(jQuery));(function($){$.csEventTeaser=function(el,options){var base=this;base.$el=$(el);base.el=el;base.$el.data("csEventTeaser",base);base.clickOpenEventTeaserDetailsLevel1=function(){if(base.$el.find('.js-open-event-teaser-details-level-1').length){base.$el.find('.js-open-event-teaser-details-level-1').each(function(){$(this).click(function(e){let $link=$(this);e.preventDefault();$link.addClass('h-deactivate-link');$link.attr('data-href',$link.attr('href'));$link.removeAttr('href');var $eventTeaser=$(this).parents('.js-event-teaser');$eventTeaser.addClass('show-details-level-1');$eventTeaser.find('.js-event-teaser-details-level-1').slideDown();$eventTeaser.find('.js-event-teaser-details-hide-on-level-1').slideUp();$eventTeaser.find('.js-event-teaser-close-link').focus();$eventTeaser.find('.js-event-teaser-info-teaser').removeAttr('inert');if(window.matchMedia('(max-width: '+base.options.breakpointMobile+'px)').matches){$('.js-global-wrapper').data("csSectionLinks").scrollToSection($eventTeaser.attr('id'),0,1)}
return!1})})}};base.clickOpenEventTeaserDetailsLevel2=function(){if(base.$el.find('.js-open-event-teaser-details-level-2').length){base.$el.find('.js-open-event-teaser-details-level-2').each(function(){$(this).click(function(e){e.preventDefault();var $eventTeaser=$(this).parents('.js-event-teaser');$eventTeaser.addClass('show-details-level-2');$eventTeaser.find('.js-event-teaser-image-wrapper').attr('inert','');$eventTeaser.find('.js-event-teaser-details-level-2').slideDown();$eventTeaser.find('.js-event-teaser-full-description').removeAttr('inert');$eventTeaser.find('.js-event-teaser-info-teaser').attr('inert','');$eventTeaser.find('.js-event-teaser-composer-info-link').focus();if(window.matchMedia('(max-width: '+base.options.breakpointMobile+'px)').matches){$eventTeaser.find('.js-event-teaser-info-teaser').slideUp();$eventTeaser.find('.js-event-teaser-image-wrapper').removeAttr('inert')}
return!1})})}};base.closeEventTeaserLevel1=function($eventTeaser){$eventTeaser.removeClass('show-details-level-1');let $link=$eventTeaser.find('.js-open-event-teaser-details-level-1');$link.removeClass('h-deactivate-link');$link.attr('href',$link.attr('data-href'));$link.removeAttr('data-href');$eventTeaser.find('.js-event-teaser-details-level-1').slideUp();$eventTeaser.find('.js-event-teaser-details-hide-on-level-1').slideDown();$eventTeaser.find('.js-event-teaser-info-teaser').attr('inert','');$eventTeaser.find('.js-event-teaser-short-description-link').focus()}
base.closeEventTeaserLevel2=function($eventTeaser){$eventTeaser.removeClass('show-details-level-2');$eventTeaser.find('.js-event-teaser-image-wrapper').removeAttr('inert');$eventTeaser.find('.js-event-teaser-details-level-2').slideUp();$eventTeaser.find('.js-event-teaser-full-description').attr('inert','');$eventTeaser.find('.js-event-teaser-info-teaser').removeAttr('inert');if(window.matchMedia('(max-width: '+base.options.breakpointMobile+'px)').matches){$eventTeaser.find('.js-event-teaser-info-teaser').slideDown()}}
base.clickCloseEventTeaserDetails=function(){if(base.$el.find('.js-close-event-teaser-details').length){base.$el.find('.js-close-event-teaser-details').each(function(){$(this).click(function(){var $eventTeaser=$(this).parents('.js-event-teaser');if($eventTeaser.hasClass('show-details-level-2')){base.closeEventTeaserLevel2($eventTeaser)}else if($eventTeaser.hasClass('show-details-level-1')){base.closeEventTeaserLevel1($eventTeaser)}
return!1})})}};base.clickCloseEventTeaserDetailsLevel1=function(){if(base.$el.find('.js-close-event-teaser-details-level-1').length){base.$el.find('.js-close-event-teaser-details-level-1').each(function(){$(this).click(function(){base.closeEventTeaserLevel1($(this).parents('.js-event-teaser'));return!1})})}};base.clickCloseEventTeaserDetailsLevel2=function(){if(base.$el.find('.js-close-event-teaser-details-level-2').length){base.$el.find('.js-close-event-teaser-details-level-2').each(function(){$(this).click(function(){base.closeEventTeaserLevel2($(this).parents('.js-event-teaser'));return!1})})}};base.init=function(){base.options=$.extend({},$.csEventTeaser.defaultOptions,options);base.clickOpenEventTeaserDetailsLevel1();base.clickOpenEventTeaserDetailsLevel2();base.clickCloseEventTeaserDetails();base.clickCloseEventTeaserDetailsLevel1();base.clickCloseEventTeaserDetailsLevel2()};base.init()};$.csEventTeaser.defaultOptions={breakpointMobile:768};$.fn.csEventTeaser=function(options){return this.each(function(){(new $.csEventTeaser(this,options))})}}(jQuery));(function($){$.csTargetBlankAdditive=function(el,options){var base=this;base.$el=$(el);base.el=el;base.$el.data("csTargetBlankAdditive",base);base.baseTargetBlankAdditive=function(){if(base.$el.find('a[target="_blank"]').length){base.$el.find('a[target="_blank"]').each(function(){$(this).append('<span class="h-only-screenreader-text"> ('+base.options.text+')</span>')})}};base.init=function(){base.options=$.extend({},$.csTargetBlankAdditive.defaultOptions,options);base.baseTargetBlankAdditive()};base.init()};$.csTargetBlankAdditive.defaultOptions={text:$('.js-header').data('accessibility-target-blank-additive')};$.fn.csTargetBlankAdditive=function(options){return this.each(function(){(new $.csTargetBlankAdditive(this,options))})}}(jQuery));(function($){$.csHeader=function(el,options){var base=this;base.$el=$(el);base.el=el;base.$el.data("csHeader",base);base.addHighContrastCss=function(path,$link){var link=$('<link />',{rel:'stylesheet',id:'high-contrast-css',type:'text/css',href:path});$('head').append(link);$link.attr('title',$link.data('title-deactivate'));$link.attr('aria-label',$link.data('title-deactivate'))};base.removeHighContrastCss=function($link){$('link#high-contrast-css').remove();$link.attr('title',$link.data('title-activate'));$link.attr('aria-label',$link.data('title-activate'))};base.initContrastView=function(){$('.js-toggle-high-contrast').on('click',function(){if(Cookies.get('high-contrast')){Cookies.remove('high-contrast');base.removeHighContrastCss($('.js-toggle-high-contrast'))}else{Cookies.set('high-contrast','1');base.addHighContrastCss($(this).data('contrast-path'),$('.js-toggle-high-contrast'))}});if(Cookies.get('high-contrast')){base.addHighContrastCss($('.js-toggle-high-contrast').data('contrast-path'),$('.js-toggle-high-contrast'))}};base.toggleMenu=function(type){if(type=='activate'){$('.js-global-wrapper').data("csSidebar").closeMobileSidebar();$('.js-menu-overlay').addClass('active');$('.js-menu-main').addClass('open');$('.js-menu-main').removeAttr('inert');setTimeout(function(){$('.js-menu-main').find('.js-close-menu-main')[0].focus()},400)}else if(type=='deactivate'){base.toggleMenuSubLevel($('.js-menu-main').find('.js-menu-main__item'),'deactivate');$('.js-menu-main').removeClass('open');$('.js-menu-main').attr('inert','');$('.js-open-menu-main').focus();$('.js-menu-overlay').removeClass('active')}};base.clickEventMenuOpen=function(){$('.js-open-menu-main').click(function(){base.toggleMenu('activate');return!1})};base.toggleMenuSubLevel=function($item,type){if(type=='activate'){$item.addClass('show-children');$item.children('.js-menu-main-list').removeAttr('inert')}else if(type=='deactivate'){$item.removeClass('show-children');$item.children('.js-menu-main-list').attr('inert','')}};base.clickEventMenuClose=function(){$('.js-close-menu-main').click(function(){base.toggleMenu('deactivate');return!1})};base.clickEventLevelUp=function(){$('.js-menu-main-level-up').click(function(){base.toggleMenuSubLevel($(this).closest('.js-menu-main__item'),'deactivate');return!1})};base.clickEventLink=function(){$('.js-menu-main__link--has-children').click(function(e){e.preventDefault();base.toggleMenuSubLevel($(this).parent('.js-menu-main__item'),'activate');return!1})};base.clickMenuOverlay=function(){$('.js-menu-overlay').click(function(){base.toggleMenu('deactivate');$('.js-global-wrapper').data("csSidebar").closeMobileSidebar();return!1})};base.clickMainContentSectionLink=function(){$('.js-go-to-main-content').click(function(e){e.preventDefault();$('.js-main-content-wrapper').find('button:not([disabled]), a:not(.js-logo-link), input:not([type="hidden"]), select, textarea, [tabindex]:not([tabindex="-1"])').first().focus();return!1})};base.init=function(){base.options=$.extend({},$.csHeader.defaultOptions,options);base.initContrastView();base.clickEventMenuOpen();base.clickEventMenuClose();base.clickMenuOverlay();base.clickEventLink();base.clickEventLevelUp();base.clickMainContentSectionLink()};base.init()};$.csHeader.defaultOptions={};$.fn.csHeader=function(options){return this.each(function(){(new $.csHeader(this,options))})}}(jQuery));(function($){$.csSidebar=function(el,options){var base=this;base.$el=$(el);base.el=el;base.$el.data("csSidebar",base);base.contentIsSmallerThanSidebar=0;base.removeHeight=function(){$('.js-sidebar-content').removeAttr('style')};base.setHeight=function(){var footerHeight=$('.js-footer').outerHeight();$('.js-sidebar-content').css('padding-bottom',footerHeight)};base.checkHeight=function(){if(window.matchMedia('(min-width: '+(base.options.breakpointMobileSidebar+1)+'px)').matches){base.contentIsSmallerThanSidebar=0;base.removeHeight();var contentHeight=$('.js-main-content-wrapper').outerHeight();var sidebarHeight=$('.js-sidebar-content').outerHeight();if(contentHeight<sidebarHeight){base.contentIsSmallerThanSidebar=1;base.setHeight();document.addEventListener('lazyloaded',function(e){base.setHeight()})}}};base.closeMobileSidebar=function(){base.$el.find('.js-sidebar-menu-item').removeClass('active');base.$el.find('.js-sidebar-content').removeClass('open');$('.js-menu-overlay').removeClass('active')};base.clickEvent=function(){base.$el.find('.js-toggle-sidebar-content').click(function(e){e.preventDefault();$('.js-header').data("csHeader").toggleMenu('deactivate');$('.js-menu-overlay').addClass('active');$(this).parent('.js-sidebar-menu-item').toggleClass('active');$(this).parent('.js-sidebar-menu-item').siblings('.js-sidebar-menu-item').removeClass('active');base.$el.find('.js-sidebar-content-item').removeAttr('style');if($(this).parent('.js-sidebar-menu-item').hasClass('active')){var section=$(this).attr('href');$(section).fadeIn();base.$el.find('.js-sidebar-content').addClass('open');$(section).find('a,button')[0].focus()}
if(!$('.js-sidebar-menu-item.active').length){base.$el.find('.js-sidebar-content').removeClass('open')}
return!1})};base.resize=function(){$(window).resize(function(){if(window.matchMedia('(min-width: '+(base.options.breakpointMobileSidebar+1)+'px)').matches){base.checkHeight()}else{base.contentIsSmallerThanSidebar=0;base.removeHeight()}})};base.scroll=function(){$(window).scroll(function(){if(window.matchMedia('(min-width: '+(base.options.breakpointMobileSidebar+1)+'px)').matches&&base.contentIsSmallerThanSidebar==0){if($(this).scrollTop()+$(window).innerHeight()>=$('.js-footer').offset().top){base.setHeight()}else{base.removeHeight()}}})};base.init=function(){base.options=$.extend({},$.csSidebar.defaultOptions,options);base.checkHeight();base.clickEvent();base.resize();base.scroll()};base.init()};$.csSidebar.defaultOptions={breakpointMobileSidebar:1160,};$.fn.csSidebar=function(options){return this.each(function(){(new $.csSidebar(this,options))})}}(jQuery));(function($){$.csResponsiveTables=function(el,options){var base=this;base.$el=$(el);base.el=el;base.$el.data("csResponsiveTables",base);base.baseResponsiveTables=function(){if(base.$el.find(base.options.selector).length){base.$el.find(base.options.selector).each(function(){var ths=[];$(this).find('thead th').each(function(key){ths[key]=$(this).text()});var thsLength=ths.length;$(this).find('tbody td').each(function(key){if(ths[(key%thsLength)]!=""){$(this).attr('data-th',ths[(key%thsLength)])}})})}};base.init=function(){base.options=$.extend({},$.csResponsiveTables.defaultOptions,options);base.baseResponsiveTables()};base.init()};$.csResponsiveTables.defaultOptions={selector:'table:not(.h-clean):not(.duet-date__table)'};$.fn.csResponsiveTables=function(options){return this.each(function(){(new $.csResponsiveTables(this,options))})}}(jQuery));(function($){$.csMiscellaneous=function(el,options){var base=this;base.$el=$(el);base.el=el;base.isTouchDevice=('ontouchstart' in window);base.$el.data("csMiscellaneous",base);base.showAudioPlayer=function(){if(base.$el.find('.js-show-audio-player').length){base.$el.find('.js-show-audio-player').each(function(){let $singleShowAudioPlayerLink=$(this);$singleShowAudioPlayerLink.click(function(){$singleShowAudioPlayerLink.find('audio').each(function(index,element){if($(element).data('cs-cookie-able-player')!==undefined){AblePlayerInstances.push(new AblePlayer($(this),$(element)))}});$singleShowAudioPlayerLink.addClass('opened');$singleShowAudioPlayerLink.find('.js-audio-player').slideDown(400,function(){$(window).trigger('resize')});$singleShowAudioPlayerLink.off('click')})})}};base.resizeListTeaser=function(){if(base.$el.find('.js-list-teaser-outer-wrapper').length){base.$el.find('.js-list-teaser-outer-wrapper').each(function(){if(!$(this).hasClass('opened')){var previewHeight=0;var previewItems=4;if($(this).find('.js-list-teaser > li').length>previewItems){$(this).find('.js-list-teaser > li').each(function(index){if(index<previewItems){previewHeight+=$(this).outerHeight(!0)}else{return!1}});$(this).find('.js-list-teaser-inner-wrapper').css('height',previewHeight+1)}else{$(this).find('.js-list-teaser-inner-wrapper').css('height','auto');$(this).find('.js-show-list-teaser').hide()}}})}};base.initListTeaser=function(){base.resizeListTeaser()};base.resizeListTeaserEvent=function(){$(window).resize(function(){base.resizeListTeaser()})};base.openListTeaser=function(){if(base.$el.find('.js-show-list-teaser').length){base.$el.find('.js-show-list-teaser').each(function(){$(this).click(function(){var $listOuterWrapper=$(this).parents('.js-list-teaser-outer-wrapper');$listOuterWrapper.find('.js-list-teaser-inner-wrapper').css('height',$listOuterWrapper.find('.js-list-teaser').outerHeight());$listOuterWrapper.addClass('opened');$(this).hide()})})}};base.showOnTouchDeviceElements=function(){if(base.isTouchDevice){$('.h-show-on-touch-device').show()}};base.toggleTourDates=function(){if(base.$el.find('.js-show-tour-dates-detail-box, .js-hide-tour-dates-detail-box').length){base.$el.find('.js-show-tour-dates-detail-box, .js-hide-tour-dates-detail-box').each(function(){$(this).click(function(){var $listOuterWrapper=$(this).parents('.js-tour-list');$listOuterWrapper.find('.js-tour-dates-detail-box').slideToggle();$listOuterWrapper.find('.js-show-tour-dates-detail-box').parent('.js-tour-dates-off-button-wrapper').slideToggle();if($(this).hasClass('js-hide-tour-dates-detail-box')){$('.js-global-wrapper').data("csSectionLinks").scrollToSection($listOuterWrapper.attr('id'),0)}})})}};base.showHideTourDatesButton=function(){if(base.$el.find('.js-tour-dates-detail-box').length){base.$el.find('.js-tour-dates-detail-box').each(function(){$(this).find('> .frame:last-child').find('.js-tour-dates-off-button-wrapper').show()})}};base.initialLightbox=function(){if($('.js-initial-lightbox').length){var cookieName='cs-initial-lightbox-'+$('.js-initial-lightbox').attr('data-uid');if(!Cookies.get(cookieName)){$('.js-initial-lightbox').modaal('open');Cookies.set(cookieName,1,{expires:7,path:''})}}};base.responsiveVideos=function(){if(base.$el.find('.js-responsive-video').length){base.$el.find('.js-responsive-video').each(function(){$(this).fitVids()})}};base.duplicateNewstickerText=function(){if(base.$el.find('.js-newsticker-text:not(.is-cloned)').length){base.$el.find('.js-newsticker-text:not(.is-cloned)').each(function(){$(this).children().clone(!0,!0).appendTo($(this));$(this).children().clone(!0,!0).appendTo($(this));$(this).children().clone(!0,!0).appendTo($(this));$(this).children().clone(!0,!0).appendTo($(this));$(this).addClass('is-cloned')})}};base.slideToggleContent=function(){if(base.$el.find('.js-slide-toggle-content-link').length){base.$el.find('.js-slide-toggle-content-link').each(function(){var $el=$(this);$el.click(function(){$el.slideUp();$el.attr('aria-expanded','true');$el.next('.js-slide-toggle-content-wrapper').slideDown()})})}};base.triggerClick=function(){if(base.$el.find('.js-trigger-click').length){base.$el.find('.js-trigger-click').each(function(){$(this).click(function(e){var hash=$(this).data('hash');var $target;if(hash instanceof jQuery){$target=hash}else{$target=$('#'+hash)}
if($target.length){$target.trigger("click");return!1}})})}};base.scrollToTypo3MessagesOnInit=function(){if($('.typo3-messages').length){$('.js-global-wrapper').data("csSectionLinks").scrollToSection($('.typo3-messages'),0)}};base.init=function(){base.options=$.extend({},$.csMiscellaneous.defaultOptions,options);base.showAudioPlayer();base.duplicateNewstickerText();base.initialLightbox();base.responsiveVideos();base.initListTeaser();base.resizeListTeaserEvent();base.openListTeaser();base.showOnTouchDeviceElements();base.showHideTourDatesButton();base.toggleTourDates();base.slideToggleContent();base.triggerClick();base.scrollToTypo3MessagesOnInit()};base.init()};$.csMiscellaneous.defaultOptions={};$.fn.csMiscellaneous=function(options){return this.each(function(){(new $.csMiscellaneous(this,options))})}}(jQuery));(function($){$.csFixedButtonMenu=function(el,options){var base=this;base.$el=$(el);base.el=el;base.$el.data("csFixedButtonMenu",base);base.setBreakpoint=function(){if(window.matchMedia('(min-width: '+(base.options.breakpointFixedButtonMenu+1)+'px)').matches&&$('.js-fixed-button-menu').length){var globalNewstickerHeight=$('.js-global-newsticker').is(':visible')?$('.js-global-newsticker').outerHeight():0;base.breakpoint=$('.js-fixed-button-menu').parents('.js-button-menu-wrapper').offset().top-$('.js-header').outerHeight()-globalNewstickerHeight-14}};base.resetFixedButtonMenu=function(){if($('.js-fixed-button-menu').hasClass('fixed')){$('.js-fixed-button-menu').removeClass('fixed');$('.js-fixed-button-menu').parents('.js-button-menu-wrapper').removeAttr('style');$('.js-sticky-right-column').removeAttr('style')}};base.setFixedButtonMenu=function(){if(!$('.js-fixed-button-menu').hasClass('fixed')){$('.js-fixed-button-menu').parents('.js-button-menu-wrapper').css('padding-top',$('.js-fixed-button-menu').outerHeight()+parseInt($('.js-fixed-button-menu').css('margin-bottom')));$('.js-fixed-button-menu').addClass('fixed');$('.js-sticky-right-column').css('top',parseInt($('.js-sticky-right-column').css('top'))+$('.js-fixed-button-menu').outerHeight()+'px')}};base.resize=function(){$(window).resize(function(){if(window.matchMedia('(min-width: '+(base.options.breakpointFixedButtonMenu+1)+'px)').matches){setTimeout(function(){base.setBreakpoint()},50)}else{base.resetFixedButtonMenu()}})};base.scroll=function(){window.addEventListener('scroll',function(){if(window.matchMedia('(min-width: '+(base.options.breakpointFixedButtonMenu+1)+'px)').matches){if($(this).scrollTop()<=base.breakpoint){base.resetFixedButtonMenu()}else{base.setFixedButtonMenu()}}})};base.init=function(){base.options=$.extend({},$.csFixedButtonMenu.defaultOptions,options);base.setBreakpoint();base.resize();base.scroll();document.addEventListener('lazyloaded',function(e){base.setBreakpoint()})};base.init()};$.csFixedButtonMenu.defaultOptions={breakpointFixedButtonMenu:1160,};$.fn.csFixedButtonMenu=function(options){return this.each(function(){(new $.csFixedButtonMenu(this,options))})}}(jQuery));(function($){$.csConcerts=function(el,options){var base=this;base.$el=$(el);base.el=el;base.$filter=base.$el.find('.js-concerts-filter');base.$list=base.$el.find('.js-concerts-list');base.offset=0;base.itemsPerPage=6;base.loadEnabled=!0;base.allEntriesLoaded=!1;base.$el.data("csConcerts",base);base.baseCsConcerts=function(){if(base.$list.length){base.bindScrollEvent()}};base.listConcerts=function(reset){if(base.loadEnabled===!1||typeof base.$list.data('list-url')=='undefined'){return!1}
if(typeof reset!=='boolean'){reset=!1}
if(reset===!1&&base.allEntriesLoaded===!0){return!1}
base.loadEnabled=!1;if(reset===!0){base.offset=0;base.allEntriesLoaded=!1;base.$list.empty()}else{base.offset+=base.itemsPerPage}
var data={'tx_csconcerts_pi1':{'search':base.$filter.find('.sword').val(),'offset':base.offset}};jQuery.ajax({url:base.$list.data('list-url'),data:data,type:'POST',success:function(data){var $articles=jQuery(data).find('.js-concert-item');if($articles.length){base.$list.append($articles)}else if(reset===!0){base.$list.append(jQuery(data).find('.js-concerts-error'))}
base.loadEnabled=!0;if($articles.length<base.itemsPerPage){base.allEntriesLoaded=!0}
base.$list.csGlobalScripts({ajaxInit:1});base.bindScrollEvent()}})};base.bindScrollEvent=function(){if(base.$list.is(':visible')){var lastListItem=document.querySelector('.js-concerts-list .js-concert-item:last-of-type');if(lastListItem){Clickstorm.createIntersectionObserver(lastListItem,function(){base.listConcerts()})}}};base.init=function(){base.options=$.extend({},$.csConcerts.defaultOptions,options);base.baseCsConcerts()};base.init()};$.csConcerts.defaultOptions={};$.fn.csConcerts=function(options){return this.each(function(){(new $.csConcerts(this,options))})}}(jQuery));window.addEventListener('load',function(){let settings={popupClass:'.js-popup',cookieBannerCloseEvent:'close-cookie-banner',cookieName:'advertisement-popup-closed',cookieExpireRate:86400,timeoutMS:1000,};function isHidden(el){const style=window.getComputedStyle(el);return(style.display==='none')}
function triggerAnimation(ele){ele.classList.add('fade');setTimeout(function(){ele.focus()},settings.timeoutMS)}
function setCookie(){if(!Cookies.get(settings.cookieName)){document.cookie=settings.cookieName+'=1; max-age='+settings.cookieExpireRate+'; path=/'}}
function triggerPopup(){const cookieName='cs-cookie-banner';const cookieValue=Cookies.get(cookieName);document.querySelectorAll(settings.popupClass).forEach(function iterate(popup){if(Cookies.get(settings.cookieName)){popup.style.display='none'}
if(!cookieValue){popup.style.visbility='hidden'}else{if(!isHidden(popup)){triggerAnimation(popup)}}
document.addEventListener(settings.cookieBannerCloseEvent,function(){popup.style.visibility='visible';triggerAnimation(popup)})})}
function closePopup(){document.querySelectorAll(settings.popupClass).forEach(function iterate(popup){let closeIcon=popup.querySelector('.js-popup-close');closeIcon.addEventListener('click',function(){popup.style.display='none';setCookie()});closeIcon.addEventListener('keypress',function(event){if(event.key==='Enter'){event.preventDefault();popup.style.display='none';setCookie()}})})}
function init(){if(document.querySelectorAll(settings.popupClass).length){triggerPopup();closePopup()}}
init()});(function($){$.csGlobalScripts=function(el,options){var base=this;base.$el=$(el);base.el=el;base.$el.data('csGlobalScripts',base);base.init=function(){base.options=$.extend({},$.csGlobalScripts.defaultOptions,options);base.$el.csFormFields();base.$el.csSectionLinks();base.$el.csResponsiveTables();base.$el.csSlider();base.$el.csConcerts();base.$el.csLightbox();base.$el.csTargetBlankAdditive();base.$el.csCountGridItemsInARow();base.$el.csCaptcha();base.$el.csEventTeaser();base.$el.csMiscellaneous();base.$el.csChatbot();base.$el.csAudioStream();if(base.options.ajaxInit==1){base.$el.find('.js-tabs').each(function(){new AccordionTabs(this)});$csCookieBanner.reinitClickIframePrivacyAndEvents()}
base.$el.csFixedButtonMenu();base.fixCalenderDate();base.setMenuStateActive()};base.fixCalenderDate=function(){if(base.$el.find('.js-calendar').length){let filteredDate=$('.js-global-wrapper').data('csCalendar').today;if(typeof filterValues!=='undefined'&&filterValues.date&&filterValues.date.from){filteredDate=dayjs(new Date(filterValues.date.from))}else{$('.js-global-wrapper').data('csCalendar').showMonthOfDay(filteredDate)}
let selectedDate=$('.calendar__day-item[data-timestamp="'+filteredDate.unix()+'"]');if(selectedDate.length){$('.js-global-wrapper').data('csCalendar').selectDate(selectedDate.get(0))}}};base.setMenuStateActive=function(){let activeFilterPids=$('body').attr('data-menu-item-active');$('a.h-link-menu-active').removeClass('h-link-menu-active').removeAttr('aria-describedby');if(activeFilterPids){$(activeFilterPids.split(',')).each(function(index,activePid){let $menuPage=$('a[data-menu-item-uid="'+activePid+'"]');if($menuPage.length){$menuPage.addClass('h-link-menu-active').attr('aria-describedby','a11y-desc-current')}})}};base.init()};$.csGlobalScripts.defaultOptions={ajaxInit:0,};$.fn.csGlobalScripts=function(options){return this.each(function(){(new $.csGlobalScripts(this,options))})}}(jQuery));let $csCookieBanner=null;let $lastClickedElement=null;let csCookieName='cs-cookie-banner';jQuery(document).ready(function($){$csCookieBanner=jQuery(document).csCookieBanner({expireDays:7,cookieName:csCookieName,language:$('html')[0].lang,useIframes:!0,openOnStart:!0,useOwnIframeMessageBox:!0,useIframeOpenModalByClick:!0,tagManagerLoaded:!1,showCloseButton:!1,focusFirstElement:$('.menu-top__link.js-toggle-high-contrast'),pathToGtmScript:'/typo3conf/ext/cs_templates/Resources/Public/JavaScript/csTagManager.js',pathToConfigJson:'/typo3conf/ext/cs_templates/Resources/Public/JavaScript/config-cookie-banner.json',iframeTypes:[{key:'videos_youtube',cookie_key:'videos_youtube',},{key:'videos_vimeo',cookie_key:'videos_vimeo',},{key:'map',cookie_key:'maps_google',},],});let toggleLinksOnce=!0;function toggleLinks(){if($csCookieBanner.getCookieKeyExist('essential')){if(toggleLinksOnce){let params=Cookies.get(csCookieName);let paramsValue=encodeURIComponent(btoa(params));let links=document.querySelectorAll('a[href^="https://tickets.gewandhausorchester.de/"]');for(let i=0;i<links.length;i++){let link=links[i];let currentHref=link.getAttribute('href');let param=(currentHref.includes('?'))?'&':'?';param+='cshash='+paramsValue;let newHref=currentHref+param;link.setAttribute('href',newHref)}
toggleLinksOnce=!1}}}
toggleLinks();$(document).on('updatedCookieBanner',function(event){if($lastClickedElement){if($lastClickedElement.hasClass('js-show-audio-player')&&$csCookieBanner.getCookieKeyExist('audio_ableplayer')||$lastClickedElement.hasClass('js-toggle-audio')&&$csCookieBanner.getCookieKeyExist('audio_soundcloud')){$lastClickedElement.trigger('click')}
$('.js-iframe, .js-video').unbind('click');$('.js-iframe, .js-video').each(function(){$.removeData(this)});$('.js-global-wrapper').csLightbox();if($.csLightbox.checkCookieIsSet($lastClickedElement)){$lastClickedElement.trigger('click')}}
toggleLinks()});if($('.js-global-wrapper').find('.js-toggle-audio').length){if(!$('html').hasClass('no-audio')){globalAudio=new Audio();var url=['https://api.soundcloud.com/tracks/','/stream?client_id=ccc52f31f6eed2fd715db20e0c580067'];$('.js-global-wrapper').find('.js-toggle-audio').on('click',function(){if($csCookieBanner.getCookieKeyExist('audio_soundcloud')){var $el=$(this);var currentTrack=''+$el.data('id');if(currentTrack.indexOf('://')==-1){currentTrack=url[0]+currentTrack+url[1]}
if(globalAudio.src!=currentTrack){if(!globalAudio.paused){globalAudio.pause()}
globalAudio.src=currentTrack;$('.js-toggle-audio.cs-icon-pause').toggleClass('cs-icon-pause cs-icon-play')}
if($el.hasClass('cs-icon-pause')){if(!globalAudio.paused){globalAudio.pause()}}else{if(globalAudio.paused){globalAudio.play()}}
$el.toggleClass('cs-icon-pause cs-icon-play')}else{let e=jQuery.Event('click');e.target=$(this);$lastClickedElement=$(this);$csCookieBanner.openCookieModal(e)}})}}
if(!String.prototype.startsWith){Object.defineProperty(String.prototype,'startsWith',{value:function(search,rawPos){var pos=rawPos>0?rawPos|0:0;return this.substring(pos,pos+search.length)===search},})}
var selectors=$('[class^="js-confirm-"], [class*=" js-confirm-"]');selectors.each(function(){var $this=$(this);var text=$this.data('text');var href=$this.data('href');var className='';var socialNetwork=$this.prop('classList');$.each(socialNetwork,function(key,value){if(value.startsWith('js-confirm-')){className=value}});if(Cookies.get(className)){$this.attr('href',href)}else{$this.bind('click',function(event){if(Cookies.get(className)){$this.attr('href',href)}
if(!Cookies.get(className)){event.stopImmediatePropagation();event.preventDefault();event.stopPropagation();var confirmed=confirm(text);if(confirmed){Cookies.set(className,1);$this.attr('href',href)}}
return!1})}});$('.js-small-popup').on('click',function(e){e.preventDefault();var $link=$(this);var href=$link.attr('href');var options='menubar=no,toolbar=no,resizable=yes,scrollbars=yes,';window.open(href,'',options+'height=600,width=600')});$('.js-header').csHeader();$('.js-scroll-to-top').csToTopButton();$('.js-global-wrapper').csCalendar();$('.js-global-wrapper').csSidebar();$('.js-global-wrapper').csGlobalNewsticker();$('.js-global-wrapper').csGlobalScripts();if(typeof Cookies!==undefined){if(Cookies.get('phoeniX')){let params=Cookies.get('phoeniX');let searchString='|items=';let begin=params.indexOf(searchString);let end=params.indexOf('|amount=');let num='';if(begin>0&&begin<end){num=params.substr((begin+searchString.length),(end-begin-searchString.length))}
if(num!==''){$('.cs-icon-shop').append('<span class="number">'+num+'</span>')}}}});Clickstorm={createIntersectionObserver:function(element,visible,once,notVisible){once=(typeof once!=='undefined')?once:!0;notVisible=(typeof notVisible!=='undefined')?notVisible:null;var elementObserver=new IntersectionObserver(function(entries){entries.forEach(function(entry){if(entry.isIntersecting){visible();if(once){elementObserver.disconnect()}}
if(notVisible!==null&&!entry.isIntersecting){notVisible()}})});elementObserver.observe(element);return!0},};function openCookieModal(externalMediaTypeToFocus){$csCookieBanner.openCookieModal();if(!$('#externalMedia_anchor').hasClass('cs-cookie__switch-label--open')){$('#externalMedia_anchor').trigger('click')}
if(externalMediaTypeToFocus){setTimeout(function(){$('.cs-cookie__checkbox .js-cookie-inner-checkbox[for="'+externalMediaTypeToFocus+'"]').focus()},200)}}
function decryptCharcode(n,start,end,offset){n=n+offset;if(offset>0&&n>end){n=start+(n-end-1)}else if(offset<0&&n<start){n=end-(start-n-1)}
return String.fromCharCode(n)}
function decryptString(enc,offset){var dec="";var len=enc.length;for(var i=0;i<len;i++){var n=enc.charCodeAt(i);if(n>=0x2B&&n<=0x3A){dec+=decryptCharcode(n,0x2B,0x3A,offset)}else if(n>=0x40&&n<=0x5A){dec+=decryptCharcode(n,0x40,0x5A,offset)}else if(n>=0x61&&n<=0x7A){dec+=decryptCharcode(n,0x61,0x7A,offset)}else{dec+=enc.charAt(i)}}
return dec}
function linkTo_UnCryptMailto(s){location.href=decryptString(s,-2)}
/*!***************************************************
* mark.js v8.11.1
* https://markjs.io/
* Copyright (c) 2014–2018, Julian Kühnel
* Released under the MIT license https://git.io/vwTVl
*****************************************************/
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('jquery')):typeof define==='function'&&define.amd?define(['jquery'],factory):(global.Mark=factory(global.jQuery))}(this,(function($){'use strict';$=$&&$.hasOwnProperty('default')?$['default']:$;var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj};var classCallCheck=function(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}};var createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1;descriptor.configurable=!0;if("value" in descriptor)descriptor.writable=!0;Object.defineProperty(target,descriptor.key,descriptor)}}
return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor}}();var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}
return target};var DOMIterator=function(){function DOMIterator(ctx){var iframes=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var exclude=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];var iframesTimeout=arguments.length>3&&arguments[3]!==undefined?arguments[3]:5000;classCallCheck(this,DOMIterator);this.ctx=ctx;this.iframes=iframes;this.exclude=exclude;this.iframesTimeout=iframesTimeout}
createClass(DOMIterator,[{key:'getContexts',value:function getContexts(){var ctx=void 0,filteredCtx=[];if(typeof this.ctx==='undefined'||!this.ctx){ctx=[]}else if(NodeList.prototype.isPrototypeOf(this.ctx)){ctx=Array.prototype.slice.call(this.ctx)}else if(Array.isArray(this.ctx)){ctx=this.ctx}else if(typeof this.ctx==='string'){ctx=Array.prototype.slice.call(document.querySelectorAll(this.ctx))}else{ctx=[this.ctx]}
ctx.forEach(function(ctx){var isDescendant=filteredCtx.filter(function(contexts){return contexts.contains(ctx)}).length>0;if(filteredCtx.indexOf(ctx)===-1&&!isDescendant){filteredCtx.push(ctx)}});return filteredCtx}},{key:'getIframeContents',value:function getIframeContents(ifr,successFn){var errorFn=arguments.length>2&&arguments[2]!==undefined?arguments[2]:function(){};var doc=void 0;try{var ifrWin=ifr.contentWindow;doc=ifrWin.document;if(!ifrWin||!doc){throw new Error('iframe inaccessible')}}catch(e){errorFn()}
if(doc){successFn(doc)}}},{key:'isIframeBlank',value:function isIframeBlank(ifr){var bl='about:blank',src=ifr.getAttribute('src').trim(),href=ifr.contentWindow.location.href;return href===bl&&src!==bl&&src}},{key:'observeIframeLoad',value:function observeIframeLoad(ifr,successFn,errorFn){var _this=this;var called=!1,tout=null;var listener=function listener(){if(called){return}
called=!0;clearTimeout(tout);try{if(!_this.isIframeBlank(ifr)){ifr.removeEventListener('load',listener);_this.getIframeContents(ifr,successFn,errorFn)}}catch(e){errorFn()}};ifr.addEventListener('load',listener);tout=setTimeout(listener,this.iframesTimeout)}},{key:'onIframeReady',value:function onIframeReady(ifr,successFn,errorFn){try{if(ifr.contentWindow.document.readyState==='complete'){if(this.isIframeBlank(ifr)){this.observeIframeLoad(ifr,successFn,errorFn)}else{this.getIframeContents(ifr,successFn,errorFn)}}else{this.observeIframeLoad(ifr,successFn,errorFn)}}catch(e){errorFn()}}},{key:'waitForIframes',value:function waitForIframes(ctx,done){var _this2=this;var eachCalled=0;this.forEachIframe(ctx,function(){return!0},function(ifr){eachCalled++;_this2.waitForIframes(ifr.querySelector('html'),function(){if(!--eachCalled){done()}})},function(handled){if(!handled){done()}})}},{key:'forEachIframe',value:function forEachIframe(ctx,filter,each){var _this3=this;var end=arguments.length>3&&arguments[3]!==undefined?arguments[3]:function(){};var ifr=ctx.querySelectorAll('iframe'),open=ifr.length,handled=0;ifr=Array.prototype.slice.call(ifr);var checkEnd=function checkEnd(){if(--open<=0){end(handled)}};if(!open){checkEnd()}
ifr.forEach(function(ifr){if(DOMIterator.matches(ifr,_this3.exclude)){checkEnd()}else{_this3.onIframeReady(ifr,function(con){if(filter(ifr)){handled++;each(con)}
checkEnd()},checkEnd)}})}},{key:'createIterator',value:function createIterator(ctx,whatToShow,filter){return document.createNodeIterator(ctx,whatToShow,filter,!1)}},{key:'createInstanceOnIframe',value:function createInstanceOnIframe(contents){return new DOMIterator(contents.querySelector('html'),this.iframes)}},{key:'compareNodeIframe',value:function compareNodeIframe(node,prevNode,ifr){var compCurr=node.compareDocumentPosition(ifr),prev=Node.DOCUMENT_POSITION_PRECEDING;if(compCurr&prev){if(prevNode!==null){var compPrev=prevNode.compareDocumentPosition(ifr),after=Node.DOCUMENT_POSITION_FOLLOWING;if(compPrev&after){return!0}}else{return!0}}
return!1}},{key:'getIteratorNode',value:function getIteratorNode(itr){var prevNode=itr.previousNode();var node=void 0;if(prevNode===null){node=itr.nextNode()}else{node=itr.nextNode()&&itr.nextNode()}
return{prevNode:prevNode,node:node}}},{key:'checkIframeFilter',value:function checkIframeFilter(node,prevNode,currIfr,ifr){var key=!1,handled=!1;ifr.forEach(function(ifrDict,i){if(ifrDict.val===currIfr){key=i;handled=ifrDict.handled}});if(this.compareNodeIframe(node,prevNode,currIfr)){if(key===!1&&!handled){ifr.push({val:currIfr,handled:!0})}else if(key!==!1&&!handled){ifr[key].handled=!0}
return!0}
if(key===!1){ifr.push({val:currIfr,handled:!1})}
return!1}},{key:'handleOpenIframes',value:function handleOpenIframes(ifr,whatToShow,eCb,fCb){var _this4=this;ifr.forEach(function(ifrDict){if(!ifrDict.handled){_this4.getIframeContents(ifrDict.val,function(con){_this4.createInstanceOnIframe(con).forEachNode(whatToShow,eCb,fCb)})}})}},{key:'iterateThroughNodes',value:function iterateThroughNodes(whatToShow,ctx,eachCb,filterCb,doneCb){var _this5=this;var itr=this.createIterator(ctx,whatToShow,filterCb);var ifr=[],elements=[],node=void 0,prevNode=void 0,retrieveNodes=function retrieveNodes(){var _getIteratorNode=_this5.getIteratorNode(itr);prevNode=_getIteratorNode.prevNode;node=_getIteratorNode.node;return node};while(retrieveNodes()){if(this.iframes){this.forEachIframe(ctx,function(currIfr){return _this5.checkIframeFilter(node,prevNode,currIfr,ifr)},function(con){_this5.createInstanceOnIframe(con).forEachNode(whatToShow,function(ifrNode){return elements.push(ifrNode)},filterCb)})}
elements.push(node)}
elements.forEach(function(node){eachCb(node)});if(this.iframes){this.handleOpenIframes(ifr,whatToShow,eachCb,filterCb)}
doneCb()}},{key:'forEachNode',value:function forEachNode(whatToShow,each,filter){var _this6=this;var done=arguments.length>3&&arguments[3]!==undefined?arguments[3]:function(){};var contexts=this.getContexts();var open=contexts.length;if(!open){done()}
contexts.forEach(function(ctx){var ready=function ready(){_this6.iterateThroughNodes(whatToShow,ctx,each,filter,function(){if(--open<=0){done()}})};if(_this6.iframes){_this6.waitForIframes(ctx,ready)}else{ready()}})}}],[{key:'matches',value:function matches(element,selector){var selectors=typeof selector==='string'?[selector]:selector,fn=element.matches||element.matchesSelector||element.msMatchesSelector||element.mozMatchesSelector||element.oMatchesSelector||element.webkitMatchesSelector;if(fn){var match=!1;selectors.every(function(sel){if(fn.call(element,sel)){match=!0;return!1}
return!0});return match}else{return!1}}}]);return DOMIterator}();var Mark=function(){function Mark(ctx){classCallCheck(this,Mark);this.ctx=ctx;this.ie=!1;var ua=window.navigator.userAgent;if(ua.indexOf('MSIE')>-1||ua.indexOf('Trident')>-1){this.ie=!0}}
createClass(Mark,[{key:'log',value:function log(msg){var level=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'debug';var log=this.opt.log;if(!this.opt.debug){return}
if((typeof log==='undefined'?'undefined':_typeof(log))==='object'&&typeof log[level]==='function'){log[level]('mark.js: '+msg)}}},{key:'escapeStr',value:function escapeStr(str){return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,'\\$&')}},{key:'createRegExp',value:function createRegExp(str){if(this.opt.wildcards!=='disabled'){str=this.setupWildcardsRegExp(str)}
str=this.escapeStr(str);if(Object.keys(this.opt.synonyms).length){str=this.createSynonymsRegExp(str)}
if(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length){str=this.setupIgnoreJoinersRegExp(str)}
if(this.opt.diacritics){str=this.createDiacriticsRegExp(str)}
str=this.createMergedBlanksRegExp(str);if(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length){str=this.createJoinersRegExp(str)}
if(this.opt.wildcards!=='disabled'){str=this.createWildcardsRegExp(str)}
str=this.createAccuracyRegExp(str);return str}},{key:'createSynonymsRegExp',value:function createSynonymsRegExp(str){var syn=this.opt.synonyms,sens=this.opt.caseSensitive?'':'i',joinerPlaceholder=this.opt.ignoreJoiners||this.opt.ignorePunctuation.length?'\0':'';for(var index in syn){if(syn.hasOwnProperty(index)){var value=syn[index],k1=this.opt.wildcards!=='disabled'?this.setupWildcardsRegExp(index):this.escapeStr(index),k2=this.opt.wildcards!=='disabled'?this.setupWildcardsRegExp(value):this.escapeStr(value);if(k1!==''&&k2!==''){str=str.replace(new RegExp('('+this.escapeStr(k1)+'|'+this.escapeStr(k2)+')','gm'+sens),joinerPlaceholder+('('+this.processSynomyms(k1)+'|')+(this.processSynomyms(k2)+')')+joinerPlaceholder)}}}
return str}},{key:'processSynomyms',value:function processSynomyms(str){if(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length){str=this.setupIgnoreJoinersRegExp(str)}
return str}},{key:'setupWildcardsRegExp',value:function setupWildcardsRegExp(str){str=str.replace(/(?:\\)*\?/g,function(val){return val.charAt(0)==='\\'?'?':'\x01'});return str.replace(/(?:\\)*\*/g,function(val){return val.charAt(0)==='\\'?'*':'\x02'})}},{key:'createWildcardsRegExp',value:function createWildcardsRegExp(str){var spaces=this.opt.wildcards==='withSpaces';return str.replace(/\u0001/g,spaces?'[\\S\\s]?':'\\S?').replace(/\u0002/g,spaces?'[\\S\\s]*?':'\\S*')}},{key:'setupIgnoreJoinersRegExp',value:function setupIgnoreJoinersRegExp(str){return str.replace(/[^(|)\\]/g,function(val,indx,original){var nextChar=original.charAt(indx+1);if(/[(|)\\]/.test(nextChar)||nextChar===''){return val}else{return val+'\0'}})}},{key:'createJoinersRegExp',value:function createJoinersRegExp(str){var joiner=[];var ignorePunctuation=this.opt.ignorePunctuation;if(Array.isArray(ignorePunctuation)&&ignorePunctuation.length){joiner.push(this.escapeStr(ignorePunctuation.join('')))}
if(this.opt.ignoreJoiners){joiner.push('\\u00ad\\u200b\\u200c\\u200d')}
return joiner.length?str.split(/\u0000+/).join('['+joiner.join('')+']*'):str}},{key:'createDiacriticsRegExp',value:function createDiacriticsRegExp(str){var sens=this.opt.caseSensitive?'':'i',dct=this.opt.caseSensitive?['aàáảãạăằắẳẵặâầấẩẫậäåāą','AÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ','cçćč','CÇĆČ','dđď','DĐĎ','eèéẻẽẹêềếểễệëěēę','EÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ','iìíỉĩịîïī','IÌÍỈĨỊÎÏĪ','lł','LŁ','nñňń','NÑŇŃ','oòóỏõọôồốổỗộơởỡớờợöøō','OÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ','rř','RŘ','sšśșş','SŠŚȘŞ','tťțţ','TŤȚŢ','uùúủũụưừứửữựûüůū','UÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ','yýỳỷỹỵÿ','YÝỲỶỸỴŸ','zžżź','ZŽŻŹ']:['aàáảãạăằắẳẵặâầấẩẫậäåāąAÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ','cçćčCÇĆČ','dđďDĐĎ','eèéẻẽẹêềếểễệëěēęEÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ','iìíỉĩịîïīIÌÍỈĨỊÎÏĪ','lłLŁ','nñňńNÑŇŃ','oòóỏõọôồốổỗộơởỡớờợöøōOÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ','rřRŘ','sšśșşSŠŚȘŞ','tťțţTŤȚŢ','uùúủũụưừứửữựûüůūUÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ','yýỳỷỹỵÿYÝỲỶỸỴŸ','zžżźZŽŻŹ'];var handled=[];str.split('').forEach(function(ch){dct.every(function(dct){if(dct.indexOf(ch)!==-1){if(handled.indexOf(dct)>-1){return!1}
str=str.replace(new RegExp('['+dct+']','gm'+sens),'['+dct+']');handled.push(dct)}
return!0})});return str}},{key:'createMergedBlanksRegExp',value:function createMergedBlanksRegExp(str){return str.replace(/[\s]+/gmi,'[\\s]+')}},{key:'createAccuracyRegExp',value:function createAccuracyRegExp(str){var _this=this;var chars='!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~¡¿';var acc=this.opt.accuracy,val=typeof acc==='string'?acc:acc.value,ls=typeof acc==='string'?[]:acc.limiters,lsJoin='';ls.forEach(function(limiter){lsJoin+='|'+_this.escapeStr(limiter)});switch(val){case 'partially':default:return'()('+str+')';case 'complementary':lsJoin='\\s'+(lsJoin?lsJoin:this.escapeStr(chars));return'()([^'+lsJoin+']*'+str+'[^'+lsJoin+']*)';case 'exactly':return'(^|\\s'+lsJoin+')('+str+')(?=$|\\s'+lsJoin+')'}}},{key:'getSeparatedKeywords',value:function getSeparatedKeywords(sv){var _this2=this;var stack=[];sv.forEach(function(kw){if(!_this2.opt.separateWordSearch){if(kw.trim()&&stack.indexOf(kw)===-1){stack.push(kw)}}else{kw.split(' ').forEach(function(kwSplitted){if(kwSplitted.trim()&&stack.indexOf(kwSplitted)===-1){stack.push(kwSplitted)}})}});return{'keywords':stack.sort(function(a,b){return b.length-a.length}),'length':stack.length}}},{key:'isNumeric',value:function isNumeric(value){return Number(parseFloat(value))==value}},{key:'checkRanges',value:function checkRanges(array){var _this3=this;if(!Array.isArray(array)||Object.prototype.toString.call(array[0])!=='[object Object]'){this.log('markRanges() will only accept an array of objects');this.opt.noMatch(array);return[]}
var stack=[];var last=0;array.sort(function(a,b){return a.start-b.start}).forEach(function(item){var _callNoMatchOnInvalid=_this3.callNoMatchOnInvalidRanges(item,last),start=_callNoMatchOnInvalid.start,end=_callNoMatchOnInvalid.end,valid=_callNoMatchOnInvalid.valid;if(valid){item.start=start;item.length=end-start;stack.push(item);last=end}});return stack}},{key:'callNoMatchOnInvalidRanges',value:function callNoMatchOnInvalidRanges(range,last){var start=void 0,end=void 0,valid=!1;if(range&&typeof range.start!=='undefined'){start=parseInt(range.start,10);end=start+parseInt(range.length,10);if(this.isNumeric(range.start)&&this.isNumeric(range.length)&&end-last>0&&end-start>0){valid=!0}else{this.log('Ignoring invalid or overlapping range: '+(''+JSON.stringify(range)));this.opt.noMatch(range)}}else{this.log('Ignoring invalid range: '+JSON.stringify(range));this.opt.noMatch(range)}
return{start:start,end:end,valid:valid}}},{key:'checkWhitespaceRanges',value:function checkWhitespaceRanges(range,originalLength,string){var end=void 0,valid=!0,max=string.length,offset=originalLength-max,start=parseInt(range.start,10)-offset;start=start>max?max:start;end=start+parseInt(range.length,10);if(end>max){end=max;this.log('End range automatically set to the max value of '+max)}
if(start<0||end-start<0||start>max||end>max){valid=!1;this.log('Invalid range: '+JSON.stringify(range));this.opt.noMatch(range)}else if(string.substring(start,end).replace(/\s+/g,'')===''){valid=!1;this.log('Skipping whitespace only range: '+JSON.stringify(range));this.opt.noMatch(range)}
return{start:start,end:end,valid:valid}}},{key:'getTextNodes',value:function getTextNodes(cb){var _this4=this;var val='',nodes=[];this.iterator.forEachNode(NodeFilter.SHOW_TEXT,function(node){nodes.push({start:val.length,end:(val+=node.textContent).length,node:node})},function(node){if(_this4.matchesExclude(node.parentNode)){return NodeFilter.FILTER_REJECT}else{return NodeFilter.FILTER_ACCEPT}},function(){cb({value:val,nodes:nodes})})}},{key:'matchesExclude',value:function matchesExclude(el){return DOMIterator.matches(el,this.opt.exclude.concat(['script','style','title','head','html']))}},{key:'wrapRangeInTextNode',value:function wrapRangeInTextNode(node,start,end){var hEl=!this.opt.element?'mark':this.opt.element,startNode=node.splitText(start),ret=startNode.splitText(end-start);var repl=document.createElement(hEl);repl.setAttribute('data-markjs','true');if(this.opt.className){repl.setAttribute('class',this.opt.className)}
repl.textContent=startNode.textContent;startNode.parentNode.replaceChild(repl,startNode);return ret}},{key:'wrapRangeInMappedTextNode',value:function wrapRangeInMappedTextNode(dict,start,end,filterCb,eachCb){var _this5=this;dict.nodes.every(function(n,i){var sibl=dict.nodes[i+1];if(typeof sibl==='undefined'||sibl.start>start){if(!filterCb(n.node)){return!1}
var s=start-n.start,e=(end>n.end?n.end:end)-n.start,startStr=dict.value.substr(0,n.start),endStr=dict.value.substr(e+n.start);n.node=_this5.wrapRangeInTextNode(n.node,s,e);dict.value=startStr+endStr;dict.nodes.forEach(function(k,j){if(j>=i){if(dict.nodes[j].start>0&&j!==i){dict.nodes[j].start-=e}
dict.nodes[j].end-=e}});end-=e;eachCb(n.node.previousSibling,n.start);if(end>n.end){start=n.end}else{return!1}}
return!0})}},{key:'wrapMatches',value:function wrapMatches(regex,ignoreGroups,filterCb,eachCb,endCb){var _this6=this;var matchIdx=ignoreGroups===0?0:ignoreGroups+1;this.getTextNodes(function(dict){dict.nodes.forEach(function(node){node=node.node;var match=void 0;while((match=regex.exec(node.textContent))!==null&&match[matchIdx]!==''){if(!filterCb(match[matchIdx],node)){continue}
var pos=match.index;if(matchIdx!==0){for(var i=1;i<matchIdx;i++){pos+=match[i].length}}
node=_this6.wrapRangeInTextNode(node,pos,pos+match[matchIdx].length);eachCb(node.previousSibling);regex.lastIndex=0}});endCb()})}},{key:'wrapMatchesAcrossElements',value:function wrapMatchesAcrossElements(regex,ignoreGroups,filterCb,eachCb,endCb){var _this7=this;var matchIdx=ignoreGroups===0?0:ignoreGroups+1;this.getTextNodes(function(dict){var match=void 0;while((match=regex.exec(dict.value))!==null&&match[matchIdx]!==''){var start=match.index;if(matchIdx!==0){for(var i=1;i<matchIdx;i++){start+=match[i].length}}
var end=start+match[matchIdx].length;_this7.wrapRangeInMappedTextNode(dict,start,end,function(node){return filterCb(match[matchIdx],node)},function(node,lastIndex){regex.lastIndex=lastIndex;eachCb(node)})}
endCb()})}},{key:'wrapRangeFromIndex',value:function wrapRangeFromIndex(ranges,filterCb,eachCb,endCb){var _this8=this;this.getTextNodes(function(dict){var originalLength=dict.value.length;ranges.forEach(function(range,counter){var _checkWhitespaceRange=_this8.checkWhitespaceRanges(range,originalLength,dict.value),start=_checkWhitespaceRange.start,end=_checkWhitespaceRange.end,valid=_checkWhitespaceRange.valid;if(valid){_this8.wrapRangeInMappedTextNode(dict,start,end,function(node){return filterCb(node,range,dict.value.substring(start,end),counter)},function(node){eachCb(node,range)})}});endCb()})}},{key:'unwrapMatches',value:function unwrapMatches(node){var parent=node.parentNode;var docFrag=document.createDocumentFragment();while(node.firstChild){docFrag.appendChild(node.removeChild(node.firstChild))}
parent.replaceChild(docFrag,node);if(!this.ie){parent.normalize()}else{this.normalizeTextNode(parent)}}},{key:'normalizeTextNode',value:function normalizeTextNode(node){if(!node){return}
if(node.nodeType===3){while(node.nextSibling&&node.nextSibling.nodeType===3){node.nodeValue+=node.nextSibling.nodeValue;node.parentNode.removeChild(node.nextSibling)}}else{this.normalizeTextNode(node.firstChild)}
this.normalizeTextNode(node.nextSibling)}},{key:'markRegExp',value:function markRegExp(regexp,opt){var _this9=this;this.opt=opt;this.log('Searching with expression "'+regexp+'"');var totalMatches=0,fn='wrapMatches';var eachCb=function eachCb(element){totalMatches++;_this9.opt.each(element)};if(this.opt.acrossElements){fn='wrapMatchesAcrossElements'}
this[fn](regexp,this.opt.ignoreGroups,function(match,node){return _this9.opt.filter(node,match,totalMatches)},eachCb,function(){if(totalMatches===0){_this9.opt.noMatch(regexp)}
_this9.opt.done(totalMatches)})}},{key:'mark',value:function mark(sv,opt){var _this10=this;this.opt=opt;var totalMatches=0,fn='wrapMatches';var _getSeparatedKeywords=this.getSeparatedKeywords(typeof sv==='string'?[sv]:sv),kwArr=_getSeparatedKeywords.keywords,kwArrLen=_getSeparatedKeywords.length,sens=this.opt.caseSensitive?'':'i',handler=function handler(kw){var regex=new RegExp(_this10.createRegExp(kw),'gm'+sens),matches=0;_this10.log('Searching with expression "'+regex+'"');_this10[fn](regex,1,function(term,node){return _this10.opt.filter(node,kw,totalMatches,matches)},function(element){matches++;totalMatches++;_this10.opt.each(element)},function(){if(matches===0){_this10.opt.noMatch(kw)}
if(kwArr[kwArrLen-1]===kw){_this10.opt.done(totalMatches)}else{handler(kwArr[kwArr.indexOf(kw)+1])}})};if(this.opt.acrossElements){fn='wrapMatchesAcrossElements'}
if(kwArrLen===0){this.opt.done(totalMatches)}else{handler(kwArr[0])}}},{key:'markRanges',value:function markRanges(rawRanges,opt){var _this11=this;this.opt=opt;var totalMatches=0,ranges=this.checkRanges(rawRanges);if(ranges&&ranges.length){this.log('Starting to mark with the following ranges: '+JSON.stringify(ranges));this.wrapRangeFromIndex(ranges,function(node,range,match,counter){return _this11.opt.filter(node,range,match,counter)},function(element,range){totalMatches++;_this11.opt.each(element,range)},function(){_this11.opt.done(totalMatches)})}else{this.opt.done(totalMatches)}}},{key:'unmark',value:function unmark(opt){var _this12=this;this.opt=opt;var sel=this.opt.element?this.opt.element:'*';sel+='[data-markjs]';if(this.opt.className){sel+='.'+this.opt.className}
this.log('Removal selector "'+sel+'"');this.iterator.forEachNode(NodeFilter.SHOW_ELEMENT,function(node){_this12.unwrapMatches(node)},function(node){var matchesSel=DOMIterator.matches(node,sel),matchesExclude=_this12.matchesExclude(node);if(!matchesSel||matchesExclude){return NodeFilter.FILTER_REJECT}else{return NodeFilter.FILTER_ACCEPT}},this.opt.done)}},{key:'opt',set:function set$$1(val){this._opt=_extends({},{'element':'','className':'','exclude':[],'iframes':!1,'iframesTimeout':5000,'separateWordSearch':!0,'diacritics':!0,'synonyms':{},'accuracy':'partially','acrossElements':!1,'caseSensitive':!1,'ignoreJoiners':!1,'ignoreGroups':0,'ignorePunctuation':[],'wildcards':'disabled','each':function each(){},'noMatch':function noMatch(){},'filter':function filter(){return!0},'done':function done(){},'debug':!1,'log':window.console},val)},get:function get$$1(){return this._opt}},{key:'iterator',get:function get$$1(){return new DOMIterator(this.ctx,this.opt.iframes,this.opt.exclude,this.opt.iframesTimeout)}}]);return Mark}();$.fn.mark=function(sv,opt){new Mark(this.get()).mark(sv,opt);return this};$.fn.markRegExp=function(regexp,opt){new Mark(this.get()).markRegExp(regexp,opt);return this};$.fn.markRanges=function(ranges,opt){new Mark(this.get()).markRanges(ranges,opt);return this};$.fn.unmark=function(opt){new Mark(this.get()).unmark(opt);return this};return $})));
/*!
 * typeahead.js 0.11.1
 * https://github.com/twitter/typeahead.js
 * Copyright 2013-2015 Twitter, Inc. and other contributors; Licensed MIT
 */
!function(a,b){"function"==typeof define&&define.amd?define("bloodhound",["jquery"],function(c){return a.Bloodhound=b(c)}):"object"==typeof exports?module.exports=b(require("jquery")):a.Bloodhound=b(jQuery)}(this,function(a){var b=function(){"use strict";return{isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:!1},isBlankString:function(a){return!a||/^\s*$/.test(a)},escapeRegExChars:function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(a){return"string"==typeof a},isNumber:function(a){return"number"==typeof a},isArray:a.isArray,isFunction:a.isFunction,isObject:a.isPlainObject,isUndefined:function(a){return"undefined"==typeof a},isElement:function(a){return!(!a||1!==a.nodeType)},isJQuery:function(b){return b instanceof a},toStr:function(a){return b.isUndefined(a)||null===a?"":a+""},bind:a.proxy,each:function(b,c){function d(a,b){return c(b,a)}a.each(b,d)},map:a.map,filter:a.grep,every:function(b,c){var d=!0;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?void 0:!1}),!!d):d},some:function(b,c){var d=!1;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?!1:void 0}),!!d):d},mixin:a.extend,identity:function(a){return a},clone:function(b){return a.extend(!0,{},b)},getIdGenerator:function(){var a=0;return function(){return a++}},templatify:function(b){function c(){return String(b)}return a.isFunction(b)?b:c},defer:function(a){setTimeout(a,0)},debounce:function(a,b,c){var d,e;return function(){var f,g,h=this,i=arguments;return f=function(){d=null,c||(e=a.apply(h,i))},g=c&&!d,clearTimeout(d),d=setTimeout(f,b),g&&(e=a.apply(h,i)),e}},throttle:function(a,b){var c,d,e,f,g,h;return g=0,h=function(){g=new Date,e=null,f=a.apply(c,d)},function(){var i=new Date,j=b-(i-g);return c=this,d=arguments,0>=j?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},stringify:function(a){return b.isString(a)?a:JSON.stringify(a)},noop:function(){}}}(),c="0.11.1",d=function(){"use strict";function a(a){return a=b.toStr(a),a?a.split(/\s+/):[]}function c(a){return a=b.toStr(a),a?a.split(/\W+/):[]}function d(a){return function(c){return c=b.isArray(c)?c:[].slice.call(arguments,0),function(d){var e=[];return b.each(c,function(c){e=e.concat(a(b.toStr(d[c])))}),e}}}return{nonword:c,whitespace:a,obj:{nonword:d(c),whitespace:d(a)}}}(),e=function(){"use strict";function c(c){this.maxSize=b.isNumber(c)?c:100,this.reset(),this.maxSize<=0&&(this.set=this.get=a.noop)}function d(){this.head=this.tail=null}function e(a,b){this.key=a,this.val=b,this.prev=this.next=null}return b.mixin(c.prototype,{set:function(a,b){var c,d=this.list.tail;this.size>=this.maxSize&&(this.list.remove(d),delete this.hash[d.key],this.size--),(c=this.hash[a])?(c.val=b,this.list.moveToFront(c)):(c=new e(a,b),this.list.add(c),this.hash[a]=c,this.size++)},get:function(a){var b=this.hash[a];return b?(this.list.moveToFront(b),b.val):void 0},reset:function(){this.size=0,this.hash={},this.list=new d}}),b.mixin(d.prototype,{add:function(a){this.head&&(a.next=this.head,this.head.prev=a),this.head=a,this.tail=this.tail||a},remove:function(a){a.prev?a.prev.next=a.next:this.head=a.next,a.next?a.next.prev=a.prev:this.tail=a.prev},moveToFront:function(a){this.remove(a),this.add(a)}}),c}(),f=function(){"use strict";function c(a,c){this.prefix=["__",a,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+b.escapeRegExChars(this.prefix)),this.ls=c||h,!this.ls&&this._noop()}function d(){return(new Date).getTime()}function e(a){return JSON.stringify(b.isUndefined(a)?null:a)}function f(b){return a.parseJSON(b)}function g(a){var b,c,d=[],e=h.length;for(b=0;e>b;b++)(c=h.key(b)).match(a)&&d.push(c.replace(a,""));return d}var h;try{h=window.localStorage,h.setItem("~~~","!"),h.removeItem("~~~")}catch(i){h=null}return b.mixin(c.prototype,{_prefix:function(a){return this.prefix+a},_ttlKey:function(a){return this._prefix(a)+this.ttlKey},_noop:function(){this.get=this.set=this.remove=this.clear=this.isExpired=b.noop},_safeSet:function(a,b){try{this.ls.setItem(a,b)}catch(c){"QuotaExceededError"===c.name&&(this.clear(),this._noop())}},get:function(a){return this.isExpired(a)&&this.remove(a),f(this.ls.getItem(this._prefix(a)))},set:function(a,c,f){return b.isNumber(f)?this._safeSet(this._ttlKey(a),e(d()+f)):this.ls.removeItem(this._ttlKey(a)),this._safeSet(this._prefix(a),e(c))},remove:function(a){return this.ls.removeItem(this._ttlKey(a)),this.ls.removeItem(this._prefix(a)),this},clear:function(){var a,b=g(this.keyMatcher);for(a=b.length;a--;)this.remove(b[a]);return this},isExpired:function(a){var c=f(this.ls.getItem(this._ttlKey(a)));return b.isNumber(c)&&d()>c?!0:!1}}),c}(),g=function(){"use strict";function c(a){a=a||{},this.cancelled=!1,this.lastReq=null,this._send=a.transport,this._get=a.limiter?a.limiter(this._get):this._get,this._cache=a.cache===!1?new e(0):h}var d=0,f={},g=6,h=new e(10);return c.setMaxPendingRequests=function(a){g=a},c.resetCache=function(){h.reset()},b.mixin(c.prototype,{_fingerprint:function(b){return b=b||{},b.url+b.type+a.param(b.data||{})},_get:function(a,b){function c(a){b(null,a),k._cache.set(i,a)}function e(){b(!0)}function h(){d--,delete f[i],k.onDeckRequestArgs&&(k._get.apply(k,k.onDeckRequestArgs),k.onDeckRequestArgs=null)}var i,j,k=this;i=this._fingerprint(a),this.cancelled||i!==this.lastReq||((j=f[i])?j.done(c).fail(e):g>d?(d++,f[i]=this._send(a).done(c).fail(e).always(h)):this.onDeckRequestArgs=[].slice.call(arguments,0))},get:function(c,d){var e,f;d=d||a.noop,c=b.isString(c)?{url:c}:c||{},f=this._fingerprint(c),this.cancelled=!1,this.lastReq=f,(e=this._cache.get(f))?d(null,e):this._get(c,d)},cancel:function(){this.cancelled=!0}}),c}(),h=window.SearchIndex=function(){"use strict";function c(c){c=c||{},c.datumTokenizer&&c.queryTokenizer||a.error("datumTokenizer and queryTokenizer are both required"),this.identify=c.identify||b.stringify,this.datumTokenizer=c.datumTokenizer,this.queryTokenizer=c.queryTokenizer,this.reset()}function d(a){return a=b.filter(a,function(a){return!!a}),a=b.map(a,function(a){return a.toLowerCase()})}function e(){var a={};return a[i]=[],a[h]={},a}function f(a){for(var b={},c=[],d=0,e=a.length;e>d;d++)b[a[d]]||(b[a[d]]=!0,c.push(a[d]));return c}function g(a,b){var c=0,d=0,e=[];a=a.sort(),b=b.sort();for(var f=a.length,g=b.length;f>c&&g>d;)a[c]<b[d]?c++:a[c]>b[d]?d++:(e.push(a[c]),c++,d++);return e}var h="c",i="i";return b.mixin(c.prototype,{bootstrap:function(a){this.datums=a.datums,this.trie=a.trie},add:function(a){var c=this;a=b.isArray(a)?a:[a],b.each(a,function(a){var f,g;c.datums[f=c.identify(a)]=a,g=d(c.datumTokenizer(a)),b.each(g,function(a){var b,d,g;for(b=c.trie,d=a.split("");g=d.shift();)b=b[h][g]||(b[h][g]=e()),b[i].push(f)})})},get:function(a){var c=this;return b.map(a,function(a){return c.datums[a]})},search:function(a){var c,e,j=this;return c=d(this.queryTokenizer(a)),b.each(c,function(a){var b,c,d,f;if(e&&0===e.length)return!1;for(b=j.trie,c=a.split("");b&&(d=c.shift());)b=b[h][d];return b&&0===c.length?(f=b[i].slice(0),void(e=e?g(e,f):f)):(e=[],!1)}),e?b.map(f(e),function(a){return j.datums[a]}):[]},all:function(){var a=[];for(var b in this.datums)a.push(this.datums[b]);return a},reset:function(){this.datums={},this.trie=e()},serialize:function(){return{datums:this.datums,trie:this.trie}}}),c}(),i=function(){"use strict";function a(a){this.url=a.url,this.ttl=a.ttl,this.cache=a.cache,this.prepare=a.prepare,this.transform=a.transform,this.transport=a.transport,this.thumbprint=a.thumbprint,this.storage=new f(a.cacheKey)}var c;return c={data:"data",protocol:"protocol",thumbprint:"thumbprint"},b.mixin(a.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},store:function(a){this.cache&&(this.storage.set(c.data,a,this.ttl),this.storage.set(c.protocol,location.protocol,this.ttl),this.storage.set(c.thumbprint,this.thumbprint,this.ttl))},fromCache:function(){var a,b={};return this.cache?(b.data=this.storage.get(c.data),b.protocol=this.storage.get(c.protocol),b.thumbprint=this.storage.get(c.thumbprint),a=b.thumbprint!==this.thumbprint||b.protocol!==location.protocol,b.data&&!a?b.data:null):null},fromNetwork:function(a){function b(){a(!0)}function c(b){a(null,e.transform(b))}var d,e=this;a&&(d=this.prepare(this._settings()),this.transport(d).fail(b).done(c))},clear:function(){return this.storage.clear(),this}}),a}(),j=function(){"use strict";function a(a){this.url=a.url,this.prepare=a.prepare,this.transform=a.transform,this.transport=new g({cache:a.cache,limiter:a.limiter,transport:a.transport})}return b.mixin(a.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},get:function(a,b){function c(a,c){b(a?[]:e.transform(c))}var d,e=this;if(b)return a=a||"",d=this.prepare(a,this._settings()),this.transport.get(d,c)},cancelLastRequest:function(){this.transport.cancel()}}),a}(),k=function(){"use strict";function d(d){var e;return d?(e={url:null,ttl:864e5,cache:!0,cacheKey:null,thumbprint:"",prepare:b.identity,transform:b.identity,transport:null},d=b.isString(d)?{url:d}:d,d=b.mixin(e,d),!d.url&&a.error("prefetch requires url to be set"),d.transform=d.filter||d.transform,d.cacheKey=d.cacheKey||d.url,d.thumbprint=c+d.thumbprint,d.transport=d.transport?h(d.transport):a.ajax,d):null}function e(c){var d;if(c)return d={url:null,cache:!0,prepare:null,replace:null,wildcard:null,limiter:null,rateLimitBy:"debounce",rateLimitWait:300,transform:b.identity,transport:null},c=b.isString(c)?{url:c}:c,c=b.mixin(d,c),!c.url&&a.error("remote requires url to be set"),c.transform=c.filter||c.transform,c.prepare=f(c),c.limiter=g(c),c.transport=c.transport?h(c.transport):a.ajax,delete c.replace,delete c.wildcard,delete c.rateLimitBy,delete c.rateLimitWait,c}function f(a){function b(a,b){return b.url=f(b.url,a),b}function c(a,b){return b.url=b.url.replace(g,encodeURIComponent(a)),b}function d(a,b){return b}var e,f,g;return e=a.prepare,f=a.replace,g=a.wildcard,e?e:e=f?b:a.wildcard?c:d}function g(a){function c(a){return function(c){return b.debounce(c,a)}}function d(a){return function(c){return b.throttle(c,a)}}var e,f,g;return e=a.limiter,f=a.rateLimitBy,g=a.rateLimitWait,e||(e=/^throttle$/i.test(f)?d(g):c(g)),e}function h(c){return function(d){function e(a){b.defer(function(){g.resolve(a)})}function f(a){b.defer(function(){g.reject(a)})}var g=a.Deferred();return c(d,e,f),g}}return function(c){var f,g;return f={initialize:!0,identify:b.stringify,datumTokenizer:null,queryTokenizer:null,sufficient:5,sorter:null,local:[],prefetch:null,remote:null},c=b.mixin(f,c||{}),!c.datumTokenizer&&a.error("datumTokenizer is required"),!c.queryTokenizer&&a.error("queryTokenizer is required"),g=c.sorter,c.sorter=g?function(a){return a.sort(g)}:b.identity,c.local=b.isFunction(c.local)?c.local():c.local,c.prefetch=d(c.prefetch),c.remote=e(c.remote),c}}(),l=function(){"use strict";function c(a){a=k(a),this.sorter=a.sorter,this.identify=a.identify,this.sufficient=a.sufficient,this.local=a.local,this.remote=a.remote?new j(a.remote):null,this.prefetch=a.prefetch?new i(a.prefetch):null,this.index=new h({identify:this.identify,datumTokenizer:a.datumTokenizer,queryTokenizer:a.queryTokenizer}),a.initialize!==!1&&this.initialize()}var e;return e=window&&window.Bloodhound,c.noConflict=function(){return window&&(window.Bloodhound=e),c},c.tokenizers=d,b.mixin(c.prototype,{__ttAdapter:function(){function a(a,b,d){return c.search(a,b,d)}function b(a,b){return c.search(a,b)}var c=this;return this.remote?a:b},_loadPrefetch:function(){function b(a,b){return a?c.reject():(e.add(b),e.prefetch.store(e.index.serialize()),void c.resolve())}var c,d,e=this;return c=a.Deferred(),this.prefetch?(d=this.prefetch.fromCache())?(this.index.bootstrap(d),c.resolve()):this.prefetch.fromNetwork(b):c.resolve(),c.promise()},_initialize:function(){function a(){b.add(b.local)}var b=this;return this.clear(),(this.initPromise=this._loadPrefetch()).done(a),this.initPromise},initialize:function(a){return!this.initPromise||a?this._initialize():this.initPromise},add:function(a){return this.index.add(a),this},get:function(a){return a=b.isArray(a)?a:[].slice.call(arguments),this.index.get(a)},search:function(a,c,d){function e(a){var c=[];b.each(a,function(a){!b.some(f,function(b){return g.identify(a)===g.identify(b)})&&c.push(a)}),d&&d(c)}var f,g=this;return f=this.sorter(this.index.search(a)),c(this.remote?f.slice():f),this.remote&&f.length<this.sufficient?this.remote.get(a,e):this.remote&&this.remote.cancelLastRequest(),this},all:function(){return this.index.all()},clear:function(){return this.index.reset(),this},clearPrefetchCache:function(){return this.prefetch&&this.prefetch.clear(),this},clearRemoteCache:function(){return g.resetCache(),this},ttAdapter:function(){return this.__ttAdapter()}}),c}();return l}),function(a,b){"function"==typeof define&&define.amd?define("typeahead.js",["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){var b=function(){"use strict";return{isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:!1},isBlankString:function(a){return!a||/^\s*$/.test(a)},escapeRegExChars:function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(a){return"string"==typeof a},isNumber:function(a){return"number"==typeof a},isArray:a.isArray,isFunction:a.isFunction,isObject:a.isPlainObject,isUndefined:function(a){return"undefined"==typeof a},isElement:function(a){return!(!a||1!==a.nodeType)},isJQuery:function(b){return b instanceof a},toStr:function(a){return b.isUndefined(a)||null===a?"":a+""},bind:a.proxy,each:function(b,c){function d(a,b){return c(b,a)}a.each(b,d)},map:a.map,filter:a.grep,every:function(b,c){var d=!0;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?void 0:!1}),!!d):d},some:function(b,c){var d=!1;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?!1:void 0}),!!d):d},mixin:a.extend,identity:function(a){return a},clone:function(b){return a.extend(!0,{},b)},getIdGenerator:function(){var a=0;return function(){return a++}},templatify:function(b){function c(){return String(b)}return a.isFunction(b)?b:c},defer:function(a){setTimeout(a,0)},debounce:function(a,b,c){var d,e;return function(){var f,g,h=this,i=arguments;return f=function(){d=null,c||(e=a.apply(h,i))},g=c&&!d,clearTimeout(d),d=setTimeout(f,b),g&&(e=a.apply(h,i)),e}},throttle:function(a,b){var c,d,e,f,g,h;return g=0,h=function(){g=new Date,e=null,f=a.apply(c,d)},function(){var i=new Date,j=b-(i-g);return c=this,d=arguments,0>=j?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},stringify:function(a){return b.isString(a)?a:JSON.stringify(a)},noop:function(){}}}(),c=function(){"use strict";function a(a){var g,h;return h=b.mixin({},f,a),g={css:e(),classes:h,html:c(h),selectors:d(h)},{css:g.css,html:g.html,classes:g.classes,selectors:g.selectors,mixin:function(a){b.mixin(a,g)}}}function c(a){return{wrapper:'<span class="'+a.wrapper+'"></span>',menu:'<div class="'+a.menu+'"></div>'}}function d(a){var c={};return b.each(a,function(a,b){c[b]="."+a}),c}function e(){var a={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},menu:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return b.isMsie()&&b.mixin(a.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),a}var f={wrapper:"twitter-typeahead",input:"tt-input",hint:"tt-hint",menu:"tt-menu",dataset:"tt-dataset",suggestion:"tt-suggestion",selectable:"tt-selectable",empty:"tt-empty",open:"tt-open",cursor:"tt-cursor",highlight:"tt-highlight"};return a}(),d=function(){"use strict";function c(b){b&&b.el||a.error("EventBus initialized without el"),this.$el=a(b.el)}var d,e;return d="typeahead:",e={render:"rendered",cursorchange:"cursorchanged",select:"selected",autocomplete:"autocompleted"},b.mixin(c.prototype,{_trigger:function(b,c){var e;return e=a.Event(d+b),(c=c||[]).unshift(e),this.$el.trigger.apply(this.$el,c),e},before:function(a){var b,c;return b=[].slice.call(arguments,1),c=this._trigger("before"+a,b),c.isDefaultPrevented()},trigger:function(a){var b;this._trigger(a,[].slice.call(arguments,1)),(b=e[a])&&this._trigger(b,[].slice.call(arguments,1))}}),c}(),e=function(){"use strict";function a(a,b,c,d){var e;if(!c)return this;for(b=b.split(i),c=d?h(c,d):c,this._callbacks=this._callbacks||{};e=b.shift();)this._callbacks[e]=this._callbacks[e]||{sync:[],async:[]},this._callbacks[e][a].push(c);return this}function b(b,c,d){return a.call(this,"async",b,c,d)}function c(b,c,d){return a.call(this,"sync",b,c,d)}function d(a){var b;if(!this._callbacks)return this;for(a=a.split(i);b=a.shift();)delete this._callbacks[b];return this}function e(a){var b,c,d,e,g;if(!this._callbacks)return this;for(a=a.split(i),d=[].slice.call(arguments,1);(b=a.shift())&&(c=this._callbacks[b]);)e=f(c.sync,this,[b].concat(d)),g=f(c.async,this,[b].concat(d)),e()&&j(g);return this}function f(a,b,c){function d(){for(var d,e=0,f=a.length;!d&&f>e;e+=1)d=a[e].apply(b,c)===!1;return!d}return d}function g(){var a;return a=window.setImmediate?function(a){setImmediate(function(){a()})}:function(a){setTimeout(function(){a()},0)}}function h(a,b){return a.bind?a.bind(b):function(){a.apply(b,[].slice.call(arguments,0))}}var i=/\s+/,j=g();return{onSync:c,onAsync:b,off:d,trigger:e}}(),f=function(a){"use strict";function c(a,c,d){for(var e,f=[],g=0,h=a.length;h>g;g++)f.push(b.escapeRegExChars(a[g]));return e=d?"\\b("+f.join("|")+")\\b":"("+f.join("|")+")",c?new RegExp(e):new RegExp(e,"i")}var d={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1};return function(e){function f(b){var c,d,f;return(c=h.exec(b.data))&&(f=a.createElement(e.tagName),e.className&&(f.className=e.className),d=b.splitText(c.index),d.splitText(c[0].length),f.appendChild(d.cloneNode(!0)),b.parentNode.replaceChild(f,d)),!!c}function g(a,b){for(var c,d=3,e=0;e<a.childNodes.length;e++)c=a.childNodes[e],c.nodeType===d?e+=b(c)?1:0:g(c,b)}var h;e=b.mixin({},d,e),e.node&&e.pattern&&(e.pattern=b.isArray(e.pattern)?e.pattern:[e.pattern],h=c(e.pattern,e.caseSensitive,e.wordsOnly),g(e.node,f))}}(window.document),g=function(){"use strict";function c(c,e){c=c||{},c.input||a.error("input is missing"),e.mixin(this),this.$hint=a(c.hint),this.$input=a(c.input),this.query=this.$input.val(),this.queryWhenFocused=this.hasFocus()?this.query:null,this.$overflowHelper=d(this.$input),this._checkLanguageDirection(),0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=b.noop)}function d(b){return a('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:b.css("font-family"),fontSize:b.css("font-size"),fontStyle:b.css("font-style"),fontVariant:b.css("font-variant"),fontWeight:b.css("font-weight"),wordSpacing:b.css("word-spacing"),letterSpacing:b.css("letter-spacing"),textIndent:b.css("text-indent"),textRendering:b.css("text-rendering"),textTransform:b.css("text-transform")}).insertAfter(b)}function f(a,b){return c.normalizeQuery(a)===c.normalizeQuery(b)}function g(a){return a.altKey||a.ctrlKey||a.metaKey||a.shiftKey}var h;return h={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},c.normalizeQuery=function(a){return b.toStr(a).replace(/^\s*/g,"").replace(/\s{2,}/g," ")},b.mixin(c.prototype,e,{_onBlur:function(){this.resetInputValue(),this.trigger("blurred")},_onFocus:function(){this.queryWhenFocused=this.query,this.trigger("focused")},_onKeydown:function(a){var b=h[a.which||a.keyCode];this._managePreventDefault(b,a),b&&this._shouldTrigger(b,a)&&this.trigger(b+"Keyed",a)},_onInput:function(){this._setQuery(this.getInputValue()),this.clearHintIfInvalid(),this._checkLanguageDirection()},_managePreventDefault:function(a,b){var c;switch(a){case"up":case"down":c=!g(b);break;default:c=!1}c&&b.preventDefault()},_shouldTrigger:function(a,b){var c;switch(a){case"tab":c=!g(b);break;default:c=!0}return c},_checkLanguageDirection:function(){var a=(this.$input.css("direction")||"ltr").toLowerCase();this.dir!==a&&(this.dir=a,this.$hint.attr("dir",a),this.trigger("langDirChanged",a))},_setQuery:function(a,b){var c,d;c=f(a,this.query),d=c?this.query.length!==a.length:!1,this.query=a,b||c?!b&&d&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},bind:function(){var a,c,d,e,f=this;return a=b.bind(this._onBlur,this),c=b.bind(this._onFocus,this),d=b.bind(this._onKeydown,this),e=b.bind(this._onInput,this),this.$input.on("blur.tt",a).on("focus.tt",c).on("keydown.tt",d),!b.isMsie()||b.isMsie()>9?this.$input.on("input.tt",e):this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(a){h[a.which||a.keyCode]||b.defer(b.bind(f._onInput,f,a))}),this},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getLangDir:function(){return this.dir},getQuery:function(){return this.query||""},setQuery:function(a,b){this.setInputValue(a),this._setQuery(a,b)},hasQueryChangedSinceLastFocus:function(){return this.query!==this.queryWhenFocused},getInputValue:function(){return this.$input.val()},setInputValue:function(a){this.$input.val(a),this.clearHintIfInvalid(),this._checkLanguageDirection()},resetInputValue:function(){this.setInputValue(this.query)},getHint:function(){return this.$hint.val()},setHint:function(a){this.$hint.val(a)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var a,b,c,d;a=this.getInputValue(),b=this.getHint(),c=a!==b&&0===b.indexOf(a),d=""!==a&&c&&!this.hasOverflow(),!d&&this.clearHint()},hasFocus:function(){return this.$input.is(":focus")},hasOverflow:function(){var a=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=a},isCursorAtEnd:function(){var a,c,d;return a=this.$input.val().length,c=this.$input[0].selectionStart,b.isNumber(c)?c===a:document.selection?(d=document.selection.createRange(),d.moveStart("character",-a),a===d.text.length):!0},destroy:function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$overflowHelper.remove(),this.$hint=this.$input=this.$overflowHelper=a("<div>")}}),c}(),h=function(){"use strict";function c(c,e){c=c||{},c.templates=c.templates||{},c.templates.notFound=c.templates.notFound||c.templates.empty,c.source||a.error("missing source"),c.node||a.error("missing node"),c.name&&!h(c.name)&&a.error("invalid dataset name: "+c.name),e.mixin(this),this.highlight=!!c.highlight,this.name=c.name||j(),this.limit=c.limit||5,this.displayFn=d(c.display||c.displayKey),this.templates=g(c.templates,this.displayFn),this.source=c.source.__ttAdapter?c.source.__ttAdapter():c.source,this.async=b.isUndefined(c.async)?this.source.length>2:!!c.async,this._resetLastSuggestion(),this.$el=a(c.node).addClass(this.classes.dataset).addClass(this.classes.dataset+"-"+this.name)}function d(a){function c(b){return b[a]}return a=a||b.stringify,b.isFunction(a)?a:c}function g(c,d){function e(b){return a("<div>").text(d(b))}return{notFound:c.notFound&&b.templatify(c.notFound),pending:c.pending&&b.templatify(c.pending),header:c.header&&b.templatify(c.header),footer:c.footer&&b.templatify(c.footer),suggestion:c.suggestion||e}}function h(a){return/^[_a-zA-Z0-9-]+$/.test(a)}var i,j;return i={val:"tt-selectable-display",obj:"tt-selectable-object"},j=b.getIdGenerator(),c.extractData=function(b){var c=a(b);return c.data(i.obj)?{val:c.data(i.val)||"",obj:c.data(i.obj)||null}:null},b.mixin(c.prototype,e,{_overwrite:function(a,b){b=b||[],b.length?this._renderSuggestions(a,b):this.async&&this.templates.pending?this._renderPending(a):!this.async&&this.templates.notFound?this._renderNotFound(a):this._empty(),this.trigger("rendered",this.name,b,!1)},_append:function(a,b){b=b||[],b.length&&this.$lastSuggestion.length?this._appendSuggestions(a,b):b.length?this._renderSuggestions(a,b):!this.$lastSuggestion.length&&this.templates.notFound&&this._renderNotFound(a),this.trigger("rendered",this.name,b,!0)},_renderSuggestions:function(a,b){var c;c=this._getSuggestionsFragment(a,b),this.$lastSuggestion=c.children().last(),this.$el.html(c).prepend(this._getHeader(a,b)).append(this._getFooter(a,b))},_appendSuggestions:function(a,b){var c,d;c=this._getSuggestionsFragment(a,b),d=c.children().last(),this.$lastSuggestion.after(c),this.$lastSuggestion=d},_renderPending:function(a){var b=this.templates.pending;this._resetLastSuggestion(),b&&this.$el.html(b({query:a,dataset:this.name}))},_renderNotFound:function(a){var b=this.templates.notFound;this._resetLastSuggestion(),b&&this.$el.html(b({query:a,dataset:this.name}))},_empty:function(){this.$el.empty(),this._resetLastSuggestion()},_getSuggestionsFragment:function(c,d){var e,g=this;return e=document.createDocumentFragment(),b.each(d,function(b){var d,f;f=g._injectQuery(c,b),d=a(g.templates.suggestion(f)).data(i.obj,b).data(i.val,g.displayFn(b)).addClass(g.classes.suggestion+" "+g.classes.selectable),e.appendChild(d[0])}),this.highlight&&f({className:this.classes.highlight,node:e,pattern:c}),a(e)},_getFooter:function(a,b){return this.templates.footer?this.templates.footer({query:a,suggestions:b,dataset:this.name}):null},_getHeader:function(a,b){return this.templates.header?this.templates.header({query:a,suggestions:b,dataset:this.name}):null},_resetLastSuggestion:function(){this.$lastSuggestion=a()},_injectQuery:function(a,c){return b.isObject(c)?b.mixin({_query:a},c):c},update:function(b){function c(a){g||(g=!0,a=(a||[]).slice(0,e.limit),h=a.length,e._overwrite(b,a),h<e.limit&&e.async&&e.trigger("asyncRequested",b))}function d(c){c=c||[],!f&&h<e.limit&&(e.cancel=a.noop,h+=c.length,e._append(b,c.slice(0,e.limit-h)),e.async&&e.trigger("asyncReceived",b))}var e=this,f=!1,g=!1,h=0;this.cancel(),this.cancel=function(){f=!0,e.cancel=a.noop,e.async&&e.trigger("asyncCanceled",b)},this.source(b,c,d),!g&&c([])},cancel:a.noop,clear:function(){this._empty(),this.cancel(),this.trigger("cleared")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=a("<div>")}}),c}(),i=function(){"use strict";function c(c,d){function e(b){var c=f.$node.find(b.node).first();return b.node=c.length?c:a("<div>").appendTo(f.$node),new h(b,d)}var f=this;c=c||{},c.node||a.error("node is required"),d.mixin(this),this.$node=a(c.node),this.query=null,this.datasets=b.map(c.datasets,e)}return b.mixin(c.prototype,e,{_onSelectableClick:function(b){this.trigger("selectableClicked",a(b.currentTarget))},_onRendered:function(a,b,c,d){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetRendered",b,c,d)},_onCleared:function(){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetCleared")},_propagate:function(){this.trigger.apply(this,arguments)},_allDatasetsEmpty:function(){function a(a){return a.isEmpty()}return b.every(this.datasets,a)},_getSelectables:function(){return this.$node.find(this.selectors.selectable)},_removeCursor:function(){var a=this.getActiveSelectable();a&&a.removeClass(this.classes.cursor)},_ensureVisible:function(a){var b,c,d,e;b=a.position().top,c=b+a.outerHeight(!0),d=this.$node.scrollTop(),e=this.$node.height()+parseInt(this.$node.css("paddingTop"),10)+parseInt(this.$node.css("paddingBottom"),10),0>b?this.$node.scrollTop(d+b):c>e&&this.$node.scrollTop(d+(c-e))},bind:function(){var a,c=this;return a=b.bind(this._onSelectableClick,this),this.$node.on("click.tt",this.selectors.selectable,a),b.each(this.datasets,function(a){a.onSync("asyncRequested",c._propagate,c).onSync("asyncCanceled",c._propagate,c).onSync("asyncReceived",c._propagate,c).onSync("rendered",c._onRendered,c).onSync("cleared",c._onCleared,c)}),this},isOpen:function(){return this.$node.hasClass(this.classes.open)},open:function(){this.$node.addClass(this.classes.open)},close:function(){this.$node.removeClass(this.classes.open),this._removeCursor()},setLanguageDirection:function(a){this.$node.attr("dir",a)},selectableRelativeToCursor:function(a){var b,c,d,e;return c=this.getActiveSelectable(),b=this._getSelectables(),d=c?b.index(c):-1,e=d+a,e=(e+1)%(b.length+1)-1,e=-1>e?b.length-1:e,-1===e?null:b.eq(e)},setCursor:function(a){this._removeCursor(),(a=a&&a.first())&&(a.addClass(this.classes.cursor),this._ensureVisible(a))},getSelectableData:function(a){return a&&a.length?h.extractData(a):null},getActiveSelectable:function(){var a=this._getSelectables().filter(this.selectors.cursor).first();return a.length?a:null},getTopSelectable:function(){var a=this._getSelectables().first();return a.length?a:null},update:function(a){function c(b){b.update(a)}var d=a!==this.query;return d&&(this.query=a,b.each(this.datasets,c)),d},empty:function(){function a(a){a.clear()}b.each(this.datasets,a),this.query=null,this.$node.addClass(this.classes.empty)},destroy:function(){function c(a){a.destroy()}this.$node.off(".tt"),this.$node=a("<div>"),b.each(this.datasets,c)}}),c}(),j=function(){"use strict";function a(){i.apply(this,[].slice.call(arguments,0))}var c=i.prototype;return b.mixin(a.prototype,i.prototype,{open:function(){return!this._allDatasetsEmpty()&&this._show(),c.open.apply(this,[].slice.call(arguments,0))},close:function(){return this._hide(),c.close.apply(this,[].slice.call(arguments,0))},_onRendered:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),c._onRendered.apply(this,[].slice.call(arguments,0))},_onCleared:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),c._onCleared.apply(this,[].slice.call(arguments,0))},setLanguageDirection:function(a){return this.$node.css("ltr"===a?this.css.ltr:this.css.rtl),c.setLanguageDirection.apply(this,[].slice.call(arguments,0))},_hide:function(){this.$node.hide()},_show:function(){this.$node.css("display","block")}}),a}(),k=function(){"use strict";function c(c,e){var f,g,h,i,j,k,l,m,n,o,p;c=c||{},c.input||a.error("missing input"),c.menu||a.error("missing menu"),c.eventBus||a.error("missing event bus"),e.mixin(this),this.eventBus=c.eventBus,this.minLength=b.isNumber(c.minLength)?c.minLength:1,this.input=c.input,this.menu=c.menu,this.enabled=!0,this.active=!1,this.input.hasFocus()&&this.activate(),this.dir=this.input.getLangDir(),this._hacks(),this.menu.bind().onSync("selectableClicked",this._onSelectableClicked,this).onSync("asyncRequested",this._onAsyncRequested,this).onSync("asyncCanceled",this._onAsyncCanceled,this).onSync("asyncReceived",this._onAsyncReceived,this).onSync("datasetRendered",this._onDatasetRendered,this).onSync("datasetCleared",this._onDatasetCleared,this),f=d(this,"activate","open","_onFocused"),g=d(this,"deactivate","_onBlurred"),h=d(this,"isActive","isOpen","_onEnterKeyed"),i=d(this,"isActive","isOpen","_onTabKeyed"),j=d(this,"isActive","_onEscKeyed"),k=d(this,"isActive","open","_onUpKeyed"),l=d(this,"isActive","open","_onDownKeyed"),m=d(this,"isActive","isOpen","_onLeftKeyed"),n=d(this,"isActive","isOpen","_onRightKeyed"),o=d(this,"_openIfActive","_onQueryChanged"),p=d(this,"_openIfActive","_onWhitespaceChanged"),this.input.bind().onSync("focused",f,this).onSync("blurred",g,this).onSync("enterKeyed",h,this).onSync("tabKeyed",i,this).onSync("escKeyed",j,this).onSync("upKeyed",k,this).onSync("downKeyed",l,this).onSync("leftKeyed",m,this).onSync("rightKeyed",n,this).onSync("queryChanged",o,this).onSync("whitespaceChanged",p,this).onSync("langDirChanged",this._onLangDirChanged,this)}function d(a){var c=[].slice.call(arguments,1);return function(){var d=[].slice.call(arguments);b.each(c,function(b){return a[b].apply(a,d)})}}return b.mixin(c.prototype,{_hacks:function(){var c,d;c=this.input.$input||a("<div>"),d=this.menu.$node||a("<div>"),c.on("blur.tt",function(a){var e,f,g;e=document.activeElement,f=d.is(e),g=d.has(e).length>0,b.isMsie()&&(f||g)&&(a.preventDefault(),a.stopImmediatePropagation(),b.defer(function(){c.focus()}))}),d.on("mousedown.tt",function(a){a.preventDefault()})},_onSelectableClicked:function(a,b){this.select(b)},_onDatasetCleared:function(){this._updateHint()},_onDatasetRendered:function(a,b,c,d){this._updateHint(),this.eventBus.trigger("render",c,d,b)},_onAsyncRequested:function(a,b,c){this.eventBus.trigger("asyncrequest",c,b)},_onAsyncCanceled:function(a,b,c){this.eventBus.trigger("asynccancel",c,b)},_onAsyncReceived:function(a,b,c){this.eventBus.trigger("asyncreceive",c,b)},_onFocused:function(){this._minLengthMet()&&this.menu.update(this.input.getQuery())},_onBlurred:function(){this.input.hasQueryChangedSinceLastFocus()&&this.eventBus.trigger("change",this.input.getQuery())},_onEnterKeyed:function(a,b){var c;(c=this.menu.getActiveSelectable())&&this.select(c)&&b.preventDefault()},_onTabKeyed:function(a,b){var c;(c=this.menu.getActiveSelectable())?this.select(c)&&b.preventDefault():(c=this.menu.getTopSelectable())&&this.autocomplete(c)&&b.preventDefault()},_onEscKeyed:function(){this.close()},_onUpKeyed:function(){this.moveCursor(-1)},_onDownKeyed:function(){this.moveCursor(1)},_onLeftKeyed:function(){"rtl"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onRightKeyed:function(){"ltr"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onQueryChanged:function(a,b){this._minLengthMet(b)?this.menu.update(b):this.menu.empty()},_onWhitespaceChanged:function(){this._updateHint()},_onLangDirChanged:function(a,b){this.dir!==b&&(this.dir=b,this.menu.setLanguageDirection(b))},_openIfActive:function(){this.isActive()&&this.open()},_minLengthMet:function(a){return a=b.isString(a)?a:this.input.getQuery()||"",a.length>=this.minLength},_updateHint:function(){var a,c,d,e,f,h,i;a=this.menu.getTopSelectable(),c=this.menu.getSelectableData(a),d=this.input.getInputValue(),!c||b.isBlankString(d)||this.input.hasOverflow()?this.input.clearHint():(e=g.normalizeQuery(d),f=b.escapeRegExChars(e),h=new RegExp("^(?:"+f+")(.+$)","i"),i=h.exec(c.val),i&&this.input.setHint(d+i[1]))},isEnabled:function(){return this.enabled},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},isActive:function(){return this.active},activate:function(){return this.isActive()?!0:!this.isEnabled()||this.eventBus.before("active")?!1:(this.active=!0,this.eventBus.trigger("active"),!0)},deactivate:function(){return this.isActive()?this.eventBus.before("idle")?!1:(this.active=!1,this.close(),this.eventBus.trigger("idle"),!0):!0},isOpen:function(){return this.menu.isOpen()},open:function(){return this.isOpen()||this.eventBus.before("open")||(this.menu.open(),this._updateHint(),this.eventBus.trigger("open")),this.isOpen()},close:function(){return this.isOpen()&&!this.eventBus.before("close")&&(this.menu.close(),this.input.clearHint(),this.input.resetInputValue(),this.eventBus.trigger("close")),!this.isOpen()},setVal:function(a){this.input.setQuery(b.toStr(a))},getVal:function(){return this.input.getQuery()},select:function(a){var b=this.menu.getSelectableData(a);return b&&!this.eventBus.before("select",b.obj)?(this.input.setQuery(b.val,!0),this.eventBus.trigger("select",b.obj),this.close(),!0):!1},autocomplete:function(a){var b,c,d;return b=this.input.getQuery(),c=this.menu.getSelectableData(a),d=c&&b!==c.val,d&&!this.eventBus.before("autocomplete",c.obj)?(this.input.setQuery(c.val),this.eventBus.trigger("autocomplete",c.obj),!0):!1},moveCursor:function(a){var b,c,d,e,f;return b=this.input.getQuery(),c=this.menu.selectableRelativeToCursor(a),d=this.menu.getSelectableData(c),e=d?d.obj:null,f=this._minLengthMet()&&this.menu.update(b),f||this.eventBus.before("cursorchange",e)?!1:(this.menu.setCursor(c),d?this.input.setInputValue(d.val):(this.input.resetInputValue(),this._updateHint()),this.eventBus.trigger("cursorchange",e),!0)},destroy:function(){this.input.destroy(),this.menu.destroy()}}),c}();!function(){"use strict";function e(b,c){b.each(function(){var b,d=a(this);(b=d.data(p.typeahead))&&c(b,d)})}function f(a,b){return a.clone().addClass(b.classes.hint).removeData().css(b.css.hint).css(l(a)).prop("readonly",!0).removeAttr("id name placeholder required").attr({autocomplete:"off",spellcheck:"false",tabindex:-1})}function h(a,b){a.data(p.attrs,{dir:a.attr("dir"),autocomplete:a.attr("autocomplete"),spellcheck:a.attr("spellcheck"),style:a.attr("style")}),a.addClass(b.classes.input).attr({autocomplete:"off",spellcheck:!1});try{!a.attr("dir")&&a.attr("dir","auto")}catch(c){}return a}function l(a){return{backgroundAttachment:a.css("background-attachment"),backgroundClip:a.css("background-clip"),backgroundColor:a.css("background-color"),backgroundImage:a.css("background-image"),backgroundOrigin:a.css("background-origin"),backgroundPosition:a.css("background-position"),backgroundRepeat:a.css("background-repeat"),backgroundSize:a.css("background-size")}}function m(a){var c,d;c=a.data(p.www),d=a.parent().filter(c.selectors.wrapper),b.each(a.data(p.attrs),function(c,d){b.isUndefined(c)?a.removeAttr(d):a.attr(d,c)}),a.removeData(p.typeahead).removeData(p.www).removeData(p.attr).removeClass(c.classes.input),d.length&&(a.detach().insertAfter(d),d.remove())}function n(c){var d,e;return d=b.isJQuery(c)||b.isElement(c),e=d?a(c).first():[],e.length?e:null}var o,p,q;o=a.fn.typeahead,p={www:"tt-www",attrs:"tt-attrs",typeahead:"tt-typeahead"},q={initialize:function(e,l){function m(){var c,m,q,r,s,t,u,v,w,x,y;b.each(l,function(a){a.highlight=!!e.highlight}),c=a(this),m=a(o.html.wrapper),q=n(e.hint),r=n(e.menu),s=e.hint!==!1&&!q,t=e.menu!==!1&&!r,s&&(q=f(c,o)),t&&(r=a(o.html.menu).css(o.css.menu)),q&&q.val(""),c=h(c,o),(s||t)&&(m.css(o.css.wrapper),c.css(s?o.css.input:o.css.inputWithNoHint),c.wrap(m).parent().prepend(s?q:null).append(t?r:null)),y=t?j:i,u=new d({el:c}),v=new g({hint:q,input:c},o),w=new y({node:r,datasets:l},o),x=new k({input:v,menu:w,eventBus:u,minLength:e.minLength},o),c.data(p.www,o),c.data(p.typeahead,x)}var o;return l=b.isArray(l)?l:[].slice.call(arguments,1),e=e||{},o=c(e.classNames),this.each(m)},isEnabled:function(){var a;return e(this.first(),function(b){a=b.isEnabled()}),a},enable:function(){return e(this,function(a){a.enable()}),this},disable:function(){return e(this,function(a){a.disable()}),this},isActive:function(){var a;return e(this.first(),function(b){a=b.isActive()}),a},activate:function(){return e(this,function(a){a.activate()}),this},deactivate:function(){return e(this,function(a){a.deactivate()}),this},isOpen:function(){var a;return e(this.first(),function(b){a=b.isOpen()}),a},open:function(){return e(this,function(a){a.open()}),this},close:function(){return e(this,function(a){a.close()}),this},select:function(b){var c=!1,d=a(b);return e(this.first(),function(a){c=a.select(d)}),c},autocomplete:function(b){var c=!1,d=a(b);return e(this.first(),function(a){c=a.autocomplete(d)}),c},moveCursor:function(a){var b=!1;return e(this.first(),function(c){b=c.moveCursor(a)}),b},val:function(a){var b;return arguments.length?(e(this,function(b){b.setVal(a)}),this):(e(this.first(),function(a){b=a.getVal()}),b)},destroy:function(){return e(this,function(a,b){m(b),a.destroy()}),this}},a.fn.typeahead=function(a){return q[a]?q[a].apply(this,[].slice.call(arguments,1)):q.initialize.apply(this,arguments)},a.fn.typeahead.noConflict=function(){return a.fn.typeahead=o,this}}()});$(function(){$(document).trigger('nav_page_load')});$(document).on('nav_page_load',function(){if($('#demandForm').length){loadArchive()}
function loadArchive(){initTypeAhead();initFloatingLabels();initLoadingButtons();decodeHTMLEntities();startProgress();scrollToResults();CsArchive.highlightSearchWords();CsArchive.initErrorReporting();CsArchive.select2()}
function scrollToResults(){if($('.js-archive-searched-for').length){$('.js-global-wrapper').data("csSectionLinks").scrollToSection('archive_ajax_wrapper',0,1)}}
function decodeHTMLEntities(){$('#demandForm input').each(function(){$(this).val(decodeURI($(this).val()))})}
function startProgress(){$('#demandForm').on('submit',function(){$('body').addClass('ajax-loading')})}
function initLoadingButtons(){$(document).on('click','.js-load-archive',function(){CsArchive.transformValues();CsArchive.load($(this).data('offset'))})}
function initFloatingLabels(){$('.tx_csarchive_pi1_search input, .tx_csarchive_pi1_search textarea').on('focus',function(){$('.float-label').hide();$(this).parents('.input').eq(0).find('.float-label').show()})}
function initTypeAhead(){var $typeaheadFields=$('.js-typeahead');$typeaheadFields.each(function(element,index){var $el=$(this),id=$el.attr('id');window['bloodhound_'+id]=new Bloodhound({datumTokenizer:function(d){return Bloodhound.tokenizers.whitespace(bloodhoundAccentFolding.removeDiacritics(d))},queryTokenizer:bloodhoundAccentFolding.queryTokenizer,local:['...']});$el.typeahead(null,{minLength:0,name:id,source:window['bloodhound_'+id],limit:1000,});$el.on('focusin.autocomplete',function(){if(!$el.data('loaded')){var url=$el.data('autocomplete'),id=$el.attr('id'),formData=$el.closest('form').serialize();window['bloodhound_'+id].clear();window['bloodhound_'+id].local=['...'];$.ajax({type:"POST",url:url,data:formData,success:function(result){window['bloodhound_'+id].clear();window['bloodhound_'+id].local=result;window['bloodhound_'+id].initialize(!0);$el.data('loaded',!0)}})}})});$('#demandForm').on('change',function(){$typeaheadFields.data('loaded',!1)})}});CsArchive={markInstance:null,offset:0,sortSelector:'.js-filter-grid-select',initErrorReporting:function(){$('.js-report-error').on('click',function(){var $reportFrame=$('.js-report-frame');$reportFrame.find('.ua').text(navigator.userAgent);$reportFrame.slideToggle()})},print:function(id){id='#konzert-'+id;var printWindow=window.open();printWindow.document.write($(id).html());printWindow.print();printWindow.close();printWindow=null},printResults:function(){$('.toggle-content.content').css({display:'block'});window.print()},load:function(offset){this.offset=offset;var $offset=$('#offset');var previousOffset=$offset.val();$offset.val(this.offset);var form=$("#demandForm");var url=form.attr('action');var ajaxWrapperSelector='#archive_ajax_wrapper';var $ajaxWrapper=$(ajaxWrapperSelector);var formData=form.serialize()+'&'+encodeURIComponent('tx_csarchive_pi1[ajax]')+'=1';$.ajax({type:"POST",url:url,data:formData,success:function(data){$offset.val(previousOffset);var $data=$(data).find(ajaxWrapperSelector).children();$('.js-load-archive').hide();$ajaxWrapper.append($data);$data.each(function(){$(this).csGlobalScripts({ajaxInit:1})});var $scrollSelector=$('p.searched-for:last-of-type');if($scrollSelector.length){$('html, body').animate({scrollTop:$scrollSelector.offset().top-$('#header').height()-40},2000)}
CsArchive.highlightSearchWords()}})},highlightSearchWords:function(){this.markInstance=null;this.markInstance=$('#archive_ajax_wrapper .small-event-teaser__right-col').mark(this.getSearchWords(),{separateWordSearch:!1,exclude:["p.bodytext"]})},getSearchWords:function(){var searchWords=[];var $demandFields=$("#demandForm [data-demand!=''][data-demand]:not('.tt-hint'):not('#datepicker-endDate'):not('#datepicker-startDate'):not('#offset')");$demandFields.each(function(){var demand=$(this).data('demand');demand.split(', ').forEach(function(word){searchWords.push(word)})});return $.uniqueSort(searchWords)},hasElement:function(selector){return $(selector)&&$(selector).length&&$(selector).length>0},select2:function(){if(this.hasElement(this.sortSelector)){$(this.sortSelector).select2({minimumResultsForSearch:Infinity})}},transformValues:function(){var startDate=$('#datepicker-startDate');var startDateHidden=$('#datepicker-startDate + input[type="hidden"]');var endDate=$('#datepicker-endDate');var endDateHidden=$('#datepicker-endDate + input[type="hidden"]');var shortStartDateFormat=startDate.val().length===4&&!startDate.val().includes('.');var shortEndDateFormat=endDate.val().length===4&&!endDate.val().includes('.');if(shortStartDateFormat&&startDate.val()){startDate.val('01.01.'+startDate.val())}
if(shortEndDateFormat&&startDate.val()){endDate.val('31.12.'+startDate.val())}
if(startDate.val()){var startDateFormat=new Date(startDate.val());startDateFormat=startDateFormat.getDate()+'.'+(startDateFormat.getMonth()+1)+'.'+startDateFormat.getFullYear();startDateHidden.val(startDateFormat)}
if(endDate.val()){var endDateFormat=new Date(endDate.val());endDateFormat=endDateFormat.getDate()+'.'+(endDateFormat.getMonth()+1)+'.'+endDateFormat.getFullYear();endDateHidden.val(endDateFormat)}}};var bloodhoundAccentFolding={removeDiacritics:function(str){for(var i=0;i<bloodhoundAccentFolding.defaultDiacriticsRemovalMap.length;i++){str=str.replace(bloodhoundAccentFolding.defaultDiacriticsRemovalMap[i].letters,bloodhoundAccentFolding.defaultDiacriticsRemovalMap[i].base)}
return str},queryTokenizer:function(q){var normalized=bloodhoundAccentFolding.removeDiacritics(q);return Bloodhound.tokenizers.whitespace(normalized)},defaultDiacriticsRemovalMap:[{'base':"A",'letters':/(&#65;|&#9398;|&#65313;|&#192;|&#193;|&#194;|&#7846;|&#7844;|&#7850;|&#7848;|&#195;|&#256;|&#258;|&#7856;|&#7854;|&#7860;|&#7858;|&#550;|&#480;|&#196;|&#478;|&#7842;|&#197;|&#506;|&#461;|&#512;|&#514;|&#7840;|&#7852;|&#7862;|&#7680;|&#260;|&#570;|&#11375;|[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F])/g},{'base':"AA",'letters':/(&#42802;|[\uA732])/g},{'base':"AE",'letters':/(&#198;|&#508;|&#482;|[\u00C6\u01FC\u01E2])/g},{'base':"AO",'letters':/(&#42804;|[\uA734])/g},{'base':"AU",'letters':/(&#42806;|[\uA736])/g},{'base':"AV",'letters':/(&#42808;|&#42810;|[\uA738\uA73A])/g},{'base':"AY",'letters':/(&#42812;|[\uA73C])/g},{'base':"B",'letters':/(&#66;|&#9399;|&#65314;|&#7682;|&#7684;|&#7686;|&#579;|&#386;|&#385;|[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181])/g},{'base':"C",'letters':/(&#67;|&#9400;|&#65315;|&#262;|&#264;|&#266;|&#268;|&#199;|&#7688;|&#391;|&#571;|&#42814;|[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E])/g},{'base':"D",'letters':/(&#68;|&#9401;|&#65316;|&#7690;|&#270;|&#7692;|&#7696;|&#7698;|&#7694;|&#272;|&#395;|&#394;|&#393;|&#42873;|[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779])/g},{'base':"DZ",'letters':/(&#497;|&#452;|[\u01F1\u01C4])/g},{'base':"Dz",'letters':/(&#498;|&#453;|[\u01F2\u01C5])/g},{'base':"E",'letters':/(&#69;|&#9402;|&#65317;|&#200;|&#201;|&#202;|&#7872;|&#7870;|&#7876;|&#7874;|&#7868;|&#274;|&#7700;|&#7702;|&#276;|&#278;|&#203;|&#7866;|&#282;|&#516;|&#518;|&#7864;|&#7878;|&#552;|&#7708;|&#280;|&#7704;|&#7706;|&#400;|&#398;|[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E])/g},{'base':"F",'letters':/(&#70;|&#9403;|&#65318;|&#7710;|&#401;|&#42875;|[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B])/g},{'base':"G",'letters':/(&#71;|&#9404;|&#65319;|&#500;|&#284;|&#7712;|&#286;|&#288;|&#486;|&#290;|&#484;|&#403;|&#42912;|&#42877;|&#42878;|[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E])/g},{'base':"H",'letters':/(&#72;|&#9405;|&#65320;|&#292;|&#7714;|&#7718;|&#542;|&#7716;|&#7720;|&#7722;|&#294;|&#11367;|&#11381;|&#42893;|[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D])/g},{'base':"I",'letters':/(&#73;|&#9406;|&#65321;|&#204;|&#205;|&#206;|&#296;|&#298;|&#300;|&#304;|&#207;|&#7726;|&#7880;|&#463;|&#520;|&#522;|&#7882;|&#302;|&#7724;|&#407;|[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197])/g},{'base':"J",'letters':/(&#74;|&#9407;|&#65322;|&#308;|&#584;|[\u004A\u24BF\uFF2A\u0134\u0248])/g},{'base':"K",'letters':/(&#75;|&#9408;|&#65323;|&#7728;|&#488;|&#7730;|&#310;|&#7732;|&#408;|&#11369;|&#42816;|&#42818;|&#42820;|&#42914;|[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2])/g},{'base':"L",'letters':/(&#76;|&#9409;|&#65324;|&#319;|&#313;|&#317;|&#7734;|&#7736;|&#315;|&#7740;|&#7738;|&#321;|&#573;|&#11362;|&#11360;|&#42824;|&#42822;|&#42880;|[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780])/g},{'base':"LJ",'letters':/(&#455;|[\u01C7])/g},{'base':"Lj",'letters':/(&#456;|[\u01C8])/g},{'base':"M",'letters':/(&#77;|&#9410;|&#65325;|&#7742;|&#7744;|&#7746;|&#11374;|&#412;|[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C])/g},{'base':"N",'letters':/(&#78;|&#9411;|&#65326;|&#504;|&#323;|&#209;|&#7748;|&#327;|&#7750;|&#325;|&#7754;|&#7752;|&#544;|&#413;|&#42896;|&#42916;|[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4])/g},{'base':"NJ",'letters':/(&#458;|[\u01CA])/g},{'base':"Nj",'letters':/(&#459;|[\u01CB])/g},{'base':"O",'letters':/(&#79;|&#9412;|&#65327;|&#210;|&#211;|&#212;|&#7890;|&#7888;|&#7894;|&#7892;|&#213;|&#7756;|&#556;|&#7758;|&#332;|&#7760;|&#7762;|&#334;|&#558;|&#560;|&#214;|&#554;|&#7886;|&#336;|&#465;|&#524;|&#526;|&#416;|&#7900;|&#7898;|&#7904;|&#7902;|&#7906;|&#7884;|&#7896;|&#490;|&#492;|&#216;|&#510;|&#390;|&#415;|&#42826;|&#42828;|[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C])/g},{'base':"OI",'letters':/(&#418;|[\u01A2])/g},{'base':"OO",'letters':/(&#42830;|[\uA74E])/g},{'base':"OU",'letters':/(&#546;|[\u0222])/g},{'base':"P",'letters':/(&#80;|&#9413;|&#65328;|&#7764;|&#7766;|&#420;|&#11363;|&#42832;|&#42834;|&#42836;|[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754])/g},{'base':"Q",'letters':/(&#81;|&#9414;|&#65329;|&#42838;|&#42840;|&#586;|[\u0051\u24C6\uFF31\uA756\uA758\u024A])/g},{'base':"R",'letters':/(&#82;|&#9415;|&#65330;|&#340;|&#7768;|&#344;|&#528;|&#530;|&#7770;|&#7772;|&#342;|&#7774;|&#588;|&#11364;|&#42842;|&#42918;|&#42882;|[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782])/g},{'base':"S",'letters':/(&#83;|&#9416;|&#65331;|&#7838;|&#346;|&#7780;|&#348;|&#7776;|&#352;|&#7782;|&#7778;|&#7784;|&#536;|&#350;|&#11390;|&#42920;|&#42884;|[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784])/g},{'base':"T",'letters':/(&#84;|&#9417;|&#65332;|&#7786;|&#356;|&#7788;|&#538;|&#354;|&#7792;|&#7790;|&#358;|&#428;|&#430;|&#574;|&#42886;|[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786])/g},{'base':"TZ",'letters':/(&#42792;|[\uA728])/g},{'base':"U",'letters':/(&#85;|&#9418;|&#65333;|&#217;|&#218;|&#219;|&#360;|&#7800;|&#362;|&#7802;|&#364;|&#220;|&#475;|&#471;|&#469;|&#473;|&#7910;|&#366;|&#368;|&#467;|&#532;|&#534;|&#431;|&#7914;|&#7912;|&#7918;|&#7916;|&#7920;|&#7908;|&#7794;|&#370;|&#7798;|&#7796;|&#580;|[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244])/g},{'base':"V",'letters':/(&#86;|&#9419;|&#65334;|&#7804;|&#7806;|&#434;|&#42846;|&#581;|[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245])/g},{'base':"VY",'letters':/(&#42848;|[\uA760])/g},{'base':"W",'letters':/(&#87;|&#9420;|&#65335;|&#7808;|&#7810;|&#372;|&#7814;|&#7812;|&#7816;|&#11378;|[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72])/g},{'base':"X",'letters':/(&#88;|&#9421;|&#65336;|&#7818;|&#7820;|[\u0058\u24CD\uFF38\u1E8A\u1E8C])/g},{'base':"Y",'letters':/(&#89;|&#9422;|&#65337;|&#7922;|&#221;|&#374;|&#7928;|&#562;|&#7822;|&#376;|&#7926;|&#7924;|&#435;|&#590;|&#7934;|[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE])/g},{'base':"Z",'letters':/(&#90;|&#9423;|&#65338;|&#377;|&#7824;|&#379;|&#381;|&#7826;|&#7828;|&#437;|&#548;|&#11391;|&#11371;|&#42850;|[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762])/g},{'base':"a",'letters':/(&#97;|&#9424;|&#65345;|&#7834;|&#224;|&#225;|&#226;|&#7847;|&#7845;|&#7851;|&#7849;|&#227;|&#257;|&#259;|&#7857;|&#7855;|&#7861;|&#7859;|&#551;|&#481;|&#228;|&#479;|&#7843;|&#229;|&#507;|&#462;|&#513;|&#515;|&#7841;|&#7853;|&#7863;|&#7681;|&#261;|&#11365;|&#592;|[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250])/g},{'base':"aa",'letters':/(&#42803;|[\uA733])/g},{'base':"ae",'letters':/(&#230;|&#509;|&#483;|[\u00E6\u01FD\u01E3])/g},{'base':"ao",'letters':/(&#42805;|[\uA735])/g},{'base':"au",'letters':/(&#42807;|[\uA737])/g},{'base':"av",'letters':/(&#42809;|&#42811;|[\uA739\uA73B])/g},{'base':"ay",'letters':/(&#42813;|[\uA73D])/g},{'base':"b",'letters':/(&#98;|&#9425;|&#65346;|&#7683;|&#7685;|&#7687;|&#384;|&#387;|&#595;|[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253])/g},{'base':"c",'letters':/(&#99;|&#9426;|&#65347;|&#263;|&#265;|&#267;|&#269;|&#231;|&#7689;|&#392;|&#572;|&#42815;|&#8580;|[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184])/g},{'base':"d",'letters':/(&#100;|&#9427;|&#65348;|&#7691;|&#271;|&#7693;|&#7697;|&#7699;|&#7695;|&#273;|&#396;|&#598;|&#599;|&#42874;|[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A])/g},{'base':"dz",'letters':/(&#499;|&#454;|[\u01F3\u01C6])/g},{'base':"e",'letters':/(&#101;|&#9428;|&#65349;|&#232;|&#233;|&#234;|&#7873;|&#7871;|&#7877;|&#7875;|&#7869;|&#275;|&#7701;|&#7703;|&#277;|&#279;|&#235;|&#7867;|&#283;|&#517;|&#519;|&#7865;|&#7879;|&#553;|&#7709;|&#281;|&#7705;|&#7707;|&#583;|&#603;|&#477;|[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD])/g},{'base':"f",'letters':/(&#102;|&#9429;|&#65350;|&#7711;|&#402;|&#42876;|[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C])/g},{'base':"g",'letters':/(&#103;|&#9430;|&#65351;|&#501;|&#285;|&#7713;|&#287;|&#289;|&#487;|&#291;|&#485;|&#608;|&#42913;|&#7545;|&#42879;|[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F])/g},{'base':"h",'letters':/(&#104;|&#9431;|&#65352;|&#293;|&#7715;|&#7719;|&#543;|&#7717;|&#7721;|&#7723;|&#7830;|&#295;|&#11368;|&#11382;|&#613;|[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265])/g},{'base':"hv",'letters':/(&#405;|[\u0195])/g},{'base':"i",'letters':/(&#105;|&#9432;|&#65353;|&#236;|&#237;|&#238;|&#297;|&#299;|&#301;|&#239;|&#7727;|&#7881;|&#464;|&#521;|&#523;|&#7883;|&#303;|&#7725;|&#616;|&#305;|[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131])/g},{'base':"j",'letters':/(&#106;|&#9433;|&#65354;|&#309;|&#496;|&#585;|[\u006A\u24D9\uFF4A\u0135\u01F0\u0249])/g},{'base':"k",'letters':/(&#107;|&#9434;|&#65355;|&#7729;|&#489;|&#7731;|&#311;|&#7733;|&#409;|&#11370;|&#42817;|&#42819;|&#42821;|&#42915;|[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3])/g},{'base':"l",'letters':/(&#108;|&#9435;|&#65356;|&#320;|&#314;|&#318;|&#7735;|&#7737;|&#316;|&#7741;|&#7739;|&#383;|&#322;|&#410;|&#619;|&#11361;|&#42825;|&#42881;|&#42823;|[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747])/g},{'base':"lj",'letters':/(&#457;|[\u01C9])/g},{'base':"m",'letters':/(&#109;|&#9436;|&#65357;|&#7743;|&#7745;|&#7747;|&#625;|&#623;|[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F])/g},{'base':"n",'letters':/(&#110;|&#9437;|&#65358;|&#505;|&#324;|&#241;|&#7749;|&#328;|&#7751;|&#326;|&#7755;|&#7753;|&#414;|&#626;|&#329;|&#42897;|&#42917;|[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5])/g},{'base':"nj",'letters':/(&#460;|[\u01CC])/g},{'base':"o",'letters':/(&#111;|&#9438;|&#65359;|&#242;|&#243;|&#244;|&#7891;|&#7889;|&#7895;|&#7893;|&#245;|&#7757;|&#557;|&#7759;|&#333;|&#7761;|&#7763;|&#335;|&#559;|&#561;|&#246;|&#555;|&#7887;|&#337;|&#466;|&#525;|&#527;|&#417;|&#7901;|&#7899;|&#7905;|&#7903;|&#7907;|&#7885;|&#7897;|&#491;|&#493;|&#248;|&#511;|&#596;|&#42827;|&#42829;|&#629;|[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275])/g},{'base':"oi",'letters':/(&#419;|[\u01A3])/g},{'base':"ou",'letters':/(&#547;|[\u0223])/g},{'base':"oo",'letters':/(&#42831;|[\uA74F])/g},{'base':"p",'letters':/(&#112;|&#9439;|&#65360;|&#7765;|&#7767;|&#421;|&#7549;|&#42833;|&#42835;|&#42837;|[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755])/g},{'base':"q",'letters':/(&#113;|&#9440;|&#65361;|&#587;|&#42839;|&#42841;|[\u0071\u24E0\uFF51\u024B\uA757\uA759])/g},{'base':"r",'letters':/(&#114;|&#9441;|&#65362;|&#341;|&#7769;|&#345;|&#529;|&#531;|&#7771;|&#7773;|&#343;|&#7775;|&#589;|&#637;|&#42843;|&#42919;|&#42883;|[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783])/g},{'base':"s",'letters':/(&#115;|&#9442;|&#65363;|&#223;|&#347;|&#7781;|&#349;|&#7777;|&#353;|&#7783;|&#7779;|&#7785;|&#537;|&#351;|&#575;|&#42921;|&#42885;|&#7835;|[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B])/g},{'base':"t",'letters':/(&#116;|&#9443;|&#65364;|&#7787;|&#7831;|&#357;|&#7789;|&#539;|&#355;|&#7793;|&#7791;|&#359;|&#429;|&#648;|&#11366;|&#42887;|[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787])/g},{'base':"tz",'letters':/(&#42793;|[\uA729])/g},{'base':"u",'letters':/(&#117;|&#9444;|&#65365;|&#249;|&#250;|&#251;|&#361;|&#7801;|&#363;|&#7803;|&#365;|&#252;|&#476;|&#472;|&#470;|&#474;|&#7911;|&#367;|&#369;|&#468;|&#533;|&#535;|&#432;|&#7915;|&#7913;|&#7919;|&#7917;|&#7921;|&#7909;|&#7795;|&#371;|&#7799;|&#7797;|&#649;|[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289])/g},{'base':"v",'letters':/(&#118;|&#9445;|&#65366;|&#7805;|&#7807;|&#651;|&#42847;|&#652;|[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C])/g},{'base':"vy",'letters':/(&#42849;|[\uA761])/g},{'base':"w",'letters':/(&#119;|&#9446;|&#65367;|&#7809;|&#7811;|&#373;|&#7815;|&#7813;|&#7832;|&#7817;|&#11379;|[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73])/g},{'base':"x",'letters':/(&#120;|&#9447;|&#65368;|&#7819;|&#7821;|[\u0078\u24E7\uFF58\u1E8B\u1E8D])/g},{'base':"y",'letters':/(&#121;|&#9448;|&#65369;|&#7923;|&#253;|&#375;|&#7929;|&#563;|&#7823;|&#255;|&#7927;|&#7833;|&#7925;|&#436;|&#591;|&#7935;|[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF])/g},{'base':"z",'letters':/(&#122;|&#9449;|&#65370;|&#378;|&#7825;|&#380;|&#382;|&#7827;|&#7829;|&#438;|&#549;|&#576;|&#11372;|&#42851;|[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763])/g}]};if(!window.document.documentMode){jQuery.event.special.touchstart={setup:function(_,ns,handle){this.addEventListener("touchstart",handle,{passive:!ns.includes("noPreventDefault")})}};jQuery.event.special.touchmove={setup:function(_,ns,handle){this.addEventListener("touchmove",handle,{passive:!ns.includes("noPreventDefault")})}};jQuery.event.special.wheel={setup:function(_,ns,handle){this.addEventListener("wheel",handle,{passive:!0})}};jQuery.event.special.mousewheel={setup:function(_,ns,handle){this.addEventListener("mousewheel",handle,{passive:!0})}}}