/*! wysiwyg.js | https://github.com/wysiwygjs/wysiwyg.js | Apache License (v2) */
!function(ce,ue,e){"use strict";var se=function(n,r,o){var i;return function(){if(i){if(!o)return;clearTimeout(i)}var e=this,t=arguments;i=setTimeout(function(){i=null,n.apply(e,t)},r)}},fe=function(e,t,n,r){e.addEventListener(t,n,!!r)},pe=function(e,t,n,r){e.removeEventListener(t,n,!!r)},de=function(e){e.preventDefault(),e.stopPropagation()},he=function(e,t,n){for(var r=n?t.parentNode:t;r;){if(r===e)return!0;r=r.parentNode}return!1},ge=function(e){var t=e.nodeName;return"IMG"==t||"PICTURE"==t||"SVG"==t||"VIDEO"==t||"AUDIO"==t||"IFRAME"==t||"MAP"==t||"OBJECT"==t||"EMBED"==t},ve=function(e){var t=ce.getSelection();return 0<t.rangeCount?t.getRangeAt(0):null},me=function(e,t){if(t){var n=ce.getSelection();n.removeAllRanges(),n.addRange(t)}},be=function(e){return!!ce.getSelection().isCollapsed},Ce=function(){var e=ce.getSelection();if(!e.isCollapsed)try{e.collapseToEnd()}catch(e){}},ke=function(e,t){var n=ce.getSelection();if(he(e,n.anchorNode)&&he(e,n.focusNode))return!0;if(!t)return!1;var r=ue.createRange();return r.selectNodeContents(e),r.collapse(!1),n.removeAllRanges(),n.addRange(r),!0},t=function(e,t){var f,n=t.toolbar,r=t.buttons,u=t.selectionbuttons,l=t.suggester,c=t.interceptenter,o=!!t.hijackmenu,p="string"==typeof e?ue.querySelector(e):e,i=p.querySelector("textarea"),s={},d="top"==n,a="bottom"==n,h="demand"==n,g=function(e,t){e.classList?e.classList.add(t):e.className+=" "+t},v=function(e,t){e.classList&&e.classList.remove(t)},m=p.querySelector("[contenteditable=true]");if(!m){(m=ue.createElement("div")).setAttribute("contentEditable","true");var b=i.placeholder;b&&m.setAttribute("data-placeholder",b),p.insertBefore(m,p.firstChild)}var C=null,k=function(){C&&clearTimeout(C),C=null,g(p,"focus"),h&&g(p,"focused")},E=function(){C||ue.activeElement==m||(C=setTimeout(function(){C=null,v(p,"focus")},50))};fe(m,"focus",k),fe(m,"blur",E),i&&i.form&&fe(i.form,"reset",E);var y=function(e,o){var i=ue.createElement("input");i.placeholder="www.example.com",o&&(i.value=o.href),i.style.width="20em",i.style.maxWidth=parseInt(2*p.offsetWidth/3)+"px",i.autofocus=!0,o&&fe(i,"input",function(e){var t=i.value.trim();t&&(o.href=t)}),fe(i,"keypress",function(e){if(13==(e.which||e.keyCode)){var t=i.value.trim();if(o);else if(t){var n=t;if(/^[a-z0-9]+:\/\//.test(t)||(n="http://"+t),f.getSelectedHTML())f.insertLink(n);else{var r=function(e){return e.replace(/[&<>"]/g,function(e){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"}[e]||e})};f.insertHTML('<a href="'+r(n)+'">'+r(t)+"</a>")}}f.closePopup().collapseSelection(),m.focus()}}),e.appendChild(i),ce.setTimeout(function(){i.focus(),k()},1)},S=function(e,n){var t=function(e,t,n){var r,o,i,a,l,c,u,s;switch(c=n*(1-t),u=n*(1-(l=6*e-(a=Math.floor(6*e)))*t),s=n*(1-(1-l)*t),a%6){case 0:r=n,o=s,i=c;break;case 1:r=u,o=n,i=c;break;case 2:r=c,o=n,i=s;break;case 3:r=c,o=u,i=n;break;case 4:r=s,o=c,i=n;break;case 5:r=n,o=c,i=u}var f=Math.floor(255*r).toString(16),p=Math.floor(255*o).toString(16),d=Math.floor(255*i).toString(16);return"#"+(f.length<2?"0":"")+f+(p.length<2?"0":"")+p+(d.length<2?"0":"")+d},r=ue.createElement("table");r.style.borderCollapse="collapse";for(var o=1;o<15;++o){for(var i=ue.createElement("tr"),a=0;a<25;++a){var l;if(24==a){var c=Math.floor(255/13*(14-o)).toString(16),u=(c.length<2?"0":"")+c;l="#"+u+u+u}else{l=t(a/24,o<=8?o/8:1,8<o?(16-o)/8:1)}var s=ue.createElement("td");s.style.width="0.5em",s.style.height="0.5em",s.style.cursor="pointer",s.style.backgroundColor=l,s.title=l,s.style.userSelect="none",fe(s,"click",function(e){var t=this.title;n?f.forecolor(t).closePopup().collapseSelection():f.highlight(t).closePopup().collapseSelection(),de(e)}),i.appendChild(s)}r.appendChild(i)}e.appendChild(r)},w=function(l,c){if(67108864<l.size)c();else{var s=function(a){var e=new FileReader;e.onload=function(e){if(!a||1==a||8<a)return c(l.type,e.target.result);var i=new Image;i.src=e.target.result,i.onload=function(){var e=i.width,t=i.height;if(t<e){4096<e&&(t*=4096/e,e=4096)}else{4096<t&&(e*=4096/t,t=4096)}var n=ue.createElement("canvas"),r=n.getContext("2d");switch(n.width=e,n.height=t,r.save(),4<a&&(n.width=t,n.height=e),a){case 2:r.translate(e,0),r.scale(-1,1);break;case 3:r.translate(e,t),r.rotate(Math.PI);break;case 4:r.translate(0,t),r.scale(1,-1);break;case 5:r.rotate(.5*Math.PI),r.scale(1,-1);break;case 6:r.rotate(.5*Math.PI),r.translate(0,-t);break;case 7:r.rotate(.5*Math.PI),r.translate(e,-t),r.scale(-1,1);break;case 8:r.rotate(-.5*Math.PI),r.translate(-e,0)}r.drawImage(i,0,0,e,t),r.restore();var o=n.toDataURL("image/jpeg",.99);c(l.type,o)}},e.onerror=function(e){c()},e.readAsDataURL(l)};if(!ce.DataView)return s();var e=new FileReader;e.onload=function(e){var t=e.target.result,n=new DataView(t);if(65496!=n.getUint16(0,!1))return s();for(var r=n.byteLength,o=2;o<r;){if(n.getUint16(o+2,!1)<=8)return s();var i=n.getUint16(o,!1);if(o+=2,65505==i){if(1165519206!=n.getUint32(o+=2,!1))return s();var a=18761==n.getUint16(o+=6,!1);o+=n.getUint32(o+4,a);var l=n.getUint16(o,a);o+=2;for(var c=0;c<l;++c)if(274==n.getUint16(o+12*c,a)){var u=n.getUint16(o+12*c+8,a);return s(u)}}else{if(65280!=(65280&i))break;o+=n.getUint16(o,!1)}}return s()},e.onerror=function(e){c()},e.readAsArrayBuffer(l)}};function M(r,o){for(var i=[],a=0,e=0;e<r.length;++e)!function(n){w(r[n],function(e,t){for(i[n]=function(){t&&o(e,t)};a in i;)i[a](),a++;a==r.length&&(i=null)})}(e)}var L,T=function(e,t,n){for(var r=p,o=r.offsetParent;r;){if("static"!=getComputedStyle(r).position)break;t+=r.offsetLeft,n+=r.offsetTop,r=(o=r).offsetParent}o.appendChild(e);var i=o.getBoundingClientRect(),a=ue.documentElement,l=Math.min(ce.innerWidth,Math.max(a.offsetWidth,a.scrollWidth)),c=ce.innerHeight,u=e.offsetWidth,s=e.offsetHeight;i.left+t<1?t=1-i.left:i.left+t+u>l-1&&(t=Math.max(1-i.left,l-1-i.left-u)),i.top+n<1?n=1-i.top:i.top+n+s>c-1&&(n=Math.max(1-i.top,c-1-i.top-s)),e.style.left=parseInt(t)+"px",e.style.top=parseInt(n)+"px"},R=null,I=function(e,t,n,r){var o=f.activePopup();for(o&&R===t?(v(o,"animate-down"),v(o,"animate-up")):(o=f.openPopup(),g(o,"wysiwyg-popup"),g(o,e?"animate-down":"animate-up"),R=t);o.firstChild;)o.removeChild(o.firstChild);return n(o,r),o},P=function(e,t,n,r){var o=I(!!d,t,n,r),i=p.getBoundingClientRect(),a=e.getBoundingClientRect(),l=a.left-i.left+parseInt(e.offsetWidth/2)-parseInt(o.offsetWidth/2),c=a.top-i.top;d?c+=e.offsetHeight:c-=o.offsetHeight,T(o,l,c)},N=function(e,t){var n=p.getBoundingClientRect(),r=m.getBoundingClientRect(),o=t.left+parseInt(t.width/2)-parseInt(e.offsetWidth/2)+r.left-n.left,i=t.top+t.height+r.top-n.top;T(e,o,i)},H=function(e,t,n,r){var o=I(!0,t,n,r);N(o,e)},A=null,x=null,D=function(o,i,e,c){e.forEach(function(a){if(a instanceof HTMLElement)return o.appendChild(a),fe(a,"focus",k),void fe(a,"blur",E);var l=ue.createElement("button");if(g(l,"btn"),"icon"in a){var e=ue.implementation.createHTMLDocument("");e.body.innerHTML=a.icon;for(var t=e.body.firstChild;null!==t;t=t.nextSibling)l.appendChild(t)}if("attr"in a)for(var n in a.attr)l.setAttribute(n,a.attr[n]);fe(l,"focus",k),fe(l,"blur",E);var r=null;"click"in a?r=function(){a.click(f,l)}:"popup"in a?r=function(){var e=function(e){a.popup(f,e,l)};i?H(i,e.toString(),e):P(l,e.toString(),e)}:"browse"in a||"dataurl"in a?r=function(){f.closePopup().collapseSelection();var o=ue.createElement("input");o.type="file",o.multiple=!0,o.style.display="none",fe(o,"change",function(e){var t="dataurl"in a;if(e.target.files)if("browse"in a)for(var n=i.target.files,r=0;r<n.length;++r)a.browse(f,o,n[r],l);else M(i.target.files,function(e,t){a.dataurl(f,e,t,l)});else t=!0;t&&o.parentNode.removeChild(o),de(e)}),p.appendChild(o);var i=ue.createEvent("MouseEvents");i.initEvent("click",!0,!1),o.dispatchEvent(i)}:"action"in a&&(r=function(){switch(a.action){case"link":i?H(i,"link",y,x):P(l,"link",y,x);break;case"bold":f.bold().closePopup().collapseSelection();break;case"italic":f.italic().closePopup().collapseSelection();break;case"underline":f.underline().closePopup().collapseSelection();break;case"strikethrough":f.strikethrough().closePopup().collapseSelection();break;case"colortext":i?H(i,"colortext",S,!0):P(l,"colortext",S,!0);break;case"colorfill":i?H(i,"colorfill",S,!1):P(l,"colorfill",S,!1);break;case"subscript":f.subscript().closePopup().collapseSelection();break;case"superscript":f.superscript().closePopup().collapseSelection();break;case"orderedlist":f.orderedList().closePopup().collapseSelection();break;case"unorderedlist":f.unorderedList().closePopup().collapseSelection();break;case"clearformat":f.removeFormat().closePopup().collapseSelection()}}),l.onclick=function(e){r&&r(),de(e)},o.appendChild(l),"hotkey"in a&&r&&c&&(c[a.hotkey.toLowerCase()]=r)})},B=null,O=1,U=null,W=function(e){e&&f.expandSelection(B.length,0).insertHTML(e),U=B=null,O+=1,f.closePopup()},F=se(function(){if(B){var t=O;l(B,function(e){A&&t==O&&(U=null,e?H(A,"suggestion",function(n){e.forEach(function(t){var e=ue.createElement("div");g(e,"suggestion"),e.innerHTML=t.label,fe(e,"click",function(e){W(t.insert),de(e)}),n.appendChild(e),null===U&&(U=t.insert)})}):W())})||W()}},100,!0),_=function(e,t,n,r,o,i){if(c&&13==e&&!n&&!r&&!o&&!i&&(f.sync(),c()))return f.closePopup(),!1;if(t&&!n&&!r&&o&&!i){var a=t.toLowerCase();if(s[a])return s[a](),!1}return l?13!=e||!U||(W(U),!1):void 0},q=function(e,t,n,r,o,i){if(l)return function(e,t,n,r,o,i){switch(e){case 8:if(B&&(B=B.slice(0,-1)),B)break;return W(),!0;case 13:case 27:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:return B&&W(),!0;default:B||(B=""),B+=t}return F(),!0}(e,t)},X=function(e,n,t,r){if(A=e?n||A:null,x=null,n)if(e&&null!==B){var o=f.activePopup();o&&(v(o,"animate-down"),v(o,"animate-up"),N(o,n))}else{for(var i=0;i<t.length;++i){var a=t[i],l=a.closest||function(e){for(var t=this;t;){var n=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector;if(n&&n.call(t,e))return t;t=t.parentElement}return null};if(x=l.call(a,"a"))break}var c=!0;r||(u?e?c=!1:t.forEach(function(e){ge(e)&&(c=!1)}):c=!1),c?H(n,"selection",function(e){var t=ue.createElement("div");g(t,"toolbar"),e.appendChild(t),D(t,n,u)}):W()}else W()},z=function(){k()},V=function(){W(),E()},Y=null,K=null;if(i){!m.innerHTML&&i.value&&(m.innerHTML=i.value);var j=m.innerHTML;if(Y=function(){var e=m.innerHTML;e.match(/^<br[/ ]*>$/i)&&(e=m.innerHTML=""),e!=j&&(i.value=e,j=e)},fe(m,"focus",function(){var e=ue.createEvent("Event");e.initEvent("focus",!1,!1),i.dispatchEvent(e)}),fe(m,"blur",function(){Y();var e=ue.createEvent("Event");e.initEvent("blur",!1,!1),i.dispatchEvent(e)}),K=se(Y,250,!0),fe(m,"input",K),fe(m,"propertychange",K),fe(m,"textInput",K),fe(m,"paste",K),fe(m,"cut",K),fe(m,"drop",K),ce.MutationObserver)new MutationObserver(K).observe(m,{attributes:!0,childList:!0,characterData:!0,subtree:!0});var G=i.form;G&&fe(G,"reset",function(){m.innerHTML="",K(),L(!0),v(p,"focused")})}var J=null,$=null;$=se(function(e,t,n){var r=be(),o=function(e){var t=ce.getSelection();if(!t.rangeCount)return[];for(var n=[],r=0;r<t.rangeCount;++r)for(var o=(c=t.getRangeAt(r)).startContainer,i=c.endContainer;o;){if(o!=e){var a=!1;if(t.containsNode)a=t.containsNode(o,!0);else{var l=ue.createRange();for(l.selectNodeContents(o),r=0;r<t.rangeCount;++r){var c;if(0<=(c=t.getRangeAt(r)).compareBoundaryPoints(c.END_TO_START,l)&&c.compareBoundaryPoints(c.START_TO_END,l)<=0){a=!0;break}}}a&&n.push(o)}o=function(e,t){if(e.firstChild)return e.firstChild;for(;e;){if(e==t)return null;if(e.nextSibling)return e.nextSibling;e=e.parentNode}return null}(o,o==i?i:e)}return 0==n.length&&he(e,t.focusNode)&&t.focusNode!=e&&n.push(t.focusNode),n}(m),i=null===e||null===t?null:{left:e,top:t,width:0,height:0},a=function(){var e=ce.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).cloneRange();if((o=t.getBoundingClientRect())&&o.left&&o.top&&o.right&&o.bottom)return{left:parseInt(o.left),top:parseInt(o.top),width:parseInt(o.right-o.left),height:parseInt(o.bottom-o.top)};for(var n=t.getClientRects?t.getClientRects():[],r=0;r<n.length;++r){var o;if((o=n[r]).left&&o.top&&o.right&&o.bottom)return{left:parseInt(o.left),top:parseInt(o.top),width:parseInt(o.right-o.left),height:parseInt(o.bottom-o.top)}}return!1}();if(a&&(i=a),i){var l=m.getBoundingClientRect();i.left-=parseInt(l.left),i.top-=parseInt(l.top),i.left<0&&(i.left=0),i.top<0&&(i.top=0),i.width>m.offsetWidth&&(i.width=m.offsetWidth),i.height>m.offsetHeight&&(i.height=m.offsetHeight)}else if(o.length)for(var c=0;c<o.length;++c){var u=o[c];if(u.nodeType==Node.ELEMENT_NODE){i={left:u.offsetLeft,top:u.offsetTop,width:u.offsetWidth,height:u.offsetHeight};break}}X(r,i,o,n)},1);var Q=null,Z=function(e){var t=e.target||e.srcElement;t.nodeType==Node.TEXT_NODE&&(t=t.parentNode),he(Q,t)||ee()},ee=function(){Q&&(Q.parentNode.removeChild(Q),pe(ce,"mousedown",Z,!(Q=null)),V())},te=function(e,t){var n=e.which||e.keyCode,r=String.fromCharCode(n||e.charCode),o=e.shiftKey||!1,i=e.altKey||!1,a=e.ctrlKey||!1,l=e.metaKey||!1;if(1==t?!1===_(n,r,o,i,a,l)&&de(e):2==t&&!1===q(n,r)&&de(e),J&&(J=ve()),2!=t&&3!=t||$&&$(null,null,!1),2==t&&K)switch(n){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:break;default:K()}};fe(m,"keydown",function(e){te(e,1)}),fe(m,"keypress",function(e){te(e,2)}),fe(m,"keyup",function(e){te(e,3)});var ne=function(e,t){var n=null,r=null;e.clientX&&e.clientY?(n=e.clientX,r=e.clientY):e.pageX&&e.pageY&&(n=e.pageX-ce.pageXOffset,r=e.pageY-ce.pageYOffset),e.which&&3==e.which?t=!0:e.button&&2==e.button&&(t=!0),pe(ce,"mouseup",ne),J&&(J=ve()),!o&&t||$&&$(n,r,t)},re=null;fe(m,"mousedown",function(e){pe(ce,"mouseup",ne),fe(ce,"mouseup",ne),re=e.target}),fe(m,"mouseup",function(e){var t=e.target;if(t&&t.nodeType==Node.ELEMENT_NODE&&t===re&&ge(t)&&he(m,t,!0)){var n=ce.getSelection(),r=ue.createRange();r.setStartBefore(t),r.setEndAfter(t),n.removeAllRanges(),n.addRange(r)}ne(e),K&&K()}),fe(m,"dblclick",function(e){ne(e)}),fe(m,"selectionchange",function(e){ne(e)}),o&&fe(m,"contextmenu",function(e){ne(e,!0),de(e)});var oe=function(e,t,n){if(me(0,J),m.focus(),!ke(m,n))return!1;try{return!(ue.queryCommandSupported&&!ue.queryCommandSupported(e))&&ue.execCommand(e,!1,t)}catch(e){}return!1};function ie(e){if(!e)return!1;var t=[];if(e.items)for(var n=e.items,r=0;r<n.length;++r){var o=n[r];if(o.type.match(/^image\//)){var i=o.getAsFile();t.push(i)}}else if(e.files){var a=e.files;for(r=0;r<a.length;++r)t.push(a[r])}return!!t.length&&(M(t,function(e,t){oe("insertImage",t)}),!0)}if(fe(m,"paste",function(e){ie(e.clipboardData)&&de(e)}),fe(m,"drop",function(e){ie(e.dataTransfer)&&de(e)}),L=function(e){K&&K(),e?(Ce(),J=null):J&&(J=ve())},f={sync:function(){return Y&&Y(),this},getHTML:function(){return m.innerHTML},setHTML:function(e){return m.innerHTML=e||"",L(!0),this},getSelectedHTML:function(){return me(0,J),ke(m)?function(e){if(be())return null;var t=ce.getSelection();if(t.rangeCount){for(var n=ue.createElement("div"),r=t.rangeCount,o=0;o<r;++o){var i=t.getRangeAt(o).cloneContents();n.appendChild(i)}return n.innerHTML}return null}():null},collapseSelection:function(){return Ce(),J=null,this},expandSelection:function(e,t){return me(0,J),ke(m)&&(function(e,t,n){var r=ce.getSelection();if(r.modify){for(var o=0;o<t;++o)r.modify("extend","backward","character");for(o=0;o<n;++o)r.modify("extend","forward","character")}else{var i=r.getRangeAt(0);i.setStart(i.startContainer,i.startOffset-t),i.setEnd(i.endContainer,i.endOffset+n),r.removeAllRanges(),r.addRange(i)}}(0,e,t),J=ve()),this},openPopup:function(){return J||(J=ve()),function(){if(Q)return Q;fe(ce,"mousedown",Z,!0),Q=ue.createElement("DIV");var e=m.parentNode,t=m.nextSibling;return t?e.insertBefore(Q,t):e.appendChild(Q),z(),Q}()},activePopup:function(){return Q},closePopup:function(){return ee(),this},removeFormat:function(){return oe("removeFormat"),oe("unlink"),L(),this},bold:function(){return oe("bold"),L(),this},italic:function(){return oe("italic"),L(),this},underline:function(){return oe("underline"),L(),this},strikethrough:function(){return oe("strikeThrough"),L(),this},forecolor:function(e){return oe("foreColor",e),L(),this},highlight:function(e){return oe("hiliteColor",e)||oe("backColor",e),L(),this},fontName:function(e){return oe("fontName",e),L(),this},fontSize:function(e){return oe("fontSize",e),L(),this},subscript:function(){return oe("subscript"),L(),this},superscript:function(){return oe("superscript"),L(),this},insertLink:function(e){return oe("createLink",e),L(!0),this},insertImage:function(e){return oe("insertImage",e,!0),L(!0),this},insertHTML:function(e){return oe("insertHTML",e,!0)||(me(0,J),ke(m,!0),function(e,t){var n=ce.getSelection();if(n.getRangeAt&&n.rangeCount){var r=n.getRangeAt(0),o=ue.createElement("div");o.innerHTML=t;for(var i,a,l=ue.createDocumentFragment();i=o.firstChild;)a=l.appendChild(i);he(e,r.commonAncestorContainer)?(r.deleteContents(),r.insertNode(l)):e.appendChild(l),a&&((r=r.cloneRange()).setStartAfter(a),r.collapse(!0),n.removeAllRanges(),n.addRange(r))}}(m,e)),L(!0),this},orderedList:function(){return oe("insertOrderedList"),L(),this},unorderedList:function(){return oe("insertUnorderedList"),L(),this}},r){var ae=ue.createElement("div");if(g(ae,"toolbar"),d)g(ae,"toolbar-top"),p.insertBefore(ae,p.firstChild);else if(a)g(ae,"toolbar-bottom"),p.appendChild(ae);else{var le=ue.createElement("div");g(le,"toolbar-auto"),p.appendChild(le),le.appendChild(ae)}D(ae,null,r,s)}return f};"undefined"!=typeof module&&void 0!==module.exports?module.exports=t:ce.wysiwyg=t}(window,document);
"object"==typeof navigator&&function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Plyr",t):e.Plyr=t()}(this,function(){"use strict";!function(){if("undefined"!=typeof window)try{var e=new window.CustomEvent("test",{cancelable:!0});if(e.preventDefault(),!0!==e.defaultPrevented)throw new Error("Could not prevent default")}catch(e){var t=function(e,t){var n,i;return t=t||{bubbles:!1,cancelable:!1,detail:void 0},(n=document.createEvent("CustomEvent")).initCustomEvent(e,t.bubbles,t.cancelable,t.detail),i=n.preventDefault,n.preventDefault=function(){i.call(this);try{Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}catch(e){this.defaultPrevented=!0}},n};t.prototype=window.Event.prototype,window.CustomEvent=t}}();var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e,t){return e(t={exports:{}},t.exports),t.exports}!function(e){var t=function(){try{return!!Symbol.iterator}catch(e){return!1}}(),n=function(e){var n={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t&&(n[Symbol.iterator]=function(){return n}),n},i=function(e){return encodeURIComponent(e).replace(/%20/g,"+")},r=function(e){return decodeURIComponent(e).replace(/\+/g," ")};"URLSearchParams"in e&&"a=1"===new URLSearchParams("?a=1").toString()||function(){var r=function(e){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var t=typeof e;if("undefined"===t);else if("string"===t)""!==e&&this._fromString(e);else if(e instanceof r){var n=this;e.forEach(function(e,t){n.append(t,e)})}else{if(null===e||"object"!==t)throw new TypeError("Unsupported input's type for URLSearchParams");if("[object Array]"===Object.prototype.toString.call(e))for(var i=0;i<e.length;i++){var a=e[i];if("[object Array]"!==Object.prototype.toString.call(a)&&2===a.length)throw new TypeError("Expected [string, any] as entry at index "+i+" of URLSearchParams's input");this.append(a[0],a[1])}else for(var o in e)e.hasOwnProperty(o)&&this.append(o,e[o])}},a=r.prototype;a.append=function(e,t){e in this._entries?this._entries[e].push(String(t)):this._entries[e]=[String(t)]},a.delete=function(e){delete this._entries[e]},a.get=function(e){return e in this._entries?this._entries[e][0]:null},a.getAll=function(e){return e in this._entries?this._entries[e].slice(0):[]},a.has=function(e){return e in this._entries},a.set=function(e,t){this._entries[e]=[String(t)]},a.forEach=function(e,t){var n;for(var i in this._entries)if(this._entries.hasOwnProperty(i)){n=this._entries[i];for(var r=0;r<n.length;r++)e.call(t,n[r],i,this)}},a.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),n(e)},a.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),n(e)},a.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),n(e)},t&&(a[Symbol.iterator]=a.entries),a.toString=function(){var e=[];return this.forEach(function(t,n){e.push(i(n)+"="+i(t))}),e.join("&")},e.URLSearchParams=r}();var a=URLSearchParams.prototype;"function"!=typeof a.sort&&(a.sort=function(){var e=this,t=[];this.forEach(function(n,i){t.push([i,n]),e._entries||e.delete(i)}),t.sort(function(e,t){return e[0]<t[0]?-1:e[0]>t[0]?1:0}),e._entries&&(e._entries={});for(var n=0;n<t.length;n++)this.append(t[n][0],t[n][1])}),"function"!=typeof a._fromString&&Object.defineProperty(a,"_fromString",{enumerable:!1,configurable:!1,writable:!1,value:function(e){if(this._entries)this._entries={};else{var t=[];this.forEach(function(e,n){t.push(n)});for(var n=0;n<t.length;n++)this.delete(t[n])}var i,a=(e=e.replace(/^\?/,"")).split("&");for(n=0;n<a.length;n++)i=a[n].split("="),this.append(r(i[0]),i.length>1?r(i[1]):"")}})}(void 0!==e?e:"undefined"!=typeof window?window:"undefined"!=typeof self?self:e),function(e){if(function(){try{var e=new URL("b","http://a");return e.pathname="c%20d","http://a/c%20d"===e.href&&e.searchParams}catch(e){return!1}}()||function(){var t=e.URL,n=function(t,n){"string"!=typeof t&&(t=String(t));var i,r=document;if(n&&(void 0===e.location||n!==e.location.href)){(i=(r=document.implementation.createHTMLDocument("")).createElement("base")).href=n,r.head.appendChild(i);try{if(0!==i.href.indexOf(n))throw new Error(i.href)}catch(e){throw new Error("URL unable to set base "+n+" due to "+e)}}var a=r.createElement("a");if(a.href=t,i&&(r.body.appendChild(a),a.href=a.href),":"===a.protocol||!/:/.test(a.href))throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:a});var o=new URLSearchParams(this.search),s=!0,l=!0,c=this;["append","delete","set"].forEach(function(e){var t=o[e];o[e]=function(){t.apply(o,arguments),s&&(l=!1,c.search=o.toString(),l=!0)}}),Object.defineProperty(this,"searchParams",{value:o,enumerable:!0});var u=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==u&&(u=this.search,l&&(s=!1,this.searchParams._fromString(this.search),s=!0))}})},i=n.prototype;["hash","host","hostname","port","protocol"].forEach(function(e){!function(e){Object.defineProperty(i,e,{get:function(){return this._anchorElement[e]},set:function(t){this._anchorElement[e]=t},enumerable:!0})}(e)}),Object.defineProperty(i,"search",{get:function(){return this._anchorElement.search},set:function(e){this._anchorElement.search=e,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(i,{toString:{get:function(){var e=this;return function(){return e.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(e){this._anchorElement.href=e,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(e){this._anchorElement.pathname=e},enumerable:!0},origin:{get:function(){var e={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],t=this._anchorElement.port!=e&&""!==this._anchorElement.port;return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(t?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(e){},enumerable:!0},username:{get:function(){return""},set:function(e){},enumerable:!0}}),n.createObjectURL=function(e){return t.createObjectURL.apply(t,arguments)},n.revokeObjectURL=function(e){return t.revokeObjectURL.apply(t,arguments)},e.URL=n}(),void 0!==e.location&&!("origin"in e.location)){var t=function(){return e.location.protocol+"//"+e.location.hostname+(e.location.port?":"+e.location.port:"")};try{Object.defineProperty(e.location,"origin",{get:t,enumerable:!0})}catch(n){setInterval(function(){e.location.origin=t()},100)}}}(void 0!==e?e:"undefined"!=typeof window?window:"undefined"!=typeof self?self:e);var n=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e},i=function(e,t,i){if(n(e),void 0===t)return e;switch(i){case 1:return function(n){return e.call(t,n)};case 2:return function(n,i){return e.call(t,n,i)};case 3:return function(n,i,r){return e.call(t,n,i,r)}}return function(){return e.apply(t,arguments)}},r=t(function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)}),a=t(function(e){var t=e.exports={version:"2.6.1"};"number"==typeof __e&&(__e=t)}),o=(a.version,function(e){return"object"==typeof e?null!==e:"function"==typeof e}),s=function(e){if(!o(e))throw TypeError(e+" is not an object!");return e},l=function(e){try{return!!e()}catch(e){return!0}},c=!l(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),u=r.document,h=o(u)&&o(u.createElement),d=function(e){return h?u.createElement(e):{}},f=!c&&!l(function(){return 7!=Object.defineProperty(d("div"),"a",{get:function(){return 7}}).a}),p=function(e,t){if(!o(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!o(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!o(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!o(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")},m=Object.defineProperty,g={f:c?Object.defineProperty:function(e,t,n){if(s(e),t=p(t,!0),s(n),f)try{return m(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},y=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},v=c?function(e,t,n){return g.f(e,t,y(1,n))}:function(e,t,n){return e[t]=n,e},b={}.hasOwnProperty,w=function(e,t){return b.call(e,t)},k=0,T=Math.random(),E=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++k+T).toString(36))},S=t(function(e){var t=E("src"),n=Function.toString,i=(""+n).split("toString");a.inspectSource=function(e){return n.call(e)},(e.exports=function(e,n,a,o){var s="function"==typeof a;s&&(w(a,"name")||v(a,"name",n)),e[n]!==a&&(s&&(w(a,t)||v(a,t,e[n]?""+e[n]:i.join(String(n)))),e===r?e[n]=a:o?e[n]?e[n]=a:v(e,n,a):(delete e[n],v(e,n,a)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[t]||n.call(this)})}),A=function(e,t,n){var o,s,l,c,u=e&A.F,h=e&A.G,d=e&A.S,f=e&A.P,p=e&A.B,m=h?r:d?r[t]||(r[t]={}):(r[t]||{}).prototype,g=h?a:a[t]||(a[t]={}),y=g.prototype||(g.prototype={});for(o in h&&(n=t),n)l=((s=!u&&m&&void 0!==m[o])?m:n)[o],c=p&&s?i(l,r):f&&"function"==typeof l?i(Function.call,l):l,m&&S(m,o,l,e&A.U),g[o]!=l&&v(g,o,c),f&&y[o]!=l&&(y[o]=l)};r.core=a,A.F=1,A.G=2,A.S=4,A.P=8,A.B=16,A.W=32,A.U=64,A.R=128;var P=A,C=function(e){if(null==e)throw TypeError("Can't call method on  "+e);return e},_=function(e){return Object(C(e))},x=function(e,t,n,i){try{return i?t(s(n)[0],n[1]):t(n)}catch(t){var r=e.return;throw void 0!==r&&s(r.call(e)),t}},I={},N=t(function(e){var t=r["__core-js_shared__"]||(r["__core-js_shared__"]={});(e.exports=function(e,n){return t[e]||(t[e]=void 0!==n?n:{})})("versions",[]).push({version:a.version,mode:"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})}),M=t(function(e){var t=N("wks"),n=r.Symbol,i="function"==typeof n;(e.exports=function(e){return t[e]||(t[e]=i&&n[e]||(i?n:E)("Symbol."+e))}).store=t}),O=M("iterator"),L=Array.prototype,j=function(e){return void 0!==e&&(I.Array===e||L[O]===e)},R=Math.ceil,D=Math.floor,F=function(e){return isNaN(e=+e)?0:(e>0?D:R)(e)},q=Math.min,H=function(e){return e>0?q(F(e),9007199254740991):0},V=function(e,t,n){t in e?g.f(e,t,y(0,n)):e[t]=n},B={}.toString,U=function(e){return B.call(e).slice(8,-1)},W=M("toStringTag"),z="Arguments"==U(function(){return arguments}()),K=function(e){var t,n,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),W))?n:z?U(t):"Object"==(i=U(t))&&"function"==typeof t.callee?"Arguments":i},Y=M("iterator"),G=a.getIteratorMethod=function(e){if(null!=e)return e[Y]||e["@@iterator"]||I[K(e)]},J=M("iterator"),$=!1;try{[7][J]().return=function(){$=!0}}catch(e){}var Q=function(e,t){if(!t&&!$)return!1;var n=!1;try{var i=[7],r=i[J]();r.next=function(){return{done:n=!0}},i[J]=function(){return r},e(i)}catch(e){}return n};P(P.S+P.F*!Q(function(e){}),"Array",{from:function(e){var t,n,r,a,o=_(e),s="function"==typeof this?this:Array,l=arguments.length,c=l>1?arguments[1]:void 0,u=void 0!==c,h=0,d=G(o);if(u&&(c=i(c,l>2?arguments[2]:void 0,2)),null==d||s==Array&&j(d))for(n=new s(t=H(o.length));t>h;h++)V(n,h,u?c(o[h],h):o[h]);else for(a=d.call(o),n=new s;!(r=a.next()).done;h++)V(n,h,u?x(a,c,[r.value,h],!0):r.value);return n.length=h,n}});var X=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==U(e)?e.split(""):Object(e)},Z=Array.isArray||function(e){return"Array"==U(e)},ee=M("species"),te=function(e,t){return new(function(e){var t;return Z(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!Z(t.prototype)||(t=void 0),o(t)&&null===(t=t[ee])&&(t=void 0)),void 0===t?Array:t}(e))(t)},ne=function(e,t){var n=1==e,r=2==e,a=3==e,o=4==e,s=6==e,l=5==e||s,c=t||te;return function(t,u,h){for(var d,f,p=_(t),m=X(p),g=i(u,h,3),y=H(m.length),v=0,b=n?c(t,y):r?c(t,0):void 0;y>v;v++)if((l||v in m)&&(f=g(d=m[v],v,p),e))if(n)b[v]=f;else if(f)switch(e){case 3:return!0;case 5:return d;case 6:return v;case 2:b.push(d)}else if(o)return!1;return s?-1:a||o?o:b}},ie=M("unscopables"),re=Array.prototype;null==re[ie]&&v(re,ie,{});var ae=function(e){re[ie][e]=!0},oe=ne(5),se=!0;"find"in[]&&Array(1).find(function(){se=!1}),P(P.P+P.F*se,"Array",{find:function(e){return oe(this,e,arguments.length>1?arguments[1]:void 0)}}),ae("find");var le={f:{}.propertyIsEnumerable},ce=function(e){return X(C(e))},ue=Object.getOwnPropertyDescriptor,he={f:c?ue:function(e,t){if(e=ce(e),t=p(t,!0),f)try{return ue(e,t)}catch(e){}if(w(e,t))return y(!le.f.call(e,t),e[t])}},de=function(e,t){if(s(e),!o(t)&&null!==t)throw TypeError(t+": can't set as prototype!")},fe={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,n){try{(n=i(Function.call,he.f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,i){return de(e,i),t?e.__proto__=i:n(e,i),e}}({},!1):void 0),check:de}.set,pe=function(e,t,n){var i,r=t.constructor;return r!==n&&"function"==typeof r&&(i=r.prototype)!==n.prototype&&o(i)&&fe&&fe(e,i),e},me=Math.max,ge=Math.min,ye=function(e){return function(t,n,i){var r,a=ce(t),o=H(a.length),s=function(e,t){return(e=F(e))<0?me(e+t,0):ge(e,t)}(i,o);if(e&&n!=n){for(;o>s;)if((r=a[s++])!=r)return!0}else for(;o>s;s++)if((e||s in a)&&a[s]===n)return e||s||0;return!e&&-1}},ve=N("keys"),be=function(e){return ve[e]||(ve[e]=E(e))},we=ye(!1),ke=be("IE_PROTO"),Te=function(e,t){var n,i=ce(e),r=0,a=[];for(n in i)n!=ke&&w(i,n)&&a.push(n);for(;t.length>r;)w(i,n=t[r++])&&(~we(a,n)||a.push(n));return a},Ee="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),Se=Ee.concat("length","prototype"),Ae={f:Object.getOwnPropertyNames||function(e){return Te(e,Se)}},Pe="\t\n\v\f\r   ᠎             　\u2028\u2029\ufeff",Ce="["+Pe+"]",_e=RegExp("^"+Ce+Ce+"*"),xe=RegExp(Ce+Ce+"*$"),Ie=function(e,t,n){var i={},r=l(function(){return!!Pe[e]()||"​"!="​"[e]()}),a=i[e]=r?t(Ne):Pe[e];n&&(i[n]=a),P(P.P+P.F*r,"String",i)},Ne=Ie.trim=function(e,t){return e=String(C(e)),1&t&&(e=e.replace(_e,"")),2&t&&(e=e.replace(xe,"")),e},Me=Ie,Oe=Object.keys||function(e){return Te(e,Ee)},Le=c?Object.defineProperties:function(e,t){s(e);for(var n,i=Oe(t),r=i.length,a=0;r>a;)g.f(e,n=i[a++],t[n]);return e},je=r.document,Re=je&&je.documentElement,De=be("IE_PROTO"),Fe=function(){},qe=function(){var e,t=d("iframe"),n=Ee.length;for(t.style.display="none",Re.appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),qe=e.F;n--;)delete qe.prototype[Ee[n]];return qe()},He=Object.create||function(e,t){var n;return null!==e?(Fe.prototype=s(e),n=new Fe,Fe.prototype=null,n[De]=e):n=qe(),void 0===t?n:Le(n,t)},Ve=Ae.f,Be=he.f,Ue=g.f,We=Me.trim,ze=r.Number,Ke=ze,Ye=ze.prototype,Ge="Number"==U(He(Ye)),Je="trim"in String.prototype,$e=function(e){var t=p(e,!1);if("string"==typeof t&&t.length>2){var n,i,r,a=(t=Je?t.trim():We(t,3)).charCodeAt(0);if(43===a||45===a){if(88===(n=t.charCodeAt(2))||120===n)return NaN}else if(48===a){switch(t.charCodeAt(1)){case 66:case 98:i=2,r=49;break;case 79:case 111:i=8,r=55;break;default:return+t}for(var o,s=t.slice(2),l=0,c=s.length;l<c;l++)if((o=s.charCodeAt(l))<48||o>r)return NaN;return parseInt(s,i)}}return+t};if(!ze(" 0o1")||!ze("0b1")||ze("+0x1")){ze=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof ze&&(Ge?l(function(){Ye.valueOf.call(n)}):"Number"!=U(n))?pe(new Ke($e(t)),n,ze):$e(t)};for(var Qe,Xe=c?Ve(Ke):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),Ze=0;Xe.length>Ze;Ze++)w(Ke,Qe=Xe[Ze])&&!w(ze,Qe)&&Ue(ze,Qe,Be(Ke,Qe));ze.prototype=Ye,Ye.constructor=ze,S(r,"Number",ze)}!function(e,t){var n=(a.Object||{})[e]||Object[e],i={};i[e]=t(n),P(P.S+P.F*l(function(){n(1)}),"Object",i)}("keys",function(){return function(e){return Oe(_(e))}});var et=M("match"),tt=function(e){var t;return o(e)&&(void 0!==(t=e[et])?!!t:"RegExp"==U(e))},nt=function(e,t,n){if(tt(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(C(e))},it=M("match"),rt=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[it]=!1,!"/./"[e](t)}catch(e){}}return!0};P(P.P+P.F*rt("includes"),"String",{includes:function(e){return!!~nt(this,e,"includes").indexOf(e,arguments.length>1?arguments[1]:void 0)}});var at=ye(!0);P(P.P,"Array",{includes:function(e){return at(this,e,arguments.length>1?arguments[1]:void 0)}}),ae("includes");var ot=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},st=RegExp.prototype.exec,lt=function(e,t){var n=e.exec;if("function"==typeof n){var i=n.call(e,t);if("object"!=typeof i)throw new TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==K(e))throw new TypeError("RegExp#exec called on incompatible receiver");return st.call(e,t)},ct=function(){var e=s(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},ut=RegExp.prototype.exec,ht=String.prototype.replace,dt=ut,ft=function(){var e=/a/,t=/b*/g;return ut.call(e,"a"),ut.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),pt=void 0!==/()??/.exec("")[1];(ft||pt)&&(dt=function(e){var t,n,i,r,a=this;return pt&&(n=new RegExp("^"+a.source+"$(?!\\s)",ct.call(a))),ft&&(t=a.lastIndex),i=ut.call(a,e),ft&&i&&(a.lastIndex=a.global?i.index+i[0].length:t),pt&&i&&i.length>1&&ht.call(i[0],n,function(){for(r=1;r<arguments.length-2;r++)void 0===arguments[r]&&(i[r]=void 0)}),i});var mt=dt;P({target:"RegExp",proto:!0,forced:mt!==/./.exec},{exec:mt});var gt=M("species"),yt=!l(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}),vt=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}(),bt=function(e,t,n){var i=M(e),r=!l(function(){var t={};return t[i]=function(){return 7},7!=""[e](t)}),a=r?!l(function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[gt]=function(){return n}),n[i](""),!t}):void 0;if(!r||!a||"replace"===e&&!yt||"split"===e&&!vt){var o=/./[i],s=n(C,i,""[e],function(e,t,n,i,a){return t.exec===mt?r&&!a?{done:!0,value:o.call(t,n,i)}:{done:!0,value:e.call(n,t,i)}:{done:!1}}),c=s[0],u=s[1];S(String.prototype,e,c),v(RegExp.prototype,i,2==t?function(e,t){return u.call(e,this,t)}:function(e){return u.call(e,this)})}};bt("search",1,function(e,t,n,i){return[function(n){var i=e(this),r=null==n?void 0:n[t];return void 0!==r?r.call(n,i):new RegExp(n)[t](String(i))},function(e){var t=i(n,e,this);if(t.done)return t.value;var r=s(e),a=String(this),o=r.lastIndex;ot(o,0)||(r.lastIndex=0);var l=lt(r,a);return ot(r.lastIndex,o)||(r.lastIndex=o),null===l?-1:l.index}]}),c&&"g"!=/./g.flags&&g.f(RegExp.prototype,"flags",{configurable:!0,get:ct});var wt=/./.toString,kt=function(e){S(RegExp.prototype,"toString",e,!0)};l(function(){return"/a/b"!=wt.call({source:"a",flags:"b"})})?kt(function(){var e=s(this);return"/".concat(e.source,"/","flags"in e?e.flags:!c&&e instanceof RegExp?ct.call(e):void 0)}):"toString"!=wt.name&&kt(function(){return wt.call(this)});var Tt=function(e,t){return{value:t,done:!!e}},Et=g.f,St=M("toStringTag"),At=function(e,t,n){e&&!w(e=n?e:e.prototype,St)&&Et(e,St,{configurable:!0,value:t})},Pt={};v(Pt,M("iterator"),function(){return this});var Ct=function(e,t,n){e.prototype=He(Pt,{next:y(1,n)}),At(e,t+" Iterator")},_t=be("IE_PROTO"),xt=Object.prototype,It=Object.getPrototypeOf||function(e){return e=_(e),w(e,_t)?e[_t]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?xt:null},Nt=M("iterator"),Mt=!([].keys&&"next"in[].keys()),Ot=function(){return this},Lt=function(e,t,n,i,r,a,o){Ct(n,t,i);var s,l,c,u=function(e){if(!Mt&&e in p)return p[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},h=t+" Iterator",d="values"==r,f=!1,p=e.prototype,m=p[Nt]||p["@@iterator"]||r&&p[r],g=m||u(r),y=r?d?u("entries"):g:void 0,b="Array"==t&&p.entries||m;if(b&&(c=It(b.call(new e)))!==Object.prototype&&c.next&&(At(c,h,!0),"function"!=typeof c[Nt]&&v(c,Nt,Ot)),d&&m&&"values"!==m.name&&(f=!0,g=function(){return m.call(this)}),(Mt||f||!p[Nt])&&v(p,Nt,g),I[t]=g,I[h]=Ot,r)if(s={values:d?g:u("values"),keys:a?g:u("keys"),entries:y},o)for(l in s)l in p||S(p,l,s[l]);else P(P.P+P.F*(Mt||f),t,s);return s},jt=Lt(Array,"Array",function(e,t){this._t=ce(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,Tt(1)):Tt(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values");I.Arguments=I.Array,ae("keys"),ae("values"),ae("entries");for(var Rt=M("iterator"),Dt=M("toStringTag"),Ft=I.Array,qt={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},Ht=Oe(qt),Vt=0;Vt<Ht.length;Vt++){var Bt,Ut=Ht[Vt],Wt=qt[Ut],zt=r[Ut],Kt=zt&&zt.prototype;if(Kt&&(Kt[Rt]||v(Kt,Rt,Ft),Kt[Dt]||v(Kt,Dt,Ut),I[Ut]=Ft,Wt))for(Bt in jt)Kt[Bt]||S(Kt,Bt,jt[Bt],!0)}var Yt=function(e){return function(t,n){var i,r,a=String(C(t)),o=F(n),s=a.length;return o<0||o>=s?e?"":void 0:(i=a.charCodeAt(o))<55296||i>56319||o+1===s||(r=a.charCodeAt(o+1))<56320||r>57343?e?a.charAt(o):i:e?a.slice(o,o+2):r-56320+(i-55296<<10)+65536}},Gt=Yt(!0);Lt(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=Gt(t,n),this._i+=e.length,{value:e,done:!1})});var Jt=t(function(e){var t=E("meta"),n=g.f,i=0,r=Object.isExtensible||function(){return!0},a=!l(function(){return r(Object.preventExtensions({}))}),s=function(e){n(e,t,{value:{i:"O"+ ++i,w:{}}})},c=e.exports={KEY:t,NEED:!1,fastKey:function(e,n){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!w(e,t)){if(!r(e))return"F";if(!n)return"E";s(e)}return e[t].i},getWeak:function(e,n){if(!w(e,t)){if(!r(e))return!0;if(!n)return!1;s(e)}return e[t].w},onFreeze:function(e){return a&&c.NEED&&r(e)&&!w(e,t)&&s(e),e}}}),$t=(Jt.KEY,Jt.NEED,Jt.fastKey,Jt.getWeak,Jt.onFreeze,{f:Object.getOwnPropertySymbols}),Qt=Object.assign,Xt=!Qt||l(function(){var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach(function(e){t[e]=e}),7!=Qt({},e)[n]||Object.keys(Qt({},t)).join("")!=i})?function(e,t){for(var n=_(e),i=arguments.length,r=1,a=$t.f,o=le.f;i>r;)for(var s,l=X(arguments[r++]),c=a?Oe(l).concat(a(l)):Oe(l),u=c.length,h=0;u>h;)o.call(l,s=c[h++])&&(n[s]=l[s]);return n}:Qt,Zt=function(e,t,n){for(var i in t)S(e,i,t[i],n);return e},en=function(e,t,n,i){if(!(e instanceof t)||void 0!==i&&i in e)throw TypeError(n+": incorrect invocation!");return e},tn=t(function(e){var t={},n={},r=e.exports=function(e,r,a,o,l){var c,u,h,d,f=l?function(){return e}:G(e),p=i(a,o,r?2:1),m=0;if("function"!=typeof f)throw TypeError(e+" is not iterable!");if(j(f)){for(c=H(e.length);c>m;m++)if((d=r?p(s(u=e[m])[0],u[1]):p(e[m]))===t||d===n)return d}else for(h=f.call(e);!(u=h.next()).done;)if((d=x(h,p,u.value,r))===t||d===n)return d};r.BREAK=t,r.RETURN=n}),nn=function(e,t){if(!o(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e},rn=Jt.getWeak,an=ne(5),on=ne(6),sn=0,ln=function(e){return e._l||(e._l=new cn)},cn=function(){this.a=[]},un=function(e,t){return an(e.a,function(e){return e[0]===t})};cn.prototype={get:function(e){var t=un(this,e);if(t)return t[1]},has:function(e){return!!un(this,e)},set:function(e,t){var n=un(this,e);n?n[1]=t:this.a.push([e,t])},delete:function(e){var t=on(this.a,function(t){return t[0]===e});return~t&&this.a.splice(t,1),!!~t}};var hn={getConstructor:function(e,t,n,i){var r=e(function(e,a){en(e,r,t,"_i"),e._t=t,e._i=sn++,e._l=void 0,null!=a&&tn(a,n,e[i],e)});return Zt(r.prototype,{delete:function(e){if(!o(e))return!1;var n=rn(e);return!0===n?ln(nn(this,t)).delete(e):n&&w(n,this._i)&&delete n[this._i]},has:function(e){if(!o(e))return!1;var n=rn(e);return!0===n?ln(nn(this,t)).has(e):n&&w(n,this._i)}}),r},def:function(e,t,n){var i=rn(s(t),!0);return!0===i?ln(e).set(t,n):i[e._i]=n,e},ufstore:ln};t(function(e){var t,n=ne(0),i=Jt.getWeak,a=Object.isExtensible,s=hn.ufstore,c={},u=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},h={get:function(e){if(o(e)){var t=i(e);return!0===t?s(nn(this,"WeakMap")).get(e):t?t[this._i]:void 0}},set:function(e,t){return hn.def(nn(this,"WeakMap"),e,t)}},d=e.exports=function(e,t,n,i,a,s){var c=r[e],u=c,h=a?"set":"add",d=u&&u.prototype,f={},p=function(e){var t=d[e];S(d,e,"delete"==e?function(e){return!(s&&!o(e))&&t.call(this,0===e?0:e)}:"has"==e?function(e){return!(s&&!o(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return s&&!o(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})};if("function"==typeof u&&(s||d.forEach&&!l(function(){(new u).entries().next()}))){var m=new u,g=m[h](s?{}:-0,1)!=m,y=l(function(){m.has(1)}),v=Q(function(e){new u(e)}),b=!s&&l(function(){for(var e=new u,t=5;t--;)e[h](t,t);return!e.has(-0)});v||((u=t(function(t,n){en(t,u,e);var i=pe(new c,t,u);return null!=n&&tn(n,a,i[h],i),i})).prototype=d,d.constructor=u),(y||b)&&(p("delete"),p("has"),a&&p("get")),(b||g)&&p(h),s&&d.clear&&delete d.clear}else u=i.getConstructor(t,e,a,h),Zt(u.prototype,n),Jt.NEED=!0;return At(u,e),f[e]=u,P(P.G+P.W+P.F*(u!=c),f),s||i.setStrong(u,e,a),u}("WeakMap",u,h,hn,!0,!0);l(function(){return 7!=(new d).set((Object.freeze||Object)(c),7).get(c)})&&(t=hn.getConstructor(u,"WeakMap"),Xt(t.prototype,h),Jt.NEED=!0,n(["delete","has","get","set"],function(e){var n=d.prototype,i=n[e];S(n,e,function(n,r){if(o(n)&&!a(n)){this._f||(this._f=new t);var s=this._f[e](n,r);return"set"==e?this:s}return i.call(this,n,r)})}))});function dn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fn(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function pn(e,t,n){return t&&fn(e.prototype,t),n&&fn(e,n),e}function mn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);i=!0);}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function yn(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}P(P.S+P.F,"Object",{assign:Xt});var vn=M("species"),bn=function(e,t){var i,r=s(e).constructor;return void 0===r||null==(i=s(r)[vn])?t:n(i)},wn=Yt(!0),kn=function(e,t,n){return t+(n?wn(e,t).length:1)},Tn=Math.min,En=[].push,Sn=!!function(){try{return new RegExp("x","y")}catch(e){}}();bt("split",2,function(e,t,n,i){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,t){var i=String(this);if(void 0===e&&0===t)return[];if(!tt(e))return n.call(i,e,t);for(var r,a,o,s=[],l=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),c=0,u=void 0===t?4294967295:t>>>0,h=new RegExp(e.source,l+"g");(r=mt.call(h,i))&&!((a=h.lastIndex)>c&&(s.push(i.slice(c,r.index)),r.length>1&&r.index<i.length&&En.apply(s,r.slice(1)),o=r[0].length,c=a,s.length>=u));)h.lastIndex===r.index&&h.lastIndex++;return c===i.length?!o&&h.test("")||s.push(""):s.push(i.slice(c)),s.length>u?s.slice(0,u):s}:"0".split(void 0,0).length?function(e,t){return void 0===e&&0===t?[]:n.call(this,e,t)}:n,[function(n,i){var a=e(this),o=null==n?void 0:n[t];return void 0!==o?o.call(n,a,i):r.call(String(a),n,i)},function(e,t){var a=i(r,e,this,t,r!==n);if(a.done)return a.value;var o=s(e),l=String(this),c=bn(o,RegExp),u=o.unicode,h=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(Sn?"y":"g"),d=new c(Sn?o:"^(?:"+o.source+")",h),f=void 0===t?4294967295:t>>>0;if(0===f)return[];if(0===l.length)return null===lt(d,l)?[l]:[];for(var p=0,m=0,g=[];m<l.length;){d.lastIndex=Sn?m:0;var y,v=lt(d,Sn?l:l.slice(m));if(null===v||(y=Tn(H(d.lastIndex+(Sn?0:m)),l.length))===p)m=kn(l,m,u);else{if(g.push(l.slice(p,m)),g.length===f)return g;for(var b=1;b<=v.length-1;b++)if(g.push(v[b]),g.length===f)return g;m=p=y}}return g.push(l.slice(p)),g}]});var An=le.f,Pn=function(e){return function(t){for(var n,i=ce(t),r=Oe(i),a=r.length,o=0,s=[];a>o;)An.call(i,n=r[o++])&&s.push(e?[n,i[n]]:i[n]);return s}},Cn=Pn(!0);P(P.S,"Object",{entries:function(e){return Cn(e)}});var _n=Pn(!1);P(P.S,"Object",{values:function(e){return _n(e)}});var xn=Math.max,In=Math.min,Nn=Math.floor,Mn=/\$([$&`']|\d\d?|<[^>]*>)/g,On=/\$([$&`']|\d\d?)/g;bt("replace",2,function(e,t,n,i){return[function(i,r){var a=e(this),o=null==i?void 0:i[t];return void 0!==o?o.call(i,a,r):n.call(String(a),i,r)},function(e,t){var a=i(n,e,this,t);if(a.done)return a.value;var o=s(e),l=String(this),c="function"==typeof t;c||(t=String(t));var u=o.global;if(u){var h=o.unicode;o.lastIndex=0}for(var d=[];;){var f=lt(o,l);if(null===f)break;if(d.push(f),!u)break;""===String(f[0])&&(o.lastIndex=kn(l,H(o.lastIndex),h))}for(var p,m="",g=0,y=0;y<d.length;y++){f=d[y];for(var v=String(f[0]),b=xn(In(F(f.index),l.length),0),w=[],k=1;k<f.length;k++)w.push(void 0===(p=f[k])?p:String(p));var T=f.groups;if(c){var E=[v].concat(w,b,l);void 0!==T&&E.push(T);var S=String(t.apply(void 0,E))}else S=r(v,l,b,w,T,t);b>=g&&(m+=l.slice(g,b)+S,g=b+v.length)}return m+l.slice(g)}];function r(e,t,i,r,a,o){var s=i+e.length,l=r.length,c=On;return void 0!==a&&(a=_(a),c=Mn),n.call(o,c,function(n,o){var c;switch(o.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,i);case"'":return t.slice(s);case"<":c=a[o.slice(1,-1)];break;default:var u=+o;if(0===u)return o;if(u>l){var h=Nn(u/10);return 0===h?o:h<=l?void 0===r[h-1]?o.charAt(1):r[h-1]+o.charAt(1):o}c=r[u-1]}return void 0===c?"":c})}});var Ln,jn,Rn,Dn=r.process,Fn=r.setImmediate,qn=r.clearImmediate,Hn=r.MessageChannel,Vn=r.Dispatch,Bn=0,Un={},Wn=function(){var e=+this;if(Un.hasOwnProperty(e)){var t=Un[e];delete Un[e],t()}},zn=function(e){Wn.call(e.data)};Fn&&qn||(Fn=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return Un[++Bn]=function(){!function(e,t,n){var i=void 0===n;switch(t.length){case 0:return i?e():e.call(n);case 1:return i?e(t[0]):e.call(n,t[0]);case 2:return i?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return i?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return i?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}e.apply(n,t)}("function"==typeof e?e:Function(e),t)},Ln(Bn),Bn},qn=function(e){delete Un[e]},"process"==U(Dn)?Ln=function(e){Dn.nextTick(i(Wn,e,1))}:Vn&&Vn.now?Ln=function(e){Vn.now(i(Wn,e,1))}:Hn?(Rn=(jn=new Hn).port2,jn.port1.onmessage=zn,Ln=i(Rn.postMessage,Rn,1)):r.addEventListener&&"function"==typeof postMessage&&!r.importScripts?(Ln=function(e){r.postMessage(e+"","*")},r.addEventListener("message",zn,!1)):Ln="onreadystatechange"in d("script")?function(e){Re.appendChild(d("script")).onreadystatechange=function(){Re.removeChild(this),Wn.call(e)}}:function(e){setTimeout(i(Wn,e,1),0)});var Kn={set:Fn,clear:qn},Yn=Kn.set,Gn=r.MutationObserver||r.WebKitMutationObserver,Jn=r.process,$n=r.Promise,Qn="process"==U(Jn);function Xn(e){var t,i;this.promise=new e(function(e,n){if(void 0!==t||void 0!==i)throw TypeError("Bad Promise constructor");t=e,i=n}),this.resolve=n(t),this.reject=n(i)}var Zn,ei,ti,ni,ii={f:function(e){return new Xn(e)}},ri=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}},ai=r.navigator,oi=ai&&ai.userAgent||"",si=M("species"),li=function(e){var t=r[e];c&&t&&!t[si]&&g.f(t,si,{configurable:!0,get:function(){return this}})},ci=Kn.set,ui=function(){var e,t,n,i=function(){var i,r;for(Qn&&(i=Jn.domain)&&i.exit();e;){r=e.fn,e=e.next;try{r()}catch(i){throw e?n():t=void 0,i}}t=void 0,i&&i.enter()};if(Qn)n=function(){Jn.nextTick(i)};else if(!Gn||r.navigator&&r.navigator.standalone)if($n&&$n.resolve){var a=$n.resolve(void 0);n=function(){a.then(i)}}else n=function(){Yn.call(r,i)};else{var o=!0,s=document.createTextNode("");new Gn(i).observe(s,{characterData:!0}),n=function(){s.data=o=!o}}return function(i){var r={fn:i,next:void 0};t&&(t.next=r),e||(e=r,n()),t=r}}(),hi=r.TypeError,di=r.process,fi=di&&di.versions,pi=fi&&fi.v8||"",mi=r.Promise,gi="process"==K(di),yi=function(){},vi=ei=ii.f,bi=!!function(){try{var e=mi.resolve(1),t=(e.constructor={})[M("species")]=function(e){e(yi,yi)};return(gi||"function"==typeof PromiseRejectionEvent)&&e.then(yi)instanceof t&&0!==pi.indexOf("6.6")&&-1===oi.indexOf("Chrome/66")}catch(e){}}(),wi=function(e){var t;return!(!o(e)||"function"!=typeof(t=e.then))&&t},ki=function(e,t){if(!e._n){e._n=!0;var n=e._c;ui(function(){for(var i=e._v,r=1==e._s,a=0,o=function(t){var n,a,o,s=r?t.ok:t.fail,l=t.resolve,c=t.reject,u=t.domain;try{s?(r||(2==e._h&&Si(e),e._h=1),!0===s?n=i:(u&&u.enter(),n=s(i),u&&(u.exit(),o=!0)),n===t.promise?c(hi("Promise-chain cycle")):(a=wi(n))?a.call(n,l,c):l(n)):c(i)}catch(e){u&&!o&&u.exit(),c(e)}};n.length>a;)o(n[a++]);e._c=[],e._n=!1,t&&!e._h&&Ti(e)})}},Ti=function(e){ci.call(r,function(){var t,n,i,a=e._v,o=Ei(e);if(o&&(t=ri(function(){gi?di.emit("unhandledRejection",a,e):(n=r.onunhandledrejection)?n({promise:e,reason:a}):(i=r.console)&&i.error&&i.error("Unhandled promise rejection",a)}),e._h=gi||Ei(e)?2:1),e._a=void 0,o&&t.e)throw t.v})},Ei=function(e){return 1!==e._h&&0===(e._a||e._c).length},Si=function(e){ci.call(r,function(){var t;gi?di.emit("rejectionHandled",e):(t=r.onrejectionhandled)&&t({promise:e,reason:e._v})})},Ai=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),ki(t,!0))},Pi=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw hi("Promise can't be resolved itself");(t=wi(e))?ui(function(){var r={_w:n,_d:!1};try{t.call(e,i(Pi,r,1),i(Ai,r,1))}catch(e){Ai.call(r,e)}}):(n._v=e,n._s=1,ki(n,!1))}catch(e){Ai.call({_w:n,_d:!1},e)}}};bi||(mi=function(e){en(this,mi,"Promise","_h"),n(e),Zn.call(this);try{e(i(Pi,this,1),i(Ai,this,1))}catch(e){Ai.call(this,e)}},(Zn=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=Zt(mi.prototype,{then:function(e,t){var n=vi(bn(this,mi));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=gi?di.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&ki(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),ti=function(){var e=new Zn;this.promise=e,this.resolve=i(Pi,e,1),this.reject=i(Ai,e,1)},ii.f=vi=function(e){return e===mi||e===ni?new ti(e):ei(e)}),P(P.G+P.W+P.F*!bi,{Promise:mi}),At(mi,"Promise"),li("Promise"),ni=a.Promise,P(P.S+P.F*!bi,"Promise",{reject:function(e){var t=vi(this);return(0,t.reject)(e),t.promise}}),P(P.S+P.F*!bi,"Promise",{resolve:function(e){return function(e,t){if(s(e),o(t)&&t.constructor===e)return t;var n=ii.f(e);return(0,n.resolve)(t),n.promise}(this,e)}}),P(P.S+P.F*!(bi&&Q(function(e){mi.all(e).catch(yi)})),"Promise",{all:function(e){var t=this,n=vi(t),i=n.resolve,r=n.reject,a=ri(function(){var n=[],a=0,o=1;tn(e,!1,function(e){var s=a++,l=!1;n.push(void 0),o++,t.resolve(e).then(function(e){l||(l=!0,n[s]=e,--o||i(n))},r)}),--o||i(n)});return a.e&&r(a.v),n.promise},race:function(e){var t=this,n=vi(t),i=n.reject,r=ri(function(){tn(e,!1,function(e){t.resolve(e).then(n.resolve,i)})});return r.e&&i(r.v),n.promise}});var Ci="".startsWith;P(P.P+P.F*rt("startsWith"),"String",{startsWith:function(e){var t=nt(this,e,"startsWith"),n=H(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),i=String(e);return Ci?Ci.call(t,i,n):t.slice(n,n+i.length)===i}}),P(P.S,"Number",{isNaN:function(e){return e!=e}});var _i=function(e){return null!=e?e.constructor:null},xi=function(e,t){return Boolean(e&&t&&e instanceof t)},Ii=function(e){return null==e},Ni=function(e){return _i(e)===Object},Mi=function(e){return _i(e)===String},Oi=function(e){return Array.isArray(e)},Li=function(e){return xi(e,NodeList)},ji=function(e){return Ii(e)||(Mi(e)||Oi(e)||Li(e))&&!e.length||Ni(e)&&!Object.keys(e).length},Ri={nullOrUndefined:Ii,object:Ni,number:function(e){return _i(e)===Number&&!Number.isNaN(e)},string:Mi,boolean:function(e){return _i(e)===Boolean},function:function(e){return _i(e)===Function},array:Oi,weakMap:function(e){return xi(e,WeakMap)},nodeList:Li,element:function(e){return xi(e,Element)},textNode:function(e){return _i(e)===Text},event:function(e){return xi(e,Event)},keyboardEvent:function(e){return xi(e,KeyboardEvent)},cue:function(e){return xi(e,window.TextTrackCue)||xi(e,window.VTTCue)},track:function(e){return xi(e,TextTrack)||!Ii(e)&&Mi(e.kind)},url:function(e){if(xi(e,window.URL))return!0;if(!Mi(e))return!1;var t=e;e.startsWith("http://")&&e.startsWith("https://")||(t="http://".concat(e));try{return!ji(new URL(t).hostname)}catch(e){return!1}},empty:ji},Di=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){return e=!0,null}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(e){}return e}();function Fi(e,t,n){var i=this,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(e&&"addEventListener"in e&&!Ri.empty(t)&&Ri.function(n)){var s=t.split(" "),l=o;Di&&(l={passive:a,capture:o}),s.forEach(function(t){i&&i.eventListeners&&r&&i.eventListeners.push({element:e,type:t,callback:n,options:l}),e[r?"addEventListener":"removeEventListener"](t,n,l)})}}function qi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Fi.call(this,e,t,n,!0,i,r)}function Hi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Fi.call(this,e,t,n,!1,i,r)}function Vi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Fi.call(this,e,t,function a(){Hi(e,t,a,i,r);for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];n.apply(this,s)},!0,i,r)}function Bi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(Ri.element(e)&&!Ri.empty(t)){var r=new CustomEvent(t,{bubbles:n,detail:Object.assign({},i,{plyr:this})});e.dispatchEvent(r)}}function Ui(e,t){var n=e.length?e:[e];Array.from(n).reverse().forEach(function(e,n){var i=n>0?t.cloneNode(!0):t,r=e.parentNode,a=e.nextSibling;i.appendChild(e),a?r.insertBefore(i,a):r.appendChild(i)})}function Wi(e,t){Ri.element(e)&&!Ri.empty(t)&&Object.entries(t).filter(function(e){var t=gn(e,2)[1];return!Ri.nullOrUndefined(t)}).forEach(function(t){var n=gn(t,2),i=n[0],r=n[1];return e.setAttribute(i,r)})}function zi(e,t,n){var i=document.createElement(e);return Ri.object(t)&&Wi(i,t),Ri.string(n)&&(i.innerText=n),i}function Ki(e,t,n,i){Ri.element(t)&&t.appendChild(zi(e,n,i))}function Yi(e){Ri.nodeList(e)||Ri.array(e)?Array.from(e).forEach(Yi):Ri.element(e)&&Ri.element(e.parentNode)&&e.parentNode.removeChild(e)}function Gi(e){if(Ri.element(e))for(var t=e.childNodes.length;t>0;)e.removeChild(e.lastChild),t-=1}function Ji(e,t){return Ri.element(t)&&Ri.element(t.parentNode)&&Ri.element(e)?(t.parentNode.replaceChild(e,t),e):null}function $i(e,t){if(!Ri.string(e)||Ri.empty(e))return{};var n={},i=t;return e.split(",").forEach(function(e){var t=e.trim(),r=t.replace(".",""),a=t.replace(/[[\]]/g,"").split("="),o=a[0],s=a.length>1?a[1].replace(/["']/g,""):"";switch(t.charAt(0)){case".":Ri.object(i)&&Ri.string(i.class)&&(i.class+=" ".concat(r)),n.class=r;break;case"#":n.id=t.replace("#","");break;case"[":n[o]=s}}),n}function Qi(e,t){if(Ri.element(e)){var n=t;Ri.boolean(n)||(n=!e.hidden),n?e.setAttribute("hidden",""):e.removeAttribute("hidden")}}function Xi(e,t,n){if(Ri.nodeList(e))return Array.from(e).map(function(e){return Xi(e,t,n)});if(Ri.element(e)){var i="toggle";return void 0!==n&&(i=n?"add":"remove"),e.classList[i](t),e.classList.contains(t)}return!1}function Zi(e,t){return Ri.element(e)&&e.classList.contains(t)}function er(e,t){return function(){return Array.from(document.querySelectorAll(t)).includes(this)}.call(e,t)}function tr(e){return this.elements.container.querySelectorAll(e)}function nr(e){return this.elements.container.querySelector(e)}function ir(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Ri.element(e)&&(e.focus({preventScroll:!0}),t&&Xi(e,this.config.classNames.tabFocus))}var rr,ar,or,sr=(rr=document.createElement("span"),ar={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},or=Object.keys(ar).find(function(e){return void 0!==rr.style[e]}),!!Ri.string(or)&&ar[or]);function lr(e){setTimeout(function(){try{Qi(e,!0),e.offsetHeight,Qi(e,!1)}catch(e){}},0)}var cr,ur={isIE:!!document.documentMode,isWebkit:"WebkitAppearance"in document.documentElement.style&&!/Edge/.test(navigator.userAgent),isIPhone:/(iPhone|iPod)/gi.test(navigator.platform),isIos:/(iPad|iPhone|iPod)/gi.test(navigator.platform)},hr={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},dr={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check:function(e,t,n){var i=ur.isIPhone&&n&&dr.playsinline,r=dr[e]||"html5"!==t;return{api:r,ui:r&&dr.rangeInput&&("video"!==e||!ur.isIPhone||i)}},pip:!(ur.isIPhone||!Ri.function(zi("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||zi("video").disablePictureInPicture)),airplay:Ri.function(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime:function(e){if(Ri.empty(e))return!1;var t=gn(e.split("/"),1)[0],n=e;if(!this.isHTML5||t!==this.type)return!1;Object.keys(hr).includes(n)&&(n+='; codecs="'.concat(hr[e],'"'));try{return Boolean(n&&this.media.canPlayType(n).replace(/no/,""))}catch(e){return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(cr=document.createElement("input"),cr.type="range","range"===cr.type),touch:"ontouchstart"in document.documentElement,transitions:!1!==sr,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},fr={getSources:function(){var e=this;return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter(function(t){var n=t.getAttribute("type");return!!Ri.empty(n)||dr.mime.call(e,n)}):[]},getQualityOptions:function(){return fr.getSources.call(this).map(function(e){return Number(e.getAttribute("size"))}).filter(Boolean)},extend:function(){if(this.isHTML5){var e=this;Object.defineProperty(e.media,"quality",{get:function(){var t=fr.getSources.call(e).find(function(t){return t.getAttribute("src")===e.source});return t&&Number(t.getAttribute("size"))},set:function(t){var n=fr.getSources.call(e).find(function(e){return Number(e.getAttribute("size"))===t});if(n){var i=e.media,r=i.currentTime,a=i.paused,o=i.preload,s=i.readyState;e.media.src=n.getAttribute("src"),("none"!==o||s)&&(e.once("loadedmetadata",function(){e.currentTime=r,a||e.play()}),e.media.load()),Bi.call(e,e.media,"qualitychange",!1,{quality:t})}}})}},cancelRequests:function(){this.isHTML5&&(Yi(fr.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function pr(e){return Ri.array(e)?e.filter(function(t,n){return e.indexOf(t)===n}):e}function mr(e,t){return t.split(".").reduce(function(e,t){return e&&e[t]},e)}function gr(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];if(!n.length)return e;var r=n.shift();return Ri.object(r)?(Object.keys(r).forEach(function(t){Ri.object(r[t])?(Object.keys(e).includes(t)||Object.assign(e,mn({},t,{})),gr(e[t],r[t])):Object.assign(e,mn({},t,r[t]))}),gr.apply(void 0,[e].concat(n))):e}var yr=g.f,vr=Ae.f,br=r.RegExp,wr=br,kr=br.prototype,Tr=/a/g,Er=/a/g,Sr=new br(Tr)!==Tr;if(c&&(!Sr||l(function(){return Er[M("match")]=!1,br(Tr)!=Tr||br(Er)==Er||"/a/i"!=br(Tr,"i")}))){br=function(e,t){var n=this instanceof br,i=tt(e),r=void 0===t;return!n&&i&&e.constructor===br&&r?e:pe(Sr?new wr(i&&!r?e.source:e,t):wr((i=e instanceof br)?e.source:e,i&&r?ct.call(e):t),n?this:kr,br)};for(var Ar=function(e){e in br||yr(br,e,{configurable:!0,get:function(){return wr[e]},set:function(t){wr[e]=t}})},Pr=vr(wr),Cr=0;Pr.length>Cr;)Ar(Pr[Cr++]);kr.constructor=br,br.prototype=kr,S(r,"RegExp",br)}function _r(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return Ri.empty(e)?e:e.toString().replace(/{(\d+)}/g,function(e,t){return n[t].toString()})}function xr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return e.replace(new RegExp(t.toString().replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1"),"g"),n.toString())}function Ir(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString().replace(/\w\S*/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})}function Nr(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString();return(e=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString();return e=xr(e,"-"," "),e=xr(e,"_"," "),xr(e=Ir(e)," ","")}(e)).charAt(0).toLowerCase()+e.slice(1)}function Mr(e){var t=document.createElement("div");return t.appendChild(e),t.innerHTML}li("RegExp");var Or={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},Lr=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Ri.empty(e)||Ri.empty(t))return"";var n=mr(t.i18n,e);if(Ri.empty(n))return Object.keys(Or).includes(e)?Or[e]:"";var i={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(i).forEach(function(e){var t=gn(e,2),i=t[0],r=t[1];n=xr(n,i,r)}),n},jr=function(){function e(t){dn(this,e),this.enabled=t.config.storage.enabled,this.key=t.config.storage.key}return pn(e,[{key:"get",value:function(t){if(!e.supported||!this.enabled)return null;var n=window.localStorage.getItem(this.key);if(Ri.empty(n))return null;var i=JSON.parse(n);return Ri.string(t)&&t.length?i[t]:i}},{key:"set",value:function(t){if(e.supported&&this.enabled&&Ri.object(t)){var n=this.get();Ri.empty(n)&&(n={}),gr(n,t),window.localStorage.setItem(this.key,JSON.stringify(n))}}}],[{key:"supported",get:function(){try{if(!("localStorage"in window))return!1;return window.localStorage.setItem("___test","___test"),window.localStorage.removeItem("___test"),!0}catch(e){return!1}}}]),e}();function Rr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";return new Promise(function(n,i){try{var r=new XMLHttpRequest;if(!("withCredentials"in r))return;r.addEventListener("load",function(){if("text"===t)try{n(JSON.parse(r.responseText))}catch(e){n(r.responseText)}else n(r.response)}),r.addEventListener("error",function(){throw new Error(r.status)}),r.open("GET",e,!0),r.responseType=t,r.send()}catch(e){i(e)}})}function Dr(e,t){if(Ri.string(e)){var n=Ri.string(t),i=function(){return null!==document.getElementById(t)},r=function(e,t){e.innerHTML=t,n&&i()||document.body.insertAdjacentElement("afterbegin",e)};if(!n||!i()){var a=jr.supported,o=document.createElement("div");if(o.setAttribute("hidden",""),n&&o.setAttribute("id",t),a){var s=window.localStorage.getItem("".concat("cache","-").concat(t));if(null!==s){var l=JSON.parse(s);r(o,l.content)}}Rr(e).then(function(e){Ri.empty(e)||(a&&window.localStorage.setItem("".concat("cache","-").concat(t),JSON.stringify({content:e})),r(o,e))}).catch(function(){})}}}var Fr=function(e){return parseInt(e/60/60%60,10)},qr=function(e){return parseInt(e/60%60,10)},Hr=function(e){return parseInt(e%60,10)};function Vr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!Ri.number(e))return Vr(null,t,n);var i=function(e){return"0".concat(e).slice(-2)},r=Fr(e),a=qr(e),o=Hr(e);return r=t||r>0?"".concat(r,":"):"","".concat(n&&e>0?"-":"").concat(r).concat(i(a),":").concat(i(o))}var Br={getIconUrl:function(){var e=new URL(this.config.iconUrl,window.location).host!==window.location.host||ur.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:e}},findElements:function(){try{return this.elements.controls=nr.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:tr.call(this,this.config.selectors.buttons.play),pause:nr.call(this,this.config.selectors.buttons.pause),restart:nr.call(this,this.config.selectors.buttons.restart),rewind:nr.call(this,this.config.selectors.buttons.rewind),fastForward:nr.call(this,this.config.selectors.buttons.fastForward),mute:nr.call(this,this.config.selectors.buttons.mute),pip:nr.call(this,this.config.selectors.buttons.pip),airplay:nr.call(this,this.config.selectors.buttons.airplay),settings:nr.call(this,this.config.selectors.buttons.settings),captions:nr.call(this,this.config.selectors.buttons.captions),fullscreen:nr.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=nr.call(this,this.config.selectors.progress),this.elements.inputs={seek:nr.call(this,this.config.selectors.inputs.seek),volume:nr.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:nr.call(this,this.config.selectors.display.buffer),currentTime:nr.call(this,this.config.selectors.display.currentTime),duration:nr.call(this,this.config.selectors.display.duration)},Ri.element(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(".".concat(this.config.classNames.tooltip))),!0}catch(e){return this.debug.warn("It looks like there is a problem with your custom controls HTML",e),this.toggleNativeControls(!0),!1}},createIcon:function(e,t){var n=Br.getIconUrl.call(this),i="".concat(n.cors?"":n.url,"#").concat(this.config.iconPrefix),r=document.createElementNS("http://www.w3.org/2000/svg","svg");Wi(r,gr(t,{role:"presentation",focusable:"false"}));var a=document.createElementNS("http://www.w3.org/2000/svg","use"),o="".concat(i,"-").concat(e);return"href"in a&&a.setAttributeNS("http://www.w3.org/1999/xlink","href",o),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o),r.appendChild(a),r},createLabel:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Lr(e,this.config);return zi("span",Object.assign({},t,{class:[t.class,this.config.classNames.hidden].filter(Boolean).join(" ")}),n)},createBadge:function(e){if(Ri.empty(e))return null;var t=zi("span",{class:this.config.classNames.menu.value});return t.appendChild(zi("span",{class:this.config.classNames.menu.badge},e)),t},createButton:function(e,t){var n=Object.assign({},t),i=Nr(e),r={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach(function(e){Object.keys(n).includes(e)&&(r[e]=n[e],delete n[e])}),"button"!==r.element||Object.keys(n).includes("type")||(n.type="button"),Object.keys(n).includes("class")?n.class.includes(this.config.classNames.control)||(n.class+=" ".concat(this.config.classNames.control)):n.class=this.config.classNames.control,e){case"play":r.toggle=!0,r.label="play",r.labelPressed="pause",r.icon="play",r.iconPressed="pause";break;case"mute":r.toggle=!0,r.label="mute",r.labelPressed="unmute",r.icon="volume",r.iconPressed="muted";break;case"captions":r.toggle=!0,r.label="enableCaptions",r.labelPressed="disableCaptions",r.icon="captions-off",r.iconPressed="captions-on";break;case"fullscreen":r.toggle=!0,r.label="enterFullscreen",r.labelPressed="exitFullscreen",r.icon="enter-fullscreen",r.iconPressed="exit-fullscreen";break;case"play-large":n.class+=" ".concat(this.config.classNames.control,"--overlaid"),i="play",r.label="play",r.icon="play";break;default:Ri.empty(r.label)&&(r.label=i),Ri.empty(r.icon)&&(r.icon=e)}var a=zi(r.element);return r.toggle?(a.appendChild(Br.createIcon.call(this,r.iconPressed,{class:"icon--pressed"})),a.appendChild(Br.createIcon.call(this,r.icon,{class:"icon--not-pressed"})),a.appendChild(Br.createLabel.call(this,r.labelPressed,{class:"label--pressed"})),a.appendChild(Br.createLabel.call(this,r.label,{class:"label--not-pressed"}))):(a.appendChild(Br.createIcon.call(this,r.icon)),a.appendChild(Br.createLabel.call(this,r.label))),gr(n,$i(this.config.selectors.buttons[i],n)),Wi(a,n),"play"===i?(Ri.array(this.elements.buttons[i])||(this.elements.buttons[i]=[]),this.elements.buttons[i].push(a)):this.elements.buttons[i]=a,a},createRange:function(e,t){var n=zi("input",gr($i(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":Lr(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=n,Br.updateRangeFill.call(this,n),n},createProgress:function(e,t){var n=zi("progress",gr($i(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"presentation","aria-hidden":!0},t));if("volume"!==e){n.appendChild(zi("span",null,"0"));var i={played:"played",buffer:"buffered"}[e],r=i?Lr(i,this.config):"";n.innerText="% ".concat(r.toLowerCase())}return this.elements.display[e]=n,n},createTime:function(e){var t=$i(this.config.selectors.display[e]),n=zi("div",gr(t,{class:"".concat(this.config.classNames.display.time," ").concat(t.class?t.class:"").trim(),"aria-label":Lr(e,this.config)}),"00:00");return this.elements.display[e]=n,n},bindMenuItemShortcuts:function(e,t){var n=this;qi(e,"keydown keyup",function(i){if([32,38,39,40].includes(i.which)&&(i.preventDefault(),i.stopPropagation(),"keydown"!==i.type)){var r,a=er(e,'[role="menuitemradio"]');if(!a&&[32,39].includes(i.which))Br.showMenuPanel.call(n,t,!0);else 32!==i.which&&(40===i.which||a&&39===i.which?(r=e.nextElementSibling,Ri.element(r)||(r=e.parentNode.firstElementChild)):(r=e.previousElementSibling,Ri.element(r)||(r=e.parentNode.lastElementChild)),ir.call(n,r,!0))}},!1),qi(e,"keyup",function(e){13===e.which&&Br.focusFirstMenuItem.call(n,null,!0)})},createMenuItem:function(e){var t=this,n=e.value,i=e.list,r=e.type,a=e.title,o=e.badge,s=void 0===o?null:o,l=e.checked,c=void 0!==l&&l,u=$i(this.config.selectors.inputs[r]),h=zi("button",gr(u,{type:"button",role:"menuitemradio",class:"".concat(this.config.classNames.control," ").concat(u.class?u.class:"").trim(),"aria-checked":c,value:n})),d=zi("span");d.innerHTML=a,Ri.element(s)&&d.appendChild(s),h.appendChild(d),Object.defineProperty(h,"checked",{enumerable:!0,get:function(){return"true"===h.getAttribute("aria-checked")},set:function(e){e&&Array.from(h.parentNode.children).filter(function(e){return er(e,'[role="menuitemradio"]')}).forEach(function(e){return e.setAttribute("aria-checked","false")}),h.setAttribute("aria-checked",e?"true":"false")}}),this.listeners.bind(h,"click keyup",function(e){if(!Ri.keyboardEvent(e)||32===e.which){switch(e.preventDefault(),e.stopPropagation(),h.checked=!0,r){case"language":t.currentTrack=Number(n);break;case"quality":t.quality=n;break;case"speed":t.speed=parseFloat(n)}Br.showMenuPanel.call(t,"home",Ri.keyboardEvent(e))}},r,!1),Br.bindMenuItemShortcuts.call(this,h,r),i.appendChild(h)},formatTime:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Ri.number(e)?Vr(e,Fr(this.duration)>0,t):e},updateTimeDisplay:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Ri.element(e)&&Ri.number(t)&&(e.innerText=Br.formatTime(t,n))},updateVolume:function(){this.supported.ui&&(Ri.element(this.elements.inputs.volume)&&Br.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),Ri.element(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||0===this.volume))},setRange:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Ri.element(e)&&(e.value=t,Br.updateRangeFill.call(this,e))},updateProgress:function(e){var t=this;if(this.supported.ui&&Ri.event(e)){var n,i,r=0;if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":n=this.currentTime,i=this.duration,r=0===n||0===i||Number.isNaN(n)||Number.isNaN(i)?0:(n/i*100).toFixed(2),"timeupdate"===e.type&&Br.setRange.call(this,this.elements.inputs.seek,r);break;case"playing":case"progress":!function(e,n){var i=Ri.number(n)?n:0,r=Ri.element(e)?e:t.elements.display.buffer;if(Ri.element(r)){r.value=i;var a=r.getElementsByTagName("span")[0];Ri.element(a)&&(a.childNodes[0].nodeValue=i)}}(this.elements.display.buffer,100*this.buffered)}}},updateRangeFill:function(e){var t=Ri.event(e)?e.target:e;if(Ri.element(t)&&"range"===t.getAttribute("type")){if(er(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);var n=Br.formatTime(this.currentTime),i=Br.formatTime(this.duration),r=Lr("seekLabel",this.config);t.setAttribute("aria-valuetext",r.replace("{currentTime}",n).replace("{duration}",i))}else if(er(t,this.config.selectors.inputs.volume)){var a=100*t.value;t.setAttribute("aria-valuenow",a),t.setAttribute("aria-valuetext","".concat(a.toFixed(1),"%"))}else t.setAttribute("aria-valuenow",t.value);ur.isWebkit&&t.style.setProperty("--value","".concat(t.value/t.max*100,"%"))}},updateSeekTooltip:function(e){var t=this;if(this.config.tooltips.seek&&Ri.element(this.elements.inputs.seek)&&Ri.element(this.elements.display.seekTooltip)&&0!==this.duration){var n=0,i=this.elements.progress.getBoundingClientRect(),r="".concat(this.config.classNames.tooltip,"--visible"),a=function(e){Xi(t.elements.display.seekTooltip,r,e)};if(this.touch)a(!1);else{if(Ri.event(e))n=100/i.width*(e.pageX-i.left);else{if(!Zi(this.elements.display.seekTooltip,r))return;n=parseFloat(this.elements.display.seekTooltip.style.left,10)}n<0?n=0:n>100&&(n=100),Br.updateTimeDisplay.call(this,this.elements.display.seekTooltip,this.duration/100*n),this.elements.display.seekTooltip.style.left="".concat(n,"%"),Ri.event(e)&&["mouseenter","mouseleave"].includes(e.type)&&a("mouseenter"===e.type)}}},timeUpdate:function(e){var t=!Ri.element(this.elements.display.duration)&&this.config.invertTime;Br.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),e&&"timeupdate"===e.type&&this.media.seeking||Br.updateProgress.call(this,e)},durationUpdate:function(){if(this.supported.ui&&(this.config.invertTime||!this.currentTime)){if(this.duration>=Math.pow(2,32))return Qi(this.elements.display.currentTime,!0),void Qi(this.elements.progress,!0);Ri.element(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);var e=Ri.element(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&Br.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&Br.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),Br.updateSeekTooltip.call(this)}},toggleMenuButton:function(e,t){Qi(this.elements.settings.buttons[e],!t)},updateSetting:function(e,t,n){var i=this.elements.settings.panels[e],r=null,a=t;if("captions"===e)r=this.currentTrack;else{if(r=Ri.empty(n)?this[e]:n,Ri.empty(r)&&(r=this.config[e].default),!Ri.empty(this.options[e])&&!this.options[e].includes(r))return void this.debug.warn("Unsupported value of '".concat(r,"' for ").concat(e));if(!this.config[e].options.includes(r))return void this.debug.warn("Disabled value of '".concat(r,"' for ").concat(e))}if(Ri.element(a)||(a=i&&i.querySelector('[role="menu"]')),Ri.element(a)){this.elements.settings.buttons[e].querySelector(".".concat(this.config.classNames.menu.value)).innerHTML=Br.getLabel.call(this,e,r);var o=a&&a.querySelector('[value="'.concat(r,'"]'));Ri.element(o)&&(o.checked=!0)}},getLabel:function(e,t){switch(e){case"speed":return 1===t?Lr("normal",this.config):"".concat(t,"&times;");case"quality":if(Ri.number(t)){var n=Lr("qualityLabel.".concat(t),this.config);return n.length?n:"".concat(t,"p")}return Ir(t);case"captions":return zr.getLabel.call(this);default:return null}},setQualityMenu:function(e){var t=this;if(Ri.element(this.elements.settings.panels.quality)){var n=this.elements.settings.panels.quality.querySelector('[role="menu"]');Ri.array(e)&&(this.options.quality=pr(e).filter(function(e){return t.config.quality.options.includes(e)}));var i=!Ri.empty(this.options.quality)&&this.options.quality.length>1;if(Br.toggleMenuButton.call(this,"quality",i),Gi(n),Br.checkMenu.call(this),i){var r=function(e){var n=Lr("qualityBadge.".concat(e),t.config);return n.length?Br.createBadge.call(t,n):null};this.options.quality.sort(function(e,n){var i=t.config.quality.options;return i.indexOf(e)>i.indexOf(n)?1:-1}).forEach(function(e){Br.createMenuItem.call(t,{value:e,list:n,type:"quality",title:Br.getLabel.call(t,"quality",e),badge:r(e)})}),Br.updateSetting.call(this,"quality",n)}}},setCaptionsMenu:function(){var e=this;if(Ri.element(this.elements.settings.panels.captions)){var t=this.elements.settings.panels.captions.querySelector('[role="menu"]'),n=zr.getTracks.call(this),i=Boolean(n.length);if(Br.toggleMenuButton.call(this,"captions",i),Gi(t),Br.checkMenu.call(this),i){var r=n.map(function(n,i){return{value:i,checked:e.captions.toggled&&e.currentTrack===i,title:zr.getLabel.call(e,n),badge:n.language&&Br.createBadge.call(e,n.language.toUpperCase()),list:t,type:"language"}});r.unshift({value:-1,checked:!this.captions.toggled,title:Lr("disabled",this.config),list:t,type:"language"}),r.forEach(Br.createMenuItem.bind(this)),Br.updateSetting.call(this,"captions",t)}}},setSpeedMenu:function(e){var t=this;if(Ri.element(this.elements.settings.panels.speed)){var n=this.elements.settings.panels.speed.querySelector('[role="menu"]');Ri.array(e)?this.options.speed=e:(this.isHTML5||this.isVimeo)&&(this.options.speed=[.5,.75,1,1.25,1.5,1.75,2]),this.options.speed=this.options.speed.filter(function(e){return t.config.speed.options.includes(e)});var i=!Ri.empty(this.options.speed)&&this.options.speed.length>1;Br.toggleMenuButton.call(this,"speed",i),Gi(n),Br.checkMenu.call(this),i&&(this.options.speed.forEach(function(e){Br.createMenuItem.call(t,{value:e,list:n,type:"speed",title:Br.getLabel.call(t,"speed",e)})}),Br.updateSetting.call(this,"speed",n))}},checkMenu:function(){var e=this.elements.settings.buttons,t=!Ri.empty(e)&&Object.values(e).some(function(e){return!e.hidden});Qi(this.elements.settings.menu,!t)},focusFirstMenuItem:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.elements.settings.popup.hidden){var n=e;Ri.element(n)||(n=Object.values(this.elements.settings.panels).find(function(e){return!e.hidden}));var i=n.querySelector('[role^="menuitem"]');ir.call(this,i,t)}},toggleMenu:function(e){var t=this.elements.settings.popup,n=this.elements.buttons.settings;if(Ri.element(t)&&Ri.element(n)){var i=t.hidden,r=i;if(Ri.boolean(e))r=e;else if(Ri.keyboardEvent(e)&&27===e.which)r=!1;else if(Ri.event(e)){var a=t.contains(e.target);if(a||!a&&e.target!==n&&r)return}n.setAttribute("aria-expanded",r),Qi(t,!r),Xi(this.elements.container,this.config.classNames.menu.open,r),r&&Ri.keyboardEvent(e)?Br.focusFirstMenuItem.call(this,null,!0):r||i||ir.call(this,n,Ri.keyboardEvent(e))}},getMenuSize:function(e){var t=e.cloneNode(!0);t.style.position="absolute",t.style.opacity=0,t.removeAttribute("hidden"),e.parentNode.appendChild(t);var n=t.scrollWidth,i=t.scrollHeight;return Yi(t),{width:n,height:i}},showMenuPanel:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=document.getElementById("plyr-settings-".concat(this.id,"-").concat(t));if(Ri.element(i)){var r=i.parentNode,a=Array.from(r.children).find(function(e){return!e.hidden});if(dr.transitions&&!dr.reducedMotion){r.style.width="".concat(a.scrollWidth,"px"),r.style.height="".concat(a.scrollHeight,"px");var o=Br.getMenuSize.call(this,i);qi.call(this,r,sr,function t(n){n.target===r&&["width","height"].includes(n.propertyName)&&(r.style.width="",r.style.height="",Hi.call(e,r,sr,t))}),r.style.width="".concat(o.width,"px"),r.style.height="".concat(o.height,"px")}Qi(a,!0),Qi(i,!1),Br.focusFirstMenuItem.call(this,i,n)}},setDownloadLink:function(){var e=this.elements.buttons.download;Ri.element(e)&&e.setAttribute("href",this.download)},create:function(e){var t=this,n=zi("div",$i(this.config.selectors.controls.wrapper));if(this.config.controls.includes("restart")&&n.appendChild(Br.createButton.call(this,"restart")),this.config.controls.includes("rewind")&&n.appendChild(Br.createButton.call(this,"rewind")),this.config.controls.includes("play")&&n.appendChild(Br.createButton.call(this,"play")),this.config.controls.includes("fast-forward")&&n.appendChild(Br.createButton.call(this,"fast-forward")),this.config.controls.includes("progress")){var i=zi("div",$i(this.config.selectors.progress));if(i.appendChild(Br.createRange.call(this,"seek",{id:"plyr-seek-".concat(e.id)})),i.appendChild(Br.createProgress.call(this,"buffer")),this.config.tooltips.seek){var r=zi("span",{class:this.config.classNames.tooltip},"00:00");i.appendChild(r),this.elements.display.seekTooltip=r}this.elements.progress=i,n.appendChild(this.elements.progress)}if(this.config.controls.includes("current-time")&&n.appendChild(Br.createTime.call(this,"currentTime")),this.config.controls.includes("duration")&&n.appendChild(Br.createTime.call(this,"duration")),this.config.controls.includes("mute")||this.config.controls.includes("volume")){var a=zi("div",{class:"plyr__volume"});if(this.config.controls.includes("mute")&&a.appendChild(Br.createButton.call(this,"mute")),this.config.controls.includes("volume")){var o={max:1,step:.05,value:this.config.volume};a.appendChild(Br.createRange.call(this,"volume",gr(o,{id:"plyr-volume-".concat(e.id)}))),this.elements.volume=a}n.appendChild(a)}if(this.config.controls.includes("captions")&&n.appendChild(Br.createButton.call(this,"captions")),this.config.controls.includes("settings")&&!Ri.empty(this.config.settings)){var s=zi("div",{class:"plyr__menu",hidden:""});s.appendChild(Br.createButton.call(this,"settings",{"aria-haspopup":!0,"aria-controls":"plyr-settings-".concat(e.id),"aria-expanded":!1}));var l=zi("div",{class:"plyr__menu__container",id:"plyr-settings-".concat(e.id),hidden:""}),c=zi("div"),u=zi("div",{id:"plyr-settings-".concat(e.id,"-home")}),h=zi("div",{role:"menu"});u.appendChild(h),c.appendChild(u),this.elements.settings.panels.home=u,this.config.settings.forEach(function(n){var i=zi("button",gr($i(t.config.selectors.buttons.settings),{type:"button",class:"".concat(t.config.classNames.control," ").concat(t.config.classNames.control,"--forward"),role:"menuitem","aria-haspopup":!0,hidden:""}));Br.bindMenuItemShortcuts.call(t,i,n),qi(i,"click",function(){Br.showMenuPanel.call(t,n,!1)});var r=zi("span",null,Lr(n,t.config)),a=zi("span",{class:t.config.classNames.menu.value});a.innerHTML=e[n],r.appendChild(a),i.appendChild(r),h.appendChild(i);var o=zi("div",{id:"plyr-settings-".concat(e.id,"-").concat(n),hidden:""}),s=zi("button",{type:"button",class:"".concat(t.config.classNames.control," ").concat(t.config.classNames.control,"--back")});s.appendChild(zi("span",{"aria-hidden":!0},Lr(n,t.config))),s.appendChild(zi("span",{class:t.config.classNames.hidden},Lr("menuBack",t.config))),qi(o,"keydown",function(e){37===e.which&&(e.preventDefault(),e.stopPropagation(),Br.showMenuPanel.call(t,"home",!0))},!1),qi(s,"click",function(){Br.showMenuPanel.call(t,"home",!1)}),o.appendChild(s),o.appendChild(zi("div",{role:"menu"})),c.appendChild(o),t.elements.settings.buttons[n]=i,t.elements.settings.panels[n]=o}),l.appendChild(c),s.appendChild(l),n.appendChild(s),this.elements.settings.popup=l,this.elements.settings.menu=s}if(this.config.controls.includes("pip")&&dr.pip&&n.appendChild(Br.createButton.call(this,"pip")),this.config.controls.includes("airplay")&&dr.airplay&&n.appendChild(Br.createButton.call(this,"airplay")),this.config.controls.includes("download")){var d={element:"a",href:this.download,target:"_blank"},f=this.config.urls.download;!Ri.url(f)&&this.isEmbed&&gr(d,{icon:"logo-".concat(this.provider),label:this.provider}),n.appendChild(Br.createButton.call(this,"download",d))}return this.config.controls.includes("fullscreen")&&n.appendChild(Br.createButton.call(this,"fullscreen")),this.config.controls.includes("play-large")&&this.elements.container.appendChild(Br.createButton.call(this,"play-large")),this.elements.controls=n,this.isHTML5&&Br.setQualityMenu.call(this,fr.getQualityOptions.call(this)),Br.setSpeedMenu.call(this),n},inject:function(){var e=this;if(this.config.loadSprite){var t=Br.getIconUrl.call(this);t.cors&&Dr(t.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());var n=null;this.elements.controls=null;var i={id:this.id,seektime:this.config.seekTime,title:this.config.title},r=!0;Ri.function(this.config.controls)&&(this.config.controls=this.config.controls.call(this,i)),this.config.controls||(this.config.controls=[]),Ri.element(this.config.controls)||Ri.string(this.config.controls)?n=this.config.controls:(n=Br.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:zr.getLabel.call(this)}),r=!1);var a,o=function(e){var t=e;return Object.entries(i).forEach(function(e){var n=gn(e,2),i=n[0],r=n[1];t=xr(t,"{".concat(i,"}"),r)}),t};if(r&&(Ri.string(this.config.controls)?n=o(n):Ri.element(n)&&(n.innerHTML=o(n.innerHTML))),Ri.string(this.config.selectors.controls.container)&&(a=document.querySelector(this.config.selectors.controls.container)),Ri.element(a)||(a=this.elements.container),a[Ri.element(n)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",n),Ri.element(this.elements.controls)||Br.findElements.call(this),!Ri.empty(this.elements.buttons)){var s=function(t){var n=e.config.classNames.controlPressed;Object.defineProperty(t,"pressed",{enumerable:!0,get:function(){return Zi(t,n)},set:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];Xi(t,n,e)}})};Object.values(this.elements.buttons).filter(Boolean).forEach(function(e){Ri.array(e)||Ri.nodeList(e)?Array.from(e).filter(Boolean).forEach(s):s(e)})}if(window.navigator.userAgent.includes("Edge")&&lr(a),this.config.tooltips.controls){var l=this.config,c=l.classNames,u=l.selectors,h="".concat(u.controls.wrapper," ").concat(u.labels," .").concat(c.hidden),d=tr.call(this,h);Array.from(d).forEach(function(t){Xi(t,e.config.classNames.hidden,!1),Xi(t,e.config.classNames.tooltip,!0)})}}};function Ur(e){var t=e;if(!(arguments.length>1&&void 0!==arguments[1])||arguments[1]){var n=document.createElement("a");n.href=t,t=n.href}try{return new URL(t)}catch(e){return null}}function Wr(e){var t=new URLSearchParams;return Ri.object(e)&&Object.entries(e).forEach(function(e){var n=gn(e,2),i=n[0],r=n[1];t.set(i,r)}),t}var zr={setup:function(){if(this.supported.ui)if(!this.isVideo||this.isYouTube||this.isHTML5&&!dr.textTracks)Ri.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Br.setCaptionsMenu.call(this);else{var e,t;if(Ri.element(this.elements.captions)||(this.elements.captions=zi("div",$i(this.config.selectors.captions)),e=this.elements.captions,t=this.elements.wrapper,Ri.element(e)&&Ri.element(t)&&t.parentNode.insertBefore(e,t.nextSibling)),ur.isIE&&window.URL){var n=this.media.querySelectorAll("track");Array.from(n).forEach(function(e){var t=e.getAttribute("src"),n=Ur(t);null!==n&&n.hostname!==window.location.href.hostname&&["http:","https:"].includes(n.protocol)&&Rr(t,"blob").then(function(t){e.setAttribute("src",window.URL.createObjectURL(t))}).catch(function(){Yi(e)})})}var i=pr((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map(function(e){return e.split("-")[0]})),r=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();if("auto"===r)r=gn(i,1)[0];var a=this.storage.get("captions");if(Ri.boolean(a)||(a=this.config.captions.active),Object.assign(this.captions,{toggled:!1,active:a,language:r,languages:i}),this.isHTML5){var o=this.config.captions.update?"addtrack removetrack":"removetrack";qi.call(this,this.media.textTracks,o,zr.update.bind(this))}setTimeout(zr.update.bind(this),0)}},update:function(){var e=this,t=zr.getTracks.call(this,!0),n=this.captions,i=n.active,r=n.language,a=n.meta,o=n.currentTrackNode,s=Boolean(t.find(function(e){return e.language===r}));this.isHTML5&&this.isVideo&&t.filter(function(e){return!a.get(e)}).forEach(function(t){e.debug.log("Track added",t),a.set(t,{default:"showing"===t.mode}),t.mode="hidden",qi.call(e,t,"cuechange",function(){return zr.updateCues.call(e)})}),(s&&this.language!==r||!t.includes(o))&&(zr.setLanguage.call(this,r),zr.toggle.call(this,i&&s)),Xi(this.elements.container,this.config.classNames.captions.enabled,!Ri.empty(t)),(this.config.controls||[]).includes("settings")&&this.config.settings.includes("captions")&&Br.setCaptionsMenu.call(this)},toggle:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.supported.ui){var n=this.captions.toggled,i=this.config.classNames.captions.active,r=Ri.nullOrUndefined(e)?!n:e;if(r!==n){if(t||(this.captions.active=r,this.storage.set({captions:r})),!this.language&&r&&!t){var a=zr.getTracks.call(this),o=zr.findTrack.call(this,[this.captions.language].concat(yn(this.captions.languages)),!0);return this.captions.language=o.language,void zr.set.call(this,a.indexOf(o))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=r),Xi(this.elements.container,i,r),this.captions.toggled=r,Br.updateSetting.call(this,"captions"),Bi.call(this,this.media,r?"captionsenabled":"captionsdisabled")}}},set:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=zr.getTracks.call(this);if(-1!==e)if(Ri.number(e))if(e in n){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;var i=n[e],r=(i||{}).language;this.captions.currentTrackNode=i,Br.updateSetting.call(this,"captions"),t||(this.captions.language=r,this.storage.set({language:r})),this.isVimeo&&this.embed.enableTextTrack(r),Bi.call(this,this.media,"languagechange")}zr.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&zr.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else zr.toggle.call(this,!1,t)},setLanguage:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Ri.string(e)){var n=e.toLowerCase();this.captions.language=n;var i=zr.getTracks.call(this),r=zr.findTrack.call(this,[n]);zr.set.call(this,i.indexOf(r),t)}else this.debug.warn("Invalid language argument",e)},getTracks:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Array.from((this.media||{}).textTracks||[]).filter(function(n){return!e.isHTML5||t||e.captions.meta.has(n)}).filter(function(e){return["captions","subtitles"].includes(e.kind)})},findTrack:function(e){var t,n=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=zr.getTracks.call(this),a=function(e){return Number((n.captions.meta.get(e)||{}).default)},o=Array.from(r).sort(function(e,t){return a(t)-a(e)});return e.every(function(e){return!(t=o.find(function(t){return t.language===e}))}),t||(i?o[0]:void 0)},getCurrentTrack:function(){return zr.getTracks.call(this)[this.currentTrack]},getLabel:function(e){var t=e;return!Ri.track(t)&&dr.textTracks&&this.captions.toggled&&(t=zr.getCurrentTrack.call(this)),Ri.track(t)?Ri.empty(t.label)?Ri.empty(t.language)?Lr("enabled",this.config):e.language.toUpperCase():t.label:Lr("disabled",this.config)},updateCues:function(e){if(this.supported.ui)if(Ri.element(this.elements.captions))if(Ri.nullOrUndefined(e)||Array.isArray(e)){var t=e;if(!t){var n=zr.getCurrentTrack.call(this);t=Array.from((n||{}).activeCues||[]).map(function(e){return e.getCueAsHTML()}).map(Mr)}var i=t.map(function(e){return e.trim()}).join("\n");if(i!==this.elements.captions.innerHTML){Gi(this.elements.captions);var r=zi("span",$i(this.config.selectors.caption));r.innerHTML=i,this.elements.captions.appendChild(r),Bi.call(this,this.media,"cuechange")}}else this.debug.warn("updateCues: Invalid input",e);else this.debug.warn("No captions element to render to")}},Kr={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:"16:9",clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.4.7/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240]},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"}},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/v2/video/{0}.json"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://www.googleapis.com/youtube/v3/videos?id={0}&key={1}&fields=items(snippet(title))&part=snippet"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption",menu:{quality:".js-plyr__menu__list--quality"}},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isIos:"plyr--is-ios",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},tabFocus:"plyr__tab-focus",previewThumbnails:{thumbnailContainer:"plyr__preview-thumbnail-container",scrubbingContainer:"plyr__preview-scrubbing-container",timeTextContainer:"plyr__preview-time-text-container"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id"}},keys:{google:null},ads:{enabled:!1,publisherId:""},previewThumbnails:{enabled:!1}},Yr="picture-in-picture",Gr="inline",Jr={html5:"html5",youtube:"youtube",vimeo:"vimeo"},$r={audio:"audio",video:"video"};var Qr=function(){},Xr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];dn(this,e),this.enabled=window.console&&t,this.enabled&&this.log("Debugging enabled")}return pn(e,[{key:"log",get:function(){return this.enabled?Function.prototype.bind.call(console.log,console):Qr}},{key:"warn",get:function(){return this.enabled?Function.prototype.bind.call(console.warn,console):Qr}},{key:"error",get:function(){return this.enabled?Function.prototype.bind.call(console.error,console):Qr}}]),e}();function Zr(){if(this.enabled){var e=this.player.elements.buttons.fullscreen;Ri.element(e)&&(e.pressed=this.active),Bi.call(this.player,this.target,this.active?"enterfullscreen":"exitfullscreen",!0),ur.isIos||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Ri.element(e)){var n=tr.call(this,"button:not(:disabled), input:not(:disabled), [tabindex]"),i=n[0],r=n[n.length-1];Fi.call(this,this.elements.container,"keydown",function(e){if("Tab"===e.key&&9===e.keyCode){var t=document.activeElement;t!==r||e.shiftKey?t===i&&e.shiftKey&&(r.focus(),e.preventDefault()):(i.focus(),e.preventDefault())}},t,!1)}}.call(this.player,this.target,this.active)}}function ea(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(t?this.scrollPosition={x:window.scrollX||0,y:window.scrollY||0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=t?"hidden":"",Xi(this.target,this.player.config.classNames.fullscreen.fallback,t),ur.isIos){var n=document.head.querySelector('meta[name="viewport"]'),i="viewport-fit=cover";n||(n=document.createElement("meta")).setAttribute("name","viewport");var r=Ri.string(n.content)&&n.content.includes(i);t?(this.cleanupViewport=!r,r||(n.content+=",".concat(i))):this.cleanupViewport&&(n.content=n.content.split(",").filter(function(e){return e.trim()!==i}).join(",")),setTimeout(function(){return lr(e.target)},100)}Zr.call(this)}var ta=function(){function e(t){var n=this;dn(this,e),this.player=t,this.prefix=e.prefix,this.property=e.property,this.scrollPosition={x:0,y:0},qi.call(this.player,document,"ms"===this.prefix?"MSFullscreenChange":"".concat(this.prefix,"fullscreenchange"),function(){Zr.call(n)}),qi.call(this.player,this.player.elements.container,"dblclick",function(e){Ri.element(n.player.elements.controls)&&n.player.elements.controls.contains(e.target)||n.toggle()}),this.update()}return pn(e,[{key:"update",value:function(){this.enabled?this.player.debug.log("".concat(e.native?"Native":"Fallback"," fullscreen enabled")):this.player.debug.log("Fullscreen not supported and fallback disabled"),Xi(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.enabled)}},{key:"enter",value:function(){this.enabled&&(ur.isIos&&this.player.config.fullscreen.iosNative?this.target.webkitEnterFullscreen():e.native?this.prefix?Ri.empty(this.prefix)||this.target["".concat(this.prefix,"Request").concat(this.property)]():this.target.requestFullscreen():ea.call(this,!0))}},{key:"exit",value:function(){if(this.enabled)if(ur.isIos&&this.player.config.fullscreen.iosNative)this.target.webkitExitFullscreen(),this.player.play();else if(e.native)if(this.prefix){if(!Ri.empty(this.prefix)){var t="moz"===this.prefix?"Cancel":"Exit";document["".concat(this.prefix).concat(t).concat(this.property)]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document);else ea.call(this,!1)}},{key:"toggle",value:function(){this.active?this.exit():this.enter()}},{key:"enabled",get:function(){return(e.native||this.player.config.fullscreen.fallback)&&this.player.config.fullscreen.enabled&&this.player.supported.ui&&this.player.isVideo}},{key:"active",get:function(){return!!this.enabled&&(e.native?(this.prefix?document["".concat(this.prefix).concat(this.property,"Element")]:document.fullscreenElement)===this.target:Zi(this.target,this.player.config.classNames.fullscreen.fallback))}},{key:"target",get:function(){return ur.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.container}}],[{key:"native",get:function(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}},{key:"prefix",get:function(){if(Ri.function(document.exitFullscreen))return"";var e="";return["webkit","moz","ms"].some(function(t){return!(!Ri.function(document["".concat(t,"ExitFullscreen")])&&!Ri.function(document["".concat(t,"CancelFullScreen")]))&&(e=t,!0)}),e}},{key:"property",get:function(){return"moz"===this.prefix?"FullScreen":"Fullscreen"}}]),e}(),na=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1};function ia(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new Promise(function(n,i){var r=new Image,a=function(){delete r.onload,delete r.onerror,(r.naturalWidth>=t?n:i)(r)};Object.assign(r,{onload:a,onerror:a,src:e})})}P(P.S,"Math",{sign:na});var ra={addStyleHook:function(){Xi(this.elements.container,this.config.selectors.container.replace(".",""),!0),Xi(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build:function(){var e=this;if(this.listeners.media(),!this.supported.ui)return this.debug.warn("Basic support only for ".concat(this.provider," ").concat(this.type)),void ra.toggleNativeControls.call(this,!0);Ri.element(this.elements.controls)||(Br.inject.call(this),this.listeners.controls()),ra.toggleNativeControls.call(this),this.isHTML5&&zr.setup.call(this),this.volume=null,this.muted=null,this.speed=null,this.loop=null,this.quality=null,Br.updateVolume.call(this),Br.timeUpdate.call(this),ra.checkPlaying.call(this),Xi(this.elements.container,this.config.classNames.pip.supported,dr.pip&&this.isHTML5&&this.isVideo),Xi(this.elements.container,this.config.classNames.airplay.supported,dr.airplay&&this.isHTML5),Xi(this.elements.container,this.config.classNames.isIos,ur.isIos),Xi(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout(function(){Bi.call(e,e.media,"ready")},0),ra.setTitle.call(this),this.poster&&ra.setPoster.call(this,this.poster,!1).catch(function(){}),this.config.duration&&Br.durationUpdate.call(this)},setTitle:function(){var e=Lr("play",this.config);if(Ri.string(this.config.title)&&!Ri.empty(this.config.title)&&(e+=", ".concat(this.config.title)),Array.from(this.elements.buttons.play||[]).forEach(function(t){t.setAttribute("aria-label",e)}),this.isEmbed){var t=nr.call(this,"iframe");if(!Ri.element(t))return;var n=Ri.empty(this.config.title)?"video":this.config.title,i=Lr("frameTitle",this.config);t.setAttribute("title",i.replace("{title}",n))}},togglePoster:function(e){Xi(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster:function(e){var t=this;return arguments.length>1&&void 0!==arguments[1]&&!arguments[1]||!this.poster?(this.media.setAttribute("poster",e),function(){var e=this;return new Promise(function(t){return e.ready?setTimeout(t,0):qi.call(e,e.elements.container,"ready",t)}).then(function(){})}.call(this).then(function(){return ia(e)}).catch(function(n){throw e===t.poster&&ra.togglePoster.call(t,!1),n}).then(function(){if(e!==t.poster)throw new Error("setPoster cancelled by later call to setPoster")}).then(function(){return Object.assign(t.elements.poster.style,{backgroundImage:"url('".concat(e,"')"),backgroundSize:""}),ra.togglePoster.call(t,!0),e})):Promise.reject(new Error("Poster already set"))},checkPlaying:function(e){var t=this;Xi(this.elements.container,this.config.classNames.playing,this.playing),Xi(this.elements.container,this.config.classNames.paused,this.paused),Xi(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach(function(e){e.pressed=t.playing}),Ri.event(e)&&"timeupdate"===e.type||ra.toggleControls.call(this)},checkLoading:function(e){var t=this;this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout(function(){Xi(t.elements.container,t.config.classNames.loading,t.loading),ra.toggleControls.call(t)},this.loading?250:0)},toggleControls:function(e){var t=this.elements.controls;if(t&&this.config.hideControls){var n=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(Boolean(e||this.loading||this.paused||t.pressed||t.hover||n))}}},aa=function(){function e(t){dn(this,e),this.player=t,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.setTabFocus=this.setTabFocus.bind(this),this.firstTouch=this.firstTouch.bind(this)}return pn(e,[{key:"handleKey",value:function(e){var t=this.player,n=t.elements,i=e.keyCode?e.keyCode:e.which,r="keydown"===e.type,a=r&&i===this.lastKey;if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)&&Ri.number(i)){if(r){var o=document.activeElement;if(Ri.element(o)){var s=t.config.selectors.editable;if(o!==n.inputs.seek&&er(o,s))return;if(32===e.which&&er(o,'button, [role^="menuitem"]'))return}switch([32,37,38,39,40,48,49,50,51,52,53,54,56,57,67,70,73,75,76,77,79].includes(i)&&(e.preventDefault(),e.stopPropagation()),i){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:a||(t.currentTime=t.duration/10*(i-48));break;case 32:case 75:a||t.togglePlay();break;case 38:t.increaseVolume(.1);break;case 40:t.decreaseVolume(.1);break;case 77:a||(t.muted=!t.muted);break;case 39:t.forward();break;case 37:t.rewind();break;case 70:t.fullscreen.toggle();break;case 67:a||t.toggleCaptions();break;case 76:t.loop=!t.loop}!t.fullscreen.enabled&&t.fullscreen.active&&27===i&&t.fullscreen.toggle(),this.lastKey=i}else this.lastKey=null}}},{key:"toggleMenu",value:function(e){Br.toggleMenu.call(this.player,e)}},{key:"firstTouch",value:function(){var e=this.player,t=e.elements;e.touch=!0,Xi(t.container,e.config.classNames.isTouch,!0)}},{key:"setTabFocus",value:function(e){var t=this.player,n=t.elements;if(clearTimeout(this.focusTimer),"keydown"!==e.type||9===e.which){"keydown"===e.type&&(this.lastKeyDown=e.timeStamp);var i,r=e.timeStamp-this.lastKeyDown<=20;if("focus"!==e.type||r)i=t.config.classNames.tabFocus,Xi(tr.call(t,".".concat(i)),i,!1),this.focusTimer=setTimeout(function(){var e=document.activeElement;n.container.contains(e)&&Xi(document.activeElement,t.config.classNames.tabFocus,!0)},10)}}},{key:"global",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.player;t.config.keyboard.global&&Fi.call(t,window,"keydown keyup",this.handleKey,e,!1),Fi.call(t,document.body,"click",this.toggleMenu,e),Vi.call(t,document.body,"touchstart",this.firstTouch),Fi.call(t,document.body,"keydown focus blur",this.setTabFocus,e,!1,!0)}},{key:"container",value:function(){var e=this.player,t=e.elements;!e.config.keyboard.global&&e.config.keyboard.focused&&qi.call(e,t.container,"keydown keyup",this.handleKey,!1),qi.call(e,t.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",function(n){var i=t.controls;i&&"enterfullscreen"===n.type&&(i.pressed=!1,i.hover=!1);var r=0;["touchstart","touchmove","mousemove"].includes(n.type)&&(ra.toggleControls.call(e,!0),r=e.touch?3e3:2e3),clearTimeout(e.timers.controls),e.timers.controls=setTimeout(function(){return ra.toggleControls.call(e,!1)},r)})}},{key:"media",value:function(){var e=this,t=this.player,n=t.elements;if(qi.call(t,t.media,"timeupdate seeking seeked",function(e){return Br.timeUpdate.call(t,e)}),qi.call(t,t.media,"durationchange loadeddata loadedmetadata",function(e){return Br.durationUpdate.call(t,e)}),qi.call(t,t.media,"canplay loadeddata",function(){Qi(n.volume,!t.hasAudio),Qi(n.buttons.mute,!t.hasAudio)}),qi.call(t,t.media,"ended",function(){t.isHTML5&&t.isVideo&&t.config.resetOnEnd&&t.restart()}),qi.call(t,t.media,"progress playing seeking seeked",function(e){return Br.updateProgress.call(t,e)}),qi.call(t,t.media,"volumechange",function(e){return Br.updateVolume.call(t,e)}),qi.call(t,t.media,"playing play pause ended emptied timeupdate",function(e){return ra.checkPlaying.call(t,e)}),qi.call(t,t.media,"waiting canplay seeked playing",function(e){return ra.checkLoading.call(t,e)}),qi.call(t,t.media,"playing",function(){t.ads&&t.ads.enabled&&!t.ads.initialized&&t.ads.managerPromise.then(function(){return t.ads.play()}).catch(function(){return t.play()})}),t.supported.ui&&t.config.clickToPlay&&!t.isAudio){var i=nr.call(t,".".concat(t.config.classNames.video));if(!Ri.element(i))return;qi.call(t,n.container,"click",function(r){([n.container,i].includes(r.target)||i.contains(r.target))&&(t.touch&&t.config.hideControls||(t.ended?(e.proxy(r,t.restart,"restart"),e.proxy(r,t.play,"play")):e.proxy(r,t.togglePlay,"play")))})}t.supported.ui&&t.config.disableContextMenu&&qi.call(t,n.wrapper,"contextmenu",function(e){e.preventDefault()},!1),qi.call(t,t.media,"volumechange",function(){t.storage.set({volume:t.volume,muted:t.muted})}),qi.call(t,t.media,"ratechange",function(){Br.updateSetting.call(t,"speed"),t.storage.set({speed:t.speed})}),qi.call(t,t.media,"qualitychange",function(e){Br.updateSetting.call(t,"quality",null,e.detail.quality)}),qi.call(t,t.media,"ready qualitychange",function(){Br.setDownloadLink.call(t)});var r=t.config.events.concat(["keyup","keydown"]).join(" ");qi.call(t,t.media,r,function(e){var i=e.detail,r=void 0===i?{}:i;"error"===e.type&&(r=t.media.error),Bi.call(t,n.container,e.type,!0,r)})}},{key:"proxy",value:function(e,t,n){var i=this.player,r=i.config.listeners[n],a=!0;Ri.function(r)&&(a=r.call(i,e)),a&&Ri.function(t)&&t.call(i,e)}},{key:"bind",value:function(e,t,n,i){var r=this,a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=this.player,s=o.config.listeners[i],l=Ri.function(s);qi.call(o,e,t,function(e){return r.proxy(e,n,i)},a&&!l)}},{key:"controls",value:function(){var e=this,t=this.player,n=t.elements,i=ur.isIE?"change":"input";if(n.buttons.play&&Array.from(n.buttons.play).forEach(function(n){e.bind(n,"click",t.togglePlay,"play")}),this.bind(n.buttons.restart,"click",t.restart,"restart"),this.bind(n.buttons.rewind,"click",t.rewind,"rewind"),this.bind(n.buttons.fastForward,"click",t.forward,"fastForward"),this.bind(n.buttons.mute,"click",function(){t.muted=!t.muted},"mute"),this.bind(n.buttons.captions,"click",function(){return t.toggleCaptions()}),this.bind(n.buttons.download,"click",function(){Bi.call(t,t.media,"download")},"download"),this.bind(n.buttons.fullscreen,"click",function(){t.fullscreen.toggle()},"fullscreen"),this.bind(n.buttons.pip,"click",function(){t.pip="toggle"},"pip"),this.bind(n.buttons.airplay,"click",t.airplay,"airplay"),this.bind(n.buttons.settings,"click",function(e){e.stopPropagation(),Br.toggleMenu.call(t,e)}),this.bind(n.buttons.settings,"keyup",function(e){var n=e.which;[13,32].includes(n)&&(13!==n?(e.preventDefault(),e.stopPropagation(),Br.toggleMenu.call(t,e)):Br.focusFirstMenuItem.call(t,null,!0))},null,!1),this.bind(n.settings.menu,"keydown",function(e){27===e.which&&Br.toggleMenu.call(t,e)}),this.bind(n.inputs.seek,"mousedown mousemove",function(e){var t=n.progress.getBoundingClientRect(),i=100/t.width*(e.pageX-t.left);e.currentTarget.setAttribute("seek-value",i)}),this.bind(n.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",function(e){var n=e.currentTarget,i=e.keyCode?e.keyCode:e.which;if(!Ri.keyboardEvent(e)||39===i||37===i){t.lastSeekTime=Date.now();var r=n.hasAttribute("play-on-seeked"),a=["mouseup","touchend","keyup"].includes(e.type);r&&a?(n.removeAttribute("play-on-seeked"),t.play()):!a&&t.playing&&(n.setAttribute("play-on-seeked",""),t.pause())}}),ur.isIos){var r=tr.call(t,'input[type="range"]');Array.from(r).forEach(function(t){return e.bind(t,i,function(e){return lr(e.target)})})}this.bind(n.inputs.seek,i,function(e){var n=e.currentTarget,i=n.getAttribute("seek-value");Ri.empty(i)&&(i=n.value),n.removeAttribute("seek-value"),t.currentTime=i/n.max*t.duration},"seek"),this.bind(n.progress,"mouseenter mouseleave mousemove",function(e){return Br.updateSeekTooltip.call(t,e)}),ur.isWebkit&&Array.from(tr.call(t,'input[type="range"]')).forEach(function(n){e.bind(n,"input",function(e){return Br.updateRangeFill.call(t,e.target)})}),t.config.toggleInvert&&!Ri.element(n.display.duration)&&this.bind(n.display.currentTime,"click",function(){0!==t.currentTime&&(t.config.invertTime=!t.config.invertTime,Br.timeUpdate.call(t))}),this.bind(n.inputs.volume,i,function(e){t.volume=e.target.value},"volume"),this.bind(n.controls,"mouseenter mouseleave",function(e){n.controls.hover=!t.touch&&"mouseenter"===e.type}),this.bind(n.controls,"mousedown mouseup touchstart touchend touchcancel",function(e){n.controls.pressed=["mousedown","touchstart"].includes(e.type)}),this.bind(n.controls,"focusin",function(){var n=t.config,i=t.elements,r=t.timers;Xi(i.controls,n.classNames.noTransition,!0),ra.toggleControls.call(t,!0),setTimeout(function(){Xi(i.controls,n.classNames.noTransition,!1)},0);var a=e.touch?3e3:4e3;clearTimeout(r.controls),r.controls=setTimeout(function(){return ra.toggleControls.call(t,!1)},a)}),this.bind(n.inputs.volume,"wheel",function(e){var n=e.webkitDirectionInvertedFromDevice,i=gn([e.deltaX,-e.deltaY].map(function(e){return n?-e:e}),2),r=i[0],a=i[1],o=Math.sign(Math.abs(r)>Math.abs(a)?r:a);t.increaseVolume(o/50);var s=t.media.volume;(1===o&&s<1||-1===o&&s>0)&&e.preventDefault()},"volume",!1)}}]),e}(),oa=g.f,sa=Function.prototype,la=/^\s*function ([^ (]*)/;"name"in sa||c&&oa(sa,"name",{configurable:!0,get:function(){try{return(""+this).match(la)[1]}catch(e){return""}}}),bt("match",1,function(e,t,n,i){return[function(n){var i=e(this),r=null==n?void 0:n[t];return void 0!==r?r.call(n,i):new RegExp(n)[t](String(i))},function(e){var t=i(n,e,this);if(t.done)return t.value;var r=s(e),a=String(this);if(!r.global)return lt(r,a);var o=r.unicode;r.lastIndex=0;for(var l,c=[],u=0;null!==(l=lt(r,a));){var h=String(l[0]);c[u]=h,""===h&&(r.lastIndex=kn(a,H(r.lastIndex),o)),u++}return 0===u?null:c}]});var ca=t(function(e,t){e.exports=function(){var e=function(){},t={},n={},i={};function r(e,t){if(e){var r=i[e];if(n[e]=t,r)for(;r.length;)r[0](e,t),r.splice(0,1)}}function a(t,n){t.call&&(t={success:t}),n.length?(t.error||e)(n):(t.success||e)(t)}function o(t,n,i,r){var a,s,l=document,c=i.async,u=(i.numRetries||0)+1,h=i.before||e,d=t.replace(/^(css|img)!/,"");r=r||0,/(^css!|\.css$)/.test(t)?(a=!0,(s=l.createElement("link")).rel="stylesheet",s.href=d):/(^img!|\.(png|gif|jpg|svg)$)/.test(t)?(s=l.createElement("img")).src=d:((s=l.createElement("script")).src=t,s.async=void 0===c||c),s.onload=s.onerror=s.onbeforeload=function(e){var l=e.type[0];if(a&&"hideFocus"in s)try{s.sheet.cssText.length||(l="e")}catch(e){18!=e.code&&(l="e")}if("e"==l&&(r+=1)<u)return o(t,n,i,r);n(t,l,e.defaultPrevented)},!1!==h(t,s)&&l.head.appendChild(s)}function s(e,n,i){var s,l;if(n&&n.trim&&(s=n),l=(s?i:n)||{},s){if(s in t)throw"LoadJS";t[s]=!0}!function(e,t,n){var i,r,a=(e=e.push?e:[e]).length,s=a,l=[];for(i=function(e,n,i){if("e"==n&&l.push(e),"b"==n){if(!i)return;l.push(e)}--a||t(l)},r=0;r<s;r++)o(e[r],i,n)}(e,function(e){a(l,e),r(s,e)},l)}return s.ready=function(e,t){return function(e,t){e=e.push?e:[e];var r,a,o,s=[],l=e.length,c=l;for(r=function(e,n){n.length&&s.push(e),--c||t(s)};l--;)a=e[l],(o=n[a])?r(a,o):(i[a]=i[a]||[]).push(r)}(e,function(e){a(t,e)}),s},s.done=function(e){r(e,[])},s.reset=function(){t={},n={},i={}},s.isDefined=function(e){return e in t},s}()});function ua(e){return new Promise(function(t,n){ca(e,{success:t,error:n})})}function ha(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,Bi.call(this,this.media,e?"play":"pause"))}var da={setup:function(){var e=this;Xi(this.elements.wrapper,this.config.classNames.embed,!0),da.setAspectRatio.call(this),Ri.object(window.Vimeo)?da.ready.call(this):ua(this.config.urls.vimeo.sdk).then(function(){da.ready.call(e)}).catch(function(t){e.debug.warn("Vimeo API failed to load",t)})},setAspectRatio:function(e){var t=gn((Ri.string(e)?e:this.config.ratio).split(":").map(Number),2),n=100/t[0]*t[1];if(da.padding=n,this.elements.wrapper.style.paddingBottom="".concat(n,"%"),this.supported.ui){var i=(240-n)/4.8;this.media.style.transform="translateY(-".concat(i,"%)")}},ready:function(){var e=this,t=this,n=Wr({loop:t.config.loop.active,autoplay:t.autoplay,byline:!1,portrait:!1,title:!1,speed:!0,transparent:0,gesture:"media",playsinline:!this.config.fullscreen.iosNative}),i=t.media.getAttribute("src");Ri.empty(i)&&(i=t.media.getAttribute(t.config.attributes.embed.id));var r,a=(r=i,Ri.empty(r)?null:Ri.number(Number(r))?r:r.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:r),o=zi("iframe"),s=_r(t.config.urls.vimeo.iframe,a,n);o.setAttribute("src",s),o.setAttribute("allowfullscreen",""),o.setAttribute("allowtransparency",""),o.setAttribute("allow","autoplay");var l=zi("div",{poster:t.poster,class:t.config.classNames.embedContainer});l.appendChild(o),t.media=Ji(l,t.media),Rr(_r(t.config.urls.vimeo.api,a),"json").then(function(e){if(!Ri.empty(e)){var n=new URL(e[0].thumbnail_large);n.pathname="".concat(n.pathname.split("_")[0],".jpg"),ra.setPoster.call(t,n.href).catch(function(){})}}),t.embed=new window.Vimeo.Player(o,{autopause:t.config.autopause,muted:t.muted}),t.media.paused=!0,t.media.currentTime=0,t.supported.ui&&t.embed.disableTextTrack(),t.media.play=function(){return ha.call(t,!0),t.embed.play()},t.media.pause=function(){return ha.call(t,!1),t.embed.pause()},t.media.stop=function(){t.pause(),t.currentTime=0};var c=t.media.currentTime;Object.defineProperty(t.media,"currentTime",{get:function(){return c},set:function(e){var n=t.embed,i=t.media,r=t.paused,a=t.volume,o=r&&!n.hasPlayed;i.seeking=!0,Bi.call(t,i,"seeking"),Promise.resolve(o&&n.setVolume(0)).then(function(){return n.setCurrentTime(e)}).then(function(){return o&&n.pause()}).then(function(){return o&&n.setVolume(a)}).catch(function(){})}});var u=t.config.speed.selected;Object.defineProperty(t.media,"playbackRate",{get:function(){return u},set:function(e){t.embed.setPlaybackRate(e).then(function(){u=e,Bi.call(t,t.media,"ratechange")}).catch(function(e){"Error"===e.name&&Br.setSpeedMenu.call(t,[])})}});var h=t.config.volume;Object.defineProperty(t.media,"volume",{get:function(){return h},set:function(e){t.embed.setVolume(e).then(function(){h=e,Bi.call(t,t.media,"volumechange")})}});var d=t.config.muted;Object.defineProperty(t.media,"muted",{get:function(){return d},set:function(e){var n=!!Ri.boolean(e)&&e;t.embed.setVolume(n?0:t.config.volume).then(function(){d=n,Bi.call(t,t.media,"volumechange")})}});var f,p=t.config.loop;Object.defineProperty(t.media,"loop",{get:function(){return p},set:function(e){var n=Ri.boolean(e)?e:t.config.loop.active;t.embed.setLoop(n).then(function(){p=n})}}),t.embed.getVideoUrl().then(function(e){f=e,Br.setDownloadLink.call(t)}).catch(function(t){e.debug.warn(t)}),Object.defineProperty(t.media,"currentSrc",{get:function(){return f}}),Object.defineProperty(t.media,"ended",{get:function(){return t.currentTime===t.duration}}),Promise.all([t.embed.getVideoWidth(),t.embed.getVideoHeight()]).then(function(t){var n,i,r;da.ratio=(n=t[0],i=t[1],r=function e(t,n){return 0===n?t:e(n,t%n)}(n,i),"".concat(n/r,":").concat(i/r)),da.setAspectRatio.call(e,da.ratio)}),t.embed.setAutopause(t.config.autopause).then(function(e){t.config.autopause=e}),t.embed.getVideoTitle().then(function(n){t.config.title=n,ra.setTitle.call(e)}),t.embed.getCurrentTime().then(function(e){c=e,Bi.call(t,t.media,"timeupdate")}),t.embed.getDuration().then(function(e){t.media.duration=e,Bi.call(t,t.media,"durationchange")}),t.embed.getTextTracks().then(function(e){t.media.textTracks=e,zr.setup.call(t)}),t.embed.on("cuechange",function(e){var n=e.cues,i=(void 0===n?[]:n).map(function(e){return t=e.text,n=document.createDocumentFragment(),i=document.createElement("div"),n.appendChild(i),i.innerHTML=t,n.firstChild.innerText;var t,n,i});zr.updateCues.call(t,i)}),t.embed.on("loaded",function(){(t.embed.getPaused().then(function(e){ha.call(t,!e),e||Bi.call(t,t.media,"playing")}),Ri.element(t.embed.element)&&t.supported.ui)&&t.embed.element.setAttribute("tabindex",-1)}),t.embed.on("play",function(){ha.call(t,!0),Bi.call(t,t.media,"playing")}),t.embed.on("pause",function(){ha.call(t,!1)}),t.embed.on("timeupdate",function(e){t.media.seeking=!1,c=e.seconds,Bi.call(t,t.media,"timeupdate")}),t.embed.on("progress",function(e){t.media.buffered=e.percent,Bi.call(t,t.media,"progress"),1===parseInt(e.percent,10)&&Bi.call(t,t.media,"canplaythrough"),t.embed.getDuration().then(function(e){e!==t.media.duration&&(t.media.duration=e,Bi.call(t,t.media,"durationchange"))})}),t.embed.on("seeked",function(){t.media.seeking=!1,Bi.call(t,t.media,"seeked")}),t.embed.on("ended",function(){t.media.paused=!0,Bi.call(t,t.media,"ended")}),t.embed.on("error",function(e){t.media.error=e,Bi.call(t,t.media,"error")}),t.on("enterfullscreen exitfullscreen",function(e){var n=t.fullscreen.target;if(n===t.elements.container){var i="enterfullscreen"===e.type,r=gn(da.ratio.split(":").map(Number),2),a=r[0]>r[1]?"width":"height";n.style[a]=i?"".concat(da.padding,"%"):null}}),setTimeout(function(){return ra.build.call(t)},0)}};function fa(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,Bi.call(this,this.media,e?"play":"pause"))}var pa={setup:function(){var e=this;Xi(this.elements.wrapper,this.config.classNames.embed,!0),pa.setAspectRatio.call(this),Ri.object(window.YT)&&Ri.function(window.YT.Player)?pa.ready.call(this):(ua(this.config.urls.youtube.sdk).catch(function(t){e.debug.warn("YouTube API failed to load",t)}),window.onYouTubeReadyCallbacks=window.onYouTubeReadyCallbacks||[],window.onYouTubeReadyCallbacks.push(function(){pa.ready.call(e)}),window.onYouTubeIframeAPIReady=function(){window.onYouTubeReadyCallbacks.forEach(function(e){e()})})},getTitle:function(e){var t=this;if(Ri.function(this.embed.getVideoData)){var n=this.embed.getVideoData().title;if(Ri.empty(n))return this.config.title=n,void ra.setTitle.call(this)}var i=this.config.keys.google;Ri.string(i)&&!Ri.empty(i)&&Rr(_r(this.config.urls.youtube.api,e,i)).then(function(e){Ri.object(e)&&(t.config.title=e.items[0].snippet.title,ra.setTitle.call(t))}).catch(function(){})},setAspectRatio:function(){var e=this.config.ratio.split(":");this.elements.wrapper.style.paddingBottom="".concat(100/e[0]*e[1],"%")},ready:function(){var e=this,t=e.media.getAttribute("id");if(Ri.empty(t)||!t.startsWith("youtube-")){var n=e.media.getAttribute("src");Ri.empty(n)&&(n=e.media.getAttribute(this.config.attributes.embed.id));var i,r,a=(i=n,Ri.empty(i)?null:i.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:i),o=(r=e.provider,"".concat(r,"-").concat(Math.floor(1e4*Math.random()))),s=zi("div",{id:o,poster:e.poster});e.media=Ji(s,e.media);var l=function(e){return"https://img.youtube.com/vi/".concat(a,"/").concat(e,"default.jpg")};ia(l("maxres"),121).catch(function(){return ia(l("sd"),121)}).catch(function(){return ia(l("hq"))}).then(function(t){return ra.setPoster.call(e,t.src)}).then(function(t){t.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")}).catch(function(){}),e.embed=new window.YT.Player(o,{videoId:a,playerVars:{autoplay:e.config.autoplay?1:0,hl:e.config.hl,controls:e.supported.ui?0:1,rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,disablekb:1,playsinline:1,widget_referrer:window?window.location.href:null,cc_load_policy:e.captions.active?1:0,cc_lang_pref:e.config.captions.language},events:{onError:function(t){if(!e.media.error){var n=t.data,i={2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[n]||"An unknown error occured";e.media.error={code:n,message:i},Bi.call(e,e.media,"error")}},onPlaybackRateChange:function(t){var n=t.target;e.media.playbackRate=n.getPlaybackRate(),Bi.call(e,e.media,"ratechange")},onReady:function(t){if(!Ri.function(e.media.play)){var n=t.target;pa.getTitle.call(e,a),e.media.play=function(){fa.call(e,!0),n.playVideo()},e.media.pause=function(){fa.call(e,!1),n.pauseVideo()},e.media.stop=function(){n.stopVideo()},e.media.duration=n.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get:function(){return Number(n.getCurrentTime())},set:function(t){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,Bi.call(e,e.media,"seeking"),n.seekTo(t)}}),Object.defineProperty(e.media,"playbackRate",{get:function(){return n.getPlaybackRate()},set:function(e){n.setPlaybackRate(e)}});var i=e.config.volume;Object.defineProperty(e.media,"volume",{get:function(){return i},set:function(t){i=t,n.setVolume(100*i),Bi.call(e,e.media,"volumechange")}});var r=e.config.muted;Object.defineProperty(e.media,"muted",{get:function(){return r},set:function(t){var i=Ri.boolean(t)?t:r;r=i,n[i?"mute":"unMute"](),Bi.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get:function(){return n.getVideoUrl()}}),Object.defineProperty(e.media,"ended",{get:function(){return e.currentTime===e.duration}}),e.options.speed=n.getAvailablePlaybackRates(),e.supported.ui&&e.media.setAttribute("tabindex",-1),Bi.call(e,e.media,"timeupdate"),Bi.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval(function(){e.media.buffered=n.getVideoLoadedFraction(),(null===e.media.lastBuffered||e.media.lastBuffered<e.media.buffered)&&Bi.call(e,e.media,"progress"),e.media.lastBuffered=e.media.buffered,1===e.media.buffered&&(clearInterval(e.timers.buffering),Bi.call(e,e.media,"canplaythrough"))},200),setTimeout(function(){return ra.build.call(e)},50)}},onStateChange:function(t){var n=t.target;switch(clearInterval(e.timers.playing),e.media.seeking&&[1,2].includes(t.data)&&(e.media.seeking=!1,Bi.call(e,e.media,"seeked")),t.data){case-1:Bi.call(e,e.media,"timeupdate"),e.media.buffered=n.getVideoLoadedFraction(),Bi.call(e,e.media,"progress");break;case 0:fa.call(e,!1),e.media.loop?(n.stopVideo(),n.playVideo()):Bi.call(e,e.media,"ended");break;case 1:e.media.paused&&!e.embed.hasPlayed?e.media.pause():(fa.call(e,!0),Bi.call(e,e.media,"playing"),e.timers.playing=setInterval(function(){Bi.call(e,e.media,"timeupdate")},50),e.media.duration!==n.getDuration()&&(e.media.duration=n.getDuration(),Bi.call(e,e.media,"durationchange")));break;case 2:e.muted||e.embed.unMute(),fa.call(e,!1)}Bi.call(e,e.elements.container,"statechange",!1,{code:t.data})}}})}}},ma={setup:function(){this.media?(Xi(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),Xi(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&Xi(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=zi("div",{class:this.config.classNames.video}),Ui(this.media,this.elements.wrapper),this.elements.poster=zi("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?fr.extend.call(this):this.isYouTube?pa.setup.call(this):this.isVimeo&&da.setup.call(this)):this.debug.warn("No media element found!")}},ga=function(){function e(t){var n=this;dn(this,e),this.player=t,this.publisherId=t.config.ads.publisherId,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise(function(e,t){n.on("loaded",e),n.on("error",t)}),this.load()}return pn(e,[{key:"load",value:function(){var e=this;this.enabled&&(Ri.object(window.google)&&Ri.object(window.google.ima)?this.ready():ua(this.player.config.urls.googleIMA.sdk).then(function(){e.ready()}).catch(function(){e.trigger("error",new Error("Google IMA SDK failed to load"))}))}},{key:"ready",value:function(){var e=this;this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then(function(){e.clearSafetyTimer("onAdsManagerLoaded()")}),this.listeners(),this.setupIMA()}},{key:"setupIMA",value:function(){this.elements.container=zi("div",{class:this.player.config.classNames.ads}),this.player.elements.container.appendChild(this.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(this.player.config.ads.language),this.elements.displayContainer=new google.ima.AdDisplayContainer(this.elements.container),this.requestAds()}},{key:"requestAds",value:function(){var e=this,t=this.player.elements.container;try{this.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,function(t){return e.onAdsManagerLoaded(t)},!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,function(t){return e.onAdError(t)},!1);var n=new google.ima.AdsRequest;n.adTagUrl=this.tagUrl,n.linearAdSlotWidth=t.offsetWidth,n.linearAdSlotHeight=t.offsetHeight,n.nonLinearAdSlotWidth=t.offsetWidth,n.nonLinearAdSlotHeight=t.offsetHeight,n.forceNonLinearFullSlot=!1,n.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(n)}catch(e){this.onAdError(e)}}},{key:"pollCountdown",value:function(){var e=this;if(!(arguments.length>0&&void 0!==arguments[0]&&arguments[0]))return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");this.countdownTimer=setInterval(function(){var t=Vr(Math.max(e.manager.getRemainingTime(),0)),n="".concat(Lr("advertisement",e.player.config)," - ").concat(t);e.elements.container.setAttribute("data-badge-text",n)},100)}},{key:"onAdsManagerLoaded",value:function(e){var t=this;if(this.enabled){var n=new google.ima.AdsRenderingSettings;n.restoreCustomPlaybackStateOnAdBreakComplete=!0,n.enablePreloading=!0,this.manager=e.getAdsManager(this.player,n),this.cuePoints=this.manager.getCuePoints(),Ri.empty(this.cuePoints)||this.cuePoints.forEach(function(e){if(0!==e&&-1!==e&&e<t.player.duration){var n=t.player.elements.progress;if(Ri.element(n)){var i=100/t.player.duration*e,r=zi("span",{class:t.player.config.classNames.cues});r.style.left="".concat(i.toString(),"%"),n.appendChild(r)}}}),this.manager.setVolume(this.player.volume),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,function(e){return t.onAdError(e)}),Object.keys(google.ima.AdEvent.Type).forEach(function(e){t.manager.addEventListener(google.ima.AdEvent.Type[e],function(e){return t.onAdEvent(e)})}),this.trigger("loaded")}}},{key:"onAdEvent",value:function(e){var t=this,n=this.player.elements.container,i=e.getAd(),r=function(e){var n="ads".concat(e.replace(/_/g,"").toLowerCase());Bi.call(t.player,t.player.media,n)};switch(e.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),r(e.type),this.pollCountdown(!0),i.isLinear()||(i.width=n.offsetWidth,i.height=n.offsetHeight);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:r(e.type),this.loadAds();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:r(e.type),this.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:r(e.type),this.pollCountdown(),this.resumeContent();break;case google.ima.AdEvent.Type.STARTED:case google.ima.AdEvent.Type.MIDPOINT:case google.ima.AdEvent.Type.COMPLETE:case google.ima.AdEvent.Type.IMPRESSION:case google.ima.AdEvent.Type.CLICK:r(e.type)}}},{key:"onAdError",value:function(e){this.cancel(),this.player.debug.warn("Ads error",e)}},{key:"listeners",value:function(){var e,t=this,n=this.player.elements.container;this.player.on("ended",function(){t.loader.contentComplete()}),this.player.on("seeking",function(){return e=t.player.currentTime}),this.player.on("seeked",function(){var n=t.player.currentTime;Ri.empty(t.cuePoints)||t.cuePoints.forEach(function(i,r){e<i&&i<n&&(t.manager.discardAdBreak(),t.cuePoints.splice(r,1))})}),window.addEventListener("resize",function(){t.manager&&t.manager.resize(n.offsetWidth,n.offsetHeight,google.ima.ViewMode.NORMAL)})}},{key:"play",value:function(){var e=this,t=this.player.elements.container;this.managerPromise||this.resumeContent(),this.managerPromise.then(function(){e.elements.displayContainer.initialize();try{e.initialized||(e.manager.init(t.offsetWidth,t.offsetHeight,google.ima.ViewMode.NORMAL),e.manager.start()),e.initialized=!0}catch(t){e.onAdError(t)}}).catch(function(){})}},{key:"resumeContent",value:function(){this.elements.container.style.zIndex="",this.playing=!1,this.player.currentTime<this.player.duration&&this.player.play()}},{key:"pauseContent",value:function(){this.elements.container.style.zIndex=3,this.playing=!0,this.player.pause()}},{key:"cancel",value:function(){this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()}},{key:"loadAds",value:function(){var e=this;this.managerPromise.then(function(){e.manager&&e.manager.destroy(),e.managerPromise=new Promise(function(t){e.on("loaded",t),e.player.debug.log(e.manager)}),e.requestAds()}).catch(function(){})}},{key:"trigger",value:function(e){for(var t=this,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var a=this.events[e];Ri.array(a)&&a.forEach(function(e){Ri.function(e)&&e.apply(t,i)})}},{key:"on",value:function(e,t){return Ri.array(this.events[e])||(this.events[e]=[]),this.events[e].push(t),this}},{key:"startSafetyTimer",value:function(e,t){var n=this;this.player.debug.log("Safety timer invoked from: ".concat(t)),this.safetyTimer=setTimeout(function(){n.cancel(),n.clearSafetyTimer("startSafetyTimer()")},e)}},{key:"clearSafetyTimer",value:function(e){Ri.nullOrUndefined(this.safetyTimer)||(this.player.debug.log("Safety timer cleared from: ".concat(e)),clearTimeout(this.safetyTimer),this.safetyTimer=null)}},{key:"enabled",get:function(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.ads.enabled&&!Ri.empty(this.publisherId)}},{key:"tagUrl",get:function(){var e={AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:this.publisherId};return"".concat("https://go.aniview.com/api/adserver6/vast/","?").concat(Wr(e))}}]),e}(),ya=ne(6),va=!0;"findIndex"in[]&&Array(1).findIndex(function(){va=!1}),P(P.P+P.F*va,"Array",{findIndex:function(e){return ya(this,e,arguments.length>1?arguments[1]:void 0)}}),ae("findIndex");var ba={f:M},wa=g.f,ka=function(e){var t=a.Symbol||(a.Symbol=r.Symbol||{});"_"==e.charAt(0)||e in t||wa(t,e,{value:ba.f(e)})};ka("asyncIterator");var Ta=Ae.f,Ea={}.toString,Sa="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Aa={f:function(e){return Sa&&"[object Window]"==Ea.call(e)?function(e){try{return Ta(e)}catch(e){return Sa.slice()}}(e):Ta(ce(e))}},Pa=Jt.KEY,Ca=he.f,_a=g.f,xa=Aa.f,Ia=r.Symbol,Na=r.JSON,Ma=Na&&Na.stringify,Oa=M("_hidden"),La=M("toPrimitive"),ja={}.propertyIsEnumerable,Ra=N("symbol-registry"),Da=N("symbols"),Fa=N("op-symbols"),qa=Object.prototype,Ha="function"==typeof Ia,Va=r.QObject,Ba=!Va||!Va.prototype||!Va.prototype.findChild,Ua=c&&l(function(){return 7!=He(_a({},"a",{get:function(){return _a(this,"a",{value:7}).a}})).a})?function(e,t,n){var i=Ca(qa,t);i&&delete qa[t],_a(e,t,n),i&&e!==qa&&_a(qa,t,i)}:_a,Wa=function(e){var t=Da[e]=He(Ia.prototype);return t._k=e,t},za=Ha&&"symbol"==typeof Ia.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof Ia},Ka=function(e,t,n){return e===qa&&Ka(Fa,t,n),s(e),t=p(t,!0),s(n),w(Da,t)?(n.enumerable?(w(e,Oa)&&e[Oa][t]&&(e[Oa][t]=!1),n=He(n,{enumerable:y(0,!1)})):(w(e,Oa)||_a(e,Oa,y(1,{})),e[Oa][t]=!0),Ua(e,t,n)):_a(e,t,n)},Ya=function(e,t){s(e);for(var n,i=function(e){var t=Oe(e),n=$t.f;if(n)for(var i,r=n(e),a=le.f,o=0;r.length>o;)a.call(e,i=r[o++])&&t.push(i);return t}(t=ce(t)),r=0,a=i.length;a>r;)Ka(e,n=i[r++],t[n]);return e},Ga=function(e){var t=ja.call(this,e=p(e,!0));return!(this===qa&&w(Da,e)&&!w(Fa,e))&&(!(t||!w(this,e)||!w(Da,e)||w(this,Oa)&&this[Oa][e])||t)},Ja=function(e,t){if(e=ce(e),t=p(t,!0),e!==qa||!w(Da,t)||w(Fa,t)){var n=Ca(e,t);return!n||!w(Da,t)||w(e,Oa)&&e[Oa][t]||(n.enumerable=!0),n}},$a=function(e){for(var t,n=xa(ce(e)),i=[],r=0;n.length>r;)w(Da,t=n[r++])||t==Oa||t==Pa||i.push(t);return i},Qa=function(e){for(var t,n=e===qa,i=xa(n?Fa:ce(e)),r=[],a=0;i.length>a;)!w(Da,t=i[a++])||n&&!w(qa,t)||r.push(Da[t]);return r};Ha||(S((Ia=function(){if(this instanceof Ia)throw TypeError("Symbol is not a constructor!");var e=E(arguments.length>0?arguments[0]:void 0),t=function(n){this===qa&&t.call(Fa,n),w(this,Oa)&&w(this[Oa],e)&&(this[Oa][e]=!1),Ua(this,e,y(1,n))};return c&&Ba&&Ua(qa,e,{configurable:!0,set:t}),Wa(e)}).prototype,"toString",function(){return this._k}),he.f=Ja,g.f=Ka,Ae.f=Aa.f=$a,le.f=Ga,$t.f=Qa,c&&S(qa,"propertyIsEnumerable",Ga,!0),ba.f=function(e){return Wa(M(e))}),P(P.G+P.W+P.F*!Ha,{Symbol:Ia});for(var Xa="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),Za=0;Xa.length>Za;)M(Xa[Za++]);for(var eo=Oe(M.store),to=0;eo.length>to;)ka(eo[to++]);P(P.S+P.F*!Ha,"Symbol",{for:function(e){return w(Ra,e+="")?Ra[e]:Ra[e]=Ia(e)},keyFor:function(e){if(!za(e))throw TypeError(e+" is not a symbol!");for(var t in Ra)if(Ra[t]===e)return t},useSetter:function(){Ba=!0},useSimple:function(){Ba=!1}}),P(P.S+P.F*!Ha,"Object",{create:function(e,t){return void 0===t?He(e):Ya(He(e),t)},defineProperty:Ka,defineProperties:Ya,getOwnPropertyDescriptor:Ja,getOwnPropertyNames:$a,getOwnPropertySymbols:Qa}),Na&&P(P.S+P.F*(!Ha||l(function(){var e=Ia();return"[null]"!=Ma([e])||"{}"!=Ma({a:e})||"{}"!=Ma(Object(e))})),"JSON",{stringify:function(e){for(var t,n,i=[e],r=1;arguments.length>r;)i.push(arguments[r++]);if(n=t=i[1],(o(t)||void 0!==e)&&!za(e))return Z(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!za(t))return t}),i[1]=t,Ma.apply(Na,i)}}),Ia.prototype[La]||v(Ia.prototype,La,Ia.prototype.valueOf),At(Ia,"Symbol"),At(Math,"Math",!0),At(r.JSON,"JSON",!0);var no,io=function(){function e(t){dn(this,e),this.player=t,this.thumbnailsDefs=[],this.lastMousemoveEventTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.enabled&&this.load()}return pn(e,[{key:"load",value:function(){var e=this;this.player.config.tooltips.seek=!1,this.getThumbnailsDefs().then(function(){e.listeners(),e.elements(),e.determineContainerAutoSizing()})}},{key:"getThumbnailsDefs",value:function(){var e=this;return new Promise(function(t,n){if(!e.player.config.previewThumbnails.src)throw new Error("Missing previewThumbnails.src config attribute");var i=e.player.config.previewThumbnails.src,r="string"==typeof i?[i]:i,a=[],o=!0,s=!1,l=void 0;try{for(var c,u=r[Symbol.iterator]();!(o=(c=u.next()).done);o=!0){var h=c.value;a.push(e.getThumbnailDef(h))}}catch(e){s=!0,l=e}finally{try{o||null==u.return||u.return()}finally{if(s)throw l}}Promise.all(a).then(function(){e.thumbnailsDefs.sort(function(e,t){return e.height-t.height}),e.player.debug.log("Preview thumbnails: thumbnailsDefs: "+JSON.stringify(e.thumbnailsDefs,null,4)),t()})})}},{key:"getThumbnailDef",value:function(e){var t=this;return new Promise(function(n,i){Rr(e).then(function(i){var r={frames:t.parseVtt(i),height:null,urlPrefix:""};r.frames[0].text.startsWith("/")||r.frames[0].text.startsWith("http://")||r.frames[0].text.startsWith("https://")||(r.urlPrefix=e.substring(0,e.lastIndexOf("/")+1));var a=new Image;a.src=r.urlPrefix+r.frames[0].text,a.onload=function(){r.height=a.naturalHeight,r.width=a.naturalWidth,t.thumbnailsDefs.push(r),n()}})})}},{key:"listeners",value:function(){var e=this;qi.call(this.player,this.player.elements.progress,"mousemove",function(t){if(e.player.media.duration){var n=e.player.elements.progress.getBoundingClientRect(),i=100/n.width*(t.pageX-n.left);e.seekTime=e.player.media.duration*(i/100),e.seekTime<0&&(e.seekTime=0),e.seekTime>e.player.media.duration-1&&(e.seekTime=e.player.media.duration-1),e.mousePosX=t.pageX,e.player.elements.display.previewThumbnailTimeText.innerText=Vr(e.seekTime),e.showImageAtCurrentTime()}}),qi.call(this.player,this.player.elements.progress,"touchmove",function(t){e.player.media.duration&&(e.seekTime=e.player.media.duration*(e.player.elements.inputs.seek.value/100),e.showImageAtCurrentTime())}),qi.call(this.player,this.player.elements.progress,"mouseleave click",function(){e.hideThumbContainer(!0)}),this.player.on("play",function(){e.hideThumbContainer(!0)}),this.player.on("seeked",function(){e.hideThumbContainer(!1)}),qi.call(this.player,this.player.elements.progress,"mousedown touchstart",function(t){t.button&&0!==t.button||(e.mouseDown=!0,e.player.media.duration&&(e.showScrubbingContainer(),e.hideThumbContainer(!0),e.showImageAtCurrentTime()))}),qi.call(this.player,this.player.media,"timeupdate",function(){e.timeAtLastTimeupdate=e.player.media.currentTime}),qi.call(this.player,this.player.elements.progress,"mouseup touchend",function(){e.mouseDown=!1,Math.ceil(e.timeAtLastTimeupdate)===Math.ceil(e.player.media.currentTime)?e.hideScrubbingContainer():Vi.call(e.player,e.player.media,"timeupdate",function(){e.mouseDown||e.hideScrubbingContainer()})})}},{key:"elements",value:function(){var e=zi("div",{class:this.player.config.classNames.previewThumbnails.thumbnailContainer});this.player.elements.progress.appendChild(e),this.player.elements.display.previewThumbnailContainer=e;var t=zi("div",{class:this.player.config.classNames.previewThumbnails.timeTextContainer});this.player.elements.display.previewThumbnailContainer.appendChild(t);var n=zi("span",{},"00:00");t.appendChild(n),this.player.elements.display.previewThumbnailTimeText=n;var i=zi("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer});this.player.elements.wrapper.appendChild(i),this.player.elements.display.previewScrubbingContainer=i}},{key:"showImageAtCurrentTime",value:function(){var e=this;this.mouseDown?this.setScrubbingContainerSize():(this.showThumbContainer(),this.setThumbContainerSizeAndPos());for(var t=this.thumbnailsDefs[0].frames.findIndex(function(t){return e.seekTime>=t.startTime&&e.seekTime<=t.endTime}),n=0,i=1;i<this.thumbnailsDefs.length;i++)this.loadedImages.includes(this.thumbnailsDefs[i].frames[t].text)&&(n=i);t!==this.showingThumb&&(this.showingThumb=t,this.loadImage(n))}},{key:"loadImage",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=this.thumbnailsDefs[t].frames[this.showingThumb];this.showingThumbFilename=n.text;var i=this.thumbnailsDefs[t].urlPrefix+this.showingThumbFilename;if(this.currentImageElement&&this.currentImageElement.getAttribute("data-thumbfilename")===this.showingThumbFilename)this.showImage(this.currentImageElement,n,t,this.showingThumb,this.showingThumbFilename,!1),this.currentImageElement.setAttribute("data-thumbnum",this.showingThumb),this.removeOldImages(this.currentImageElement);else{this.loadingImage&&(this.loadingImage.onload=null);var r=new Image;r.src=i,r.setAttribute("data-thumbnum",this.showingThumb),r.setAttribute("data-thumbfilename",this.showingThumbFilename),r.onload=function(){return e.showImage(r,n,t,e.showingThumb,e.showingThumbFilename,!0)},this.loadingImage=r,this.removeOldImages(r)}}},{key:"showImage",value:function(e,t,n,i,r){var a=this,o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];this.showingThumb&&this.showingThumb===i&&(this.player.debug.log("Showing thumb: "+r+". num: "+i+". xy:".concat(t.x,",").concat(t.y)+". qual: "+n+". newimg: "+o),this.setImageSizeAndOffset(e,t),o&&(this.currentContainer.appendChild(e),this.currentImageElement=e,this.loadedImages.includes(r)||this.loadedImages.push(r)),this.preloadNearby(i,!0).then(function(){return a.preloadNearby(i,!1)}).then(function(){return a.getHigherQuality(n,e,t,r,i)}).catch(function(e){e instanceof Error&&a.player.debug.error(e)}))}},{key:"removeOldImages",value:function(e){for(var t=this,n=Array.from(this.currentContainer.children),i=function(){var i=n[r];if("IMG"===i.tagName){var a=t.usingJpegSprites?500:1e3;if(i.getAttribute("data-thumbnum")!==e.getAttribute("data-thumbnum")&&!i.getAttribute("data-deleting")){i.setAttribute("data-deleting","true");var o=t.currentContainer;setTimeout(function(){o.removeChild(i),t.player.debug.log("Removing thumb: "+i.getAttribute("data-thumbfilename"))},a)}}},r=0;r<n.length;r++)i()}},{key:"preloadNearby",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return new Promise(function(i,r){var a=t.thumbnailsDefs[0].frames[e].text;if(t.showingThumbFilename===a){var o;o=n?t.thumbnailsDefs[0].frames.slice(e):t.thumbnailsDefs[0].frames.slice(0,e).reverse();var s=!1,l=!0,c=!1,u=void 0;try{for(var h,d=function(){var e=h.value.text;if(e!==a){if(!t.loadedImages.includes(e)){s=!0,t.player.debug.log("Preloading thumb filename: "+e);var n=t.thumbnailsDefs[0].urlPrefix+e;t.numLoading+=1;var r=new Image;r.src=n,r.onload=function(){t.player.debug.log("Preloaded thumb filename: "+e),t.loadedImages.includes(e)||t.loadedImages.push(e),t.numLoading-=1,i()}}return"break"}},f=o[Symbol.iterator]();!(l=(h=f.next()).done);l=!0){if("break"===d())break}}catch(e){c=!0,u=e}finally{try{l||null==f.return||f.return()}finally{if(c)throw u}}s||i()}else r("stale")})}},{key:"getHigherQuality",value:function(e,t,n,i,r){if(e<this.thumbnailsDefs.length-1){var a=t.naturalHeight;this.usingJpegSprites&&(a=n.h),a<this.thumbContainerHeight&&this.showingThumb===r&&(this.player.debug.log("Showing higher quality thumb for: "+i),this.loadImage(e+1))}}},{key:"showThumbContainer",value:function(){this.player.elements.display.previewThumbnailContainer.style.opacity=1}},{key:"hideThumbContainer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.player.elements.display.previewThumbnailContainer.style.opacity=0,e&&(this.showingThumb=null,this.showingThumbFilename=null)}},{key:"showScrubbingContainer",value:function(){this.player.elements.display.previewScrubbingContainer.style.opacity=1}},{key:"hideScrubbingContainer",value:function(){this.player.elements.display.previewScrubbingContainer.style.opacity=0,this.showingThumb=null,this.showingThumbFilename=null}},{key:"determineContainerAutoSizing",value:function(){this.player.elements.display.previewThumbnailContainer.clientHeight>20&&(this.sizeSpecifiedInCSS=!0)}},{key:"setThumbContainerSizeAndPos",value:function(){if(!this.sizeSpecifiedInCSS){var e=this.thumbContainerHeight*this.thumbAspectRatio;this.player.elements.display.previewThumbnailContainer.style.height="".concat(this.thumbContainerHeight,"px"),this.player.elements.display.previewThumbnailContainer.style.width="".concat(e,"px")}this.setThumbContainerPos()}},{key:"setThumbContainerPos",value:function(){var e=this.player.elements.progress.getBoundingClientRect(),t=this.player.elements.container.getBoundingClientRect(),n=this.player.elements.display.previewThumbnailContainer,i=t.left-e.left+10,r=t.right-e.left-n.clientWidth-10,a=this.mousePosX-e.left-n.clientWidth/2;a<i&&(a=i),a>r&&(a=r),n.style.left=a+"px"}},{key:"setScrubbingContainerSize",value:function(){this.player.elements.display.previewScrubbingContainer.style.width="".concat(this.player.media.clientWidth,"px"),this.player.elements.display.previewScrubbingContainer.style.height="".concat(this.player.media.clientWidth/this.thumbAspectRatio,"px")}},{key:"setImageSizeAndOffset",value:function(e,t){if(this.usingJpegSprites){var n=this.thumbContainerHeight/t.h;e.style.height="".concat(e.naturalHeight*n,"px"),e.style.width="".concat(e.naturalWidth*n,"px"),e.style.left="-".concat(Math.ceil(t.x*n),"px"),e.style.top="-".concat(t.y*n,"px")}}},{key:"parseVtt",value:function(e){var t=[],n=e.split(/\r\n\r\n|\n\n|\r\r/),i=!0,r=!1,a=void 0;try{for(var o,s=n[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var l=o.value,c={},u=!0,h=!1,d=void 0;try{for(var f,p=l.split(/\r\n|\n|\r/)[Symbol.iterator]();!(u=(f=p.next()).done);u=!0){var m=f.value;if(null==c.startTime){var g=m.match(/([0-9]{2})?:?([0-9]{2}):([0-9]{2}).?([0-9]{2,3})?( ?--> ?)([0-9]{2})?:?([0-9]{2}):([0-9]{2}).?([0-9]{2,3})?/);g&&(c.startTime=60*Number(g[1]||0)*60+60*Number(g[2])+Number(g[3])+Number("0."+(g[4]||0)),c.endTime=60*Number(g[6]||0)*60+60*Number(g[7])+Number(g[8])+Number("0."+(g[9]||0)))}else if(m.trim().length>0&&!c.text){var y=m.trim().split("#xywh=");if(c.text=y[0],y[1]){var v=y[1].split(",");c.x=v[0],c.y=v[1],c.w=v[2],c.h=v[3]}}}}catch(e){h=!0,d=e}finally{try{u||null==p.return||p.return()}finally{if(h)throw d}}c.text&&t.push(c)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return t}},{key:"enabled",get:function(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}},{key:"currentContainer",get:function(){return this.mouseDown?this.player.elements.display.previewScrubbingContainer:this.player.elements.display.previewThumbnailContainer}},{key:"usingJpegSprites",get:function(){return!!this.thumbnailsDefs[0].frames[0].w}},{key:"thumbAspectRatio",get:function(){return this.usingJpegSprites?this.thumbnailsDefs[0].frames[0].w/this.thumbnailsDefs[0].frames[0].h:this.thumbnailsDefs[0].width/this.thumbnailsDefs[0].height}},{key:"thumbContainerHeight",get:function(){return this.mouseDown?this.player.media.clientWidth/this.thumbAspectRatio:this.player.media.clientWidth/this.thumbAspectRatio/4}},{key:"currentImageElement",get:function(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement},set:function(e){this.mouseDown?this.currentScrubbingImageElement=e:this.currentThumbnailImageElement=e}}]),e}(),ro={insertElements:function(e,t){var n=this;Ri.string(t)?Ki(e,this.media,{src:t}):Ri.array(t)&&t.forEach(function(t){Ki(e,n.media,t)})},change:function(e){var t=this;mr(e,"sources.length")?(fr.cancelRequests.call(this),this.destroy.call(this,function(){t.options.quality=[],Yi(t.media),t.media=null,Ri.element(t.elements.container)&&t.elements.container.removeAttribute("class");var n=e.sources,i=e.type,r=gn(n,1)[0],a=r.provider,o=void 0===a?Jr.html5:a,s=r.src,l="html5"===o?i:"div",c="html5"===o?{}:{src:s};Object.assign(t,{provider:o,type:i,supported:dr.check(i,o,t.config.playsinline),media:zi(l,c)}),t.elements.container.appendChild(t.media),Ri.boolean(e.autoplay)&&(t.config.autoplay=e.autoplay),t.isHTML5&&(t.config.crossorigin&&t.media.setAttribute("crossorigin",""),t.config.autoplay&&t.media.setAttribute("autoplay",""),Ri.empty(e.poster)||(t.poster=e.poster),t.config.loop.active&&t.media.setAttribute("loop",""),t.config.muted&&t.media.setAttribute("muted",""),t.config.playsinline&&t.media.setAttribute("playsinline","")),ra.addStyleHook.call(t),t.isHTML5&&ro.insertElements.call(t,"source",n),t.config.title=e.title,ma.setup.call(t),t.isHTML5&&Object.keys(e).includes("tracks")&&ro.insertElements.call(t,"track",e.tracks),(t.isHTML5||t.isEmbed&&!t.supported.ui)&&ra.build.call(t),t.isHTML5&&t.media.load(),t.fullscreen.update()},!0)):this.debug.warn("Invalid source format")}},ao=function(){function e(t,n){var i=this;if(dn(this,e),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=dr.touch,this.media=t,Ri.string(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||Ri.nodeList(this.media)||Ri.array(this.media))&&(this.media=this.media[0]),this.config=gr({},Kr,e.defaults,n||{},function(){try{return JSON.parse(i.media.getAttribute("data-plyr-config"))}catch(e){return{}}}()),this.elements={container:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new Xr(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",dr),!Ri.nullOrUndefined(this.media)&&Ri.element(this.media))if(this.media.plyr)this.debug.warn("Target already setup");else if(this.config.enabled)if(dr.check().api){var r=this.media.cloneNode(!0);r.autoplay=!1,this.elements.original=r;var a=this.media.tagName.toLowerCase(),o=null,s=null;switch(a){case"div":if(o=this.media.querySelector("iframe"),Ri.element(o)){if(s=Ur(o.getAttribute("src")),this.provider=function(e){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtu\.?be)\/.+$/.test(e)?Jr.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?Jr.vimeo:null}(s.toString()),this.elements.container=this.media,this.media=o,this.elements.container.className="",s.search.length){var l=["1","true"];l.includes(s.searchParams.get("autoplay"))&&(this.config.autoplay=!0),l.includes(s.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=l.includes(s.searchParams.get("playsinline")),this.config.hl=s.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(Ri.empty(this.provider)||!Object.keys(Jr).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=$r.video;break;case"video":case"audio":this.type=a,this.provider=Jr.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:return void this.debug.error("Setup failed: unsupported type")}this.supported=dr.check(this.type,this.provider,this.config.playsinline),this.supported.api?(this.eventListeners=[],this.listeners=new aa(this),this.storage=new jr(this),this.media.plyr=this,Ri.element(this.elements.container)||(this.elements.container=zi("div"),Ui(this.media,this.elements.container)),ra.addStyleHook.call(this),ma.setup.call(this),this.config.debug&&qi.call(this,this.elements.container,this.config.events.join(" "),function(e){i.debug.log("event: ".concat(e.type))}),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&ra.build.call(this),this.listeners.container(),this.listeners.global(),this.fullscreen=new ta(this),this.config.ads.enabled&&(this.ads=new ga(this)),this.config.autoplay&&this.play(),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new io(this))):this.debug.error("Setup failed: no support")}else this.debug.error("Setup failed: no support");else this.debug.error("Setup failed: disabled by config");else this.debug.error("Setup failed: no suitable element passed")}return pn(e,[{key:"play",value:function(){return Ri.function(this.media.play)?this.media.play():null}},{key:"pause",value:function(){this.playing&&Ri.function(this.media.pause)&&this.media.pause()}},{key:"togglePlay",value:function(e){(Ri.boolean(e)?e:!this.playing)?this.play():this.pause()}},{key:"stop",value:function(){this.isHTML5?(this.pause(),this.restart()):Ri.function(this.media.stop)&&this.media.stop()}},{key:"restart",value:function(){this.currentTime=0}},{key:"rewind",value:function(e){this.currentTime=this.currentTime-(Ri.number(e)?e:this.config.seekTime)}},{key:"forward",value:function(e){this.currentTime=this.currentTime+(Ri.number(e)?e:this.config.seekTime)}},{key:"increaseVolume",value:function(e){var t=this.media.muted?0:this.volume;this.volume=t+(Ri.number(e)?e:0)}},{key:"decreaseVolume",value:function(e){this.increaseVolume(-e)}},{key:"toggleCaptions",value:function(e){zr.toggle.call(this,e,!1)}},{key:"airplay",value:function(){dr.airplay&&this.media.webkitShowPlaybackTargetPicker()}},{key:"toggleControls",value:function(e){if(this.supported.ui&&!this.isAudio){var t=Zi(this.elements.container,this.config.classNames.hideControls),n=void 0===e?void 0:!e,i=Xi(this.elements.container,this.config.classNames.hideControls,n);if(i&&this.config.controls.includes("settings")&&!Ri.empty(this.config.settings)&&Br.toggleMenu.call(this,!1),i!==t){var r=i?"controlshidden":"controlsshown";Bi.call(this,this.media,r)}return!i}return!1}},{key:"on",value:function(e,t){qi.call(this,this.elements.container,e,t)}},{key:"once",value:function(e,t){Vi.call(this,this.elements.container,e,t)}},{key:"off",value:function(e,t){Hi(this.elements.container,e,t)}},{key:"destroy",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.ready){var i=function(){document.body.style.overflow="",t.embed=null,n?(Object.keys(t.elements).length&&(Yi(t.elements.buttons.play),Yi(t.elements.captions),Yi(t.elements.controls),Yi(t.elements.wrapper),t.elements.buttons.play=null,t.elements.captions=null,t.elements.controls=null,t.elements.wrapper=null),Ri.function(e)&&e()):(function(){this&&this.eventListeners&&(this.eventListeners.forEach(function(e){var t=e.element,n=e.type,i=e.callback,r=e.options;t.removeEventListener(n,i,r)}),this.eventListeners=[])}.call(t),Ji(t.elements.original,t.elements.container),Bi.call(t,t.elements.original,"destroyed",!0),Ri.function(e)&&e.call(t.elements.original),t.ready=!1,setTimeout(function(){t.elements=null,t.media=null},200))};this.stop(),this.isHTML5?(clearTimeout(this.timers.loading),ra.toggleNativeControls.call(this,!0),i()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),null!==this.embed&&Ri.function(this.embed.destroy)&&this.embed.destroy(),i()):this.isVimeo&&(null!==this.embed&&this.embed.unload().then(i),setTimeout(i,200))}}},{key:"supports",value:function(e){return dr.mime.call(this,e)}},{key:"isHTML5",get:function(){return Boolean(this.provider===Jr.html5)}},{key:"isEmbed",get:function(){return Boolean(this.isYouTube||this.isVimeo)}},{key:"isYouTube",get:function(){return Boolean(this.provider===Jr.youtube)}},{key:"isVimeo",get:function(){return Boolean(this.provider===Jr.vimeo)}},{key:"isVideo",get:function(){return Boolean(this.type===$r.video)}},{key:"isAudio",get:function(){return Boolean(this.type===$r.audio)}},{key:"playing",get:function(){return Boolean(this.ready&&!this.paused&&!this.ended)}},{key:"paused",get:function(){return Boolean(this.media.paused)}},{key:"stopped",get:function(){return Boolean(this.paused&&0===this.currentTime)}},{key:"ended",get:function(){return Boolean(this.media.ended)}},{key:"currentTime",set:function(e){if(this.duration){var t=Ri.number(e)&&e>0;this.media.currentTime=t?Math.min(e,this.duration):0,this.debug.log("Seeking to ".concat(this.currentTime," seconds"))}},get:function(){return Number(this.media.currentTime)}},{key:"buffered",get:function(){var e=this.media.buffered;return Ri.number(e)?e:e&&e.length&&this.duration>0?e.end(0)/this.duration:0}},{key:"seeking",get:function(){return Boolean(this.media.seeking)}},{key:"duration",get:function(){var e=parseFloat(this.config.duration),t=(this.media||{}).duration,n=Ri.number(t)&&t!==1/0?t:0;return e||n}},{key:"volume",set:function(e){var t=e;Ri.string(t)&&(t=Number(t)),Ri.number(t)||(t=this.storage.get("volume")),Ri.number(t)||(t=this.config.volume),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!Ri.empty(e)&&this.muted&&t>0&&(this.muted=!1)},get:function(){return Number(this.media.volume)}},{key:"muted",set:function(e){var t=e;Ri.boolean(t)||(t=this.storage.get("muted")),Ri.boolean(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t},get:function(){return Boolean(this.media.muted)}},{key:"hasAudio",get:function(){return!this.isHTML5||(!!this.isAudio||(Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)))}},{key:"speed",set:function(e){var t=null;Ri.number(e)&&(t=e),Ri.number(t)||(t=this.storage.get("speed")),Ri.number(t)||(t=this.config.speed.selected),t<.1&&(t=.1),t>2&&(t=2),this.config.speed.options.includes(t)?(this.config.speed.selected=t,this.media.playbackRate=t):this.debug.warn("Unsupported speed (".concat(t,")"))},get:function(){return Number(this.media.playbackRate)}},{key:"quality",set:function(e){var t=this.config.quality,n=this.options.quality;if(n.length){var i=[!Ri.empty(e)&&Number(e),this.storage.get("quality"),t.selected,t.default].find(Ri.number),r=!0;if(!n.includes(i)){var a=function(e,t){return Ri.array(e)&&e.length?e.reduce(function(e,n){return Math.abs(n-t)<Math.abs(e-t)?n:e}):null}(n,i);this.debug.warn("Unsupported quality option: ".concat(i,", using ").concat(a," instead")),i=a,r=!1}t.selected=i,this.media.quality=i,r&&this.storage.set({quality:i})}},get:function(){return this.media.quality}},{key:"loop",set:function(e){var t=Ri.boolean(e)?e:this.config.loop.active;this.config.loop.active=t,this.media.loop=t},get:function(){return Boolean(this.media.loop)}},{key:"source",set:function(e){ro.change.call(this,e)},get:function(){return this.media.currentSrc}},{key:"download",get:function(){var e=this.config.urls.download;return Ri.url(e)?e:this.source}},{key:"poster",set:function(e){this.isVideo?ra.setPoster.call(this,e,!1).catch(function(){}):this.debug.warn("Poster can only be set for video")},get:function(){return this.isVideo?this.media.getAttribute("poster"):null}},{key:"autoplay",set:function(e){var t=Ri.boolean(e)?e:this.config.autoplay;this.config.autoplay=t},get:function(){return Boolean(this.config.autoplay)}},{key:"currentTrack",set:function(e){zr.set.call(this,e,!1)},get:function(){var e=this.captions,t=e.toggled,n=e.currentTrack;return t?n:-1}},{key:"language",set:function(e){zr.setLanguage.call(this,e,!1)},get:function(){return(zr.getCurrentTrack.call(this)||{}).language}},{key:"pip",set:function(e){if(dr.pip){var t=Ri.boolean(e)?e:!this.pip;Ri.function(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?Yr:Gr),Ri.function(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}},get:function(){return dr.pip?Ri.empty(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===Yr:null}}],[{key:"supported",value:function(e,t,n){return dr.check(e,t,n)}},{key:"loadSprite",value:function(e,t){return Dr(e,t)}},{key:"setup",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null;return Ri.string(t)?i=Array.from(document.querySelectorAll(t)):Ri.nodeList(t)?i=Array.from(t):Ri.array(t)&&(i=t.filter(Ri.element)),Ri.empty(i)?null:i.map(function(t){return new e(t,n)})}}]),e}();return ao.defaults=(no=Kr,JSON.parse(JSON.stringify(no))),ao});
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=t(e,document):"function"==typeof define&&define.amd?define(null,function(){t(e,document)}):e.rangetouch=t(e,document)}("undefined"!=typeof window?window:this,function(e,t){"use strict";function n(){u(t.body,f.events.start,l),u(t.body,f.events.move,l),u(t.body,f.events.end,l)}function o(){var e=t.createElement("style");return e.appendChild(t.createTextNode("")),t.head.appendChild(e),e.sheet}function a(n,o,a){if(n&&o){var r;"function"==typeof e.CustomEvent?r=e.CustomEvent:(r=function(e,n){n=n||{bubbles:!1,cancelable:!1,detail:void 0};var o=t.createEvent("CustomEvent");return o.initCustomEvent(e,n.bubbles,n.cancelable,n.detail),o},r.prototype=e.Event.prototype);var i=new r(o,{bubbles:!0,detail:a});n.dispatchEvent(i)}}function r(){return[f.selectors.range,":not(",f.selectors.disabled,")"].join("")}function i(e){return!(e instanceof HTMLElement)||(e.matches(f.selectors.disabled)||e.disabled)}function u(e,t,n){e.addEventListener(t,n,!1)}function d(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}function c(e,t){if(t<1){var n=d(t);return parseFloat(e.toFixed(n))}return Math.round(e/t)*t}function s(e){var t,n=e.target,o=e.changedTouches[0],a=parseFloat(n.getAttribute("min"))||0,r=parseFloat(n.getAttribute("max"))||100,i=parseFloat(n.getAttribute("step"))||1,u=r-a,d=n.getBoundingClientRect(),s=100/d.width*(f.thumbWidth/2)/100;return t=100/d.width*(o.clientX-d.left),t<0?t=0:t>100&&(t=100),t<50?t-=(100-2*t)*s:t>50&&(t+=2*(t-50)*s),a+c(u*(t/100),i)}function l(e){f.enabled&&"range"===e.target.type&&!i(e.target)&&(e.preventDefault(),e.target.value=s(e),a(e.target,e.type===f.events.end?"change":"input"))}var f={enabled:!0,addCSS:!0,thumbWidth:15,selectors:{range:'[type="range"]',disabled:".rangetouch--disabled"},events:{start:"touchstart",move:"touchmove",end:"touchend"}};return function(){if("ontouchstart"in t.documentElement){if(f.addCSS){var e=t.styleSheets;(e.length?e[0]:o()).insertRule(r()+" { user-select: none; -webkit-user-select: none; touch-action: manipulation; }",0)}n()}}(),{set:function(e,t){f[e]=t}}});
"undefined"!=typeof window&&function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Hls=t():e.Hls=t()}(this,function(){return function(e){var t={};function r(i){if(t[i])return t[i].exports;var a=t[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(i,a,function(t){return e[t]}.bind(null,a));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/dist/",r(r.s=24)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(6);function a(){}var n={trace:a,debug:a,log:a,warn:a,info:a,error:a},o=n;var s=i.getSelfScope();function l(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];t.forEach(function(t){o[t]=e[t]?e[t].bind(e):function(e){var t=s.console[e];return t?function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];r[0]&&(r[0]=function(e,t){return t="["+e+"] > "+t}(e,r[0])),t.apply(s.console,r)}:a}(t)})}t.enableLogs=function(e){if(!0===e||"object"==typeof e){l(e,"debug","log","info","warn","error");try{o.log()}catch(e){o=n}}else o=n},t.logger=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={MEDIA_ATTACHING:"hlsMediaAttaching",MEDIA_ATTACHED:"hlsMediaAttached",MEDIA_DETACHING:"hlsMediaDetaching",MEDIA_DETACHED:"hlsMediaDetached",BUFFER_RESET:"hlsBufferReset",BUFFER_CODECS:"hlsBufferCodecs",BUFFER_CREATED:"hlsBufferCreated",BUFFER_APPENDING:"hlsBufferAppending",BUFFER_APPENDED:"hlsBufferAppended",BUFFER_EOS:"hlsBufferEos",BUFFER_FLUSHING:"hlsBufferFlushing",BUFFER_FLUSHED:"hlsBufferFlushed",MANIFEST_LOADING:"hlsManifestLoading",MANIFEST_LOADED:"hlsManifestLoaded",MANIFEST_PARSED:"hlsManifestParsed",LEVEL_SWITCHING:"hlsLevelSwitching",LEVEL_SWITCHED:"hlsLevelSwitched",LEVEL_LOADING:"hlsLevelLoading",LEVEL_LOADED:"hlsLevelLoaded",LEVEL_UPDATED:"hlsLevelUpdated",LEVEL_PTS_UPDATED:"hlsLevelPtsUpdated",AUDIO_TRACKS_UPDATED:"hlsAudioTracksUpdated",AUDIO_TRACK_SWITCHING:"hlsAudioTrackSwitching",AUDIO_TRACK_SWITCHED:"hlsAudioTrackSwitched",AUDIO_TRACK_LOADING:"hlsAudioTrackLoading",AUDIO_TRACK_LOADED:"hlsAudioTrackLoaded",SUBTITLE_TRACKS_UPDATED:"hlsSubtitleTracksUpdated",SUBTITLE_TRACK_SWITCH:"hlsSubtitleTrackSwitch",SUBTITLE_TRACK_LOADING:"hlsSubtitleTrackLoading",SUBTITLE_TRACK_LOADED:"hlsSubtitleTrackLoaded",SUBTITLE_FRAG_PROCESSED:"hlsSubtitleFragProcessed",INIT_PTS_FOUND:"hlsInitPtsFound",FRAG_LOADING:"hlsFragLoading",FRAG_LOAD_PROGRESS:"hlsFragLoadProgress",FRAG_LOAD_EMERGENCY_ABORTED:"hlsFragLoadEmergencyAborted",FRAG_LOADED:"hlsFragLoaded",FRAG_DECRYPTED:"hlsFragDecrypted",FRAG_PARSING_INIT_SEGMENT:"hlsFragParsingInitSegment",FRAG_PARSING_USERDATA:"hlsFragParsingUserdata",FRAG_PARSING_METADATA:"hlsFragParsingMetadata",FRAG_PARSING_DATA:"hlsFragParsingData",FRAG_PARSED:"hlsFragParsed",FRAG_BUFFERED:"hlsFragBuffered",FRAG_CHANGED:"hlsFragChanged",FPS_DROP:"hlsFpsDrop",FPS_DROP_LEVEL_CAPPING:"hlsFpsDropLevelCapping",ERROR:"hlsError",DESTROYING:"hlsDestroying",KEY_LOADING:"hlsKeyLoading",KEY_LOADED:"hlsKeyLoaded",STREAM_STATE_TRANSITION:"hlsStreamStateTransition"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(6).getSelfScope().Number;t.Number=i,i.isFinite=i.isFinite||function(e){return"number"==typeof e&&isFinite(e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorTypes={NETWORK_ERROR:"networkError",MEDIA_ERROR:"mediaError",KEY_SYSTEM_ERROR:"keySystemError",MUX_ERROR:"muxError",OTHER_ERROR:"otherError"},t.ErrorDetails={KEY_SYSTEM_NO_KEYS:"keySystemNoKeys",KEY_SYSTEM_NO_ACCESS:"keySystemNoAccess",KEY_SYSTEM_NO_SESSION:"keySystemNoSession",KEY_SYSTEM_LICENSE_REQUEST_FAILED:"keySystemLicenseRequestFailed",MANIFEST_LOAD_ERROR:"manifestLoadError",MANIFEST_LOAD_TIMEOUT:"manifestLoadTimeOut",MANIFEST_PARSING_ERROR:"manifestParsingError",MANIFEST_INCOMPATIBLE_CODECS_ERROR:"manifestIncompatibleCodecsError",LEVEL_LOAD_ERROR:"levelLoadError",LEVEL_LOAD_TIMEOUT:"levelLoadTimeOut",LEVEL_SWITCH_ERROR:"levelSwitchError",AUDIO_TRACK_LOAD_ERROR:"audioTrackLoadError",AUDIO_TRACK_LOAD_TIMEOUT:"audioTrackLoadTimeOut",FRAG_LOAD_ERROR:"fragLoadError",FRAG_LOAD_TIMEOUT:"fragLoadTimeOut",FRAG_DECRYPT_ERROR:"fragDecryptError",FRAG_PARSING_ERROR:"fragParsingError",REMUX_ALLOC_ERROR:"remuxAllocError",KEY_LOAD_ERROR:"keyLoadError",KEY_LOAD_TIMEOUT:"keyLoadTimeOut",BUFFER_ADD_CODEC_ERROR:"bufferAddCodecError",BUFFER_APPEND_ERROR:"bufferAppendError",BUFFER_APPENDING_ERROR:"bufferAppendingError",BUFFER_STALLED_ERROR:"bufferStalledError",BUFFER_FULL_ERROR:"bufferFullError",BUFFER_SEEK_OVER_HOLE:"bufferSeekOverHole",BUFFER_NUDGE_ON_STALL:"bufferNudgeOnStall",INTERNAL_EXCEPTION:"internalException"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),a=r(3),n=r(1),o={hlsEventGeneric:!0,hlsHandlerDestroying:!0,hlsHandlerDestroyed:!0},s=function(){function e(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.hls=e,this.onEvent=this.onEvent.bind(this),this.handledEvents=t,this.useGenericHandler=!0,this.registerListeners()}return e.prototype.destroy=function(){this.onHandlerDestroying(),this.unregisterListeners(),this.onHandlerDestroyed()},e.prototype.onHandlerDestroying=function(){},e.prototype.onHandlerDestroyed=function(){},e.prototype.isEventHandler=function(){return"object"==typeof this.handledEvents&&this.handledEvents.length&&"function"==typeof this.onEvent},e.prototype.registerListeners=function(){this.isEventHandler()&&this.handledEvents.forEach(function(e){if(o[e])throw new Error("Forbidden event-name: "+e);this.hls.on(e,this.onEvent)},this)},e.prototype.unregisterListeners=function(){this.isEventHandler()&&this.handledEvents.forEach(function(e){this.hls.off(e,this.onEvent)},this)},e.prototype.onEvent=function(e,t){this.onEventGeneric(e,t)},e.prototype.onEventGeneric=function(e,t){try{(function(e,t){var r="on"+e.replace("hls","");if("function"!=typeof this[r])throw new Error("Event "+e+" has no generic handler in this "+this.constructor.name+" class (tried "+r+")");return this[r].bind(this,t)}).call(this,e,t).call()}catch(t){i.logger.error("An internal error happened while handling event "+e+'. Error message: "'+t.message+'". Here is a stacktrace:',t),this.hls.trigger(n.default.ERROR,{type:a.ErrorTypes.OTHER_ERROR,details:a.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:e,err:t})}},e}();t.default=s},function(e,t){e.exports=void 0},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSelfScope=function(){return"undefined"==typeof window?self:window}},function(e,t,r){!function(t){var r=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,i=/^([^\/?#]*)(.*)$/,a=/(?:\/|^)\.(?=\/)/g,n=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,o={buildAbsoluteURL:function(e,t,r){if(r=r||{},e=e.trim(),!(t=t.trim())){if(!r.alwaysNormalize)return e;var a=o.parseURL(e);if(!a)throw new Error("Error trying to parse base URL.");return a.path=o.normalizePath(a.path),o.buildURLFromParts(a)}var n=o.parseURL(t);if(!n)throw new Error("Error trying to parse relative URL.");if(n.scheme)return r.alwaysNormalize?(n.path=o.normalizePath(n.path),o.buildURLFromParts(n)):t;var s=o.parseURL(e);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&"/"!==s.path[0]){var l=i.exec(s.path);s.netLoc=l[1],s.path=l[2]}s.netLoc&&!s.path&&(s.path="/");var u={scheme:s.scheme,netLoc:n.netLoc,path:null,params:n.params,query:n.query,fragment:n.fragment};if(!n.netLoc&&(u.netLoc=s.netLoc,"/"!==n.path[0]))if(n.path){var d=s.path,f=d.substring(0,d.lastIndexOf("/")+1)+n.path;u.path=o.normalizePath(f)}else u.path=s.path,n.params||(u.params=s.params,n.query||(u.query=s.query));return null===u.path&&(u.path=r.alwaysNormalize?o.normalizePath(n.path):n.path),o.buildURLFromParts(u)},parseURL:function(e){var t=r.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(a,"");e.length!==(e=e.replace(n,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};e.exports=o}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e.isBuffered=function(e,t){try{if(e)for(var r=e.buffered,i=0;i<r.length;i++)if(t>=r.start(i)&&t<=r.end(i))return!0}catch(e){}return!1},e.bufferInfo=function(e,t,r){try{if(e){var i=e.buffered,a=[],n=void 0;for(n=0;n<i.length;n++)a.push({start:i.start(n),end:i.end(n)});return this.bufferedInfo(a,t,r)}}catch(e){}return{len:0,start:t,end:t,nextStart:void 0}},e.bufferedInfo=function(e,t,r){var i,a,n,o,s,l=[];for(e.sort(function(e,t){var r=e.start-t.start;return r||t.end-e.end}),s=0;s<e.length;s++){var u=l.length;if(u){var d=l[u-1].end;e[s].start-d<r?e[s].end>d&&(l[u-1].end=e[s].end):l.push(e[s])}else l.push(e[s])}for(s=0,i=0,a=n=t;s<l.length;s++){var f=l[s].start,c=l[s].end;if(t+r>=f&&t<c)a=f,i=(n=c)-t;else if(t+r<f){o=f;break}}return{len:i,start:a,end:n,nextStart:o}},e}();t.BufferHelper=i},function(e,t,r){"use strict";(function(e){var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0});var a=r(4),n=r(1);t.FragmentState={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};var o=function(r){function o(e){var t=r.call(this,e,n.default.BUFFER_APPENDED,n.default.FRAG_BUFFERED,n.default.FRAG_LOADED)||this;return t.bufferPadding=.2,t.fragments=Object.create(null),t.timeRanges=Object.create(null),t.config=e.config,t}return i(o,r),o.prototype.destroy=function(){this.fragments=null,this.timeRanges=null,this.config=null,a.default.prototype.destroy.call(this),r.prototype.destroy.call(this)},o.prototype.getBufferedFrag=function(e,t){var r=this.fragments,i=Object.keys(r).filter(function(i){var a=r[i];if(a.body.type!==t)return!1;if(!a.buffered)return!1;var n=a.body;return n.startPTS<=e&&e<=n.endPTS});if(0===i.length)return null;var a=i.pop();return r[a].body},o.prototype.detectEvictedFragments=function(e,t){var r,i,a=this;Object.keys(this.fragments).forEach(function(n){var o=a.fragments[n];if(!0===o.buffered){var s=o.range[e];if(s){r=s.time;for(var l=0;l<r.length;l++)if(i=r[l],!1===a.isTimeBuffered(i.startPTS,i.endPTS,t)){a.removeFragment(o.body);break}}}})},o.prototype.detectPartialFragments=function(e){var t=this,r=this.getFragmentKey(e),i=this.fragments[r];i&&(i.buffered=!0,Object.keys(this.timeRanges).forEach(function(r){if(e.hasElementaryStream(r)){var a=t.timeRanges[r];i.range[r]=t.getBufferedTimes(e.startPTS,e.endPTS,a)}}))},o.prototype.getBufferedTimes=function(e,t,r){for(var i,a,n=[],o=!1,s=0;s<r.length;s++){if(i=r.start(s)-this.bufferPadding,a=r.end(s)+this.bufferPadding,e>=i&&t<=a){n.push({startPTS:Math.max(e,r.start(s)),endPTS:Math.min(t,r.end(s))});break}if(e<a&&t>i)n.push({startPTS:Math.max(e,r.start(s)),endPTS:Math.min(t,r.end(s))}),o=!0;else if(t<=i)break}return{time:n,partial:o}},o.prototype.getFragmentKey=function(e){return e.type+"_"+e.level+"_"+e.urlId+"_"+e.sn},o.prototype.getPartialFragment=function(e){var t,r,i,a=this,n=null,o=0;return Object.keys(this.fragments).forEach(function(s){var l=a.fragments[s];a.isPartial(l)&&(r=l.body.startPTS-a.bufferPadding,i=l.body.endPTS+a.bufferPadding,e>=r&&e<=i&&(t=Math.min(e-r,i-e),o<=t&&(n=l.body,o=t)))}),n},o.prototype.getState=function(e){var r=this.getFragmentKey(e),i=this.fragments[r],a=t.FragmentState.NOT_LOADED;return void 0!==i&&(a=i.buffered?!0===this.isPartial(i)?t.FragmentState.PARTIAL:t.FragmentState.OK:t.FragmentState.APPENDING),a},o.prototype.isPartial=function(e){return!0===e.buffered&&(void 0!==e.range.video&&!0===e.range.video.partial||void 0!==e.range.audio&&!0===e.range.audio.partial)},o.prototype.isTimeBuffered=function(e,t,r){for(var i,a,n=0;n<r.length;n++){if(i=r.start(n)-this.bufferPadding,a=r.end(n)+this.bufferPadding,e>=i&&t<=a)return!0;if(t<=i)return!1}return!1},o.prototype.onFragLoaded=function(t){var r=t.frag;e.isFinite(r.sn)&&!r.bitrateTest&&(this.fragments[this.getFragmentKey(r)]={body:r,range:Object.create(null),buffered:!1})},o.prototype.onBufferAppended=function(e){var t=this;this.timeRanges=e.timeRanges,Object.keys(this.timeRanges).forEach(function(e){var r=t.timeRanges[e];t.detectEvictedFragments(e,r)})},o.prototype.onFragBuffered=function(e){this.detectPartialFragments(e.frag)},o.prototype.hasFragment=function(e){var t=this.getFragmentKey(e);return void 0!==this.fragments[t]},o.prototype.removeFragment=function(e){var t=this.getFragmentKey(e);delete this.fragments[t]},o.prototype.removeAllFragments=function(){this.fragments=Object.create(null)},o}(a.default);t.FragmentTracker=o}).call(this,r(2).Number)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={search:function(e,t){for(var r=0,i=e.length-1,a=null,n=null;r<=i;){var o=t(n=e[a=(r+i)/2|0]);if(o>0)r=a+1;else{if(!(o<0))return n;i=a-1}}return null}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e.isHeader=function(e,t){return t+10<=e.length&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128},e.isFooter=function(e,t){return t+10<=e.length&&51===e[t]&&68===e[t+1]&&73===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128},e.getID3Data=function(t,r){for(var i=r,a=0;e.isHeader(t,r);){a+=10,a+=e._readSize(t,r+6),e.isFooter(t,r+10)&&(a+=10),r+=a}if(a>0)return t.subarray(i,i+a)},e._readSize=function(e,t){var r=0;return r=(127&e[t])<<21,r|=(127&e[t+1])<<14,r|=(127&e[t+2])<<7,r|=127&e[t+3]},e.getTimeStamp=function(t){for(var r=e.getID3Frames(t),i=0;i<r.length;i++){var a=r[i];if(e.isTimeStampFrame(a))return e._readTimeStamp(a)}},e.isTimeStampFrame=function(e){return e&&"PRIV"===e.key&&"com.apple.streaming.transportStreamTimestamp"===e.info},e._getFrameData=function(t){var r=String.fromCharCode(t[0],t[1],t[2],t[3]),i=e._readSize(t,4);return{type:r,size:i,data:t.subarray(10,10+i)}},e.getID3Frames=function(t){for(var r=0,i=[];e.isHeader(t,r);){for(var a=e._readSize(t,r+6),n=(r+=10)+a;r+8<n;){var o=e._getFrameData(t.subarray(r)),s=e._decodeFrame(o);s&&i.push(s),r+=o.size+10}e.isFooter(t,r)&&(r+=10)}return i},e._decodeFrame=function(t){return"PRIV"===t.type?e._decodePrivFrame(t):"T"===t.type[0]?e._decodeTextFrame(t):"W"===t.type[0]?e._decodeURLFrame(t):void 0},e._readTimeStamp=function(e){if(8===e.data.byteLength){var t=new Uint8Array(e.data),r=1&t[3],i=(t[4]<<23)+(t[5]<<15)+(t[6]<<7)+t[7];return i/=45,r&&(i+=47721858.84),Math.round(i)}},e._decodePrivFrame=function(t){if(!(t.size<2)){var r=e._utf8ArrayToStr(t.data,!0),i=new Uint8Array(t.data.subarray(r.length+1));return{key:t.type,info:r,data:i.buffer}}},e._decodeTextFrame=function(t){if(!(t.size<2)){if("TXXX"===t.type){var r=1,i=e._utf8ArrayToStr(t.data.subarray(r));r+=i.length+1;var a=e._utf8ArrayToStr(t.data.subarray(r));return{key:t.type,info:i,data:a}}var n=e._utf8ArrayToStr(t.data.subarray(1));return{key:t.type,data:n}}},e._decodeURLFrame=function(t){if("WXXX"===t.type){if(t.size<2)return;var r=1,i=e._utf8ArrayToStr(t.data.subarray(r));r+=i.length+1;var a=e._utf8ArrayToStr(t.data.subarray(r));return{key:t.type,info:i,data:a}}var n=e._utf8ArrayToStr(t.data);return{key:t.type,data:n}},e._utf8ArrayToStr=function(e,t){void 0===t&&(t=!1);for(var r,i,a,n=e.length,o="",s=0;s<n;){if(0===(r=e[s++])&&t)return o;if(0!==r&&3!==r)switch(r>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(r);break;case 12:case 13:i=e[s++],o+=String.fromCharCode((31&r)<<6|63&i);break;case 14:i=e[s++],a=e[s++],o+=String.fromCharCode((15&r)<<12|(63&i)<<6|(63&a)<<0)}}return o},e}(),a=i._utf8ArrayToStr;t.utf8ArrayToStr=a,t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMediaSource=function(){if("undefined"!=typeof window)return window.MediaSource||window.WebKitMediaSource}},function(e,t,r){"use strict";(function(e){var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0});var a=r(1),n=r(4),o=r(3),s=r(0),l=r(14),u=r(25),d=window.performance,f={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},c={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"},h=function(t){function r(e){var r=t.call(this,e,a.default.MANIFEST_LOADING,a.default.LEVEL_LOADING,a.default.AUDIO_TRACK_LOADING,a.default.SUBTITLE_TRACK_LOADING)||this;return r.loaders={},r}return i(r,t),Object.defineProperty(r,"ContextType",{get:function(){return f},enumerable:!0,configurable:!0}),Object.defineProperty(r,"LevelType",{get:function(){return c},enumerable:!0,configurable:!0}),r.canHaveQualityLevels=function(e){return e!==f.AUDIO_TRACK&&e!==f.SUBTITLE_TRACK},r.mapContextToLevelType=function(e){switch(e.type){case f.AUDIO_TRACK:return c.AUDIO;case f.SUBTITLE_TRACK:return c.SUBTITLE;default:return c.MAIN}},r.getResponseUrl=function(e,t){var r=e.url;return void 0!==r&&0!==r.indexOf("data:")||(r=t.url),r},r.prototype.createInternalLoader=function(e){var t=this.hls.config,r=t.pLoader,i=t.loader,a=new(r||i)(t);return e.loader=a,this.loaders[e.type]=a,a},r.prototype.getInternalLoader=function(e){return this.loaders[e.type]},r.prototype.resetInternalLoader=function(e){this.loaders[e]&&delete this.loaders[e]},r.prototype.destroyInternalLoaders=function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}},r.prototype.destroy=function(){this.destroyInternalLoaders(),t.prototype.destroy.call(this)},r.prototype.onManifestLoading=function(e){this.load(e.url,{type:f.MANIFEST,level:0,id:null})},r.prototype.onLevelLoading=function(e){this.load(e.url,{type:f.LEVEL,level:e.level,id:e.id})},r.prototype.onAudioTrackLoading=function(e){this.load(e.url,{type:f.AUDIO_TRACK,level:null,id:e.id})},r.prototype.onSubtitleTrackLoading=function(e){this.load(e.url,{type:f.SUBTITLE_TRACK,level:null,id:e.id})},r.prototype.load=function(e,t){var r=this.hls.config;s.logger.debug("Loading playlist of type "+t.type+", level: "+t.level+", id: "+t.id);var i,a,n,o,l=this.getInternalLoader(t);if(l){var u=l.context;if(u&&u.url===e)return s.logger.trace("playlist request ongoing"),!1;s.logger.warn("aborting previous loader for type: "+t.type),l.abort()}switch(t.type){case f.MANIFEST:i=r.manifestLoadingMaxRetry,a=r.manifestLoadingTimeOut,n=r.manifestLoadingRetryDelay,o=r.manifestLoadingMaxRetryTimeout;break;case f.LEVEL:i=0,a=r.levelLoadingTimeOut;break;default:i=r.levelLoadingMaxRetry,a=r.levelLoadingTimeOut,n=r.levelLoadingRetryDelay,o=r.levelLoadingMaxRetryTimeout}l=this.createInternalLoader(t),t.url=e,t.responseType=t.responseType||"";var d={timeout:a,maxRetry:i,retryDelay:n,maxRetryDelay:o},c={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};return s.logger.debug("Calling internal loader delegate for URL: "+e),l.load(t,d,c),!0},r.prototype.loadsuccess=function(e,t,r,i){if(void 0===i&&(i=null),r.isSidxRequest)return this._handleSidxRequest(e,r),void this._handlePlaylistLoaded(e,t,r,i);this.resetInternalLoader(r.type);var a=e.data;t.tload=d.now(),0===a.indexOf("#EXTM3U")?a.indexOf("#EXTINF:")>0||a.indexOf("#EXT-X-TARGETDURATION:")>0?this._handleTrackOrLevelPlaylist(e,t,r,i):this._handleMasterPlaylist(e,t,r,i):this._handleManifestParsingError(e,r,"no EXTM3U delimiter",i)},r.prototype.loaderror=function(e,t,r){void 0===r&&(r=null),this._handleNetworkError(t,r,!1,e)},r.prototype.loadtimeout=function(e,t,r){void 0===r&&(r=null),this._handleNetworkError(t,r,!0)},r.prototype._handleMasterPlaylist=function(e,t,i,n){var o=this.hls,l=e.data,d=r.getResponseUrl(e,i),f=u.default.parseMasterPlaylist(l,d);if(f.length){var c=f.map(function(e){return{id:e.attrs.AUDIO,codec:e.audioCodec}}),h=u.default.parseMasterPlaylistMedia(l,d,"AUDIO",c),p=u.default.parseMasterPlaylistMedia(l,d,"SUBTITLES");if(h.length){var g=!1;h.forEach(function(e){e.url||(g=!0)}),!1===g&&f[0].audioCodec&&!f[0].attrs.AUDIO&&(s.logger.log("audio codec signaled in quality level, but no embedded audio track signaled, create one"),h.unshift({type:"main",name:"main"}))}o.trigger(a.default.MANIFEST_LOADED,{levels:f,audioTracks:h,subtitles:p,url:d,stats:t,networkDetails:n})}else this._handleManifestParsingError(e,i,"no level found in manifest",n)},r.prototype._handleTrackOrLevelPlaylist=function(t,i,n,o){var s=this.hls,l=n.id,c=n.level,h=n.type,p=r.getResponseUrl(t,n),g=e.isFinite(l)?l:0,v=e.isFinite(c)?c:g,m=r.mapContextToLevelType(n),y=u.default.parseLevelPlaylist(t.data,p,v,m,g);if(y.tload=i.tload,h===f.MANIFEST){var _={url:p,details:y};s.trigger(a.default.MANIFEST_LOADED,{levels:[_],audioTracks:[],url:p,stats:i,networkDetails:o})}if(i.tparsed=d.now(),y.needSidxRanges){var E=y.initSegment.url;this.load(E,{isSidxRequest:!0,type:h,level:c,levelDetails:y,id:l,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer"})}else n.levelDetails=y,this._handlePlaylistLoaded(t,i,n,o)},r.prototype._handleSidxRequest=function(e,t){var r=l.default.parseSegmentIndex(new Uint8Array(e.data));if(r){var i=r.references,a=t.levelDetails;i.forEach(function(e,t){var r=e.info,i=a.fragments[t];0===i.byteRange.length&&(i.rawByteRange=String(1+r.end-r.start)+"@"+String(r.start))}),a.initSegment.rawByteRange=String(r.moovEndOffset)+"@0"}},r.prototype._handleManifestParsingError=function(e,t,r,i){this.hls.trigger(a.default.ERROR,{type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:e.url,reason:r,networkDetails:i})},r.prototype._handleNetworkError=function(e,t,r,i){var n,l;void 0===r&&(r=!1),void 0===i&&(i=null),s.logger.info("A network error occured while loading a "+e.type+"-type playlist");var u=this.getInternalLoader(e);switch(e.type){case f.MANIFEST:n=r?o.ErrorDetails.MANIFEST_LOAD_TIMEOUT:o.ErrorDetails.MANIFEST_LOAD_ERROR,l=!0;break;case f.LEVEL:n=r?o.ErrorDetails.LEVEL_LOAD_TIMEOUT:o.ErrorDetails.LEVEL_LOAD_ERROR,l=!1;break;case f.AUDIO_TRACK:n=r?o.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:o.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,l=!1;break;default:l=!1}u&&(u.abort(),this.resetInternalLoader(e.type));var d={type:o.ErrorTypes.NETWORK_ERROR,details:n,fatal:l,url:u.url,loader:u,context:e,networkDetails:t};i&&(d.response=i),this.hls.trigger(a.default.ERROR,d)},r.prototype._handlePlaylistLoaded=function(e,t,i,n){var o=i.type,s=i.level,l=i.id,u=i.levelDetails;if(u.targetduration)if(r.canHaveQualityLevels(i.type))this.hls.trigger(a.default.LEVEL_LOADED,{details:u,level:s||0,id:l||0,stats:t,networkDetails:n});else switch(o){case f.AUDIO_TRACK:this.hls.trigger(a.default.AUDIO_TRACK_LOADED,{details:u,id:l,stats:t,networkDetails:n});break;case f.SUBTITLE_TRACK:this.hls.trigger(a.default.SUBTITLE_TRACK_LOADED,{details:u,id:l,stats:t,networkDetails:n})}else this._handleManifestParsingError(e,i,"invalid target duration",n)},r}(n.default);t.default=h}).call(this,r(2).Number)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),a=r(1),n=Math.pow(2,32)-1,o=function(){function e(e,t){this.observer=e,this.remuxer=t}return e.prototype.resetTimeStamp=function(e){this.initPTS=e},e.prototype.resetInitSegment=function(t,r,i,n){if(t&&t.byteLength){var o=this.initData=e.parseInitSegment(t);null==r&&(r="mp4a.40.5"),null==i&&(i="avc1.42e01e");var s={};o.audio&&o.video?s.audiovideo={container:"video/mp4",codec:r+","+i,initSegment:n?t:null}:(o.audio&&(s.audio={container:"audio/mp4",codec:r,initSegment:n?t:null}),o.video&&(s.video={container:"video/mp4",codec:i,initSegment:n?t:null})),this.observer.trigger(a.default.FRAG_PARSING_INIT_SEGMENT,{tracks:s})}else r&&(this.audioCodec=r),i&&(this.videoCodec=i)},e.probe=function(t){return e.findBox({data:t,start:0,end:Math.min(t.length,16384)},["moof"]).length>0},e.bin2str=function(e){return String.fromCharCode.apply(null,e)},e.readUint16=function(e,t){e.data&&(t+=e.start,e=e.data);var r=e[t]<<8|e[t+1];return r<0?65536+r:r},e.readUint32=function(e,t){e.data&&(t+=e.start,e=e.data);var r=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return r<0?4294967296+r:r},e.writeUint32=function(e,t,r){e.data&&(t+=e.start,e=e.data),e[t]=r>>24,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r},e.findBox=function(t,r){var i,a,n,o,s,l,u,d=[];if(t.data?(l=t.start,o=t.end,t=t.data):(l=0,o=t.byteLength),!r.length)return null;for(i=l;i<o;)a=e.readUint32(t,i),n=e.bin2str(t.subarray(i+4,i+8)),u=a>1?i+a:o,n===r[0]&&(1===r.length?d.push({data:t,start:i+8,end:u}):(s=e.findBox({data:t,start:i+8,end:u},r.slice(1))).length&&(d=d.concat(s))),i=u;return d},e.parseSegmentIndex=function(t){var r,i=e.findBox(t,["moov"])[0],a=i?i.end:null,n=0,o=e.findBox(t,["sidx"]);if(!o||!o[0])return null;r=[];var s=(o=o[0]).data[0];n=0===s?8:16;var l=e.readUint32(o,n);n+=4;n+=0===s?8:16,n+=2;var u=o.end+0,d=e.readUint16(o,n);n+=2;for(var f=0;f<d;f++){var c=n,h=e.readUint32(o,c);c+=4;var p=2147483647&h;if(1===(2147483648&h)>>>31)return void console.warn("SIDX has hierarchical references (not supported)");var g=e.readUint32(o,c);c+=4,r.push({referenceSize:p,subsegmentDuration:g,info:{duration:g/l,start:u,end:u+p-1}}),u+=p,n=c+=4}return{earliestPresentationTime:0,timescale:l,version:s,referencesCount:d,references:r,moovEndOffset:a}},e.parseInitSegment=function(t){var r=[];return e.findBox(t,["moov","trak"]).forEach(function(t){var a=e.findBox(t,["tkhd"])[0];if(a){var n=a.data[a.start],o=0===n?12:20,s=e.readUint32(a,o),l=e.findBox(t,["mdia","mdhd"])[0];if(l){o=0===(n=l.data[l.start])?12:20;var u=e.readUint32(l,o),d=e.findBox(t,["mdia","hdlr"])[0];if(d){var f={soun:"audio",vide:"video"}[e.bin2str(d.data.subarray(d.start+8,d.start+12))];if(f){var c=e.findBox(t,["mdia","minf","stbl","stsd"]);if(c.length){c=c[0];var h=e.bin2str(c.data.subarray(c.start+12,c.start+16));i.logger.log("MP4Demuxer:"+f+":"+h+" found")}r[s]={timescale:u,type:f},r[f]={timescale:u,id:s}}}}}}),r},e.getStartDTS=function(t,r){var i,a,n;return i=e.findBox(r,["moof","traf"]),a=[].concat.apply([],i.map(function(r){return e.findBox(r,["tfhd"]).map(function(i){var a,n;return a=e.readUint32(i,4),n=t[a].timescale||9e4,e.findBox(r,["tfdt"]).map(function(t){var r,i;return r=t.data[t.start],i=e.readUint32(t,4),1===r&&(i*=Math.pow(2,32),i+=e.readUint32(t,8)),i})[0]/n})})),n=Math.min.apply(null,a),isFinite(n)?n:0},e.offsetStartDTS=function(t,r,i){e.findBox(r,["moof","traf"]).map(function(r){return e.findBox(r,["tfhd"]).map(function(a){var o=e.readUint32(a,4),s=t[o].timescale||9e4;e.findBox(r,["tfdt"]).map(function(t){var r=t.data[t.start],a=e.readUint32(t,4);if(0===r)e.writeUint32(t,4,a-i*s);else{a*=Math.pow(2,32),a+=e.readUint32(t,8),a-=i*s,a=Math.max(a,0);var o=Math.floor(a/(n+1)),l=Math.floor(a%(n+1));e.writeUint32(t,4,o),e.writeUint32(t,8,l)}})})})},e.prototype.append=function(t,r,i,n){var o=this.initData;o||(this.resetInitSegment(t,this.audioCodec,this.videoCodec,!1),o=this.initData);var s,l=this.initPTS;if(void 0===l){var u=e.getStartDTS(o,t);this.initPTS=l=u-r,this.observer.trigger(a.default.INIT_PTS_FOUND,{initPTS:l})}e.offsetStartDTS(o,t,l),s=e.getStartDTS(o,t),this.remuxer.remux(o.audio,o.video,null,null,s,i,n,t)},e.prototype.destroy=function(){},e}();t.default=o},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var i=r(7),a=r(16),n=function(){function t(){var e;this._url=null,this._byteRange=null,this._decryptdata=null,this.tagList=[],this.programDateTime=null,this.rawProgramDateTime=null,this._elementaryStreams=((e={})[t.ElementaryStreamTypes.AUDIO]=!1,e[t.ElementaryStreamTypes.VIDEO]=!1,e)}return Object.defineProperty(t,"ElementaryStreamTypes",{get:function(){return{AUDIO:"audio",VIDEO:"video"}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"url",{get:function(){return!this._url&&this.relurl&&(this._url=i.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url},set:function(e){this._url=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"byteRange",{get:function(){if(!this._byteRange&&!this.rawByteRange)return[];if(this._byteRange)return this._byteRange;var e=[];if(this.rawByteRange){var t=this.rawByteRange.split("@",2);if(1===t.length){var r=this.lastByteRangeEndOffset;e[0]=r||0}else e[0]=parseInt(t[1]);e[1]=parseInt(t[0])+e[0],this._byteRange=e}return e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"byteRangeStartOffset",{get:function(){return this.byteRange[0]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"byteRangeEndOffset",{get:function(){return this.byteRange[1]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"decryptdata",{get:function(){return this._decryptdata||(this._decryptdata=this.fragmentDecryptdataFromLevelkey(this.levelkey,this.sn)),this._decryptdata},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"endProgramDateTime",{get:function(){if(!e.isFinite(this.programDateTime))return null;var t=e.isFinite(this.duration)?this.duration:0;return this.programDateTime+1e3*t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"encrypted",{get:function(){return!(!this.decryptdata||null===this.decryptdata.uri||null!==this.decryptdata.key)},enumerable:!0,configurable:!0}),t.prototype.addElementaryStream=function(e){this._elementaryStreams[e]=!0},t.prototype.hasElementaryStream=function(e){return!0===this._elementaryStreams[e]},t.prototype.createInitializationVector=function(e){for(var t=new Uint8Array(16),r=12;r<16;r++)t[r]=e>>8*(15-r)&255;return t},t.prototype.fragmentDecryptdataFromLevelkey=function(e,t){var r=e;return e&&e.method&&e.uri&&!e.iv&&((r=new a.default).method=e.method,r.baseuri=e.baseuri,r.reluri=e.reluri,r.iv=this.createInitializationVector(t)),r},t}();t.default=n}).call(this,r(2).Number)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(7),a=function(){function e(){this.method=null,this.key=null,this.iv=null,this._uri=null}return Object.defineProperty(e.prototype,"uri",{get:function(){return!this._uri&&this.reluri&&(this._uri=i.buildAbsoluteURL(this.baseuri,this.reluri,{alwaysNormalize:!0})),this._uri},enumerable:!0,configurable:!0}),e}();t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0}};t.isCodecType=function(e,t){var r=i[t];return!!r&&!0===r[e.slice(0,4)]},t.isCodecSupportedInMp4=function(e,t){return window.MediaSource.isTypeSupported((t||"video")+'/mp4;codecs="'+e+'"')}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,a=r(1),n=r(3),o=r(19),s=r(36),l=r(14),u=r(37),d=r(40),f=r(41),c=r(44),h=r(6),p=r(0),g=h.getSelfScope();try{i=g.performance.now.bind(g.performance)}catch(e){p.logger.debug("Unable to use Performance API on this environment"),i=g.Date.now}var v=function(){function e(e,t,r,i){this.observer=e,this.typeSupported=t,this.config=r,this.vendor=i}return e.prototype.destroy=function(){var e=this.demuxer;e&&e.destroy()},e.prototype.push=function(e,t,r,n,s,l,u,d,f,c,h,p){var g=this;if(e.byteLength>0&&null!=t&&null!=t.key&&"AES-128"===t.method){var v=this.decrypter;null==v&&(v=this.decrypter=new o.default(this.observer,this.config));var m=i();v.decrypt(e,t.key.buffer,t.iv.buffer,function(e){var o=i();g.observer.trigger(a.default.FRAG_DECRYPTED,{stats:{tstart:m,tdecrypt:o}}),g.pushDecrypted(new Uint8Array(e),t,new Uint8Array(r),n,s,l,u,d,f,c,h,p)})}else this.pushDecrypted(new Uint8Array(e),t,new Uint8Array(r),n,s,l,u,d,f,c,h,p)},e.prototype.pushDecrypted=function(e,t,r,i,o,h,p,g,v,m,y,_){var E=this.demuxer;if(!E||(p||g)&&!this.probe(e)){for(var b=this.observer,S=this.typeSupported,T=this.config,A=[{demux:u.default,remux:f.default},{demux:l.default,remux:c.default},{demux:s.default,remux:f.default},{demux:d.default,remux:f.default}],R=0,L=A.length;R<L;R++){var D=A[R],O=D.demux.probe;if(O(e)){var w=this.remuxer=new D.remux(b,T,S,this.vendor);E=new D.demux(b,w,T,S),this.probe=O;break}}if(!E)return void b.trigger(a.default.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"});this.demuxer=E}var P=this.remuxer;(p||g)&&(E.resetInitSegment(r,i,o,m),P.resetInitSegment()),p&&(E.resetTimeStamp(_),P.resetTimeStamp(_)),"function"==typeof E.setDecryptData&&E.setDecryptData(t),E.append(e,h,v,y)},e}();t.default=v},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(33),a=r(34),n=r(35),o=r(3),s=r(0),l=r(1),u=r(6).getSelfScope(),d=function(){function e(e,t,r){var i=(void 0===r?{}:r).removePKCS7Padding,a=void 0===i||i;if(this.logEnabled=!0,this.observer=e,this.config=t,this.removePKCS7Padding=a,a)try{var n=u.crypto;n&&(this.subtle=n.subtle||n.webkitSubtle)}catch(e){}this.disableWebCrypto=!this.subtle}return e.prototype.isSync=function(){return this.disableWebCrypto&&this.config.enableSoftwareAES},e.prototype.decrypt=function(e,t,r,o){var l=this;if(this.disableWebCrypto&&this.config.enableSoftwareAES){this.logEnabled&&(s.logger.log("JS AES decrypt"),this.logEnabled=!1);var u=this.decryptor;u||(this.decryptor=u=new n.default),u.expandKey(t),o(u.decrypt(e,0,r,this.removePKCS7Padding))}else{this.logEnabled&&(s.logger.log("WebCrypto AES decrypt"),this.logEnabled=!1);var d=this.subtle;this.key!==t&&(this.key=t,this.fastAesKey=new a.default(d,t)),this.fastAesKey.expandKey().then(function(a){new i.default(d,r).decrypt(e,a).catch(function(i){l.onWebCryptoError(i,e,t,r,o)}).then(function(e){o(e)})}).catch(function(i){l.onWebCryptoError(i,e,t,r,o)})}},e.prototype.onWebCryptoError=function(e,t,r,i,a){this.config.enableSoftwareAES?(s.logger.log("WebCrypto Error, disable WebCrypto API"),this.disableWebCrypto=!0,this.logEnabled=!0,this.decrypt(t,r,i,a)):(s.logger.error("decrypting error : "+e.message),this.observer.trigger(l.default.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.FRAG_DECRYPT_ERROR,fatal:!0,reason:e.message}))},e.prototype.destroy=function(){var e=this.decryptor;e&&(e.destroy(),this.decryptor=void 0)},e}();t.default=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),a=r(3),n=r(1);function o(e,t,r,o){var s,l,u,d,f,c=navigator.userAgent.toLowerCase(),h=o,p=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];if(s=1+((192&t[r+2])>>>6),!((l=(60&t[r+2])>>>2)>p.length-1))return d=(1&t[r+2])<<2,d|=(192&t[r+3])>>>6,i.logger.log("manifest codec:"+o+",ADTS data:type:"+s+",sampleingIndex:"+l+"["+p[l]+"Hz],channelConfig:"+d),/firefox/i.test(c)?l>=6?(s=5,f=new Array(4),u=l-3):(s=2,f=new Array(2),u=l):-1!==c.indexOf("android")?(s=2,f=new Array(2),u=l):(s=5,f=new Array(4),o&&(-1!==o.indexOf("mp4a.40.29")||-1!==o.indexOf("mp4a.40.5"))||!o&&l>=6?u=l-3:((o&&-1!==o.indexOf("mp4a.40.2")&&(l>=6&&1===d||/vivaldi/i.test(c))||!o&&1===d)&&(s=2,f=new Array(2)),u=l)),f[0]=s<<3,f[0]|=(14&l)>>1,f[1]|=(1&l)<<7,f[1]|=d<<3,5===s&&(f[1]|=(14&u)>>1,f[2]=(1&u)<<7,f[2]|=8,f[3]=0),{config:f,samplerate:p[l],channelCount:d,codec:"mp4a.40."+s,manifestCodec:h};e.trigger(n.default.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+l})}function s(e,t){return 255===e[t]&&240==(246&e[t+1])}function l(e,t){return 1&e[t+1]?7:9}function u(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5}function d(e){return 9216e4/e}function f(e,t,r,i,a){var n,o,s=e.length;if(n=l(e,t),o=u(e,t),(o-=n)>0&&t+n+o<=s)return{headerLength:n,frameLength:o,stamp:r+i*a}}t.getAudioConfig=o,t.isHeaderPattern=s,t.getHeaderLength=l,t.getFullFrameLength=u,t.isHeader=function(e,t){return!!(t+1<e.length&&s(e,t))},t.probe=function(e,t){if(t+1<e.length&&s(e,t)){var r=l(e,t);t+5<e.length&&(r=u(e,t));var i=t+r;if(i===e.length||i+1<e.length&&s(e,i))return!0}return!1},t.initTrackConfig=function(e,t,r,a,n){if(!e.samplerate){var s=o(t,r,a,n);e.config=s.config,e.samplerate=s.samplerate,e.channelCount=s.channelCount,e.codec=s.codec,e.manifestCodec=s.manifestCodec,i.logger.log("parsed codec:"+e.codec+",rate:"+s.samplerate+",nb channel:"+s.channelCount)}},t.getFrameDuration=d,t.parseFrameHeader=f,t.appendFrame=function(e,t,r,i,a){var n=f(t,r,i,a,d(e.samplerate));if(n){var o=n.stamp,s=n.headerLength,l=n.frameLength,u={unit:t.subarray(r+s,r+s+l),pts:o,dts:o};return e.samples.push(u),e.len+=l,{sample:u,length:l+s}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={BitratesMap:[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],SamplingRateMap:[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],SamplesCoefficients:[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],BytesInSlot:[0,1,1,4],appendFrame:function(e,t,r,i,a){if(!(r+24>t.length)){var n=this.parseHeader(t,r);if(n&&r+n.frameLength<=t.length){var o=i+a*(9e4*n.samplesPerFrame/n.sampleRate),s={unit:t.subarray(r,r+n.frameLength),pts:o,dts:o};return e.config=[],e.channelCount=n.channelCount,e.samplerate=n.sampleRate,e.samples.push(s),e.len+=n.frameLength,{sample:s,length:n.frameLength}}}},parseHeader:function(e,t){var r=e[t+1]>>3&3,a=e[t+1]>>1&3,n=e[t+2]>>4&15,o=e[t+2]>>2&3,s=e[t+2]>>1&1;if(1!==r&&0!==n&&15!==n&&3!==o){var l=3===r?3-a:3===a?3:4,u=1e3*i.BitratesMap[14*l+n-1],d=3===r?0:2===r?1:2,f=i.SamplingRateMap[3*d+o],c=e[t+3]>>6==3?1:2,h=i.SamplesCoefficients[r][a],p=i.BytesInSlot[a],g=8*h*p;return{sampleRate:f,channelCount:c,frameLength:parseInt(h*u/f+s,10)*p,samplesPerFrame:g}}},isHeaderPattern:function(e,t){return 255===e[t]&&224==(224&e[t+1])&&0!=(6&e[t+1])},isHeader:function(e,t){return!!(t+1<e.length&&this.isHeaderPattern(e,t))},probe:function(e,t){if(t+1<e.length&&this.isHeaderPattern(e,t)){var r=this.parseHeader(e,t),i=4;r&&r.frameLength&&(i=r.frameLength);var a=t+i;if(a===e.length||a+1<e.length&&this.isHeaderPattern(e,a))return!0}return!1}};t.default=i},function(e,t,r){"use strict";var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.trigger=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.emit.apply(this,[e,e].concat(t))},t}(r(45).EventEmitter);t.Observer=a},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var i=r(0);function a(t,r,a){var n=t[r],o=t[a],s=o.startPTS;e.isFinite(s)?a>r?(n.duration=s-n.start,n.duration<0&&i.logger.warn("negative duration computed for frag "+n.sn+",level "+n.level+", there should be some duration drift between playlist and fragment!")):(o.duration=n.start-s,o.duration<0&&i.logger.warn("negative duration computed for frag "+o.sn+",level "+o.level+", there should be some duration drift between playlist and fragment!")):o.start=a>r?n.start+n.duration:Math.max(n.start-o.duration,0)}function n(t,r,i,n,o,s){var l=i;if(e.isFinite(r.startPTS)){var u=Math.abs(r.startPTS-i);e.isFinite(r.deltaPTS)?r.deltaPTS=Math.max(u,r.deltaPTS):r.deltaPTS=u,l=Math.max(i,r.startPTS),i=Math.min(i,r.startPTS),n=Math.max(n,r.endPTS),o=Math.min(o,r.startDTS),s=Math.max(s,r.endDTS)}var d=i-r.start;r.start=r.startPTS=i,r.maxStartPTS=l,r.endPTS=n,r.startDTS=o,r.endDTS=s,r.duration=n-i;var f,c,h,p=r.sn;if(!t||p<t.startSN||p>t.endSN)return 0;for(f=p-t.startSN,(c=t.fragments)[f]=r,h=f;h>0;h--)a(c,h,h-1);for(h=f;h<c.length-1;h++)a(c,h,h+1);return t.PTSKnown=!0,d}function o(e,t,r){if(e&&t)for(var i=Math.max(e.startSN,t.startSN)-t.startSN,a=Math.min(e.endSN,t.endSN)-t.startSN,n=t.startSN-e.startSN,o=i;o<=a;o++){var s=e.fragments[n+o],l=t.fragments[o];if(!s||!l)break;r(s,l,o)}}function s(e,t){var r=t.startSN-e.startSN,i=e.fragments,a=t.fragments;if(!(r<0||r>i.length))for(var n=0;n<a.length;n++)a[n].start+=i[r].start}t.addGroupId=function(e,t,r){switch(t){case"audio":e.audioGroupIds||(e.audioGroupIds=[]),e.audioGroupIds.push(r);break;case"text":e.textGroupIds||(e.textGroupIds=[]),e.textGroupIds.push(r)}},t.updatePTS=a,t.updateFragPTSDTS=n,t.mergeDetails=function(t,r){r.initSegment&&t.initSegment&&(r.initSegment=t.initSegment);var a,l=0;if(o(t,r,function(t,i){l=t.cc-i.cc,e.isFinite(t.startPTS)&&(i.start=i.startPTS=t.startPTS,i.endPTS=t.endPTS,i.duration=t.duration,i.backtracked=t.backtracked,i.dropped=t.dropped,a=i),r.PTSKnown=!0}),r.PTSKnown){if(l){i.logger.log("discontinuity sliding from playlist, take drift into account");for(var u=r.fragments,d=0;d<u.length;d++)u[d].cc+=l}a?n(r,a,a.startPTS,a.endPTS,a.startDTS,a.endDTS):s(t,r),r.PTSKnown=t.PTSKnown}},t.mergeSubtitlePlaylists=function(e,t,r){void 0===r&&(r=0);var i=-1;o(e,t,function(e,t,r){t.start=e.start,i=r});var a=t.fragments;if(i<0)a.forEach(function(e){e.start+=r});else for(var n=i+1;n<a.length;n++)a[n].start=a[n-1].start+a[n-1].duration},t.mapFragmentIntersection=o,t.adjustSliding=s,t.computeReloadInterval=function(e,t,r){var i=1e3*(t.averagetargetduration?t.averagetargetduration:t.targetduration),a=i/2;return e&&t.endSN===e.endSN&&(i=a),r&&(i=Math.max(a,i-(window.performance.now()-r))),Math.round(i)}}).call(this,r(2).Number)},function(e,t,r){"use strict";var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0});var a=r(7),n=r(3),o=r(13),s=r(28),l=r(29),u=r(9),d=r(30),f=r(54),c=r(55),h=r(57),p=r(0),g=r(58),v=r(1),m=function(e){function t(r){void 0===r&&(r={});var i=e.call(this)||this,a=t.DefaultConfig;if((r.liveSyncDurationCount||r.liveMaxLatencyDurationCount)&&(r.liveSyncDuration||r.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");for(var n in a)n in r||(r[n]=a[n]);if(void 0!==r.liveMaxLatencyDurationCount&&r.liveMaxLatencyDurationCount<=r.liveSyncDurationCount)throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be gt "liveSyncDurationCount"');if(void 0!==r.liveMaxLatencyDuration&&(r.liveMaxLatencyDuration<=r.liveSyncDuration||void 0===r.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be gt "liveSyncDuration"');p.enableLogs(r.debug),i.config=r,i._autoLevelCapping=-1;var h=i.abrController=new r.abrController(i),g=new r.bufferController(i),v=new r.capLevelController(i),m=new r.fpsController(i),y=new o.default(i),_=new s.default(i),E=new l.default(i),b=new c.default(i),S=i.levelController=new f.default(i),T=new u.FragmentTracker(i),A=[S,i.streamController=new d.default(i,T)],R=r.audioStreamController;R&&A.push(new R(i,T)),i.networkControllers=A;var L=[y,_,E,h,g,v,m,b,T];if(R=r.audioTrackController){var D=new R(i);i.audioTrackController=D,L.push(D)}if(R=r.subtitleTrackController){var O=new R(i);i.subtitleTrackController=O,A.push(O)}if(R=r.emeController){var w=new R(i);i.emeController=w,L.push(w)}return(R=r.subtitleStreamController)&&A.push(new R(i,T)),(R=r.timelineController)&&L.push(new R(i)),i.coreComponents=L,i}return i(t,e),Object.defineProperty(t,"version",{get:function(){return"0.12.3"},enumerable:!0,configurable:!0}),t.isSupported=function(){return h.isSupported()},Object.defineProperty(t,"Events",{get:function(){return v.default},enumerable:!0,configurable:!0}),Object.defineProperty(t,"ErrorTypes",{get:function(){return n.ErrorTypes},enumerable:!0,configurable:!0}),Object.defineProperty(t,"ErrorDetails",{get:function(){return n.ErrorDetails},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DefaultConfig",{get:function(){return t.defaultConfig?t.defaultConfig:g.hlsDefaultConfig},set:function(e){t.defaultConfig=e},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){p.logger.log("destroy"),this.trigger(v.default.DESTROYING),this.detachMedia(),this.coreComponents.concat(this.networkControllers).forEach(function(e){e.destroy()}),this.url=null,this.removeAllListeners(),this._autoLevelCapping=-1},t.prototype.attachMedia=function(e){p.logger.log("attachMedia"),this.media=e,this.trigger(v.default.MEDIA_ATTACHING,{media:e})},t.prototype.detachMedia=function(){p.logger.log("detachMedia"),this.trigger(v.default.MEDIA_DETACHING),this.media=null},t.prototype.loadSource=function(e){e=a.buildAbsoluteURL(window.location.href,e,{alwaysNormalize:!0}),p.logger.log("loadSource:"+e),this.url=e,this.trigger(v.default.MANIFEST_LOADING,{url:e})},t.prototype.startLoad=function(e){void 0===e&&(e=-1),p.logger.log("startLoad("+e+")"),this.networkControllers.forEach(function(t){t.startLoad(e)})},t.prototype.stopLoad=function(){p.logger.log("stopLoad"),this.networkControllers.forEach(function(e){e.stopLoad()})},t.prototype.swapAudioCodec=function(){p.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},t.prototype.recoverMediaError=function(){p.logger.log("recoverMediaError");var e=this.media;this.detachMedia(),this.attachMedia(e)},Object.defineProperty(t.prototype,"levels",{get:function(){return this.levelController.levels},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentLevel",{get:function(){return this.streamController.currentLevel},set:function(e){p.logger.log("set currentLevel:"+e),this.loadLevel=e,this.streamController.immediateLevelSwitch()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nextLevel",{get:function(){return this.streamController.nextLevel},set:function(e){p.logger.log("set nextLevel:"+e),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"loadLevel",{get:function(){return this.levelController.level},set:function(e){p.logger.log("set loadLevel:"+e),this.levelController.manualLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nextLoadLevel",{get:function(){return this.levelController.nextLoadLevel},set:function(e){this.levelController.nextLoadLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstLevel",{get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(e){p.logger.log("set firstLevel:"+e),this.levelController.firstLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"startLevel",{get:function(){return this.levelController.startLevel},set:function(e){p.logger.log("set startLevel:"+e);-1!==e&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"autoLevelCapping",{get:function(){return this._autoLevelCapping},set:function(e){p.logger.log("set autoLevelCapping:"+e),this._autoLevelCapping=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"autoLevelEnabled",{get:function(){return-1===this.levelController.manualLevel},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"manualLevel",{get:function(){return this.levelController.manualLevel},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minAutoLevel",{get:function(){for(var e=this.levels,t=this.config.minAutoBitrate,r=e?e.length:0,i=0;i<r;i++){if((e[i].realBitrate?Math.max(e[i].realBitrate,e[i].bitrate):e[i].bitrate)>t)return i}return 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxAutoLevel",{get:function(){var e=this.levels,t=this.autoLevelCapping;return-1===t&&e&&e.length?e.length-1:t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nextAutoLevel",{get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(e){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"audioTracks",{get:function(){var e=this.audioTrackController;return e?e.audioTracks:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"audioTrack",{get:function(){var e=this.audioTrackController;return e?e.audioTrack:-1},set:function(e){var t=this.audioTrackController;t&&(t.audioTrack=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"liveSyncPosition",{get:function(){return this.streamController.liveSyncPosition},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subtitleTracks",{get:function(){var e=this.subtitleTrackController;return e?e.subtitleTracks:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subtitleTrack",{get:function(){var e=this.subtitleTrackController;return e?e.subtitleTrack:-1},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleTrack=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subtitleDisplay",{get:function(){var e=this.subtitleTrackController;return!!e&&e.subtitleDisplay},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)},enumerable:!0,configurable:!0}),t}(r(22).Observer);t.default=m},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var i=r(7),a=r(15),n=r(26),o=r(16),s=r(27),l=r(0),u=r(17),d=/#EXT-X-STREAM-INF:([^\n\r]*)[\r\n]+([^\r\n]+)/g,f=/#EXT-X-MEDIA:(.*)/g,c=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/|(?!#)([\S+ ?]+)/.source,/|#EXT-X-BYTERANGE:*(.+)/.source,/|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/|#.*/.source].join(""),"g"),h=/(?:(?:#(EXTM3U))|(?:#EXT-X-(PLAYLIST-TYPE):(.+))|(?:#EXT-X-(MEDIA-SEQUENCE): *(\d+))|(?:#EXT-X-(TARGETDURATION): *(\d+))|(?:#EXT-X-(KEY):(.+))|(?:#EXT-X-(START):(.+))|(?:#EXT-X-(ENDLIST))|(?:#EXT-X-(DISCONTINUITY-SEQ)UENCE:(\d+))|(?:#EXT-X-(DIS)CONTINUITY))|(?:#EXT-X-(VERSION):(\d+))|(?:#EXT-X-(MAP):(.+))|(?:(#)([^:]*):(.*))|(?:(#)(.*))(?:.*)\r?\n?/,p=/\.(mp4|m4s|m4v|m4a)$/i,g=function(){function t(){}return t.findGroup=function(e,t){if(!e)return null;for(var r=null,i=0;i<e.length;i++){var a=e[i];a.id===t&&(r=a)}return r},t.convertAVC1ToAVCOTI=function(e){var t,r=e.split(".");return r.length>2?(t=r.shift()+".",t+=parseInt(r.shift()).toString(16),t+=("000"+parseInt(r.shift()).toString(16)).substr(-4)):t=e,t},t.resolve=function(e,t){return i.buildAbsoluteURL(t,e,{alwaysNormalize:!0})},t.parseMasterPlaylist=function(e,r){var i,a=[];function n(e,t){["video","audio"].forEach(function(r){var i=e.filter(function(e){return u.isCodecType(e,r)});if(i.length){var a=i.filter(function(e){return 0===e.lastIndexOf("avc1",0)||0===e.lastIndexOf("mp4a",0)});t[r+"Codec"]=a.length>0?a[0]:i[0],e=e.filter(function(e){return-1===i.indexOf(e)})}}),t.unknownCodecs=e}for(d.lastIndex=0;null!=(i=d.exec(e));){var o={},l=o.attrs=new s.default(i[1]);o.url=t.resolve(i[2],r);var f=l.decimalResolution("RESOLUTION");f&&(o.width=f.width,o.height=f.height),o.bitrate=l.decimalInteger("AVERAGE-BANDWIDTH")||l.decimalInteger("BANDWIDTH"),o.name=l.NAME,n([].concat((l.CODECS||"").split(/[ ,]+/)),o),o.videoCodec&&-1!==o.videoCodec.indexOf("avc1")&&(o.videoCodec=t.convertAVC1ToAVCOTI(o.videoCodec)),a.push(o)}return a},t.parseMasterPlaylistMedia=function(e,r,i,a){var n;void 0===a&&(a=[]);var o=[],l=0;for(f.lastIndex=0;null!==(n=f.exec(e));){var u={},d=new s.default(n[1]);if(d.TYPE===i){if(u.groupId=d["GROUP-ID"],u.name=d.NAME,u.type=i,u.default="YES"===d.DEFAULT,u.autoselect="YES"===d.AUTOSELECT,u.forced="YES"===d.FORCED,d.URI&&(u.url=t.resolve(d.URI,r)),u.lang=d.LANGUAGE,u.name||(u.name=u.lang),a.length){var c=t.findGroup(a,u.groupId);u.audioCodec=c?c.codec:a[0].codec}u.id=l++,o.push(u)}}return o},t.parseLevelPlaylist=function(t,r,i,u,d){var f,g,m=0,y=0,_=new n.default(r),E=new o.default,b=0,S=null,T=new a.default,A=null;for(c.lastIndex=0;null!==(f=c.exec(t));){var R=f[1];if(R){T.duration=parseFloat(R);var L=(" "+f[2]).slice(1);T.title=L||null,T.tagList.push(L?["INF",R,L]:["INF",R])}else if(f[3]){if(e.isFinite(T.duration)){var D=m++;T.type=u,T.start=y,T.levelkey=E,T.sn=D,T.level=i,T.cc=b,T.urlId=d,T.baseurl=r,T.relurl=(" "+f[3]).slice(1),v(T,S),_.fragments.push(T),S=T,y+=T.duration,T=new a.default}}else if(f[4]){if(T.rawByteRange=(" "+f[4]).slice(1),S){var O=S.byteRangeEndOffset;O&&(T.lastByteRangeEndOffset=O)}}else if(f[5])T.rawProgramDateTime=(" "+f[5]).slice(1),T.tagList.push(["PROGRAM-DATE-TIME",T.rawProgramDateTime]),null===A&&(A=_.fragments.length);else{for(f=f[0].match(h),g=1;g<f.length&&void 0===f[g];g++);var w=(" "+f[g+1]).slice(1),P=(" "+f[g+2]).slice(1);switch(f[g]){case"#":T.tagList.push(P?[w,P]:[w]);break;case"PLAYLIST-TYPE":_.type=w.toUpperCase();break;case"MEDIA-SEQUENCE":m=_.startSN=parseInt(w);break;case"TARGETDURATION":_.targetduration=parseFloat(w);break;case"VERSION":_.version=parseInt(w);break;case"EXTM3U":break;case"ENDLIST":_.live=!1;break;case"DIS":b++,T.tagList.push(["DIS"]);break;case"DISCONTINUITY-SEQ":b=parseInt(w);break;case"KEY":var I=w,x=new s.default(I),F=x.enumeratedString("METHOD"),k=x.URI,C=x.hexadecimalInteger("IV");F&&(E=new o.default,k&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(F)>=0&&(E.method=F,E.baseuri=r,E.reluri=k,E.key=null,E.iv=C));break;case"START":var M=w,N=new s.default(M).decimalFloatingPoint("TIME-OFFSET");e.isFinite(N)&&(_.startTimeOffset=N);break;case"MAP":var U=new s.default(w);T.relurl=U.URI,T.rawByteRange=U.BYTERANGE,T.baseurl=r,T.level=i,T.type=u,T.sn="initSegment",_.initSegment=T,(T=new a.default).rawProgramDateTime=_.initSegment.rawProgramDateTime;break;default:l.logger.warn("line parsed but not handled: "+f)}}}return(T=S)&&!T.relurl&&(_.fragments.pop(),y-=T.duration),_.totalduration=y,_.averagetargetduration=y/_.fragments.length,_.endSN=m-1,_.startCC=_.fragments[0]?_.fragments[0].cc:0,_.endCC=b,!_.initSegment&&_.fragments.length&&_.fragments.every(function(e){return p.test(e.relurl)})&&(l.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),(T=new a.default).relurl=_.fragments[0].relurl,T.baseurl=r,T.level=i,T.type=u,T.sn="initSegment",_.initSegment=T,_.needSidxRanges=!0),A&&function(e,t){for(var r=e[t],i=t-1;i>=0;i--){var a=e[i];a.programDateTime=r.programDateTime-1e3*a.duration,r=a}}(_.fragments,A),_},t}();function v(t,r){t.rawProgramDateTime?t.programDateTime=Date.parse(t.rawProgramDateTime):r&&r.programDateTime&&(t.programDateTime=r.endProgramDateTime),e.isFinite(t.programDateTime)||(t.programDateTime=null,t.rawProgramDateTime=null)}t.default=g}).call(this,r(2).Number)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function t(e){this.endCC=0,this.endSN=0,this.fragments=[],this.initSegment=null,this.live=!0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=e,this.version=null}return Object.defineProperty(t.prototype,"hasProgramDateTime",{get:function(){return!(!this.fragments[0]||!e.isFinite(this.fragments[0].programDateTime))},enumerable:!0,configurable:!0}),t}();t.default=r}).call(this,r(2).Number)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var r=/^(\d+)x(\d+)$/,i=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,a=function(){function t(e){for(var r in"string"==typeof e&&(e=t.parseAttrList(e)),e)e.hasOwnProperty(r)&&(this[r]=e[r])}return t.prototype.decimalInteger=function(t){var r=parseInt(this[t],10);return r>e.MAX_SAFE_INTEGER?1/0:r},t.prototype.hexadecimalInteger=function(e){if(this[e]){var t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;for(var r=new Uint8Array(t.length/2),i=0;i<t.length/2;i++)r[i]=parseInt(t.slice(2*i,2*i+2),16);return r}return null},t.prototype.hexadecimalIntegerAsNumber=function(t){var r=parseInt(this[t],16);return r>e.MAX_SAFE_INTEGER?1/0:r},t.prototype.decimalFloatingPoint=function(e){return parseFloat(this[e])},t.prototype.enumeratedString=function(e){return this[e]},t.prototype.decimalResolution=function(e){var t=r.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}},t.parseAttrList=function(e){var t,r={};for(i.lastIndex=0;null!==(t=i.exec(e));){var a=t[2];0===a.indexOf('"')&&a.lastIndexOf('"')===a.length-1&&(a=a.slice(1,-1)),r[t[1]]=a}return r},t}();t.default=a}).call(this,r(2).Number)},function(e,t,r){"use strict";(function(e){var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0});var a=r(1),n=r(4),o=r(3),s=r(0),l=function(t){function r(e){var r=t.call(this,e,a.default.FRAG_LOADING)||this;return r.loaders={},r}return i(r,t),r.prototype.destroy=function(){var e=this.loaders;for(var r in e){var i=e[r];i&&i.destroy()}this.loaders={},t.prototype.destroy.call(this)},r.prototype.onFragLoading=function(t){var r=t.frag,i=r.type,a=this.loaders,n=this.hls.config,o=n.fLoader,l=n.loader;r.loaded=0;var u,d,f,c=a[i];c&&(s.logger.warn("abort previous fragment loader for type: "+i),c.abort()),c=a[i]=r.loader=n.fLoader?new o(n):new l(n),u={url:r.url,frag:r,responseType:"arraybuffer",progressData:!1};var h=r.byteRangeStartOffset,p=r.byteRangeEndOffset;e.isFinite(h)&&e.isFinite(p)&&(u.rangeStart=h,u.rangeEnd=p),d={timeout:n.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:n.fragLoadingMaxRetryTimeout},f={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this),onProgress:this.loadprogress.bind(this)},c.load(u,d,f)},r.prototype.loadsuccess=function(e,t,r,i){void 0===i&&(i=null);var n=e.data,o=r.frag;o.loader=void 0,this.loaders[o.type]=void 0,this.hls.trigger(a.default.FRAG_LOADED,{payload:n,frag:o,stats:t,networkDetails:i})},r.prototype.loaderror=function(e,t,r){void 0===r&&(r=null);var i=t.frag,n=i.loader;n&&n.abort(),this.loaders[i.type]=void 0,this.hls.trigger(a.default.ERROR,{type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t.frag,response:e,networkDetails:r})},r.prototype.loadtimeout=function(e,t,r){void 0===r&&(r=null);var i=t.frag,n=i.loader;n&&n.abort(),this.loaders[i.type]=void 0,this.hls.trigger(a.default.ERROR,{type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t.frag,networkDetails:r})},r.prototype.loadprogress=function(e,t,r,i){void 0===i&&(i=null);var n=t.frag;n.loaded=e.loaded,this.hls.trigger(a.default.FRAG_LOAD_PROGRESS,{frag:n,stats:e,networkDetails:i})},r}(n.default);t.default=l}).call(this,r(2).Number)},function(e,t,r){"use strict";var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0});var a=r(1),n=r(4),o=r(3),s=r(0),l=function(e){function t(t){var r=e.call(this,t,a.default.KEY_LOADING)||this;return r.loaders={},r.decryptkey=null,r.decrypturl=null,r}return i(t,e),t.prototype.destroy=function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy()}this.loaders={},n.default.prototype.destroy.call(this)},t.prototype.onKeyLoading=function(e){var t=e.frag,r=t.type,i=this.loaders[r],n=t.decryptdata,o=n.uri;if(o!==this.decrypturl||null===this.decryptkey){var l=this.hls.config;i&&(s.logger.warn("abort previous key loader for type:"+r),i.abort()),t.loader=this.loaders[r]=new l.loader(l),this.decrypturl=o,this.decryptkey=null;var u,d,f;u={url:o,frag:t,responseType:"arraybuffer"},d={timeout:l.fragLoadingTimeOut,maxRetry:0,retryDelay:l.fragLoadingRetryDelay,maxRetryDelay:l.fragLoadingMaxRetryTimeout},f={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},t.loader.load(u,d,f)}else this.decryptkey&&(n.key=this.decryptkey,this.hls.trigger(a.default.KEY_LOADED,{frag:t}))},t.prototype.loadsuccess=function(e,t,r){var i=r.frag;this.decryptkey=i.decryptdata.key=new Uint8Array(e.data),i.loader=void 0,this.loaders[i.type]=void 0,this.hls.trigger(a.default.KEY_LOADED,{frag:i})},t.prototype.loaderror=function(e,t){var r=t.frag,i=r.loader;i&&i.abort(),this.loaders[t.type]=void 0,this.hls.trigger(a.default.ERROR,{type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:r,response:e})},t.prototype.loadtimeout=function(e,t){var r=t.frag,i=r.loader;i&&i.abort(),this.loaders[t.type]=void 0,this.hls.trigger(a.default.ERROR,{type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:r})},t}(n.default);t.default=l},function(e,t,r){"use strict";(function(e){var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0});var a=r(10),n=r(8),o=r(31),s=r(1),l=r(9),u=r(15),d=r(13),f=r(23),c=r(48),h=r(3),p=r(0),g=r(49),v=r(50),m=r(51),y=r(52),_=function(t){function r(e,r){var i=t.call(this,e,s.default.MEDIA_ATTACHED,s.default.MEDIA_DETACHING,s.default.MANIFEST_LOADING,s.default.MANIFEST_PARSED,s.default.LEVEL_LOADED,s.default.KEY_LOADED,s.default.FRAG_LOADED,s.default.FRAG_LOAD_EMERGENCY_ABORTED,s.default.FRAG_PARSING_INIT_SEGMENT,s.default.FRAG_PARSING_DATA,s.default.FRAG_PARSED,s.default.ERROR,s.default.AUDIO_TRACK_SWITCHING,s.default.AUDIO_TRACK_SWITCHED,s.default.BUFFER_CREATED,s.default.BUFFER_APPENDED,s.default.BUFFER_FLUSHED)||this;return i.fragmentTracker=r,i.config=e.config,i.audioCodecSwap=!1,i._state=y.State.STOPPED,i.stallReported=!1,i.gapController=null,i}return i(r,t),r.prototype.startLoad=function(e){if(this.levels){var t=this.lastCurrentTime,r=this.hls;if(this.stopLoad(),this.setInterval(100),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var i=r.startLevel;-1===i&&(i=0,this.bitrateTest=!0),this.level=r.nextLoadLevel=i,this.loadedmetadata=!1}t>0&&-1===e&&(p.logger.log("override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t),this.state=y.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this.forceStartLoad=!0,this.state=y.State.STOPPED},r.prototype.stopLoad=function(){this.forceStartLoad=!1,t.prototype.stopLoad.call(this)},r.prototype.doTick=function(){switch(this.state){case y.State.BUFFER_FLUSHING:this.fragLoadError=0;break;case y.State.IDLE:this._doTickIdle();break;case y.State.WAITING_LEVEL:var e=this.levels[this.level];e&&e.details&&(this.state=y.State.IDLE);break;case y.State.FRAG_LOADING_WAITING_RETRY:var t=window.performance.now(),r=this.retryDate;(!r||t>=r||this.media&&this.media.seeking)&&(p.logger.log("mediaController: retryDate reached, switch back to IDLE state"),this.state=y.State.IDLE);break;case y.State.ERROR:case y.State.STOPPED:case y.State.FRAG_LOADING:case y.State.PARSING:case y.State.PARSED:case y.State.ENDED:}this._checkBuffer(),this._checkFragmentChanged()},r.prototype._doTickIdle=function(){var e=this.hls,t=e.config,r=this.media;if(void 0!==this.levelLastLoaded&&(r||!this.startFragRequested&&t.startFragPrefetch)){var i;i=this.loadedmetadata?r.currentTime:this.nextLoadPosition;var a=e.nextLoadLevel,o=this.levels[a];if(o){var l,u=o.bitrate;l=u?Math.max(8*t.maxBufferSize/u,t.maxBufferLength):t.maxBufferLength,l=Math.min(l,t.maxMaxBufferLength);var d=n.BufferHelper.bufferInfo(this.mediaBuffer?this.mediaBuffer:r,i,t.maxBufferHole),f=d.len;if(!(f>=l)){p.logger.trace("buffer length of "+f.toFixed(3)+" is below max of "+l.toFixed(3)+". checking for more payload ..."),this.level=e.nextLoadLevel=a;var c=o.details;if(!c||c.live&&this.levelLastLoaded!==a)this.state=y.State.WAITING_LEVEL;else{if(this._streamEnded(d,c)){var h={};return this.altAudio&&(h.type="video"),this.hls.trigger(s.default.BUFFER_EOS,h),void(this.state=y.State.ENDED)}this._fetchPayloadOrEos(i,d,c)}}}}},r.prototype._fetchPayloadOrEos=function(e,t,r){var i=this.fragPrevious,a=this.level,n=r.fragments,o=n.length;if(0!==o){var s,l=n[0].start,u=n[o-1].start+n[o-1].duration,d=t.end;if(r.initSegment&&!r.initSegment.data)s=r.initSegment;else if(r.live){var f=this.config.initialLiveManifestSize;if(o<f)return void p.logger.warn("Can not start playback of a level, reason: not enough fragments "+o+" < "+f);if(null===(s=this._ensureFragmentAtLivePoint(r,d,l,u,i,n,o)))return}else d<l&&(s=n[0]);s||(s=this._findFragment(l,i,o,n,d,u,r)),s&&(s.encrypted?(p.logger.log("Loading key for "+s.sn+" of ["+r.startSN+" ,"+r.endSN+"],level "+a),this._loadKey(s)):(p.logger.log("Loading "+s.sn+" of ["+r.startSN+" ,"+r.endSN+"],level "+a+", currentTime:"+e.toFixed(3)+",bufferEnd:"+d.toFixed(3)),this._loadFragment(s)))}},r.prototype._ensureFragmentAtLivePoint=function(e,t,r,i,n,o,s){var l,u=this.hls.config,d=this.media,f=void 0!==u.liveMaxLatencyDuration?u.liveMaxLatencyDuration:u.liveMaxLatencyDurationCount*e.targetduration;if(t<Math.max(r-u.maxFragLookUpTolerance,i-f)){var c=this.liveSyncPosition=this.computeLivePosition(r,e);p.logger.log("buffer end: "+t.toFixed(3)+" is located too far from the end of live sliding playlist, reset currentTime to : "+c.toFixed(3)),t=c,d&&d.readyState&&d.duration>c&&(d.currentTime=c),this.nextLoadPosition=c}if(e.PTSKnown&&t>i&&d&&d.readyState)return null;if(this.startFragRequested&&!e.PTSKnown){if(n)if(e.hasProgramDateTime)p.logger.log("live playlist, switching playlist, load frag with same PDT: "+n.programDateTime),l=v.findFragmentByPDT(o,n.endProgramDateTime,u.maxFragLookUpTolerance);else{var h=n.sn+1;if(h>=e.startSN&&h<=e.endSN){var g=o[h-e.startSN];n.cc===g.cc&&(l=g,p.logger.log("live playlist, switching playlist, load frag with next SN: "+l.sn))}l||(l=a.default.search(o,function(e){return n.cc-e.cc}))&&p.logger.log("live playlist, switching playlist, load frag with same CC: "+l.sn)}l||(l=o[Math.min(s-1,Math.round(s/2))],p.logger.log("live playlist, switching playlist, unknown, load middle frag : "+l.sn))}return l},r.prototype._findFragment=function(e,t,r,i,a,n,o){var s,l=this.hls.config;if(a<n){var u=a>n-l.maxFragLookUpTolerance?0:l.maxFragLookUpTolerance;s=v.findFragmentByPTS(t,i,a,u)}else s=i[r-1];if(s){var d=s.sn-o.startSN,f=t&&s.level===t.level,c=i[d-1],h=i[d+1];if(t&&s.sn===t.sn)if(f&&!s.backtracked)if(s.sn<o.endSN){var g=t.deltaPTS;g&&g>l.maxBufferHole&&t.dropped&&d?(s=c,p.logger.warn("SN just loaded, with large PTS gap between audio and video, maybe frag is not starting with a keyframe ? load previous one to try to overcome this")):(s=h,p.logger.log("SN just loaded, load next one: "+s.sn,s))}else s=null;else s.backtracked&&(h&&h.backtracked?(p.logger.warn("Already backtracked from fragment "+h.sn+", will not backtrack to fragment "+s.sn+". Loading fragment "+h.sn),s=h):(p.logger.warn("Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe"),s.dropped=0,c?(s=c).backtracked=!0:d&&(s=null)))}return s},r.prototype._loadKey=function(e){this.state=y.State.KEY_LOADING,this.hls.trigger(s.default.KEY_LOADING,{frag:e})},r.prototype._loadFragment=function(t){var r=this.fragmentTracker.getState(t);this.fragCurrent=t,this.startFragRequested=!0,e.isFinite(t.sn)&&!t.bitrateTest&&(this.nextLoadPosition=t.start+t.duration),t.backtracked||r===l.FragmentState.NOT_LOADED||r===l.FragmentState.PARTIAL?(t.autoLevel=this.hls.autoLevelEnabled,t.bitrateTest=this.bitrateTest,this.hls.trigger(s.default.FRAG_LOADING,{frag:t}),this.demuxer||(this.demuxer=new o.default(this.hls,"main")),this.state=y.State.FRAG_LOADING):r===l.FragmentState.APPENDING&&this._reduceMaxBufferLength(t.duration)&&this.fragmentTracker.removeFragment(t)},Object.defineProperty(r.prototype,"state",{get:function(){return this._state},set:function(e){if(this.state!==e){var t=this.state;this._state=e,p.logger.log("main stream:"+t+"->"+e),this.hls.trigger(s.default.STREAM_STATE_TRANSITION,{previousState:t,nextState:e})}},enumerable:!0,configurable:!0}),r.prototype.getBufferedFrag=function(e){return this.fragmentTracker.getBufferedFrag(e,d.default.LevelType.MAIN)},Object.defineProperty(r.prototype,"currentLevel",{get:function(){var e=this.media;if(e){var t=this.getBufferedFrag(e.currentTime);if(t)return t.level}return-1},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"nextBufferedFrag",{get:function(){var e=this.media;return e?this.followingBufferedFrag(this.getBufferedFrag(e.currentTime)):null},enumerable:!0,configurable:!0}),r.prototype.followingBufferedFrag=function(e){return e?this.getBufferedFrag(e.endPTS+.5):null},Object.defineProperty(r.prototype,"nextLevel",{get:function(){var e=this.nextBufferedFrag;return e?e.level:-1},enumerable:!0,configurable:!0}),r.prototype._checkFragmentChanged=function(){var e,t,r=this.media;if(r&&r.readyState&&!1===r.seeking&&((t=r.currentTime)>this.lastCurrentTime&&(this.lastCurrentTime=t),n.BufferHelper.isBuffered(r,t)?e=this.getBufferedFrag(t):n.BufferHelper.isBuffered(r,t+.1)&&(e=this.getBufferedFrag(t+.1)),e)){var i=e;if(i!==this.fragPlaying){this.hls.trigger(s.default.FRAG_CHANGED,{frag:i});var a=i.level;this.fragPlaying&&this.fragPlaying.level===a||this.hls.trigger(s.default.LEVEL_SWITCHED,{level:a}),this.fragPlaying=i}}},r.prototype.immediateLevelSwitch=function(){if(p.logger.log("immediateLevelSwitch"),!this.immediateSwitch){this.immediateSwitch=!0;var t=this.media,r=void 0;t?(r=t.paused,t.pause()):r=!0,this.previouslyPaused=r}var i=this.fragCurrent;i&&i.loader&&i.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(0,e.POSITIVE_INFINITY)},r.prototype.immediateLevelSwitchEnd=function(){var e=this.media;e&&e.buffered.length&&(this.immediateSwitch=!1,n.BufferHelper.isBuffered(e,e.currentTime)&&(e.currentTime-=1e-4),this.previouslyPaused||e.play())},r.prototype.nextLevelSwitch=function(){var t=this.media;if(t&&t.readyState){var r,i=void 0,a=void 0;if((r=this.getBufferedFrag(t.currentTime))&&r.startPTS>1&&this.flushMainBuffer(0,r.startPTS-1),t.paused)i=0;else{var n=this.hls.nextLoadLevel,o=this.levels[n],s=this.fragLastKbps;i=s&&this.fragCurrent?this.fragCurrent.duration*o.bitrate/(1e3*s)+1:0}if((a=this.getBufferedFrag(t.currentTime+i))&&(a=this.followingBufferedFrag(a))){var l=this.fragCurrent;l&&l.loader&&l.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(a.maxStartPTS,e.POSITIVE_INFINITY)}}},r.prototype.flushMainBuffer=function(e,t){this.state=y.State.BUFFER_FLUSHING;var r={startOffset:e,endOffset:t};this.altAudio&&(r.type="video"),this.hls.trigger(s.default.BUFFER_FLUSHING,r)},r.prototype.onMediaAttached=function(e){var t=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),this.onvended=this.onMediaEnded.bind(this),t.addEventListener("seeking",this.onvseeking),t.addEventListener("seeked",this.onvseeked),t.addEventListener("ended",this.onvended);var r=this.config;this.levels&&r.autoStartLoad&&this.hls.startLoad(r.startPosition),this.gapController=new m.default(r,t,this.fragmentTracker,this.hls)},r.prototype.onMediaDetaching=function(){var e=this.media;e&&e.ended&&(p.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var t=this.levels;t&&t.forEach(function(e){e.details&&e.details.fragments.forEach(function(e){e.backtracked=void 0})}),e&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("seeked",this.onvseeked),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()},r.prototype.onMediaSeeked=function(){var t=this.media,r=t?t.currentTime:void 0;e.isFinite(r)&&p.logger.log("media seeked to "+r.toFixed(3)),this.tick()},r.prototype.onManifestLoading=function(){p.logger.log("trigger BUFFER_RESET"),this.hls.trigger(s.default.BUFFER_RESET),this.fragmentTracker.removeAllFragments(),this.stalled=!1,this.startPosition=this.lastCurrentTime=0},r.prototype.onManifestParsed=function(e){var t,r=!1,i=!1;e.levels.forEach(function(e){(t=e.audioCodec)&&(-1!==t.indexOf("mp4a.40.2")&&(r=!0),-1!==t.indexOf("mp4a.40.5")&&(i=!0))}),this.audioCodecSwitch=r&&i,this.audioCodecSwitch&&p.logger.log("both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=e.levels,this.startFragRequested=!1;var a=this.config;(a.autoStartLoad||this.forceStartLoad)&&this.hls.startLoad(a.startPosition)},r.prototype.onLevelLoaded=function(t){var r=t.details,i=t.level,a=this.levels[this.levelLastLoaded],n=this.levels[i],o=r.totalduration,l=0;if(p.logger.log("level "+i+" loaded ["+r.startSN+","+r.endSN+"],duration:"+o),r.live){var u=n.details;u&&r.fragments.length>0?(f.mergeDetails(u,r),l=r.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(l,u),r.PTSKnown&&e.isFinite(l)?p.logger.log("live playlist sliding:"+l.toFixed(3)):(p.logger.log("live playlist - outdated PTS, unknown sliding"),g.alignStream(this.fragPrevious,a,r))):(p.logger.log("live playlist - first load, unknown sliding"),r.PTSKnown=!1,g.alignStream(this.fragPrevious,a,r))}else r.PTSKnown=!1;if(n.details=r,this.levelLastLoaded=i,this.hls.trigger(s.default.LEVEL_UPDATED,{details:r,level:i}),!1===this.startFragRequested){if(-1===this.startPosition||-1===this.lastCurrentTime){var d=r.startTimeOffset;e.isFinite(d)?(d<0&&(p.logger.log("negative start time offset "+d+", count from end of last fragment"),d=l+o+d),p.logger.log("start time offset found in playlist, adjust startPosition to "+d),this.startPosition=d):r.live?(this.startPosition=this.computeLivePosition(l,r),p.logger.log("configure startPosition to "+this.startPosition)):this.startPosition=0,this.lastCurrentTime=this.startPosition}this.nextLoadPosition=this.startPosition}this.state===y.State.WAITING_LEVEL&&(this.state=y.State.IDLE),this.tick()},r.prototype.onKeyLoaded=function(){this.state===y.State.KEY_LOADING&&(this.state=y.State.IDLE,this.tick())},r.prototype.onFragLoaded=function(e){var t=this.fragCurrent,r=this.hls,i=this.levels,a=this.media,n=e.frag;if(this.state===y.State.FRAG_LOADING&&t&&"main"===n.type&&n.level===t.level&&n.sn===t.sn){var l=e.stats,u=i[t.level],d=u.details;if(this.bitrateTest=!1,this.stats=l,p.logger.log("Loaded "+t.sn+" of ["+d.startSN+" ,"+d.endSN+"],level "+t.level),n.bitrateTest&&r.nextLoadLevel)this.state=y.State.IDLE,this.startFragRequested=!1,l.tparsed=l.tbuffered=window.performance.now(),r.trigger(s.default.FRAG_BUFFERED,{stats:l,frag:t,id:"main"}),this.tick();else if("initSegment"===n.sn)this.state=y.State.IDLE,l.tparsed=l.tbuffered=window.performance.now(),d.initSegment.data=e.payload,r.trigger(s.default.FRAG_BUFFERED,{stats:l,frag:t,id:"main"}),this.tick();else{p.logger.log("Parsing "+t.sn+" of ["+d.startSN+" ,"+d.endSN+"],level "+t.level+", cc "+t.cc),this.state=y.State.PARSING,this.pendingBuffering=!0,this.appended=!1,n.bitrateTest&&(n.bitrateTest=!1,this.fragmentTracker.onFragLoaded({frag:n}));var f=!(a&&a.seeking)&&(d.PTSKnown||!d.live),c=d.initSegment?d.initSegment.data:[],h=this._getAudioCodec(u);(this.demuxer=this.demuxer||new o.default(this.hls,"main")).push(e.payload,c,h,u.videoCodec,t,d.totalduration,f)}}this.fragLoadError=0},r.prototype.onFragParsingInitSegment=function(e){var t=this.fragCurrent,r=e.frag;if(t&&"main"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===y.State.PARSING){var i=e.tracks,a=void 0,n=void 0;if(i.audio&&this.altAudio&&delete i.audio,n=i.audio){var o=this.levels[this.level].audioCodec,l=navigator.userAgent.toLowerCase();o&&this.audioCodecSwap&&(p.logger.log("swapping playlist audio codec"),o=-1!==o.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),this.audioCodecSwitch&&1!==n.metadata.channelCount&&-1===l.indexOf("firefox")&&(o="mp4a.40.5"),-1!==l.indexOf("android")&&"audio/mpeg"!==n.container&&(o="mp4a.40.2",p.logger.log("Android: force audio codec to "+o)),n.levelCodec=o,n.id=e.id}for(a in(n=i.video)&&(n.levelCodec=this.levels[this.level].videoCodec,n.id=e.id),this.hls.trigger(s.default.BUFFER_CODECS,i),i){n=i[a],p.logger.log("main track:"+a+",container:"+n.container+",codecs[level/parsed]=["+n.levelCodec+"/"+n.codec+"]");var u=n.initSegment;u&&(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(s.default.BUFFER_APPENDING,{type:a,data:u,parent:"main",content:"initSegment"}))}this.tick()}},r.prototype.onFragParsingData=function(t){var r=this,i=this.fragCurrent,a=t.frag;if(i&&"main"===t.id&&a.sn===i.sn&&a.level===i.level&&("audio"!==t.type||!this.altAudio)&&this.state===y.State.PARSING){var n=this.levels[this.level],o=i;if(e.isFinite(t.endPTS)||(t.endPTS=t.startPTS+i.duration,t.endDTS=t.startDTS+i.duration),!0===t.hasAudio&&o.addElementaryStream(u.default.ElementaryStreamTypes.AUDIO),!0===t.hasVideo&&o.addElementaryStream(u.default.ElementaryStreamTypes.VIDEO),p.logger.log("Parsed "+t.type+",PTS:["+t.startPTS.toFixed(3)+","+t.endPTS.toFixed(3)+"],DTS:["+t.startDTS.toFixed(3)+"/"+t.endDTS.toFixed(3)+"],nb:"+t.nb+",dropped:"+(t.dropped||0)),"video"===t.type)if(o.dropped=t.dropped,o.dropped)if(o.backtracked)p.logger.warn("Already backtracked on this fragment, appending with the gap",o.sn);else{var l=n.details;if(!l||o.sn!==l.startSN)return p.logger.warn("missing video frame(s), backtracking fragment",o.sn),this.fragmentTracker.removeFragment(o),o.backtracked=!0,this.nextLoadPosition=t.startPTS,this.state=y.State.IDLE,this.fragPrevious=o,void this.tick();p.logger.warn("missing video frame(s) on first frag, appending with gap",o.sn)}else o.backtracked=!1;var d=f.updateFragPTSDTS(n.details,o,t.startPTS,t.endPTS,t.startDTS,t.endDTS),c=this.hls;c.trigger(s.default.LEVEL_PTS_UPDATED,{details:n.details,level:this.level,drift:d,type:t.type,start:t.startPTS,end:t.endPTS}),[t.data1,t.data2].forEach(function(e){e&&e.length&&r.state===y.State.PARSING&&(r.appended=!0,r.pendingBuffering=!0,c.trigger(s.default.BUFFER_APPENDING,{type:t.type,data:e,parent:"main",content:"data"}))}),this.tick()}},r.prototype.onFragParsed=function(e){var t=this.fragCurrent,r=e.frag;t&&"main"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===y.State.PARSING&&(this.stats.tparsed=window.performance.now(),this.state=y.State.PARSED,this._checkAppendedParsed())},r.prototype.onAudioTrackSwitching=function(t){var r=!!t.url,i=t.id;if(!r){if(this.mediaBuffer!==this.media){p.logger.log("switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var a=this.fragCurrent;a.loader&&(p.logger.log("switching to main audio track, cancel main fragment load"),a.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=y.State.IDLE}var n=this.hls;n.trigger(s.default.BUFFER_FLUSHING,{startOffset:0,endOffset:e.POSITIVE_INFINITY,type:"audio"}),n.trigger(s.default.AUDIO_TRACK_SWITCHED,{id:i}),this.altAudio=!1}},r.prototype.onAudioTrackSwitched=function(e){var t=e.id,r=!!this.hls.audioTracks[t].url;if(r){var i=this.videoBuffer;i&&this.mediaBuffer!==i&&(p.logger.log("switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=i)}this.altAudio=r,this.tick()},r.prototype.onBufferCreated=function(e){var t,r,i=e.tracks,a=!1;for(var n in i){var o=i[n];"main"===o.id?(r=n,t=o,"video"===n&&(this.videoBuffer=i[n].buffer)):a=!0}a&&t?(p.logger.log("alternate track found, use "+r+".buffered to schedule main fragment loading"),this.mediaBuffer=t.buffer):this.mediaBuffer=this.media},r.prototype.onBufferAppended=function(e){if("main"===e.parent){var t=this.state;t!==y.State.PARSING&&t!==y.State.PARSED||(this.pendingBuffering=e.pending>0,this._checkAppendedParsed())}},r.prototype._checkAppendedParsed=function(){if(!(this.state!==y.State.PARSED||this.appended&&this.pendingBuffering)){var e=this.fragCurrent;if(e){var t=this.mediaBuffer?this.mediaBuffer:this.media;p.logger.log("main buffered : "+c.default.toString(t.buffered)),this.fragPrevious=e;var r=this.stats;r.tbuffered=window.performance.now(),this.fragLastKbps=Math.round(8*r.total/(r.tbuffered-r.tfirst)),this.hls.trigger(s.default.FRAG_BUFFERED,{stats:r,frag:e,id:"main"}),this.state=y.State.IDLE}this.tick()}},r.prototype.onError=function(t){var r=t.frag||this.fragCurrent;if(!r||"main"===r.type){var i=!!this.media&&n.BufferHelper.isBuffered(this.media,this.media.currentTime)&&n.BufferHelper.isBuffered(this.media,this.media.currentTime+.5);switch(t.details){case h.ErrorDetails.FRAG_LOAD_ERROR:case h.ErrorDetails.FRAG_LOAD_TIMEOUT:case h.ErrorDetails.KEY_LOAD_ERROR:case h.ErrorDetails.KEY_LOAD_TIMEOUT:if(!t.fatal)if(this.fragLoadError+1<=this.config.fragLoadingMaxRetry){var a=Math.min(Math.pow(2,this.fragLoadError)*this.config.fragLoadingRetryDelay,this.config.fragLoadingMaxRetryTimeout);p.logger.warn("mediaController: frag loading failed, retry in "+a+" ms"),this.retryDate=window.performance.now()+a,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.fragLoadError++,this.state=y.State.FRAG_LOADING_WAITING_RETRY}else p.logger.error("mediaController: "+t.details+" reaches max retry, redispatch as fatal ..."),t.fatal=!0,this.state=y.State.ERROR;break;case h.ErrorDetails.LEVEL_LOAD_ERROR:case h.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==y.State.ERROR&&(t.fatal?(this.state=y.State.ERROR,p.logger.warn("streamController: "+t.details+",switch to "+this.state+" state ...")):t.levelRetry||this.state!==y.State.WAITING_LEVEL||(this.state=y.State.IDLE));break;case h.ErrorDetails.BUFFER_FULL_ERROR:"main"!==t.parent||this.state!==y.State.PARSING&&this.state!==y.State.PARSED||(i?(this._reduceMaxBufferLength(this.config.maxBufferLength),this.state=y.State.IDLE):(p.logger.warn("buffer full error also media.currentTime is not buffered, flush everything"),this.fragCurrent=null,this.flushMainBuffer(0,e.POSITIVE_INFINITY)))}}},r.prototype._reduceMaxBufferLength=function(e){var t=this.config;return t.maxMaxBufferLength>=e&&(t.maxMaxBufferLength/=2,p.logger.warn("main:reduce max buffer length to "+t.maxMaxBufferLength+"s"),!0)},r.prototype._checkBuffer=function(){var e=this.media;if(e&&0!==e.readyState){var t=(this.mediaBuffer?this.mediaBuffer:e).buffered;!this.loadedmetadata&&t.length?(this.loadedmetadata=!0,this._seekToStartPos()):this.immediateSwitch?this.immediateLevelSwitchEnd():this.gapController.poll(this.lastCurrentTime,t)}},r.prototype.onFragLoadEmergencyAborted=function(){this.state=y.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tick()},r.prototype.onBufferFlushed=function(){var e=this.mediaBuffer?this.mediaBuffer:this.media;e&&this.fragmentTracker.detectEvictedFragments(u.default.ElementaryStreamTypes.VIDEO,e.buffered),this.state=y.State.IDLE,this.fragPrevious=null},r.prototype.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},r.prototype.computeLivePosition=function(e,t){var r=void 0!==this.config.liveSyncDuration?this.config.liveSyncDuration:this.config.liveSyncDurationCount*t.targetduration;return e+Math.max(0,t.totalduration-r)},r.prototype._seekToStartPos=function(){var e=this.media,t=e.currentTime,r=e.seeking?t:this.startPosition;t!==r&&(p.logger.log("target start position not buffered, seek to buffered.start(0) "+r+" from current time "+t+" "),e.currentTime=r)},r.prototype._getAudioCodec=function(e){var t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&(p.logger.log("swapping playlist audio codec"),t&&(t=-1!==t.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5")),t},Object.defineProperty(r.prototype,"liveSyncPosition",{get:function(){return this._liveSyncPosition},set:function(e){this._liveSyncPosition=e},enumerable:!0,configurable:!0}),r}(y.default);t.default=_}).call(this,r(2).Number)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var i=r(32),a=r(1),n=r(18),o=r(0),s=r(3),l=r(12),u=r(6),d=r(22),f=u.getSelfScope(),c=l.getMediaSource(),h=function(){function t(e,t){var r=this;this.hls=e,this.id=t;var l=this.observer=new d.Observer,u=e.config,h=function(t,i){(i=i||{}).frag=r.frag,i.id=r.id,e.trigger(t,i)};l.on(a.default.FRAG_DECRYPTED,h),l.on(a.default.FRAG_PARSING_INIT_SEGMENT,h),l.on(a.default.FRAG_PARSING_DATA,h),l.on(a.default.FRAG_PARSED,h),l.on(a.default.ERROR,h),l.on(a.default.FRAG_PARSING_METADATA,h),l.on(a.default.FRAG_PARSING_USERDATA,h),l.on(a.default.INIT_PTS_FOUND,h);var p={mp4:c.isTypeSupported("video/mp4"),mpeg:c.isTypeSupported("audio/mpeg"),mp3:c.isTypeSupported('audio/mp4; codecs="mp3"')},g=navigator.vendor;if(u.enableWorker&&"undefined"!=typeof Worker){o.logger.log("demuxing in webworker");var v=void 0;try{v=this.w=i(46),this.onwmsg=this.onWorkerMessage.bind(this),v.addEventListener("message",this.onwmsg),v.onerror=function(t){e.trigger(a.default.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",err:{message:t.message+" ("+t.filename+":"+t.lineno+")"}})},v.postMessage({cmd:"init",typeSupported:p,vendor:g,id:t,config:JSON.stringify(u)})}catch(e){o.logger.warn("Error in worker:",e),o.logger.error("Error while initializing DemuxerWorker, fallback on DemuxerInline"),v&&f.URL.revokeObjectURL(v.objectURL),this.demuxer=new n.default(l,p,u,g),this.w=void 0}}else this.demuxer=new n.default(l,p,u,g)}return t.prototype.destroy=function(){var e=this.w;if(e)e.removeEventListener("message",this.onwmsg),e.terminate(),this.w=null;else{var t=this.demuxer;t&&(t.destroy(),this.demuxer=null)}var r=this.observer;r&&(r.removeAllListeners(),this.observer=null)},t.prototype.push=function(t,r,i,a,n,s,l,u){var d=this.w,f=e.isFinite(n.startPTS)?n.startPTS:n.start,c=n.decryptdata,h=this.frag,p=!(h&&n.cc===h.cc),g=!(h&&n.level===h.level),v=h&&n.sn===h.sn+1,m=!g&&v;if(p&&o.logger.log(this.id+":discontinuity detected"),g&&o.logger.log(this.id+":switch detected"),this.frag=n,d)d.postMessage({cmd:"demux",data:t,decryptdata:c,initSegment:r,audioCodec:i,videoCodec:a,timeOffset:f,discontinuity:p,trackSwitch:g,contiguous:m,duration:s,accurateTimeOffset:l,defaultInitPTS:u},t instanceof ArrayBuffer?[t]:[]);else{var y=this.demuxer;y&&y.push(t,c,r,i,a,f,p,g,m,s,l,u)}},t.prototype.onWorkerMessage=function(e){var t=e.data,r=this.hls;switch(t.event){case"init":f.URL.revokeObjectURL(this.w.objectURL);break;case a.default.FRAG_PARSING_DATA:t.data.data1=new Uint8Array(t.data1),t.data2&&(t.data.data2=new Uint8Array(t.data2));default:t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,r.trigger(t.event,t.data)}},t}();t.default=h}).call(this,r(2).Number)},function(e,t,r){function i(e){var t={};function r(i){if(t[i])return t[i].exports;var a=t[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,r),a.l=!0,a.exports}r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r.oe=function(e){throw console.error(e),e};var i=r(r.s=ENTRY_MODULE);return i.default||i}var a="[\\.|\\-|\\+|\\w|/|@]+",n="\\((/\\*.*?\\*/)?s?.*?("+a+").*?\\)";function o(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function s(e){return!isNaN(1*e)}function l(e,t,i){var l={};l[i]=[];var u=t.toString(),d=u.match(/^function\s?\(\w+,\s*\w+,\s*(\w+)\)/);if(!d)return l;for(var f,c=d[1],h=new RegExp("(\\\\n|\\W)"+o(c)+n,"g");f=h.exec(u);)"dll-reference"!==f[3]&&l[i].push(f[3]);for(h=new RegExp("\\("+o(c)+'\\("(dll-reference\\s('+a+'))"\\)\\)'+n,"g");f=h.exec(u);)e[f[2]]||(l[i].push(f[1]),e[f[2]]=r(f[1]).m),l[f[2]]=l[f[2]]||[],l[f[2]].push(f[4]);for(var p=Object.keys(l),g=0;g<p.length;g++)for(var v=0;v<l[p[g]].length;v++)s(l[p[g]][v])&&(l[p[g]][v]=1*l[p[g]][v]);return l}function u(e){return Object.keys(e).reduce(function(t,r){return t||e[r].length>0},!1)}e.exports=function(e,t){t=t||{};var a={main:r.m},n=t.all?{main:Object.keys(a.main)}:function(e,t){for(var r={main:[t]},i={main:[]},a={main:{}};u(r);)for(var n=Object.keys(r),o=0;o<n.length;o++){var s=n[o],d=r[s].pop();if(a[s]=a[s]||{},!a[s][d]&&e[s][d]){a[s][d]=!0,i[s]=i[s]||[],i[s].push(d);for(var f=l(e,e[s][d],s),c=Object.keys(f),h=0;h<c.length;h++)r[c[h]]=r[c[h]]||[],r[c[h]]=r[c[h]].concat(f[c[h]])}}return i}(a,e),o="";Object.keys(n).filter(function(e){return"main"!==e}).forEach(function(e){for(var t=0;n[e][t];)t++;n[e].push(t),a[e][t]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",o=o+"var "+e+" = ("+i.toString().replace("ENTRY_MODULE",JSON.stringify(t))+")({"+n[e].map(function(t){return JSON.stringify(t)+": "+a[e][t].toString()}).join(",")+"});\n"}),o=o+"new (("+i.toString().replace("ENTRY_MODULE",JSON.stringify(e))+")({"+n.main.map(function(e){return JSON.stringify(e)+": "+a.main[e].toString()}).join(",")+"}))(self);";var s=new window.Blob([o],{type:"text/javascript"});if(t.bare)return s;var d=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(s),f=new window.Worker(d);return f.objectURL=d,f}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){this.subtle=e,this.aesIV=t}return e.prototype.decrypt=function(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)},e}();t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){this.subtle=e,this.key=t}return e.prototype.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},e}();t.default=i},function(e,t,r){"use strict";function i(e){var t=e.byteLength,r=t&&new DataView(e).getUint8(t-1);return r?e.slice(0,t-r):e}Object.defineProperty(t,"__esModule",{value:!0}),t.removePadding=i;var a=function(){function e(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.initTable()}return e.prototype.uint8ArrayToUint32Array_=function(e){for(var t=new DataView(e),r=new Uint32Array(4),i=0;i<4;i++)r[i]=t.getUint32(4*i);return r},e.prototype.initTable=function(){var e=this.sBox,t=this.invSBox,r=this.subMix,i=r[0],a=r[1],n=r[2],o=r[3],s=this.invSubMix,l=s[0],u=s[1],d=s[2],f=s[3],c=new Uint32Array(256),h=0,p=0,g=0;for(g=0;g<256;g++)c[g]=g<128?g<<1:g<<1^283;for(g=0;g<256;g++){var v=p^p<<1^p<<2^p<<3^p<<4;v=v>>>8^255&v^99,e[h]=v,t[v]=h;var m=c[h],y=c[m],_=c[y],E=257*c[v]^16843008*v;i[h]=E<<24|E>>>8,a[h]=E<<16|E>>>16,n[h]=E<<8|E>>>24,o[h]=E,E=16843009*_^65537*y^257*m^16843008*h,l[v]=E<<24|E>>>8,u[v]=E<<16|E>>>16,d[v]=E<<8|E>>>24,f[v]=E,h?(h=m^c[c[c[_^m]]],p^=c[c[p]]):h=p=1}},e.prototype.expandKey=function(e){for(var t=this.uint8ArrayToUint32Array_(e),r=!0,i=0;i<t.length&&r;)r=t[i]===this.key[i],i++;if(!r){this.key=t;var a=this.keySize=t.length;if(4!==a&&6!==a&&8!==a)throw new Error("Invalid aes key size="+a);var n,o,s,l,u=this.ksRows=4*(a+6+1),d=this.keySchedule=new Uint32Array(u),f=this.invKeySchedule=new Uint32Array(u),c=this.sBox,h=this.rcon,p=this.invSubMix,g=p[0],v=p[1],m=p[2],y=p[3];for(n=0;n<u;n++)n<a?s=d[n]=t[n]:(l=s,n%a==0?(l=c[(l=l<<8|l>>>24)>>>24]<<24|c[l>>>16&255]<<16|c[l>>>8&255]<<8|c[255&l],l^=h[n/a|0]<<24):a>6&&n%a==4&&(l=c[l>>>24]<<24|c[l>>>16&255]<<16|c[l>>>8&255]<<8|c[255&l]),d[n]=s=(d[n-a]^l)>>>0);for(o=0;o<u;o++)n=u-o,l=3&o?d[n]:d[n-4],f[o]=o<4||n<=4?l:g[c[l>>>24]]^v[c[l>>>16&255]]^m[c[l>>>8&255]]^y[c[255&l]],f[o]=f[o]>>>0}},e.prototype.networkToHostOrderSwap=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},e.prototype.decrypt=function(e,t,r,a){for(var n,o,s,l,u,d,f,c,h,p,g,v,m,y,_=this.keySize+6,E=this.invKeySchedule,b=this.invSBox,S=this.invSubMix,T=S[0],A=S[1],R=S[2],L=S[3],D=this.uint8ArrayToUint32Array_(r),O=D[0],w=D[1],P=D[2],I=D[3],x=new Int32Array(e),F=new Int32Array(x.length),k=this.networkToHostOrderSwap;t<x.length;){for(h=k(x[t]),p=k(x[t+1]),g=k(x[t+2]),v=k(x[t+3]),u=h^E[0],d=v^E[1],f=g^E[2],c=p^E[3],m=4,y=1;y<_;y++)n=T[u>>>24]^A[d>>16&255]^R[f>>8&255]^L[255&c]^E[m],o=T[d>>>24]^A[f>>16&255]^R[c>>8&255]^L[255&u]^E[m+1],s=T[f>>>24]^A[c>>16&255]^R[u>>8&255]^L[255&d]^E[m+2],l=T[c>>>24]^A[u>>16&255]^R[d>>8&255]^L[255&f]^E[m+3],u=n,d=o,f=s,c=l,m+=4;n=b[u>>>24]<<24^b[d>>16&255]<<16^b[f>>8&255]<<8^b[255&c]^E[m],o=b[d>>>24]<<24^b[f>>16&255]<<16^b[c>>8&255]<<8^b[255&u]^E[m+1],s=b[f>>>24]<<24^b[c>>16&255]<<16^b[u>>8&255]<<8^b[255&d]^E[m+2],l=b[c>>>24]<<24^b[u>>16&255]<<16^b[d>>8&255]<<8^b[255&f]^E[m+3],m+=3,F[t]=k(n^O),F[t+1]=k(l^w),F[t+2]=k(s^P),F[t+3]=k(o^I),O=h,w=p,P=g,I=v,t+=4}return a?i(F.buffer):F.buffer},e.prototype.destroy=function(){this.key=void 0,this.keySize=void 0,this.ksRows=void 0,this.sBox=void 0,this.invSBox=void 0,this.subMix=void 0,this.invSubMix=void 0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.rcon=void 0},e}();t.default=a},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var i=r(20),a=r(0),n=r(11),o=function(){function t(e,t,r){this.observer=e,this.config=r,this.remuxer=t}return t.prototype.resetInitSegment=function(e,t,r,i){this._audioTrack={container:"audio/adts",type:"audio",id:0,sequenceNumber:0,isAAC:!0,samples:[],len:0,manifestCodec:t,duration:i,inputTimeScale:9e4}},t.prototype.resetTimeStamp=function(){},t.probe=function(e){if(!e)return!1;for(var t=(n.default.getID3Data(e,0)||[]).length,r=e.length;t<r;t++)if(i.probe(e,t))return a.logger.log("ADTS sync word found !"),!0;return!1},t.prototype.append=function(t,r,o,s){for(var l=this._audioTrack,u=n.default.getID3Data(t,0)||[],d=n.default.getTimeStamp(u),f=e.isFinite(d)?90*d:9e4*r,c=0,h=f,p=t.length,g=u.length,v=[{pts:h,dts:h,data:u}];g<p-1;)if(i.isHeader(t,g)&&g+5<p){i.initTrackConfig(l,this.observer,t,g,l.manifestCodec);var m=i.appendFrame(l,t,g,f,c);if(!m){a.logger.log("Unable to parse AAC frame");break}g+=m.length,h=m.sample.pts,c++}else n.default.isHeader(t,g)?(u=n.default.getID3Data(t,g),v.push({pts:h,dts:h,data:u}),g+=u.length):g++;this.remuxer.remux(l,{samples:[]},{samples:v,inputTimeScale:9e4},{samples:[]},r,o,s)},t.prototype.destroy=function(){},t}();t.default=o}).call(this,r(2).Number)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(20),a=r(21),n=r(1),o=r(38),s=r(39),l=r(0),u=r(3),d={video:1,audio:2,id3:3,text:4},f=function(){function e(e,t,r,i){this.observer=e,this.config=r,this.typeSupported=i,this.remuxer=t,this.sampleAes=null}return e.prototype.setDecryptData=function(e){null!=e&&null!=e.key&&"SAMPLE-AES"===e.method?this.sampleAes=new s.default(this.observer,this.config,e,this.discardEPB):this.sampleAes=null},e.probe=function(t){var r=e._syncOffset(t);return!(r<0)&&(r&&l.logger.warn("MPEG2-TS detected but first sync word found @ offset "+r+", junk ahead ?"),!0)},e._syncOffset=function(e){for(var t=Math.min(1e3,e.length-564),r=0;r<t;){if(71===e[r]&&71===e[r+188]&&71===e[r+376])return r;r++}return-1},e.createTrack=function(e,t){return{container:"video"===e||"audio"===e?"video/mp2t":void 0,type:e,id:d[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],len:0,dropped:"video"===e?0:void 0,isAAC:"audio"===e||void 0,duration:"audio"===e?t:void 0}},e.prototype.resetInitSegment=function(t,r,i,a){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=e.createTrack("video",a),this._audioTrack=e.createTrack("audio",a),this._id3Track=e.createTrack("id3",a),this._txtTrack=e.createTrack("text",a),this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=r,this.videoCodec=i,this._duration=a},e.prototype.resetTimeStamp=function(){},e.prototype.append=function(t,r,i,a){var o,s,d,f,c,h=t.length,p=!1;this.contiguous=i;var g=this.pmtParsed,v=this._avcTrack,m=this._audioTrack,y=this._id3Track,_=v.pid,E=m.pid,b=y.pid,S=this._pmtId,T=v.pesData,A=m.pesData,R=y.pesData,L=this._parsePAT,D=this._parsePMT,O=this._parsePES,w=this._parseAVCPES.bind(this),P=this._parseAACPES.bind(this),I=this._parseMPEGPES.bind(this),x=this._parseID3PES.bind(this),F=e._syncOffset(t);for(h-=(h+F)%188,o=F;o<h;o+=188)if(71===t[o]){if(s=!!(64&t[o+1]),d=((31&t[o+1])<<8)+t[o+2],(48&t[o+3])>>4>1){if((f=o+5+t[o+4])===o+188)continue}else f=o+4;switch(d){case _:s&&(T&&(c=O(T))&&void 0!==c.pts&&w(c,!1),T={data:[],size:0}),T&&(T.data.push(t.subarray(f,o+188)),T.size+=o+188-f);break;case E:s&&(A&&(c=O(A))&&void 0!==c.pts&&(m.isAAC?P(c):I(c)),A={data:[],size:0}),A&&(A.data.push(t.subarray(f,o+188)),A.size+=o+188-f);break;case b:s&&(R&&(c=O(R))&&void 0!==c.pts&&x(c),R={data:[],size:0}),R&&(R.data.push(t.subarray(f,o+188)),R.size+=o+188-f);break;case 0:s&&(f+=t[f]+1),S=this._pmtId=L(t,f);break;case S:s&&(f+=t[f]+1);var k=D(t,f,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,null!=this.sampleAes);(_=k.avc)>0&&(v.pid=_),(E=k.audio)>0&&(m.pid=E,m.isAAC=k.isAAC),(b=k.id3)>0&&(y.pid=b),p&&!g&&(l.logger.log("reparse from beginning"),p=!1,o=F-188),g=this.pmtParsed=!0;break;case 17:case 8191:break;default:p=!0}}else this.observer.trigger(n.default.ERROR,{type:u.ErrorTypes.MEDIA_ERROR,details:u.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});T&&(c=O(T))&&void 0!==c.pts?(w(c,!0),v.pesData=null):v.pesData=T,A&&(c=O(A))&&void 0!==c.pts?(m.isAAC?P(c):I(c),m.pesData=null):(A&&A.size&&l.logger.log("last AAC PES packet truncated,might overlap between fragments"),m.pesData=A),R&&(c=O(R))&&void 0!==c.pts?(x(c),y.pesData=null):y.pesData=R,null==this.sampleAes?this.remuxer.remux(m,v,y,this._txtTrack,r,i,a):this.decryptAndRemux(m,v,y,this._txtTrack,r,i,a)},e.prototype.decryptAndRemux=function(e,t,r,i,a,n,o){if(e.samples&&e.isAAC){var s=this;this.sampleAes.decryptAacSamples(e.samples,0,function(){s.decryptAndRemuxAvc(e,t,r,i,a,n,o)})}else this.decryptAndRemuxAvc(e,t,r,i,a,n,o)},e.prototype.decryptAndRemuxAvc=function(e,t,r,i,a,n,o){if(t.samples){var s=this;this.sampleAes.decryptAvcSamples(t.samples,0,0,function(){s.remuxer.remux(e,t,r,i,a,n,o)})}else this.remuxer.remux(e,t,r,i,a,n,o)},e.prototype.destroy=function(){this._initPTS=this._initDTS=void 0,this._duration=0},e.prototype._parsePAT=function(e,t){return(31&e[t+10])<<8|e[t+11]},e.prototype._parsePMT=function(e,t,r,i){var a,n,o={audio:-1,avc:-1,id3:-1,isAAC:!0};for(a=t+3+((15&e[t+1])<<8|e[t+2])-4,t+=12+((15&e[t+10])<<8|e[t+11]);t<a;){switch(n=(31&e[t+1])<<8|e[t+2],e[t]){case 207:if(!i){l.logger.log("unkown stream type:"+e[t]);break}case 15:-1===o.audio&&(o.audio=n);break;case 21:-1===o.id3&&(o.id3=n);break;case 219:if(!i){l.logger.log("unkown stream type:"+e[t]);break}case 27:-1===o.avc&&(o.avc=n);break;case 3:case 4:r?-1===o.audio&&(o.audio=n,o.isAAC=!1):l.logger.log("MPEG audio found, not supported in this browser for now");break;case 36:l.logger.warn("HEVC stream type found, not supported for now");break;default:l.logger.log("unkown stream type:"+e[t])}t+=5+((15&e[t+3])<<8|e[t+4])}return o},e.prototype._parsePES=function(e){var t,r,i,a,n,o,s,u,d=0,f=e.data;if(!e||0===e.size)return null;for(;f[0].length<19&&f.length>1;){var c=new Uint8Array(f[0].length+f[1].length);c.set(f[0]),c.set(f[1],f[0].length),f[0]=c,f.splice(1,1)}if(1===((t=f[0])[0]<<16)+(t[1]<<8)+t[2]){if((i=(t[4]<<8)+t[5])&&i>e.size-6)return null;192&(r=t[7])&&((o=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2)>4294967295&&(o-=8589934592),64&r?((s=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2)>4294967295&&(s-=8589934592),o-s>54e5&&(l.logger.warn(Math.round((o-s)/9e4)+"s delta between PTS and DTS, align them"),o=s)):s=o),u=(a=t[8])+9,e.size-=u,n=new Uint8Array(e.size);for(var h=0,p=f.length;h<p;h++){var g=(t=f[h]).byteLength;if(u){if(u>g){u-=g;continue}t=t.subarray(u),g-=u,u=0}n.set(t,d),d+=g}return i&&(i-=a+3),{data:n,pts:o,dts:s,len:i}}return null},e.prototype.pushAccesUnit=function(e,t){if(e.units.length&&e.frame){var r=t.samples,i=r.length;!this.config.forceKeyFrameOnDiscontinuity||!0===e.key||t.sps&&(i||this.contiguous)?(e.id=i,r.push(e)):t.dropped++}e.debug.length&&l.logger.log(e.pts+"/"+e.dts+":"+e.debug)},e.prototype._parseAVCPES=function(e,t){var r,i,a,n=this,s=this._avcTrack,l=this._parseAVCNALu(e.data),u=this.avcSample,d=!1,f=this.pushAccesUnit.bind(this),c=function(e,t,r,i){return{key:e,pts:t,dts:r,units:[],debug:i}};e.data=null,u&&l.length&&!s.audFound&&(f(u,s),u=this.avcSample=c(!1,e.pts,e.dts,"")),l.forEach(function(t){switch(t.type){case 1:i=!0,u||(u=n.avcSample=c(!0,e.pts,e.dts,"")),u.frame=!0;var l=t.data;if(d&&l.length>4){var h=new o.default(l).readSliceType();2!==h&&4!==h&&7!==h&&9!==h||(u.key=!0)}break;case 5:i=!0,u||(u=n.avcSample=c(!0,e.pts,e.dts,"")),u.key=!0,u.frame=!0;break;case 6:i=!0,(r=new o.default(n.discardEPB(t.data))).readUByte();for(var p=0,g=0,v=!1,m=0;!v&&r.bytesAvailable>1;){p=0;do{p+=m=r.readUByte()}while(255===m);g=0;do{g+=m=r.readUByte()}while(255===m);if(4===p&&0!==r.bytesAvailable){if(v=!0,181===r.readUByte())if(49===r.readUShort())if(1195456820===r.readUInt())if(3===r.readUByte()){var y=r.readUByte(),_=31&y,E=[y,r.readUByte()];for(a=0;a<_;a++)E.push(r.readUByte()),E.push(r.readUByte()),E.push(r.readUByte());n._insertSampleInOrder(n._txtTrack.samples,{type:3,pts:e.pts,bytes:E})}}else if(g<r.bytesAvailable)for(a=0;a<g;a++)r.readUByte()}break;case 7:if(i=!0,d=!0,!s.sps){var b=(r=new o.default(t.data)).readSPS();s.width=b.width,s.height=b.height,s.pixelRatio=b.pixelRatio,s.sps=[t.data],s.duration=n._duration;var S=t.data.subarray(1,4),T="avc1.";for(a=0;a<3;a++){var A=S[a].toString(16);A.length<2&&(A="0"+A),T+=A}s.codec=T}break;case 8:i=!0,s.pps||(s.pps=[t.data]);break;case 9:i=!1,s.audFound=!0,u&&f(u,s),u=n.avcSample=c(!1,e.pts,e.dts,"");break;case 12:i=!1;break;default:i=!1,u&&(u.debug+="unknown NAL "+t.type+" ")}u&&i&&u.units.push(t)}),t&&u&&(f(u,s),this.avcSample=null)},e.prototype._insertSampleInOrder=function(e,t){var r=e.length;if(r>0){if(t.pts>=e[r-1].pts)e.push(t);else for(var i=r-1;i>=0;i--)if(t.pts<e[i].pts){e.splice(i,0,t);break}}else e.push(t)},e.prototype._getLastNalUnit=function(){var e,t=this.avcSample;if(!t||0===t.units.length){var r=this._avcTrack.samples;t=r[r.length-1]}if(t){var i=t.units;e=i[i.length-1]}return e},e.prototype._parseAVCNALu=function(e){var t,r,i,a,n=0,o=e.byteLength,s=this._avcTrack,l=s.naluState||0,u=l,d=[],f=-1;for(-1===l&&(f=0,a=31&e[0],l=0,n=1);n<o;)if(t=e[n++],l)if(1!==l)if(t)if(1===t){var c,h;if(f>=0)i={data:e.subarray(f,n-l-1),type:a},d.push(i);else if(c=this._getLastNalUnit())if(u&&n<=4-u&&c.state&&(c.data=c.data.subarray(0,c.data.byteLength-u)),(r=n-l-1)>0)(h=new Uint8Array(c.data.byteLength+r)).set(c.data,0),h.set(e.subarray(0,r),c.data.byteLength),c.data=h;n<o?(f=n,a=31&e[n],l=0):l=-1}else l=0;else l=3;else l=t?0:2;else l=t?0:1;(f>=0&&l>=0&&(i={data:e.subarray(f,o),type:a,state:l},d.push(i)),0===d.length)&&((c=this._getLastNalUnit())&&((h=new Uint8Array(c.data.byteLength+e.byteLength)).set(c.data,0),h.set(e,c.data.byteLength),c.data=h));return s.naluState=l,d},e.prototype.discardEPB=function(e){for(var t,r,i=e.byteLength,a=[],n=1;n<i-2;)0===e[n]&&0===e[n+1]&&3===e[n+2]?(a.push(n+2),n+=2):n++;if(0===a.length)return e;t=i-a.length,r=new Uint8Array(t);var o=0;for(n=0;n<t;o++,n++)o===a[0]&&(o++,a.shift()),r[n]=e[o];return r},e.prototype._parseAACPES=function(e){var t,r,a,o,s,d=this._audioTrack,f=e.data,c=e.pts,h=this.aacOverFlow,p=this.aacLastPTS;if(h){var g=new Uint8Array(h.byteLength+f.byteLength);g.set(h,0),g.set(f,h.byteLength),f=g}for(a=0,s=f.length;a<s-1&&!i.isHeader(f,a);a++);if(a){var v=void 0,m=void 0;if(a<s-1?(v="AAC PES did not start with ADTS header,offset:"+a,m=!1):(v="no ADTS header found in AAC PES",m=!0),l.logger.warn("parsing error:"+v),this.observer.trigger(n.default.ERROR,{type:u.ErrorTypes.MEDIA_ERROR,details:u.ErrorDetails.FRAG_PARSING_ERROR,fatal:m,reason:v}),m)return}if(i.initTrackConfig(d,this.observer,f,a,this.audioCodec),r=0,t=i.getFrameDuration(d.samplerate),h&&p){var y=p+t;Math.abs(y-c)>1&&(l.logger.log("AAC: align PTS for overlapping frames by "+Math.round((y-c)/90)),c=y)}for(;a<s;)if(i.isHeader(f,a)&&a+5<s){var _=i.appendFrame(d,f,a,c,r);if(!_)break;a+=_.length,o=_.sample.pts,r++}else a++;h=a<s?f.subarray(a,s):null,this.aacOverFlow=h,this.aacLastPTS=o},e.prototype._parseMPEGPES=function(e){for(var t=e.data,r=t.length,i=0,n=0,o=e.pts;n<r;)if(a.default.isHeader(t,n)){var s=a.default.appendFrame(this._audioTrack,t,n,o,i);if(!s)break;n+=s.length,i++}else n++},e.prototype._parseID3PES=function(e){this._id3Track.samples.push(e)},e}();t.default=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),a=function(){function e(e){this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}return e.prototype.loadWord=function(){var e=this.data,t=this.bytesAvailable,r=e.byteLength-t,i=new Uint8Array(4),a=Math.min(4,t);if(0===a)throw new Error("no bytes available");i.set(e.subarray(r,r+a)),this.word=new DataView(i.buffer).getUint32(0),this.bitsAvailable=8*a,this.bytesAvailable-=a},e.prototype.skipBits=function(e){var t;this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,e-=(t=e>>3)>>3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)},e.prototype.readBits=function(e){var t=Math.min(this.bitsAvailable,e),r=this.word>>>32-t;return e>32&&i.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0?this.word<<=t:this.bytesAvailable>0&&this.loadWord(),(t=e-t)>0&&this.bitsAvailable?r<<t|this.readBits(t):r},e.prototype.skipLZ=function(){var e;for(e=0;e<this.bitsAvailable;++e)if(0!=(this.word&2147483648>>>e))return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()},e.prototype.skipUEG=function(){this.skipBits(1+this.skipLZ())},e.prototype.skipEG=function(){this.skipBits(1+this.skipLZ())},e.prototype.readUEG=function(){var e=this.skipLZ();return this.readBits(e+1)-1},e.prototype.readEG=function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)},e.prototype.readBoolean=function(){return 1===this.readBits(1)},e.prototype.readUByte=function(){return this.readBits(8)},e.prototype.readUShort=function(){return this.readBits(16)},e.prototype.readUInt=function(){return this.readBits(32)},e.prototype.skipScalingList=function(e){var t,r=8,i=8;for(t=0;t<e;t++)0!==i&&(i=(r+this.readEG()+256)%256),r=0===i?r:i},e.prototype.readSPS=function(){var e,t,r,i,a,n,o,s=0,l=0,u=0,d=0,f=this.readUByte.bind(this),c=this.readBits.bind(this),h=this.readUEG.bind(this),p=this.readBoolean.bind(this),g=this.skipBits.bind(this),v=this.skipEG.bind(this),m=this.skipUEG.bind(this),y=this.skipScalingList.bind(this);if(f(),e=f(),c(5),g(3),f(),m(),100===e||110===e||122===e||244===e||44===e||83===e||86===e||118===e||128===e){var _=h();if(3===_&&g(1),m(),m(),g(1),p())for(n=3!==_?8:12,o=0;o<n;o++)p()&&y(o<6?16:64)}m();var E=h();if(0===E)h();else if(1===E)for(g(1),v(),v(),t=h(),o=0;o<t;o++)v();m(),g(1),r=h(),i=h(),0===(a=c(1))&&g(1),g(1),p()&&(s=h(),l=h(),u=h(),d=h());var b=[1,1];if(p()&&p())switch(f()){case 1:b=[1,1];break;case 2:b=[12,11];break;case 3:b=[10,11];break;case 4:b=[16,11];break;case 5:b=[40,33];break;case 6:b=[24,11];break;case 7:b=[20,11];break;case 8:b=[32,11];break;case 9:b=[80,33];break;case 10:b=[18,11];break;case 11:b=[15,11];break;case 12:b=[64,33];break;case 13:b=[160,99];break;case 14:b=[4,3];break;case 15:b=[3,2];break;case 16:b=[2,1];break;case 255:b=[f()<<8|f(),f()<<8|f()]}return{width:Math.ceil(16*(r+1)-2*s-2*l),height:(2-a)*(i+1)*16-(a?2:4)*(u+d),pixelRatio:b}},e.prototype.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},e}();t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(19),a=function(){function e(e,t,r,a){this.decryptdata=r,this.discardEPB=a,this.decrypter=new i.default(e,t,{removePKCS7Padding:!1})}return e.prototype.decryptBuffer=function(e,t){this.decrypter.decrypt(e,this.decryptdata.key.buffer,this.decryptdata.iv.buffer,t)},e.prototype.decryptAacSample=function(e,t,r,i){var a=e[t].unit,n=a.subarray(16,a.length-a.length%16),o=n.buffer.slice(n.byteOffset,n.byteOffset+n.length),s=this;this.decryptBuffer(o,function(n){n=new Uint8Array(n),a.set(n,16),i||s.decryptAacSamples(e,t+1,r)})},e.prototype.decryptAacSamples=function(e,t,r){for(;;t++){if(t>=e.length)return void r();if(!(e[t].unit.length<32)){var i=this.decrypter.isSync();if(this.decryptAacSample(e,t,r,i),!i)return}}},e.prototype.getAvcEncryptedData=function(e){for(var t=16*Math.floor((e.length-48)/160)+16,r=new Int8Array(t),i=0,a=32;a<=e.length-16;a+=160,i+=16)r.set(e.subarray(a,a+16),i);return r},e.prototype.getAvcDecryptedUnit=function(e,t){t=new Uint8Array(t);for(var r=0,i=32;i<=e.length-16;i+=160,r+=16)e.set(t.subarray(r,r+16),i);return e},e.prototype.decryptAvcSample=function(e,t,r,i,a,n){var o=this.discardEPB(a.data),s=this.getAvcEncryptedData(o),l=this;this.decryptBuffer(s.buffer,function(s){a.data=l.getAvcDecryptedUnit(o,s),n||l.decryptAvcSamples(e,t,r+1,i)})},e.prototype.decryptAvcSamples=function(e,t,r,i){for(;;t++,r=0){if(t>=e.length)return void i();for(var a=e[t].units;!(r>=a.length);r++){var n=a[r];if(!(n.length<=48||1!==n.type&&5!==n.type)){var o=this.decrypter.isSync();if(this.decryptAvcSample(e,t,r,i,n,o),!o)return}}}},e}();t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(11),a=r(0),n=r(21),o=function(){function e(e,t,r){this.observer=e,this.config=r,this.remuxer=t}return e.prototype.resetInitSegment=function(e,t,r,i){this._audioTrack={container:"audio/mpeg",type:"audio",id:-1,sequenceNumber:0,isAAC:!1,samples:[],len:0,manifestCodec:t,duration:i,inputTimeScale:9e4}},e.prototype.resetTimeStamp=function(){},e.probe=function(e){var t,r,o=i.default.getID3Data(e,0);if(o&&void 0!==i.default.getTimeStamp(o))for(t=o.length,r=Math.min(e.length-1,t+100);t<r;t++)if(n.default.probe(e,t))return a.logger.log("MPEG Audio sync word found !"),!0;return!1},e.prototype.append=function(e,t,r,a){for(var o=i.default.getID3Data(e,0),s=i.default.getTimeStamp(o),l=s?90*s:9e4*t,u=o.length,d=e.length,f=0,c=0,h=this._audioTrack,p=[{pts:l,dts:l,data:o}];u<d;)if(n.default.isHeader(e,u)){var g=n.default.appendFrame(h,e,u,l,f);if(!g)break;u+=g.length,c=g.sample.pts,f++}else i.default.isHeader(e,u)?(o=i.default.getID3Data(e,u),p.push({pts:c,dts:c,data:o}),u+=o.length):u++;this.remuxer.remux(h,{samples:[]},{samples:p,inputTimeScale:9e4},{samples:[]},t,r,a)},e.prototype.destroy=function(){},e}();t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(42),a=r(43),n=r(1),o=r(3),s=r(0),l=function(){function e(e,t,r,i){this.observer=e,this.config=t,this.typeSupported=r;var a=navigator.userAgent;this.isSafari=i&&i.indexOf("Apple")>-1&&a&&!a.match("CriOS"),this.ISGenerated=!1}return e.prototype.destroy=function(){},e.prototype.resetTimeStamp=function(e){this._initPTS=this._initDTS=e},e.prototype.resetInitSegment=function(){this.ISGenerated=!1},e.prototype.remux=function(e,t,r,i,a,o,l){if(this.ISGenerated||this.generateIS(e,t,a),this.ISGenerated){var u=e.samples.length,d=t.samples.length,f=a,c=a;if(u&&d){var h=(e.samples[0].pts-t.samples[0].pts)/t.inputTimeScale;f+=Math.max(0,h),c+=Math.max(0,-h)}if(u){e.timescale||(s.logger.warn("regenerate InitSegment as audio detected"),this.generateIS(e,t,a));var p=this.remuxAudio(e,f,o,l);if(d){var g=void 0;p&&(g=p.endPTS-p.startPTS),t.timescale||(s.logger.warn("regenerate InitSegment as video detected"),this.generateIS(e,t,a)),this.remuxVideo(t,c,o,g,l)}}else if(d){var v=this.remuxVideo(t,c,o,0,l);v&&e.codec&&this.remuxEmptyAudio(e,f,o,v)}}r.samples.length&&this.remuxID3(r,a),i.samples.length&&this.remuxText(i,a),this.observer.trigger(n.default.FRAG_PARSED)},e.prototype.generateIS=function(e,t,r){var i,l,u=this.observer,d=e.samples,f=t.samples,c=this.typeSupported,h="audio/mp4",p={},g={tracks:p},v=void 0===this._initPTS;if(v&&(i=l=1/0),e.config&&d.length&&(e.timescale=e.samplerate,s.logger.log("audio sampling rate : "+e.samplerate),e.isAAC||(c.mpeg?(h="audio/mpeg",e.codec=""):c.mp3&&(e.codec="mp3")),p.audio={container:h,codec:e.codec,initSegment:!e.isAAC&&c.mpeg?new Uint8Array:a.default.initSegment([e]),metadata:{channelCount:e.channelCount}},v&&(i=l=d[0].pts-e.inputTimeScale*r)),t.sps&&t.pps&&f.length){var m=t.inputTimeScale;t.timescale=m,p.video={container:"video/mp4",codec:t.codec,initSegment:a.default.initSegment([t]),metadata:{width:t.width,height:t.height}},v&&(i=Math.min(i,f[0].pts-m*r),l=Math.min(l,f[0].dts-m*r),this.observer.trigger(n.default.INIT_PTS_FOUND,{initPTS:i}))}Object.keys(p).length?(u.trigger(n.default.FRAG_PARSING_INIT_SEGMENT,g),this.ISGenerated=!0,v&&(this._initPTS=i,this._initDTS=l)):u.trigger(n.default.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"no audio/video samples found"})},e.prototype.remuxVideo=function(e,t,r,i,l){var u,d,f,c,h,p,g,v=8,m=e.timescale,y=e.samples,_=[],E=y.length,b=this._PTSNormalize,S=this._initPTS,T=this.nextAvcDts,A=this.isSafari;if(0!==E){A&&(r|=y.length&&T&&(l&&Math.abs(t-T/m)<.1||Math.abs(y[0].pts-T-S)<m/5)),r||(T=t*m),y.forEach(function(e){e.pts=b(e.pts-S,T),e.dts=b(e.dts-S,T)}),y.sort(function(e,t){var r=e.dts-t.dts,i=e.pts-t.pts;return r||i||e.id-t.id});var R=y.reduce(function(e,t){return Math.max(Math.min(e,t.pts-t.dts),-18e3)},0);if(R<0){s.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Math.round(R/90)+" ms to overcome this issue");for(var L=0;L<y.length;L++)y[L].dts+=R}var D=y[0];h=Math.max(D.dts,0),c=Math.max(D.pts,0);var O=Math.round((h-T)/90);r&&O&&(O>1?s.logger.log("AVC:"+O+" ms hole between fragments detected,filling it"):O<-1&&s.logger.log("AVC:"+-O+" ms overlapping between fragments detected"),h=T,y[0].dts=h,c=Math.max(c-O,T),y[0].pts=c,s.logger.log("Video/PTS/DTS adjusted: "+Math.round(c/90)+"/"+Math.round(h/90)+",delta:"+O+" ms")),D=y[y.length-1],g=Math.max(D.dts,0),p=Math.max(D.pts,0,g),A&&(u=Math.round((g-h)/(y.length-1)));var w=0,P=0;for(L=0;L<E;L++){for(var I=y[L],x=I.units,F=x.length,k=0,C=0;C<F;C++)k+=x[C].data.length;P+=k,w+=F,I.length=k,I.dts=A?h+L*u:Math.max(I.dts,h),I.pts=Math.max(I.pts,I.dts)}var M=P+4*w+8;try{d=new Uint8Array(M)}catch(e){return void this.observer.trigger(n.default.ERROR,{type:o.ErrorTypes.MUX_ERROR,details:o.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:M,reason:"fail allocating video mdat "+M})}var N=new DataView(d.buffer);N.setUint32(0,M),d.set(a.default.types.mdat,4);for(L=0;L<E;L++){var U=y[L],B=U.units,G=0,j=void 0;for(C=0,F=B.length;C<F;C++){var H=B[C],K=H.data,V=H.data.byteLength;N.setUint32(v,V),v+=4,d.set(K,v),v+=V,G+=4+V}if(A)j=Math.max(0,u*Math.round((U.pts-U.dts)/u));else{if(L<E-1)u=y[L+1].dts-U.dts;else{var W=this.config,Y=U.dts-y[L>0?L-1:L].dts;if(W.stretchShortVideoTrack){var z=W.maxBufferHole,X=Math.floor(z*m),q=(i?c+i*m:this.nextAudioPts)-U.pts;q>X?((u=q-Y)<0&&(u=Y),s.logger.log("It is approximately "+q/90+" ms to the next segment; using duration "+u/90+" ms for the last video frame.")):u=Y}else u=Y}j=Math.round(U.pts-U.dts)}_.push({size:G,duration:u,cts:j,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:U.key?2:1,isNonSync:U.key?0:1}})}this.nextAvcDts=g+u;var Q=e.dropped;if(e.len=0,e.nbNalu=0,e.dropped=0,_.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var Z=_[0].flags;Z.dependsOn=2,Z.isNonSync=0}e.samples=_,f=a.default.moof(e.sequenceNumber++,h,e),e.samples=[];var J={data1:f,data2:d,startPTS:c/m,endPTS:(p+u)/m,startDTS:h/m,endDTS:this.nextAvcDts/m,type:"video",hasAudio:!1,hasVideo:!0,nb:_.length,dropped:Q};return this.observer.trigger(n.default.FRAG_PARSING_DATA,J),J}},e.prototype.remuxAudio=function(e,t,r,l){var u,d,f,c,h,p,g,v=e.inputTimeScale,m=e.timescale,y=v/m,_=(e.isAAC?1024:1152)*y,E=this._PTSNormalize,b=this._initPTS,S=!e.isAAC&&this.typeSupported.mpeg,T=e.samples,A=[],R=this.nextAudioPts;if(r|=T.length&&R&&(l&&Math.abs(t-R/v)<.1||Math.abs(T[0].pts-R-b)<20*_),T.forEach(function(e){e.pts=e.dts=E(e.pts-b,t*v)}),0!==(T=T.filter(function(e){return e.pts>=0})).length){if(r||(R=l?t*v:T[0].pts),e.isAAC)for(var L=this.config.maxAudioFramesDrift,D=0,O=R;D<T.length;){var w,P=T[D];w=(U=P.pts)-O;var I=Math.abs(1e3*w/v);if(w<=-L*_)s.logger.warn("Dropping 1 audio frame @ "+(O/v).toFixed(3)+"s due to "+Math.round(I)+" ms overlap."),T.splice(D,1),e.len-=P.unit.length;else if(w>=L*_&&I<1e4&&O){var x=Math.round(w/_);s.logger.warn("Injecting "+x+" audio frame @ "+(O/v).toFixed(3)+"s due to "+Math.round(1e3*w/v)+" ms gap.");for(var F=0;F<x;F++){var k=Math.max(O,0);(f=i.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount))||(s.logger.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),f=P.unit.subarray()),T.splice(D,0,{unit:f,pts:k,dts:k}),e.len+=f.length,O+=_,D++}P.pts=P.dts=O,O+=_,D++}else Math.abs(w),P.pts=P.dts=O,O+=_,D++}F=0;for(var C=T.length;F<C;F++){var M=T[F],N=M.unit,U=M.pts;if(void 0!==g)d.duration=Math.round((U-g)/y);else{var B=Math.round(1e3*(U-R)/v),G=0;if(r&&e.isAAC&&B){if(B>0&&B<1e4)G=Math.round((U-R)/_),s.logger.log(B+" ms hole between AAC samples detected,filling it"),G>0&&((f=i.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount))||(f=N.subarray()),e.len+=G*f.length);else if(B<-12){s.logger.log("drop overlapping AAC sample, expected/parsed/delta:"+(R/v).toFixed(3)+"s/"+(U/v).toFixed(3)+"s/"+-B+"ms"),e.len-=N.byteLength;continue}U=R}if(p=U,!(e.len>0))return;var j=S?e.len:e.len+8;u=S?0:8;try{c=new Uint8Array(j)}catch(e){return void this.observer.trigger(n.default.ERROR,{type:o.ErrorTypes.MUX_ERROR,details:o.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:j,reason:"fail allocating audio mdat "+j})}S||(new DataView(c.buffer).setUint32(0,j),c.set(a.default.types.mdat,4));for(D=0;D<G;D++)(f=i.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount))||(s.logger.log("Unable to get silent frame for given audio codec; duplicating this frame instead."),f=N.subarray()),c.set(f,u),u+=f.byteLength,d={size:f.byteLength,cts:0,duration:1024,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},A.push(d)}c.set(N,u);var H=N.byteLength;u+=H,d={size:H,cts:0,duration:0,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},A.push(d),g=U}var K=0,V=A.length;if(V>=2&&(K=A[V-2].duration,d.duration=K),V){this.nextAudioPts=R=g+y*K,e.len=0,e.samples=A,h=S?new Uint8Array:a.default.moof(e.sequenceNumber++,p/y,e),e.samples=[];var W=p/v,Y=R/v,z={data1:h,data2:c,startPTS:W,endPTS:Y,startDTS:W,endDTS:Y,type:"audio",hasAudio:!0,hasVideo:!1,nb:V};return this.observer.trigger(n.default.FRAG_PARSING_DATA,z),z}return null}},e.prototype.remuxEmptyAudio=function(e,t,r,a){var n=e.inputTimeScale,o=n/(e.samplerate?e.samplerate:n),l=this.nextAudioPts,u=(void 0!==l?l:a.startDTS*n)+this._initDTS,d=a.endDTS*n+this._initDTS,f=1024*o,c=Math.ceil((d-u)/f),h=i.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(s.logger.warn("remux empty Audio"),h){for(var p=[],g=0;g<c;g++){var v=u+g*f;p.push({unit:h,pts:v,dts:v}),e.len+=h.length}e.samples=p,this.remuxAudio(e,t,r)}else s.logger.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!")},e.prototype.remuxID3=function(e){var t,r=e.samples.length,i=e.inputTimeScale,a=this._initPTS,o=this._initDTS;if(r){for(var s=0;s<r;s++)(t=e.samples[s]).pts=(t.pts-a)/i,t.dts=(t.dts-o)/i;this.observer.trigger(n.default.FRAG_PARSING_METADATA,{samples:e.samples})}e.samples=[]},e.prototype.remuxText=function(e){e.samples.sort(function(e,t){return e.pts-t.pts});var t,r=e.samples.length,i=e.inputTimeScale,a=this._initPTS;if(r){for(var o=0;o<r;o++)(t=e.samples[o]).pts=(t.pts-a)/i;this.observer.trigger(n.default.FRAG_PARSING_USERDATA,{samples:e.samples})}e.samples=[]},e.prototype._PTSNormalize=function(e,t){var r;if(void 0===t)return e;for(r=t<e?-8589934592:8589934592;Math.abs(e-t)>4294967296;)e+=r;return e},e}();t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e.getSilentFrame=function(e,t){switch(e){case"mp4a.40.2":if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null},e}();t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=Math.pow(2,32)-1,a=function(){function e(){}return e.init=function(){var t;for(t in e.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]},e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var r=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),i=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);e.HDLR_TYPES={video:r,audio:i};var a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),n=new Uint8Array([0,0,0,0,0,0,0,0]);e.STTS=e.STSC=e.STCO=n,e.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),e.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),e.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),e.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var o=new Uint8Array([105,115,111,109]),s=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);e.FTYP=e.box(e.types.ftyp,o,l,o,s),e.DINF=e.box(e.types.dinf,e.box(e.types.dref,a))},e.box=function(e){for(var t,r=Array.prototype.slice.call(arguments,1),i=8,a=r.length,n=a;a--;)i+=r[a].byteLength;for((t=new Uint8Array(i))[0]=i>>24&255,t[1]=i>>16&255,t[2]=i>>8&255,t[3]=255&i,t.set(e,4),a=0,i=8;a<n;a++)t.set(r[a],i),i+=r[a].byteLength;return t},e.hdlr=function(t){return e.box(e.types.hdlr,e.HDLR_TYPES[t])},e.mdat=function(t){return e.box(e.types.mdat,t)},e.mdhd=function(t,r){r*=t;var a=Math.floor(r/(i+1)),n=Math.floor(r%(i+1));return e.box(e.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,a>>24,a>>16&255,a>>8&255,255&a,n>>24,n>>16&255,n>>8&255,255&n,85,196,0,0]))},e.mdia=function(t){return e.box(e.types.mdia,e.mdhd(t.timescale,t.duration),e.hdlr(t.type),e.minf(t))},e.mfhd=function(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))},e.minf=function(t){return"audio"===t.type?e.box(e.types.minf,e.box(e.types.smhd,e.SMHD),e.DINF,e.stbl(t)):e.box(e.types.minf,e.box(e.types.vmhd,e.VMHD),e.DINF,e.stbl(t))},e.moof=function(t,r,i){return e.box(e.types.moof,e.mfhd(t),e.traf(i,r))},e.moov=function(t){for(var r=t.length,i=[];r--;)i[r]=e.trak(t[r]);return e.box.apply(null,[e.types.moov,e.mvhd(t[0].timescale,t[0].duration)].concat(i).concat(e.mvex(t)))},e.mvex=function(t){for(var r=t.length,i=[];r--;)i[r]=e.trex(t[r]);return e.box.apply(null,[e.types.mvex].concat(i))},e.mvhd=function(t,r){r*=t;var a=Math.floor(r/(i+1)),n=Math.floor(r%(i+1)),o=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,a>>24,a>>16&255,a>>8&255,255&a,n>>24,n>>16&255,n>>8&255,255&n,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return e.box(e.types.mvhd,o)},e.sdtp=function(t){var r,i,a=t.samples||[],n=new Uint8Array(4+a.length);for(i=0;i<a.length;i++)r=a[i].flags,n[i+4]=r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy;return e.box(e.types.sdtp,n)},e.stbl=function(t){return e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.STTS),e.box(e.types.stsc,e.STSC),e.box(e.types.stsz,e.STSZ),e.box(e.types.stco,e.STCO))},e.avc1=function(t){var r,i,a,n=[],o=[];for(r=0;r<t.sps.length;r++)a=(i=t.sps[r]).byteLength,n.push(a>>>8&255),n.push(255&a),n=n.concat(Array.prototype.slice.call(i));for(r=0;r<t.pps.length;r++)a=(i=t.pps[r]).byteLength,o.push(a>>>8&255),o.push(255&a),o=o.concat(Array.prototype.slice.call(i));var s=e.box(e.types.avcC,new Uint8Array([1,n[3],n[4],n[5],255,224|t.sps.length].concat(n).concat([t.pps.length]).concat(o))),l=t.width,u=t.height,d=t.pixelRatio[0],f=t.pixelRatio[1];return e.box(e.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,255&l,u>>8&255,255&u,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),s,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),e.box(e.types.pasp,new Uint8Array([d>>24,d>>16&255,d>>8&255,255&d,f>>24,f>>16&255,f>>8&255,255&f])))},e.esds=function(e){var t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))},e.mp4a=function(t){var r=t.samplerate;return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]),e.box(e.types.esds,e.esds(t)))},e.mp3=function(t){var r=t.samplerate;return e.box(e.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]))},e.stsd=function(t){return"audio"===t.type?t.isAAC||"mp3"!==t.codec?e.box(e.types.stsd,e.STSD,e.mp4a(t)):e.box(e.types.stsd,e.STSD,e.mp3(t)):e.box(e.types.stsd,e.STSD,e.avc1(t))},e.tkhd=function(t){var r=t.id,a=t.duration*t.timescale,n=t.width,o=t.height,s=Math.floor(a/(i+1)),l=Math.floor(a%(i+1));return e.box(e.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,l>>24,l>>16&255,l>>8&255,255&l,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,n>>8&255,255&n,0,0,o>>8&255,255&o,0,0]))},e.traf=function(t,r){var a=e.sdtp(t),n=t.id,o=Math.floor(r/(i+1)),s=Math.floor(r%(i+1));return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n])),e.box(e.types.tfdt,new Uint8Array([1,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,s>>24,s>>16&255,s>>8&255,255&s])),e.trun(t,a.length+16+20+8+16+8+8),a)},e.trak=function(t){return t.duration=t.duration||4294967295,e.box(e.types.trak,e.tkhd(t),e.mdia(t))},e.trex=function(t){var r=t.id;return e.box(e.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},e.trun=function(t,r){var i,a,n,o,s,l,u=t.samples||[],d=u.length,f=12+16*d,c=new Uint8Array(f);for(r+=8+f,c.set([0,0,15,1,d>>>24&255,d>>>16&255,d>>>8&255,255&d,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0),i=0;i<d;i++)n=(a=u[i]).duration,o=a.size,s=a.flags,l=a.cts,c.set([n>>>24&255,n>>>16&255,n>>>8&255,255&n,o>>>24&255,o>>>16&255,o>>>8&255,255&o,s.isLeading<<2|s.dependsOn,s.isDependedOn<<6|s.hasRedundancy<<4|s.paddingValue<<1|s.isNonSync,61440&s.degradPrio,15&s.degradPrio,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*i);return e.box(e.types.trun,c)},e.initSegment=function(t){e.types||e.init();var r,i=e.moov(t);return(r=new Uint8Array(e.FTYP.byteLength+i.byteLength)).set(e.FTYP),r.set(i,e.FTYP.byteLength),r},e}();t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),a=function(){function e(e){this.observer=e}return e.prototype.destroy=function(){},e.prototype.resetTimeStamp=function(){},e.prototype.resetInitSegment=function(){},e.prototype.remux=function(e,t,r,a,n,o,s,l){var u=this.observer,d="";e&&(d+="audio"),t&&(d+="video"),u.trigger(i.default.FRAG_PARSING_DATA,{data1:l,startPTS:n,startDTS:n,type:d,hasAudio:!!e,hasVideo:!!t,nb:1,dropped:0}),u.trigger(i.default.FRAG_PARSED)},e}();t.default=a},function(e,t,r){"use strict";var i=Object.prototype.hasOwnProperty,a="~";function n(){}function o(e,t,r,i,n){if("function"!=typeof r)throw new TypeError("The listener must be a function");var o=new function(e,t,r){this.fn=e,this.context=t,this.once=r||!1}(r,i||e,n),s=a?a+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],o]:e._events[s].push(o):(e._events[s]=o,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function l(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(a=!1)),l.prototype.eventNames=function(){var e,t,r=[];if(0===this._eventsCount)return r;for(t in e=this._events)i.call(e,t)&&r.push(a?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},l.prototype.listeners=function(e){var t=a?a+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,n=r.length,o=new Array(n);i<n;i++)o[i]=r[i].fn;return o},l.prototype.listenerCount=function(e){var t=a?a+e:e,r=this._events[t];return r?r.fn?1:r.length:0},l.prototype.emit=function(e,t,r,i,n,o){var s=a?a+e:e;if(!this._events[s])return!1;var l,u,d=this._events[s],f=arguments.length;if(d.fn){switch(d.once&&this.removeListener(e,d.fn,void 0,!0),f){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,t),!0;case 3:return d.fn.call(d.context,t,r),!0;case 4:return d.fn.call(d.context,t,r,i),!0;case 5:return d.fn.call(d.context,t,r,i,n),!0;case 6:return d.fn.call(d.context,t,r,i,n,o),!0}for(u=1,l=new Array(f-1);u<f;u++)l[u-1]=arguments[u];d.fn.apply(d.context,l)}else{var c,h=d.length;for(u=0;u<h;u++)switch(d[u].once&&this.removeListener(e,d[u].fn,void 0,!0),f){case 1:d[u].fn.call(d[u].context);break;case 2:d[u].fn.call(d[u].context,t);break;case 3:d[u].fn.call(d[u].context,t,r);break;case 4:d[u].fn.call(d[u].context,t,r,i);break;default:if(!l)for(c=1,l=new Array(f-1);c<f;c++)l[c-1]=arguments[c];d[u].fn.apply(d[u].context,l)}}return!0},l.prototype.on=function(e,t,r){return o(this,e,t,r,!1)},l.prototype.once=function(e,t,r){return o(this,e,t,r,!0)},l.prototype.removeListener=function(e,t,r,i){var n=a?a+e:e;if(!this._events[n])return this;if(!t)return s(this,n),this;var o=this._events[n];if(o.fn)o.fn!==t||i&&!o.once||r&&o.context!==r||s(this,n);else{for(var l=0,u=[],d=o.length;l<d;l++)(o[l].fn!==t||i&&!o[l].once||r&&o[l].context!==r)&&u.push(o[l]);u.length?this._events[n]=1===u.length?u[0]:u:s(this,n)}return this},l.prototype.removeAllListeners=function(e){var t;return e?(t=a?a+e:e,this._events[t]&&s(this,t)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=a,l.EventEmitter=l,e.exports=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(18),a=r(1),n=r(0),o=r(47);t.default=function(e){var t=new o.EventEmitter;t.trigger=function(e){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];t.emit.apply(t,[e,e].concat(r))},t.off=function(e){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];t.removeListener.apply(t,[e].concat(r))};var r=function(t,r){e.postMessage({event:t,data:r})};e.addEventListener("message",function(a){var o=a.data;switch(o.cmd){case"init":var s=JSON.parse(o.config);e.demuxer=new i.default(t,o.typeSupported,s,o.vendor),n.enableLogs(s.debug),r("init",null);break;case"demux":e.demuxer.push(o.data,o.decryptdata,o.initSegment,o.audioCodec,o.videoCodec,o.timeOffset,o.discontinuity,o.trackSwitch,o.contiguous,o.duration,o.accurateTimeOffset,o.defaultInitPTS)}}),t.on(a.default.FRAG_DECRYPTED,r),t.on(a.default.FRAG_PARSING_INIT_SEGMENT,r),t.on(a.default.FRAG_PARSED,r),t.on(a.default.ERROR,r),t.on(a.default.FRAG_PARSING_METADATA,r),t.on(a.default.FRAG_PARSING_USERDATA,r),t.on(a.default.INIT_PTS_FOUND,r),t.on(a.default.FRAG_PARSING_DATA,function(t,r){var i=[],a={event:t,data:r};r.data1&&(a.data1=r.data1.buffer,i.push(r.data1.buffer),delete r.data1),r.data2&&(a.data2=r.data2.buffer,i.push(r.data2.buffer),delete r.data2),e.postMessage(a,i)})}},function(e,t){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(e){return"function"==typeof e}function a(e){return"object"==typeof e&&null!==e}function n(e){return void 0===e}e.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!function(e){return"number"==typeof e}(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,r,o,s,l,u;if(this._events||(this._events={}),"error"===e&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var d=new Error('Uncaught, unspecified "error" event. ('+t+")");throw d.context=t,d}if(n(r=this._events[e]))return!1;if(i(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),r.apply(this,s)}else if(a(r))for(s=Array.prototype.slice.call(arguments,1),o=(u=r.slice()).length,l=0;l<o;l++)u[l].apply(this,s);return!0},r.prototype.addListener=function(e,t){var o;if(!i(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,i(t.listener)?t.listener:t),this._events[e]?a(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,a(this._events[e])&&!this._events[e].warned&&(o=n(this._maxListeners)?r.defaultMaxListeners:this._maxListeners)&&o>0&&this._events[e].length>o&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){if(!i(t))throw TypeError("listener must be a function");var r=!1;function a(){this.removeListener(e,a),r||(r=!0,t.apply(this,arguments))}return a.listener=t,this.on(e,a),this},r.prototype.removeListener=function(e,t){var r,n,o,s;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(o=(r=this._events[e]).length,n=-1,r===t||i(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(a(r)){for(s=o;s-- >0;)if(r[s]===t||r[s].listener&&r[s].listener===t){n=s;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(i(r=this._events[e]))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){return this._events&&this._events[e]?i(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(i(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={toString:function(e){for(var t="",r=e.length,i=0;i<r;i++)t+="["+e.start(i).toFixed(3)+","+e.end(i).toFixed(3)+"]";return t}}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var i=r(10),a=r(0);function n(e,t){for(var r=null,i=0;i<e.length;i+=1){var a=e[i];if(a&&a.cc===t){r=a;break}}return r}function o(e,t,r){var i=!1;return t&&t.details&&r&&(r.endCC>r.startCC||e&&e.cc<r.startCC)&&(i=!0),i}function s(e,t){var r=e.fragments,i=t.fragments;if(i.length&&r.length){var o=n(r,i[0].cc);if(o&&(!o||o.startPTS))return o;a.logger.log("No frag in previous level to align on")}else a.logger.log("No fragments to align")}function l(e,t){t.fragments.forEach(function(t){if(t){var r=t.start+e;t.start=t.startPTS=r,t.endPTS=r+t.duration}}),t.PTSKnown=!0}function u(e,t,r){if(o(e,r,t)){var i=s(r.details,t);i&&(a.logger.log("Adjusting PTS using last level due to CC increase within current level"),l(i.start,t))}}function d(t,r){if(r&&r.fragments.length){if(!t.hasProgramDateTime||!r.hasProgramDateTime)return;var i=r.fragments[0].programDateTime,n=(t.fragments[0].programDateTime-i)/1e3+r.fragments[0].start;e.isFinite(n)&&(a.logger.log("adjusting PTS using programDateTime delta, sliding:"+n.toFixed(3)),l(n,t))}}t.findFirstFragWithCC=n,t.findFragWithCC=function(e,t){return i.default.search(e,function(e){return e.cc<t?1:e.cc>t?-1:0})},t.shouldAlignOnDiscontinuities=o,t.findDiscontinuousReferenceFrag=s,t.adjustPts=l,t.alignStream=function(e,t,r){u(e,r,t),!r.PTSKnown&&t&&d(r,t.details)},t.alignDiscontinuities=u,t.alignPDT=d}).call(this,r(2).Number)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var i=r(10);function a(e,t,r){void 0===e&&(e=0),void 0===t&&(t=0);var i=Math.min(t,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.start+r.duration-i<=e?1:r.start-i>e&&r.start?-1:0}function n(e,t,r){var i=1e3*Math.min(t,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.endProgramDateTime-i>e}t.findFragmentByPDT=function(t,r,i){if(!Array.isArray(t)||!t.length||!e.isFinite(r))return null;if(r<t[0].programDateTime)return null;if(r>=t[t.length-1].endProgramDateTime)return null;i=i||0;for(var a=0;a<t.length;++a){var o=t[a];if(n(r,i,o))return o}return null},t.findFragmentByPTS=function(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=0);var o=e?t[e.sn-t[0].sn+1]:null;return o&&!a(r,n,o)?o:i.default.search(t,a.bind(null,r,n))},t.fragmentWithinToleranceTest=a,t.pdtWithinToleranceTest=n}).call(this,r(2).Number)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(8),a=r(3),n=r(1),o=r(0),s=function(){function e(e,t,r,i){this.config=e,this.media=t,this.fragmentTracker=r,this.hls=i,this.stallReported=!1}return e.prototype.poll=function(e,t){var r=this.config,a=this.media,n=a.currentTime,s=window.performance.now();if(n!==e)return this.stallReported&&(o.logger.warn("playback not stuck anymore @"+n+", after "+Math.round(s-this.stalled)+"ms"),this.stallReported=!1),this.stalled=null,void(this.nudgeRetry=0);if(!(a.ended||!a.buffered.length||a.readyState>2||a.seeking&&i.BufferHelper.isBuffered(a,n))){var l=s-this.stalled,u=i.BufferHelper.bufferInfo(a,n,r.maxBufferHole);this.stalled?(l>=1e3&&this._reportStall(u.len),this._tryFixBufferStall(u,l)):this.stalled=s}},e.prototype._tryFixBufferStall=function(e,t){var r=this.config,i=this.fragmentTracker,a=this.media.currentTime,n=i.getPartialFragment(a);n&&this._trySkipBufferHole(n),e.len>.5&&t>1e3*r.highBufferWatchdogPeriod&&(this.stalled=null,this._tryNudgeBuffer())},e.prototype._reportStall=function(e){var t=this.hls,r=this.media;this.stallReported||(this.stallReported=!0,o.logger.warn("Playback stalling at @"+r.currentTime+" due to low buffer"),t.trigger(n.default.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:e}))},e.prototype._trySkipBufferHole=function(e){for(var t=this.hls,r=this.media,i=r.currentTime,s=0,l=0;l<r.buffered.length;l++){var u=r.buffered.start(l);if(i>=s&&i<u)return r.currentTime=Math.max(u,r.currentTime+.1),o.logger.warn("skipping hole, adjusting currentTime from "+i+" to "+r.currentTime),this.stalled=null,void t.trigger(n.default.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+i+" to "+r.currentTime,frag:e});s=r.buffered.end(l)}},e.prototype._tryNudgeBuffer=function(){var e=this.config,t=this.hls,r=this.media,i=r.currentTime,s=(this.nudgeRetry||0)+1;if(this.nudgeRetry=s,s<e.nudgeMaxRetry){var l=i+s*e.nudgeOffset;o.logger.log("adjust currentTime from "+i+" to "+l),r.currentTime=l,t.trigger(n.default.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else o.logger.error("still stuck in high buffer @"+i+" after "+e.nudgeMaxRetry+", raise fatal error"),t.trigger(n.default.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},e}();t.default=s},function(e,t,r){"use strict";(function(e){var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0});var a=r(53),n=r(9),o=r(8),s=r(0);t.State={STOPPED:"STOPPED",STARTING:"STARTING",IDLE:"IDLE",PAUSED:"PAUSED",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BUFFER_FLUSHING:"BUFFER_FLUSHING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"};var l=function(r){function a(){return null!==r&&r.apply(this,arguments)||this}return i(a,r),a.prototype.doTick=function(){},a.prototype.startLoad=function(){},a.prototype.stopLoad=function(){var e=this.fragCurrent;e&&(e.loader&&e.loader.abort(),this.fragmentTracker.removeFragment(e)),this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=t.State.STOPPED},a.prototype._streamEnded=function(e,t){var r=this.fragCurrent,i=this.fragmentTracker;if(!t.live&&r&&!r.backtracked&&r.sn===t.endSN&&!e.nextStart){var a=i.getState(r);return a===n.FragmentState.PARTIAL||a===n.FragmentState.OK}return!1},a.prototype.onMediaSeeking=function(){var r=this.config,i=this.media,a=this.mediaBuffer,n=this.state,l=i?i.currentTime:null,u=o.BufferHelper.bufferInfo(a||i,l,this.config.maxBufferHole);if(e.isFinite(l)&&s.logger.log("media seeking to "+l.toFixed(3)),n===t.State.FRAG_LOADING){var d=this.fragCurrent;if(0===u.len&&d){var f=r.maxFragLookUpTolerance,c=d.start-f,h=d.start+d.duration+f;l<c||l>h?(d.loader&&(s.logger.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),d.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.state=t.State.IDLE):s.logger.log("seeking outside of buffer but within currently loaded fragment range")}}else n===t.State.ENDED&&(0===u.len&&(this.fragPrevious=null,this.fragCurrent=null),this.state=t.State.IDLE);i&&(this.lastCurrentTime=l),this.loadedmetadata||(this.nextLoadPosition=this.startPosition=l),this.tick()},a.prototype.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},a.prototype.onHandlerDestroying=function(){this.stopLoad(),r.prototype.onHandlerDestroying.call(this)},a.prototype.onHandlerDestroyed=function(){this.state=t.State.STOPPED,this.fragmentTracker=null},a}(a.default);t.default=l}).call(this,r(2).Number)},function(e,t,r){"use strict";var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(t){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var a=e.apply(this,[t].concat(r))||this;return a._tickInterval=null,a._tickTimer=null,a._tickCallCount=0,a._boundTick=a.tick.bind(a),a}return i(t,e),t.prototype.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},t.prototype.hasInterval=function(){return!!this._tickInterval},t.prototype.hasNextTick=function(){return!!this._tickTimer},t.prototype.setInterval=function(e){return!this._tickInterval&&(this._tickInterval=setInterval(this._boundTick,e),!0)},t.prototype.clearInterval=function(){return!!this._tickInterval&&(clearInterval(this._tickInterval),this._tickInterval=null,!0)},t.prototype.clearNextTick=function(){return!!this._tickTimer&&(clearTimeout(this._tickTimer),this._tickTimer=null,!0)},t.prototype.tick=function(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&(this.clearNextTick(),this._tickTimer=setTimeout(this._boundTick,0)),this._tickCallCount=0)},t.prototype.doTick=function(){},t}(r(4).default);t.default=a},function(e,t,r){"use strict";var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0});var a,n=r(1),o=r(4),s=r(0),l=r(3),u=r(17),d=r(23),f=(window.performance,function(e){function t(t){var r=e.call(this,t,n.default.MANIFEST_LOADED,n.default.LEVEL_LOADED,n.default.AUDIO_TRACK_SWITCHED,n.default.FRAG_LOADED,n.default.ERROR)||this;return r.canload=!1,r.currentLevelIndex=null,r.manualLevelIndex=-1,r.timer=null,a=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),r}return i(t,e),t.prototype.onHandlerDestroying=function(){this.clearTimer(),this.manualLevelIndex=-1},t.prototype.clearTimer=function(){null!==this.timer&&(clearTimeout(this.timer),this.timer=null)},t.prototype.startLoad=function(){var e=this._levels;this.canload=!0,this.levelRetryCount=0,e&&e.forEach(function(e){e.loadError=0;var t=e.details;t&&t.live&&(e.details=void 0)}),null!==this.timer&&this.loadLevel()},t.prototype.stopLoad=function(){this.canload=!1},t.prototype.onManifestLoaded=function(e){var t,r=[],i=[],o={},f=null,c=!1,h=!1;if(e.levels.forEach(function(e){var t=e.attrs;e.loadError=0,e.fragmentError=!1,c=c||!!e.videoCodec,h=h||!!e.audioCodec,a&&e.audioCodec&&-1!==e.audioCodec.indexOf("mp4a.40.34")&&(e.audioCodec=void 0),(f=o[e.bitrate])?f.url.push(e.url):(e.url=[e.url],e.urlId=0,o[e.bitrate]=e,r.push(e)),t&&(t.AUDIO&&(h=!0,d.addGroupId(f||e,"audio",t.AUDIO)),t.SUBTITLES&&d.addGroupId(f||e,"text",t.SUBTITLES))}),c&&h&&(r=r.filter(function(e){return!!e.videoCodec})),r=r.filter(function(e){var t=e.audioCodec,r=e.videoCodec;return(!t||u.isCodecSupportedInMp4(t,"audio"))&&(!r||u.isCodecSupportedInMp4(r,"video"))}),e.audioTracks&&(i=e.audioTracks.filter(function(e){return!e.audioCodec||u.isCodecSupportedInMp4(e.audioCodec,"audio")})).forEach(function(e,t){e.id=t}),r.length>0){t=r[0].bitrate,r.sort(function(e,t){return e.bitrate-t.bitrate}),this._levels=r;for(var p=0;p<r.length;p++)if(r[p].bitrate===t){this._firstLevel=p,s.logger.log("manifest loaded,"+r.length+" level(s) found, first bitrate:"+t);break}this.hls.trigger(n.default.MANIFEST_PARSED,{levels:r,audioTracks:i,firstLevel:this._firstLevel,stats:e.stats,audio:h,video:c,altAudio:i.some(function(e){return!!e.url})})}else this.hls.trigger(n.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:this.hls.url,reason:"no level with compatible codecs found in manifest"})},Object.defineProperty(t.prototype,"levels",{get:function(){return this._levels},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){return this.currentLevelIndex},set:function(e){var t=this._levels;t&&(e=Math.min(e,t.length-1),this.currentLevelIndex===e&&t[e].details||this.setLevelInternal(e))},enumerable:!0,configurable:!0}),t.prototype.setLevelInternal=function(e){var t=this._levels,r=this.hls;if(e>=0&&e<t.length){if(this.clearTimer(),this.currentLevelIndex!==e){s.logger.log("switching to level "+e),this.currentLevelIndex=e;var i=t[e];i.level=e,r.trigger(n.default.LEVEL_SWITCHING,i)}var a=t[e],o=a.details;if(!o||o.live){var u=a.urlId;r.trigger(n.default.LEVEL_LOADING,{url:a.url[u],level:e,id:u})}}else r.trigger(n.default.ERROR,{type:l.ErrorTypes.OTHER_ERROR,details:l.ErrorDetails.LEVEL_SWITCH_ERROR,level:e,fatal:!1,reason:"invalid level idx"})},Object.defineProperty(t.prototype,"manualLevel",{get:function(){return this.manualLevelIndex},set:function(e){this.manualLevelIndex=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstLevel",{get:function(){return this._firstLevel},set:function(e){this._firstLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"startLevel",{get:function(){if(void 0===this._startLevel){var e=this.hls.config.startLevel;return void 0!==e?e:this._firstLevel}return this._startLevel},set:function(e){this._startLevel=e},enumerable:!0,configurable:!0}),t.prototype.onError=function(e){if(e.fatal)e.type===l.ErrorTypes.NETWORK_ERROR&&this.clearTimer();else{var t,r=!1,i=!1;switch(e.details){case l.ErrorDetails.FRAG_LOAD_ERROR:case l.ErrorDetails.FRAG_LOAD_TIMEOUT:case l.ErrorDetails.KEY_LOAD_ERROR:case l.ErrorDetails.KEY_LOAD_TIMEOUT:t=e.frag.level,i=!0;break;case l.ErrorDetails.LEVEL_LOAD_ERROR:case l.ErrorDetails.LEVEL_LOAD_TIMEOUT:t=e.context.level,r=!0;break;case l.ErrorDetails.REMUX_ALLOC_ERROR:t=e.level,r=!0}void 0!==t&&this.recoverLevel(e,t,r,i)}},t.prototype.recoverLevel=function(e,t,r,i){var a,n,o,l=this,u=this.hls.config,d=e.details,f=this._levels[t];if(f.loadError++,f.fragmentError=i,r){if(!(this.levelRetryCount+1<=u.levelLoadingMaxRetry))return s.logger.error("level controller, cannot recover from "+d+" error"),this.currentLevelIndex=null,this.clearTimer(),void(e.fatal=!0);n=Math.min(Math.pow(2,this.levelRetryCount)*u.levelLoadingRetryDelay,u.levelLoadingMaxRetryTimeout),this.timer=setTimeout(function(){return l.loadLevel()},n),e.levelRetry=!0,this.levelRetryCount++,s.logger.warn("level controller, "+d+", retry in "+n+" ms, current retry count is "+this.levelRetryCount)}(r||i)&&((a=f.url.length)>1&&f.loadError<a?(f.urlId=(f.urlId+1)%a,f.details=void 0,s.logger.warn("level controller, "+d+" for level "+t+": switching to redundant URL-id "+f.urlId)):-1===this.manualLevelIndex?(o=0===t?this._levels.length-1:t-1,s.logger.warn("level controller, "+d+": switch to "+o),this.hls.nextAutoLevel=this.currentLevelIndex=o):i&&(s.logger.warn("level controller, "+d+": reload a fragment"),this.currentLevelIndex=null))},t.prototype.onFragLoaded=function(e){var t=e.frag;if(void 0!==t&&"main"===t.type){var r=this._levels[t.level];void 0!==r&&(r.fragmentError=!1,r.loadError=0,this.levelRetryCount=0)}},t.prototype.onLevelLoaded=function(e){var t=this,r=e.level,i=e.details;if(r===this.currentLevelIndex){var a=this._levels[r];if(a.fragmentError||(a.loadError=0,this.levelRetryCount=0),i.live){var n=d.computeReloadInterval(a.details,i,e.stats.trequest);s.logger.log("live playlist, reload in "+Math.round(n)+" ms"),this.timer=setTimeout(function(){return t.loadLevel()},n)}else this.clearTimer()}},t.prototype.onAudioTrackSwitched=function(e){var t=this.hls.audioTracks[e.id].groupId,r=this.hls.levels[this.currentLevelIndex];if(r&&r.audioGroupIds){for(var i=-1,a=0;a<r.audioGroupIds.length;a++)if(r.audioGroupIds[a]===t){i=a;break}i!==r.urlId&&(r.urlId=i,this.startLoad())}},t.prototype.loadLevel=function(){if(s.logger.debug("call to loadLevel"),null!==this.currentLevelIndex&&this.canload){var e=this._levels[this.currentLevelIndex];if("object"==typeof e&&e.url.length>0){var t=this.currentLevelIndex,r=e.urlId,i=e.url[r];s.logger.log("Attempt loading level index "+t+" with URL-id "+r),this.hls.trigger(n.default.LEVEL_LOADING,{url:i,level:t,id:r})}}},Object.defineProperty(t.prototype,"nextLoadLevel",{get:function(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(e){this.level=e,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=e)},enumerable:!0,configurable:!0}),t}(o.default));t.default=f},function(e,t,r){"use strict";var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0});var a=r(1),n=r(4),o=r(11),s=r(56),l=function(e){function t(t){var r=e.call(this,t,a.default.MEDIA_ATTACHED,a.default.MEDIA_DETACHING,a.default.FRAG_PARSING_METADATA)||this;return r.id3Track=void 0,r.media=void 0,r}return i(t,e),t.prototype.destroy=function(){n.default.prototype.destroy.call(this)},t.prototype.onMediaAttached=function(e){this.media=e.media,this.media},t.prototype.onMediaDetaching=function(){s.clearCurrentCues(this.id3Track),this.id3Track=void 0,this.media=void 0},t.prototype.getID3Track=function(e){for(var t=0;t<e.length;t++){var r=e[t];if("metadata"===r.kind&&"id3"===r.label)return s.sendAddTrackEvent(r,this.media),r}return this.media.addTextTrack("metadata","id3")},t.prototype.onFragParsingMetadata=function(e){var t=e.frag,r=e.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var i=window.WebKitDataCue||window.VTTCue||window.TextTrackCue,a=0;a<r.length;a++){var n=o.default.getID3Frames(r[a].data);if(n){var s=r[a].pts,l=a<r.length-1?r[a+1].pts:t.endPTS;s===l&&(l+=1e-4);for(var u=0;u<n.length;u++){var d=n[u];if(!o.default.isTimeStampFrame(d)){var f=new i(s,l,"");f.value=d,this.id3Track.addCue(f)}}}}},t}(n.default);t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendAddTrackEvent=function(e,t){var r=null;try{r=new window.Event("addtrack")}catch(e){(r=document.createEvent("Event")).initEvent("addtrack",!1,!1)}r.track=e,t.dispatchEvent(r)},t.clearCurrentCues=function(e){if(e&&e.cues)for(;e.cues.length>0;)e.removeCue(e.cues[0])}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(12);t.isSupported=function(){var e=i.getMediaSource(),t=window.SourceBuffer||window.WebKitSourceBuffer,r=e&&"function"==typeof e.isTypeSupported&&e.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),a=!t||t.prototype&&"function"==typeof t.prototype.appendBuffer&&"function"==typeof t.prototype.remove;return!!r&&!!a}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(59),a=r(62),n=r(63),o=r(64),s=r(65),l=(r(5),r(5),r(5),r(5),r(5),r(5),r(5),r(66));t.hlsDefaultConfig={autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,maxBufferSize:6e7,maxBufferHole:.5,lowBufferWatchdogPeriod:.5,highBufferWatchdogPeriod:3,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,liveDurationInfinity:!1,liveBackBufferLength:1/0,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:s.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,abrController:i.default,bufferController:a.default,capLevelController:n.default,fpsController:o.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,requestMediaKeySystemAccessFunc:l.requestMediaKeySystemAccess}},function(e,t,r){"use strict";(function(e){var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0});var a=r(1),n=r(4),o=r(8),s=r(3),l=r(0),u=r(60),d=window.performance,f=function(t){function r(e){var r=t.call(this,e,a.default.FRAG_LOADING,a.default.FRAG_LOADED,a.default.FRAG_BUFFERED,a.default.ERROR)||this;return r.lastLoadedFragLevel=0,r._nextAutoLevel=-1,r.hls=e,r.timer=null,r._bwEstimator=null,r.onCheck=r._abandonRulesCheck.bind(r),r}return i(r,t),r.prototype.destroy=function(){this.clearTimer(),n.default.prototype.destroy.call(this)},r.prototype.onFragLoading=function(e){var t=e.frag;if("main"===t.type&&(this.timer||(this.fragCurrent=t,this.timer=setInterval(this.onCheck,100)),!this._bwEstimator)){var r=this.hls,i=r.config,a=t.level,n=void 0,o=void 0;r.levels[a].details.live?(n=i.abrEwmaFastLive,o=i.abrEwmaSlowLive):(n=i.abrEwmaFastVoD,o=i.abrEwmaSlowVoD),this._bwEstimator=new u.default(r,o,n,i.abrEwmaDefaultEstimate)}},r.prototype._abandonRulesCheck=function(){var e=this.hls,t=e.media,r=this.fragCurrent;if(r){var i=r.loader,n=e.minAutoLevel;if(!i||i.stats&&i.stats.aborted)return l.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),void(this._nextAutoLevel=-1);var s=i.stats;if(t&&s&&(!t.paused&&0!==t.playbackRate||!t.readyState)&&r.autoLevel&&r.level){var u=d.now()-s.trequest,f=Math.abs(t.playbackRate);if(u>500*r.duration/f){var c=e.levels,h=Math.max(1,s.bw?s.bw/8:1e3*s.loaded/u),p=c[r.level],g=p.realBitrate?Math.max(p.realBitrate,p.bitrate):p.bitrate,v=s.total?s.total:Math.max(s.loaded,Math.round(r.duration*g/8)),m=t.currentTime,y=(v-s.loaded)/h,_=(o.BufferHelper.bufferInfo(t,m,e.config.maxBufferHole).end-m)/f;if(_<2*r.duration/f&&y>_){var E=void 0,b=void 0;for(b=r.level-1;b>n;b--){var S=c[b].realBitrate?Math.max(c[b].realBitrate,c[b].bitrate):c[b].bitrate;if((E=r.duration*S/(6.4*h))<_)break}E<y&&(l.logger.warn("loading too slow, abort fragment loading and switch to level "+b+":fragLoadedDelay["+b+"]<fragLoadedDelay["+(r.level-1)+"];bufferStarvationDelay:"+E.toFixed(1)+"<"+y.toFixed(1)+":"+_.toFixed(1)),e.nextLoadLevel=b,this._bwEstimator.sample(u,s.loaded),i.abort(),this.clearTimer(),e.trigger(a.default.FRAG_LOAD_EMERGENCY_ABORTED,{frag:r,stats:s}))}}}}},r.prototype.onFragLoaded=function(t){var r=t.frag;if("main"===r.type&&e.isFinite(r.sn)){if(this.clearTimer(),this.lastLoadedFragLevel=r.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var i=this.hls.levels[r.level],a=(i.loaded?i.loaded.bytes:0)+t.stats.loaded,n=(i.loaded?i.loaded.duration:0)+t.frag.duration;i.loaded={bytes:a,duration:n},i.realBitrate=Math.round(8*a/n)}if(t.frag.bitrateTest){var o=t.stats;o.tparsed=o.tbuffered=o.tload,this.onFragBuffered(t)}}},r.prototype.onFragBuffered=function(t){var r=t.stats,i=t.frag;if(!0!==r.aborted&&"main"===i.type&&e.isFinite(i.sn)&&(!i.bitrateTest||r.tload===r.tbuffered)){var a=r.tparsed-r.trequest;l.logger.log("latency/loading/parsing/append/kbps:"+Math.round(r.tfirst-r.trequest)+"/"+Math.round(r.tload-r.tfirst)+"/"+Math.round(r.tparsed-r.tload)+"/"+Math.round(r.tbuffered-r.tparsed)+"/"+Math.round(8*r.loaded/(r.tbuffered-r.trequest))),this._bwEstimator.sample(a,r.loaded),r.bwEstimate=this._bwEstimator.getEstimate(),i.bitrateTest?this.bitrateTestDelay=a/1e3:this.bitrateTestDelay=0}},r.prototype.onError=function(e){switch(e.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer()}},r.prototype.clearTimer=function(){clearInterval(this.timer),this.timer=null},Object.defineProperty(r.prototype,"nextAutoLevel",{get:function(){var e=this._nextAutoLevel,t=this._bwEstimator;if(!(-1===e||t&&t.canEstimate()))return e;var r=this._nextABRAutoLevel;return-1!==e&&(r=Math.min(e,r)),r},set:function(e){this._nextAutoLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"_nextABRAutoLevel",{get:function(){var e=this.hls,t=e.maxAutoLevel,r=e.levels,i=e.config,a=e.minAutoLevel,n=e.media,s=this.lastLoadedFragLevel,u=this.fragCurrent?this.fragCurrent.duration:0,d=n?n.currentTime:0,f=n&&0!==n.playbackRate?Math.abs(n.playbackRate):1,c=this._bwEstimator?this._bwEstimator.getEstimate():i.abrEwmaDefaultEstimate,h=(o.BufferHelper.bufferInfo(n,d,i.maxBufferHole).end-d)/f,p=this._findBestLevel(s,u,c,a,t,h,i.abrBandWidthFactor,i.abrBandWidthUpFactor,r);if(p>=0)return p;l.logger.trace("rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering");var g=u?Math.min(u,i.maxStarvationDelay):i.maxStarvationDelay,v=i.abrBandWidthFactor,m=i.abrBandWidthUpFactor;if(0===h){var y=this.bitrateTestDelay;if(y)g=(u?Math.min(u,i.maxLoadingDelay):i.maxLoadingDelay)-y,l.logger.trace("bitrate test took "+Math.round(1e3*y)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*g)+" ms"),v=m=1}return p=this._findBestLevel(s,u,c,a,t,h+g,v,m,r),Math.max(p,0)},enumerable:!0,configurable:!0}),r.prototype._findBestLevel=function(e,t,r,i,a,n,o,s,u){for(var d=a;d>=i;d--){var f=u[d];if(f){var c=f.details,h=c?c.totalduration/c.fragments.length:t,p=!!c&&c.live,g=void 0;g=d<=e?o*r:s*r;var v=u[d].realBitrate?Math.max(u[d].realBitrate,u[d].bitrate):u[d].bitrate,m=v*h/g;if(l.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+d+"/"+Math.round(g)+"/"+v+"/"+h+"/"+n+"/"+m),g>v&&(!m||p&&!this.bitrateTestDelay||m<n))return d}}return-1},r}(n.default);t.default=f}).call(this,r(2).Number)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(61),a=function(){function e(e,t,r,a){this.hls=e,this.defaultEstimate_=a,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new i.default(t),this.fast_=new i.default(r)}return e.prototype.sample=function(e,t){var r=8e3*t/(e=Math.max(e,this.minDelayMs_)),i=e/1e3;this.fast_.sample(i,r),this.slow_.sample(i,r)},e.prototype.canEstimate=function(){var e=this.fast_;return e&&e.getTotalWeight()>=this.minWeight_},e.prototype.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},e.prototype.destroy=function(){},e}();t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e){this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=0,this.totalWeight_=0}return e.prototype.sample=function(e,t){var r=Math.pow(this.alpha_,e);this.estimate_=t*(1-r)+r*this.estimate_,this.totalWeight_+=e},e.prototype.getTotalWeight=function(){return this.totalWeight_},e.prototype.getEstimate=function(){if(this.alpha_){var e=1-Math.pow(this.alpha_,this.totalWeight_);return this.estimate_/e}return this.estimate_},e}();t.default=i},function(e,t,r){"use strict";(function(e){var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0});var a=r(1),n=r(4),o=r(0),s=r(3),l=r(12).getMediaSource(),u=function(t){function r(e){var r=t.call(this,e,a.default.MEDIA_ATTACHING,a.default.MEDIA_DETACHING,a.default.MANIFEST_PARSED,a.default.BUFFER_RESET,a.default.BUFFER_APPENDING,a.default.BUFFER_CODECS,a.default.BUFFER_EOS,a.default.BUFFER_FLUSHING,a.default.LEVEL_PTS_UPDATED,a.default.LEVEL_UPDATED)||this;return r._msDuration=null,r._levelDuration=null,r._levelTargetDuration=10,r._live=null,r._objectUrl=null,r.bufferCodecEventsExpected=0,r.onsbue=r.onSBUpdateEnd.bind(r),r.onsbe=r.onSBUpdateError.bind(r),r.pendingTracks={},r.tracks={},r}return i(r,t),r.prototype.destroy=function(){n.default.prototype.destroy.call(this)},r.prototype.onLevelPtsUpdated=function(e){var t=e.type,r=this.tracks.audio;if("audio"===t&&r&&"audio/mpeg"===r.container){var i=this.sourceBuffer.audio;if(Math.abs(i.timestampOffset-e.start)>.1){var a=i.updating;try{i.abort()}catch(e){o.logger.warn("can not abort audio buffer: "+e)}a?this.audioTimestampOffset=e.start:(o.logger.warn("change mpeg audio timestamp offset from "+i.timestampOffset+" to "+e.start),i.timestampOffset=e.start)}}},r.prototype.onManifestParsed=function(e){this.bufferCodecEventsExpected=e.altAudio?2:1,o.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},r.prototype.onMediaAttaching=function(e){var t=this.media=e.media;if(t){var r=this.mediaSource=new l;this.onmso=this.onMediaSourceOpen.bind(this),this.onmse=this.onMediaSourceEnded.bind(this),this.onmsc=this.onMediaSourceClose.bind(this),r.addEventListener("sourceopen",this.onmso),r.addEventListener("sourceended",this.onmse),r.addEventListener("sourceclose",this.onmsc),t.src=window.URL.createObjectURL(r),this._objectUrl=t.src}},r.prototype.onMediaDetaching=function(){o.logger.log("media source detaching");var e=this.mediaSource;if(e){if("open"===e.readyState)try{e.endOfStream()}catch(e){o.logger.warn("onMediaDetaching:"+e.message+" while calling endOfStream")}e.removeEventListener("sourceopen",this.onmso),e.removeEventListener("sourceended",this.onmse),e.removeEventListener("sourceclose",this.onmsc),this.media&&(window.URL.revokeObjectURL(this._objectUrl),this.media.src===this._objectUrl?(this.media.removeAttribute("src"),this.media.load()):o.logger.warn("media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.pendingTracks={},this.tracks={},this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}this.onmso=this.onmse=this.onmsc=null,this.hls.trigger(a.default.MEDIA_DETACHED)},r.prototype.onMediaSourceOpen=function(){o.logger.log("media source opened"),this.hls.trigger(a.default.MEDIA_ATTACHED,{media:this.media});var e=this.mediaSource;e&&e.removeEventListener("sourceopen",this.onmso),this.checkPendingTracks()},r.prototype.checkPendingTracks=function(){var e=this.bufferCodecEventsExpected,t=this.pendingTracks,r=Object.keys(t).length;(r&&!e||2===r)&&(this.createSourceBuffers(t),this.pendingTracks={},this.doAppending())},r.prototype.onMediaSourceClose=function(){o.logger.log("media source closed")},r.prototype.onMediaSourceEnded=function(){o.logger.log("media source ended")},r.prototype.onSBUpdateEnd=function(){if(this.audioTimestampOffset){var e=this.sourceBuffer.audio;o.logger.warn("change mpeg audio timestamp offset from "+e.timestampOffset+" to "+this.audioTimestampOffset),e.timestampOffset=this.audioTimestampOffset,delete this.audioTimestampOffset}this._needsFlush&&this.doFlush(),this._needsEos&&this.checkEos(),this.appending=!1;var t=this.parent,r=this.segments.reduce(function(e,r){return r.parent===t?e+1:e},0),i={},n=this.sourceBuffer;for(var s in n)i[s]=n[s].buffered;this.hls.trigger(a.default.BUFFER_APPENDED,{parent:t,pending:r,timeRanges:i}),this._needsFlush||this.doAppending(),this.updateMediaElementDuration(),0===r&&this.flushLiveBackBuffer()},r.prototype.onSBUpdateError=function(e){o.logger.error("sourceBuffer error:",e),this.hls.trigger(a.default.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})},r.prototype.onBufferReset=function(){var e=this.sourceBuffer;for(var t in e){var r=e[t];try{this.mediaSource.removeSourceBuffer(r),r.removeEventListener("updateend",this.onsbue),r.removeEventListener("error",this.onsbe)}catch(e){}}this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0},r.prototype.onBufferCodecs=function(e){var t=this;if(!Object.keys(this.sourceBuffer).length){Object.keys(e).forEach(function(r){t.pendingTracks[r]=e[r]});var r=this.mediaSource;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),r&&"open"===r.readyState&&this.checkPendingTracks()}},r.prototype.createSourceBuffers=function(e){var t=this.sourceBuffer,r=this.mediaSource;for(var i in e)if(!t[i]){var n=e[i],l=n.levelCodec||n.codec,u=n.container+";codecs="+l;o.logger.log("creating sourceBuffer("+u+")");try{var d=t[i]=r.addSourceBuffer(u);d.addEventListener("updateend",this.onsbue),d.addEventListener("error",this.onsbe),this.tracks[i]={codec:l,container:n.container},n.buffer=d}catch(e){o.logger.error("error while trying to add sourceBuffer:"+e.message),this.hls.trigger(a.default.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:e,mimeType:u})}}this.hls.trigger(a.default.BUFFER_CREATED,{tracks:e})},r.prototype.onBufferAppending=function(e){this._needsFlush||(this.segments?this.segments.push(e):this.segments=[e],this.doAppending())},r.prototype.onBufferAppendFail=function(e){o.logger.error("sourceBuffer error:",e.event),this.hls.trigger(a.default.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})},r.prototype.onBufferEos=function(e){var t=this.sourceBuffer,r=e.type;for(var i in t)r&&i!==r||t[i].ended||(t[i].ended=!0,o.logger.log(i+" sourceBuffer now EOS"));this.checkEos()},r.prototype.checkEos=function(){var e=this.sourceBuffer,t=this.mediaSource;if(t&&"open"===t.readyState){for(var r in e){var i=e[r];if(!i.ended)return;if(i.updating)return void(this._needsEos=!0)}o.logger.log("all media data are available, signal endOfStream() to MediaSource and stop loading fragment");try{t.endOfStream()}catch(e){o.logger.warn("exception while calling mediaSource.endOfStream()")}this._needsEos=!1}else this._needsEos=!1},r.prototype.onBufferFlushing=function(e){this.flushRange.push({start:e.startOffset,end:e.endOffset,type:e.type}),this.flushBufferCounter=0,this.doFlush()},r.prototype.flushLiveBackBuffer=function(){if(this._live){var e=this.hls.config.liveBackBufferLength;if(isFinite(e)&&!(e<0))for(var t=this.media.currentTime,r=this.sourceBuffer,i=Object.keys(r),a=t-Math.max(e,this._levelTargetDuration),n=i.length-1;n>=0;n--){var o=i[n],s=r[o].buffered;s.length>0&&a>s.start(0)&&this.removeBufferRange(o,r[o],0,a)}}},r.prototype.onLevelUpdated=function(e){var t=e.details;t.fragments.length>0&&(this._levelDuration=t.totalduration+t.fragments[0].start,this._levelTargetDuration=t.averagetargetduration||t.targetduration||10,this._live=t.live,this.updateMediaElementDuration())},r.prototype.updateMediaElementDuration=function(){var t,r=this.hls.config;if(null!==this._levelDuration&&this.media&&this.mediaSource&&this.sourceBuffer&&0!==this.media.readyState&&"open"===this.mediaSource.readyState){for(var i in this.sourceBuffer)if(!0===this.sourceBuffer[i].updating)return;t=this.media.duration,null===this._msDuration&&(this._msDuration=this.mediaSource.duration),!0===this._live&&!0===r.liveDurationInfinity?(o.logger.log("Media Source duration is set to Infinity"),this._msDuration=this.mediaSource.duration=1/0):(this._levelDuration>this._msDuration&&this._levelDuration>t||!e.isFinite(t))&&(o.logger.log("Updating Media Source duration to "+this._levelDuration.toFixed(3)),this._msDuration=this.mediaSource.duration=this._levelDuration)}},r.prototype.doFlush=function(){for(;this.flushRange.length;){var e=this.flushRange[0];if(!this.flushBuffer(e.start,e.end,e.type))return void(this._needsFlush=!0);this.flushRange.shift(),this.flushBufferCounter=0}if(0===this.flushRange.length){this._needsFlush=!1;var t=0,r=this.sourceBuffer;try{for(var i in r)t+=r[i].buffered.length}catch(e){o.logger.error("error while accessing sourceBuffer.buffered")}this.appended=t,this.hls.trigger(a.default.BUFFER_FLUSHED)}},r.prototype.doAppending=function(){var e=this.hls,t=this.segments,r=this.sourceBuffer;if(Object.keys(r).length){if(this.media.error)return this.segments=[],void o.logger.error("trying to append although a media error occured, flush segment and abort");if(this.appending)return;if(t&&t.length){var i=t.shift();try{var n=r[i.type];n?n.updating?t.unshift(i):(n.ended=!1,this.parent=i.parent,n.appendBuffer(i.data),this.appendError=0,this.appended++,this.appending=!0):this.onSBUpdateEnd()}catch(r){o.logger.error("error while trying to append buffer:"+r.message),t.unshift(i);var l={type:s.ErrorTypes.MEDIA_ERROR,parent:i.parent};22!==r.code?(this.appendError?this.appendError++:this.appendError=1,l.details=s.ErrorDetails.BUFFER_APPEND_ERROR,this.appendError>e.config.appendErrorMaxRetry?(o.logger.log("fail "+e.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),this.segments=[],l.fatal=!0,e.trigger(a.default.ERROR,l)):(l.fatal=!1,e.trigger(a.default.ERROR,l))):(this.segments=[],l.details=s.ErrorDetails.BUFFER_FULL_ERROR,l.fatal=!1,e.trigger(a.default.ERROR,l))}}}},r.prototype.flushBuffer=function(e,t,r){var i,a=this.sourceBuffer;if(Object.keys(a).length){if(o.logger.log("flushBuffer,pos/start/end: "+this.media.currentTime.toFixed(3)+"/"+e+"/"+t),this.flushBufferCounter<this.appended){for(var n in a)if(!r||n===r){if((i=a[n]).ended=!1,i.updating)return o.logger.warn("cannot flush, sb updating in progress"),!1;if(this.removeBufferRange(n,i,e,t))return this.flushBufferCounter++,!1}}else o.logger.warn("abort flushing too many retries");o.logger.log("buffer flushed")}return!0},r.prototype.removeBufferRange=function(e,t,r,i){try{for(var a=0;a<t.buffered.length;a++){var n=t.buffered.start(a),s=t.buffered.end(a),l=Math.max(n,r),u=Math.min(s,i);if(Math.min(u,s)-l>.5)return o.logger.log("sb remove "+e+" ["+l+","+u+"], of ["+n+","+s+"], pos:"+this.media.currentTime),t.remove(l,u),!0}}catch(e){o.logger.warn("removeBufferRange failed",e)}return!1},r}(n.default);t.default=u}).call(this,r(2).Number)},function(e,t,r){"use strict";(function(e){var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0});var a=r(1),n=function(t){function r(r){var i=t.call(this,r,a.default.FPS_DROP_LEVEL_CAPPING,a.default.MEDIA_ATTACHING,a.default.MANIFEST_PARSED,a.default.BUFFER_CODECS,a.default.MEDIA_DETACHING)||this;return i.autoLevelCapping=e.POSITIVE_INFINITY,i.firstLevel=null,i.levels=[],i.media=null,i.restrictedLevels=[],i.timer=null,i}return i(r,t),r.prototype.destroy=function(){this.hls.config.capLevelToPlayerSize&&(this.media=null,this._stopCapping())},r.prototype.onFpsDropLevelCapping=function(e){r.isLevelAllowed(e.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(e.droppedLevel)},r.prototype.onMediaAttaching=function(e){this.media=e.media instanceof window.HTMLVideoElement?e.media:null},r.prototype.onManifestParsed=function(e){var t=this.hls;this.restrictedLevels=[],this.levels=e.levels,this.firstLevel=e.firstLevel,t.config.capLevelToPlayerSize&&e.video&&this._startCapping()},r.prototype.onBufferCodecs=function(e){this.hls.config.capLevelToPlayerSize&&e.video&&this._startCapping()},r.prototype.onLevelsUpdated=function(e){this.levels=e.levels},r.prototype.onMediaDetaching=function(){this._stopCapping()},r.prototype.detectPlayerSize=function(){if(this.media){var e=this.levels?this.levels.length:0;if(e){var t=this.hls;t.autoLevelCapping=this.getMaxLevel(e-1),t.autoLevelCapping>this.autoLevelCapping&&t.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}},r.prototype.getMaxLevel=function(e){var t=this;if(!this.levels)return-1;var i=this.levels.filter(function(i,a){return r.isLevelAllowed(a,t.restrictedLevels)&&a<=e});return r.getMaxLevelByMediaSize(i,this.mediaWidth,this.mediaHeight)},r.prototype._startCapping=function(){this.timer||(this.autoLevelCapping=e.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),clearInterval(this.timer),this.timer=setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},r.prototype._stopCapping=function(){this.restrictedLevels=[],this.firstLevel=null,this.autoLevelCapping=e.POSITIVE_INFINITY,this.timer&&(this.timer=clearInterval(this.timer),this.timer=null)},Object.defineProperty(r.prototype,"mediaWidth",{get:function(){var e,t=this.media;return t&&(e=t.width||t.clientWidth||t.offsetWidth,e*=r.contentScaleFactor),e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"mediaHeight",{get:function(){var e,t=this.media;return t&&(e=t.height||t.clientHeight||t.offsetHeight,e*=r.contentScaleFactor),e},enumerable:!0,configurable:!0}),Object.defineProperty(r,"contentScaleFactor",{get:function(){var e=1;try{e=window.devicePixelRatio}catch(e){}return e},enumerable:!0,configurable:!0}),r.isLevelAllowed=function(e,t){return void 0===t&&(t=[]),-1===t.indexOf(e)},r.getMaxLevelByMediaSize=function(e,t,r){if(!e||e&&!e.length)return-1;for(var i=function(e,t){return!t||(e.width!==t.width||e.height!==t.height)},a=e.length-1,n=0;n<e.length;n+=1){var o=e[n];if((o.width>=t||o.height>=r)&&i(o,e[n+1])){a=n;break}}return a},r}(r(4).default);t.default=n}).call(this,r(2).Number)},function(e,t,r){"use strict";var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0});var a=r(1),n=r(4),o=r(0),s=window.performance,l=function(e){function t(t){return e.call(this,t,a.default.MEDIA_ATTACHING)||this}return i(t,e),t.prototype.destroy=function(){this.timer&&clearInterval(this.timer),this.isVideoPlaybackQualityAvailable=!1},t.prototype.onMediaAttaching=function(e){var t=this.hls.config;t.capLevelOnFPSDrop&&("function"==typeof(this.video=e.media instanceof window.HTMLVideoElement?e.media:null).getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),clearInterval(this.timer),this.timer=setInterval(this.checkFPSInterval.bind(this),t.fpsDroppedMonitoringPeriod))},t.prototype.checkFPS=function(e,t,r){var i=s.now();if(t){if(this.lastTime){var n=i-this.lastTime,l=r-this.lastDroppedFrames,u=t-this.lastDecodedFrames,d=1e3*l/n,f=this.hls;if(f.trigger(a.default.FPS_DROP,{currentDropped:l,currentDecoded:u,totalDroppedFrames:r}),d>0&&l>f.config.fpsDroppedMonitoringThreshold*u){var c=f.currentLevel;o.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+c),c>0&&(-1===f.autoLevelCapping||f.autoLevelCapping>=c)&&(c-=1,f.trigger(a.default.FPS_DROP_LEVEL_CAPPING,{level:c,droppedLevel:f.currentLevel}),f.autoLevelCapping=c,f.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=r,this.lastDecodedFrames=t}},t.prototype.checkFPSInterval=function(){var e=this.video;if(e)if(this.isVideoPlaybackQualityAvailable){var t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)},t}(n.default);t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),a=window.performance,n=window.XMLHttpRequest,o=function(){function e(e){e&&e.xhrSetup&&(this.xhrSetup=e.xhrSetup)}return e.prototype.destroy=function(){this.abort(),this.loader=null},e.prototype.abort=function(){var e=this.loader;e&&4!==e.readyState&&(this.stats.aborted=!0,e.abort()),window.clearTimeout(this.requestTimeout),this.requestTimeout=null,window.clearTimeout(this.retryTimeout),this.retryTimeout=null},e.prototype.load=function(e,t,r){this.context=e,this.config=t,this.callbacks=r,this.stats={trequest:a.now(),retry:0},this.retryDelay=t.retryDelay,this.loadInternal()},e.prototype.loadInternal=function(){var e,t=this.context;e=this.loader=new n;var r=this.stats;r.tfirst=0,r.loaded=0;var i=this.xhrSetup;try{if(i)try{i(e,t.url)}catch(r){e.open("GET",t.url,!0),i(e,t.url)}e.readyState||e.open("GET",t.url,!0)}catch(r){return void this.callbacks.onError({code:e.status,text:r.message},t,e)}t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),this.config.timeout),e.send()},e.prototype.readystatechange=function(e){var t=e.currentTarget,r=t.readyState,n=this.stats,o=this.context,s=this.config;if(!n.aborted&&r>=2)if(window.clearTimeout(this.requestTimeout),0===n.tfirst&&(n.tfirst=Math.max(a.now(),n.trequest)),4===r){var l=t.status;if(l>=200&&l<300){n.tload=Math.max(n.tfirst,a.now());var u=void 0,d=void 0;d="arraybuffer"===o.responseType?(u=t.response).byteLength:(u=t.responseText).length,n.loaded=n.total=d;var f={url:t.responseURL,data:u};this.callbacks.onSuccess(f,n,o,t)}else n.retry>=s.maxRetry||l>=400&&l<499?(i.logger.error(l+" while loading "+o.url),this.callbacks.onError({code:l,text:t.statusText},o,t)):(i.logger.warn(l+" while loading "+o.url+", retrying in "+this.retryDelay+"..."),this.destroy(),this.retryTimeout=window.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,s.maxRetryDelay),n.retry++)}else this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),s.timeout)},e.prototype.loadtimeout=function(){i.logger.warn("timeout while loading "+this.context.url),this.callbacks.onTimeout(this.stats,this.context,null)},e.prototype.loadprogress=function(e){var t=e.currentTarget,r=this.stats;r.loaded=e.loaded,e.lengthComputable&&(r.total=e.total);var i=this.callbacks.onProgress;i&&i(r,this.context,null,t)},e}();t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i="undefined"!=typeof window&&window.navigator&&window.navigator.requestMediaKeySystemAccess?window.navigator.requestMediaKeySystemAccess.bind(window.navigator):null;t.requestMediaKeySystemAccess=i}]).default});
!function(F,X){"use strict";var Y="/",B=[{url:"/smiley/petrusromanus",width:38,height:32},{url:"/smiley/cardinalis",width:48,height:31},{url:"/smiley/sacerdos",width:41,height:38},{url:"/smiley/ostiarius",width:50,height:44},{url:"/smiley/pater",width:30,height:28},{url:"/smiley/paterfumo",width:37,height:32},{url:"/smiley/paterscribendus",width:39,height:31},{url:"/smiley/patercoquus",width:29,height:29},{url:"/smiley/pateralcuinus",width:29,height:28},{url:"/smiley/paterstrabo",width:29,height:27},{url:"/smiley/patertacitus",width:35,height:29},{url:"/smiley/paterpulsatus",width:46,height:28},{url:"/smiley/patercogitans",width:38,height:28},{url:"/smiley/patervino",width:36,height:32},{url:"/smiley/patervomens",width:34,height:32},{url:"/smiley/pateroccultatus",width:32,height:32},{url:"/smiley/paterpallidus",width:29,height:28},{url:"/smiley/soror",width:33,height:28},{url:"/smiley/sororbasiola",width:33,height:28},{url:"/smiley/sororcamilla",width:45,height:29},{url:"/smiley/sororfuma",width:44,height:30},{url:"/smiley/sororsolina",width:34,height:29},{url:"/smiley/sorordistorquenda",width:33,height:28},{url:"/smiley/sororlatina",width:33,height:28},{url:"/smiley/sororvituperanda",width:34,height:28},{url:"/smiley/sororrabiata",width:48,height:32},{url:"/smiley/sororbenigna",width:52,height:30},{url:"/smiley/sororphilomena",width:35,height:29},{url:"/smiley/sororrosario",width:49,height:30},{url:"/smiley/novizinaapplausa",width:39,height:31},{url:"/smiley/novizinapaula",width:34,height:30},{url:"/smiley/protestantica",width:34,height:30}],p={plural:function(t){return 1==t?"one":"other"},digits:null,"year-one":"{#} year ago","year-other":"{#} years ago","year+one":"in {#} year","year+other":"in {#} years","month-one":"{#} month ago","month-other":"{#} months ago","month+one":"in {#} month","month+other":"in {#} months","week-one":"{#} week ago","week-other":"{#} weeks ago","week+one":"in {#} week","week+other":"in {#} weeks","day-one":"{#} day ago","day-other":"{#} days ago","day+one":"in {#} day","day+other":"in {#} days","hour-one":"{#} hour ago","hour-other":"{#} hours ago","hour+one":"in {#} hour","hour+other":"in {#} hours","minute-one":"{#} minute ago","minute-other":"{#} minutes ago","minute+one":"in {#} minute","minute+other":"in {#} minutes","second-one":"{#} second ago","second-other":"{#} seconds ago","second+one":"in {#} second","second+other":"in {#} seconds"},m={image:"Insert image",attach:"Attach files",smileys:"Smilies",link:"Insert link",bold:"Bold",italic:"Italic",underline:"Underline",striketrough:"Strikethrough",textcolor:"Text color",backcolor:"Background color",clear:"Clear format"},g={submit:"Submit",placeholder:"Write message",groupchat:"Group conversation",groupjoin:"Invite user",groupleave:"Leave conversation",clear:"Delete conversation",enlarge:"Enlarge",close:"Close",description:"Description"},t=F.init||{},e=t.i18n||{},w=t.language||"",b=t.synchronizer||"",n=t.events||[],h=new Date,$=X.documentElement,_=X.body,i=F.navigator;function y(){for(var t=1;t<arguments.length;++t)for(var e in arguments[t])arguments[t].hasOwnProperty(e)&&(arguments[0][e]=arguments[t][e]);return arguments[0]}var x=y(p,e.datetime||{}),I=y(m,e.wysiwyg||{}),j=y(g,e.chat||{});function s(){if(F.performance){if(performance.now)return performance.now();if(performance.webkitNow)return performance.webkitNow();if(performance.mozNow)return performance.mozNow();if(performance.msNow)return performance.msNow()}return(new Date).getTime()}function k(a,r,o){var l=F.requestAnimationFrame||F.webkitRequestAnimationFrame||F.mozRequestAnimationFrame||F.msRequestAnimationFrame||function(t){F.setTimeout(function(){t(s())},1e3/60)},i=2;function c(t){return t<.5?(n=2*t,Math.pow(n,i)/2):(e=2*t-1,(1-Math.abs(Math.pow(e-1,i)))/2+.5);var e,n}var u=s();l(function t(e){var n=(e-u)/a;if(1<=n)o();else{var i=c(n);r(i),l(t)}})}var a=0;function r(){return a+++";"+(new Date).getTime().toString(36)+";"+s().toString(36)+";"+Math.random().toString(36).substring(2)}var o={};function G(t,e){var n=null;if(o instanceof WeakMap)o.has(t)&&(n=o.get(t));else{if(!("_id"in t))return null;t._id;n=o[t._id]}return n&&e in n?n[e]:null}function J(t,e,n){if(o instanceof WeakMap)if(o.has(t))o.get(t)[e]=n;else{var i={};i[e]=n,o.set(t,i)}else"_id"in t||(t._id=r()),o[t._id][e]=n}F.WeakMap&&(o=new WeakMap);var K=function(n,i,a){var r;return function(){if(r){if(!a)return;clearTimeout(r)}var t=this,e=arguments;r=setTimeout(function(){r=null,n.apply(t,e)},i)}};function Z(t,e,n,i){t.addEventListener(e,n,!!i)}function Q(t,e,n,i){t.removeEventListener(e,n,!!i)}function tt(t,e,n){var i;"function"==typeof Event?i=new Event(e,{bubbles:!1,cancelable:!0}):(i=X.createEvent("Event")).initEvent(e,!1,!0),t.dispatchEvent(i)}function et(t){t.stopPropagation(),t.preventDefault()}function l(t){"interactive"==X.readyState||"complete"==X.readyState?t():Z(X,"DOMContentLoaded",t)}function nt(t,e,n){var i=n?t.querySelector(n):t;i&&(i.classList?i.classList.add(e):i.setAttribute("class",e))}function it(t,e){return t.classList.contains(e)}function at(t,e){t.classList.remove(e)}function rt(t,e,n){for(var i=n?e.parentNode:e;i;){if(i===t)return!0;i=i.parentNode}return!1}function c(t,e){return t.hasAttribute(e)}function L(t,e){return t.getAttribute(e)}function ot(t,e){var n=t.getAttribute(e);return n?JSON.parse(n):null}function E(t,e,n){t.setAttribute(e,n)}function A(t,e){t.removeAttribute(e)}function W(e,t){(Array.isArray(t)?t:[t]).forEach(function(t){t&&e.appendChild(t)})}function lt(t,e,n){var i=X.createElement(t);if(e)for(var a in e)E(i,a,e[a]);return n&&("string"==typeof n?i.innerHTML=n:W(i,n)),i}function ct(t){return X.createTextNode(t)}function ut(t){(Array.isArray(t)?t:[t]).forEach(function(t){var e=t.parentNode;e&&e.removeChild(t)})}function st(t,e){for(var n in e){var i=e[n];(t.style[n]=i)||t.style.removeProperty(n)}}function ht(t,e,n){if(n&&t.matches(e))return t;if("closest"in t)return t.closest(e);var i=t;do{if(i.matches(e))return i;i=i.parentNode}while(null!==i&&i.nodeType===Node.ELEMENT_NODE);return null}function ft(t,e){var n=[];t.matches(e)&&n.unshift(t);for(var i=t.querySelectorAll(e),a=0;a<i.length;++a)n.push(i[a]);return n}function z(t,e){for(var n=[],i=0;i<t.children.length;++i){var a=t.children[i];e&&!a.matches(e)||n.push(a)}return n}function T(t,e){for(var n=t.nextElementSibling;null!==n;){if(!e||n.matches(e))return n;n=n.nextElementSibling}return null}function C(t,e){for(var n=t.previousElementSibling;null!==n;){if(!e||n.matches(e))return n;n=n.previousElementSibling}return null}function M(t,e){for(var n=[],i=t.firstChild;null!==i;i=i.nextSibling)e&&!i.matches(e)||n.push(i);return ut(n),n}function q(t){return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function dt(){var t=!1;return("ontouchstart"in F||F.DocumentTouch&&X instanceof F.DocumentTouch||0<i.maxTouchPoints||0<F.navigator.msMaxTouchPoints)&&(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(i.userAgent||"")?t=!0:/iPhone|iPad|iPod/i.test(i.platform||"")&&(t=!0)),(F.innerWidth||$.clientWidth)<(t?1024:768)}function S(t){return t&&"rtl"==(t.dir||"").toLowerCase()}Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector);var u=[];function H(t,e){var n,i="",a=F.URLSearchParams?F.URLSearchParams:null,r=a&&"a=1"===new a({a:1}).toString(),o=a&&"+"===new a("s=%2B").get("s"),l=!a||((n=new a).append("s"," &"),"s=+%26"===n.toString());if(a&&r&&o&&l){i=new a(t).toString()}else{if(t instanceof FormData)return null;for(var c in t)i+=(""==i?"":"&")+encodeURIComponent(c)+"="+encodeURIComponent(t[c])}return(e||"")+Y+(""!=i?"?"+i:"")}function D(t){var e=null,n=F.URL||F.webkitURL;if(n){var i=new n(t);if(!i)return null;e=(i.pathname||Y)+i.search}else{var a=X.createElement("a");a.href=t,e=("/"!==a.pathname.charAt(0)?"/":"")+a.pathname+i.search}return e.match(/^\/language\/[0-9A-Za-z]{25}$/i)&&(e="/"),e}function vt(t,e,n,h,f,i,d){var a={};if("object"==typeof n)for(c in n)a[c]=n[c];"language"in a?w=a.language:w&&(a.language=w),!b||"synchronizer"in a||(a.synchronizer=b);var r=t?"POST":"GET",o=Y,l=void 0;if(e){for(var c in(l=new FormData(e)).has&&l.delete&&ft(e,"input[data-fileupload],textarea[data-fileupload]").forEach(function(t){var e=L(t,"name");if(e&&l.has(e)){var n=t.value;if(n&&!(n.length<1048576)){l.delete(e);var i=new Blob([n],{type:"text/html"});l.append(e,i,"document.html")}}}),a){(l.has?l.has(c):0!=ft(e,"[name='"+c+"']").length)||l.append(c,a[c])}if(!t)(u=H(l))&&u.length<4096?(o=u,l=void 0):r="POST"}else if(t||"string"!=typeof n){var u,s=!1;if(!t)(u=H(a)).length<4096&&(o=u,s=!0);if(!s){for(var c in l=new FormData,a)l.append(c,a[c]);r="POST"}}else o=n;var v=new XMLHttpRequest;return v.open(r,o,!0),v.responseType=d?"json":"text",v.setRequestHeader("Accept",d?"application/json":"text/html,*/*;q=0.9"),v.onload=function(){if(200!=v.status)return console.warn("request status",v.status),void(f&&f());if(h)if(d)h(v.response);else{var t=null;try{var e=new DOMParser;e&&(t=e.parseFromString(v.response,"text/html"))}catch(t){}t||((t=X.implementation.createHTMLDocument("")).documentElement.innerHTML=v.response),ft(t.head,"script:not([src])").forEach(function(t){var e=t.textContent;if(e){var n=new Function(e+";return init;")();if(n){n.language&&(w=n.language),n.synchronizer&&(b=n.synchronizer);var i=n.i18n||{};i.datetime&&(x=y(p,i.datetime)),i.wysiwyg&&(I=y(m,i.wysiwyg)),i.chat&&(j=y(g,i.chat))}}});var n=null;ft(t.head,"link[rel=canonical]").forEach(function(t){if(!n){var e=L(t,"href");e&&(n=D(e))}});var i=t.body,a=ft(i,"header"),r=ft(i,"main"),o=ft(i,".content aside"),l=ft(i,"footer"),c=ft(i,".nav-back"),u=ft(i,".nav-next"),s=function(t){if(0==t.length)return null;var e=z(t[0]);return 0==e.length?null:e};h({document:t,rtl:S(t.documentElement),title:t.title||null,url:n||null,body:i,header:s(a),main:s(r),aside:s(o),footer:s(l),back:0!=c.length?c.shift():null,next:0!=u.length?u.shift():null})}else;},v.onerror=function(t){console.warn("request failed",v.status,v.statusText),f&&f()},t||(v.timeout=3e4),v.ontimeout=function(t){console.warn("request timed out"),f&&f()},v.withCredentials=!0,v.upload&&i&&(v.upload.onprogress=function(t){i(t.loaded,t.total)}),v.send(l),function(){v.abort()}}function N(){var l=null;return function(t,e,n,i,a,r,o){return l&&l(),l=vt(t,e,n,function(t){l=null,i&&i(t)},function(){l=null,a&&a()},r,o),function(){l&&l(),l=null}}}l(function(){var t=function(){u.forEach(function(t){t()})};Z(F,"scroll",t),Z(F,"resize",t),Z(F,"orientationchange",t)});var f=[];function d(t,e){f.push([t,e])}function O(t,a){f.forEach(function(n){var i=n[0];ft(t,i).forEach(function(t){var e="init:"+i;G(t,e)||(J(t,e,!0),n[1](t,a))})})}l(function(){F.setInterval(function(){var s=new Date;ft($,"[data-datetime]").forEach(function(e){var t=L(e,"datetime"),n=L(e,"data-datetime");if(t){var i=G(e,"datetime"),a=s.getTime()-(i||h).getTime(),r=new Date(t),o=r.getTime(),l=60*r.getTimezoneOffset()*1e3,c=parseInt(n),u=function(t,e){var o=t.getTime()<e.getTime(),n=parseInt(Math.abs(t.getTime()-e.getTime())/1e3),i=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()),a=Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),r=parseInt(Math.abs(i-a)/864e5);function l(t,e){var n=parseInt(e),i=t+(o&&0!=n?"+":"-")+n;return i in x?x[i]:null}function c(t,e){var n=parseInt(e),i=x.plural(n),a=t+(o&&0!=n?"+":"-")+i;if(a in x){var r=x.digits?n.toString().replace(/[0-9]/g,function(t){return x.digits[+t]}):n;return x[a].replace("{#}",r)}return null}function u(t,e){var n=l(t,e);if(n)return n;var i=c(t,e);return i||null}if(n<60&&(s=l("second",0)))return s;if(n<3600)return u("minute",Math.max((n+20)/60,1));if(n<43200)return u("hour",Math.max((n+1200)/3600,1));if(t.getUTCDate()==e.getUTCDate()&&n<86400)return u("hour",Math.max((n+1200)/3600,1));if(r<6){var s;if(s=l("day",Math.max(r,1)))return s;var h=null;switch(e.getUTCDay()){case 0:h="sunday";break;case 1:h="monday";break;case 2:h="tuesday";break;case 3:h="wednesday";break;case 4:h="thursday";break;case 5:h="friday";break;case 6:h="saturday"}var f=h+(o?"+1":"-1");if(f in x)return x[f];var d=c("day",Math.max(r,1));return d||null}return r<14?u("week",Math.max(r/7,1)):t.getUTCMonth()==e.getUTCMonth()&&r<28?u("week",Math.max(r/7,1)):r<360?u("month",Math.max(r/30,1)):u("year",Math.max(r/365,1))}(new Date(o+c+a-l),new Date(o-l));u&&e.textContent!=u&&setTimeout(function(){var t=z(e,"span");(t.length?t[0]:e).textContent=u})}})},3e4)});var v=0;function R(){1<(v+=1)||(nt($,"lock"),$.offsetWidth)}function U(){0!=v&&0==(v-=1)&&(at($,"lock"),st(_,{paddingLeft:null,paddingRight:null}))}function pt(e,n,t,i){var a=Array.isArray(t)?t:[t];"prepend"!=n&&"after"!=n||a.reverse(),a.forEach(function(t){switch(n){case"before":e.parentNode.insertBefore(t,e);break;case"prepend":e.insertBefore(t,e.firstChild);break;case"append":e.appendChild(t);break;case"after":e.parentNode.insertBefore(t,e.nextSibling)}O(t,!0),i&&(nt(t,"fade-in"),setTimeout(function(){at(t,"fade-in")},1e3))})}l(function(){var t=F.innerWidth-Math.min(Math.max($.offsetWidth,$.scrollWidth),F.innerWidth);t&&$.style.setProperty("--scrollbar",t+"px")});var P=K(function(){ft($,"[data-unveil]").forEach(function(t){V(t)})},50);function V(a){if(!ht(a,".window")){var r=ht(a,"[data-scroll]"),t=(r||a).getBoundingClientRect(),e=$.clientWidth||F.innerWidth,n=2*($.clientHeight||F.innerHeight),i=t.top<=n&&0<=t.top+t.height,o=t.left<=e&&0<=t.left+t.width;if(i&&o){if(r){var l=a.offsetTop-r.scrollTop,c=a.offsetHeight,u=r.offsetHeight,s=1*u/3;if(l+c+s<0)return;if(u+s<l)return}if(!G(a,"unveil")){J(a,"unveil",!0);var h=ot(a,"data-unveil");h&&vt(!1,void 0,h,function(t){var n=null;if(r&&!a.previousElementSibling){n=r.scrollTop;var e=getComputedStyle(a);n-=a.offsetHeight+parseInt(e.marginTop)+parseInt(e.marginBottom)}var i=t.header||t.main;i&&pt(a,"before",i,!0),null!==n&&(i.forEach(function(t){var e=getComputedStyle(t);n+=t.offsetHeight+parseInt(e.marginTop)+parseInt(e.marginBottom)}),r.scrollTop=Math.max(n,0)),ut(a),P()})}}}}u.push(P),Z(X,"keydown",function(e){var t=!1,n=X.activeElement;n&&(n.matches("input")||n.matches("textarea")||ht(n,"form"))&&(t=!0);var i=ft($,".dropdown.open");if(0!=i.length)if("Escape"==e.key)i.forEach(function(t){et(e),at(t,"open")});else if(!t&&("ArrowDown"==e.key||"ArrowUp"==e.key)){et(e);var a=ft($,".dropdown :focus");if(0==a.length)return;var r=ht(a[0],"li",!0);if(r)"ArrowDown"==e.key?r=T(r):"ArrowUp"==e.key&&(r=C(r));else{var o=ft(i[0],"li");0!=o.length&&(r=o[0])}if(!r)return;var l=ft(r,"a");0!=l.length&&l[0].focus()}"Escape"==e.key&&(0!=It(!0).length&&et(e));var c=ft($,".book");if(0!=c.length&&!t){var u=G(c[0],"book");u&&("ArrowLeft"==e.key?(et(e),u.back()):"ArrowRight"==e.key&&(et(e),u.next()))}});var mt=function(e){ft($,".dropdown.open").forEach(function(t){rt(t,e.target)||at(t,"open")})};Z(X,"mousedown",mt),Z(X,"touchstart",mt);var gt=null;function wt(f,d){var v=null,p="string"==typeof d,n=null,i=null,a=p?400:200,r=p?10:100;function m(){if(v){var t=v;v=null,n&&n(),n=null,i&&i(),i=null,at(t,"open"),setTimeout(function(){ut(t)},1e3),gt==m&&(gt=null)}}function o(t,e,n){gt&&gt(),gt=m;for(var i=ht(f,"h6")||f,a=f;a&&!it(a,"modal");a=a.parentElement){"hidden"==F.getComputedStyle(a).overflow&&(i=a)}var r=(i.offsetParent||_).getBoundingClientRect(),o=f.getBoundingClientRect(),l=0;p?(l=e-r.left,v=lt("div",{class:"popup tip",style:"left:"+l+"px;top:"+(o.top-r.top+o.height)+"px"},ct(d))):(l=o.left-r.left+o.width/2,Z(v=lt("div",{class:"user"in d?"popup user":"popup post",style:"left:"+l+"px;top:"+(o.top-r.top+o.height)+"px"},t),"mousemove",g),Z(v,"mouseleave",w)),i.parentNode.insertBefore(v,i.nextSibling),p||(ft(v,"[data-external],[data-popup]").forEach(function(t){A(t,"data-external"),A(t,"data-popup")}),O(v,!0));var c=v.offsetWidth,u=v.offsetHeight,s=$.clientWidth||F.innerWidth,h=$.clientHeight||F.innerHeight;r.left+l+c/2>=s-5&&(l=s-5-(r.left+c/2),v.style.left=l+"px"),r.left+l<=c/2+5&&(l=c/2+5-r.left,v.style.left=l+"px"),o.top>u+5&&o.top+o.height+u>h-5&&(v.style.top="",v.style.bottom=r.bottom-o.bottom+o.height+"px",v.style.transformOrigin="bottom left"),v.offsetWidth,nt(v,"open")}function g(t){if(i&&i(),i=null,!v){var e=setTimeout(function(){var e;e=t.clientX,t.clientY,n&&n(),n=null,i&&i(),i=null,p?o(null,e):(n=vt(!1,void 0,d,function(t){n=null,o(t.main,e)},function(){gt=n=null}),gt&&gt(),gt=n)},a);n&&n(),n=function(){clearTimeout(e)},gt&&gt(),gt=n}}function w(t){n&&n(),n=null;var e=setTimeout(m,r);i&&i(),i=function(){clearTimeout(e)}}Z(f,"mousemove",g),Z(f,"mouseleave",w),Z(f,"click",w)}function bt(n,t){var e=ht(n,"form");if(e){var i="image"==t,a="attachment"==t,c="chat"==t,r=0!=ft(n,"div[contenteditable=true]").length,o=c?"bottom":a&&r?"demand":"top";""!=t&&"image"!=t||nt(n,"document");var l=[],u=[],s=ft(e,"button[type=submit][hidden]");if(1==s.length){var h=s.shift();A(h,"hidden"),l.push(h)}if(i||a||c){var f={icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86l-3 3.87L9 13.14 6 17h12l-3.86-5.14z"/></svg>',dataurl:function(t,e,n,i){e.match(/^image/i)&&t.insertHTML(' <img src="'+n+'"> <br><br> ')},attr:{title:I.image}};l.push(f)}var d=null;if((a||c)&&e.matches("[enctype='multipart/form-data']")){var v=null,p=1,m=[];f={icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z"/></svg>',browse:function(t,e,n,i){e.name="attachment-"+p++,m.push(e),i.style.position="relative",v?v.textContent=(parseInt(v.textContent)+1).toString():(st(v=lt("div",void 0,ct("1")),{position:"absolute",top:"0",right:"0",fontSize:"0.6em",padding:"1px 2px",color:"white",backgroundColor:"#fa3e3e",borderRadius:"2px"}),W(i,v))},attr:{title:I.attach}};l.push(f),d=function(){v&&ut(v),v=null,m.forEach(function(t){ut(t)}),m=[]}}var g={icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm3.5-9c.83 0 1.5-.67 1.5-1.5S16.33 8 15.5 8 14 8.67 14 9.5s.67 1.5 1.5 1.5zm-7 0c.83 0 1.5-.67 1.5-1.5S9.33 8 8.5 8 7 8.67 7 9.5 7.67 11 8.5 11zm3.5 6.5c2.33 0 4.31-1.46 5.11-3.5H6.89c.8 2.04 2.78 3.5 5.11 3.5z"/></svg>',popup:function(o,l,t){var e=n.offsetWidth;st(l,{display:"inline-block",maxWidth:parseInt(8*e/9)+"px",padding:"0.5rem",textAlign:"center",whiteSpace:"normal"}),l.unselectable=!0,B.forEach(function(e,t){0!=t&&W(l,ct(" "));var n=lt("img",{src:e.url,width:e.width,height:e.height,unselectable:!0}),i=e.width,a=e.height,r=c?20:28;r<a&&(i=Math.round(i*r/a),a=r),st(n,{cursor:"pointer",width:i+"px",height:a+"px",display:"inline-block"}),Z(n,"click",function(){var t=' <img src="'+q(e.url)+'" width="'+i+'" height="'+a+'" alt=""> ';o.insertHTML(t)}),W(l,n)})},attr:{title:I.smileys}};l.push(g);var w={icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>',action:"link",attr:{title:I.link}};l.push(w),u.push(w);var b={icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z"/></svg>',action:"bold",hotkey:"b",attr:{title:I.bold}};c||l.push(b),u.push(b);var y={icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4h-8z"/></svg>',action:"italic",hotkey:"i",attr:{title:I.italic}};c||l.push(y),u.push(y);var x={icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6zm-7 2v2h14v-2H5z"/></svg>',action:"underline",hotkey:"u",attr:{title:I.underline}};c||l.push(x),u.push(x);var k={icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M7.24 8.75c-.26-.48-.39-1.03-.39-1.67 0-.61.13-1.16.4-1.67.26-.5.63-.93 1.11-1.29.48-.35 1.05-.63 1.7-.83.66-.19 1.39-.29 2.18-.29.81 0 1.54.11 2.21.34.66.22 1.23.54 1.69.94.47.4.83.88 1.08 1.43s.38 1.15.38 1.81h-3.01c0-.31-.05-.59-.15-.85-.09-.27-.24-.49-.44-.68-.2-.19-.45-.33-.75-.44-.3-.1-.66-.16-1.06-.16-.39 0-.74.04-1.03.13s-.53.21-.72.36c-.19.16-.34.34-.44.55-.1.21-.15.43-.15.66 0 .48.25.88.74 1.21.38.25.77.48 1.41.7H7.39c-.05-.08-.11-.17-.15-.25zM21 12v-2H3v2h9.62c.18.07.4.14.55.2.37.17.66.34.87.51s.35.36.43.57c.07.2.11.43.11.69 0 .23-.05.45-.14.66-.09.2-.23.38-.42.53-.19.15-.42.26-.71.35-.29.08-.63.13-1.01.13-.43 0-.83-.04-1.18-.13s-.66-.23-.91-.42c-.25-.19-.45-.44-.59-.75s-.25-.76-.25-1.21H6.4c0 .55.08 1.13.24 1.58s.37.85.65 1.21c.28.35.6.66.98.92.37.26.78.48 1.22.65.44.17.9.3 1.38.39.48.08.96.13 1.44.13.8 0 1.53-.09 2.18-.28s1.21-.45 1.67-.79c.46-.34.82-.77 1.07-1.27s.38-1.07.38-1.71c0-.6-.1-1.14-.31-1.61-.05-.11-.11-.23-.17-.33H21V12z"/></svg>',action:"strikethrough",hotkey:"s",attr:{title:I.striketrough}};c||l.push(k),u.push(k);var E={icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path fill-opacity=".36" d="M0 20h24v4H0v-4z"/><path d="M11 3L5.5 17h2.25l1.12-3h6.25l1.12 3h2.25L13 3h-2zm-1.38 9L12 5.67 14.38 12H9.62z"/></svg>',action:"colortext",attr:{title:I.textcolor}};c||l.push(E),u.push(E);var z={icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M16.56 8.94L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.59-.59 1.54 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.58.59-1.53 0-2.12zM5.21 10L10 5.21 14.79 10H5.21zM19 11.5s-2 2.17-2 3.5c0 1.1.9 2 2 2s2-.9 2-2c0-1.33-2-3.5-2-3.5z"/><path fill-opacity=".36" d="M0 20h24v4H0v-4z"/></svg>',action:"colorfill",attr:{title:I.backcolor}};c||l.push(z),u.push(z);var T={icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M20 8V5H6.39l3 3h1.83l-.55 1.28 2.09 2.1L14.21 8zM3.41 4.86L2 6.27l6.97 6.97L6.5 19h3l1.57-3.66L16.73 21l1.41-1.41z"/></svg>',action:"clearformat",attr:{title:I.clear}};c||l.push(T);var C=N(),M=null;c&&(M=function(){return tt(e,"submit"),!0}),H(l,"demand"!=o),H(u);var S=wysiwyg(n,{toolbar:o,buttons:l,selectionbuttons:u,suggester:function(h,f){if("@"!=h[0])return!1;if(h.length<=2)return!0;var t={suggestion:h.substring(1),users:""};return C(!1,void 0,t,function(t){var e=t.main||[];if(0!=e.length){for(var n=[],i=0;i<5&&i<e.length;++i){var a=e[i],r=L(a,"data-id");if(r){var o=ft(a,"cite");if(0!=o.length){var l=o[0].textContent;if(l){var c=l,u=new RegExp("^("+h.substring(1).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+")(.*)$","i");u.test(c)&&(c=c.replace(u,"$1<b>$2</b>"));var s=ft(a,"figure>img");0!=s.length&&(c='<span class="icon">'+s[0].outerHTML+"</span>"+c),n.push({label:c,insert:'&nbsp;<a href="/user/'+q(r)+'">@'+q(l)+"</a>&nbsp; "})}}}}f(n)}else f(null)}),!0},interceptenter:M,hijackmenu:!1});return O(n,!0),Z(e,"reset",function(){S.setHTML(""),!c&&X.activeElement&&rt(n,X.activeElement)&&X.activeElement.blur(),d&&d()}),S}function H(t,n){t.forEach(function(t){if(t.attr){var e=t.attr;e.title&&(n&&(e["data-tooltip"]=e.title),delete e.title)}})}}u.push(function(){gt&&(gt(),gt=null)});var yt=null,xt=void 0,kt=void 0;function Et(t){if(kt&&(clearTimeout(kt),kt=null),!0===t||!1===t){if(!yt)return;return!1===t?(ut(yt),void(yt=null)):(st(yt,{transform:"translate3d(0%,0,0)",transition:"none",opacity:1}),yt.offsetWidth,void(kt=setTimeout(function(){st(yt,{transition:"all 400ms",opacity:0}),yt.offsetWidth,kt=setTimeout(function(){ut(yt),yt=null},400)},200)))}function e(){xt+=(1-xt)/11*Math.random(),yt.offsetWidth,st(yt,{transform:"translate3d("+-100*(1-xt)+"%,0,0)",transition:"all 350ms"})}yt||(st(yt=lt("div",{class:"nanoscope"}),{transform:"translate3d(-100%,0,0)",opacity:1}),W(_,yt)),xt=0,e(),kt=setInterval(e,200)}var zt=N(),Tt=null;function Ct(t,e,n){Tt&&Tt(),Et();var i=zt(!1,null,t,function(t){Et(!0),e&&e(t)},function(t){Et(!1),n&&n()});return function(){i(),Et(!1)}}var Mt={},St="",Ht=null,Bt=[];function It(e){var n=!1;if(ft($,"input#login:checked,input#aside:checked").reverse().forEach(function(t){t.checked=null,n=!0,U()}),n&&e)return[!0];var i=[];return Bt.forEach(function(t){n&&e||(i.push(t.modal),t.close(),n=!0)}),Bt=[],i}function Lt(t,e,n,i,a,r){var o=F.pageYOffset,l=It();function c(t){ft(t,"video,audio").forEach(function(t){try{t.pause(),t.currentTime=0}catch(t){}})}var u=z(_,":not(.nanoscope):not(.window):not(.notification)"),s=!!Ht,h=[],f=null;u.forEach(function(t){if(h.push(t),s&&t===Ht.modal)(f=M(Ht.overlay,":not(.nav-close)")).forEach(function(t){c(t)});else if(!s||"obsolete"==r){if(s&&t===Ht.modal)return;if(-1!=l.indexOf(t))return;ut(t),c(t)}}),St in Mt||(Mt[St]={});var d=Mt[St];if(d.url||(d.url=D(F.location.href)),d.rtl||(d.rtl=S($)),d.title||(d.title=X.title),d.elements=h,d.scroll=o,s&&"open"!=r&&(d.overlay=f),s&&"obsolete"==r&&(Ht&&Ht.close(!0),Ht=null),e){var v="object"==typeof e?e:null,p=n||(v?H(v):Y),m=a||"";t in Mt||(Mt[t]={});var g=Mt[t];g.param||(g.param=v),g.url||(g.url=p),g.rtl||(g.rtl=i),g.title||(g.title=m),g.prev||(g.prev=St),m&&(X.title=m);var w={key:t,param:v};F.history.pushState(w,m,p)}St=t}function At(t){for(var e=[],n=t.body.firstChild;null!==n;n=n.nextSibling)n.nodeType==Node.ELEMENT_NODE&&e.unshift(n);e.forEach(function(t){pt(_,"prepend",t,!1)}),t.rtl?E($,"dir","rtl"):A($,"dir")}function Wt(e){Ct(e,function(t){Lt(r(),e,t.url,t.rtl,t.title,"obsolete"),At(t),F.scroll(0,0)})}function qt(t,e,n){var i=null;if(ft($,"input#login").forEach(function(t){i=t}),i){var a=lt("div",{class:t},e),r=lt("div",{class:"modal"},a);Z(r,"click",function(t){rt(a,t.target)||c()});var o=null;Z(r,"touchstart",function(t){1===t.targetTouches.length&&(o=t.targetTouches[0].clientY)}),Z(r,"touchmove",function(t){if(1===t.targetTouches.length){var e=t.targetTouches[0].clientY-o;0===r.scrollTop&&0<e&&t.preventDefault(),r.scrollHeight-r.scrollTop<=r.clientHeight&&e<0&&t.preventDefault()}}),pt(i,"before",r),R(),r.offsetWidth,nt(r,"open");var l=!1;return J(r,"close",function(){c()}),Z(r,"scroll",P),Z(r,"resize",P),Z(r,"orientationchange",P),{modal:r,overlay:a,close:c}}function c(t){l||(l=!0,n&&n(t),U(),at(r,"open"),setTimeout(function(){r&&(ut(r),r=null)},600))}}function Dt(a){Ht=qt("overlay",null,function(t){if(a&&a(),!t){for(var e={},n=St;n in Mt&&(e=Mt[n],n==St||"overlay"in Mt[n]);n=Mt[n].prev);var i=e.param||!0;Lt(r(),i,e.url,e.rtl,e.title,"close")}Ht=null});var t=lt("button"),e=lt("div",{class:"nav-close"},t);Z(t,"click",function(t){et(t),this.blur(),Ht.close()}),W(Ht.overlay,e)}"state"in F.history&&(St=(F.history.state||{}).key||""),Z(F,"popstate",function(t){var e=t.state,n=null===e?"":e.key;if(n in Mt){var i=Mt[n];Lt(n,null,i.url,i.rtl,i.title,null),i.rtl?E($,"dir","rtl"):A($,"dir"),X.title=i.title,!Ht||"overlay"in i||(Ht&&Ht.close(!0),Ht=null),i.elements.slice().reverse().forEach(function(t){_.insertBefore(t,_.firstChild)}),F.scroll(0,i.scroll),"overlay"in i&&(Ht||Dt(),W(Ht.overlay,i.overlay))}else{Ct(e&&"param"in e?e.param:(F.location.pathname||Y)+F.location.search,function(t){Lt(n,null,t.url,t.rtl,t.title,null),At(t),F.scroll(0,0)})}});var Nt=null;function Ot(n,t){if(Ht||!t){var i=null;Ht||(Dt(function(){Nt&&Nt(),Nt=null}),i=lt("div",{class:"unveil"},"<hr>"),W(Ht.overlay,i)),Nt=Ct(n,function(t){if(!t.header&&!t.main)return Ht.close(),void(Ht=null);i&&ut(i),Lt(r(),n,t.url,t.rtl,t.title,i?"open":null);var e=Ht.overlay;t.header&&(pt(e,"append",lt("div",{class:"header"},t.header),!1),nt(e,"wide")),t.main&&t.aside?(pt(e,"append",lt("div",{class:"content"},[lt("div",{class:"main"},t.main),lt("div",{class:"aside"},t.aside)]),!1),!t.header&&t.aside&&nt(e,"wide")):t.main&&pt(e,"append",lt("div",{class:"main"},t.main),!1);t.back&&pt(e,"append",t.back,!1),t.next&&pt(e,"append",t.next,!1)},function(){Ht&&(Ht.close(),Ht=null)})}else Wt(n)}function Rt(n){var i=null;return ft($,"input#login+.modal .overlay .footer label.button[for=login]").forEach(function(t){var e=lt("button",{class:"button"},ct(t.textContent));Z(e,"click",function(t){et(t),this.blur(),n.close()}),i=lt("div",{class:"footer"},e),W(n.overlay,i)}),i}function Ut(t,r){var o=lt("div",{class:"unveil"},"<hr>"),l=qt("overlay dialog",o,function(){var t=Bt.indexOf(l);-1!=t&&Bt.splice(t,1),Tt=l=null});Bt.push(l);var e=lt("div",{class:"nav-close"},lt("button"));W(l.modal,e);var c=Rt(l);Ct(t,function(t){if(l)if(t.header||t.main){if(t.main&&1==t.main.length&&!t.header&&!t.aside){var e=t.main.slice().shift();ft(e,"form > .alert-success").forEach(function(t){at(t,"alert-success"),nt(l.overlay,"success")}),ft(e,"form > .alert-danger").forEach(function(t){at(t,"alert-danger"),nt(l.overlay,"danger")})}t.header&&nt(l.overlay,"wide");var n=t.header||t.main;if(pt(o,"before",n,!1),ut(o),c){var i=null,a=n.filter(function(t){return t.matches("form")});1==a.length&&ft(a.shift(),"button[type=submit]").forEach(function(t){i=t}),i&&(i.parentNode.insertBefore(c,i),W(c,i))}r&&r(l)}else l.close()},function(){l&&l.close()}),Tt=l.close}function Pt(t,e){var n=qt("overlay "+e,t,function(){var t=Bt.indexOf(n);-1!=t&&Bt.splice(t,1)});Bt.push(n);var i=lt("div",{class:"nav-close"},lt("button"));return W(n.modal,i),"input"!=e&&Rt(n),n.close}function Vt(e,t,n,i){var a=L(e,"method"),r=L(e,"enctype")||"",o="POST"==a.toUpperCase(),l=null,c=null;function u(t){l?(ut(l),l=null):Et(t)}o&&"multipart/form-data"==r.toLowerCase()?(c=lt("progress",{max:"1.0",value:"0.0"}),l=lt("div",{class:"cover"},c),W(e,l)):Et(),vt(o,e,t,function(t){u(!0),n&&n(t),tt(e,"reset")},function(){u(),i&&e.submit()},function(t,e){c&&E(c,"value",t/e)})}function Ft(n,l,t){var i=$.matches("html[dir=rtl]"),e=lt("button"),c=lt("div",{class:"nav-back lock"},e),a=lt("button"),u=lt("div",{class:"nav-next lock"},a),r=ht(n,".overlay");r||(r=ht(n,".frame")),r&&(ft(r,".nav-back,.nav-next").forEach(function(t){ut(t)}),W(r,[c,u]));var o=!1;function s(){t&&!o&&(vt(!1,null,t),o=!0)}function h(t,e){var n=e;i&&(e%2==0?n+=1:n-=1),t.innerHTML=n<l.length?l[n].html:"",W(t,lt("var",null,ct(n+1)))}var f=0,d=!1;function v(t){d=!0;var e=ft(n,"div.page");if(4==e.length){var a=e[0],r=e[1];W(n,a),W(n,r),t?(h(a,f-2),h(r,f-1),f-=2):(h(a,f+2),h(r,f+3),f+=2);var o=parseInt(n.offsetWidth/2),l=parseInt(n.offsetHeight);st(a,{clip:"rect(0,0,"+l+"px,0)"}),st(r,{clip:"rect(0,0,"+l+"px,0)"}),st(c,{zIndex:3}),st(u,{zIndex:3}),k(400,(i?!t:t)?function(t){var e=parseInt(Math.round(t*(2*o)-o));e=Math.min(e,o);var n=parseInt(Math.round((1-t)*o));n=Math.max(n,0),st(a,{left:0,right:"auto",clip:"rect(0,"+(o-n)+"px,"+l+"px,0)",zIndex:1}),st(r,{left:e+"px",right:"auto",clip:"rect(0,"+o+"px,"+l+"px,"+n+"px)",zIndex:2})}:function(t){var e=parseInt(Math.round(2*o*(1-t)));e=Math.max(e,0);var n=parseInt(Math.round(t*o));n=Math.min(n,o);var i=e-o;st(a,{left:e+"px",right:"auto",clip:"rect(0,"+n+"px,"+l+"px,0)",zIndex:2}),st(r,{left:o+"px",right:"auto",clip:"rect(0,"+o+"px,"+l+"px,"+i+"px)",zIndex:1})},function(){st(a,{left:null,right:null,clip:null,zIndex:null}),st(r,{left:null,right:null,clip:null,zIndex:null}),st(c,{zIndex:null}),st(u,{zIndex:null}),d=!1})}}function p(){(i?f+3<=l.length:0!=f)?A(e,"disabled"):E(e,"disabled","disabled"),(i?0!=f:f+3<=l.length)?A(a,"disabled"):E(a,"disabled","disabled")}function m(){d||f<2||(v(!0),p(),s())}function g(){d||f+3>l.length||(v(!1),p(),s())}p(),Z(e,"click",function(t){et(t),this.blur(),m()}),Z(a,"click",function(t){et(t),this.blur(),g()}),J(n,"book",{back:m,next:g});var w=null;function b(t){t.originalEvent&&t.originalEvent.touches&&(t=t.originalEvent.touches[0]);if(w.idle&&10<Math.abs(t.pageX-w.x)&&(F.getSelection().toString()?w=null:w.idle(t)),w){var e=0;t.clientX||t.clientY?e=t.clientX:(t.pageX||t.pageY)&&(e=t.pageX-_.scrollLeft-$.scrollLeft);var n=e>w.pointerStartX?-1:1;w.dir=n}}function y(t){w&&(w.dir==(i?1:-1)?m():w.dir==(i?-1:1)&&g(),p()),Q($,"mousemove",b),Q($,"touchmove",b),Q($,"mouseup",y),Q($,"touchend",y),at(n,"drag"),w=null}function x(t){t.originalEvent&&t.originalEvent.touches&&(t=t.originalEvent.touches[0]),et(t),t.button&&2==t.button||(w={idle:function(t){w.idle=!1,nt(n,"drag")},x:parseInt(t.pageX,10),dir:0,pointerStartX:parseInt(t.pageX,10),pointerStartY:parseInt(t.pageY,10)},Z($,"mousemove",b),Z($,"touchmove",b),Z($,"mouseup",y),Z($,"touchend",y))}Z(n,"touchstart",x),Z(n,"mousedown",x),ft(n,"div.page").forEach(function(t,n){Z(t,"click",function(t){et(t),this.blur();var e=f+n%2;e>=l.length&&(e-=1),function(t){var i=[];l.forEach(function(t){var e=lt("div");st(e,{width:"85vw",height:85/t.width*t.height+"vw"}),i.push(e)});var e=qt("pages",i,function(){var t=Bt.indexOf(e);-1!=t&&Bt.splice(t,1)});if(e){if(Bt.push(e),Z(e.overlay,"click",function(t){et(t),this.blur(),e.close()}),0!=t&&t<i.length){var n=i[t].offsetTop;n&&e.modal.scroll(0,n-F.innerHeight/20)}var a=K(function(){var a=[],r=$.clientWidth||F.innerWidth,o=$.clientHeight||F.innerHeight;i.forEach(function(t){var e=t.getBoundingClientRect(),n=e.top<=o&&0<=e.top+e.height,i=e.left<=r&&0<=e.left+e.width;n&&i&&a.push(t)}),ft(e.overlay,"iframe").forEach(function(t){var e=ht(t,"div");-1==a.indexOf(e)&&ut(t)}),a.forEach(function(t){if(!t.querySelector("iframe")){var e=i.indexOf(t);if(-1!=e){t.innerHTML=l[e].iframe;var n=t.offsetWidth/l[e].width;st(t.querySelector("iframe"),{transform:"scale("+n+")",transformOrigin:"0 0"})}}})},50);Z(e.modal,"scroll",a),Z(e.modal,"resize",a),Z(e.modal,"orientationchange",a),a()}}(e),s()})})}function Xt(t,e,n){var i=ft($,".notification");0!=i.length?i=i.shift():(i=lt("div",{class:"notification"}),W(_,i));var a=lt("div",null,t);"success"==e?nt(a,"success"):"danger"==e&&nt(a,"danger");var r=lt("span",{class:"close"});W(a,r);for(var o=0,l=void 0,c=i.firstChild;null!==c;c=c.nextSibling)G(c,"timeout")||(o+=1,l=c);3<=o&&tt(l,"click"),pt(i,"prepend",a,!0);var u=null;function s(){clearTimeout(u),a&&(nt(a,"fade-out"),setTimeout(function(){a&&(ut(a),a=null)},1e3))}if(Z(a,"click",s),ft(a,"a").forEach(function(t){Z(t,"click",s)}),Z(r,"click",function(t){et(t),s()}),n){u=setTimeout(s,5e3),J(a,"timeout",!0),Z(a,"mouseover",function(){u&&(clearTimeout(u),u=null)});var h=function(t){t.target==a&&(u||(u=setTimeout(s,5e3)))};Z(a,"mouseout",h),Z(a,"mouseleave",h)}}function Yt(t,n){return t?t.filter(function(t){if(n&&t.matches("data")){var e=ot(t,"value");return e&&e.predecessor&&n(e.predecessor),!1}return t.matches(".alert-success")?(at(t,"alert-success"),Xt(t,"success",!0),!1):!t.matches(".alert-danger")||(at(t,"alert-danger"),Xt(t,"danger",!0),!1)}):[]}function $t(i,t,e,n){var a=[],r=!1;e.forEach(function(t){if(t.matches("data")){var e=ot(t,"value");return e&&e.chat&&(i.chat=e.chat),void(e&&e.predecessor&&(i.predecessor=e.predecessor))}if(!r){var n=ot(t,"data-texting");if(n){if(-1!=i.textings.indexOf(n.id))return void(r=!0);i.textings.push(n.id)}ft(t,"time[data-tooltip]").forEach(function(t){A(t,"data-tooltip")}),a.unshift(t)}});var o=i.scroll.scrollTop;if(t){pt(t,"before",a,!0);var l=getComputedStyle(t);o-=t.offsetHeight+parseInt(l.marginTop)+parseInt(l.marginBottom)}else pt(i.list,"append",a,!0);a.forEach(function(t){var e=getComputedStyle(t);o+=t.offsetHeight+parseInt(e.marginTop)+parseInt(e.marginBottom)}),i.scroll.scrollTop=Math.max(o,0)}var _t={};function jt(e,t,l,n,i,a,r,o,c){if(dt())Wt(e?{chat:e}:{chat:"",user:l});else{var u=t?"g:"+t:l?"u:"+l:e?"c:"+e:null;if(u){if(u in _t)return!(D=_t[u]).chat&&e&&(D.chat=e),i&&nt(D.title,"unread"),$t(D,null,r),void(o&&(D.predecessor=o));var s=void 0,h=void 0,f=void 0;t?(h=lt("button",{class:"muted","data-tooltip":j.groupjoin},'<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="1280" viewBox="0 0 1280 1280" fill="currentColor"><path d="m426.773438 853.652344c-117.601563 0-213.332032-95.730469-213.332032-213.332032 0-117.601562 95.730469-213.332031 213.332032-213.332031 117.601562 0 213.332031 95.730469 213.332031 213.332031 0 117.601563-95.679688 213.332032-213.332031 213.332032zm0-320c-58.878907 0-106.667969 47.789062-106.667969 106.667968 0 58.828126 47.789062 106.667969 106.667969 106.667969 58.878906 0 106.667968-47.839843 106.667968-106.667969 0-58.878906-47.789062-106.667968-106.667968-106.667968zm0 0"/><path d="m853.441406 1280.320312h-853.335937v-53.332031c0-188.429687 175.414062-320 426.667969-320 251.253906 0 426.667968 131.570313 426.667968 320zm-738.1875-106.667968h623.144532c-31.945313-96.425782-151.144532-160-311.570313-160-160.429687 0-279.679687 63.574218-311.574219 160zm0 0"/><path d="m1173.441406 373.652344h-160v-160h-106.667968v160h-160v106.667968h160v160h106.667968v-160h160zm0 0"/></svg>'),f=lt("button",{class:"muted","data-tooltip":j.groupleave},'<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="1280" viewBox="0 0 1280 1280" fill="currentColor"><path d="m960 1173.332031h-586.667969c-58.824219 0-106.664062-47.839843-106.664062-106.664062v-160h106.664062v160h586.667969v-853.335938h-586.667969v160h-106.664062v-160c0-58.773437 47.839843-106.664062 106.664062-106.664062h586.667969c58.828125 0 106.667969 47.890625 106.667969 106.664062v853.335938c0 58.824219-47.839844 106.664062-106.667969 106.664062zm0 0"/><path d="m624.375 388.90625-75.414062 75.519531 122.503906 122.242188h-458.132813v106.664062h457.707031l-122.132812 122.347657 75.519531 75.308593 250.988281-251.46875zm0 0"/></svg>')):s=lt("button",{class:"muted","data-tooltip":j.groupchat},'<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="1280" viewBox="0 0 1280 1280" fill="currentColor"><path d="m960.054688 693.332031c44 0 80 36.054688 80 80 0 43.949219-36 80-80 80s-80-36.050781-80-80c0-43.945312 36-80 80-80zm0 0"/><path d="m1066.71875 1173.332031h-213.332031v-160c0-58.878906 47.785156-106.664062 106.667969-106.664062 58.878906 0 106.664062 47.785156 106.664062 106.664062zm0 0"/><path d="m640.054688 693.332031c44 0 80 36.054688 80 80 0 43.949219-36 80-80 80s-80-36.050781-80-80c0-43.945312 36-80 80-80zm0 0"/><path d="m746.71875 1173.332031h-213.332031v-160c0-58.878906 47.785156-106.664062 106.667969-106.664062 58.878906 0 106.664062 47.785156 106.664062 106.664062zm0 0"/><path d="m320.054688 693.332031c44 0 80 36.054688 80 80 0 43.949219-36 80-80 80s-80-36.050781-80-80c0-43.945312 36-80 80-80zm0 0"/><path d="m426.71875 1173.332031h-213.332031v-160c0-58.878906 47.785156-106.664062 106.667969-106.664062 58.878906 0 106.664062 47.785156 106.664062 106.664062zm0 0"/><path d="m1140.054688 628.320312-500-400-500.054688 400-66.613281-83.308593 566.667969-453.332031 566.613281 453.332031zm0 0"/></svg>');var d=lt("button",{class:"muted","data-tooltip":j.enlarge},'<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="1280" viewBox="0 0 1280 1280" fill="currentColor"><path d="m853.332031 640v-160c0-29.441406-23.890625-53.332031-53.332031-53.332031h-533.332031c-29.441407 0-53.335938 23.890625-53.335938 53.332031v160h106.667969v-106.667969h160v369.066407c17.492188 2.507812 35.199219 4.269531 53.332031 4.269531 18.132813 0 35.839844-1.761719 53.335938-4.269531v-369.066407h160v106.667969zm0 0"/><path d="m586.667969 1117.28125c-17.601563 1.597656-35.359375 2.71875-53.335938 2.71875-17.972656 0-35.730469-1.121094-53.332031-2.71875v56.050781h-106.667969v106.667969h320v-106.667969h-106.664062zm0 0"/><path d="m1211.039062 1188.960938-290.238281-290.1875c90.1875-95.625 145.867188-224 145.867188-365.441407 0-294.078125-239.253907-533.332031-533.335938-533.332031-294.078125 0-533.332031 239.253906-533.332031 533.332031 0 294.132813 239.253906 533.335938 533.332031 533.335938 114.242188 0 219.949219-36.429688 306.773438-97.761719l295.519531 295.46875zm-1104.371093-655.628907c0-235.253906 191.410156-426.664062 426.664062-426.664062 235.253907 0 426.667969 191.410156 426.667969 426.664062 0 235.253907-191.414062 426.667969-426.667969 426.667969-235.253906 0-426.664062-191.414062-426.664062-426.667969zm0 0"/></svg>'),v=lt("button",{class:"muted","data-tooltip":j.clear},'<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="1280" viewBox="0 0 1280 1280" fill="currentColor"><path d="m106.667969 1066.667969h1066.664062v106.664062h-1066.664062zm0 0"/><path d="m335.574219 997.707031c9.707031 9.652344 23.039062 15.625 37.757812 15.625h320c14.722657 0 28.054688-5.972656 37.761719-15.625l388.90625-388.960937c41.601562-41.546875 41.601562-109.226563 0-150.824219l-297.921875-297.921875c-41.542969-41.601562-109.277344-41.601562-150.824219 0l-511.253906 511.253906c-41.601562 41.597656-41.601562 109.28125 0 150.824219zm197.757812-548.960937 297.921875 297.921875-160 160h-275.839844l-160-160zm0 0"/></svg>'),p=lt("button",{class:"muted","data-tooltip":j.close},'<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="1280" viewBox="0 0 1280 1280" fill="currentColor"><path d="m1106.613281 251.039062-75.464843-75.414062-388.910157 388.960938-388.957031-388.960938-75.46875 75.414062 388.960938 388.960938-388.960938 388.960938 75.46875 75.414062 388.957031-388.960938 388.910157 388.960938 75.464843-75.414062-388.960937-388.960938zm0 0"/></svg>'),m=lt("div",{class:"title cols"},[lt("h6",{class:"col-spare"},n),s,h,f,d,v,p]);i&&nt(m,"unread");var g=null,w=null,b=null,y=null;if(c){Z(y=lt("button",{class:"wysiwyg"},[C=lt("span",{class:"contenteditable","data-placeholder":j.placeholder})]),"click",function(t){et(t),this.blur(),Pt(c,"warning")})}else{var x=lt("input",{type:"hidden",name:"chat",value:e||""}),k=lt("input",{type:"hidden",name:"chatwindow",value:""}),E=lt("input",{type:"hidden",name:"mission",value:"texting"}),z=void 0;t&&(z=lt("input",{type:"hidden",name:"name",value:t}));var T=void 0;l&&(T=lt("input",{type:"hidden",name:"user",value:l}));var C=lt("div",{contenteditable:!0,"data-placeholder":j.placeholder});b=lt("textarea",{name:"texting-text",cols:100,rows:1,required:!0,spellcheck:!1,"data-fileupload":""}),w=lt("div",{class:"wysiwyg"},[C,b]);var M=lt("button",{type:"submit",hidden:!0},j.submit);g=lt("form",{method:"POST",action:Y,acceptCharset:"UTF-8",enctype:"multipart/form-data"},[x,k,E,z,T,w,M])}var S=void 0;r||(S=lt("a",{class:"unveil"},"<hr>"));var H=lt("div",{class:"history"},S),B=lt("div",{class:"scrollbox"},H),I=lt("div",{class:"window"},[m,B,g,y]);pt(_,"append",I,!1);var L=null;w&&(L=bt(w,"chat"));var A=$.clientHeight||F.innerHeight,W=I.offsetHeight,q=B.offsetHeight;A<W&&st(B,{maxHeight:parseInt(A-(W-q))+"px"}),_t[u]={chat:e,user:l,name:t,textings:r||[],predecessor:o,win:I,title:m,scroll:B,list:H};var D=_t[u];if(R(),a&&P(),s&&Z(s,"click",function(t){et(t),this.blur();var n=null,i=lt("input",{type:"text",size:"100",required:"required"}),e=lt("label",void 0,[ct(j.description),i]),a=lt("button",{type:"button",class:"button submit"},j.submit),r=lt("fieldset",void 0,[lt("legend",void 0,j.groupchat),e,a]),o=lt("form",{method:"GET",action:Y},[r]);Z(o,"submit",function(t){et(t);var e=i.value.trim();e&&(jt(null,e,l,e),n())}),Z(a,"click",function(t){et(t),this.blur(),tt(o,"submit")}),n=Pt(o,"input")}),h&&Z(h,"click",function(t){et(t),this.blur(),D.chat&&Ut({chat:D.chat,mission:"join"})}),f&&Z(f,"click",function(t){et(t),this.blur(),D.chat&&Ut({chat:D.chat,mission:"leave"},function(t){ft(t.overlay,"form").forEach(function(t){Z(t,"submit",U)})})}),Z(v,"click",function(t){et(t),this.blur(),D.chat&&Ut({chat:D.chat,mission:"clear"},function(t){ft(t.overlay,"form").forEach(function(t){Z(t,"submit",U)})})}),Z(d,"click",function(t){et(t),this.blur(),U(),Wt(e?{chat:e}:{chat:"",user:l})}),Z(p,"click",function(t){et(t),this.blur(),P(),U()}),b){var N=!1;Z(b,"focus",function(){N||P(),N=!1}),Z(b,"blur",function(){var t=X.activeElement;N=w&&t&&rt(w,t)})}if(w&&(Z(w,"click",P),Z(w,"input",P),Z(w,"change",P)),Z(B,"wheel",P),g&&Z(g,"submit",function(t){if(et(t),L){var e=X.implementation.createHTMLDocument("");if(e.body.innerHTML=L.getHTML(),0==(e.body.textContent||"").replace(/[\r\n ]/,"").length&&0==ft(e.body,"a,figure,img,svg,picture,video,audio,iframe").length)return}var n={window:""};D.predecessor&&(n.predecessor=D.predecessor),Vt(g,n,function(t){if(t.main){var e=Yt(t.main);0!=e.length&&($t(D,null,e),ee())}})}),S)V(S,t?{chat:"",name:t,window:""}:l?{chat:"",user:l,window:""}:{chat:e,window:""});else r&&($t(D,null,r),ee());var O=K(function(){ft(B,"[data-unveil]").forEach(function(t){var e=t.offsetTop-B.scrollTop,n=t.offsetHeight,i=B.offsetHeight,a=1*i/3;if(!(e+n+a<0||i+a<e||G(t,"unveil"))){J(t,"unveil",!0);var r=ot(t,"data-unveil");r&&(r.window="",V(t,r))}})},50);Z(B,"scroll",O),Z(m,"mousedown",function(t){if(t.preventDefault(),rt(m,t.target)&&!ht(t.target,"button",!0)){J(I,"moved",!0);var e=I.getBoundingClientRect(),l=t.clientX-e.left,c=t.clientY-e.top,u=null;Z($,"mousemove",n),Z($,"touchmove",n),Z($,"mouseup",i),Z($,"touchend",i)}function n(o){u||(u=setTimeout(function(){u=null;var t=$.clientWidth||F.innerWidth,e=$.clientHeight||F.innerHeight,n=I.offsetWidth,i=I.offsetHeight,a=t-n-Math.min(Math.max(parseInt(o.clientX-l),0),t-n),r=e-i-Math.min(Math.max(parseInt(o.clientY-c),0),e-i);st(I,{right:a+"px",bottom:r+"px"})},50))}function i(t){Q($,"mousemove",n),Q($,"touchmove",n),Q($,"mouseup",i),Q($,"touchend",i)}})}}function R(){var t=ft($,".window").filter(function(t){return!G(t,"moved")}),e=10;t.forEach(function(t){st(t,{right:e+"px",bottom:"10px"}),e+=t.offsetWidth+10})}function U(){ut(D.win),delete _t[u],ee(),R()}function P(){if(it(m,"unread")){at(m,"unread");var t=D.chat?{chat:D.chat}:{chat:"",user:l};(function(t){if(!Kt||Kt.readyState!=F.WebSocket.OPEN)return!1;var e=JSON.stringify(t);return Kt.send(e),!0})(t)||vt(!1,void 0,t)}}function V(e,t){vt(!1,void 0,t,function(t){t.main&&($t(D,e,t.main),ee()),ut(e)},function(){ut(e)})}}var Gt={},Jt=function(t){function u(t){var e=X.implementation.createHTMLDocument("");return e.body.innerHTML=t,e.body.firstChild}t&&Array.isArray(t)&&t.reverse().forEach(function(t){if("chat"in t){var e=t.chat,n=null;e.users.forEach(function(t){n=t.id});var i=!!e.properties&&e.properties.unread,a=t.caption,r=[];t.html.forEach(function(t){var e=u(t);r.push(e)});var o=null;t.textings.forEach(function(t){"predecessor"==t.type&&(o=t.query.predecessor)}),jt(e.id,e.name,n,a,i,!1,r,o)}else if("notification"in t){var l=t.notification,c=l.type+"-"+l.id;if(c in Gt)return;Gt[c]=!0,Xt(u(t.html))}})},Kt=null,Zt=null,Qt=null,te=function(t){var e={synchronizer:b};t&&(e.quiesced=t);var n=H(e,("http:"==location.protocol?"ws://":"wss://")+location.hostname),i=new WebSocket(n,"html");i&&(Z(i,"open",function(t){Kt=i,Z(X,"visibilitychange",ie),ee(!0)}),Z(i,"message",function(t){var e=JSON.parse(t.data);Jt(e)}),Z(i,"close",function(t){Qt=Kt=null;var e=!1;switch(t.code){case 1012:case 1013:e=!0}e&&null===Zt&&setTimeout(function(){te()},1e3)}),Z(i,"error",function(t){Qt=Kt=null,Q(X,"visibilitychange",ie),console.warn("websocket error",t)}))};function ee(t){if(!Kt||Kt.readyState!=F.WebSocket.OPEN)return!1;var e=[];for(var n in _t){var i=_t[n];i.chat&&(i.predecessor&&e.push({type:"predecessor",query:{chat:i.chat,predecessor:i.predecessor}}))}if(!t||0!=e.length){var a=JSON.stringify(e);Qt!==a&&(Qt=a,Kt.send(a))}}var ne=null;function ie(){if(clearTimeout(ne),ne=null,"hidden"==X.visibilityState)Kt&&(ne=F.setTimeout(function(){Kt&&(Kt.close(1e3,"quiesce"),Qt=Kt=null,Zt=new Date)},6e4));else if(null!==Zt){var t=(new Date).getTime()-Zt.getTime();Zt=null,te(t)}}function ae(i,a,n){function r(t){var e=Yt(t.main,function(t){J(i,"predecessor",t)});0!=e.length&&pt(i,n,e,!0)}Z(i,"submit",function(t){et(t);var e=G(i,"predecessor"),n=y({},a,e?{predecessor:e}:{});Vt(i,n,r)})}l(function(){Jt(n),b&&"WebSocket"in F&&2===F.WebSocket.CLOSING&&te()}),d("details,.details",function(r){Z(r,"click",function(e){if(!c(r,"open")){var t=ft(r,".toggle");if(0!=t.length){var n=!1;if(t.forEach(function(t){rt(t,e.target)&&(n=!0)}),!n)return}et(e),this.blur();var i=r.offsetHeight;E(r,"open","open");var a=r.offsetHeight;if(i!=a)st(r,{height:i+"px",overflow:"hidden"}),k(a<=2*i?150:a<=5*i?300:450,function(t){st(r,{height:(a-i)*t+i+"px"})},function(){st(r,{height:null,overflow:null})})}})}),d("[data-datetime]",function(t,e){e&&J(t,"datetime",new Date)}),d(".dropdown",function(t){var a;nt(t,"lock"),Z(a=t,"click",function(){if(it(a,"open"))at(a,"open");else{var t=a.querySelector("ul");if(t&&"string"==typeof t.style.marginTop&&(st(t,{display:"none",marginTop:null}),t.offsetHeight,st(t,{display:null}),t.offsetHeight),nt(a,"open"),t){var e=F.innerHeight,n=t.getBoundingClientRect(),i=n.top+t.offsetHeight;e-1<i&&st(t,{marginTop:Math.max(1-n.top,e-1-i)+"px"})}}},!0)}),d("[data-external]",function(t){var e=L(t,"data-external");e&&wt(t,e)}),d("[data-popup]",function(t){var e=ot(t,"data-popup");e&&wt(t,e)}),d("input#login,input#aside",function(e){Z(e,"change",function(t){e.checked?R():U()})}),d("[data-scroll]",function(e){z(e,".active").forEach(function(t){e.scrollTop=Math.max(t.offsetTop-(e.offsetHeight-t.offsetHeight)/2,0)}),Z(e,"scroll",P)}),d("[data-unveil]",function(t){V(t)}),d("[data-load]",function(t){var e=ot(t,"data-load");e&&Z(t,"click",function(t){et(t),this.blur(),Wt(e)})}),d("[data-post]",function(t){var e=ot(t,"data-post");e&&Z(t,"click",function(t){et(t),this.blur(),Ot(e)})}),d("[data-album]",function(t){var e=ot(t,"data-album");e&&Z(t,"click",function(t){et(t),this.blur(),Ot(e,!0)})}),d("[data-dialog]",function(t){var e=ot(t,"data-dialog");e&&Z(t,"click",function(t){et(t),this.blur(),Ut(e)})}),d("[data-alert]",function(t){var e=L(t,"data-alert");Z(t,"click",function(t){et(t),this.blur(),Pt(e,"warning")})}),d("[data-chat]",function(t){var e=ot(t,"data-chat");e&&Z(t,"click",function(t){et(t),this.blur(),It(),jt(e.chat,e.name,e.user,e.caption,!1,!0,null,null,e.blocked)})}),d("[data-description]",function(t){setTimeout(function(){bt(t,"")})}),d("[data-document]",function(t){setTimeout(function(){bt(t,"image")})}),d("[data-posting]",function(t){setTimeout(function(){bt(t,"attachment")})}),d("[data-submit]",function(e){function n(t){if(ht(e,".overlay.dialog")&&t.main&&1==t.main.length&&!t.header&&!t.aside&&0==Yt(t.main).length)return void It();Lt(r(),!0,t.url,t.rtl,t.title,"obsolete"),At(t)}Z(e,"submit",function(t){et(t),Vt(e,null,n,!0)})}),d("[data-above]",function(t){ae(t,ot(t,"data-above"),"before")}),d("[data-below]",function(t){ae(t,ot(t,"data-below"),"after")}),d("[data-like]",function(t){var i=ht(t,".tile");i||(i=ht(t,".cols"));var a=ot(t,"data-like"),r=!1;Z(t,"click",function(t){if(et(t),this.blur(),!r){r=!0;var e=T(i,"form");e&&c(e,"data-above")&&(e=null);var n=e?G(e,"predecessor"):null;vt(!0,null,y({},a,n?{predecessor:n}:{}),function(t){e?(Yt(t.main,function(t){J(e,"predecessor",t)}),pt(e,"after",t.main,!0)):pt(i,"after",t.main,!0)})}})}),d("[data-sort]",function(e){var n=ot(e,"data-sort");Z(e,"click",function(t){et(t),this.blur(),function(t,e){var n=ht(t,"ol,ul"),i=ht(t,"li");if(n&&i){switch(e.mission){case"move-top":n.insertBefore(i,n.firstChild);break;case"move-up":n.insertBefore(i,i.previousElementSibling);break;case"move-down":i.nextElementSibling&&n.insertBefore(i,i.nextElementSibling.nextElementSibling);break;case"move-bottom":n.appendChild(i);break;case"delete":ut(i);break;default:return}vt(!0,void 0,e)}}(e,n)})}),d("input[type=file]",function(t){!function h(f,d,v){d&&!v&&A(v=f.cloneNode(),"required");var p=C(f,".button");p||(p=T(f,".button")),p=ht(f,"label"),Z(f,"change",function(t){if(t.target.files){var e=t.target.files,n=ht(f,"label.placeholder");if(n||nt(n=ht(f,"label"),"placeholder"),n){if(d){E(f,"hidden",""),n.parentNode.insertBefore(f,n);var i=v.cloneNode();W(n,i),h(i,d,v)}for(var a=[],r=0;r<e.length;++r)if(0!=(u=e[r]).size){var o=lt("span",{class:"file"},(u.type.match(/^image/i)?'<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="1280" viewBox="0 0 1280 1280" fill="currentColor"><path d="m875.414062 53.386719h-608.746093c-58.828125 0-106.667969 47.839843-106.667969 106.667969v960c0 58.824218 47.839844 106.664062 106.667969 106.664062h746.664062c58.828125 0 106.667969-47.839844 106.667969-106.664062v-822.082032zm-608.746093 1066.667969v-960h533.332031v213.332031h213.332031l.054688 746.667969zm0 0"/><path d="m640 853.441406-106.667969-106.667968-160 213.332031h533.335938l-160-320zm0 0"/><path d="m640 586.773438c0 58.910156-47.757812 106.667968-106.667969 106.667968-58.910156 0-106.664062-47.757812-106.664062-106.667968 0-58.910157 47.753906-106.667969 106.664062-106.667969 58.910157 0 106.667969 47.757812 106.667969 106.667969zm0 0"/></svg>':u.type.match(/^video/i)?'<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="1280" viewBox="0 0 1280 1280" fill="currentColor"><path d="m693.332031 640.375h-266.664062v320h266.664062v-120l160 120v-320l-160 120zm0 0"/><path d="m875.414062 53.546875h-608.746093c-58.828125 0-106.667969 47.894531-106.667969 106.667969v960c0 58.824218 47.839844 106.664062 106.667969 106.664062h746.664062c58.828125 0 106.667969-47.839844 106.667969-106.664062v-822.082032zm-608.746093 1066.667969v-960h533.332031v213.332031h213.332031l.054688 746.667969zm0 0"/></svg>':u.type.match(/^audio/i)?'<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="1280" viewBox="0 0 1280 1280" fill="currentColor"><path d="m875.414062 53.492188h-608.746093c-58.828125 0-106.667969 47.839843-106.667969 106.667968v960c0 58.828125 47.839844 106.667969 106.667969 106.667969h746.664062c58.828125 0 106.667969-47.839844 106.667969-106.667969v-822.082031zm-608.746093 1066.667968v-960h533.332031v213.332032h213.332031l.054688 746.667968zm0 0"/><path d="m586.667969 696c-8.640625-1.707031-17.546875-2.667969-26.667969-2.667969-73.652344 0-133.332031 59.734375-133.332031 133.335938 0 73.597656 59.679687 133.332031 133.332031 133.332031s133.332031-59.734375 133.332031-133.332031v-272.640625l140.375 46.773437 33.757813-101.226562-280.796875-93.601563zm0 0"/></svg>':'<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="1280" viewBox="0 0 1280 1280" fill="currentColor"><path d="m822.078125 106.667969h-502.078125c-58.828125 0-106.667969 47.890625-106.667969 106.664062v853.335938c0 58.824219 47.839844 106.664062 106.667969 106.664062h640c58.828125 0 106.667969-47.839843 106.667969-106.664062v-715.414063zm137.976563 960h-640.054688v-853.335938h426.667969v213.335938h213.332031zm0 0"/></svg>')+u.name);ft(o,"svg").forEach(function(t){nt(t,"icon")}),a.push(ct(" "),o)}if(0!=a.length){for(var l=n.firstChild;null!==l;){var c=l;if(l=l.nextSibling,c.nodeType==Node.ELEMENT_NODE){if(c.matches("input[type=file]"))continue;if(d&&c.matches(".file"))continue}ut(c)}W(n,a)}}if(p)for(r=0;r<e.length;++r){var u;if(0!=(u=e[r]).size&&!(16777216<u.size)&&u.type.match(/^image/i)){var s=new FileReader;s.onloadend=function(t){st(p,{backgroundImage:"url("+t.target.result+")",backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"})},s.readAsDataURL(u);break}}}})}(t,c(t,"multiple"))}),d("[data-validate]",function(i){if(i.setCustomValidity){var t=ht(i,"form");if(t){var a=ot(i,"data-validate"),r=L(i,"name");if(r){var o=N(),e=K(function(){if(i.value){var e=y({},a||{});for(var n in e)ft(t,"[name="+n+"]").forEach(function(t){t.value&&(e[n]=t.value)});e[r]=i.value,o(!0,void 0,e,function(t){var e="";t.main&&t.main.forEach(function(t){t.matches(".alert-danger")&&(e=t.textContent)}),i.setCustomValidity(e)})}},300,!0);Z(i,"input",e)}}}}),d("[data-repeatpassword]",function(e){var n=C(e,"input[type=password]");n&&Z(n,"change",function(){var t=n.value.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");E(e,"pattern",t)})}),d("[data-upload]",function(n){var t=ht(n,"form");if(t){var e=ft(t,"input[name=upload-file]"),i=ft(t,"input[name=upload-link]"),a=ft(t,"input[name=upload-title]"),r=ft(t,"textarea[name=upload-text]"),o=[];e.forEach(function(t){var e=ht(t,".upload.placeholder");o.push(e),Z(t,"change",function(t){ut([n].concat(i))})}),i.forEach(function(e){Z(e,"input",function(t){ut([n].concat(o,a)),E(e,"required","required"),r.forEach(function(t){A(t,"required")})})}),Z(n,"click",function(t){ut([n].concat(o,i)),r.forEach(function(t){E(t,"data-fileupload","")})})}}),d("[data-autocomplete]",function(t){var e=ot(t,"data-autocomplete"),n=L(t,"name"),i=ht(t,"form");n&&i&&function(l,c,e,n,u){if(!dt()||!u){E(c,"autocomplete","off");var s=c.offsetWidth,h=null,i=N(),t=K(function(){if(s=Math.max(s,c.offsetWidth),c.value){var t=y({},e);t[n]=c.value,i(!1,void 0,t,function(t){if(t.main||t.aside){if(h)M(h);else{h=lt("div",{class:"autocomplete"});var e=l.getBoundingClientRect(),n=c.getBoundingClientRect();st(h,{top:n.top-e.top+c.offsetHeight+1+"px",left:n.left-e.left+"px",maxWidth:s+"px"}),Z(h,"click",function(){f()},!0),Z($,"mouseup",d),Z($,"touchend",d),W(l,h)}if(u){var i=[];t.main&&(i=t.main.slice(0,5).map(function(t){return nt(t,"suggestion"),t}));var a=[];if(t.aside&&(a=t.aside.slice(0,3).map(function(t){return nt(t,"suggestion"),t})),0!=a.length){nt(h,"cols");var r=lt("div",{class:"col-spare"},i),o=lt("div",{class:"col-thumb"},a);pt(h,"append",[r,o],!1)}else at(h,"cols"),pt(h,"append",i,!1)}else i=[],t.main&&(i=t.main.slice(0,5).map(function(r){return nt(r,"suggestion"),Z(r,"click",function(t){et(t),this.blur();var e=null;ft(r,".richtext").forEach(function(t){e||(e=t.textContent)}),e||(e=r.textContent),c.value=e;var n=L(r,"data-id"),i=ht(c,"label");if(n&&i){var a=ft(i,"input[type=hidden]");1==a.length&&(a.shift().value=n)}f()}),r})),pt(h,"append",i,!1)}else f()})}else f()},300,!0);Z(c,"input",t)}function f(){h&&(Q($,"mouseup",d),Q($,"touchend",d),ut(h),h=null)}function d(t){h&&(rt(c,t.target)||rt(h,t.target)||f())}}(i,t,e,n,!1)}),d("[data-search]",function(i){var a=ot(i,"data-search"),r=L(i,"name"),t=ht(i,".modal"),n=t?t.querySelector(".main"):$.querySelector("main");if(r&&n){var o=N(),l=null,e=K(function(){c(i.value)},300,!0);Z(i,"input",e),Z(i,"keydown",function(t){"Escape"==t.key&&(c(),i.value="")})}function c(t){if(!t||t.length<3){if(null===l)return;return M(n),W(n,l),void(l=null)}var e=y({},a);e[r]=t,o(!1,void 0,e,function(t){null===l?l=M(n):M(n),t.main?(pt(n,"append",t.main,!1),ft(n,"[data-filter]").forEach(function(n){n.matches("input[type=checkbox]")?Z(n,"change",function(t){var e=!!n.checked;"babel"!=n.name&&"users"!=n.name||(e=!e),e?a[n.name]="":delete a[n.name],c(i.value)}):Z(n,"click",function(t){et(t),this.blur();var e=ot(n,"data-filter");r in e&&(i.value=e[r]),c(i.value)})})):c()})}}),d("[data-lightbox]",function(t){var n=ot(t,"data-lightbox");if(n){var i=!1;Z(t,"click",function(t){et(t),this.blur();var e=Array.isArray(n);!function(t,l){var c=[];l.forEach(function(t,e){var n=t.url?lt("img",{src:t.url,width:t.width,height:t.height,alt:""}):lt("div",{style:"width:"+("audio"==t.type?"80%":"100%")},t.html);0!=e&&ft(n,"video,audio").forEach(function(t){A(t,"autoplay")}),c.push(n)});var u=qt("lightbox",c,function(){var t=Bt.indexOf(u);-1!=t&&Bt.splice(t,1)});function e(t){var e=u.overlay.querySelector(".open");e&&(at(e,"open"),ft(e,"video,audio").forEach(function(t){t.pause()}));var n=c.indexOf(e);-1==n&&(n=0),-1==t?n=0!=n?n-1:c.length-1:1==t&&(n=n+1<c.length?n+1:0);var i=c[n];nt(i,"open"),ft(i,"video,audio").forEach(function(t){t.play()});var a=l[n],r="text"==a.type?2*a.width:a.width||512,o=a.height||128;st(u.overlay,{width:r/o*100+"vh",height:o/r*100+"vw"})}Bt.push(u);var n=lt("div",{class:"nav-close"},lt("button"));if(W(u.modal,n),1<l.length){var i=lt("button"),a=lt("div",{class:"nav-back"},i);Z(i,"click",function(t){et(t),this.blur(),e(-1)});var r=lt("button"),o=lt("div",{class:"nav-next"},r);Z(r,"click",function(t){et(t),this.blur(),e(1)}),W(u.modal,[a,o])}Z(u.overlay,"click",function(n){et(n),this.blur();var i=-1;c.forEach(function(t,e){rt(t,n.target)&&(i=e)}),-1==i||1==l.length?u.close():"url"in l[i]&&e(1)}),e(0)}(0,e?n:[n]),e||!n.notify||i||(vt(!1,null,n.notify),i=!0)})}}),d("[data-video]",function(t){var e=ot(t,"data-video");if(e){var n=c(t,"autoplay");setTimeout(function(){!function(e,n,t,i){var a="/icon/",r=$.querySelector("svg use");if(r){var o=r.getAttribute("xlink:href");o&&(a=o.replace(/#.*$/,""))}var l=[],c=null;ft(e,"source").forEach(function(t){var e=L(t,"type")||"",n=L(t,"src"),i=ot(t,"data-quality")||{};e.match(/^application\/x-mpegURL$/i)?c||(c=n):i&&(l.push([t,i.height]),i.width)}),l.sort(function(t,e){return t[1]-e[1]});for(var u=[4320,2880,2160,1440,1080,720,576,480,360,240],s=0;s<l.length;++s){for(var h=0,f=0;f<u.length&&(h=f,!(l[s][1]>=u[f]));++f);E(l[s][0],"size",u[h]),u.splice(h)}var d=F.Hls,v=null;d&&d.isSupported()&&function(){var t=F.MediaSource;if(!t)return!1;var e=t.isTypeSupported;if("function"!=typeof e)return!1;for(var n=['video/mp4; codecs="avc1.42c01e,mp4a.40.5"','video/mp4; codecs="avc1.4d401f,mp4a.40.5"'],i=0;i<n.length;++i)if(!e(n[i]))return!1;return!0}()&&c&&(v=c);var p=new Plyr(e,{autoplay:n,volume:1,iconUrl:a,controls:["play-large","play","progress","current-time","volume","settings","captions","pip","airplay","fullscreen"],settings:["quality"],blankVideo:null,keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},storage:{enabled:!1,key:"plyr"},duration:null,previewThumbnails:t?{enabled:!0,src:t}:{enabled:!1}}),m=null;v&&((m=new d).loadSource(v),m.attachMedia(e),p.on("languagechange",function(){setTimeout(function(){m.subtitleTrack=p.currentTrack},50)})),p.once("ready",function(){if(rt($,e)){if(n){var t=/^#(\d+)$/.exec(F.location.hash||"");t&&(p.currentTime=parseInt(t[1])),p.play()}}else p.stop()});var g=!1;p.on("play",function(){m&&m.startLoad(),i&&!g&&(vt(!1,null,i),g=!0)}),p.on("pause",function(){m&&m.stopLoad()}),p.on("qualitychange",function(t){})}(t,n,e.thumbnail,e.notify)})}}),d("[data-book]",function(t){var e=ot(t,"data-book");e&&e.pages&&setTimeout(function(){Ft(t,e.pages,e.notify)})}),d("[data-social]",function(t){var n=ot(t,"data-social"),e=lt("ul",void 0,[{name:"Facebook",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="1280" viewBox="0 0 1280 1280" fill="currentColor"><path d="m499.960938 691.328125v436.289063h212.226562v-434.21875h144.882812l35.078126-181.015626h-178.4375v-132.8125c0-18.320312 9.804687-42.851562 39.492187-42.851562h103.164063v-184.335938h-192.578126c-66.445312 0-164.492187 81.835938-164.492187 168.828126v186.015624h-111.367187v183.320313zm0 0"/></svg>',url:"https://www.facebook.com/sharer.php?u=[url]&t=[title]"},{name:"Twitter",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="1280" viewBox="0 0 1280 1280" fill="currentColor"><path d="m1127.617188 337.539062c-35.859376 15.898438-74.375 26.679688-114.921876 31.523438 41.328126-24.765625 73.046876-63.984375 88.007813-110.703125-38.671875 22.890625-81.523437 39.570313-127.03125 48.554687-36.484375-38.867187-88.515625-63.203124-146.09375-63.203124-110.46875 0-200.039063 89.570312-200.039063 200.039062 0 15.742188 1.71875 31.015625 5.195313 45.625-166.328125-8.320312-313.75-88.007812-412.382813-209.023438-17.226562 29.570313-27.148437 63.945313-27.148437 100.585938 0 69.453125 35.351563 130.664062 89.023437 166.523438-32.773437-1.015626-63.632812-10-90.625-25-.039062.820312-.039062 1.679687-.039062 2.5 0 96.953124 68.984375 177.8125 160.546875 196.210937-16.796875 4.53125-34.492187 6.953125-52.695313 6.953125-12.929687 0-25.429687-1.25-37.65625-3.515625 25.46875 79.453125 99.375 137.304687 186.914063 138.945313-68.476563 53.671874-154.726563 85.625-248.476563 85.625-16.132812 0-32.070312-.898438-47.734374-2.8125 88.515624 56.796874 193.671874 89.921874 306.679687 89.921874 368.085937 0 569.335937-304.882812 569.335937-569.257812 0-8.710938-.195312-17.34375-.585937-25.9375 38.984375-28.164062 72.890625-63.4375 99.726563-103.554688"/></svg>',url:"https://twitter.com/intent/tweet?text=[title]&url=[url]&counturl=[url]&hashtags="},{name:"Reddit",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="1280" viewBox="0 0 1280 1280" fill="currentColor"><path d="m350.46875 712.382812c0 40 32.421875 72.382813 72.382812 72.382813 40 0 72.382813-32.382813 72.382813-72.382813 0-39.960937-32.382813-72.382812-72.382813-72.382812-39.960937 0-72.382812 32.421875-72.382812 72.382812zm434.296875 0c0 40 32.382813 72.382813 72.382813 72.382813 39.960937 0 72.382812-32.382813 72.382812-72.382813 0-39.960937-32.421875-72.382812-72.382812-72.382812-40 0-72.382813 32.421875-72.382813 72.382812zm3.515625 154.6875c18.632812-14.6875 45.664062-11.523437 60.351562 7.148438 14.648438 18.59375 11.445313 45.664062-7.148437 60.3125-51.953125 40.9375-130.976563 67.34375-201.484375 67.34375s-149.53125-26.40625-201.40625-67.34375c-18.710938-14.648438-21.875-41.71875-7.1875-60.3125 14.648438-18.59375 41.71875-21.875 60.3125-7.148438 29.921875 23.515626 89.023438 48.90625 148.28125 48.90625s118.359375-25.390624 148.28125-48.90625zm430.78125-299.453124c0-79.960938-64.882812-144.765626-144.765625-144.765626-54.414063 0-101.796875 30.039063-126.484375 74.453126-74.414062-40.703126-165.117188-66.992188-263.789062-73.046876l86.289062-193.984374 165.390625 47.734374c14.882813 42.1875 55.117187 72.5 102.421875 72.5 59.921875 0 108.554688-48.59375 108.554688-108.59375 0-59.960937-48.632813-108.59375-108.554688-108.59375-41.328125 0-77.304688 23.125-95.664062 57.109376l-184.21875-53.125c-20.585938-5.976563-42.460938 4.179687-51.210938 23.789062l-117.304688 263.515625c-96.328124 6.796875-184.765624 32.8125-257.460937 72.65625-24.804687-44.414063-72.148437-74.453125-126.5625-74.453125-79.882813 0-144.765625 64.804688-144.765625 144.765625 0 59.179687 35.507812 109.921875 86.367188 132.460937-9.0625 27.148438-13.984376 55.507813-13.984376 84.6875 0 199.882813 226.835938 361.914063 506.679688 361.914063s506.679688-162.03125 506.679688-361.914063c0-29.179687-4.84375-57.578124-14.023438-84.6875 50.898438-22.421874 86.40625-73.28125 86.40625-132.421874zm-180.9375-366.40625c22.460938 0 40.703125 18.203124 40.703125 40.703124s-18.242187 40.703126-40.703125 40.703126c-22.5 0-40.742188-18.203126-40.742188-40.703126s18.203126-40.703124 40.742188-40.703124zm-904.804688 366.40625c0-39.882813 32.460938-72.382813 72.382813-72.382813 28.828125 0 53.789063 16.992187 65.429687 41.445313-37.851562 28.671874-69.21875 61.796874-92.382812 98.125-26.601562-10.703126-45.429688-36.796876-45.429688-67.1875zm506.679688 493.125c-232.34375 0-420.742188-123.554688-420.742188-275.976563 0-152.382813 188.398438-275.976563 420.742188-275.976563s420.742188 123.554688 420.742188 275.976563-188.398438 275.976563-420.742188 275.976563zm461.25-425.9375c-23.203125-36.328126-54.53125-69.453126-92.382812-98.125 11.640624-24.453126 36.601562-41.445313 65.429687-41.445313 39.921875 0 72.382813 32.5 72.382813 72.382813 0 30.390624-18.828126 56.484374-45.429688 67.1875zm0 0"/><path d="m495.234375 712.382812c0 39.960938-32.382813 72.382813-72.382813 72.382813-39.960937 0-72.382812-32.421875-72.382812-72.382813 0-39.960937 32.421875-72.382812 72.382812-72.382812 40 0 72.382813 32.421875 72.382813 72.382812zm0 0"/><path d="m788.28125 867.070312c-29.921875 23.515626-89.023438 48.90625-148.28125 48.90625s-118.359375-25.390624-148.28125-48.90625c-18.59375-14.6875-45.664062-11.445312-60.3125 7.148438-14.6875 18.59375-11.523438 45.664062 7.1875 60.3125 51.875 40.9375 130.898438 67.34375 201.40625 67.34375s149.53125-26.40625 201.484375-67.34375c18.59375-14.648438 21.796875-41.71875 7.148437-60.3125-14.6875-18.671875-41.679687-21.835938-60.351562-7.148438zm0 0"/><path d="m929.53125 712.382812c0 39.960938-32.421875 72.382813-72.382812 72.382813-40 0-72.382813-32.421875-72.382813-72.382813 0-39.960937 32.382813-72.382812 72.382813-72.382812 39.960937 0 72.382812 32.421875 72.382812 72.382812zm0 0"/><path d="m1219.0625 567.617188c0-79.960938-64.882812-144.765626-144.765625-144.765626-54.414063 0-101.796875 30.039063-126.484375 74.453126-74.414062-40.703126-165.117188-66.992188-263.789062-73.046876l86.289062-193.984374 165.390625 47.734374c14.882813 42.1875 55.117187 72.5 102.421875 72.5 59.921875 0 108.554688-48.59375 108.554688-108.59375 0-59.960937-48.632813-108.59375-108.554688-108.59375-41.328125 0-77.304688 23.125-95.664062 57.109376l-184.21875-53.125c-20.585938-5.976563-42.460938 4.179687-51.210938 23.789062l-117.304688 263.515625c-96.328124 6.796875-184.765624 32.8125-257.460937 72.65625-24.804687-44.414063-72.148437-74.453125-126.5625-74.453125-79.882813 0-144.765625 64.804688-144.765625 144.765625 0 59.179687 35.507812 109.921875 86.367188 132.460937-9.0625 27.148438-13.984376 55.507813-13.984376 84.6875 0 199.882813 226.835938 361.914063 506.679688 361.914063s506.679688-162.03125 506.679688-361.914063c0-29.179687-4.84375-57.578124-14.023438-84.6875 50.898438-22.421874 86.40625-73.28125 86.40625-132.421874zm-180.9375-366.40625c22.460938 0 40.703125 18.203124 40.703125 40.703124s-18.242187 40.703126-40.703125 40.703126c-22.5 0-40.742188-18.203126-40.742188-40.703126s18.203126-40.703124 40.742188-40.703124zm-904.804688 366.40625c0-39.882813 32.460938-72.382813 72.382813-72.382813 28.828125 0 53.789063 16.992187 65.429687 41.445313-37.851562 28.671874-69.21875 61.796874-92.382812 98.125-26.601562-10.703126-45.429688-36.796876-45.429688-67.1875zm506.679688 493.125c-232.34375 0-420.742188-123.554688-420.742188-275.976563 0-152.382813 188.398438-275.976563 420.742188-275.976563s420.742188 123.554688 420.742188 275.976563-188.398438 275.976563-420.742188 275.976563zm461.25-425.9375c-23.203125-36.328126-54.53125-69.453126-92.382812-98.125 11.640624-24.453126 36.601562-41.445313 65.429687-41.445313 39.921875 0 72.382813 32.5 72.382813 72.382813 0 30.390624-18.828126 56.484374-45.429688 67.1875zm0 0"/></svg>',url:"https://www.reddit.com/submit?url=[url]&title=[title]"},{name:"VK",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="1280" viewBox="0 0 1280 1280" fill="currentColor"><path d="m1122.421875 864.257812c-1.171875-2.5-2.265625-4.609374-3.28125-6.328124-16.953125-30.46875-49.257813-67.890626-96.992187-112.226563l-1.523438-1.523437-.507812-.546876h-.546876c-21.640624-20.664062-35.390624-34.53125-41.132812-41.601562-10.507812-13.554688-12.851562-27.304688-7.109375-41.171875 4.0625-10.46875 19.335937-32.617187 45.742187-66.484375 13.867188-17.929688 24.84375-32.34375 32.96875-43.164062 58.554688-77.890626 83.945313-127.617188 76.171876-149.296876l-3.046876-5.078124c-1.992187-3.046876-7.265624-5.820313-15.742187-8.398438-8.4375-2.5-19.296875-2.929688-32.5-1.25l-146.210937.976562c-2.382813-.820312-5.78125-.742187-10.195313.273438-4.375 1.015625-6.5625 1.523438-6.5625 1.523438l-2.578125 1.25-1.992188 1.523437c-1.71875 1.015625-3.554687 2.773437-5.625 5.351563-1.992187 2.539062-3.671874 5.46875-5.039062 8.90625-15.9375 40.9375-34.023438 79.023437-54.335938 114.257812-12.5 20.976562-24.023437 39.179688-34.53125 54.570312-10.507812 15.390626-19.296874 26.71875-26.40625 34.023438-7.109374 7.265625-13.554687 13.085938-19.296874 17.5-5.742188 4.414062-10.15625 6.289062-13.242188 5.625-3.046875-.664062-5.859375-1.367188-8.59375-2.03125-4.726562-3.085938-8.554688-7.226562-11.445312-12.460938-2.851563-5.234374-4.804688-11.835937-5.820313-19.804687s-1.601563-14.804687-1.796875-20.585937c-.15625-5.703126-.078125-13.867188.273438-24.375.351562-10.46875.507812-17.578126.507812-21.328126 0-12.851562.273438-26.796874.78125-41.914062.507812-15.039062.898438-26.992188 1.25-35.78125s.507812-18.085938.507812-27.929688-.625-17.539062-1.757812-23.085937c-1.210938-5.585937-3.007812-11.015625-5.351562-16.25-2.382813-5.234375-5.859376-9.335937-10.429688-12.1875-4.53125-2.890625-10.234375-5.15625-16.992188-6.875-17.929687-4.0625-40.820312-6.289063-68.554687-6.601563-62.929687-.664062-103.4375 3.359376-121.328125 12.1875-7.109375 3.710938-13.554688 8.789063-19.335938 15.234376-6.054687 7.421874-6.953124 11.523437-2.539062 12.1875 20.3125 3.046874 34.726562 10.3125 43.164062 21.835937l3.046876 6.09375c2.382812 4.414063 4.765624 12.1875 7.109374 23.359375 2.382813 11.171875 3.90625 23.515625 4.570313 37.070312 1.71875 24.726563 1.71875 45.859376 0 63.476563s-3.28125 31.289063-4.804687 41.132813c-1.5625 9.804687-3.828126 17.773437-6.914063 23.867187-3.046875 6.09375-5.039063 9.804687-6.054687 11.171875-1.015626 1.328125-1.875 2.1875-2.539063 2.5-4.453125 1.679688-8.984375 2.539062-13.710937 2.539062-4.765626 0-10.507813-2.382812-17.226563-7.109374-6.796875-4.726563-13.828125-11.25-21.09375-19.53125-7.265625-8.320313-15.507813-19.921876-24.648437-34.804688-9.140626-14.882812-18.59375-32.460938-28.4375-52.8125l-8.125-14.726562c-5.078126-9.453126-12.03125-23.28125-20.859376-41.367188-8.75-18.085938-16.5625-35.625-23.320312-52.539062-2.734375-7.109376-6.796875-12.539063-12.1875-16.25l-2.539062-1.523438c-1.71875-1.328125-4.414063-2.773438-8.125-4.335938-3.75-1.523437-7.617188-2.617187-11.71875-3.28125l-139.101563 1.054688c-14.21875 0-23.867187 3.164062-28.945313 9.609375l-1.992187 3.046875c-.9375 1.757812-1.445313 4.492188-1.445313 8.242188 0 3.710937 1.015626 8.28125 3.046876 13.710937 20.3125 47.734375 42.421874 93.75 66.289062 138.125 23.828125 44.335937 44.570312 80.039063 62.148438 107.109375 17.617187 27.070312 35.585937 52.617188 53.867187 76.640625 18.28125 24.0625 30.390625 39.492187 36.289063 46.25 5.9375 6.796875 10.585937 11.835937 13.984374 15.234375l12.65625 12.148438c8.164063 8.125 20.078126 17.851562 35.820313 29.21875 15.742187 11.328124 33.203125 22.5 52.304687 33.554687 19.140626 10.9375 41.367188 19.921875 66.757813 26.875s50.117187 9.726563 74.140625 8.359375h58.398438c11.875-1.015625 20.820312-4.726562 26.914062-11.132812l2.03125-2.578126c1.367188-1.992187 2.617188-5.15625 3.789062-9.375 1.171876-4.257812 1.796876-8.90625 1.796876-13.945312-.351563-14.570312.742187-27.695312 3.28125-39.375 2.5-11.679688 5.390624-20.46875 8.632812-26.367188 3.203125-5.9375 6.875-10.9375 10.898438-14.960937 4.0625-4.101563 6.953124-6.523437 8.632812-7.382813 1.71875-.820312 3.046875-1.445312 4.0625-1.757812 8.125-2.734375 17.695312-.117188 28.671875 7.851562 11.015625 7.929688 21.328125 17.773438 31.015625 29.453126 9.609375 11.679687 21.210938 24.804687 34.804688 39.335937 13.554687 14.570313 25.390624 25.390625 35.507812 32.5l10.15625 6.054687c6.796875 4.101563 15.585938 7.8125 26.40625 11.210938 10.820312 3.359375 20.273438 4.21875 28.4375 2.539062l130-2.03125c12.851562 0 22.851562-2.109374 29.960938-6.328124 7.109374-4.257813 11.289062-8.90625 12.65625-13.984376 1.40625-5.078124 1.445312-10.820312.273437-17.265624-1.210937-6.445313-2.382813-10.9375-3.59375-13.515626zm0 0"/></svg>',url:"https://vk.com/share.php?url=[url]"},{name:"Weibo",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="1280" viewBox="0 0 1280 1280" fill="currentColor"><path d="m912.773438 643.945312c-15.9375-4.84375-26.914063-8.164062-18.554688-29.53125 18.125-46.328124 20.039062-86.367187.390625-114.921874-36.835937-53.515626-137.539063-50.703126-252.96875-1.445313 0-.078125-36.25 16.132813-27.03125-13.125 17.8125-58.125 15.078125-106.835937-12.539063-134.921875-62.617187-63.789062-229.179687 2.382812-372.109374 147.8125-106.914063 108.867188-169.023438 224.296875-169.023438 324.101562 0 190.859376 240.46875 318.59375 475.742188 318.59375 308.398437 0 513.632812-194.023437 513.632812-338.828124 0-87.539063-72.382812-137.1875-137.539062-157.734376zm-375.429688 410.9375c-187.734375 18.632813-349.804688-66.679687-361.992188-190.625-12.148437-123.945312 130.15625-239.53125 317.890626-258.203124 187.734374-18.671876 349.804687 66.679687 361.992187 190.546874 12.070313 123.984376-130.078125 239.609376-317.890625 258.28125zm0 0"/><path d="m1219.0625 488.515625c-.078125-192.773437-156.40625-349.023437-349.140625-349.023437-22.578125 0-40.820313 18.28125-40.820313 40.78125s18.242188 40.703124 40.820313 40.703124c147.8125 0 267.617187 119.882813 267.617187 267.695313 0 22.5 18.320313 40.742187 40.78125 40.742187 22.5 0 40.742188-18.242187 40.742188-40.742187 0 0 0-.117187 0-.15625zm0 0"/><path d="m1057.1875 482.578125c-18.59375-90.859375-90.3125-162.578125-181.210938-181.171875-21.992187-4.492188-43.554687 9.648438-48.046874 31.679688-4.53125 22.070312 9.648437 43.59375 31.640624 48.125 59.140626 12.109374 105.703126 58.671874 117.8125 117.734374 4.53125 22.070313 26.09375 36.25 48.085938 31.71875 22.070312-4.570312 36.25-26.054687 31.71875-48.085937zm0 0"/><path d="m440.976562 727.5c-75.585937 15.195312-126.601562 78.632812-113.90625 141.640625 12.65625 63.007813 84.21875 101.757813 159.84375 86.523437 75.585938-15.195312 126.601563-78.632812 113.90625-141.640624-12.65625-63.007813-84.257812-101.757813-159.84375-86.523438zm0 0"/></svg>',url:"https://service.weibo.com/share/share.php?url=[url]"},{name:"LinkedIn",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="1280" viewBox="0 0 1280 1280" fill="currentColor"><path d="m373.203125 263.4375c0 57.617188-42.539063 104.21875-112.460937 104.21875-65.859376 0-108.359376-46.601562-108.359376-104.21875 0-58.984375 43.945313-104.257812 111.132813-104.257812 67.148437 0 108.320313 45.273437 109.6875 104.257812m-215.273437 186.5625h208.4375v670.78125h-208.4375zm333.242187 213.984375c0-83.671875-2.773437-153.632813-5.546875-213.984375h181.054688l9.648437 93.359375h4.101563c27.382812-43.945313 94.648437-108.398437 207.109374-108.398437 137.148438 0 240.039063 91.914062 240.039063 289.414062v396.484375h-208.476563v-371.796875c0-86.40625-30.234374-145.429688-105.664062-145.429688-57.578125 0-91.835938 39.804688-106.953125 78.164063-5.546875 13.710937-6.914063 32.929687-6.914063 52.148437v386.835938h-208.476562v-456.796875zm0 0"/></svg>',url:"https://www.linkedin.com/shareArticle?mini=true&title=[title]&url=[url]"},{name:"Tumblr",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="1280" viewBox="0 0 1280 1280" fill="currentColor"><path d="m700.898438 579.0625v222.96875c0 56.601562-.742188 89.21875 5.273437 105.273438 5.9375 15.9375 20.898437 32.5 37.148437 42.070312 21.601563 12.96875 46.210938 19.414062 73.984376 19.414062 49.414062 0 78.554687-6.484374 127.382812-38.59375v146.601563c-41.601562 19.609375-77.96875 31.054687-111.71875 38.984375-33.828125 7.851562-70.390625 11.835938-109.609375 11.835938-44.648437 0-70.9375-5.625-105.15625-16.835938-34.257813-11.289062-63.476563-27.421875-87.65625-48.125-24.21875-20.898438-41.015625-43.085938-50.351563-66.523438-9.296874-23.476562-13.984374-57.539062-13.984374-102.148437v-341.992187h-130.898438v-138.085938c38.28125-12.421875 81.132812-30.273438 108.4375-53.476562 27.304688-23.28125 49.21875-51.171876 65.742188-83.75 16.601562-32.539063 27.96875-74.0625 34.179687-124.296876h157.226563v243.789063h243.789062v182.890625zm0 0"/></svg>',url:"https://www.tumblr.com/share/link?url=[url]&title=[title]"},{name:"Pinterest",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="1280" viewBox="0 0 1280 1280" fill="currentColor"><path d="m1012.539062 131.171875c-88.085937-84.570313-210.039062-131.171875-343.320312-131.171875-203.632812 0-328.828125 83.476562-398.046875 153.476562-85.273437 86.289063-134.179687 200.859376-134.179687 314.335938 0 142.460938 59.570312 251.835938 159.375 292.539062 6.71875 2.734376 13.476562 4.101563 20.078124 4.101563 21.054688 0 37.734376-13.75 43.515626-35.859375 3.359374-12.695312 11.171874-43.945312 14.570312-57.539062 7.265625-26.796876 1.367188-39.726563-14.453125-58.398438-28.867187-34.140625-42.304687-74.53125-42.304687-127.109375 0-156.09375 116.25-322.03125 331.71875-322.03125 170.976562 0 277.148437 97.148437 277.148437 253.59375 0 98.671875-21.25 190.117187-59.882813 257.382813-26.835937 46.757812-74.023437 102.5-146.445312 102.5-31.328125 0-59.453125-12.890626-77.226562-35.3125-16.757813-21.210938-22.304688-48.59375-15.546876-77.148438 7.617188-32.265625 18.007813-65.898438 28.046876-98.4375 18.359374-59.414062 35.703124-115.546875 35.703124-160.3125 0-76.5625-47.070312-128.046875-117.148437-128.046875-89.023437 0-158.789063 90.429687-158.789063 205.898437 0 56.601563 15.039063 98.984376 21.835938 115.234376-11.210938 47.5-77.851562 330.078124-90.507812 383.359374-7.304688 31.09375-51.367188 276.757813 21.5625 296.328126 81.875 22.03125 155.117187-217.226563 162.578124-244.257813 6.015626-21.992187 27.148438-105.15625 40.117188-156.25 39.53125 38.085937 103.203125 63.828125 165.15625 63.828125 116.796875 0 221.796875-52.539062 295.742188-147.96875 71.679687-92.539062 111.171874-221.523438 111.171874-363.203125 0-110.742187-47.539062-219.921875-130.46875-299.53125zm0 0"/></svg>',url:"https://pinterest.com/pin/create/bookmarklet/?is_video=false&url=[url]&media=&description=[title]"}].map(function(t){var e=lt("a",{href:t.url.replace(/\[url\]/g,encodeURIComponent(n.url)).replace(/\[title\]/g,encodeURIComponent(n.text)),target:"_blank"},t.icon+t.name);return ft(e,"svg").forEach(function(t){nt(t,"icon")}),lt("li",void 0,e)}));t.parentNode.insertBefore(e,t.nextSibling)}),d("[data-embed]",function(t){var e=L(t,"data-embed");if(e){var n=ht(t,"form"),i=t.querySelector("input[type=checkbox]"),a=n.querySelector("textarea");i&&a&&(Z(i,"change",function(){var t=a.value;a.value=e,e=t}),Z(a,"click",function(){this.blur(),this.focus(),this.select()}))}}),"chrome"in F&&d("use",function(t,e){e&&t.parentNode.replaceChild(t.cloneNode(),t)}),("ActiveXObject"in F||(i.userAgent.match(/\bEdge\/12\.(\d+)\b/)||[])[1]<10547||(i.userAgent.match(/\bAppleWebKit\/(\d+)\b/)||[])[1]<537)&&d("svg",function(t){var e=t.querySelector("use");if(e){var n=lt("img",{src:"/icon/"+e.getAttribute("xlink:href").replace(/.*#/,""),width:"24",height:"24",class:t.getAttribute("class")});t.parentNode.replaceChild(n,t)}}),l(function(){O($)})}(window,document);
