PageSourceSearch

https://www.volunteerministers.org/js/_combined.js?_=123

js volunteerministers.org collected 2026-10-03 21:37:49 UTC 1,491,327 bytes, 3,147 lines download raw bytes

1var _gcui_env='livesite';var globaldata_domain='gd2.edgesuite.net';var globaldata_domain2='gd2.edgesuite.net';var globalLang="en";var _gcui_file_url='https:\/\/files.volunteerministers.org';var _gcui_sd_url='//sd2.ondemandhosting.info';var _gcui_aure_url='https:\/\/aure.ondemandhosting.info\/aure\/subscribe.action';var _gcui_otherText='gcui_common_strings:other';var _gcui_selectElem='<option value="">Select…</option>';var _gcui_otherSpecifyText='Other (Specify)';var _gcui_campaignName='Volunteer Ministers';var _gcui_requiredText='gcui_dynaform:field_needs_to_be';var _site_locale='en';var main_cat="overview";var tabbar_div='<div id="gcui_online_course2_tabbar" class="tabs"><ul class="tabs primary">';var i18n_course_overview="gcui_common_strings:course_overview";var i18n_course_details="gcui_common_strings:course_details";var i18n_success_stories="gcui_vm:succes";var i18n_start_now="Start Now";
2/*!jQuery v3.1.1 | (c) jQuery Foundation | jquery.org/license*/
vendor: 86,640 bytes, line 2
2!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.1.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c<b?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:h,sort:c.sort,splice:c.splice},r.extend=r.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||r.isFunction(g)||(g={}),h===i&&(g=this,h--);h<i;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(r.isPlainObject(d)||(e=r.isArray(d)))?(e?(e=!1,f=c&&r.isArray(c)?c:[]):f=c&&r.isPlainObject(c)?c:{},g[b]=r.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},r.extend({expando:"jQuery"+(q+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===r.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=r.type(a);return("number"===b||"string"===b)&&!isNaN(a-parseFloat(a))},isPlainObject:function(a){var b,c;return!(!a||"[object Object]"!==k.call(a))&&(!(b=e(a))||(c=l.call(b,"constructor")&&b.constructor,"function"==typeof c&&m.call(c)===n))},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?j[k.call(a)]||"object":typeof a},globalEval:function(a){p(a)},camelCase:function(a){return a.replace(t,"ms-").replace(u,v)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(w(a)){for(c=a.length;d<c;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(s,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(w(Object(a))?r.merge(c,"string"==typeof a?[a]:a):h.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:i.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;d<c;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;f<g;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,f=0,h=[];if(w(a))for(d=a.length;f<d;f++)e=b(a[f],f,c),null!=e&&h.push(e);else for(f in a)e=b(a[f],f,c),null!=e&&h.push(e);return g.apply([],h)},guid:1,proxy:function(a,b){var c,d,e;if("string"==typeof b&&(c=a[b],b=a,a=c),r.isFunction(a))return d=f.call(arguments,2),e=function(){return a.apply(b||this,d.concat(f.call(arguments)))},e.guid=a.guid=a.guid||r.guid++,e},now:Date.now,support:o}),"function"==typeof Symbol&&(r.fn[Symbol.iterator]=c[Symbol.iterator]),r.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){j["[object "+b+"]"]=b.toLowerCase()});function w(a){var b=!!a&&"length"in a&&a.length,c=r.type(a);return"function"!==c&&!r.isWindow(a)&&("array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",M="\\["+K+"*("+L+")(?:"+K+"*([*^$|!~]?=)"+K+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+L+"))|)"+K+"*\\]",N=":("+L+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+M+")*)|.*)\\)|)",O=new RegExp(K+"+","g"),P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c<b;c+=2)a.push(c);return a}),odd:pa(function(a,b){for(var c=1;c<b;c+=2)a.push(c);return a}),lt:pa(function(a,b,c){for(var d=c<0?c+b:c;--d>=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function ra(){}ra.prototype=d.filters=d.pseudos,d.setFilters=new ra,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=Q.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=R.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(P," ")}),h=h.slice(c.length));for(g in d.filter)!(e=V[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function sa(a){for(var b=0,c=a.length,d="";b<c;b++)d+=a[b].value;return d}function ta(a,b,c){var d=b.dir,e=b.next,f=e||d,g=c&&"parentNode"===f,h=x++;return b.first?function(b,c,e){while(b=b[d])if(1===b.nodeType||g)return a(b,c,e);return!1}:function(b,c,i){var j,k,l,m=[w,h];if(i){while(b=b[d])if((1===b.nodeType||g)&&a(b,c,i))return!0}else while(b=b[d])if(1===b.nodeType||g)if(l=b[u]||(b[u]={}),k=l[b.uniqueID]||(l[b.uniqueID]={}),e&&e===b.nodeName.toLowerCase())b=b[d]||b;else{if((j=k[f])&&j[0]===w&&j[1]===h)return m[2]=j[2];if(k[f]=m,m[2]=a(b,c,i))return!0}return!1}}function ua(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d<e;d++)ga(a,b[d],c);return c}function wa(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;h<i;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function xa(a,b,c,d,e,f){return d&&!d[u]&&(d=xa(d)),e&&!e[u]&&(e=xa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||va(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:wa(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=wa(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i<f;i++)if(c=d.relative[a[i].type])m=[ta(ua(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;e<f;e++)if(d.relative[a[e].type])break;return xa(i>1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i<e&&ya(a.slice(i,e)),e<f&&ya(a=a.slice(e)),e<f&&sa(a))}m.push(c)}return ua(m)}function za(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext,B=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,C=/^.[^:#\[\.,]*$/;function D(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):C.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b<d;b++)if(r.contains(e[b],this))return!0}));for(c=this.pushStack([]),b=0;b<d;b++)r.find(a,e[b],c);return d>1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(D(this,a||[],!1))},not:function(a){return this.pushStack(D(this,a||[],!0))},is:function(a){return!!D(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var E,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,G=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||E,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:F.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),B.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};G.prototype=r.fn,E=r(d);var H=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a<c;a++)if(r.contains(this,b[a]))return!0})},closest:function(a,b){var c,d=0,e=this.length,f=[],g="string"!=typeof a&&r(a);if(!A.test(a))for(;d<e;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function J(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return J(a,"nextSibling")},prev:function(a){return J(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return a.contentDocument||r.merge([],a.childNodes)}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(I[a]||r.uniqueSort(e),H.test(a)&&e.reverse()),this.pushStack(e)}});var K=/[^\x20\t\r\n\f]+/g;function L(a){var b={};return r.each(a.match(K)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?L(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){r.each(b,function(b,c){r.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==r.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return r.each(arguments,function(a,b){var c;while((c=r.inArray(b,f,c))>-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function M(a){return a}function N(a){throw a}function O(a,b,c){var d;try{a&&r.isFunction(d=a.promise)?d.call(a).done(b).fail(c):a&&r.isFunction(d=a.then)?d.call(a,b,c):b.call(void 0,a)}catch(a){c.call(void 0,a)}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b<f)){if(a=d.apply(h,i),a===c.promise())throw new TypeError("Thenable self-resolution");j=a&&("object"==typeof a||"function"==typeof a)&&a.then,r.isFunction(j)?e?j.call(a,g(f,c,M,e),g(f,c,N,e)):(f++,j.call(a,g(f,c,M,e),g(f,c,N,e),g(f,c,M,c.notifyWith))):(d!==M&&(h=void 0,i=[a]),(e||c.resolveWith)(h,i))}},k=e?j:function(){try{j()}catch(a){r.Deferred.exceptionHook&&r.Deferred.exceptionHook(a,k.stackTrace),b+1>=f&&(d!==N&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:M,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:M)),c[2][3].add(g(0,a,r.isFunction(d)?d:N))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(O(a,g.done(h(c)).resolve,g.reject),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)O(e[c],h(c),g.reject);return g.promise()}});var P=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&P.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var Q=r.Deferred();r.fn.ready=function(a){return Q.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,holdReady:function(a){a?r.readyWait++:r.ready(!0)},ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||Q.resolveWith(d,[r]))}}),r.ready.then=Q.then;function R(){d.removeEventListener("DOMContentLoaded",R),a.removeEventListener("load",R),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",R),a.addEventListener("load",R));var S=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)S(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h<i;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},T=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function U(){this.expando=r.expando+U.uid++}U.uid=1,U.prototype={cache:function(a){var b=a[this.expando];return b||(b={},T(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[r.camelCase(b)]=c;else for(d in b)e[r.camelCase(d)]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][r.camelCase(b)]},access:function(a,b,c){return void 0===b||b&&"string"==typeof b&&void 0===c?this.get(a,b):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d=a[this.expando];if(void 0!==d){if(void 0!==b){r.isArray(b)?b=b.map(r.camelCase):(b=r.camelCase(b),b=b in d?[b]:b.match(K)||[]),c=b.length;while(c--)delete d[b[c]]}(void 0===b||r.isEmptyObject(d))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!r.isEmptyObject(b)}};var V=new U,W=new U,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Y=/[A-Z]/g;function Z(a){return"true"===a||"false"!==a&&("null"===a?null:a===+a+""?+a:X.test(a)?JSON.parse(a):a)}function $(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Y,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c=Z(c)}catch(e){}W.set(a,b,c)}else c=void 0;return c}r.extend({hasData:function(a){return W.hasData(a)||V.hasData(a)},data:function(a,b,c){return W.access(a,b,c)},removeData:function(a,b){W.remove(a,b)},_data:function(a,b,c){return V.access(a,b,c)},_removeData:function(a,b){V.remove(a,b)}}),r.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=W.get(f),1===f.nodeType&&!V.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=r.camelCase(d.slice(5)),$(f,d,e[d])));V.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){W.set(this,a)}):S(this,function(b){var c;if(f&&void 0===b){if(c=W.get(f,a),void 0!==c)return c;if(c=$(f,a),void 0!==c)return c}else this.each(function(){W.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){W.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=V.get(a,b),c&&(!d||r.isArray(c)?d=V.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return V.get(a,c)||V.access(a,c,{empty:r.Callbacks("once memory").add(function(){V.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?r.queue(this[0],a):void 0===b?this:this.each(function(){var c=r.queue(this,a,b);r._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&r.dequeue(this,a)})},dequeue:function(a){return this.each(function(){r.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=r.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=V.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var _=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,aa=new RegExp("^(?:([+-])=|)("+_+")([a-z%]*)$","i"),ba=["Top","Right","Bottom","Left"],ca=function(a,b){return a=b||a,"none"===a.style.display||""===a.style.display&&r.contains(a.ownerDocument,a)&&"none"===r.css(a,"display")},da=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};function ea(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return r.css(a,b,"")},i=h(),j=c&&c[3]||(r.cssNumber[b]?"":"px"),k=(r.cssNumber[b]||"px"!==j&&+i)&&aa.exec(r.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,r.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var fa={};function ga(a){var b,c=a.ownerDocument,d=a.nodeName,e=fa[d];return e?e:(b=c.body.appendChild(c.createElement(d)),e=r.css(b,"display"),b.parentNode.removeChild(b),"none"===e&&(e="block"),fa[d]=e,e)}function ha(a,b){for(var c,d,e=[],f=0,g=a.length;f<g;f++)d=a[f],d.style&&(c=d.style.display,b?("none"===c&&(e[f]=V.get(d,"display")||null,e[f]||(d.style.display="")),""===d.style.display&&ca(d)&&(e[f]=ga(d))):"none"!==c&&(e[f]="none",V.set(d,"display",c)));for(f=0;f<g;f++)null!=e[f]&&(a[f].style.display=e[f]);return a}r.fn.extend({show:function(){return ha(this,!0)},hide:function(){return ha(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){ca(this)?r(this).show():r(this).hide()})}});var ia=/^(?:checkbox|radio)$/i,ja=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,ka=/^$|\/(?:java|ecma)script/i,la={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};la.optgroup=la.option,la.tbody=la.tfoot=la.colgroup=la.caption=la.thead,la.th=la.td;function ma(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&r.nodeName(a,b)?r.merge([a],c):c}function na(a,b){for(var c=0,d=a.length;c<d;c++)V.set(a[c],"globalEval",!b||V.get(b[c],"globalEval"))}var oa=/<|&#?\w+;/;function pa(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],n=0,o=a.length;n<o;n++)if(f=a[n],f||0===f)if("object"===r.type(f))r.merge(m,f.nodeType?[f]:f);else if(oa.test(f)){g=g||l.appendChild(b.createElement("div")),h=(ja.exec(f)||["",""])[1].toLowerCase(),i=la[h]||la._default,g.innerHTML=i[1]+r.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;r.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",n=0;while(f=m[n++])if(d&&r.inArray(f,d)>-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=ma(l.appendChild(f),"script"),j&&na(g),c){k=0;while(f=g[k++])ka.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var qa=d.documentElement,ra=/^key/,sa=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ta=/^([^.]*)(?:\.(.+)|)/;function ua(){return!0}function va(){return!1}function wa(){try{return d.activeElement}catch(a){}}function xa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)xa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=va;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(qa,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(K)||[""],j=b.length;while(j--)h=ta.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.hasData(a)&&V.get(a);if(q&&(i=q.events)){b=(b||"").match(K)||[""],j=b.length;while(j--)if(h=ta.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&V.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(V.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c<arguments.length;c++)i[c]=arguments[c];if(b.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,b)!==!1){h=r.event.handlers.call(this,b,j),c=0;while((f=h[c++])&&!b.isPropagationStopped()){b.currentTarget=f.elem,d=0;while((g=f.handlers[d++])&&!b.isImmediatePropagationStopped())b.rnamespace&&!b.rnamespace.test(g.namespace)||(b.handleObj=g,b.data=g.data,e=((r.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(b.result=e)===!1&&(b.preventDefault(),b.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,b),b.result}},handlers:function(a,b){var c,d,e,f,g,h=[],i=b.delegateCount,j=a.target;if(i&&j.nodeType&&!("click"===a.type&&a.button>=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c<i;c++)d=b[c],e=d.selector+" ",void 0===g[e]&&(g[e]=d.needsContext?r(e,this).index(j)>-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i<b.length&&h.push({elem:j,handlers:b.slice(i)}),h},addProp:function(a,b){Object.defineProperty(r.Event.prototype,a,{enumerable:!0,configurable:!0,get:r.isFunction(b)?function(){if(this.originalEvent)return b(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[a]},set:function(b){Object.defineProperty(this,a,{enumerable:!0,configurable:!0,writable:!0,value:b})}})},fix:function(a){return a[r.expando]?a:new r.Event(a)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==wa()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===wa()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&r.nodeName(this,"input"))return this.click(),!1},_default:function(a){return r.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},r.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},r.Event=function(a,b){return this instanceof r.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ua:va,this.target=a.target&&3===a.target.nodeType?a.target.parentNode:a.target,this.currentTarget=a.currentTarget,this.relatedTarget=a.relatedTarget):this.type=a,b&&r.extend(this,b),this.timeStamp=a&&a.timeStamp||r.now(),void(this[r.expando]=!0)):new r.Event(a,b)},r.Event.prototype={constructor:r.Event,isDefaultPrevented:va,isPropagationStopped:va,isImmediatePropagationStopped:va,isSimulated:!1,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ua,a&&!this.isSimulated&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ua,a&&!this.isSimulated&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ua,a&&!this.isSimulated&&a.stopImmediatePropagation(),this.stopPropagation()}},r.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(a){var b=a.button;return null==a.which&&ra.test(a.type)?null!=a.charCode?a.charCode:a.keyCode:!a.which&&void 0!==b&&sa.test(a.type)?1&b?1:2&b?3:4&b?2:0:a.which}},r.event.addProp),r.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){r.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||r.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),r.fn.extend({on:function(a,b,c,d){return xa(this,a,b,c,d)},one:function(a,b,c,d){return xa(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,r(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=va),this.each(function(){r.event.remove(this,a,c,b)})}});var ya=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,za=/<script|<style|<link/i,Aa=/checked\s*(?:[^=]|=\s*.checked.)/i,Ba=/^true\/(.*)/,Ca=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Da(a,b){return r.nodeName(a,"table")&&r.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a:a}function Ea(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Fa(a){var b=Ba.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ga(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(V.hasData(a)&&(f=V.access(a),g=V.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c<d;c++)r.event.add(b,e,j[e][c])}W.hasData(a)&&(h=W.access(a),i=r.extend({},h),W.set(b,i))}}function Ha(a,b){var c=b.nodeName.toLowerCase();"input"===c&&ia.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function Ia(a,b,c,d){b=g.apply([],b);var e,f,h,i,j,k,l=0,m=a.length,n=m-1,q=b[0],s=r.isFunction(q);if(s||m>1&&"string"==typeof q&&!o.checkClone&&Aa.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ia(f,b,c,d)});if(m&&(e=pa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(ma(e,"script"),Ea),i=h.length;l<m;l++)j=e,l!==n&&(j=r.clone(j,!0,!0),i&&r.merge(h,ma(j,"script"))),c.call(a[l],j,l);if(i)for(k=h[h.length-1].ownerDocument,r.map(h,Fa),l=0;l<i;l++)j=h[l],ka.test(j.type||"")&&!V.access(j,"globalEval")&&r.contains(k,j)&&(j.src?r._evalUrl&&r._evalUrl(j.src):p(j.textContent.replace(Ca,""),k))}return a}function Ja(a,b,c){for(var d,e=b?r.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||r.cleanData(ma(d)),d.parentNode&&(c&&r.contains(d.ownerDocument,d)&&na(ma(d,"script")),d.parentNode.removeChild(d));return a}r.extend({htmlPrefilter:function(a){return a.replace(ya,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=ma(h),f=ma(a),d=0,e=f.length;d<e;d++)Ha(f[d],g[d]);if(b)if(c)for(f=f||ma(a),g=g||ma(h),d=0,e=f.length;d<e;d++)Ga(f[d],g[d]);else Ga(a,h);return g=ma(h,"script"),g.length>0&&na(g,!i&&ma(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(T(c)){if(b=c[V.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[V.expando]=void 0}c[W.expando]&&(c[W.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ja(this,a,!0)},remove:function(a){return Ja(this,a)},text:function(a){return S(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ia(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Da(this,a);b.appendChild(a)}})},prepend:function(){return Ia(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Da(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ia(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ia(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(ma(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return S(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!za.test(a)&&!la[(ja.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c<d;c++)b=this[c]||{},1===b.nodeType&&(r.cleanData(ma(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ia(this,arguments,function(b){var c=this.parentNode;r.inArray(this,a)<0&&(r.cleanData(ma(this)),c&&c.replaceChild(b,this))},a)}}),r.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){r.fn[a]=function(a){for(var c,d=[],e=r(a),f=e.length-1,g=0;g<=f;g++)c=g===f?this:this.clone(!0),r(e[g])[b](c),h.apply(d,c.get());return this.pushStack(d)}});var Ka=/^margin/,La=new RegExp("^("+_+")(?!px)[a-z%]+$","i"),Ma=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)};!function(){function b(){if(i){i.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",i.innerHTML="",qa.appendChild(h);var b=a.getComputedStyle(i);c="1%"!==b.top,g="2px"===b.marginLeft,e="4px"===b.width,i.style.marginRight="50%",f="4px"===b.marginRight,qa.removeChild(h),i=null}}var c,e,f,g,h=d.createElement("div"),i=d.createElement("div");i.style&&(i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",o.clearCloneStyle="content-box"===i.style.backgroundClip,h.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",h.appendChild(i),r.extend(o,{pixelPosition:function(){return b(),c},boxSizingReliable:function(){return b(),e},pixelMarginRight:function(){return b(),f},reliableMarginLeft:function(){return b(),g}}))}();function Na(a,b,c){var d,e,f,g,h=a.style;return c=c||Ma(a),c&&(g=c.getPropertyValue(b)||c[b],""!==g||r.contains(a.ownerDocument,a)||(g=r.style(a,b)),!o.pixelMarginRight()&&La.test(g)&&Ka.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function Oa(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Pa=/^(none|table(?!-c[ea]).+)/,Qa={position:"absolute",visibility:"hidden",display:"block"},Ra={letterSpacing:"0",fontWeight:"400"},Sa=["Webkit","Moz","ms"],Ta=d.createElement("div").style;function Ua(a){if(a in Ta)return a;var b=a[0].toUpperCase()+a.slice(1),c=Sa.length;while(c--)if(a=Sa[c]+b,a in Ta)return a}function Va(a,b,c){var d=aa.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Wa(a,b,c,d,e){var f,g=0;for(f=c===(d?"border":"content")?4:"width"===b?1:0;f<4;f+=2)"margin"===c&&(g+=r.css(a,c+ba[f],!0,e)),d?("content"===c&&(g-=r.css(a,"padding"+ba[f],!0,e)),"margin"!==c&&(g-=r.css(a,"border"+ba[f]+"Width",!0,e))):(g+=r.css(a,"padding"+ba[f],!0,e),"padding"!==c&&(g+=r.css(a,"border"+ba[f]+"Width",!0,e)));return g}function Xa(a,b,c){var d,e=!0,f=Ma(a),g="border-box"===r.css(a,"boxSizing",!1,f);if(a.getClientRects().length&&(d=a.getBoundingClientRect()[b]),d<=0||null==d){if(d=Na(a,b,f),(d<0||null==d)&&(d=a.style[b]),La.test(d))return d;e=g&&(o.boxSizingReliable()||d===a.style[b]),d=parseFloat(d)||0}return d+Wa(a,b,c||(g?"border":"content"),e,f)+"px"}r.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Na(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=r.camelCase(b),i=a.style;return b=r.cssProps[h]||(r.cssProps[h]=Ua(h)||h),g=r.cssHooks[b]||r.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=aa.exec(c))&&e[1]&&(c=ea(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(r.cssNumber[h]?"":"px")),o.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=r.camelCase(b);return b=r.cssProps[h]||(r.cssProps[h]=Ua(h)||h),g=r.cssHooks[b]||r.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Na(a,b,d)),"normal"===e&&b in Ra&&(e=Ra[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),r.each(["height","width"],function(a,b){r.cssHooks[b]={get:function(a,c,d){if(c)return!Pa.test(r.css(a,"display"))||a.getClientRects().length&&a.getBoundingClientRect().width?Xa(a,b,d):da(a,Qa,function(){return Xa(a,b,d)})},set:function(a,c,d){var e,f=d&&Ma(a),g=d&&Wa(a,b,d,"border-box"===r.css(a,"boxSizing",!1,f),f);return g&&(e=aa.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=r.css(a,b)),Va(a,c,g)}}}),r.cssHooks.marginLeft=Oa(o.reliableMarginLeft,function(a,b){if(b)return(parseFloat(Na(a,"marginLeft"))||a.getBoundingClientRect().left-da(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px"}),r.each({margin:"",padding:"",border:"Width"},function(a,b){r.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];d<4;d++)e[a+ba[d]+b]=f[d]||f[d-2]||f[0];return e}},Ka.test(a)||(r.cssHooks[a+b].set=Va)}),r.fn.extend({css:function(a,b){return S(this,function(a,b,c){var d,e,f={},g=0;if(r.isArray(b)){for(d=Ma(a),e=b.length;g<e;g++)f[b[g]]=r.css(a,b[g],!1,d);return f}return void 0!==c?r.style(a,b,c):r.css(a,b)},a,b,arguments.length>1)}});function Ya(a,b,c,d,e){return new Ya.prototype.init(a,b,c,d,e)}r.Tween=Ya,Ya.prototype={constructor:Ya,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=Ya.propHooks[this.prop];return a&&a.get?a.get(this):Ya.propHooks._default.get(this)},run:function(a){var b,c=Ya.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ya.propHooks._default.set(this),this}},Ya.prototype.init.prototype=Ya.prototype,Ya.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},Ya.propHooks.scrollTop=Ya.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=Ya.prototype.init,r.fx.step={};var Za,$a,_a=/^(?:toggle|show|hide)$/,ab=/queueHooks$/;function bb(){$a&&(a.requestAnimationFrame(bb),r.fx.tick())}function cb(){return a.setTimeout(function(){Za=void 0}),Za=r.now()}function db(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=ba[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function eb(a,b,c){for(var d,e=(hb.tweeners[b]||[]).concat(hb.tweeners["*"]),f=0,g=e.length;f<g;f++)if(d=e[f].call(c,b,a))return d}function fb(a,b,c){var d,e,f,g,h,i,j,k,l="width"in b||"height"in b,m=this,n={},o=a.style,p=a.nodeType&&ca(a),q=V.get(a,"fxshow");c.queue||(g=r._queueHooks(a,"fx"),null==g.unqueued&&(g.unqueued=0,h=g.empty.fire,g.empty.fire=function(){g.unqueued||h()}),g.unqueued++,m.always(function(){m.always(function(){g.unqueued--,r.queue(a,"fx").length||g.empty.fire()})}));for(d in b)if(e=b[d],_a.test(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}n[d]=q&&q[d]||r.style(a,d)}if(i=!r.isEmptyObject(b),i||!r.isEmptyObject(n)){l&&1===a.nodeType&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=q&&q.display,null==j&&(j=V.get(a,"display")),k=r.css(a,"display"),"none"===k&&(j?k=j:(ha([a],!0),j=a.style.display||j,k=r.css(a,"display"),ha([a]))),("inline"===k||"inline-block"===k&&null!=j)&&"none"===r.css(a,"float")&&(i||(m.done(function(){o.display=j}),null==j&&(k=o.display,j="none"===k?"":k)),o.display="inline-block")),c.overflow&&(o.overflow="hidden",m.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]})),i=!1;for(d in n)i||(q?"hidden"in q&&(p=q.hidden):q=V.access(a,"fxshow",{display:j}),f&&(q.hidden=!p),p&&ha([a],!0),m.done(function(){p||ha([a]),V.remove(a,"fxshow");for(d in n)r.style(a,d,n[d])})),i=eb(p?q[d]:0,d,m),d in q||(q[d]=i.start,p&&(i.end=i.start,i.start=0))}}function gb(a,b){var c,d,e,f,g;for(c in a)if(d=r.camelCase(c),e=b[d],f=a[c],r.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=r.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function hb(a,b,c){var d,e,f=0,g=hb.prefilters.length,h=r.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Za||cb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;g<i;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),f<1&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:r.extend({},b),opts:r.extend(!0,{specialEasing:{},easing:r.easing._default},c),originalProperties:b,originalOptions:c,startTime:Za||cb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=r.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;c<d;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(gb(k,j.opts.specialEasing);f<g;f++)if(d=hb.prefilters[f].call(j,a,k,j.opts))return r.isFunction(d.stop)&&(r._queueHooks(j.elem,j.opts.queue).stop=r.proxy(d.stop,d)),d;return r.map(k,eb,j),r.isFunction(j.opts.start)&&j.opts.start.call(a,j),r.fx.timer(r.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}r.Animation=r.extend(hb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return ea(c.elem,a,aa.exec(b),c),c}]},tweener:function(a,b){r.isFunction(a)?(b=a,a=["*"]):a=a.match(K);for(var c,d=0,e=a.length;d<e;d++)c=a[d],hb.tweeners[c]=hb.tweeners[c]||[],hb.tweeners[c].unshift(b)},prefilters:[fb],prefilter:function(a,b){b?hb.prefilters.unshift(a):hb.prefilters.push(a)}}),r.speed=function(a,b,c){var e=a&&"object"==typeof a?r.extend({},a):{complete:c||!c&&b||r.isFunction(a)&&a,duration:a,easing:c&&b||b&&!r.isFunction(b)&&b};return r.fx.off||d.hidden?e.duration=0:"number"!=typeof e.duration&&(e.duration in r.fx.speeds?e.duration=r.fx.speeds[e.duration]:e.duration=r.fx.speeds._default),null!=e.queue&&e.queue!==!0||(e.queue="fx"),e.old=e.complete,e.complete=function(){r.isFunction(e.old)&&e.old.call(this),e.queue&&r.dequeue(this,e.queue)},e},r.fn.extend({fadeTo:function(a,b,c,d){return this.filter(ca).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=r.isEmptyObject(a),f=r.speed(b,c,d),g=function(){var b=hb(this,r.extend({},a),f);(e||V.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=r.timers,g=V.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&ab.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||r.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=V.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=r.timers,g=d?d.length:0;for(c.finish=!0,r.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;b<g;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),r.each(["toggle","show","hide"],function(a,b){var c=r.fn[b];r.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(db(b,!0),a,d,e)}}),r.each({slideDown:db("show"),slideUp:db("hide"),slideToggle:db("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){r.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),r.timers=[],r.fx.tick=function(){var a,b=0,c=r.timers;for(Za=r.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||r.fx.stop(),Za=void 0},r.fx.timer=function(a){r.timers.push(a),a()?r.fx.start():r.timers.pop()},r.fx.interval=13,r.fx.start=function(){$a||($a=a.requestAnimationFrame?a.requestAnimationFrame(bb):a.setInterval(r.fx.tick,r.fx.interval))},r.fx.stop=function(){a.cancelAnimationFrame?a.cancelAnimationFrame($a):a.clearInterval($a),$a=null},r.fx.speeds={slow:600,fast:200,_default:400},r.fn.delay=function(b,c){return b=r.fx?r.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",o.checkOn=""!==a.value,o.optSelected=c.selected,a=d.createElement("input"),a.value="t",a.type="radio",o.radioValue="t"===a.value}();var ib,jb=r.expr.attrHandle;r.fn.extend({attr:function(a,b){return S(this,r.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?ib:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&r.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(K);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),ib={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=jb[b]||r.find.attr;jb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=jb[g],jb[g]=e,e=null!=c(a,b,d)?g:null,jb[g]=f),e}});var kb=/^(?:input|select|textarea|button)$/i,lb=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return S(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):kb.test(a.nodeName)||lb.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function mb(a){var b=a.match(K)||[];return b.join(" ")}function nb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,nb(this)))});if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=nb(c),d=1===c.nodeType&&" "+mb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=mb(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,nb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=nb(c),d=1===c.nodeType&&" "+mb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=mb(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,nb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(K)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=nb(this),b&&V.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":V.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+mb(nb(c))+" ").indexOf(b)>-1)return!0;return!1}});var ob=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":r.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(ob,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:mb(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d<i;d++)if(c=e[d],(c.selected||d===f)&&!c.disabled&&(!c.parentNode.disabled||!r.nodeName(c.parentNode,"optgroup"))){if(b=r(c).val(),g)return b;h.push(b)}return h},set:function(a,b){var c,d,e=a.options,f=r.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=r.inArray(r.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(r.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var pb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!pb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,pb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(V.get(h,"events")||{})[b.type]&&V.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&T(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!T(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=V.access(d,b);e||d.addEventListener(a,c,!0),V.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=V.access(d,b)-1;e?V.access(d,b,e):(d.removeEventListener(a,c,!0),V.remove(d,b))}}});var qb=a.location,rb=r.now(),sb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var tb=/\[\]$/,ub=/\r?\n/g,vb=/^(?:submit|button|image|reset|file)$/i,wb=/^(?:input|select|textarea|keygen)/i;function xb(a,b,c,d){var e;if(r.isArray(b))r.each(b,function(b,e){c||tb.test(a)?d(a,e):xb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)xb(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(r.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)xb(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&wb.test(this.nodeName)&&!vb.test(a)&&(this.checked||!ia.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:r.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(ub,"\r\n")}}):{name:b.name,value:c.replace(ub,"\r\n")}}).get()}});var yb=/%20/g,zb=/#.*$/,Ab=/([?&])_=[^&]*/,Bb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Cb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Db=/^(?:GET|HEAD)$/,Eb=/^\/\//,Fb={},Gb={},Hb="*/".concat("*"),Ib=d.createElement("a");Ib.href=qb.href;function Jb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(K)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Kb(a,b,c,d){var e={},f=a===Gb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Lb(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Mb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Nb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:qb.href,type:"GET",isLocal:Cb.test(qb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Hb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Lb(Lb(a,r.ajaxSettings),b):Lb(r.ajaxSettings,a)},ajaxPrefilter:Jb(Fb),ajaxTransport:Jb(Gb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Bb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||qb.href)+"").replace(Eb,qb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(K)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Ib.protocol+"//"+Ib.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Kb(Fb,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Db.test(o.type),f=o.url.replace(zb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(yb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(sb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Ab,"$1"),n=(sb.test(f)?"&":"?")+"_="+rb++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Hb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Kb(Gb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Mb(o,y,d)),v=Nb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Ob={0:200,1223:204},Pb=r.ajaxSettings.xhr();o.cors=!!Pb&&"withCredentials"in Pb,o.ajax=Pb=!!Pb,r.ajaxTransport(function(b){var c,d;if(o.cors||Pb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Ob[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Qb=[],Rb=/(=)\?(?=&|$)|\?\?/;r.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Qb.pop()||r.expando+"_"+rb++;return this[a]=!0,a}}),r.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Rb.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Rb.test(b.data)&&"data");if(h||"jsonp"===b.dataTypes[0])return e=b.jsonpCallback=r.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Rb,"$1"+e):b.jsonp!==!1&&(b.url+=(sb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||r.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?r(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Qb.push(e)),g&&r.isFunction(f)&&f(g[0]),g=f=void 0}),"script"}),o.createHTMLDocument=function(){var a=d.implementation.createHTMLDocument("").body;return a.innerHTML="<form></form><form></form>",2===a.childNodes.length}(),r.parseHTML=function(a,b,c){if("string"!=typeof a)return[];"boolean"==typeof b&&(c=b,b=!1);var e,f,g;return b||(o.createHTMLDocument?(b=d.implementation.createHTMLDocument(""),e=b.createElement("base"),e.href=d.location.href,b.head.appendChild(e)):b=d),f=B.exec(a),g=!c&&[],f?[b.createElement(f[1])]:(f=pa([a],b,g),g&&g.length&&r(g).remove(),r.merge([],f.childNodes))},r.fn.load=function(a,b,c){var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=mb(a.slice(h)),a=a.slice(0,h)),r.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&r.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?r("<div>").append(r.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},r.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){r.fn[b]=function(a){return this.on(b,a)}}),r.expr.pseudos.animated=function(a){return r.grep(r.timers,function(b){return a===b.elem}).length};function Sb(a){return r.isWindow(a)?a:9===a.nodeType&&a.defaultView}r.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=r.css(a,"position"),l=r(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=r.css(a,"top"),i=r.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),r.isFunction(b)&&(b=b.call(a,c,r.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},r.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){r.offset.setOffset(this,a,b)});var b,c,d,e,f=this[0];if(f)return f.getClientRects().length?(d=f.getBoundingClientRect(),d.width||d.height?(e=f.ownerDocument,c=Sb(e),b=e.documentElement,{top:d.top+c.pageYOffset-b.clientTop,left:d.left+c.pageXOffset-b.clientLeft}):d):{top:0,left:0}},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===r.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),r.nodeName(a[0],"html")||(d=a.offset()),d={top:d.top+r.css(a[0],"borderTopWidth",!0),left:d.left+r.css(a[0],"borderLeftWidth",!0)}),{top:b.top-d.top-r.css(c,"marginTop",!0),left:b.left-d.left-r.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===r.css(a,"position"))a=a.offsetParent;return a||qa})}}),r.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;r.fn[a]=function(d){return S(this,function(a,d,e){var f=Sb(a);return void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),r.each(["top","left"],function(a,b){r.cssHooks[b]=Oa(o.pixelPosition,function(a,c){if(c)return c=Na(a,b),La.test(c)?r(a).position()[b]+"px":c})}),r.each({Height:"height",Width:"width"},function(a,b){r.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){r.fn[d]=function(e,f){var g=arguments.length&&(c||"boolean"!=typeof e),h=c||(e===!0||f===!0?"margin":"border");return S(this,function(b,c,e){var f;return r.isWindow(b)?0===d.indexOf("outer")?b["inner"+a]:b.document.documentElement["client"+a]:9===b.nodeType?(f=b.documentElement,Math.max(b.body["scroll"+a],f["scroll"+a],b.body["offset"+a],f["offset"+a],f["client"+a])):void 0===e?r.css(b,c,h):r.style(b,c,e,h)},b,g?e:void 0,g)}})}),r.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),r.parseJSON=JSON.parse,"function"==typeof define&&define.amd&&define("jquery",[],function(){return r});var Tb=a.jQuery,Ub=a.$;return r.noConflict=function(b){return a.$===r&&(a.$=Ub),b&&a.jQuery===r&&(a.jQuery=Tb),r},b||(a.jQuery=a.$=r),r});
vendor: 4,956 bytes, lines 2-4
2
3/*! modernizr 3.3.1 (Custom Build) | MIT *
4* https://modernizr.com/download/?-applicationcache-audio-canvas-cssanimations-csscolumns-csstransforms-csstransforms3d-csstransitions-flexbox-flexboxlegacy-generatedcontent-geolocation-history-localstorage-multiplebgs-opacity-postmessage-rgba-sessionstorage-svg-textshadow-video-webgl-websockets-webworkers-domprefixes-prefixed-prefixes-printshiv-setclasses-testallprops-testprop-teststyles !*/!function(e,t,n){function r(e,t){return typeof e===t}function o(){var e,t,n,o,a,i,s;for(var c in b)if(b.hasOwnProperty(c)){if(e=[],t=b[c],t.name&&(e.push(t.name.toLowerCase()),t.options&&t.options.aliases&&t.options.aliases.length))for(n=0;n<t.options.aliases.length;n++)e.push(t.options.aliases[n].toLowerCase());for(o=r(t.fn,"function")?t.fn():t.fn,a=0;a<e.length;a++)i=e[a],s=i.split("."),1===s.length?Modernizr[s[0]]=o:(!Modernizr[s[0]]||Modernizr[s[0]]instanceof Boolean||(Modernizr[s[0]]=new Boolean(Modernizr[s[0]])),Modernizr[s[0]][s[1]]=o),y.push((o?"":"no-")+s.join("-"))}}function a(e){var t=C.className,n=Modernizr._config.classPrefix||"";if(E&&(t=t.baseVal),Modernizr._config.enableJSClass){var r=new RegExp("(^|\\s)"+n+"no-js(\\s|$)");t=t.replace(r,"$1"+n+"js$2")}Modernizr._config.enableClasses&&(t+=" "+n+e.join(" "+n),E?C.className.baseVal=t:C.className=t)}function i(e){return e.replace(/([a-z])-([a-z])/g,function(e,t,n){return t+n.toUpperCase()}).replace(/^-/,"")}function s(){return"function"!=typeof t.createElement?t.createElement(arguments[0]):E?t.createElementNS.call(t,"http://www.w3.org/2000/svg",arguments[0]):t.createElement.apply(t,arguments)}function c(e,t){return!!~(""+e).indexOf(t)}function l(){var e=t.body;return e||(e=s(E?"svg":"body"),e.fake=!0),e}function d(e,n,r,o){var a,i,c,d,u="modernizr",f=s("div"),p=l();if(parseInt(r,10))for(;r--;)c=s("div"),c.id=o?o[r]:u+(r+1),f.appendChild(c);return a=s("style"),a.type="text/css",a.id="s"+u,(p.fake?p:f).appendChild(a),p.appendChild(f),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(t.createTextNode(e)),f.id=u,p.fake&&(p.style.background="",p.style.overflow="hidden",d=C.style.overflow,C.style.overflow="hidden",C.appendChild(p)),i=n(f,e),p.fake?(p.parentNode.removeChild(p),C.style.overflow=d,C.offsetHeight):f.parentNode.removeChild(f),!!i}function u(e,t){return function(){return e.apply(t,arguments)}}function f(e,t,n){var o;for(var a in e)if(e[a]in t)return n===!1?e[a]:(o=t[e[a]],r(o,"function")?u(o,n||t):o);return!1}function p(e){return e.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()}).replace(/^ms-/,"-ms-")}function m(t,r){var o=t.length;if("CSS"in e&&"supports"in e.CSS){for(;o--;)if(e.CSS.supports(p(t[o]),r))return!0;return!1}if("CSSSupportsRule"in e){for(var a=[];o--;)a.push("("+p(t[o])+":"+r+")");return a=a.join(" or "),d("@supports ("+a+") { #modernizr { position: absolute; } }",function(e){return"absolute"==getComputedStyle(e,null).position})}return n}function h(e,t,o,a){function l(){u&&(delete A.style,delete A.modElem)}if(a=r(a,"undefined")?!1:a,!r(o,"undefined")){var d=m(e,o);if(!r(d,"undefined"))return d}for(var u,f,p,h,v,g=["modernizr","tspan","samp"];!A.style&&g.length;)u=!0,A.modElem=s(g.shift()),A.style=A.modElem.style;for(p=e.length,f=0;p>f;f++)if(h=e[f],v=A.style[h],c(h,"-")&&(h=i(h)),A.style[h]!==n){if(a||r(o,"undefined"))return l(),"pfx"==t?h:!0;try{A.style[h]=o}catch(y){}if(A.style[h]!=v)return l(),"pfx"==t?h:!0}return l(),!1}function v(e,t,n,o,a){var i=e.charAt(0).toUpperCase()+e.slice(1),s=(e+" "+$.join(i+" ")+i).split(" ");return r(t,"string")||r(t,"undefined")?h(s,t,o,a):(s=(e+" "+k.join(i+" ")+i).split(" "),f(s,t,n))}function g(e,t,r){return v(e,n,n,t,r)}var y=[],b=[],x={_version:"3.3.1",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var n=this;setTimeout(function(){t(n[e])},0)},addTest:function(e,t,n){b.push({name:e,fn:t,options:n})},addAsyncTest:function(e){b.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=x,Modernizr=new Modernizr,Modernizr.addTest("applicationcache","applicationCache"in e),Modernizr.addTest("geolocation","geolocation"in navigator),Modernizr.addTest("postmessage","postMessage"in e),Modernizr.addTest("history",function(){var t=navigator.userAgent;return-1===t.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone")?e.history&&"pushState"in e.history:!1}),Modernizr.addTest("svg",!!t.createElementNS&&!!t.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect);var T=!1;try{T="WebSocket"in e&&2===e.WebSocket.CLOSING}catch(S){}Modernizr.addTest("websockets",T),Modernizr.addTest("localstorage",function(){var e="modernizr";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(t){return!1}}),Modernizr.addTest("sessionstorage",function(){var e="modernizr";try{return sessionStorage.setItem(e,e),sessionStorage.removeItem(e),!0}catch(t){return!1}}
4),Modernizr.addTest("webworkers","Worker"in e);var w=x._config.usePrefixes?" -webkit- -moz- -o- -ms- ".split(" "):["",""];x._prefixes=w;var C=t.documentElement,E="svg"===C.nodeName.toLowerCase();E||!function(e,t){function n(e,t){var n=e.createElement("p"),r=e.getElementsByTagName("head")[0]||e.documentElement;return n.innerHTML="x<style>"+t+"</style>",r.insertBefore(n.lastChild,r.firstChild)}function r(){var e=C.elements;return"string"==typeof e?e.split(" "):e}function o(e,t){var n=C.elements;"string"!=typeof n&&(n=n.join(" ")),"string"!=typeof e&&(e=e.join(" ")),C.elements=n+" "+e,l(t)}function a(e){var t=w[e[T]];return t||(t={},S++,e[T]=S,w[S]=t),t}function i(e,n,r){if(n||(n=t),v)return n.createElement(e);r||(r=a(n));var o;return o=r.cache[e]?r.cache[e].cloneNode():x.test(e)?(r.cache[e]=r.createElem(e)).cloneNode():r.createElem(e),!o.canHaveChildren||b.test(e)||o.tagUrn?o:r.frag.appendChild(o)}function s(e,n){if(e||(e=t),v)return e.createDocumentFragment();n=n||a(e);for(var o=n.frag.cloneNode(),i=0,s=r(),c=s.length;c>i;i++)o.createElement(s[i]);return o}function c(e,t){t.cache||(t.cache={},t.createElem=e.createElement,t.createFrag=e.createDocumentFragment,t.frag=t.createFrag()),e.createElement=function(n){return C.shivMethods?i(n,e,t):t.createElem(n)},e.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+r().join().replace(/[\w\-:]+/g,function(e){return t.createElem(e),t.frag.createElement(e),'c("'+e+'")'})+");return n}")(C,t.frag)}function l(e){e||(e=t);var r=a(e);return!C.shivCSS||h||r.hasCSS||(r.hasCSS=!!n(e,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),v||c(e,r),e}function d(e){for(var t,n=e.getElementsByTagName("*"),o=n.length,a=RegExp("^(?:"+r().join("|")+")$","i"),i=[];o--;)t=n[o],a.test(t.nodeName)&&i.push(t.applyElement(u(t)));return i}function u(e){for(var t,n=e.attributes,r=n.length,o=e.ownerDocument.createElement(P+":"+e.nodeName);r--;)t=n[r],t.specified&&o.setAttribute(t.nodeName,t.nodeValue);return o.style.cssText=e.style.cssText,o}function f(e){for(var t,n=e.split("{"),o=n.length,a=RegExp("(^|[\\s,>+~])("+r().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),i="$1"+P+"\\:$2";o--;)t=n[o]=n[o].split("}"),t[t.length-1]=t[t.length-1].replace(a,i),n[o]=t.join("}");return n.join("{")}function p(e){for(var t=e.length;t--;)e[t].removeNode()}function m(e){function t(){clearTimeout(i._removeSheetTimer),r&&r.removeNode(!0),r=null}var r,o,i=a(e),s=e.namespaces,c=e.parentWindow;return!k||e.printShived?e:("undefined"==typeof s[P]&&s.add(P),c.attachEvent("onbeforeprint",function(){t();for(var a,i,s,c=e.styleSheets,l=[],u=c.length,p=Array(u);u--;)p[u]=c[u];for(;s=p.pop();)if(!s.disabled&&E.test(s.media)){try{a=s.imports,i=a.length}catch(m){i=0}for(u=0;i>u;u++)p.push(a[u]);try{l.push(s.cssText)}catch(m){}}l=f(l.reverse().join("")),o=d(e),r=n(e,l)}),c.attachEvent("onafterprint",function(){p(o),clearTimeout(i._removeSheetTimer),i._removeSheetTimer=setTimeout(t,500)}),e.printShived=!0,e)}var h,v,g="3.7.3",y=e.html5||{},b=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,x=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,T="_html5shiv",S=0,w={};!function(){try{var e=t.createElement("a");e.innerHTML="<xyz></xyz>",h="hidden"in e,v=1==e.childNodes.length||function(){t.createElement("a");var e=t.createDocumentFragment();return"undefined"==typeof e.cloneNode||"undefined"==typeof e.createDocumentFragment||"undefined"==typeof e.createElement}()}catch(n){h=!0,v=!0}}();var C={elements:y.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:g,shivCSS:y.shivCSS!==!1,supportsUnknownElements:v,shivMethods:y.shivMethods!==!1,type:"default",shivDocument:l,createElement:i,createDocumentFragment:s,addElements:o};e.html5=C,l(t);var E=/^$|\b(?:all|print)\b/,P="html5shiv",k=!v&&function(){var n=t.documentElement;return!("undefined"==typeof t.namespaces||"undefined"==typeof t.parentWindow||"undefined"==typeof n.applyElement||"undefined"==typeof n.removeNode||"undefined"==typeof e.attachEvent)}();C.type+=" print",C.shivPrint=m,m(t),"object"==typeof module&&module.exports&&(module.exports=C)}("undefined"!=typeof e?e:this,t);var P="Moz O ms Webkit",k=x._config.usePrefixes?P.toLowerCase().split(" "):[];x._domPrefixes=k,Modernizr.addTest("audio",function(){var e=s("audio"),t=!1;try{(t=!!e.canPlayType)&&(t=new Boolean(t),t.ogg=e.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),t.mp3=e.canPlayType('audio/mpeg; codecs="mp3"').replace(/^no$/,""),t.opus=e.canPlayType('audio/ogg; codecs="opus"')||e.canPlayType('audio/webm; codecs="opus"').replace(/^no$/,""),t.wav=e.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),t.m4a=(e.canPlayType("audio/x-m4a;")||e.canPlayType("audio/aac;")).replace(/^no$/,""))}catch(n){}return t}),Modernizr.addTest("canvas",function(){var e=s("canvas");return!(!e.getContext||!e.getContext("2d"))}),Modernizr.addTest("video",function(){var e=s("video"),t=!1;try{(t=!!e.canPlayType)&&(t=new Boolean(t),t.ogg=e.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),t.h264=e.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),t.webm=e.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,""),t.vp9=e.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,""),t.hls=e.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/,""))}catch(n){}return t}),Modernizr.addTest("webgl",function(){var t=s("canvas"),n="probablySupportsContext"in t?"probablySupportsContext":"supportsContext";return n in t?t[n]("webgl")||t[n]("experimental-webgl"):"WebGLRenderingContext"in e}),Modernizr.addTest("opacity",function(){var e=s("a").style;return e.cssText=w.join("opacity:.55;"),/^0.55$/.test(e.opacity)}),Modernizr.addTest("multiplebgs",function(){var e=s("a").style;return e.cssText="background:url(https://),url(https://),red url(https://)",/(url\s*\(.*?){3}/.test(e.background)}),Modernizr.addTest("rgba",function(){var e=s("a").style;return e.cssText="background-color:rgba(150,255,150,.5)",(""+e.backgroundColor).indexOf("rgba")>-1});var _="CSS"in e&&"supports"in e.CSS,N="supportsCSS"in e;Modernizr.addTest("supports",_||N);var $=x._config.usePrefixes?P.split(" "):[];x._cssomPrefixes=$;var j=function(t){var r,o=w.length,a=e.CSSRule;if("undefined"==typeof a)return n;if(!t)return!1;if(t=t.replace(/^@/,""),r=t.replace(/-/g,"_").toUpperCase()+"_RULE",r in a)return"@"+t;for(var i=0;o>i;i++){var s=w[i],c=s.toUpperCase()+"_"+r;if(c in a)return"@-"+s.toLowerCase()+"-"+t}return!1};x.atRule=j;var z=x.testStyles=d;z('#modernizr{font:0/0 a}#modernizr:after{content:":)";visibility:hidden;font:7px/1 a}',function(e){Modernizr.addTest("generatedcontent",e.offsetHeight>=7)});var R={elem:s("modernizr")};Modernizr._q.push(function(){delete R.elem});var A={style:R.elem.style};Modernizr._q.unshift(function(){delete A.style});var O=x.testProp=function(e,t,r){return h([e],n,t,r)};Modernizr.addTest("textshadow",O("textShadow","1px 1px")),x.testAllProps=v;x.prefixed=function(e,t,n){return 0===e.indexOf("@")?j(e):(-1!=e.indexOf("-")&&(e=i(e)),t?v(e,t,n):v(e,"pfx"))};x.testAllProps=g,Modernizr.addTest("cssanimations",g("animationName","a",!0)),function(){Modernizr.addTest("csscolumns",function(){var e=!1,t=g("columnCount");try{(e=!!t)&&(e=new Boolean(e))}catch(n){}return e});for(var e,t,n=["Width","Span","Fill","Gap","Rule","RuleColor","RuleStyle","RuleWidth","BreakBefore","BreakAfter","BreakInside"],r=0;r<n.length;r++)e=n[r].toLowerCase(),t=g("column"+n[r]),("breakbefore"===e||"breakafter"===e||"breakinside"==e)&&(t=t||g(n[r])),Modernizr.addTest("csscolumns."+e,t)}(),Modernizr.addTest("flexbox",g("flexBasis","1px",!0)),Modernizr.addTest("flexboxlegacy",g("boxDirection","reverse",!0)),Modernizr.addTest("csstransforms",function(){return-1===navigator.userAgent.indexOf("Android 2.")&&g("transform","scale(1)",!0)}),Modernizr.addTest("csstransforms3d",function(){var e=!!g("perspective","1px",!0),t=Modernizr._config.usePrefixes;if(e&&(!t||"webkitPerspective"in C.style)){var n,r="#modernizr{width:0;height:0}";Modernizr.supports?n="@supports (perspective: 1px)":(n="@media (transform-3d)",t&&(n+=",(-webkit-transform-3d)")),n+="{#modernizr{width:7px;height:18px;margin:0;padding:0;border:0}}",z(r+n,function(t){e=7===t.offsetWidth&&18===t.offsetHeight})}return e}),Modernizr.addTest("csstransitions",g("transition","all",!0)),o(),a(y),delete x.addTest,delete x.addAsyncTest;for(var B=0;B<Modernizr._q.length;B++)Modernizr._q[B]();e.Modernizr=Modernizr}(window,document);
5(function(){function n(n){function t(t,r,e,u,i,o){for(;i>=0&&o>i;i+=n){var a=u?u[i]:i;e=r(e,t[a],a,t)}return e}return function(r,e,u,i){e=b(e,i,4);var o=!k(r)&&m.keys(r),a=(o||r).length,c=n>0?0:a-1;return arguments.length<3&&(u=r[o?o[c]:c],c+=n),t(r,e,u,o,c,a)}}function t(n){return function(t,r,e){r=x(r,e);for(var u=O(t),i=n>0?0:u-1;i>=0&&u>i;i+=n)if(r(t[i],i,t))return i;return-1}}function r(n,t,r){return function(e,u,i){var o=0,a=O(e);
5if("number"==typeof i)n>0?o=i>=0?i:Math.max(i+a,o):a=i>=0?Math.min(i+1,a):i+a+1;else if(r&&i&&a)return i=r(e,u),e[i]===u?i:-1;if(u!==u)return i=t(l.call(e,o,a),m.isNaN),i>=0?i+o:-1;for(i=n>0?o:a-1;i>=0&&a>i;i+=n)if(e[i]===u)return i;return-1}}function e(n,t){var r=I.length,e=n.constructor,u=m.isFunction(e)&&e.prototype||a,i="constructor";for(m.has(n,i)&&!m.contains(t,i)&&t.push(i);r--;)i=I[r],i in n&&n[i]!==u[i]&&!m.contains(t,i)&&t.push(i)}var u=this,i=u._,o=Array.prototype,a=Object.prototype,c=Function.prototype,f=o.push,l=o.slice,s=a.toString,p=a.hasOwnProperty,h=Array.isArray,v=Object.keys,g=c.bind,y=Object.create,d=function(){},m=function(n){return n instanceof m?n:this instanceof m?void(this._wrapped=n):new m(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=m),exports._=m):u._=m,m.VERSION="1.8.3";var b=function(n,t,r){if(t===void 0)return n;switch(null==r?3:r){case 1:return function(r){return n.call(t,r)};case 2:return function(r,e){return n.call(t,r,e)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,i){return n.call(t,r,e,u,i)}}return function(){return n.apply(t,arguments)}},x=function(n,t,r){return null==n?m.identity:m.isFunction(n)?b(n,t,r):m.isObject(n)?m.matcher(n):m.property(n)};m.iteratee=function(n,t){return x(n,t,1/0)};var _=function(n,t){return function(r){var e=arguments.length;if(2>e||null==r)return r;for(var u=1;e>u;u++)for(var i=arguments[u],o=n(i),a=o.length,c=0;a>c;c++){var f=o[c];t&&r[f]!==void 0||(r[f]=i[f])}return r}},j=function(n){if(!m.isObject(n))return{};if(y)return y(n);d.prototype=n;var t=new d;return d.prototype=null,t},w=function(n){return function(t){return null==t?void 0:t[n]}},A=Math.pow(2,53)-1,O=w("length"),k=function(n){var t=O(n);return"number"==typeof t&&t>=0&&A>=t};m.each=m.forEach=function(n,t,r){t=b(t,r);var e,u;if(k(n))for(e=0,u=n.length;u>e;e++)t(n[e],e,n);else{var i=m.keys(n);for(e=0,u=i.length;u>e;e++)t(n[i[e]],i[e],n)}return n},m.map=m.collect=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=Array(u),o=0;u>o;o++){var a=e?e[o]:o;i[o]=t(n[a],a,n)}return i},m.reduce=m.foldl=m.inject=n(1),m.reduceRight=m.foldr=n(-1),m.find=m.detect=function(n,t,r){var e;return e=k(n)?m.findIndex(n,t,r):m.findKey(n,t,r),e!==void 0&&e!==-1?n[e]:void 0},m.filter=m.select=function(n,t,r){var e=[];return t=x(t,r),m.each(n,function(n,r,u){t(n,r,u)&&e.push(n)}),e},m.reject=function(n,t,r){return m.filter(n,m.negate(x(t)),r)},m.every=m.all=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(!t(n[o],o,n))return!1}return!0},m.some=m.any=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(t(n[o],o,n))return!0}return!1},m.contains=m.includes=m.include=function(n,t,r,e){return k(n)||(n=m.values(n)),("number"!=typeof r||e)&&(r=0),m.indexOf(n,t,r)>=0},m.invoke=function(n,t){var r=l.call(arguments,2),e=m.isFunction(t);return m.map(n,function(n){var u=e?t:n[t];return null==u?u:u.apply(n,r)})},m.pluck=function(n,t){return m.map(n,m.property(t))},m.where=function(n,t){return m.filter(n,m.matcher(t))},m.findWhere=function(n,t){return m.find(n,m.matcher(t))},m.max=function(n,t,r){var e,u,i=-1/0,o=-1/0;if(null==t&&null!=n){n=k(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],e>i&&(i=e)}else t=x(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(u>o||u===-1/0&&i===-1/0)&&(i=n,o=u)});return i},m.min=function(n,t,r){var e,u,i=1/0,o=1/0;if(null==t&&null!=n){n=k(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],i>e&&(i=e)}else t=x(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(o>u||1/0===u&&1/0===i)&&(i=n,o=u)});return i},m.shuffle=function(n){for(var t,r=k(n)?n:m.values(n),e=r.length,u=Array(e),i=0;e>i;i++)t=m.random(0,i),t!==i&&(u[i]=u[t]),u[t]=r[i];return u},m.sample=function(n,t,r){return null==t||r?(k(n)||(n=m.values(n)),n[m.random(n.length-1)]):m.shuffle(n).slice(0,Math.max(0,t))},m.sortBy=function(n,t,r){return t=x(t,r),m.pluck(m.map(n,function(n,r,e){return{value:n,index:r,criteria:t(n,r,e)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={};return r=x(r,e),m.each(t,function(e,i){var o=r(e,i,t);n(u,e,o)}),u}};m.groupBy=F(function(n,t,r){m.has(n,r)?n[r].push(t):n[r]=[t]}),m.indexBy=F(function(n,t,r){n[r]=t}),m.countBy=F(function(n,t,r){m.has(n,r)?n[r]++:n[r]=1}),m.toArray=function(n){return n?m.isArray(n)?l.call(n):k(n)?m.map(n,m.identity):m.values(n):[]},m.size=function(n){return null==n?0:k(n)?n.length:m.keys(n).length},m.partition=function(n,t,r){t=x(t,r);var e=[],u=[];return m.each(n,function(n,r,i){(t(n,r,i)?e:u).push(n)}),[e,u]},m.first=m.head=m.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:m.initial(n,n.length-t)},m.initial=function(n,t,r){return l.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))},m.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:m.rest(n,Math.max(0,n.length-t))},m.rest=m.tail=m.drop=function(n,t,r){return l.call(n,null==t||r?1:t)},m.compact=function(n){return m.filter(n,m.identity)};var S=function(n,t,r,e){for(var u=[],i=0,o=e||0,a=O(n);a>o;o++){var c=n[o];if(k(c)&&(m.isArray(c)||m.isArguments(c))){t||(c=S(c,t,r));var f=0,l=c.length;for(u.length+=l;l>f;
5)u[i++]=c[f++]}else r||(u[i++]=c)}return u};m.flatten=function(n,t){return S(n,t,!1)},m.without=function(n){return m.difference(n,l.call(arguments,1))},m.uniq=m.unique=function(n,t,r,e){m.isBoolean(t)||(e=r,r=t,t=!1),null!=r&&(r=x(r,e));for(var u=[],i=[],o=0,a=O(n);a>o;o++){var c=n[o],f=r?r(c,o,n):c;t?(o&&i===f||u.push(c),i=f):r?m.contains(i,f)||(i.push(f),u.push(c)):m.contains(u,c)||u.push(c)}return u},m.union=function(){return m.uniq(S(arguments,!0,!0))},m.intersection=function(n){for(var t=[],r=arguments.length,e=0,u=O(n);u>e;e++){var i=n[e];if(!m.contains(t,i)){for(var o=1;r>o&&m.contains(arguments[o],i);o++);o===r&&t.push(i)}}return t},m.difference=function(n){var t=S(arguments,!0,!0,1);return m.filter(n,function(n){return!m.contains(t,n)})},m.zip=function(){return m.unzip(arguments)},m.unzip=function(n){for(var t=n&&m.max(n,O).length||0,r=Array(t),e=0;t>e;e++)r[e]=m.pluck(n,e);return r},m.object=function(n,t){for(var r={},e=0,u=O(n);u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},m.findIndex=t(1),m.findLastIndex=t(-1),m.sortedIndex=function(n,t,r,e){r=x(r,e,1);for(var u=r(t),i=0,o=O(n);o>i;){var a=Math.floor((i+o)/2);r(n[a])<u?i=a+1:o=a}return i},m.indexOf=r(1,m.findIndex,m.sortedIndex),m.lastIndexOf=r(-1,m.findLastIndex),m.range=function(n,t,r){null==t&&(t=n||0,n=0),r=r||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=Array(e),i=0;e>i;i++,n+=r)u[i]=n;return u};var E=function(n,t,r,e,u){if(!(e instanceof t))return n.apply(r,u);var i=j(n.prototype),o=n.apply(i,u);return m.isObject(o)?o:i};m.bind=function(n,t){if(g&&n.bind===g)return g.apply(n,l.call(arguments,1));if(!m.isFunction(n))throw new TypeError("Bind must be called on a function");var r=l.call(arguments,2),e=function(){return E(n,e,t,this,r.concat(l.call(arguments)))};return e},m.partial=function(n){var t=l.call(arguments,1),r=function(){for(var e=0,u=t.length,i=Array(u),o=0;u>o;o++)i[o]=t[o]===m?arguments[e++]:t[o];for(;e<arguments.length;)i.push(arguments[e++]);return E(n,r,this,this,i)};return r},m.bindAll=function(n){var t,r,e=arguments.length;if(1>=e)throw new Error("bindAll must be passed function names");for(t=1;e>t;t++)r=arguments[t],n[r]=m.bind(n[r],n);return n},m.memoize=function(n,t){var r=function(e){var u=r.cache,i=""+(t?t.apply(this,arguments):e);return m.has(u,i)||(u[i]=n.apply(this,arguments)),u[i]};return r.cache={},r},m.delay=function(n,t){var r=l.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},m.defer=m.partial(m.delay,m,1),m.throttle=function(n,t,r){var e,u,i,o=null,a=0;r||(r={});var c=function(){a=r.leading===!1?0:m.now(),o=null,i=n.apply(e,u),o||(e=u=null)};return function(){var f=m.now();a||r.leading!==!1||(a=f);var l=t-(f-a);return e=this,u=arguments,0>=l||l>t?(o&&(clearTimeout(o),o=null),a=f,i=n.apply(e,u),o||(e=u=null)):o||r.trailing===!1||(o=setTimeout(c,l)),i}},m.debounce=function(n,t,r){var e,u,i,o,a,c=function(){var f=m.now()-o;t>f&&f>=0?e=setTimeout(c,t-f):(e=null,r||(a=n.apply(i,u),e||(i=u=null)))};return function(){i=this,u=arguments,o=m.now();var f=r&&!e;return e||(e=setTimeout(c,t)),f&&(a=n.apply(i,u),i=u=null),a}},m.wrap=function(n,t){return m.partial(t,n)},m.negate=function(n){return function(){return!n.apply(this,arguments)}},m.compose=function(){var n=arguments,t=n.length-1;return function(){for(var r=t,e=n[t].apply(this,arguments);r--;)e=n[r].call(this,e);return e}},m.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},m.before=function(n,t){var r;return function(){return--n>0&&(r=t.apply(this,arguments)),1>=n&&(t=null),r}},m.once=m.partial(m.before,2);var M=!{toString:null}.propertyIsEnumerable("toString"),I=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];m.keys=function(n){if(!m.isObject(n))return[];if(v)return v(n);var t=[];for(var r in n)m.has(n,r)&&t.push(r);return M&&e(n,t),t},m.allKeys=function(n){if(!m.isObject(n))return[];var t=[];for(var r in n)t.push(r);return M&&e(n,t),t},m.values=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},m.mapObject=function(n,t,r){t=x(t,r);for(var e,u=m.keys(n),i=u.length,o={},a=0;i>a;a++)e=u[a],o[e]=t(n[e],e,n);return o},m.pairs=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},m.invert=function(n){for(var t={},r=m.keys(n),e=0,u=r.length;u>e;
5e++)t[n[r[e]]]=r[e];return t},m.functions=m.methods=function(n){var t=[];for(var r in n)m.isFunction(n[r])&&t.push(r);return t.sort()},m.extend=_(m.allKeys),m.extendOwn=m.assign=_(m.keys),m.findKey=function(n,t,r){t=x(t,r);for(var e,u=m.keys(n),i=0,o=u.length;o>i;i++)if(e=u[i],t(n[e],e,n))return e},m.pick=function(n,t,r){var e,u,i={},o=n;if(null==o)return i;m.isFunction(t)?(u=m.allKeys(o),e=b(t,r)):(u=S(arguments,!1,!1,1),e=function(n,t,r){return t in r},o=Object(o));for(var a=0,c=u.length;c>a;a++){var f=u[a],l=o[f];e(l,f,o)&&(i[f]=l)}return i},m.omit=function(n,t,r){if(m.isFunction(t))t=m.negate(t);else{var e=m.map(S(arguments,!1,!1,1),String);t=function(n,t){return!m.contains(e,t)}}return m.pick(n,t,r)},m.defaults=_(m.allKeys,!0),m.create=function(n,t){var r=j(n);return t&&m.extendOwn(r,t),r},m.clone=function(n){return m.isObject(n)?m.isArray(n)?n.slice():m.extend({},n):n},m.tap=function(n,t){return t(n),n},m.isMatch=function(n,t){var r=m.keys(t),e=r.length;if(null==n)return!e;for(var u=Object(n),i=0;e>i;i++){var o=r[i];if(t[o]!==u[o]||!(o in u))return!1}return!0};var N=function(n,t,r,e){if(n===t)return 0!==n||1/n===1/t;if(null==n||null==t)return n===t;n instanceof m&&(n=n._wrapped),t instanceof m&&(t=t._wrapped);var u=s.call(n);if(u!==s.call(t))return!1;switch(u){case"[object RegExp]":case"[object String]":return""+n==""+t;case"[object Number]":return+n!==+n?+t!==+t:0===+n?1/+n===1/t:+n===+t;case"[object Date]":case"[object Boolean]":return+n===+t}var i="[object Array]"===u;if(!i){if("object"!=typeof n||"object"!=typeof t)return!1;var o=n.constructor,a=t.constructor;if(o!==a&&!(m.isFunction(o)&&o instanceof o&&m.isFunction(a)&&a instanceof a)&&"constructor"in n&&"constructor"in t)return!1}r=r||[],e=e||[];for(var c=r.length;c--;)if(r[c]===n)return e[c]===t;if(r.push(n),e.push(t),i){if(c=n.length,c!==t.length)return!1;for(;c--;)if(!N(n[c],t[c],r,e))return!1}else{var f,l=m.keys(n);if(c=l.length,m.keys(t).length!==c)return!1;for(;c--;)if(f=l[c],!m.has(t,f)||!N(n[f],t[f],r,e))return!1}return r.pop(),e.pop(),!0};m.isEqual=function(n,t){return N(n,t)},m.isEmpty=function(n){return null==n?!0:k(n)&&(m.isArray(n)||m.isString(n)||m.isArguments(n))?0===n.length:0===m.keys(n).length},m.isElement=function(n){return!(!n||1!==n.nodeType)},m.isArray=h||function(n){return"[object Array]"===s.call(n)},m.isObject=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},m.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(n){m["is"+n]=function(t){return s.call(t)==="[object "+n+"]"}}),m.isArguments(arguments)||(m.isArguments=function(n){return m.has(n,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(m.isFunction=function(n){return"function"==typeof n||!1}),m.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},m.isNaN=function(n){return m.isNumber(n)&&n!==+n},m.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"===s.call(n)},m.isNull=function(n){return null===n},m.isUndefined=function(n){return n===void 0},m.has=function(n,t){return null!=n&&p.call(n,t)},m.noConflict=function(){return u._=i,this},m.identity=function(n){return n},m.constant=function(n){return function(){return n}},m.noop=function(){},m.property=w,m.propertyOf=function(n){return null==n?function(){}:function(t){return n[t]}},m.matcher=m.matches=function(n){return n=m.extendOwn({},n),function(t){return m.isMatch(t,n)}},m.times=function(n,t,r){var e=Array(Math.max(0,n));t=b(t,r,1);for(var u=0;n>u;u++)e[u]=t(u);return e},m.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},m.now=Date.now||function(){return(new Date).getTime()};var B={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},T=m.invert(B),R=function(n){var t=function(t){return n[t]},r="(?:"+m.keys(n).join("|")+")",e=RegExp(r),u=RegExp(r,"g");return function(n){return n=null==n?"":""+n,e.test(n)?n.replace(u,t):n}};m.escape=R(B),m.unescape=R(T),m.result=function(n,t,r){var e=null==n?void 0:n[t];return e===void 0&&(e=r),m.isFunction(e)?e.call(n):e};var q=0;m.uniqueId=function(n){var t=++q+"";return n?n+t:t},m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,z={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\u2028|\u2029/g,L=function(n){return"\\"+z[n]};m.template=function(n,t,r){!t&&r&&(t=r),t=m.defaults({},t,m.templateSettings);var e=RegExp([(t.escape||K).source,(t.interpolate||K).source,(t.evaluate||K).source].join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(t,r,e,o,a){return i+=n.slice(u,a).replace(D,L),u=a+t.length,r?i+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":e?i+="'+\n((__t=("+e+"))==null?'':__t)+\n'":o&&(i+="';\n"+o+"\n__p+='"),t}),i+="';\n",t.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var o=new Function(t.variable||"obj","_",i)}catch(a){throw a.source=i,a}var c=function(n){return o.call(this,n,m)},f=t.variable||"obj";return c.source="function("+f+"){\n"+i+"}",c},m.chain=function(n){var t=m(n);return t._chain=!0,t};var P=function(n,t){return n._chain?m(t).chain():t};m.mixin=function(n){m.each(m.functions(n),function(t){var r=m[t]=n[t];m.prototype[t]=function(){var n=[this._wrapped];return f.apply(n,arguments),P(this,r.apply(m,n))}})},m.mixin(m),m.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=o[n];m.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==n&&"splice"!==n||0!==r.length||delete r[0],P(this,r)}}),m.each(["concat","join","slice"],function(n){var t=o[n];m.prototype[n]=function(){return P(this,t.apply(this._wrapped,arguments))}}),m.prototype.value=function(){return this._wrapped},m.prototype.valueOf=m.prototype.toJSON=m.prototype.value,m.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return m})}).call(this);
6!function(t,e,n,o){"use strict";function i(t){var e=t.currentTarget,o=t.data?t.data.options:{},i=t.data?t.data.items:[],a=n(e).attr("data-fancybox")||"",s=0;t.preventDefault(),t.stopPropagation(),a?(i=i.length?i.filter('[data-fancybox="'+a+'"]'):n('[data-fancybox="'+a+'"]'),s=i.index(e),s<0&&(s=0)):i=[e],n.fancybox.open(i,o,s)}if(n){if(n.fn.fancybox)return void n.error("fancyBox already initialized");var a={loop:!1,margin:[44,0],gutter:50,keyboard:!0,arrows:!0,infobar:!1,toolbar:!0,buttons:["slideShow","fullScreen","thumbs","close"],idleTime:4,smallBtn:"auto",protect:!1,modal:!1,image:{preload:"auto"},ajax:{settings:{data:{fancybox:!0}}},iframe:{tpl:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen allowtransparency="true" src=""></iframe>',preload:!0,css:{},attr:{scrolling:"auto"}},animationEffect:"fade",animationDuration:366,zoomOpacity:"auto",transitionEffect:"fade",transitionDuration:366,slideClass:"",baseClass:"",baseTpl:'<div class="fancybox-container" role="dialog" tabindex="-1"><div class="fancybox-bg"></div><div class="fancybox-inner"><div class="fancybox-infobar"><button data-fancybox-prev title="{{PREV}}" class="fancybox-button fancybox-button--left"></button><div class="fancybox-infobar__body"><span data-fancybox-index></span>&nbsp;/&nbsp;<span data-fancybox-count></span></div><button data-fancybox-next title="{{NEXT}}" class="fancybox-button fancybox-button--right"></button></div><div class="fancybox-toolbar">{{BUTTONS}}</div><div class="fancybox-navigation"><button data-fancybox-prev title="{{PREV}}" class="fancybox-arrow fancybox-arrow--left" /><button data-fancybox-next title="{{NEXT}}" class="fancybox-arrow fancybox-arrow--right" /></div><div class="fancybox-stage"></div><div class="fancybox-caption-wrap"><div class="fancybox-caption"></div></div></div></div>',spinnerTpl:'<div class="fancybox-loading"></div>',errorTpl:'<div class="fancybox-error"><p>{{ERROR}}<p></div>',btnTpl:{slideShow:'<button data-fancybox-play class="fancybox-button fancybox-button--play" title="{{PLAY_START}}"></button>',fullScreen:'<button data-fancybox-fullscreen class="fancybox-button fancybox-button--fullscreen" title="{{FULL_SCREEN}}"></button>',thumbs:'<button data-fancybox-thumbs class="fancybox-button fancybox-button--thumbs" title="{{THUMBS}}"></button>',close:'<button data-fancybox-close class="fancybox-button fancybox-button--close" title="{{CLOSE}}"></button>',smallBtn:'<button data-fancybox-close class="fancybox-close-small" title="{{CLOSE}}"></button>'},parentEl:"body",autoFocus:!0,backFocus:!0,trapFocus:!0,fullScreen:{autoStart:!1},touch:{vertical:!0,momentum:!0},hash:null,media:{},slideShow:{autoStart:!1,speed:4e3},thumbs:{autoStart:!1,hideOnClose:!0},onInit:n.noop,beforeLoad:n.noop,afterLoad:n.noop,beforeShow:n.noop,afterShow:n.noop,beforeClose:n.noop,afterClose:n.noop,onActivate:n.noop,onDeactivate:n.noop,clickContent:function(t,e){return"image"===t.type&&"zoom"},clickSlide:"close",clickOutside:"close",dblclickContent:!1,dblclickSlide:!1,dblclickOutside:!1,mobile:{clickContent:function(t,e){return"image"===t.type&&"toggleControls"},clickSlide:function(t,e){return"image"===t.type?"toggleControls":"close"},dblclickContent:function(t,e){return"image"===t.type&&"zoom"},dblclickSlide:function(t,e){return"image"===t.type&&"zoom"}},lang:"en",i18n:{en:{CLOSE:"Close",NEXT:"Next",PREV:"Previous",ERROR:"The requested content cannot be loaded. <br/> Please try again later.",PLAY_START:"Start slideshow",PLAY_STOP:"Pause slideshow",FULL_SCREEN:"Full screen",THUMBS:"Thumbnails"},de:{CLOSE:"Schliessen",NEXT:"Weiter",PREV:"Zurück",ERROR:"Die angeforderten Daten konnten nicht geladen werden. <br/>
6 Bitte versuchen Sie es später nochmal.",PLAY_START:"Diaschau starten",PLAY_STOP:"Diaschau beenden",FULL_SCREEN:"Vollbild",THUMBS:"Vorschaubilder"}}},s=n(t),r=n(e),c=0,l=function(t){return t&&t.hasOwnProperty&&t instanceof n},u=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||function(e){return t.setTimeout(e,1e3/60)}}(),d=function(){var t,n=e.createElement("fakeelement"),i={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(t in i)if(n.style[t]!==o)return i[t]}(),f=function(t){return t&&t.length&&t[0].offsetHeight},h=function(t,o,i){var s=this;s.opts=n.extend(!0,{index:i},a,o||{}),o&&n.isArray(o.buttons)&&(s.opts.buttons=o.buttons),s.id=s.opts.id||++c,s.group=[],s.currIndex=parseInt(s.opts.index,10)||0,s.prevIndex=null,s.prevPos=null,s.currPos=0,s.firstRun=null,s.createGroup(t),s.group.length&&(s.$lastFocus=n(e.activeElement).blur(),s.slides={},s.init(t))};n.extend(h.prototype,{init:function(){var t,e,o,i=this,a=i.group[i.currIndex].opts;i.scrollTop=r.scrollTop(),i.scrollLeft=r.scrollLeft(),n.fancybox.getInstance()||n.fancybox.isMobile||"hidden"===n("body").css("overflow")||(t=n("body").width(),n("html").addClass("fancybox-enabled"),t=n("body").width()-t,t>1&&n("head").append('<style id="fancybox-style-noscroll" type="text/css">.compensate-for-scrollbar, .fancybox-enabled body { margin-right: '+t+"px; }</style>")),o="",n.each(a.buttons,function(t,e){o+=a.btnTpl[e]||""}),e=n(i.translate(i,a.baseTpl.replace("{{BUTTONS}}",o))).addClass("fancybox-is-hidden").attr("id","fancybox-container-"+i.id).addClass(a.baseClass).data("FancyBox",i).prependTo(a.parentEl),i.$refs={container:e},["bg","inner","infobar","toolbar","stage","caption"].forEach(function(t){i.$refs[t]=e.find(".fancybox-"+t)}),(!a.arrows||i.group.length<2)&&e.find(".fancybox-navigation").remove(),a.infobar||i.$refs.infobar.remove(),a.toolbar||i.$refs.toolbar.remove(),i.trigger("onInit"),i.activate(),i.jumpTo(i.currIndex)},translate:function(t,e){var n=t.opts.i18n[t.opts.lang];return e.replace(/\{\{(\w+)\}\}/g,function(t,e){var i=n[e];return i===o?t:i})},createGroup:function(t){var e=this,i=n.makeArray(t);n.each(i,function(t,i){var a,s,r,c,l={},u={},d=[];n.isPlainObject(i)?(l=i,u=i.opts||i):"object"===n.type(i)&&n(i).length?(a=n(i),d=a.data(),u="options"in d?d.options:{},u="object"===n.type(u)?u:{},l.src="src"in d?d.src:u.src||a.attr("href"),["width","height","thumb","type","filter"].forEach(function(t){t in d&&(u[t]=d[t])}),"srcset"in d&&(u.image={srcset:d.srcset}),u.$orig=a,l.type||l.src||(l.type="inline",l.src=i)):l={type:"html",src:i+""},l.opts=n.extend(!0,{},e.opts,u),n.fancybox.isMobile&&(l.opts=n.extend(!0,{},l.opts,l.opts.mobile)),s=l.type||l.opts.type,r=l.src||"",!s&&r&&(r.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)?s="image":r.match(/\.(pdf)((\?|#).*)?$/i)?s="pdf":"#"===r.charAt(0)&&(s="inline")),l.type=s,l.index=e.group.length,l.opts.$orig&&!l.opts.$orig.length&&delete l.opts.$orig,!l.opts.$thumb&&l.opts.$orig&&(l.opts.$thumb=l.opts.$orig.find("img:first")),l.opts.$thumb&&!l.opts.$thumb.length&&delete l.opts.$thumb,"function"===n.type(l.opts.caption)?l.opts.caption=l.opts.caption.apply(i,[e,l]):"caption"in d&&(l.opts.caption=d.caption),l.opts.caption=l.opts.caption===o?"":l.opts.caption+"","ajax"===s&&(c=r.split(/\s+/,2),c.length>1&&(l.src=c.shift(),l.opts.filter=c.shift())),"auto"==l.opts.smallBtn&&(n.inArray(s,["html","inline","ajax"])>-1?(l.opts.toolbar=!1,l.opts.smallBtn=!0):l.opts.smallBtn=!1),"pdf"===s&&(l.type="iframe",l.opts.iframe.preload=!1),l.opts.modal&&(l.opts=n.extend(!0,l.opts,{infobar:0,toolbar:0,smallBtn:0,keyboard:0,slideShow:0,fullScreen:0,thumbs:0,touch:0,clickContent:!1,clickSlide:!1,clickOutside:!1,dblclickContent:!1,dblclickSlide:!1,dblclickOutside:!1})),e.group.push(l)})},addEvents:function(){var o=this;o.removeEvents(),o.$refs.container.on("click.fb-close","[data-fancybox-close]",function(t){t.stopPropagation(),t.preventDefault(),o.close(t)}).on("click.fb-prev touchend.fb-prev","[data-fancybox-prev]",function(t){t.stopPropagation(),t.preventDefault(),o.previous()}).on("click.fb-next touchend.fb-next","[data-fancybox-next]",function(t){t.stopPropagation(),t.preventDefault(),o.next()}),s.on("orientationchange.fb resize.fb",function(t){t&&t.originalEvent&&"resize"===t.originalEvent.type?u(function(){o.update()}):(o.$refs.stage.hide(),setTimeout(function(){o.$refs.stage.show(),o.update()},500))}),r.on("focusin.fb",function(t){var i=n.fancybox?n.fancybox.getInstance():null;i.isClosing||!i.current||!i.current.opts.trapFocus||n(t.target).hasClass("fancybox-container")||n(t.target).is(e)||i&&"fixed"!==n(t.target).css("position")&&!i.$refs.container.has(t.target).length&&(t.stopPropagation(),i.focus(),s.scrollTop(o.scrollTop).scrollLeft(o.scrollLeft))}
6),r.on("keydown.fb",function(t){var e=o.current,i=t.keyCode||t.which;if(e&&e.opts.keyboard&&!n(t.target).is("input")&&!n(t.target).is("textarea"))return 8===i||27===i?(t.preventDefault(),void o.close(t)):37===i||38===i?(t.preventDefault(),void o.previous()):39===i||40===i?(t.preventDefault(),void o.next()):void o.trigger("afterKeydown",t,i)}),o.group[o.currIndex].opts.idleTime&&(o.idleSecondsCounter=0,r.on("mousemove.fb-idle mouseenter.fb-idle mouseleave.fb-idle mousedown.fb-idle touchstart.fb-idle touchmove.fb-idle scroll.fb-idle keydown.fb-idle",function(){o.idleSecondsCounter=0,o.isIdle&&o.showControls(),o.isIdle=!1}),o.idleInterval=t.setInterval(function(){o.idleSecondsCounter++,o.idleSecondsCounter>=o.group[o.currIndex].opts.idleTime&&(o.isIdle=!0,o.idleSecondsCounter=0,o.hideControls())},1e3))},removeEvents:function(){var e=this;s.off("orientationchange.fb resize.fb"),r.off("focusin.fb keydown.fb .fb-idle"),this.$refs.container.off(".fb-close .fb-prev .fb-next"),e.idleInterval&&(t.clearInterval(e.idleInterval),e.idleInterval=null)},previous:function(t){return this.jumpTo(this.currPos-1,t)},next:function(t){return this.jumpTo(this.currPos+1,t)},jumpTo:function(t,e,i){var a,s,r,c,l,u,d,h=this,p=h.group.length;if(!(h.isSliding||h.isClosing||h.isAnimating&&h.firstRun)){if(t=parseInt(t,10),s=h.current?h.current.opts.loop:h.opts.loop,!s&&(t<0||t>=p))return!1;if(a=h.firstRun=null===h.firstRun,!(p<2&&!a&&h.isSliding)){if(c=h.current,h.prevIndex=h.currIndex,h.prevPos=h.currPos,r=h.createSlide(t),p>1&&((s||r.index>0)&&h.createSlide(t-1),(s||r.index<p-1)&&h.createSlide(t+1)),h.current=r,h.currIndex=r.index,h.currPos=r.pos,h.trigger("beforeShow",a),h.updateControls(),u=n.fancybox.getTranslate(r.$slide),r.isMoved=(0!==u.left||0!==u.top)&&!r.$slide.hasClass("fancybox-animated"),r.forcedDuration=o,n.isNumeric(e)?r.forcedDuration=e:e=r.opts[a?"animationDuration":"transitionDuration"],e=parseInt(e,10),a)return r.opts.animationEffect&&e&&h.$refs.container.css("transition-duration",e+"ms"),h.$refs.container.removeClass("fancybox-is-hidden"),f(h.$refs.container),h.$refs.container.addClass("fancybox-is-open"),r.$slide.addClass("fancybox-slide--current"),h.loadSlide(r),void h.preload();n.each(h.slides,function(t,e){n.fancybox.stop(e.$slide)}),r.$slide.removeClass("fancybox-slide--next fancybox-slide--previous").addClass("fancybox-slide--current"),r.isMoved?(l=Math.round(r.$slide.width()),n.each(h.slides,function(t,o){var i=o.pos-r.pos;n.fancybox.animate(o.$slide,{top:0,left:i*l+i*o.opts.gutter},e,function(){o.$slide.removeAttr("style").removeClass("fancybox-slide--next fancybox-slide--previous"),o.pos===h.currPos&&(r.isMoved=!1,h.complete())})})):h.$refs.stage.children().removeAttr("style"),r.isLoaded?h.revealContent(r):h.loadSlide(r),h.preload(),c.pos!==r.pos&&(d="fancybox-slide--"+(c.pos>r.pos?"next":"previous"),c.$slide.removeClass("fancybox-slide--complete fancybox-slide--current fancybox-slide--next fancybox-slide--previous"),c.isComplete=!1,e&&(r.isMoved||r.opts.transitionEffect)&&(r.isMoved?c.$slide.addClass(d):(d="fancybox-animated "+d+" fancybox-fx-"+r.opts.transitionEffect,n.fancybox.animate(c.$slide,d,e,function(){c.$slide.removeClass(d).removeAttr("style")}))))}}},createSlide:function(t){var e,o,i=this;return o=t%i.group.length,o=o<0?i.group.length+o:o,!i.slides[t]&&i.group[o]&&(e=n('<div class="fancybox-slide"></div>').appendTo(i.$refs.stage),i.slides[t]=n.extend(!0,{},i.group[o],{pos:t,$slide:e,isLoaded:!1}),i.updateSlide(i.slides[t])),i.slides[t]},scaleToActual:function(t,e,i){var a,s,r,c,l,u=this,d=u.current,f=d.$content,h=parseInt(d.$slide.width(),10),p=parseInt(d.$slide.height(),10),g=d.width,b=d.height;"image"!=d.type||d.hasError||!f||u.isAnimating||(n.fancybox.stop(f),u.isAnimating=!0,t=t===o?.5*h:t,e=e===o?.5*p:e,a=n.fancybox.getTranslate(f),c=g/a.width,l=b/a.height,s=.5*h-.5*g,r=.5*p-.5*b,g>h&&(s=a.left*c-(t*c-t),s>0&&(s=0),s<h-g&&(s=h-g)),b>p&&(r=a.top*l-(e*l-e),r>0&&(r=0),r<p-b&&(r=p-b)),u.updateCursor(g,b),n.fancybox.animate(f,{top:r,left:s,scaleX:c,scaleY:l},i||330,function(){u.isAnimating=!1}),u.SlideShow&&u.SlideShow.isActive&&u.SlideShow.stop())},scaleToFit:function(t){var e,o=this,i=o.current,a=i.$content;"image"!=i.type||i.hasError||!a||o.isAnimating||(n.fancybox.stop(a),o.isAnimating=!0,e=o.getFitPos(i),o.updateCursor(e.width,e.height),n.fancybox.animate(a,{top:e.top,left
6:e.left,scaleX:e.width/a.width(),scaleY:e.height/a.height()},t||330,function(){o.isAnimating=!1}))},getFitPos:function(t){var e,o,i,a,r,c=this,l=t.$content,u=t.width,d=t.height,f=t.opts.margin;return!(!l||!l.length||!u&&!d)&&("number"===n.type(f)&&(f=[f,f]),2==f.length&&(f=[f[0],f[1],f[0],f[1]]),s.width()<800&&(f=[0,0,0,0]),e=parseInt(c.$refs.stage.width(),10)-(f[1]+f[3]),o=parseInt(c.$refs.stage.height(),10)-(f[0]+f[2]),i=Math.min(1,e/u,o/d),a=Math.floor(i*u),r=Math.floor(i*d),{top:Math.floor(.5*(o-r))+f[0],left:Math.floor(.5*(e-a))+f[3],width:a,height:r})},update:function(){var t=this;n.each(t.slides,function(e,n){t.updateSlide(n)})},updateSlide:function(t){var e=this,o=t.$content;o&&(t.width||t.height)&&(n.fancybox.stop(o),n.fancybox.setTranslate(o,e.getFitPos(t)),t.pos===e.currPos&&e.updateCursor()),t.$slide.trigger("refresh"),e.trigger("onUpdate",t)},updateCursor:function(t,e){var n,i=this,a=i.$refs.container.removeClass("fancybox-is-zoomable fancybox-can-zoomIn fancybox-can-drag fancybox-can-zoomOut");i.current&&!i.isClosing&&(i.isZoomable()?(a.addClass("fancybox-is-zoomable"),n=t!==o&&e!==o?t<i.current.width&&e<i.current.height:i.isScaledDown(),n?a.addClass("fancybox-can-zoomIn"):i.current.opts.touch?a.addClass("fancybox-can-drag"):a.addClass("fancybox-can-zoomOut")):i.current.opts.touch&&a.addClass("fancybox-can-drag"))},isZoomable:function(){var t,e=this,o=e.current;if(o&&!e.isClosing)return!!("image"===o.type&&o.isLoaded&&!o.hasError&&("zoom"===o.opts.clickContent||n.isFunction(o.opts.clickContent)&&"zoom"===o.opts.clickContent(o))&&(t=e.getFitPos(o),o.width>t.width||o.height>t.height))},isScaledDown:function(){var t=this,e=t.current,o=e.$content,i=!1;return o&&(i=n.fancybox.getTranslate(o),i=i.width<e.width||i.height<e.height),i},canPan:function(){var t=this,e=t.current,n=e.$content,o=!1;return n&&(o=t.getFitPos(e),o=Math.abs(n.width()-o.width)>1||Math.abs(n.height()-o.height)>1),o},loadSlide:function(t){var e,o,i,a=this;if(!t.isLoading&&!t.isLoaded){switch(t.isLoading=!0,a.trigger("beforeLoad",t),e=t.type,o=t.$slide,o.off("refresh").trigger("onReset").addClass("fancybox-slide--"+(e||"unknown")).addClass(t.opts.slideClass),e){case"image":a.setImage(t);break;case"iframe":a.setIframe(t);break;case"html":a.setContent(t,t.src||t.content);break;case"inline":n(t.src).length?a.setContent(t,n(t.src)):a.setError(t);break;case"ajax":a.showLoading(t),i=n.ajax(n.extend({},t.opts.ajax.settings,{url:t.src,success:function(e,n){"success"===n&&a.setContent(t,e)},error:function(e,n){e&&"abort"!==n&&a.setError(t)}})),o.one("onReset",function(){i.abort()});break;default:a.setError(t)}return!0}},setImage:function(e){var o,i,a,s,r=this,c=e.opts.image.srcset;if(c){a=t.devicePixelRatio||1,s=t.innerWidth*a,i=c.split(",").map(function(t){var e={};return t.trim().split(/\s+/).forEach(function(t,n){var o=parseInt(t.substring(0,t.length-1),10);return 0===n?e.url=t:void(o&&(e.value=o,e.postfix=t[t.length-1]))}),e}),i.sort(function(t,e){return t.value-e.value});for(var l=0;l<i.length;l++){var u=i[l];if("w"===u.postfix&&u.value>=s||"x"===u.postfix&&u.value>=a){o=u;break}}!o&&i.length&&(o=i[i.length-1]),o&&(e.src=o.url,e.width&&e.height&&"w"==o.postfix&&(e.height=e.width/e.height*o.value,e.width=o.value))}e.$content=n('<div class="fancybox-image-wrap"></div>').addClass("fancybox-is-hidden").appendTo(e.$slide),e.opts.preload!==!1&&e.opts.width&&e.opts.height&&(e.opts.thumb||e.opts.$thumb)?(e.width=e.opts.width,e.height=e.opts.height,e.$ghost=n("<img />").one("error",function(){n(this).remove(),e.$ghost=null,r.setBigImage(e)}).one("load",function(){r.afterLoad(e),r.setBigImage(e)}).addClass("fancybox-image").appendTo(e.$content).attr("src",e.opts.thumb||e.opts.$thumb.attr("src"))):r.setBigImage(e)},setBigImage:function(t){var e=this,o=n("<img />");t.$image=o.one("error",function(){e.setError(t)}).one("load",function(){clearTimeout(t.timouts),t.timouts=null,e.isClosing||(t.width=this.naturalWidth,t.height=this.naturalHeight,t.opts.image.srcset&&o.attr("sizes","100vw").attr("srcset",t.opts.image.srcset),e.hideLoading(t),t.$ghost?t.timouts=setTimeout(function(){t.timouts=null,t.$ghost.hide()},Math.min(300,Math.max(1e3,t.height/1600))):e.afterLoad(t))}).addClass("fancybox-image").attr("src",t.src).appendTo(t.$content),o[0].complete?o.trigger("load"):o[0].error?o.trigger("error"):t.timouts=setTimeout(function(){o[0].complete||t.hasError||e.showLoading(t)}
6,100)},setIframe:function(t){var e,i=this,a=t.opts.iframe,s=t.$slide;t.$content=n('<div class="fancybox-content'+(a.preload?" fancybox-is-hidden":"")+'"></div>').css(a.css).appendTo(s),e=n(a.tpl.replace(/\{rnd\}/g,(new Date).getTime())).attr(a.attr).appendTo(t.$content),a.preload?(i.showLoading(t),e.on("load.fb error.fb",function(e){this.isReady=1,t.$slide.trigger("refresh"),i.afterLoad(t)}),s.on("refresh.fb",function(){var n,i,s,r,c,l=t.$content;if(1===e[0].isReady){try{n=e.contents(),i=n.find("body")}catch(t){}i&&i.length&&(a.css.width===o||a.css.height===o)&&(s=e[0].contentWindow.document.documentElement.scrollWidth,r=Math.ceil(i.outerWidth(!0)+(l.width()-s)),c=Math.ceil(i.outerHeight(!0)),l.css({width:a.css.width===o?r+(l.outerWidth()-l.innerWidth()):a.css.width,height:a.css.height===o?c+(l.outerHeight()-l.innerHeight()):a.css.height})),l.removeClass("fancybox-is-hidden")}})):this.afterLoad(t),e.attr("src",t.src),t.opts.smallBtn===!0&&t.$content.prepend(i.translate(t,t.opts.btnTpl.smallBtn)),s.one("onReset",function(){try{n(this).find("iframe").hide().attr("src","//about:blank")}catch(t){}n(this).empty(),t.isLoaded=!1})},setContent:function(t,e){var o=this;o.isClosing||(o.hideLoading(t),t.$slide.empty(),l(e)&&e.parent().length?(e.parent(".fancybox-slide--inline").trigger("onReset"),t.$placeholder=n("<div></div>").hide().insertAfter(e),e.css("display","inline-block")):t.hasError||("string"===n.type(e)&&(e=n("<div>").append(n.trim(e)).contents(),3===e[0].nodeType&&(e=n("<div>").html(e))),t.opts.filter&&(e=n("<div>").html(e).find(t.opts.filter))),t.$slide.one("onReset",function(){t.$placeholder&&(t.$placeholder.after(e.hide()).remove(),t.$placeholder=null),t.$smallBtn&&(t.$smallBtn.remove(),t.$smallBtn=null),t.hasError||(n(this).empty(),t.isLoaded=!1)}),t.$content=n(e).appendTo(t.$slide),t.opts.smallBtn&&!t.$smallBtn&&(t.$smallBtn=n(o.translate(t,t.opts.btnTpl.smallBtn)).appendTo(t.$content)),this.afterLoad(t))},setError:function(t){t.hasError=!0,t.$slide.removeClass("fancybox-slide--"+t.type),this.setContent(t,this.translate(t,t.opts.errorTpl))},showLoading:function(t){var e=this;t=t||e.current,t&&!t.$spinner&&(t.$spinner=n(e.opts.spinnerTpl).appendTo(t.$slide))},hideLoading:function(t){var e=this;t=t||e.current,t&&t.$spinner&&(t.$spinner.remove(),delete t.$spinner)},afterLoad:function(t){var e=this;e.isClosing||(t.isLoading=!1,t.isLoaded=!0,e.trigger("afterLoad",t),e.hideLoading(t),t.opts.protect&&t.$content&&!t.hasError&&(t.$content.on("contextmenu.fb",function(t){return 2==t.button&&t.preventDefault(),!0}),"image"===t.type&&n('<div class="fancybox-spaceball"></div>').appendTo(t.$content)),e.revealContent(t))},revealContent:function(t){var e,i,a,s,r,c=this,l=t.$slide,u=!1;return e=t.opts[c.firstRun?"animationEffect":"transitionEffect"],a=t.opts[c.firstRun?"animationDuration":"transitionDuration"],a=parseInt(t.forcedDuration===o?a:t.forcedDuration,10),!t.isMoved&&t.pos===c.currPos&&a||(e=!1),"zoom"!==e||t.pos===c.currPos&&a&&"image"===t.type&&!t.hasError&&(u=c.getThumbPos(t))||(e="fade"),"zoom"===e?(r=c.getFitPos(t),r.scaleX=Math.round(r.width/u.width*100)/100,r.scaleY=Math.round(r.height/u.height*100)/100,delete r.width,delete r.height,s=t.opts.zoomOpacity,"auto"==s&&(s=Math.abs(t.width/t.height-u.width/u.height)>.1),s&&(u.opacity=.1,r.opacity=1),n.fancybox.setTranslate(t.$content.removeClass("fancybox-is-hidden"),u),f(t.$content),void n.fancybox.animate(t.$content,r,a,function(){c.complete()})):(c.updateSlide(t),e?(n.fancybox.stop(l),i="fancybox-animated fancybox-slide--"+(t.pos>c.prevPos?"next":"previous")+" fancybox-fx-"+e,l.removeAttr("style").removeClass("fancybox-slide--current fancybox-slide--next fancybox-slide--previous").addClass(i),t.$content.removeClass("fancybox-is-hidden"),f(l),void n.fancybox.animate(l,"fancybox-slide--current",a,function(e){l.removeClass(i).removeAttr("style"),t.pos===c.currPos&&c.complete()},!0)):(f(l),t.$content.removeClass("fancybox-is-hidden"),void(t.pos===c.currPos&&c.complete())))},getThumbPos:function(o){var i,a=this,s=!1,r=function(e){for(var o,i=e[0],a=i.getBoundingClientRect(),s=[];null!==i.parentElement;)"hidden"!==n(i.parentElement).css("overflow")&&"auto"!==n(i.parentElement).css("overflow")||s.push(i.parentElement.getBoundingClientRect()),i=i.parentElement;return o=s.every(function(t){var e=Math.min(a.right,t.right)-Math.max(a.left,t.left),n=Math.min(a.bottom,t.bottom)-Math.max(a.top,t.top);return e>0&&n>0}),o&&a.bottom>0&&a.right>0&&a.left<n(t).width()&&a.top<n(t).height()},c=o.opts.$thumb,l=c?c.offset():0;return l&&c[0].ownerDocument===e&&r(c)&&(i=a.$refs.stage.offset(),s={top:l.top-i.top+parseFloat(c.css("border-top-width")||0),left
6:l.left-i.left+parseFloat(c.css("border-left-width")||0),width:c.width(),height:c.height(),scaleX:1,scaleY:1}),s},complete:function(){var t=this,o=t.current,i={};o.isMoved||!o.isLoaded||o.isComplete||(o.isComplete=!0,o.$slide.siblings().trigger("onReset"),f(o.$slide),o.$slide.addClass("fancybox-slide--complete"),n.each(t.slides,function(e,o){o.pos>=t.currPos-1&&o.pos<=t.currPos+1?i[o.pos]=o:o&&(n.fancybox.stop(o.$slide),o.$slide.unbind().remove())}),t.slides=i,t.updateCursor(),t.trigger("afterShow"),(n(e.activeElement).is("[disabled]")||o.opts.autoFocus&&"image"!=o.type&&"iframe"!==o.type)&&t.focus())},preload:function(){var t,e,n=this;n.group.length<2||(t=n.slides[n.currPos+1],e=n.slides[n.currPos-1],t&&"image"===t.type&&n.loadSlide(t),e&&"image"===e.type&&n.loadSlide(e))},focus:function(){var t,e=this.current;this.isClosing||(t=e&&e.isComplete?e.$slide.find("button,:input,[tabindex],a").filter(":not([disabled]):visible:first"):null,t=t&&t.length?t:this.$refs.container,t.focus())},activate:function(){var t=this;n(".fancybox-container").each(function(){var e=n(this).data("FancyBox");e&&e.uid!==t.uid&&!e.isClosing&&e.trigger("onDeactivate")}),t.current&&(t.$refs.container.index()>0&&t.$refs.container.prependTo(e.body),t.updateControls()),t.trigger("onActivate"),t.addEvents()},close:function(t,e){var o,i,a,s,r,c,l=this,f=l.current,h=function(){l.cleanUp(t)};return!l.isClosing&&(l.isClosing=!0,l.trigger("beforeClose",t)===!1?(l.isClosing=!1,u(function(){l.update()}),!1):(l.removeEvents(),f.timouts&&clearTimeout(f.timouts),a=f.$content,o=f.opts.animationEffect,i=n.isNumeric(e)?e:o?f.opts.animationDuration:0,f.$slide.off(d).removeClass("fancybox-slide--complete fancybox-slide--next fancybox-slide--previous fancybox-animated"),f.$slide.siblings().trigger("onReset").remove(),i&&l.$refs.container.removeClass("fancybox-is-open").addClass("fancybox-is-closing"),l.hideLoading(f),l.hideControls(),l.updateCursor(),"zoom"!==o||t!==!0&&a&&i&&"image"===f.type&&!f.hasError&&(c=l.getThumbPos(f))||(o="fade"),"zoom"===o?(n.fancybox.stop(a),r=n.fancybox.getTranslate(a),r.width=r.width*r.scaleX,r.height=r.height*r.scaleY,s=f.opts.zoomOpacity,"auto"==s&&(s=Math.abs(f.width/f.height-c.width/c.height)>.1),s&&(c.opacity=0),r.scaleX=r.width/c.width,r.scaleY=r.height/c.height,r.width=c.width,r.height=c.height,n.fancybox.setTranslate(f.$content,r),n.fancybox.animate(f.$content,c,i,h),!0):(o&&i?t===!0?setTimeout(h,i):n.fancybox.animate(f.$slide.removeClass("fancybox-slide--current"),"fancybox-animated fancybox-slide--previous fancybox-fx-"+o,i,h):h(),!0)))},cleanUp:function(t){var e,o=this;o.current.$slide.trigger("onReset"),o.$refs.container.empty().remove(),o.trigger("afterClose",t),o.$lastFocus&&!o.current.focusBack&&o.$lastFocus.focus(),o.current=null,e=n.fancybox.getInstance(),e?e.activate():(s.scrollTop(o.scrollTop).scrollLeft(o.scrollLeft),n("html").removeClass("fancybox-enabled"),n("#fancybox-style-noscroll").remove())},trigger:function(t,e){var o,i=Array.prototype.slice.call(arguments,1),a=this,s=e&&e.opts?e:a.current;return s?i.unshift(s):s=a,i.unshift(a),n.isFunction(s.opts[t])&&(o=s.opts[t].apply(s,i)),o===!1?o:void("afterClose"===t?r.trigger(t+".fb",i):a.$refs.container.trigger(t+".fb",i))},updateControls:function(t){var e=this,o=e.current,i=o.index,a=o.opts,s=a.caption,r=e.$refs.caption;o.$slide.trigger("refresh"),e.$caption=s&&s.length?r.html(s):null,e.isHiddenControls||e.showControls(),n("[data-fancybox-count]").html(e.group.length),n("[data-fancybox-index]").html(i+1),n("[data-fancybox-prev]").prop("disabled",!a.loop&&i<=0),n("[data-fancybox-next]").prop("disabled",!a.loop&&i>=e.group.length-1)},hideControls:function(){this.isHiddenControls=!0,this.$refs.container.removeClass("fancybox-show-infobar fancybox-show-toolbar fancybox-show-caption fancybox-show-nav")},showControls:function(){var t=this,e=t.current?t.current.opts:t.opts,n=t.$refs.container;t.isHiddenControls=!1,t.idleSecondsCounter=0,n.toggleClass("fancybox-show-toolbar",!(!e.toolbar||!e.buttons)).toggleClass("fancybox-show-infobar",!!(e.infobar&&t.group.length>1)).toggleClass("fancybox-show-nav",!!(e.arrows&&t.group.length>1)).toggleClass("fancybox-is-modal",!!e.modal),t.$caption?n.addClass("fancybox-show-caption "):n.removeClass("fancybox-show-caption")}
6,toggleControls:function(){this.isHiddenControls?this.showControls():this.hideControls()}}),n.fancybox={version:"3.1.20",defaults:a,getInstance:function(t){var e=n('.fancybox-container:not(".fancybox-is-closing"):first').data("FancyBox"),o=Array.prototype.slice.call(arguments,1);return e instanceof h&&("string"===n.type(t)?e[t].apply(e,o):"function"===n.type(t)&&t.apply(e,o),e)},open:function(t,e,n){return new h(t,e,n)},close:function(t){var e=this.getInstance();e&&(e.close(),t===!0&&this.close())},destroy:function(){this.close(!0),r.off("click.fb-start")},isMobile:e.createTouch!==o&&/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent),use3d:function(){var n=e.createElement("div");return t.getComputedStyle&&t.getComputedStyle(n).getPropertyValue("transform")&&!(e.documentMode&&e.documentMode<11)}(),getTranslate:function(t){var e;if(!t||!t.length)return!1;if(e=t.eq(0).css("transform"),e&&e.indexOf("matrix")!==-1?(e=e.split("(")[1],e=e.split(")")[0],e=e.split(",")):e=[],e.length)e=e.length>10?[e[13],e[12],e[0],e[5]]:[e[5],e[4],e[0],e[3]],e=e.map(parseFloat);else{e=[0,0,1,1];var n=/\.*translate\((.*)px,(.*)px\)/i,o=n.exec(t.eq(0).attr("style"));o&&(e[0]=parseFloat(o[2]),e[1]=parseFloat(o[1]))}return{top:e[0],left:e[1],scaleX:e[2],scaleY:e[3],opacity:parseFloat(t.css("opacity")),width:t.width(),height:t.height()}},setTranslate:function(t,e){var n="",i={};if(t&&e)return e.left===o&&e.top===o||(n=(e.left===o?t.position().left:e.left)+"px, "+(e.top===o?t.position().top:e.top)+"px",n=this.use3d?"translate3d("+n+", 0px)":"translate("+n+")"),e.scaleX!==o&&e.scaleY!==o&&(n=(n.length?n+" ":"")+"scale("+e.scaleX+", "+e.scaleY+")"),n.length&&(i.transform=n),e.opacity!==o&&(i.opacity=e.opacity),e.width!==o&&(i.width=e.width),e.height!==o&&(i.height=e.height),t.css(i)},animate:function(t,e,i,a,s){var r=d||"transitionend";n.isFunction(i)&&(a=i,i=null),n.isPlainObject(e)||t.removeAttr("style"),t.on(r,function(i){(!i||!i.originalEvent||t.is(i.originalEvent.target)&&"z-index"!=i.originalEvent.propertyName)&&(t.off(r),n.isPlainObject(e)?e.scaleX!==o&&e.scaleY!==o&&(t.css("transition-duration","0ms"),e.width=t.width()*e.scaleX,e.height=t.height()*e.scaleY,e.scaleX=1,e.scaleY=1,n.fancybox.setTranslate(t,e)):s!==!0&&t.removeClass(e),n.isFunction(a)&&a(i))}),n.isNumeric(i)&&t.css("transition-duration",i+"ms"),n.isPlainObject(e)?n.fancybox.setTranslate(t,e):t.addClass(e),t.data("timer",setTimeout(function(){t.trigger("transitionend")},i+16))},stop:function(t){clearTimeout(t.data("timer")),t.off(d)}},n.fn.fancybox=function(t){var e;return t=t||{},e=t.selector||!1,e?n("body").off("click.fb-start",e).on("click.fb-start",e,{items:n(e),options:t},i):this.off("click.fb-start").on("click.fb-start",{items:this,options:t},i),this},r.on("click.fb-start","[data-fancybox]",i)}}(window,document,window.jQuery),function(t){"use strict";var e=function(e,n,o){if(e)return o=o||"","object"===t.type(o)&&(o=t.param(o,!0)),t.each(n,function(t,n){e=e.replace("$"+t,n||"")}),o.length&&(e+=(e.indexOf("?")>0?"&":"?")+o),e},n={youtube:{matcher:/(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(watch\?(.*&)?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*))(.*)/i,params:{autoplay:1,autohide:1,fs:1,rel:0,hd:1,wmode:"transparent",enablejsapi:1,html5:1},paramPlace:8,type:"iframe",url:"//www.youtube.com/embed/$4",thumb:"//img.youtube.com/vi/$4/hqdefault.jpg"},vimeo:{matcher:/^.+vimeo.com\/(.*\/)?([\d]+)(.*)?/,params:{autoplay:1,hd:1,show_title:1,show_byline:1,show_portrait:0,fullscreen:1,api:1},paramPlace:3,type:"iframe",url:"//player.vimeo.com/video/$2"},metacafe:{matcher:/metacafe.com\/watch\/(\d+)\/(.*)?/,type:"iframe",url:"//www.metacafe.com/embed/$1/?ap=1"},dailymotion:{matcher:/dailymotion.com\/video\/(.*)\/?(.*)/,params:{additionalInfos:0,autoStart:1},type:"iframe",url:"//www.dailymotion.com/embed/video/$1"},vine:{matcher:/vine.co\/v\/([a-zA-Z0-9\?\=\-]+)/,type:"iframe",url:"//vine.co/v/$1/embed/simple"},instagram:{matcher:/(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,type:"image",url:"//$1/p/$2/media/?size=l"},google_maps:{matcher:/(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(((maps\/(place\/(.*)\/)?\@(.*),(\d+.?\d+?)z))|(\?ll=))(.*)?/i,type:"iframe",url:function(t){return"//maps.google."+t[2]+"/?ll="+(t[9]?t[9]+"&z="+Math.floor(t[10])+(t[12]?t[12].replace(/^\//,"&"):""):t[12])+"&output="+(t[12]&&t[12].indexOf("layer=c")>0?"svembed":"embed")}}};t(document).on("onInit.fb",function(o,i){t.each(i.group,function(o,i){var a,s,r,c,l,u,d,f=i.src||"",h=!1;i.type||(a=t.extend(!0,{},n,i.opts.media),t.each(a,function(n,o){if(r=f.match(o.matcher),u={},d=n,r){if(h=o.type,o.paramPlace&&r[o.paramPlace]){l=r[o.paramPlace],"?"==l[0]&&(l=l.substring(1)),l=l.split("&");for(var a=0;a<l.length;++a){var p=l[a].split("=",2);2==p.length&&(u[p[0]]=decodeURIComponent(p[1].replace(/\+/g," ")))}}return c=t.extend(!0,{},o.params,i.opts[n],u),f="function"===t.type(o.url)?o.url.call(this,r,c,i):e(o.url,r,c),s="function"===t.type(o.thumb)?o.thumb.call(this,r,c,i):e(o.thumb,r),"vimeo"===d&&(f=f.replace("&%23","#")),!1}}),h?(i.src=f,i.type=h,i.opts.thumb||i.opts.$thumb&&i.opts.$thumb.length||(i.opts.thumb=s),"iframe"===h&&(t.extend(!0,i.opts,{iframe:{preload:!1,attr:{scrolling:"no"}}}),i.contentProvider=d,i.opts.slideClass+=" fancybox-slide--"+("google_maps"==d?"map":"video"))):i.type="image")})})}(window.jQuery),function(t,e,n){"use strict";var o=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||function(e){return t.setTimeout(e,1e3/60)}}(),i=function(){return t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.mozCancelAnimationFrame||t.oCancelAnimationFrame||function(e){t.clearTimeout(e)}}(),a=function(e){var n=[];e=e.originalEvent||e||t.e,e=e.touches&&e.touches.length?e.touches:e.changedTouches&&e.changedTouches.length?e.changedTouches:[e];for(var o in e)e[o].pageX?n.push({x:e[o].pageX,y:e[o].pageY}):e[o].clientX&&n.push({x:e[o].clientX,y:e[o].clientY});return n},s=function(t,e,n){return e&&t?"x"===n?t.x-e.x:"y"===n?t.y-e.y:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)):0},r=function(t){if(t.is("a,button,input,select,textarea")||n.isFunction(t.get(0).onclick))return!0;for(var e=0,o=t[0].attributes,i=o.length;e<i;e++)if("data-fancybox-"===o[e].nodeName.substr(0,14))return!0;return!1},c=function(e){var n=t.getComputedStyle(e)["overflow-y"],o=t.getComputedStyle(e)["overflow-x"],i=("scroll"===n||"auto"===n)&&e.scrollHeight>e.clientHeight,a=("scroll"===o||"auto"===o)&&e.scrollWidth>e.clientWidth;return i||a},l=function(t){for(var e=!1;;){if(e=c(t.get(0)))break;if(t=t.parent(),!t.length||t.hasClass("fancybox-stage")||t.is("body"))break}return e},u=function(t){var e=this;e.instance=t,e.$bg=t.$refs.bg,e.$stage=t.$refs.stage,e.$container=t.$refs.container,e.destroy(),e.$container.on("touchstart.fb.touch mousedown.fb.touch",n.proxy(e,"ontouchstart"))};u.prototype.destroy=function(){this.$container.off(".fb.touch")},u.prototype.ontouchstart=function(o){var i=this,c=n(o.target),u=i.instance,d=u.current,f=d.$content,h="touchstart"==o.type;
6if(h&&i.$container.off("mousedown.fb.touch"),!d||i.instance.isAnimating||i.instance.isClosing)return o.stopPropagation(),void o.preventDefault();if((!o.originalEvent||2!=o.originalEvent.button)&&c.length&&!r(c)&&!r(c.parent())&&!(o.originalEvent.clientX>c[0].clientWidth+c.offset().left)&&(i.startPoints=a(o),i.startPoints&&!(i.startPoints.length>1&&u.isSliding))){if(i.$target=c,i.$content=f,i.canTap=!0,n(e).off(".fb.touch"),n(e).on(h?"touchend.fb.touch touchcancel.fb.touch":"mouseup.fb.touch mouseleave.fb.touch",n.proxy(i,"ontouchend")),n(e).on(h?"touchmove.fb.touch":"mousemove.fb.touch",n.proxy(i,"ontouchmove")),o.stopPropagation(),!u.current.opts.touch&&!u.canPan()||!c.is(i.$stage)&&!i.$stage.find(c).length)return void(c.is("img")&&o.preventDefault());n.fancybox.isMobile&&(l(i.$target)||l(i.$target.parent()))||o.preventDefault(),i.canvasWidth=Math.round(d.$slide[0].clientWidth),i.canvasHeight=Math.round(d.$slide[0].clientHeight),i.startTime=(new Date).getTime(),i.distanceX=i.distanceY=i.distance=0,i.isPanning=!1,i.isSwiping=!1,i.isZooming=!1,i.sliderStartPos=i.sliderLastPos||{top:0,left:0},i.contentStartPos=n.fancybox.getTranslate(i.$content),i.contentLastPos=null,1!==i.startPoints.length||i.isZooming||(i.canTap=!u.isSliding,"image"===d.type&&(i.contentStartPos.width>i.canvasWidth+1||i.contentStartPos.height>i.canvasHeight+1)?(n.fancybox.stop(i.$content),i.$content.css("transition-duration","0ms"),i.isPanning=!0):i.isSwiping=!0,i.$container.addClass("fancybox-controls--isGrabbing")),2!==i.startPoints.length||u.isAnimating||d.hasError||"image"!==d.type||!d.isLoaded&&!d.$ghost||(i.isZooming=!0,i.isSwiping=!1,i.isPanning=!1,n.fancybox.stop(i.$content),i.$content.css("transition-duration","0ms"),i.centerPointStartX=.5*(i.startPoints[0].x+i.startPoints[1].x)-n(t).scrollLeft(),i.centerPointStartY=.5*(i.startPoints[0].y+i.startPoints[1].y)-n(t).scrollTop(),i.percentageOfImageAtPinchPointX=(i.centerPointStartX-i.contentStartPos.left)/i.contentStartPos.width,i.percentageOfImageAtPinchPointY=(i.centerPointStartY-i.contentStartPos.top)/i.contentStartPos.height,i.startDistanceBetweenFingers=s(i.startPoints[0],i.startPoints[1]))}},u.prototype.ontouchmove=function(t){var e=this;if(e.newPoints=a(t),n.fancybox.isMobile&&(l(e.$target)||l(e.$target.parent())))return t.stopPropagation(),void(e.canTap=!1);if((e.instance.current.opts.touch||e.instance.canPan())&&e.newPoints&&e.newPoints.length&&(e.distanceX=s(e.newPoints[0],e.startPoints[0],"x"),e.distanceY=s(e.newPoints[0],e.startPoints[0],"y"),e.distance=s(e.newPoints[0],e.startPoints[0]),e.distance>0)){if(!e.$target.is(e.$stage)&&!e.$stage.find(e.$target).length)return;t.stopPropagation(),t.preventDefault(),e.isSwiping?e.onSwipe():e.isPanning?e.onPan():e.isZooming&&e.onZoom()}},u.prototype.onSwipe=function(){var e,a=this,s=a.isSwiping,r=a.sliderStartPos.left||0;s===!0?Math.abs(a.distance)>10&&(a.canTap=!1,a.instance.group.length<2&&a.instance.opts.touch.vertical?a.isSwiping="y":a.instance.isSliding||a.instance.opts.touch.vertical===!1||"auto"===a.instance.opts.touch.vertical&&n(t).width()>800?a.isSwiping="x":(e=Math.abs(180*Math.atan2(a.distanceY,a.distanceX)/Math.PI),a.isSwiping=e>45&&e<135?"y":"x"),a.instance.isSliding=a.isSwiping,a.startPoints=a.newPoints,n.each(a.instance.slides,function(t,e){n.fancybox.stop(e.$slide),e.$slide.css("transition-duration","0ms"),e.inTransition=!1,e.pos===a.instance.current.pos&&(a.sliderStartPos.left=n.fancybox.getTranslate(e.$slide).left)}),a.instance.SlideShow&&a.instance.SlideShow.isActive&&a.instance.SlideShow.stop()):("x"==s&&(a.distanceX>0&&(a.instance.group.length<2||0===a.instance.current.index&&!a.instance.current.opts.loop)?r+=Math.pow(a.distanceX,.8):a.distanceX<0&&(a.instance.group.length<2||a.instance.current.index===a.instance.group.length-1&&!a.instance.current.opts.loop)?r-=Math.pow(-a.distanceX,.8):r+=a.distanceX),a.sliderLastPos={top:"x"==s?0:a.sliderStartPos.top+a.distanceY,left:r},a.requestId&&(i(a.requestId),a.requestId=null),a.requestId=o(function(){a.sliderLastPos&&(n.each(a.instance.slides,function(t,e){var o=e.pos-a.instance.currPos;
6n.fancybox.setTranslate(e.$slide,{top:a.sliderLastPos.top,left:a.sliderLastPos.left+o*a.canvasWidth+o*e.opts.gutter})}),a.$container.addClass("fancybox-is-sliding"))}))},u.prototype.onPan=function(){var t,e,a,s=this;s.canTap=!1,t=s.contentStartPos.width>s.canvasWidth?s.contentStartPos.left+s.distanceX:s.contentStartPos.left,e=s.contentStartPos.top+s.distanceY,a=s.limitMovement(t,e,s.contentStartPos.width,s.contentStartPos.height),a.scaleX=s.contentStartPos.scaleX,a.scaleY=s.contentStartPos.scaleY,s.contentLastPos=a,s.requestId&&(i(s.requestId),s.requestId=null),s.requestId=o(function(){n.fancybox.setTranslate(s.$content,s.contentLastPos)})},u.prototype.limitMovement=function(t,e,n,o){var i,a,s,r,c=this,l=c.canvasWidth,u=c.canvasHeight,d=c.contentStartPos.left,f=c.contentStartPos.top,h=c.distanceX,p=c.distanceY;return i=Math.max(0,.5*l-.5*n),a=Math.max(0,.5*u-.5*o),s=Math.min(l-n,.5*l-.5*n),r=Math.min(u-o,.5*u-.5*o),n>l&&(h>0&&t>i&&(t=i-1+Math.pow(-i+d+h,.8)||0),h<0&&t<s&&(t=s+1-Math.pow(s-d-h,.8)||0)),o>u&&(p>0&&e>a&&(e=a-1+Math.pow(-a+f+p,.8)||0),p<0&&e<r&&(e=r+1-Math.pow(r-f-p,.8)||0)),{top:e,left:t}},u.prototype.limitPosition=function(t,e,n,o){var i=this,a=i.canvasWidth,s=i.canvasHeight;return n>a?(t=t>0?0:t,t=t<a-n?a-n:t):t=Math.max(0,a/2-n/2),o>s?(e=e>0?0:e,e=e<s-o?s-o:e):e=Math.max(0,s/2-o/2),{top:e,left:t}},u.prototype.onZoom=function(){var e=this,a=e.contentStartPos.width,r=e.contentStartPos.height,c=e.contentStartPos.left,l=e.contentStartPos.top,u=s(e.newPoints[0],e.newPoints[1]),d=u/e.startDistanceBetweenFingers,f=Math.floor(a*d),h=Math.floor(r*d),p=(a-f)*e.percentageOfImageAtPinchPointX,g=(r-h)*e.percentageOfImageAtPinchPointY,b=(e.newPoints[0].x+e.newPoints[1].x)/2-n(t).scrollLeft(),m=(e.newPoints[0].y+e.newPoints[1].y)/2-n(t).scrollTop(),y=b-e.centerPointStartX,v=m-e.centerPointStartY,x=c+(p+y),w=l+(g+v),$={top:w,left:x,scaleX:e.contentStartPos.scaleX*d,scaleY:e.contentStartPos.scaleY*d};e.canTap=!1,e.newWidth=f,e.newHeight=h,e.contentLastPos=$,e.requestId&&(i(e.requestId),e.requestId=null),e.requestId=o(function(){n.fancybox.setTranslate(e.$content,e.contentLastPos)})},u.prototype.ontouchend=function(t){var o=this,s=Math.max((new Date).getTime()-o.startTime,1),r=o.isSwiping,c=o.isPanning,l=o.isZooming;return o.endPoints=a(t),o.$container.removeClass("fancybox-controls--isGrabbing"),n(e).off(".fb.touch"),o.requestId&&(i(o.requestId),o.requestId=null),o.isSwiping=!1,o.isPanning=!1,o.isZooming=!1,o.canTap?o.onTap(t):(o.speed=366,o.velocityX=o.distanceX/s*.5,o.velocityY=o.distanceY/s*.5,o.speedX=Math.max(.5*o.speed,Math.min(1.5*o.speed,1/Math.abs(o.velocityX)*o.speed)),void(c?o.endPanning():l?o.endZooming():o.endSwiping(r)))},u.prototype.endSwiping=function(t){var e=this,o=!1;e.instance.isSliding=!1,e.sliderLastPos=null,"y"==t&&Math.abs(e.distanceY)>50?(n.fancybox.animate(e.instance.current.$slide,{top:e.sliderStartPos.top+e.distanceY+150*e.velocityY,opacity:0},150),o=e.instance.close(!0,300)):"x"==t&&e.distanceX>50&&e.instance.group.length>1?o=e.instance.previous(e.speedX):"x"==t&&e.distanceX<-50&&e.instance.group.length>1&&(o=e.instance.next(e.speedX)),o!==!1||"x"!=t&&"y"!=t||e.instance.jumpTo(e.instance.current.index,150),e.$container.removeClass("fancybox-is-sliding")},u.prototype.endPanning=function(){var t,e,o,i=this;i.contentLastPos&&(i.instance.current.opts.touch.momentum===!1?(t=i.contentLastPos.left,e=i.contentLastPos.top):(t=i.contentLastPos.left+i.velocityX*i.speed,e=i.contentLastPos.top+i.velocityY*i.speed),o=i.limitPosition(t,e,i.contentStartPos.width,i.contentStartPos.height),o.width=i.contentStartPos.width,o.height=i.contentStartPos.height,n.fancybox.animate(i.$content,o,330))},u.prototype.endZooming=function(){var t,e,o,i,a=this,s=a.instance.current,r=a.newWidth,c=a.newHeight;a.contentLastPos&&(t=a.contentLastPos.left,e=a.contentLastPos.top,i={top:e,left:t,width:r,height:c,scaleX:1,scaleY:1},n.fancybox.setTranslate(a.$content,i),r<a.canvasWidth&&c<a.canvasHeight?a.instance.scaleToFit(150):r>s.width||c>s.height?a.instance.scaleToActual(a.centerPointStartX,a.centerPointStartY,150):(o=a.limitPosition(t,e,r,c),n.fancybox.setTranslate(a.content,n.fancybox.getTranslate(a.$content)),n.fancybox.animate(a.$content,o,150)))},u.prototype.onTap=function(t){var e,o=this,i=n(t.target),s=o.instance,r=s.current,c=t&&a(t)||o.startPoints,l=c[0]?c[0].x-o.$stage.offset().left:0,u=c[0]?c[0].y-o.$stage.offset().top:0,d=function(e){var i=r.opts[e];if(n.isFunction(i)&&(i=i.apply(s,[r,t])),i)switch(i){case"close"
6:s.close(o.startEvent);break;case"toggleControls":s.toggleControls(!0);break;case"next":s.next();break;case"nextOrClose":s.group.length>1?s.next():s.close(o.startEvent);break;case"zoom":"image"==r.type&&(r.isLoaded||r.$ghost)&&(s.canPan()?s.scaleToFit():s.isScaledDown()?s.scaleToActual(l,u):s.group.length<2&&s.close(o.startEvent))}};if(!(t.originalEvent&&2==t.originalEvent.button||s.isSliding||l>i[0].clientWidth+i.offset().left)){if(i.is(".fancybox-bg,.fancybox-inner,.fancybox-outer,.fancybox-container"))e="Outside";else if(i.is(".fancybox-slide"))e="Slide";else{if(!s.current.$content||!s.current.$content.has(t.target).length)return;e="Content"}if(o.tapped){if(clearTimeout(o.tapped),o.tapped=null,Math.abs(l-o.tapX)>50||Math.abs(u-o.tapY)>50||s.isSliding)return this;d("dblclick"+e)}else o.tapX=l,o.tapY=u,r.opts["dblclick"+e]&&r.opts["dblclick"+e]!==r.opts["click"+e]?o.tapped=setTimeout(function(){o.tapped=null,d("click"+e)},300):d("click"+e);return this}},n(e).on("onActivate.fb",function(t,e){e&&!e.Guestures&&(e.Guestures=new u(e))}),n(e).on("beforeClose.fb",function(t,e){e&&e.Guestures&&e.Guestures.destroy()})}(window,document,window.jQuery),function(t,e){"use strict";var n=function(t){this.instance=t,this.init()};e.extend(n.prototype,{timer:null,isActive:!1,$button:null,speed:3e3,init:function(){var t=this;t.$button=t.instance.$refs.toolbar.find("[data-fancybox-play]").on("click",function(){t.toggle()}),(t.instance.group.length<2||!t.instance.group[t.instance.currIndex].opts.slideShow)&&t.$button.hide()},set:function(){var t=this;t.instance&&t.instance.current&&(t.instance.current.opts.loop||t.instance.currIndex<t.instance.group.length-1)?t.timer=setTimeout(function(){t.instance.next()},t.instance.current.opts.slideShow.speed||t.speed):(t.stop(),t.instance.idleSecondsCounter=0,t.instance.showControls())},clear:function(){var t=this;clearTimeout(t.timer),t.timer=null},start:function(){var t=this,e=t.instance.current;t.instance&&e&&(e.opts.loop||e.index<t.instance.group.length-1)&&(t.isActive=!0,t.$button.attr("title",e.opts.i18n[e.opts.lang].PLAY_STOP).addClass("fancybox-button--pause"),e.isComplete&&t.set())},stop:function(){var t=this,e=t.instance.current;t.clear(),t.$button.attr("title",e.opts.i18n[e.opts.lang].PLAY_START).removeClass("fancybox-button--pause"),t.isActive=!1},toggle:function(){var t=this;t.isActive?t.stop():t.start()}}),e(t).on({"onInit.fb":function(t,e){e&&!e.SlideShow&&(e.SlideShow=new n(e))},"beforeShow.fb":function(t,e,n,o){var i=e&&e.SlideShow;o?i&&n.opts.slideShow.autoStart&&i.start():i&&i.isActive&&i.clear()},"afterShow.fb":function(t,e,n){var o=e&&e.SlideShow;o&&o.isActive&&o.set()},"afterKeydown.fb":function(n,o,i,a,s){var r=o&&o.SlideShow;!r||!i.opts.slideShow||80!==s&&32!==s||e(t.activeElement).is("button,a,input")||(a.preventDefault(),r.toggle(
6))},"beforeClose.fb onDeactivate.fb":function(t,e){var n=e&&e.SlideShow;n&&n.stop()}}),e(t).on("visibilitychange",function(){var n=e.fancybox.getInstance(),o=n&&n.SlideShow;o&&o.isActive&&(t.hidden?o.clear():o.set())})}(document,window.jQuery),function(t,e){"use strict";var n=function(){var e,n,o,i=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],a={};for(n=0;n<i.length;n++)if(e=i[n],e&&e[1]in t){for(o=0;o<e.length;o++)a[i[0][o]]=e[o];return a}return!1}();if(!n)return void(e.fancybox.defaults.btnTpl.fullScreen=!1);var o={request:function(e){e=e||t.documentElement,e[n.requestFullscreen](e.ALLOW_KEYBOARD_INPUT)},exit:function(){t[n.exitFullscreen]()},toggle:function(e){e=e||t.documentElement,this.isFullscreen()?this.exit():this.request(e)},isFullscreen:function(){return Boolean(t[n.fullscreenElement])},enabled:function(){return Boolean(t[n.fullscreenEnabled])}};e(t).on({"onInit.fb":function(t,e){var n,i=e.$refs.toolbar.find("[data-fancybox-fullscreen]");e&&!e.FullScreen&&e.group[e.currIndex].opts.fullScreen?(n=e.$refs.container,n.on("click.fb-fullscreen","[data-fancybox-fullscreen]",function(t){t.stopPropagation(),t.preventDefault(),o.toggle(n[0])}),e.opts.fullScreen&&e.opts.fullScreen.autoStart===!0&&o.request(n[0]),e.FullScreen=o):i.hide()},"afterKeydown.fb":function(t,e,n,o,i){e&&e.FullScreen&&70===i&&(o.preventDefault(),e.FullScreen.toggle(e.$refs.container[0]))},"beforeClose.fb":function(t){t&&t.FullScreen&&o.exit()}}),e(t).on(n.fullscreenchange,function(){var t=e.fancybox.getInstance();t.current&&"image"===t.current.type&&t.isAnimating&&(t.current.$content.css("transition","none"),t.isAnimating=!1,t.update(!0,!0,0))})}(document,window.jQuery),function(t,e){"use strict";var n=function(t){this.instance=t,this.init()};e.extend(n.prototype,{$button:null,$grid:null,$list:null,isVisible:!1,init:function(){var t=this,e=t.instance.group[0],n=t.instance.group[1];t.$button=t.instance.$refs.toolbar.find("[data-fancybox-thumbs]"),t.instance.group.length>1&&t.instance.group[t.instance.currIndex].opts.thumbs&&("image"==e.type||e.opts.thumb||e.opts.$thumb)&&("image"==n.type||n.opts.thumb||n.opts.$thumb)?(t.$button.on("click",function(){t.toggle()}),t.isActive=!0):(t.$button.hide(),t.isActive=!1)},create:function(){var t,n,o=this.instance;this.$grid=e('<div class="fancybox-thumbs"></div>').appendTo(o.$refs.container),t="<ul>",e.each(o.group,function(e,o){n=o.opts.thumb||(o.opts.$thumb?o.opts.$thumb.attr("src"):null),n||"image"!==o.type||(n=o.src),n&&n.length&&(t+='<li data-index="'+e+'"  tabindex="0" class="fancybox-thumbs-loading"><img data-src="'+n+'" /></li>')}),t+="</ul>",this.$list=e(t).appendTo(this.$grid).on("click","li",function(){o.jumpTo(e(this).data("index"))}),this.$list.find("img").hide().one("load",function(){var t,n,o,i,a=e(this).parent().removeClass("fancybox-thumbs-loading"),s=a.outerWidth(),r=a.outerHeight();t=this.naturalWidth||this.width,n=this.naturalHeight||this.height,o=t/s,i=n/r,o>=1&&i>=1&&(o>i?(t/=i,n=r):(t=s,n/=o)),e(this).css({width:Math.floor(t),height:Math.floor(n),"margin-top":Math.min(0,Math.floor(.3*r-.3*n)),"margin-left":Math.min(0,Math.floor(.5*s-.5*t))}).show()}).each(function(){this.src=e(this).data("src")})},focus:function(){this.instance.current&&this.$list.children().removeClass("fancybox-thumbs-active").filter('[data-index="'+this.instance.current.index+'"]').addClass("fancybox-thumbs-active").focus()},close:function(){this.$grid.hide()},update:function(){this.instance.$refs.container.toggleClass("fancybox-show-thumbs",this.isVisible),this.isVisible?(this.$grid||this.create(),this.instance.trigger("onThumbsShow"),this.focus()):this.$grid&&this.instance.trigger("onThumbsHide"),this.instance.update(
6)},hide:function(){this.isVisible=!1,this.update()},show:function(){this.isVisible=!0,this.update()},toggle:function(){this.isVisible=!this.isVisible,this.update()}}),e(t).on({"onInit.fb":function(t,e){e&&!e.Thumbs&&(e.Thumbs=new n(e))},"beforeShow.fb":function(t,e,n,o){var i=e&&e.Thumbs;if(i&&i.isActive){if(n.modal)return i.$button.hide(),void i.hide();o&&e.opts.thumbs.autoStart===!0&&i.show(),i.isVisible&&i.focus()}},"afterKeydown.fb":function(t,e,n,o,i){var a=e&&e.Thumbs;a&&a.isActive&&71===i&&(o.preventDefault(),a.toggle())},"beforeClose.fb":function(t,e){var n=e&&e.Thumbs;n&&n.isVisible&&e.opts.thumbs.hideOnClose!==!1&&n.close()}})}(document,window.jQuery),function(t,e,n){"use strict";function o(){var t=e.location.hash.substr(1),n=t.split("-"),o=n.length>1&&/^\+?\d+$/.test(n[n.length-1])?parseInt(n.pop(-1),10)||1:1,i=n.join("-");return o<1&&(o=1),{hash:t,index:o,gallery:i}}function i(t){var e;""!==t.gallery&&(e=n("[data-fancybox='"+n.escapeSelector(t.gallery)+"']").eq(t.index-1),e.length?e.trigger("click"):n("#"+n.escapeSelector(t.gallery)).trigger("click"))}function a(t){var e;return!!t&&(e=t.current?t.current.opts:t.opts,e.$orig?e.$orig.data("fancybox"):e.hash||"")}n.escapeSelector||(n.escapeSelector=function(t){var e=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,n=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t};return(t+"").replace(e,n)});var s=null,r=null;n(function(){setTimeout(function(){n.fancybox.defaults.hash!==!1&&(n(t).on({"onInit.fb":function(t,e){var n,i;e.group[e.currIndex].opts.hash!==!1&&(n=o(),i=a(e),i&&n.gallery&&i==n.gallery&&(e.currIndex=n.index-1))},"beforeShow.fb":function(n,o,i,c){var l;i.opts.hash!==!1&&(l=a(o),l&&""!==l&&(e.location.hash.indexOf(l)<0&&(o.opts.origHash=e.location.hash),s=l+(o.group.length>1?"-"+(i.index+1):""),"replaceState"in e.history?(r&&clearTimeout(r),r=setTimeout(function(){e.history[c?"pushState":"replaceState"]({},t.title,e.location.pathname+e.location.search+"#"+s),r=null},300)):e.location.hash=s))},"beforeClose.fb":function(o,i,c){var l,u;r&&clearTimeout(r),c.opts.hash!==!1&&(l=a(i),u=i&&i.opts.origHash?i.opts.origHash:"",l&&""!==l&&("replaceState"in history?e.history.replaceState({},t.title,e.location.pathname+e.location.search+u):(e.location.hash=u,n(e).scrollTop(i.scrollTop).scrollLeft(i.scrollLeft))),s=null)}}),n(e).on("hashchange.fb",function(){var t=o();n.fancybox.getInstance()?!s||s===t.gallery+"-"+t.index||1===t.index&&s==t.gallery||(s=null,n.fancybox.close()):""!==t.gallery&&i(t)}),n(e).one("unload.fb popstate.fb",function(){n.fancybox.getInstance("close",!0,0)}),i(o()))},50)})}(document,window,window.jQuery);
vendor: 18,859 bytes, lines 7-8
7(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.Popper=t()})(this,function(){'use strict';function e(e){return e&&'[object Function]'==={}.toString.call(e)}function t(e,t){if(1!==e.nodeType)return[];var o=window.getComputedStyle(e,null);return t?o[t]:o}function o(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function n(e){if(!e||-1!==['HTML','BODY','#document'].indexOf(e.nodeName))return window.document.body;var i=t(e),r=i.overflow,p=i.overflowX,s=i.overflowY;return /(auto|scroll)/.test(r+s+p)?e:n(o(e))}function r(e){var o=e&&e.offsetParent,i=o&&o.nodeName;return i&&'BODY'!==i&&'HTML'!==i?-1!==['TD','TABLE'].indexOf(o.nodeName)&&'static'===t(o,'position')?r(o):o:window.document.documentElement}function p(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||r(e.firstElementChild)===e)}function s(e){return null===e.parentNode?e:s(e.parentNode)}function d(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return window.document.documentElement;var o=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,i=o?e:t,n=o?t:e,a=document.createRange();a.setStart(i,0),a.setEnd(n,0);var f=a.commonAncestorContainer;if(e!==f&&t!==f||i.contains(n))return p(f)?f:r(f);var l=s(e);return l.host?d(l.host,t):d(e,s(t).host)}function a(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:'top',o='top'===t?'scrollTop':'scrollLeft',i=e.nodeName;if('BODY'===i||'HTML'===i){var n=window.document.documentElement,r=window.document.scrollingElement||n;return r[o]}return e[o]}function f(e,t){var o=2<arguments.length&&void 0!==arguments[2]&&arguments[2],i=a(t,'top'),n=a(t,'left'),r=o?-1:1;return e.top+=i*r,e.bottom+=i*r,e.left+=n*r,e.right+=n*r,e}function l(e,t){var o='x'===t?'Left':'Top',i='Left'==o?'Right':'Bottom';return+e['border'+o+'Width'].split('px')[0]+ +e['border'+i+'Width'].split('px')[0]}function m(e,t,o,i){return _(t['offset'+e],o['client'+e],o['offset'+e],ie()?o['offset'+e]+i['margin'+('Height'===e?'Top':'Left')]+i['margin'+('Height'===e?'Bottom':'Right')]:0)}function h(){var e=window.document.body,t=window.document.documentElement,o=ie()&&window.getComputedStyle(t);return{height:m('Height',e,t,o),width:m('Width',e,t,o)}}function c(e){return se({},e,{right:e.left+e.width,bottom:e.top+e.height})}function g(e){var o={};if(ie())try{o=e.getBoundingClientRect();var i=a(e,'top'),n=a(e,'left');o.top+=i,o.left+=n,o.bottom+=i,o.right+=n}catch(e){}else o=e.getBoundingClientRect();var r={left:o.left,top:o.top,width:o.right-o.left,height:o.bottom-o.top},p='HTML'===e.nodeName?h():{},s=p.width||e.clientWidth||r.right-r.left,d=p.height||e.clientHeight||r.bottom-r.top,f=e.offsetWidth-s,m=e.offsetHeight-d;if(f||m){var g=t(e);f-=l(g,'x'),m-=l(g,'y'),r.width-=f,r.height-=m}return c(r)}function u(e,o){var i=ie(),r='HTML'===o.nodeName,p=g(e),s=g(o),d=n(e),a=t(o),l=+a.borderTopWidth.split('px')[0],m=+a.borderLeftWidth.split('px')[0],h=c({top:p.top-s.top-l,left:p.left-s.left-m,width:p.width,height:p.height});if(h.marginTop=0,h.marginLeft=0,!i&&r){var u=+a.marginTop.split('px')[0],b=+a.marginLeft.split('px')[0];h.top-=l-u,h.bottom-=l-u,h.left-=m-b,h.right-=m-b,h.marginTop=u,h.marginLeft=b}return(i?o.contains(d):o===d&&'BODY'!==d.nodeName)&&(h=f(h,o)),h}function b(e){var t=window.document.documentElement,o=u(e,t),i=_(t.clientWidth,window.innerWidth||0),n=_(t.clientHeight,window.innerHeight||0),r=a(t),p=a(t,'left'),s={top:r-o.top+o.marginTop,left:p-o.left+o.marginLeft,width:i,height:n};return c(s)}function y(e){var i=e.nodeName;return'BODY'===i||'HTML'===i?!1:'fixed'===t(e,'position')||y(o(e))}function w(e,t,i,r){var p={top:0,left:0},s=d(e,t);if('viewport'===r)p=b(s);else{var a;'scrollParent'===r?(a=n(o(e)),'BODY'===a.nodeName&&(a=window.document.documentElement)):'window'===r?a=window.document.documentElement:a=r;var f=u(a,s);if('HTML'===a.nodeName&&!y(s)){var l=h(),m=l.height,c=l.width;p.top+=f.top-f.marginTop,p.bottom=m+f.top,p.left+=f.left-f.marginLeft,p.right=c+f.left}else p=f}return p.left+=i,p.top+=i,p.right-=i,p.bottom-=i,p}function v(e){var t=e.width,o=e.height;return t*o}function E(e,t,o,i,n){var r=5<arguments.length&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf('auto'))return e;var p=w(o,i,r,n),s={top:{width:p.width,height:t.top-p.top},right:{width:p.right-t.right,height:p.height},bottom:{width:p.width,height:p.bottom-t.bottom},left:{width:t.left-p.left,height:p.height}},d=Object.keys(s).map(function(e){return se({key:e},s[e],{area:v(s[e])})}).sort(function(e,t){return t.area-e.area}),a=d.filter(function(e){var t=e.width,i=e.height;return t>=o.clientWidth&&i>=o.clientHeight}),f=0<a.length?a[0].key:d[0].key,l=e.split('-')[1];return f+(l?'-'+l:'')}function x(e,t,o){var i=d(t,o);return u(o,i)}function O(e){var t=window.getComputedStyle(e),o=parseFloat(t.marginTop)+parseFloat(t.marginBottom),i=parseFloat(t.marginLeft)+parseFloat(t.marginRight),n={width:e.offsetWidth+i,height:e.offsetHeight+o};return n}function L(e){var t={left:'right',right:'left',bottom:'top',top:'bottom'};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function S(e,t,o){o=o.split('-')[0];var i=O(e),n={width:i.width,height:i.height},r=-1!==['right','left'].indexOf(o),p=r?'top':'left',s=r?'left':'top',d=r?'height':'width',a=r?'width':'height';return n[p]=t[p]+t[d]/2-i[d]/2,n[s]=o===s?t[s]-i[a]:t[L(s)],n}function T(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function C(e,t,o){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===o});var i=T(e,function(e){return e[t]===o});return e.indexOf(i)}function N(t,o,i){var n=void 0===i?t:t.slice(0,C(t,'name',i));return n.forEach(function(t){t.function&&console.warn('`modifier.function` is deprecated, use `modifier.fn`!');var i=t.function||t.fn;t.enabled&&e(i)&&(o.offsets.popper=c(o.offsets.popper),o.offsets.reference=c(o.offsets.reference),o=i(o,t))}),o}function k(){if(!this.state.isDestroyed){var e={instance:this,styles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=x(this.state,this.popper,this.reference),e.placement=E(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.offsets.popper=S(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position='absolute',e=N(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function W(e,t){return e.some(function(e){var o=e.name,i=e.enabled;return i&&o===t})}function B(e){for(var t=[!1,'ms','Webkit','Moz','O'],o=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<t.length-1;n++){var i=t[n],r=i?''+i+o:e;if('undefined'!=typeof window.document.body.style[r])return r}return null}function D(){return this.state.isDestroyed=!0,W(this.modifiers,'applyStyle')&&(this.popper.removeAttribute('x-placement'),this.popper.style.left='',this.popper.style.position='',this.popper.style.top='',this.popper.style[B('transform')]=''),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function H(e,t,o,i){var r='BODY'===e.nodeName,p=r?window:e;p.addEventListener(t,o,{passive:!0}),r||H(n(p.parentNode),t,o,i),i.push(p)}function P(e,t,o,i){o.updateBound=i,window.addEventListener('resize',o.updateBound,{passive:!0});var r=n(e);return H(r,'scroll',o.updateBound,o.scrollParents),o.scrollElement=r,o.eventsEnabled=!0,o}function A(){this.state.eventsEnabled||(this.state=P(this.reference,this.options,this.state,this.scheduleUpdate))}function M(e,t){return window.removeEventListener('resize',t.updateBound),t.scrollParents.forEach(function(e){e.removeEventListener('scroll',t.updateBound)}),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t}function I(){this.state.eventsEnabled&&(window.cancelAnimationFrame(this.scheduleUpdate),this.state=M(this.reference,this.state))}function R(e){return''!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function U(e,t){Object.keys(t).forEach(function(o){var i='';-1!==['width','height','top','right','bottom','left'].indexOf(o)&&R(t[o])&&(i='px'),e.style[o]=t[o]+i})}function Y(e,t){Object.keys(t).forEach(function(o){var i=t[o];!1===i?e.removeAttribute(o):e.setAttribute(o,t[o])})}function F(e,t,o){var i=T(e,function(e){var o=e.name;return o===t}),n=!!i&&e.some(function(e){return e.name===o&&e.enabled&&e.order<i.order});if(!n){var r='`'+t+'`';console.warn('`'+o+'`'+' modifier is required by '+r+' modifier in order to work, be sure to include it before '+r+'!')}return n}function j(e){return'end'===e?'start':'start'===e?'end':e}function K(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],o=ae.indexOf(e),i=ae.slice(o+1).concat(ae.slice(0,o));return t?i.reverse():i}function q(e,t,o,i){var n=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),r=+n[1],p=n[2];if(!r)return e;if(0===p.indexOf('%')){var s;switch(p){case'%p':s=o;break;case'%':case'%r':default:s=i;}var d=c(s);return d[t]/100*r}if('vh'===p||'vw'===p){var a;return a='vh'===p?_(document.documentElement.clientHeight,window.innerHeight||0):_(document.documentElement.clientWidth,window.innerWidth||0),a/100*r}return r}function G(e,t,o,i){var n=[0,0],r=-1!==['right','left'].indexOf(i),p=e.split(/(\+|\-)/).map(function(e){return e.trim()}),s=p.indexOf(T(p,function(e){return-1!==e.search(/,|\s/)}));p[s]&&-1===p[s].indexOf(',')&&console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');var d=/\s*,\s*|\s+/,a=-1===s?[p]:[p.slice(0,s).concat([p[s].split(d)[0]]),[p[s].split(d)[1]].concat(p.slice(s+1))];return a=a.map(function(e,i){var n=(1===i?!r:r)?'height':'width',p=!1;return e.reduce(function(e,t){return''===e[e.length-1]&&-1!==['+','-'].indexOf(t)?(e[e.length-1]=t,p=!0,e):p?(e[e.length-1]+=t,p=!1,e):e.concat(t)},[]).map(function(e){return q(e,n,t,o)})}),a.forEach(function(e,t){e.forEach(function(o,i){R(o)&&(n[t]+=o*('-'===e[i-1]?-1:1))})}),n}for(var z=Math.min,V=Math.floor,_=Math.max,X=['native code','[object MutationObserverConstructor]'],Q=function(e){return X.some(function(t){return-1<(e||'').toString().indexOf(t)})},J='undefined'!=typeof window,Z=['Edge','Trident','Firefox'],$=0,ee=0;ee<Z.length;ee+=1)if(J&&0<=navigator.userAgent.indexOf(Z[ee])){$=1;break}var i,te=J&&Q(window.MutationObserver),oe=te?function(e){var t=!1,o=0,i=document.createElement('span'),n=new MutationObserver(function(){e(),t=!1});return n.observe(i,{attributes:!0}),function(){t||(t=!0,i.setAttribute('x-index',o),++o)}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},$))}},ie=function(){return void 0==i&&(i=-1!==navigator.appVersion.indexOf('MSIE 10')),i},ne=function(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')},re=function(){function e(e,t){for(var o,n=0;n<t.length;n++)o=t[n],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,o,i){return o&&e(t.prototype,o),i&&e(t,i),t}}(),pe=function(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e},se=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var i in t=arguments[o],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},de=['auto-start','auto','auto-end','top-start','top','top-end','right-start','right','right-end','bottom-end','bottom','bottom-start','left-end','left','left-start'],ae=de.slice(3),fe={FLIP:'flip',CLOCKWISE:'clockwise',COUNTERCLOCKWISE:'counterclockwise'},le=function(){function t(o,i){var n=this,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};ne(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(n.update)},this.update=oe(this.update.bind(this)),this.options=se({},t.Defaults,r),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=o.jquery?o[0]:o,this.popper=i.jquery?i[0]:i,this.options.modifiers={},Object.keys(se({},t.Defaults.modifiers,r.modifiers)).forEach(function(e){n.options.modifiers[e]=se({},t.Defaults.modifiers[e]||{},r.modifiers?r.modifiers[e]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return se({name:e},n.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(t){t.enabled&&e(t.onLoad)&&t.onLoad(n.reference,n.popper,n.options,t,n.state)}),this.update();var p=this.options.eventsEnabled;p&&this.enableEventListeners(),this.state.eventsEnabled=p}return re(t,[{key:'update',value:function(){return k.call(this)}},{key:'destroy',value:function(){return D.call(this)}},{key:'enableEventListeners',value:function(){return A.call(this)}},{key:'disableEventListeners',value:function(){return I.call(this)}}]),t}();return le.Utils=('undefined'==typeof window?global:window).PopperUtils,le.placements=de,le.Defaults={placement:'bottom',eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,o=t.split('-')[0],i=t.split('-')[1];if(i){var n=e.offsets,r=n.reference,p=n.popper,s=-1!==['bottom','top'].indexOf(o),d=s?'left':'top',a=s?'width':'height',f={start:pe({},d,r[d]),end:pe({},d,r[d]+r[a]-p[a])};e.offsets.popper=se({},p,f[i])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var o,i=t.offset,n=e.placement,r=e.offsets,p=r.popper,s=r.reference,d=n.split('-')[0];return o=R(+i)?[+i,0]:G(i,p,s,d),'left'===d?(p.top+=o[0],p.left-=o[1]):'right'===d?(p.top+=o[0],p.left+=o[1]):'top'===d?(p.left+=o[0],p.top-=o[1]):'bottom'===d&&(p.left+=o[0],p.top+=o[1]),e.popper=p,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var o=t.boundariesElement||r(e.instance.popper);e.instance.reference===o&&(o=r(o));var i=w(e.instance.popper,e.instance.reference,t.padding,o);t.boundaries=i;var n=t.priority,p=e.offsets.popper,s={primary:function(e){var o=p[e];return p[e]<i[e]&&!t.escapeWithReference&&(o=_(p[e],i[e])),pe({},e,o)},secondary:function(e){var o='right'===e?'left':'top',n=p[o];return p[e]>i[e]&&!t.escapeWithReference&&(n=z(p[o],i[e]-('right'===e?p.width:p.height))),pe({},o,n)}};return n.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';p=se({},p,s[t](e))}),e.offsets.popper=p,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,i=t.reference,n=e.placement.split('-')[0],r=V,p=-1!==['top','bottom'].indexOf(n),s=p?'right':'bottom',d=p?'left':'top',a=p?'width':'height';return o[s]<r(i[d])&&(e.offsets.popper[d]=r(i[d])-o[a]),o[d]>r(i[s])&&(e.offsets.popper[d]=r(i[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){if(!F(e.instance.modifiers,'arrow','keepTogether'))return e;var o=t.element;if('string'==typeof o){if(o=e.instance.popper.querySelector(o),!o)return e;}else if(!e.instance.popper.contains(o))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var i=e.placement.split('-')[0],n=e.offsets,r=n.popper,p=n.reference,s=-1!==['left','right'].indexOf(i),d=s?'height':'width',a=s?'top':'left',f=s?'left':'top',l=s?'bottom':'right',m=O(o)[d];p[l]-m<r[a]&&(e.offsets.popper[a]-=r[a]-(p[l]-m)),p[a]+m>r[l]&&(e.offsets.popper[a]+=p[a]+m-r[l]);var h=p[a]+p[d]/2-m/2,g=h-c(e.offsets.popper)[a];return g=_(z(r[d]-m,g),0),e.arrowElement=o,e.offsets.arrow={},e.offsets.arrow[a]=Math.round(g),e.offsets.arrow[f]='',e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(W(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var o=w(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement),i=e.placement.split('-')[0],n=L(i),r=e.placement.split('-')[1]||'',p=[];switch(t.behavior){case fe.FLIP:p=[i,n];break;case fe.CLOCKWISE:p=K(i);break;case fe.COUNTERCLOCKWISE:p=K(i,!0);break;default:p=t.behavior;}return p.forEach(function(s,d){if(i!==s||p.length===d+1)return e;i=e.placement.split('-')[0],n=L(i);var a=e.offsets.popper,f=e.offsets.reference,l=V,m='left'===i&&l(a.right)>l(f.left)||'right'===i&&l(a.left)<l(f.right)||'top'===i&&l(a.bottom)>l(f.top)||'bottom'===i&&l(a.top)<l(f.bottom),h=l(a.left)<l(o.left),c=l(a.right)>l(o.right),g=l(a.top)<l(o.top),u=l(a.bottom)>l(o.bottom),b='left'===i&&h||'right'===i&&c||'top'===i&&g||'bottom'===i&&u,y=-1!==['top','bottom'].indexOf(i),w=!!t.flipVariations&&(y&&'start'===r&&h||y&&'end'===r&&c||!y&&'start'===r&&g||!y&&'end'===r&&u);(m||b||w)&&(e.flipped=!0,(m||b)&&(i=p[d+1]),w&&(r=j(r)),e.placement=i+(r?'-'+r:''),e.offsets.popper=se({},e.offsets.popper,S(e.instance.popper,e.offsets.reference,e.placement)),e=N(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport'},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split('-')[0],i=e.offsets,n=i.popper,r=i.reference,p=-1!==['left','right'].indexOf(o),s=-1===['top','left'].indexOf(o);return n[p?'left':'top']=r[t]-(s?n[p?'width':'height']:0),e.placement=L(t),e.offsets.popper=c(n),e}},hide:{order:800,enabled:!0,fn:function(e){if(!F(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,o=T(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottom<o.top||t.left>o.right||t.top>o.bottom||t.right<o.left){if(!0===e.hide)return e;e.hide=!0,e.attributes['x-out-of-boundaries']=''}else{if(!1===e.hide)return e;e.hide=!1,e.attributes['x-out-of-boundaries']=!1}return e}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var o=t.x,i=t.y,n=e.offsets.popper,p=T(e.instance.modifiers,function(e){return'applyStyle'===e.name}).gpuAcceleration;void 0!==p&&console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');var s,d,a=void 0===p?t.gpuAcceleration:p,f=r(e.instance.popper),l=g(f),m={position:n.position},h={left:V(n.left),top:V(n.top),bottom:V(n.bottom),right:V(n.right)},c='bottom'===o?'top':'bottom',u='right'===i?'left':'right',b=B('transform');if(d='bottom'==c?-l.height+h.bottom:h.top,s='right'==u?-l.width+h.right:h.left,a&&b)m[b]='translate3d('+s+'px, '+d+'px, 0)',m[c]=0,m[u]=0,m.willChange='transform';else{var y='bottom'==c?-1:1,w='right'==u?-1:1;m[c]=d*y,m[u]=s*w,m.willChange=c+', '+u}var v={"x-placement":e.placement};return e.attributes=se({},v,e.attributes),e.styles=se({},m,e.styles),e},gpuAcceleration:!0,x:'bottom',y:'right'},applyStyle:{order:900,enabled:!0,fn:function(e){return U(e.instance.popper,e.styles),Y(e.instance.popper,e.attributes),e.offsets.arrow&&U(e.arrowElement,e.offsets.arrow),e},onLoad:function(e,t,o,i,n){var r=x(n,t,e),p=E(o.placement,r,t,e,o.modifiers.flip.boundariesElement,o.modifiers.flip.padding);return t.setAttribute('x-placement',p),U(t,{position:'absolute'}),o},gpuAcceleration:void 0}}},le});
8/
8*!
9* Bootstrap v4.0.0-beta (https://getbootstrap.com)
10* Copyright 2011-2017 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
11* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
12*/
vendor: 50,904 bytes, line 12
12if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");!function(t){var e=jQuery.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1||e[0]>=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}(),function(){function t(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function e(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=function(t){function e(t){return{}.toString.call(t).match(/\s([a-zA-Z]+)/)[1].toLowerCase()}function n(t){return(t[0]||t).nodeType}function i(){return{bindType:s.end,delegateType:s.end,handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}}}function o(){if(window.QUnit)return!1;var t=document.createElement("bootstrap");for(var e in a)if(void 0!==t.style[e])return{end:a[e]};return!1}function r(e){var n=this,i=!1;return t(this).one(l.TRANSITION_END,function(){i=!0}),setTimeout(function(){i||l.triggerTransitionEnd(n)},e),this}var s=!1,a={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},l={TRANSITION_END:"bsTransitionEnd",getUID:function(t){do{t+=~~(1e6*Math.random())}while(document.getElementById(t));return t},getSelectorFromElement:function(e){var n=e.getAttribute("data-target");n&&"#"!==n||(n=e.getAttribute("href")||"");try{return t(n).length>0?n:null}catch(t){return null}},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(e){t(e).trigger(s.end)},supportsTransitionEnd:function(){return Boolean(s)},typeCheckConfig:function(t,i,o){for(var r in o)if(o.hasOwnProperty(r)){var s=o[r],a=i[r],l=a&&n(a)?"element":e(a);if(!new RegExp(s).test(l))throw new Error(t.toUpperCase()+': Option "'+r+'" provided type "'+l+'" but expected type "'+s+'".')}}};return s=o(),t.fn.emulateTransitionEnd=r,l.supportsTransitionEnd()&&(t.event.special[l.TRANSITION_END]=i()),l}(jQuery),s=(function(t){var e="alert",i=t.fn[e],s={DISMISS:'[data-dismiss="alert"]'},a={CLOSE:"close.bs.alert",CLOSED:"closed.bs.alert",CLICK_DATA_API:"click.bs.alert.data-api"},l={ALERT:"alert",FADE:"fade",SHOW:"show"},h=function(){function e(t){n(this,e),this._element=t}return e.prototype.close=function(t){t=t||this._element;var e=this._getRootElement(t);this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},e.prototype.dispose=function(){t.removeData(this._element,"bs.alert"),this._element=null},e.prototype._getRootElement=function(e){var n=r.getSelectorFromElement(e),i=!1;return n&&(i=t(n)[0]),i||(i=t(e).closest("."+l.ALERT)[0]),i},e.prototype._triggerCloseEvent=function(e){var n=t.Event(a.CLOSE);return t(e).trigger(n),n},e.prototype._removeElement=function(e){var n=this;t(e).removeClass(l.SHOW),r.supportsTransitionEnd()&&t(e).hasClass(l.FADE)?t(e).one(r.TRANSITION_END,function(t){return n._destroyElement(e,t)}).emulateTransitionEnd(150):this._destroyElement(e)},e.prototype._destroyElement=function(e){t(e).detach().trigger(a.CLOSED).remove()},e._jQueryInterface=function(n){return this.each(function(){var i=t(this),o=i.data("bs.alert");o||(o=new e(this),i.data("bs.alert",o)),"close"===n&&o[n](this)})},e._handleDismiss=function(t){return function(e){e&&e.preventDefault(),t.close(this)}},o(e,null,[{key:"VERSION",get:function(){return"4.0.0-beta"}}]),e}();t(document).on(a.CLICK_DATA_API,s.DISMISS,h._handleDismiss(new h)),t.fn[e]=h._jQueryInterface,t.fn[e].Constructor=h,t.fn[e].noConflict=function(){return t.fn[e]=i,h._jQueryInterface}}(jQuery),function(t){var e="button",i=t.fn[e],r={ACTIVE:"active",BUTTON:"btn",FOCUS:"focus"},s={DATA_TOGGLE_CARROT:'[data-toggle^="button"]',DATA_TOGGLE:'[data-toggle="buttons"]',INPUT:"input",ACTIVE:".active",BUTTON:".btn"},a={CLICK_DATA_API:"click.bs.button.data-api",FOCUS_BLUR_DATA_API:"focus.bs.button.data-api blur.bs.button.data-api"},l=function(){function e(t){n(this,e),this._element=t}return e.prototype.toggle=function(){var e=!0,n=!0,i=t(this._element).closest(s.DATA_TOGGLE)[0];if(i){var o=t(this._element).find(s.INPUT)[0];if(o){if("radio"===o.type)if(o.checked&&t(this._element).hasClass(r.ACTIVE))e=!1;else{var a=t(i).find(s.ACTIVE)[0];a&&t(a).removeClass(r.ACTIVE)}if(e){if(o.hasAttribute("disabled")||i.hasAttribute("disabled")||o.classList.contains("disabled")||i.classList.contains("disabled"))return;o.checked=!t(this._element).hasClass(r.ACTIVE),t(o).trigger("change")}o.focus(),n=!1}}n&&this._element.setAttribute("aria-pressed",!t(this._element).hasClass(r.ACTIVE)),e&&t(this._element).toggleClass(r.ACTIVE)},e.prototype.dispose=function(){t.removeData(this._element,"bs.button"),this._element=null},e._jQueryInterface=function(n){return this.each(function(){var i=t(this).data("bs.button");i||(i=new e(this),t(this).data("bs.button",i)),"toggle"===n&&i[n]()})},o(e,null,[{key:"VERSION",get:function(){return"4.0.0-beta"}}]),e}();t(document).on(a.CLICK_DATA_API,s.DATA_TOGGLE_CARROT,function(e){e.preventDefault();var n=e.target;t(n).hasClass(r.BUTTON)||(n=t(n).closest(s.BUTTON)),l._jQueryInterface.call(t(n),"toggle")}).on(a.FOCUS_BLUR_DATA_API,s.DATA_TOGGLE_CARROT,function(e){var n=t(e.target).closest(s.BUTTON)[0];t(n).toggleClass(r.FOCUS,/^focus(in)?$/.test(e.type))}),t.fn[e]=l._jQueryInterface,t.fn[e].Constructor=l,t.fn[e].noConflict=function(){return t.fn[e]=i,l._jQueryInterface}}(jQuery),function(t){var e="carousel",s="bs.carousel",a="."+s,l=t.fn[e],h={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0},c={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean"},u={NEXT:"next",PREV:"prev",LEFT:"left",RIGHT:"right"},d={SLIDE:"slide"+a,SLID:"slid"+a,KEYDOWN:"keydown"+a,MOUSEENTER:"mouseenter"+a,MOUSELEAVE:"mouseleave"+a,TOUCHEND:"touchend"+a,LOAD_DATA_API:"load.bs.carousel.data-api",CLICK_DATA_API:"click.bs.carousel.data-api"},f={CAROUSEL:"carousel",ACTIVE:"active",SLIDE:"slide",RIGHT:"carousel-item-right",LEFT:"carousel-item-left",NEXT:"carousel-item-next",PREV:"carousel-item-prev",ITEM:"carousel-item"},p={ACTIVE:".active",ACTIVE_ITEM:".active.carousel-item",ITEM:".carousel-item",NEXT_PREV:".carousel-item-next, .carousel-item-prev",INDICATORS:".carousel-indicators",DATA_SLIDE:"[data-slide], [data-slide-to]",DATA_RIDE:'[data-ride="carousel"]'},_=function(){function l(e,i){n(this,l),this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this._config=this._getConfig(i),this._element=t(e)[0],this._indicatorsElement=t(this._element).find(p.INDICATORS)[0],this._addEventListeners()}return l.prototype.next=function(){this._isSliding||this._slide(u.NEXT)},l.prototype.nextWhenVisible=function(){document.hidden||this.next()},l.prototype.prev=function(){this._isSliding||this._slide(u.PREV)},l.prototype.pause=function(e){e||(this._isPaused=!0),t(this._element).find(p.NEXT_PREV)[0]&&r.supportsTransitionEnd()&&(r.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},l.prototype.cycle=function(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},l.prototype.to=function(e){var n=this;this._activeElement=t(this._element).find(p.ACTIVE_ITEM)[0];var i=this._getItemIndex(this._activeElement);if(!(e>this._items.length-1||e<0))if(this._isSliding)t(this._element).one(d.SLID,function(){return n.to(e)});else{if(i===e)return this.pause(),void this.cycle();var o=e>i?u.NEXT:u.PREV;this._slide(o,this._items[e])}},l.prototype.dispose=function(){t(this._element).off(a),t.removeData(this._element,s),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},l.prototype._getConfig=function(n){return n=t.extend({},h,n),r.typeCheckConfig(e,n,c),n},l.prototype._addEventListeners=function(){var e=this;this._config.keyboard&&t(this._element).on(d.KEYDOWN,function(t){return e._keydown(t)}),"hover"===this._config.pause&&(t(this._element).on(d.MOUSEENTER,function(t){return e.pause(t)}).on(d.MOUSELEAVE,function(t){return e.cycle(t)}),"ontouchstart"in document.documentElement&&t(this._element).on(d.TOUCHEND,function(){e.pause(),e.touchTimeout&&clearTimeout(e.touchTimeout),e.touchTimeout=setTimeout(function(t){return e.cycle(t)},500+e._config.interval)}))},l.prototype._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case 37:t.preventDefault(),this.prev();break;case 39:t.preventDefault(),this.next();break;default:return}},l.prototype._getItemIndex=function(e){return this._items=t.makeArray(t(e).parent().find(p.ITEM)),this._items.indexOf(e)},l.prototype._getItemByDirection=function(t,e){var n=t===u.NEXT,i=t===u.PREV,o=this._getItemIndex(e),r=this._items.length-1;if((i&&0===o||n&&o===r)&&!this._config.wrap)return e;var s=(o+(t===u.PREV?-1:1))%this._items.length;return-1===s?this._items[this._items.length-1]:this._items[s]},l.prototype._triggerSlideEvent=function(e,n){var i=this._getItemIndex(e),o=this._getItemIndex(t(this._element).find(p.ACTIVE_ITEM)[0]),r=t.Event(d.SLIDE,{relatedTarget:e,direction:n,from:o,to:i});return t(this._element).trigger(r),r},l.prototype._setActiveIndicatorElement=function(e){if(this._indicatorsElement){t(this._indicatorsElement).find(p.ACTIVE).removeClass(f.ACTIVE);var n=this._indicatorsElement.children[this._getItemIndex(e)];n&&t(n).addClass(f.ACTIVE)}},l.prototype._slide=function(e,n){var i=this,o=t(this._element).find(p.ACTIVE_ITEM)[0],s=this._getItemIndex(o),a=n||o&&this._getItemByDirection(e,o),l=this._getItemIndex(a),h=Boolean(this._interval),c=void 0,_=void 0,g=void 0;if(e===u.NEXT?(c=f.LEFT,_=f.NEXT,g=u.LEFT):(c=f.RIGHT,_=f.PREV,g=u.RIGHT),a&&t(a).hasClass(f.ACTIVE))this._isSliding=!1;else if(!this._triggerSlideEvent(a,g).isDefaultPrevented()&&o&&a){this._isSliding=!0,h&&this.pause(),this._setActiveIndicatorElement(a);var m=t.Event(d.SLID,{relatedTarget:a,direction:g,from:s,to:l});r.supportsTransitionEnd()&&t(this._element).hasClass(f.SLIDE)?(t(a).addClass(_),r.reflow(a),t(o).addClass(c),t(a).addClass(c),t(o).one(r.TRANSITION_END,function(){t(a).removeClass(c+" "+_).addClass(f.ACTIVE),t(o).removeClass(f.ACTIVE+" "+_+" "+c),i._isSliding=!1,setTimeout(function(){return t(i._element).trigger(m)},0)}).emulateTransitionEnd(600)):(t(o).removeClass(f.ACTIVE),t(a).addClass(f.ACTIVE),this._isSliding=!1,t(this._element).trigger(m)),h&&this.cycle()}},l._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(s),o=t.extend({},h,t(this).data());"object"===(void 0===e?"undefined":i(e))&&t.extend(o,e);var r="string"==typeof e?e:o.slide;if(n||(n=new l(this,o),t(this).data(s,n)),"number"==typeof e)n.to(e);else if("string"==typeof r){if(void 0===n[r])throw new Error('No method named "'+r+'"');n[r]()}else o.interval&&(n.pause(),n.cycle())})},l._dataApiClickHandler=function(e){var n=r.getSelectorFromElement(this);if(n){var i=t(n)[0];if(i&&t(i).hasClass(f.CAROUSEL)){var o=t.extend({},t(i).data(),t(this).data()),a=this.getAttribute("data-slide-to");a&&(o.interval=!1),l._jQueryInterface.call(t(i),o),a&&t(i).data(s).to(a),e.preventDefault()}}},o(l,null,[{key:"VERSION",get:function(){return"4.0.0-beta"}},{key:"Default",get:function(){return h}}]),l}();t(document).on(d.CLICK_DATA_API,p.DATA_SLIDE,_._dataApiClickHandler),t(window).on(d.LOAD_DATA_API,function(){t(p.DATA_RIDE).each(function(){var e=t(this);_._jQueryInterface.call(e,e.data())})}),t.fn[e]=_._jQueryInterface,t.fn[e].Constructor=_,t.fn[e].noConflict=function(){return t.fn[e]=l,_._jQueryInterface}}(jQuery),function(t){var e="collapse",s="bs.collapse",a=t.fn[e],l={toggle:!0,parent:""},h={toggle:"boolean",parent:"string"},c={SHOW:"show.bs.collapse",SHOWN:"shown.bs.collapse",HIDE:"hide.bs.collapse",HIDDEN:"hidden.bs.collapse",CLICK_DATA_API:"click.bs.collapse.data-api"},u={SHOW:"show",COLLAPSE:"collapse",COLLAPSING:"collapsing",COLLAPSED:"collapsed"},d={WIDTH:"width",HEIGHT:"height"},f={ACTIVES:".show, .collapsing",DATA_TOGGLE:'[data-toggle="collapse"]'},p=function(){function a(e,i){n(this,a),this._isTransitioning=!1,this._element=e,this._config=this._getConfig(i),this._triggerArray=t.makeArray(t('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'));for(var o=t(f.DATA_TOGGLE),s=0;s<o.length;s++){var l=o[s],h=r.getSelectorFromElement(l);null!==h&&t(h).filter(e).length>0&&this._triggerArray.push(l)}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}return a.prototype.toggle=function(){t(this._element).hasClass(u.SHOW)?this.hide():this.show()},a.prototype.show=function(){var e=this;if(!this._isTransitioning&&!t(this._element).hasClass(u.SHOW)){var n=void 0,i=void 0;if(this._parent&&((n=t.makeArray(t(this._parent).children().children(f.ACTIVES))).length||(n=null)),!(n&&(i=t(n).data(s))&&i._isTransitioning)){var o=t.Event(c.SHOW);if(t(this._element).trigger(o),!o.isDefaultPrevented()){n&&(a._jQueryInterface.call(t(n),"hide"),i||t(n).data(s,null));var l=this._getDimension();t(this._element).removeClass(u.COLLAPSE).addClass(u.COLLAPSING),this._element.style[l]=0,this._triggerArray.length&&t(this._triggerArray).removeClass(u.COLLAPSED).attr("aria-expanded",!0),this.setTransitioning(!0);var h=function(){t(e._element).removeClass(u.COLLAPSING).addClass(u.COLLAPSE).addClass(u.SHOW),e._element.style[l]="",e.setTransitioning(!1),t(e._element).trigger(c.SHOWN)};if(r.supportsTransitionEnd()){var d="scroll"+(l[0].toUpperCase()+l.slice(1));t(this._element).one(r.TRANSITION_END,h).emulateTransitionEnd(600),this._element.style[l]=this._element[d]+"px"}else h()}}}},a.prototype.hide=function(){var e=this;if(!this._isTransitioning&&t(this._element).hasClass(u.SHOW)){var n=t.Event(c.HIDE);if(t(this._element).trigger(n),!n.isDefaultPrevented()){var i=this._getDimension();if(this._element.style[i]=this._element.getBoundingClientRect()[i]+"px",r.reflow(this._element),t(this._element).addClass(u.COLLAPSING).removeClass(u.COLLAPSE).removeClass(u.SHOW),this._triggerArray.length)for(var o=0;o<this._triggerArray.length;o++){var s=this._triggerArray[o],a=r.getSelectorFromElement(s);null!==a&&(t(a).hasClass(u.SHOW)||t(s).addClass(u.COLLAPSED).attr("aria-expanded",!1))}this.setTransitioning(!0);var l=function(){e.setTransitioning(!1),t(e._element).removeClass(u.COLLAPSING).addClass(u.COLLAPSE).trigger(c.HIDDEN)};this._element.style[i]="",r.supportsTransitionEnd()?t(this._element).one(r.TRANSITION_END,l).emulateTransitionEnd(600):l()}}},a.prototype.setTransitioning=function(t){this._isTransitioning=t},a.prototype.dispose=function(){t.removeData(this._element,s),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null},a.prototype._getConfig=function(n){return n=t.extend({},l,n),n.toggle=Boolean(n.toggle),r.typeCheckConfig(e,n,h),n},a.prototype._getDimension=function(){return t(this._element).hasClass(d.WIDTH)?d.WIDTH:d.HEIGHT},a.prototype._getParent=function(){var e=this,n=t(this._config.parent)[0],i='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]';return t(n).find(i).each(function(t,n){e._addAriaAndCollapsedClass(a._getTargetFromElement(n),[n])}),n},a.prototype._addAriaAndCollapsedClass=function(e,n){if(e){var i=t(e).hasClass(u.SHOW);n.length&&t(n).toggleClass(u.COLLAPSED,!i).attr("aria-expanded",i)}},a._getTargetFromElement=function(e){var n=r.getSelectorFromElement(e);return n?t(n)[0]:null},a._jQueryInterface=function(e){return this.each(function(){var n=t(this),o=n.data(s),r=t.extend({},l,n.data(),"object"===(void 0===e?"undefined":i(e))&&e);if(!o&&r.toggle&&/show|hide/.test(e)&&(r.toggle=!1),o||(o=new a(this,r),n.data(s,o)),"string"==typeof e){if(void 0===o[e])throw new Error('No method named "'+e+'"');o[e]()}})},o(a,null,[{key:"VERSION",get:function(){return"4.0.0-beta"}},{key:"Default",get:function(){return l}}]),a}();t(document).on(c.CLICK_DATA_API,f.DATA_TOGGLE,function(e){/input|textarea/i.test(e.target.tagName)||e.preventDefault();var n=t(this),i=r.getSelectorFromElement(this);t(i).each(function(){var e=t(this),i=e.data(s)?"toggle":n.data();p._jQueryInterface.call(e,i)})}),t.fn[e]=p._jQueryInterface,t.fn[e].Constructor=p,t.fn[e].noConflict=function(){return t.fn[e]=a,p._jQueryInterface}}(jQuery),function(t){if("undefined"==typeof Popper)throw new Error("Bootstrap dropdown require Popper.js (https://popper.js.org)");var e="dropdown",s="bs.dropdown",a="."+s,l=t.fn[e],h=new RegExp("38|40|27"),c={HIDE:"hide"+a,HIDDEN:"hidden"+a,SHOW:"show"+a,SHOWN:"shown"+a,CLICK:"click"+a,CLICK_DATA_API:"click.bs.dropdown.data-api",KEYDOWN_DATA_API:"keydown.bs.dropdown.data-api",KEYUP_DATA_API:"keyup.bs.dropdown.data-api"},u={DISABLED:"disabled",SHOW:"show",DROPUP:"dropup",MENURIGHT:"dropdown-menu-right",MENULEFT:"dropdown-menu-left"},d={DATA_TOGGLE:'[data-toggle="dropdown"]',FORM_CHILD:".dropdown form",MENU:".dropdown-menu",NAVBAR_NAV:".navbar-nav",VISIBLE_ITEMS:".dropdown-menu .dropdown-item:not(.disabled)"},f={TOP:"top-start",TOPEND:"top-end",BOTTOM:"bottom-start",BOTTOMEND:"bottom-end"},p={placement:f.BOTTOM,offset:0,flip:!0},_={placement:"string",offset:"(number|string)",flip:"boolean"},g=function(){function l(t,e){n(this,l),this._element=t,this._popper=null,this._config=this._getConfig(e),this._menu=this._getMenuElement(),this._inNavbar=this._detectNavbar(),this._addEventListeners()}return l.prototype.toggle=function(){if(!this._element.disabled&&!t(this._element).hasClass(u.DISABLED)){var e=l._getParentFromElement(this._element),n=t(this._menu).hasClass(u.SHOW);if(l._clearMenus(),!n){var i={relatedTarget:this._element},o=t.Event(c.SHOW,i);if(t(e).trigger(o),!o.isDefaultPrevented()){var r=this._element;t(e).hasClass(u.DROPUP)&&(t(this._menu).hasClass(u.MENULEFT)||t(this._menu).hasClass(u.MENURIGHT))&&(r=e),this._popper=new Popper(r,this._menu,this._getPopperConfig()),"ontouchstart"in document.documentElement&&!t(e).closest(d.NAVBAR_NAV).length&&t("body").children().on("mouseover",null,t.noop),this._element.focus(),this._element.setAttribute("aria-expanded",!0),t(this._menu).toggleClass(u.SHOW),t(e).toggleClass(u.SHOW).trigger(t.Event(c.SHOWN,i))}}}},l.prototype.dispose=function(){t.removeData(this._element,s),t(this._element).off(a),this._element=null,this._menu=null,null!==this._popper&&this._popper.destroy(),this._popper=null},l.prototype.update=function(){this._inNavbar=this._detectNavbar(),null!==this._popper&&this._popper.scheduleUpdate()},l.prototype._addEventListeners=function(){var e=this;t(this._element).on(c.CLICK,function(t){t.preventDefault(),t.stopPropagation(),e.toggle()})},l.prototype._getConfig=function(n){var i=t(this._element).data();return void 0!==i.placement&&(i.placement=f[i.placement.toUpperCase()]),n=t.extend({},this.constructor.Default,t(this._element).data(),n),r.typeCheckConfig(e,n,this.constructor.DefaultType),n},l.prototype._getMenuElement=function(){if(!this._menu){var e=l._getParentFromElement(this._element);this._menu=t(e).find(d.MENU)[0]}return this._menu},l.prototype._getPlacement=function(){var e=t(this._element).parent(),n=this._config.placement;return e.hasClass(u.DROPUP)||this._config.placement===f.TOP?(n=f.TOP,t(this._menu).hasClass(u.MENURIGHT)&&(n=f.TOPEND)):t(this._menu).hasClass(u.MENURIGHT)&&(n=f.BOTTOMEND),n},l.prototype._detectNavbar=function(){return t(this._element).closest(".navbar").length>0},l.prototype._getPopperConfig=function(){var t={placement:this._getPlacement(),modifiers:{offset:{offset:this._config.offset},flip:{enabled:this._config.flip}}};return this._inNavbar&&(t.modifiers.applyStyle={enabled:!this._inNavbar}),t},l._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(s),o="object"===(void 0===e?"undefined":i(e))?e:null;if(n||(n=new l(this,o),t(this).data(s,n)),"string"==typeof e){if(void 0===n[e])throw new Error('No method named "'+e+'"');n[e]()}})},l._clearMenus=function(e){if(!e||3!==e.which&&("keyup"!==e.type||9===e.which))for(var n=t.makeArray(t(d.DATA_TOGGLE)),i=0;i<n.length;i++){var o=l._getParentFromElement(n[i]),r=t(n[i]).data(s),a={relatedTarget:n[i]};if(r){var h=r._menu;if(t(o).hasClass(u.SHOW)&&!(e&&("click"===e.type&&/input|textarea/i.test(e.target.tagName)||"keyup"===e.type&&9===e.which)&&t.contains(o,e.target))){var f=t.Event(c.HIDE,a);t(o).trigger(f),f.isDefaultPrevented()||("ontouchstart"in document.documentElement&&t("body").children().off("mouseover",null,t.noop),n[i].setAttribute("aria-expanded","false"),t(h).removeClass(u.SHOW),t(o).removeClass(u.SHOW).trigger(t.Event(c.HIDDEN,a)))}}}},l._getParentFromElement=function(e){var n=void 0,i=r.getSelectorFromElement(e);return i&&(n=t(i)[0]),n||e.parentNode},l._dataApiKeydownHandler=function(e){if(!(!h.test(e.which)||/button/i.test(e.target.tagName)&&32===e.which||/input|textarea/i.test(e.target.tagName)||(e.preventDefault(),e.stopPropagation(),this.disabled||t(this).hasClass(u.DISABLED)))){var n=l._getParentFromElement(this),i=t(n).hasClass(u.SHOW);if((i||27===e.which&&32===e.which)&&(!i||27!==e.which&&32!==e.which)){var o=t(n).find(d.VISIBLE_ITEMS).get();if(o.length){var r=o.indexOf(e.target);38===e.which&&r>0&&r--,40===e.which&&r<o.length-1&&r++,r<0&&(r=0),o[r].focus()}}else{if(27===e.which){var s=t(n).find(d.DATA_TOGGLE)[0];t(s).trigger("focus")}t(this).trigger("click")}}},o(l,null,[{key:"VERSION",get:function(){return"4.0.0-beta"}},{key:"Default",get:function(){return p}},{key:"DefaultType",get:function(){return _}}]),l}();t(document).on(c.KEYDOWN_DATA_API,d.DATA_TOGGLE,g._dataApiKeydownHandler).on(c.KEYDOWN_DATA_API,d.MENU,g._dataApiKeydownHandler).on(c.CLICK_DATA_API+" "+c.KEYUP_DATA_API,g._clearMenus).on(c.CLICK_DATA_API,d.DATA_TOGGLE,function(e){e.preventDefault(),e.stopPropagation(),g._jQueryInterface.call(t(this),"toggle")}).on(c.CLICK_DATA_API,d.FORM_CHILD,function(t){t.stopPropagation()}),t.fn[e]=g._jQueryInterface,t.fn[e].Constructor=g,t.fn[e].noConflict=function(){return t.fn[e]=l,g._jQueryInterface}}(jQuery),function(t){var e="modal",s=".bs.modal",a=t.fn[e],l={backdrop:!0,keyboard:!0,focus:!0,show:!0},h={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean",show:"boolean"},c={HIDE:"hide.bs.modal",HIDDEN:"hidden.bs.modal",SHOW:"show.bs.modal",SHOWN:"shown.bs.modal",FOCUSIN:"focusin.bs.modal",RESIZE:"resize.bs.modal",CLICK_DISMISS:"click.dismiss.bs.modal",KEYDOWN_DISMISS:"keydown.dismiss.bs.modal",MOUSEUP_DISMISS:"mouseup.dismiss.bs.modal",MOUSEDOWN_DISMISS:"mousedown.dismiss.bs.modal",CLICK_DATA_API:"click.bs.modal.data-api"},u={SCROLLBAR_MEASURER:"modal-scrollbar-measure",BACKDROP:"modal-backdrop",OPEN:"modal-open",FADE:"fade",SHOW:"show"},d={DIALOG:".modal-dialog",DATA_TOGGLE:'[data-toggle="modal"]',DATA_DISMISS:'[data-dismiss="modal"]',FIXED_CONTENT:".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",NAVBAR_TOGGLER:".navbar-toggler"},f=function(){function a(e,i){n(this,a),this._config=this._getConfig(i),this._element=e,this._dialog=t(e).find(d.DIALOG)[0],this._backdrop=null,this._isShown=!1,this._isBodyOverflowing=!1,this._ignoreBackdropClick=!1,this._originalBodyPadding=0,this._scrollbarWidth=0}return a.prototype.toggle=function(t){return this._isShown?this.hide():this.show(t)},a.prototype.show=function(e){var n=this;if(!this._isTransitioning){r.supportsTransitionEnd()&&t(this._element).hasClass(u.FADE)&&(this._isTransitioning=!0);var i=t.Event(c.SHOW,{relatedTarget:e});t(this._element).trigger(i),this._isShown||i.isDefaultPrevented()||(this._isShown=!0,this._checkScrollbar(),this._setScrollbar(),t(document.body).addClass(u.OPEN),this._setEscapeEvent(),this._setResizeEvent(),t(this._element).on(c.CLICK_DISMISS,d.DATA_DISMISS,function(t){return n.hide(t)}),t(this._dialog).on(c.MOUSEDOWN_DISMISS,function(){t(n._element).one(c.MOUSEUP_DISMISS,function(e){t(e.target).is(n._element)&&(n._ignoreBackdropClick=!0)})}),this._showBackdrop(function(){return n._showElement(e)}))}},a.prototype.hide=function(e){var n=this;if(e&&e.preventDefault(),!this._isTransitioning&&this._isShown){var i=r.supportsTransitionEnd()&&t(this._element).hasClass(u.FADE);i&&(this._isTransitioning=!0);var o=t.Event(c.HIDE);t(this._element).trigger(o),this._isShown&&!o.isDefaultPrevented()&&(this._isShown=!1,this._setEscapeEvent(),this._setResizeEvent(),t(document).off(c.FOCUSIN),t(this._element).removeClass(u.SHOW),t(this._element).off(c.CLICK_DISMISS),t(this._dialog).off(c.MOUSEDOWN_DISMISS),i?t(this._element).one(r.TRANSITION_END,function(t){return n._hideModal(t)}).emulateTransitionEnd(300):this._hideModal())}},a.prototype.dispose=function(){t.removeData(this._element,"bs.modal"),t(window,document,this._element,this._backdrop).off(s),this._config=null,this._element=null,this._dialog=null,this._backdrop=null,this._isShown=null,this._isBodyOverflowing=null,this._ignoreBackdropClick=null,this._scrollbarWidth=null},a.prototype.handleUpdate=function(){this._adjustDialog()},a.prototype._getConfig=function(n){return n=t.extend({},l,n),r.typeCheckConfig(e,n,h),n},a.prototype._showElement=function(e){var n=this,i=r.supportsTransitionEnd()&&t(this._element).hasClass(u.FADE);this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.scrollTop=0,i&&r.reflow(this._element),t(this._element).addClass(u.SHOW),this._config.focus&&this._enforceFocus();var o=t.Event(c.SHOWN,{relatedTarget:e}),s=function(){n._config.focus&&n._element.focus(),n._isTransitioning=!1,t(n._element).trigger(o)};i?t(this._dialog).one(r.TRANSITION_END,s).emulateTransitionEnd(300):s()},a.prototype._enforceFocus=function(){var e=this;t(document).off(c.FOCUSIN).on(c.FOCUSIN,function(n){document===n.target||e._element===n.target||t(e._element).has(n.target).length||e._element.focus()})},a.prototype._setEscapeEvent=function(){var e=this;this._isShown&&this._config.keyboard?t(this._element).on(c.KEYDOWN_DISMISS,function(t){27===t.which&&(t.preventDefault(),e.hide())}):this._isShown||t(this._element).off(c.KEYDOWN_DISMISS)},a.prototype._setResizeEvent=function(){var e=this;this._isShown?t(window).on(c.RESIZE,function(t){return e.handleUpdate(t)}):t(window).off(c.RESIZE)},a.prototype._hideModal=function(){var e=this;this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._isTransitioning=!1,this._showBackdrop(function(){t(document.body).removeClass(u.OPEN),e._resetAdjustments(),e._resetScrollbar(),t(e._element).trigger(c.HIDDEN)})},a.prototype._removeBackdrop=function(){this._backdrop&&(t(this._backdrop).remove(),this._backdrop=null)},a.prototype._showBackdrop=function(e){var n=this,i=t(this._element).hasClass(u.FADE)?u.FADE:"";if(this._isShown&&this._config.backdrop){var o=r.supportsTransitionEnd()&&i;if(this._backdrop=document.createElement("div"),this._backdrop.className=u.BACKDROP,i&&t(this._backdrop).addClass(i),t(this._backdrop).appendTo(document.body),t(this._element).on(c.CLICK_DISMISS,function(t){n._ignoreBackdropClick?n._ignoreBackdropClick=!1:t.target===t.currentTarget&&("static"===n._config.backdrop?n._element.focus():n.hide())}),o&&r.reflow(this._backdrop),t(this._backdrop).addClass(u.SHOW),!e)return;if(!o)return void e();t(this._backdrop).one(r.TRANSITION_END,e).emulateTransitionEnd(150)}else if(!this._isShown&&this._backdrop){t(this._backdrop).removeClass(u.SHOW);var s=function(){n._removeBackdrop(),e&&e()};r.supportsTransitionEnd()&&t(this._element).hasClass(u.FADE)?t(this._backdrop).one(r.TRANSITION_END,s).emulateTransitionEnd(150):s()}else e&&e()},a.prototype._adjustDialog=function(){var t=this._element.scrollHeight>document.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},a.prototype._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},a.prototype._checkScrollbar=function(){this._isBodyOverflowing=document.body.clientWidth<window.innerWidth,this._scrollbarWidth=this._getScrollbarWidth()},a.prototype._setScrollbar=function(){var e=this;if(this._isBodyOverflowing){t(d.FIXED_CONTENT).each(function(n,i){var o=t(i)[0].style.paddingRight,r=t(i).css("padding-right");t(i).data("padding-right",o).css("padding-right",parseFloat(r)+e._scrollbarWidth+"px")}),t(d.NAVBAR_TOGGLER).each(function(n,i){var o=t(i)[0].style.marginRight,r=t(i).css("margin-right");t(i).data("margin-right",o).css("margin-right",parseFloat(r)+e._scrollbarWidth+"px")});var n=document.body.style.paddingRight,i=t("body").css("padding-right");t("body").data("padding-right",n).css("padding-right",parseFloat(i)+this._scrollbarWidth+"px")}},a.prototype._resetScrollbar=function(){t(d.FIXED_CONTENT).each(function(e,n){var i=t(n).data("padding-right");void 0!==i&&t(n).css("padding-right",i).removeData("padding-right")}),t(d.NAVBAR_TOGGLER).each(function(e,n){var i=t(n).data("margin-right");void 0!==i&&t(n).css("margin-right",i).removeData("margin-right")});var e=t("body").data("padding-right");void 0!==e&&t("body").css("padding-right",e).removeData("padding-right")},a.prototype._getScrollbarWidth=function(){var t=document.createElement("div");t.className=u.SCROLLBAR_MEASURER,document.body.appendChild(t);var e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e},a._jQueryInterface=function(e,n){return this.each(function(){var o=t(this).data("bs.modal"),r=t.extend({},a.Default,t(this).data(),"object"===(void 0===e?"undefined":i(e))&&e);if(o||(o=new a(this,r),t(this).data("bs.modal",o)),"string"==typeof e){if(void 0===o[e])throw new Error('No method named "'+e+'"');o[e](n)}else r.show&&o.show(n)})},o(a,null,[{key:"VERSION",get:function(){return"4.0.0-beta"}},{key:"Default",get:function(){return l}}]),a}();t(document).on(c.CLICK_DATA_API,d.DATA_TOGGLE,function(e){var n=this,i=void 0,o=r.getSelectorFromElement(this);o&&(i=t(o)[0]);var s=t(i).data("bs.modal")?"toggle":t.extend({},t(i).data(),t(this).data());"A"!==this.tagName&&"AREA"!==this.tagName||e.preventDefault();var a=t(i).one(c.SHOW,function(e){e.isDefaultPrevented()||a.one(c.HIDDEN,function(){t(n).is(":visible")&&n.focus()})});f._jQueryInterface.call(t(i),s,this)}),t.fn[e]=f._jQueryInterface,t.fn[e].Constructor=f,t.fn[e].noConflict=function(){return t.fn[e]=a,f._jQueryInterface}}(jQuery),function(t){var e="scrollspy",s=t.fn[e],a={offset:10,method:"auto",target:""},l={offset:"number",method:"string",target:"(string|element)"},h={ACTIVATE:"activate.bs.scrollspy",SCROLL:"scroll.bs.scrollspy",LOAD_DATA_API:"load.bs.scrollspy.data-api"},c={DROPDOWN_ITEM:"dropdown-item",DROPDOWN_MENU:"dropdown-menu",ACTIVE:"active"},u={DATA_SPY:'[data-spy="scroll"]',ACTIVE:".active",NAV_LIST_GROUP:".nav, .list-group",NAV_LINKS:".nav-link",LIST_ITEMS:".list-group-item",DROPDOWN:".dropdown",DROPDOWN_ITEMS:".dropdown-item",DROPDOWN_TOGGLE:".dropdown-toggle"},d={OFFSET:"offset",POSITION:"position"},f=function(){function s(e,i){var o=this;n(this,s),this._element=e,this._scrollElement="BODY"===e.tagName?window:e,this._config=this._getConfig(i),this._selector=this._config.target+" "+u.NAV_LINKS+","+this._config.target+" "+u.LIST_ITEMS+","+this._config.target+" "+u.DROPDOWN_ITEMS,this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,t(this._scrollElement).on(h.SCROLL,function(t){return o._process(t)}),this.refresh(),this._process()}return s.prototype.refresh=function(){var e=this,n=this._scrollElement!==this._scrollElement.window?d.POSITION:d.OFFSET,i="auto"===this._config.method?n:this._config.method,o=i===d.POSITION?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),t.makeArray(t(this._selector)).map(function(e){var n=void 0,s=r.getSelectorFromElement(e);if(s&&(n=t(s)[0]),n){var a=n.getBoundingClientRect();if(a.width||a.height)return[t(n)[i]().top+o,s]}return null}).filter(function(t){return t}).sort(function(t,e){return t[0]-e[0]}).forEach(function(t){e._offsets.push(t[0]),e._targets.push(t[1])})},s.prototype.dispose=function(){t.removeData(this._element,"bs.scrollspy"),t(this._scrollElement).off(".bs.scrollspy"),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},s.prototype._getConfig=function(n){if("string"!=typeof(n=t.extend({},a,n)).target){var i=t(n.target).attr("id");i||(i=r.getUID(e),t(n.target).attr("id",i)),n.target="#"+i}return r.typeCheckConfig(e,n,l),n},s.prototype._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},s.prototype._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},s.prototype._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},s.prototype._process=function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),t>=n){var i=this._targets[this._targets.length-1];this._activeTarget!==i&&this._activate(i)}else{if(this._activeTarget&&t<this._offsets[0]&&this._offsets[0]>0)return this._activeTarget=null,void this._clear();for(var o=this._offsets.length;o--;)this._activeTarget!==this._targets[o]&&t>=this._offsets[o]&&(void 0===this._offsets[o+1]||t<this._offsets[o+1])&&this._activate(this._targets[o])}},s.prototype._activate=function(e){this._activeTarget=e,this._clear();var n=this._selector.split(",");n=n.map(function(t){return t+'[data-target="'+e+'"],'+t+'[href="'+e+'"]'});var i=t(n.join(","));i.hasClass(c.DROPDOWN_ITEM)?(i.closest(u.DROPDOWN).find(u.DROPDOWN_TOGGLE).addClass(c.ACTIVE),i.addClass(c.ACTIVE)):(i.addClass(c.ACTIVE),i.parents(u.NAV_LIST_GROUP).prev(u.NAV_LINKS+", "+u.LIST_ITEMS).addClass(c.ACTIVE)),t(this._scrollElement).trigger(h.ACTIVATE,{relatedTarget:e})},s.prototype._clear=function(){t(this._selector).filter(u.ACTIVE).removeClass(c.ACTIVE)},s._jQueryInterface=function(e){return this.each(function(){var n=t(this).data("bs.scrollspy"),o="object"===(void 0===e?"undefined":i(e))&&e;if(n||(n=new s(this,o),t(this).data("bs.scrollspy",n)),"string"==typeof e){if(void 0===n[e])throw new Error('No method named "'+e+'"');n[e]()}})},o(s,null,[{key:"VERSION",get:function(){return"4.0.0-beta"}},{key:"Default",get:function(){return a}}]),s}();t(window).on(h.LOAD_DATA_API,function(){for(var e=t.makeArray(t(u.DATA_SPY)),n=e.length;n--;){var i=t(e[n]);f._jQueryInterface.call(i,i.data())}}),t.fn[e]=f._jQueryInterface,t.fn[e].Constructor=f,t.fn[e].noConflict=function(){return t.fn[e]=s,f._jQueryInterface}}(jQuery),function(t){var e=t.fn.tab,i={HIDE:"hide.bs.tab",HIDDEN:"hidden.bs.tab",SHOW:"show.bs.tab",SHOWN:"shown.bs.tab",CLICK_DATA_API:"click.bs.tab.data-api"},s={DROPDOWN_MENU:"dropdown-menu",ACTIVE:"active",DISABLED:"disabled",FADE:"fade",SHOW:"show"},a={DROPDOWN:".dropdown",NAV_LIST_GROUP:".nav, .list-group",ACTIVE:".active",DATA_TOGGLE:'[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',DROPDOWN_TOGGLE:".dropdown-toggle",DROPDOWN_ACTIVE_CHILD:"> .dropdown-menu .active"},l=function(){function e(t){n(this,e),this._element=t}return e.prototype.show=function(){var e=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&t(this._element).hasClass(s.ACTIVE)||t(this._element).hasClass(s.DISABLED))){var n=void 0,o=void 0,l=t(this._element).closest(a.NAV_LIST_GROUP)[0],h=r.getSelectorFromElement(this._element);l&&(o=t.makeArray(t(l).find(a.ACTIVE)),o=o[o.length-1]);var c=t.Event(i.HIDE,{relatedTarget:this._element}),u=t.Event(i.SHOW,{relatedTarget:o});if(o&&t(o).trigger(c),t(this._element).trigger(u),!u.isDefaultPrevented()&&!c.isDefaultPrevented()){h&&(n=t(h)[0]),this._activate(this._element,l);var d=function(){var n=t.Event(i.HIDDEN,{relatedTarget:e._element}),r=t.Event(i.SHOWN,{relatedTarget:o});t(o).trigger(n),t(e._element).trigger(r)};n?this._activate(n,n.parentNode,d):d()}}},e.prototype.dispose=function(){t.removeData(this._element,"bs.tab"),this._element=null},e.prototype._activate=function(e,n,i){var o=this,l=t(n).find(a.ACTIVE)[0],h=i&&r.supportsTransitionEnd()&&l&&t(l).hasClass(s.FADE),c=function(){return o._transitionComplete(e,l,h,i)};l&&h?t(l).one(r.TRANSITION_END,c).emulateTransitionEnd(150):c(),l&&t(l).removeClass(s.SHOW)},e.prototype._transitionComplete=function(e,n,i,o){if(n){t(n).removeClass(s.ACTIVE);var l=t(n.parentNode).find(a.DROPDOWN_ACTIVE_CHILD)[0];l&&t(l).removeClass(s.ACTIVE),n.setAttribute("aria-expanded",!1)}if(t(e).addClass(s.ACTIVE),e.setAttribute("aria-expanded",!0),i?(r.reflow(e),t(e).addClass(s.SHOW)):t(e).removeClass(s.FADE),e.parentNode&&t(e.parentNode).hasClass(s.DROPDOWN_MENU)){var h=t(e).closest(a.DROPDOWN)[0];h&&t(h).find(a.DROPDOWN_TOGGLE).addClass(s.ACTIVE),e.setAttribute("aria-expanded",!0)}o&&o()},e._jQueryInterface=function(n){return this.each(function(){var i=t(this),o=i.data("bs.tab");if(o||(o=new e(this),i.data("bs.tab",o)),"string"==typeof n){if(void 0===o[n])throw new Error('No method named "'+n+'"');o[n]()}})},o(e,null,[{key:"VERSION",get:function(){return"4.0.0-beta"}}]),e}();t(document).on(i.CLICK_DATA_API,a.DATA_TOGGLE,function(e){e.preventDefault(),l._jQueryInterface.call(t(this),"show")}),t.fn.tab=l._jQueryInterface,t.fn.tab.Constructor=l,t.fn.tab.noConflict=function(){return t.fn.tab=e,l._jQueryInterface}}(jQuery),function(t){if("undefined"==typeof Popper)throw new Error("Bootstrap tooltips require Popper.js (https://popper.js.org)");var e="tooltip",s=".bs.tooltip",a=t.fn[e],l=new RegExp("(^|\\s)bs-tooltip\\S+","g"),h={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(number|string)",container:"(string|element|boolean)",fallbackPlacement:"(string|array)"},c={AUTO:"auto",TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left"},u={animation:!0,template:'<div class="tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip"},d={SHOW:"show",OUT:"out"},f={HIDE:"hide"+s,HIDDEN:"hidden"+s,SHOW:"show"+s,SHOWN:"shown"+s,INSERTED:"inserted"+s,CLICK:"click"+s,FOCUSIN:"focusin"+s,FOCUSOUT:"focusout"+s,MOUSEENTER:"mouseenter"+s,MOUSELEAVE:"mouseleave"+s},p={FADE:"fade",SHOW:"show"},_={TOOLTIP:".tooltip",TOOLTIP_INNER:".tooltip-inner",ARROW:".arrow"},g={HOVER:"hover",FOCUS:"focus",CLICK:"click",MANUAL:"manual"},m=function(){function a(t,e){n(this,a),this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}return a.prototype.enable=function(){this._isEnabled=!0},a.prototype.disable=function(){this._isEnabled=!1},a.prototype.toggleEnabled=function(){this._isEnabled=!this._isEnabled},a.prototype.toggle=function(e){if(e){var n=this.constructor.DATA_KEY,i=t(e.currentTarget).data(n);i||(i=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(n,i)),i._activeTrigger.click=!i._activeTrigger.click,i._isWithActiveTrigger()?i._enter(null,i):i._leave(null,i)}else{if(t(this.getTipElement()).hasClass(p.SHOW))return void this._leave(null,this);this._enter(null,this)}},a.prototype.dispose=function(){clearTimeout(this._timeout),t.removeData(this.element,this.constructor.DATA_KEY),t(this.element).off(this.constructor.EVENT_KEY),t(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&t(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,null!==this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},a.prototype.show=function(){var e=this;if("none"===t(this.element).css("display"))throw new Error("Please use show on visible elements");var n=t.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){t(this.element).trigger(n);var i=t.contains(this.element.ownerDocument.documentElement,this.element);if(n.isDefaultPrevented()||!i)return;var o=this.getTipElement(),s=r.getUID(this.constructor.NAME);o.setAttribute("id",s),this.element.setAttribute("aria-describedby",s),this.setContent(),this.config.animation&&t(o).addClass(p.FADE);var l="function"==typeof this.config.placement?this.config.placement.call(this,o,this.element):this.config.placement,h=this._getAttachment(l);this.addAttachmentClass(h);var c=!1===this.config.container?document.body:t(this.config.container);t(o).data(this.constructor.DATA_KEY,this),t.contains(this.element.ownerDocument.documentElement,this.tip)||t(o).appendTo(c),t(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new Popper(this.element,o,{placement:h,modifiers:{offset:{offset:this.config.offset},flip:{behavior:this.config.fallbackPlacement},arrow:{element:_.ARROW}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){e._handlePopperPlacementChange(t)}}),t(o).addClass(p.SHOW),"ontouchstart"in document.documentElement&&t("body").children().on("mouseover",null,t.noop);var u=function(){e.config.animation&&e._fixTransition();var n=e._hoverState;e._hoverState=null,t(e.element).trigger(e.constructor.Event.SHOWN),n===d.OUT&&e._leave(null,e)};r.supportsTransitionEnd()&&t(this.tip).hasClass(p.FADE)?t(this.tip).one(r.TRANSITION_END,u).emulateTransitionEnd(a._TRANSITION_DURATION):u()}},a.prototype.hide=function(e){var n=this,i=this.getTipElement(),o=t.Event(this.constructor.Event.HIDE),s=function(){n._hoverState!==d.SHOW&&i.parentNode&&i.parentNode.removeChild(i),n._cleanTipClass(),n.element.removeAttribute("aria-describedby"),t(n.element).trigger(n.constructor.Event.HIDDEN),null!==n._popper&&n._popper.destroy(),e&&e()};t(this.element).trigger(o),o.isDefaultPrevented()||(t(i).removeClass(p.SHOW),"ontouchstart"in document.documentElement&&t("body").children().off("mouseover",null,t.noop),this._activeTrigger[g.CLICK]=!1,this._activeTrigger[g.FOCUS]=!1,this._activeTrigger[g.HOVER]=!1,r.supportsTransitionEnd()&&t(this.tip).hasClass(p.FADE)?t(i).one(r.TRANSITION_END,s).emulateTransitionEnd(150):s(),this._hoverState="")},a.prototype.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},a.prototype.isWithContent=function(){return Boolean(this.getTitle())},a.prototype.addAttachmentClass=function(e){t(this.getTipElement()).addClass("bs-tooltip-"+e)},a.prototype.getTipElement=function(){return this.tip=this.tip||t(this.config.template)[0]},a.prototype.setContent=function(){var e=t(this.getTipElement());this.setElementContent(e.find(_.TOOLTIP_INNER),this.getTitle()),e.removeClass(p.FADE+" "+p.SHOW)},a.prototype.setElementContent=function(e,n){var o=this.config.html;"object"===(void 0===n?"undefined":i(n))&&(n.nodeType||n.jquery)?o?t(n).parent().is(e)||e.empty().append(n):e.text(t(n).text()):e[o?"html":"text"](n)},a.prototype.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},a.prototype._getAttachment=function(t){return c[t.toUpperCase()]},a.prototype._setListeners=function(){var e=this;this.config.trigger.split(" ").forEach(function(n){if("click"===n)t(e.element).on(e.constructor.Event.CLICK,e.config.selector,function(t){return e.toggle(t)});else if(n!==g.MANUAL){var i=n===g.HOVER?e.constructor.Event.MOUSEENTER:e.constructor.Event.FOCUSIN,o=n===g.HOVER?e.constructor.Event.MOUSELEAVE:e.constructor.Event.FOCUSOUT;t(e.element).on(i,e.config.selector,function(t){return e._enter(t)}).on(o,e.config.selector,function(t){return e._leave(t)})}t(e.element).closest(".modal").on("hide.bs.modal",function(){return e.hide()})}),this.config.selector?this.config=t.extend({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},a.prototype._fixTitle=function(){var t=i(this.element.getAttribute("data-original-title"));(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},a.prototype._enter=function(e,n){var i=this.constructor.DATA_KEY;(n=n||t(e.currentTarget).data(i))||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(i,n)),e&&(n._activeTrigger["focusin"===e.type?g.FOCUS:g.HOVER]=!0),t(n.getTipElement()).hasClass(p.SHOW)||n._hoverState===d.SHOW?n._hoverState=d.SHOW:(clearTimeout(n._timeout),n._hoverState=d.SHOW,n.config.delay&&n.config.delay.show?n._timeout=setTimeout(function(){n._hoverState===d.SHOW&&n.show()},n.config.delay.show):n.show())},a.prototype._leave=function(e,n){var i=this.constructor.DATA_KEY;(n=n||t(e.currentTarget).data(i))||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(i,n)),e&&(n._activeTrigger["focusout"===e.type?g.FOCUS:g.HOVER]=!1),n._isWithActiveTrigger()||(clearTimeout(n._timeout),n._hoverState=d.OUT,n.config.delay&&n.config.delay.hide?n._timeout=setTimeout(function(){n._hoverState===d.OUT&&n.hide()},n.config.delay.hide):n.hide())},a.prototype._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},a.prototype._getConfig=function(n){return(n=t.extend({},this.constructor.Default,t(this.element).data(),n)).delay&&"number"==typeof n.delay&&(n.delay={show:n.delay,hide:n.delay}),n.title&&"number"==typeof n.title&&(n.title=n.title.toString()),n.content&&"number"==typeof n.content&&(n.content=n.content.toString()),r.typeCheckConfig(e,n,this.constructor.DefaultType),n},a.prototype._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},a.prototype._cleanTipClass=function(){var e=t(this.getTipElement()),n=e.attr("class").match(l);null!==n&&n.length>0&&e.removeClass(n.join(""))},a.prototype._handlePopperPlacementChange=function(t){this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},a.prototype._fixTransition=function(){var e=this.getTipElement(),n=this.config.animation;null===e.getAttribute("x-placement")&&(t(e).removeClass(p.FADE),this.config.animation=!1,this.hide(),this.show(),this.config.animation=n)},a._jQueryInterface=function(e){return this.each(function(){var n=t(this).data("bs.tooltip"),o="object"===(void 0===e?"undefined":i(e))&&e;if((n||!/dispose|hide/.test(e))&&(n||(n=new a(this,o),t(this).data("bs.tooltip",n)),"string"==typeof e)){if(void 0===n[e])throw new Error('No method named "'+e+'"');n[e]()}})},o(a,null,[{key:"VERSION",get:function(){return"4.0.0-beta"}},{key:"Default",get:function(){return u}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return"bs.tooltip"}},{key:"Event",get:function(){return f}},{key:"EVENT_KEY",get:function(){return s}},{key:"DefaultType",get:function(){return h}}]),a}();return t.fn[e]=m._jQueryInterface,t.fn[e].Constructor=m,t.fn[e].noConflict=function(){return t.fn[e]=a,m._jQueryInterface},m}(jQuery));!function(r){var a="popover",l=".bs.popover",h=r.fn[a],c=new RegExp("(^|\\s)bs-popover\\S+","g"),u=r.extend({},s.Default,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>'}),d=r.extend({},s.DefaultType,{content:"(string|element|function)"}),f={FADE:"fade",SHOW:"show"},p={TITLE:".popover-header",CONTENT:".popover-body"},_={HIDE:"hide"+l,HIDDEN:"hidden"+l,SHOW:"show"+l,SHOWN:"shown"+l,INSERTED:"inserted"+l,CLICK:"click"+l,FOCUSIN:"focusin"+l,FOCUSOUT:"focusout"+l,MOUSEENTER:"mouseenter"+l,MOUSELEAVE:"mouseleave"+l},g=function(s){function h(){return n(this,h),t(this,s.apply(this,arguments))}return e(h,s),h.prototype.isWithContent=function(){return this.getTitle()||this._getContent()},h.prototype.addAttachmentClass=function(t){r(this.getTipElement()).addClass("bs-popover-"+t)},h.prototype.getTipElement=function(){return this.tip=this.tip||r(this.config.template)[0]},h.prototype.setContent=function(){var t=r(this.getTipElement());this.setElementContent(t.find(p.TITLE),this.getTitle()),this.setElementContent(t.find(p.CONTENT),this._getContent()),t.removeClass(f.FADE+" "+f.SHOW)},h.prototype._getContent=function(){return this.element.getAttribute("data-content")||("function"==typeof this.config.content?this.config.content.call(this.element):this.config.content)},h.prototype._cleanTipClass=function(){var t=r(this.getTipElement()),e=t.attr("class").match(c);null!==e&&e.length>0&&t.removeClass(e.join(""))},h._jQueryInterface=function(t){return this.each(function(){var e=r(this).data("bs.popover"),n="object"===(void 0===t?"undefined":i(t))?t:null;if((e||!/destroy|hide/.test(t))&&(e||(e=new h(this,n),r(this).data("bs.popover",e)),"string"==typeof t)){if(void 0===e[t])throw new Error('No method named "'+t+'"');e[t]()}})},o(h,null,[{key:"VERSION",get:function(){return"4.0.0-beta"}},{key:"Default",get:function(){return u}},{key:"NAME",get:function(){return a}},{key:"DATA_KEY",get:function(){return"bs.popover"}},{key:"Event",get:function(){return _}},{key:"EVENT_KEY",get:function(){return l}},{key:"DefaultType",get:function(){return d}}]),h}(s);r.fn[a]=g._jQueryInterface,r.fn[a].Constructor=g,r.fn[a].noConflict=function(){return r.fn[a]=h,g._jQueryInterface}}(jQuery)}();
12
13(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('global/window'),require('global/document')):typeof define==='function'&&define.amd?define(['global/window','global/document'],factory):(global=global||self,global.videojs=factory(global.window,global.document));}(this,(function(window$3,document){'use strict';window$3=window$3&&Object.prototype.hasOwnProperty.call(window$3,'default')?window$3['default']:window$3;document=document&&Object.prototype.hasOwnProperty.call(document,'default')?document['default']:document;var version="7.8.0";var history=[];var LogByTypeFactory=function LogByTypeFactory(name,log){return function(type,level,args){var lvl=log.levels[level];var lvlRegExp=new RegExp("^("+lvl+")$");if(type!=='log'){args.unshift(type.toUpperCase()+':');}
14args.unshift(name+':');if(history){history.push([].concat(args));var splice=history.length-1000;history.splice(0,splice>0?splice:0);}
15if(!window$3.console){return;}
16var fn=window$3.console[type];if(!fn&&type==='debug'){fn=window$3.console.info||window$3.console.log;}
17if(!fn||!lvl||!lvlRegExp.test(type)){return;}
18fn[Array.isArray(args)?'apply':'call'](window$3.console,args);};};function createLogger(name){var level='info';var logByType;var log=function log(){for(var _len=arguments.length,args=new Array(_len),_
vendor: 4,185 bytes, lines 18-52
18key=0;_key<_len;_key++){args[_key]=arguments[_key];}
19logByType('log',level,args);};logByType=LogByTypeFactory(name,log);log.createLogger=function(subname){return createLogger(name+': '+subname);};log.levels={all:'debug|log|warn|error',off:'',debug:'debug|log|warn|error',info:'log|warn|error',warn:'warn|error',error:'error',DEFAULT:level};log.level=function(lvl){if(typeof lvl==='string'){if(!log.levels.hasOwnProperty(lvl)){throw new Error("\""+lvl+"\" in not a valid log level");}
20level=lvl;}
21return level;};log.history=function(){return history?[].concat(history):[];};log.history.filter=function(fname){return(history||[]).filter(function(historyItem){return new RegExp(".*"+fname+".*").test(historyItem[0]);});};log.history.clear=function(){if(history){history.length=0;}};log.history.disable=function(){if(history!==null){history.length=0;history=null;}};log.history.enable=function(){if(history===null){history=[];}};log.error=function(){for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2];}
22return logByType('error',level,args);};log.warn=function(){for(var _len3=arguments.length,args=new Array(_len3),_key3=0;_key3<_len3;_key3++){args[_key3]=arguments[_key3];}
23return logByType('warn',level,args);};log.debug=function(){for(var _len4=arguments.length,args=new Array(_len4),_key4=0;_key4<_len4;_key4++){args[_key4]=arguments[_key4];}
24return logByType('debug',level,args);};return log;}
25var log=createLogger('VIDEOJS');var createLogger$1=log.createLogger;function createCommonjsModule(fn,module){return module={exports:{}},fn(module,module.exports),module.exports;}
26var _extends_1=createCommonjsModule(function(module){function _extends(){module.exports=_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];}}}
27return target;};return _extends.apply(this,arguments);}
28module.exports=_extends;});var toString=Object.prototype.toString;var keys=function keys(object){return isObject(object)?Object.keys(object):[];};function each(object,fn){keys(object).forEach(function(key){return fn(object[key],key);});}
29function reduce(object,fn,initial){if(initial===void 0){initial=0;}
30return keys(object).reduce(function(accum,key){return fn(accum,object[key],key);},initial);}
31function assign(target){for(var _len=arguments.length,sources=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){sources[_key-1]=arguments[_key];}
32if(Object.assign){return _extends_1.apply(void 0,[target].concat(sources));}
33sources.forEach(function(source){if(!source){return;}
34each(source,function(value,key){target[key]=value;});});return target;}
35function isObject(value){return!!value&&typeof value==='object';}
36function isPlain(value){return isObject(value)&&toString.call(value)==='[object Object]'&&value.constructor===Object;}
37function computedStyle(el,prop){if(!el||!prop){return '';}
38if(typeof window$3.getComputedStyle==='function'){var computedStyleValue=window$3.getComputedStyle(el);return computedStyleValue?computedStyleValue.getPropertyValue(prop)||computedStyleValue[prop]:'';}
39return '';}
40function isNonBlankString(str){return typeof str==='string'&&Boolean(str.trim());}
41function throwIfWhitespace(str){if(str.indexOf(' ')>=0){throw new Error('class has illegal whitespace characters');}}
42function classRegExp(className){return new RegExp('(^|\\s)'+className+'($|\\s)');}
43function isReal(){return document===window$3.document;}
44function isEl(value){return isObject(value)&&value.nodeType===1;}
45function isInFrame(){try{return window$3.parent!==window$3.self;}catch(x){return true;}}
46function createQuerier(method){return function(selector,context){if(!isNonBlankString(selector)){return document[method](null);}
47if(isNonBlankString(context)){context=document.querySelector(context);}
48var ctx=isEl(context)?context:document;return ctx[method]&&ctx[method](selector);};}
49function createEl(tagName,properties,attributes,content){if(tagName===void 0){tagName='div';}
50if(properties===void 0){properties={};}
51if(attributes===void 0){attributes={};}
52var el=document.createElement(tagName);
vendor: 7,325 bytes, lines 52-102
52Object.getOwnPropertyNames(properties).forEach(function(propName){var val=properties[propName];if(propName.indexOf('aria-')!==-1||propName==='role'||propName==='type'){log.warn('Setting attributes in the second argument of createEl()\n'+'has been deprecated. Use the third argument instead.\n'+("createEl(type, properties, attributes). Attempting to set "+propName+" to "+val+"."));el.setAttribute(propName,val);}else if(propName==='textContent'){textContent(el,val);}else if(el[propName]!==val){el[propName]=val;}});Object.getOwnPropertyNames(attributes).forEach(function(attrName){el.setAttribute(attrName,attributes[attrName]);});if(content){appendContent(el,content);}
53return el;}
54function textContent(el,text){if(typeof el.textContent==='undefined'){el.innerText=text;}else{el.textContent=text;}
55return el;}
56function prependTo(child,parent){if(parent.firstChild){parent.insertBefore(child,parent.firstChild);}else{parent.appendChild(child);}}
57function hasClass(element,classToCheck){throwIfWhitespace(classToCheck);if(element.classList){return element.classList.contains(classToCheck);}
58return classRegExp(classToCheck).test(element.className);}
59function addClass(element,classToAdd){if(element.classList){element.classList.add(classToAdd);}else if(!hasClass(element,classToAdd)){element.className=(element.className+' '+classToAdd).trim();}
60return element;}
61function removeClass(element,classToRemove){if(element.classList){element.classList.remove(classToRemove);}else{throwIfWhitespace(classToRemove);element.className=element.className.split(/\s+/).filter(function(c){return c!==classToRemove;}).join(' ');}
62return element;}
63function toggleClass(element,classToToggle,predicate){var has=hasClass(element,classToToggle);if(typeof predicate==='function'){predicate=predicate(element,classToToggle);}
64if(typeof predicate!=='boolean'){predicate=!has;}
65if(predicate===has){return;}
66if(predicate){addClass(element,classToToggle);}else{removeClass(element,classToToggle);}
67return element;}
68function setAttributes(el,attributes){Object.getOwnPropertyNames(attributes).forEach(function(attrName){var attrValue=attributes[attrName];if(attrValue===null||typeof attrValue==='undefined'||attrValue===false){el.removeAttribute(attrName);}else{el.setAttribute(attrName,attrValue===true?'':attrValue);}});}
69function getAttributes(tag){var obj={};var knownBooleans=','+'autoplay,controls,playsinline,loop,muted,default,defaultMuted'+',';if(tag&&tag.attributes&&tag.attributes.length>0){var attrs=tag.attributes;for(var i=attrs.length-1;i>=0;i--){var attrName=attrs[i].name;var attrVal=attrs[i].value;if(typeof tag[attrName]==='boolean'||knownBooleans.indexOf(','+attrName+',')!==-1){attrVal=attrVal!==null?true:false;}
70obj[attrName]=attrVal;}}
71return obj;}
72function getAttribute(el,attribute){return el.getAttribute(attribute);}
73function setAttribute(el,attribute,value){el.setAttribute(attribute,value);}
74function removeAttribute(el,attribute){el.removeAttribute(attribute);}
75function blockTextSelection(){document.body.focus();document.onselectstart=function(){return false;};}
76function unblockTextSelection(){document.onselectstart=function(){return true;};}
77function getBoundingClientRect(el){if(el&&el.getBoundingClientRect&&el.parentNode){var rect=el.getBoundingClientRect();var result={};['bottom','height','left','right','top','width'].forEach(function(k){if(rect[k]!==undefined){result[k]=rect[k];}});if(!result.height){result.height=parseFloat(computedStyle(el,'height'));}
78if(!result.width){result.width=parseFloat(computedStyle(el,'width'));}
79return result;}}
80function findPosition(el){var box;if(el.getBoundingClientRect&&el.parentNode){box=el.getBoundingClientRect();}
81if(!box){return{left:0,top:0};}
82var docEl=document.documentElement;var body=document.body;var clientLeft=docEl.clientLeft||body.clientLeft||0;var scrollLeft=window$3.pageXOffset||body.scrollLeft;var left=box.left+scrollLeft-clientLeft;var clientTop=docEl.clientTop||body.clientTop||0;var scrollTop=window$3.pageYOffset||body.scrollTop;var top=box.top+scrollTop-clientTop;return{left:Math.round(left),top:Math.round(top)};}
83function getPointerPosition(el,event){var position={};var box=findPosition(el);var boxW=el.offsetWidth;var boxH=el.offsetHeight;var boxY=box.top;var boxX=box.left;var pageY=event.pageY;var pageX=event.pageX;if(event.changedTouches){pageX=event.changedTouches[0].pageX;pageY=event.changedTouches[0].pageY;}
84position.y=Math.max(0,Math.min(1,(boxY-pageY+boxH)/boxH));position.x=Math.max(0,Math.min(1,(pageX-boxX)/boxW));return position;}
85function isTextNode(value){return isObject(value)&&value.nodeType===3;}
86function emptyEl(el){while(el.firstChild){el.removeChild(el.firstChild);}
87return el;}
88function normalizeContent(content){if(typeof content==='function'){content=content();}
89return(Array.isArray(content)?content:[content]).map(function(value){if(typeof value==='function'){value=value();}
90if(isEl(value)||isTextNode(value)){return value;}
91if(typeof value==='string'&&/\S/.test(value)){return document.createTextNode(value);}}).filter(function(value){return value;});}
92function appendContent(el,content){normalizeContent(content).forEach(function(node){return el.appendChild(node);});return el;}
93function insertContent(el,content){return appendContent(emptyEl(el),content);}
94function isSingleLeftClick(event){if(event.button===undefined&&event.buttons===undefined){return true;}
95if(event.button===0&&event.buttons===undefined){return true;}
96if(event.type==='mouseup'&&event.button===0&&event.buttons===0){return true;}
97if(event.button!==0||event.buttons!==1){return false;}
98return true;}
99var $=createQuerier('querySelector');var $$=createQuerier('querySelectorAll');var Dom=Object.freeze({__proto__:null,isReal:isReal,isEl:isEl,isInFrame:isInFrame,createEl:createEl,textContent:textContent,prependTo:prependTo,hasClass:hasClass,addClass:addClass,removeClass:removeClass,toggleClass:toggleClass,setAttributes:setAttributes,getAttributes:getAttributes,getAttribute:getAttribute,setAttribute:setAttribute,removeAttribute:removeAttribute,blockTextSelection:blockTextSelection,unblockTextSelection:unblockTextSelection,getBoundingClientRect:getBoundingClientRect,findPosition:findPosition,getPointerPosition:getPointerPosition,isTextNode:isTextNode,emptyEl:emptyEl,normalizeContent:normalizeContent,appendContent:appendContent,insertContent:insertContent,isSingleLeftClick:isSingleLeftClick,$:$,$$:$$});var _windowLoaded=false;var videojs;var autoSetup=function autoSetup(){if(!isReal()||videojs.options.autoSetup===false){return;}
100var vids=Array.prototype.slice.call(document.getElementsByTagName('video'));var audios=Array.prototype.slice.call(document.getElementsByTagName('audio'));var divs=Array.prototype.slice.call(document.getElementsByTagName('video-js'));var mediaEls=vids.concat(audios,divs);if(mediaEls&&mediaEls.length>0){for(var i=0,e=mediaEls.length;i<e;i++){var mediaEl=mediaEls[i];if(mediaEl&&mediaEl.getAttribute){if(mediaEl.player===undefined){var options=mediaEl.getAttribute('data-setup');if(options!==null){videojs(mediaEl);}}}else{autoSetupTimeout(1);break;}}}else if(!_windowLoaded){autoSetupTimeout(1);}};function autoSetupTimeout(wait,vjs){if(vjs){videojs=vjs;}
101window$3.setTimeout(autoSetup,wait);}
102function setWindowLoaded(){_windowLoaded=true;window$3.removeEventListener('load',setWindowLoaded);}
vendor: 30,216 bytes, lines 103-249
103if(isReal()){if(document.readyState==='complete'){setWindowLoaded();}else{window$3.addEventListener('load',setWindowLoaded);}}
104var createStyleElement=function createStyleElement(className){var style=document.createElement('style');style.className=className;return style;};var setTextContent=function setTextContent(el,content){if(el.styleSheet){el.styleSheet.cssText=content;}else{el.textContent=content;}};var _initialGuid=3;var _guid=_initialGuid;function newGUID(){return _guid++;}
105var FakeWeakMap;if(!window$3.WeakMap){FakeWeakMap=function(){function FakeWeakMap(){this.vdata='vdata'+Math.floor(window$3.performance&&window$3.performance.now()||Date.now());this.data={};}
106var _proto=FakeWeakMap.prototype;_proto.set=function set(key,value){var access=key[this.vdata]||newGUID();if(!key[this.vdata]){key[this.vdata]=access;}
107this.data[access]=value;return this;};_proto.get=function get(key){var access=key[this.vdata];if(access){return this.data[access];}
108log('We have no data for this element',key);return undefined;};_proto.has=function has(key){var access=key[this.vdata];return access in this.data;};_proto["delete"]=function _delete(key){var access=key[this.vdata];if(access){delete this.data[access];delete key[this.vdata];}};return FakeWeakMap;}();}
109var DomData=window$3.WeakMap?new WeakMap():new FakeWeakMap();function _cleanUpEvents(elem,type){if(!DomData.has(elem)){return;}
110var data=DomData.get(elem);if(data.handlers[type].length===0){delete data.handlers[type];if(elem.removeEventListener){elem.removeEventListener(type,data.dispatcher,false);}else if(elem.detachEvent){elem.detachEvent('on'+type,data.dispatcher);}}
111if(Object.getOwnPropertyNames(data.handlers).length<=0){delete data.handlers;delete data.dispatcher;delete data.disabled;}
112if(Object.getOwnPropertyNames(data).length===0){DomData["delete"](elem);}}
113function _handleMultipleEvents(fn,elem,types,callback){types.forEach(function(type){fn(elem,type,callback);});}
114function fixEvent(event){if(event.fixed_){return event;}
115function returnTrue(){return true;}
116function returnFalse(){return false;}
117if(!event||!event.isPropagationStopped){var old=event||window$3.event;event={};for(var key in old){if(key!=='layerX'&&key!=='layerY'&&key!=='keyLocation'&&key!=='webkitMovementX'&&key!=='webkitMovementY'){if(!(key==='returnValue'&&old.preventDefault)){event[key]=old[key];}}}
118if(!event.target){event.target=event.srcElement||document;}
119if(!event.relatedTarget){event.relatedTarget=event.fromElement===event.target?event.toElement:event.fromElement;}
120event.preventDefault=function(){if(old.preventDefault){old.preventDefault();}
121event.returnValue=false;old.returnValue=false;event.defaultPrevented=true;};event.defaultPrevented=false;event.stopPropagation=function(){if(old.stopPropagation){old.stopPropagation();}
122event.cancelBubble=true;old.cancelBubble=true;event.isPropagationStopped=returnTrue;};event.isPropagationStopped=returnFalse;event.stopImmediatePropagation=function(){if(old.stopImmediatePropagation){old.stopImmediatePropagation();}
123event.isImmediatePropagationStopped=returnTrue;event.stopPropagation();};event.isImmediatePropagationStopped=returnFalse;if(event.clientX!==null&&event.clientX!==undefined){var doc=document.documentElement;var body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc&&doc.clientLeft||body&&body.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc&&doc.clientTop||body&&body.clientTop||0);}
124event.which=event.charCode||event.keyCode;if(event.button!==null&&event.button!==undefined){event.button=event.button&1?0:event.button&4?1:event.button&2?2:0;}}
125event.fixed_=true;return event;}
126var _supportsPassive;var supportsPassive=function supportsPassive(){if(typeof _supportsPassive!=='boolean'){_supportsPassive=false;try{var opts=Object.defineProperty({},'passive',{get:function get(){_supportsPassive=true;}});window$3.addEventListener('test',null,opts);window$3.removeEventListener('test',null,opts);}catch(e){}}
127return _supportsPassive;};var passiveEvents=['touchstart','touchmove'];function on(elem,type,fn){if(Array.isArray(type)){return _handleMultipleEvents(on,elem,type,fn);}
128if(!DomData.has(elem)){DomData.set(elem,{});}
129var data=DomData.get(elem);if(!data.handlers){data.handlers={};}
130if(!data.handlers[type]){data.handlers[type]=[];}
131if(!fn.guid){fn.guid=newGUID();}
132data.handlers[type].push(fn);if(!data.dispatcher){data.disabled=false;data.dispatcher=function(event,hash){if(data.disabled){return;}
133event=fixEvent(event);var handlers=data.handlers[event.type];if(handlers){var handlersCopy=handlers.slice(0);for(var m=0,n=handlersCopy.length;m<n;m++){if(event.isImmediatePropagationStopped()){break;}else{try{handlersCopy[m].call(elem,event,hash);}catch(e){log.error(e);}}}}};}
134if(data.handlers[type].length===1){if(elem.addEventListener){var options=false;if(supportsPassive()&&passiveEvents.indexOf(type)>-1){options={passive:true};}
135elem.addEventListener(type,data.dispatcher,options);}else if(elem.attachEvent){elem.attachEvent('on'+type,data.dispatcher);}}}
136function off(elem,type,fn){if(!DomData.has(elem)){return;}
137var data=DomData.get(elem);if(!data.handlers){return;}
138if(Array.isArray(type)){return _handleMultipleEvents(off,elem,type,fn);}
139var removeType=function removeType(el,t){data.handlers[t]=[];_cleanUpEvents(el,t);};if(type===undefined){for(var t in data.handlers){if(Object.prototype.hasOwnProperty.call(data.handlers||{},t)){removeType(elem,t);}}
140return;}
141var handlers=data.handlers[type];if(!handlers){return;}
142if(!fn){removeType(elem,type);return;}
143if(fn.guid){for(var n=0;n<handlers.length;n++){if(handlers[n].guid===fn.guid){handlers.splice(n--,1);}}}
144_cleanUpEvents(elem,type);}
145function trigger(elem,event,hash){var elemData=DomData.has(elem)?DomData.get(elem):{};var parent=elem.parentNode||elem.ownerDocument;if(typeof event==='string'){event={type:event,target:elem};}else if(!event.target){event.target=elem;}
146event=fixEvent(event);if(elemData.dispatcher){elemData.dispatcher.call(elem,event,hash);}
147if(parent&&!event.isPropagationStopped()&&event.bubbles===true){trigger.call(null,parent,event,hash);}else if(!parent&&!event.defaultPrevented&&event.target&&event.target[event.type]){if(!DomData.has(event.target)){DomData.set(event.target,{});}
148var targetData=DomData.get(event.target);if(event.target[event.type]){targetData.disabled=true;if(typeof event.target[event.type]==='function'){event.target[event.type]();}
149targetData.disabled=false;}}
150return!event.defaultPrevented;}
151function one(elem,type,fn){if(Array.isArray(type)){return _handleMultipleEvents(one,elem,type,fn);}
152var func=function func(){off(elem,type,func);fn.apply(this,arguments);};func.guid=fn.guid=fn.guid||newGUID();on(elem,type,func);}
153function any(elem,type,fn){var func=function func(){off(elem,type,func);fn.apply(this,arguments);};func.guid=fn.guid=fn.guid||newGUID();on(elem,type,func);}
154var Events=Object.freeze({__proto__:null,fixEvent:fixEvent,on:on,off:off,trigger:trigger,one:one,any:any});var UPDATE_REFRESH_INTERVAL=30;var bind=function bind(context,fn,uid){if(!fn.guid){fn.guid=newGUID();}
155var bound=fn.bind(context);bound.guid=uid?uid+'_'+fn.guid:fn.guid;return bound;};var throttle=function throttle(fn,wait){var last=window$3.performance.now();var throttled=function throttled(){var now=window$3.performance.now();if(now-last>=wait){fn.apply(void 0,arguments);last=now;}};return throttled;};var debounce=function debounce(func,wait,immediate,context){if(context===void 0){context=window$3;}
156var timeout;var cancel=function cancel(){context.clearTimeout(timeout);timeout=null;};var debounced=function debounced(){var self=this;var args=arguments;var _later=function later(){timeout=null;_later=null;if(!immediate){func.apply(self,args);}};if(!timeout&&immediate){func.apply(self,args);}
157context.clearTimeout(timeout);timeout=context.setTimeout(_later,wait);};debounced.cancel=cancel;return debounced;};var EventTarget=function EventTarget(){};EventTarget.prototype.allowedEvents_={};EventTarget.prototype.on=function(type,fn){var ael=this.addEventListener;this.addEventListener=function(){};on(this,type,fn);this.addEventListener=ael;};EventTarget.prototype.addEventListener=EventTarget.prototype.on;EventTarget.prototype.off=function(type,fn){off(this,type,fn);};EventTarget.prototype.removeEventListener=EventTarget.prototype.off;EventTarget.prototype.one=function(type,fn){var ael=this.addEventListener;this.addEventListener=function(){};one(this,type,fn);this.addEventListener=ael;};EventTarget.prototype.any=function(type,fn){var ael=this.addEventListener;this.addEventListener=function(){};any(this,type,fn);this.addEventListener=ael;};EventTarget.prototype.trigger=function(event){var type=event.type||event;if(typeof event==='string'){event={type:type};}
158event=fixEvent(event);if(this.allowedEvents_[type]&&this['on'+type]){this['on'+type](event);}
159trigger(this,event);};EventTarget.prototype.dispatchEvent=EventTarget.prototype.trigger;var EVENT_MAP;EventTarget.prototype.queueTrigger=function(event){var _this=this;if(!EVENT_MAP){EVENT_MAP=new Map();}
160var type=event.type||event;var map=EVENT_MAP.get(this);if(!map){map=new Map();EVENT_MAP.set(this,map);}
161var oldTimeout=map.get(type);map["delete"](type);window$3.clearTimeout(oldTimeout);var timeout=window$3.setTimeout(function(){if(map.size===0){map=null;EVENT_MAP["delete"](_this);}
162_this.trigger(event);},0);map.set(type,timeout);};var isEvented=function isEvented(object){return object instanceof EventTarget||!!object.eventBusEl_&&['on','one','off','trigger'].every(function(k){return typeof object[k]==='function';});};var addEventedCallback=function addEventedCallback(target,callback){if(isEvented(target)){callback();}else{if(!target.eventedCallbacks){target.eventedCallbacks=[];}
163target.eventedCallbacks.push(callback);}};var isValidEventType=function isValidEventType(type){return(typeof type==='string'&&/\S/.test(type)||Array.isArray(type)&&!!type.length);};var validateTarget=function validateTarget(target){if(!target.nodeName&&!isEvented(target)){throw new Error('Invalid target; must be a DOM node or evented object.');}};var validateEventType=function validateEventType(type){if(!isValidEventType(type)){throw new Error('Invalid event type; must be a non-empty string or array.');}};var validateListener=function validateListener(listener){if(typeof listener!=='function'){throw new Error('Invalid listener; must be a function.');}};var normalizeListenArgs=function normalizeListenArgs(self,args){var isTargetingSelf=args.length<3||args[0]===self||args[0]===self.eventBusEl_;var target;var type;var listener;if(isTargetingSelf){target=self.eventBusEl_;if(args.length>=3){args.shift();}
164type=args[0];listener=args[1];}else{target=args[0];type=args[1];listener=args[2];}
165validateTarget(target);validateEventType(type);validateListener(listener);listener=bind(self,listener);return{isTargetingSelf:isTargetingSelf,target:target,type:type,listener:listener};};var listen=function listen(target,method,type,listener){validateTarget(target);if(target.nodeName){Events[method](target,type,listener);}else{target[method](type,listener);}};var EventedMixin={on:function on(){var _this=this;for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}
166var _normalizeListenArgs=normalizeListenArgs(this,args),isTargetingSelf=_normalizeListenArgs.isTargetingSelf,target=_normalizeListenArgs.target,type=_normalizeListenArgs.type,listener=_normalizeListenArgs.listener;listen(target,'on',type,listener);if(!isTargetingSelf){var removeListenerOnDispose=function removeListenerOnDispose(){return _this.off(target,type,listener);};removeListenerOnDispose.guid=listener.guid;var removeRemoverOnTargetDispose=function removeRemoverOnTargetDispose(){return _this.off('dispose',removeListenerOnDispose);};removeRemoverOnTargetDispose.guid=listener.guid;listen(this,'on','dispose',removeListenerOnDispose);listen(target,'on','dispose',removeRemoverOnTargetDispose);}},one:function one(){var _this2=this;for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2];}
167var _normalizeListenArgs2=normalizeListenArgs(this,args),isTargetingSelf=_normalizeListenArgs2.isTargetingSelf,target=_normalizeListenArgs2.target,type=_normalizeListenArgs2.type,listener=_normalizeListenArgs2.listener;if(isTargetingSelf){listen(target,'one',type,listener);}else{var wrapper=function wrapper(){_this2.off(target,type,wrapper);for(var _len3=arguments.length,largs=new Array(_len3),_key3=0;_key3<_len3;_key3++){largs[_key3]=arguments[_key3];}
168listener.apply(null,largs);};wrapper.guid=listener.guid;listen(target,'one',type,wrapper);}},any:function any(){var _this3=this;for(var _len4=arguments.length,args=new Array(_len4),_key4=0;_key4<_len4;_key4++){args[_key4]=arguments[_key4];}
169var _normalizeListenArgs3=normalizeListenArgs(this,args),isTargetingSelf=_normalizeListenArgs3.isTargetingSelf,target=_normalizeListenArgs3.target,type=_normalizeListenArgs3.type,listener=_normalizeListenArgs3.listener;if(isTargetingSelf){listen(target,'any',type,listener);}else{var wrapper=function wrapper(){_this3.off(target,type,wrapper);for(var _len5=arguments.length,largs=new Array(_len5),_key5=0;_key5<_len5;_key5++){largs[_key5]=arguments[_key5];}
170listener.apply(null,largs);};wrapper.guid=listener.guid;listen(target,'any',type,wrapper);}},off:function off$1(targetOrType,typeOrListener,listener){if(!targetOrType||isValidEventType(targetOrType)){off(this.eventBusEl_,targetOrType,typeOrListener);}else{var target=targetOrType;var type=typeOrListener;validateTarget(target);validateEventType(type);validateListener(listener);listener=bind(this,listener);this.off('dispose',listener);if(target.nodeName){off(target,type,listener);off(target,'dispose',listener);}else if(isEvented(target)){target.off(type,listener);target.off('dispose',listener);}}},trigger:function trigger$1(event,hash){return trigger(this.eventBusEl_,event,hash);}};function evented(target,options){if(options===void 0){options={};}
171var _options=options,eventBusKey=_options.eventBusKey;if(eventBusKey){if(!target[eventBusKey].nodeName){throw new Error("The eventBusKey \""+eventBusKey+"\" does not refer to an element.");}
172target.eventBusEl_=target[eventBusKey];}else{target.eventBusEl_=createEl('span',{className:'vjs-event-bus'});}
173assign(target,EventedMixin);if(target.eventedCallbacks){target.eventedCallbacks.forEach(function(callback){callback();});}
174target.on('dispose',function(){target.off();window$3.setTimeout(function(){target.eventBusEl_=null;},0);});return target;}
175var StatefulMixin={state:{},setState:function setState(stateUpdates){var _this=this;if(typeof stateUpdates==='function'){stateUpdates=stateUpdates();}
176var changes;each(stateUpdates,function(value,key){if(_this.state[key]!==value){changes=changes||{};changes[key]={from:_this.state[key],to:value};}
177_this.state[key]=value;});if(changes&&isEvented(this)){this.trigger({changes:changes,type:'statechanged'});}
178return changes;}};function stateful(target,defaultState){assign(target,StatefulMixin);target.state=assign({},target.state,defaultState);if(typeof target.handleStateChanged==='function'&&isEvented(target)){target.on('statechanged',target.handleStateChanged);}
179return target;}
180var toLowerCase=function toLowerCase(string){if(typeof string!=='string'){return string;}
181return string.replace(/./,function(w){return w.toLowerCase();});};var toTitleCase=function toTitleCase(string){if(typeof string!=='string'){return string;}
182return string.replace(/./,function(w){return w.toUpperCase();});};var titleCaseEquals=function titleCaseEquals(str1,str2){return toTitleCase(str1)===toTitleCase(str2);};function mergeOptions(){var result={};for(var _len=arguments.length,sources=new Array(_len),_key=0;_key<_len;_key++){sources[_key]=arguments[_key];}
183sources.forEach(function(source){if(!source){return;}
184each(source,function(value,key){if(!isPlain(value)){result[key]=value;return;}
185if(!isPlain(result[key])){result[key]={};}
186result[key]=mergeOptions(result[key],value);});});return result;}
187var Component=function(){function Component(player,options,ready){if(!player&&this.play){this.player_=player=this;}else{this.player_=player;}
188this.isDisposed_=false;this.parentComponent_=null;this.options_=mergeOptions({},this.options_);options=this.options_=mergeOptions(this.options_,options);this.id_=options.id||options.el&&options.el.id;if(!this.id_){var id=player&&player.id&&player.id()||'no_player';this.id_=id+"_component_"+newGUID();}
189this.name_=options.name||null;if(options.el){this.el_=options.el;}else if(options.createEl!==false){this.el_=this.createEl();}
190if(options.evented!==false){evented(this,{eventBusKey:this.el_?'el_':null});}
191stateful(this,this.constructor.defaultState);this.children_=[];this.childIndex_={};this.childNameIndex_={};var SetSham;if(!window$3.Set){SetSham=function(){function SetSham(){this.set_={};}
192var _proto2=SetSham.prototype;_proto2.has=function has(key){return key in this.set_;};_proto2["delete"]=function _delete(key){var has=this.has(key);delete this.set_[key];return has;};_proto2.add=function add(key){this.set_[key]=1;return this;};_proto2.forEach=function forEach(callback,thisArg){for(var key in this.set_){callback.call(thisArg,key,key,this);}};return SetSham;}();}
193this.setTimeoutIds_=window$3.Set?new Set():new SetSham();this.setIntervalIds_=window$3.Set?new Set():new SetSham();this.rafIds_=window$3.Set?new Set():new SetSham();this.clearingTimersOnDispose_=false;if(options.initChildren!==false){this.initChildren();}
194this.ready(ready);if(options.reportTouchActivity!==false){this.enableTouchActivity();}}
195var _proto=Component.prototype;_proto.dispose=function dispose(){if(this.isDisposed_){return;}
196this.trigger({type:'dispose',bubbles:false});this.isDisposed_=true;if(this.children_){for(var i=this.children_.length-1;i>=0;i--){if(this.children_[i].dispose){this.children_[i].dispose();}}}
197this.children_=null;this.childIndex_=null;this.childNameIndex_=null;this.parentComponent_=null;if(this.el_){if(this.el_.parentNode){this.el_.parentNode.removeChild(this.el_);}
198if(DomData.has(this.el_)){DomData["delete"](this.el_);}
199this.el_=null;}
200this.player_=null;};_proto.isDisposed=function isDisposed(){return Boolean(this.isDisposed_);};_proto.player=function player(){return this.player_;};_proto.options=function options(obj){if(!obj){return this.options_;}
201this.options_=mergeOptions(this.options_,obj);return this.options_;};_proto.el=function el(){return this.el_;};_proto.createEl=function createEl$1(tagName,properties,attributes){return createEl(tagName,properties,attributes);};_proto.localize=function localize(string,tokens,defaultValue){if(defaultValue===void 0){defaultValue=string;}
202var code=this.player_.language&&this.player_.language();var languages=this.player_.languages&&this.player_.languages();var language=languages&&languages[code];var primaryCode=code&&code.split('-')[0];var primaryLang=languages&&languages[primaryCode];var localizedString=defaultValue;if(language&&language[string]){localizedString=language[string];}else if(primaryLang&&primaryLang[string]){localizedString=primaryLang[string];}
203if(tokens){localizedString=localizedString.replace(/\{(\d+)\}/g,function(match,index){var value=tokens[index-1];var ret=value;if(typeof value==='undefined'){ret=match;}
204return ret;});}
205return localizedString;};_proto.contentEl=function contentEl(){return this.contentEl_||this.el_;};_proto.id=function id(){return this.id_;};_proto.name=function name(){return this.name_;};_proto.children=function children(){return this.children_;};_proto.getChildById=function getChildById(id){return this.childIndex_[id];};_proto.getChild=function getChild(name){if(!name){return;}
206return this.childNameIndex_[name];};_proto.getDescendant=function getDescendant(){for(var _len=arguments.length,names=new Array(_len),_key=0;_key<_len;_key++){names[_key]=arguments[_key];}
207names=names.reduce(function(acc,n){return acc.concat(n);},[]);var currentChild=this;for(var i=0;i<names.length;i++){currentChild=currentChild.getChild(names[i]);if(!currentChild||!currentChild.getChild){return;}}
208return currentChild;};_proto.addChild=function addChild(child,options,index){if(options===void 0){options={};}
209if(index===void 0){index=this.children_.length;}
210var component;var componentName;if(typeof child==='string'){componentName=toTitleCase(child);var componentClassName=options.componentClass||componentName;options.name=componentName;var ComponentClass=Component.getComponent(componentClassName);if(!ComponentClass){throw new Error("Component "+componentClassName+" does not exist");}
211if(typeof ComponentClass!=='function'){return null;}
212component=new ComponentClass(this.player_||this,options);}else{component=child;}
213if(component.parentComponent_){component.parentComponent_.removeChild(component);}
214this.children_.splice(index,0,component);component.parentComponent_=this;if(typeof component.id==='function'){this.childIndex_[component.id()]=component;}
215componentName=componentName||component.name&&toTitleCase(component.name());if(componentName){this.childNameIndex_[componentName]=component;this.childNameIndex_[toLowerCase(componentName)]=component;}
216if(typeof component.el==='function'&&component.el()){var refNode=null;if(this.children_[index+1]&&this.children_[index+1].el_){refNode=this.children_[index+1].el_;}
217this.contentEl().insertBefore(component.el(),refNode);}
218return component;};_proto.removeChild=function removeChild(component){if(typeof component==='string'){component=this.getChild(component);}
219if(!component||!this.children_){return;}
220var childFound=false;for(var i=this.children_.length-1;i>=0;i--){if(this.children_[i]===component){childFound=true;this.children_.splice(i,1);break;}}
221if(!childFound){return;}
222component.parentComponent_=null;this.childIndex_[component.id()]=null;this.childNameIndex_[toTitleCase(component.name())]=null;this.childNameIndex_[toLowerCase(component.name())]=null;var compEl=component.el();if(compEl&&compEl.parentNode===this.contentEl()){this.contentEl().removeChild(component.el());}};_proto.initChildren=function initChildren(){var _this=this;var children=this.options_.children;if(children){var parentOptions=this.options_;var handleAdd=function handleAdd(child){var name=child.name;var opts=child.opts;if(parentOptions[name]!==undefined){opts=parentOptions[name];}
223if(opts===false){return;}
224if(opts===true){opts={};}
225opts.playerOptions=_this.options_.playerOptions;var newChild=_this.addChild(name,opts);if(newChild){_this[name]=newChild;}};var workingChildren;var Tech=Component.getComponent('Tech');if(Array.isArray(children)){workingChildren=children;}else{workingChildren=Object.keys(children);}
226workingChildren.concat(Object.keys(this.options_).filter(function(child){return!workingChildren.some(function(wchild){if(typeof wchild==='string'){return child===wchild;}
227return child===wchild.name;});})).map(function(child){var name;var opts;if(typeof child==='string'){name=child;opts=children[name]||_this.options_[name]||{};}else{name=child.name;opts=child;}
228return{name:name,opts:opts};}).filter(function(child){var c=Component.getComponent(child.opts.componentClass||toTitleCase(child.name));return c&&!Tech.isTech(c);}).forEach(handleAdd);}};_proto.buildCSSClass=function buildCSSClass(){return '';};_proto.ready=function ready(fn,sync){if(sync===void 0){sync=false;}
229if(!fn){return;}
230if(!this.isReady_){this.readyQueue_=this.readyQueue_||[];this.readyQueue_.push(fn);return;}
231if(sync){fn.call(this);}else{this.setTimeout(fn,1);}};_proto.triggerReady=function triggerReady(){this.isReady_=true;this.setTimeout(function(){var readyQueue=this.readyQueue_;this.readyQueue_=[];if(readyQueue&&readyQueue.length>0){readyQueue.forEach(function(fn){fn.call(this);},this);}
232this.trigger('ready');},1);};_proto.$=function $$1(selector,context){return $(selector,context||this.contentEl());};_proto.$$=function $$$1(selector,context){return $$(selector,context||this.contentEl());};_proto.hasClass=function hasClass$1(classToCheck){return hasClass(this.el_,classToCheck);};_proto.addClass=function addClass$1(classToAdd){addClass(this.el_,classToAdd);};_proto.removeClass=function removeClass$1(classToRemove){removeClass(this.el_,classToRemove);};_proto.toggleClass=function toggleClass$1(classToToggle,predicate){toggleClass(this.el_,classToToggle,predicate);};_proto.show=function show(){this.removeClass('vjs-hidden');};_proto.hide=function hide(){this.addClass('vjs-hidden');};_proto.lockShowing=function lockShowing(){this.addClass('vjs-lock-showing');};_proto.unlockShowing=function unlockShowing(){this.removeClass('vjs-lock-showing');};_proto.getAttribute=function getAttribute$1(attribute){return getAttribute(this.el_,attribute);};_proto.setAttribute=function setAttribute$1(attribute,value){setAttribute(this.el_,attribute,value);};_proto.removeAttribute=function removeAttribute$1(attribute){removeAttribute(this.el_,attribute);};_proto.width=function width(num,skipListeners){return this.dimension('width',num,skipListeners);};_proto.height=function height(num,skipListeners){return this.dimension('height',num,skipListeners);};_proto.dimensions=function dimensions(width,height){this.width(width,true);this.height(height);};_proto.dimension=function dimension(widthOrHeight,num,skipListeners){if(num!==undefined){if(num===null||num!==num){num=0;}
233if((''+num).indexOf('%')!==-1||(''+num).indexOf('px')!==-1){this.el_.style[widthOrHeight]=num;}else if(num==='auto'){this.el_.style[widthOrHeight]='';}else{this.el_.style[widthOrHeight]=num+'px';}
234if(!skipListeners){this.trigger('componentresize');}
235return;}
236if(!this.el_){return 0;}
237var val=this.el_.style[widthOrHeight];var pxIndex=val.indexOf('px');if(pxIndex!==-1){return parseInt(val.slice(0,pxIndex),10);}
238return parseInt(this.el_['offset'+toTitleCase(widthOrHeight)],10);};_proto.currentDimension=function currentDimension(widthOrHeight){var computedWidthOrHeight=0;if(widthOrHeight!=='width'&&widthOrHeight!=='height'){throw new Error('currentDimension only accepts width or height value');}
239computedWidthOrHeight=computedStyle(this.el_,widthOrHeight);computedWidthOrHeight=parseFloat(computedWidthOrHeight);if(computedWidthOrHeight===0||isNaN(computedWidthOrHeight)){var rule="offset"+toTitleCase(widthOrHeight);computedWidthOrHeight=this.el_[rule];}
240return computedWidthOrHeight;};_proto.currentDimensions=function currentDimensions(){return{width:this.currentDimension('width'),height:this.currentDimension('height')};};_proto.currentWidth=function currentWidth(){return this.currentDimension('width');};_proto.currentHeight=function currentHeight(){return this.currentDimension('height');};_proto.focus=function focus(){this.el_.focus();};_proto.blur=function blur(){this.el_.blur();};_proto.handleKeyDown=function handleKeyDown(event){if(this.player_){event.stopPropagation();this.player_.handleKeyDown(event);}};_proto.handleKeyPress=function handleKeyPress(event){this.handleKeyDown(event);};_proto.emitTapEvents=function emitTapEvents(){var touchStart=0;var firstTouch=null;var tapMovementThreshold=10;var touchTimeThreshold=200;var couldBeTap;this.on('touchstart',function(event){if(event.touches.length===1){firstTouch={pageX:event.touches[0].pageX,pageY:event.touches[0].pageY};touchStart=window$3.performance.now();couldBeTap=true;}});this.on('touchmove',function(event){if(event.touches.length>1){couldBeTap=false;}else if(firstTouch){var xdiff=event.touches[0].pageX-firstTouch.pageX;var ydiff=event.touches[0].pageY-firstTouch.pageY;var touchDistance=Math.sqrt(xdiff*xdiff+ydiff*ydiff);if(touchDistance>tapMovementThreshold){couldBeTap=false;}}});var noTap=function noTap(){couldBeTap=false;};this.on('touchleave',noTap);this.on('touchcancel',noTap);this.on('touchend',function(event){firstTouch=null;if(couldBeTap===true){var touchTime=window$3.performance.now()-touchStart;if(touchTime<touchTimeThreshold){event.preventDefault();this.trigger('tap');}}});};_proto.enableTouchActivity=function enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity){return;}
241var report=bind(this.player(),this.player().reportUserActivity);var touchHolding;this.on('touchstart',function(){report();this.clearInterval(touchHolding);touchHolding=this.setInterval(report,250);});var touchEnd=function touchEnd(event){report();this.clearInterval(touchHolding);};this.on('touchmove',report);this.on('touchend',touchEnd);this.on('touchcancel',touchEnd);};_proto.setTimeout=function setTimeout(fn,timeout){var _this2=this;var timeoutId;fn=bind(this,fn);this.clearTimersOnDispose_();timeoutId=window$3.setTimeout(function(){if(_this2.setTimeoutIds_.has(timeoutId)){_this2.setTimeoutIds_["delete"](timeoutId);}
242fn();},timeout);this.setTimeoutIds_.add(timeoutId);return timeoutId;};_proto.clearTimeout=function clearTimeout(timeoutId){if(this.setTimeoutIds_.has(timeoutId)){this.setTimeoutIds_["delete"](timeoutId);window$3.clearTimeout(timeoutId);}
243return timeoutId;};_proto.setInterval=function setInterval(fn,interval){fn=bind(this,fn);this.clearTimersOnDispose_();var intervalId=window$3.setInterval(fn,interval);this.setIntervalIds_.add(intervalId);return intervalId;};_proto.clearInterval=function clearInterval(intervalId){if(this.setIntervalIds_.has(intervalId)){this.setIntervalIds_["delete"](intervalId);window$3.clearInterval(intervalId);}
244return intervalId;};_proto.requestAnimationFrame=function requestAnimationFrame(fn){var _this3=this;if(!this.supportsRaf_){return this.setTimeout(fn,1000/60);}
245this.clearTimersOnDispose_();var id;fn=bind(this,fn);id=window$3.requestAnimationFrame(function(){if(_this3.rafIds_.has(id)){_this3.rafIds_["delete"](id);}
246fn();});this.rafIds_.add(id);return id;};_proto.cancelAnimationFrame=function cancelAnimationFrame(id){if(!this.supportsRaf_){return this.clearTimeout(id);}
247if(this.rafIds_.has(id)){this.rafIds_["delete"](id);window$3.cancelAnimationFrame(id);}
248return id;};_proto.clearTimersOnDispose_=function clearTimersOnDispose_(){var _this4=this;if(this.clearingTimersOnDispose_){return;}
249this.clearingTimersOnDispose_=true;this.one('dispose',function(){[['rafIds_','cancelAnimationFrame'],['setTimeoutIds_','clearTimeout'],['setIntervalIds_','clearInterval']].forEac
249h(function(_ref){var idName=_ref[0],cancelName=_ref[1];_this4[idName].forEach(_this4[cancelName],_this4);});_this4.clearingTimersOnDispose_=false;});};Component.registerComponent=function registerComponent(name,ComponentToRegister){if(typeof name!=='string'||!name){throw new Error("Illegal component name, \""+name+"\"; must be a non-empty string.");}
250var Tech=Component.getComponent('Tech');var isTech=Tech&&Tech.isTech(ComponentToRegister);var isComp=Component===ComponentToRegister||Component.prototype.isPrototypeOf(ComponentToRegister.prototype);if(isTech||!isComp){var reason;if(isTech){reason='techs must be registered using Tech.registerTech()';}else{reason='must be a Component subclass';}
251throw new Error("Illegal component, \""+name+"\"; "+reason+".");}
252name=toTitleCase(name);if(!Component.components_){Component.components_={};}
253var Player=Component.getComponent('Player');if(name==='Player'&&Player&&Player.players){var players=Player.players;var playerNames=Object.keys(players);if(players&&playerNames.length>0&&playerNames.map(function(pname){return players[pname];}).every(Boolean)){throw new Error('Can not register Player component after player has been created.');}}
254Component.components_[name]=ComponentToRegister;Component.components_[toLowerCase(name)]=ComponentToRegister;return ComponentToRegister;};Component.getComponent=function getComponent(name){if(!name||!Component.components_){return;}
255return Component.components_[name];};return Component;}();Component.prototype.supportsRaf_=typeof window$3.requestAnimationFrame==='function'&&typeof window$3.cancelAnimationFrame==='function';Component.registerComponent('Component',Component);function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}
256return self;}
257var assertThisInitialized=_assertThisInitialized;var _typeof_1=createCommonjsModule(function(module){function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){module.exports=_typeof=function _typeof(obj){return typeof obj;};}else{module.exports=_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}
258return _typeof(obj);}
259module.exports=_typeof;});var getPrototypeOf=createCommonjsModule(function(module){function _getPrototypeOf(o){module.exports=_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}
260module.exports=_getPrototypeOf;});function _inheritsLoose(subClass,superClass){subClass.prototype=Object.create(superClass.prototype);subClass.prototype.constructor=subClass;subClass.__proto__=superClass;}
261var inheritsLoose=_inheritsLoose;var USER_AGENT=window$3.navigator&&window$3.navigator.userAgent||'';var webkitVersionMap=/AppleWebKit\/([\d.]+)/i.exec(USER_AGENT);var appleWebkitVersion=webkitVersionMap?parseFloat(webkitVersionMap.pop()):null;var IS_IPOD=/iPod/i.test(USER_AGENT);var IOS_VERSION=function(){var match=USER_AGENT.match(/OS (\d+)_/i);if(match&&match[1]){return match[1];}
262return null;}();var IS_ANDROID=/Android/i.test(USER_AGENT);var ANDROID_VERSION=function(){var match=USER_AGENT.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!match){return null;}
263var major=match[1]&&parseFloat(match[1]);var minor=match[2]&&parseFloat(match[2]);if(major&&minor){return parseFloat(match[1]+'.'+match[2]);}else if(major){return major;}
264return null;}();var IS_NATIVE_ANDROID=IS_ANDROID&&ANDROID_VERSION<5&&appleWebkitVersion<537;var IS_FIREFOX=/Firefox/i.test(USER_AGENT);var IS_EDGE=/Edg/i.test(USER_AGENT);var IS_CHROME=!IS_EDGE&&(/Chrome/i.test(USER_AGENT)||/CriOS/i.test(USER_AGENT));var CHROME_VERSION=function(){var match=USER_AGENT.match(/(Chrome|CriOS)\/(\d+)/);if(match&&match[2]){return parseFloat(match[2]);}
265return null;}();var IE_VERSION=function(){var result=/MSIE\s(\d+)\.\d/.exec(USER_AGENT);var version=result&&parseFloat(result[1]);if(!version&&/Trident\/7.0/i.test(USER_AGENT)&&/rv:11.0/.test(USER_AGENT)){version=11.0;}
266return version;}();var IS_SAFARI=/Safari/i.test(USER_AGENT)&&!IS_CHROME&&!IS_ANDROID&&!IS_EDGE;var IS_WINDOWS=/Windows/i.test(USER_AGENT);var TOUCH_ENABLED=isReal()&&('ontouchstart'in window$3||window$3.navigator.maxTouchPoints||window$3.DocumentTouch&&window$3.document instanceof window$3.DocumentTouch);var IS_IPAD=/iPad/i.test(USER_AGENT)||IS_SAFARI&&TOUCH_ENABLED&&
266!/iPhone/i.test(USER_AGENT);var IS_IPHONE=/iPhone/i.test(USER_AGENT)&&!IS_IPAD;var IS_IOS=IS_IPHONE||IS_IPAD||IS_IPOD;var IS_ANY_SAFARI=(IS_SAFARI||IS_IOS)&&!IS_CHROME;var browser=Object.freeze({__proto__:null,IS_IPOD:IS_IPOD,IOS_VERSION:IOS_VERSION,IS_ANDROID:IS_ANDROID,ANDROID_VERSION:ANDROID_VERSION,IS_NATIVE_ANDROID:IS_NATIVE_ANDROID,IS_FIREFOX:IS_FIREFOX,IS_EDGE:IS_EDGE,IS_CHROME:IS_CHROME,CHROME_VERSION:CHROME_VERSION,IE_VERSION:IE_VERSION,IS_SAFARI:IS_SAFARI,IS_WINDOWS:IS_WINDOWS,TOUCH_ENABLED:TOUCH_ENABLED,IS_IPAD:IS_IPAD,IS_IPHONE:IS_IPHONE,IS_IOS:IS_IOS,IS_ANY_SAFARI:IS_ANY_SAFARI});function rangeCheck(fnName,index,maxIndex){if(typeof index!=='number'||index<0||index>maxIndex){throw new Error("Failed to execute '"+fnName+"' on 'TimeRanges': The index provided ("+index+") is non-numeric or out of bounds (0-"+maxIndex+").");}}
267function getRange(fnName,valueIndex,ranges,rangeIndex){rangeCheck(fnName,rangeIndex,ranges.length-1);return ranges[rangeIndex][valueIndex];}
268function createTimeRangesObj(ranges){if(ranges===undefined||ranges.length===0){return{length:0,start:function start(){throw new Error('This TimeRanges object is empty');},end:function end(){throw new Error('This TimeRanges object is empty');}};}
269return{length:ranges.length,start:getRange.bind(null,'start',0,ranges),end:getRange.bind(null,'end',1,ranges)};}
270function createTimeRanges(start,end){if(Array.isArray(start)){return createTimeRangesObj(start);}else if(start===undefined||end===undefined){return createTimeRangesObj();}
271return createTimeRangesObj([[start,end]]);}
272function bufferedPercent(buffered,duration){var bufferedDuration=0;var start;var end;if(!duration){return 0;}
273if(!buffered||!buffered.length){buffered=createTimeRanges(0,0);}
274for(var i=0;i<buffered.length;i++){start=buffered.start(i);end=buffered.end(i);if(end>duration){end=duration;}
275bufferedDuration+=end-start;}
276return bufferedDuration/duration;}
277var FullscreenApi={prefixed:true};var apiMap=[['requestFullscreen','exitFullscreen','fullscreenElement','fullscreenEnabled','fullscreenchange','fullscreenerror','fullscreen'],['webkitRequestFullscreen','webkitExitFullscreen','webkitFullscreenElement','webkitFullscreenEnabled','webkitfullscreenchange','webkitfullscreenerror','-webkit-full-screen'],['mozRequestFullScreen','mozCancelFullScreen','mozFullScreenElement','mozFullScreenEnabled','mozfullscreenchange','mozfullscreenerror','-moz-full-screen'],['msRequestFullscreen','msExitFullscreen','msFullscreenElement','msFullscreenEnabled','MSFullscreenChange','MSFullscreenError','-ms-fullscreen']];var specApi=apiMap[0];var browserApi;for(var i=0;i<apiMap.length;i++){if(apiMap[i][1]in document){browserApi=apiMap[i];break;}}
278if(browserApi){for(var _i=0;_i<browserApi.length;_i++){FullscreenApi[specApi[_i]]=browserApi[_i];}
279FullscreenApi.prefixed=browserApi[0]!==specApi[0];}
280function MediaError(value){if(value instanceof MediaError){return value;}
281if(typeof value==='number'){this.code=value;}else if(typeof value==='string'){this.message=value;}else if(isObject(value)){if(typeof value.code==='number'){this.code=value.code;}
282assign(this,value);}
283if(!this.message){this.message=MediaError.defaultMessages[this.code]||'';}}
284MediaError.prototype.code=0;MediaError.prototype.message='';MediaError.prototype.status=null;MediaError.errorTypes=['MEDIA_ERR_CUSTOM','MEDIA_ERR_ABORTED','MEDIA_ERR_NETWORK','MEDIA_ERR_DECODE','MEDIA_ERR_SRC_NOT_SUPPORTED','MEDIA_ERR_ENCRYPTED'];MediaError.defaultMessages={1:'You aborted the media playback',2:'A network error caused the media download to fail part-way.',3:'The media playback was aborted due to a corruption problem or because the media used features your browser did not support.',4:'The media could not be loaded, either because the server or network failed or because the format is not supported.',5:'The media is encrypted and we do not have the keys to decrypt it.'};for(var errNum=0;errNum<MediaError.errorTypes.length;errNum++){MediaError[MediaError.errorTypes[errNum]]=errNum;MediaError.prototype[MediaError.errorTypes[errNum]]=errNum;}
285var tuple=SafeParseTuple;function SafeParseTuple(obj,reviver){var json;var error=null;try{json=JSON.parse(obj,reviver);}catch(err){error=err;}
286return[error,json];}
287function isPromise(value){return value!==undefined&&value!==null&&typeof value.then==='function';}
288function silencePromise(value){if(isPromise(value)){value.then(null,function(e){});}}
289var trackToJson_=function trackToJson_(track){var ret=['kind','label','language','id','inBandMetadataTrackDispatchType','mode','src'].reduce(function(acc,prop,i){if(track[prop]){acc[prop]=track[prop];}
290return acc;},{cues:track.cues&&Array.prototype.map.call(track.cues,function(cue){return{startTime:cue.startTime,endTime:cue.endTime,text:cue.text,id:cue.id};})});return ret;};var textTracksToJson=function textTracksToJson(tech){var trackEls=tech.$$('track');var trackObjs=Array.prototype.map.call(trackEls,function(t){return t.track;});var tracks=Array.prototype.map.call(trackEls,function(trackEl){var json=trackToJson_(trackEl.track);if(trackEl.src){json.src=trackEl.src;}
291return json;});return tracks.concat(Array.prototype.filter.call(tech.textTracks(),function(track){return trackObjs.indexOf(track)===-1;}).map(trackToJson_));};var jsonToTextTracks=function jsonToTextTracks(json,tech){json.forEach(function(track){var addedTrack=tech.addRemoteTextTrack(track).track;if(!track.src&&track.cues){track.cues.forEach(function(cue){return addedTrack.addCue(cue);});}});return tech.textTracks();};var textTrackConverter={textTracksToJson:textTracksToJson,jsonToTextTracks:jsonToTextTracks,trackToJson_:trackToJson_};var keycode=createCommonjsModule(function(module,exports){function keyCode(searchInput){if(searchInput&&'object'===typeof searchInput){var hasKeyCode=searchInput.which||searchInput.keyCode||searchInput.charCode;if(hasKeyCode)searchInput=hasKeyCode;}
292if('number'===typeof searchInput)return names[searchInput];var search=String(searchInput);var foundNamedKey=codes[search.toLowerCase()];if(foundNamedKey)return foundNamedKey;var foundNamedKey=aliases[search.toLowerCase()];if(foundNamedKey)return foundNamedKey;if(search.length===1)return search.charCodeAt(0);return undefined;}
293keyCode.isEventKey=function isEventKey(event,nameOrCode){if(event&&'object'===typeof event){var keyCode=event.which||event.keyCode||event.charCode;if(keyCode===null||keyCode===undefined){return false;}
294if(typeof nameOrCode==='string'){var foundNamedKey=codes[nameOrCode.toLowerCase()];if(foundNamedKey){return foundNamedKey===keyCode;}
295var foundNamedKey=aliases[nameOrCode.toLowerCase()];if(foundNamedKey){return foundNamedKey===keyCode;}}else if(typeof nameOrCode==='number'){return nameOrCode===keyCode;}
296return false;}};exports=module.exports=keyCode;var codes=exports.code=exports.codes={'backspace':8,'tab':9,'enter':13,'shift':16,'ctrl':17,'alt':18,'pause/break':19,'caps lock':20,'esc':27,'space':32,'page up':33,'page down':34,'end':35,'home':36,'left':37,'up':38,'right':39,'down':40,'insert':45,'delete':46,'command':91,'left command':91,'right command':93,'numpad *':106,'numpad +':107,'numpad -':109,'numpad .':110,'numpad /':111,'num lock':144,'scroll lock':145,'my computer':182,'my calculator':183,';':186,'=':187,',':188,'-':189,'.':190,'/':191,'`':192,'[':219,'\\':220,']':221,"'":222};var aliases=exports.aliases={'windows':91,'⇧':16,'⌥':18,'⌃':17,'⌘':91,'ctl':17,'control':17,'option':18,'pause':19,'break':19,'caps':20,'return':13,'escape':27,'spc':32,'spacebar':32,'pgup':33,'pgdn':34,'ins':45,'del':46,'cmd':91};/*!
297* Programatically add the following
298*/for(i=97;i<123;i++){codes[String.fromCharCode(i)]=i-32;}
299for(var i=48;i<58;i++){codes[i-48]=i;}
300for(i=1;i<13;i++){codes['f'+i]=i+111;}
301for(i=0;i<10;i++){codes['numpad '+i]=i+96;}
302var names=exports.names=exports.title={};for(i in codes){names[codes[i]]=i;}
303for(var alias in aliases){codes[alias]=aliases[alias];}});var keycode_1=keycode.code;var keycode_2=keycode.codes;var keycode_3=keycode.aliases;var keycode_4=keycode.names;var keycode_5=keycode.title;var MODAL_CLASS_NAME='vjs-modal-dialog';var ModalDialog=function(_Component){inheritsLoose(ModalDialog,_Component);function ModalDialog(player,options){var _this;_this=_Component.call(this,player,options)||this;_this.opened_=_this.hasBeenOpened_=_this.hasBeenFilled_=false;_this.closeable(!_this.options_.uncloseable);_this.content(_this.options_.content);_this.contentEl_=createEl('div',{className:MODAL_CLASS_NAME+"-content"},{role:'document'});_this.descEl_=createEl('p',{className:MODAL_CLASS_NAME+"-description vjs-control-text",id:_this.el().getAttribute('aria-describedby')});textContent(_this.descEl_,_this.description());_this.el_.appendChild(_this.descEl_);_this.el_.appendChild(_this.contentEl_);return _this;}
304var _proto=ModalDialog.prototype;_proto.createEl=function createEl(){return _Component.prototype.createEl.call(this,'div',{className:this.buildCSSClass(),tabIndex:-1},{'aria-describedby':this.id()+"_description",'aria-hidden':'true','aria-label':this.label(),'role':'dialog'});};_proto.dispose=function dispose(){this.contentEl_=null;this.descEl_=null;this.previouslyActiveEl_=null;_Component.prototype.dispose.call(this);};_proto.buildCSSClass=function buildCSSClass(){return MODAL_CLASS_NAME+" vjs-hidden "+_Component.prototype.buildCSSClass.call(this);};_proto.label=function label(){return this.localize(this.options_.label||'Modal Window');};_proto.description=function description(){var desc=this.options_.description||this.localize('This is a modal window.');if(this.closeable()){desc+=' '+this.localize('This modal can be closed by pressing the Escape key or activating the close button.');}
305return desc;};_proto.open=function open(){if(!this.opened_){var player=this.player();this.trigger('beforemodalopen');this.opened_=true;if(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_){this.fill();}
306this.wasPlaying_=!player.paused();
vendor: 31,605 bytes, lines 306-454
306if(this.options_.pauseOnOpen&&this.wasPlaying_){player.pause();}
307this.on('keydown',this.handleKeyDown);this.hadControls_=player.controls();player.controls(false);this.show();this.conditionalFocus_();this.el().setAttribute('aria-hidden','false');this.trigger('modalopen');this.hasBeenOpened_=true;}};_proto.opened=function opened(value){if(typeof value==='boolean'){this[value?'open':'close']();}
308return this.opened_;};_proto.close=function close(){if(!this.opened_){return;}
309var player=this.player();this.trigger('beforemodalclose');this.opened_=false;if(this.wasPlaying_&&this.options_.pauseOnOpen){player.play();}
310this.off('keydown',this.handleKeyDown);if(this.hadControls_){player.controls(true);}
311this.hide();this.el().setAttribute('aria-hidden','true');this.trigger('modalclose');this.conditionalBlur_();if(this.options_.temporary){this.dispose();}};_proto.closeable=function closeable(value){if(typeof value==='boolean'){var closeable=this.closeable_=!!value;var close=this.getChild('closeButton');if(closeable&&!close){var temp=this.contentEl_;this.contentEl_=this.el_;close=this.addChild('closeButton',{controlText:'Close Modal Dialog'});this.contentEl_=temp;this.on(close,'close',this.close);}
312if(!closeable&&close){this.off(close,'close',this.close);this.removeChild(close);close.dispose();}}
313return this.closeable_;};_proto.fill=function fill(){this.fillWith(this.content());};_proto.fillWith=function fillWith(content){var contentEl=this.contentEl();var parentEl=contentEl.parentNode;var nextSiblingEl=contentEl.nextSibling;this.trigger('beforemodalfill');this.hasBeenFilled_=true;parentEl.removeChild(contentEl);this.empty();insertContent(contentEl,content);this.trigger('modalfill');if(nextSiblingEl){parentEl.insertBefore(contentEl,nextSiblingEl);}else{parentEl.appendChild(contentEl);}
314var closeButton=this.getChild('closeButton');if(closeButton){parentEl.appendChild(closeButton.el_);}};_proto.empty=function empty(){this.trigger('beforemodalempty');emptyEl(this.contentEl());this.trigger('modalempty');};_proto.content=function content(value){if(typeof value!=='undefined'){this.content_=value;}
315return this.content_;};_proto.conditionalFocus_=function conditionalFocus_(){var activeEl=document.activeElement;var playerEl=this.player_.el_;this.previouslyActiveEl_=null;if(playerEl.contains(activeEl)||playerEl===activeEl){this.previouslyActiveEl_=activeEl;this.focus();}};_proto.conditionalBlur_=function conditionalBlur_(){if(this.previouslyActiveEl_){this.previouslyActiveEl_.focus();this.previouslyActiveEl_=null;}};_proto.handleKeyDown=function handleKeyDown(event){event.stopPropagation();if(keycode.isEventKey(event,'Escape')&&this.closeable()){event.preventDefault();this.close();return;}
316if(!keycode.isEventKey(event,'Tab')){return;}
317var focusableEls=this.focusableEls_();var activeEl=this.el_.querySelector(':focus');var focusIndex;for(var i=0;i<focusableEls.length;i++){if(activeEl===focusableEls[i]){focusIndex=i;break;}}
318if(document.activeElement===this.el_){focusIndex=0;}
319if(event.shiftKey&&focusIndex===0){focusableEls[focusableEls.length-1].focus();event.preventDefault();}else if(!event.shiftKey&&focusIndex===focusableEls.length-1){focusableEls[0].focus();event.preventDefault();}};_proto.focusableEls_=function focusableEls_(){var allChildren=this.el_.querySelectorAll('*');return Array.prototype.filter.call(allChildren,function(child){return(child instanceof window$3.HTMLAnchorElement||child instanceof window$3.HTMLAreaElement)&&child.hasAttribute('href')||(child instanceof window$3.HTMLInputElement||child instanceof window$3.HTMLSelectElement||child instanceof window$3.HTMLTextAreaElement||child instanceof window$3.HTMLButtonElement)&&!child.hasAttribute('disabled')||child instanceof window$3.HTMLIFrameElement||child instanceof window$3.HTMLObjectElement||child instanceof window$3.HTMLEmbedElement||child.hasAttribute('tabindex')&&child.getAttribute('tabindex')!==-1||child.hasAttribute('contenteditable');});};return ModalDialog;}(Component);ModalDialog.prototype.options_={pauseOnOpen:true,temporary:true};Component.registerComponent('ModalDialog',ModalDialog);var TrackList=function(_EventTarget){inheritsLoose(TrackList,_EventTarget);function TrackList(tracks){var _this;if(tracks===void 0){tracks=[];}
320_this=_EventTarget.call(this)||this;_this.tracks_=[];Object.defineProperty(assertThisInitialized(_this),'length',{get:function get(){return this.tracks_.length;}});for(var i=0;i<tracks.length;i++){_this.addTrack(tracks[i]);}
321return _this;}
322var _proto=TrackList.prototype;_proto.addTrack=function addTrack(track){var index=this.tracks_.length;if(!(''+index in this)){Object.defineProperty(this,index,{get:function get(){return this.tracks_[index];}});}
323if(this.tracks_.indexOf(track)===-1){this.tracks_.push(track);this.trigger({track:track,type:'addtrack',target:this});}};_proto.removeTrack=function removeTrack(rtrack){var track;for(var i=0,l=this.length;i<l;i++){if(this[i]===rtrack){track=this[i];if(track.off){track.off();}
324this.tracks_.splice(i,1);break;}}
325if(!track){return;}
326this.trigger({track:track,type:'removetrack',target:this});};_proto.getTrackById=function getTrackById(id){var result=null;for(var i=0,l=this.length;i<l;i++){var track=this[i];if(track.id===id){result=track;break;}}
327return result;};return TrackList;}(EventTarget);TrackList.prototype.allowedEvents_={change:'change',addtrack:'addtrack',removetrack:'removetrack'};for(var event in TrackList.prototype.allowedEvents_){TrackList.prototype['on'+event]=null;}
328var disableOthers=function disableOthers(list,track){for(var i=0;i<list.length;i++){if(!Object.keys(list[i]).length||track.id===list[i].id){continue;}
329list[i].enabled=false;}};var AudioTrackList=function(_TrackList){inheritsLoose(AudioTrackList,_TrackList);function AudioTrackList(tracks){var _this;if(tracks===void 0){tracks=[];}
330for(var i=tracks.length-1;i>=0;i--){if(tracks[i].enabled){disableOthers(tracks,tracks[i]);break;}}
331_this=_TrackList.call(this,tracks)||this;_this.changing_=false;return _this;}
332var _proto=AudioTrackList.prototype;_proto.addTrack=function addTrack(track){var _this2=this;if(track.enabled){disableOthers(this,track);}
333_TrackList.prototype.addTrack.call(this,track);if(!track.addEventListener){return;}
334track.enabledChange_=function(){if(_this2.changing_){return;}
335_this2.changing_=true;disableOthers(_this2,track);_this2.changing_=false;_this2.trigger('change');};track.addEventListener('enabledchange',track.enabledChange_);};_proto.removeTrack=function removeTrack(rtrack){_TrackList.prototype.removeTrack.call(this,rtrack);if(rtrack.removeEventListener&&rtrack.enabledChange_){rtrack.removeEventListener('enabledchange',rtrack.enabledChange_);rtrack.enabledChange_=null;}};return AudioTrackList;}(TrackList);var disableOthers$1=function disableOthers(list,track){for(var i=0;i<list.length;i++){if(!Object.keys(list[i]).length||track.id===list[i].id){continue;}
336list[i].selected=false;}};var VideoTrackList=function(_TrackList){inheritsLoose(VideoTrackList,_TrackList);function VideoTrackList(tracks){var _this;if(tracks===void 0){tracks=[];}
337for(var i=tracks.length-1;i>=0;i--){if(tracks[i].selected){disableOthers$1(tracks,tracks[i]);break;}}
338_this=_TrackList.call(this,tracks)||this;_this.changing_=false;Object.defineProperty(assertThisInitialized(_this),'selectedIndex',{get:function get(){for(var _i=0;_i<this.length;_i++){if(this[_i].selected){return _i;}}
339return-1;},set:function set(){}});return _this;}
340var _proto=VideoTrackList.prototype;_proto.addTrack=function addTrack(track){var _this2=this;if(track.selected){disableOthers$1(this,track);}
341_TrackList.prototype.addTrack.call(this,track);if(!track.addEventListener){return;}
342track.selectedChange_=function(){if(_this2.changing_){return;}
343_this2.changing_=true;disableOthers$1(_this2,track);_this2.changing_=false;_this2.trigger('change');};track.addEventListener('selectedchange',track.selectedChange_);};_proto.removeTrack=function removeTrack(rtrack){_TrackList.prototype.removeTrack.call(this,rtrack);if(rtrack.removeEventListener&&rtrack.selectedChange_){rtrack.removeEventListener('selectedchange',rtrack.selectedChange_);rtrack.selectedChange_=null;}};return VideoTrackList;}(TrackList);var TextTrackList=function(_TrackList){inheritsLoose(TextTrackList,_TrackList);function TextTrackList(){return _TrackList.apply(this,arguments)||this;}
344var _proto=TextTrackList.prototype;_proto.addTrack=function addTrack(track){var _this=this;_TrackList.prototype.addTrack.call(this,track);if(!this.queueChange_){this.queueChange_=function(){return _this.queueTrigger('change');};}
345if(!this.triggerSelectedlanguagechange){this.triggerSelectedlanguagechange_=function(){return _this.trigger('selectedlanguagechange');};}
346track.addEventListener('modechange',this.queueChange_);var nonLanguageTextTrackKind=['metadata','chapters'];if(nonLanguageTextTrackKind.indexOf(track.kind)===-1){track.addEventListener('modechange',this.triggerSelectedlanguagechange_);}};_proto.removeTrack=function removeTrack(rtrack){_TrackList.prototype.removeTrack.call(this,rtrack);if(rtrack.removeEventListener){if(this.queueChange_){rtrack.removeEventListener('modechange',this.queueChange_);}
347if(this.selectedlanguagechange_){rtrack.removeEventListener('modechange',this.triggerSelectedlanguagechange_);}}};return TextTrackList;}(TrackList);var HtmlTrackElementList=function(){function HtmlTrackElementList(trackElements){if(trackElements===void 0){trackElements=[];}
348this.trackElements_=[];Object.defineProperty(this,'length',{get:function get(){return this.trackElements_.length;}});for(var i=0,length=trackElements.length;i<length;i++){this.addTrackElement_(trackElements[i]);}}
349var _proto=HtmlTrackElementList.prototype;_proto.addTrackElement_=function addTrackElement_(trackElement){var index=this.trackElements_.length;if(!(''+index in this)){Object.defineProperty(this,index,{get:function get(){return this.trackElements_[index];}});}
350if(this.trackElements_.indexOf(trackElement)===-1){this.trackElements_.push(trackElement);}};_proto.getTrackElementByTrack_=function getTrackElementByTrack_(track){var trackElement_;for(var i=0,length=this.trackElements_.length;i<length;i++){if(track===this.trackElements_[i].track){trackElement_=this.trackElements_[i];break;}}
351return trackElement_;};_proto.removeTrackElement_=function removeTrackElement_(trackElement){for(var i=0,length=this.trackElements_.length;i<length;i++){if(trackElement===this.trackElements_[i]){if(this.trackElements_[i].track&&typeof this.trackElements_[i].track.off==='function'){this.trackElements_[i].track.off();}
352if(typeof this.trackElements_[i].off==='function'){this.trackElements_[i].off();}
353this.trackElements_.splice(i,1);break;}}};return HtmlTrackElementList;}();var TextTrackCueList=function(){function TextTrackCueList(cues){TextTrackCueList.prototype.setCues_.call(this,cues);Object.defineProperty(this,'length',{get:function get(){return this.length_;}});}
354var _proto=TextTrackCueList.prototype;_proto.setCues_=function setCues_(cues){var oldLength=this.length||0;var i=0;var l=cues.length;this.cues_=cues;this.length_=cues.length;var defineProp=function defineProp(index){if(!(''+index in this)){Object.defineProperty(this,''+index,{get:function get(){return this.cues_[index];}});}};if(oldLength<l){i=oldLength;for(;i<l;i++){defineProp.call(this,i);}}};_proto.getCueById=function getCueById(id){var result=null;for(var i=0,l=this.length;i<l;i++){var cue=this[i];if(cue.id===id){result=cue;break;}}
355return result;};return TextTrackCueList;}();var VideoTrackKind={alternative:'alternative',captions:'captions',main:'main',sign:'sign',subtitles:'subtitles',commentary:'commentary'};var AudioTrackKind={'alternative':'alternative','descriptions':'descriptions','main':'main','main-desc':'main-desc','translation':'translation','commentary':'commentary'};var TextTrackKind={subtitles:'subtitles',captions:'captions',descriptions:'descriptions',chapters:'chapters',metadata:'metadata'};var TextTrackMode={disabled:'disabled',hidden:'hidden',showing:'showing'};var Track=function(_EventTarget){inheritsLoose(Track,_EventTarget);function Track(options){var _this;if(options===void 0){options={};}
356_this=_EventTarget.call(this)||this;var trackProps={id:options.id||'vjs_track_'+newGUID(),kind:options.kind||'',label:options.label||'',language:options.language||''};var _loop=function _loop(key){Object.defineProperty(assertThisInitialized(_this),key,{get:function get(){return trackProps[key];},set:function set(){}});};for(var key in trackProps){_loop(key);}
357return _this;}
358return Track;}(EventTarget);var parseUrl=function parseUrl(url){var props=['protocol','hostname','port','pathname','search','hash','host'];var a=document.createElement('a');a.href=url;var addToBody=a.host===''&&a.protocol!=='file:';var div;if(addToBody){div=document.createElement('div');div.innerHTML="<a href=\""+url+"\"></a>";a=div.firstChild;div.setAttribute('style','display:none; position:absolute;');document.body.appendChild(div);}
359var details={};for(var i=0;i<props.length;i++){details[props[i]]=a[props[i]];}
360if(details.protocol==='http:'){details.host=details.host.replace(/:80$/,'');}
361if(details.protocol==='https:'){details.host=details.host.replace(/:443$/,'');}
362if(!details.protocol){details.protocol=window$3.location.protocol;}
363if(addToBody){document.body.removeChild(div);}
364return details;};var getAbsoluteURL=function getAbsoluteURL(url){if(!url.match(/^https?:\/\//)){var div=document.createElement('div');div.innerHTML="<a href=\""+url+"\">x</a>";url=div.firstChild.href;}
365return url;};var getFileExtension=function getFileExtension(path){if(typeof path==='string'){var splitPathRe=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/;var pathParts=splitPathRe.exec(path);if(pathParts){return pathParts.pop().toLowerCase();}}
366return '';};var isCrossOrigin=function isCrossOrigin(url,winLoc){if(winLoc===void 0){winLoc=window$3.location;}
367var urlInfo=parseUrl(url);var srcProtocol=urlInfo.protocol===':'?winLoc.protocol:urlInfo.protocol;var crossOrigin=srcProtocol+urlInfo.host!==winLoc.protocol+winLoc.host;return crossOrigin;};var Url=Object.freeze({__proto__:null,parseUrl:parseUrl,getAbsoluteURL:getAbsoluteURL,getFileExtension:getFileExtension,isCrossOrigin:isCrossOrigin});var isFunction_1=isFunction;var toString$1=Object.prototype.toString;function isFunction(fn){var string=toString$1.call(fn);return string==='[object Function]'||typeof fn==='function'&&string!=='[object RegExp]'||typeof window!=='undefined'&&(fn===window.setTimeout||fn===window.alert||fn===window.confirm||fn===window.prompt);}
368var parseHeaders=function parseHeaders(headers){var result={};if(!headers){return result;}
369headers.trim().split('\n').forEach(function(row){var index=row.indexOf(':');var key=row.slice(0,index).trim().toLowerCase();var value=row.slice(index+1).trim();if(typeof result[key]==='undefined'){result[key]=value;}else if(Array.isArray(result[key])){result[key].push(value);}else{result[key]=[result[key],value];}});return result;};var xhr=createXHR;var default_1=createXHR;createXHR.XMLHttpRequest=window$3.XMLHttpRequest||noop;createXHR.XDomainRequest="withCredentials"in new createXHR.XMLHttpRequest()?createXHR.XMLHttpRequest:window$3.XDomainRequest;forEachArray(["get","put","post","patch","head","delete"],function(method){createXHR[method==="delete"?"del":method]=function(uri,options,callback){options=initParams(uri,options,callback);options.method=method.toUpperCase();return _createXHR(options);};});function forEachArray(array,iterator){for(var i=0;i<array.length;i++){iterator(array[i]);}}
370function isEmpty(obj){for(var i in obj){if(obj.hasOwnProperty(i))return false;}
371return true;}
372function initParams(uri,options,callback){var params=uri;if(isFunction_1(options)){callback=options;if(typeof uri==="string"){params={uri:uri};}}else{params=_extends_1({},options,{uri:uri});}
373params.callback=callback;return params;}
374function createXHR(uri,options,callback){options=initParams(uri,options,callback);return _createXHR(options);}
375function _createXHR(options){if(typeof options.callback==="undefined"){throw new Error("callback argument missing");}
376var called=false;var callback=function cbOnce(err,response,body){if(!called){called=true;options.callback(err,response,body);}};function readystatechange(){if(xhr.readyState===4){setTimeout(loadFunc,0);}}
377function getBody(){var body=undefined;if(xhr.response){body=xhr.response;}else{body=xhr.responseText||getXml(xhr);}
378if(isJson){try{body=JSON.parse(body);}catch(e){}}
379return body;}
380function errorFunc(evt){clearTimeout(timeoutTimer);if(!(evt instanceof Error)){evt=new Error(""+(evt||"Unknown XMLHttpRequest Error"));}
381evt.statusCode=0;return callback(evt,failureResponse);}
382function loadFunc(){if(aborted)return;var status;clearTimeout(timeoutTimer);if(options.useXDR&&xhr.status===undefined){status=200;}else{status=xhr.status===1223?204:xhr.status;}
383var response=failureResponse;var err=null;if(status!==0){response={body:getBody(),statusCode:status,method:method,headers:{},url:uri,rawRequest:xhr};if(xhr.getAllResponseHeaders){response.headers=parseHeaders(xhr.getAllResponseHeaders());}}else{err=new Error("Internal XMLHttpRequest Error");}
384return callback(err,response,response.body);}
385var xhr=options.xhr||null;if(!xhr){if(options.cors||options.useXDR){xhr=new createXHR.XDomainRequest();}else{xhr=new createXHR.XMLHttpRequest();}}
386var key;var aborted;var uri=xhr.url=options.uri||options.url;var method=xhr.method=options.method||"GET";var body=options.body||options.data;var headers=xhr.headers=options.headers||{};var sync=!!options.sync;var isJson=false;var timeoutTimer;var failureResponse={body:undefined,headers:{},statusCode:0,method:method,url:uri,rawRequest:xhr};if("json"in options&&options.json!==false){isJson=true;headers["accept"]||headers["Accept"]||(headers["Accept"]="application/json");if(method!=="GET"&&method!=="HEAD"){headers["content-type"]||headers["Content-Type"]||(headers["Content-Type"]="application/json");body=JSON.stringify(options.json===true?body:options.json);}}
387xhr.onreadystatechange=readystatechange;xhr.onload=loadFunc;xhr.onerror=errorFunc;xhr.onprogress=function(){};xhr.onabort=function(){aborted=true;};xhr.ontimeout=errorFunc;xhr.open(method,uri,!sync,options.username,options.password);if(!sync){xhr.withCredentials=!!options.withCredentials;}
388if(!sync&&options.timeout>0){timeoutTimer=setTimeout(function(){if(aborted)return;aborted=true;xhr.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT";errorFunc(e);},options.timeout);}
389if(xhr.setRequestHeader){for(key in headers){if(headers.hasOwnProperty(key)){xhr.setRequestHeader(key,headers[key]);}}}else if(options.headers&&!isEmpty(options.headers)){throw new Error("Headers cannot be set on an XDomainRequest object");}
390if("responseType"in options){xhr.responseType=options.responseType;}
391if("beforeSend"in options&&typeof options.beforeSend==="function"){options.beforeSend(xhr);}
392xhr.send(body||null);return xhr;}
393function getXml(xhr){try{if(xhr.responseType==="document"){return xhr.responseXML;}
394var firefoxBugTakenEffect=xhr.responseXML&&xhr.responseXML.documentElement.nodeName==="parsererror";if(xhr.responseType===""&&!firefoxBugTakenEffect){return xhr.responseXML;}}catch(e){}
395return null;}
396function noop(){}
397xhr["default"]=default_1;var parseCues=function parseCues(srcContent,track){var parser=new window$3.WebVTT.Parser(window$3,window$3.vttjs,window$3.WebVTT.StringDecoder());var errors=[];parser.oncue=function(cue){track.addCue(cue);};parser.onparsingerror=function(error){errors.push(error);};parser.onflush=function(){track.trigger({type:'loadeddata',target:track});};parser.parse(srcContent);if(errors.length>0){if(window$3.console&&window$3.console.groupCollapsed){window$3.console.groupCollapsed("Text Track parsing errors for "+track.src);}
398errors.forEach(function(error){return log.error(error);});if(window$3.console&&window$3.console.groupEnd){window$3.console.groupEnd();}}
399parser.flush();};var loadTrack=function loadTrack(src,track){var opts={uri:src};var crossOrigin=isCrossOrigin(src);if(crossOrigin){opts.cors=crossOrigin;}
400xhr(opts,bind(this,function(err,response,responseBody){if(err){return log.error(err,response);}
401track.loaded_=true;if(typeof window$3.WebVTT!=='function'){if(track.tech_){track.tech_.any(['vttjsloaded','vttjserror'],function(event){if(event.type==='vttjserror'){log.error("vttjs failed to load, stopping trying to process "+track.src);return;}
402return parseCues(responseBody,track);});}}else{parseCues(responseBody,track);}}));};var TextTrack=function(_Track){inheritsLoose(TextTrack,_Track);function TextTrack(options){var _this;if(options===void 0){options={};}
403if(!options.tech){throw new Error('A tech was not provided.');}
404var settings=mergeOptions(options,{kind:TextTrackKind[options.kind]||'subtitles',language:options.language||options.srclang||''});var mode=TextTrackMode[settings.mode]||'disabled';var default_=settings["default"];if(settings.kind==='metadata'||settings.kind==='chapters'){mode='hidden';}
405_this=_Track.call(this,settings)||this;_this.tech_=settings.tech;_this.cues_=[];_this.activeCues_=[];_this.preload_=_this.tech_.preloadTextTracks!==false;var cues=new TextTrackCueList(_this.cues_);var activeCues=new TextTrackCueList(_this.activeCues_);var changed=false;var timeupdateHandler=bind(assertThisInitialized(_this),function(){this.activeCues=this.activeCues;if(changed){this.trigger('cuechange');changed=false;}});if(mode!=='disabled'){_this.tech_.ready(function(){_this.tech_.on('timeupdate',timeupdateHandler);},true);}
406Object.defineProperties(assertThisInitialized(_this),{"default":{get:function get(){return default_;},set:function set(){}},mode:{get:function get(){return mode;},set:function set(newMode){var _this2=this;if(!TextTrackMode[newMode]){return;}
407mode=newMode;if(!this.preload_&&mode!=='disabled'&&this.cues.length===0){loadTrack(this.src,this);}
408if(mode!=='disabled'){this.tech_.ready(function(){_this2.tech_.on('timeupdate',timeupdateHandler);},true);}else{this.tech_.off('timeupdate',timeupdateHandler);}
409this.trigger('modechange');}},cues:{get:function get(){if(!this.loaded_){return null;}
410return cues;},set:function set(){}},activeCues:{get:function get(){if(!this.loaded_){return null;}
411if(this.cues.length===0){return activeCues;}
412var ct=this.tech_.currentTime();var active=[];for(var i=0,l=this.cues.length;i<l;i++){var cue=this.cues[i];if(cue.startTime<=ct&&cue.endTime>=ct){active.push(cue);}else if(cue.startTime===cue.endTime&&cue.startTime<=ct&&cue.startTime+0.5>=ct){active.push(cue);}}
413changed=false;if(active.length!==this.activeCues_.length){changed=true;}else{for(var _i=0;_i<active.length;_i++){if(this.activeCues_.indexOf(active[_i])===-1){changed=true;}}}
414this.activeCues_=active;activeCues.setCues_(this.activeCues_);return activeCues;},set:function set(){}}});if(settings.src){_this.src=settings.src;if(!_this.preload_){_this.loaded_=true;}
415if(_this.preload_||default_||settings.kind!=='subtitles'&&settings.kind!=='captions'){loadTrack(_this.src,assertThisInitialized(_this));}}else{_this.loaded_=true;}
416return _this;}
417var _proto=TextTrack.prototype;_proto.addCue=function addCue(originalCue){var cue=originalCue;if(window$3.vttjs&&!(originalCue instanceof window$3.vttjs.VTTCue)){cue=new window$3.vttjs.VTTCue(originalCue.startTime,originalCue.endTime,originalCue.text);for(var prop in originalCue){if(!(prop in cue)){cue[prop]=originalCue[prop];}}
418cue.id=originalCue.id;cue.originalCue_=originalCue;}
419var tracks=this.tech_.textTracks();for(var i=0;i<tracks.length;i++){if(tracks[i]!==this){tracks[i].removeCue(cue);}}
420this.cues_.push(cue);this.cues.setCues_(this.cues_);};_proto.removeCue=function removeCue(_removeCue){var i=this.cues_.length;while(i--){var cue=this.cues_[i];if(cue===_removeCue||cue.originalCue_&&cue.originalCue_===_removeCue){this.cues_.splice(i,1);this.cues.setCues_(this.cues_);break;}}};return TextTrack;}(Track);TextTrack.prototype.allowedEvents_={cuechange:'cuechange'};var AudioTrack=function(_Track){inheritsLoose(AudioTrack,_Track);function AudioTrack(options){var _this;if(options===void 0){options={};}
421var settings=mergeOptions(options,{kind:AudioTrackKind[options.kind]||''});_this=_Track.call(this,settings)||this;var enabled=false;Object.defineProperty(assertThisInitialized(_this),'enabled',{get:function get(){return enabled;},set:function set(newEnabled){if(typeof newEnabled!=='boolean'||newEnabled===enabled){return;}
422enabled=newEnabled;this.trigger('enabledchange');}});if(settings.enabled){_this.enabled=settings.enabled;}
423_this.loaded_=true;return _this;}
424return AudioTrack;}(Track);var VideoTrack=function(_Track){inheritsLoose(VideoTrack,_Track);function VideoTrack(options){var _this;if(options===void 0){options={};}
425var settings=mergeOptions(options,{kind:VideoTrackKind[options.kind]||''});_this=_Track.call(this,settings)||this;var selected=false;Object.defineProperty(assertThisInitialized(_this),'selected',{get:function get(){return selected;},set:function set(newSelected){if(typeof newSelected!=='boolean'||newSelected===selected){return;}
426selected=newSelected;this.trigger('selectedchange');}});if(settings.selected){_this.selected=settings.selected;}
427return _this;}
428return VideoTrack;}(Track);var NONE=0;var LOADING=1;var LOADED=2;var ERROR=3;var HTMLTrackElement=function(_EventTarget){inheritsLoose(HTMLTrackElement,_EventTarget);function HTMLTrackElement(options){var _this;if(options===void 0){options={};}
429_this=_EventTarget.call(this)||this;var readyState;var track=new TextTrack(options);_this.kind=track.kind;_this.src=track.src;_this.srclang=track.language;_this.label=track.label;_this["default"]=track["default"];Object.defineProperties(assertThisInitialized(_this),{readyState:{get:function get(){return readyState;}},track:{get:function get(){return track;}}});readyState=NONE;track.addEventListener('loadeddata',function(){readyState=LOADED;_this.trigger({type:'load',target:assertThisInitialized(_this)});});return _this;}
430return HTMLTrackElement;}(EventTarget);HTMLTrackElement.prototype.allowedEvents_={load:'load'};HTMLTrackElement.NONE=NONE;HTMLTrackElement.LOADING=LOADING;HTMLTrackElement.LOADED=LOADED;HTMLTrackElement.ERROR=ERROR;var NORMAL={audio:{ListClass:AudioTrackList,TrackClass:AudioTrack,capitalName:'Audio'},video:{ListClass:VideoTrackList,TrackClass:VideoTrack,capitalName:'Video'},text:{ListClass:TextTrackList,TrackClass:TextTrack,capitalName:'Text'}};Object.keys(NORMAL).forEach(function(type){NORMAL[type].getterName=type+"Tracks";NORMAL[type].privateName=type+"Tracks_";});var REMOTE={remoteText:{ListClass:TextTrackList,TrackClass:TextTrack,capitalName:'RemoteText',getterName:'remoteTextTracks',privateName:'remoteTextTracks_'},remoteTextEl:{ListClass:HtmlTrackElementList,TrackClass:HTMLTrackElement,capitalName:'RemoteTextTrackEls',getterName:'remoteTextTrackEls',privateName:'remoteTextTrackEls_'}};var ALL=_extends_1({},NORMAL,REMOTE);REMOTE.names=Object.keys(REMOTE);NORMAL.names=Object.keys(NORMAL);ALL.names=[].concat(REMOTE.names).concat(NORMAL.names);var _objCreate=Object.create||function(){function F(){}
431return function(o){if(arguments.length!==1){throw new Error('Object.create shim only accepts one parameter.');}
432F.prototype=o;return new F();};}();function ParsingError(errorData,message){this.name="ParsingError";this.code=errorData.code;this.message=message||errorData.message;}
433ParsingError.prototype=_objCreate(Error.prototype);ParsingError.prototype.constructor=ParsingError;ParsingError.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function parseTimeStamp(input){function computeSeconds(h,m,s,f){return(h|0)*3600+(m|0)*60+(s|0)+(f|0)/1000;}
434var m=input.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);if(!m){return null;}
435if(m[3]){return computeSeconds(m[1],m[2],m[3].replace(":",""),m[4]);}else if(m[1]>59){return computeSeconds(m[1],m[2],0,m[4]);}else{return computeSeconds(0,m[1],m[2],m[4]);}}
436function Settings(){this.values=_objCreate(null);}
437Settings.prototype={set:function set(k,v){if(!this.get(k)&&v!==""){this.values[k]=v;}},get:function get(k,dflt,defaultKey){if(defaultKey){return this.has(k)?this.values[k]:dflt[defaultKey];}
438return this.has(k)?this.values[k]:dflt;},has:function has(k){return k in this.values;},alt:function alt(k,v,a){for(var n=0;n<a.length;++n){if(v===a[n]){this.set(k,v);break;}}},integer:function integer(k,v){if(/^-?\d+$/.test(v)){this.set(k,parseInt(v,10));}},percent:function percent(k,v){var m;if(m=v.match(/^([\d]{1,3})(\.[\d]*)?%$/)){v=parseFloat(v);if(v>=0&&v<=100){this.set(k,v);return true;}}
439return false;}};function parseOptions(input,callback,keyValueDelim,groupDelim){var groups=groupDelim?input.split(groupDelim):[input];for(var i in groups){if(typeof groups[i]!=="string"){continue;}
440var kv=groups[i].split(keyValueDelim);if(kv.length!==2){continue;}
441var k=kv[0];var v=kv[1];callback(k,v);}}
442function parseCue(input,cue,regionList){var oInput=input;function consumeTimeStamp(){var ts=parseTimeStamp(input);if(ts===null){throw new ParsingError(ParsingError.Errors.BadTimeStamp,"Malformed timestamp: "+oInput);}
443input=input.replace(/^[^\sa-zA-Z-]+/,"");return ts;}
444function consumeCueSettings(input,cue){var settings=new Settings();parseOptions(input,function(k,v){switch(k){case "region":for(var i=regionList.length-1;i>=0;i--){if(regionList[i].id===v){settings.set(k,regionList[i].region);break;}}
445break;case "vertical":settings.alt(k,v,["rl","lr"]);break;case "line":var vals=v.split(","),vals0=vals[0];settings.integer(k,vals0);settings.percent(k,vals0)?settings.set("snapToLines",false):null;settings.alt(k,vals0,["auto"]);if(vals.length===2){settings.alt("lineAlign",vals[1],["start","center","end"]);}
446break;case "position":vals=v.split(",");settings.percent(k,vals[0]);if(vals.length===2){settings.alt("positionAlign",vals[1],["start","center","end"]);}
447break;case "size":settings.percent(k,v);break;case "align":settings.alt(k,v,["start","center","end","left","right"]);break;}},/:/,/\s/);cue.region=settings.get("region",null);cue.vertical=settings.get("vertical","");try{cue.line=settings.get("line","auto");}catch(e){}
448cue.lineAlign=settings.get("lineAlign","start");cue.snapToLines=settings.get("snapToLines",true);cue.size=settings.get("size",100);try{cue.align=settings.get("align","center");}catch(e){cue.align=settings.get("align","middle");}
449try{cue.position=settings.get("position","auto");}catch(e){cue.position=settings.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},cue.align);}
450cue.positionAlign=settings.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},cue.align);}
451function skipWhitespace(){input=input.replace(/^\s+/,"");}
452skipWhitespace();cue.startTime=consumeTimeStamp();skipWhitespace();if(input.substr(0,3)!=="-->"){throw new ParsingError(ParsingError.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+oInput);}
453input=input.substr(3);skipWhitespace();cue.endTime=consumeTimeStamp();skipWhitespace();consumeCueSettings(input,cue);}
454var TEXTAREA_ELEMENT=document.createElement("textarea");var TAG_NAME={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"};var DEFAULT_COLOR_CLASS={white:'rgba(255,255,255,1)',lime:'rgba(0,255,0,1)',cyan:'rgba(0,255,255,1)',red:'rgba(255,0,0,1)',yellow:'rgba(255,255,0,1)',magenta:'rgba(255,0,255,1)',blue:'rgba(0,0,255,1)',black:'rgba(0,0,0,1)'};var TAG_ANNOTATION={v:"title",lang:"lang"};var NEEDS_PARENT={rt:"ruby"};function parseContent(window,input){function nextToken(){if(!input){return null;}
vendor: 12,974 bytes, lines 455-516
455function consume(result){input=input.substr(result.length);return result;}
456var m=input.match(/^([^<]*)(<[^>]*>?)?/);return consume(m[1]?m[1]:m[2]);}
457function unescape(s){TEXTAREA_ELEMENT.innerHTML=s;s=TEXTAREA_ELEMENT.textContent;TEXTAREA_ELEMENT.textContent="";return s;}
458function shouldAdd(current,element){return!NEEDS_PARENT[element.localName]||NEEDS_PARENT[element.localName]===current.localName;}
459function createElement(type,annotation){var tagName=TAG_NAME[type];if(!tagName){return null;}
460var element=window.document.createElement(tagName);var name=TAG_ANNOTATION[type];if(name&&annotation){element[name]=annotation.trim();}
461return element;}
462var rootDiv=window.document.createElement("div"),current=rootDiv,t,tagStack=[];while((t=nextToken())!==null){if(t[0]==='<'){if(t[1]==="/"){if(tagStack.length&&tagStack[tagStack.length-1]===t.substr(2).replace(">","")){tagStack.pop();current=current.parentNode;}
463continue;}
464var ts=parseTimeStamp(t.substr(1,t.length-2));var node;if(ts){node=window.document.createProcessingInstruction("timestamp",ts);current.appendChild(node);continue;}
465var m=t.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!m){continue;}
466node=createElement(m[1],m[3]);if(!node){continue;}
467if(!shouldAdd(current,node)){continue;}
468if(m[2]){var classes=m[2].split('.');classes.forEach(function(cl){var bgColor=/^bg_/.test(cl);var colorName=bgColor?cl.slice(3):cl;if(DEFAULT_COLOR_CLASS.hasOwnProperty(colorName)){var propName=bgColor?'background-color':'color';var propValue=DEFAULT_COLOR_CLASS[colorName];node.style[propName]=propValue;}});node.className=classes.join(' ');}
469tagStack.push(m[1]);current.appendChild(node);current=node;continue;}
470current.appendChild(window.document.createTextNode(unescape(t)));}
471return rootDiv;}
472var strongRTLRanges=[[0x5be,0x5be],[0x5c0,0x5c0],[0x5c3,0x5c3],[0x5c6,0x5c6],[0x5d0,0x5ea],[0x5f0,0x5f4],[0x608,0x608],[0x60b,0x60b],[0x60d,0x60d],[0x61b,0x61b],[0x61e,0x64a],[0x66d,0x66f],[0x671,0x6d5],[0x6e5,0x6e6],[0x6ee,0x6ef],[0x6fa,0x70d],[0x70f,0x710],[0x712,0x72f],[0x74d,0x7a5],[0x7b1,0x7b1],[0x7c0,0x7ea],[0x7f4,0x7f5],[0x7fa,0x7fa],[0x800,0x815],[0x81a,0x81a],[0x824,0x824],[0x828,0x828],[0x830,0x83e],[0x840,0x858],[0x85e,0x85e],[0x8a0,0x8a0],[0x8a2,0x8ac],[0x200f,0x200f],[0xfb1d,0xfb1d],[0xfb1f,0xfb28],[0xfb2a,0xfb36],[0xfb38,0xfb3c],[0xfb3e,0xfb3e],[0xfb40,0xfb41],[0xfb43,0xfb44],[0xfb46,0xfbc1],[0xfbd3,0xfd3d],[0xfd50,0xfd8f],[0xfd92,0xfdc7],[0xfdf0,0xfdfc],[0xfe70,0xfe74],[0xfe76,0xfefc],[0x10800,0x10805],[0x10808,0x10808],[0x1080a,0x10835],[0x10837,0x10838],[0x1083c,0x1083c],[0x1083f,0x10855],[0x10857,0x1085f],[0x10900,0x1091b],[0x10920,0x10939],[0x1093f,0x1093f],[0x10980,0x109b7],[0x109be,0x109bf],[0x10a00,0x10a00],[0x10a10,0x10a13],[0x10a15,0x10a17],[0x10a19,0x10a33],[0x10a40,0x10a47],[0x10a50,0x10a58],[0x10a60,0x10a7f],[0x10b00,0x10b35],[0x10b40,0x10b55],[0x10b58,0x10b72],[0x10b78,0x10b7f],[0x10c00,0x10c48],[0x1ee00,0x1ee03],[0x1ee05,0x1ee1f],[0x1ee21,0x1ee22],[0x1ee24,0x1ee24],[0x1ee27,0x1ee27],[0x1ee29,0x1ee32],[0x1ee34,0x1ee37],[0x1ee39,0x1ee39],[0x1ee3b,0x1ee3b],[0x1ee42,0x1ee42],[0x1ee47,0x1ee47],[0x1ee49,0x1ee49],[0x1ee4b,0x1ee4b],[0x1ee4d,0x1ee4f],[0x1ee51,0x1ee52],[0x1ee54,0x1ee54],[0x1ee57,0x1ee57],[0x1ee59,0x1ee59],[0x1ee5b,0x1ee5b],[0x1ee5d,0x1ee5d],[0x1ee5f,0x1ee5f],[0x1ee61,0x1ee62],[0x1ee64,0x1ee64],[0x1ee67,0x1ee6a],[0x1ee6c,0x1ee72],[0x1ee74,0x1ee77],[0x1ee79,0x1ee7c],[0x1ee7e,0x1ee7e],[0x1ee80,0x1ee89],[0x1ee8b,0x1ee9b],[0x1eea1,0x1eea3],[0x1eea5,0x1eea9],[0x1eeab,0x1eebb],[0x10fffd,0x10fffd]];function isStrongRTLChar(charCode){for(var i=0;i<strongRTLRanges.length;i++){var currentRange=strongRTLRanges[i];if(charCode>=currentRange[0]&&charCode<=currentRange[1]){return true;}}
473return false;}
474function determineBidi(cueDiv){var nodeStack=[],text="",charCode;if(!cueDiv||!cueDiv.childNodes){return "ltr";}
475function pushNodes(nodeStack,node){for(var i=node.childNodes.length-1;i>=0;i--){nodeStack.push(node.childNodes[i]);}}
476function nextTextNode(nodeStack){if(!nodeStack||!nodeStack.length){return null;}
477var node=nodeStack.pop(),text=node.textContent||node.innerText;if(text){var m=text.match(/^.*(\n|\r)/);if(m){nodeStack.length=0;return m[0];}
478return text;}
479if(node.tagName==="ruby"){return nextTextNode(nodeStack);}
480if(node.childNodes){pushNodes(nodeStack,node);return nextTextNode(nodeStack);}}
481pushNodes(nodeStack,cueDiv);while(text=nextTextNode(nodeStack)){for(var i=0;i<text.length;i++){charCode=text.charCodeAt(i);if(isStrongRTLChar(charCode)){return "rtl";}}}
482return "ltr";}
483function computeLinePos(cue){if(typeof cue.line==="number"&&(cue.snapToLines||cue.line>=0&&cue.line<=100)){return cue.line;}
484if(!cue.track||!cue.track.textTrackList||!cue.track.textTrackList.mediaElement){return-1;}
485var track=cue.track,trackList=track.textTrackList,count=0;for(var i=0;i<trackList.length&&trackList[i]!==track;i++){if(trackList[i].mode==="showing"){count++;}}
486return++count*-1;}
487function StyleBox(){}
488StyleBox.prototype.applyStyles=function(styles,div){div=div||this.div;for(var prop in styles){if(styles.hasOwnProperty(prop)){div.style[prop]=styles[prop];}}};StyleBox.prototype.formatStyle=function(val,unit){return val===0?0:val+unit;};function CueStyleBox(window,cue,styleOptions){StyleBox.call(this);this.cue=cue;this.cueDiv=parseContent(window,cue.text);var styles={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:cue.vertical===""?"horizontal-tb":cue.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(styles,this.cueDiv);this.div=window.document.createElement("div");styles={direction:determineBidi(this.cueDiv),writingMode:cue.vertical===""?"horizontal-tb":cue.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:cue.align==="middle"?"center":cue.align,font:styleOptions.font,whiteSpace:"pre-line",position:"absolute"};this.applyStyles(styles);this.div.appendChild(this.cueDiv);var textPos=0;switch(cue.positionAlign){case "start":textPos=cue.position;break;case "center":textPos=cue.position-cue.size/2;break;case "end":textPos=cue.position-cue.size;break;}
489if(cue.vertical===""){this.applyStyles({left:this.formatStyle(textPos,"%"),width:this.formatStyle(cue.size,"%")});}else{this.applyStyles({top:this.formatStyle(textPos,"%"),height:this.formatStyle(cue.size,"%")});}
490this.move=function(box){this.applyStyles({top:this.formatStyle(box.top,"px"),bottom:this.formatStyle(box.bottom,"px"),left:this.formatStyle(box.left,"px"),right:this.formatStyle(box.right,"px"),height:this.formatStyle(box.height,"px"),width:this.formatStyle(box.width,"px")});};}
491CueStyleBox.prototype=_objCreate(StyleBox.prototype);CueStyleBox.prototype.constructor=CueStyleBox;function BoxPosition(obj){var lh,height,width,top;if(obj.div){height=obj.div.offsetHeight;width=obj.div.offsetWidth;top=obj.div.offsetTop;var rects=(rects=obj.div.childNodes)&&(rects=rects[0])&&rects.getClientRects&&rects.getClientRects();obj=obj.div.getBoundingClientRect();lh=rects?Math.max(rects[0]&&rects[0].height||0,obj.height/rects.length):0;}
492this.left=obj.left;this.right=obj.right;this.top=obj.top||top;this.height=obj.height||height;this.bottom=obj.bottom||top+(obj.height||height);this.width=obj.width||width;this.lineHeight=lh!==undefined?lh:obj.lineHeight;}
493BoxPosition.prototype.move=function(axis,toMove){toMove=toMove!==undefined?toMove:this.lineHeight;switch(axis){case "+x":this.left+=toMove;this.right+=toMove;break;case "-x":this.left-=toMove;this.right-=toMove;break;case "+y":this.top+=toMove;this.bottom+=toMove;break;case "-y":this.top-=toMove;this.bottom-=toMove;break;}};BoxPosition.prototype.overlaps=function(b2){return this.left<b2.right&&this.right>b2.left&&this.top<b2.bottom&&this.bottom>b2.top;};BoxPosition.prototype.overlapsAny=function(boxes){for(var i=0;i<boxes.length;i++){if(this.overlaps(boxes[i])){return true;}}
494return false;};BoxPosition.prototype.within=function(container){return this.top>=container.top&&this.bottom<=container.bottom&&this.left>=container.left&&this.right<=container.right;};BoxPosition.prototype.overlapsOppositeAxis=function(container,axis){switch(axis){case "+x":return this.left<container.left;case "-x":return this.right>container.right;case "+y":return this.top<container.top;case "-y":return this.bottom>container.bottom;}};BoxPosition.prototype.intersectPercentage=function(b2){var x=Math.max(0,Math.min(this.right,b2.right)-Math.max(this.left,b2.left)),y=Math.max(0,Math.min(this.bottom,b2.bottom)-Math.max(this.top,b2.top)),intersectArea=x*y;return intersectArea/(this.height*this.width);};BoxPosition.prototype.toCSSCompatValues=function(reference){return{top:this.top-reference.top,bottom:reference.bottom-this.bottom,left:this.left-reference.left,right:reference.right-this.right,height:this.height,width:this.width};};BoxPosition.getSimpleBoxPosition=function(obj){var height=obj.div?obj.div.offsetHeight:obj.tagName?obj.offsetHeight:0;var width=obj.div?obj.div.offsetWidth:obj.tagName?obj.offsetWidth:0;var top=obj.div?obj.div.offsetTop:obj.tagName?obj.offsetTop:0;obj=obj.div?obj.div.getBoundingClientRect():obj.tagName?obj.getBoundingClientRect():obj;var ret={left:obj.left,right:obj.right,top:obj.top||top,height:obj.height||height,bottom:obj.bottom||top+(obj.height||height),width:obj.width||width};return ret;};function moveBoxToLinePosition(window,styleBox,containerBox,boxPositions){function findBestPosition(b,axis){var bestPosition,specifiedPosition=new BoxPosition(b),percentage=1;for(var i=0;i<axis.length;i++){while(b.overlapsOppositeAxis(containerBox,axis[i])||b.within(containerBox)&&b.overlapsAny(boxPositions)){b.move(axis[i]);}
495if(b.within(containerBox)){return b;}
496var p=b.intersectPercentage(containerBox);if(percentage>p){bestPosition=new BoxPosition(b);percentage=p;}
497b=new BoxPosition(specifiedPosition);}
498return bestPosition||specifiedPosition;}
499var boxPosition=new BoxPosition(styleBox),cue=styleBox.cue,linePos=computeLinePos(cue),axis=[];if(cue.snapToLines){var size;switch(cue.vertical){case "":axis=["+y","-y"];size="height";break;case "rl":axis=["+x","-x"];size="width";break;case "lr":axis=["-x","+x"];size="width";break;}
500var step=boxPosition.lineHeight,position=step*Math.round(linePos),maxPosition=containerBox[size]+step,initialAxis=axis[0];if(Math.abs(position)>maxPosition){position=position<0?-1:1;position*=Math.ceil(maxPosition/step)*step;}
501if(linePos<0){position+=cue.vertical===""?containerBox.height:containerBox.width;axis=axis.reverse();}
502boxPosition.move(initialAxis,position);}else{var calculatedPercentage=boxPosition.lineHeight/containerBox.height*100;switch(cue.lineAlign){case "center":linePos-=calculatedPercentage/2;break;case "end":linePos-=calculatedPercentage;break;}
503switch(cue.vertical){case "":styleBox.applyStyles({top:styleBox.formatStyle(linePos,"%")});break;case "rl":styleBox.applyStyles({left:styleBox.formatStyle(linePos,"%")});break;case "lr":styleBox.applyStyles({right:styleBox.formatStyle(linePos,"%")});break;}
504axis=["+y","-x","+x","-y"];boxPosition=new BoxPosition(styleBox);}
505var bestPosition=findBestPosition(boxPosition,axis);styleBox.move(bestPosition.toCSSCompatValues(containerBox));}
506function WebVTT$1(){}
507WebVTT$1.StringDecoder=function(){return{decode:function decode(data){if(!data){return "";}
508if(typeof data!=="string"){throw new Error("Error - expected string data.");}
509return decodeURIComponent(encodeURIComponent(data));}};};WebVTT$1.convertCueToDOMTree=function(window,cuetext){if(!window||!cuetext){return null;}
510return parseContent(window,cuetext);};var FONT_SIZE_PERCENT=0.05;var FONT_STYLE="sans-serif";var CUE_BACKGROUND_PADDING="1.5%";WebVTT$1.processCues=function(window,cues,overlay){if(!window||!cues||!overlay){return null;}
511while(overlay.firstChild){overlay.removeChild(overlay.firstChild);}
512var paddedOverlay=window.document.createElement("div");paddedOverlay.style.position="absolute";paddedOverlay.style.left="0";paddedOverlay.style.right="0";paddedOverlay.style.top="0";paddedOverlay.style.bottom="0";paddedOverlay.style.margin=CUE_BACKGROUND_PADDING;overlay.appendChild(paddedOverlay);function shouldCompute(cues){for(var i=0;i<cues.length;i++){if(cues[i].hasBeenReset||!cues[i].displayState){return true;}}
513return false;}
514if(!shouldCompute(cues)){for(var i=0;i<cues.length;i++){paddedOverlay.appendChild(cues[i].displayState);}
515return;}
516var boxPositions=[],containerBox=BoxPosition.getSimpleBoxPosition(paddedOverlay),fontSize=Math.round(containerBox.height*FONT_SIZE_PERCENT*100)/100;var styleOptions={font:fontSize+"px "+FONT_STYLE};(function(){var styleBox,cue;for(var i=0;i<cues.length;i++){cue=cues[i];styleBox=new CueStyleBox(window,cue,styleOptions);paddedOverlay.appendChild(styleBox.div);moveBoxToLinePosition(window,styleBox,containerBox,boxPositions);cue.displayState=styleBox.div;boxPositions.push(BoxPosition.getSimpleBoxPosition(styleBox));}})();};WebVTT$1.Parser=function(window,vttjs,decoder){if(!decoder){decoder=vttjs;vttjs={};}
vendor: 4,368 bytes, lines 517-547
517if(!vttjs){vttjs={};}
518this.window=window;this.vttjs=vttjs;this.state="INITIAL";this.buffer="";this.decoder=decoder||new TextDecoder("utf8");this.regionList=[];};WebVTT$1.Parser.prototype={reportOrThrowError:function reportOrThrowError(e){if(e instanceof ParsingError){this.onparsingerror&&this.onparsingerror(e);}else{throw e;}},parse:function parse(data){var self=this;if(data){self.buffer+=self.decoder.decode(data,{stream:true});}
519function collectNextLine(){var buffer=self.buffer;var pos=0;while(pos<buffer.length&&buffer[pos]!=='\r'&&buffer[pos]!=='\n'){++pos;}
520var line=buffer.substr(0,pos);if(buffer[pos]==='\r'){++pos;}
521if(buffer[pos]==='\n'){++pos;}
522self.buffer=buffer.substr(pos);return line;}
523function parseRegion(input){var settings=new Settings();parseOptions(input,function(k,v){switch(k){case "id":settings.set(k,v);break;case "width":settings.percent(k,v);break;case "lines":settings.integer(k,v);break;case "regionanchor":case "viewportanchor":var xy=v.split(',');if(xy.length!==2){break;}
524var anchor=new Settings();anchor.percent("x",xy[0]);anchor.percent("y",xy[1]);if(!anchor.has("x")||!anchor.has("y")){break;}
525settings.set(k+"X",anchor.get("x"));settings.set(k+"Y",anchor.get("y"));break;case "scroll":settings.alt(k,v,["up"]);break;}},/=/,/\s/);if(settings.has("id")){var region=new(self.vttjs.VTTRegion||self.window.VTTRegion)();region.width=settings.get("width",100);region.lines=settings.get("lines",3);region.regionAnchorX=settings.get("regionanchorX",0);region.regionAnchorY=settings.get("regionanchorY",100);region.viewportAnchorX=settings.get("viewportanchorX",0);region.viewportAnchorY=settings.get("viewportanchorY",100);region.scroll=settings.get("scroll","");self.onregion&&self.onregion(region);self.regionList.push({id:settings.get("id"),region:region});}}
526function parseTimestampMap(input){var settings=new Settings();parseOptions(input,function(k,v){switch(k){case "MPEGT":settings.integer(k+'S',v);break;case "LOCA":settings.set(k+'L',parseTimeStamp(v));break;}},/[^\d]:/,/,/);self.ontimestampmap&&self.ontimestampmap({"MPEGTS":settings.get("MPEGTS"),"LOCAL":settings.get("LOCAL")});}
527function parseHeader(input){if(input.match(/X-TIMESTAMP-MAP/)){parseOptions(input,function(k,v){switch(k){case "X-TIMESTAMP-MAP":parseTimestampMap(v);break;}},/=/);}else{parseOptions(input,function(k,v){switch(k){case "Region":parseRegion(v);break;}},/:/);}}
528try{var line;if(self.state==="INITIAL"){if(!/\r\n|\n/.test(self.buffer)){return this;}
529line=collectNextLine();var m=line.match(/^WEBVTT([ \t].*)?$/);if(!m||!m[0]){throw new ParsingError(ParsingError.Errors.BadSignature);}
530self.state="HEADER";}
531var alreadyCollectedLine=false;while(self.buffer){if(!/\r\n|\n/.test(self.buffer)){return this;}
532if(!alreadyCollectedLine){line=collectNextLine();}else{alreadyCollectedLine=false;}
533switch(self.state){case "HEADER":if(/:/.test(line)){parseHeader(line);}else if(!line){self.state="ID";}
534continue;case "NOTE":if(!line){self.state="ID";}
535continue;case "ID":if(/^NOTE($|[ \t])/.test(line)){self.state="NOTE";break;}
536if(!line){continue;}
537self.cue=new(self.vttjs.VTTCue||self.window.VTTCue)(0,0,"");try{self.cue.align="center";}catch(e){self.cue.align="middle";}
538self.state="CUE";if(line.indexOf("-->")===-1){self.cue.id=line;continue;}
539case "CUE":try{parseCue(line,self.cue,self.regionList);}catch(e){self.reportOrThrowError(e);self.cue=null;self.state="BADCUE";continue;}
540self.state="CUETEXT";continue;case "CUETEXT":var hasSubstring=line.indexOf("-->")!==-1;if(!line||hasSubstring&&(alreadyCollectedLine=true)){self.oncue&&self.oncue(self.cue);self.cue=null;self.state="ID";continue;}
541if(self.cue.text){self.cue.text+="\n";}
542self.cue.text+=line.replace(/\u2028/g,'\n').replace(/u2029/g,'\n');continue;case "BADCUE":if(!line){self.state="ID";}
543continue;}}}catch(e){self.reportOrThrowError(e);if(self.state==="CUETEXT"&&self.cue&&self.oncue){self.oncue(self.cue);}
544self.cue=null;self.state=self.state==="INITIAL"?"BADWEBVTT":"BADCUE";}
545return this;},flush:function flush(){var self=this;try{self.buffer+=self.decoder.decode();if(self.cue||self.state==="HEADER"){self.buffer+="\n\n";self.parse();}
546if(self.state==="INITIAL"){throw new ParsingError(ParsingError.Errors.BadSignature);}}catch(e){self.reportOrThrowError(e);}
547self.onflush&&self.onflush();return this;}};var vtt=WebVTT$1;var autoKeyword="auto";var directionSetting={"":1,"lr":1,"rl":1};
547var alignSetting={"start":1,"center":1,"end":1,"left":1,"right":1,"auto":1,"line-left":1,"line-right":1};function findDirectionSetting(value){if(typeof value!=="string"){return false;}
548var dir=directionSetting[value.toLowerCase()];return dir?value.toLowerCase():false;}
549function findAlignSetting(value){if(typeof value!=="string"){return false;}
550var align=alignSetting[value.toLowerCase()];return align?value.toLowerCase():false;}
551function VTTCue(startTime,endTime,text){this.hasBeenReset=false;var _id="";var _pauseOnExit=false;var _startTime=startTime;var _endTime=endTime;var _text=text;var _region=null;var _vertical="";var _snapToLines=true;var _line="auto";var _lineAlign="start";var _position="auto";var _positionAlign="auto";var _size=100;var _align="center";Object.defineProperties(this,{"id":{enumerable:true,get:function get(){return _id;},set:function set(value){_id=""+value;}},"pauseOnExit":{enumerable:true,get:function get(){return _pauseOnExit;},set:function set(value){_pauseOnExit=!!value;}},"startTime":{enumerable:true,get:function get(){return _startTime;},set:function set(value){if(typeof value!=="number"){throw new TypeError("Start time must be set to a number.");}
552_startTime=value;this.hasBeenReset=true;}},"endTime":{enumerable:true,get:function get(){return _endTime;},set:function set(value){if(typeof value!=="number"){throw new TypeError("End time must be set to a number.");}
553_endTime=value;this.hasBeenReset=true;}},"text":{enumerable:true,get:function get(){return _text;},set:function set(value){_text=""+value;this.hasBeenReset=true;}},"region":{enumerable:true,get:function get(){return _region;},set:function set(value){_region=value;this.hasBeenReset=true;}},"vertical":{enumerable:true,get:function get(){return _vertical;},set:function set(value){var setting=findDirectionSetting(value);if(setting===false){throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");}
554_vertical=setting;this.hasBeenReset=true;}},"snapToLines":{enumerable:true,get:function get(){return _snapToLines;},set:function set(value){_snapToLines=!!value;this.hasBeenReset=true;}},"line":{enumerable:true,get:function get(){return _line;},set:function set(value){if(typeof value!=="number"&&value!==autoKeyword){throw new SyntaxError("Line: an invalid number or illegal string was specified.");}
555_line=value;this.hasBeenReset=true;}},"lineAlign":{enumerable:true,get:function get(){return _lineAlign;},set:function set(value){var setting=findAlignSetting(value);if(!setting){console.warn("lineAlign: an invalid or illegal string was specified.");}else{_lineAlign=setting;this.hasBeenReset=true;}}},"position":{enumerable:true,get:function get(){return _position;},set:function set(value){if(value<0||value>100){throw new Error("Position must be between 0 and 100.");}
556_position=value;this.hasBeenReset=true;}},"positionAlign":{enumerable:true,get:function get(){return _positionAlign;},set:function set(value){var setting=findAlignSetting(value);if(!setting){console.warn("positionAlign: an invalid or illegal string was specified.");}else{_positionAlign=setting;this.hasBeenReset=true;}}},"size":{enumerable:true,get:function get(){return _size;},set:function set(value){if(value<0||value>100){throw new Error("Size must be between 0 and 100.");}
557_size=value;this.hasBeenReset=true;}},"align":{enumerable:true,get:function get(){return _align;},set:function set(value){var setting=findAlignSetting(value);if(!setting){throw new SyntaxError("align: an invalid or illegal alignment string was specified.");}
558_align=setting;this.hasBeenReset=true;}}});this.displayState=undefined;}
559VTTCue.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text);};var vttcue=VTTCue;var scrollSetting={"":true,"up":true};function findScrollSetting(value){if(typeof value!=="string"){return false;}
560var scroll=scrollSetting[value.toLowerCase()];return scroll?value.toLowerCase():false;}
561function isValidPercentValue(value){return typeof value==="number"&&value>=0&&value<=100;}
562function VTTRegion(){var _width=100;var _lines=3;var _regionAnchorX=0;var _regionAnchorY=100;var _viewportAnchorX=0;var _viewportAnchorY=100;var _scroll="";Object.defineProperties(this,{"width":{enumerable:true,get:function get(){return _width;},set:function set(value){if(!isValidPercentValue(value)){throw new Error("Width must be between 0 and 100.");}
563_width=value;}},"lines":{enumerable:true,get:function get(){return _lines;},set:function set(value){if(typeof value!=="number"){throw new TypeError("Lines must be set to a number.");}
564_lines=value;}},"regionAnchorY":{enumerable:true,get:function get(){return _regionAnchorY;},set:function set(value){if(!isValidPercentValue(value)){throw new Error("RegionAnchorX must be between 0 and 100.");}
565_regionAnchorY=value;}},"regionAnchorX":{enumerable:true,get:function get(){return _regionAnchorX;},set:function set(value){if(!isValidPercentValue(value)){throw new Error("RegionAnchorY must be between 0 and 100.");}
566_regionAnchorX=value;}},"viewportAnchorY":{enumerable:true,get:function get(){return _viewportAnchorY;},set:function set(value){if(!isValidPercentValue(value)){throw new Error("ViewportAnchorY must be between 0 and 100.");}
567_viewportAnchorY=value;}},"viewportAnchorX":{enumerable:true,get:function get(){return _viewportAnchorX;},set:function set(value){if(!isValidPercentValue(value)){throw new Error("ViewportAnchorX must be between 0 and 100.");}
568_viewportAnchorX=value;}},"scroll":{enumerable:true,get:function get(){return _scroll;},set:function set(value){var setting=findScrollSetting(value);
vendor: 115,064 bytes, lines 568-902
568if(setting===false){console.warn("Scroll: an invalid or illegal string was specified.");}else{_scroll=setting;}}}});}
569var vttregion=VTTRegion;var browserIndex=createCommonjsModule(function(module){var vttjs=module.exports={WebVTT:vtt,VTTCue:vttcue,VTTRegion:vttregion};window$3.vttjs=vttjs;window$3.WebVTT=vttjs.WebVTT;var cueShim=vttjs.VTTCue;var regionShim=vttjs.VTTRegion;var nativeVTTCue=window$3.VTTCue;var nativeVTTRegion=window$3.VTTRegion;vttjs.shim=function(){window$3.VTTCue=cueShim;window$3.VTTRegion=regionShim;};vttjs.restore=function(){window$3.VTTCue=nativeVTTCue;window$3.VTTRegion=nativeVTTRegion;};if(!window$3.VTTCue){vttjs.shim();}});var browserIndex_1=browserIndex.WebVTT;var browserIndex_2=browserIndex.VTTCue;var browserIndex_3=browserIndex.VTTRegion;function createTrackHelper(self,kind,label,language,options){if(options===void 0){options={};}
570var tracks=self.textTracks();options.kind=kind;if(label){options.label=label;}
571if(language){options.language=language;}
572options.tech=self;var track=new ALL.text.TrackClass(options);tracks.addTrack(track);return track;}
573var Tech=function(_Component){inheritsLoose(Tech,_Component);function Tech(options,ready){var _this;if(options===void 0){options={};}
574if(ready===void 0){ready=function ready(){};}
575options.reportTouchActivity=false;_this=_Component.call(this,null,options,ready)||this;_this.hasStarted_=false;_this.on('playing',function(){this.hasStarted_=true;});_this.on('loadstart',function(){this.hasStarted_=false;});ALL.names.forEach(function(name){var props=ALL[name];if(options&&options[props.getterName]){_this[props.privateName]=options[props.getterName];}});if(!_this.featuresProgressEvents){_this.manualProgressOn();}
576if(!_this.featuresTimeupdateEvents){_this.manualTimeUpdatesOn();}
577['Text','Audio','Video'].forEach(function(track){if(options["native"+track+"Tracks"]===false){_this["featuresNative"+track+"Tracks"]=false;}});if(options.nativeCaptions===false||options.nativeTextTracks===false){_this.featuresNativeTextTracks=false;}else if(options.nativeCaptions===true||options.nativeTextTracks===true){_this.featuresNativeTextTracks=true;}
578if(!_this.featuresNativeTextTracks){_this.emulateTextTracks();}
579_this.preloadTextTracks=options.preloadTextTracks!==false;_this.autoRemoteTextTracks_=new ALL.text.ListClass();_this.initTrackListeners();if(!options.nativeControlsForTouch){_this.emitTapEvents();}
580if(_this.constructor){_this.name_=_this.constructor.name||'Unknown Tech';}
581return _this;}
582var _proto=Tech.prototype;_proto.triggerSourceset=function triggerSourceset(src){var _this2=this;if(!this.isReady_){this.one('ready',function(){return _this2.setTimeout(function(){return _this2.triggerSourceset(src);},1);});}
583this.trigger({src:src,type:'sourceset'});};_proto.manualProgressOn=function manualProgressOn(){this.on('durationchange',this.onDurationChange);this.manualProgress=true;this.one('ready',this.trackProgress);};_proto.manualProgressOff=function manualProgressOff(){this.manualProgress=false;this.stopTrackingProgress();this.off('durationchange',this.onDurationChange);};_proto.trackProgress=function trackProgress(event){this.stopTrackingProgress();this.progressInterval=this.setInterval(bind(this,function(){var numBufferedPercent=this.bufferedPercent();if(this.bufferedPercent_!==numBufferedPercent){this.trigger('progress');}
584this.bufferedPercent_=numBufferedPercent;if(numBufferedPercent===1){this.stopTrackingProgress();}}),500);};_proto.onDurationChange=function onDurationChange(event){this.duration_=this.duration();};_proto.buffered=function buffered(){return createTimeRanges(0,0);};_proto.bufferedPercent=function bufferedPercent$1(){return bufferedPercent(this.buffered(),this.duration_);};_proto.stopTrackingProgress=function stopTrackingProgress(){this.clearInterval(this.progressInterval);};_proto.manualTimeUpdatesOn=function manualTimeUpdatesOn(){this.manualTimeUpdates=true;this.on('play',this.trackCurrentTime);this.on('pause',this.stopTrackingCurrentTime);};_proto.manualTimeUpdatesOff=function manualTimeUpdatesOff(){this.manualTimeUpdates=false;this.stopTrackingCurrentTime();this.off('play',this.trackCurrentTime);this.off('pause',this.stopTrackingCurrentTime);};_proto.trackCurrentTime=function trackCurrentTime(){if(this.currentTimeInterval){this.stopTrackingCurrentTime();}
585this.currentTimeInterval=this.setInterval(function(){this.trigger({type:'timeupdate',target:this,manuallyTriggered:true});},250);};_proto.stopTrackingCurrentTime=function stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval);this.trigger({type:'timeupdate',target:this,manuallyTriggered:true});};_proto.dispose=function dispose(){this.clearTracks(NORMAL.names);if(this.manualProgress){this.manualProgressOff();}
586if(this.manualTimeUpdates){this.manualTimeUpdatesOff();}
587_Component.prototype.dispose.call(this);};_proto.clearTracks=function clearTracks(types){var _this3=this;types=[].concat(types);types.forEach(function(type){var list=_this3[type+"Tracks"]()||[];var i=list.length;while(i--){var track=list[i];if(type==='text'){_this3.removeRemoteTextTrack(track);}
588list.removeTrack(track);}});};_proto.cleanupAutoTextTracks=function cleanupAutoTextTracks(){var list=this.autoRemoteTextTracks_||[];var i=list.length;while(i--){var track=list[i];this.removeRemoteTextTrack(track);}};_proto.reset=function reset(){};_proto.error=function error(err){if(err!==undefined){this.error_=new MediaError(err);this.trigger('error');}
589return this.error_;};_proto.played=function played(){if(this.hasStarted_){return createTimeRanges(0,0);}
590return createTimeRanges();};_proto.setCurrentTime=function setCurrentTime(){if(this.manualTimeUpdates){this.trigger({type:'timeupdate',target:this,manuallyTriggered:true});}};_proto.initTrackListeners=function initTrackListeners(){var _this4=this;NORMAL.names.forEach(function(name){var props=NORMAL[name];var trackListChanges=function trackListChanges(){_this4.trigger(name+"trackchange");};var tracks=_this4[props.getterName]();tracks.addEventListener('removetrack',trackListChanges);tracks.addEventListener('addtrack',trackListChanges);_this4.on('dispose',function(){tracks.removeEventListener('removetrack',trackListChanges);tracks.removeEventListener('addtrack',trackListChanges);});});};_proto.addWebVttScript_=function addWebVttScript_(){var _this5=this;if(window$3.WebVTT){return;}
591if(document.body.contains(this.el())){if(!this.options_['vtt.js']&&isPlain(browserIndex)&&Object.keys(browserIndex).length>0){this.trigger('vttjsloaded');return;}
592var script=document.createElement('script');script.src=this.options_['vtt.js']||'https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js';script.onload=function(){_this5.trigger('vttjsloaded');};script.onerror=function(){_this5.trigger('vttjserror');};this.on('dispose',function(){script.onload=null;script.onerror=null;});window$3.WebVTT=true;this.el().parentNode.appendChild(script);}else{this.ready(this.addWebVttScript_);}};_proto.emulateTextTracks=function emulateTextTracks(){var _this6=this;var tracks=this.textTracks();var remoteTracks=this.remoteTextTracks();var handleAddTrack=function handleAddTrack(e){return tracks.addTrack(e.track);};var handleRemoveTrack=function handleRemoveTrack(e){return tracks.removeTrack(e.track);};remoteTracks.on('addtrack',handleAddTrack);remoteTracks.on('removetrack',handleRemoveTrack);this.addWebVttScript_();var updateDisplay=function updateDisplay(){return _this6.trigger('texttrackchange');};var textTracksChanges=function textTracksChanges(){updateDisplay();for(var i=0;i<tracks.length;i++){var track=tracks[i];track.removeEventListener('cuechange',updateDisplay);if(track.mode==='showing'){track.addEventListener('cuechange',updateDisplay);}}};textTracksChanges();tracks.addEventListener('change',textTracksChanges);tracks.addEventListener('addtrack',textTracksChanges);tracks.addEventListener('removetrack',textTracksChanges);this.on('dispose',function(){remoteTracks.off('addtrack',handleAddTrack);remoteTracks.off('removetrack',handleRemoveTrack);tracks.removeEventListener('change',textTracksChanges);tracks.removeEventListener('addtrack',textTracksChanges);tracks.removeEventListener('removetrack',textTracksChanges);for(var i=0;i<tracks.length;i++){var track=tracks[i];track.removeEventListener('cuechange',updateDisplay);}});};_proto.addTextTrack=function addTextTrack(kind,label,language){if(!kind){throw new Error('TextTrack kind is required but was not provided');}
593return createTrackHelper(this,kind,label,language);};_proto.createRemoteTextTrack=function createRemoteTextTrack(options){var track=mergeOptions(options,{tech:this});return new REMOTE.remoteTextEl.TrackClass(track);};_proto.addRemoteTextTrack=function addRemoteTextTrack(options,manualCleanup){var _this7=this;if(options===void 0){options={};}
594var htmlTrackElement=this.createRemoteTextTrack(options);if(manualCleanup!==true&&manualCleanup!==false){log.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js');manualCleanup=true;}
595this.remoteTextTrackEls().addTrackElement_(htmlTrackElement);this.remoteTextTracks().addTrack(htmlTrackElement.track);if(manualCleanup!==true){this.ready(function(){return _this7.autoRemoteTextTracks_.addTrack(htmlTrackElement.track);});}
596return htmlTrackElement;};_proto.removeRemoteTextTrack=function removeRemoteTextTrack(track){var trackElement=this.remoteTextTrackEls().getTrackElementByTrack_(track);this.remoteTextTrackEls().removeTrackElement_(trackElement);this.remoteTextTracks().removeTrack(track);this.autoRemoteTextTracks_.removeTrack(track);};_proto.getVideoPlaybackQuality=function getVideoPlaybackQuality(){return{};};_proto.requestPictureInPicture=function requestPictureInPicture(){var PromiseClass=this.options_.Promise||window$3.Promise;if(PromiseClass){return PromiseClass.reject();}};_proto.setPoster=function setPoster(){};_proto.playsinline=function playsinline(){};_proto.setPlaysinline=function setPlaysinline(){};_proto.overrideNativeAudioTracks=function overrideNativeAudioTracks(){};_proto.overrideNativeVideoTracks=function overrideNativeVideoTracks(){};_proto.canPlayType=function canPlayType(){return '';};Tech.canPlayType=function canPlayType(){return '';};Tech.canPlaySource=function canPlaySource(srcObj,options){return Tech.canPlayType(srcObj.type);};Tech.isTech=function isTech(component){return component.prototype instanceof Tech||component instanceof Tech||component===Tech;};Tech.registerTech=function registerTech(name,tech){if(!Tech.techs_){Tech.techs_={};}
597if(!Tech.isTech(tech)){throw new Error("Tech "+name+" must be a Tech");}
598if(!Tech.canPlayType){throw new Error('Techs must have a static canPlayType method on them');}
599if(!Tech.canPlaySource){throw new Error('Techs must have a static canPlaySource method on them');}
600name=toTitleCase(name);Tech.techs_[name]=tech;Tech.techs_[toLowerCase(name)]=tech;if(name!=='Tech'){Tech.defaultTechOrder_.push(name);}
601return tech;};Tech.getTech=function getTech(name){if(!name){return;}
602if(Tech.techs_&&Tech.techs_[name]){return Tech.techs_[name];}
603name=toTitleCase(name);if(window$3&&window$3.videojs&&window$3.videojs[name]){log.warn("The "+name+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)");return window$3.videojs[name];}};return Tech;}(Component);ALL.names.forEach(function(name){var props=ALL[name];Tech.prototype[props.getterName]=function(){this[props.privateName]=this[props.privateName]||new props.ListClass();return this[props.privateName];};});Tech.prototype.featuresVolumeControl=true;Tech.prototype.featuresMuteControl=true;Tech.prototype.featuresFullscreenResize=false;Tech.prototype.featuresPlaybackRate=false;Tech.prototype.featuresProgressEvents=false;Tech.prototype.featuresSourceset=false;Tech.prototype.featuresTimeupdateEvents=false;Tech.prototype.featuresNativeTextTracks=false;Tech.withSourceHandlers=function(_Tech){_Tech.registerSourceHandler=function(handler,index){var handlers=_Tech.sourceHandlers;if(!handlers){handlers=_Tech.sourceHandlers=[];}
604if(index===undefined){index=handlers.length;}
605handlers.splice(index,0,handler);};_Tech.canPlayType=function(type){var handlers=_Tech.sourceHandlers||[];var can;for(var i=0;i<handlers.length;i++){can=handlers[i].canPlayType(type);if(can){return can;}}
606return '';};_Tech.selectSourceHandler=function(source,options){var handlers=_Tech.sourceHandlers||[];var can;for(var i=0;i<handlers.length;i++){can=handlers[i].canHandleSource(source,options);if(can){return handlers[i];}}
607return null;};_Tech.canPlaySource=function(srcObj,options){var sh=_Tech.selectSourceHandler(srcObj,options);if(sh){return sh.canHandleSource(srcObj,options);}
608return '';};var deferrable=['seekable','seeking','duration'];deferrable.forEach(function(fnName){var originalFn=this[fnName];if(typeof originalFn!=='function'){return;}
609this[fnName]=function(){if(this.sourceHandler_&&this.sourceHandler_[fnName]){return this.sourceHandler_[fnName].apply(this.sourceHandler_,arguments);}
610return originalFn.apply(this,arguments);};},_Tech.prototype);_Tech.prototype.setSource=function(source){var sh=_Tech.selectSourceHandler(source,this.options_);if(!sh){if(_Tech.nativeSourceHandler){sh=_Tech.nativeSourceHandler;}else{log.error('No source handler found for the current source.');}}
611this.disposeSourceHandler();this.off('dispose',this.disposeSourceHandler);if(sh!==_Tech.nativeSourceHandler){this.currentSource_=source;}
612this.sourceHandler_=sh.handleSource(source,this,this.options_);this.one('dispose',this.disposeSourceHandler);};_Tech.prototype.disposeSourceHandler=function(){if(this.currentSource_){this.clearTracks(['audio','video']);this.currentSource_=null;}
613this.cleanupAutoTextTracks();if(this.sourceHandler_){if(this.sourceHandler_.dispose){this.sourceHandler_.dispose();}
614this.sourceHandler_=null;}};};Component.registerComponent('Tech',Tech);Tech.registerTech('Tech',Tech);Tech.defaultTechOrder_=[];var middlewares={};var middlewareInstances={};var TERMINATOR={};function use(type,middleware){middlewares[type]=middlewares[type]||[];middlewares[type].push(middleware);}
615function setSource(player,src,next){player.setTimeout(function(){return setSourceHelper(src,middlewares[src.type],next,player);},1);}
616function setTech(middleware,tech){middleware.forEach(function(mw){return mw.setTech&&mw.setTech(tech);});}
617function get(middleware,tech,method){return middleware.reduceRight(middlewareIterator(method),tech[method]());}
618function set(middleware,tech,method,arg){return tech[method](middleware.reduce(middlewareIterator(method),arg));}
619function mediate(middleware,tech,method,arg){if(arg===void 0){arg=null;}
620var callMethod='call'+toTitleCase(method);var middlewareValue=middleware.reduce(middlewareIterator(callMethod),arg);var terminated=middlewareValue===TERMINATOR;var returnValue=terminated?null:tech[method](middlewareValue);executeRight(middleware,method,returnValue,terminated);return returnValue;}
621var allowedGetters={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1};var allowedSetters={setCurrentTime:1,setMuted:1,setVolume:1};var allowedMediators={play:1,pause:1};function middlewareIterator(method){return function(value,mw){if(value===TERMINATOR){return TERMINATOR;}
622if(mw[method]){return mw[method](value);}
623return value;};}
624function executeRight(mws,method,value,terminated){for(var i=mws.length-1;i>=0;i--){var mw=mws[i];if(mw[method]){mw[method](terminated,value);}}}
625function clearCacheForPlayer(player){middlewareInstances[player.id()]=null;}
626function getOrCreateFactory(player,mwFactory){var mws=middlewareInstances[player.id()];var mw=null;if(mws===undefined||mws===null){mw=mwFactory(player);middlewareInstances[player.id()]=[[mwFactory,mw]];return mw;}
627for(var i=0;i<mws.length;i++){var _mws$i=mws[i],mwf=_mws$i[0],mwi=_mws$i[1];if(mwf!==mwFactory){continue;}
628mw=mwi;}
629if(mw===null){mw=mwFactory(player);mws.push([mwFactory,mw]);}
630return mw;}
631function setSourceHelper(src,middleware,next,player,acc,lastRun){if(src===void 0){src={};}
632if(middleware===void 0){middleware=[];}
633if(acc===void 0){acc=[];}
634if(lastRun===void 0){lastRun=false;}
635var _middleware=middleware,mwFactory=_middleware[0],mwrest=_middleware.slice(1);if(typeof mwFactory==='string'){setSourceHelper(src,middlewares[mwFactory],next,player,acc,lastRun);}else if(mwFactory){var mw=getOrCreateFactory(player,mwFactory);if(!mw.setSource){acc.push(mw);return setSourceHelper(src,mwrest,next,player,acc,lastRun);}
636mw.setSource(assign({},src),function(err,_src){if(err){return setSourceHelper(src,mwrest,next,player,acc,lastRun);}
637acc.push(mw);setSourceHelper(_src,src.type===_src.type?mwrest:middlewares[_src.type],next,player,acc,lastRun);});}else if(mwrest.length){setSourceHelper(src,mwrest,next,player,acc,lastRun);}else if(lastRun){next(src,acc);}else{setSourceHelper(src,middlewares['*'],next,player,acc,true);}}
638var MimetypesKind={opus:'video/ogg',ogv:'video/ogg',mp4:'video/mp4',mov:'video/mp4',m4v:'video/mp4',mkv:'video/x-matroska',m4a:'audio/mp4',mp3:'audio/mpeg',aac:'audio/aac',oga:'audio/ogg',m3u8:'application/x-mpegURL',jpg:'image/jpeg',jpeg:'image/jpeg',gif:'image/gif',png:'image/png',svg:'image/svg+xml',webp:'image/webp'};var getMimetype=function getMimetype(src){if(src===void 0){src='';}
639var ext=getFileExtension(src);var mimetype=MimetypesKind[ext.toLowerCase()];return mimetype||'';};var findMimetype=function findMimetype(player,src){if(!src){return '';}
640if(player.cache_.source.src===src&&player.cache_.source.type){return player.cache_.source.type;}
641var matchingSources=player.cache_.sources.filter(function(s){return s.src===src;});if(matchingSources.length){return matchingSources[0].type;}
642var sources=player.$$('source');for(var i=0;i<sources.length;i++){var s=sources[i];if(s.type&&s.src&&s.src===src){return s.type;}}
643return getMimetype(src);};var filterSource=function filterSource(src){if(Array.isArray(src)){var newsrc=[];src.forEach(function(srcobj){srcobj=filterSource(srcobj);if(Array.isArray(srcobj)){newsrc=newsrc.concat(srcobj);}else if(isObject(srcobj)){newsrc.push(srcobj);}});src=newsrc;}else if(typeof src==='string'&&src.trim()){src=[fixSource({src:src})];}else if(isObject(src)&&typeof src.src==='string'&&src.src&&src.src.trim()){src=[fixSource(src)];}else{src=[];}
644return src;};function fixSource(src){if(!src.type){var mimetype=getMimetype(src.src);if(mimetype){src.type=mimetype;}}
645return src;}
646var MediaLoader=function(_Component){inheritsLoose(MediaLoader,_Component);function MediaLoader(player,options,ready){var _this;var options_=mergeOptions({createEl:false},options);_this=_Component.call(this,player,options_,ready)||this;if(!options.playerOptions.sources||options.playerOptions.sources.length===0){for(var i=0,j=options.playerOptions.techOrder;i<j.length;i++){var techName=toTitleCase(j[i]);var tech=Tech.getTech(techName);if(!techName){tech=Component.getComponent(techName);}
647if(tech&&tech.isSupported()){player.loadTech_(techName);break;}}}else{player.src(options.playerOptions.sources);}
648return _this;}
649return MediaLoader;}(Component);Component.registerComponent('MediaLoader',MediaLoader);var ClickableComponent=function(_Component){inheritsLoose(ClickableComponent,_Component);function ClickableComponent(player,options){var _this;_this=_Component.call(this,player,options)||this;_this.emitTapEvents();_this.enable();return _this;}
650var _proto=ClickableComponent.prototype;_proto.createEl=function createEl(tag,props,attributes){if(tag===void 0){tag='div';}
651if(props===void 0){props={};}
652if(attributes===void 0){attributes={};}
653props=assign({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass(),tabIndex:0},props);if(tag==='button'){log.error("Creating a ClickableComponent with an HTML element of "+tag+" is not supported; use a Button instead.");}
654attributes=assign({role:'button'},attributes);this.tabIndex_=props.tabIndex;var el=_Component.prototype.createEl.call(this,tag,props,attributes);this.createControlTextEl(el);return el;};_proto.dispose=function dispose(){this.controlTextEl_=null;_Component.prototype.dispose.call(this);};_proto.createControlTextEl=function createControlTextEl(el){this.controlTextEl_=createEl('span',{className:'vjs-control-text'},{'aria-live':'polite'});if(el){el.appendChild(this.controlTextEl_);}
655this.controlText(this.controlText_,el);return this.controlTextEl_;};_proto.controlText=function controlText(text,el){if(el===void 0){el=this.el();}
656if(text===undefined){return this.controlText_||'Need Text';}
657var localizedText=this.localize(text);this.controlText_=text;textContent(this.controlTextEl_,localizedText);if(!this.nonIconControl){el.setAttribute('title',localizedText);}};_proto.buildCSSClass=function buildCSSClass(){return "vjs-control vjs-button "+_Component.prototype.buildCSSClass.call(this);};_proto.enable=function enable(){if(!this.enabled_){this.enabled_=true;this.removeClass('vjs-disabled');this.el_.setAttribute('aria-disabled','false');if(typeof this.tabIndex_!=='undefined'){this.el_.setAttribute('tabIndex',this.tabIndex_);}
658this.on(['tap','click'],this.handleClick);this.on('keydown',this.handleKeyDown);}};_proto.disable=function disable(){this.enabled_=false;this.addClass('vjs-disabled');this.el_.setAttribute('aria-disabled','true');if(typeof this.tabIndex_!=='undefined'){this.el_.removeAttribute('tabIndex');}
659this.off('mouseover',this.handleMouseOver);this.off('mouseout',this.handleMouseOut);this.off(['tap','click'],this.handleClick);this.off('keydown',this.handleKeyDown);};_proto.handleClick=function handleClick(event){if(this.options_.clickHandler){this.options_.clickHandler.call(this,arguments);}};_proto.handleKeyDown=function handleKeyDown(event){if(keycode.isEventKey(event,'Space')||keycode.isEventKey(event,'Enter')){event.preventDefault();event.stopPropagation();this.trigger('click');}else{_Component.prototype.handleKeyDown.call(this,event);}};return ClickableComponent;}(Component);Component.registerComponent('ClickableComponent',ClickableComponent);var PosterImage=function(_ClickableComponent){inheritsLoose(PosterImage,_ClickableComponent);function PosterImage(player,options){var _this;_this=_ClickableComponent.call(this,player,options)||this;_this.update();player.on('posterchange',bind(assertThisInitialized(_this),_this.update));return _this;}
660var _proto=PosterImage.prototype;_proto.dispose=function dispose(){this.player().off('posterchange',this.update);_ClickableComponent.prototype.dispose.call(this);};_proto.createEl=function createEl$1(){var el=createEl('div',{className:'vjs-poster',tabIndex:-1});return el;};_proto.update=function update(event){var url=this.player().poster();this.setSrc(url);if(url){this.show();}else{this.hide();}};_proto.setSrc=function setSrc(url){var backgroundImage='';if(url){backgroundImage="url(\""+url+"\")";}
661this.el_.style.backgroundImage=backgroundImage;};_proto.handleClick=function handleClick(event){if(!this.player_.controls()){return;}
662var sourceIsEncrypted=this.player_.usingPlugin('eme')&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;if(this.player_.tech(true)&&!((IE_VERSION||IS_EDGE)&&sourceIsEncrypted)){this.player_.tech(true).focus();}
663if(this.player_.paused()){silencePromise(this.player_.play());}else{this.player_.pause();}};return PosterImage;}(ClickableComponent);Component.registerComponent('PosterImage',PosterImage);var darkGray='#222';var lightGray='#ccc';var fontMap={monospace:'monospace',sansSerif:'sans-serif',serif:'serif',monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:'sans-serif',proportionalSerif:'serif',casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function constructColor(color,opacity){var hex;if(color.length===4){hex=color[1]+color[1]+color[2]+color[2]+color[3]+color[3];}else if(color.length===7){hex=color.slice(1);}else{throw new Error('Invalid color code provided, '+color+'; must be formatted as e.g. #f0e or #f604e2.');}
664return 'rgba('+parseInt(hex.slice(0,2),16)+','+parseInt(hex.slice(2,4),16)+','+parseInt(hex.slice(4,6),16)+','+opacity+')';}
665function tryUpdateStyle(el,style,rule){try{el.style[style]=rule;}catch(e){return;}}
666var TextTrackDisplay=function(_Component){inheritsLoose(TextTrackDisplay,_Component);function TextTrackDisplay(player,options,ready){var _this;_this=_Component.call(this,player,options,ready)||this;var updateDisplayHandler=bind(assertThisInitialized(_this),_this.updateDisplay);player.on('loadstart',bind(assertThisInitialized(_this),_this.toggleDisplay));player.on('texttrackchange',updateDisplayHandler);player.on('loadedmetadata',bind(assertThisInitialized(_this),_this.preselectTrack));player.ready(bind(assertThisInitialized(_this),function(){if(player.tech_&&player.tech_.featuresNativeTextTracks){this.hide();return;}
667player.on('fullscreenchange',updateDisplayHandler);player.on('playerresize',updateDisplayHandler);window$3.addEventListener('orientationchange',updateDisplayHandler);player.on('dispose',function(){return window$3.removeEventListener('orientationchange',updateDisplayHandler);});var tracks=this.options_.playerOptions.tracks||[];for(var i=0;i<tracks.length;i++){this.player_.addRemoteTextTrack(tracks[i],true);}
668this.preselectTrack();}));return _this;}
669var _proto=TextTrackDisplay.prototype;_proto.preselectTrack=function preselectTrack(){var modes={captions:1,subtitles:1};var trackList=this.player_.textTracks();var userPref=this.player_.cache_.selectedLanguage;var firstDesc;var firstCaptions;var preferredTrack;for(var i=0;i<trackList.length;i++){var track=trackList[i];if(userPref&&userPref.enabled&&userPref.language&&userPref.language===track.language&&track.kind in modes){if(track.kind===userPref.kind){preferredTrack=track;}else if(!preferredTrack){preferredTrack=track;}}else if(userPref&&!userPref.enabled){preferredTrack=null;firstDesc=null;firstCaptions=null;}else if(track["default"]){if(track.kind==='descriptions'&&!firstDesc){firstDesc=track;}else if(track.kind in modes&&!firstCaptions){firstCaptions=track;}}}
670if(preferredTrack){preferredTrack.mode='showing';}else if(firstCaptions){firstCaptions.mode='showing';}else if(firstDesc){firstDesc.mode='showing';}};_proto.toggleDisplay=function toggleDisplay(){if(this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks){this.hide();}else{this.show();}};_proto.createEl=function createEl(){return _Component.prototype.createEl.call(this,'div',{className:'vjs-text-track-display'},{'aria-live':'off','aria-atomic':'true'});};_proto.clearDisplay=function clearDisplay(){if(typeof window$3.WebVTT==='function'){window$3.WebVTT.processCues(window$3,[],this.el_);}};_proto.updateDisplay=function updateDisplay(){var tracks=this.player_.textTracks();var allowMultipleShowingTracks=this.options_.allowMultipleShowingTracks;this.clearDisplay();if(allowMultipleShowingTracks){var showingTracks=[];for(var _i=0;_i<tracks.length;++_i){var track=tracks[_i];if(track.mode!=='showing'){continue;}
671showingTracks.push(track);}
672this.updateForTrack(showingTracks);return;}
673var descriptionsTrack=null;var captionsSubtitlesTrack=null;var i=tracks.length;while(i--){var _track=tracks[i];if(_track.mode==='showing'){if(_track.kind==='descriptions'){descriptionsTrack=_track;}else{captionsSubtitlesTrack=_track;}}}
674if(captionsSubtitlesTrack){if(this.getAttribute('aria-live')!=='off'){this.setAttribute('aria-live','off');}
675this.updateForTrack(captionsSubtitlesTrack);}else if(descriptionsTrack){if(this.getAttribute('aria-live')!=='assertive'){this.setAttribute('aria-live','assertive');}
676this.updateForTrack(descriptionsTrack);}};_proto.updateDisplayState=function updateDisplayState(track){var overrides=this.player_.textTrackSettings.getValues();var cues=track.activeCues;var i=cues.length;while(i--){var cue=cues[i];if(!cue){continue;}
677var cueDiv=cue.displayState;if(overrides.color){cueDiv.firstChild.style.color=overrides.color;}
678if(overrides.textOpacity){tryUpdateStyle(cueDiv.firstChild,'color',constructColor(overrides.color||'#fff',overrides.textOpacity));}
679if(overrides.backgroundColor){cueDiv.firstChild.style.backgroundColor=overrides.backgroundColor;}
680if(overrides.backgroundOpacity){tryUpdateStyle(cueDiv.firstChild,'backgroundColor',constructColor(overrides.backgroundColor||'#000',overrides.backgroundOpacity));}
681if(overrides.windowColor){if(overrides.windowOpacity){tryUpdateStyle(cueDiv,'backgroundColor',constructColor(overrides.windowColor,overrides.windowOpacity));}else{cueDiv.style.backgroundColor=overrides.windowColor;}}
682if(overrides.edgeStyle){if(overrides.edgeStyle==='dropshadow'){cueDiv.firstChild.style.textShadow="2px 2px 3px "+darkGray+", 2px 2px 4px "+darkGray+", 2px 2px 5px "+darkGray;}else if(overrides.edgeStyle==='raised'){cueDiv.firstChild.style.textShadow="1px 1px "+darkGray+", 2px 2px "+darkGray+", 3px 3px "+darkGray;}else if(overrides.edgeStyle==='depressed'){cueDiv.firstChild.style.textShadow="1px 1px "+lightGray+", 0 1px "+lightGray+", -1px -1px "+darkGray+", 0 -1px "+darkGray;}else if(overrides.edgeStyle==='uniform'){cueDiv.firstChild.style.textShadow="0 0 4px "+darkGray+", 0 0 4px "+darkGray+", 0 0 4px "+darkGray+", 0 0 4px "+darkGray;}}
683if(overrides.fontPercent&&overrides.fontPercent!==1){var fontSize=window$3.parseFloat(cueDiv.style.fontSize);cueDiv.style.fontSize=fontSize*overrides.fontPercent+'px';cueDiv.style.height='auto';cueDiv.style.top='auto';cueDiv.style.bottom='2px';}
684if(overrides.fontFamily&&overrides.fontFamily!=='default'){if(overrides.fontFamily==='small-caps'){cueDiv.firstChild.style.fontVariant='small-caps';}else{cueDiv.firstChild.style.fontFamily=fontMap[overrides.fontFamily];}}}};_proto.updateForTrack=function updateForTrack(tracks){if(!Array.isArray(tracks)){tracks=[tracks];}
685if(typeof window$3.WebVTT!=='function'||tracks.every(function(track){return!track.activeCues;})){return;}
686var cues=[];for(var i=0;i<tracks.length;++i){var track=tracks[i];for(var j=0;j<track.activeCues.length;++j){cues.push(track.activeCues[j]);}}
687window$3.WebVTT.processCues(window$3,cues,this.el_);for(var _i2=0;_i2<tracks.length;++_i2){var _track2=tracks[_i2];for(var _j=0;_j<_track2.activeCues.length;++_j){var cueEl=_track2.activeCues[_j].displayState;addClass(cueEl,'vjs-text-track-cue');addClass(cueEl,'vjs-text-track-cue-'+(_track2.language?_track2.language:_i2));}
688if(this.player_.textTrackSettings){this.updateDisplayState(_track2);}}};return TextTrackDisplay;}(Component);Component.registerComponent('TextTrackDisplay',TextTrackDisplay);var LoadingSpinner=function(_Component){inheritsLoose(LoadingSpinner,_Component);function LoadingSpinner(){return _Component.apply(this,arguments)||this;}
689var _proto=LoadingSpinner.prototype;_proto.createEl=function createEl$1(){var isAudio=this.player_.isAudio();var playerType=this.localize(isAudio?'Audio Player':'Video Player');var controlText=createEl('span',{className:'vjs-control-text',innerHTML:this.localize('{1} is loading.',[playerType])});var el=_Component.prototype.createEl.call(this,'div',{className:'vjs-loading-spinner',dir:'ltr'});el.appendChild(controlText);return el;};return LoadingSpinner;}(Component);Component.registerComponent('LoadingSpinner',LoadingSpinner);var Button=function(_ClickableComponent){inheritsLoose(Button,_ClickableComponent);function Button(){return _ClickableComponent.apply(this,arguments)||this;}
690var _proto=Button.prototype;_proto.createEl=function createEl(tag,props,attributes){if(props===void 0){props={};}
691if(attributes===void 0){attributes={};}
692tag='button';props=assign({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass()},props);attributes=assign({type:'button'},attributes);var el=Component.prototype.createEl.call(this,tag,props,attributes);this.createControlTextEl(el);return el;};_proto.addChild=function addChild(child,options){if(options===void 0){options={};}
693var className=this.constructor.name;log.warn("Adding an actionable (user controllable) child to a Button ("+className+") is not supported; use a ClickableComponent instead.");return Component.prototype.addChild.call(this,child,options);};_proto.enable=function enable(){_ClickableComponent.prototype.enable.call(this);this.el_.removeAttribute('disabled');};_proto.disable=function disable(){_ClickableComponent.prototype.disable.call(this);this.el_.setAttribute('disabled','disabled');};_proto.handleKeyDown=function handleKeyDown(event){if(keycode.isEventKey(event,'Space')||keycode.isEventKey(event,'Enter')){event.stopPropagation();return;}
694_ClickableComponent.prototype.handleKeyDown.call(this,event);};return Button;}(ClickableComponent);Component.registerComponent('Button',Button);var BigPlayButton=function(_Button){inheritsLoose(BigPlayButton,_Button);function BigPlayButton(player,options){var _this;_this=_Button.call(this,player,options)||this;_this.mouseused_=false;_this.on('mousedown',_this.handleMouseDown);return _this;}
695var _proto=BigPlayButton.prototype;_proto.buildCSSClass=function buildCSSClass(){return 'vjs-big-play-button';};_proto.handleClick=function handleClick(event){var playPromise=this.player_.play();if(this.mouseused_&&event.clientX&&event.clientY){var sourceIsEncrypted=this.player_.usingPlugin('eme')&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;silencePromise(playPromise);if(this.player_.tech(true)&&!((IE_VERSION||IS_EDGE)&&sourceIsEncrypted)){this.player_.tech(true).focus();}
696return;}
697var cb=this.player_.getChild('controlBar');var playToggle=cb&&cb.getChild('playToggle');if(!playToggle){this.player_.tech(true).focus();return;}
698var playFocus=function playFocus(){return playToggle.focus();};if(isPromise(playPromise)){playPromise.then(playFocus,function(){});}else{this.setTimeout(playFocus,1);}};_proto.handleKeyDown=function handleKeyDown(event){this.mouseused_=false;_Button.prototype.handleKeyDown.call(this,event);};_proto.handleMouseDown=function handleMouseDown(event){this.mouseused_=true;};return BigPlayButton;}(Button);BigPlayButton.prototype.controlText_='Play Video';Component.registerComponent('BigPlayButton',BigPlayButton);var CloseButton=function(_Button){inheritsLoose(CloseButton,_Button);function CloseButton(player,options){var _this;_this=_Button.call(this,player,options)||this;_this.controlText(options&&options.controlText||_this.localize('Close'));return _this;}
699var _proto=CloseButton.prototype;_proto.buildCSSClass=function buildCSSClass(){return "vjs-close-button "+_Button.prototype.buildCSSClass.call(this);};_proto.handleClick=function handleClick(event){this.trigger({type:'close',bubbles:false});};_proto.handleKeyDown=function handleKeyDown(event){if(keycode.isEventKey(event,'Esc')){event.preventDefault();event.stopPropagation();this.trigger('click');}else{_Button.prototype.handleKeyDown.call(this,event);}};return CloseButton;}(Button);Component.registerComponent('CloseButton',CloseButton);var PlayToggle=function(_Button){inheritsLoose(PlayToggle,_Button);function PlayToggle(player,options){var _this;if(options===void 0){options={};}
700_this=_Button.call(this,player,options)||this;options.replay=options.replay===undefined||options.replay;_this.on(player,'play',_this.handlePlay);_this.on(player,'pause',_this.handlePause);if(options.replay){_this.on(player,'ended',_this.handleEnded);}
701return _this;}
702var _proto=PlayToggle.prototype;_proto.buildCSSClass=function buildCSSClass(){return "vjs-play-control "+_Button.prototype.buildCSSClass.call(this);};_proto.handleClick=function handleClick(event){if(this.player_.paused()){this.player_.play();}else{this.player_.pause();}};_proto.handleSeeked=function handleSeeked(event){this.removeClass('vjs-ended');if(this.player_.paused()){this.handlePause(event);}else{this.handlePlay(event);}};_proto.handlePlay=function handlePlay(event){this.removeClass('vjs-ended');this.removeClass('vjs-paused');this.addClass('vjs-playing');this.controlText('Pause');};_proto.handlePause=function handlePause(event){this.removeClass('vjs-playing');this.addClass('vjs-paused');this.controlText('Play');};_proto.handleEnded=function handleEnded(event){this.removeClass('vjs-playing');this.addClass('vjs-ended');this.controlText('Replay');this.one(this.player_,'seeked',this.handleSeeked);};return PlayToggle;}(Button);PlayToggle.prototype.controlText_='Play';Component.registerComponent('PlayToggle',PlayToggle);var defaultImplementation=function defaultImplementation(seconds,guide){seconds=seconds<0?0:seconds;var s=Math.floor(seconds%60);var m=Math.floor(seconds/60%60);var h=Math.floor(seconds/3600);var gm=Math.floor(guide/60%60);var gh=Math.floor(guide/3600);if(isNaN(seconds)||seconds===Infinity){h=m=s='-';}
703h=h>0||gh>0?h+':':'';m=((h||gm>=10)&&m<10?'0'+m:m)+':';s=s<10?'0'+s:s;return h+m+s;};var implementation=defaultImplementation;function setFormatTime(customImplementation){implementation=customImplementation;}
704function resetFormatTime(){implementation=defaultImplementation;}
705function formatTime(seconds,guide){if(guide===void 0){guide=seconds;}
706return implementation(seconds,guide);}
707var TimeDisplay=function(_Component){inheritsLoose(TimeDisplay,_Component);function TimeDisplay(player,options){var _this;_this=_Component.call(this,player,options)||this;_this.on(player,['timeupdate','ended'],_this.updateContent);_this.updateTextNode_();return _this;}
708var _proto=TimeDisplay.prototype;_proto.createEl=function createEl$1(){var className=this.buildCSSClass();var el=_Component.prototype.createEl.call(this,'div',{className:className+" vjs-time-control vjs-control",innerHTML:"<span class=\"vjs-control-text\" role=\"presentation\">"+this.localize(this.labelText_)+"\xA0</span>"});this.contentEl_=createEl('span',{className:className+"-display"},{'aria-live':'off','role':'presentation'});el.appendChild(this.contentEl_);return el;};_proto.dispose=function dispose(){this.contentEl_=null;this.textNode_=null;_Component.prototype.dispose.call(this);};_proto.updateTextNode_=function updateTextNode_(time){var _this2=this;if(time===void 0){time=0;}
709time=formatTime(time);if(this.formattedTime_===time){return;}
710this.formattedTime_=time;this.requestAnimationFrame(function(){if(!_this2.contentEl_){return;}
711var oldNode=_this2.textNode_;_this2.textNode_=document.createTextNode(_this2.formattedTime_);if(!_this2.textNode_){return;}
712if(oldNode){_this2.contentEl_.replaceChild(_this2.textNode_,oldNode);}else{_this2.contentEl_.appendChild(_this2.textNode_);}});};_proto.updateContent=function updateContent(event){};return TimeDisplay;}(Component);TimeDisplay.prototype.labelText_='Time';TimeDisplay.prototype.controlText_='Time';Component.registerComponent('TimeDisplay',TimeDisplay);var CurrentTimeDisplay=function(_TimeDisplay){inheritsLoose(CurrentTimeDisplay,_TimeDisplay);function CurrentTimeDisplay(){return _TimeDisplay.apply(this,arguments)||this;}
713var _proto=CurrentTimeDisplay.prototype;_proto.buildCSSClass=function buildCSSClass(){return 'vjs-current-time';};_proto.updateContent=function updateContent(event){var time;if(this.player_.ended()){time=this.player_.duration();}else{time=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();}
714this.updateTextNode_(time);};return CurrentTimeDisplay;}(TimeDisplay);CurrentTimeDisplay.prototype.labelText_='Current Time';CurrentTimeDisplay.prototype.controlText_='Current Time';Component.registerComponent('CurrentTimeDisplay',CurrentTimeDisplay);var DurationDisplay=function(_TimeDisplay){inheritsLoose(DurationDisplay,_TimeDisplay);function DurationDisplay(player,options){var _this;_this=_TimeDisplay.call(this,player,options)||this;_this.on(player,'durationchange',_this.updateContent);_this.on(player,'loadstart',_this.updateContent);_this.on(player,'loadedmetadata',_this.updateContent);return _this;}
715var _proto=DurationDisplay.prototype;_proto.buildCSSClass=function buildCSSClass(){return 'vjs-duration';};_proto.updateContent=function updateContent(event){var duration=this.player_.duration();this.updateTextNode_(duration);};return DurationDisplay;}(TimeDisplay);DurationDisplay.prototype.labelText_='Duration';DurationDisplay.prototype.controlText_='Duration';Component.registerComponent('DurationDisplay',DurationDisplay);var TimeDivider=function(_Component){inheritsLoose(TimeDivider,_Component);function TimeDivider(){return _Component.apply(this,arguments)||this;}
716var _proto=TimeDivider.prototype;_proto.createEl=function createEl(){return _Component.prototype.createEl.call(this,'div',{className:'vjs-time-control vjs-time-divider',innerHTML:'<div><span>/</span></div>'},{'aria-hidden':true});};return TimeDivider;}(Component);Component.registerComponent('TimeDivider',TimeDivider);var RemainingTimeDisplay=function(_TimeDisplay){inheritsLoose(RemainingTimeDisplay,_TimeDisplay);function RemainingTimeDisplay(player,options){var _this;_this=_TimeDisplay.call(this,player,options)||this;_this.on(player,'durationchange',_this.updateContent);return _this;}
717var _proto=RemainingTimeDisplay.prototype;_proto.buildCSSClass=function buildCSSClass(){return 'vjs-remaining-time';};_proto.createEl=function createEl$1(){var el=_TimeDisplay.prototype.createEl.call(this);el.insertBefore(createEl('span',{},{'aria-hidden':true},'-'),this.contentEl_);return el;};_proto.updateContent=function updateContent(event){if(typeof this.player_.duration()!=='number'){return;}
718var time;if(this.player_.ended()){time=0;}else if(this.player_.remainingTimeDisplay){time=this.player_.remainingTimeDisplay();}else{time=this.player_.remainingTime();}
719this.updateTextNode_(time);};return RemainingTimeDisplay;}(TimeDisplay);RemainingTimeDisplay.prototype.labelText_='Remaining Time';RemainingTimeDisplay.prototype.controlText_='Remaining Time';Component.registerComponent('RemainingTimeDisplay',RemainingTimeDisplay);var LiveDisplay=function(_Component){inheritsLoose(LiveDisplay,_Component);function LiveDisplay(player,options){var _this;_this=_Component.call(this,player,options)||this;_this.updateShowing();_this.on(_this.player(),'durationchange',_this.updateShowing);return _this;}
720var _proto=LiveDisplay.prototype;_proto.createEl=function createEl$1(){var el=_Component.prototype.createEl.call(this,'div',{className:'vjs-live-control vjs-control'});this.contentEl_=createEl('div',{className:'vjs-live-display',innerHTML:"<span class=\"vjs-control-text\">"+this.localize('Stream Type')+"\xA0</span>"+this.localize('LIVE')},{'aria-live':'off'});el.appendChild(this.contentEl_);return el;};_proto.dispose=function dispose(){this.contentEl_=null;_Component.prototype.dispose.call(this);};_proto.updateShowing=function updateShowing(event){if(this.player().duration()===Infinity){this.show();}else{this.hide();}};return LiveDisplay;}(Component);Component.registerComponent('LiveDisplay',LiveDisplay);var SeekToLive=function(_Button){inheritsLoose(SeekToLive,_Button);function SeekToLive(player,options){var _this;_this=_Button.call(this,player,options)||this;_this.updateLiveEdgeStatus();if(_this.player_.liveTracker){_this.on(_this.player_.liveTracker,'liveedgechange',_this.updateLiveEdgeStatus);}
721return _this;}
722var _proto=SeekToLive.prototype;_proto.createEl=function createEl$1(){var el=_Button.prototype.createEl.call(this,'button',{className:'vjs-seek-to-live-control vjs-control'});this.textEl_=createEl('span',{className:'vjs-seek-to-live-text',innerHTML:this.localize('LIVE')},{'aria-hidden':'true'});el.appendChild(this.textEl_);return el;};_proto.updateLiveEdgeStatus=function updateLiveEdgeStatus(){if(!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()){this.setAttribute('aria-disabled',true);this.addClass('vjs-at-live-edge');this.controlText('Seek to live, currently playing live');}else{this.setAttribute('aria-disabled',false);this.removeClass('vjs-at-live-edge');this.controlText('Seek to live, currently behind live');}};_proto.handleClick=function handleClick(){this.player_.liveTracker.seekToLiveEdge();};_proto.dispose=function dispose(){if(this.player_.liveTracker){this.off(this.player_.liveTracker,'liveedgechange',this.updateLiveEdgeStatus);}
723this.textEl_=null;_Button.prototype.dispose.call(this);};return SeekToLive;}(Button);SeekToLive.prototype.controlText_='Seek to live, currently playing live';Component.registerComponent('SeekToLive',SeekToLive);var clamp=function clamp(number,min,max){number=Number(number);return Math.min(max,Math.max(min,isNaN(number)?min:number));};var Slider=function(_Component){inheritsLoose(Slider,_Component);function Slider(player,options){var _this;_this=_Component.call(this,player,options)||this;_this.bar=_this.getChild(_this.options_.barName);_this.vertical(!!_this.options_.vertical);_this.enable();return _this;}
724var _proto=Slider.prototype;_proto.enabled=function enabled(){return this.enabled_;};_proto.enable=function enable(){if(this.enabled()){return;}
725this.on('mousedown',this.handleMouseDown);this.on('touchstart',this.handleMouseDown);this.on('keydown',this.handleKeyDown);this.on('click',this.handleClick);this.on(this.player_,'controlsvisible',this.update);if(this.playerEvent){this.on(this.player_,this.playerEvent,this.update);}
726this.removeClass('disabled');this.setAttribute('tabindex',0);this.enabled_=true;};_proto.disable=function disable(){if(!this.enabled()){return;}
727var doc=this.bar.el_.ownerDocument;this.off('mousedown',this.handleMouseDown);this.off('touchstart',this.handleMouseDown);this.off('keydown',this.handleKeyDown);this.off('click',this.handleClick);this.off(this.player_,'controlsvisible',this.update);this.off(doc,'mousemove',this.handleMouseMove);this.off(doc,'mouseup',this.handleMouseUp);this.off(doc,'touchmove',this.handleMouseMove);this.off(doc,'touchend',this.handleMouseUp);this.removeAttribute('tabindex');this.addClass('disabled');if(this.playerEvent){this.off(this.player_,this.playerEvent,this.update);}
728this.enabled_=false;};_proto.createEl=function createEl(type,props,attributes){if(props===void 0){props={};}
729if(attributes===void 0){attributes={};}
730props.className=props.className+' vjs-slider';props=assign({tabIndex:0},props);attributes=assign({'role':'slider','aria-valuenow':0,'aria-valuemin':0,'aria-valuemax':100,'tabIndex':0},attributes);return _Component.prototype.createEl.call(this,type,props,attributes);};_proto.handleMouseDown=function handleMouseDown(event){var doc=this.bar.el_.ownerDocument;if(event.type==='mousedown'){event.preventDefault();}
731if(event.type==='touchstart'&&!IS_CHROME){event.preventDefault();}
732blockTextSelection();this.addClass('vjs-sliding');this.trigger('slideractive');this.on(doc,'mousemove',this.handleMouseMove);this.on(doc,'mouseup',this.handleMouseUp);this.on(doc,'touchmove',this.handleMouseMove);this.on(doc,'touchend',this.handleMouseUp);this.handleMouseMove(event);};_proto.handleMouseMove=function handleMouseMove(event){};_proto.handleMouseUp=function handleMouseUp(){var doc=this.bar.el_.ownerDocument;unblockTextSelection();this.removeClass('vjs-sliding');this.trigger('sliderinactive');this.off(doc,'mousemove',this.handleMouseMove);this.off(doc,'mouseup',this.handleMouseUp);this.off(doc,'touchmove',this.handleMouseMove);this.off(doc,'touchend',this.handleMouseUp);this.update();};_proto.update=function update(){var _this2=this;if(!this.el_||!this.bar){return;}
733var progress=this.getProgress();if(progress===this.progress_){return progress;}
734this.progress_=progress;this.requestAnimationFrame(function(){var sizeKey=_this2.vertical()?'height':'width';_this2.bar.el().style[sizeKey]=(progress*100).toFixed(2)+'%';});return progress;};_proto.getProgress=function getProgress(){return Number(clamp(this.getPercent(),0,1).toFixed(4));};_proto.calculateDistance=function calculateDistance(event){var position=getPointerPosition(this.el_,event);if(this.vertical()){return position.y;}
735return position.x;};_proto.handleKeyDown=function handleKeyDown(event){if(keycode.isEventKey(event,'Left')||keycode.isEventKey(event,'Down')){event.preventDefault();event.stopPropagation();this.stepBack();}else if(keycode.isEventKey(event,'Right')||keycode.isEventKey(event,'Up')){event.preventDefault();event.stopPropagation();this.stepForward();}else{_Component.prototype.handleKeyDown.call(this,event);}};_proto.handleClick=function handleClick(event){event.stopPropagation();event.preventDefault();};_proto.vertical=function vertical(bool){if(bool===undefined){return this.vertical_||false;}
736this.vertical_=!!bool;if(this.vertical_){this.addClass('vjs-slider-vertical');}else{this.addClass('vjs-slider-horizontal');}};return Slider;}(Component);Component.registerComponent('Slider',Slider);var percentify=function percentify(time,end){return clamp(time/end*100,0,100).toFixed(2)+'%';};var LoadProgressBar=function(_Component){inheritsLoose(LoadProgressBar,_Component);function LoadProgressBar(player,options){var _this;_this=_Component.call(this,player,options)||this;_this.partEls_=[];_this.on(player,'progress',_this.update);return _this;}
737var _proto=LoadProgressBar.prototype;_proto.createEl=function createEl$1(){var el=_Component.prototype.createEl.call(this,'div',{className:'vjs-load-progress'});var wrapper=createEl('span',{className:'vjs-control-text'});var loadedText=createEl('span',{textContent:this.localize('Loaded')});var separator=document.createTextNode(': ');this.percentageEl_=createEl('span',{className:'vjs-control-text-loaded-percentage',textContent:'0%'});el.appendChild(wrapper);wrapper.appendChild(loadedText);wrapper.appendChild(separator);wrapper.appendChild(this.percentageEl_);return el;};_proto.dispose=function dispose(){this.partEls_=null;this.percentageEl_=null;_Component.prototype.dispose.call(this);};_proto.update=function update(event){var _this2=this;this.requestAnimationFrame(function(){var liveTracker=_this2.player_.liveTracker;var buffered=_this2.player_.buffered();var duration=liveTracker&&liveTracker.isLive()?liveTracker.seekableEnd():_this2.player_.duration();var bufferedEnd=_this2.player_.bufferedEnd();var children=_this2.partEls_;var percent=percentify(bufferedEnd,duration);if(_this2.percent_!==percent){_this2.el_.style.width=percent;textContent(_this2.percentageEl_,percent);_this2.percent_=percent;}
738for(var i=0;i<buffered.length;i++){var start=buffered.start(i);var end=buffered.end(i);var part=children[i];if(!part){part=_this2.el_.appendChild(createEl());children[i]=part;}
739if(part.dataset.start===start&&part.dataset.end===end){continue;}
740part.dataset.start=start;part.dataset.end=end;part.style.left=percentify(start,bufferedEnd);part.style.width=percentify(end-start,bufferedEnd);}
741for(var _i=children.length;_i>buffered.length;_i--){_this2.el_.removeChild(children[_i-1]);}
742children.length=buffered.length;});};return LoadProgressBar;}(Component);Component.registerComponent('LoadProgressBar',LoadProgressBar);var TimeTooltip=function(_Component){inheritsLoose(TimeTooltip,_Component);function TimeTooltip(player,options){var _this;_this=_Component.call(this,player,options)||this;_this.update=throttle(bind(assertThisInitialized(_this),_this.update),UPDATE_REFRESH_INTERVAL);return _this;}
743var _proto=TimeTooltip.prototype;_proto.createEl=function createEl(){return _Component.prototype.createEl.call(this,'div',{className:'vjs-time-tooltip'},{'aria-hidden':'true'});};_proto.update=function update(seekBarRect,seekBarPoint,content){var tooltipRect=getBoundingClientRect(this.el_);var playerRect=getBoundingClientRect(this.player_.el());var seekBarPointPx=seekBarRect.width*seekBarPoint;if(!playerRect||!tooltipRect){return;}
744var spaceLeftOfPoint=seekBarRect.left-playerRect.left+seekBarPointPx;var spaceRightOfPoint=seekBarRect.width-seekBarPointPx+(playerRect.right-seekBarRect.right);var pullTooltipBy=tooltipRect.width/2;if(spaceLeftOfPoint<pullTooltipBy){pullTooltipBy+=pullTooltipBy-spaceLeftOfPoint;}else if(spaceRightOfPoint<pullTooltipBy){pullTooltipBy=spaceRightOfPoint;}
745if(pullTooltipBy<0){pullTooltipBy=0;}else if(pullTooltipBy>tooltipRect.width){pullTooltipBy=tooltipRect.width;}
746this.el_.style.right="-"+pullTooltipBy+"px";this.write(content);};_proto.write=function write(content){textContent(this.el_,content);};_proto.updateTime=function updateTime(seekBarRect,seekBarPoint,time,cb){var _this2=this;if(this.rafId_){this.cancelAnimationFrame(this.rafId_);}
747this.rafId_=this.requestAnimationFrame(function(){var content;var duration=_this2.player_.duration();if(_this2.player_.liveTracker&&_this2.player_.liveTracker.isLive()){var liveWindow=_this2.player_.liveTracker.liveWindow();var secondsBehind=liveWindow-seekBarPoint*liveWindow;content=(secondsBehind<1?'':'-')+formatTime(secondsBehind,liveWindow);}else{content=formatTime(time,duration);}
748_this2.update(seekBarRect,seekBarPoint,content);if(cb){cb();}});};return TimeTooltip;}(Component);Component.registerComponent('TimeTooltip',TimeTooltip);var PlayProgressBar=function(_Component){inheritsLoose(PlayProgressBar,_Component);function PlayProgressBar(player,options){var _this;_this=_Component.call(this,player,options)||this;_this.update=throttle(bind(assertThisInitialized(_this),_this.update),UPDATE_REFRESH_INTERVAL);return _this;}
749var _proto=PlayProgressBar.prototype;_proto.createEl=function createEl(){return _Component.prototype.createEl.call(this,'div',{className:'vjs-play-progress vjs-slider-bar'},{'aria-hidden':'true'});};_proto.update=function update(seekBarRect,seekBarPoint){var timeTooltip=this.getChild('timeTooltip');if(!timeTooltip){return;}
750var time=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();timeTooltip.updateTime(seekBarRect,seekBarPoint,time);};return PlayProgressBar;}(Component);PlayProgressBar.prototype.options_={children:[]};if(!IS_IOS&&!IS_ANDROID){PlayProgressBar.prototype.options_.children.push('timeTooltip');}
751Component.registerComponent('PlayProgressBar',PlayProgressBar);var MouseTimeDisplay=function(_Component){inheritsLoose(MouseTimeDisplay,_Component);function MouseTimeDisplay(player,options){var _this;_this=_Component.call(this,player,options)||this;_this.update=throttle(bind(assertThisInitialized(_this),_this.update),UPDATE_REFRESH_INTERVAL);return _this;}
752var _proto=MouseTimeDisplay.prototype;_proto.createEl=function createEl(){return _Component.prototype.createEl.call(this,'div',{className:'vjs-mouse-display'});};_proto.update=function update(seekBarRect,seekBarPoint){var _this2=this;var time=seekBarPoint*this.player_.duration();this.getChild('timeTooltip').updateTime(seekBarRect,seekBarPoint,time,function(){_this2.el_.style.left=seekBarRect.width*seekBarPoint+"px";});};return MouseTimeDisplay;}(Component);MouseTimeDisplay.prototype.options_={children:['timeTooltip']};Component.registerComponent('MouseTimeDisplay',MouseTimeDisplay);var STEP_SECONDS=5;var PAGE_KEY_MULTIPLIER=12;var SeekBar=function(_Slider){inheritsLoose(SeekBar,_Slider);function SeekBar(player,options){var _this;_this=_Slider.call(this,player,options)||this;_this.setEventHandlers_();return _this;}
753var _proto=SeekBar.prototype;_proto.setEventHandlers_=function setEventHandlers_(){this.update_=bind(this,this.update);this.update=throttle(this.update_,UPDATE_REFRESH_INTERVAL);this.on(this.player_,['ended','durationchange','timeupdate'],this.update);if(this.player_.liveTracker){this.on(this.player_.liveTracker,'liveedgechange',this.update);}
754this.updateInterval=null;this.on(this.player_,['playing'],this.enableInterval_);this.on(this.player_,['ended','pause','waiting'],this.disableInterval_);if('hidden'in document&&'visibilityState'in document){this.on(document,'visibilitychange',this.toggleVisibility_);}};_proto.toggleVisibility_=function toggleVisibility_(e){if(document.hidden){this.disableInterval_(e);}else{this.enableInterval_();this.update();}};_proto.enableInterval_=function enableInterval_(){if(this.updateInterval){return;}
755this.updateInterval=this.setInterval(this.update,UPDATE_REFRESH_INTERVAL);};_proto.disableInterval_=function disableInterval_(e){if(this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e.type!=='ended'){return;}
756if(!this.updateInterval){return;}
757this.clearInterval(this.updateInterval);this.updateInterval=null;};_proto.createEl=function createEl(){return _Slider.prototype.createEl.call(this,'div',{className:'vjs-progress-holder'},{'aria-label':this.localize('Progress Bar')});};_proto.update=function update(event){var _this2=this;var percent=_Slider.prototype.update.call(this);this.requestAnimationFrame(function(){var currentTime=_this2.player_.ended()?_this2.player_.duration():_this2.getCurrentTime_();var liveTracker=_this2.player_.liveTracker;var duration=_this2.player_.duration();if(liveTracker&&liveTracker.isLive()){duration=_this2.player_.liveTracker.liveCurrentTime();}
758if(_this2.percent_!==percent){_this2.el_.setAttribute('aria-valuenow',(percent*100).toFixed(2));_this2.percent_=percent;}
759if(_this2.currentTime_!==currentTime||_this2.duration_!==duration){_this2.el_.setAttribute('aria-valuetext',_this2.localize('progress bar timing: currentTime={1} duration={2}',[formatTime(currentTime,duration),formatTime(duration,duration)],'{1} of {2}'));_this2.currentTime_=currentTime;_this2.duration_=duration;}
760if(_this2.bar){_this2.bar.update(getBoundingClientRect(_this2.el()),_this2.getProgress());}});return percent;};_proto.getCurrentTime_=function getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();};_proto.getPercent=function getPercent(){var currentTime=this.getCurrentTime_();var percent;var liveTracker=this.player_.liveTracker;if(liveTracker&&liveTracker.isLive()){percent=(currentTime-liveTracker.seekableStart())/liveTracker.liveWindow();if(liveTracker.atLiveEdge()){percent=1;}}else{percent=currentTime/this.player_.duration();}
761return percent;};_proto.handleMouseDown=function handleMouseDown(event){if(!isSingleLeftClick(event)){return;}
762event.stopPropagation();this.player_.scrubbing(true);this.videoWasPlaying=!this.player_.paused();this.player_.pause();_Slider.prototype.handleMouseDown.call(this,event);};_proto.handleMouseMove=function handleMouseMove(event){if(!isSingleLeftClick(event)){return;}
763var newTime;var distance=this.calculateDistance(event);var liveTracker=this.player_.liveTracker;if(!liveTracker||!liveTracker.isLive()){newTime=distance*this.player_.duration();if(newTime===this.player_.duration()){newTime=newTime-0.1;}}else{if(distance>=0.99){liveTracker.seekToLiveEdge();return;}
764var seekableStart=liveTracker.seekableStart();var seekableEnd=liveTracker.liveCurrentTime();newTime=seekableStart+distance*liveTracker.liveWindow();if(newTime>=seekableEnd){newTime=seekableEnd;}
765if(newTime<=seekableStart){newTime=seekableStart+0.1;}
766if(newTime===Infinity){return;}}
767this.player_.currentTime(newTime);};_proto.enable=function enable(){_Slider.prototype.enable.call(this);var mouseTimeDisplay=this.getChild('mouseTimeDisplay');if(!mouseTimeDisplay){return;}
768mouseTimeDisplay.show();};_proto.disable=function disable(){_Slider.prototype.disable.call(this);var mouseTimeDisplay=this.getChild('mouseTimeDisplay');if(!mouseTimeDisplay){return;}
769mouseTimeDisplay.hide();};_proto.handleMouseUp=function handleMouseUp(event){_Slider.prototype.handleMouseUp.call(this,event);if(event){event.stopPropagation();}
770this.player_.scrubbing(false);this.player_.trigger({type:'timeupdate',target:this,manuallyTriggered:true});if(this.videoWasPlaying){silencePromise(this.player_.play());}else{this.update_();}};_proto.stepForward=function stepForward(){this.player_.currentTime(this.player_.currentTime()+STEP_SECONDS);};_proto.stepBack=function stepBack(){this.player_.currentTime(this.player_.currentTime()-STEP_SECONDS);};_proto.handleAction=function handleAction(event){if(this.player_.paused()){this.player_.play();}else{this.player_.pause();}};_proto.handleKeyDown=function handleKeyDown(event){if(keycode.isEventKey(event,'Space')||keycode.isEventKey(event,'Enter')){event.preventDefault();event.stopPropagation();this.handleAction(event);}else if(keycode.isEventKey(event,'Home')){event.preventDefault();event.stopPropagation();this.player_.currentTime(0);}else if(keycode.isEventKey(event,'End')){event.preventDefault();event.stopPropagation();this.player_.currentTime(this.player_.duration());}else if(/^[0-9]$/.test(keycode(event))){event.preventDefault();event.stopPropagation();var gotoFraction=(keycode.codes[keycode(event)]-keycode.codes['0'])*10.0/100.0;this.player_.currentTime(this.player_.duration()*gotoFraction);}else if(keycode.isEventKey(event,'PgDn')){event.preventDefault();event.stopPropagation();this.player_.currentTime(this.player_.currentTime()-STEP_SECONDS*PAGE_KEY_MULTIPLIER);}else if(keycode.isEventKey(event,'PgUp')){event.preventDefault();event.stopPropagation();this.player_.currentTime(this.player_.currentTime()+STEP_SECONDS*PAGE_KEY_MULTIPLIER);}else{_Slider.prototype.handleKeyDown.call(this,event);}};return SeekBar;}(Slider);SeekBar.prototype.options_={children:['loadProgressBar','playProgressBar'],barName:'playProgressBar'};if(!IS_IOS&&!IS_ANDROID){SeekBar.prototype.options_.children.splice(1,0,'mouseTimeDisplay');}
771Component.registerComponent('SeekBar',SeekBar);var ProgressControl=function(_Component){inheritsLoose(ProgressControl,_Component);function ProgressControl(player,options){var _this;_this=_Component.call(this,player,options)||this;_this.handleMouseMove=throttle(bind(assertThisInitialized(_this),_this.handleMouseMove),UPDATE_REFRESH_INTERVAL);_this.throttledHandleMouseSeek=throttle(bind(assertThisInitialized(_this),_this.handleMouseSeek),UPDATE_REFRESH_INTERVAL);_this.enable();return _this;}
772var _proto=ProgressControl.prototype;_proto.createEl=function createEl(){return _Component.prototype.createEl.call(this,'div',{className:'vjs-progress-control vjs-control'});};_proto.handleMouseMove=function handleMouseMove(event){var seekBar=this.getChild('seekBar');if(!seekBar){return;}
773var playProgressBar=seekBar.getChild('playProgressBar');var mouseTimeDisplay=seekBar.getChild('mouseTimeDisplay');if(!playProgressBar&&!mouseTimeDisplay){return;}
774var seekBarEl=seekBar.el();var seekBarRect=getBoundingClientRect(seekBarEl);var seekBarPoint=getPointerPosition(seekBarEl,event).x;seekBarPoint=clamp(0,1,seekBarPoint);if(mouseTimeDisplay){mouseTimeDisplay.update(seekBarRect,seekBarPoint);}
775if(playProgressBar){playProgressBar.update(seekBarRect,seekBar.getProgress());}};_proto.handleMouseSeek=function handleMouseSeek(event){var seekBar=this.getChild('seekBar');if(seekBar){seekBar.handleMouseMove(event);}};_proto.enabled=function enabled(){return this.enabled_;};_proto.disable=function disable(){this.children().forEach(function(child){return child.disable&&child.disable();});if(!this.enabled()){return;}
776this.off(['mousedown','touchstart'],this.handleMouseDown);this.off(this.el_,'mousemove',this.handleMouseMove);this.handleMouseUp();this.addClass('disabled');this.enabled_=false;};_proto.enable=function enable(){this.children().forEach(function(child){return child.enable&&child.enable();});if(this.enabled()){return;}
777this.on(['mousedown','touchstart'],this.handleMouseDown);this.on(this.el_,'mousemove',this.handleMouseMove);this.removeClass('disabled');this.enabled_=true;};_proto.handleMouseDown=function handleMouseDown(event){var doc=this.el_.ownerDocument;var seekBar=this.getChild('seekBar');if(seekBar){seekBar.handleMouseDown(event);}
778this.on(doc,'mousemove',this.throttledHandleMouseSeek);this.on(doc,'touchmove',this.throttledHandleMouseSeek);this.on(doc,'mouseup',this.handleMouseUp);this.on(doc,'touchend',this.handleMouseUp);};_proto.handleMouseUp=function handleMouseUp(event){var doc=this.el_.ownerDocument;var seekBar=this.getChild('seekBar');if(seekBar){seekBar.handleMouseUp(event);}
779this.off(doc,'mousemove',this.throttledHandleMouseSeek);this.off(doc,'touchmove',this.throttledHandleMouseSeek);this.off(doc,'mouseup',this.handleMouseUp);this.off(doc,'touchend',this.handleMouseUp);};return ProgressControl;}(Component);ProgressControl.prototype.options_={children:['seekBar']};Component.registerComponent('ProgressControl',ProgressControl);var PictureInPictureToggle=function(_Button){inheritsLoose(PictureInPictureToggle,_Button);function PictureInPictureToggle(player,options){var _this;_this=_Button.call(this,player,options)||this;_this.on(player,['enterpictureinpicture','leavepictureinpicture'],_this.handlePictureInPictureChange);if(!document.pictureInPictureEnabled){_this.disable();}
780return _this;}
781var _proto=PictureInPictureToggle.prototype;_proto.buildCSSClass=function buildCSSClass(){return "vjs-picture-in-picture-control "+_Button.prototype.buildCSSClass.call(this);};_proto.handlePictureInPictureChange=function handlePictureInPictureChange(event){if(this.player_.isInPictureInPicture()){this.controlText('Exit Picture-in-Picture');}else{this.controlText('Picture-in-Picture');}};_proto.handleClick=function handleClick(event){if(!this.player_.isInPictureInPicture()){this.player_.requestPictureInPicture();}else{this.player_.exitPictureInPicture();}};return PictureInPictureToggle;}(Button);PictureInPictureToggle.prototype.controlText_='Picture-in-Picture';Component.registerComponent('PictureInPictureToggle',PictureInPictureToggle);var FullscreenToggle=function(_Button){inheritsLoose(FullscreenToggle,_Button);function FullscreenToggle(player,options){var _this;_this=_Button.call(this,player,options)||this;_this.on(player,'fullscreenchange',_this.handleFullscreenChange);if(document[player.fsApi_.fullscreenEnabled]===false){_this.disable();}
782return _this;}
783var _proto=FullscreenToggle.prototype;_proto.buildCSSClass=function buildCSSClass(){return "vjs-fullscreen-control "+_Button.prototype.buildCSSClass.call(this);};_proto.handleFullscreenChange=function handleFullscreenChange(event){if(this.player_.isFullscreen()){this.controlText('Non-Fullscreen');}else{this.controlText('Fullscreen');}};_proto.handleClick=function handleClick(event){if(!this.player_.isFullscreen()){this.player_.requestFullscreen();}else{this.player_.exitFullscreen();}};return FullscreenToggle;}(Button);FullscreenToggle.prototype.controlText_='Fullscreen';Component.registerComponent('FullscreenToggle',FullscreenToggle);var checkVolumeSupport=function checkVolumeSupport(self,player){if(player.tech_&&!player.tech_.featuresVolumeControl){self.addClass('vjs-hidden');}
784self.on(player,'loadstart',function(){if(!player.tech_.featuresVolumeControl){self.addClass('vjs-hidden');}else{self.removeClass('vjs-hidden');}});};var VolumeLevel=function(_Component){inheritsLoose(VolumeLevel,_Component);function VolumeLevel(){return _Component.apply(this,arguments)||this;}
785var _proto=VolumeLevel.prototype;_proto.createEl=function createEl(){return _Component.prototype.createEl.call(this,'div',{className:'vjs-volume-level',innerHTML:'<span class="vjs-control-text"></span>'});};return VolumeLevel;}(Component);Component.registerComponent('VolumeLevel',VolumeLevel);var VolumeBar=function(_Slider){inheritsLoose(VolumeBar,_Slider);function VolumeBar(player,options){var _this;_this=_Slider.call(this,player,options)||this;_this.on('slideractive',_this.updateLastVolume_);_this.on(player,'volumechange',_this.updateARIAAttributes);player.ready(function(){return _this.updateARIAAttributes();});return _this;}
786var _proto=VolumeBar.prototype;_proto.createEl=function createEl(){return _Slider.prototype.createEl.call(this,'div',{className:'vjs-volume-bar vjs-slider-bar'},{'aria-label':this.localize('Volume Level'),'aria-live':'polite'});};_proto.handleMouseDown=function handleMouseDown(event){if(!isSingleLeftClick(event)){return;}
787_Slider.prototype.handleMouseDown.call(this,event);};_proto.handleMouseMove=function handleMouseMove(event){if(!isSingleLeftClick(event)){return;}
788this.checkMuted();this.player_.volume(this.calculateDistance(event));};_proto.checkMuted=function checkMuted(){if(this.player_.muted()){this.player_.muted(false);}};_proto.getPercent=function getPercent(){if(this.player_.muted()){return 0;}
789return this.player_.volume();};_proto.stepForward=function stepForward(){this.checkMuted();this.player_.volume(this.player_.volume()+0.1);};_proto.stepBack=function stepBack(){this.checkMuted();this.player_.volume(this.player_.volume()-0.1);};_proto.updateARIAAttributes=function updateARIAAttributes(event){var ariaValue=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute('aria-valuenow',ariaValue);this.el_.setAttribute('aria-valuetext',ariaValue+'%');};_proto.volumeAsPercentage_=function volumeAsPercentage_(){return Math.round(this.player_.volume()*100);};_proto.updateLastVolume_=function updateLastVolume_(){var _this2=this;var volumeBeforeDrag=this.player_.volume();this.one('sliderinactive',function(){if(_this2.player_.volume()===0){_this2.player_.lastVolume_(volumeBeforeDrag);}});};return VolumeBar;}(Slider);VolumeBar.prototype.options_={children:['volumeLevel'],barName:'volumeLevel'};VolumeBar.prototype.playerEvent='volumechange';Component.registerComponent('VolumeBar',VolumeBar);var VolumeControl=function(_Component){inheritsLoose(VolumeControl,_Component);function VolumeControl(player,options){var _this;if(options===void 0){options={};}
790options.vertical=options.vertical||false;if(typeof options.volumeBar==='undefined'||isPlain(options.volumeBar)){options.volumeBar=options.volumeBar||{};options.volumeBar.vertical=options.vertical;}
791_this=_Component.call(this,player,options)||this;checkVolumeSupport(assertThisInitialized(_this),player);_this.throttledHandleMouseMove=throttle(bind(assertThisInitialized(_this),_this.handleMouseMove),UPDATE_REFRESH_INTERVAL);_this.on('mousedown',_this.handleMouseDown);_this.on('touchstart',_this.handleMouseDown);_this.on(_this.volumeBar,['focus','slideractive'],function(){_this.volumeBar.addClass('vjs-slider-active');_this.addClass('vjs-slider-active');_this.trigger('slideractive');});_this.on(_this.volumeBar,['blur','sliderinactive'],function(){_this.volumeBar.removeClass('vjs-slider-active');_this.removeClass('vjs-slider-active');_this.trigger('sliderinactive');});return _this;}
792var _proto=VolumeControl.prototype;_proto.createEl=function createEl(){var orientationClass='vjs-volume-horizontal';if(this.options_.vertical){orientationClass='vjs-volume-vertical';}
793return _Component.prototype.createEl.call(this,'div',{className:"vjs-volume-control vjs-control "+orientationClass});};_proto.handleMouseDown=function handleMouseDown(event){var doc=this.el_.ownerDocument;this.on(doc,'mousemove',this.throttledHandleMouseMove);this.on(doc,'touchmove',this.throttledHandleMouseMove);this.on(doc,'mouseup',this.handleMouseUp);this.on(doc,'touchend',this.handleMouseUp);};_proto.handleMouseUp=function handleMouseUp(event){var doc=this.el_.ownerDocument;this.off(doc,'mousemove',this.throttledHandleMouseMove);this.off(doc,'touchmove',this.throttledHandleMouseMove);this.off(doc,'mouseup',this.handleMouseUp);this.off(doc,'touchend',this.handleMouseUp);};_proto.handleMouseMove=function handleMouseMove(event){this.volumeBar.handleMouseMove(event);};return VolumeControl;}(Component);VolumeControl.prototype.options_={children:['volumeBar']};Component.registerComponent('VolumeControl',VolumeControl);var checkMuteSupport=function checkMuteSupport(self,player){if(player.tech_&&!player.tech_.featuresMuteControl){self.addClass('vjs-hidden');}
794self.on(player,'loadstart',function(){if(!player.tech_.featuresMuteControl){self.addClass('vjs-hidden');}else{self.removeClass('vjs-hidden');}});};var MuteToggle=function(_Button){inheritsLoose(MuteToggle,_Button);function MuteToggle(player,options){var _this;_this=_Button.call(this,player,options)||this;checkMuteSupport(assertThisInitialized(_this),player);_this.on(player,['loadstart','volumechange'],_this.update);return _this;}
795var _proto=MuteToggle.prototype;_proto.buildCSSClass=function buildCSSClass(){return "vjs-mute-control "+_Button.prototype.buildCSSClass.call(this);};_proto.handleClick=function handleClick(event){var vol=this.player_.volume();var lastVolume=this.player_.lastVolume_();if(vol===0){var volumeToSet=lastVolume<0.1?0.1:lastVolume;this.player_.volume(volumeToSet);this.player_.muted(false);}else{this.player_.muted(this.player_.muted()?false:true);}};_proto.update=function update(event){this.updateIcon_();this.updateControlText_();};_proto.updateIcon_=function updateIcon_(){var vol=this.player_.volume();var level=3;if(IS_IOS&&this.player_.tech_&&this.player_.tech_.el_){this.player_.muted(this.player_.tech_.el_.muted);}
796if(vol===0||this.player_.muted()){level=0;}else if(vol<0.33){level=1;}else if(vol<0.67){level=2;}
797for(var i=0;i<4;i++){removeClass(this.el_,"vjs-vol-"+i);}
798addClass(this.el_,"vjs-vol-"+level);};_proto.updateControlText_=function updateControlText_(){var soundOff=this.player_.muted()||this.player_.volume()===0;var text=soundOff?'Unmute':'Mute';if(this.controlText()!==text){this.controlText(text);}};return MuteToggle;}(Button);MuteToggle.prototype.controlText_='Mute';Component.registerComponent('MuteToggle',MuteToggle);var VolumePanel=function(_Component){inheritsLoose(VolumePanel,_Component);function VolumePanel(player,options){var _this;if(options===void 0){options={};}
799if(typeof options.inline!=='undefined'){options.inline=options.inline;}else{options.inline=true;}
800if(typeof options.volumeControl==='undefined'||isPlain(options.volumeControl)){options.volumeControl=options.volumeControl||{};options.volumeControl.vertical=!options.inline;}
801_this=_Component.call(this,player,options)||this;_this.on(player,['loadstart'],_this.volumePanelState_);_this.on(_this.muteToggle,'keyup',_this.handleKeyPress);_this.on(_this.volumeControl,'keyup',_this.handleVolumeControlKeyUp);_this.on('keydown',_this.handleKeyPress);_this.on('mouseover',_this.handleMouseOver);_this.on('mouseout',_this.handleMouseOut);_this.on(_this.volumeControl,['slideractive'],_this.sliderActive_);_this.on(_this.volumeControl,['sliderinactive'],_this.sliderInactive_);return _this;}
802var _proto=VolumePanel.prototype;_proto.sliderActive_=function sliderActive_(){this.addClass('vjs-slider-active');};_proto.sliderInactive_=function sliderInactive_(){this.removeClass('vjs-slider-active');};_proto.volumePanelState_=function volumePanelState_(){if(this.volumeControl.hasClass('vjs-hidden')&&this.muteToggle.hasClass('vjs-hidden')){this.addClass('vjs-hidden');}
803if(this.volumeControl.hasClass('vjs-hidden')&&!this.muteToggle.hasClass('vjs-hidden')){this.addClass('vjs-mute-toggle-only');}};_proto.createEl=function createEl(){var orientationClass='vjs-volume-panel-horizontal';if(!this.options_.inline){orientationClass='vjs-volume-panel-vertical';}
804return _Component.prototype.createEl.call(this,'div',{className:"vjs-volume-panel vjs-control "+orientationClass});};_proto.dispose=function dispose(){this.handleMouseOut();_Component.prototype.dispose.call(this);};_proto.handleVolumeControlKeyUp=function handleVolumeControlKeyUp(event){if(keycode.isEventKey(event,'Esc')){this.muteToggle.focus();}};_proto.handleMouseOver=function handleMouseOver(event){this.addClass('vjs-hover');on(document,'keyup',bind(this,this.handleKeyPress));};_proto.handleMouseOut=function handleMouseOut(event){this.removeClass('vjs-hover');off(document,'keyup',bind(this,this.handleKeyPress));};_proto.handleKeyPress=function handleKeyPress(event){if(keycode.isEventKey(event,'Esc')){this.handleMouseOut();}};return VolumePanel;}(Component);VolumePanel.prototype.options_={children:['muteToggle','volumeControl']};Component.registerComponent('VolumePanel',VolumePanel);var Menu=function(_Component){inheritsLoose(Menu,_Component);function Menu(player,options){var _this;_this=_Component.call(this,player,options)||this;if(options){_this.menuButton_=options.menuButton;}
805_this.focusedChild_=-1;_this.on('keydown',_this.handleKeyDown);_this.boundHandleBlur_=bind(assertThisInitialized(_this),_this.handleBlur);_this.boundHandleTapClick_=bind(assertThisInitialized(_this),_this.handleTapClick);return _this;}
806var _proto=Menu.prototype;_proto.addEventListenerForItem=function addEventListenerForItem(component){if(!(component instanceof Component)){return;}
807this.on(component,'blur',this.boundHandleBlur_);this.on(component,['tap','click'],this.boundHandleTapClick_);};_proto.removeEventListenerForItem=function removeEventListenerForItem(component){if(!(component instanceof Component)){return;}
808this.off(component,'blur',this.boundHandleBlur_);this.off(component,['tap','click'],this.boundHandleTapClick_);};_proto.removeChild=function removeChild(component){if(typeof component==='string'){component=this.getChild(component);}
809this.removeEventListenerForItem(component);_Component.prototype.removeChild.call(this,component);};_proto.addItem=function addItem(component){var childComponent=this.addChild(component);if(childComponent){this.addEventListenerForItem(childComponent);}};_proto.createEl=function createEl$1(){var contentElType=this.options_.contentElType||'ul';this.contentEl_=createEl(contentElType,{className:'vjs-menu-content'});this.contentEl_.setAttribute('role','menu');var el=_Component.prototype.createEl.call(this,'div',{append:this.contentEl_,className:'vjs-menu'});el.appendChild(this.contentEl_);on(el,'click',function(event){event.preventDefault();event.stopImmediatePropagation();});return el;};_proto.dispose=function dispose(){this.contentEl_=null;this.boundHandleBlur_=null;this.boundHandleTapClick_=null;_Component.prototype.dispose.call(this);};_proto.handleBlur=function handleBlur(event){var relatedTarget=event.relatedTarget||document.activeElement;if(!this.children().some(function(element){return element.el()===relatedTarget;})){var btn=this.menuButton_;if(btn&&btn.buttonPressed_&&relatedTarget!==btn.el().firstChild){btn.unpressButton();}}};_proto.handleTapClick=function handleTapClick(event){if(this.menuButton_){this.menuButton_.unpressButton();var childComponents=this.children();if(!Array.isArray(childComponents)){return;}
810var foundComponent=childComponents.filter(function(component){return component.el()===event.target;})[0];if(!foundComponent){return;}
811if(foundComponent.name()!=='CaptionSettingsMenuItem'){this.menuButton_.focus();}}};_proto.handleKeyDown=function handleKeyDown(event){if(keycode.isEventKey(event,'Left')||keycode.isEventKey(event,'Down')){event.preventDefault();event.stopPropagation();this.stepForward();}else if(keycode.isEventKey(event,'Right')||keycode.isEventKey(event,'Up')){event.preventDefault();event.stopPropagation();this.stepBack();}};_proto.stepForward=function stepForward(){var stepChild=0;if(this.focusedChild_!==undefined){stepChild=this.focusedChild_+1;}
812this.focus(stepChild);};_proto.stepBack=function stepBack(){var stepChild=0;if(this.focusedChild_!==undefined){stepChild=this.focusedChild_-1;}
813this.focus(stepChild);};_proto.focus=function focus(item){if(item===void 0){item=0;}
814var children=this.children().slice();var haveTitle=children.length&&children[0].className&&/vjs-menu-title/.test(children[0].className);if(haveTitle){children.shift();}
815if(children.length>0){if(item<0){item=0;}else if(item>=children.length){item=children.length-1;}
816this.focusedChild_=item;children[item].el_.focus();}};return Menu;}(Component);Component.registerComponent('Menu',Menu);var MenuButton=function(_Component){inheritsLoose(MenuButton,_Component);function MenuButton(player,options){var _this;if(options===void 0){options={};}
817_this=_Component.call(this,player,options)||this;_this.menuButton_=new Button(player,options);_this.menuButton_.controlText(_this.controlText_);_this.menuButton_.el_.setAttribute('aria-haspopup','true');var buttonClass=Button.prototype.buildCSSClass();_this.menuButton_.el_.className=_this.buildCSSClass()+' '+buttonClass;_this.menuButton_.removeClass('vjs-control');_this.addChild(_this.menuButton_);_this.update();_this.enabled_=true;_this.on(_this.menuButton_,'tap',_this.handleClick);_this.on(_this.menuButton_,'click',_this.handleClick);_this.on(_this.menuButton_,'keydown',_this.handleKeyDown);_this.on(_this.menuButton_,'mouseenter',function(){_this.addClass('vjs-hover');_this.menu.show();on(document,'keyup',bind(assertThisInitialized(_this),_this.handleMenuKeyUp));});_this.on('mouseleave',_this.handleMouseLeave);_this.on('keydown',_this.handleSubmenuKeyDown);return _this;}
818var _proto=MenuButton.prototype;_proto.update=function update(){var menu=this.createMenu();if(this.menu){this.menu.dispose();this.removeChild(this.menu);}
819this.menu=menu;this.addChild(menu);this.buttonPressed_=false;this.menuButton_.el_.setAttribute('aria-expanded','false');if(this.items&&this.items.length<=this.hideThreshold_){this.hide();}else{this.show();}};_proto.createMenu=function createMenu(){var menu=new Menu(this.player_,{menuButton:this});this.hideThreshold_=0;if(this.options_.title){var titleEl=createEl('li',{className:'vjs-menu-title',innerHTML:toTitleCase(this.options_.title),tabIndex:-1});this.hideThreshold_+=1;var titleComponent=new Component(this.player_,{el:titleEl});menu.addItem(titleComponent);}
820this.items=this.createItems();if(this.items){for(var i=0;i<this.items.length;i++){menu.addItem(this.items[i]);}}
821return menu;};_proto.createItems=function createItems(){};_proto.createEl=function createEl(){return _Component.prototype.createEl.call(this,'div',{className:this.buildWrapperCSSClass()},{});};_proto.buildWrapperCSSClass=function buildWrapperCSSClass(){var menuButtonClass='vjs-menu-button';if(this.options_.inline===true){menuButtonClass+='-inline';}else{menuButtonClass+='-popup';}
822var buttonClass=Button.prototype.buildCSSClass();return "vjs-menu-button "+menuButtonClass+" "+buttonClass+" "+_Component.prototype.buildCSSClass.call(this);};_proto.buildCSSClass=function buildCSSClass(){var menuButtonClass='vjs-menu-button';if(this.options_.inline===true){menuButtonClass+='-inline';}else{menuButtonClass+='-popup';}
823return "vjs-menu-button "+menuButtonClass+" "+_Component.prototype.buildCSSClass.call(this);};_proto.controlText=function controlText(text,el){if(el===void 0){el=this.menuButton_.el();}
824return this.menuButton_.controlText(text,el);};_proto.dispose=function dispose(){this.handleMouseLeave();_Component.prototype.dispose.call(this);};_proto.handleClick=function handleClick(event){if(this.buttonPressed_){this.unpressButton();}else{this.pressButton();}};_proto.handleMouseLeave=function handleMouseLeave(event){this.removeClass('vjs-hover');off(document,'keyup',bind(this,this.handleMenuKeyUp));};_proto.focus=function focus(){this.menuButton_.focus();};_proto.blur=function blur(){this.menuButton_.blur();};_proto.handleKeyDown=function handleKeyDown(event){if(keycode.isEventKey(event,'Esc')||keycode.isEventKey(event,'Tab')){if(this.buttonPressed_){this.unpressButton();}
825if(!keycode.isEventKey(event,'Tab')){event.preventDefault();this.menuButton_.focus();}}else if(keycode.isEventKey(event,'Up')||keycode.isEventKey(event,'Down')){if(!this.buttonPressed_){event.preventDefault();this.pressButton();}}};_proto.handleMenuKeyUp=function handleMenuKeyUp(event){if(keycode.isEventKey(event,'Esc')||keycode.isEventKey(event,'Tab')){this.removeClass('vjs-hover');}};_proto.handleSubmenuKeyPress=function handleSubmenuKeyPress(event){this.handleSubmenuKeyDown(event);};_proto.handleSubmenuKeyDown=function handleSubmenuKeyDown(event){if(keycode.isEventKey(event,'Esc')||keycode.isEventKey(event,'Tab')){if(this.buttonPressed_){this.unpressButton();}
826if(!keycode.isEventKey(event,'Tab')){event.preventDefault();this.menuButton_.focus();}}};_proto.pressButton=function pressButton(){if(this.enabled_){this.buttonPressed_=true;this.menu.show();this.menu.lockShowing();this.menuButton_.el_.setAttribute('aria-expanded','true');if(IS_IOS&&isInFrame()){return;}
827this.menu.focus();}};_proto.unpressButton=function unpressButton(){if(this.enabled_){this.buttonPressed_=false;this.menu.unlockShowing();this.menu.hide();this.menuButton_.el_.setAttribute('aria-expanded','false');}};_proto.disable=function disable(){this.unpressButton();this.enabled_=false;this.addClass('vjs-disabled');this.menuButton_.disable();};_proto.enable=function enable(){this.enabled_=true;this.removeClass('vjs-disabled');this.menuButton_.enable();};return MenuButton;}(Component);Component.registerComponent('MenuButton',MenuButton);var TrackButton=function(_MenuButton){inheritsLoose(TrackButton,_MenuButton);function TrackButton(player,options){var _this;var tracks=options.tracks;_this=_MenuButton.call(this,player,options)||this;if(_this.items.length<=1){_this.hide();}
828if(!tracks){return assertThisInitialized(_this);}
829var updateHandler=bind(assertThisInitialized(_this),_this.update);tracks.addEventListener('removetrack',updateHandler);tracks.addEventListener('addtrack',updateHandler);_this.player_.on('ready',updateHandler);_this.player_.on('dispose',function(){tracks.removeEventListener('removetrack',updateHandler);tracks.removeEventListener('addtrack',updateHandler);});return _this;}
830return TrackButton;}(MenuButton);Component.registerComponent('TrackButton',TrackButton);var MenuKeys=['Tab','Esc','Up','Down','Right','Left'];var MenuItem=function(_ClickableComponent){inheritsLoose(MenuItem,_ClickableComponent);function MenuItem(player,options){var _this;_this=_ClickableComponent.call(this,player,options)||this;_this.selectable=options.selectable;_this.isSelected_=options.selected||false;_this.multiSelectable=options.multiSelectable;_this.selected(_this.isSelected_);if(_this.selectable){if(_this.multiSelectable){_this.el_.setAttribute('role','menuitemcheckbox');}else{_this.el_.setAttribute('role','menuitemradio');}}else{_this.el_.setAttribute('role','menuitem');}
831return _this;}
832var _proto=MenuItem.prototype;_proto.createEl=function createEl(type,props,attrs){this.nonIconControl=true;return _ClickableComponent.prototype.createEl.call(this,'li',assign({className:'vjs-menu-item',innerHTML:"<span class=\"vjs-menu-item-text\">"+this.localize(this.options_.label)+"</span>",tabIndex:-1},props),attrs);};_proto.handleKeyDown=function handleKeyDown(event){if(!MenuKeys.some(function(key){return keycode.isEventKey(event,key);})){_ClickableComponent.prototype.handleKeyDown.call(this,event);}};_proto.handleClick=function handleClick(event){this.selected(true);};_proto.selected=function selected(_selected){if(this.selectable){if(_selected){this.addClass('vjs-selected');this.el_.setAttribute('aria-checked','true');this.controlText(', selected');this.isSelected_=true;}else{this.removeClass('vjs-selected');this.el_.setAttribute('aria-checked','false');this.controlText('');this.isSelected_=false;}}};return MenuItem;}(ClickableComponent);Component.registerComponent('MenuItem',MenuItem);var TextTrackMenuItem=function(_MenuItem){inheritsLoose(TextTrackMenuItem,_MenuItem);function TextTrackMenuItem(player,options){var _this;var track=options.track;var tracks=player.textTracks();options.label=track.label||track.language||'Unknown';options.selected=track.mode==='showing';_this=_MenuItem.call(this,player,options)||this;_this.track=track;_this.kinds=(options.kinds||[options.kind||_this.track.kind]).filter(Boolean);var changeHandler=function changeHandler(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}
833_this.handleTracksChange.apply(assertThisInitialized(_this),args);};var selectedLanguageChangeHandler=function selectedLanguageChangeHandler(){for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2];}
834_this.handleSelectedLanguageChange.apply(assertThisInitialized(_this),args);};player.on(['loadstart','texttrackchange'],changeHandler);tracks.addEventListener('change',changeHandler);tracks.addEventListener('selectedlanguagechange',selectedLanguageChangeHandler);_this.on('dispose',function(){player.off(['loadstart','texttrackchange'],changeHandler);tracks.removeEventListener('change',changeHandler);tracks.removeEventListener('selectedlanguagechange',selectedLanguageChangeHandler);});if(tracks.onchange===undefined){var event;_this.on(['tap','click'],function(){if(typeof window$3.Event!=='object'){try{event=new window$3.Event('change');}catch(err){}}
835if(!event){event=document.createEvent('Event');event.initEvent('change',true,true);}
836tracks.dispatchEvent(event);});}
837_this.handleTracksChange();return _this;}
838var _proto=TextTrackMenuItem.prototype;_proto.handleClick=function handleClick(event){var referenceTrack=this.track;var tracks=this.player_.textTracks();_MenuItem.prototype.handleClick.call(this,event);if(!tracks){return;}
839for(var i=0;i<tracks.length;i++){var track=tracks[i];if(this.kinds.indexOf(track.kind)===-1){continue;}
840if(track===referenceTrack){if(track.mode!=='showing'){track.mode='showing';}}else if(track.mode!=='disabled'){track.mode='disabled';}}};_proto.handleTracksChange=function handleTracksChange(event){var shouldBeSelected=this.track.mode==='showing';if(shouldBeSelected!==this.isSelected_){this.selected(shouldBeSelected);}};_proto.handleSelectedLanguageChange=function handleSelectedLanguageChange(event){if(this.track.mode==='showing'){var selectedLanguage=this.player_.cache_.selectedLanguage;if(selectedLanguage&&selectedLanguage.enabled&&selectedLanguage.language===this.track.language&&selectedLanguage.kind!==this.track.kind){return;}
841this.player_.cache_.selectedLanguage={enabled:true,language:this.track.language,kind:this.track.kind};}};_proto.dispose=function dispose(){this.track=null;_MenuItem.prototype.dispose.call(this);};return TextTrackMenuItem;}(MenuItem);Component.registerComponent('TextTrackMenuItem',TextTrackMenuItem);var OffTextTrackMenuItem=function(_TextTrackMenuItem){inheritsLoose(OffTextTrackMenuItem,_TextTrackMenuItem);function OffTextTrackMenuItem(player,options){options.track={player:player,kind:options.kind,kinds:options.kinds,"default":false,mode:'disabled'};if(!options.kinds){options.kinds=[options.kind];}
842if(options.label){options.track.label=options.label;}else{options.track.label=options.kinds.join(' and ')+' off';}
843options.selectable=true;options.multiSelectable=false;return _TextTrackMenuItem.call(this,player,options)||this;}
844var _proto=OffTextTrackMenuItem.prototype;_proto.handleTracksChange=function handleTracksChange(event){var tracks=this.player().textTracks();var shouldBeSelected=true;for(var i=0,l=tracks.length;i<l;i++){var track=tracks[i];if(this.options_.kinds.indexOf(track.kind)>-1&&track.mode==='showing'){shouldBeSelected=false;break;}}
845if(shouldBeSelected!==this.isSelected_){this.selected(shouldBeSelected);}};_proto.handleSelectedLanguageChange=function handleSelectedLanguageChange(event){var tracks=this.player().textTracks();var allHidden=true;for(var i=0,l=tracks.length;i<l;i++){var track=tracks[i];if(['captions','descriptions','subtitles'].indexOf(track.kind)>-1&&track.mode==='showing'){allHidden=false;break;}}
846if(allHidden){this.player_.cache_.selectedLanguage={enabled:false};}};return OffTextTrackMenuItem;}(TextTrackMenuItem);Component.registerComponent('OffTextTrackMenuItem',OffTextTrackMenuItem);var TextTrackButton=function(_TrackButton){inheritsLoose(TextTrackButton,_TrackButton);function TextTrackButton(player,options){if(options===void 0){options={};}
847options.tracks=player.textTracks();return _TrackButton.call(this,player,options)||this;}
848var _proto=TextTrackButton.prototype;_proto.createItems=function createItems(items,TrackMenuItem){if(items===void 0){items=[];}
849if(TrackMenuItem===void 0){TrackMenuItem=TextTrackMenuItem;}
850var label;if(this.label_){label=this.label_+" off";}
851items.push(new OffTextTrackMenuItem(this.player_,{kinds:this.kinds_,kind:this.kind_,label:label}));this.hideThreshold_+=1;var tracks=this.player_.textTracks();if(!Array.isArray(this.kinds_)){this.kinds_=[this.kind_];}
852for(var i=0;i<tracks.length;i++){var track=tracks[i];if(this.kinds_.indexOf(track.kind)>-1){var item=new TrackMenuItem(this.player_,{track:track,kinds:this.kinds_,kind:this.kind_,selectable:true,multiSelectable:false});item.addClass("vjs-"+track.kind+"-menu-item");items.push(item);}}
853return items;};return TextTrackButton;}(TrackButton);Component.registerComponent('TextTrackButton',TextTrackButton);var ChaptersTrackMenuItem=function(_MenuItem){inheritsLoose(ChaptersTrackMenuItem,_MenuItem);function ChaptersTrackMenuItem(player,options){var _this;var track=options.track;var cue=options.cue;var currentTime=player.currentTime();options.selectable=true;options.multiSelectable=false;options.label=cue.text;options.selected=cue.startTime<=currentTime&&currentTime<cue.endTime;_this=_MenuItem.call(this,player,options)||this;_this.track=track;_this.cue=cue;track.addEventListener('cuechange',bind(assertThisInitialized(_this),_this.update));return _this;}
854var _proto=ChaptersTrackMenuItem.prototype;_proto.handleClick=function handleClick(event){_MenuItem.prototype.handleClick.call(this);this.player_.currentTime(this.cue.startTime);this.update(this.cue.startTime);};_proto.update=function update(event){var cue=this.cue;var currentTime=this.player_.currentTime();this.selected(cue.startTime<=currentTime&&currentTime<cue.endTime);};return ChaptersTrackMenuItem;}(MenuItem);Component.registerComponent('ChaptersTrackMenuItem',ChaptersTrackMenuItem);var ChaptersButton=function(_TextTrackButton){inheritsLoose(ChaptersButton,_TextTrackButton);function ChaptersButton(player,options,ready){return _TextTrackButton.call(this,player,options,ready)||this;}
855var _proto=ChaptersButton.prototype;_proto.buildCSSClass=function buildCSSClass(){return "vjs-chapters-button "+_TextTrackButton.prototype.buildCSSClass.call(this);};_proto.buildWrapperCSSClass=function buildWrapperCSSClass(){return "vjs-chapters-button "+_TextTrackButton.prototype.buildWrapperCSSClass.call(this);};_proto.update=function update(event){if(!this.track_||event&&(event.type==='addtrack'||event.type==='removetrack')){this.setTrack(this.findChaptersTrack());}
856_TextTrackButton.prototype.update.call(this);};_proto.setTrack=function setTrack(track){if(this.track_===track){return;}
857if(!this.updateHandler_){this.updateHandler_=this.update.bind(this);}
858if(this.track_){var remoteTextTrackEl=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);if(remoteTextTrackEl){remoteTextTrackEl.removeEventListener('load',this.updateHandler_);}
859this.track_=null;}
860this.track_=track;if(this.track_){this.track_.mode='hidden';var _remoteTextTrackEl=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);if(_remoteTextTrackEl){_remoteTextTrackEl.addEventListener('load',this.updateHandler_);}}};_proto.findChaptersTrack=function findChaptersTrack(){var tracks=this.player_.textTracks()||[];for(var i=tracks.length-1;i>=0;i--){var track=tracks[i];if(track.kind===this.kind_){return track;}}};_proto.getMenuCaption=function getMenuCaption(){if(this.track_&&this.track_.label){return this.track_.label;}
861return this.localize(toTitleCase(this.kind_));};_proto.createMenu=function createMenu(){this.options_.title=this.getMenuCaption();return _TextTrackButton.prototype.createMenu.call(this);};_proto.createItems=function createItems(){var items=[];if(!this.track_){return items;}
862var cues=this.track_.cues;if(!cues){return items;}
863for(var i=0,l=cues.length;i<l;i++){var cue=cues[i];var mi=new ChaptersTrackMenuItem(this.player_,{track:this.track_,cue:cue});items.push(mi);}
864return items;};return ChaptersButton;}(TextTrackButton);ChaptersButton.prototype.kind_='chapters';ChaptersButton.prototype.controlText_='Chapters';Component.registerComponent('ChaptersButton',ChaptersButton);var DescriptionsButton=function(_TextTrackButton){inheritsLoose(DescriptionsButton,_TextTrackButton);function DescriptionsButton(player,options,ready){var _this;_this=_TextTrackButton.call(this,player,options,ready)||this;var tracks=player.textTracks();var changeHandler=bind(assertThisInitialized(_this),_this.handleTracksChange);tracks.addEventListener('change',changeHandler);_this.on('dispose',function(){tracks.removeEventListener('change',changeHandler);});return _this;}
865var _proto=DescriptionsButton.prototype;_proto.handleTracksChange=function handleTracksChange(event){var tracks=this.player().textTracks();var disabled=false;for(var i=0,l=tracks.length;i<l;i++){var track=tracks[i];if(track.kind!==this.kind_&&track.mode==='showing'){disabled=true;break;}}
866if(disabled){this.disable();}else{this.enable();}};_proto.buildCSSClass=function buildCSSClass(){return "vjs-descriptions-button "+_TextTrackButton.prototype.buildCSSClass.call(this);};_proto.buildWrapperCSSClass=function buildWrapperCSSClass(){return "vjs-descriptions-button "+_TextTrackButton.prototype.buildWrapperCSSClass.call(this);};return DescriptionsButton;}(TextTrackButton);DescriptionsButton.prototype.kind_='descriptions';DescriptionsButton.prototype.controlText_='Descriptions';Component.registerComponent('DescriptionsButton',DescriptionsButton);var SubtitlesButton=function(_TextTrackButton){inheritsLoose(SubtitlesButton,_TextTrackButton);function SubtitlesButton(player,options,ready){return _TextTrackButton.call(this,player,options,ready)||this;}
867var _proto=SubtitlesButton.prototype;_proto.buildCSSClass=function buildCSSClass(){return "vjs-subtitles-button "+_TextTrackButton.prototype.buildCSSClass.call(this);};_proto.buildWrapperCSSClass=function buildWrapperCSSClass(){return "vjs-subtitles-button "+_TextTrackButton.prototype.buildWrapperCSSClass.call(this);};return SubtitlesButton;}(TextTrackButton);SubtitlesButton.prototype.kind_='subtitles';SubtitlesButton.prototype.controlText_='Subtitles';Component.registerComponent('SubtitlesButton',SubtitlesButton);var CaptionSettingsMenuItem=function(_TextTrackMenuItem){inheritsLoose(CaptionSettingsMenuItem,_TextTrackMenuItem);function CaptionSettingsMenuItem(player,options){var _this;options.track={player:player,kind:options.kind,label:options.kind+' settings',selectable:false,"default":false,mode:'disabled'};options.selectable=false;options.name='CaptionSettingsMenuItem';_this=_TextTrackMenuItem.call(this,player,options)||this;_this.addClass('vjs-texttrack-settings');_this.controlText(', opens '+options.kind+' settings dialog');return _this;}
868var _proto=CaptionSettingsMenuItem.prototype;_proto.handleClick=function handleClick(event){this.player().getChild('textTrackSettings').open();};return CaptionSettingsMenuItem;}(TextTrackMenuItem);Component.registerComponent('CaptionSettingsMenuItem',CaptionSettingsMenuItem);var CaptionsButton=function(_TextTrackButton){inheritsLoose(CaptionsButton,_TextTrackButton);function CaptionsButton(player,options,ready){return _TextTrackButton.call(this,player,options,ready)||this;}
869var _proto=CaptionsButton.prototype;_proto.buildCSSClass=function buildCSSClass(){return "vjs-captions-button "+_TextTrackButton.prototype.buildCSSClass.call(this);};_proto.buildWrapperCSSClass=function buildWrapperCSSClass(){return "vjs-captions-button "+_TextTrackButton.prototype.buildWrapperCSSClass.call(this);};_proto.createItems=function createItems(){var items=[];if(!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild('textTrackSettings')){items.push(new CaptionSettingsMenuItem(this.player_,{kind:this.kind_}));this.hideThreshold_+=1;}
870return _TextTrackButton.prototype.createItems.call(this,items);};return CaptionsButton;}(TextTrackButton);CaptionsButton.prototype.kind_='captions';CaptionsButton.prototype.controlText_='Captions';Component.registerComponent('CaptionsButton',CaptionsButton);var SubsCapsMenuItem=function(_TextTrackMenuItem){inheritsLoose(SubsCapsMenuItem,_TextTrackMenuItem);function SubsCapsMenuItem(){return _TextTrackMenuItem.apply(this,arguments)||this;}
871var _proto=SubsCapsMenuItem.prototype;_proto.createEl=function createEl(type,props,attrs){var innerHTML="<span class=\"vjs-menu-item-text\">"+this.localize(this.options_.label);if(this.options_.track.kind==='captions'){innerHTML+="\n        <span aria-hidden=\"true\" class=\"vjs-icon-placeholder\"></span>\n        <span class=\"vjs-control-text\"> "+this.localize('Captions')+"</span>\n      ";}
872innerHTML+='</span>';var el=_TextTrackMenuItem.prototype.createEl.call(this,type,assign({innerHTML:innerHTML},props),attrs);return el;};return SubsCapsMenuItem;}(TextTrackMenuItem);Component.registerComponent('SubsCapsMenuItem',SubsCapsMenuItem);var SubsCapsButton=function(_TextTrackButton){inheritsLoose(SubsCapsButton,_TextTrackButton);function SubsCapsButton(player,options){var _this;if(options===void 0){options={};}
873_this=_TextTrackButton.call(this,player,options)||this;_this.label_='subtitles';if(['en','en-us','en-ca','fr-ca'].indexOf(_this.player_.language_)>-1){_this.label_='captions';}
874_this.menuButton_.controlText(toTitleCase(_this.label_));return _this;}
875var _proto=SubsCapsButton.prototype;_proto.buildCSSClass=function buildCSSClass(){return "vjs-subs-caps-button "+_TextTrackButton.prototype.buildCSSClass.call(this);};_proto.buildWrapperCSSClass=function buildWrapperCSSClass(){return "vjs-subs-caps-button "+_TextTrackButton.prototype.buildWrapperCSSClass.call(this);};_proto.createItems=function createItems(){var items=[];if(!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild('textTrackSettings')){items.push(new CaptionSettingsMenuItem(this.player_,{kind:this.label_}));this.hideThreshold_+=1;}
876items=_TextTrackButton.prototype.createItems.call(this,items,SubsCapsMenuItem);return items;};return SubsCapsButton;}(TextTrackButton);SubsCapsButton.prototype.kinds_=['captions','subtitles'];SubsCapsButton.prototype.controlText_='Subtitles';Component.registerComponent('SubsCapsButton',SubsCapsButton);var AudioTrackMenuItem=function(_MenuItem){inheritsLoose(AudioTrackMenuItem,_MenuItem);function AudioTrackMenuItem(player,options){var _this;var track=options.track;var tracks=player.audioTracks();options.label=track.label||track.language||'Unknown';options.selected=track.enabled;_this=_MenuItem.call(this,player,options)||this;_this.track=track;_this.addClass("vjs-"+track.kind+"-menu-item");var changeHandler=function changeHandler(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}
877_this.handleTracksChange.apply(assertThisInitialized(_this),args);};tracks.addEventListener('change',changeHandler);_this.on('dispose',function(){tracks.removeEventListener('change',changeHandler);});return _this;}
878var _proto=AudioTrackMenuItem.prototype;_proto.createEl=function createEl(type,props,attrs){var innerHTML="<span class=\"vjs-menu-item-text\">"+this.localize(this.options_.label);if(this.options_.track.kind==='main-desc'){innerHTML+="\n        <span aria-hidden=\"true\" class=\"vjs-icon-placeholder\"></span>\n        <span class=\"vjs-control-text\"> "+this.localize('Descriptions')+"</span>\n      ";}
879innerHTML+='</span>';var el=_MenuItem.prototype.createEl.call(this,type,assign({innerHTML:innerHTML},props),attrs);return el;};_proto.handleClick=function handleClick(event){var tracks=this.player_.audioTracks();_MenuItem.prototype.handleClick.call(this,event);for(var i=0;i<tracks.length;i++){var track=tracks[i];track.enabled=track===this.track;}};_proto.handleTracksChange=function handleTracksChange(event){this.selected(this.track.enabled);};return AudioTrackMenuItem;}(MenuItem);Component.registerComponent('AudioTrackMenuItem',AudioTrackMenuItem);var AudioTrackButton=function(_TrackButton){inheritsLoose(AudioTrackButton,_TrackButton);function AudioTrackButton(player,options){if(options===void 0){options={};}
880options.tracks=player.audioTracks();return _TrackButton.call(this,player,options)||this;}
881var _proto=AudioTrackButton.prototype;_proto.buildCSSClass=function buildCSSClass(){return "vjs-audio-button "+_TrackButton.prototype.buildCSSClass.call(this);};_proto.buildWrapperCSSClass=function buildWrapperCSSClass(){return "vjs-audio-button "+_TrackButton.prototype.buildWrapperCSSClass.call(this);};_proto.createItems=function createItems(items){if(items===void 0){items=[];}
882this.hideThreshold_=1;var tracks=this.player_.audioTracks();for(var i=0;i<tracks.length;i++){var track=tracks[i];items.push(new AudioTrackMenuItem(this.player_,{track:track,selectable:true,multiSelectable:false}));}
883return items;};return AudioTrackButton;}(TrackButton);AudioTrackButton.prototype.controlText_='Audio Track';Component.registerComponent('AudioTrackButton',AudioTrackButton);var PlaybackRateMenuItem=function(_MenuItem){inheritsLoose(PlaybackRateMenuItem,_MenuItem);function PlaybackRateMenuItem(player,options){var _this;var label=options.rate;var rate=parseFloat(label,10);options.label=label;options.selected=rate===1;options.selectable=true;options.multiSelectable=false;_this=_MenuItem.call(this,player,options)||this;_this.label=label;_this.rate=rate;_this.on(player,'ratechange',_this.update);return _this;}
884var _proto=PlaybackRateMenuItem.prototype;_proto.handleClick=function handleClick(event){_MenuItem.prototype.handleClick.call(this);this.player().playbackRate(this.rate);};_proto.update=function update(event){this.selected(this.player().playbackRate()===this.rate);};return PlaybackRateMenuItem;}(MenuItem);PlaybackRateMenuItem.prototype.contentElType='button';Component.registerComponent('PlaybackRateMenuItem',PlaybackRateMenuItem);var PlaybackRateMenuButton=function(_MenuButton){inheritsLoose(PlaybackRateMenuButton,_MenuButton);function PlaybackRateMenuButton(player,options){var _this;_this=_MenuButton.call(this,player,options)||this;_this.updateVisibility();_this.updateLabel();_this.on(player,'loadstart',_this.updateVisibility);_this.on(player,'ratechange',_this.updateLabel);return _this;}
885var _proto=PlaybackRateMenuButton.prototype;_proto.createEl=function createEl$1(){var el=_MenuButton.prototype.createEl.call(this);this.labelEl_=createEl('div',{className:'vjs-playback-rate-value',innerHTML:'1x'});el.appendChild(this.labelEl_);return el;};_proto.dispose=function dispose(){this.labelEl_=null;_MenuButton.prototype.dispose.call(this);};_proto.buildCSSClass=function buildCSSClass(){return "vjs-playback-rate "+_MenuButton.prototype.buildCSSClass.call(this);};_proto.buildWrapperCSSClass=function buildWrapperCSSClass(){return "vjs-playback-rate "+_MenuButton.prototype.buildWrapperCSSClass.call(this);};_proto.createMenu=function createMenu(){var menu=new Menu(this.player());var rates=this.playbackRates();if(rates){for(var i=rates.length-1;i>=0;i--){menu.addChild(new PlaybackRateMenuItem(this.player(),{rate:rates[i]+'x'}));}}
886return menu;};_proto.updateARIAAttributes=function updateARIAAttributes(){this.el().setAttribute('aria-valuenow',this.player().playbackRate());};_proto.handleClick=function handleClick(event){var currentRate=this.player().playbackRate();var rates=this.playbackRates();var newRate=rates[0];for(var i=0;i<rates.length;i++){if(rates[i]>currentRate){newRate=rates[i];break;}}
887this.player().playbackRate(newRate);};_proto.playbackRates=function playbackRates(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates;};_proto.playbackRateSupported=function playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0;};_proto.updateVisibility=function updateVisibility(event){if(this.playbackRateSupported()){this.removeClass('vjs-hidden');}else{this.addClass('vjs-hidden');}};_proto.updateLabel=function updateLabel(event){if(this.playbackRateSupported()){this.labelEl_.innerHTML=this.player().playbackRate()+'x';}};return PlaybackRateMenuButton;}(MenuButton);PlaybackRateMenuButton.prototype.controlText_='Playback Rate';Component.registerComponent('PlaybackRateMenuButton',PlaybackRateMenuButton);var Spacer=function(_Component){inheritsLoose(Spacer,_Component);function Spacer(){return _Component.apply(this,arguments)||this;}
888var _proto=Spacer.prototype;_proto.buildCSSClass=function buildCSSClass(){return "vjs-spacer "+_Component.prototype.buildCSSClass.call(this);};_proto.createEl=function createEl(){return _Component.prototype.createEl.call(this,'div',{className:this.buildCSSClass()});};return Spacer;}(Component);Component.registerComponent('Spacer',Spacer);var CustomControlSpacer=function(_Spacer){inheritsLoose(CustomControlSpacer,_Spacer);function CustomControlSpacer(){return _Spacer.apply(this,arguments)||this;}
889var _proto=CustomControlSpacer.prototype;_proto.buildCSSClass=function buildCSSClass(){return "vjs-custom-control-spacer "+_Spacer.prototype.buildCSSClass.call(this);};_proto.createEl=function createEl(){var el=_Spacer.prototype.createEl.call(this,{className:this.buildCSSClass()});el.innerHTML="\xA0";return el;};return CustomControlSpacer;}(Spacer);Component.registerComponent('CustomControlSpacer',CustomControlSpacer);var ControlBar=function(_Component){inheritsLoose(ControlBar,_Component);function ControlBar(){return _Component.apply(this,arguments)||this;}
890var _proto=ControlBar.prototype;_proto.createEl=function createEl(){return _Component.prototype.createEl.call(this,'div',{className:'vjs-control-bar',dir:'ltr'});};return ControlBar;}(Component);ControlBar.prototype.options_={children:['playToggle','volumePanel','currentTimeDisplay','timeDivider','durationDisplay','progressControl','liveDisplay','seekToLive','remainingTimeDisplay','customControlSpacer','playbackRateMenuButton','chaptersButton','descriptionsButton','subsCapsButton','audioTrackButton','fullscreenToggle']};if('exitPictureInPicture'in document){ControlBar.prototype.options_.children.splice(ControlBar.prototype.options_.children.length-1,0,'pictureInPictureToggle');}
891Component.registerComponent('ControlBar',ControlBar);var ErrorDisplay=function(_ModalDialog){inheritsLoose(ErrorDisplay,_ModalDialog);function ErrorDisplay(player,options){var _this;_this=_ModalDialog.call(this,player,options)||this;_this.on(player,'error',_this.open);return _this;}
892var _proto=ErrorDisplay.prototype;_proto.buildCSSClass=function buildCSSClass(){return "vjs-error-display "+_ModalDialog.prototype.buildCSSClass.call(this);};_proto.content=function content(){var error=this.player().error();return error?this.localize(error.message):'';};return ErrorDisplay;}(ModalDialog);ErrorDisplay.prototype.options_=_extends_1({},ModalDialog.prototype.options_,{pauseOnOpen:false,fillAlways:true,temporary:false,uncloseable:true});Component.registerComponent('ErrorDisplay',ErrorDisplay);var LOCAL_STORAGE_KEY='vjs-text-track-settings';var COLOR_BLACK=['#000','Black'];var COLOR_BLUE=['#00F','Blue'];var COLOR_CYAN=['#0FF','Cyan'];var COLOR_GREEN=['#0F0','Green'];var COLOR_MAGENTA=['#F0F','Magenta'];var COLOR_RED=['#F00','Red'];var COLOR_WHITE=['#FFF','White'];var COLOR_YELLOW=['#FF0','Yellow'];var OPACITY_OPAQUE=['1','Opaque'];var OPACITY_SEMI=['0.5','Semi-Transparent'];var OPACITY_TRANS=['0','Transparent'];var selectConfigs={backgroundColor:{selector:'.vjs-bg-color > select',id:'captions-background-color-%s',label:'Color',options:[COLOR_BLACK,COLOR_WHITE,COLOR_RED,COLOR_GREEN,COLOR_BLUE,COLOR_YELLOW,COLOR_MAGENTA,COLOR_CYAN]},backgroundOpacity:{selector:'.vjs-bg-opacity > select',id:'captions-background-opacity-%s',label:'Transparency',options:[OPACITY_OPAQUE,OPACITY_SEMI,OPACITY_TRANS]},color:{selector:'.vjs-fg-color > select',id:'captions-foreground-color-%s',label:'Color',options:[COLOR_WHITE,COLOR_BLACK,COLOR_RED,COLOR_GREEN,COLOR_BLUE,COLOR_YELLOW,COLOR_MAGENTA,COLOR_CYAN]},edgeStyle:{selector:'.vjs-edge-style > select',id:'%s',label:'Text Edge Style',options:[['none','None'],['raised','Raised'],['depressed','Depressed'],['uniform','Uniform'],['dropshadow','Dropshadow']]},fontFamily:{selector:'.vjs-font-family > select',id:'captions-font-family-%s',label:'Font Family',options:[['proportionalSansSerif','Proportional Sans-Serif'],['monospaceSansSerif','Monospace Sans-Serif'],['proportionalSerif','Proportional Serif'],['monospaceSerif','Monospace Serif'],['casual','Casual'],['script','Script'],['small-caps','Small Caps']]},fontPercent:{selector:'.vjs-font-percent > select',id:'captions-font-size-%s',label:'Font Size',options:[['0.50','50%'],['0.75','75%'],['1.00','100%'],['1.25','125%'],['1.50','150%'],['1.75','175%'],['2.00','200%'],['3.00','300%'],['4.00','400%']],"default":2,parser:function parser(v){return v==='1.00'?null:Number(v);}},textOpacity:{selector:'.vjs-text-opacity > select',id:'captions-foreground-opacity-%s',label:'Transparency',options:[OPACITY_OPAQUE,OPACITY_SEMI]},windowColor:{selector:'.vjs-window-color > select',id:'captions-window-color-%s',label:'Color'},windowOpacity:{selector:'.vjs-window-opacity > select',id:'captions-window-opacity-%s',label:'Transparency',options:[OPACITY_TRANS,OPACITY_SEMI,OPACITY_OPAQUE]}};selectConfigs.windowColor.options=selectConfigs.backgroundColor.options;function parseOptionValue(value,parser){if(parser){value=parser(value);}
893if(value&&value!=='none'){return value;}}
894function getSelectedOptionValue(el,parser){var value=el.options[el.options.selectedIndex].value;return parseOptionValue(value,parser);}
895function setSelectedOption(el,value,parser){if(!value){return;}
896for(var i=0;i<el.options.length;i++){if(parseOptionValue(el.options[i].value,parser)===value){el.selectedIndex=i;break;}}}
897var TextTrackSettings=function(_ModalDialog){inheritsLoose(TextTrackSettings,_ModalDialog);function TextTrackSettings(player,options){var _this;options.temporary=false;_this=_ModalDialog.call(this,player,options)||this;_this.updateDisplay=bind(assertThisInitialized(_this),_this.updateDisplay);_this.fill();_this.hasBeenOpened_=_this.hasBeenFilled_=true;_this.endDialog=createEl('p',{className:'vjs-control-text',textContent:_this.localize('End of dialog window.')});_this.el().appendChild(_this.endDialog);_this.setDefaults();if(options.persistTextTrackSettings===undefined){_this.options_.persistTextTrackSettings=_this.options_.playerOptions.persistTextTrackSettings;}
898_this.on(_this.$('.vjs-done-button'),'click',function(){_this.saveSettings();_this.close();});_this.on(_this.$('.vjs-default-button'),'click',function(){_this.setDefaults();_this.updateDisplay();});each(selectConfigs,function(config){_this.on(_this.$(config.selector),'change',_this.updateDisplay);});if(_this.options_.persistTextTrackSettings){_this.restoreSettings();}
899return _this;}
900var _proto=TextTrackSettings.prototype;_proto.dispose=function dispose(){this.endDialog=null;_ModalDialog.prototype.dispose.call(this);};_proto.createElSelect_=function createElSelect_(key,legendId,type){var _this2=this;if(legendId===void 0){legendId='';}
901if(type===void 0){type='label';}
902var config=selectConfigs[key];var id=config.id.replace('%s',this.id_);var selectLabelledbyIds=[legendId,id].join(' ').trim();return["<"+type+" id=\""+id+"\" class=\""+(type==='label'?'vjs-label':'')+"\">",this.localize(config.label),"</"+type+">","<select aria-labelledby=\""+selectLabelledbyIds+"\">"].concat(config.options.map(function(o){var optionId=id+'-'+o[1].replace(/\W+/g,'');return["<option id=\""+optionId+"\" value=\""+o[0]+"\" ","aria-labelledby=\""+selectLabelledbyIds+" "+optionId+"\">",_this2.localize(o[1]),'</option>'].join('');})).concat('</select>').join('');};_proto.createElFgColor_=function createElFgColor_(){var legendId="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">',"<legend id=\""+legendId+"\">",this.localize('Text'),'</legend>',this.createElSelect_('color',legendId),'<span class="vjs-text-opacity vjs-opacity">
902',this.createElSelect_('textOpacity',legendId),'</span>','</fieldset>'].join('');};_proto.createElBgColor_=function createElBgColor_(){var legendId="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">',"<legend id=\""+legendId+"\">",this.localize('Background'),'</legend>',this.createElSelect_('backgroundColor',legendId),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_('backgroundOpacity',legendId),'</span>','</fieldset>'].join('');};_proto.createElWinColor_=function createElWinColor_(){var legendId="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">',"<legend id=\""+legendId+"\">",this.localize('Window'),'</legend>',this.createElSelect_('windowColor',legendId),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_('windowOpacity',legendId),'</span>','</fieldset>'].join('');};_proto.createElColors_=function createElColors_(){return createEl('div',{className:'vjs-track-settings-colors',innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join('')});};_proto.createElFont_=function createElFont_(){return createEl('div',{className:'vjs-track-settings-font',innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_('fontPercent','','legend'),'</fieldset>','<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_('edgeStyle','','legend'),'</fieldset>','<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_('fontFamily','','legend'),'</fieldset>'].join('')});};_proto.createElControls_=function createElControls_(){var defaultsDescription=this.localize('restore all settings to the default values');return createEl('div',{className:'vjs-track-settings-controls',innerHTML:["<button type=\"button\" class=\"vjs-default-button\" title=\""+defaultsDescription+"\">",this.localize('Reset'),"<span class=\"vjs-control-text\"> "+defaultsDescription+"</span>",'</button>',"<button type=\"button\" class=\"vjs-done-button\">"+this.localize('Done')+"</button>"].join('')});};_proto.content=function content(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()];};_proto.label=function label(){return this.localize('Caption Settings Dialog');};_proto.description=function description(){return this.localize('Beginning of dialog window. Escape will cancel and close the window.');};_proto.buildCSSClass=function buildCSSClass(){return _ModalDialog.prototype.buildCSSClass.call(this)+' vjs-text-track-settings';};_proto.getValues=function getValues(){var _this3=this;return reduce(selectConfigs,function(accum,config,key){var value=getSelectedOptionValue(_this3.$(config.selector),config.parser);if(value!==undefined){accum[key]=value;}
903return accum;},{});};_proto.setValues=function setValues(values){var _this4=this;each(selectConfigs,function(config,key){setSelectedOption(_this4.$(config.selector),values[key],config.parser);});};_proto.setDefaults=function setDefaults(){var _this5=this;each(selectConfigs,function(config){var index=config.hasOwnProperty('default')?config["default"]:0;_this5.$(config.selector).selectedIndex=index;});};_proto.restoreSettings=function restoreSettings(){var values;try{values=JSON.parse(window$3.localStorage.getItem(LOCAL_STORAGE_KEY));}catch(err){log.warn(err);}
904if(values){this.setValues(values);}};_proto.saveSettings=function saveSettings(){if(!this.options_.persistTextTrackSettings){return;}
905var values=this.getValues();try{if(Object.keys(values).length){window$3.localStorage.setItem(LOCAL_STORAGE_KEY,JSON.stringify(values));}else{window$3.localStorage.removeItem(LOCAL_STORAGE_KEY);}}catch(err){log.warn(err);}};_proto.updateDisplay=function updateDisplay(){var ttDisplay=this.player_.getChild('textTrackDisplay');if(ttDisplay){ttDisplay.updateDisplay();}};_proto.conditionalBlur_=function conditionalBlur_(){this.previouslyActiveEl_=null;var cb=this.player_.controlBar;var subsCapsBtn=cb&&cb.subsCapsButton;var ccBtn=cb&&cb.captionsButton;if(subsCapsBtn){subsCapsBtn.focus();}else if(ccBtn){ccBtn.focus();}};return TextTrackSettings;}(ModalDialog);Component.registerComponent('TextTrackSettings',TextTrackSettings);var ResizeManager=function(_Component){inheritsLoose(ResizeManager,_Component);function ResizeManager(player,options){var _this;
vendor: 41,093 bytes, lines 905-1058
905var RESIZE_OBSERVER_AVAILABLE=options.ResizeObserver||window$3.ResizeObserver;if(options.ResizeObserver===null){RESIZE_OBSERVER_AVAILABLE=false;}
906var options_=mergeOptions({createEl:!RESIZE_OBSERVER_AVAILABLE,reportTouchActivity:false},options);_this=_Component.call(this,player,options_)||this;_this.ResizeObserver=options.ResizeObserver||window$3.ResizeObserver;_this.loadListener_=null;_this.resizeObserver_=null;_this.debouncedHandler_=debounce(function(){_this.resizeHandler();},100,false,assertThisInitialized(_this));if(RESIZE_OBSERVER_AVAILABLE){_this.resizeObserver_=new _this.ResizeObserver(_this.debouncedHandler_);_this.resizeObserver_.observe(player.el());}else{_this.loadListener_=function(){if(!_this.el_||!_this.el_.contentWindow){return;}
907var debouncedHandler_=_this.debouncedHandler_;var unloadListener_=_this.unloadListener_=function(){off(this,'resize',debouncedHandler_);off(this,'unload',unloadListener_);unloadListener_=null;};on(_this.el_.contentWindow,'unload',unloadListener_);on(_this.el_.contentWindow,'resize',debouncedHandler_);};_this.one('load',_this.loadListener_);}
908return _this;}
909var _proto=ResizeManager.prototype;_proto.createEl=function createEl(){return _Component.prototype.createEl.call(this,'iframe',{className:'vjs-resize-manager',tabIndex:-1},{'aria-hidden':'true'});};_proto.resizeHandler=function resizeHandler(){if(!this.player_||!this.player_.trigger){return;}
910this.player_.trigger('playerresize');};_proto.dispose=function dispose(){if(this.debouncedHandler_){this.debouncedHandler_.cancel();}
911if(this.resizeObserver_){if(this.player_.el()){this.resizeObserver_.unobserve(this.player_.el());}
912this.resizeObserver_.disconnect();}
913if(this.loadListener_){this.off('load',this.loadListener_);}
914if(this.el_&&this.el_.contentWindow&&this.unloadListener_){this.unloadListener_.call(this.el_.contentWindow);}
915this.ResizeObserver=null;this.resizeObserver=null;this.debouncedHandler_=null;this.loadListener_=null;_Component.prototype.dispose.call(this);};return ResizeManager;}(Component);Component.registerComponent('ResizeManager',ResizeManager);var defaults={trackingThreshold:30,liveTolerance:15};var LiveTracker=function(_Component){inheritsLoose(LiveTracker,_Component);function LiveTracker(player,options){var _this;var options_=mergeOptions(defaults,options,{createEl:false});_this=_Component.call(this,player,options_)||this;_this.reset_();_this.on(_this.player_,'durationchange',_this.handleDurationchange);if(IE_VERSION&&'hidden'in document&&'visibilityState'in document){_this.on(document,'visibilitychange',_this.handleVisibilityChange);}
916return _this;}
917var _proto=LiveTracker.prototype;_proto.handleVisibilityChange=function handleVisibilityChange(){if(this.player_.duration()!==Infinity){return;}
918if(document.hidden){this.stopTracking();}else{this.startTracking();}};_proto.trackLive_=function trackLive_(){var seekable=this.player_.seekable();if(!seekable||!seekable.length){return;}
919var newTime=Number(window$3.performance.now().toFixed(4));var deltaTime=this.lastTime_===-1?0:(newTime-this.lastTime_)/1000;this.lastTime_=newTime;this.pastSeekEnd_=this.pastSeekEnd()+deltaTime;var liveCurrentTime=this.liveCurrentTime();var currentTime=this.player_.currentTime();var isBehind=this.player_.paused()||this.seekedBehindLive_||Math.abs(liveCurrentTime-currentTime)>this.options_.liveTolerance;if(!this.timeupdateSeen_||liveCurrentTime===Infinity){isBehind=false;}
920if(isBehind!==this.behindLiveEdge_){this.behindLiveEdge_=isBehind;this.trigger('liveedgechange');}};_proto.handleDurationchange=function handleDurationchange(){if(this.player_.duration()===Infinity&&this.liveWindow()>=this.options_.trackingThreshold){if(this.player_.options_.liveui){this.player_.addClass('vjs-liveui');}
921this.startTracking();}else{this.player_.removeClass('vjs-liveui');this.stopTracking();}};_proto.startTracking=function startTracking(){if(this.isTracking()){return;}
922if(!this.timeupdateSeen_){this.timeupdateSeen_=this.player_.hasStarted();}
923this.trackingInterval_=this.setInterval(this.trackLive_,UPDATE_REFRESH_INTERVAL);this.trackLive_();this.on(this.player_,['play','pause'],this.trackLive_);if(!this.timeupdateSeen_){this.one(this.player_,'play',this.handlePlay);this.one(this.player_,'timeupdate',this.handleFirstTimeupdate);}else{this.on(this.player_,'seeked',this.handleSeeked);}};_proto.handleFirstTimeupdate=function handleFirstTimeupdate(){this.timeupdateSeen_=true;this.on(this.player_,'seeked',this.handleSeeked);};_proto.handleSeeked=function handleSeeked(){var timeDiff=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.skipNextSeeked_?false:timeDiff>2;this.skipNextSeeked_=false;this.trackLive_();};_proto.handlePlay=function handlePlay(){this.one(this.player_,'timeupdate',this.seekToLiveEdge);};_proto.reset_=function reset_(){this.lastTime_=-1;this.pastSeekEnd_=0;this.lastSeekEnd_=-1;this.behindLiveEdge_=true;this.timeupdateSeen_=false;this.seekedBehindLive_=false;this.skipNextSeeked_=false;this.clearInterval(this.trackingInterval_);this.trackingInterval_=null;this.off(this.player_,['play','pause'],this.trackLive_);this.off(this.player_,'seeked',this.handleSeeked);this.off(this.player_,'play',this.handlePlay);this.off(this.player_,'timeupdate',this.handleFirstTimeupdate);this.off(this.player_,'timeupdate',this.seekToLiveEdge);};_proto.stopTracking=function stopTracking(){if(!this.isTracking()){return;}
924this.reset_();this.trigger('liveedgechange');};_proto.seekableEnd=function seekableEnd(){var seekable=this.player_.seekable();var seekableEnds=[];var i=seekable?seekable.length:0;while(i--){seekableEnds.push(seekable.end(i));}
925return seekableEnds.length?seekableEnds.sort()[seekableEnds.length-1]:Infinity;};_proto.seekableStart=function seekableStart(){var seekable=this.player_.seekable();var seekableStarts=[];var i=seekable?seekable.length:0;while(i--){seekableStarts.push(seekable.start(i));}
926return seekableStarts.length?seekableStarts.sort()[0]:0;};_proto.liveWindow=function liveWindow(){var liveCurrentTime=this.liveCurrentTime();if(liveCurrentTime===Infinity){return Infinity;}
927return liveCurrentTime-this.seekableStart();};_proto.isLive=function isLive(){return this.isTracking();};_proto.atLiveEdge=function atLiveEdge(){return!this.behindLiveEdge();};_proto.liveCurrentTime=function liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd();};_proto.pastSeekEnd=function pastSeekEnd(){var seekableEnd=this.seekableEnd();if(this.lastSeekEnd_!==-1&&seekableEnd!==this.lastSeekEnd_){this.pastSeekEnd_=0;}
928this.lastSeekEnd_=seekableEnd;return this.pastSeekEnd_;};_proto.behindLiveEdge=function behindLiveEdge(){return this.behindLiveEdge_;};_proto.isTracking=function isTracking(){return typeof this.trackingInterval_==='number';};_proto.seekToLiveEdge=function seekToLiveEdge(){this.seekedBehindLive_=false;if(this.atLiveEdge()){return;}
929this.skipNextSeeked_=true;this.player_.currentTime(this.liveCurrentTime());};_proto.dispose=function dispose(){this.off(document,'visibilitychange',this.handleVisibilityChange);this.stopTracking();_Component.prototype.dispose.call(this);};return LiveTracker;}(Component);Component.registerComponent('LiveTracker',LiveTracker);var sourcesetLoad=function sourcesetLoad(tech){var el=tech.el();if(el.hasAttribute('src')){tech.triggerSourceset(el.src);return true;}
930var sources=tech.$$('source');var srcUrls=[];var src='';if(!sources.length){return false;}
931for(var i=0;i<sources.length;i++){var url=sources[i].src;if(url&&srcUrls.indexOf(url)===-1){srcUrls.push(url);}}
932if(!srcUrls.length){return false;}
933if(srcUrls.length===1){src=srcUrls[0];}
934tech.triggerSourceset(src);return true;};var innerHTMLDescriptorPolyfill=Object.defineProperty({},'innerHTML',{get:function get(){return this.cloneNode(true).innerHTML;},set:function set(v){var dummy=document.createElement(this.nodeName.toLowerCase());dummy.innerHTML=v;var docFrag=document.createDocumentFragment();while(dummy.childNodes.length){docFrag.appendChild(dummy.childNodes[0]);}
935this.innerText='';window$3.Element.prototype.appendChild.call(this,docFrag);return this.innerHTML;}});var getDescriptor=function getDescriptor(priority,prop){var descriptor={};for(var i=0;i<priority.length;i++){descriptor=Object.getOwnPropertyDescriptor(priority[i],prop);if(descriptor&&descriptor.set&&descriptor.get){break;}}
936descriptor.enumerable=true;descriptor.configurable=true;return descriptor;};var getInnerHTMLDescriptor=function getInnerHTMLDescriptor(tech){return getDescriptor([tech.el(),window$3.HTMLMediaElement.prototype,window$3.Element.prototype,innerHTMLDescriptorPolyfill],'innerHTML');};var firstSourceWatch=function firstSourceWatch(tech){var el=tech.el();if(el.resetSourceWatch_){return;}
937var old={};var innerDescriptor=getInnerHTMLDescriptor(tech);var appendWrapper=function appendWrapper(appendFn){return function(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}
938var retval=appendFn.apply(el,args);sourcesetLoad(tech);return retval;};};['append','appendChild','insertAdjacentHTML'].forEach(function(k){if(!el[k]){return;}
939old[k]=el[k];el[k]=appendWrapper(old[k]);});Object.defineProperty(el,'innerHTML',mergeOptions(innerDescriptor,{set:appendWrapper(innerDescriptor.set)}));el.resetSourceWatch_=function(){el.resetSourceWatch_=null;Object.keys(old).forEach(function(k){el[k]=old[k];});Object.defineProperty(el,'innerHTML',innerDescriptor);};tech.one('sourceset',el.resetSourceWatch_);};var srcDescriptorPolyfill=Object.defineProperty({},'src',{get:function get(){if(this.hasAttribute('src')){return getAbsoluteURL(window$3.Element.prototype.getAttribute.call(this,'src'));}
940return '';},set:function set(v){window$3.Element.prototype.setAttribute.call(this,'src',v);return v;}});var getSrcDescriptor=function getSrcDescriptor(tech){return getDescriptor([tech.el(),window$3.HTMLMediaElement.prototype,srcDescriptorPolyfill],'src');};var setupSourceset=function setupSourceset(tech){if(!tech.featuresSourceset){return;}
941var el=tech.el();if(el.resetSourceset_){return;}
942var srcDescriptor=getSrcDescriptor(tech);var oldSetAttribute=el.setAttribute;var oldLoad=el.load;Object.defineProperty(el,'src',mergeOptions(srcDescriptor,{set:function set(v){var retval=srcDescriptor.set.call(el,v);tech.triggerSourceset(el.src);return retval;}}));el.setAttribute=function(n,v){var retval=oldSetAttribute.call(el,n,v);if(/src/i.test(n)){tech.triggerSourceset(el.src);}
943return retval;};el.load=function(){var retval=oldLoad.call(el);if(!sourcesetLoad(tech)){tech.triggerSourceset('');firstSourceWatch(tech);}
944return retval;};if(el.currentSrc){tech.triggerSourceset(el.currentSrc);}else if(!sourcesetLoad(tech)){firstSourceWatch(tech);}
945el.resetSourceset_=function(){el.resetSourceset_=null;el.load=oldLoad;el.setAttribute=oldSetAttribute;Object.defineProperty(el,'src',srcDescriptor);if(el.resetSourceWatch_){el.resetSourceWatch_();}};};var defineLazyProperty=function defineLazyProperty(obj,key,getValue,setter){if(setter===void 0){setter=true;}
946var set=function set(value){return Object.defineProperty(obj,key,{value:value,enumerable:true,writable:true});};var options={configurable:true,enumerable:true,get:function get(){var value=getValue();set(value);return value;}};if(setter){options.set=set;}
947return Object.defineProperty(obj,key,options);};var Html5=function(_Tech){inheritsLoose(Html5,_Tech);function Html5(options,ready){var _this;_this=_Tech.call(this,options,ready)||this;var source=options.source;var crossoriginTracks=false;if(source&&(_this.el_.currentSrc!==source.src||options.tag&&options.tag.initNetworkState_===3)){_this.setSource(source);}else{_this.handleLateInit_(_this.el_);}
948if(options.enableSourceset){_this.setupSourcesetHandling_();}
949if(_this.el_.hasChildNodes()){var nodes=_this.el_.childNodes;var nodesLength=nodes.length;var removeNodes=[];while(nodesLength--){var node=nodes[nodesLength];var nodeName=node.nodeName.toLowerCase();if(nodeName==='track'){if(!_this.featuresNativeTextTracks){removeNodes.push(node);}else{_this.remoteTextTrackEls().addTrackElement_(node);_this.remoteTextTracks().addTrack(node.track);_this.textTracks().addTrack(node.track);if(!crossoriginTracks&&!_this.el_.hasAttribute('crossorigin')&&isCrossOrigin(node.src)){crossoriginTracks=true;}}}}
950for(var i=0;i<removeNodes.length;i++){_this.el_.removeChild(removeNodes[i]);}}
951_this.proxyNativeTracks_();if(_this.featuresNativeTextTracks&&crossoriginTracks){log.warn('Text Tracks are being loaded from another origin but the crossorigin attribute isn\'t used.\n'+'This may prevent text tracks from loading.');}
952_this.restoreMetadataTracksInIOSNativePlayer_();if((TOUCH_ENABLED||IS_IPHONE||IS_NATIVE_ANDROID)&&options.nativeControlsForTouch===true){_this.setControls(true);}
953_this.proxyWebkitFullscreen_();_this.triggerReady();return _this;}
954var _proto=Html5.prototype;_proto.dispose=function dispose(){if(this.el_&&this.el_.resetSourceset_){this.el_.resetSourceset_();}
955Html5.disposeMediaElement(this.el_);this.options_=null;_Tech.prototype.dispose.call(this);};_proto.setupSourcesetHandling_=function setupSourcesetHandling_(){setupSourceset(this);};_proto.restoreMetadataTracksInIOSNativePlayer_=function restoreMetadataTracksInIOSNativePlayer_(){var textTracks=this.textTracks();var metadataTracksPreFullscreenState;var takeMetadataTrackSnapshot=function takeMetadataTrackSnapshot(){metadataTracksPreFullscreenState=[];for(var i=0;i<textTracks.length;i++){var track=textTracks[i];if(track.kind==='metadata'){metadataTracksPreFullscreenState.push({track:track,storedMode:track.mode});}}};takeMetadataTrackSnapshot();textTracks.addEventListener('change',takeMetadataTrackSnapshot);this.on('dispose',function(){return textTracks.removeEventListener('change',takeMetadataTrackSnapshot);});var restoreTrackMode=function restoreTrackMode(){for(var i=0;i<metadataTracksPreFullscreenState.length;i++){var storedTrack=metadataTracksPreFullscreenState[i];if(storedTrack.track.mode==='disabled'&&storedTrack.track.mode!==storedTrack.storedMode){storedTrack.track.mode=storedTrack.storedMode;}}
956textTracks.removeEventListener('change',restoreTrackMode);};this.on('webkitbeginfullscreen',function(){textTracks.removeEventListener('change',takeMetadataTrackSnapshot);textTracks.removeEventListener('change',restoreTrackMode);textTracks.addEventListener('change',restoreTrackMode);});this.on('webkitendfullscreen',function(){textTracks.removeEventListener('change',takeMetadataTrackSnapshot);textTracks.addEventListener('change',takeMetadataTrackSnapshot);textTracks.removeEventListener('change',restoreTrackMode);});};_proto.overrideNative_=function overrideNative_(type,override){var _this2=this;if(override!==this["featuresNative"+type+"Tracks"]){return;}
957var lowerCaseType=type.toLowerCase();if(this[lowerCaseType+"TracksListeners_"]){Object.keys(this[lowerCaseType+"TracksListeners_"]).forEach(function(eventName){var elTracks=_this2.el()[lowerCaseType+"Tracks"];elTracks.removeEventListener(eventName,_this2[lowerCaseType+"TracksListeners_"][eventName]);});}
958this["featuresNative"+type+"Tracks"]=!override;this[lowerCaseType+"TracksListeners_"]=null;this.proxyNativeTracksForType_(lowerCaseType);};_proto.overrideNativeAudioTracks=function overrideNativeAudioTracks(override){this.overrideNative_('Audio',override);};_proto.overrideNativeVideoTracks=function overrideNativeVideoTracks(override){this.overrideNative_('Video',override);};_proto.proxyNativeTracksForType_=function proxyNativeTracksForType_(name){var _this3=this;var props=NORMAL[name];var elTracks=this.el()[props.getterName];var techTracks=this[props.getterName]();if(!this["featuresNative"+props.capitalName+"Tracks"]||!elTracks||!elTracks.addEventListener){return;}
959var listeners={change:function change(e){var event={type:'change',target:techTracks,currentTarget:techTracks,srcElement:techTracks};techTracks.trigger(event);if(name==='text'){_this3[REMOTE.remoteText.getterName]().trigger(event);}},addtrack:function addtrack(e){techTracks.addTrack(e.track);},removetrack:function removetrack(e){techTracks.removeTrack(e.track);}};var removeOldTracks=function removeOldTracks(){var removeTracks=[];for(var i=0;i<techTracks.length;i++){var found=false;for(var j=0;j<elTracks.length;j++){if(elTracks[j]===techTracks[i]){found=true;break;}}
960if(!found){removeTracks.push(techTracks[i]);}}
961while(removeTracks.length){techTracks.removeTrack(removeTracks.shift());}};this[props.getterName+'Listeners_']=listeners;Object.keys(listeners).forEach(function(eventName){var listener=listeners[eventName];elTracks.addEventListener(eventName,listener);_this3.on('dispose',function(e){return elTracks.removeEventListener(eventName,listener);});});this.on('loadstart',removeOldTracks);this.on('dispose',function(e){return _this3.off('loadstart',removeOldTracks);});};_proto.proxyNativeTracks_=function proxyNativeTracks_(){var _this4=this;NORMAL.names.forEach(function(name){_this4.proxyNativeTracksForType_(name);});};_proto.createEl=function createEl(){var el=this.options_.tag;if(!el||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(el){var clone=el.cloneNode(true);if(el.parentNode){el.parentNode.insertBefore(clone,el);}
962Html5.disposeMediaElement(el);el=clone;}else{el=document.createElement('video');var tagAttributes=this.options_.tag&&getAttributes(this.options_.tag);var attributes=mergeOptions({},tagAttributes);if(!TOUCH_ENABLED||this.options_.nativeControlsForTouch!==true){delete attributes.controls;}
963setAttributes(el,assign(attributes,{id:this.options_.techId,"class":'vjs-tech'}));}
964el.playerId=this.options_.playerId;}
965if(typeof this.options_.preload!=='undefined'){setAttribute(el,'preload',this.options_.preload);}
966var settingsAttrs=['loop','muted','playsinline','autoplay'];for(var i=0;i<settingsAttrs.length;i++){var attr=settingsAttrs[i];var value=this.options_[attr];if(typeof value!=='undefined'){if(value){setAttribute(el,attr,attr);}else{removeAttribute(el,attr);}
967el[attr]=value;}}
968return el;};_proto.handleLateInit_=function handleLateInit_(el){if(el.networkState===0||el.networkState===3){return;}
969if(el.readyState===0){var loadstartFired=false;var setLoadstartFired=function setLoadstartFired(){loadstartFired=true;};this.on('loadstart',setLoadstartFired);var triggerLoadstart=function triggerLoadstart(){if(!loadstartFired){this.trigger('loadstart');}};this.on('loadedmetadata',triggerLoadstart);this.ready(function(){this.off('loadstart',setLoadstartFired);this.off('loadedmetadata',triggerLoadstart);if(!loadstartFired){this.trigger('loadstart');}});return;}
970var eventsToTrigger=['loadstart'];eventsToTrigger.push('loadedmetadata');if(el.readyState>=2){eventsToTrigger.push('loadeddata');}
971if(el.readyState>=3){eventsToTrigger.push('canplay');}
972if(el.readyState>=4){eventsToTrigger.push('canplaythrough');}
973this.ready(function(){eventsToTrigger.forEach(function(type){this.trigger(type);},this);});};_proto.setCurrentTime=function setCurrentTime(seconds){try{this.el_.currentTime=seconds;}catch(e){log(e,'Video is not ready. (Video.js)');}};_proto.duration=function duration(){var _this5=this;if(this.el_.duration===Infinity&&IS_ANDROID&&IS_CHROME&&this.el_.currentTime===0){var checkProgress=function checkProgress(){if(_this5.el_.currentTime>0){if(_this5.el_.duration===Infinity){_this5.trigger('durationchange');}
974_this5.off('timeupdate',checkProgress);}};this.on('timeupdate',checkProgress);return NaN;}
975return this.el_.duration||NaN;};_proto.width=function width(){return this.el_.offsetWidth;};_proto.height=function height(){return this.el_.offsetHeight;};_proto.proxyWebkitFullscreen_=function proxyWebkitFullscreen_(){var _this6=this;if(!('webkitDisplayingFullscreen'in this.el_)){return;}
976var endFn=function endFn(){this.trigger('fullscreenchange',{isFullscreen:false});};var beginFn=function beginFn(){if('webkitPresentationMode'in this.el_&&this.el_.webkitPresentationMode!=='picture-in-picture'){this.one('webkitendfullscreen',endFn);this.trigger('fullscreenchange',{isFullscreen:true});}};this.on('webkitbeginfullscreen',beginFn);this.on('dispose',function(){_this6.off('webkitbeginfullscreen',beginFn);_this6.off('webkitendfullscreen',endFn);});};_proto.supportsFullScreen=function supportsFullScreen(){if(typeof this.el_.webkitEnterFullScreen==='function'){var userAgent=window$3.navigator&&window$3.navigator.userAgent||'';if(/Android/.test(userAgent)||!/Chrome|Mac OS X 10.5/.test(userAgent)){return true;}}
977return false;};_proto.enterFullScreen=function enterFullScreen(){var video=this.el_;if(video.paused&&video.networkState<=video.HAVE_METADATA){silencePromise(this.el_.play());this.setTimeout(function(){video.pause();try{video.webkitEnterFullScreen();}catch(e){this.trigger('fullscreenerror',e);}},0);}else{try{video.webkitEnterFullScreen();}catch(e){this.trigger('fullscreenerror',e);}}};_proto.exitFullScreen=function exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen){this.trigger('fullscreenerror',new Error('The video is not fullscreen'));return;}
978this.el_.webkitExitFullScreen();};_proto.requestPictureInPicture=function requestPictureInPicture(){return this.el_.requestPictureInPicture();};_proto.src=function src(_src){if(_src===undefined){return this.el_.src;}
979this.setSrc(_src);};_proto.reset=function reset(){Html5.resetMediaElement(this.el_);};_proto.currentSrc=function currentSrc(){if(this.currentSource_){return this.currentSource_.src;}
980return this.el_.currentSrc;};_proto.setControls=function setControls(val){this.el_.controls=!!val;};_proto.addTextTrack=function addTextTrack(kind,label,language){if(!this.featuresNativeTextTracks){return _Tech.prototype.addTextTrack.call(this,kind,label,language);}
981return this.el_.addTextTrack(kind,label,language);};_proto.createRemoteTextTrack=function createRemoteTextTrack(options){if(!this.featuresNativeTextTracks){return _Tech.prototype.createRemoteTextTrack.call(this,options);}
982var htmlTrackElement=document.createElement('track');if(options.kind){htmlTrackElement.kind=options.kind;}
983if(options.label){htmlTrackElement.label=options.label;}
984if(options.language||options.srclang){htmlTrackElement.srclang=options.language||options.srclang;}
985if(options["default"]){htmlTrackElement["default"]=options["default"];}
986if(options.id){htmlTrackElement.id=options.id;}
987if(options.src){htmlTrackElement.src=options.src;}
988return htmlTrackElement;};_proto.addRemoteTextTrack=function addRemoteTextTrack(options,manualCleanup){var htmlTrackElement=_Tech.prototype.addRemoteTextTrack.call(this,options,manualCleanup);if(this.featuresNativeTextTracks){this.el().appendChild(htmlTrackElement);}
989return htmlTrackElement;};_proto.removeRemoteTextTrack=function removeRemoteTextTrack(track){_Tech.prototype.removeRemoteTextTrack.call(this,track);if(this.featuresNativeTextTracks){var tracks=this.$$('track');var i=tracks.length;while(i--){if(track===tracks[i]||track===tracks[i].track){this.el().removeChild(tracks[i]);}}}};_proto.getVideoPlaybackQuality=function getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality==='function'){return this.el().getVideoPlaybackQuality();}
990var videoPlaybackQuality={};if(typeof this.el().webkitDroppedFrameCount!=='undefined'&&typeof this.el().webkitDecodedFrameCount!=='undefined'){videoPlaybackQuality.droppedVideoFrames=this.el().webkitDroppedFrameCount;videoPlaybackQuality.totalVideoFrames=this.el().webkitDecodedFrameCount;}
991if(window$3.performance&&typeof window$3.performance.now==='function'){videoPlaybackQuality.creationTime=window$3.performance.now();}else if(window$3.performance&&window$3.performance.timing&&typeof window$3.performance.timing.navigationStart==='number'){videoPlaybackQuality.creationTime=window$3.Date.now()-window$3.performance.timing.navigationStart;}
992return videoPlaybackQuality;};return Html5;}(Tech);defineLazyProperty(Html5,'TEST_VID',function(){if(!isReal()){return;}
993var video=document.createElement('video');var track=document.createElement('track');track.kind='captions';track.srclang='en';track.label='English';video.appendChild(track);return video;});Html5.isSupported=function(){try{Html5.TEST_VID.volume=0.5;}catch(e){return false;}
994return!!(Html5.TEST_VID&&Html5.TEST_VID.canPlayType);};Html5.canPlayType=function(type){return Html5.TEST_VID.canPlayType(type);};Html5.canPlaySource=function(srcObj,options){return Html5.canPlayType(srcObj.type);};Html5.canControlVolume=function(){try{var volume=Html5.TEST_VID.volume;Html5.TEST_VID.volume=volume/2+0.1;return volume!==Html5.TEST_VID.volume;}catch(e){return false;}};Html5.canMuteVolume=function(){try{var muted=Html5.TEST_VID.muted;Html5.TEST_VID.muted=!muted;if(Html5.TEST_VID.muted){setAttribute(Html5.TEST_VID,'muted','muted');}else{removeAttribute(Html5.TEST_VID,'muted','muted');}
995return muted!==Html5.TEST_VID.muted;}catch(e){return false;}};Html5.canControlPlaybackRate=function(){if(IS_ANDROID&&IS_CHROME&&CHROME_VERSION<58){return false;}
996try{var playbackRate=Html5.TEST_VID.playbackRate;Html5.TEST_VID.playbackRate=playbackRate/2+0.1;return playbackRate!==Html5.TEST_VID.playbackRate;}catch(e){return false;}};Html5.canOverrideAttributes=function(){try{var noop=function noop(){};Object.defineProperty(document.createElement('video'),'src',{get:noop,set:noop});Object.defineProperty(document.createElement('audio'),'src',{get:noop,set:noop});Object.defineProperty(document.createElement('video'),'innerHTML',{get:noop,set:noop});Object.defineProperty(document.createElement('audio'),'innerHTML',{get:noop,set:noop});}catch(e){return false;}
997return true;};Html5.supportsNativeTextTracks=function(){return IS_ANY_SAFARI||IS_IOS&&IS_CHROME;};Html5.supportsNativeVideoTracks=function(){return!!(Html5.TEST_VID&&Html5.TEST_VID.videoTracks);};Html5.supportsNativeAudioTracks=function(){return!!(Html5.TEST_VID&&Html5.TEST_VID.audioTracks);};Html5.Events=['loadstart','suspend','abort','error','emptied','stalled','loadedmetadata','loadeddata','canplay','canplaythrough','playing','waiting','seeking','seeked','ended','durationchange','timeupdate','progress','play','pause','ratechange','resize','volumechange'];[['featuresVolumeControl','canControlVolume'],['featuresMuteControl','canMuteVolume'],['featuresPlaybackRate','canControlPlaybackRate'],['featuresSourceset','canOverrideAttributes'],['featuresNativeTextTracks','supportsNativeTextTracks'],['featuresNativeVideoTracks','supportsNativeVideoTracks'],['featuresNativeAudioTracks','supportsNativeAudioTracks']].forEach(function(_ref){var key=_ref[0],fn=_ref[1];defineLazyProperty(Html5.prototype,key,function(){return Html5[fn]();},true);});Html5.prototype.movingMediaElementInDOM=!IS_IOS;Html5.prototype.featuresFullscreenResize=true;Html5.prototype.featuresProgressEvents=true;Html5.prototype.featuresTimeupdateEvents=true;var canPlayType;Html5.patchCanPlayType=function(){if(ANDROID_VERSION>=4.0&&!IS_FIREFOX&&!IS_CHROME){canPlayType=Html5.TEST_VID&&Html5.TEST_VID.constructor.prototype.canPlayType;Html5.TEST_VID.constructor.prototype.canPlayType=function(type){var mpegurlRE=/^application\/(?:x-|vnd\.apple\.)mpegurl/i;if(type&&mpegurlRE.test(type)){return 'maybe';}
998return canPlayType.call(this,type);};}};Html5.unpatchCanPlayType=function(){var r=Html5.TEST_VID.constructor.prototype.canPlayType;if(canPlayType){Html5.TEST_VID.constructor.prototype.canPlayType=canPlayType;}
999return r;};Html5.patchCanPlayType();Html5.disposeMediaElement=function(el){if(!el){return;}
1000if(el.parentNode){el.parentNode.removeChild(el);}
1001while(el.hasChildNodes()){el.removeChild(el.firstChild);}
1002el.removeAttribute('src');if(typeof el.load==='function'){(function(){try{el.load();}catch(e){}})();}};Html5.resetMediaElement=function(el){if(!el){return;}
1003var sources=el.querySelectorAll('source');var i=sources.length;while(i--){el.removeChild(sources[i]);}
1004el.removeAttribute('src');if(typeof el.load==='function'){(function(){try{el.load();}catch(e){}})();}};['muted','defaultMuted','autoplay','controls','loop','playsinline'].forEach(function(prop){Html5.prototype[prop]=function(){return this.el_[prop]||this.el_.hasAttribute(prop);};});['muted','defaultMuted','autoplay','loop','playsinline'].forEach(function(prop){Html5.prototype['set'+toTitleCase(prop)]=function(v){this.el_[prop]=v;if(v){this.el_.setAttribute(prop,prop);}else{this.el_.removeAttribute(prop);}};});['paused','currentTime','buffered','volume','poster','preload','error','seeking','seekable','ended','playbackRate','defaultPlaybackRate','played','networkState','readyState','videoWidth','videoHeight','crossOrigin'].forEach(function(prop){Html5.prototype[prop]=function(){return this.el_[prop];};});['volume','src','poster','preload','playbackRate','defaultPlaybackRate','crossOrigin'].forEach(function(prop){Html5.prototype['set'+toTitleCase(prop)]=function(v){this.el_[prop]=v;};});['pause','load','play'].forEach(function(prop){Html5.prototype[prop]=function(){return this.el_[prop]();};});Tech.withSourceHandlers(Html5);Html5.nativeSourceHandler={};Html5.nativeSourceHandler.canPlayType=function(type){try{return Html5.TEST_VID.canPlayType(type);}catch(e){return '';}};Html5.nativeSourceHandler.canHandleSource=function(source,options){if(source.type){return Html5.nativeSourceHandler.canPlayType(source.type);}else if(source.src){var ext=getFileExtension(source.src);return Html5.nativeSourceHandler.canPlayType("video/"+ext);}
1005return '';};Html5.nativeSourceHandler.handleSource=function(source,tech,options){tech.setSrc(source.src);};Html5.nativeSourceHandler.dispose=function(){};Html5.registerSourceHandler(Html5.nativeSourceHandler);Tech.registerTech('Html5',Html5);var TECH_EVENTS_RETRIGGER=['progress','abort','suspend','emptied','stalled','loadedmetadata','loadeddata','timeupdate','resize','volumechange','texttrackchange'];var TECH_EVENTS_QUEUE={canplay:'CanPlay',canplaythrough:'CanPlayThrough',playing:'Playing',seeked:'Seeked'};var BREAKPOINT_ORDER=['tiny','xsmall','small','medium','large','xlarge','huge'];var BREAKPOINT_CLASSES={};BREAKPOINT_ORDER.forEach(function(k){var v=k.charAt(0)==='x'?"x-"+k.substring(1):k;BREAKPOINT_CLASSES[k]="vjs-layout-"+v;});var DEFAULT_BREAKPOINTS={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:Infinity};var Player=function(_Component){inheritsLoose(Player,_Component);function Player(tag,options,ready){var _this;tag.id=tag.id||options.id||"vjs_video_"+newGUID();options=assign(Player.getTagSettings(tag),options);options.initChildren=false;options.createEl=false;options.evented=false;options.reportTouchActivity=false;if(!options.language){if(typeof tag.closest==='function'){var closest=tag.closest('[lang]');if(closest&&closest.getAttribute){options.language=closest.getAttribute('lang');}}else{var element=tag;while(element&&element.nodeType===1){if(getAttributes(element).hasOwnProperty('lang')){options.language=element.getAttribute('lang');break;}
1006element=element.parentNode;}}}
1007_this=_Component.call(this,null,options,ready)||this;_this.boundDocumentFullscreenChange_=bind(assertThisInitialized(_this),_this.documentFullscreenChange_);_this.boundFullWindowOnEscKey_=bind(assertThisInitialized(_this),_this.fullWindowOnEscKey);_this.isFullscreen_=false;_this.log=createLogger$1(_this.id_);_this.fsApi_=FullscreenApi;_this.isPosterFromTech_=false;_this.queuedCallbacks_=[];_this.isReady_=false;_this.hasStarted_=false;_this.userActive_=false;if(!_this.options_||!_this.options_.techOrder||!_this.options_.techOrder.length){throw new Error('No techOrder specified. Did you overwrite '+'videojs.options instead of just changing the '+'properties you want to override?');}
1008_this.tag=tag;_this.tagAttributes=tag&&getAttributes(tag);_this.language(_this.options_.language);if(options.languages){var languagesToLower={};Object.getOwnPropertyNames(options.languages).forEach(function(name){languagesToLower[name.toLowerCase()]=options.languages[name];});_this.languages_=languagesToLower;}else{_this.languages_=Player.prototype.options_.languages;}
1009_this.resetCache_();_this.poster_=options.poster||'';_this.controls_=!!options.controls;tag.controls=false;tag.removeAttribute('controls');_this.changingSrc_=false;_this.playCallbacks_=[];_this.playTerminatedQueue_=[];if(tag.hasAttribute('autoplay')){_this.autoplay(true);}else{_this.autoplay(_this.options_.autoplay);}
1010if(options.plugins){Object.keys(options.plugins).forEach(function(name){if(typeof _this[name]!=='function'){throw new Error("plugin \""+name+"\" does not exist");}});}
1011_this.scrubbing_=false;_this.el_=_this.createEl();evented(assertThisInitialized(_this),{eventBusKey:'el_'});if(_this.fsApi_.requestFullscreen){on(document,_this.fsApi_.fullscreenchange,_this.boundDocumentFullscreenChange_);_this.on(_this.fsApi_.fullscreenchange,_this.boundDocumentFullscreenChange_);}
1012if(_this.fluid_){_this.on('playerreset',_this.updateStyleEl_);}
1013var playerOptionsCopy=mergeOptions(_this.options_);if(options.plugins){Object.keys(options.plugins).forEach(function(name){_this[name](options.plugins[name]);});}
1014_this.options_.playerOptions=playerOptionsCopy;_this.middleware_=[];_this.initChildren();_this.isAudio(tag.nodeName.toLowerCase()==='audio');if(_this.controls()){_this.addClass('vjs-controls-enabled');}else{_this.addClass('vjs-controls-disabled');}
1015_this.el_.setAttribute('role','region');if(_this.isAudio()){_this.el_.setAttribute('aria-label',_this.localize('Audio Player'));}else{_this.el_.setAttribute('aria-label',_this.localize('Video Player'));}
1016if(_this.isAudio()){_this.addClass('vjs-audio');}
1017if(_this.flexNotSupported_()){_this.addClass('vjs-no-flex');}
1018if(TOUCH_ENABLED){_this.addClass('vjs-touch-enabled');}
1019if(!IS_IOS){_this.addClass('vjs-workinghover');}
1020Player.players[_this.id_]=assertThisInitialized(_this);var majorVersion=version.split('.')[0];_this.addClass("vjs-v"+majorVersion);_this.userActive(true);_this.reportUserActivity();_this.one('play',_this.listenForUserActivity_);_this.on('stageclick',_this.handleStageClick_);_this.on('keydown',_this.handleKeyDown);_this.breakpoints(_this.options_.breakpoints);_this.responsive(_this.options_.responsive);return _this;}
1021var _proto=Player.prototype;_proto.dispose=function dispose(){var _this2=this;this.trigger('dispose');this.off('dispose');off(document,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_);off(document,'keydown',this.boundFullWindowOnEscKey_);if(this.styleEl_&&this.styleEl_.parentNode){this.styleEl_.parentNode.removeChild(this.styleEl_);this.styleEl_=null;}
1022Player.players[this.id_]=null;if(this.tag&&this.tag.player){this.tag.player=null;}
1023if(this.el_&&this.el_.player){this.el_.player=null;}
1024if(this.tech_){this.tech_.dispose();this.isPosterFromTech_=false;this.poster_='';}
1025if(this.playerElIngest_){this.playerElIngest_=null;}
1026if(this.tag){this.tag=null;}
1027clearCacheForPlayer(this);ALL.names.forEach(function(name){var props=ALL[name];var list=_this2[props.getterName]();if(list&&list.off){list.off();}});_Component.prototype.dispose.call(this);};_proto.createEl=function createEl(){var tag=this.tag;var el;var playerElIngest=this.playerElIngest_=tag.parentNode&&tag.parentNode.hasAttribute&&tag.parentNode.hasAttribute('data-vjs-player');var divEmbed=this.tag.tagName.toLowerCase()==='video-js';if(playerElIngest){el=this.el_=tag.parentNode;}else if(!divEmbed){el=this.el_=_Component.prototype.createEl.call(this,'div');}
1028var attrs=getAttributes(tag);if(divEmbed){el=this.el_=tag;tag=this.tag=document.createElement('video');while(el.children.length){tag.appendChild(el.firstChild);}
1029if(!hasClass(el,'video-js')){addClass(el,'video-js');}
1030el.appendChild(tag);playerElIngest=this.playerElIngest_=el;Object.keys(el).forEach(function(k){try{tag[k]=el[k];}catch(e){}});}
1031tag.setAttribute('tabindex','-1');attrs.tabindex='-1';if(IE_VERSION||IS_CHROME&&IS_WINDOWS){tag.setAttribute('role','application');attrs.role='application';}
1032tag.removeAttribute('width');tag.removeAttribute('height');if('width'in attrs){delete attrs.width;}
1033if('height'in attrs){delete attrs.height;}
1034Object.getOwnPropertyNames(attrs).forEach(function(attr){if(!(divEmbed&&attr==='class')){el.setAttribute(attr,attrs[attr]);}
1035if(divEmbed){tag.setAttribute(attr,attrs[attr]);}});tag.playerId=tag.id;tag.id+='_html5_api';tag.className='vjs-tech';tag.player=el.player=this;this.addClass('vjs-paused');if(window$3.VIDEOJS_NO_DYNAMIC_STYLE!==true){this.styleEl_=createStyleElement('vjs-styles-dimensions');var defaultsStyleEl=$('.vjs-styles-defaults');var head=$('head');head.insertBefore(this.styleEl_,defaultsStyleEl?defaultsStyleEl.nextSibling:head.firstChild);}
1036this.fill_=false;this.fluid_=false;this.width(this.options_.width);this.height(this.options_.height);this.fill(this.options_.fill);this.fluid(this.options_.fluid);this.aspectRatio(this.options_.aspectRatio);this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);var links=tag.getElementsByTagName('a');for(var i=0;i<links.length;i++){var linkEl=links.item(i);addClass(linkEl,'vjs-hidden');linkEl.setAttribute('hidden','hidden');}
1037tag.initNetworkState_=tag.networkState;if(tag.parentNode&&!playerElIngest){tag.parentNode.insertBefore(el,tag);}
1038prependTo(tag,el);this.children_.unshift(tag);this.el_.setAttribute('lang',this.language_);this.el_=el;return el;};_proto.crossOrigin=function crossOrigin(value){if(!value){return this.techGet_('crossOrigin');}
1039if(value!=='anonymous'&&value!=='use-credentials'){log.warn("crossOrigin must be \"anonymous\" or \"use-credentials\", given \""+value+"\"");return;}
1040this.techCall_('setCrossOrigin',value);return;};_proto.width=function width(value){return this.dimension('width',value);};_proto.height=function height(value){return this.dimension('height',value);};_proto.dimension=function dimension(_dimension,value){var privDimension=_dimension+'_';if(value===undefined){return this[privDimension]||0;}
1041if(value===''||value==='auto'){this[privDimension]=undefined;this.updateStyleEl_();return;}
1042var parsedVal=parseFloat(value);if(isNaN(parsedVal)){log.error("Improper value \""+value+"\" supplied for for "+_dimension);return;}
1043this[privDimension]=parsedVal;this.updateStyleEl_();};_proto.fluid=function fluid(bool){if(bool===undefined){return!!this.fluid_;}
1044this.fluid_=!!bool;if(isEvented(this)){this.off('playerreset',this.updateStyleEl_);}
1045if(bool){this.addClass('vjs-fluid');this.fill(false);addEventedCallback(function(){this.on('playerreset',this.updateStyleEl_);});}else{this.removeClass('vjs-fluid');}
1046this.updateStyleEl_();};_proto.fill=function fill(bool){if(bool===undefined){return!!this.fill_;}
1047this.fill_=!!bool;if(bool){this.addClass('vjs-fill');this.fluid(false);}else{this.removeClass('vjs-fill');}};_proto.aspectRatio=function aspectRatio(ratio){if(ratio===undefined){return this.aspectRatio_;}
1048if(!/^\d+\:\d+$/.test(ratio)){throw new Error('Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.');}
1049this.aspectRatio_=ratio;this.fluid(true);this.updateStyleEl_();};_proto.updateStyleEl_=function updateStyleEl_(){if(window$3.VIDEOJS_NO_DYNAMIC_STYLE===true){var _width=typeof this.width_==='number'?this.width_:this.options_.width;var _height=typeof this.height_==='number'?this.height_:this.options_.height;var techEl=this.tech_&&this.tech_.el();if(techEl){if(_width>=0){techEl.width=_width;}
1050if(_height>=0){techEl.height=_height;}}
1051return;}
1052var width;var height;var aspectRatio;var idClass;if(this.aspectRatio_!==undefined&&this.aspectRatio_!=='auto'){aspectRatio=this.aspectRatio_;}else if(this.videoWidth()>0){aspectRatio=this.videoWidth()+':'+this.videoHeight();}else{aspectRatio='16:9';}
1053var ratioParts=aspectRatio.split(':');var ratioMultiplier=ratioParts[1]/ratioParts[0];if(this.width_!==undefined){width=this.width_;}else if(this.height_!==undefined){width=this.height_/ratioMultiplier;}else{width=this.videoWidth()||300;}
1054if(this.height_!==undefined){height=this.height_;}else{height=width*ratioMultiplier;}
1055if(/^[^a-zA-Z]/.test(this.id())){idClass='dimensions-'+this.id();}else{idClass=this.id()+'-dimensions';}
1056this.addClass(idClass);setTextContent(this.styleEl_,"\n      ."+idClass+" {\n        width: "+width+"px;\n        height: "+height+"px;\n      }\n\n      ."+idClass+".vjs-fluid {\n        padding-top: "+ratioMultiplier*100+"%;\n      }\n    ");};_proto.loadTech_=function loadTech_(techName,source){var _this3=this;if(this.tech_){this.unloadTech_();}
1057var titleTechName=toTitleCase(techName);var camelTechName=techName.charAt(0).toLowerCase()+techName.slice(1);if(titleTechName!=='Html5'&&this.tag){Tech.getTech('Html5').disposeMediaElement(this.tag);this.tag.player=null;this.tag=null;}
1058this.techName_=titleTechName;this.isReady_=false;var autoplay=typeof this.autoplay()==='string'?false:this.autoplay();var techOptions={source:source,autoplay:autoplay,'nativeControlsForTouch':this.options_.nativeControlsForTouch,'playerId':this.id(),'techId':this.id()+"_"+camelTechName+"_api",'playsinline':this.options_.playsinline,'preload':this.options_.preload,'loop':this.options_.loop,'muted':this.options_.muted,'poster':this.poster(),'language':this.language(),'playerElIngest':this.playerElIngest_||false,'vtt.js':this.options_['vtt.js'],'canOverridePoster':!!this.options_.techCanOverridePoster,'enableSourceset':this.options_.enableSourceset,'Promise':this.options_.Promise};
vendor: 3,179 bytes, lines 1058-1065
1058ALL.names.forEach(function(name){var props=ALL[name];techOptions[props.getterName]=_this3[props.privateName];});assign(techOptions,this.options_[titleTechName]);assign(techOptions,this.options_[camelTechName]);assign(techOptions,this.options_[techName.toLowerCase()]);if(this.tag){techOptions.tag=this.tag;}
1059if(source&&source.src===this.cache_.src&&this.cache_.currentTime>0){techOptions.startTime=this.cache_.currentTime;}
1060var TechClass=Tech.getTech(techName);if(!TechClass){throw new Error("No Tech named '"+titleTechName+"' exists! '"+titleTechName+"' should be registered using videojs.registerTech()'");}
1061this.tech_=new TechClass(techOptions);this.tech_.ready(bind(this,this.handleTechReady_),true);textTrackConverter.jsonToTextTracks(this.textTracksJson_||[],this.tech_);TECH_EVENTS_RETRIGGER.forEach(function(event){_this3.on(_this3.tech_,event,_this3["handleTech"+toTitleCase(event)+"_"]);});Object.keys(TECH_EVENTS_QUEUE).forEach(function(event){_this3.on(_this3.tech_,event,function(eventObj){if(_this3.tech_.playbackRate()===0&&_this3.tech_.seeking()){_this3.queuedCallbacks_.push({callback:_this3["handleTech"+TECH_EVENTS_QUEUE[event]+"_"].bind(_this3),event:eventObj});return;}
1062_this3["handleTech"+TECH_EVENTS_QUEUE[event]+"_"](eventObj);});});this.on(this.tech_,'loadstart',this.handleTechLoadStart_);this.on(this.tech_,'sourceset',this.handleTechSourceset_);this.on(this.tech_,'waiting',this.handleTechWaiting_);this.on(this.tech_,'ended',this.handleTechEnded_);this.on(this.tech_,'seeking',this.handleTechSeeking_);this.on(this.tech_,'play',this.handleTechPlay_);this.on(this.tech_,'firstplay',this.handleTechFirstPlay_);this.on(this.tech_,'pause',this.handleTechPause_);this.on(this.tech_,'durationchange',this.handleTechDurationChange_);this.on(this.tech_,'fullscreenchange',this.handleTechFullscreenChange_);this.on(this.tech_,'fullscreenerror',this.handleTechFullscreenError_);this.on(this.tech_,'enterpictureinpicture',this.handleTechEnterPictureInPicture_);this.on(this.tech_,'leavepictureinpicture',this.handleTechLeavePictureInPicture_);this.on(this.tech_,'error',this.handleTechError_);this.on(this.tech_,'loadedmetadata',this.updateStyleEl_);this.on(this.tech_,'posterchange',this.handleTechPosterChange_);this.on(this.tech_,'textdata',this.handleTechTextData_);this.on(this.tech_,'ratechange',this.handleTechRateChange_);this.usingNativeControls(this.techGet_('controls'));if(this.controls()&&!this.usingNativeControls()){this.addTechControlsListeners_();}
1063if(this.tech_.el().parentNode!==this.el()&&(titleTechName!=='Html5'||!this.tag)){prependTo(this.tech_.el(),this.el());}
1064if(this.tag){this.tag.player=null;this.tag=null;}};_proto.unloadTech_=function unloadTech_(){var _this4=this;ALL.names.forEach(function(name){var props=ALL[name];_this4[props.privateName]=_this4[props.getterName]();});this.textTracksJson_=textTrackConverter.textTracksToJson(this.tech_);this.isReady_=false;this.tech_.dispose();this.tech_=false;if(this.isPosterFromTech_){this.poster_='';this.trigger('posterchange');}
1065this.isPosterFromTech_=false;};_proto.tech=function tech(safety){if(safety===undefined){log.warn('Using the tech directly can be dangerous. I hope you know 
vendor: 35,260 bytes, lines 1065-1189
1065what you\'re doing.\n'+'See https://github.com/videojs/video.js/issues/2617 for more info.\n');}
1066return this.tech_;};_proto.addTechControlsListeners_=function addTechControlsListeners_(){this.removeTechControlsListeners_();this.on(this.tech_,'mouseup',this.handleTechClick_);this.on(this.tech_,'dblclick',this.handleTechDoubleClick_);this.on(this.tech_,'touchstart',this.handleTechTouchStart_);this.on(this.tech_,'touchmove',this.handleTechTouchMove_);this.on(this.tech_,'touchend',this.handleTechTouchEnd_);this.on(this.tech_,'tap',this.handleTechTap_);};_proto.removeTechControlsListeners_=function removeTechControlsListeners_(){this.off(this.tech_,'tap',this.handleTechTap_);this.off(this.tech_,'touchstart',this.handleTechTouchStart_);this.off(this.tech_,'touchmove',this.handleTechTouchMove_);this.off(this.tech_,'touchend',this.handleTechTouchEnd_);this.off(this.tech_,'mouseup',this.handleTechClick_);this.off(this.tech_,'dblclick',this.handleTechDoubleClick_);};_proto.handleTechReady_=function handleTechReady_(){this.triggerReady();if(this.cache_.volume){this.techCall_('setVolume',this.cache_.volume);}
1067this.handleTechPosterChange_();this.handleTechDurationChange_();};_proto.handleTechLoadStart_=function handleTechLoadStart_(){this.removeClass('vjs-ended');this.removeClass('vjs-seeking');this.error(null);this.handleTechDurationChange_();if(!this.paused()){this.trigger('loadstart');this.trigger('firstplay');}else{this.hasStarted(false);this.trigger('loadstart');}
1068this.manualAutoplay_(this.autoplay());};_proto.manualAutoplay_=function manualAutoplay_(type){var _this5=this;if(!this.tech_||typeof type!=='string'){return;}
1069var muted=function muted(){var previouslyMuted=_this5.muted();_this5.muted(true);var restoreMuted=function restoreMuted(){_this5.muted(previouslyMuted);};_this5.playTerminatedQueue_.push(restoreMuted);var mutedPromise=_this5.play();if(!isPromise(mutedPromise)){return;}
1070return mutedPromise["catch"](restoreMuted);};var promise;if(type==='any'&&this.muted()!==true){promise=this.play();if(isPromise(promise)){promise=promise["catch"](muted);}}else if(type==='muted'&&this.muted()!==true){promise=muted();}else{promise=this.play();}
1071if(!isPromise(promise)){return;}
1072return promise.then(function(){_this5.trigger({type:'autoplay-success',autoplay:type});})["catch"](function(e){_this5.trigger({type:'autoplay-failure',autoplay:type});});};_proto.updateSourceCaches_=function updateSourceCaches_(srcObj){if(srcObj===void 0){srcObj='';}
1073var src=srcObj;var type='';if(typeof src!=='string'){src=srcObj.src;type=srcObj.type;}
1074this.cache_.source=this.cache_.source||{};this.cache_.sources=this.cache_.sources||[];if(src&&!type){type=findMimetype(this,src);}
1075this.cache_.source=mergeOptions({},srcObj,{src:src,type:type});var matchingSources=this.cache_.sources.filter(function(s){return s.src&&s.src===src;});var sourceElSources=[];var sourceEls=this.$$('source');var matchingSourceEls=[];for(var i=0;i<sourceEls.length;i++){var sourceObj=getAttributes(sourceEls[i]);sourceElSources.push(sourceObj);if(sourceObj.src&&sourceObj.src===src){matchingSourceEls.push(sourceObj.src);}}
1076if(matchingSourceEls.length&&!matchingSources.length){this.cache_.sources=sourceElSources;}else if(!matchingSources.length){this.cache_.sources=[this.cache_.source];}
1077this.cache_.src=src;};_proto.handleTechSourceset_=function handleTechSourceset_(event){var _this6=this;if(!this.changingSrc_){var updateSourceCaches=function updateSourceCaches(src){return _this6.updateSourceCaches_(src);};var playerSrc=this.currentSource().src;var eventSrc=event.src;if(playerSrc&&!/^blob:/.test(playerSrc)&&/^blob:/.test(eventSrc)){if(!this.lastSource_||this.lastSource_.tech!==eventSrc&&this.lastSource_.player!==playerSrc){updateSourceCaches=function updateSourceCaches(){};}}
1078updateSourceCaches(eventSrc);if(!event.src){this.tech_.any(['sourceset','loadstart'],function(e){if(e.type==='sourceset'){return;}
1079var techSrc=_this6.techGet('currentSrc');_this6.lastSource_.tech=techSrc;_this6.updateSourceCaches_(techSrc);});}}
1080this.lastSource_={player:this.currentSource().src,tech:event.src};this.trigger({src:event.src,type:'sourceset'});};_proto.hasStarted=function hasStarted(request){if(request===undefined){return this.hasStarted_;}
1081if(request===this.hasStarted_){return;}
1082this.hasStarted_=request;if(this.hasStarted_){this.addClass('vjs-has-started');this.trigger('firstplay');}else{this.removeClass('vjs-has-started');}};_proto.handleTechPlay_=function handleTechPlay_(){this.removeClass('vjs-ended');this.removeClass('vjs-paused');this.addClass('vjs-playing');this.hasStarted(true);this.trigger('play');};_proto.handleTechRateChange_=function handleTechRateChange_(){if(this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0){this.queuedCallbacks_.forEach(function(queued){return queued.callback(queued.event);});this.queuedCallbacks_=[];}
1083this.cache_.lastPlaybackRate=this.tech_.playbackRate();this.trigger('ratechange');};_proto.handleTechWaiting_=function handleTechWaiting_(){var _this7=this;this.addClass('vjs-waiting');this.trigger('waiting');var timeWhenWaiting=this.currentTime();var timeUpdateListener=function timeUpdateListener(){if(timeWhenWaiting!==_this7.currentTime()){_this7.removeClass('vjs-waiting');_this7.off('timeupdate',timeUpdateListener);}};this.on('timeupdate',timeUpdateListener);};_proto.handleTechCanPlay_=function handleTechCanPlay_(){this.removeClass('vjs-waiting');this.trigger('canplay');};_proto.handleTechCanPlayThrough_=function handleTechCanPlayThrough_(){this.removeClass('vjs-waiting');this.trigger('canplaythrough');};_proto.handleTechPlaying_=function handleTechPlaying_(){this.removeClass('vjs-waiting');this.trigger('playing');};_proto.handleTechSeeking_=function handleTechSeeking_(){this.addClass('vjs-seeking');this.trigger('seeking');};_proto.handleTechSeeked_=function handleTechSeeked_(){this.removeClass('vjs-seeking');this.removeClass('vjs-ended');this.trigger('seeked');};_proto.handleTechFirstPlay_=function handleTechFirstPlay_(){if(this.options_.starttime){log.warn('Passing the `starttime` option to the player will be deprecated in 6.0');this.currentTime(this.options_.starttime);}
1084this.addClass('vjs-has-started');this.trigger('firstplay');};_proto.handleTechPause_=function handleTechPause_(){this.removeClass('vjs-playing');this.addClass('vjs-paused');this.trigger('pause');};_proto.handleTechEnded_=function handleTechEnded_(){this.addClass('vjs-ended');if(this.options_.loop){this.currentTime(0);this.play();}else if(!this.paused()){this.pause();}
1085this.trigger('ended');};_proto.handleTechDurationChange_=function handleTechDurationChange_(){this.duration(this.techGet_('duration'));};_proto.handleTechClick_=function handleTechClick_(event){if(!isSingleLeftClick(event)){return;}
1086if(!this.controls_){return;}
1087if(this.paused()){silencePromise(this.play());}else{this.pause();}};_proto.handleTechDoubleClick_=function handleTechDoubleClick_(event){if(!this.controls_){return;}
1088var inAllowedEls=Array.prototype.some.call(this.$$('.vjs-control-bar, .vjs-modal-dialog'),function(el){return el.contains(event.target);});if(!inAllowedEls){if(this.options_===undefined||this.options_.userActions===undefined||this.options_.userActions.doubleClick===undefined||this.options_.userActions.doubleClick!==false){if(this.options_!==undefined&&this.options_.userActions!==undefined&&typeof this.options_.userActions.doubleClick==='function'){this.options_.userActions.doubleClick.call(this,event);}else if(this.isFullscreen()){this.exitFullscreen();}else{this.requestFullscreen();}}}};_proto.handleTechTap_=function handleTechTap_(){this.userActive(!this.userActive());};_proto.handleTechTouchStart_=function handleTechTouchStart_(){this.userWasActive=this.userActive();};_proto.handleTechTouchMove_=function handleTechTouchMove_(){if(this.userWasActive){this.reportUserActivity();}};_proto.handleTechTouchEnd_=function handleTechTouchEnd_(event){event.preventDefault();};_proto.handleStageClick_=function handleStageClick_(){this.reportUserActivity();};_proto.toggleFullscreenClass_=function toggleFullscreenClass_(){if(this.isFullscreen()){this.addClass('vjs-fullscreen');}else{this.removeClass('vjs-fullscreen');}};_proto.documentFullscreenChange_=function documentFullscreenChange_(e){var targetPlayer=e.target.player;if(targetPlayer&&targetPlayer!==this){return;}
1089var el=this.el();var isFs=document[this.fsApi_.fullscreenElement]===el;if(!isFs&&el.matches){isFs=el.matches(':'+this.fsApi_.fullscreen);}else if(!isFs&&el.msMatchesSelector){isFs=el.msMatchesSelector(':'+this.fsApi_.fullscreen);}
1090this.isFullscreen(isFs);};_proto.handleTechFullscreenChange_=function handleTechFullscreenChange_(event,data){if(data){this.isFullscreen(data.isFullscreen);}};_proto.handleTechFullscreenError_=function handleTechFullscreenError_(event,err){this.trigger('fullscreenerror',err);};_proto.togglePictureInPictureClass_=function togglePictureInPictureClass_(){if(this.isInPictureInPicture()){this.addClass('vjs-picture-in-picture');}else{this.removeClass('vjs-picture-in-picture');}};_proto.handleTechEnterPictureInPicture_=function handleTechEnterPictureInPicture_(event){this.isInPictureInPicture(true);};_proto.handleTechLeavePictureInPicture_=function handleTechLeavePictureInPicture_(event){this.isInPictureInPicture(false);};_proto.handleTechError_=function handleTechError_(){var error=this.tech_.error();this.error(error);};_proto.handleTechTextData_=function handleTechTextData_(){var data=null;if(arguments.length>1){data=arguments[1];}
1091this.trigger('textdata',data);};_proto.getCache=function getCache(){return this.cache_;};_proto.resetCache_=function resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:'',source:{},sources:[],volume:1};};_proto.techCall_=function techCall_(method,arg){this.ready(function(){if(method in allowedSetters){return set(this.middleware_,this.tech_,method,arg);}else if(method in allowedMediators){return mediate(this.middleware_,this.tech_,method,arg);}
1092try{if(this.tech_){this.tech_[method](arg);}}catch(e){log(e);throw e;}},true);};_proto.techGet_=function techGet_(method){if(!this.tech_||!this.tech_.isReady_){return;}
1093if(method in allowedGetters){return get(this.middleware_,this.tech_,method);}else if(method in allowedMediators){return mediate(this.middleware_,this.tech_,method);}
1094try{return this.tech_[method]();}catch(e){if(this.tech_[method]===undefined){log("Video.js: "+method+" method not defined for "+this.techName_+" playback technology.",e);throw e;}
1095if(e.name==='TypeError'){log("Video.js: "+method+" unavailable on "+this.techName_+" playback technology element.",e);this.tech_.isReady_=false;throw e;}
1096log(e);throw e;}};_proto.play=function play(){var _this8=this;var PromiseClass=this.options_.Promise||window$3.Promise;if(PromiseClass){return new PromiseClass(function(resolve){_this8.play_(resolve);});}
1097return this.play_();};_proto.play_=function play_(callback){var _this9=this;if(callback===void 0){callback=silencePromise;}
1098this.playCallbacks_.push(callback);var isSrcReady=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_){this.off(['ready','loadstart'],this.waitToPlay_);this.waitToPlay_=null;}
1099if(!this.isReady_||!isSrcReady){this.waitToPlay_=function(e){_this9.play_();};this.one(['ready','loadstart'],this.waitToPlay_);if(!isSrcReady&&(IS_ANY_SAFARI||IS_IOS)){this.load();}
1100return;}
1101var val=this.techGet_('play');if(val===null){this.runPlayTerminatedQueue_();}else{this.runPlayCallbacks_(val);}};_proto.runPlayTerminatedQueue_=function runPlayTerminatedQueue_(){var queue=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[];queue.forEach(function(q){q();});};_proto.runPlayCallbacks_=function runPlayCallbacks_(val){var callbacks=this.playCallbacks_.slice(0);this.playCallbacks_=[];this.playTerminatedQueue_=[];callbacks.forEach(function(cb){cb(val);});};_proto.pause=function pause(){this.techCall_('pause');};_proto.paused=function paused(){return this.techGet_('paused')===false?false:true;};_proto.played=function played(){return this.techGet_('played')||createTimeRanges(0,0);};_proto.scrubbing=function scrubbing(isScrubbing){if(typeof isScrubbing==='undefined'){return this.scrubbing_;}
1102this.scrubbing_=!!isScrubbing;if(isScrubbing){this.addClass('vjs-scrubbing');}else{this.removeClass('vjs-scrubbing');}};_proto.currentTime=function currentTime(seconds){if(typeof seconds!=='undefined'){if(seconds<0){seconds=0;}
1103if(!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=seconds;this.off('canplay',this.applyInitTime_);this.one('canplay',this.applyInitTime_);return;}
1104this.techCall_('setCurrentTime',seconds);this.cache_.initTime=0;return;}
1105this.cache_.currentTime=this.techGet_('currentTime')||0;return this.cache_.currentTime;};_proto.applyInitTime_=function applyInitTime_(){this.currentTime(this.cache_.initTime);};_proto.duration=function duration(seconds){if(seconds===undefined){return this.cache_.duration!==undefined?this.cache_.duration:NaN;}
1106seconds=parseFloat(seconds);if(seconds<0){seconds=Infinity;}
1107if(seconds!==this.cache_.duration){this.cache_.duration=seconds;if(seconds===Infinity){this.addClass('vjs-live');}else{this.removeClass('vjs-live');}
1108if(!isNaN(seconds)){this.trigger('durationchange');}}};_proto.remainingTime=function remainingTime(){return this.duration()-this.currentTime();};_proto.remainingTimeDisplay=function remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime());};_proto.buffered=function buffered(){var buffered=this.techGet_('buffered');if(!buffered||!buffered.length){buffered=createTimeRanges(0,0);}
1109return buffered;};_proto.bufferedPercent=function bufferedPercent$1(){return bufferedPercent(this.buffered(),this.duration());};_proto.bufferedEnd=function bufferedEnd(){var buffered=this.buffered();var duration=this.duration();var end=buffered.end(buffered.length-1);if(end>duration){end=duration;}
1110return end;};_proto.volume=function volume(percentAsDecimal){var vol;if(percentAsDecimal!==undefined){vol=Math.max(0,Math.min(1,parseFloat(percentAsDecimal)));this.cache_.volume=vol;this.techCall_('setVolume',vol);if(vol>0){this.lastVolume_(vol);}
1111return;}
1112vol=parseFloat(this.techGet_('volume'));return isNaN(vol)?1:vol;};_proto.muted=function muted(_muted){if(_muted!==undefined){this.techCall_('setMuted',_muted);return;}
1113return this.techGet_('muted')||false;};_proto.defaultMuted=function defaultMuted(_defaultMuted){if(_defaultMuted!==undefined){return this.techCall_('setDefaultMuted',_defaultMuted);}
1114return this.techGet_('defaultMuted')||false;};_proto.lastVolume_=function lastVolume_(percentAsDecimal){if(percentAsDecimal!==undefined&&percentAsDecimal!==0){this.cache_.lastVolume=percentAsDecimal;return;}
1115return this.cache_.lastVolume;};_proto.supportsFullScreen=function supportsFullScreen(){return this.techGet_('supportsFullScreen')||false;};_proto.isFullscreen=function isFullscreen(isFS){if(isFS!==undefined){var oldValue=this.isFullscreen_;this.isFullscreen_=Boolean(isFS);if(this.isFullscreen_!==oldValue&&this.fsApi_.prefixed){this.trigger('fullscreenchange');}
1116this.toggleFullscreenClass_();return;}
1117return this.isFullscreen_;};_proto.requestFullscreen=function requestFullscreen(fullscreenOptions){var PromiseClass=this.options_.Promise||window$3.Promise;if(PromiseClass){var self=this;return new PromiseClass(function(resolve,reject){function offHandler(){self.off(self.fsApi_.fullscreenerror,errorHandler);self.off(self.fsApi_.fullscreenchange,changeHandler);}
1118function changeHandler(){offHandler();resolve();}
1119function errorHandler(e,err){offHandler();reject(err);}
1120self.one('fullscreenchange',changeHandler);self.one('fullscreenerror',errorHandler);var promise=self.requestFullscreenHelper_(fullscreenOptions);if(promise){promise.then(offHandler,offHandler);return promise;}});}
1121return this.requestFullscreenHelper_();};_proto.requestFullscreenHelper_=function requestFullscreenHelper_(fullscreenOptions){var _this10=this;var fsOptions;if(!this.fsApi_.prefixed){fsOptions=this.options_.fullscreen&&this.options_.fullscreen.options||{};if(fullscreenOptions!==undefined){fsOptions=fullscreenOptions;}}
1122if(this.fsApi_.requestFullscreen){var promise=this.el_[this.fsApi_.requestFullscreen](fsOptions);if(promise){promise.then(function(){return _this10.isFullscreen(true);},function(){return _this10.isFullscreen(false);});}
1123return promise;}else if(this.tech_.supportsFullScreen()){this.techCall_('enterFullScreen');}else{this.enterFullWindow();}};_proto.exitFullscreen=function exitFullscreen(){var PromiseClass=this.options_.Promise||window$3.Promise;if(PromiseClass){var self=this;return new PromiseClass(function(resolve,reject){function offHandler(){self.off(self.fsApi_.fullscreenerror,errorHandler);self.off(self.fsApi_.fullscreenchange,changeHandler);}
1124function changeHandler(){offHandler();resolve();}
1125function errorHandler(e,err){offHandler();reject(err);}
1126self.one('fullscreenchange',changeHandler);self.one('fullscreenerror',errorHandler);var promise=self.exitFullscreenHelper_();if(promise){promise.then(offHandler,offHandler);return promise;}});}
1127return this.exitFullscreenHelper_();};_proto.exitFullscreenHelper_=function exitFullscreenHelper_(){var _this11=this;if(this.fsApi_.requestFullscreen){var promise=document[this.fsApi_.exitFullscreen]();if(promise){promise.then(function(){return _this11.isFullscreen(false);});}
1128return promise;}else if(this.tech_.supportsFullScreen()){this.techCall_('exitFullScreen');}else{this.exitFullWindow();}};_proto.enterFullWindow=function enterFullWindow(){this.isFullscreen(true);this.isFullWindow=true;this.docOrigOverflow=document.documentElement.style.overflow;on(document,'keydown',this.boundFullWindowOnEscKey_);document.documentElement.style.overflow='hidden';addClass(document.body,'vjs-full-window');this.trigger('enterFullWindow');};_proto.fullWindowOnEscKey=function fullWindowOnEscKey(event){if(keycode.isEventKey(event,'Esc')){if(this.isFullscreen()===true){this.exitFullscreen();}else{this.exitFullWindow();}}};_proto.exitFullWindow=function exitFullWindow(){this.isFullscreen(false);this.isFullWindow=false;off(document,'keydown',this.boundFullWindowOnEscKey_);document.documentElement.style.overflow=this.docOrigOverflow;removeClass(document.body,'vjs-full-window');this.trigger('exitFullWindow');};_proto.isInPictureInPicture=function isInPictureInPicture(isPiP){if(isPiP!==undefined){this.isInPictureInPicture_=!!isPiP;this.togglePictureInPictureClass_();return;}
1129return!!this.isInPictureInPicture_;};_proto.requestPictureInPicture=function requestPictureInPicture(){if('pictureInPictureEnabled'in document){return this.techGet_('requestPictureInPicture');}};_proto.exitPictureInPicture=function exitPictureInPicture(){if('pictureInPictureEnabled'in document){return document.exitPictureInPicture();}};_proto.handleKeyDown=function handleKeyDown(event){var userActions=this.options_.userActions;if(!userActions||!userActions.hotkeys){return;}
1130var excludeElement=function excludeElement(el){var tagName=el.tagName.toLowerCase();if(el.isContentEditable){return true;}
1131var allowedInputTypes=['button','checkbox','hidden','radio','reset','submit'];if(tagName==='input'){return allowedInputTypes.indexOf(el.type)===-1;}
1132var excludedTags=['textarea'];return excludedTags.indexOf(tagName)!==-1;};if(excludeElement(this.el_.ownerDocument.activeElement)){return;}
1133if(typeof userActions.hotkeys==='function'){userActions.hotkeys.call(this,event);}else{this.handleHotkeys(event);}};_proto.handleHotkeys=function handleHotkeys(event){var hotkeys=this.options_.userActions?this.options_.userActions.hotkeys:{};var _hotkeys$fullscreenKe=hotkeys.fullscreenKey,fullscreenKey=_hotkeys$fullscreenKe===void 0?function(keydownEvent){return keycode.isEventKey(keydownEvent,'f');}:_hotkeys$fullscreenKe,_hotkeys$muteKey=hotkeys.muteKey,muteKey=_hotkeys$muteKey===void 0?function(keydownEvent){return keycode.isEventKey(keydownEvent,'m');}:_hotkeys$muteKey,_hotkeys$playPauseKey=hotkeys.playPauseKey,playPauseKey=_hotkeys$playPauseKey===void 0?function(keydownEvent){return keycode.isEventKey(keydownEvent,'k')||keycode.isEventKey(keydownEvent,'Space');}:_hotkeys$playPauseKey;if(fullscreenKey.call(this,event)){event.preventDefault();event.stopPropagation();var FSToggle=Component.getComponent('FullscreenToggle');if(document[this.fsApi_.fullscreenEnabled]!==false){FSToggle.prototype.handleClick.call(this,event);}}else if(muteKey.call(this,event)){event.preventDefault();event.stopPropagation();var MuteToggle=Component.getComponent('MuteToggle');MuteToggle.prototype.handleClick.call(this,event);}else if(playPauseKey.call(this,event)){event.preventDefault();event.stopPropagation();var PlayToggle=Component.getComponent('PlayToggle');PlayToggle.prototype.handleClick.call(this,event);}};_proto.canPlayType=function canPlayType(type){var can;for(var i=0,j=this.options_.techOrder;i<j.length;i++){var techName=j[i];var tech=Tech.getTech(techName);if(!tech){tech=Component.getComponent(techName);}
1134if(!tech){log.error("The \""+techName+"\" tech is undefined. Skipped browser support check for that tech.");continue;}
1135if(tech.isSupported()){can=tech.canPlayType(type);if(can){return can;}}}
1136return '';};_proto.selectSource=function selectSource(sources){var _this12=this;var techs=this.options_.techOrder.map(function(techName){return[techName,Tech.getTech(techName)];}).filter(function(_ref){var techName=_ref[0],tech=_ref[1];if(tech){return tech.isSupported();}
1137log.error("The \""+techName+"\" tech is undefined. Skipped browser support check for that tech.");return false;});var findFirstPassingTechSourcePair=function findFirstPassingTechSourcePair(outerArray,innerArray,tester){var found;outerArray.some(function(outerChoice){return innerArray.some(function(innerChoice){found=tester(outerChoice,innerChoice);if(found){return true;}});});return found;};var foundSourceAndTech;var flip=function flip(fn){return function(a,b){return fn(b,a);};};var finder=function finder(_ref2,source){var techName=_ref2[0],tech=_ref2[1];if(tech.canPlaySource(source,_this12.options_[techName.toLowerCase()])){return{source:source,tech:techName};}};if(this.options_.sourceOrder){foundSourceAndTech=findFirstPassingTechSourcePair(sources,techs,flip(finder));}else{foundSourceAndTech=findFirstPassingTechSourcePair(techs,sources,finder);}
1138return foundSourceAndTech||false;};_proto.src=function src(source){var _this13=this;if(typeof source==='undefined'){return this.cache_.src||'';}
1139var sources=filterSource(source);if(!sources.length){this.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)});},0);return;}
1140this.changingSrc_=true;this.cache_.sources=sources;this.updateSourceCaches_(sources[0]);setSource(this,sources[0],function(middlewareSource,mws){_this13.middleware_=mws;_this13.cache_.sources=sources;_this13.updateSourceCaches_(middlewareSource);var err=_this13.src_(middlewareSource);if(err){if(sources.length>1){return _this13.src(sources.slice(1));}
1141_this13.changingSrc_=false;_this13.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)});},0);_this13.triggerReady();return;}
1142setTech(mws,_this13.tech_);});};_proto.src_=function src_(source){var _this14=this;var sourceTech=this.selectSource([source]);if(!sourceTech){return true;}
1143if(!titleCaseEquals(sourceTech.tech,this.techName_)){this.changingSrc_=true;this.loadTech_(sourceTech.tech,sourceTech.source);this.tech_.ready(function(){_this14.changingSrc_=false;});return false;}
1144this.ready(function(){if(this.tech_.constructor.prototype.hasOwnProperty('setSource')){this.techCall_('setSource',source);}else{this.techCall_('src',source.src);}
1145this.changingSrc_=false;},true);return false;};_proto.load=function load(){this.techCall_('load');};_proto.reset=function reset(){var _this15=this;var PromiseClass=this.options_.Promise||window$3.Promise;if(this.paused()||!PromiseClass){this.doReset_();}else{var playPromise=this.play();silencePromise(playPromise.then(function(){return _this15.doReset_();}));}};_proto.doReset_=function doReset_(){if(this.tech_){this.tech_.clearTracks('text');}
1146this.resetCache_();this.poster('');this.loadTech_(this.options_.techOrder[0],null);this.techCall_('reset');this.resetControlBarUI_();if(isEvented(this)){this.trigger('playerreset');}};_proto.resetControlBarUI_=function resetControlBarUI_(){this.resetProgressBar_();this.resetPlaybackRate_();this.resetVolumeBar_();};_proto.resetProgressBar_=function resetProgressBar_(){this.currentTime(0);var _this$controlBar=this.controlBar,durationDisplay=_this$controlBar.durationDisplay,remainingTimeDisplay=_this$controlBar.remainingTimeDisplay;if(durationDisplay){durationDisplay.updateContent();}
1147if(remainingTimeDisplay){remainingTimeDisplay.updateContent();}};_proto.resetPlaybackRate_=function resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate());this.handleTechRateChange_();};_proto.resetVolumeBar_=function resetVolumeBar_(){this.volume(1.0);this.trigger('volumechange');};_proto.currentSources=function currentSources(){var source=this.currentSource();var sources=[];if(Object.keys(source).length!==0){sources.push(source);}
1148return this.cache_.sources||sources;};_proto.currentSource=function currentSource(){return this.cache_.source||{};};_proto.currentSrc=function currentSrc(){return this.currentSource()&&this.currentSource().src||'';};_proto.currentType=function currentType(){return this.currentSource()&&this.currentSource().type||'';};_proto.preload=function preload(value){if(value!==undefined){this.techCall_('setPreload',value);this.options_.preload=value;return;}
1149return this.techGet_('preload');};_proto.autoplay=function autoplay(value){if(value===undefined){return this.options_.autoplay||false;}
1150var techAutoplay;if(typeof value==='string'&&/(any|play|muted)/.test(value)){this.options_.autoplay=value;this.manualAutoplay_(value);techAutoplay=false;}else if(!value){this.options_.autoplay=false;}else{this.options_.autoplay=true;}
1151techAutoplay=typeof techAutoplay==='undefined'?this.options_.autoplay:techAutoplay;if(this.tech_){this.techCall_('setAutoplay',techAutoplay);}};_proto.playsinline=function playsinline(value){if(value!==undefined){this.techCall_('setPlaysinline',value);this.options_.playsinline=value;return this;}
1152return this.techGet_('playsinline');};_proto.loop=function loop(value){if(value!==undefined){this.techCall_('setLoop',value);this.options_.loop=value;return;}
1153return this.techGet_('loop');};_proto.poster=function poster(src){if(src===undefined){return this.poster_;}
1154if(!src){src='';}
1155if(src===this.poster_){return;}
1156this.poster_=src;this.techCall_('setPoster',src);this.isPosterFromTech_=false;this.trigger('posterchange');};_proto.handleTechPosterChange_=function handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var newPoster=this.tech_.poster()||'';if(newPoster!==this.poster_){this.poster_=newPoster;this.isPosterFromTech_=true;this.trigger('posterchange');}}};_proto.controls=function controls(bool){if(bool===undefined){return!!this.controls_;}
1157bool=!!bool;if(this.controls_===bool){return;}
1158this.controls_=bool;if(this.usingNativeControls()){this.techCall_('setControls',bool);}
1159if(this.controls_){this.removeClass('vjs-controls-disabled');this.addClass('vjs-controls-enabled');this.trigger('controlsenabled');if(!this.usingNativeControls()){this.addTechControlsListeners_();}}else{this.removeClass('vjs-controls-enabled');this.addClass('vjs-controls-disabled');this.trigger('controlsdisabled');if(!this.usingNativeControls()){this.removeTechControlsListeners_();}}};_proto.usingNativeControls=function usingNativeControls(bool){if(bool===undefined){return!!this.usingNativeControls_;}
1160bool=!!bool;if(this.usingNativeControls_===bool){return;}
1161this.usingNativeControls_=bool;if(this.usingNativeControls_){this.addClass('vjs-using-native-controls');this.trigger('usingnativecontrols');}else{this.removeClass('vjs-using-native-controls');this.trigger('usingcustomcontrols');}};_proto.error=function error(err){if(err===undefined){return this.error_||null;}
1162if(this.options_.suppressNotSupportedError&&err&&err.code===4){var triggerSuppressedError=function triggerSuppressedError(){this.error(err);};this.options_.suppressNotSupportedError=false;this.any(['click','touchstart'],triggerSuppressedError);this.one('loadstart',function(){this.off(['click','touchstart'],triggerSuppressedError);});return;}
1163if(err===null){this.error_=err;this.removeClass('vjs-error');if(this.errorDisplay){this.errorDisplay.close();}
1164return;}
1165this.error_=new MediaError(err);this.addClass('vjs-error');log.error("(CODE:"+this.error_.code+" "+MediaError.errorTypes[this.error_.code]+")",this.error_.message,this.error_);this.trigger('error');return;};_proto.reportUserActivity=function reportUserActivity(event){this.userActivity_=true;};_proto.userActive=function userActive(bool){if(bool===undefined){return this.userActive_;}
1166bool=!!bool;if(bool===this.userActive_){return;}
1167this.userActive_=bool;if(this.userActive_){this.userActivity_=true;this.removeClass('vjs-user-inactive');this.addClass('vjs-user-active');this.trigger('useractive');return;}
1168if(this.tech_){this.tech_.one('mousemove',function(e){e.stopPropagation();e.preventDefault();});}
1169this.userActivity_=false;this.removeClass('vjs-user-active');this.addClass('vjs-user-inactive');this.trigger('userinactive');};_proto.listenForUserActivity_=function listenForUserActivity_(){var mouseInProgress;var lastMoveX;var lastMoveY;var handleActivity=bind(this,this.reportUserActivity);var handleMouseMove=function handleMouseMove(e){if(e.screenX!==lastMoveX||e.screenY!==lastMoveY){lastMoveX=e.screenX;lastMoveY=e.screenY;handleActivity();}};var handleMouseDown=function handleMouseDown(){handleActivity();this.clearInterval(mouseInProgress);mouseInProgress=this.setInterval(handleActivity,250);};var handleMouseUpAndMouseLeave=function handleMouseUpAndMouseLeave(event){handleActivity();this.clearInterval(mouseInProgress);};this.on('mousedown',handleMouseDown);this.on('mousemove',handleMouseMove);this.on('mouseup',handleMouseUpAndMouseLeave);this.on('mouseleave',handleMouseUpAndMouseLeave);var controlBar=this.getChild('controlBar');if(controlBar&&!IS_IOS&&!IS_ANDROID){controlBar.on('mouseenter',function(event){this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout;this.player().options_.inactivityTimeout=0;});controlBar.on('mouseleave',function(event){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout;});}
1170this.on('keydown',handleActivity);this.on('keyup',handleActivity);var inactivityTimeout;this.setInterval(function(){if(!this.userActivity_){return;}
1171this.userActivity_=false;this.userActive(true);this.clearTimeout(inactivityTimeout);var timeout=this.options_.inactivityTimeout;if(timeout<=0){return;}
1172inactivityTimeout=this.setTimeout(function(){if(!this.userActivity_){this.userActive(false);}},timeout);},250);};_proto.playbackRate=function playbackRate(rate){if(rate!==undefined){this.techCall_('setPlaybackRate',rate);return;}
1173if(this.tech_&&this.tech_.featuresPlaybackRate){return this.cache_.lastPlaybackRate||this.techGet_('playbackRate');}
1174return 1.0;};_proto.defaultPlaybackRate=function defaultPlaybackRate(rate){if(rate!==undefined){return this.techCall_('setDefaultPlaybackRate',rate);}
1175if(this.tech_&&this.tech_.featuresPlaybackRate){return this.techGet_('defaultPlaybackRate');}
1176return 1.0;};_proto.isAudio=function isAudio(bool){if(bool!==undefined){this.isAudio_=!!bool;return;}
1177return!!this.isAudio_;};_proto.addTextTrack=function addTextTrack(kind,label,language){if(this.tech_){return this.tech_.addTextTrack(kind,label,language);}};_proto.addRemoteTextTrack=function addRemoteTextTrack(options,manualCleanup){if(this.tech_){return this.tech_.addRemoteTextTrack(options,manualCleanup);}};_proto.removeRemoteTextTrack=function removeRemoteTextTrack(obj){if(obj===void 0){obj={};}
1178var _obj=obj,track=_obj.track;if(!track){track=obj;}
1179if(this.tech_){return this.tech_.removeRemoteTextTrack(track);}};_proto.getVideoPlaybackQuality=function getVideoPlaybackQuality(){return this.techGet_('getVideoPlaybackQuality');};_proto.videoWidth=function videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0;};_proto.videoHeight=function videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0;};_proto.language=function language(code){if(code===undefined){return this.language_;}
1180this.language_=String(code).toLowerCase();};_proto.languages=function languages(){return mergeOptions(Player.prototype.options_.languages,this.languages_);};_proto.toJSON=function toJSON(){var options=mergeOptions(this.options_);var tracks=options.tracks;options.tracks=[];for(var i=0;i<tracks.length;i++){var track=tracks[i];track=mergeOptions(track);track.player=undefined;options.tracks[i]=track;}
1181return options;};_proto.createModal=function createModal(content,options){var _this16=this;options=options||{};options.content=content||'';var modal=new ModalDialog(this,options);this.addChild(modal);modal.on('dispose',function(){_this16.removeChild(modal);});modal.open();return modal;};_proto.updateCurrentBreakpoint_=function updateCurrentBreakpoint_(){if(!this.responsive()){return;}
1182var currentBreakpoint=this.currentBreakpoint();var currentWidth=this.currentWidth();for(var i=0;i<BREAKPOINT_ORDER.length;i++){var candidateBreakpoint=BREAKPOINT_ORDER[i];var maxWidth=this.breakpoints_[candidateBreakpoint];if(currentWidth<=maxWidth){if(currentBreakpoint===candidateBreakpoint){return;}
1183if(currentBreakpoint){this.removeClass(BREAKPOINT_CLASSES[currentBreakpoint]);}
1184this.addClass(BREAKPOINT_CLASSES[candidateBreakpoint]);this.breakpoint_=candidateBreakpoint;break;}}};_proto.removeCurrentBreakpoint_=function removeCurrentBreakpoint_(){var className=this.currentBreakpointClass();this.breakpoint_='';if(className){this.removeClass(className);}};_proto.breakpoints=function breakpoints(_breakpoints){if(_breakpoints===undefined){return assign(this.breakpoints_);}
1185this.breakpoint_='';this.breakpoints_=assign({},DEFAULT_BREAKPOINTS,_breakpoints);this.updateCurrentBreakpoint_();return assign(this.breakpoints_);};_proto.responsive=function responsive(value){if(value===undefined){return this.responsive_;}
1186value=Boolean(value);var current=this.responsive_;if(value===current){return;}
1187this.responsive_=value;if(value){this.on('playerresize',this.updateCurrentBreakpoint_);this.updateCurrentBreakpoint_();}else{this.off('playerresize',this.updateCurrentBreakpoint_);this.removeCurrentBreakpoint_();}
1188return value;};_proto.currentBreakpoint=function currentBreakpoint(){return this.breakpoint_;};_proto.currentBreakpointClass=function currentBreakpointClass(){return BREAKPOINT_CLASSES[this.breakpoint_]||'';};_proto.loadMedia=function loadMedia(media,ready){var _this17=this;if(!media||typeof media!=='object'){return;}
1189this.reset();this.cache_.media=mergeOptions(media);var _this$cache_$media=this.cache_.media,artwork=_this$cache_$media.artwork,poster=_this$cache_$media.poster,src=_this$cache_$media.src,textTracks=_this$cache_$media.textTracks;
1189if(!artwork&&poster){this.cache_.media.artwork=[{src:poster,type:getMimetype(poster)}];}
1190if(src){this.src(src);}
1191if(poster){this.poster(poster);}
1192if(Array.isArray(textTracks)){textTracks.forEach(function(tt){return _this17.addRemoteTextTrack(tt,false);});}
1193this.ready(ready);};_proto.getMedia=function getMedia(){if(!this.cache_.media){var poster=this.poster();var src=this.currentSources();var textTracks=Array.prototype.map.call(this.remoteTextTracks(),function(tt){return{kind:tt.kind,label:tt.label,language:tt.language,src:tt.src};});var media={src:src,textTracks:textTracks};if(poster){media.poster=poster;media.artwork=[{src:media.poster,type:getMimetype(media.poster)}];}
1194return media;}
1195return mergeOptions(this.cache_.media);};Player.getTagSettings=function getTagSettings(tag){var baseOptions={sources:[],tracks:[]};var tagOptions=getAttributes(tag);var dataSetup=tagOptions['data-setup'];if(hasClass(tag,'vjs-fill')){tagOptions.fill=true;}
1196if(hasClass(tag,'vjs-fluid')){tagOptions.fluid=true;}
1197if(dataSetup!==null){var _safeParseTuple=tuple(dataSetup||'{}'),err=_safeParseTuple[0],data=_safeParseTuple[1];if(err){log.error(err);}
1198assign(tagOptions,data);}
1199assign(baseOptions,tagOptions);if(tag.hasChildNodes()){var children=tag.childNodes;for(var i=0,j=children.length;i<j;i++){var child=children[i];var childName=child.nodeName.toLowerCase();if(childName==='source'){baseOptions.sources.push(getAttributes(child));}else if(childName==='track'){baseOptions.tracks.push(getAttributes(child));}}}
1200return baseOptions;};_proto.flexNotSupported_=function flexNotSupported_(){var elem=document.createElement('i');return!('flexBasis'in elem.style||'webkitFlexBasis'in elem.style||'mozFlexBasis'in elem.style||'msFlexBasis'in elem.style||'msFlexOrder'in elem.style);};return Player;}(Component);ALL.names.forEach(function(name){var props=ALL[name];Player.prototype[props.getterName]=function(){if(this.tech_){return this.tech_[props.getterName]();}
1201this[props.privateName]=this[props.privateName]||new props.ListClass();return this[props.privateName];};});Player.prototype.crossorigin=Player.prototype.crossOrigin;Player.players={};var navigator=window$3.navigator;Player.prototype.options_={techOrder:Tech.defaultTechOrder_,html5:{},flash:{},inactivityTimeout:2000,playbackRates:[],liveui:false,children:['mediaLoader','posterImage','textTrackDisplay','loadingSpinner','bigPlayButton','liveTracker','controlBar','errorDisplay','textTrackSettings','resizeManager'],language:navigator&&(navigator.languages&&navigator.languages[0]||navigator.userLanguage||navigator.language)||'en',languages:{},notSupportedMessage:'No compatible source was found for this media.',fullscreen:{options:{navigationUI:'hide'}},breakpoints:{},responsive:false};['ended','seeking','seekable','networkState','readyState'].forEach(function(fn){Player.prototype[fn]=function(){return this.techGet_(fn);};});TECH_EVENTS_RETRIGGER.forEach(function(event){Player.prototype["handleTech"+toTitleCase(event)+"_"]=function(){return this.trigger(event);};});Component.registerComponent('Player',Player);var setPrototypeOf=createCommonjsModule(function(module){function _setPrototypeOf(o,p){module.exports=_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}
1202module.exports=_setPrototypeOf;});function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true;}catch(e){return false;}}
1203var isNativeReflectConstruct=_isNativeReflectConstruct;var construct=createCommonjsModule(function(module){function _construct(Parent,args,Class){if(isNativeReflectConstruct()){module.exports=_construct=Reflect.construct;}else{module.exports=_construct=function _construct(Parent,args,Class){var a=[null];a.push.apply(a,args);var Constructor=Function.bind.apply(Parent,a);var instance=new Constructor();if(Class)setPrototypeOf(instance,Class.prototype);return instance;};}
1204return _construct.apply(null,arguments);}
1205module.exports=_construct;});var BASE_PLUGIN_NAME='plugin';var PLUGIN_CACHE_KEY='activePlugins_';var pluginStorage={};var pluginExists=function pluginExists(name){return pluginStorage.hasOwnProperty(name);};var getPlugin=function getPlugin(name){return pluginExists(name)?pluginStorage[name]:un
vendor: 5,675 bytes, lines 1205-1226
1205defined;};var markPluginAsActive=function markPluginAsActive(player,name){player[PLUGIN_CACHE_KEY]=player[PLUGIN_CACHE_KEY]||{};player[PLUGIN_CACHE_KEY][name]=true;};var triggerSetupEvent=function triggerSetupEvent(player,hash,before){var eventName=(before?'before':'')+'pluginsetup';player.trigger(eventName,hash);player.trigger(eventName+':'+hash.name,hash);};var createBasicPlugin=function createBasicPlugin(name,plugin){var basicPluginWrapper=function basicPluginWrapper(){triggerSetupEvent(this,{name:name,plugin:plugin,instance:null},true);var instance=plugin.apply(this,arguments);markPluginAsActive(this,name);triggerSetupEvent(this,{name:name,plugin:plugin,instance:instance});return instance;};Object.keys(plugin).forEach(function(prop){basicPluginWrapper[prop]=plugin[prop];});return basicPluginWrapper;};var createPluginFactory=function createPluginFactory(name,PluginSubClass){PluginSubClass.prototype.name=name;return function(){triggerSetupEvent(this,{name:name,plugin:PluginSubClass,instance:null},true);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}
1206var instance=construct(PluginSubClass,[this].concat(args));this[name]=function(){return instance;};triggerSetupEvent(this,instance.getEventHash());return instance;};};var Plugin=function(){function Plugin(player){if(this.constructor===Plugin){throw new Error('Plugin must be sub-classed; not directly instantiated.');}
1207this.player=player;evented(this);delete this.trigger;stateful(this,this.constructor.defaultState);markPluginAsActive(player,this.name);this.dispose=bind(this,this.dispose);player.on('dispose',this.dispose);}
1208var _proto=Plugin.prototype;_proto.version=function version(){return this.constructor.VERSION;};_proto.getEventHash=function getEventHash(hash){if(hash===void 0){hash={};}
1209hash.name=this.name;hash.plugin=this.constructor;hash.instance=this;return hash;};_proto.trigger=function trigger$1(event,hash){if(hash===void 0){hash={};}
1210return trigger(this.eventBusEl_,event,this.getEventHash(hash));};_proto.handleStateChanged=function handleStateChanged(e){};_proto.dispose=function dispose(){var name=this.name,player=this.player;this.trigger('dispose');this.off();player.off('dispose',this.dispose);player[PLUGIN_CACHE_KEY][name]=false;this.player=this.state=null;player[name]=createPluginFactory(name,pluginStorage[name]);};Plugin.isBasic=function isBasic(plugin){var p=typeof plugin==='string'?getPlugin(plugin):plugin;return typeof p==='function'&&!Plugin.prototype.isPrototypeOf(p.prototype);};Plugin.registerPlugin=function registerPlugin(name,plugin){if(typeof name!=='string'){throw new Error("Illegal plugin name, \""+name+"\", must be a string, was "+typeof name+".");}
1211if(pluginExists(name)){log.warn("A plugin named \""+name+"\" already exists. You may want to avoid re-registering plugins!");}else if(Player.prototype.hasOwnProperty(name)){throw new Error("Illegal plugin name, \""+name+"\", cannot share a name with an existing player method!");}
1212if(typeof plugin!=='function'){throw new Error("Illegal plugin for \""+name+"\", must be a function, was "+typeof plugin+".");}
1213pluginStorage[name]=plugin;if(name!==BASE_PLUGIN_NAME){if(Plugin.isBasic(plugin)){Player.prototype[name]=createBasicPlugin(name,plugin);}else{Player.prototype[name]=createPluginFactory(name,plugin);}}
1214return plugin;};Plugin.deregisterPlugin=function deregisterPlugin(name){if(name===BASE_PLUGIN_NAME){throw new Error('Cannot de-register base plugin.');}
1215if(pluginExists(name)){delete pluginStorage[name];delete Player.prototype[name];}};Plugin.getPlugins=function getPlugins(names){if(names===void 0){names=Object.keys(pluginStorage);}
1216var result;names.forEach(function(name){var plugin=getPlugin(name);if(plugin){result=result||{};result[name]=plugin;}});return result;};Plugin.getPluginVersion=function getPluginVersion(name){var plugin=getPlugin(name);return plugin&&plugin.VERSION||'';};return Plugin;}();Plugin.getPlugin=getPlugin;Plugin.BASE_PLUGIN_NAME=BASE_PLUGIN_NAME;Plugin.registerPlugin(BASE_PLUGIN_NAME,Plugin);Player.prototype.usingPlugin=function(name){return!!this[PLUGIN_CACHE_KEY]&&this[PLUGIN_CACHE_KEY][name]===true;};Player.prototype.hasPlugin=function(name){return!!pluginExists(name);};function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}
1217subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)setPrototypeOf(subClass,superClass);}
1218var inherits=_inherits;var extend=function extend(superClass,subClassMethods){if(subClassMethods===void 0){subClassMethods={};}
1219var subClass=function subClass(){superClass.apply(this,arguments);};var methods={};if(typeof subClassMethods==='object'){if(subClassMethods.constructor!==Object.prototype.constructor){subClass=subClassMethods.constructor;}
1220methods=subClassMethods;}else if(typeof subClassMethods==='function'){subClass=subClassMethods;}
1221inherits(subClass,superClass);if(superClass){subClass.super_=superClass;}
1222for(var name in methods){if(methods.hasOwnProperty(name)){subClass.prototype[name]=methods[name];}}
1223return subClass;};var normalizeId=function normalizeId(id){return id.indexOf('#')===0?id.slice(1):id;};function videojs$1(id,options,ready){var player=videojs$1.getPlayer(id);if(player){if(options){log.warn("Player \""+id+"\" is already initialised. Options will not be applied.");}
1224if(ready){player.ready(ready);}
1225return player;}
1226var el=typeof id==='string'?$('#'+normalizeId(id)):id;if(!isEl(el)){throw new TypeError('The element or ID supplied is not val
vendor: 5,212 bytes, lines 1226-1237
1226id. (videojs)');}
1227if(!el.ownerDocument.defaultView||!el.ownerDocument.body.contains(el)){log.warn('The element supplied is not included in the DOM');}
1228options=options||{};videojs$1.hooks('beforesetup').forEach(function(hookFunction){var opts=hookFunction(el,mergeOptions(options));if(!isObject(opts)||Array.isArray(opts)){log.error('please return an object in beforesetup hooks');return;}
1229options=mergeOptions(options,opts);});var PlayerComponent=Component.getComponent('Player');player=new PlayerComponent(el,options,ready);videojs$1.hooks('setup').forEach(function(hookFunction){return hookFunction(player);});return player;}
1230videojs$1.hooks_={};videojs$1.hooks=function(type,fn){videojs$1.hooks_[type]=videojs$1.hooks_[type]||[];if(fn){videojs$1.hooks_[type]=videojs$1.hooks_[type].concat(fn);}
1231return videojs$1.hooks_[type];};videojs$1.hook=function(type,fn){videojs$1.hooks(type,fn);};videojs$1.hookOnce=function(type,fn){videojs$1.hooks(type,[].concat(fn).map(function(original){var wrapper=function wrapper(){videojs$1.removeHook(type,wrapper);return original.apply(void 0,arguments);};return wrapper;}));};videojs$1.removeHook=function(type,fn){var index=videojs$1.hooks(type).indexOf(fn);if(index<=-1){return false;}
1232videojs$1.hooks_[type]=videojs$1.hooks_[type].slice();videojs$1.hooks_[type].splice(index,1);return true;};if(window$3.VIDEOJS_NO_DYNAMIC_STYLE!==true&&isReal()){var style=$('.vjs-styles-defaults');if(!style){style=createStyleElement('vjs-styles-defaults');var head=$('head');if(head){head.insertBefore(style,head.firstChild);}
1233setTextContent(style,"\n      .video-js {\n        width: 300px;\n        height: 150px;\n      }\n\n      .vjs-fluid {\n        padding-top: 56.25%\n      }\n    ");}}
1234autoSetupTimeout(1,videojs$1);videojs$1.VERSION=version;videojs$1.options=Player.prototype.options_;videojs$1.getPlayers=function(){return Player.players;};videojs$1.getPlayer=function(id){var players=Player.players;var tag;if(typeof id==='string'){var nId=normalizeId(id);var player=players[nId];if(player){return player;}
1235tag=$('#'+nId);}else{tag=id;}
1236if(isEl(tag)){var _tag=tag,_player=_tag.player,playerId=_tag.playerId;if(_player||players[playerId]){return _player||players[playerId];}}};videojs$1.getAllPlayers=function(){return(Object.keys(Player.players).map(function(k){return Player.players[k];}).filter(Boolean));};videojs$1.players=Player.players;videojs$1.getComponent=Component.getComponent;videojs$1.registerComponent=function(name,comp){if(Tech.isTech(comp)){log.warn("The "+name+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)");}
1237Component.registerComponent.call(Component,name,comp);};videojs$1.getTech=Tech.getTech;videojs$1.registerTech=Tech.registerTech;videojs$1.use=use;Object.defineProperty(videojs$1,'middleware',{value:{},writeable:false,enumerable:true});Object.defineProperty(videojs$1.middleware,'TERMINATOR',{value:TERMINATOR,writeable:false,enumerable:true});videojs$1.browser=browser;videojs$1.TOUCH_ENABLED=TOUCH_ENABLED;videojs$1.extend=extend;videojs$1.mergeOptions=mergeOptions;videojs$1.bind=bind;videojs$1.registerPlugin=Plugin.registerPlugin;videojs$1.deregisterPlugin=Plugin.deregisterPlugin;videojs$1.plugin=function(name,plugin){log.warn('videojs.plugin() is deprecated; use videojs.registerPlugin() instead');return Plugin.registerPlugin(name,plugin);};videojs$1.getPlugins=Plugin.getPlugins;videojs$1.getPlugin=Plugin.getPlugin;videojs$1.getPluginVersion=Plugin.getPluginVersion;videojs$1.addLanguage=function(code,data){var _mergeOptions;code=(''+code).toLowerCase();videojs$1.options.languages=mergeOptions(videojs$1.options.languages,(_mergeOptions={},_mergeOptions[code]=data,_mergeOptions));return videojs$1.options.languages[code];};videojs$1.log=log;videojs$1.createLogger=createLogger$1;videojs$1.createTimeRange=videojs$1.createTimeRanges=createTimeRanges;videojs$1.formatTime=formatTime;videojs$1.setFormatTime=setFormatTime;videojs$1.resetFormatTime=resetFormatTime;videojs$1.parseUrl=parseUrl;videojs$1.isCrossOrigin=isCrossOrigin;videojs$1.EventTarget=EventTarget;videojs$1.on=on;videojs$1.one=one;videojs$1.off=off;videojs$1.trigger=trigger;videojs$1.xhr=xhr;videojs$1.TextTrack=TextTrack;videojs$1.AudioTrack=AudioTrack;videojs$1.VideoTrack=VideoTrack;['isEl','isTextNode','createEl','hasClass','addClass','removeClass','toggleClass','setAttributes','getAttributes','emptyEl','appendContent','insertContent'].forEach(function(k){videojs$1[k]=function(){log.warn("videojs."+k+"() is deprecated; use videojs.dom."+k+"() instead");return Dom[k].apply(null,arguments);};});videojs$1.computedStyle=computedStyle;videojs$1.dom=Dom;videojs$1.url=Url;videojs$1.defineLazyProperty=defineLazyProperty;var urlToolkit=createCommonjsModule(function(module,exports){(function(root){var URL_REGEX=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/;var FIRST_SEGMENT_REGEX=/^([^\/?#]*)(.*)$/;var SLASH_DOT_REGEX=/(?:\/|^)\.(?=\/)/g;var SLASH_DOT_DOT_REGEX=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g;var URLToolkit={buildAbsoluteURL:function buildAbsoluteURL(baseURL,relativeURL,opts){opts=opts||{};baseURL=baseURL.trim();relativeURL=relativeURL.trim();
vendor: 1,374 bytes, lines 1237-1246
1237if(!relativeURL){if(!opts.alwaysNormalize){return baseURL;}
1238var basePartsForNormalise=URLToolkit.parseURL(baseURL);if(!basePartsForNormalise){throw new Error('Error trying to parse base URL.');}
1239basePartsForNormalise.path=URLToolkit.normalizePath(basePartsForNormalise.path);return URLToolkit.buildURLFromParts(basePartsForNormalise);}
1240var relativeParts=URLToolkit.parseURL(relativeURL);if(!relativeParts){throw new Error('Error trying to parse relative URL.');}
1241if(relativeParts.scheme){if(!opts.alwaysNormalize){return relativeURL;}
1242relativeParts.path=URLToolkit.normalizePath(relativeParts.path);return URLToolkit.buildURLFromParts(relativeParts);}
1243var baseParts=URLToolkit.parseURL(baseURL);if(!baseParts){throw new Error('Error trying to parse base URL.');}
1244if(!baseParts.netLoc&&baseParts.path&&baseParts.path[0]!=='/'){var pathParts=FIRST_SEGMENT_REGEX.exec(baseParts.path);baseParts.netLoc=pathParts[1];baseParts.path=pathParts[2];}
1245if(baseParts.netLoc&&!baseParts.path){baseParts.path='/';}
1246var builtParts={scheme:baseParts.scheme,netLoc:relativeParts.netLoc,path:null,params:relativeParts.params,query:relativeParts.query,fragment:relativeParts.fragment};if(!relativeParts.netLoc){builtParts.netLoc=baseParts.netLoc;if(relativeParts.path[0]!=='/'){if(!relativeParts.path){builtParts.path=baseParts.path;if(!relativeParts.params){builtParts.params=baseParts.params;
vendor: 21,085 bytes, lines 1246-1363
1246if(!relativeParts.query){builtParts.query=baseParts.query;}}}else{var baseURLPath=baseParts.path;var newPath=baseURLPath.substring(0,baseURLPath.lastIndexOf('/')+1)+relativeParts.path;builtParts.path=URLToolkit.normalizePath(newPath);}}}
1247if(builtParts.path===null){builtParts.path=opts.alwaysNormalize?URLToolkit.normalizePath(relativeParts.path):relativeParts.path;}
1248return URLToolkit.buildURLFromParts(builtParts);},parseURL:function parseURL(url){var parts=URL_REGEX.exec(url);if(!parts){return null;}
1249return{scheme:parts[1]||'',netLoc:parts[2]||'',path:parts[3]||'',params:parts[4]||'',query:parts[5]||'',fragment:parts[6]||''};},normalizePath:function normalizePath(path){path=path.split('').reverse().join('').replace(SLASH_DOT_REGEX,'');while(path.length!==(path=path.replace(SLASH_DOT_DOT_REGEX,'')).length){}
1250return path.split('').reverse().join('');},buildURLFromParts:function buildURLFromParts(parts){return parts.scheme+parts.netLoc+parts.path+parts.params+parts.query+parts.fragment;}};module.exports=URLToolkit;})();});/*!@name m3u8-parser @version 4.4.0 @license Apache-2.0*/function _extends(){_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];}}}
1251return target;};return _extends.apply(this,arguments);}
1252function _inheritsLoose$1(subClass,superClass){subClass.prototype=Object.create(superClass.prototype);subClass.prototype.constructor=subClass;subClass.__proto__=superClass;}
1253function _assertThisInitialized$1(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}
1254return self;}
1255var Stream=function(){function Stream(){this.listeners={};}
1256var _proto=Stream.prototype;_proto.on=function on(type,listener){if(!this.listeners[type]){this.listeners[type]=[];}
1257this.listeners[type].push(listener);};_proto.off=function off(type,listener){if(!this.listeners[type]){return false;}
1258var index=this.listeners[type].indexOf(listener);this.listeners[type].splice(index,1);return index>-1;};_proto.trigger=function trigger(type){var callbacks=this.listeners[type];var i;var length;var args;if(!callbacks){return;}
1259if(arguments.length===2){length=callbacks.length;for(i=0;i<length;++i){callbacks[i].call(this,arguments[1]);}}else{args=Array.prototype.slice.call(arguments,1);length=callbacks.length;for(i=0;i<length;++i){callbacks[i].apply(this,args);}}};_proto.dispose=function dispose(){this.listeners={};};_proto.pipe=function pipe(destination){this.on('data',function(data){destination.push(data);});};return Stream;}();var LineStream=function(_Stream){_inheritsLoose$1(LineStream,_Stream);function LineStream(){var _this;_this=_Stream.call(this)||this;_this.buffer='';return _this;}
1260var _proto=LineStream.prototype;_proto.push=function push(data){var nextNewline;this.buffer+=data;nextNewline=this.buffer.indexOf('\n');for(;nextNewline>-1;nextNewline=this.buffer.indexOf('\n')){this.trigger('data',this.buffer.substring(0,nextNewline));this.buffer=this.buffer.substring(nextNewline+1);}};return LineStream;}(Stream);var attributeSeparator=function attributeSeparator(){var key='[^=]*';var value='"[^"]*"|[^,]*';var keyvalue='(?:'+key+')=(?:'+value+')';return new RegExp('(?:^|,)('+keyvalue+')');};var parseAttributes=function parseAttributes(attributes){var attrs=attributes.split(attributeSeparator());var result={};var i=attrs.length;var attr;while(i--){if(attrs[i]===''){continue;}
1261attr=/([^=]*)=(.*)/.exec(attrs[i]).slice(1);attr[0]=attr[0].replace(/^\s+|\s+$/g,'');attr[1]=attr[1].replace(/^\s+|\s+$/g,'');attr[1]=attr[1].replace(/^['"](.*)['"]$/g,'$1');result[attr[0]]=attr[1];}
1262return result;};var ParseStream=function(_Stream){_inheritsLoose$1(ParseStream,_Stream);function ParseStream(){var _this;_this=_Stream.call(this)||this;_this.customParsers=[];_this.tagMappers=[];return _this;}
1263var _proto=ParseStream.prototype;_proto.push=function push(line){var _this2=this;var match;var event;line=line.trim();if(line.length===0){return;}
1264if(line[0]!=='#'){this.trigger('data',{type:'uri',uri:line});return;}
1265var newLines=this.tagMappers.reduce(function(acc,mapper){var mappedLine=mapper(line);if(mappedLine===line){return acc;}
1266return acc.concat([mappedLine]);},[line]);newLines.forEach(function(newLine){for(var i=0;i<_this2.customParsers.length;i++){if(_this2.customParsers[i].call(_this2,newLine)){return;}}
1267if(newLine.indexOf('#EXT')!==0){_this2.trigger('data',{type:'comment',text:newLine.slice(1)});return;}
1268newLine=newLine.replace('\r','');match=/^#EXTM3U/.exec(newLine);if(match){_this2.trigger('data',{type:'tag',tagType:'m3u'});return;}
1269match=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(newLine);if(match){event={type:'tag',tagType:'inf'};if(match[1]){event.duration=parseFloat(match[1]);}
1270if(match[2]){event.title=match[2];}
1271_this2.trigger('data',event);return;}
1272match=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(newLine);if(match){event={type:'tag',tagType:'targetduration'};if(match[1]){event.duration=parseInt(match[1],10);}
1273_this2.trigger('data',event);return;}
1274match=/^#ZEN-TOTAL-DURATION:?([0-9.]*)?/.exec(newLine);if(match){event={type:'tag',tagType:'totalduration'};if(match[1]){event.duration=parseInt(match[1],10);}
1275_this2.trigger('data',event);return;}
1276match=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(newLine);if(match){event={type:'tag',tagType:'version'};if(match[1]){event.version=parseInt(match[1],10);}
1277_this2.trigger('data',event);return;}
1278match=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(newLine);if(match){event={type:'tag',tagType:'media-sequence'};if(match[1]){event.number=parseInt(match[1],10);}
1279_this2.trigger('data',event);return;}
1280match=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(newLine);if(match){event={type:'tag',tagType:'discontinuity-sequence'};if(match[1]){event.number=parseInt(match[1],10);}
1281_this2.trigger('data',event);return;}
1282match=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(newLine);if(match){event={type:'tag',tagType:'playlist-type'};if(match[1]){event.playlistType=match[1];}
1283_this2.trigger('data',event);return;}
1284match=/^#EXT-X-BYTERANGE:?([0-9.]*)?@?([0-9.]*)?/.exec(newLine);if(match){event={type:'tag',tagType:'byterange'};if(match[1]){event.length=parseInt(match[1],10);}
1285if(match[2]){event.offset=parseInt(match[2],10);}
1286_this2.trigger('data',event);return;}
1287match=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(newLine);if(match){event={type:'tag',tagType:'allow-cache'};if(match[1]){event.allowed=!/NO/.test(match[1]);}
1288_this2.trigger('data',event);return;}
1289match=/^#EXT-X-MAP:?(.*)$/.exec(newLine);if(match){event={type:'tag',tagType:'map'};if(match[1]){var attributes=parseAttributes(match[1]);if(attributes.URI){event.uri=attributes.URI;}
1290if(attributes.BYTERANGE){var _attributes$BYTERANGE=attributes.BYTERANGE.split('@'),length=_attributes$BYTERANGE[0],offset=_attributes$BYTERANGE[1];event.byterange={};if(length){event.byterange.length=parseInt(length,10);}
1291if(offset){event.byterange.offset=parseInt(offset,10);}}}
1292_this2.trigger('data',event);return;}
1293match=/^#EXT-X-STREAM-INF:?(.*)$/.exec(newLine);if(match){event={type:'tag',tagType:'stream-inf'};if(match[1]){event.attributes=parseAttributes(match[1]);if(event.attributes.RESOLUTION){var split=event.attributes.RESOLUTION.split('x');var resolution={};if(split[0]){resolution.width=parseInt(split[0],10);}
1294if(split[1]){resolution.height=parseInt(split[1],10);}
1295event.attributes.RESOLUTION=resolution;}
1296if(event.attributes.BANDWIDTH){event.attributes.BANDWIDTH=parseInt(event.attributes.BANDWIDTH,10);}
1297if(event.attributes['PROGRAM-ID']){event.attributes['PROGRAM-ID']=parseInt(event.attributes['PROGRAM-ID'],10);}}
1298_this2.trigger('data',event);return;}
1299match=/^#EXT-X-MEDIA:?(.*)$/.exec(newLine);if(match){event={type:'tag',tagType:'media'};if(match[1]){event.attributes=parseAttributes(match[1]);}
1300_this2.trigger('data',event);return;}
1301match=/^#EXT-X-ENDLIST/.exec(newLine);if(match){_this2.trigger('data',{type:'tag',tagType:'endlist'});return;}
1302match=/^#EXT-X-DISCONTINUITY/.exec(newLine);if(match){_this2.trigger('data',{type:'tag',tagType:'discontinuity'});return;}
1303match=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(newLine);if(match){event={type:'tag',tagType:'program-date-time'};if(match[1]){event.dateTimeString=match[1];event.dateTimeObject=new Date(match[1]);}
1304_this2.trigger('data',event);return;}
1305match=/^#EXT-X-KEY:?(.*)$/.exec(newLine);if(match){event={type:'tag',tagType:'key'};if(match[1]){event.attributes=parseAttributes(match[1]);if(event.attributes.IV){if(event.attributes.IV.substring(0,2).toLowerCase()==='0x'){event.attributes.IV=event.attributes.IV.substring(2);}
1306event.attributes.IV=event.attributes.IV.match(/.{8}/g);event.attributes.IV[0]=parseInt(event.attributes.IV[0],16);event.attributes.IV[1]=parseInt(event.attributes.IV[1],16);event.attributes.IV[2]=parseInt(event.attributes.IV[2],16);event.attributes.IV[3]=parseInt(event.attributes.IV[3],16);event.attributes.IV=new Uint32Array(event.attributes.IV);}}
1307_this2.trigger('data',event);return;}
1308match=/^#EXT-X-START:?(.*)$/.exec(newLine);if(match){event={type:'tag',tagType:'start'};if(match[1]){event.attributes=parseAttributes(match[1]);event.attributes['TIME-OFFSET']=parseFloat(event.attributes['TIME-OFFSET']);event.attributes.PRECISE=/YES/.test(event.attributes.PRECISE);}
1309_this2.trigger('data',event);return;}
1310match=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(newLine);if(match){event={type:'tag',tagType:'cue-out-cont'};if(match[1]){event.data=match[1];}else{event.data='';}
1311_this2.trigger('data',event);return;}
1312match=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(newLine);if(match){event={type:'tag',tagType:'cue-out'};if(match[1]){event.data=match[1];}else{event.data='';}
1313_this2.trigger('data',event);return;}
1314match=/^#EXT-X-CUE-IN:?(.*)?$/.exec(newLine);if(match){event={type:'tag',tagType:'cue-in'};if(match[1]){event.data=match[1];}else{event.data='';}
1315_this2.trigger('data',event);return;}
1316_this2.trigger('data',{type:'tag',data:newLine.slice(4)});});};_proto.addParser=function addParser(_ref){var _this3=this;var expression=_ref.expression,customType=_ref.customType,dataParser=_ref.dataParser,segment=_ref.segment;if(typeof dataParser!=='function'){dataParser=function dataParser(line){return line;};}
1317this.customParsers.push(function(line){var match=expression.exec(line);if(match){_this3.trigger('data',{type:'custom',data:dataParser(line),customType:customType,segment:segment});return true;}});};_proto.addTagMapper=function addTagMapper(_ref2){var expression=_ref2.expression,map=_ref2.map;var mapFn=function mapFn(line){if(expression.test(line)){return map(line);}
1318return line;};this.tagMappers.push(mapFn);};return ParseStream;}(Stream);function decodeB64ToUint8Array(b64Text){var decodedString=window$3.atob(b64Text||'');var array=new Uint8Array(decodedString.length);for(var i=0;i<decodedString.length;i++){array[i]=decodedString.charCodeAt(i);}
1319return array;}
1320var Parser=function(_Stream){_inheritsLoose$1(Parser,_Stream);function Parser(){var _this;_this=_Stream.call(this)||this;_this.lineStream=new LineStream();_this.parseStream=new ParseStream();_this.lineStream.pipe(_this.parseStream);var self=_assertThisInitialized$1(_this);var uris=[];var currentUri={};var currentMap;var _key;var noop=function noop(){};var defaultMediaGroups={'AUDIO':{},'VIDEO':{},'CLOSED-CAPTIONS':{},'SUBTITLES':{}};var widevineUuid='urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed';var currentTimeline=0;_this.manifest={allowCache:true,discontinuityStarts:[],segments:[]};_this.parseStream.on('data',function(entry){var mediaGroup;var rendition;({tag:function tag(){(({'allow-cache':function allowCache(){this.manifest.allowCache=entry.allowed;if(!('allowed'in entry)){this.trigger('info',{message:'defaulting allowCache to YES'});this.manifest.allowCache=true;}},byterange:function byterange(){var byterange={};if('length'in entry){currentUri.byterange=byterange;byterange.length=entry.length;if(!('offset'in entry)){this.trigger('info',{message:'defaulting offset to zero'});entry.offset=0;}}
1321if('offset'in entry){currentUri.byterange=byterange;byterange.offset=entry.offset;}},endlist:function endlist(){this.manifest.endList=true;},inf:function inf(){if(!('mediaSequence'in this.manifest)){this.manifest.mediaSequence=0;this.trigger('info',{message:'defaulting media sequence to zero'});}
1322if(!('discontinuitySequence'in this.manifest)){this.manifest.discontinuitySequence=0;this.trigger('info',{message:'defaulting discontinuity sequence to zero'});}
1323if(entry.duration>0){currentUri.duration=entry.duration;}
1324if(entry.duration===0){currentUri.duration=0.01;this.trigger('info',{message:'updating zero segment duration to a small value'});}
1325this.manifest.segments=uris;},key:function key(){if(!entry.attributes){this.trigger('warn',{message:'ignoring key declaration without attribute list'});return;}
1326if(entry.attributes.METHOD==='NONE'){_key=null;return;}
1327if(!entry.attributes.URI){this.trigger('warn',{message:'ignoring key declaration without URI'});return;}
1328if(entry.attributes.KEYFORMAT===widevineUuid){var VALID_METHODS=['SAMPLE-AES','SAMPLE-AES-CTR','SAMPLE-AES-CENC'];if(VALID_METHODS.indexOf(entry.attributes.METHOD)===-1){this.trigger('warn',{message:'invalid key method provided for Widevine'});return;}
1329if(entry.attributes.METHOD==='SAMPLE-AES-CENC'){this.trigger('warn',{message:'SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead'});}
1330if(entry.attributes.URI.substring(0,23)!=='data:text/plain;base64,'){this.trigger('warn',{message:'invalid key URI provided for Widevine'});return;}
1331if(!(entry.attributes.KEYID&&entry.attributes.KEYID.substring(0,2)==='0x')){this.trigger('warn',{message:'invalid key ID provided for Widevine'});return;}
1332this.manifest.contentProtection={'com.widevine.alpha':{attributes:{schemeIdUri:entry.attributes.KEYFORMAT,keyId:entry.attributes.KEYID.substring(2)},pssh:decodeB64ToUint8Array(entry.attributes.URI.split(',')[1])}};return;}
1333if(!entry.attributes.METHOD){this.trigger('warn',{message:'defaulting key method to AES-128'});}
1334_key={method:entry.attributes.METHOD||'AES-128',uri:entry.attributes.URI};if(typeof entry.attributes.IV!=='undefined'){_key.iv=entry.attributes.IV;}},'media-sequence':function mediaSequence(){if(!isFinite(entry.number)){this.trigger('warn',{message:'ignoring invalid media sequence: '+entry.number});return;}
1335this.manifest.mediaSequence=entry.number;},'discontinuity-sequence':function discontinuitySequence(){if(!isFinite(entry.number)){this.trigger('warn',{message:'ignoring invalid discontinuity sequence: '+entry.number});return;}
1336this.manifest.discontinuitySequence=entry.number;currentTimeline=entry.number;},'playlist-type':function playlistType(){if(!/VOD|EVENT/.test(entry.playlistType)){this.trigger('warn',{message:'ignoring unknown playlist type: '+entry.playlist});return;}
1337this.manifest.playlistType=entry.playlistType;},map:function map(){currentMap={};if(entry.uri){currentMap.uri=entry.uri;}
1338if(entry.byterange){currentMap.byterange=entry.byterange;}},'stream-inf':function streamInf(){this.manifest.playlists=uris;this.manifest.mediaGroups=this.manifest.mediaGroups||defaultMediaGroups;if(!entry.attributes){this.trigger('warn',{message:'ignoring empty stream-inf attributes'});return;}
1339if(!currentUri.attributes){currentUri.attributes={};}
1340_extends(currentUri.attributes,entry.attributes);},media:function media(){this.manifest.mediaGroups=this.manifest.mediaGroups||defaultMediaGroups;if(!(entry.attributes&&entry.attributes.TYPE&&entry.attributes['GROUP-ID']&&entry.attributes.NAME)){this.trigger('warn',{message:'ignoring incomplete or missing media group'});return;}
1341var mediaGroupType=this.manifest.mediaGroups[entry.attributes.TYPE];mediaGroupType[entry.attributes['GROUP-ID']]=mediaGroupType[entry.attributes['GROUP-ID']]||{};mediaGroup=mediaGroupType[entry.attributes['GROUP-ID']];rendition={"default":/yes/i.test(entry.attributes.DEFAULT)};if(rendition["default"]){rendition.autoselect=true;}else{rendition.autoselect=/yes/i.test(entry.attributes.AUTOSELECT);}
1342if(entry.attributes.LANGUAGE){rendition.language=entry.attributes.LANGUAGE;}
1343if(entry.attributes.URI){rendition.uri=entry.attributes.URI;}
1344if(entry.attributes['INSTREAM-ID']){rendition.instreamId=entry.attributes['INSTREAM-ID'];}
1345if(entry.attributes.CHARACTERISTICS){rendition.characteristics=entry.attributes.CHARACTERISTICS;}
1346if(entry.attributes.FORCED){rendition.forced=/yes/i.test(entry.attributes.FORCED);}
1347mediaGroup[entry.attributes.NAME]=rendition;},discontinuity:function discontinuity(){currentTimeline+=1;currentUri.discontinuity=true;this.manifest.discontinuityStarts.push(uris.length);},'program-date-time':function programDateTime(){if(typeof this.manifest.dateTimeString==='undefined'){this.manifest.dateTimeString=entry.dateTimeString;this.manifest.dateTimeObject=entry.dateTimeObject;}
1348currentUri.dateTimeString=entry.dateTimeString;currentUri.dateTimeObject=entry.dateTimeObject;},targetduration:function targetduration(){if(!isFinite(entry.duration)||entry.duration<0){this.trigger('warn',{message:'ignoring invalid target duration: '+entry.duration});return;}
1349this.manifest.targetDuration=entry.duration;},totalduration:function totalduration(){if(!isFinite(entry.duration)||entry.duration<0){this.trigger('warn',{message:'ignoring invalid total duration: '+entry.duration});return;}
1350this.manifest.totalDuration=entry.duration;},start:function start(){if(!entry.attributes||isNaN(entry.attributes['TIME-OFFSET'])){this.trigger('warn',{message:'ignoring start declaration without appropriate attribute list'});return;}
1351this.manifest.start={timeOffset:entry.attributes['TIME-OFFSET'],precise:entry.attributes.PRECISE};},'cue-out':function cueOut(){currentUri.cueOut=entry.data;},'cue-out-cont':function cueOutCont(){currentUri.cueOutCont=entry.data;},'cue-in':function cueIn(){currentUri.cueIn=entry.data;}})[entry.tagType]||noop).call(self);},uri:function uri(){currentUri.uri=entry.uri;uris.push(currentUri);if(this.manifest.targetDuration&&!('duration'in currentUri)){this.trigger('warn',{message:'defaulting segment duration to the target duration'});currentUri.duration=this.manifest.targetDuration;}
1352if(_key){currentUri.key=_key;}
1353currentUri.timeline=currentTimeline;if(currentMap){currentUri.map=currentMap;}
1354currentUri={};},comment:function comment(){},custom:function custom(){if(entry.segment){currentUri.custom=currentUri.custom||{};currentUri.custom[entry.customType]=entry.data;}else{this.manifest.custom=this.manifest.custom||{};this.manifest.custom[entry.customType]=entry.data;}}})[entry.type].call(self);});return _this;}
1355var _proto=Parser.prototype;_proto.push=function push(chunk){this.lineStream.push(chunk);};_proto.end=function end(){this.lineStream.push('\n');};_proto.addParser=function addParser(options){this.parseStream.addParser(options);};_proto.addTagMapper=function addTagMapper(options){this.parseStream.addTagMapper(options);};return Parser;}(Stream);function _interopDefault(ex){return ex&&typeof ex==='object'&&'default'in ex?ex['default']:ex;}
1356var URLToolkit=_interopDefault(urlToolkit);var window$1=_interopDefault(window$3);var resolveUrl=function resolveUrl(baseUrl,relativeUrl){if(/^[a-z]+:/i.test(relativeUrl)){return relativeUrl;}
1357if(!/\/\//i.test(baseUrl)){baseUrl=URLToolkit.buildAbsoluteURL(window$1.location&&window$1.location.href||'',baseUrl);}
1358return URLToolkit.buildAbsoluteURL(baseUrl,relativeUrl);};var resolveUrl_1=resolveUrl;function _interopDefault$1(ex){return ex&&typeof ex==='object'&&'default'in ex?ex['default']:ex;}
1359var window$2=_interopDefault$1(window$3);var atob=function atob(s){return window$2.atob?window$2.atob(s):Buffer.from(s,'base64').toString('binary');};function decodeB64ToUint8Array$1(b64Text){var decodedString=atob(b64Text);var array=new Uint8Array(decodedString.length);for(var i=0;i<decodedString.length;i++){array[i]=decodedString.charCodeAt(i);}
1360return array;}
1361var decodeB64ToUint8Array_1=decodeB64ToUint8Array$1;var nameStartChar=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;var nameChar=new RegExp("[\\-\\.0-9"+nameStartChar.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]");var tagNamePattern=new RegExp('^'+nameStartChar.source+nameChar.source+'*(?:\:'+nameStartChar.source+nameChar.source+'*)?$');var S_TAG=0;var S_ATTR=1;var S_ATTR_SPACE=2;var S_EQ=3;var S_ATTR_NOQUOT_VALUE=4;var S_ATTR_END=5;var S_TAG_SPACE=6;var S_TAG_CLOSE=7;function XMLReader(){}
1362XMLReader.prototype={parse:function parse(source,defaultNSMap,entityMap){var domBuilder=this.domBuilder;domBuilder.startDocument();_copy(defaultNSMap,defaultNSMap={});_parse(source,defaultNSMap,entityMap,domBuilder,this.errorHandler);domBuilder.endDocument();}};function _parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){function fixedFromCharCode(code){if(code>0xffff){code-=0x10000;var surrogate1=0xd800+(code>>10),surrogate2=0xdc00+(code&0x3ff);return String.fromCharCode(surrogate1,surrogate2);}else{return String.fromCharCode(code);}}
1363function entityReplacer(a){var k=a.slice(1,-1);if(k in entityMap){return entityMap[k];}
vendor: 1,820 bytes, lines 1363-1371
1363else if(k.charAt(0)==='#'){return fixedFromCharCode(parseInt(k.substr(1).replace('x','0x')));}else{errorHandler.error('entity not found:'+a);return a;}}
1364function appendText(end){if(end>start){var xt=source.substring(start,end).replace(/&#?\w+;/g,entityReplacer);locator&&position(start);domBuilder.characters(xt,0,end-start);start=end;}}
1365function position(p,m){while(p>=lineEnd&&(m=linePattern.exec(source))){lineStart=m.index;lineEnd=lineStart+m[0].length;locator.lineNumber++;}
1366locator.columnNumber=p-lineStart+1;}
1367var lineStart=0;var lineEnd=0;var linePattern=/.*(?:\r\n?|\n)|.*$/g;var locator=domBuilder.locator;var parseStack=[{currentNSMap:defaultNSMapCopy}];var closeMap={};var start=0;while(true){try{var tagStart=source.indexOf('<',start);if(tagStart<0){if(!source.substr(start).match(/^\s*$/)){var doc=domBuilder.doc;var text=doc.createTextNode(source.substr(start));doc.appendChild(text);domBuilder.currentElement=text;}
1368return;}
1369if(tagStart>start){appendText(tagStart);}
1370switch(source.charAt(tagStart+1)){case '/':var end=source.indexOf('>',tagStart+3);var tagName=source.substring(tagStart+2,end);var config=parseStack.pop();if(end<0){tagName=source.substring(tagStart+2).replace(/[\s<].*/,'');errorHandler.error("end tag name: "+tagName+' is not complete:'+config.tagName);end=tagStart+1+tagName.length;}else if(tagName.match(/\s</)){tagName=tagName.replace(/[\s<].*/,'');errorHandler.error("end tag name: "+tagName+' maybe not complete');end=tagStart+1+tagName.length;}
1371var localNSMap=config.localNSMap;var endMatch=config.tagName==tagName;var endIgnoreCaseMach=endMatch||config.tagName&&config.tagName.toLowerCase()==tagName.toLowerCase();if(endIgnoreCaseMach){domBuilder.endElement(config.uri,config.localName,tagName);if(localNSMap){for(var prefix in localNSMap){domBuilder.endPrefixMapping(prefix);}}
vendor: 6,133 bytes, lines 1372-1400
1372if(!endMatch){errorHandler.fatalError("end tag name: "+tagName+' is not match the current start tagName:'+config.tagName);}}else{parseStack.push(config);}
1373end++;break;case '?':locator&&position(tagStart);end=parseInstruction(source,tagStart,domBuilder);break;case '!':locator&&position(tagStart);end=parseDCC(source,tagStart,domBuilder,errorHandler);break;default:locator&&position(tagStart);var el=new ElementAttributes();var currentNSMap=parseStack[parseStack.length-1].currentNSMap;var end=parseElementStartPart(source,tagStart,el,currentNSMap,entityReplacer,errorHandler);var len=el.length;if(!el.closed&&fixSelfClosed(source,end,el.tagName,closeMap)){el.closed=true;if(!entityMap.nbsp){errorHandler.warning('unclosed xml attribute');}}
1374if(locator&&len){var locator2=copyLocator(locator,{});for(var i=0;i<len;i++){var a=el[i];position(a.offset);a.locator=copyLocator(locator,{});}
1375domBuilder.locator=locator2;if(appendElement(el,domBuilder,currentNSMap)){parseStack.push(el);}
1376domBuilder.locator=locator;}else{if(appendElement(el,domBuilder,currentNSMap)){parseStack.push(el);}}
1377if(el.uri==='http://www.w3.org/1999/xhtml'&&!el.closed){end=parseHtmlSpecialContent(source,end,el.tagName,entityReplacer,domBuilder);}else{end++;}}}catch(e){errorHandler.error('element parse error: '+e);end=-1;}
1378if(end>start){start=end;}else{appendText(Math.max(tagStart,start)+1);}}}
1379function copyLocator(f,t){t.lineNumber=f.lineNumber;t.columnNumber=f.columnNumber;return t;}
1380function parseElementStartPart(source,start,el,currentNSMap,entityReplacer,errorHandler){var attrName;var value;var p=++start;var s=S_TAG;while(true){var c=source.charAt(p);switch(c){case '=':if(s===S_ATTR){attrName=source.slice(start,p);s=S_EQ;}else if(s===S_ATTR_SPACE){s=S_EQ;}else{throw new Error('attribute equal must after attrName');}
1381break;case '\'':case '"':if(s===S_EQ||s===S_ATTR){if(s===S_ATTR){errorHandler.warning('attribute value must after "="');attrName=source.slice(start,p);}
1382start=p+1;p=source.indexOf(c,start);if(p>0){value=source.slice(start,p).replace(/&#?\w+;/g,entityReplacer);el.add(attrName,value,start-1);s=S_ATTR_END;}else{throw new Error('attribute value no end \''+c+'\' match');}}else if(s==S_ATTR_NOQUOT_VALUE){value=source.slice(start,p).replace(/&#?\w+;/g,entityReplacer);el.add(attrName,value,start);errorHandler.warning('attribute "'+attrName+'" missed start quot('+c+')!!');start=p+1;s=S_ATTR_END;}else{throw new Error('attribute value must after "="');}
1383break;case '/':switch(s){case S_TAG:el.setTagName(source.slice(start,p));case S_ATTR_END:case S_TAG_SPACE:case S_TAG_CLOSE:s=S_TAG_CLOSE;el.closed=true;case S_ATTR_NOQUOT_VALUE:case S_ATTR:case S_ATTR_SPACE:break;default:throw new Error("attribute invalid close char('/')");}
1384break;case '':errorHandler.error('unexpected end of input');if(s==S_TAG){el.setTagName(source.slice(start,p));}
1385return p;case '>':switch(s){case S_TAG:el.setTagName(source.slice(start,p));case S_ATTR_END:case S_TAG_SPACE:case S_TAG_CLOSE:break;case S_ATTR_NOQUOT_VALUE:case S_ATTR:value=source.slice(start,p);if(value.slice(-1)==='/'){el.closed=true;value=value.slice(0,-1);}
1386case S_ATTR_SPACE:if(s===S_ATTR_SPACE){value=attrName;}
1387if(s==S_ATTR_NOQUOT_VALUE){errorHandler.warning('attribute "'+value+'" missed quot(")!!');el.add(attrName,value.replace(/&#?\w+;/g,entityReplacer),start);}else{if(currentNSMap['']!=='http://www.w3.org/1999/xhtml'||!value.match(/^(?:disabled|checked|selected)$/i)){errorHandler.warning('attribute "'+value+'" missed value!! "'+value+'" instead!!');}
1388el.add(value,value,start);}
1389break;case S_EQ:throw new Error('attribute value missed!!');}
1390return p;case "\x80":c=' ';default:if(c<=' '){switch(s){case S_TAG:el.setTagName(source.slice(start,p));s=S_TAG_SPACE;break;case S_ATTR:attrName=source.slice(start,p);s=S_ATTR_SPACE;break;case S_ATTR_NOQUOT_VALUE:var value=source.slice(start,p).replace(/&#?\w+;/g,entityReplacer);errorHandler.warning('attribute "'+value+'" missed quot(")!!');el.add(attrName,value,start);case S_ATTR_END:s=S_TAG_SPACE;break;}}else{switch(s){case S_ATTR_SPACE:var tagName=el.tagName;if(currentNSMap['']!=='http://www.w3.org/1999/xhtml'||!attrName.match(/^(?:disabled|checked|selected)$/i)){errorHandler.warning('attribute "'+attrName+'" missed value!! "'+attrName+'" instead2!!');}
1391el.add(attrName,attrName,start);start=p;s=S_ATTR;break;case S_ATTR_END:errorHandler.warning('attribute space is required"'+attrName+'"!!');case S_TAG_SPACE:s=S_ATTR;start=p;break;case S_EQ:s=S_ATTR_NOQUOT_VALUE;start=p;break;case S_TAG_CLOSE:throw new Error("elements closed character '/' and '>' must be connected to");}}}
1392p++;}}
1393function appendElement(el,domBuilder,currentNSMap){var tagName=el.tagName;var localNSMap=null;var i=el.length;while(i--){var a=el[i];var qName=a.qName;var value=a.value;var nsp=qName.indexOf(':');if(nsp>0){var prefix=a.prefix=qName.slice(0,nsp);var localName=qName.slice(nsp+1);var nsPrefix=prefix==='xmlns'&&localName;}else{localName=qName;prefix=null;nsPrefix=qName==='xmlns'&&'';}
1394a.localName=localName;if(nsPrefix!==false){if(localNSMap==null){localNSMap={};_copy(currentNSMap,currentNSMap={});}
1395currentNSMap[nsPrefix]=localNSMap[nsPrefix]=value;a.uri='http://www.w3.org/2000/xmlns/';domBuilder.startPrefixMapping(nsPrefix,value);}}
1396var i=el.length;while(i--){a=el[i];var prefix=a.prefix;if(prefix){if(prefix==='xml'){a.uri='http://www.w3.org/XML/1998/namespace';}
1397if(prefix!=='xmlns'){a.uri=currentNSMap[prefix||''];}}}
1398var nsp=tagName.indexOf(':');if(nsp>0){prefix=el.prefix=tagName.slice(0,nsp);localName=el.localName=tagName.slice(nsp+1);}else{prefix=null;localName=el.localName=tagName;}
1399var ns=el.uri=currentNSMap[prefix||''];domBuilder.startElement(ns,localName,tagName,el);if(el.closed){domBuilder.endElement(ns,localName,tagName);if(localNSMap){for(prefix in localNSMap){domBuilder.endPrefixMapping(prefix);}}}else{el.currentNSMap=currentNSMap;el.localNSMap=localNSMap;return true;}}
1400function parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBuilder){if(/^(?:script|textarea)$/i.test(tagName)){var elEndStart=source.indexOf('</'+tagName+'>',elStartEnd);var text=source.substring(elStartEnd+1,elEndStart);
1400if(/[&<]/.test(text)){if(/^script$/i.test(tagName)){domBuilder.characters(text,0,text.length);return elEndStart;}
1401text=text.replace(/&#?\w+;/g,entityReplacer);domBuilder.characters(text,0,text.length);return elEndStart;}}
1402return elStartEnd+1;}
1403function fixSelfClosed(source,elStartEnd,tagName,closeMap){var pos=closeMap[tagName];if(pos==null){pos=source.lastIndexOf('</'+tagName+'>');if(pos<elStartEnd){pos=source.lastIndexOf('</'+tagName);}
1404closeMap[tagName]=pos;}
1405return pos<elStartEnd;}
1406function _copy(source,target){for(var n in source){target[n]=source[n];}}
1407function parseDCC(source,start,domBuilder,errorHandler){var next=source.charAt(start+2);switch(next){case '-':if(source.charAt(start+3)==='-'){var end=source.indexOf('-->',start+4);if(end>start){domBuilder.comment(source,start+4,end-start-4);return end+3;}else{errorHandler.error("Unclosed comment");return-1;}}else{return-1;}
1408default:if(source.substr(start+3,6)=='CDATA['){var end=source.indexOf(']]>',start+9);domBuilder.startCDATA();domBuilder.characters(source,start+9,end-start-9);domBuilder.endCDATA();return end+3;}
1409var matchs=split(source,start);var len=matchs.length;if(len>1&&/!doctype/i.test(matchs[0][0])){var name=matchs[1][0];var pubid=len>3&&/^public$/i.test(matchs[2][0])&&matchs[3][0];var sysid=len>4&&matchs[4][0];var lastMatch=matchs[len-1];domBuilder.startDTD(name,pubid&&pubid.replace(/^(['"])(.*?)\1$/,'$2'),sysid&&sysid.replace(/^(['"])(.*?)\1$/,'$2'));domBuilder.endDTD();return lastMatch.index+lastMatch[0].length;}}
1410return-1;}
1411function parseInstruction(source,start,domBuilder){var end=source.indexOf('?>',start);if(end){var match=source.substring(start,end).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(match){var len=match[0].length;domBuilder.processingInstruction(match[1],match[2]);return end+2;}else{return-1;}}
1412return-1;}
1413function ElementAttributes(source){}
1414ElementAttributes.prototype={setTagName:function setTagName(tagName){if(!tagNamePattern.test(tagName)){throw new Error('invalid tagName:'+tagName);}
1415this.tagName=tagName;},add:function add(qName,value,offset){if(!tagNamePattern.test(qName)){throw new Error('invalid attribute:'+qName);}
1416this[this.length++]={qName:qName,value:value,offset:offset};},length:0,getLocalName:function getLocalName(i){return this[i].localName;},getLocator:function getLocator(i){return this[i].locator;},getQName:function getQName(i){return this[i].qName;},getURI:function getURI(i){return this[i].uri;},getValue:function getValue(i){return this[i].value;}};function _set_proto_(thiz,parent){thiz.__proto__=parent;return thiz;}
1417if(!(_set_proto_({},_set_proto_.prototype)instanceof _set_proto_)){_set_proto_=function _set_proto_(thiz,parent){function p(){}
1418p.prototype=parent;p=new p();for(parent in thiz){p[parent]=thiz[parent];}
1419return p;};}
1420function split(source,start){var match;var buf=[];var reg=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;reg.lastIndex=start;reg.exec(source);while(match=reg.exec(source)){buf.push(match);if(match[1])return buf;}}
1421var XMLReader_1=XMLReader;var sax={XMLReader:XMLReader_1};function copy(src,dest){for(var p in src){dest[p]=src[p];}}
1422function _extends$1(Class,Super){var pt=Class.prototype;if(Object.create){var ppt=Object.create(Super.prototype);pt.__proto__=ppt;}
1423if(!(pt instanceof Super)){var t=function t(){};t.prototype=Super.prototype;t=new t();copy(pt,t);Class.prototype=pt=t;}
1424if(pt.constructor!=Class){if(typeof Class!='function'){console.error("unknow Class:"+Class);}
1425pt.constructor=Class;}}
1426var htmlns='http://www.w3.org/1999/xhtml';var NodeType={};var ELEMENT_NODE=NodeType.ELEMENT_NODE=1;var ATTRIBUTE_NODE=NodeType.ATTRIBUTE_NODE=2;var TEXT_NODE=NodeType.TEXT_NODE=3;var CDATA_SECTION_NODE=NodeType.CDATA_SECTION_NODE=4;var ENTITY_REFERENCE_NODE=NodeType.ENTITY_REFERENCE_NODE=5;var ENTITY_NODE=NodeType.ENTITY_NODE=6;var PROCESSING_INSTRUCTION_NODE=NodeType.PROCESSING_INSTRUCTION_NODE=7;var COMMENT_NODE=NodeType.COMMENT_NODE=8;var DOCUMENT_NODE=NodeType.DOCUMENT_NODE=9;var DOCUMENT_TYPE_NODE=NodeType.DOCUMENT_TYPE_NODE=10;var DOCUMENT_FRAGMENT_NODE=NodeType.DOCUMENT_FRAGMENT_NODE=11;
1426var NOTATION_NODE=NodeType.NOTATION_NODE=12;var ExceptionCode={};var ExceptionMessage={};var INDEX_SIZE_ERR=ExceptionCode.INDEX_SIZE_ERR=(ExceptionMessage[1]="Index size error",1);var DOMSTRING_SIZE_ERR=ExceptionCode.DOMSTRING_SIZE_ERR=(ExceptionMessage[2]="DOMString size error",2);var HIERARCHY_REQUEST_ERR=ExceptionCode.HIERARCHY_REQUEST_ERR=(ExceptionMessage[3]="Hierarchy request error",3);var WRONG_DOCUMENT_ERR=ExceptionCode.WRONG_DOCUMENT_ERR=(ExceptionMessage[4]="Wrong document",4);var INVALID_CHARACTER_ERR=ExceptionCode.INVALID_CHARACTER_ERR=(ExceptionMessage[5]="Invalid character",5);var NO_DATA_ALLOWED_ERR=ExceptionCode.NO_DATA_ALLOWED_ERR=(ExceptionMessage[6]="No data allowed",6);var NO_MODIFICATION_ALLOWED_ERR=ExceptionCode.NO_MODIFICATION_ALLOWED_ERR=(ExceptionMessage[7]="No modification allowed",7);var NOT_FOUND_ERR=ExceptionCode.NOT_FOUND_ERR=(ExceptionMessage[8]="Not found",8);var NOT_SUPPORTED_ERR=ExceptionCode.NOT_SUPPORTED_ERR=(ExceptionMessage[9]="Not supported",9);var INUSE_ATTRIBUTE_ERR=ExceptionCode.INUSE_ATTRIBUTE_ERR=(ExceptionMessage[10]="Attribute in use",10);var INVALID_STATE_ERR=ExceptionCode.INVALID_STATE_ERR=(ExceptionMessage[11]="Invalid state",11);var SYNTAX_ERR=ExceptionCode.SYNTAX_ERR=(ExceptionMessage[12]="Syntax error",12);var INVALID_MODIFICATION_ERR=ExceptionCode.INVALID_MODIFICATION_ERR=(ExceptionMessage[13]="Invalid modification",13);var NAMESPACE_ERR=ExceptionCode.NAMESPACE_ERR=(ExceptionMessage[14]="Invalid namespace",14);var INVALID_ACCESS_ERR=ExceptionCode.INVALID_ACCESS_ERR=(ExceptionMessage[15]="Invalid access",15);function DOMException(code,message){if(message instanceof Error){var error=message;}else{error=this;Error.call(this,ExceptionMessage[code]);this.message=ExceptionMessage[code];if(Error.captureStackTrace)Error.captureStackTrace(this,DOMException);}
1427error.code=code;if(message)this.message=this.message+": "+message;return error;}
1428DOMException.prototype=Error.prototype;copy(ExceptionCode,DOMException);function NodeList(){}
1429NodeList.prototype={length:0,item:function item(index){return this[index]||null;},toString:function toString(isHTML,nodeFilter){for(var buf=[],i=0;i<this.length;i++){serializeToString(this[i],buf,isHTML,nodeFilter);}
1430return buf.join('');}};function LiveNodeList(node,refresh){this._node=node;this._refresh=refresh;_updateLiveList(this);}
1431function _updateLiveList(list){var inc=list._node._inc||list._node.ownerDocument._inc;if(list._inc!=inc){var ls=list._refresh(list._node);__set__(list,'length',ls.length);copy(ls,list);list._inc=inc;}}
1432LiveNodeList.prototype.item=function(i){_updateLiveList(this);return this[i];};_extends$1(LiveNodeList,NodeList);function NamedNodeMap(){}
1433function _findNodeIndex(list,node){var i=list.length;while(i--){if(list[i]===node){return i;}}}
1434function _addNamedNode(el,list,newAttr,oldAttr){if(oldAttr){list[_findNodeIndex(list,oldAttr)]=newAttr;}else{list[list.length++]=newAttr;}
1435if(el){newAttr.ownerElement=el;var doc=el.ownerDocument;if(doc){oldAttr&&_onRemoveAttribute(doc,el,oldAttr);_onAddAttribute(doc,el,newAttr);}}}
1436function _removeNamedNode(el,list,attr){var i=_findNodeIndex(list,attr);if(i>=0){var lastIndex=list.length-1;while(i<lastIndex){list[i]=list[++i];}
1437list.length=lastIndex;if(el){var doc=el.ownerDocument;if(doc){_onRemoveAttribute(doc,el,attr);attr.ownerElement=null;}}}else{throw DOMException(NOT_FOUND_ERR,new Error(el.tagName+'@'+attr));}}
1438NamedNodeMap.prototype={length:0,item:NodeList.prototype.item,getNamedItem:function getNamedItem(key){var i=this.length;while(i--){var attr=this[i];if(attr.nodeName==key){return attr;}}},setNamedItem:function setNamedItem(attr){var el=attr.ownerElement;if(el&&el!=this._ownerElement){throw new DOMException(INUSE_ATTRIBUTE_ERR);}
1439var oldAttr=this.getNamedItem(attr.nodeName);_addNamedNode(this._ownerElement,this,attr,oldAttr);return oldAttr;},setNamedItemNS:function setNamedItemNS(attr){var el=attr.ownerElement,oldAttr;if(el&&el!=this._ownerElement){throw new DOMException(INUSE_ATTRIBUTE_ERR);}
1440oldAttr=this.getNamedItemNS(attr.namespaceURI,attr.localName);_addNamedNode(this._ownerElement,this,attr,oldAttr);return oldAttr;},removeNamedItem:function removeNamedItem(key){var attr=this.getNamedItem(key);_removeNamedNode(this._ownerElement,this,attr);return attr;},removeNamedItemNS:function removeNamedItemNS(namespaceURI,localName){var attr=this.getNamedItemNS(namespaceURI,localName);_removeNamedNode(this._ownerElement,this,attr);return attr;},getNamedItemNS:function getNamedItemNS(namespaceURI,localName){var i=this.length;while(i--){var node=this[i];if(node.localName==localName&&node.namespaceURI==namespaceURI){return node;}}
1441return null;}};function DOMImplementation(features){this._features={};if(features){for(var feature in features){this._features=features[feature];}}}
1442DOMImplementation.prototype={hasFeature:function hasFeature(feature,version){var versions=this._features[feature.toLowerCase()];if(versions&&(!version||version in versions)){return true;}else{return false;}},createDocument:function createDocument(namespaceURI,qualifiedName,doctype){var doc=new Document();doc.implementation=this;doc.childNodes=new NodeList();doc.doctype=doctype;if(doctype){doc.appendChild(doctype);}
1443if(qualifiedName){var root=doc.createElementNS(namespaceURI,qualifiedName);doc.appendChild(root);}
1444return doc;}
1444,createDocumentType:function createDocumentType(qualifiedName,publicId,systemId){var node=new DocumentType();node.name=qualifiedName;node.nodeName=qualifiedName;node.publicId=publicId;node.systemId=systemId;return node;}};function Node(){}
1445Node.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function insertBefore(newChild,refChild){return _insertBefore(this,newChild,refChild);},replaceChild:function replaceChild(newChild,oldChild){this.insertBefore(newChild,oldChild);if(oldChild){this.removeChild(oldChild);}},removeChild:function removeChild(oldChild){return _removeChild(this,oldChild);},appendChild:function appendChild(newChild){return this.insertBefore(newChild,null);},hasChildNodes:function hasChildNodes(){return this.firstChild!=null;},cloneNode:function cloneNode(deep){return _cloneNode(this.ownerDocument||this,this,deep);},normalize:function normalize(){var child=this.firstChild;while(child){var next=child.nextSibling;if(next&&next.nodeType==TEXT_NODE&&child.nodeType==TEXT_NODE){this.removeChild(next);child.appendData(next.data);}else{child.normalize();child=next;}}},isSupported:function isSupported(feature,version){return this.ownerDocument.implementation.hasFeature(feature,version);},hasAttributes:function hasAttributes(){return this.attributes.length>0;},lookupPrefix:function lookupPrefix(namespaceURI){var el=this;while(el){var map=el._nsMap;if(map){for(var n in map){if(map[n]==namespaceURI){return n;}}}
1446el=el.nodeType==ATTRIBUTE_NODE?el.ownerDocument:el.parentNode;}
1447return null;},lookupNamespaceURI:function lookupNamespaceURI(prefix){var el=this;while(el){var map=el._nsMap;if(map){if(prefix in map){return map[prefix];}}
1448el=el.nodeType==ATTRIBUTE_NODE?el.ownerDocument:el.parentNode;}
1449return null;},isDefaultNamespace:function isDefaultNamespace(namespaceURI){var prefix=this.lookupPrefix(namespaceURI);return prefix==null;}};function _xmlEncoder(c){return c=='<'&&'&lt;'||c=='>'&&'&gt;'||c=='&'&&'&amp;'||c=='"'&&'&quot;'||'&#'+c.charCodeAt()+';';}
1450copy(NodeType,Node);copy(NodeType,Node.prototype);function _visitNode(node,callback){if(callback(node)){return true;}
1451if(node=node.firstChild){do{if(_visitNode(node,callback)){return true;}}while(node=node.nextSibling);}}
1452function Document(){}
1453function _onAddAttribute(doc,el,newAttr){doc&&doc._inc++;var ns=newAttr.namespaceURI;if(ns=='http://www.w3.org/2000/xmlns/'){el._nsMap[newAttr.prefix?newAttr.localName:'']=newAttr.value;}}
1454function _onRemoveAttribute(doc,el,newAttr,remove){doc&&doc._inc++;var ns=newAttr.namespaceURI;if(ns=='http://www.w3.org/2000/xmlns/'){delete el._nsMap[newAttr.prefix?newAttr.localName:''];}}
1455function _onUpdateChild(doc,el,newChild){if(doc&&doc._inc){doc._inc++;var cs=el.childNodes;if(newChild){cs[cs.length++]=newChild;}else{var child=el.firstChild;var i=0;while(child){cs[i++]=child;child=child.nextSibling;}
1456cs.length=i;}}}
1457function _removeChild(parentNode,child){var previous=child.previousSibling;var next=child.nextSibling;if(previous){previous.nextSibling=next;}else{parentNode.firstChild=next;}
1458if(next){next.previousSibling=previous;}else{parentNode.lastChild=previous;}
1459_onUpdateChild(parentNode.ownerDocument,parentNode);return child;}
1460function _insertBefore(parentNode,newChild,nextChild){var cp=newChild.parentNode;if(cp){cp.removeChild(newChild);}
1461if(newChild.nodeType===DOCUMENT_FRAGMENT_NODE){var newFirst=newChild.firstChild;if(newFirst==null){return newChild;}
1462var newLast=newChild.lastChild;}else{newFirst=newLast=newChild;}
1463var pre=nextChild?nextChild.previousSibling:parentNode.lastChild;newFirst.previousSibling=pre;newLast.nextSibling=nextChild;if(pre){pre.nextSibling=newFirst;}else{parentNode.firstChild=newFirst;}
1464if(nextChild==null){parentNode.lastChild=newLast;}else{nextChild.previousSibling=newLast;}
1465do{newFirst.parentNode=parentNode;}while(newFirst!==newLast&&(newFirst=newFirst.nextSibling));_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);if(newChild.nodeType==DOCUMENT_FRAGMENT_NODE){newChild.firstChild=newChild.lastChild=null;}
1466return newChild;}
1467function _appendSingleChild(parentNode,newChild){var cp=newChild.parentNode;if(cp){var pre=parentNode.lastChild;cp.removeChild(newChild);var pre=parentNode.lastChild;}
1468var pre=parentNode.lastChild;newChild.parentNode=parentNode;newChild.previousSibling=pre;newChild.nextSibling=null;if(pre){pre.nextSibling=newChild;}else{parentNode.firstChild=newChild;}
1469parentNode.lastChild=newChild;_onUpdateChild(parentNode.ownerDocument,parentNode,newChild);return newChild;}
1470Document.prototype={nodeName:'#document',nodeType:DOCUMENT_NODE,doctype:null,documentElement:null,_inc:1,insertBefore:function insertBefore(newChild,refChild){if(newChild.nodeType==DOCUMENT_FRAGMENT_NODE){var child=newChild.firstChild;while(child){var next=child.nextSibling;this.insertBefore(child,refChild);child=next;}
1471return newChild;}
1472if(this.documentElement==null&&newChild.nodeType==ELEMENT_NODE){this.documentElement=newChild;}
1473return _insertBefore(this,newChild,refChild),newChild.ownerDocument=this,newChild;},removeChild:function removeChild(oldChild){if(this.documentElement==oldChild){this.documentElement=null;}
1474return _removeChild(this,oldChild);},importNode:function importNode(importedNode,deep){return _importNode(this,importedNode,deep);},getElementById:function getElementById(id){var rtv=null;_visitNode(this.documentElement,function(node){if(node.nodeType==ELEMENT_NODE){if(node.getAttribute('id')==id){rtv=node;return true;}}});return rtv;},createElement:function createElement(tagName){var node=new Element();node.ownerDocument=this;node.nodeName=tagName;node.tagName=tagName;node.childNodes=new NodeList();var attrs=node.attributes=new NamedNodeMap();attrs._ownerElement=node;return node;},createDocumentFragment:function createDocumentFragment(){var node=new DocumentFragment();node.ownerDocument=this;node.childNodes=new NodeList();return node;},createTextNode:function createTextNode(data){var node=new Text();node.ownerDocument=this;node.appendData(data);return node;},createComment:function createComment(data){var node=new Comment();node.ownerDocument=this;node.appendData(data);return node;},createCDATASection:function createCDATASection(data){var node=new CDATASection();node.ownerDocument=this;node.appendData(data);return node;},createProcessingInstruction:function createProcessingInstruction(target,data){var node=new ProcessingInstruction();node.ownerDocument=this;node.tagName=node.target=target;node.nodeValue=node.data=data;return node;},createAttribute:function createAttribute(name){var node=new Attr();node.ownerDocument=this;node.name=name;node.nodeName=name;node.localName=name;node.specified=true;return node;},createEntityReference:function createEntityReference(name){var node=new EntityReference();node.ownerDocument=this;node.nodeName=name;return node;},createElementNS:function createElementNS(namespaceURI,qualifiedName){var node=new Element();var pl=qualifiedName.split(':');var attrs=node.attributes=new NamedNodeMap();node.childNodes=new NodeList();node.ownerDocument=this;node.nodeName=qualifiedName;node.tagName=qualifiedName;node.namespaceURI=namespaceURI;if(pl.length==2){node.prefix=pl[0];
1474node.localName=pl[1];}else{node.localName=qualifiedName;}
1475attrs._ownerElement=node;return node;},createAttributeNS:function createAttributeNS(namespaceURI,qualifiedName){var node=new Attr();var pl=qualifiedName.split(':');node.ownerDocument=this;node.nodeName=qualifiedName;node.name=qualifiedName;node.namespaceURI=namespaceURI;node.specified=true;if(pl.length==2){node.prefix=pl[0];node.localName=pl[1];}else{node.localName=qualifiedName;}
1476return node;}};_extends$1(Document,Node);function Element(){this._nsMap={};}
1477Element.prototype={nodeType:ELEMENT_NODE,hasAttribute:function hasAttribute(name){return this.getAttributeNode(name)!=null;},getAttribute:function getAttribute(name){var attr=this.getAttributeNode(name);return attr&&attr.value||'';},getAttributeNode:function getAttributeNode(name){return this.attributes.getNamedItem(name);},setAttribute:function setAttribute(name,value){var attr=this.ownerDocument.createAttribute(name);attr.value=attr.nodeValue=""+value;this.setAttributeNode(attr);},removeAttribute:function removeAttribute(name){var attr=this.getAttributeNode(name);attr&&this.removeAttributeNode(attr);},appendChild:function appendChild(newChild){if(newChild.nodeType===DOCUMENT_FRAGMENT_NODE){return this.insertBefore(newChild,null);}else{return _appendSingleChild(this,newChild);}},setAttributeNode:function setAttributeNode(newAttr){return this.attributes.setNamedItem(newAttr);},setAttributeNodeNS:function setAttributeNodeNS(newAttr){return this.attributes.setNamedItemNS(newAttr);},removeAttributeNode:function removeAttributeNode(oldAttr){return this.attributes.removeNamedItem(oldAttr.nodeName);},removeAttributeNS:function removeAttributeNS(namespaceURI,localName){var old=this.getAttributeNodeNS(namespaceURI,localName);old&&this.removeAttributeNode(old);},hasAttributeNS:function hasAttributeNS(namespaceURI,localName){return this.getAttributeNodeNS(namespaceURI,localName)!=null;},getAttributeNS:function getAttributeNS(namespaceURI,localName){var attr=this.getAttributeNodeNS(namespaceURI,localName);return attr&&attr.value||'';},setAttributeNS:function setAttributeNS(namespaceURI,qualifiedName,value){var attr=this.ownerDocument.createAttributeNS(namespaceURI,qualifiedName);attr.value=attr.nodeValue=""+value;this.setAttributeNode(attr);},getAttributeNodeNS:function getAttributeNodeNS(namespaceURI,localName){return this.attributes.getNamedItemNS(namespaceURI,localName);},getElementsByTagName:function getElementsByTagName(tagName){return new LiveNodeList(this,function(base){var ls=[];_visitNode(base,function(node){if(node!==base&&node.nodeType==ELEMENT_NODE&&(tagName==='*'||node.tagName==tagName)){ls.push(node);}});return ls;});},getElementsByTagNameNS:function getElementsByTagNameNS(namespaceURI,localName){return new LiveNodeList(this,function(base){var ls=[];_visitNode(base,function(node){if(node!==base&&node.nodeType===ELEMENT_NODE&&(namespaceURI==='*'||node.namespaceURI===namespaceURI)&&(localName==='*'||node.localName==localName)){ls.push(node);}});return ls;});}};Document.prototype.getElementsByTagName=Element.prototype.getElementsByTagName;Document.prototype.getElementsByTagNameNS=Element.prototype.getElementsByTagNameNS;_extends$1(Element,Node);function Attr(){}
1478Attr.prototype.nodeType=ATTRIBUTE_NODE;_extends$1(Attr,Node);function CharacterData(){}
1479CharacterData.prototype={data:'',substringData:function substringData(offset,count){return this.data.substring(offset,offset+count);},appendData:function appendData(text){text=this.data+text;this.nodeValue=this.data=text;this.length=text.length;},insertData:function insertData(offset,text){this.replaceData(offset,0,text);},appendChild:function appendChild(newChild){throw new Error(ExceptionMessage[HIERARCHY_REQUEST_ERR]);},deleteData:function deleteData(offset,count){this.replaceData(offset,count,"");},replaceData:function replaceData(offset,count,text){var start=this.data.substring(0,offset);var end=this.data.substring(offset+count);text=start+text+end;this.nodeValue=this.data=text;this.length=text.length;}};_extends$1(CharacterData,Node);function Text(){}
1480Text.prototype={nodeName:"#text",nodeType:TEXT_NODE,splitText:function splitText(offset){var text=this.data;var newText=text.substring(offset);text=text.substring(0,offset);this.data=this.nodeValue=text;this.length=text.length;var newNode=this.ownerDocument.createTextNode(newText);if(this.parentNode){this.parentNode.insertBefore(newNode,this.nextSibling);}
1481return newNode;}};_extends$1(Text,CharacterData);function Comment(){}
1482Comment.prototype={nodeName:"#comment",nodeType:COMMENT_NODE};_extends$1(Comment,CharacterData);function CDATASection(){}
1483CDATASection.prototype={nodeName:"#cdata-section",nodeType:CDATA_SECTION_NODE};_extends$1(CDATASection,CharacterData);function DocumentType(){}
1484DocumentType.prototype.nodeType=DOCUMENT_TYPE_NODE;_extends$1(DocumentType,Node);function Notation(){}
1485Notation.prototype.nodeType=NOTATION_NODE;_extends$1(Notation,Node);function Entity(){}
1486Entity.prototype.nodeType=ENTITY_NODE;_extends$1(Entity,Node);function EntityReference(){}
1487EntityReference.prototype.nodeType=ENTITY_REFERENCE_NODE;_extends$1(EntityReference,Node);function DocumentFragment(){}
1488DocumentFragment.prototype.nodeName="#document-fragment";DocumentFragment.prototype.nodeType=DOCUMENT_FRAGMENT_NODE;_extends$1(DocumentFragment,Node);function ProcessingInstruction(){}
1489ProcessingInstruction.prototype.nodeType=PROCESSING_INSTRUCTION_NODE;_extends$1(ProcessingInstruction,Node);function XMLSerializer(){}
1490XMLSerializer.prototype.serializeToString=function(node,isHtml,nodeFilter){return nodeSerializeToString.call(node,isHtml,nodeFilter);};Node.prototype.toString=nodeSerializeToString;function nodeSerializeToString(isHtml,nodeFilter){var buf=[];
1490var refNode=this.nodeType==9?this.documentElement:this;var prefix=refNode.prefix;var uri=refNode.namespaceURI;if(uri&&prefix==null){var prefix=refNode.lookupPrefix(uri);if(prefix==null){var visibleNamespaces=[{namespace:uri,prefix:null}];}}
1491serializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces);return buf.join('');}
1492function needNamespaceDefine(node,isHTML,visibleNamespaces){var prefix=node.prefix||'';var uri=node.namespaceURI;if(!prefix&&!uri){return false;}
1493if(prefix==="xml"&&uri==="http://www.w3.org/XML/1998/namespace"||uri=='http://www.w3.org/2000/xmlns/'){return false;}
1494var i=visibleNamespaces.length;while(i--){var ns=visibleNamespaces[i];if(ns.prefix==prefix){return ns.namespace!=uri;}}
1495return true;}
1496function serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){if(nodeFilter){node=nodeFilter(node);if(node){if(typeof node=='string'){buf.push(node);return;}}else{return;}}
1497switch(node.nodeType){case ELEMENT_NODE:if(!visibleNamespaces)visibleNamespaces=[];var startVisibleNamespaces=visibleNamespaces.length;var attrs=node.attributes;var len=attrs.length;var child=node.firstChild;var nodeName=node.tagName;isHTML=htmlns===node.namespaceURI||isHTML;buf.push('<',nodeName);for(var i=0;i<len;i++){var attr=attrs.item(i);if(attr.prefix=='xmlns'){visibleNamespaces.push({prefix:attr.localName,namespace:attr.value});}else if(attr.nodeName=='xmlns'){visibleNamespaces.push({prefix:'',namespace:attr.value});}}
1498for(var i=0;i<len;i++){var attr=attrs.item(i);if(needNamespaceDefine(attr,isHTML,visibleNamespaces)){var prefix=attr.prefix||'';var uri=attr.namespaceURI;var ns=prefix?' xmlns:'+prefix:" xmlns";buf.push(ns,'="',uri,'"');visibleNamespaces.push({prefix:prefix,namespace:uri});}
1499serializeToString(attr,buf,isHTML,nodeFilter,visibleNamespaces);}
1500if(needNamespaceDefine(node,isHTML,visibleNamespaces)){var prefix=node.prefix||'';var uri=node.namespaceURI;var ns=prefix?' xmlns:'+prefix:" xmlns";buf.push(ns,'="',uri,'"');visibleNamespaces.push({prefix:prefix,namespace:uri});}
1501if(child||isHTML&&!/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)){buf.push('>');if(isHTML&&/^script$/i.test(nodeName)){while(child){if(child.data){buf.push(child.data);}else{serializeToString(child,buf,isHTML,nodeFilter,visibleNamespaces);}
1502child=child.nextSibling;}}else{while(child){serializeToString(child,buf,isHTML,nodeFilter,visibleNamespaces);child=child.nextSibling;}}
1503buf.push('</',nodeName,'>');}else{buf.push('/>');}
1504return;case DOCUMENT_NODE:case DOCUMENT_FRAGMENT_NODE:var child=node.firstChild;while(child){serializeToString(child,buf,isHTML,nodeFilter,visibleNamespaces);child=child.nextSibling;}
1505return;case ATTRIBUTE_NODE:return buf.push(' ',node.name,'="',node.value.replace(/[<&"]/g,_xmlEncoder),'"');case TEXT_NODE:return buf.push(node.data.replace(/[<&]/g,_xmlEncoder));case CDATA_SECTION_NODE:return buf.push('<![CDATA[',node.data,']]>');case COMMENT_NODE:return buf.push("<!--",node.data,"-->");case DOCUMENT_TYPE_NODE:var pubid=node.publicId;var sysid=node.systemId;buf.push('<!DOCTYPE ',node.name);if(pubid){buf.push(' PUBLIC "',pubid);if(sysid&&sysid!='.'){buf.push('" "',sysid);}
1506buf.push('">');}else if(sysid&&sysid!='.'){buf.push(' SYSTEM "',sysid,'">');}else{var sub=node.internalSubset;if(sub){buf.push(" [",sub,"]");}
1507buf.push(">");}
1508return;case PROCESSING_INSTRUCTION_NODE:return buf.push("<?",node.target," ",node.data,"?>");case ENTITY_REFERENCE_NODE:return buf.push('&',node.nodeName,';');default:buf.push('??',node.nodeName);}}
1509function _importNode(doc,node,deep){var node2;switch(node.nodeType){case ELEMENT_NODE:node2=node.cloneNode(false);node2.ownerDocument=doc;case DOCUMENT_FRAGMENT_NODE:break;case ATTRIBUTE_NODE:deep=true;break;}
1510if(!node2){node2=node.cloneNode(false);}
1511node2.ownerDocument=doc;node2.parentNode=null;if(deep){var child=node.firstChild;while(child){node2.appendChild(_importNode(doc,child,deep));child=child.nextSibling;}}
1512return node2;}
1513function _cloneNode(doc,node,deep){var node2=new node.constructor();for(var n in node){var v=node[n];if(typeof v!='object'){if(v!=node2[n]){node2[n]=v;}}}
1514if(node.childNodes){node2.childNodes=new NodeList();}
1515node2.ownerDocument=doc;switch(node2.nodeType){case ELEMENT_NODE:var attrs=node.attributes;var attrs2=node2.attributes=new NamedNodeMap();var len=attrs.length;attrs2._ownerElement=node2;for(var i=0;i<len;i++){node2.setAttributeNode(_cloneNode(doc,attrs.item(i),true));}
1516break;case ATTRIBUTE_NODE:deep=true;}
1517if(deep){var child=node.firstChild;while(child){node2.appendChild(_cloneNode(doc,child,deep));child=child.nextSibling;}}
1518return node2;}
1519function __set__(object,key,value){object[key]=value;}
1520try{if(Object.defineProperty){var getTextContent=function getTextContent(node){switch(node.nodeType){case ELEMENT_NODE:case DOCUMENT_FRAGMENT_NODE:var buf=[];node=node.firstChild;while(node){if(node.nodeType!==7&&node.nodeType!==8){buf.push(getTextContent(node));}
1521node=node.nextSibling;}
1522return buf.join('');default:return node.nodeValue;}};Object.defineProperty(LiveNodeList.prototype,'length',{get:function get(){_updateLiveList(this);return this.$$length;}});Object.defineProperty(Node.prototype,'textContent',{get:function get(){return getTextContent(this);},set:function set(data){switch(this.nodeType){case ELEMENT_NODE:case DOCUMENT_FRAGMENT_NODE:while(this.firstChild){this.removeChild(this.firstChild);}
1523if(data||String(data)){this.appendChild(this.ownerDocument.createTextNode(data));}
1524break;default:this.data=data;this.value=data;this.nodeValue=data;}}});__set__=function __set__(object,key,value){object['$$'+key]=value;};}}catch(e){}
1525var DOMImplementation_1=DOMImplementation;var XMLSerializer_1=XMLSerializer;var dom={DOMImplementation:DOMImplementation_1,XMLSerializer:XMLSerializer_1};var domParser=createCommonjsModule(function(module,exports){function DOMParser(options){this.options=options||{locator:{}};}
1526DOMParser.prototype.parseFromString=function(source,mimeType){var options=this.options;var sax=new XMLReader();var domBuilder=options.domBuilder||new DOMHandler();var errorHandler=options.errorHandler;var locator=options.locator;var defaultNSMap=options.xmlns||{};var entityMap={'lt':'<','gt':'>','amp':'&','quot':'"','apos':"'"};if(locator){domBuilder.setDocumentLocator(locator);}
1527sax.errorHandler=buildErrorHandler(errorHandler,domBuilder,locator);sax.domBuilder=options.domBuilder||domBuilder;if(/\/x?html?$/.test(mimeType)){entityMap.nbsp='\xa0';entityMap.copy='\xa9';defaultNSMap['']='http://www.w3.org/1999/xhtml';}
1528defaultNSMap.xml=defaultNSMap.xml||'http://www.w3.org/XML/1998/namespace';if(source){sax.parse(source,defaultNSMap,entityMap);}else{sax.errorHandler.error("invalid doc source");}
1529return domBuilder.doc;};function buildErrorHandler(errorImpl,domBuilder,locator){if(!errorImpl){if(domBuilder instanceof DOMHandler){return domBuilder;}
1530errorImpl=domBuilder;}
1531var errorHandler={};var isCallback=errorImpl instanceof Function;locator=locator||{};function build(key){var fn=errorImpl[key];if(!fn&&isCallback){fn=errorImpl.length==2?function(msg){errorImpl(key,msg);}:errorImpl;}
1532errorHandler[key]=fn&&function(msg){fn('[xmldom '+key+']\t'+msg+_locator(locator));}||function(){};}
1533build('warning');build('error');build('fatalError');return errorHandler;}
1534function DOMHandler(){this.cdata=false;}
1535function position(locator,node){node.lineNumber=locator.lineNumber;node.columnNumber=locator.columnNumber;}
1536DOMHandler.prototype={startDocument:function startDocument(){this.doc=new DOMImplementation().createDocument(null,null,null);if(this.locator){this.doc.documentURI=this.locator.systemId;}},startElement:function startElement(namespaceURI,localName,qName,attrs){var doc=this.doc;var el=doc.createElementNS(namespaceURI,qName||localName);var len=attrs.length;appendElement(this,el);this.currentElement=el;this.locator&&position(this.locator,el);for(var i=0;i<len;i++){var namespaceURI=attrs.getURI(i);var value=attrs.getValue(i);var qName=attrs.getQName(i);var attr=doc.createAttributeNS(namespaceURI,qName);this.locator&&position(attrs.getLocator(i),attr);attr.value=attr.nodeValue=value;el.setAttributeNode(attr);}},endElement:function endElement(namespaceURI,localName,qName){var current=this.currentElement;var tagName=current.tagName;this.currentElement=current.parentNode;},startPrefixMapping:function startPrefixMapping(prefix,uri){},endPrefixMapping:function endPrefixMapping(prefix){},processingInstruction:function processingInstruction(target,data){var ins=this.doc.createProcessingInstruction(target,data);this.locator&&position(this.locator,ins);appendElement(this,ins);},ignorableWhitespace:function ignorableWhitespace(ch,start,length){},characters:function characters(chars,start,length){chars=_toString.apply(this,arguments);if(chars){if(this.cdata){var charNode=this.doc.createCDATASection(chars);}else{var charNode=this.doc.createTextNode(chars);}
1537if(this.currentElement){this.currentElement.appendChild(charNode);}else if(/^\s*$/.test(chars)){this.doc.appendChild(charNode);}
1538this.locator&&position(this.locator,charNode);}},skippedEntity:function skippedEntity(name){},endDocument:function endDocument(){this.doc.normalize();},setDocumentLocator:function setDocumentLocator(locator){if(this.locator=locator){locator.lineNumber=0;}},comment:function comment(chars,start,length){chars=_toString.apply(this,arguments);var comm=this.doc.createComment(chars);this.locator&&position(this.locator,comm);appendElement(this,comm);},startCDATA:function startCDATA(){this.cdata=true;},endCDATA:function endCDATA(){this.cdata=false;},startDTD:function startDTD(name,publicId,systemId){var impl=this.doc.implementation;if(impl&&impl.createDocumentType){var dt=impl.createDocumentType(name,publicId,systemId);this.locator&&position(this.locator,dt);appendElement(this,dt);}},warning:function warning(error){console.warn('[xmldom warning]\t'+error,_locator(this.locator));},error:function error(_error){console.error('[xmldom error]\t'+_error,_locator(this.locator));},fatalError:function fatalError(error){console.error('[xmldom fatalError]\t'+error,_locator(this.locator));throw error;}};function _locator(l){if(l){return '\n@'+(l.systemId||'')+'#[line:'+l.lineNumber+',col:'+l.columnNumber+']';}}
1539function _toString(chars,start,length){if(typeof chars=='string'){return chars.substr(start,length);}else{if(chars.length>=start+length||start){return new java.lang.String(chars,start,length)+'';}
1540return chars;}}
1541"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(key){DOMHandler.prototype[key]=function(){return null;};});function appendElement(hander,node){if(!hander.currentElement){hander.doc.appendChild(node);}else{hander.currentElement.appendChild(node);}}
1542var XMLReader=sax.XMLReader;var DOMImplementation=exports.DOMImplementation=dom.DOMImplementation;
1542exports.XMLSerializer=dom.XMLSerializer;exports.DOMParser=DOMParser;});var domParser_1=domParser.DOMImplementation;var domParser_2=domParser.XMLSerializer;var domParser_3=domParser.DOMParser;/*!@name mpd-parser @version 0.10.0 @license Apache-2.0*/var isObject$1=function isObject(obj){return!!obj&&typeof obj==='object';};var merge=function merge(){for(var _len=arguments.length,objects=new Array(_len),_key=0;_key<_len;_key++){objects[_key]=arguments[_key];}
1543return objects.reduce(function(result,source){Object.keys(source).forEach(function(key){if(Array.isArray(result[key])&&Array.isArray(source[key])){result[key]=result[key].concat(source[key]);}else if(isObject$1(result[key])&&isObject$1(source[key])){result[key]=merge(result[key],source[key]);}else{result[key]=source[key];}});return result;},{});};var values=function values(o){return Object.keys(o).map(function(k){return o[k];});};var range=function range(start,end){var result=[];for(var i=start;i<end;i++){result.push(i);}
1544return result;};var flatten=function flatten(lists){return lists.reduce(function(x,y){return x.concat(y);},[]);};var from=function from(list){if(!list.length){return[];}
1545var result=[];for(var i=0;i<list.length;i++){result.push(list[i]);}
1546return result;};var findIndexes=function findIndexes(l,key){return l.reduce(function(a,e,i){if(e[key]){a.push(i);}
1547return a;},[]);};var errors={INVALID_NUMBER_OF_PERIOD:'INVALID_NUMBER_OF_PERIOD',DASH_EMPTY_MANIFEST:'DASH_EMPTY_MANIFEST',DASH_INVALID_XML:'DASH_INVALID_XML',NO_BASE_URL:'NO_BASE_URL',MISSING_SEGMENT_INFORMATION:'MISSING_SEGMENT_INFORMATION',SEGMENT_TIME_UNSPECIFIED:'SEGMENT_TIME_UNSPECIFIED',UNSUPPORTED_UTC_TIMING_SCHEME:'UNSUPPORTED_UTC_TIMING_SCHEME'};var urlTypeToSegment=function urlTypeToSegment(_ref){var _ref$baseUrl=_ref.baseUrl,baseUrl=_ref$baseUrl===void 0?'':_ref$baseUrl,_ref$source=_ref.source,source=_ref$source===void 0?'':_ref$source,_ref$range=_ref.range,range=_ref$range===void 0?'':_ref$range,_ref$indexRange=_ref.indexRange,indexRange=_ref$indexRange===void 0?'':_ref$indexRange;var segment={uri:source,resolvedUri:resolveUrl_1(baseUrl||'',source)};if(range||indexRange){var rangeStr=range?range:indexRange;var ranges=rangeStr.split('-');var startRange=parseInt(ranges[0],10);var endRange=parseInt(ranges[1],10);segment.byterange={length:endRange-startRange+1,offset:startRange};}
1548return segment;};var byteRangeToString=function byteRangeToString(byterange){var endRange=byterange.offset+byterange.length-1;return byterange.offset+"-"+endRange;};var segmentRange={"static":function _static(attributes){var duration=attributes.duration,_attributes$timescale=attributes.timescale,timescale=_attributes$timescale===void 0?1:_attributes$timescale,sourceDuration=attributes.sourceDuration;return{start:0,end:Math.ceil(sourceDuration/(duration/timescale))};},dynamic:function dynamic(attributes){var NOW=attributes.NOW,clientOffset=attributes.clientOffset,availabilityStartTime=attributes.availabilityStartTime,_attributes$timescale2=attributes.timescale,timescale=_attributes$timescale2===void 0?1:_attributes$timescale2,duration=attributes.duration,_attributes$start=attributes.start,start=_attributes$start===void 0?0:_attributes$start,_attributes$minimumUp=attributes.minimumUpdatePeriod,minimumUpdatePeriod=_attributes$minimumUp===void 0?0:_attributes$minimumUp,_attributes$timeShift=attributes.timeShiftBufferDepth,timeShiftBufferDepth=_attributes$timeShift===void 0?Infinity:_attributes$timeShift;var now=(NOW+clientOffset)/1000;var periodStartWC=availabilityStartTime+start;var periodEndWC=now+minimumUpdatePeriod;var periodDuration=periodEndWC-periodStartWC;var segmentCount=Math.ceil(periodDuration*timescale/duration);var availableStart=Math.floor((now-periodStartWC-timeShiftBufferDepth)*timescale/duration);var availableEnd=Math.floor((now-periodStartWC)*timescale/duration);return{start:Math.max(0,availableStart),end:Math.min(segmentCount,availableEnd)};}};var toSegments=function toSegments(attributes){return function(number,index){var duration=attributes.duration,_attributes$timescale3=attributes.timescale,timescale=_attributes$timescale3===void 0?1:_attributes$timescale3,periodIndex=attributes.periodIndex,_attributes$startNumb=attributes.startNumber,startNumber=_attributes$startNumb===void 0?1:_attributes$startNumb;return{number:startNumber+number,duration:duration/timescale,timeline:periodIndex,time:index*duration};};};var parseByDuration=function parseByDuration(attributes){var _attributes$type=attributes.type,type=_attributes$type===void 0?'static':_attributes$type,duration=attributes.duration,_attributes$timescale4=attributes.timescale,timescale=_attributes$timescale4===void 0?1:_attributes$timescale4,sourceDuration=attributes.sourceDuration;var _segmentRange$type=segmentRange[type](attributes),start=_segmentRange$type.start,end=_segmentRange$type.end;var segments=range(start,end).map(toSegments(attributes));if(type==='static'){var index=segments.length-1;segments[index].duration=sourceDuration-duration/timescale*index;}
1549return segments;};var segmentsFromBase=function segmentsFromBase(attributes){var baseUrl=attributes.baseUrl,_attributes$initializ=attributes.initialization,initialization=_attributes$initializ===void 0?{}:_attributes$initializ,sourceDuration=attributes.sourceDuration,_attributes$timescale=attributes.timescale,timescale=_attributes$timescale===void 0?1:_attributes$timescale,_attributes$indexRang=attributes.indexRange,indexRange=_attributes$indexRang===void 0?'':_attributes$indexRang,duration=attributes.duration;if(!baseUrl){throw new Error(errors.NO_BASE_URL);}
1550var initSegment=urlTypeToSegment({baseUrl:baseUrl,source:initialization.sourceURL,range:initialization.range});var segment=urlTypeToSegment({baseUrl:baseUrl,source:baseUrl,indexRange:indexRange});segment.map=initSegment;if(duration){var segmentTimeInfo=parseByDuration(attributes);if(segmentTimeInfo.length){segment.duration=segmentTimeInfo[0].duration;segment.timeline=segmentTimeInfo[0].timeline;}}else if(sourceDuration){segment.duration=sourceDuration/timescale;segment.timeline=0;}
1551segment.number=0;return[segment];};var addSegmentsToPlaylist=function addSegmentsToPlaylist(playlist,sidx,baseUrl){var initSegment=playlist.sidx.map?playlist.sidx.map:null;var sourceDuration=playlist.sidx.duration;var timeline=playlist.timeline||0;var sidxByteRange=playlist.sidx.byterange;var sidxEnd=sidxByteRange.offset+sidxByteRange.length;var timescale=sidx.timescale;var mediaReferences=sidx.references.filter(function(r){return r.referenceType!==1;});var segments=[];
1551var startIndex=sidxEnd+sidx.firstOffset;for(var i=0;i<mediaReferences.length;i++){var reference=sidx.references[i];var size=reference.referencedSize;var duration=reference.subsegmentDuration;var endIndex=startIndex+size-1;var indexRange=startIndex+"-"+endIndex;var attributes={baseUrl:baseUrl,timescale:timescale,timeline:timeline,periodIndex:timeline,duration:duration,sourceDuration:sourceDuration,indexRange:indexRange};var segment=segmentsFromBase(attributes)[0];if(initSegment){segment.map=initSegment;}
1552segments.push(segment);startIndex+=size;}
1553playlist.segments=segments;return playlist;};var mergeDiscontiguousPlaylists=function mergeDiscontiguousPlaylists(playlists){var mergedPlaylists=values(playlists.reduce(function(acc,playlist){var name=playlist.attributes.id+(playlist.attributes.lang||'');if(acc[name]){var _acc$name$segments;if(playlist.segments[0]){playlist.segments[0].discontinuity=true;}
1554(_acc$name$segments=acc[name].segments).push.apply(_acc$name$segments,playlist.segments);if(playlist.attributes.contentProtection){acc[name].attributes.contentProtection=playlist.attributes.contentProtection;}}else{acc[name]=playlist;}
1555return acc;},{}));return mergedPlaylists.map(function(playlist){playlist.discontinuityStarts=findIndexes(playlist.segments,'discontinuity');return playlist;});};var addSegmentInfoFromSidx=function addSegmentInfoFromSidx(playlists,sidxMapping){if(sidxMapping===void 0){sidxMapping={};}
1556if(!Object.keys(sidxMapping).length){return playlists;}
1557for(var i in playlists){var playlist=playlists[i];if(!playlist.sidx){continue;}
1558var sidxKey=playlist.sidx.uri+'-'+byteRangeToString(playlist.sidx.byterange);var sidxMatch=sidxMapping[sidxKey]&&sidxMapping[sidxKey].sidx;if(playlist.sidx&&sidxMatch){addSegmentsToPlaylist(playlist,sidxMatch,playlist.sidx.resolvedUri);}}
1559return playlists;};var formatAudioPlaylist=function formatAudioPlaylist(_ref){var _attributes;var attributes=_ref.attributes,segments=_ref.segments,sidx=_ref.sidx;var playlist={attributes:(_attributes={NAME:attributes.id,BANDWIDTH:attributes.bandwidth,CODECS:attributes.codecs},_attributes['PROGRAM-ID']=1,_attributes),uri:'',endList:(attributes.type||'static')==='static',timeline:attributes.periodIndex,resolvedUri:'',targetDuration:attributes.duration,segments:segments,mediaSequence:segments.length?segments[0].number:1};if(attributes.contentProtection){playlist.contentProtection=attributes.contentProtection;}
1560if(sidx){playlist.sidx=sidx;}
1561return playlist;};var formatVttPlaylist=function formatVttPlaylist(_ref2){var _attributes2;var attributes=_ref2.attributes,segments=_ref2.segments;if(typeof segments==='undefined'){segments=[{uri:attributes.baseUrl,timeline:attributes.periodIndex,resolvedUri:attributes.baseUrl||'',duration:attributes.sourceDuration,number:0}];attributes.duration=attributes.sourceDuration;}
1562return{attributes:(_attributes2={NAME:attributes.id,BANDWIDTH:attributes.bandwidth},_attributes2['PROGRAM-ID']=1,_attributes2),uri:'',endList:(attributes.type||'static')==='static',timeline:attributes.periodIndex,resolvedUri:attributes.baseUrl||'',targetDuration:attributes.duration,segments:segments,mediaSequence:segments.length?segments[0].number:1};};var organizeAudioPlaylists=function organizeAudioPlaylists(playlists,sidxMapping){if(sidxMapping===void 0){sidxMapping={};}
1563var mainPlaylist;var formattedPlaylists=playlists.reduce(function(a,playlist){var role=playlist.attributes.role&&playlist.attributes.role.value||'';var language=playlist.attributes.lang||'';var label='main';if(language){var roleLabel=role?" ("+role+")":'';label=""+playlist.attributes.lang+roleLabel;}
1564if(a[label]&&a[label].playlists[0].attributes.BANDWIDTH>playlist.attributes.bandwidth){return a;}
1565a[label]={language:language,autoselect:true,"default":role==='main',playlists:addSegmentInfoFromSidx([formatAudioPlaylist(playlist)],sidxMapping),uri:''};if(typeof mainPlaylist==='undefined'&&role==='main'){mainPlaylist=playlist;mainPlaylist["default"]=true;}
1566return a;},{});if(!mainPlaylist){var firstLabel=Object.keys(formattedPlaylists)[0];formattedPlaylists[firstLabel]["default"]=true;}
1567return formattedPlaylists;};var organizeVttPlaylists=function organizeVttPlaylists(playlists,sidxMapping){if(sidxMapping===void 0){sidxMapping={};}
1568return playlists.reduce(function(a,playlist){var label=playlist.attributes.lang||'text';if(a[label]){return a;}
1569a[label]={language:label,"default":false,autoselect:false,playlists:addSegmentInfoFromSidx([formatVttPlaylist(playlist)],sidxMapping),uri:''};return a;},{});};var formatVideoPlaylist=function formatVideoPlaylist(_ref3){var _attributes3;var attributes=_ref3.attributes,segments=_ref3.segments,sidx=_ref3.sidx;var playlist={attributes:(_attributes3={NAME:attributes.id,AUDIO:'audio',SUBTITLES:'subs',RESOLUTION:{width:attributes.width,height:attributes.height},CODECS:attributes.codecs,BANDWIDTH:attributes.bandwidth},_attributes3['PROGRAM-ID']=1,_attributes3),uri:'',endList:(attributes.type||'static')==='static',timeline:attributes.periodIndex,resolvedUri:'',targetDuration:attributes.duration,segments:segments,mediaSequence:segments.length?segments[0].number:1};if(attributes.contentProtection){playlist.contentProtection=attributes.contentProtection;}
1570if(sidx){playlist.sidx=sidx;}
1571return playlist;};var toM3u8=function toM3u8(dashPlaylists,sidxMapping){var _mediaGroups;if(sidxMapping===void 0){sidxMapping={};}
1572if(!dashPlaylists.length){return{};}
1573var _dashPlaylists$0$attr=dashPlaylists[0].attributes,duration=_dashPlaylists$0$attr.sourceDuration,_dashPlaylists$0$attr2=_dashPlaylists$0$attr.type,type=_dashPlaylists$0$attr2===void 0?'static':_dashPlaylists$0$attr2,suggestedPresentationDelay=_dashPlaylists$0$attr.suggestedPresentationDelay,_dashPlaylists$0$attr3=_dashPlaylists$0$attr.minimumUpdatePeriod,minimumUpdatePeriod=_dashPlaylists$0$attr3===void 0?0:_dashPlaylists$0$attr3;var videoOnly=function videoOnly(_ref4){var attributes=_ref4.attributes;return attributes.mimeType==='video/mp4'||attributes.contentType==='video';};var audioOnly=function audioOnly(_ref5){var attributes=_ref5.attributes;return attributes.mimeType==='audio/mp4'||attributes.contentType==='audio';};var vttOnly=function vttOnly(_ref6){var attributes=_ref6.attributes;return attributes.mimeType==='text/vtt'||attributes.contentType==='text';};var videoPlaylists=mergeDiscontiguousPlaylists(dashPlaylists.filter(videoOnly)).map(formatVideoPlaylist);var audioPlaylists=mergeDiscontiguousPlaylists(dashPlaylists.filter(audioOnly));var vttPlaylists=dashPlaylists.filter(vttOnly);var master={allowCache:true,discontinuityStarts:[],segments:[],endList:true,mediaGroups:(_mediaGroups={AUDIO:{},VIDEO:{}},_mediaGroups['CLOSED-CAPTIONS']={},_mediaGroups.SUBTITLES={},_mediaGroups),uri:'',duration:duration,playlists:addSegmentInfoFromSidx(videoPlaylists,sidxMapping),minimumUpdatePeriod:minimumUpdatePeriod*1000};if(type==='dynamic'){master.suggestedPresentationDelay=suggestedPresentationDelay;}
1574if(audioPlaylists.length){master.mediaGroups.AUDIO.audio=organizeAudioPlaylists(audioPlaylists,sidxMapping);}
1575if(vttPlaylists.length){master.mediaGroups.SUBTITLES.subs=organizeVttPlaylists(vttPlaylists,sidxMapping);}
1576return master;};var getLiveRValue=function getLiveRValue(attributes,time,duration){var NOW=attributes.NOW,clientOffset=attributes.clientOffset,availabilityStartTime=attributes.availabilityStartTime,_attributes$timescale=attributes.timescale,timescale=_attributes$timescale===void 0?1:_attributes$timescale,_attributes$start=attributes.start,start=_attributes$start===void 0?0:_attributes$start,_attributes$minimumUp=attributes.minimumUpdatePeriod,minimumUpdatePeriod=_attributes$minimumUp===void 0?0:_attributes$minimumUp;var now=(NOW+clientOffset)/1000;var periodStartWC=availabilityStartTime+start;var periodEndWC=now+minimumUpdatePeriod;var periodDuration=periodEndWC-periodStartWC;return Math.ceil((periodDuration*timescale-time)/duration);};var parseByTimeline=function parseByTimeline(attributes,segmentTimeline){var _attributes$type=attributes.type,type=_attributes$type===void 0?'static':_attributes$type,_attributes$minimumUp2=attributes.minimumUpdatePeriod,minimumUpdatePeriod=_attributes$minimumUp2===void 0?0:_attributes$minimumUp2,_attributes$media=attributes.media,media=_attributes$media===void 0?'':_attributes$media,sourceDuration=attributes.sourceDuration,_attributes$timescale2=attributes.timescale,timescale=_attributes$timescale2===void 0?1:_attributes$timescale2,_attributes$startNumb=attributes.startNumber,startNumber=_attributes$startNumb===void 0?1:_attributes$startNumb,timeline=attributes.periodIndex;var segments=[];var time=-1;for(var sIndex=0;sIndex<segmentTimeline.length;sIndex++){var S=segmentTimeline[sIndex];var duration=S.d;var repeat=S.r||0;var segmentTime=S.t||0;if(time<0){time=segmentTime;}
1577if(segmentTime&&segmentTime>time){time=segmentTime;}
1578var count=void 0;if(repeat<0){var nextS=sIndex+1;if(nextS===segmentTimeline.length){if(type==='dynamic'&&minimumUpdatePeriod>0&&media.indexOf('$Number$')>0){count=getLiveRValue(attributes,time,duration);}else{count=(sourceDuration*timescale-time)/duration;}}else{count=(segmentTimeline[nextS].t-time)/duration;}}else{count=repeat+1;}
1579var end=startNumber+segments.length+count;var number=startNumber+segments.length;while(number<end){segments.push({number:number,duration:duration/timescale,time:time,timeline:timeline});time+=duration;number++;}}
1580return segments;};var identifierPattern=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g;var identifierReplacement=function identifierReplacement(values){return function(match,identifier,format,width){if(match==='$$'){return '$';}
1581if(typeof values[identifier]==='undefined'){return match;}
1582var value=''+values[identifier];if(identifier==='RepresentationID'){return value;}
1583if(!format){width=1;}else{width=parseInt(width,10);}
1584if(value.length>=width){return value;}
vendor: 7,560 bytes, lines 1585-1599
1585return ""+new Array(width-value.length+1).join('0')+value;};};var constructTemplateUrl=function constructTemplateUrl(url,values){return url.replace(identifierPattern,identifierReplacement(values));};var parseTemplateInfo=function parseTemplateInfo(attributes,segmentTimeline){if(!attributes.duration&&!segmentTimeline){return[{number:attributes.startNumber||1,duration:attributes.sourceDuration,time:0,timeline:attributes.periodIndex}];}
1586if(attributes.duration){return parseByDuration(attributes);}
1587return parseByTimeline(attributes,segmentTimeline);};var segmentsFromTemplate=function segmentsFromTemplate(attributes,segmentTimeline){var templateValues={RepresentationID:attributes.id,Bandwidth:attributes.bandwidth||0};var _attributes$initializ=attributes.initialization,initialization=_attributes$initializ===void 0?{sourceURL:'',range:''}:_attributes$initializ;var mapSegment=urlTypeToSegment({baseUrl:attributes.baseUrl,source:constructTemplateUrl(initialization.sourceURL,templateValues),range:initialization.range});var segments=parseTemplateInfo(attributes,segmentTimeline);return segments.map(function(segment){templateValues.Number=segment.number;templateValues.Time=segment.time;var uri=constructTemplateUrl(attributes.media||'',templateValues);return{uri:uri,timeline:segment.timeline,duration:segment.duration,resolvedUri:resolveUrl_1(attributes.baseUrl||'',uri),map:mapSegment,number:segment.number};});};var SegmentURLToSegmentObject=function SegmentURLToSegmentObject(attributes,segmentUrl){var baseUrl=attributes.baseUrl,_attributes$initializ=attributes.initialization,initialization=_attributes$initializ===void 0?{}:_attributes$initializ;var initSegment=urlTypeToSegment({baseUrl:baseUrl,source:initialization.sourceURL,range:initialization.range});var segment=urlTypeToSegment({baseUrl:baseUrl,source:segmentUrl.media,range:segmentUrl.mediaRange});segment.map=initSegment;return segment;};var segmentsFromList=function segmentsFromList(attributes,segmentTimeline){var duration=attributes.duration,_attributes$segmentUr=attributes.segmentUrls,segmentUrls=_attributes$segmentUr===void 0?[]:_attributes$segmentUr;if(!duration&&!segmentTimeline||duration&&segmentTimeline){throw new Error(errors.SEGMENT_TIME_UNSPECIFIED);}
1588var segmentUrlMap=segmentUrls.map(function(segmentUrlObject){return SegmentURLToSegmentObject(attributes,segmentUrlObject);});var segmentTimeInfo;if(duration){segmentTimeInfo=parseByDuration(attributes);}
1589if(segmentTimeline){segmentTimeInfo=parseByTimeline(attributes,segmentTimeline);}
1590var segments=segmentTimeInfo.map(function(segmentTime,index){if(segmentUrlMap[index]){var segment=segmentUrlMap[index];segment.timeline=segmentTime.timeline;segment.duration=segmentTime.duration;segment.number=segmentTime.number;return segment;}}).filter(function(segment){return segment;});return segments;};var generateSegments=function generateSegments(_ref){var attributes=_ref.attributes,segmentInfo=_ref.segmentInfo;var segmentAttributes;var segmentsFn;if(segmentInfo.template){segmentsFn=segmentsFromTemplate;segmentAttributes=merge(attributes,segmentInfo.template);}else if(segmentInfo.base){segmentsFn=segmentsFromBase;segmentAttributes=merge(attributes,segmentInfo.base);}else if(segmentInfo.list){segmentsFn=segmentsFromList;segmentAttributes=merge(attributes,segmentInfo.list);}
1591var segmentsInfo={attributes:attributes};if(!segmentsFn){return segmentsInfo;}
1592var segments=segmentsFn(segmentAttributes,segmentInfo.timeline);if(segmentAttributes.duration){var _segmentAttributes=segmentAttributes,duration=_segmentAttributes.duration,_segmentAttributes$ti=_segmentAttributes.timescale,timescale=_segmentAttributes$ti===void 0?1:_segmentAttributes$ti;segmentAttributes.duration=duration/timescale;}else if(segments.length){segmentAttributes.duration=segments.reduce(function(max,segment){return Math.max(max,Math.ceil(segment.duration));},0);}else{segmentAttributes.duration=0;}
1593segmentsInfo.attributes=segmentAttributes;segmentsInfo.segments=segments;if(segmentInfo.base&&segmentAttributes.indexRange){segmentsInfo.sidx=segments[0];segmentsInfo.segments=[];}
1594return segmentsInfo;};var toPlaylists=function toPlaylists(representations){return representations.map(generateSegments);};var findChildren=function findChildren(element,name){return from(element.childNodes).filter(function(_ref){var tagName=_ref.tagName;return tagName===name;});};var getContent=function getContent(element){return element.textContent.trim();};var parseDuration=function parseDuration(str){var SECONDS_IN_YEAR=365*24*60*60;var SECONDS_IN_MONTH=30*24*60*60;var SECONDS_IN_DAY=24*60*60;var SECONDS_IN_HOUR=60*60;var SECONDS_IN_MIN=60;var durationRegex=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/;var match=durationRegex.exec(str);if(!match){return 0;}
1595var _match$slice=match.slice(1),year=_match$slice[0],month=_match$slice[1],day=_match$slice[2],hour=_match$slice[3],minute=_match$slice[4],second=_match$slice[5];return parseFloat(year||0)*SECONDS_IN_YEAR+parseFloat(month||0)*SECONDS_IN_MONTH+parseFloat(day||0)*SECONDS_IN_DAY+parseFloat(hour||0)*SECONDS_IN_HOUR+parseFloat(minute||0)*SECONDS_IN_MIN+parseFloat(second||0);};var parseDate=function parseDate(str){var dateRegex=/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/;if(dateRegex.test(str)){str+='Z';}
1596return Date.parse(str);};var parsers={mediaPresentationDuration:function mediaPresentationDuration(value){return parseDuration(value);},availabilityStartTime:function availabilityStartTime(value){return parseDate(value)/1000;},minimumUpdatePeriod:function minimumUpdatePeriod(value){return parseDuration(value);},suggestedPresentationDelay:function suggestedPresentationDelay(value){return parseDuration(value);},type:function type(value){return value;},timeShiftBufferDepth:function timeShiftBufferDepth(value){return parseDuration(value);},start:function start(value){return parseDuration(value);},width:function width(value){return parseInt(value,10);},height:function height(value){return parseInt(value,10);},bandwidth:function bandwidth(value){return parseInt(value,10);},startNumber:function startNumber(value){return parseInt(value,10);},timescale:function timescale(value){return parseInt(value,10);},duration:function duration(value){var parsedValue=parseInt(value,10);if(isNaN(parsedValue)){return parseDuration(value);}
1597return parsedValue;},d:function d(value){return parseInt(value,10);},t:function t(value){return parseInt(value,10);},r:function r(value){return parseInt(value,10);},DEFAULT:function DEFAULT(value){return value;}};var parseAttributes$1=function parseAttributes(el){if(!(el&&el.attributes)){return{};}
1598return from(el.attributes).reduce(function(a,e){var parseFn=parsers[e.name]||parsers.DEFAULT;a[e.name]=parseFn(e.value);return a;},{});};var keySystemsMap={'urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b':'org.w3.clearkey','urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed':'com.widevine.alpha','urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95':'com.microsoft.playready','urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb':'com.adobe.primetime'};var buildBaseUrls=function buildBaseUrls(referenceUrls,baseUrlElements){if(!baseUrlElements.length){return referenceUrls;}
1599return flatten(referenceUrls.map(function(reference){return baseUrlElements.map(function(baseUrlElement){return resolveUrl_1(reference,getContent(baseUrlElement));});}));};var getSegmentInformation=function getSegmentInformation(adaptationSet){var segmentTemplate=findChildren(adaptationSet,'SegmentTemplate')[0];var segmentList=findChildren(adaptationSet,'SegmentList')[0];
vendor: 23,208 bytes, lines 1599-1654
1599var segmentUrls=segmentList&&findChildren(segmentList,'SegmentURL').map(function(s){return merge({tag:'SegmentURL'},parseAttributes$1(s));});var segmentBase=findChildren(adaptationSet,'SegmentBase')[0];var segmentTimelineParentNode=segmentList||segmentTemplate;var segmentTimeline=segmentTimelineParentNode&&findChildren(segmentTimelineParentNode,'SegmentTimeline')[0];var segmentInitializationParentNode=segmentList||segmentBase||segmentTemplate;var segmentInitialization=segmentInitializationParentNode&&findChildren(segmentInitializationParentNode,'Initialization')[0];var template=segmentTemplate&&parseAttributes$1(segmentTemplate);if(template&&segmentInitialization){template.initialization=segmentInitialization&&parseAttributes$1(segmentInitialization);}else if(template&&template.initialization){template.initialization={sourceURL:template.initialization};}
1600var segmentInfo={template:template,timeline:segmentTimeline&&findChildren(segmentTimeline,'S').map(function(s){return parseAttributes$1(s);}),list:segmentList&&merge(parseAttributes$1(segmentList),{segmentUrls:segmentUrls,initialization:parseAttributes$1(segmentInitialization)}),base:segmentBase&&merge(parseAttributes$1(segmentBase),{initialization:parseAttributes$1(segmentInitialization)})};Object.keys(segmentInfo).forEach(function(key){if(!segmentInfo[key]){delete segmentInfo[key];}});return segmentInfo;};var inheritBaseUrls=function inheritBaseUrls(adaptationSetAttributes,adaptationSetBaseUrls,adaptationSetSegmentInfo){return function(representation){var repBaseUrlElements=findChildren(representation,'BaseURL');var repBaseUrls=buildBaseUrls(adaptationSetBaseUrls,repBaseUrlElements);var attributes=merge(adaptationSetAttributes,parseAttributes$1(representation));var representationSegmentInfo=getSegmentInformation(representation);return repBaseUrls.map(function(baseUrl){return{segmentInfo:merge(adaptationSetSegmentInfo,representationSegmentInfo),attributes:merge(attributes,{baseUrl:baseUrl})};});};};var generateKeySystemInformation=function generateKeySystemInformation(contentProtectionNodes){return contentProtectionNodes.reduce(function(acc,node){var attributes=parseAttributes$1(node);var keySystem=keySystemsMap[attributes.schemeIdUri];if(keySystem){acc[keySystem]={attributes:attributes};var psshNode=findChildren(node,'cenc:pssh')[0];if(psshNode){var pssh=getContent(psshNode);var psshBuffer=pssh&&decodeB64ToUint8Array_1(pssh);acc[keySystem].pssh=psshBuffer;}}
1601return acc;},{});};var toRepresentations=function toRepresentations(periodAttributes,periodBaseUrls,periodSegmentInfo){return function(adaptationSet){var adaptationSetAttributes=parseAttributes$1(adaptationSet);var adaptationSetBaseUrls=buildBaseUrls(periodBaseUrls,findChildren(adaptationSet,'BaseURL'));var role=findChildren(adaptationSet,'Role')[0];var roleAttributes={role:parseAttributes$1(role)};var attrs=merge(periodAttributes,adaptationSetAttributes,roleAttributes);var contentProtection=generateKeySystemInformation(findChildren(adaptationSet,'ContentProtection'));if(Object.keys(contentProtection).length){attrs=merge(attrs,{contentProtection:contentProtection});}
1602var segmentInfo=getSegmentInformation(adaptationSet);var representations=findChildren(adaptationSet,'Representation');var adaptationSetSegmentInfo=merge(periodSegmentInfo,segmentInfo);return flatten(representations.map(inheritBaseUrls(attrs,adaptationSetBaseUrls,adaptationSetSegmentInfo)));};};var toAdaptationSets=function toAdaptationSets(mpdAttributes,mpdBaseUrls){return function(period,index){var periodBaseUrls=buildBaseUrls(mpdBaseUrls,findChildren(period,'BaseURL'));var periodAtt=parseAttributes$1(period);var parsedPeriodId=parseInt(periodAtt.id,10);var periodIndex=window$3.isNaN(parsedPeriodId)?index:parsedPeriodId;var periodAttributes=merge(mpdAttributes,{periodIndex:periodIndex});var adaptationSets=findChildren(period,'AdaptationSet');var periodSegmentInfo=getSegmentInformation(period);return flatten(adaptationSets.map(toRepresentations(periodAttributes,periodBaseUrls,periodSegmentInfo)));};};var inheritAttributes=function inheritAttributes(mpd,options){if(options===void 0){options={};}
1603var _options=options,_options$manifestUri=_options.manifestUri,manifestUri=_options$manifestUri===void 0?'':_options$manifestUri,_options$NOW=_options.NOW,NOW=_options$NOW===void 0?Date.now():_options$NOW,_options$clientOffset=_options.clientOffset,clientOffset=_options$clientOffset===void 0?0:_options$clientOffset;var periods=findChildren(mpd,'Period');if(!periods.length){throw new Error(errors.INVALID_NUMBER_OF_PERIOD);}
1604var mpdAttributes=parseAttributes$1(mpd);var mpdBaseUrls=buildBaseUrls([manifestUri],findChildren(mpd,'BaseURL'));mpdAttributes.sourceDuration=mpdAttributes.mediaPresentationDuration||0;mpdAttributes.NOW=NOW;mpdAttributes.clientOffset=clientOffset;return flatten(periods.map(toAdaptationSets(mpdAttributes,mpdBaseUrls)));};var stringToMpdXml=function stringToMpdXml(manifestString){if(manifestString===''){throw new Error(errors.DASH_EMPTY_MANIFEST);}
1605var parser=new domParser_3();var xml=parser.parseFromString(manifestString,'application/xml');var mpd=xml&&xml.documentElement.tagName==='MPD'?xml.documentElement:null;if(!mpd||mpd&&mpd.getElementsByTagName('parsererror').length>0){throw new Error(errors.DASH_INVALID_XML);}
1606return mpd;};var parseUTCTimingScheme=function parseUTCTimingScheme(mpd){var UTCTimingNode=findChildren(mpd,'UTCTiming')[0];if(!UTCTimingNode){return null;}
1607var attributes=parseAttributes$1(UTCTimingNode);switch(attributes.schemeIdUri){case 'urn:mpeg:dash:utc:http-head:2014':case 'urn:mpeg:dash:utc:http-head:2012':attributes.method='HEAD';break;case 'urn:mpeg:dash:utc:http-xsdate:2014':case 'urn:mpeg:dash:utc:http-iso:2014':case 'urn:mpeg:dash:utc:http-xsdate:2012':case 'urn:mpeg:dash:utc:http-iso:2012':attributes.method='GET';break;case 'urn:mpeg:dash:utc:direct:2014':case 'urn:mpeg:dash:utc:direct:2012':attributes.method='DIRECT';attributes.value=Date.parse(attributes.value);break;case 'urn:mpeg:dash:utc:http-ntp:2014':case 'urn:mpeg:dash:utc:ntp:2014':case 'urn:mpeg:dash:utc:sntp:2014':default:throw new Error(errors.UNSUPPORTED_UTC_TIMING_SCHEME);}
1608return attributes;};var parse=function parse(manifestString,options){if(options===void 0){options={};}
1609return toM3u8(toPlaylists(inheritAttributes(stringToMpdXml(manifestString),options)),options.sidxMapping);};var parseUTCTiming=function parseUTCTiming(manifestString){return parseUTCTimingScheme(stringToMpdXml(manifestString));};var toUnsigned=function toUnsigned(value){return value>>>0;};var toHexString=function toHexString(value){return('00'+value.toString(16)).slice(-2);};var bin={toUnsigned:toUnsigned,toHexString:toHexString};var inspectMp4,_textifyMp,toUnsigned$1=bin.toUnsigned,parseMp4Date=function parseMp4Date(seconds){return new Date(seconds*1000-2082844800000);},parseSampleFlags=function parseSampleFlags(flags){return{isLeading:(flags[0]&0x0c)>>>2,dependsOn:flags[0]&0x03,isDependedOn:(flags[1]&0xc0)>>>6,hasRedundancy:(flags[1]&0x30)>>>4,paddingValue:(flags[1]&0x0e)>>>1,isNonSyncSample:flags[1]&0x01,degradationPriority:flags[2]<<8|flags[3]};},parseType=function parseType(buffer){var result='';result+=String.fromCharCode(buffer[0]);result+=String.fromCharCode(buffer[1]);result+=String.fromCharCode(buffer[2]);result+=String.fromCharCode(buffer[3]);return result;},findBox=function findBox(data,path){var results=[],i,size,type,end,subresults;if(!path.length){return null;}
1610for(i=0;i<data.byteLength;){size=toUnsigned$1(data[i]<<24|data[i+1]<<16|data[i+2]<<8|data[i+3]);type=parseType(data.subarray(i+4,i+8));end=size>1?i+size:data.byteLength;if(type===path[0]){if(path.length===1){results.push(data.subarray(i+8,end));}else{subresults=findBox(data.subarray(i+8,end),path.slice(1));if(subresults.length){results=results.concat(subresults);}}}
1611i=end;}
1612return results;},nalParse=function nalParse(avcStream){var avcView=new DataView(avcStream.buffer,avcStream.byteOffset,avcStream.byteLength),result=[],i,length;for(i=0;i+4<avcStream.length;i+=length){length=avcView.getUint32(i);i+=4;if(length<=0){result.push('<span style=\'color:red;\'>MALFORMED DATA</span>');continue;}
1613switch(avcStream[i]&0x1F){case 0x01:result.push('slice_layer_without_partitioning_rbsp');break;case 0x05:result.push('slice_layer_without_partitioning_rbsp_idr');break;case 0x06:result.push('sei_rbsp');break;case 0x07:result.push('seq_parameter_set_rbsp');break;case 0x08:result.push('pic_parameter_set_rbsp');break;case 0x09:result.push('access_unit_delimiter_rbsp');break;default:result.push('UNKNOWN NAL - '+avcStream[i]&0x1F);break;}}
1614return result;},parse$1={avc1:function avc1(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength);return{dataReferenceIndex:view.getUint16(6),width:view.getUint16(24),height:view.getUint16(26),horizresolution:view.getUint16(28)+view.getUint16(30)/16,vertresolution:view.getUint16(32)+view.getUint16(34)/16,frameCount:view.getUint16(40),depth:view.getUint16(74),config:inspectMp4(data.subarray(78,data.byteLength))};},avcC:function avcC(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength),result={configurationVersion:data[0],avcProfileIndication:data[1],profileCompatibility:data[2],avcLevelIndication:data[3],lengthSizeMinusOne:data[4]&0x03,sps:[],pps:[]},numOfSequenceParameterSets=data[5]&0x1f,numOfPictureParameterSets,nalSize,offset,i;offset=6;for(i=0;i<numOfSequenceParameterSets;i++){nalSize=view.getUint16(offset);offset+=2;result.sps.push(new Uint8Array(data.subarray(offset,offset+nalSize)));offset+=nalSize;}
1615numOfPictureParameterSets=data[offset];offset++;for(i=0;i<numOfPictureParameterSets;i++){nalSize=view.getUint16(offset);offset+=2;result.pps.push(new Uint8Array(data.subarray(offset,offset+nalSize)));offset+=nalSize;}
1616return result;},btrt:function btrt(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength);return{bufferSizeDB:view.getUint32(0),maxBitrate:view.getUint32(4),avgBitrate:view.getUint32(8)};},esds:function esds(data){return{version:data[0],flags:new Uint8Array(data.subarray(1,4)),esId:data[6]<<8|data[7],streamPriority:data[8]&0x1f,decoderConfig:{objectProfileIndication:data[11],streamType:data[12]>>>2&0x3f,bufferSize:data[13]<<16|data[14]<<8|data[15],maxBitrate:data[16]<<24|data[17]<<16|data[18]<<8|data[19],avgBitrate:data[20]<<24|data[21]<<16|data[22]<<8|data[23],decoderConfigDescriptor:{tag:data[24],length:data[25],audioObjectType:data[26]>>>3&0x1f,samplingFrequencyIndex:(data[26]&0x07)<<1|data[27]>>>7&0x01,channelConfiguration:data[27]>>>3&0x0f}}};},ftyp:function ftyp(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength),result={majorBrand:parseType(data.subarray(0,4)),minorVersion:view.getUint32(4),compatibleBrands:[]},i=8;while(i<data.byteLength){result.compatibleBrands.push(parseType(data.subarray(i,i+4)));i+=4;}
1617return result;},dinf:function dinf(data){return{boxes:inspectMp4(data)};},dref:function dref(data){return{version:data[0],flags:new Uint8Array(data.subarray(1,4)),dataReferences:inspectMp4(data.subarray(8))};},hdlr:function hdlr(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength),result={version:view.getUint8(0),flags:new Uint8Array(data.subarray(1,4)),handlerType:parseType(data.subarray(8,12)),name:''},i=8;for(i=24;i<data.byteLength;i++){if(data[i]===0x00){i++;break;}
1618result.name+=String.fromCharCode(data[i]);}
1619result.name=decodeURIComponent(escape(result.name));return result;},mdat:function mdat(data){return{byteLength:data.byteLength,nals:nalParse(data)};},mdhd:function mdhd(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength),i=4,language,result={version:view.getUint8(0),flags:new Uint8Array(data.subarray(1,4)),language:''};if(result.version===1){i+=4;result.creationTime=parseMp4Date(view.getUint32(i));i+=8;result.modificationTime=parseMp4Date(view.getUint32(i));i+=4;result.timescale=view.getUint32(i);i+=8;result.duration=view.getUint32(i);}else{result.creationTime=parseMp4Date(view.getUint32(i));i+=4;result.modificationTime=parseMp4Date(view.getUint32(i));i+=4;result.timescale=view.getUint32(i);i+=4;result.duration=view.getUint32(i);}
1620i+=4;language=view.getUint16(i);result.language+=String.fromCharCode((language>>10)+0x60);result.language+=String.fromCharCode(((language&0x03e0)>>5)+0x60);result.language+=String.fromCharCode((language&0x1f)+0x60);return result;},mdia:function mdia(data){return{boxes:inspectMp4(data)};},mfhd:function mfhd(data){return{version:data[0],flags:new Uint8Array(data.subarray(1,4)),sequenceNumber:data[4]<<24|data[5]<<16|data[6]<<8|data[7]};},minf:function minf(data){return{boxes:inspectMp4(data)};},mp4a:function mp4a(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength),result={dataReferenceIndex:view.getUint16(6),channelcount:view.getUint16(16),samplesize:view.getUint16(18),samplerate:view.getUint16(24)+view.getUint16(26)/65536};if(data.byteLength>28){result.streamDescriptor=inspectMp4(data.subarray(28))[0];}
1621return result;},moof:function moof(data){return{boxes:inspectMp4(data)};},moov:function moov(data){return{boxes:inspectMp4(data)};},mvex:function mvex(data){return{boxes:inspectMp4(data)};},mvhd:function mvhd(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength),i=4,result={version:view.getUint8(0),flags:new Uint8Array(data.subarray(1,4))};if(result.version===1){i+=4;result.creationTime=parseMp4Date(view.getUint32(i));i+=8;result.modificationTime=parseMp4Date(view.getUint32(i));i+=4;result.timescale=view.getUint32(i);i+=8;result.duration=view.getUint32(i);}else{result.creationTime=parseMp4Date(view.getUint32(i));i+=4;result.modificationTime=parseMp4Date(view.getUint32(i));i+=4;result.timescale=view.getUint32(i);i+=4;result.duration=view.getUint32(i);}
1622i+=4;result.rate=view.getUint16(i)+view.getUint16(i+2)/16;i+=4;result.volume=view.getUint8(i)+view.getUint8(i+1)/8;i+=2;i+=2;i+=2*4;result.matrix=new Uint32Array(data.subarray(i,i+9*4));i+=9*4;i+=6*4;result.nextTrackId=view.getUint32(i);return result;},pdin:function pdin(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength);return{version:view.getUint8(0),flags:new Uint8Array(data.subarray(1,4)),rate:view.getUint32(4),initialDelay:view.getUint32(8)};},sdtp:function sdtp(data){var result={version:data[0],flags:new Uint8Array(data.subarray(1,4)),samples:[]},i;for(i=4;i<data.byteLength;i++){result.samples.push({dependsOn:(data[i]&0x30)>>4,isDependedOn:(data[i]&0x0c)>>2,hasRedundancy:data[i]&0x03});}
1623return result;},sidx:function sidx(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength),result={version:data[0],flags:new Uint8Array(data.subarray(1,4)),references:[],referenceId:view.getUint32(4),timescale:view.getUint32(8),earliestPresentationTime:view.getUint32(12),firstOffset:view.getUint32(16)},referenceCount=view.getUint16(22),i;for(i=24;referenceCount;i+=12,referenceCount--){result.references.push({referenceType:(data[i]&0x80)>>>7,referencedSize:view.getUint32(i)&0x7FFFFFFF,subsegmentDuration:view.getUint32(i+4),startsWithSap:!!(data[i+8]&0x80),sapType:(data[i+8]&0x70)>>>4,sapDeltaTime:view.getUint32(i+8)&0x0FFFFFFF});}
1624return result;},smhd:function smhd(data){return{version:data[0],flags:new Uint8Array(data.subarray(1,4)),balance:data[4]+data[5]/256};},stbl:function stbl(data){return{boxes:inspectMp4(data)};},stco:function stco(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength),result={version:data[0],flags:new Uint8Array(data.subarray(1,4)),chunkOffsets:[]},entryCount=view.getUint32(4),i;for(i=8;entryCount;i+=4,entryCount--){result.chunkOffsets.push(view.getUint32(i));}
1625return result;},stsc:function stsc(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength),entryCount=view.getUint32(4),result={version:data[0],flags:new Uint8Array(data.subarray(1,4)),sampleToChunks:[]},i;for(i=8;entryCount;i+=12,entryCount--){result.sampleToChunks.push({firstChunk:view.getUint32(i),samplesPerChunk:view.getUint32(i+4),sampleDescriptionIndex:view.getUint32(i+8)});}
1626return result;},stsd:function stsd(data){return{version:data[0],flags:new Uint8Array(data.subarray(1,4)),sampleDescriptions:inspectMp4(data.subarray(8))};},stsz:function stsz(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength),result={version:data[0],flags:new Uint8Array(data.subarray(1,4)),sampleSize:view.getUint32(4),entries:[]},i;for(i=12;i<data.byteLength;i+=4){result.entries.push(view.getUint32(i));}
1627return result;},stts:function stts(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength),result={version:data[0],flags:new Uint8Array(data.subarray(1,4)),timeToSamples:[]},entryCount=view.getUint32(4),i;for(i=8;entryCount;i+=8,entryCount--){result.timeToSamples.push({sampleCount:view.getUint32(i),sampleDelta:view.getUint32(i+4)});}
1628return result;},styp:function styp(data){return parse$1.ftyp(data);},tfdt:function tfdt(data){var result={version:data[0],flags:new Uint8Array(data.subarray(1,4)),baseMediaDecodeTime:toUnsigned$1(data[4]<<24|data[5]<<16|data[6]<<8|data[7])};if(result.version===1){result.baseMediaDecodeTime*=Math.pow(2,32);result.baseMediaDecodeTime+=toUnsigned$1(data[8]<<24|data[9]<<16|data[10]<<8|data[11]);}
1629return result;},tfhd:function tfhd(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength),result={version:data[0],flags:new Uint8Array(data.subarray(1,4)),trackId:view.getUint32(4)},baseDataOffsetPresent=result.flags[2]&0x01,sampleDescriptionIndexPresent=result.flags[2]&0x02,defaultSampleDurationPresent=result.flags[2]&0x08,defaultSampleSizePresent=result.flags[2]&0x10,defaultSampleFlagsPresent=result.flags[2]&0x20,durationIsEmpty=result.flags[0]&0x010000,defaultBaseIsMoof=result.flags[0]&0x020000,i;i=8;if(baseDataOffsetPresent){i+=4;result.baseDataOffset=view.getUint32(12);i+=4;}
1630if(sampleDescriptionIndexPresent){result.sampleDescriptionIndex=view.getUint32(i);i+=4;}
1631if(defaultSampleDurationPresent){result.defaultSampleDuration=view.getUint32(i);i+=4;}
1632if(defaultSampleSizePresent){result.defaultSampleSize=view.getUint32(i);i+=4;}
1633if(defaultSampleFlagsPresent){result.defaultSampleFlags=view.getUint32(i);}
1634if(durationIsEmpty){result.durationIsEmpty=true;}
1635if(!baseDataOffsetPresent&&defaultBaseIsMoof){result.baseDataOffsetIsMoof=true;}
1636return result;},tkhd:function tkhd(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength),i=4,result={version:view.getUint8(0),flags:new Uint8Array(data.subarray(1,4))};if(result.version===1){i+=4;result.creationTime=parseMp4Date(view.getUint32(i));i+=8;result.modificationTime=parseMp4Date(view.getUint32(i));i+=4;result.trackId=view.getUint32(i);i+=4;i+=8;result.duration=view.getUint32(i);}else{result.creationTime=parseMp4Date(view.getUint32(i));i+=4;result.modificationTime=parseMp4Date(view.getUint32(i));i+=4;result.trackId=view.getUint32(i);i+=4;i+=4;result.duration=view.getUint32(i);}
1637i+=4;i+=2*4;result.layer=view.getUint16(i);i+=2;result.alternateGroup=view.getUint16(i);i+=2;result.volume=view.getUint8(i)+view.getUint8(i+1)/8;i+=2;i+=2;result.matrix=new Uint32Array(data.subarray(i,i+9*4));i+=9*4;result.width=view.getUint16(i)+view.getUint16(i+2)/16;i+=4;result.height=view.getUint16(i)+view.getUint16(i+2)/16;return result;},traf:function traf(data){return{boxes:inspectMp4(data)};},trak:function trak(data){return{boxes:inspectMp4(data)};},trex:function trex(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength);return{version:data[0],flags:new Uint8Array(data.subarray(1,4)),trackId:view.getUint32(4),defaultSampleDescriptionIndex:view.getUint32(8),defaultSampleDuration:view.getUint32(12),defaultSampleSize:view.getUint32(16),sampleDependsOn:data[20]&0x03,sampleIsDependedOn:(data[21]&0xc0)>>6,sampleHasRedundancy:(data[21]&0x30)>>4,samplePaddingValue:(data[21]&0x0e)>>1,sampleIsDifferenceSample:!!(data[21]&0x01),sampleDegradationPriority:view.getUint16(22)};},trun:function trun(data){var result={version:data[0],flags:new Uint8Array(data.subarray(1,4)),samples:[]},view=new DataView(data.buffer,data.byteOffset,data.byteLength),dataOffsetPresent=result.flags[2]&0x01,firstSampleFlagsPresent=result.flags[2]&0x04,sampleDurationPresent=result.flags[1]&0x01,sampleSizePresent=result.flags[1]&0x02,sampleFlagsPresent=result.flags[1]&0x04,sampleCompositionTimeOffsetPresent=result.flags[1]&0x08,sampleCount=view.getUint32(4),offset=8,sample;if(dataOffsetPresent){result.dataOffset=view.getInt32(offset);offset+=4;}
1638if(firstSampleFlagsPresent&&sampleCount){sample={flags:parseSampleFlags(data.subarray(offset,offset+4))};offset+=4;if(sampleDurationPresent){sample.duration=view.getUint32(offset);offset+=4;}
1639if(sampleSizePresent){sample.size=view.getUint32(offset);offset+=4;}
1640if(sampleCompositionTimeOffsetPresent){sample.compositionTimeOffset=view.getUint32(offset);offset+=4;}
1641result.samples.push(sample);sampleCount--;}
1642while(sampleCount--){sample={};if(sampleDurationPresent){sample.duration=view.getUint32(offset);offset+=4;}
1643if(sampleSizePresent){sample.size=view.getUint32(offset);offset+=4;}
1644if(sampleFlagsPresent){sample.flags=parseSampleFlags(data.subarray(offset,offset+4));offset+=4;}
1645if(sampleCompositionTimeOffsetPresent){sample.compositionTimeOffset=view.getUint32(offset);offset+=4;}
1646result.samples.push(sample);}
1647return result;},'url ':function url(data){return{version:data[0],flags:new Uint8Array(data.subarray(1,4))};},vmhd:function vmhd(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength);return{version:data[0],flags:new Uint8Array(data.subarray(1,4)),graphicsmode:view.getUint16(4),opcolor:new Uint16Array([view.getUint16(6),view.getUint16(8),view.getUint16(10)])};}};inspectMp4=function inspectMp4(data){var i=0,result=[],view,size,type,end,box;var ab=new ArrayBuffer(data.length);var v=new Uint8Array(ab);for(var z=0;z<data.length;++z){v[z]=data[z];}
1648view=new DataView(ab);while(i<data.byteLength){size=view.getUint32(i);type=parseType(data.subarray(i+4,i+8));end=size>1?i+size:data.byteLength;box=(parse$1[type]||function(data){return{data:data};})(data.subarray(i+8,end));box.size=size;box.type=type;result.push(box);i=end;}
1649return result;};_textifyMp=function textifyMp4(inspectedMp4,depth){var indent;depth=depth||0;indent=new Array(depth*2+1).join(' ');return inspectedMp4.map(function(box,index){return indent+box.type+'\n'+
1650Object.keys(box).filter(function(key){return key!=='type'&&key!=='boxes';}).map(function(key){var prefix=indent+'  '+key+': ',value=box[key];if(value instanceof Uint8Array||value instanceof Uint32Array){var bytes=Array.prototype.slice.call(new Uint8Array(value.buffer,value.byteOffset,value.byteLength)).map(function(_byte){return ' '+('00'+_byte.toString(16)).slice(-2);}).join('').match(/.{1,24}/g);if(!bytes){return prefix+'<>';}
1651if(bytes.length===1){return prefix+'<'+bytes.join('').slice(1)+'>';}
1652return prefix+'<\n'+bytes.map(function(line){return indent+'  '+line;}).join('\n')+'\n'+indent+'  >';}
1653return prefix+JSON.stringify(value,null,2).split('\n').map(function(line,index){if(index===0){return line;}
1654return indent+'  '+line;}).join('\n');}).join('\n')+(box.boxes?'\n'+_textifyMp(box.boxes,depth+1):'');}).join('\n');};var mp4Inspector={inspect:inspectMp4,textify:_textifyMp,parseType:parseType,f
1654indBox:findBox,parseTraf:parse$1.traf,parseTfdt:parse$1.tfdt,parseHdlr:parse$1.hdlr,parseTfhd:parse$1.tfhd,parseTrun:parse$1.trun,parseSidx:parse$1.sidx};var toUnsigned$2=bin.toUnsigned;var toHexString$1=bin.toHexString;var timescale,startTime,compositionStartTime,getVideoTrackIds,getTracks;timescale=function timescale(init){var result={},traks=mp4Inspector.findBox(init,['moov','trak']);return traks.reduce(function(result,trak){var tkhd,version,index,id,mdhd;tkhd=mp4Inspector.findBox(trak,['tkhd'])[0];if(!tkhd){return null;}
1655version=tkhd[0];index=version===0?12:20;id=toUnsigned$2(tkhd[index]<<24|tkhd[index+1]<<16|tkhd[index+2]<<8|tkhd[index+3]);mdhd=mp4Inspector.findBox(trak,['mdia','mdhd'])[0];if(!mdhd){return null;}
1656version=mdhd[0];index=version===0?12:20;result[id]=toUnsigned$2(mdhd[index]<<24|mdhd[index+1]<<16|mdhd[index+2]<<8|mdhd[index+3]);return result;},result);};startTime=function startTime(timescale,fragment){var trafs,baseTimes,result;trafs=mp4Inspector.findBox(fragment,['moof','traf']);baseTimes=[].concat.apply([],trafs.map(function(traf){return mp4Inspector.findBox(traf,['tfhd']).map(function(tfhd){var id,scale,baseTime;id=toUnsigned$2(tfhd[4]<<24|tfhd[5]<<16|tfhd[6]<<8|tfhd[7]);scale=timescale[id]||90e3;baseTime=mp4Inspector.findBox(traf,['tfdt']).map(function(tfdt){var version,result;version=tfdt[0];result=toUnsigned$2(tfdt[4]<<24|tfdt[5]<<16|tfdt[6]<<8|tfdt[7]);if(version===1){result*=Math.pow(2,32);result+=toUnsigned$2(tfdt[8]<<24|tfdt[9]<<16|tfdt[10]<<8|tfdt[11]);}
1657return result;})[0];baseTime=baseTime||Infinity;return baseTime/scale;});}));result=Math.min.apply(null,baseTimes);return isFinite(result)?result:0;};compositionStartTime=function compositionStartTime(timescales,fragment){var trafBoxes=mp4Inspector.findBox(fragment,['moof','traf']);var baseMediaDecodeTime=0;var compositionTimeOffset=0;var trackId;if(trafBoxes&&trafBoxes.length){var parsedTraf=mp4Inspector.parseTraf(trafBoxes[0]);for(var i=0;i<parsedTraf.boxes.length;i++){if(parsedTraf.boxes[i].type==='tfhd'){trackId=parsedTraf.boxes[i].trackId;}else if(parsedTraf.boxes[i].type==='tfdt'){baseMediaDecodeTime=parsedTraf.boxes[i].baseMediaDecodeTime;}else if(parsedTraf.boxes[i].type==='trun'&&parsedTraf.boxes[i].samples.length){compositionTimeOffset=parsedTraf.boxes[i].samples[0].compositionTimeOffset||0;}}}
1658var timescale=timescales[trackId]||90e3;return(baseMediaDecodeTime+compositionTimeOffset)/timescale;};getVideoTrackIds=function getVideoTrackIds(init){var traks=mp4Inspector.findBox(init,['moov','trak']);var videoTrackIds=[];traks.forEach(function(trak){var hdlrs=mp4Inspector.findBox(trak,['mdia','hdlr']);var tkhds=mp4Inspector.findBox(trak,['tkhd']);hdlrs.forEach(function(hdlr,index){var handlerType=mp4Inspector.parseType(hdlr.subarray(8,12));var tkhd=tkhds[index];var view;var version;var trackId;if(handlerType==='vide'){view=new DataView(tkhd.buffer,tkhd.byteOffset,tkhd.byteLength);version=view.getUint8(0);trackId=version===0?view.getUint32(12):view.getUint32(20);videoTrackIds.push(trackId);}});});return videoTrackIds;};getTracks=function getTracks(init){var traks=mp4Inspector.findBox(init,['moov','trak']);var tracks=[];traks.forEach(function(trak){var track={};var tkhd=mp4Inspector.findBox(trak,['tkhd'])[0];var view,version;if(tkhd){view=new DataView(tkhd.buffer,tkhd.byteOffset,tkhd.byteLength);version=view.getUint8(0);track.id=version===0?view.getUint32(12):view.getUint32(20);}
1659var hdlr=mp4Inspector.findBox(trak,['mdia','hdlr'])[0];if(hdlr){var type=mp4Inspector.parseType(hdlr.subarray(8,12));if(type==='vide'){track.type='video';}else if(type==='soun'){track.type='audio';}else{track.type=type;}}
1660var stsd=mp4Inspector.findBox(trak,['mdia','minf','stbl','stsd'])[0];if(stsd){var sampleDescriptions=stsd.subarray(8);track.codec=mp4Inspector.parseType(sampleDescriptions.subarray(4,8));var codecBox=mp4Inspector.findBox(sampleDescriptions,[track.codec])[0];var codecConfig,codecConfigType;if(codecBox){if(/^[a-z]vc[1-9]$/i.test(track.codec)){codecConfig=codecBox.subarray(78);codecConfigType=mp4Inspector.parseType(codecConfig.subarray(4,8));if(codecConfigType==='avcC'&&codecConfig.length>11){track.codec+='.';track.codec+=toHexString$1(codecConfig[9]);track.codec+=toHexString$1(codecConfig[10]);track.codec+=toHexString$1(codecConfig[11]);}else{track.codec='avc1.4d400d';}}else if(/^mp4[a,v]$/i.test(track.codec)){codecConfig=codecBox.subarray(28);codecConfigType=mp4Inspector.parseType(codecConfig.subarray(4,8));if(codecConfigType==='esds'&&codecConfig.length>20&&codecConfig[19]!==0){track.codec+='.'+toHexString$1(codecConfig[19]);track.codec+='.'+toHexString$1(codecConfig[20]>>>2&0x3f).replace(/^0/,'');}else{track.codec='mp4a.40.2';}}}}
1661var mdhd=mp4Inspector.findBox(trak,['mdia','mdhd'])[0];if(mdhd&&tkhd){var index=version===0?12:20;track.timescale=toUnsigned$2(mdhd[index]<<24|mdhd[index+1]<<16|mdhd[index+2]<<8|mdhd[index+3]);}
1662tracks.push(track);});return tracks;};var probe={findBox:mp4Inspector.findBox,parseType:mp4Inspector.parseType,timescale:timescale,startTime:startTime,compositionStartTime:compositionStartTime,videoTrackIds:getVideoTrackIds,tracks:getTracks};var USER_DATA_REGISTERED_ITU_T_T35=4,RBSP_TRAILING_BITS=128;var parseSei=function parseSei(bytes){var i=0,result={payloadType:-1,payloadSize:0},payloadType=0,payloadSize=0;while(i<bytes.byteLength){if(bytes[i]===RBSP_TRAILING_BITS){break;}
1663while(bytes[i]===0xFF){payloadType+=255;i++;}
1664payloadType+=bytes[i++];
vendor: 4,892 bytes, lines 1664-1687
1664while(bytes[i]===0xFF){payloadSize+=255;i++;}
1665payloadSize+=bytes[i++];if(!result.payload&&payloadType===USER_DATA_REGISTERED_ITU_T_T35){result.payloadType=payloadType;result.payloadSize=payloadSize;result.payload=bytes.subarray(i,i+payloadSize);break;}
1666i+=payloadSize;payloadType=0;payloadSize=0;}
1667return result;};var parseUserData=function parseUserData(sei){if(sei.payload[0]!==181){return null;}
1668if((sei.payload[1]<<8|sei.payload[2])!==49){return null;}
1669if(String.fromCharCode(sei.payload[3],sei.payload[4],sei.payload[5],sei.payload[6])!=='GA94'){return null;}
1670if(sei.payload[7]!==0x03){return null;}
1671return sei.payload.subarray(8,sei.payload.length-1);};var parseCaptionPackets=function parseCaptionPackets(pts,userData){var results=[],i,count,offset,data;if(!(userData[0]&0x40)){return results;}
1672count=userData[0]&0x1f;for(i=0;i<count;i++){offset=i*3;data={type:userData[offset+2]&0x03,pts:pts};if(userData[offset+2]&0x04){data.ccData=userData[offset+3]<<8|userData[offset+4];results.push(data);}}
1673return results;};var discardEmulationPreventionBytes=function discardEmulationPreventionBytes(data){var length=data.byteLength,emulationPreventionBytesPositions=[],i=1,newLength,newData;while(i<length-2){if(data[i]===0&&data[i+1]===0&&data[i+2]===0x03){emulationPreventionBytesPositions.push(i+2);i+=2;}else{i++;}}
1674if(emulationPreventionBytesPositions.length===0){return data;}
1675newLength=length-emulationPreventionBytesPositions.length;newData=new Uint8Array(newLength);var sourceIndex=0;for(i=0;i<newLength;sourceIndex++,i++){if(sourceIndex===emulationPreventionBytesPositions[0]){sourceIndex++;emulationPreventionBytesPositions.shift();}
1676newData[i]=data[sourceIndex];}
1677return newData;};var captionPacketParser={parseSei:parseSei,parseUserData:parseUserData,parseCaptionPackets:parseCaptionPackets,discardEmulationPreventionBytes:discardEmulationPreventionBytes,USER_DATA_REGISTERED_ITU_T_T35:USER_DATA_REGISTERED_ITU_T_T35};var Stream$1=function Stream(){this.init=function(){var listeners={};this.on=function(type,listener){if(!listeners[type]){listeners[type]=[];}
1678listeners[type]=listeners[type].concat(listener);};this.off=function(type,listener){var index;if(!listeners[type]){return false;}
1679index=listeners[type].indexOf(listener);listeners[type]=listeners[type].slice();listeners[type].splice(index,1);return index>-1;};this.trigger=function(type){var callbacks,i,length,args;callbacks=listeners[type];if(!callbacks){return;}
1680if(arguments.length===2){length=callbacks.length;for(i=0;i<length;++i){callbacks[i].call(this,arguments[1]);}}else{args=[];i=arguments.length;for(i=1;i<arguments.length;++i){args.push(arguments[i]);}
1681length=callbacks.length;for(i=0;i<length;++i){callbacks[i].apply(this,args);}}};this.dispose=function(){listeners={};};};};Stream$1.prototype.pipe=function(destination){this.on('data',function(data){destination.push(data);});this.on('done',function(flushSource){destination.flush(flushSource);});this.on('partialdone',function(flushSource){destination.partialFlush(flushSource);});this.on('endedtimeline',function(flushSource){destination.endTimeline(flushSource);});this.on('reset',function(flushSource){destination.reset(flushSource);});return destination;};Stream$1.prototype.push=function(data){this.trigger('data',data);};Stream$1.prototype.flush=function(flushSource){this.trigger('done',flushSource);};Stream$1.prototype.partialFlush=function(flushSource){this.trigger('partialdone',flushSource);};Stream$1.prototype.endTimeline=function(flushSource){this.trigger('endedtimeline',flushSource);};Stream$1.prototype.reset=function(flushSource){this.trigger('reset',flushSource);};var stream=Stream$1;var CaptionStream=function CaptionStream(){CaptionStream.prototype.init.call(this);this.captionPackets_=[];this.ccStreams_=[new Cea608Stream(0,0),new Cea608Stream(0,1),new Cea608Stream(1,0),new Cea608Stream(1,1)];this.reset();this.ccStreams_.forEach(function(cc){cc.on('data',this.trigger.bind(this,'data'));cc.on('partialdone',this.trigger.bind(this,'partialdone'));cc.on('done',this.trigger.bind(this,'done'));},this);};CaptionStream.prototype=new stream();CaptionStream.prototype.push=function(event){var sei,userData,newCaptionPackets;if(event.nalUnitType!=='sei_rbsp'){return;}
1682sei=captionPacketParser.parseSei(event.escapedRBSP);if(sei.payloadType!==captionPacketParser.USER_DATA_REGISTERED_ITU_T_T35){return;}
1683userData=captionPacketParser.parseUserData(sei);if(!userData){return;}
1684if(event.dts<this.latestDts_){this.ignoreNextEqualDts_=true;return;}else if(event.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--;if(!this.numSameDts_){this.ignoreNextEqualDts_=false;}
1685return;}
1686newCaptionPackets=captionPacketParser.parseCaptionPackets(event.pts,userData);this.captionPackets_=this.captionPackets_.concat(newCaptionPackets);if(this.latestDts_!==event.dts){this.numSameDts_=0;}
1687this.numSameDts_++;this.latestDts_=event.dts;};
vendor: 10,726 bytes, lines 1687-1712
1687CaptionStream.prototype.flushCCStreams=function(flushType){this.ccStreams_.forEach(function(cc){return flushType==='flush'?cc.flush():cc.partialFlush();},this);};CaptionStream.prototype.flushStream=function(flushType){if(!this.captionPackets_.length){this.flushCCStreams(flushType);return;}
1688this.captionPackets_.forEach(function(elem,idx){elem.presortIndex=idx;});this.captionPackets_.sort(function(a,b){if(a.pts===b.pts){return a.presortIndex-b.presortIndex;}
1689return a.pts-b.pts;});this.captionPackets_.forEach(function(packet){if(packet.type<2){this.dispatchCea608Packet(packet);}},this);this.captionPackets_.length=0;this.flushCCStreams(flushType);};CaptionStream.prototype.flush=function(){return this.flushStream('flush');};CaptionStream.prototype.partialFlush=function(){return this.flushStream('partialFlush');};CaptionStream.prototype.reset=function(){this.latestDts_=null;this.ignoreNextEqualDts_=false;this.numSameDts_=0;this.activeCea608Channel_=[null,null];this.ccStreams_.forEach(function(ccStream){ccStream.reset();});};CaptionStream.prototype.dispatchCea608Packet=function(packet){if(this.setsTextOrXDSActive(packet)){this.activeCea608Channel_[packet.type]=null;}else if(this.setsChannel1Active(packet)){this.activeCea608Channel_[packet.type]=0;}else if(this.setsChannel2Active(packet)){this.activeCea608Channel_[packet.type]=1;}
1690if(this.activeCea608Channel_[packet.type]===null){return;}
1691this.ccStreams_[(packet.type<<1)+this.activeCea608Channel_[packet.type]].push(packet);};CaptionStream.prototype.setsChannel1Active=function(packet){return(packet.ccData&0x7800)===0x1000;};CaptionStream.prototype.setsChannel2Active=function(packet){return(packet.ccData&0x7800)===0x1800;};CaptionStream.prototype.setsTextOrXDSActive=function(packet){return(packet.ccData&0x7100)===0x0100||(packet.ccData&0x78fe)===0x102a||(packet.ccData&0x78fe)===0x182a;};var CHARACTER_TRANSLATION={0x2a:0xe1,0x5c:0xe9,0x5e:0xed,0x5f:0xf3,0x60:0xfa,0x7b:0xe7,0x7c:0xf7,0x7d:0xd1,0x7e:0xf1,0x7f:0x2588,0x0130:0xae,0x0131:0xb0,0x0132:0xbd,0x0133:0xbf,0x0134:0x2122,0x0135:0xa2,0x0136:0xa3,0x0137:0x266a,0x0138:0xe0,0x0139:0xa0,0x013a:0xe8,0x013b:0xe2,0x013c:0xea,0x013d:0xee,0x013e:0xf4,0x013f:0xfb,0x0220:0xc1,0x0221:0xc9,0x0222:0xd3,0x0223:0xda,0x0224:0xdc,0x0225:0xfc,0x0226:0x2018,0x0227:0xa1,0x0228:0x2a,0x0229:0x27,0x022a:0x2014,0x022b:0xa9,0x022c:0x2120,0x022d:0x2022,0x022e:0x201c,0x022f:0x201d,0x0230:0xc0,0x0231:0xc2,0x0232:0xc7,0x0233:0xc8,0x0234:0xca,0x0235:0xcb,0x0236:0xeb,0x0237:0xce,0x0238:0xcf,0x0239:0xef,0x023a:0xd4,0x023b:0xd9,0x023c:0xf9,0x023d:0xdb,0x023e:0xab,0x023f:0xbb,0x0320:0xc3,0x0321:0xe3,0x0322:0xcd,0x0323:0xcc,0x0324:0xec,0x0325:0xd2,0x0326:0xf2,0x0327:0xd5,0x0328:0xf5,0x0329:0x7b,0x032a:0x7d,0x032b:0x5c,0x032c:0x5e,0x032d:0x5f,0x032e:0x7c,0x032f:0x7e,0x0330:0xc4,0x0331:0xe4,0x0332:0xd6,0x0333:0xf6,0x0334:0xdf,0x0335:0xa5,0x0336:0xa4,0x0337:0x2502,0x0338:0xc5,0x0339:0xe5,0x033a:0xd8,0x033b:0xf8,0x033c:0x250c,0x033d:0x2510,0x033e:0x2514,0x033f:0x2518};var getCharFromCode=function getCharFromCode(code){if(code===null){return '';}
1692code=CHARACTER_TRANSLATION[code]||code;return String.fromCharCode(code);};var BOTTOM_ROW=14;var ROWS=[0x1100,0x1120,0x1200,0x1220,0x1500,0x1520,0x1600,0x1620,0x1700,0x1720,0x1000,0x1300,0x1320,0x1400,0x1420];var createDisplayBuffer=function createDisplayBuffer(){var result=[],i=BOTTOM_ROW+1;while(i--){result.push('');}
1693return result;};var Cea608Stream=function Cea608Stream(field,dataChannel){Cea608Stream.prototype.init.call(this);this.field_=field||0;this.dataChannel_=dataChannel||0;this.name_='CC'+((this.field_<<1|this.dataChannel_)+1);this.setConstants();this.reset();this.push=function(packet){var data,swap,char0,char1,text;data=packet.ccData&0x7f7f;if(data===this.lastControlCode_){this.lastControlCode_=null;return;}
1694if((data&0xf000)===0x1000){this.lastControlCode_=data;}else if(data!==this.PADDING_){this.lastControlCode_=null;}
1695char0=data>>>8;char1=data&0xff;if(data===this.PADDING_){return;}else if(data===this.RESUME_CAPTION_LOADING_){this.mode_='popOn';}else if(data===this.END_OF_CAPTION_){this.mode_='popOn';this.clearFormatting(packet.pts);this.flushDisplayed(packet.pts);swap=this.displayed_;this.displayed_=this.nonDisplayed_;this.nonDisplayed_=swap;this.startPts_=packet.pts;}else if(data===this.ROLL_UP_2_ROWS_){this.rollUpRows_=2;this.setRollUp(packet.pts);}else if(data===this.ROLL_UP_3_ROWS_){this.rollUpRows_=3;this.setRollUp(packet.pts);}else if(data===this.ROLL_UP_4_ROWS_){this.rollUpRows_=4;this.setRollUp(packet.pts);}else if(data===this.CARRIAGE_RETURN_){this.clearFormatting(packet.pts);this.flushDisplayed(packet.pts);this.shiftRowsUp_();this.startPts_=packet.pts;}else if(data===this.BACKSPACE_){if(this.mode_==='popOn'){this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1);}else{this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);}}else if(data===this.ERASE_DISPLAYED_MEMORY_){this.flushDisplayed(packet.pts);this.displayed_=createDisplayBuffer();}else if(data===this.ERASE_NON_DISPLAYED_MEMORY_){this.nonDisplayed_=createDisplayBuffer();}else if(data===this.RESUME_DIRECT_CAPTIONING_){if(this.mode_!=='paintOn'){this.flushDisplayed(packet.pts);this.displayed_=createDisplayBuffer();}
1696this.mode_='paintOn';this.startPts_=packet.pts;}else if(this.isSpecialCharacter(char0,char1)){char0=(char0&0x03)<<8;text=getCharFromCode(char0|char1);this[this.mode_](packet.pts,text);this.column_++;}else if(this.isExtCharacter(char0,char1)){if(this.mode_==='popOn'){this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1);}else{this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);}
1697char0=(char0&0x03)<<8;text=getCharFromCode(char0|char1);this[this.mode_](packet.pts,text);this.column_++;}else if(this.isMidRowCode(char0,char1)){this.clearFormatting(packet.pts);this[this.mode_](packet.pts,' ');this.column_++;if((char1&0xe)===0xe){this.addFormatting(packet.pts,['i']);}
1698if((char1&0x1)===0x1){this.addFormatting(packet.pts,['u']);}}else if(this.isOffsetControlCode(char0,char1)){this.column_+=char1&0x03;}else if(this.isPAC(char0,char1)){var row=ROWS.indexOf(data&0x1f20);if(this.mode_==='rollUp'){if(row-this.rollUpRows_+1<0){row=this.rollUpRows_-1;}
1699this.setRollUp(packet.pts,row);}
1700if(row!==this.row_){this.clearFormatting(packet.pts);this.row_=row;}
1701if(char1&0x1&&this.formatting_.indexOf('u')===-1){this.addFormatting(packet.pts,['u']);}
1702if((data&0x10)===0x10){this.column_=((data&0xe)>>1)*4;}
1703if(this.isColorPAC(char1)){if((char1&0xe)===0xe){this.addFormatting(packet.pts,['i']);}}}else if(this.isNormalChar(char0)){if(char1===0x00){char1=null;}
1704text=getCharFromCode(char0);text+=getCharFromCode(char1);this[this.mode_](packet.pts,text);this.column_+=text.length;}};};Cea608Stream.prototype=new stream();Cea608Stream.prototype.flushDisplayed=function(pts){var content=this.displayed_.map(function(row){try{return row.trim();}catch(e){console.error('Skipping malformed caption.');return '';}}).join('\n').replace(/^\n+|\n+$/g,'');if(content.length){this.trigger('data',{startPts:this.startPts_,endPts:pts,text:content,stream:this.name_});}};Cea608Stream.prototype.reset=function(){this.mode_='popOn';this.topRow_=0;this.startPts_=0;this.displayed_=createDisplayBuffer();this.nonDisplayed_=createDisplayBuffer();this.lastControlCode_=null;this.column_=0;this.row_=BOTTOM_ROW;this.rollUpRows_=2;this.formatting_=[];};Cea608Stream.prototype.setConstants=function(){if(this.dataChannel_===0){this.BASE_=0x10;this.EXT_=0x11;this.CONTROL_=(0x14|this.field_)<<8;this.OFFSET_=0x17;}else if(this.dataChannel_===1){this.BASE_=0x18;this.EXT_=0x19;this.CONTROL_=(0x1c|this.field_)<<8;this.OFFSET_=0x1f;}
1705this.PADDING_=0x0000;this.RESUME_CAPTION_LOADING_=this.CONTROL_|0x20;this.END_OF_CAPTION_=this.CONTROL_|0x2f;this.ROLL_UP_2_ROWS_=this.CONTROL_|0x25;this.ROLL_UP_3_ROWS_=this.CONTROL_|0x26;this.ROLL_UP_4_ROWS_=this.CONTROL_|0x27;this.CARRIAGE_RETURN_=this.CONTROL_|0x2d;this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|0x29;this.BACKSPACE_=this.CONTROL_|0x21;this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|0x2c;this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|0x2e;};Cea608Stream.prototype.isSpecialCharacter=function(char0,char1){return char0===this.EXT_&&char1>=0x30&&char1<=0x3f;};Cea608Stream.prototype.isExtCharacter=function(char0,char1){return(char0===this.EXT_+1||char0===this.EXT_+2)&&char1>=0x20&&char1<=0x3f;};Cea608Stream.prototype.isMidRowCode=function(char0,char1){return char0===this.EXT_&&char1>=0x20&&char1<=0x2f;};Cea608Stream.prototype.isOffsetControlCode=function(char0,char1){return char0===this.OFFSET_&&char1>=0x21&&char1<=0x23;};Cea608Stream.prototype.isPAC=function(char0,char1){return char0>=this.BASE_&&char0<this.BASE_+8&&char1>=0x40&&char1<=0x7f;};Cea608Stream.prototype.isColorPAC=function(char1){return char1>=0x40&&char1<=0x4f||char1>=0x60&&char1<=0x7f;};Cea608Stream.prototype.isNormalChar=function(_char){return _char>=0x20&&_char<=0x7f;};Cea608Stream.prototype.setRollUp=function(pts,newBaseRow){if(this.mode_!=='rollUp'){this.row_=BOTTOM_ROW;this.mode_='rollUp';this.flushDisplayed(pts);this.nonDisplayed_=createDisplayBuffer();this.displayed_=createDisplayBuffer();}
1706if(newBaseRow!==undefined&&newBaseRow!==this.row_){for(var i=0;i<this.rollUpRows_;i++){this.displayed_[newBaseRow-i]=this.displayed_[this.row_-i];this.displayed_[this.row_-i]='';}}
1707if(newBaseRow===undefined){newBaseRow=this.row_;}
1708this.topRow_=newBaseRow-this.rollUpRows_+1;};Cea608Stream.prototype.addFormatting=function(pts,format){this.formatting_=this.formatting_.concat(format);var text=format.reduce(function(text,format){return text+'<'+format+'>';},'');this[this.mode_](pts,text);};Cea608Stream.prototype.clearFormatting=function(pts){if(!this.formatting_.length){return;}
1709var text=this.formatting_.reverse().reduce(function(text,format){return text+'</'+format+'>';},'');this.formatting_=[];this[this.mode_](pts,text);};Cea608Stream.prototype.popOn=function(pts,text){var baseRow=this.nonDisplayed_[this.row_];baseRow+=text;this.nonDisplayed_[this.row_]=baseRow;};Cea608Stream.prototype.rollUp=function(pts,text){var baseRow=this.displayed_[this.row_];baseRow+=text;this.displayed_[this.row_]=baseRow;};Cea608Stream.prototype.shiftRowsUp_=function(){var i;for(i=0;i<this.topRow_;i++){this.displayed_[i]='';}
1710for(i=this.row_+1;i<BOTTOM_ROW+1;i++){this.displayed_[i]='';}
1711for(i=this.topRow_;i<this.row_;i++){this.displayed_[i]=this.displayed_[i+1];}
1712this.displayed_[this.row_]='';};Cea608Stream.prototype.paintOn=function(pts,text){var baseRow=this.displayed_[this.row_];baseRow+=text;this.displayed_[this.row_]=baseRow;};var captionStream={CaptionStream:CaptionStream,Cea608Stream:Cea608Stream};var discardEmulationPreventionBytes$1=captionPacketParser.discardEmulationPreventionBytes;
vendor: 4,602 bytes, lines 1712-1726
1712var CaptionStream$1=captionStream.CaptionStream;var mapToSample=function mapToSample(offset,samples){var approximateOffset=offset;for(var i=0;i<samples.length;i++){var sample=samples[i];if(approximateOffset<sample.size){return sample;}
1713approximateOffset-=sample.size;}
1714return null;};var findSeiNals=function findSeiNals(avcStream,samples,trackId){var avcView=new DataView(avcStream.buffer,avcStream.byteOffset,avcStream.byteLength),result=[],seiNal,i,length,lastMatchedSample;for(i=0;i+4<avcStream.length;i+=length){length=avcView.getUint32(i);i+=4;if(length<=0){continue;}
1715switch(avcStream[i]&0x1F){case 0x06:var data=avcStream.subarray(i+1,i+1+length);var matchingSample=mapToSample(i,samples);seiNal={nalUnitType:'sei_rbsp',size:length,data:data,escapedRBSP:discardEmulationPreventionBytes$1(data),trackId:trackId};if(matchingSample){seiNal.pts=matchingSample.pts;seiNal.dts=matchingSample.dts;lastMatchedSample=matchingSample;}else{seiNal.pts=lastMatchedSample.pts;seiNal.dts=lastMatchedSample.dts;}
1716result.push(seiNal);break;}}
1717return result;};var parseSamples=function parseSamples(truns,baseMediaDecodeTime,tfhd){var currentDts=baseMediaDecodeTime;var defaultSampleDuration=tfhd.defaultSampleDuration||0;var defaultSampleSize=tfhd.defaultSampleSize||0;var trackId=tfhd.trackId;var allSamples=[];truns.forEach(function(trun){var trackRun=mp4Inspector.parseTrun(trun);var samples=trackRun.samples;samples.forEach(function(sample){if(sample.duration===undefined){sample.duration=defaultSampleDuration;}
1718if(sample.size===undefined){sample.size=defaultSampleSize;}
1719sample.trackId=trackId;sample.dts=currentDts;if(sample.compositionTimeOffset===undefined){sample.compositionTimeOffset=0;}
1720sample.pts=currentDts+sample.compositionTimeOffset;currentDts+=sample.duration;});allSamples=allSamples.concat(samples);});return allSamples;};var parseCaptionNals=function parseCaptionNals(segment,videoTrackId){var trafs=probe.findBox(segment,['moof','traf']);var mdats=probe.findBox(segment,['mdat']);var captionNals={};var mdatTrafPairs=[];mdats.forEach(function(mdat,index){var matchingTraf=trafs[index];mdatTrafPairs.push({mdat:mdat,traf:matchingTraf});});mdatTrafPairs.forEach(function(pair){var mdat=pair.mdat;var traf=pair.traf;var tfhd=probe.findBox(traf,['tfhd']);var headerInfo=mp4Inspector.parseTfhd(tfhd[0]);var trackId=headerInfo.trackId;var tfdt=probe.findBox(traf,['tfdt']);var baseMediaDecodeTime=tfdt.length>0?mp4Inspector.parseTfdt(tfdt[0]).baseMediaDecodeTime:0;var truns=probe.findBox(traf,['trun']);var samples;var seiNals;if(videoTrackId===trackId&&truns.length>0){samples=parseSamples(truns,baseMediaDecodeTime,headerInfo);seiNals=findSeiNals(mdat,samples,trackId);if(!captionNals[trackId]){captionNals[trackId]=[];}
1721captionNals[trackId]=captionNals[trackId].concat(seiNals);}});return captionNals;};var parseEmbeddedCaptions=function parseEmbeddedCaptions(segment,trackId,timescale){var seiNals;if(trackId===null){return null;}
1722seiNals=parseCaptionNals(segment,trackId);return{seiNals:seiNals[trackId],timescale:timescale};};var CaptionParser=function CaptionParser(){var isInitialized=false;var captionStream;var segmentCache;var trackId;var timescale;var parsedCaptions;var parsingPartial;this.isInitialized=function(){return isInitialized;};this.init=function(options){captionStream=new CaptionStream$1();isInitialized=true;parsingPartial=options?options.isPartial:false;captionStream.on('data',function(event){event.startTime=event.startPts/timescale;event.endTime=event.endPts/timescale;parsedCaptions.captions.push(event);parsedCaptions.captionStreams[event.stream]=true;});};this.isNewInit=function(videoTrackIds,timescales){if(videoTrackIds&&videoTrackIds.length===0||timescales&&typeof timescales==='object'&&Object.keys(timescales).length===0){return false;}
1723return trackId!==videoTrackIds[0]||timescale!==timescales[trackId];};this.parse=function(segment,videoTrackIds,timescales){var parsedData;if(!this.isInitialized()){return null;}else if(!videoTrackIds||!timescales){return null;}else if(this.isNewInit(videoTrackIds,timescales)){trackId=videoTrackIds[0];timescale=timescales[trackId];}else if(trackId===null||!timescale){segmentCache.push(segment);return null;}
1724while(segmentCache.length>0){var cachedSegment=segmentCache.shift();this.parse(cachedSegment,videoTrackIds,timescales);}
1725parsedData=parseEmbeddedCaptions(segment,trackId,timescale);if(parsedData===null||!parsedData.seiNals){return null;}
1726this.pushNals(parsedData.seiNals);this.flushStream();return parsedCaptions;};this.pushNals=function(nals){if(!this.isInitialized()||!nals||nals.length===0){return null;}
vendor: 7,299 bytes, lines 1727-1752
1727nals.forEach(function(nal){captionStream.push(nal);});};this.flushStream=function(){if(!this.isInitialized()){return null;}
1728if(!parsingPartial){captionStream.flush();}else{captionStream.partialFlush();}};this.clearParsedCaptions=function(){parsedCaptions.captions=[];parsedCaptions.captionStreams={};};this.resetCaptionStream=function(){if(!this.isInitialized()){return null;}
1729captionStream.reset();};this.clearAllCaptions=function(){this.clearParsedCaptions();this.resetCaptionStream();};this.reset=function(){segmentCache=[];trackId=null;timescale=null;if(!parsedCaptions){parsedCaptions={captions:[],captionStreams:{}};}else{this.clearParsedCaptions();}
1730this.resetCaptionStream();};this.reset();};var captionParser=CaptionParser;var streamTypes={H264_STREAM_TYPE:0x1B,ADTS_STREAM_TYPE:0x0F,METADATA_STREAM_TYPE:0x15};var MAX_TS=8589934592;var RO_THRESH=4294967296;var TYPE_SHARED='shared';var handleRollover=function handleRollover(value,reference){var direction=1;if(value>reference){direction=-1;}
1731while(Math.abs(reference-value)>RO_THRESH){value+=direction*MAX_TS;}
1732return value;};var TimestampRolloverStream=function TimestampRolloverStream(type){var lastDTS,referenceDTS;TimestampRolloverStream.prototype.init.call(this);this.type_=type||TYPE_SHARED;this.push=function(data){if(this.type_!==TYPE_SHARED&&data.type!==this.type_){return;}
1733if(referenceDTS===undefined){referenceDTS=data.dts;}
1734data.dts=handleRollover(data.dts,referenceDTS);data.pts=handleRollover(data.pts,referenceDTS);lastDTS=data.dts;this.trigger('data',data);};this.flush=function(){referenceDTS=lastDTS;this.trigger('done');};this.endTimeline=function(){this.flush();this.trigger('endedtimeline');};this.discontinuity=function(){referenceDTS=void 0;lastDTS=void 0;};this.reset=function(){this.discontinuity();this.trigger('reset');};};TimestampRolloverStream.prototype=new stream();var timestampRolloverStream={TimestampRolloverStream:TimestampRolloverStream,handleRollover:handleRollover};var parsePid=function parsePid(packet){var pid=packet[1]&0x1f;pid<<=8;pid|=packet[2];return pid;};var parsePayloadUnitStartIndicator=function parsePayloadUnitStartIndicator(packet){return!!(packet[1]&0x40);};var parseAdaptionField=function parseAdaptionField(packet){var offset=0;if((packet[3]&0x30)>>>4>0x01){offset+=packet[4]+1;}
1735return offset;};var parseType$1=function parseType(packet,pmtPid){var pid=parsePid(packet);if(pid===0){return 'pat';}else if(pid===pmtPid){return 'pmt';}else if(pmtPid){return 'pes';}
1736return null;};var parsePat=function parsePat(packet){var pusi=parsePayloadUnitStartIndicator(packet);var offset=4+parseAdaptionField(packet);if(pusi){offset+=packet[offset]+1;}
1737return(packet[offset+10]&0x1f)<<8|packet[offset+11];};var parsePmt=function parsePmt(packet){var programMapTable={};var pusi=parsePayloadUnitStartIndicator(packet);var payloadOffset=4+parseAdaptionField(packet);if(pusi){payloadOffset+=packet[payloadOffset]+1;}
1738if(!(packet[payloadOffset+5]&0x01)){return;}
1739var sectionLength,tableEnd,programInfoLength;sectionLength=(packet[payloadOffset+1]&0x0f)<<8|packet[payloadOffset+2];tableEnd=3+sectionLength-4;programInfoLength=(packet[payloadOffset+10]&0x0f)<<8|packet[payloadOffset+11];var offset=12+programInfoLength;while(offset<tableEnd){var i=payloadOffset+offset;programMapTable[(packet[i+1]&0x1F)<<8|packet[i+2]]=packet[i];offset+=((packet[i+3]&0x0F)<<8|packet[i+4])+5;}
1740return programMapTable;};var parsePesType=function parsePesType(packet,programMapTable){var pid=parsePid(packet);var type=programMapTable[pid];switch(type){case streamTypes.H264_STREAM_TYPE:return 'video';case streamTypes.ADTS_STREAM_TYPE:return 'audio';case streamTypes.METADATA_STREAM_TYPE:return 'timed-metadata';default:return null;}};var parsePesTime=function parsePesTime(packet){var pusi=parsePayloadUnitStartIndicator(packet);if(!pusi){return null;}
1741var offset=4+parseAdaptionField(packet);if(offset>=packet.byteLength){return null;}
1742var pes=null;var ptsDtsFlags;ptsDtsFlags=packet[offset+7];if(ptsDtsFlags&0xC0){pes={};pes.pts=(packet[offset+9]&0x0E)<<27|(packet[offset+10]&0xFF)<<20|(packet[offset+11]&0xFE)<<12|(packet[offset+12]&0xFF)<<5|(packet[offset+13]&0xFE)>>>3;pes.pts*=4;pes.pts+=(packet[offset+13]&0x06)>>>1;pes.dts=pes.pts;if(ptsDtsFlags&0x40){pes.dts=(packet[offset+14]&0x0E)<<27|(packet[offset+15]&0xFF)<<20|(packet[offset+16]&0xFE)<<12|(packet[offset+17]&0xFF)<<5|(packet[offset+18]&0xFE)>>>3;pes.dts*=4;pes.dts+=(packet[offset+18]&0x06)>>>1;}}
1743return pes;};var parseNalUnitType=function parseNalUnitType(type){switch(type){case 0x05:return 'slice_layer_without_partitioning_rbsp_idr';case 0x06:return 'sei_rbsp';case 0x07:return 'seq_parameter_set_rbsp';case 0x08:return 'pic_parameter_set_rbsp';case 0x09:return 'access_unit_delimiter_rbsp';default:return null;}};var videoPacketContainsKeyFrame=function videoPacketContainsKeyFrame(packet){var offset=4+parseAdaptionField(packet);var frameBuffer=packet.subarray(offset);var frameI=0;var frameSyncPoint=0;var foundKeyFrame=false;var nalType;for(;frameSyncPoint<frameBuffer.byteLength-3;frameSyncPoint++){if(frameBuffer[frameSyncPoint+2]===1){frameI=frameSyncPoint+5;break;}}
1744while(frameI<frameBuffer.byteLength){switch(frameBuffer[frameI]){case 0:if(frameBuffer[frameI-1]!==0){frameI+=2;break;}else if(frameBuffer[frameI-2]!==0){frameI++;break;}
1745if(frameSyncPoint+3!==frameI-2){nalType=parseNalUnitType(frameBuffer[frameSyncPoint+3]&0x1f);if(nalType==='slice_layer_without_partitioning_rbsp_idr'){foundKeyFrame=true;}}
1746do{frameI++;}while(frameBuffer[frameI]!==1&&frameI<frameBuffer.length);frameSyncPoint=frameI-2;frameI+=3;break;case 1:if(frameBuffer[frameI-1]!==0||frameBuffer[frameI-2]!==0){frameI+=3;break;}
1747nalType=parseNalUnitType(frameBuffer[frameSyncPoint+3]&0x1f);if(nalType==='slice_layer_without_partitioning_rbsp_idr'){foundKeyFrame=true;}
1748frameSyncPoint=frameI-2;frameI+=3;break;default:frameI+=3;break;}}
1749frameBuffer=frameBuffer.subarray(frameSyncPoint);frameI-=frameSyncPoint;frameSyncPoint=0;if(frameBuffer&&frameBuffer.byteLength>3){nalType=parseNalUnitType(frameBuffer[frameSyncPoint+3]&0x1f);if(nalType==='slice_layer_without_partitioning_rbsp_idr'){foundKeyFrame=true;}}
1750return foundKeyFrame;};var probe$1={parseType:parseType$1,parsePat:parsePat,parsePmt:parsePmt,parsePayloadUnitStartIndicator:parsePayloadUnitStartIndicator,parsePesType:parsePesType,parsePesTime:parsePesTime,videoPacketContainsKeyFrame:videoPacketContainsKeyFrame};var ADTS_SAMPLING_FREQUENCIES=[96000,88200,64000,48000,44100,32000,24000,22050,16000,12000,11025,8000,7350];var isLikelyAacData=function isLikelyAacData(data){if(data[0]==='I'.charCodeAt(0)&&data[1]==='D'.charCodeAt(0)&&data[2]==='3'.charCodeAt(0)){return true;}
1751return false;};var parseSyncSafeInteger=function parseSyncSafeInteger(data){return data[0]<<21|data[1]<<14|data[2]<<7|data[3];};var percentEncode=function percentEncode(bytes,start,end){var i,result='';for(i=start;i<end;i++){result+='%'+('00'+bytes[i].toString(16)).slice(-2);}
1752return result;};var parseIso88591=function parseIso88591(bytes,start,end){return unescape(percentEncode(bytes,start,end));};var parseId3TagSize=function parseId3TagSize(header,byteIndex){var returnSize=header[byteIndex+6]<<21|header[byteIndex+7]<<14|header[byteIndex+8]<<7|header[byteIndex+9],flags=header[byteIndex+5],footerPresent=(flags&16)>>4;
vendor: 7,835 bytes, lines 1752-1787
1752if(footerPresent){return returnSize+20;}
1753return returnSize+10;};var parseAdtsSize=function parseAdtsSize(header,byteIndex){var lowThree=(header[byteIndex+5]&0xE0)>>5,middle=header[byteIndex+4]<<3,highTwo=header[byteIndex+3]&0x3<<11;return highTwo|middle|lowThree;};var parseType$2=function parseType(header,byteIndex){if(header[byteIndex]==='I'.charCodeAt(0)&&header[byteIndex+1]==='D'.charCodeAt(0)&&header[byteIndex+2]==='3'.charCodeAt(0)){return 'timed-metadata';}else if(header[byteIndex]&0xff===0xff&&(header[byteIndex+1]&0xf0)===0xf0){return 'audio';}
1754return null;};var parseSampleRate=function parseSampleRate(packet){var i=0;while(i+5<packet.length){if(packet[i]!==0xFF||(packet[i+1]&0xF6)!==0xF0){i++;continue;}
1755return ADTS_SAMPLING_FREQUENCIES[(packet[i+2]&0x3c)>>>2];}
1756return null;};var parseAacTimestamp=function parseAacTimestamp(packet){var frameStart,frameSize,frame,frameHeader;frameStart=10;if(packet[5]&0x40){frameStart+=4;frameStart+=parseSyncSafeInteger(packet.subarray(10,14));}
1757do{frameSize=parseSyncSafeInteger(packet.subarray(frameStart+4,frameStart+8));if(frameSize<1){return null;}
1758frameHeader=String.fromCharCode(packet[frameStart],packet[frameStart+1],packet[frameStart+2],packet[frameStart+3]);if(frameHeader==='PRIV'){frame=packet.subarray(frameStart+10,frameStart+frameSize+10);for(var i=0;i<frame.byteLength;i++){if(frame[i]===0){var owner=parseIso88591(frame,0,i);if(owner==='com.apple.streaming.transportStreamTimestamp'){var d=frame.subarray(i+1);var size=(d[3]&0x01)<<30|d[4]<<22|d[5]<<14|d[6]<<6|d[7]>>>2;size*=4;size+=d[7]&0x03;return size;}
1759break;}}}
1760frameStart+=10;frameStart+=frameSize;}while(frameStart<packet.byteLength);return null;};var utils={isLikelyAacData:isLikelyAacData,parseId3TagSize:parseId3TagSize,parseAdtsSize:parseAdtsSize,parseType:parseType$2,parseSampleRate:parseSampleRate,parseAacTimestamp:parseAacTimestamp};var ONE_SECOND_IN_TS=90000,secondsToVideoTs,secondsToAudioTs,videoTsToSeconds,audioTsToSeconds,audioTsToVideoTs,videoTsToAudioTs,metadataTsToSeconds;secondsToVideoTs=function secondsToVideoTs(seconds){return seconds*ONE_SECOND_IN_TS;};secondsToAudioTs=function secondsToAudioTs(seconds,sampleRate){return seconds*sampleRate;};videoTsToSeconds=function videoTsToSeconds(timestamp){return timestamp/ONE_SECOND_IN_TS;};audioTsToSeconds=function audioTsToSeconds(timestamp,sampleRate){return timestamp/sampleRate;};audioTsToVideoTs=function audioTsToVideoTs(timestamp,sampleRate){return secondsToVideoTs(audioTsToSeconds(timestamp,sampleRate));};videoTsToAudioTs=function videoTsToAudioTs(timestamp,sampleRate){return secondsToAudioTs(videoTsToSeconds(timestamp),sampleRate);};metadataTsToSeconds=function metadataTsToSeconds(timestamp,timelineStartPts,keepOriginalTimestamps){return videoTsToSeconds(keepOriginalTimestamps?timestamp:timestamp-timelineStartPts);};var clock={ONE_SECOND_IN_TS:ONE_SECOND_IN_TS,secondsToVideoTs:secondsToVideoTs,secondsToAudioTs:secondsToAudioTs,videoTsToSeconds:videoTsToSeconds,audioTsToSeconds:audioTsToSeconds,audioTsToVideoTs:audioTsToVideoTs,videoTsToAudioTs:videoTsToAudioTs,metadataTsToSeconds:metadataTsToSeconds};var handleRollover$1=timestampRolloverStream.handleRollover;var probe$2={};probe$2.ts=probe$1;probe$2.aac=utils;var ONE_SECOND_IN_TS$1=clock.ONE_SECOND_IN_TS;var MP2T_PACKET_LENGTH=188,SYNC_BYTE=0x47;var parsePsi_=function parsePsi_(bytes,pmt){var startIndex=0,endIndex=MP2T_PACKET_LENGTH,packet,type;while(endIndex<bytes.byteLength){if(bytes[startIndex]===SYNC_BYTE&&bytes[endIndex]===SYNC_BYTE){packet=bytes.subarray(startIndex,endIndex);type=probe$2.ts.parseType(packet,pmt.pid);switch(type){case 'pat':if(!pmt.pid){pmt.pid=probe$2.ts.parsePat(packet);}
1761break;case 'pmt':if(!pmt.table){pmt.table=probe$2.ts.parsePmt(packet);}
1762break;}
1763if(pmt.pid&&pmt.table){return;}
1764startIndex+=MP2T_PACKET_LENGTH;endIndex+=MP2T_PACKET_LENGTH;continue;}
1765startIndex++;endIndex++;}};var parseAudioPes_=function parseAudioPes_(bytes,pmt,result){var startIndex=0,endIndex=MP2T_PACKET_LENGTH,packet,type,pesType,pusi,parsed;var endLoop=false;while(endIndex<=bytes.byteLength){if(bytes[startIndex]===SYNC_BYTE&&(bytes[endIndex]===SYNC_BYTE||endIndex===bytes.byteLength)){packet=bytes.subarray(startIndex,endIndex);type=probe$2.ts.parseType(packet,pmt.pid);switch(type){case 'pes':pesType=probe$2.ts.parsePesType(packet,pmt.table);pusi=probe$2.ts.parsePayloadUnitStartIndicator(packet);if(pesType==='audio'&&pusi){parsed=probe$2.ts.parsePesTime(packet);if(parsed){parsed.type='audio';result.audio.push(parsed);endLoop=true;}}
1766break;}
1767if(endLoop){break;}
1768startIndex+=MP2T_PACKET_LENGTH;endIndex+=MP2T_PACKET_LENGTH;continue;}
1769startIndex++;endIndex++;}
1770endIndex=bytes.byteLength;startIndex=endIndex-MP2T_PACKET_LENGTH;endLoop=false;while(startIndex>=0){if(bytes[startIndex]===SYNC_BYTE&&(bytes[endIndex]===SYNC_BYTE||endIndex===bytes.byteLength)){packet=bytes.subarray(startIndex,endIndex);type=probe$2.ts.parseType(packet,pmt.pid);switch(type){case 'pes':pesType=probe$2.ts.parsePesType(packet,pmt.table);pusi=probe$2.ts.parsePayloadUnitStartIndicator(packet);if(pesType==='audio'&&pusi){parsed=probe$2.ts.parsePesTime(packet);if(parsed){parsed.type='audio';result.audio.push(parsed);endLoop=true;}}
1771break;}
1772if(endLoop){break;}
1773startIndex-=MP2T_PACKET_LENGTH;endIndex-=MP2T_PACKET_LENGTH;continue;}
1774startIndex--;endIndex--;}};var parseVideoPes_=function parseVideoPes_(bytes,pmt,result){var startIndex=0,endIndex=MP2T_PACKET_LENGTH,packet,type,pesType,pusi,parsed,frame,i,pes;var endLoop=false;var currentFrame={data:[],size:0};while(endIndex<bytes.byteLength){if(bytes[startIndex]===SYNC_BYTE&&bytes[endIndex]===SYNC_BYTE){packet=bytes.subarray(startIndex,endIndex);type=probe$2.ts.parseType(packet,pmt.pid);switch(type){case 'pes':pesType=probe$2.ts.parsePesType(packet,pmt.table);pusi=probe$2.ts.parsePayloadUnitStartIndicator(packet);if(pesType==='video'){if(pusi&&!endLoop){parsed=probe$2.ts.parsePesTime(packet);if(parsed){parsed.type='video';result.video.push(parsed);endLoop=true;}}
1775if(!result.firstKeyFrame){if(pusi){if(currentFrame.size!==0){frame=new Uint8Array(currentFrame.size);i=0;while(currentFrame.data.length){pes=currentFrame.data.shift();frame.set(pes,i);i+=pes.byteLength;}
1776if(probe$2.ts.videoPacketContainsKeyFrame(frame)){var firstKeyFrame=probe$2.ts.parsePesTime(frame);if(firstKeyFrame){result.firstKeyFrame=firstKeyFrame;result.firstKeyFrame.type='video';}else{console.warn('Failed to extract PTS/DTS from PES at first keyframe. '+'This could be an unusual TS segment, or else mux.js did not '+'parse your TS segment correctly. If you know your TS '+'segments do contain PTS/DTS on keyframes please file a bug '+'report! You can try ffprobe to double check for yourself.');}}
1777currentFrame.size=0;}}
1778currentFrame.data.push(packet);currentFrame.size+=packet.byteLength;}}
1779break;}
1780if(endLoop&&result.firstKeyFrame){break;}
1781startIndex+=MP2T_PACKET_LENGTH;endIndex+=MP2T_PACKET_LENGTH;continue;}
1782startIndex++;endIndex++;}
1783endIndex=bytes.byteLength;startIndex=endIndex-MP2T_PACKET_LENGTH;endLoop=false;while(startIndex>=0){if(bytes[startIndex]===SYNC_BYTE&&bytes[endIndex]===SYNC_BYTE){packet=bytes.subarray(startIndex,endIndex);type=probe$2.ts.parseType(packet,pmt.pid);switch(type){case 'pes':pesType=probe$2.ts.parsePesType(packet,pmt.table);pusi=probe$2.ts.parsePayloadUnitStartIndicator(packet);if(pesType==='video'&&pusi){parsed=probe$2.ts.parsePesTime(packet);if(parsed){parsed.type='video';result.video.push(parsed);endLoop=true;}}
1784break;}
1785if(endLoop){break;}
1786startIndex-=MP2T_PACKET_LENGTH;endIndex-=MP2T_PACKET_LENGTH;continue;}
1787startIndex--;endIndex--;}};var adjustTimestamp_=function adjustTimestamp_(segmentInfo,baseTimestamp){if(segmentInfo.audio&&segmentInfo.audio.length){var audioBaseTimestamp=baseTimestamp;if(typeof audioBaseTimestamp==='undefined'){audioBaseTimestamp=segmentInfo.audio[0].dts;}
vendor: 35,529 bytes, lines 1788-1918
1788segmentInfo.audio.forEach(function(info){info.dts=handleRollover$1(info.dts,audioBaseTimestamp);info.pts=handleRollover$1(info.pts,audioBaseTimestamp);info.dtsTime=info.dts/ONE_SECOND_IN_TS$1;info.ptsTime=info.pts/ONE_SECOND_IN_TS$1;});}
1789if(segmentInfo.video&&segmentInfo.video.length){var videoBaseTimestamp=baseTimestamp;if(typeof videoBaseTimestamp==='undefined'){videoBaseTimestamp=segmentInfo.video[0].dts;}
1790segmentInfo.video.forEach(function(info){info.dts=handleRollover$1(info.dts,videoBaseTimestamp);info.pts=handleRollover$1(info.pts,videoBaseTimestamp);info.dtsTime=info.dts/ONE_SECOND_IN_TS$1;info.ptsTime=info.pts/ONE_SECOND_IN_TS$1;});if(segmentInfo.firstKeyFrame){var frame=segmentInfo.firstKeyFrame;frame.dts=handleRollover$1(frame.dts,videoBaseTimestamp);frame.pts=handleRollover$1(frame.pts,videoBaseTimestamp);frame.dtsTime=frame.dts/ONE_SECOND_IN_TS$1;frame.ptsTime=frame.dts/ONE_SECOND_IN_TS$1;}}};var inspectAac_=function inspectAac_(bytes){var endLoop=false,audioCount=0,sampleRate=null,timestamp=null,frameSize=0,byteIndex=0,packet;while(bytes.length-byteIndex>=3){var type=probe$2.aac.parseType(bytes,byteIndex);switch(type){case 'timed-metadata':if(bytes.length-byteIndex<10){endLoop=true;break;}
1791frameSize=probe$2.aac.parseId3TagSize(bytes,byteIndex);if(frameSize>bytes.length){endLoop=true;break;}
1792if(timestamp===null){packet=bytes.subarray(byteIndex,byteIndex+frameSize);timestamp=probe$2.aac.parseAacTimestamp(packet);}
1793byteIndex+=frameSize;break;case 'audio':if(bytes.length-byteIndex<7){endLoop=true;break;}
1794frameSize=probe$2.aac.parseAdtsSize(bytes,byteIndex);if(frameSize>bytes.length){endLoop=true;break;}
1795if(sampleRate===null){packet=bytes.subarray(byteIndex,byteIndex+frameSize);sampleRate=probe$2.aac.parseSampleRate(packet);}
1796audioCount++;byteIndex+=frameSize;break;default:byteIndex++;break;}
1797if(endLoop){return null;}}
1798if(sampleRate===null||timestamp===null){return null;}
1799var audioTimescale=ONE_SECOND_IN_TS$1/sampleRate;var result={audio:[{type:'audio',dts:timestamp,pts:timestamp},{type:'audio',dts:timestamp+audioCount*1024*audioTimescale,pts:timestamp+audioCount*1024*audioTimescale}]};return result;};var inspectTs_=function inspectTs_(bytes){var pmt={pid:null,table:null};var result={};parsePsi_(bytes,pmt);for(var pid in pmt.table){if(pmt.table.hasOwnProperty(pid)){var type=pmt.table[pid];switch(type){case streamTypes.H264_STREAM_TYPE:result.video=[];parseVideoPes_(bytes,pmt,result);if(result.video.length===0){delete result.video;}
1800break;case streamTypes.ADTS_STREAM_TYPE:result.audio=[];parseAudioPes_(bytes,pmt,result);if(result.audio.length===0){delete result.audio;}
1801break;}}}
1802return result;};var inspect=function inspect(bytes,baseTimestamp){var isAacData=probe$2.aac.isLikelyAacData(bytes);var result;if(isAacData){result=inspectAac_(bytes);}else{result=inspectTs_(bytes);}
1803if(!result||!result.audio&&!result.video){return null;}
1804adjustTimestamp_(result,baseTimestamp);return result;};var tsInspector={inspect:inspect,parseAudioPes_:parseAudioPes_};function unpad(padded){return padded.subarray(0,padded.byteLength-padded[padded.byteLength-1]);}
1805var classCallCheck=function classCallCheck(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||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}
1806return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();var inherits$1=function inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}
1807subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;};var possibleConstructorReturn=function possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}
1808return call&&(typeof call==="object"||typeof call==="function")?call:self;};var precompute=function precompute(){var tables=[[[],[],[],[],[]],[[],[],[],[],[]]];var encTable=tables[0];var decTable=tables[1];var sbox=encTable[4];var sboxInv=decTable[4];var i=void 0;var x=void 0;var xInv=void 0;var d=[];var th=[];var x2=void 0;var x4=void 0;var x8=void 0;var s=void 0;var tEnc=void 0;var tDec=void 0;for(i=0;i<256;i++){th[(d[i]=i<<1^(i>>7)*283)^i]=i;}
1809for(x=xInv=0;!sbox[x];x^=x2||1,xInv=th[xInv]||1){s=xInv^xInv<<1^xInv<<2^xInv<<3^xInv<<4;s=s>>8^s&255^99;sbox[x]=s;sboxInv[s]=x;x8=d[x4=d[x2=d[x]]];tDec=x8*0x1010101^x4*0x10001^x2*0x101^x*0x1010100;tEnc=d[s]*0x101^s*0x1010100;for(i=0;i<4;i++){encTable[i][x]=tEnc=tEnc<<24^tEnc>>>8;decTable[i][s]=tDec=tDec<<24^tDec>>>8;}}
1810for(i=0;i<5;i++){encTable[i]=encTable[i].slice(0);decTable[i]=decTable[i].slice(0);}
1811return tables;};var aesTables=null;var AES=function(){function AES(key){classCallCheck(this,AES);if(!aesTables){aesTables=precompute();}
1812this._tables=[[aesTables[0][0].slice(),aesTables[0][1].slice(),aesTables[0][2].slice(),aesTables[0][3].slice(),aesTables[0][4].slice()],[aesTables[1][0].slice(),aesTables[1][1].slice(),aesTables[1][2].slice(),aesTables[1][3].slice(),aesTables[1][4].slice()]];var i=void 0;var j=void 0;var tmp=void 0;var encKey=void 0;var decKey=void 0;var sbox=this._tables[0][4];var decTable=this._tables[1];var keyLen=key.length;var rcon=1;if(keyLen!==4&&keyLen!==6&&keyLen!==8){throw new Error('Invalid aes key size');}
1813encKey=key.slice(0);decKey=[];this._key=[encKey,decKey];for(i=keyLen;i<4*keyLen+28;i++){tmp=encKey[i-1];if(i%keyLen===0||keyLen===8&&i%keyLen===4){tmp=sbox[tmp>>>24]<<24^sbox[tmp>>16&255]<<16^sbox[tmp>>8&255]<<8^sbox[tmp&255];if(i%keyLen===0){tmp=tmp<<8^tmp>>>24^rcon<<24;rcon=rcon<<1^(rcon>>7)*283;}}
1814encKey[i]=encKey[i-keyLen]^tmp;}
1815for(j=0;i;j++,i--){tmp=encKey[j&3?i:i-4];if(i<=4||j<4){decKey[j]=tmp;}else{decKey[j]=decTable[0][sbox[tmp>>>24]]^decTable[1][sbox[tmp>>16&255]]^decTable[2][sbox[tmp>>8&255]]^decTable[3][sbox[tmp&255]];}}}
1816AES.prototype.decrypt=function decrypt(encrypted0,encrypted1,encrypted2,encrypted3,out,offset){var key=this._key[1];var a=encrypted0^key[0];var b=encrypted3^key[1];var c=encrypted2^key[2];var d=encrypted1^key[3];var a2=void 0;var b2=void 0;var c2=void 0;var nInnerRounds=key.length/4-2;var i=void 0;var kIndex=4;var table=this._tables[1];var table0=table[0];var table1=table[1];var table2=table[2];var table3=table[3];var sbox=table[4];for(i=0;i<nInnerRounds;i++){a2=table0[a>>>24]^table1[b>>16&255]^table2[c>>8&255]^table3[d&255]^key[kIndex];b2=table0[b>>>24]^table1[c>>16&255]^table2[d>>8&255]^table3[a&255]^key[kIndex+1];c2=table0[c>>>24]^table1[d>>16&255]^table2[a>>8&255]^table3[b&255]^key[kIndex+2];d=table0[d>>>24]^table1[a>>16&255]^table2[b>>8&255]^table3[c&255]^key[kIndex+3];kIndex+=4;a=a2;b=b2;c=c2;}
1817for(i=0;i<4;i++){out[(3&-i)+offset]=sbox[a>>>24]<<24^sbox[b>>16&255]<<16^sbox[c>>8&255]<<8^sbox[d&255]^key[kIndex++];a2=a;a=b;b=c;c=d;d=a2;}};return AES;}();var Stream$2=function(){function Stream(){classCallCheck(this,Stream);this.listeners={};}
1818Stream.prototype.on=function on(type,listener){if(!this.listeners[type]){this.listeners[type]=[];}
1819this.listeners[type].push(listener);};Stream.prototype.off=function off(type,listener){if(!this.listeners[type]){return false;}
1820var index=this.listeners[type].indexOf(listener);this.listeners[type].splice(index,1);return index>-1;};Stream.prototype.trigger=function trigger(type){var callbacks=this.listeners[type];if(!callbacks){return;}
1821if(arguments.length===2){var length=callbacks.length;for(var i=0;i<length;++i){callbacks[i].call(this,arguments[1]);}}else{var args=Array.prototype.slice.call(arguments,1);var _length=callbacks.length;for(var _i=0;_i<_length;++_i){callbacks[_i].apply(this,args);}}};Stream.prototype.dispose=function dispose(){this.listeners={};};Stream.prototype.pipe=function pipe(destination){this.on('data',function(data){destination.push(data);});};return Stream;}();var AsyncStream=function(_Stream){inherits$1(AsyncStream,_Stream);function AsyncStream(){classCallCheck(this,AsyncStream);var _this=possibleConstructorReturn(this,_Stream.call(this,Stream$2));_this.jobs=[];_this.delay=1;_this.timeout_=null;return _this;}
1822AsyncStream.prototype.processJob_=function processJob_(){this.jobs.shift()();if(this.jobs.length){this.timeout_=setTimeout(this.processJob_.bind(this),this.delay);}else{this.timeout_=null;}};AsyncStream.prototype.push=function push(job){this.jobs.push(job);if(!this.timeout_){this.timeout_=setTimeout(this.processJob_.bind(this),this.delay);}};return AsyncStream;}(Stream$2);var ntoh=function ntoh(word){return word<<24|(word&0xff00)<<8|(word&0xff0000)>>8|word>>>24;};var decrypt=function decrypt(encrypted,key,initVector){var encrypted32=new Int32Array(encrypted.buffer,encrypted.byteOffset,encrypted.byteLength>>2);var decipher=new AES(Array.prototype.slice.call(key));var decrypted=new Uint8Array(encrypted.byteLength);var decrypted32=new Int32Array(decrypted.buffer);var init0=void 0;var init1=void 0;var init2=void 0;var init3=void 0;var encrypted0=void 0;var encrypted1=void 0;var encrypted2=void 0;var encrypted3=void 0;var wordIx=void 0;init0=initVector[0];init1=initVector[1];init2=initVector[2];init3=initVector[3];for(wordIx=0;wordIx<encrypted32.length;wordIx+=4){encrypted0=ntoh(encrypted32[wordIx]);encrypted1=ntoh(encrypted32[wordIx+1]);encrypted2=ntoh(encrypted32[wordIx+2]);encrypted3=ntoh(encrypted32[wordIx+3]);decipher.decrypt(encrypted0,encrypted1,encrypted2,encrypted3,decrypted32,wordIx);decrypted32[wordIx]=ntoh(decrypted32[wordIx]^init0);decrypted32[wordIx+1]=ntoh(decrypted32[wordIx+1]^init1);decrypted32[wordIx+2]=ntoh(decrypted32[wordIx+2]^init2);decrypted32[wordIx+3]=ntoh(decrypted32[wordIx+3]^init3);init0=encrypted0;init1=encrypted1;init2=encrypted2;init3=encrypted3;}
1823return decrypted;};var Decrypter=function(){function Decrypter(encrypted,key,initVector,done){classCallCheck(this,Decrypter);var step=Decrypter.STEP;var encrypted32=new Int32Array(encrypted.buffer);var decrypted=new Uint8Array(encrypted.byteLength);var i=0;this.asyncStream_=new AsyncStream();this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i,i+step),key,initVector,decrypted));for(i=step;i<encrypted32.length;i+=step){initVector=new Uint32Array([ntoh(encrypted32[i-4]),ntoh(encrypted32[i-3]),ntoh(encrypted32[i-2]),ntoh(encrypted32[i-1])]);this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i,i+step),key,initVector,decrypted));}
1824this.asyncStream_.push(function(){done(null,unpad(decrypted));});}
1825Decrypter.prototype.decryptChunk_=function decryptChunk_(encrypted,key,initVector,decrypted){return function(){var bytes=decrypt(encrypted,key,initVector);decrypted.set(bytes,encrypted.byteOffset);};};createClass(Decrypter,null,[{key:'STEP',get:function get$$1(){return 32000;}}]);return Decrypter;}();var resolveUrl$1=function resolveUrl(baseURL,relativeURL){if(/^[a-z]+:/i.test(relativeURL)){return relativeURL;}
1826if(!/\/\//i.test(baseURL)){baseURL=urlToolkit.buildAbsoluteURL(window$3.location.href,baseURL);}
1827return urlToolkit.buildAbsoluteURL(baseURL,relativeURL);};var resolveManifestRedirect=function resolveManifestRedirect(handleManifestRedirect,url,req){if(handleManifestRedirect&&req.responseURL&&url!==req.responseURL){return req.responseURL;}
1828return url;};var classCallCheck$1=function classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}};var createClass$1=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}
1829return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();var get$1=function get(object,property,receiver){if(object===null)object=Function.prototype;var desc=Object.getOwnPropertyDescriptor(object,property);if(desc===undefined){var parent=Object.getPrototypeOf(object);if(parent===null){return undefined;}else{return get(parent,property,receiver);}}else if("value"in desc){return desc.value;}else{var getter=desc.get;if(getter===undefined){return undefined;}
1830return getter.call(receiver);}};var inherits$2=function inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}
1831subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;};var possibleConstructorReturn$1=function possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}
1832return call&&(typeof call==="object"||typeof call==="function")?call:self;};var slicedToArray=function(){function sliceIterator(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"])_i["return"]();}finally{if(_d)throw _e;}}
1833return _arr;}
1834return function(arr,i){if(Array.isArray(arr)){return arr;}else if(Symbol.iterator in Object(arr)){return sliceIterator(arr,i);}else{throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();var mergeOptions$1=videojs$1.mergeOptions,EventTarget$1=videojs$1.EventTarget,log$1=videojs$1.log;var forEachMediaGroup=function forEachMediaGroup(master,callback){['AUDIO','SUBTITLES'].forEach(function(mediaType){for(var groupKey in master.mediaGroups[mediaType]){for(var labelKey in master.mediaGroups[mediaType][groupKey]){var mediaProperties=master.mediaGroups[mediaType][groupKey][labelKey];callback(mediaProperties,mediaType,groupKey,labelKey);}}});};var updateSegments=function updateSegments(original,update,offset){var result=update.slice();offset=offset||0;var length=Math.min(original.length,update.length+offset);for(var i=offset;i<length;i++){result[i-offset]=mergeOptions$1(original[i],result[i-offset]);}
1835return result;};var resolveSegmentUris=function resolveSegmentUris(segment,baseUri){if(!segment.resolvedUri){segment.resolvedUri=resolveUrl$1(baseUri,segment.uri);}
1836if(segment.key&&!segment.key.resolvedUri){segment.key.resolvedUri=resolveUrl$1(baseUri,segment.key.uri);}
1837if(segment.map&&!segment.map.resolvedUri){segment.map.resolvedUri=resolveUrl$1(baseUri,segment.map.uri);}};var updateMaster=function updateMaster(master,media){var result=mergeOptions$1(master,{});var playlist=result.playlists[media.id];if(!playlist){return null;}
1838if(playlist.segments&&media.segments&&playlist.segments.length===media.segments.length&&playlist.endList===media.endList&&playlist.mediaSequence===media.mediaSequence){return null;}
1839var mergedPlaylist=mergeOptions$1(playlist,media);if(playlist.segments){mergedPlaylist.segments=updateSegments(playlist.segments,media.segments,media.mediaSequence-playlist.mediaSequence);}
1840mergedPlaylist.segments.forEach(function(segment){resolveSegmentUris(segment,mergedPlaylist.resolvedUri);});for(var i=0;i<result.playlists.length;i++){if(result.playlists[i].id===media.id){result.playlists[i]=mergedPlaylist;}}
1841result.playlists[media.id]=mergedPlaylist;result.playlists[media.uri]=mergedPlaylist;return result;};var createPlaylistID=function createPlaylistID(index,uri){return index+'-'+uri;};var setupMediaPlaylists=function setupMediaPlaylists(master){var i=master.playlists.length;while(i--){var playlist=master.playlists[i];playlist.resolvedUri=resolveUrl$1(master.uri,playlist.uri);playlist.id=createPlaylistID(i,playlist.uri);master.playlists[playlist.id]=playlist;master.playlists[playlist.uri]=playlist;if(!playlist.attributes){playlist.attributes={};log$1.warn('Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.');}}};var resolveMediaGroupUris=function resolveMediaGroupUris(master){forEachMediaGroup(master,function(properties){if(properties.uri){properties.resolvedUri=resolveUrl$1(master.uri,properties.uri);}});};var refreshDelay=function refreshDelay(media,update){var lastSegment=media.segments[media.segments.length-1];var delay=void 0;if(update&&lastSegment&&lastSegment.duration){delay=lastSegment.duration*1000;}else{delay=(media.targetDuration||10)*500;}
1842return delay;};var PlaylistLoader=function(_EventTarget){inherits$2(PlaylistLoader,_EventTarget);function PlaylistLoader(srcUrl,hls){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};classCallCheck$1(this,PlaylistLoader);var _this=possibleConstructorReturn$1(this,(PlaylistLoader.__proto__||Object.getPrototypeOf(PlaylistLoader)).call(this));var _options$withCredenti=options.withCredentials,withCredentials=_options$withCredenti===undefined?false:_options$withCredenti,_options$handleManife=options.handleManifestRedirects,handleManifestRedirects=_options$handleManife===undefined?false:_options$handleManife;_this.srcUrl=srcUrl;_this.hls_=hls;_this.withCredentials=withCredentials;_this.handleManifestRedirects=handleManifestRedirects;var hlsOptions=hls.options_;_this.customTagParsers=hlsOptions&&hlsOptions.customTagParsers||[];_this.customTagMappers=hlsOptions&&hlsOptions.customTagMappers||[];if(!_this.srcUrl){throw new Error('A non-empty playlist URL is required');}
1843_this.state='HAVE_NOTHING';_this.on('mediaupdatetimeout',function(){if(_this.state!=='HAVE_METADATA'){return;}
1844_this.state='HAVE_CURRENT_METADATA';_this.request=_this.hls_.xhr({uri:resolveUrl$1(_this.master.uri,_this.media().uri),withCredentials:_this.withCredentials},function(error,req){if(!_this.request){return;}
1845if(error){return _this.playlistRequestError(_this.request,_this.media(),'HAVE_METADATA');}
1846_this.haveMetadata(_this.request,_this.media().uri,_this.media().id);});});return _this;}
1847createClass$1(PlaylistLoader,[{key:'playlistRequestError',value:function playlistRequestError(xhr,playlist,startingState){var uri=playlist.uri,id=playlist.id;this.request=null;if(startingState){this.state=startingState;}
1848this.error={playlist:this.master.playlists[id],status:xhr.status,message:'HLS playlist request error at URL: '+uri+'.',responseText:xhr.responseText,code:xhr.status>=500?4:2};this.trigger('error');}},{key:'haveMetadata',value:function haveMetadata(xhr,url,id){var _this2=this;this.request=null;this.state='HAVE_METADATA';var parser=new Parser();this.customTagParsers.forEach(function(customParser){return parser.addParser(customParser);});this.customTagMappers.forEach(function(mapper){return parser.addTagMapper(mapper);});parser.push(xhr.responseText);parser.end();parser.manifest.uri=url;parser.manifest.id=id;parser.manifest.attributes=parser.manifest.attributes||{};var update=updateMaster(this.master,parser.manifest);this.targetDuration=parser.manifest.targetDuration;if(update){this.master=update;this.media_=this.master.playlists[id];}else{this.trigger('playlistunchanged');}
1849if(!this.media().endList){window$3.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=window$3.setTimeout(function(){_this2.trigger('mediaupdatetimeout');},refreshDelay(this.media(),!!update));}
1850this.trigger('loadedplaylist');}},{key:'dispose',value:function dispose(){this.trigger('dispose');this.stopRequest();window$3.clearTimeout(this.mediaUpdateTimeout);window$3.clearTimeout(this.finalRenditionTimeout);this.off();}},{key:'stopRequest',value:function stopRequest(){if(this.request){var oldRequest=this.request;this.request=null;oldRequest.onreadystatechange=null;oldRequest.abort();}}},{key:'media',value:function media(playlist,isFinalRendition){var _this3=this;if(!playlist){return this.media_;}
1851if(this.state==='HAVE_NOTHING'){throw new Error('Cannot switch media playlist from '+this.state);}
1852if(typeof playlist==='string'){if(!this.master.playlists[playlist]){throw new Error('Unknown playlist URI: '+playlist);}
1853playlist=this.master.playlists[playlist];}
1854window$3.clearTimeout(this.finalRenditionTimeout);if(isFinalRendition){var delay=playlist.targetDuration/2*1000||5*1000;this.finalRenditionTimeout=window$3.setTimeout(this.media.bind(this,playlist,false),delay);return;}
1855var startingState=this.state;var mediaChange=!this.media_||playlist.id!==this.media_.id;if(this.master.playlists[playlist.id].endList){if(this.request){this.request.onreadystatechange=null;this.request.abort();this.request=null;}
1856this.state='HAVE_METADATA';this.media_=playlist;if(mediaChange){this.trigger('mediachanging');this.trigger('mediachange');}
1857return;}
1858if(!mediaChange){return;}
1859this.state='SWITCHING_MEDIA';if(this.request){if(playlist.resolvedUri===this.request.url){return;}
1860this.request.onreadystatechange=null;this.request.abort();this.request=null;}
1861if(this.media_){this.trigger('mediachanging');}
1862this.request=this.hls_.xhr({uri:playlist.resolvedUri,withCredentials:this.withCredentials},function(error,req){if(!_this3.request){return;}
1863playlist.resolvedUri=resolveManifestRedirect(_this3.handleManifestRedirects,playlist.resolvedUri,req);if(error){return _this3.playlistRequestError(_this3.request,playlist,startingState);}
1864_this3.haveMetadata(req,playlist.uri,playlist.id);if(startingState==='HAVE_MASTER'){_this3.trigger('loadedmetadata');}else{_this3.trigger('mediachange');}});}},{key:'pause',value:function pause(){this.stopRequest();window$3.clearTimeout(this.mediaUpdateTimeout);if(this.state==='HAVE_NOTHING'){this.started=false;}
1865if(this.state==='SWITCHING_MEDIA'){if(this.media_){this.state='HAVE_METADATA';}else{this.state='HAVE_MASTER';}}else if(this.state==='HAVE_CURRENT_METADATA'){this.state='HAVE_METADATA';}}},{key:'load',value:function load(isFinalRendition){var _this4=this;window$3.clearTimeout(this.mediaUpdateTimeout);var media=this.media();if(isFinalRendition){var delay=media?media.targetDuration/2*1000:5*1000;this.mediaUpdateTimeout=window$3.setTimeout(function(){return _this4.load();},delay);return;}
1866if(!this.started){this.start();return;}
1867if(media&&!media.endList){this.trigger('mediaupdatetimeout');}else{this.trigger('loadedplaylist');}}},{key:'start',value:function start(){var _this5=this;this.started=true;this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},function(error,req){if(!_this5.request){return;}
1868_this5.request=null;if(error){_this5.error={status:req.status,message:'HLS playlist request error at URL: '+_this5.srcUrl+'.',responseText:req.responseText,code:2};if(_this5.state==='HAVE_NOTHING'){_this5.started=false;}
1869return _this5.trigger('error');}
1870var parser=new Parser();_this5.customTagParsers.forEach(function(customParser){return parser.addParser(customParser);});_this5.customTagMappers.forEach(function(mapper){return parser.addTagMapper(mapper);});parser.push(req.responseText);parser.end();_this5.state='HAVE_MASTER';_this5.srcUrl=resolveManifestRedirect(_this5.handleManifestRedirects,_this5.srcUrl,req);parser.manifest.uri=_this5.srcUrl;if(parser.manifest.playlists){_this5.master=parser.manifest;setupMediaPlaylists(_this5.master);resolveMediaGroupUris(_this5.master);_this5.trigger('loadedplaylist');if(!_this5.request){_this5.media(parser.manifest.playlists[0]);}
1871return;}
1872var id=createPlaylistID(0,_this5.srcUrl);_this5.master={mediaGroups:{'AUDIO':{},'VIDEO':{},'CLOSED-CAPTIONS':{},'SUBTITLES':{}},uri:window$3.location.href,playlists:[{uri:_this5.srcUrl,id:id,resolvedUri:_this5.srcUrl,attributes:{}}]};_this5.master.playlists[id]=_this5.master.playlists[0];_this5.master.playlists[_this5.srcUrl]=_this5.master.playlists[0];_this5.haveMetadata(req,_this5.srcUrl,id);return _this5.trigger('loadedmetadata');});}}]);return PlaylistLoader;}(EventTarget$1);var createTimeRange=videojs$1.createTimeRange;var backwardDuration=function backwardDuration(playlist,endSequence){var result=0;var i=endSequence-playlist.mediaSequence;var segment=playlist.segments[i];if(segment){if(typeof segment.start!=='undefined'){return{result:segment.start,precise:true};}
1873if(typeof segment.end!=='undefined'){return{result:segment.end-segment.duration,precise:true};}}
1874while(i--){segment=playlist.segments[i];if(typeof segment.end!=='undefined'){return{result:result+segment.end,precise:true};}
1875result+=segment.duration;if(typeof segment.start!=='undefined'){return{result:result+segment.start,precise:true};}}
1876return{result:result,precise:false};};var forwardDuration=function forwardDuration(playlist,endSequence){var result=0;var segment=void 0;var i=endSequence-playlist.mediaSequence;for(;i<playlist.segments.length;i++){segment=playlist.segments[i];if(typeof segment.start!=='undefined'){return{result:segment.start-result,precise:true};}
1877result+=segment.duration;if(typeof segment.end!=='undefined'){return{result:segment.end-result,precise:true};}}
1878return{result:-1,precise:false};};var intervalDuration=function intervalDuration(playlist,endSequence,expired){var backward=void 0;var forward=void 0;if(typeof endSequence==='undefined'){endSequence=playlist.mediaSequence+playlist.segments.length;}
1879if(endSequence<playlist.mediaSequence){return 0;}
1880backward=backwardDuration(playlist,endSequence);if(backward.precise){return backward.result;}
1881forward=forwardDuration(playlist,endSequence);if(forward.precise){return forward.result;}
1882return backward.result+expired;};var duration=function duration(playlist,endSequence,expired){if(!playlist){return 0;}
1883if(typeof expired!=='number'){expired=0;}
1884if(typeof endSequence==='undefined'){if(playlist.totalDuration){return playlist.totalDuration;}
1885if(!playlist.endList){return window$3.Infinity;}}
1886return intervalDuration(playlist,endSequence,expired);};var sumDurations=function sumDurations(playlist,startIndex,endIndex){var durations=0;if(startIndex>endIndex){var _ref=[endIndex,startIndex];startIndex=_ref[0];endIndex=_ref[1];}
1887if(startIndex<0){for(var i=startIndex;i<Math.min(0,endIndex);i++){durations+=playlist.targetDuration;}
1888startIndex=0;}
1889for(var _i=startIndex;_i<endIndex;_i++){durations+=playlist.segments[_i].duration;}
1890return durations;};var safeLiveIndex=function safeLiveIndex(playlist,liveEdgePadding){if(!playlist.segments.length){return 0;}
1891var i=playlist.segments.length;var lastSegmentDuration=playlist.segments[i-1].duration||playlist.targetDuration;var safeDistance=typeof liveEdgePadding==='number'?liveEdgePadding:lastSegmentDuration+playlist.targetDuration*2;if(safeDistance===0){return i;}
1892var distanceFromEnd=0;while(i--){distanceFromEnd+=playlist.segments[i].duration;if(distanceFromEnd>=safeDistance){break;}}
1893return Math.max(0,i);};var playlistEnd=function playlistEnd(playlist,expired,useSafeLiveEnd,liveEdgePadding){if(!playlist||!playlist.segments){return null;}
1894if(playlist.endList){return duration(playlist);}
1895if(expired===null){return null;}
1896expired=expired||0;var endSequence=useSafeLiveEnd?safeLiveIndex(playlist,liveEdgePadding):playlist.segments.length;return intervalDuration(playlist,playlist.mediaSequence+endSequence,expired);};var seekable=function seekable(playlist,expired,liveEdgePadding){var useSafeLiveEnd=true;var seekableStart=expired||0;var seekableEnd=playlistEnd(playlist,expired,useSafeLiveEnd,liveEdgePadding);if(seekableEnd===null){return createTimeRange();}
1897return createTimeRange(seekableStart,seekableEnd);};var isWholeNumber=function isWholeNumber(num){return num-Math.floor(num)===0;};var roundSignificantDigit=function roundSignificantDigit(increment,num){if(isWholeNumber(num)){return num+increment*0.1;}
1898var numDecimalDigits=num.toString().split('.')[1].length;for(var i=1;i<=numDecimalDigits;i++){var scale=Math.pow(10,i);var temp=num*scale;if(isWholeNumber(temp)||i===numDecimalDigits){return(temp+increment)/scale;}}};var ceilLeastSignificantDigit=roundSignificantDigit.bind(null,1);var floorLeastSignificantDigit=roundSignificantDigit.bind(null,-1);var getMediaInfoForTime=function getMediaInfoForTime(playlist,currentTime,startIndex,startTime){var i=void 0;var segment=void 0;var numSegments=playlist.segments.length;var time=currentTime-startTime;if(time<0){if(startIndex>0){for(i=startIndex-1;i>=0;i--){segment=playlist.segments[i];time+=floorLeastSignificantDigit(segment.duration);if(time>0){return{mediaIndex:i,startTime:startTime-sumDurations(playlist,startIndex,i)};}}}
1899return{mediaIndex:0,startTime:currentTime};}
1900if(startIndex<0){for(i=startIndex;i<0;i++){time-=playlist.targetDuration;if(time<0){return{mediaIndex:0,startTime:currentTime};}}
1901startIndex=0;}
1902for(i=startIndex;i<numSegments;i++){segment=playlist.segments[i];time-=ceilLeastSignificantDigit(segment.duration);if(time<0){return{mediaIndex:i,startTime:startTime+sumDurations(playlist,startIndex,i)};}}
1903return{mediaIndex:numSegments-1,startTime:currentTime};};var isBlacklisted=function isBlacklisted(playlist){return playlist.excludeUntil&&playlist.excludeUntil>Date.now();};var isIncompatible=function isIncompatible(playlist){return playlist.excludeUntil&&playlist.excludeUntil===Infinity;};var isEnabled=function isEnabled(playlist){var blacklisted=isBlacklisted(playlist);return!playlist.disabled&&!blacklisted;};var isDisabled=function isDisabled(playlist){return playlist.disabled;};var isAes=function isAes(media){for(var i=0;i<media.segments.length;i++){if(media.segments[i].key){return true;}}
1904return false;};var isFmp4=function isFmp4(media){for(var i=0;i<media.segments.length;i++){if(media.segments[i].map){return true;}}
1905return false;};var hasAttribute=function hasAttribute(attr,playlist){return playlist.attributes&&playlist.attributes[attr];};var estimateSegmentRequestTime=function estimateSegmentRequestTime(segmentDuration,bandwidth,playlist){var bytesReceived=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;if(!hasAttribute('BANDWIDTH',playlist)){return NaN;}
1906var size=segmentDuration*playlist.attributes.BANDWIDTH;return(size-bytesReceived*8)/bandwidth;};var isLowestEnabledRendition=function isLowestEnabledRendition(master,media){if(master.playlists.length===1){return true;}
1907var currentBandwidth=media.attributes.BANDWIDTH||Number.MAX_VALUE;return master.playlists.filter(function(playlist){if(!isEnabled(playlist)){return false;}
1908return(playlist.attributes.BANDWIDTH||0)<currentBandwidth;}).length===0;};var Playlist={duration:duration,seekable:seekable,safeLiveIndex:safeLiveIndex,getMediaInfoForTime:getMediaInfoForTime,isEnabled:isEnabled,isDisabled:isDisabled,isBlacklisted:isBlacklisted,isIncompatible:isIncompatible,playlistEnd:playlistEnd,isAes:isAes,isFmp4:isFmp4,hasAttribute:hasAttribute,estimateSegmentRequestTime:estimateSegmentRequestTime,isLowestEnabledRendition:isLowestEnabledRendition};var videojsXHR=videojs$1.xhr,mergeOptions$1$1=videojs$1.mergeOptions;var xhrFactory=function xhrFactory(){var xhr=function XhrFunction(options,callback){options=mergeOptions$1$1({timeout:45e3},options);var beforeRequest=XhrFunction.beforeRequest||videojs$1.Hls.xhr.beforeRequest;if(beforeRequest&&typeof beforeRequest==='function'){var newOptions=beforeRequest(options);if(newOptions){options=newOptions;}}
1909var request=videojsXHR(options,function(error,response){var reqResponse=request.response;if(!error&&reqResponse){request.responseTime=Date.now();request.roundTripTime=request.responseTime-request.requestTime;request.bytesReceived=reqResponse.byteLength||reqResponse.length;if(!request.bandwidth){request.bandwidth=Math.floor(request.bytesReceived/request.roundTripTime*8*1000);}}
1910if(response.headers){request.responseHeaders=response.headers;}
1911if(error&&error.code==='ETIMEDOUT'){request.timedout=true;}
1912if(!error&&!request.aborted&&response.statusCode!==200&&response.statusCode!==206&&response.statusCode!==0){error=new Error('XHR Failed with a response of: '+(request&&(reqResponse||request.responseText)));}
1913callback(error,request);});var originalAbort=request.abort;request.abort=function(){request.aborted=true;return originalAbort.apply(request,arguments);};request.uri=options.uri;request.requestTime=Date.now();return request;};return xhr;};var byterangeStr=function byterangeStr(byterange){var byterangeStart=void 0;var byterangeEnd=void 0;byterangeEnd=byterange.offset+byterange.length-1;byterangeStart=byterange.offset;return 'bytes='+byterangeStart+'-'+byterangeEnd;};var segmentXhrHeaders=function segmentXhrHeaders(segment){var headers={};if(segment.byterange){headers.Range=byterangeStr(segment.byterange);}
1914return headers;};var textRange=function textRange(range,i){return range.start(i)+'-'+range.end(i);};var formatHexString=function formatHexString(e,i){var value=e.toString(16);return '00'.substring(0,2-value.length)+value+(i%2?' ':'');};var formatAsciiString=function formatAsciiString(e){if(e>=0x20&&e<0x7e){return String.fromCharCode(e);}
1915return '.';};var createTransferableMessage=function createTransferableMessage(message){var transferable={};Object.keys(message).forEach(function(key){var value=message[key];if(ArrayBuffer.isView(value)){transferable[key]={bytes:value.buffer,byteOffset:value.byteOffset,byteLength:value.byteLength};}else{transferable[key]=value;}});return transferable;};var initSegmentId=function initSegmentId(initSegment){var byterange=initSegment.byterange||{length:Infinity,offset:0};return[byterange.length,byterange.offset,initSegment.resolvedUri].join(',');};var segmentKeyId=function segmentKeyId(key){return key.resolvedUri;};var hexDump=function hexDump(data){var bytes=Array.prototype.slice.call(data);var step=16;var result='';var hex=void 0;var ascii=void 0;for(var j=0;j<bytes.length/step;j++){hex=bytes.slice(j*step,j*step+step).map(formatHexString).join('');ascii=bytes.slice(j*step,j*step+step).map(formatAsciiString).join('');result+=hex+' '+ascii+'\n';}
1916return result;};var tagDump=function tagDump(_ref){var bytes=_ref.bytes;return hexDump(bytes);};var textRanges=function textRanges(ranges){var result='';var i=void 0;for(i=0;i<ranges.length;i++){result+=textRange(ranges,i)+' ';}
1917return result;};var utils$1=Object.freeze({createTransferableMessage:createTransferableMessage,initSegmentId:initSegmentId,segmentKeyId:segmentKeyId,hexDump:hexDump,tagDump:tagDump,textRanges:textRanges});var SEGMENT_END_FUDGE_PERCENT=0.25;var playerTimeToProgramTime=function playerTimeToProgramTime(playerTime,segment){if(!segment.dateTimeObject){return null;}
1918var transmuxerPrependedSeconds=segment.videoTimingInfo.transmuxerPrependedSeconds;var transmuxedStart=segment.videoTimingInfo.transmuxedPresentationStart;var startOfSegment=transmuxedStart+transmuxerPrependedSeconds;var offsetFromSegmentStart=playerTime-startOfSegment;return new Date(segment.dateTimeObject.getTime()+offsetFromSegmentStart*1000);};var originalSegmentVideoDuration=function originalSegmentVideoDuration(videoTimingInfo){return videoTimingInfo.transmuxedPresentationEnd-videoTimingInfo.transmuxedPresentationStart-videoTimingInfo.transmuxerPrependedSeconds;};var findSegmentForProgramTime=function findSegmentForProgramTime(programTime,playlist){var dateTimeObject=void 0;
vendor: 3,118 bytes, lines 1918-1934
1918try{dateTimeObject=new Date(programTime);}catch(e){return null;}
1919if(!playlist||!playlist.segments||playlist.segments.length===0){return null;}
1920var segment=playlist.segments[0];if(dateTimeObject<segment.dateTimeObject){return null;}
1921for(var i=0;i<playlist.segments.length-1;i++){segment=playlist.segments[i];var nextSegmentStart=playlist.segments[i+1].dateTimeObject;if(dateTimeObject<nextSegmentStart){break;}}
1922var lastSegment=playlist.segments[playlist.segments.length-1];var lastSegmentStart=lastSegment.dateTimeObject;var lastSegmentDuration=lastSegment.videoTimingInfo?originalSegmentVideoDuration(lastSegment.videoTimingInfo):lastSegment.duration+lastSegment.duration*SEGMENT_END_FUDGE_PERCENT;var lastSegmentEnd=new Date(lastSegmentStart.getTime()+lastSegmentDuration*1000);if(dateTimeObject>lastSegmentEnd){return null;}
1923if(dateTimeObject>lastSegmentStart){segment=lastSegment;}
1924return{segment:segment,estimatedStart:segment.videoTimingInfo?segment.videoTimingInfo.transmuxedPresentationStart:Playlist.duration(playlist,playlist.mediaSequence+playlist.segments.indexOf(segment)),type:segment.videoTimingInfo?'accurate':'estimate'};};var findSegmentForPlayerTime=function findSegmentForPlayerTime(time,playlist){if(!playlist||!playlist.segments||playlist.segments.length===0){return null;}
1925var segmentEnd=0;var segment=void 0;for(var i=0;i<playlist.segments.length;i++){segment=playlist.segments[i];segmentEnd=segment.videoTimingInfo?segment.videoTimingInfo.transmuxedPresentationEnd:segmentEnd+segment.duration;if(time<=segmentEnd){break;}}
1926var lastSegment=playlist.segments[playlist.segments.length-1];if(lastSegment.videoTimingInfo&&lastSegment.videoTimingInfo.transmuxedPresentationEnd<time){return null;}
1927if(time>segmentEnd){if(time>segmentEnd+lastSegment.duration*SEGMENT_END_FUDGE_PERCENT){return null;}
1928segment=lastSegment;}
1929return{segment:segment,estimatedStart:segment.videoTimingInfo?segment.videoTimingInfo.transmuxedPresentationStart:segmentEnd-segment.duration,type:segment.videoTimingInfo?'accurate':'estimate'};};var getOffsetFromTimestamp=function getOffsetFromTimestamp(comparisonTimeStamp,programTime){var segmentDateTime=void 0;var programDateTime=void 0;try{segmentDateTime=new Date(comparisonTimeStamp);programDateTime=new Date(programTime);}catch(e){}
1930var segmentTimeEpoch=segmentDateTime.getTime();var programTimeEpoch=programDateTime.getTime();return(programTimeEpoch-segmentTimeEpoch)/1000;};var verifyProgramDateTimeTags=function verifyProgramDateTimeTags(playlist){if(!playlist.segments||playlist.segments.length===0){return false;}
1931for(var i=0;i<playlist.segments.length;i++){var segment=playlist.segments[i];if(!segment.dateTimeObject){return false;}}
1932return true;};var getProgramTime=function getProgramTime(_ref){var playlist=_ref.playlist,_ref$time=_ref.time,time=_ref$time===undefined?undefined:_ref$time,callback=_ref.callback;if(!callback){throw new Error('getProgramTime: callback must be provided');}
1933if(!playlist||time===undefined){return callback({message:'getProgramTime: playlist and time must be provided'});}
1934var matchedSegment=findSegmentForPlayerTime(time,playlist);
1934if(!matchedSegment){return callback({message:'valid programTime was not found'});}
1935if(matchedSegment.type==='estimate'){return callback({message:'Accurate programTime could not be determined.'+' Please seek to e.seekTime and try again',seekTime:matchedSegment.estimatedStart});}
1936var programTimeObject={mediaSeconds:time};var programTime=playerTimeToProgramTime(time,matchedSegment.segment);if(programTime){programTimeObject.programDateTime=programTime.toISOString();}
1937return callback(null,programTimeObject);};var seekToProgramTime=function seekToProgramTime(_ref2){var programTime=_ref2.programTime,playlist=_ref2.playlist,_ref2$retryCount=_ref2.retryCount,retryCount=_ref2$retryCount===undefined?2:_ref2$retryCount,seekTo=_ref2.seekTo,_ref2$pauseAfterSeek=_ref2.pauseAfterSeek,pauseAfterSeek=_ref2$pauseAfterSeek===undefined?true:_ref2$pauseAfterSeek,tech=_ref2.tech,callback=_ref2.callback;if(!callback){throw new Error('seekToProgramTime: callback must be provided');}
1938if(typeof programTime==='undefined'||!playlist||!seekTo){return callback({message:'seekToProgramTime: programTime, seekTo and playlist must be provided'});}
1939if(!playlist.endList&&!tech.hasStarted_){return callback({message:'player must be playing a live stream to start buffering'});}
1940if(!verifyProgramDateTimeTags(playlist)){return callback({message:'programDateTime tags must be provided in the manifest '+playlist.resolvedUri});}
1941var matchedSegment=findSegmentForProgramTime(programTime,playlist);
vendor: 9,950 bytes, lines 1941-1967
1941if(!matchedSegment){return callback({message:programTime+' was not found in the stream'});}
1942var segment=matchedSegment.segment;var mediaOffset=getOffsetFromTimestamp(segment.dateTimeObject,programTime);if(matchedSegment.type==='estimate'){if(retryCount===0){return callback({message:programTime+' is not buffered yet. Try again'});}
1943seekTo(matchedSegment.estimatedStart+mediaOffset);tech.one('seeked',function(){seekToProgramTime({programTime:programTime,playlist:playlist,retryCount:retryCount-1,seekTo:seekTo,pauseAfterSeek:pauseAfterSeek,tech:tech,callback:callback});});return;}
1944var seekToTime=segment.start+mediaOffset;var seekedCallback=function seekedCallback(){return callback(null,tech.currentTime());};tech.one('seeked',seekedCallback);if(pauseAfterSeek){tech.pause();}
1945seekTo(seekToTime);};var TIME_FUDGE_FACTOR=1/30;var SAFE_TIME_DELTA=TIME_FUDGE_FACTOR*3;var filterRanges=function filterRanges(timeRanges,predicate){var results=[];var i=void 0;if(timeRanges&&timeRanges.length){for(i=0;i<timeRanges.length;i++){if(predicate(timeRanges.start(i),timeRanges.end(i))){results.push([timeRanges.start(i),timeRanges.end(i)]);}}}
1946return videojs$1.createTimeRanges(results);};var findRange=function findRange(buffered,time){return filterRanges(buffered,function(start,end){return start-SAFE_TIME_DELTA<=time&&end+SAFE_TIME_DELTA>=time;});};var findNextRange=function findNextRange(timeRanges,time){return filterRanges(timeRanges,function(start){return start-TIME_FUDGE_FACTOR>=time;});};var findGaps=function findGaps(buffered){if(buffered.length<2){return videojs$1.createTimeRanges();}
1947var ranges=[];for(var i=1;i<buffered.length;i++){var start=buffered.end(i-1);var end=buffered.start(i);ranges.push([start,end]);}
1948return videojs$1.createTimeRanges(ranges);};var printableRange=function printableRange(range){var strArr=[];if(!range||!range.length){return '';}
1949for(var i=0;i<range.length;i++){strArr.push(range.start(i)+' => '+range.end(i));}
1950return strArr.join(', ');};var timeUntilRebuffer=function timeUntilRebuffer(buffered,currentTime){var playbackRate=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;var bufferedEnd=buffered.length?buffered.end(buffered.length-1):0;return(bufferedEnd-currentTime)/playbackRate;};var timeRangesToArray=function timeRangesToArray(timeRanges){var timeRangesList=[];for(var i=0;i<timeRanges.length;i++){timeRangesList.push({start:timeRanges.start(i),end:timeRanges.end(i)});}
1951return timeRangesList;};var createTextTracksIfNecessary=function createTextTracksIfNecessary(sourceBuffer,mediaSource,segment){var player=mediaSource.player_;if(segment.captions&&segment.captions.length){if(!sourceBuffer.inbandTextTracks_){sourceBuffer.inbandTextTracks_={};}
1952for(var trackId in segment.captionStreams){if(!sourceBuffer.inbandTextTracks_[trackId]){player.tech_.trigger({type:'usage',name:'hls-608'});var track=player.textTracks().getTrackById(trackId);if(track){sourceBuffer.inbandTextTracks_[trackId]=track;}else{sourceBuffer.inbandTextTracks_[trackId]=player.addRemoteTextTrack({kind:'captions',id:trackId,label:trackId},false).track;}}}}
1953if(segment.metadata&&segment.metadata.length&&!sourceBuffer.metadataTrack_){sourceBuffer.metadataTrack_=player.addRemoteTextTrack({kind:'metadata',label:'Timed Metadata'},false).track;sourceBuffer.metadataTrack_.inBandMetadataTrackDispatchType=segment.metadata.dispatchType;}};var removeCuesFromTrack=function removeCuesFromTrack(start,end,track){var i=void 0;var cue=void 0;if(!track){return;}
1954if(!track.cues){return;}
1955i=track.cues.length;while(i--){cue=track.cues[i];if(cue.startTime<=end&&cue.endTime>=start){track.removeCue(cue);}}};var deprecateOldCue=function deprecateOldCue(cue){Object.defineProperties(cue.frame,{id:{get:function get(){videojs$1.log.warn('cue.frame.id is deprecated. Use cue.value.key instead.');return cue.value.key;}},value:{get:function get(){videojs$1.log.warn('cue.frame.value is deprecated. Use cue.value.data instead.');return cue.value.data;}},privateData:{get:function get(){videojs$1.log.warn('cue.frame.privateData is deprecated. Use cue.value.data instead.');return cue.value.data;}}});};var durationOfVideo=function durationOfVideo(duration){var dur=void 0;if(isNaN(duration)||Math.abs(duration)===Infinity){dur=Number.MAX_VALUE;}else{dur=duration;}
1956return dur;};var addTextTrackData=function addTextTrackData(sourceHandler,captionArray,metadataArray){var Cue=window$3.WebKitDataCue||window$3.VTTCue;if(captionArray){captionArray.forEach(function(caption){var track=caption.stream;this.inbandTextTracks_[track].addCue(new Cue(caption.startTime+this.timestampOffset,caption.endTime+this.timestampOffset,caption.text));},sourceHandler);}
1957if(metadataArray){var videoDuration=durationOfVideo(sourceHandler.mediaSource_.duration);metadataArray.forEach(function(metadata){var time=metadata.cueTime+this.timestampOffset;if(typeof time!=='number'||window$3.isNaN(time)||time<0||!(time<Infinity)){return;}
1958metadata.frames.forEach(function(frame){var cue=new Cue(time,time,frame.value||frame.url||frame.data||'');cue.frame=frame;cue.value=frame;deprecateOldCue(cue);this.metadataTrack_.addCue(cue);},this);},sourceHandler);if(sourceHandler.metadataTrack_&&sourceHandler.metadataTrack_.cues&&sourceHandler.metadataTrack_.cues.length){var cues=sourceHandler.metadataTrack_.cues;var cuesArray=[];for(var i=0;i<cues.length;i++){if(cues[i]){cuesArray.push(cues[i]);}}
1959var cuesGroupedByStartTime=cuesArray.reduce(function(obj,cue){var timeSlot=obj[cue.startTime]||[];timeSlot.push(cue);obj[cue.startTime]=timeSlot;return obj;},{});var sortedStartTimes=Object.keys(cuesGroupedByStartTime).sort(function(a,b){return Number(a)-Number(b);});sortedStartTimes.forEach(function(startTime,idx){var cueGroup=cuesGroupedByStartTime[startTime];var nextTime=Number(sortedStartTimes[idx+1])||videoDuration;cueGroup.forEach(function(cue){cue.endTime=nextTime;});});}}};var win=typeof window!=='undefined'?window:{},TARGET=typeof Symbol==='undefined'?'__target':Symbol(),SCRIPT_TYPE='application/javascript',BlobBuilder=win.BlobBuilder||win.WebKitBlobBuilder||win.MozBlobBuilder||win.MSBlobBuilder,URL=win.URL||win.webkitURL||URL&&URL.msURL,Worker=win.Worker;function shimWorker(filename,fn){return function ShimWorker(forceFallback){var o=this;if(!fn){return new Worker(filename);}else if(Worker&&!forceFallback){var source=fn.toString().replace(/^function.+?{/,'').slice(0,-1),objURL=createSourceObject(source);this[TARGET]=new Worker(objURL);wrapTerminate(this[TARGET],objURL);return this[TARGET];}else{var selfShim={postMessage:function postMessage(m){if(o.onmessage){setTimeout(function(){o.onmessage({data:m,target:selfShim});});}}};fn.call(selfShim);this.postMessage=function(m){setTimeout(function(){selfShim.onmessage({data:m,target:o});});};this.isThisThread=true;}};}
1960if(Worker){var testWorker,objURL=createSourceObject('self.onmessage = function () {}'),testArray=new Uint8Array(1);try{testWorker=new Worker(objURL);testWorker.postMessage(testArray,[testArray.buffer]);}catch(e){Worker=null;}finally{URL.revokeObjectURL(objURL);if(testWorker){testWorker.terminate();}}}
1961function createSourceObject(str){try{return URL.createObjectURL(new Blob([str],{type:SCRIPT_TYPE}));}catch(e){var blob=new BlobBuilder();blob.append(str);return URL.createObjectURL(blob.getBlob(type));}}
1962function wrapTerminate(worker,objURL){if(!worker||!objURL)return;var term=worker.terminate;worker.objURL=objURL;worker.terminate=function(){if(worker.objURL)URL.revokeObjectURL(worker.objURL);term.call(worker);};}
1963var TransmuxWorker=new shimWorker("./transmuxer-worker.worker.js",function(window,document$$1){var self=this;var transmuxerWorker=function(){var Stream=function Stream(){this.init=function(){var listeners={};this.on=function(type,listener){if(!listeners[type]){listeners[type]=[];}
1964listeners[type]=listeners[type].concat(listener);};this.off=function(type,listener){var index;if(!listeners[type]){return false;}
1965index=listeners[type].indexOf(listener);listeners[type]=listeners[type].slice();listeners[type].splice(index,1);return index>-1;};this.trigger=function(type){var callbacks,i,length,args;callbacks=listeners[type];if(!callbacks){return;}
1966if(arguments.length===2){length=callbacks.length;for(i=0;i<length;++i){callbacks[i].call(this,arguments[1]);}}else{args=[];i=arguments.length;for(i=1;i<arguments.length;++i){args.push(arguments[i]);}
1967length=callbacks.length;for(i=0;i<length;++i){callbacks[i].apply(this,args);}}};this.dispose=function(){listeners={};};};};Stream.prototype.pipe=function(destination){this.on('data',function(data){destination.push(data);});this.on('done',function(flushSource){destination.flush(flushSource);});this.on('partialdone',function(flushSource){destination.partialFlush(flushSource);});this.on('endedtimeline',function(flushSource){destination.endTimeline(flushSource);});this.on('reset',function(flushSource){destination.reset(flushSource);});return destination;};Stream.prototype.push=function(data){this.trigger('data',data);};Stream.prototype.flush=function(flushSource){this.trigger('done',flushSource);};Stream.prototype.partialFlush=function(flushSource){this.trigger('partialdone',flushSource);};Stream.prototype.endTimeline=function(flushSource){this.trigger('endedtimeline',flushSource);};Stream.prototype.reset=function(flushSource){this.trigger('reset',flushSource);};var stream=Stream;var UINT32_MAX=Math.pow(2,32)-1;var box,dinf,esds,ftyp,mdat,mfhd,minf,moof,moov,mvex,mvhd,trak,tkhd,mdia,mdhd,hdlr,sdtp,stbl,stsd,traf,trex,trun,types,MAJOR_BRAND,MINOR_VERSION,AVC1_BRAND,VIDEO_HDLR,AUDIO_HDLR,HDLR_TYPES,VMHD,SMHD,DREF,STCO,STSC,STSZ,STTS;(function(){var i;types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]};if(typeof Uint8Array==='undefined'){return;}
vendor: 9,508 bytes, lines 1968-1986
1968for(i in types){if(types.hasOwnProperty(i)){types[i]=[i.charCodeAt(0),i.charCodeAt(1),i.charCodeAt(2),i.charCodeAt(3)];}}
1969MAJOR_BRAND=new Uint8Array(['i'.charCodeAt(0),'s'.charCodeAt(0),'o'.charCodeAt(0),'m'.charCodeAt(0)]);AVC1_BRAND=new Uint8Array(['a'.charCodeAt(0),'v'.charCodeAt(0),'c'.charCodeAt(0),'1'.charCodeAt(0)]);MINOR_VERSION=new Uint8Array([0,0,0,1]);VIDEO_HDLR=new Uint8Array([0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x76,0x69,0x64,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x56,0x69,0x64,0x65,0x6f,0x48,0x61,0x6e,0x64,0x6c,0x65,0x72,0x00]);AUDIO_HDLR=new Uint8Array([0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x6f,0x75,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x53,0x6f,0x75,0x6e,0x64,0x48,0x61,0x6e,0x64,0x6c,0x65,0x72,0x00]);HDLR_TYPES={video:VIDEO_HDLR,audio:AUDIO_HDLR};DREF=new Uint8Array([0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x0c,0x75,0x72,0x6c,0x20,0x00,0x00,0x00,0x01]);SMHD=new Uint8Array([0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]);STCO=new Uint8Array([0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]);STSC=STCO;STSZ=new Uint8Array([0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]);STTS=STCO;VMHD=new Uint8Array([0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]);})();box=function box(type){var payload=[],size=0,i,result,view;for(i=1;i<arguments.length;i++){payload.push(arguments[i]);}
1970i=payload.length;while(i--){size+=payload[i].byteLength;}
1971result=new Uint8Array(size+8);view=new DataView(result.buffer,result.byteOffset,result.byteLength);view.setUint32(0,result.byteLength);result.set(type,4);for(i=0,size=8;i<payload.length;i++){result.set(payload[i],size);size+=payload[i].byteLength;}
1972return result;};dinf=function dinf(){return box(types.dinf,box(types.dref,DREF));};esds=function esds(track){return box(types.esds,new Uint8Array([0x00,0x00,0x00,0x00,0x03,0x19,0x00,0x00,0x00,0x04,0x11,0x40,0x15,0x00,0x06,0x00,0x00,0x00,0xda,0xc0,0x00,0x00,0xda,0xc0,0x05,0x02,track.audioobjecttype<<3|track.samplingfrequencyindex>>>1,track.samplingfrequencyindex<<7|track.channelcount<<3,0x06,0x01,0x02]));};ftyp=function ftyp(){return box(types.ftyp,MAJOR_BRAND,MINOR_VERSION,MAJOR_BRAND,AVC1_BRAND);};hdlr=function hdlr(type){return box(types.hdlr,HDLR_TYPES[type]);};mdat=function mdat(data){return box(types.mdat,data);};mdhd=function mdhd(track){var result=new Uint8Array([0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x03,0x00,0x01,0x5f,0x90,track.duration>>>24&0xFF,track.duration>>>16&0xFF,track.duration>>>8&0xFF,track.duration&0xFF,0x55,0xc4,0x00,0x00]);if(track.samplerate){result[12]=track.samplerate>>>24&0xFF;result[13]=track.samplerate>>>16&0xFF;result[14]=track.samplerate>>>8&0xFF;result[15]=track.samplerate&0xFF;}
1973return box(types.mdhd,result);};mdia=function mdia(track){return box(types.mdia,mdhd(track),hdlr(track.type),minf(track));};mfhd=function mfhd(sequenceNumber){return box(types.mfhd,new Uint8Array([0x00,0x00,0x00,0x00,(sequenceNumber&0xFF000000)>>24,(sequenceNumber&0xFF0000)>>16,(sequenceNumber&0xFF00)>>8,sequenceNumber&0xFF]));};minf=function minf(track){return box(types.minf,track.type==='video'?box(types.vmhd,VMHD):box(types.smhd,SMHD),dinf(),stbl(track));};moof=function moof(sequenceNumber,tracks){var trackFragments=[],i=tracks.length;while(i--){trackFragments[i]=traf(tracks[i]);}
1974return box.apply(null,[types.moof,mfhd(sequenceNumber)].concat(trackFragments));};moov=function moov(tracks){var i=tracks.length,boxes=[];while(i--){boxes[i]=trak(tracks[i]);}
1975return box.apply(null,[types.moov,mvhd(0xffffffff)].concat(boxes).concat(mvex(tracks)));};mvex=function mvex(tracks){var i=tracks.length,boxes=[];while(i--){boxes[i]=trex(tracks[i]);}
1976return box.apply(null,[types.mvex].concat(boxes));};mvhd=function mvhd(duration){var bytes=new Uint8Array([0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x01,0x5f,0x90,(duration&0xFF000000)>>24,(duration&0xFF0000)>>16,(duration&0xFF00)>>8,duration&0xFF,0x00,0x01,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff]);return box(types.mvhd,bytes);};sdtp=function sdtp(track){var samples=track.samples||[],bytes=new Uint8Array(4+samples.length),flags,i;for(i=0;i<samples.length;i++){flags=samples[i].flags;bytes[i+4]=flags.dependsOn<<4|flags.isDependedOn<<2|flags.hasRedundancy;}
1977return box(types.sdtp,bytes);};stbl=function stbl(track){return box(types.stbl,stsd(track),box(types.stts,STTS),box(types.stsc,STSC),box(types.stsz,STSZ),box(types.stco,STCO));};(function(){var videoSample,audioSample;stsd=function stsd(track){return box(types.stsd,new Uint8Array([0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01]),track.type==='video'?videoSample(track):audioSample(track));};videoSample=function videoSample(track){var sps=track.sps||[],pps=track.pps||[],sequenceParameterSets=[],pictureParameterSets=[],i,avc1Box;for(i=0;i<sps.length;i++){sequenceParameterSets.push((sps[i].byteLength&0xFF00)>>>8);sequenceParameterSets.push(sps[i].byteLength&0xFF);sequenceParameterSets=sequenceParameterSets.concat(Array.prototype.slice.call(sps[i]));}
1978for(i=0;i<pps.length;i++){pictureParameterSets.push((pps[i].byteLength&0xFF00)>>>8);pictureParameterSets.push(pps[i].byteLength&0xFF);pictureParameterSets=pictureParameterSets.concat(Array.prototype.slice.call(pps[i]));}
1979avc1Box=[types.avc1,new Uint8Array([0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,(track.width&0xff00)>>8,track.width&0xff,(track.height&0xff00)>>8,track.height&0xff,0x00,0x48,0x00,0x00,0x00,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x13,0x76,0x69,0x64,0x65,0x6f,0x6a,0x73,0x2d,0x63,0x6f,0x6e,0x74,0x72,0x69,0x62,0x2d,0x68,0x6c,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x11,0x11]),box(types.avcC,new Uint8Array([0x01,track.profileIdc,track.profileCompatibility,track.levelIdc,0xff].concat([sps.length],sequenceParameterSets,[pps.length],pictureParameterSets))),box(types.btrt,new Uint8Array([0x00,0x1c,0x9c,0x80,0x00,0x2d,0xc6,0xc0,0x00,0x2d,0xc6,0xc0]))];if(track.sarRatio){var hSpacing=track.sarRatio[0],vSpacing=track.sarRatio[1];avc1Box.push(box(types.pasp,new Uint8Array([(hSpacing&0xFF000000)>>24,(hSpacing&0xFF0000)>>16,(hSpacing&0xFF00)>>8,hSpacing&0xFF,(vSpacing&0xFF000000)>>24,(vSpacing&0xFF0000)>>16,(vSpacing&0xFF00)>>8,vSpacing&0xFF])));}
1980return box.apply(null,avc1Box);};audioSample=function audioSample(track){return box(types.mp4a,new Uint8Array([0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,(track.channelcount&0xff00)>>8,track.channelcount&0xff,(track.samplesize&0xff00)>>8,track.samplesize&0xff,0x00,0x00,0x00,0x00,(track.samplerate&0xff00)>>8,track.samplerate&0xff,0x00,0x00]),esds(track));};})();tkhd=function tkhd(track){var result=new Uint8Array([0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,(track.id&0xFF000000)>>24,(track.id&0xFF0000)>>16,(track.id&0xFF00)>>8,track.id&0xFF,0x00,0x00,0x00,0x00,(track.duration&0xFF000000)>>24,(track.duration&0xFF0000)>>16,(track.duration&0xFF00)>>8,track.duration&0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,(track.width&0xFF00)>>8,track.width&0xFF,0x00,0x00,(track.height&0xFF00)>>8,track.height&0xFF,0x00,0x00]);return box(types.tkhd,result);};traf=function traf(track){var trackFragmentHeader,trackFragmentDecodeTime,trackFragmentRun,sampleDependencyTable,dataOffset,upperWordBaseMediaDecodeTime,lowerWordBaseMediaDecodeTime;trackFragmentHeader=box(types.tfhd,new Uint8Array([0x00,0x00,0x00,0x3a,(track.id&0xFF000000)>>24,(track.id&0xFF0000)>>16,(track.id&0xFF00)>>8,track.id&0xFF,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]));upperWordBaseMediaDecodeTime=Math.floor(track.baseMediaDecodeTime/(UINT32_MAX+1));lowerWordBaseMediaDecodeTime=Math.floor(track.baseMediaDecodeTime%(UINT32_MAX+1));trackFragmentDecodeTime=box(types.tfdt,new Uint8Array([0x01,0x00,0x00,0x00,upperWordBaseMediaDecodeTime>>>24&0xFF,upperWordBaseMediaDecodeTime>>>16&0xFF,upperWordBaseMediaDecodeTime>>>8&0xFF,upperWordBaseMediaDecodeTime&0xFF,lowerWordBaseMediaDecodeTime>>>24&0xFF,lowerWordBaseMediaDecodeTime>>>16&0xFF,lowerWordBaseMediaDecodeTime>>>8&0xFF,lowerWordBaseMediaDecodeTime&0xFF]));dataOffset=32+
198120+
19828+
198316+
19848+
19858;if(track.type==='audio'){trackFragmentRun=trun(track,dataOffset);return box(types.traf,trackFragmentHeader,trackFragmentDecodeTime,trackFragmentRun);}
1986sampleDependencyTable=sdtp(track);trackFragmentRun=trun(track,sampleDependencyTable.length+dataOffset);return box(types.traf,trackFragmentHeader,trackFragmentDecodeTime,trackFragmentRun,sampleDependencyTable);};trak=function trak(track){track.duration=track.duration||0xffffffff;return box(types.trak,tkhd(track),mdia(track));};trex=function trex(track){var result=new Uint8Array([0x00,0x00,0x00,0x00,(track.id&0xFF000000)>>24,(track.id&0xFF0000)>>16,(track.id&0xFF00)>>8,track.id&0xFF,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01]
vendor: 6,673 bytes, lines 1986-2004
1986);if(track.type!=='video'){result[result.length-1]=0x00;}
1987return box(types.trex,result);};(function(){var audioTrun,videoTrun,trunHeader;trunHeader=function trunHeader(samples,offset){var durationPresent=0,sizePresent=0,flagsPresent=0,compositionTimeOffset=0;if(samples.length){if(samples[0].duration!==undefined){durationPresent=0x1;}
1988if(samples[0].size!==undefined){sizePresent=0x2;}
1989if(samples[0].flags!==undefined){flagsPresent=0x4;}
1990if(samples[0].compositionTimeOffset!==undefined){compositionTimeOffset=0x8;}}
1991return[0x00,0x00,durationPresent|sizePresent|flagsPresent|compositionTimeOffset,0x01,(samples.length&0xFF000000)>>>24,(samples.length&0xFF0000)>>>16,(samples.length&0xFF00)>>>8,samples.length&0xFF,(offset&0xFF000000)>>>24,(offset&0xFF0000)>>>16,(offset&0xFF00)>>>8,offset&0xFF];};videoTrun=function videoTrun(track,offset){var bytes,samples,sample,i;samples=track.samples||[];offset+=8+12+16*samples.length;bytes=trunHeader(samples,offset);for(i=0;i<samples.length;i++){sample=samples[i];bytes=bytes.concat([(sample.duration&0xFF000000)>>>24,(sample.duration&0xFF0000)>>>16,(sample.duration&0xFF00)>>>8,sample.duration&0xFF,(sample.size&0xFF000000)>>>24,(sample.size&0xFF0000)>>>16,(sample.size&0xFF00)>>>8,sample.size&0xFF,sample.flags.isLeading<<2|sample.flags.dependsOn,sample.flags.isDependedOn<<6|sample.flags.hasRedundancy<<4|sample.flags.paddingValue<<1|sample.flags.isNonSyncSample,sample.flags.degradationPriority&0xF0<<8,sample.flags.degradationPriority&0x0F,(sample.compositionTimeOffset&0xFF000000)>>>24,(sample.compositionTimeOffset&0xFF0000)>>>16,(sample.compositionTimeOffset&0xFF00)>>>8,sample.compositionTimeOffset&0xFF]);}
1992return box(types.trun,new Uint8Array(bytes));};audioTrun=function audioTrun(track,offset){var bytes,samples,sample,i;samples=track.samples||[];offset+=8+12+8*samples.length;bytes=trunHeader(samples,offset);for(i=0;i<samples.length;i++){sample=samples[i];bytes=bytes.concat([(sample.duration&0xFF000000)>>>24,(sample.duration&0xFF0000)>>>16,(sample.duration&0xFF00)>>>8,sample.duration&0xFF,(sample.size&0xFF000000)>>>24,(sample.size&0xFF0000)>>>16,(sample.size&0xFF00)>>>8,sample.size&0xFF]);}
1993return box(types.trun,new Uint8Array(bytes));};trun=function trun(track,offset){if(track.type==='audio'){return audioTrun(track,offset);}
1994return videoTrun(track,offset);};})();var mp4Generator={ftyp:ftyp,mdat:mdat,moof:moof,moov:moov,initSegment:function initSegment(tracks){var fileType=ftyp(),movie=moov(tracks),result;result=new Uint8Array(fileType.byteLength+movie.byteLength);result.set(fileType);result.set(movie,fileType.byteLength);return result;}};var groupNalsIntoFrames=function groupNalsIntoFrames(nalUnits){var i,currentNal,currentFrame=[],frames=[];frames.byteLength=0;frames.nalCount=0;frames.duration=0;currentFrame.byteLength=0;for(i=0;i<nalUnits.length;i++){currentNal=nalUnits[i];if(currentNal.nalUnitType==='access_unit_delimiter_rbsp'){if(currentFrame.length){currentFrame.duration=currentNal.dts-currentFrame.dts;frames.byteLength+=currentFrame.byteLength;frames.nalCount+=currentFrame.length;frames.duration+=currentFrame.duration;frames.push(currentFrame);}
1995currentFrame=[currentNal];currentFrame.byteLength=currentNal.data.byteLength;currentFrame.pts=currentNal.pts;currentFrame.dts=currentNal.dts;}else{if(currentNal.nalUnitType==='slice_layer_without_partitioning_rbsp_idr'){currentFrame.keyFrame=true;}
1996currentFrame.duration=currentNal.dts-currentFrame.dts;currentFrame.byteLength+=currentNal.data.byteLength;currentFrame.push(currentNal);}}
1997if(frames.length&&(!currentFrame.duration||currentFrame.duration<=0)){currentFrame.duration=frames[frames.length-1].duration;}
1998frames.byteLength+=currentFrame.byteLength;frames.nalCount+=currentFrame.length;frames.duration+=currentFrame.duration;frames.push(currentFrame);return frames;};var groupFramesIntoGops=function groupFramesIntoGops(frames){var i,currentFrame,currentGop=[],gops=[];currentGop.byteLength=0;currentGop.nalCount=0;currentGop.duration=0;currentGop.pts=frames[0].pts;currentGop.dts=frames[0].dts;gops.byteLength=0;gops.nalCount=0;gops.duration=0;gops.pts=frames[0].pts;gops.dts=frames[0].dts;for(i=0;i<frames.length;i++){currentFrame=frames[i];if(currentFrame.keyFrame){if(currentGop.length){gops.push(currentGop);gops.byteLength+=currentGop.byteLength;gops.nalCount+=currentGop.nalCount;gops.duration+=currentGop.duration;}
1999currentGop=[currentFrame];currentGop.nalCount=currentFrame.length;currentGop.byteLength=currentFrame.byteLength;currentGop.pts=currentFrame.pts;currentGop.dts=currentFrame.dts;currentGop.duration=currentFrame.duration;}else{currentGop.duration+=currentFrame.duration;currentGop.nalCount+=currentFrame.length;currentGop.byteLength+=currentFrame.byteLength;currentGop.push(currentFrame);}}
2000if(gops.length&&currentGop.duration<=0){currentGop.duration=gops[gops.length-1].duration;}
2001gops.byteLength+=currentGop.byteLength;gops.nalCount+=currentGop.nalCount;gops.duration+=currentGop.duration;gops.push(currentGop);return gops;};var extendFirstKeyFrame=function extendFirstKeyFrame(gops){var currentGop;if(!gops[0][0].keyFrame&&gops.length>1){currentGop=gops.shift();gops.byteLength-=currentGop.byteLength;gops.nalCount-=currentGop.nalCount;gops[0][0].dts=currentGop.dts;gops[0][0].pts=currentGop.pts;gops[0][0].duration+=currentGop.duration;}
2002return gops;};var createDefaultSample=function createDefaultSample(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};};var sampleForFrame=function sampleForFrame(frame,dataOffset){var sample=createDefaultSample();sample.dataOffset=dataOffset;sample.compositionTimeOffset=frame.pts-frame.dts;sample.duration=frame.duration;sample.size=4*frame.length;sample.size+=frame.byteLength;if(frame.keyFrame){sample.flags.dependsOn=2;sample.flags.isNonSyncSample=0;}
2003return sample;};var generateSampleTable=function generateSampleTable(gops,baseDataOffset){var h,i,sample,currentGop,currentFrame,dataOffset=baseDataOffset||0,samples=[];for(h=0;h<gops.length;h++){currentGop=gops[h];for(i=0;i<currentGop.length;i++){currentFrame=currentGop[i];sample=sampleForFrame(currentFrame,dataOffset);dataOffset+=sample.size;samples.push(sample);}}
2004return samples;};var concatenateNalData=function concatenateNalData(gops){var h,i,j,currentGop,currentFrame,currentNal,dataOffset=0,nalsByteLength=gops.byteLength,numberOfNals=gops.nalCount,totalByteLength=nalsByteLength+4*numberOfNals,data=new Uint8Array(totalByteLength),view=new DataView(data.buffer);for(h=0;h<gops.length;h++){currentGop=gops[h];for(i=0;i<currentGop.length;i++){currentFrame=currentGop[i];for(j=0;j<currentFrame.length;j++){currentNal=currentFrame[j];
vendor: 6,496 bytes, lines 2004-2017
2004view.setUint32(dataOffset,currentNal.data.byteLength);dataOffset+=4;data.set(currentNal.data,dataOffset);dataOffset+=currentNal.data.byteLength;}}}
2005return data;};var generateSampleTableForFrame=function generateSampleTableForFrame(frame,baseDataOffset){var sample,dataOffset=baseDataOffset||0,samples=[];sample=sampleForFrame(frame,dataOffset);samples.push(sample);return samples;};var concatenateNalDataForFrame=function concatenateNalDataForFrame(frame){var i,currentNal,dataOffset=0,nalsByteLength=frame.byteLength,numberOfNals=frame.length,totalByteLength=nalsByteLength+4*numberOfNals,data=new Uint8Array(totalByteLength),view=new DataView(data.buffer);for(i=0;i<frame.length;i++){currentNal=frame[i];view.setUint32(dataOffset,currentNal.data.byteLength);dataOffset+=4;data.set(currentNal.data,dataOffset);dataOffset+=currentNal.data.byteLength;}
2006return data;};var frameUtils={groupNalsIntoFrames:groupNalsIntoFrames,groupFramesIntoGops:groupFramesIntoGops,extendFirstKeyFrame:extendFirstKeyFrame,generateSampleTable:generateSampleTable,concatenateNalData:concatenateNalData,generateSampleTableForFrame:generateSampleTableForFrame,concatenateNalDataForFrame:concatenateNalDataForFrame};var highPrefix=[33,16,5,32,164,27];var lowPrefix=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252];var zeroFill=function zeroFill(count){var a=[];while(count--){a.push(0);}
2007return a;};var makeTable=function makeTable(metaTable){return Object.keys(metaTable).reduce(function(obj,key){obj[key]=new Uint8Array(metaTable[key].reduce(function(arr,part){return arr.concat(part);},[]));return obj;},{});};var coneOfSilence={96000:[highPrefix,[227,64],zeroFill(154),[56]],88200:[highPrefix,[231],zeroFill(170),[56]],64000:[highPrefix,[248,192],zeroFill(240),[56]],48000:[highPrefix,[255,192],zeroFill(268),[55,148,128],zeroFill(54),[112]],44100:[highPrefix,[255,192],zeroFill(268),[55,163,128],zeroFill(84),[112]],32000:[highPrefix,[255,192],zeroFill(268),[55,234],zeroFill(226),[112]],24000:[highPrefix,[255,192],zeroFill(268),[55,255,128],zeroFill(268),[111,112],zeroFill(126),[224]],16000:[highPrefix,[255,192],zeroFill(268),[55,255,128],zeroFill(268),[111,255],zeroFill(269),[223,108],zeroFill(195),[1,192]],12000:[lowPrefix,zeroFill(268),[3,127,248],zeroFill(268),[6,255,240],zeroFill(268),[13,255,224],zeroFill(268),[27,253,128],zeroFill(259),[56]],11025:[lowPrefix,zeroFill(268),[3,127,248],zeroFill(268),[6,255,240],zeroFill(268),[13,255,224],zeroFill(268),[27,255,192],zeroFill(268),[55,175,128],zeroFill(108),[112]],8000:[lowPrefix,zeroFill(268),[3,121,16],zeroFill(47),[7]]};var silence=makeTable(coneOfSilence);var ONE_SECOND_IN_TS=90000,secondsToVideoTs,secondsToAudioTs,videoTsToSeconds,audioTsToSeconds,audioTsToVideoTs,videoTsToAudioTs,metadataTsToSeconds;secondsToVideoTs=function secondsToVideoTs(seconds){return seconds*ONE_SECOND_IN_TS;};secondsToAudioTs=function secondsToAudioTs(seconds,sampleRate){return seconds*sampleRate;};videoTsToSeconds=function videoTsToSeconds(timestamp){return timestamp/ONE_SECOND_IN_TS;};audioTsToSeconds=function audioTsToSeconds(timestamp,sampleRate){return timestamp/sampleRate;};audioTsToVideoTs=function audioTsToVideoTs(timestamp,sampleRate){return secondsToVideoTs(audioTsToSeconds(timestamp,sampleRate));};videoTsToAudioTs=function videoTsToAudioTs(timestamp,sampleRate){return secondsToAudioTs(videoTsToSeconds(timestamp),sampleRate);};metadataTsToSeconds=function metadataTsToSeconds(timestamp,timelineStartPts,keepOriginalTimestamps){return videoTsToSeconds(keepOriginalTimestamps?timestamp:timestamp-timelineStartPts);};var clock={ONE_SECOND_IN_TS:ONE_SECOND_IN_TS,secondsToVideoTs:secondsToVideoTs,secondsToAudioTs:secondsToAudioTs,videoTsToSeconds:videoTsToSeconds,audioTsToSeconds:audioTsToSeconds,audioTsToVideoTs:audioTsToVideoTs,videoTsToAudioTs:videoTsToAudioTs,metadataTsToSeconds:metadataTsToSeconds};var sumFrameByteLengths=function sumFrameByteLengths(array){var i,currentObj,sum=0;for(i=0;i<array.length;i++){currentObj=array[i];sum+=currentObj.data.byteLength;}
2008return sum;};var prefixWithSilence=function prefixWithSilence(track,frames,audioAppendStartTs,videoBaseMediaDecodeTime){var baseMediaDecodeTimeTs,frameDuration=0,audioGapDuration=0,audioFillFrameCount=0,audioFillDuration=0,silentFrame,i,firstFrame;if(!frames.length){return;}
2009baseMediaDecodeTimeTs=clock.audioTsToVideoTs(track.baseMediaDecodeTime,track.samplerate);frameDuration=Math.ceil(clock.ONE_SECOND_IN_TS/(track.samplerate/1024));if(audioAppendStartTs&&videoBaseMediaDecodeTime){audioGapDuration=baseMediaDecodeTimeTs-Math.max(audioAppendStartTs,videoBaseMediaDecodeTime);audioFillFrameCount=Math.floor(audioGapDuration/frameDuration);audioFillDuration=audioFillFrameCount*frameDuration;}
2010if(audioFillFrameCount<1||audioFillDuration>clock.ONE_SECOND_IN_TS/2){return;}
2011silentFrame=silence[track.samplerate];if(!silentFrame){silentFrame=frames[0].data;}
2012for(i=0;i<audioFillFrameCount;i++){firstFrame=frames[0];frames.splice(0,0,{data:silentFrame,dts:firstFrame.dts-frameDuration,pts:firstFrame.pts-frameDuration});}
2013track.baseMediaDecodeTime-=Math.floor(clock.videoTsToAudioTs(audioFillDuration,track.samplerate));};var trimAdtsFramesByEarliestDts=function trimAdtsFramesByEarliestDts(adtsFrames,track,earliestAllowedDts){if(track.minSegmentDts>=earliestAllowedDts){return adtsFrames;}
2014track.minSegmentDts=Infinity;return adtsFrames.filter(function(currentFrame){if(currentFrame.dts>=earliestAllowedDts){track.minSegmentDts=Math.min(track.minSegmentDts,currentFrame.dts);track.minSegmentPts=track.minSegmentDts;return true;}
2015return false;});};var generateSampleTable$1=function generateSampleTable(frames){var i,currentFrame,samples=[];for(i=0;i<frames.length;i++){currentFrame=frames[i];samples.push({size:currentFrame.data.byteLength,duration:1024});}
2016return samples;};var concatenateFrameData=function concatenateFrameData(frames){var i,currentFrame,dataOffset=0,data=new Uint8Array(sumFrameByteLengths(frames));for(i=0;i<frames.length;i++){currentFrame=frames[i];data.set(currentFrame.data,dataOffset);dataOffset+=currentFrame.data.byteLength;}
2017return data;};var audioFrameUtils={prefixWithSilence:prefixWithSilence,trimAdtsFramesByEarliestDts:trimAdtsFramesByEarliestDts,generateSampleTable:generateSampleTable$1,concatenateFrameData:concatenateFrameData};var ONE_SECOND_IN_TS$1=clock.ONE_SECOND_IN_TS;var collectDtsInfo=function collectDtsInfo(track,data){if(typeof data.pts==='number'){if(track.timelineStartInfo.pts===undefined){track.timelineStartInfo.pts=data.pts;}
vendor: 1,833 bytes, lines 2018-2026
2018if(track.minSegmentPts===undefined){track.minSegmentPts=data.pts;}else{track.minSegmentPts=Math.min(track.minSegmentPts,data.pts);}
2019if(track.maxSegmentPts===undefined){track.maxSegmentPts=data.pts;}else{track.maxSegmentPts=Math.max(track.maxSegmentPts,data.pts);}}
2020if(typeof data.dts==='number'){if(track.timelineStartInfo.dts===undefined){track.timelineStartInfo.dts=data.dts;}
2021if(track.minSegmentDts===undefined){track.minSegmentDts=data.dts;}else{track.minSegmentDts=Math.min(track.minSegmentDts,data.dts);}
2022if(track.maxSegmentDts===undefined){track.maxSegmentDts=data.dts;}else{track.maxSegmentDts=Math.max(track.maxSegmentDts,data.dts);}}};var clearDtsInfo=function clearDtsInfo(track){delete track.minSegmentDts;delete track.maxSegmentDts;delete track.minSegmentPts;delete track.maxSegmentPts;};var calculateTrackBaseMediaDecodeTime=function calculateTrackBaseMediaDecodeTime(track,keepOriginalTimestamps){var baseMediaDecodeTime,scale,minSegmentDts=track.minSegmentDts;if(!keepOriginalTimestamps){minSegmentDts-=track.timelineStartInfo.dts;}
2023baseMediaDecodeTime=track.timelineStartInfo.baseMediaDecodeTime;baseMediaDecodeTime+=minSegmentDts;baseMediaDecodeTime=Math.max(0,baseMediaDecodeTime);if(track.type==='audio'){scale=track.samplerate/ONE_SECOND_IN_TS$1;baseMediaDecodeTime*=scale;baseMediaDecodeTime=Math.floor(baseMediaDecodeTime);}
2024return baseMediaDecodeTime;};var trackDecodeInfo={clearDtsInfo:clearDtsInfo,calculateTrackBaseMediaDecodeTime:calculateTrackBaseMediaDecodeTime,collectDtsInfo:collectDtsInfo};var USER_DATA_REGISTERED_ITU_T_T35=4,RBSP_TRAILING_BITS=128;var parseSei=function parseSei(bytes){var i=0,result={payloadType:-1,payloadSize:0},payloadType=0,payloadSize=0;while(i<bytes.byteLength){if(bytes[i]===RBSP_TRAILING_BITS){break;}
2025while(bytes[i]===0xFF){payloadType+=255;i++;}
2026payloadType+=bytes[i++];
vendor: 5,735 bytes, lines 2026-2049
2026while(bytes[i]===0xFF){payloadSize+=255;i++;}
2027payloadSize+=bytes[i++];if(!result.payload&&payloadType===USER_DATA_REGISTERED_ITU_T_T35){result.payloadType=payloadType;result.payloadSize=payloadSize;result.payload=bytes.subarray(i,i+payloadSize);break;}
2028i+=payloadSize;payloadType=0;payloadSize=0;}
2029return result;};var parseUserData=function parseUserData(sei){if(sei.payload[0]!==181){return null;}
2030if((sei.payload[1]<<8|sei.payload[2])!==49){return null;}
2031if(String.fromCharCode(sei.payload[3],sei.payload[4],sei.payload[5],sei.payload[6])!=='GA94'){return null;}
2032if(sei.payload[7]!==0x03){return null;}
2033return sei.payload.subarray(8,sei.payload.length-1);};var parseCaptionPackets=function parseCaptionPackets(pts,userData){var results=[],i,count,offset,data;if(!(userData[0]&0x40)){return results;}
2034count=userData[0]&0x1f;for(i=0;i<count;i++){offset=i*3;data={type:userData[offset+2]&0x03,pts:pts};if(userData[offset+2]&0x04){data.ccData=userData[offset+3]<<8|userData[offset+4];results.push(data);}}
2035return results;};var discardEmulationPreventionBytes=function discardEmulationPreventionBytes(data){var length=data.byteLength,emulationPreventionBytesPositions=[],i=1,newLength,newData;while(i<length-2){if(data[i]===0&&data[i+1]===0&&data[i+2]===0x03){emulationPreventionBytesPositions.push(i+2);i+=2;}else{i++;}}
2036if(emulationPreventionBytesPositions.length===0){return data;}
2037newLength=length-emulationPreventionBytesPositions.length;newData=new Uint8Array(newLength);var sourceIndex=0;for(i=0;i<newLength;sourceIndex++,i++){if(sourceIndex===emulationPreventionBytesPositions[0]){sourceIndex++;emulationPreventionBytesPositions.shift();}
2038newData[i]=data[sourceIndex];}
2039return newData;};var captionPacketParser={parseSei:parseSei,parseUserData:parseUserData,parseCaptionPackets:parseCaptionPackets,discardEmulationPreventionBytes:discardEmulationPreventionBytes,USER_DATA_REGISTERED_ITU_T_T35:USER_DATA_REGISTERED_ITU_T_T35};var CaptionStream=function CaptionStream(){CaptionStream.prototype.init.call(this);this.captionPackets_=[];this.ccStreams_=[new Cea608Stream(0,0),new Cea608Stream(0,1),new Cea608Stream(1,0),new Cea608Stream(1,1)];this.reset();this.ccStreams_.forEach(function(cc){cc.on('data',this.trigger.bind(this,'data'));cc.on('partialdone',this.trigger.bind(this,'partialdone'));cc.on('done',this.trigger.bind(this,'done'));},this);};CaptionStream.prototype=new stream();CaptionStream.prototype.push=function(event){var sei,userData,newCaptionPackets;if(event.nalUnitType!=='sei_rbsp'){return;}
2040sei=captionPacketParser.parseSei(event.escapedRBSP);if(sei.payloadType!==captionPacketParser.USER_DATA_REGISTERED_ITU_T_T35){return;}
2041userData=captionPacketParser.parseUserData(sei);if(!userData){return;}
2042if(event.dts<this.latestDts_){this.ignoreNextEqualDts_=true;return;}else if(event.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--;if(!this.numSameDts_){this.ignoreNextEqualDts_=false;}
2043return;}
2044newCaptionPackets=captionPacketParser.parseCaptionPackets(event.pts,userData);this.captionPackets_=this.captionPackets_.concat(newCaptionPackets);if(this.latestDts_!==event.dts){this.numSameDts_=0;}
2045this.numSameDts_++;this.latestDts_=event.dts;};CaptionStream.prototype.flushCCStreams=function(flushType){this.ccStreams_.forEach(function(cc){return flushType==='flush'?cc.flush():cc.partialFlush();},this);};CaptionStream.prototype.flushStream=function(flushType){if(!this.captionPackets_.length){this.flushCCStreams(flushType);return;}
2046this.captionPackets_.forEach(function(elem,idx){elem.presortIndex=idx;});this.captionPackets_.sort(function(a,b){if(a.pts===b.pts){return a.presortIndex-b.presortIndex;}
2047return a.pts-b.pts;});this.captionPackets_.forEach(function(packet){if(packet.type<2){this.dispatchCea608Packet(packet);}},this);this.captionPackets_.length=0;this.flushCCStreams(flushType);};CaptionStream.prototype.flush=function(){return this.flushStream('flush');};CaptionStream.prototype.partialFlush=function(){return this.flushStream('partialFlush');};CaptionStream.prototype.reset=function(){this.latestDts_=null;this.ignoreNextEqualDts_=false;this.numSameDts_=0;this.activeCea608Channel_=[null,null];this.ccStreams_.forEach(function(ccStream){ccStream.reset();});};CaptionStream.prototype.dispatchCea608Packet=function(packet){if(this.setsTextOrXDSActive(packet)){this.activeCea608Channel_[packet.type]=null;}else if(this.setsChannel1Active(packet)){this.activeCea608Channel_[packet.type]=0;}else if(this.setsChannel2Active(packet)){this.activeCea608Channel_[packet.type]=1;}
2048if(this.activeCea608Channel_[packet.type]===null){return;}
2049this.ccStreams_[(packet.type<<1)+this.activeCea608Channel_[packet.type]].push(packet);};CaptionStream.prototype.setsChannel1Active=function(packet){return(packet.ccData&0x7800)===0x1000;};CaptionStream.prototype.setsChannel2Active=function(packet){return(packet.ccData&0x7800)===0x1800;};CaptionStream.prototype.setsTextOrXDSActive=function(packet){return(packet.ccData&0x7100)===0x0100||(packet.ccData&0x78fe)===0x102a||(packet.ccData&0x78fe)===0x182a;};var CHARACTER_TRANSLATION={0x2a:0xe1,0x5c:0xe9,0x5e:0xed,0x5f:0xf3,0x60:0xfa,0x7b:0xe7,0x7c:0xf7,0x7d:0xd1,0x7e:0xf1,0x7f:0x2588,0x0130:0xae,0x0131:0xb0,0x0132:0xbd,0x0133:0xbf,0x0134:0x2122,0x0135:0xa2,0x0136:0xa3,0x0137:0x266a,0x0138:0xe0,0x0139:0xa0,0x013a:0xe8,0x013b:0xe2,0x013c:0xea,0x013d:0xee,0x013e:0xf4,0x013f:0xfb,0x0220:0xc1,0x0221:0xc9,0x0222:0xd3,0x0223:0xda,0x0224:0xdc,0x0225:0xfc,0x0226:0x2018,0x0227:0xa1,0x0228:0x2a,0x0229:0x27,0x022a:0x2014,0x022b:0xa9,0x022c:0x2120,0x022d:0x2022,0x022e:0x201c,0x022f:0x201d,0x0230:0xc0,0x0231:0xc2,0x0232:0xc7,0x0233:0xc8,0x0234:0xca,0x0235:0xcb,0x0236:0xeb,0x0237:0xce,0x0238:0xcf,0x0239:0xef,0x023a:0xd4,0x023b:0xd9,0x023c:0xf9,0x023d:0xdb,0
vendor: 8,605 bytes, lines 2049-2072
2049x023e:0xab,0x023f:0xbb,0x0320:0xc3,0x0321:0xe3,0x0322:0xcd,0x0323:0xcc,0x0324:0xec,0x0325:0xd2,0x0326:0xf2,0x0327:0xd5,0x0328:0xf5,0x0329:0x7b,0x032a:0x7d,0x032b:0x5c,0x032c:0x5e,0x032d:0x5f,0x032e:0x7c,0x032f:0x7e,0x0330:0xc4,0x0331:0xe4,0x0332:0xd6,0x0333:0xf6,0x0334:0xdf,0x0335:0xa5,0x0336:0xa4,0x0337:0x2502,0x0338:0xc5,0x0339:0xe5,0x033a:0xd8,0x033b:0xf8,0x033c:0x250c,0x033d:0x2510,0x033e:0x2514,0x033f:0x2518};var getCharFromCode=function getCharFromCode(code){if(code===null){return '';}
2050code=CHARACTER_TRANSLATION[code]||code;return String.fromCharCode(code);};var BOTTOM_ROW=14;var ROWS=[0x1100,0x1120,0x1200,0x1220,0x1500,0x1520,0x1600,0x1620,0x1700,0x1720,0x1000,0x1300,0x1320,0x1400,0x1420];var createDisplayBuffer=function createDisplayBuffer(){var result=[],i=BOTTOM_ROW+1;while(i--){result.push('');}
2051return result;};var Cea608Stream=function Cea608Stream(field,dataChannel){Cea608Stream.prototype.init.call(this);this.field_=field||0;this.dataChannel_=dataChannel||0;this.name_='CC'+((this.field_<<1|this.dataChannel_)+1);this.setConstants();this.reset();this.push=function(packet){var data,swap,char0,char1,text;data=packet.ccData&0x7f7f;if(data===this.lastControlCode_){this.lastControlCode_=null;return;}
2052if((data&0xf000)===0x1000){this.lastControlCode_=data;}else if(data!==this.PADDING_){this.lastControlCode_=null;}
2053char0=data>>>8;char1=data&0xff;if(data===this.PADDING_){return;}else if(data===this.RESUME_CAPTION_LOADING_){this.mode_='popOn';}else if(data===this.END_OF_CAPTION_){this.mode_='popOn';this.clearFormatting(packet.pts);this.flushDisplayed(packet.pts);swap=this.displayed_;this.displayed_=this.nonDisplayed_;this.nonDisplayed_=swap;this.startPts_=packet.pts;}else if(data===this.ROLL_UP_2_ROWS_){this.rollUpRows_=2;this.setRollUp(packet.pts);}else if(data===this.ROLL_UP_3_ROWS_){this.rollUpRows_=3;this.setRollUp(packet.pts);}else if(data===this.ROLL_UP_4_ROWS_){this.rollUpRows_=4;this.setRollUp(packet.pts);}else if(data===this.CARRIAGE_RETURN_){this.clearFormatting(packet.pts);this.flushDisplayed(packet.pts);this.shiftRowsUp_();this.startPts_=packet.pts;}else if(data===this.BACKSPACE_){if(this.mode_==='popOn'){this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1);}else{this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);}}else if(data===this.ERASE_DISPLAYED_MEMORY_){this.flushDisplayed(packet.pts);this.displayed_=createDisplayBuffer();}else if(data===this.ERASE_NON_DISPLAYED_MEMORY_){this.nonDisplayed_=createDisplayBuffer();}else if(data===this.RESUME_DIRECT_CAPTIONING_){if(this.mode_!=='paintOn'){this.flushDisplayed(packet.pts);this.displayed_=createDisplayBuffer();}
2054this.mode_='paintOn';this.startPts_=packet.pts;}else if(this.isSpecialCharacter(char0,char1)){char0=(char0&0x03)<<8;text=getCharFromCode(char0|char1);this[this.mode_](packet.pts,text);this.column_++;}else if(this.isExtCharacter(char0,char1)){if(this.mode_==='popOn'){this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1);}else{this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);}
2055char0=(char0&0x03)<<8;text=getCharFromCode(char0|char1);this[this.mode_](packet.pts,text);this.column_++;}else if(this.isMidRowCode(char0,char1)){this.clearFormatting(packet.pts);this[this.mode_](packet.pts,' ');this.column_++;if((char1&0xe)===0xe){this.addFormatting(packet.pts,['i']);}
2056if((char1&0x1)===0x1){this.addFormatting(packet.pts,['u']);}}else if(this.isOffsetControlCode(char0,char1)){this.column_+=char1&0x03;}else if(this.isPAC(char0,char1)){var row=ROWS.indexOf(data&0x1f20);if(this.mode_==='rollUp'){if(row-this.rollUpRows_+1<0){row=this.rollUpRows_-1;}
2057this.setRollUp(packet.pts,row);}
2058if(row!==this.row_){this.clearFormatting(packet.pts);this.row_=row;}
2059if(char1&0x1&&this.formatting_.indexOf('u')===-1){this.addFormatting(packet.pts,['u']);}
2060if((data&0x10)===0x10){this.column_=((data&0xe)>>1)*4;}
2061if(this.isColorPAC(char1)){if((char1&0xe)===0xe){this.addFormatting(packet.pts,['i']);}}}else if(this.isNormalChar(char0)){if(char1===0x00){char1=null;}
2062text=getCharFromCode(char0);text+=getCharFromCode(char1);this[this.mode_](packet.pts,text);this.column_+=text.length;}};};Cea608Stream.prototype=new stream();Cea608Stream.prototype.flushDisplayed=function(pts){var content=this.displayed_.map(function(row){try{return row.trim();}catch(e){console.error('Skipping malformed caption.');return '';}}).join('\n').replace(/^\n+|\n+$/g,'');if(content.length){this.trigger('data',{startPts:this.startPts_,endPts:pts,text:content,stream:this.name_});}};Cea608Stream.prototype.reset=function(){this.mode_='popOn';this.topRow_=0;this.startPts_=0;this.displayed_=createDisplayBuffer();this.nonDisplayed_=createDisplayBuffer();this.lastControlCode_=null;this.column_=0;this.row_=BOTTOM_ROW;this.rollUpRows_=2;this.formatting_=[];};Cea608Stream.prototype.setConstants=function(){if(this.dataChannel_===0){this.BASE_=0x10;this.EXT_=0x11;this.CONTROL_=(0x14|this.field_)<<8;this.OFFSET_=0x17;}else if(this.dataChannel_===1){this.BASE_=0x18;this.EXT_=0x19;this.CONTROL_=(0x1c|this.field_)<<8;this.OFFSET_=0x1f;}
2063this.PADDING_=0x0000;this.RESUME_CAPTION_LOADING_=this.CONTROL_|0x20;this.END_OF_CAPTION_=this.CONTROL_|0x2f;this.ROLL_UP_2_ROWS_=this.CONTROL_|0x25;this.ROLL_UP_3_ROWS_=this.CONTROL_|0x26;this.ROLL_UP_4_ROWS_=this.CONTROL_|0x27;this.CARRIAGE_RETURN_=this.CONTROL_|0x2d;this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|0x29;this.BACKSPACE_=this.CONTROL_|0x21;this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|0x2c;this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|0x2e;};Cea608Stream.prototype.isSpecialCharacter=function(char0,char1){return char0===this.EXT_&&char1>=0x30&&char1<=0x3f;};Cea608Stream.prototype.isExtCharacter=function(char0,char1){return(char0===this.EXT_+1||char0===this.EXT_+2)&&char1>=0x20&&char1<=0x3f;};Cea608Stream.prototype.isMidRowCode=function(char0,char1){return char0===this.EXT_&&char1>=0x20&&char1<=0x2f;};Cea608Stream.prototype.isOffsetControlCode=function(char0,char1){return char0===this.OFFSET_&&char1>=0x21&&char1<=0x23;};Cea608Stream.prototype.isPAC=function(char0,char1){return char0>=this.BASE_&&char0<this.BASE_+8&&char1>=0x40&&char1<=0x7f;};Cea608Stream.prototype.isColorPAC=function(char1){return char1>=0x40&&char1<=0x4f||char1>=0x60&&char1<=0x7f;};Cea608Stream.prototype.isNormalChar=function(_char){return _char>=0x20&&_char<=0x7f;};Cea608Stream.prototype.setRollUp=function(pts,newBaseRow){if(this.mode_!=='rollUp'){this.row_=BOTTOM_ROW;this.mode_='rollUp';this.flushDisplayed(pts);this.nonDisplayed_=createDisplayBuffer();this.displayed_=createDisplayBuffer();}
2064if(newBaseRow!==undefined&&newBaseRow!==this.row_){for(var i=0;i<this.rollUpRows_;i++){this.displayed_[newBaseRow-i]=this.displayed_[this.row_-i];this.displayed_[this.row_-i]='';}}
2065if(newBaseRow===undefined){newBaseRow=this.row_;}
2066this.topRow_=newBaseRow-this.rollUpRows_+1;};Cea608Stream.prototype.addFormatting=function(pts,format){this.formatting_=this.formatting_.concat(format);var text=format.reduce(function(text,format){return text+'<'+format+'>';},'');this[this.mode_](pts,text);};Cea608Stream.prototype.clearFormatting=function(pts){if(!this.formatting_.length){return;}
2067var text=this.formatting_.reverse().reduce(function(text,format){return text+'</'+format+'>';},'');this.formatting_=[];this[this.mode_](pts,text);};Cea608Stream.prototype.popOn=function(pts,text){var baseRow=this.nonDisplayed_[this.row_];baseRow+=text;this.nonDisplayed_[this.row_]=baseRow;};Cea608Stream.prototype.rollUp=function(pts,text){var baseRow=this.displayed_[this.row_];baseRow+=text;this.displayed_[this.row_]=baseRow;};Cea608Stream.prototype.shiftRowsUp_=function(){var i;for(i=0;i<this.topRow_;i++){this.displayed_[i]='';}
2068for(i=this.row_+1;i<BOTTOM_ROW+1;i++){this.displayed_[i]='';}
2069for(i=this.topRow_;i<this.row_;i++){this.displayed_[i]=this.displayed_[i+1];}
2070this.displayed_[this.row_]='';};Cea608Stream.prototype.paintOn=function(pts,text){var baseRow=this.displayed_[this.row_];baseRow+=text;this.displayed_[this.row_]=baseRow;};var captionStream={CaptionStream:CaptionStream,Cea608Stream:Cea608Stream};var streamTypes={H264_STREAM_TYPE:0x1B,ADTS_STREAM_TYPE:0x0F,METADATA_STREAM_TYPE:0x15};var MAX_TS=8589934592;var RO_THRESH=4294967296;var TYPE_SHARED='shared';var handleRollover=function handleRollover(value,reference){var direction=1;if(value>reference){direction=-1;}
2071while(Math.abs(reference-value)>RO_THRESH){value+=direction*MAX_TS;}
2072return value;};var TimestampRolloverStream=function TimestampRolloverStream(type){var lastDTS,referenceDTS;TimestampRolloverStream.prototype.init.call(this);this.type_=type||TYPE_SHARED;
vendor: 4,330 bytes, lines 2072-2091
2072this.push=function(data){if(this.type_!==TYPE_SHARED&&data.type!==this.type_){return;}
2073if(referenceDTS===undefined){referenceDTS=data.dts;}
2074data.dts=handleRollover(data.dts,referenceDTS);data.pts=handleRollover(data.pts,referenceDTS);lastDTS=data.dts;this.trigger('data',data);};this.flush=function(){referenceDTS=lastDTS;this.trigger('done');};this.endTimeline=function(){this.flush();this.trigger('endedtimeline');};this.discontinuity=function(){referenceDTS=void 0;lastDTS=void 0;};this.reset=function(){this.discontinuity();this.trigger('reset');};};TimestampRolloverStream.prototype=new stream();var timestampRolloverStream={TimestampRolloverStream:TimestampRolloverStream,handleRollover:handleRollover};var percentEncode=function percentEncode(bytes,start,end){var i,result='';for(i=start;i<end;i++){result+='%'+('00'+bytes[i].toString(16)).slice(-2);}
2075return result;},parseUtf8=function parseUtf8(bytes,start,end){return decodeURIComponent(percentEncode(bytes,start,end));},parseIso88591=function parseIso88591(bytes,start,end){return unescape(percentEncode(bytes,start,end));},parseSyncSafeInteger=function parseSyncSafeInteger(data){return data[0]<<21|data[1]<<14|data[2]<<7|data[3];},tagParsers={TXXX:function TXXX(tag){var i;if(tag.data[0]!==3){return;}
2076for(i=1;i<tag.data.length;i++){if(tag.data[i]===0){tag.description=parseUtf8(tag.data,1,i);tag.value=parseUtf8(tag.data,i+1,tag.data.length).replace(/\0*$/,'');break;}}
2077tag.data=tag.value;},WXXX:function WXXX(tag){var i;if(tag.data[0]!==3){return;}
2078for(i=1;i<tag.data.length;i++){if(tag.data[i]===0){tag.description=parseUtf8(tag.data,1,i);tag.url=parseUtf8(tag.data,i+1,tag.data.length);break;}}},PRIV:function PRIV(tag){var i;for(i=0;i<tag.data.length;i++){if(tag.data[i]===0){tag.owner=parseIso88591(tag.data,0,i);break;}}
2079tag.privateData=tag.data.subarray(i+1);tag.data=tag.privateData;}},_MetadataStream;_MetadataStream=function MetadataStream(options){var settings={debug:!!(options&&options.debug),descriptor:options&&options.descriptor},tagSize=0,buffer=[],bufferSize=0,i;_MetadataStream.prototype.init.call(this);this.dispatchType=streamTypes.METADATA_STREAM_TYPE.toString(16);if(settings.descriptor){for(i=0;i<settings.descriptor.length;i++){this.dispatchType+=('00'+settings.descriptor[i].toString(16)).slice(-2);}}
2080this.push=function(chunk){var tag,frameStart,frameSize,frame,i,frameHeader;if(chunk.type!=='timed-metadata'){return;}
2081if(chunk.dataAlignmentIndicator){bufferSize=0;buffer.length=0;}
2082if(buffer.length===0&&(chunk.data.length<10||chunk.data[0]!=='I'.charCodeAt(0)||chunk.data[1]!=='D'.charCodeAt(0)||chunk.data[2]!=='3'.charCodeAt(0))){if(settings.debug){console.log('Skipping unrecognized metadata packet');}
2083return;}
2084buffer.push(chunk);bufferSize+=chunk.data.byteLength;if(buffer.length===1){tagSize=parseSyncSafeInteger(chunk.data.subarray(6,10));tagSize+=10;}
2085if(bufferSize<tagSize){return;}
2086tag={data:new Uint8Array(tagSize),frames:[],pts:buffer[0].pts,dts:buffer[0].dts};for(i=0;i<tagSize;){tag.data.set(buffer[0].data.subarray(0,tagSize-i),i);i+=buffer[0].data.byteLength;bufferSize-=buffer[0].data.byteLength;buffer.shift();}
2087frameStart=10;if(tag.data[5]&0x40){frameStart+=4;frameStart+=parseSyncSafeInteger(tag.data.subarray(10,14));tagSize-=parseSyncSafeInteger(tag.data.subarray(16,20));}
2088do{frameSize=parseSyncSafeInteger(tag.data.subarray(frameStart+4,frameStart+8));if(frameSize<1){return console.log('Malformed ID3 frame encountered. Skipping metadata parsing.');}
2089frameHeader=String.fromCharCode(tag.data[frameStart],tag.data[frameStart+1],tag.data[frameStart+2],tag.data[frameStart+3]);frame={id:frameHeader,data:tag.data.subarray(frameStart+10,frameStart+frameSize+10)};frame.key=frame.id;if(tagParsers[frame.id]){tagParsers[frame.id](frame);if(frame.owner==='com.apple.streaming.transportStreamTimestamp'){var d=frame.data,size=(d[3]&0x01)<<30|d[4]<<22|d[5]<<14|d[6]<<6|d[7]>>>2;size*=4;size+=d[7]&0x03;frame.timeStamp=size;if(tag.pts===undefined&&tag.dts===undefined){tag.pts=frame.timeStamp;tag.dts=frame.timeStamp;}
2090this.trigger('timestamp',frame);}}
2091tag.frames.push(frame);frameStart+=10;frameStart+=frameSize;}while(frameStart<tagSize);this.trigger('data',tag);};};_MetadataStream.prototype=new stream();var metadataStream=_MetadataStream;var TimestampRolloverStream$1=timestampRolloverStream.TimestampRolloverStream;
vendor: 6,891 bytes, lines 2091-2109
2091var _TransportPacketStream,_TransportParseStream,_ElementaryStream;var MP2T_PACKET_LENGTH=188,SYNC_BYTE=0x47;_TransportPacketStream=function TransportPacketStream(){var buffer=new Uint8Array(MP2T_PACKET_LENGTH),bytesInBuffer=0;_TransportPacketStream.prototype.init.call(this);this.push=function(bytes){var startIndex=0,endIndex=MP2T_PACKET_LENGTH,everything;if(bytesInBuffer){everything=new Uint8Array(bytes.byteLength+bytesInBuffer);everything.set(buffer.subarray(0,bytesInBuffer));everything.set(bytes,bytesInBuffer);bytesInBuffer=0;}else{everything=bytes;}
2092while(endIndex<everything.byteLength){if(everything[startIndex]===SYNC_BYTE&&everything[endIndex]===SYNC_BYTE){this.trigger('data',everything.subarray(startIndex,endIndex));startIndex+=MP2T_PACKET_LENGTH;endIndex+=MP2T_PACKET_LENGTH;continue;}
2093startIndex++;endIndex++;}
2094if(startIndex<everything.byteLength){buffer.set(everything.subarray(startIndex),0);bytesInBuffer=everything.byteLength-startIndex;}};this.flush=function(){if(bytesInBuffer===MP2T_PACKET_LENGTH&&buffer[0]===SYNC_BYTE){this.trigger('data',buffer);bytesInBuffer=0;}
2095this.trigger('done');};this.endTimeline=function(){this.flush();this.trigger('endedtimeline');};this.reset=function(){bytesInBuffer=0;this.trigger('reset');};};_TransportPacketStream.prototype=new stream();_TransportParseStream=function TransportParseStream(){var parsePsi,parsePat,parsePmt,self;_TransportParseStream.prototype.init.call(this);self=this;this.packetsWaitingForPmt=[];this.programMapTable=undefined;parsePsi=function parsePsi(payload,psi){var offset=0;if(psi.payloadUnitStartIndicator){offset+=payload[offset]+1;}
2096if(psi.type==='pat'){parsePat(payload.subarray(offset),psi);}else{parsePmt(payload.subarray(offset),psi);}};parsePat=function parsePat(payload,pat){pat.section_number=payload[7];pat.last_section_number=payload[8];self.pmtPid=(payload[10]&0x1F)<<8|payload[11];pat.pmtPid=self.pmtPid;};parsePmt=function parsePmt(payload,pmt){var sectionLength,tableEnd,programInfoLength,offset;if(!(payload[5]&0x01)){return;}
2097self.programMapTable={video:null,audio:null,'timed-metadata':{}};sectionLength=(payload[1]&0x0f)<<8|payload[2];tableEnd=3+sectionLength-4;programInfoLength=(payload[10]&0x0f)<<8|payload[11];offset=12+programInfoLength;while(offset<tableEnd){var streamType=payload[offset];var pid=(payload[offset+1]&0x1F)<<8|payload[offset+2];if(streamType===streamTypes.H264_STREAM_TYPE&&self.programMapTable.video===null){self.programMapTable.video=pid;}else if(streamType===streamTypes.ADTS_STREAM_TYPE&&self.programMapTable.audio===null){self.programMapTable.audio=pid;}else if(streamType===streamTypes.METADATA_STREAM_TYPE){self.programMapTable['timed-metadata'][pid]=streamType;}
2098offset+=((payload[offset+3]&0x0F)<<8|payload[offset+4])+5;}
2099pmt.programMapTable=self.programMapTable;};this.push=function(packet){var result={},offset=4;result.payloadUnitStartIndicator=!!(packet[1]&0x40);result.pid=packet[1]&0x1f;result.pid<<=8;result.pid|=packet[2];if((packet[3]&0x30)>>>4>0x01){offset+=packet[offset]+1;}
2100if(result.pid===0){result.type='pat';parsePsi(packet.subarray(offset),result);this.trigger('data',result);}else if(result.pid===this.pmtPid){result.type='pmt';parsePsi(packet.subarray(offset),result);this.trigger('data',result);while(this.packetsWaitingForPmt.length){this.processPes_.apply(this,this.packetsWaitingForPmt.shift());}}else if(this.programMapTable===undefined){this.packetsWaitingForPmt.push([packet,offset,result]);}else{this.processPes_(packet,offset,result);}};this.processPes_=function(packet,offset,result){if(result.pid===this.programMapTable.video){result.streamType=streamTypes.H264_STREAM_TYPE;}else if(result.pid===this.programMapTable.audio){result.streamType=streamTypes.ADTS_STREAM_TYPE;}else{result.streamType=this.programMapTable['timed-metadata'][result.pid];}
2101result.type='pes';result.data=packet.subarray(offset);this.trigger('data',result);};};_TransportParseStream.prototype=new stream();_TransportParseStream.STREAM_TYPES={h264:0x1b,adts:0x0f};_ElementaryStream=function ElementaryStream(){var self=this,video={data:[],size:0},audio={data:[],size:0},timedMetadata={data:[],size:0},programMapTable,parsePes=function parsePes(payload,pes){var ptsDtsFlags;pes.packetLength=6+(payload[4]<<8|payload[5]);pes.dataAlignmentIndicator=(payload[6]&0x04)!==0;ptsDtsFlags=payload[7];if(ptsDtsFlags&0xC0){pes.pts=(payload[9]&0x0E)<<27|(payload[10]&0xFF)<<20|(payload[11]&0xFE)<<12|(payload[12]&0xFF)<<5|(payload[13]&0xFE)>>>3;pes.pts*=4;pes.pts+=(payload[13]&0x06)>>>1;pes.dts=pes.pts;if(ptsDtsFlags&0x40){pes.dts=(payload[14]&0x0E)<<27|(payload[15]&0xFF)<<20|(payload[16]&0xFE)<<12|(payload[17]&0xFF)<<5|(payload[18]&0xFE)>>>3;pes.dts*=4;pes.dts+=(payload[18]&0x06)>>>1;}}
2102pes.data=payload.subarray(9+payload[8]);},flushStream=function flushStream(stream$$1,type,forceFlush){var packetData=new Uint8Array(stream$$1.size),event={type:type},i=0,offset=0,packetFlushable=false,fragment;if(!stream$$1.data.length||stream$$1.size<9){return;}
2103event.trackId=stream$$1.data[0].pid;for(i=0;i<stream$$1.data.length;i++){fragment=stream$$1.data[i];packetData.set(fragment.data,offset);offset+=fragment.data.byteLength;}
2104parsePes(packetData,event);packetFlushable=type==='video'||event.packetLength<=stream$$1.size;if(forceFlush||packetFlushable){stream$$1.size=0;stream$$1.data.length=0;}
2105if(packetFlushable){self.trigger('data',event);}};_ElementaryStream.prototype.init.call(this);this.push=function(data){({pat:function pat(){},pes:function pes(){var stream$$1,streamType;switch(data.streamType){case streamTypes.H264_STREAM_TYPE:case streamTypes.H264_STREAM_TYPE:stream$$1=video;streamType='video';break;case streamTypes.ADTS_STREAM_TYPE:stream$$1=audio;streamType='audio';break;case streamTypes.METADATA_STREAM_TYPE:stream$$1=timedMetadata;streamType='timed-metadata';break;default:return;}
2106if(data.payloadUnitStartIndicator){flushStream(stream$$1,streamType,true);}
2107stream$$1.data.push(data);stream$$1.size+=data.data.byteLength;},pmt:function pmt(){var event={type:'metadata',tracks:[]};programMapTable=data.programMapTable;if(programMapTable.video!==null){event.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+programMapTable.video,codec:'avc',type:'video'});}
2108if(programMapTable.audio!==null){event.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+programMapTable.audio,codec:'adts',type:'audio'});}
2109self.trigger('data',event);}})[data.type]();};this.reset=function(){video.size=0;video.data.length=0;audio.size=0;audio.data.length=0;this.trigger('reset');};this.flushStreams_=function(){flushStream(video,'video');flushStream(audio,'audio');flushStream(timedMetadata,'timed-metadata');};this.flush=function(){this.flushStreams_();this.trigger('done');};};_ElementaryStream.prototype=new stream();var m2ts={PAT_PID:0x0000,MP2T_PACKET_LENGTH:MP2T_PACKET_LENGTH,TransportPacketStream:_TransportPacketStream,TransportParseStream
vendor: 5,927 bytes, lines 2109-2129
2109:_TransportParseStream,ElementaryStream:_ElementaryStream,TimestampRolloverStream:TimestampRolloverStream$1,CaptionStream:captionStream.CaptionStream,Cea608Stream:captionStream.Cea608Stream,MetadataStream:metadataStream};for(var type in streamTypes){if(streamTypes.hasOwnProperty(type)){m2ts[type]=streamTypes[type];}}
2110var m2ts_1=m2ts;var ONE_SECOND_IN_TS$2=clock.ONE_SECOND_IN_TS;var _AdtsStream;var ADTS_SAMPLING_FREQUENCIES=[96000,88200,64000,48000,44100,32000,24000,22050,16000,12000,11025,8000,7350];_AdtsStream=function AdtsStream(handlePartialSegments){var buffer,frameNum=0;_AdtsStream.prototype.init.call(this);this.push=function(packet){var i=0,frameLength,protectionSkipBytes,frameEnd,oldBuffer,sampleCount,adtsFrameDuration;if(!handlePartialSegments){frameNum=0;}
2111if(packet.type!=='audio'){return;}
2112if(buffer){oldBuffer=buffer;buffer=new Uint8Array(oldBuffer.byteLength+packet.data.byteLength);buffer.set(oldBuffer);buffer.set(packet.data,oldBuffer.byteLength);}else{buffer=packet.data;}
2113while(i+5<buffer.length){if(buffer[i]!==0xFF||(buffer[i+1]&0xF6)!==0xF0){i++;continue;}
2114protectionSkipBytes=(~buffer[i+1]&0x01)*2;frameLength=(buffer[i+3]&0x03)<<11|buffer[i+4]<<3|(buffer[i+5]&0xe0)>>5;sampleCount=((buffer[i+6]&0x03)+1)*1024;adtsFrameDuration=sampleCount*ONE_SECOND_IN_TS$2/ADTS_SAMPLING_FREQUENCIES[(buffer[i+2]&0x3c)>>>2];frameEnd=i+frameLength;if(buffer.byteLength<frameEnd){return;}
2115this.trigger('data',{pts:packet.pts+frameNum*adtsFrameDuration,dts:packet.dts+frameNum*adtsFrameDuration,sampleCount:sampleCount,audioobjecttype:(buffer[i+2]>>>6&0x03)+1,channelcount:(buffer[i+2]&1)<<2|(buffer[i+3]&0xc0)>>>6,samplerate:ADTS_SAMPLING_FREQUENCIES[(buffer[i+2]&0x3c)>>>2],samplingfrequencyindex:(buffer[i+2]&0x3c)>>>2,samplesize:16,data:buffer.subarray(i+7+protectionSkipBytes,frameEnd)});frameNum++;if(buffer.byteLength===frameEnd){buffer=undefined;return;}
2116buffer=buffer.subarray(frameEnd);}};this.flush=function(){frameNum=0;this.trigger('done');};this.reset=function(){buffer=void 0;this.trigger('reset');};this.endTimeline=function(){buffer=void 0;this.trigger('endedtimeline');};};_AdtsStream.prototype=new stream();var adts=_AdtsStream;var ExpGolomb;ExpGolomb=function ExpGolomb(workingData){var
2117workingBytesAvailable=workingData.byteLength,workingWord=0,workingBitsAvailable=0;this.length=function(){return 8*workingBytesAvailable;};this.bitsAvailable=function(){return 8*workingBytesAvailable+workingBitsAvailable;};this.loadWord=function(){var position=workingData.byteLength-workingBytesAvailable,workingBytes=new Uint8Array(4),availableBytes=Math.min(4,workingBytesAvailable);if(availableBytes===0){throw new Error('no bytes available');}
2118workingBytes.set(workingData.subarray(position,position+availableBytes));workingWord=new DataView(workingBytes.buffer).getUint32(0);workingBitsAvailable=availableBytes*8;workingBytesAvailable-=availableBytes;};this.skipBits=function(count){var skipBytes;if(workingBitsAvailable>count){workingWord<<=count;workingBitsAvailable-=count;}else{count-=workingBitsAvailable;skipBytes=Math.floor(count/8);count-=skipBytes*8;workingBytesAvailable-=skipBytes;this.loadWord();workingWord<<=count;workingBitsAvailable-=count;}};this.readBits=function(size){var bits=Math.min(workingBitsAvailable,size),valu=workingWord>>>32-bits;workingBitsAvailable-=bits;if(workingBitsAvailable>0){workingWord<<=bits;}else if(workingBytesAvailable>0){this.loadWord();}
2119bits=size-bits;if(bits>0){return valu<<bits|this.readBits(bits);}
2120return valu;};this.skipLeadingZeros=function(){var leadingZeroCount;for(leadingZeroCount=0;leadingZeroCount<workingBitsAvailable;++leadingZeroCount){if((workingWord&0x80000000>>>leadingZeroCount)!==0){workingWord<<=leadingZeroCount;workingBitsAvailable-=leadingZeroCount;return leadingZeroCount;}}
2121this.loadWord();return leadingZeroCount+this.skipLeadingZeros();};this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros());};this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros());};this.readUnsignedExpGolomb=function(){var clz=this.skipLeadingZeros();return this.readBits(clz+1)-1;};this.readExpGolomb=function(){var valu=this.readUnsignedExpGolomb();if(0x01&valu){return 1+valu>>>1;}
2122return-1*(valu>>>1);};this.readBoolean=function(){return this.readBits(1)===1;};this.readUnsignedByte=function(){return this.readBits(8);};this.loadWord();};var expGolomb=ExpGolomb;var _H264Stream,_NalByteStream;var PROFILES_WITH_OPTIONAL_SPS_DATA;_NalByteStream=function NalByteStream(){var syncPoint=0,i,buffer;_NalByteStream.prototype.init.call(this);this.push=function(data){var swapBuffer;if(!buffer){buffer=data.data;}else{swapBuffer=new Uint8Array(buffer.byteLength+data.data.byteLength);swapBuffer.set(buffer);swapBuffer.set(data.data,buffer.byteLength);buffer=swapBuffer;}
2123var len=buffer.byteLength;for(;syncPoint<len-3;syncPoint++){if(buffer[syncPoint+2]===1){i=syncPoint+5;break;}}
2124while(i<len){switch(buffer[i]){case 0:if(buffer[i-1]!==0){i+=2;break;}else if(buffer[i-2]!==0){i++;break;}
2125if(syncPoint+3!==i-2){this.trigger('data',buffer.subarray(syncPoint+3,i-2));}
2126do{i++;}while(buffer[i]!==1&&i<len);syncPoint=i-2;i+=3;break;case 1:if(buffer[i-1]!==0||buffer[i-2]!==0){i+=3;break;}
2127this.trigger('data',buffer.subarray(syncPoint+3,i-2));syncPoint=i-2;i+=3;break;default:i+=3;break;}}
2128buffer=buffer.subarray(syncPoint);i-=syncPoint;syncPoint=0;};this.reset=function(){buffer=null;syncPoint=0;this.trigger('reset');};this.flush=function(){if(buffer&&buffer.byteLength>3){this.trigger('data',buffer.subarray(syncPoint+3));}
2129buffer=null;syncPoint=0;this.trigger('done');};this.endTimeline=function(){this.flush();this.trigger('endedtimeline');};};_NalByteStream.prototype=new stream();PROFILES_WITH_OPTIONAL_SPS_DATA={100:true,110:true,122:true,244:true,44:true,83:true,86:true,118:true,128:true,138:true,139:true,134:true};_H264Stream=function H264Stream(){var nalByteStream=new _NalByteStream(),self,trackId,currentPt
vendor: 5,711 bytes, lines 2129-2143
2129s,currentDts,discardEmulationPreventionBytes,readSequenceParameterSet,skipScalingList;_H264Stream.prototype.init.call(this);self=this;this.push=function(packet){if(packet.type!=='video'){return;}
2130trackId=packet.trackId;currentPts=packet.pts;currentDts=packet.dts;nalByteStream.push(packet);};nalByteStream.on('data',function(data){var event={trackId:trackId,pts:currentPts,dts:currentDts,data:data};switch(data[0]&0x1f){case 0x05:event.nalUnitType='slice_layer_without_partitioning_rbsp_idr';break;case 0x06:event.nalUnitType='sei_rbsp';event.escapedRBSP=discardEmulationPreventionBytes(data.subarray(1));break;case 0x07:event.nalUnitType='seq_parameter_set_rbsp';event.escapedRBSP=discardEmulationPreventionBytes(data.subarray(1));event.config=readSequenceParameterSet(event.escapedRBSP);break;case 0x08:event.nalUnitType='pic_parameter_set_rbsp';break;case 0x09:event.nalUnitType='access_unit_delimiter_rbsp';break;}
2131self.trigger('data',event);});nalByteStream.on('done',function(){self.trigger('done');});nalByteStream.on('partialdone',function(){self.trigger('partialdone');});nalByteStream.on('reset',function(){self.trigger('reset');});nalByteStream.on('endedtimeline',function(){self.trigger('endedtimeline');});this.flush=function(){nalByteStream.flush();};this.partialFlush=function(){nalByteStream.partialFlush();};this.reset=function(){nalByteStream.reset();};this.endTimeline=function(){nalByteStream.endTimeline();};skipScalingList=function skipScalingList(count,expGolombDecoder){var lastScale=8,nextScale=8,j,deltaScale;for(j=0;j<count;j++){if(nextScale!==0){deltaScale=expGolombDecoder.readExpGolomb();nextScale=(lastScale+deltaScale+256)%256;}
2132lastScale=nextScale===0?lastScale:nextScale;}};discardEmulationPreventionBytes=function discardEmulationPreventionBytes(data){var length=data.byteLength,emulationPreventionBytesPositions=[],i=1,newLength,newData;while(i<length-2){if(data[i]===0&&data[i+1]===0&&data[i+2]===0x03){emulationPreventionBytesPositions.push(i+2);i+=2;}else{i++;}}
2133if(emulationPreventionBytesPositions.length===0){return data;}
2134newLength=length-emulationPreventionBytesPositions.length;newData=new Uint8Array(newLength);var sourceIndex=0;for(i=0;i<newLength;sourceIndex++,i++){if(sourceIndex===emulationPreventionBytesPositions[0]){sourceIndex++;emulationPreventionBytesPositions.shift();}
2135newData[i]=data[sourceIndex];}
2136return newData;};readSequenceParameterSet=function readSequenceParameterSet(data){var frameCropLeftOffset=0,frameCropRightOffset=0,frameCropTopOffset=0,frameCropBottomOffset=0,sarScale=1,expGolombDecoder,profileIdc,levelIdc,profileCompatibility,chromaFormatIdc,picOrderCntType,numRefFramesInPicOrderCntCycle,picWidthInMbsMinus1,picHeightInMapUnitsMinus1,frameMbsOnlyFlag,scalingListCount,sarRatio,aspectRatioIdc,i;expGolombDecoder=new expGolomb(data);profileIdc=expGolombDecoder.readUnsignedByte();profileCompatibility=expGolombDecoder.readUnsignedByte();levelIdc=expGolombDecoder.readUnsignedByte();expGolombDecoder.skipUnsignedExpGolomb();if(PROFILES_WITH_OPTIONAL_SPS_DATA[profileIdc]){chromaFormatIdc=expGolombDecoder.readUnsignedExpGolomb();if(chromaFormatIdc===3){expGolombDecoder.skipBits(1);}
2137expGolombDecoder.skipUnsignedExpGolomb();expGolombDecoder.skipUnsignedExpGolomb();expGolombDecoder.skipBits(1);if(expGolombDecoder.readBoolean()){scalingListCount=chromaFormatIdc!==3?8:12;for(i=0;i<scalingListCount;i++){if(expGolombDecoder.readBoolean()){if(i<6){skipScalingList(16,expGolombDecoder);}else{skipScalingList(64,expGolombDecoder);}}}}}
2138expGolombDecoder.skipUnsignedExpGolomb();picOrderCntType=expGolombDecoder.readUnsignedExpGolomb();if(picOrderCntType===0){expGolombDecoder.readUnsignedExpGolomb();}else if(picOrderCntType===1){expGolombDecoder.skipBits(1);expGolombDecoder.skipExpGolomb();expGolombDecoder.skipExpGolomb();numRefFramesInPicOrderCntCycle=expGolombDecoder.readUnsignedExpGolomb();for(i=0;i<numRefFramesInPicOrderCntCycle;i++){expGolombDecoder.skipExpGolomb();}}
2139expGolombDecoder.skipUnsignedExpGolomb();expGolombDecoder.skipBits(1);picWidthInMbsMinus1=expGolombDecoder.readUnsignedExpGolomb();picHeightInMapUnitsMinus1=expGolombDecoder.readUnsignedExpGolomb();frameMbsOnlyFlag=expGolombDecoder.readBits(1);if(frameMbsOnlyFlag===0){expGolombDecoder.skipBits(1);}
2140expGolombDecoder.skipBits(1);if(expGolombDecoder.readBoolean()){frameCropLeftOffset=expGolombDecoder.readUnsignedExpGolomb();frameCropRightOffset=expGolombDecoder.readUnsignedExpGolomb();frameCropTopOffset=expGolombDecoder.readUnsignedExpGolomb();frameCropBottomOffset=expGolombDecoder.readUnsignedExpGolomb();}
2141if(expGolombDecoder.readBoolean()){if(expGolombDecoder.readBoolean()){aspectRatioIdc=expGolombDecoder.readUnsignedByte();switch(aspectRatioIdc){case 1:sarRatio=[1,1];break;case 2:sarRatio=[12,11];break;case 3:sarRatio=[10,11];break;case 4:sarRatio=[16,11];break;case 5:sarRatio=[40,33];break;case 6:sarRatio=[24,11];break;case 7:sarRatio=[20,11];break;case 8:sarRatio=[32,11];break;case 9:sarRatio=[80,33];break;case 10:sarRatio=[18,11];break;case 11:sarRatio=[15,11];break;case 12:sarRatio=[64,33];break;case 13:sarRatio=[160,99];break;case 14:sarRatio=[4,3];break;case 15:sarRatio=[3,2];break;case 16:sarRatio=[2,1];break;case 255:{sarRatio=[expGolombDecoder.readUnsignedByte()<<8|expGolombDecoder.readUnsignedByte(),expGolombDecoder.readUnsignedByte()<<8|expGolombDecoder.readUnsignedByte()];break;}}
2142if(sarRatio){sarScale=sarRatio[0]/sarRatio[1];}}}
2143return{profileIdc:profileIdc,levelIdc:levelIdc,profileCompatibility:profileCompatibility,width:Math.ceil(((picWidthInMbsMinus1+1)*16-frameCropLeftOffset*2-frameCropRightOffset*2)*sarScale),height:(2-frameMbsOnlyFlag)*(picHeightInMapUnitsMinus1+1)*16-frameCropTopOffset*2-frameCropBottomOffset*2,
vendor: 8,423 bytes, lines 2143-2168
2143sarRatio:sarRatio};};};_H264Stream.prototype=new stream();var h264={H264Stream:_H264Stream,NalByteStream:_NalByteStream};var ADTS_SAMPLING_FREQUENCIES$1=[96000,88200,64000,48000,44100,32000,24000,22050,16000,12000,11025,8000,7350];var isLikelyAacData=function isLikelyAacData(data){if(data[0]==='I'.charCodeAt(0)&&data[1]==='D'.charCodeAt(0)&&data[2]==='3'.charCodeAt(0)){return true;}
2144return false;};var parseSyncSafeInteger$1=function parseSyncSafeInteger(data){return data[0]<<21|data[1]<<14|data[2]<<7|data[3];};var percentEncode$1=function percentEncode(bytes,start,end){var i,result='';for(i=start;i<end;i++){result+='%'+('00'+bytes[i].toString(16)).slice(-2);}
2145return result;};var parseIso88591$1=function parseIso88591(bytes,start,end){return unescape(percentEncode$1(bytes,start,end));};var parseId3TagSize=function parseId3TagSize(header,byteIndex){var returnSize=header[byteIndex+6]<<21|header[byteIndex+7]<<14|header[byteIndex+8]<<7|header[byteIndex+9],flags=header[byteIndex+5],footerPresent=(flags&16)>>4;if(footerPresent){return returnSize+20;}
2146return returnSize+10;};var parseAdtsSize=function parseAdtsSize(header,byteIndex){var lowThree=(header[byteIndex+5]&0xE0)>>5,middle=header[byteIndex+4]<<3,highTwo=header[byteIndex+3]&0x3<<11;return highTwo|middle|lowThree;};var parseType=function parseType(header,byteIndex){if(header[byteIndex]==='I'.charCodeAt(0)&&header[byteIndex+1]==='D'.charCodeAt(0)&&header[byteIndex+2]==='3'.charCodeAt(0)){return 'timed-metadata';}else if(header[byteIndex]&0xff===0xff&&(header[byteIndex+1]&0xf0)===0xf0){return 'audio';}
2147return null;};var parseSampleRate=function parseSampleRate(packet){var i=0;while(i+5<packet.length){if(packet[i]!==0xFF||(packet[i+1]&0xF6)!==0xF0){i++;continue;}
2148return ADTS_SAMPLING_FREQUENCIES$1[(packet[i+2]&0x3c)>>>2];}
2149return null;};var parseAacTimestamp=function parseAacTimestamp(packet){var frameStart,frameSize,frame,frameHeader;frameStart=10;if(packet[5]&0x40){frameStart+=4;frameStart+=parseSyncSafeInteger$1(packet.subarray(10,14));}
2150do{frameSize=parseSyncSafeInteger$1(packet.subarray(frameStart+4,frameStart+8));if(frameSize<1){return null;}
2151frameHeader=String.fromCharCode(packet[frameStart],packet[frameStart+1],packet[frameStart+2],packet[frameStart+3]);if(frameHeader==='PRIV'){frame=packet.subarray(frameStart+10,frameStart+frameSize+10);for(var i=0;i<frame.byteLength;i++){if(frame[i]===0){var owner=parseIso88591$1(frame,0,i);if(owner==='com.apple.streaming.transportStreamTimestamp'){var d=frame.subarray(i+1);var size=(d[3]&0x01)<<30|d[4]<<22|d[5]<<14|d[6]<<6|d[7]>>>2;size*=4;size+=d[7]&0x03;return size;}
2152break;}}}
2153frameStart+=10;frameStart+=frameSize;}while(frameStart<packet.byteLength);return null;};var utils={isLikelyAacData:isLikelyAacData,parseId3TagSize:parseId3TagSize,parseAdtsSize:parseAdtsSize,parseType:parseType,parseSampleRate:parseSampleRate,parseAacTimestamp:parseAacTimestamp};var _AacStream;_AacStream=function AacStream(){var everything=new Uint8Array(),timeStamp=0;_AacStream.prototype.init.call(this);this.setTimestamp=function(timestamp){timeStamp=timestamp;};this.push=function(bytes){var frameSize=0,byteIndex=0,bytesLeft,chunk,packet,tempLength;if(everything.length){tempLength=everything.length;everything=new Uint8Array(bytes.byteLength+tempLength);everything.set(everything.subarray(0,tempLength));everything.set(bytes,tempLength);}else{everything=bytes;}
2154while(everything.length-byteIndex>=3){if(everything[byteIndex]==='I'.charCodeAt(0)&&everything[byteIndex+1]==='D'.charCodeAt(0)&&everything[byteIndex+2]==='3'.charCodeAt(0)){if(everything.length-byteIndex<10){break;}
2155frameSize=utils.parseId3TagSize(everything,byteIndex);if(byteIndex+frameSize>everything.length){break;}
2156chunk={type:'timed-metadata',data:everything.subarray(byteIndex,byteIndex+frameSize)};this.trigger('data',chunk);byteIndex+=frameSize;continue;}else if((everything[byteIndex]&0xff)===0xff&&(everything[byteIndex+1]&0xf0)===0xf0){if(everything.length-byteIndex<7){break;}
2157frameSize=utils.parseAdtsSize(everything,byteIndex);if(byteIndex+frameSize>everything.length){break;}
2158packet={type:'audio',data:everything.subarray(byteIndex,byteIndex+frameSize),pts:timeStamp,dts:timeStamp};this.trigger('data',packet);byteIndex+=frameSize;continue;}
2159byteIndex++;}
2160bytesLeft=everything.length-byteIndex;if(bytesLeft>0){everything=everything.subarray(byteIndex);}else{everything=new Uint8Array();}};this.reset=function(){everything=new Uint8Array();this.trigger('reset');};this.endTimeline=function(){everything=new Uint8Array();this.trigger('endedtimeline');};};_AacStream.prototype=new stream();var aac=_AacStream;var H264Stream=h264.H264Stream;var isLikelyAacData$1=utils.isLikelyAacData;var ONE_SECOND_IN_TS$3=clock.ONE_SECOND_IN_TS;var AUDIO_PROPERTIES=['audioobjecttype','channelcount','samplerate','samplingfrequencyindex','samplesize'];var VIDEO_PROPERTIES=['width','height','profileIdc','levelIdc','profileCompatibility','sarRatio'];var _VideoSegmentStream,_AudioSegmentStream,_Transmuxer,_CoalesceStream;var arrayEquals=function arrayEquals(a,b){var i;if(a.length!==b.length){return false;}
2161for(i=0;i<a.length;i++){if(a[i]!==b[i]){return false;}}
2162return true;};var generateVideoSegmentTimingInfo=function generateVideoSegmentTimingInfo(baseMediaDecodeTime,startDts,startPts,endDts,endPts,prependedContentDuration){var ptsOffsetFromDts=startPts-startDts,decodeDuration=endDts-startDts,presentationDuration=endPts-startPts;return{start:{dts:baseMediaDecodeTime,pts:baseMediaDecodeTime+ptsOffsetFromDts},end:{dts:baseMediaDecodeTime+decodeDuration,pts:baseMediaDecodeTime+presentationDuration},prependedContentDuration:prependedContentDuration,baseMediaDecodeTime:baseMediaDecodeTime};};_AudioSegmentStream=function AudioSegmentStream(track,options){var adtsFrames=[],sequenceNumber=0,earliestAllowedDts=0,audioAppendStartTs=0,videoBaseMediaDecodeTime=Infinity;options=options||{};_AudioSegmentStream.prototype.init.call(this);this.push=function(data){trackDecodeInfo.collectDtsInfo(track,data);if(track){AUDIO_PROPERTIES.forEach(function(prop){track[prop]=data[prop];});}
2163adtsFrames.push(data);};this.setEarliestDts=function(earliestDts){earliestAllowedDts=earliestDts-track.timelineStartInfo.baseMediaDecodeTime;};this.setVideoBaseMediaDecodeTime=function(baseMediaDecodeTime){videoBaseMediaDecodeTime=baseMediaDecodeTime;};this.setAudioAppendStart=function(timestamp){audioAppendStartTs=timestamp;};this.flush=function(){var frames,moof,mdat,boxes,frameDuration;if(adtsFrames.length===0){this.trigger('done','AudioSegmentStream');return;}
2164frames=audioFrameUtils.trimAdtsFramesByEarliestDts(adtsFrames,track,earliestAllowedDts);track.baseMediaDecodeTime=trackDecodeInfo.calculateTrackBaseMediaDecodeTime(track,options.keepOriginalTimestamps);audioFrameUtils.prefixWithSilence(track,frames,audioAppendStartTs,videoBaseMediaDecodeTime);track.samples=audioFrameUtils.generateSampleTable(frames);mdat=mp4Generator.mdat(audioFrameUtils.concatenateFrameData(frames));adtsFrames=[];moof=mp4Generator.moof(sequenceNumber,[track]);boxes=new Uint8Array(moof.byteLength+mdat.byteLength);sequenceNumber++;boxes.set(moof);boxes.set(mdat,moof.byteLength);trackDecodeInfo.clearDtsInfo(track);frameDuration=Math.ceil(ONE_SECOND_IN_TS$3*1024/track.samplerate);if(frames.length){this.trigger('timingInfo',{start:frames[0].pts,end:frames[0].pts+frames.length*frameDuration});}
2165this.trigger('data',{track:track,boxes:boxes});this.trigger('done','AudioSegmentStream');};this.reset=function(){trackDecodeInfo.clearDtsInfo(track);adtsFrames=[];this.trigger('reset');};};_AudioSegmentStream.prototype=new stream();_VideoSegmentStream=function VideoSegmentStream(track,options){var sequenceNumber=0,nalUnits=[],gopsToAlignWith=[],config,pps;options=options||{};_VideoSegmentStream.prototype.init.call(this);delete track.minPTS;this.gopCache_=[];this.push=function(nalUnit){trackDecodeInfo.collectDtsInfo(track,nalUnit);if(nalUnit.nalUnitType==='seq_parameter_set_rbsp'&&!config){config=nalUnit.config;track.sps=[nalUnit.data];VIDEO_PROPERTIES.forEach(function(prop){track[prop]=config[prop];},this);}
2166if(nalUnit.nalUnitType==='pic_parameter_set_rbsp'&&!pps){pps=nalUnit.data;track.pps=[nalUnit.data];}
2167nalUnits.push(nalUnit);};this.flush=function(){var frames,gopForFusion,gops,moof,mdat,boxes,prependedContentDuration=0,firstGop,lastGop;while(nalUnits.length){if(nalUnits[0].nalUnitType==='access_unit_delimiter_rbsp'){break;}
2168nalUnits.shift();}
vendor: 4,248 bytes, lines 2169-2183
2169if(nalUnits.length===0){this.resetStream_();this.trigger('done','VideoSegmentStream');return;}
2170frames=frameUtils.groupNalsIntoFrames(nalUnits);gops=frameUtils.groupFramesIntoGops(frames);if(!gops[0][0].keyFrame){gopForFusion=this.getGopForFusion_(nalUnits[0],track);if(gopForFusion){prependedContentDuration=gopForFusion.duration;gops.unshift(gopForFusion);gops.byteLength+=gopForFusion.byteLength;gops.nalCount+=gopForFusion.nalCount;gops.pts=gopForFusion.pts;gops.dts=gopForFusion.dts;gops.duration+=gopForFusion.duration;}else{gops=frameUtils.extendFirstKeyFrame(gops);}}
2171if(gopsToAlignWith.length){var alignedGops;if(options.alignGopsAtEnd){alignedGops=this.alignGopsAtEnd_(gops);}else{alignedGops=this.alignGopsAtStart_(gops);}
2172if(!alignedGops){this.gopCache_.unshift({gop:gops.pop(),pps:track.pps,sps:track.sps});this.gopCache_.length=Math.min(6,this.gopCache_.length);nalUnits=[];this.resetStream_();this.trigger('done','VideoSegmentStream');return;}
2173trackDecodeInfo.clearDtsInfo(track);gops=alignedGops;}
2174trackDecodeInfo.collectDtsInfo(track,gops);track.samples=frameUtils.generateSampleTable(gops);mdat=mp4Generator.mdat(frameUtils.concatenateNalData(gops));track.baseMediaDecodeTime=trackDecodeInfo.calculateTrackBaseMediaDecodeTime(track,options.keepOriginalTimestamps);this.trigger('processedGopsInfo',gops.map(function(gop){return{pts:gop.pts,dts:gop.dts,byteLength:gop.byteLength};}));firstGop=gops[0];lastGop=gops[gops.length-1];this.trigger('segmentTimingInfo',generateVideoSegmentTimingInfo(track.baseMediaDecodeTime,firstGop.dts,firstGop.pts,lastGop.dts+lastGop.duration,lastGop.pts+lastGop.duration,prependedContentDuration));this.trigger('timingInfo',{start:gops[0].pts,end:gops[gops.length-1].pts+gops[gops.length-1].duration});this.gopCache_.unshift({gop:gops.pop(),pps:track.pps,sps:track.sps});this.gopCache_.length=Math.min(6,this.gopCache_.length);nalUnits=[];this.trigger('baseMediaDecodeTime',track.baseMediaDecodeTime);this.trigger('timelineStartInfo',track.timelineStartInfo);moof=mp4Generator.moof(sequenceNumber,[track]);boxes=new Uint8Array(moof.byteLength+mdat.byteLength);sequenceNumber++;boxes.set(moof);boxes.set(mdat,moof.byteLength);this.trigger('data',{track:track,boxes:boxes});this.resetStream_();this.trigger('done','VideoSegmentStream');};this.reset=function(){this.resetStream_();nalUnits=[];this.gopCache_.length=0;gopsToAlignWith.length=0;this.trigger('reset');};this.resetStream_=function(){trackDecodeInfo.clearDtsInfo(track);config=undefined;pps=undefined;};this.getGopForFusion_=function(nalUnit){var halfSecond=45000,allowableOverlap=10000,nearestDistance=Infinity,dtsDistance,nearestGopObj,currentGop,currentGopObj,i;for(i=0;i<this.gopCache_.length;i++){currentGopObj=this.gopCache_[i];currentGop=currentGopObj.gop;if(!(track.pps&&arrayEquals(track.pps[0],currentGopObj.pps[0]))||!(track.sps&&arrayEquals(track.sps[0],currentGopObj.sps[0]))){continue;}
2175if(currentGop.dts<track.timelineStartInfo.dts){continue;}
2176dtsDistance=nalUnit.dts-currentGop.dts-currentGop.duration;if(dtsDistance>=-allowableOverlap&&dtsDistance<=halfSecond){if(!nearestGopObj||nearestDistance>dtsDistance){nearestGopObj=currentGopObj;nearestDistance=dtsDistance;}}}
2177if(nearestGopObj){return nearestGopObj.gop;}
2178return null;};this.alignGopsAtStart_=function(gops){var alignIndex,gopIndex,align,gop,byteLength,nalCount,duration,alignedGops;byteLength=gops.byteLength;nalCount=gops.nalCount;duration=gops.duration;alignIndex=gopIndex=0;while(alignIndex<gopsToAlignWith.length&&gopIndex<gops.length){align=gopsToAlignWith[alignIndex];gop=gops[gopIndex];if(align.pts===gop.pts){break;}
2179if(gop.pts>align.pts){alignIndex++;continue;}
2180gopIndex++;byteLength-=gop.byteLength;nalCount-=gop.nalCount;duration-=gop.duration;}
2181if(gopIndex===0){return gops;}
2182if(gopIndex===gops.length){return null;}
2183alignedGops=gops.slice(gopIndex);alignedGops.byteLength=byteLength;alignedGops.duration=duration;alignedGops.nalCount=nalCount;alignedGops.pts=alignedGops[0].pts;alignedGops.dts=alignedGops[0].dts;return alignedGops;};this.alignGopsAtEnd_=function(gops){var alignIndex,gopIndex,align,gop,alignEndIndex,matchFound;alignIndex=gopsToAlignWith.length-1;gopIndex=gops.length-1;alignEndIndex=null;matchFound=false;while(alignIndex>=0&&gopIndex>
vendor: 4,896 bytes, lines 2183-2204
2183=0){align=gopsToAlignWith[alignIndex];gop=gops[gopIndex];if(align.pts===gop.pts){matchFound=true;break;}
2184if(align.pts>gop.pts){alignIndex--;continue;}
2185if(alignIndex===gopsToAlignWith.length-1){alignEndIndex=gopIndex;}
2186gopIndex--;}
2187if(!matchFound&&alignEndIndex===null){return null;}
2188var trimIndex;if(matchFound){trimIndex=gopIndex;}else{trimIndex=alignEndIndex;}
2189if(trimIndex===0){return gops;}
2190var alignedGops=gops.slice(trimIndex);var metadata=alignedGops.reduce(function(total,gop){total.byteLength+=gop.byteLength;total.duration+=gop.duration;total.nalCount+=gop.nalCount;return total;},{byteLength:0,duration:0,nalCount:0});alignedGops.byteLength=metadata.byteLength;alignedGops.duration=metadata.duration;alignedGops.nalCount=metadata.nalCount;alignedGops.pts=alignedGops[0].pts;alignedGops.dts=alignedGops[0].dts;return alignedGops;};this.alignGopsWith=function(newGopsToAlignWith){gopsToAlignWith=newGopsToAlignWith;};};_VideoSegmentStream.prototype=new stream();_CoalesceStream=function CoalesceStream(options,metadataStream){this.numberOfTracks=0;this.metadataStream=metadataStream;options=options||{};if(typeof options.remux!=='undefined'){this.remuxTracks=!!options.remux;}else{this.remuxTracks=true;}
2191if(typeof options.keepOriginalTimestamps==='boolean'){this.keepOriginalTimestamps=options.keepOriginalTimestamps;}else{this.keepOriginalTimestamps=false;}
2192this.pendingTracks=[];this.videoTrack=null;this.pendingBoxes=[];this.pendingCaptions=[];this.pendingMetadata=[];this.pendingBytes=0;this.emittedTracks=0;_CoalesceStream.prototype.init.call(this);this.push=function(output){if(output.text){return this.pendingCaptions.push(output);}
2193if(output.frames){return this.pendingMetadata.push(output);}
2194this.pendingTracks.push(output.track);this.pendingBytes+=output.boxes.byteLength;if(output.track.type==='video'){this.videoTrack=output.track;this.pendingBoxes.push(output.boxes);}
2195if(output.track.type==='audio'){this.audioTrack=output.track;this.pendingBoxes.unshift(output.boxes);}};};_CoalesceStream.prototype=new stream();_CoalesceStream.prototype.flush=function(flushSource){var offset=0,event={captions:[],captionStreams:{},metadata:[],info:{}},caption,id3,initSegment,timelineStartPts=0,i;if(this.pendingTracks.length<this.numberOfTracks){if(flushSource!=='VideoSegmentStream'&&flushSource!=='AudioSegmentStream'){return;}else if(this.remuxTracks){return;}else if(this.pendingTracks.length===0){this.emittedTracks++;if(this.emittedTracks>=this.numberOfTracks){this.trigger('done');this.emittedTracks=0;}
2196return;}}
2197if(this.videoTrack){timelineStartPts=this.videoTrack.timelineStartInfo.pts;VIDEO_PROPERTIES.forEach(function(prop){event.info[prop]=this.videoTrack[prop];},this);}else if(this.audioTrack){timelineStartPts=this.audioTrack.timelineStartInfo.pts;AUDIO_PROPERTIES.forEach(function(prop){event.info[prop]=this.audioTrack[prop];},this);}
2198if(this.videoTrack||this.audioTrack){if(this.pendingTracks.length===1){event.type=this.pendingTracks[0].type;}else{event.type='combined';}
2199this.emittedTracks+=this.pendingTracks.length;initSegment=mp4Generator.initSegment(this.pendingTracks);event.initSegment=new Uint8Array(initSegment.byteLength);event.initSegment.set(initSegment);event.data=new Uint8Array(this.pendingBytes);for(i=0;i<this.pendingBoxes.length;i++){event.data.set(this.pendingBoxes[i],offset);offset+=this.pendingBoxes[i].byteLength;}
2200for(i=0;i<this.pendingCaptions.length;i++){caption=this.pendingCaptions[i];caption.startTime=clock.metadataTsToSeconds(caption.startPts,timelineStartPts,this.keepOriginalTimestamps);caption.endTime=clock.metadataTsToSeconds(caption.endPts,timelineStartPts,this.keepOriginalTimestamps);event.captionStreams[caption.stream]=true;event.captions.push(caption);}
2201for(i=0;i<this.pendingMetadata.length;i++){id3=this.pendingMetadata[i];id3.cueTime=clock.metadataTsToSeconds(id3.pts,timelineStartPts,this.keepOriginalTimestamps);event.metadata.push(id3);}
2202event.metadata.dispatchType=this.metadataStream.dispatchType;this.pendingTracks.length=0;this.videoTrack=null;this.pendingBoxes.length=0;this.pendingCaptions.length=0;this.pendingBytes=0;this.pendingMetadata.length=0;this.trigger('data',event);for(i=0;i<event.captions.length;i++){caption=event.captions[i];this.trigger('caption',caption);}
2203for(i=0;i<event.metadata.length;i++){id3=event.metadata[i];this.trigger('id3Frame',id3);}}
2204if(this.emittedTracks>=this.numberOfTracks){this.trigger('done');this.emittedTracks=0;}};_CoalesceStream.prototype.setRemux=function(val){this.remuxTracks=val;};_Transmuxer=function Transmuxer(options){var self=this,hasFlushed=true,videoTrack,audioTrack;_Transmuxer.prototype.init.call(this);options=options||{};this.baseMediaDecodeTime=options.baseMediaDecodeTime||0;this.transmuxPipeline_={};this.setupAacPipeline=function(){var pipeline={};this.transmuxPipeline_=pipeline;pipeline.type='aac';pipeline.metadataStream=new m2ts_1.MetadataStream();
vendor: 4,774 bytes, lines 2204-2209
2204pipeline.aacStream=new aac();pipeline.audioTimestampRolloverStream=new m2ts_1.TimestampRolloverStream('audio');pipeline.timedMetadataTimestampRolloverStream=new m2ts_1.TimestampRolloverStream('timed-metadata');pipeline.adtsStream=new adts();pipeline.coalesceStream=new _CoalesceStream(options,pipeline.metadataStream);pipeline.headOfPipeline=pipeline.aacStream;pipeline.aacStream.pipe(pipeline.audioTimestampRolloverStream).pipe(pipeline.adtsStream);pipeline.aacStream.pipe(pipeline.timedMetadataTimestampRolloverStream).pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream);pipeline.metadataStream.on('timestamp',function(frame){pipeline.aacStream.setTimestamp(frame.timeStamp);});pipeline.aacStream.on('data',function(data){if(data.type==='timed-metadata'&&!pipeline.audioSegmentStream){audioTrack=audioTrack||{timelineStartInfo:{baseMediaDecodeTime:self.baseMediaDecodeTime},codec:'adts',type:'audio'};pipeline.coalesceStream.numberOfTracks++;pipeline.audioSegmentStream=new _AudioSegmentStream(audioTrack,options);pipeline.audioSegmentStream.on('timingInfo',self.trigger.bind(self,'audioTimingInfo'));pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream);}
2205self.trigger('trackinfo',{hasAudio:!!audioTrack,hasVideo:!!videoTrack});});pipeline.coalesceStream.on('data',this.trigger.bind(this,'data'));pipeline.coalesceStream.on('done',this.trigger.bind(this,'done'));};this.setupTsPipeline=function(){var pipeline={};this.transmuxPipeline_=pipeline;pipeline.type='ts';pipeline.metadataStream=new m2ts_1.MetadataStream();pipeline.packetStream=new m2ts_1.TransportPacketStream();pipeline.parseStream=new m2ts_1.TransportParseStream();pipeline.elementaryStream=new m2ts_1.ElementaryStream();pipeline.timestampRolloverStream=new m2ts_1.TimestampRolloverStream();pipeline.adtsStream=new adts();pipeline.h264Stream=new H264Stream();pipeline.captionStream=new m2ts_1.CaptionStream();pipeline.coalesceStream=new _CoalesceStream(options,pipeline.metadataStream);pipeline.headOfPipeline=pipeline.packetStream;pipeline.packetStream.pipe(pipeline.parseStream).pipe(pipeline.elementaryStream).pipe(pipeline.timestampRolloverStream);pipeline.timestampRolloverStream.pipe(pipeline.h264Stream);pipeline.timestampRolloverStream.pipe(pipeline.adtsStream);pipeline.timestampRolloverStream.pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream);pipeline.h264Stream.pipe(pipeline.captionStream).pipe(pipeline.coalesceStream);pipeline.elementaryStream.on('data',function(data){var i;if(data.type==='metadata'){i=data.tracks.length;while(i--){if(!videoTrack&&data.tracks[i].type==='video'){videoTrack=data.tracks[i];videoTrack.timelineStartInfo.baseMediaDecodeTime=self.baseMediaDecodeTime;}else if(!audioTrack&&data.tracks[i].type==='audio'){audioTrack=data.tracks[i];audioTrack.timelineStartInfo.baseMediaDecodeTime=self.baseMediaDecodeTime;}}
2206if(videoTrack&&!pipeline.videoSegmentStream){pipeline.coalesceStream.numberOfTracks++;pipeline.videoSegmentStream=new _VideoSegmentStream(videoTrack,options);pipeline.videoSegmentStream.on('timelineStartInfo',function(timelineStartInfo){if(audioTrack){audioTrack.timelineStartInfo=timelineStartInfo;pipeline.audioSegmentStream.setEarliestDts(timelineStartInfo.dts);}});pipeline.videoSegmentStream.on('processedGopsInfo',self.trigger.bind(self,'gopInfo'));pipeline.videoSegmentStream.on('segmentTimingInfo',self.trigger.bind(self,'videoSegmentTimingInfo'));pipeline.videoSegmentStream.on('baseMediaDecodeTime',function(baseMediaDecodeTime){if(audioTrack){pipeline.audioSegmentStream.setVideoBaseMediaDecodeTime(baseMediaDecodeTime);}});pipeline.videoSegmentStream.on('timingInfo',self.trigger.bind(self,'videoTimingInfo'));pipeline.h264Stream.pipe(pipeline.videoSegmentStream).pipe(pipeline.coalesceStream);}
2207if(audioTrack&&!pipeline.audioSegmentStream){pipeline.coalesceStream.numberOfTracks++;pipeline.audioSegmentStream=new _AudioSegmentStream(audioTrack,options);pipeline.audioSegmentStream.on('timingInfo',self.trigger.bind(self,'audioTimingInfo'));pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream);}
2208self.trigger('trackinfo',{hasAudio:!!audioTrack,hasVideo:!!videoTrack});}});pipeline.coalesceStream.on('data',this.trigger.bind(this,'data'));pipeline.coalesceStream.on('id3Frame',function(id3Frame){id3Frame.dispatchType=pipeline.metadataStream.dispatchType;self.trigger('id3Frame',id3Frame);});pipeline.coalesceStream.on('caption',this.trigger.bind(this,'caption'));pipeline.coalesceStream.on('done',this.trigger.bind(this,'done'));};this.setBaseMediaDecodeTime=function(baseMediaDecodeTime){var pipeline=this.transmuxPipeline_;if(!options.keepOriginalTimestamps){this.baseMediaDecodeTime=baseMediaDecodeTime;}
2209if(audioTrack){audioTrack.timelineStartInfo.dts=undefined;
vendor: 25,953 bytes, lines 2209-2300
2209audioTrack.timelineStartInfo.pts=undefined;trackDecodeInfo.clearDtsInfo(audioTrack);if(!options.keepOriginalTimestamps){audioTrack.timelineStartInfo.baseMediaDecodeTime=baseMediaDecodeTime;}
2210if(pipeline.audioTimestampRolloverStream){pipeline.audioTimestampRolloverStream.discontinuity();}}
2211if(videoTrack){if(pipeline.videoSegmentStream){pipeline.videoSegmentStream.gopCache_=[];}
2212videoTrack.timelineStartInfo.dts=undefined;videoTrack.timelineStartInfo.pts=undefined;trackDecodeInfo.clearDtsInfo(videoTrack);pipeline.captionStream.reset();if(!options.keepOriginalTimestamps){videoTrack.timelineStartInfo.baseMediaDecodeTime=baseMediaDecodeTime;}}
2213if(pipeline.timestampRolloverStream){pipeline.timestampRolloverStream.discontinuity();}};this.setAudioAppendStart=function(timestamp){if(audioTrack){this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(timestamp);}};this.setRemux=function(val){var pipeline=this.transmuxPipeline_;options.remux=val;if(pipeline&&pipeline.coalesceStream){pipeline.coalesceStream.setRemux(val);}};this.alignGopsWith=function(gopsToAlignWith){if(videoTrack&&this.transmuxPipeline_.videoSegmentStream){this.transmuxPipeline_.videoSegmentStream.alignGopsWith(gopsToAlignWith);}};this.push=function(data){if(hasFlushed){var isAac=isLikelyAacData$1(data);if(isAac&&this.transmuxPipeline_.type!=='aac'){this.setupAacPipeline();}else if(!isAac&&this.transmuxPipeline_.type!=='ts'){this.setupTsPipeline();}
2214hasFlushed=false;}
2215this.transmuxPipeline_.headOfPipeline.push(data);};this.flush=function(){hasFlushed=true;this.transmuxPipeline_.headOfPipeline.flush();};this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline();};this.reset=function(){if(this.transmuxPipeline_.headOfPipeline){this.transmuxPipeline_.headOfPipeline.reset();}};this.resetCaptions=function(){if(this.transmuxPipeline_.captionStream){this.transmuxPipeline_.captionStream.reset();}};};_Transmuxer.prototype=new stream();var transmuxer={Transmuxer:_Transmuxer,VideoSegmentStream:_VideoSegmentStream,AudioSegmentStream:_AudioSegmentStream,AUDIO_PROPERTIES:AUDIO_PROPERTIES,VIDEO_PROPERTIES:VIDEO_PROPERTIES,generateVideoSegmentTimingInfo:generateVideoSegmentTimingInfo};var classCallCheck=function classCallCheck(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||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}
2216return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();var wireTransmuxerEvents=function wireTransmuxerEvents(self,transmuxer$$1){transmuxer$$1.on('data',function(segment){var initArray=segment.initSegment;segment.initSegment={data:initArray.buffer,byteOffset:initArray.byteOffset,byteLength:initArray.byteLength};var typedArray=segment.data;segment.data=typedArray.buffer;self.postMessage({action:'data',segment:segment,byteOffset:typedArray.byteOffset,byteLength:typedArray.byteLength},[segment.data]);});if(transmuxer$$1.captionStream){transmuxer$$1.captionStream.on('data',function(caption){self.postMessage({action:'caption',data:caption});});}
2217transmuxer$$1.on('done',function(data){self.postMessage({action:'done'});});transmuxer$$1.on('gopInfo',function(gopInfo){self.postMessage({action:'gopInfo',gopInfo:gopInfo});});transmuxer$$1.on('videoSegmentTimingInfo',function(videoSegmentTimingInfo){self.postMessage({action:'videoSegmentTimingInfo',videoSegmentTimingInfo:videoSegmentTimingInfo});});};var MessageHandlers=function(){function MessageHandlers(self,options){classCallCheck(this,MessageHandlers);this.options=options||{};this.self=self;this.init();}
2218createClass(MessageHandlers,[{key:'init',value:function init(){if(this.transmuxer){this.transmuxer.dispose();}
2219this.transmuxer=new transmuxer.Transmuxer(this.options);wireTransmuxerEvents(this.self,this.transmuxer);}},{key:'push',value:function push(data){var segment=new Uint8Array(data.data,data.byteOffset,data.byteLength);this.transmuxer.push(segment);}},{key:'reset',value:function reset(){this.init();}},{key:'setTimestampOffset',value:function setTimestampOffset(data){var timestampOffset=data.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(timestampOffset*90000));}},{key:'setAudioAppendStart',value:function setAudioAppendStart(data){this.transmuxer.setAudioAppendStart(Math.ceil(data.appendStart*90000));}},{key:'flush',value:function flush(data){this.transmuxer.flush();}},{key:'resetCaptions',value:function resetCaptions(){this.transmuxer.resetCaptions();}},{key:'alignGopsWith',value:function alignGopsWith(data){this.transmuxer.alignGopsWith(data.gopsToAlignWith.slice());}}]);return MessageHandlers;}();var TransmuxerWorker=function TransmuxerWorker(self){self.onmessage=function(event){if(event.data.action==='init'&&event.data.options){this.messageHandlers=new MessageHandlers(self,event.data.options);return;}
2220if(!this.messageHandlers){this.messageHandlers=new MessageHandlers(self);}
2221if(event.data&&event.data.action&&event.data.action!=='init'){if(this.messageHandlers[event.data.action]){this.messageHandlers[event.data.action](event.data);}}};};var transmuxerWorker=new TransmuxerWorker(self);return transmuxerWorker;}();});var defaultCodecs={videoCodec:'avc1',videoObjectTypeIndicator:'.4d400d',audioProfile:'2'};var translateLegacyCodecs=function translateLegacyCodecs(codecs){return codecs.map(function(codec){return codec.replace(/avc1\.(\d+)\.(\d+)/i,function(orig,profile,avcLevel){var profileHex=('00'+Number(profile).toString(16)).slice(-2);var avcLevelHex=('00'+Number(avcLevel).toString(16)).slice(-2);return 'avc1.'+profileHex+'00'+avcLevelHex;});});};var parseCodecs=function parseCodecs(){var codecs=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'';var result={codecCount:0};var parsed=void 0;result.codecCount=codecs.split(',').length;result.codecCount=result.codecCount||2;parsed=/(^|\s|,)+(avc[13])([^ ,]*)/i.exec(codecs);if(parsed){result.videoCodec=parsed[2];result.videoObjectTypeIndicator=parsed[3];}
2222result.audioProfile=/(^|\s|,)+mp4a.[0-9A-Fa-f]+\.([0-9A-Fa-f]+)/i.exec(codecs);result.audioProfile=result.audioProfile&&result.audioProfile[2];return result;};var mapLegacyAvcCodecs=function mapLegacyAvcCodecs(codecString){return codecString.replace(/avc1\.(\d+)\.(\d+)/i,function(match){return translateLegacyCodecs([match])[0];});};var makeMimeTypeString=function makeMimeTypeString(type,container,codecs){return type+'/'+container+'; codecs="'+codecs.filter(function(c){return!!c;}).join(', ')+'"';};var getContainerType=function getContainerType(media){if(media.segments&&media.segments.length&&media.segments[0].map){return 'mp4';}
2223return 'mp2t';};var getCodecs=function getCodecs(media){var mediaAttributes=media.attributes||{};if(mediaAttributes.CODECS){return parseCodecs(mediaAttributes.CODECS);}
2224return defaultCodecs;};var audioProfileFromDefault=function audioProfileFromDefault(master,audioGroupId){if(!master.mediaGroups.AUDIO||!audioGroupId){return null;}
2225var audioGroup=master.mediaGroups.AUDIO[audioGroupId];if(!audioGroup){return null;}
2226for(var name in audioGroup){var audioType=audioGroup[name];if(audioType["default"]&&audioType.playlists){return parseCodecs(audioType.playlists[0].attributes.CODECS).audioProfile;}}
2227return null;};var mimeTypesForPlaylist=function mimeTypesForPlaylist(master,media){var containerType=getContainerType(media);var codecInfo=getCodecs(media);var mediaAttributes=media.attributes||{};var isMuxed=true;var isMaat=false;if(!media){return[];}
2228if(master.mediaGroups.AUDIO&&mediaAttributes.AUDIO){var audioGroup=master.mediaGroups.AUDIO[mediaAttributes.AUDIO];if(audioGroup){isMaat=true;isMuxed=false;for(var groupId in audioGroup){if(!audioGroup[groupId].uri&&!audioGroup[groupId].playlists){isMuxed=true;break;}}}}
2229if(isMaat&&!codecInfo.audioProfile){if(!isMuxed){codecInfo.audioProfile=audioProfileFromDefault(master,mediaAttributes.AUDIO);}
2230if(!codecInfo.audioProfile){videojs$1.log.warn('Multiple audio tracks present but no audio codec string is specified. '+'Attempting to use the default audio codec (mp4a.40.2)');codecInfo.audioProfile=defaultCodecs.audioProfile;}}
2231var codecStrings={};if(codecInfo.videoCodec){codecStrings.video=''+codecInfo.videoCodec+codecInfo.videoObjectTypeIndicator;}
2232if(codecInfo.audioProfile){codecStrings.audio='mp4a.40.'+codecInfo.audioProfile;}
2233var justAudio=makeMimeTypeString('audio',containerType,[codecStrings.audio]);var justVideo=makeMimeTypeString('video',containerType,[codecStrings.video]);var bothVideoAudio=makeMimeTypeString('video',containerType,[codecStrings.video,codecStrings.audio]);if(isMaat){if(!isMuxed&&codecStrings.video){return[justVideo,justAudio];}
2234if(!isMuxed&&!codecStrings.video){return[justAudio,justAudio];}
2235return[bothVideoAudio,justAudio];}
2236if(!codecStrings.video){return[justAudio];}
2237return[bothVideoAudio];};var parseContentType=function parseContentType(type){var object={type:'',parameters:{}};var parameters=type.trim().split(';');object.type=parameters.shift().trim();parameters.forEach(function(parameter){var pair=parameter.trim().split('=');if(pair.length>1){var name=pair[0].replace(/"/g,'').trim();var value=pair[1].replace(/"/g,'').trim();object.parameters[name]=value;}});return object;};var isAudioCodec=function isAudioCodec(codec){return /mp4a\.\d+.\d+/i.test(codec);};var isVideoCodec=function isVideoCodec(codec){return /avc1\.[\da-f]+/i.test(codec);};var gopsSafeToAlignWith=function gopsSafeToAlignWith(buffer,currentTime,mapping){if(typeof currentTime==='undefined'||currentTime===null||!buffer.length){return[];}
2238var currentTimePts=Math.ceil((currentTime-mapping+3)*90000);var i=void 0;for(i=0;i<buffer.length;i++){if(buffer[i].pts>currentTimePts){break;}}
2239return buffer.slice(i);};var updateGopBuffer=function updateGopBuffer(buffer,gops,replace){if(!gops.length){return buffer;}
2240if(replace){return gops.slice();}
2241var start=gops[0].pts;var i=0;for(i;i<buffer.length;i++){if(buffer[i].pts>=start){break;}}
2242return buffer.slice(0,i).concat(gops);};var removeGopBuffer=function removeGopBuffer(buffer,start,end,mapping){var startPts=Math.ceil((start-mapping)*90000);var endPts=Math.ceil((end-mapping)*90000);var updatedBuffer=buffer.slice();var i=buffer.length;while(i--){if(buffer[i].pts<=endPts){break;}}
2243if(i===-1){return updatedBuffer;}
2244var j=i+1;while(j--){if(buffer[j].pts<=startPts){break;}}
2245j=Math.max(j,0);updatedBuffer.splice(j,i-j+1);return updatedBuffer;};var buffered=function buffered(videoBuffer,audioBuffer,audioDisabled){var start=null;var end=null;var arity=0;var extents=[];var ranges=[];if(!videoBuffer&&!audioBuffer){return videojs$1.createTimeRange();}
2246if(!videoBuffer){return audioBuffer.buffered;}
2247if(!audioBuffer){return videoBuffer.buffered;}
2248if(audioDisabled){return videoBuffer.buffered;}
2249if(videoBuffer.buffered.length===0&&audioBuffer.buffered.length===0){return videojs$1.createTimeRange();}
2250var videoBuffered=videoBuffer.buffered;var audioBuffered=audioBuffer.buffered;var count=videoBuffered.length;while(count--){extents.push({time:videoBuffered.start(count),type:'start'});extents.push({time:videoBuffered.end(count),type:'end'});}
2251count=audioBuffered.length;while(count--){extents.push({time:audioBuffered.start(count),type:'start'});extents.push({time:audioBuffered.end(count),type:'end'});}
2252extents.sort(function(a,b){return a.time-b.time;});for(count=0;count<extents.length;count++){if(extents[count].type==='start'){arity++;if(arity===2){start=extents[count].time;}}else if(extents[count].type==='end'){arity--;if(arity===1){end=extents[count].time;}}
2253if(start!==null&&end!==null){ranges.push([start,end]);start=null;end=null;}}
2254return videojs$1.createTimeRanges(ranges);};var ONE_SECOND_IN_TS$2=90000;var makeWrappedSourceBuffer=function makeWrappedSourceBuffer(mediaSource,mimeType){var sourceBuffer=mediaSource.addSourceBuffer(mimeType);var wrapper=Object.create(null);wrapper.updating=false;wrapper.realBuffer_=sourceBuffer;var _loop=function _loop(key){if(typeof sourceBuffer[key]==='function'){wrapper[key]=function(){return sourceBuffer[key].apply(sourceBuffer,arguments);};}else if(typeof wrapper[key]==='undefined'){Object.defineProperty(wrapper,key,{get:function get$$1(){return sourceBuffer[key];},set:function set$$1(v){return sourceBuffer[key]=v;}});}};for(var key in sourceBuffer){_loop(key);}
2255return wrapper;};var VirtualSourceBuffer=function(_videojs$EventTarget){inherits$2(VirtualSourceBuffer,_videojs$EventTarget);function VirtualSourceBuffer(mediaSource,codecs){classCallCheck$1(this,VirtualSourceBuffer);var _this=possibleConstructorReturn$1(this,(VirtualSourceBuffer.__proto__||Object.getPrototypeOf(VirtualSourceBuffer)).call(this,videojs$1.EventTarget));_this.timestampOffset_=0;_this.pendingBuffers_=[];_this.bufferUpdating_=false;_this.mediaSource_=mediaSource;_this.codecs_=codecs;_this.audioCodec_=null;_this.videoCodec_=null;_this.audioDisabled_=false;_this.appendAudioInitSegment_=true;_this.gopBuffer_=[];_this.timeMapping_=0;_this.safeAppend_=videojs$1.browser.IE_VERSION>=11;var options={remux:false,alignGopsAtEnd:_this.safeAppend_};_this.codecs_.forEach(function(codec){if(isAudioCodec(codec)){_this.audioCodec_=codec;}else if(isVideoCodec(codec)){_this.videoCodec_=codec;}});_this.transmuxer_=new TransmuxWorker();_this.transmuxer_.postMessage({action:'init',options:options});_this.transmuxer_.onmessage=function(event){if(event.data.action==='data'){return _this.data_(event);}
2256if(event.data.action==='done'){return _this.done_(event);}
2257if(event.data.action==='gopInfo'){return _this.appendGopInfo_(event);}
2258if(event.data.action==='videoSegmentTimingInfo'){return _this.videoSegmentTimingInfo_(event.data.videoSegmentTimingInfo);}};Object.defineProperty(_this,'timestampOffset',{get:function get$$1(){return this.timestampOffset_;},set:function set$$1(val){if(typeof val==='number'&&val>=0){this.timestampOffset_=val;this.appendAudioInitSegment_=true;this.gopBuffer_.length=0;this.timeMapping_=0;this.transmuxer_.postMessage({action:'setTimestampOffset',timestampOffset:val});}}});Object.defineProperty(_this,'appendWindowStart',{get:function get$$1(){return(this.videoBuffer_||this.audioBuffer_).appendWindowStart;},set:function set$$1(start){if(this.videoBuffer_){this.videoBuffer_.appendWindowStart=start;}
2259if(this.audioBuffer_){this.audioBuffer_.appendWindowStart=start;}}});Object.defineProperty(_this,'updating',{get:function get$$1(){return!!(this.bufferUpdating_||!this.audioDisabled_&&this.audioBuffer_&&this.audioBuffer_.updating||this.videoBuffer_&&this.videoBuffer_.updating);}});Object.defineProperty(_this,'buffered',{get:function get$$1(){return buffered(this.videoBuffer_,this.audioBuffer_,this.audioDisabled_);}});return _this;}
2260createClass$1(VirtualSourceBuffer,[{key:'data_',value:function data_(event){var segment=event.data.segment;segment.data=new Uint8Array(segment.data,event.data.byteOffset,event.data.byteLength);segment.initSegment=new Uint8Array(segment.initSegment.data,segment.initSegment.byteOffset,segment.initSegment.byteLength);createTextTracksIfNecessary(this,this.mediaSource_,segment);this.pendingBuffers_.push(segment);return;}},{key:'done_',value:function done_(event){if(this.mediaSource_.readyState==='closed'){this.pendingBuffers_.length=0;return;}
2261this.processPendingSegments_();return;}},{key:'videoSegmentTimingInfo_',value:function videoSegmentTimingInfo_(timingInfo){var timingInfoInSeconds={start:{decode:timingInfo.start.dts/ONE_SECOND_IN_TS$2,presentation:timingInfo.start.pts/ONE_SECOND_IN_TS$2},end:{decode:timingInfo.end.dts/ONE_SECOND_IN_TS$2,presentation:timingInfo.end.pts/ONE_SECOND_IN_TS$2},baseMediaDecodeTime:timingInfo.baseMediaDecodeTime/ONE_SECOND_IN_TS$2};if(timingInfo.prependedContentDuration){timingInfoInSeconds.prependedContentDuration=timingInfo.prependedContentDuration/ONE_SECOND_IN_TS$2;}
2262this.trigger({type:'videoSegmentTimingInfo',videoSegmentTimingInfo:timingInfoInSeconds});}},{key:'createRealSourceBuffers_',value:function createRealSourceBuffers_(){var _this2=this;var types=['audio','video'];types.forEach(function(type){if(!_this2[type+'Codec_']){return;}
2263if(_this2[type+'Buffer_']){return;}
2264var buffer=null;if(_this2.mediaSource_[type+'Buffer_']){buffer=_this2.mediaSource_[type+'Buffer_'];buffer.updating=false;}else{var codecProperty=type+'Codec_';var mimeType=type+'/mp4;codecs="'+_this2[codecProperty]+'"';buffer=makeWrappedSourceBuffer(_this2.mediaSource_.nativeMediaSource_,mimeType);_this2.mediaSource_[type+'Buffer_']=buffer;}
2265_this2[type+'Buffer_']=buffer;['update','updatestart','updateend'].forEach(function(event){buffer.addEventListener(event,function(){if(type==='audio'&&_this2.audioDisabled_){return;}
2266if(event==='updateend'){_this2[type+'Buffer_'].updating=false;}
2267var shouldTrigger=types.every(function(t){if(t==='audio'&&_this2.audioDisabled_){return true;}
2268if(type!==t&&_this2[t+'Buffer_']&&_this2[t+'Buffer_'].updating){return false;}
2269return true;});if(shouldTrigger){return _this2.trigger(event);}});});});}},{key:'appendBuffer',value:function appendBuffer(segment){this.bufferUpdating_=true;if(this.audioBuffer_&&this.audioBuffer_.buffered.length){var audioBuffered=this.audioBuffer_.buffered;this.transmuxer_.postMessage({action:'setAudioAppendStart',appendStart:audioBuffered.end(audioBuffered.length-1)});}
2270if(this.videoBuffer_){this.transmuxer_.postMessage({action:'alignGopsWith',gopsToAlignWith:gopsSafeToAlignWith(this.gopBuffer_,this.mediaSource_.player_?this.mediaSource_.player_.currentTime():null,this.timeMapping_)});}
2271this.transmuxer_.postMessage({action:'push',data:segment.buffer,byteOffset:segment.byteOffset,byteLength:segment.byteLength},[segment.buffer]);this.transmuxer_.postMessage({action:'flush'});}},{key:'appendGopInfo_',value:function appendGopInfo_(event){this.gopBuffer_=updateGopBuffer(this.gopBuffer_,event.data.gopInfo,this.safeAppend_);}},{key:'remove',value:function remove(start,end){if(this.videoBuffer_){this.videoBuffer_.updating=true;this.videoBuffer_.remove(start,end);this.gopBuffer_=removeGopBuffer(this.gopBuffer_,start,end,this.timeMapping_);}
2272if(!this.audioDisabled_&&this.audioBuffer_){this.audioBuffer_.updating=true;this.audioBuffer_.remove(start,end);}
2273removeCuesFromTrack(start,end,this.metadataTrack_);if(this.inbandTextTracks_){for(var track in this.inbandTextTracks_){removeCuesFromTrack(start,end,this.inbandTextTracks_[track]);}}}},{key:'processPendingSegments_',value:function processPendingSegments_(){var sortedSegments={video:{segments:[],bytes:0},audio:{segments:[],bytes:0},captions:[],metadata:[]};if(!this.pendingBuffers_.length){this.trigger('updateend');this.bufferUpdating_=false;return;}
2274sortedSegments=this.pendingBuffers_.reduce(function(segmentObj,segment){var type=segment.type;var data=segment.data;var initSegment=segment.initSegment;segmentObj[type].segments.push(data);segmentObj[type].bytes+=data.byteLength;segmentObj[type].initSegment=initSegment;if(segment.captions){segmentObj.captions=segmentObj.captions.concat(segment.captions);}
2275if(segment.info){segmentObj[type].info=segment.info;}
2276if(segment.metadata){segmentObj.metadata=segmentObj.metadata.concat(segment.metadata);}
2277return segmentObj;},sortedSegments);if(!this.videoBuffer_&&!this.audioBuffer_){if(sortedSegments.video.bytes===0){this.videoCodec_=null;}
2278if(sortedSegments.audio.bytes===0){this.audioCodec_=null;}
2279this.createRealSourceBuffers_();}
2280if(sortedSegments.audio.info){this.mediaSource_.trigger({type:'audioinfo',info:sortedSegments.audio.info});}
2281if(sortedSegments.video.info){this.mediaSource_.trigger({type:'videoinfo',info:sortedSegments.video.info});}
2282if(this.appendAudioInitSegment_){if(!this.audioDisabled_&&this.audioBuffer_){sortedSegments.audio.segments.unshift(sortedSegments.audio.initSegment);sortedSegments.audio.bytes+=sortedSegments.audio.initSegment.byteLength;}
2283this.appendAudioInitSegment_=false;}
2284var triggerUpdateend=false;if(this.videoBuffer_&&sortedSegments.video.bytes){sortedSegments.video.segments.unshift(sortedSegments.video.initSegment);sortedSegments.video.bytes+=sortedSegments.video.initSegment.byteLength;this.concatAndAppendSegments_(sortedSegments.video,this.videoBuffer_);}else if(this.videoBuffer_&&(this.audioDisabled_||!this.audioBuffer_)){triggerUpdateend=true;}
2285addTextTrackData(this,sortedSegments.captions,sortedSegments.metadata);if(!this.audioDisabled_&&this.audioBuffer_){this.concatAndAppendSegments_(sortedSegments.audio,this.audioBuffer_);}
2286this.pendingBuffers_.length=0;if(triggerUpdateend){this.trigger('updateend');}
2287this.bufferUpdating_=false;}},{key:'concatAndAppendSegments_',value:function concatAndAppendSegments_(segmentObj,destinationBuffer){var offset=0;var tempBuffer=void 0;if(segmentObj.bytes){tempBuffer=new Uint8Array(segmentObj.bytes);segmentObj.segments.forEach(function(segment){tempBuffer.set(segment,offset);offset+=segment.byteLength;});try{destinationBuffer.updating=true;destinationBuffer.appendBuffer(tempBuffer);}catch(error){if(this.mediaSource_.player_){this.mediaSource_.player_.error({code:-3,type:'APPEND_BUFFER_ERR',message:error.message,originalError:error});}}}}},{key:'abort',value:function abort(){if(this.videoBuffer_){this.videoBuffer_.abort();}
2288if(!this.audioDisabled_&&this.audioBuffer_){this.audioBuffer_.abort();}
2289if(this.transmuxer_){this.transmuxer_.postMessage({action:'reset'});}
2290this.pendingBuffers_.length=0;this.bufferUpdating_=false;}},{key:'dispose',value:function dispose(){if(this.transmuxer_){this.transmuxer_.terminate();}
2291this.trigger('dispose');this.off();}}]);return VirtualSourceBuffer;}(videojs$1.EventTarget);var HtmlMediaSource=function(_videojs$EventTarget){inherits$2(HtmlMediaSource,_videojs$EventTarget);function HtmlMediaSource(){classCallCheck$1(this,HtmlMediaSource);var _this=possibleConstructorReturn$1(this,(HtmlMediaSource.__proto__||Object.getPrototypeOf(HtmlMediaSource)).call(this));var property=void 0;_this.nativeMediaSource_=new window$3.MediaSource();for(property in _this.nativeMediaSource_){if(!(property in HtmlMediaSource.prototype)&&typeof _this.nativeMediaSource_[property]==='function'){_this[property]=_this.nativeMediaSource_[property].bind(_this.nativeMediaSource_);}}
2292_this.duration_=NaN;Object.defineProperty(_this,'duration',{get:function get$$1(){if(this.duration_===Infinity){return this.duration_;}
2293return this.nativeMediaSource_.duration;},set:function set$$1(duration){this.duration_=duration;if(duration!==Infinity){this.nativeMediaSource_.duration=duration;return;}}});Object.defineProperty(_this,'seekable',{get:function get$$1(){if(this.duration_===Infinity){return videojs$1.createTimeRanges([[0,this.nativeMediaSource_.duration]]);}
2294return this.nativeMediaSource_.seekable;}});Object.defineProperty(_this,'readyState',{get:function get$$1(){return this.nativeMediaSource_.readyState;}});Object.defineProperty(_this,'activeSourceBuffers',{get:function get$$1(){return this.activeSourceBuffers_;}});_this.sourceBuffers=[];_this.activeSourceBuffers_=[];_this.updateActiveSourceBuffers_=function(){_this.activeSourceBuffers_.length=0;if(_this.sourceBuffers.length===1){var sourceBuffer=_this.sourceBuffers[0];sourceBuffer.appendAudioInitSegment_=true;sourceBuffer.audioDisabled_=!sourceBuffer.audioCodec_;_this.activeSourceBuffers_.push(sourceBuffer);return;}
2295var disableCombined=false;var disableAudioOnly=true;for(var i=0;i<_this.player_.audioTracks().length;i++){var track=_this.player_.audioTracks()[i];if(track.enabled&&track.kind!=='main'){disableCombined=true;disableAudioOnly=false;break;}}
2296_this.sourceBuffers.forEach(function(sourceBuffer,index){sourceBuffer.appendAudioInitSegment_=true;if(sourceBuffer.videoCodec_&&sourceBuffer.audioCodec_){sourceBuffer.audioDisabled_=disableCombined;}else if(sourceBuffer.videoCodec_&&!sourceBuffer.audioCodec_){sourceBuffer.audioDisabled_=true;disableAudioOnly=false;}else if(!sourceBuffer.videoCodec_&&sourceBuffer.audioCodec_){sourceBuffer.audioDisabled_=index?disableAudioOnly:!disableAudioOnly;if(sourceBuffer.audioDisabled_){return;}}
2297_this.activeSourceBuffers_.push(sourceBuffer);});};_this.onPlayerMediachange_=function(){_this.sourceBuffers.forEach(function(sourceBuffer){sourceBuffer.appendAudioInitSegment_=true;});};_this.onHlsReset_=function(){_this.sourceBuffers.forEach(function(sourceBuffer){if(sourceBuffer.transmuxer_){sourceBuffer.transmuxer_.postMessage({action:'resetCaptions'});}});};_this.onHlsSegmentTimeMapping_=function(event){_this.sourceBuffers.forEach(function(buffer){return buffer.timeMapping_=event.mapping;});};['sourceopen','sourceclose','sourceended'].forEach(function(eventName){this.nativeMediaSource_.addEventListener(eventName,this.trigger.bind(this));},_this);_this.on('sourceopen',function(event){var video=document.querySelector('[src="'+_this.url_+'"]');if(!video){return;}
2298_this.player_=videojs$1(video.parentNode);if(!_this.player_){return;}
2299_this.player_.tech_.on('hls-reset',_this.onHlsReset_);_this.player_.tech_.on('hls-segment-time-mapping',_this.onHlsSegmentTimeMapping_);if(_this.player_.audioTracks&&_this.player_.audioTracks()){_this.player_.audioTracks().on('change',_this.updateActiveSourceBuffers_);_this.player_.audioTracks().on('addtrack',_this.updateActiveSourceBuffers_);_this.player_.audioTracks().on('removetrack',_this.updateActiveSourceBuffers_);}
2300_this.player_.on('mediachange',_this.onPlayerMediachange_);});_this.on('sourceended',function(event){var duration=durationOfVideo(_this.duration);for(var i=0;i<_this.sourceBuffers.length;i++){var sourcebuffer=_this.sourceBuffers[i];var cues=sourcebuffer.metadataTrack_&&sourcebuffer.metadataTrack_.cues;if(cues&&cues.length){cues[cues.length-1].endTime=duration;}}});_this.on('sourceclose',function(event){this.sourceBuffers.forEac
2300h(function(sourceBuffer){if(sourceBuffer.transmuxer_){sourceBuffer.transmuxer_.terminate();}});this.sourceBuffers.length=0;if(!this.player_){return;}
2301if(this.player_.audioTracks&&this.player_.audioTracks()){this.player_.audioTracks().off('change',this.updateActiveSourceBuffers_);this.player_.audioTracks().off('addtrack',this.updateActiveSourceBuffers_);this.player_.audioTracks().off('removetrack',this.updateActiveSourceBuffers_);}
2302if(this.player_.el_){this.player_.off('mediachange',this.onPlayerMediachange_);}
2303if(this.player_.tech_&&this.player_.tech_.el_){this.player_.tech_.off('hls-reset',this.onHlsReset_);this.player_.tech_.off('hls-segment-time-mapping',this.onHlsSegmentTimeMapping_);}});return _this;}
2304createClass$1(HtmlMediaSource,[{key:'addSeekableRange_',value:function addSeekableRange_(start,end){var error=void 0;if(this.duration!==Infinity){error=new Error('MediaSource.addSeekableRange() can only be invoked '+'when the duration is Infinity');error.name='InvalidStateError';error.code=11;throw error;}
2305if(end>this.nativeMediaSource_.duration||isNaN(this.nativeMediaSource_.duration)){this.nativeMediaSource_.duration=end;}}},{key:'addSourceBuffer',value:function addSourceBuffer(type){var buffer=void 0;var parsedType=parseContentType(type);if(/^(video|audio)\/mp2t$/i.test(parsedType.type)){var codecs=[];if(parsedType.parameters&&parsedType.parameters.codecs){codecs=parsedType.parameters.codecs.split(',');codecs=translateLegacyCodecs(codecs);codecs=codecs.filter(function(codec){return isAudioCodec(codec)||isVideoCodec(codec);});}
2306if(codecs.length===0){codecs=['avc1.4d400d','mp4a.40.2'];}
2307buffer=new VirtualSourceBuffer(this,codecs);if(this.sourceBuffers.length!==0){this.sourceBuffers[0].createRealSourceBuffers_();buffer.createRealSourceBuffers_();this.sourceBuffers[0].audioDisabled_=true;}}else{buffer=this.nativeMediaSource_.addSourceBuffer(type);}
2308this.sourceBuffers.push(buffer);return buffer;}},{key:'dispose',value:function dispose(){this.trigger('dispose');this.off();this.sourceBuffers.forEach(function(buffer){if(buffer.dispose){buffer.dispose();}});this.sourceBuffers.length=0;}}]);return HtmlMediaSource;}(videojs$1.EventTarget);var urlCount=0;videojs$1.mediaSources={};var open=function open(msObjectURL,swfId){var mediaSource=videojs$1.mediaSources[msObjectURL];if(mediaSource){mediaSource.trigger({type:'sourceopen',swfId:swfId});}else{throw new Error('Media Source not found (Video.js)');}};var supportsNativeMediaSources=function supportsNativeMediaSources(){return!!window$3.MediaSource&&!!window$3.MediaSource.isTypeSupported&&window$3.MediaSource.isTypeSupported('video/mp4;codecs="avc1.4d400d,mp4a.40.2"');};var MediaSource=function MediaSource(){this.MediaSource={open:open,supportsNativeMediaSources:supportsNativeMediaSources};if(supportsNativeMediaSources()){return new HtmlMediaSource();}
2309throw new Error('Cannot use create a virtual MediaSource for this video');};MediaSource.open=open;MediaSource.supportsNativeMediaSources=supportsNativeMediaSources;var URL$1={createObjectURL:function createObjectURL(object){var objectUrlPrefix='blob:vjs-media-source/';var url=void 0;if(object instanceof HtmlMediaSource){url=window$3.URL.createObjectURL(object.nativeMediaSource_);object.url_=url;return url;}
2310if(!(object instanceof HtmlMediaSource)){url=window$3.URL.createObjectURL(object);object.url_=url;return url;}
2311url=objectUrlPrefix+urlCount;urlCount++;videojs$1.mediaSources[url]=object;return url;}};videojs$1.MediaSource=MediaSource;videojs$1.URL=URL$1;var EventTarget$1$1=videojs$1.EventTarget,mergeOptions$2=videojs$1.mergeOptions;var updateMaster$1=function updateMaster$$1(oldMaster,newMaster){var noChanges=void 0;var update=mergeOptions$2(oldMaster,{duration:newMaster.duration,minimumUpdatePeriod:newMaster.minimumUpdatePeriod});for(var i=0;i<newMaster.playlists.length;i++){var playlistUpdate=updateMaster(update,newMaster.playlists[i]);if(playlistUpdate){update=playlistUpdate;}else{noChanges=true;}}
2312forEachMediaGroup(newMaster,function(properties,type,group,label){if(properties.playlists&&properties.playlists.length){var id=properties.playlists[0].id;var _playlistUpdate=updateMaster(update,properties.playlists[0]);if(_playlistUpdate){update=_playlistUpdate;update.mediaGroups[type][group][label].playlists[0]=update.playlists[id];noChanges=false;}}});if(noChanges){return null;}
2313return update;};var generateSidxKey=function generateSidxKey(sidxInfo){var sidxByteRangeEnd=sidxInfo.byterange.offset+sidxInfo.byterange.length-1;return sidxInfo.uri+'-'+sidxInfo.byterange.offset+'-'+sidxByteRangeEnd;};var equivalentSidx=function equivalentSidx(a,b){var neitherMap=Boolean(!a.map&&!b.map);var equivalentMap=neitherMap||Boolean(a.map&&b.map&&a.map.byterange.offset===b.map.byterange.offset&&a.map.byterange.length===b.map.byterange.length);return equivalentMap&&a.uri===b.uri&&a.byterange.offset===b.byterange.offset&&a.byterange.length===b.byterange.length;};var compareSidxEntry=function compareSidxEntry(playlists,oldSidxMapping){var newSidxMapping={};for(var id in playlists){var playlist=playlists[id];var currentSidxInfo=playlist.sidx;if(currentSidxInfo){var key=generateSidxKey(currentSidxInfo);if(!oldSidxMapping[key]){break;}
2314var savedSidxInfo=oldSidxMapping[key].sidxInfo;
2314if(equivalentSidx(savedSidxInfo,currentSidxInfo)){newSidxMapping[key]=oldSidxMapping[key];}}}
2315return newSidxMapping;};var filterChangedSidxMappings=function filterChangedSidxMappings(masterXml,srcUrl,clientOffset,oldSidxMapping){var master=parse(masterXml,{manifestUri:srcUrl,clientOffset:clientOffset});var videoSidx=compareSidxEntry(master.playlists,oldSidxMapping);var mediaGroupSidx=videoSidx;forEachMediaGroup(master,function(properties,mediaType,groupKey,labelKey){if(properties.playlists&&properties.playlists.length){var playlists=properties.playlists;mediaGroupSidx=mergeOptions$2(mediaGroupSidx,compareSidxEntry(playlists,oldSidxMapping));}});return mediaGroupSidx;};var requestSidx_=function requestSidx_(sidxRange,playlist,xhr,options,finishProcessingFn){var sidxInfo={uri:resolveManifestRedirect(options.handleManifestRedirects,sidxRange.resolvedUri),byterange:sidxRange.byterange,playlist:playlist};var sidxRequestOptions=videojs$1.mergeOptions(sidxInfo,{responseType:'arraybuffer',headers:segmentXhrHeaders(sidxInfo)});return xhr(sidxRequestOptions,finishProcessingFn);};var DashPlaylistLoader=function(_EventTarget){inherits$2(DashPlaylistLoader,_EventTarget);function DashPlaylistLoader(srcUrlOrPlaylist,hls){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var masterPlaylistLoader=arguments[3];classCallCheck$1(this,DashPlaylistLoader);var _this=possibleConstructorReturn$1(this,(DashPlaylistLoader.__proto__||Object.getPrototypeOf(DashPlaylistLoader)).call(this));var _options$withCredenti=options.withCredentials,withCredentials=_options$withCredenti===undefined?false:_options$withCredenti,_options$handleManife=options.handleManifestRedirects,handleManifestRedirects=_options$handleManife===undefined?false:_options$handleManife;_this.hls_=hls;_this.withCredentials=withCredentials;_this.handleManifestRedirects=handleManifestRedirects;if(!srcUrlOrPlaylist){throw new Error('A non-empty playlist URL or playlist is required');}
2316_this.on('minimumUpdatePeriod',function(){_this.refreshXml_();});_this.on('mediaupdatetimeout',function(){_this.refreshMedia_(_this.media().id);});_this.state='HAVE_NOTHING';_this.loadedPlaylists_={};if(typeof srcUrlOrPlaylist==='string'){_this.srcUrl=srcUrlOrPlaylist;_this.sidxMapping_={};return possibleConstructorReturn$1(_this);}
2317_this.setupChildLoader(masterPlaylistLoader,srcUrlOrPlaylist);return _this;}
2318createClass$1(DashPlaylistLoader,[{key:'setupChildLoader',value:function setupChildLoader(masterPlaylistLoader,playlist){this.masterPlaylistLoader_=masterPlaylistLoader;this.childPlaylist_=playlist;}},{key:'dispose',value:function dispose(){this.trigger('dispose');this.stopRequest();this.loadedPlaylists_={};window$3.clearTimeout(this.minimumUpdatePeriodTimeout_);window$3.clearTimeout(this.mediaRequest_);window$3.clearTimeout(this.mediaUpdateTimeout);this.off();}},{key:'hasPendingRequest',value:function hasPendingRequest(){return this.request||this.mediaRequest_;}},{key:'stopRequest',value:function stopRequest(){if(this.request){var oldRequest=this.request;this.request=null;oldRequest.onreadystatechange=null;oldRequest.abort();}}},{key:'sidxRequestFinished_',value:function sidxRequestFinished_(playlist,master,startingState,doneFn){var _this2=this;return function(err,request){if(!_this2.request){return;}
2319_this2.request=null;if(err){_this2.error={status:request.status,message:'DASH playlist request error at URL: '+playlist.uri,response:request.response,code:2};if(startingState){_this2.state=startingState;}
2320_this2.trigger('error');return doneFn(master,null);}
2321var bytes=new Uint8Array(request.response);var sidx=mp4Inspector.parseSidx(bytes.subarray(8));return doneFn(master,sidx);};}},{key:'media',value:function media(playlist){var _this3=this;if(!playlist){return this.media_;}
2322if(this.state==='HAVE_NOTHING'){throw new Error('Cannot switch media playlist from '+this.state);}
2323var startingState=this.state;if(typeof playlist==='string'){if(!this.master.playlists[playlist]){throw new Error('Unknown playlist URI: '+playlist);}
2324playlist=this.master.playlists[playlist];}
2325var mediaChange=!this.media_||playlist.id!==this.media_.id;if(mediaChange&&this.loadedPlaylists_[playlist.id]&&this.loadedPlaylists_[playlist.id].endList){this.state='HAVE_METADATA';this.media_=playlist;if(mediaChange){this.trigger('mediachanging');this.trigger('mediachange');}
2326return;}
2327if(!mediaChange){return;}
2328if(this.media_){this.trigger('mediachanging');}
2329if(!playlist.sidx){this.mediaRequest_=window$3.setTimeout(this.haveMetadata.bind(this,{startingState:startingState,playlist:playlist}),0);return;}
2330var oldMaster=void 0;var sidxMapping=void 0;if(this.masterPlaylistLoader_){oldMaster=this.masterPlaylistLoader_.master;sidxMapping=this.masterPlaylistLoader_.sidxMapping_;}else{oldMaster=this.master;sidxMapping=this.sidxMapping_;}
2331var sidxKey=generateSidxKey(playlist.sidx);sidxMapping[sidxKey]={sidxInfo:playlist.sidx};this.request=requestSidx_(playlist.sidx,playlist,this.hls_.xhr,{handleManifestRedirects:this.handleManifestRedirects},this.sidxRequestFinished_(playlist,oldMaster,startingState,function(newMaster,sidx){if(!newMaster||!sidx){throw new Error('failed to request sidx');}
2332sidxMapping[sidxKey].sidx=sidx;_this3.haveMetadata({startingState:startingState,playlist:newMaster.playlists[playlist.id]});}));}},{key:'haveMetadata',value:function haveMetadata(_ref){var startingState=_ref.startingState,playlist=_ref.playlist;this.state='HAVE_METADATA';this.loadedPlaylists_[playlist.id]=playlist;this.mediaRequest_=null;this.refreshMedia_(playlist.id);if(startingState==='HAVE_MASTER'){this.trigger('loadedmetadata');}else{this.trigger('mediachange');}}},{key:'pause',value:function pause(){this.stopRequest();window$3.clearTimeout(this.mediaUpdateTimeout);window$3.clearTimeout(this.minimumUpdatePeriodTimeout_);if(this.state==='HAVE_NOTHING'){this.started=false;}}},{key:'load',value:function load(isFinalRendition){var _this4=this;window$3.clearTimeout(this.mediaUpdateTimeout);window$3.clearTimeout(this.minimumUpdatePeriodTimeout_);var media=this.media();if(isFinalRendition){var delay=media?media.targetDuration/2*1000:5*1000;this.mediaUpdateTimeout=window$3.setTimeout(function(){return _this4.load();},delay);return;}
2333if(!this.started){this.start();return;}
2334if(media&&!media.endList){this.trigger('mediaupdatetimeout');}else{this.trigger('loadedplaylist');}}},{key:'parseMasterXml',value:function parseMasterXml(){var master=parse(this.masterXml_,{manifestUri:this.srcUrl,clientOffset:this.clientOffset_,sidxMapping:this.sidxMapping_});master.uri=this.srcUrl;for(var i=0;i<master.playlists.length;i++){var phonyUri='placeholder-uri-'+i;master.playlists[i].uri=phonyUri;}
2335forEachMediaGroup(master,function(properties,mediaType,groupKey,labelKey){if(properties.playlists&&properties.playlists.length){var _phonyUri='placeholder-uri-'+mediaType+'-'+groupKey+'-'+labelKey;var id=createPlaylistID(0,_phonyUri);properties.playlists[0].uri=_phonyUri;properties.playlists[0].id=id;master.playlists[id]=properties.playlists[0];master.playlists[_phonyUri]=properties.playlists[0];}});setupMediaPlaylists(master);resolveMediaGroupUris(master);return master;}},{key:'start',value:function start(){var _this5=this;this.started=true;if(this.masterPlaylistLoader_){this.mediaRequest_=window$3.setTimeout(this.haveMaster_.bind(this),0);return;}
2336this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},function(error,req){if(!_this5.request){return;}
2337_this5.request=null;if(error){_this5.error={status:req.status,message:'DASH playlist request error at URL: '+_this5.srcUrl,responseText:req.responseText,code:2};if(_this5.state==='HAVE_NOTHING'){_this5.started=false;}
2338return _this5.trigger('error');}
2339_this5.masterXml_=req.responseText;if(req.responseHeaders&&req.responseHeaders.date){_this5.masterLoaded_=Date.parse(req.responseHeaders.date);}else{_this5.masterLoaded_=Date.now();}
2340_this5.srcUrl=resolveManifestRedirect(_this5.handleManifestRedirects,_this5.srcUrl,req);_this5.syncClientServerClock_(_this5.onClientServerClockSync_.bind(_this5));});}},{key:'syncClientServerClock_',value:function syncClientServerClock_(d
2340one){var _this6=this;var utcTiming=parseUTCTiming(this.masterXml_);if(utcTiming===null){this.clientOffset_=this.masterLoaded_-Date.now();return done();}
2341if(utcTiming.method==='DIRECT'){this.clientOffset_=utcTiming.value-Date.now();return done();}
2342this.request=this.hls_.xhr({uri:resolveUrl$1(this.srcUrl,utcTiming.value),method:utcTiming.method,withCredentials:this.withCredentials},function(error,req){if(!_this6.request){return;}
2343if(error){_this6.clientOffset_=_this6.masterLoaded_-Date.now();return done();}
2344var serverTime=void 0;if(utcTiming.method==='HEAD'){if(!req.responseHeaders||!req.responseHeaders.date){serverTime=_this6.masterLoaded_;}else{serverTime=Date.parse(req.responseHeaders.date);}}else{serverTime=Date.parse(req.responseText);}
2345_this6.clientOffset_=serverTime-Date.now();done();});}},{key:'haveMaster_',value:function haveMaster_(){this.state='HAVE_MASTER';this.mediaRequest_=null;if(!this.masterPlaylistLoader_){this.master=this.parseMasterXml();this.trigger('loadedplaylist');}else if(!this.media_){this.media(this.childPlaylist_);}}},{key:'onClientServerClockSync_',value:function onClientServerClockSync_(){var _this7=this;this.haveMaster_();if(!this.hasPendingRequest()&&!this.media_){this.media(this.master.playlists[0]);}
2346if(this.master&&this.master.minimumUpdatePeriod){this.minimumUpdatePeriodTimeout_=window$3.setTimeout(function(){_this7.trigger('minimumUpdatePeriod');},this.master.minimumUpdatePeriod);}}},{key:'refreshXml_',value:function refreshXml_(){var _this8=this;this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},function(error,req){if(!_this8.request){return;}
2347_this8.request=null;if(error){_this8.error={status:req.status,message:'DASH playlist request error at URL: '+_this8.srcUrl,responseText:req.responseText,code:2};if(_this8.state==='HAVE_NOTHING'){_this8.started=false;}
2348return _this8.trigger('error');}
2349_this8.masterXml_=req.responseText;_this8.sidxMapping_=filterChangedSidxMappings(_this8.masterXml_,_this8.srcUrl,_this8.clientOffset_,_this8.sidxMapping_);var master=_this8.parseMasterXml();var updatedMaster=updateMaster$1(_this8.master,master);var currentSidxInfo=_this8.media().sidx;if(updatedMaster){if(currentSidxInfo){var sidxKey=generateSidxKey(currentSidxInfo);if(!_this8.sidxMapping_[sidxKey]){var playlist=_this8.media();_this8.request=requestSidx_(playlist.sidx,playlist,_this8.hls_.xhr,{handleManifestRedirects:_this8.handleManifestRedirects},_this8.sidxRequestFinished_(playlist,master,_this8.state,function(newMaster,sidx){if(!newMaster||!sidx){throw new Error('failed to request sidx on minimumUpdatePeriod');}
2350_this8.sidxMapping_[sidxKey].sidx=sidx;_this8.minimumUpdatePeriodTimeout_=window$3.setTimeout(function(){_this8.trigger('minimumUpdatePeriod');},_this8.master.minimumUpdatePeriod);_this8.refreshMedia_(_this8.media().id);return;}));}}else{_this8.master=updatedMaster;}}
2351_this8.minimumUpdatePeriodTimeout_=window$3.setTimeout(function(){_this8.trigger('minimumUpdatePeriod');},_this8.master.minimumUpdatePeriod);});}},{key:'refreshMedia_',value:function refreshMedia_(mediaID){var _this9=this;if(!mediaID){throw new Error('refreshMedia_ must take a media id');}
2352var oldMaster=void 0;var newMaster=void 0;if(this.masterPlaylistLoader_){oldMaster=this.masterPlaylistLoader_.master;newMaster=this.masterPlaylistLoader_.parseMasterXml();}else{oldMaster=this.master;newMaster=this.parseMasterXml();}
2353var updatedMaster=updateMaster$1(oldMaster,newMaster);if(updatedMaster){if(this.masterPlaylistLoader_){this.masterPlaylistLoader_.master=updatedMaster;}else{this.master=updatedMaster;}
2354this.media_=updatedMaster.playlists[mediaID];}else{this.media_=newMaster.playlists[mediaID];this.trigger('playlistunchanged');}
2355if(!this.media().endList){this.mediaUpdateTimeout=window$3.setTimeout(function(){_this9.trigger('mediaupdatetimeout');},refreshDelay(this.media(),!!updatedMaster));}
2356this.trigger('loadedplaylist');}}]);return DashPlaylistLoader;}(EventTarget$1$1);var logger=function logger(source){if(videojs$1.log.debug){return videojs$1.log.debug.bind(videojs$1,'VHS:',source+' >');}
2357return function(){};};function noop$1(){}
2358var SourceUpdater=function(){function SourceUpdater(mediaSource,mimeType,type,sourceBufferEmitter){classCallCheck$1(this,SourceUpdater);this.callbacks_=[];this.pendingCallback_=null;this.timestampOffset_=0;this.mediaSource=mediaSource;this.processedAppend_=false;this.type_=type;this.mimeType_=mimeType;this.logger_=logger('SourceUpdater['+type+']['+mimeType+']');if(mediaSource.readyState==='closed'){mediaSource.addEventListener('sourceopen',this.createSourceBuffer_.bind(this,mimeType,sourceBufferEmitter));}else{this.createSourceBuffer_(mimeType,sourceBufferEmitter);}}
2359createClass$1(SourceUpdater,[{key:'createSourceBuffer_',value:function createSourceBuffer_(mimeType,sourceBufferEmitter){var _this=this;this.sourceBuffer_=this.mediaSource.addSourceBuffer(mimeType);this.logger_('created SourceBuffer');if(sourceBufferEmitter){sourceBufferEmitter.trigger('sourcebufferadded');if(this.mediaSource.sourceBuffers.length<2){sourceBufferEmitter.on('sourcebufferadded',function(){_this.start_();});return;}}
2360this.start_();}},{key:'start_',value:function start_(){var _this2=this;this.started_=true;this.onUpdateendCallback_=function(){var pendingCallback=_this2.pendingCallback_;_this2.pendingCallback_=null;_this2.sourceBuffer_.removing=false;_this2.logger_('buffered ['+printableRange(_this2.buffered())+']');if(pendingCallback){pendingCallback();}
2361_this2.runCallback_();};this.sourceBuffer_.addEventListener('updateend',this.onUpdateendCallback_);this.runCallback_();}},{key:'abort',value:function abort(done){var _this3=this;if(this.processedAppend_){this.queueCallback_(function(){_this3.sourceBuffer_.abort();},done);}}},{key:'appendBuffer',value:function appendBuffer(config,done){var _this4=this;this.processedAppend_=true;this.queueCallback_(function(){if(config.videoSegmentTimingInfoCallback){_this4.sourceBuffer_.addEventListener('videoSegmentTimingInfo',config.videoSegmentTimingInfoCallback);}
2362_this4.sourceBuffer_.appendBuffer(config.bytes);},function(){if(config.videoSegmentTimingInfoCallback){_this4.sourceBuffer_.removeEventListener('videoSegmentTimingInfo',config.videoSegmentTimingInfoCallback);}
2363done();});}},{key:'buffered',value:function buffered(){if(!this.sourceBuffer_){return videojs$1.createTimeRanges();}
2364return this.sourceBuffer_.buffered;}},{key:'remove',value:function remove(start,end){var _this5=this;var done=arguments.length>2&&arguments[2]!==undefined?arguments[2]:noop$1;if(this.processedAppend_){this.queueCallback_(function(){_this5.logger_('remove ['+start+' => '+end+']');_this5.sourceBuffer_.removing=true;_this5.sourceBuffer_.remove(start,end);},done);}}},{key:'updating',value:function updating(){return!this.sourceBuffer_||this.sourceBuffer_.updating||!!this.pendingCallback_&&this.pendingCallback_!==noop$1;}},{key:'timestampOffset',value:function timestampOffset(offset){var _this6=this;if(typeof offset!=='undefined'){this.queueCallback_(function(){_this6.sourceBuffer_.timestampOffset=offset;_this6.runCallback_();});this.timestampOffset_=offset;}
2365return this.timestampOffset_;}},{key:'queueCallback_',value:function queueCallback_(callback,done){this.callbacks_.push([callback.bind(this),done]);this.runCallback_();}},{key:'runCallback_',value:function runCallback_(){var callbacks=void 0;if(!this.updating()&&this.callbacks_.length&&this.started_){callbacks=this.callbacks_.shift();this.pendingCallback_=callbacks[1];callbacks[0]();}}},{key:'dispose',value:function dispose(){var _this7=this;var disposeFn=function disposeFn(){if(_this7.sourceBuffer_&&_this7.mediaSource.readyState==='open'){_this7.sourceBuffer_.abort();}
2366_this7.sourceBuffer_.removeEventListener('updateend',disposeFn);};this.sourceBuffer_.removeEventListener('updateend',this.onUpdateendCallback_);if(this.sourceBuffer_.removing){this.sourceBuffer_.addEventListener('updateend',disposeFn);}else{disposeFn();}}}]);return SourceUpdater;}();var Config={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,BUFFER_LOW_WATER_LINE_RATE:1};var REQUEST_ERRORS={FAILURE:2,TIMEOUT:-101,ABORTED:-102};
vendor: 17,615 bytes, lines 2366-2410
2366var abortAll=function abortAll(activeXhrs){activeXhrs.forEach(function(xhr){xhr.abort();});};var getRequestStats=function getRequestStats(request){return{bandwidth:request.bandwidth,bytesReceived:request.bytesReceived||0,roundTripTime:request.roundTripTime||0};};var getProgressStats=function getProgressStats(progressEvent){var request=progressEvent.target;var roundTripTime=Date.now()-request.requestTime;var stats={bandwidth:Infinity,bytesReceived:0,roundTripTime:roundTripTime||0};stats.bytesReceived=progressEvent.loaded;stats.bandwidth=Math.floor(stats.bytesReceived/stats.roundTripTime*8*1000);return stats;};var handleErrors=function handleErrors(error,request){if(request.timedout){return{status:request.status,message:'HLS request timed-out at URL: '+request.uri,code:REQUEST_ERRORS.TIMEOUT,xhr:request};}
2367if(request.aborted){return{status:request.status,message:'HLS request aborted at URL: '+request.uri,code:REQUEST_ERRORS.ABORTED,xhr:request};}
2368if(error){return{status:request.status,message:'HLS request errored at URL: '+request.uri,code:REQUEST_ERRORS.FAILURE,xhr:request};}
2369return null;};var handleKeyResponse=function handleKeyResponse(segment,finishProcessingFn){return function(error,request){var response=request.response;var errorObj=handleErrors(error,request);if(errorObj){return finishProcessingFn(errorObj,segment);}
2370if(response.byteLength!==16){return finishProcessingFn({status:request.status,message:'Invalid HLS key at URL: '+request.uri,code:REQUEST_ERRORS.FAILURE,xhr:request},segment);}
2371var view=new DataView(response);segment.key.bytes=new Uint32Array([view.getUint32(0),view.getUint32(4),view.getUint32(8),view.getUint32(12)]);return finishProcessingFn(null,segment);};};var handleInitSegmentResponse=function handleInitSegmentResponse(segment,captionParser,finishProcessingFn){return function(error,request){var response=request.response;var errorObj=handleErrors(error,request);if(errorObj){return finishProcessingFn(errorObj,segment);}
2372if(response.byteLength===0){return finishProcessingFn({status:request.status,message:'Empty HLS segment content at URL: '+request.uri,code:REQUEST_ERRORS.FAILURE,xhr:request},segment);}
2373segment.map.bytes=new Uint8Array(request.response);if(captionParser&&!captionParser.isInitialized()){captionParser.init();}
2374segment.map.timescales=probe.timescale(segment.map.bytes);segment.map.videoTrackIds=probe.videoTrackIds(segment.map.bytes);return finishProcessingFn(null,segment);};};var handleSegmentResponse=function handleSegmentResponse(segment,captionParser,finishProcessingFn){return function(error,request){var response=request.response;var errorObj=handleErrors(error,request);var parsed=void 0;if(errorObj){return finishProcessingFn(errorObj,segment);}
2375if(response.byteLength===0){return finishProcessingFn({status:request.status,message:'Empty HLS segment content at URL: '+request.uri,code:REQUEST_ERRORS.FAILURE,xhr:request},segment);}
2376segment.stats=getRequestStats(request);if(segment.key){segment.encryptedBytes=new Uint8Array(request.response);}else{segment.bytes=new Uint8Array(request.response);}
2377if(captionParser&&segment.map&&segment.map.bytes){if(!captionParser.isInitialized()){captionParser.init();}
2378parsed=captionParser.parse(segment.bytes,segment.map.videoTrackIds,segment.map.timescales);if(parsed&&parsed.captions){segment.captionStreams=parsed.captionStreams;segment.fmp4Captions=parsed.captions;}}
2379return finishProcessingFn(null,segment);};};var decryptSegment=function decryptSegment(decrypter,segment,doneFn){var decryptionHandler=function decryptionHandler(event){if(event.data.source===segment.requestId){decrypter.removeEventListener('message',decryptionHandler);var decrypted=event.data.decrypted;segment.bytes=new Uint8Array(decrypted.bytes,decrypted.byteOffset,decrypted.byteLength);return doneFn(null,segment);}};decrypter.addEventListener('message',decryptionHandler);var keyBytes=void 0;if(segment.key.bytes.slice){keyBytes=segment.key.bytes.slice();}else{keyBytes=new Uint32Array(Array.prototype.slice.call(segment.key.bytes));}
2380decrypter.postMessage(createTransferableMessage({source:segment.requestId,encrypted:segment.encryptedBytes,key:keyBytes,iv:segment.key.iv}),[segment.encryptedBytes.buffer,keyBytes.buffer]);};var waitForCompletion=function waitForCompletion(activeXhrs,decrypter,doneFn){var count=0;var didError=false;return function(error,segment){if(didError){return;}
2381if(error){didError=true;abortAll(activeXhrs);return doneFn(error,segment);}
2382count+=1;if(count===activeXhrs.length){segment.endOfAllRequests=Date.now();if(segment.encryptedBytes){return decryptSegment(decrypter,segment,doneFn);}
2383return doneFn(null,segment);}};};var handleProgress=function handleProgress(segment,progressFn){return function(event){segment.stats=videojs$1.mergeOptions(segment.stats,getProgressStats(event));if(!segment.stats.firstBytesReceivedAt&&segment.stats.bytesReceived){segment.stats.firstBytesReceivedAt=Date.now();}
2384return progressFn(event,segment);};};var mediaSegmentRequest=function mediaSegmentRequest(xhr,xhrOptions,decryptionWorker,captionParser,segment,progressFn,doneFn){var activeXhrs=[];var finishProcessingFn=waitForCompletion(activeXhrs,decryptionWorker,doneFn);if(segment.key&&!segment.key.bytes){var keyRequestOptions=videojs$1.mergeOptions(xhrOptions,{uri:segment.key.resolvedUri,responseType:'arraybuffer'});var keyRequestCallback=handleKeyResponse(segment,finishProcessingFn);var keyXhr=xhr(keyRequestOptions,keyRequestCallback);activeXhrs.push(keyXhr);}
2385if(segment.map&&!segment.map.bytes){var initSegmentOptions=videojs$1.mergeOptions(xhrOptions,{uri:segment.map.resolvedUri,responseType:'arraybuffer',headers:segmentXhrHeaders(segment.map)});var initSegmentRequestCallback=handleInitSegmentResponse(segment,captionParser,finishProcessingFn);var initSegmentXhr=xhr(initSegmentOptions,initSegmentRequestCallback);activeXhrs.push(initSegmentXhr);}
2386var segmentRequestOptions=videojs$1.mergeOptions(xhrOptions,{uri:segment.resolvedUri,responseType:'arraybuffer',headers:segmentXhrHeaders(segment)});var segmentRequestCallback=handleSegmentResponse(segment,captionParser,finishProcessingFn);var segmentXhr=xhr(segmentRequestOptions,segmentRequestCallback);segmentXhr.addEventListener('progress',handleProgress(segment,progressFn));activeXhrs.push(segmentXhr);return function(){return abortAll(activeXhrs);};};var safeGetComputedStyle=function safeGetComputedStyle(el,property){var result=void 0;if(!el){return '';}
2387result=window$3.getComputedStyle(el);if(!result){return '';}
2388return result[property];};var stableSort=function stableSort(array,sortFn){var newArray=array.slice();array.sort(function(left,right){var cmp=sortFn(left,right);if(cmp===0){return newArray.indexOf(left)-newArray.indexOf(right);}
2389return cmp;});};var comparePlaylistBandwidth=function comparePlaylistBandwidth(left,right){var leftBandwidth=void 0;var rightBandwidth=void 0;if(left.attributes.BANDWIDTH){leftBandwidth=left.attributes.BANDWIDTH;}
2390leftBandwidth=leftBandwidth||window$3.Number.MAX_VALUE;if(right.attributes.BANDWIDTH){rightBandwidth=right.attributes.BANDWIDTH;}
2391rightBandwidth=rightBandwidth||window$3.Number.MAX_VALUE;return leftBandwidth-rightBandwidth;};var comparePlaylistResolution=function comparePlaylistResolution(left,right){var leftWidth=void 0;var rightWidth=void 0;if(left.attributes.RESOLUTION&&left.attributes.RESOLUTION.width){leftWidth=left.attributes.RESOLUTION.width;}
2392leftWidth=leftWidth||window$3.Number.MAX_VALUE;if(right.attributes.RESOLUTION&&right.attributes.RESOLUTION.width){rightWidth=right.attributes.RESOLUTION.width;}
2393rightWidth=rightWidth||window$3.Number.MAX_VALUE;if(leftWidth===rightWidth&&left.attributes.BANDWIDTH&&right.attributes.BANDWIDTH){return left.attributes.BANDWIDTH-right.attributes.BANDWIDTH;}
2394return leftWidth-rightWidth;};var simpleSelector=function simpleSelector(master,playerBandwidth,playerWidth,playerHeight,limitRenditionByPlayerDimensions){var sortedPlaylistReps=master.playlists.map(function(playlist){var width=void 0;var height=void 0;var bandwidth=void 0;width=playlist.attributes.RESOLUTION&&playlist.attributes.RESOLUTION.width;height=playlist.attributes.RESOLUTION&&playlist.attributes.RESOLUTION.height;bandwidth=playlist.attributes.BANDWIDTH;bandwidth=bandwidth||window$3.Number.MAX_VALUE;return{bandwidth:bandwidth,width:width,height:height,playlist:playlist};});stableSort(sortedPlaylistReps,function(left,right){return left.bandwidth-right.bandwidth;});sortedPlaylistReps=sortedPlaylistReps.filter(function(rep){return!Playlist.isIncompatible(rep.playlist);});var enabledPlaylistReps=sortedPlaylistReps.filter(function(rep){return Playlist.isEnabled(rep.playlist);});if(!enabledPlaylistReps.length){enabledPlaylistReps=sortedPlaylistReps.filter(function(rep){return!Playlist.isDisabled(rep.playlist);});}
2395var bandwidthPlaylistReps=enabledPlaylistReps.filter(function(rep){return rep.bandwidth*Config.BANDWIDTH_VARIANCE<playerBandwidth;});var highestRemainingBandwidthRep=bandwidthPlaylistReps[bandwidthPlaylistReps.length-1];var bandwidthBestRep=bandwidthPlaylistReps.filter(function(rep){return rep.bandwidth===highestRemainingBandwidthRep.bandwidth;})[0];if(limitRenditionByPlayerDimensions===false){var _chosenRep=bandwidthBestRep||enabledPlaylistReps[0]||sortedPlaylistReps[0];return _chosenRep?_chosenRep.playlist:null;}
2396var haveResolution=bandwidthPlaylistReps.filter(function(rep){return rep.width&&rep.height;});stableSort(haveResolution,function(left,right){return left.width-right.width;});var resolutionBestRepList=haveResolution.filter(function(rep){return rep.width===playerWidth&&rep.height===playerHeight;});highestRemainingBandwidthRep=resolutionBestRepList[resolutionBestRepList.length-1];var resolutionBestRep=resolutionBestRepList.filter(function(rep){return rep.bandwidth===highestRemainingBandwidthRep.bandwidth;})[0];var resolutionPlusOneList=void 0;var resolutionPlusOneSmallest=void 0;var resolutionPlusOneRep=void 0;if(!resolutionBestRep){resolutionPlusOneList=haveResolution.filter(function(rep){return rep.width>playerWidth||rep.height>playerHeight;});resolutionPlusOneSmallest=resolutionPlusOneList.filter(function(rep){return rep.width===resolutionPlusOneList[0].width&&rep.height===resolutionPlusOneList[0].height;});highestRemainingBandwidthRep=resolutionPlusOneSmallest[resolutionPlusOneSmallest.length-1];resolutionPlusOneRep=resolutionPlusOneSmallest.filter(function(rep){return rep.bandwidth===highestRemainingBandwidthRep.bandwidth;})[0];}
2397var chosenRep=resolutionPlusOneRep||resolutionBestRep||bandwidthBestRep||enabledPlaylistReps[0]||sortedPlaylistReps[0];return chosenRep?chosenRep.playlist:null;};var lastBandwidthSelector=function lastBandwidthSelector(){var pixelRatio=this.useDevicePixelRatio?window$3.devicePixelRatio||1:1;return simpleSelector(this.playlists.master,this.systemBandwidth,parseInt(safeGetComputedStyle(this.tech_.el(),'width'),10)*pixelRatio,parseInt(safeGetComputedStyle(this.tech_.el(),'height'),10)*pixelRatio,this.limitRenditionByPlayerDimensions);};var minRebufferMaxBandwidthSelector=function minRebufferMaxBandwidthSelector(settings){var master=settings.master,currentTime=settings.currentTime,bandwidth=settings.bandwidth,duration$$1=settings.duration,segmentDuration=settings.segmentDuration,timeUntilRebuffer=settings.timeUntilRebuffer,currentTimeline=settings.currentTimeline,syncController=settings.syncController;var compatiblePlaylists=master.playlists.filter(function(playlist){return!Playlist.isIncompatible(playlist);});var enabledPlaylists=compatiblePlaylists.filter(Playlist.isEnabled);if(!enabledPlaylists.length){enabledPlaylists=compatiblePlaylists.filter(function(playlist){return!Playlist.isDisabled(playlist);});}
2398var bandwidthPlaylists=enabledPlaylists.filter(Playlist.hasAttribute.bind(null,'BANDWIDTH'));var rebufferingEstimates=bandwidthPlaylists.map(function(playlist){var syncPoint=syncController.getSyncPoint(playlist,duration$$1,currentTimeline,currentTime);var numRequests=syncPoint?1:2;var requestTimeEstimate=Playlist.estimateSegmentRequestTime(segmentDuration,bandwidth,playlist);var rebufferingImpact=requestTimeEstimate*numRequests-timeUntilRebuffer;return{playlist:playlist,rebufferingImpact:rebufferingImpact};});var noRebufferingPlaylists=rebufferingEstimates.filter(function(estimate){return estimate.rebufferingImpact<=0;});stableSort(noRebufferingPlaylists,function(a,b){return comparePlaylistBandwidth(b.playlist,a.playlist);});if(noRebufferingPlaylists.length){return noRebufferingPlaylists[0];}
2399stableSort(rebufferingEstimates,function(a,b){return a.rebufferingImpact-b.rebufferingImpact;});return rebufferingEstimates[0]||null;};var lowestBitrateCompatibleVariantSelector=function lowestBitrateCompatibleVariantSelector(){var playlists=this.playlists.master.playlists.filter(Playlist.isEnabled);stableSort(playlists,function(a,b){return comparePlaylistBandwidth(a,b);});var playlistsWithVideo=playlists.filter(function(playlist){return parseCodecs(playlist.attributes.CODECS).videoCodec;});return playlistsWithVideo[0]||null;};var createCaptionsTrackIfNotExists=function createCaptionsTrackIfNotExists(inbandTextTracks,tech,captionStreams){for(var trackId in captionStreams){if(!inbandTextTracks[trackId]){tech.trigger({type:'usage',name:'hls-608'});var track=tech.textTracks().getTrackById(trackId);if(track){inbandTextTracks[trackId]=track;}else{inbandTextTracks[trackId]=tech.addRemoteTextTrack({kind:'captions',id:trackId,label:trackId},false).track;}}}};var addCaptionData=function addCaptionData(_ref){var inbandTextTracks=_ref.inbandTextTracks,captionArray=_ref.captionArray,timestampOffset=_ref.timestampOffset;if(!captionArray){return;}
2400var Cue=window.WebKitDataCue||window.VTTCue;captionArray.forEach(function(caption){var track=caption.stream;var startTime=caption.startTime;var endTime=caption.endTime;if(!inbandTextTracks[track]){return;}
2401startTime+=timestampOffset;endTime+=timestampOffset;inbandTextTracks[track].addCue(new Cue(startTime,endTime,caption.text));});};var CHECK_BUFFER_DELAY=500;var detectEndOfStream=function detectEndOfStream(playlist,mediaSource,segmentIndex){if(!playlist||!mediaSource){return false;}
2402var segments=playlist.segments;var appendedLastSegment=segmentIndex===segments.length;return playlist.endList&&mediaSource.readyState==='open'&&appendedLastSegment;};var finite=function finite(num){return typeof num==='number'&&isFinite(num);};var illegalMediaSwitch=function illegalMediaSwitch(loaderType,startingMedia,newSegmentMedia){if(loaderType!=='main'||!startingMedia||!newSegmentMedia){return null;}
2403if(!newSegmentMedia.containsAudio&&!newSegmentMedia.containsVideo){return 'Neither audio nor video found in segment.';}
2404if(startingMedia.containsVideo&&!newSegmentMedia.containsVideo){return 'Only audio found in segment when we expected video.'+' We can\'t switch to audio only from a stream that had video.'+' To get rid of this message, please add codec information to the manifest.';}
2405if(!startingMedia.containsVideo&&newSegmentMedia.containsVideo){return 'Video found in segment when we expected only audio.'+' We can\'t switch to a stream with video from an audio only stream.'+' To get rid of this message, please add codec information to the manifest.';}
2406return null;};var safeBackBufferTrimTime=function safeBackBufferTrimTime(seekable$$1,currentTime,targetDuration){var trimTime=currentTime-30;if(seekable$$1.length){trimTime=Math.max(trimTime,seekable$$1.start(0));}
2407var maxTrimTime=currentTime-targetDuration;return Math.min(maxTrimTime,trimTime);};var segmentInfoString=function segmentInfoString(segmentInfo){var _segmentInfo$segment=segmentInfo.segment,start=_segmentInfo$segment.start,end=_segmentInfo$segment.end,_segmentInfo$playlist=segmentInfo.playlist,seq=_segmentInfo$playlist.mediaSequence,id=_segmentInfo$playlist.id,_segmentInfo$playlist2=_segmentInfo$playlist.segments,segments=_segmentInfo$playlist2===undefined?[]:_segmentInfo$playlist2,index=segmentInfo.mediaIndex,timeline=segmentInfo.timeline;return['appending ['+index+'] of ['+seq+', '+(seq+segments.length)+'] from playlist ['+id+']','['+start+' => '+end+'] in timeline ['+timeline+']'].join(' ');};var SegmentLoader=function(_videojs$EventTarget){inherits$2(SegmentLoader,_videojs$EventTarget);function SegmentLoader(settings){classCallCheck$1(this,SegmentLoader);var _this=possibleConstructorReturn$1(this,(SegmentLoader.__proto__||Object.getPrototypeOf(SegmentLoader)).call(this));if(!settings){throw new TypeError('Initialization settings are required');}
2408if(typeof settings.currentTime!=='function'){throw new TypeError('No currentTime getter specified');}
2409if(!settings.mediaSource){throw new TypeError('No MediaSource specified');}
2410_this.bandwidth=settings.bandwidth;_this.throughput={rate:0,count:0};_this.roundTrip=NaN;_this.resetStats_();_this.mediaIndex=null;_this.hasPlayed_=settings.hasPlayed;_this.currentTime_=settings.currentTime;_this.seekable_=settings.seekable;_this.seeking_=settings.seeking;_this.duration_=settings.duration;_this.mediaSource_=settings.mediaSource;_this.hls_=settings.hls;_this.loaderType_=settings.loaderType;_this.startingMedia_=void 0;_this.segmentMetadataTrack_=settings.segmentMetadataTrack;_this.goalBufferLength_=settings.goalBufferLength;_this.sourceType_=settings.sourceType;_this.inbandTextTracks_=settings.inbandTextTracks;_this.state_='INIT';_this.checkBufferTimeout_=null;_this.error_=void 0;_this.currentTimeline_=-1;_this.pendingSegment_=null;_this.mimeType_=null;_this.sourceUpdater_=null;_this.xhrOptions_=null;_this.activeInitSegmentId_=null;_this.initSegments_={};_this.cacheEncryptionKeys_=settings.cacheEncryptionKeys;_this.keyCache_={};
2410if(_this.loaderType_==='main'){_this.captionParser_=new captionParser();}else{_this.captionParser_=null;}
2411_this.decrypter_=settings.decrypter;_this.syncController_=settings.syncController;_this.syncPoint_={segmentIndex:0,time:0};_this.triggerSyncInfoUpdate_=function(){return _this.trigger('syncinfoupdate');};_this.syncController_.on('syncinfoupdate',_this.triggerSyncInfoUpdate_);_this.mediaSource_.addEventListener('sourceopen',function(){return _this.ended_=false;});_this.fetchAtBuffer_=false;_this.logger_=logger('SegmentLoader['+_this.loaderType_+']');Object.defineProperty(_this,'state',{get:function get$$1(){return this.state_;},set:function set$$1(newState){if(newState!==this.state_){this.logger_(this.state_+' -> '+newState);this.state_=newState;}}});return _this;}
2412createClass$1(SegmentLoader,[{key:'resetStats_',value:function resetStats_(){this.mediaBytesTransferred=0;this.mediaRequests=0;this.bandwidthHistory=[];this.mediaRequestsAborted=0;this.mediaRequestsTimedout=0;this.mediaRequestsErrored=0;this.mediaTransferDuration=0;this.mediaSecondsLoaded=0;}},{key:'dispose',value:function dispose(){this.trigger('dispose');this.state='DISPOSED';this.pause();this.abort_();if(this.sourceUpdater_){this.sourceUpdater_.dispose();}
2413this.resetStats_();if(this.captionParser_){this.captionParser_.reset();}
2414if(this.checkBufferTimeout_){window$3.clearTimeout(this.checkBufferTimeout_);}
2415if(this.syncController_&&this.triggerSyncInfoUpdate_){this.syncController_.off('syncinfoupdate',this.triggerSyncInfoUpdate_);}
2416this.off();}},{key:'abort',value:function abort(){if(this.state!=='WAITING'){if(this.pendingSegment_){this.pendingSegment_=null;}
2417return;}
2418this.abort_();this.state='READY';if(!this.paused()){this.monitorBuffer_();}}},{key:'abort_',value:function abort_(){if(this.pendingSegment_){this.pendingSegment_.abortRequests();}
2419this.pendingSegment_=null;}},{key:'error',value:function error(_error){if(typeof _error!=='undefined'){this.error_=_error;}
2420this.pendingSegment_=null;return this.error_;}},{key:'endOfStream',value:function endOfStream(){this.ended_=true;this.pause();this.trigger('ended');}},{key:'buffered_',value:function buffered_(){if(!this.sourceUpdater_){return videojs$1.createTimeRanges();}
2421return this.sourceUpdater_.buffered();}},{key:'initSegment',value:function initSegment(map){var set$$1=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(!map){return null;}
2422var id=initSegmentId(map);var storedMap=this.initSegments_[id];if(set$$1&&!storedMap&&map.bytes){this.initSegments_[id]=storedMap={resolvedUri:map.resolvedUri,byterange:map.byterange,bytes:map.bytes,timescales:map.timescales,videoTrackIds:map.videoTrackIds};}
2423return storedMap||map;}},{key:'segmentKey',value:function segmentKey(key){var set$$1=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(!key){return null;}
2424var id=segmentKeyId(key);var storedKey=this.keyCache_[id];if(this.cacheEncryptionKeys_&&set$$1&&!storedKey&&key.bytes){this.keyCache_[id]=storedKey={resolvedUri:key.resolvedUri,bytes:key.bytes};}
2425var result={resolvedUri:(storedKey||key).resolvedUri};if(storedKey){result.bytes=storedKey.bytes;}
2426return result;}},{key:'couldBeginLoading_',value:function couldBeginLoading_(){return this.playlist_&&(this.sourceUpdater_||this.mimeType_&&this.state==='INIT')&&!this.paused();}},{key:'load',value:function load(){this.monitorBuffer_();if(!this.playlist_){return;}
2427this.syncController_.setDateTimeMapping(this.playlist_);if(this.state==='INIT'&&this.couldBeginLoading_()){return this.init_();}
2428if(!this.couldBeginLoading_()||this.state!=='READY'&&this.state!=='INIT'){return;}
2429this.state='READY';}},{key:'init_',value:function init_(){this.state='READY';this.sourceUpdater_=new SourceUpdater(this.mediaSource_,this.mimeType_,this.loaderType_,this.sourceBufferEmitter_);this.resetEverything();return this.monitorBuffer_();}},{key:'playlist',value:function playlist(newPlaylist){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(!newPlaylist){return;}
2430var oldPlaylist=this.playlist_;var segmentInfo=this.pendingSegment_;this.playlist_=newPlaylist;this.xhrOptions_=options;if(this.state==='INIT'){newPlaylist.syncInfo={mediaSequence:newPlaylist.mediaSequence,time:0};}
2431var oldId=null;if(oldPlaylist){if(oldPlaylist.id){oldId=oldPlaylist.id;}else if(oldPlaylist.uri){oldId=oldPlaylist.uri;}}
2432this.logger_('playlist update ['+oldId+' => '+(newPlaylist.id||newPlaylist.uri)+']');this.trigger('syncinfoupdate');
vendor: 10,634 bytes, lines 2432-2481
2432if(this.state==='INIT'&&this.couldBeginLoading_()){return this.init_();}
2433if(!oldPlaylist||oldPlaylist.uri!==newPlaylist.uri){if(this.mediaIndex!==null){this.resyncLoader();}
2434return;}
2435var mediaSequenceDiff=newPlaylist.mediaSequence-oldPlaylist.mediaSequence;this.logger_('live window shift ['+mediaSequenceDiff+']');if(this.mediaIndex!==null){this.mediaIndex-=mediaSequenceDiff;}
2436if(segmentInfo){segmentInfo.mediaIndex-=mediaSequenceDiff;if(segmentInfo.mediaIndex>=0){segmentInfo.segment=newPlaylist.segments[segmentInfo.mediaIndex];}}
2437this.syncController_.saveExpiredSegmentInfo(oldPlaylist,newPlaylist);}},{key:'pause',value:function pause(){if(this.checkBufferTimeout_){window$3.clearTimeout(this.checkBufferTimeout_);this.checkBufferTimeout_=null;}}},{key:'paused',value:function paused(){return this.checkBufferTimeout_===null;}},{key:'mimeType',value:function mimeType(_mimeType,sourceBufferEmitter){if(this.mimeType_){return;}
2438this.mimeType_=_mimeType;this.sourceBufferEmitter_=sourceBufferEmitter;if(this.state==='INIT'&&this.couldBeginLoading_()){this.init_();}}},{key:'resetEverything',value:function resetEverything(done){this.ended_=false;this.resetLoader();this.remove(0,Infinity,done);if(this.captionParser_){this.captionParser_.clearAllCaptions();}
2439this.trigger('reseteverything');}},{key:'resetLoader',value:function resetLoader(){this.fetchAtBuffer_=false;this.resyncLoader();}},{key:'resyncLoader',value:function resyncLoader(){this.mediaIndex=null;this.syncPoint_=null;this.abort();}},{key:'remove',value:function remove(start,end,done){if(end===Infinity){end=this.duration_();}
2440if(this.sourceUpdater_){this.sourceUpdater_.remove(start,end,done);}
2441removeCuesFromTrack(start,end,this.segmentMetadataTrack_);if(this.inbandTextTracks_){for(var id in this.inbandTextTracks_){removeCuesFromTrack(start,end,this.inbandTextTracks_[id]);}}}},{key:'monitorBuffer_',value:function monitorBuffer_(){if(this.checkBufferTimeout_){window$3.clearTimeout(this.checkBufferTimeout_);}
2442this.checkBufferTimeout_=window$3.setTimeout(this.monitorBufferTick_.bind(this),1);}},{key:'monitorBufferTick_',value:function monitorBufferTick_(){if(this.state==='READY'){this.fillBuffer_();}
2443if(this.checkBufferTimeout_){window$3.clearTimeout(this.checkBufferTimeout_);}
2444this.checkBufferTimeout_=window$3.setTimeout(this.monitorBufferTick_.bind(this),CHECK_BUFFER_DELAY);}},{key:'fillBuffer_',value:function fillBuffer_(){if(this.sourceUpdater_.updating()){return;}
2445if(!this.syncPoint_){this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());}
2446var segmentInfo=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_);if(!segmentInfo){return;}
2447if(this.isEndOfStream_(segmentInfo.mediaIndex)){this.endOfStream();return;}
2448if(segmentInfo.mediaIndex===this.playlist_.segments.length-1&&this.mediaSource_.readyState==='ended'&&!this.seeking_()){return;}
2449if(segmentInfo.timeline!==this.currentTimeline_){this.syncController_.reset();segmentInfo.timestampOffset=segmentInfo.startOfSegment;if(this.captionParser_){this.captionParser_.clearAllCaptions();}}
2450this.loadSegment_(segmentInfo);}},{key:'isEndOfStream_',value:function isEndOfStream_(mediaIndex){var playlist=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.playlist_;return detectEndOfStream(playlist,this.mediaSource_,mediaIndex)&&!this.sourceUpdater_.updating();}},{key:'checkBuffer_',value:function checkBuffer_(buffered,playlist,mediaIndex,hasPlayed,currentTime,syncPoint){var lastBufferedEnd=0;var startOfSegment=void 0;if(buffered.length){lastBufferedEnd=buffered.end(buffered.length-1);}
2451var bufferedTime=Math.max(0,lastBufferedEnd-currentTime);if(!playlist.segments.length){return null;}
2452if(bufferedTime>=this.goalBufferLength_()){return null;}
2453if(!hasPlayed&&bufferedTime>=1){return null;}
2454if(syncPoint===null){mediaIndex=this.getSyncSegmentCandidate_(playlist);return this.generateSegmentInfo_(playlist,mediaIndex,null,true);}
2455if(mediaIndex!==null){var segment=playlist.segments[mediaIndex];startOfSegment=lastBufferedEnd;return this.generateSegmentInfo_(playlist,mediaIndex+1,startOfSegment,false);}
2456if(this.fetchAtBuffer_){var mediaSourceInfo=Playlist.getMediaInfoForTime(playlist,lastBufferedEnd,syncPoint.segmentIndex,syncPoint.time);mediaIndex=mediaSourceInfo.mediaIndex;startOfSegment=mediaSourceInfo.startTime;}else{var _mediaSourceInfo=Playlist.getMediaInfoForTime(playlist,currentTime,syncPoint.segmentIndex,syncPoint.time);mediaIndex=_mediaSourceInfo.mediaIndex;startOfSegment=_mediaSourceInfo.startTime;}
2457return this.generateSegmentInfo_(playlist,mediaIndex,startOfSegment,false);}},{key:'getSyncSegmentCandidate_',value:function getSyncSegmentCandidate_(playlist){var _this2=this;if(this.currentTimeline_===-1){return 0;}
2458var segmentIndexArray=playlist.segments.map(function(s,i){return{timeline:s.timeline,segmentIndex:i};}).filter(function(s){return s.timeline===_this2.currentTimeline_;});if(segmentIndexArray.length){return segmentIndexArray[Math.min(segmentIndexArray.length-1,1)].segmentIndex;}
2459return Math.max(playlist.segments.length-1,0);}},{key:'generateSegmentInfo_',value:function generateSegmentInfo_(playlist,mediaIndex,startOfSegment,isSyncRequest){if(mediaIndex<0||mediaIndex>=playlist.segments.length){return null;}
2460var segment=playlist.segments[mediaIndex];return{requestId:'segment-loader-'+Math.random(),uri:segment.resolvedUri,mediaIndex:mediaIndex,isSyncRequest:isSyncRequest,startOfSegment:startOfSegment,playlist:playlist,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:segment.timeline,duration:segment.duration,segment:segment};}},{key:'abortRequestEarly_',value:function abortRequestEarly_(stats){if(this.hls_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH){return false;}
2461if(Date.now()-(stats.firstBytesReceivedAt||Date.now())<1000){return false;}
2462var currentTime=this.currentTime_();var measuredBandwidth=this.calculateAverageBandwidth_();var segmentDuration=this.pendingSegment_.duration;var requestTimeRemaining=Playlist.estimateSegmentRequestTime(segmentDuration,measuredBandwidth,this.playlist_,stats.bytesReceived);var timeUntilRebuffer$$1=timeUntilRebuffer(this.buffered_(),currentTime,this.hls_.tech_.playbackRate())-1;if(requestTimeRemaining<=timeUntilRebuffer$$1||timeUntilRebuffer$$1<0){return false;}
2463var switchCandidate=minRebufferMaxBandwidthSelector({master:this.hls_.playlists.master,currentTime:currentTime,bandwidth:measuredBandwidth,duration:this.duration_(),segmentDuration:segmentDuration,timeUntilRebuffer:timeUntilRebuffer$$1,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!switchCandidate){return;}
2464var rebufferingImpact=requestTimeRemaining-timeUntilRebuffer$$1;var timeSavedBySwitching=rebufferingImpact-switchCandidate.rebufferingImpact;var minimumTimeSaving=0.5;if(timeUntilRebuffer$$1<=TIME_FUDGE_FACTOR){minimumTimeSaving=1;}
2465if(!switchCandidate.playlist||switchCandidate.playlist.uri===this.playlist_.uri||timeSavedBySwitching<minimumTimeSaving){return false;}
2466this.bandwidth=switchCandidate.playlist.attributes.BANDWIDTH*Config.BANDWIDTH_VARIANCE+1;this.abort();this.trigger('earlyabort');return true;}},{key:'handleProgress_',value:function handleProgress_(event,simpleSegment){if(!this.pendingSegment_||simpleSegment.requestId!==this.pendingSegment_.requestId||this.abortRequestEarly_(simpleSegment.stats)){return;}
2467this.trigger('progress');}},{key:'loadSegment_',value:function loadSegment_(segmentInfo){this.state='WAITING';this.pendingSegment_=segmentInfo;this.trimBackBuffer_(segmentInfo);segmentInfo.abortRequests=mediaSegmentRequest(this.hls_.xhr,this.xhrOptions_,this.decrypter_,this.captionParser_,this.createSimplifiedSegmentObj_(segmentInfo),this.handleProgress_.bind(this),this.segmentRequestFinished_.bind(this));}},{key:'trimBackBuffer_',value:function trimBackBuffer_(segmentInfo){var removeToTime=safeBackBufferTrimTime(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);if(removeToTime>0){this.remove(0,removeToTime);}}},{key:'createSimplifiedSegmentObj_',value:function createSimplifiedSegmentObj_(segmentInfo){var segment=segmentInfo.segment;var simpleSegment={resolvedUri:segment.resolvedUri,byterange:segment.byterange,requestId:segmentInfo.requestId};if(segment.key){var iv=segment.key.iv||new Uint32Array([0,0,0,segmentInfo.mediaIndex+segmentInfo.playlist.mediaSequence]);simpleSegment.key=this.segmentKey(segment.key);simpleSegment.key.iv=iv;}
2468if(segment.map){simpleSegment.map=this.initSegment(segment.map);}
2469return simpleSegment;}},{key:'segmentRequestFinished_',value:function segmentRequestFinished_(error,simpleSegment){this.mediaRequests+=1;if(simpleSegment.stats){this.mediaBytesTransferred+=simpleSegment.stats.bytesReceived;this.mediaTransferDuration+=simpleSegment.stats.roundTripTime;}
2470if(!this.pendingSegment_){this.mediaRequestsAborted+=1;return;}
2471if(simpleSegment.requestId!==this.pendingSegment_.requestId){return;}
2472if(error){this.pendingSegment_=null;this.state='READY';if(error.code===REQUEST_ERRORS.ABORTED){this.mediaRequestsAborted+=1;return;}
2473this.pause();if(error.code===REQUEST_ERRORS.TIMEOUT){this.mediaRequestsTimedout+=1;this.bandwidth=1;this.roundTrip=NaN;this.trigger('bandwidthupdate');return;}
2474this.mediaRequestsErrored+=1;this.error(error);this.trigger('error');return;}
2475this.bandwidth=simpleSegment.stats.bandwidth;this.roundTrip=simpleSegment.stats.roundTripTime;this.bandwidth=this.calculateAverageBandwidth_(simpleSegment);if(simpleSegment.map){simpleSegment.map=this.initSegment(simpleSegment.map,true);}
2476if(simpleSegment.key){this.segmentKey(simpleSegment.key,true);}
2477this.processSegmentResponse_(simpleSegment);}},{key:'calculateAverageBandwidth_',value:function calculateAverageBandwidth_(simpleSegment){var REQUEST_SIZE=3;if(simpleSegment&&simpleSegment.stats.bandwidth>50*1024){this.bandwidthHistory.push(simpleSegment.stats.bandwidth);}
2478if(this.bandwidthHistory.length>REQUEST_SIZE){this.bandwidthHistory.shift();}
2479var sumBytes=0;for(var i=0;i<this.bandwidthHistory.length;i++){sumBytes+=this.bandwidthHistory[i];}
2480return Math.floor(sumBytes/this.bandwidthHistory.length);}},{key:'processSegmentResponse_',value:function processSegmentResponse_(simpleSegment){var segmentInfo=this.pendingSegment_;segmentInfo.bytes=simpleSegment.bytes;if(simpleSegment.map){segmentInfo.segment.map.bytes=simpleSegment.map.bytes;}
2481segmentInfo.endOfAllRequests=simpleSegment.endOfAllRequests;if(simpleSegment.fmp4Captions){createCaptionsTrackIfNotExists(this.inbandTextTracks_,this.hls_.tech_,simpleSegment.captionStream
2481s);addCaptionData({inbandTextTracks:this.inbandTextTracks_,captionArray:simpleSegment.fmp4Captions,timestampOffset:0});if(this.captionParser_){this.captionParser_.clearParsedCaptions();}}
2482this.handleSegment_();}},{key:'handleSegment_',value:function handleSegment_(){var _this3=this;if(!this.pendingSegment_){this.state='READY';return;}
2483var segmentInfo=this.pendingSegment_;var segment=segmentInfo.segment;var timingInfo=this.syncController_.probeSegmentInfo(segmentInfo);if(typeof this.startingMedia_==='undefined'&&timingInfo&&(timingInfo.containsAudio||timingInfo.containsVideo)){this.startingMedia_={containsAudio:timingInfo.containsAudio,containsVideo:timingInfo.containsVideo};}
2484var illegalMediaSwitchError=illegalMediaSwitch(this.loaderType_,this.startingMedia_,timingInfo);if(illegalMediaSwitchError){this.error({message:illegalMediaSwitchError,blacklistDuration:Infinity});this.trigger('error');return;}
2485if(segmentInfo.isSyncRequest){this.trigger('syncinfoupdate');this.pendingSegment_=null;this.state='READY';return;}
2486if(segmentInfo.timestampOffset!==null&&segmentInfo.timestampOffset!==this.sourceUpdater_.timestampOffset()){if(timingInfo&&timingInfo.segmentTimestampInfo){var ptsStartTime=timingInfo.segmentTimestampInfo[0].ptsTime;var dtsStartTime=timingInfo.segmentTimestampInfo[0].dtsTime;segmentInfo.timestampOffset-=ptsStartTime-dtsStartTime;}
2487this.sourceUpdater_.timestampOffset(segmentInfo.timestampOffset);this.trigger('timestampoffset');}
2488var timelineMapping=this.syncController_.mappingForTimeline(segmentInfo.timeline);if(timelineMapping!==null){this.trigger({type:'segmenttimemapping',mapping:timelineMapping});}
2489this.state='APPENDING';if(segment.map){var initId=initSegmentId(segment.map);if(!this.activeInitSegmentId_||this.activeInitSegmentId_!==initId){var initSegment=this.initSegment(segment.map);this.sourceUpdater_.appendBuffer({bytes:initSegment.bytes},function(){_this3.activeInitSegmentId_=initId;});}}
2490segmentInfo.byteLength=segmentInfo.bytes.byteLength;if(typeof segment.start==='number'&&typeof segment.end==='number'){this.mediaSecondsLoaded+=segment.end-segment.start;}else{this.mediaSecondsLoaded+=segment.duration;}
2491this.logger_(segmentInfoString(segmentInfo));this.sourceUpdater_.appendBuffer({bytes:segmentInfo.bytes,videoSegmentTimingInfoCallback:this.handleVideoSegmentTimingInfo_.bind(this,segmentInfo.requestId)},this.handleUpdateEnd_.bind(this));}},{key:'handleVideoSegmentTimingInfo_',value:function handleVideoSegmentTimingInfo_(requestId,event){if(!this.pendingSegment_||requestId!==this.pendingSegment_.requestId){return;}
2492var segment=this.pendingSegment_.segment;if(!segment.videoTimingInfo){segment.videoTimingInfo={};}
2493segment.videoTimingInfo.transmuxerPrependedSeconds=event.videoSegmentTimingInfo.prependedContentDuration||0;segment.videoTimingInfo.transmuxedPresentationStart=event.videoSegmentTimingInfo.start.presentation;segment.videoTimingInfo.transmuxedPresentationEnd=event.videoSegmentTimingInfo.end.presentation;segment.videoTimingInfo.baseMediaDecodeTime=event.videoSegmentTimingInfo.baseMediaDecodeTime;}},{key:'handleUpdateEnd_',value:function handleUpdateEnd_(){if(!this.pendingSegment_){this.state='READY';if(!this.paused()){this.monitorBuffer_();}
2494return;}
2495var segmentInfo=this.pendingSegment_;var segment=segmentInfo.segment;var isWalkingForward=this.mediaIndex!==null;this.pendingSegment_=null;this.recordThroughput_(segmentInfo);this.addSegmentMetadataCue_(segmentInfo);this.state='READY';this.mediaIndex=segmentInfo.mediaIndex;this.fetchAtBuffer_=true;this.currentTimeline_=segmentInfo.timeline;this.trigger('syncinfoupdate');if(segment.end&&this.currentTime_()-segment.end>segmentInfo.playlist.targetDuration*3){this.resetEverything();return;}
2496if(isWalkingForward){this.trigger('bandwidthupdate');}
2497this.trigger('progress');if(this.isEndOfStream_(segmentInfo.mediaIndex+1,segmentInfo.playlist)){this.endOfStream();}
2498if(!this.paused()){this.monitorBuffer_();}}},{key:'recordThroughput_',value:function recordThroughput_(segmentInfo){var rate=this.throughput.rate;var segmentProcessingTime=Date.now()-segmentInfo.endOfAllRequests+1;var segmentProcessingThroughput=Math.floor(segmentInfo.byteLength/segmentProcessingTime*8*1000);this.throughput.rate+=(segmentProcessingThroughput-rate)/++this.throughput.count;}},{key:'addSegmentMetadataCue_',value:function addSegmentMetadataCue_(segmentInfo){if(!this.segmentMetadataTrack_){return;}
2499var segment=segmentInfo.segment;var start=segment.start;var end=segment.end;if(!finite(start)||!finite(end)){return;}
2500removeCuesFromTrack(start,end,this.segmentMetadataTrack_);var Cue=window$3.WebKitDataCue||window$3.VTTCue;var value={custom:segment.custom,dateTimeObject:segment.dateTimeObject,dateTimeString:segment.dateTimeString,bandwidth:segmentInfo.playlist.attributes.BANDWIDTH,resolution:segmentInfo.playlist.attributes.RESOLUTION,codecs:segmentInfo.playlist.attributes.CODECS,byteLength:segmentInfo.byteLength,uri:segmentInfo.uri,timeline:segmentInfo.timeline,playlist:segmentInfo.playlist.id,start:start,end:end};var data=JSON.stringify(value);var cue=new Cue(start,end,data);cue.value=value;this.segmentMetadataTrack_.addCue(cue);}}]);return SegmentLoader;}(videojs$1.EventTarget);var uint8ToUtf8=function uint8ToUtf8(uintArray){return decodeURIComponent(escape(String.fromCharCode.apply(null,uintArray)));};
vendor: 28,276 bytes, lines 2500-2576
2500var VTT_LINE_TERMINATORS=new Uint8Array('\n\n'.split('').map(function(_char2){return _char2.charCodeAt(0);}));var VTTSegmentLoader=function(_SegmentLoader){inherits$2(VTTSegmentLoader,_SegmentLoader);function VTTSegmentLoader(settings){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};classCallCheck$1(this,VTTSegmentLoader);var _this=possibleConstructorReturn$1(this,(VTTSegmentLoader.__proto__||Object.getPrototypeOf(VTTSegmentLoader)).call(this,settings,options));_this.mediaSource_=null;_this.subtitlesTrack_=null;_this.featuresNativeTextTracks_=settings.featuresNativeTextTracks;return _this;}
2501createClass$1(VTTSegmentLoader,[{key:'buffered_',value:function buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues.length){return videojs$1.createTimeRanges();}
2502var cues=this.subtitlesTrack_.cues;var start=cues[0].startTime;var end=cues[cues.length-1].startTime;return videojs$1.createTimeRanges([[start,end]]);}},{key:'initSegment',value:function initSegment(map){var set$$1=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(!map){return null;}
2503var id=initSegmentId(map);var storedMap=this.initSegments_[id];if(set$$1&&!storedMap&&map.bytes){var combinedByteLength=VTT_LINE_TERMINATORS.byteLength+map.bytes.byteLength;var combinedSegment=new Uint8Array(combinedByteLength);combinedSegment.set(map.bytes);combinedSegment.set(VTT_LINE_TERMINATORS,map.bytes.byteLength);this.initSegments_[id]=storedMap={resolvedUri:map.resolvedUri,byterange:map.byterange,bytes:combinedSegment};}
2504return storedMap||map;}},{key:'couldBeginLoading_',value:function couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused();}},{key:'init_',value:function init_(){this.state='READY';this.resetEverything();return this.monitorBuffer_();}},{key:'track',value:function track(_track){if(typeof _track==='undefined'){return this.subtitlesTrack_;}
2505this.subtitlesTrack_=_track;if(this.state==='INIT'&&this.couldBeginLoading_()){this.init_();}
2506return this.subtitlesTrack_;}},{key:'remove',value:function remove(start,end){removeCuesFromTrack(start,end,this.subtitlesTrack_);}},{key:'fillBuffer_',value:function fillBuffer_(){var _this2=this;if(!this.syncPoint_){this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());}
2507var segmentInfo=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_);segmentInfo=this.skipEmptySegments_(segmentInfo);if(!segmentInfo){return;}
2508if(this.syncController_.timestampOffsetForTimeline(segmentInfo.timeline)===null){var checkTimestampOffset=function checkTimestampOffset(){_this2.state='READY';if(!_this2.paused()){_this2.monitorBuffer_();}};this.syncController_.one('timestampoffset',checkTimestampOffset);this.state='WAITING_ON_TIMELINE';return;}
2509this.loadSegment_(segmentInfo);}},{key:'skipEmptySegments_',value:function skipEmptySegments_(segmentInfo){while(segmentInfo&&segmentInfo.segment.empty){segmentInfo=this.generateSegmentInfo_(segmentInfo.playlist,segmentInfo.mediaIndex+1,segmentInfo.startOfSegment+segmentInfo.duration,segmentInfo.isSyncRequest);}
2510return segmentInfo;}},{key:'handleSegment_',value:function handleSegment_(){var _this3=this;if(!this.pendingSegment_||!this.subtitlesTrack_){this.state='READY';return;}
2511this.state='APPENDING';var segmentInfo=this.pendingSegment_;var segment=segmentInfo.segment;if(typeof window$3.WebVTT!=='function'&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var loadHandler=void 0;var errorHandler=function errorHandler(){_this3.subtitlesTrack_.tech_.off('vttjsloaded',loadHandler);_this3.error({message:'Error loading vtt.js'});_this3.state='READY';_this3.pause();_this3.trigger('error');};loadHandler=function loadHandler(){_this3.subtitlesTrack_.tech_.off('vttjserror',errorHandler);_this3.handleSegment_();};this.state='WAITING_ON_VTTJS';this.subtitlesTrack_.tech_.one('vttjsloaded',loadHandler);this.subtitlesTrack_.tech_.one('vttjserror',errorHandler);return;}
2512segment.requested=true;try{this.parseVTTCues_(segmentInfo);}catch(e){this.error({message:e.message});this.state='READY';this.pause();return this.trigger('error');}
2513this.updateTimeMapping_(segmentInfo,this.syncController_.timelines[segmentInfo.timeline],this.playlist_);if(segmentInfo.isSyncRequest){this.trigger('syncinfoupdate');this.pendingSegment_=null;this.state='READY';return;}
2514segmentInfo.byteLength=segmentInfo.bytes.byteLength;this.mediaSecondsLoaded+=segment.duration;if(segmentInfo.cues.length){this.remove(segmentInfo.cues[0].endTime,segmentInfo.cues[segmentInfo.cues.length-1].endTime);}
2515segmentInfo.cues.forEach(function(cue){_this3.subtitlesTrack_.addCue(_this3.featuresNativeTextTracks_?new window$3.VTTCue(cue.startTime,cue.endTime,cue.text):cue);});this.handleUpdateEnd_();}},{key:'parseVTTCues_',value:function parseVTTCues_(segmentInfo){var decoder=void 0;var decodeBytesToString=false;if(typeof window$3.TextDecoder==='function'){decoder=new window$3.TextDecoder('utf8');}else{decoder=window$3.WebVTT.StringDecoder();decodeBytesToString=true;}
2516var parser=new window$3.WebVTT.Parser(window$3,window$3.vttjs,decoder);segmentInfo.cues=[];segmentInfo.timestampmap={MPEGTS:0,LOCAL:0};parser.oncue=segmentInfo.cues.push.bind(segmentInfo.cues);parser.ontimestampmap=function(map){return segmentInfo.timestampmap=map;};parser.onparsingerror=function(error){videojs$1.log.warn('Error encountered when parsing cues: '+error.message);};if(segmentInfo.segment.map){var mapData=segmentInfo.segment.map.bytes;if(decodeBytesToString){mapData=uint8ToUtf8(mapData);}
2517parser.parse(mapData);}
2518var segmentData=segmentInfo.bytes;if(decodeBytesToString){segmentData=uint8ToUtf8(segmentData);}
2519parser.parse(segmentData);parser.flush();}},{key:'updateTimeMapping_',value:function updateTimeMapping_(segmentInfo,mappingObj,playlist){var segment=segmentInfo.segment;if(!mappingObj){return;}
2520if(!segmentInfo.cues.length){segment.empty=true;return;}
2521var timestampmap=segmentInfo.timestampmap;var diff=timestampmap.MPEGTS/90000-timestampmap.LOCAL+mappingObj.mapping;if(this.recordedTimestampLocal){if(timestampmap.LOCAL!=this.recordedTimestampLocal){diff-=this.recordedTimestampLocal-timestampmap.LOCAL;}}else{this.recordedTimestampLocal=timestampmap.LOCAL;}
2522segmentInfo.cues.forEach(function(cue){cue.startTime+=diff;cue.endTime+=diff;});if(!playlist.syncInfo){var firstStart=segmentInfo.cues[0].startTime;var lastStart=segmentInfo.cues[segmentInfo.cues.length-1].startTime;playlist.syncInfo={mediaSequence:playlist.mediaSequence+segmentInfo.mediaIndex,time:Math.min(firstStart,lastStart-segment.duration)};}}}]);return VTTSegmentLoader;}(SegmentLoader);var findAdCue=function findAdCue(track,mediaTime){var cues=track.cues;for(var i=0;i<cues.length;i++){var cue=cues[i];if(mediaTime>=cue.adStartTime&&mediaTime<=cue.adEndTime){return cue;}}
2523return null;};var updateAdCues=function updateAdCues(media,track){var offset=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;if(!media.segments){return;}
2524var mediaTime=offset;var cue=void 0;for(var i=0;i<media.segments.length;i++){var segment=media.segments[i];if(!cue){cue=findAdCue(track,mediaTime+segment.duration/2);}
2525if(cue){if('cueIn'in segment){cue.endTime=mediaTime;cue.adEndTime=mediaTime;mediaTime+=segment.duration;cue=null;continue;}
2526if(mediaTime<cue.endTime){mediaTime+=segment.duration;continue;}
2527cue.endTime+=segment.duration;}else{if('cueOut'in segment){cue=new window$3.VTTCue(mediaTime,mediaTime+segment.duration,segment.cueOut);cue.adStartTime=mediaTime;cue.adEndTime=mediaTime+parseFloat(segment.cueOut);track.addCue(cue);}
2528if('cueOutCont'in segment){var adOffset=void 0;var adTotal=void 0;var _segment$cueOutCont$s=segment.cueOutCont.split('/').map(parseFloat);var _segment$cueOutCont$s2=slicedToArray(_segment$cueOutCont$s,2);adOffset=_segment$cueOutCont$s2[0];adTotal=_segment$cueOutCont$s2[1];cue=new window$3.VTTCue(mediaTime,mediaTime+segment.duration,'');cue.adStartTime=mediaTime-adOffset;cue.adEndTime=cue.adStartTime+adTotal;track.addCue(cue);}}
2529mediaTime+=segment.duration;}};var tsprobe=tsInspector.inspect;var syncPointStrategies=[{name:'VOD',run:function run(syncController,playlist,duration$$1,currentTimeline,currentTime){if(duration$$1!==Infinity){var syncPoint={time:0,segmentIndex:0};return syncPoint;}
2530return null;}},{name:'ProgramDateTime',run:function run(syncController,playlist,duration$$1,currentTimeline,currentTime){if(!syncController.datetimeToDisplayTime){return null;}
2531var segments=playlist.segments||[];var syncPoint=null;var lastDistance=null;currentTime=currentTime||0;for(var i=0;i<segments.length;i++){var segment=segments[i];if(segment.dateTimeObject){var segmentTime=segment.dateTimeObject.getTime()/1000;var segmentStart=segmentTime+syncController.datetimeToDisplayTime;var distance=Math.abs(currentTime-segmentStart);if(lastDistance!==null&&(distance===0||lastDistance<distance)){break;}
2532lastDistance=distance;syncPoint={time:segmentStart,segmentIndex:i};}}
2533return syncPoint;}},{name:'Segment',run:function run(syncController,playlist,duration$$1,currentTimeline,currentTime){var segments=playlist.segments||[];var syncPoint=null;var lastDistance=null;currentTime=currentTime||0;for(var i=0;i<segments.length;i++){var segment=segments[i];if(segment.timeline===currentTimeline&&typeof segment.start!=='undefined'){var distance=Math.abs(currentTime-segment.start);if(lastDistance!==null&&lastDistance<distance){break;}
2534if(!syncPoint||lastDistance===null||lastDistance>=distance){lastDistance=distance;syncPoint={time:segment.start,segmentIndex:i};}}}
2535return syncPoint;}},{name:'Discontinuity',run:function run(syncController,playlist,duration$$1,currentTimeline,currentTime){var syncPoint=null;currentTime=currentTime||0;if(playlist.discontinuityStarts&&playlist.discontinuityStarts.length){var lastDistance=null;for(var i=0;i<playlist.discontinuityStarts.length;i++){var segmentIndex=playlist.discontinuityStarts[i];var discontinuity=playlist.discontinuitySequence+i+1;var discontinuitySync=syncController.discontinuities[discontinuity];if(discontinuitySync){var distance=Math.abs(currentTime-discontinuitySync.time);if(lastDistance!==null&&lastDistance<distance){break;}
2536if(!syncPoint||lastDistance===null||lastDistance>=distance){lastDistance=distance;syncPoint={time:discontinuitySync.time,segmentIndex:segmentIndex};}}}}
2537return syncPoint;}},{name:'Playlist',run:function run(syncController,playlist,duration$$1,currentTimeline,currentTime){if(playlist.syncInfo){var syncPoint={time:playlist.syncInfo.time,segmentIndex:playlist.syncInfo.mediaSequence-playlist.mediaSequence};return syncPoint;}
2538return null;}}];var SyncController=function(_videojs$EventTarget){inherits$2(SyncController,_videojs$EventTarget);function SyncController(){classCallCheck$1(this,SyncController);var _this=possibleConstructorReturn$1(this,(SyncController.__proto__||Object.getPrototypeOf(SyncController)).call(this));_this.inspectCache_=undefined;_this.timelines=[];_this.discontinuities=[];_this.datetimeToDisplayTime=null;_this.logger_=logger('SyncController');return _this;}
2539createClass$1(SyncController,[{key:'getSyncPoint',value:function getSyncPoint(playlist,duration$$1,currentTimeline,currentTime){var syncPoints=this.runStrategies_(playlist,duration$$1,currentTimeline,currentTime);if(!syncPoints.length){return null;}
2540return this.selectSyncPoint_(syncPoints,{key:'time',value:currentTime});}},{key:'getExpiredTime',value:function getExpiredTime(playlist,duration$$1){if(!playlist||!playlist.segments){return null;}
2541var syncPoints=this.runStrategies_(playlist,duration$$1,playlist.discontinuitySequence,0);if(!syncPoints.length){return null;}
2542var syncPoint=this.selectSyncPoint_(syncPoints,{key:'segmentIndex',value:0});if(syncPoint.segmentIndex>0){syncPoint.time*=-1;}
2543return Math.abs(syncPoint.time+sumDurations(playlist,syncPoint.segmentIndex,0));}},{key:'runStrategies_',value:function runStrategies_(playlist,duration$$1,currentTimeline,currentTime){var syncPoints=[];for(var i=0;i<syncPointStrategies.length;i++){var strategy=syncPointStrategies[i];var syncPoint=strategy.run(this,playlist,duration$$1,currentTimeline,currentTime);if(syncPoint){syncPoint.strategy=strategy.name;syncPoints.push({strategy:strategy.name,syncPoint:syncPoint});}}
2544return syncPoints;}},{key:'selectSyncPoint_',value:function selectSyncPoint_(syncPoints,target){var bestSyncPoint=syncPoints[0].syncPoint;var bestDistance=Math.abs(syncPoints[0].syncPoint[target.key]-target.value);var bestStrategy=syncPoints[0].strategy;for(var i=1;i<syncPoints.length;i++){var newDistance=Math.abs(syncPoints[i].syncPoint[target.key]-target.value);if(newDistance<bestDistance){bestDistance=newDistance;bestSyncPoint=syncPoints[i].syncPoint;bestStrategy=syncPoints[i].strategy;}}
2545this.logger_('syncPoint for ['+target.key+': '+target.value+'] chosen with strategy'+(' ['+bestStrategy+']: [time:'+bestSyncPoint.time+',')+(' segmentIndex:'+bestSyncPoint.segmentIndex+']'));return bestSyncPoint;}},{key:'saveExpiredSegmentInfo',value:function saveExpiredSegmentInfo(oldPlaylist,newPlaylist){var mediaSequenceDiff=newPlaylist.mediaSequence-oldPlaylist.mediaSequence;for(var i=mediaSequenceDiff-1;i>=0;i--){var lastRemovedSegment=oldPlaylist.segments[i];if(lastRemovedSegment&&typeof lastRemovedSegment.start!=='undefined'){newPlaylist.syncInfo={mediaSequence:oldPlaylist.mediaSequence+i,time:lastRemovedSegment.start};this.logger_('playlist refresh sync: [time:'+newPlaylist.syncInfo.time+','+(' mediaSequence: '+newPlaylist.syncInfo.mediaSequence+']'));this.trigger('syncinfoupdate');break;}}}},{key:'setDateTimeMapping',value:function setDateTimeMapping(playlist){if(!this.datetimeToDisplayTime&&playlist.segments&&playlist.segments.length&&playlist.segments[0].dateTimeObject){var playlistTimestamp=playlist.segments[0].dateTimeObject.getTime()/1000;this.datetimeToDisplayTime=-playlistTimestamp;}}},{key:'reset',value:function reset(){this.inspectCache_=undefined;}},{key:'probeSegmentInfo',value:function probeSegmentInfo(segmentInfo){var segment=segmentInfo.segment;var playlist=segmentInfo.playlist;var timingInfo=void 0;if(segment.map){timingInfo=this.probeMp4Segment_(segmentInfo);}else{timingInfo=this.probeTsSegment_(segmentInfo);}
2546if(timingInfo){if(this.calculateSegmentTimeMapping_(segmentInfo,timingInfo)){this.saveDiscontinuitySyncInfo_(segmentInfo);if(!playlist.syncInfo){playlist.syncInfo={mediaSequence:playlist.mediaSequence+segmentInfo.mediaIndex,time:segment.start};}}}
2547return timingInfo;}},{key:'probeMp4Segment_',value:function probeMp4Segment_(segmentInfo){var segment=segmentInfo.segment;var timescales=probe.timescale(segment.map.bytes);var compositionStartTime=probe.compositionStartTime(timescales,segmentInfo.bytes);if(segmentInfo.timestampOffset!==null){segmentInfo.timestampOffset-=compositionStartTime;}
2548return{start:compositionStartTime,end:compositionStartTime+segment.duration};}},{key:'probeTsSegment_',value:function probeTsSegment_(segmentInfo){var timeInfo=tsprobe(segmentInfo.bytes,this.inspectCache_);var segmentStartTime=void 0;var segmentEndTime=void 0;var segmentTimestampInfo=void 0;if(!timeInfo){return null;}
2549if(timeInfo.video&&timeInfo.video.length===2){this.inspectCache_=timeInfo.video[1].dts;segmentStartTime=timeInfo.video[0].dtsTime;segmentEndTime=timeInfo.video[1].dtsTime;segmentTimestampInfo=timeInfo.video;}else if(timeInfo.audio&&timeInfo.audio.length===2){this.inspectCache_=timeInfo.audio[1].dts;segmentStartTime=timeInfo.audio[0].dtsTime;segmentEndTime=timeInfo.audio[1].dtsTime;segmentTimestampInfo=timeInfo.audio;}
2550var probedInfo={segmentTimestampInfo:segmentTimestampInfo,start:segmentStartTime,end:segmentEndTime,containsVideo:timeInfo.video&&timeInfo.video.length===2,containsAudio:timeInfo.audio&&timeInfo.audio.length===2};return probedInfo;}},{key:'timestampOffsetForTimeline',value:function timestampOffsetForTimeline(timeline){if(typeof this.timelines[timeline]==='undefined'){return null;}
2551return this.timelines[timeline].time;}},{key:'mappingForTimeline',value:function mappingForTimeline(timeline){if(typeof this.timelines[timeline]==='undefined'){return null;}
2552return this.timelines[timeline].mapping;}},{key:'calculateSegmentTimeMapping_',value:function calculateSegmentTimeMapping_(segmentInfo,timingInfo){var segment=segmentInfo.segment;var mappingObj=this.timelines[segmentInfo.timeline];if(segmentInfo.timestampOffset!==null){mappingObj={time:segmentInfo.startOfSegment,mapping:segmentInfo.startOfSegment-timingInfo.start};this.timelines[segmentInfo.timeline]=mappingObj;this.trigger('timestampoffset');this.logger_('time mapping for timeline '+segmentInfo.timeline+': '+('[time: '+mappingObj.time+'] [mapping: '+mappingObj.mapping+']'));segment.start=segmentInfo.startOfSegment;segment.end=timingInfo.end+mappingObj.mapping;}else if(mappingObj){segment.start=timingInfo.start+mappingObj.mapping;segment.end=timingInfo.end+mappingObj.mapping;}else{return false;}
2553return true;}},{key:'saveDiscontinuitySyncInfo_',value:function saveDiscontinuitySyncInfo_(segmentInfo){var playlist=segmentInfo.playlist;var segment=segmentInfo.segment;if(segment.discontinuity){this.discontinuities[segment.timeline]={time:segment.start,accuracy:0};}else if(playlist.discontinuityStarts&&playlist.discontinuityStarts.length){for(var i=0;i<playlist.discontinuityStarts.length;i++){var segmentIndex=playlist.discontinuityStarts[i];var discontinuity=playlist.discontinuitySequence+i+1;var mediaIndexDiff=segmentIndex-segmentInfo.mediaIndex;var accuracy=Math.abs(mediaIndexDiff);if(!this.discontinuities[discontinuity]||this.discontinuities[discontinuity].accuracy>accuracy){var time=void 0;if(mediaIndexDiff<0){time=segment.start-sumDurations(playlist,segmentInfo.mediaIndex,segmentIndex);}else{time=segment.end+sumDurations(playlist,segmentInfo.mediaIndex+1,segmentIndex);}
2554this.discontinuities[discontinuity]={time:time,accuracy:accuracy};}}}}},{key:'dispose',value:function dispose(){this.trigger('dispose');this.off();}}]);return SyncController;}(videojs$1.EventTarget);var Decrypter$1=new shimWorker("./decrypter-worker.worker.js",function(window,document$$1){var self=this;var decrypterWorker=function(){function unpad(padded){return padded.subarray(0,padded.byteLength-padded[padded.byteLength-1]);}
2555var classCallCheck=function classCallCheck(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||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}
2556return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();var inherits=function inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}
2557subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;};var possibleConstructorReturn=function possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}
2558return call&&(typeof call==="object"||typeof call==="function")?call:self;};var precompute=function precompute(){var tables=[[[],[],[],[],[]],[[],[],[],[],[]]];var encTable=tables[0];var decTable=tables[1];var sbox=encTable[4];var sboxInv=decTable[4];var i=void 0;var x=void 0;var xInv=void 0;var d=[];var th=[];var x2=void 0;var x4=void 0;var x8=void 0;var s=void 0;var tEnc=void 0;var tDec=void 0;for(i=0;i<256;i++){th[(d[i]=i<<1^(i>>7)*283)^i]=i;}
2559for(x=xInv=0;!sbox[x];x^=x2||1,xInv=th[xInv]||1){s=xInv^xInv<<1^xInv<<2^xInv<<3^xInv<<4;s=s>>8^s&255^99;sbox[x]=s;sboxInv[s]=x;x8=d[x4=d[x2=d[x]]];tDec=x8*0x1010101^x4*0x10001^x2*0x101^x*0x1010100;tEnc=d[s]*0x101^s*0x1010100;for(i=0;i<4;i++){encTable[i][x]=tEnc=tEnc<<24^tEnc>>>8;decTable[i][s]=tDec=tDec<<24^tDec>>>8;}}
2560for(i=0;i<5;i++){encTable[i]=encTable[i].slice(0);decTable[i]=decTable[i].slice(0);}
2561return tables;};var aesTables=null;var AES=function(){function AES(key){classCallCheck(this,AES);if(!aesTables){aesTables=precompute();}
2562this._tables=[[aesTables[0][0].slice(),aesTables[0][1].slice(),aesTables[0][2].slice(),aesTables[0][3].slice(),aesTables[0][4].slice()],[aesTables[1][0].slice(),aesTables[1][1].slice(),aesTables[1][2].slice(),aesTables[1][3].slice(),aesTables[1][4].slice()]];var i=void 0;var j=void 0;var tmp=void 0;var encKey=void 0;var decKey=void 0;var sbox=this._tables[0][4];var decTable=this._tables[1];var keyLen=key.length;var rcon=1;if(keyLen!==4&&keyLen!==6&&keyLen!==8){throw new Error('Invalid aes key size');}
2563encKey=key.slice(0);decKey=[];this._key=[encKey,decKey];for(i=keyLen;i<4*keyLen+28;i++){tmp=encKey[i-1];if(i%keyLen===0||keyLen===8&&i%keyLen===4){tmp=sbox[tmp>>>24]<<24^sbox[tmp>>16&255]<<16^sbox[tmp>>8&255]<<8^sbox[tmp&255];if(i%keyLen===0){tmp=tmp<<8^tmp>>>24^rcon<<24;rcon=rcon<<1^(rcon>>7)*283;}}
2564encKey[i]=encKey[i-keyLen]^tmp;}
2565for(j=0;i;j++,i--){tmp=encKey[j&3?i:i-4];if(i<=4||j<4){decKey[j]=tmp;}else{decKey[j]=decTable[0][sbox[tmp>>>24]]^decTable[1][sbox[tmp>>16&255]]^decTable[2][sbox[tmp>>8&255]]^decTable[3][sbox[tmp&255]];}}}
2566AES.prototype.decrypt=function decrypt$$1(encrypted0,encrypted1,encrypted2,encrypted3,out,offset){var key=this._key[1];var a=encrypted0^key[0];var b=encrypted3^key[1];var c=encrypted2^key[2];var d=encrypted1^key[3];var a2=void 0;var b2=void 0;var c2=void 0;var nInnerRounds=key.length/4-2;var i=void 0;var kIndex=4;var table=this._tables[1];var table0=table[0];var table1=table[1];var table2=table[2];var table3=table[3];var sbox=table[4];for(i=0;i<nInnerRounds;i++){a2=table0[a>>>24]^table1[b>>16&255]^table2[c>>8&255]^table3[d&255]^key[kIndex];b2=table0[b>>>24]^table1[c>>16&255]^table2[d>>8&255]^table3[a&255]^key[kIndex+1];c2=table0[c>>>24]^table1[d>>16&255]^table2[a>>8&255]^table3[b&255]^key[kIndex+2];d=table0[d>>>24]^table1[a>>16&255]^table2[b>>8&255]^table3[c&255]^key[kIndex+3];kIndex+=4;a=a2;b=b2;c=c2;}
2567for(i=0;i<4;i++){out[(3&-i)+offset]=sbox[a>>>24]<<24^sbox[b>>16&255]<<16^sbox[c>>8&255]<<8^sbox[d&255]^key[kIndex++];a2=a;a=b;b=c;c=d;d=a2;}};return AES;}();var Stream=function(){function Stream(){classCallCheck(this,Stream);this.listeners={};}
2568Stream.prototype.on=function on(type,listener){if(!this.listeners[type]){this.listeners[type]=[];}
2569this.listeners[type].push(listener);};Stream.prototype.off=function off(type,listener){if(!this.listeners[type]){return false;}
2570var index=this.listeners[type].indexOf(listener);this.listeners[type].splice(index,1);return index>-1;};Stream.prototype.trigger=function trigger(type){var callbacks=this.listeners[type];if(!callbacks){return;}
2571if(arguments.length===2){var length=callbacks.length;for(var i=0;i<length;++i){callbacks[i].call(this,arguments[1]);}}else{var args=Array.prototype.slice.call(arguments,1);var _length=callbacks.length;for(var _i=0;_i<_length;++_i){callbacks[_i].apply(this,args);}}};Stream.prototype.dispose=function dispose(){this.listeners={};};Stream.prototype.pipe=function pipe(destination){this.on('data',function(data){destination.push(data);});};return Stream;}();var AsyncStream$$1=function(_Stream){inherits(AsyncStream$$1,_Stream);function AsyncStream$$1(){classCallCheck(this,AsyncStream$$1);var _this=possibleConstructorReturn(this,_Stream.call(this,Stream));_this.jobs=[];_this.delay=1;_this.timeout_=null;return _this;}
2572AsyncStream$$1.prototype.processJob_=function processJob_(){this.jobs.shift()();if(this.jobs.length){this.timeout_=setTimeout(this.processJob_.bind(this),this.delay);}else{this.timeout_=null;}};AsyncStream$$1.prototype.push=function push(job){this.jobs.push(job);if(!this.timeout_){this.timeout_=setTimeout(this.processJob_.bind(this),this.delay);}};return AsyncStream$$1;}(Stream);var ntoh=function ntoh(word){return word<<24|(word&0xff00)<<8|(word&0xff0000)>>8|word>>>24;};var decrypt$$1=function decrypt$$1(encrypted,key,initVector){var encrypted32=new Int32Array(encrypted.buffer,encrypted.byteOffset,encrypted.byteLength>>2);var decipher=new AES(Array.prototype.slice.call(key));var decrypted=new Uint8Array(encrypted.byteLength);var decrypted32=new Int32Array(decrypted.buffer);var init0=void 0;var init1=void 0;var init2=void 0;var init3=void 0;var encrypted0=void 0;var encrypted1=void 0;var encrypted2=void 0;var encrypted3=void 0;var wordIx=void 0;init0=initVector[0];init1=initVector[1];init2=initVector[2];init3=initVector[3];for(wordIx=0;wordIx<encrypted32.length;wordIx+=4){encrypted0=ntoh(encrypted32[wordIx]);encrypted1=ntoh(encrypted32[wordIx+1]);encrypted2=ntoh(encrypted32[wordIx+2]);encrypted3=ntoh(encrypted32[wordIx+3]);decipher.decrypt(encrypted0,encrypted1,encrypted2,encrypted3,decrypted32,wordIx);decrypted32[wordIx]=ntoh(decrypted32[wordIx]^init0);decrypted32[wordIx+1]=ntoh(decrypted32[wordIx+1]^init1);decrypted32[wordIx+2]=ntoh(decrypted32[wordIx+2]^init2);decrypted32[wordIx+3]=ntoh(decrypted32[wordIx+3]^init3);init0=encrypted0;init1=encrypted1;init2=encrypted2;init3=encrypted3;}
2573return decrypted;};var Decrypter$$1=function(){function Decrypter$$1(encrypted,key,initVector,done){classCallCheck(this,Decrypter$$1);var step=Decrypter$$1.STEP;var encrypted32=new Int32Array(encrypted.buffer);var decrypted=new Uint8Array(encrypted.byteLength);var i=0;this.asyncStream_=new AsyncStream$$1();this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i,i+step),key,initVector,decrypted));for(i=step;i<encrypted32.length;i+=step){initVector=new Uint32Array([ntoh(encrypted32[i-4]),ntoh(encrypted32[i-3]),ntoh(encrypted32[i-2]),ntoh(encrypted32[i-1])]);this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i,i+step),key,initVector,decrypted));}
2574this.asyncStream_.push(function(){done(null,unpad(decrypted));});}
2575Decrypter$$1.prototype.decryptChunk_=function decryptChunk_(encrypted,key,initVector,decrypted){return function(){var bytes=decrypt$$1(encrypted,key,initVector);decrypted.set(bytes,encrypted.byteOffset);};};createClass(Decrypter$$1,null,[{key:'STEP',get:function get$$1(){return 32000;}}]);return Decrypter$$1;}();var createTransferableMessage=function createTransferableMessage(message){var transferable={};Object.keys(message).forEach(function(key){var value=message[key];if(ArrayBuffer.isView(value)){transferable[key]={bytes:value.buffer,byteOffset:value.byteOffset,byteLength:value.byteLength};}else{transferable[key]=value;}});return transferable;};var DecrypterWorker=function DecrypterWorker(self){self.onmessage=function(event){var data=event.data;var encrypted=new Uint8Array(data.encrypted.bytes,data.encrypted.byteOffset,data.encrypted.byteLength);var key=new Uint32Array(data.key.bytes,data.key.byteOffset,data.key.byteLength/4);var iv=new Uint32Array(data.iv.bytes,data.iv.byteOffset,data.iv.byteLength/4);new Decrypter$$1(encrypted,key,iv,function(err,bytes){self.postMessage(createTransferableMessage({source:data.source,decrypted:bytes}),[bytes.buffer]);});};};var decrypterWorker=new DecrypterWorker(self);return decrypterWorker;}();});var audioTrackKind_=function audioTrackKind_(properties){var kind=properties["default"]?'main':'alternative';if(properties.characteristics&&properties.characteristics.indexOf('public.accessibility.describes-video')>=0){kind='main-desc';}
2576return kind;};var stopLoaders=function stopLoaders(segmentLoader,mediaType){segmentLoader.abort();segmentLoader.pause();if(mediaType&&mediaType.activePlaylistLoader){mediaType.activePlaylistLoader.pause();mediaType.activePlaylistLoader=null;}};var startLoaders=function startLoaders(playlistLoader,mediaType){mediaType.activePlaylistLoader=playlistLoader;playlistLoader.load();};var onGroupChanged=function onGroupChanged(type,settings){return function(){var _settings$segmentLoad=settings.segmentLoaders,segmentLoader=_settings$segmentLoad[type],mainSegmentLoader=_settings$segmentLoad.main,mediaType=sett
vendor: 7,354 bytes, lines 2576-2597
2576ings.mediaTypes[type];var activeTrack=mediaType.activeTrack();var activeGroup=mediaType.activeGroup(activeTrack);var previousActiveLoader=mediaType.activePlaylistLoader;stopLoaders(segmentLoader,mediaType);if(!activeGroup){return;}
2577if(!activeGroup.playlistLoader){if(previousActiveLoader){mainSegmentLoader.resetEverything();}
2578return;}
2579segmentLoader.resyncLoader();startLoaders(activeGroup.playlistLoader,mediaType);};};var onTrackChanged=function onTrackChanged(type,settings){return function(){var _settings$segmentLoad2=settings.segmentLoaders,segmentLoader=_settings$segmentLoad2[type],mainSegmentLoader=_settings$segmentLoad2.main,mediaType=settings.mediaTypes[type];var activeTrack=mediaType.activeTrack();var activeGroup=mediaType.activeGroup(activeTrack);var previousActiveLoader=mediaType.activePlaylistLoader;stopLoaders(segmentLoader,mediaType);if(!activeGroup){return;}
2580if(!activeGroup.playlistLoader){mainSegmentLoader.resetEverything();return;}
2581if(previousActiveLoader===activeGroup.playlistLoader){startLoaders(activeGroup.playlistLoader,mediaType);return;}
2582if(segmentLoader.track){segmentLoader.track(activeTrack);}
2583segmentLoader.resetEverything();startLoaders(activeGroup.playlistLoader,mediaType);};};var onError={AUDIO:function AUDIO(type,settings){return function(){var segmentLoader=settings.segmentLoaders[type],mediaType=settings.mediaTypes[type],blacklistCurrentPlaylist=settings.blacklistCurrentPlaylist;stopLoaders(segmentLoader,mediaType);var activeTrack=mediaType.activeTrack();var activeGroup=mediaType.activeGroup();var id=(activeGroup.filter(function(group){return group["default"];})[0]||activeGroup[0]).id;var defaultTrack=mediaType.tracks[id];if(activeTrack===defaultTrack){blacklistCurrentPlaylist({message:'Problem encountered loading the default audio track.'});return;}
2584videojs$1.log.warn('Problem encountered loading the alternate audio track.'+'Switching back to default.');for(var trackId in mediaType.tracks){mediaType.tracks[trackId].enabled=mediaType.tracks[trackId]===defaultTrack;}
2585mediaType.onTrackChanged();};},SUBTITLES:function SUBTITLES(type,settings){return function(){var segmentLoader=settings.segmentLoaders[type],mediaType=settings.mediaTypes[type];videojs$1.log.warn('Problem encountered loading the subtitle track.'+'Disabling subtitle track.');stopLoaders(segmentLoader,mediaType);var track=mediaType.activeTrack();if(track){track.mode='disabled';}
2586mediaType.onTrackChanged();};}};var setupListeners={AUDIO:function AUDIO(type,playlistLoader,settings){if(!playlistLoader){return;}
2587var tech=settings.tech,requestOptions=settings.requestOptions,segmentLoader=settings.segmentLoaders[type];playlistLoader.on('loadedmetadata',function(){var media=playlistLoader.media();segmentLoader.playlist(media,requestOptions);if(!tech.paused()||media.endList&&tech.preload()!=='none'){segmentLoader.load();}});playlistLoader.on('loadedplaylist',function(){segmentLoader.playlist(playlistLoader.media(),requestOptions);if(!tech.paused()){segmentLoader.load();}});playlistLoader.on('error',onError[type](type,settings));},SUBTITLES:function SUBTITLES(type,playlistLoader,settings){var tech=settings.tech,requestOptions=settings.requestOptions,segmentLoader=settings.segmentLoaders[type],mediaType=settings.mediaTypes[type];playlistLoader.on('loadedmetadata',function(){var media=playlistLoader.media();segmentLoader.playlist(media,requestOptions);segmentLoader.track(mediaType.activeTrack());if(!tech.paused()||media.endList&&tech.preload()!=='none'){segmentLoader.load();}});playlistLoader.on('loadedplaylist',function(){segmentLoader.playlist(playlistLoader.media(),requestOptions);if(!tech.paused()){segmentLoader.load();}});playlistLoader.on('error',onError[type](type,settings));}};var initialize={'AUDIO':function AUDIO(type,settings){var hls=settings.hls,sourceType=settings.sourceType,segmentLoader=settings.segmentLoaders[type],requestOptions=settings.requestOptions,mediaGroups=settings.master.mediaGroups,_settings$mediaTypes$=settings.mediaTypes[type],groups=_settings$mediaTypes$.groups,tracks=_settings$mediaTypes$.tracks,masterPlaylistLoader=settings.masterPlaylistLoader;if(!mediaGroups[type]||Object.keys(mediaGroups[type]).length===0){mediaGroups[type]={main:{"default":{"default":true}}};}
2588for(var groupId in mediaGroups[type]){if(!groups[groupId]){groups[groupId]=[];}
2589for(var variantLabel in mediaGroups[type][groupId]){var properties=mediaGroups[type][groupId][variantLabel];var playlistLoader=void 0;if(properties.resolvedUri){playlistLoader=new PlaylistLoader(properties.resolvedUri,hls,requestOptions);}else if(properties.playlists&&sourceType==='dash'){playlistLoader=new DashPlaylistLoader(properties.playlists[0],hls,requestOptions,masterPlaylistLoader);}else{playlistLoader=null;}
2590properties=videojs$1.mergeOptions({id:variantLabel,playlistLoader:playlistLoader},properties);setupListeners[type](type,properties.playlistLoader,settings);groups[groupId].push(properties);if(typeof tracks[variantLabel]==='undefined'){var track=new videojs$1.AudioTrack({id:variantLabel,kind:audioTrackKind_(properties),enabled:false,language:properties.language,"default":properties["default"],label:variantLabel});tracks[variantLabel]=track;}}}
2591segmentLoader.on('error',onError[type](type,settings));},'SUBTITLES':function SUBTITLES(type,settings){var tech=settings.tech,hls=settings.hls,sourceType=settings.sourceType,segmentLoader=settings.segmentLoaders[type],requestOptions=settings.requestOptions,mediaGroups=settings.master.mediaGroups,_settings$mediaTypes$2=settings.mediaTypes[type],groups=_settings$mediaTypes$2.groups,tracks=_settings$mediaTypes$2.tracks,masterPlaylistLoader=settings.masterPlaylistLoader;for(var groupId in mediaGroups[type]){if(!groups[groupId]){groups[groupId]=[];}
2592for(var variantLabel in mediaGroups[type][groupId]){if(mediaGroups[type][groupId][variantLabel].forced){continue;}
2593var properties=mediaGroups[type][groupId][variantLabel];var playlistLoader=void 0;if(sourceType==='hls'){playlistLoader=new PlaylistLoader(properties.resolvedUri,hls,requestOptions);}else if(sourceType==='dash'){playlistLoader=new DashPlaylistLoader(properties.playlists[0],hls,requestOptions,masterPlaylistLoader);}
2594properties=videojs$1.mergeOptions({id:variantLabel,playlistLoader:playlistLoader},properties);setupListeners[type](type,properties.playlistLoader,settings);groups[groupId].push(properties);if(typeof tracks[variantLabel]==='undefined'){var track=tech.addRemoteTextTrack({id:variantLabel,kind:'subtitles',"default":properties["default"]&&properties.autoselect,language:properties.language,label:variantLabel},false).track;tracks[variantLabel]=track;}}}
2595segmentLoader.on('error',onError[type](type,settings));},'CLOSED-CAPTIONS':function CLOSEDCAPTIONS(type,settings){var tech=settings.tech,mediaGroups=settings.master.mediaGroups,_settings$mediaTypes$3=settings.mediaTypes[type],groups=_settings$mediaTypes$3.groups,tracks=_settings$mediaTypes$3.tracks;for(var groupId in mediaGroups[type]){if(!groups[groupId]){groups[groupId]=[];}
2596for(var variantLabel in mediaGroups[type][groupId]){var properties=mediaGroups[type][groupId][variantLabel];if(!properties.instreamId.match(/CC\d/)){continue;}
2597groups[groupId].push(videojs$1.mergeOptions({id:variantLabel},properties));if(typeof tracks[variantLabel]==='undefined'){var track=tech.addRemoteTextTrack({id:properties.instreamId,
vendor: 11,879 bytes, lines 2597-2622
2597kind:'captions',"default":properties["default"]&&properties.autoselect,language:properties.language,label:variantLabel},false).track;tracks[variantLabel]=track;}}}}};var activeGroup=function activeGroup(type,settings){return function(track){var masterPlaylistLoader=settings.masterPlaylistLoader,groups=settings.mediaTypes[type].groups;var media=masterPlaylistLoader.media();if(!media){return null;}
2598var variants=null;if(media.attributes[type]){variants=groups[media.attributes[type]];}
2599variants=variants||groups.main;if(typeof track==='undefined'){return variants;}
2600if(track===null){return null;}
2601return variants.filter(function(props){return props.id===track.id;})[0]||null;};};var activeTrack={AUDIO:function AUDIO(type,settings){return function(){var tracks=settings.mediaTypes[type].tracks;for(var id in tracks){if(tracks[id].enabled){return tracks[id];}}
2602return null;};},SUBTITLES:function SUBTITLES(type,settings){return function(){var tracks=settings.mediaTypes[type].tracks;for(var id in tracks){if(tracks[id].mode==='showing'||tracks[id].mode==='hidden'){return tracks[id];}}
2603return null;};}};var setupMediaGroups=function setupMediaGroups(settings){['AUDIO','SUBTITLES','CLOSED-CAPTIONS'].forEach(function(type){initialize[type](type,settings);});var mediaTypes=settings.mediaTypes,masterPlaylistLoader=settings.masterPlaylistLoader,tech=settings.tech,hls=settings.hls;['AUDIO','SUBTITLES'].forEach(function(type){mediaTypes[type].activeGroup=activeGroup(type,settings);mediaTypes[type].activeTrack=activeTrack[type](type,settings);mediaTypes[type].onGroupChanged=onGroupChanged(type,settings);mediaTypes[type].onTrackChanged=onTrackChanged(type,settings);});var audioGroup=mediaTypes.AUDIO.activeGroup();var groupId=(audioGroup.filter(function(group){return group["default"];})[0]||audioGroup[0]).id;mediaTypes.AUDIO.tracks[groupId].enabled=true;mediaTypes.AUDIO.onTrackChanged();masterPlaylistLoader.on('mediachange',function(){['AUDIO','SUBTITLES'].forEach(function(type){return mediaTypes[type].onGroupChanged();});});var onAudioTrackChanged=function onAudioTrackChanged(){mediaTypes.AUDIO.onTrackChanged();tech.trigger({type:'usage',name:'hls-audio-change'});};tech.audioTracks().addEventListener('change',onAudioTrackChanged);tech.remoteTextTracks().addEventListener('change',mediaTypes.SUBTITLES.onTrackChanged);hls.on('dispose',function(){tech.audioTracks().removeEventListener('change',onAudioTrackChanged);tech.remoteTextTracks().removeEventListener('change',mediaTypes.SUBTITLES.onTrackChanged);});tech.clearTracks('audio');for(var id in mediaTypes.AUDIO.tracks){tech.audioTracks().addTrack(mediaTypes.AUDIO.tracks[id]);}};var createMediaTypes=function createMediaTypes(){var mediaTypes={};['AUDIO','SUBTITLES','CLOSED-CAPTIONS'].forEach(function(type){mediaTypes[type]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:noop$1,activeTrack:noop$1,onGroupChanged:noop$1,onTrackChanged:noop$1};});return mediaTypes;};var ABORT_EARLY_BLACKLIST_SECONDS=10;var Hls=void 0;var loaderStats=['mediaRequests','mediaRequestsAborted','mediaRequestsTimedout','mediaRequestsErrored','mediaTransferDuration','mediaBytesTransferred'];var sumLoaderStat=function sumLoaderStat(stat){return this.audioSegmentLoader_[stat]+this.mainSegmentLoader_[stat];};var shouldSwitchToMedia=function shouldSwitchToMedia(_ref){var currentPlaylist=_ref.currentPlaylist,nextPlaylist=_ref.nextPlaylist,forwardBuffer=_ref.forwardBuffer,bufferLowWaterLine=_ref.bufferLowWaterLine,duration$$1=_ref.duration,log=_ref.log;if(!nextPlaylist){videojs$1.log.warn('We received no playlist to switch to. Please check your stream.');return false;}
2604if(!currentPlaylist.endList){return true;}
2605if(duration$$1<Config.MAX_BUFFER_LOW_WATER_LINE){return true;}
2606if(nextPlaylist.attributes.BANDWIDTH<currentPlaylist.attributes.BANDWIDTH){return true;}
2607if(forwardBuffer>=bufferLowWaterLine){return true;}
2608return false;};var MasterPlaylistController=function(_videojs$EventTarget){inherits$2(MasterPlaylistController,_videojs$EventTarget);function MasterPlaylistController(options){classCallCheck$1(this,MasterPlaylistController);var _this=possibleConstructorReturn$1(this,(MasterPlaylistController.__proto__||Object.getPrototypeOf(MasterPlaylistController)).call(this));var url=options.url,handleManifestRedirects=options.handleManifestRedirects,withCredentials=options.withCredentials,tech=options.tech,bandwidth=options.bandwidth,externHls=options.externHls,useCueTags=options.useCueTags,blacklistDuration=options.blacklistDuration,enableLowInitialPlaylist=options.enableLowInitialPlaylist,cacheEncryptionKeys=options.cacheEncryptionKeys,sourceType=options.sourceType;if(!url){throw new Error('A non-empty playlist URL is required');}
2609Hls=externHls;_this.withCredentials=withCredentials;_this.tech_=tech;_this.hls_=tech.hls;_this.sourceType_=sourceType;_this.useCueTags_=useCueTags;_this.blacklistDuration=blacklistDuration;_this.enableLowInitialPlaylist=enableLowInitialPlaylist;if(_this.useCueTags_){_this.cueTagsTrack_=_this.tech_.addTextTrack('metadata','ad-cues');_this.cueTagsTrack_.inBandMetadataTrackDispatchType='';}
2610_this.requestOptions_={withCredentials:withCredentials,handleManifestRedirects:handleManifestRedirects,timeout:null};_this.mediaTypes_=createMediaTypes();_this.mediaSource=new videojs$1.MediaSource();_this.mediaSource.addEventListener('sourceopen',_this.handleSourceOpen_.bind(_this));_this.seekable_=videojs$1.createTimeRanges();_this.hasPlayed_=false;_this.syncController_=new SyncController(options);_this.segmentMetadataTrack_=tech.addRemoteTextTrack({kind:'metadata',label:'segment-metadata'},false).track;_this.decrypter_=new Decrypter$1();_this.inbandTextTracks_={};var segmentLoaderSettings={hls:_this.hls_,mediaSource:_this.mediaSource,currentTime:_this.tech_.currentTime.bind(_this.tech_),seekable:function seekable$$1(){return _this.seekable();},seeking:function seeking(){return _this.tech_.seeking();},duration:function duration$$1(){return _this.mediaSource.duration;},hasPlayed:function hasPlayed(){return _this.hasPlayed_;},goalBufferLength:function goalBufferLength(){return _this.goalBufferLength();},bandwidth:bandwidth,syncController:_this.syncController_,decrypter:_this.decrypter_,sourceType:_this.sourceType_,inbandTextTracks:_this.inbandTextTracks_,cacheEncryptionKeys:cacheEncryptionKeys};_this.masterPlaylistLoader_=_this.sourceType_==='dash'?new DashPlaylistLoader(url,_this.hls_,_this.requestOptions_):new PlaylistLoader(url,_this.hls_,_this.requestOptions_);_this.setupMasterPlaylistLoaderListeners_();_this.mainSegmentLoader_=new SegmentLoader(videojs$1.mergeOptions(segmentLoaderSettings,{segmentMetadataTrack:_this.segmentMetadataTrack_,loaderType:'main'}),options);_this.audioSegmentLoader_=new SegmentLoader(videojs$1.mergeOptions(segmentLoaderSettings,{loaderType:'audio'}),options);_this.subtitleSegmentLoader_=new VTTSegmentLoader(videojs$1.mergeOptions(segmentLoaderSettings,{loaderType:'vtt',featuresNativeTextTracks:_this.tech_.featuresNativeTextTracks}),options);_this.setupSegmentLoaderListeners_();loaderStats.forEach(function(stat){_this[stat+'_']=sumLoaderStat.bind(_this,stat);});_this.logger_=logger('MPC');_this.masterPlaylistLoader_.load();return _this;}
2611createClass$1(MasterPlaylistController,[{key:'setupMasterPlaylistLoaderListeners_',value:function setupMasterPlaylistLoaderListeners_(){var _this2=this;this.masterPlaylistLoader_.on('loadedmetadata',function(){var media=_this2.masterPlaylistLoader_.media();var requestTimeout=media.targetDuration*1.5*1000;if(isLowestEnabledRendition(_this2.masterPlaylistLoader_.master,_this2.masterPlaylistLoader_.media())){_this2.requestOptions_.timeout=0;}else{_this2.requestOptions_.timeout=requestTimeout;}
2612if(media.endList&&_this2.tech_.preload()!=='none'){_this2.mainSegmentLoader_.playlist(media,_this2.requestOptions_);_this2.mainSegmentLoader_.load();}
2613setupMediaGroups({sourceType:_this2.sourceType_,segmentLoaders:{AUDIO:_this2.audioSegmentLoader_,SUBTITLES:_this2.subtitleSegmentLoader_,main:_this2.mainSegmentLoader_},tech:_this2.tech_,requestOptions:_this2.requestOptions_,masterPlaylistLoader:_this2.masterPlaylistLoader_,hls:_this2.hls_,master:_this2.master(),mediaTypes:_this2.mediaTypes_,blacklistCurrentPlaylist:_this2.blacklistCurrentPlaylist.bind(_this2)});_this2.triggerPresenceUsage_(_this2.master(),media);try{_this2.setupSourceBuffers_();}catch(e){videojs$1.log.warn('Failed to create SourceBuffers',e);return _this2.mediaSource.endOfStream('decode');}
2614_this2.setupFirstPlay();if(!_this2.mediaTypes_.AUDIO.activePlaylistLoader||_this2.mediaTypes_.AUDIO.activePlaylistLoader.media()){_this2.trigger('selectedinitialmedia');}else{_this2.mediaTypes_.AUDIO.activePlaylistLoader.one('loadedmetadata',function(){_this2.trigger('selectedinitialmedia');});}});this.masterPlaylistLoader_.on('loadedplaylist',function(){var updatedPlaylist=_this2.masterPlaylistLoader_.media();if(!updatedPlaylist){_this2.excludeUnsupportedVariants_();var selectedMedia=void 0;if(_this2.enableLowInitialPlaylist){selectedMedia=_this2.selectInitialPlaylist();}
2615if(!selectedMedia){selectedMedia=_this2.selectPlaylist();}
2616_this2.initialMedia_=selectedMedia;_this2.masterPlaylistLoader_.media(_this2.initialMedia_);return;}
2617if(_this2.useCueTags_){_this2.updateAdCues_(updatedPlaylist);}
2618_this2.mainSegmentLoader_.playlist(updatedPlaylist,_this2.requestOptions_);_this2.updateDuration();if(!_this2.tech_.paused()){_this2.mainSegmentLoader_.load();if(_this2.audioSegmentLoader_){_this2.audioSegmentLoader_.load();}}
2619if(!updatedPlaylist.endList){var addSeekableRange=function addSeekableRange(){var seekable$$1=_this2.seekable();if(seekable$$1.length!==0){_this2.mediaSource.addSeekableRange_(seekable$$1.start(0),seekable$$1.end(0));}};if(_this2.duration()!==Infinity){var onDurationchange=function onDurationchange(){if(_this2.duration()===Infinity){addSeekableRange();}else{_this2.tech_.one('durationchange',onDurationchange);}};_this2.tech_.one('durationchange',onDurationchange);}else{addSeekableRange();}}});this.masterPlaylistLoader_.on('error',function(){_this2.blacklistCurrentPlaylist(_this2.masterPlaylistLoader_.error);});this.masterPlaylistLoader_.on('mediachanging',function(){_this2.mainSegmentLoader_.abort();_this2.mainSegmentLoader_.pause();});this.masterPlaylistLoader_.on('mediachange',function(){var media=_this2.masterPlaylistLoader_.media();var requestTimeout=media.targetDuration*1.5*1000;if(isLowestEnabledRendition(_this2.masterPlaylistLoader_.master,_this2.masterPlaylistLoader_.media())){_this2.requestOptions_.timeout=0;}else{_this2.requestOptions_.timeout=requestTimeout;}
2620_this2.mainSegmentLoader_.playlist(media,_this2.requestOptions_);_this2.mainSegmentLoader_.load();_this2.tech_.trigger({type:'mediachange',bubbles:true});});this.masterPlaylistLoader_.on('playlistunchanged',function(){var updatedPlaylist=_this2.masterPlaylistLoader_.media();var playlistOutdated=_this2.stuckAtPlaylistEnd_(updatedPlaylist);if(playlistOutdated){_this2.blacklistCurrentPlaylist({message:'Playlist no longer updating.'});_this2.tech_.trigger('playliststuck');}});this.masterPlaylistLoader_.on('renditiondisabled',function(){_this2.tech_.trigger({type:'usage',name:'hls-rendition-disabled'});});this.masterPlaylistLoader_.on('renditionenabled',function(){_this2.tech_.trigger({type:'usage',name:'hls-rendition-enabled'});});}},{key:'triggerPresenceUsage_',value:function triggerPresenceUsage_(master,media){var mediaGroups=master.mediaGroups||{};var defaultDemuxed=true;var audioGroupKeys=Object.keys(mediaGroups.AUDIO);for(var mediaGroup in mediaGroups.AUDIO){for(var label in mediaGroups.AUDIO[mediaGroup]){var properties=mediaGroups.AUDIO[mediaGroup][label];if(!properties.uri){defaultDemuxed=false;}}}
2621if(defaultDemuxed){this.tech_.trigger({type:'usage',name:'hls-demuxed'});}
2622if(Object.keys(mediaGroups.SUBTITLES).length){this.tech_.trigger({type:'usage',name:'hls-webvtt'});}
2623if(Hls.Playlist.isAes(media)){this.tech_.trigger({type:'usage',name:'hls-aes'});}
2624if(Hls.Playlist.isFmp4(media)){this.tech_.trigger({type:'usage',name:'hls-fmp4'});}
2625if(audioGroupKeys.length&&Object.keys(mediaGroups.AUDIO[audioGroupKeys[0]]).length>1){this.tech_.trigger({type:'usage',name:'hls-alternate-audio'});}
2626if(this.useCueTags_){this.tech_.trigger({type:'usage',name:'hls-playlist-cue-tags'});}}},{key:'setupSegmentLoaderListeners_',value:function setupSegmentLoaderListeners_(){var _this3=this;this.mainSegmentLoader_.on('bandwidthupdate',function(){var nextPlaylist=_this3.selectPlaylist();var currentPlaylist=_this3.masterPlaylistLoader_.media();var buffered=_this3.tech_.buffered();var forwardBuffer=buffered.length?buffered.end(buffered.length-1)-_this3.tech_.currentTime():0;var bufferLowWaterLine=_this3.bufferLowWaterLine();if(shouldSwitchToMedia({currentPlaylist:currentPlaylist,nextPlaylist:nextPlaylist,forwardBuffer:forwardBuffer,bufferLowWaterLine:bufferLowWaterLine,duration:_this3.duration(),log:_this3.logger_})){_this3.masterPlaylistLoader_.media(nextPlaylist);}
2627_this3.tech_.trigger('bandwidthupdate');});this.mainSegmentLoader_.on('progress',function(){_this3.trigger('progress');});this.mainSegmentLoader_.on('error',function(){_this3.blacklistCurrentPlaylist(_this3.mainSegmentLoader_.error());});this.mainSegmentLoader_.on('syncinfoupdate',function(){_this3.onSyncInfoUpdate_();});this.mainSegmentLoader_.on('timestampoffset',function(){_this3.tech_.trigger({type:'usage',name:'hls-timestamp-offset'});});this.audioSegmentLoader_.on('syncinfoupdate',function(){_this3.onSyncInfoUpdate_();});this.mainSegmentLoader_.on('ended',function(){_this3.onEndOfStream();});this.mainSegmentLoader_.on('earlyabort',function(){_this3.blacklistCurrentPlaylist({message:'Aborted early because there isn\'t enough bandwidth to complete the '+'request without rebuffering.'},ABORT_EARLY_BLACKLIST_SECONDS);});this.mainSegmentLoader_.on('reseteverything',function(){_this3.tech_.trigger('hls-reset');});this.mainSegmentLoader_.on('segmenttimemapping',function(event){_this3.tech_.trigger({type:'hls-segment-time-mapping',mapping:event.mapping});});this.audioSegmentLoader_.on('ended',function(){_this3.onEndOfStream();});}},{key:'mediaSecondsLoaded_',value:function mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded);}},{key:'load',value:function load(){this.mainSegmentLoader_.load();if(this.mediaTypes_.AUDIO.activePlaylistLoader){this.audioSegmentLoader_.load();}
2628if(this.mediaTypes_.SUBTITLES.activePlaylistLoader){this.subtitleSegmentLoader_.load();}}},{key:'smoothQualityChange_',value:function smoothQualityChange_(){var media=this.selectPlaylist();if(media!==this.masterPlaylistLoader_.media()){this.masterPlaylistLoader_.media(media);this.mainSegmentLoader_.resetLoader();}}},{key:'fastQualityChange_',value:function fastQualityChange_(){var _this4=this;var media=this.selectPlaylist();if(media===this.masterPlaylistLoader_.media()){return;}
2629this.masterPlaylistLoader_.media(media);this.mainSegmentLoader_.resetEverything(function(){if(videojs$1.browser.IE_VERSION||videojs$1.browser.IS_EDGE){_this4.tech_.setCurrentTime(_this4.tech_.currentTime()+0.04);}else{_this4.tech_.setCurrentTime(_this4.tech_.currentTime());}});}},{key:'play',value:function play(){if(this.setupFirstPlay()){return;}
2630if(this.tech_.ended()){this.tech_.setCurrentTime(0);}
2631if(this.hasPlayed_){this.load();}
2632var seekable$$1=this.tech_.seekable();if(this.tech_.duration()===Infinity){if(this.tech_.currentTime()<seekable$$1.start(0)){return this.tech_.setCurrentTime(seekable$$1.end(seekable$$1.length-1));}}}},{key:'setupFirstPlay',value:function setupFirstPlay(){var _this5=this;var media=this.masterPlaylistLoader_.media();if(!media||this.tech_.paused()||this.hasPlayed_){return false;}
2633if(!media.endList){var seekable$$1=this.seekable();if(!seekable$$1.length){return false;}
2634if(videojs$1.browser.IE_VERSION&&this.tech_.readyState()===0){this.tech_.one('loadedmetadata',function(){_this5.trigger('firstplay');_this5.tech_.setCurrentTime(seekable$$1.end(0));_this5.hasPlayed_=true;});return false;}
2635this.trigger('firstplay');this.tech_.setCurrentTime(seekable$$1.end(0));}
2636this.hasPlayed_=true;this.load();return true;}},{key:'handleSourceOpen_',value:function handleSourceOpen_(){try{this.setupSourceBuffers_();}catch(e){videojs$1.log.warn('Failed to create Source Buffers',e);return this.mediaSource.endOfStream('decode');}
vendor: 1,762 bytes, lines 2637-2643
2637if(this.tech_.autoplay()){var playPromise=this.tech_.play();if(typeof playPromise!=='undefined'&&typeof playPromise.then==='function'){playPromise.then(null,function(e){});}}
2638this.trigger('sourceopen');}},{key:'onEndOfStream',value:function onEndOfStream(){var isEndOfStream=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(!this.mainSegmentLoader_.startingMedia_||this.mainSegmentLoader_.startingMedia_.containsVideo){isEndOfStream=isEndOfStream&&this.audioSegmentLoader_.ended_;}else{isEndOfStream=this.audioSegmentLoader_.ended_;}}
2639if(!isEndOfStream){return;}
2640this.logger_('calling mediaSource.endOfStream()');try{this.mediaSource.endOfStream();}catch(e){videojs$1.log.warn('Failed to call media source endOfStream',e);}}},{key:'stuckAtPlaylistEnd_',value:function stuckAtPlaylistEnd_(playlist){var seekable$$1=this.seekable();if(!seekable$$1.length){return false;}
2641var expired=this.syncController_.getExpiredTime(playlist,this.mediaSource.duration);if(expired===null){return false;}
2642var absolutePlaylistEnd=Hls.Playlist.playlistEnd(playlist,expired);var currentTime=this.tech_.currentTime();var buffered=this.tech_.buffered();if(!buffered.length){return absolutePlaylistEnd-currentTime<=SAFE_TIME_DELTA;}
2643var bufferedEnd=buffered.end(buffered.length-1);return bufferedEnd-currentTime<=SAFE_TIME_DELTA&&absolutePlaylistEnd-bufferedEnd<=SAFE_TIME_DELTA;}},{key:'blacklistCurrentPlaylist',value:function blacklistCurrentPlaylist(){var error=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var blacklistDuration=arguments[1];var currentPlaylist=void 0;var nextPlaylist=void 0;currentPlaylist=error.playlist||this.masterPlaylistLoader_.media();blacklistDuration=blacklistDuration||error.blacklistDuration||this.blackl
2643istDuration;if(!currentPlaylist){this.error=error;try{return this.mediaSource.endOfStream('network');}catch(e){return this.trigger('error');}}
2644var isFinalRendition=this.masterPlaylistLoader_.master.playlists.filter(isEnabled).length===1;var playlists=this.masterPlaylistLoader_.master.playlists;if(playlists.length===1){videojs$1.log.warn('Problem encountered with the current '+'HLS playlist. Trying again since it is the only playlist.');this.tech_.trigger('retryplaylist');return this.masterPlaylistLoader_.load(isFinalRendition);}
2645if(isFinalRendition){videojs$1.log.warn('Removing all playlists from the blacklist because the last '+'rendition is about to be blacklisted.');playlists.forEach(function(playlist){if(playlist.excludeUntil!==Infinity){delete playlist.excludeUntil;}});this.tech_.trigger('retryplaylist');}
2646currentPlaylist.excludeUntil=Date.now()+blacklistDuration*1000;this.tech_.trigger('blacklistplaylist');this.tech_.trigger({type:'usage',name:'hls-rendition-blacklisted'});nextPlaylist=this.selectPlaylist();videojs$1.log.warn('Problem encountered with the current HLS playlist.'+(error.message?' '+error.message:'')+' Switching to another playlist.');return this.masterPlaylistLoader_.media(nextPlaylist,isFinalRendition);}},{key:'pauseLoading',value:function pauseLoading(){this.mainSegmentLoader_.pause();if(this.mediaTypes_.AUDIO.activePlaylistLoader){this.audioSegmentLoader_.pause();}
2647if(this.mediaTypes_.SUBTITLES.activePlaylistLoader){this.subtitleSegmentLoader_.pause();}}},{key:'setCurrentTime',value:function setCurrentTime(currentTime){var buffered=findRange(this.tech_.buffered(),currentTime);if(!(this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media())){return 0;}
2648if(!this.masterPlaylistLoader_.media().segments){return 0;}
2649if(buffered&&buffered.length){return currentTime;}
2650this.mainSegmentLoader_.resetEverything();this.mainSegmentLoader_.abort();if(this.mediaTypes_.AUDIO.activePlaylistLoader){this.audioSegmentLoader_.resetEverything();this.audioSegmentLoader_.abort();}
2651if(this.mediaTypes_.SUBTITLES.activePlaylistLoader){this.subtitleSegmentLoader_.resetEverything();this.subtitleSegmentLoader_.abort();}
2652this.load();}},{key:'duration',value:function duration$$1(){if(!this.masterPlaylistLoader_){return 0;}
2653if(this.mediaSource){return this.mediaSource.duration;}
2654return Hls.Playlist.duration(this.masterPlaylistLoader_.media());}},{key:'seekable',value:function seekable$$1(){return this.seekable_;}},{key:'onSyncInfoUpdate_',value:function onSyncInfoUpdate_(){var audioSeekable=void 0;if(!this.masterPlaylistLoader_){return;}
2655var media=this.masterPlaylistLoader_.media();if(!media){return;}
2656var expired=this.syncController_.getExpiredTime(media,this.mediaSource.duration);if(expired===null){return;}
2657var suggestedPresentationDelay=this.masterPlaylistLoader_.master.suggestedPresentationDelay;var mainSeekable=Hls.Playlist.seekable(media,expired,suggestedPresentationDelay);if(mainSeekable.length===0){return;}
2658if(this.mediaTypes_.AUDIO.activePlaylistLoader){media=this.mediaTypes_.AUDIO.activePlaylistLoader.media();expired=this.syncController_.getExpiredTime(media,this.mediaSource.duration);if(expired===null){return;}
2659audioSeekable=Hls.Playlist.seekable(media,expired,suggestedPresentationDelay);if(audioSeekable.length===0){return;}}
2660var oldEnd=void 0;var oldStart=void 0;if(this.seekable_&&this.seekable_.length){oldEnd=this.seekable_.end(0);oldStart=this.seekable_.start(0);}
2661if(!audioSeekable){this.seekable_=mainSeekable;}else if(audioSeekable.start(0)>mainSeekable.end(0)||mainSeekable.start(0)>audioSeekable.end(0)){this.seekable_=mainSeekable;}else{this.seekable_=videojs$1.createTimeRanges([[audioSeekable.start(0)>mainSeekable.start(0)?audioSeekable.start(0):mainSeekable.start(0),audioSeekable.end(0)<mainSeekable.end(0)?audioSeekable.end(0):mainSeekable.end(0)]]);}
2662if(this.seekable_&&this.seekable_.length){if(this.seekable_.end(0)===oldEnd&&this.seekable_.start(0)===oldStart){return;}}
2663this.logger_('seekable updated ['+printableRange(this.seekable_)+']');this.tech_.trigger('seekablechanged');}},{key:'updateDuration',value:function updateDuration(){var _this6=this;var oldDuration=this.mediaSource.duration;var newDuration=Hls.Playlist.duration(this.masterPlaylistLoader_.media());var buffered=this.tech_.buffered();var setDuration=function setDuration(){_this6.logger_('Setting duration from '+_this6.mediaSource.duration+' =>
vendor: 15,041 bytes, lines 2663-2704
2663 '+newDuration);try{_this6.mediaSource.duration=newDuration;}catch(e){videojs$1.log.warn('Failed to set media source duration',e);}
2664_this6.tech_.trigger('durationchange');_this6.mediaSource.removeEventListener('sourceopen',setDuration);};if(buffered.length>0){newDuration=Math.max(newDuration,buffered.end(buffered.length-1));}
2665if(oldDuration!==newDuration){if(this.mediaSource.readyState!=='open'){this.mediaSource.addEventListener('sourceopen',setDuration);}else{setDuration();}}}},{key:'dispose',value:function dispose(){var _this7=this;this.trigger('dispose');if(this.decrypter_){this.decrypter_.terminate();}
2666this.masterPlaylistLoader_.dispose();this.mainSegmentLoader_.dispose();['AUDIO','SUBTITLES'].forEach(function(type){var groups=_this7.mediaTypes_[type].groups;for(var id in groups){groups[id].forEach(function(group){if(group.playlistLoader){group.playlistLoader.dispose();}});}});this.audioSegmentLoader_.dispose();this.subtitleSegmentLoader_.dispose();this.off();if(this.mediaSource.dispose){this.mediaSource.dispose();}}},{key:'master',value:function master(){return this.masterPlaylistLoader_.master;}},{key:'media',value:function media(){return this.masterPlaylistLoader_.media()||this.initialMedia_;}},{key:'setupSourceBuffers_',value:function setupSourceBuffers_(){var media=this.masterPlaylistLoader_.media();var mimeTypes=void 0;if(!media||this.mediaSource.readyState!=='open'){return;}
2667mimeTypes=mimeTypesForPlaylist(this.masterPlaylistLoader_.master,media);if(mimeTypes.length<1){this.error='No compatible SourceBuffer configuration for the variant stream:'+media.resolvedUri;return this.mediaSource.endOfStream('decode');}
2668this.configureLoaderMimeTypes_(mimeTypes);this.excludeIncompatibleVariants_(media);}},{key:'configureLoaderMimeTypes_',value:function configureLoaderMimeTypes_(mimeTypes){var sourceBufferEmitter=mimeTypes.length>1&&mimeTypes[0].indexOf(',')===-1&&mimeTypes[0]!==mimeTypes[1]?new videojs$1.EventTarget():null;this.mainSegmentLoader_.mimeType(mimeTypes[0],sourceBufferEmitter);if(mimeTypes[1]){this.audioSegmentLoader_.mimeType(mimeTypes[1],sourceBufferEmitter);}}},{key:'excludeUnsupportedVariants_',value:function excludeUnsupportedVariants_(){this.master().playlists.forEach(function(variant){if(variant.attributes.CODECS&&window$3.MediaSource&&window$3.MediaSource.isTypeSupported&&!window$3.MediaSource.isTypeSupported('video/mp4; codecs="'+mapLegacyAvcCodecs(variant.attributes.CODECS)+'"')){variant.excludeUntil=Infinity;}});}},{key:'excludeIncompatibleVariants_',value:function excludeIncompatibleVariants_(media){var codecCount=2;var videoCodec=null;var codecs=void 0;if(media.attributes.CODECS){codecs=parseCodecs(media.attributes.CODECS);videoCodec=codecs.videoCodec;codecCount=codecs.codecCount;}
2669this.master().playlists.forEach(function(variant){var variantCodecs={codecCount:2,videoCodec:null};if(variant.attributes.CODECS){variantCodecs=parseCodecs(variant.attributes.CODECS);}
2670if(variantCodecs.codecCount!==codecCount){variant.excludeUntil=Infinity;}
2671if(variantCodecs.videoCodec!==videoCodec){variant.excludeUntil=Infinity;}});}},{key:'updateAdCues_',value:function updateAdCues_(media){var offset=0;var seekable$$1=this.seekable();if(seekable$$1.length){offset=seekable$$1.start(0);}
2672updateAdCues(media,this.cueTagsTrack_,offset);}},{key:'goalBufferLength',value:function goalBufferLength(){var currentTime=this.tech_.currentTime();var initial=Config.GOAL_BUFFER_LENGTH;var rate=Config.GOAL_BUFFER_LENGTH_RATE;var max=Math.max(initial,Config.MAX_GOAL_BUFFER_LENGTH);return Math.min(initial+currentTime*rate,max);}},{key:'bufferLowWaterLine',value:function bufferLowWaterLine(){var currentTime=this.tech_.currentTime();var initial=Config.BUFFER_LOW_WATER_LINE;var rate=Config.BUFFER_LOW_WATER_LINE_RATE;var max=Math.max(initial,Config.MAX_BUFFER_LOW_WATER_LINE);return Math.min(initial+currentTime*rate,max);}}]);return MasterPlaylistController;}(videojs$1.EventTarget);var enableFunction=function enableFunction(loader,playlistID,changePlaylistFn){return function(enable){var playlist=loader.master.playlists[playlistID];var incompatible=isIncompatible(playlist);var currentlyEnabled=isEnabled(playlist);if(typeof enable==='undefined'){return currentlyEnabled;}
2673if(enable){delete playlist.disabled;}else{playlist.disabled=true;}
2674if(enable!==currentlyEnabled&&!incompatible){changePlaylistFn();if(enable){loader.trigger('renditionenabled');}else{loader.trigger('renditiondisabled');}}
2675return enable;};};var Representation=function Representation(hlsHandler,playlist,id){classCallCheck$1(this,Representation);var mpc=hlsHandler.masterPlaylistController_,smoothQualityChange=hlsHandler.options_.smoothQualityChange;var changeType=smoothQualityChange?'smooth':'fast';var qualityChangeFunction=mpc[changeType+'QualityChange_'].bind(mpc);if(playlist.attributes.RESOLUTION){var resolution=playlist.attributes.RESOLUTION;this.width=resolution.width;this.height=resolution.height;}
2676this.bandwidth=playlist.attributes.BANDWIDTH;this.id=id;this.enabled=enableFunction(hlsHandler.playlists,playlist.id,qualityChangeFunction);};var renditionSelectionMixin=function renditionSelectionMixin(hlsHandler){var playlists=hlsHandler.playlists;hlsHandler.representations=function(){if(!playlists||!playlists.master||!playlists.master.playlists){return[];}
2677return playlists.master.playlists.filter(function(media){return!isIncompatible(media);}).map(function(e,i){return new Representation(hlsHandler,e,e.id);});};};var timerCancelEvents=['seeking','seeked','pause','playing','error'];var PlaybackWatcher=function(){function PlaybackWatcher(options){var _this=this;classCallCheck$1(this,PlaybackWatcher);this.tech_=options.tech;this.seekable=options.seekable;this.allowSeeksWithinUnsafeLiveWindow=options.allowSeeksWithinUnsafeLiveWindow;this.media=options.media;this.consecutiveUpdates=0;this.lastRecordedTime=null;this.timer_=null;this.checkCurrentTimeTimeout_=null;this.logger_=logger('PlaybackWatcher');this.logger_('initialize');var canPlayHandler=function canPlayHandler(){return _this.monitorCurrentTime_();};var waitingHandler=function waitingHandler(){return _this.techWaiting_();};var cancelTimerHandler=function cancelTimerHandler(){return _this.cancelTimer_();};var fixesBadSeeksHandler=function fixesBadSeeksHandler(){return _this.fixesBadSeeks_();};this.tech_.on('seekablechanged',fixesBadSeeksHandler);this.tech_.on('waiting',waitingHandler);this.tech_.on(timerCancelEvents,cancelTimerHandler);this.tech_.on('canplay',canPlayHandler);this.dispose=function(){_this.logger_('dispose');_this.tech_.off('seekablechanged',fixesBadSeeksHandler);_this.tech_.off('waiting',waitingHandler);_this.tech_.off(timerCancelEvents,cancelTimerHandler);_this.tech_.off('canplay',canPlayHandler);if(_this.checkCurrentTimeTimeout_){window$3.clearTimeout(_this.checkCurrentTimeTimeout_);}
2678_this.cancelTimer_();};}
2679createClass$1(PlaybackWatcher,[{key:'monitorCurrentTime_',value:function monitorCurrentTime_(){this.checkCurrentTime_();if(this.checkCurrentTimeTimeout_){window$3.clearTimeout(this.checkCurrentTimeTimeout_);}
2680this.checkCurrentTimeTimeout_=window$3.setTimeout(this.monitorCurrentTime_.bind(this),250);}},{key:'checkCurrentTime_',value:function checkCurrentTime_(){if(this.tech_.seeking()&&this.fixesBadSeeks_()){this.consecutiveUpdates=0;this.lastRecordedTime=this.tech_.currentTime();return;}
2681if(this.tech_.paused()||this.tech_.seeking()){return;}
2682var currentTime=this.tech_.currentTime();var buffered=this.tech_.buffered();if(this.lastRecordedTime===currentTime&&(!buffered.length||currentTime+SAFE_TIME_DELTA>=buffered.end(buffered.length-1))){return this.techWaiting_();}
2683if(this.consecutiveUpdates>=5&&currentTime===this.lastRecordedTime){this.consecutiveUpdates++;this.waiting_();}else if(currentTime===this.lastRecordedTime){this.consecutiveUpdates++;}else{this.consecutiveUpdates=0;this.lastRecordedTime=currentTime;}}},{key:'cancelTimer_',value:function cancelTimer_(){this.consecutiveUpdates=0;if(this.timer_){this.logger_('cancelTimer_');clearTimeout(this.timer_);}
2684this.timer_=null;}},{key:'fixesBadSeeks_',value:function fixesBadSeeks_(){var seeking=this.tech_.seeking();if(!seeking){return false;}
2685var seekable=this.seekable();var currentTime=this.tech_.currentTime();var isAfterSeekableRange=this.afterSeekableWindow_(seekable,currentTime,this.media(),this.allowSeeksWithinUnsafeLiveWindow);var seekTo=void 0;if(isAfterSeekableRange){var seekableEnd=seekable.end(seekable.length-1);seekTo=seekableEnd;}
2686if(this.beforeSeekableWindow_(seekable,currentTime)){var seekableStart=seekable.start(0);seekTo=seekableStart+SAFE_TIME_DELTA;}
2687if(typeof seekTo!=='undefined'){this.logger_('Trying to seek outside of seekable at time '+currentTime+' with '+('seekable range '+printableRange(seekable)+'. Seeking to ')+(seekTo+'.'));this.tech_.setCurrentTime(seekTo);return true;}
2688return false;}},{key:'waiting_',value:function waiting_(){if(this.techWaiting_()){return;}
2689var currentTime=this.tech_.currentTime();var buffered=this.tech_.buffered();var currentRange=findRange(buffered,currentTime);if(currentRange.length&&currentTime+3<=currentRange.end(0)){this.cancelTimer_();this.tech_.setCurrentTime(currentTime);this.logger_('Stopped at '+currentTime+' while inside a buffered region '+('['+currentRange.start(0)+' -> '+currentRange.end(0)+']. Attempting to resume ')+'playback by seeking to the current time.');this.tech_.trigger({type:'usage',name:'hls-unknown-waiting'});return;}}},{key:'techWaiting_',value:function techWaiting_(){var seekable=this.seekable();var currentTime=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_()){return true;}
2690if(this.tech_.seeking()||this.timer_!==null){return true;}
2691if(this.beforeSeekableWindow_(seekable,currentTime)){var livePoint=seekable.end(seekable.length-1);this.logger_('Fell out of live window at time '+currentTime+'. Seeking to '+('live point (seekable end) '+livePoint));this.cancelTimer_();this.tech_.setCurrentTime(livePoint);this.tech_.trigger({type:'usage',name:'hls-live-resync'});return true;}
2692var buffered=this.tech_.buffered();var nextRange=findNextRange(buffered,currentTime);if(this.videoUnderflow_(nextRange,buffered,currentTime)){this.cancelTimer_();this.tech_.setCurrentTime(currentTime);this.tech_.trigger({type:'usage',name:'hls-video-underflow'});return true;}
2693if(nextRange.length>0){var difference=nextRange.start(0)-currentTime;this.logger_('Stopped at '+currentTime+', setting timer for '+difference+', seeking '+('to '+nextRange.start(0)));this.timer_=setTimeout(this.skipTheGap_.bind(this),difference*1000,currentTime);return true;}
2694return false;}},{key:'afterSeekableWindow_',value:function afterSeekableWindow_(seekable,currentTime,playlist){var allowSeeksWithinUnsafeLiveWindow=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;if(!seekable.length){return false;}
2695var allowedEnd=seekable.end(seekable.length-1)+SAFE_TIME_DELTA;var isLive=!playlist.endList;if(isLive&&allowSeeksWithinUnsafeLiveWindow){allowedEnd=seekable.end(seekable.length-1)+playlist.targetDuration*3;}
2696if(currentTime>allowedEnd){return true;}
2697return false;}},{key:'beforeSeekableWindow_',value:function beforeSeekableWindow_(seekable,currentTime){if(seekable.length&&seekable.start(0)>0&&currentTime<seekable.start(0)-SAFE_TIME_DELTA){return true;}
2698return false;}},{key:'videoUnderflow_',value:function videoUnderflow_(nextRange,buffered,currentTime){if(nextRange.length===0){var gap=this.gapFromVideoUnderflow_(buffered,currentTime);if(gap){this.logger_('Encountered a gap in video from '+gap.start+' to '+gap.end+'. '+('Seeking to current time '+currentTime));return true;}}
2699return false;}},{key:'skipTheGap_',value:function skipTheGap_(scheduledCurrentTime){var buffered=this.tech_.buffered();var currentTime=this.tech_.currentTime();var nextRange=findNextRange(buffered,currentTime);this.cancelTimer_();if(nextRange.length===0||currentTime!==scheduledCurrentTime){return;}
2700this.logger_('skipTheGap_:','currentTime:',currentTime,'scheduled currentTime:',scheduledCurrentTime,'nextRange start:',nextRange.start(0));this.tech_.setCurrentTime(nextRange.start(0)+TIME_FUDGE_FACTOR);this.tech_.trigger({type:'usage',name:'hls-gap-skip'});}},{key:'gapFromVideoUnderflow_',value:function gapFromVideoUnderflow_(buffered,currentTime){var gaps=findGaps(buffered);for(var i=0;i<gaps.length;i++){var start=gaps.start(i);var end=gaps.end(i);if(currentTime-start<4&&currentTime-start>2){return{start:start,end:end};}}
2701return null;}}]);return PlaybackWatcher;}();var defaultOptions={errorInterval:30,getSource:function getSource(next){var tech=this.tech({IWillNotUseThisInPlugins:true});var sourceObj=tech.currentSource_;return next(sourceObj);}};var initPlugin=function initPlugin(player,options){var lastCalled=0;var seekTo=0;var localOptions=videojs$1.mergeOptions(defaultOptions,options);player.ready(function(){player.trigger({type:'usage',name:'hls-error-reload-initialized'});});var loadedMetadataHandler=function loadedMetadataHandler(){if(seekTo){player.currentTime(seekTo);}};var setSource=function setSource(sourceObj){if(sourceObj===null||sourceObj===undefined){return;}
2702seekTo=player.duration()!==Infinity&&player.currentTime()||0;player.one('loadedmetadata',loadedMetadataHandler);player.src(sourceObj);player.trigger({type:'usage',name:'hls-error-reload'});player.play();};var errorHandler=function errorHandler(){if(Date.now()-lastCalled<localOptions.errorInterval*1000){player.trigger({type:'usage',name:'hls-error-reload-canceled'});return;}
2703if(!localOptions.getSource||typeof localOptions.getSource!=='function'){videojs$1.log.error('ERROR: reloadSourceOnError - The option getSource must be a function!');return;}
2704lastCalled=Date.now();return localOptions.getSource.call(player,setSource);};var cleanupEvents=function cleanupEvents(){player.off('loadedmetadata',loadedMetadataHandler);player.off('error',errorHandler);player.off('dispose',cleanupEvents);};var reinitPlugin=function reinitPlugin(newOptions){cleanupEvents();initPlugin(player,newOptions);};player.on('error',errorHandler);player.on('dispose',cleanupEvents);player.reloadSourceOnError=reinitPlugin;};var reloadSourceOnError=function reloadSourceOnError(options){initPlugin(this,options);};var version$1="1.13.2";var Hls$1={PlaylistLoader:PlaylistLoader,Playlist:Playlist,Decrypter:Decrypter,AsyncStream:AsyncStream,decrypt:decrypt,utils:utils$1,STANDARD_PLAYLIST_SELECTOR:lastBandwidthSelector,INITIAL_PLAYLIST_SELECTOR:lowestBitrateCompatibleVariantSelector,comparePlaylistBandwidth:comparePlaylistBandwidth,comparePlaylistResolution:comparePlaylistResolution,xhr:xhrFactory()};['GOAL_BUFFER_LENGTH','MAX_GOAL_BUFFER_LENGTH','GOAL_BUFFER_LENGTH_RATE','BUFFER_LOW_WATER_LINE','MAX_BUFFER_LOW_WATER_LINE','BUFFER_LOW_WATER_LINE_RATE','BANDWIDTH_VARIANCE'].forEach(function(prop){Object.defineProperty(Hls$1,prop,{get:function get$$1(){videojs$1.log.warn('using Hls.'+prop+' is UNSAFE be sure you know what you are doing');return Config[prop];},set:function set$$1(value){videojs$1.log.warn('using Hls.'+prop+' is UNSAFE be sure you know 
2704what you are doing');if(typeof value!=='number'||value<0){videojs$1.log.warn('value of Hls.'+prop+' must be greater than or equal to 0');return;}
2705Config[prop]=value;}});});var LOCAL_STORAGE_KEY$1='videojs-vhs';var simpleTypeFromSourceType=function simpleTypeFromSourceType(type){var mpegurlRE=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i;if(mpegurlRE.test(type)){return 'hls';}
2706var dashRE=/^application\/dash\+xml/i;if(dashRE.test(type)){return 'dash';}
2707return null;};var handleHlsMediaChange=function handleHlsMediaChange(qualityLevels,playlistLoader){var newPlaylist=playlistLoader.media();var selectedIndex=-1;for(var i=0;i<qualityLevels.length;i++){if(qualityLevels[i].id===newPlaylist.id){selectedIndex=i;break;}}
2708qualityLevels.selectedIndex_=selectedIndex;qualityLevels.trigger({selectedIndex:selectedIndex,type:'change'});};var handleHlsLoadedMetadata=function handleHlsLoadedMetadata(qualityLevels,hls){hls.representations().forEach(function(rep){qualityLevels.addQualityLevel(rep);});handleHlsMediaChange(qualityLevels,hls.playlists);};Hls$1.canPlaySource=function(){return videojs$1.log.warn('HLS is no longer a tech. Please remove it from '+'your player\'s techOrder.');};var emeKeySystems=function emeKeySystems(keySystemOptions,mainSegmentLoader,audioSegmentLoader){if(!keySystemOptions){return keySystemOptions;}
2709var videoMimeType=void 0;var audioMimeType=void 0;if(audioSegmentLoader.mimeType_){videoMimeType=mainSegmentLoader.mimeType_;audioMimeType=audioSegmentLoader.mimeType_;}else{var parsedMimeType=parseContentType(mainSegmentLoader.mimeType_);var codecs=parsedMimeType.parameters.codecs.split(',');var audioCodec=void 0;var videoCodec=void 0;codecs.forEach(function(codec){codec=codec.trim();if(isAudioCodec(codec)){audioCodec=codec;}else if(isVideoCodec(codec)){videoCodec=codec;}});videoMimeType=parsedMimeType.type+'; codecs="'+videoCodec+'"';audioMimeType=parsedMimeType.type.replace('video','audio')+'; codecs="'+audioCodec+'"';}
2710var keySystemContentTypes={};var videoPlaylist=mainSegmentLoader.playlist_;for(var keySystem in keySystemOptions){keySystemContentTypes[keySystem]={audioContentType:audioMimeType,videoContentType:videoMimeType};if(videoPlaylist.contentProtection&&videoPlaylist.contentProtection[keySystem]&&videoPlaylist.contentProtection[keySystem].pssh){keySystemContentTypes[keySystem].pssh=videoPlaylist.contentProtection[keySystem].pssh;}
2711if(typeof keySystemOptions[keySystem]==='string'){keySystemContentTypes[keySystem].url=keySystemOptions[keySystem];}}
2712return videojs$1.mergeOptions(keySystemOptions,keySystemContentTypes);};var setupEmeOptions=function setupEmeOptions(hlsHandler){var mainSegmentLoader=hlsHandler.masterPlaylistController_.mainSegmentLoader_;var audioSegmentLoader=hlsHandler.masterPlaylistController_.audioSegmentLoader_;var player=videojs$1.players[hlsHandler.tech_.options_.playerId];if(player.eme){var sourceOptions=emeKeySystems(hlsHandler.source_.keySystems,mainSegmentLoader,audioSegmentLoader);if(sourceOptions){player.currentSource().keySystems=sourceOptions;if(!(videojs$1.browser.IE_VERSION===11)&&player.eme.initializeMediaKeys){player.eme.initializeMediaKeys();}}}};var getVhsLocalStorage=function getVhsLocalStorage(){if(!window.localStorage){return null;}
2713var storedObject=window.localStorage.getItem(LOCAL_STORAGE_KEY$1);if(!storedObject){return null;}
2714try{return JSON.parse(storedObject);}catch(e){return null;}};var updateVhsLocalStorage=function updateVhsLocalStorage(options){if(!window.localStorage){return false;}
2715var objectToStore=getVhsLocalStorage();objectToStore=objectToStore?videojs$1.mergeOptions(objectToStore,options):options;try{window.localStorage.setItem(LOCAL_STORAGE_KEY$1,JSON.stringify(objectToStore));}catch(e){return false;}
2716return objectToStore;};Hls$1.supportsNativeHls=function(){var video=document.createElement('video');if(!videojs$1.getTech('Html5').isSupported()){return false;}
2717var canPlay=['application/vnd.apple.mpegurl','audio/mpegurl','audio/x-mpegurl','application/x-mpegurl','video/x-mpegurl','video/mpegurl','application/mpegurl'];return canPlay.some(function(canItPlay){return /maybe|probably/i.test(video.canPlayType(canItPlay));});}();Hls$1.supportsNativeDash=function(){if(!videojs$1.getTech('Html5').isSupported()){return false;}
2718return /maybe|probably/i.test(document.createElement('video').canPlayType('application/d
vendor: 9,204 bytes, lines 2718-2733
2718ash+xml'));}();Hls$1.supportsTypeNatively=function(type){if(type==='hls'){return Hls$1.supportsNativeHls;}
2719if(type==='dash'){return Hls$1.supportsNativeDash;}
2720return false;};Hls$1.isSupported=function(){return videojs$1.log.warn('HLS is no longer a tech. Please remove it from '+'your player\'s techOrder.');};var Component$1=videojs$1.getComponent('Component');var HlsHandler=function(_Component){inherits$2(HlsHandler,_Component);function HlsHandler(source,tech,options){classCallCheck$1(this,HlsHandler);var _this=possibleConstructorReturn$1(this,(HlsHandler.__proto__||Object.getPrototypeOf(HlsHandler)).call(this,tech,options.hls));if(tech.options_&&tech.options_.playerId){var _player=videojs$1(tech.options_.playerId);if(!_player.hasOwnProperty('hls')){Object.defineProperty(_player,'hls',{get:function get$$1(){videojs$1.log.warn('player.hls is deprecated. Use player.tech().hls instead.');tech.trigger({type:'usage',name:'hls-player-access'});return _this;},configurable:true});}
2721_player.vhs=_this;_player.dash=_this;_this.player_=_player;}
2722_this.tech_=tech;_this.source_=source;_this.stats={};_this.ignoreNextSeekingEvent_=false;_this.setOptions_();if(_this.options_.overrideNative&&tech.overrideNativeAudioTracks&&tech.overrideNativeVideoTracks){tech.overrideNativeAudioTracks(true);tech.overrideNativeVideoTracks(true);}else if(_this.options_.overrideNative&&(tech.featuresNativeVideoTracks||tech.featuresNativeAudioTracks)){throw new Error('Overriding native HLS requires emulated tracks. '+'See https://git.io/vMpjB');}
2723_this.on(document,['fullscreenchange','webkitfullscreenchange','mozfullscreenchange','MSFullscreenChange'],function(event){var fullscreenElement=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;if(fullscreenElement&&fullscreenElement.contains(_this.tech_.el())){_this.masterPlaylistController_.smoothQualityChange_();}});_this.on(_this.tech_,'seeking',function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=false;return;}
2724this.setCurrentTime(this.tech_.currentTime());});_this.on(_this.tech_,'error',function(){if(this.masterPlaylistController_){this.masterPlaylistController_.pauseLoading();}});_this.on(_this.tech_,'play',_this.play);return _this;}
2725createClass$1(HlsHandler,[{key:'setOptions_',value:function setOptions_(){var _this2=this;this.options_.withCredentials=this.options_.withCredentials||false;this.options_.handleManifestRedirects=this.options_.handleManifestRedirects||false;this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions===false?false:true;this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||false;this.options_.smoothQualityChange=this.options_.smoothQualityChange||false;this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage!=='undefined'?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||false;this.options_.customTagParsers=this.options_.customTagParsers||[];this.options_.customTagMappers=this.options_.customTagMappers||[];this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||false;if(typeof this.options_.blacklistDuration!=='number'){this.options_.blacklistDuration=5*60;}
2726if(typeof this.options_.bandwidth!=='number'){if(this.options_.useBandwidthFromLocalStorage){var storedObject=getVhsLocalStorage();if(storedObject&&storedObject.bandwidth){this.options_.bandwidth=storedObject.bandwidth;this.tech_.trigger({type:'usage',name:'hls-bandwidth-from-local-storage'});}
2727if(storedObject&&storedObject.throughput){this.options_.throughput=storedObject.throughput;this.tech_.trigger({type:'usage',name:'hls-throughput-from-local-storage'});}}}
2728if(typeof this.options_.bandwidth!=='number'){this.options_.bandwidth=Config.INITIAL_BANDWIDTH;}
2729this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Config.INITIAL_BANDWIDTH;['withCredentials','useDevicePixelRatio','limitRenditionByPlayerDimensions','bandwidth','smoothQualityChange','customTagParsers','customTagMappers','handleManifestRedirects','cacheEncryptionKeys'].forEach(function(option){if(typeof _this2.source_[option]!=='undefined'){_this2.options_[option]=_this2.source_[option];}});this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions;this.useDevicePixelRatio=this.options_.useDevicePixelRatio;}},{key:'src',value:function src(_src,type){var _this3=this;if(!_src){return;}
2730this.setOptions_();this.options_.url=this.source_.src;this.options_.tech=this.tech_;this.options_.externHls=Hls$1;this.options_.sourceType=simpleTypeFromSourceType(type);this.options_.seekTo=function(time){_this3.tech_.setCurrentTime(time);};this.masterPlaylistController_=new MasterPlaylistController(this.options_);this.playbackWatcher_=new PlaybackWatcher(videojs$1.mergeOptions(this.options_,{seekable:function seekable$$1(){return _this3.seekable();},media:function media(){return _this3.masterPlaylistController_.media();}}));this.masterPlaylistController_.on('error',function(){var player=videojs$1.players[_this3.tech_.options_.playerId];player.error(_this3.masterPlaylistController_.error);});this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):Hls$1.STANDARD_PLAYLIST_SELECTOR.bind(this);this.masterPlaylistController_.selectInitialPlaylist=Hls$1.INITIAL_PLAYLIST_SELECTOR.bind(this);this.playlists=this.masterPlaylistController_.masterPlaylistLoader_;this.mediaSource=this.masterPlaylistController_.mediaSource;Object.defineProperties(this,{selectPlaylist:{get:function get$$1(){return this.masterPlaylistController_.selectPlaylist;},set:function set$$1(selectPlaylist){this.masterPlaylistController_.selectPlaylist=selectPlaylist.bind(this);}},throughput:{get:function get$$1(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate;},set:function set$$1(throughput){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=throughput;this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1;}},bandwidth:{get:function get$$1(){return this.masterPlaylistController_.mainSegmentLoader_.bandwidth;},set:function set$$1(bandwidth){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=bandwidth;this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0};}},systemBandwidth:{get:function get$$1(){var invBandwidth=1/(this.bandwidth||1);var invThroughput=void 0;if(this.throughput>0){invThroughput=1/this.throughput;}else{invThroughput=0;}
2731var systemBitrate=Math.floor(1/(invBandwidth+invThroughput));return systemBitrate;},set:function set$$1(){videojs$1.log.error('The "systemBandwidth" property is read-only');}}});if(this.options_.bandwidth){this.bandwidth=this.options_.bandwidth;}
2732if(this.options_.throughput){this.throughput=this.options_.throughput;}
2733Object.defineProperties(this.stats,{bandwidth:{get:function get$$1(){return _this3.bandwidth||0;},enumerable:true},mediaRequests:{get:function get$$1(){return _this3.masterPlaylistController_.mediaRequests_()||0;},enumerable:true},mediaRequestsAborted:{get:function get$$1(){return _this3.masterPlaylistController_.mediaRequestsAborted_()||0;},enumerable:true},mediaRequestsTimedout:{get:function get$$1(){return _this3.masterPlaylistController_.mediaRequestsTimedout_()||0;},enumerable:true},mediaRequestsErrored:{get:function get$$1(){return _this3.masterPlaylistController_.mediaRequestsErrored_()||0;},enumerable:true},mediaTransferDuration:{get:function get$$1(){return _this3.masterPlaylistController_.mediaTransferDuration_()||0;},enumerable:true},mediaBytesTransferred:{get:function get$$1(){return _this3.masterPlaylistController_.mediaBytesTransferred_()||0;},enumerable:true},mediaSecondsLoaded:{get:function get$$1(){return _this3.masterPlaylistController_.mediaSecondsLoaded_()||0;},enumerable:true},buffered:{get:function get$$1(){return timeRangesToArray(_this3.tech_.buffered());},enumerable:true},currentTime:{get:function get$$1(){return _this3.tech_.currentTime();},enumerable:true},currentSource:{get:function get$$1(){return _this3.tech_.currentSource_;},enumerable:true},currentTech:{get:function get$$1(){return _this3.tech_.name_;},enumerable:true},duration:{get:function get$$1(){return _this3.tech_.duration();},enumerable:true},master:{get:function get$$1(){return _this3.playlists.master;},enumerable:true},playerDimensions:{get:function get$$1(){return _this3.tech_.currentDimensions();},enumerable:true},seekable:{get:function get$$1(){return timeRangesToArray(_this3.tech_.seekable());},enumerable:true},timestamp:{get:function get$$1(){return Date.now();},enumerable:true},videoPlaybackQuality:{get:function get$$1(){return _this3.tech_.getVideoPlaybackQuality();},enumerable:true}});this.tech_.one('canplay',this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_));this.tech_.on('bandwidthupdate',function(){if(_this3.options_.useBandwidthFromLocalStorage){updateVhsLocalStorage({bandwidth:_this3.bandwidth,throughput:Math.round(_this3.throughput)});}});this.masterPlaylistController_.on('selectedinitialmedia',function(){renditionSelectionMixin(_this3);
2733setupEmeOptions(_this3);});this.on(this.masterPlaylistController_,'progress',function(){this.tech_.trigger('progress');});this.on(this.masterPlaylistController_,'firstplay',function(){this.ignoreNextSeekingEvent_=true;});this.setupQualityLevels_();if(!this.tech_.el()){return;}
2734this.tech_.src(videojs$1.URL.createObjectURL(this.masterPlaylistController_.mediaSource));}},{key:'setupQualityLevels_',value:function setupQualityLevels_(){var _this4=this;var player=videojs$1.players[this.tech_.options_.playerId];if(!player||!player.qualityLevels||this.qualityLevels_){return;}
2735this.qualityLevels_=player.qualityLevels();this.masterPlaylistController_.on('selectedinitialmedia',function(){handleHlsLoadedMetadata(_this4.qualityLevels_,_this4);});this.playlists.on('mediachange',function(){handleHlsMediaChange(_this4.qualityLevels_,_this4.playlists);});}},{key:'play',value:function play(){this.masterPlaylistController_.play();}},{key:'setCurrentTime',value:function setCurrentTime(currentTime){this.masterPlaylistController_.setCurrentTime(currentTime);}},{key:'duration',value:function duration$$1(){return this.masterPlaylistController_.duration();}},{key:'seekable',value:function seekable$$1(){return this.masterPlaylistController_.seekable();}},{key:'dispose',value:function dispose(){if(this.playbackWatcher_){this.playbackWatcher_.dispose();}
2736if(this.masterPlaylistController_){this.masterPlaylistController_.dispose();}
2737if(this.qualityLevels_){this.qualityLevels_.dispose();}
2738if(this.player_){delete this.player_.vhs;delete this.player_.dash;delete this.player_.hls;}
2739if(this.tech_&&this.tech_.hls){delete this.tech_.hls;}
2740get$1(HlsHandler.prototype.__proto__||Object.getPrototypeOf(HlsHandler.prototype),'dispose',this).call(this);}},{key:'convertToProgramTime',value:function convertToProgramTime(time,callback){return getProgramTime({playlist:this.masterPlaylistController_.media(),time:time,callback:callback});}},{key:'seekToProgramTime',value:function seekToProgramTime$$1(programTime,callback){var pauseAfterSeek=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;var retryCount=arguments.length>3&&arguments[3]!==undefined?arguments[3]:2;return seekToProgramTime({programTime:programTime,playlist:this.masterPlaylistController_.media(),retryCount:retryCount,pauseAfterSeek:pauseAfterSeek,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:callback});}}]);return HlsHandler;}(Component$1);var HlsSourceHandler={name:'videojs-http-streaming',VERSION:version$1,canHandleSource:function canHandleSource(srcObj){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var localOptions=videojs$1.mergeOptions(videojs$1.options,options);return HlsSourceHandler.canPlayType(srcObj.type,localOptions);},handleSource:function handleSource(source,tech){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var localOptions=videojs$1.mergeOptions(videojs$1.options,options);tech.hls=new HlsHandler(source,tech,localOptions);tech.hls.xhr=xhrFactory();tech.hls.src(source.src,source.type);return tech.hls;},canPlayType:function canPlayType(type){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var _videojs$mergeOptions=videojs$1.mergeOptions(videojs$1.options,options),overrideNative=_videojs$mergeOptions.hls.overrideNative;var supportedType=simpleTypeFromSourceType(type);var canUseMsePlayback=supportedType&&(!Hls$1.supportsTypeNatively(supportedType)||overrideNative);return canUseMsePlayback?'maybe':'';}};if(typeof videojs$1.MediaSource==='undefined'||typeof videojs$1.URL==='undefined'){videojs$1.MediaSource=MediaSource;videojs$1.URL=URL$1;}
2741if(MediaSource.supportsNativeMediaSources()){videojs$1.getTech('Html5').registerSourceHandler(HlsSourceHandler,0);}
2742videojs$1.HlsHandler=HlsHandler;videojs$1.HlsSourceHandler=HlsSourceHandler;videojs$1.Hls=Hls$1;if(!videojs$1.use){videojs$1.registerComponent('Hls',Hls$1);}
2743videojs$1.options.hls=videojs$1.options.hls||{};if(videojs$1.registerPlugin){videojs$1.registerPlugin('reloadSourceOnError',reloadSourceOnError);}else{videojs$1.plugin('reloadSourceOnError',reloadSourceOnError);}
2744return videojs$1;})));
2745function waitFor(variable,callback){var interval=setInterval(function(){if(window[variable]){clearInterval(interval);callback();}},1000);}
2746var setupVideoTrackingDone=false;var setupVideoTracking=function(){if(setupVideoTrackingDone){return;}
2747setupVideoTrackingDone=true;(function(vjs){function getVideoId(vid){var src=vid.src();var els=vid.el().getElementsByTagName('source');if(els.length>0){src=els[0].src;}
2748var hlsParts=vid.currentSrc().match(/([^/_]*)_.*[.]csmil\/master[.]m3u8$/);if(hlsParts&&hlsParts.length>=2){return hlsParts[1];}
2749var parts=src.match(/\?(?:.*&)?v=([^&]*)/);if(parts)return parts[1];parts=src.match(/[^\/]*$/);if(parts)return parts[0];return src;}
2750function onEndedOnce(e){trackEvent('Videos','Video Completed',getVideoId(this));}
2751function onPlayOnce(e){trackEvent('Videos','Play',getVideoId(this));}
2752function onProgressOnce(e){var progress;try{progress=this.currentTime()/this.duration();}catch(e){return;}
2753if(progress>=0.2){this.off('timeupdate',onProgressOnce);this.on('timeupdate',onProgressTwice);trackEvent('Videos','Watched 20%',getVideoId(this));}}
2754function onProgressTwice(e){var progress;try{progress=this.currentTime()/this.duration();}catch(e){return;}
2755if(progress>=0.8){this.off('timeupdate',onProgressTwice);trackEvent('Videos','Watched 80%',getVideoId(this));}}
2756function setTracking(){this.off('ended',onEndedOnce);this.off('play',onPlayOnce);this.off('timeupdate',onProgressOnce);this.off('timeupdate',onProgressTwice);this.one('ended',onEndedOnce);this.one('play',onPlayOnce);this.on('timeupdate',onProgressOnce);}
2757var player=vjs.getComponent('Player'),triggerReady=player.prototype.triggerReady;player.prototype.triggerReady=function(){setTracking.call(this);triggerReady.call(this);};})(window['videojs']);}
2758waitFor('videojs',setupVideoTracking);
2759/*!
2760* smoothState.js is jQuery plugin that progressively enhances
2761* page loads to behave more like a single-page application.
2762*
2763* @author Miguel Ángel Pérez [email protected]
2764* @see http://smoothstate.com
2765*
2766*//*!
2767* smoothState.js is jQuery plugin that progressively enhances
2768* page loads to behave more like a single-page application.
2769*
2770* @author Miguel Ángel Pérez [email protected]
2771* @see http://smoothstate.com
2772*
2773*/(function(factory){'use strict';if(typeof module==='object'&&typeof module.exports==='object'){factory(require('jquery'),window,document);}else{factory(jQuery,window,document);}}(function($,window,document,undefined){'use strict';if(!window.history.pushState){$.fn.smoothState=function(){return this;};
2773$.fn.smoothState.options={};return;}
2774if($.fn.smoothState){return;}
2775var
2776$body=$('html, body'),consl=window.console,defaults={debug:false,anchors:'a',hrefRegex:'',forms:'form',allowFormCaching:false,repeatDelay:500,blacklist:'.no-smoothState',prefetch:false,prefetchOn:'mouseover touchstart',prefetchBlacklist:'.no-prefetch',locationHeader:'X-SmoothState-Location',cacheLength:0,loadingClass:'is-loading',scroll:true,alterRequest:function(request){return request;},alterChangeState:function(state,title,url){return state;},onBefore:function($currentTarget,$container){},onStart:{duration:0,render:function($container){}},onProgress:{duration:0,render:function($container){}},onReady:{duration:0,render:function($container,$newContent){$container.html($newContent);}},onAfter:function($container,$newContent){}},utility={isExternal:function(url){var match=url.match(/^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/);if(typeof match[1]==='string'&&match[1].length>0&&match[1].toLowerCase()!==window.location.protocol){return true;}
2777if(typeof match[2]==='string'&&match[2].length>0&&match[2].replace(new RegExp(':('+{'http:':80,'https:':443}[window.location.protocol]+
2778')?$'),'')!==window.location.host){return true;}
2779return false;},stripHash:function(href){return href.replace(/#.*/,'');},isHash:function(href,prev){prev=prev||window.location.href;var hasHash=(href.indexOf('#')>-1)?true:false,samePath=(utility.stripHash(href)===utility.stripHash(prev))?true:false;return(hasHash&&samePath);},translate:function(request){var defaults={dataType:'html',type:'GET'};if(typeof request==='string'){request=$.extend({},defaults,{url:request});}else{request=$.extend({},defaults,request);}
2780return request;},shouldLoadAnchor:function($anchor,blacklist,hrefRegex){var href=$anchor.prop('href');return(!utility.isExternal(href)&&!utility.isHash(href)&&!$anchor.is(blacklist)&&!$anchor.prop('target'))&&(typeof hrefRegex===undefined||hrefRegex===''||$anchor.prop('href').search(hrefRegex)!==-1);},clearIfOverCapacity:function(cache,cap){if(!Object.keys){Object.keys=function(obj){var keys=[],k;for(k in obj){if(Object.prototype.hasOwnProperty.call(obj,k)){keys.push(k);}}
2781return keys;};}
2782if(Object.keys(cache).length>cap){cache={};}
2783return cache;},storePageIn:function(object,url,doc,id,state,destUrl){var $html=$('<html></html>').append($(doc));if(typeof state==='undefined'){state={};}
2784if(typeof destUrl==='undefined'){destUrl=url;}
2785object[url]={status:'loaded',title:$html.find('title').first().text(),html:$html.find('#'+id),doc:doc,state:state,destUrl:destUrl};return object;},triggerAllAnimationEndEvent:function($element,resetOn){resetOn=' '+resetOn||'';var animationCount=0,animationstart='animationstart webkitAnimationStart oanimationstart MSAnimationStart',animationend='animationend webkitAnimationEnd oanimationend MSAnimationEnd',eventname='allanimationend',onAnimationStart=function(e){if($(e.delegateTarget).is($element)){e.stopPropagation();animationCount++;}},onAnimationEnd=function(e){if($(e.delegateTarget).is($element)){e.stopPropagation();animationCount--;if(animationCount===0){$element.trigger(eventname);}}};$element.on(animationstart,onAnimationStart);$element.on(animationend,onAnimationEnd);$element.on('allanimationend'+resetOn,function(){animationCount=0;utility.redraw($element);});},redraw:function($element){$element.height();}},onPopState=function(e){if(e.state!==null){var url=window.location.href,$page=$('#'+e.state.id),page=$page.data('smoothState'),diffUrl=(page&&page.href!==url&&!utility.isHash(url,page.href)),diffState=(e.state!==page.cache[page.href].state);if(diffUrl||diffState){if(diffState){page.clear(page.href);}
2786page.load(url,false);}}},Smoothstate=function(element,options){var
2787$container=$(element),elementId=$container.prop('id'),targetHash=null,isTransitioning=false,cache={},state={},currentHref=window.location.href,clear=function(url){url=url||false;if(url&&cache.hasOwnProperty(url)){delete cache[url];}else{cache={};}
2788$container.data('smoothState').cache=cache;},fetch=function(request,callback){callback=callback||$.noop;var settings=utility.translate(request);cache=utility.clearIfOverCapacity(cache,options.cacheLength);if(cache.hasOwnProperty(settings.url)&&(typeof settings.data==='undefined'||settings.data.q=="noreload")){return;}
2789cache[settings.url]={status:'fetching'};var ajaxRequest=$.ajax(settings);ajaxRequest.done(function(html){utility.storePageIn(cache,settings.url,html,elementId);$container.data('smoothState').cache=cache;});ajaxRequest.fail(function(){cache[settings.url].status='error';});if(options.locationHeader){ajaxRequest.always(function(htmlOrXhr,status,errorOrXhr){var xhr=(htmlOrXhr.statusCode?htmlOrXhr:errorOrXhr),redirectedLocation=xhr.getResponseHeader(options.locationHeader);if(redirectedLocation){cache[settings.url].destUrl=redirectedLocation;}});}
2790if(callback){ajaxRequest.always(callback);}},repositionWindow=function(){if(targetHash){var $targetHashEl=$(targetHash,$container);if($targetHashEl.length){var newPosition=$targetHashEl.offset().top;$body.scrollTop(newPosition);}
2791targetHash=null;}},updateContent=function(url){var containerId='#'+elementId,$newContent=cache[url]?$(cache[url].html.html()):null;if($newContent.length){document.title=cache[url].title;$container.data('smoothState').href=url;if(options.loadingClass){$body.removeClass(options.loadingClass);}
2792options.onReady.render($container,$newContent);$container.one('ss.onReadyEnd',function(){isTransitioning=false;options.onAfter($container,$newContent);if(options.scroll){repositionWindow();}
2793bindPrefetchHandlers($container);});window.setTimeout(function(){$container.trigger('ss.onReadyEnd');},options.onReady.duration);}else if(!$newContent&&options.debug&&consl){consl.warn('No element with an id of '+containerId+' in response from '+url+' in '+cache);}else{window.location=url;}},load=function(request,push,cacheResponse){var settings=utility.translate(request);if(typeof push==='undefined'){push=true;}
2794if(typeof cacheResponse==='undefined'){cacheResponse=true;}
2795var
2796hasRunCallback=false,callbBackEnded=false,responses={loaded:function(){var eventName=hasRunCallback?'ss.onProgressEnd':'ss.onStartEnd';if(!callbBackEnded||!hasRunCallback){$container.one(eventName,function(){updateContent(settings.url);if(!cacheResponse){clear(settings.url);}});}
2797else if(callbBackEnded){updateContent(settings.url);}
2798if(push){var destUrl=cache[settings.url].destUrl;state=options.alterChangeState({id:elementId},cache[settings.url].title,destUrl);cache[settings.url].state=state;window.history.pushState(state,cache[settings.url].title,destUrl);}
2799if(callbBackEnded&&!cacheResponse){clear(settings.url);}},fetching:function(){if(!hasRunCallback){hasRunCallback=true;$container.one('ss.onStartEnd',function(){if(options.loadingClass){$body.addClass(options.loadingClass);}
2800options.onProgress.render($container);window.setTimeout(function(){$container.trigger('ss.onProgressEnd');callbBackEnded=true;},options.onProgress.duration);});}
2801window.setTimeout(function(){if(cache.hasOwnProperty(settings.url)){responses[cache[settings.url].status]();}},10);},error:function(){if(options.debug&&consl){consl.log('There was an error loading: '+settings.url);}else{window.location=settings.url;}}};if(!cache.hasOwnProperty(settings.url)){fetch(settings);}
2802options.onStart.render($container);window.setTimeout(function(){if(options.scroll){$body.scrollTop(0);}
2803$container.trigger('ss.onStartEnd');},!Utils.isElementInView('.nav-container')?800:options.onStart.duration);responses[cache[settings.url].status]();},hoverAnchor=function(event){var request,$anchor=$(event.currentTarget);if(utility.shouldLoadAnchor($anchor,options.blacklist,options.hrefRegex)&&!isTransitioning){event.stopPropagation();request=utility.translate($anchor.prop('href'));request=options.alterRequest(request);fetch(request);}},clickAnchor=function(event){var $anchor=$(event.currentTarget);if(!event.metaKey&&!event.ctrlKey&&utility.shouldLoadAnchor($anchor,options.blacklist,options.hrefRegex)){event.stopPropagation();event.preventDefault();if(!isRateLimited()){setRateLimitRepeatTime();var request=utility.translate($anchor.prop('href'));isTransitioning=true;targetHash=$anchor.prop('hash');request=options.alterRequest(request);options.onBefore($anchor,$container);load(request);}}else if(!event.metaKey&&!event.ctrlKey&&$anchor.prop('target')!="_blank"){location=$anchor.attr('href');}},submitForm=function(event){var $form=$(event.currentTarget);if(!$form.is(options.blacklist)){event.preventDefault();event.stopPropagation();if(!isRateLimited()){setRateLimitRepeatTime();var request={url:$form.prop('action'),data:$form.serialize(),type:$form.prop('method')};isTransitioning=true;request=options.alterRequest(request);if(request.type.toLowerCase()==='get'){request.url=request.url+'?'+request.data;}
2804options.onBefore($form,$container);load(request,undefined,options.allowFormCaching);}}},rateLimitRepeatTime=0,isRateLimited=function(){var isFirstClick=(options.repeatDelay===null);var isDelayOver=(parseInt(Date.now())>rateLimitRepeatTime);return!(isFirstClick||isDelayOver);},setRateLimitRepeatTime=function(){rateLimitRepeatTime=parseInt(Date.now())+parseInt(options.repeatDelay);},bindPrefetchHandlers=function($element){if(options.anchors&&options.prefetch){$element.find(options.anchors).not(options.prefetchBlacklist).on(options.prefetchOn,null,hoverAnchor);}},bindEventHandlers=function($element){if(options.anchors){$element.on('click',options.anchors,clickAnchor);bindPrefetchHandlers($element);}
2805if(options.forms){$element.on('submit',options.forms,submitForm);}},restartCSSAnimations=function(){var classes=$container.prop('class');$container.removeClass(classes);utility.redraw($container);
2805$container.addClass(classes);};options=$.extend({},$.fn.smoothState.options,options);if(window.history.state===null){state=options.alterChangeState({id:elementId},document.title,currentHref);window.history.replaceState(state,document.title,currentHref);}else{state={};}
2806utility.storePageIn(cache,currentHref,document.documentElement.outerHTML,elementId,state);utility.triggerAllAnimationEndEvent($container,'ss.onStartEnd ss.onProgressEnd ss.onEndEnd');bindEventHandlers($container);return{href:currentHref,cache:cache,clear:clear,load:load,fetch:fetch,restartCSSAnimations:restartCSSAnimations};},declaresmoothState=function(options){return this.each(function(){var tagname=this.tagName.toLowerCase();if(this.id&&tagname!=='body'&&tagname!=='html'&&!$.data(this,'smoothState')){$.data(this,'smoothState',new Smoothstate(this,options));}else if(!this.id&&consl){consl.warn('Every smoothState container needs an id but the following one does not have one:',this);}else if((tagname==='body'||tagname==='html')&&consl){consl.warn('The smoothstate container cannot be the '+this.tagName+' tag');}});};window.onpopstate=onPopState;window.popstate=onPopState;$.smoothStateUtility=utility;$.fn.smoothState=declaresmoothState;$.fn.smoothState.options=defaults;}));
2807/*!lazysizes - v4.0.0-rc2*/!function(a,b){var c=b(a,a.document);"object"==typeof module&&module.exports?module.exports=c:"function"==typeof define&&define.amd?define(c):a.lazySizes=c}(window,function(a,b){"use strict";if(b.getElementsByClassName){var c,d,e=b.documentElement,f=a.Date,g=a.HTMLPictureElement,h="addEventListener",i="getAttribute",j=a[h],k=a.setTimeout,l=a.requestAnimationFrame||k,m=a.requestIdleCallback,n=/^picture$/i,o=["load","error","lazyincluded","_lazyloaded"],p={},q=Array.prototype.forEach,r=function(a,b){return p[b]||(p[b]=new RegExp("(\\s|^)"+b+"(\\s|$)")),p[b].test(a[i]("class")||"")&&p[b]},s=function(a,b){r(a,b)||a.setAttribute("class",(a[i]("class")||"").trim()+" "+b)},t=function(a,b){var c;(c=r(a,b))&&a.setAttribute("class",(a[i]("class")||"").replace(c," "))},u=function(a,b,c){var d=c?h:"removeEventListener";c&&u(a,b),o.forEach(function(c){a[d](c,b)})},v=function(a,d,e,f,g){var h=b.createEvent("CustomEvent");return e||(e={}),e.instance=c,h.initCustomEvent(d,!f,!g,e),a.dispatchEvent(h),h},w=function(b,c){var e;!g&&(e=a.picturefill||d.pf)?e({reevaluate:!0,elements:[b]}):c&&c.src&&(b.src=c.src)},x=function(a,b){return(getComputedStyle(a,null)||{})[b]},y=function(a,b,c){for(c=c||a.offsetWidth;c<d.minSize&&b&&!a._lazysizesWidth;)c=b.offsetWidth,b=b.parentNode;return c},z=function(){var a,c,d=[],e=[],f=d,g=function(){var b=f;for(f=d.length?e:d,a=!0,c=!1;b.length;)b.shift()();a=!1},h=function(d,e){a&&!e?d.apply(this,arguments):(f.push(d),c||(c=!0,(b.hidden?k:l)(g)))};return h._lsFlush=g,h}(),A=function(a,b){return b?function(){z(a)}:function(){var b=this,c=arguments;z(function(){a.apply(b,c)})}},B=function(a){var b,c=0,d=125,e=666,g=e,h=function(){b=!1,c=f.now(),a()},i=m?function(){m(h,{timeout:g}),g!==e&&(g=e)}:A(function(){k(h)},!0);return function(a){var e;(a=a===!0)&&(g=44),b||(b=!0,e=d-(f.now()-c),0>e&&(e=0),a||9>e&&m?i():k(i,e))}},C=function(a){var b,c,d=99,e=function(){b=null,a()},g=function(){var a=f.now()-c;d>a?k(g,d-a):(m||e)(e)};return function(){c=f.now(),b||(b=k(g,d))}},D=function(){var g,l,m,o,p,y,D,F,G,H,I,J,K,L,M=/^img$/i,N=/^iframe$/i,O="onscroll"in a&&!/glebot/.test(navigator.userAgent),P=0,Q=0,R=0,S=-1,T=function(a){R--,a&&a.target&&u(a.target,T),(!a||0>R||!a.target)&&(R=0)},U=function(a,c){var d,f=a,g="hidden"==x(b.body,"visibility")||"hidden"!=x(a,"visibility");for(F-=c,I+=c,G-=c,H+=c;g&&(f=f.offsetParent)&&f!=b.body&&f!=e;)g=(x(f,"opacity")||1)>0,g&&"visible"!=x(f,"overflow")&&(d=f.getBoundingClientRect(),g=H>d.left&&G<d.right&&I>d.top-1&&F<d.bottom+1);return g},V=function(){var a,f,h,j,k,m,n,p,q,r=c.elements;if((o=d.loadMode)&&8>R&&(a=r.length)){f=0,S++,null==K&&("expand"in d||(d.expand=e.clientHeight>500&&e.clientWidth>500?500:370),J=d.expand,K=J*d.expFactor),K>Q&&1>R&&S>2&&o>2&&!b.hidden?(Q=K,S=0):Q=o>1&&S>1&&6>R?J:P;for(;a>f;f++)if(r[f]&&!r[f]._lazyRace)if(O)if((p=r[f][i]("data-expand"))&&(m=1*p)||(m=Q),q!==m&&(y=innerWidth+m*L,D=innerHeight+m,n=-1*m,q=m),h=r[f].getBoundingClientRect(),(I=h.bottom)>=n&&(F=h.top)<=D&&(H=h.right)>
2807=n*L&&(G=h.left)<=y&&(I||H||G||F)&&(d.loadHidden||"hidden"!=x(r[f],"visibility"))&&(l&&3>R&&!p&&(3>o||4>S)||U(r[f],m))){if(ba(r[f]),k=!0,R>9)break}else!k&&l&&!j&&4>R&&4>S&&o>2&&(g[0]||d.preloadAfterLoad)&&(g[0]||!p&&(I||H||G||F||"auto"!=r[f][i](d.sizesAttr)))&&(j=g[0]||r[f]);else ba(r[f]);j&&!k&&ba(j)}},W=B(V),X=function(a){s(a.target,d.loadedClass),t(a.target,d.loadingClass),u(a.target,Z),v(a.target,"lazyloaded")},Y=A(X),Z=function(a){Y({target:a.target})},$=function(a,b){try{a.contentWindow.location.replace(b)}catch(c){a.src=b}},_=function(a){var b,c=a[i](d.srcsetAttr);(b=d.customMedia[a[i]("data-media")||a[i]("media")])&&a.setAttribute("media",b),c&&a.setAttribute("srcset",c)},aa=A(function(a,b,c,e,f){var g,h,j,l,o,p;(o=v(a,"lazybeforeunveil",b)).defaultPrevented||(e&&(c?s(a,d.autosizesClass):a.setAttribute("sizes",e)),h=a[i](d.srcsetAttr),g=a[i](d.srcAttr),f&&(j=a.parentNode,l=j&&n.test(j.nodeName||"")),p=b.firesLoad||"src"in a&&(h||g||l),o={target:a},p&&(u(a,T,!0),clearTimeout(m),m=k(T,2500),s(a,d.loadingClass),u(a,Z,!0)),l&&q.call(j.getElementsByTagName("source"),_),h?a.setAttribute("srcset",h):g&&!l&&(N.test(a.nodeName)?$(a,g):a.src=g),f&&(h||l)&&w(a,{src:g})),a._lazyRace&&delete a._lazyRace,t(a,d.lazyClass),z(function(){(!p||a.complete&&a.naturalWidth>1)&&(p?T(o):R--,X(o))},!0)}),ba=function(a){var b,c=M.test(a.nodeName),e=c&&(a[i](d.sizesAttr)||a[i]("sizes")),f="auto"==e;(!f&&l||!c||!a[i]("src")&&!a.srcset||a.complete||r(a,d.errorClass))&&(b=v(a,"lazyunveilread").detail,f&&E.updateElem(a,!0,a.offsetWidth),a._lazyRace=!0,R++,aa(a,b,f,e,c))},ca=function(){if(!l){if(f.now()-p<999)return void k(ca,999);var a=C(function(){d.loadMode=3,W()});l=!0,d.loadMode=3,W(),j("scroll",function(){3==d.loadMode&&(d.loadMode=2),a()},!0)}};return{_:function(){p=f.now(),c.elements=b.getElementsByClassName(d.lazyClass),g=b.getElementsByClassName(d.lazyClass+" "+d.preloadClass),L=d.hFac,j("scroll",W,!0),j("resize",W,!0),a.MutationObserver?new MutationObserver(W).observe(e,{childList:!0,subtree:!0,attributes:!0}):(e[h]("DOMNodeInserted",W,!0),e[h]("DOMAttrModified",W,!0),setInterval(W,999)),j("hashchange",W,!0),["focus","mouseover","click","load","transitionend","animationend","webkitAnimationEnd"].forEach(function(a){b[h](a,W,!0)}),/d$|^c/.test(b.readyState)?ca():(j("load",ca),b[h]("DOMContentLoaded",W),k(ca,2e4)),c.elements.length?(V(),z._lsFlush()):W()},checkElems:W,unveil:ba}}(),E=function(){var a,c=A(function(a,b,c,d){var e,f,g;if(a._lazysizesWidth=d,d+="px",a.setAttribute("sizes",d),n.test(b.nodeName||""))for(e=b.getElementsByTagName("source"),f=0,g=e.length;g>f;f++)e[f].setAttribute("sizes",d);c.detail.dataAttr||w(a,c.detail)}),e=function(a,b,d){var e,f=a.parentNode;f&&(d=y(a,f,d),e=v(a,"lazybeforesizes",{width:d,dataAttr:!!b}),e.defaultPrevented||(d=e.detail.width,d&&d!==a._lazysizesWidth&&c(a,f,e,d)))},f=function(){var b,c=a.length;if(c)for(b=0;c>b;b++)e(a[b])},g=C(f);return{_:function(){a=b.getElementsByClassName(d.autosizesClass),j("resize",g)},checkElems:g,updateElem:e}}(),F=function(){F.i||(F.i=!0,E._(),D._())};return function(){var b,c={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",errorClass:"lazyerror",autosizesClass:"lazyautosizes",srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:!0};d=a.lazySizesConfig||a.lazysizesConfig||{};for(b in c)b in d||(d[b]=c[b]);a.lazySizesConfig=d,k(function(){d.init&&F()})}(),c={cfg:d,autoSizer:E,loader:D,init:F,uP:w,aC:s,rC:t,hC:r,fire:v,gW:y,rAF:z}}});
2808loadjs=function(){var l=function(){},c={},f={},u={};function s(e,n){if(e){var t=u[e];if(f[e]=n,t)for(;t.length;)t[0](e,n),t.splice(0,1)}}function o(e,n){e.call&&(e={success:e}),n.length?(e.error||l)(n):(e.success||l)(e)}function h(t,r,i,c){var s,o,e=document,n=i.async,f=(i.numRetries||0)+1,u=i.before||l,a=t.replace(/^(css|img)!/,"");c=c||0,/(^css!|\.css$)/.test(t)?(s=!0,(o=e.createElement("link")).rel="stylesheet",o.href=a):/(^img!|\.(png|gif|jpg|svg)$)/.test(t)?(o=e.createElement("img")).src=a:((o=e.createElement("script")).src=t,o.async=void 0===n||n),!(o.onload=o.onerror=o.onbeforeload=function(e){var n=e.type[0];if(s&&"hideFocus"in o)try{o.sheet.cssText.length||(n="e")}catch(e){n="e"}if("e"==n&&(c+=1)<f)return h(t,r,i,c);r(t,n,e.defaultPrevented)})!==u(t,o)&&e.head.appendChild(o)}function t(e,n,t){var r,i;if(n&&n.trim&&(r=n),i=(r?t:n)||{},r){if(r in c)throw"LoadJS";c[r]=!0}!function(e,r,n){var t,i,c=(e=e.push?e:[e]).length,s=c,o=[];for(t=function(e,n,t){if("e"==n&&o.push(e),"b"==n){if(!t)return;o.push(e)}--c||r(o)},i=0;i<s;i++)h(e[i],t,n)}(e,function(e){o(i,e),s(r,e)},i)}return t.ready=function(e,n){return function(e,t){e=e.push?e:[e];var n,r,i,c=[],s=e.length,o=s;
2808for(n=function(e,n){n.length&&c.push(e),--o||t(c)};s--;)r=e[s],(i=f[r])?n(r,i):(u[r]=u[r]||[]).push(n)}(e,function(e){o(n,e)}),t},t.done=function(e){s(e,[])},t.reset=function(){c={},f={},u={}},t.isDefined=function(e){return e in c},t}();
2809(function(m,r){"use strict";var s=function(t){this.elem=t};s.init=function(){var t=r.querySelectorAll("[data-sharer]"),e,a=t.length;for(e=0;e<a;e++){t[e].addEventListener("click",s.add)}};s.add=function(t){var e=t.currentTarget||t.srcElement;var a=new s(e);a.share()};s.prototype={constructor:s,getValue:function(t){var e=this.elem.getAttribute("data-"+t);if(e&&t==="hashtag"){if(!e.startsWith("#")){e="#"+e}}return e===null?"":e},share:function(){var t=this.getValue("sharer").toLowerCase(),e={facebook:{shareUrl:"https://www.facebook.com/sharer/sharer.php",params:{u:this.getValue("url"),hashtag:this.getValue("hashtag"),quote:this.getValue("quote")}},linkedin:{shareUrl:"https://www.linkedin.com/shareArticle",params:{url:this.getValue("url"),mini:true}},twitter:{shareUrl:"https://twitter.com/intent/tweet/",params:{text:this.getValue("title"),url:this.getValue("url"),hashtags:this.getValue("hashtags"),via:this.getValue("via")}},email:{shareUrl:"mailto:"+this.getValue("to"),params:{subject:this.getValue("subject"),body:this.getValue("title")+"\n"+this.getValue("url")}},whatsapp:{shareUrl:this.getValue("web")==="true"?"https://web.whatsapp.com/send":"https://wa.me/",params:{phone:this.getValue("to"),text:this.getValue("title")+" "+this.getValue("url")}},telegram:{shareUrl:"https://t.me/share",params:{text:this.getValue("title"),url:this.getValue("url")}},viber:{shareUrl:"viber://forward",params:{text:this.getValue("title")+" "+this.getValue("url")}},line:{shareUrl:"http://line.me/R/msg/text/?"+encodeURIComponent(this.getValue("title")+" "+this.getValue("url"))},pinterest:{shareUrl:"https://www.pinterest.com/pin/create/button/",params:{url:this.getValue("url"),media:this.getValue("image"),description:this.getValue("description")}}
vendor: 4,065 bytes, line 2809
2809,tumblr:{shareUrl:"http://tumblr.com/widgets/share/tool",params:{canonicalUrl:this.getValue("url"),content:this.getValue("url"),posttype:"link",title:this.getValue("title"),caption:this.getValue("caption"),tags:this.getValue("tags")}},hackernews:{shareUrl:"https://news.ycombinator.com/submitlink",params:{u:this.getValue("url"),t:this.getValue("title")}},reddit:{shareUrl:"https://www.reddit.com/submit",params:{url:this.getValue("url"),title:this.getValue("title")}},vk:{shareUrl:"http://vk.com/share.php",params:{url:this.getValue("url"),title:this.getValue("title"),description:this.getValue("caption"),image:this.getValue("image")}},xing:{shareUrl:"https://www.xing.com/social/share/spi",params:{url:this.getValue("url")}},buffer:{shareUrl:"https://buffer.com/add",params:{url:this.getValue("url"),title:this.getValue("title"),via:this.getValue("via"),picture:this.getValue("picture")}},instapaper:{shareUrl:"http://www.instapaper.com/edit",params:{url:this.getValue("url"),title:this.getValue("title"),description:this.getValue("description")}},pocket:{shareUrl:"https://getpocket.com/save",params:{url:this.getValue("url")}},mashable:{shareUrl:"https://mashable.com/submit",params:{url:this.getValue("url"),title:this.getValue("title")}},mix:{shareUrl:"https://mix.com/add",params:{url:this.getValue("url")}},flipboard:{shareUrl:"https://share.flipboard.com/bookmarklet/popout",params:{v:2,title:this.getValue("title"),url:this.getValue("url"),t:Date.now()}},weibo:{shareUrl:"http://service.weibo.com/share/share.php",params:{url:this.getValue("url"),title:this.getValue("title"),pic:this.getValue("image"),appkey:this.getValue("appkey"),ralateUid:this.getValue("ralateuid"),language:"zh_cn"}},blogger:{shareUrl:"https://www.blogger.com/blog-this.g",params:{u:this.getValue("url"),n:this.getValue("title"),t:this.getValue("description")}},baidu:{shareUrl:"http://cang.baidu.com/do/add",params:{it:this.getValue("title"),iu:this.getValue("url")}},douban:{shareUrl:"https://www.douban.com/share/service",params:{name:this.getValue("name"),href:this.getValue("url"),image:this.getValue("image"),comment:this.getValue("description")}},okru:{shareUrl:"https://connect.ok.ru/dk",params:{"st.cmd":"WidgetSharePreview","st.shareUrl":this.getValue("url"),title:this.getValue("title")}},mailru:{shareUrl:"http://connect.mail.ru/share",params:{share_url:this.getValue("url"),linkname:this.getValue("title"),linknote:this.getValue("description"),type:"page"}},evernote:{shareUrl:"https://www.evernote.com/clip.action",params:{url:this.getValue("url"),title:this.getValue("title")}},skype:{shareUrl:"https://web.skype.com/share",params:{url:this.getValue("url"),title:this.getValue("title")}},delicious:{shareUrl:"https://del.icio.us/post",params:{url:this.getValue("url"),title:this.getValue("title")}},sms:{shareUrl:"sms://",params:{body:this.getValue("body")}},trello:{shareUrl:"https://trello.com/add-card",params:{url:this.getValue("url"),name:this.getValue("title"),desc:this.getValue("description"),mode:"popup"}},messenger:{shareUrl:"fb-messenger://share",params:{link:this.getValue("url")}},odnoklassniki:{shareUrl:"https://connect.ok.ru/dk",params:{st:{cmd:"WidgetSharePreview",deprecated:1,shareUrl:this.getValue("url")}}},meneame:{shareUrl:"https://www.meneame.net/submit",params:{url:this.getValue("url")}},diaspora:{shareUrl:"https://share.diasporafoundation.org",params:{title:this.getValue("title"),url:this.getValue("url")}},googlebookmarks:{shareUrl:"https://www.google.com/bookmarks/mark",params:{op:"edit",bkmk:this.getValue("url"),title:this.getValue("title")}},qzone:{shareUrl:"https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey",params:{url:this.getValue("url")}},refind:{shareUrl:"https://refind.com",params:{url:this.getValue("url")}},surfingbird:{shareUrl:"https://surfingbird.ru/share",params:{url:this.getValue("url"),title:this.getValue("title"),description:this.getValue("description")}},yahoomail:{shareUrl:"http://compose.mail.yahoo.com",params:{to:this.getValue("to"),subject:this.getValue("subject"),body:this.getValue("body")}}
2809,wordpress:{shareUrl:"https://wordpress.com/wp-admin/press-this.php",params:{u:this.getValue("url"),t:this.getValue("title"),s:this.getValue("title")}},amazon:{shareUrl:"https://www.amazon.com/gp/wishlist/static-add",params:{u:this.getValue("url"),t:this.getValue("title")}},pinboard:{shareUrl:"https://pinboard.in/add",params:{url:this.getValue("url"),title:this.getValue("title"),description:this.getValue("description")}},threema:{shareUrl:"threema://compose",params:{text:this.getValue("text"),id:this.getValue("id")}},kakaostory:{shareUrl:"https://story.kakao.com/share",params:{url:this.getValue("url")}},yummly:{shareUrl:"http://www.yummly.com/urb/verify",params:{url:this.getValue("url"),title:this.getValue("title"),yumtype:"button"}}},a=e[t];if(a){a.width=this.getValue("width");a.height=this.getValue("height")}return a!==undefined?this.urlSharer(a):false},urlSharer:function(t){var e=t.params||{},a=Object.keys(e),r,s=a.length>0?"?":"";for(r=0;r<a.length;r++){if(s!=="?"){s+="&"}if(e[a[r]]){s+=a[r]+"="+encodeURIComponent(e[a[r]])}}t.shareUrl+=s;var l=this.getValue("link")==="true";var i=this.getValue("blank")==="true";if(l){if(i){m.open(t.shareUrl,"_blank")}else{m.location.href=t.shareUrl}}else{console.log(t.shareUrl);var h=t.width||600,u=t.height||480,o=m.innerWidth/2-h/2+m.screenX,p=m.innerHeight/2-u/2+m.screenY,g="scrollbars=no, width="+h+", height="+u+", top="+p+", left="+o,n=m.open(t.shareUrl,"",g);if(n&&m.focus){n.focus()}}}};if(r.readyState==="complete"||r.readyState!=="loading"){s.init()}else{r.addEventListener("DOMContentLoaded",s.init)}m.Sharer=s})(window,document);
2810(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof module==='object'&&module.exports){module.exports=factory(require('jquery'));}else{factory(jQuery);}}(function($){var slice=Array.prototype.slice;var splice=Array.prototype.splice;var defaults={topSpacing:0,bottomSpacing:0,className:'is-sticky',wrapperClassName:'sticky-wrapper',center:false,getWidthFrom:'',widthFromWrapper:true,responsiveWidth:false,zIndex:'inherit'},$window=$(window),$document=$(document),sticked=[],windowHeight=$window.height(),scroller=function(){var scrollTop=$window.scrollTop(),documentHeight=$document.height(),dwh=documentHeight-windowHeight,extra=(scrollTop>dwh)?dwh-scrollTop:0;for(var i=0,l=sticked.length;i<l;i++){var s=sticked[i],elementTop=s.stickyWrapper.offset().top,etse=elementTop-s.topSpacing-extra;s.stickyWrapper.css('height',s.stickyElement.outerHeight());if(scrollTop<=etse){if(s.currentTop!==null){s.stickyElement.css({'width':'','position':'','top':'','z-index':''});s.stickyElement.parent().removeClass(s.className);s.stickyElement.trigger('sticky-end',[s]);s.currentTop=null;}}
2811else{var newTop=documentHeight-s.stickyElement.outerHeight()
2812-s.topSpacing-s.bottomSpacing-scrollTop-extra;if(newTop<0){newTop=newTop+s.topSpacing;}else{newTop=s.topSpacing;}
2813if(s.currentTop!==newTop){var newWidth;if(s.getWidthFrom){padding=s.stickyElement.innerWidth()-s.stickyElement.width();newWidth=$(s.getWidthFrom).width()-padding||null;}else if(s.widthFromWrapper){newWidth=s.stickyWrapper.width();}
2814if(newWidth==null){newWidth=s.stickyElement.width();}
2815s.stickyElement.css('width',newWidth).css('position','fixed').css('top',newTop).css('z-index',s.zIndex);s.stickyElement.parent().addClass(s.className);if(s.currentTop===null){s.stickyElement.trigger('sticky-start',[s]);}else{s.stickyElement.trigger('sticky-update',[s]);}
2816if(s.currentTop===s.topSpacing&&s.currentTop>newTop||s.currentTop===null&&newTop<s.topSpacing){s.stickyElement.trigger('sticky-bottom-reached',[s]);}else if(s.currentTop!==null&&newTop===s.topSpacing&&s.currentTop<newTop){s.stickyElement.trigger('sticky-bottom-unreached',[s]);}
2817s.currentTop=newTop;}
2818var stickyWrapperContainer=s.stickyWrapper.parent();var unstick=(s.stickyElement.offset().top+s.stickyElement.outerHeight()>=stickyWrapperContainer.offset().top+stickyWrapperContainer.outerHeight())&&(s.stickyElement.offset().top<=s.topSpacing);if(unstick){s.stickyElement.css('position','absolute').css('top','').css('bottom',0).css('z-index','');}else{s.stickyElement.css('position','fixed').css('top',newTop).css('bottom','').css('z-index',s.zIndex);}}}},resizer=function(){windowHeight=$window.height();for(var i=0,l=sticked.length;i<l;i++){var s=sticked[i];var newWidth=null;if(s.getWidthFrom){if(s.responsiveWidth){newWidth=$(s.getWidthFrom).width();}}else if(s.widthFromWrapper){newWidth=s.stickyWrapper.width();}
2819if(newWidth!=null){s.stickyElement.css('width',newWidth);}}},methods={init:function(options){return this.each(function(){var o=$.extend({},defaults,options);var stickyElement=$(this);var stickyId=stickyElement.attr('id');var wrapperId=stickyId?stickyId+'-'+defaults.wrapperClassName:defaults.wrapperClassName;var wrapper=$('<div></div>').attr('id',wrapperId).addClass(o.wrapperClassName);stickyElement.wrapAll(function(){if($(this).parent("#"+wrapperId).length==0){return wrapper;}});var stickyWrapper=stickyElement.parent();if(o.center){stickyWrapper.css({width:stickyElement.outerWidth(),marginLeft:"auto",marginRight:"auto"});}
2820if(stickyElement.css("float")==="right"){stickyElement.css({"float":"none"}).parent().css({"float":"right"});}
2821o.stickyElement=stickyElement;o.stickyWrapper=stickyWrapper;o.currentTop=null;sticked.push(o);methods.setWrapperHeight(this);methods.setupChangeListeners(this);});},setWrapperHeight:function(stickyElement){var element=$(stickyElement);var stickyWrapper=element.parent();if(stickyWrapper){stickyWrapper.css('height',element.outerHeight());}},setupChangeListeners:function(stickyElement){if(window.MutationObserver){var mutationObserver=new window.MutationObserver(function(mutations){if(mutations[0].addedNodes.length||mutations[0].removedNodes.length){methods.setWrapperHeight(stickyElement);}});mutationObserver.observe(stickyElement,{subtree:true,childList:true});}else{if(window.addEventListener){stickyElement.addEventListener('DOMNodeInserted',function(){methods.setWrapperHeight(stickyElement);},false);stickyElement.addEventListener('DOMNodeRemoved',function(){methods.setWrapperHeight(stickyElement);},false);}else if(window.attachEvent){stickyElement.attachEvent('onDOMNodeInserted',function(){methods.setWrapperHeight(stickyElement);});stickyElement.attachEvent('onDOMNodeRemoved',function(){methods.setWrapperHeight(stickyElement);});}}},update:scroller,unstick:function(options){return this.each(function(){var that=this;var unstickyElement=$(that);var removeIdx=-1;var i=sticked.length;while(i-->0){if(sticked[i].stickyElement.get(0)===that){splice.call(sticked,i,1);removeIdx=i;}}
2822if(removeIdx!==-1){unstickyElement.unwrap();unstickyElement.css({'width':'','position':'','top':'','float':'','z-index':''});}});}};if(window.addEventListener){window.addEventListener('scroll',scroller,false);window.addEventListener('resize',resizer,false);}else if(window.attachEvent){window.attachEvent('onscroll',scroller);window.attachEvent('onresize',resizer);}
2823$.fn.sticky=function(method){if(methods[method]){return methods[method].apply(this,slice.call(arguments,1
vendor: 4,766 bytes, lines 2823-2836
2823));}else if(typeof method==='object'||!method){return methods.init.apply(this,arguments);}else{$.error('Method '+method+' does not exist on jQuery.sticky');}};$.fn.unstick=function(method){if(methods[method]){return methods[method].apply(this,slice.call(arguments,1));}else if(typeof method==='object'||!method){return methods.unstick.apply(this,arguments);}else{$.error('Method '+method+' does not exist on jQuery.sticky');}};$(function(){setTimeout(scroller,0);});}));
2824/*!
2825* VERSION: 1.19.1
2826* DATE: 2017-01-17
2827* UPDATES AND DOCS AT: http://greensock.com
2828*
2829* Includes all of the following: TweenLite, TweenMax, TimelineLite, TimelineMax, EasePack, CSSPlugin, RoundPropsPlugin, BezierPlugin, AttrPlugin, DirectionalRotationPlugin
2830*
2831* @license Copyright (c) 2008-2017, GreenSock. All rights reserved.
2832* This work is subject to the terms at http://greensock.com/standard-license or for
2833* Club GreenSock members, the software agreement that was issued with your membership.
2834*
2835* @author: Jack Doyle, [email protected]
2836**/var _gsScope="undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window;(_gsScope._gsQueue||(_gsScope._gsQueue=[])).push(function(){"use strict";_gsScope._gsDefine("TweenMax",["core.Animation","core.SimpleTimeline","TweenLite"],function(a,b,c){var d=function(a){var b,c=[],d=a.length;for(b=0;b!==d;c.push(a[b++]));return c},e=function(a,b,c){var d,e,f=a.cycle;for(d in f)e=f[d],a[d]="function"==typeof e?e(c,b[c]):e[c%e.length];delete a.cycle},f=function(a,b,d){c.call(this,a,b,d),this._cycle=0,this._yoyo=this.vars.yoyo===!0,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._dirty=!0,this.render=f.prototype.render},g=1e-10,h=c._internals,i=h.isSelector,j=h.isArray,k=f.prototype=c.to({},.1,{}),l=[];f.version="1.19.1",k.constructor=f,k.kill()._gc=!1,f.killTweensOf=f.killDelayedCallsTo=c.killTweensOf,f.getTweensOf=c.getTweensOf,f.lagSmoothing=c.lagSmoothing,f.ticker=c.ticker,f.render=c.render,k.invalidate=function(){return this._yoyo=this.vars.yoyo===!0,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._uncache(!0),c.prototype.invalidate.call(this)},k.updateTo=function(a,b){var d,e=this.ratio,f=this.vars.immediateRender||a.immediateRender;b&&this._startTime<this._timeline._time&&(this._startTime=this._timeline._time,this._uncache(!1),this._gc?this._enabled(!0,!1):this._timeline.insert(this,this._startTime-this._delay));for(d in a)this.vars[d]=a[d];if(this._initted||f)if(b)this._initted=!1,f&&this.render(0,!0,!0);else if(this._gc&&this._enabled(!0,!1),this._notifyPluginsOfEnabled&&this._firstPT&&c._onPluginEvent("_onDisable",this),this._time/this._duration>.998){var g=this._totalTime;this.render(0,!0,!1),this._initted=!1,this.render(g,!0,!1)}else if(this._initted=!1,this._init(),this._time>0||f)for(var h,i=1/(1-e),j=this._firstPT;j;)h=j.s+j.c,j.c*=i,j.s=h-j.c,j=j._next;return this},k.render=function(a,b,c){this._initted||0===this._duration&&this.vars.repeat&&this.invalidate();var d,e,f,i,j,k,l,m,n=this._dirty?this.totalDuration():this._totalDuration,o=this._time,p=this._totalTime,q=this._cycle,r=this._duration,s=this._rawPrevTime;if(a>=n-1e-7&&a>=0?(this._totalTime=n,this._cycle=this._repeat,this._yoyo&&0!==(1&this._cycle)?(this._time=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0):(this._time=r,this.ratio=this._ease._calcEnd?this._ease.getRatio(1):1),this._reversed||(d=!0,e="onComplete",c=c||this._timeline.autoRemoveChildren),0===r&&(this._initted||!this.vars.lazy||c)&&(this._startTime===this._timeline._duration&&(a=0),(0>s||0>=a&&a>=-1e-7||s===g&&"isPause"!==this.data)&&s!==a&&(c=!0,s>g&&(e="onReverseComplete")),this._rawPrevTime=m=!b||a||s===a?a:g)):1e-7>a?(this._totalTime=this._time=this._cycle=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0,(0!==p||0===r&&s>0)&&(e="onReverseComplete",d=this._reversed),0>a&&(this._active=!1,0===r&&(this._initted||!this.vars.lazy||c)&&(s>=0&&(c=!0),this._rawPrevTime=m=!b||a||s===a?a:g)),this._initted||(c=!0)):(this._totalTime=this._time=a,0!==this._repeat&&(i=r+this._repeatDelay,this._cycle=this._totalTime/i>>0,0!==this._cycle&&this._cycle===this._totalTime/i&&a>=p&&this._cycle--,this._time=this._totalTime-this._cycle*i,this._yoyo&&0!==(1&this._cycle)&&(this._time=r-this._time),this._time>r?this._time=r:this._time<0&&(this._time=0)),this._easeType?(j=this._time/r,k=this._easeType,l=this._easePower,(1===k||3===k&&j>=.5)&&(j=1-j),3===k&&(j*=2),1===l?j*=j:2===l?j*=j*j:3===l?j*=j*j*j:4===l&&(j*=j*j*j*j),1===k?this.ratio=1-j:2===k?this.ratio=j:this._time/r<.5?this.ratio=j/2:this.ratio=1-j/2):this.ratio=this._ease.getRatio(this._time/r)),o===this._time&&!c&&q===this._cycle)return void(p!==this._totalTime&&this._onUpdate&&(b||this._callback("onUp
2836date")));if(!this._initted){if(this._init(),!this._initted||this._gc)return;if(!c&&this._firstPT&&(this.vars.lazy!==!1&&this._duration||this.vars.lazy&&!this._duration))return this._time=o,this._totalTime=p,this._rawPrevTime=s,this._cycle=q,h.lazyTweens.push(this),void(this._lazy=[a,b]);this._time&&!d?this.ratio=this._ease.getRatio(this._time/r):d&&this._ease._calcEnd&&(this.ratio=this._ease.getRatio(0===this._time?0:1))}for(this._lazy!==!1&&(this._lazy=!1),this._active||!this._paused&&this._time!==o&&a>=0&&(this._active=!0),0===p&&(2===this._initted&&a>0&&this._init(),this._startAt&&(a>=0?this._startAt.render(a,b,c):e||(e="_dummyGS")),this.vars.onStart&&(0!==this._totalTime||0===r)&&(b||this._callback("onStart"))),f=this._firstPT;f;)f.f?f.t[f.p](f.c*this.ratio+f.s):f.t[f.p]=f.c*this.ratio+f.s,f=f._next;this._onUpdate&&(0>a&&this._startAt&&this._startTime&&this._startAt.render(a,b,c),b||(this._totalTime!==p||e)&&this._callback("onUpdate")),this._cycle!==q&&(b||this._gc||this.vars.onRepeat&&this._callback("onRepeat")),e&&(!this._gc||c)&&(0>a&&this._startAt&&!this._onUpdate&&this._startTime&&this._startAt.render(a,b,c),d&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!b&&this.vars[e]&&this._callback(e),0===r&&this._rawPrevTime===g&&m!==g&&(this._rawPrevTime=0))},f.to=function(a,b,c){return new f(a,b,c)},f.from=function(a,b,c){return c.runBackwards=!0,c.immediateRender=0!=c.immediateRender,new f(a,b,c)},f.fromTo=function(a,b,c,d){return d.startAt=c,d.immediateRender=0!=d.immediateRender&&0!=c.immediateRender,new f(a,b,d)},f.staggerTo=f.allTo=function(a,b,g,h,k,m,n){h=h||0;var o,p,q,r,s=0,t=[],u=function(){g.onComplete&&g.onComplete.apply(g.onCompleteScope||this,arguments),k.apply(n||g.callbackScope||this,m||l)},v=g.cycle,w=g.startAt&&g.startAt.cycle;for(j(a)||("string"==typeof a&&(a=c.selector(a)||a),i(a)&&(a=d(a))),a=a||[],0>h&&(a=d(a),a.reverse(),h*=-1),o=a.length-1,q=0;o>=q;q++){p={};for(r in g)p[r]=g[r];if(v&&(e(p,a,q),null!=p.duration&&(b=p.duration,delete p.duration)),w){w=p.startAt={};for(r in g.startAt)w[r]=g.startAt[r];e(p.startAt,a,q)}p.delay=s+(p.delay||0),q===o&&k&&(p.onComplete=u),t[q]=new f(a[q],b,p),s+=h}return t},f.staggerFrom=f.allFrom=function(a,b,c,d,e,g,h){return c.runBackwards=!0,c.immediateRender=0!=c.immediateRender,f.staggerTo(a,b,c,d,e,g,h)},f.staggerFromTo=f.allFromTo=function(a,b,c,d,e,g,h,i){return d.startAt=c,d.immediateRender=0!=d.immediateRender&&0!=c.immediateRender,f.staggerTo(a,b,d,e,g,h,i)},f.delayedCall=function(a,b,c,d,e){return new f(b,0,{delay:a,onComplete:b,onCompleteParams:c,callbackScope:d,onReverseComplete:b,onReverseCompleteParams:c,immediateRender:!1,useFrames:e,overwrite:0})},f.set=function(a,b){return new f(a,0,b)},f.isTweening=function(a){return c.getTweensOf(a,!0).length>0};var m=function(a,b){for(var d=[],e=0,f=a._first;f;)f instanceof c?d[e++]=f:(b&&(d[e++]=f),d=d.concat(m(f,b)),e=d.length),f=f._next;return d},n=f.getAllTweens=function(b){return m(a._rootTimeline,b).concat(m(a._rootFramesTimeline,b))};f.killAll=function(a,c,d,e){null==c&&(c=!0),null==d&&(d=!0);var f,g,h,i=n(0!=e),j=i.length,k=c&&d&&e;for(h=0;j>h;h++)g=i[h],(k||g instanceof b||(f=g.target===g.vars.onComplete)&&d||c&&!f)&&(a?g.totalTime(g._reversed?0:g.totalDuration()):g._enabled(!1,!1))},f.killChildTweensOf=function(a,b){if(null!=a){var e,g,k,l,m,n=h.tweenLookup;if("string"==typeof a&&(a=c.selector(a)||a),i(a)&&(a=d(a)),j(a))for(l=a.length;--l>-1;)f.killChildTweensOf(a[l],b);else{e=[];for(k in n)for(g=n[k].target.parentNode;g;)g===a&&(e=e.concat(n[k].tweens)),g=g.parentNode;for(m=e.length,l=0;m>l;l++)b&&e[l].totalTime(e[l].totalDuration()),e[l]._enabled(!1,!1)}}};var o=function(a,c,d,e){c=c!==!1,d=d!==!1,e=e!==!1;for(var f,g,h=n(e),i=c&&d&&e,j=h.length;--j>-1;)g=h[j],(i||g instanceof b||(f=g.target===g.vars.onComplete)&&d||c&&!f)&&g.paused(a)};return f.pauseAll=function(a,b,c){o(!0,a,b,c)},f.resumeAll=function(a,b,c){o(!1,a,b,c)},f.globalTimeScale=function(b){var d=a._rootTimeline,e=c.ticker.time;return arguments.length?(b=b||g,d._startTime=e-(e-d._startTime)*d._timeScale/b,d=a._rootFramesTimeline,e=c.ticker.frame,d._startTime=e-(e-d._startTime)*d._timeScale/b,d._timeScale=a._rootTimeline._timeScale=b,b):d._timeScale},k.progress=function(a,b){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&0!==(1&this._cycle)?1-a:a)+this._cycle*(this._duration+this._repeatDelay),b):this._time/this.duration()},k.totalProgress=function(a,b){return arguments.length?this.totalTime(this.totalDuration()*a,b):this._totalTime/this.totalDuration()},k.time=function(a,b){return arguments.length?(this._dirty&&this.totalDuration(),a>this._duration&&(a=this._duration),this._yoyo&&0!==(1&this._cycle)?a=this._duration-a+this._cycle*(this._duration+this._repeatDelay):0!==this._repeat&&(a+=this._cycle*(this._duration+this._repeatDelay)),this.totalTime(a,b)):this._time},k.duration=function(b){return arguments.length?a.prototype.duration.call(this,b):this._duration},k.totalDuration=function(a){return arguments.length?-1===this._repeat?this:this.duration((a-this._repeat*this._repeatDelay)/(this._repeat+1)):(this._dirty&&(this._totalDuration=-1===this._repeat?999999999999:this._duration*(this._repeat+1)+this._repeatDelay*this._repeat,this._dirty=!1),this._totalDuration)},k.repeat=function(a){return arguments.length?(this._repeat=a,this._uncache(!0)):this._repeat},k.repeatDelay=function(a){return arguments.length?(this._repeatDelay=a,this._uncache(!0)):this._repeatDelay},k.yoyo=function(a){return arguments.length?(this._yoyo=a,this):this._yoyo},f},!0),_gsScope._gsDefine("TimelineLite",["core.Animation","core.SimpleTimeline","TweenLite"],function(a,b,c){var d=function(a){b.call(this,a),this._labels={},this.autoRemoveChildren=this.vars.autoRemoveChildren===!0,this.smoothChildTiming=this.vars.smoothChildTiming===!0,this._sortChildren=!0,this._onUpdate=this.vars.onUp
vendor: 8,053 bytes, line 2836
2836date;var c,d,e=this.vars;for(d in e)c=e[d],i(c)&&-1!==c.join("").indexOf("{self}")&&(e[d]=this._swapSelfInParams(c));i(e.tweens)&&this.add(e.tweens,0,e.align,e.stagger)},e=1e-10,f=c._internals,g=d._internals={},h=f.isSelector,i=f.isArray,j=f.lazyTweens,k=f.lazyRender,l=_gsScope._gsDefine.globals,m=function(a){var b,c={};for(b in a)c[b]=a[b];return c},n=function(a,b,c){var d,e,f=a.cycle;for(d in f)e=f[d],a[d]="function"==typeof e?e(c,b[c]):e[c%e.length];delete a.cycle},o=g.pauseCallback=function(){},p=function(a){var b,c=[],d=a.length;for(b=0;b!==d;c.push(a[b++]));return c},q=d.prototype=new b;return d.version="1.19.1",q.constructor=d,q.kill()._gc=q._forcingPlayhead=q._hasPause=!1,q.to=function(a,b,d,e){var f=d.repeat&&l.TweenMax||c;return b?this.add(new f(a,b,d),e):this.set(a,d,e)},q.from=function(a,b,d,e){return this.add((d.repeat&&l.TweenMax||c).from(a,b,d),e)},q.fromTo=function(a,b,d,e,f){var g=e.repeat&&l.TweenMax||c;return b?this.add(g.fromTo(a,b,d,e),f):this.set(a,e,f)},q.staggerTo=function(a,b,e,f,g,i,j,k){var l,o,q=new d({onComplete:i,onCompleteParams:j,callbackScope:k,smoothChildTiming:this.smoothChildTiming}),r=e.cycle;for("string"==typeof a&&(a=c.selector(a)||a),a=a||[],h(a)&&(a=p(a)),f=f||0,0>f&&(a=p(a),a.reverse(),f*=-1),o=0;o<a.length;o++)l=m(e),l.startAt&&(l.startAt=m(l.startAt),l.startAt.cycle&&n(l.startAt,a,o)),r&&(n(l,a,o),null!=l.duration&&(b=l.duration,delete l.duration)),q.to(a[o],b,l,o*f);return this.add(q,g)},q.staggerFrom=function(a,b,c,d,e,f,g,h){return c.immediateRender=0!=c.immediateRender,c.runBackwards=!0,this.staggerTo(a,b,c,d,e,f,g,h)},q.staggerFromTo=function(a,b,c,d,e,f,g,h,i){return d.startAt=c,d.immediateRender=0!=d.immediateRender&&0!=c.immediateRender,this.staggerTo(a,b,d,e,f,g,h,i)},q.call=function(a,b,d,e){return this.add(c.delayedCall(0,a,b,d),e)},q.set=function(a,b,d){return d=this._parseTimeOrLabel(d,0,!0),null==b.immediateRender&&(b.immediateRender=d===this._time&&!this._paused),this.add(new c(a,0,b),d)},d.exportRoot=function(a,b){a=a||{},null==a.smoothChildTiming&&(a.smoothChildTiming=!0);var e,f,g=new d(a),h=g._timeline;for(null==b&&(b=!0),h._remove(g,!0),g._startTime=0,g._rawPrevTime=g._time=g._totalTime=h._time,e=h._first;e;)f=e._next,b&&e instanceof c&&e.target===e.vars.onComplete||g.add(e,e._startTime-e._delay),e=f;return h.add(g,0),g},q.add=function(e,f,g,h){var j,k,l,m,n,o;if("number"!=typeof f&&(f=this._parseTimeOrLabel(f,0,!0,e)),!(e instanceof a)){if(e instanceof Array||e&&e.push&&i(e)){for(g=g||"normal",h=h||0,j=f,k=e.length,l=0;k>l;l++)i(m=e[l])&&(m=new d({tweens:m})),this.add(m,j),"string"!=typeof m&&"function"!=typeof m&&("sequence"===g?j=m._startTime+m.totalDuration()/m._timeScale:"start"===g&&(m._startTime-=m.delay())),j+=h;return this._uncache(!0)}if("string"==typeof e)return this.addLabel(e,f);if("function"!=typeof e)throw"Cannot add "+e+" into the timeline; it is not a tween, timeline, function, or string.";e=c.delayedCall(0,e)}if(b.prototype.add.call(this,e,f),(this._gc||this._time===this._duration)&&!this._paused&&this._duration<this.duration())for(n=this,o=n.rawTime()>e._startTime;n._timeline;)o&&n._timeline.smoothChildTiming?n.totalTime(n._totalTime,!0):n._gc&&n._enabled(!0,!1),n=n._timeline;return this},q.remove=function(b){if(b instanceof a){this._remove(b,!1);var c=b._timeline=b.vars.useFrames?a._rootFramesTimeline:a._rootTimeline;return b._startTime=(b._paused?b._pauseTime:c._time)-(b._reversed?b.totalDuration()-b._totalTime:b._totalTime)/b._timeScale,this}if(b instanceof Array||b&&b.push&&i(b)){for(var d=b.length;--d>-1;)this.remove(b[d]);return this}return"string"==typeof b?this.removeLabel(b):this.kill(null,b)},q._remove=function(a,c){b.prototype._remove.call(this,a,c);var d=this._last;return d?this._time>this.duration()&&(this._time=this._duration,this._totalTime=this._totalDuration):this._time=this._totalTime=this._duration=this._totalDuration=0,this},q.append=function(a,b){return this.add(a,this._parseTimeOrLabel(null,b,!0,a))},q.insert=q.insertMultiple=function(a,b,c,d){return this.add(a,b||0,c,d)},q.appendMultiple=function(a,b,c,d){return this.add(a,this._parseTimeOrLabel(null,b,!0,a),c,d)},q.addLabel=function(a,b){return this._labels[a]=this._parseTimeOrLabel(b),this},q.addPause=function(a,b,d,e){var f=c.delayedCall(0,o,d,e||this);return f.vars.onComplete=f.vars.onReverseComplete=b,f.data="isPause",this._hasPause=!0,this.add(f,a)},q.removeLabel=function(a){return delete this._labels[a],this},q.getLabelTime=function(a){return null!=this._labels[a]?this._labels[a]:-1},q._parseTimeOrLabel=function(b,c,d,e){var f;if(e instanceof a&&e.timeline===this)this.remove(e);else if(e&&(e instanceof Array||e.push&&i(e)))for(f=e.length;--f>-1;)e[f]instanceof a&&e[f].timeline===this&&this.remove(e[f]);if("string"==typeof c)return this._parseTimeOrLabel(c,d&&"number"==typeof b&&null==this._labels[c]?b-this.duration():0,d);if(c=c||0,"string"!=typeof b||!isNaN(b)&&null==this._labels[b])null==b&&(b=this.duration());else{if(f=b.indexOf("="),-1===f)return null==this._labels[b]?d?this._labels[b]=this.duration()+c:c:this._labels[b]+c;c=parseInt(b.charAt(f-1)+"1",10)*Number(b.substr(f+1)),b=f>1?this._parseTimeOrLabel(b.substr(0,f-1),0,d):this.duration()}return Number(b)+c},q.seek=function(a,b){return this.totalTime("number"==typeof a?a:this._parseTimeOrLabel(a),b!==!1)},q.stop=function(){return this.paused(!0)},q.gotoAndPlay=function(a,b){return this.play(a,b)},q.gotoAndStop=function(a,b){return this.pause(a,b)},q.render=function(a,b,c){this._gc&&this._enabled(!0,!1);var d,f,g,h,i,l,m,n=this._dirty?this.totalDuration():this._totalDuration,o=this._time,p=this._startTime,q=this._timeScale,r=this._paused;if(a>=n-1e-7&&a>=0)this._totalTime=this._time=n,this._reversed||this._hasPausedChild()||(f=!0,h="onComplete",i=!!this._timeline.autoRemoveChildren,0===this._duration&&(0>=a&&a>=-1e-7||this._rawPrevTime<0||this._rawPrevTime===e)&&this._rawPrevTime!==a&&this._first&&(i=!0,this._rawPrevTime>e&&(h="onReverseComplete"))),this._rawPrevTime=this._duration||!b||a||this._rawPrevTime===a?a:e,a=n+1e-4;else if(1e-7>a)if(this._totalTime=this._time=0,(0!==o||0===this._duration&&this._rawPrevTime!==e&&(this._rawPrevTime>0||0>a&&this._rawPrevTime>=0))&&(h="onReverseComplete",f=this._reversed),0>a)this._active=!1,this._timeline.autoRemoveChildren&&this._reversed?(i=f=!0,h="onReverseComplete"):this._rawPrevTime>=0&&this._first&&(i=!0),this._rawPrevTime=a;else{if(this._rawPrevTime=this._duration||!b||a||this._rawPrevTime===a?a:e,0===a&&f)for(d=this._first;d&&0===d._startTime;)d._duration||(f=!1),d=d._next;a=0,this._initted||(i=!0)}else{if(this._hasPause&&!this._forcingPlayhead&&!b){if(a>=o)for(d=this._first;d&&d._startTime<=a&&!l;)d._duration||"isPause"!==d.data||d.ratio||0===d._startTime&&0===this._rawPrevTime||(l=d),d=d._next;else for(d=this._last;d&&d._startTime>=a&&!l;)d._duration||"isPause"===d.data&&d._rawPrevTime>0&&(l=d),d=d._prev;l&&(this._time=a=l._startTime,this._totalTime=a+this._cycle*(this._totalDuration+this._repeatDelay))}this._totalTime=this._time=this._rawPrevTime=a}if(this._time!==o&&this._first||c||i||l){if(this._initted||(this._initted=!0),this._active||!this._paused&&this._time!==o&&a>0&&(this._active=!0),0===o&&this.vars.onStart&&(0===this._time&&this._duration||b||this._callback("onStart")),m=this._time,m>=o)for(d=this._first;d&&(g=d._next,m===this._time&&(!this._paused||r));)(d._active||d._startTime<=m&&!d._paused&&!d._gc)&&(l===d&&this.pause(),d._reversed?d.render((d._dirty?d.totalDuration():d._totalDuration)-(a-d._startTime)*d._timeScale,b,c):d.render((a-d._startTime)*d._timeScale,b,c)),d=g;else for(d=this._last;d&&(g=d._prev,m===this._time&&(!this._paused||r));){if(d._active||d._startTime<=o&&!d._paused&&!d._gc){if(l===d){for(l=d._prev;l&&l.endTime()>this._time;)l.render(l._reversed?l.totalDuration()-(a-l._startTime)*l._timeScale:(a-l._startTime)*l._timeScale,b,c),l=l._prev;l=null,this.pause()}d._reversed?d.render((d._dirty?d.totalDuration():d._totalDuration)-(a-d._startTime)*d._timeScale,b,c):d.render((a-d._startTime)*d._timeScale,b,c)}d=g}
vendor: 7,870 bytes, line 2836
2836this._onUpdate&&(b||(j.length&&k(),this._callback("onUpdate"))),h&&(this._gc||(p===this._startTime||q!==this._timeScale)&&(0===this._time||n>=this.totalDuration())&&(f&&(j.length&&k(),this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!b&&this.vars[h]&&this._callback(h)))}},q._hasPausedChild=function(){for(var a=this._first;a;){if(a._paused||a instanceof d&&a._hasPausedChild())return!0;a=a._next}return!1},q.getChildren=function(a,b,d,e){e=e||-9999999999;for(var f=[],g=this._first,h=0;g;)g._startTime<e||(g instanceof c?b!==!1&&(f[h++]=g):(d!==!1&&(f[h++]=g),a!==!1&&(f=f.concat(g.getChildren(!0,b,d)),h=f.length))),g=g._next;return f},q.getTweensOf=function(a,b){var d,e,f=this._gc,g=[],h=0;for(f&&this._enabled(!0,!0),d=c.getTweensOf(a),e=d.length;--e>-1;)(d[e].timeline===this||b&&this._contains(d[e]))&&(g[h++]=d[e]);return f&&this._enabled(!1,!0),g},q.recent=function(){return this._recent},q._contains=function(a){for(var b=a.timeline;b;){if(b===this)return!0;b=b.timeline}return!1},q.shiftChildren=function(a,b,c){c=c||0;for(var d,e=this._first,f=this._labels;e;)e._startTime>=c&&(e._startTime+=a),e=e._next;if(b)for(d in f)f[d]>=c&&(f[d]+=a);return this._uncache(!0)},q._kill=function(a,b){if(!a&&!b)return this._enabled(!1,!1);for(var c=b?this.getTweensOf(b):this.getChildren(!0,!0,!1),d=c.length,e=!1;--d>-1;)c[d]._kill(a,b)&&(e=!0);return e},q.clear=function(a){var b=this.getChildren(!1,!0,!0),c=b.length;for(this._time=this._totalTime=0;--c>-1;)b[c]._enabled(!1,!1);return a!==!1&&(this._labels={}),this._uncache(!0)},q.invalidate=function(){for(var b=this._first;b;)b.invalidate(),b=b._next;return a.prototype.invalidate.call(this)},q._enabled=function(a,c){if(a===this._gc)for(var d=this._first;d;)d._enabled(a,!0),d=d._next;return b.prototype._enabled.call(this,a,c)},q.totalTime=function(b,c,d){this._forcingPlayhead=!0;var e=a.prototype.totalTime.apply(this,arguments);return this._forcingPlayhead=!1,e},q.duration=function(a){return arguments.length?(0!==this.duration()&&0!==a&&this.timeScale(this._duration/a),this):(this._dirty&&this.totalDuration(),this._duration)},q.totalDuration=function(a){if(!arguments.length){if(this._dirty){for(var b,c,d=0,e=this._last,f=999999999999;e;)b=e._prev,e._dirty&&e.totalDuration(),e._startTime>f&&this._sortChildren&&!e._paused?this.add(e,e._startTime-e._delay):f=e._startTime,e._startTime<0&&!e._paused&&(d-=e._startTime,this._timeline.smoothChildTiming&&(this._startTime+=e._startTime/this._timeScale),this.shiftChildren(-e._startTime,!1,-9999999999),f=0),c=e._startTime+e._totalDuration/e._timeScale,c>d&&(d=c),e=b;this._duration=this._totalDuration=d,this._dirty=!1}return this._totalDuration}return a&&this.totalDuration()?this.timeScale(this._totalDuration/a):this},q.paused=function(b){if(!b)for(var c=this._first,d=this._time;c;)c._startTime===d&&"isPause"===c.data&&(c._rawPrevTime=0),c=c._next;return a.prototype.paused.apply(this,arguments)},q.usesFrames=function(){for(var b=this._timeline;b._timeline;)b=b._timeline;return b===a._rootFramesTimeline},q.rawTime=function(a){return a&&(this._paused||this._repeat&&this.time()>0&&this.totalProgress()<1)?this._totalTime%(this._duration+this._repeatDelay):this._paused?this._totalTime:(this._timeline.rawTime(a)-this._startTime)*this._timeScale},d},!0),_gsScope._gsDefine("TimelineMax",["TimelineLite","TweenLite","easing.Ease"],function(a,b,c){var d=function(b){a.call(this,b),this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._cycle=0,this._yoyo=this.vars.yoyo===!0,this._dirty=!0},e=1e-10,f=b._internals,g=f.lazyTweens,h=f.lazyRender,i=_gsScope._gsDefine.globals,j=new c(null,null,1,0),k=d.prototype=new a;return k.constructor=d,k.kill()._gc=!1,d.version="1.19.1",k.invalidate=function(){return this._yoyo=this.vars.yoyo===!0,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._uncache(!0),a.prototype.invalidate.call(this)},k.addCallback=function(a,c,d,e){return this.add(b.delayedCall(0,a,d,e),c)},k.removeCallback=function(a,b){if(a)if(null==b)this._kill(null,a);else for(var c=this.getTweensOf(a,!1),d=c.length,e=this._parseTimeOrLabel(b);--d>-1;)c[d]._startTime===e&&c[d]._enabled(!1,!1);return this},k.removePause=function(b){return this.removeCallback(a._internals.pauseCallback,b)},k.tweenTo=function(a,c){c=c||{};var d,e,f,g={ease:j,useFrames:this.usesFrames(),immediateRender:!1},h=c.repeat&&i.TweenMax||b;for(e in c)g[e]=c[e];return g.time=this._parseTimeOrLabel(a),d=Math.abs(Number(g.time)-this._time)/this._timeScale||.001,f=new h(this,d,g),g.onStart=function(){f.target.paused(!0),f.vars.time!==f.target.time()&&d===f.duration()&&f.duration(Math.abs(f.vars.time-f.target.time())/f.target._timeScale),c.onStart&&c.onStart.apply(c.onStartScope||c.callbackScope||f,c.onStartParams||[])},f},k.tweenFromTo=function(a,b,c){c=c||{},a=this._parseTimeOrLabel(a),c.startAt={onComplete:this.seek,onCompleteParams:[a],callbackScope:this},c.immediateRender=c.immediateRender!==!1;var d=this.tweenTo(b,c);return d.duration(Math.abs(d.vars.time-a)/this._timeScale||.001)},k.render=function(a,b,c){this._gc&&this._enabled(!0,!1);var d,f,i,j,k,l,m,n,o=this._dirty?this.totalDuration():this._totalDuration,p=this._duration,q=this._time,r=this._totalTime,s=this._startTime,t=this._timeScale,u=this._rawPrevTime,v=this._paused,w=this._cycle;if(a>=o-1e-7&&a>=0)this._locked||(this._totalTime=o,this._cycle=this._repeat),this._reversed||this._hasPausedChild()||(f=!0,j="onComplete",k=!!this._timeline.autoRemoveChildren,0===this._duration&&(0>=a&&a>=-1e-7||0>u||u===e)&&u!==a&&this._first&&(k=!0,u>e&&(j="onReverseComplete"))),this._rawPrevTime=this._duration||!b||a||this._rawPrevTime===a?a:e,this._yoyo&&0!==(1&this._cycle)?this._time=a=0:(this._time=p,a=p+1e-4);else if(1e-7>a)if(this._locked||(this._totalTime=this._cycle=0),this._time=0,(0!==q||0===p&&u!==e&&(u>0||0>a&&u>=0)&&!this._locked)&&(j="onReverseComplete",f=this._reversed),0>a)this._active=!1,this._timeline.autoRemoveChildren&&this._reversed?(k=f=!0,j="onReverseComplete"):u>=0&&this._first&&(k=!0),this._rawPrevTime=a;else{if(this._rawPrevTime=p||!b||a||this._rawPrevTime===a?a:e,0===a&&f)for(d=this._first;d&&0===d._startTime;)d._duration||(f=!1),d=d._next;a=0,this._initted||(k=!0)}else if(0===p&&0>u&&(k=!0),this._time=this._rawPrevTime=a,this._locked||(this._totalTime=a,0!==this._repeat&&(l=p+this._repeatDelay,this._cycle=this._totalTime/l>>0,0!==this._cycle&&this._cycle===this._totalTime/l&&a>=r&&this._cycle--,this._time=this._totalTime-this._cycle*l,this._yoyo&&0!==(1&this._cycle)&&(this._time=p-this._time),this._time>p?(this._time=p,a=p+1e-4):this._time<0?this._time=a=0:a=this._time)),this._hasPause&&!this._forcingPlayhead&&!b&&p>a){if(a=this._time,a>=q||this._repeat&&w!==this._cycle)for(d=this._first;d&&d._startTime<=a&&!m;)d._duration||"isPause"!==d.data||d.ratio||0===d._startTime&&0===this._rawPrevTime||(m=d),d=d._next;else for(d=this._last;d&&d._startTime>=a&&!m;)d._duration||"isPause"===d.data&&d._rawPrevTime>0&&(m=d),d=d._prev;m&&(this._time=a=m._startTime,this._totalTime=a+this._cycle*(this._totalDuration+this._repeatDelay))}if(this._cycle!==w&&!this._locked){var x=this._yoyo&&0!==(1&w),y=x===(this._yoyo&&0!==(1&this._cycle)),z=this._totalTime,A=this._cycle,B=this._rawPrevTime,C=this._time;if(this._totalTime=w*p,this._cycle<w?x=!x:this._totalTime+=p,this._time=q,this._rawPrevTime=0===p?u-1e-4:u,this._cycle=w,this._locked=!0,q=x?0:p,this.render(q,b,0===p),b||this._gc||this.vars.onRepeat&&(this._cycle=A,this._locked=!1,this._callback("onRepeat")),q!==this._time)return;if(y&&(this._cycle=w,this._locked=!0,q=x?p+1e-4:-1e-4,this.render(q,!0,!1)),this._locked=!1,this._paused&&!v)return;this._time=C,this._totalTime=z,this._cycle=A,this._rawPrevTime=B}if(!(this._time!==q&&this._first||c||k||m))return void(r!==this._totalTime&&this._onUpdate&&(b||this._callback("onUp
2836date")));if(this._initted||(this._initted=!0),this._active||!this._paused&&this._totalTime!==r&&a>0&&(this._active=!0),0===r&&this.vars.onStart&&(0===this._totalTime&&this._totalDuration||b||this._callback("onStart")),n=this._time,n>=q)for(d=this._first;d&&(i=d._next,n===this._time&&(!this._paused||v));)(d._active||d._startTime<=this._time&&!d._paused&&!d._gc)&&(m===d&&this.pause(),d._reversed?d.render((d._dirty?d.totalDuration():d._totalDuration)-(a-d._startTime)*d._timeScale,b,c):d.render((a-d._startTime)*d._timeScale,b,c)),d=i;else for(d=this._last;d&&(i=d._prev,n===this._time&&(!this._paused||v));){if(d._active||d._startTime<=q&&!d._paused&&!d._gc){if(m===d){for(m=d._prev;m&&m.endTime()>this._time;)m.render(m._reversed?m.totalDuration()-(a-m._startTime)*m._timeScale:(a-m._startTime)*m._timeScale,b,c),m=m._prev;m=null,this.pause()}d._reversed?d.render((d._dirty?d.totalDuration():d._totalDuration)-(a-d._startTime)*d._timeScale,b,c):d.render((a-d._startTime)*d._timeScale,b,c)}d=i}this._onUpdate&&(b||(g.length&&h(),this._callback("onUpdate"))),j&&(this._locked||this._gc||(s===this._startTime||t!==this._timeScale)&&(0===this._time||o>=this.totalDuration())&&(f&&(g.length&&h(),this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!b&&this.vars[j]&&this._callback(j)))},k.getActive=function(a,b,c){null==a&&(a=!0),null==b&&(b=!0),null==c&&(c=!1);var d,e,f=[],g=this.getChildren(a,b,c),h=0,i=g.length;for(d=0;i>d;d++)e=g[d],e.isActive()&&(f[h++]=e);return f},k.getLabelAfter=function(a){a||0!==a&&(a=this._time);var b,c=this.getLabelsArray(),d=c.length;for(b=0;d>b;b++)if(c[b].time>a)return c[b].name;return null},k.getLabelBefore=function(a){null==a&&(a=this._time);for(var b=this.getLabelsArray(),c=b.length;--c>-1;)if(b[c].time<a)return b[c].name;return null},k.getLabelsArray=function(){var a,b=[],c=0;for(a in this._labels)b[c++]={time:this._labels[a],name:a};return b.sort(function(a,b){return a.time-b.time}),b},k.invalidate=function(){return this._locked=!1,a.prototype.invalidate.call(this)},k.progress=function(a,b){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&0!==(1&this._cycle)?1-a:a)+this._cycle*(this._duration+this._repeatDelay),b):this._time/this.duration()},k.totalProgress=function(a,b){return arguments.length?this.totalTime(this.totalDuration()*a,b):this._totalTime/this.totalDuration()},k.totalDuration=function(b){return arguments.length?-1!==this._repeat&&b?this.timeScale(this.totalDuration()/b):this:(this._dirty&&(a.prototype.totalDuration.call(this),this._totalDuration=-1===this._repeat?999999999999:this._duration*(this._repeat+1)+this._repeatDelay*this._repeat),this._totalDuration)},k.time=function(a,b){return arguments.length?(this._dirty&&this.totalDuration(),a>this._duration&&(a=this._duration),this._yoyo&&0!==(1&this._cycle)?a=this._duration-a+this._cycle*(this._duration+this._repeatDelay):0!==this._repeat&&(a+=this._cycle*(this._duration+this._repeatDelay)),this.totalTime(a,b)):this._time},k.repeat=function(a){return arguments.length?(this._repeat=a,this._uncache(!0)):this._repeat},k.repeatDelay=function(a){return arguments.length?(this._repeatDelay=a,this._uncache(!0)):this._repeatDelay},k.yoyo=function(a){return arguments.length?(this._yoyo=a,this):this._yoyo},k.currentLabel=function(a){return arguments.length?this.seek(a,!0):this.getLabelBefore(this._time+1e-8)},d},!0),function(){var a=180/Math.PI,b=[],c=[],d=[],e={},f=_gsScope._gsDefine.globals,g=function(a,b,c,d){c===d&&(c=d-(d-b)/1e6),a===b&&(b=a+(c-a)/1e6),this.a=a,this.b=b,this.c=c,this.d=d,this.da=d-a,this.ca=c-a,this.ba=b-a},h=",x,y,z,left,top,right,bottom,marginTop,marginLeft,marginRight,marginBottom,paddingLeft,paddingTop,paddingRight,paddingBottom,backgroundPosition,backgroundPosition_y,",i=function(a,b,c,d){var e={a:a},f={},g={},h={c:d},i=(a+b)/2,j=(b+c)/2,k=(c+d)/2,l=(i+j)/2,m=(j+k)/2,n=(m-l)/8;return e.b=i+(a-i)/4,f.b=l+n,e.c=f.a=(e.b+f.b)/2,f.c=g.a=(l+m)/2,g.b=m-n,h.b=k+(d-k)/4,g.c=h.a=(g.b+h.b)/2,[e,f,g,h]},j=function(a,e,f,g,h){var j,k,l,m,n,o,p,q,r,s,t,u,v,w=a.length-1,x=0,y=a[0].a;for(j=0;w>j;j++)n=a[x],k=n.a,l=n.d,m=a[x+1].d,h?(t=b[j],u=c[j],v=(u+t)*e*.25/(g?.5:d[j]||.5),o=l-(l-k)*(g?.5*e:0!==t?v/t:0),p=l+(m-l)*(g?.5*e:0!==u?v/u
vendor: 55,240 bytes, line 2836
2836:0),q=l-(o+((p-o)*(3*t/(t+u)+.5)/4||0))):(o=l-(l-k)*e*.5,p=l+(m-l)*e*.5,q=l-(o+p)/2),o+=q,p+=q,n.c=r=o,0!==j?n.b=y:n.b=y=n.a+.6*(n.c-n.a),n.da=l-k,n.ca=r-k,n.ba=y-k,f?(s=i(k,y,r,l),a.splice(x,1,s[0],s[1],s[2],s[3]),x+=4):x++,y=p;n=a[x],n.b=y,n.c=y+.4*(n.d-y),n.da=n.d-n.a,n.ca=n.c-n.a,n.ba=y-n.a,f&&(s=i(n.a,y,n.c,n.d),a.splice(x,1,s[0],s[1],s[2],s[3]))},k=function(a,d,e,f){var h,i,j,k,l,m,n=[];if(f)for(a=[f].concat(a),i=a.length;--i>-1;)"string"==typeof(m=a[i][d])&&"="===m.charAt(1)&&(a[i][d]=f[d]+Number(m.charAt(0)+m.substr(2)));if(h=a.length-2,0>h)return n[0]=new g(a[0][d],0,0,a[-1>h?0:1][d]),n;for(i=0;h>i;i++)j=a[i][d],k=a[i+1][d],n[i]=new g(j,0,0,k),e&&(l=a[i+2][d],b[i]=(b[i]||0)+(k-j)*(k-j),c[i]=(c[i]||0)+(l-k)*(l-k));return n[i]=new g(a[i][d],0,0,a[i+1][d]),n},l=function(a,f,g,i,l,m){var n,o,p,q,r,s,t,u,v={},w=[],x=m||a[0];l="string"==typeof l?","+l+",":h,null==f&&(f=1);for(o in a[0])w.push(o);if(a.length>1){for(u=a[a.length-1],t=!0,n=w.length;--n>-1;)if(o=w[n],Math.abs(x[o]-u[o])>.05){t=!1;break}t&&(a=a.concat(),m&&a.unshift(m),a.push(a[1]),m=a[a.length-3])}for(b.length=c.length=d.length=0,n=w.length;--n>-1;)o=w[n],e[o]=-1!==l.indexOf(","+o+","),v[o]=k(a,o,e[o],m);for(n=b.length;--n>-1;)b[n]=Math.sqrt(b[n]),c[n]=Math.sqrt(c[n]);if(!i){for(n=w.length;--n>-1;)if(e[o])for(p=v[w[n]],s=p.length-1,q=0;s>q;q++)r=p[q+1].da/c[q]+p[q].da/b[q]||0,d[q]=(d[q]||0)+r*r;for(n=d.length;--n>-1;)d[n]=Math.sqrt(d[n])}for(n=w.length,q=g?4:1;--n>-1;)o=w[n],p=v[o],j(p,f,g,i,e[o]),t&&(p.splice(0,q),p.splice(p.length-q,q));return v},m=function(a,b,c){b=b||"soft";var d,e,f,h,i,j,k,l,m,n,o,p={},q="cubic"===b?3:2,r="soft"===b,s=[];if(r&&c&&(a=[c].concat(a)),null==a||a.length<q+1)throw"invalid Bezier data";for(m in a[0])s.push(m);for(j=s.length;--j>-1;){for(m=s[j],p[m]=i=[],n=0,l=a.length,k=0;l>k;k++)d=null==c?a[k][m]:"string"==typeof(o=a[k][m])&&"="===o.charAt(1)?c[m]+Number(o.charAt(0)+o.substr(2)):Number(o),r&&k>1&&l-1>k&&(i[n++]=(d+i[n-2])/2),i[n++]=d;for(l=n-q+1,n=0,k=0;l>k;k+=q)d=i[k],e=i[k+1],f=i[k+2],h=2===q?0:i[k+3],i[n++]=o=3===q?new g(d,e,f,h):new g(d,(2*e+d)/3,(2*e+f)/3,f);i.length=n}return p},n=function(a,b,c){for(var d,e,f,g,h,i,j,k,l,m,n,o=1/c,p=a.length;--p>-1;)for(m=a[p],f=m.a,g=m.d-f,h=m.c-f,i=m.b-f,d=e=0,k=1;c>=k;k++)j=o*k,l=1-j,d=e-(e=(j*j*g+3*l*(j*h+l*i))*j),n=p*c+k-1,b[n]=(b[n]||0)+d*d},o=function(a,b){b=b>>0||6;var c,d,e,f,g=[],h=[],i=0,j=0,k=b-1,l=[],m=[];for(c in a)n(a[c],g,b);for(e=g.length,d=0;e>d;d++)i+=Math.sqrt(g[d]),f=d%b,m[f]=i,f===k&&(j+=i,f=d/b>>0,l[f]=m,h[f]=j,i=0,m=[]);return{length:j,lengths:h,segments:l}},p=_gsScope._gsDefine.plugin({propName:"bezier",priority:-1,version:"1.3.7",API:2,global:!0,init:function(a,b,c){this._target=a,b instanceof Array&&(b={values:b}),this._func={},this._mod={},this._props=[],this._timeRes=null==b.timeResolution?6:parseInt(b.timeResolution,10);var d,e,f,g,h,i=b.values||[],j={},k=i[0],n=b.autoRotate||c.vars.orientToBezier;this._autoRotate=n?n instanceof Array?n:[["x","y","rotation",n===!0?0:Number(n)||0]]:null;for(d in k)this._props.push(d);for(f=this._props.length;--f>-1;)d=this._props[f],this._overwriteProps.push(d),e=this._func[d]="function"==typeof a[d],j[d]=e?a[d.indexOf("set")||"function"!=typeof a["get"+d.substr(3)]?d:"get"+d.substr(3)]():parseFloat(a[d]),h||j[d]!==i[0][d]&&(h=j);if(this._beziers="cubic"!==b.type&&"quadratic"!==b.type&&"soft"!==b.type?l(i,isNaN(b.curviness)?1:b.curviness,!1,"thruBasic"===b.type,b.correlate,h):m(i,b.type,j),this._segCount=this._beziers[d].length,this._timeRes){var p=o(this._beziers,this._timeRes);this._length=p.length,this._lengths=p.lengths,this._segments=p.segments,this._l1=this._li=this._s1=this._si=0,this._l2=this._lengths[0],this._curSeg=this._segments[0],this._s2=this._curSeg[0],this._prec=1/this._curSeg.length}if(n=this._autoRotate)for(this._initialRotations=[],n[0]instanceof Array||(this._autoRotate=n=[n]),f=n.length;--f>-1;){for(g=0;3>g;g++)d=n[f][g],this._func[d]="function"==typeof a[d]?a[d.indexOf("set")||"function"!=typeof a["get"+d.substr(3)]?d:"get"+d.substr(3)]:!1;d=n[f][2],this._initialRotations[f]=(this._func[d]?this._func[d].call(this._target):this._target[d])||0,this._overwriteProps.push(d)}return this._startRatio=c.vars.runBackwards?1:0,!0},set:function(b){var c,d,e,f,g,h,i,j,k,l,m=this._segCount,n=this._func,o=this._target,p=b!==this._startRatio;if(this._timeRes){if(k=this._lengths,l=this._curSeg,b*=this._length,e=this._li,b>this._l2&&m-1>e){for(j=m-1;j>e&&(this._l2=k[++e])<=b;);this._l1=k[e-1],this._li=e,this._curSeg=l=this._segments[e],this._s2=l[this._s1=this._si=0]}else if(b<this._l1&&e>0){for(;e>0&&(this._l1=k[--e])>=b;);0===e&&b<this._l1?this._l1=0:e++,this._l2=k[e],this._li=e,this._curSeg=l=this._segments[e],this._s1=l[(this._si=l.length-1)-1]||0,this._s2=l[this._si]}if(c=e,b-=this._l1,e=this._si,b>this._s2&&e<l.length-1){for(j=l.length-1;j>e&&(this._s2=l[++e])<=b;);this._s1=l[e-1],this._si=e}else if(b<this._s1&&e>0){for(;e>0&&(this._s1=l[--e])>=b;);0===e&&b<this._s1?this._s1=0:e++,this._s2=l[e],this._si=e}h=(e+(b-this._s1)/(this._s2-this._s1))*this._prec||0}else c=0>b?0:b>=1?m-1:m*b>>0,h=(b-c*(1/m))*m;for(d=1-h,e=this._props.length;--e>-1;)f=this._props[e],g=this._beziers[f][c],i=(h*h*g.da+3*d*(h*g.ca+d*g.ba))*h+g.a,this._mod[f]&&(i=this._mod[f](i,o)),n[f]?o[f](i):o[f]=i;if(this._autoRotate){var q,r,s,t,u,v,w,x=this._autoRotate;for(e=x.length;--e>-1;)f=x[e][2],v=x[e][3]||0,w=x[e][4]===!0?1:a,g=this._beziers[x[e][0]],q=this._beziers[x[e][1]],g&&q&&(g=g[c],q=q[c],r=g.a+(g.b-g.a)*h,t=g.b+(g.c-g.b)*h,r+=(t-r)*h,t+=(g.c+(g.d-g.c)*h-t)*h,s=q.a+(q.b-q.a)*h,u=q.b+(q.c-q.b)*h,s+=(u-s)*h,u+=(q.c+(q.d-q.c)*h-u)*h,i=p?Math.atan2(u-s,t-r)*w+v:this._initialRotations[e],this._mod[f]&&(i=this._mod[f](i,o)),n[f]?o[f](i):o[f]=i)}}}),q=p.prototype;p.bezierThrough=l,p.cubicToQuadratic=i,p._autoCSS=!0,p.quadraticToCubic=function(a,b,c){return new g(a,(2*b+a)/3,(2*b+c)/3,c)},p._cssRegister=function(){var a=f.CSSPlugin;if(a){var b=a._internals,c=b._parseToProxy,d=b._setPluginRatio,e=b.CSSPropTween;b._registerComplexSpecialProp("bezier",{parser:function(a,b,f,g,h,i){b instanceof Array&&(b={values:b}),i=new p;var j,k,l,m=b.values,n=m.length-1,o=[],q={};if(0>n)return h;for(j=0;n>=j;j++)l=c(a,m[j],g,h,i,n!==j),o[j]=l.end;for(k in b)q[k]=b[k];return q.values=o,h=new e(a,"bezier",0,0,l.pt,2),h.data=l,h.plugin=i,h.setRatio=d,0===q.autoRotate&&(q.autoRotate=!0),!q.autoRotate||q.autoRotate instanceof Array||(j=q.autoRotate===!0?0:Number(q.autoRotate),q.autoRotate=null!=l.end.left?[["left","top","rotation",j,!1]]:null!=l.end.x?[["x","y","rotation",j,!1]]:!1),q.autoRotate&&(g._transform||g._enableTransforms(!1),l.autoRotate=g._target._gsTransform,l.proxy.rotation=l.autoRotate.rotation||0,g._overwriteProps.push("rotation")),i._onInitTween(l.proxy,q,g._tween),h}})}},q._mod=function(a){for(var b,c=this._overwriteProps,d=c.length;--d>-1;)b=a[c[d]],b&&"function"==typeof b&&(this._mod[c[d]]=b)},q._kill=function(a){var b,c,d=this._props;for(b in this._beziers)if(b in a)for(delete this._beziers[b],delete this._func[b],c=d.length;--c>-1;)d[c]===b&&d.splice(c,1);if(d=this._autoRotate)for(c=d.length;--c>-1;)a[d[c][2]]&&d.splice(c,1);return this._super._kill.call(this,a)}}(),_gsScope._gsDefine("plugins.CSSPlugin",["plugins.TweenPlugin","TweenLite"],function(a,b){var c,d,e,f,g=function(){a.call(this,"css"),this._overwriteProps.length=0,this.setRatio=g.prototype.setRatio},h=_gsScope._gsDefine.globals,i={},j=g.prototype=new a("css");j.constructor=g,g.version="1.19.1",g.API=2,g.defaultTransformPerspective=0,g.defaultSkewType="compensated",g.defaultSmoothOrigin=!0,j="px",g.suffixMap={top:j,right:j,bottom:j,left:j,width:j,height:j,fontSize:j,padding:j,margin:j,perspective:j,lineHeight:""};var k,l,m,n,o,p,q,r,s=/(?:\-|\.|\b)(\d|\.|e\-)+/g,t=/(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,u=/(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi,v=/(?![+-]?\d*\.?\d+|[+-]|e[+-]\d+)[^0-9]/g,w=/(?:\d|\-|\+|=|#|\.)*/g,x=/opacity *= *([^)]*)/i,y=/opacity:([^;]*)/i,z=/alpha\(opacity *=.+?\)/i,A=/^(rgb|hsl)/,B=/([A-Z])/g,C=/-([a-z])/gi,D=/(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi,E=function(a,b){return b.toUpperCase()},F=/(?:Left|Right|Width)/i,G=/(M11|M12|M21|M22)=[\d\-\.e]+/gi,H=/progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i,I=/,(?=[^\)]*(?:\(|$))/gi,J=/[\s,\(]/i,K=Math.PI/180,L=180/Math.PI,M={},N={style:{}},O=_gsScope.document||{createElement:function(){return N}},P=function(a,b){return O.createElementNS?O.createElementNS(b||"http://www.w3.org/1999/xhtml",a):O.createElement(a)},Q=P("div"),R=P("img"),S=g._internals={_specialProps:i},T=(_gsScope.navigator||{}).userAgent||"",U=function(){var a=T.indexOf("Android"),b=P("a");return m=-1!==T.indexOf("Safari")&&-1===T.indexOf("Chrome")&&(-1===a||parseFloat(T.substr(a+8,2))>3),o=m&&parseFloat(T.substr(T.indexOf("Version/")+8,2))<6,n=-1!==T.indexOf("Firefox"),(/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(T)||/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(T))&&(p=parseFloat(RegExp.$1)),b?(b.style.cssText="top:1px;opacity:.55;",/^0.55/.test(b.style.opacity)):!1}(),V=function(a){return x.test("string"==typeof a?a:(a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100:1},W=function(a){_gsScope.console&&console.log(a)},X="",Y="",Z=function(a,b){b=b||Q;var c,d,e=b.style;if(void 0!==e[a])return a;for(a=a.charAt(0).toUpperCase()+a.substr(1),c=["O","Moz","ms","Ms","Webkit"],d=5;--d>-1&&void 0===e[c[d]+a];);return d>=0?(Y=3===d?"ms":c[d],X="-"+Y.toLowerCase()+"-",Y+a):null},$=O.defaultView?O.defaultView.getComputedStyle:function(){},_=g.getStyle=function(a,b,c,d,e){var f;return U||"opacity"!==b?(!d&&a.style[b]?f=a.style[b]:(c=c||$(a))?f=c[b]||c.getPropertyValue(b)||c.getPropertyValue(b.replace(B,"-$1").toLowerCase()):a.currentStyle&&(f=a.currentStyle[b]),null==e||f&&"none"!==f&&"auto"!==f&&"auto auto"!==f?f:e):V(a)},aa=S.convertToPixels=function(a,c,d,e,f){if("px"===e||!e)return d;if("auto"===e||!d)return 0;var h,i,j,k=F.test(c),l=a,m=Q.style,n=0>d,o=1===d;if(n&&(d=-d),o&&(d*=100),"%"===e&&-1!==c.indexOf("border"))h=d/100*(k?a.clientWidth:a.clientHeight);else{if(m.cssText="border:0 solid red;position:"+_(a,"position")+";line-height:0;","%"!==e&&l.appendChild&&"v"!==e.charAt(0)&&"rem"!==e)m[k?"borderLeftWidth":"borderTopWidth"]=d+e;else{if(l=a.parentNode||O.body,i=l._gsCache,j=b.ticker.frame,i&&k&&i.time===j)return i.width*d/100;m[k?"width":"height"]=d+e}l.appendChild(Q),h=parseFloat(Q[k?"offsetWidth":"offsetHeight"]),l.removeChild(Q),k&&"%"===e&&g.cacheWidths!==!1&&(i=l._gsCache=l._gsCache||{},i.time=j,i.width=h/d*100),0!==h||f||(h=aa(a,c,d,e,!0))}return o&&(h/=100),n?-h:h},ba=S.calculateOffset=function(a,b,c){if("absolute"!==_(a,"position",c))return 0;var d="left"===b?"Left":"Top",e=_(a,"margin"+d,c);return a["offset"+d]-(aa(a,b,parseFloat(e),e.replace(w,""))||0)},ca=function(a,b){var c,d,e,f={};if(b=b||$(a,null))if(c=b.length)for(;--c>-1;)e=b[c],(-1===e.indexOf("-transform")||Da===e)&&(f[e.replace(C,E)]=b.getPropertyValue(e));else for(c in b)(-1===c.indexOf("Transform")||Ca===c)&&(f[c]=b[c]);else if(b=a.currentStyle||a.style)for(c in b)"string"==typeof c&&void 0===f[c]&&(f[c.replace(C,E)]=b[c]);return U||(f.opacity=V(a)),d=Ra(a,b,!1),f.rotation=d.rotation,f.skewX=d.skewX,f.scaleX=d.scaleX,f.scaleY=d.scaleY,f.x=d.x,f.y=d.y,Fa&&(f.z=d.z,f.rotationX=d.rotationX,f.rotationY=d.rotationY,f.scaleZ=d.scaleZ),f.filters&&delete f.filters,f},da=function(a,b,c,d,e){var f,g,h,i={},j=a.style;for(g in c)"cssText"!==g&&"length"!==g&&isNaN(g)&&(b[g]!==(f=c[g])||e&&e[g])&&-1===g.indexOf("Origin")&&("number"==typeof f||"string"==typeof f)&&(i[g]="auto"!==f||"left"!==g&&"top"!==g?""!==f&&"auto"!==f&&"none"!==f||"string"!=typeof b[g]||""===b[g].replace(v,"")?f:0:ba(a,g),void 0!==j[g]&&(h=new sa(j,g,j[g],h)));if(d)for(g in d)"className"!==g&&(i[g]=d[g]);return{difs:i,firstMPT:h}},ea={width:["Left","Right"],height:["Top","Bottom"]},fa=["marginLeft","marginRight","marginTop","marginBottom"],ga=function(a,b,c){if("svg"===(a.nodeName+"").toLowerCase())return(c||$(a))[b]||0;if(a.getCTM&&Oa(a))return a.getBBox()[b]||0;var d=parseFloat("width"===b?a.offsetWidth:a.offsetHeight),e=ea[b],f=e.length;for(c=c||$(a,null);--f>-1;)d-=parseFloat(_(a,"padding"+e[f],c,!0))||0,d-=parseFloat(_(a,"border"+e[f]+"Width",c,!0))||0;return d},ha=function(a,b){if("contain"===a||"auto"===a||"auto auto"===a)return a+" ";(null==a||""===a)&&(a="0 0");var c,d=a.split(" "),e=-1!==a.indexOf("left")?"0%":-1!==a.indexOf("right")?"100%":d[0],f=-1!==a.indexOf("top")?"0%":-1!==a.indexOf("bottom")?"100%":d[1];if(d.length>3&&!b){for(d=a.split(", ").join(",").split(","),a=[],c=0;c<d.length;c++)a.push(ha(d[c]));return a.join(",")}return null==f?f="center"===e?"50%":"0":"center"===f&&(f="50%"),("center"===e||isNaN(parseFloat(e))&&-1===(e+"").indexOf("="))&&(e="50%"),a=e+" "+f+(d.length>2?" "+d[2]:""),b&&(b.oxp=-1!==e.indexOf("%"),b.oyp=-1!==f.indexOf("%"),b.oxr="="===e.charAt(1),b.oyr="="===f.charAt(1),b.ox=parseFloat(e.replace(v,"")),b.oy=parseFloat(f.replace(v,"")),b.v=a),b||a},ia=function(a,b){return"function"==typeof a&&(a=a(r,q)),"string"==typeof a&&"="===a.charAt(1)?parseInt(a.charAt(0)+"1",10)*parseFloat(a.substr(2)):parseFloat(a)-parseFloat(b)||0},ja=function(a,b){return"function"==typeof a&&(a=a(r,q)),null==a?b:"string"==typeof a&&"="===a.charAt(1)?parseInt(a.charAt(0)+"1",10)*parseFloat(a.substr(2))+b:parseFloat(a)||0},ka=function(a,b,c,d){var e,f,g,h,i,j=1e-6;return"function"==typeof a&&(a=a(r,q)),null==a?h=b:"number"==typeof a?h=a:(e=360,f=a.split("_"),i="="===a.charAt(1),g=(i?parseInt(a.charAt(0)+"1",10)*parseFloat(f[0].substr(2)):parseFloat(f[0]))*(-1===a.indexOf("rad")?1:L)-(i?0:b),f.length&&(d&&(d[c]=b+g),-1!==a.indexOf("short")&&(g%=e,g!==g%(e/2)&&(g=0>g?g+e:g-e)),-1!==a.indexOf("_cw")&&0>g?g=(g+9999999999*e)%e-(g/e|0)*e:-1!==a.indexOf("ccw")&&g>0&&(g=(g-9999999999*e)%e-(g/e|0)*e)),h=b+g),j>h&&h>-j&&(h=0),h},la={aqua:[0,255,255],lime:[0,255,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,255],navy:[0,0,128],white:[255,255,255],fuchsia:[255,0,255],olive:[128,128,0],yellow:[255,255,0],orange:[255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[255,0,0],pink:[255,192,203],cyan:[0,255,255],transparent:[255,255,255,0]},ma=function(a,b,c){return a=0>a?a+1:a>1?a-1:a,255*(1>6*a?b+(c-b)*a*6:.5>a?c:2>3*a?b+(c-b)*(2/3-a)*6:b)+.5|0},na=g.parseColor=function(a,b){var c,d,e,f,g,h,i,j,k,l,m;if(a)if("number"==typeof a)c=[a>>16,a>>8&255,255&a];else{if(","===a.charAt(a.length-1)&&(a=a.substr(0,a.length-1)),la[a])c=la[a];else if("#"===a.charAt(0))4===a.length&&(d=a.charAt(1),e=a.charAt(2),f=a.charAt(3),a="#"+d+d+e+e+f+f),a=parseInt(a.substr(1),16),c=[a>>16,a>>8&255,255&a];else if("hsl"===a.substr(0,3))if(c=m=a.match(s),b){if(-1!==a.indexOf("="))return a.match(t)}else g=Number(c[0])%360/360,h=Number(c[1])/100,i=Number(c[2])/100,e=.5>=i?i*(h+1):i+h-i*h,d=2*i-e,c.length>3&&(c[3]=Number(a[3])),c[0]=ma(g+1/3,d,e),c[1]=ma(g,d,e),c[2]=ma(g-1/3,d,e);else c=a.match(s)||la.transparent;c[0]=Number(c[0]),c[1]=Number(c[1]),c[2]=Number(c[2]),c.length>3&&(c[3]=Number(c[3]))}else c=la.black;return b&&!m&&(d=c[0]/255,e=c[1]/255,f=c[2]/255,j=Math.max(d,e,f),k=Math.min(d,e,f),i=(j+k)/2,j===k?g=h=0:(l=j-k,h=i>.5?l/(2-j-k):l/(j+k),g=j===d?(e-f)/l+(f>e?6:0):j===e?(f-d)/l+2:(d-e)/l+4,g*=60),c[0]=g+.5|0,c[1]=100*h+.5|0,c[2]=100*i+.5|0),c},oa=function(a,b){var c,d,e,f=a.match(pa)||[],g=0,h=f.length?"":a;for(c=0;c<f.length;c++)d=f[c],e=a.substr(g,a.indexOf(d,g)-g),g+=e.length+d.length,d=na(d,b),3===d.length&&d.push(1),h+=e+(b?"hsla("+d[0]+","+d[1]+"%,"+d[2]+"%,"+d[3]:"rgba("+d.join(","))+")";return h+a.substr(g)},pa="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3}){1,2}\\b";for(j in la)pa+="|"+j+"\\b";pa=new RegExp(pa+")","gi"),g.colorStringFilter=function(a){var b,c=a[0]+a[1];pa.test(c)&&(b=-1!==c.indexOf("hsl(")||-1!==c.indexOf("hsla("),a[0]=oa(a[0],b),a[1]=oa(a[1],b)),pa.lastIndex=0},b.defaultStringFilter||(b.defaultStringFilter=g.colorStringFilter);var qa=function(a,b,c,d){if(null==a)return function(a){return a};var e,f=b?(a.match(pa)||[""])[0]:"",g=a.split(f).join("").match(u)||[],h=a.substr(0,a.indexOf(g[0])),i=")"===a.charAt(a.length-1)?")":"",j=-1!==a.indexOf(" ")?" ":",",k=g.length,l=k>0?g[0].replace(s,""):"";return k?e=b?function(a){var b,m,n,o;if("number"==typeof a)a+=l;else if(d&&I.test(a)){for(o=a.replace(I,"|").split("|"),n=0;n<o.length;n++)o[n]=e(o[n]);return o.join(",")}if(b=(a.match(pa)||[f])[0],m=a.split(b).join("").match(u)||[],n=m.length,k>n--)for(;++n<k;)m[n]=c?m[(n-1)/2|0]:g[n];return h+m.join(j)+j+b+i+(-1!==a.indexOf("inset")?" inset":"")}:function(a){var b,f,m;if("number"==typeof a)a+=l;else if(d&&I.test(a)){for(f=a.replace(I,"|").split("|"),m=0;m<f.length;m++)f[m]=e(f[m]);return f.join(",")}if(b=a.match(u)||[],m=b.length,k>m--)for(;++m<k;)b[m]=c?b[(m-1)/2|0]:g[m];return h+b.join(j)+i}:function(a){return a}},ra=function(a){return a=a.split(","),function(b,c,d,e,f,g,h){var i,j=(c+"").split(" ");for(h={},i=0;4>i;i++)h[a[i]]=j[i]=j[i]||j[(i-1)/2>>0];return e.parse(b,h,f,g)}},sa=(S._setPluginRatio=function(a){this.plugin.setRatio(a);for(var b,c,d,e,f,g=this.data,h=g.proxy,i=g.firstMPT,j=1e-6;i;)b=h[i.v],i.r?b=Math.round(b):j>b&&b>-j&&(b=0),i.t[i.p]=b,i=i._next;if(g.autoRotate&&(g.autoRotate.rotation=g.mod?g.mod(h.rotation,this.t):h.rotation),1===a||0===a)for(i=g.firstMPT,f=1===a?"e":"b";i;){if(c=i.t,c.type){if(1===c.type){for(e=c.xs0+c.s+c.xs1,d=1;d<c.l;d++)e+=c["xn"+d]+c["xs"+(d+1)];c[f]=e}}else c[f]=c.s+c.xs0;i=i._next}},function(a,b,c,d,e){this.t=a,this.p=b,this.v=c,this.r=e,d&&(d._prev=this,this._next=d)}),ta=(S._parseToProxy=function(a,b,c,d,e,f){var g,h,i,j,k,l=d,m={},n={},o=c._transform,p=M;for(c._transform=null,M=b,d=k=c.parse(a,b,d,e),M=p,f&&(c._transform=o,l&&(l._prev=null,l._prev&&(l._prev._next=null)));d&&d!==l;){if(d.type<=1&&(h=d.p,n[h]=d.s+d.c,m[h]=d.s,f||(j=new sa(d,"s",h,j,d.r),d.c=0),1===d.type))for(g=d.l;--g>0;)i="xn"+g,h=d.p+"_"+i,n[h]=d.data[i],m[h]=d[i],f||(j=new sa(d,i,h,j,d.rxp[i]));d=d._next}return{proxy:m,end:n,firstMPT:j,pt:k}},S.CSSPropTween=function(a,b,d,e,g,h,i,j,k,l,m){this.t=a,this.p=b,this.s=d,this.c=e,this.n=i||b,a instanceof ta||f.push(this.n),this.r=j,this.type=h||0,k&&(this.pr=k,c=!0),this.b=void 0===l?d:l,this.e=void 0===m?d+e:m,g&&(this._next=g,g._prev=this)}),ua=function(a,b,c,d,e,f){var g=new ta(a,b,c,d-c,e,-1,f);return g.b=c,g.e=g.xs0=d,g},va=g.parseComplex=function(a,b,c,d,e,f,h,i,j,l){c=c||f||"","function"==typeof d&&(d=d(r,q)),h=new ta(a,b,0,0,h,l?2:1,null,!1,i,c,d),d+="",e&&pa.test(d+c)&&(d=[c,d],g.colorStringFilter(d),c=d[0],d=d[1]);var m,n,o,p,u,v,w,x,y,z,A,B,C,D=c.split(", ").join(",").split(" "),E=d.split(", ").join(",").split(" "),F=D.length,G=k!==!1;for((-1!==d.indexOf(",")||-1!==c.indexOf(","))&&(D=D.join(" ").replace(I,", ").split(" "),E=E.join(" ").replace(I,", ").split(" "),F=D.length),F!==E.length&&(D=(f||"").split(" "),F=D.length),h.plugin=j,h.setRatio=l,pa.lastIndex=0,m=0;F>m;m++)if(p=D[m],u=E[m],x=parseFloat(p),x||0===x)h.appendXtra("",x,ia(u,x),u.replace(t,""),G&&-1!==u.indexOf("px"),!0);else if(e&&pa.test(p))B=u.indexOf(")")+1,B=")"+(B?u.substr(B):""),C=-1!==u.indexOf("hsl")&&U,p=na(p,C),u=na(u,C),y=p.length+u.length>6,y&&!U&&0===u[3]?(h["xs"+h.l]+=h.l?" transparent":"transparent",h.e=h.e.split(E[m]).join("transparent")):(U||(y=!1),C?h.appendXtra(y?"hsla(":"hsl(",p[0],ia(u[0],p[0]),",",!1,!0).appendXtra("",p[1],ia(u[1],p[1]),"%,",!1).appendXtra("",p[2],ia(u[2],p[2]),y?"%,":"%"+B,!1):h.appendXtra(y?"rgba(":"rgb(",p[0],u[0]-p[0],",",!0,!0).appendXtra("",p[1],u[1]-p[1],",",!0).appendXtra("",p[2],u[2]-p[2],y?",":B,!0),y&&(p=p.length<4?1:p[3],h.appendXtra("",p,(u.length<4?1:u[3])-p,B,!1))),pa.lastIndex=0;else if(v=p.match(s)){if(w=u.match(t),!w||w.length!==v.length)return h;for(o=0,n=0;n<v.length;n++)A=v[n],z=p.indexOf(A,o),h.appendXtra(p.substr(o,z-o),Number(A),ia(w[n],A),"",G&&"px"===p.substr(z+A.length,2),0===n),o=z+A.length;h["xs"+h.l]+=p.substr(o)}else h["xs"+h.l]+=h.l||h["xs"+h.l]?" "+u:u;if(-1!==d.indexOf("=")&&h.data){for(B=h.xs0+h.data.s,m=1;m<h.l;m++)B+=h["xs"+m]+h.data["xn"+m];h.e=B+h["xs"+m]}return h.l||(h.type=-1,h.xs0=h.e),h.xfirst||h},wa=9;for(j=ta.prototype,j.l=j.pr=0;--wa>0;)j["xn"+wa]=0,j["xs"+wa]="";j.xs0="",j._next=j._prev=j.xfirst=j.data=j.plugin=j.setRatio=j.rxp=null,j.appendXtra=function(a,b,c,d,e,f){var g=this,h=g.l;return g["xs"+h]+=f&&(h||g["xs"+h])?" "+a:a||"",c||0===h||g.plugin?(g.l++,g.type=g.setRatio?2:1,g["xs"+g.l]=d||"",h>0?(g.data["xn"+h]=b+c,g.rxp["xn"+h]=e,g["xn"+h]=b,g.plugin||(g.xfirst=new ta(g,"xn"+h,b,c,g.xfirst||g,0,g.n,e,g.pr),g.xfirst.xs0=0),g):(g.data={s:b+c},g.rxp={},g.s=b,g.c=c,g.r=e,g)):(g["xs"+h]+=b+(d||""),g)};var xa=function(a,b){b=b||{},this.p=b.prefix?Z(a)||a:a,i[a]=i[this.p]=this,this.format=b.formatter||qa(b.defaultValue,b.color,b.collapsible,b.multi),b.parser&&(this.parse=b.parser),this.clrs=b.color,this.multi=b.multi,this.keyword=b.keyword,this.dflt=b.defaultValue,this.pr=b.priority||0},ya=S._registerComplexSpecialProp=function(a,b,c){"object"!=typeof b&&(b={parser:c});var d,e,f=a.split(","),g=b.defaultValue;for(c=c||[g],d=0;d<f.length;d++)b.prefix=0===d&&b.prefix,b.defaultValue=c[d]||g,e=new xa(f[d],b)},za=S._registerPluginProp=function(a){if(!i[a]){var b=a.charAt(0).toUpperCase()+a.substr(1)+"Plugin";ya(a,{parser:function(a,c,d,e,f,g,j){var k=h.com.greensock.plugins[b];return k?(k._cssRegister(),i[d].parse(a,c,d,e,f,g,j)):(W("Error: "+b+" js file not loaded."),f)}})}};j=xa.prototype,j.parseComplex=function(a,b,c,d,e,f){var g,h,i,j,k,l,m=this.keyword;if(this.multi&&(I.test(c)||I.test(b)?(h=b.replace(I,"|").split("|"),i=c.replace(I,"|").split("|")):m&&(h=[b],i=[c])),i){for(j=i.length>h.length?i.length:h.length,g=0;j>g;g++)b=h[g]=h[g]||this.dflt,c=i[g]=i[g]||this.dflt,m&&(k=b.indexOf(m),l=c.indexOf(m),k!==l&&(-1===l?h[g]=h[g].split(m).join(""):-1===k&&(h[g]+=" "+m)));b=h.join(", "),c=i.join(", ")}return va(a,this.p,b,c,this.clrs,this.dflt,d,this.pr,e,f)},j.parse=function(a,b,c,d,f,g,h){return this.parseComplex(a.style,this.format(_(a,this.p,e,!1,this.dflt)),this.format(b),f,g)},g.registerSpecialProp=function(a,b,c){ya(a,{parser:function(a,d,e,f,g,h,i){var j=new ta(a,e,0,0,g,2,e,!1,c);return j.plugin=h,j.setRatio=b(a,d,f._tween,e),j},priority:c})},g.useSVGTransformAttr=!0;var Aa,Ba="scaleX,scaleY,scaleZ,x,y,z,skewX,skewY,rotation,rotationX,rotationY,perspective,xPercent,yPercent".split(","),Ca=Z("transform"),Da=X+"transform",Ea=Z("transformOrigin"),Fa=null!==Z("perspective"),Ga=S.Transform=function(){this.perspective=parseFloat(g.defaultTransformPerspective)||0,this.force3D=g.defaultForce3D!==!1&&Fa?g.defaultForce3D||"auto":!1},Ha=_gsScope.SVGElement,Ia=function(a,b,c){var d,e=O.createElementNS("http://www.w3.org/2000/svg",a),f=/([a-z])([A-Z])/g;for(d in c)e.setAttributeNS(null,d.replace(f,"$1-$2").toLowerCase(),c[d]);return b.appendChild(e),e},Ja=O.documentElement||{},Ka=function(){var a,b,c,d=p||/Android/i.test(T)&&!_gsScope.chrome;return O.createElementNS&&!d&&(a=Ia("svg",Ja),b=Ia("rect",a,{width:100,height:50,x:100}),c=b.getBoundingClientRect().width,b.style[Ea]="50% 50%",b.style[Ca]="scaleX(0.5)",d=c===b.getBoundingClientRect().width&&!(n&&Fa),Ja.removeChild(a)),d}(),La=function(a,b,c,d,e,f){var h,i,j,k,l,m,n,o,p,q,r,s,t,u,v=a._gsTransform,w=Qa(a,!0);v&&(t=v.xOrigin,u=v.yOrigin),(!d||(h=d.split(" ")).length<2)&&(n=a.getBBox(),0===n.x&&0===n.y&&n.width+n.height===0&&(n={x:parseFloat(a.hasAttribute("x")?a.getAttribute("x"):a.hasAttribute("cx")?a.getAttribute("cx"):0)||0,y:parseFloat(a.hasAttribute("y")?a.getAttribute("y"):a.hasAttribute("cy")?a.getAttribute("cy"):0)||0,width:0,height:0}),b=ha(b).split(" "),h=[(-1!==b[0].indexOf("%")?parseFloat(b[0])/100*n.width:parseFloat(b[0]))+n.x,(-1!==b[1].indexOf("%")?parseFloat(b[1])/100*n.height:parseFloat(b[1]))+n.y]),c.xOrigin=k=parseFloat(h[0]),c.yOrigin=l=parseFloat(h[1]),d&&w!==Pa&&(m=w[0],n=w[1],o=w[2],p=w[3],q=w[4],r=w[5],s=m*p-n*o,s&&(i=k*(p/s)+l*(-o/s)+(o*r-p*q)/s,j=k*(-n/s)+l*(m/s)-(m*r-n*q)/s,k=c.xOrigin=h[0]=i,l=c.yOrigin=h[1]=j)),v&&(f&&(c.xOffset=v.xOffset,c.yOffset=v.yOffset,v=c),e||e!==!1&&g.defaultSmoothOrigin!==!1?(i=k-t,j=l-u,v.xOffset+=i*w[0]+j*w[2]-i,v.yOffset+=i*w[1]+j*w[3]-j):v.xOffset=v.yOffset=0),f||a.setAttribute("data-svg-origin",h.join(" "))},Ma=function(a){var b,c=P("svg",this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),d=this.parentNode,e=this.nextSibling,f=this.style.cssText;if(Ja.appendChild(c),c.appendChild(this),this.style.display="block",a)try{b=this.getBBox(),this._originalGetBBox=this.getBBox,this.getBBox=Ma}catch(g){}else this._originalGetBBox&&(b=this._originalGetBBox());return e?d.insertBefore(this,e):d.appendChild(this),Ja.removeChild(c),this.style.cssText=f,b},Na=function(a){try{return a.getBBox()}catch(b){return Ma.call(a,!0)}},Oa=function(a){return!(!(Ha&&a.getCTM&&Na(a))||a.parentNode&&!a.ownerSVGElement)},Pa=[1,0,0,1,0,0],Qa=function(a,b){var c,d,e,f,g,h,i=a._gsTransform||new Ga,j=1e5,k=a.style;if(Ca?d=_(a,Da,null,!0):a.currentStyle&&(d=a.currentStyle.filter.match(G),d=d&&4===d.length?[d[0].substr(4),Number(d[2].substr(4)),Number(d[1].substr(4)),d[3].substr(4),i.x||0,i.y||0].join(","):""),c=!d||"none"===d||"matrix(1, 0, 0, 1, 0, 0)"===d,c&&Ca&&((h="none"===$(a).display)||!a.parentNode)&&(h&&(f=k.display,k.display="block"),a.parentNode||(g=1,Ja.appendChild(a)),d=_(a,Da,null,!0),c=!d||"none"===d||"matrix(1, 0, 0, 1, 0, 0)"===d,f?k.display=f:h&&Va(k,"display"),g&&Ja.removeChild(a)),(i.svg||a.getCTM&&Oa(a))&&(c&&-1!==(k[Ca]+"").indexOf("matrix")&&(d=k[Ca],c=0),e=a.getAttribute("transform"),c&&e&&(-1!==e.indexOf("matrix")?(d=e,c=0):-1!==e.indexOf("translate")&&(d="matrix(1,0,0,1,"+e.match(/(?:\-|\b)[\d\-\.e]+\b/gi).join(",")+")",c=0))),c)return Pa;for(e=(d||"").match(s)||[],wa=e.length;--wa>-1;)f=Number(e[wa]),e[wa]=(g=f-(f|=0))?(g*j+(0>g?-.5:.5)|0)/j+f:f;return b&&e.length>6?[e[0],e[1],e[4],e[5],e[12],e[13]]:e},Ra=S.getTransform=function(a,c,d,e){if(a._gsTransform&&d&&!e)return a._gsTransform;var f,h,i,j,k,l,m=d?a._gsTransform||new Ga:new Ga,n=m.scaleX<0,o=2e-5,p=1e5,q=Fa?parseFloat(_(a,Ea,c,!1,"0 0 0").split(" ")[2])||m.zOrigin||0:0,r=parseFloat(g.defaultTransformPerspective)||0;if(m.svg=!(!a.getCTM||!Oa(a)),m.svg&&(La(a,_(a,Ea,c,!1,"50% 50%")+"",m,a.getAttribute("data-svg-origin")),Aa=g.useSVGTransformAttr||Ka),f=Qa(a),f!==Pa){if(16===f.length){var s,t,u,v,w,x=f[0],y=f[1],z=f[2],A=f[3],B=f[4],C=f[5],D=f[6],E=f[7],F=f[8],G=f[9],H=f[10],I=f[12],J=f[13],K=f[14],M=f[11],N=Math.atan2(D,H);m.zOrigin&&(K=-m.zOrigin,I=F*K-f[12],J=G*K-f[13],K=H*K+m.zOrigin-f[14]),m.rotationX=N*L,N&&(v=Math.cos(-N),w=Math.sin(-N),s=B*v+F*w,t=C*v+G*w,u=D*v+H*w,F=B*-w+F*v,G=C*-w+G*v,H=D*-w+H*v,M=E*-w+M*v,B=s,C=t,D=u),N=Math.atan2(-z,H),m.rotationY=N*L,N&&(v=Math.cos(-N),w=Math.sin(-N),s=x*v-F*w,t=y*v-G*w,u=z*v-H*w,G=y*w+G*v,H=z*w+H*v,M=A*w+M*v,x=s,y=t,z=u),N=Math.atan2(y,x),m.rotation=N*L,N&&(v=Math.cos(-N),w=Math.sin(-N),x=x*v+B*w,t=y*v+C*w,C=y*-w+C*v,D=z*-w+D*v,y=t),m.rotationX&&Math.abs(m.rotationX)+Math.abs(m.rotation)>359.9&&(m.rotationX=m.rotation=0,m.rotationY=180-m.rotationY),m.scaleX=(Math.sqrt(x*x+y*y)*p+.5|0)/p,m.scaleY=(Math.sqrt(C*C+G*G)*p+.5|0)/p,m.scaleZ=(Math.sqrt(D*D+H*H)*p+.5|0)/p,m.rotationX||m.rotationY?m.skewX=0:(m.skewX=B||C?Math.atan2(B,C)*L+m.rotation:m.skewX||0,Math.abs(m.skewX)>90&&Math.abs(m.skewX)<270&&(n?(m.scaleX*=-1,m.skewX+=m.rotation<=0?180:-180,m.rotation+=m.rotation<=0?180:-180):(m.scaleY*=-1,m.skewX+=m.skewX<=0?180:-180))),m.perspective=M?1/(0>M?-M:M):0,m.x=I,m.y=J,m.z=K,m.svg&&(m.x-=m.xOrigin-(m.xOrigin*x-m.yOrigin*B),m.y-=m.yOrigin-(m.yOrigin*y-m.xOrigin*C))}else if(!Fa||e||!f.length||m.x!==f[4]||m.y!==f[5]||!m.rotationX&&!m.rotationY){var O=f.length>=6,P=O?f[0]:1,Q=f[1]||0,R=f[2]||0,S=O?f[3]:1;m.x=f[4]||0,m.y=f[5]||0,i=Math.sqrt(P*P+Q*Q),j=Math.sqrt(S*S+R*R),k=P||Q?Math.atan2(Q,P)*L:m.rotation||0,l=R||S?Math.atan2(R,S)*L+k:m.skewX||0,Math.abs(l)>90&&Math.abs(l)<270&&(n?(i*=-1,l+=0>=k?180:-180,k+=0>=k?180:-180):(j*=-1,l+=0>=l?180:-180)),m.scaleX=i,m.scaleY=j,m.rotation=k,m.skewX=l,Fa&&(m.rotationX=m.rotationY=m.z=0,m.perspective=r,m.scaleZ=1),m.svg&&(m.x-=m.xOrigin-(m.xOrigin*P+m.yOrigin*R),m.y-=m.yOrigin-(m.xOrigin*Q+m.yOrigin*S))}m.zOrigin=q;for(h in m)m[h]<o&&m[h]>-o&&(m[h]=0)}return d&&(a._gsTransform=m,m.svg&&(Aa&&a.style[Ca]?b.delayedCall(.001,function(){Va(a.style,Ca)}):!Aa&&a.getAttribute("transform")&&b.delayedCall(.001,function(){a.removeAttribute("transform")}))),m},Sa=function(a){var b,c,d=this.data,e=-d.rotation*K,f=e+d.skewX*K,g=1e5,h=(Math.cos(e)*d.scaleX*g|0)/g,i=(Math.sin(e)*d.scaleX*g|0)/g,j=(Math.sin(f)*-d.scaleY*g|0)/g,k=(Math.cos(f)*d.scaleY*g|0)/g,l=this.t.style,m=this.t.currentStyle;if(m){c=i,i=-j,j=-c,b=m.filter,l.filter="";var n,o,q=this.t.offsetWidth,r=this.t.offsetHeight,s="absolute"!==m.position,t="progid:DXImageTransform.Microsoft.Matrix(M11="+h+", M12="+i+", M21="+j+", M22="+k,u=d.x+q*d.xPercent/100,v=d.y+r*d.yPercent/100;if(null!=d.ox&&(n=(d.oxp?q*d.ox*.01:d.ox)-q/2,o=(d.oyp?r*d.oy*.01:d.oy)-r/2,u+=n-(n*h+o*i),v+=o-(n*j+o*k)),s?(n=q/2,o=r/2,t+=", Dx="+(n-(n*h+o*i)+u)+", Dy="+(o-(n*j+o*k)+v)+")"):t+=", sizingMethod='auto expand')",-1!==b.indexOf("DXImageTransform.Microsoft.Matrix(")?l.filter=b.replace(H,t):l.filter=t+" "+b,(0===a||1===a)&&1===h&&0===i&&0===j&&1===k&&(s&&-1===t.indexOf("Dx=0, Dy=0")||x.test(b)&&100!==parseFloat(RegExp.$1)||-1===b.indexOf(b.indexOf("Alpha"))&&l.removeAttribute("filter")),!s){var y,z,A,B=8>p?1:-1;for(n=d.ieOffsetX||0,o=d.ieOffsetY||0,d.ieOffsetX=Math.round((q-((0>h?-h:h)*q+(0>i?-i:i)*r))/2+u),d.ieOffsetY=Math.round((r-((0>k?-k:k)*r+(0>j?-j:j)*q))/2+v),wa=0;4>wa;wa++)z=fa[wa],y=m[z],c=-1!==y.indexOf("px")?parseFloat(y):aa(this.t,z,parseFloat(y),y.replace(w,""))||0,A=c!==d[z]?2>wa?-d.ieOffsetX:-d.ieOffsetY:2>wa?n-d.ieOffsetX:o-d.ieOffsetY,l[z]=(d[z]=Math.round(c-A*(0===wa||2===wa?1:B)))+"px"}}},Ta=S.set3DTransformRatio=S.setTransformRatio=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,o,p,q,r,s,t,u,v,w,x,y,z=this.data,A=this.t.style,B=z.rotation,C=z.rotationX,D=z.rotationY,E=z.scaleX,F=z.scaleY,G=z.scaleZ,H=z.x,I=z.y,J=z.z,L=z.svg,M=z.perspective,N=z.force3D,O=z.skewY,P=z.skewX;if(O&&(P+=O,B+=O),((1===a||0===a)&&"auto"===N&&(this.tween._totalTime===this.tween._totalDuration||!this.tween._totalTime)||!N)&&!J&&!M&&!D&&!C&&1===G||Aa&&L||!Fa)return void(B||P||L?(B*=K,x=P*K,y=1e5,c=Math.cos(B)*E,f=Math.sin(B)*E,d=Math.sin(B-x)*-F,g=Math.cos(B-x)*F,x&&"simple"===z.skewType&&(b=Math.tan(x-O*K),b=Math.sqrt(1+b*b),d*=b,g*=b,O&&(b=Math.tan(O*K),b=Math.sqrt(1+b*b),c*=b,f*=b)),L&&(H+=z.xOrigin-(z.xOrigin*c+z.yOrigin*d)+z.xOffset,I+=z.yOrigin-(z.xOrigin*f+z.yOrigin*g)+z.yOffset,Aa&&(z.xPercent||z.yPercent)&&(q=this.t.getBBox(),H+=.01*z.xPercent*q.width,I+=.01*z.yPercent*q.height),q=1e-6,q>H&&H>-q&&(H=0),q>I&&I>-q&&(I=0)),u=(c*y|0)/y+","+(f*y|0)/y+","+(d*y|0)/y+","+(g*y|0)/y+","+H+","+I+")",L&&Aa?this.t.setAttribute("transform","matrix("+u):A[Ca]=(z.xPercent||z.yPercent?"translate("+z.xPercent+"%,"+z.yPercent+"%) matrix(":"matrix(")+u):A[Ca]=(z.xPercent||z.yPercent?"translate("+z.xPercent+"%,"+z.yPercent+"%) matrix(":"matrix(")+E+",0,0,"+F+","+H+","+I+")");if(n&&(q=1e-4,q>E&&E>-q&&(E=G=2e-5),q>F&&F>-q&&(F=G=2e-5),!M||z.z||z.rotationX||z.rotationY||(M=0)),B||P)B*=K,r=c=Math.cos(B),s=f=Math.sin(B),P&&(B-=P*K,r=Math.cos(B),s=Math.sin(B),"simple"===z.skewType&&(b=Math.tan((P-O)*K),b=Math.sqrt(1+b*b),r*=b,s*=b,z.skewY&&(b=Math.tan(O*K),b=Math.sqrt(1+b*b),c*=b,f*=b))),d=-s,g=r;else{if(!(D||C||1!==G||M||L))return void(A[Ca]=(z.xPercent||z.yPercent?"translate("+z.xPercent+"%,"+z.yPercent+"%) translate3d(":"translate3d(")+H+"px,"+I+"px,"+J+"px)"+(1!==E||1!==F?" scale("+E+","+F+")":""));c=g=1,d=f=0}k=1,e=h=i=j=l=m=0,o=M?-1/M:0,p=z.zOrigin,q=1e-6,v=",",w="0",B=D*K,B&&(r=Math.cos(B),s=Math.sin(B),i=-s,l=o*-s,e=c*s,h=f*s,k=r,o*=r,c*=r,f*=r),B=C*K,B&&(r=Math.cos(B),s=Math.sin(B),b=d*r+e*s,t=g*r+h*s,j=k*s,m=o*s,e=d*-s+e*r,h=g*-s+h*r,k*=r,o*=r,d=b,g=t),1!==G&&(e*=G,h*=G,k*=G,o*=G),1!==F&&(d*=F,g*=F,j*=F,m*=F),1!==E&&(c*=E,f*=E,i*=E,l*=E),(p||L)&&(p&&(H+=e*-p,I+=h*-p,J+=k*-p+p),L&&(H+=z.xOrigin-(z.xOrigin*c+z.yOrigin*d)+z.xOffset,I+=z.yOrigin-(z.xOrigin*f+z.yOrigin*g)+z.yOffset),q>H&&H>-q&&(H=w),q>I&&I>-q&&(I=w),q>J&&J>-q&&(J=0)),u=z.xPercent||z.yPercent?"translate("+z.xPercent+"%,"+z.yPercent+"%) matrix3d(":"matrix3d(",u+=(q>c&&c>-q?w:c)+v+(q>f&&f>-q?w:f)+v+(q>i&&i>-q?w:i),u+=v+(q>l&&l>-q?w:l)+v+(q>d&&d>-q?w:d)+v+(q>g&&g>-q?w:g),C||D||1!==G?(u+=v+(q>j&&j>-q?w:j)+v+(q>m&&m>-q?w:m)+v+(q>e&&e>-q?w:e),u+=v+(q>h&&h>-q?w:h)+v+(q>k&&k>-q?w:k)+v+(q>o&&o>-q?w:o)+v):u+=",0,0,0,0,1,0,",u+=H+v+I+v+J+v+(M?1+-J/M:1)+")",A[Ca]=u};j=Ga.prototype,j.x=j.y=j.z=j.skewX=j.skewY=j.rotation=j.rotationX=j.rotationY=j.zOrigin=j.xPercent=j.yPercent=j.xOffset=j.yOffset=0,j.scaleX=j.scaleY=j.scaleZ=1,ya("transform,scale,scaleX,scaleY,scaleZ,x,y,z,rotation,rotationX,rotationY,rotationZ,skewX,skewY,shortRotation,shortRotationX,shortRotationY,shortRotationZ,transformOrigin,svgOrigin,transformPerspective,directionalRotation,parseTransform,force3D,skewType,xPercent,yPercent,smoothOrigin",{parser:function(a,b,c,d,f,h,i){if(d._lastParsedTransform===i)return f;d._lastParsedTransform=i;var j,k=i.scale&&"function"==typeof i.scale?i.scale:0;"function"==typeof i[c]&&(j=i[c],i[c]=b),k&&(i.scale=k(r,a));var l,m,n,o,p,s,t,u,v,w=a._gsTransform,x=a.style,y=1e-6,z=Ba.length,A=i,B={},C="transformOrigin",D=Ra(a,e,!0,A.parseTransform),E=A.transform&&("function"==typeof A.transform?A.transform(r,q):A.transform);if(d._transform=D,E&&"string"==typeof E&&Ca)m=Q.style,m[Ca]=E,m.display="block",m.position="absolute",O.body.appendChild(Q),l=Ra(Q,null,!1),D.svg&&(s=D.xOrigin,t=D.yOrigin,l.x-=D.xOffset,l.y-=D.yOffset,(A.transformOrigin||A.svgOrigin)&&(E={},La(a,ha(A.transformOrigin),E,A.svgOrigin,A.smoothOrigin,!0),s=E.xOrigin,t=E.yOrigin,l.x-=E.xOffset-D.xOffset,l.y-=E.yOffset-D.yOffset),(s||t)&&(u=Qa(Q,!0),l.x-=s-(s*u[0]+t*u[2]),l.y-=t-(s*u[1]+t*u[3]))),O.body.removeChild(Q),l.perspective||(l.perspective=D.perspective),null!=A.xPercent&&(l.xPercent=ja(A.xPercent,D.xPercent)),null!=A.yPercent&&(l.yPercent=ja(A.yPercent,D.yPercent));else if("object"==typeof A){if(l={scaleX:ja(null!=A.scaleX?A.scaleX:A.scale,D.scaleX),scaleY:ja(null!=A.scaleY?A.scaleY:A.scale,D.scaleY),scaleZ:ja(A.scaleZ,D.scaleZ),x:ja(A.x,D.x),y:ja(A.y,D.y),z:ja(A.z,D.z),xPercent:ja(A.xPercent,D.xPercent),yPercent:ja(A.yPercent,D.yPercent),perspective:ja(A.transformPerspective,D.perspective)},p=A.directionalRotation,null!=p)if("object"==typeof p)for(m in p)A[m]=p[m];else A.rotation=p;"string"==typeof A.x&&-1!==A.x.indexOf("%")&&(l.x=0,l.xPercent=ja(A.x,D.xPercent)),"string"==typeof A.y&&-1!==A.y.indexOf("%")&&(l.y=0,l.yPercent=ja(A.y,D.yPercent)),l.rotation=ka("rotation"in A?A.rotation:"shortRotation"in A?A.shortRotation+"_short":"rotationZ"in A?A.rotationZ:D.rotation,D.rotation,"rotation",B),Fa&&(l.rotationX=ka("rotationX"in A?A.rotationX:"shortRotationX"in A?A.shortRotationX+"_short":D.rotationX||0,D.rotationX,"rotationX",B),l.rotationY=ka("rotationY"in A?A.rotationY:"shortRotationY"in A?A.shortRotationY+"_short":D.rotationY||0,D.rotationY,"rotationY",B)),l.skewX=ka(A.skewX,D.skewX),l.skewY=ka(A.skewY,D.skewY)}for(Fa&&null!=A.force3D&&(D.force3D=A.force3D,o=!0),D.skewType=A.skewType||D.skewType||g.defaultSkewType,n=D.force3D||D.z||D.rotationX||D.rotationY||l.z||l.rotationX||l.rotationY||l.perspective,n||null==A.scale||(l.scaleZ=1);--z>-1;)v=Ba[z],E=l[v]-D[v],(E>y||-y>E||null!=A[v]||null!=M[v])&&(o=!0,f=new ta(D,v,D[v],E,f),v in B&&(f.e=B[v]),f.xs0=0,f.plugin=h,d._overwriteProps.push(f.n));return E=A.transformOrigin,D.svg&&(E||A.svgOrigin)&&(s=D.xOffset,t=D.yOffset,La(a,ha(E),l,A.svgOrigin,A.smoothOrigin),f=ua(D,"xOrigin",(w?D:l).xOrigin,l.xOrigin,f,C),f=ua(D,"yOrigin",(w?D:l).yOrigin,l.yOrigin,f,C),(s!==D.xOffset||t!==D.yOffset)&&(f=ua(D,"xOffset",w?s:D.xOffset,D.xOffset,f,C),f=ua(D,"yOffset",w?t:D.yOffset,D.yOffset,f,C)),E="0px 0px"),(E||Fa&&n&&D.zOrigin)&&(Ca?(o=!0,v=Ea,E=(E||_(a,v,e,!1,"50% 50%"))+"",f=new ta(x,v,0,0,f,-1,C),f.b=x[v],f.plugin=h,Fa?(m=D.zOrigin,E=E.split(" "),D.zOrigin=(E.length>2&&(0===m||"0px"!==E[2])?parseFloat(E[2]):m)||0,f.xs0=f.e=E[0]+" "+(E[1]||"50%")+" 0px",f=new ta(D,"zOrigin",0,0,f,-1,f.n),f.b=m,f.xs0=f.e=D.zOrigin):f.xs0=f.e=E):ha(E+"",D)),o&&(d._transformType=D.svg&&Aa||!n&&3!==this._transformType?2:3),j&&(i[c]=j),k&&(i.scale=k),f},prefix:!0}),ya("boxShadow",{defaultValue:"0px 0px 0px 0px #999",prefix:!0,color:!0,multi:!0,keyword:"inset"}),ya("borderRadius",{defaultValue:"0px",parser:function(a,b,c,f,g,h){b=this.format(b);var i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],z=a.style;for(q=parseFloat(a.offsetWidth),r=parseFloat(a.offsetHeight),i=b.split(" "),j=0;j<y.length;j++)this.p.indexOf("border")&&(y[j]=Z(y[j])),m=l=_(a,y[j],e,!1,"0px"),-1!==m.indexOf(" ")&&(l=m.split(" "),m=l[0],l=l[1]),n=k=i[j],o=parseFloat(m),t=m.substr((o+"").length),u="="===n.charAt(1),u?(p=parseInt(n.charAt(0)+"1",10),n=n.substr(2),p*=parseFloat(n),s=n.substr((p+"").length-(0>p?1:0))||""):(p=parseFloat(n),s=n.substr((p+"").length)),""===s&&(s=d[c]||t),s!==t&&(v=aa(a,"borderLeft",o,t),w=aa(a,"borderTop",o,t),"%"===s?(m=v/q*100+"%",l=w/r*100+"%"):"em"===s?(x=aa(a,"borderLeft",1,"em"),m=v/x+"em",l=w/x+"em"):(m=v+"px",l=w+"px"),u&&(n=parseFloat(m)+p+s,k=parseFloat(l)+p+s)),g=va(z,y[j],m+" "+l,n+" "+k,!1,"0px",g);return g},prefix:!0,formatter:qa("0px 0px 0px 0px",!1,!0)}),ya("borderBottomLeftRadius,borderBottomRightRadius,borderTopLeftRadius,borderTopRightRadius",{defaultValue:"0px",parser:function(a,b,c,d,f,g){return va(a.style,c,this.format(_(a,c,e,!1,"0px 0px")),this.format(b),!1,"0px",f)},prefix:!0,formatter:qa("0px 0px",!1,!0)}),ya("backgroundPosition",{defaultValue:"0 0",parser:function(a,b,c,d,f,g){var h,i,j,k,l,m,n="background-position",o=e||$(a,null),q=this.format((o?p?o.getPropertyValue(n+"-x")+" "+o.getPropertyValue(n+"-y"):o.getPropertyValue(n):a.currentStyle.backgroundPositionX+" "+a.currentStyle.backgroundPositionY)||"0 0"),r=this.format(b);if(-1!==q.indexOf("%")!=(-1!==r.indexOf("%"))&&r.split(",").length<2&&(m=_(a,"backgroundImage").replace(D,""),m&&"none"!==m)){for(h=q.split(" "),i=r.split(" "),R.setAttribute("src",m),j=2;--j>-1;)q=h[j],k=-1!==q.indexOf("%"),k!==(-1!==i[j].indexOf("%"))&&(l=0===j?a.offsetWidth-R.width:a.offsetHeight-R.height,h[j]=k?parseFloat(q)/100*l+"px":parseFloat(q)/l*100+"%");q=h.join(" ")}return this.parseComplex(a.style,q,r,f,g)},formatter:ha}),ya("backgroundSize",{defaultValue:"0 0",formatter:function(a){return a+="",ha(-1===a.indexOf(" ")?a+" "+a:a)}}),ya("perspective",{defaultValue:"0px",prefix:!0}),ya("perspectiveOrigin",{defaultValue:"50% 50%",prefix:!0}),ya("transformStyle",{prefix:!0}),ya("backfaceVisibility",{prefix:!0}),ya("userSelect",{prefix:!0}),ya("margin",{parser:ra("marginTop,marginRight,marginBottom,marginLeft")}),ya("padding",{parser:ra("paddingTop,paddingRight,paddingBottom,paddingLeft")}),ya("clip",{defaultValue:"rect(0px,0px,0px,0px)",parser:function(a,b,c,d,f,g){var h,i,j;return 9>p?(i=a.currentStyle,j=8>p?" ":",",h="rect("+i.clipTop+j+i.clipRight+j+i.clipBottom+j+i.clipLeft+")",b=this.format(b).split(",").join(j)):(h=this.format(_(a,this.p,e,!1,this.dflt)),b=this.format(b)),this.parseComplex(a.style,h,b,f,g)}}),ya("textShadow",{defaultValue:"0px 0px 0px #999",color:!0,multi:!0}),ya("autoRound,strictUnits",{parser:function(a,b,c,d,e){return e}}),ya("border",{defaultValue:"0px solid #000",parser:function(a,b,c,d,f,g){var h=_(a,"borderTopWidth",e,!1,"0px"),i=this.format(b).split(" "),j=i[0].replace(w,"");return"px"!==j&&(h=parseFloat(h)/aa(a,"borderTopWidth",1,j)+j),this.parseComplex(a.style,this.format(h+" "+_(a,"borderTopStyle",e,!1,"solid")+" "+_(a,"borderTopColor",e,!1,"#000")),i.join(" "),f,g)},color:!0,formatter:function(a){var b=a.split(" ");return b[0]+" "+(b[1]||"solid")+" "+(a.match(pa)||["#000"])[0]}}),ya("borderWidth",{parser:ra("borderTopWidth,borderRightWidth,borderBottomWidth,borderLeftWidth")}),ya("float,cssFloat,styleFloat",{parser:function(a,b,c,d,e,f){var g=a.style,h="cssFloat"in g?"cssFloat":"styleFloat";return new ta(g,h,0,0,e,-1,c,!1,0,g[h],b)}});var Ua=function(a){var b,c=this.t,d=c.filter||_(this.data,"filter")||"",e=this.s+this.c*a|0;100===e&&(-1===d.indexOf("atrix(")&&-1===d.indexOf("radient(")&&-1===d.indexOf("oader(")?(c.removeAttribute("filter"),b=!_(this.data,"filter")):(c.filter=d.replace(z,""),b=!0)),b||(this.xn1&&(c.filter=d=d||"alpha(opacity="+e+")"),-1===d.indexOf("pacity")?0===e&&this.xn1||(c.filter=d+" alpha(opacity="+e+")"):c.filter=d.replace(x,"opacity="+e))};ya("opacity,alpha,autoAlpha",{defaultValue:"1",parser:function(a,b,c,d,f,g){var h=parseFloat(_(a,"opacity",e,!1,"1")),i=a.style,j="autoAlpha"===c;return"string"==typeof b&&"="===b.charAt(1)&&(b=("-"===b.charAt(0)?-1:1)*parseFloat(b.substr(2))+h),j&&1===h&&"hidden"===_(a,"visibility",e)&&0!==b&&(h=0),U?f=new ta(i,"opacity",h,b-h,f):(f=new ta(i,"opacity",100*h,100*(b-h),f),f.xn1=j?1:0,i.zoom=1,f.type=2,f.b="alpha(opacity="+f.s+")",f.e="alpha(opacity="+(f.s+f.c)+")",f.data=a,f.plugin=g,f.setRatio=Ua),j&&(f=new ta(i,"visibility",0,0,f,-1,null,!1,0,0!==h?"inherit":"hidden",0===b?"hidden":"inherit"),f.xs0="inherit",d._overwriteProps.push(f.n),d._overwriteProps.push(c)),f}});var Va=function(a,b){b&&(a.removeProperty?(("ms"===b.substr(0,2)||"webkit"===b.substr(0,6))&&(b="-"+b),a.removeProperty(b.replace(B,"-$1").toLowerCase())):a.removeAttribute(b))},Wa=function(a){if(this.t._gsClassPT=this,1===a||0===a){this.t.setAttribute("class",0===a?this.b:this.e);for(var b=this.data,c=this.t.style;b;)b.v?c[b.p]=b.v:Va(c,b.p),b=b._next;1===a&&this.t._gsClassPT===this&&(this.t._gsClassPT=null)}else this.t.getAttribute("class")!==this.e&&this.t.setAttribute("class",this.e)};ya("className",{parser:function(a,b,d,f,g,h,i){var j,k,l,m,n,o=a.getAttribute("class")||"",p=a.style.cssText;if(g=f._classNamePT=new ta(a,d,0,0,g,2),g.setRatio=Wa,g.pr=-11,c=!0,g.b=o,k=ca(a,e),l=a._gsClassPT){for(m={},n=l.data;n;)m[n.p]=1,n=n._next;l.setRatio(1)}return a._gsClassPT=g,g.e="="!==b.charAt(1)?b:o.replace(new RegExp("(?:\\s|^)"+b.substr(2)+"(?![\\w-])"),"")+("+"===b.charAt(0)?" "+b.substr(2):""),a.setAttribute("class",g.e),j=da(a,k,ca(a),i,m),a.setAttribute("class",o),g.data=j.firstMPT,a.style.cssText=p,g=g.xfirst=f.parse(a,j.difs,g,h)}});var Xa=function(a){if((1===a||0===a)&&this.data._totalTime===this.data._totalDuration&&"isFromStart"!==this.data.data){var b,c,d,e,f,g=this.t.style,h=i.transform.parse;if("all"===this.e)g.cssText="",e=!0;else for(b=this.e.split(" ").join("").split(","),d=b.length;--d>-1;)c=b[d],i[c]&&(i[c].parse===h?e=!0:c="transformOrigin"===c?Ea:i[c].p),Va(g,c);e&&(Va(g,Ca),f=this.t._gsTransform,f&&(f.svg&&(this.t.removeAttribute("data-svg-origin"),this.t.removeAttribute("transform")),delete this.t._gsTransform))}};for(ya("clearProps",{parser:function(a,b,d,e,f){return f=new ta(a,d,0,0,f,2),f.setRatio=Xa,f.e=b,f.pr=-10,f.data=e._tween,c=!0,f}}),j="bezier,throwProps,physicsProps,physics2D".split(","),wa=j.length;wa--;)za(j[wa]);j=g.prototype,j._firstPT=j._lastParsedTransform=j._transform=null,j._onInitTween=function(a,b,h,j){if(!a.nodeType)return!1;this._target=q=a,this._tween=h,this._vars=b,r=j,k=b.autoRound,c=!1,d=b.suffixMap||g.suffixMap,e=$(a,""),f=this._overwriteProps;var n,p,s,t,u,v,w,x,z,A=a.style;if(l&&""===A.zIndex&&(n=_(a,"zIndex",e),("auto"===n||""===n)&&this._addLazySet(A,"zIndex",0)),"string"==typeof b&&(t=A.cssText,n=ca(a,e),A.cssText=t+";"+b,n=da(a,n,ca(a)).difs,!U&&y.test(b)&&(n.opacity=parseFloat(RegExp.$1)),b=n,A.cssText=t),b.className?this._firstPT=p=i.className.parse(a,b.className,"className",this,null,null,b):this._firstPT=p=this.parse(a,b,null),this._transformType){for(z=3===this._transformType,Ca?m&&(l=!0,""===A.zIndex&&(w=_(a,"zIndex",e),("auto"===w||""===w)&&this._addLazySet(A,"zIndex",0)),o&&this._addLazySet(A,"WebkitBackfaceVisibility",this._vars.WebkitBackfaceVisibility||(z?"visible":"hidden"))):A.zoom=1,s=p;s&&s._next;)s=s._next;x=new ta(a,"transform",0,0,null,2),this._linkCSSP(x,null,s),x.setRatio=Ca?Ta:Sa,x.data=this._transform||Ra(a,e,!0),x.tween=h,x.pr=-1,f.pop()}if(c){for(;p;){for(v=p._next,s=t;s&&s.pr>p.pr;)s=s._next;(p._prev=s?s._prev:u)?p._prev._next=p:t=p,(p._next=s)?s._prev=p:u=p,p=v}this._firstPT=t}return!0},j.parse=function(a,b,c,f){var g,h,j,l,m,n,o,p,s,t,u=a.style;for(g in b)n=b[g],"function"==typeof n&&(n=n(r,q)),h=i[g],h?c=h.parse(a,n,g,this,c,f,b):(m=_(a,g,e)+"",s="string"==typeof n,"color"===g||"fill"===g||"stroke"===g||-1!==g.indexOf("Color")||s&&A.test(n)?(s||(n=na(n),n=(n.length>3?"rgba(":"rgb(")+n.join(",")+")"),c=va(u,g,m,n,!0,"transparent",c,0,f)):s&&J.test(n)?c=va(u,g,m,n,!0,null,c,0,f):(j=parseFloat(m),o=j||0===j?m.substr((j+"").length):"",(""===m||"auto"===m)&&("width"===g||"height"===g?(j=ga(a,g,e),o="px"):"left"===g||"top"===g?(j=ba(a,g,e),o="px"):(j="opacity"!==g?0:1,o="")),t=s&&"="===n.charAt(1),t?(l=parseInt(n.charAt(0)+"1",10),n=n.substr(2),l*=parseFloat(n),p=n.replace(w,"")):(l=parseFloat(n),p=s?n.replace(w,""):""),""===p&&(p=g in d?d[g]:o),n=l||0===l?(t?l+j:l)+p:b[g],o!==p&&""!==p&&(l||0===l)&&j&&(j=aa(a,g,j,o),"%"===p?(j/=aa(a,g,100,"%")/100,b.strictUnits!==!0&&(m=j+"%")):"em"===p||"rem"===p||"vw"===p||"vh"===p?j/=aa(a,g,1,p):"px"!==p&&(l=aa(a,g,l,p),p="px"),t&&(l||0===l)&&(n=l+j+p)),t&&(l+=j),!j&&0!==j||!l&&0!==l?void 0!==u[g]&&(n||n+""!="NaN"&&null!=n)?(c=new ta(u,g,l||j||0,0,c,-1,g,!1,0,m,n),c.xs0="none"!==n||"display"!==g&&-1===g.indexOf("Style")?n:m):W("invalid "+g+" tween value: "+b[g]):(c=new ta(u,g,j,l-j,c,0,g,k!==!1&&("px"===p||"zIndex"===g),0,m,n),c.xs0=p))),f&&c&&!c.plugin&&(c.plugin=f);return c},j.setRatio=function(a){var b,c,d,e=this._firstPT,f=1e-6;if(1!==a||this._tween._time!==this._tween._duration&&0!==this._tween._time)if(a||this._tween._time!==this._tween._duration&&0!==this._tween._time||this._tween._rawPrevTime===-1e-6)for(;e;){if(b=e.c*a+e.s,e.r?b=Math.round(b):f>b&&b>-f&&(b=0),e.type)if(1===e.type)if(d=e.l,2===d)e.t[e.p]=e.xs0+b+e.xs1+e.xn1+e.xs2;else if(3===d)e.t[e.p]=e.xs0+b+e.xs1+e.xn1+e.xs2+e.xn2+e.xs3;else if(4===d)e.t[e.p]=e.xs0+b+e.xs1+e.xn1+e.xs2+e.xn2+e.xs3+e.xn3+e.xs4;else if(5===d)e.t[e.p]=e.xs0+b+e.xs1+e.xn1+e.xs2+e.xn2+e.xs3+e.xn3+e.xs4+e.xn4+e.xs5;else{for(c=e.xs0+b+e.xs1,d=1;d<e.l;d++)c+=e["xn"+d]+e["xs"+(d+1)];e.t[e.p]=c}else-1===e.type?e.t[e.p]=e.xs0:e.setRatio&&e.setRatio(a);else e.t[e.p]=b+e.xs0;e=e._next}else for(;e;)2!==e.type?e.t[e.p]=e.b:e.setRatio(a),e=e._next;else for(;e;){if(2!==e.type)if(e.r&&-1!==e.type)if(b=Math.round(e.s+e.c),e.type){if(1===e.type){for(d=e.l,c=e.xs0+b+e.xs1,d=1;d<e.l;d++)c+=e["xn"+d]+e["xs"+(d+1)];e.t[e.p]=c}}else e.t[e.p]=b+e.xs0;else e.t[e.p]=e.e;else e.setRatio(a);e=e._next}},j._enableTransforms=function(a){this._transform=this._transform||Ra(this._target,e,!0),this._transformType=this._transform.svg&&Aa||!a&&3!==this._transformType?2:3};var Ya=function(a){this.t[this.p]=this.e,this.data._linkCSSP(this,this._next,null,!0)};j._addLazySet=function(a,b,c){var d=this._firstPT=new ta(a,b,0,0,this._firstPT,2);d.e=c,d.setRatio=Ya,d.data=this},j._linkCSSP=function(a,b,c,d){return a&&(b&&(b._prev=a),a._next&&(a._next._prev=a._prev),a._prev?a._prev._next=a._next:this._firstPT===a&&(this._firstPT=a._next,d=!0),c?c._next=a:d||null!==this._firstPT||(this._firstPT=a),a._next=b,a._prev=c),a},j._mod=function(a){for(var b=this._firstPT;b;)"function"==typeof a[b.p]&&a[b.p]===Math.round&&(b.r=1),b=b._next},j._kill=function(b){var c,d,e,f=b;if(b.autoAlpha||b.alpha){f={};for(d in b)f[d]=b[d];f.opacity=1,f.autoAlpha&&(f.visibility=1)}for(b.className&&(c=this._classNamePT)&&(e=c.xfirst,e&&e._prev?this._linkCSSP(e._prev,c._next,e._prev._prev):e===this._firstPT&&(this._firstPT=c._next),c._next&&this._linkCSSP(c._next,c._next._next,e._prev),this._classNamePT=null),c=this._firstPT;c;)c.plugin&&c.plugin!==d&&c.plugin._kill&&(c.plugin._kill(b),d=c.plugin),c=c._next;return a.prototype._kill.call(this,f)};var Za=function(a,b,c){var d,e,f,g;if(a.slice)for(e=a.length;--e>-1;)Za(a[e],b,c);else for(d=a.childNodes,e=d.length;--e>-1;)f=d[e],g=f.type,f.style&&(b.push(ca(f)),c&&c.push(f)),1!==g&&9!==g&&11!==g||!f.childNodes.length||Za(f,b,c)};return g.cascadeTo=function(a,c,d){var e,f,g,h,i=b.to(a,c,d),j=[i],k=[],l=[],m=[],n=b._internals.reservedProps;for(a=i._targets||i.target,Za(a,k,m),i.render(c,!0,!0),Za(a,l),i.render(0,!0,!0),i._enabled(!0),e=m.length;--e>-1;)if(f=da(m[e],k[e],l[e]),f.firstMPT){f=f.difs;for(g in d)n[g]&&(f[g]=d[g]);h={};for(g in f)h[g]=k[e][g];j.push(b.fromTo(m[e],c,h,f))}return j},a.activate([g]),g},!0),function(){var a=_gsScope._gsDefine.plugin({propName:"roundProps",version:"1.6.0",priority:-1,API:2,init:function(a,b,c){return this._tween=c,!0}}),b=function(a){for(;a;)a.f||a.blob||(a.m=Math.round),a=a._next},c=a.prototype;c._onInitAllProps=function(){for(var a,c,d,e=this._tween,f=e.vars.roundProps.join?e.vars.roundProps:e.vars.roundProps.split(","),g=f.length,h={},i=e._propLookup.roundProps;--g>-1;)h[f[g]]=Math.round;for(g=f.length;--g>-1;)for(a=f[g],c=e._firstPT;c;)d=c._next,c.pg?c.t._mod(h):c.n===a&&(2===c.f&&c.t?b(c.t._firstPT):(this._add(c.t,a,c.s,c.c),d&&(d._prev=c._prev),c._prev?c._prev._next=d:e._firstPT===c&&(e._firstPT=d),c._next=c._prev=null,e._propLookup[a]=i)),c=d;return!1},c._add=function(a,b,c,d){this._addTween(a,b,c,c+d,b,Math.round),this._overwriteProps.push(b)}}(),function(){_gsScope._gsDefine.plugin({propName:"attr",API:2,version:"0.6.0",init:function(a,b,c,d){var e,f;if("function"!=typeof a.setAttribute)return!1;for(e in b)f=b[e],"function"==typeof f&&(f=f(d,a)),this._addTween(a,"setAttribute",a.getAttribute(e)+"",f+"",e,!1,e),this._overwriteProps.push(e);return!0}})}(),_gsScope._gsDefine.plugin({propName:"directionalRotation",version:"0.3.0",API:2,init:function(a,b,c,d){"object"!=typeof b&&(b={rotation:b}),this.finals={};var e,f,g,h,i,j,k=b.useRadians===!0?2*Math.PI:360,l=1e-6;for(e in b)"useRadians"!==e&&(h=b[e],"function"==typeof h&&(h=h(d,a)),j=(h+"").split("_"),f=j[0],g=parseFloat("function"!=typeof a[e]?a[e]:a[e.indexOf("set")||"function"!=typeof a["get"+e.substr(3)]?e:"get"+e.substr(3)]()),h=this.finals[e]="string"==typeof f&&"="===f.charAt(1)?g+parseInt(f.charAt(0)+"1",10)*Number(f.substr(2)):Number(f)||0,i=h-g,j.length&&(f=j.join("_"),-1!==f.indexOf("short")&&(i%=k,i!==i%(k/2)&&(i=0>i?i+k:i-k)),-1!==f.indexOf("_cw")&&0>i?i=(i+9999999999*k)%k-(i/k|0)*k:-1!==f.indexOf("ccw")&&i>0&&(i=(i-9999999999*k)%k-(i/k|0)*k)),(i>l||-l>i)&&(this._addTween(a,e,g,g+i,e),this._overwriteProps.push(e)));return!0},set:function(a){var b;if(1!==a)this._super.setRatio.call(this,a);else for(b=this._firstPT;b;)b.f?b.t[b.p](this.finals[b.p]):b.t[b.p]=this.finals[b.p],b=b._next}})._autoCSS=!0,_gsScope._gsDefine("easing.Back",["easing.Ease"],function(a){var b,c,d,e=_gsScope.GreenSockGlobals||_gsScope,f=e.com.greensock,g=2*Math.PI,h=Math.PI/2,i=f._class,j=function(b,c){var d=i("easing."+b,function(){},!0),e=d.prototype=new a;return e.constructor=d,e.getRatio=c,d},k=a.register||function(){},l=function(a,b,c,d,e){var f=i("easing."+a,{easeOut:new b,easeIn:new c,easeInOut:new d},!0);return k(f,a),f},m=function(a,b,c){this.t=a,this.v=b,c&&(this.next=c,c.prev=this,this.c=c.v-b,this.gap=c.t-a)},n=function(b,c){var d=i("easing."+b,function(a){this._p1=a||0===a?a:1.70158,this._p2=1.525*this._p1},!0),e=d.prototype=new a;return e.constructor=d,e.getRatio=c,e.config=function(a){return new d(a)},d},o=l("Back",n("BackOut",function(a){return(a-=1)*a*((this._p1+1)*a+this._p1)+1}),n("BackIn",function(a){return a*a*((this._p1+1)*a-this._p1)}),n("BackInOut",function(a){return(a*=2)<1?.5*a*a*((this._p2+1)*a-this._p2):.5*((a-=2)*a*((this._p2+1)*a+this._p2)+2)})),p=i("easing.SlowMo",function(a,b,c){b=b||0===b?b:.7,null==a?a=.7:a>1&&(a=1),this._p=1!==a?b:0,this._p1=(1-a)/2,this._p2=a,this._p3=this._p1+this._p2,this._calcEnd=c===!0},!0),q=p.prototype=new a;return q.constructor=p,q.getRatio=function(a){var b=a+(.5-a)*this._p;return a<this._p1?this._calcEnd?1-(a=1-a/this._p1)*a:b-(a=1-a/this._p1)*a*a*a*b:a>this._p3?this._calcEnd?1-(a=(a-this._p3)/this._p1)*a:b+(a-b)*(a=(a-this._p3)/this._p1)*a*a*a:this._calcEnd?1:b},p.ease=new p(.7,.7),q.config=p.config=function(a,b,c){return new p(a,b,c)},b=i("easing.SteppedEase",function(a){a=a||1,this._p1=1/a,this._p2=a+1},!0),q=b.prototype=new a,q.constructor=b,q.getRatio=function(a){return 0>a?a=0:a>=1&&(a=.999999999),(this._p2*a>>0)*this._p1},q.config=b.config=function(a){return new b(a)},c=i("easing.RoughEase",function(b){b=b||{};for(var c,d,e,f,g,h,i=b.taper||"none",j=[],k=0,l=0|(b.points||20),n=l,o=b.randomize!==!1,p=b.clamp===!0,q=b.template instanceof a?b.template:null,r="number"==typeof b.strength?.4*b.strength:.4;--n>-1;)c=o?Math.random():1/l*n,d=q?q.getRatio(c):c,"none"===i?e=r:"out"===i?(f=1-c,e=f*f*r):"in"===i?e=c*c*r:.5>c?(f=2*c,e=f*f*.5*r):(f=2*(1-c),e=f*f*.5*r),o?d+=Math.random()*e-.5*e:n%2?d+=.5*e:d-=.5*e,p&&(d>1?d=1:0>d&&(d=0)),j[k++]={x:c,y:d};for(j.sort(function(a,b){return a.x-b.x}),h=new m(1,1,null),n=l;--n>-1;)g=j[n],h=new m(g.x,g.y,h);this._prev=new m(0,0,0!==h.t?h:h.next)},!0),q=c.prototype=new a,q.constructor=c,q.getRatio=function(a){var b=this._prev;if(a>b.t){for(;b.next&&a>=b.t;)b=b.next;b=b.prev}else for(;b.prev&&a<=b.t;)b=b.prev;return this._prev=b,b.v+(a-b.t)/b.gap*b.c},q.config=function(a){return new c(a)},c.ease=new c,l("Bounce",j("BounceOut",function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}),j("BounceIn",function(a){return(a=1-a)<1/2.75?1-7.5625*a*a:2/2.75>a?1-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?1-(7.5625*(a-=2.25/2.75)*a+.9375):1-(7.5625*(a-=2.625/2.75)*a+.984375)}),j("BounceInOut",function(a){var b=.5>a;return a=b?1-2*a:2*a-1,a=1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375,b?.5*(1-a):.5*a+.5})),l("Circ",j("CircOut",function(a){return Math.sqrt(1-(a-=1)*a)}),j("CircIn",function(a){return-(Math.sqrt(1-a*a)-1)}),j("CircInOut",function(a){return(a*=2)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)})),d=function(b,c,d){var e=i("easing."+b,function(a,b){this._p1=a>=1?a:1,this._p2=(b||d)/(1>a?a:1),this._p3=this._p2/g*(Math.asin(1/this._p1)||0),this._p2=g/this._p2},!0),f=e.prototype=new a;return f.constructor=e,f.getRatio=c,f.config=function(a,b){return new e(a,b)},e},l("Elastic",d("ElasticOut",function(a){return this._p1*Math.pow(2,-10*a)*Math.sin((a-this._p3)*this._p2)+1},.3),d("ElasticIn",function(a){return-(this._p1*Math.pow(2,10*(a-=1))*Math.sin((a-this._p3)*this._p2))},.3),d("ElasticInOut",function(a){return(a*=2)<1?-.5*(this._p1*Math.pow(2,10*(a-=1))*Math.sin((a-this._p3)*this._p2)):this._p1*Math.pow(2,-10*(a-=1))*Math.sin((a-this._p3)*this._p2)*.5+1},.45)),l("Expo",j("ExpoOut",function(a){return 1-Math.pow(2,-10*a)}),j("ExpoIn",function(a){return Math.pow(2,10*(a-1))-.001}),j("ExpoInOut",function(a){return(a*=2)<1?.5*Math.pow(2,10*(a-1)):.5*(2-Math.pow(2,-10*(a-1)))})),l("Sine",j("SineOut",function(a){return Math.sin(a*h)}),j("SineIn",function(a){return-Math.cos(a*h)+1}),j("SineInOut",function(a){return-.5*(Math.cos(Math.PI*a)-1)})),i("easing.EaseLookup",{find:function(b){return a.map[b]}},!0),k(e.SlowMo,"SlowMo","ease,"),k(c,"RoughEase","ease,"),k(b,"SteppedEase","ease,"),o},!0)}),_gsScope._gsDefine&&_gsScope._gsQueue.pop()(),
vendor: 27,279 bytes, line 2836
2836function(a,b){"use strict";var c={},d=a.document,e=a.GreenSockGlobals=a.GreenSockGlobals||a;if(!e.TweenLite){var f,g,h,i,j,k=function(a){var b,c=a.split("."),d=e;for(b=0;b<c.length;b++)d[c[b]]=d=d[c[b]]||{};return d},l=k("com.greensock"),m=1e-10,n=function(a){var b,c=[],d=a.length;for(b=0;b!==d;c.push(a[b++]));return c},o=function(){},p=function(){var a=Object.prototype.toString,b=a.call([]);return function(c){return null!=c&&(c instanceof Array||"object"==typeof c&&!!c.push&&a.call(c)===b)}}(),q={},r=function(d,f,g,h){this.sc=q[d]?q[d].sc:[],q[d]=this,this.gsClass=null,this.func=g;var i=[];this.check=function(j){for(var l,m,n,o,p,s=f.length,t=s;--s>-1;)(l=q[f[s]]||new r(f[s],[])).gsClass?(i[s]=l.gsClass,t--):j&&l.sc.push(this);if(0===t&&g){if(m=("com.greensock."+d).split("."),n=m.pop(),o=k(m.join("."))[n]=this.gsClass=g.apply(g,i),h)if(e[n]=c[n]=o,p="undefined"!=typeof module&&module.exports,!p&&"function"==typeof define&&define.amd)define((a.GreenSockAMDPath?a.GreenSockAMDPath+"/":"")+d.split(".").pop(),[],function(){return o});else if(p)if(d===b){module.exports=c[b]=o;for(s in c)o[s]=c[s]}else c[b]&&(c[b][n]=o);for(s=0;s<this.sc.length;s++)this.sc[s].check()}},this.check(!0)},s=a._gsDefine=function(a,b,c,d){return new r(a,b,c,d)},t=l._class=function(a,b,c){return b=b||function(){},s(a,[],function(){return b},c),b};s.globals=e;var u=[0,0,1,1],v=t("easing.Ease",function(a,b,c,d){this._func=a,this._type=c||0,this._power=d||0,this._params=b?u.concat(b):u},!0),w=v.map={},x=v.register=function(a,b,c,d){for(var e,f,g,h,i=b.split(","),j=i.length,k=(c||"easeIn,easeOut,easeInOut").split(",");--j>-1;)for(f=i[j],e=d?t("easing."+f,null,!0):l.easing[f]||{},g=k.length;--g>-1;)h=k[g],w[f+"."+h]=w[h+f]=e[h]=a.getRatio?a:a[h]||new a};for(h=v.prototype,h._calcEnd=!1,h.getRatio=function(a){if(this._func)return this._params[0]=a,this._func.apply(null,this._params);var b=this._type,c=this._power,d=1===b?1-a:2===b?a:.5>a?2*a:2*(1-a);return 1===c?d*=d:2===c?d*=d*d:3===c?d*=d*d*d:4===c&&(d*=d*d*d*d),1===b?1-d:2===b?d:.5>a?d/2:1-d/2},f=["Linear","Quad","Cubic","Quart","Quint,Strong"],g=f.length;--g>-1;)h=f[g]+",Power"+g,x(new v(null,null,1,g),h,"easeOut",!0),x(new v(null,null,2,g),h,"easeIn"+(0===g?",easeNone":"")),x(new v(null,null,3,g),h,"easeInOut");w.linear=l.easing.Linear.easeIn,w.swing=l.easing.Quad.easeInOut;var y=t("events.EventDispatcher",function(a){this._listeners={},this._eventTarget=a||this});h=y.prototype,h.addEventListener=function(a,b,c,d,e){e=e||0;var f,g,h=this._listeners[a],k=0;for(this!==i||j||i.wake(),null==h&&(this._listeners[a]=h=[]),g=h.length;--g>-1;)f=h[g],f.c===b&&f.s===c?h.splice(g,1):0===k&&f.pr<e&&(k=g+1);h.splice(k,0,{c:b,s:c,up:d,pr:e})},h.removeEventListener=function(a,b){var c,d=this._listeners[a];if(d)for(c=d.length;--c>-1;)if(d[c].c===b)return void d.splice(c,1)},h.dispatchEvent=function(a){var b,c,d,e=this._listeners[a];if(e)for(b=e.length,b>1&&(e=e.slice(0)),c=this._eventTarget;--b>-1;)d=e[b],d&&(d.up?d.c.call(d.s||c,{type:a,target:c}):d.c.call(d.s||c))};var z=a.requestAnimationFrame,A=a.cancelAnimationFrame,B=Date.now||function(){return(new Date).getTime()},C=B();for(f=["ms","moz","webkit","o"],g=f.length;--g>-1&&!z;)z=a[f[g]+"RequestAnimationFrame"],A=a[f[g]+"CancelAnimationFrame"]||a[f[g]+"CancelRequestAnimationFrame"];t("Ticker",function(a,b){var c,e,f,g,h,k=this,l=B(),n=b!==!1&&z?"auto":!1,p=500,q=33,r="tick",s=function(a){var b,d,i=B()-C;i>p&&(l+=i-q),C+=i,k.time=(C-l)/1e3,b=k.time-h,(!c||b>0||a===!0)&&(k.frame++,h+=b+(b>=g?.004:g-b),d=!0),a!==!0&&(f=e(s)),d&&k.dispatchEvent(r)};y.call(k),k.time=k.frame=0,k.tick=function(){s(!0)},k.lagSmoothing=function(a,b){p=a||1/m,q=Math.min(b,p,0)},k.sleep=function(){null!=f&&(n&&A?A(f):clearTimeout(f),e=o,f=null,k===i&&(j=!1))},k.wake=function(a){null!==f?k.sleep():a?l+=-C+(C=B()):k.frame>10&&(C=B()-p+5),e=0===c?o:n&&z?z:function(a){return setTimeout(a,1e3*(h-k.time)+1|0)},k===i&&(j=!0),s(2)},k.fps=function(a){return arguments.length?(c=a,g=1/(c||60),h=this.time+g,void k.wake()):c},k.useRAF=function(a){return arguments.length?(k.sleep(),n=a,void k.fps(c)):n},k.fps(a),setTimeout(function(){"auto"===n&&k.frame<5&&"hidden"!==d.visibilityState&&k.useRAF(!1)},1500)}),h=l.Ticker.prototype=new l.events.EventDispatcher,h.constructor=l.Ticker;var D=t("core.Animation",function(a,b){if(this.vars=b=b||{},this._duration=this._totalDuration=a||0,this._delay=Number(b.delay)||0,this._timeScale=1,this._active=b.immediateRender===!0,this.data=b.data,this._reversed=b.reversed===!0,W){j||i.wake();var c=this.vars.useFrames?V:W;c.add(this,c._time),this.vars.paused&&this.paused(!0)}});i=D.ticker=new l.Ticker,h=D.prototype,h._dirty=h._gc=h._initted=h._paused=!1,h._totalTime=h._time=0,h._rawPrevTime=-1,h._next=h._last=h._onUpdate=h._timeline=h.timeline=null,h._paused=!1;var E=function(){j&&B()-C>2e3&&i.wake(),setTimeout(E,2e3)};E(),h.play=function(a,b){return null!=a&&this.seek(a,b),this.reversed(!1).paused(!1)},h.pause=function(a,b){return null!=a&&this.seek(a,b),this.paused(!0)},h.resume=function(a,b){return null!=a&&this.seek(a,b),this.paused(!1)},h.seek=function(a,b){return this.totalTime(Number(a),b!==!1)},h.restart=function(a,b){return this.reversed(!1).paused(!1).totalTime(a?-this._delay:0,b!==!1,!0)},h.reverse=function(a,b){return null!=a&&this.seek(a||this.totalDuration(),b),this.reversed(!0).paused(!1)},h.render=function(a,b,c){},h.invalidate=function(){return this._time=this._totalTime=0,this._initted=this._gc=!1,this._rawPrevTime=-1,(this._gc||!this.timeline)&&this._enabled(!0),this},h.isActive=function(){var a,b=this._timeline,c=this._startTime;return!b||!this._gc&&!this._paused&&b.isActive()&&(a=b.rawTime(!0))>=c&&a<c+this.totalDuration()/this._timeScale},h._enabled=function(a,b){return j||i.wake(),this._gc=!a,this._active=this.isActive(),b!==!0&&(a&&!this.timeline?this._timeline.add(this,this._startTime-this._delay):!a&&this.timeline&&this._timeline._remove(this,!0)),!1},h._kill=function(a,b){return this._enabled(!1,!1)},h.kill=function(a,b){return this._kill(a,b),this},h._uncache=function(a){for(var b=a?this:this.timeline;b;)b._dirty=!0,b=b.timeline;return this},h._swapSelfInParams=function(a){for(var b=a.length,c=a.concat();--b>-1;)"{self}"===a[b]&&(c[b]=this);return c},h._callback=function(a){var b=this.vars,c=b[a],d=b[a+"Params"],e=b[a+"Scope"]||b.callbackScope||this,f=d?d.length:0;switch(f){case 0:c.call(e);break;case 1:c.call(e,d[0]);break;case 2:c.call(e,d[0],d[1]);break;default:c.apply(e,d)}},h.eventCallback=function(a,b,c,d){if("on"===(a||"").substr(0,2)){var e=this.vars;if(1===arguments.length)return e[a];null==b?delete e[a]:(e[a]=b,e[a+"Params"]=p(c)&&-1!==c.join("").indexOf("{self}")?this._swapSelfInParams(c):c,e[a+"Scope"]=d),"onUpdate"===a&&(this._onUpdate=b)}return this},h.delay=function(a){return arguments.length?(this._timeline.smoothChildTiming&&this.startTime(this._startTime+a-this._delay),this._delay=a,this):this._delay},h.duration=function(a){return arguments.length?(this._duration=this._totalDuration=a,this._uncache(!0),this._timeline.smoothChildTiming&&this._time>0&&this._time<this._duration&&0!==a&&this.totalTime(this._totalTime*(a/this._duration),!0),this):(this._dirty=!1,this._duration)},h.totalDuration=function(a){return this._dirty=!1,arguments.length?this.duration(a):this._totalDuration},h.time=function(a,b){return arguments.length?(this._dirty&&this.totalDuration(),this.totalTime(a>this._duration?this._duration:a,b)):this._time},h.totalTime=function(a,b,c){if(j||i.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(0>a&&!c&&(a+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var d=this._totalDuration,e=this._timeline;if(a>d&&!c&&(a=d),this._startTime=(this._paused?this._pauseTime:e._time)-(this._reversed?d-a:a)/this._timeScale,e._dirty||this._uncache(!1),e._timeline)for(;e._timeline;)e._timeline._time!==(e._startTime+e._totalTime)/e._timeScale&&e.totalTime(e._totalTime,!0),e=e._timeline}this._gc&&this._enabled(!0,!1),(this._totalTime!==a||0===this._duration)&&(J.length&&Y(),this.render(a,b,!1),J.length&&Y())}return this},h.progress=h.totalProgress=function(a,b){var c=this.duration();return arguments.length?this.totalTime(c*a,b):c?this._time/c:this.ratio},h.startTime=function(a){return arguments.length?(a!==this._startTime&&(this._startTime=a,this.timeline&&this.timeline._sortChildren&&this.timeline.add(this,a-this._delay)),this):this._startTime},h.endTime=function(a){return this._startTime+(0!=a?this.totalDuration():this.duration())/this._timeScale},h.timeScale=function(a){if(!arguments.length)return this._timeScale;if(a=a||m,this._timeline&&this._timeline.smoothChildTiming){var b=this._pauseTime,c=b||0===b?b:this._timeline.totalTime();this._startTime=c-(c-this._startTime)*this._timeScale/a}return this._timeScale=a,this._uncache(!1)},h.reversed=function(a){return arguments.length?(a!=this._reversed&&(this._reversed=a,this.totalTime(this._timeline&&!this._timeline.smoothChildTiming?this.totalDuration()-this._totalTime:this._totalTime,!0)),this):this._reversed},h.paused=function(a){if(!arguments.length)return this._paused;var b,c,d=this._timeline;return a!=this._paused&&d&&(j||a||i.wake(),b=d.rawTime(),c=b-this._pauseTime,!a&&d.smoothChildTiming&&(this._startTime+=c,this._uncache(!1)),this._pauseTime=a?b:null,this._paused=a,this._active=this.isActive(),!a&&0!==c&&this._initted&&this.duration()&&(b=d.smoothChildTiming?this._totalTime:(b-this._startTime)/this._timeScale,this.render(b,b===this._totalTime,!0))),this._gc&&!a&&this._enabled(!0,!1),this};var F=t("core.SimpleTimeline",function(a){D.call(this,0,a),this.autoRemoveChildren=this.smoothChildTiming=!0});h=F.prototype=new D,h.constructor=F,h.kill()._gc=!1,h._first=h._last=h._recent=null,h._sortChildren=!1,h.add=h.insert=function(a,b,c,d){var e,f;if(a._startTime=Number(b||0)+a._delay,a._paused&&this!==a._timeline&&(a._pauseTime=a._startTime+(this.rawTime()-a._startTime)/a._timeScale),a.timeline&&a.timeline._remove(a,!0),a.timeline=a._timeline=this,a._gc&&a._enabled(!0,!0),e=this._last,this._sortChildren)for(f=a._startTime;e&&e._startTime>f;)e=e._prev;return e?(a._next=e._next,e._next=a):(a._next=this._first,this._first=a),a._next?a._next._prev=a:this._last=a,a._prev=e,this._recent=a,this._timeline&&this._uncache(!0),this},h._remove=function(a,b){return a.timeline===this&&(b||a._enabled(!1,!0),a._prev?a._prev._next=a._next:this._first===a&&(this._first=a._next),a._next?a._next._prev=a._prev:this._last===a&&(this._last=a._prev),a._next=a._prev=a.timeline=null,a===this._recent&&(this._recent=this._last),this._timeline&&this._uncache(!0)),this},h.render=function(a,b,c){var d,e=this._first;for(this._totalTime=this._time=this._rawPrevTime=a;e;)d=e._next,(e._active||a>=e._startTime&&!e._paused)&&(e._reversed?e.render((e._dirty?e.totalDuration():e._totalDuration)-(a-e._startTime)*e._timeScale,b,c):e.render((a-e._startTime)*e._timeScale,b,c)),e=d},h.rawTime=function(){return j||i.wake(),this._totalTime};var G=t("TweenLite",function(b,c,d){if(D.call(this,c,d),this.render=G.prototype.render,null==b)throw"Cannot tween a null target.";this.target=b="string"!=typeof b?b:G.selector(b)||b;var e,f,g,h=b.jquery||b.length&&b!==a&&b[0]&&(b[0]===a||b[0].nodeType&&b[0].style&&!b.nodeType),i=this.vars.overwrite;if(this._overwrite=i=null==i?U[G.defaultOverwrite]:"number"==typeof i?i>>0:U[i],(h||b instanceof Array||b.push&&p(b))&&"number"!=typeof b[0])for(this._targets=g=n(b),this._propLookup=[],this._siblings=[],e=0;e<g.length;e++)f=g[e],f?"string"!=typeof f?f.length&&f!==a&&f[0]&&(f[0]===a||f[0].nodeType&&f[0].style&&!f.nodeType)?(g.splice(e--,1),this._targets=g=g.concat(n(f))):(this._siblings[e]=Z(f,this,!1),1===i&&this._siblings[e].length>1&&_(f,this,null,1,this._siblings[e])):(f=g[e--]=G.selector(f),"string"==typeof f&&g.splice(e+1,1)):g.splice(e--,1);else this._propLookup={},this._siblings=Z(b,this,!1),1===i&&this._siblings.length>1&&_(b,this,null,1,this._siblings);(this.vars.immediateRender||0===c&&0===this._delay&&this.vars.immediateRender!==!1)&&(this._time=-m,this.render(Math.min(0,-this._delay)))},!0),H=function(b){return b&&b.length&&b!==a&&b[0]&&(b[0]===a||b[0].nodeType&&b[0].style&&!b.nodeType)},I=function(a,b){var c,d={};for(c in a)T[c]||c in b&&"transform"!==c&&"x"!==c&&"y"!==c&&"width"!==c&&"height"!==c&&"className"!==c&&"border"!==c||!(!Q[c]||Q[c]&&Q[c]._autoCSS)||(d[c]=a[c],delete a[c]);a.css=d};h=G.prototype=new D,h.constructor=G,h.kill()._gc=!1,h.ratio=0,h._firstPT=h._targets=h._overwrittenProps=h._startAt=null,h._notifyPluginsOfEnabled=h._lazy=!1,G.version="1.19.1",G.defaultEase=h._ease=new v(null,null,1,1),G.defaultOverwrite="auto",G.ticker=i,G.autoSleep=120,G.lagSmoothing=function(a,b){i.lagSmoothing(a,b)},G.selector=a.$||a.jQuery||function(b){var c=a.$||a.jQuery;return c?(G.selector=c,c(b)):"undefined"==typeof d?b:d.querySelectorAll?d.querySelectorAll(b):d.getElementById("#"===b.charAt(0)?b.substr(1):b)};var J=[],K={},L=/(?:(-|-=|\+=)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi,M=function(a){for(var b,c=this._firstPT,d=1e-6;c;)b=c.blob?1===a?this.end:a?this.join(""):this.start:c.c*a+c.s,c.m?b=c.m(b,this._target||c.t):d>b&&b>-d&&!c.blob&&(b=0),c.f?c.fp?c.t[c.p](c.fp,b):c.t[c.p](b):c.t[c.p]=b,c=c._next},N=function(a,b,c,d){var e,f,g,h,i,j,k,l=[],m=0,n="",o=0;for(l.start=a,l.end=b,a=l[0]=a+"",b=l[1]=b+"",c&&(c(l),a=l[0],b=l[1]),l.length=0,e=a.match(L)||[],f=b.match(L)||[],d&&(d._next=null,d.blob=1,l._firstPT=l._applyPT=d),i=f.length,h=0;i>h;h++)k=f[h],j=b.substr(m,b.indexOf(k,m)-m),n+=j||!h?j:",",m+=j.length,o?o=(o+1)%5:"rgba("===j.substr(-5)&&(o=1),k===e[h]||e.length<=h?n+=k:(n&&(l.push(n),n=""),g=parseFloat(e[h]),l.push(g),l._firstPT={_next:l._firstPT,t:l,p:l.length-1,s:g,c:("="===k.charAt(1)?parseInt(k.charAt(0)+"1",10)*parseFloat(k.substr(2)):parseFloat(k)-g)||0,f:0,m:o&&4>o?Math.round:0}),m+=k.length;return n+=b.substr(m),n&&l.push(n),l.setRatio=M,l},O=function(a,b,c,d,e,f,g,h,i){"function"==typeof d&&(d=d(i||0,a));var j,k=typeof a[b],l="function"!==k?"":b.indexOf("set")||"function"!=typeof a["get"+b.substr(3)]?b:"get"+b.substr(3),m="get"!==c?c:l?g?a[l](g):a[l]():a[b],n="string"==typeof d&&"="===d.charAt(1),o={t:a,p:b,s:m,f:"function"===k,pg:0,n:e||b,m:f?"function"==typeof f?f:Math.round:0,pr:0,c:n?parseInt(d.charAt(0)+"1",10)*parseFloat(d.substr(2)):parseFloat(d)-m||0};return("number"!=typeof m||"number"!=typeof d&&!n)&&(g||isNaN(m)||!n&&isNaN(d)||"boolean"==typeof m||"boolean"==typeof d?(o.fp=g,j=N(m,n?o.s+o.c:d,h||G.defaultStringFilter,o),o={t:j,p:"setRatio",s:0,c:1,f:2,pg:0,n:e||b,pr:0,m:0}):(o.s=parseFloat(m),n||(o.c=parseFloat(d)-o.s||0))),o.c?((o._next=this._firstPT)&&(o._next._prev=o),this._firstPT=o,o):void 0},P=G._internals={isArray:p,isSelector:H,lazyTweens:J,blobDif:N},Q=G._plugins={},R=P.tweenLookup={},S=0,T=P.reservedProps={ease:1,delay:1,overwrite:1,onComplete:1,onCompleteParams:1,onCompleteScope:1,useFrames:1,runBackwards:1,startAt:1,onUpdate:1,onUpdateParams:1,onUpdateScope:1,onStart:1,onStartParams:1,onStartScope:1,onReverseComplete:1,onReverseCompleteParams:1,onReverseCompleteScope:1,onRepeat:1,onRepeatParams:1,onRepeatScope:1,easeParams:1,yoyo:1,immediateRender:1,repeat:1,repeatDelay:1,data:1,paused:1,reversed:1,autoCSS:1,lazy:1,onOverwrite:1,callbackScope:1,stringFilter:1,id:1},U={none:0,all:1,auto:2,concurrent:3,allOnStart:4,preexisting:5,"true":1,"false":0},V=D._rootFramesTimeline=new F,W=D._rootTimeline=new F,X=30,Y=P.lazyRender=function(){var a,b=J.length;for(K={};--b>-1;)a=J[b],a&&a._lazy!==!1&&(a.render(a._lazy[0],a._lazy[1],!0),a._lazy=!1);J.length=0};W._startTime=i.time,V._startTime=i.frame,W._active=V._active=!0,setTimeout(Y,1),D._updateRoot=G.render=function(){var a,b,c;if(J.length&&Y(),W.render((i.time-W._startTime)*W._timeScale,!1,!1),V.render((i.frame-V._startTime)*V._timeScale,!1,!1),J.length&&Y(),i.frame>=X){X=i.frame+(parseInt(G.autoSleep,10)||120);for(c in R){for(b=R[c].tweens,a=b.length;--a>-1;)b[a]._gc&&b.splice(a,1);0===b.length&&delete R[c]}if(c=W._first,(!c||c._paused)&&G.autoSleep&&!V._first&&1===i._listeners.tick.length){for(;c&&c._paused;)c=c._next;c||i.sleep()}}},i.addEventListener("tick",D._updateRoot);var Z=function(a,b,c){var d,e,f=a._gsTweenID;if(R[f||(a._gsTweenID=f="t"+S++)]||(R[f]={target:a,tweens:[]}),b&&(d=R[f].tweens,d[e=d.length]=b,c))for(;--e>-1;)d[e]===b&&d.splice(e,1);return R[f].tweens},$=function(a,b,c,d){var e,f,g=a.vars.onOverwrite;return g&&(e=g(a,b,c,d)),g=G.onOverwrite,g&&(f=g(a,b,c,d)),e!==!1&&f!==!1},_=function(a,b,c,d,e){var f,g,h,i;if(1===d||d>=4){for(i=e.length,f=0;i>f;f++)if((h=e[f])!==b)h._gc||h._kill(null,a,b)&&(g=!0);else if(5===d)break;return g}var j,k=b._startTime+m,l=[],n=0,o=0===b._duration;for(f=e.length;--f>-1;)(h=e[f])===b||h._gc||h._paused||(h._timeline!==b._timeline?(j=j||aa(b,0,o),0===aa(h,j,o)&&(l[n++]=h)):h._startTime<=k&&h._startTime+h.totalDuration()/h._timeScale>k&&((o||!h._initted)&&k-h._startTime<=2e-10||(l[n++]=h)));for(f=n;--f>-1;)if(h=l[f],2===d&&h._kill(c,a,b)&&(g=!0),2!==d||!h._firstPT&&h._initted){if(2!==d&&!$(h,b))continue;h._enabled(!1,!1)&&(g=!0)}return g},aa=function(a,b,c){for(var d=a._timeline,e=d._timeScale,f=a._startTime;d._timeline;){if(f+=d._startTime,e*=d._timeScale,d._paused)return-100;d=d._timeline}return f/=e,f>b?f-b:c&&f===b||!a._initted&&2*m>f-b?m:(f+=a.totalDuration()/a._timeScale/e)>b+m?0:f-b-m};h._init=function(){var a,b,c,d,e,f,g=this.vars,h=this._overwrittenProps,i=this._duration,j=!!g.immediateRender,k=g.ease;if(g.startAt){this._startAt&&(this._startAt.render(-1,!0),this._startAt.kill()),e={};for(d in g.startAt)e[d]=g.startAt[d];if(e.overwrite=!1,e.immediateRender=!0,e.lazy=j&&g.lazy!==!1,e.startAt=e.delay=null,this._startAt=G.to(this.target,0,e),j)if(this._time>0)this._startAt=null;else if(0!==i)return}else if(g.runBackwards&&0!==i)if(this._startAt)this._startAt.render(-1,!0),this._startAt.kill(),this._startAt=null;else{0!==this._time&&(j=!1),c={};for(d in g)T[d]&&"autoCSS"!==d||(c[d]=g[d]);if(c.overwrite=0,c.data="isFromStart",c.lazy=j&&g.lazy!==!1,c.immediateRender=j,this._startAt=G.to(this.target,0,c),j){if(0===this._time)return}else this._startAt._init(),this._startAt._enabled(!1),this.vars.immediateRender&&(this._startAt=null)}if(this._ease=k=k?k instanceof v?k:"function"==typeof k?new v(k,g.easeParams):w[k]||G.defaultEase:G.defaultEase,g.easeParams instanceof Array&&k.config&&(this._ease=k.config.apply(k,g.easeParams)),this._easeType=this._ease._type,this._easePower=this._ease._power,this._firstPT=null,this._targets)for(f=this._targets.length,a=0;f>a;a++)this._initProps(this._targets[a],this._propLookup[a]={},this._siblings[a],h?h[a]:null,a)&&(b=!0);else b=this._initProps(this.target,this._propLookup,this._siblings,h,0);if(b&&G._onPluginEvent("_onInitAllProps",this),h&&(this._firstPT||"function"!=typeof this.target&&this._enabled(!1,!1)),g.runBackwards)for(c=this._firstPT;c;)c.s+=c.c,c.c=-c.c,c=c._next;this._onUpdate=g.onUpdate,this._initted=!0},h._initProps=function(b,c,d,e,f){var g,h,i,j,k,l;if(null==b)return!1;K[b._gsTweenID]&&Y(),this.vars.css||b.style&&b!==a&&b.nodeType&&Q.css&&this.vars.autoCSS!==!1&&I(this.vars,b);for(g in this.vars)if(l=this.vars[g],T[g])l&&(l instanceof Array||l.push&&p(l))&&-1!==l.join("").indexOf("{self}")&&(this.vars[g]=l=this._swapSelfInParams(l,this));else if(Q[g]&&(j=new Q[g])._onInitTween(b,this.vars[g],this,f)){for(this._firstPT=k={_next:this._firstPT,t:j,p:"setRatio",s:0,c:1,f:1,n:g,pg:1,pr:j._priority,m:0},h=j._overwriteProps.length;--h>-1;)c[j._overwriteProps[h]]=this._firstPT;(j._priority||j._onInitAllProps)&&(i=!0),(j._onDisable||j._onEnable)&&(this._notifyPluginsOfEnabled=!0),k._next&&(k._next._prev=k)}else c[g]=O.call(this,b,g,"get",l,g,0,null,this.vars.stringFilter,f);return e&&this._kill(e,b)?this._initProps(b,c,d,e,f):this._overwrite>1&&this._firstPT&&d.length>1&&_(b,this,c,this._overwrite,d)?(this._kill(c,b),this._initProps(b,c,d,e,f)):(this._firstPT&&(this.vars.lazy!==!1&&this._duration||this.vars.lazy&&!this._duration)&&(K[b._gsTweenID]=!0),i)},h.render=function(a,b,c){var d,e,f,g,h=this._time,i=this._duration,j=this._rawPrevTime;if(a>=i-1e-7&&a>=0)this._totalTime=this._time=i,this.ratio=this._ease._calcEnd?this._ease.getRatio(1):1,this._reversed||(d=!0,e="onComplete",c=c||this._timeline.autoRemoveChildren),0===i&&(this._initted||!this.vars.lazy||c)&&(this._startTime===this._timeline._duration&&(a=0),(0>j||0>=a&&a>=-1e-7||j===m&&"isPause"!==this.data)&&j!==a&&(c=!0,j>m&&(e="onReverseComplete")),this._rawPrevTime=g=!b||a||j===a?a:m);else if(1e-7>a)this._totalTime=this._time=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0,(0!==h||0===i&&j>0)&&(e="onReverseComplete",d=this._reversed),0>a&&(this._active=!1,0===i&&(this._initted||!this.vars.lazy||c)&&(j>=0&&(j!==m||"isPause"!==this.data)&&(c=!0),this._rawPrevTime=g=!b||a||j===a?a:m)),this._initted||(c=!0);else if(this._totalTime=this._time=a,this._easeType){var k=a/i,l=this._easeType,n=this._easePower;(1===l||3===l&&k>=.5)&&(k=1-k),3===l&&(k*=2),1===n?k*=k:2===n?k*=k*k:3===n?k*=k*k*k:4===n&&(k*=k*k*k*k),1===l?this.ratio=1-k:2===l?this.ratio=k:.5>a/i?this.ratio=k/2:this.ratio=1-k/2}else this.ratio=this._ease.getRatio(a/i);if(this._time!==h||c){if(!this._initted){if(this._init(),!this._initted||this._gc)return;if(!c&&this._firstPT&&(this.vars.lazy!==!1&&this._duration||this.vars.lazy&&!this._duration))return this._time=this._totalTime=h,this._rawPrevTime=j,J.push(this),void(this._lazy=[a,b]);this._time&&!d?this.ratio=this._ease.getRatio(this._time/i):d&&this._ease._calcEnd&&(this.ratio=this._ease.getRatio(0===this._time?0:1))}for(this._lazy!==!1&&(this._lazy=!1),this._active||!this._paused&&this._time!==h&&a>=0&&(this._active=!0),0===h&&(this._startAt&&(a>=0?this._startAt.render(a,b,c):e||(e="_dummyGS")),this.vars.onStart&&(0!==this._time||0===i)&&(b||this._callback("onStart"))),f=this._firstPT;f;)f.f?f.t[f.p](f.c*this.ratio+f.s):f.t[f.p]=f.c*this.ratio+f.s,f=f._next;this._onUpdate&&(0>a&&this._startAt&&a!==-1e-4&&this._startAt.render(a,b,c),b||(this._time!==h||d||c)&&this._callback("onUpdate")),e&&(!this._gc||c)&&(0>a&&this._startAt&&!this._onUpdate&&a!==-1e-4&&this._startAt.render(a,b,c),d&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!b&&this.vars[e]&&this._callback(e),0===i&&this._rawPrevTime===m&&g!==m&&(this._rawPrevTime=0))}},h._kill=function(a,b,c){if("all"===a&&(a=null),null==a&&(null==b||b===this.target))return this._lazy=!1,this._enabled(!1,!1);b="string"!=typeof b?b||this._targets||this.target:G.selector(b)||b;var d,e,f,g,h,i,j,k,l,m=c&&this._time&&c._startTime===this._startTime&&this._timeline===c._timeline;if((p(b)||H(b))&&"number"!=typeof b[0])for(d=b.length;--d>-1;)this._kill(a,b[d],c)&&(i=!0);else{if(this._targets){for(d=this._targets.length;--d>-1;)if(b===this._targets[d]){h=this._propLookup[d]||{},this._overwrittenProps=this._overwrittenProps||[],e=this._overwrittenProps[d]=a?this._overwrittenProps[d]||{}:"all";break}}else{if(b!==this.target)return!1;h=this._propLookup,e=this._overwrittenProps=a?this._overwrittenProps||{}:"all"}if(h){if(j=a||h,k=a!==e&&"all"!==e&&a!==h&&("object"!=typeof a||!a._tempKill),c&&(G.onOverwrite||this.vars.onOverwrite)){for(f in j)h[f]&&(l||(l=[]),l.push(f));if((l||!a)&&!$(this,c,b,l))return!1}for(f in j)(g=h[f])&&(m&&(g.f?g.t[g.p](g.s):g.t[g.p]=g.s,i=!0),g.pg&&g.t._kill(j)&&(i=!0),g.pg&&0!==g.t._overwriteProps.length||(g._prev?g._prev._next=g._next:g===this._firstPT&&(this._firstPT=g._next),g._next&&(g._next._prev=g._prev),g._next=g._prev=null),delete h[f]),k&&(e[f]=1);!this._firstPT&&this._initted&&this._enabled(!1,!1)}}return i},h.invalidate=function(){return this._notifyPluginsOfEnabled&&G._onPluginEvent("_onDisable",this),this._firstPT=this._overwrittenProps=this._startAt=this._onUpdate=null,this._notifyPluginsOfEnabled=this._active=this._lazy=!1,this._propLookup=this._targets?{}:[],D.prototype.invalidate.call(this),this.vars.immediateRender&&(this._time=-m,this.render(Math.min(0,-this._delay))),this},h._enabled=function(a,b){if(j||i.wake(),a&&this._gc){var c,d=this._targets;if(d)for(c=d.length;--c>-1;)this._siblings[c]=Z(d[c],this,!0);else this._siblings=Z(this.target,this,!0)}return D.prototype._enabled.call(this,a,b),this._notifyPluginsOfEnabled&&this._firstPT?G._onPluginEvent(a?"_onEnable":"_onDisable",this):!1},G.to=function(a,b,c){return new G(a,b,c)},G.from=function(a,b,c){return c.runBackwards=!0,c.immediateRender=0!=c.immediateRender,new G(a,b,c)},G.fromTo=function(a,b,c,d){return d.startAt=c,d.immediateRender=0!=d.immediateRender&&0!=c.immediateRender,new G(a,b,d)},G.delayedCall=function(a,b,c,d,e){return new G(b,0,{delay:a,onComplete:b,onCompleteParams:c,callbackScope:d,onReverseComplete:b,onReverseCompleteParams:c,immediateRender:!1,lazy:!1,useFrames:e,overwrite:0})},G.set=function(a,b){return new G(a,0,b)},G.getTweensOf=function(a,b){if(null==a)return[];a="string"!=typeof a?a:G.selector(a)||a;var c,d,e,f;if((p(a)||H(a))&&"number"!=typeof a[0]){for(c=a.length,d=[];--c>-1;)d=d.concat(G.getTweensOf(a[c],b));for(c=d.length;--c>-1;)for(f=d[c],e=c;--e>-1;)f===d[e]&&d.splice(c,1)}else for(d=Z(a).concat(),c=d.length;--c>-1;)(d[c]._gc||b&&!d[c].isActive())&&d.splice(c,1);return d},G.killTweensOf=G.killDelayedCallsTo=function(a,b,c){"object"==typeof b&&(c=b,b=!1);for(var d=G.getTweensOf(a,b),e=d.length;--e>-1;)d[e]._kill(c,a)};var ba=t("plugins.TweenPlugin",function(a,b){this._overwriteProps=(a||"").split(","),this._propName=this._overwriteProps[0],this._priority=b||0,this._super=ba.prototype},!0);if(h=ba.prototype,ba.version="1.19.0",ba.API=2,h._firstPT=null,h._addTween=O,h.setRatio=M,h._kill=function(a){var b,c=this._overwriteProps,d=this._firstPT;if(null!=a[this._propName])this._overwriteProps=[];else for(b=c.length;--b>-1;)null!=a[c[b]]&&c.splice(b,1);for(;d;)null!=a[d.n]&&(d._next&&(d._next._prev=d._prev),d._prev?(d._prev._next=d._next,d._prev=null):this._firstPT===d&&(this._firstPT=d._next)),d=d._next;return!1},h._mod=h._roundProps=function(a){for(var b,c=this._firstPT;c;)b=a[this._propName]||null!=c.n&&a[c.n.split(this._propName+"_").join("")],b&&"function"==typeof b&&(2===c.f?c.t._applyPT.m=b:c.m=b),c=c._next},G._onPluginEvent=function(a,b){var c,d,e,f,g,h=b._firstPT;if("_onInitAllProps"===a){for(;h;){for(g=h._next,d=e;d&&d.pr>h.pr;)d=d._next;(h._prev=d?d._prev:f)?h._prev._next=h:e=h,(h._next=d)?d._prev=h:f=h,h=g}h=b._firstPT=e}for(;h;)h.pg&&"function"==typeof h.t[a]&&h.t[a]()&&(c=!0),h=h._next;return c},ba.activate=function(a){for(var b=a.length;--b>-1;)a[b].API===ba.API&&(Q[(new a[b])._propName]=a[b]);return!0},s.plugin=function(a){if(!(a&&a.propName&&a.init&&a.API))throw"illegal plugin definition.";var b,c=a.propName,d=a.priority||0,e=a.overwriteProps,f={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_mod",mod:"_mod",initAll:"_onInitAllProps"},g=t("plugins."+c.charAt(0).toUpperCase()+c.substr(1)+"Plugin",function(){ba.call(this,c,d),this._overwriteProps=e||[]},a.global===!0),h=g.prototype=new ba(c);h.constructor=g,g.API=a.API;for(b in f)"function"==typeof a[b]&&(h[f[b]]=a[b]);return g.version=a.version,ba.activate([g]),g},f=a._gsQueue){for(g=0;g<f.length;g++)f[g]();for(h in q)q[h].func||a.console.log("GSAP encountered missing dependency: "+h)}j=!1}}("undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window,"Tween
2836Max");
2837class AddressAutocomplete{constructor(apiKey){this.apiKey=apiKey;this.addressPicked=false;this.currentFilters={};this.lastValidationTime=0;this.rateLimitInterval=5000;this.cachedData=null;this.cachedValidationResult=null;this.suggestionCounter=0;this.initAutoComplete();this.initAddressIdField();this.initStateField();}
2838initAddressIdField(){this.addressIdField=document.querySelector('[name="address_id"]');if(!this.addressIdField){this.addressIdField=document.createElement("input");this.addressIdField.type="hidden";this.addressIdField.name="address_id";if(this.inputField&&this.inputField.form){this.inputField.form.appendChild(this.addressIdField);}else{document.body.appendChild(this.addressIdField);}}}
2839initStateField(){this.stateIdField=document.querySelector('[name="state_name"]');if(!this.stateIdField){this.stateIdField=document.createElement("input");this.stateIdField.type="hidden";this.stateIdField.name="state_name";if(this.inputField&&this.inputField.form){this.inputField.form.appendChild(this.stateIdField);}else{document.body.appendChild(this.stateIdField);}}}
2840isAddressPicked(){return this.addressPicked;}
2841isErrored(){return this.errored;}
2842initAutoComplete(){const inputSelector='[name="fulladdress"]';this.inputField=document.querySelector(inputSelector);if(!this.inputField){console.error(`Input field with selector ${inputSelector} not found.`);return;}
2843const wrapper=document.createElement("div");wrapper.classList.add("autoComplete_wrapper");this.inputField.parentNode.insertBefore(wrapper,this.inputField);wrapper.appendChild(this.inputField);this.autoCompleteJS=new autoComplete({selector:inputSelector,data:{src:(query)=>{if(this.containerSuggestions&&this.containerSuggestions.length>0){return new Promise((resolve)=>{resolve(this.containerSuggestions);});}
2844return this.fetchAddressSuggestions(query);},keys:["description"],cache:false,},debounce:100,searchEngine:function(query,record){return record;},resultsList:{noResults:true,maxResults:1000,tabSelect:true,},});this.inputField.addEventListener("focus",()=>{this.autoCompleteJS.open();});this.inputField.addEventListener("selection",this.handleSelection.bind(this));this.inputField.addEventListener("input",(event)=>{if(!this.ignoreInputChange){this.containerSuggestions=[];}
2845this.ignoreInputChange=false;if(this.addressPicked){this.addressPicked=false;if(this.addressIdField){this.addressIdField.value="";}}});}
2846async handleSelection(event){const feedback=event.detail;const selectedData=feedback.selection.value;const id=selectedData.id;const query=selectedData.description;this.autoCompleteJS.input.classList.remove("invalid-address-input");if(selectedData.type==='Address'){this.inputField.value=query;this.addressPicked=true;if(this.addressIdField){this.addressIdField.value=id;}
2847this.selectedData=selectedData;}
2848if(selectedData.type==='Container'){try{await this.fetchAutocompleteSuggestions(selectedData.id);this.triggerChangeEvent();}catch(error){this.handleError(error);}}}
2849async fetchAutocompleteSuggestions(containerId){const advancedData=await this.fetchAdvancedDataByContainer(containerId,globalLang);if(!advancedData||!advancedData.data){console.warn("No advanced data available to update suggestions.");return;}
2850this.containerSuggestions=this.mapSuggestions(advancedData.data);}
2851triggerChangeEvent(){const inputElement=this.autoCompleteJS.input;const inputEvent=new Event('input',{bubbles:true,cancelable:true});this.ignoreInputChange=true;inputElement.dispatchEvent(inputEvent);}
2852isCachedDataValid(){return JSON.stringify(this.selectedData)===JSON.stringify(this.cachedData);}
2853validateAddress(){const currentTime=Date.now();if(this.cachedData&&this.isCachedDataValid()){return Promise.resolve(this.cachedValidationResult);}
2854if(currentTime-this.lastValidationTime<this.rateLimitInterval){return Promise.resolve(false);}
2855this.lastValidationTime=currentTime;return new Promise((resolve)=>{if(!this.isAddressPicked()){return resolve(false);}
2856this.processAddress(this.selectedData).then((result)=>{this.cachedData=JSON.parse(JSON.stringify(this.selectedData));this.cachedValidationResult=result;resolve(result);}).catch((error)=>{this.handleError(error);resolve(false);});});}
2857async processAddress(selectedData){const id=selectedData.id;const query=selectedData.description;
2857try{const fullAddress=await this.fetchFullAddress(id,query);if(!fullAddress){throw new Error("Full address data is missing.");}
2858this.fillAddressFields(fullAddress);const missingFields=this.findMissingAddressFields();if(missingFields.length>0){this.requestAddressCompletion(missingFields);return false;}
2859return true;}catch(error){this.handleError(error);return false;}}
2860fillAddressFields(fullAddress){document.querySelector('[name="address"]').value=fullAddress.address||fullAddress.line1||"";document.querySelector('[name="city"]').value=fullAddress.city||"";document.querySelector('[name="postalCode"]').value=fullAddress.pc||fullAddress.postalOrZip||"";if(fullAddress.provinceOrState){this.stateIdField.value=fullAddress.provinceOrState;}}
2861findMissingAddressFields(){const requiredFields=["address","city"];const countryCode=document.querySelector('[name="countryCode"]').value;if(countryCode&&this.isPostalCodeRequired(countryCode)){requiredFields.push("postalCode");}
2862return requiredFields.filter(name=>document.querySelector(`[name="${name}"]`).value.trim()==="");}
2863requestAddressCompletion(missingFields){this.errored=true;console.warn("Picked address is incomplete, missing:",missingFields.join(", "));window.trackEvent&&window.trackEvent("Address Autocomplete","Incomplete Address",missingFields.join(","));window._paq&&_paq.push(['trackEvent',"Address Autocomplete","Incomplete Address",missingFields.join(",")]);this.showManualAddressFields();$(`.form-group__address [name="${missingFields[0]}"]`).focus();}
2864handleError(error){this.errored=true;console.error("Address verification error:",error);this.unhideAddressFields();}
2865unhideAddressFields(){this.showManualAddressFields();$('.form-group__address [name="address"]').focus();const addressValue=this.inputField.value;document.querySelector('[name="address"]').value=addressValue}
2866showManualAddressFields(){const hiddenAddressFields=document.querySelectorAll(".form-group__address.hidden");hiddenAddressFields.forEach(field=>{field.classList.remove("hidden");});const autocompleteField=document.querySelector(".form-group__autocomplete");if(autocompleteField){autocompleteField.classList.add("hidden");}
2867$('.form-group__address [name="address"]').attr('required','required');$('.form-group__address [name="city"]').attr('required','required');const countryCode=document.querySelector('[name="countryCode"]').value;if(countryCode&&this.isPostalCodeRequired(countryCode)){$('.form-group__address [name="postalCode"]').attr('required','required');}}
2868async fetchAdvancedDataByContainer(container,language='EN'){const url=`https://api.postgrid.com/v1/intl_addver/completions?container=${encodeURIComponent(container)}&language=${encodeURIComponent(language.toUpperCase())}&advanced=true`;try{const response=await fetch(url,{method:'GET',headers:{'x-api-key':this.apiKey,},});if(!response.ok){throw new Error(`Error fetching advanced data: ${response.status} ${response.statusText}`);}
2869const data=await response.json();if(data.status!=='success'){throw new Error(`Advanced data fetch unsuccessful: ${data.message||'Unknown error'}`);}
2870return data;}catch(error){console.error("Error in fetchAdvancedDataByContainer:",error);throw error;}}
2871async fetchAddressSuggestions(query){this.autoCompleteJS.input.classList.remove("invalid-address-input");try{const filters=this.getFilterValues();const filterCombinations=this.buildFilterCombinations(filters);let combinations={};let suggestions=[];for(const combination of filterCombinations){const url=this.constructUrl(query,combination);if(combinations[url]){continue;}
2872combinations[url]=true;const data=await this.fetchData(url);if(data&&data.data&&data.data.length>0){this.currentFilters=combination;suggestions.push(...this.mapSuggestions(data.data));}}
2873suggestions=suggestions.filter((suggestion,index,self)=>index===self.findIndex((s)=>(s.id===suggestion.id&&s.description===suggestion.description)));if(suggestions.length>0){return suggestions;}
2874this.currentFilters={};return[];}catch(error){this.handleError(error);return[];}}
2875async fetchData(url){try{const response=await fetch(url,{headers:{"x-api-key":this.apiKey,},});if(!response.ok){throw new Error(`Error fetching data from ${url}: ${response.status} ${response.statusText}`);}
2876const data=await response.json();if(data.status!=='success'){throw new Error(`Data fetch unsuccessful: ${data.message||'Unknown error'}`);}
2877return data;}catch(error){console.error(`Fetch error for ${url}:`,error);throw error;}}
2878mapSuggestions(data){return data.map((item,index)=>({id:item.id||index,description:(item.text||`${item.preview.address} ${item.preview.city} ${item.preview.pc}`)+(item.description?" "+item.description:""),type:item.type||'Address',}));}
2879async fetchFullAddress(id,query){try{const{countryCode,stateProvince,city}=this.currentFilters;const isUS=countryCode==="US";const method=isUS?"addver":"intl_addver";let modifiedId=id;if(method==="intl_addver"){const idParts=id.split("|");if(idParts.length>4){idParts[idParts.length-1]=idParts[idParts.length-1].replace(/_.+$/,"_ENG");modifiedId=idParts.join("|");}}
2880window.trackEvent&&window.trackEvent("Address Autocomplete","Full Address Fetch",id);const countryParam=isUS?{countryFilter:countryCode}:{countriesFilter:countryCode};const stateParam=stateProvince?{stateFilter:stateProvince}:{};const cityParam=city?{cityFilter:city}:{};const bodyParams={id:modifiedId,partialStreet:query,language:'en',...countryParam,...stateParam,...cityParam,};const response=await fetch(`https://api.postgrid.com/v1/${method}/completions`,{method:"POST",headers:{"x-api-key":this.apiKey,"Content-Type":"application/json",},body:JSON.stringify(bodyParams),});if(!response.ok){throw new Error(`Error fetching full address: ${response.status} ${response.statusText}`);}
2881const data=await response.json();if(data.status!=='success'){throw new Error(`Full address fetch unsuccessful: ${data.message||'Unknown error'}`);}
2882let addressData=data.data;if(Array.isArray(addressData)){addressData=addressData[0].address;}
2883if(!addressData){throw new Error("Address data is empty.");}
2884return addressData;}catch(error){console.error("Error fetching full address:",error);throw error;}}
2885getFilterValues(){const countryCode=document.querySelector('[name="countryCode"]').value;const stateProvinceValue=document.querySelector('[name="stateProvince"]').value;let stateProvince="";if(stateProvinceValue){const parts=stateProvinceValue.split("-");stateProvince=parts.length>1?parts[1]:stateProvinceValue;}
2886const city=document.querySelector('[name="city"]').value;return{countryCode,stateProvince,city};}
2887buildFilterCombinations(filters){const{countryCode,stateProvince,city}=filters;return[{countryCode,stateProvince},{countryCode},];}
2888constructUrl(query,filters){const{countryCode,stateProvince,city}=filters;const isUS=countryCode==="US";const method=isUS?"addver":"intl_addver";const countryParam=isUS?`&countryFilter=${encodeURIComponent(countryCode)}`:`&countriesFilter=${encodeURIComponent(countryCode)}`;const stateParam=stateProvince?`&stateFilter=${encodeURIComponent(stateProvince)}`:"";const cityParam=city?`&cityFilter=${encodeURIComponent(city)}`:"";const allParams=`${countryParam}${stateParam}${cityParam}`;return `https://api.postgrid.com/v1/${method}/completions?partialStreet=${encodeURIComponent(query)}&language=${encodeURIComponent(globalLang)}${allParams}`;}
2889showSuggestions(){this.autoCompleteJS.start();this.autoCompleteJS.input.focus();this.autoCompleteJS.open();this.autoCompleteJS.input.classList.add("invalid-address-input");const isMobile=window.innerWidth<=768;this.autoCompleteJS.input.scrollIntoView({behavior:"smooth",block:isMobile?"start":"center",});this.suggestionCounter++;if(this.suggestionCounter>=3){window.trackEvent&&window.trackEvent("Address Autocomplete","Show Suggestions","3 times");window._paq&&_paq.push(['trackEvent',"Address Autocomplete","Show Suggestions","3 times"]);this.unhideAddressFields();this.errored=true;}
2890if(isMobile){const elementPosition=this.autoCompleteJS.input.getBoundingClientRect().top+window.pageYOffset;window.scrollTo({top:elementPosition-100,behavior:"smooth",});}
2891window.trackEvent&&window.trackEvent("Address Autocomplete","Show Suggestions");window._paq&&_paq.push(['trackEvent',"Address Autocomplete","Show Suggestions",this.autoCompleteJS.input.value]);}
2892isPostalCodeRequired(countryCode){const countriesWithMandatoryPostalCodes=["US","CA","GB","DE","FR","AU","JP","IT","ES","NL","CH","SE","NO","FI","DK","BE","AT","IE","PT","NZ","KR","CN","IN","BR","MX","ZA","RU","PL","CZ","HU","SG","MY","TH","PH","AR","CL","CO","PE","IL","TR","AE","SA","EG","NG","KE"];return countriesWithMandatoryPostalCodes.includes(countryCode);}}
2893var e,t;e=this,t=function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};
vendor: 5,757 bytes, line 2893
2893n%2?e(Object(i),!0).forEach((function(e){r(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||o(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var u=function(e){return"string"==typeof e?document.querySelector(e):e()},a=function(e,t){var n="string"==typeof e?document.createElement(e):e;for(var r in t){var i=t[r];if("inside"===r)i.append(n);else if("dest"===r)u(i[0]).insertAdjacentElement(i[1],n);else if("around"===r){var o=i;o.parentNode.insertBefore(n,o),n.append(o),null!=o.getAttribute("autofocus")&&o.focus()}else r in n?n[r]=i:n.setAttribute(r,i)}return n},c=function(e,t){return e=String(e).toLowerCase(),t?e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").normalize("NFC"):e},l=function(e,n){return a("mark",t({innerHTML:e},"string"==typeof n&&{class:n})).outerHTML},f=function(e,t){t.input.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:t.feedback,cancelable:!0}))},p=function(e,t,n){var r=n||{},i=r.mode,o=r.diacritics,s=r.highlight,u=c(t,o);if(t=String(t),e=c(e,o),"loose"===i){var a=(e=e.replace(/ /g,"")).length,f=0,p=Array.from(t).map((function(t,n){return f<a&&u[n]===e[f]&&(t=s?l(t,s):t,f++),t})).join("");if(f===a)return p}else{var d=u.indexOf(e);if(~d)return e=t.substring(d,d+e.length),d=s?t.replace(e,l(e,s)):t}},d=function(e,t){return new Promise((function(n,r){var i;return(i=e.data).cache&&i.store?n():new Promise((function(e,n){return"function"==typeof i.src?i.src(t).then(e,n):e(i.src)})).then((function(t){try{return e.feedback=i.store=t,f("response",e),n()}catch(e){return r(e)}}),r)}))},h=function(e,t){var n=t.data,r=t.searchEngine,i=[];n.store.forEach((function(s,u){var a=function(n){var o=n?s[n]:s,u="function"==typeof r?r(e,o):p(e,o,{mode:r,diacritics:t.diacritics,highlight:t.resultItem.highlight});if(u){var a={match:u,value:s};n&&(a.key=n),i.push(a)}};if(n.keys){var c,l=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=o(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,u=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){a=!0,s=e},f:function(){try{u||null==n.return||n.return()}finally{if(a)throw s}}}}(n.keys);try{for(l.s();!(c=l.n()).done;)a(c.value)}catch(e){l.e(e)}finally{l.f()}}else a()})),n.filter&&(i=n.filter(i));var s=i.slice(0,t.resultsList.maxResults);t.feedback={query:e,matches:i,results:s},f("results",t)},m="aria-expanded",b="aria-activedescendant",y="aria-selected",v=function(e,n){e.feedback.selection=t({index:n},e.feedback.results[n])},g=function(e){e.isOpen||((e.wrapper||e.input).setAttribute(m,!0),e.list.removeAttribute("hidden"),e.isOpen=!0,f("open",e))},w=function(e){e.isOpen&&((e.wrapper||e.input).setAttribute(m,!1),e.input.setAttribute(b,""),e.list.setAttribute("hidden",""),e.isOpen=!1,f("close",e))},O=function(e,t){var n=t.resultItem,r=t.list.getElementsByTagName(n.tag),o=!!n.selected&&n.selected.split(" ");if(t.isOpen&&r.length){var s,u,a=t.cursor;e>=r.length&&(e=0),e<0&&(e=r.length-1),t.cursor=e,a>-1&&(r[a].removeAttribute(y),o&&(u=r[a].classList).remove.apply(u,i(o))),r[e].setAttribute(y,!0),o&&(s=r[e].classList).add.apply(s,i(o)),t.input.setAttribute(b,r[t.cursor].id),t.list.scrollTop=r[e].offsetTop-t.list.clientHeight+r[e].clientHeight+5,t.feedback.cursor=t.cursor,v(t,e),f("navigate",t)}},A=function(e){O(e.cursor+1,e)},k=function(e){O(e.cursor-1,e)},L=function(e,t,n){(n=n>=0?n:e.cursor)<0||(e.feedback.event=t,v(e,n),f("selection",e),w(e))};function j(e,n){var r=this;return new Promise((function(i,o){var s,u;return s=n||((u=e.input)instanceof HTMLInputElement||u instanceof HTMLTextAreaElement?u.value:u.innerHTML),function(e,t,n){return t?t(e):e.length>=n}(s=e.query?e.query(s):s,e.trigger,e.threshold)?d(e,s).then((function(n){try{return e.feedback instanceof Error?i():(h(s,e),e.resultsList&&function(e){var n=e.resultsList,r=e.list,i=e.resultItem,o=e.feedback,s=o.matches,u=o.results;if(e.cursor=-1,r.innerHTML="",s.length||n.noResults){var c=new DocumentFragment;u.forEach((function(e,n){var r=a(i.tag,t({id:"".concat(i.id,"_").concat(n),role:"option",innerHTML:e.match,inside:c},i.class&&{class:i.class}));i.element&&i.element(r,e)})),r.append(c),n.element&&n.element(r,o),g(e)}else w(e)}(e),c.call(r))}catch(e){return o(e)}}
2893),o):(w(e),c.call(r));function c(){return i()}}))}var S=function(e,t){for(var n in e)for(var r in e[n])t(n,r)},T=function(e){var n,r,i,o=e.events,s=(n=function(){return j(e)},r=e.debounce,function(){clearTimeout(i),i=setTimeout((function(){return n()}),r)}),u=e.events=t({input:t({},o&&o.input)},e.resultsList&&{list:o?t({},o.list):{}}),a={input:{input:function(){s()},keydown:function(t){!function(e,t){switch(e.keyCode){case 40:case 38:e.preventDefault(),40===e.keyCode?A(t):k(t);break;case 13:t.submit||e.preventDefault(),t.cursor>=0&&L(t,e);break;case 9:t.resultsList.tabSelect&&t.cursor>=0&&L(t,e);break;case 27:t.input.value="",w(t)}}(t,e)},blur:function(){w(e)}},list:{mousedown:function(e){e.preventDefault()},click:function(t){!function(e,t){var n=t.resultItem.tag.toUpperCase(),r=Array.from(t.list.querySelectorAll(n)),i=e.target.closest(n);i&&i.nodeName===n&&L(t,e,r.indexOf(i))}(t,e)}}};S(a,(function(t,n){(e.resultsList||"input"===n)&&(u[t][n]||(u[t][n]=a[t][n]))})),S(u,(function(t,n){e[t].addEventListener(n,u[t][n])}))};function E(e){var n=this;return new Promise((function(r,i){var o,s,u;if(o=e.placeHolder,u={role:"combobox","aria-owns":(s=e.resultsList).id,"aria-haspopup":!0,"aria-expanded":!1},a(e.input,t(t({"aria-controls":s.id,"aria-autocomplete":"both"},o&&{placeholder:o}),!e.wrapper&&t({},u))),e.wrapper&&(e.wrapper=a("div",t({around:e.input,class:e.name+"_wrapper"},u))),s&&(e.list=a(s.tag,t({dest:[s.destination,s.position],id:s.id,role:"listbox",hidden:"hidden"},s.class&&{class:s.class}))),T(e),e.data.cache)return d(e).then((function(e){try{return c.call(n)}catch(e){return i(e)}}),i);function c(){return f("init",e),r()}return c.call(n)}))}function x(e){var t=e.prototype;t.init=function(){E(this)},t.start=function(e){j(this,e)},t.unInit=function(){if(this.wrapper){var e=this.wrapper.parentNode;e.insertBefore(this.input,this.wrapper),e.removeChild(this.wrapper)}var t;S((t=this).events,(function(e,n){t[e].removeEventListener(n,t.events[e][n])}))},t.open=function(){g(this)},t.close=function(){w(this)},t.goTo=function(e){O(e,this)},t.next=function(){A(this)},t.previous=function(){k(this)},t.select=function(e){L(this,null,e)},t.search=function(e,t,n){return p(e,t,n)}}return function e(t){this.options=t,this.id=e.instances=(e.instances||0)+1,this.name="autoComplete",this.wrapper=1,this.threshold=1,this.debounce=0,this.resultsList={position:"afterend",tag:"ul",maxResults:5},this.resultItem={tag:"li"},function(e){var t=e.name,r=e.options,i=e.resultsList,o=e.resultItem;for(var s in r)if("object"===n(r[s]))for(var a in e[s]||(e[s]={}),r[s])e[s][a]=r[s][a];else e[s]=r[s];e.selector=e.selector||"#"+t,i.destination=i.destination||e.selector,i.id=i.id||t+"_list_"+e.id,o.id=o.id||t+"_result",e.input=u(e.selector)}(this),x.call(this,e),E(this)}},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).autoComplete=t();
2894!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.riot=t()}(this,function(){"use strict";function e(e){return mt.test(e)}function t(e){return typeof e===ot}function n(e){return e&&typeof e===it}function r(e){return typeof e===st}function i(e){return typeof e===rt}function s(e){return r(e)||null===e||""===e}function o(e){return Array.isArray(e)||e instanceof Array}function a(e,t){var n=Object.getOwnPropertyDescriptor(e,t);return r(e[t])||n&&n.writable}function u(e,t){return Array.prototype.slice.call((t||document).querySelectorAll(e))}function c(e,t){return(t||document).querySelector(e)}function l(){return document.createDocumentFragment()}function p(){return document.createTextNode("")}function f(e){return!!e.ownerSVGElement}function h(e){return"svg"===e?document.createElementNS(ut,e):document.createElement(e)}function d(e,t){if(r(e.innerHTML)){var n=(new DOMParser).parseFromString(t,"application/xml"),i=e.ownerDocument.importNode(n.documentElement,!0);e.appendChild(i)}else e.innerHTML=t}function g(e,t){e.style.display=t?"":"none",e.hidden=!t}function m(e,t){e.removeAttribute(t)}function v(e){return Object.keys(e).reduce(function(t,n){return t+" "+n+": "+e[n]+";"},"")}function x(e,t){return e.getAttribute(t)}function y(e,t,n){var r=ct.exec(t);r&&r[1]?e.setAttributeNS(at,r[1],n):e.setAttribute(t,n)}function b(e,t,n){e.insertBefore(t,n.parentNode&&n)}function w(e,t){if(e)for(var n;n=dt.exec(e);)t(n[1].toLowerCase(),n[2]||n[3]||n[4])}function _(e,t,n){if(e){var r,i=t(e,n);if(!1===i)return;for(e=e.firstChild;e;)r=e.nextSibling,_(e,t,i),e=r}}function O(e,t){for(var n=e?e.length:0,r=0;r<n;++r)t(e[r],r);return e}function j(e,t){return-1!==e.indexOf(t)}function E(e){return e.replace(/-(\w)/g,function(e,t){return t.toUpperCase()})}function N(e,t){return e.slice(0,t.length)===t}function C(e,t,n,r){return Object.defineProperty(e,t,S({value:n,enumerable:!1,writable:!1,
2894configurable:!0},r)),e}function S(e){for(var t,n=arguments,r=1;r<n.length;++r)if(t=n[r])for(var i in t)a(e,i)&&(e[i]=t[i]);return e}function A(e,t,n){var r=this.__.parent,i=this.__.item;if(!i)for(;r&&!i;)i=r.__.item,r=r.__.parent;if(a(n,"currentTarget")&&(n.currentTarget=e),a(n,"target")&&(n.target=n.srcElement),a(n,"which")&&(n.which=n.charCode||n.keyCode),n.item=i,t.call(this,n),kt.autoUpdate&&!n.preventUpdate){var s=ue(this);s.isMounted&&s.update()}}function T(e,t,n,r){var i,s=A.bind(r,n,t);n[e]=null,i=e.replace(ht,""),j(r.__.listeners,n)||r.__.listeners.push(n),n[nt]||(n[nt]={}),n[nt][e]&&n.removeEventListener(i,n[nt][e]),n[nt][e]=s,n.addEventListener(i,s,!1)}function k(e,t,n){var r,s=e.tag||e.dom._tag,o=(s?s.__:{}).head,a="VIRTUAL"===e.dom.tagName;s&&e.tagName===n?s.update():(s&&(a&&(r=p(),o.parentNode.insertBefore(r,o)),s.unmount(!0)),i(n)&&(e.impl=Ze[n],e.impl&&(e.tag=s=ae(e.impl,{root:e.dom,parent:t,tagName:n},e.dom.innerHTML,t),O(e.attrs,function(e){return y(s.root,e.name,e.value)}),e.tagName=n,s.mount(),a&&de(s,r||s.root),t.__.onUnmount=function(){var e=s.opts.dataIs;fe(s.parent.tags,e,s),fe(s.__.parent.tags,e,s),s.unmount()})))}function L(e){return e?(e=e.replace(Ke,""),gt[e]&&(e=gt[e]),e):null}function I(e){if(!this.root||!x(this.root,"virtualized")){var r,i,o,a=e.dom,u=L(e.attr),c=j([et,tt],u),l=e.root&&"VIRTUAL"===e.root.tagName,p=a&&(e.parent||a.parentNode),f="style"===u,h="class"===u;if(e._riot_id)e.__.wasCreated?e.update():(e.mount(),l&&de(e,e.root));else{if(e.update)return e.update();if(o=St(e.expr,c?S({},Object.create(this.parent),this):this),r=!s(o),(i=n(o))&&(i=!h&&!f,h?o=St(JSON.stringify(o),this):f&&(o=v(o))),!e.attr||e.isAttrRemoved&&r&&!1!==o||(m(a,e.attr),e.isAttrRemoved=!0),e.bool&&(o=!!o&&u),e.isRtag)return k(e,this,o);if((!e.wasParsedOnce||e.value!==o)&&(e.value=o,e.wasParsedOnce=!0,!i||c)){if(s(o)&&(o=""),!u)return o+="",void(p&&(e.parent=p,"TEXTAREA"===p.tagName?(p.value=o,vt||(a.nodeValue=o)):a.nodeValue=o));t(o)?T(u,o,a,this):c?g(a,u===tt?!o:o):(e.bool&&(a[u]=o),"value"===u&&a.value!==o&&(a.value=o),r&&!1!==o&&y(a,u,o),f&&a.hidden&&g(a,!1))}}}}function R(e){O(e,I.bind(this))}function M(e,t,n,r){var i=r?Object.create(r):{};return i[e.key]=t,e.pos&&(i[e.pos]=n),i}function $(e,t){for(var n=t.length,r=e.length;n>r;)n--,P.apply(t[n],[t,n])}function P(e,t){e.splice(t,1),this.unmount(),fe(this.parent,this,this.__.tagName,!0)}function F(e){var t=this;O(Object.keys(this.tags),function(n){oe.apply(t.tags[n],[n,e])})}function H(e,t,n){n?me.apply(this,[e,t]):b(e,this.root,t.root)}function z(e,t,n){n?ge.apply(this,[e,t]):b(e,this.root,t.root)}function U(e,t){t?ge.call(this,e):e.appendChild(this.root)}function V(e,t,n){var r,s=typeof x(e,Ye)!==rt||m(e,Ye),a=le(e),u=Ze[a],c=e.parentNode,f=p(),h=ie(e),d=x(e,Qe),g=[],v=!Ze[a],y="VIRTUAL"===e.tagName,b=[];return m(e,Xe),n=St.loopKeys(n),n.isLoop=!0,d&&m(e,Qe),c.insertBefore(f,e),c.removeChild(e),n.update=function(){n.value=St(n.val,t);var c=n.value,p=l(),m=!o(c)&&!i(c),x=f.parentNode;x&&(m?c=(r=c||!1)?Object.keys(c).map(function(e){return M(n,c[e],e)}):[]:r=!1,d&&(c=c.filter(function(e,r){return n.key&&!m?!!St(d,M(n,e,r,t)):!!St(d,S(Object.create(t),e))})),O(c,function(i,o){var l=s&&typeof i===it&&!r,f=b.indexOf(i),d=-1===f,m=!d&&l?f:o,w=g[m],_=o>=b.length,O=l&&d||!l&&!w;i=!r&&n.key?M(n,i,o):i,O?((w=new re(u,{parent:t,isLoop:!0,isAnonymous:v,tagName:a,root:e.cloneNode(v),item:i,index:o},e.innerHTML)).mount(),_?U.apply(w,[p||x,y]):z.apply(w,[x,g[o],y]),_||b.splice(o,0,i),g.splice(o,0,w),h&&pe(t.tags,a,w,!0)):m!==o&&l&&(j(c,b[m])&&(H.apply(w,[x,g[o],y]),g.splice(o,0,g.splice(m,1)[0]),b.splice(o,0,b.splice(m,1)[0])),n.pos&&(w[n.pos]=o),!h&&w.tags&&F.call(w,o)),w.__.item=i,w.__.index=o,w.__.parent=t,O||w.update(i)}),$(c,g),b=c.slice(),x.insertBefore(p,f))},n.unmount=function(){O(g,function(e){e.unmount()})},n}function B(e,t,n){var r=this;_(e,function(t,i){var s,o,a,u=t.nodeType,c=i.parent;if(!n&&t===e)return{parent:c};if(3===u&&"STYLE"!==t.parentNode.tagName&&St.hasExpr(t.nodeValue)&&c.children.push({dom:t,expr:t.nodeValue}),1!==u)return i;var l="VIRTUAL"===t.tagName;if(s=x(t,Xe))return l&&y(t,"loopVirtual",!0),c.children.push(V(t,r,s)),!1;if(s=x(t,Qe))return c.children.push(Object.create(Lt).init(t,r,s)),!1;if((o=x(t,Je))&&St.hasExpr(o))return c.children.push({isRtag:!0,expr:o,dom:t,attrs:[].slice.call(t.attributes)}),!1;if(a=ie(t),l&&(x(t,"virtualized")&&t.parentElement.removeChild(t),a||x(t,"virtualized")||x(t,"loopVirtual")||(a={tmpl:t.outerHTML})),a&&(t!==e||n)){if(!l||x(t,Je))return c.children.push(ae(a,{root:t,parent:r},t.innerHTML,r)),!1;y(t,"virtualized",!0);var p=new re({tmpl:t.outerHTML},{root:t,parent:r},t.innerHTML);c.children.push(p)}return q.apply(r,[t,t.attributes,function(e,t){t&&c.children.push(t)}]),{parent:c}},{parent:{children:t}})}function q(t,n,r){var i=this;O(n,function(n){if(!n)return!1;var s,o=n.name,a=e(o);j(We,o)?s=Object.create(It).init(t,i,o,n.value):St.hasExpr(n.value)&&(s={dom:t,expr:n.value,attr:o,bool:a}),r(n,s)})}function D(e,t,n){var r="o"===n[0],i=r?"select>":"table>";if(e.innerHTML="<"+i+t.trim()+"</"+i,i=e.firstChild,r)i.selectedIndex=-1;else{var s=Ft[n];s&&1===i.childElementCount&&(i=c(s,i))}return i}function Z(e,t){if(!Rt.test(e))return e;var n={};return t=t&&t.replace($t,function(e,t,r){return n[t]=n[t]||r,""}).trim(),e.replace(Pt,function(e,t,r){return n[t]||r||""}).replace(Mt,function(e,n){return t||n||""})}function G(e,t,n){var r=e&&e.match(/^\s*<([-\w]+)/),i=r&&r[1].toLowerCase(),s=h(n?Ut:zt);return e=Z(e,t),Ht.test(i)?s=D(s,e,i):d(s,e),s}function K(e,t){var n=this,r=n.name,i=n.tmpl,s=n.css,o=n.attrs,a=n.onCreate;return Ze[r]||(W(r,i,s,o,a),Ze[r].class=this.constructor),he(e,r,t,this),s&&Et.inject(),this}function W(e,n,r,i,s){return t(i)&&(s=i,/^[\w-]+\s?=/.test(r)?(i=r,r=""):i=""),r&&(t(r)?s=r:Et.add(r)),e=e.toLowerCase(),Ze[e]={name:e,tmpl:n,attrs:i,fn:s},e}function J(e,t,n,r,i){return n&&Et.add(n,e),Ze[e]={name:e,tmpl:t,attrs:r,fn:i},e}function Q(e,t,r){function s(e){if(e.tagName){var n,i=x(e,Je);t&&i!==t&&(i=t,y(e,Je,t)),(n=he(e,i||e.tagName.toLowerCase(),r))&&c.push(n)}else e.length&&O(e,s)}var o,a,c=[];if(Et.inject(),n(t)&&(r=t,t=0),o=i(e)?(e="*"===e?a=ve():e+ve(e.split(/, */)))?u(e):[]:e,"*"===t){if(t=a||ve(),o.tagName)o=u(t,o);else{var l=[];O(o,function(e){return l.push(u(t,e))}),o=l}t=0}return s(o),c}function X(e,i,s){if(n(e))X("__"+qt+++"__",e,!0);else{var o=s?Bt:Vt;if(!i){if(r(o[e]))throw new Error("Unregistered mixin: "+e);return o[e]}o[e]=t(i)?S(i.prototype,o[e]||{})&&i:S(o[e]||{},i)}}
2894function Y(){return O(De,function(e){return e.update()})}function ee(e){Ze[e]=null}function te(e,t,n,r,i){if(!e||!n){var s=!n&&e?this:t||this;O(i,function(e){e.expr&&R.call(s,[e.expr]),r[E(e.name).replace(Ke,"")]=e.expr?e.expr.value:e.value})}}function ne(e){C(this,"isMounted",e)}function re(e,n,r){void 0===e&&(e={}),void 0===n&&(n={});var s,o=S({},n.opts),a=n.parent,u=n.isLoop,c=!!n.isAnonymous,l=kt.skipAnonymousTags&&c,p=n.item,h=n.index,g=[],v=[],x=[],b=n.root,_=n.tagName||le(b),E="virtual"===_,A=!E&&!e.tmpl,T=[];l||At(this),e.name&&b._tag&&b._tag.unmount(!0),ne.call(this,!1),C(this,"__",{isAnonymous:c,instAttrs:g,innerHTML:r,tagName:_,index:h,isLoop:u,isInline:A,listeners:[],virts:[],wasCreated:!1,tail:null,head:null,parent:null,item:null}),C(this,"_riot_id",++Zt),C(this,"root",b),S(this,{opts:o},p),C(this,"parent",a||null),C(this,"tags",{}),C(this,"refs",{}),A||u&&c?s=b:(E||(b.innerHTML=""),s=G(e.tmpl,r,f(b))),C(this,"update",function(e){var n={},r=this.isMounted&&!l;return S(this,e),te.apply(this,[u,a,c,n,g]),r&&this.isMounted&&t(this.shouldUpdate)&&!this.shouldUpdate(e,n)?this:(u&&c&&se.apply(this,[this.parent,T]),S(o,n),r&&this.trigger("update",e),R.call(this,x),r&&this.trigger("updated"),this)}.bind(this)),C(this,"mixin",function(){var e=this;return O(arguments,function(n){var r,s,o=[],a=["init","__proto__"];n=i(n)?X(n):n,r=t(n)?new n:n;var u=Object.getPrototypeOf(r);do{o=o.concat(Object.getOwnPropertyNames(s||r))}while(s=Object.getPrototypeOf(s||r));O(o,function(n){if(!j(a,n)){var i=Object.getOwnPropertyDescriptor(r,n)||Object.getOwnPropertyDescriptor(u,n),s=i&&(i.get||i.set);!e.hasOwnProperty(n)&&s?Object.defineProperty(e,n,i):e[n]=t(r[n])?r[n].bind(e):r[n]}}),r.init&&r.init.bind(e)()}),this}.bind(this)),C(this,"mount",function(){var t=this;b._tag=this,q.apply(a,[b,b.attributes,function(e,n){!c&&It.isPrototypeOf(n)&&(n.tag=t),e.expr=n,g.push(e)}]),v=[],w(e.attrs,function(e,t){v.push({name:e,value:t})}),q.apply(this,[b,v,function(e,t){t?x.push(t):y(b,e.name,e.value)}]),te.apply(this,[u,a,c,o,g]);var n=X(Ge);if(n&&!l)for(var r in n)n.hasOwnProperty(r)&&t.mixin(n[r]);if(e.fn&&e.fn.call(this,o),l||this.trigger("before-mount"),B.apply(this,[s,x,c]),this.update(p),!c&&!A)for(;s.firstChild;)b.appendChild(s.firstChild);if(C(this,"root",b),!l&&this.parent){var i=ue(this.parent);i.one(i.isMounted?"updated":"mount",function(){ne.call(t,!0),t.trigger("mount")})}else ne.call(this,!0),l||this.trigger("mount");return this.__.wasCreated=!0,this}.bind(this)),C(this,"unmount",function(t){var n,r=this,i=this.root,s=i.parentNode,o=De.indexOf(this);return l||this.trigger("before-unmount"),w(e.attrs,function(e){N(e,Ke)&&(e=e.slice(Ke.length)),m(b,e)}),this.__.listeners.forEach(function(e){Object.keys(e[nt]).forEach(function(t){e.removeEventListener(t,e[nt][t])})}),-1!==o&&De.splice(o,1),(s||E)&&(a?(n=ue(a),E?Object.keys(this.tags).forEach(function(e){fe(n.tags,e,r.tags[e])}):(fe(n.tags,_,this),a!==n&&fe(a.tags,_,this))):d(i,""),s&&!t&&s.removeChild(i)),this.__.virts&&O(this.__.virts,function(e){e.parentNode&&e.parentNode.removeChild(e)}),ce(x),O(g,function(e){return e.expr&&e.expr.unmount&&e.expr.unmount()}),this.__.onUnmount&&this.__.onUnmount(),l||(this.isMounted||this.trigger("mount"),this.trigger("unmount"),this.off("*")),C(this,"isMounted",!1),this.__.wasCreated=!1,delete this.root._tag,this}.bind(this))}function ie(e){return e.tagName&&Ze[x(e,Je)||x(e,Je)||e.tagName.toLowerCase()]}function se(e,t){var n=this;O(Object.keys(e),function(i){var s=j(t,i);(r(n[i])||s)&&(s||t.push(i),n[i]=e[i])})}function oe(e,t){var n,r=this.parent;r&&(o(n=r.tags[e])?n.splice(t,0,n.splice(n.indexOf(this),1)[0]):pe(r.tags,e,this))}function ae(e,t,n,r){var i=new re(e,t,n),s=t.tagName||le(t.root,!0),o=ue(r);return C(i,"parent",o),i.__.parent=r,pe(o.tags,s,i),o!==r&&pe(r.tags,s,i),i}function ue(e){for(var t=e;t.__.isAnonymous&&t.parent;)t=t.parent;return t}function ce(e){O(e,function(e){e instanceof re?e.unmount(!0):e.tagName?e.tag.unmount(!0):e.unmount&&e.unmount()})}function le(e,t){var n=ie(e),r=!t&&x(e,Je);return r&&!St.hasExpr(r)?r:n?n.name:e.tagName.toLowerCase()}function pe(e,t,n,i,s){var a=e[t],u=o(a),c=!r(s);if(!a||a!==n)if(!a&&i)e[t]=[n];else if(a)if(u){var l=a.indexOf(n);if(l===s)return;-1!==l&&a.splice(l,1),c?a.splice(s,0,n):a.push(n)}else e[t]=[a,n];else e[t]=n}function fe(e,t,n,r){if(o(e[t])){var i=e[t].indexOf(n);-1!==i&&e[t].splice(i,1),e[t].length?1!==e[t].length||r||(e[t]=e[t][0]):delete e[t]}else delete e[t]}function he(e,t,n,r){var i=Ze[t],s=Ze[t].class,o=r||(s?Object.create(s.prototype):{}),a=e._innerHTML=e._innerHTML||e.innerHTML,u=S({root:e,opts:n},{parent:n?n.parent:null});return i&&e&&re.apply(o,[i,u,a]),o&&o.mount&&(o.mount(!0),j(De,o)||De.push(o)),o}function de(e,t){var n=l();ge.call(e,n),t.parentNode.replaceChild(n,t)}function ge(e,t){var n,r,i=this,s=p(),o=p(),a=l();for(this.root.insertBefore(s,this.root.firstChild),this.root.appendChild(o),this.__.head=r=s,this.__.tail=o;r;)n=r.nextSibling,a.appendChild(r),i.__.virts.push(r),r=n;t?e.insertBefore(a,t.__.head):e.appendChild(a)}function me(e,t){for(var n,r=this,i=this.__.head,s=l();i;)if(n=i.nextSibling,s.appendChild(i),(i=n)===r.__.tail){s.appendChild(i),e.insertBefore(s,t.__.head);break}}function ve(e){if(!e){var t=Object.keys(Ze);return t+ve(t)}return e.filter(function(e){return!/[^-\w]/.test(e)}).reduce(function(e,t){var n=t.trim().toLowerCase();return e+",["+Je+'="'+n+'"]'},"")}function xe(e){var t=arguments,n=e.source,r=e.global?"g":"";e.ignoreCase&&(r+="i"),e.multiline&&(r+="m");for(var i=1;i<arguments.length;i++)n=n.replace("@","\\"+t[i]);return new RegExp(n,r)}
2894function ye(e,t,n){var r=/[`$\\]/g;for(r.lastIndex=t;r.exec(e);){var i=r.lastIndex,s=e[i-1];if("`"===s)return i;if("$"===s&&"{"===e[i])return n.push("`","}"),i+1;r.lastIndex++}throw new Error("Unclosed ES6 template")}function be(e,t){for(var n,r,i,s,o,a,u=new RegExp(cn,"g"),c=Ct.skipRegex,l=t|=0,p=[[]],f=[],h=u,d=h.lastIndex=l;a=h.exec(e);){if(s=a.index,o=h.lastIndex,r="",i=a[1]){if("{"===i)f.push("}");else if("}"===i){if(f.pop()!==i)throw new Error("Unexpected '}'");"`"===f[f.length-1]&&(i=f.pop())}else"/"===i&&(o=c(e,s))>s+1&&(r=e.slice(s,o));"`"===i&&(o=ye(e,o,f),r=e.slice(s,o),h=f.length?n||(n=new RegExp(ln,"g")):u)}else"/"===(r=a[0])[0]?(r="*"===r[1]?" ":"",e=e.slice(l,s)+r+e.slice(o),o=s+r.length,r=""):2===r.length&&(r="");r&&(p[0].push(e.slice(d,s)),p.push(r),d=o),h.lastIndex=o}return p[0].push(e.slice(d)),p}function we(e){var t,n=gn;for(~e.indexOf("\r")&&(e=e.replace(/\r\n?/g,"\n")),n.lastIndex=0;t=n.exec(e);)"<"===t[0][0]&&(e=RegExp.leftContext+RegExp.rightContext,n.lastIndex=t[3]+1);return e}function _e(e,t){var n,r,i,s=[];for(dn.lastIndex=0,e=e.replace(/\s+/g," ");n=dn.exec(e);){var o=n[1].toLowerCase(),a=n[2];a?(a[0]!==Sn&&(a=Sn+(a[0]===An?a.slice(1,-1):a)+Sn),"type"===o&&wn.test(a)?r=a:(jn.test(a)&&("value"===o&&(i=1),~xn.indexOf(o)&&(o="riot-"+o)),s.push(o+"="+a))):s.push(o)}return r&&(i&&(r=Sn+t._bp[0]+An+r.slice(1,-1)+An+t._bp[1]+Sn),s.push("type="+r)),s.join(" ")}function Oe(e,t,n){var r=n._bp;if(e&&r[4].test(e)){for(var i,s=t.expr&&(t.parser||t.type)?Ce:0,o=Ct.split(e,0,r),a=1;a<o.length;a+=2)"^"===(i=o[a])[0]?i=i.slice(1):s&&";"===(i=s(i,t).trim()).slice(-1)&&(i=i.slice(0,-1)),o[a]=Nn+(n.push(i)-1)+r[1];e=o.join("")}return e}function je(e,t){return t.length&&(e=e.replace(En,function(e,n){return t._bp[0]+t[n].trim().replace(/[\r\n]+/g," ").replace(/"/g,Cn)})),e}function Ee(e,t,n){if(!/\S/.test(e))return"";if(e=Oe(e,t,n).replace(mn,function(e,t,r,i){return t=t.toLowerCase(),i=i&&!yn.test(t)?"></"+t:"",r&&(t+=" "+_e(r,n)),"<"+t+i+">"}),!t.whitespace){var r=[];/<pre[\s>]/.test(e)&&(e=e.replace(bn,function(e){return r.push(e),"�"})),e=e.trim().replace(/\s+/g," "),r.length&&(e=e.replace(/\u0002/g,function(){return r.shift()}))}return t.compact&&(e=e.replace(vn,"><$1")),je(e,n).replace(On,"")}function Ne(e){var t,n,r,i,s,o,a=[],u=RegExp,c=be(e);for(e=c.shift().join("<%>");t=e.match(Tn);)a.push(u.leftContext),r=function(e){for(var t=/[{}]/g,n=1;n&&t.exec(e);)"{"===e[t.lastIndex-1]?++n:--n;return n?e.length:t.lastIndex}(e=u.rightContext),i=t[1],s=t[2]||"",o=t[3],o=(n=!/^(?:if|while|for|switch|catch|function)$/.test(o))?t[0].replace(i,"this."+o+" ="+s+" function"):t[0],a.push(o,e.slice(0,r)),e=e.slice(r),n&&!/^\s*.\s*bind\b/.test(e)&&a.push(".bind(this)");return a.length&&(e=a.join("")+e),c.length&&(e=e.replace(/<%>/g,function(){return c.shift()})),e}function Ce(e,t,n,r,i){return/\S/.test(e)?(n||(n=t.type),(t.parser||n&&an._req("js."+n,!0)||Ne)(e,r,i).replace(/\r\n?/g,"\n").replace(On,"")):""}function Se(e,t){return t.replace(kn,function(t,n,r){return r?(r=r.replace(/[^,]+/g,function(t){var n=t.trim();return 0===n.indexOf(e)?t:n&&"from"!==n&&"to"!==n&&"%"!==n.slice(-1)?n=n.indexOf(":scope")<0?e+" "+n+',[data-is="'+e+'"] '+n:n.replace(":scope",e)+","+n.replace(":scope",'[data-is="'+e+'"]'):t}),n?n+" "+r:r):t})}function Ae(e,t,n,r){return r=r||{},n&&"css"!==n&&(e=an._req("css."+n,!0)(t,e,r.parserOpts||{},r.url)),e=e.replace(Ct.R_MLCOMMS,"").replace(/\s+/g," ").trim(),t&&(e=Se(t,e)),e}function Te(e,t){return e?(e=An+e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+An,t&&~e.indexOf("\n")?e.replace(/\n/g,"\\n"):e):"''"}function ke(e,t,n,r,i,s,o){var a=o.debug?",\n  ":", ",u="});";return i&&"\n"!==i.slice(-1)&&(u="\n"+u),s+"riot.tag2('"+e+An+a+Te(t,1)+a+Te(n)+a+Te(r)+", function(opts) {\n"+i+u}function Le(e){if(/<[-\w]/.test(e))for(var t,n=e.lastIndexOf("<"),r=e.length;~n;){if(t=e.slice(n,r).match(Rn))return n+=t.index+t[0].length,"<-/>\n"===(t=e.slice(0,n)).slice(-5)&&(t=t.slice(0,-5)),[t,e.slice(n)];r=n,n=e.lastIndexOf("<",n-1)}return["",e]}function Ie(e){if(e){var t=e.match(Ln);if(t=t&&(t[2]||t[3]))return t.replace("text/","")}return""}function Re(e,t){if(e){var n=e.match(RegExp("\\s"+t+In,"i"));if(n=n&&n[1])return/^['"]/.test(n)?n.slice(1,-1):n}return""}function Me(e){return e.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#039;/g,"'")}function $e(e){var t=Me(Re(e,"options"));return t?JSON.parse(t):null}function Pe(e,t,n,r){var i=Ie(n),s=Re(n,"src"),o=pn({},t.parserOptions.js);return!s&&Ce(e,t,i,pn(o,$e(n)),r)}function Fe(e,t,n,r,i){var s=pn({},t.parserOptions.style),o={parserOpts:pn(s,$e(n)),url:r};return Ae(e,i,Ie(n)||t.style,o)}function He(e,t,n,r){return an._req("html."+n,!0)(e,r,t)}function ze(e,t,n){var r=new XMLHttpRequest;
2894r.onreadystatechange=function(){4===r.readyState&&(200===r.status||!r.status&&r.responseText.length)&&t(r.responseText,n,e)},r.open("GET",e,!0),r.send("")}function Ue(e,t){if(typeof e===rt){var n=h("script"),r=document.documentElement;t&&(e+="\n//# sourceURL="+t+".js"),n.text=e,r.appendChild(n),r.removeChild(n)}}function Ve(e,t){function n(){Ot.trigger("ready"),jt=!0,e&&e()}function r(e,t,r){Ue(Fn.compile(e,t,r),r),--s||n()}var i=u('script[type="riot/tag"]'),s=i.length;if(s)for(var o=0;o<i.length;++o){var a=i[o],c=S({template:x(a,"template")},t),l=x(a,"src")||x(a,"data-src");l?ze(l,r,c):r(a.innerHTML,c)}else n()}var Be,qe,De=[],Ze={},Ge="__global_mixin",Ke="riot-",We=["ref","data-ref"],Je="data-is",Qe="if",Xe="each",Ye="no-reorder",et="show",tt="hide",nt="__riot-events__",rt="string",it="object",st="undefined",ot="function",at="http://www.w3.org/1999/xlink",ut="http://www.w3.org/2000/svg",ct=/^xlink:(\w+)/,lt=typeof window===st?void 0:window,pt=/^(?:t(?:body|head|foot|[rhd])|caption|col(?:group)?|opt(?:ion|group))$/,ft=/^(?:t(?:body|head|foot|[rhd])|caption|col(?:group)?)$/,ht=/^on/,dt=/([-\w]+) ?= ?(?:"([^"]*)|'([^']*)|({[^}]*}))/g,gt={viewbox:"viewBox"},mt=/^(?:disabled|checked|readonly|required|allowfullscreen|auto(?:focus|play)|compact|controls|default|formnovalidate|hidden|ismap|itemscope|loop|multiple|muted|no(?:resize|shade|validate|wrap)?|open|reversed|seamless|selected|sortable|truespeed|typemustmatch)$/,vt=0|(lt&&lt.document||{}).documentMode,xt=Object.freeze({isBoolAttr:e,isFunction:t,isObject:n,isUndefined:r,isString:i,isBlank:s,isArray:o,isWritable:a}),yt=Object.freeze({$$:u,$:c,createFrag:l,createDOMPlaceholder:p,isSvg:f,mkEl:h,setInnerHTML:d,toggleVisibility:g,remAttr:m,styleObjectToString:v,getAttr:x,setAttr:y,safeInsert:b,walkAttrs:w,walkNodes:_}),bt={},wt=[],_t=!1;lt&&(Be=function(){var e=h("style");y(e,"type","text/css");var t=c("style[type=riot]");return t?(t.id&&(e.id=t.id),t.parentNode.replaceChild(e,t)):document.getElementsByTagName("head")[0].appendChild(e),e}(),qe=Be.styleSheet);var Ot,jt,Et={styleNode:Be,add:function(e,t){t?bt[t]=e:wt.push(e),_t=!0},inject:function(){if(lt&&_t){_t=!1;var e=Object.keys(bt).map(function(e){return bt[e]}).concat(wt).join("\n");qe?qe.cssText=e:Be.innerHTML=e}}},Nt=function(){function e(e,t){for(;--t>=0&&/\s/.test(e[t]););return t}var t="[{(,;:?=|&!^~>%*/",n=["case","default","do","else","in","instanceof","prefix","return","typeof","void","yield"],r=n.reduce(function(e,t){return e+t.slice(-1)},""),i=/^\/(?=[^*>/])[^[/\\]*(?:(?:\\.|\[(?:\\.|[^\]\\]*)*\])[^[\\/]*)*?\/[gimuy]*/,s=/[$\w]/;return function(o,a){var u=/.*/g,c=u.lastIndex=a++,l=u.exec(o)[0].match(i);if(l){var p=c+l[0].length,f=o[c=e(o,c)];if(c<0||~t.indexOf(f))return p;if("."===f)"."===o[c-1]&&(a=p);else if("+"===f||"-"===f)(o[--c]!==f||(c=e(o,c))<0||!s.test(o[c]))&&(a=p);else if(~r.indexOf(f)){for(var h=c+1;--c>=0&&s.test(o[c]););~n.indexOf(o.slice(c+1,h))&&(a=p)}}return a}}(),Ct=function(e){function t(e){return e}function n(e,t){return t||(t=y),new RegExp(e.source.replace(/{/g,t[2]).replace(/}/g,t[3]),e.global?u:"")}function r(e){if(e===m)return v;var t=e.split(" ");if(2!==t.length||f.test(e))throw new Error('Unsupported brackets "'+e+'"');return t=t.concat(e.replace(h,"\\").split(" ")),t[4]=n(t[1].length>1?/{[\S\s]*?}/:v[4],t),t[5]=n(e.length>3?/\\({|})/g:v[5],t),t[6]=n(v[6],t),t[7]=RegExp("\\\\("+t[3]+")|([[({])|("+t[3]+")|"+d,u),t[8]=e,t}function i(e){return e instanceof RegExp?o(e):y[e]}function s(e){(e||(e=m))!==y[8]&&(y=r(e),o=e===m?t:n,y[9]=o(v[9])),x=e}var o,a,u="g",c=/\/\*[^*]*\*+(?:[^*\/][^*]*\*+)*\//g,l=/"[^"\\]*(?:\\[\S\s][^"\\]*)*"|'[^'\\]*(?:\\[\S\s][^'\\]*)*'|`[^`\\]*(?:\\[\S\s][^`\\]*)*`/g,p=l.source+"|"+/(?:\breturn\s+|(?:[$\w\)\]]|\+\+|--)\s*(\/)(?![*\/]))/.source+"|"+/\/(?=[^*\/])[^[\/\\]*(?:(?:\[(?:\\.|[^\]\\]*)*\]|\\.)[^[\/\\]*)*?([^<]\/)[gim]*/.source,f=RegExp("[\\x00-\\x1F<>a-zA-Z0-9'\",;\\\\]"),h=/(?=[[\]()*+?.^$|])/g,d=l.source+"|"+/(\/)(?![*\/])/.source,g={"(":RegExp("([()])|"+d,u),"[":RegExp("([[\\]])|"+d,u),"{":RegExp("([{}])|"+d,u)},m="{ }",v=["{","}","{","}",/{[^}]*}/,/\\([{}])/g,/\\({)|{/g,RegExp("\\\\(})|([[({])|(})|"+d,u),m,/^\s*{\^?\s*([$\w]+)(?:\s*,\s*(\S+))?\s+in\s+(\S.*)\s*}/,/(^|[^\\]){=[\S\s]*?}/],x=void 0,y=[];return i.split=function(e,t,n){function r(e){d&&(e=d+e,d=""),t||o?p.push(e&&e.replace(n[5],"$1")):p.push(e)}function i(n,r,i){return i&&(r=Nt(e,n)),t&&r>n+2&&(c="⁗"+h.length+"~",h.push(e.slice(n,r)),d+=e.slice(a,n)+c,a=r),r}n||(n=y);var s,o,a,u,c,l,p=[],f=n[6],h=[],d="";for(o=a=f.lastIndex=0;s=f.exec(e);){if(l=f.lastIndex,u=s.index,o){if(s[2]){var m=s[2],v=g[m],x=1;for(v.lastIndex=l;s=v.exec(e);)if(s[1]){if(s[1]===m)++x;else if(!--x)break}else v.lastIndex=i(s.index,v.lastIndex,s[2]);f.lastIndex=x?e.length:v.lastIndex;continue}if(!s[3]){f.lastIndex=i(u,l,s[4]);continue}}s[1]||(r(e.slice(a,u)),a=f.lastIndex,(f=n[6+(o^=1)]).lastIndex=a)}return e&&a<e.length&&r(e.slice(a)),p.qblocks=h,p},i.hasExpr=function(e){return y[4].test(e)},i.loopKeys=function(e){var t=e.match(y[9]);return t?{key:t[1],pos:t[2],val:y[0]+t[3].trim()+y[1]}:{val:e.trim()}},i.array=function(e){return e?r(e):y},Object.defineProperty(i,"settings",{set:function(e){var t;t=(e=e||{}).brackets,Object.defineProperty(e,"brackets",{set:s,get:function(){return x},enumerable:!0}),a=e,s(t)},get:function(){return a}}),i.settings="undefined"!=typeof riot&&riot.settings||{},i.set=s,i.skipRegex=Nt,i.R_STRINGS=l,i.R_MLCOMMS=c,i.S_QBLOCKS=p,i.S_QBLOCK2=d,i}(),St=function(){function e(e,r){return e?(o[e]||(o[e]=n(e))).call(r,t.bind({data:r,tmpl:e})):e}function t(t,n){t.riotData={tagName:n&&n.__&&n.__.tagName,_riot_id:n&&n._riot_id},e.errorHandler?e.errorHandler(t):"undefined"!=typeof console&&"function"==typeof console.error&&(console.error(t.message),console.log("<%s> %s",t.riotData.tagName||"Unknown tag",this.tmpl),console.log(this.data))}function n(e){var t=r(e);return"try{return "!==t.slice(0,11)&&(t="return "+t),new Function("E",t+";")}function r(e){var t,n=Ct.split(e.replace(a,'"'),1),r=n.qblocks;if(n.length>2||n[0]){var s,o,c=[];for(s=o=0;s<n.length;++s)(t=n[s])&&(t=1&s?i(t,1,r):'"'+t.replace(/\\/g,"\\\\").replace(/\r\n?|\n/g,"\\n").replace(/"/g,'\\"')+'"')&&(c[o++]=t);t=o<2?c[0]:"["+c.join(",")+'].join("")'}else t=i(n[1],0,r);return r.length&&(t=t.replace(u,function(e,t){return r[t].replace(/\r/g,"\\r").replace(/\n/g,"\\n")})),t}function i(e,t,n){if(e=e.replace(/\s+/g," ").trim().replace(/\ ?([[\({},?\.:])\ ?/g,"$1")){for(var r,i=[],o=0;e&&(r=e.match(c))&&!r.index;){var a,u,p=/,|([[{(])|$/g;for(e=RegExp.rightContext,a=r[2]?n[r[2]].slice(1,-1).trim().replace(/\s+/g," "):r[1];u=(r=p.exec(e))[1];)!function(t,n){var r,i=1,s=l[t];for(s.lastIndex=n.lastIndex;r=s.exec(e);)if(r[0]===t)++i;else if(!--i)break;n.lastIndex=i?e.length:s.lastIndex}(u,p);u=e.slice(0,r.index),e=RegExp.rightContext,i[o++]=s(u,1,a)}e=o?o>1?"["+i.join(",")+'].join(" ").trim()':i[0]:s(e,t)}return e}function s(e,t,n){var r;return e=e.replace(f,function(e,t,n,i,s){return n&&(i=r?0:i+e.length,"this"!==n&&"global"!==n&&"window"!==n?(e=t+'("'+n+p+n,i&&(r="."===(s=s[i])||"("===s||"["===s)):i&&(r=!h.test(s.slice(i)))),e}),r&&(e="try{return "+e+"}catch(e){E(e,this)}"),n?e=(r?"function(){"+e+"}.call(this)":"("+e+")")+'?"'+n+'":""':t&&(e="function(v){"+(r?e.replace("return ","v="):"v=("+e+")")+';return v||v===0?v:""}.call(this)'),e}var o={};e.hasExpr=Ct.hasExpr,e.loopKeys=Ct.loopKeys,e.clearCache=function(){o={}},e.errorHandler=null;var a=/\u2057/g,u=/\u2057(\d+)~/g,c=/^(?:(-?[_A-Za-z\xA0-\xFF][-\w\xA0-\xFF]*)|\u2057(\d+)~):/,l={"(":/[()]/g,"[":/[[\]]/g,"{":/[{}]/g},p='"in this?this:'+("object"!=typeof window?"global":"window")+").",f=/[,{][\$\w]+(?=:)|(^ *|[^$\w\.{])(?!(?:typeof|true|false|null|undefined|in|instanceof|is(?:Finite|NaN)|void|NaN|new|Date|RegExp|Math)(?![$\w]))([$_A-Za-z][$\w]*)/g,h=/^(?=(\.[$\w]+))\1(?:[^.[(]|$)/;return e.version=Ct.version="v3.0.8",e}(),At=function(e){e=e||{};var t={},n=Array.prototype.slice;return Object.defineProperties(e,{on:{value:function(n,r){return"function"==typeof r&&(t[n]=t[n]||[]).push(r),e}
2894,enumerable:!1,writable:!1,configurable:!1},off:{value:function(n,r){if("*"!=n||r)if(r)for(var i,s=t[n],o=0;i=s&&s[o];++o)i==r&&s.splice(o--,1);else delete t[n];else t={};return e},enumerable:!1,writable:!1,configurable:!1},one:{value:function(t,n){function r(){e.off(t,r),n.apply(e,arguments)}return e.on(t,r)},enumerable:!1,writable:!1,configurable:!1},trigger:{value:function(r){var i,s,o,a=arguments,u=arguments.length-1,c=new Array(u);for(o=0;o<u;o++)c[o]=a[o+1];for(i=n.call(t[r]||[],0),o=0;s=i[o];++o)s.apply(e,c);return t["*"]&&"*"!=r&&e.trigger.apply(e,["*",r].concat(c)),e},enumerable:!1,writable:!1,configurable:!1}}),e},Tt=Object.freeze({each:O,contains:j,toCamel:E,startsWith:N,defineProperty:C,extend:S}),kt=S(Object.create(Ct.settings),{skipAnonymousTags:!0,autoUpdate:!0}),Lt={init:function(e,t,n){m(e,Qe),this.tag=t,this.expr=n,this.stub=p(),this.pristine=e;var r=e.parentNode;return r.insertBefore(this.stub,e),r.removeChild(e),this},update:function(){this.value=St(this.expr,this.tag),this.value&&!this.current?(this.current=this.pristine.cloneNode(!0),this.stub.parentNode.insertBefore(this.current,this.stub),this.expressions=[],B.apply(this.tag,[this.current,this.expressions,!0])):!this.value&&this.current&&(ce(this.expressions),this.current._tag?this.current._tag.unmount():this.current.parentNode&&this.current.parentNode.removeChild(this.current),this.current=null,this.expressions=[]),this.value&&R.call(this.tag,this.expressions)},unmount:function(){ce(this.expressions||[])}},It={init:function(e,t,n,r){return this.dom=e,this.attr=n,this.rawValue=r,this.parent=t,this.hasExp=St.hasExpr(r),this},update:function(){var e=this.value,t=this.parent&&ue(this.parent),n=this.dom.__ref||this.tag||this.dom;this.value=this.hasExp?St(this.rawValue,this.parent):this.rawValue,!s(e)&&t&&fe(t.refs,e,n),!s(this.value)&&i(this.value)?(t&&pe(t.refs,this.value,n,null,this.parent.__.index),this.value!==e&&y(this.dom,this.attr,this.value)):m(this.dom,this.attr),this.dom.__ref||(this.dom.__ref=n)},unmount:function(){var e=this.tag||this.dom,t=this.parent&&ue(this.parent);!s(this.value)&&t&&fe(t.refs,this.value,e)}},Rt=/<yield\b/i,Mt=/<yield\s*(?:\/>|>([\S\s]*?)<\/yield\s*>|>)/gi,$t=/<yield\s+to=['"]([^'">]*)['"]\s*>([\S\s]*?)<\/yield\s*>/gi,Pt=/<yield\s+from=['"]?([-\w]+)['"]?\s*(?:\/>|>([\S\s]*?)<\/yield\s*>)/gi,Ft={tr:"tbody",th:"tr",td:"tr",col:"colgroup"},Ht=vt&&vt<10?pt:ft,zt="div",Ut="svg",Vt={},Bt=Vt[Ge]={},qt=0,Dt=Object.freeze({Tag:K,tag:W,tag2:J,mount:Q,mixin:X,update:Y,unregister:ee,version:"v3.6.3"}),Zt=0,Gt=Object.freeze({getTag:ie,inheritFrom:se,moveChildTag:oe,initChildTag:ae,getImmediateCustomParentTag:ue,unmountAll:ce,getTagName:le,arrayishAdd:pe,arrayishRemove:fe,mountTo:he,makeReplaceVirtual:de,makeVirtual:ge,moveVirtual:me,selectTags:ve}),Kt=kt,Wt={tmpl:St,brackets:Ct,styleManager:Et,vdom:De,styleNode:Et.styleNode,dom:yt,check:xt,misc:Tt,tags:Gt},Jt=K,Qt=W,Xt=J,Yt=Q,en=X,tn=Y,nn=ee,rn=At,sn=S({},Dt,{observable:At,settings:Kt,util:Wt}),on=Object.freeze({settings:Kt,util:Wt,Tag:Jt,tag:Qt,tag2:Xt,mount:Yt,mixin:en,update:tn,unregister:nn,version:"v3.6.3",observable:rn,default:sn}),an=function(e){function t(t){var n=e[t];if(n)return n;throw new Error('Parser "'+t+'" not loaded.')}function n(e,t){if(t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function r(e,r,i,s){return i=n({pretty:!0,filename:s,doctype:"html"},i),t(e).render(r,i)}var i={};return i.html={jade:function(e,t,n){return console.log('DEPRECATION WARNING: jade was renamed "pug" - The jade parser will be removed in [email protected]!'),r("jade",e,t,n)},pug:function(e,t,n){return r("pug",e,t,n)}},i.css={less:function(e,r,i,s){var o;return i=n({sync:!0,syncImport:!0,filename:s},i),t("less").render(r,i,function(e,t){if(e)throw e;o=t.css}),o}},i.js={es6:function(e,r,i){return t("Babel").transform(e,n({plugins:[["transform-es2015-template-literals",{loose:!0}],"transform-es2015-literals","transform-es2015-function-name","transform-es2015-arrow-functions","transform-es2015-block-scoped-functions",["transform-es2015-classes",{loose:!0}],"transform-es2015-object-super","transform-es2015-shorthand-properties","transform-es2015-duplicate-keys",["transform-es2015-computed-properties",{loose:!0}],["transform-es2015-for-of",{loose:!0}],"transform-es2015-sticky-regex","transform-es2015-unicode-regex","check-es2015-constants",["transform-es2015-spread",{loose:!0}],"transform-es2015-parameters",["transform-es2015-destructuring",{loose:!0}],"transform-es2015-block-scoping","transform-es2015-typeof-symbol",["transform-es2015-modules-commonjs",{allowTopLevelThis:!0}],["transform-regenerator",{async:!1,asyncGenerators:!1}]]},r)).code},buble:function(e,r,i){return r=n({source:i,modules:!1}
2894,r),t("buble").transform(e,r).code},coffee:function(e,r){return t("CoffeeScript").compile(e,n({bare:!0},r))},livescript:function(e,r){return t("livescript").compile(e,n({bare:!0,header:!1},r))},typescript:function(e,n){return t("typescript")(e,n)},none:function(e){return e}},i.js.javascript=i.js.none,i.js.coffeescript=i.js.coffee,i._req=function(e){var t=e.split(".");if(2!==t.length)throw new Error("Bad format for parsers._req");var n=i[t[0]][t[1]];if(n)return n;throw new Error('Parser "'+e+'" not found.')},i.utils={extend:n},i}(window||global),un=/'[^'\n\r\\]*(?:\\(?:\r\n?|[\S\s])[^'\n\r\\]*)*'/.source,cn=[/\/\*[^*]*\*+(?:[^*\/][^*]*\*+)*\//.source,"//.*",un,un.replace(/'/g,'"'),"([/`])"].join("|"),ln=cn.slice(0,-2)+"{}])",pn=an.utils.extend,fn=/"[^"\n\\]*(?:\\[\S\s][^"\n\\]*)*"|'[^'\n\\]*(?:\\[\S\s][^'\n\\]*)*'/.source,hn=Ct.R_STRINGS.source,dn=/ *([-\w:\xA0-\xFF]+) ?(?:= ?('[^']*'|"[^"]*"|\S+))?/g,gn=RegExp(/<!--(?!>)[\S\s]*?-->/.source+"|"+fn,"g"),mn=/<(-?[A-Za-z][-\w\xA0-\xFF]*)(?:\s+([^"'\/>]*(?:(?:"[^"]*"|'[^']*'|\/[^>])[^'"\/>]*)*)|\s*)(\/?)>/g,vn=/>[ \t]+<(-?[A-Za-z]|\/[-A-Za-z])/g,xn=["style","src","d","value"],yn=/^(?:input|img|br|wbr|hr|area|base|col|embed|keygen|link|meta|param|source|track)$/,bn=/<pre(?:\s+(?:[^">]*|"[^"]*")*)?>([\S\s]+?)<\/pre\s*>/gi,wn=/^"(?:number|date(?:time)?|time|month|email|color)\b/i,_n=/^\s*import(?!\w)(?:(?:\s|[^\s'"])*)['|"].*\n?/gm,On=/[ \t]+$/gm,jn=xe(/@#\d/,"x01"),En=xe(/@#(\d+)/g,"x01"),Nn="�#",Cn="⁗",Sn='"',An="'",Tn=/^[ \t]*(((?:async|\*)\s*)?([$_A-Za-z][$\w]*))\s*\([^()]*\)\s*{/m,kn=RegExp("([{}]|^)[; ]*((?:[^@ ;{}][^{}]*)?[^@ ;{}:] ?)(?={)|"+fn,"g"),Ln=/\stype\s*=\s*(?:(['"])(.+?)\1|(\S+))/i,In="\\s*=\\s*("+hn+"|{[^}]+}|\\S+)",Rn=/\/>\n|^<(?:\/?-?[A-Za-z][-\w\xA0-\xFF]*\s*|-?[A-Za-z][-\w\xA0-\xFF]*\s+[-\w:\xA0-\xFF][\S\s]*?)>\n/,Mn=RegExp(/^([ \t]*)<(-?[A-Za-z][-\w\xA0-\xFF]*)(?:\s+([^'"\/>]+(?:(?:@|\/[^>])[^'"\/>]*)*)|\s*)?(?:\/>|>[ \t]*\n?([\S\s]*)^\1<\/\2\s*>|>(.*)<\/\2\s*>)/.source.replace("@",hn),"gim"),$n=/<script(\s+[^>]*)?>\n?([\S\s]*?)<\/script\s*>/gi,Pn=/<style(\s+[^>]*)?>\n?([\S\s]*?)<\/style\s*>/gi,Fn={compile:function(e,t,n){var r,i=[],s={template:{},js:{},style:{}};t||(t={}),t.parserOptions=pn(s,t.parserOptions||{}),r=t.exclude?function(e){return t.exclude.indexOf(e)<0}:function(){return 1},n||(n="");var o=Ct.array(t.brackets);return t.template&&(e=He(e,n,t.template,t.parserOptions.template)),e=we(e).replace(Mn,function(e,s,a,u,c,l){var p="",f="",h="",d="",g=[];if(g._bp=o,a=a.toLowerCase(),u=u&&r("attribs")?je(_e(Oe(u,t,g),g),g):"",(c||(c=l))&&/\S/.test(c))if(l)r("html")&&(h=Ee(l,t,g));else{var m=Le((c=(c=(c=c.replace(RegExp("^"+s,"gm"),"")).replace($n,function(e,i,s){if(r("js")){var o=Pe(s,t,i,n);o&&(p+=(p?"\n":"")+o)}return""})).replace(Pn,function(e,i,s){return r("css")&&(f+=(f?" ":"")+Fe(s,t,i,n,a)),""})).replace(On,""));r("html")&&(h=Ee(m[0],t,g)),r("js")&&((c=Ce(m[1],t,null,null,n))&&(p+=(p?"\n":"")+c),p=p.replace(_n,function(e){return d+=e.trim()+"\n",""}))}return p=/\S/.test(p)?p.replace(/\n{3,}/g,"\n\n"):"",t.entities?(i.push({tagName:a,html:h,css:f,attribs:u,js:p,imports:d}),""):ke(a,h,f,u,p,d,t)}),t.entities?i:e},compileHTML:function(e,t,n){return Array.isArray(t)?(n=t,t={}):(n||(n=[]),t||(t={})),n._bp=Ct.array(t.brackets),Ee(we(e),t,n)},compileCSS:function(e,t,n){return t&&"object"==typeof t?(n=t,t=""):n||(n={}),Ae(e,n.tagName,t,n)},compileJS:function(e,t,n,r){return"string"==typeof t&&(r=n,n=t,t={}),n&&"object"==typeof n&&(r=n,n=""),r||(r={}),Ce(e,t||{},n,r.parserOptions,r.url)},parsers:an,version:"v3.2.4"},Hn=Fn.parsers,zn=function(e,r,i){if(typeof e===rt){if(n(r)&&(i=r,r=!1),/^\s*</m.test(e)){var s=Fn.compile(e,i);return!0!==r&&Ue(s),t(r)&&r(s,e,i),s}ze(e,function(e,t,n){var i=Fn.compile(e,t,n);Ue(i,n),r&&r(i,e,t)},i)}else if(o(e)){var a=e.length;e.forEach(function(e){ze(e,function(e,t,n){var i=Fn.compile(e,t,n);Ue(i,n),!--a&&r&&r(i,e,t)},i)})}else{if(t(e)?(i=r,r=e):(i=e,r=void 0),jt)return r&&r();Ot?r&&Ot.on("ready",r):(Ot=At(),Ve(r,i))}};return S({},on,{mount:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n;return zn(function(){n=Yt.apply(on,e)}),n},compile:zn,parsers:Hn})});
2895/*!
2896* VERSION: 1.8.1
2897* DATE: 2017-01-17
2898* UPDATES AND DOCS AT: http://greensock.com
2899*
2900* @license Copyright (c) 2008-2017, GreenSock. All rights reserved.
2901* This work is subject to the terms at http://greensock.com/standard-license or for
vendor: 32,928 bytes, lines 2902-2906
2902* Club GreenSock members, the software agreement that was issued with your membership.
2903*
2904* @author: Jack Doyle, [email protected]
2905**/var _gsScope="undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window;(_gsScope._gsQueue||(_gsScope._gsQueue=[])).push(function(){"use strict";var a=document.documentElement,b=_gsScope,c=function(c,d){var e="x"===d?"Width":"Height",f="scroll"+e,g="client"+e,h=document.body;return c===b||c===a||c===h?Math.max(a[f],h[f])-(b["inner"+e]||a[g]||h[g]):c[f]-c["offset"+e]},d=function(a){return"string"==typeof a&&(a=TweenLite.selector(a)),a.length&&a!==b&&a[0]&&a[0].style&&!a.nodeType&&(a=a[0]),a===b||a.nodeType&&a.style?a:null},e=function(c,d){var e="scroll"+("x"===d?"Left":"Top");return c===b&&(null!=c.pageXOffset?e="page"+d.toUpperCase()+"Offset":c=null!=a[e]?a:document.body),function(){return c[e]}},f=function(c,f){var g=d(c).getBoundingClientRect(),h=!f||f===b||f===document.body,i=(h?a:f).getBoundingClientRect(),j={x:g.left-i.left,y:g.top-i.top};return!h&&f&&(j.x+=e(f,"x")(),j.y+=e(f,"y")()),j},g=function(a,b,d){var e=typeof a;return"number"===e||"string"===e&&"="===a.charAt(1)?a:"max"===a?c(b,d):Math.min(c(b,d),f(a,b)[d])},h=_gsScope._gsDefine.plugin({propName:"scrollTo",API:2,global:!0,version:"1.8.1",init:function(a,c,d){return this._wdw=a===b,this._target=a,this._tween=d,"object"!=typeof c?(c={y:c},"string"==typeof c.y&&"max"!==c.y&&"="!==c.y.charAt(1)&&(c.x=c.y)):c.nodeType&&(c={y:c,x:c}),this.vars=c,this._autoKill=c.autoKill!==!1,this.getX=e(a,"x"),this.getY=e(a,"y"),this.x=this.xPrev=this.getX(),this.y=this.yPrev=this.getY(),null!=c.x?(this._addTween(this,"x",this.x,g(c.x,a,"x")-(c.offsetX||0),"scrollTo_x",!0),this._overwriteProps.push("scrollTo_x")):this.skipX=!0,null!=c.y?(this._addTween(this,"y",this.y,g(c.y,a,"y")-(c.offsetY||0),"scrollTo_y",!0),this._overwriteProps.push("scrollTo_y")):this.skipY=!0,!0},set:function(a){this._super.setRatio.call(this,a);var d=this._wdw||!this.skipX?this.getX():this.xPrev,e=this._wdw||!this.skipY?this.getY():this.yPrev,f=e-this.yPrev,g=d-this.xPrev,i=h.autoKillThreshold;this.x<0&&(this.x=0),this.y<0&&(this.y=0),this._autoKill&&(!this.skipX&&(g>i||-i>g)&&d<c(this._target,"x")&&(this.skipX=!0),!this.skipY&&(f>i||-i>f)&&e<c(this._target,"y")&&(this.skipY=!0),this.skipX&&this.skipY&&(this._tween.kill(),this.vars.onAutoKill&&this.vars.onAutoKill.apply(this.vars.onAutoKillScope||this._tween,this.vars.onAutoKillParams||[]))),this._wdw?b.scrollTo(this.skipX?d:this.x,this.skipY?e:this.y):(this.skipY||(this._target.scrollTop=this.y),this.skipX||(this._target.scrollLeft=this.x)),this.xPrev=this.x,this.yPrev=this.y}}),i=h.prototype;h.max=c,h.getOffset=f,h.autoKillThreshold=7,i._kill=function(a){return a.scrollTo_x&&(this.skipX=!0),a.scrollTo_y&&(this.skipY=!0),this._super._kill.call(this,a)}}),_gsScope._gsDefine&&_gsScope._gsQueue.pop()(),function(a){"use strict";var b=function(){return(_gsScope.GreenSockGlobals||_gsScope)[a]};"function"==typeof define&&define.amd?define(["TweenLite"],b):"undefined"!=typeof module&&module.exports&&(require("../TweenLite.js"),module.exports=b())}("ScrollToPlugin");
2906var Swiper=function(){"use strict";function e(e){return null!==e&&"object"==typeof e&&"constructor"in e&&e.constructor===Object}function t(s,a){void 0===s&&(s={}),void 0===a&&(a={}),Object.keys(a).forEach((i=>{void 0===s[i]?s[i]=a[i]:e(a[i])&&e(s[i])&&Object.keys(a[i]).length>0&&t(s[i],a[i])}))}const s={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector:()=>null,querySelectorAll:()=>[],getElementById:()=>null,createEvent:()=>({initEvent(){}}),createElement:()=>({children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName:()=>[]}),createElementNS:()=>({}),importNode:()=>null,location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function a(){const e="undefined"!=typeof document?document:{};return t(e,s),e}const i={document:s,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle:()=>({getPropertyValue:()=>""}),Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia:()=>({}),requestAnimationFrame:e=>"undefined"==typeof setTimeout?(e(),null):setTimeout(e,0),cancelAnimationFrame(e){"undefined"!=typeof setTimeout&&clearTimeout(e)}};function r(){const e="undefined"!=typeof window?window:{};return t(e,i),e}function n(e,t){return void 0===t&&(t=0),setTimeout(e,t)}function l(){return Date.now()}function o(e,t){void 0===t&&(t="x");const s=r();let a,i,n;const l=function(e){const t=r();let s;return t.getComputedStyle&&(s=t.getComputedStyle(e,null)),!s&&e.currentStyle&&(s=e.currentStyle),s||(s=e.style),s}(e);return s.WebKitCSSMatrix?(i=l.transform||l.webkitTransform,i.split(",").length>6&&(i=i.split(", ").map((e=>e.replace(",","."))).join(", ")),n=new s.WebKitCSSMatrix("none"===i?"":i)):(n=l.MozTransform||l.OTransform||l.MsTransform||l.msTransform||l.transform||l.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),a=n.toString().split(",")),"x"===t&&(i=s.WebKitCSSMatrix?n.m41:16===a.length?parseFloat(a[12]):parseFloat(a[4])),"y"===t&&(i=s.WebKitCSSMatrix?n.m42:16===a.length?parseFloat(a[13]):parseFloat(a[5])),i||0}function d(e){return"object"==typeof e&&null!==e&&e.constructor&&"Object"===Object.prototype.toString.call(e).slice(8,-1)}function c(){const e=Object(arguments.length<=0?void 0:arguments[0]),t=["__proto__","constructor","prototype"];for(let a=1;a<arguments.length;a+=1){const i=a<0||arguments.length<=a?void 0:arguments[a];if(null!=i&&(s=i,!("undefined"!=typeof window&&void 0!==window.HTMLElement?s instanceof HTMLElement:s&&(1===s.nodeType||11===s.nodeType)))){const s=Object.keys(Object(i)).filter((e=>t.indexOf(e)<0));for(let t=0,a=s.length;t<a;t+=1){const a=s[t],r=Object.getOwnPropertyDescriptor(i,a);void 0!==r&&r.enumerable&&(d(e[a])&&d(i[a])?i[a].__swiper__?e[a]=i[a]:c(e[a],i[a]):!d(e[a])&&d(i[a])?(e[a]={},i[a].__swiper__?e[a]=i[a]:c(e[a],i[a])):e[a]=i[a])}}}var s;return e}function p(e,t,s){e.style.setProperty(t,s)}function u(e){let{swiper:t,targetPosition:s,side:a}=e;const i=r(),n=-t.translate;let l,o=null;const d=t.params.speed;t.wrapperEl.style.scrollSnapType="none",i.cancelAnimationFrame(t.cssModeFrameID);const c=s>n?"next":"prev",p=(e,t)=>"next"===c&&e>=t||"prev"===c&&e<=t,u=()=>{l=(new Date).getTime(),null===o&&(o=l);const e=Math.max(Math.min((l-o)/d,1),0),r=.5-Math.cos(e*Math.PI)/2;let c=n+r*(s-n);if(p(c,s)&&(c=s),t.wrapperEl.scrollTo({[a]:c}),p(c,s))return t.wrapperEl.style.overflow="hidden",t.wrapperEl.style.scrollSnapType="",setTimeout((()=>{t.wrapperEl.style.overflow="",t.wrapperEl.scrollTo({[a]:c})})),void i.cancelAnimationFrame(t.cssModeFrameID);t.cssModeFrameID=i.requestAnimationFrame(u)};u()}function m(e){return e.querySelector(".swiper-slide-transform")||e.shadowRoot&&e.shadowRoot.querySelector(".swiper-slide-transform")||e}function h(e,t){return void 0===t&&(t=""),[...e.children].filter((e=>e.matches(t)))}function f(e,t){void 0===t&&(t=[]);const s=document.createElement(e);return s.classList.add(...Array.isArray(t)?t:[t]),s}function g(e){const t=r(),s=a(),i=e.getBoundingClientRect(),n=s.body,l=e.clientTop||n.clientTop||0,o=e.clientLeft||n.clientLeft||0,d=e===t?t.scrollY:e.scrollTop,c=e===t?t.scrollX:e.scrollLeft;return{top:i.top+d-l,left:i.left+c-o}}function v(e,t){return r().getComputedStyle(e,null).getPropertyValue(t)}function w(e){let t,s=e;if(s){for(t=0;null!==(s=s.previousSibling);)1===s.nodeType&&(t+=1);return t}}function b(e,t){const s=[];let a=e.parentElement;for(;a;)t?a.matches(t)&&s.push(a):s.push(a),a=a.parentElement;return s}function y(e,t){t&&e.addEventListener("transitionend",(function s(a){a.target===e&&(t.call(e,a),e.removeEventListener("transitionend",s))}))}function E(e,t,s){const a=r();return s?e["width"===t?"offsetWidth":"offsetHeight"]+parseFloat(a.getComputedStyle(e,null).getPropertyValue("width"===t?"margin-right":"margin-top"))+parseFloat(a.getComputedStyle(e,null).getPropertyValue("width"===t?"margin-left":"margin-bottom")):e.offsetWidth}let x,S,T;function M(){return x||(x=function(){const e=r(),t=a();return{smoothScroll:t.documentElement&&t.documentElement.style&&"scrollBehavior"in t.documentElement.style,touch:!!("ontouchstart"in e||e.DocumentTouch&&t instanceof e.DocumentTouch)}}()),x}function C(e){return void 0===e&&(e={}),S||(S=function(e){let{userAgent:t}=void 0===e?{}:e;const s=M(),a=r(),i=a.navigator.platform,n=t||a.navigator.userAgent,l={ios:!1,android:!1},o=a.screen.width,d=a.screen.height,c=n.match(/(Android);?[\s\/]+([\d.]+)?/);let p=n.match(/(iPad).*OS\s([\d_]+)/);const u=n.match(/(iPod)(.*OS\s([\d_]+))?/),m=!p&&n.match(/(iPhone\sOS|iOS)\s([\d_]+)/),h="Win32"===i;let f="MacIntel"===i;return!p&&f&&s.touch&&["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"].indexOf(`${o}x${d}`)>=0&&(p=n.match(/(Version)\/([\d.]+)/),p||(p=[0,1,"13_0_0"]),f=!1),c&&!h&&(l.os="android",l.android=!0),(p||m||u)&&(l.os="ios",l.ios=!0),l}(e)),S}function P(){return T||(T=function(){const e=r();let t=!1;function s(){const t=e.navigator.userAgent.toLowerCase();return t.indexOf("safari")>=0&&t.indexOf("chrome")<0&&t.indexOf("android")<0}if(s()){const s=String(e.navigator.userAgent);if(s.includes("Version/")){const[e,a]=s.split("Version/")[1].split(" ")[0].split(".").map((e=>Number(e)));t=e<16||16===e&&a<2}}return{isSafari:t||s(),needPerspectiveFix:t,isWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(e.navigator.userAgent)}}()),T}var L={on(e,t,s){const a=this;if(!a.eventsListeners||a.destroyed)return a;if("function"!=typeof t)return a;const i=s?"unshift":"push";return e.split(" ").forEach((e=>{a.eventsListeners[e]||(a.eventsListeners[e]=[]),a.eventsListeners[e][i](t)})),a},once(e,t,s){const a=this;if(!a.eventsListeners||a.destroyed)return a;if("function"!=typeof t)return a;function i(){a.off(e,i),i.__emitterProxy&&delete i.__emitterProxy;for(var s=arguments.length,r=new Array(s),n=0;n<s;n++)r[n]=arguments[n];t.apply(a,r)}return i.__emitterProxy=t,a.on(e,i,s)},onAny(e,t){const s=this;if(!s.eventsListeners||s.destroyed)return s;if("function"!=typeof e)return s;const a=t?"unshift":"push";return s.eventsAnyListeners.indexOf(e)<0&&s.eventsAnyListeners[a](e),s},offAny(e){const t=this;if(!t.eventsListeners||t.destroyed)return t;if(!t.eventsAnyListeners)return t;const s=t.eventsAnyListeners.indexOf(e);return s>=0&&t.eventsAnyListeners.splice(s,1),t},off(e,t){const s=this;return!s.eventsListeners||s.destroyed?s:s.eventsListeners?(e.split(" ").forEach((e=>{void 0===t?s.eventsListeners[e]=[]:s.eventsListeners[e]&&s.eventsListeners[e].forEach(((a,i)=>{(a===t||a.__emitterProxy&&a.__emitterProxy===t)&&s.eventsListeners[e].splice(i,1)}))})),s):s},emit(){const e=this;if(!e.eventsListeners||e.destroyed)return e;if(!e.eventsListeners)return e;let t,s,a;for(var i=arguments.length,r=new Array(i),n=0;n<i;n++)r[n]=arguments[n];"string"==typeof r[0]||Array.isArray(r[0])?(t=r[0],s=r.slice(1,r.length),a=e):(t=r[0].events,s=r[0].data,a=r[0].context||e),s.unshift(a);return(Array.isArray(t)?t:t.split(" ")).forEach((t=>{e.eventsAnyListeners&&e.eventsAnyListeners.length&&e.eventsAnyListeners.forEach((e=>{e.apply(a,[t,...s])})),e.eventsListeners&&e.eventsListeners[t]&&e.eventsListeners[t].forEach((e=>{e.apply(a,s)}))})),e}};const z=(e,t)=>{if(!e||e.destroyed||!e.params)return;const s=t.closest(e.isElement?"swiper-slide":`.${e.params.slideClass}`);if(s){const t=s.querySelector(`.${e.params.lazyPreloaderClass}`);t&&t.remove()}},A=(e,t)=>{if(!e.slides[t])return;const s=e.slides[t].querySelector('[loading="lazy"]');s&&s.removeAttribute("loading")},$=e=>{if(!e||e.destroyed||!e.params)return;let t=e.params.lazyPreloadPrevNext;const s=e.slides.length;if(!s||!t||t<0)return;t=Math.min(t,s);const a="auto"===e.params.slidesPerView?e.slidesPerViewDynamic():Math.ceil(e.params.slidesPerView),i=e.activeIndex;if(e.params.grid&&e.params.grid.rows>1){const s=i,r=[s-t];return r.push(...Array.from({length:t}).map(((e,t)=>s+a+t))),void e.slides.forEach(((t,s)=>{r.includes(t.column)&&A(e,s)}))}const r=i+a-1;if(e.params.rewind||e.params.loop)for(let a=i-t;a<=r+t;a+=1){const t=(a%s+s)%s;(t<i||t>r)&&A(e,t)}else for(let a=Math.max(i-t,0);a<=Math.min(r+t,s-1);a+=1)a!==i&&(a>r||a<i)&&A(e,a)};var I={updateSize:function(){const e=this;let t,s;const a=e.el;t=void 0!==e.params.width&&null!==e.params.width?e.params.width:a.clientWidth,s=void 0!==e.params.height&&null!==e.params.height?e.params.height:a.clientHeight,0===t&&e.isHorizontal()||0===s&&e.isVertical()||(t=t-parseInt(v(a,"padding-left")||0,10)-parseInt(v(a,"padding-right")||0,10),s=s-parseInt(v(a,"padding-top")||0,10)-parseInt(v(a,"padding-bottom")||0,10),Number.isNaN(t)&&(t=0),Number.isNaN(s)&&(s=0),Object.assign(e,{width:t,height:s,size:e.isHorizontal()?t:s}))},updateSlides:function(){const e=this;function t(t){return e.isHorizontal()?t:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[t]}function s(e,s){return parseFloat(e.getPropertyValue(t(s))||0)}const a=e.params,{wrapperEl:i,slidesEl:r,size:n,rtlTranslate:l,wrongRTL:o}=e,d=e.virtual&&a.virtual.enabled,c=d?e.virtual.slides.length:e.slides.length,u=h(r,`.${e.params.slideClass}, swiper-slide`),m=d?e.virtual.slides.length:u.length;let f=[];const g=[],w=[];let b=a.slidesOffsetBefore;"function"==typeof b&&(b=a.slidesOffsetBefore.call(e));let y=a.slidesOffsetAfter;"function"==typeof y&&(y=a.slidesOffsetAfter.call(e));const x=e.snapGrid.length,S=e.slidesGrid.length;let T=a.spaceBetween,M=-b,C=0,P=0;if(void 0===n)return;"string"==typeof T&&T.indexOf("%")>=0?T=parseFloat(T.replace("%",""))/100*n:"string"==typeof T&&(T=parseFloat(T)),e.virtualSize=-T,u.forEach((e=>{l?e.style.marginLeft="":e.style.marginRight="",e.style.marginBottom="",e.style.marginTop=""})),a.centeredSlides&&a.cssMode&&(p(i,"--swiper-centered-offset-before",""),p(i,"--swiper-centered-offset-after",""));const L=a.grid&&a.grid.rows>1&&e.grid;let z;L&&e.grid.initSlides(m);const A="auto"===a.slidesPerView&&a.breakpoints&&Object.keys(a.breakpoints).filter((e=>void 0!==a.breakpoints[e].slidesPerView)).length>0;for(let i=0;i<m;i+=1){let r;if(z=0,u[i]&&(r=u[i]),L&&e.grid.updateSlide(i,r,m,t),!u[i]||"none"!==v(r,"display")){if("auto"===a.slidesPerView){A&&(u[i].style[t("width")]="");const n=getComputedStyle(r),l=r.style.transform,o=r.style.webkitTransform;if(l&&(r.style.transform="none"),o&&(r.style.webkitTransform="none"),a.roundLengths)z=e.isHorizontal()?E(r,"width",!0):E(r,"height",!0);else{const e=s(n,"width"),t=s(n,"padding-left"),a=s(n,"padding-right"),i=s(n,"margin-left"),l=s(n,"margin-right"),o=n.getPropertyValue("box-sizing");if(o&&"border-box"===o)z=e+i+l;else{const{clientWidth:s,offsetWidth:n}=r;z=e+t+a+i+l+(n-s)}}l&&(r.style.transform=l),o&&(r.style.webkitTransform=o),a.roundLengths&&(z=Math.floor(z))}else z=(n-(a.slidesPerView-1)*T)/a.slidesPerView,a.roundLengths&&(z=Math.floor(z)),u[i]&&(u[i].style[t("width")]=`${z}px`);u[i]&&(u[i].swiperSlideSize=z),w.push(z),a.centeredSlides?(M=M+z/2+C/2+T,0===C&&0!==i&&(M=M-n/2-T),0===i&&(M=M-n/2-T),Math.abs(M)<.001&&(M=0),a.roundLengths&&(M=Math.floor(M)),P%a.slidesPerGroup==0&&f.push(M),g.push(M)):(a.roundLengths&&(M=Math.floor(M)),(P-Math.min(e.params.slidesPerGroupSkip,P))%e.params.slidesPerGroup==0&&f.push(M),g.push(M),M=M+z+T),e.virtualSize+=z+T,C=z,P+=1}}if(e.virtualSize=Math.max(e.virtualSize,n)+y,l&&o&&("slide"===a.effect||"coverflow"===a.effect)&&(i.style.width=`${e.virtualSize+T}px`),a.setWrapperSize&&(i.style[t("width")]=`${e.virtualSize+T}px`),L&&e.grid.updateWrapperSize(z,f,t),!a.centeredSlides){const t=[];for(let s=0;s<f.length;s+=1){let i=f[s];a.roundLengths&&(i=Math.floor(i)),f[s]<=e.virtualSize-n&&t.push(i)}f=t,Math.floor(e.virtualSize-n)-Math.floor(f[f.length-1])>1&&f.push(e.virtualSize-n)}if(d&&a.loop){const t=w[0]+T;if(a.slidesPerGroup>1){const s=Math.ceil((e.virtual.slidesBefore+e.virtual.slidesAfter)/a.slidesPerGroup),i=t*a.slidesPerGroup;for(let e=0;e<s;e+=1)f.push(f[f.length-1]+i)}for(let s=0;s<e.virtual.slidesBefore+e.virtual.slidesAfter;s+=1)1===a.slidesPerGroup&&f.push(f[f.length-1]+t),g.push(g[g.length-1]+t),e.virtualSize+=t}if(0===f.length&&(f=[0]),0!==T){const s=e.isHorizontal()&&l?"marginLeft":t("marginRight");u.filter(((e,t)=>!(a.cssMode&&!a.loop)||t!==u.length-1)).forEach((e=>{e.style[s]=`${T}px`}))}if(a.centeredSlides&&a.centeredSlidesBounds){let e=0;w.forEach((t=>{e+=t+(T||0)})),e-=T;const t=e-n;f=f.map((e=>e<=0?-b:e>t?t+y:e))}if(a.centerInsufficientSlides){let e=0;if(w.forEach((t=>{e+=t+(T||0)})),e-=T,e<n){const t=(n-e)/2;f.forEach(((e,s)=>{f[s]=e-t})),g.forEach(((e,s)=>{g[s]=e+t}))}}if(Object.assign(e,{slides:u,snapGrid:f,slidesGrid:g,slidesSizesGrid:w}),a.centeredSlides&&a.cssMode&&!a.centeredSlidesBounds){p(i,"--swiper-centered-offset-before",-f[0]+"px"),p(i,"--swiper-centered-offset-after",e.size/2-w[w.length-1]/2+"px");const t=-e.snapGrid[0],s=-e.slidesGrid[0];e.snapGrid=e.snapGrid.map((e=>e+t)),e.slidesGrid=e.slidesGrid.map((e=>e+s))}if(m!==c&&e.emit("slidesLengthChange"),f.length!==x&&(e.params.watchOverflow&&e.checkOverflow(),e.emit("snapGridLengthChange")),g.length!==S&&e.emit("slidesGridLengthChange"),a.watchSlidesProgress&&e.updateSlidesOffset(),!(d||a.cssMode||"slide"!==a.effect&&"fade"!==a.effect)){const t=`${a.containerModifierClass}backface-hidden`,s=e.el.classList.contains(t);m<=a.maxBackfaceHiddenSlides?s||e.el.classList.add(t):s&&e.el.classList.remove(t)}},updateAutoHeight:function(e){const t=this,s=[],a=t.virtual&&t.params.virtual.enabled;let i,r=0;"number"==typeof e?t.setTransition(e):!0===e&&t.setTransition(t.params.speed);const n=e=>a?t.slides[t.getSlideIndexByData(e)]:t.slides[e];if("auto"!==t.params.slidesPerView&&t.params.slidesPerView>1)if(t.params.centeredSlides)(t.visibleSlides||[]).forEach((e=>{s.push(e)}));else for(i=0;i<Math.ceil(t.params.slidesPerView);i+=1){const e=t.activeIndex+i;if(e>t.slides.length&&!a)break;s.push(n(e))}else s.push(n(t.activeIndex));for(i=0;i<s.length;i+=1)if(void 0!==s[i]){const e=s[i].offsetHeight;r=e>r?e:r}(r||0===r)&&(t.wrapperEl.style.height=`${r}px`)},updateSlidesOffset:function(){const e=this,t=e.slides,s=e.isElement?e.isHorizontal()?e.wrapperEl.offsetLeft:e.wrapperEl.offsetTop:0;for(let a=0;a<t.length;a+=1)t[a].swiperSlideOffset=(e.isHorizontal()?t[a].offsetLeft:t[a].offsetTop)-s-e.cssOverflowAdjustment()},updateSlidesProgress:function(e){void 0===e&&(e=this&&this.translate||0);const t=this,s=t.params,{slides:a,rtlTranslate:i,snapGrid:r}=t;if(0===a.length)return;void 0===a[0].swiperSlideOffset&&t.updateSlidesOffset();let n=-e;i&&(n=e),a.forEach((e=>{e.classList.remove(s.slideVisibleClass)})),t.visibleSlidesIndexes=[],t.visibleSlides=[];let l=s.spaceBetween;"string"==typeof l&&l.indexOf("%")>=0?l=parseFloat(l.replace("%",""))/100*t.size:"string"==typeof l&&(l=parseFloat(l));for(let e=0;e<a.length;e+=1){const o=a[e];let d=o.swiperSlideOffset;s.cssMode&&s.centeredSlides&&(d-=a[0].swiperSlideOffset);const c=(n+(s.centeredSlides?t.minTranslate():0)-d)/(o.swiperSlideSize+l),p=(n-r[0]+(s.centeredSlides?t.minTranslate():0)-d)/(o.swiperSlideSize+l),u=-(n-d),m=u+t.slidesSizesGrid[e];(u>=0&&u<t.size-1||m>1&&m<=t.size||u<=0&&m>=t.size)&&(t.visibleSlides.push(o),t.visibleSlidesIndexes.push(e),a[e].classList.add(s.slideVisibleClass)),o.progress=i?-c:c,o.originalProgress=i?-p:p}},updateProgress:function(e){const t=this;if(void 0===e){const s=t.rtlTranslate?-1:1;e=t&&t.translate&&t.translate*s||0}const s=t.params,a=t.maxTranslate()-t.minTranslate();let{progress:i,isBeginning:r,isEnd:n,progressLoop:l}=t;const o=r,d=n;if(0===a)i=0,r=!0,n=!0;else{i=(e-t.minTranslate())/a;const s=Math.abs(e-t.minTranslate())<1,l=Math.abs(e-t.maxTranslate())<1;r=s||i<=0,n=l||i>=1,s&&(i=0),l&&(i=1)}if(s.loop){const s=t.getSlideIndexByData(0),a=t.getSlideIndexByData(t.slides.length-1),i=t.slidesGrid[s],r=t.slidesGrid[a],n=t.slidesGrid[t.slidesGrid.length-1],o=Math.abs(e);l=o>=i?(o-i)/n:(o+n-r)/n,l>1&&(l-=1)}Object.assign(t,{progress:i,progressLoop:l,isBeginning:r,isEnd:n}),(s.watchSlidesProgress||s.centeredSlides&&s.autoHeight)&&t.updateSlidesProgress(e),r&&!o&&t.emit("reachBeginning toEdge"),n&&!d&&t.emit("reachEnd toEdge"),(o&&!r||d&&!n)&&t.emit("fromEdge"),t.emit("progress",i)},updateSlidesClasses:function(){const e=this,{slides:t,params:s,slidesEl:a,activeIndex:i}=e,r=e.virtual&&s.virtual.enabled,n=e=>h(a,`.${s.slideClass}${e}, swiper-slide${e}`)[0];let l;if(t.forEach((e=>{e.classList.remove(s.slideActiveClass,s.slideNextClass,s.slidePrevClass)})),r)if(s.loop){let t=i-e.virtual.slidesBefore;t<0&&(t=e.virtual.slides.length+t),t>=e.virtual.slides.length&&(t-=e.virtual.slides.length),l=n(`[data-swiper-slide-index="${t}"]`)}else l=n(`[data-swiper-slide-index="${i}"]`);else l=t[i];if(l){l.classList.add(s.slideActiveClass);let e=function(e,t){const s=[];for(;e.nextElementSibling;){const a=e.nextElementSibling;t?a.matches(t)&&s.push(a):s.push(a),e=a}return s}(l,`.${s.slideClass}, swiper-slide`)[0];s.loop&&!e&&(e=t[0]),e&&e.classList.add(s.slideNextClass);let a=function(e,t){const s=[];for(;e.previousElementSibling;){const a=e.previousElementSibling;t?a.matches(t)&&s.push(a):s.push(a),e=a}return s}(l,`.${s.slideClass}, swiper-slide`)[0];s.loop&&0===!a&&(a=t[t.length-1]),a&&a.classList.add(s.slidePrevClass)}e.emitSlidesClasses()},updateActiveIndex:function(e){const t=this,s=t.rtlTranslate?t.translate:-t.translate,{snapGrid:a,params:i,activeIndex:r,realIndex:n,snapIndex:l}=t;let o,d=e;const c=e=>{let s=e-t.virtual.slidesBefore;return s<0&&(s=t.virtual.slides.length+s),s>=t.virtual.slides.length&&(s-=t.virtual.slides.length),s};if(void 0===d&&(d=function(e){const{slidesGrid:t,params:s}=e,a=e.rtlTranslate?e.translate:-e.translate;let i;for(let e=0;e<t.length;e+=1)void 0!==t[e+1]?a>=t[e]&&a<t[e+1]-(t[e+1]-t[e])/2?i=e:a>=t[e]&&a<t[e+1]&&(i=e+1):a>=t[e]&&(i=e);return s.normalizeSlideIndex&&(i<0||void 0===i)&&(i=0),i}(t)),a.indexOf(s)>=0)o=a.indexOf(s);else{const e=Math.min(i.slidesPerGroupSkip,d);o=e+Math.floor((d-e)/i.slidesPerGroup)}if(o>=a.length&&(o=a.length-1),d===r)return o!==l&&(t.snapIndex=o,t.emit("snapIndexChange")),void(t.params.loop&&t.virtual&&t.params.virtual.enabled&&(t.realIndex=c(d)));let p;p=t.virtual&&i.virtual.enabled&&i.loop?c(d):t.slides[d]?parseInt(t.slides[d].getAttribute("data-swiper-slide-index")||d,10):d,Object.assign(t,{previousSnapIndex:l,snapIndex:o,previousRealIndex:n,realIndex:p,previousIndex:r,activeIndex:d}),t.initialized&&$(t),t.emit("activeIndexChange"),t.emit("snapIndexChange"),n!==p&&t.emit("realIndexChange"),(t.initialized||t.params.runCallbacksOnInit)&&t.emit("slideChange")},updateClickedSlide:function(e){const t=this,s=t.params,a=e.closest(`.${s.slideClass}, swiper-slide`);let i,r=!1;if(a)for(let e=0;e<t.slides.length;e+=1)if(t.slides[e]===a){r=!0,i=e;break}if(!a||!r)return t.clickedSlide=void 0,void(t.clickedIndex=void 0);t.clickedSlide=a,t.virtual&&t.params.virtual.enabled?t.clickedIndex=parseInt(a.getAttribute("data-swiper-slide-index"),10):t.clickedIndex=i,s.slideToClickedSlide&&void 0!==t.clickedIndex&&t.clickedIndex!==t.activeIndex&&t.slideToClickedSlide()}};var k={getTranslate:function(e){void 0===e&&(e=this.isHorizontal()?"x":"y");const{params:t,rtlTranslate:s,translate:a,wrapperEl:i}=this;if(t.virtualTranslate)return s?-a:a;if(t.cssMode)return a;let r=o(i,e);return r+=this.cssOverflowAdjustment(),s&&(r=-r),r||0},setTranslate:function(e,t){const s=this,{rtlTranslate:a,params:i,wrapperEl:r,progress:n}=s;let l,o=0,d=0;s.isHorizontal()?o=a?-e:e:d=e,i.roundLengths&&(o=Math.floor(o),d=Math.floor(d)),s.previousTranslate=s.translate,s.translate=s.isHorizontal()?o:d,i.cssMode?r[s.isHorizontal()?"scrollLeft":"scrollTop"]=s.isHorizontal()?-o:-d:i.virtualTranslate||(s.isHorizontal()?o-=s.cssOverflowAdjustment():d-=s.cssOverflowAdjustment(),r.style.transform=`translate3d(${o}px, ${d}px, 0px)`);const c=s.maxTranslate()-s.minTranslate();l=0===c?0:(e-s.minTranslate())/c,l!==n&&s.updateProgress(e),s.emit("setTranslate",s.translate,t)},minTranslate:function(){return-this.snapGrid[0]},maxTranslate:function(){return-this.snapGrid[this.snapGrid.length-1]},translateTo:function(e,t,s,a,i){void 0===e&&(e=0),void 0===t&&(t=this.params.speed),void 0===s&&(s=!0),void 0===a&&(a=!0);const r=this,{params:n,wrapperEl:l}=r;if(r.animating&&n.preventInteractionOnTransition)return!1;const o=r.minTranslate(),d=r.maxTranslate();let c;if(c=a&&e>o?o:a&&e<d?d:e,r.updateProgress(c),n.cssMode){const e=r.isHorizontal();if(0===t)l[e?"scrollLeft":"scrollTop"]=-c;else{if(!r.support.smoothScroll)return u({swiper:r,targetPosition:-c,side:e?"left":"top"}),!0;l.scrollTo({[e?"left":"top"]:-c,behavior:"smooth"})}return!0}return 0===t?(r.setTransition(0),r.setTranslate(c),s&&(r.emit("beforeTransitionStart",t,i),r.emit("transitionEnd"))):(r.setTransition(t),r.setTranslate(c),s&&(r.emit("beforeTransitionStart",t,i),r.emit("transitionStart")),r.animating||(r.animating=!0,r.onTranslateToWrapperTransitionEnd||(r.onTranslateToWrapperTransitionEnd=function(e){r&&!r.destroyed&&e.target===this&&(r.wrapperEl.removeEventListener("transitionend",r.onTranslateToWrapperTransitionEnd),r.onTranslateToWrapperTransitionEnd=null,delete r.onTranslateToWrapperTransitionEnd,s&&r.emit("transitionEnd"))}),r.wrapperEl.addEventListener("transitionend",r.onTranslateToWrapperTransitionEnd))),!0}};function O(e){let{swiper:t,runCallbacks:s,direction:a,step:i}=e;const{activeIndex:r,previousIndex:n}=t;let l=a;if(l||(l=r>n?"next":r<n?"prev":"reset"),t.emit(`transition${i}`),s&&r!==n){if("reset"===l)return void t.emit(`slideResetTransition${i}`);t.emit(`slideChangeTransition${i}`),"next"===l?t.emit(`slideNextTransition${i}`):t.emit(`slidePrevTransition${i}`)}}var D={slideTo:function(e,t,s,a,i){void 0===e&&(e=0),void 0===t&&(t=this.params.speed),void 0===s&&(s=!0),"string"==typeof e&&(e=parseInt(e,10));const r=this;let n=e;n<0&&(n=0);const{params:l,snapGrid:o,slidesGrid:d,previousIndex:c,activeIndex:p,rtlTranslate:m,wrapperEl:h,enabled:f}=r;if(r.animating&&l.preventInteractionOnTransition||!f&&!a&&!i)return!1;const g=Math.min(r.params.slidesPerGroupSkip,n);let v=g+Math.floor((n-g)/r.params.slidesPerGroup);v>=o.length&&(v=o.length-1);const w=-o[v];if(l.normalizeSlideIndex)for(let e=0;e<d.length;e+=1){const t=-Math.floor(100*w),s=Math.floor(100*d[e]),a=Math.floor(100*d[e+1]);void 0!==d[e+1]?t>=s&&t<a-(a-s)/2?n=e:t>=s&&t<a&&(n=e+1):t>=s&&(n=e)}if(r.initialized&&n!==p){if(!r.allowSlideNext&&(m?w>r.translate&&w>r.minTranslate():w<r.translate&&w<r.minTranslate()))return!1;if(!r.allowSlidePrev&&w>r.translate&&w>r.maxTranslate()&&(p||0)!==n)return!1}let b;if(n!==(c||0)&&s&&r.emit("beforeSlideChangeStart"),r.updateProgress(w),b=n>p?"next":n<p?"prev":"reset",m&&-w===r.translate||!m&&w===r.translate)return r.updateActiveIndex(n),l.autoHeight&&r.updateAutoHeight(),r.updateSlidesClasses(),"slide"!==l.effect&&r.setTranslate(w),"reset"!==b&&(r.transitionStart(s,b),r.transitionEnd(s,b)),!1;if(l.cssMode){const e=r.isHorizontal(),s=m?w:-w;if(0===t){const t=r.virtual&&r.params.virtual.enabled;t&&(r.wrapperEl.style.scrollSnapType="none",r._immediateVirtual=!0),t&&!r._cssModeVirtualInitialSet&&r.params.initialSlide>0?(r._cssModeVirtualInitialSet=!0,requestAnimationFrame((()=>{h[e?"scrollLeft":"scrollTop"]=s}))):h[e?"scrollLeft":"scrollTop"]=s,t&&requestAnimationFrame((()=>{r.wrapperEl.style.scrollSnapType="",r._immediateVirtual=!1}))}else{if(!r.support.smoothScroll)return u({swiper:r,targetPosition:s,side:e?"left":"top"}),!0;h.scrollTo({[e?"left":"top"]:s,behavior:"smooth"})}return!0}return r.setTransition(t),r.setTranslate(w),r.updateActiveIndex(n),r.updateSlidesClasses(),r.emit("beforeTransitionStart",t,a),r.transitionStart(s,b),0===t?r.transitionEnd(s,b):r.animating||(r.animating=!0,r.onSlideToWrapperTransitionEnd||(r.onSlideToWrapperTransitionEnd=function(e){r&&!r.destroyed&&e.target===this&&(r.wrapperEl.removeEventListener("transitionend",r.onSlideToWrapperTransitionEnd),r.onSlideToWrapperTransitionEnd=null,delete r.onSlideToWrapperTransitionEnd,r.transitionEnd(s,b))}),r.wrapperEl.addEventListener("transitionend",r.onSlideToWrapperTransitionEnd)),!0},slideToLoop:function(e,t,s,a){if(void 0===e&&(e=0),void 0===t&&(t=this.params.speed),void 0===s&&(s=!0),"string"==typeof e){e=parseInt(e,10)}const i=this;let r=e;return i.params.loop&&(i.virtual&&i.params.virtual.enabled?r+=i.virtual.slidesBefore:r=i.getSlideIndexByData(r)),i.slideTo(r,t,s,a)},slideNext:function(e,t,s){void 0===e&&(e=this.params.speed),void 0===t&&(t=!0);const a=this,{enabled:i,params:r,animating:n}=a;if(!i)return a;let l=r.slidesPerGroup;"auto"===r.slidesPerView&&1===r.slidesPerGroup&&r.slidesPerGroupAuto&&(l=Math.max(a.slidesPerViewDynamic("current",!0),1));const o=a.activeIndex<r.slidesPerGroupSkip?1:l,d=a.virtual&&r.virtual.enabled;if(r.loop){if(n&&!d&&r.loopPreventsSliding)return!1;a.loopFix({direction:"next"}),a._clientLeft=a.wrapperEl.clientLeft}return r.rewind&&a.isEnd?a.slideTo(0,e,t,s):a.slideTo(a.activeIndex+o,e,t,s)},slidePrev:function(e,t,s){void 0===e&&(e=this.params.speed),void 0===t&&(t=!0);const a=this,{params:i,snapGrid:r,slidesGrid:n,rtlTranslate:l,enabled:o,animating:d}=a;if(!o)return a;const c=a.virtual&&i.virtual.enabled;if(i.loop){if(d&&!c&&i.loopPreventsSliding)return!1;a.loopFix({direction:"prev"}),a._clientLeft=a.wrapperEl.clientLeft}function p(e){return e<0?-Math.floor(Math.abs(e)):Math.floor(e)}const u=p(l?a.translate:-a.translate),m=r.map((e=>p(e)));let h=r[m.indexOf(u)-1];if(void 0===h&&i.cssMode){let e;r.forEach(((t,s)=>{u>=t&&(e=s)})),void 0!==e&&(h=r[e>0?e-1:e])}let f=0;if(void 0!==h&&(f=n.indexOf(h),f<0&&(f=a.activeIndex-1),"auto"===i.slidesPerView&&1===i.slidesPerGroup&&i.slidesPerGroupAuto&&(f=f-a.slidesPerViewDynamic("previous",!0)+1,f=Math.max(f,0))),i.rewind&&a.isBeginning){const i=a.params.virtual&&a.params.virtual.enabled&&a.virtual?a.virtual.slides.length-1:a.slides.length-1;return a.slideTo(i,e,t,s)}return a.slideTo(f,e,t,s)},slideReset:function(e,t,s){return void 0===e&&(e=this.params.speed),void 0===t&&(t=!0),this.slideTo(this.activeIndex,e,t,s)},slideToClosest:function(e,t,s,a){void 0===e&&(e=this.params.speed),void 0===t&&(t=!0),void 0===a&&(a=.5);const i=this;let r=i.activeIndex;const n=Math.min(i.params.slidesPerGroupSkip,r),l=n+Math.floor((r-n)/i.params.slidesPerGroup),o=i.rtlTranslate?i.translate:-i.translate;if(o>=i.snapGrid[l]){const e=i.snapGrid[l];o-e>(i.snapGrid[l+1]-e)*a&&(r+=i.params.slidesPerGroup)}else{const e=i.snapGrid[l-1];o-e<=(i.snapGrid[l]-e)*a&&(r-=i.params.slidesPerGroup)}return r=Math.max(r,0),r=Math.min(r,i.slidesGrid.length-1),i.slideTo(r,e,t,s)},slideToClickedSlide:function(){const e=this,{params:t,slidesEl:s}=e,a="auto"===t.slidesPerView?e.slidesPerViewDynamic():t.slidesPerView;let i,r=e.clickedIndex;const l=e.isElement?"swiper-slide":`.${t.slideClass}`;if(t.loop){if(e.animating)return;i=parseInt(e.clickedSlide.getAttribute("data-swiper-slide-index"),10),t.centeredSlides?r<e.loopedSlides-a/2||r>e.slides.length-e.loopedSlides+a/2?(e.loopFix(),r=e.getSlideIndex(h(s,`${l}[data-swiper-slide-index="${i}"]`)[0]),n((()=>{e.slideTo(r)}))):e.slideTo(r):r>e.slides.length-a?(e.loopFix(),r=e.getSlideIndex(h(s,`${l}[data-swiper-slide-index="${i}"]`)[0]),n((()=>{e.slideTo(r)}))):e.slideTo(r)}else e.slideTo(r)}};var G={loopCreate:function(e){const t=this,{params:s,slidesEl:a}=t;if(!s.loop||t.virtual&&t.params.virtual.enabled)return;h(a,`.${s.slideClass}, swiper-slide`).forEach(((e,t)=>{e.setAttribute("data-swiper-slide-index",t)})),t.loopFix({slideRealIndex:e,direction:s.centeredSlides?void 0:"next"})},loopFix:function(e){let{slideRealIndex:t,slideTo:s=!0,direction:a,setTranslate:i,activeSlideIndex:r,byController:n,byMousewheel:l}=void 0===e?{}:e;const o=this;if(!o.params.loop)return;o.emit("beforeLoopFix");const{slides:d,allowSlidePrev:c,allowSlideNext:p,slidesEl:u,params:m}=o;if(o.allowSlidePrev=!0,o.allowSlideNext=!0,o.virtual&&m.virtual.enabled)return s&&(m.centeredSlides||0!==o.snapIndex?m.centeredSlides&&o.snapIndex<m.slidesPerView?o.slideTo(o.virtual.slides.length+o.snapIndex,0,!1,!0):o.snapIndex===o.snapGrid.length-1&&o.slideTo(o.virtual.slidesBefore,0,!1,!0):o.slideTo(o.virtual.slides.length,0,!1,!0)),o.allowSlidePrev=c,o.allowSlideNext=p,void o.emit("loopFix");const h="auto"===m.slidesPerView?o.slidesPerViewDynamic():Math.ceil(parseFloat(m.slidesPerView,10));let f=m.loopedSlides||h;f%m.slidesPerGroup!=0&&(f+=m.slidesPerGroup-f%m.slidesPerGroup),o.loopedSlides=f;const g=[],v=[];let w=o.activeIndex;void 0===r?r=o.getSlideIndex(o.slides.filter((e=>e.classList.contains(m.slideActiveClass)))[0]):w=r;
2906const b="next"===a||!a,y="prev"===a||!a;let E=0,x=0;if(r<f){E=Math.max(f-r,m.slidesPerGroup);for(let e=0;e<f-r;e+=1){const t=e-Math.floor(e/d.length)*d.length;g.push(d.length-t-1)}}else if(r>o.slides.length-2*f){x=Math.max(r-(o.slides.length-2*f),m.slidesPerGroup);for(let e=0;e<x;e+=1){const t=e-Math.floor(e/d.length)*d.length;v.push(t)}}if(y&&g.forEach((e=>{o.slides[e].swiperLoopMoveDOM=!0,u.prepend(o.slides[e]),o.slides[e].swiperLoopMoveDOM=!1})),b&&v.forEach((e=>{o.slides[e].swiperLoopMoveDOM=!0,u.append(o.slides[e]),o.slides[e].swiperLoopMoveDOM=!1})),o.recalcSlides(),"auto"===m.slidesPerView&&o.updateSlides(),m.watchSlidesProgress&&o.updateSlidesOffset(),s)if(g.length>0&&y)if(void 0===t){const e=o.slidesGrid[w],t=o.slidesGrid[w+E]-e;l?o.setTranslate(o.translate-t):(o.slideTo(w+E,0,!1,!0),i&&(o.touches[o.isHorizontal()?"startX":"startY"]+=t))}else i&&o.slideToLoop(t,0,!1,!0);else if(v.length>0&&b)if(void 0===t){const e=o.slidesGrid[w],t=o.slidesGrid[w-x]-e;l?o.setTranslate(o.translate-t):(o.slideTo(w-x,0,!1,!0),i&&(o.touches[o.isHorizontal()?"startX":"startY"]+=t))}else o.slideToLoop(t,0,!1,!0);if(o.allowSlidePrev=c,o.allowSlideNext=p,o.controller&&o.controller.control&&!n){const e={slideRealIndex:t,slideTo:!1,direction:a,setTranslate:i,activeSlideIndex:r,byController:!0};Array.isArray(o.controller.control)?o.controller.control.forEach((t=>{!t.destroyed&&t.params.loop&&t.loopFix(e)})):o.controller.control instanceof o.constructor&&o.controller.control.params.loop&&o.controller.control.loopFix(e)}o.emit("loopFix")},loopDestroy:function(){const e=this,{params:t,slidesEl:s}=e;if(!t.loop||e.virtual&&e.params.virtual.enabled)return;e.recalcSlides();const a=[];e.slides.forEach((e=>{const t=void 0===e.swiperSlideIndex?1*e.getAttribute("data-swiper-slide-index"):e.swiperSlideIndex;a[t]=e})),e.slides.forEach((e=>{e.removeAttribute("data-swiper-slide-index")})),a.forEach((e=>{s.append(e)})),e.recalcSlides(),e.slideTo(e.realIndex,0)}};function H(e){const t=this,s=a(),i=r(),n=t.touchEventsData;n.evCache.push(e);const{params:o,touches:d,enabled:c}=t;if(!c)return;if(!o.simulateTouch&&"mouse"===e.pointerType)return;if(t.animating&&o.preventInteractionOnTransition)return;!t.animating&&o.cssMode&&o.loop&&t.loopFix();let p=e;p.originalEvent&&(p=p.originalEvent);let u=p.target;if("wrapper"===o.touchEventsTarget&&!t.wrapperEl.contains(u))return;if("which"in p&&3===p.which)return;if("button"in p&&p.button>0)return;if(n.isTouched&&n.isMoved)return;const m=!!o.noSwipingClass&&""!==o.noSwipingClass,h=e.composedPath?e.composedPath():e.path;m&&p.target&&p.target.shadowRoot&&h&&(u=h[0]);const f=o.noSwipingSelector?o.noSwipingSelector:`.${o.noSwipingClass}`,g=!(!p.target||!p.target.shadowRoot);if(o.noSwiping&&(g?function(e,t){return void 0===t&&(t=this),function t(s){if(!s||s===a()||s===r())return null;s.assignedSlot&&(s=s.assignedSlot);const i=s.closest(e);return i||s.getRootNode?i||t(s.getRootNode().host):null}(t)}(f,u):u.closest(f)))return void(t.allowClick=!0);if(o.swipeHandler&&!u.closest(o.swipeHandler))return;d.currentX=p.pageX,d.currentY=p.pageY;const v=d.currentX,w=d.currentY,b=o.edgeSwipeDetection||o.iOSEdgeSwipeDetection,y=o.edgeSwipeThreshold||o.iOSEdgeSwipeThreshold;if(b&&(v<=y||v>=i.innerWidth-y)){if("prevent"!==b)return;e.preventDefault()}Object.assign(n,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),d.startX=v,d.startY=w,n.touchStartTime=l(),t.allowClick=!0,t.updateSize(),t.swipeDirection=void 0,o.threshold>0&&(n.allowThresholdMove=!1);let E=!0;u.matches(n.focusableElements)&&(E=!1,"SELECT"===u.nodeName&&(n.isTouched=!1)),s.activeElement&&s.activeElement.matches(n.focusableElements)&&s.activeElement!==u&&s.activeElement.blur();const x=E&&t.allowTouchMove&&o.touchStartPreventDefault;!o.touchStartForcePreventDefault&&!x||u.isContentEditable||p.preventDefault(),o.freeMode&&o.freeMode.enabled&&t.freeMode&&t.animating&&!o.cssMode&&t.freeMode.onTouchStart(),t.emit("touchStart",p)}function X(e){const t=a(),s=this,i=s.touchEventsData,{params:r,touches:n,rtlTranslate:o,enabled:d}=s;if(!d)return;if(!r.simulateTouch&&"mouse"===e.pointerType)return;let c=e;if(c.originalEvent&&(c=c.originalEvent),!i.isTouched)return void(i.startMoving&&i.isScrolling&&s.emit("touchMoveOpposite",c));const p=i.evCache.findIndex((e=>e.pointerId===c.pointerId));p>=0&&(i.evCache[p]=c);const u=i.evCache.length>1?i.evCache[0]:c,m=u.pageX,h=u.pageY;if(c.preventedByNestedSwiper)return n.startX=m,void(n.startY=h);if(!s.allowTouchMove)return c.target.matches(i.focusableElements)||(s.allowClick=!1),void(i.isTouched&&(Object.assign(n,{startX:m,startY:h,prevX:s.touches.currentX,prevY:s.touches.currentY,currentX:m,currentY:h}),i.touchStartTime=l()));if(r.touchReleaseOnEdges&&!r.loop)if(s.isVertical()){if(h<n.startY&&s.translate<=s.maxTranslate()||h>n.startY&&s.translate>=s.minTranslate())return i.isTouched=!1,void(i.isMoved=!1)}else if(m<n.startX&&s.translate<=s.maxTranslate()||m>n.startX&&s.translate>=s.minTranslate())return;if(t.activeElement&&c.target===t.activeElement&&c.target.matches(i.focusableElements))return i.isMoved=!0,void(s.allowClick=!1);if(i.allowTouchCallbacks&&s.emit("touchMove",c),c.targetTouches&&c.targetTouches.length>1)return;n.currentX=m,n.currentY=h;const f=n.currentX-n.startX,g=n.currentY-n.startY;if(s.params.threshold&&Math.sqrt(f**2+g**2)<s.params.threshold)return;if(void 0===i.isScrolling){let e;s.isHorizontal()&&n.currentY===n.startY||s.isVertical()&&n.currentX===n.startX?i.isScrolling=!1:f*f+g*g>=25&&(e=180*Math.atan2(Math.abs(g),Math.abs(f))/Math.PI,i.isScrolling=s.isHorizontal()?e>r.touchAngle:90-e>r.touchAngle)}if(i.isScrolling&&s.emit("touchMoveOpposite",c),void 0===i.startMoving&&(n.currentX===n.startX&&n.currentY===n.startY||(i.startMoving=!0)),i.isScrolling||s.zoom&&s.params.zoom&&s.params.zoom.enabled&&i.evCache.length>1)return void(i.isTouched=!1);if(!i.startMoving)return;s.allowClick=!1,!r.cssMode&&c.cancelable&&c.preventDefault(),r.touchMoveStopPropagation&&!r.nested&&c.stopPropagation();let v=s.isHorizontal()?f:g,w=s.isHorizontal()?n.currentX-n.previousX:n.currentY-n.previousY;r.oneWayMovement&&(v=Math.abs(v)*(o?1:-1),w=Math.abs(w)*(o?1:-1)),n.diff=v,v*=r.touchRatio,o&&(v=-v,w=-w);const b=s.touchesDirection;s.swipeDirection=v>0?"prev":"next",s.touchesDirection=w>0?"prev":"next";const y=s.params.loop&&!r.cssMode;if(!i.isMoved){if(y&&s.loopFix({direction:s.swipeDirection}),i.startTranslate=s.getTranslate(),s.setTransition(0),s.animating){const e=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});
2906s.wrapperEl.dispatchEvent(e)}i.allowMomentumBounce=!1,!r.grabCursor||!0!==s.allowSlideNext&&!0!==s.allowSlidePrev||s.setGrabCursor(!0),s.emit("sliderFirstMove",c)}let E;i.isMoved&&b!==s.touchesDirection&&y&&Math.abs(v)>=1&&(s.loopFix({direction:s.swipeDirection,setTranslate:!0}),E=!0),s.emit("sliderMove",c),i.isMoved=!0,i.currentTranslate=v+i.startTranslate;let x=!0,S=r.resistanceRatio;if(r.touchReleaseOnEdges&&(S=0),v>0?(y&&!E&&i.currentTranslate>(r.centeredSlides?s.minTranslate()-s.size/2:s.minTranslate())&&s.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),i.currentTranslate>s.minTranslate()&&(x=!1,r.resistance&&(i.currentTranslate=s.minTranslate()-1+(-s.minTranslate()+i.startTranslate+v)**S))):v<0&&(y&&!E&&i.currentTranslate<(r.centeredSlides?s.maxTranslate()+s.size/2:s.maxTranslate())&&s.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:s.slides.length-("auto"===r.slidesPerView?s.slidesPerViewDynamic():Math.ceil(parseFloat(r.slidesPerView,10)))}),i.currentTranslate<s.maxTranslate()&&(x=!1,r.resistance&&(i.currentTranslate=s.maxTranslate()+1-(s.maxTranslate()-i.startTranslate-v)**S))),x&&(c.preventedByNestedSwiper=!0),!s.allowSlideNext&&"next"===s.swipeDirection&&i.currentTranslate<i.startTranslate&&(i.currentTranslate=i.startTranslate),!s.allowSlidePrev&&"prev"===s.swipeDirection&&i.currentTranslate>i.startTranslate&&(i.currentTranslate=i.startTranslate),s.allowSlidePrev||s.allowSlideNext||(i.currentTranslate=i.startTranslate),r.threshold>0){if(!(Math.abs(v)>r.threshold||i.allowThresholdMove))return void(i.currentTranslate=i.startTranslate);
vendor: 62,130 bytes, line 2906
2906if(!i.allowThresholdMove)return i.allowThresholdMove=!0,n.startX=n.currentX,n.startY=n.currentY,i.currentTranslate=i.startTranslate,void(n.diff=s.isHorizontal()?n.currentX-n.startX:n.currentY-n.startY)}r.followFinger&&!r.cssMode&&((r.freeMode&&r.freeMode.enabled&&s.freeMode||r.watchSlidesProgress)&&(s.updateActiveIndex(),s.updateSlidesClasses()),r.freeMode&&r.freeMode.enabled&&s.freeMode&&s.freeMode.onTouchMove(),s.updateProgress(i.currentTranslate),s.setTranslate(i.currentTranslate))}function Y(e){const t=this,s=t.touchEventsData,a=s.evCache.findIndex((t=>t.pointerId===e.pointerId));if(a>=0&&s.evCache.splice(a,1),["pointercancel","pointerout","pointerleave"].includes(e.type)){if(!("pointercancel"===e.type&&(t.browser.isSafari||t.browser.isWebView)))return}const{params:i,touches:r,rtlTranslate:o,slidesGrid:d,enabled:c}=t;if(!c)return;if(!i.simulateTouch&&"mouse"===e.pointerType)return;let p=e;if(p.originalEvent&&(p=p.originalEvent),s.allowTouchCallbacks&&t.emit("touchEnd",p),s.allowTouchCallbacks=!1,!s.isTouched)return s.isMoved&&i.grabCursor&&t.setGrabCursor(!1),s.isMoved=!1,void(s.startMoving=!1);i.grabCursor&&s.isMoved&&s.isTouched&&(!0===t.allowSlideNext||!0===t.allowSlidePrev)&&t.setGrabCursor(!1);const u=l(),m=u-s.touchStartTime;if(t.allowClick){const e=p.path||p.composedPath&&p.composedPath();t.updateClickedSlide(e&&e[0]||p.target),t.emit("tap click",p),m<300&&u-s.lastClickTime<300&&t.emit("doubleTap doubleClick",p)}if(s.lastClickTime=l(),n((()=>{t.destroyed||(t.allowClick=!0)})),!s.isTouched||!s.isMoved||!t.swipeDirection||0===r.diff||s.currentTranslate===s.startTranslate)return s.isTouched=!1,s.isMoved=!1,void(s.startMoving=!1);let h;if(s.isTouched=!1,s.isMoved=!1,s.startMoving=!1,h=i.followFinger?o?t.translate:-t.translate:-s.currentTranslate,i.cssMode)return;if(i.freeMode&&i.freeMode.enabled)return void t.freeMode.onTouchEnd({currentPos:h});let f=0,g=t.slidesSizesGrid[0];for(let e=0;e<d.length;e+=e<i.slidesPerGroupSkip?1:i.slidesPerGroup){const t=e<i.slidesPerGroupSkip-1?1:i.slidesPerGroup;void 0!==d[e+t]?h>=d[e]&&h<d[e+t]&&(f=e,g=d[e+t]-d[e]):h>=d[e]&&(f=e,g=d[d.length-1]-d[d.length-2])}let v=null,w=null;i.rewind&&(t.isBeginning?w=i.virtual&&i.virtual.enabled&&t.virtual?t.virtual.slides.length-1:t.slides.length-1:t.isEnd&&(v=0));const b=(h-d[f])/g,y=f<i.slidesPerGroupSkip-1?1:i.slidesPerGroup;if(m>i.longSwipesMs){if(!i.longSwipes)return void t.slideTo(t.activeIndex);"next"===t.swipeDirection&&(b>=i.longSwipesRatio?t.slideTo(i.rewind&&t.isEnd?v:f+y):t.slideTo(f)),"prev"===t.swipeDirection&&(b>1-i.longSwipesRatio?t.slideTo(f+y):null!==w&&b<0&&Math.abs(b)>i.longSwipesRatio?t.slideTo(w):t.slideTo(f))}else{if(!i.shortSwipes)return void t.slideTo(t.activeIndex);t.navigation&&(p.target===t.navigation.nextEl||p.target===t.navigation.prevEl)?p.target===t.navigation.nextEl?t.slideTo(f+y):t.slideTo(f):("next"===t.swipeDirection&&t.slideTo(null!==v?v:f+y),"prev"===t.swipeDirection&&t.slideTo(null!==w?w:f))}}function B(){const e=this,{params:t,el:s}=e;if(s&&0===s.offsetWidth)return;t.breakpoints&&e.setBreakpoint();const{allowSlideNext:a,allowSlidePrev:i,snapGrid:r}=e,n=e.virtual&&e.params.virtual.enabled;e.allowSlideNext=!0,e.allowSlidePrev=!0,e.updateSize(),e.updateSlides(),e.updateSlidesClasses();const l=n&&t.loop;!("auto"===t.slidesPerView||t.slidesPerView>1)||!e.isEnd||e.isBeginning||e.params.centeredSlides||l?e.params.loop&&!n?e.slideToLoop(e.realIndex,0,!1,!0):e.slideTo(e.activeIndex,0,!1,!0):e.slideTo(e.slides.length-1,0,!1,!0),e.autoplay&&e.autoplay.running&&e.autoplay.paused&&(clearTimeout(e.autoplay.resizeTimeout),e.autoplay.resizeTimeout=setTimeout((()=>{e.autoplay&&e.autoplay.running&&e.autoplay.paused&&e.autoplay.resume()}),500)),e.allowSlidePrev=i,e.allowSlideNext=a,e.params.watchOverflow&&r!==e.snapGrid&&e.checkOverflow()}function N(e){const t=this;t.enabled&&(t.allowClick||(t.params.preventClicks&&e.preventDefault(),t.params.preventClicksPropagation&&t.animating&&(e.stopPropagation(),e.stopImmediatePropagation())))}function R(){const e=this,{wrapperEl:t,rtlTranslate:s,enabled:a}=e;if(!a)return;let i;e.previousTranslate=e.translate,e.isHorizontal()?e.translate=-t.scrollLeft:e.translate=-t.scrollTop,0===e.translate&&(e.translate=0),e.updateActiveIndex(),e.updateSlidesClasses();const r=e.maxTranslate()-e.minTranslate();i=0===r?0:(e.translate-e.minTranslate())/r,i!==e.progress&&e.updateProgress(s?-e.translate:e.translate),e.emit("setTranslate",e.translate,!1)}function q(e){const t=this;z(t,e.target),t.params.cssMode||"auto"!==t.params.slidesPerView&&!t.params.autoHeight||t.update()}let F=!1;function _(){}const V=(e,t)=>{const s=a(),{params:i,el:r,wrapperEl:n,device:l}=e,o=!!i.nested,d="on"===t?"addEventListener":"removeEventListener",c=t;r[d]("pointerdown",e.onTouchStart,{passive:!1}),s[d]("pointermove",e.onTouchMove,{passive:!1,capture:o}),s[d]("pointerup",e.onTouchEnd,{passive:!0}),s[d]("pointercancel",e.onTouchEnd,{passive:!0}),s[d]("pointerout",e.onTouchEnd,{passive:!0}),s[d]("pointerleave",e.onTouchEnd,{passive:!0}),(i.preventClicks||i.preventClicksPropagation)&&r[d]("click",e.onClick,!0),i.cssMode&&n[d]("scroll",e.onScroll),i.updateOnWindowResize?e[c](l.ios||l.android?"resize orientationchange observerUpdate":"resize observerUpdate",B,!0):e[c]("observerUpdate",B,!0),r[d]("load",e.onLoad,{capture:!0})};const j=(e,t)=>e.grid&&t.grid&&t.grid.rows>1;var W={init:!0,direction:"horizontal",oneWayMovement:!1,touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopedSlides:null,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function U(e,t){return function(s){void 0===s&&(s={});const a=Object.keys(s)[0],i=s[a];"object"==typeof i&&null!==i?(["navigation","pagination","scrollbar"].indexOf(a)>=0&&!0===e[a]&&(e[a]={auto:!0}),a in e&&"enabled"in i?(!0===e[a]&&(e[a]={enabled:!0}),"object"!=typeof e[a]||"enabled"in e[a]||(e[a].enabled=!0),e[a]||(e[a]={enabled:!1}),c(t,s)):c(t,s)):c(t,s)}}const K={eventsEmitter:L,update:I,translate:k,transition:{setTransition:function(e,t){const s=this;s.params.cssMode||(s.wrapperEl.style.transitionDuration=`${e}ms`),s.emit("setTransition",e,t)},transitionStart:function(e,t){void 0===e&&(e=!0);const s=this,{params:a}=s;a.cssMode||(a.autoHeight&&s.updateAutoHeight(),O({swiper:s,runCallbacks:e,direction:t,step:"Start"}))},transitionEnd:function(e,t){void 0===e&&(e=!0);const s=this,{params:a}=s;s.animating=!1,a.cssMode||(s.setTransition(0),O({swiper:s,runCallbacks:e,direction:t,step:"End"}))}},slide:D,loop:G,grabCursor:{setGrabCursor:function(e){const t=this;if(!t.params.simulateTouch||t.params.watchOverflow&&t.isLocked||t.params.cssMode)return;const s="container"===t.params.touchEventsTarget?t.el:t.wrapperEl;t.isElement&&(t.__preventObserver__=!0),s.style.cursor="move",s.style.cursor=e?"grabbing":"grab",t.isElement&&requestAnimationFrame((()=>{t.__preventObserver__=!1}))},unsetGrabCursor:function(){const e=this;e.params.watchOverflow&&e.isLocked||e.params.cssMode||(e.isElement&&(e.__preventObserver__=!0),e["container"===e.params.touchEventsTarget?"el":"wrapperEl"].style.cursor="",e.isElement&&requestAnimationFrame((()=>{e.__preventObserver__=!1})))}},events:{attachEvents:function(){const e=this,t=a(),{params:s}=e;e.onTouchStart=H.bind(e),e.onTouchMove=X.bind(e),e.onTouchEnd=Y.bind(e),s.cssMode&&(e.onScroll=R.bind(e)),e.onClick=N.bind(e),e.onLoad=q.bind(e),F||(t.addEventListener("touchstart",_),F=!0),V(e,"on")},detachEvents:function(){V(this,"off")}},breakpoints:{setBreakpoint:function(){const e=this,{realIndex:t,initialized:s,params:a,el:i}=e,r=a.breakpoints;if(!r||r&&0===Object.keys(r).length)return;const n=e.getBreakpoint(r,e.params.breakpointsBase,e.el);if(!n||e.currentBreakpoint===n)return;const l=(n in r?r[n]:void 0)||e.originalParams,o=j(e,a),d=j(e,l),p=a.enabled;o&&!d?(i.classList.remove(`${a.containerModifierClass}grid`,`${a.containerModifierClass}grid-column`),e.emitContainerClasses()):!o&&d&&(i.classList.add(`${a.containerModifierClass}grid`),(l.grid.fill&&"column"===l.grid.fill||!l.grid.fill&&"column"===a.grid.fill)&&i.classList.add(`${a.containerModifierClass}grid-column`),e.emitContainerClasses()),["navigation","pagination","scrollbar"].forEach((t=>{if(void 0===l[t])return;const s=a[t]&&a[t].enabled,i=l[t]&&l[t].enabled;s&&!i&&e[t].disable(),!s&&i&&e[t].enable()}));const u=l.direction&&l.direction!==a.direction,m=a.loop&&(l.slidesPerView!==a.slidesPerView||u);u&&s&&e.changeDirection(),c(e.params,l);const h=e.params.enabled;Object.assign(e,{allowTouchMove:e.params.allowTouchMove,allowSlideNext:e.params.allowSlideNext,allowSlidePrev:e.params.allowSlidePrev}),p&&!h?e.disable():!p&&h&&e.enable(),e.currentBreakpoint=n,e.emit("_beforeBreakpoint",l),m&&s&&(e.loopDestroy(),e.loopCreate(t),e.updateSlides()),e.emit("breakpoint",l)},getBreakpoint:function(e,t,s){if(void 0===t&&(t="window"),!e||"container"===t&&!s)return;let a=!1;const i=r(),n="window"===t?i.innerHeight:s.clientHeight,l=Object.keys(e).map((e=>{if("string"==typeof e&&0===e.indexOf("@")){const t=parseFloat(e.substr(1));return{value:n*t,point:e}}return{value:e,point:e}}));l.sort(((e,t)=>parseInt(e.value,10)-parseInt(t.value,10)));for(let e=0;e<l.length;e+=1){const{point:r,value:n}=l[e];"window"===t?i.matchMedia(`(min-width: ${n}px)`).matches&&(a=r):n<=s.clientWidth&&(a=r)}return a||"max"}},checkOverflow:{checkOverflow:function(){const e=this,{isLocked:t,params:s}=e,{slidesOffsetBefore:a}=s;if(a){const t=e.slides.length-1,s=e.slidesGrid[t]+e.slidesSizesGrid[t]+2*a;e.isLocked=e.size>s}else e.isLocked=1===e.snapGrid.length;!0===s.allowSlideNext&&(e.allowSlideNext=!e.isLocked),!0===s.allowSlidePrev&&(e.allowSlidePrev=!e.isLocked),t&&t!==e.isLocked&&(e.isEnd=!1),t!==e.isLocked&&e.emit(e.isLocked?"lock":"unlock")}},classes:{addClasses:function(){const e=this,{classNames:t,params:s,rtl:a,el:i,device:r}=e,n=function(e,t){const s=[];return e.forEach((e=>{"object"==typeof e?Object.keys(e).forEach((a=>{e[a]&&s.push(t+a)})):"string"==typeof e&&s.push(t+e)})),s}(["initialized",s.direction,{"free-mode":e.params.freeMode&&s.freeMode.enabled},{autoheight:s.autoHeight},{rtl:a},{grid:s.grid&&s.grid.rows>1},{"grid-column":s.grid&&s.grid.rows>1&&"column"===s.grid.fill},{android:r.android},{ios:r.ios},{"css-mode":s.cssMode},{centered:s.cssMode&&s.centeredSlides},{"watch-progress":s.watchSlidesProgress}],s.containerModifierClass);t.push(...n),i.classList.add(...t),e.emitContainerClasses()},removeClasses:function(){const{el:e,classNames:t}=this;e.classList.remove(...t),this.emitContainerClasses()}}},Z={};class Q{constructor(){let e,t;for(var s=arguments.length,i=new Array(s),r=0;r<s;r++)i[r]=arguments[r];1===i.length&&i[0].constructor&&"Object"===Object.prototype.toString.call(i[0]).slice(8,-1)?t=i[0]:[e,t]=i,t||(t={}),t=c({},t),e&&!t.el&&(t.el=e);const n=a();if(t.el&&"string"==typeof t.el&&n.querySelectorAll(t.el).length>1){const e=[];return n.querySelectorAll(t.el).forEach((s=>{const a=c({},t,{el:s});e.push(new Q(a))})),e}const l=this;l.__swiper__=!0,l.support=M(),l.device=C({userAgent:t.userAgent}),l.browser=P(),l.eventsListeners={},l.eventsAnyListeners=[],l.modules=[...l.__modules__],t.modules&&Array.isArray(t.modules)&&l.modules.push(...t.modules);const o={};l.modules.forEach((e=>{e({params:t,swiper:l,extendParams:U(t,o),on:l.on.bind(l),once:l.once.bind(l),off:l.off.bind(l),emit:l.emit.bind(l)})}));const d=c({},W,o);return l.params=c({},d,Z,t),l.originalParams=c({},l.params),l.passedParams=c({},t),l.params&&l.params.on&&Object.keys(l.params.on).forEach((e=>{l.on(e,l.params.on[e])})),l.params&&l.params.onAny&&l.onAny(l.params.onAny),Object.assign(l,{enabled:l.params.enabled,el:e,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal:()=>"horizontal"===l.params.direction,isVertical:()=>"vertical"===l.params.direction,activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:l.params.allowSlideNext,allowSlidePrev:l.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:l.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,evCache:[]},allowClick:!0,allowTouchMove:l.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),l.emit("_swiper"),l.params.init&&l.init(),l}getSlideIndex(e){const{slidesEl:t,params:s}=this,a=w(h(t,`.${s.slideClass}, swiper-slide`)[0]);return w(e)-a}getSlideIndexByData(e){return this.getSlideIndex(this.slides.filter((t=>1*t.getAttribute("data-swiper-slide-index")===e))[0])}recalcSlides(){const{slidesEl:e,params:t}=this;this.slides=h(e,`.${t.slideClass}, swiper-slide`)}enable(){const e=this;e.enabled||(e.enabled=!0,e.params.grabCursor&&e.setGrabCursor(),e.emit("enable"))}disable(){const e=this;e.enabled&&(e.enabled=!1,e.params.grabCursor&&e.unsetGrabCursor(),e.emit("disable"))}setProgress(e,t){const s=this;e=Math.min(Math.max(e,0),1);const a=s.minTranslate(),i=(s.maxTranslate()-a)*e+a;s.translateTo(i,void 0===t?0:t),s.updateActiveIndex(),s.updateSlidesClasses()}emitContainerClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const t=e.el.className.split(" ").filter((t=>0===t.indexOf("swiper")||0===t.indexOf(e.params.containerModifierClass)));e.emit("_containerClasses",t.join(" "))}getSlideClasses(e){const t=this;return t.destroyed?"":e.className.split(" ").filter((e=>0===e.indexOf("swiper-slide")||0===e.indexOf(t.params.slideClass))).join(" ")}emitSlidesClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const t=[];e.slides.forEach((s=>{const a=e.getSlideClasses(s);t.push({slideEl:s,classNames:a}),e.emit("_slideClass",s,a)})),e.emit("_slideClasses",t)}slidesPerViewDynamic(e,t){void 0===e&&(e="current"),void 0===t&&(t=!1);const{params:s,slides:a,slidesGrid:i,slidesSizesGrid:r,size:n,activeIndex:l}=this;let o=1;if(s.centeredSlides){let e,t=a[l]?a[l].swiperSlideSize:0;for(let s=l+1;s<a.length;s+=1)a[s]&&!e&&(t+=a[s].swiperSlideSize,o+=1,t>n&&(e=!0));for(let s=l-1;s>=0;s-=1)a[s]&&!e&&(t+=a[s].swiperSlideSize,o+=1,t>n&&(e=!0))}else if("current"===e)for(let e=l+1;e<a.length;e+=1){(t?i[e]+r[e]-i[l]<n:i[e]-i[l]<n)&&(o+=1)}else for(let e=l-1;e>=0;e-=1){i[l]-i[e]<n&&(o+=1)}return o}update(){const e=this;if(!e||e.destroyed)return;const{snapGrid:t,params:s}=e;function a(){const t=e.rtlTranslate?-1*e.translate:e.translate,s=Math.min(Math.max(t,e.maxTranslate()),e.minTranslate());e.setTranslate(s),e.updateActiveIndex(),e.updateSlidesClasses()}let i;if(s.breakpoints&&e.setBreakpoint(),[...e.el.querySelectorAll('[loading="lazy"]')].forEach((t=>{t.complete&&z(e,t)})),e.updateSize(),e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),s.freeMode&&s.freeMode.enabled&&!s.cssMode)a(),s.autoHeight&&e.updateAutoHeight();else{if(("auto"===s.slidesPerView||s.slidesPerView>1)&&e.isEnd&&!s.centeredSlides){const t=e.virtual&&s.virtual.enabled?e.virtual.slides:e.slides;i=e.slideTo(t.length-1,0,!1,!0)}else i=e.slideTo(e.activeIndex,0,!1,!0);i||a()}s.watchOverflow&&t!==e.snapGrid&&e.checkOverflow(),e.emit("update")}changeDirection(e,t){void 0===t&&(t=!0);const s=this,a=s.params.direction;return e||(e="horizontal"===a?"vertical":"horizontal"),e===a||"horizontal"!==e&&"vertical"!==e||(s.el.classList.remove(`${s.params.containerModifierClass}${a}`),s.el.classList.add(`${s.params.containerModifierClass}${e}`),s.emitContainerClasses(),s.params.direction=e,s.slides.forEach((t=>{"vertical"===e?t.style.width="":t.style.height=""})),s.emit("changeDirection"),t&&s.update()),s}changeLanguageDirection(e){const t=this;t.rtl&&"rtl"===e||!t.rtl&&"ltr"===e||(t.rtl="rtl"===e,t.rtlTranslate="horizontal"===t.params.direction&&t.rtl,t.rtl?(t.el.classList.add(`${t.params.containerModifierClass}rtl`),t.el.dir="rtl"):(t.el.classList.remove(`${t.params.containerModifierClass}rtl`),t.el.dir="ltr"),t.update())}mount(e){const t=this;if(t.mounted)return!0;let s=e||t.params.el;if("string"==typeof s&&(s=document.querySelector(s)),!s)return!1;s.swiper=t,s.parentNode&&s.parentNode.host&&(t.isElement=!0);const a=()=>`.${(t.params.wrapperClass||"").trim().split(" ").join(".")}`;let i=(()=>{if(s&&s.shadowRoot&&s.shadowRoot.querySelector){return s.shadowRoot.querySelector(a())}return h(s,a())[0]})();return!i&&t.params.createElements&&(i=f("div",t.params.wrapperClass),s.append(i),h(s,`.${t.params.slideClass}`).forEach((e=>{i.append(e)}))),Object.assign(t,{el:s,wrapperEl:i,slidesEl:t.isElement?s.parentNode.host:i,hostEl:t.isElement?s.parentNode.host:s,mounted:!0,rtl:"rtl"===s.dir.toLowerCase()||"rtl"===v(s,"direction"),rtlTranslate:"horizontal"===t.params.direction&&("rtl"===s.dir.toLowerCase()||"rtl"===v(s,"direction")),wrongRTL:"-webkit-box"===v(i,"display")}),!0}init(e){const t=this;if(t.initialized)return t;return!1===t.mount(e)||(t.emit("beforeInit"),t.params.breakpoints&&t.setBreakpoint(),t.addClasses(),t.updateSize(),t.updateSlides(),t.params.watchOverflow&&t.checkOverflow(),t.params.grabCursor&&t.enabled&&t.setGrabCursor(),t.params.loop&&t.virtual&&t.params.virtual.enabled?t.slideTo(t.params.initialSlide+t.virtual.slidesBefore,0,t.params.runCallbacksOnInit,!1,!0):t.slideTo(t.params.initialSlide,0,t.params.runCallbacksOnInit,!1,!0),t.params.loop&&t.loopCreate(),t.attachEvents(),[...t.el.querySelectorAll('[loading="lazy"]')].forEach((e=>{e.complete?z(t,e):e.addEventListener("load",(e=>{z(t,e.target)}))})),$(t),t.initialized=!0,$(t),t.emit("init"),t.emit("afterInit")),t}destroy(e,t){void 0===e&&(e=!0),void 0===t&&(t=!0);const s=this,{params:a,el:i,wrapperEl:r,slides:n}=s;return void 0===s.params||s.destroyed||(s.emit("beforeDestroy"),s.initialized=!1,s.detachEvents(),a.loop&&s.loopDestroy(),t&&(s.removeClasses(),i.removeAttribute("style"),r.removeAttribute("style"),n&&n.length&&n.forEach((e=>{e.classList.remove(a.slideVisibleClass,a.slideActiveClass,a.slideNextClass,a.slidePrevClass),e.removeAttribute("style"),e.removeAttribute("data-swiper-slide-index")}))),s.emit("destroy"),Object.keys(s.eventsListeners).forEach((e=>{s.off(e)})),!1!==e&&(s.el.swiper=null,function(e){const t=e;Object.keys(t).forEach((e=>{try{t[e]=null}catch(e){}try{delete t[e]}catch(e){}}))}(s)),s.destroyed=!0),null}static extendDefaults(e){c(Z,e)}static get extendedDefaults(){return Z}static get defaults(){return W}static installModule(e){Q.prototype.__modules__||(Q.prototype.__modules__=[]);const t=Q.prototype.__modules__;"function"==typeof e&&t.indexOf(e)<0&&t.push(e)}static use(e){return Array.isArray(e)?(e.forEach((e=>Q.installModule(e))),Q):(Q.installModule(e),Q)}}function J(e,t,s,a){return e.params.createElements&&Object.keys(a).forEach((i=>{if(!s[i]&&!0===s.auto){let r=h(e.el,`.${a[i]}`)[0];r||(r=f("div",a[i]),r.className=a[i],e.el.append(r)),s[i]=r,t[i]=r}})),s}function ee(e){return void 0===e&&(e=""),`.${e.trim().replace(/([\.:!+\/])/g,"\\$1").replace(/ /g,".")}`}function te(e){const t=this,{params:s,slidesEl:a}=t;s.loop&&t.loopDestroy();const i=e=>{if("string"==typeof e){const t=document.createElement("div");t.innerHTML=e,a.append(t.children[0]),t.innerHTML=""}else a.append(e)};if("object"==typeof e&&"length"in e)for(let t=0;t<e.length;t+=1)e[t]&&i(e[t]);else i(e);t.recalcSlides(),s.loop&&t.loopCreate(),s.observer&&!t.isElement||t.update()}function se(e){const t=this,{params:s,activeIndex:a,slidesEl:i}=t;s.loop&&t.loopDestroy();let r=a+1;const n=e=>{if("string"==typeof e){const t=document.createElement("div");t.innerHTML=e,i.prepend(t.children[0]),t.innerHTML=""}else i.prepend(e)};if("object"==typeof e&&"length"in e){for(let t=0;t<e.length;t+=1)e[t]&&n(e[t]);r=a+e.length}else n(e);t.recalcSlides(),s.loop&&t.loopCreate(),s.observer&&!t.isElement||t.update(),t.slideTo(r,0,!1)}function ae(e,t){const s=this,{params:a,activeIndex:i,slidesEl:r}=s;let n=i;a.loop&&(n-=s.loopedSlides,s.loopDestroy(),s.recalcSlides());const l=s.slides.length;if(e<=0)return void s.prependSlide(t);if(e>=l)return void s.appendSlide(t);let o=n>e?n+1:n;const d=[];for(let t=l-1;t>=e;t-=1){const e=s.slides[t];e.remove(),d.unshift(e)}if("object"==typeof t&&"length"in t){for(let e=0;e<t.length;e+=1)t[e]&&r.append(t[e]);o=n>e?n+t.length:n}else r.append(t);for(let e=0;e<d.length;e+=1)r.append(d[e]);s.recalcSlides(),a.loop&&s.loopCreate(),a.observer&&!s.isElement||s.update(),a.loop?s.slideTo(o+s.loopedSlides,0,!1):s.slideTo(o,0,!1)}function ie(e){const t=this,{params:s,activeIndex:a}=t;let i=a;s.loop&&(i-=t.loopedSlides,t.loopDestroy());let r,n=i;if("object"==typeof e&&"length"in e){for(let s=0;s<e.length;s+=1)r=e[s],t.slides[r]&&t.slides[r].remove(),r<n&&(n-=1);n=Math.max(n,0)}else r=e,t.slides[r]&&t.slides[r].remove(),r<n&&(n-=1),n=Math.max(n,0);t.recalcSlides(),s.loop&&t.loopCreate(),s.observer&&!t.isElement||t.update(),s.loop?t.slideTo(n+t.loopedSlides,0,!1):t.slideTo(n,0,!1)}function re(){const e=this,t=[];for(let s=0;s<e.slides.length;s+=1)t.push(s);e.removeSlide(t)}function ne(e){const{effect:t,swiper:s,on:a,setTranslate:i,setTransition:r,overwriteParams:n,perspective:l,recreateShadows:o,getEffectParams:d}=e;let c;a("beforeInit",(()=>{if(s.params.effect!==t)return;s.classNames.push(`${s.params.containerModifierClass}${t}`),l&&l()&&s.classNames.push(`${s.params.containerModifierClass}3d`);const e=n?n():{};Object.assign(s.params,e),Object.assign(s.originalParams,e)})),a("setTranslate",(()=>{s.params.effect===t&&i()})),a("setTransition",((e,a)=>{s.params.effect===t&&r(a)})),a("transitionEnd",(()=>{if(s.params.effect===t&&o){if(!d||!d().slideShadows)return;s.slides.forEach((e=>{e.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach((e=>e.remove()))})),o()}})),a("virtualUpdate",(()=>{s.params.effect===t&&(s.slides.length||(c=!0),requestAnimationFrame((()=>{c&&s.slides&&s.slides.length&&(i(),c=!1)})))}))}function le(e,t){const s=m(t);return s!==t&&(s.style.backfaceVisibility="hidden",s.style["-webkit-backface-visibility"]="hidden"),s}function oe(e){let{swiper:t,duration:s,transformElements:a,allSlides:i}=e;const{activeIndex:r}=t;if(t.params.virtualTranslate&&0!==s){let e,s=!1;e=i?a:a.filter((e=>{const s=e.classList.contains("swiper-slide-transform")?(e=>{if(!e.parentElement)return t.slides.filter((t=>t.shadowRoot&&t.shadowRoot===e.parentNode))[0];return e.parentElement})(e):e;return t.getSlideIndex(s)===r})),e.forEach((e=>{y(e,(()=>{if(s)return;if(!t||t.destroyed)return;s=!0,t.animating=!1;const e=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});t.wrapperEl.dispatchEvent(e)}))}))}}function de(e,t,s){const a=`swiper-slide-shadow${s?`-${s}`:""}${e?` swiper-slide-shadow-${e}`:""}`,i=m(t);let r=i.querySelector(`.${a.split(" ").join(".")}`);return r||(r=f("div",a.split(" ")),i.append(r)),r}Object.keys(K).forEach((e=>{Object.keys(K[e]).forEach((t=>{Q.prototype[t]=K[e][t]}))})),Q.use([function(e){let{swiper:t,on:s,emit:a}=e;const i=r();let n=null,l=null;const o=()=>{t&&!t.destroyed&&t.initialized&&(a("beforeResize"),a("resize"))},d=()=>{t&&!t.destroyed&&t.initialized&&a("orientationchange")};s("init",(()=>{t.params.resizeObserver&&void 0!==i.ResizeObserver?t&&!t.destroyed&&t.initialized&&(n=new ResizeObserver((e=>{l=i.requestAnimationFrame((()=>{const{width:s,height:a}=t;let i=s,r=a;e.forEach((e=>{let{contentBoxSize:s,contentRect:a,target:n}=e;n&&n!==t.el||(i=a?a.width:(s[0]||s).inlineSize,r=a?a.height:(s[0]||s).blockSize)})),i===s&&r===a||o()}))})),n.observe(t.el)):(i.addEventListener("resize",o),i.addEventListener("orientationchange",d))})),s("destroy",(()=>{l&&i.cancelAnimationFrame(l),n&&n.unobserve&&t.el&&(n.unobserve(t.el),n=null),i.removeEventListener("resize",o),i.removeEventListener("orientationchange",d)}))},function(e){let{swiper:t,extendParams:s,on:a,emit:i}=e;const n=[],l=r(),o=function(e,s){void 0===s&&(s={});const a=new(l.MutationObserver||l.WebkitMutationObserver)((e=>{if(t.__preventObserver__)return;if(1===e.length)return void i("observerUpdate",e[0]);const s=function(){i("observerUpdate",e[0])};l.requestAnimationFrame?l.requestAnimationFrame(s):l.setTimeout(s,0)}));a.observe(e,{attributes:void 0===s.attributes||s.attributes,childList:void 0===s.childList||s.childList,characterData:void 0===s.characterData||s.characterData}),n.push(a)};s({observer:!1,observeParents:!1,observeSlideChildren:!1}),a("init",(()=>{if(t.params.observer){if(t.params.observeParents){const e=b(t.el);for(let t=0;t<e.length;t+=1)o(e[t])}o(t.el,{childList:t.params.observeSlideChildren}),o(t.wrapperEl,{attributes:!1})}})),a("destroy",(()=>{n.forEach((e=>{e.disconnect()})),n.splice(0,n.length)}))}]);const ce=[function(e){let t,{swiper:s,extendParams:i,on:r,emit:n}=e;i({virtual:{enabled:!1,slides:[],cache:!0,renderSlide:null,renderExternal:null,renderExternalUpdate:!0,addSlidesBefore:0,addSlidesAfter:0}});const l=a();s.virtual={cache:{},from:void 0,to:void 0,slides:[],offset:0,slidesGrid:[]};const o=l.createElement("div");function d(e,t){const a=s.params.virtual;if(a.cache&&s.virtual.cache[t])return s.virtual.cache[t];let i;return a.renderSlide?(i=a.renderSlide.call(s,e,t),"string"==typeof i&&(o.innerHTML=i,i=o.children[0])):i=s.isElement?f("swiper-slide"):f("div",s.params.slideClass),i.setAttribute("data-swiper-slide-index",t),a.renderSlide||(i.innerHTML=e),a.cache&&(s.virtual.cache[t]=i),i}function c(e){const{slidesPerView:t,slidesPerGroup:a,centeredSlides:i,loop:r}=s.params,{addSlidesBefore:l,addSlidesAfter:o}=s.params.virtual,{from:c,to:p,slides:u,slidesGrid:m,offset:f}=s.virtual;s.params.cssMode||s.updateActiveIndex();const g=s.activeIndex||0;let v,w,b;v=s.rtlTranslate?"right":s.isHorizontal()?"left":"top",i?(w=Math.floor(t/2)+a+o,b=Math.floor(t/2)+a+l):(w=t+(a-1)+o,b=(r?t:a)+l);let y=g-b,E=g+w;r||(y=Math.max(y,0),E=Math.min(E,u.length-1));let x=(s.slidesGrid[y]||0)-(s.slidesGrid[0]||0);function S(){s.updateSlides(),s.updateProgress(),s.updateSlidesClasses(),n("virtualUpdate")}if(r&&g>=b?(y-=b,i||(x+=s.slidesGrid[0])):r&&g<b&&(y=-b,i&&(x+=s.slidesGrid[0])),Object.assign(s.virtual,{from:y,to:E,offset:x,slidesGrid:s.slidesGrid,slidesBefore:b,slidesAfter:w}),c===y&&p===E&&!e)return s.slidesGrid!==m&&x!==f&&s.slides.forEach((e=>{e.style[v]=x-Math.abs(s.cssOverflowAdjustment())+"px"})),s.updateProgress(),void n("virtualUpdate");if(s.params.virtual.renderExternal)return s.params.virtual.renderExternal.call(s,{offset:x,from:y,to:E,slides:function(){const e=[];for(let t=y;t<=E;t+=1)e.push(u[t]);return e}()}),void(s.params.virtual.renderExternalUpdate?S():n("virtualUpdate"));const T=[],M=[],C=e=>{let t=e;return e<0?t=u.length+e:t>=u.length&&(t-=u.length),t};if(e)s.slidesEl.querySelectorAll(`.${s.params.slideClass}, swiper-slide`).forEach((e=>{e.remove()}));else for(let e=c;e<=p;e+=1)if(e<y||e>E){const t=C(e);s.slidesEl.querySelectorAll(`.${s.params.slideClass}[data-swiper-slide-index="${t}"], swiper-slide[data-swiper-slide-index="${t}"]`).forEach((e=>{e.remove()}))}const P=r?-u.length:0,L=r?2*u.length:u.length;for(let t=P;t<L;t+=1)if(t>=y&&t<=E){const s=C(t);void 0===p||e?M.push(s):(t>p&&M.push(s),t<c&&T.push(s))}if(M.forEach((e=>{s.slidesEl.append(d(u[e],e))})),r)for(let e=T.length-1;e>=0;e-=1){const t=T[e];s.slidesEl.prepend(d(u[t],t))}else T.sort(((e,t)=>t-e)),T.forEach((e=>{s.slidesEl.prepend(d(u[e],e))}));h(s.slidesEl,".swiper-slide, swiper-slide").forEach((e=>{e.style[v]=x-Math.abs(s.cssOverflowAdjustment())+"px"})),S()}r("beforeInit",(()=>{if(!s.params.virtual.enabled)return;let e;if(void 0===s.passedParams.virtual.slides){const t=[...s.slidesEl.children].filter((e=>e.matches(`.${s.params.slideClass}, swiper-slide`)));t&&t.length&&(s.virtual.slides=[...t],e=!0,t.forEach(((e,t)=>{e.setAttribute("data-swiper-slide-index",t),s.virtual.cache[t]=e,e.remove()})))}e||(s.virtual.slides=s.params.virtual.slides),s.classNames.push(`${s.params.containerModifierClass}virtual`),s.params.watchSlidesProgress=!0,s.originalParams.watchSlidesProgress=!0,s.params.initialSlide||c()})),r("setTranslate",(()=>{s.params.virtual.enabled&&(s.params.cssMode&&!s._immediateVirtual?(clearTimeout(t),t=setTimeout((()=>{c()}),100)):c())})),r("init update resize",(()=>{s.params.virtual.enabled&&s.params.cssMode&&p(s.wrapperEl,"--swiper-virtual-size",`${s.virtualSize}px`)})),Object.assign(s.virtual,{appendSlide:function(e){if("object"==typeof e&&"length"in e)for(let t=0;t<e.length;t+=1)e[t]&&s.virtual.slides.push(e[t]);else s.virtual.slides.push(e);c(!0)},prependSlide:function(e){const t=s.activeIndex;let a=t+1,i=1;if(Array.isArray(e)){for(let t=0;t<e.length;t+=1)e[t]&&s.virtual.slides.unshift(e[t]);a=t+e.length,i=e.length}else s.virtual.slides.unshift(e);if(s.params.virtual.cache){const e=s.virtual.cache,t={};Object.keys(e).forEach((s=>{const a=e[s],r=a.getAttribute("data-swiper-slide-index");r&&a.setAttribute("data-swiper-slide-index",parseInt(r,10)+i),t[parseInt(s,10)+i]=a})),s.virtual.cache=t}c(!0),s.slideTo(a,0)},removeSlide:function(e){if(null==e)return;let t=s.activeIndex;if(Array.isArray(e))for(let a=e.length-1;a>=0;a-=1)s.virtual.slides.splice(e[a],1),s.params.virtual.cache&&delete s.virtual.cache[e[a]],e[a]<t&&(t-=1),t=Math.max(t,0);else s.virtual.slides.splice(e,1),s.params.virtual.cache&&delete s.virtual.cache[e],e<t&&(t-=1),t=Math.max(t,0);c(!0),s.slideTo(t,0)},removeAllSlides:function(){s.virtual.slides=[],s.params.virtual.cache&&(s.virtual.cache={}),c(!0),s.slideTo(0,0)},update:c})},function(e){let{swiper:t,extendParams:s,on:i,emit:n}=e;const l=a(),o=r();function d(e){if(!t.enabled)return;const{rtlTranslate:s}=t;let a=e;a.originalEvent&&(a=a.originalEvent);const i=a.keyCode||a.charCode,r=t.params.keyboard.pageUpDown,d=r&&33===i,c=r&&34===i,p=37===i,u=39===i,m=38===i,h=40===i;if(!t.allowSlideNext&&(t.isHorizontal()&&u||t.isVertical()&&h||c))return!1;if(!t.allowSlidePrev&&(t.isHorizontal()&&p||t.isVertical()&&m||d))return!1;if(!(a.shiftKey||a.altKey||a.ctrlKey||a.metaKey||l.activeElement&&l.activeElement.nodeName&&("input"===l.activeElement.nodeName.toLowerCase()||"textarea"===l.activeElement.nodeName.toLowerCase()))){if(t.params.keyboard.onlyInViewport&&(d||c||p||u||m||h)){let e=!1;if(b(t.el,`.${t.params.slideClass}, swiper-slide`).length>0&&0===b(t.el,`.${t.params.slideActiveClass}`).length)return;const a=t.el,i=a.clientWidth,r=a.clientHeight,n=o.innerWidth,l=o.innerHeight,d=g(a);s&&(d.left-=a.scrollLeft);const c=[[d.left,d.top],[d.left+i,d.top],[d.left,d.top+r],[d.left+i,d.top+r]];for(let t=0;t<c.length;t+=1){const s=c[t];if(s[0]>=0&&s[0]<=n&&s[1]>=0&&s[1]<=l){if(0===s[0]&&0===s[1])continue;e=!0}}if(!e)return}t.isHorizontal()?((d||c||p||u)&&(a.preventDefault?a.preventDefault():a.returnValue=!1),((c||u)&&!s||(d||p)&&s)&&t.slideNext(),((d||p)&&!s||(c||u)&&s)&&t.slidePrev()):((d||c||m||h)&&(a.preventDefault?a.preventDefault():a.returnValue=!1),(c||h)&&t.slideNext(),(d||m)&&t.slidePrev()),n("keyPress",i)}}function c(){t.keyboard.enabled||(l.addEventListener("keydown",d),t.keyboard.enabled=!0)}function p(){t.keyboard.enabled&&(l.removeEventListener("keydown",d),t.keyboard.enabled=!1)}t.keyboard={enabled:!1},s({keyboard:{enabled:!1,onlyInViewport:!0,pageUpDown:!0}}),i("init",(()=>{t.params.keyboard.enabled&&c()})),i("destroy",(()=>{t.keyboard.enabled&&p()})),Object.assign(t.keyboard,{enable:c,disable:p})},function(e){let{swiper:t,extendParams:s,on:a,emit:i}=e;const o=r();let d;s({mousewheel:{enabled:!1,releaseOnEdges:!1,invert:!1,forceToAxis:!1,sensitivity:1,eventsTarget:"container",thresholdDelta:null,thresholdTime:null,noMousewheelClass:"swiper-no-mousewheel"}}),t.mousewheel={enabled:!1};let c,p=l();const u=[];function m(){t.enabled&&(t.mouseEntered=!0)}function h(){t.enabled&&(t.mouseEntered=!1)}function f(e){return!(t.params.mousewheel.thresholdDelta&&e.delta<t.params.mousewheel.thresholdDelta)&&(!(t.params.mousewheel.thresholdTime&&l()-p<t.params.mousewheel.thresholdTime)&&(e.delta>=6&&l()-p<60||(e.direction<0?t.isEnd&&!t.params.loop||t.animating||(t.slideNext(),i("scroll",e.raw)):t.isBeginning&&!t.params.loop||t.animating||(t.slidePrev(),i("scroll",e.raw)),p=(new o.Date).getTime(),!1)))}function g(e){let s=e,a=!0;if(!t.enabled)return;if(e.target.closest(`.${t.params.mousewheel.noMousewheelClass}`))return;const r=t.params.mousewheel;t.params.cssMode&&s.preventDefault();let o=t.el;"container"!==t.params.mousewheel.eventsTarget&&(o=document.querySelector(t.params.mousewheel.eventsTarget));const p=o&&o.contains(s.target);if(!t.mouseEntered&&!p&&!r.releaseOnEdges)return!0;s.originalEvent&&(s=s.originalEvent);let m=0;const h=t.rtlTranslate?-1:1,g=function(e){let t=0,s=0,a=0,i=0;return"detail"in e&&(s=e.detail),"wheelDelta"in e&&(s=-e.wheelDelta/120),"wheelDeltaY"in e&&(s=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=s,s=0),a=10*t,i=10*s,"deltaY"in e&&(i=e.deltaY),"deltaX"in e&&(a=e.deltaX),e.shiftKey&&!a&&(a=i,i=0),(a||i)&&e.deltaMode&&(1===e.deltaMode?(a*=40,i*=40):(a*=800,i*=800)),a&&!t&&(t=a<1?-1:1),i&&!s&&(s=i<1?-1:1),{spinX:t,spinY:s,pixelX:a,pixelY:i}}(s);if(r.forceToAxis)if(t.isHorizontal()){if(!(Math.abs(g.pixelX)>Math.abs(g.pixelY)))return!0;m=-g.pixelX*h}else{if(!(Math.abs(g.pixelY)>Math.abs(g.pixelX)))return!0;m=-g.pixelY}else m=Math.abs(g.pixelX)>Math.abs(g.pixelY)?-g.pixelX*h:-g.pixelY;if(0===m)return!0;r.invert&&(m=-m);let v=t.getTranslate()+m*r.sensitivity;if(v>=t.minTranslate()&&(v=t.minTranslate()),v<=t.maxTranslate()&&(v=t.maxTranslate()),a=!!t.params.loop||!(v===t.minTranslate()||v===t.maxTranslate()),a&&t.params.nested&&s.stopPropagation(),t.params.freeMode&&t.params.freeMode.enabled){const e={time:l(),delta:Math.abs(m),direction:Math.sign(m)},a=c&&e.time<c.time+500&&e.delta<=c.delta&&e.direction===c.direction;if(!a){c=void 0;let l=t.getTranslate()+m*r.sensitivity;const o=t.isBeginning,p=t.isEnd;if(l>=t.minTranslate()&&(l=t.minTranslate()),l<=t.maxTranslate()&&(l=t.maxTranslate()),t.setTransition(0),t.setTranslate(l),t.updateProgress(),t.updateActiveIndex(),t.updateSlidesClasses(),(!o&&t.isBeginning||!p&&t.isEnd)&&t.updateSlidesClasses(),t.params.loop&&t.loopFix({direction:e.direction<0?"next":"prev",byMousewheel:!0}),t.params.freeMode.sticky){clearTimeout(d),d=void 0,u.length>=15&&u.shift();const s=u.length?u[u.length-1]:void 0,a=u[0];if(u.push(e),s&&(e.delta>s.delta||e.direction!==s.direction))u.splice(0);else if(u.length>=15&&e.time-a.time<500&&a.delta-e.delta>=1&&e.delta<=6){const s=m>0?.8:.2;c=e,u.splice(0),d=n((()=>{t.slideToClosest(t.params.speed,!0,void 0,s)}),0)}d||(d=n((()=>{c=e,u.splice(0),t.slideToClosest(t.params.speed,!0,void 0,.5)}),500))}if(a||i("scroll",s),t.params.autoplay&&t.params.autoplayDisableOnInteraction&&t.autoplay.stop(),l===t.minTranslate()||l===t.maxTranslate())return!0}}else{const s={time:l(),delta:Math.abs(m),direction:Math.sign(m),raw:e};u.length>=2&&u.shift();const a=u.length?u[u.length-1]:void 0;if(u.push(s),a?(s.direction!==a.direction||s.delta>a.delta||s.time>a.time+150)&&f(s):f(s),function(e){const s=t.params.mousewheel;if(e.direction<0){if(t.isEnd&&!t.params.loop&&s.releaseOnEdges)return!0}else if(t.isBeginning&&!t.params.loop&&s.releaseOnEdges)return!0;return!1}(s))return!0}return s.preventDefault?s.preventDefault():s.returnValue=!1,!1}function v(e){let s=t.el;"container"!==t.params.mousewheel.eventsTarget&&(s=document.querySelector(t.params.mousewheel.eventsTarget)),s[e]("mouseenter",m),s[e]("mouseleave",h),s[e]("wheel",g)}function w(){return t.params.cssMode?(t.wrapperEl.removeEventListener("wheel",g),!0):!t.mousewheel.enabled&&(v("addEventListener"),t.mousewheel.enabled=!0,!0)}function b(){return t.params.cssMode?(t.wrapperEl.addEventListener(event,g),!0):!!t.mousewheel.enabled&&(v("removeEventListener"),t.mousewheel.enabled=!1,!0)}a("init",(()=>{!t.params.mousewheel.enabled&&t.params.cssMode&&b(),t.params.mousewheel.enabled&&w()})),a("destroy",(()=>{t.params.cssMode&&w(),t.mousewheel.enabled&&b()})),Object.assign(t.mousewheel,{enable:w,disable:b})},function(e){let{swiper:t,extendParams:s,on:a,emit:i}=e;s({navigation:{nextEl:null,prevEl:null,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock",navigationDisabledClass:"swiper-navigation-disabled"}}),t.navigation={nextEl:null,prevEl:null};const r=e=>(Array.isArray(e)||(e=[e].filter((e=>!!e))),e);function n(e){let s;return e&&"string"==typeof e&&t.isElement&&(s=t.el.querySelector(e),s)?s:(e&&("string"==typeof e&&(s=[...document.querySelectorAll(e)]),t.params.uniqueNavElements&&"string"==typeof e&&s.length>1&&1===t.el.querySelectorAll(e).length&&(s=t.el.querySelector(e))),e&&!s?e:s)}function l(e,s){const a=t.params.navigation;(e=r(e)).forEach((e=>{e&&(e.classList[s?"add":"remove"](...a.disabledClass.split(" ")),"BUTTON"===e.tagName&&(e.disabled=s),t.params.watchOverflow&&t.enabled&&e.classList[t.isLocked?"add":"remove"](a.lockClass))}))}function o(){const{nextEl:e,prevEl:s}=t.navigation;if(t.params.loop)return l(s,!1),void l(e,!1);l(s,t.isBeginning&&!t.params.rewind),l(e,t.isEnd&&!t.params.rewind)}function d(e){e.preventDefault(),(!t.isBeginning||t.params.loop||t.params.rewind)&&(t.slidePrev(),i("navigationPrev"))}function c(e){e.preventDefault(),(!t.isEnd||t.params.loop||t.params.rewind)&&(t.slideNext(),i("navigationNext"))}function p(){const e=t.params.navigation;if(t.params.navigation=J(t,t.originalParams.navigation,t.params.navigation,{nextEl:"swiper-button-next",prevEl:"swiper-button-prev"}),!e.nextEl&&!e.prevEl)return;let s=n(e.nextEl),a=n(e.prevEl);Object.assign(t.navigation,{nextEl:s,prevEl:a}),s=r(s),a=r(a);const i=(s,a)=>{s&&s.addEventListener("click","next"===a?c:d),!t.enabled&&s&&s.classList.add(...e.lockClass.split(" "))};s.forEach((e=>i(e,"next"))),a.forEach((e=>i(e,"prev")))}function u(){let{nextEl:e,prevEl:s}=t.navigation;e=r(e),s=r(s);const a=(e,s)=>{e.removeEventListener("click","next"===s?c:d),e.classList.remove(...t.params.navigation.disabledClass.split(" "))};e.forEach((e=>a(e,"next"))),s.forEach((e=>a(e,"prev")))}a("init",(()=>{!1===t.params.navigation.enabled?m():(p(),o())})),a("toEdge fromEdge lock unlock",(()=>{o()})),a("destroy",(()=>{u()})),a("enable disable",(()=>{let{nextEl:e,prevEl:s}=t.navigation;e=r(e),s=r(s),[...e,...s].filter((e=>!!e)).forEach((e=>e.classList[t.enabled?"remove":"add"](t.params.navigation.lockClass)))})),a("click",((e,s)=>{let{nextEl:a,prevEl:n}=t.navigation;a=r(a),n=r(n);const l=s.target;if(t.params.navigation.hideOnClick&&!n.includes(l)&&!a.includes(l)){if(t.pagination&&t.params.pagination&&t.params.pagination.clickable&&(t.pagination.el===l||t.pagination.el.contains(l)))return;let e;a.length?e=a[0].classList.contains(t.params.navigation.hiddenClass):n.length&&(e=n[0].classList.contains(t.params.navigation.hiddenClass)),i(!0===e?"navigationShow":"navigationHide"),[...a,...n].filter((e=>!!e)).forEach((e=>e.classList.toggle(t.params.navigation.hiddenClass)))}}));const m=()=>{t.el.classList.add(...t.params.navigation.navigationDisabledClass.split(" ")),u()};Object.assign(t.navigation,{enable:()=>{t.el.classList.remove(...t.params.navigation.navigationDisabledClass.split(" ")),p(),o()},disable:m,update:o,init:p,destroy:u})},function(e){let{swiper:t,extendParams:s,on:a,emit:i}=e;const r="swiper-pagination";let n;s({pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,formatFractionCurrent:e=>e,formatFractionTotal:e=>e,bulletClass:`${r}-bullet`,bulletActiveClass:`${r}-bullet-active`,modifierClass:`${r}-`,currentClass:`${r}-current`,totalClass:`${r}-total`,hiddenClass:`${r}-hidden`,progressbarFillClass:`${r}-progressbar-fill`,progressbarOppositeClass:`${r}-progressbar-opposite`,clickableClass:`${r}-clickable`,lockClass:`${r}-lock`,horizontalClass:`${r}-horizontal`,verticalClass:`${r}-vertical`,paginationDisabledClass:`${r}-disabled`}}),t.pagination={el:null,bullets:[]};let l=0;const o=e=>(Array.isArray(e)||(e=[e].filter((e=>!!e))),e);function d(){return!t.params.pagination.el||!t.pagination.el||Array.isArray(t.pagination.el)&&0===t.pagination.el.length}function c(e,s){const{bulletActiveClass:a}=t.params.pagination;e&&(e=e[("prev"===s?"previous":"next")+"ElementSibling"])&&(e.classList.add(`${a}-${s}`),(e=e[("prev"===s?"previous":"next")+"ElementSibling"])&&e.classList.add(`${a}-${s}-${s}`))}function p(e){const s=e.target.closest(ee(t.params.pagination.bulletClass));if(!s)return;e.preventDefault();const a=w(s)*t.params.slidesPerGroup;if(t.params.loop){if(t.realIndex===a)return;const e=t.getSlideIndexByData(a),s=t.getSlideIndexByData(t.realIndex);e>t.slides.length-t.loopedSlides&&t.loopFix({direction:e>s?"next":"prev",activeSlideIndex:e,slideTo:!1}),t.slideToLoop(a)}else t.slideTo(a)}function u(){const e=t.rtl,s=t.params.pagination;if(d())return;let a,r,p=t.pagination.el;p=o(p);const u=t.virtual&&t.params.virtual.enabled?t.virtual.slides.length:t.slides.length,m=t.params.loop?Math.ceil(u/t.params.slidesPerGroup):t.snapGrid.length;if(t.params.loop?(r=t.previousRealIndex||0,a=t.params.slidesPerGroup>1?Math.floor(t.realIndex/t.params.slidesPerGroup):t.realIndex):void 0!==t.snapIndex?(a=t.snapIndex,r=t.previousSnapIndex):(r=t.previousIndex||0,a=t.activeIndex||0),"bullets"===s.type&&t.pagination.bullets&&t.pagination.bullets.length>0){const i=t.pagination.bullets;let o,d,u;if(s.dynamicBullets&&(n=E(i[0],t.isHorizontal()?"width":"height",!0),p.forEach((e=>{e.style[t.isHorizontal()?"width":"height"]=n*(s.dynamicMainBullets+4)+"px"})),s.dynamicMainBullets>1&&void 0!==r&&(l+=a-(r||0),l>s.dynamicMainBullets-1?l=s.dynamicMainBullets-1:l<0&&(l=0)),o=Math.max(a-l,0),d=o+(Math.min(i.length,s.dynamicMainBullets)-1),u=(d+o)/2),i.forEach((e=>{const t=[...["","-next","-next-next","-prev","-prev-prev","-main"].map((e=>`${s.bulletActiveClass}${e}`))].map((e=>"string"==typeof e&&e.includes(" ")?e.split(" "):e)).flat();e.classList.remove(...t)})),p.length>1)i.forEach((e=>{const i=w(e);i===a?e.classList.add(...s.bulletActiveClass.split(" ")):t.isElement&&e.setAttribute("part","bullet"),s.dynamicBullets&&(i>=o&&i<=d&&e.classList.add(...`${s.bulletActiveClass}-main`.split(" ")),i===o&&c(e,"prev"),i===d&&c(e,"next"))}));else{const e=i[a];if(e&&e.classList.add(...s.bulletActiveClass.split(" ")),t.isElement&&i.forEach(((e,t)=>{e.setAttribute("part",t===a?"bullet-active":"bullet")})),s.dynamicBullets){const e=i[o],t=i[d];for(let e=o;e<=d;e+=1)i[e]&&i[e].classList.add(...`${s.bulletActiveClass}-main`.split(" "));c(e,"prev"),c(t,"next")}}if(s.dynamicBullets){const a=Math.min(i.length,s.dynamicMainBullets+4),r=(n*a-n)/2-u*n,l=e?"right":"left";i.forEach((e=>{e.style[t.isHorizontal()?l:"top"]=`${r}px`}))}}p.forEach(((e,r)=>{if("fraction"===s.type&&(e.querySelectorAll(ee(s.currentClass)).forEach((e=>{e.textContent=s.formatFractionCurrent(a+1)})),e.querySelectorAll(ee(s.totalClass)).forEach((e=>{e.textContent=s.formatFractionTotal(m)}))),"progressbar"===s.type){let i;i=s.progressbarOpposite?t.isHorizontal()?"vertical":"horizontal":t.isHorizontal()?"horizontal":"vertical";const r=(a+1)/m;let n=1,l=1;"horizontal"===i?n=r:l=r,e.querySelectorAll(ee(s.progressbarFillClass)).forEach((e=>{e.style.transform=`translate3d(0,0,0) scaleX(${n}) scaleY(${l})`,e.style.transitionDuration=`${t.params.speed}ms`}))}"custom"===s.type&&s.renderCustom?(e.innerHTML=s.renderCustom(t,a+1,m),0===r&&i("paginationRender",e)):(0===r&&i("paginationRender",e),i("paginationUpdate",e)),t.params.watchOverflow&&t.enabled&&e.classList[t.isLocked?"add":"remove"](s.lockClass)}))}function m(){const e=t.params.pagination;if(d())return;const s=t.virtual&&t.params.virtual.enabled?t.virtual.slides.length:t.slides.length;let a=t.pagination.el;a=o(a);let r="";if("bullets"===e.type){let a=t.params.loop?Math.ceil(s/t.params.slidesPerGroup):t.snapGrid.length;t.params.freeMode&&t.params.freeMode.enabled&&a>s&&(a=s);for(let s=0;s<a;s+=1)e.renderBullet?r+=e.renderBullet.call(t,s,e.bulletClass):r+=`<${e.bulletElement} ${t.isElement?'part="bullet"':""} class="${e.bulletClass}"></${e.bulletElement}>`}"fraction"===e.type&&(r=e.renderFraction?e.renderFraction.call(t,e.currentClass,e.totalClass):`<span class="${e.currentClass}"></span> / <span class="${e.totalClass}"></span>`),"progressbar"===e.type&&(r=e.renderProgressbar?e.renderProgressbar.call(t,e.progressbarFillClass):`<span class="${e.progressbarFillClass}"></span>`),t.pagination.bullets=[],a.forEach((s=>{"custom"!==e.type&&(s.innerHTML=r||""),"bullets"===e.type&&t.pagination.bullets.push(...s.querySelectorAll(ee(e.bulletClass)))})),"custom"!==e.type&&i("paginationRender",a[0])}function h(){t.params.pagination=J(t,t.originalParams.pagination,t.params.pagination,{el:"swiper-pagination"});const e=t.params.pagination;if(!e.el)return;let s;"string"==typeof e.el&&t.isElement&&(s=t.el.querySelector(e.el)),s||"string"!=typeof e.el||(s=[...document.querySelectorAll(e.el)]),s||(s=e.el),s&&0!==s.length&&(t.params.uniqueNavElements&&"string"==typeof e.el&&Array.isArray(s)&&s.length>1&&(s=[...t.el.querySelectorAll(e.el)],s.length>1&&(s=s.filter((e=>b(e,".swiper")[0]===t.el))[0])),Array.isArray(s)&&1===s.length&&(s=s[0]),Object.assign(t.pagination,{el:s}),s=o(s),s.forEach((s=>{"bullets"===e.type&&e.clickable&&s.classList.add(e.clickableClass),s.classList.add(e.modifierClass+e.type),s.classList.add(t.isHorizontal()?e.horizontalClass:e.verticalClass),"bullets"===e.type&&e.dynamicBullets&&(s.classList.add(`${e.modifierClass}${e.type}-dynamic`),l=0,e.dynamicMainBullets<1&&(e.dynamicMainBullets=1)),"progressbar"===e.type&&e.progressbarOpposite&&s.classList.add(e.progressbarOppositeClass),e.clickable&&s.addEventListener("click",p),t.enabled||s.classList.add(e.lockClass)})))}function f(){const e=t.params.pagination;if(d())return;let s=t.pagination.el;s&&(s=o(s),s.forEach((s=>{s.classList.remove(e.hiddenClass),s.classList.remove(e.modifierClass+e.type),s.classList.remove(t.isHorizontal()?e.horizontalClass:e.verticalClass),e.clickable&&s.removeEventListener("click",p)}))),t.pagination.bullets&&t.pagination.bullets.forEach((t=>t.classList.remove(...e.bulletActiveClass.split(" "))))}a("changeDirection",(()=>{if(!t.pagination||!t.pagination.el)return;const e=t.params.pagination;let{el:s}=t.pagination;s=o(s),s.forEach((s=>{s.classList.remove(e.horizontalClass,e.verticalClass),s.classList.add(t.isHorizontal()?e.horizontalClass:e.verticalClass)}))})),a("init",(()=>{!1===t.params.pagination.enabled?g():(h(),m(),u())})),a("activeIndexChange",(()=>{void 0===t.snapIndex&&u()})),a("snapIndexChange",(()=>{u()})),a("snapGridLengthChange",(()=>{m(),u()})),a("destroy",(()=>{f()})),a("enable disable",(()=>{let{el:e}=t.pagination;e&&(e=o(e),e.forEach((e=>e.classList[t.enabled?"remove":"add"](t.params.pagination.lockClass))))})),a("lock unlock",(()=>{u()})),a("click",((e,s)=>{const a=s.target,r=o(t.pagination.el);if(t.params.pagination.el&&t.params.pagination.hideOnClick&&r&&r.length>0&&!a.classList.contains(t.params.pagination.bulletClass)){if(t.navigation&&(t.navigation.nextEl&&a===t.navigation.nextEl||t.navigation.prevEl&&a===t.navigation.prevEl))return;const e=r[0].classList.contains(t.params.pagination.hiddenClass);i(!0===e?"paginationShow":"paginationHide"),r.forEach((e=>e.classList.toggle(t.params.pagination.hiddenClass)))}}));const g=()=>{t.el.classList.add(t.params.pagination.paginationDisabledClass);let{el:e}=t.pagination;e&&(e=o(e),e.forEach((e=>e.classList.add(t.params.pagination.paginationDisabledClass)))),f()};Object.assign(t.pagination,{enable:()=>{t.el.classList.remove(t.params.pagination.paginationDisabledClass);let{el:e}=t.pagination;e&&(e=o(e),e.forEach((e=>e.classList.remove(t.params.pagination.paginationDisabledClass)))),h(),m(),u()},disable:g,render:m,update:u,init:h,destroy:f})},function(e){let{swiper:t,extendParams:s,on:i,emit:r}=e;const l=a();let o,d,c,p,u=!1,m=null,h=null;function v(){if(!t.params.scrollbar.el||!t.scrollbar.el)return;const{scrollbar:e,rtlTranslate:s}=t,{dragEl:a,el:i}=e,r=t.params.scrollbar,n=t.params.loop?t.progressLoop:t.progress;let l=d,o=(c-d)*n;s?(o=-o,o>0?(l=d-o,o=0):-o+d>c&&(l=c+o)):o<0?(l=d+o,o=0):o+d>c&&(l=c-o),t.isHorizontal()?(a.style.transform=`translate3d(${o}px, 0, 0)`,a.style.width=`${l}px`):(a.style.transform=`translate3d(0px, ${o}px, 0)`,a.style.height=`${l}px`),r.hide&&(clearTimeout(m),i.style.opacity=1,m=setTimeout((()=>{i.style.opacity=0,i.style.transitionDuration="400ms"}),1e3))}function w(){if(!t.params.scrollbar.el||!t.scrollbar.el)return;const{scrollbar:e}=t,{dragEl:s,el:a}=e;s.style.width="",s.style.height="",c=t.isHorizontal()?a.offsetWidth:a.offsetHeight,p=t.size/(t.virtualSize+t.params.slidesOffsetBefore-(t.params.centeredSlides?t.snapGrid[0]:0)),d="auto"===t.params.scrollbar.dragSize?c*p:parseInt(t.params.scrollbar.dragSize,10),t.isHorizontal()?s.style.width=`${d}px`:s.style.height=`${d}px`,a.style.display=p>=1?"none":"",t.params.scrollbar.hide&&(a.style.opacity=0),t.params.watchOverflow&&t.enabled&&e.el.classList[t.isLocked?"add":"remove"](t.params.scrollbar.lockClass)}function b(e){return t.isHorizontal()?e.clientX:e.clientY}function y(e){const{scrollbar:s,rtlTranslate:a}=t,{el:i}=s;let r;r=(b(e)-g(i)[t.isHorizontal()?"left":"top"]-(null!==o?o:d/2))/(c-d),r=Math.max(Math.min(r,1),0),a&&(r=1-r);const n=t.minTranslate()+(t.maxTranslate()-t.minTranslate())*r;t.updateProgress(n),t.setTranslate(n),t.updateActiveIndex(),t.updateSlidesClasses()}function E(e){const s=t.params.scrollbar,{scrollbar:a,wrapperEl:i}=t,{el:n,dragEl:l}=a;u=!0,o=e.target===l?b(e)-e.target.getBoundingClientRect()[t.isHorizontal()?"left":"top"]:null,e.preventDefault(),e.stopPropagation(),i.style.transitionDuration="100ms",l.style.transitionDuration="100ms",y(e),clearTimeout(h),n.style.transitionDuration="0ms",s.hide&&(n.style.opacity=1),t.params.cssMode&&(t.wrapperEl.style["scroll-snap-type"]="none"),r("scrollbarDragStart",e)}function x(e){const{scrollbar:s,wrapperEl:a}=t,{el:i,dragEl:n}=s;u&&(e.preventDefault?e.preventDefault():e.returnValue=!1,y(e),a.style.transitionDuration="0ms",i.style.transitionDuration="0ms",n.style.transitionDuration="0ms",r("scrollbarDragMove",e))}function S(e){const s=t.params.scrollbar,{scrollbar:a,wrapperEl:i}=t,{el:l}=a;u&&(u=!1,t.params.cssMode&&(t.wrapperEl.style["scroll-snap-type"]="",i.style.transitionDuration=""),s.hide&&(clearTimeout(h),h=n((()=>{l.style.opacity=0,l.style.transitionDuration="400ms"}),1e3)),r("scrollbarDragEnd",e),s.snapOnRelease&&t.slideToClosest())}function T(e){const{scrollbar:s,params:a}=t,i=s.el;if(!i)return;const r=i,n=!!a.passiveListeners&&{passive:!1,capture:!1},o=!!a.passiveListeners&&{passive:!0,capture:!1};if(!r)return;const d="on"===e?"addEventListener":"removeEventListener";r[d]("pointerdown",E,n),l[d]("pointermove",x,n),l[d]("pointerup",S,o)}function M(){const{scrollbar:e,el:s}=t;t.params.scrollbar=J(t,t.originalParams.scrollbar,t.params.scrollbar,{el:"swiper-scrollbar"});const a=t.params.scrollbar;if(!a.el)return;let i,r;"string"==typeof a.el&&t.isElement&&(i=t.el.querySelector(a.el)),i||"string"!=typeof a.el?i||(i=a.el):i=l.querySelectorAll(a.el),t.params.uniqueNavElements&&"string"==typeof a.el&&i.length>1&&1===s.querySelectorAll(a.el).length&&(i=s.querySelector(a.el)),i.length>0&&(i=i[0]),i.classList.add(t.isHorizontal()?a.horizontalClass:a.verticalClass),i&&(r=i.querySelector(`.${t.params.scrollbar.dragClass}`),r||(r=f("div",t.params.scrollbar.dragClass),i.append(r))),Object.assign(e,{el:i,dragEl:r}),a.draggable&&t.params.scrollbar.el&&t.scrollbar.el&&T("on"),i&&i.classList[t.enabled?"remove":"add"](t.params.scrollbar.lockClass)}function C(){const e=t.params.scrollbar,s=t.scrollbar.el;s&&s.classList.remove(t.isHorizontal()?e.horizontalClass:e.verticalClass),t.params.scrollbar.el&&t.scrollbar.el&&T("off")}s({scrollbar:{el:null,dragSize:"auto",hide:!1,draggable:!1,snapOnRelease:!0,lockClass:"swiper-scrollbar-lock",dragClass:"swiper-scrollbar-drag",scrollbarDisabledClass:"swiper-scrollbar-disabled",horizontalClass:"swiper-scrollbar-horizontal",verticalClass:"swiper-scrollbar-vertical"}}),t.scrollbar={el:null,dragEl:null},i("init",(()=>{!1===t.params.scrollbar.enabled?P():(M(),w(),v())})),i("update resize observerUpdate lock unlock",(()=>{w()})),i("setTranslate",(()=>{v()})),i("setTransition",((e,s)=>{!function(e){t.params.scrollbar.el&&t.scrollbar.el&&(t.scrollbar.dragEl.style.transitionDuration=`${e}ms`)}(s)})),i("enable disable",(()=>{const{el:e}=t.scrollbar;e&&e.classList[t.enabled?"remove":"add"](t.params.scrollbar.lockClass)})),i("destroy",(()=>{C()}));const P=()=>{t.el.classList.add(t.params.scrollbar.scrollbarDisabledClass),t.scrollbar.el&&t.scrollbar.el.classList.add(t.params.scrollbar.scrollbarDisabledClass),C()};Object.assign(t.scrollbar,{enable:()=>{t.el.classList.remove(t.params.scrollbar.scrollbarDisabledClass),t.scrollbar.el&&t.scrollbar.el.classList.remove(t.params.scrollbar.scrollbarDisabledClass),M(),w(),v()},disable:P,updateSize:w,setTranslate:v,init:M,destroy:C})},function(e){let{swiper:t,extendParams:s,on:a}=e;s({parallax:{enabled:!1}});const i=(e,s)=>{const{rtl:a}=t,i=a?-1:1,r=e.getAttribute("data-swiper-parallax")||"0";let n=e.getAttribute("data-swiper-parallax-x"),l=e.getAttribute("data-swiper-parallax-y");const o=e.getAttribute("data-swiper-parallax-scale"),d=e.getAttribute("data-swiper-parallax-opacity"),c=e.getAttribute("data-swiper-parallax-rotate");if(n||l?(n=n||"0",l=l||"0"):t.isHorizontal()?(n=r,l="0"):(l=r,n="0"),n=n.indexOf("%")>=0?parseInt(n,10)*s*i+"%":n*s*i+"px",l=l.indexOf("%")>=0?parseInt(l,10)*s+"%":l*s+"px",null!=d){const t=d-(d-1)*(1-Math.abs(s));e.style.opacity=t}let p=`translate3d(${n}, ${l}, 0px)`;if(null!=o){p+=` scale(${o-(o-1)*(1-Math.abs(s))})`}if(c&&null!=c){p+=` rotate(${c*s*-1}deg)`}e.style.transform=p},r=()=>{const{el:e,slides:s,progress:a,snapGrid:r}=t;h(e,"[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]").forEach((e=>{i(e,a)})),s.forEach(((e,s)=>{let n=e.progress;t.params.slidesPerGroup>1&&"auto"!==t.params.slidesPerView&&(n+=Math.ceil(s/2)-a*(r.length-1)),n=Math.min(Math.max(n,-1),1),e.querySelectorAll("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale], [data-swiper-parallax-rotate]").forEach((e=>{i(e,n)}))}))};a("beforeInit",(()=>{t.params.parallax.enabled&&(t.params.watchSlidesProgress=!0,t.originalParams.watchSlidesProgress=!0)})),a("init",(()=>{t.params.parallax.enabled&&r()})),a("setTranslate",(()=>{t.params.parallax.enabled&&r()})),a("setTransition",((e,s)=>{t.params.parallax.enabled&&function(e){void 0===e&&(e=t.params.speed);const{el:s}=t;s.querySelectorAll("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]").forEach((t=>{let s=parseInt(t.getAttribute("data-swiper-parallax-duration"),10)||e;0===e&&(s=0),t.style.transitionDuration=`${s}ms`}))}(s)}))},function(e){let{swiper:t,extendParams:s,on:a,emit:i}=e;const n=r();s({zoom:{enabled:!1,maxRatio:3,minRatio:1,toggle:!0,containerClass:"swiper-zoom-container",zoomedSlideClass:"swiper-slide-zoomed"}}),t.zoom={enabled:!1};let l,d,c=1,p=!1;const u=[],m={originX:0,originY:0,slideEl:void 0,slideWidth:void 0,slideHeight:void 0,imageEl:void 0,imageWrapEl:void 0,maxRatio:3},f={isTouched:void 0,isMoved:void 0,currentX:void 0,currentY:void 0,minX:void 0,minY:void 0,maxX:void 0,maxY:void 0,width:void 0,height:void 0,startX:void 0,startY:void 0,touchesStart:{},touchesCurrent:{}},v={x:void 0,y:void 0,prevPositionX:void 0,prevPositionY:void 0,prevTime:void 0};let w=1;function y(){if(u.length<2)return 1;const e=u[0].pageX,t=u[0].pageY,s=u[1].pageX,a=u[1].pageY;return Math.sqrt((s-e)**2+(a-t)**2)}function E(e){const s=t.isElement?"swiper-slide":`.${t.params.slideClass}`;return!!e.target.matches(s)||t.slides.filter((t=>t.contains(e.target))).length>0}function x(e){if("mouse"===e.pointerType&&u.splice(0,u.length),!E(e))return;const s=t.params.zoom;if(l=!1,d=!1,u.push(e),!(u.length<2)){if(l=!0,m.scaleStart=y(),!m.slideEl){m.slideEl=e.target.closest(`.${t.params.slideClass}, swiper-slide`),m.slideEl||(m.slideEl=t.slides[t.activeIndex]);let a=m.slideEl.querySelector(`.${s.containerClass}`);if(a&&(a=a.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]),m.imageEl=a,m.imageWrapEl=a?b(m.imageEl,`.${s.containerClass}`)[0]:void 0,!m.imageWrapEl)return void(m.imageEl=void 0);m.maxRatio=m.imageWrapEl.getAttribute("data-swiper-zoom")||s.maxRatio}if(m.imageEl){const[e,t]=function(){if(u.length<2)return{x:null,y:null};const e=m.imageEl.getBoundingClientRect();return[(u[0].pageX+(u[1].pageX-u[0].pageX)/2-e.x)/c,(u[0].pageY+(u[1].pageY-u[0].pageY)/2-e.y)/c]}();m.originX=e,m.originY=t,m.imageEl.style.transitionDuration="0ms"}p=!0}}function S(e){if(!E(e))return;const s=t.params.zoom,a=t.zoom,i=u.findIndex((t=>t.pointerId===e.pointerId));i>=0&&(u[i]=e),u.length<2||(d=!0,m.scaleMove=y(),m.imageEl&&(a.scale=m.scaleMove/m.scaleStart*c,a.scale>m.maxRatio&&(a.scale=m.maxRatio-1+(a.scale-m.maxRatio+1)**.5),a.scale<s.minRatio&&(a.scale=s.minRatio+1-(s.minRatio-a.scale+1)**.5),m.imageEl.style.transform=`translate3d(0,0,0) scale(${a.scale})`))}function T(e){if(!E(e))return;if("mouse"===e.pointerType&&"pointerout"===e.type)return;const s=t.params.zoom,a=t.zoom,i=u.findIndex((t=>t.pointerId===e.pointerId));i>=0&&u.splice(i,1),l&&d&&(l=!1,d=!1,m.imageEl&&(a.scale=Math.max(Math.min(a.scale,m.maxRatio),s.minRatio),m.imageEl.style.transitionDuration=`${t.params.speed}ms`,m.imageEl.style.transform=`translate3d(0,0,0) scale(${a.scale})`,c=a.scale,p=!1,a.scale>1&&m.slideEl?m.slideEl.classList.add(`${s.zoomedSlideClass}`):a.scale<=1&&m.slideEl&&m.slideEl.classList.remove(`${s.zoomedSlideClass}`),1===a.scale&&(m.originX=0,m.originY=0,m.slideEl=void 0)))}function M(e){if(!E(e)||!function(e){const s=`.${t.params.zoom.containerClass}`;return!!e.target.matches(s)||[...t.el.querySelectorAll(s)].filter((t=>t.contains(e.target))).length>0}(e))return;const s=t.zoom;if(!m.imageEl)return;if(!f.isTouched||!m.slideEl)return;f.isMoved||(f.width=m.imageEl.offsetWidth,f.height=m.imageEl.offsetHeight,f.startX=o(m.imageWrapEl,"x")||0,f.startY=o(m.imageWrapEl,"y")||0,m.slideWidth=m.slideEl.offsetWidth,m.slideHeight=m.slideEl.offsetHeight,m.imageWrapEl.style.transitionDuration="0ms");const a=f.width*s.scale,i=f.height*s.scale;if(a<m.slideWidth&&i<m.slideHeight)return;f.minX=Math.min(m.slideWidth/2-a/2,0),f.maxX=-f.minX,f.minY=Math.min(m.slideHeight/2-i/2,0),f.maxY=-f.minY,f.touchesCurrent.x=u.length>0?u[0].pageX:e.pageX,f.touchesCurrent.y=u.length>0?u[0].pageY:e.pageY;if(Math.max(Math.abs(f.touchesCurrent.x-f.touchesStart.x),Math.abs(f.touchesCurrent.y-f.touchesStart.y))>5&&(t.allowClick=!1),!f.isMoved&&!p){if(t.isHorizontal()&&(Math.floor(f.minX)===Math.floor(f.startX)&&f.touchesCurrent.x<f.touchesStart.x||Math.floor(f.maxX)===Math.floor(f.startX)&&f.touchesCurrent.x>f.touchesStart.x))return void(f.isTouched=!1);if(!t.isHorizontal()&&(Math.floor(f.minY)===Math.floor(f.startY)&&f.touchesCurrent.y<f.touchesStart.y||Math.floor(f.maxY)===Math.floor(f.startY)&&f.touchesCurrent.y>f.touchesStart.y))return void(f.isTouched=!1)}e.cancelable&&e.preventDefault(),e.stopPropagation(),f.isMoved=!0;const r=(s.scale-c)/(m.maxRatio-t.params.zoom.minRatio),{originX:n,originY:l}=m;f.currentX=f.touchesCurrent.x-f.touchesStart.x+f.startX+r*(f.width-2*n),f.currentY=f.touchesCurrent.y-f.touchesStart.y+f.startY+r*(f.height-2*l),f.currentX<f.minX&&(f.currentX=f.minX+1-(f.minX-f.currentX+1)**.8),f.currentX>f.maxX&&(f.currentX=f.maxX-1+(f.currentX-f.maxX+1)**.8),f.currentY<f.minY&&(f.currentY=f.minY+1-(f.minY-f.currentY+1)**.8),f.currentY>f.maxY&&(f.currentY=f.maxY-1+(f.currentY-f.maxY+1)**.8),v.prevPositionX||(v.prevPositionX=f.touchesCurrent.x),v.prevPositionY||(v.prevPositionY=f.touchesCurrent.y),v.prevTime||(v.prevTime=Date.now()),v.x=(f.touchesCurrent.x-v.prevPositionX)/(Date.now()-v.prevTime)/2,v.y=(f.touchesCurrent.y-v.prevPositionY)/(Date.now()-v.prevTime)/2,Math.abs(f.touchesCurrent.x-v.prevPositionX)<2&&(v.x=0),Math.abs(f.touchesCurrent.y-v.prevPositionY)<2&&(v.y=0),v.prevPositionX=f.touchesCurrent.x,v.prevPositionY=f.touchesCurrent.y,v.prevTime=Date.now(),m.imageWrapEl.style.transform=`translate3d(${f.currentX}px, ${f.currentY}px,0)`}function C(){const e=t.zoom;m.slideEl&&t.activeIndex!==t.slides.indexOf(m.slideEl)&&(m.imageEl&&(m.imageEl.style.transform="translate3d(0,
29060,0) scale(1)"),m.imageWrapEl&&(m.imageWrapEl.style.transform="translate3d(0,0,0)"),m.slideEl.classList.remove(`${t.params.zoom.zoomedSlideClass}`),e.scale=1,c=1,m.slideEl=void 0,m.imageEl=void 0,m.imageWrapEl=void 0,m.originX=0,m.originY=0)}function P(e){const s=t.zoom,a=t.params.zoom;if(!m.slideEl){e&&e.target&&(m.slideEl=e.target.closest(`.${t.params.slideClass}, swiper-slide`)),m.slideEl||(t.params.virtual&&t.params.virtual.enabled&&t.virtual?m.slideEl=h(t.slidesEl,`.${t.params.slideActiveClass}`)[0]:m.slideEl=t.slides[t.activeIndex]);let s=m.slideEl.querySelector(`.${a.containerClass}`);s&&(s=s.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]),m.imageEl=s,m.imageWrapEl=s?b(m.imageEl,`.${a.containerClass}`)[0]:void 0}if(!m.imageEl||!m.imageWrapEl)return;let i,r,l,o,d,p,u,v,w,y,E,x,S,T,M,C,P,L;t.params.cssMode&&(t.wrapperEl.style.overflow="hidden",t.wrapperEl.style.touchAction="none"),m.slideEl.classList.add(`${a.zoomedSlideClass}`),void 0===f.touchesStart.x&&e?(i=e.pageX,r=e.pageY):(i=f.touchesStart.x,r=f.touchesStart.y);const z="number"==typeof e?e:null;1===c&&z&&(i=void 0,r=void 0),s.scale=z||m.imageWrapEl.getAttribute("data-swiper-zoom")||a.maxRatio,c=z||m.imageWrapEl.getAttribute("data-swiper-zoom")||a.maxRatio,!e||1===c&&z?(u=0,v=0):(P=m.slideEl.offsetWidth,L=m.slideEl.offsetHeight,l=g(m.slideEl).left+n.scrollX,o=g(m.slideEl).top+n.scrollY,d=l+P/2-i,p=o+L/2-r,w=m.imageEl.offsetWidth,y=m.imageEl.offsetHeight,E=w*s.scale,x=y*s.scale,S=Math.min(P/2-E/2,0),T=Math.min(L/2-x/2,0),M=-S,C=-T,u=d*s.scale,v=p*s.scale,u<S&&(u=S),u>M&&(u=M),v<T&&(v=T),v>C&&(v=C)),z&&1===s.scale&&(m.originX=0,m.originY=0),m.imageWrapEl.style.transitionDuration="300ms",m.imageWrapEl.style.transform=`translate3d(${u}px, ${v}px,0)`,m.imageEl.style.transitionDuration="300ms",m.imageEl.style.transform=`translate3d(0,0,0) scale(${s.scale})`}function L(){const e=t.zoom,s=t.params.zoom;if(!m.slideEl){t.params.virtual&&t.params.virtual.enabled&&t.virtual?m.slideEl=h(t.slidesEl,`.${t.params.slideActiveClass}`)[0]:m.slideEl=t.slides[t.activeIndex];let e=m.slideEl.querySelector(`.${s.containerClass}`);e&&(e=e.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]),m.imageEl=e,m.imageWrapEl=e?b(m.imageEl,`.${s.containerClass}`)[0]:void 0}m.imageEl&&m.imageWrapEl&&(t.params.cssMode&&(t.wrapperEl.style.overflow="",t.wrapperEl.style.touchAction=""),e.scale=1,c=1,m.imageWrapEl.style.transitionDuration="300ms",m.imageWrapEl.style.transform="translate3d(0,0,0)",m.imageEl.style.transitionDuration="300ms",m.imageEl.style.transform="translate3d(0,0,0) scale(1)",m.slideEl.classList.remove(`${s.zoomedSlideClass}`),m.slideEl=void 0,m.originX=0,m.originY=0)}function z(e){const s=t.zoom;s.scale&&1!==s.scale?L():P(e)}function A(){return{passiveListener:!!t.params.passiveListeners&&{passive:!0,capture:!1},activeListenerWithCapture:!t.params.passiveListeners||{passive:!1,capture:!0}}}function $(){const e=t.zoom;if(e.enabled)return;e.enabled=!0;const{passiveListener:s,activeListenerWithCapture:a}=A();t.wrapperEl.addEventListener("pointerdown",x,s),t.wrapperEl.addEventListener("pointermove",S,a),["pointerup","pointercancel","pointerout"].forEach((e=>{t.wrapperEl.addEventListener(e,T,s)}
vendor: 32,471 bytes, line 2906
2906)),t.wrapperEl.addEventListener("pointermove",M,a)}function I(){const e=t.zoom;if(!e.enabled)return;e.enabled=!1;const{passiveListener:s,activeListenerWithCapture:a}=A();t.wrapperEl.removeEventListener("pointerdown",x,s),t.wrapperEl.removeEventListener("pointermove",S,a),["pointerup","pointercancel","pointerout"].forEach((e=>{t.wrapperEl.removeEventListener(e,T,s)})),t.wrapperEl.removeEventListener("pointermove",M,a)}Object.defineProperty(t.zoom,"scale",{get:()=>w,set(e){if(w!==e){const t=m.imageEl,s=m.slideEl;i("zoomChange",e,t,s)}w=e}}),a("init",(()=>{t.params.zoom.enabled&&$()})),a("destroy",(()=>{I()})),a("touchStart",((e,s)=>{t.zoom.enabled&&function(e){const s=t.device;if(!m.imageEl)return;if(f.isTouched)return;s.android&&e.cancelable&&e.preventDefault(),f.isTouched=!0;const a=u.length>0?u[0]:e;f.touchesStart.x=a.pageX,f.touchesStart.y=a.pageY}(s)})),a("touchEnd",((e,s)=>{t.zoom.enabled&&function(){const e=t.zoom;if(!m.imageEl)return;if(!f.isTouched||!f.isMoved)return f.isTouched=!1,void(f.isMoved=!1);f.isTouched=!1,f.isMoved=!1;let s=300,a=300;const i=v.x*s,r=f.currentX+i,n=v.y*a,l=f.currentY+n;0!==v.x&&(s=Math.abs((r-f.currentX)/v.x)),0!==v.y&&(a=Math.abs((l-f.currentY)/v.y));const o=Math.max(s,a);f.currentX=r,f.currentY=l;const d=f.width*e.scale,c=f.height*e.scale;f.minX=Math.min(m.slideWidth/2-d/2,0),f.maxX=-f.minX,f.minY=Math.min(m.slideHeight/2-c/2,0),f.maxY=-f.minY,f.currentX=Math.max(Math.min(f.currentX,f.maxX),f.minX),f.currentY=Math.max(Math.min(f.currentY,f.maxY),f.minY),m.imageWrapEl.style.transitionDuration=`${o}ms`,m.imageWrapEl.style.transform=`translate3d(${f.currentX}px, ${f.currentY}px,0)`}()})),a("doubleTap",((e,s)=>{!t.animating&&t.params.zoom.enabled&&t.zoom.enabled&&t.params.zoom.toggle&&z(s)})),a("transitionEnd",(()=>{t.zoom.enabled&&t.params.zoom.enabled&&C()})),a("slideChange",(()=>{t.zoom.enabled&&t.params.zoom.enabled&&t.params.cssMode&&C()})),Object.assign(t.zoom,{enable:$,disable:I,in:P,out:L,toggle:z})},function(e){let{swiper:t,extendParams:s,on:a}=e;function i(e,t){const s=function(){let e,t,s;return(a,i)=>{for(t=-1,e=a.length;e-t>1;)s=e+t>>1,a[s]<=i?t=s:e=s;return e}}();let a,i;return this.x=e,this.y=t,this.lastIndex=e.length-1,this.interpolate=function(e){return e?(i=s(this.x,e),a=i-1,(e-this.x[a])*(this.y[i]-this.y[a])/(this.x[i]-this.x[a])+this.y[a]):0},this}function r(){t.controller.control&&t.controller.spline&&(t.controller.spline=void 0,delete t.controller.spline)}s({controller:{control:void 0,inverse:!1,by:"slide"}}),t.controller={control:void 0},a("beforeInit",(()=>{if("undefined"!=typeof window&&("string"==typeof t.params.controller.control||t.params.controller.control instanceof HTMLElement)){const e=document.querySelector(t.params.controller.control);if(e&&e.swiper)t.controller.control=e.swiper;else if(e){const s=a=>{t.controller.control=a.detail[0],t.update(),e.removeEventListener("init",s)};e.addEventListener("init",s)}}else t.controller.control=t.params.controller.control})),a("update",(()=>{r()})),a("resize",(()=>{r()})),a("observerUpdate",(()=>{r()})),a("setTranslate",((e,s,a)=>{t.controller.control&&!t.controller.control.destroyed&&t.controller.setTranslate(s,a)})),a("setTransition",((e,s,a)=>{t.controller.control&&!t.controller.control.destroyed&&t.controller.setTransition(s,a)})),Object.assign(t.controller,{setTranslate:function(e,s){const a=t.controller.control;let r,n;const l=t.constructor;function o(e){if(e.destroyed)return;const s=t.rtlTranslate?-t.translate:t.translate;"slide"===t.params.controller.by&&(!function(e){t.controller.spline=t.params.loop?new i(t.slidesGrid,e.slidesGrid):new i(t.snapGrid,e.snapGrid)}(e),n=-t.controller.spline.interpolate(-s)),n&&"container"!==t.params.controller.by||(r=(e.maxTranslate()-e.minTranslate())/(t.maxTranslate()-t.minTranslate()),!Number.isNaN(r)&&Number.isFinite(r)||(r=1),n=(s-t.minTranslate())*r+e.minTranslate()),t.params.controller.inverse&&(n=e.maxTranslate()-n),e.updateProgress(n),e.setTranslate(n,t),e.updateActiveIndex(),e.updateSlidesClasses()}if(Array.isArray(a))for(let e=0;e<a.length;e+=1)a[e]!==s&&a[e]instanceof l&&o(a[e]);else a instanceof l&&s!==a&&o(a)},setTransition:function(e,s){const a=t.constructor,i=t.controller.control;let r;function l(s){s.destroyed||(s.setTransition(e,t),0!==e&&(s.transitionStart(),s.params.autoHeight&&n((()=>{s.updateAutoHeight()})),y(s.wrapperEl,(()=>{i&&s.transitionEnd()}))))}if(Array.isArray(i))for(r=0;r<i.length;r+=1)i[r]!==s&&i[r]instanceof a&&l(i[r]);else i instanceof a&&s!==i&&l(i)}})},function(e){let{swiper:t,extendParams:s,on:a}=e;s({a11y:{enabled:!0,notificationClass:"swiper-notification",prevSlideMessage:"Previous slide",nextSlideMessage:"Next slide",firstSlideMessage:"This is the first slide",lastSlideMessage:"This is the last slide",paginationBulletMessage:"Go to slide {{index}}",slideLabelMessage:"{{index}} / {{slidesLength}}",containerMessage:null,containerRoleDescriptionMessage:null,itemRoleDescriptionMessage:null,slideRole:"group",id:null}}),t.a11y={clicked:!1};let i=null;function r(e){const t=i;0!==t.length&&(t.innerHTML="",t.innerHTML=e)}const n=e=>(Array.isArray(e)||(e=[e].filter((e=>!!e))),e);function l(e){(e=n(e)).forEach((e=>{e.setAttribute("tabIndex","0")}))}function o(e){(e=n(e)).forEach((e=>{e.setAttribute("tabIndex","-1")}))}function d(e,t){(e=n(e)).forEach((e=>{e.setAttribute("role",t)}))}function c(e,t){(e=n(e)).forEach((e=>{e.setAttribute("aria-roledescription",t)}))}function p(e,t){(e=n(e)).forEach((e=>{e.setAttribute("aria-label",t)}))}function u(e){(e=n(e)).forEach((e=>{e.setAttribute("aria-disabled",!0)}))}function m(e){(e=n(e)).forEach((e=>{e.setAttribute("aria-disabled",!1)}))}function h(e){if(13!==e.keyCode&&32!==e.keyCode)return;const s=t.params.a11y,a=e.target;t.pagination&&t.pagination.el&&(a===t.pagination.el||t.pagination.el.contains(e.target))&&!e.target.matches(ee(t.params.pagination.bulletClass))||(t.navigation&&t.navigation.nextEl&&a===t.navigation.nextEl&&(t.isEnd&&!t.params.loop||t.slideNext(),t.isEnd?r(s.lastSlideMessage):r(s.nextSlideMessage)),t.navigation&&t.navigation.prevEl&&a===t.navigation.prevEl&&(t.isBeginning&&!t.params.loop||t.slidePrev(),t.isBeginning?r(s.firstSlideMessage):r(s.prevSlideMessage)),t.pagination&&a.matches(ee(t.params.pagination.bulletClass))&&a.click())}function g(){return t.pagination&&t.pagination.bullets&&t.pagination.bullets.length}function v(){return g()&&t.params.pagination.clickable}const b=(e,t,s)=>{l(e),"BUTTON"!==e.tagName&&(d(e,"button"),e.addEventListener("keydown",h)),p(e,s),function(e,t){(e=n(e)).forEach((e=>{e.setAttribute("aria-controls",t)}))}(e,t)},y=()=>{t.a11y.clicked=!0},E=()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{t.destroyed||(t.a11y.clicked=!1)}))}))},x=e=>{if(t.a11y.clicked)return;const s=e.target.closest(`.${t.params.slideClass}, swiper-slide`);if(!s||!t.slides.includes(s))return;const a=t.slides.indexOf(s)===t.activeIndex,i=t.params.watchSlidesProgress&&t.visibleSlides&&t.visibleSlides.includes(s);a||i||e.sourceCapabilities&&e.sourceCapabilities.firesTouchEvents||(t.isHorizontal()?t.el.scrollLeft=0:t.el.scrollTop=0,t.slideTo(t.slides.indexOf(s),0))},S=()=>{const e=t.params.a11y;e.itemRoleDescriptionMessage&&c(t.slides,e.itemRoleDescriptionMessage),e.slideRole&&d(t.slides,e.slideRole);const s=t.slides.length;e.slideLabelMessage&&t.slides.forEach(((a,i)=>{const r=t.params.loop?parseInt(a.getAttribute("data-swiper-slide-index"),10):i;p(a,e.slideLabelMessage.replace(/\{\{index\}\}/,r+1).replace(/\{\{slidesLength\}\}/,s))}))},T=()=>{const e=t.params.a11y;t.el.append(i);const s=t.el;e.containerRoleDescriptionMessage&&c(s,e.containerRoleDescriptionMessage),e.containerMessage&&p(s,e.containerMessage);const a=t.wrapperEl,r=e.id||a.getAttribute("id")||`swiper-wrapper-${l=16,void 0===l&&(l=16),"x".repeat(l).replace(/x/g,(()=>Math.round(16*Math.random()).toString(16)))}`;var l;const o=t.params.autoplay&&t.params.autoplay.enabled?"off":"polite";var d;d=r,n(a).forEach((e=>{e.setAttribute("id",d)})),function(e,t){(e=n(e)).forEach((e=>{e.setAttribute("aria-live",t)}))}(a,o),S();let{nextEl:u,prevEl:m}=t.navigation?t.navigation:{};if(u=n(u),m=n(m),u&&u.forEach((t=>b(t,r,e.nextSlideMessage))),m&&m.forEach((t=>b(t,r,e.prevSlideMessage))),v()){(Array.isArray(t.pagination.el)?t.pagination.el:[t.pagination.el]).forEach((e=>{e.addEventListener("keydown",h)}))}t.el.addEventListener("focus",x,!0),t.el.addEventListener("pointerdown",y,!0),t.el.addEventListener("pointerup",E,!0)};a("beforeInit",(()=>{i=f("span",t.params.a11y.notificationClass),i.setAttribute("aria-live","assertive"),i.setAttribute("aria-atomic","true")})),a("afterInit",(()=>{t.params.a11y.enabled&&T()})),a("slidesLengthChange snapGridLengthChange slidesGridLengthChange",(()=>{t.params.a11y.enabled&&S()})),a("fromEdge toEdge afterInit lock unlock",(()=>{t.params.a11y.enabled&&function(){if(t.params.loop||t.params.rewind||!t.navigation)return;const{nextEl:e,prevEl:s}=t.navigation;s&&(t.isBeginning?(u(s),o(s)):(m(s),l(s))),e&&(t.isEnd?(u(e),o(e)):(m(e),l(e)))}()})),a("paginationUpdate",(()=>{t.params.a11y.enabled&&function(){const e=t.params.a11y;g()&&t.pagination.bullets.forEach((s=>{t.params.pagination.clickable&&(l(s),t.params.pagination.renderBullet||(d(s,"button"),p(s,e.paginationBulletMessage.replace(/\{\{index\}\}/,w(s)+1)))),s.matches(ee(t.params.pagination.bulletActiveClass))?s.setAttribute("aria-current","true"):s.removeAttribute("aria-current")}))}()})),a("destroy",(()=>{t.params.a11y.enabled&&function(){i&&i.remove();let{nextEl:e,prevEl:s}=t.navigation?t.navigation:{};e=n(e),s=n(s),e&&e.forEach((e=>e.removeEventListener("keydown",h))),s&&s.forEach((e=>e.removeEventListener("keydown",h))),v()&&(Array.isArray(t.pagination.el)?t.pagination.el:[t.pagination.el]).forEach((e=>{e.removeEventListener("keydown",h)}));t.el.removeEventListener("focus",x,!0),t.el.removeEventListener("pointerdown",y,!0),t.el.removeEventListener("pointerup",E,!0)}()}))},function(e){let{swiper:t,extendParams:s,on:a}=e;s({history:{enabled:!1,root:"",replaceState:!1,key:"slides",keepQuery:!1}});let i=!1,n={};const l=e=>e.toString().replace(/\s+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-").replace(/^-+/,"").replace(/-+$/,""),o=e=>{const t=r();let s;s=e?new URL(e):t.location;const a=s.pathname.slice(1).split("/").filter((e=>""!==e)),i=a.length;return{key:a[i-2],value:a[i-1]}},d=(e,s)=>{const a=r();if(!i||!t.params.history.enabled)return;let n;n=t.params.url?new URL(t.params.url):a.location;const o=t.slides[s];let d=l(o.getAttribute("data-history"));if(t.params.history.root.length>0){let s=t.params.history.root;"/"===s[s.length-1]&&(s=s.slice(0,s.length-1)),d=`${s}/${e?`${e}/`:""}${d}`}else n.pathname.includes(e)||(d=`${e?`${e}/`:""}${d}`);t.params.history.keepQuery&&(d+=n.search);const c=a.history.state;c&&c.value===d||(t.params.history.replaceState?a.history.replaceState({value:d},null,d):a.history.pushState({value:d},null,d))},c=(e,s,a)=>{if(s)for(let i=0,r=t.slides.length;i<r;i+=1){const r=t.slides[i];if(l(r.getAttribute("data-history"))===s){const s=t.getSlideIndex(r);t.slideTo(s,e,a)}}else t.slideTo(0,e,a)},p=()=>{n=o(t.params.url),c(t.params.speed,n.value,!1)};a("init",(()=>{t.params.history.enabled&&(()=>{const e=r();if(t.params.history){if(!e.history||!e.history.pushState)return t.params.history.enabled=!1,void(t.params.hashNavigation.enabled=!0);i=!0,n=o(t.params.url),n.key||n.value?(c(0,n.value,t.params.runCallbacksOnInit),t.params.history.replaceState||e.addEventListener("popstate",p)):t.params.history.replaceState||e.addEventListener("popstate",p)}})()})),a("destroy",(()=>{t.params.history.enabled&&(()=>{const e=r();t.params.history.replaceState||e.removeEventListener("popstate",p)})()})),a("transitionEnd _freeModeNoMomentumRelease",(()=>{i&&d(t.params.history.key,t.activeIndex)})),a("slideChange",(()=>{i&&t.params.cssMode&&d(t.params.history.key,t.activeIndex)}))},function(e){let{swiper:t,extendParams:s,emit:i,on:n}=e,l=!1;const o=a(),d=r();s({hashNavigation:{enabled:!1,replaceState:!1,watchState:!1,getSlideIndex(e,s){if(t.virtual&&t.params.virtual.enabled){const e=t.slides.filter((e=>e.getAttribute("data-hash")===s))[0];if(!e)return 0;return parseInt(e.getAttribute("data-swiper-slide-index"),10)}return t.getSlideIndex(h(t.slidesEl,`.${t.params.slideClass}[data-hash="${s}"], swiper-slide[data-hash="${s}"]`)[0])}}});const c=()=>{i("hashChange");const e=o.location.hash.replace("#",""),s=t.virtual&&t.params.virtual.enabled?t.slidesEl.querySelector(`[data-swiper-slide-index="${t.activeIndex}"]`):t.slides[t.activeIndex];if(e!==(s?s.getAttribute("data-hash"):"")){const s=t.params.hashNavigation.getSlideIndex(t,e);if(void 0===s||Number.isNaN(s))return;t.slideTo(s)}},p=()=>{if(!l||!t.params.hashNavigation.enabled)return;const e=t.virtual&&t.params.virtual.enabled?t.slidesEl.querySelector(`[data-swiper-slide-index="${t.activeIndex}"]`):t.slides[t.activeIndex],s=e?e.getAttribute("data-hash")||e.getAttribute("data-history"):"";t.params.hashNavigation.replaceState&&d.history&&d.history.replaceState?(d.history.replaceState(null,null,`#${s}`||""),i("hashSet")):(o.location.hash=s||"",i("hashSet"))};n("init",(()=>{t.params.hashNavigation.enabled&&(()=>{if(!t.params.hashNavigation.enabled||t.params.history&&t.params.history.enabled)return;l=!0;const e=o.location.hash.replace("#","");if(e){const s=0,a=t.params.hashNavigation.getSlideIndex(t,e);t.slideTo(a||0,s,t.params.runCallbacksOnInit,!0)}t.params.hashNavigation.watchState&&d.addEventListener("hashchange",c)})()})),n("destroy",(()=>{t.params.hashNavigation.enabled&&t.params.hashNavigation.watchState&&d.removeEventListener("hashchange",c)})),n("transitionEnd _freeModeNoMomentumRelease",(()=>{l&&p()})),n("slideChange",(()=>{l&&t.params.cssMode&&p()}))},function(e){let t,s,{swiper:i,extendParams:r,on:n,emit:l,params:o}=e;i.autoplay={running:!1,paused:!1,timeLeft:0},r({autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!0,stopOnLastSlide:!1,reverseDirection:!1,pauseOnMouseEnter:!1}});let d,c,p,u,m,h,f,g=o&&o.autoplay?o.autoplay.delay:3e3,v=o&&o.autoplay?o.autoplay.delay:3e3,w=(new Date).getTime;function b(e){i&&!i.destroyed&&i.wrapperEl&&e.target===i.wrapperEl&&(i.wrapperEl.removeEventListener("transitionend",b),M())}const y=()=>{if(i.destroyed||!i.autoplay.running)return;i.autoplay.paused?c=!0:c&&(v=d,c=!1);const e=i.autoplay.paused?d:w+v-(new Date).getTime();i.autoplay.timeLeft=e,l("autoplayTimeLeft",e,e/g),s=requestAnimationFrame((()=>{y()}))},E=e=>{if(i.destroyed||!i.autoplay.running)return;cancelAnimationFrame(s),y();let a=void 0===e?i.params.autoplay.delay:e;g=i.params.autoplay.delay,v=i.params.autoplay.delay;const r=(()=>{let e;if(e=i.virtual&&i.params.virtual.enabled?i.slides.filter((e=>e.classList.contains("swiper-slide-active")))[0]:i.slides[i.activeIndex],!e)return;return parseInt(e.getAttribute("data-swiper-autoplay"),10)})();!Number.isNaN(r)&&r>0&&void 0===e&&(a=r,g=r,v=r),d=a;const n=i.params.speed,o=()=>{i&&!i.destroyed&&(i.params.autoplay.reverseDirection?!i.isBeginning||i.params.loop||i.params.rewind?(i.slidePrev(n,!0,!0),l("autoplay")):i.params.autoplay.stopOnLastSlide||(i.slideTo(i.slides.length-1,n,!0,!0),l("autoplay")):!i.isEnd||i.params.loop||i.params.rewind?(i.slideNext(n,!0,!0),l("autoplay")):i.params.autoplay.stopOnLastSlide||(i.slideTo(0,n,!0,!0),l("autoplay")),i.params.cssMode&&(w=(new Date).getTime(),requestAnimationFrame((()=>{E()}))))};return a>0?(clearTimeout(t),t=setTimeout((()=>{o()}),a)):requestAnimationFrame((()=>{o()})),a},x=()=>{i.autoplay.running=!0,E(),l("autoplayStart")},S=()=>{i.autoplay.running=!1,clearTimeout(t),cancelAnimationFrame(s),l("autoplayStop")},T=(e,s)=>{if(i.destroyed||!i.autoplay.running)return;clearTimeout(t),e||(f=!0);const a=()=>{l("autoplayPause"),i.params.autoplay.waitForTransition?i.wrapperEl.addEventListener("transitionend",b):M()};if(i.autoplay.paused=!0,s)return h&&(d=i.params.autoplay.delay),h=!1,void a();const r=d||i.params.autoplay.delay;d=r-((new Date).getTime()-w),i.isEnd&&d<0&&!i.params.loop||(d<0&&(d=0),a())},M=()=>{i.isEnd&&d<0&&!i.params.loop||i.destroyed||!i.autoplay.running||(w=(new Date).getTime(),f?(f=!1,E(d)):E(),i.autoplay.paused=!1,l("autoplayResume"))},C=()=>{if(i.destroyed||!i.autoplay.running)return;const e=a();"hidden"===e.visibilityState&&(f=!0,T(!0)),"visible"===e.visibilityState&&M()},P=e=>{"mouse"===e.pointerType&&(f=!0,T(!0))},L=e=>{"mouse"===e.pointerType&&i.autoplay.paused&&M()};n("init",(()=>{i.params.autoplay.enabled&&(i.params.autoplay.pauseOnMouseEnter&&(i.el.addEventListener("pointerenter",P),i.el.addEventListener("pointerleave",L)),a().addEventListener("visibilitychange",C),w=(new Date).getTime(),x())})),n("destroy",(()=>{i.el.removeEventListener("pointerenter",P),i.el.removeEventListener("pointerleave",L),a().removeEventListener("visibilitychange",C),i.autoplay.running&&S()})),n("beforeTransitionStart",((e,t,s)=>{!i.destroyed&&i.autoplay.running&&(s||!i.params.autoplay.disableOnInteraction?T(!0,!0):S())})),n("sliderFirstMove",(()=>{!i.destroyed&&i.autoplay.running&&(i.params.autoplay.disableOnInteraction?S():(p=!0,u=!1,f=!1,m=setTimeout((()=>{f=!0,u=!0,T(!0)}),200)))})),n("touchEnd",(()=>{if(!i.destroyed&&i.autoplay.running&&p){if(clearTimeout(m),clearTimeout(t),i.params.autoplay.disableOnInteraction)return u=!1,void(p=!1);u&&i.params.cssMode&&M(),u=!1,p=!1}})),n("slideChange",(()=>{!i.destroyed&&i.autoplay.running&&(h=!0)})),Object.assign(i.autoplay,{start:x,stop:S,pause:T,resume:M})},function(e){let{swiper:t,extendParams:s,on:i}=e;s({thumbs:{swiper:null,multipleActiveThumbs:!0,autoScrollOffset:0,slideThumbActiveClass:"swiper-slide-thumb-active",thumbsContainerClass:"swiper-thumbs"}});let r=!1,n=!1;function l(){const e=t.thumbs.swiper;if(!e||e.destroyed)return;const s=e.clickedIndex,a=e.clickedSlide;if(a&&a.classList.contains(t.params.thumbs.slideThumbActiveClass))return;if(null==s)return;let i;i=e.params.loop?parseInt(e.clickedSlide.getAttribute("data-swiper-slide-index"),10):s,t.params.loop?t.slideToLoop(i):t.slideTo(i)}function o(){const{thumbs:e}=t.params;if(r)return!1;r=!0;const s=t.constructor;if(e.swiper instanceof s)t.thumbs.swiper=e.swiper,Object.assign(t.thumbs.swiper.originalParams,{watchSlidesProgress:!0,slideToClickedSlide:!1}),Object.assign(t.thumbs.swiper.params,{watchSlidesProgress:!0,slideToClickedSlide:!1}),t.thumbs.swiper.update();else if(d(e.swiper)){const a=Object.assign({},e.swiper);Object.assign(a,{watchSlidesProgress:!0,slideToClickedSlide:!1}),t.thumbs.swiper=new s(a),n=!0}return t.thumbs.swiper.el.classList.add(t.params.thumbs.thumbsContainerClass),t.thumbs.swiper.on("tap",l),!0}function c(e){const s=t.thumbs.swiper;if(!s||s.destroyed)return;const a="auto"===s.params.slidesPerView?s.slidesPerViewDynamic():s.params.slidesPerView;let i=1;const r=t.params.thumbs.slideThumbActiveClass;if(t.params.slidesPerView>1&&!t.params.centeredSlides&&(i=t.params.slidesPerView),t.params.thumbs.multipleActiveThumbs||(i=1),i=Math.floor(i),s.slides.forEach((e=>e.classList.remove(r))),s.params.loop||s.params.virtual&&s.params.virtual.enabled)for(let e=0;e<i;e+=1)h(s.slidesEl,`[data-swiper-slide-index="${t.realIndex+e}"]`).forEach((e=>{e.classList.add(r)}));else for(let e=0;e<i;e+=1)s.slides[t.realIndex+e]&&s.slides[t.realIndex+e].classList.add(r);const n=t.params.thumbs.autoScrollOffset,l=n&&!s.params.loop;if(t.realIndex!==s.realIndex||l){const i=s.activeIndex;let r,o;if(s.params.loop){const e=s.slides.filter((e=>e.getAttribute("data-swiper-slide-index")===`${t.realIndex}`))[0];r=s.slides.indexOf(e),o=t.activeIndex>t.previousIndex?"next":"prev"}else r=t.realIndex,o=r>t.previousIndex?"next":"prev";l&&(r+="next"===o?n:-1*n),s.visibleSlidesIndexes&&s.visibleSlidesIndexes.indexOf(r)<0&&(s.params.centeredSlides?r=r>i?r-Math.floor(a/2)+1:r+Math.floor(a/2)-1:r>i&&s.params.slidesPerGroup,s.slideTo(r,e?0:void 0))}}t.thumbs={swiper:null},i("beforeInit",(()=>{const{thumbs:e}=t.params;if(e&&e.swiper)if("string"==typeof e.swiper||e.swiper instanceof HTMLElement){const s=a(),i=()=>{const a="string"==typeof e.swiper?s.querySelector(e.swiper):e.swiper;if(a&&a.swiper)e.swiper=a.swiper,o(),c(!0);else if(a){const s=i=>{e.swiper=i.detail[0],a.removeEventListener("init",s),o(),c(!0),e.swiper.update(),t.update()};a.addEventListener("init",s)}return a},r=()=>{if(t.destroyed)return;i()||requestAnimationFrame(r)};requestAnimationFrame(r)}else o(),c(!0)})),i("slideChange update resize observerUpdate",(()=>{c()})),i("setTransition",((e,s)=>{const a=t.thumbs.swiper;a&&!a.destroyed&&a.setTransition(s)})),i("beforeDestroy",(()=>{const e=t.thumbs.swiper;e&&!e.destroyed&&n&&e.destroy()})),Object.assign(t.thumbs,{init:o,update:c})},function(e){let{swiper:t,extendParams:s,emit:a,once:i}=e;s({freeMode:{enabled:!1,momentum:!0,momentumRatio:1,momentumBounce:!0,momentumBounceRatio:1,momentumVelocityRatio:1,sticky:!1,minimumVelocity:.02}}),Object.assign(t,{freeMode:{onTouchStart:function(){if(t.params.cssMode)return;const e=t.getTranslate();t.setTranslate(e),t.setTransition(0),t.touchEventsData.velocities.length=0,t.freeMode.onTouchEnd({currentPos:t.rtl?t.translate:-t.translate})},onTouchMove:function(){if(t.params.cssMode)return;const{touchEventsData:e,touches:s}=t;0===e.velocities.length&&e.velocities.push({position:s[t.isHorizontal()?"startX":"startY"],time:e.touchStartTime}),e.velocities.push({position:s[t.isHorizontal()?"currentX":"currentY"],time:l()})},onTouchEnd:function(e){let{currentPos:s}=e;if(t.params.cssMode)return;const{params:r,wrapperEl:n,rtlTranslate:o,snapGrid:d,touchEventsData:c}=t,p=l()-c.touchStartTime;if(s<-t.minTranslate())t.slideTo(t.activeIndex);else if(s>-t.maxTranslate())t.slides.length<d.length?t.slideTo(d.length-1):t.slideTo(t.slides.length-1);else{if(r.freeMode.momentum){if(c.velocities.length>1){const e=c.velocities.pop(),s=c.velocities.pop(),a=e.position-s.position,i=e.time-s.time;t.velocity=a/i,t.velocity/=2,Math.abs(t.velocity)<r.freeMode.minimumVelocity&&(t.velocity=0),(i>150||l()-e.time>300)&&(t.velocity=0)}else t.velocity=0;t.velocity*=r.freeMode.momentumVelocityRatio,c.velocities.length=0;let e=1e3*r.freeMode.momentumRatio;const s=t.velocity*e;let p=t.translate+s;o&&(p=-p);let u,m=!1;const h=20*Math.abs(t.velocity)*r.freeMode.momentumBounceRatio;let f;if(p<t.maxTranslate())r.freeMode.momentumBounce?(p+t.maxTranslate()<-h&&(p=t.maxTranslate()-h),u=t.maxTranslate(),m=!0,c.allowMomentumBounce=!0):p=t.maxTranslate(),r.loop&&r.centeredSlides&&(f=!0);else if(p>t.minTranslate())r.freeMode.momentumBounce?(p-t.minTranslate()>h&&(p=t.minTranslate()+h),u=t.minTranslate(),m=!0,c.allowMomentumBounce=!0):p=t.minTranslate(),r.loop&&r.centeredSlides&&(f=!0);else if(r.freeMode.sticky){let e;for(let t=0;t<d.length;t+=1)if(d[t]>-p){e=t;break}p=Math.abs(d[e]-p)<Math.abs(d[e-1]-p)||"next"===t.swipeDirection?d[e]:d[e-1],p=-p}if(f&&i("transitionEnd",(()=>{t.loopFix()})),0!==t.velocity){if(e=o?Math.abs((-p-t.translate)/t.velocity):Math.abs((p-t.translate)/t.velocity),r.freeMode.sticky){const s=Math.abs((o?-p:p)-t.translate),a=t.slidesSizesGrid[t.activeIndex];e=s<a?r.speed:s<2*a?1.5*r.speed:2.5*r.speed}}else if(r.freeMode.sticky)return void t.slideToClosest();r.freeMode.momentumBounce&&m?(t.updateProgress(u),t.setTransition(e),t.setTranslate(p),t.transitionStart(!0,t.swipeDirection),t.animating=!0,y(n,(()=>{t&&!t.destroyed&&c.allowMomentumBounce&&(a("momentumBounce"),t.setTransition(r.speed),setTimeout((()=>{t.setTranslate(u),y(n,(()=>{t&&!t.destroyed&&t.transitionEnd()}))}),0))}))):t.velocity?(a("_freeModeNoMomentumRelease"),t.updateProgress(p),t.setTransition(e),t.setTranslate(p),t.transitionStart(!0,t.swipeDirection),t.animating||(t.animating=!0,y(n,(()=>{t&&!t.destroyed&&t.transitionEnd()})))):t.updateProgress(p),t.updateActiveIndex(),t.updateSlidesClasses()}else{if(r.freeMode.sticky)return void t.slideToClosest();r.freeMode&&a("_freeModeNoMomentumRelease")}(!r.freeMode.momentum||p>=r.longSwipesMs)&&(t.updateProgress(),t.updateActiveIndex(),t.updateSlidesClasses())}}}})},function(e){let t,s,a,{swiper:i,extendParams:r}=e;r({grid:{rows:1,fill:"column"}});const n=()=>{let e=i.params.spaceBetween;return"string"==typeof e&&e.indexOf("%")>=0?e=parseFloat(e.replace("%",""))/100*i.size:"string"==typeof e&&(e=parseFloat(e)),e};i.grid={initSlides:e=>{const{slidesPerView:r}=i.params,{rows:n,fill:l}=i.params.grid;a=Math.floor(e/n),t=Math.floor(e/n)===e/n?e:Math.ceil(e/n)*n,"auto"!==r&&"row"===l&&(t=Math.max(t,r*n)),s=t/n},updateSlide:(e,r,l,o)=>{const{slidesPerGroup:d}=i.params,c=n(),{rows:p,fill:u}=i.params.grid;let m,h,f;if("row"===u&&d>1){const s=Math.floor(e/(d*p)),a=e-p*d*s,i=0===s?d:Math.min(Math.ceil((l-s*p*d)/p),d);f=Math.floor(a/i),h=a-f*i+s*d,m=h+f*t/p,r.style.order=m}else"column"===u?(h=Math.floor(e/p),f=e-h*p,(h>a||h===a&&f===p-1)&&(f+=1,f>=p&&(f=0,h+=1))):(f=Math.floor(e/s),h=e-f*s);r.row=f,r.column=h,r.style[o("margin-top")]=0!==f?c&&`${c}px`:""},updateWrapperSize:(e,s,a)=>{const{centeredSlides:r,roundLengths:l}=i.params,o=n(),{rows:d}=i.params.grid;if(i.virtualSize=(e+o)*t,i.virtualSize=Math.ceil(i.virtualSize/d)-o,i.wrapperEl.style[a("width")]=`${i.virtualSize+o}px`,r){const e=[];for(let t=0;t<s.length;t+=1){let a=s[t];l&&(a=Math.floor(a)),s[t]<i.virtualSize+s[0]&&e.push(a)}s.splice(0,s.length),s.push(...e)}}}},function(e){let{swiper:t}=e;Object.assign(t,{appendSlide:te.bind(t),prependSlide:se.bind(t),addSlide:ae.bind(t),removeSlide:ie.bind(t),removeAllSlides:re.bind(t)})},function(e){let{swiper:t,extendParams:s,on:a}=e;s({fadeEffect:{crossFade:!1}}),ne({effect:"fade",swiper:t,on:a,setTranslate:()=>{const{slides:e}=t;t.params.fadeEffect;for(let s=0;s<e.length;s+=1){const e=t.slides[s];let a=-e.swiperSlideOffset;t.params.virtualTranslate||(a-=t.translate);let i=0;t.isHorizontal()||(i=a,a=0);const r=t.params.fadeEffect.crossFade?Math.max(1-Math.abs(e.progress),0):1+Math.min(Math.max(e.progress,-1),0),n=le(0,e);n.style.opacity=r,n.style.transform=`translate3d(${a}px, ${i}px, 0px)`}},setTransition:e=>{const s=t.slides.map((e=>m(e)));s.forEach((t=>{t.style.transitionDuration=`${e}ms`})),oe({swiper:t,duration:e,transformElements:s,allSlides:!0})},overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!t.params.cssMode})})},function(e){let{swiper:t,extendParams:s,on:a}=e;s({cubeEffect:{slideShadows:!0,shadow:!0,shadowOffset:20,shadowScale:.94}});const i=(e,t,s)=>{let a=s?e.querySelector(".swiper-slide-shadow-left"):e.querySelector(".swiper-slide-shadow-top"),i=s?e.querySelector(".swiper-slide-shadow-right"):e.querySelector(".swiper-slide-shadow-bottom");a||(a=f("div",("swiper-slide-shadow-cube swiper-slide-shadow-"+(s?"left":"top")).split(" ")),e.append(a)),i||(i=f("div",("swiper-slide-shadow-cube swiper-slide-shadow-"+(s?"right":"bottom")).split(" ")),e.append(i)),a&&(a.style.opacity=Math.max(-t,0)),i&&(i.style.opacity=Math.max(t,0))};ne({effect:"cube",swiper:t,on:a,setTranslate:()=>{const{el:e,wrapperEl:s,slides:a,width:r,height:n,rtlTranslate:l,size:o,browser:d}=t,c=t.params.cubeEffect,p=t.isHorizontal(),u=t.virtual&&t.params.virtual.enabled;let m,h=0;c.shadow&&(p?(m=t.wrapperEl.querySelector(".swiper-cube-shadow"),m||(m=f("div","swiper-cube-shadow"),t.wrapperEl.append(m)),m.style.height=`${r}px`):(m=e.querySelector(".swiper-cube-shadow"),m||(m=f("div","swiper-cube-shadow"),e.append(m))));for(let e=0;e<a.length;e+=1){const t=a[e];let s=e;u&&(s=parseInt(t.getAttribute("data-swiper-slide-index"),10));let r=90*s,n=Math.floor(r/360);l&&(r=-r,n=Math.floor(-r/360));const d=Math.max(Math.min(t.progress,1),-1);let m=0,f=0,g=0;s%4==0?(m=4*-n*o,g=0):(s-1)%4==0?(m=0,g=4*-n*o):(s-2)%4==0?(m=o+4*n*o,g=o):(s-3)%4==0&&(m=-o,g=3*o+4*o*n),l&&(m=-m),p||(f=m,m=0);const v=`rotateX(${p?0:-r}deg) rotateY(${p?r:0}deg) translate3d(${m}px, ${f}px, ${g}px)`;d<=1&&d>-1&&(h=90*s+90*d,l&&(h=90*-s-90*d)),t.style.transform=v,c.slideShadows&&i(t,d,p)}if(s.style.transformOrigin=`50% 50% -${o/2}px`,s.style["-webkit-transform-origin"]=`50% 50% -${o/2}px`,c.shadow)if(p)m.style.transform=`translate3d(0px, ${r/2+c.shadowOffset}px, ${-r/2}px) rotateX(90deg) rotateZ(0deg) scale(${c.shadowScale})`;else{const e=Math.abs(h)-90*Math.floor(Math.abs(h)/90),t=1.5-(Math.sin(2*e*Math.PI/360)/2+Math.cos(2*e*Math.PI/360)/2),s=c.shadowScale,a=c.shadowScale/t,i=c.shadowOffset;m.style.transform=`scale3d(${s}, 1, ${a}) translate3d(0px, ${n/2+i}px, ${-n/2/a}px) rotateX(-90deg)`}const g=(d.isSafari||d.isWebView)&&d.needPerspectiveFix?-o/2:0;s.style.transform=`translate3d(0px,0,${g}px) rotateX(${t.isHorizontal()?0:h}deg) rotateY(${t.isHorizontal()?-h:0}deg)`,s.style.setProperty("--swiper-cube-translate-z",`${g}px`)},setTransition:e=>{const{el:s,slides:a}=t;if(a.forEach((t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach((t=>{t.style.transitionDuration=`${e}ms`}))})),t.params.cubeEffect.shadow&&!t.isHorizontal()){const t=s.querySelector(".swiper-cube-shadow");t&&(t.style.transitionDuration=`${e}ms`)}},recreateShadows:()=>{const e=t.isHorizontal();t.slides.forEach((t=>{const s=Math.max(Math.min(t.progress,1),-1);i(t,s,e)}))},getEffectParams:()=>t.params.cubeEffect,perspective:()=>!0,overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,resistanceRatio:0,spaceBetween:0,centeredSlides:!1,virtualTranslate:!0})})},function(e){let{swiper:t,extendParams:s,on:a}=e;s({flipEffect:{slideShadows:!0,limitRotation:!0}});const i=(e,s)=>{let a=t.isHorizontal()?e.querySelector(".swiper-slide-shadow-left"):e.querySelector(".swiper-slide-shadow-top"),i=t.isHorizontal()?e.querySelector(".swiper-slide-shadow-right"):e.querySelector(".swiper-slide-shadow-bottom");a||(a=de("flip",e,t.isHorizontal()?"left":"top")),i||(i=de("flip",e,t.isHorizontal()?"right":"bottom")),a&&(a.style.opacity=Math.max(-s,0)),i&&(i.style.opacity=Math.max(s,0))};ne({effect:"flip",swiper:t,on:a,setTranslate:()=>{const{slides:e,rtlTranslate:s}=t,a=t.params.flipEffect;for(let r=0;r<e.length;r+=1){const n=e[r];let l=n.progress;t.params.flipEffect.limitRotation&&(l=Math.max(Math.min(n.progress,1),-1));const o=n.swiperSlideOffset;let d=-180*l,c=0,p=t.params.cssMode?-o-t.translate:-o,u=0;t.isHorizontal()?s&&(d=-d):(u=p,p=0,c=-d,d=0),n.style.zIndex=-Math.abs(Math.round(l))+e.length,a.slideShadows&&i(n,l);const m=`translate3d(${p}px, ${u}px, 0px) rotateX(${c}deg) rotateY(${d}deg)`;le(0,n).style.transform=m}},setTransition:e=>{const s=t.slides.map((e=>m(e)));s.forEach((t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach((t=>{t.style.transitionDuration=`${e}ms`}))})),oe({swiper:t,duration:e,transformElements:s})},recreateShadows:()=>{t.params.flipEffect,t.slides.forEach((e=>{let s=e.progress;t.params.flipEffect.limitRotation&&(s=Math.max(Math.min(e.progress,1),-1)),i(e,s)}))},getEffectParams:()=>t.params.flipEffect,perspective:()=>!0,overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!t.params.cssMode})})},function(e){let{swiper:t,extendParams:s,on:a}=e;s({coverflowEffect:{rotate:50,stretch:0,depth:100,scale:1,modifier:1,slideShadows:!0}}),ne({effect:"coverflow",swiper:t,on:a,setTranslate:()=>{const{width:e,height:s,slides:a,slidesSizesGrid:i}=t,r=t.params.coverflowEffect,n=t.isHorizontal(),l=t.translate,o=n?e/2-l:s/2-l,d=n?r.rotate:-r.rotate,c=r.depth;for(let e=0,t=a.length;e<t;e+=1){const t=a[e],s=i[e],l=(o-t.swiperSlideOffset-s/2)/s,p="function"==typeof r.modifier?r.modifier(l):l*r.modifier;let u=n?d*p:0,m=n?0:d*p,h=-c*Math.abs(p),f=r.stretch;"string"==typeof f&&-1!==f.indexOf("%")&&(f=parseFloat(r.stretch)/100*s);let g=n?0:f*p,v=n?f*p:0,w=1-(1-r.scale)*Math.abs(p);Math.abs(v)<.001&&(v=0),Math.abs(g)<.001&&(g=0),Math.abs(h)<.001&&(h=0),Math.abs(u)<.001&&(u=0),Math.abs(m)<.001&&(m=0),Math.abs(w)<.001&&(w=0);const b=`translate3d(${v}px,${g}px,${h}px)  rotateX(${m}deg) rotateY(${u}deg) scale(${w})`;if(le(0,t).style.transform=b,t.style.zIndex=1-Math.abs(Math.round(p)),r.slideShadows){let e=n?t.querySelector(".swiper-slide-shadow-left"):t.querySelector(".swiper-slide-shadow-top"),s=n?t.querySelector(".swiper-slide-shadow-right"):t.querySelector(".swiper-slide-shadow-bottom");e||(e=de("coverflow",t,n?"left":"top")),s||(s=de("coverflow",t,n?"right":"bottom")),e&&(e.style.opacity=p>0?p:0),s&&(s.style.opacity=-p>0?-p:0)}}},setTransition:e=>{t.slides.map((e=>
2906m(e))).forEach((t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach((t=>{t.style.transitionDuration=`${e}ms`}))}))},perspective:()=>!0,overwriteParams:()=>({watchSlidesProgress:!0})})},function(e){let{swiper:t,extendParams:s,on:a}=e;s({creativeEffect:{limitProgress:1,shadowPerProgress:!1,progressMultiplier:1,perspective:!0,prev:{translate:[0,0,0],rotate:[0,0,0],opacity:1,scale:1},next:{translate:[0,0,0],rotate:[0,0,0],opacity:1,scale:1}}});const i=e=>"string"==typeof e?e:`${e}px`;ne({effect:"creative",swiper:t,on:a,setTranslate:()=>{const{slides:e,wrapperEl:s,slidesSizesGrid:a}=t,r=t.params.creativeEffect,{progressMultiplier:n}=r,l=t.params.centeredSlides;if(l){const e=a[0]/2-t.params.slidesOffsetBefore||0;s.style.transform=`translateX(calc(50% - ${e}px))`}for(let s=0;s<e.length;s+=1){const a=e[s],o=a.progress,d=Math.min(Math.max(a.progress,-r.limitProgress),r.limitProgress);let c=d;l||(c=Math.min(Math.max(a.originalProgress,-r.limitProgress),r.limitProgress));const p=a.swiperSlideOffset,u=[t.params.cssMode?-p-t.translate:-p,0,0],m=[0,0,0];let h=!1;t.isHorizontal()||(u[1]=u[0],u[0]=0);let f={translate:[0,0,0],rotate:[0,0,0],scale:1,opacity:1};d<0?(f=r.next,h=!0):d>0&&(f=r.prev,h=!0),u.forEach(((e,t)=>{u[t]=`calc(${e}px + (${i(f.translate[t])} * ${Math.abs(d*n)}))`})),m.forEach(((e,t)=>{m[t]=f.rotate[t]*Math.abs(d*n)})),a.style.zIndex=-Math.abs(Math.round(o))+e.length;const g=u.join(", "),v=`rotateX(${m[0]}deg) rotateY(${m[1]}deg) rotateZ(${m[2]}deg)`,w=c<0?`scale(${1+(1-f.scale)*c*n})`:`scale(${1-(1-f.scale)*c*n})`,b=c<0?1+(1-f.opacity)*c*n:1-(1-f.opacity)*c*n,y=`translate3d(${g}) ${v} ${w}`;if(h&&f.shadow||!h){let e=a.querySelector(".swiper-slide-shadow");if(!e&&f.shadow&&(e=de("creative",a)),e){const t=r.shadowPerProgress?d*(1/r.limitProgress):d;e.style.opacity=Math.min(Math.max(Math.abs(t),0),1)}}const E=le(0,a);E.style.transform=y,E.style.opacity=b,f.origin&&(E.style.transformOrigin=f.origin)}},setTransition:e=>{const s=t.slides.map((e=>m(e)));s.forEach((t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow").forEach((t=>{t.style.transitionDuration=`${e}ms`}))})),oe({swiper:t,duration:e,transformElements:s,allSlides:!0})},perspective:()=>t.params.creativeEffect.perspective,overwriteParams:()=>({watchSlidesProgress:!0,virtualTranslate:!t.params.cssMode})})},function(e){let{swiper:t,extendParams:s,on:a}=e;s({cardsEffect:{slideShadows:!0,rotate:!0,perSlideRotate:2,perSlideOffset:8}}),ne({effect:"cards",swiper:t,on:a,setTranslate:()=>{const{slides:e,activeIndex:s,rtlTranslate:a}=t,i=t.params.cardsEffect,{startTranslate:r,isTouched:n}=t.touchEventsData,l=a?-t.translate:t.translate;for(let o=0;o<e.length;o+=1){const d=e[o],c=d.progress,p=Math.min(Math.max(c,-4),4);let u=d.swiperSlideOffset;t.params.centeredSlides&&!t.params.cssMode&&(t.wrapperEl.style.transform=`translateX(${t.minTranslate()}px)`),t.params.centeredSlides&&t.params.cssMode&&(u-=e[0].swiperSlideOffset);let m=t.params.cssMode?-u-t.translate:-u,h=0;const f=-100*Math.abs(p);let g=1,v=-i.perSlideRotate*p,w=i.perSlideOffset-.75*Math.abs(p);const b=t.virtual&&t.params.virtual.enabled?t.virtual.from+o:o,y=(b===s||b===s-1)&&p>0&&p<1&&(n||t.params.cssMode)&&l<r,E=(b===s||b===s+1)&&p<0&&p>-1&&(n||t.params.cssMode)&&l>r;if(y||E){const e=(1-Math.abs((Math.abs(p)-.5)/.5))**.5;v+=-28*p*e,g+=-.5*e,w+=96*e,h=-25*e*Math.abs(p)+"%"}if(m=p<0?`calc(${m}px ${a?"-":"+"} (${w*Math.abs(p)}%))`:p>0?`calc(${m}px ${a?"-":"+"} (-${w*Math.abs(p)}%))`:`${m}px`,!t.isHorizontal()){const e=h;h=m,m=e}const x=p<0?""+(1+(1-g)*p):""+(1-(1-g)*p),S=`\n        translate3d(${m}, ${h}, ${f}px)\n        rotateZ(${i.rotate?a?-v:v:0}deg)\n        scale(${x})\n      `;if(i.slideShadows){let e=d.querySelector(".swiper-slide-shadow");e||(e=de("cards",d)),e&&(e.style.opacity=Math.min(Math.max((Math.abs(p)-.5)/.5,0),1))}d.style.zIndex=-Math.abs(Math.round(c))+e.length;le(0,d).style.transform=S}},setTransition:e=>{const s=t.slides.map((e=>m(e)));s.forEach((t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow").forEach((t=>{t.style.transitionDuration=`${e}ms`}))})),oe({swiper:t,duration:e,transformElements:s})},perspective:()=>!0,overwriteParams:()=>({watchSlidesProgress:!0,virtualTranslate:!t.params.cssMode})})}];return Q.use(ce),Q}();
2907function isMobile(){return('ontouchstart'in document.documentElement);}
2908$(".external-language-selector a.selector").on("click",function(){if('ontouchstart'in document.documentElement){$(".external-language-selector ul").toggleClass("collapsed");}});$(".external-language-selector a.selector").on("blur",function(){$(".external-language-selector ul").addClass("collapsed");});fadeInMenu();$(window).resize(function(event){if($('.mobile-menu').hasClass('is-active')&&$(window).width()>992){toggleMobileMenu();}});function toggleMobileMenu(){$('.hamburger').toggleClass('is-active');$('.mobile-menu').toggleClass('is-active');$('html').toggleClass('mobile-menu-open');if($('.mobile-menu').hasClass('is-active')){$('.mobile-menu').removeClass('is-hidding');fadeInMenu();$('html, body').css({overflow:'hidden',height:'100%'});}else{$('.mobile-menu').addClass('is-hidding');setTimeout(function(){$('.mobile-menu').removeClass('is-hidding');},250);$('html, body').css({overflow:'',height:''});var tl=new TimelineMax({});tl.staggerFromTo($('.mobile-menu-link a'),0.2,{autoAlpha:1,y:0},{autoAlpha:0,y:-10,clearProps:"all"},0.1);}}
2909function fadeInMenu(){var tl=new TimelineMax({});tl.staggerFromTo($('.mobile-menu-link a'),0.2,{autoAlpha:0,y:10},{autoAlpha:1,y:0,clearProps:"all"},0.1);}
2910function handleMotionEvent(event){var x=event.accelerationIncludingGravity.x;var y=event.accelerationIncludingGravity.y;var z=event.accelerationIncludingGravity.z;var translationX=-240,translationY=0;if(x<-1){translationX=-200;}else if(x>1){translationX=-300;}
2911if(y<-1){translationY=-20;}else if(y>1){translationY=20;}
2912$('.mobile-menu-bg').css('background-position',translationX+'px ',translationY+'px');}
2913/*!
2914* Parsley.js
2915* Version 2.6.2 - built Wed, Jan 4th 2017, 8:58 am
2916* http://parsleyjs.org
2917* Guillaume Potier - <[email protected]>
2918* Marc-Andre Lafortune - <[email protected]>
2919* MIT Licensed
2920*/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;!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}
2921function n(){var t=this,i=window||global;e.extend(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("undefined"==typeof e||"undefined"==typeof e[0])return i;for(s=e[0].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.is("["+t+i+"]")},setAttr:function(e,t,i,n){e[0].setAttribute(this.dasherize(t+i),String(n))},generateID:function(){return""+r++},deserializeValue:function(t){var i;try{return t?"true"==t||("false"==t?!1:"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,"")},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){-1==i.indexOf(t)&&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=a,l={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,focu
2921s:"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>"},u=function(){this.__id__=o.generateID()};u.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 o.attr(this.$element,this.options.namespace,this.domOptions),this.parent&&this.parent.actualizeOptions&&this.parent.actualizeOptions(),this},_resetOptions:function(e){this.domOptions=o.objectCreate(this.parent.options),this.options=o.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):!0},reset:function(){if("ParsleyForm"!==this.__class__)return this._resetUI(),this._trigger("reset");for(var e=0;e<this.fields.length;e++)this.fields[e].reset();this._trigger("reset")},destroy:function(){if(this._destroyUI(),"ParsleyForm"!==this.__class__)return this.$element.removeData("Parsley"),this.$element.removeData("ParsleyFieldMultiple"),void this._trigger("destroy");for(var e=0;e<this.fields.length;e++)this.fields[e].destroy();this.$element.removeData("Parsley"),this._trigger("destroy")},asyncIsValid:function(e,t){return o.warnOnce("asyncIsValid is deprecated; please use whenValid instead"),this.whenValid({group:e,force:t})},_findRelated:function(){return this.options.multiple?this.parent.$element.find("["+this.options.namespace+'multiple="'+this.options.multiple+'"]'):this.$element}};var d={string:function(e){return e},integer:function(e){if(isNaN(e))throw'Requirement is not an integer: "'+e+'"';return parseInt(e,10)},number:function(e){if(isNaN(e))throw'Requirement is not a number: "'+e+'"';return parseFloat(e)},reference:function(t){var i=e(t);if(0===i.length)throw'No such reference: "'+t+'"';return i},"boolean":function(e){return"false"!==e},object:function(e){return o.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)}},h=function(e,t){var i=e.match(/^\s*\[(.*)\]\s*$/);if(!i)throw'Requirement is not an array: "'+e+'"';var n=i[1].split(",").map(o.trimString);if(n.length!==t)throw"Requirement has "+n.length+" values when "+t+" are needed";return n},p=function(e,t){var i=d[e||"string"];if(!i)throw'Unknown requirement specification: "'+e+'"';return i(t)},c=function(e,t,i){var n=null,r={};for(var s in e)if(s){var a=i(s);"string"==typeof a&&(a=p(e[s],a)),r[s]=a}else n=p(e[s],t);return[n,r]},f=function(t){e.extend(!0,this,t)};f.prototype={validate:function(t,i){if(this.fn)return arguments.length>3&&(i=[].slice.call(arguments,1,-1)),this.fn.call(this,t,i);if(e.isArray(t)){if(!this.validateMultiple)throw"Validator `"+this.name+"` does not handle multiple values";return this.validateMultiple.apply(this,arguments)}if(this.validateNumber)return isNaN(t)?!1:(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 e.isArray(t)?t:[t];var n=this.requirementType;if(e.isArray(n)){for(var r=h(t,n.length),s=0;s<r.length;s++)r[s]=p(n[s],r[s]);return r}return e.isPlainObject(n)?c(n,t,i):[p(n,t)]},requirementType:"string",priority:2};var m=function(e,t){this.__class__="ParsleyValidatorRegistry",this.locale="en",this.init(e||{},t||{})},g={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,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")};g.range=g.number;var v=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.prototype={init:function(t,i){this.catalog=i,this.validators=e.extend({},this.validators);for(var n in t)this.addValidator(n,t[n].fn,t[n].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])o.warn('Validator "'+e+'" is already defined.');else if(l.hasOwnProperty(e))return void o.warn('"'+e+'" is a restricted keyword and is not a valid validator name.');return this._setValidator.apply(this,arguments)}
2921,updateValidator:function(e,t,i){return this.validators[e]?this._setValidator.apply(this,arguments):(o.warn('Validator "'+e+'" is not already defined.'),this.addValidator.apply(this,arguments))},removeValidator:function(e){return this.validators[e]||o.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 f(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=g[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(v(r),v(a));if(v(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:{validateNumber:function(e,t){return e>=t},requirementType:"number",priority:30},max:{validateNumber:function(e,t){return t>=e},requirementType:"number",priority:30},range:{validateNumber:function(e,t,i){return e>=t&&i>=e},requirementType:["number","number"],priority:30},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",o._SubmitSelector,function(t){e.onSubmitButton(t)}),!1!==this.options.uiEnabled&&this.$element.attr("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?!0: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?!0: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?!0:i;this._buildUI(),this._removeError(e),n&&this._manageStatusClass()},_manageStatusClass:function(){this.hasConstraints()&&this.needsValidation()&&
2921!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.attr(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&&e(this.options.classHandler).length)return e(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||this.$element.is("select")?this.$element:this.$element.parent()},_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);o.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(o.namespaceEvents(this.options.triggerAfterFailure,"Parsley"),function(){t._validateIfNeeded()}):(e=o.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__="ParsleyForm",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(o._SubmitSelector).first();if(this._$submitSource=null,this.$element.find(".parsley-synthetic-submit-button").prop("disabled",!0),!i.is("[formnovalidate]")){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(t){this._$submitSource=e(t.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.attr("name"),value:t.attr("value")})}this.$element.trigger(e.extend(e.Event("submit"),{parsley:!0}))}},validate:function(t){if(arguments.length>=1&&!e.isPlainObject(t)){o.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,a=n.event;this.submitEvent=a,a&&(this.submitEvent=e.extend({},a,{preventDefault:function(){o.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=o.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)){o.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 o.all(s)},_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);"ParsleyField"!==n.__class__&&"ParsleyFieldMultiple"!==n.__class__||!0===n.options.excluded||"undefined"==typeof t.fieldsMappedById[n.__class__+"-"+n.__id__]&&(t.fieldsMappedById[n.__class__+"-"+n.__id__]=n,t.fields.push(n))}),e.each(o.difference(i,t.fields),function(e,t){t._trigger("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(t,i,n,r,s){if(!/ParsleyField/.test(t.__class__))throw new Error("ParsleyField or ParsleyFieldMultiple instance expected");var a=window.Parsley._validatorRegistry.validators[i],o=new f(a);e.extend(this,{validator:o,name:i,requirements:n,priority:r||t.options[i+"Priority"]||o.priority,isDomConstraint:!0===s}),this._parseRequirements(t.options)},C=function(e){var t=e[0].toUpperCase();return t+e.slice(1)};F.prototype={validate:function(e,t){var i;
2921return(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 $=function(t,i,n,r){this.__class__="ParsleyField",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()},x={pending:null,resolved:!0,rejected:!1};$.prototype={validate:function(t){arguments.length>=1&&!e.isPlainObject(t)&&(o.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;return this.refreshConstraints(),!r||this._isInGroup(r)?(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()))):void 0},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 e.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)){o.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?x[s.state()]:!0},whenValid:function(){var t=this,i=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=i.force,r=void 0===n?!1:n,s=i.value,a=i.group,l=i._refreshed;if(l||this.refreshConstraints(),!a||this._isInGroup(a)){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=o.all(e.map(n,function(e){return t._validateConstraint(s,e)}));return d.push(r),"rejected"===r.state()?!1:void 0}),o.all(d)}},_validateConstraint:function(t,i){var n=this,r=i.validate(t,this);return!1===r&&(r=e.Deferred().reject()),o.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)},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(){this.$element.attr("required")&&this.addConstraint("required",!0,void 0,!0),"string"==typeof this.$element.attr("pattern")&&this.addConstraint("pattern",this.$element.attr("pattern"),void 0,!0),"date"!==this.$element.attr("type")&&"undefined"!=typeof this.$element.attr("min")&&"undefined"!=typeof this.$element.attr("max")?this.addConstraint("range",[this.$element.attr("min"),this.$element.attr("max")],void 0,!0):"date"!==this.$element.attr("type")&&"undefined"!=typeof this.$element.attr("min")?this.addConstraint("min",this.$element.attr("min"),void 0,!0):"date"!==this.$element.attr("type")&&"undefined"!=typeof this.$element.attr("max")&&this.addConstraint("max",this.$element.attr("max"),void 0,!0),"undefined"!=typeof this.$element.attr("minlength")&&"undefined"!=typeof this.$element.attr("maxlength")?this.addConstraint("length",[this.$element.attr("minlength"),this.$element.attr("maxlength")],void 0,!0):"undefined"!=typeof this.$element.attr("minlength")?this.addConstraint("minlength",this.$element.attr("minlength"),void 0,!0):"undefined"!=typeof this.$element.attr("maxlength")&&this.addConstraint("maxlength",this.$element.attr("maxlength"),void 0,!0);var e=this.$element.attr("type");return"undefined"==typeof e?this:"number"===e?this.addConstraint("type",["number",{step:this.$element.attr("step")||"1",base
2921:this.$element.attr("min")||this.$element.attr("value")}],void 0,!0):/^(email|url|range)$/i.test(e)?this.addConstraint("type",e,void 0,!0):this},_isRequired:function(){return"undefined"==typeof this.constraintsByName.required?!1:!1!==this.constraintsByName.required.requirements},_trigger:function(e){return this.trigger("field:"+e)},_handleWhitespace:function(e){return!0===this.options.trimValue&&o.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=o.trimString(e)),e},_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 E=$,P=function(){this.__class__="ParsleyFieldMultiple"};P.prototype={addElement:function(e){return this.$elements.push(e),this},refreshConstraints:function(){var t;if(this.constraints=[],this.$element.is("select"))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("ParsleyFieldMultiple").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(this.$element.is("input[type=radio]"))return this._findRelated().filter(":checked").val()||"";if(this.$element.is("input[type=checkbox]")){var t=[];return this._findRelated().filter(":checked").each(function(){t.push(e(this).val())}),t}return this.$element.is("select")&&null===this.$element.val()?[]:this.$element.val()},_init:function(){return this.$elements=[this.$element],this}};var V=function(t,i,n){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&&e.extend(r.options,i),r;if(!this.$element.length)throw new Error("You must bind Parsley on an existing element.");if("undefined"!=typeof n&&"ParsleyForm"!==n.__class__)throw new Error("Parent instance must be a ParsleyForm instance");return this.parent=n||window.Parsley,this.init(i)};V.prototype={init:function(e){return this.__class__="Parsley",this.__version__="2.6.2",this.__id__=o.generateID(),this._resetOptions(e),this.$element.is("form")||o.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 this.$element.is("input[type=radio], input[type=checkbox]")||this.$element.is("select")&&"undefined"!=typeof this.$element.attr("multiple");},handleMultiple:function(){var t,i,n=this;if(this.options.multiple||("undefined"!=typeof this.$element.attr("name")&&this.$element.attr("name").length?this.options.multiple=t=this.$element.attr("name"):"undefined"!=typeof this.$element.attr("id")&&this.$element.attr("id").length&&(this.options.multiple=this.$element.attr("id"))),this.$element.is("select")&&"undefined"!=typeof this.$element.attr("multiple"))return this.options.multiple=this.options.multiple||this.__id__,this.bind("parsleyFieldMultiple");if(!this.options.multiple)return o.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,""),"undefined"!=typeof t&&e('input[name="'+t+'"]').each(function(t,i){e(i).is("input[type=radio], input[type=checkbox]")&&e(i).attr(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("ParsleyFieldMultiple")||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 u,window.ParsleyExtend)._bindFields();break;case"parsleyField":n=e.extend(new E(this.$element,this.domOptions,this.options,this.parent),new u,window.ParsleyExtend);break;case"parsleyFieldMultiple":n=e.extend(new E(this.$element,this.domOptions,this.options,this.parent),new P,new u,
2921window.ParsleyExtend)._init();break;default:throw new Error(t+"is not a supported Parsley type")}return this.options.multiple&&o.setAttr(this.$element,this.options.namespace,"multiple",this.options.multiple),"undefined"!=typeof i?(this.$element.data("ParsleyFieldMultiple",n),n):(this.$element.data("Parsley",n),n._actualizeTriggers(),n._trigger("init"),n)}};var M=e.fn.jquery.split(".");if(parseInt(M[0])<=1&&parseInt(M[1])<8)throw"The loaded version of jQuery is too old. Please upgrade to 1.8.x or better.";M.forEach||o.warn("Parsley requires ES5 to run properly. Please include https://github.com/es-shims/es5-shim");var O=e.extend(new u,{$element:e(document),actualizeOptions:null,_resetOptions:null,Factory:V,version:"2.6.2"});e.extend(E.prototype,y.Field,u.prototype),e.extend(w.prototype,y.Form,u.prototype),e.extend(V.prototype,u.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 V(this,t):void o.warn("You must bind Parsley on an existing element.")},"undefined"==typeof window.ParsleyExtend&&(window.ParsleyExtend={}),O.options=e.extend(o.objectCreate(l),window.ParsleyConfig),window.ParsleyConfig=O.options,window.Parsley=window.psly=O,window.ParsleyUtils=o;var A=window.Parsley._validatorRegistry=new m(window.ParsleyConfig.validators,window.ParsleyConfig.i18n);window.ParsleyValidator={},e.each("setLocale addCatalog addMessage addMessages getErrorMessage formatMessage addValidator updateValidator removeValidator".split(" "),function(t,i){window.Parsley[i]=e.proxy(A,i),window.ParsleyValidator[i]=function(){var e;return o.warnOnce("Accessing the method '"+i+"' through ParsleyValidator is deprecated. Simply call 'window.Parsley."+i+"(...)'"),(e=window.Parsley)[i].apply(e,arguments)}}),window.Parsley.UI=y,window.ParsleyUI={removeError:function(e,t,i){var n=!0!==i;return o.warnOnce("Accessing ParsleyUI 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 o.warnOnce("Accessing ParsleyUI 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 a=!0!==s;return o.warnOnce("Accessing ParsleyUI 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:a})}}),!1!==window.ParsleyConfig.autoBind&&e(function(){e("[data-parsley-validate]").length&&e("[data-parsley-validate]").parsley()});var T=e({}),R=function(){o.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 E||e instanceof w))throw new Error("Mu
vendor: 8,922 bytes, lines 2921-2950
2921st 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 E||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 E||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.attr("name")||r.$element.attr("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={}}),window.ParsleyExtend.addAsyncValidator=function(){return ParsleyUtils.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});
2922;(function($){var transform=(function(){var vendors=['webkit','moz','ms'];var style=document.createElement("div").style;var trans='transform'in style?'transform':undefined;for(var i=0,count=vendors.length;i<count;i++){var prop=vendors[i]+'Transform';if(prop in style){trans=prop;break;}}
2923return trans;})();var Item=function(element,options){element.item=this;this.element=element;if(element.tagName==='IMG'){this.fullWidth=element.width;this.fullHeight=element.height;}else{element.style.display="inline-block";this.fullWidth=element.offsetWidth;this.fullHeight=element.offsetHeight;}
2924element.style.position='absolute';if(options.mirror&&this.element.tagName==='IMG'){this.reflection=$(element).reflect(options.mirror).next()[0];var $reflection=$(this.reflection);this.reflection.fullHeight=$reflection.height();$reflection.css('margin-top',options.mirror.gap+'px');$reflection.css('width','100%');element.style.width="100%";this.element=this.element.parentNode;this.element.item=this;this.element.alt=element.alt;this.element.title=element.title;}
2925if(transform&&options.transforms)
2926this.element.style[transform+"Origin"]="0 0";this.moveTo=function(x,y,scale){this.width=this.fullWidth*scale;this.height=this.fullHeight*scale;this.x=x;this.y=y;this.scale=scale;var style=this.element.style;style.zIndex=""+(scale*100)|0;if(transform&&options.transforms){style[transform]="translate("+x+"px, "+y+"px) scale("+scale+")";}else{if(options.mirror&&this.element.tagName==='IMG')
2927this.reflection.style.marginTop=(options.mirror.gap*scale)+"px";style.width=this.width+"px";style.left=x+"px";style.top=y+"px";}}}
2928var time=!window.performance||!window.performance.now?function(){return+new Date()}:function(){return performance.now()};var cancelFrame=window.cancelAnimationFrame||window.cancelRequestAnimationFrame;var requestFrame=window.requestAnimationFrame;(function(){var vendors=['webkit','moz','ms'];for(var i=0,count=vendors.length;i<count&&!cancelFrame;i++){cancelFrame=window[vendors[i]+'CancelAnimationFrame']||window[vendors[i]+'CancelRequestAnimationFrame'];requestFrame=requestFrame&&window[vendors[i]+'RequestAnimationFrame'];}}());var Carousel=function(element,options){var self=this;var $container=$(element);this.items=[];this.xOrigin=(options.xOrigin===null)?$container.width()*0.5:options.xOrigin;this.yOrigin=(options.yOrigin===null)?$container.height()*0.1:options.yOrigin;this.xRadius=(options.xRadius===null)?$container.width()/2.3:options.xRadius;this.yRadius=(options.yRadius===null)?$container.height()/6:options.yRadius;this.farScale=options.farScale;this.rotation=this.destRotation=Math.PI/2;this.speed=options.speed;this.smooth=options.smooth;this.fps=options.fps;this.timer=0;this.autoPlayAmount=options.autoPlay;this.autoPlayDelay=options.autoPlayDelay;this.autoPlayTimer=0;this.onLoaded=options.onLoaded;this.onRendered=options.onRendered;this.onAnimationFinished=options.onAnimationFinished;this.itemOptions={transforms:options.transforms}
2929if(options.mirror){this.itemOptions.mirror=$.extend({gap:2},options.mirror);}
2930$container.css({position:'relative',overflow:'hidden'});this.renderItem=function(itemIndex,rotation){var item=this.items[itemIndex];var sin=Math.sin(rotation);var farScale=this.farScale;var scale=farScale+((1-farScale)*(sin+1)*0.5);item.moveTo(this.xOrigin+(scale*((Math.cos(rotation)*this.xRadius)-(item.fullWidth*0.5))),this.yOrigin+(scale*sin*this.yRadius),scale);}
2931this.render=function(){var count=this.items.length;var spacing=2*Math.PI/count;var radians=this.rotation;for(var i=0;i<count;i++){this.renderItem(i,radians);radians+=spacing;}
2932if(typeof this.onRendered==='function')
2933this.onRendered(this);}
2934this.playFrame=function(){var rem=self.destRotation-self.rotation;var now=time();var dt=(now-self.lastTime)*0.002;self.lastTime=now;if(Math.abs(rem)<0.003){self.rotation=self.destRotation;self.pause();if(typeof self.onAnimationFinished==='function')
2935self.onAnimationFinished();}else{self.rotation=self.destRotation-rem/(1+(self.speed*dt));self.scheduleNextFrame();}
2936self.render();}
2937this.scheduleNextFrame=function(){this.lastTime=time();this.timer=this.smooth&&cancelFrame?requestFrame(self.playFrame):setTimeout(self.playFrame,1000/this.fps);}
2938this.itemsRotated=function(){return this.items.length*((Math.PI/2)-this.rotation)/(2*Math.PI);}
2939this.floatIndex=function(){var count=this.items.length;var floatIndex=this.itemsRotated()%count;return(floatIndex<0)?floatIndex+count:floatIndex;}
2940this.nearestIndex=function(){return Math.round(this.floatIndex())%this.items.length;}
2941this.nearestItem=function(){return this.items[this.nearestIndex()];}
2942this.play=function(){if(this.timer===0)
2943this.scheduleNextFrame();}
2944this.pause=function(){this.smooth&&cancelFrame?cancelFrame(this.timer):clearTimeout(this.timer);this.timer=0;}
2945this.go=function(count){this.destRotation+=(2*Math.PI/this.items.length)*count;this.play();}
2946this.goTo=function(index){var count=this.items.length;var diff=index-(this.floatIndex()%count);if(2*Math.abs(diff)>count)
2947diff-=(diff>0)?count:-count;this.destRotation=this.rotation;this.go(-diff);return diff;}
2948this.deactivate=function(){this.pause();clearInterval(this.autoPlayTimer);if(options.buttonLeft)options.buttonLeft.unbind('click');if(options.buttonRight)options.buttonRight.unbind('click');$container.unbind('.cloud9');}
2949this.autoPlay=function(){this.autoPlayTimer=setInterval(function(){self.go(self.autoPlayAmount)},this.autoPlayDelay);}
2950this.enableAutoPlay=function(){$container.bind('mouseover.cloud9',function(){clearInterval(self.autoPlayTimer);});$container.bind('mouseout.cloud9',function(){self.autoPlay();});this.autoPlay();}
2951this.bindControls=function(){if(options.buttonLeft){options.buttonLeft.bind('click',function(){self.go(-1);return false;});}
2952if(options.buttonRight){options.buttonRight.bind('click',function(){self.go(1);return false;});}
2953if(options.mouseWheel){$container.bind('mousewheel.cloud9',function(event,delta){self.go((delta>0)?1:-1);return false;});}
2954if(options.bringToFront){$container.bind('click.cloud9',function(event){var hits=$(event.target).closest('.'+options.itemClass);if(hits.length!==0){var diff=self.goTo(self.items.indexOf(hits[0].item));if(Math.abs(diff)>0.5)
2955event.preventDefault();}});}}
2956var items=$container.find('.'+options.itemClass);this.finishInit=function(){for(var i=0;i<items.length;i++){var item=items[i];if((item.tagName==='IMG')&&((item.width===undefined)||((item.complete!==undefined)&&!item.complete)))
2957return;}
2958clearInterval(this.initTimer);for(i=0;i<items.length;i++)
2959this.items.push(new Item(items[i],this.itemOptions));$container.bind('mousedown onselectstart',function(){return false});if(this.autoPlayAmount!==0)this.enableAutoPlay();this.bindControls();this.render();if(typeof this.onLoaded==='function')
2960this.onLoaded(this);};this.initTimer=setInterval(function(){self.finishInit()},50);}
2961$.fn.Cloud9Carousel=function(options){return this.each(function(){options=$.extend({xOrigin:null,yOrigin:null,xRadius:null,yRadius:null,farScale:0.5,transforms:true,smooth:true,fps:30,speed:4,autoPlay:0,autoPlayDelay:4000,bringToFront:false,itemClass:'cloud9-item',handle:'carousel'},options);$(this).data(options.handle,new Carousel(this,options));});}})(window.jQuery||window.Zepto);
2962if(!window._gcui_otherText)window.console&&console.error&&console.error('Please define _gcui_otherText.');if(!window._gcui_selectElem)window.console&&console.error&&console.error('Please define _gcui_selectElem.');if(!window._gcui_campaignName)window.console&&console.error&&console.error('Please define _gcui_campaignName.');if(!window._gcui_requiredText)window.console&&console.error&&console.error('Please define _gcui_requiredText.');if(!window._gcui_sd_url)window.console&&console.error&&console.error('Please define _gcui_sd_url.');var gcui_eu_country_list={AT:1,BE:1,BG:1,CY:1,CZ:1,DK:1,EE:1,FI:1,FR:1,DE:1,GR:1,HU:1,IE:1,IT:1,LV:1,LT:1,LU:1,MT:1,NL:1,PL:1,PT:1,RO:1,SK:1,SI:1,ES:1,SE:1,GB:1};var cookieController={get:function(sKey){return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(sKey).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null;},set:function(sKey,sValue,vEnd,sPath,sDomain,bSecure){if(!sKey||/^(?:expires|max\-age|path|domain|secure)$/i.test(sKey)){return false;}
2963var sExpires="";if(vEnd){switch(vEnd.constructor){case Number:sExpires=vEnd===Infinity?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+vEnd;break;case String:sExpires="; expires="+vEnd;break;case Date:sExpires="; expires="+vEnd.toUTCString();break;}}
2964document.cookie=encodeURIComponent(sKey)+"="+encodeURIComponent(sValue)+sExpires+(sDomain?"; domain="+sDomain:"")+(sPath?"; path="+sPath:"")+(bSecure?"; secure":"");return true;},remove:function(sKey,sPath,sDomain){if(!sKey||!this.has(sKey)){return false;}
2965document.cookie=encodeURIComponent(sKey)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"+(sDomain?"; domain="+sDomain:"")+(sPath?"; path="+sPath:"");return true;},has:function(sKey){return(new RegExp("(?:^|;\\s*)"+encodeURIComponent(sKey).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=")).test(document.cookie);}};var cookieMonster=cookieController;var ReCaptcha=(function(){'use strict';function recaptchaLang(){var lang=(window.globalLang||'en');var map={'zh':'zh-TW','zh_TW':'zh-TW','zh_CN':'zh-CN','es_ES':'es','pt_BR':'pt-BR','fr_CA':'fr-CA',};return map[lang]||lang.replace('_','-')||'en';}
2966function ReCaptcha(){this.inited=false;}
2967ReCaptcha.prototype.isNewsletterForm=function($form){var source=(($form.find('[name="_source"]').first().val()||'')+'').toLowerCase();var action=(($form.attr('action')||'')+'').toLowerCase();return $form.hasClass('subscribe-form')||action.indexOf('/form/subscribe.action')===0||source==='footer-subscribe'||source==='popup-subscribe'||source==='subscribe-form';};ReCaptcha.prototype.appendWidget=function($form){if(this.isNewsletterForm($form))return false;if($form.find('.g-recaptcha').length>0)return false;var widgetHtml='<div class="g-recaptcha--wrapper"><div class="g-recaptcha" data-sitekey="'+recapchaKey+'" data-action="LOGIN"></div></div>';var $submit=$form.find('button[type="submit"], input[type="submit"]').first();if($submit.length>0){$submit.before(widgetHtml);}else{$form.append(widgetHtml);}
2968return true;};ReCaptcha.prototype.getWrapper=function($form){return $form.find('.g-recaptcha--wrapper').first();};ReCaptcha.prototype.hasResponse=function($form){var responseField=$form.find('[name="g-recaptcha-response"]').first();return responseField.length>0&&responseField.val()!=='';};ReCaptcha.prototype.setRequiredState=function($form,isRequired){var $wrapper=this.getWrapper($form);if($wrapper.length===0)return;if(isRequired){$wrapper.removeClass('captcha-required-pulse');$wrapper.addClass('captcha-required');setTimeout(function(){$wrapper.addClass('captcha-required-pulse');},10);if($wrapper[0]&&typeof $wrapper[0].scrollIntoView==='function'){$wrapper[0].scrollIntoView({behavior:'smooth',block:'center'});}
2969return;}
2970$wrapper.removeClass('captcha-required captcha-required-pulse');};ReCaptcha.prototype.renderWidget=function($form){var self=this;var $widget=$form.find('.g-recaptcha').first();if($widget.length===0)return;if($widget.attr('data-rendered')==='true')return;if($widget.children().length>0){$widget.attr('data-rendered','true');return;}
2971if(!(window.grecaptcha&&grecaptcha.enterprise&&typeof grecaptcha.enterprise.render==='function'))return;grecaptcha.enterprise.render($widget[0],{sitekey:recapchaKey,action:$widget.attr('data-action')||'LOGIN',callback:function(){self.setRequiredState($form,false);},'expired-callback':function(){self.setRequiredState($form,true);},'error-callback':function(){self.setRequiredState($form,true);},hl:recaptchaLang(),});$widget.attr('data-rendered','true');};ReCaptcha.prototype.init=function($forms){if(this.inited)return;if(!window.recapchaKey||recapchaKey==='')return;this.inited=true;var self=this;var protectedForms=[];_.each($forms,function(el){var $form=$(el);if(!self.appendWidget($form))return;protectedForms.push($form);});if(protectedForms.length===0)return;if(window.grecaptcha&&grecaptcha.enterprise&&typeof grecaptcha.enterprise.render==='function'){_.each(protectedForms,function($form){self.renderWidget($form);});return;}
2972if(!window.loadjs||!loadjs.isDefined('recaptcha-enterprise')){var scriptUrl='https://www.google.com/recaptcha/enterprise.js?hl='+encodeURIComponent(recaptchaLang());if(window.loadjs){loadjs([scriptUrl],'recaptcha-enterprise');loadjs.ready('recaptcha-enterprise',function(){_.each(protectedForms,function($form){self.renderWidget($form);});});}else{var s=document.createElement('script');s.src=scriptUrl;s.async=true;s.onload=function(){_.each(protectedForms,function($form){self.renderWidget($form);});};document.head.appendChild(s);}}else if(window.loadjs){loadjs.ready('recaptcha-enterprise',function(){_.each(protectedForms,function($form){self.renderWidget($form);});});}};return ReCaptcha;})();function initForm(){if(!window.safeNav){function safeNav(stringOfDotSeparatedParameters){var returnObject=window,parameters=stringOfDotSeparatedParameters.split('.'),i,parameter;for(i=0;i<parameters.length;i++){parameter=parameters[i];returnObject=returnObject[parameter];if(returnObject===undefined)return undefined;}
2973return returnObject;};function safeNav2(obj,stringOfDotSeparatedParameters){var returnObject=obj,parameters=stringOfDotSeparatedParameters.split('.'),i,parameter;for(i=0;i<parameters.length;i++){parameter=parameters[i];returnObject=returnObject[parameter];if(returnObject===undefined)return undefined;}
2974return returnObject;};}
2975$(function(){$('[data-toggle="tooltip"]').tooltip();});var cc=0;
2975$(document).on('keyup mouseup',function(e){if(cc++==2)$('[name=captcha]').val('V@3fsasdfasdfAAdgf9J*');});var _vmRecaptcha=new ReCaptcha();$(function(){_vmRecaptcha.init($('form.autowired'));});$(document).on('change input','form.autowired [name="g-recaptcha-response"]',function(){var $form=$(this).closest('form');if($form.length===0)return;_vmRecaptcha.setRequiredState($form,!_vmRecaptcha.hasResponse($form));});$('.autowired input[type="text"], .autowired textarea, .autowired select').each(function(){if(!$(this).attr('id')&&$(this).attr('name'))$(this).attr('id',$(this).attr('name'));if($(this).attr('id')&&!$(this).attr('name'))$(this).attr('name',$(this).attr('id'));});var $countryElem=$('.autowired [name="countryCode"]');var $stateElem=$('.autowired [name="stateProvince"]');var defaultCountry='US';var firstStateUpdate=true;$countryElem.on('change',function(e){var newVal=$(this).val();_.each($countryElem,function(value,key,list){$(value).val(newVal);});updateStateList();});$stateElem.on('change',function(e){var newVal=$(this).val();_.each($stateElem,function(value,key,list){$(value).val(newVal);});});$('form select').each(function(){if($(this).closest('body').hasClass('path-store')){return;}
2976var name=$(this).attr('name');if(!name){return window.console&&console.error&&console.error('select must have "name" attribute: '+this);}
2977var formGroup=$(this).parents('.form-group');if(!formGroup.length){return window.console&&console.error&&console.error('select must have a ".form-group" parent: '+this);}
2978formGroup.css('position','relative');$(this).after('<input class="other-input form-control" type="text" name="'+name+'-other-input" id="'+name+'_other_input" placeholder="'+_gcui_otherSpecifyText+'" data-placement="bottom" title="'+_gcui_requiredText+'" />');});$('select').on('change',function(e){var selected=$(this).find(':selected');var formGroup=$(this).parents('.form-group');if(selected.attr('data-other')){formGroup.addClass('other-active');formGroup.find('.other-input').focus();}else{formGroup.removeClass('other-active');}});setTimeout(function(){if(window.globalGeolocationData){var defaultCountry=safeNav('globalGeolocationData.estimated_location.country_code');if(defaultCountry)defaultCountry=defaultCountry.toUpperCase();$countryElem.val(defaultCountry);updateStateList();}else{$(document).bind('geolocated',function(){var defaultCountry=safeNav('globalGeolocationData.estimated_location.country_code');if(defaultCountry)defaultCountry=defaultCountry.toUpperCase();$countryElem.val(defaultCountry);updateStateList();});}
2979$stateElem.on('change',function(e){var newVal=$(this).val();_.each($stateElem,function(value,key,list){if(newVal!=$(value).val()){$(value).val(newVal);}});});},500);var $dateElem=$('.autowired .input-group.date input[type="text"]');if($dateElem.length){var datepickerLang=(globalLang=='zh'?'zh-TW':(globalLang=='es_ES'?'es':globalLang));function datepickerInit(){$dateElem.datepicker({format:"d-M-yyyy",calendarWeeks:true,autoclose:true,todayHighlight:true,language:datepickerLang,});}
2980$.getScript('/theme/js/bootstrap-datepicker.js',function(){if(globalLang!='en'){$.getScript('/theme/js/locales/bootstrap-datepicker.'+globalLang+'.js').done(function(){datepickerInit();}).fail(function(){datepickerInit();});}else{datepickerInit();}});}
2981$(document).on('keyup','input[type="text"],textarea',function(e){$(this).removeClass('errored');});$(document).on('click','.btn-request-booklet',function(e){if($('.form-wrapper').hasClass('activated'))return true;if(window.extraFormOpenValidation&&!extraFormOpenValidation()){e.preventDefault();e.stopPropagation();return false;}
2982e.preventDefault();e.stopPropagation();$('.form-wrapper').addClass('activated');$('#salutation').focus();setTimeout(function(){$('.activated .row.hider').css('overflow','visible');},2000);return false;});$(document).on('submit','form.autowired',function(e){var $form=$(this);e.preventDefault();e.stopPropagation();if(window.recapchaKey&&recapchaKey!==''&&!_vmRecaptcha.isNewsletterForm($form)&&!_vmRecaptcha.hasResponse($form)){_vmRecaptcha.setRequiredState($form,true);return false;}else{_vmRecaptcha.setRequiredState($form,false);}
2983var countrySelected;if($countryElem.length>0){countrySelected=$countryElem.val().toUpperCase();}
2984if(gcui_eu_country_list[countrySelected]){if(!$('[name="sign-up-for-newsletter-eu"]')[0].checked){$('.email-wrapper').tooltip('show');setTimeout(function(){$('.email-wrapper').tooltip('hide');var old_element=$('.email-wrapper')[0];var new_element=old_element.cloneNode(true);old_element.parentNode.replaceChild(new_element,old_element);},1000);return false;}
2985if(!$('[name="by-phone"]')[0].checked){$('.by-phone-wrapper').tooltip('show');setTimeout(function(){$('.by-phone-wrapper').tooltip('hide');var old_element=$('.by-phone-wrapper')[0];var new_element=old_element.cloneNode(true);old_element.parentNode.replaceChild(new_element,old_element);},1000);return false;}
2986if(!$('[name="by-mail"]')[0].checked){$('.by-mail-wrapper').tooltip('show');setTimeout(function(){$('.by-mail-wrapper').tooltip('hide');var old_element=$('.by-mail-wrapper')[0];var new_element=old_element.cloneNode(true);old_element.parentNode.replaceChild(new_element,old_element);},1000);return false;}}
2987var formRes=_.reduce($form.find('input,textarea,select'),function(m,elem){if($(elem).hasClass('other-input')){return m;}
2988if(elem.name=="")return m;if(elem.type=='checkbox'){m[elem.name]=elem.checked;}else{m[elem.name]=elem.value;}
2989if(elem.type=='radio'&&elem.checked){m[elem.name]=elem.value;}
2990return m;},{});var isErrored=false;_.each($form.find('select'),function(elem){if(isErrored)return;if($(elem).find(':selected').attr('data-other')){var otherElem=$(elem).siblings('.other-input')[0];formRes[otherElem.name]=otherElem.value;}});if(isErrored)return false;if($countryElem.length>0){if(formRes['stateProvince']=='other')formRes['stateProvince']=$form.find('[name="stateProvince-other
2990-input"]').filter(function(){return this.value;}).val();formRes['stateProvinceCode']=formRes['stateProvince'];formRes['stateProvince']=$('#stateProvince option').eq($('#stateProvince')[0].selectedIndex).val();}
2991if(window.globalOrgData)formRes['orgData']=JSON.stringify(globalOrgData);if($form.attr("enctype")=="multipart/form-data"){formRes=new FormData($form[0]);}
2992window.console&&console.log&&console.log(formRes);$form.find('[type="submit"]').addClass('activated').attr('disabled','disabled');formAddressValidate($form,formRes);e.preventDefault();return false;});$(document).bind('gcui_org_preference_set',function(e,org_data){if(org_data==null)return window.console&&console.warn&&console.warn('geolocation not available');globalOrgData={latitude:safeNav2(org_data,'result.estimated_location.latitude'),longitude:safeNav2(org_data,'result.estimated_location.longitude'),cont_from_org:safeNav2(org_data,'result.items.cont'),address_data_from_geolocation:{area_code:safeNav2(org_data,'result.estimated_location.area_code'),city:safeNav2(org_data,'result.estimated_location.city'),country_code:safeNav2(org_data,'result.estimated_location.country_code'),postal_code:safeNav2(org_data,'result.estimated_location.postal_code'),region_code:safeNav2(org_data,'result.estimated_location.region_code'),},org_id:safeNav2(org_data,'result.items.id'),}});var addressValidateSecondTry=false;function formAddressValidate($form,formRes){if(window.addressAutocomplete&&formRes.fulladdress!=null&&!window.addressAutocomplete.isErrored()){if(window.addressAutocomplete&&!window.addressAutocomplete.isAddressPicked()){window.addressAutocomplete.showSuggestions();$('.btn-submit').removeClass('disabled').removeAttr('disabled')
2993return;}
2994window.addressAutocomplete.validateAddress().then(result=>{var formRes2=_.reduce($form.find('input,textarea,select'),function(m,elem){if($(elem).hasClass('other-input')){return m;}
2995if(elem.name=="")return m;if(elem.type=='checkbox'){m[elem.name]=elem.checked;}else{m[elem.name]=elem.value;}
2996if(elem.type=='radio'&&elem.checked){m[elem.name]=elem.value;}
2997return m;},{});formRes=Object.assign(formRes,formRes2);if(result){submitForm(formRes);}else{$('.btn-submit').removeClass('disabled').removeAttr('disabled');}}).catch(error=>{console.error(error);$('.btn-submit').removeClass('disabled').removeAttr('disabled');});return;}
2998return submitForm(formRes);if(addressValidateSecondTry||$('.autowired [name="_source"]').attr('value')=="/download.html")return submitForm(formRes);var url=_gcui_sd_url+'/address/validation.action?'+
2999'countryCode='+encodeURIComponent(formRes['countryCode'].toLowerCase())+
3000'&address='+encodeURIComponent(formRes['address'])+
3001'&city='+encodeURIComponent(formRes['city'])+
3002'&stateProvince='+encodeURIComponent(formRes['stateProvince'])+
3003'&postalCode='+encodeURIComponent(formRes['postalCode'])+
3004'&firstName='+encodeURIComponent(formRes['firstName'])+
3005'&lastName='+encodeURIComponent(formRes['lastName']);var xhr=createCORSRequest('GET',url);if(!xhr){window.console&&console.warn&&console.warn('no CORS support - not validating address');window._tr=window._tr||[];
3005_tr.push(['_trackEvent','Errors',document.location+'','no CORS support - not validating address']);submitForm(formRes);return;}
3006xhr.onload=function(){var res=xhr.responseText;if(res==null||res.length==0)return address_validation_error('address validation returned zero response',url);var parsed=JSON.parse(res);if(!parsed||!parsed.result)return address_validation_error('address validation returned no good object',url);if(!parsed.result.valid)return address_validation_error('address not valid',url);submitForm(formRes);};xhr.onerror=function(){address_validation_error(xhr.responseText,url);};xhr.send();}
3007function submitForm(formRes){email_validate(formRes.email,function(){sendForm(formRes);},function(){email_validation_error(formRes.email);});}
3008function sendForm(formRes){var $form=$('form.autowired');var options={url:$form.attr('action'),type:$form.attr('method'),data:formRes,success:function(data){if($('.autowired').hasClass('download-form')){$("<style type='text/css'> .fancybox-overlay{display: none !important; z-index:-1 !important; } </style>").appendTo("head");res=data.split('|');cookieController.set('booklet_downloaded','true','');cookieController.set('download_session_id',res[1],'');cookieController.set('identityId',res[2],'');firstTime=true;$('form input[name="DownloadId"]').attr('value',res[1]);$('form input[name="identityId"]').attr('value',res[2]);submitDownloadState($form.attr('data-on-success'));location=$form.attr('data-on-success');}else if($form.attr('data-redirect-on-success')){location=$form.attr('data-redirect-on-success');}else{$(document).trigger('form-success');}},error:function(xhr,status,error){var err=xhr.responseText;window.console&&console.error&&console.error(err);$form.find('[type="submit"]').removeClass('activated').removeAttr('disabled');$('.error-box').html('Error submitting your form: '+xhr.responseText);}};if($form.attr("enctype")=="multipart/form-data"){options.enctype='multipart/form-data';options.cache=false;options.contentType=false;options.processData=false;}
3009$.ajax(options);}
3010function createCORSRequest(method,url){var xhr=new XMLHttpRequest();if("withCredentials"in xhr){xhr.open(method,url,true);}else if(typeof XDomainRequest!="undefined"){xhr=new XDomainRequest();xhr.open(method,url);}else{xhr=null;}
3011return xhr;}
3012var emailValidateSecondTry=false;function email_validate(email,successCallback,errorCallback){return successCallback();}
3013function email_validation_error(email){emailValidateSecondTry=true;window.console&&console.error&&console.error('email validation error');_tr.push(['_trackEvent','Errors',document.location+'','email did not validate ('+email+')']);$('.error-box').html('Sorry, your email address does not appear to be valid. Please review it and try again.');$('form.autowired').find('[type="submit"]').removeClass('activated').removeAttr('disabled');}
3014function address_validation_error(mess,url){addressValidateSecondTry=true;window.console&&console.error&&console.error('address validation error');$('.error-box').html('Sorry, this does not appear to be a valid mailing address. Please review it and try again.');$('form.autowired').find('[type="submit"]').removeClass('activated').removeAttr('disabled');_tr.push(['_trackEvent','Errors',document.location+'','address did not validate ('+mess+'): '+url]);}
3015function updateStateList(){if(!$countryElem.val())return;var countrySelected=$countryElem.val().toUpperCase();if(gcui_eu_country_list[countrySelected]){$('form.autowired .eu-only').slideDown(50);$('form.autowired .non-eu').slideUp(50);}else{$('form.autowired .eu-only').slideUp(50);$('form.autowired .non-eu').slideDown(50);}
3016$.ajax({url:'/lookups/state_list.html?countryCode='+countrySelected,dataType:'jsonp',cache:true,jsonpCallback:'state_list_lookup_callback',success:function(data){$stateElem.html(_gcui_selectElem+
3017_.reduce(data,function(m,v,k){return m+'<option value="'+k+'">'+v+'</option>';},'')+
3018'<option data-other="true" value="other">'+_gcui_otherText+'</option>');if(firstStateUpdate){var defaultState=safeNav('globalGeolocationData.estimated_location.region_code');if(defaultState)defaultState=defaultState.toUpperCase();if(defaultState&&$stateElem.find('[value="'+defaultCountry+'-'+defaultState+'"]').length)$stateElem.val(defaultCountry+'-'+defaultState);firstStateUpdate=false;}else{$stateElem.find('[value=""]').attr('selected','selected');}},error:function(xhr,status,error){var err=xhr.responseText;window.console&&console.error&&console.error(err);$stateElem.html(_gcui_selectElem+'<option data-other="true" value="other">'+_gcui_otherText+'</option>');}});}
3019$('.salutation-section .btn').click(function(event){$('.salutation-section .btn').removeClass('selected');$(this).addClass('selected');$('form.autowired [name="salutation"]').val($(this).attr('value'));});$(function(){if($('form.autowired').length==0){return;}
3020if(globalLang!='en'){loadjs(['/plugins/parsley/i18n/'+globalLang+'.js?_='],'parsleyjs-i18n');}
3021$('form.autowired').parsley().on('form:validate',function(formInstance){if(curIndex()==1&&$('form.autowired').find('.btn.selected').length==0){$('.invalid-form-error-message.salutation').show().toggleClass('filled',false);formInstance.validationResult=false;}});var $sections=$('.form-section');var firstLoad=true;function navigateTo(index){if(firstLoad){firstLoad=false;return;}
3022TweenMax.to($sections.parent().find('.current'),0.25,{autoAlpha:0,onComplete:switchSection,ease:Power3.easeInOut});window.trackEvent&&trackEvent("Form","Step Shown",index+1);function switchSection(){$sections.removeClass('current').eq(index).addClass('current');TweenMax.fromTo($sections.parent().find('.current'),0.25,{autoAlpha:0},{autoAlpha:1,ease:Power3.easeInOut});$('.form-navigation .previous').toggle(index>0);var atTheEnd=index>=$sections.length-1;$('.form-navigation .next').toggle(!atTheEnd);TweenMax.to(window,1,{scrollTo:$('#request-form').position().top});}}
3023$(document).bind('form-success',function(event){if(window.redirectOnSuccess){location=window.redirectOnSuccess;}else if($sections.length>0){navigateTo(curIndex()+1);}});function curIndex(){return $sections.index($sections.filter('.current'));}
3024$('.form-top-left .go-back, .form-back-button').click(function(){navigateTo(curIndex()-1);});$('form.autowired').on('keypress',function(e){if(e.which==13){e.preventDefault();$('.form-navigation .btn-next').click();}});$('.form-navigation .btn-next').click(function(){var currentGroup='block-'+curIndex();var parsleyInstance=$('.registration-form').parsley({});if(parsleyInstance.validate({group:currentGroup})){var currentGroupInputs=$('.registration-form [data-parsley-group="'+currentGroup+'"]');var checkAddress=false;var stopPropagation=false;if(window.addressAutocomplete){currentGroupInputs.each(function(){if($(this).attr('name')=='fulladdress'&&!window.addressAutocomplete.isErrored()){checkAddress=true;if(window.addressAutocomplete&&!window.addressAutocomplete.isAddressPicked()){window.addressAutocomplete.showSuggestions();stopPropagation=true;}}});}
3025if(curIndex()==0){$sections.find('[name=countryCode]').val($('.form-section.current').find('[name=countryCode]').val());$sections.find('[name=stateProvince]').val($('.form-section.current').find('[name=stateProvince]').val());$sections.find('[name=productCode]').val($('.form-section.current').find('[name=productCode]').val());}
3026$('.form-right-bottom').addClass('form-right-bottom__relative');if(!stopPropagation){$('.form-navigation .btn-next').addClass('disabled');if(checkAddress){window.addressAutocomplete.validateAddress().then(result=>{if(result){navigateTo(curIndex()+1);}
3027$('.form-navigation .btn-next').removeClass('disabled');});}else{navigateTo(curIndex()+1);$('.form-navigation .btn-next').removeClass('disabled');}}}});$sections.each(function(index,section){$(section).find(':input').attr('data-parsley-group','block-'+index);});navigateTo(0);});var firstTime=false;function submitDownloadState(message){if(!$('form input[name="DownloadId"]').attr('value')){$('form input[name="DownloadId"]').attr('value',cookieController.get('download_session_id'));}
3028$('[name=captcha]').val('V@3fsasdfasdfAAdgf9J*');$('form input[name="Message"]').attr('value',"downloaded "+message);$('form input[name="identityId"]').attr('value',cookieController.get('identityId'));var $form=$('form.download');var formRes=_.reduce($form.find('input,textarea,select'),function(m,elem){if($(elem).hasClass('other-input')){return m;}
3029if(elem.name=="")return m;if(elem.type=='checkbox'){m[elem.name]=elem.checked;}else{m[elem.name]=elem.value;}
3030if(elem.type=='radio'&&elem.checked){m[elem.name]=elem.value;}
3031return m;},{});$.ajax({url:$form.attr('action'),type:$form.attr('method'),data:formRes,success:function(data){if(firstTime&&globalIsSafari)
3032location=message;},error:function(xhr,status,error){var err=xhr.responseText;window.console&&console.error&&console.error(err);}});}
3033if(!window.globalGetParams){globalGetParams=window.location.search.length<=1?{hash:window.location.hash}:function(a){var i=a.length,r=/%25/g,h={};while(i--){var p=a[i].split('=');
3033h[p[0]]=r.test(p[1])?decodeURIComponent(p[1]):p[1];}
3034h.hash=window.location.hash;return h;}(window.location.search.substr(1).split('&'));}
3035var globalGeolocationData;if(!globalGetParams.geoDebugIP){globalGeolocationData=cookieMonster.get('geolocated');if(globalGeolocationData)globalGeolocationData=JSON.parse(globalGeolocationData);}else{globalGeolocationData=null;}
3036if(!globalGeolocationData){if(window.globalIgnoreGeolocation)return;var ajaxData={locale:$('html').attr('lang'),results:50};if(globalGetParams.geoDebugIP)ajaxData.ip_override=globalGetParams.geoDebugIP;$.ajax({url:'https://gd2.ondemandhosting.info/gcui-globaldata/geolocate-api.action',dataType:'jsonp',data:ajaxData,success:function(data){globalGeolocationData=data.result;window.globalGeolocationData=globalGeolocationData;if(typeof globalGeolocationData.items[0]!='undefined')
3037globalGeolocationData.items=globalGeolocationData.items[0];delete globalGeolocationData.estimated_location.metro_code;delete globalGeolocationData.items._adjustments;delete globalGeolocationData.items._distance;delete globalGeolocationData.items._matchtype;delete globalGeolocationData.items.csitollfreetelephonenumber;delete globalGeolocationData.items.facsimiletelephonenumber;delete globalGeolocationData.items.geo_accuracy;delete globalGeolocationData.items.incomm_id;cookieMonster.set('geolocated',JSON.stringify(globalGeolocationData),void 0,'/');$(document).trigger('geolocated');$(document).trigger('org-selected',globalGeolocationData.items&&globalGeolocationData.items.id);$(document).trigger('gcui_org_preference_set',{result:globalGeolocationData});},error:function(xhr,status,error){var err=xhr.responseText;}});}else{$(document).trigger('geolocated');$(document).trigger('org-selected',globalGeolocationData.items&&globalGeolocationData.items.id);$(document).trigger('gcui_org_preference_set',{result:globalGeolocationData});setTimeout(function(){$(document).trigger('geolocated');$(document).trigger('org-selected',globalGeolocationData.items&&globalGeolocationData.items.id);$(document).trigger('gcui_org_preference_set',{result:globalGeolocationData});},5000);}
3038window.globalGeolocationData=globalGeolocationData;}
3039function initScene(){$('.enter-tent-arrow,.enter-tent-click').click(function(event){$('.enter-tent-click').css('z-index','0');enterTent();});$.fn.reverse=[].reverse;var tl=new TimelineMax({repeat:-1});tl.to($('.enter-tent-arrow > *, .enter-tent-arrow'),0.5,{autoAlpha:0,ease:Power3.easeInOut,delay:2}).to($('.enter-tent-arrow'),0.5,{autoAlpha:1,ease:Power3.easeInOut}).staggerTo($('.enter-tent-arrow > *').reverse(),1,{autoAlpha:1,ease:Power3.easeInOut},0.1);}
3040var swiperTranslateX;function enterTent(){TweenMax.to($('.interactive-bg-inside-tent'),0.5,{opacity:1,delay:0.5,ease:Power3.easeInOut});var tl=new TimelineMax();$('.enter-tent-arrow').hide();tl.to($('.cta-container, .enter-tent-arrow, .enter-tent-click'),0.25,{autoAlpha:0,ease:Power3.easeInOut,onComplete:()=>{$('.cta-container').hide().removeClass('d-lg-block');$('.home-courses').show();var swiper=new Swiper('.swiper',{paginationClickable:true,navigation:{nextEl:$('.swiper-button-next')[0],prevEl:$('.swiper-button-prev')[0],},spaceBetween:30,slidesPerView:'auto',centeredSlides:true,initialSlide:2,slidesPerView:'auto',freeMode:true});$('.swiper-button-home').show();}}).fromTo($('.home-courses'),0.5,{scale:0.9},{autoAlpha:1,scale:1,ease:Power3.easeInOut}).to($('.bottom-links'),0.25,{autoAlpha:1,ease:Power3.easeInOut})
3041$('.course-slide-wrapper').click(function(event){var courseId=$(this).attr('courseid');showVideo();updateVideoSource($(this).attr('source'),$(this).attr('type'),$(this).attr('videoid'));TweenMax.set($('.course-info'),{autoAlpha:0});var swiper=$('.swiper-container').data('swiper');TweenMax.fromTo($('.swiper-wrapper'),1,{x:swiperTranslateX},{scale:0.7,x:swiperTranslateX*0.7,ease:Power3.easeInOut});$('.link-to-course').attr('href','/training/'+courseId+'/overview.html');$.ajax({url:'/training/'+courseId+'/overview.html',dataType:'html',}).done(function(data){var body=$(data);var fragment=body.find('main.content');updateBody(fragment);}).fail(function(){console.log("error");}).always(function(){console.log("complete");});});$('.video-container .close-button').click(function(event){closeVideo();});}
3042function updateBody(fragment){TweenMax.to($('.body-wrapper, .subheader'),0.5,{autoAlpha:0,ease:Power3.easeInOut,onComplete:()=>{$('.body-wrapper, .subheader').hide();$('.course-info').html($(fragment).html());TweenMax.to($('.course-info'),0.5,{autoAlpha:1,ease:Power3.easeInOut});}});}
3043var shownVideo=false;function showVideo(){shownVideo=true;$('.close-profession').hide();$('.video-container').show();TweenMax.fromTo($('.video-container'),0.75,{autoAlpha:0,scale:0.9},{autoAlpha:1,scale:1,ease:Power3.easeInOut});}
3044function closeVideo(){shownVideo=false;for(var player in videojs.players){if(videojs.players.hasOwnProperty(player)){videojs.players[player].pause();}}
3045TweenMax.to($('.video-container'),0.75,{autoAlpha:0,scale:0.9,ease:Power3.easeInOut,onComplete:()=>{$('.video-container').hide();}});var swiper=$('.swiper-container').data('swiper');TweenMax.to($('.swiper-wrapper'),1,{scale:1,x:swiperTranslateX,ease:Power3.easeInOut});TweenMax.to($('.course-info'),0.5,{autoAlpha:0,onComplete:()=>{$('.course-info').html('');$('.body-wrapper, .subheader').show();TweenMax.to($('.body-wrapper, .subheader'),0.5,{autoAlpha:1,ease:Power3.easeInOut});},ease:Power3.easeInOut});}
3046var header_video;function updateVideoSource(src,type,videoid){showVideo();var is_safari=navigator.userAgent.toLowerCase().indexOf('safari/')>-1;$('#header_video').attr('videoid',videoid);for(var player in videojs.players){if(videojs.players.hasOwnProperty(player)){if($(videojs.players[player].el_).closest('.video-container').length>0){videojs.players[player].src({src:src,type:type,});videojs.players[player].poster('/FURL/data/shared/web/assets/videos/master_thumbs/'+videoid+'.jpg');}}}}
3047(function(){var JavascriptHandler={chain:[],destructors:[],};JavascriptHandler.AddHandler=function(handler){JavascriptHandler.chain.push(handler);};JavascriptHandler.Execute=function(handler){_.each(JavascriptHandler.chain,function(handler,key,list){handler();});};JavascriptHandler.AddDestructor=function(handler){JavascriptHandler.destructors.push(handler);};JavascriptHandler.Destroy=function(handler){_.each(JavascriptHandler.destructors,function(handler,key,list){handler();});JavascriptHandler.destructors=[];};this.JavascriptHandler=JavascriptHandler;}).call(this);$(document).ready(function($){JavascriptHandler.Execute();});
3048(function(){var cc=0;
3048$(document).on('keyup mouseup',function(e){cc++;if(cc>=2){$('[name=captcha]').val('V@3fsasdfasdfAAdgf9J*');}});function trackEvent(ec,ea,el,ev){var nonInteraction=ev&&ev.nonInteraction;window._tr&&_tr.push(['_trackEvent',ec,ea,el,ev]);window._gaq&&_gaq.push(['_trackEvent',ec,ea,el,null,nonInteraction]);window.ga&&ga('send','event',ec,ea,el,ev);window._gaq||window.ga||(window.console&&console.log.apply(console,arguments));var params={'event_category':ec,'event_label':el};if(ev&&ev.nonInteraction){params['non_interaction']=true;}
3049window.gtag&&gtag('event',ea,params);window.console&&console.log.apply(console,arguments);}
3050$(document).on('submit','.form-subscribe',function(e){var $form=$(this);$form.find('[type="submit"]').addClass('disabled');$.ajax({url:$form.attr('action'),type:$form.attr('method'),data:$form.find('.form-control, [type="hidden"]'),success:function(data){$form.addClass('form-subscribe__succeed');if($form.hasClass("subscribe-take-over--form")){trackEvent("Subscription Popup","Submitted");$('.subscribe-take-over--inner-close').removeClass('d-none');$('.subscribe-take-over--inner-no-thx').addClass('d-none');$('.subscribe-take-over--inner-title').css('opacity','0');cookieController.set('popup_subscribedyoutube','true',999999999,"/");}},error:function(xhr,status,error){$form.removeClass('disabled');var err=xhr.responseText;window.console&&console.error&&console.error(err);$form.find('[type="submit"]').removeClass('activated').removeAttr('disabled');alert('Error submitting your form: '+xhr.responseText);}});return false;});if(!cookieController.has('popup_subscribedyoutube')&&window.location.pathname!="/subscribe/"){setTimeout(function(){if($('.subscribe-take-over').length!=0){$('.subscribe-take-over').removeClass('d-none');trackEvent("Subscription Popup","Shown",null,{nonInteraction:true});$('.subscribe-take-over--inner-no-thx').click(function(){$('.subscribe-take-over').addClass('d-none');trackEvent("Subscription Popup","No thank you",null,{nonInteraction:true});cookieController.set('popup_subscribedyoutube','true',3600*24*5,'/');$('.subscribe-take-over').remove();});$('.subscribe-take-over--inner-close, .subscribe-take-over--close-x-button').click(function(){$('.subscribe-take-over').addClass('d-none');cookieController.set('popup_subscribedyoutube','true',3600*24*5,'/');$('.subscribe-take-over').remove();trackEvent("Subscription Popup","No thank you",null,{nonInteraction:true});});}},30000);}})();
3051(function(){JavascriptHandler.AddHandler(function(){_.each($('slideshow'),function(value,key,list){var swiper=new Swiper($(value).find('.swiper')[0],{pagination:$(value).find('.swiper-pagination')[0],paginationClickable:true,spaceBetween:0,loop:true,navigation:{nextEl:$(value).find('.button-next-wrapper')[0],prevEl:$(value).find('.button-prev-wrapper')[0],},});});});})();
3052(function(){JavascriptHandler.AddHandler(function(){if(window.location.pathname!="/training/"){return;}
3053init();});function init(){var isLegacyBrowser=(navigator.userAgent+"").match(/MSIE [5-8]\./);var currentId;var quizXml;function setSlideText(slideId){var text="<li>"+slidesCaption[slideId*3]+"</li>";text+="<li>"+slidesCaption[slideId*3+1]+"</li>";text+="<li>"+slidesCaption[slideId*3+2]+"</li>";$('#slide-text').html(text);}
3054function initCarousel(){var swiper=new Swiper('.swiper',{paginationClickable:true,navigation:{nextEl:$('.swiper-button-next')[0],prevEl:$('.swiper-button-prev')[0],},spaceBetween:0,slidesPerView:'auto',centeredSlides:true,slidesPerView:1,});setSlideText(0);swiper.on('onSlideChangeStart',function(){var swiper=$('.swiper-container').data('swiper');var ind=(swiper.activeIndex-1)%$('.swiper-slide:not(.swiper-slide-duplicate)').length+1;if(ind<0){ind+=$('.swiper-slide:not(.swiper-slide-duplicate)').length;}
3055var tl=new TimelineMax();tl.to($('#slide-text'),0.5,{opacity:0,onComplete:function(){setSlideText(ind);},ease:Power3.easeInOut}).to($('#slide-text'),0.5,{opacity:1,ease:Power3.easeInOut});});}
3056initCarousel();$.ajax({type:"GET",url:"/training/online_course_info.xml",dataType:"xml",success:createXml});function createXml(xml){quizXml=xml;}
3057$('.course-selection').each(function(){var url='/FURL/data/www.volunteerministers.org/files/sites/all/themes/gold_master/www_volunteerministers_org/images/'+$(this).attr("imgId")+'.jpg';(jQuery("<img>")).attr("src",url);});
3057$('.course-selection').hover(function(){var url='url(/FURL/data/www.volunteerministers.org/files/sites/all/themes/gold_master/www_volunteerministers_org/images/'+$(this).attr("imgId")+'.jpg) no-repeat'
3058var cssObj={'background':url,'opacity':'1','background-size':'100% 100%'}
3059$('.left-menu-image').css(cssObj);$('.left-menu-title, .left-menu-body').hide();},function(){$('.left-menu-image').attr("style","");$('.left-menu-title, .left-menu-body').show();});$('.right-menu').css('opacity','1');enterMenus();function enterMenus(){$('.left-menu').animate({left:'0',opacity:'1'},250,'swing',function(){});$('.course-selection-container').css('opacity','1');var delay=50;$('.course-selection').each(function(){delay+=50;$(this).css('left','200px');if(isLegacyBrowser)
3060$(this).css('display','block');else
3061$(this).css('display','flex');$(this).animate({left:'-=200',opacity:'1'},500+delay,'swing',function(){$('.course-selection-controls').hide();});});}
3062$('.slide').click(function(){var myCourseId=$(this).attr('id');document.location='/training/'+myCourseId+'/overview.html';});$('.filler, .slide-show-accessories').click(function(){var myCourseId=$('.active .slide').attr('id');document.location='/training/'+myCourseId+'/overview.html';});$('.course-selection').click(function(){if(isLegacyBrowser){$('#headercourseselector .course-selection-holder').hide();}
3063var myRuinId=$(this).attr('id');var myRuinEl=$(quizXml).find("Ruin#"+myRuinId);var myCourseId=myRuinEl.attr('courseId');if(myCourseId){document.location='/training/'+myCourseId+'/overview.html';return;}
3064$('.course_selector_feature').animate({left:'-40',opacity:'1'},750,'swing');currentId=$(this).attr('id');$('#right_menu_selected').html($(this).children()[0].textContent);var delay=0;if(!isLegacyBrowser){$('.course-selection').each(function(){delay+=50;$(this).animate({left:'-=200',opacity:'0'},500+delay,'swing',function(){$('.course-selection').hide();});});}
3065$('.left-menu').css('height',$('.left-menu').height()+"px");$('.second-menu').css('display','block');$('.left-menu, .left-menu-image').css('position','absolute');$('.left-menu').animate({left:'-235',opacity:'0'},750,'swing',function(){$(this).hide();$(this).css('position','relative');});var h=$('.course-selection-holder').height();$('.right-menu').css('height',h+"px");$('.left-menu-image').animate({left:'-235'},750,'swing',function(){$('#carousel').css('height',h+"px");loadMenuTwo();});$('.second-menu').css('transform','translateX(0px)');$('.second-menu').animate({left:'0',opacity:'1'},750,'swing',function(){});$('#carousel').css('left','200px').css('opacity','0');$('#carousel').animate({left:'0',opacity:'1'},1000,'swing',function(){});});var carusel;var myNumItems=0;function loadMenuTwo(){var newHtml="";var i=0;myNumItems=0;$('.course-selection-controls').show();$(quizXml).find("Ruin").each(function(){if($(this).attr('id')==currentId){$(this).children("Item").each(function(){i++;var myCourseId=$(this).attr('courseId');var myCourseTag=$(quizXml).find("Course#"+myCourseId+"");var myAdText=myCourseTag.attr('adtext').toUpperCase();var myCourseName=myCourseTag.attr('thename').toUpperCase();var myNameBarValue=myCourseTag.attr('shortname');newHtml+='<div class="course-question-item" courseId="'+myCourseId+'">';newHtml+='<div class="image-wrapper">';newHtml+='<img src="/FURL/data/www.volunteerministers.org/files/sites/all/themes/gold_master/www_volunteerministers_org/images/course/'+myCourseId+'.jpg" />';newHtml+='<div class="ad-text">'+myAdText+'</div>';newHtml+='</div>';newHtml+='<div class="name-bar">'+myNameBarValue+'</div>';newHtml+='</div>';myNumItems++;});}});$('#carousel').html(newHtml);carusel=$("#carousel").Cloud9Carousel({buttonLeft:$(".prev-hitarea"),buttonRight:$(".next-hitarea"),itemClass:"course-question-item",bringToFront:true,onLoaded:function(){$('.course-question-item').css('display','block;');},onRendered:function(carousel){var item=$(carusel).data("carousel").nearestItem();$('#headercourseselector .current-item-hitarea').attr('href','/training/'+item.element.getAttribute("courseid")+'/overview.html');}});var myCtls=$('#headercourseselector .course-selection-holder-questions,#headercourseselector .course-selection-controls').css('display','block').hide();tryFadeIn(myCtls,250);return;}
3066$('#headercourseselector .prev-arrow').hide();$('#headercourseselector .next-arrow').hide();$('#headercourseselector .prev-hitarea').css('cursor','inherit');$('#headercourseselector .next-hitarea').css('cursor','inherit');$('#headercourseselector .prev-hitarea').hover(function(e){if(menuTwoCanPrev()){tryFadeIn($('#headercourseselector .prev-arrow'),100);$('#headercourseselector .prev-hitarea').css('cursor','pointer');}else{$('#headercourseselector .prev-hitarea').css('cursor','inherit');}},function(e){tryFadeOut($('#headercourseselector .prev-arrow'),100);});$('#headercourseselector .next-hitarea').hover(function(e){if(menuTwoCanNext()){tryFadeIn($('#headercourseselector .next-arrow'),100);$('#headercourseselector .next-hitarea').css('cursor','pointer');}else{$('#headercourseselector .next-hitarea').css('cursor','inherit');}},function(e){tryFadeOut($('#headercourseselector .next-arrow'),100);});$('#headercourseselector .hitarea').mousemove(function(e){var myY=(e.pageY-$(this).offset().top)-20;$('#headercourseselector .arrow').css('top',myY);});function menuTwoCanNext(){if($("#carousel").data("carousel").nearestIndex()+1>=myNumItems){return false;}
3067return true;}
3068function menuTwoCanPrev(){if($("#carousel").data("carousel").nearestIndex()<=0){return false;}
3069return true;}
3070$('.right-menu-back-to-menu').click(function(){$('.second-menu').css('height',$('.second-menu').height()+"px");$('.second-menu').css('position','absolute');$('.second-menu').css('transform','translateX(500px)');$('.second-menu').animate({'opacity':'0',left:800},750,'swing',function(){$('.second-menu').css('display','none');$('.second-menu').css('position','relative');});$('.left-menu').css('display','block');$('.left-menu').css('opacity','0');$('.left-menu').animate({'opacity':'1',left:0},400,'swing');$('#carousel').animate({left:'200',opacity:'0'},750,'swing',function(){$('#carousel').html('');$('#carousel').removeAttr('style');enterMenus();});});function tryFadeOut(aElement,aTime){if(isLegacyBrowser){aElement.hide();}else{aElement.fadeOut(aTime);}
3071return aElement;}
3072function tryFadeIn(aElement,aTime){if(isLegacyBrowser){aElement.show();}else{aElement.fadeIn(aTime);}
3073return aElement;}}})();
3074(function(){JavascriptHandler.AddHandler(function(){if(!window.location.pathname.startsWith("/training/")||!window.location.pathname.endsWith("/overview.html")){return;}
3075var vm_header_video;var is_safari=navigator.userAgent.toLowerCase().indexOf('safari/')>-1;videojs('vm_header_video',{autoplay:true,controls:true,nativeControlsForTouch:false,html5:{nativeVideoTracks:is_safari,nativeAudioTracks:is_safari,hls:{overrideNative:!is_safari,}},}).ready(function(){vm_header_video=this;});$(".prebody").sticky({topSpacing:0});$('.course-links').click(function(event){var el=$(".gcui-course-desc-wrapper");var id=$(this).attr('data-link-id');if(id=="details"){el=$(".gcui-coursetabbar-details");}else if(id=="stories"){el=$(".gcui-coursetabbar-successes");}
3076TweenMax.to(window,0.75,{scrollTo:{y:el.offset().top-20-$('.sticky-wrapper').height()}});});$('.slide-header .start-now-bottom, .start-now-link, a[href^="/training/"][href$="start.html"]').click(function(e){e.preventDefault();e.stopPropagation();if(window.gtag){gtag('event','all_courses_starts',{'event_callback':handleStartClick,});}else{handleStartClick();}
3077setTimeout(handleStartClick,2000);});function handleStartClick(){var parts=window.location.pathname.split('/');var link='/tools-for-life/'+parts[2]+'/start.html';location=link;}
3078function getLinkerParameter(UA_CODE){var linker=[];var trackers=ga.getAll();if(trackers.length>0){for(i=0,len=trackers.length;i<len;i+=1){if(trackers[i].get('trackingId')===UA_CODE){return trackers[i].get('linkerParam');}}}
3079return null;}});})();
3080
3081(function(){JavascriptHandler.AddHandler(function(){$('[data-fancybox]').fancybox({protect:true});JavascriptHandler.AddDestructor(function(){});});})();
3082(function(){handlerLoaded=false;var precept_video;JavascriptHandler.AddHandler(function(){initSearch();initMobileMenu();initMainMenu();initSectionNav();initSubscribeForm();if(!handlerLoaded&&window.location.pathname=="/"){handlerLoaded=true;initScene();JavascriptHandler.AddDestructor(function(){handlerLoaded=false;$(window).unbind('scroll');});}});function initMobileMenu(){$('html, body').css({overflow:'',height:''});$('.hamburger').click(function(event){toggleMobileMenu();});$('.mobile-menu-open').removeClass('mobile-menu-open');$('.arrow-small-down-mobile').click(function(event){$('.top-mobile-menu').toggleClass('activated');if($('.top-mobile-menu').hasClass('activated')){TweenMax.set($('.top-mobile-menu ul li'),{'transform':'none',delay:1});}else{TweenMax.set($('.top-mobile-menu ul li'),{clearProps:'all'});}});updateStickyMobileMenuBar();$(window).scroll(function(event){updateStickyMobileMenuBar();});function updateStickyMobileMenuBar(){if($(window).width()<992){if($(document).scrollTop()>100){$('.top-mobile-menu').addClass('pop-up');}else{$('.top-mobile-menu').removeClass('pop-up').removeClass('activated');}}}}
3083function initSubscribeForm(){if($('.subscribe-form').length==0){return;}
3084function submitForm($form,formRes){$.ajax({url:$form.attr('action'),type:$form.attr('method'),data:formRes,success:function(data){$form.html('<p>Thank you for subscribing!</p>');},error:function(xhr,status,error){var err=xhr.responseText;window.console&&console.error&&console.error(err);$form.html('<p>Thank you for subscribing!</p>');}});}
3085$('.subscribe-form').on('submit',function(e){e.preventDefault();var data=$(".subscribe-form :input").serializeArray();submitForm($('.subscribe-form'),data);});}
3086function initSearch(){;(function(window){'use strict';
3086if(document.querySelector('#shell #btn-search')==undefined){return;}
3087var mainContainer=document.querySelector('#shell'),openCtrl=document.querySelector('#shell #btn-search'),closeCtrl=document.querySelector('#btn-search-close'),searchContainer=document.querySelector('.search'),inputSearch=searchContainer.querySelector('.search__input');function init(){initEvents();}
3088function initEvents(){openCtrl.addEventListener('click',openSearch);closeCtrl.addEventListener('click',closeSearch);document.addEventListener('keyup',function(ev){if(ev.keyCode==27){closeSearch();}});}
3089function openSearch(){mainContainer.classList.add('main-wrap--move');searchContainer.classList.add('search--open');inputSearch.focus();}
3090function closeSearch(){mainContainer.classList.remove('main-wrap--move');searchContainer.classList.remove('search--open');inputSearch.blur();inputSearch.value='';}
3091init();})(window);}
3092function initMainMenu(){var main_navbar=$(".navbar-main");$(window).on('scroll',function(e){if(document.body.scrollTop>26){if(!main_navbar.hasClass("fixed")){main_navbar.addClass("fixed");}}else{main_navbar.removeClass("fixed");}});var revertBack=true;img1=new Image();img1.src="/FURL/imagecache/cropfit@w=100@bl=20@cr=826,163,1308,859@qa=85/data/www.volunteerministers.org/files/home/tent-scene-wide-r.jpg";linkPaddingOffset=13;function underlineDefaultPos(){if($('.top-navigation a.active').length>0&&!hoveredOverMenu){var left=$('.top-navigation a.active').offsetParent().position().left;$('.menu-underline').css('left',(left+linkPaddingOffset)+'px');var width=$('.top-navigation a.active').width();$('.menu-underline').css('width',width+'px');}else{TweenMax.to($('.menu-underline'),0.3,{opacity:0,ease:Circ.easeOut});}}
3093$('.top-navigation a').hover(function(){var el=$(this);TweenMax.to($('.menu-underline'),0.3,{opacity:1,ease:Circ.easeOut});if(!el.hasClass('primary-link')){el=el.parents('.rel').find('.primary-link');}
3094revertBack=true;var left=el.offsetParent().position().left;$('.menu-underline').css('left',(left+linkPaddingOffset)+'px');var width=el.width();$('.menu-underline').css('width',width+'px');},function(event){if($(this).find(('.second-level-wrapper')).length==0){underlineDefaultPos();}});$('.second-level-wrapper').hover(function(){},function(){underlineDefaultPos();});underlineDefaultPos();document.addEventListener('mousemove',onMouseMove,false);var hoveredOverMenu;function onMouseMove(event){if($(event.target).parent().hasClass('menu-link')){hoveredOverMenu=true;}else{hoveredOverMenu=false;}}}
3095function initSectionNav(){if($('.subheader .subheader-menu-wrapper li').length==0){return;}
3096var menu='';columns=3;var perColumn=Math.floor($('.subheader .subheader-menu-wrapper li').length/columns);if($('.subheader .subheader-menu-wrapper li.hidden').length>columns&&$('.subheader .subheader-menu-wrapper li.hidden').length%columns>0){perColumn++;}
3097realNumberOfColumns=Math.floor($('.subheader .subheader-menu-wrapper li.hidden').length/perColumn)
3098+($('.subheader .subheader-menu-wrapper li.hidden').length%perColumn>0?1:0);var bsLayout=4;if(realNumberOfColumns<3){bsLayout=6;}
3099_.each($('.subheader .subheader-menu-wrapper li'),function(value,key,list){if(key%perColumn==0){if(key!=0){menu+="</div>";}
3100menu+='<div class="col-sm-'+bsLayout+' menu-column">';}
3101if($(value).find('.menu-link-wrapper').html()!=undefined){menu+='<li>'+$(value).find('.menu-link-wrapper').html()+'</li>';}});menu+='</div>'
3102$('.additional-menu').html(menu);}})();
3103(function(){JavascriptHandler.AddHandler(function(){var currentPage=globalGetParams.page||1;$('.btn--load-more').click(function(event){var self=this;$('.sk-circle').removeClass('hidden');$.ajax({url:'?ajax=Articles&page='+currentPage,}).done(function(data){currentPage++;$(self).before(data);var $el=$("<div>"+data+"</div>");if($el.find('article').length<9){$(self).remove();}
3104$('.sk-circle').addClass('hidden');});});});})();
3105(function(){'use strict';JavascriptHandler.AddHandler(function(){var paragraphs=document.querySelectorAll('.policy-indent p');paragraphs.forEach(p=>{const bTag=p.querySelector('b');if(bTag&&/^\d+\.\d+(.\d+)?\.$/.test(bTag.textContent.trim())){bTag.classList.add('highlight-digit');}});});})();
3106(function(){JavascriptHandler.AddHandler(function(){if(window.location.pathname.startsWith('/request-info/')){getCountries();}
3107if(document.querySelector('[name="fulladdress"]')){window.addressAutocomplete=new AddressAutocomplete("live_pk_9VRb4m52c2ZzVcq4bcXfK");}});function getCountries(){$.ajax({url:'/lookups/country_list.html?locale='+globalLang,type:'GET',}).done(function(data){globalCountryList=data;var countries=Array.prototype.reduce.call(Object.keys(globalCountryList),function(m,k){return m.concat([[k,globalCountryList[k]]]);},[]).sort(function(a,b){if(a[1]>b[1])return 1;if(a[1]<b[1])return-1;return 0;});countryListing=Array.prototype.reduce.call(countries,function(m,v){return m+'
3107<option value="'+v[0]+'" >'+v[1]+'</option>';},'');$('[name=countryCode]').html($('[name=countryCode]').html()+countryListing);initForm();if(window.globalGeolocationData){$(document).trigger('geolocated');}});JavascriptHandler.AddDestructor(function(){$(document).unbind('geolocated gcui_org_preference_set form-success')});}})();
3108(function(){JavascriptHandler.AddHandler(function(){$(document).on('click','.blog-share-button',function(e){$('.share-overlay').addClass('share-overlay__visible');});$(document).on('click','.share-overlay--close',function(e){$('.share-overlay').removeClass('share-overlay__visible');});});})();
3109(function(){JavascriptHandler.AddHandler(function(){if($('.display-part .swiper').length>0){initSlideShow();}});function initSlideShow(){var swiper=new Swiper($('.swiper')[0],{pagination:{el:$('.swiper').find('.swiper-pagination')[0],type:'bullets',},spaceBetween:0,simulateTouch:false,loop:true,navigation:{nextEl:$('.swiper').find('.swiper-button-next')[0],prevEl:$('.swiper').find('.swiper-button-prev')[0],},});swiper.on('slideChange',function(){_.each(videojs.players,function(player){if(player){player.pause();}});});if(window.location.pathname=="/about-us/being-a-volunteer-minister.html"){swiper.on('slideChange',function(){let ind=swiper.realIndex;tl=new TimelineMax({});tl.to($('.info-text'),0.35,{autoAlpha:0,onComplete:()=>{$('.info-text .wrap-borders').html('<span>'+slides[ind]+'</span>');},ease:Power3.easeInOut}).to($('.info-text'),0.35,{autoAlpha:1,ease:Power3.easeInOut});});}
3110JavascriptHandler.AddDestructor(function(){swiper.destroy();});}})();
3111(function(){JavascriptHandler.AddHandler(function(){if($('#banner-endcard').length>0){(new GscOnlineCourseEndcard({domParent:$('#banner-endcard')})).init();}});})();
3112(function(){var autoplayed;JavascriptHandler.AddHandler(function(){JavascriptHandler.AddDestructor(function(){_.each(videojs.players,function(value,key,list){if(value){value.dispose();}});});autoplayed=false;_.each($('video[videoid]'),function(value,key,list){if($(value).attr('videoid')){var videoId='video-'+(new Date()).getTime();$(value).attr('id',videoId)
3113initVideo($(value).attr('videoid'),videoId);}});});function initVideo(videoId,elementId){var poster=_gcui_file_url+"/data/shared/web/assets/videos/master_thumbs/"+videoId+'.jpg';var autoplay=false;var is_safari=navigator.userAgent.toLowerCase().indexOf('safari/')>-1;videojs(elementId,{autoplay:autoplay,controls:true,nativeControlsForTouch:false,html5:{nativeVideoTracks:is_safari,nativeAudioTracks:is_safari,hls:{overrideNative:!is_safari,}},poster:poster,}).ready(function(){this.on('play',function(event){$('.video-title-strip, .button-next-wrapper, .button-prev-wrapper').hide();});this.on('pause',function(event){$('.video-title-strip, .button-next-wrapper, .button-prev-wrapper').show();});});autoplayed=autoplayed||autoplay;}})();(function(){JavascriptHandler.AddHandler(function(){if(!window.location.pathname.startsWith('/videos/')){return;}
3114init();});function init(){if(!loadjs.isDefined('systemjs')){loadjs(['/plugins-webstack/system.min.js'],'systemjs');}
3115loadjs.ready('systemjs',function(){if(window.location.pathname.indexOf("/videos/voices-for-humanity/")==0){System.import("/libs/vue-compiled/src/voices-for-humanity.min.js");}else{System.import("/libs/vue-compiled/src/videos.min.js");}});}})();
3116(function(){JavascriptHandler.AddHandler(function(){if($('.swiper__vm-doc').length>0){initSlideShow();}});function initSlideShow(){var leftOffset=20;if($(window).width()>1360){leftOffset=($(window).width()-1330)/2;}
3117new Swiper($('.swiper__vm-doc')[0],{spaceBetween:10,slidesPerView:"auto",simulateTouch:false,slidesOffsetBefore:leftOffset,initialSlide:0,navigation:{nextEl:'.swiper-button-next',prevEl:'.swiper-button-prev',},on:{init:function(){window.TrailerPreview&&TrailerPreview.initalizeSlideTrailerPreview(this);window.swiper=this;},beforeResize:function(){var leftOffset=20;if($(window).width()>1360){leftOffset=($(window).width()-1330)/2;}
3118this.params.slidesOffsetBefore=leftOffset;var self=this;setTimeout(function(){self.slideToClosest(500);self.navigation.update();},3000);},resize:function(){var self=this;setTimeout(function(){self.navigation.update();},1000);},},});}})();
3119globalGetParams=window.location.search.length<=1?{hash:window.location.hash}:function(a){var i=a.length,r=/%25/g,h={};while(i--){var p=a[i].split('=');
3119h[p[0]]=r.test(p[1])?decodeURIComponent(p[1]):p[1];}
3120h.hash=window.location.hash;return h;}(window.location.search.substr(1).split('&'));new function(){var ua=navigator.userAgent;if(globalGetParams.ua)ua=globalGetParams.ua;if((/iPhone/i).test(ua))document.documentElement.className+=' device-iphone';if((/iPad/i).test(ua))document.documentElement.className+=' device-ipad';if((/iPod/i).test(ua))document.documentElement.className+=' device-ipod';if((/iPhone/i).test(ua)||(/iPad/i).test(ua)||(/iPod/i).test(ua)){document.documentElement.className+=' device-ios';globalIsIOS=true;}else{document.documentElement.className+=' device-not-ios';globalIsIOS=false;}
3121if((/Android/i).test(ua))document.documentElement.className+=' device-android';globalIsSafari=false;if(ua.toLowerCase().indexOf('safari')!=-1){if(ua.toLowerCase().indexOf('chrome')>-1){}else{globalIsSafari=true;document.documentElement.className+=' browser-safari';}}
3122globalIsIE=(document.documentElement.className.indexOf('ie678')>-1);var mobile_user_agent_strings=['Android','iPhone','iPad','iPod','Opera Mobi','BlackBerry','AvantGo','DoCoMo','KDDI','Vodafone','J-PHONE','DDIPOCKET','PDXGW','ASTEL','EudoraWeb','Windows CE','Minimo','OPWV-SDK','UP.Browser','PLink','Plucker','NetFront','WM5 PIE','Xiino','BenQ','Cricket','IEMobile','Nintendo Wii','nook browser','Nook','Kindle'];globalIsMobile=false;for(var nu in mobile_user_agent_strings){if(ua.toLowerCase().match(new RegExp(mobile_user_agent_strings[nu].toLowerCase()))){document.documentElement.className+=' device-mobile';globalIsMobile=true;break;}}}();var isRTL=(document.documentElement.dir=='rtl');if(globalIsIE){document.createElement("slide");document.createElement("arrow");}
3123var globalTransitionTransformProps={'WebkitTransform':'-webkit-transform','MozTransform':'-moz-transform','msTransform':'-ms-transform','OTransform':'-o-transform','transform':'transform'};if(globalGetParams&&globalGetParams.source){var d=new Date();d.setDate(d.getDate()+14);cookieMonster.set('trackingSource',globalGetParams.source,d,'/');}else if(globalGetParams&&globalGetParams.src){var d=new Date();d.setDate(d.getDate()+14);cookieMonster.set('trackingSource',globalGetParams.src,d,'/');}
3124var cookieController={get:function(sKey){return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(sKey).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null;},set:function(sKey,sValue,vEnd,sPath,sDomain,bSecure){if(!sKey||/^(?:expires|max\-age|path|domain|secure)$/i.test(sKey)){return false;}
3125var sExpires="";if(vEnd){switch(vEnd.constructor){case Number:sExpires=vEnd===Infinity?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+vEnd;break;case String:sExpires="; expires="+vEnd;break;case Date:sExpires="; expires="+vEnd.toUTCString();break;}}
3126document.cookie=encodeURIComponent(sKey)+"="+encodeURIComponent(sValue)+sExpires+(sDomain?"; domain="+sDomain:"")+(sPath?"; path="+sPath:"")+(bSecure?"; secure":"");return true;},remove:function(sKey,sPath,sDomain){if(!sKey||!this.has(sKey)){return false;}
3127document.cookie=encodeURIComponent(sKey)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"+(sDomain?"; domain="+sDomain:"")+(sPath?"; path="+sPath:"");return true;},has:function(sKey){return(new RegExp("(?:^|;\\s*)"+encodeURIComponent(sKey).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=")).test(document.cookie);}};var cookieMonster=cookieController;jQuery.fn.andSelf=jQuery.fn.addBack;$(function(){$('a[href*="#"]:not([href="#"])').click(function(){if(location.pathname.replace(/^\//,'')==this.pathname.replace(/^\//,'')&&location.hostname==this.hostname){var target=$(this.hash);target=target.length?target:$('[name='+this.hash.slice(1)+']');if(target.length){$('html, body').animate({scrollTop:target.offset().top},1000);return false;}}});});
3128function Utils(){}
3129var _rpccount=0;Utils.prototype={constructor:Utils,isElementInView:function(element,fullyInView){var pageTop=$(window).scrollTop();var pageBottom=pageTop+$(window).height();var elementTop=$(element).offset().top;var elementBottom=elementTop+$(element).height();if(fullyInView===true){return((pageTop<elementTop)&&(pageBottom>elementBottom));}else{return((elementTop<=pageBottom)&&(elementBottom>=pageTop));}},draftCall:function(method,params,opts){var options=_.defaults(opts,{url:'/info/'+method+'.action',method:'post',dataType:'json',processData:false,data:JSON.stringify({method:method,jsonrpc:'2.0',id:(++_rpccount),params:params}),});return $.ajax(options);}};var Utils=new Utils();if(!window.location.pathname.endsWith('.action')){$(document).ready(function($){var newBackgroun
3129dImage='';var lastHeaderHeight=0;var $content=$('#outer_shell');var newPathName,fadeEverytingOut=false;var is_chrome=!!window.chrome;if(!is_chrome||window.innerWidth<992||navigator.platform.indexOf('Win')>-1){return;}
3130(function($){'use strict';if(true){return;}
3131var $body=$('html, body'),animationDuration=300,content=$content.smoothState({prefetch:false,blacklist:".no-smoothstate, form, .no-smoothstate a, [target], [href$='/store/checkout.action'], [href$='.pdf']",onStart:{duration:500,render:function(url,$container){$content.addClass('is-exiting');if(window.scrollY==0){fadeEverytingOut=false;}else{fadeEverytingOut=true;}
3132fadeOut();}},onReady:{duration:0,render:function($container,$newContent){JavascriptHandler.Destroy();var newHtml="";_.each($newContent,function(value,key,list){if(value.outerHTML!=undefined){newHtml+=value.outerHTML;}});$container.html(newHtml);JavascriptHandler.Execute();$content.removeClass('is-exiting');if(window.location.pathname.indexOf("/request-info/")>-1||window.location.pathname.indexOf("/news")>-1||$('form.autowired').length>0||window.location.pathname.indexOf("/book")>-1){window.location.reload();}else{initPage();}}}}).data('smoothState');})(jQuery);var firstLoad=true;var lastHeaderHeight=0;function initPage(){if(firstLoad){firstLoad=false;return;}
3133window.addthis_reload();document.getElementsByTagName('body')[0].className=document.getElementById('body-classes').className+' transiting';fadeIn();fireTrackings();firstLoad=false;}
3134initPage();var bgTimeLine=new TimelineMax({});function fadeOut(){function animateUp(selector){var tl=new TimelineMax({});tl.staggerTo($(selector),0.5,{opacity:0,y:-10,ease:Power3.easeInOut},0.08,0.1);}
3135if(fadeEverytingOut){animateUp('.navigation, .header, .subheader, .prebody, .body > *, .footer');bgTimeLine.to($('.background-holder'),0.5,{autoAlpha:0,ease:Power3.easeInOut});}else{animateUp('.header, .subheader, .prebody, .body > *, .footer');}}
3136function fadeIn(){function animateUp(selector){var tl=new TimelineMax({});tl.staggerFromTo($(selector),0.5,{opacity:0,y:10},{opacity:1,y:0,ease:Power3.easeInOut,clearProps:"all"},0.1,0.2)}
3137if(fadeEverytingOut){animateUp('.navigation, .header, .subheader, .prebody, .body > *, .footer');bgTimeLine.to($('.background-holder'),0.5,{autoAlpha:1,ease:Power3.easeInOut});}else{animateUp('.header, .subheader, .prebody, .body > *, .footer');}}});}
3138function fireTrackings(){window.gtag&&gtag('config',t1,{'page_path':window.location.pathname});window.gtag&&gtag('config',t2,{'page_path':window.location.pathname});window._tr&&_tr.push(['_trackPageview']);if(window._paq){_paq.push(['setCustomUrl',window.location]);_paq.push(['setDocumentTitle',document.title]);_paq.push(['trackPageView']);}}
3139window.addthis_reload=function(){if(!window.addthis){window['addthis_config']={'data_track_addressbar':false,'data_ga_tracker':'ga','pubid':'ra-59a63a812d5fd80d'};}else{window['addthis_share'].url=window.location.href;window['addthis_share'].title=window.document.title;window.addthis.toolbox('.addthis_toolbox');}}
3140window.addthis_reload();(function(){var lastClick=0;$(document).on('click','.top-language-selector',function(event){$('.top-language-selector').toggleClass('top-language-selector__show');lastClick=new Date().getTime();});$(document).on('click','#shell',function(event){if(new Date().getTime()-lastClick>1000){$('.top-language-selector.top-language-selector__show').removeClass('top-language-selector__show');}});})();if(document.querySelector('.sticky-cta')){document.addEventListener('scroll',function(){const formRightCol=document.querySelector('.form-right-col');const stickyCta=document.querySelector('.sticky-cta');if(formRightCol){const rect=formRightCol.getBoundingClientRect();if(rect.top>window.innerHeight&&rect.bottom>=0){stickyCta.classList.add('sticky-cta__show');}else{stickyCta.classList.remove('sticky-cta__show');}}});}
3141function trackAbTest(ec,ea,el,ev){function isGtagAvailable(){return typeof gtag==='function';}
3142function waitForGtag(){return new Promise((resolve)=>{const interval=setInterval(()=>{if(isGtagAvailable()){clearInterval(interval);resolve();}},100);});}
3143async function fireEvent(){await waitForGtag();trackEvent(ec,ea,el,ev);}
3144fireEvent();}
3145if(window.abtestForm){trackAbTest('AbTest','Started',window.abtestForm);}
3146function trackEvent(ec,ea,el,ev){var nonInteraction=ev&&ev.nonInteraction;window._tr&&_tr.push(['_trackEvent',ec,ea,el,ev]);
3146window._gaq&&_gaq.push(['_trackEvent',ec,ea,el,null,nonInteraction]);window.ga&&ga('send','event',ec,ea,el,ev);window._gaq||window.ga||(window.console&&console.log.apply(console,arguments));var params={'event_category':ec,'event_label':el};if(ev&&ev.nonInteraction){params['non_interaction']=true;}
3147window.gtag&&gtag('event',ea,params);window.console&&console.log.apply(console,arguments);}

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