From c7c2c1ade2cca00eef415ed9008a876fdae8f983 Mon Sep 17 00:00:00 2001 From: iyak Date: Thu, 3 Apr 2025 04:57:19 +0000 Subject: [PATCH] =?UTF-8?q?6709=20=EC=99=B8=20jquery-ui=20cdn=EB=A7=81?= =?UTF-8?q?=ED=81=AC=20=EB=A1=9C=EC=BB=AC=EB=B3=80=EA=B2=BD,=20=EB=B0=8F?= =?UTF-8?q?=20zipfile=20=EB=A1=9C=EC=A7=81=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BO/BO.csproj | 1 + BO/Views/MM/popups.cshtml | 2 +- .../Shared/Partial/ExcelCommentBox.cshtml | 2 +- BO/Views/Shared/_Layout.cshtml | 48 +- BO/Views/cm/cgs.cshtml | 12 +- BO/Views/cm/cms.cshtml | 2 +- BO/Views/cm/ctr.cshtml | 2 +- BO/Web.config | 5 +- .../images/ui-icons_444444_256x240.png | Bin 0 -> 7006 bytes .../images/ui-icons_555555_256x240.png | Bin 0 -> 7074 bytes .../images/ui-icons_777620_256x240.png | Bin 0 -> 4676 bytes .../images/ui-icons_777777_256x240.png | Bin 0 -> 7013 bytes .../images/ui-icons_cc0000_256x240.png | Bin 0 -> 4632 bytes .../images/ui-icons_ffffff_256x240.png | Bin 0 -> 6313 bytes BO/css/jquery-ui-1.12.1/jquery-ui.min.css | 7 + BO/favicon.ico | Bin 0 -> 6458 bytes BO/js/jquery-ui.min.js | 44 ++ BO/js/site.js | 378 +++++++++-- Base/Controller/ACommonCM.cs | 2 + Base/Controller/ACommonCRoom.cs | 6 + Base/Controller/BasePartialController.cs | 62 +- Base/Controller/FCommonCRoom.cs | 91 ++- Base/Lib/Helpers.cs | 91 ++- Dao/MyBatis/Maps/CRoom.xml | 40 +- FO/Controllers/CRoomController.cs | 640 +++++++++++++++--- FO/Controllers/CourseController.cs | 12 +- FO/Controllers/MyController.cs | 94 ++- FO/FO.csproj | 11 + FO/Views/CRoom/Estimation.cshtml | 85 ++- FO/Views/CRoom/EstimationSubject.cshtml | 46 +- FO/Views/CRoom/Index.cshtml | 61 +- FO/Views/CRoom/Innings.cshtml | 74 +- FO/Views/Home/Index.cshtml | 4 +- FO/Views/My/Index.cshtml | 102 ++- FO/Views/Shared/Partial/JS.cshtml | 8 +- FO/Views/Shared/Partial/ScriptDate.cshtml | 5 +- FO/Views/Shared/_LayoutContents.cshtml | 2 +- FO/Web.config | 9 +- .../images/ui-icons_444444_256x240.png | Bin 0 -> 7006 bytes .../images/ui-icons_555555_256x240.png | Bin 0 -> 7074 bytes .../images/ui-icons_777620_256x240.png | Bin 0 -> 4676 bytes .../images/ui-icons_777777_256x240.png | Bin 0 -> 7013 bytes .../images/ui-icons_cc0000_256x240.png | Bin 0 -> 4632 bytes .../images/ui-icons_ffffff_256x240.png | Bin 0 -> 6313 bytes FO/css/jquery-ui-1.12.1/jquery-ui.min.css | 7 + FO/js/jquery-ui.min.js | 44 ++ FO/js/polyfill.min.js | 1 + FO/js/site.js | 598 ++++++++++++---- FO/js/video.js | 30 + FO/js/videojs-ie8.min.js | 1 + Model/CRoom.cs | 37 + Model/Model.csproj | 1 + Model/VMMy.cs | 2 + 53 files changed, 2058 insertions(+), 611 deletions(-) create mode 100644 BO/css/jquery-ui-1.12.1/images/ui-icons_444444_256x240.png create mode 100644 BO/css/jquery-ui-1.12.1/images/ui-icons_555555_256x240.png create mode 100644 BO/css/jquery-ui-1.12.1/images/ui-icons_777620_256x240.png create mode 100644 BO/css/jquery-ui-1.12.1/images/ui-icons_777777_256x240.png create mode 100644 BO/css/jquery-ui-1.12.1/images/ui-icons_cc0000_256x240.png create mode 100644 BO/css/jquery-ui-1.12.1/images/ui-icons_ffffff_256x240.png create mode 100644 BO/css/jquery-ui-1.12.1/jquery-ui.min.css create mode 100644 BO/favicon.ico create mode 100644 BO/js/jquery-ui.min.js create mode 100644 FO/css/jquery-ui-1.12.1/images/ui-icons_444444_256x240.png create mode 100644 FO/css/jquery-ui-1.12.1/images/ui-icons_555555_256x240.png create mode 100644 FO/css/jquery-ui-1.12.1/images/ui-icons_777620_256x240.png create mode 100644 FO/css/jquery-ui-1.12.1/images/ui-icons_777777_256x240.png create mode 100644 FO/css/jquery-ui-1.12.1/images/ui-icons_cc0000_256x240.png create mode 100644 FO/css/jquery-ui-1.12.1/images/ui-icons_ffffff_256x240.png create mode 100644 FO/css/jquery-ui-1.12.1/jquery-ui.min.css create mode 100644 FO/js/jquery-ui.min.js create mode 100644 FO/js/polyfill.min.js create mode 100644 FO/js/video.js create mode 100644 FO/js/videojs-ie8.min.js create mode 100644 Model/CRoom.cs diff --git a/BO/BO.csproj b/BO/BO.csproj index 4a9cfbb..2e902d2 100644 --- a/BO/BO.csproj +++ b/BO/BO.csproj @@ -318,6 +318,7 @@ + diff --git a/BO/Views/MM/popups.cshtml b/BO/Views/MM/popups.cshtml index 1fd01d9..792e195 100644 --- a/BO/Views/MM/popups.cshtml +++ b/BO/Views/MM/popups.cshtml @@ -68,7 +68,7 @@ } @section scriptsHeader{ - + @Html.Partial("./Partial/Summernote") } @section scripts{ diff --git a/BO/Views/Shared/Partial/ExcelCommentBox.cshtml b/BO/Views/Shared/Partial/ExcelCommentBox.cshtml index d31d2cb..78208c7 100644 --- a/BO/Views/Shared/Partial/ExcelCommentBox.cshtml +++ b/BO/Views/Shared/Partial/ExcelCommentBox.cshtml @@ -60,7 +60,7 @@ margin-left: 1px; } -@**@ +@**@ +
-
- @*
- -
*@ +

@(((NP.Model.Menu)ViewBag.CMenu) == null ? "Home" : ((NP.Model.Menu)ViewBag.CMenu).menuname)

@RenderBody()



@@ -193,26 +187,26 @@
processing...
- +
- +

파일선택

- 등록하기 - 닫기 + 등록하기 + 닫기
처리중입니다.
-

엑셀일괄등록X

+

엑셀일괄등록X


    @@ -228,8 +222,8 @@

@@ -260,12 +254,10 @@ document.location.href = '/Home/Index'; } } - }); - - //window.history.pushState('forward', null, '#SomeIDYouAreNotUsing'); + }); } }); - + \ No newline at end of file diff --git a/BO/Views/cm/cgs.cshtml b/BO/Views/cm/cgs.cshtml index d382a8f..2c06c77 100644 --- a/BO/Views/cm/cgs.cshtml +++ b/BO/Views/cm/cgs.cshtml @@ -81,27 +81,25 @@ @section scriptsHeader{ - + } @section scripts{ + @Html.Partial("./Partial/ScriptDate") } @section scripts{ diff --git a/BO/Views/cm/ctr.cshtml b/BO/Views/cm/ctr.cshtml index c9100f8..8421547 100644 --- a/BO/Views/cm/ctr.cshtml +++ b/BO/Views/cm/ctr.cshtml @@ -216,7 +216,7 @@ } @section scriptsHeader{ @Html.Partial("./Partial/FileScript") - + } @section scripts{ diff --git a/FO/Views/CRoom/EstimationSubject.cshtml b/FO/Views/CRoom/EstimationSubject.cshtml index b14a230..ba26feb 100644 --- a/FO/Views/CRoom/EstimationSubject.cshtml +++ b/FO/Views/CRoom/EstimationSubject.cshtml @@ -8,10 +8,6 @@
- @* - - - *@ @@ -47,12 +43,7 @@
과제파일첨부
과제회차1회
과제제목 @Model.LectSD.sdname
- - @* - - *@ + - - @**@ + - - @**@ + - - @**@ + - - @**@ + - - @* - - - - - *@ - - @**@ + - - @**@ + @@ -167,7 +154,7 @@
-
오늘 시청 가능한 10개 차시 중 (@Model.intval/@Model.intval2)를 수강하셨습니다. 수강 중인 강의 모두 보기
+ @{ + string lectInningsTitle = string.Empty; + + if (Model.Lect.attrate < 100) + { + lectInningsTitle = string.Format("오늘 시청 가능한 10개 차시 중 ({0}/{1})를 수강하셨습니다.", Model.intval, Model.intval2); + } + else + { + lectInningsTitle = "    "; + } + } +
@Html.Raw(lectInningsTitle) 수강 중인 강의 모두 보기
- -
@@ -87,28 +78,39 @@ @Html.HiddenFor(m => m.tabidx) @Html.HiddenFor(m => m.estno) + @section scriptsHeader{ @Html.Partial("./Partial/filescript") } + @section scripts{ } \ No newline at end of file diff --git a/FO/Views/CRoom/Index.cshtml b/FO/Views/CRoom/Index.cshtml index ffb8eb5..76958b5 100644 --- a/FO/Views/CRoom/Index.cshtml +++ b/FO/Views/CRoom/Index.cshtml @@ -17,41 +17,28 @@
구분진도율진행평가진도율 최종평가 과제평가집체교육(7h)토론평가집체교육(7h) 총점
나의성적@(Model.Lect.attrate)%@(Model.Lect.ex0lectpoint)점@(Model.Lect.attrate)% @(Model.Lect.ex1lectpoint)점 @(Model.Lect.sd0lectpoint)점@(Model.Lect.istatus == 2 ? "출석완료" : "-")@(Model.Lect.sd1lectpoint)점@(Model.Lect.istatus == 2 ? "출석완료" : "-") @(Model.Lect.apoint + Model.Lect.mpoint + Model.Lect.fpoint + Model.Lect.spoint + Model.Lect.dpoint)점@(Model.Lect.attrate)%(@(Model.Lect.apoint)점)@(Model.Lect.mpoint)점@(Model.Lect.fpoint)점@(Model.Lect.spoint)점@(Model.Lect.dpoint)점@(Model.Lect.apoint + Model.Lect.mpoint + Model.Lect.fpoint + Model.Lect.spoint + Model.Lect.dpoint)점
수료기준@(Model.Lect.acut)%이상@(Model.Lect.mcut)점이상@(Model.Lect.acut)%이상 @(Model.Lect.fcut)점이상 @(Model.Lect.scut)점이상집체교육 참석(7h)@(Model.Lect.dcut)점이상집체교육 참석(7h) @(Model.Lect.cut)점이상
@foreach (var d in Model.LectInnings) @@ -220,8 +219,7 @@ else {
-
@(d.edate < DateTime.Now ? "학습기간종료" : d.isonline == 0 && d.istatus == 2 ? "출석완료" : d.isonline == 0 && d.idate < DateTime.Now ? "결석" : d.isonline == 0 ? "출석전" : d.stime == null ? "학습전(0%)" : d.istatus == 2 ? "학습완료" : string.Format("학습중({0}%)", d.sttime > 0 ? (d.totstudy * 100 / (d.sttime * 60)) : 0))
- @*
@(d.isonline == 0 ? (d.cshape != 2 ? "강의시작일" : "집체교육") : "교육기간") : @(d.isonline == 0 ? (d.cshape != 2 ? string.Format("{0} {1}:{2}", d.idate.ToString("MM/dd"), d.ist.Substring(0, 2), d.ist.Substring(2, 2)) : d.eend.ToString("MM/dd")) :d.cshape != 1 ? d.cdt.ToString("MM/dd")+" ~ "+d.estart.ToString("MM/dd") : (d.sdate.ToString("MM/dd") + " ~ " + d.edate.ToString("MM/dd")))
*@ +
@(d.edate < DateTime.Now ? "학습기간종료" : d.isonline == 0 && d.istatus == 2 ? "출석완료" : d.isonline == 0 && d.idate < DateTime.Now ? "결석" : d.isonline == 0 ? "출석전" : d.stime == null ? "학습전(0%)" : d.istatus == 2 ? "학습완료" : string.Format("학습중({0}%)", d.sttime > 0 ? (d.totstudy * 100 / (d.sttime * 60)) : 0))
@(d.isonline == 0 ? (d.cshape != 2 ? "강의시작일" : "집체교육") : "교육기간") : @(d.isonline == 0 ? (d.cshape != 2 ? string.Format("{0} {1}:{2}", d.idate.ToString("MM/dd"), d.ist.Substring(0, 2), d.ist.Substring(2, 2)) : d.eend.ToString("MM/dd")) :(d.sdate.ToString("MM/dd") + " ~ " + d.edate.ToString("MM/dd")))
@if (d.cshape != 1 && d.isonline == 1) { @@ -256,7 +254,7 @@
  • @if (d.isonline == 1) { - if(!isplay) + if (!isplay) { if (d.isseq == 1 && d.iseq != 1 && d.preistatus < 2) @@ -273,7 +271,7 @@ preflag = 1; } //학습기간 종료후에도 시청은 가능하고, 출석인정은 되지않도록 변경 2021-01-25 - 학습하기 + 학습하기 }
  • @@ -306,8 +304,7 @@ msg("관련 법령에 의해 일일 최대 학습가능한 시간은 10시간(10차시)입니다."); } else { _cmino = cmino; - chkcontent(); - @*viewcontents(cmino, false, @Model.croomlectno);*@ + chkcontent(); } } function chkcontent() { @@ -330,8 +327,7 @@ } else if (_authplatform == "2") { confirmtoggle(true, "학습을 처음 시작할 때 본인인증이 필요합니다. 본인인증은 회차 당 1회에 한 해 진행됩니다.
    본인인증을 하시겠습니까?", "chkmobile()"); } - // ### 모바일 인증 중단 처리 - // viewcontents(_cmino, false,@Model.croomlectno); + // ### 모바일 인증 중단 처리 } } else { msg("휴대폰 번호가 공란입니다.
    정보수정을 통해 번호를 입력해주세요."); @@ -352,8 +348,7 @@ } } function cbchkmobile() { - if (capResult.code == 1000) { - //msg("인증이 성공하였습니다.\n 확인 버튼을 클릭하시면 학습이 가능합니다."); + if (capResult.code == 1000) { $("#mobile").css("background", "#ddd"); mobilechkclose(); viewcontents(_cmino, false,@Model.croomlectno); diff --git a/FO/Views/CRoom/Innings.cshtml b/FO/Views/CRoom/Innings.cshtml index 3a4951e..557d942 100644 --- a/FO/Views/CRoom/Innings.cshtml +++ b/FO/Views/CRoom/Innings.cshtml @@ -26,21 +26,22 @@ } -@**@ +
    현재 오늘 학습 가능한 10회차 중 @(Model.intval2 - Model.intval)회차 학습가능 합니다.
    ※ 관련 법령에 의해 일일 최대 학습시간은 학습중인 모든 과정에 대하여 10시간(10회차)입니다.
    -@*

    오늘의 학습회차(@Model.intval/@Model.intval2)

    *@
    + +
    @foreach (var d in Model.LectInnings) { + // d.istatus == 2 가 학습완료다 + ", e.document[0]).appendTo(n)) : "tr" === s ? e._createTrPlaceholder(e.currentItem, n) : "img" === s && n.attr("src", e.currentItem.attr("src")), i || n.css("visibility", "hidden"), n }, update: function (t, n) { (!i || s.forcePlaceholderSize) && (n.height() || n.height(e.currentItem.innerHeight() - parseInt(e.currentItem.css("paddingTop") || 0, 10) - parseInt(e.currentItem.css("paddingBottom") || 0, 10)), n.width() || n.width(e.currentItem.innerWidth() - parseInt(e.currentItem.css("paddingLeft") || 0, 10) - parseInt(e.currentItem.css("paddingRight") || 0, 10))) } }), e.placeholder = t(s.placeholder.element.call(e.element, e.currentItem)), e.currentItem.after(e.placeholder), s.placeholder.update(e, e.placeholder) }, _createTrPlaceholder: function (e, i) { var s = this; e.children().each(function () { t("", s.document[0]).attr("colspan", t(this).attr("colspan") || 1).appendTo(i) }) }, _contactContainers: function (e) { var i, s, n, o, a, r, h, l, c, u, d = null, p = null; for (i = this.containers.length - 1; i >= 0; i--)if (!t.contains(this.currentItem[0], this.containers[i].element[0])) if (this._intersectsWith(this.containers[i].containerCache)) { if (d && t.contains(this.containers[i].element[0], d.element[0])) continue; d = this.containers[i], p = i } else this.containers[i].containerCache.over && (this.containers[i]._trigger("out", e, this._uiHash(this)), this.containers[i].containerCache.over = 0); if (d) if (1 === this.containers.length) this.containers[p].containerCache.over || (this.containers[p]._trigger("over", e, this._uiHash(this)), this.containers[p].containerCache.over = 1); else { for (n = 1e4, o = null, c = d.floating || this._isFloating(this.currentItem), a = c ? "left" : "top", r = c ? "width" : "height", u = c ? "pageX" : "pageY", s = this.items.length - 1; s >= 0; s--)t.contains(this.containers[p].element[0], this.items[s].item[0]) && this.items[s].item[0] !== this.currentItem[0] && (h = this.items[s].item.offset()[a], l = !1, e[u] - h > this.items[s][r] / 2 && (l = !0), n > Math.abs(e[u] - h) && (n = Math.abs(e[u] - h), o = this.items[s], this.direction = l ? "up" : "down")); if (!o && !this.options.dropOnEmpty) return; if (this.currentContainer === this.containers[p]) return this.currentContainer.containerCache.over || (this.containers[p]._trigger("over", e, this._uiHash()), this.currentContainer.containerCache.over = 1), void 0; o ? this._rearrange(e, o, null, !0) : this._rearrange(e, null, this.containers[p].element, !0), this._trigger("change", e, this._uiHash()), this.containers[p]._trigger("change", e, this._uiHash(this)), this.currentContainer = this.containers[p], this.options.placeholder.update(this.currentContainer, this.placeholder), this.containers[p]._trigger("over", e, this._uiHash(this)), this.containers[p].containerCache.over = 1 } }, _createHelper: function (e) { var i = this.options, s = t.isFunction(i.helper) ? t(i.helper.apply(this.element[0], [e, this.currentItem])) : "clone" === i.helper ? this.currentItem.clone() : this.currentItem; return s.parents("body").length || t("parent" !== i.appendTo ? i.appendTo : this.currentItem[0].parentNode)[0].appendChild(s[0]), s[0] === this.currentItem[0] && (this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") }), (!s[0].style.width || i.forceHelperSize) && s.width(this.currentItem.width()), (!s[0].style.height || i.forceHelperSize) && s.height(this.currentItem.height()), s }, _adjustOffsetFromHelper: function (e) { "string" == typeof e && (e = e.split(" ")), t.isArray(e) && (e = { left: +e[0], top: +e[1] || 0 }), "left" in e && (this.offset.click.left = e.left + this.margins.left), "right" in e && (this.offset.click.left = this.helperProportions.width - e.right + this.margins.left), "top" in e && (this.offset.click.top = e.top + this.margins.top), "bottom" in e && (this.offset.click.top = this.helperProportions.height - e.bottom + this.margins.top) }, _getParentOffset: function () { this.offsetParent = this.helper.offsetParent(); var e = this.offsetParent.offset(); return "absolute" === this.cssPosition && this.scrollParent[0] !== this.document[0] && t.contains(this.scrollParent[0], this.offsetParent[0]) && (e.left += this.scrollParent.scrollLeft(), e.top += this.scrollParent.scrollTop()), (this.offsetParent[0] === this.document[0].body || this.offsetParent[0].tagName && "html" === this.offsetParent[0].tagName.toLowerCase() && t.ui.ie) && (e = { top: 0, left: 0 }), { top: e.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0), left: e.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0) } }, _getRelativeOffset: function () { if ("relative" === this.cssPosition) { var t = this.currentItem.position(); return { top: t.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(), left: t.left - (parseInt(this.helper.css("left"), 10) || 0) + this.scrollParent.scrollLeft() } } return { top: 0, left: 0 } }, _cacheMargins: function () { this.margins = { left: parseInt(this.currentItem.css("marginLeft"), 10) || 0, top: parseInt(this.currentItem.css("marginTop"), 10) || 0 } }, _cacheHelperProportions: function () { this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() } }, _setContainment: function () { var e, i, s, n = this.options; "parent" === n.containment && (n.containment = this.helper[0].parentNode), ("document" === n.containment || "window" === n.containment) && (this.containment = [0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, "document" === n.containment ? this.document.width() : this.window.width() - this.helperProportions.width - this.margins.left, ("document" === n.containment ? this.document.height() || document.body.parentNode.scrollHeight : this.window.height() || this.document[0].body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top]), /^(document|window|parent)$/.test(n.containment) || (e = t(n.containment)[0], i = t(n.containment).offset(), s = "hidden" !== t(e).css("overflow"), this.containment = [i.left + (parseInt(t(e).css("borderLeftWidth"), 10) || 0) + (parseInt(t(e).css("paddingLeft"), 10) || 0) - this.margins.left, i.top + (parseInt(t(e).css("borderTopWidth"), 10) || 0) + (parseInt(t(e).css("paddingTop"), 10) || 0) - this.margins.top, i.left + (s ? Math.max(e.scrollWidth, e.offsetWidth) : e.offsetWidth) - (parseInt(t(e).css("borderLeftWidth"), 10) || 0) - (parseInt(t(e).css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left, i.top + (s ? Math.max(e.scrollHeight, e.offsetHeight) : e.offsetHeight) - (parseInt(t(e).css("borderTopWidth"), 10) || 0) - (parseInt(t(e).css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top]) }, _convertPositionTo: function (e, i) { i || (i = this.position); var s = "absolute" === e ? 1 : -1, n = "absolute" !== this.cssPosition || this.scrollParent[0] !== this.document[0] && t.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent, o = /(html|body)/i.test(n[0].tagName); return { top: i.top + this.offset.relative.top * s + this.offset.parent.top * s - ("fixed" === this.cssPosition ? -this.scrollParent.scrollTop() : o ? 0 : n.scrollTop()) * s, left: i.left + this.offset.relative.left * s + this.offset.parent.left * s - ("fixed" === this.cssPosition ? -this.scrollParent.scrollLeft() : o ? 0 : n.scrollLeft()) * s } }, _generatePosition: function (e) { var i, s, n = this.options, o = e.pageX, a = e.pageY, r = "absolute" !== this.cssPosition || this.scrollParent[0] !== this.document[0] && t.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent, h = /(html|body)/i.test(r[0].tagName); return "relative" !== this.cssPosition || this.scrollParent[0] !== this.document[0] && this.scrollParent[0] !== this.offsetParent[0] || (this.offset.relative = this._getRelativeOffset()), this.originalPosition && (this.containment && (e.pageX - this.offset.click.left < this.containment[0] && (o = this.containment[0] + this.offset.click.left), e.pageY - this.offset.click.top < this.containment[1] && (a = this.containment[1] + this.offset.click.top), e.pageX - this.offset.click.left > this.containment[2] && (o = this.containment[2] + this.offset.click.left), e.pageY - this.offset.click.top > this.containment[3] && (a = this.containment[3] + this.offset.click.top)), n.grid && (i = this.originalPageY + Math.round((a - this.originalPageY) / n.grid[1]) * n.grid[1], a = this.containment ? i - this.offset.click.top >= this.containment[1] && i - this.offset.click.top <= this.containment[3] ? i : i - this.offset.click.top >= this.containment[1] ? i - n.grid[1] : i + n.grid[1] : i, s = this.originalPageX + Math.round((o - this.originalPageX) / n.grid[0]) * n.grid[0], o = this.containment ? s - this.offset.click.left >= this.containment[0] && s - this.offset.click.left <= this.containment[2] ? s : s - this.offset.click.left >= this.containment[0] ? s - n.grid[0] : s + n.grid[0] : s)), { top: a - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + ("fixed" === this.cssPosition ? -this.scrollParent.scrollTop() : h ? 0 : r.scrollTop()), left: o - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + ("fixed" === this.cssPosition ? -this.scrollParent.scrollLeft() : h ? 0 : r.scrollLeft()) } }, _rearrange: function (t, e, i, s) { + i ? i[0].appendChild(this.placeholder[0]) : e.item[0].parentNode.insertBefore(this.placeholder[0], "down" === this.direction ? e.item[0] : e.item[0].nextSibling), this.counter = this.counter ? ++this.counter : 1; var n = this.counter; + this._delay(function () { n === this.counter && this.refreshPositions(!s) }) + }, _clear: function (t, e) { function i(t, e, i) { return function (s) { i._trigger(t, s, e._uiHash(e)) } } this.reverting = !1; var s, n = []; if (!this._noFinalSort && this.currentItem.parent().length && this.placeholder.before(this.currentItem), this._noFinalSort = null, this.helper[0] === this.currentItem[0]) { for (s in this._storedCSS) ("auto" === this._storedCSS[s] || "static" === this._storedCSS[s]) && (this._storedCSS[s] = ""); this.currentItem.css(this._storedCSS), this._removeClass(this.currentItem, "ui-sortable-helper") } else this.currentItem.show(); for (this.fromOutside && !e && n.push(function (t) { this._trigger("receive", t, this._uiHash(this.fromOutside)) }), !this.fromOutside && this.domPosition.prev === this.currentItem.prev().not(".ui-sortable-helper")[0] && this.domPosition.parent === this.currentItem.parent()[0] || e || n.push(function (t) { this._trigger("update", t, this._uiHash()) }), this !== this.currentContainer && (e || (n.push(function (t) { this._trigger("remove", t, this._uiHash()) }), n.push(function (t) { return function (e) { t._trigger("receive", e, this._uiHash(this)) } }.call(this, this.currentContainer)), n.push(function (t) { return function (e) { t._trigger("update", e, this._uiHash(this)) } }.call(this, this.currentContainer)))), s = this.containers.length - 1; s >= 0; s--)e || n.push(i("deactivate", this, this.containers[s])), this.containers[s].containerCache.over && (n.push(i("out", this, this.containers[s])), this.containers[s].containerCache.over = 0); if (this.storedCursor && (this.document.find("body").css("cursor", this.storedCursor), this.storedStylesheet.remove()), this._storedOpacity && this.helper.css("opacity", this._storedOpacity), this._storedZIndex && this.helper.css("zIndex", "auto" === this._storedZIndex ? "" : this._storedZIndex), this.dragging = !1, e || this._trigger("beforeStop", t, this._uiHash()), this.placeholder[0].parentNode.removeChild(this.placeholder[0]), this.cancelHelperRemoval || (this.helper[0] !== this.currentItem[0] && this.helper.remove(), this.helper = null), !e) { for (s = 0; n.length > s; s++)n[s].call(this, t); this._trigger("stop", t, this._uiHash()) } return this.fromOutside = !1, !this.cancelHelperRemoval }, _trigger: function () { t.Widget.prototype._trigger.apply(this, arguments) === !1 && this.cancel() }, _uiHash: function (e) { var i = e || this; return { helper: i.helper, placeholder: i.placeholder || t([]), position: i.position, originalPosition: i.originalPosition, offset: i.positionAbs, item: i.currentItem, sender: e ? e.element : null } } + }), t.widget("ui.spinner", { version: "1.12.1", defaultElement: "", widgetEventPrefix: "spin", options: { classes: { "ui-spinner": "ui-corner-all", "ui-spinner-down": "ui-corner-br", "ui-spinner-up": "ui-corner-tr" }, culture: null, icons: { down: "ui-icon-triangle-1-s", up: "ui-icon-triangle-1-n" }, incremental: !0, max: null, min: null, numberFormat: null, page: 10, step: 1, change: null, spin: null, start: null, stop: null }, _create: function () { this._setOption("max", this.options.max), this._setOption("min", this.options.min), this._setOption("step", this.options.step), "" !== this.value() && this._value(this.element.val(), !0), this._draw(), this._on(this._events), this._refresh(), this._on(this.window, { beforeunload: function () { this.element.removeAttr("autocomplete") } }) }, _getCreateOptions: function () { var e = this._super(), i = this.element; return t.each(["min", "max", "step"], function (t, s) { var n = i.attr(s); null != n && n.length && (e[s] = n) }), e }, _events: { keydown: function (t) { this._start(t) && this._keydown(t) && t.preventDefault() }, keyup: "_stop", focus: function () { this.previous = this.element.val() }, blur: function (t) { return this.cancelBlur ? (delete this.cancelBlur, void 0) : (this._stop(), this._refresh(), this.previous !== this.element.val() && this._trigger("change", t), void 0) }, mousewheel: function (t, e) { if (e) { if (!this.spinning && !this._start(t)) return !1; this._spin((e > 0 ? 1 : -1) * this.options.step, t), clearTimeout(this.mousewheelTimer), this.mousewheelTimer = this._delay(function () { this.spinning && this._stop(t) }, 100), t.preventDefault() } }, "mousedown .ui-spinner-button": function (e) { function i() { var e = this.element[0] === t.ui.safeActiveElement(this.document[0]); e || (this.element.trigger("focus"), this.previous = s, this._delay(function () { this.previous = s })) } var s; s = this.element[0] === t.ui.safeActiveElement(this.document[0]) ? this.previous : this.element.val(), e.preventDefault(), i.call(this), this.cancelBlur = !0, this._delay(function () { delete this.cancelBlur, i.call(this) }), this._start(e) !== !1 && this._repeat(null, t(e.currentTarget).hasClass("ui-spinner-up") ? 1 : -1, e) }, "mouseup .ui-spinner-button": "_stop", "mouseenter .ui-spinner-button": function (e) { return t(e.currentTarget).hasClass("ui-state-active") ? this._start(e) === !1 ? !1 : (this._repeat(null, t(e.currentTarget).hasClass("ui-spinner-up") ? 1 : -1, e), void 0) : void 0 }, "mouseleave .ui-spinner-button": "_stop" }, _enhance: function () { this.uiSpinner = this.element.attr("autocomplete", "off").wrap("").parent().append("") }, _draw: function () { this._enhance(), this._addClass(this.uiSpinner, "ui-spinner", "ui-widget ui-widget-content"), this._addClass("ui-spinner-input"), this.element.attr("role", "spinbutton"), this.buttons = this.uiSpinner.children("a").attr("tabIndex", -1).attr("aria-hidden", !0).button({ classes: { "ui-button": "" } }), this._removeClass(this.buttons, "ui-corner-all"), this._addClass(this.buttons.first(), "ui-spinner-button ui-spinner-up"), this._addClass(this.buttons.last(), "ui-spinner-button ui-spinner-down"), this.buttons.first().button({ icon: this.options.icons.up, showLabel: !1 }), this.buttons.last().button({ icon: this.options.icons.down, showLabel: !1 }), this.buttons.height() > Math.ceil(.5 * this.uiSpinner.height()) && this.uiSpinner.height() > 0 && this.uiSpinner.height(this.uiSpinner.height()) }, _keydown: function (e) { var i = this.options, s = t.ui.keyCode; switch (e.keyCode) { case s.UP: return this._repeat(null, 1, e), !0; case s.DOWN: return this._repeat(null, -1, e), !0; case s.PAGE_UP: return this._repeat(null, i.page, e), !0; case s.PAGE_DOWN: return this._repeat(null, -i.page, e), !0 }return !1 }, _start: function (t) { return this.spinning || this._trigger("start", t) !== !1 ? (this.counter || (this.counter = 1), this.spinning = !0, !0) : !1 }, _repeat: function (t, e, i) { t = t || 500, clearTimeout(this.timer), this.timer = this._delay(function () { this._repeat(40, e, i) }, t), this._spin(e * this.options.step, i) }, _spin: function (t, e) { var i = this.value() || 0; this.counter || (this.counter = 1), i = this._adjustValue(i + t * this._increment(this.counter)), this.spinning && this._trigger("spin", e, { value: i }) === !1 || (this._value(i), this.counter++) }, _increment: function (e) { var i = this.options.incremental; return i ? t.isFunction(i) ? i(e) : Math.floor(e * e * e / 5e4 - e * e / 500 + 17 * e / 200 + 1) : 1 }, _precision: function () { var t = this._precisionOf(this.options.step); return null !== this.options.min && (t = Math.max(t, this._precisionOf(this.options.min))), t }, _precisionOf: function (t) { var e = "" + t, i = e.indexOf("."); return -1 === i ? 0 : e.length - i - 1 }, _adjustValue: function (t) { var e, i, s = this.options; return e = null !== s.min ? s.min : 0, i = t - e, i = Math.round(i / s.step) * s.step, t = e + i, t = parseFloat(t.toFixed(this._precision())), null !== s.max && t > s.max ? s.max : null !== s.min && s.min > t ? s.min : t }, _stop: function (t) { this.spinning && (clearTimeout(this.timer), clearTimeout(this.mousewheelTimer), this.counter = 0, this.spinning = !1, this._trigger("stop", t)) }, _setOption: function (t, e) { var i, s, n; return "culture" === t || "numberFormat" === t ? (i = this._parse(this.element.val()), this.options[t] = e, this.element.val(this._format(i)), void 0) : (("max" === t || "min" === t || "step" === t) && "string" == typeof e && (e = this._parse(e)), "icons" === t && (s = this.buttons.first().find(".ui-icon"), this._removeClass(s, null, this.options.icons.up), this._addClass(s, null, e.up), n = this.buttons.last().find(".ui-icon"), this._removeClass(n, null, this.options.icons.down), this._addClass(n, null, e.down)), this._super(t, e), void 0) }, _setOptionDisabled: function (t) { this._super(t), this._toggleClass(this.uiSpinner, null, "ui-state-disabled", !!t), this.element.prop("disabled", !!t), this.buttons.button(t ? "disable" : "enable") }, _setOptions: r(function (t) { this._super(t) }), _parse: function (t) { return "string" == typeof t && "" !== t && (t = window.Globalize && this.options.numberFormat ? Globalize.parseFloat(t, 10, this.options.culture) : +t), "" === t || isNaN(t) ? null : t }, _format: function (t) { return "" === t ? "" : window.Globalize && this.options.numberFormat ? Globalize.format(t, this.options.numberFormat, this.options.culture) : t }, _refresh: function () { this.element.attr({ "aria-valuemin": this.options.min, "aria-valuemax": this.options.max, "aria-valuenow": this._parse(this.element.val()) }) }, isValid: function () { var t = this.value(); return null === t ? !1 : t === this._adjustValue(t) }, _value: function (t, e) { var i; "" !== t && (i = this._parse(t), null !== i && (e || (i = this._adjustValue(i)), t = this._format(i))), this.element.val(t), this._refresh() }, _destroy: function () { this.element.prop("disabled", !1).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow"), this.uiSpinner.replaceWith(this.element) }, stepUp: r(function (t) { this._stepUp(t) }), _stepUp: function (t) { this._start() && (this._spin((t || 1) * this.options.step), this._stop()) }, stepDown: r(function (t) { this._stepDown(t) }), _stepDown: function (t) { this._start() && (this._spin((t || 1) * -this.options.step), this._stop()) }, pageUp: r(function (t) { this._stepUp((t || 1) * this.options.page) }), pageDown: r(function (t) { this._stepDown((t || 1) * this.options.page) }), value: function (t) { return arguments.length ? (r(this._value).call(this, t), void 0) : this._parse(this.element.val()) }, widget: function () { return this.uiSpinner } }), t.uiBackCompat !== !1 && t.widget("ui.spinner", t.ui.spinner, { _enhance: function () { this.uiSpinner = this.element.attr("autocomplete", "off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml()) }, _uiSpinnerHtml: function () { return "" }, _buttonHtml: function () { return "" } }), t.ui.spinner, t.widget("ui.tabs", { version: "1.12.1", delay: 300, options: { active: null, classes: { "ui-tabs": "ui-corner-all", "ui-tabs-nav": "ui-corner-all", "ui-tabs-panel": "ui-corner-bottom", "ui-tabs-tab": "ui-corner-top" }, collapsible: !1, event: "click", heightStyle: "content", hide: null, show: null, activate: null, beforeActivate: null, beforeLoad: null, load: null }, _isLocal: function () { var t = /#.*$/; return function (e) { var i, s; i = e.href.replace(t, ""), s = location.href.replace(t, ""); try { i = decodeURIComponent(i) } catch (n) { } try { s = decodeURIComponent(s) } catch (n) { } return e.hash.length > 1 && i === s } }(), _create: function () { var e = this, i = this.options; this.running = !1, this._addClass("ui-tabs", "ui-widget ui-widget-content"), this._toggleClass("ui-tabs-collapsible", null, i.collapsible), this._processTabs(), i.active = this._initialActive(), t.isArray(i.disabled) && (i.disabled = t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"), function (t) { return e.tabs.index(t) }))).sort()), this.active = this.options.active !== !1 && this.anchors.length ? this._findActive(i.active) : t(), this._refresh(), this.active.length && this.load(i.active) }, _initialActive: function () { var e = this.options.active, i = this.options.collapsible, s = location.hash.substring(1); return null === e && (s && this.tabs.each(function (i, n) { return t(n).attr("aria-controls") === s ? (e = i, !1) : void 0 }), null === e && (e = this.tabs.index(this.tabs.filter(".ui-tabs-active"))), (null === e || -1 === e) && (e = this.tabs.length ? 0 : !1)), e !== !1 && (e = this.tabs.index(this.tabs.eq(e)), -1 === e && (e = i ? !1 : 0)), !i && e === !1 && this.anchors.length && (e = 0), e }, _getCreateEventData: function () { return { tab: this.active, panel: this.active.length ? this._getPanelForTab(this.active) : t() } }, _tabKeydown: function (e) { var i = t(t.ui.safeActiveElement(this.document[0])).closest("li"), s = this.tabs.index(i), n = !0; if (!this._handlePageNav(e)) { switch (e.keyCode) { case t.ui.keyCode.RIGHT: case t.ui.keyCode.DOWN: s++; break; case t.ui.keyCode.UP: case t.ui.keyCode.LEFT: n = !1, s--; break; case t.ui.keyCode.END: s = this.anchors.length - 1; break; case t.ui.keyCode.HOME: s = 0; break; case t.ui.keyCode.SPACE: return e.preventDefault(), clearTimeout(this.activating), this._activate(s), void 0; case t.ui.keyCode.ENTER: return e.preventDefault(), clearTimeout(this.activating), this._activate(s === this.options.active ? !1 : s), void 0; default: return }e.preventDefault(), clearTimeout(this.activating), s = this._focusNextTab(s, n), e.ctrlKey || e.metaKey || (i.attr("aria-selected", "false"), this.tabs.eq(s).attr("aria-selected", "true"), this.activating = this._delay(function () { this.option("active", s) }, this.delay)) } }, _panelKeydown: function (e) { this._handlePageNav(e) || e.ctrlKey && e.keyCode === t.ui.keyCode.UP && (e.preventDefault(), this.active.trigger("focus")) }, _handlePageNav: function (e) { return e.altKey && e.keyCode === t.ui.keyCode.PAGE_UP ? (this._activate(this._focusNextTab(this.options.active - 1, !1)), !0) : e.altKey && e.keyCode === t.ui.keyCode.PAGE_DOWN ? (this._activate(this._focusNextTab(this.options.active + 1, !0)), !0) : void 0 }, _findNextTab: function (e, i) { function s() { return e > n && (e = 0), 0 > e && (e = n), e } for (var n = this.tabs.length - 1; -1 !== t.inArray(s(), this.options.disabled);)e = i ? e + 1 : e - 1; return e }, _focusNextTab: function (t, e) { return t = this._findNextTab(t, e), this.tabs.eq(t).trigger("focus"), t }, _setOption: function (t, e) { return "active" === t ? (this._activate(e), void 0) : (this._super(t, e), "collapsible" === t && (this._toggleClass("ui-tabs-collapsible", null, e), e || this.options.active !== !1 || this._activate(0)), "event" === t && this._setupEvents(e), "heightStyle" === t && this._setupHeightStyle(e), void 0) }, _sanitizeSelector: function (t) { return t ? t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&") : "" }, refresh: function () { var e = this.options, i = this.tablist.children(":has(a[href])"); e.disabled = t.map(i.filter(".ui-state-disabled"), function (t) { return i.index(t) }), this._processTabs(), e.active !== !1 && this.anchors.length ? this.active.length && !t.contains(this.tablist[0], this.active[0]) ? this.tabs.length === e.disabled.length ? (e.active = !1, this.active = t()) : this._activate(this._findNextTab(Math.max(0, e.active - 1), !1)) : e.active = this.tabs.index(this.active) : (e.active = !1, this.active = t()), this._refresh() }, _refresh: function () { this._setOptionDisabled(this.options.disabled), this._setupEvents(this.options.event), this._setupHeightStyle(this.options.heightStyle), this.tabs.not(this.active).attr({ "aria-selected": "false", "aria-expanded": "false", tabIndex: -1 }), this.panels.not(this._getPanelForTab(this.active)).hide().attr({ "aria-hidden": "true" }), this.active.length ? (this.active.attr({ "aria-selected": "true", "aria-expanded": "true", tabIndex: 0 }), this._addClass(this.active, "ui-tabs-active", "ui-state-active"), this._getPanelForTab(this.active).show().attr({ "aria-hidden": "false" })) : this.tabs.eq(0).attr("tabIndex", 0) }, _processTabs: function () { var e = this, i = this.tabs, s = this.anchors, n = this.panels; this.tablist = this._getList().attr("role", "tablist"), this._addClass(this.tablist, "ui-tabs-nav", "ui-helper-reset ui-helper-clearfix ui-widget-header"), this.tablist.on("mousedown" + this.eventNamespace, "> li", function (e) { t(this).is(".ui-state-disabled") && e.preventDefault() }).on("focus" + this.eventNamespace, ".ui-tabs-anchor", function () { t(this).closest("li").is(".ui-state-disabled") && this.blur() }), this.tabs = this.tablist.find("> li:has(a[href])").attr({ role: "tab", tabIndex: -1 }), this._addClass(this.tabs, "ui-tabs-tab", "ui-state-default"), this.anchors = this.tabs.map(function () { return t("a", this)[0] }).attr({ role: "presentation", tabIndex: -1 }), this._addClass(this.anchors, "ui-tabs-anchor"), this.panels = t(), this.anchors.each(function (i, s) { var n, o, a, r = t(s).uniqueId().attr("id"), h = t(s).closest("li"), l = h.attr("aria-controls"); e._isLocal(s) ? (n = s.hash, a = n.substring(1), o = e.element.find(e._sanitizeSelector(n))) : (a = h.attr("aria-controls") || t({}).uniqueId()[0].id, n = "#" + a, o = e.element.find(n), o.length || (o = e._createPanel(a), o.insertAfter(e.panels[i - 1] || e.tablist)), o.attr("aria-live", "polite")), o.length && (e.panels = e.panels.add(o)), l && h.data("ui-tabs-aria-controls", l), h.attr({ "aria-controls": a, "aria-labelledby": r }), o.attr("aria-labelledby", r) }), this.panels.attr("role", "tabpanel"), this._addClass(this.panels, "ui-tabs-panel", "ui-widget-content"), i && (this._off(i.not(this.tabs)), this._off(s.not(this.anchors)), this._off(n.not(this.panels))) }, _getList: function () { return this.tablist || this.element.find("ol, ul").eq(0) }, _createPanel: function (e) { return t("
    ").attr("id", e).data("ui-tabs-destroy", !0) }, _setOptionDisabled: function (e) { var i, s, n; for (t.isArray(e) && (e.length ? e.length === this.anchors.length && (e = !0) : e = !1), n = 0; s = this.tabs[n]; n++)i = t(s), e === !0 || -1 !== t.inArray(n, e) ? (i.attr("aria-disabled", "true"), this._addClass(i, null, "ui-state-disabled")) : (i.removeAttr("aria-disabled"), this._removeClass(i, null, "ui-state-disabled")); this.options.disabled = e, this._toggleClass(this.widget(), this.widgetFullName + "-disabled", null, e === !0) }, _setupEvents: function (e) { var i = {}; e && t.each(e.split(" "), function (t, e) { i[e] = "_eventHandler" }), this._off(this.anchors.add(this.tabs).add(this.panels)), this._on(!0, this.anchors, { click: function (t) { t.preventDefault() } }), this._on(this.anchors, i), this._on(this.tabs, { keydown: "_tabKeydown" }), this._on(this.panels, { keydown: "_panelKeydown" }), this._focusable(this.tabs), this._hoverable(this.tabs) }, _setupHeightStyle: function (e) { var i, s = this.element.parent(); "fill" === e ? (i = s.height(), i -= this.element.outerHeight() - this.element.height(), this.element.siblings(":visible").each(function () { var e = t(this), s = e.css("position"); "absolute" !== s && "fixed" !== s && (i -= e.outerHeight(!0)) }), this.element.children().not(this.panels).each(function () { i -= t(this).outerHeight(!0) }), this.panels.each(function () { t(this).height(Math.max(0, i - t(this).innerHeight() + t(this).height())) }).css("overflow", "auto")) : "auto" === e && (i = 0, this.panels.each(function () { i = Math.max(i, t(this).height("").height()) }).height(i)) }, _eventHandler: function (e) { var i = this.options, s = this.active, n = t(e.currentTarget), o = n.closest("li"), a = o[0] === s[0], r = a && i.collapsible, h = r ? t() : this._getPanelForTab(o), l = s.length ? this._getPanelForTab(s) : t(), c = { oldTab: s, oldPanel: l, newTab: r ? t() : o, newPanel: h }; e.preventDefault(), o.hasClass("ui-state-disabled") || o.hasClass("ui-tabs-loading") || this.running || a && !i.collapsible || this._trigger("beforeActivate", e, c) === !1 || (i.active = r ? !1 : this.tabs.index(o), this.active = a ? t() : o, this.xhr && this.xhr.abort(), l.length || h.length || t.error("jQuery UI Tabs: Mismatching fragment identifier."), h.length && this.load(this.tabs.index(o), e), this._toggle(e, c)) }, _toggle: function (e, i) { function s() { o.running = !1, o._trigger("activate", e, i) } function n() { o._addClass(i.newTab.closest("li"), "ui-tabs-active", "ui-state-active"), a.length && o.options.show ? o._show(a, o.options.show, s) : (a.show(), s()) } var o = this, a = i.newPanel, r = i.oldPanel; this.running = !0, r.length && this.options.hide ? this._hide(r, this.options.hide, function () { o._removeClass(i.oldTab.closest("li"), "ui-tabs-active", "ui-state-active"), n() }) : (this._removeClass(i.oldTab.closest("li"), "ui-tabs-active", "ui-state-active"), r.hide(), n()), r.attr("aria-hidden", "true"), i.oldTab.attr({ "aria-selected": "false", "aria-expanded": "false" }), a.length && r.length ? i.oldTab.attr("tabIndex", -1) : a.length && this.tabs.filter(function () { return 0 === t(this).attr("tabIndex") }).attr("tabIndex", -1), a.attr("aria-hidden", "false"), i.newTab.attr({ "aria-selected": "true", "aria-expanded": "true", tabIndex: 0 }) }, _activate: function (e) { var i, s = this._findActive(e); s[0] !== this.active[0] && (s.length || (s = this.active), i = s.find(".ui-tabs-anchor")[0], this._eventHandler({ target: i, currentTarget: i, preventDefault: t.noop })) }, _findActive: function (e) { return e === !1 ? t() : this.tabs.eq(e) }, _getIndex: function (e) { return "string" == typeof e && (e = this.anchors.index(this.anchors.filter("[href$='" + t.ui.escapeSelector(e) + "']"))), e }, _destroy: function () { this.xhr && this.xhr.abort(), this.tablist.removeAttr("role").off(this.eventNamespace), this.anchors.removeAttr("role tabIndex").removeUniqueId(), this.tabs.add(this.panels).each(function () { t.data(this, "ui-tabs-destroy") ? t(this).remove() : t(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded") }), this.tabs.each(function () { var e = t(this), i = e.data("ui-tabs-aria-controls"); i ? e.attr("aria-controls", i).removeData("ui-tabs-aria-controls") : e.removeAttr("aria-controls") }), this.panels.show(), "content" !== this.options.heightStyle && this.panels.css("height", "") }, enable: function (e) { var i = this.options.disabled; i !== !1 && (void 0 === e ? i = !1 : (e = this._getIndex(e), i = t.isArray(i) ? t.map(i, function (t) { return t !== e ? t : null }) : t.map(this.tabs, function (t, i) { return i !== e ? i : null })), this._setOptionDisabled(i)) }, disable: function (e) { var i = this.options.disabled; if (i !== !0) { if (void 0 === e) i = !0; else { if (e = this._getIndex(e), -1 !== t.inArray(e, i)) return; i = t.isArray(i) ? t.merge([e], i).sort() : [e] } this._setOptionDisabled(i) } }, load: function (e, i) { e = this._getIndex(e); var s = this, n = this.tabs.eq(e), o = n.find(".ui-tabs-anchor"), a = this._getPanelForTab(n), r = { tab: n, panel: a }, h = function (t, e) { "abort" === e && s.panels.stop(!1, !0), s._removeClass(n, "ui-tabs-loading"), a.removeAttr("aria-busy"), t === s.xhr && delete s.xhr }; this._isLocal(o[0]) || (this.xhr = t.ajax(this._ajaxSettings(o, i, r)), this.xhr && "canceled" !== this.xhr.statusText && (this._addClass(n, "ui-tabs-loading"), a.attr("aria-busy", "true"), this.xhr.done(function (t, e, n) { setTimeout(function () { a.html(t), s._trigger("load", i, r), h(n, e) }, 1) }).fail(function (t, e) { setTimeout(function () { h(t, e) }, 1) }))) }, _ajaxSettings: function (e, i, s) { var n = this; return { url: e.attr("href").replace(/#.*$/, ""), beforeSend: function (e, o) { return n._trigger("beforeLoad", i, t.extend({ jqXHR: e, ajaxSettings: o }, s)) } } }, _getPanelForTab: function (e) { var i = t(e).attr("aria-controls"); return this.element.find(this._sanitizeSelector("#" + i)) } }), t.uiBackCompat !== !1 && t.widget("ui.tabs", t.ui.tabs, { _processTabs: function () { this._superApply(arguments), this._addClass(this.tabs, "ui-tab") } }), t.ui.tabs, t.widget("ui.tooltip", { version: "1.12.1", options: { classes: { "ui-tooltip": "ui-corner-all ui-widget-shadow" }, content: function () { var e = t(this).attr("title") || ""; return t("").text(e).html() }, hide: !0, items: "[title]:not([disabled])", position: { my: "left top+15", at: "left bottom", collision: "flipfit flip" }, show: !0, track: !1, close: null, open: null }, _addDescribedBy: function (e, i) { var s = (e.attr("aria-describedby") || "").split(/\s+/); s.push(i), e.data("ui-tooltip-id", i).attr("aria-describedby", t.trim(s.join(" "))) }, _removeDescribedBy: function (e) { var i = e.data("ui-tooltip-id"), s = (e.attr("aria-describedby") || "").split(/\s+/), n = t.inArray(i, s); -1 !== n && s.splice(n, 1), e.removeData("ui-tooltip-id"), s = t.trim(s.join(" ")), s ? e.attr("aria-describedby", s) : e.removeAttr("aria-describedby") }, _create: function () { this._on({ mouseover: "open", focusin: "open" }), this.tooltips = {}, this.parents = {}, this.liveRegion = t("
    ").attr({ role: "log", "aria-live": "assertive", "aria-relevant": "additions" }).appendTo(this.document[0].body), this._addClass(this.liveRegion, null, "ui-helper-hidden-accessible"), this.disabledTitles = t([]) }, _setOption: function (e, i) { var s = this; this._super(e, i), "content" === e && t.each(this.tooltips, function (t, e) { s._updateContent(e.element) }) }, _setOptionDisabled: function (t) { this[t ? "_disable" : "_enable"]() }, _disable: function () { var e = this; t.each(this.tooltips, function (i, s) { var n = t.Event("blur"); n.target = n.currentTarget = s.element[0], e.close(n, !0) }), this.disabledTitles = this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function () { var e = t(this); return e.is("[title]") ? e.data("ui-tooltip-title", e.attr("title")).removeAttr("title") : void 0 })) }, _enable: function () { this.disabledTitles.each(function () { var e = t(this); e.data("ui-tooltip-title") && e.attr("title", e.data("ui-tooltip-title")) }), this.disabledTitles = t([]) }, open: function (e) { var i = this, s = t(e ? e.target : this.element).closest(this.options.items); s.length && !s.data("ui-tooltip-id") && (s.attr("title") && s.data("ui-tooltip-title", s.attr("title")), s.data("ui-tooltip-open", !0), e && "mouseover" === e.type && s.parents().each(function () { var e, s = t(this); s.data("ui-tooltip-open") && (e = t.Event("blur"), e.target = e.currentTarget = this, i.close(e, !0)), s.attr("title") && (s.uniqueId(), i.parents[this.id] = { element: this, title: s.attr("title") }, s.attr("title", "")) }), this._registerCloseHandlers(e, s), this._updateContent(s, e)) }, _updateContent: function (t, e) { var i, s = this.options.content, n = this, o = e ? e.type : null; return "string" == typeof s || s.nodeType || s.jquery ? this._open(e, t, s) : (i = s.call(t[0], function (i) { n._delay(function () { t.data("ui-tooltip-open") && (e && (e.type = o), this._open(e, t, i)) }) }), i && this._open(e, t, i), void 0) }, _open: function (e, i, s) { function n(t) { l.of = t, a.is(":hidden") || a.position(l) } var o, a, r, h, l = t.extend({}, this.options.position); if (s) { if (o = this._find(i)) return o.tooltip.find(".ui-tooltip-content").html(s), void 0; i.is("[title]") && (e && "mouseover" === e.type ? i.attr("title", "") : i.removeAttr("title")), o = this._tooltip(i), a = o.tooltip, this._addDescribedBy(i, a.attr("id")), a.find(".ui-tooltip-content").html(s), this.liveRegion.children().hide(), h = t("
    ").html(a.find(".ui-tooltip-content").html()), h.removeAttr("name").find("[name]").removeAttr("name"), h.removeAttr("id").find("[id]").removeAttr("id"), h.appendTo(this.liveRegion), this.options.track && e && /^mouse/.test(e.type) ? (this._on(this.document, { mousemove: n }), n(e)) : a.position(t.extend({ of: i }, this.options.position)), a.hide(), this._show(a, this.options.show), this.options.track && this.options.show && this.options.show.delay && (r = this.delayedShow = setInterval(function () { a.is(":visible") && (n(l.of), clearInterval(r)) }, t.fx.interval)), this._trigger("open", e, { tooltip: a }) } }, _registerCloseHandlers: function (e, i) { var s = { keyup: function (e) { if (e.keyCode === t.ui.keyCode.ESCAPE) { var s = t.Event(e); s.currentTarget = i[0], this.close(s, !0) } } }; i[0] !== this.element[0] && (s.remove = function () { this._removeTooltip(this._find(i).tooltip) }), e && "mouseover" !== e.type || (s.mouseleave = "close"), e && "focusin" !== e.type || (s.focusout = "close"), this._on(!0, i, s) }, close: function (e) { var i, s = this, n = t(e ? e.currentTarget : this.element), o = this._find(n); return o ? (i = o.tooltip, o.closing || (clearInterval(this.delayedShow), n.data("ui-tooltip-title") && !n.attr("title") && n.attr("title", n.data("ui-tooltip-title")), this._removeDescribedBy(n), o.hiding = !0, i.stop(!0), this._hide(i, this.options.hide, function () { s._removeTooltip(t(this)) }), n.removeData("ui-tooltip-open"), this._off(n, "mouseleave focusout keyup"), n[0] !== this.element[0] && this._off(n, "remove"), this._off(this.document, "mousemove"), e && "mouseleave" === e.type && t.each(this.parents, function (e, i) { t(i.element).attr("title", i.title), delete s.parents[e] }), o.closing = !0, this._trigger("close", e, { tooltip: i }), o.hiding || (o.closing = !1)), void 0) : (n.removeData("ui-tooltip-open"), void 0) }, _tooltip: function (e) { var i = t("
    ").attr("role", "tooltip"), s = t("
    ").appendTo(i), n = i.uniqueId().attr("id"); return this._addClass(s, "ui-tooltip-content"), this._addClass(i, "ui-tooltip", "ui-widget ui-widget-content"), i.appendTo(this._appendTo(e)), this.tooltips[n] = { element: e, tooltip: i } }, _find: function (t) { var e = t.data("ui-tooltip-id"); return e ? this.tooltips[e] : null }, _removeTooltip: function (t) { t.remove(), delete this.tooltips[t.attr("id")] }, _appendTo: function (t) { var e = t.closest(".ui-front, dialog"); return e.length || (e = this.document[0].body), e }, _destroy: function () { var e = this; t.each(this.tooltips, function (i, s) { var n = t.Event("blur"), o = s.element; n.target = n.currentTarget = o[0], e.close(n, !0), t("#" + i).remove(), o.data("ui-tooltip-title") && (o.attr("title") || o.attr("title", o.data("ui-tooltip-title")), o.removeData("ui-tooltip-title")) }), this.liveRegion.remove() } }), t.uiBackCompat !== !1 && t.widget("ui.tooltip", t.ui.tooltip, { options: { tooltipClass: null }, _tooltip: function () { var t = this._superApply(arguments); return this.options.tooltipClass && t.tooltip.addClass(this.options.tooltipClass), t } }), t.ui.tooltip +}); \ No newline at end of file diff --git a/FO/js/polyfill.min.js b/FO/js/polyfill.min.js new file mode 100644 index 0000000..3a764b4 --- /dev/null +++ b/FO/js/polyfill.min.js @@ -0,0 +1 @@ +function __cons(t, a) { return eval("new t(" + Array.prototype.map.call(a, function (t, e) { return "a[" + e + "]" }).join(",") + ")") } Object.getPrototypeOf || (Object.getPrototypeOf = function (t) { if (t !== Object(t)) throw TypeError("Object.getPrototypeOf called on non-object"); return t.__proto__ || t.constructor.prototype || Object.prototype }), "function" != typeof Object.getOwnPropertyNames && (Object.getOwnPropertyNames = function (t) { if (t !== Object(t)) throw TypeError("Object.getOwnPropertyNames called on non-object"); var e, r = []; for (e in t) Object.prototype.hasOwnProperty.call(t, e) && r.push(e); return r }), "function" != typeof Object.create && (Object.create = function (t, e) { function r() { } if ("object" != typeof t) throw TypeError(); r.prototype = t; var n = new r; if (t && (n.constructor = r), e !== undefined) { if (e !== Object(e)) throw TypeError(); Object.defineProperties(n, e) } return n }), function () { if (!Object.defineProperty || !function () { try { return Object.defineProperty({}, "x", {}), !0 } catch (t) { return !1 } }()) { var t = Object.defineProperty; Object.defineProperty = function (e, r, n) { if (t) try { return t(e, r, n) } catch (o) { } if (e !== Object(e)) throw TypeError("Object.defineProperty called on non-object"); return Object.prototype.__defineGetter__ && "get" in n && Object.prototype.__defineGetter__.call(e, r, n.get), Object.prototype.__defineSetter__ && "set" in n && Object.prototype.__defineSetter__.call(e, r, n.set), "value" in n && (e[r] = n.value), e } } }(), "function" != typeof Object.defineProperties && (Object.defineProperties = function (t, e) { if (t !== Object(t)) throw TypeError("Object.defineProperties called on non-object"); var r; for (r in e) Object.prototype.hasOwnProperty.call(e, r) && Object.defineProperty(t, r, e[r]); return t }), Object.keys || (Object.keys = function (t) { if (t !== Object(t)) throw TypeError("Object.keys called on non-object"); var e, r = []; for (e in t) Object.prototype.hasOwnProperty.call(t, e) && r.push(e); return r }), Function.prototype.bind || (Function.prototype.bind = function (t) { if ("function" != typeof this) throw TypeError("Bind must be called on a function"); var e = Array.prototype.slice.call(arguments, 1), r = this, n = function () { }, o = function () { return r.apply(this instanceof n ? this : t, e.concat(Array.prototype.slice.call(arguments))) }; return this.prototype && (n.prototype = this.prototype), o.prototype = new n, o }), Array.isArray = Array.isArray || function (t) { return Boolean(t && "[object Array]" === Object.prototype.toString.call(Object(t))) }, Array.prototype.indexOf || (Array.prototype.indexOf = function (t) { if (void 0 === this || null === this) throw TypeError(); var e = Object(this), r = e.length >>> 0; if (0 === r) return -1; var n = 0; if (arguments.length > 0 && (n = Number(arguments[1]), isNaN(n) ? n = 0 : 0 !== n && n !== 1 / 0 && n !== -1 / 0 && (n = (n > 0 || -1) * Math.floor(Math.abs(n)))), n >= r) return -1; for (var o = n >= 0 ? n : Math.max(r - Math.abs(n), 0); o < r; o++)if (o in e && e[o] === t) return o; return -1 }), Array.prototype.lastIndexOf || (Array.prototype.lastIndexOf = function (t) { if (void 0 === this || null === this) throw TypeError(); var e = Object(this), r = e.length >>> 0; if (0 === r) return -1; var n = r; arguments.length > 1 && ((n = Number(arguments[1])) !== n ? n = 0 : 0 !== n && n !== 1 / 0 && n !== -1 / 0 && (n = (n > 0 || -1) * Math.floor(Math.abs(n)))); for (var o = n >= 0 ? Math.min(n, r - 1) : r - Math.abs(n); o >= 0; o--)if (o in e && e[o] === t) return o; return -1 }), Array.prototype.every || (Array.prototype.every = function (t) { if (void 0 === this || null === this) throw TypeError(); var e = Object(this), r = e.length >>> 0; if ("function" != typeof t) throw TypeError(); var n, o = arguments[1]; for (n = 0; n < r; n++)if (n in e && !t.call(o, e[n], n, e)) return !1; return !0 }), Array.prototype.some || (Array.prototype.some = function (t) { if (void 0 === this || null === this) throw TypeError(); var e = Object(this), r = e.length >>> 0; if ("function" != typeof t) throw TypeError(); var n, o = arguments[1]; for (n = 0; n < r; n++)if (n in e && t.call(o, e[n], n, e)) return !0; return !1 }), Array.prototype.forEach || (Array.prototype.forEach = function (t) { if (void 0 === this || null === this) throw TypeError(); var e = Object(this), r = e.length >>> 0; if ("function" != typeof t) throw TypeError(); var n, o = arguments[1]; for (n = 0; n < r; n++)n in e && t.call(o, e[n], n, e) }), Array.prototype.map || (Array.prototype.map = function (t) { if (void 0 === this || null === this) throw TypeError(); var e = Object(this), r = e.length >>> 0; if ("function" != typeof t) throw TypeError(); var n = []; n.length = r; var o, i = arguments[1]; for (o = 0; o < r; o++)o in e && (n[o] = t.call(i, e[o], o, e)); return n }), Array.prototype.filter || (Array.prototype.filter = function (t) { if (void 0 === this || null === this) throw TypeError(); var e = Object(this), r = e.length >>> 0; if ("function" != typeof t) throw TypeError(); var n, o = [], i = arguments[1]; for (n = 0; n < r; n++)if (n in e) { var a = e[n]; t.call(i, a, n, e) && o.push(a) } return o }), Array.prototype.reduce || (Array.prototype.reduce = function (t) { if (void 0 === this || null === this) throw TypeError(); var e = Object(this), r = e.length >>> 0; if ("function" != typeof t) throw TypeError(); if (0 === r && 1 === arguments.length) throw TypeError(); var n, o = 0; if (arguments.length >= 2) n = arguments[1]; else for (; ;) { if (o in e) { n = e[o++]; break } if (++o >= r) throw TypeError() } for (; o < r;)o in e && (n = t.call(undefined, n, e[o], o, e)), o++; return n }), Array.prototype.reduceRight || (Array.prototype.reduceRight = function (t) { if (void 0 === this || null === this) throw TypeError(); var e = Object(this), r = e.length >>> 0; if ("function" != typeof t) throw TypeError(); if (0 === r && 1 === arguments.length) throw TypeError(); var n, o = r - 1; if (arguments.length >= 2) n = arguments[1]; else for (; ;) { if (o in this) { n = this[o--]; break } if (--o < 0) throw TypeError() } for (; o >= 0;)o in e && (n = t.call(undefined, n, e[o], o, e)), o--; return n }), String.prototype.trim || (String.prototype.trim = function () { return String(this).replace(/^\s+/, "").replace(/\s+$/, "") }), Date.now || (Date.now = function () { return Number(new Date) }), Date.prototype.toISOString || (Date.prototype.toISOString = function () { function t(t) { return ("00" + t).slice(-2) } return this.getUTCFullYear() + "-" + t(this.getUTCMonth() + 1) + "-" + t(this.getUTCDate()) + "T" + t(this.getUTCHours()) + ":" + t(this.getUTCMinutes()) + ":" + t(this.getUTCSeconds()) + "." + function (t) { return ("000" + t).slice(-3) }(this.getUTCMilliseconds()) + "Z" }), function (t) { "use strict"; function e(e) { return e === t ? C : e } function r(t, e) { for (var r = Object.getOwnPropertyDescriptor(t, e), n = Object.getPrototypeOf(t); !r && n;)r = Object.getOwnPropertyDescriptor(n, e), n = Object.getPrototypeOf(n); return r } function n(t, e, r, n) { e in t && !n && !I || ("function" == typeof r ? Object.defineProperty(t, e, { value: r, configurable: !0, enumerable: !1, writable: !0 }) : Object.defineProperty(t, e, { value: r, configurable: !1, enumerable: !1, writable: !1 })) } function o(t, e, r) { Object.defineProperty(t, e, { value: r, configurable: !1, enumerable: !1, writable: !0 }) } function i() { function t(t) { var e = t.valueOf, n = R(null); return Object.defineProperty(t, "valueOf", { value: function (r) { return function (o) { return o === r ? n : e.apply(t, arguments) } }(r), configurable: !0, writeable: !0, enumerable: !1 }), n } function e(t) { var e = "function" == typeof t.valueOf && t.valueOf(r); return e === t ? null : e } var r = R(null); return { clear: function () { r = R(null) }, remove: function (t) { var r = e(t); return !(!r || !b(r, "value")) && (delete r.value, !0) }, get: function (t, r) { var n = e(t); return n && b(n, "value") ? n.value : r }, has: function (t) { var r = e(t); return Boolean(r && b(r, "value")) }, set: function (r, n) { (e(r) || t(r)).value = n } } } function a(e) { switch (typeof e) { case "undefined": return "undefined"; case "boolean": return "boolean"; case "number": return "number"; case "string": return "string"; case "symbol": return "symbol"; default: return null === e ? "null" : e instanceof t.Symbol ? "symbol" : "object" } } function u(t) { return t = Number(t), L(t) ? 0 : 0 === t || t === Infinity || t === -Infinity ? t : (t < 0 ? -1 : 1) * V(H(t)) } function c(t) { return t >>> 0 } function s(t) { if (null === t || t === C) throw TypeError(); return Object(t) } function f(t) { var e = u(t); return e <= 0 ? 0 : e === Infinity ? 9007199254740991 : K(e, 9007199254740991) } function l(t) { return "function" == typeof t } function p(t) { return !!/Constructor/.test(Object.prototype.toString.call(t)) || (!!/Function/.test(Object.prototype.toString.call(t)) || "function" == typeof t) } function h(t, e) { if (typeof t != typeof e) return !1; switch (typeof t) { case "undefined": return !0; case "number": return t !== t && e !== e || (0 === t && 0 === e ? 1 / t == 1 / e : t === e); case "boolean": case "string": case "object": default: return t === e } } function y(t, e) { if (typeof t != typeof e) return !1; switch (typeof t) { case "undefined": return !0; case "number": return t !== t && e !== e || t === e; case "boolean": case "string": case "object": default: return t === e } } function v(t, e) { return s(t)[e] } function d(t, e) { var r = v(t, e); if (r === C || null === r) return C; if (!l(r)) throw TypeError(); return r } function m(t, e) { for (; t;) { if (Object.prototype.hasOwnProperty.call(t, e)) return !0; if ("object" !== a(t)) return !1; var r = Object.getPrototypeOf(t); if (r === t) return !1; t = r } return !1 } function b(t, e) { return Object.prototype.hasOwnProperty.call(t, e) } function g(t, e) { arguments.length < 2 && (e = d(t, it)); var r = e.call(t); if ("object" !== a(r)) throw TypeError(); return r } function E(t, e) { if (arguments.length < 2) var r = t.next(); else r = t.next(e); if ("object" !== a(r)) throw TypeError(); return r } function w(t) { return t.value } function S(t, e) { var r = E(t, e), n = r.done; return !0 !== Boolean(n) && r } function T(t, e) { var r = {}; return r.value = t, r.done = e, r } function O(t, e, r) { k(function () { e.apply(C, r) }) } function j(t) { } function _(t) { var e = []; if (Object(t) !== t) return e; for (var r = new Set; null !== t;)Object.getOwnPropertyNames(t).forEach(function (n) { if (!r.has(n)) { var o = Object.getOwnPropertyDescriptor(t, n); o && (r.add(n), o.enumerable && e.push(n)) } }), t = Object.getPrototypeOf(t); return e[it]() } function P(t) { return Object.getOwnPropertyNames(t) } function R(t, e) { return Object.create(t, e) } function A() { } function N(t, e) { var r = String(t), n = new A; return o(n, "[[IteratedString]]", r), o(n, "[[StringIteratorNextIndex]]", 0), o(n, "[[StringIterationKind]]", e), n } function D() { } function M(t, e) { var r = s(t), n = new D; return o(n, "[[IteratedObject]]", r), o(n, "[[ArrayIteratorNextIndex]]", 0), o(n, "[[ArrayIterationKind]]", e), n } var x, I = !1, C = void 0, k = function (t, e) { return t ? function (e) { t.resolve().then(function () { e() }) } : e ? function (t) { e(t) } : function (t) { setTimeout(t, 0) } }(t.Promise, t.setImmediate), L = t.isNaN, U = t.parseInt, F = t.parseFloat, W = Math.E, q = Math.LOG10E, B = Math.LOG2E, H = Math.abs, X = Math.ceil, G = Math.exp, V = Math.floor, z = Math.log, $ = Math.max, K = Math.min, J = Math.pow, Y = Math.random, Z = Math.sqrt, Q = String.prototype.match, tt = String.prototype.replace, et = String.prototype.search, rt = String.prototype.split, nt = Object.create(null); !function () { function r(t) { return Array(t + 1).join("x").replace(/x/g, function () { return Y() < .5 ? "‌" : "‍" }) } function i(t) { if (!(this instanceof i)) return new i(t, a); if (this instanceof i && arguments[1] !== a) throw TypeError(); var e = t === C ? C : String(t); return o(this, "[[SymbolData]]", r(128)), o(this, "[[Description]]", e), u[this] = this, this } var a = Object.create(null), u = {}; x = function (t) { return u[t] }; var c = []; "Symbol" in t && !I || (t.Symbol = i), n(i, "for", function (t) { for (var e = String(t), r = 0; r < c.length; ++r) { var n = c[r]; if (h(n["[[key]]"], e)) return n["[[symbol]]"] } var o = i(t); return c.push({ "[[key]]": e, "[[symbol]]": o }), o }), n(t.Symbol, "iterator", t.Symbol("Symbol.iterator")), n(i, "keyFor", function (t) { if (!(t instanceof i)) throw TypeError(); for (var e = 0; e < c.length; ++e) { var r = c[e]; if (h(r["[[symbol]]"], t)) return r["[[key]]"] } return C }), n(t.Symbol, "match", t.Symbol("Symbol.match")), n(t.Symbol, "replace", t.Symbol("Symbol.replace")), n(t.Symbol, "search", t.Symbol("Symbol.search")), n(t.Symbol, "split", t.Symbol("Symbol.split")), n(t.Symbol, "toStringTag", t.Symbol("Symbol.toStringTag")), Object.defineProperty(i.prototype, "toString", { value: function () { var t = e(this), r = t["[[Description]]"]; return "Symbol(" + (r === C ? "" : r) + t["[[SymbolData]]"] + ")" }, configurable: !0, writeable: !0, enumerable: !1 }), Object.defineProperty(i.prototype, "valueOf", { value: function () { throw TypeError() }, configurable: !0, writeable: !0, enumerable: !1 }) }(); var ot = {}, it = t.Symbol.iterator, at = t.Symbol.match, ut = t.Symbol.replace, ct = t.Symbol.search, st = t.Symbol.split, ft = t.Symbol.toStringTag; n(Object, "assign", function (t, e) { var r = s(t); if (arguments.length < 2) return r; for (var n = 1; n < arguments.length;) { var o = arguments[n++]; if (o === C || null === o) var i = []; else { var a = s(o); i = P(a) } for (var u = 0; u < i.length; ++u) { var c = i[u], f = Object.getOwnPropertyDescriptor(a, c); if (f !== C && f.enumerable) { var l = a[c]; r[c] = l } } } return r }), function () { function e(t) { return !x(t) } var r = "symbol" == typeof t.Symbol(), o = Object.getOwnPropertyNames, i = Object.keys, a = "object" == typeof window ? o(window) : []; n(Object, "getOwnPropertyNames", function (t) { if ("[object Window]" === Object.prototype.toString.call(t)) try { return o(t).filter(e) } catch (r) { return a.slice() } return o(t).filter(e) }, !r), n(Object, "getOwnPropertySymbols", function (t) { return o(t).filter(x).map(x) }, !r), n(Object, "keys", function (t) { return i(t).filter(e) }, !r) }(), n(Object, "is", function (t, e) { return h(t, e) }), n(Object, "setPrototypeOf", function (t, e) { if ("object" !== a(t)) throw TypeError(); if ("object" !== a(e) && "null" !== a(e)) throw TypeError(); return t.__proto__ = e, t }); var lt = Object.prototype.toString; n(Object.prototype, "toString", function () { var t = e(this); return t === Object(t) && ft in t ? "[object " + t[ft] + "]" : lt.apply(t, arguments) }), n(t.Symbol.prototype, t.Symbol.toStringTag, "Symbol"), n(Number, "EPSILON", function () { var t, e; for (t = 1; 1 + t !== 1; t /= 2)e = t; return e }()), n(Number, "isFinite", function (t) { return "number" === a(t) && (t === t && t !== +Infinity && t !== -Infinity) }), n(Number, "isInteger", function (t) { return "number" === a(t) && (t === t && t !== +Infinity && t !== -Infinity && u(t) === t) }), n(Number, "isNaN", function (t) { return "number" === a(t) && t !== t }), n(Number, "isSafeInteger", function (t) { if ("number" !== a(t)) return !1; if (t !== t || t === +Infinity || t === -Infinity) return !1; var e = u(t); return e === t && H(e) <= 9007199254740991 }), n(Number, "MAX_SAFE_INTEGER", 9007199254740991), n(Number, "MIN_SAFE_INTEGER", -9007199254740991), n(Number, "parseFloat", F), n(Number, "parseInt", U), n(Math, ft, "Math"), n(Math, "acosh", function (t) { return t = Number(t), z(t + Z(t * t - 1)) }), n(Math, "asinh", function (t) { if (t = Number(t), h(t, -0)) return t; var e = Z(t * t + 1); return z(e === -t ? 0 : t + e) }), n(Math, "atanh", function (t) { return 0 === (t = Number(t)) ? t : z((1 + t) / (1 - t)) / 2 }), n(Math, "cbrt", function (t) { if (t = Number(t), L(t / t)) return t; var e = J(H(t), 1 / 3), r = t / e / e; return e + e * (r - e) / (2 * e + r) }), n(Math, "clz32", function (t) { function e(t) { return 240 & t ? 128 & t ? 0 : 64 & t ? 1 : 32 & t ? 2 : 3 : 8 & t ? 4 : 4 & t ? 5 : 2 & t ? 6 : 1 & t ? 7 : 8 } return 4278190080 & (t = c(t)) ? e(t >> 24) : 16711680 & t ? e(t >> 16) + 8 : 65280 & t ? e(t >> 8) + 16 : e(t) + 24 }), n(Math, "cosh", function (t) { return t = Number(t), (J(W, t) + J(W, -t)) / 2 }), n(Math, "expm1", function (t) { return t = Number(t), h(t, -0) ? -0 : H(t) < 1e-5 ? t + .5 * t * t : G(t) - 1 }), n(Math, "fround", function (t) { return L(t) ? NaN : 1 / t == +Infinity || 1 / t == -Infinity || t === +Infinity || t === -Infinity ? t : new Float32Array([t])[0] }), n(Math, "hypot", function () { for (var t = [], e = 0, r = !1, n = 0; n < arguments.length; ++n) { var o = H(Number(arguments[n])); if (o === Infinity) return o; o !== o && (r = !0), o > e && (e = o), t[n] = o } if (r) return NaN; if (0 === e) return 0; var i = 0; for (n = 0; n < t.length; ++n) { var a = t[n] / e; i += a * a } return e * Z(i) }), n(Math, "imul", function (t, e) { var r = c(t), n = c(e), o = 65535 & r, i = 65535 & n; return o * i + ((r >>> 16 & 65535) * i + o * (n >>> 16 & 65535) << 16 >>> 0) | 0 }, "imul" in Math && 0 === Math.imul(1, 2147483648)), n(Math, "log1p", function (t) { return (t = Number(t)) < -1 ? NaN : h(t, -0) ? -0 : H(t) > 1e-4 ? z(1 + t) : (-.5 * t + 1) * t }), n(Math, "log10", function (t) { return t = Number(t), z(t) * q }), n(Math, "log2", function (t) { return t = Number(t), z(t) * B }), n(Math, "sign", function (t) { return (t = Number(t)) < 0 ? -1 : t > 0 ? 1 : t }), n(Math, "sinh", function (t) { return t = Number(t), h(t, -0) ? t : (J(W, t) - J(W, -t)) / 2 }), n(Math, "tanh", function (t) { t = Number(t); var e = J(W, 2 * t) - 1, r = J(W, 2 * t) + 1; return h(t, -0) ? t : e === r ? 1 : e / r }), n(Math, "trunc", function (t) { return t = Number(t), L(t) ? NaN : t < 0 ? X(t) : V(t) }); var pt = function () { var t = {}, e = Symbol(); return t[Symbol.match] = function () { return e }, "".match(t) === e }(); n(String, "fromCodePoint", function () { for (var t = arguments, e = t.length, r = [], n = 0; n < e;) { var o = t[n], i = Number(o); if (!h(i, u(i)) || i < 0 || i > 1114111) throw RangeError("Invalid code point " + i); i < 65536 ? r.push(String.fromCharCode(i)) : (i -= 65536, r.push(String.fromCharCode(55296 + (i >> 10))), r.push(String.fromCharCode(i % 1024 + 56320))), n += 1 } return r.join("") }), n(String, "raw", function (t) { var e = [].slice.call(arguments, 1), r = Object(t).raw, n = Object(r), o = f(n.length); if (o <= 0) return ""; for (var i = [], a = 0; ;) { var u = n[a], c = String(u); if (i.push(c), a + 1 === o) return i.join(""); u = e[a]; var s = String(u); i.push(s), a += 1 } }), n(String.prototype, "codePointAt", function (t) { var r = e(this), n = String(r), o = u(t), i = n.length; if (o < 0 || o >= i) return C; var a = n.charCodeAt(o); if (a < 55296 || a > 56319 || o + 1 === i) return a; var c = n.charCodeAt(o + 1); return c < 56320 || c > 57343 ? a : 1024 * (a - 55296) + (c - 56320) + 65536 }), n(String.prototype, "endsWith", function (t) { var r = arguments[1], n = e(this), o = String(n), i = String(t), a = o.length, c = r === C ? a : u(r), s = K($(c, 0), a), f = i.length, l = s - f; return !(l < 0) && o.substring(l, l + f) === i }), n(String.prototype, "includes", function (t) { var r = arguments[1], n = e(this), o = String(n), i = String(t), a = u(r), c = o.length, s = K($(a, 0), c); return -1 !== o.indexOf(i, s) }), n(String.prototype, "match", function (t) { var r = e(this), n = String(r); if (m(t, at)) var o = t; else o = new RegExp(t); return o[at](n) }, !pt), n(String.prototype, "repeat", function (t) { var r = e(this), n = String(r), o = u(t); if (o < 0) throw RangeError(); if (o === Infinity) throw RangeError(); return new Array(o + 1).join(n) }), n(String.prototype, "replace", function (t, r) { var n = e(this); return m(t, ut) ? t[ut](n, r) : tt.call(n, t, r) }, !pt), n(String.prototype, "search", function (t) { var r = e(this), n = String(r); if (m(t, ct)) var o = t; else o = new RegExp(t); return o[ct](n) }, !pt), n(String.prototype, "split", function (t, r) { var n = e(this); return m(t, st) ? t[st](n, r) : rt.call(n, t, r) }, !pt), n(String.prototype, "startsWith", function (t) { var r = arguments[1], n = e(this), o = String(n), i = String(t), a = u(r), c = o.length, s = K($(a, 0), c), f = i.length; return !(f + s > c) && o.substring(s, s + f) === i }), n(String.prototype, it, function () { return N(this, "value") }); var ht = Object.create(ot); A.prototype = ht, n(ht, "next", function () { var t = s(this), e = String(t["[[IteratedString]]"]), r = t["[[StringIteratorNextIndex]]"]; if (r >= e.length) return o(t, "[[StringIteratorNextIndex]]", Infinity), T(C, !0); var n = e.codePointAt(r); return o(t, "[[StringIteratorNextIndex]]", r + (n > 65535 ? 2 : 1)), T(String.fromCodePoint(n), !1) }), n(ht, ft, "String Iterator"), "flags" in RegExp.prototype || Object.defineProperty(RegExp.prototype, "flags", { get: function () { var t = String(this); return t.substring(t.lastIndexOf("/") + 1) } }), n(RegExp.prototype, at, function (t) { var r = e(this); return Q.call(t, r) }), n(RegExp.prototype, ut, function (t, r) { var n = e(this); return tt.call(t, n, r) }), n(RegExp.prototype, ct, function (t) { var r = e(this); return et.call(t, r) }), n(RegExp.prototype, st, function (t, r) { var n = e(this); return rt.call(t, n, r) }), n(Array, "from", function (t) { var r = arguments[1], n = arguments[2], o = e(this); if (r === C) var i = !1; else { if (!l(r)) throw TypeError(); var a = n; i = !0 } var u = d(t, it); if (u !== C) { if (p(o)) var c = new o; else c = new Array(0); for (var h = g(t, u), y = 0; ;) { var v = S(h); if (!1 === v) return c.length = y, c; var m = w(v); if (i) var b = r.call(a, m); else b = m; c[y] = b, y += 1 } } var E = s(t), T = f(E.length); for (c = p(o) ? new o(T) : new Array(T), y = 0; y < T;) { var O = E[y]; b = i ? r.call(a, O, y) : O, c[y] = b, y += 1 } return c.length = T, c }), n(Array, "of", function () { var t, r = arguments, n = c(r.length), o = e(this); t = p(o) ? s(t = new o(n)) : new Array(n); for (var i = 0; i < n;)t[i] = r[i], i += 1; return t.length = n, t }), n(Array.prototype, "copyWithin", function (t, e) { var r = arguments[2], n = s(this), o = f(n.length); o = $(o, 0); var i, a = u(t); i = a < 0 ? $(o + a, 0) : K(a, o); var c, l = u(e); c = l < 0 ? $(o + l, 0) : K(l, o); var p, h; h = (p = r === C ? o : u(r)) < 0 ? $(o + p, 0) : K(p, o); var y, v = K(h - c, o - i); for (c < i && i < c + v ? (y = -1, c = c + v - 1, i = i + v - 1) : y = 1; v > 0;) { var d = String(c), b = String(i); if (m(n, d)) { var g = n[d]; n[b] = g } else delete n[b]; c += y, i += y, v -= 1 } return n }); var yt = "entries" in Array.prototype && "next" in [].entries(); n(Array.prototype, "entries", function () { return M(this, "key+value") }, !yt), n(Array.prototype, "fill", function (t) { var e = arguments[1], r = arguments[2], n = s(this), o = f(n.length); o = $(o, 0); var i, a = u(e); i = a < 0 ? $(o + a, 0) : K(a, o); var c, l; for (l = (c = r === C ? o : u(r)) < 0 ? $(o + c, 0) : K(c, o); i < l;)n[String(i)] = t, i += 1; return n }), n(Array.prototype, "find", function (t) { var e = s(this), r = u(e.length); if (!l(t)) throw TypeError(); for (var n = arguments.length > 1 ? arguments[1] : C, o = 0; o < r;) { var i = String(o); if (m(e, i)) { var a = e[i], c = t.call(n, a, o, e); if (Boolean(c)) return a } ++o } return C }), n(Array.prototype, "findIndex", function (t) { var e = s(this), r = f(e.length); if (!l(t)) throw TypeError(); for (var n = arguments.length > 1 ? arguments[1] : C, o = 0; o < r;) { var i = String(o); if (m(e, i)) { var a = e[i], u = t.call(n, a, o, e); if (Boolean(u)) return o } ++o } return -1 }), n(Array.prototype, "keys", function () { return M(this, "key") }, !yt), n(Array.prototype, "values", function () { return M(this, "value") }, !yt), n(Array.prototype, it, Array.prototype.values); var vt = Object.create(ot); D.prototype = vt, n(vt, "next", function () { var t = e(this); if ("object" !== a(t)) throw TypeError(); var r, n, i = t["[[IteratedObject]]"], u = t["[[ArrayIteratorNextIndex]]"], s = t["[[ArrayIterationKind]]"], f = c(i.length); if (-1 !== s.indexOf("sparse")) for (var l = !1; !l && u < f;)(l = m(i, r = String(u))) || (u += 1); if (u >= f) return o(t, "[[ArrayIteratorNextIndex]]", Infinity), T(C, !0); if (r = u, o(t, "[[ArrayIteratorNextIndex]]", u + 1), -1 !== s.indexOf("value") && (n = i[r]), -1 !== s.indexOf("key+value")) return T([r, n], !1); if (-1 !== s.indexOf("key")) return T(r, !1); if ("value" === s) return T(n, !1); throw Error("Internal error") }), n(vt, ft, "Array Iterator"), ["Int8Array", "Uint8Array", "Uint8ClampedArray", "Int16Array", "Uint16Array", "Int32Array", "Uint32Array", "Float32Array", "Float64Array"].forEach(function (r) { if (r in t) { var o = t[r]; n(o, "from", function (t) { var r = arguments[1], n = arguments[2], o = e(this); if (!p(o)) throw TypeError(); if (r === C) var i = !1; else { if (l(r)) throw TypeError(); var a = n; i = !0 } var u = d(t, it); if (u !== C) { for (var c = g(t, u), h = [], y = !0; !1 !== y;)if (!1 !== (y = S(c))) { var v = w(y); h.push(v) } for (var m = h.length, b = new o(m), E = 0; E < m;) { var T = h.shift(); if (i) var O = r.call(a, T); else O = T; b[E] = O, ++E } return b } var j = s(t); for (b = new o(m = f(j.length)), E = 0; E < m;)T = j[E], O = i ? r.call(a, T, E) : T, b[E] = O, ++E; return b }), n(o, "of", function () { for (var t = arguments, r = t.length, n = new (e(this))(r), o = 0; o < r;)n[o] = t[o], ++o; return n }), n(o.prototype, "copyWithin", Array.prototype.copyWithin), n(o.prototype, "entries", Array.prototype.entries), n(o.prototype, "every", Array.prototype.every), n(o.prototype, "fill", function (t) { var e = arguments[1], r = arguments[2], n = s(this), o = f(n.length); o = $(o, 0); var i, a = u(e); i = a < 0 ? $(o + a, 0) : K(a, o); var c, l; for (l = (c = r === C ? o : u(r)) < 0 ? $(o + c, 0) : K(c, o); i < l;)n[String(i)] = t, i += 1; return n }), n(o.prototype, "filter", function (t) { var e = arguments[1], r = s(this), n = f(r.length); if (!l(t)) throw TypeError(); for (var o = e, i = r.constructor, a = [], u = 0, c = 0; u < n;) { var p = r[u]; t.call(o, p, u, r) && (a.push(p), ++c), ++u } for (var h = new i(c), y = 0, v = 0; v < a.length; ++v) { var d = a[v]; h[y] = d, ++y } return h }), n(o.prototype, "find", Array.prototype.find), n(o.prototype, "findIndex", Array.prototype.findIndex), n(o.prototype, "forEach", Array.prototype.forEach), n(o.prototype, "indexOf", Array.prototype.indexOf), n(o.prototype, "join", Array.prototype.join), n(o.prototype, "keys", Array.prototype.keys), n(o.prototype, "lastIndexOf", Array.prototype.lastIndexOf), n(o.prototype, "map", function (t) { var e = arguments[1], r = s(this), n = f(r.length); if (!l(t)) throw TypeError(); var o = e, i = C, a = r.constructor; p(a) && (i = new a(n)), i === C && (i = new Array(n)); for (var u = 0; u < n;) { if (m(r, u)) { var c = r[u], h = t.call(o, c, u, r); i[u] = h } ++u } return i }), n(o.prototype, "reduce", Array.prototype.reduce), n(o.prototype, "reduceRight", Array.prototype.reduceRight), n(o.prototype, "reverse", Array.prototype.reverse), n(o.prototype, "slice", function (t, e) { var r = s(this), n = f(r.length), o = u(t), i = o < 0 ? $(n + o, 0) : K(o, n), a = e === C ? n : u(e), c = a < 0 ? $(n + a, 0) : K(a, n), l = c - i, h = r.constructor; if (!p(h)) throw TypeError(); for (var y = new h(l), v = 0; i < c;) { var d = r[i]; y[v] = d, ++i, ++v } return y }), n(o.prototype, "some", Array.prototype.some), n(o.prototype, "sort", function () { var t = arguments[0]; return Array.prototype.sort.call(this, function (e, r) { return e !== e && r !== r ? 0 : e !== e ? 1 : r !== r ? -1 : t !== C ? t(e, r) : e < r ? -1 : e > r ? 1 : 0 }) }), n(o.prototype, "values", Array.prototype.values), n(o.prototype, it, o.prototype.values), n(o.prototype, ft, r) } }), function () { function r() { var t = e(this), r = arguments[0]; if ("object" !== a(t)) throw TypeError(); if ("[[MapData]]" in t) throw TypeError(); if (r !== C) { var n = t.set; if (!l(n)) throw TypeError(); var i = g(s(r)) } if (o(t, "[[MapData]]", { keys: [], values: [] }), i === C) return t; for (; ;) { var u = S(i); if (!1 === u) return t; var c = w(u); if ("object" !== a(c)) throw TypeError(); var f = c[0], p = c[1]; n.call(t, f, p) } return t } function i(t, e) { var r; if (e === e) return t.keys.indexOf(e); for (r = 0; r < t.keys.length; r += 1)if (y(t.keys[r], e)) return r; return -1 } function u() { } function c(t, e) { if ("object" !== a(t)) throw TypeError(); if (!("[[MapData]]" in t)) throw TypeError(); if (t["[[MapData]]"] === C) throw TypeError(); var r = new u; return o(r, "[[Map]]", t), o(r, "[[MapNextIndex]]", 0), o(r, "[[MapIterationKind]]", e), r } "Map" in t && !I && !function () { try { return new t.Map([]), !1 } catch (e) { return !0 } }() && !function () { try { return !(new t.Map).entries().next } catch (e) { return !0 } }() && 1 === new t.Map([["a", 1]]).size || (t.Map = r); var f = {}; n(r.prototype = f, "clear", function () { var t = e(this); if ("object" !== a(t)) throw TypeError(); if (!("[[MapData]]" in t)) throw TypeError(); if (t["[[MapData]]"] === C) throw TypeError(); var r = t["[[MapData]]"]; return r.keys.length = 0, r.values.length = 0, C }), n(r.prototype, "delete", function (t) { var r = e(this); if ("object" !== a(r)) throw TypeError(); if (!("[[MapData]]" in r)) throw TypeError(); if (r["[[MapData]]"] === C) throw TypeError(); var n = r["[[MapData]]"], o = i(n, t); return !(o < 0) && (n.keys[o] = nt, n.values[o] = nt, !0) }), n(r.prototype, "entries", function () { var t = e(this); if ("object" !== a(t)) throw TypeError(); return c(t, "key+value") }), n(r.prototype, "forEach", function (t) { var r = arguments[1], n = e(this); if ("object" !== a(n)) throw TypeError(); if (!("[[MapData]]" in n)) throw TypeError(); if (n["[[MapData]]"] === C) throw TypeError(); var o = n["[[MapData]]"]; if (!l(t)) throw TypeError("First argument to forEach is not callable."); for (var i = 0; i < o.keys.length; ++i)o.keys[i] !== nt && t.call(r, o.values[i], o.keys[i], n); return C }), n(r.prototype, "get", function (t) { var r = e(this); if ("object" !== a(r)) throw TypeError(); if (!("[[MapData]]" in r)) throw TypeError(); if (r["[[MapData]]"] === C) throw TypeError(); var n = r["[[MapData]]"], o = i(n, t); return o >= 0 ? n.values[o] : C }), n(r.prototype, "has", function (t) { var r = e(this); if ("object" !== a(r)) throw TypeError(); if (!("[[MapData]]" in r)) throw TypeError(); if (r["[[MapData]]"] === C) throw TypeError(); return i(r["[[MapData]]"], t) >= 0 }), n(r.prototype, "keys", function () { var t = e(this); if ("object" !== a(t)) throw TypeError(); return c(t, "key") }), n(r.prototype, "set", function (t, r) { var n = e(this); if ("object" !== a(n)) throw TypeError(); if (!("[[MapData]]" in n)) throw TypeError(); if (n["[[MapData]]"] === C) throw TypeError(); var o = n["[[MapData]]"], u = i(o, t); return u < 0 && (u = o.keys.length), h(t, -0) && (t = 0), o.keys[u] = t, o.values[u] = r, n }), Object.defineProperty(r.prototype, "size", { get: function () { var t = e(this); if ("object" !== a(t)) throw TypeError(); if (!("[[MapData]]" in t)) throw TypeError(); if (t["[[MapData]]"] === C) throw TypeError(); for (var r = t["[[MapData]]"], n = 0, o = 0; o < r.keys.length; ++o)r.keys[o] !== nt && (n += 1); return n } }), n(r.prototype, "values", function () { var t = e(this); if ("object" !== a(t)) throw TypeError(); return c(t, "value") }), n(r.prototype, it, function () { var t = e(this); if ("object" !== a(t)) throw TypeError(); return c(t, "key+value") }), n(t.Map.prototype, ft, "Map"); var p = Object.create(ot); u.prototype = p, n(p, "next", function () { var t = e(this); if ("object" !== a(t)) throw TypeError(); for (var r = t["[[Map]]"], n = t["[[MapNextIndex]]"], i = t["[[MapIterationKind]]"], u = r["[[MapData]]"]; n < u.keys.length;) { var c = { key: u.keys[n], value: u.values[n] }; if (n = n += 1, o(t, "[[MapNextIndex]]", n), c.key !== nt) return "key" === i ? T(c.key, !1) : "value" === i ? T(c.value, !1) : T([c.key, c.value], !1) } return T(C, !0) }), n(p, ft, "Map Iterator") }(), function () { function r() { var t = e(this), r = arguments[0]; if ("object" !== a(t)) throw TypeError(); if ("[[SetData]]" in t) throw TypeError(); if (r !== C) { var n = t.add; if (!l(n)) throw TypeError(); var i = g(s(r)) } if (o(t, "[[SetData]]", []), i === C) return t; for (; ;) { var u = S(i); if (!1 === u) return t; var c = w(u); n.call(t, c) } return t } function i(t, e) { var r; if (e === e) return t.indexOf(e); for (r = 0; r < t.length; r += 1)if (y(t[r], e)) return r; return -1 } function u() { } function c(t, e) { if ("object" !== a(t)) throw TypeError(); if (!("[[SetData]]" in t)) throw TypeError(); if (t["[[SetData]]"] === C) throw TypeError(); var r = new u; return o(r, "[[IteratedSet]]", t), o(r, "[[SetNextIndex]]", 0), o(r, "[[SetIterationKind]]", e), r } "Set" in t && !I && !function () { try { return !(new t.Set).entries().next } catch (e) { return !0 } }() && 1 === new t.Set([1]).size || (t.Set = r); var f = {}; n(r.prototype = f, "add", function (t) { var r = e(this); if ("object" !== a(r)) throw TypeError(); if (!("[[SetData]]" in r)) throw TypeError(); if (r["[[SetData]]"] === C) throw TypeError(); h(t, -0) && (t = 0); var n = i(r["[[SetData]]"], t); return n < 0 && (n = r["[[SetData]]"].length), r["[[SetData]]"][n] = t, r }), n(r.prototype, "clear", function () { var t = e(this); if ("object" !== a(t)) throw TypeError(); if (!("[[SetData]]" in t)) throw TypeError(); if (t["[[SetData]]"] === C) throw TypeError(); return t["[[SetData]]"].length = 0, C }), n(r.prototype, "delete", function (t) { var r = e(this); if ("object" !== a(r)) throw TypeError(); if (!("[[SetData]]" in r)) throw TypeError(); if (r["[[SetData]]"] === C) throw TypeError(); var n = r["[[SetData]]"], o = i(n, t); return !(o < 0) && (n[o] = nt, !0) }), n(r.prototype, "entries", function () { var t = e(this); if ("object" !== a(t)) throw TypeError(); return c(t, "key+value") }), n(r.prototype, "forEach", function (t) { var r = arguments[1], n = e(this); if ("object" !== a(n)) throw TypeError(); if (!("[[SetData]]" in n)) throw TypeError(); if (n["[[SetData]]"] === C) throw TypeError(); var o = n["[[SetData]]"]; if (!l(t)) throw TypeError("First argument to forEach is not callable."); for (var i = 0; i < o.length; ++i)o[i] !== nt && t.call(r, o[i], o[i], n) }), n(r.prototype, "has", function (t) { var r = e(this); if ("object" !== a(r)) throw TypeError(); if (!("[[SetData]]" in r)) throw TypeError(); if (r["[[SetData]]"] === C) throw TypeError(); return -1 !== i(r["[[SetData]]"], t) }), Object.defineProperty(r.prototype, "size", { get: function () { var t = e(this); if ("object" !== a(t)) throw TypeError(); if (!("[[SetData]]" in t)) throw TypeError(); if (t["[[SetData]]"] === C) throw TypeError(); for (var r = t["[[SetData]]"], n = 0, o = 0; o < r.length; ++o)r[o] !== nt && (n += 1); return n } }), n(r.prototype, "values", function () { var t = e(this); if ("object" !== a(t)) throw TypeError(); return c(t, "value") }), r.prototype.keys = r.prototype.values, n(r.prototype, it, function () { var t = e(this); if ("object" !== a(t)) throw TypeError(); return c(t) }), n(t.Set.prototype, ft, "Set"); var p = Object.create(ot); u.prototype = p, n(p, "next", function () { var t = e(this); if ("object" !== a(t)) throw TypeError(); for (var r = t["[[IteratedSet]]"], n = t["[[SetNextIndex]]"], i = t["[[SetIterationKind]]"], u = r["[[SetData]]"]; n < u.length;) { var c = u[n]; if (n = n += 1, o(t, "[[SetNextIndex]]", n), c !== nt) return "key+value" === i ? T([c, c], !1) : T(c, !1) } return T(C, !0) }), n(p, ft, "Set Iterator") }(), function () { function r() { var t = e(this), r = arguments[0]; if ("object" !== a(t)) throw TypeError(); if ("[[WeakMapData]]" in t) throw TypeError(); if (r !== C) { var n = t.set; if (!l(n)) throw TypeError(); var u = g(s(r)) } if (o(t, "[[WeakMapData]]", new i), u === C) return t; for (; ;) { var c = S(u); if (!1 === c) return t; var f = w(c); if ("object" !== a(f)) throw TypeError(); var p = f[0], h = f[1]; n.call(t, p, h) } return t } "WeakMap" in t && !I || (t.WeakMap = r); var u = {}; n(r.prototype = u, "delete", function (t) { var r = e(this); if ("object" !== a(r)) throw TypeError(); if (r["[[WeakMapData]]"] === C) throw TypeError(); if ("object" !== a(t)) throw TypeError("Expected object"); return r["[[WeakMapData]]"].remove(t) }), n(r.prototype, "get", function (t, r) { var n = e(this); if ("object" !== a(n)) throw TypeError(); if (n["[[WeakMapData]]"] === C) throw TypeError(); if ("object" !== a(t)) throw TypeError("Expected object"); return n["[[WeakMapData]]"].get(t, r) }), n(r.prototype, "has", function (t) { var r = e(this); if ("object" !== a(r)) throw TypeError(); if (r["[[WeakMapData]]"] === C) throw TypeError(); if ("object" !== a(t)) throw TypeError("Expected object"); return r["[[WeakMapData]]"].has(t) }), n(r.prototype, "set", function (t, r) { var n = e(this); if ("object" !== a(n)) throw TypeError(); if (n["[[WeakMapData]]"] === C) throw TypeError(); if ("object" !== a(t)) throw TypeError("Expected object"); return n["[[WeakMapData]]"].set(t, r), n }), n(t.WeakMap.prototype, ft, "WeakMap"), function () { var e = new t.WeakMap, r = t.WeakMap.prototype.set; n(t.WeakMap.prototype, "set", function () { return r.apply(this, arguments), this }, e.set({}, 0) !== e) }() }(), function () { function r() { var t = e(this), r = arguments[0]; if ("object" !== a(t)) throw TypeError(); if ("[[WeakSetData]]" in t) throw TypeError(); if (r !== C) { var n = t.add; if (!l(n)) throw TypeError(); var u = g(s(r)) } if (o(t, "[[WeakSetData]]", new i), u === C) return t; for (; ;) { var c = S(u); if (!1 === c) return t; var f = w(c); n.call(t, f) } return t } "WeakSet" in t && !I || (t.WeakSet = r); var u = {}; n(r.prototype = u, "add", function (t) { var r = e(this); if ("object" !== a(r)) throw TypeError(); if (r["[[WeakSetData]]"] === C) throw TypeError(); if ("object" !== a(t)) throw TypeError("Expected object"); return r["[[WeakSetData]]"].set(t, !0), r }), n(r.prototype, "delete", function (t) { var r = e(this); if ("object" !== a(r)) throw TypeError(); if (r["[[WeakSetData]]"] === C) throw TypeError(); if ("object" !== a(t)) throw TypeError("Expected object"); return r["[[WeakSetData]]"].remove(t) }), n(r.prototype, "has", function (t) { var r = e(this); if ("object" !== a(r)) throw TypeError(); if (r["[[WeakSetData]]"] === C) throw TypeError(); if ("object" !== a(t)) throw TypeError("Expected object"); return r["[[WeakSetData]]"].has(t) }), n(t.WeakSet.prototype, ft, "WeakSet"), function () { var e = new t.WeakSet, r = t.WeakSet.prototype.add; n(t.WeakSet.prototype, "add", function () { return r.apply(this, arguments), this }, e.add({}) !== e) }() }(), "ArrayBuffer" in t && (n(ArrayBuffer, "isView", function (t) { return "object" === a(t) && ("buffer" in t && t.buffer instanceof ArrayBuffer) }), n(ArrayBuffer.prototype, ft, "ArrayBuffer")), "DataView" in t && n(DataView.prototype, ft, "DataView"), n(JSON, ft, "JSON"), n(ot, it, function () { return this }), function () { function r(t) { var e = { "[[value]]": !1 }, r = u(); o(r, "[[Promise]]", t), o(r, "[[AlreadyResolved]]", e); var n = i(); return o(n, "[[Promise]]", t), o(n, "[[AlreadyResolved]]", e), { "[[Resolve]]": r, "[[Reject]]": n } } function i() { var t = function (e) { var r = t["[[Promise]]"], n = t["[[AlreadyResolved]]"]; return n["[[value]]"] ? C : (o(n, "[[value]]", !0), v(r, e)) }; return t } function u() { var t = function (e) { var r = t["[[Promise]]"], n = t["[[AlreadyResolved]]"]; if (n["[[value]]"]) return C; if (o(n, "[[value]]", !0), h(e, r)) { var i = TypeError(); return v(r, i) } if ("object" !== a(e)) return c(r, e); try { var u = e.then } catch (u) { return v(r, u) } return l(u) ? (O("PromiseJobs", b, [r, e, u]), C) : c(r, e) }; return t } function c(t, e) { var r = t["[[PromiseFulfillReactions]]"]; return o(t, "[[PromiseResult]]", e), o(t, "[[PromiseFulfillReactions]]", C), o(t, "[[PromiseRejectReactions]]", C), o(t, "[[PromiseState]]", "fulfilled"), d(r, e) } function s(t) { return f(C, t) } function f(t, e) { var r = {}; o(r, "[[Promise]]", t), o(r, "[[Resolve]]", C), o(r, "[[Reject]]", C); var n = p(); o(n, "[[Capability]]", r); var i = t = new e(n); if (o(r, "[[Promise]]", t), !l(r["[[Resolve]]"])) throw TypeError(); if (!l(r["[[Reject]]"])) throw TypeError(); if ("object" === a(i) && !h(t, i)) throw TypeError(); return r } function p() { var t = function (e, r) { var n = t["[[Capability]]"]; if (n["[[Resolve]]"] !== C) throw TypeError(); if (n["[[Reject]]"] !== C) throw TypeError(); return o(n, "[[Resolve]]", e), o(n, "[[Reject]]", r), C }; return t } function y(t) { return "object" === a(t) && ("[[PromiseState]]" in t && t["[[PromiseState]]"] !== C) } function v(t, e) { var r = t["[[PromiseRejectReactions]]"]; return o(t, "[[PromiseResult]]", e), o(t, "[[PromiseFulfillReactions]]", C), o(t, "[[PromiseRejectReactions]]", C), o(t, "[[PromiseState]]", "rejected"), d(r, e) } function d(t, e) { for (var r = 0, n = t.length; r < n; ++r)O("PromiseJobs", m, [t[r], e]); return C } function m(t, e) { var r, n, o = t["[[Capabilities]]"], i = t["[[Handler]]"]; try { if ("Identity" === i) r = e; else { if ("Thrower" === i) throw e; r = i.call(C, e) } } catch (r) { return n = o["[[Reject]]"].call(C, r), void j(n) } j(n = o["[[Resolve]]"].call(C, r)) } function b(t, e, n) { var o = r(t); try { var i = n.call(e, o["[[Resolve]]"], o["[[Reject]]"]) } catch (i) { return void j(o["[[Reject]]"].call(C, i)) } j(i) } function E(t) { var e = { configurable: !1, enumerable: !1, writable: !0, value: C }; Object.defineProperty(this, "[[PromiseState]]", e), Object.defineProperty(this, "[[PromiseConstructor]]", e), Object.defineProperty(this, "[[PromiseResult]]", e), Object.defineProperty(this, "[[PromiseFulfillReactions]]", e), Object.defineProperty(this, "[[PromiseRejectReactions]]", e); var r = this; if ("object" !== a(r)) throw new TypeError; if (!("[[PromiseState]]" in r)) throw TypeError(); if (r["[[PromiseState]]"] !== C) throw TypeError(); if (!l(t)) throw TypeError(); return o(r, "[[PromiseConstructor]]", E), T(r, t) } function T(t, e) { o(t, "[[PromiseState]]", "pending"), o(t, "[[PromiseFulfillReactions]]", []), o(t, "[[PromiseRejectReactions]]", []); var n = r(t); try { var i = e.call(C, n["[[Resolve]]"], n["[[Reject]]"]) } catch (i) { n["[[Reject]]"].call(C, i) } return t } function _() { var t = function (e) { var r = t["[[AlreadyCalled]]"]; if (r.value) return C; r.value = !0; var n = t["[[Index]]"], o = t["[[Values]]"], i = t["[[Capabilities]]"], a = t["[[RemainingElements]]"]; try { o[n] = e } catch (u) { return i["[[Reject]]"].call(C, u), i["[[Promise]]"] } return a.value -= 1, 0 === a.value ? i["[[Resolve]]"].call(C, o) : C }; return t } n(E, "all", function (t) { var r = e(this), n = s(r); try { var i = g(t) } catch (y) { return n["[[Reject]]"].call(C, y), n["[[Promise]]"] } for (var a = [], u = { value: 1 }, c = 0; ;) { try { var f = S(i) } catch (y) { return n["[[Reject]]"].call(C, y), n["[[Promise]]"] } if (!f) { if (u.value -= 1, 0 === u.value) n["[[Resolve]]"].apply(C, a); return n["[[Promise]]"] } try { var l = w(f) } catch (y) { return n["[[Reject]]"].call(C, y), n["[[Promise]]"] } try { var p = r.resolve(l) } catch (y) { return n["[[Reject]]"].call(C, y), n["[[Promise]]"] } var h = _(); o(h, "[[AlreadyCalled]]", { value: !1 }), o(h, "[[Index]]", c), o(h, "[[Values]]", a), o(h, "[[Capabilities]]", n), o(h, "[[RemainingElements]]", u), u.value += 1; try { p.then(h, n["[[Reject]]"]) } catch (y) { return n["[[Reject]]"].call(C, y), n["[[Promise]]"] } c += 1 } }), E.prototype = {}, n(E, "race", function (t) { var r = e(this), n = s(r); try { var o = g(t) } catch (c) { return n["[[Reject]]"].call(C, c), n["[[Promise]]"] } for (; ;) { try { var i = S(o) } catch (c) { return n["[[Reject]]"].call(C, c), n["[[Promise]]"] } if (!i) return n["[[Promise]]"]; try { var a = w(i) } catch (c) { return n["[[Reject]]"].call(C, c), n["[[Promise]]"] } try { var u = r.resolve(a) } catch (c) { return n["[[Reject]]"].call(C, c), n["[[Promise]]"] } try { u.then(n["[[Resolve]]"], n["[[Reject]]"]) } catch (c) { return n["[[Reject]]"].call(C, c), n["[[Promise]]"] } } }), n(E, "reject", function (t) { var r = s(e(this)); r["[[Reject]]"].call(C, t); return r["[[Promise]]"] }), n(E, "resolve", function (t) { var r = e(this); if (y(t) && h(t["[[PromiseConstructor]]"], r)) return t; var n = s(r); n["[[Resolve]]"].call(C, t); return n["[[Promise]]"] }), n(E.prototype, "catch", function (t) { return this.then(C, t) }), E.prototype.constructor = E, n(E.prototype, "then", function (t, e) { var r = this; if (!y(r)) throw TypeError(); l(t) || (t = "Identity"), l(e) || (e = "Thrower"); var n = s(r.constructor), o = { "[[Capabilities]]": n, "[[Handler]]": t }, i = { "[[Capabilities]]": n, "[[Handler]]": e }; return "pending" === r["[[PromiseState]]"] ? (r["[[PromiseFulfillReactions]]"].push(o), r["[[PromiseRejectReactions]]"].push(i)) : "fulfilled" === r["[[PromiseState]]"] ? O("PromiseJobs", m, [o, r["[[PromiseResult]]"]]) : "rejected" === r["[[PromiseState]]"] && O("PromiseJobs", m, [i, r["[[PromiseResult]]"]]), n["[[Promise]]"] }), "Promise" in t && !I || (t.Promise = E), "cast" in t.Promise && (t.Promise.resolve = t.Promise.cast) }(), n(Promise.prototype, ft, "Promise"), "Reflect" in t && !I || (t.Reflect = {}), n(Reflect, "apply", function (t, e, r) { if (!l(t)) throw TypeError(); return Function.prototype.apply.call(t, e, r) }), n(Reflect, "construct", function (t, e) { return __cons(t, e) }), n(Reflect, "defineProperty", function (t, e, r) { try { return Object.defineProperty(t, e, r), !0 } catch (n) { return !1 } }), n(Reflect, "deleteProperty", function (t, e) { try { return delete t[e], !b(t, e) } catch (r) { return !1 } }), n(Reflect, "enumerate", function (t) { return _(t = s(t)) }), n(Reflect, "get", function (t, e, n) { t = s(t), e = String(e), n = n === C ? t : s(n); var o = r(t, e); return o && "get" in o ? Function.prototype.call.call(o.get, n) : t[e] }), n(Reflect, "getOwnPropertyDescriptor", Object.getOwnPropertyDescriptor), n(Reflect, "getPrototypeOf", Object.getPrototypeOf), n(Reflect, "has", function (t, e) { return String(e) in s(t) }), n(Reflect, "isExtensible", Object.isExtensible), n(Reflect, "ownKeys", function (t) { var e = s(t); return Object.getOwnPropertyNames(e) }), n(Reflect, "preventExtensions", function (t) { try { return Object.preventExtensions(t), !0 } catch (e) { return !1 } }), n(Reflect, "set", function (t, e, n, o) { t = s(t), e = String(e), o = o === C ? t : s(o); var i = r(t, e); try { return i && "set" in i ? Function.prototype.call.call(i.set, o, n) : t[e] = n, !0 } catch (a) { return !1 } }), n(Reflect, "setPrototypeOf", function (t, e) { try { return t.__proto__ = e, Reflect.getPrototypeOf(t) === e } catch (r) { return !1 } }) }(self), function (t) { "use strict"; function e(t) { return t = Number(t), a(t) ? 0 : 0 === t || t === Infinity || t === -Infinity ? t : (t < 0 ? -1 : 1) * c(u(t)) } function r(t) { if (null === t || t === i) throw TypeError(); return Object(t) } function n(t) { var r = e(t); return r <= 0 ? 0 : s(r, 9007199254740991) } function o(t, e) { if (typeof t != typeof e) return !1; switch (typeof t) { case "undefined": return !0; case "number": return t !== t && e !== e || t === e; case "boolean": case "string": case "object": default: return t === e } } var i = void 0, a = t.isNaN, u = Math.abs, c = Math.floor, s = (Math.max, Math.min); !function (t, e, r, n) { e in t && !n || ("function" == typeof r ? Object.defineProperty(t, e, { value: r, configurable: !0, enumerable: !1, writable: !0 }) : Object.defineProperty(t, e, { value: r, configurable: !1, enumerable: !1, writable: !1 })) }(Array.prototype, "includes", function (t) { var i = arguments[1], a = r(this), u = n(a.length); if (0 === u) return !1; var c = e(i); if (c >= 0) var s = c; else (s = u + c) < 0 && (s = 0); for (; s < u;) { a[s]; if (o(a[s], t)) return !0; s += 1 } return !1 }) }(this), function (t) { "use strict"; function e(t, e, r, n) { e in t && !n || ("function" == typeof r ? Object.defineProperty(t, e, { value: r, configurable: !0, enumerable: !1, writable: !0 }) : Object.defineProperty(t, e, { value: r, configurable: !1, enumerable: !1, writable: !1 })) } function r(t) { return t = Number(t), c(t) ? 0 : 0 === t || t === Infinity || t === -Infinity ? t : (t < 0 ? -1 : 1) * f(s(t)) } function n(t) { if (null === t || t === u) throw TypeError(); return Object(t) } function o(t) { var e = r(t); return e <= 0 ? 0 : l(e, 9007199254740991) } function i(t, e, r) { Object.defineProperty(t, e, { value: r, writable: !0, enumerable: !0, configurable: !0 }) } function a(t, e) { var r = []; return Object.keys(t).forEach(function (n) { var o = Object.getOwnPropertyDescriptor(t, n); if (o && o.enumerable) if ("key" === e) r.push(n); else { var i = t[n]; "value" === e ? r.push(i) : r.push([n, i]) } }), r } var u = void 0, c = t.isNaN, s = Math.abs, f = Math.floor, l = Math.min; e(Object, "entries", function (t) { return a(n(t), "key+value") }), e(Object, "getOwnPropertyDescriptors", function (t) { for (var e = n(t), r = Object.getOwnPropertyNames(e), o = {}, a = 0; a < r.length; ++a) { var u = r[a]; i(o, u, Object.getOwnPropertyDescriptor(e, u)) } return o }), e(Object, "values", function (t) { return a(n(t), "value") }), e(String.prototype, "padEnd", function (t) { var e = arguments[1], r = String(this), n = r.length; if (e === u) var i = ""; else i = String(e); "" === i && (i = " "); var a = o(t); if (a <= n) return r; for (var c = a - n, s = ""; s.length < c;)s += i; return r + s.substring(0, c) }), e(String.prototype, "padStart", function (t) { var e = arguments[1], r = String(this), n = r.length; if (e === u) var i = ""; else i = String(e); "" === i && (i = " "); var a = o(t); if (a <= n) return r; for (var c = a - n, s = ""; s.length < c;)s += i; return s.substring(0, c) + r }) }(this), function (t) { "use strict"; "window" in t && "document" in t && ("head" in document || (document.head = document.getElementsByTagName("head")[0]), ["abbr", "article", "aside", "audio", "bdi", "canvas", "data", "datalist", "details", "dialog", "figcaption", "figure", "footer", "header", "hgroup", "main", "mark", "meter", "nav", "output", "picture", "progress", "section", "summary", "template", "time", "video"].forEach(function (t) { document.createElement(t) }), !("dataset" in document.createElement("span")) && "Element" in t && Element.prototype && Object.defineProperty && Object.defineProperty(Element.prototype, "dataset", { get: function () { for (var t = Object.create(null), e = 0; e < this.attributes.length; ++e) { var r = this.attributes[e]; r.specified && "data-" === r.name.substring(0, 5) && function (e, r) { var n = r.replace(/-([a-z])/g, function (t, e) { return e.toUpperCase() }); t[n] = e.getAttribute("data-" + r), Object.defineProperty(t, n, { get: function () { return e.getAttribute("data-" + r) }, set: function (t) { e.setAttribute("data-" + r, t) } }) }(this, r.name.substring(5)) } return t } }), function () { if (!("atob" in t && "btoa" in t)) { var e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; t.atob = function (t) { var r = 0, n = [], o = 0, i = 0; if ((t = (t = String(t)).replace(/\s/g, "")).length % 4 == 0 && (t = t.replace(/=+$/, "")), t.length % 4 == 1) throw Error("InvalidCharacterError"); if (/[^+/0-9A-Za-z]/.test(t)) throw Error("InvalidCharacterError"); for (; r < t.length;)o = o << 6 | e.indexOf(t.charAt(r)), 24 === (i += 6) && (n.push(String.fromCharCode(o >> 16 & 255)), n.push(String.fromCharCode(o >> 8 & 255)), n.push(String.fromCharCode(255 & o)), i = 0, o = 0), r += 1; return 12 === i ? (o >>= 4, n.push(String.fromCharCode(255 & o))) : 18 === i && (o >>= 2, n.push(String.fromCharCode(o >> 8 & 255)), n.push(String.fromCharCode(255 & o))), n.join("") }, t.btoa = function (t) { t = String(t); var r, n, o, i, a, u, c, s = 0, f = []; if (/[^\x00-\xFF]/.test(t)) throw Error("InvalidCharacterError"); for (; s < t.length;)i = (r = t.charCodeAt(s++)) >> 2, a = (3 & r) << 4 | (n = t.charCodeAt(s++)) >> 4, u = (15 & n) << 2 | (o = t.charCodeAt(s++)) >> 6, c = 63 & o, s === t.length + 2 ? (u = 64, c = 64) : s === t.length + 1 && (c = 64), f.push(e.charAt(i), e.charAt(a), e.charAt(u), e.charAt(c)); return f.join("") } } }(), function () { function e(t) { return t.offsetWidth > 0 && t.offsetHeight > 0 } function r() { var t = o; o = Object.create(null), a = -1, Object.keys(t).forEach(function (r) { var n = t[r]; n.element && !e(n.element) || n.callback(Date.now()) }) } if (!("requestAnimationFrame" in t)) { var n = 60, o = Object.create(null), i = 0, a = -1; t.requestAnimationFrame = function (e, u) { var c = ++i; return o[c] = { callback: e, element: u }, -1 === a && (a = t.setTimeout(r, 1e3 / n)), c }, t.cancelAnimationFrame = function (e) { delete o[e], 0 === Object.keys(o).length && (t.clearTimeout(a), a = -1) } } }()) }(self), function (t) { "use strict"; function e(e, r) { "Element" in t && Element.prototype && Object.defineProperty && Object.defineProperty(Element.prototype, e, { get: r }) } function r(t, e) { t && Object.keys(e).forEach(function (r) { if (!(r in t || r in t.prototype)) try { Object.defineProperty(t.prototype, r, Object.getOwnPropertyDescriptor(e, r)) } catch (n) { t[r] = e[r] } }) } function n(t) { var e = null; return 1 === (t = t.map(function (t) { return t instanceof Node ? t : document.createTextNode(t) })).length ? e = t[0] : (e = document.createDocumentFragment(), t.forEach(function (t) { e.appendChild(t) })), e } if ("window" in t && "document" in t) { document.querySelectorAll || (document.querySelectorAll = function (t) { var e, r = document.createElement("style"), n = []; for (document.documentElement.firstChild.appendChild(r), document._qsa = [], r.styleSheet.cssText = t + "{x-qsa:expression(document._qsa && document._qsa.push(this))}", window.scrollBy(0, 0), r.parentNode.removeChild(r); document._qsa.length;)(e = document._qsa.shift()).style.removeAttribute("x-qsa"), n.push(e); return document._qsa = null, n }), document.querySelector || (document.querySelector = function (t) { var e = document.querySelectorAll(t); return e.length ? e[0] : null }), document.getElementsByClassName || (document.getElementsByClassName = function (t) { return t = String(t).replace(/^|\s+/g, "."), document.querySelectorAll(t) }), t.Node = t.Node || function () { throw TypeError("Illegal constructor") }, [["ELEMENT_NODE", 1], ["ATTRIBUTE_NODE", 2], ["TEXT_NODE", 3], ["CDATA_SECTION_NODE", 4], ["ENTITY_REFERENCE_NODE", 5], ["ENTITY_NODE", 6], ["PROCESSING_INSTRUCTION_NODE", 7], ["COMMENT_NODE", 8], ["DOCUMENT_NODE", 9], ["DOCUMENT_TYPE_NODE", 10], ["DOCUMENT_FRAGMENT_NODE", 11], ["NOTATION_NODE", 12]].forEach(function (e) { e[0] in t.Node || (t.Node[e[0]] = e[1]) }), t.DOMException = t.DOMException || function () { throw TypeError("Illegal constructor") }, [["INDEX_SIZE_ERR", 1], ["DOMSTRING_SIZE_ERR", 2], ["HIERARCHY_REQUEST_ERR", 3], ["WRONG_DOCUMENT_ERR", 4], ["INVALID_CHARACTER_ERR", 5], ["NO_DATA_ALLOWED_ERR", 6], ["NO_MODIFICATION_ALLOWED_ERR", 7], ["NOT_FOUND_ERR", 8], ["NOT_SUPPORTED_ERR", 9], ["INUSE_ATTRIBUTE_ERR", 10], ["INVALID_STATE_ERR", 11], ["SYNTAX_ERR", 12], ["INVALID_MODIFICATION_ERR", 13], ["NAMESPACE_ERR", 14], ["INVALID_ACCESS_ERR", 15]].forEach(function (e) { e[0] in t.DOMException || (t.DOMException[e[0]] = e[1]) }), function () { function e(t, e, r) { if ("function" == typeof e) { "DOMContentLoaded" === t && (t = "load"); var n = this, o = function (t) { t._timeStamp = Date.now(), t._currentTarget = n, e.call(this, t), t._currentTarget = null }; this["_" + t + e] = o, this.attachEvent("on" + t, o) } } function r(t, e, r) { if ("function" == typeof e) { "DOMContentLoaded" === t && (t = "load"); var n = this["_" + t + e]; n && (this.detachEvent("on" + t, n), this["_" + t + e] = null) } } "Element" in t && !Element.prototype.addEventListener && Object.defineProperty && (Event.CAPTURING_PHASE = 1, Event.AT_TARGET = 2, Event.BUBBLING_PHASE = 3, Object.defineProperties(Event.prototype, { CAPTURING_PHASE: { get: function () { return 1 } }, AT_TARGET: { get: function () { return 2 } }, BUBBLING_PHASE: { get: function () { return 3 } }, target: { get: function () { return this.srcElement } }, currentTarget: { get: function () { return this._currentTarget } }, eventPhase: { get: function () { return this.srcElement === this.currentTarget ? Event.AT_TARGET : Event.BUBBLING_PHASE } }, bubbles: { get: function () { switch (this.type) { case "click": case "dblclick": case "mousedown": case "mouseup": case "mouseover": case "mousemove": case "mouseout": case "mousewheel": case "keydown": case "keypress": case "keyup": case "resize": case "scroll": case "select": case "change": case "submit": case "reset": return !0 }return !1 } }, cancelable: { get: function () { switch (this.type) { case "click": case "dblclick": case "mousedown": case "mouseup": case "mouseover": case "mouseout": case "mousewheel": case "keydown": case "keypress": case "keyup": case "submit": return !0 }return !1 } }, timeStamp: { get: function () { return this._timeStamp } }, stopPropagation: { value: function () { this.cancelBubble = !0 } }, preventDefault: { value: function () { this.returnValue = !1 } }, defaultPrevented: { get: function () { return !1 === this.returnValue } } }), [Window, HTMLDocument, Element].forEach(function (t) { t.prototype.addEventListener = e, t.prototype.removeEventListener = r })) }(), function () { function e(t, e) { e = e || { bubbles: !1, cancelable: !1, detail: undefined }; var r = document.createEvent("CustomEvent"); return r.initCustomEvent(t, e.bubbles, e.cancelable, e.detail), r } "CustomEvent" in t && "function" == typeof t.CustomEvent || (e.prototype = t.Event.prototype, t.CustomEvent = e) }(), window.addEvent = function (t, e, r) { t.addEventListener ? t.addEventListener(e, r, !1) : t.attachEvent && (t["e" + e + r] = r, t[e + r] = function () { var n = window.event; n.currentTarget = t, n.preventDefault = function () { n.returnValue = !1 }, n.stopPropagation = function () { n.cancelBubble = !0 }, n.target = n.srcElement, n.timeStamp = Date.now(), t["e" + e + r].call(this, n) }, t.attachEvent("on" + e, t[e + r])) }, window.removeEvent = function (t, e, r) { t.removeEventListener ? t.removeEventListener(e, r, !1) : t.detachEvent && (t.detachEvent("on" + e, t[e + r]), t[e + r] = null, t["e" + e + r] = null) }, function () { function r(t, e) { function r(t) { return t.length ? t.split(/\s+/g) : [] } function n(t, e) { var n = r(e), o = n.indexOf(t); return -1 !== o && n.splice(o, 1), n.join(" ") } if (Object.defineProperties(this, { length: { get: function () { return r(t[e]).length } }, item: { value: function (n) { var o = r(t[e]); return 0 <= n && n < o.length ? o[n] : null } }, contains: { value: function (n) { return n = String(n), -1 !== r(t[e]).indexOf(n) } }, add: { value: function () { var n = Array.prototype.slice.call(arguments).map(String); if (n.some(function (t) { return 0 === t.length })) throw SyntaxError(); if (n.some(function (t) { return /\s/.test(t) })) throw Error("InvalidCharacterError"); try { var o = t[e], i = r(o); if (0 === (n = n.filter(function (t) { return -1 === i.indexOf(t) })).length) return; 0 === o.length || /\s$/.test(o) || (o += " "), o += n.join(" "), t[e] = o } finally { var a = r(t[e]).length; this.length !== a && (this.length = a) } } }, remove: { value: function () { var o = Array.prototype.slice.call(arguments).map(String); if (o.some(function (t) { return 0 === t.length })) throw SyntaxError(); if (o.some(function (t) { return /\s/.test(t) })) throw Error("InvalidCharacterError"); try { var i = t[e]; o.forEach(function (t) { i = n(t, i) }), t[e] = i } finally { var a = r(t[e]).length; this.length !== a && (this.length = a) } } }, toggle: { value: function (o) { var i = arguments[1]; try { if (0 === (o = String(o)).length) throw SyntaxError(); if (/\s/.test(o)) throw Error("InvalidCharacterError"); var a = r(t[e]).indexOf(o); if (-1 !== a && (!i || void 0 === i)) return t[e] = n(o, t[e]), !1; if (-1 !== a && i) return !0; var u = t[e]; return 0 === u.length || /\s$/.test(u) || (u += " "), u += o, t[e] = u, !0 } finally { var c = r(t[e]).length; this.length !== c && (this.length = c) } } }, toString: { value: function () { return t[e] } } }), "length" in this) for (var o = 0; o < 100; ++o)Object.defineProperty(this, String(o), { get: function (t) { return function () { return this.item(t) } }(o) }); else this.length = r(t[e]).length } "classList" in document.createElement("span") ? window.getClassList = function (t) { return t.classList } : (window.getClassList = function (t) { return new r(t, "className") }, e("classList", function () { return new r(this, "className") })), "relList" in document.createElement("link") ? window.getRelList = function (t) { return t.relList } : (window.getRelList = function (t) { return new r(t, "rel") }, e("relList", function () { return new r(this, "rel") })), function () { if ("DOMTokenList" in t) { var e = document.createElement("span"); "classList" in e && (e.classList.toggle("x", !1), e.classList.contains("x") && (t.DOMTokenList.prototype.toggle = function (t) { var e = arguments[1]; if (e === undefined) { var r = !this.contains(t); return this[r ? "add" : "remove"](t), r } return e = !!e, this[e ? "add" : "remove"](t), e })) } }() }(), "previousElementSibling" in document.documentElement || e("previousElementSibling", function () { for (var t = this.previousSibling; t && t.nodeType !== Node.ELEMENT_NODE;)t = t.previousSibling; return t }), "nextElementSibling" in document.documentElement || e("nextElementSibling", function () { for (var t = this.nextSibling; t && t.nodeType !== Node.ELEMENT_NODE;)t = t.nextSibling; return t }), "Element" in t && !Element.prototype.matches && (Element.prototype.msMatchesSelector ? Element.prototype.matches = Element.prototype.msMatchesSelector : Element.prototype.oMatchesSelector ? Element.prototype.matches = Element.prototype.oMatchesSelector : Element.prototype.mozMatchesSelector ? Element.prototype.matches = Element.prototype.mozMatchesSelector : Element.prototype.webkitMatchesSelector ? Element.prototype.matches = Element.prototype.webkitMatchesSelector : document.querySelectorAll && (Element.prototype.matches = function (t) { for (var e = (this.document || this.ownerDocument).querySelectorAll(t), r = e.length; --r >= 0 && e.item(r) !== this;); return r > -1 })), window.Element && !Element.prototype.closest && (Element.prototype.closest = function (t) { var e, r = (this.document || this.ownerDocument).querySelectorAll(t), n = this; do { for (e = r.length; --e >= 0 && r.item(e) !== n;); } while (e < 0 && (n = n.parentElement)); return n }); var o = { prepend: function () { var t = [].slice.call(arguments); t = n(t), this.insertBefore(t, this.firstChild) }, append: function () { var t = [].slice.call(arguments); t = n(t), this.appendChild(t) } }; r(t.Document || t.HTMLDocument, o), r(t.DocumentFragment, o), r(t.Element, o), "firstElementChild" in document.documentElement || e("firstElementChild", function () { for (var t = this.children, e = 0, r = t.length; e < r; ++e) { var n = t[e]; if (n.nodeType === Node.ELEMENT_NODE) return n } return null }), "lastElementChild" in document.documentElement || e("lastElementChild", function () { for (var t = this.children, e = t.length - 1; e >= 0; --e) { var r = t[e]; if (r.nodeType === Node.ELEMENT_NODE) return r } return null }), "childElementCount" in document.documentElement || e("childElementCount", function () { for (var t = 0, e = this.children, r = 0, n = e.length; r < n; ++r)e[r].nodeType === Node.ELEMENT_NODE && ++t; return t }); var i = { before: function () { var t = [].slice.call(arguments), e = this.parentNode; if (e) { for (var r = this.previousSibling; -1 !== t.indexOf(r);)r = r.previousSibling; var o = n(t); e.insertBefore(o, r ? r.nextSibling : e.firstChild) } }, after: function () { var t = [].slice.call(arguments), e = this.parentNode; if (e) { for (var r = this.nextSibling; -1 !== t.indexOf(r);)r = r.nextSibling; var o = n(t); e.insertBefore(o, r) } }, replaceWith: function () { var t = [].slice.call(arguments), e = this.parentNode; if (e) { for (var r = this.nextSibling; -1 !== t.indexOf(r);)r = r.nextSibling; var o = n(t); this.parentNode === e ? e.replaceChild(o, this) : e.insertBefore(o, r) } }, remove: function () { this.parentNode && this.parentNode.removeChild(this) } }; r(t.DocumentType, i), r(t.Element, i), r(t.CharacterData, i) } }(self), function (t) { "use strict"; "window" in t && "document" in t && (t.XMLHttpRequest = t.XMLHttpRequest || function () { try { return new ActiveXObject("Msxml2.XMLHTTP.6.0") } catch (t) { } try { return new ActiveXObject("Msxml2.XMLHTTP.3.0") } catch (t) { } try { return new ActiveXObject("Msxml2.XMLHTTP") } catch (t) { } throw Error("This browser does not support XMLHttpRequest.") }, [["UNSENT", 0], ["OPENED", 1], ["HEADERS_RECEIVED", 2], ["LOADING", 3], ["DONE", 4]].forEach(function (e) { e[0] in t.XMLHttpRequest || (t.XMLHttpRequest[e[0]] = e[1]) }), function () { function e(t) { if (this._data = [], t) for (var e = 0; e < t.elements.length; ++e) { var r = t.elements[e]; "" !== r.name && this.append(r.name, r.value) } } if (!("FormData" in t)) { e.prototype = { append: function (e, r) { if ("Blob" in t && r instanceof t.Blob) throw TypeError("Blob not supported"); e = String(e), this._data.push([e, r]) }, toString: function () { return this._data.map(function (t) { return encodeURIComponent(t[0]) + "=" + encodeURIComponent(t[1]) }).join("&") } }, t.FormData = e; var r = t.XMLHttpRequest.prototype.send; t.XMLHttpRequest.prototype.send = function (t) { return t instanceof e && (this.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), arguments[0] = t.toString()), r.apply(this, arguments) } } }()) }(self), function (t) { "use strict"; "window" in t && "document" in t && "TextRectangle" in t && !("width" in t.TextRectangle.prototype) && Object.defineProperties(t.TextRectangle.prototype, { width: { get: function () { return this.right - this.left } }, height: { get: function () { return this.bottom - this.top } } }) }(self), function (t) { "use strict"; function e(e) { return !!e && ("Symbol" in t && "iterator" in t.Symbol && "function" == typeof e[Symbol.iterator] || !!Array.isArray(e)) } function r(t) { return "from" in Array ? Array.from(t) : Array.prototype.slice.call(t) } !function () { function n(t) { var e = "", r = !0; return t.forEach(function (t) { var n = encodeURIComponent(t.name), o = encodeURIComponent(t.value); r || (e += "&"), e += n + "=" + o, r = !1 }), e.replace(/%20/g, "+") } function o(t, e) { var r = t.split("&"); e && -1 === r[0].indexOf("=") && (r[0] = "=" + r[0]); var n = []; r.forEach(function (t) { if (0 !== t.length) { var e = t.indexOf("="); if (-1 !== e) var r = t.substring(0, e), o = t.substring(e + 1); else r = t, o = ""; r = r.replace(/\+/g, " "), o = o.replace(/\+/g, " "), n.push({ name: r, value: o }) } }); var o = []; return n.forEach(function (t) { o.push({ name: decodeURIComponent(t.name), value: decodeURIComponent(t.value) }) }), o } function i(t) { if (s) return new f(t); var e = document.createElement("a"); return e.href = t, e } function a(t) { var i = this; this._list = [], t === undefined || null === t || (t instanceof a ? this._list = o(String(t)) : "object" == typeof t && e(t) ? r(t).forEach(function (t) { if (!e(t)) throw TypeError(); var n = r(t); if (2 !== n.length) throw TypeError(); i._list.push({ name: String(n[0]), value: String(n[1]) }) }) : "object" == typeof t && t ? Object.keys(t).forEach(function (e) { i._list.push({ name: String(e), value: String(t[e]) }) }) : ("?" === (t = String(t)).substring(0, 1) && (t = t.substring(1)), this._list = o(t))), this._url_object = null, this._setList = function (t) { u || (i._list = t) }; var u = !1; this._update_steps = function () { u || (u = !0, i._url_object && ("about:" === i._url_object.protocol && -1 !== i._url_object.pathname.indexOf("?") && (i._url_object.pathname = i._url_object.pathname.split("?")[0]), i._url_object.search = n(i._list), u = !1)) } } function u(t, e) { var r = 0; this.next = function () { if (r >= t.length) return { done: !0, value: undefined }; var n = t[r++]; return { done: !1, value: "key" === e ? n.name : "value" === e ? n.value : [n.name, n.value] } } } function c(e, r) { function n() { var t = c.href.replace(/#$|\?$|\?(?=#)/g, ""); c.href !== t && (c.href = t) } function u() { p._setList(c.search ? o(c.search.substring(1)) : []), p._update_steps() } if (!(this instanceof t.URL)) throw new TypeError("Failed to construct 'URL': Please use the 'new' operator."); r && (e = function () { if (s) return new f(e, r).href; var t; try { var n; if ("[object OperaMini]" === Object.prototype.toString.call(window.operamini) ? ((t = document.createElement("iframe")).style.display = "none", document.documentElement.appendChild(t), n = t.contentWindow.document) : document.implementation && document.implementation.createHTMLDocument ? n = document.implementation.createHTMLDocument("") : document.implementation && document.implementation.createDocument ? ((n = document.implementation.createDocument("http://www.w3.org/1999/xhtml", "html", null)).documentElement.appendChild(n.createElement("head")), n.documentElement.appendChild(n.createElement("body"))) : window.ActiveXObject && ((n = new window.ActiveXObject("htmlfile")).write(""), n.close()), !n) throw Error("base not supported"); var o = n.createElement("base"); o.href = r, n.getElementsByTagName("head")[0].appendChild(o); var i = n.createElement("a"); return i.href = e, i.href } finally { t && t.parentNode.removeChild(t) } }()); var c = i(e || ""), l = function () { if (!("defineProperties" in Object)) return !1; try { var t = {}; return Object.defineProperties(t, { prop: { get: function () { return !0 } } }), t.prop } catch (e) { return !1 } }() ? this : document.createElement("a"), p = new a(c.search ? c.search.substring(1) : null); return p._url_object = l, Object.defineProperties(l, { href: { get: function () { return c.href }, set: function (t) { c.href = t, n(), u() }, enumerable: !0, configurable: !0 }, origin: { get: function () { return "origin" in c ? c.origin : this.protocol + "//" + this.host }, enumerable: !0, configurable: !0 }, protocol: { get: function () { return c.protocol }, set: function (t) { c.protocol = t }, enumerable: !0, configurable: !0 }, username: { get: function () { return c.username }, set: function (t) { c.username = t }, enumerable: !0, configurable: !0 }, password: { get: function () { return c.password }, set: function (t) { c.password = t }, enumerable: !0, configurable: !0 }, host: { get: function () { var t = { "http:": /:80$/, "https:": /:443$/, "ftp:": /:21$/ }[c.protocol]; return t ? c.host.replace(t, "") : c.host }, set: function (t) { c.host = t }, enumerable: !0, configurable: !0 }, hostname: { get: function () { return c.hostname }, set: function (t) { c.hostname = t }, enumerable: !0, configurable: !0 }, port: { get: function () { return c.port }, set: function (t) { c.port = t }, enumerable: !0, configurable: !0 }, pathname: { get: function () { return "/" !== c.pathname.charAt(0) ? "/" + c.pathname : c.pathname }, set: function (t) { c.pathname = t }, enumerable: !0, configurable: !0 }, search: { get: function () { return c.search }, set: function (t) { c.search !== t && (c.search = t, n(), u()) }, enumerable: !0, configurable: !0 }, searchParams: { get: function () { return p }, enumerable: !0, configurable: !0 }, hash: { get: function () { return c.hash }, set: function (t) { c.hash = t, n() }, enumerable: !0, configurable: !0 }, toString: { value: function () { return c.toString() }, enumerable: !1, configurable: !0 }, valueOf: { value: function () { return c.valueOf() }, enumerable: !1, configurable: !0 } }), l } var s, f = t.URL; try { if (f) { if ("searchParams" in (s = new t.URL("http://example.com"))) return; "href" in s || (s = undefined) } } catch (p) { } if (Object.defineProperties(a.prototype, { append: { value: function (t, e) { this._list.push({ name: t, value: e }), this._update_steps() }, writable: !0, enumerable: !0, configurable: !0 }, "delete": { value: function (t) { for (var e = 0; e < this._list.length;)this._list[e].name === t ? this._list.splice(e, 1) : ++e; this._update_steps() }, writable: !0, enumerable: !0, configurable: !0 }, get: { value: function (t) { for (var e = 0; e < this._list.length; ++e)if (this._list[e].name === t) return this._list[e].value; return null }, writable: !0, enumerable: !0, configurable: !0 }, getAll: { value: function (t) { for (var e = [], r = 0; r < this._list.length; ++r)this._list[r].name === t && e.push(this._list[r].value); return e }, writable: !0, enumerable: !0, configurable: !0 }, has: { value: function (t) { for (var e = 0; e < this._list.length; ++e)if (this._list[e].name === t) return !0; return !1 }, writable: !0, enumerable: !0, configurable: !0 }, set: { value: function (t, e) { for (var r = !1, n = 0; n < this._list.length;)this._list[n].name === t ? r ? this._list.splice(n, 1) : (this._list[n].value = e, r = !0, ++n) : ++n; r || this._list.push({ name: t, value: e }), this._update_steps() }, writable: !0, enumerable: !0, configurable: !0 }, entries: { value: function () { return new u(this._list, "key+value") }, writable: !0, enumerable: !0, configurable: !0 }, keys: { value: function () { return new u(this._list, "key") }, writable: !0, enumerable: !0, configurable: !0 }, values: { value: function () { return new u(this._list, "value") }, writable: !0, enumerable: !0, configurable: !0 }, forEach: { value: function (t) { var e = arguments.length > 1 ? arguments[1] : undefined; this._list.forEach(function (r, n) { t.call(e, r.value, r.name) }) }, writable: !0, enumerable: !0, configurable: !0 }, toString: { value: function () { return n(this._list) }, writable: !0, enumerable: !1, configurable: !0 } }), "Symbol" in t && "iterator" in t.Symbol && (Object.defineProperty(a.prototype, t.Symbol.iterator, { value: a.prototype.entries, writable: !0, enumerable: !0, configurable: !0 }), Object.defineProperty(u.prototype, t.Symbol.iterator, { value: function () { return this }, writable: !0, enumerable: !0, configurable: !0 })), f) for (var l in f) f.hasOwnProperty(l) && "function" == typeof f[l] && (c[l] = f[l]); t.URL = c, t.URLSearchParams = a }(), function () { if ("1" !== new t.URLSearchParams([["a", 1]]).get("a") || "1" !== new t.URLSearchParams({ a: 1 }).get("a")) { var n = t.URLSearchParams; t.URLSearchParams = function (t) { if (t && "object" == typeof t && e(t)) { var o = new n; return r(t).forEach(function (t) { if (!e(t)) throw TypeError(); var n = r(t); if (2 !== n.length) throw TypeError(); o.append(n[0], n[1]) }), o } return t && "object" == typeof t ? (o = new n, Object.keys(t).forEach(function (e) { o.set(e, t[e]) }), o) : new n(t) } } }() }(self), function (t) { "use strict"; function e(t) { if ((t = String(t)).match(/[^\x00-\xFF]/)) throw TypeError("Not a valid ByteString"); return t } function r(t) { return (t = String(t)).replace(/([\u0000-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDFFF])/g, function (t) { return /^[\uD800-\uDFFF]$/.test(t) ? "�" : t }) } function n(t) { return 65535 & t } function o(t) { return String(t).replace(/[a-z]/g, function (t) { return t.toUpperCase() }) } function i(t) { return "CONNECT" === (t = o(t)) || "TRACE" === t || "TRACK" === t } function a(t) { var e = o(t); return "DELETE" === e || "GET" === e || "HEAD" === e || "OPTIONS" === e || "POST" === e || "PUT" === e ? e : t } function u(t) { return /^[!#$%&'*+\-.09A-Z^_`a-z|~]+$/.test(t) } function c(t) { return { "accept-charset": !0, "accept-encoding": !0, "access-control-request-headers": !0, "access-control-request-method": !0, connection: !0, "content-length": !0, cookie: !0, cookie2: !0, date: !0, dnt: !0, expect: !0, host: !0, "keep-alive": !0, origin: !0, referer: !0, te: !0, trailer: !0, "transfer-encoding": !0, upgrade: !0, "user-agent": !0, via: !0 }[t = String(t).toLowerCase()] || "proxy-" === t.substring(0, 6) || "sec-" === t.substring(0, 4) } function s(t) { return { "set-cookie": !0, "set-cookie2": !0 }[t = String(t).toLowerCase()] } function f(t, e) { return "accept" === (t = String(t).toLowerCase()) || "accept-language" === t || "content-language" === t || "content-type" === t && -1 !== ["application/x-www-form-encoded", "multipart/form-data", "text/plain"].indexOf(e) } function l(t) { this._guard = "none", this._headerList = [], t && p(this, t) } function p(t, e) { e instanceof l ? e._headerList.forEach(function (e) { t.append(e[0], e[1]) }) : Array.isArray(e) ? e.forEach(function (e) { if (!Array.isArray(e) || 2 !== e.length) throw TypeError(); t.append(e[0], e[1]) }) : (e = Object(e), Object.keys(e).forEach(function (r) { t.append(r, e[r]) })) } function h(t) { this._headers = t, this._index = 0 } function y(t) { this._stream = t, this.bodyUsed = !1 } function v(t, n) { if (arguments.length < 1) throw TypeError("Not enough arguments"); if (y.call(this, null), this.method = "GET", this.url = "", this.headers = new l, this.headers._guard = "request", this.referrer = null, this.mode = null, this.credentials = "omit", t instanceof v) { if (t.bodyUsed) throw TypeError(); t.bodyUsed = !0, this.method = t.method, this.url = t.url, this.headers = new l(t.headers), this.headers._guard = t.headers._guard, this.credentials = t.credentials, this._stream = t._stream } else t = r(t), this.url = String(new URL(t, self.location)); if ("method" in (n = Object(n))) { var o = e(n.method); if (i(o)) throw TypeError(); this.method = a(o) } "headers" in n && (this.headers = new l, p(this.headers, n.headers)), "body" in n && (this._stream = n.body), "credentials" in n && -1 !== ["omit", "same-origin", "include"].indexOf(n.credentials) && (this.credentials = n.credentials) } function d(t, e) { if (arguments.length < 1 && (t = ""), this.headers = new l, this.headers._guard = "response", t instanceof XMLHttpRequest && "_url" in t) { var o = t; return this.type = "basic", this.url = r(o._url), this.status = o.status, this.ok = 200 <= this.status && this.status <= 299, this.statusText = o.statusText, o.getAllResponseHeaders().split(/\r?\n/).filter(function (t) { return t.length }).forEach(function (t) { var e = t.indexOf(":"); this.headers.append(t.substring(0, e), t.substring(e + 2)) }, this), void y.call(this, o.responseText) } y.call(this, t), e = Object(e) || {}, this.url = ""; var i = "status" in e ? n(e.status) : 200; if (i < 200 || i > 599) throw RangeError(); this.status = i, this.ok = 200 <= this.status && this.status <= 299; var a = "statusText" in e ? String(e.statusText) : "OK"; if (/[^\x00-\xFF]/.test(a)) throw TypeError(); this.statusText = a, "headers" in e && p(this.headers, e), this.type = "basic" } l.prototype = { append: function (t, r) { if (t = e(t), !u(t)) throw TypeError(); if ("immutable" === this._guard) throw TypeError(); "request" === this._guard && c(t) || ("request-no-CORS" !== this._guard || f(t, r)) && ("response" === this._guard && s(t) || (t = t.toLowerCase(), this._headerList.push([t, r]))) }, "delete": function (t) { if (t = e(t), !u(t)) throw TypeError(); if ("immutable" === this._guard) throw TypeError(); if (("request" !== this._guard || !c(t)) && ("request-no-CORS" !== this._guard || f(t, "invalid")) && ("response" !== this._guard || !s(t))) { t = t.toLowerCase(); for (var r = 0; r < this._headerList.length;)this._headerList[r][0] === t ? this._headerList.splice(r, 1) : ++r } }, get: function (t) { if (t = e(t), !u(t)) throw TypeError(); t = t.toLowerCase(); for (var r = 0; r < this._headerList.length; ++r)if (this._headerList[r][0] === t) return this._headerList[r][1]; return null }, getAll: function (t) { if (t = e(t), !u(t)) throw TypeError(); t = t.toLowerCase(); for (var r = [], n = 0; n < this._headerList.length; ++n)this._headerList[n][0] === t && r.push(this._headerList[n][1]); return r }, has: function (t) { if (t = e(t), !u(t)) throw TypeError(); t = t.toLowerCase(); for (var r = 0; r < this._headerList.length; ++r)if (this._headerList[r][0] === t) return !0; return !1 }, set: function (t, r) { if (t = e(t), !u(t)) throw TypeError(); if ("immutable" === this._guard) throw TypeError(); if (("request" !== this._guard || !c(t)) && ("request-no-CORS" !== this._guard || f(t, r)) && ("response" !== this._guard || !s(t))) { t = t.toLowerCase(); for (var n = 0; n < this._headerList.length; ++n)if (this._headerList[n][0] === t) { for (this._headerList[n++][1] = r; n < this._headerList.length;)this._headerList[n][0] === t ? this._headerList.splice(n, 1) : ++n; return } this._headerList.push([t, r]) } } }, l.prototype[Symbol.iterator] = function () { return new h(this) }, (h.prototype = {}).next = function () { return this._index >= this._headers._headerList.length ? { value: undefined, done: !0 } : { value: this._headers._headerList[this._index++], done: !1 } }, h.prototype[Symbol.iterator] = function () { return this }, y.prototype = { arrayBuffer: function () { if (this.bodyUsed) return Promise.reject(TypeError()); if (this.bodyUsed = !0, this._stream instanceof ArrayBuffer) return Promise.resolve(this._stream); var t = this._stream; return new Promise(function (e, r) { var n = unescape(encodeURIComponent(t)).split("").map(function (t) { return t.charCodeAt(0) }); e(new Uint8Array(n).buffer) }) }, blob: function () { return this.bodyUsed ? Promise.reject(TypeError()) : (this.bodyUsed = !0, this._stream instanceof Blob ? Promise.resolve(this._stream) : Promise.resolve(new Blob([this._stream]))) }, formData: function () { return this.bodyUsed ? Promise.reject(TypeError()) : (this.bodyUsed = !0, this._stream instanceof FormData ? Promise.resolve(this._stream) : Promise.reject(Error("Not yet implemented"))) }, json: function () { if (this.bodyUsed) return Promise.reject(TypeError()); this.bodyUsed = !0; var t = this; return new Promise(function (e, r) { e(JSON.parse(t._stream)) }) }, text: function () { return this.bodyUsed ? Promise.reject(TypeError()) : (this.bodyUsed = !0, Promise.resolve(String(this._stream))) } }, v.prototype = y.prototype, d.prototype = y.prototype, d.redirect = function () { throw Error("Not supported") }, "fetch" in t || (t.Headers = l, t.Request = v, t.Response = d, t.fetch = function (t, e) { return new Promise(function (r, n) { var o = new v(t, e), i = new XMLHttpRequest; i._url = o.url; try { i.open(o.method, o.url, !0) } catch (c) { throw TypeError(c.message) } for (var a = o.headers[Symbol.iterator](), u = a.next(); !u.done; u = a.next())i.setRequestHeader(u.value[0], u.value[1]); "include" === o.credentials && (i.withCredentials = !0), i.onreadystatechange = function () { i.readyState === XMLHttpRequest.DONE && (0 === i.status ? n(new TypeError("Network error")) : r(new d(i))) }, i.send(o._stream) }) }) }(self); \ No newline at end of file diff --git a/FO/js/site.js b/FO/js/site.js index 2b45b8c..0fd959c 100644 --- a/FO/js/site.js +++ b/FO/js/site.js @@ -20,11 +20,9 @@ } }); $(document).ready(function () { - //$("body").on("blur", "input[type='text'],input[type='password']", function () { - // //$("body").focus(); - //}); + $("body").on("keydown", ".int, .intdot", function (e) { - //109,189 + }).on("keyup", ".int, .intdot, input.mobile,input[type='text'],input[type='password']", function (e) { if (($(this).hasClass("int") || $(this).hasClass("intdot") || $(this).hasClass("mobile")) && $(this).val() !== null && $(this).val() !== '' && e.keyCode != 8 && e.keyCode != 109 && e.keyCode != 189 && e.keyCode != 46 && e.keyCode != 190 && e.keyCode != 110 && e.keyCode != 109 && e.keycode != 189 && e.keyCode != 13 && !(e.keyCode > 47 && e.keyCode < 58) && !(e.keyCode > 95 && e.keyCode < 106)) { @@ -92,11 +90,7 @@ $(document).ready(function () { } } }).on("click", ".int, .intdot", function () { - //if ($(this).hasClass("phplaceholder")) { - // $("#" + $(this).attr("id").substr(3)).focus(); - //} else { - $(this)[0].select(); - //} + $(this)[0].select(); }).on("focus", ".int, .intdot, input[type='text'], input[type='password']", function () { if ($(this).hasClass("int") || $(this).hasClass("intdot")) { $(this).val($(this).val().replace(/,/gi, '')); @@ -120,14 +114,7 @@ $(document).ready(function () { } else { $(this).val(v.substr(0, 4) + "-" + v.substr(4, 2) + "-" + v.substr(6)); } - }).on("focusout", ".int, .intdot, input[type='text'], input[type='password']", function () { - //focusoutobj = $(this); - //if (!$(this).hasClass("nocomma")) { - // setTimeout(function () { - // var fv = $.trim($(focusoutobj).val()); - // bindComma2(fv); - // }, 10); - //} + }).on("focusout", ".int, .intdot, input[type='text'], input[type='password']", function () { $("label.phplaceholder").remove(); }); $('#breadcrumb dd > span').click(function () { @@ -217,8 +204,7 @@ function uploadeditorimage(files, el, fdata, _callback, _url) { cache: false, contentType: false, processData: false, - success: function (result) { - //_uploadeditorimagertn = JSON.parse(result); + success: function (result) { _uploadeditorimagertn = result; eval(_uploadeditorimagecallback.substr(_uploadeditorimagecallback.length - 1, 1) == ")" ? _uploadeditorimagecallback : (_uploadeditorimagecallback + "()")); } @@ -266,39 +252,66 @@ function viewcontentsok() { cbviewcontents(); } } + + var _cdmsisopenning = 0; + +// 팝업 창 참조를 전역으로 유지 +let globalPopup = null; + function cbviewcontents() { - if (_vcistaste || (capResult.code == 1000)) { + if (_vcistaste || capResult.code == 1000) { + // 백그라운드 레이어 숨기기 $("#bglayer").hide(); _cdmsisopenning = 1; - if (ismobile()) { - var win = window.open("/CDMS/Play" + (_vc_istaste ? "Taste" : "") + "?cmino=" + _vc_cmino + "&ismobile=1&lectno=" + _vc_lectno + "&pseq=" + _vc_pseq, 'contentsview'); - if (win == null) { - msg("팝업이 차단되어 있습니다. 차단을 해제해 주세요(0)"); + + const url = `/CDMS/Play${_vc_istaste ? "Taste" : ""}?cmino=${_vc_cmino}&ismobile=${ismobile() ? '1' : '0'}&lectno=${_vc_lectno}&pseq=${_vc_pseq}`; + + // 팝업 옵션 + const nWidth = 1080; + const nHeight = screen.availHeight - 100; + const nLeft = Math.round((screen.availWidth - nWidth) / 2); + const nTop = Math.round((screen.availHeight - nHeight) / 2); + + const popOption = ` + width=${nWidth}, + height=${nHeight}, + top=${nTop}, + left=${nLeft}, + toolbar=no, + menubar=no, + location=no, + resizable=yes, + status=yes, + scrollbars=yes`.replace(/\s+/g, ''); + + // 이미 팝업이 열려 있는지 확인 + if (globalPopup && !globalPopup.closed) { + try { + // 1초 딜레이 적용 + setTimeout(() => { + globalPopup.location.href = url; // URL 업데이트 (필요에 따라) + globalPopup.focus(); // 이미 열린 팝업 창 활성화 + }, 1000); + } catch (e) { + console.error("기존 팝업 접근 실패: ", e); + globalPopup = null; // 접근 실패 시 참조 정리 } - } else { - var cpop = open("/Open/Popup", "checkpop", 'width=100,height=100'); - if (cpop == null) { - msg("팝업이 차단되어 있습니다. 차단을 해제해 주세요(1)"); + } else { + globalPopup = window.open(url, 'contentsview', popOption); + + if (!globalPopup) { + msg("팝업이 차단되어 있습니다. 차단을 해제해 주세요."); } else { - cpop.close(); - var nWidth = "1080"; - var nHeight = screen.availHeight - 100; - var popOption = ""; - popOption += "width=" + nWidth + ","; - popOption += "height=" + nHeight + ","; - popOption += "toolbar=no,menubar=no,location=no,"; - popOption += "resizable=yes,status=yes,scrollbars=yes"; - if (window.open("/CDMS/Play" + (_vc_istaste ? "Taste" : "") + "?cmino=" + _vc_cmino + "&ismobile=0&lectno=" + _vc_lectno + "&pseq=" + _vc_pseq, 'contentsview', popOption) != null) { - //window.open("/CDMS/Play" + (_vc_istaste ? "Taste" : "") + "?cmino=" + _vc_cmino + "&ismobile=0&lectno=" + _vc_lectno + "&pseq=" + _vc_pseq, 'contentsview', popOption).focus(); - console.log('iscdms'); + try { + globalPopup.focus(); // 포커스 이동 + } catch (e) { + console.error("팝업 포커스 실패: ", e); } - else { msg("팝업이 차단되어 있습니다. 차단을 해제해 주세요"); } } } - } - else { - location.href = "/Account/Index?ru="+location.href.replace(/#/gi,''); + } else { + location.href = "/Account/Index?ru=" + location.href.replace(/#/gi, ''); } } @@ -603,132 +616,309 @@ function cap(url, formid, callback, getpost, autoMsg, noBG, jsislayer2) { console.log("다른 작업을 처리중입니다. 잠시후 다시 작업해주세요."); } } + function capp(url, p, callback, getpost, autoMsg, noBG, jsislayer2, hideBG, noerror, sync) { _jsislayer2 = jsislayer2 || false; _noerror = noerror || false; _hideBG = hideBG || false; + + // 동기식 요청은 권장되지 않지만, 기존 코드 호환성을 위해 유지 + // 단, 경고 메시지 출력 _async = !(sync || false); + if (sync) { + console.warn("동기식 Ajax 요청은 권장되지 않으며 iOS에서 문제를 일으킬 수 있습니다."); + } + if (!isCaping) { isAutoMsg = autoMsg || false; _bging = noBG || false; + if (!_bging) { ajaxing(); } + if (_jsislayer2) { bglayer2(); } + _callback = callback; capResult = null; capOK = false; isCaping = true; - clearComma(); - $.ajax({ + + // 기존 함수 호출 유지, 존재 확인 후 실행 + if (typeof clearComma === 'function') { + try { + clearComma(); + } catch (e) { + console.error("clearComma 함수 실행 오류:", e); + } + } + + // Ajax 요청 설정 + const ajaxSettings = { type: getpost || "post", url: url, data: p, async: _async, + timeout: _async ? 30000 : undefined, // 비동기 요청만 타임아웃 설정 success: function (r) { isCaping = false; capResult = r; - setcap(); - }, error: function (e) { + // iOS 호환성을 위한 추가 처리 + setTimeout(function () { + setcap(); + }, 0); + }, + error: function (xhr, status, error) { isCaping = false; - console.log(e.responseText); - if (_jsislayer2) { - //msg2("잠시 후 다시 요청해주세요."); + console.log("Ajax 오류:", status, error); + + if (xhr.responseText) { + console.log("응답 내용:", xhr.responseText); } - else { - //msg("잠시 후 다시 요청해주세요."); + + // 타임아웃 오류 별도 처리 + if (status === "timeout") { + if (_jsislayer2) { + alert("요청 시간이 초과되었습니다. 다시 시도해 주세요."); + } else { + alert("요청 시간이 초과되었습니다. 다시 시도해 주세요."); + } } - }, complete: function () { - ajaxing(false); + else if (!_noerror) { + if (_jsislayer2) { + alert("잠시 후 다시 요청해주세요."); + } + else { + alert("잠시 후 다시 요청해주세요."); + } + } + }, + complete: function () { + // iOS에서의 지연 문제 방지를 위한 setTimeout 사용 + setTimeout(function () { + ajaxing(false); + }, 0); } - }); + }; + + // iOS 특정 버전에서의 캐시 문제 방지 + if (navigator.userAgent.match(/(iPad|iPhone|iPod)/g)) { + ajaxSettings.cache = false; + + // URL에 타임스탬프 추가하여 캐시 방지 + const timestamp = new Date().getTime(); + ajaxSettings.url = ajaxSettings.url + + (ajaxSettings.url.indexOf('?') >= 0 ? '&' : '?') + + '_t=' + timestamp; + } + + $.ajax(ajaxSettings); } - else if (!_noerror){ + else if (!_noerror) { console.log("다른 작업을 처리중입니다. 잠시후 다시 작업해주세요."); } } + function capfile(url, data, callback, noeval, setBG, jsislayer2) { + // 로딩바 표시 추가 + showLoadingImage(); + noeval = noeval || false; _jsislayer2 = jsislayer2 || false; _setBG = setBG || false; - capfilecallback = callback; + // 백그라운드 레이어 표시 if (_setBG) { bglayer(); } if (_jsislayer2) { bglayer2(); } + // iOS 호환성을 위한 처리 + // FormData 객체 확인 및 필요시 수정 + if (data instanceof FormData) { + // iOS에서 FormData 디버깅을 위한 로그 (개발 중에만 사용) + console.log("FormData 항목 수:", [...data.entries()].length); + } + // 콜백 함수 실행 헬퍼 + function executeCallback(result) { + // 로딩바 숨김 추가 + hideLoadingImage(); + + if (_setBG) { + $("#bglayer").hide(); + } + if (noeval) { + // 함수 객체로 직접 호출 + if (typeof callback === 'function') { + callback(result); + } + } + else { + // 기존 방식 유지 (eval 사용) + // 보안상 권장되지 않지만 기존 코드 호환성 유지 + try { + window.capResult = result; // 전역 변수로 결과 저장 + if (typeof callback === 'string') { + if (callback.substr(callback.length - 1, 1) == ")") { + eval(callback); + } else { + eval(callback + "()"); + } + } + } catch (e) { + console.error("콜백 실행 오류:", e); + } + } + } var ajaxRequest = $.ajax({ type: "POST", url: url, contentType: false, processData: false, - data: data + data: data, + timeout: 60000, + xhr: function () { + var xhr = $.ajaxSettings.xhr(); + // 업로드 진행 상황 모니터링 (iOS에서 파일 업로드 진행 확인) + if (xhr.upload) { + xhr.upload.addEventListener('progress', function (e) { + if (e.lengthComputable) { + var percent = Math.round((e.loaded / e.total) * 100); + console.log("업로드 진행률: " + percent + "%"); + } + }, false); + } + return xhr; + } }); - ajaxRequest.error(function (e) { - console.log(e); - capResult = data; - if (!noeval) { - eval(capfilecallback.substr(capfilecallback.length - 1, 1) == ")" ? capfilecallback : (capfilecallback + "()")); + // 에러 처리 + ajaxRequest.fail(function (jqXHR, textStatus, errorThrown) { + console.error("Ajax 요청 실패:", textStatus, errorThrown); + // 타임아웃인 경우 별도 처리 + if (textStatus === "timeout") { + alert("요청 시간이 초과되었습니다. 다시 시도해 주세요."); + // 로딩바 숨김 추가 (타임아웃 시) + hideLoadingImage(); } else { - ajaxRequest.done(capfilecallback); + // 기존 에러 처리 로직 유지 (하지만 에러 시 다른 처리를 권장) + executeCallback({ + code: -1, + message: "요청 처리 중 오류가 발생했습니다", + error: textStatus + }); } }); + ajaxRequest.done(function (data) { - if (_setBG) { - $("#bglayer").hide(); + if (data && data.code == 1000) { + executeCallback(data); } - capResult = data; - if (capResult.code == 1000) { - if (!noeval) { - eval(capfilecallback.substr(capfilecallback.length - 1, 1) == ")" ? capfilecallback : (capfilecallback + "()")); - } - else { - ajaxRequest.done(capfilecallback); - } + else { + console.warn("서버 응답 코드가 1000이 아닙니다:", data); + executeCallback(data); } }); } + function capfileform(url, fid, callback, iseval, getpost, autoMsg, noBG, jsislayer2) { _jsislayer2 = jsislayer2 || false; if (!isCaping) { + // 로딩바 표시 추가 + showLoadingImage(); + isAutoMsg = autoMsg || false; _bging = noBG || false; - if (!_bging) { - ajaxing(); - } - if (_jsislayer2) { - bglayer2(); - } + if (!_bging) { ajaxing(); } + if (_jsislayer2) { bglayer2(); } _callback = callback; capResult = null; capOK = false; isCaping = true; - //clearComma(); + // 폼 요소 직접 참조 + const form = document.getElementById(fid); + // iOS 호환성을 위한 FormData 생성 방식 개선 + let formData; + try { + // 기본 FormData 생성 시도 + formData = new FormData(form); + // iOS 호환성 검사 - 파일 입력 필드 확인 + const fileInputs = form.querySelectorAll('input[type="file"]'); + let hasFiles = false; + fileInputs.forEach(input => { + if (input.files && input.files.length > 0) { + hasFiles = true; + // 파일 입력 필드 값이 제대로 FormData에 들어갔는지 확인 + const fieldName = input.name || 'file'; + if (!formData.has(fieldName)) { + console.log(`iOS 호환성: 수동으로 ${fieldName} 추가`); + // 수동으로 파일 추가 + for (let i = 0; i < input.files.length; i++) { + formData.append(fieldName, input.files[i]); + } + } + } + }); + // 디버깅용 로그 + console.log('FormData 생성 완료:', hasFiles ? '파일 포함' : '파일 없음'); + } catch (error) { + console.error('FormData 생성 오류:', error); + // 대체 방식으로 FormData 생성 + formData = new FormData(); + // 폼 필드 수동 추가 + const formElements = form.elements; + for (let i = 0; i < formElements.length; i++) { + const field = formElements[i]; + const name = field.name; + if (!name) continue; + if (field.type === 'file') { + for (let j = 0; j < field.files.length; j++) { + formData.append(name, field.files[j]); + } + } + else if (field.type !== 'submit' && field.type !== 'button') { + formData.append(name, field.value); + } + } + } + // 네트워크 요청 타임아웃 설정 + const ajaxTimeout = 60000; // 60초 $.ajax({ type: getpost || "post", url: url, - data: new FormData($('#' + fid)[0]), + data: formData, contentType: false, processData: false, + timeout: ajaxTimeout, success: function (r) { isCaping = false; capResult = r; setcap(); - }, error: function (e) { + // 로딩바 숨김 추가 + hideLoadingImage(); + }, + error: function (e) { isCaping = false; + console.log('Ajax 오류:', e.status, e.statusText); console.log(e.responseText); - if (_jsislayer2) { - msg2("개발담당자에게 문의해주세요."); + if (e.status === 0 && e.statusText === 'timeout') { + alert("요청 시간이 초과되었습니다. 다시 시도해주세요."); + } + else if (_jsislayer2) { + alert("개발담당자에게 문의해주세요"); } else { - msg("개발담당자에게 문의해주세요."); + alert("개발담당자에게 문의해주세요."); } - }, complete: function () { + // 로딩바 숨김 추가 + hideLoadingImage(); + }, + complete: function () { ajaxing(false); + // complete에도 로딩바 숨김 추가 (중복 호출 방지를 위해 다른 방법 고려 가능) + hideLoadingImage(); } }); } @@ -736,6 +926,181 @@ function capfileform(url, fid, callback, iseval, getpost, autoMsg, noBG, jsislay console.log("다른 작업을 처리중입니다. 잠시후 다시 작업해주세요."); } } + +function setcap() { + // 결과가 없는 경우 예외 처리 + if (!capResult) { + console.error("capResult가 정의되지 않았습니다"); + return; + } + + if (capResult.code === 1000) { + capOK = true; + capResultObj = capResult.obj; + capResultMsg = capResult.msg; + } + + // 인증 관련 오류 처리 + if (capResult.code == 9991) { + alert("인증시간이 초과되어 로그아웃되었습니다."); + setTimeout(function () { + location.href = '/Account/Error?code=9991'; + }, 100); // iOS에서 alert 후 즉시 리디렉션 문제 방지 + } + else if (capResult.code == 9992) { + alert("로그인 정보가 일치하지 않아 다시 로그인을 진행하셔야 합니다.\n(다른 디바이스에 로그인 또는 Cookie정보를 확인할 수 없습니다.)"); + setTimeout(function () { + location.href = '/Account/Error?code=9992'; + }, 100); // iOS에서 alert 후 즉시 리디렉션 문제 방지 + } + else { + // 자동 메시지 처리 + if (isAutoMsg) { + switch (capResult.code) { + case 1000: showOK(); break; + case 9999: alert("서버접속이 원활하지 않습니다"); break; + case 9998: alert("권한이 없는 요청입니다"); break; + case 9997: alert("권한(로그인)이 없는 요청입니다"); break; + case 9996: alert("검색된 데이터가 없습니다"); break; + case 9995: alert("적용된 데이터가 없습니다"); break; + default: + // 개발 모드에서만 상세 로그 출력 + console.log("응답 코드:", capResult.code); + console.log("응답 메시지:", capResult.msg); + if (capResult.obj) console.log("응답 데이터:", capResult.obj); + break; + } + } + else { + capResultMsg = capResult.code + ": " + capResult.msg; + } + + // 콜백 함수 실행 + if (_callback) { + try { + if (typeof _callback === "function") { + _callback(capResult); + } + else if (typeof _callback === "string") { + // 문자열 콜백 처리 - eval 사용을 최소화 + if (_callback.indexOf(")") > -1) { + // 이미 괄호가 포함된 경우 + window.setTimeout(function () { + try { + eval(_callback); + } catch (e) { + console.error("콜백 실행 오류:", e); + } + }, 0); + } + else { + // 괄호 추가 필요 + window.setTimeout(function () { + try { + eval(_callback + "()"); + } catch (e) { + console.error("콜백 실행 오류:", e); + } + }, 0); + } + } + } catch (e) { + console.error("콜백 실행 중 오류 발생:", e); + } + } + } +} + + +/** 로딩이미지 보여주기 */ +function showLoadingImage() { + // 이미 존재하는 경우 중복 생성 방지 + if (document.getElementById('custom-loading-overlay')) { + return; + } + + // 로딩 이미지 요소 생성 + const loadingDiv = document.createElement('div'); + loadingDiv.id = 'custom-loading-overlay'; + + // 인라인 스타일 대신 클래스 사용을 위한 스타일 추가 + const style = document.createElement('style'); + style.textContent = ` + #custom-loading-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.5); + display: flex; + justify-content: center; + align-items: center; + z-index: 9999; + } + + #custom-loading-spinner { + width: 40px; + height: 40px; + background-color: #fff; + border-radius: 100%; + -webkit-animation: sk-scaleout 1.0s infinite ease-in-out; + animation: sk-scaleout 1.0s infinite ease-in-out; + } + + @-webkit-keyframes sk-scaleout { + 0% { -webkit-transform: scale(0) } + 100% { -webkit-transform: scale(1.0); opacity: 0; } + } + + @keyframes sk-scaleout { + 0% { transform: scale(0); -webkit-transform: scale(0); } + 100% { transform: scale(1.0); -webkit-transform: scale(1.0); opacity: 0; } + } + + /* 애니메이션 미지원 브라우저용 대체 스타일 */ + .no-animation #custom-loading-spinner { + background-color: #3498db; + border: 5px solid #f3f3f3; + } + `; + document.head.appendChild(style); + + // 브라우저 애니메이션 지원 확인 + const supportsAnimation = 'AnimationEvent' in window || + 'WebKitAnimationEvent' in window || + 'MozAnimationEvent' in window || + 'msAnimationEvent' in window || + 'OAnimationEvent' in window; + + // 기본 로딩 스피너 + const spinnerDiv = document.createElement('div'); + spinnerDiv.id = 'custom-loading-spinner'; + + // 애니메이션을 지원하지 않는 브라우저에는 정적 스타일 적용 + if (!supportsAnimation) { + loadingDiv.className = 'no-animation'; + } + + loadingDiv.appendChild(spinnerDiv); + document.body.appendChild(loadingDiv); +} + +/** 로딩이미지 제거 */ +function hideLoadingImage() { + const loadingDiv = document.getElementById('custom-loading-overlay'); + if (loadingDiv) { + // 스타일 요소도 정리 + const style = document.querySelector('style[id^="custom-loading-style"]'); + if (style) { + document.head.removeChild(style); + } + document.body.removeChild(loadingDiv); + } +} + + + function ajaxing(tf) { if (!_jsislayer2) { bglayer(false); @@ -773,64 +1138,7 @@ function clearComma() { $(c).val($(c).val().replace(/,/gi, '')); }); } -function setcap() { - if (capResult.code === 1000) { - capOK = true; - capResultObj = capResult.obj; - capResultMsg = capResult.msg; - } - if (capResult.code == 9991) { - if (ispop()) { - parent.location.href = capResult.obj + '?istimeout=true'; - } - else if ((parent.ismainlayout || 0) == 1) { - parent.location.href = capResult.obj + '?istimeout=true'; - } - else if (opener != null) { - parent.location.href = capResult.obj + '?istimeout=true'; - self.close(); - } - else { - //msg("인증시간이 초과되어 로그아웃되었습니다."); - location.href = capResult.obj; - } - } - else { - if (isAutoMsg) { - switch (capResult.code) { - case 1000: - showOK(); - break; - case 9999: - msg("서버접속이 원활하지 않습니다 <" + capResult.code + ": " + capResult.msg + ">"); - break; - case 9998: - msg("권한이 없는 요청입니다. <" + capResult.code + ": " + capResult.msg + ">"); - break; - case 9997: - msg("권한(로그인)이 없는 요청입니다. <" + capResult.code + ": " + capResult.msg + ">"); - break; - case 9996: - msg("검색된 데이터가 없습니다. <" + capResult.code + ": " + capResult.msg + ">"); - break; - case 9995: - msg("적용된 데이터가 없습니다. <" + capResult.code + ": " + capResult.msg + ">"); - break; - default: - console.log(capResult.code); - console.log(capResult.msg); - console.log(capResult.obj); - break; - } - } - else { - capResultMsg = capResult.code + ": " + capResult.msg; - } - if ((_callback || "") != "") { - eval(_callback.indexOf(")") > -1 ? _callback : (_callback + "()")); - } - } -} + var _focusitem; var _focusitem2; var _okm; diff --git a/FO/js/video.js b/FO/js/video.js new file mode 100644 index 0000000..db87699 --- /dev/null +++ b/FO/js/video.js @@ -0,0 +1,30 @@ +/** + * @license + * Video.js 7.7.6 + * Copyright Brightcove, Inc. + * Available under Apache License Version 2.0 + * + * + * Includes vtt.js + * Available under Apache License Version 2.0 + * + */ +!function (e, t) { "object" == typeof exports && "undefined" != typeof module ? module.exports = t(require("global/window"), require("global/document")) : "function" == typeof define && define.amd ? define(["global/window", "global/document"], t) : (e = e || self).videojs = t(e.window, e.document) }(this, function (y, h) { + "use strict"; y = y && y.hasOwnProperty("default") ? y.default : y, h = h && h.hasOwnProperty("default") ? h.default : h; var d = "7.7.6", l = [], e = function (o, u) { return function (e, t, i) { var n = u.levels[t], r = new RegExp("^(" + n + ")$"); if ("log" !== e && i.unshift(e.toUpperCase() + ":"), i.unshift(o + ":"), l) { l.push([].concat(i)); var a = l.length - 1e3; l.splice(0, 0 < a ? a : 0) } if (y.console) { var s = y.console[e]; s || "debug" !== e || (s = y.console.info || y.console.log), s && n && r.test(e) && s[Array.isArray(i) ? "apply" : "call"](y.console, i) } } }; var p = function t(i) { function n() { for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++)t[i] = arguments[i]; r("log", a, t) } var r, a = "info"; return r = e(i, n), n.createLogger = function (e) { return t(i + ": " + e) }, n.levels = { all: "debug|log|warn|error", off: "", debug: "debug|log|warn|error", info: "log|warn|error", warn: "warn|error", error: "error", DEFAULT: a }, n.level = function (e) { if ("string" == typeof e) { if (!n.levels.hasOwnProperty(e)) throw new Error('"' + e + '" in not a valid log level'); a = e } return a }, (n.history = function () { return l ? [].concat(l) : [] }).filter = function (t) { return (l || []).filter(function (e) { return new RegExp(".*" + t + ".*").test(e[0]) }) }, n.history.clear = function () { l && (l.length = 0) }, n.history.disable = function () { null !== l && (l.length = 0, l = null) }, n.history.enable = function () { null === l && (l = []) }, n.error = function () { for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++)t[i] = arguments[i]; return r("error", a, t) }, n.warn = function () { for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++)t[i] = arguments[i]; return r("warn", a, t) }, n.debug = function () { for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++)t[i] = arguments[i]; return r("debug", a, t) }, n }("VIDEOJS"), f = p.createLogger; function t(e, t) { return e(t = { exports: {} }, t.exports), t.exports } var r = t(function (e) { function t() { return e.exports = t = Object.assign || function (e) { for (var t = 1; t < arguments.length; t++) { var i = arguments[t]; for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && (e[n] = i[n]) } return e }, t.apply(this, arguments) } e.exports = t }), i = Object.prototype.toString, a = function (e) { return o(e) ? Object.keys(e) : [] }; function s(t, i) { a(t).forEach(function (e) { return i(t[e], e) }) } function m(i) { for (var e = arguments.length, t = new Array(1 < e ? e - 1 : 0), n = 1; n < e; n++)t[n - 1] = arguments[n]; return Object.assign ? r.apply(void 0, [i].concat(t)) : (t.forEach(function (e) { e && s(e, function (e, t) { i[t] = e }) }), i) } function o(e) { return !!e && "object" == typeof e } function u(e) { return o(e) && "[object Object]" === i.call(e) && e.constructor === Object } function n(e, t) { if (!e || !t) return ""; if ("function" != typeof y.getComputedStyle) return ""; var i = y.getComputedStyle(e); return i ? i.getPropertyValue(t) || i[t] : "" } function c(e) { return "string" == typeof e && Boolean(e.trim()) } function g(e) { if (0 <= e.indexOf(" ")) throw new Error("class has illegal whitespace characters") } function v() { return h === y.document } function _(e) { return o(e) && 1 === e.nodeType } function b() { try { return y.parent !== y.self } catch (e) { return !0 } } function T(n) { return function (e, t) { if (!c(e)) return h[n](null); c(t) && (t = h.querySelector(t)); var i = _(t) ? t : h; return i[n] && i[n](e) } } function S(e, i, t, n) { void 0 === e && (e = "div"), void 0 === i && (i = {}), void 0 === t && (t = {}); var r = h.createElement(e); return Object.getOwnPropertyNames(i).forEach(function (e) { var t = i[e]; -1 !== e.indexOf("aria-") || "role" === e || "type" === e ? (p.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set " + e + " to " + t + "."), r.setAttribute(e, t)) : "textContent" === e ? k(r, t) : r[e] !== t && (r[e] = t) }), Object.getOwnPropertyNames(t).forEach(function (e) { r.setAttribute(e, t[e]) }), n && V(r, n), r } function k(e, t) { return "undefined" == typeof e.textContent ? e.innerText = t : e.textContent = t, e } function C(e, t) { t.firstChild ? t.insertBefore(e, t.firstChild) : t.appendChild(e) } function E(e, t) { return g(t), e.classList ? e.classList.contains(t) : function (e) { return new RegExp("(^|\\s)" + e + "($|\\s)") }(t).test(e.className) } function w(e, t) { return e.classList ? e.classList.add(t) : E(e, t) || (e.className = (e.className + " " + t).trim()), e } function A(e, t) { return e.classList ? e.classList.remove(t) : (g(t), e.className = e.className.split(/\s+/).filter(function (e) { return e !== t }).join(" ")), e } function I(e, t, i) { var n = E(e, t); if ("function" == typeof i && (i = i(e, t)), "boolean" != typeof i && (i = !n), i !== n) return i ? w(e, t) : A(e, t), e } function x(i, n) { Object.getOwnPropertyNames(n).forEach(function (e) { var t = n[e]; null === t || "undefined" == typeof t || !1 === t ? i.removeAttribute(e) : i.setAttribute(e, !0 === t ? "" : t) }) } function P(e) { var t = {}, i = ",autoplay,controls,playsinline,loop,muted,default,defaultMuted,"; if (e && e.attributes && 0 < e.attributes.length) for (var n = e.attributes, r = n.length - 1; 0 <= r; r--) { var a = n[r].name, s = n[r].value; "boolean" != typeof e[a] && -1 === i.indexOf("," + a + ",") || (s = null !== s), t[a] = s } return t } function L(e, t) { return e.getAttribute(t) } function O(e, t, i) { e.setAttribute(t, i) } function D(e, t) { e.removeAttribute(t) } function N() { h.body.focus(), h.onselectstart = function () { return !1 } } function R() { h.onselectstart = function () { return !0 } } function U(e) { if (e && e.getBoundingClientRect && e.parentNode) { var t = e.getBoundingClientRect(), i = {}; return ["bottom", "height", "left", "right", "top", "width"].forEach(function (e) { void 0 !== t[e] && (i[e] = t[e]) }), i.height || (i.height = parseFloat(n(e, "height"))), i.width || (i.width = parseFloat(n(e, "width"))), i } } function M(e) { var t; if (e.getBoundingClientRect && e.parentNode && (t = e.getBoundingClientRect()), !t) return { left: 0, top: 0 }; var i = h.documentElement, n = h.body, r = i.clientLeft || n.clientLeft || 0, a = y.pageXOffset || n.scrollLeft, s = t.left + a - r, o = i.clientTop || n.clientTop || 0, u = y.pageYOffset || n.scrollTop, l = t.top + u - o; return { left: Math.round(s), top: Math.round(l) } } function B(e, t) { var i = {}, n = M(e), r = e.offsetWidth, a = e.offsetHeight, s = n.top, o = n.left, u = t.pageY, l = t.pageX; return t.changedTouches && (l = t.changedTouches[0].pageX, u = t.changedTouches[0].pageY), i.y = Math.max(0, Math.min(1, (s - u + a) / a)), i.x = Math.max(0, Math.min(1, (l - o) / r)), i } function j(e) { return o(e) && 3 === e.nodeType } function F(e) { for (; e.firstChild;)e.removeChild(e.firstChild); return e } function H(e) { return "function" == typeof e && (e = e()), (Array.isArray(e) ? e : [e]).map(function (e) { return "function" == typeof e && (e = e()), _(e) || j(e) ? e : "string" == typeof e && /\S/.test(e) ? h.createTextNode(e) : void 0 }).filter(function (e) { return e }) } function V(t, e) { return H(e).forEach(function (e) { return t.appendChild(e) }), t } function q(e, t) { return V(F(e), t) } function W(e) { return void 0 === e.button && void 0 === e.buttons || (0 === e.button && void 0 === e.buttons || ("mouseup" === e.type && 0 === e.button && 0 === e.buttons || 0 === e.button && 1 === e.buttons)) } var z, G = T("querySelector"), X = T("querySelectorAll"), K = Object.freeze({ isReal: v, isEl: _, isInFrame: b, createEl: S, textContent: k, prependTo: C, hasClass: E, addClass: w, removeClass: A, toggleClass: I, setAttributes: x, getAttributes: P, getAttribute: L, setAttribute: O, removeAttribute: D, blockTextSelection: N, unblockTextSelection: R, getBoundingClientRect: U, findPosition: M, getPointerPosition: B, isTextNode: j, emptyEl: F, normalizeContent: H, appendContent: V, insertContent: q, isSingleLeftClick: W, $: G, $$: X }), Y = !1, $ = function () { if (v() && !1 !== z.options.autoSetup) { var e = Array.prototype.slice.call(h.getElementsByTagName("video")), t = Array.prototype.slice.call(h.getElementsByTagName("audio")), i = Array.prototype.slice.call(h.getElementsByTagName("video-js")), n = e.concat(t, i); if (n && 0 < n.length) for (var r = 0, a = n.length; r < a; r++) { var s = n[r]; if (!s || !s.getAttribute) { Q(1); break } void 0 === s.player && null !== s.getAttribute("data-setup") && z(s) } else Y || Q(1) } }; function Q(e, t) { t && (z = t), y.setTimeout($, e) } function J() { Y = !0, y.removeEventListener("load", J) } v() && ("complete" === h.readyState ? J() : y.addEventListener("load", J)); function Z(e) { var t = h.createElement("style"); return t.className = e, t } function ee(e, t) { e.styleSheet ? e.styleSheet.cssText = t : e.textContent = t } var te, ie = 3; function ne() { return ie++ } y.WeakMap || (te = function () { function e() { this.vdata = "vdata" + Math.floor(y.performance && y.performance.now() || Date.now()), this.data = {} } var t = e.prototype; return t.set = function (e, t) { var i = e[this.vdata] || ne(); return e[this.vdata] || (e[this.vdata] = i), this.data[i] = t, this }, t.get = function (e) { var t = e[this.vdata]; if (t) return this.data[t]; p("We have no data for this element", e) }, t.has = function (e) { return e[this.vdata] in this.data }, t.delete = function (e) { var t = e[this.vdata]; t && (delete this.data[t], delete e[this.vdata]) }, e }()); var re, ae = y.WeakMap ? new WeakMap : new te; function se(e, t) { if (ae.has(e)) { var i = ae.get(e); 0 === i.handlers[t].length && (delete i.handlers[t], e.removeEventListener ? e.removeEventListener(t, i.dispatcher, !1) : e.detachEvent && e.detachEvent("on" + t, i.dispatcher)), Object.getOwnPropertyNames(i.handlers).length <= 0 && (delete i.handlers, delete i.dispatcher, delete i.disabled), 0 === Object.getOwnPropertyNames(i).length && ae.delete(e) } } function oe(t, i, e, n) { e.forEach(function (e) { t(i, e, n) }) } function ue(e) { if (e.fixed_) return e; function t() { return !0 } function i() { return !1 } if (!e || !e.isPropagationStopped) { var n = e || y.event; for (var r in e = {}, n) "layerX" !== r && "layerY" !== r && "keyLocation" !== r && "webkitMovementX" !== r && "webkitMovementY" !== r && ("returnValue" === r && n.preventDefault || (e[r] = n[r])); if (e.target || (e.target = e.srcElement || h), e.relatedTarget || (e.relatedTarget = e.fromElement === e.target ? e.toElement : e.fromElement), e.preventDefault = function () { n.preventDefault && n.preventDefault(), e.returnValue = !1, n.returnValue = !1, e.defaultPrevented = !0 }, e.defaultPrevented = !1, e.stopPropagation = function () { n.stopPropagation && n.stopPropagation(), e.cancelBubble = !0, n.cancelBubble = !0, e.isPropagationStopped = t }, e.isPropagationStopped = i, e.stopImmediatePropagation = function () { n.stopImmediatePropagation && n.stopImmediatePropagation(), e.isImmediatePropagationStopped = t, e.stopPropagation() }, e.isImmediatePropagationStopped = i, null !== e.clientX && void 0 !== e.clientX) { var a = h.documentElement, s = h.body; e.pageX = e.clientX + (a && a.scrollLeft || s && s.scrollLeft || 0) - (a && a.clientLeft || s && s.clientLeft || 0), e.pageY = e.clientY + (a && a.scrollTop || s && s.scrollTop || 0) - (a && a.clientTop || s && s.clientTop || 0) } e.which = e.charCode || e.keyCode, null !== e.button && void 0 !== e.button && (e.button = 1 & e.button ? 0 : 4 & e.button ? 1 : 2 & e.button ? 2 : 0) } return e.fixed_ = !0, e } var le = function () { if ("boolean" != typeof re) { re = !1; try { var e = Object.defineProperty({}, "passive", { get: function () { re = !0 } }); y.addEventListener("test", null, e), y.removeEventListener("test", null, e) } catch (e) { } } return re }, ce = ["touchstart", "touchmove"]; function he(s, e, t) { if (Array.isArray(e)) return oe(he, s, e, t); ae.has(s) || ae.set(s, {}); var o = ae.get(s); if (o.handlers || (o.handlers = {}), o.handlers[e] || (o.handlers[e] = []), t.guid || (t.guid = ne()), o.handlers[e].push(t), o.dispatcher || (o.disabled = !1, o.dispatcher = function (e, t) { if (!o.disabled) { e = ue(e); var i = o.handlers[e.type]; if (i) for (var n = i.slice(0), r = 0, a = n.length; r < a && !e.isImmediatePropagationStopped(); r++)try { n[r].call(s, e, t) } catch (e) { p.error(e) } } }), 1 === o.handlers[e].length) if (s.addEventListener) { var i = !1; le() && -1 < ce.indexOf(e) && (i = { passive: !0 }), s.addEventListener(e, o.dispatcher, i) } else s.attachEvent && s.attachEvent("on" + e, o.dispatcher) } function de(e, t, i) { if (ae.has(e)) { var n = ae.get(e); if (n.handlers) { if (Array.isArray(t)) return oe(de, e, t, i); var r = function (e, t) { n.handlers[t] = [], se(e, t) }; if (void 0 !== t) { var a = n.handlers[t]; if (a) if (i) { if (i.guid) for (var s = 0; s < a.length; s++)a[s].guid === i.guid && a.splice(s--, 1); se(e, t) } else r(e, t) } else for (var o in n.handlers) Object.prototype.hasOwnProperty.call(n.handlers || {}, o) && r(e, o) } } } function pe(e, t, i) { var n = ae.has(e) ? ae.get(e) : {}, r = e.parentNode || e.ownerDocument; if ("string" == typeof t ? t = { type: t, target: e } : t.target || (t.target = e), t = ue(t), n.dispatcher && n.dispatcher.call(e, t, i), r && !t.isPropagationStopped() && !0 === t.bubbles) pe.call(null, r, t, i); else if (!r && !t.defaultPrevented && t.target && t.target[t.type]) { ae.has(t.target) || ae.set(t.target, {}); var a = ae.get(t.target); t.target[t.type] && (a.disabled = !0, "function" == typeof t.target[t.type] && t.target[t.type](), a.disabled = !1) } return !t.defaultPrevented } function fe(e, t, i) { if (Array.isArray(t)) return oe(fe, e, t, i); function n() { de(e, t, n), i.apply(this, arguments) } n.guid = i.guid = i.guid || ne(), he(e, t, n) } function me(e, t, i) { function n() { de(e, t, n), i.apply(this, arguments) } n.guid = i.guid = i.guid || ne(), he(e, t, n) } function ge(e, t, i) { t.guid || (t.guid = ne()); var n = t.bind(e); return n.guid = i ? i + "_" + t.guid : t.guid, n } function ve(t, i) { var n = y.performance.now(); return function () { var e = y.performance.now(); i <= e - n && (t.apply(void 0, arguments), n = e) } } function ye() { } var _e, be = Object.freeze({ fixEvent: ue, on: he, off: de, trigger: pe, one: fe, any: me }); ye.prototype.allowedEvents_ = {}, ye.prototype.addEventListener = ye.prototype.on = function (e, t) { var i = this.addEventListener; this.addEventListener = function () { }, he(this, e, t), this.addEventListener = i }, ye.prototype.removeEventListener = ye.prototype.off = function (e, t) { de(this, e, t) }, ye.prototype.one = function (e, t) { var i = this.addEventListener; this.addEventListener = function () { }, fe(this, e, t), this.addEventListener = i }, ye.prototype.any = function (e, t) { var i = this.addEventListener; this.addEventListener = function () { }, me(this, e, t), this.addEventListener = i }, ye.prototype.dispatchEvent = ye.prototype.trigger = function (e) { var t = e.type || e; "string" == typeof e && (e = { type: t }), e = ue(e), this.allowedEvents_[t] && this["on" + t] && this["on" + t](e), pe(this, e) }, ye.prototype.queueTrigger = function (e) { var t = this; _e = _e || new Map; var i = e.type || e, n = _e.get(this); n || (n = new Map, _e.set(this, n)); var r = n.get(i); n.delete(i), y.clearTimeout(r); var a = y.setTimeout(function () { 0 === n.size && (n = null, _e.delete(t)), t.trigger(e) }, 0); n.set(i, a) }; function Te(e) { return "string" == typeof e && /\S/.test(e) || Array.isArray(e) && !!e.length } function Se(e) { if (!e.nodeName && !Ae(e)) throw new Error("Invalid target; must be a DOM node or evented object.") } function ke(e) { if (!Te(e)) throw new Error("Invalid event type; must be a non-empty string or array.") } function Ce(e) { if ("function" != typeof e) throw new Error("Invalid listener; must be a function.") } function Ee(e, t) { var i, n, r, a = t.length < 3 || t[0] === e || t[0] === e.eventBusEl_; return r = a ? (i = e.eventBusEl_, 3 <= t.length && t.shift(), n = t[0], t[1]) : (i = t[0], n = t[1], t[2]), Se(i), ke(n), Ce(r), { isTargetingSelf: a, target: i, type: n, listener: r = ge(e, r) } } function we(e, t, i, n) { Se(e), e.nodeName ? be[t](e, i, n) : e[t](i, n) } var Ae = function (t) { return t instanceof ye || !!t.eventBusEl_ && ["on", "one", "off", "trigger"].every(function (e) { return "function" == typeof t[e] }) }, Ie = { on: function () { for (var e = this, t = arguments.length, i = new Array(t), n = 0; n < t; n++)i[n] = arguments[n]; var r = Ee(this, i), a = r.isTargetingSelf, s = r.target, o = r.type, u = r.listener; if (we(s, "on", o, u), !a) { var l = function () { return e.off(s, o, u) }; l.guid = u.guid; var c = function () { return e.off("dispose", l) }; c.guid = u.guid, we(this, "on", "dispose", l), we(s, "on", "dispose", c) } }, one: function () { for (var r = this, e = arguments.length, t = new Array(e), i = 0; i < e; i++)t[i] = arguments[i]; var n = Ee(this, t), a = n.isTargetingSelf, s = n.target, o = n.type, u = n.listener; if (a) we(s, "one", o, u); else { var l = function e() { r.off(s, o, e); for (var t = arguments.length, i = new Array(t), n = 0; n < t; n++)i[n] = arguments[n]; u.apply(null, i) }; l.guid = u.guid, we(s, "one", o, l) } }, any: function () { for (var r = this, e = arguments.length, t = new Array(e), i = 0; i < e; i++)t[i] = arguments[i]; var n = Ee(this, t), a = n.isTargetingSelf, s = n.target, o = n.type, u = n.listener; if (a) we(s, "any", o, u); else { var l = function e() { r.off(s, o, e); for (var t = arguments.length, i = new Array(t), n = 0; n < t; n++)i[n] = arguments[n]; u.apply(null, i) }; l.guid = u.guid, we(s, "any", o, l) } }, off: function (e, t, i) { if (!e || Te(e)) de(this.eventBusEl_, e, t); else { var n = e, r = t; Se(n), ke(r), Ce(i), i = ge(this, i), this.off("dispose", i), n.nodeName ? (de(n, r, i), de(n, "dispose", i)) : Ae(n) && (n.off(r, i), n.off("dispose", i)) } }, trigger: function (e, t) { return pe(this.eventBusEl_, e, t) } }; function xe(e, t) { void 0 === t && (t = {}); var i = t.eventBusKey; if (i) { if (!e[i].nodeName) throw new Error('The eventBusKey "' + i + '" does not refer to an element.'); e.eventBusEl_ = e[i] } else e.eventBusEl_ = S("span", { className: "vjs-event-bus" }); return m(e, Ie), e.eventedCallbacks && e.eventedCallbacks.forEach(function (e) { e() }), e.on("dispose", function () { e.off(), y.setTimeout(function () { e.eventBusEl_ = null }, 0) }), e } var Pe = { state: {}, setState: function (e) { var i, n = this; return "function" == typeof e && (e = e()), s(e, function (e, t) { n.state[t] !== e && ((i = i || {})[t] = { from: n.state[t], to: e }), n.state[t] = e }), i && Ae(this) && this.trigger({ changes: i, type: "statechanged" }), i } }; function Le(e, t) { return m(e, Pe), e.state = m({}, e.state, t), "function" == typeof e.handleStateChanged && Ae(e) && e.on("statechanged", e.handleStateChanged), e } function Oe(e) { return "string" != typeof e ? e : e.replace(/./, function (e) { return e.toLowerCase() }) } function De(e) { return "string" != typeof e ? e : e.replace(/./, function (e) { return e.toUpperCase() }) } function Ne() { for (var i = {}, e = arguments.length, t = new Array(e), n = 0; n < e; n++)t[n] = arguments[n]; return t.forEach(function (e) { e && s(e, function (e, t) { u(e) ? (u(i[t]) || (i[t] = {}), i[t] = Ne(i[t], e)) : i[t] = e }) }), i } var Re = function () { function l(e, t, i) { if (!e && this.play ? this.player_ = e = this : this.player_ = e, this.isDisposed_ = !1, this.parentComponent_ = null, this.options_ = Ne({}, this.options_), t = this.options_ = Ne(this.options_, t), this.id_ = t.id || t.el && t.el.id, !this.id_) { var n = e && e.id && e.id() || "no_player"; this.id_ = n + "_component_" + ne() } var r; this.name_ = t.name || null, t.el ? this.el_ = t.el : !1 !== t.createEl && (this.el_ = this.createEl()), !1 !== t.evented && xe(this, { eventBusKey: this.el_ ? "el_" : null }), Le(this, this.constructor.defaultState), this.children_ = [], this.childIndex_ = {}, this.childNameIndex_ = {}, y.Set || (r = function () { function e() { this.set_ = {} } var t = e.prototype; return t.has = function (e) { return e in this.set_ }, t.delete = function (e) { var t = this.has(e); return delete this.set_[e], t }, t.add = function (e) { return this.set_[e] = 1, this }, t.forEach = function (e, t) { for (var i in this.set_) e.call(t, i, i, this) }, e }()), this.setTimeoutIds_ = y.Set ? new Set : new r, this.setIntervalIds_ = y.Set ? new Set : new r, this.rafIds_ = y.Set ? new Set : new r, (this.clearingTimersOnDispose_ = !1) !== t.initChildren && this.initChildren(), this.ready(i), !1 !== t.reportTouchActivity && this.enableTouchActivity() } var e = l.prototype; return e.dispose = function () { if (!this.isDisposed_) { if (this.trigger({ type: "dispose", bubbles: !1 }), this.isDisposed_ = !0, this.children_) for (var e = this.children_.length - 1; 0 <= e; e--)this.children_[e].dispose && this.children_[e].dispose(); this.children_ = null, this.childIndex_ = null, this.childNameIndex_ = null, this.parentComponent_ = null, this.el_ && (this.el_.parentNode && this.el_.parentNode.removeChild(this.el_), ae.has(this.el_) && ae.delete(this.el_), this.el_ = null), this.player_ = null } }, e.isDisposed = function () { return Boolean(this.isDisposed_) }, e.player = function () { return this.player_ }, e.options = function (e) { return e && (this.options_ = Ne(this.options_, e)), this.options_ }, e.el = function () { return this.el_ }, e.createEl = function (e, t, i) { return S(e, t, i) }, e.localize = function (e, r, t) { void 0 === t && (t = e); var i = this.player_.language && this.player_.language(), n = this.player_.languages && this.player_.languages(), a = n && n[i], s = i && i.split("-")[0], o = n && n[s], u = t; return a && a[e] ? u = a[e] : o && o[e] && (u = o[e]), r && (u = u.replace(/\{(\d+)\}/g, function (e, t) { var i = r[t - 1], n = i; return "undefined" == typeof i && (n = e), n })), u }, e.contentEl = function () { return this.contentEl_ || this.el_ }, e.id = function () { return this.id_ }, e.name = function () { return this.name_ }, e.children = function () { return this.children_ }, e.getChildById = function (e) { return this.childIndex_[e] }, e.getChild = function (e) { if (e) return this.childNameIndex_[e] }, e.addChild = function (e, t, i) { var n, r; if (void 0 === t && (t = {}), void 0 === i && (i = this.children_.length), "string" == typeof e) { r = De(e); var a = t.componentClass || r; t.name = r; var s = l.getComponent(a); if (!s) throw new Error("Component " + a + " does not exist"); if ("function" != typeof s) return null; n = new s(this.player_ || this, t) } else n = e; if (n.parentComponent_ && n.parentComponent_.removeChild(n), this.children_.splice(i, 0, n), n.parentComponent_ = this, "function" == typeof n.id && (this.childIndex_[n.id()] = n), (r = r || n.name && De(n.name())) && (this.childNameIndex_[r] = n, this.childNameIndex_[Oe(r)] = n), "function" == typeof n.el && n.el()) { var o = null; this.children_[i + 1] && this.children_[i + 1].el_ && (o = this.children_[i + 1].el_), this.contentEl().insertBefore(n.el(), o) } return n }, e.removeChild = function (e) { if ("string" == typeof e && (e = this.getChild(e)), e && this.children_) { for (var t = !1, i = this.children_.length - 1; 0 <= i; i--)if (this.children_[i] === e) { t = !0, this.children_.splice(i, 1); break } if (t) { e.parentComponent_ = null, this.childIndex_[e.id()] = null, this.childNameIndex_[De(e.name())] = null, this.childNameIndex_[Oe(e.name())] = null; var n = e.el(); n && n.parentNode === this.contentEl() && this.contentEl().removeChild(e.el()) } } }, e.initChildren = function () { var r = this, n = this.options_.children; if (n) { var e, a = this.options_, i = l.getComponent("Tech"); (e = Array.isArray(n) ? n : Object.keys(n)).concat(Object.keys(this.options_).filter(function (t) { return !e.some(function (e) { return "string" == typeof e ? t === e : t === e.name }) })).map(function (e) { var t, i; return i = "string" == typeof e ? n[t = e] || r.options_[t] || {} : (t = e.name, e), { name: t, opts: i } }).filter(function (e) { var t = l.getComponent(e.opts.componentClass || De(e.name)); return t && !i.isTech(t) }).forEach(function (e) { var t = e.name, i = e.opts; if (void 0 !== a[t] && (i = a[t]), !1 !== i) { !0 === i && (i = {}), i.playerOptions = r.options_.playerOptions; var n = r.addChild(t, i); n && (r[t] = n) } }) } }, e.buildCSSClass = function () { return "" }, e.ready = function (e, t) { if (void 0 === t && (t = !1), e) return this.isReady_ ? void (t ? e.call(this) : this.setTimeout(e, 1)) : (this.readyQueue_ = this.readyQueue_ || [], void this.readyQueue_.push(e)) }, e.triggerReady = function () { this.isReady_ = !0, this.setTimeout(function () { var e = this.readyQueue_; this.readyQueue_ = [], e && 0 < e.length && e.forEach(function (e) { e.call(this) }, this), this.trigger("ready") }, 1) }, e.$ = function (e, t) { return G(e, t || this.contentEl()) }, e.$$ = function (e, t) { return X(e, t || this.contentEl()) }, e.hasClass = function (e) { return E(this.el_, e) }, e.addClass = function (e) { w(this.el_, e) }, e.removeClass = function (e) { A(this.el_, e) }, e.toggleClass = function (e, t) { I(this.el_, e, t) }, e.show = function () { this.removeClass("vjs-hidden") }, e.hide = function () { this.addClass("vjs-hidden") }, e.lockShowing = function () { this.addClass("vjs-lock-showing") }, e.unlockShowing = function () { this.removeClass("vjs-lock-showing") }, e.getAttribute = function (e) { return L(this.el_, e) }, e.setAttribute = function (e, t) { O(this.el_, e, t) }, e.removeAttribute = function (e) { D(this.el_, e) }, e.width = function (e, t) { return this.dimension("width", e, t) }, e.height = function (e, t) { return this.dimension("height", e, t) }, e.dimensions = function (e, t) { this.width(e, !0), this.height(t) }, e.dimension = function (e, t, i) { if (void 0 !== t) return null !== t && t == t || (t = 0), -1 !== ("" + t).indexOf("%") || -1 !== ("" + t).indexOf("px") ? this.el_.style[e] = t : this.el_.style[e] = "auto" === t ? "" : t + "px", void (i || this.trigger("componentresize")); if (!this.el_) return 0; var n = this.el_.style[e], r = n.indexOf("px"); return -1 !== r ? parseInt(n.slice(0, r), 10) : parseInt(this.el_["offset" + De(e)], 10) }, e.currentDimension = function (e) { var t = 0; if ("width" !== e && "height" !== e) throw new Error("currentDimension only accepts width or height value"); if (t = n(this.el_, e), 0 === (t = parseFloat(t)) || isNaN(t)) { var i = "offset" + De(e); t = this.el_[i] } return t }, e.currentDimensions = function () { return { width: this.currentDimension("width"), height: this.currentDimension("height") } }, e.currentWidth = function () { return this.currentDimension("width") }, e.currentHeight = function () { return this.currentDimension("height") }, e.focus = function () { this.el_.focus() }, e.blur = function () { this.el_.blur() }, e.handleKeyDown = function (e) { this.player_ && (e.stopPropagation(), this.player_.handleKeyDown(e)) }, e.handleKeyPress = function (e) { this.handleKeyDown(e) }, e.emitTapEvents = function () { var n, t = 0, r = null; this.on("touchstart", function (e) { 1 === e.touches.length && (r = { pageX: e.touches[0].pageX, pageY: e.touches[0].pageY }, t = y.performance.now(), n = !0) }), this.on("touchmove", function (e) { if (1 < e.touches.length) n = !1; else if (r) { var t = e.touches[0].pageX - r.pageX, i = e.touches[0].pageY - r.pageY; 10 < Math.sqrt(t * t + i * i) && (n = !1) } }); function e() { n = !1 } this.on("touchleave", e), this.on("touchcancel", e), this.on("touchend", function (e) { !(r = null) === n && y.performance.now() - t < 200 && (e.preventDefault(), this.trigger("tap")) }) }, e.enableTouchActivity = function () { if (this.player() && this.player().reportUserActivity) { var t, i = ge(this.player(), this.player().reportUserActivity); this.on("touchstart", function () { i(), this.clearInterval(t), t = this.setInterval(i, 250) }); var e = function (e) { i(), this.clearInterval(t) }; this.on("touchmove", i), this.on("touchend", e), this.on("touchcancel", e) } }, e.setTimeout = function (e, t) { var i, n = this; return e = ge(this, e), this.clearTimersOnDispose_(), i = y.setTimeout(function () { n.setTimeoutIds_.has(i) && n.setTimeoutIds_.delete(i), e() }, t), this.setTimeoutIds_.add(i), i }, e.clearTimeout = function (e) { return this.setTimeoutIds_.has(e) && (this.setTimeoutIds_.delete(e), y.clearTimeout(e)), e }, e.setInterval = function (e, t) { e = ge(this, e), this.clearTimersOnDispose_(); var i = y.setInterval(e, t); return this.setIntervalIds_.add(i), i }, e.clearInterval = function (e) { return this.setIntervalIds_.has(e) && (this.setIntervalIds_.delete(e), y.clearInterval(e)), e }, e.requestAnimationFrame = function (e) { var t, i = this; return this.supportsRaf_ ? (this.clearTimersOnDispose_(), e = ge(this, e), t = y.requestAnimationFrame(function () { i.rafIds_.has(t) && i.rafIds_.delete(t), e() }), this.rafIds_.add(t), t) : this.setTimeout(e, 1e3 / 60) }, e.cancelAnimationFrame = function (e) { return this.supportsRaf_ ? (this.rafIds_.has(e) && (this.rafIds_.delete(e), y.cancelAnimationFrame(e)), e) : this.clearTimeout(e) }, e.clearTimersOnDispose_ = function () { var n = this; this.clearingTimersOnDispose_ || (this.clearingTimersOnDispose_ = !0, this.one("dispose", function () { [["rafIds_", "cancelAnimationFrame"], ["setTimeoutIds_", "clearTimeout"], ["setIntervalIds_", "clearInterval"]].forEach(function (e) { var t = e[0], i = e[1]; n[t].forEach(n[i], n) }), n.clearingTimersOnDispose_ = !1 })) }, l.registerComponent = function (e, t) { if ("string" != typeof e || !e) throw new Error('Illegal component name, "' + e + '"; must be a non-empty string.'); var i, n = l.getComponent("Tech"), r = n && n.isTech(t), a = l === t || l.prototype.isPrototypeOf(t.prototype); if (r || !a) throw i = r ? "techs must be registered using Tech.registerTech()" : "must be a Component subclass", new Error('Illegal component, "' + e + '"; ' + i + "."); e = De(e), l.components_ || (l.components_ = {}); var s = l.getComponent("Player"); if ("Player" === e && s && s.players) { var o = s.players, u = Object.keys(o); if (o && 0 < u.length && u.map(function (e) { return o[e] }).every(Boolean)) throw new Error("Can not register Player component after player has been created.") } return l.components_[e] = t, l.components_[Oe(e)] = t }, l.getComponent = function (e) { if (e && l.components_) return l.components_[e] }, l }(); Re.prototype.supportsRaf_ = "function" == typeof y.requestAnimationFrame && "function" == typeof y.cancelAnimationFrame, Re.registerComponent("Component", Re); var Ue = function (e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e }; t(function (t) { function i(e) { return "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? t.exports = i = function (e) { return typeof e } : t.exports = i = function (e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e }, i(e) } t.exports = i }), t(function (t) { function i(e) { return t.exports = i = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) { return e.__proto__ || Object.getPrototypeOf(e) }, i(e) } t.exports = i }); var Me, Be, je, Fe, He = function (e, t) { e.prototype = Object.create(t.prototype), (e.prototype.constructor = e).__proto__ = t }, Ve = y.navigator && y.navigator.userAgent || "", qe = /AppleWebKit\/([\d.]+)/i.exec(Ve), We = qe ? parseFloat(qe.pop()) : null, ze = /iPod/i.test(Ve), Ge = (Me = Ve.match(/OS (\d+)_/i)) && Me[1] ? Me[1] : null, Xe = /Android/i.test(Ve), Ke = function () { var e = Ve.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i); if (!e) return null; var t = e[1] && parseFloat(e[1]), i = e[2] && parseFloat(e[2]); return t && i ? parseFloat(e[1] + "." + e[2]) : t || null }(), Ye = Xe && Ke < 5 && We < 537, $e = /Firefox/i.test(Ve), Qe = /Edg/i.test(Ve), Je = !Qe && (/Chrome/i.test(Ve) || /CriOS/i.test(Ve)), Ze = (Be = Ve.match(/(Chrome|CriOS)\/(\d+)/)) && Be[2] ? parseFloat(Be[2]) : null, et = (je = /MSIE\s(\d+)\.\d/.exec(Ve), !(Fe = je && parseFloat(je[1])) && /Trident\/7.0/i.test(Ve) && /rv:11.0/.test(Ve) && (Fe = 11), Fe), tt = /Safari/i.test(Ve) && !Je && !Xe && !Qe, it = /Windows/i.test(Ve), nt = v() && ("ontouchstart" in y || y.navigator.maxTouchPoints || y.DocumentTouch && y.document instanceof y.DocumentTouch), rt = /iPad/i.test(Ve) || tt && nt && !/iPhone/i.test(Ve), at = /iPhone/i.test(Ve) && !rt, st = at || rt || ze, ot = (tt || st) && !Je, ut = Object.freeze({ IS_IPOD: ze, IOS_VERSION: Ge, IS_ANDROID: Xe, ANDROID_VERSION: Ke, IS_NATIVE_ANDROID: Ye, IS_FIREFOX: $e, IS_EDGE: Qe, IS_CHROME: Je, CHROME_VERSION: Ze, IE_VERSION: et, IS_SAFARI: tt, IS_WINDOWS: it, TOUCH_ENABLED: nt, IS_IPAD: rt, IS_IPHONE: at, IS_IOS: st, IS_ANY_SAFARI: ot }); function lt(e, t, i, n) { return function (e, t, i) { if ("number" != typeof t || t < 0 || i < t) throw new Error("Failed to execute '" + e + "' on 'TimeRanges': The index provided (" + t + ") is non-numeric or out of bounds (0-" + i + ").") }(e, n, i.length - 1), i[n][t] } function ct(e) { return void 0 === e || 0 === e.length ? { length: 0, start: function () { throw new Error("This TimeRanges object is empty") }, end: function () { throw new Error("This TimeRanges object is empty") } } : { length: e.length, start: lt.bind(null, "start", 0, e), end: lt.bind(null, "end", 1, e) } } function ht(e, t) { return Array.isArray(e) ? ct(e) : void 0 === e || void 0 === t ? ct() : ct([[e, t]]) } function dt(e, t) { var i, n, r = 0; if (!t) return 0; e && e.length || (e = ht(0, 0)); for (var a = 0; a < e.length; a++)i = e.start(a), t < (n = e.end(a)) && (n = t), r += n - i; return r / t } for (var pt, ft = { prefixed: !0 }, mt = [["requestFullscreen", "exitFullscreen", "fullscreenElement", "fullscreenEnabled", "fullscreenchange", "fullscreenerror", "fullscreen"], ["webkitRequestFullscreen", "webkitExitFullscreen", "webkitFullscreenElement", "webkitFullscreenEnabled", "webkitfullscreenchange", "webkitfullscreenerror", "-webkit-full-screen"], ["mozRequestFullScreen", "mozCancelFullScreen", "mozFullScreenElement", "mozFullScreenEnabled", "mozfullscreenchange", "mozfullscreenerror", "-moz-full-screen"], ["msRequestFullscreen", "msExitFullscreen", "msFullscreenElement", "msFullscreenEnabled", "MSFullscreenChange", "MSFullscreenError", "-ms-fullscreen"]], gt = mt[0], vt = 0; vt < mt.length; vt++)if (mt[vt][1] in h) { pt = mt[vt]; break } if (pt) { for (var yt = 0; yt < pt.length; yt++)ft[gt[yt]] = pt[yt]; ft.prefixed = pt[0] !== gt[0] } function _t(e) { if (e instanceof _t) return e; "number" == typeof e ? this.code = e : "string" == typeof e ? this.message = e : o(e) && ("number" == typeof e.code && (this.code = e.code), m(this, e)), this.message || (this.message = _t.defaultMessages[this.code] || "") } _t.prototype.code = 0, _t.prototype.message = "", _t.prototype.status = null, _t.errorTypes = ["MEDIA_ERR_CUSTOM", "MEDIA_ERR_ABORTED", "MEDIA_ERR_NETWORK", "MEDIA_ERR_DECODE", "MEDIA_ERR_SRC_NOT_SUPPORTED", "MEDIA_ERR_ENCRYPTED"], _t.defaultMessages = { 1: "You aborted the media playback", 2: "A network error caused the media download to fail part-way.", 3: "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.", 4: "The media could not be loaded, either because the server or network failed or because the format is not supported.", 5: "The media is encrypted and we do not have the keys to decrypt it." }; for (var bt = 0; bt < _t.errorTypes.length; bt++)_t[_t.errorTypes[bt]] = bt, _t.prototype[_t.errorTypes[bt]] = bt; var Tt = function (e, t) { var i, n = null; try { i = JSON.parse(e, t) } catch (e) { n = e } return [n, i] }; function St(e) { return null != e && "function" == typeof e.then } function kt(e) { St(e) && e.then(null, function (e) { }) } function Ct(n) { return ["kind", "label", "language", "id", "inBandMetadataTrackDispatchType", "mode", "src"].reduce(function (e, t, i) { return n[t] && (e[t] = n[t]), e }, { cues: n.cues && Array.prototype.map.call(n.cues, function (e) { return { startTime: e.startTime, endTime: e.endTime, text: e.text, id: e.id } }) }) } var Et = function (e) { var t = e.$$("track"), i = Array.prototype.map.call(t, function (e) { return e.track }); return Array.prototype.map.call(t, function (e) { var t = Ct(e.track); return e.src && (t.src = e.src), t }).concat(Array.prototype.filter.call(e.textTracks(), function (e) { return -1 === i.indexOf(e) }).map(Ct)) }, wt = function (e, i) { return e.forEach(function (e) { var t = i.addRemoteTextTrack(e).track; !e.src && e.cues && e.cues.forEach(function (e) { return t.addCue(e) }) }), i.textTracks() }, At = t(function (e, t) { function i(e) { if (e && "object" == typeof e) { var t = e.which || e.keyCode || e.charCode; t && (e = t) } if ("number" == typeof e) return s[e]; var i, n = String(e); return (i = r[n.toLowerCase()]) ? i : (i = a[n.toLowerCase()]) || (1 === n.length ? n.charCodeAt(0) : void 0) } i.isEventKey = function (e, t) { if (e && "object" == typeof e) { var i = e.which || e.keyCode || e.charCode; if (null == i) return !1; if ("string" == typeof t) { var n; if (n = r[t.toLowerCase()]) return n === i; if (n = a[t.toLowerCase()]) return n === i } else if ("number" == typeof t) return t === i; return !1 } }; var r = (t = e.exports = i).code = t.codes = { backspace: 8, tab: 9, enter: 13, shift: 16, ctrl: 17, alt: 18, "pause/break": 19, "caps lock": 20, esc: 27, space: 32, "page up": 33, "page down": 34, end: 35, home: 36, left: 37, up: 38, right: 39, down: 40, insert: 45, delete: 46, command: 91, "left command": 91, "right command": 93, "numpad *": 106, "numpad +": 107, "numpad -": 109, "numpad .": 110, "numpad /": 111, "num lock": 144, "scroll lock": 145, "my computer": 182, "my calculator": 183, ";": 186, "=": 187, ",": 188, "-": 189, ".": 190, "/": 191, "`": 192, "[": 219, "\\": 220, "]": 221, "'": 222 }, a = t.aliases = { windows: 91, "⇧": 16, "⌥": 18, "⌃": 17, "⌘": 91, ctl: 17, control: 17, option: 18, pause: 19, break: 19, caps: 20, return: 13, escape: 27, spc: 32, spacebar: 32, pgup: 33, pgdn: 34, ins: 45, del: 46, cmd: 91 }; for (n = 97; n < 123; n++)r[String.fromCharCode(n)] = n - 32; for (var n = 48; n < 58; n++)r[n - 48] = n; for (n = 1; n < 13; n++)r["f" + n] = n + 111; for (n = 0; n < 10; n++)r["numpad " + n] = n + 96; var s = t.names = t.title = {}; for (n in r) s[r[n]] = n; for (var o in a) r[o] = a[o] }), It = (At.code, At.codes, At.aliases, At.names, At.title, "vjs-modal-dialog"), xt = function (n) { function e(e, t) { var i; return (i = n.call(this, e, t) || this).opened_ = i.hasBeenOpened_ = i.hasBeenFilled_ = !1, i.closeable(!i.options_.uncloseable), i.content(i.options_.content), i.contentEl_ = S("div", { className: It + "-content" }, { role: "document" }), i.descEl_ = S("p", { className: It + "-description vjs-control-text", id: i.el().getAttribute("aria-describedby") }), k(i.descEl_, i.description()), i.el_.appendChild(i.descEl_), i.el_.appendChild(i.contentEl_), i } He(e, n); var t = e.prototype; return t.createEl = function () { return n.prototype.createEl.call(this, "div", { className: this.buildCSSClass(), tabIndex: -1 }, { "aria-describedby": this.id() + "_description", "aria-hidden": "true", "aria-label": this.label(), role: "dialog" }) }, t.dispose = function () { this.contentEl_ = null, this.descEl_ = null, this.previouslyActiveEl_ = null, n.prototype.dispose.call(this) }, t.buildCSSClass = function () { return It + " vjs-hidden " + n.prototype.buildCSSClass.call(this) }, t.label = function () { return this.localize(this.options_.label || "Modal Window") }, t.description = function () { var e = this.options_.description || this.localize("This is a modal window."); return this.closeable() && (e += " " + this.localize("This modal can be closed by pressing the Escape key or activating the close button.")), e }, t.open = function () { if (!this.opened_) { var e = this.player(); this.trigger("beforemodalopen"), this.opened_ = !0, !this.options_.fillAlways && (this.hasBeenOpened_ || this.hasBeenFilled_) || this.fill(), this.wasPlaying_ = !e.paused(), this.options_.pauseOnOpen && this.wasPlaying_ && e.pause(), this.on("keydown", this.handleKeyDown), this.hadControls_ = e.controls(), e.controls(!1), this.show(), this.conditionalFocus_(), this.el().setAttribute("aria-hidden", "false"), this.trigger("modalopen"), this.hasBeenOpened_ = !0 } }, t.opened = function (e) { return "boolean" == typeof e && this[e ? "open" : "close"](), this.opened_ }, t.close = function () { if (this.opened_) { var e = this.player(); this.trigger("beforemodalclose"), this.opened_ = !1, this.wasPlaying_ && this.options_.pauseOnOpen && e.play(), this.off("keydown", this.handleKeyDown), this.hadControls_ && e.controls(!0), this.hide(), this.el().setAttribute("aria-hidden", "true"), this.trigger("modalclose"), this.conditionalBlur_(), this.options_.temporary && this.dispose() } }, t.closeable = function (e) { if ("boolean" == typeof e) { var t = this.closeable_ = !!e, i = this.getChild("closeButton"); if (t && !i) { var n = this.contentEl_; this.contentEl_ = this.el_, i = this.addChild("closeButton", { controlText: "Close Modal Dialog" }), this.contentEl_ = n, this.on(i, "close", this.close) } !t && i && (this.off(i, "close", this.close), this.removeChild(i), i.dispose()) } return this.closeable_ }, t.fill = function () { this.fillWith(this.content()) }, t.fillWith = function (e) { var t = this.contentEl(), i = t.parentNode, n = t.nextSibling; this.trigger("beforemodalfill"), this.hasBeenFilled_ = !0, i.removeChild(t), this.empty(), q(t, e), this.trigger("modalfill"), n ? i.insertBefore(t, n) : i.appendChild(t); var r = this.getChild("closeButton"); r && i.appendChild(r.el_) }, t.empty = function () { this.trigger("beforemodalempty"), F(this.contentEl()), this.trigger("modalempty") }, t.content = function (e) { return "undefined" != typeof e && (this.content_ = e), this.content_ }, t.conditionalFocus_ = function () { var e = h.activeElement, t = this.player_.el_; this.previouslyActiveEl_ = null, !t.contains(e) && t !== e || (this.previouslyActiveEl_ = e, this.focus()) }, t.conditionalBlur_ = function () { this.previouslyActiveEl_ && (this.previouslyActiveEl_.focus(), this.previouslyActiveEl_ = null) }, t.handleKeyDown = function (e) { if (e.stopPropagation(), At.isEventKey(e, "Escape") && this.closeable()) return e.preventDefault(), void this.close(); if (At.isEventKey(e, "Tab")) { for (var t, i = this.focusableEls_(), n = this.el_.querySelector(":focus"), r = 0; r < i.length; r++)if (n === i[r]) { t = r; break } h.activeElement === this.el_ && (t = 0), e.shiftKey && 0 === t ? (i[i.length - 1].focus(), e.preventDefault()) : e.shiftKey || t !== i.length - 1 || (i[0].focus(), e.preventDefault()) } }, t.focusableEls_ = function () { var e = this.el_.querySelectorAll("*"); return Array.prototype.filter.call(e, function (e) { return (e instanceof y.HTMLAnchorElement || e instanceof y.HTMLAreaElement) && e.hasAttribute("href") || (e instanceof y.HTMLInputElement || e instanceof y.HTMLSelectElement || e instanceof y.HTMLTextAreaElement || e instanceof y.HTMLButtonElement) && !e.hasAttribute("disabled") || e instanceof y.HTMLIFrameElement || e instanceof y.HTMLObjectElement || e instanceof y.HTMLEmbedElement || e.hasAttribute("tabindex") && -1 !== e.getAttribute("tabindex") || e.hasAttribute("contenteditable") }) }, e }(Re); xt.prototype.options_ = { pauseOnOpen: !0, temporary: !0 }, Re.registerComponent("ModalDialog", xt); var Pt = function (n) { function e(e) { var t; void 0 === e && (e = []), (t = n.call(this) || this).tracks_ = [], Object.defineProperty(Ue(t), "length", { get: function () { return this.tracks_.length } }); for (var i = 0; i < e.length; i++)t.addTrack(e[i]); return t } He(e, n); var t = e.prototype; return t.addTrack = function (e) { var t = this.tracks_.length; "" + t in this || Object.defineProperty(this, t, { get: function () { return this.tracks_[t] } }), -1 === this.tracks_.indexOf(e) && (this.tracks_.push(e), this.trigger({ track: e, type: "addtrack", target: this })) }, t.removeTrack = function (e) { for (var t, i = 0, n = this.length; i < n; i++)if (this[i] === e) { (t = this[i]).off && t.off(), this.tracks_.splice(i, 1); break } t && this.trigger({ track: t, type: "removetrack", target: this }) }, t.getTrackById = function (e) { for (var t = null, i = 0, n = this.length; i < n; i++) { var r = this[i]; if (r.id === e) { t = r; break } } return t }, e }(ye); for (var Lt in Pt.prototype.allowedEvents_ = { change: "change", addtrack: "addtrack", removetrack: "removetrack" }, Pt.prototype.allowedEvents_) Pt.prototype["on" + Lt] = null; function Ot(e, t) { for (var i = 0; i < e.length; i++)Object.keys(e[i]).length && t.id !== e[i].id && (e[i].enabled = !1) } function Dt(e, t) { for (var i = 0; i < e.length; i++)Object.keys(e[i]).length && t.id !== e[i].id && (e[i].selected = !1) } function Nt(e) { var t = ["protocol", "hostname", "port", "pathname", "search", "hash", "host"], i = h.createElement("a"); i.href = e; var n, r = "" === i.host && "file:" !== i.protocol; r && ((n = h.createElement("div")).innerHTML = '', i = n.firstChild, n.setAttribute("style", "display:none; position:absolute;"), h.body.appendChild(n)); for (var a = {}, s = 0; s < t.length; s++)a[t[s]] = i[t[s]]; return "http:" === a.protocol && (a.host = a.host.replace(/:80$/, "")), "https:" === a.protocol && (a.host = a.host.replace(/:443$/, "")), a.protocol || (a.protocol = y.location.protocol), r && h.body.removeChild(n), a } function Rt(e) { if (!e.match(/^https?:\/\//)) { var t = h.createElement("div"); t.innerHTML = 'x', e = t.firstChild.href } return e } function Ut(e) { if ("string" == typeof e) { var t = /^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e); if (t) return t.pop().toLowerCase() } return "" } function Mt(e, t) { void 0 === t && (t = y.location); var i = Nt(e); return (":" === i.protocol ? t.protocol : i.protocol) + i.host !== t.protocol + t.host } var Bt = function (n) { function e(e) { var t; void 0 === e && (e = []); for (var i = e.length - 1; 0 <= i; i--)if (e[i].enabled) { Ot(e, e[i]); break } return (t = n.call(this, e) || this).changing_ = !1, t } He(e, n); var t = e.prototype; return t.addTrack = function (e) { var t = this; e.enabled && Ot(this, e), n.prototype.addTrack.call(this, e), e.addEventListener && (e.enabledChange_ = function () { t.changing_ || (t.changing_ = !0, Ot(t, e), t.changing_ = !1, t.trigger("change")) }, e.addEventListener("enabledchange", e.enabledChange_)) }, t.removeTrack = function (e) { n.prototype.removeTrack.call(this, e), e.removeEventListener && e.enabledChange_ && (e.removeEventListener("enabledchange", e.enabledChange_), e.enabledChange_ = null) }, e }(Pt), jt = function (n) { function e(e) { var t; void 0 === e && (e = []); for (var i = e.length - 1; 0 <= i; i--)if (e[i].selected) { Dt(e, e[i]); break } return (t = n.call(this, e) || this).changing_ = !1, Object.defineProperty(Ue(t), "selectedIndex", { get: function () { for (var e = 0; e < this.length; e++)if (this[e].selected) return e; return -1 }, set: function () { } }), t } He(e, n); var t = e.prototype; return t.addTrack = function (e) { var t = this; e.selected && Dt(this, e), n.prototype.addTrack.call(this, e), e.addEventListener && (e.selectedChange_ = function () { t.changing_ || (t.changing_ = !0, Dt(t, e), t.changing_ = !1, t.trigger("change")) }, e.addEventListener("selectedchange", e.selectedChange_)) }, t.removeTrack = function (e) { n.prototype.removeTrack.call(this, e), e.removeEventListener && e.selectedChange_ && (e.removeEventListener("selectedchange", e.selectedChange_), e.selectedChange_ = null) }, e }(Pt), Ft = function (i) { function e() { return i.apply(this, arguments) || this } He(e, i); var t = e.prototype; return t.addTrack = function (e) { var t = this; i.prototype.addTrack.call(this, e), this.queueChange_ || (this.queueChange_ = function () { return t.queueTrigger("change") }), this.triggerSelectedlanguagechange || (this.triggerSelectedlanguagechange_ = function () { return t.trigger("selectedlanguagechange") }), e.addEventListener("modechange", this.queueChange_); -1 === ["metadata", "chapters"].indexOf(e.kind) && e.addEventListener("modechange", this.triggerSelectedlanguagechange_) }, t.removeTrack = function (e) { i.prototype.removeTrack.call(this, e), e.removeEventListener && (this.queueChange_ && e.removeEventListener("modechange", this.queueChange_), this.selectedlanguagechange_ && e.removeEventListener("modechange", this.triggerSelectedlanguagechange_)) }, e }(Pt), Ht = function () { function e(e) { void 0 === e && (e = []), this.trackElements_ = [], Object.defineProperty(this, "length", { get: function () { return this.trackElements_.length } }); for (var t = 0, i = e.length; t < i; t++)this.addTrackElement_(e[t]) } var t = e.prototype; return t.addTrackElement_ = function (e) { var t = this.trackElements_.length; "" + t in this || Object.defineProperty(this, t, { get: function () { return this.trackElements_[t] } }), -1 === this.trackElements_.indexOf(e) && this.trackElements_.push(e) }, t.getTrackElementByTrack_ = function (e) { for (var t, i = 0, n = this.trackElements_.length; i < n; i++)if (e === this.trackElements_[i].track) { t = this.trackElements_[i]; break } return t }, t.removeTrackElement_ = function (e) { for (var t = 0, i = this.trackElements_.length; t < i; t++)if (e === this.trackElements_[t]) { this.trackElements_[t].track && "function" == typeof this.trackElements_[t].track.off && this.trackElements_[t].track.off(), "function" == typeof this.trackElements_[t].off && this.trackElements_[t].off(), this.trackElements_.splice(t, 1); break } }, e }(), Vt = function () { function t(e) { t.prototype.setCues_.call(this, e), Object.defineProperty(this, "length", { get: function () { return this.length_ } }) } var e = t.prototype; return e.setCues_ = function (e) { var t = this.length || 0, i = 0, n = e.length; this.cues_ = e, this.length_ = e.length; function r(e) { "" + e in this || Object.defineProperty(this, "" + e, { get: function () { return this.cues_[e] } }) } if (t < n) for (i = t; i < n; i++)r.call(this, i) }, e.getCueById = function (e) { for (var t = null, i = 0, n = this.length; i < n; i++) { var r = this[i]; if (r.id === e) { t = r; break } } return t }, t }(), qt = { alternative: "alternative", captions: "captions", main: "main", sign: "sign", subtitles: "subtitles", commentary: "commentary" }, Wt = { alternative: "alternative", descriptions: "descriptions", main: "main", "main-desc": "main-desc", translation: "translation", commentary: "commentary" }, zt = { subtitles: "subtitles", captions: "captions", descriptions: "descriptions", chapters: "chapters", metadata: "metadata" }, Gt = { disabled: "disabled", hidden: "hidden", showing: "showing" }, Xt = function (a) { function e(e) { var t; void 0 === e && (e = {}), t = a.call(this) || this; function i(e) { Object.defineProperty(Ue(t), e, { get: function () { return n[e] }, set: function () { } }) } var n = { id: e.id || "vjs_track_" + ne(), kind: e.kind || "", label: e.label || "", language: e.language || "" }; for (var r in n) i(r); return t } return He(e, a), e }(ye), Kt = Object.freeze({ parseUrl: Nt, getAbsoluteURL: Rt, getFileExtension: Ut, isCrossOrigin: Mt }), Yt = function (e) { var t = $t.call(e); return "[object Function]" === t || "function" == typeof e && "[object RegExp]" !== t || "undefined" != typeof window && (e === window.setTimeout || e === window.alert || e === window.confirm || e === window.prompt) } +/** + * @license + * slighly modified parse-headers 2.0.2 + * Copyright (c) 2014 David Björklund + * Available under the MIT license + * + */, $t = Object.prototype.toString; var Qt = function (e) { var r = {}; return e && e.trim().split("\n").forEach(function (e) { var t = e.indexOf(":"), i = e.slice(0, t).trim().toLowerCase(), n = e.slice(t + 1).trim(); "undefined" == typeof r[i] ? r[i] = n : Array.isArray(r[i]) ? r[i].push(n) : r[i] = [r[i], n] }), r }, Jt = ti, Zt = ti; function ei(e, t, i) { var n = e; return Yt(t) ? (i = t, "string" == typeof e && (n = { uri: e })) : n = r({}, t, { uri: e }), n.callback = i, n } function ti(e, t, i) { return ii(t = ei(e, t, i)) } function ii(n) { if ("undefined" == typeof n.callback) throw new Error("callback argument missing"); var r = !1, a = function (e, t, i) { r || (r = !0, n.callback(e, t, i)) }; function t(e) { return clearTimeout(o), e instanceof Error || (e = new Error("" + (e || "Unknown XMLHttpRequest Error"))), e.statusCode = 0, a(e, m) } function e() { if (!s) { var e; clearTimeout(o), e = n.useXDR && void 0 === u.status ? 200 : 1223 === u.status ? 204 : u.status; var t = m, i = null; return 0 !== e ? (t = { body: function () { var e = void 0; if (e = u.response ? u.response : u.responseText || function (e) { try { if ("document" === e.responseType) return e.responseXML; var t = e.responseXML && "parsererror" === e.responseXML.documentElement.nodeName; if ("" === e.responseType && !t) return e.responseXML } catch (e) { } return null }(u), f) try { e = JSON.parse(e) } catch (e) { } return e }(), statusCode: e, method: c, headers: {}, url: l, rawRequest: u }, u.getAllResponseHeaders && (t.headers = Qt(u.getAllResponseHeaders()))) : i = new Error("Internal XMLHttpRequest Error"), a(i, t, t.body) } } var i, s, o, u = n.xhr || null, l = (u = u || (n.cors || n.useXDR ? new ti.XDomainRequest : new ti.XMLHttpRequest)).url = n.uri || n.url, c = u.method = n.method || "GET", h = n.body || n.data, d = u.headers = n.headers || {}, p = !!n.sync, f = !1, m = { body: void 0, headers: {}, statusCode: 0, method: c, url: l, rawRequest: u }; if ("json" in n && !1 !== n.json && (f = !0, d.accept || d.Accept || (d.Accept = "application/json"), "GET" !== c && "HEAD" !== c && (d["content-type"] || d["Content-Type"] || (d["Content-Type"] = "application/json"), h = JSON.stringify(!0 === n.json ? h : n.json))), u.onreadystatechange = function () { 4 === u.readyState && setTimeout(e, 0) }, u.onload = e, u.onerror = t, u.onprogress = function () { }, u.onabort = function () { s = !0 }, u.ontimeout = t, u.open(c, l, !p, n.username, n.password), p || (u.withCredentials = !!n.withCredentials), !p && 0 < n.timeout && (o = setTimeout(function () { if (!s) { s = !0, u.abort("timeout"); var e = new Error("XMLHttpRequest timeout"); e.code = "ETIMEDOUT", t(e) } }, n.timeout)), u.setRequestHeader) for (i in d) d.hasOwnProperty(i) && u.setRequestHeader(i, d[i]); else if (n.headers && !function (e) { for (var t in e) if (e.hasOwnProperty(t)) return !1; return !0 }(n.headers)) throw new Error("Headers cannot be set on an XDomainRequest object"); return "responseType" in n && (u.responseType = n.responseType), "beforeSend" in n && "function" == typeof n.beforeSend && n.beforeSend(u), u.send(h || null), u } ti.XMLHttpRequest = y.XMLHttpRequest || function () { }, ti.XDomainRequest = "withCredentials" in new ti.XMLHttpRequest ? ti.XMLHttpRequest : y.XDomainRequest, function (e, t) { for (var i = 0; i < e.length; i++)t(e[i]) }(["get", "put", "post", "patch", "head", "delete"], function (n) { ti["delete" === n ? "del" : n] = function (e, t, i) { return (t = ei(e, t, i)).method = n.toUpperCase(), ii(t) } }), Jt.default = Zt; function ni(e, t) { var i = new y.WebVTT.Parser(y, y.vttjs, y.WebVTT.StringDecoder()), n = []; i.oncue = function (e) { t.addCue(e) }, i.onparsingerror = function (e) { n.push(e) }, i.onflush = function () { t.trigger({ type: "loadeddata", target: t }) }, i.parse(e), 0 < n.length && (y.console && y.console.groupCollapsed && y.console.groupCollapsed("Text Track parsing errors for " + t.src), n.forEach(function (e) { return p.error(e) }), y.console && y.console.groupEnd && y.console.groupEnd()), i.flush() } function ri(e, n) { var t = { uri: e }, i = Mt(e); i && (t.cors = i), Jt(t, ge(this, function (e, t, i) { if (e) return p.error(e, t); n.loaded_ = !0, "function" != typeof y.WebVTT ? n.tech_ && n.tech_.any(["vttjsloaded", "vttjserror"], function (e) { if ("vttjserror" !== e.type) return ni(i, n); p.error("vttjs failed to load, stopping trying to process " + n.src) }) : ni(i, n) })) } var ai = function (l) { function e(e) { var t; if (void 0 === e && (e = {}), !e.tech) throw new Error("A tech was not provided."); var i = Ne(e, { kind: zt[e.kind] || "subtitles", language: e.language || e.srclang || "" }), n = Gt[i.mode] || "disabled", r = i.default; "metadata" !== i.kind && "chapters" !== i.kind || (n = "hidden"), (t = l.call(this, i) || this).tech_ = i.tech, t.cues_ = [], t.activeCues_ = [], t.preload_ = !1 !== t.tech_.preloadTextTracks; var a = new Vt(t.cues_), s = new Vt(t.activeCues_), o = !1, u = ge(Ue(t), function () { this.activeCues = this.activeCues, o && (this.trigger("cuechange"), o = !1) }); return "disabled" !== n && t.tech_.ready(function () { t.tech_.on("timeupdate", u) }, !0), Object.defineProperties(Ue(t), { default: { get: function () { return r }, set: function () { } }, mode: { get: function () { return n }, set: function (e) { var t = this; Gt[e] && (n = e, this.preload_ || "disabled" === n || 0 !== this.cues.length || ri(this.src, this), "disabled" !== n ? this.tech_.ready(function () { t.tech_.on("timeupdate", u) }, !0) : this.tech_.off("timeupdate", u), this.trigger("modechange")) } }, cues: { get: function () { return this.loaded_ ? a : null }, set: function () { } }, activeCues: { get: function () { if (!this.loaded_) return null; if (0 === this.cues.length) return s; for (var e = this.tech_.currentTime(), t = [], i = 0, n = this.cues.length; i < n; i++) { var r = this.cues[i]; r.startTime <= e && r.endTime >= e ? t.push(r) : r.startTime === r.endTime && r.startTime <= e && r.startTime + .5 >= e && t.push(r) } if (o = !1, t.length !== this.activeCues_.length) o = !0; else for (var a = 0; a < t.length; a++)-1 === this.activeCues_.indexOf(t[a]) && (o = !0); return this.activeCues_ = t, s.setCues_(this.activeCues_), s }, set: function () { } } }), i.src ? (t.src = i.src, t.preload_ || (t.loaded_ = !0), (t.preload_ || r || "subtitles" !== i.kind && "captions" !== i.kind) && ri(t.src, Ue(t))) : t.loaded_ = !0, t } He(e, l); var t = e.prototype; return t.addCue = function (e) { var t = e; if (y.vttjs && !(e instanceof y.vttjs.VTTCue)) { for (var i in t = new y.vttjs.VTTCue(e.startTime, e.endTime, e.text), e) i in t || (t[i] = e[i]); t.id = e.id, t.originalCue_ = e } for (var n = this.tech_.textTracks(), r = 0; r < n.length; r++)n[r] !== this && n[r].removeCue(t); this.cues_.push(t), this.cues.setCues_(this.cues_) }, t.removeCue = function (e) { for (var t = this.cues_.length; t--;) { var i = this.cues_[t]; if (i === e || i.originalCue_ && i.originalCue_ === e) { this.cues_.splice(t, 1), this.cues.setCues_(this.cues_); break } } }, e }(Xt); ai.prototype.allowedEvents_ = { cuechange: "cuechange" }; var si = function (r) { function e(e) { var t; void 0 === e && (e = {}); var i = Ne(e, { kind: Wt[e.kind] || "" }); t = r.call(this, i) || this; var n = !1; return Object.defineProperty(Ue(t), "enabled", { get: function () { return n }, set: function (e) { "boolean" == typeof e && e !== n && (n = e, this.trigger("enabledchange")) } }), i.enabled && (t.enabled = i.enabled), t.loaded_ = !0, t } return He(e, r), e }(Xt), oi = function (r) { function e(e) { var t; void 0 === e && (e = {}); var i = Ne(e, { kind: qt[e.kind] || "" }); t = r.call(this, i) || this; var n = !1; return Object.defineProperty(Ue(t), "selected", { get: function () { return n }, set: function (e) { "boolean" == typeof e && e !== n && (n = e, this.trigger("selectedchange")) } }), i.selected && (t.selected = i.selected), t } return He(e, r), e }(Xt), ui = function (r) { function e(e) { var t, i; void 0 === e && (e = {}), t = r.call(this) || this; var n = new ai(e); return t.kind = n.kind, t.src = n.src, t.srclang = n.language, t.label = n.label, t.default = n.default, Object.defineProperties(Ue(t), { readyState: { get: function () { return i } }, track: { get: function () { return n } } }), i = 0, n.addEventListener("loadeddata", function () { i = 2, t.trigger({ type: "load", target: Ue(t) }) }), t } return He(e, r), e }(ye); ui.prototype.allowedEvents_ = { load: "load" }, ui.NONE = 0, ui.LOADING = 1, ui.LOADED = 2, ui.ERROR = 3; var li = { audio: { ListClass: Bt, TrackClass: si, capitalName: "Audio" }, video: { ListClass: jt, TrackClass: oi, capitalName: "Video" }, text: { ListClass: Ft, TrackClass: ai, capitalName: "Text" } }; Object.keys(li).forEach(function (e) { li[e].getterName = e + "Tracks", li[e].privateName = e + "Tracks_" }); var ci = { remoteText: { ListClass: Ft, TrackClass: ai, capitalName: "RemoteText", getterName: "remoteTextTracks", privateName: "remoteTextTracks_" }, remoteTextEl: { ListClass: Ht, TrackClass: ui, capitalName: "RemoteTextTrackEls", getterName: "remoteTextTrackEls", privateName: "remoteTextTrackEls_" } }, hi = r({}, li, ci); ci.names = Object.keys(ci), li.names = Object.keys(li), hi.names = [].concat(ci.names).concat(li.names); var di = Object.create || function (e) { if (1 !== arguments.length) throw new Error("Object.create shim only accepts one parameter."); return pi.prototype = e, new pi }; function pi() { } function fi(e, t) { this.name = "ParsingError", this.code = e.code, this.message = t || e.message } function mi(e) { function t(e, t, i, n) { return 3600 * (0 | e) + 60 * (0 | t) + (0 | i) + (0 | n) / 1e3 } var i = e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/); return i ? i[3] ? t(i[1], i[2], i[3].replace(":", ""), i[4]) : 59 < i[1] ? t(i[1], i[2], 0, i[4]) : t(0, i[1], i[2], i[4]) : null } function gi() { this.values = di(null) } function vi(e, t, i, n) { var r = n ? e.split(n) : [e]; for (var a in r) if ("string" == typeof r[a]) { var s = r[a].split(i); if (2 === s.length) t(s[0], s[1]) } } function yi(t, e, s) { var i = t; function n() { var e = mi(t); if (null === e) throw new fi(fi.Errors.BadTimeStamp, "Malformed timestamp: " + i); return t = t.replace(/^[^\sa-zA-Z-]+/, ""), e } function r() { t = t.replace(/^\s+/, "") } if (r(), e.startTime = n(), r(), "--\x3e" !== t.substr(0, 3)) throw new fi(fi.Errors.BadTimeStamp, "Malformed time stamp (time stamps must be separated by '--\x3e'): " + i); t = t.substr(3), r(), e.endTime = n(), r(), function (e, t) { var a = new gi; vi(e, function (e, t) { switch (e) { case "region": for (var i = s.length - 1; 0 <= i; i--)if (s[i].id === t) { a.set(e, s[i].region); break } break; case "vertical": a.alt(e, t, ["rl", "lr"]); break; case "line": var n = t.split(","), r = n[0]; a.integer(e, r), a.percent(e, r) && a.set("snapToLines", !1), a.alt(e, r, ["auto"]), 2 === n.length && a.alt("lineAlign", n[1], ["start", "center", "end"]); break; case "position": n = t.split(","), a.percent(e, n[0]), 2 === n.length && a.alt("positionAlign", n[1], ["start", "center", "end"]); break; case "size": a.percent(e, t); break; case "align": a.alt(e, t, ["start", "center", "end", "left", "right"]) } }, /:/, /\s/), t.region = a.get("region", null), t.vertical = a.get("vertical", ""); try { t.line = a.get("line", "auto") } catch (e) { } t.lineAlign = a.get("lineAlign", "start"), t.snapToLines = a.get("snapToLines", !0), t.size = a.get("size", 100); try { t.align = a.get("align", "center") } catch (e) { t.align = a.get("align", "middle") } try { t.position = a.get("position", "auto") } catch (e) { t.position = a.get("position", { start: 0, left: 0, center: 50, middle: 50, end: 100, right: 100 }, t.align) } t.positionAlign = a.get("positionAlign", { start: "start", left: "start", center: "center", middle: "center", end: "end", right: "end" }, t.align) }(t, e) } ((fi.prototype = di(Error.prototype)).constructor = fi).Errors = { BadSignature: { code: 0, message: "Malformed WebVTT signature." }, BadTimeStamp: { code: 1, message: "Malformed time stamp." } }, gi.prototype = { set: function (e, t) { this.get(e) || "" === t || (this.values[e] = t) }, get: function (e, t, i) { return i ? this.has(e) ? this.values[e] : t[i] : this.has(e) ? this.values[e] : t }, has: function (e) { return e in this.values }, alt: function (e, t, i) { for (var n = 0; n < i.length; ++n)if (t === i[n]) { this.set(e, t); break } }, integer: function (e, t) { /^-?\d+$/.test(t) && this.set(e, parseInt(t, 10)) }, percent: function (e, t) { return !!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/) && 0 <= (t = parseFloat(t)) && t <= 100) && (this.set(e, t), !0) } }; var _i = h.createElement("textarea"), bi = { c: "span", i: "i", b: "b", u: "u", ruby: "ruby", rt: "rt", v: "span", lang: "span" }, Ti = { white: "rgba(255,255,255,1)", lime: "rgba(0,255,0,1)", cyan: "rgba(0,255,255,1)", red: "rgba(255,0,0,1)", yellow: "rgba(255,255,0,1)", magenta: "rgba(255,0,255,1)", blue: "rgba(0,0,255,1)", black: "rgba(0,0,0,1)" }, Si = { v: "title", lang: "lang" }, ki = { rt: "ruby" }; function Ci(a, i) { function e() { if (!i) return null; var e, t = i.match(/^([^<]*)(<[^>]*>?)?/); return e = t[1] ? t[1] : t[2], i = i.substr(e.length), e } function t(e, t) { var i = bi[e]; if (!i) return null; var n = a.document.createElement(i), r = Si[e]; return r && t && (n[r] = t.trim()), n } for (var n, r, s, o, u = a.document.createElement("div"), l = u, c = []; null !== (n = e());)if ("<" !== n[0]) l.appendChild(a.document.createTextNode((r = n, _i.innerHTML = r, r = _i.textContent, _i.textContent = "", r))); else { if ("/" === n[1]) { c.length && c[c.length - 1] === n.substr(2).replace(">", "") && (c.pop(), l = l.parentNode); continue } var h, d = mi(n.substr(1, n.length - 2)); if (d) { h = a.document.createProcessingInstruction("timestamp", d), l.appendChild(h); continue } var p = n.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/); if (!p) continue; if (!(h = t(p[1], p[3]))) continue; if (s = l, ki[(o = h).localName] && ki[o.localName] !== s.localName) continue; if (p[2]) { var f = p[2].split("."); f.forEach(function (e) { var t = /^bg_/.test(e), i = t ? e.slice(3) : e; if (Ti.hasOwnProperty(i)) { var n = t ? "background-color" : "color", r = Ti[i]; h.style[n] = r } }), h.className = f.join(" ") } c.push(p[1]), l.appendChild(h), l = h } return u } var Ei = [[1470, 1470], [1472, 1472], [1475, 1475], [1478, 1478], [1488, 1514], [1520, 1524], [1544, 1544], [1547, 1547], [1549, 1549], [1563, 1563], [1566, 1610], [1645, 1647], [1649, 1749], [1765, 1766], [1774, 1775], [1786, 1805], [1807, 1808], [1810, 1839], [1869, 1957], [1969, 1969], [1984, 2026], [2036, 2037], [2042, 2042], [2048, 2069], [2074, 2074], [2084, 2084], [2088, 2088], [2096, 2110], [2112, 2136], [2142, 2142], [2208, 2208], [2210, 2220], [8207, 8207], [64285, 64285], [64287, 64296], [64298, 64310], [64312, 64316], [64318, 64318], [64320, 64321], [64323, 64324], [64326, 64449], [64467, 64829], [64848, 64911], [64914, 64967], [65008, 65020], [65136, 65140], [65142, 65276], [67584, 67589], [67592, 67592], [67594, 67637], [67639, 67640], [67644, 67644], [67647, 67669], [67671, 67679], [67840, 67867], [67872, 67897], [67903, 67903], [67968, 68023], [68030, 68031], [68096, 68096], [68112, 68115], [68117, 68119], [68121, 68147], [68160, 68167], [68176, 68184], [68192, 68223], [68352, 68405], [68416, 68437], [68440, 68466], [68472, 68479], [68608, 68680], [126464, 126467], [126469, 126495], [126497, 126498], [126500, 126500], [126503, 126503], [126505, 126514], [126516, 126519], [126521, 126521], [126523, 126523], [126530, 126530], [126535, 126535], [126537, 126537], [126539, 126539], [126541, 126543], [126545, 126546], [126548, 126548], [126551, 126551], [126553, 126553], [126555, 126555], [126557, 126557], [126559, 126559], [126561, 126562], [126564, 126564], [126567, 126570], [126572, 126578], [126580, 126583], [126585, 126588], [126590, 126590], [126592, 126601], [126603, 126619], [126625, 126627], [126629, 126633], [126635, 126651], [1114109, 1114109]]; function wi(e) { for (var t = 0; t < Ei.length; t++) { var i = Ei[t]; if (e >= i[0] && e <= i[1]) return !0 } return !1 } function Ai() { } function Ii(e, t, i) { Ai.call(this), this.cue = t, this.cueDiv = Ci(e, t.text); var n = { color: "rgba(255, 255, 255, 1)", backgroundColor: "rgba(0, 0, 0, 0.8)", position: "relative", left: 0, right: 0, top: 0, bottom: 0, display: "inline", writingMode: "" === t.vertical ? "horizontal-tb" : "lr" === t.vertical ? "vertical-lr" : "vertical-rl", unicodeBidi: "plaintext" }; this.applyStyles(n, this.cueDiv), this.div = e.document.createElement("div"), n = { direction: function (e) { var t = [], i = ""; if (!e || !e.childNodes) return "ltr"; function r(e, t) { for (var i = t.childNodes.length - 1; 0 <= i; i--)e.push(t.childNodes[i]) } function a(e) { if (!e || !e.length) return null; var t = e.pop(), i = t.textContent || t.innerText; if (i) { var n = i.match(/^.*(\n|\r)/); return n ? n[e.length = 0] : i } return "ruby" === t.tagName ? a(e) : t.childNodes ? (r(e, t), a(e)) : void 0 } for (r(t, e); i = a(t);)for (var n = 0; n < i.length; n++)if (wi(i.charCodeAt(n))) return "rtl"; return "ltr" }(this.cueDiv), writingMode: "" === t.vertical ? "horizontal-tb" : "lr" === t.vertical ? "vertical-lr" : "vertical-rl", unicodeBidi: "plaintext", textAlign: "middle" === t.align ? "center" : t.align, font: i.font, whiteSpace: "pre-line", position: "absolute" }, this.applyStyles(n), this.div.appendChild(this.cueDiv); var r = 0; switch (t.positionAlign) { case "start": r = t.position; break; case "center": r = t.position - t.size / 2; break; case "end": r = t.position - t.size }"" === t.vertical ? this.applyStyles({ left: this.formatStyle(r, "%"), width: this.formatStyle(t.size, "%") }) : this.applyStyles({ top: this.formatStyle(r, "%"), height: this.formatStyle(t.size, "%") }), this.move = function (e) { this.applyStyles({ top: this.formatStyle(e.top, "px"), bottom: this.formatStyle(e.bottom, "px"), left: this.formatStyle(e.left, "px"), right: this.formatStyle(e.right, "px"), height: this.formatStyle(e.height, "px"), width: this.formatStyle(e.width, "px") }) } } function xi(e) { var t, i, n, r; if (e.div) { i = e.div.offsetHeight, n = e.div.offsetWidth, r = e.div.offsetTop; var a = (a = e.div.childNodes) && (a = a[0]) && a.getClientRects && a.getClientRects(); e = e.div.getBoundingClientRect(), t = a ? Math.max(a[0] && a[0].height || 0, e.height / a.length) : 0 } this.left = e.left, this.right = e.right, this.top = e.top || r, this.height = e.height || i, this.bottom = e.bottom || r + (e.height || i), this.width = e.width || n, this.lineHeight = void 0 !== t ? t : e.lineHeight } function Pi(e, t, o, u) { var i = new xi(t), n = t.cue, r = function (e) { if ("number" == typeof e.line && (e.snapToLines || 0 <= e.line && e.line <= 100)) return e.line; if (!e.track || !e.track.textTrackList || !e.track.textTrackList.mediaElement) return -1; for (var t = e.track, i = t.textTrackList, n = 0, r = 0; r < i.length && i[r] !== t; r++)"showing" === i[r].mode && n++; return -1 * ++n }(n), a = []; if (n.snapToLines) { var s; switch (n.vertical) { case "": a = ["+y", "-y"], s = "height"; break; case "rl": a = ["+x", "-x"], s = "width"; break; case "lr": a = ["-x", "+x"], s = "width" }var l = i.lineHeight, c = l * Math.round(r), h = o[s] + l, d = a[0]; Math.abs(c) > h && (c = c < 0 ? -1 : 1, c *= Math.ceil(h / l) * l), r < 0 && (c += "" === n.vertical ? o.height : o.width, a = a.reverse()), i.move(d, c) } else { var p = i.lineHeight / o.height * 100; switch (n.lineAlign) { case "center": r -= p / 2; break; case "end": r -= p }switch (n.vertical) { case "": t.applyStyles({ top: t.formatStyle(r, "%") }); break; case "rl": t.applyStyles({ left: t.formatStyle(r, "%") }); break; case "lr": t.applyStyles({ right: t.formatStyle(r, "%") }) }a = ["+y", "-x", "+x", "-y"], i = new xi(t) } var f = function (e, t) { for (var i, n = new xi(e), r = 1, a = 0; a < t.length; a++) { for (; e.overlapsOppositeAxis(o, t[a]) || e.within(o) && e.overlapsAny(u);)e.move(t[a]); if (e.within(o)) return e; var s = e.intersectPercentage(o); s < r && (i = new xi(e), r = s), e = new xi(n) } return i || n }(i, a); t.move(f.toCSSCompatValues(o)) } function Li() { } Ai.prototype.applyStyles = function (e, t) { for (var i in t = t || this.div, e) e.hasOwnProperty(i) && (t.style[i] = e[i]) }, Ai.prototype.formatStyle = function (e, t) { return 0 === e ? 0 : e + t }, (Ii.prototype = di(Ai.prototype)).constructor = Ii, xi.prototype.move = function (e, t) { switch (t = void 0 !== t ? t : this.lineHeight, e) { case "+x": this.left += t, this.right += t; break; case "-x": this.left -= t, this.right -= t; break; case "+y": this.top += t, this.bottom += t; break; case "-y": this.top -= t, this.bottom -= t } }, xi.prototype.overlaps = function (e) { return this.left < e.right && this.right > e.left && this.top < e.bottom && this.bottom > e.top }, xi.prototype.overlapsAny = function (e) { for (var t = 0; t < e.length; t++)if (this.overlaps(e[t])) return !0; return !1 }, xi.prototype.within = function (e) { return this.top >= e.top && this.bottom <= e.bottom && this.left >= e.left && this.right <= e.right }, xi.prototype.overlapsOppositeAxis = function (e, t) { switch (t) { case "+x": return this.left < e.left; case "-x": return this.right > e.right; case "+y": return this.top < e.top; case "-y": return this.bottom > e.bottom } }, xi.prototype.intersectPercentage = function (e) { return Math.max(0, Math.min(this.right, e.right) - Math.max(this.left, e.left)) * Math.max(0, Math.min(this.bottom, e.bottom) - Math.max(this.top, e.top)) / (this.height * this.width) }, xi.prototype.toCSSCompatValues = function (e) { return { top: this.top - e.top, bottom: e.bottom - this.bottom, left: this.left - e.left, right: e.right - this.right, height: this.height, width: this.width } }, xi.getSimpleBoxPosition = function (e) { var t = e.div ? e.div.offsetHeight : e.tagName ? e.offsetHeight : 0, i = e.div ? e.div.offsetWidth : e.tagName ? e.offsetWidth : 0, n = e.div ? e.div.offsetTop : e.tagName ? e.offsetTop : 0; return { left: (e = e.div ? e.div.getBoundingClientRect() : e.tagName ? e.getBoundingClientRect() : e).left, right: e.right, top: e.top || n, height: e.height || t, bottom: e.bottom || n + (e.height || t), width: e.width || i } }, Li.StringDecoder = function () { return { decode: function (e) { if (!e) return ""; if ("string" != typeof e) throw new Error("Error - expected string data."); return decodeURIComponent(encodeURIComponent(e)) } } }, Li.convertCueToDOMTree = function (e, t) { return e && t ? Ci(e, t) : null }; Li.processCues = function (n, r, e) { if (!n || !r || !e) return null; for (; e.firstChild;)e.removeChild(e.firstChild); var a = n.document.createElement("div"); if (a.style.position = "absolute", a.style.left = "0", a.style.right = "0", a.style.top = "0", a.style.bottom = "0", a.style.margin = "1.5%", e.appendChild(a), function (e) { for (var t = 0; t < e.length; t++)if (e[t].hasBeenReset || !e[t].displayState) return !0; return !1 }(r)) { var s = [], o = xi.getSimpleBoxPosition(a), u = { font: Math.round(.05 * o.height * 100) / 100 + "px sans-serif" }; !function () { for (var e, t, i = 0; i < r.length; i++)t = r[i], e = new Ii(n, t, u), a.appendChild(e.div), Pi(0, e, o, s), t.displayState = e.div, s.push(xi.getSimpleBoxPosition(e)) }() } else for (var t = 0; t < r.length; t++)a.appendChild(r[t].displayState) }, (Li.Parser = function (e, t, i) { i || (i = t, t = {}), t = t || {}, this.window = e, this.vttjs = t, this.state = "INITIAL", this.buffer = "", this.decoder = i || new TextDecoder("utf8"), this.regionList = [] }).prototype = { reportOrThrowError: function (e) { if (!(e instanceof fi)) throw e; this.onparsingerror && this.onparsingerror(e) }, parse: function (e) { var n = this; function t() { for (var e = n.buffer, t = 0; t < e.length && "\r" !== e[t] && "\n" !== e[t];)++t; var i = e.substr(0, t); return "\r" === e[t] && ++t, "\n" === e[t] && ++t, n.buffer = e.substr(t), i } function i(e) { e.match(/X-TIMESTAMP-MAP/) ? vi(e, function (e, t) { switch (e) { case "X-TIMESTAMP-MAP": !function (e) { var i = new gi; vi(e, function (e, t) { switch (e) { case "MPEGT": i.integer(e + "S", t); break; case "LOCA": i.set(e + "L", mi(t)) } }, /[^\d]:/, /,/), n.ontimestampmap && n.ontimestampmap({ MPEGTS: i.get("MPEGTS"), LOCAL: i.get("LOCAL") }) }(t) } }, /=/) : vi(e, function (e, t) { switch (e) { case "Region": !function (e) { var r = new gi; if (vi(e, function (e, t) { switch (e) { case "id": r.set(e, t); break; case "width": r.percent(e, t); break; case "lines": r.integer(e, t); break; case "regionanchor": case "viewportanchor": var i = t.split(","); if (2 !== i.length) break; var n = new gi; if (n.percent("x", i[0]), n.percent("y", i[1]), !n.has("x") || !n.has("y")) break; r.set(e + "X", n.get("x")), r.set(e + "Y", n.get("y")); break; case "scroll": r.alt(e, t, ["up"]) } }, /=/, /\s/), r.has("id")) { var t = new (n.vttjs.VTTRegion || n.window.VTTRegion); t.width = r.get("width", 100), t.lines = r.get("lines", 3), t.regionAnchorX = r.get("regionanchorX", 0), t.regionAnchorY = r.get("regionanchorY", 100), t.viewportAnchorX = r.get("viewportanchorX", 0), t.viewportAnchorY = r.get("viewportanchorY", 100), t.scroll = r.get("scroll", ""), n.onregion && n.onregion(t), n.regionList.push({ id: r.get("id"), region: t }) } }(t) } }, /:/) } e && (n.buffer += n.decoder.decode(e, { stream: !0 })); try { var r; if ("INITIAL" === n.state) { if (!/\r\n|\n/.test(n.buffer)) return this; var a = (r = t()).match(/^WEBVTT([ \t].*)?$/); if (!a || !a[0]) throw new fi(fi.Errors.BadSignature); n.state = "HEADER" } for (var s = !1; n.buffer;) { if (!/\r\n|\n/.test(n.buffer)) return this; switch (s ? s = !1 : r = t(), n.state) { case "HEADER": /:/.test(r) ? i(r) : r || (n.state = "ID"); continue; case "NOTE": r || (n.state = "ID"); continue; case "ID": if (/^NOTE($|[ \t])/.test(r)) { n.state = "NOTE"; break } if (!r) continue; n.cue = new (n.vttjs.VTTCue || n.window.VTTCue)(0, 0, ""); try { n.cue.align = "center" } catch (e) { n.cue.align = "middle" } if (n.state = "CUE", -1 === r.indexOf("--\x3e")) { n.cue.id = r; continue } case "CUE": try { yi(r, n.cue, n.regionList) } catch (e) { n.reportOrThrowError(e), n.cue = null, n.state = "BADCUE"; continue } n.state = "CUETEXT"; continue; case "CUETEXT": var o = -1 !== r.indexOf("--\x3e"); if (!r || o && (s = !0)) { n.oncue && n.oncue(n.cue), n.cue = null, n.state = "ID"; continue } n.cue.text && (n.cue.text += "\n"), n.cue.text += r.replace(/\u2028/g, "\n").replace(/u2029/g, "\n"); continue; case "BADCUE": r || (n.state = "ID"); continue } } } catch (e) { n.reportOrThrowError(e), "CUETEXT" === n.state && n.cue && n.oncue && n.oncue(n.cue), n.cue = null, n.state = "INITIAL" === n.state ? "BADWEBVTT" : "BADCUE" } return this }, flush: function () { var t = this; try { if (t.buffer += t.decoder.decode(), !t.cue && "HEADER" !== t.state || (t.buffer += "\n\n", t.parse()), "INITIAL" === t.state) throw new fi(fi.Errors.BadSignature) } catch (e) { t.reportOrThrowError(e) } return t.onflush && t.onflush(), this } }; var Oi = Li, Di = { "": 1, lr: 1, rl: 1 }, Ni = { start: 1, center: 1, end: 1, left: 1, right: 1, auto: 1, "line-left": 1, "line-right": 1 }; function Ri(e) { return "string" == typeof e && (!!Ni[e.toLowerCase()] && e.toLowerCase()) } function Ui(e, t, i) { this.hasBeenReset = !1; var n = "", r = !1, a = e, s = t, o = i, u = null, l = "", c = !0, h = "auto", d = "start", p = "auto", f = "auto", m = 100, g = "center"; Object.defineProperties(this, { id: { enumerable: !0, get: function () { return n }, set: function (e) { n = "" + e } }, pauseOnExit: { enumerable: !0, get: function () { return r }, set: function (e) { r = !!e } }, startTime: { enumerable: !0, get: function () { return a }, set: function (e) { if ("number" != typeof e) throw new TypeError("Start time must be set to a number."); a = e, this.hasBeenReset = !0 } }, endTime: { enumerable: !0, get: function () { return s }, set: function (e) { if ("number" != typeof e) throw new TypeError("End time must be set to a number."); s = e, this.hasBeenReset = !0 } }, text: { enumerable: !0, get: function () { return o }, set: function (e) { o = "" + e, this.hasBeenReset = !0 } }, region: { enumerable: !0, get: function () { return u }, set: function (e) { u = e, this.hasBeenReset = !0 } }, vertical: { enumerable: !0, get: function () { return l }, set: function (e) { var t = function (e) { return "string" == typeof e && (!!Di[e.toLowerCase()] && e.toLowerCase()) }(e); if (!1 === t) throw new SyntaxError("Vertical: an invalid or illegal direction string was specified."); l = t, this.hasBeenReset = !0 } }, snapToLines: { enumerable: !0, get: function () { return c }, set: function (e) { c = !!e, this.hasBeenReset = !0 } }, line: { enumerable: !0, get: function () { return h }, set: function (e) { if ("number" != typeof e && "auto" !== e) throw new SyntaxError("Line: an invalid number or illegal string was specified."); h = e, this.hasBeenReset = !0 } }, lineAlign: { enumerable: !0, get: function () { return d }, set: function (e) { var t = Ri(e); t && (d = t, this.hasBeenReset = !0) } }, position: { enumerable: !0, get: function () { return p }, set: function (e) { if (e < 0 || 100 < e) throw new Error("Position must be between 0 and 100."); p = e, this.hasBeenReset = !0 } }, positionAlign: { enumerable: !0, get: function () { return f }, set: function (e) { var t = Ri(e); t && (f = t, this.hasBeenReset = !0) } }, size: { enumerable: !0, get: function () { return m }, set: function (e) { if (e < 0 || 100 < e) throw new Error("Size must be between 0 and 100."); m = e, this.hasBeenReset = !0 } }, align: { enumerable: !0, get: function () { return g }, set: function (e) { var t = Ri(e); if (!t) throw new SyntaxError("align: an invalid or illegal alignment string was specified."); g = t, this.hasBeenReset = !0 } } }), this.displayState = void 0 } Ui.prototype.getCueAsHTML = function () { return WebVTT.convertCueToDOMTree(window, this.text) }; var Mi = Ui, Bi = { "": !0, up: !0 }; function ji(e) { return "number" == typeof e && 0 <= e && e <= 100 } function Fi() { var t = 100, i = 3, n = 0, r = 100, a = 0, s = 100, o = ""; Object.defineProperties(this, { width: { enumerable: !0, get: function () { return t }, set: function (e) { if (!ji(e)) throw new Error("Width must be between 0 and 100."); t = e } }, lines: { enumerable: !0, get: function () { return i }, set: function (e) { if ("number" != typeof e) throw new TypeError("Lines must be set to a number."); i = e } }, regionAnchorY: { enumerable: !0, get: function () { return r }, set: function (e) { if (!ji(e)) throw new Error("RegionAnchorX must be between 0 and 100."); r = e } }, regionAnchorX: { enumerable: !0, get: function () { return n }, set: function (e) { if (!ji(e)) throw new Error("RegionAnchorY must be between 0 and 100."); n = e } }, viewportAnchorY: { enumerable: !0, get: function () { return s }, set: function (e) { if (!ji(e)) throw new Error("ViewportAnchorY must be between 0 and 100."); s = e } }, viewportAnchorX: { enumerable: !0, get: function () { return a }, set: function (e) { if (!ji(e)) throw new Error("ViewportAnchorX must be between 0 and 100."); a = e } }, scroll: { enumerable: !0, get: function () { return o }, set: function (e) { var t = function (e) { return "string" == typeof e && (!!Bi[e.toLowerCase()] && e.toLowerCase()) }(e); !1 === t || (o = t) } } }) } var Hi = t(function (e) { var t = e.exports = { WebVTT: Oi, VTTCue: Mi, VTTRegion: Fi }; y.vttjs = t, y.WebVTT = t.WebVTT; var i = t.VTTCue, n = t.VTTRegion, r = y.VTTCue, a = y.VTTRegion; t.shim = function () { y.VTTCue = i, y.VTTRegion = n }, t.restore = function () { y.VTTCue = r, y.VTTRegion = a }, y.VTTCue || t.shim() }); Hi.WebVTT, Hi.VTTCue, Hi.VTTRegion; var Vi = function (t) { function i(i, e) { var n; return void 0 === i && (i = {}), void 0 === e && (e = function () { }), i.reportTouchActivity = !1, (n = t.call(this, null, i, e) || this).hasStarted_ = !1, n.on("playing", function () { this.hasStarted_ = !0 }), n.on("loadstart", function () { this.hasStarted_ = !1 }), hi.names.forEach(function (e) { var t = hi[e]; i && i[t.getterName] && (n[t.privateName] = i[t.getterName]) }), n.featuresProgressEvents || n.manualProgressOn(), n.featuresTimeupdateEvents || n.manualTimeUpdatesOn(), ["Text", "Audio", "Video"].forEach(function (e) { !1 === i["native" + e + "Tracks"] && (n["featuresNative" + e + "Tracks"] = !1) }), !1 === i.nativeCaptions || !1 === i.nativeTextTracks ? n.featuresNativeTextTracks = !1 : !0 !== i.nativeCaptions && !0 !== i.nativeTextTracks || (n.featuresNativeTextTracks = !0), n.featuresNativeTextTracks || n.emulateTextTracks(), n.preloadTextTracks = !1 !== i.preloadTextTracks, n.autoRemoteTextTracks_ = new hi.text.ListClass, n.initTrackListeners(), i.nativeControlsForTouch || n.emitTapEvents(), n.constructor && (n.name_ = n.constructor.name || "Unknown Tech"), n } He(i, t); var e = i.prototype; return e.triggerSourceset = function (e) { var t = this; this.isReady_ || this.one("ready", function () { return t.setTimeout(function () { return t.triggerSourceset(e) }, 1) }), this.trigger({ src: e, type: "sourceset" }) }, e.manualProgressOn = function () { this.on("durationchange", this.onDurationChange), this.manualProgress = !0, this.one("ready", this.trackProgress) }, e.manualProgressOff = function () { this.manualProgress = !1, this.stopTrackingProgress(), this.off("durationchange", this.onDurationChange) }, e.trackProgress = function (e) { this.stopTrackingProgress(), this.progressInterval = this.setInterval(ge(this, function () { var e = this.bufferedPercent(); this.bufferedPercent_ !== e && this.trigger("progress"), 1 === (this.bufferedPercent_ = e) && this.stopTrackingProgress() }), 500) }, e.onDurationChange = function (e) { this.duration_ = this.duration() }, e.buffered = function () { return ht(0, 0) }, e.bufferedPercent = function () { return dt(this.buffered(), this.duration_) }, e.stopTrackingProgress = function () { this.clearInterval(this.progressInterval) }, e.manualTimeUpdatesOn = function () { this.manualTimeUpdates = !0, this.on("play", this.trackCurrentTime), this.on("pause", this.stopTrackingCurrentTime) }, e.manualTimeUpdatesOff = function () { this.manualTimeUpdates = !1, this.stopTrackingCurrentTime(), this.off("play", this.trackCurrentTime), this.off("pause", this.stopTrackingCurrentTime) }, e.trackCurrentTime = function () { this.currentTimeInterval && this.stopTrackingCurrentTime(), this.currentTimeInterval = this.setInterval(function () { this.trigger({ type: "timeupdate", target: this, manuallyTriggered: !0 }) }, 250) }, e.stopTrackingCurrentTime = function () { this.clearInterval(this.currentTimeInterval), this.trigger({ type: "timeupdate", target: this, manuallyTriggered: !0 }) }, e.dispose = function () { this.clearTracks(li.names), this.manualProgress && this.manualProgressOff(), this.manualTimeUpdates && this.manualTimeUpdatesOff(), t.prototype.dispose.call(this) }, e.clearTracks = function (e) { var r = this; (e = [].concat(e)).forEach(function (e) { for (var t = r[e + "Tracks"]() || [], i = t.length; i--;) { var n = t[i]; "text" === e && r.removeRemoteTextTrack(n), t.removeTrack(n) } }) }, e.cleanupAutoTextTracks = function () { for (var e = this.autoRemoteTextTracks_ || [], t = e.length; t--;) { var i = e[t]; this.removeRemoteTextTrack(i) } }, e.reset = function () { }, e.error = function (e) { return void 0 !== e && (this.error_ = new _t(e), this.trigger("error")), this.error_ }, e.played = function () { return this.hasStarted_ ? ht(0, 0) : ht() }, e.setCurrentTime = function () { this.manualTimeUpdates && this.trigger({ type: "timeupdate", target: this, manuallyTriggered: !0 }) }, e.initTrackListeners = function () { var r = this; li.names.forEach(function (e) { function t() { r.trigger(e + "trackchange") } var i = li[e], n = r[i.getterName](); n.addEventListener("removetrack", t), n.addEventListener("addtrack", t), r.on("dispose", function () { n.removeEventListener("removetrack", t), n.removeEventListener("addtrack", t) }) }) }, e.addWebVttScript_ = function () { var e = this; if (!y.WebVTT) if (h.body.contains(this.el())) { if (!this.options_["vtt.js"] && u(Hi) && 0 < Object.keys(Hi).length) return void this.trigger("vttjsloaded"); var t = h.createElement("script"); t.src = this.options_["vtt.js"] || "https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js", t.onload = function () { e.trigger("vttjsloaded") }, t.onerror = function () { e.trigger("vttjserror") }, this.on("dispose", function () { t.onload = null, t.onerror = null }), y.WebVTT = !0, this.el().parentNode.appendChild(t) } else this.ready(this.addWebVttScript_) }, e.emulateTextTracks = function () { function t(e) { return n.addTrack(e.track) } function i(e) { return n.removeTrack(e.track) } var e = this, n = this.textTracks(), r = this.remoteTextTracks(); r.on("addtrack", t), r.on("removetrack", i), this.addWebVttScript_(); function a() { return e.trigger("texttrackchange") } function s() { a(); for (var e = 0; e < n.length; e++) { var t = n[e]; t.removeEventListener("cuechange", a), "showing" === t.mode && t.addEventListener("cuechange", a) } } s(), n.addEventListener("change", s), n.addEventListener("addtrack", s), n.addEventListener("removetrack", s), this.on("dispose", function () { r.off("addtrack", t), r.off("removetrack", i), n.removeEventListener("change", s), n.removeEventListener("addtrack", s), n.removeEventListener("removetrack", s); for (var e = 0; e < n.length; e++) { n[e].removeEventListener("cuechange", a) } }) }, e.addTextTrack = function (e, t, i) { if (!e) throw new Error("TextTrack kind is required but was not provided"); return function (e, t, i, n, r) { void 0 === r && (r = {}); var a = e.textTracks(); r.kind = t, i && (r.label = i), n && (r.language = n), r.tech = e; var s = new hi.text.TrackClass(r); return a.addTrack(s), s }(this, e, t, i) }, e.createRemoteTextTrack = function (e) { var t = Ne(e, { tech: this }); return new ci.remoteTextEl.TrackClass(t) }, e.addRemoteTextTrack = function (e, t) { var i = this; void 0 === e && (e = {}); var n = this.createRemoteTextTrack(e); return !0 !== t && !1 !== t && (p.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'), t = !0), this.remoteTextTrackEls().addTrackElement_(n), this.remoteTextTracks().addTrack(n.track), !0 !== t && this.ready(function () { return i.autoRemoteTextTracks_.addTrack(n.track) }), n }, e.removeRemoteTextTrack = function (e) { var t = this.remoteTextTrackEls().getTrackElementByTrack_(e); this.remoteTextTrackEls().removeTrackElement_(t), this.remoteTextTracks().removeTrack(e), this.autoRemoteTextTracks_.removeTrack(e) }, e.getVideoPlaybackQuality = function () { return {} }, e.requestPictureInPicture = function () { var e = this.options_.Promise || y.Promise; if (e) return e.reject() }, e.setPoster = function () { }, e.playsinline = function () { }, e.setPlaysinline = function () { }, e.overrideNativeAudioTracks = function () { }, e.overrideNativeVideoTracks = function () { }, e.canPlayType = function () { return "" }, i.canPlayType = function () { return "" }, i.canPlaySource = function (e, t) { return i.canPlayType(e.type) }, i.isTech = function (e) { return e.prototype instanceof i || e instanceof i || e === i }, i.registerTech = function (e, t) { if (i.techs_ || (i.techs_ = {}), !i.isTech(t)) throw new Error("Tech " + e + " must be a Tech"); if (!i.canPlayType) throw new Error("Techs must have a static canPlayType method on them"); if (!i.canPlaySource) throw new Error("Techs must have a static canPlaySource method on them"); return e = De(e), i.techs_[e] = t, i.techs_[Oe(e)] = t, "Tech" !== e && i.defaultTechOrder_.push(e), t }, i.getTech = function (e) { if (e) return i.techs_ && i.techs_[e] ? i.techs_[e] : (e = De(e), y && y.videojs && y.videojs[e] ? (p.warn("The " + e + " tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"), y.videojs[e]) : void 0) }, i }(Re); hi.names.forEach(function (e) { var t = hi[e]; Vi.prototype[t.getterName] = function () { return this[t.privateName] = this[t.privateName] || new t.ListClass, this[t.privateName] } }), Vi.prototype.featuresVolumeControl = !0, Vi.prototype.featuresMuteControl = !0, Vi.prototype.featuresFullscreenResize = !1, Vi.prototype.featuresPlaybackRate = !1, Vi.prototype.featuresProgressEvents = !1, Vi.prototype.featuresSourceset = !1, Vi.prototype.featuresTimeupdateEvents = !1, Vi.prototype.featuresNativeTextTracks = !1, Vi.withSourceHandlers = function (r) { r.registerSourceHandler = function (e, t) { var i = r.sourceHandlers; i = i || (r.sourceHandlers = []), void 0 === t && (t = i.length), i.splice(t, 0, e) }, r.canPlayType = function (e) { for (var t, i = r.sourceHandlers || [], n = 0; n < i.length; n++)if (t = i[n].canPlayType(e)) return t; return "" }, r.selectSourceHandler = function (e, t) { for (var i = r.sourceHandlers || [], n = 0; n < i.length; n++)if (i[n].canHandleSource(e, t)) return i[n]; return null }, r.canPlaySource = function (e, t) { var i = r.selectSourceHandler(e, t); return i ? i.canHandleSource(e, t) : "" };["seekable", "seeking", "duration"].forEach(function (e) { var t = this[e]; "function" == typeof t && (this[e] = function () { return this.sourceHandler_ && this.sourceHandler_[e] ? this.sourceHandler_[e].apply(this.sourceHandler_, arguments) : t.apply(this, arguments) }) }, r.prototype), r.prototype.setSource = function (e) { var t = r.selectSourceHandler(e, this.options_); t || (r.nativeSourceHandler ? t = r.nativeSourceHandler : p.error("No source handler found for the current source.")), this.disposeSourceHandler(), this.off("dispose", this.disposeSourceHandler), t !== r.nativeSourceHandler && (this.currentSource_ = e), this.sourceHandler_ = t.handleSource(e, this, this.options_), this.one("dispose", this.disposeSourceHandler) }, r.prototype.disposeSourceHandler = function () { this.currentSource_ && (this.clearTracks(["audio", "video"]), this.currentSource_ = null), this.cleanupAutoTextTracks(), this.sourceHandler_ && (this.sourceHandler_.dispose && this.sourceHandler_.dispose(), this.sourceHandler_ = null) } }, Re.registerComponent("Tech", Vi), Vi.registerTech("Tech", Vi), Vi.defaultTechOrder_ = []; var qi = {}, Wi = {}, zi = {}; function Gi(e, t, i) { e.setTimeout(function () { return function i(n, e, r, a, s, o) { void 0 === n && (n = {}); void 0 === e && (e = []); void 0 === s && (s = []); void 0 === o && (o = !1); var t = e, u = t[0], l = t.slice(1); if ("string" == typeof u) i(n, qi[u], r, a, s, o); else if (u) { var c = Ji(a, u); if (!c.setSource) return s.push(c), i(n, l, r, a, s, o); c.setSource(m({}, n), function (e, t) { if (e) return i(n, l, r, a, s, o); s.push(c), i(t, n.type === t.type ? l : qi[t.type], r, a, s, o) }) } else l.length ? i(n, l, r, a, s, o) : o ? r(n, s) : i(n, qi["*"], r, a, s, !0) }(t, qi[t.type], i, e) }, 1) } function Xi(e, t, i, n) { void 0 === n && (n = null); var r = "call" + De(i), a = e.reduce(Qi(r), n), s = a === zi, o = s ? null : t[i](a); return function (e, t, i, n) { for (var r = e.length - 1; 0 <= r; r--) { var a = e[r]; a[t] && a[t](n, i) } }(e, i, o, s), o } var Ki = { buffered: 1, currentTime: 1, duration: 1, muted: 1, played: 1, paused: 1, seekable: 1, volume: 1 }, Yi = { setCurrentTime: 1, setMuted: 1, setVolume: 1 }, $i = { play: 1, pause: 1 }; function Qi(i) { return function (e, t) { return e === zi ? zi : t[i] ? t[i](e) : e } } function Ji(e, t) { var i = Wi[e.id()], n = null; if (null == i) return n = t(e), Wi[e.id()] = [[t, n]], n; for (var r = 0; r < i.length; r++) { var a = i[r], s = a[0], o = a[1]; s === t && (n = o) } return null === n && (n = t(e), i.push([t, n])), n } function Zi(e) { void 0 === e && (e = ""); var t = Ut(e); return en[t.toLowerCase()] || "" } var en = { opus: "video/ogg", ogv: "video/ogg", mp4: "video/mp4", mov: "video/mp4", m4v: "video/mp4", mkv: "video/x-matroska", m4a: "audio/mp4", mp3: "audio/mpeg", aac: "audio/aac", oga: "audio/ogg", m3u8: "application/x-mpegURL", jpg: "image/jpeg", jpeg: "image/jpeg", gif: "image/gif", png: "image/png", svg: "image/svg+xml", webp: "image/webp" }; function tn(e) { if (!e.type) { var t = Zi(e.src); t && (e.type = t) } return e } var nn = function (l) { function e(e, t, i) { var n, r = Ne({ createEl: !1 }, t); if (n = l.call(this, e, r, i) || this, t.playerOptions.sources && 0 !== t.playerOptions.sources.length) e.src(t.playerOptions.sources); else for (var a = 0, s = t.playerOptions.techOrder; a < s.length; a++) { var o = De(s[a]), u = Vi.getTech(o); if (o || (u = Re.getComponent(o)), u && u.isSupported()) { e.loadTech_(o); break } } return n } return He(e, l), e }(Re); Re.registerComponent("MediaLoader", nn); var rn = function (r) { function e(e, t) { var i; return (i = r.call(this, e, t) || this).emitTapEvents(), i.enable(), i } He(e, r); var t = e.prototype; return t.createEl = function (e, t, i) { void 0 === e && (e = "div"), void 0 === t && (t = {}), void 0 === i && (i = {}), t = m({ innerHTML: '', className: this.buildCSSClass(), tabIndex: 0 }, t), "button" === e && p.error("Creating a ClickableComponent with an HTML element of " + e + " is not supported; use a Button instead."), i = m({ role: "button" }, i), this.tabIndex_ = t.tabIndex; var n = r.prototype.createEl.call(this, e, t, i); return this.createControlTextEl(n), n }, t.dispose = function () { this.controlTextEl_ = null, r.prototype.dispose.call(this) }, t.createControlTextEl = function (e) { return this.controlTextEl_ = S("span", { className: "vjs-control-text" }, { "aria-live": "polite" }), e && e.appendChild(this.controlTextEl_), this.controlText(this.controlText_, e), this.controlTextEl_ }, t.controlText = function (e, t) { if (void 0 === t && (t = this.el()), void 0 === e) return this.controlText_ || "Need Text"; var i = this.localize(e); this.controlText_ = e, k(this.controlTextEl_, i), this.nonIconControl || t.setAttribute("title", i) }, t.buildCSSClass = function () { return "vjs-control vjs-button " + r.prototype.buildCSSClass.call(this) }, t.enable = function () { this.enabled_ || (this.enabled_ = !0, this.removeClass("vjs-disabled"), this.el_.setAttribute("aria-disabled", "false"), "undefined" != typeof this.tabIndex_ && this.el_.setAttribute("tabIndex", this.tabIndex_), this.on(["tap", "click"], this.handleClick), this.on("keydown", this.handleKeyDown)) }, t.disable = function () { this.enabled_ = !1, this.addClass("vjs-disabled"), this.el_.setAttribute("aria-disabled", "true"), "undefined" != typeof this.tabIndex_ && this.el_.removeAttribute("tabIndex"), this.off("mouseover", this.handleMouseOver), this.off("mouseout", this.handleMouseOut), this.off(["tap", "click"], this.handleClick), this.off("keydown", this.handleKeyDown) }, t.handleClick = function (e) { this.options_.clickHandler && this.options_.clickHandler.call(this, arguments) }, t.handleKeyDown = function (e) { At.isEventKey(e, "Space") || At.isEventKey(e, "Enter") ? (e.preventDefault(), e.stopPropagation(), this.trigger("click")) : r.prototype.handleKeyDown.call(this, e) }, e }(Re); Re.registerComponent("ClickableComponent", rn); var an = function (n) { function e(e, t) { var i; return (i = n.call(this, e, t) || this).update(), e.on("posterchange", ge(Ue(i), i.update)), i } He(e, n); var t = e.prototype; return t.dispose = function () { this.player().off("posterchange", this.update), n.prototype.dispose.call(this) }, t.createEl = function () { return S("div", { className: "vjs-poster", tabIndex: -1 }) }, t.update = function (e) { var t = this.player().poster(); this.setSrc(t), t ? this.show() : this.hide() }, t.setSrc = function (e) { var t = ""; e && (t = 'url("' + e + '")'), this.el_.style.backgroundImage = t }, t.handleClick = function (e) { if (this.player_.controls()) { var t = this.player_.usingPlugin("eme") && this.player_.eme.sessions && 0 < this.player_.eme.sessions.length; !this.player_.tech(!0) || (et || Qe) && t || this.player_.tech(!0).focus(), this.player_.paused() ? kt(this.player_.play()) : this.player_.pause() } }, e }(rn); Re.registerComponent("PosterImage", an); var sn = "#222", on = { monospace: "monospace", sansSerif: "sans-serif", serif: "serif", monospaceSansSerif: '"Andale Mono", "Lucida Console", monospace', monospaceSerif: '"Courier New", monospace', proportionalSansSerif: "sans-serif", proportionalSerif: "serif", casual: '"Comic Sans MS", Impact, fantasy', script: '"Monotype Corsiva", cursive', smallcaps: '"Andale Mono", "Lucida Console", monospace, sans-serif' }; function un(e, t) { var i; if (4 === e.length) i = e[1] + e[1] + e[2] + e[2] + e[3] + e[3]; else { if (7 !== e.length) throw new Error("Invalid color code provided, " + e + "; must be formatted as e.g. #f0e or #f604e2."); i = e.slice(1) } return "rgba(" + parseInt(i.slice(0, 2), 16) + "," + parseInt(i.slice(2, 4), 16) + "," + parseInt(i.slice(4, 6), 16) + "," + t + ")" } function ln(e, t, i) { try { e.style[t] = i } catch (e) { return } } var cn = function (a) { function e(i, e, t) { var n; n = a.call(this, i, e, t) || this; var r = ge(Ue(n), n.updateDisplay); return i.on("loadstart", ge(Ue(n), n.toggleDisplay)), i.on("texttrackchange", r), i.on("loadedmetadata", ge(Ue(n), n.preselectTrack)), i.ready(ge(Ue(n), function () { if (i.tech_ && i.tech_.featuresNativeTextTracks) this.hide(); else { i.on("fullscreenchange", r), i.on("playerresize", r), y.addEventListener("orientationchange", r), i.on("dispose", function () { return y.removeEventListener("orientationchange", r) }); for (var e = this.options_.playerOptions.tracks || [], t = 0; t < e.length; t++)this.player_.addRemoteTextTrack(e[t], !0); this.preselectTrack() } })), n } He(e, a); var t = e.prototype; return t.preselectTrack = function () { for (var e, t, i, n = { captions: 1, subtitles: 1 }, r = this.player_.textTracks(), a = this.player_.cache_.selectedLanguage, s = 0; s < r.length; s++) { var o = r[s]; a && a.enabled && a.language && a.language === o.language && o.kind in n ? i = o.kind === a.kind ? o : i || o : a && !a.enabled ? t = e = i = null : o.default && ("descriptions" !== o.kind || e ? o.kind in n && !t && (t = o) : e = o) } i ? i.mode = "showing" : t ? t.mode = "showing" : e && (e.mode = "showing") }, t.toggleDisplay = function () { this.player_.tech_ && this.player_.tech_.featuresNativeTextTracks ? this.hide() : this.show() }, t.createEl = function () { return a.prototype.createEl.call(this, "div", { className: "vjs-text-track-display" }, { "aria-live": "off", "aria-atomic": "true" }) }, t.clearDisplay = function () { "function" == typeof y.WebVTT && y.WebVTT.processCues(y, [], this.el_) }, t.updateDisplay = function () { var e = this.player_.textTracks(), t = this.options_.allowMultipleShowingTracks; if (this.clearDisplay(), t) { for (var i = [], n = 0; n < e.length; ++n) { var r = e[n]; "showing" === r.mode && i.push(r) } this.updateForTrack(i) } else { for (var a = null, s = null, o = e.length; o--;) { var u = e[o]; "showing" === u.mode && ("descriptions" === u.kind ? a = u : s = u) } s ? ("off" !== this.getAttribute("aria-live") && this.setAttribute("aria-live", "off"), this.updateForTrack(s)) : a && ("assertive" !== this.getAttribute("aria-live") && this.setAttribute("aria-live", "assertive"), this.updateForTrack(a)) } }, t.updateDisplayState = function (e) { for (var t = this.player_.textTrackSettings.getValues(), i = e.activeCues, n = i.length; n--;) { var r = i[n]; if (r) { var a = r.displayState; if (t.color && (a.firstChild.style.color = t.color), t.textOpacity && ln(a.firstChild, "color", un(t.color || "#fff", t.textOpacity)), t.backgroundColor && (a.firstChild.style.backgroundColor = t.backgroundColor), t.backgroundOpacity && ln(a.firstChild, "backgroundColor", un(t.backgroundColor || "#000", t.backgroundOpacity)), t.windowColor && (t.windowOpacity ? ln(a, "backgroundColor", un(t.windowColor, t.windowOpacity)) : a.style.backgroundColor = t.windowColor), t.edgeStyle && ("dropshadow" === t.edgeStyle ? a.firstChild.style.textShadow = "2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px " + sn : "raised" === t.edgeStyle ? a.firstChild.style.textShadow = "1px 1px #222, 2px 2px #222, 3px 3px " + sn : "depressed" === t.edgeStyle ? a.firstChild.style.textShadow = "1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px " + sn : "uniform" === t.edgeStyle && (a.firstChild.style.textShadow = "0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px " + sn)), t.fontPercent && 1 !== t.fontPercent) { var s = y.parseFloat(a.style.fontSize); a.style.fontSize = s * t.fontPercent + "px", a.style.height = "auto", a.style.top = "auto", a.style.bottom = "2px" } t.fontFamily && "default" !== t.fontFamily && ("small-caps" === t.fontFamily ? a.firstChild.style.fontVariant = "small-caps" : a.firstChild.style.fontFamily = on[t.fontFamily]) } } }, t.updateForTrack = function (e) { if (Array.isArray(e) || (e = [e]), "function" == typeof y.WebVTT && !e.every(function (e) { return !e.activeCues })) { for (var t = [], i = 0; i < e.length; ++i)for (var n = e[i], r = 0; r < n.activeCues.length; ++r)t.push(n.activeCues[r]); y.WebVTT.processCues(y, t, this.el_); for (var a = 0; a < e.length; ++a) { for (var s = e[a], o = 0; o < s.activeCues.length; ++o) { var u = s.activeCues[o].displayState; w(u, "vjs-text-track-cue"), w(u, "vjs-text-track-cue-" + (s.language ? s.language : a)) } this.player_.textTrackSettings && this.updateDisplayState(s) } } }, e }(Re); Re.registerComponent("TextTrackDisplay", cn); var hn = function (r) { function e() { return r.apply(this, arguments) || this } return He(e, r), e.prototype.createEl = function () { var e = this.player_.isAudio(), t = this.localize(e ? "Audio Player" : "Video Player"), i = S("span", { className: "vjs-control-text", innerHTML: this.localize("{1} is loading.", [t]) }), n = r.prototype.createEl.call(this, "div", { className: "vjs-loading-spinner", dir: "ltr" }); return n.appendChild(i), n }, e }(Re); Re.registerComponent("LoadingSpinner", hn); var dn = function (t) { function e() { return t.apply(this, arguments) || this } He(e, t); var i = e.prototype; return i.createEl = function (e, t, i) { void 0 === t && (t = {}), void 0 === i && (i = {}), t = m({ innerHTML: '', className: this.buildCSSClass() }, t), i = m({ type: "button" }, i); var n = Re.prototype.createEl.call(this, "button", t, i); return this.createControlTextEl(n), n }, i.addChild = function (e, t) { void 0 === t && (t = {}); var i = this.constructor.name; return p.warn("Adding an actionable (user controllable) child to a Button (" + i + ") is not supported; use a ClickableComponent instead."), Re.prototype.addChild.call(this, e, t) }, i.enable = function () { t.prototype.enable.call(this), this.el_.removeAttribute("disabled") }, i.disable = function () { t.prototype.disable.call(this), this.el_.setAttribute("disabled", "disabled") }, i.handleKeyDown = function (e) { At.isEventKey(e, "Space") || At.isEventKey(e, "Enter") ? e.stopPropagation() : t.prototype.handleKeyDown.call(this, e) }, e }(rn); Re.registerComponent("Button", dn); var pn = function (n) { function e(e, t) { var i; return (i = n.call(this, e, t) || this).mouseused_ = !1, i.on("mousedown", i.handleMouseDown), i } He(e, n); var t = e.prototype; return t.buildCSSClass = function () { return "vjs-big-play-button" }, t.handleClick = function (e) { var t = this.player_.play(); if (this.mouseused_ && e.clientX && e.clientY) { var i = this.player_.usingPlugin("eme") && this.player_.eme.sessions && 0 < this.player_.eme.sessions.length; return kt(t), void (!this.player_.tech(!0) || (et || Qe) && i || this.player_.tech(!0).focus()) } var n = this.player_.getChild("controlBar"), r = n && n.getChild("playToggle"); if (r) { var a = function () { return r.focus() }; St(t) ? t.then(a, function () { }) : this.setTimeout(a, 1) } else this.player_.tech(!0).focus() }, t.handleKeyDown = function (e) { this.mouseused_ = !1, n.prototype.handleKeyDown.call(this, e) }, t.handleMouseDown = function (e) { this.mouseused_ = !0 }, e }(dn); pn.prototype.controlText_ = "Play Video", Re.registerComponent("BigPlayButton", pn); var fn = function (n) { function e(e, t) { var i; return (i = n.call(this, e, t) || this).controlText(t && t.controlText || i.localize("Close")), i } He(e, n); var t = e.prototype; return t.buildCSSClass = function () { return "vjs-close-button " + n.prototype.buildCSSClass.call(this) }, t.handleClick = function (e) { this.trigger({ type: "close", bubbles: !1 }) }, t.handleKeyDown = function (e) { At.isEventKey(e, "Esc") ? (e.preventDefault(), e.stopPropagation(), this.trigger("click")) : n.prototype.handleKeyDown.call(this, e) }, e }(dn); Re.registerComponent("CloseButton", fn); var mn = function (n) { function e(e, t) { var i; return void 0 === t && (t = {}), i = n.call(this, e, t) || this, t.replay = void 0 === t.replay || t.replay, i.on(e, "play", i.handlePlay), i.on(e, "pause", i.handlePause), t.replay && i.on(e, "ended", i.handleEnded), i } He(e, n); var t = e.prototype; return t.buildCSSClass = function () { return "vjs-play-control " + n.prototype.buildCSSClass.call(this) }, t.handleClick = function (e) { this.player_.paused() ? this.player_.play() : this.player_.pause() }, t.handleSeeked = function (e) { this.removeClass("vjs-ended"), this.player_.paused() ? this.handlePause(e) : this.handlePlay(e) }, t.handlePlay = function (e) { this.removeClass("vjs-ended"), this.removeClass("vjs-paused"), this.addClass("vjs-playing"), this.controlText("Pause") }, t.handlePause = function (e) { this.removeClass("vjs-playing"), this.addClass("vjs-paused"), this.controlText("Play") }, t.handleEnded = function (e) { this.removeClass("vjs-playing"), this.addClass("vjs-ended"), this.controlText("Replay"), this.one(this.player_, "seeked", this.handleSeeked) }, e }(dn); mn.prototype.controlText_ = "Play", Re.registerComponent("PlayToggle", mn); function gn(e, t) { e = e < 0 ? 0 : e; var i = Math.floor(e % 60), n = Math.floor(e / 60 % 60), r = Math.floor(e / 3600), a = Math.floor(t / 60 % 60), s = Math.floor(t / 3600); return !isNaN(e) && e !== 1 / 0 || (r = n = i = "-"), (r = 0 < r || 0 < s ? r + ":" : "") + (n = ((r || 10 <= a) && n < 10 ? "0" + n : n) + ":") + (i = i < 10 ? "0" + i : i) } var vn = gn; function yn(e, t) { return void 0 === t && (t = e), vn(e, t) } var _n = function (n) { function e(e, t) { var i; return (i = n.call(this, e, t) || this).on(e, ["timeupdate", "ended"], i.updateContent), i.updateTextNode_(), i } He(e, n); var t = e.prototype; return t.createEl = function () { var e = this.buildCSSClass(), t = n.prototype.createEl.call(this, "div", { className: e + " vjs-time-control vjs-control", innerHTML: '' + this.localize(this.labelText_) + " " }); return this.contentEl_ = S("span", { className: e + "-display" }, { "aria-live": "off", role: "presentation" }), t.appendChild(this.contentEl_), t }, t.dispose = function () { this.contentEl_ = null, this.textNode_ = null, n.prototype.dispose.call(this) }, t.updateTextNode_ = function (e) { var t = this; void 0 === e && (e = 0), e = yn(e), this.formattedTime_ !== e && (this.formattedTime_ = e, this.requestAnimationFrame(function () { if (t.contentEl_) { var e = t.textNode_; t.textNode_ = h.createTextNode(t.formattedTime_), t.textNode_ && (e ? t.contentEl_.replaceChild(t.textNode_, e) : t.contentEl_.appendChild(t.textNode_)) } })) }, t.updateContent = function (e) { }, e }(Re); _n.prototype.labelText_ = "Time", _n.prototype.controlText_ = "Time", Re.registerComponent("TimeDisplay", _n); var bn = function (e) { function t() { return e.apply(this, arguments) || this } He(t, e); var i = t.prototype; return i.buildCSSClass = function () { return "vjs-current-time" }, i.updateContent = function (e) { var t; t = this.player_.ended() ? this.player_.duration() : this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime(), this.updateTextNode_(t) }, t }(_n); bn.prototype.labelText_ = "Current Time", bn.prototype.controlText_ = "Current Time", Re.registerComponent("CurrentTimeDisplay", bn); var Tn = function (n) { function e(e, t) { var i; return (i = n.call(this, e, t) || this).on(e, "durationchange", i.updateContent), i.on(e, "loadstart", i.updateContent), i.on(e, "loadedmetadata", i.updateContent), i } He(e, n); var t = e.prototype; return t.buildCSSClass = function () { return "vjs-duration" }, t.updateContent = function (e) { var t = this.player_.duration(); this.updateTextNode_(t) }, e }(_n); Tn.prototype.labelText_ = "Duration", Tn.prototype.controlText_ = "Duration", Re.registerComponent("DurationDisplay", Tn); var Sn = function (e) { function t() { return e.apply(this, arguments) || this } return He(t, e), t.prototype.createEl = function () { return e.prototype.createEl.call(this, "div", { className: "vjs-time-control vjs-time-divider", innerHTML: "
    /
    " }, { "aria-hidden": !0 }) }, t }(Re); Re.registerComponent("TimeDivider", Sn); var kn = function (n) { function e(e, t) { var i; return (i = n.call(this, e, t) || this).on(e, "durationchange", i.updateContent), i } He(e, n); var t = e.prototype; return t.buildCSSClass = function () { return "vjs-remaining-time" }, t.createEl = function () { var e = n.prototype.createEl.call(this); return e.insertBefore(S("span", {}, { "aria-hidden": !0 }, "-"), this.contentEl_), e }, t.updateContent = function (e) { var t; "number" == typeof this.player_.duration() && (t = this.player_.ended() ? 0 : this.player_.remainingTimeDisplay ? this.player_.remainingTimeDisplay() : this.player_.remainingTime(), this.updateTextNode_(t)) }, e }(_n); kn.prototype.labelText_ = "Remaining Time", kn.prototype.controlText_ = "Remaining Time", Re.registerComponent("RemainingTimeDisplay", kn); var Cn = function (n) { function e(e, t) { var i; return (i = n.call(this, e, t) || this).updateShowing(), i.on(i.player(), "durationchange", i.updateShowing), i } He(e, n); var t = e.prototype; return t.createEl = function () { var e = n.prototype.createEl.call(this, "div", { className: "vjs-live-control vjs-control" }); return this.contentEl_ = S("div", { className: "vjs-live-display", innerHTML: '' + this.localize("Stream Type") + " " + this.localize("LIVE") }, { "aria-live": "off" }), e.appendChild(this.contentEl_), e }, t.dispose = function () { this.contentEl_ = null, n.prototype.dispose.call(this) }, t.updateShowing = function (e) { this.player().duration() === 1 / 0 ? this.show() : this.hide() }, e }(Re); Re.registerComponent("LiveDisplay", Cn); var En = function (n) { function e(e, t) { var i; return (i = n.call(this, e, t) || this).updateLiveEdgeStatus(), i.player_.liveTracker && i.on(i.player_.liveTracker, "liveedgechange", i.updateLiveEdgeStatus), i } He(e, n); var t = e.prototype; return t.createEl = function () { var e = n.prototype.createEl.call(this, "button", { className: "vjs-seek-to-live-control vjs-control" }); return this.textEl_ = S("span", { className: "vjs-seek-to-live-text", innerHTML: this.localize("LIVE") }, { "aria-hidden": "true" }), e.appendChild(this.textEl_), e }, t.updateLiveEdgeStatus = function (e) { !this.player_.liveTracker || this.player_.liveTracker.atLiveEdge() ? (this.setAttribute("aria-disabled", !0), this.addClass("vjs-at-live-edge"), this.controlText("Seek to live, currently playing live")) : (this.setAttribute("aria-disabled", !1), this.removeClass("vjs-at-live-edge"), this.controlText("Seek to live, currently behind live")) }, t.handleClick = function () { this.player_.liveTracker.seekToLiveEdge() }, t.dispose = function () { this.player_.liveTracker && this.off(this.player_.liveTracker, "liveedgechange", this.updateLiveEdgeStatus), this.textEl_ = null, n.prototype.dispose.call(this) }, e }(dn); En.prototype.controlText_ = "Seek to live, currently playing live", Re.registerComponent("SeekToLive", En); function wn(e, t, i) { return e = Number(e), Math.min(i, Math.max(t, isNaN(e) ? t : e)) } var An = function (n) { function e(e, t) { var i; return (i = n.call(this, e, t) || this).bar = i.getChild(i.options_.barName), i.vertical(!!i.options_.vertical), i.enable(), i } He(e, n); var t = e.prototype; return t.enabled = function () { return this.enabled_ }, t.enable = function () { this.enabled() || (this.on("mousedown", this.handleMouseDown), this.on("touchstart", this.handleMouseDown), this.on("keydown", this.handleKeyDown), this.on("click", this.handleClick), this.on(this.player_, "controlsvisible", this.update), this.playerEvent && this.on(this.player_, this.playerEvent, this.update), this.removeClass("disabled"), this.setAttribute("tabindex", 0), this.enabled_ = !0) }, t.disable = function () { if (this.enabled()) { var e = this.bar.el_.ownerDocument; this.off("mousedown", this.handleMouseDown), this.off("touchstart", this.handleMouseDown), this.off("keydown", this.handleKeyDown), this.off("click", this.handleClick), this.off(this.player_, "controlsvisible", this.update), this.off(e, "mousemove", this.handleMouseMove), this.off(e, "mouseup", this.handleMouseUp), this.off(e, "touchmove", this.handleMouseMove), this.off(e, "touchend", this.handleMouseUp), this.removeAttribute("tabindex"), this.addClass("disabled"), this.playerEvent && this.off(this.player_, this.playerEvent, this.update), this.enabled_ = !1 } }, t.createEl = function (e, t, i) { return void 0 === t && (t = {}), void 0 === i && (i = {}), t.className = t.className + " vjs-slider", t = m({ tabIndex: 0 }, t), i = m({ role: "slider", "aria-valuenow": 0, "aria-valuemin": 0, "aria-valuemax": 100, tabIndex: 0 }, i), n.prototype.createEl.call(this, e, t, i) }, t.handleMouseDown = function (e) { var t = this.bar.el_.ownerDocument; "mousedown" === e.type && e.preventDefault(), "touchstart" !== e.type || Je || e.preventDefault(), N(), this.addClass("vjs-sliding"), this.trigger("slideractive"), this.on(t, "mousemove", this.handleMouseMove), this.on(t, "mouseup", this.handleMouseUp), this.on(t, "touchmove", this.handleMouseMove), this.on(t, "touchend", this.handleMouseUp), this.handleMouseMove(e) }, t.handleMouseMove = function (e) { }, t.handleMouseUp = function () { var e = this.bar.el_.ownerDocument; R(), this.removeClass("vjs-sliding"), this.trigger("sliderinactive"), this.off(e, "mousemove", this.handleMouseMove), this.off(e, "mouseup", this.handleMouseUp), this.off(e, "touchmove", this.handleMouseMove), this.off(e, "touchend", this.handleMouseUp), this.update() }, t.update = function () { var t = this; if (this.el_ && this.bar) { var i = this.getProgress(); return i === this.progress_ || (this.progress_ = i, this.requestAnimationFrame(function () { var e = t.vertical() ? "height" : "width"; t.bar.el().style[e] = (100 * i).toFixed(2) + "%" })), i } }, t.getProgress = function () { return Number(wn(this.getPercent(), 0, 1).toFixed(4)) }, t.calculateDistance = function (e) { var t = B(this.el_, e); return this.vertical() ? t.y : t.x }, t.handleKeyDown = function (e) { At.isEventKey(e, "Left") || At.isEventKey(e, "Down") ? (e.preventDefault(), e.stopPropagation(), this.stepBack()) : At.isEventKey(e, "Right") || At.isEventKey(e, "Up") ? (e.preventDefault(), e.stopPropagation(), this.stepForward()) : n.prototype.handleKeyDown.call(this, e) }, t.handleClick = function (e) { e.stopPropagation(), e.preventDefault() }, t.vertical = function (e) { if (void 0 === e) return this.vertical_ || !1; this.vertical_ = !!e, this.vertical_ ? this.addClass("vjs-slider-vertical") : this.addClass("vjs-slider-horizontal") }, e }(Re); Re.registerComponent("Slider", An); function In(e, t) { return wn(e / t * 100, 0, 100).toFixed(2) + "%" } var xn = function (r) { function e(e, t) { var i; return (i = r.call(this, e, t) || this).partEls_ = [], i.on(e, "progress", i.update), i } He(e, r); var t = e.prototype; return t.createEl = function () { var e = r.prototype.createEl.call(this, "div", { className: "vjs-load-progress" }), t = S("span", { className: "vjs-control-text" }), i = S("span", { textContent: this.localize("Loaded") }), n = h.createTextNode(": "); return this.percentageEl_ = S("span", { className: "vjs-control-text-loaded-percentage", textContent: "0%" }), e.appendChild(t), t.appendChild(i), t.appendChild(n), t.appendChild(this.percentageEl_), e }, t.dispose = function () { this.partEls_ = null, this.percentageEl_ = null, r.prototype.dispose.call(this) }, t.update = function (e) { var h = this; this.requestAnimationFrame(function () { var e = h.player_.liveTracker, t = h.player_.buffered(), i = e && e.isLive() ? e.seekableEnd() : h.player_.duration(), n = h.player_.bufferedEnd(), r = h.partEls_, a = In(n, i); h.percent_ !== a && (h.el_.style.width = a, k(h.percentageEl_, a), h.percent_ = a); for (var s = 0; s < t.length; s++) { var o = t.start(s), u = t.end(s), l = r[s]; l || (l = h.el_.appendChild(S()), r[s] = l), l.dataset.start === o && l.dataset.end === u || (l.dataset.start = o, l.dataset.end = u, l.style.left = In(o, n), l.style.width = In(u - o, n)) } for (var c = r.length; c > t.length; c--)h.el_.removeChild(r[c - 1]); r.length = t.length }) }, e }(Re); Re.registerComponent("LoadProgressBar", xn); var Pn = function (n) { function e(e, t) { var i; return (i = n.call(this, e, t) || this).update = ve(ge(Ue(i), i.update), 30), i } He(e, n); var t = e.prototype; return t.createEl = function () { return n.prototype.createEl.call(this, "div", { className: "vjs-time-tooltip" }, { "aria-hidden": "true" }) }, t.update = function (e, t, i) { var n = U(this.el_), r = U(this.player_.el()), a = e.width * t; if (r && n) { var s = e.left - r.left + a, o = e.width - a + (r.right - e.right), u = n.width / 2; s < u ? u += u - s : o < u && (u = o), u < 0 ? u = 0 : u > n.width && (u = n.width), this.el_.style.right = "-" + u + "px", this.write(i) } }, t.write = function (e) { k(this.el_, e) }, t.updateTime = function (r, a, s, o) { var u = this; this.rafId_ && this.cancelAnimationFrame(this.rafId_), this.rafId_ = this.requestAnimationFrame(function () { var e, t = u.player_.duration(); if (u.player_.liveTracker && u.player_.liveTracker.isLive()) { var i = u.player_.liveTracker.liveWindow(), n = i - a * i; e = (n < 1 ? "" : "-") + yn(n, i) } else e = yn(s, t); u.update(r, a, e), o && o() }) }, e }(Re); Re.registerComponent("TimeTooltip", Pn); var Ln = function (n) { function e(e, t) { var i; return (i = n.call(this, e, t) || this).update = ve(ge(Ue(i), i.update), 30), i } He(e, n); var t = e.prototype; return t.createEl = function () { return n.prototype.createEl.call(this, "div", { className: "vjs-play-progress vjs-slider-bar" }, { "aria-hidden": "true" }) }, t.update = function (e, t) { var i = this.getChild("timeTooltip"); if (i) { var n = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime(); i.updateTime(e, t, n) } }, e }(Re); Ln.prototype.options_ = { children: [] }, st || Xe || Ln.prototype.options_.children.push("timeTooltip"), Re.registerComponent("PlayProgressBar", Ln); var On = function (n) { function e(e, t) { var i; return (i = n.call(this, e, t) || this).update = ve(ge(Ue(i), i.update), 30), i } He(e, n); var t = e.prototype; return t.createEl = function () { return n.prototype.createEl.call(this, "div", { className: "vjs-mouse-display" }) }, t.update = function (e, t) { var i = this, n = t * this.player_.duration(); this.getChild("timeTooltip").updateTime(e, t, n, function () { i.el_.style.left = e.width * t + "px" }) }, e }(Re); On.prototype.options_ = { children: ["timeTooltip"] }, Re.registerComponent("MouseTimeDisplay", On); var Dn = function (a) { function e(e, t) { var i; return (i = a.call(this, e, t) || this).setEventHandlers_(), i } He(e, a); var t = e.prototype; return t.setEventHandlers_ = function () { this.update_ = ge(this, this.update), this.update = ve(this.update_, 30), this.on(this.player_, ["ended", "durationchange", "timeupdate"], this.update), this.player_.liveTracker && this.on(this.player_.liveTracker, "liveedgechange", this.update), this.updateInterval = null, this.on(this.player_, ["playing"], this.enableInterval_), this.on(this.player_, ["ended", "pause", "waiting"], this.disableInterval_), "hidden" in h && "visibilityState" in h && this.on(h, "visibilitychange", this.toggleVisibility_) }, t.toggleVisibility_ = function (e) { h.hidden ? this.disableInterval_(e) : (this.enableInterval_(), this.update()) }, t.enableInterval_ = function () { this.updateInterval || (this.updateInterval = this.setInterval(this.update, 30)) }, t.disableInterval_ = function (e) { this.player_.liveTracker && this.player_.liveTracker.isLive() && "ended" !== e.type || this.updateInterval && (this.clearInterval(this.updateInterval), this.updateInterval = null) }, t.createEl = function () { return a.prototype.createEl.call(this, "div", { className: "vjs-progress-holder" }, { "aria-label": this.localize("Progress Bar") }) }, t.update = function (e) { var n = this, r = a.prototype.update.call(this); return this.requestAnimationFrame(function () { var e = n.player_.ended() ? n.player_.duration() : n.getCurrentTime_(), t = n.player_.liveTracker, i = n.player_.duration(); t && t.isLive() && (i = n.player_.liveTracker.liveCurrentTime()), n.percent_ !== r && (n.el_.setAttribute("aria-valuenow", (100 * r).toFixed(2)), n.percent_ = r), n.currentTime_ === e && n.duration_ === i || (n.el_.setAttribute("aria-valuetext", n.localize("progress bar timing: currentTime={1} duration={2}", [yn(e, i), yn(i, i)], "{1} of {2}")), n.currentTime_ = e, n.duration_ = i), n.bar && n.bar.update(U(n.el()), n.getProgress()) }), r }, t.getCurrentTime_ = function () { return this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime() }, t.getPercent = function () { var e, t = this.getCurrentTime_(), i = this.player_.liveTracker; return i && i.isLive() ? (e = (t - i.seekableStart()) / i.liveWindow(), i.atLiveEdge() && (e = 1)) : e = t / this.player_.duration(), e }, t.handleMouseDown = function (e) { W(e) && (e.stopPropagation(), this.player_.scrubbing(!0), this.videoWasPlaying = !this.player_.paused(), this.player_.pause(), a.prototype.handleMouseDown.call(this, e)) }, t.handleMouseMove = function (e) { if (W(e)) { var t, i = this.calculateDistance(e), n = this.player_.liveTracker; if (n && n.isLive()) { var r = n.seekableStart(), a = n.liveCurrentTime(); if (a <= (t = r + i * n.liveWindow()) && (t = a), t <= r && (t = r + .1), t === 1 / 0) return } else (t = i * this.player_.duration()) === this.player_.duration() && (t -= .1); this.player_.currentTime(t) } }, t.enable = function () { a.prototype.enable.call(this); var e = this.getChild("mouseTimeDisplay"); e && e.show() }, t.disable = function () { a.prototype.disable.call(this); var e = this.getChild("mouseTimeDisplay"); e && e.hide() }, t.handleMouseUp = function (e) { a.prototype.handleMouseUp.call(this, e), e && e.stopPropagation(), this.player_.scrubbing(!1), this.player_.trigger({ type: "timeupdate", target: this, manuallyTriggered: !0 }), this.videoWasPlaying ? kt(this.player_.play()) : this.update_() }, t.stepForward = function () { this.player_.currentTime(this.player_.currentTime() + 5) }, t.stepBack = function () { this.player_.currentTime(this.player_.currentTime() - 5) }, t.handleAction = function (e) { this.player_.paused() ? this.player_.play() : this.player_.pause() }, t.handleKeyDown = function (e) { if (At.isEventKey(e, "Space") || At.isEventKey(e, "Enter")) e.preventDefault(), e.stopPropagation(), this.handleAction(e); else if (At.isEventKey(e, "Home")) e.preventDefault(), e.stopPropagation(), this.player_.currentTime(0); else if (At.isEventKey(e, "End")) e.preventDefault(), e.stopPropagation(), this.player_.currentTime(this.player_.duration()); else if (/^[0-9]$/.test(At(e))) { e.preventDefault(), e.stopPropagation(); var t = 10 * (At.codes[At(e)] - At.codes[0]) / 100; this.player_.currentTime(this.player_.duration() * t) } else At.isEventKey(e, "PgDn") ? (e.preventDefault(), e.stopPropagation(), this.player_.currentTime(this.player_.currentTime() - 60)) : At.isEventKey(e, "PgUp") ? (e.preventDefault(), e.stopPropagation(), this.player_.currentTime(this.player_.currentTime() + 60)) : a.prototype.handleKeyDown.call(this, e) }, e }(An); Dn.prototype.options_ = { children: ["loadProgressBar", "playProgressBar"], barName: "playProgressBar" }, st || Xe || Dn.prototype.options_.children.splice(1, 0, "mouseTimeDisplay"), Re.registerComponent("SeekBar", Dn); var Nn = function (n) { function e(e, t) { var i; return (i = n.call(this, e, t) || this).handleMouseMove = ve(ge(Ue(i), i.handleMouseMove), 30), i.throttledHandleMouseSeek = ve(ge(Ue(i), i.handleMouseSeek), 30), i.enable(), i } He(e, n); var t = e.prototype; return t.createEl = function () { return n.prototype.createEl.call(this, "div", { className: "vjs-progress-control vjs-control" }) }, t.handleMouseMove = function (e) { var t = this.getChild("seekBar"); if (t) { var i = t.getChild("playProgressBar"), n = t.getChild("mouseTimeDisplay"); if (i || n) { var r = t.el(), a = U(r), s = B(r, e).x; s = wn(0, 1, s), n && n.update(a, s), i && i.update(a, t.getProgress()) } } }, t.handleMouseSeek = function (e) { var t = this.getChild("seekBar"); t && t.handleMouseMove(e) }, t.enabled = function () { return this.enabled_ }, t.disable = function () { this.children().forEach(function (e) { return e.disable && e.disable() }), this.enabled() && (this.off(["mousedown", "touchstart"], this.handleMouseDown), this.off(this.el_, "mousemove", this.handleMouseMove), this.handleMouseUp(), this.addClass("disabled"), this.enabled_ = !1) }, t.enable = function () { this.children().forEach(function (e) { return e.enable && e.enable() }), this.enabled() || (this.on(["mousedown", "touchstart"], this.handleMouseDown), this.on(this.el_, "mousemove", this.handleMouseMove), this.removeClass("disabled"), this.enabled_ = !0) }, t.handleMouseDown = function (e) { var t = this.el_.ownerDocument, i = this.getChild("seekBar"); i && i.handleMouseDown(e), this.on(t, "mousemove", this.throttledHandleMouseSeek), this.on(t, "touchmove", this.throttledHandleMouseSeek), this.on(t, "mouseup", this.handleMouseUp), this.on(t, "touchend", this.handleMouseUp) }, t.handleMouseUp = function (e) { var t = this.el_.ownerDocument, i = this.getChild("seekBar"); i && i.handleMouseUp(e), this.off(t, "mousemove", this.throttledHandleMouseSeek), this.off(t, "touchmove", this.throttledHandleMouseSeek), this.off(t, "mouseup", this.handleMouseUp), this.off(t, "touchend", this.handleMouseUp) }, e }(Re); Nn.prototype.options_ = { children: ["seekBar"] }, Re.registerComponent("ProgressControl", Nn); var Rn = function (n) { function e(e, t) { var i; return (i = n.call(this, e, t) || this).on(e, ["enterpictureinpicture", "leavepictureinpicture"], i.handlePictureInPictureChange), h.pictureInPictureEnabled || i.disable(), i } He(e, n); var t = e.prototype; return t.buildCSSClass = function () { return "vjs-picture-in-picture-control " + n.prototype.buildCSSClass.call(this) }, t.handlePictureInPictureChange = function (e) { this.player_.isInPictureInPicture() ? this.controlText("Exit Picture-in-Picture") : this.controlText("Picture-in-Picture") }, t.handleClick = function (e) { this.player_.isInPictureInPicture() ? this.player_.exitPictureInPicture() : this.player_.requestPictureInPicture() }, e }(dn); Rn.prototype.controlText_ = "Picture-in-Picture", Re.registerComponent("PictureInPictureToggle", Rn); var Un = function (n) { function e(e, t) { var i; return (i = n.call(this, e, t) || this).on(e, "fullscreenchange", i.handleFullscreenChange), !1 === h[e.fsApi_.fullscreenEnabled] && i.disable(), i } He(e, n); var t = e.prototype; return t.buildCSSClass = function () { return "vjs-fullscreen-control " + n.prototype.buildCSSClass.call(this) }, t.handleFullscreenChange = function (e) { this.player_.isFullscreen() ? this.controlText("Non-Fullscreen") : this.controlText("Fullscreen") }, t.handleClick = function (e) { this.player_.isFullscreen() ? this.player_.exitFullscreen() : this.player_.requestFullscreen() }, e }(dn); Un.prototype.controlText_ = "Fullscreen", Re.registerComponent("FullscreenToggle", Un); var Mn = function (e) { function t() { return e.apply(this, arguments) || this } return He(t, e), t.prototype.createEl = function () { return e.prototype.createEl.call(this, "div", { className: "vjs-volume-level", innerHTML: '' }) }, t }(Re); Re.registerComponent("VolumeLevel", Mn); var Bn = function (n) { function e(e, t) { var i; return (i = n.call(this, e, t) || this).on("slideractive", i.updateLastVolume_), i.on(e, "volumechange", i.updateARIAAttributes), e.ready(function () { return i.updateARIAAttributes() }), i } He(e, n); var t = e.prototype; return t.createEl = function () { return n.prototype.createEl.call(this, "div", { className: "vjs-volume-bar vjs-slider-bar" }, { "aria-label": this.localize("Volume Level"), "aria-live": "polite" }) }, t.handleMouseDown = function (e) { W(e) && n.prototype.handleMouseDown.call(this, e) }, t.handleMouseMove = function (e) { W(e) && (this.checkMuted(), this.player_.volume(this.calculateDistance(e))) }, t.checkMuted = function () { this.player_.muted() && this.player_.muted(!1) }, t.getPercent = function () { return this.player_.muted() ? 0 : this.player_.volume() }, t.stepForward = function () { this.checkMuted(), this.player_.volume(this.player_.volume() + .1) }, t.stepBack = function () { this.checkMuted(), this.player_.volume(this.player_.volume() - .1) }, t.updateARIAAttributes = function (e) { var t = this.player_.muted() ? 0 : this.volumeAsPercentage_(); this.el_.setAttribute("aria-valuenow", t), this.el_.setAttribute("aria-valuetext", t + "%") }, t.volumeAsPercentage_ = function () { return Math.round(100 * this.player_.volume()) }, t.updateLastVolume_ = function () { var e = this, t = this.player_.volume(); this.one("sliderinactive", function () { 0 === e.player_.volume() && e.player_.lastVolume_(t) }) }, e }(An); Bn.prototype.options_ = { children: ["volumeLevel"], barName: "volumeLevel" }, Bn.prototype.playerEvent = "volumechange", Re.registerComponent("VolumeBar", Bn); var jn = function (n) { function e(e, t) { var i; return void 0 === t && (t = {}), t.vertical = t.vertical || !1, "undefined" != typeof t.volumeBar && !u(t.volumeBar) || (t.volumeBar = t.volumeBar || {}, t.volumeBar.vertical = t.vertical), i = n.call(this, e, t) || this, function (e, t) { t.tech_ && !t.tech_.featuresVolumeControl && e.addClass("vjs-hidden"), e.on(t, "loadstart", function () { t.tech_.featuresVolumeControl ? e.removeClass("vjs-hidden") : e.addClass("vjs-hidden") }) }(Ue(i), e), i.throttledHandleMouseMove = ve(ge(Ue(i), i.handleMouseMove), 30), i.on("mousedown", i.handleMouseDown), i.on("touchstart", i.handleMouseDown), i.on(i.volumeBar, ["focus", "slideractive"], function () { i.volumeBar.addClass("vjs-slider-active"), i.addClass("vjs-slider-active"), i.trigger("slideractive") }), i.on(i.volumeBar, ["blur", "sliderinactive"], function () { i.volumeBar.removeClass("vjs-slider-active"), i.removeClass("vjs-slider-active"), i.trigger("sliderinactive") }), i } He(e, n); var t = e.prototype; return t.createEl = function () { var e = "vjs-volume-horizontal"; return this.options_.vertical && (e = "vjs-volume-vertical"), n.prototype.createEl.call(this, "div", { className: "vjs-volume-control vjs-control " + e }) }, t.handleMouseDown = function (e) { var t = this.el_.ownerDocument; this.on(t, "mousemove", this.throttledHandleMouseMove), this.on(t, "touchmove", this.throttledHandleMouseMove), this.on(t, "mouseup", this.handleMouseUp), this.on(t, "touchend", this.handleMouseUp) }, t.handleMouseUp = function (e) { var t = this.el_.ownerDocument; this.off(t, "mousemove", this.throttledHandleMouseMove), this.off(t, "touchmove", this.throttledHandleMouseMove), this.off(t, "mouseup", this.handleMouseUp), this.off(t, "touchend", this.handleMouseUp) }, t.handleMouseMove = function (e) { this.volumeBar.handleMouseMove(e) }, e }(Re); jn.prototype.options_ = { children: ["volumeBar"] }, Re.registerComponent("VolumeControl", jn); var Fn = function (n) { function e(e, t) { var i; return i = n.call(this, e, t) || this, function (e, t) { t.tech_ && !t.tech_.featuresMuteControl && e.addClass("vjs-hidden"), e.on(t, "loadstart", function () { t.tech_.featuresMuteControl ? e.removeClass("vjs-hidden") : e.addClass("vjs-hidden") }) }(Ue(i), e), i.on(e, ["loadstart", "volumechange"], i.update), i } He(e, n); var t = e.prototype; return t.buildCSSClass = function () { return "vjs-mute-control " + n.prototype.buildCSSClass.call(this) }, t.handleClick = function (e) { var t = this.player_.volume(), i = this.player_.lastVolume_(); if (0 === t) { var n = i < .1 ? .1 : i; this.player_.volume(n), this.player_.muted(!1) } else this.player_.muted(!this.player_.muted()) }, t.update = function (e) { this.updateIcon_(), this.updateControlText_() }, t.updateIcon_ = function () { var e = this.player_.volume(), t = 3; st && this.player_.tech_ && this.player_.tech_.el_ && this.player_.muted(this.player_.tech_.el_.muted), 0 === e || this.player_.muted() ? t = 0 : e < .33 ? t = 1 : e < .67 && (t = 2); for (var i = 0; i < 4; i++)A(this.el_, "vjs-vol-" + i); w(this.el_, "vjs-vol-" + t) }, t.updateControlText_ = function () { var e = this.player_.muted() || 0 === this.player_.volume() ? "Unmute" : "Mute"; this.controlText() !== e && this.controlText(e) }, e }(dn); Fn.prototype.controlText_ = "Mute", Re.registerComponent("MuteToggle", Fn); var Hn = function (n) { function e(e, t) { var i; return void 0 === t && (t = {}), "undefined" != typeof t.inline ? t.inline = t.inline : t.inline = !0, "undefined" != typeof t.volumeControl && !u(t.volumeControl) || (t.volumeControl = t.volumeControl || {}, t.volumeControl.vertical = !t.inline), (i = n.call(this, e, t) || this).on(e, ["loadstart"], i.volumePanelState_), i.on(i.muteToggle, "keyup", i.handleKeyPress), i.on(i.volumeControl, "keyup", i.handleVolumeControlKeyUp), i.on("keydown", i.handleKeyPress), i.on("mouseover", i.handleMouseOver), i.on("mouseout", i.handleMouseOut), i.on(i.volumeControl, ["slideractive"], i.sliderActive_), i.on(i.volumeControl, ["sliderinactive"], i.sliderInactive_), i } He(e, n); var t = e.prototype; return t.sliderActive_ = function () { this.addClass("vjs-slider-active") }, t.sliderInactive_ = function () { this.removeClass("vjs-slider-active") }, t.volumePanelState_ = function () { this.volumeControl.hasClass("vjs-hidden") && this.muteToggle.hasClass("vjs-hidden") && this.addClass("vjs-hidden"), this.volumeControl.hasClass("vjs-hidden") && !this.muteToggle.hasClass("vjs-hidden") && this.addClass("vjs-mute-toggle-only") }, t.createEl = function () { var e = "vjs-volume-panel-horizontal"; return this.options_.inline || (e = "vjs-volume-panel-vertical"), n.prototype.createEl.call(this, "div", { className: "vjs-volume-panel vjs-control " + e }) }, t.dispose = function () { this.handleMouseOut(), n.prototype.dispose.call(this) }, t.handleVolumeControlKeyUp = function (e) { At.isEventKey(e, "Esc") && this.muteToggle.focus() }, t.handleMouseOver = function (e) { this.addClass("vjs-hover"), he(h, "keyup", ge(this, this.handleKeyPress)) }, t.handleMouseOut = function (e) { this.removeClass("vjs-hover"), de(h, "keyup", ge(this, this.handleKeyPress)) }, t.handleKeyPress = function (e) { At.isEventKey(e, "Esc") && this.handleMouseOut() }, e }(Re); Hn.prototype.options_ = { children: ["muteToggle", "volumeControl"] }, Re.registerComponent("VolumePanel", Hn); var Vn = function (n) { function e(e, t) { var i; return i = n.call(this, e, t) || this, t && (i.menuButton_ = t.menuButton), i.focusedChild_ = -1, i.on("keydown", i.handleKeyDown), i.boundHandleBlur_ = ge(Ue(i), i.handleBlur), i.boundHandleTapClick_ = ge(Ue(i), i.handleTapClick), i } He(e, n); var t = e.prototype; return t.addEventListenerForItem = function (e) { e instanceof Re && (this.on(e, "blur", this.boundHandleBlur_), this.on(e, ["tap", "click"], this.boundHandleTapClick_)) }, t.removeEventListenerForItem = function (e) { e instanceof Re && (this.off(e, "blur", this.boundHandleBlur_), this.off(e, ["tap", "click"], this.boundHandleTapClick_)) }, t.removeChild = function (e) { "string" == typeof e && (e = this.getChild(e)), this.removeEventListenerForItem(e), n.prototype.removeChild.call(this, e) }, t.addItem = function (e) { var t = this.addChild(e); t && this.addEventListenerForItem(t) }, t.createEl = function () { var e = this.options_.contentElType || "ul"; this.contentEl_ = S(e, { className: "vjs-menu-content" }), this.contentEl_.setAttribute("role", "menu"); var t = n.prototype.createEl.call(this, "div", { append: this.contentEl_, className: "vjs-menu" }); return t.appendChild(this.contentEl_), he(t, "click", function (e) { e.preventDefault(), e.stopImmediatePropagation() }), t }, t.dispose = function () { this.contentEl_ = null, this.boundHandleBlur_ = null, this.boundHandleTapClick_ = null, n.prototype.dispose.call(this) }, t.handleBlur = function (e) { var t = e.relatedTarget || h.activeElement; if (!this.children().some(function (e) { return e.el() === t })) { var i = this.menuButton_; i && i.buttonPressed_ && t !== i.el().firstChild && i.unpressButton() } }, t.handleTapClick = function (t) { if (this.menuButton_) { this.menuButton_.unpressButton(); var e = this.children(); if (!Array.isArray(e)) return; var i = e.filter(function (e) { return e.el() === t.target })[0]; if (!i) return; "CaptionSettingsMenuItem" !== i.name() && this.menuButton_.focus() } }, t.handleKeyDown = function (e) { At.isEventKey(e, "Left") || At.isEventKey(e, "Down") ? (e.preventDefault(), e.stopPropagation(), this.stepForward()) : (At.isEventKey(e, "Right") || At.isEventKey(e, "Up")) && (e.preventDefault(), e.stopPropagation(), this.stepBack()) }, t.stepForward = function () { var e = 0; void 0 !== this.focusedChild_ && (e = this.focusedChild_ + 1), this.focus(e) }, t.stepBack = function () { var e = 0; void 0 !== this.focusedChild_ && (e = this.focusedChild_ - 1), this.focus(e) }, t.focus = function (e) { void 0 === e && (e = 0); var t = this.children().slice(); t.length && t[0].className && /vjs-menu-title/.test(t[0].className) && t.shift(), 0 < t.length && (e < 0 ? e = 0 : e >= t.length && (e = t.length - 1), t[this.focusedChild_ = e].el_.focus()) }, e }(Re); Re.registerComponent("Menu", Vn); var qn = function (r) { function e(e, t) { var i; void 0 === t && (t = {}), (i = r.call(this, e, t) || this).menuButton_ = new dn(e, t), i.menuButton_.controlText(i.controlText_), i.menuButton_.el_.setAttribute("aria-haspopup", "true"); var n = dn.prototype.buildCSSClass(); return i.menuButton_.el_.className = i.buildCSSClass() + " " + n, i.menuButton_.removeClass("vjs-control"), i.addChild(i.menuButton_), i.update(), i.enabled_ = !0, i.on(i.menuButton_, "tap", i.handleClick), i.on(i.menuButton_, "click", i.handleClick), i.on(i.menuButton_, "keydown", i.handleKeyDown), i.on(i.menuButton_, "mouseenter", function () { i.addClass("vjs-hover"), i.menu.show(), he(h, "keyup", ge(Ue(i), i.handleMenuKeyUp)) }), i.on("mouseleave", i.handleMouseLeave), i.on("keydown", i.handleSubmenuKeyDown), i } He(e, r); var t = e.prototype; return t.update = function () { var e = this.createMenu(); this.menu && (this.menu.dispose(), this.removeChild(this.menu)), this.menu = e, this.addChild(e), this.buttonPressed_ = !1, this.menuButton_.el_.setAttribute("aria-expanded", "false"), this.items && this.items.length <= this.hideThreshold_ ? this.hide() : this.show() }, t.createMenu = function () { var e = new Vn(this.player_, { menuButton: this }); if (this.hideThreshold_ = 0, this.options_.title) { var t = S("li", { className: "vjs-menu-title", innerHTML: De(this.options_.title), tabIndex: -1 }); this.hideThreshold_ += 1; var i = new Re(this.player_, { el: t }); e.addItem(i) } if (this.items = this.createItems(), this.items) for (var n = 0; n < this.items.length; n++)e.addItem(this.items[n]); return e }, t.createItems = function () { }, t.createEl = function () { return r.prototype.createEl.call(this, "div", { className: this.buildWrapperCSSClass() }, {}) }, t.buildWrapperCSSClass = function () { var e = "vjs-menu-button"; return !0 === this.options_.inline ? e += "-inline" : e += "-popup", "vjs-menu-button " + e + " " + dn.prototype.buildCSSClass() + " " + r.prototype.buildCSSClass.call(this) }, t.buildCSSClass = function () { var e = "vjs-menu-button"; return !0 === this.options_.inline ? e += "-inline" : e += "-popup", "vjs-menu-button " + e + " " + r.prototype.buildCSSClass.call(this) }, t.controlText = function (e, t) { return void 0 === t && (t = this.menuButton_.el()), this.menuButton_.controlText(e, t) }, t.dispose = function () { this.handleMouseLeave(), r.prototype.dispose.call(this) }, t.handleClick = function (e) { this.buttonPressed_ ? this.unpressButton() : this.pressButton() }, t.handleMouseLeave = function (e) { this.removeClass("vjs-hover"), de(h, "keyup", ge(this, this.handleMenuKeyUp)) }, t.focus = function () { this.menuButton_.focus() }, t.blur = function () { this.menuButton_.blur() }, t.handleKeyDown = function (e) { At.isEventKey(e, "Esc") || At.isEventKey(e, "Tab") ? (this.buttonPressed_ && this.unpressButton(), At.isEventKey(e, "Tab") || (e.preventDefault(), this.menuButton_.focus())) : (At.isEventKey(e, "Up") || At.isEventKey(e, "Down")) && (this.buttonPressed_ || (e.preventDefault(), this.pressButton())) }, t.handleMenuKeyUp = function (e) { (At.isEventKey(e, "Esc") || At.isEventKey(e, "Tab")) && this.removeClass("vjs-hover") }, t.handleSubmenuKeyPress = function (e) { this.handleSubmenuKeyDown(e) }, t.handleSubmenuKeyDown = function (e) { (At.isEventKey(e, "Esc") || At.isEventKey(e, "Tab")) && (this.buttonPressed_ && this.unpressButton(), At.isEventKey(e, "Tab") || (e.preventDefault(), this.menuButton_.focus())) }, t.pressButton = function () { if (this.enabled_) { if (this.buttonPressed_ = !0, this.menu.show(), this.menu.lockShowing(), this.menuButton_.el_.setAttribute("aria-expanded", "true"), st && b()) return; this.menu.focus() } }, t.unpressButton = function () { this.enabled_ && (this.buttonPressed_ = !1, this.menu.unlockShowing(), this.menu.hide(), this.menuButton_.el_.setAttribute("aria-expanded", "false")) }, t.disable = function () { this.unpressButton(), this.enabled_ = !1, this.addClass("vjs-disabled"), this.menuButton_.disable() }, t.enable = function () { this.enabled_ = !0, this.removeClass("vjs-disabled"), this.menuButton_.enable() }, e }(Re); Re.registerComponent("MenuButton", qn); var Wn = function (a) { function e(e, t) { var i, n = t.tracks; if ((i = a.call(this, e, t) || this).items.length <= 1 && i.hide(), !n) return Ue(i); var r = ge(Ue(i), i.update); return n.addEventListener("removetrack", r), n.addEventListener("addtrack", r), i.player_.on("ready", r), i.player_.on("dispose", function () { n.removeEventListener("removetrack", r), n.removeEventListener("addtrack", r) }), i } return He(e, a), e }(qn); Re.registerComponent("TrackButton", Wn); var zn = ["Tab", "Esc", "Up", "Down", "Right", "Left"], Gn = function (n) { function e(e, t) { var i; return (i = n.call(this, e, t) || this).selectable = t.selectable, i.isSelected_ = t.selected || !1, i.multiSelectable = t.multiSelectable, i.selected(i.isSelected_), i.selectable ? i.multiSelectable ? i.el_.setAttribute("role", "menuitemcheckbox") : i.el_.setAttribute("role", "menuitemradio") : i.el_.setAttribute("role", "menuitem"), i } He(e, n); var t = e.prototype; return t.createEl = function (e, t, i) { return this.nonIconControl = !0, n.prototype.createEl.call(this, "li", m({ className: "vjs-menu-item", innerHTML: '' + this.localize(this.options_.label) + "", tabIndex: -1 }, t), i) }, t.handleKeyDown = function (t) { zn.some(function (e) { return At.isEventKey(t, e) }) || n.prototype.handleKeyDown.call(this, t) }, t.handleClick = function (e) { this.selected(!0) }, t.selected = function (e) { this.selectable && (e ? (this.addClass("vjs-selected"), this.el_.setAttribute("aria-checked", "true"), this.controlText(", selected"), this.isSelected_ = !0) : (this.removeClass("vjs-selected"), this.el_.setAttribute("aria-checked", "false"), this.controlText(""), this.isSelected_ = !1)) }, e }(rn); Re.registerComponent("MenuItem", Gn); var Xn = function (u) { function e(e, t) { var n, i = t.track, r = e.textTracks(); t.label = i.label || i.language || "Unknown", t.selected = "showing" === i.mode, (n = u.call(this, e, t) || this).track = i, n.kinds = (t.kinds || [t.kind || n.track.kind]).filter(Boolean); function a() { for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++)t[i] = arguments[i]; n.handleTracksChange.apply(Ue(n), t) } function s() { for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++)t[i] = arguments[i]; n.handleSelectedLanguageChange.apply(Ue(n), t) } var o; e.on(["loadstart", "texttrackchange"], a), r.addEventListener("change", a), r.addEventListener("selectedlanguagechange", s), n.on("dispose", function () { e.off(["loadstart", "texttrackchange"], a), r.removeEventListener("change", a), r.removeEventListener("selectedlanguagechange", s) }), void 0 === r.onchange && n.on(["tap", "click"], function () { if ("object" != typeof y.Event) try { o = new y.Event("change") } catch (e) { } o || (o = h.createEvent("Event")).initEvent("change", !0, !0), r.dispatchEvent(o) }); return n.handleTracksChange(), n } He(e, u); var t = e.prototype; return t.handleClick = function (e) { var t = this.track, i = this.player_.textTracks(); if (u.prototype.handleClick.call(this, e), i) for (var n = 0; n < i.length; n++) { var r = i[n]; -1 !== this.kinds.indexOf(r.kind) && (r === t ? "showing" !== r.mode && (r.mode = "showing") : "disabled" !== r.mode && (r.mode = "disabled")) } }, t.handleTracksChange = function (e) { var t = "showing" === this.track.mode; t !== this.isSelected_ && this.selected(t) }, t.handleSelectedLanguageChange = function (e) { if ("showing" === this.track.mode) { var t = this.player_.cache_.selectedLanguage; if (t && t.enabled && t.language === this.track.language && t.kind !== this.track.kind) return; this.player_.cache_.selectedLanguage = { enabled: !0, language: this.track.language, kind: this.track.kind } } }, t.dispose = function () { this.track = null, u.prototype.dispose.call(this) }, e }(Gn); Re.registerComponent("TextTrackMenuItem", Xn); var Kn = function (i) { function e(e, t) { return t.track = { player: e, kind: t.kind, kinds: t.kinds, default: !1, mode: "disabled" }, t.kinds || (t.kinds = [t.kind]), t.label ? t.track.label = t.label : t.track.label = t.kinds.join(" and ") + " off", t.selectable = !0, t.multiSelectable = !1, i.call(this, e, t) || this } He(e, i); var t = e.prototype; return t.handleTracksChange = function (e) { for (var t = this.player().textTracks(), i = !0, n = 0, r = t.length; n < r; n++) { var a = t[n]; if (-1 < this.options_.kinds.indexOf(a.kind) && "showing" === a.mode) { i = !1; break } } i !== this.isSelected_ && this.selected(i) }, t.handleSelectedLanguageChange = function (e) { for (var t = this.player().textTracks(), i = !0, n = 0, r = t.length; n < r; n++) { var a = t[n]; if (-1 < ["captions", "descriptions", "subtitles"].indexOf(a.kind) && "showing" === a.mode) { i = !1; break } } i && (this.player_.cache_.selectedLanguage = { enabled: !1 }) }, e }(Xn); Re.registerComponent("OffTextTrackMenuItem", Kn); var Yn = function (i) { function e(e, t) { return void 0 === t && (t = {}), t.tracks = e.textTracks(), i.call(this, e, t) || this } return He(e, i), e.prototype.createItems = function (e, t) { var i; void 0 === e && (e = []), void 0 === t && (t = Xn), this.label_ && (i = this.label_ + " off"), e.push(new Kn(this.player_, { kinds: this.kinds_, kind: this.kind_, label: i })), this.hideThreshold_ += 1; var n = this.player_.textTracks(); Array.isArray(this.kinds_) || (this.kinds_ = [this.kind_]); for (var r = 0; r < n.length; r++) { var a = n[r]; if (-1 < this.kinds_.indexOf(a.kind)) { var s = new t(this.player_, { track: a, kinds: this.kinds_, kind: this.kind_, selectable: !0, multiSelectable: !1 }); s.addClass("vjs-" + a.kind + "-menu-item"), e.push(s) } } return e }, e }(Wn); Re.registerComponent("TextTrackButton", Yn); var $n = function (s) { function e(e, t) { var i, n = t.track, r = t.cue, a = e.currentTime(); return t.selectable = !0, t.multiSelectable = !1, t.label = r.text, t.selected = r.startTime <= a && a < r.endTime, (i = s.call(this, e, t) || this).track = n, i.cue = r, n.addEventListener("cuechange", ge(Ue(i), i.update)), i } He(e, s); var t = e.prototype; return t.handleClick = function (e) { s.prototype.handleClick.call(this), this.player_.currentTime(this.cue.startTime), this.update(this.cue.startTime) }, t.update = function (e) { var t = this.cue, i = this.player_.currentTime(); this.selected(t.startTime <= i && i < t.endTime) }, e }(Gn); Re.registerComponent("ChaptersTrackMenuItem", $n); var Qn = function (n) { function e(e, t, i) { return n.call(this, e, t, i) || this } He(e, n); var t = e.prototype; return t.buildCSSClass = function () { return "vjs-chapters-button " + n.prototype.buildCSSClass.call(this) }, t.buildWrapperCSSClass = function () { return "vjs-chapters-button " + n.prototype.buildWrapperCSSClass.call(this) }, t.update = function (e) { this.track_ && (!e || "addtrack" !== e.type && "removetrack" !== e.type) || this.setTrack(this.findChaptersTrack()), n.prototype.update.call(this) }, t.setTrack = function (e) { if (this.track_ !== e) { if (this.updateHandler_ || (this.updateHandler_ = this.update.bind(this)), this.track_) { var t = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_); t && t.removeEventListener("load", this.updateHandler_), this.track_ = null } if (this.track_ = e, this.track_) { this.track_.mode = "hidden"; var i = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_); i && i.addEventListener("load", this.updateHandler_) } } }, t.findChaptersTrack = function () { for (var e = this.player_.textTracks() || [], t = e.length - 1; 0 <= t; t--) { var i = e[t]; if (i.kind === this.kind_) return i } }, t.getMenuCaption = function () { return this.track_ && this.track_.label ? this.track_.label : this.localize(De(this.kind_)) }, t.createMenu = function () { return this.options_.title = this.getMenuCaption(), n.prototype.createMenu.call(this) }, t.createItems = function () { var e = []; if (!this.track_) return e; var t = this.track_.cues; if (!t) return e; for (var i = 0, n = t.length; i < n; i++) { var r = t[i], a = new $n(this.player_, { track: this.track_, cue: r }); e.push(a) } return e }, e }(Yn); Qn.prototype.kind_ = "chapters", Qn.prototype.controlText_ = "Chapters", Re.registerComponent("ChaptersButton", Qn); var Jn = function (s) { function e(e, t, i) { var n; n = s.call(this, e, t, i) || this; var r = e.textTracks(), a = ge(Ue(n), n.handleTracksChange); return r.addEventListener("change", a), n.on("dispose", function () { r.removeEventListener("change", a) }), n } He(e, s); var t = e.prototype; return t.handleTracksChange = function (e) { for (var t = this.player().textTracks(), i = !1, n = 0, r = t.length; n < r; n++) { var a = t[n]; if (a.kind !== this.kind_ && "showing" === a.mode) { i = !0; break } } i ? this.disable() : this.enable() }, t.buildCSSClass = function () { return "vjs-descriptions-button " + s.prototype.buildCSSClass.call(this) }, t.buildWrapperCSSClass = function () { return "vjs-descriptions-button " + s.prototype.buildWrapperCSSClass.call(this) }, e }(Yn); Jn.prototype.kind_ = "descriptions", Jn.prototype.controlText_ = "Descriptions", Re.registerComponent("DescriptionsButton", Jn); var Zn = function (n) { function e(e, t, i) { return n.call(this, e, t, i) || this } He(e, n); var t = e.prototype; return t.buildCSSClass = function () { return "vjs-subtitles-button " + n.prototype.buildCSSClass.call(this) }, t.buildWrapperCSSClass = function () { return "vjs-subtitles-button " + n.prototype.buildWrapperCSSClass.call(this) }, e }(Yn); Zn.prototype.kind_ = "subtitles", Zn.prototype.controlText_ = "Subtitles", Re.registerComponent("SubtitlesButton", Zn); var er = function (n) { function e(e, t) { var i; return t.track = { player: e, kind: t.kind, label: t.kind + " settings", selectable: !1, default: !1, mode: "disabled" }, t.selectable = !1, t.name = "CaptionSettingsMenuItem", (i = n.call(this, e, t) || this).addClass("vjs-texttrack-settings"), i.controlText(", opens " + t.kind + " settings dialog"), i } return He(e, n), e.prototype.handleClick = function (e) { this.player().getChild("textTrackSettings").open() }, e }(Xn); Re.registerComponent("CaptionSettingsMenuItem", er); var tr = function (n) { function e(e, t, i) { return n.call(this, e, t, i) || this } He(e, n); var t = e.prototype; return t.buildCSSClass = function () { return "vjs-captions-button " + n.prototype.buildCSSClass.call(this) }, t.buildWrapperCSSClass = function () { return "vjs-captions-button " + n.prototype.buildWrapperCSSClass.call(this) }, t.createItems = function () { var e = []; return this.player().tech_ && this.player().tech_.featuresNativeTextTracks || !this.player().getChild("textTrackSettings") || (e.push(new er(this.player_, { kind: this.kind_ })), this.hideThreshold_ += 1), n.prototype.createItems.call(this, e) }, e }(Yn); tr.prototype.kind_ = "captions", tr.prototype.controlText_ = "Captions", Re.registerComponent("CaptionsButton", tr); var ir = function (r) { function e() { return r.apply(this, arguments) || this } return He(e, r), e.prototype.createEl = function (e, t, i) { var n = '' + this.localize(this.options_.label); return "captions" === this.options_.track.kind && (n += '\n \n ' + this.localize("Captions") + "\n "), n += "", r.prototype.createEl.call(this, e, m({ innerHTML: n }, t), i) }, e }(Xn); Re.registerComponent("SubsCapsMenuItem", ir); var nr = function (n) { function e(e, t) { var i; return void 0 === t && (t = {}), (i = n.call(this, e, t) || this).label_ = "subtitles", -1 < ["en", "en-us", "en-ca", "fr-ca"].indexOf(i.player_.language_) && (i.label_ = "captions"), i.menuButton_.controlText(De(i.label_)), i } He(e, n); var t = e.prototype; return t.buildCSSClass = function () { return "vjs-subs-caps-button " + n.prototype.buildCSSClass.call(this) }, t.buildWrapperCSSClass = function () { return "vjs-subs-caps-button " + n.prototype.buildWrapperCSSClass.call(this) }, t.createItems = function () { var e = []; return this.player().tech_ && this.player().tech_.featuresNativeTextTracks || !this.player().getChild("textTrackSettings") || (e.push(new er(this.player_, { kind: this.label_ })), this.hideThreshold_ += 1), e = n.prototype.createItems.call(this, e, ir) }, e }(Yn); nr.prototype.kinds_ = ["captions", "subtitles"], nr.prototype.controlText_ = "Subtitles", Re.registerComponent("SubsCapsButton", nr); var rr = function (s) { function e(e, t) { var n, i = t.track, r = e.audioTracks(); t.label = i.label || i.language || "Unknown", t.selected = i.enabled, (n = s.call(this, e, t) || this).track = i, n.addClass("vjs-" + i.kind + "-menu-item"); function a() { for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++)t[i] = arguments[i]; n.handleTracksChange.apply(Ue(n), t) } return r.addEventListener("change", a), n.on("dispose", function () { r.removeEventListener("change", a) }), n } He(e, s); var t = e.prototype; return t.createEl = function (e, t, i) { var n = '' + this.localize(this.options_.label); return "main-desc" === this.options_.track.kind && (n += '\n \n ' + this.localize("Descriptions") + "\n "), n += "", s.prototype.createEl.call(this, e, m({ innerHTML: n }, t), i) }, t.handleClick = function (e) { var t = this.player_.audioTracks(); s.prototype.handleClick.call(this, e); for (var i = 0; i < t.length; i++) { var n = t[i]; n.enabled = n === this.track } }, t.handleTracksChange = function (e) { this.selected(this.track.enabled) }, e }(Gn); Re.registerComponent("AudioTrackMenuItem", rr); var ar = function (i) { function e(e, t) { return void 0 === t && (t = {}), t.tracks = e.audioTracks(), i.call(this, e, t) || this } He(e, i); var t = e.prototype; return t.buildCSSClass = function () { return "vjs-audio-button " + i.prototype.buildCSSClass.call(this) }, t.buildWrapperCSSClass = function () { return "vjs-audio-button " + i.prototype.buildWrapperCSSClass.call(this) }, t.createItems = function (e) { void 0 === e && (e = []), this.hideThreshold_ = 1; for (var t = this.player_.audioTracks(), i = 0; i < t.length; i++) { var n = t[i]; e.push(new rr(this.player_, { track: n, selectable: !0, multiSelectable: !1 })) } return e }, e }(Wn); ar.prototype.controlText_ = "Audio Track", Re.registerComponent("AudioTrackButton", ar); var sr = function (a) { function e(e, t) { var i, n = t.rate, r = parseFloat(n, 10); return t.label = n, t.selected = 1 === r, t.selectable = !0, t.multiSelectable = !1, (i = a.call(this, e, t) || this).label = n, i.rate = r, i.on(e, "ratechange", i.update), i } He(e, a); var t = e.prototype; return t.handleClick = function (e) { a.prototype.handleClick.call(this), this.player().playbackRate(this.rate) }, t.update = function (e) { this.selected(this.player().playbackRate() === this.rate) }, e }(Gn); sr.prototype.contentElType = "button", Re.registerComponent("PlaybackRateMenuItem", sr); var or = function (n) { function e(e, t) { var i; return (i = n.call(this, e, t) || this).updateVisibility(), i.updateLabel(), i.on(e, "loadstart", i.updateVisibility), i.on(e, "ratechange", i.updateLabel), i } He(e, n); var t = e.prototype; return t.createEl = function () { var e = n.prototype.createEl.call(this); return this.labelEl_ = S("div", { className: "vjs-playback-rate-value", innerHTML: "1x" }), e.appendChild(this.labelEl_), e }, t.dispose = function () { this.labelEl_ = null, n.prototype.dispose.call(this) }, t.buildCSSClass = function () { return "vjs-playback-rate " + n.prototype.buildCSSClass.call(this) }, t.buildWrapperCSSClass = function () { return "vjs-playback-rate " + n.prototype.buildWrapperCSSClass.call(this) }, t.createMenu = function () { var e = new Vn(this.player()), t = this.playbackRates(); if (t) for (var i = t.length - 1; 0 <= i; i--)e.addChild(new sr(this.player(), { rate: t[i] + "x" })); return e }, t.updateARIAAttributes = function () { this.el().setAttribute("aria-valuenow", this.player().playbackRate()) }, t.handleClick = function (e) { for (var t = this.player().playbackRate(), i = this.playbackRates(), n = i[0], r = 0; r < i.length; r++)if (i[r] > t) { n = i[r]; break } this.player().playbackRate(n) }, t.playbackRates = function () { return this.options_.playbackRates || this.options_.playerOptions && this.options_.playerOptions.playbackRates }, t.playbackRateSupported = function () { return this.player().tech_ && this.player().tech_.featuresPlaybackRate && this.playbackRates() && 0 < this.playbackRates().length }, t.updateVisibility = function (e) { this.playbackRateSupported() ? this.removeClass("vjs-hidden") : this.addClass("vjs-hidden") }, t.updateLabel = function (e) { this.playbackRateSupported() && (this.labelEl_.innerHTML = this.player().playbackRate() + "x") }, e }(qn); or.prototype.controlText_ = "Playback Rate", Re.registerComponent("PlaybackRateMenuButton", or); var ur = function (e) { function t() { return e.apply(this, arguments) || this } He(t, e); var i = t.prototype; return i.buildCSSClass = function () { return "vjs-spacer " + e.prototype.buildCSSClass.call(this) }, i.createEl = function () { return e.prototype.createEl.call(this, "div", { className: this.buildCSSClass() }) }, t }(Re); Re.registerComponent("Spacer", ur); var lr = function (t) { function e() { return t.apply(this, arguments) || this } He(e, t); var i = e.prototype; return i.buildCSSClass = function () { return "vjs-custom-control-spacer " + t.prototype.buildCSSClass.call(this) }, i.createEl = function () { var e = t.prototype.createEl.call(this, { className: this.buildCSSClass() }); return e.innerHTML = " ", e }, e }(ur); Re.registerComponent("CustomControlSpacer", lr); var cr = function (e) { function t() { return e.apply(this, arguments) || this } return He(t, e), t.prototype.createEl = function () { return e.prototype.createEl.call(this, "div", { className: "vjs-control-bar", dir: "ltr" }) }, t }(Re); cr.prototype.options_ = { children: ["playToggle", "volumePanel", "currentTimeDisplay", "timeDivider", "durationDisplay", "progressControl", "liveDisplay", "seekToLive", "remainingTimeDisplay", "customControlSpacer", "playbackRateMenuButton", "chaptersButton", "descriptionsButton", "subsCapsButton", "audioTrackButton", "fullscreenToggle"] }, "exitPictureInPicture" in h && cr.prototype.options_.children.splice(cr.prototype.options_.children.length - 1, 0, "pictureInPictureToggle"), Re.registerComponent("ControlBar", cr); var hr = function (n) { function e(e, t) { var i; return (i = n.call(this, e, t) || this).on(e, "error", i.open), i } He(e, n); var t = e.prototype; return t.buildCSSClass = function () { return "vjs-error-display " + n.prototype.buildCSSClass.call(this) }, t.content = function () { var e = this.player().error(); return e ? this.localize(e.message) : "" }, e }(xt); hr.prototype.options_ = r({}, xt.prototype.options_, { pauseOnOpen: !1, fillAlways: !0, temporary: !1, uncloseable: !0 }), Re.registerComponent("ErrorDisplay", hr); var dr = "vjs-text-track-settings", pr = ["#000", "Black"], fr = ["#00F", "Blue"], mr = ["#0FF", "Cyan"], gr = ["#0F0", "Green"], vr = ["#F0F", "Magenta"], yr = ["#F00", "Red"], _r = ["#FFF", "White"], br = ["#FF0", "Yellow"], Tr = ["1", "Opaque"], Sr = ["0.5", "Semi-Transparent"], kr = ["0", "Transparent"], Cr = { backgroundColor: { selector: ".vjs-bg-color > select", id: "captions-background-color-%s", label: "Color", options: [pr, _r, yr, gr, fr, br, vr, mr] }, backgroundOpacity: { selector: ".vjs-bg-opacity > select", id: "captions-background-opacity-%s", label: "Transparency", options: [Tr, Sr, kr] }, color: { selector: ".vjs-fg-color > select", id: "captions-foreground-color-%s", label: "Color", options: [_r, pr, yr, gr, fr, br, vr, mr] }, edgeStyle: { selector: ".vjs-edge-style > select", id: "%s", label: "Text Edge Style", options: [["none", "None"], ["raised", "Raised"], ["depressed", "Depressed"], ["uniform", "Uniform"], ["dropshadow", "Dropshadow"]] }, fontFamily: { selector: ".vjs-font-family > select", id: "captions-font-family-%s", label: "Font Family", options: [["proportionalSansSerif", "Proportional Sans-Serif"], ["monospaceSansSerif", "Monospace Sans-Serif"], ["proportionalSerif", "Proportional Serif"], ["monospaceSerif", "Monospace Serif"], ["casual", "Casual"], ["script", "Script"], ["small-caps", "Small Caps"]] }, fontPercent: { selector: ".vjs-font-percent > select", id: "captions-font-size-%s", label: "Font Size", options: [["0.50", "50%"], ["0.75", "75%"], ["1.00", "100%"], ["1.25", "125%"], ["1.50", "150%"], ["1.75", "175%"], ["2.00", "200%"], ["3.00", "300%"], ["4.00", "400%"]], default: 2, parser: function (e) { return "1.00" === e ? null : Number(e) } }, textOpacity: { selector: ".vjs-text-opacity > select", id: "captions-foreground-opacity-%s", label: "Transparency", options: [Tr, Sr] }, windowColor: { selector: ".vjs-window-color > select", id: "captions-window-color-%s", label: "Color" }, windowOpacity: { selector: ".vjs-window-opacity > select", id: "captions-window-opacity-%s", label: "Transparency", options: [kr, Sr, Tr] } }; function Er(e, t) { if (t && (e = t(e)), e && "none" !== e) return e } Cr.windowColor.options = Cr.backgroundColor.options; var wr = function (n) { function e(e, t) { var i; return t.temporary = !1, (i = n.call(this, e, t) || this).updateDisplay = ge(Ue(i), i.updateDisplay), i.fill(), i.hasBeenOpened_ = i.hasBeenFilled_ = !0, i.endDialog = S("p", { className: "vjs-control-text", textContent: i.localize("End of dialog window.") }), i.el().appendChild(i.endDialog), i.setDefaults(), void 0 === t.persistTextTrackSettings && (i.options_.persistTextTrackSettings = i.options_.playerOptions.persistTextTrackSettings), i.on(i.$(".vjs-done-button"), "click", function () { i.saveSettings(), i.close() }), i.on(i.$(".vjs-default-button"), "click", function () { i.setDefaults(), i.updateDisplay() }), s(Cr, function (e) { i.on(i.$(e.selector), "change", i.updateDisplay) }), i.options_.persistTextTrackSettings && i.restoreSettings(), i } He(e, n); var t = e.prototype; return t.dispose = function () { this.endDialog = null, n.prototype.dispose.call(this) }, t.createElSelect_ = function (e, t, i) { var n = this; void 0 === t && (t = ""), void 0 === i && (i = "label"); var r = Cr[e], a = r.id.replace("%s", this.id_), s = [t, a].join(" ").trim(); return ["<" + i + ' id="' + a + '" class="' + ("label" === i ? "vjs-label" : "") + '">', this.localize(r.label), "", '").join("") }, t.createElFgColor_ = function () { var e = "captions-text-legend-" + this.id_; return ['
    ', '', this.localize("Text"), "", this.createElSelect_("color", e), '', this.createElSelect_("textOpacity", e), "", "
    "].join("") }, t.createElBgColor_ = function () { var e = "captions-background-" + this.id_; return ['
    ', '', this.localize("Background"), "", this.createElSelect_("backgroundColor", e), '', this.createElSelect_("backgroundOpacity", e), "", "
    "].join("") }, t.createElWinColor_ = function () { var e = "captions-window-" + this.id_; return ['
    ', '', this.localize("Window"), "", this.createElSelect_("windowColor", e), '', this.createElSelect_("windowOpacity", e), "", "
    "].join("") }, t.createElColors_ = function () { return S("div", { className: "vjs-track-settings-colors", innerHTML: [this.createElFgColor_(), this.createElBgColor_(), this.createElWinColor_()].join("") }) }, t.createElFont_ = function () { return S("div", { className: "vjs-track-settings-font", innerHTML: ['
    ', this.createElSelect_("fontPercent", "", "legend"), "
    ", '
    ', this.createElSelect_("edgeStyle", "", "legend"), "
    ", '
    ', this.createElSelect_("fontFamily", "", "legend"), "
    "].join("") }) }, t.createElControls_ = function () { var e = this.localize("restore all settings to the default values"); return S("div", { className: "vjs-track-settings-controls", innerHTML: ['", '"].join("") }) }, t.content = function () { return [this.createElColors_(), this.createElFont_(), this.createElControls_()] }, t.label = function () { return this.localize("Caption Settings Dialog") }, t.description = function () { return this.localize("Beginning of dialog window. Escape will cancel and close the window.") }, t.buildCSSClass = function () { return n.prototype.buildCSSClass.call(this) + " vjs-text-track-settings" }, t.getValues = function () { var r = this; return function (i, n, e) { return void 0 === e && (e = 0), a(i).reduce(function (e, t) { return n(e, i[t], t) }, e) }(Cr, function (e, t, i) { var n = function (e, t) { return Er(e.options[e.options.selectedIndex].value, t) }(r.$(t.selector), t.parser); return void 0 !== n && (e[i] = n), e }, {}) }, t.setValues = function (i) { var n = this; s(Cr, function (e, t) { !function (e, t, i) { if (t) for (var n = 0; n < e.options.length; n++)if (Er(e.options[n].value, i) === t) { e.selectedIndex = n; break } }(n.$(e.selector), i[t], e.parser) }) }, t.setDefaults = function () { var i = this; s(Cr, function (e) { var t = e.hasOwnProperty("default") ? e.default : 0; i.$(e.selector).selectedIndex = t }) }, t.restoreSettings = function () { var e; try { e = JSON.parse(y.localStorage.getItem(dr)) } catch (e) { p.warn(e) } e && this.setValues(e) }, t.saveSettings = function () { if (this.options_.persistTextTrackSettings) { var e = this.getValues(); try { Object.keys(e).length ? y.localStorage.setItem(dr, JSON.stringify(e)) : y.localStorage.removeItem(dr) } catch (e) { p.warn(e) } } }, t.updateDisplay = function () { var e = this.player_.getChild("textTrackDisplay"); e && e.updateDisplay() }, t.conditionalBlur_ = function () { this.previouslyActiveEl_ = null; var e = this.player_.controlBar, t = e && e.subsCapsButton, i = e && e.captionsButton; t ? t.focus() : i && i.focus() }, e }(xt); Re.registerComponent("TextTrackSettings", wr); var Ar = function (a) { function e(e, t) { var i, n = t.ResizeObserver || y.ResizeObserver; null === t.ResizeObserver && (n = !1); var r = Ne({ createEl: !n, reportTouchActivity: !1 }, t); return (i = a.call(this, e, r) || this).ResizeObserver = t.ResizeObserver || y.ResizeObserver, i.loadListener_ = null, i.resizeObserver_ = null, i.debouncedHandler_ = function (n, r, a, s) { var o; void 0 === s && (s = y); function e() { var e = this, t = arguments, i = function () { i = o = null, a || n.apply(e, t) }; !o && a && n.apply(e, t), s.clearTimeout(o), o = s.setTimeout(i, r) } return e.cancel = function () { s.clearTimeout(o), o = null }, e }(function () { i.resizeHandler() }, 100, !1, Ue(i)), n ? (i.resizeObserver_ = new i.ResizeObserver(i.debouncedHandler_), i.resizeObserver_.observe(e.el())) : (i.loadListener_ = function () { if (i.el_ && i.el_.contentWindow) { var e = i.debouncedHandler_, t = i.unloadListener_ = function () { de(this, "resize", e), de(this, "unload", t), t = null }; he(i.el_.contentWindow, "unload", t), he(i.el_.contentWindow, "resize", e) } }, i.one("load", i.loadListener_)), i } He(e, a); var t = e.prototype; return t.createEl = function () { return a.prototype.createEl.call(this, "iframe", { className: "vjs-resize-manager", tabIndex: -1 }, { "aria-hidden": "true" }) }, t.resizeHandler = function () { this.player_ && this.player_.trigger && this.player_.trigger("playerresize") }, t.dispose = function () { this.debouncedHandler_ && this.debouncedHandler_.cancel(), this.resizeObserver_ && (this.player_.el() && this.resizeObserver_.unobserve(this.player_.el()), this.resizeObserver_.disconnect()), this.loadListener_ && this.off("load", this.loadListener_), this.el_ && this.el_.contentWindow && this.unloadListener_ && this.unloadListener_.call(this.el_.contentWindow), this.ResizeObserver = null, this.resizeObserver = null, this.debouncedHandler_ = null, this.loadListener_ = null, a.prototype.dispose.call(this) }, e }(Re); Re.registerComponent("ResizeManager", Ar); var Ir = { trackingThreshold: 30 }, xr = function (r) { function e(e, t) { var i, n = Ne(Ir, t, { createEl: !1 }); return (i = r.call(this, e, n) || this).reset_(), i.on(i.player_, "durationchange", i.handleDurationchange), et && "hidden" in h && "visibilityState" in h && i.on(h, "visibilitychange", i.handleVisibilityChange), i } He(e, r); var t = e.prototype; return t.handleVisibilityChange = function () { this.player_.duration() === 1 / 0 && (h.hidden ? this.stopTracking() : this.startTracking()) }, t.isBehind_ = function () { if (!this.timeupdateSeen_) return !1; var e = this.liveCurrentTime(), t = this.player_.currentTime(), i = 2 * this.seekableIncrement_ + .07; return e !== 1 / 0 && t <= e - i }, t.trackLive_ = function () { this.pastSeekEnd_ = this.pastSeekEnd_; var e = this.player_.seekable(); if (e && e.length) { var t = this.seekableEnd(); t !== this.lastSeekEnd_ && (this.lastSeekEnd_ && (this.seekableIncrementList_ = this.seekableIncrementList_.slice(-11), this.seekableIncrementList_.push(Math.abs(t - this.lastSeekEnd_)), 3 < this.seekableIncrementList_.length && (this.seekableIncrement_ = function (e) { var t = Math.floor(e.length / 2), i = [].concat(e).sort(function (e, t) { return e - t }); return e.length % 2 != 0 ? i[t] : (i[t - 1] + i[t]) / 2 }(this.seekableIncrementList_))), this.pastSeekEnd_ = 0, this.lastSeekEnd_ = t, this.trigger("seekableendchange")), this.pastSeekEnd() > 1.5 * this.seekableIncrement_ ? this.pastSeekEnd_ = 0 : this.pastSeekEnd_ = this.pastSeekEnd() + .03, this.isBehind_() !== this.behindLiveEdge() && (this.behindLiveEdge_ = this.isBehind_(), this.trigger("liveedgechange")) } }, t.handleDurationchange = function () { this.player_.duration() === 1 / 0 && this.liveWindow() >= this.options_.trackingThreshold ? (this.player_.options_.liveui && this.player_.addClass("vjs-liveui"), this.startTracking()) : (this.player_.removeClass("vjs-liveui"), this.stopTracking()) }, t.startTracking = function () { var e = this; this.isTracking() || (this.timeupdateSeen_ || (this.timeupdateSeen_ = this.player_.hasStarted()), this.trackingInterval_ = this.setInterval(this.trackLive_, 30), this.trackLive_(), this.on(this.player_, "play", this.trackLive_), this.on(this.player_, "pause", this.trackLive_), this.timeupdateSeen_ || (this.one(this.player_, "play", this.handlePlay), this.handleTimeupdate = function () { e.timeupdateSeen_ = !0, e.handleTimeupdate = null }, this.one(this.player_, "timeupdate", this.handleTimeupdate))) }, t.handlePlay = function () { this.one(this.player_, "timeupdate", this.seekToLiveEdge) }, t.reset_ = function () { this.pastSeekEnd_ = 0, this.lastSeekEnd_ = null, this.behindLiveEdge_ = null, this.timeupdateSeen_ = !1, this.clearInterval(this.trackingInterval_), this.trackingInterval_ = null, this.seekableIncrement_ = 12, this.seekableIncrementList_ = [], this.off(this.player_, "play", this.trackLive_), this.off(this.player_, "pause", this.trackLive_), this.off(this.player_, "play", this.handlePlay), this.off(this.player_, "timeupdate", this.seekToLiveEdge), this.handleTimeupdate && (this.off(this.player_, "timeupdate", this.handleTimeupdate), this.handleTimeupdate = null) }, t.stopTracking = function () { this.isTracking() && this.reset_() }, t.seekableEnd = function () { for (var e = this.player_.seekable(), t = [], i = e ? e.length : 0; i--;)t.push(e.end(i)); return t.length ? t.sort()[t.length - 1] : 1 / 0 }, t.seekableStart = function () { for (var e = this.player_.seekable(), t = [], i = e ? e.length : 0; i--;)t.push(e.start(i)); return t.length ? t.sort()[0] : 0 }, t.liveWindow = function () { var e = this.liveCurrentTime(); return e === 1 / 0 ? 1 / 0 : e - this.seekableStart() }, t.isLive = function () { return this.isTracking() }, t.atLiveEdge = function () { return !this.behindLiveEdge() }, t.liveCurrentTime = function () { return this.pastSeekEnd() + this.seekableEnd() }, t.pastSeekEnd = function () { return this.pastSeekEnd_ }, t.behindLiveEdge = function () { return this.behindLiveEdge_ }, t.isTracking = function () { return "number" == typeof this.trackingInterval_ }, t.seekToLiveEdge = function () { this.atLiveEdge() || (this.player_.currentTime(this.liveCurrentTime()), this.player_.paused() && this.player_.play()) }, t.dispose = function () { this.stopTracking(), r.prototype.dispose.call(this) }, e }(Re); Re.registerComponent("LiveTracker", xr); function Pr(e) { var t = e.el(); if (t.hasAttribute("src")) return e.triggerSourceset(t.src), !0; var i = e.$$("source"), n = [], r = ""; if (!i.length) return !1; for (var a = 0; a < i.length; a++) { var s = i[a].src; s && -1 === n.indexOf(s) && n.push(s) } return !!n.length && (1 === n.length && (r = n[0]), e.triggerSourceset(r), !0) } function Lr(e, t) { for (var i = {}, n = 0; n < e.length && !((i = Object.getOwnPropertyDescriptor(e[n], t)) && i.set && i.get); n++); return i.enumerable = !0, i.configurable = !0, i } function Or(a) { var s = a.el(); if (!s.resetSourceWatch_) { var t = {}, e = function (e) { return Lr([e.el(), y.HTMLMediaElement.prototype, y.Element.prototype, Ur], "innerHTML") }(a), i = function (r) { return function () { for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++)t[i] = arguments[i]; var n = r.apply(s, t); return Pr(a), n } };["append", "appendChild", "insertAdjacentHTML"].forEach(function (e) { s[e] && (t[e] = s[e], s[e] = i(t[e])) }), Object.defineProperty(s, "innerHTML", Ne(e, { set: i(e.set) })), s.resetSourceWatch_ = function () { s.resetSourceWatch_ = null, Object.keys(t).forEach(function (e) { s[e] = t[e] }), Object.defineProperty(s, "innerHTML", e) }, a.one("sourceset", s.resetSourceWatch_) } } function Dr(n) { if (n.featuresSourceset) { var r = n.el(); if (!r.resetSourceset_) { var i = function (e) { return Lr([e.el(), y.HTMLMediaElement.prototype, Mr], "src") }(n), a = r.setAttribute, t = r.load; Object.defineProperty(r, "src", Ne(i, { set: function (e) { var t = i.set.call(r, e); return n.triggerSourceset(r.src), t } })), r.setAttribute = function (e, t) { var i = a.call(r, e, t); return /src/i.test(e) && n.triggerSourceset(r.src), i }, r.load = function () { var e = t.call(r); return Pr(n) || (n.triggerSourceset(""), Or(n)), e }, r.currentSrc ? n.triggerSourceset(r.currentSrc) : Pr(n) || Or(n), r.resetSourceset_ = function () { r.resetSourceset_ = null, r.load = t, r.setAttribute = a, Object.defineProperty(r, "src", i), r.resetSourceWatch_ && r.resetSourceWatch_() } } } } function Nr(t, i, n, e) { function r(e) { return Object.defineProperty(t, i, { value: e, enumerable: !0, writable: !0 }) } void 0 === e && (e = !0); var a = { configurable: !0, enumerable: !0, get: function () { var e = n(); return r(e), e } }; return e && (a.set = r), Object.defineProperty(t, i, a) } var Rr, Ur = Object.defineProperty({}, "innerHTML", { get: function () { return this.cloneNode(!0).innerHTML }, set: function (e) { var t = h.createElement(this.nodeName.toLowerCase()); t.innerHTML = e; for (var i = h.createDocumentFragment(); t.childNodes.length;)i.appendChild(t.childNodes[0]); return this.innerText = "", y.Element.prototype.appendChild.call(this, i), this.innerHTML } }), Mr = Object.defineProperty({}, "src", { get: function () { return this.hasAttribute("src") ? Rt(y.Element.prototype.getAttribute.call(this, "src")) : "" }, set: function (e) { return y.Element.prototype.setAttribute.call(this, "src", e), e } }), Br = function (c) { function o(e, t) { var i; i = c.call(this, e, t) || this; var n = e.source, r = !1; if (n && (i.el_.currentSrc !== n.src || e.tag && 3 === e.tag.initNetworkState_) ? i.setSource(n) : i.handleLateInit_(i.el_), e.enableSourceset && i.setupSourcesetHandling_(), i.el_.hasChildNodes()) { for (var a = i.el_.childNodes, s = a.length, o = []; s--;) { var u = a[s]; "track" === u.nodeName.toLowerCase() && (i.featuresNativeTextTracks ? (i.remoteTextTrackEls().addTrackElement_(u), i.remoteTextTracks().addTrack(u.track), i.textTracks().addTrack(u.track), r || i.el_.hasAttribute("crossorigin") || !Mt(u.src) || (r = !0)) : o.push(u)) } for (var l = 0; l < o.length; l++)i.el_.removeChild(o[l]) } return i.proxyNativeTracks_(), i.featuresNativeTextTracks && r && p.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."), i.restoreMetadataTracksInIOSNativePlayer_(), (nt || at || Ye) && !0 === e.nativeControlsForTouch && i.setControls(!0), i.proxyWebkitFullscreen_(), i.triggerReady(), i } He(o, c); var e = o.prototype; return e.dispose = function () { this.el_ && this.el_.resetSourceset_ && this.el_.resetSourceset_(), o.disposeMediaElement(this.el_), this.options_ = null, c.prototype.dispose.call(this) }, e.setupSourcesetHandling_ = function () { Dr(this) }, e.restoreMetadataTracksInIOSNativePlayer_ = function () { function e() { i = []; for (var e = 0; e < n.length; e++) { var t = n[e]; "metadata" === t.kind && i.push({ track: t, storedMode: t.mode }) } } var i, n = this.textTracks(); e(), n.addEventListener("change", e), this.on("dispose", function () { return n.removeEventListener("change", e) }); function r() { for (var e = 0; e < i.length; e++) { var t = i[e]; "disabled" === t.track.mode && t.track.mode !== t.storedMode && (t.track.mode = t.storedMode) } n.removeEventListener("change", r) } this.on("webkitbeginfullscreen", function () { n.removeEventListener("change", e), n.removeEventListener("change", r), n.addEventListener("change", r) }), this.on("webkitendfullscreen", function () { n.removeEventListener("change", e), n.addEventListener("change", e), n.removeEventListener("change", r) }) }, e.overrideNative_ = function (e, t) { var i = this; if (t === this["featuresNative" + e + "Tracks"]) { var n = e.toLowerCase(); this[n + "TracksListeners_"] && Object.keys(this[n + "TracksListeners_"]).forEach(function (e) { i.el()[n + "Tracks"].removeEventListener(e, i[n + "TracksListeners_"][e]) }), this["featuresNative" + e + "Tracks"] = !t, this[n + "TracksListeners_"] = null, this.proxyNativeTracksForType_(n) } }, e.overrideNativeAudioTracks = function (e) { this.overrideNative_("Audio", e) }, e.overrideNativeVideoTracks = function (e) { this.overrideNative_("Video", e) }, e.proxyNativeTracksForType_ = function (i) { var n = this, e = li[i], r = this.el()[e.getterName], a = this[e.getterName](); if (this["featuresNative" + e.capitalName + "Tracks"] && r && r.addEventListener) { var s = { change: function (e) { var t = { type: "change", target: a, currentTarget: a, srcElement: a }; a.trigger(t), "text" === i && n[ci.remoteText.getterName]().trigger(t) }, addtrack: function (e) { a.addTrack(e.track) }, removetrack: function (e) { a.removeTrack(e.track) } }, t = function () { for (var e = [], t = 0; t < a.length; t++) { for (var i = !1, n = 0; n < r.length; n++)if (r[n] === a[t]) { i = !0; break } i || e.push(a[t]) } for (; e.length;)a.removeTrack(e.shift()) }; this[e.getterName + "Listeners_"] = s, Object.keys(s).forEach(function (t) { var i = s[t]; r.addEventListener(t, i), n.on("dispose", function (e) { return r.removeEventListener(t, i) }) }), this.on("loadstart", t), this.on("dispose", function (e) { return n.off("loadstart", t) }) } }, e.proxyNativeTracks_ = function () { var t = this; li.names.forEach(function (e) { t.proxyNativeTracksForType_(e) }) }, e.createEl = function () { var e = this.options_.tag; if (!e || !this.options_.playerElIngest && !this.movingMediaElementInDOM) { if (e) { var t = e.cloneNode(!0); e.parentNode && e.parentNode.insertBefore(t, e), o.disposeMediaElement(e), e = t } else { e = h.createElement("video"); var i = Ne({}, this.options_.tag && P(this.options_.tag)); nt && !0 === this.options_.nativeControlsForTouch || delete i.controls, x(e, m(i, { id: this.options_.techId, class: "vjs-tech" })) } e.playerId = this.options_.playerId } "undefined" != typeof this.options_.preload && O(e, "preload", this.options_.preload); for (var n = ["loop", "muted", "playsinline", "autoplay"], r = 0; r < n.length; r++) { var a = n[r], s = this.options_[a]; "undefined" != typeof s && (s ? O(e, a, a) : D(e, a), e[a] = s) } return e }, e.handleLateInit_ = function (e) { if (0 !== e.networkState && 3 !== e.networkState) { if (0 === e.readyState) { var t = !1, i = function () { t = !0 }; this.on("loadstart", i); var n = function () { t || this.trigger("loadstart") }; return this.on("loadedmetadata", n), void this.ready(function () { this.off("loadstart", i), this.off("loadedmetadata", n), t || this.trigger("loadstart") }) } var r = ["loadstart"]; r.push("loadedmetadata"), 2 <= e.readyState && r.push("loadeddata"), 3 <= e.readyState && r.push("canplay"), 4 <= e.readyState && r.push("canplaythrough"), this.ready(function () { r.forEach(function (e) { this.trigger(e) }, this) }) } }, e.setCurrentTime = function (e) { try { this.el_.currentTime = e } catch (e) { p(e, "Video is not ready. (Video.js)") } }, e.duration = function () { var t = this; if (this.el_.duration === 1 / 0 && Xe && Je && 0 === this.el_.currentTime) { return this.on("timeupdate", function e() { 0 < t.el_.currentTime && (t.el_.duration === 1 / 0 && t.trigger("durationchange"), t.off("timeupdate", e)) }), NaN } return this.el_.duration || NaN }, e.width = function () { return this.el_.offsetWidth }, e.height = function () { return this.el_.offsetHeight }, e.proxyWebkitFullscreen_ = function () { var e = this; if ("webkitDisplayingFullscreen" in this.el_) { var t = function () { this.trigger("fullscreenchange", { isFullscreen: !1 }) }, i = function () { "webkitPresentationMode" in this.el_ && "picture-in-picture" !== this.el_.webkitPresentationMode && (this.one("webkitendfullscreen", t), this.trigger("fullscreenchange", { isFullscreen: !0 })) }; this.on("webkitbeginfullscreen", i), this.on("dispose", function () { e.off("webkitbeginfullscreen", i), e.off("webkitendfullscreen", t) }) } }, e.supportsFullScreen = function () { if ("function" == typeof this.el_.webkitEnterFullScreen) { var e = y.navigator && y.navigator.userAgent || ""; if (/Android/.test(e) || !/Chrome|Mac OS X 10.5/.test(e)) return !0 } return !1 }, e.enterFullScreen = function () { var e = this.el_; e.paused && e.networkState <= e.HAVE_METADATA ? (this.el_.play(), this.setTimeout(function () { e.pause(), e.webkitEnterFullScreen() }, 0)) : e.webkitEnterFullScreen() }, e.exitFullScreen = function () { this.el_.webkitExitFullScreen() }, e.requestPictureInPicture = function () { return this.el_.requestPictureInPicture() }, e.src = function (e) { if (void 0 === e) return this.el_.src; this.setSrc(e) }, e.reset = function () { o.resetMediaElement(this.el_) }, e.currentSrc = function () { return this.currentSource_ ? this.currentSource_.src : this.el_.currentSrc }, e.setControls = function (e) { this.el_.controls = !!e }, e.addTextTrack = function (e, t, i) { return this.featuresNativeTextTracks ? this.el_.addTextTrack(e, t, i) : c.prototype.addTextTrack.call(this, e, t, i) }, e.createRemoteTextTrack = function (e) { if (!this.featuresNativeTextTracks) return c.prototype.createRemoteTextTrack.call(this, e); var t = h.createElement("track"); return e.kind && (t.kind = e.kind), e.label && (t.label = e.label), (e.language || e.srclang) && (t.srclang = e.language || e.srclang), e.default && (t.default = e.default), e.id && (t.id = e.id), e.src && (t.src = e.src), t }, e.addRemoteTextTrack = function (e, t) { var i = c.prototype.addRemoteTextTrack.call(this, e, t); return this.featuresNativeTextTracks && this.el().appendChild(i), i }, e.removeRemoteTextTrack = function (e) { if (c.prototype.removeRemoteTextTrack.call(this, e), this.featuresNativeTextTracks) for (var t = this.$$("track"), i = t.length; i--;)e !== t[i] && e !== t[i].track || this.el().removeChild(t[i]) }, e.getVideoPlaybackQuality = function () { if ("function" == typeof this.el().getVideoPlaybackQuality) return this.el().getVideoPlaybackQuality(); var e = {}; return "undefined" != typeof this.el().webkitDroppedFrameCount && "undefined" != typeof this.el().webkitDecodedFrameCount && (e.droppedVideoFrames = this.el().webkitDroppedFrameCount, e.totalVideoFrames = this.el().webkitDecodedFrameCount), y.performance && "function" == typeof y.performance.now ? e.creationTime = y.performance.now() : y.performance && y.performance.timing && "number" == typeof y.performance.timing.navigationStart && (e.creationTime = y.Date.now() - y.performance.timing.navigationStart), e }, o }(Vi); Nr(Br, "TEST_VID", function () { if (v()) { var e = h.createElement("video"), t = h.createElement("track"); return t.kind = "captions", t.srclang = "en", t.label = "English", e.appendChild(t), e } }), Br.isSupported = function () { try { Br.TEST_VID.volume = .5 } catch (e) { return !1 } return !(!Br.TEST_VID || !Br.TEST_VID.canPlayType) }, Br.canPlayType = function (e) { return Br.TEST_VID.canPlayType(e) }, Br.canPlaySource = function (e, t) { return Br.canPlayType(e.type) }, Br.canControlVolume = function () { try { var e = Br.TEST_VID.volume; return Br.TEST_VID.volume = e / 2 + .1, e !== Br.TEST_VID.volume } catch (e) { return !1 } }, Br.canMuteVolume = function () { try { var e = Br.TEST_VID.muted; return Br.TEST_VID.muted = !e, Br.TEST_VID.muted ? O(Br.TEST_VID, "muted", "muted") : D(Br.TEST_VID, "muted"), e !== Br.TEST_VID.muted } catch (e) { return !1 } }, Br.canControlPlaybackRate = function () { if (Xe && Je && Ze < 58) return !1; try { var e = Br.TEST_VID.playbackRate; return Br.TEST_VID.playbackRate = e / 2 + .1, e !== Br.TEST_VID.playbackRate } catch (e) { return !1 } }, Br.canOverrideAttributes = function () { try { var e = function () { }; Object.defineProperty(h.createElement("video"), "src", { get: e, set: e }), Object.defineProperty(h.createElement("audio"), "src", { get: e, set: e }), Object.defineProperty(h.createElement("video"), "innerHTML", { get: e, set: e }), Object.defineProperty(h.createElement("audio"), "innerHTML", { get: e, set: e }) } catch (e) { return !1 } return !0 }, Br.supportsNativeTextTracks = function () { return ot || st && Je }, Br.supportsNativeVideoTracks = function () { return !(!Br.TEST_VID || !Br.TEST_VID.videoTracks) }, Br.supportsNativeAudioTracks = function () { return !(!Br.TEST_VID || !Br.TEST_VID.audioTracks) }, Br.Events = ["loadstart", "suspend", "abort", "error", "emptied", "stalled", "loadedmetadata", "loadeddata", "canplay", "canplaythrough", "playing", "waiting", "seeking", "seeked", "ended", "durationchange", "timeupdate", "progress", "play", "pause", "ratechange", "resize", "volumechange"], [["featuresVolumeControl", "canControlVolume"], ["featuresMuteControl", "canMuteVolume"], ["featuresPlaybackRate", "canControlPlaybackRate"], ["featuresSourceset", "canOverrideAttributes"], ["featuresNativeTextTracks", "supportsNativeTextTracks"], ["featuresNativeVideoTracks", "supportsNativeVideoTracks"], ["featuresNativeAudioTracks", "supportsNativeAudioTracks"]].forEach(function (e) { var t = e[0], i = e[1]; Nr(Br.prototype, t, function () { return Br[i]() }, !0) }), Br.prototype.movingMediaElementInDOM = !st, Br.prototype.featuresFullscreenResize = !0, Br.prototype.featuresProgressEvents = !0, Br.prototype.featuresTimeupdateEvents = !0, Br.patchCanPlayType = function () { 4 <= Ke && !$e && !Je && (Rr = Br.TEST_VID && Br.TEST_VID.constructor.prototype.canPlayType, Br.TEST_VID.constructor.prototype.canPlayType = function (e) { return e && /^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(e) ? "maybe" : Rr.call(this, e) }) }, Br.unpatchCanPlayType = function () { var e = Br.TEST_VID.constructor.prototype.canPlayType; return Rr && (Br.TEST_VID.constructor.prototype.canPlayType = Rr), e }, Br.patchCanPlayType(), Br.disposeMediaElement = function (e) { if (e) { for (e.parentNode && e.parentNode.removeChild(e); e.hasChildNodes();)e.removeChild(e.firstChild); e.removeAttribute("src"), "function" == typeof e.load && function () { try { e.load() } catch (e) { } }() } }, Br.resetMediaElement = function (e) { if (e) { for (var t = e.querySelectorAll("source"), i = t.length; i--;)e.removeChild(t[i]); e.removeAttribute("src"), "function" == typeof e.load && function () { try { e.load() } catch (e) { } }() } }, ["muted", "defaultMuted", "autoplay", "controls", "loop", "playsinline"].forEach(function (e) { Br.prototype[e] = function () { return this.el_[e] || this.el_.hasAttribute(e) } }), ["muted", "defaultMuted", "autoplay", "loop", "playsinline"].forEach(function (t) { Br.prototype["set" + De(t)] = function (e) { (this.el_[t] = e) ? this.el_.setAttribute(t, t) : this.el_.removeAttribute(t) } }), ["paused", "currentTime", "buffered", "volume", "poster", "preload", "error", "seeking", "seekable", "ended", "playbackRate", "defaultPlaybackRate", "played", "networkState", "readyState", "videoWidth", "videoHeight"].forEach(function (e) { Br.prototype[e] = function () { return this.el_[e] } }), ["volume", "src", "poster", "preload", "playbackRate", "defaultPlaybackRate"].forEach(function (t) { Br.prototype["set" + De(t)] = function (e) { this.el_[t] = e } }), ["pause", "load", "play"].forEach(function (e) { Br.prototype[e] = function () { return this.el_[e]() } }), Vi.withSourceHandlers(Br), Br.nativeSourceHandler = {}, Br.nativeSourceHandler.canPlayType = function (e) { try { return Br.TEST_VID.canPlayType(e) } catch (e) { return "" } }, Br.nativeSourceHandler.canHandleSource = function (e, t) { if (e.type) return Br.nativeSourceHandler.canPlayType(e.type); if (e.src) { var i = Ut(e.src); return Br.nativeSourceHandler.canPlayType("video/" + i) } return "" }, Br.nativeSourceHandler.handleSource = function (e, t, i) { t.setSrc(e.src) }, Br.nativeSourceHandler.dispose = function () { }, Br.registerSourceHandler(Br.nativeSourceHandler), Vi.registerTech("Html5", Br); var jr = ["progress", "abort", "suspend", "emptied", "stalled", "loadedmetadata", "loadeddata", "timeupdate", "resize", "volumechange", "texttrackchange"], Fr = { canplay: "CanPlay", canplaythrough: "CanPlayThrough", playing: "Playing", seeked: "Seeked" }, Hr = ["tiny", "xsmall", "small", "medium", "large", "xlarge", "huge"], Vr = {}; Hr.forEach(function (e) { var t = "x" === e.charAt(0) ? "x-" + e.substring(1) : e; Vr[e] = "vjs-layout-" + t }); var qr = { tiny: 210, xsmall: 320, small: 425, medium: 768, large: 1440, xlarge: 2560, huge: 1 / 0 }, Wr = function (c) { function l(e, t, i) { var n; if (e.id = e.id || t.id || "vjs_video_" + ne(), (t = m(l.getTagSettings(e), t)).initChildren = !1, t.createEl = !1, t.evented = !1, t.reportTouchActivity = !1, !t.language) if ("function" == typeof e.closest) { var r = e.closest("[lang]"); r && r.getAttribute && (t.language = r.getAttribute("lang")) } else for (var a = e; a && 1 === a.nodeType;) { if (P(a).hasOwnProperty("lang")) { t.language = a.getAttribute("lang"); break } a = a.parentNode } if ((n = c.call(this, null, t, i) || this).boundDocumentFullscreenChange_ = ge(Ue(n), n.documentFullscreenChange_), n.boundFullWindowOnEscKey_ = ge(Ue(n), n.fullWindowOnEscKey), n.isFullscreen_ = !1, n.log = f(n.id_), n.fsApi_ = ft, n.isPosterFromTech_ = !1, n.queuedCallbacks_ = [], n.isReady_ = !1, n.hasStarted_ = !1, n.userActive_ = !1, !n.options_ || !n.options_.techOrder || !n.options_.techOrder.length) throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?"); if (n.tag = e, n.tagAttributes = e && P(e), n.language(n.options_.language), t.languages) { var s = {}; Object.getOwnPropertyNames(t.languages).forEach(function (e) { s[e.toLowerCase()] = t.languages[e] }), n.languages_ = s } else n.languages_ = l.prototype.options_.languages; n.resetCache_(), n.poster_ = t.poster || "", n.controls_ = !!t.controls, e.controls = !1, e.removeAttribute("controls"), n.changingSrc_ = !1, n.playCallbacks_ = [], n.playTerminatedQueue_ = [], e.hasAttribute("autoplay") ? n.autoplay(!0) : n.autoplay(n.options_.autoplay), t.plugins && Object.keys(t.plugins).forEach(function (e) { if ("function" != typeof n[e]) throw new Error('plugin "' + e + '" does not exist') }), n.scrubbing_ = !1, n.el_ = n.createEl(), xe(Ue(n), { eventBusKey: "el_" }), n.fsApi_.requestFullscreen && (he(h, n.fsApi_.fullscreenchange, n.boundDocumentFullscreenChange_), n.on(n.fsApi_.fullscreenchange, n.boundDocumentFullscreenChange_)), n.fluid_ && n.on("playerreset", n.updateStyleEl_); var o = Ne(n.options_); t.plugins && Object.keys(t.plugins).forEach(function (e) { n[e](t.plugins[e]) }), n.options_.playerOptions = o, n.middleware_ = [], n.initChildren(), n.isAudio("audio" === e.nodeName.toLowerCase()), n.controls() ? n.addClass("vjs-controls-enabled") : n.addClass("vjs-controls-disabled"), n.el_.setAttribute("role", "region"), n.isAudio() ? n.el_.setAttribute("aria-label", n.localize("Audio Player")) : n.el_.setAttribute("aria-label", n.localize("Video Player")), n.isAudio() && n.addClass("vjs-audio"), n.flexNotSupported_() && n.addClass("vjs-no-flex"), nt && n.addClass("vjs-touch-enabled"), st || n.addClass("vjs-workinghover"), l.players[n.id_] = Ue(n); var u = d.split(".")[0]; return n.addClass("vjs-v" + u), n.userActive(!0), n.reportUserActivity(), n.one("play", n.listenForUserActivity_), n.on("stageclick", n.handleStageClick_), n.on("keydown", n.handleKeyDown), n.breakpoints(n.options_.breakpoints), n.responsive(n.options_.responsive), n } He(l, c); var e = l.prototype; return e.dispose = function () { var n = this; this.trigger("dispose"), this.off("dispose"), de(h, this.fsApi_.fullscreenchange, this.boundDocumentFullscreenChange_), de(h, "keydown", this.boundFullWindowOnEscKey_), this.styleEl_ && this.styleEl_.parentNode && (this.styleEl_.parentNode.removeChild(this.styleEl_), this.styleEl_ = null), l.players[this.id_] = null, this.tag && this.tag.player && (this.tag.player = null), this.el_ && this.el_.player && (this.el_.player = null), this.tech_ && (this.tech_.dispose(), this.isPosterFromTech_ = !1, this.poster_ = ""), this.playerElIngest_ && (this.playerElIngest_ = null), this.tag && (this.tag = null), function (e) { Wi[e.id()] = null }(this), hi.names.forEach(function (e) { var t = hi[e], i = n[t.getterName](); i && i.off && i.off() }), c.prototype.dispose.call(this) }, e.createEl = function () { var t, i = this.tag, e = this.playerElIngest_ = i.parentNode && i.parentNode.hasAttribute && i.parentNode.hasAttribute("data-vjs-player"), n = "video-js" === this.tag.tagName.toLowerCase(); e ? t = this.el_ = i.parentNode : n || (t = this.el_ = c.prototype.createEl.call(this, "div")); var r = P(i); if (n) { for (t = this.el_ = i, i = this.tag = h.createElement("video"); t.children.length;)i.appendChild(t.firstChild); E(t, "video-js") || w(t, "video-js"), t.appendChild(i), e = this.playerElIngest_ = t, Object.keys(t).forEach(function (e) { try { i[e] = t[e] } catch (e) { } }) } if (i.setAttribute("tabindex", "-1"), r.tabindex = "-1", (et || Je && it) && (i.setAttribute("role", "application"), r.role = "application"), i.removeAttribute("width"), i.removeAttribute("height"), "width" in r && delete r.width, "height" in r && delete r.height, Object.getOwnPropertyNames(r).forEach(function (e) { n && "class" === e || t.setAttribute(e, r[e]), n && i.setAttribute(e, r[e]) }), i.playerId = i.id, i.id += "_html5_api", i.className = "vjs-tech", i.player = t.player = this, this.addClass("vjs-paused"), !0 !== y.VIDEOJS_NO_DYNAMIC_STYLE) { this.styleEl_ = Z("vjs-styles-dimensions"); var a = G(".vjs-styles-defaults"), s = G("head"); s.insertBefore(this.styleEl_, a ? a.nextSibling : s.firstChild) } this.fill_ = !1, this.fluid_ = !1, this.width(this.options_.width), this.height(this.options_.height), this.fill(this.options_.fill), this.fluid(this.options_.fluid), this.aspectRatio(this.options_.aspectRatio); for (var o = i.getElementsByTagName("a"), u = 0; u < o.length; u++) { var l = o.item(u); w(l, "vjs-hidden"), l.setAttribute("hidden", "hidden") } return i.initNetworkState_ = i.networkState, i.parentNode && !e && i.parentNode.insertBefore(t, i), C(i, t), this.children_.unshift(i), this.el_.setAttribute("lang", this.language_), this.el_ = t }, e.width = function (e) { return this.dimension("width", e) }, e.height = function (e) { return this.dimension("height", e) }, e.dimension = function (e, t) { var i = e + "_"; if (void 0 === t) return this[i] || 0; if ("" === t || "auto" === t) return this[i] = void 0, void this.updateStyleEl_(); var n = parseFloat(t); isNaN(n) ? p.error('Improper value "' + t + '" supplied for for ' + e) : (this[i] = n, this.updateStyleEl_()) }, e.fluid = function (e) { if (void 0 === e) return !!this.fluid_; this.fluid_ = !!e, Ae(this) && this.off("playerreset", this.updateStyleEl_), e ? (this.addClass("vjs-fluid"), this.fill(!1), function (e, t) { Ae(e) ? t() : (e.eventedCallbacks || (e.eventedCallbacks = []), e.eventedCallbacks.push(t)) }(function () { this.on("playerreset", this.updateStyleEl_) })) : this.removeClass("vjs-fluid"), this.updateStyleEl_() }, e.fill = function (e) { if (void 0 === e) return !!this.fill_; this.fill_ = !!e, e ? (this.addClass("vjs-fill"), this.fluid(!1)) : this.removeClass("vjs-fill") }, e.aspectRatio = function (e) { if (void 0 === e) return this.aspectRatio_; if (!/^\d+\:\d+$/.test(e)) throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9."); this.aspectRatio_ = e, this.fluid(!0), this.updateStyleEl_() }, e.updateStyleEl_ = function () { if (!0 !== y.VIDEOJS_NO_DYNAMIC_STYLE) { var e, t, i, n = (void 0 !== this.aspectRatio_ && "auto" !== this.aspectRatio_ ? this.aspectRatio_ : 0 < this.videoWidth() ? this.videoWidth() + ":" + this.videoHeight() : "16:9").split(":"), r = n[1] / n[0]; e = void 0 !== this.width_ ? this.width_ : void 0 !== this.height_ ? this.height_ / r : this.videoWidth() || 300, t = void 0 !== this.height_ ? this.height_ : e * r, i = /^[^a-zA-Z]/.test(this.id()) ? "dimensions-" + this.id() : this.id() + "-dimensions", this.addClass(i), ee(this.styleEl_, "\n ." + i + " {\n width: " + e + "px;\n height: " + t + "px;\n }\n\n ." + i + ".vjs-fluid {\n padding-top: " + 100 * r + "%;\n }\n ") } else { var a = "number" == typeof this.width_ ? this.width_ : this.options_.width, s = "number" == typeof this.height_ ? this.height_ : this.options_.height, o = this.tech_ && this.tech_.el(); o && (0 <= a && (o.width = a), 0 <= s && (o.height = s)) } }, e.loadTech_ = function (e, t) { var i = this; this.tech_ && this.unloadTech_(); var n = De(e), r = e.charAt(0).toLowerCase() + e.slice(1); "Html5" !== n && this.tag && (Vi.getTech("Html5").disposeMediaElement(this.tag), this.tag.player = null, this.tag = null), this.techName_ = n, this.isReady_ = !1; var a = { source: t, autoplay: "string" != typeof this.autoplay() && this.autoplay(), nativeControlsForTouch: this.options_.nativeControlsForTouch, playerId: this.id(), techId: this.id() + "_" + r + "_api", playsinline: this.options_.playsinline, preload: this.options_.preload, loop: this.options_.loop, muted: this.options_.muted, poster: this.poster(), language: this.language(), playerElIngest: this.playerElIngest_ || !1, "vtt.js": this.options_["vtt.js"], canOverridePoster: !!this.options_.techCanOverridePoster, enableSourceset: this.options_.enableSourceset, Promise: this.options_.Promise }; hi.names.forEach(function (e) { var t = hi[e]; a[t.getterName] = i[t.privateName] }), m(a, this.options_[n]), m(a, this.options_[r]), m(a, this.options_[e.toLowerCase()]), this.tag && (a.tag = this.tag), t && t.src === this.cache_.src && 0 < this.cache_.currentTime && (a.startTime = this.cache_.currentTime); var s = Vi.getTech(e); if (!s) throw new Error("No Tech named '" + n + "' exists! '" + n + "' should be registered using videojs.registerTech()'"); this.tech_ = new s(a), this.tech_.ready(ge(this, this.handleTechReady_), !0), wt(this.textTracksJson_ || [], this.tech_), jr.forEach(function (e) { i.on(i.tech_, e, i["handleTech" + De(e) + "_"]) }), Object.keys(Fr).forEach(function (t) { i.on(i.tech_, t, function (e) { 0 === i.tech_.playbackRate() && i.tech_.seeking() ? i.queuedCallbacks_.push({ callback: i["handleTech" + Fr[t] + "_"].bind(i), event: e }) : i["handleTech" + Fr[t] + "_"](e) }) }), this.on(this.tech_, "loadstart", this.handleTechLoadStart_), this.on(this.tech_, "sourceset", this.handleTechSourceset_), this.on(this.tech_, "waiting", this.handleTechWaiting_), this.on(this.tech_, "ended", this.handleTechEnded_), this.on(this.tech_, "seeking", this.handleTechSeeking_), this.on(this.tech_, "play", this.handleTechPlay_), this.on(this.tech_, "firstplay", this.handleTechFirstPlay_), this.on(this.tech_, "pause", this.handleTechPause_), this.on(this.tech_, "durationchange", this.handleTechDurationChange_), this.on(this.tech_, "fullscreenchange", this.handleTechFullscreenChange_), this.on(this.tech_, "enterpictureinpicture", this.handleTechEnterPictureInPicture_), this.on(this.tech_, "leavepictureinpicture", this.handleTechLeavePictureInPicture_), this.on(this.tech_, "error", this.handleTechError_), this.on(this.tech_, "loadedmetadata", this.updateStyleEl_), this.on(this.tech_, "posterchange", this.handleTechPosterChange_), this.on(this.tech_, "textdata", this.handleTechTextData_), this.on(this.tech_, "ratechange", this.handleTechRateChange_), this.usingNativeControls(this.techGet_("controls")), this.controls() && !this.usingNativeControls() && this.addTechControlsListeners_(), this.tech_.el().parentNode === this.el() || "Html5" === n && this.tag || C(this.tech_.el(), this.el()), this.tag && (this.tag.player = null, this.tag = null) }, e.unloadTech_ = function () { var i = this; hi.names.forEach(function (e) { var t = hi[e]; i[t.privateName] = i[t.getterName]() }), this.textTracksJson_ = Et(this.tech_), this.isReady_ = !1, this.tech_.dispose(), this.tech_ = !1, this.isPosterFromTech_ && (this.poster_ = "", this.trigger("posterchange")), this.isPosterFromTech_ = !1 }, e.tech = function (e) { return void 0 === e && p.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"), this.tech_ }, e.addTechControlsListeners_ = function () { this.removeTechControlsListeners_(), this.on(this.tech_, "mouseup", this.handleTechClick_), this.on(this.tech_, "dblclick", this.handleTechDoubleClick_), this.on(this.tech_, "touchstart", this.handleTechTouchStart_), this.on(this.tech_, "touchmove", this.handleTechTouchMove_), this.on(this.tech_, "touchend", this.handleTechTouchEnd_), this.on(this.tech_, "tap", this.handleTechTap_) }, e.removeTechControlsListeners_ = function () { this.off(this.tech_, "tap", this.handleTechTap_), this.off(this.tech_, "touchstart", this.handleTechTouchStart_), this.off(this.tech_, "touchmove", this.handleTechTouchMove_), this.off(this.tech_, "touchend", this.handleTechTouchEnd_), this.off(this.tech_, "mouseup", this.handleTechClick_), this.off(this.tech_, "dblclick", this.handleTechDoubleClick_) }, e.handleTechReady_ = function () { this.triggerReady(), this.cache_.volume && this.techCall_("setVolume", this.cache_.volume), this.handleTechPosterChange_(), this.handleTechDurationChange_() }, e.handleTechLoadStart_ = function () { this.removeClass("vjs-ended"), this.removeClass("vjs-seeking"), this.error(null), this.handleTechDurationChange_(), this.paused() ? (this.hasStarted(!1), this.trigger("loadstart")) : (this.trigger("loadstart"), this.trigger("firstplay")), this.manualAutoplay_(this.autoplay()) }, e.manualAutoplay_ = function (t) { var n = this; if (this.tech_ && "string" == typeof t) { var e, i = function () { var e = n.muted(); n.muted(!0); function t() { n.muted(e) } n.playTerminatedQueue_.push(t); var i = n.play(); if (St(i)) return i.catch(t) }; if ("any" === t && !0 !== this.muted() ? St(e = this.play()) && (e = e.catch(i)) : e = "muted" === t && !0 !== this.muted() ? i() : this.play(), St(e)) return e.then(function () { n.trigger({ type: "autoplay-success", autoplay: t }) }).catch(function (e) { n.trigger({ type: "autoplay-failure", autoplay: t }) }) } }, e.updateSourceCaches_ = function (e) { void 0 === e && (e = ""); var t = e, i = ""; "string" != typeof t && (t = e.src, i = e.type), this.cache_.source = this.cache_.source || {}, this.cache_.sources = this.cache_.sources || [], t && !i && (i = function (e, t) { if (!t) return ""; if (e.cache_.source.src === t && e.cache_.source.type) return e.cache_.source.type; var i = e.cache_.sources.filter(function (e) { return e.src === t }); if (i.length) return i[0].type; for (var n = e.$$("source"), r = 0; r < n.length; r++) { var a = n[r]; if (a.type && a.src && a.src === t) return a.type } return Zi(t) }(this, t)), this.cache_.source = Ne({}, e, { src: t, type: i }); for (var n = this.cache_.sources.filter(function (e) { return e.src && e.src === t }), r = [], a = this.$$("source"), s = [], o = 0; o < a.length; o++) { var u = P(a[o]); r.push(u), u.src && u.src === t && s.push(u.src) } s.length && !n.length ? this.cache_.sources = r : n.length || (this.cache_.sources = [this.cache_.source]), this.cache_.src = t }, e.handleTechSourceset_ = function (e) { var i = this; if (!this.changingSrc_) { var t = function (e) { return i.updateSourceCaches_(e) }, n = this.currentSource().src, r = e.src; n && !/^blob:/.test(n) && /^blob:/.test(r) && (this.lastSource_ && (this.lastSource_.tech === r || this.lastSource_.player === n) || (t = function () { })), t(r), e.src || this.tech_.any(["sourceset", "loadstart"], function (e) { if ("sourceset" !== e.type) { var t = i.techGet("currentSrc"); i.lastSource_.tech = t, i.updateSourceCaches_(t) } }) } this.lastSource_ = { player: this.currentSource().src, tech: e.src }, this.trigger({ src: e.src, type: "sourceset" }) }, e.hasStarted = function (e) { if (void 0 === e) return this.hasStarted_; e !== this.hasStarted_ && (this.hasStarted_ = e, this.hasStarted_ ? (this.addClass("vjs-has-started"), this.trigger("firstplay")) : this.removeClass("vjs-has-started")) }, e.handleTechPlay_ = function () { this.removeClass("vjs-ended"), this.removeClass("vjs-paused"), this.addClass("vjs-playing"), this.hasStarted(!0), this.trigger("play") }, e.handleTechRateChange_ = function () { 0 < this.tech_.playbackRate() && 0 === this.cache_.lastPlaybackRate && (this.queuedCallbacks_.forEach(function (e) { return e.callback(e.event) }), this.queuedCallbacks_ = []), this.cache_.lastPlaybackRate = this.tech_.playbackRate(), this.trigger("ratechange") }, e.handleTechWaiting_ = function () { var t = this; this.addClass("vjs-waiting"), this.trigger("waiting"); var i = this.currentTime(); this.on("timeupdate", function e() { i !== t.currentTime() && (t.removeClass("vjs-waiting"), t.off("timeupdate", e)) }) }, e.handleTechCanPlay_ = function () { this.removeClass("vjs-waiting"), this.trigger("canplay") }, e.handleTechCanPlayThrough_ = function () { this.removeClass("vjs-waiting"), this.trigger("canplaythrough") }, e.handleTechPlaying_ = function () { this.removeClass("vjs-waiting"), this.trigger("playing") }, e.handleTechSeeking_ = function () { this.addClass("vjs-seeking"), this.trigger("seeking") }, e.handleTechSeeked_ = function () { this.removeClass("vjs-seeking"), this.removeClass("vjs-ended"), this.trigger("seeked") }, e.handleTechFirstPlay_ = function () { this.options_.starttime && (p.warn("Passing the `starttime` option to the player will be deprecated in 6.0"), this.currentTime(this.options_.starttime)), this.addClass("vjs-has-started"), this.trigger("firstplay") }, e.handleTechPause_ = function () { this.removeClass("vjs-playing"), this.addClass("vjs-paused"), this.trigger("pause") }, e.handleTechEnded_ = function () { this.addClass("vjs-ended"), this.options_.loop ? (this.currentTime(0), this.play()) : this.paused() || this.pause(), this.trigger("ended") }, e.handleTechDurationChange_ = function () { this.duration(this.techGet_("duration")) }, e.handleTechClick_ = function (e) { W(e) && this.controls_ && (this.paused() ? kt(this.play()) : this.pause()) }, e.handleTechDoubleClick_ = function (t) { this.controls_ && (Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"), function (e) { return e.contains(t.target) }) || void 0 !== this.options_ && void 0 !== this.options_.userActions && void 0 !== this.options_.userActions.doubleClick && !1 === this.options_.userActions.doubleClick || (void 0 !== this.options_ && void 0 !== this.options_.userActions && "function" == typeof this.options_.userActions.doubleClick ? this.options_.userActions.doubleClick.call(this, t) : this.isFullscreen() ? this.exitFullscreen() : this.requestFullscreen())) }, e.handleTechTap_ = function () { this.userActive(!this.userActive()) }, e.handleTechTouchStart_ = function () { this.userWasActive = this.userActive() }, e.handleTechTouchMove_ = function () { this.userWasActive && this.reportUserActivity() }, e.handleTechTouchEnd_ = function (e) { e.preventDefault() }, e.handleStageClick_ = function () { this.reportUserActivity() }, e.toggleFullscreenClass_ = function () { this.isFullscreen() ? this.addClass("vjs-fullscreen") : this.removeClass("vjs-fullscreen") }, e.documentFullscreenChange_ = function (e) { var t = e.target.player; if (!t || t === this) { var i = this.el(), n = h[this.fsApi_.fullscreenElement] === i; !n && i.matches ? n = i.matches(":" + this.fsApi_.fullscreen) : !n && i.msMatchesSelector && (n = i.msMatchesSelector(":" + this.fsApi_.fullscreen)), this.isFullscreen(n) } }, e.handleTechFullscreenChange_ = function (e, t) { t && this.isFullscreen(t.isFullscreen) }, e.togglePictureInPictureClass_ = function () { this.isInPictureInPicture() ? this.addClass("vjs-picture-in-picture") : this.removeClass("vjs-picture-in-picture") }, e.handleTechEnterPictureInPicture_ = function (e) { this.isInPictureInPicture(!0) }, e.handleTechLeavePictureInPicture_ = function (e) { this.isInPictureInPicture(!1) }, e.handleTechError_ = function () { var e = this.tech_.error(); this.error(e) }, e.handleTechTextData_ = function (e, t) { var i = null; 1 < arguments.length && (i = t), this.trigger("textdata", i) }, e.getCache = function () { return this.cache_ }, e.resetCache_ = function () { this.cache_ = { currentTime: 0, inactivityTimeout: this.options_.inactivityTimeout, duration: NaN, lastVolume: 1, lastPlaybackRate: this.defaultPlaybackRate(), media: null, src: "", source: {}, sources: [], volume: 1 } }, e.techCall_ = function (e, t) { this.ready(function () { if (e in Yi) return function (e, t, i, n) { return t[i](e.reduce(Qi(i), n)) }(this.middleware_, this.tech_, e, t); if (e in $i) return Xi(this.middleware_, this.tech_, e, t); try { this.tech_ && this.tech_[e](t) } catch (e) { throw p(e), e } }, !0) }, e.techGet_ = function (t) { if (this.tech_ && this.tech_.isReady_) { if (t in Ki) return function (e, t, i) { return e.reduceRight(Qi(i), t[i]()) }(this.middleware_, this.tech_, t); if (t in $i) return Xi(this.middleware_, this.tech_, t); try { return this.tech_[t]() } catch (e) { if (void 0 === this.tech_[t]) throw p("Video.js: " + t + " method not defined for " + this.techName_ + " playback technology.", e), e; if ("TypeError" === e.name) throw p("Video.js: " + t + " unavailable on " + this.techName_ + " playback technology element.", e), this.tech_.isReady_ = !1, e; throw p(e), e } } }, e.play = function () { var t = this, e = this.options_.Promise || y.Promise; return e ? new e(function (e) { t.play_(e) }) : this.play_() }, e.play_ = function (e) { var t = this; void 0 === e && (e = kt), this.playCallbacks_.push(e); var i = Boolean(!this.changingSrc_ && (this.src() || this.currentSrc())); if (this.waitToPlay_ && (this.off(["ready", "loadstart"], this.waitToPlay_), this.waitToPlay_ = null), !this.isReady_ || !i) return this.waitToPlay_ = function (e) { t.play_() }, this.one(["ready", "loadstart"], this.waitToPlay_), void (i || !ot && !st || this.load()); var n = this.techGet_("play"); null === n ? this.runPlayTerminatedQueue_() : this.runPlayCallbacks_(n) }, e.runPlayTerminatedQueue_ = function () { var e = this.playTerminatedQueue_.slice(0); this.playTerminatedQueue_ = [], e.forEach(function (e) { e() }) }, e.runPlayCallbacks_ = function (t) { var e = this.playCallbacks_.slice(0); this.playCallbacks_ = [], this.playTerminatedQueue_ = [], e.forEach(function (e) { e(t) }) }, e.pause = function () { this.techCall_("pause") }, e.paused = function () { return !1 !== this.techGet_("paused") }, e.played = function () { return this.techGet_("played") || ht(0, 0) }, e.scrubbing = function (e) { if ("undefined" == typeof e) return this.scrubbing_; this.scrubbing_ = !!e, e ? this.addClass("vjs-scrubbing") : this.removeClass("vjs-scrubbing") }, e.currentTime = function (e) { return "undefined" != typeof e ? (e < 0 && (e = 0), void this.techCall_("setCurrentTime", e)) : (this.cache_.currentTime = this.techGet_("currentTime") || 0, this.cache_.currentTime) }, e.duration = function (e) { if (void 0 === e) return void 0 !== this.cache_.duration ? this.cache_.duration : NaN; (e = parseFloat(e)) < 0 && (e = 1 / 0), e !== this.cache_.duration && ((this.cache_.duration = e) === 1 / 0 ? this.addClass("vjs-live") : this.removeClass("vjs-live"), isNaN(e) || this.trigger("durationchange")) }, e.remainingTime = function () { return this.duration() - this.currentTime() }, e.remainingTimeDisplay = function () { return Math.floor(this.duration()) - Math.floor(this.currentTime()) }, e.buffered = function () { var e = this.techGet_("buffered"); return e && e.length || (e = ht(0, 0)), e }, e.bufferedPercent = function () { return dt(this.buffered(), this.duration()) }, e.bufferedEnd = function () { var e = this.buffered(), t = this.duration(), i = e.end(e.length - 1); return t < i && (i = t), i }, e.volume = function (e) { var t; return void 0 !== e ? (t = Math.max(0, Math.min(1, parseFloat(e))), this.cache_.volume = t, this.techCall_("setVolume", t), void (0 < t && this.lastVolume_(t))) : (t = parseFloat(this.techGet_("volume")), isNaN(t) ? 1 : t) }, e.muted = function (e) { if (void 0 === e) return this.techGet_("muted") || !1; this.techCall_("setMuted", e) }, e.defaultMuted = function (e) { return void 0 !== e ? this.techCall_("setDefaultMuted", e) : this.techGet_("defaultMuted") || !1 }, e.lastVolume_ = function (e) { if (void 0 === e || 0 === e) return this.cache_.lastVolume; this.cache_.lastVolume = e }, e.supportsFullScreen = function () { return this.techGet_("supportsFullScreen") || !1 }, e.isFullscreen = function (e) { if (void 0 === e) return this.isFullscreen_; var t = this.isFullscreen_; return this.isFullscreen_ = Boolean(e), this.isFullscreen_ !== t && this.fsApi_.prefixed && this.trigger("fullscreenchange"), void this.toggleFullscreenClass_() }, e.requestFullscreen = function (e) { var t, i = this; if (this.fsApi_.prefixed || (t = this.options_.fullscreen && this.options_.fullscreen.options || {}, void 0 !== e && (t = e)), this.fsApi_.requestFullscreen) { var n = this.el_[this.fsApi_.requestFullscreen](t); return n && n.then(function () { return i.isFullscreen(!0) }, function () { return i.isFullscreen(!1) }), n } this.tech_.supportsFullScreen() ? this.techCall_("enterFullScreen") : this.enterFullWindow() }, e.exitFullscreen = function () { var e = this; if (this.fsApi_.requestFullscreen) { var t = h[this.fsApi_.exitFullscreen](); return t && t.then(function () { return e.isFullscreen(!1) }), t } this.tech_.supportsFullScreen() ? this.techCall_("exitFullScreen") : this.exitFullWindow() }, e.enterFullWindow = function () { this.isFullscreen(!0), this.isFullWindow = !0, this.docOrigOverflow = h.documentElement.style.overflow, he(h, "keydown", this.boundFullWindowOnEscKey_), h.documentElement.style.overflow = "hidden", w(h.body, "vjs-full-window"), this.trigger("enterFullWindow") }, e.fullWindowOnEscKey = function (e) { At.isEventKey(e, "Esc") && (!0 === this.isFullscreen() ? this.exitFullscreen() : this.exitFullWindow()) }, e.exitFullWindow = function () { this.isFullscreen(!1), this.isFullWindow = !1, de(h, "keydown", this.boundFullWindowOnEscKey_), h.documentElement.style.overflow = this.docOrigOverflow, A(h.body, "vjs-full-window"), this.trigger("exitFullWindow") }, e.isInPictureInPicture = function (e) { return void 0 !== e ? (this.isInPictureInPicture_ = !!e, void this.togglePictureInPictureClass_()) : !!this.isInPictureInPicture_ }, e.requestPictureInPicture = function () { if ("pictureInPictureEnabled" in h) return this.techGet_("requestPictureInPicture") }, e.exitPictureInPicture = function () { if ("pictureInPictureEnabled" in h) return h.exitPictureInPicture() }, e.handleKeyDown = function (e) { var t = this.options_.userActions; if (t && t.hotkeys) { !function (e) { var t = e.tagName.toLowerCase(); if (e.isContentEditable) return !0; if ("input" === t) return -1 === ["button", "checkbox", "hidden", "radio", "reset", "submit"].indexOf(e.type); return -1 !== ["textarea"].indexOf(t) }(this.el_.ownerDocument.activeElement) && ("function" == typeof t.hotkeys ? t.hotkeys.call(this, e) : this.handleHotkeys(e)) } }, e.handleHotkeys = function (e) { var t = this.options_.userActions ? this.options_.userActions.hotkeys : {}, i = t.fullscreenKey, n = void 0 === i ? function (e) { return At.isEventKey(e, "f") } : i, r = t.muteKey, a = void 0 === r ? function (e) { return At.isEventKey(e, "m") } : r, s = t.playPauseKey, o = void 0 === s ? function (e) { return At.isEventKey(e, "k") || At.isEventKey(e, "Space") } : s; if (n.call(this, e)) { e.preventDefault(), e.stopPropagation(); var u = Re.getComponent("FullscreenToggle"); !1 !== h[this.fsApi_.fullscreenEnabled] && u.prototype.handleClick.call(this, e) } else if (a.call(this, e)) { e.preventDefault(), e.stopPropagation(), Re.getComponent("MuteToggle").prototype.handleClick.call(this, e) } else if (o.call(this, e)) { e.preventDefault(), e.stopPropagation(), Re.getComponent("PlayToggle").prototype.handleClick.call(this, e) } }, e.canPlayType = function (e) { for (var t, i = 0, n = this.options_.techOrder; i < n.length; i++) { var r = n[i], a = Vi.getTech(r); if (a = a || Re.getComponent(r)) { if (a.isSupported() && (t = a.canPlayType(e))) return t } else p.error('The "' + r + '" tech is undefined. Skipped browser support check for that tech.') } return "" }, e.selectSource = function (e) { function t(e, i, n) { var r; return e.some(function (t) { return i.some(function (e) { if (r = n(t, e)) return !0 }) }), r } function i(e, t) { var i = e[0]; if (e[1].canPlaySource(t, r.options_[i.toLowerCase()])) return { source: t, tech: i } } var n, r = this, a = this.options_.techOrder.map(function (e) { return [e, Vi.getTech(e)] }).filter(function (e) { var t = e[0], i = e[1]; return i ? i.isSupported() : (p.error('The "' + t + '" tech is undefined. Skipped browser support check for that tech.'), !1) }); return (this.options_.sourceOrder ? t(e, a, (n = i, function (e, t) { return n(t, e) })) : t(a, e, i)) || !1 }, e.src = function (e) { var i = this; if ("undefined" == typeof e) return this.cache_.src || ""; var n = function t(e) { if (Array.isArray(e)) { var i = []; e.forEach(function (e) { e = t(e), Array.isArray(e) ? i = i.concat(e) : o(e) && i.push(e) }), e = i } else e = "string" == typeof e && e.trim() ? [tn({ src: e })] : o(e) && "string" == typeof e.src && e.src && e.src.trim() ? [tn(e)] : []; return e }(e); n.length ? (this.changingSrc_ = !0, this.cache_.sources = n, this.updateSourceCaches_(n[0]), Gi(this, n[0], function (e, t) { if (i.middleware_ = t, i.cache_.sources = n, i.updateSourceCaches_(e), i.src_(e)) return 1 < n.length ? i.src(n.slice(1)) : (i.changingSrc_ = !1, i.setTimeout(function () { this.error({ code: 4, message: this.localize(this.options_.notSupportedMessage) }) }, 0), void i.triggerReady()); !function (e, t) { e.forEach(function (e) { return e.setTech && e.setTech(t) }) }(t, i.tech_) })) : this.setTimeout(function () { this.error({ code: 4, message: this.localize(this.options_.notSupportedMessage) }) }, 0) }, e.src_ = function (e) { var t = this, i = this.selectSource([e]); return !i || (function (e, t) { return De(e) === De(t) }(i.tech, this.techName_) ? this.ready(function () { this.tech_.constructor.prototype.hasOwnProperty("setSource") ? this.techCall_("setSource", e) : this.techCall_("src", e.src), this.changingSrc_ = !1 }, !0) : (this.changingSrc_ = !0, this.loadTech_(i.tech, i.source), this.tech_.ready(function () { t.changingSrc_ = !1 })), !1) }, e.load = function () { this.techCall_("load") }, e.reset = function () { var e = this, t = this.options_.Promise || y.Promise; this.paused() || !t ? this.doReset_() : kt(this.play().then(function () { return e.doReset_() })) }, e.doReset_ = function () { this.tech_ && this.tech_.clearTracks("text"), this.resetCache_(), this.poster(""), this.loadTech_(this.options_.techOrder[0], null), this.techCall_("reset"), this.resetControlBarUI_(), Ae(this) && this.trigger("playerreset") }, e.resetControlBarUI_ = function () { this.resetProgressBar_(), this.resetPlaybackRate_(), this.resetVolumeBar_() }, e.resetProgressBar_ = function () { this.currentTime(0); var e = this.controlBar, t = e.durationDisplay, i = e.remainingTimeDisplay; t && t.updateContent(), i && i.updateContent() }, e.resetPlaybackRate_ = function () { this.playbackRate(this.defaultPlaybackRate()), this.handleTechRateChange_() }, e.resetVolumeBar_ = function () { this.volume(1), this.trigger("volumechange") }, e.currentSources = function () { var e = this.currentSource(), t = []; return 0 !== Object.keys(e).length && t.push(e), this.cache_.sources || t }, e.currentSource = function () { return this.cache_.source || {} }, e.currentSrc = function () { return this.currentSource() && this.currentSource().src || "" }, e.currentType = function () { return this.currentSource() && this.currentSource().type || "" }, e.preload = function (e) { return void 0 !== e ? (this.techCall_("setPreload", e), void (this.options_.preload = e)) : this.techGet_("preload") }, e.autoplay = function (e) { if (void 0 === e) return this.options_.autoplay || !1; var t; "string" == typeof e && /(any|play|muted)/.test(e) ? (this.options_.autoplay = e, this.manualAutoplay_(e), t = !1) : this.options_.autoplay = !!e, t = "undefined" == typeof t ? this.options_.autoplay : t, this.tech_ && this.techCall_("setAutoplay", t) }, e.playsinline = function (e) { return void 0 !== e ? (this.techCall_("setPlaysinline", e), this.options_.playsinline = e, this) : this.techGet_("playsinline") }, e.loop = function (e) { return void 0 !== e ? (this.techCall_("setLoop", e), void (this.options_.loop = e)) : this.techGet_("loop") }, e.poster = function (e) { if (void 0 === e) return this.poster_; (e = e || "") !== this.poster_ && (this.poster_ = e, this.techCall_("setPoster", e), this.isPosterFromTech_ = !1, this.trigger("posterchange")) }, e.handleTechPosterChange_ = function () { if ((!this.poster_ || this.options_.techCanOverridePoster) && this.tech_ && this.tech_.poster) { var e = this.tech_.poster() || ""; e !== this.poster_ && (this.poster_ = e, this.isPosterFromTech_ = !0, this.trigger("posterchange")) } }, e.controls = function (e) { if (void 0 === e) return !!this.controls_; e = !!e, this.controls_ !== e && (this.controls_ = e, this.usingNativeControls() && this.techCall_("setControls", e), this.controls_ ? (this.removeClass("vjs-controls-disabled"), this.addClass("vjs-controls-enabled"), this.trigger("controlsenabled"), this.usingNativeControls() || this.addTechControlsListeners_()) : (this.removeClass("vjs-controls-enabled"), this.addClass("vjs-controls-disabled"), this.trigger("controlsdisabled"), this.usingNativeControls() || this.removeTechControlsListeners_())) }, e.usingNativeControls = function (e) { if (void 0 === e) return !!this.usingNativeControls_; e = !!e, this.usingNativeControls_ !== e && (this.usingNativeControls_ = e, this.usingNativeControls_ ? (this.addClass("vjs-using-native-controls"), this.trigger("usingnativecontrols")) : (this.removeClass("vjs-using-native-controls"), this.trigger("usingcustomcontrols"))) }, e.error = function (e) { if (void 0 === e) return this.error_ || null; if (this.options_.suppressNotSupportedError && e && 4 === e.code) { var t = function () { this.error(e) }; return this.options_.suppressNotSupportedError = !1, this.any(["click", "touchstart"], t), void this.one("loadstart", function () { this.off(["click", "touchstart"], t) }) } if (null === e) return this.error_ = e, this.removeClass("vjs-error"), void (this.errorDisplay && this.errorDisplay.close()); this.error_ = new _t(e), this.addClass("vjs-error"), p.error("(CODE:" + this.error_.code + " " + _t.errorTypes[this.error_.code] + ")", this.error_.message, this.error_), this.trigger("error") }, e.reportUserActivity = function (e) { this.userActivity_ = !0 }, e.userActive = function (e) { if (void 0 === e) return this.userActive_; if ((e = !!e) !== this.userActive_) { if (this.userActive_ = e, this.userActive_) return this.userActivity_ = !0, this.removeClass("vjs-user-inactive"), this.addClass("vjs-user-active"), void this.trigger("useractive"); this.tech_ && this.tech_.one("mousemove", function (e) { e.stopPropagation(), e.preventDefault() }), this.userActivity_ = !1, this.removeClass("vjs-user-active"), this.addClass("vjs-user-inactive"), this.trigger("userinactive") } }, e.listenForUserActivity_ = function () { function e(e) { r(), this.clearInterval(t) } var t, i, n, r = ge(this, this.reportUserActivity); this.on("mousedown", function () { r(), this.clearInterval(t), t = this.setInterval(r, 250) }), this.on("mousemove", function (e) { e.screenX === i && e.screenY === n || (i = e.screenX, n = e.screenY, r()) }), this.on("mouseup", e), this.on("mouseleave", e); var a, s = this.getChild("controlBar"); !s || st || Xe || (s.on("mouseenter", function (e) { this.player().cache_.inactivityTimeout = this.player().options_.inactivityTimeout, this.player().options_.inactivityTimeout = 0 }), s.on("mouseleave", function (e) { this.player().options_.inactivityTimeout = this.player().cache_.inactivityTimeout })), this.on("keydown", r), this.on("keyup", r), this.setInterval(function () { if (this.userActivity_) { this.userActivity_ = !1, this.userActive(!0), this.clearTimeout(a); var e = this.options_.inactivityTimeout; e <= 0 || (a = this.setTimeout(function () { this.userActivity_ || this.userActive(!1) }, e)) } }, 250) }, e.playbackRate = function (e) { if (void 0 === e) return this.tech_ && this.tech_.featuresPlaybackRate ? this.cache_.lastPlaybackRate || this.techGet_("playbackRate") : 1; this.techCall_("setPlaybackRate", e) }, e.defaultPlaybackRate = function (e) { return void 0 !== e ? this.techCall_("setDefaultPlaybackRate", e) : this.tech_ && this.tech_.featuresPlaybackRate ? this.techGet_("defaultPlaybackRate") : 1 }, e.isAudio = function (e) { if (void 0 === e) return !!this.isAudio_; this.isAudio_ = !!e }, e.addTextTrack = function (e, t, i) { if (this.tech_) return this.tech_.addTextTrack(e, t, i) }, e.addRemoteTextTrack = function (e, t) { if (this.tech_) return this.tech_.addRemoteTextTrack(e, t) }, e.removeRemoteTextTrack = function (e) { void 0 === e && (e = {}); var t = e.track; if (t = t || e, this.tech_) return this.tech_.removeRemoteTextTrack(t) }, e.getVideoPlaybackQuality = function () { return this.techGet_("getVideoPlaybackQuality") }, e.videoWidth = function () { return this.tech_ && this.tech_.videoWidth && this.tech_.videoWidth() || 0 }, e.videoHeight = function () { return this.tech_ && this.tech_.videoHeight && this.tech_.videoHeight() || 0 }, e.language = function (e) { if (void 0 === e) return this.language_; this.language_ = String(e).toLowerCase() }, e.languages = function () { return Ne(l.prototype.options_.languages, this.languages_) }, e.toJSON = function () { var e = Ne(this.options_), t = e.tracks; e.tracks = []; for (var i = 0; i < t.length; i++) { var n = t[i]; (n = Ne(n)).player = void 0, e.tracks[i] = n } return e }, e.createModal = function (e, t) { var i = this; (t = t || {}).content = e || ""; var n = new xt(this, t); return this.addChild(n), n.on("dispose", function () { i.removeChild(n) }), n.open(), n }, e.updateCurrentBreakpoint_ = function () { if (this.responsive()) for (var e = this.currentBreakpoint(), t = this.currentWidth(), i = 0; i < Hr.length; i++) { var n = Hr[i]; if (t <= this.breakpoints_[n]) { if (e === n) return; e && this.removeClass(Vr[e]), this.addClass(Vr[n]), this.breakpoint_ = n; break } } }, e.removeCurrentBreakpoint_ = function () { var e = this.currentBreakpointClass(); this.breakpoint_ = "", e && this.removeClass(e) }, e.breakpoints = function (e) { return void 0 === e || (this.breakpoint_ = "", this.breakpoints_ = m({}, qr, e), this.updateCurrentBreakpoint_()), m(this.breakpoints_) }, e.responsive = function (e) { return void 0 === e ? this.responsive_ : (e = Boolean(e)) !== this.responsive_ ? ((this.responsive_ = e) ? (this.on("playerresize", this.updateCurrentBreakpoint_), this.updateCurrentBreakpoint_()) : (this.off("playerresize", this.updateCurrentBreakpoint_), this.removeCurrentBreakpoint_()), e) : void 0 }, e.currentBreakpoint = function () { return this.breakpoint_ }, e.currentBreakpointClass = function () { return Vr[this.breakpoint_] || "" }, e.loadMedia = function (e, t) { var i = this; if (e && "object" == typeof e) { this.reset(), this.cache_.media = Ne(e); var n = this.cache_.media, r = n.artwork, a = n.poster, s = n.src, o = n.textTracks; !r && a && (this.cache_.media.artwork = [{ src: a, type: Zi(a) }]), s && this.src(s), a && this.poster(a), Array.isArray(o) && o.forEach(function (e) { return i.addRemoteTextTrack(e, !1) }), this.ready(t) } }, e.getMedia = function () { if (this.cache_.media) return Ne(this.cache_.media); var e = this.poster(), t = { src: this.currentSources(), textTracks: Array.prototype.map.call(this.remoteTextTracks(), function (e) { return { kind: e.kind, label: e.label, language: e.language, src: e.src } }) }; return e && (t.poster = e, t.artwork = [{ src: t.poster, type: Zi(t.poster) }]), t }, l.getTagSettings = function (e) { var t = { sources: [], tracks: [] }, i = P(e), n = i["data-setup"]; if (E(e, "vjs-fill") && (i.fill = !0), E(e, "vjs-fluid") && (i.fluid = !0), null !== n) { var r = Tt(n || "{}"), a = r[0], s = r[1]; a && p.error(a), m(i, s) } if (m(t, i), e.hasChildNodes()) for (var o = e.childNodes, u = 0, l = o.length; u < l; u++) { var c = o[u], h = c.nodeName.toLowerCase(); "source" === h ? t.sources.push(P(c)) : "track" === h && t.tracks.push(P(c)) } return t }, e.flexNotSupported_ = function () { var e = h.createElement("i"); return !("flexBasis" in e.style || "webkitFlexBasis" in e.style || "mozFlexBasis" in e.style || "msFlexBasis" in e.style || "msFlexOrder" in e.style) }, l }(Re); hi.names.forEach(function (e) { var t = hi[e]; Wr.prototype[t.getterName] = function () { return this.tech_ ? this.tech_[t.getterName]() : (this[t.privateName] = this[t.privateName] || new t.ListClass, this[t.privateName]) } }), Wr.players = {}; var zr = y.navigator; Wr.prototype.options_ = { techOrder: Vi.defaultTechOrder_, html5: {}, flash: {}, inactivityTimeout: 2e3, playbackRates: [], liveui: !1, children: ["mediaLoader", "posterImage", "textTrackDisplay", "loadingSpinner", "bigPlayButton", "liveTracker", "controlBar", "errorDisplay", "textTrackSettings", "resizeManager"], language: zr && (zr.languages && zr.languages[0] || zr.userLanguage || zr.language) || "en", languages: {}, notSupportedMessage: "No compatible source was found for this media.", fullscreen: { options: { navigationUI: "hide" } }, breakpoints: {}, responsive: !1 }, ["ended", "seeking", "seekable", "networkState", "readyState"].forEach(function (e) { Wr.prototype[e] = function () { return this.techGet_(e) } }), jr.forEach(function (e) { Wr.prototype["handleTech" + De(e) + "_"] = function () { return this.trigger(e) } }), Re.registerComponent("Player", Wr); var Gr = t(function (i) { function n(e, t) { return i.exports = n = Object.setPrototypeOf || function (e, t) { return e.__proto__ = t, e }, n(e, t) } i.exports = n }); function Xr(e) { return ia.hasOwnProperty(e) } function Kr(e) { return Xr(e) ? ia[e] : void 0 } function Yr(e, t) { e[ta] = e[ta] || {}, e[ta][t] = !0 } function $r(e, t, i) { var n = (i ? "before" : "") + "pluginsetup"; e.trigger(n, t), e.trigger(n + ":" + t.name, t) } function Qr(r, a) { return a.prototype.name = r, function () { $r(this, { name: r, plugin: a, instance: null }, !0); for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++)t[i] = arguments[i]; var n = Zr(a, [this].concat(t)); return this[r] = function () { return n }, $r(this, n.getEventHash()), n } } var Jr = function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(Reflect.construct(Date, [], function () { })), !0 } catch (e) { return !1 } }, Zr = t(function (n) { function r(e, t, i) { return Jr() ? n.exports = r = Reflect.construct : n.exports = r = function (e, t, i) { var n = [null]; n.push.apply(n, t); var r = new (Function.bind.apply(e, n)); return i && Gr(r, i.prototype), r }, r.apply(null, arguments) } n.exports = r }), ea = "plugin", ta = "activePlugins_", ia = {}, na = function () { function i(e) { if (this.constructor === i) throw new Error("Plugin must be sub-classed; not directly instantiated."); this.player = e, xe(this), delete this.trigger, Le(this, this.constructor.defaultState), Yr(e, this.name), this.dispose = ge(this, this.dispose), e.on("dispose", this.dispose) } var e = i.prototype; return e.version = function () { return this.constructor.VERSION }, e.getEventHash = function (e) { return void 0 === e && (e = {}), e.name = this.name, e.plugin = this.constructor, e.instance = this, e }, e.trigger = function (e, t) { return void 0 === t && (t = {}), pe(this.eventBusEl_, e, this.getEventHash(t)) }, e.handleStateChanged = function (e) { }, e.dispose = function () { var e = this.name, t = this.player; this.trigger("dispose"), this.off(), t.off("dispose", this.dispose), t[ta][e] = !1, this.player = this.state = null, t[e] = Qr(e, ia[e]) }, i.isBasic = function (e) { var t = "string" == typeof e ? Kr(e) : e; return "function" == typeof t && !i.prototype.isPrototypeOf(t.prototype) }, i.registerPlugin = function (e, t) { if ("string" != typeof e) throw new Error('Illegal plugin name, "' + e + '", must be a string, was ' + typeof e + "."); if (Xr(e)) p.warn('A plugin named "' + e + '" already exists. You may want to avoid re-registering plugins!'); else if (Wr.prototype.hasOwnProperty(e)) throw new Error('Illegal plugin name, "' + e + '", cannot share a name with an existing player method!'); if ("function" != typeof t) throw new Error('Illegal plugin for "' + e + '", must be a function, was ' + typeof t + "."); return ia[e] = t, e !== ea && (i.isBasic(t) ? Wr.prototype[e] = function (t, i) { function n() { $r(this, { name: t, plugin: i, instance: null }, !0); var e = i.apply(this, arguments); return Yr(this, t), $r(this, { name: t, plugin: i, instance: e }), e } return Object.keys(i).forEach(function (e) { n[e] = i[e] }), n }(e, t) : Wr.prototype[e] = Qr(e, t)), t }, i.deregisterPlugin = function (e) { if (e === ea) throw new Error("Cannot de-register base plugin."); Xr(e) && (delete ia[e], delete Wr.prototype[e]) }, i.getPlugins = function (e) { var i; return void 0 === e && (e = Object.keys(ia)), e.forEach(function (e) { var t = Kr(e); t && ((i = i || {})[e] = t) }), i }, i.getPluginVersion = function (e) { var t = Kr(e); return t && t.VERSION || "" }, i }(); na.getPlugin = Kr, na.BASE_PLUGIN_NAME = ea, na.registerPlugin(ea, na), Wr.prototype.usingPlugin = function (e) { return !!this[ta] && !0 === this[ta][e] }, Wr.prototype.hasPlugin = function (e) { return !!Xr(e) }; var ra = function (e, t) { if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function"); e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), t && Gr(e, t) }, aa = function (e) { return 0 === e.indexOf("#") ? e.slice(1) : e }; function sa(e, i, t) { var n = sa.getPlayer(e); if (n) return i && p.warn('Player "' + e + '" is already initialised. Options will not be applied.'), t && n.ready(t), n; var r = "string" == typeof e ? G("#" + aa(e)) : e; if (!_(r)) throw new TypeError("The element or ID supplied is not valid. (videojs)"); r.ownerDocument.defaultView && r.ownerDocument.body.contains(r) || p.warn("The element supplied is not included in the DOM"), i = i || {}, sa.hooks("beforesetup").forEach(function (e) { var t = e(r, Ne(i)); o(t) && !Array.isArray(t) ? i = Ne(i, t) : p.error("please return an object in beforesetup hooks") }); var a = Re.getComponent("Player"); return n = new a(r, i, t), sa.hooks("setup").forEach(function (e) { return e(n) }), n } if (sa.hooks_ = {}, sa.hooks = function (e, t) { return sa.hooks_[e] = sa.hooks_[e] || [], t && (sa.hooks_[e] = sa.hooks_[e].concat(t)), sa.hooks_[e] }, sa.hook = function (e, t) { sa.hooks(e, t) }, sa.hookOnce = function (i, e) { sa.hooks(i, [].concat(e).map(function (t) { return function e() { return sa.removeHook(i, e), t.apply(void 0, arguments) } })) }, sa.removeHook = function (e, t) { var i = sa.hooks(e).indexOf(t); return !(i <= -1) && (sa.hooks_[e] = sa.hooks_[e].slice(), sa.hooks_[e].splice(i, 1), !0) }, !0 !== y.VIDEOJS_NO_DYNAMIC_STYLE && v()) { var oa = G(".vjs-styles-defaults"); if (!oa) { oa = Z("vjs-styles-defaults"); var ua = G("head"); ua && ua.insertBefore(oa, ua.firstChild), ee(oa, "\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid {\n padding-top: 56.25%\n }\n ") } } Q(1, sa), sa.VERSION = d, sa.options = Wr.prototype.options_, sa.getPlayers = function () { return Wr.players }, sa.getPlayer = function (e) { var t, i = Wr.players; if ("string" == typeof e) { var n = aa(e), r = i[n]; if (r) return r; t = G("#" + n) } else t = e; if (_(t)) { var a = t, s = a.player, o = a.playerId; if (s || i[o]) return s || i[o] } }, sa.getAllPlayers = function () { return Object.keys(Wr.players).map(function (e) { return Wr.players[e] }).filter(Boolean) }, sa.players = Wr.players, sa.getComponent = Re.getComponent, sa.registerComponent = function (e, t) { Vi.isTech(t) && p.warn("The " + e + " tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"), Re.registerComponent.call(Re, e, t) }, sa.getTech = Vi.getTech, sa.registerTech = Vi.registerTech, sa.use = function (e, t) { qi[e] = qi[e] || [], qi[e].push(t) }, Object.defineProperty(sa, "middleware", { value: {}, writeable: !1, enumerable: !0 }), Object.defineProperty(sa.middleware, "TERMINATOR", { value: zi, writeable: !1, enumerable: !0 }), sa.browser = ut, sa.TOUCH_ENABLED = nt, sa.extend = function (e, t) { void 0 === t && (t = {}); var i = function () { e.apply(this, arguments) }, n = {}; for (var r in "object" == typeof t ? (t.constructor !== Object.prototype.constructor && (i = t.constructor), n = t) : "function" == typeof t && (i = t), ra(i, e), e && (i.super_ = e), n) n.hasOwnProperty(r) && (i.prototype[r] = n[r]); return i }, sa.mergeOptions = Ne, sa.bind = ge, sa.registerPlugin = na.registerPlugin, sa.deregisterPlugin = na.deregisterPlugin, sa.plugin = function (e, t) { return p.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"), na.registerPlugin(e, t) }, sa.getPlugins = na.getPlugins, sa.getPlugin = na.getPlugin, sa.getPluginVersion = na.getPluginVersion, sa.addLanguage = function (e, t) { var i; return e = ("" + e).toLowerCase(), sa.options.languages = Ne(sa.options.languages, ((i = {})[e] = t, i)), sa.options.languages[e] }, sa.log = p, sa.createLogger = f, sa.createTimeRange = sa.createTimeRanges = ht, sa.formatTime = yn, sa.setFormatTime = function (e) { vn = e }, sa.resetFormatTime = function () { vn = gn }, sa.parseUrl = Nt, sa.isCrossOrigin = Mt, sa.EventTarget = ye, sa.on = he, sa.one = fe, sa.off = de, sa.trigger = pe, sa.xhr = Jt, sa.TextTrack = ai, sa.AudioTrack = si, sa.VideoTrack = oi, ["isEl", "isTextNode", "createEl", "hasClass", "addClass", "removeClass", "toggleClass", "setAttributes", "getAttributes", "emptyEl", "appendContent", "insertContent"].forEach(function (e) { sa[e] = function () { return p.warn("videojs." + e + "() is deprecated; use videojs.dom." + e + "() instead"), K[e].apply(null, arguments) } }), sa.computedStyle = n, sa.dom = K, sa.url = Kt, sa.defineLazyProperty = Nr; var la = t(function (e, t) { var i, c, n, r, h; i = /^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/, c = /^([^\/?#]*)(.*)$/, n = /(?:\/|^)\.(?=\/)/g, r = /(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g, h = { buildAbsoluteURL: function (e, t, i) { if (i = i || {}, e = e.trim(), !(t = t.trim())) { if (!i.alwaysNormalize) return e; var n = h.parseURL(e); if (!n) throw new Error("Error trying to parse base URL."); return n.path = h.normalizePath(n.path), h.buildURLFromParts(n) } var r = h.parseURL(t); if (!r) throw new Error("Error trying to parse relative URL."); if (r.scheme) return i.alwaysNormalize ? (r.path = h.normalizePath(r.path), h.buildURLFromParts(r)) : t; var a = h.parseURL(e); if (!a) throw new Error("Error trying to parse base URL."); if (!a.netLoc && a.path && "/" !== a.path[0]) { var s = c.exec(a.path); a.netLoc = s[1], a.path = s[2] } a.netLoc && !a.path && (a.path = "/"); var o = { scheme: a.scheme, netLoc: r.netLoc, path: null, params: r.params, query: r.query, fragment: r.fragment }; if (!r.netLoc && (o.netLoc = a.netLoc, "/" !== r.path[0])) if (r.path) { var u = a.path, l = u.substring(0, u.lastIndexOf("/") + 1) + r.path; o.path = h.normalizePath(l) } else o.path = a.path, r.params || (o.params = a.params, r.query || (o.query = a.query)); return null === o.path && (o.path = i.alwaysNormalize ? h.normalizePath(r.path) : r.path), h.buildURLFromParts(o) }, parseURL: function (e) { var t = i.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(n, ""); e.length !== (e = e.replace(r, "")).length;); return e.split("").reverse().join("") }, buildURLFromParts: function (e) { return e.scheme + e.netLoc + e.path + e.params + e.query + e.fragment } }, e.exports = h }); +/*! @name m3u8-parser @version 4.4.0 @license Apache-2.0 */function ca() { return (ca = Object.assign || function (e) { for (var t = 1; t < arguments.length; t++) { var i = arguments[t]; for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && (e[n] = i[n]) } return e }).apply(this, arguments) } function ha(e, t) { e.prototype = Object.create(t.prototype), (e.prototype.constructor = e).__proto__ = t } function da(e) { for (var t, i = e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')), n = {}, r = i.length; r--;)"" !== i[r] && ((t = /([^=]*)=(.*)/.exec(i[r]).slice(1))[0] = t[0].replace(/^\s+|\s+$/g, ""), t[1] = t[1].replace(/^\s+|\s+$/g, ""), t[1] = t[1].replace(/^['"](.*)['"]$/g, "$1"), n[t[0]] = t[1]); return n } var pa = function () { function e() { this.listeners = {} } var t = e.prototype; return t.on = function (e, t) { this.listeners[e] || (this.listeners[e] = []), this.listeners[e].push(t) }, t.off = function (e, t) { if (!this.listeners[e]) return !1; var i = this.listeners[e].indexOf(t); return this.listeners[e].splice(i, 1), -1 < i }, t.trigger = function (e, t) { var i, n, r, a = this.listeners[e]; if (a) if (2 === arguments.length) for (n = a.length, i = 0; i < n; ++i)a[i].call(this, t); else for (r = Array.prototype.slice.call(arguments, 1), n = a.length, i = 0; i < n; ++i)a[i].apply(this, r) }, t.dispose = function () { this.listeners = {} }, t.pipe = function (t) { this.on("data", function (e) { t.push(e) }) }, e }(), fa = function (t) { function e() { var e; return (e = t.call(this) || this).buffer = "", e } return ha(e, t), e.prototype.push = function (e) { var t; for (this.buffer += e, t = this.buffer.indexOf("\n"); -1 < t; t = this.buffer.indexOf("\n"))this.trigger("data", this.buffer.substring(0, t)), this.buffer = this.buffer.substring(t + 1) }, e }(pa), ma = function (t) { function e() { var e; return (e = t.call(this) || this).customParsers = [], e.tagMappers = [], e } ha(e, t); var i = e.prototype; return i.push = function (n) { var u, l, c = this; 0 !== (n = n.trim()).length && ("#" === n[0] ? this.tagMappers.reduce(function (e, t) { var i = t(n); return i === n ? e : e.concat([i]) }, [n]).forEach(function (e) { for (var t = 0; t < c.customParsers.length; t++)if (c.customParsers[t].call(c, e)) return; if (0 === e.indexOf("#EXT")) if (e = e.replace("\r", ""), u = /^#EXTM3U/.exec(e)) c.trigger("data", { type: "tag", tagType: "m3u" }); else { if (u = /^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(e)) return l = { type: "tag", tagType: "inf" }, u[1] && (l.duration = parseFloat(u[1])), u[2] && (l.title = u[2]), void c.trigger("data", l); if (u = /^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(e)) return l = { type: "tag", tagType: "targetduration" }, u[1] && (l.duration = parseInt(u[1], 10)), void c.trigger("data", l); if (u = /^#ZEN-TOTAL-DURATION:?([0-9.]*)?/.exec(e)) return l = { type: "tag", tagType: "totalduration" }, u[1] && (l.duration = parseInt(u[1], 10)), void c.trigger("data", l); if (u = /^#EXT-X-VERSION:?([0-9.]*)?/.exec(e)) return l = { type: "tag", tagType: "version" }, u[1] && (l.version = parseInt(u[1], 10)), void c.trigger("data", l); if (u = /^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(e)) return l = { type: "tag", tagType: "media-sequence" }, u[1] && (l.number = parseInt(u[1], 10)), void c.trigger("data", l); if (u = /^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(e)) return l = { type: "tag", tagType: "discontinuity-sequence" }, u[1] && (l.number = parseInt(u[1], 10)), void c.trigger("data", l); if (u = /^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(e)) return l = { type: "tag", tagType: "playlist-type" }, u[1] && (l.playlistType = u[1]), void c.trigger("data", l); if (u = /^#EXT-X-BYTERANGE:?([0-9.]*)?@?([0-9.]*)?/.exec(e)) return l = { type: "tag", tagType: "byterange" }, u[1] && (l.length = parseInt(u[1], 10)), u[2] && (l.offset = parseInt(u[2], 10)), void c.trigger("data", l); if (u = /^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(e)) return l = { type: "tag", tagType: "allow-cache" }, u[1] && (l.allowed = !/NO/.test(u[1])), void c.trigger("data", l); if (u = /^#EXT-X-MAP:?(.*)$/.exec(e)) { if (l = { type: "tag", tagType: "map" }, u[1]) { var i = da(u[1]); if (i.URI && (l.uri = i.URI), i.BYTERANGE) { var n = i.BYTERANGE.split("@"), r = n[0], a = n[1]; l.byterange = {}, r && (l.byterange.length = parseInt(r, 10)), a && (l.byterange.offset = parseInt(a, 10)) } } c.trigger("data", l) } else if (u = /^#EXT-X-STREAM-INF:?(.*)$/.exec(e)) { if (l = { type: "tag", tagType: "stream-inf" }, u[1]) { if (l.attributes = da(u[1]), l.attributes.RESOLUTION) { var s = l.attributes.RESOLUTION.split("x"), o = {}; s[0] && (o.width = parseInt(s[0], 10)), s[1] && (o.height = parseInt(s[1], 10)), l.attributes.RESOLUTION = o } l.attributes.BANDWIDTH && (l.attributes.BANDWIDTH = parseInt(l.attributes.BANDWIDTH, 10)), l.attributes["PROGRAM-ID"] && (l.attributes["PROGRAM-ID"] = parseInt(l.attributes["PROGRAM-ID"], 10)) } c.trigger("data", l) } else { if (u = /^#EXT-X-MEDIA:?(.*)$/.exec(e)) return l = { type: "tag", tagType: "media" }, u[1] && (l.attributes = da(u[1])), void c.trigger("data", l); if (u = /^#EXT-X-ENDLIST/.exec(e)) c.trigger("data", { type: "tag", tagType: "endlist" }); else if (u = /^#EXT-X-DISCONTINUITY/.exec(e)) c.trigger("data", { type: "tag", tagType: "discontinuity" }); else { if (u = /^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(e)) return l = { type: "tag", tagType: "program-date-time" }, u[1] && (l.dateTimeString = u[1], l.dateTimeObject = new Date(u[1])), void c.trigger("data", l); if (u = /^#EXT-X-KEY:?(.*)$/.exec(e)) return l = { type: "tag", tagType: "key" }, u[1] && (l.attributes = da(u[1]), l.attributes.IV && ("0x" === l.attributes.IV.substring(0, 2).toLowerCase() && (l.attributes.IV = l.attributes.IV.substring(2)), l.attributes.IV = l.attributes.IV.match(/.{8}/g), l.attributes.IV[0] = parseInt(l.attributes.IV[0], 16), l.attributes.IV[1] = parseInt(l.attributes.IV[1], 16), l.attributes.IV[2] = parseInt(l.attributes.IV[2], 16), l.attributes.IV[3] = parseInt(l.attributes.IV[3], 16), l.attributes.IV = new Uint32Array(l.attributes.IV))), void c.trigger("data", l); if (u = /^#EXT-X-START:?(.*)$/.exec(e)) return l = { type: "tag", tagType: "start" }, u[1] && (l.attributes = da(u[1]), l.attributes["TIME-OFFSET"] = parseFloat(l.attributes["TIME-OFFSET"]), l.attributes.PRECISE = /YES/.test(l.attributes.PRECISE)), void c.trigger("data", l); if (u = /^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(e)) return l = { type: "tag", tagType: "cue-out-cont" }, u[1] ? l.data = u[1] : l.data = "", void c.trigger("data", l); if (u = /^#EXT-X-CUE-OUT:?(.*)?$/.exec(e)) return l = { type: "tag", tagType: "cue-out" }, u[1] ? l.data = u[1] : l.data = "", void c.trigger("data", l); if (u = /^#EXT-X-CUE-IN:?(.*)?$/.exec(e)) return l = { type: "tag", tagType: "cue-in" }, u[1] ? l.data = u[1] : l.data = "", void c.trigger("data", l); c.trigger("data", { type: "tag", data: e.slice(4) }) } } } else c.trigger("data", { type: "comment", text: e.slice(1) }) }) : this.trigger("data", { type: "uri", uri: n })) }, i.addParser = function (e) { var t = this, i = e.expression, n = e.customType, r = e.dataParser, a = e.segment; "function" != typeof r && (r = function (e) { return e }), this.customParsers.push(function (e) { if (i.exec(e)) return t.trigger("data", { type: "custom", data: r(e), customType: n, segment: a }), !0 }) }, i.addTagMapper = function (e) { var t = e.expression, i = e.map; this.tagMappers.push(function (e) { return t.test(e) ? i(e) : e }) }, e }(pa); var ga = function (t) { function e() { var e; (e = t.call(this) || this).lineStream = new fa, e.parseStream = new ma, e.lineStream.pipe(e.parseStream); var r, a, s = function (e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e }(e), o = [], u = {}, l = { AUDIO: {}, VIDEO: {}, "CLOSED-CAPTIONS": {}, SUBTITLES: {} }, c = 0; return e.manifest = { allowCache: !0, discontinuityStarts: [], segments: [] }, e.parseStream.on("data", function (t) { var i, n; ({ tag: function () { ({ "allow-cache": function () { this.manifest.allowCache = t.allowed, "allowed" in t || (this.trigger("info", { message: "defaulting allowCache to YES" }), this.manifest.allowCache = !0) }, byterange: function () { var e = {}; "length" in t && ((u.byterange = e).length = t.length, "offset" in t || (this.trigger("info", { message: "defaulting offset to zero" }), t.offset = 0)), "offset" in t && ((u.byterange = e).offset = t.offset) }, endlist: function () { this.manifest.endList = !0 }, inf: function () { "mediaSequence" in this.manifest || (this.manifest.mediaSequence = 0, this.trigger("info", { message: "defaulting media sequence to zero" })), "discontinuitySequence" in this.manifest || (this.manifest.discontinuitySequence = 0, this.trigger("info", { message: "defaulting discontinuity sequence to zero" })), 0 < t.duration && (u.duration = t.duration), 0 === t.duration && (u.duration = .01, this.trigger("info", { message: "updating zero segment duration to a small value" })), this.manifest.segments = o }, key: function () { if (t.attributes) if ("NONE" !== t.attributes.METHOD) if (t.attributes.URI) { if ("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" === t.attributes.KEYFORMAT) { return -1 === ["SAMPLE-AES", "SAMPLE-AES-CTR", "SAMPLE-AES-CENC"].indexOf(t.attributes.METHOD) ? void this.trigger("warn", { message: "invalid key method provided for Widevine" }) : ("SAMPLE-AES-CENC" === t.attributes.METHOD && this.trigger("warn", { message: "SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead" }), "data:text/plain;base64," !== t.attributes.URI.substring(0, 23) ? void this.trigger("warn", { message: "invalid key URI provided for Widevine" }) : t.attributes.KEYID && "0x" === t.attributes.KEYID.substring(0, 2) ? void (this.manifest.contentProtection = { "com.widevine.alpha": { attributes: { schemeIdUri: t.attributes.KEYFORMAT, keyId: t.attributes.KEYID.substring(2) }, pssh: function (e) { for (var t = y.atob(e || ""), i = new Uint8Array(t.length), n = 0; n < t.length; n++)i[n] = t.charCodeAt(n); return i }(t.attributes.URI.split(",")[1]) } }) : void this.trigger("warn", { message: "invalid key ID provided for Widevine" })) } t.attributes.METHOD || this.trigger("warn", { message: "defaulting key method to AES-128" }), a = { method: t.attributes.METHOD || "AES-128", uri: t.attributes.URI }, "undefined" != typeof t.attributes.IV && (a.iv = t.attributes.IV) } else this.trigger("warn", { message: "ignoring key declaration without URI" }); else a = null; else this.trigger("warn", { message: "ignoring key declaration without attribute list" }) }, "media-sequence": function () { isFinite(t.number) ? this.manifest.mediaSequence = t.number : this.trigger("warn", { message: "ignoring invalid media sequence: " + t.number }) }, "discontinuity-sequence": function () { isFinite(t.number) ? (this.manifest.discontinuitySequence = t.number, c = t.number) : this.trigger("warn", { message: "ignoring invalid discontinuity sequence: " + t.number }) }, "playlist-type": function () { /VOD|EVENT/.test(t.playlistType) ? this.manifest.playlistType = t.playlistType : this.trigger("warn", { message: "ignoring unknown playlist type: " + t.playlist }) }, map: function () { r = {}, t.uri && (r.uri = t.uri), t.byterange && (r.byterange = t.byterange) }, "stream-inf": function () { this.manifest.playlists = o, this.manifest.mediaGroups = this.manifest.mediaGroups || l, t.attributes ? (u.attributes || (u.attributes = {}), ca(u.attributes, t.attributes)) : this.trigger("warn", { message: "ignoring empty stream-inf attributes" }) }, media: function () { if (this.manifest.mediaGroups = this.manifest.mediaGroups || l, t.attributes && t.attributes.TYPE && t.attributes["GROUP-ID"] && t.attributes.NAME) { var e = this.manifest.mediaGroups[t.attributes.TYPE]; e[t.attributes["GROUP-ID"]] = e[t.attributes["GROUP-ID"]] || {}, i = e[t.attributes["GROUP-ID"]], (n = { default: /yes/i.test(t.attributes.DEFAULT) }).default ? n.autoselect = !0 : n.autoselect = /yes/i.test(t.attributes.AUTOSELECT), t.attributes.LANGUAGE && (n.language = t.attributes.LANGUAGE), t.attributes.URI && (n.uri = t.attributes.URI), t.attributes["INSTREAM-ID"] && (n.instreamId = t.attributes["INSTREAM-ID"]), t.attributes.CHARACTERISTICS && (n.characteristics = t.attributes.CHARACTERISTICS), t.attributes.FORCED && (n.forced = /yes/i.test(t.attributes.FORCED)), i[t.attributes.NAME] = n } else this.trigger("warn", { message: "ignoring incomplete or missing media group" }) }, discontinuity: function () { c += 1, u.discontinuity = !0, this.manifest.discontinuityStarts.push(o.length) }, "program-date-time": function () { "undefined" == typeof this.manifest.dateTimeString && (this.manifest.dateTimeString = t.dateTimeString, this.manifest.dateTimeObject = t.dateTimeObject), u.dateTimeString = t.dateTimeString, u.dateTimeObject = t.dateTimeObject }, targetduration: function () { !isFinite(t.duration) || t.duration < 0 ? this.trigger("warn", { message: "ignoring invalid target duration: " + t.duration }) : this.manifest.targetDuration = t.duration }, totalduration: function () { !isFinite(t.duration) || t.duration < 0 ? this.trigger("warn", { message: "ignoring invalid total duration: " + t.duration }) : this.manifest.totalDuration = t.duration }, start: function () { t.attributes && !isNaN(t.attributes["TIME-OFFSET"]) ? this.manifest.start = { timeOffset: t.attributes["TIME-OFFSET"], precise: t.attributes.PRECISE } : this.trigger("warn", { message: "ignoring start declaration without appropriate attribute list" }) }, "cue-out": function () { u.cueOut = t.data }, "cue-out-cont": function () { u.cueOutCont = t.data }, "cue-in": function () { u.cueIn = t.data } }[t.tagType] || function () { }).call(s) }, uri: function () { u.uri = t.uri, o.push(u), !this.manifest.targetDuration || "duration" in u || (this.trigger("warn", { message: "defaulting segment duration to the target duration" }), u.duration = this.manifest.targetDuration), a && (u.key = a), u.timeline = c, r && (u.map = r), u = {} }, comment: function () { }, custom: function () { t.segment ? (u.custom = u.custom || {}, u.custom[t.customType] = t.data) : (this.manifest.custom = this.manifest.custom || {}, this.manifest.custom[t.customType] = t.data) } })[t.type].call(s) }), e } ha(e, t); var i = e.prototype; return i.push = function (e) { this.lineStream.push(e) }, i.end = function () { this.lineStream.push("\n") }, i.addParser = function (e) { this.parseStream.addParser(e) }, i.addTagMapper = function (e) { this.parseStream.addTagMapper(e) }, e }(pa); function va(e) { return e && "object" == typeof e && "default" in e ? e.default : e } var ya = va(la), _a = va(y), ba = function (e, t) { return /^[a-z]+:/i.test(t) ? t : (/\/\//i.test(e) || (e = ya.buildAbsoluteURL(_a.location && _a.location.href || "", e)), ya.buildAbsoluteURL(e, t)) }; var Ta, Sa = (Ta = y) && "object" == typeof Ta && "default" in Ta ? Ta.default : Ta; var ka = function (e) { for (var t = function (e) { return Sa.atob ? Sa.atob(e) : Buffer.from(e, "base64").toString("binary") }(e), i = new Uint8Array(t.length), n = 0; n < t.length; n++)i[n] = t.charCodeAt(n); return i }, Ca = /[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, Ea = new RegExp("[\\-\\.0-9" + Ca.source.slice(1, -1) + "\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"), wa = new RegExp("^" + Ca.source + Ea.source + "*(?::" + Ca.source + Ea.source + "*)?$"), Aa = 0, Ia = 1, xa = 2, Pa = 3, La = 4, Oa = 5, Da = 6, Na = 7; function Ra() { } function Ua(e, t) { return t.lineNumber = e.lineNumber, t.columnNumber = e.columnNumber, t } function Ma(e, t, i, n, r, a) { for (var s, o = ++t, u = Aa; ;) { var l = e.charAt(o); switch (l) { case "=": if (u === Ia) s = e.slice(t, o), u = Pa; else { if (u !== xa) throw new Error("attribute equal must after attrName"); u = Pa } break; case "'": case '"': if (u === Pa || u === Ia) { if (u === Ia && (a.warning('attribute value must after "="'), s = e.slice(t, o)), t = o + 1, !(0 < (o = e.indexOf(l, t)))) throw new Error("attribute value no end '" + l + "' match"); c = e.slice(t, o).replace(/&#?\w+;/g, r), i.add(s, c, t - 1), u = Oa } else { if (u != La) throw new Error('attribute value must after "="'); c = e.slice(t, o).replace(/&#?\w+;/g, r), i.add(s, c, t), a.warning('attribute "' + s + '" missed start quot(' + l + ")!!"), t = o + 1, u = Oa } break; case "/": switch (u) { case Aa: i.setTagName(e.slice(t, o)); case Oa: case Da: case Na: u = Na, i.closed = !0; case La: case Ia: case xa: break; default: throw new Error("attribute invalid close char('/')") }break; case "": return a.error("unexpected end of input"), u == Aa && i.setTagName(e.slice(t, o)), o; case ">": switch (u) { case Aa: i.setTagName(e.slice(t, o)); case Oa: case Da: case Na: break; case La: case Ia: "/" === (c = e.slice(t, o)).slice(-1) && (i.closed = !0, c = c.slice(0, -1)); case xa: u === xa && (c = s), u == La ? (a.warning('attribute "' + c + '" missed quot(")!!'), i.add(s, c.replace(/&#?\w+;/g, r), t)) : ("http://www.w3.org/1999/xhtml" === n[""] && c.match(/^(?:disabled|checked|selected)$/i) || a.warning('attribute "' + c + '" missed value!! "' + c + '" instead!!'), i.add(c, c, t)); break; case Pa: throw new Error("attribute value missed!!") }return o; case "€": l = " "; default: if (l <= " ") switch (u) { case Aa: i.setTagName(e.slice(t, o)), u = Da; break; case Ia: s = e.slice(t, o), u = xa; break; case La: var c = e.slice(t, o).replace(/&#?\w+;/g, r); a.warning('attribute "' + c + '" missed quot(")!!'), i.add(s, c, t); case Oa: u = Da } else switch (u) { case xa: i.tagName; "http://www.w3.org/1999/xhtml" === n[""] && s.match(/^(?:disabled|checked|selected)$/i) || a.warning('attribute "' + s + '" missed value!! "' + s + '" instead2!!'), i.add(s, s, t), t = o, u = Ia; break; case Oa: a.warning('attribute space is required"' + s + '"!!'); case Da: u = Ia, t = o; break; case Pa: u = La, t = o; break; case Na: throw new Error("elements closed character '/' and '>' must be connected to") } }o++ } } function Ba(e, t, i) { for (var n = e.tagName, r = null, a = e.length; a--;) { var s = e[a], o = s.qName, u = s.value; if (0 < (d = o.indexOf(":"))) var l = s.prefix = o.slice(0, d), c = o.slice(d + 1), h = "xmlns" === l && c; else l = null, h = "xmlns" === (c = o) && ""; s.localName = c, !1 !== h && (null == r && (r = {}, Ha(i, i = {})), i[h] = r[h] = u, s.uri = "http://www.w3.org/2000/xmlns/", t.startPrefixMapping(h, u)) } for (a = e.length; a--;) { (l = (s = e[a]).prefix) && ("xml" === l && (s.uri = "http://www.w3.org/XML/1998/namespace"), "xmlns" !== l && (s.uri = i[l || ""])) } var d; c = 0 < (d = n.indexOf(":")) ? (l = e.prefix = n.slice(0, d), e.localName = n.slice(d + 1)) : (l = null, e.localName = n); var p = e.uri = i[l || ""]; if (t.startElement(p, c, n, e), !e.closed) return e.currentNSMap = i, e.localNSMap = r, !0; if (t.endElement(p, c, n), r) for (l in r) t.endPrefixMapping(l) } function ja(e, t, i, n, r) { if (/^(?:script|textarea)$/i.test(i)) { var a = e.indexOf("", t), s = e.substring(t + 1, a); if (/[&<]/.test(s)) return /^script$/i.test(i) || (s = s.replace(/&#?\w+;/g, n)), r.characters(s, 0, s.length), a } return t + 1 } function Fa(e, t, i, n) { var r = n[i]; return null == r && ((r = e.lastIndexOf("")) < t && (r = e.lastIndexOf("", t + 9); return i.startCDATA(), i.characters(e, t + 9, r - t - 9), i.endCDATA(), r + 3 } var a = function (e, t) { var i, n = [], r = /'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g; r.lastIndex = t, r.exec(e); for (; i = r.exec(e);)if (n.push(i), i[1]) return n }(e, t), s = a.length; if (1 < s && /!doctype/i.test(a[0][0])) { var o = a[1][0], u = 3 < s && /^public$/i.test(a[2][0]) && a[3][0], l = 4 < s && a[4][0], c = a[s - 1]; return i.startDTD(o, u && u.replace(/^(['"])(.*?)\1$/, "$2"), l && l.replace(/^(['"])(.*?)\1$/, "$2")), i.endDTD(), c.index + c[0].length } }return -1 } function qa(e, t, i) { var n = e.indexOf("?>", t); if (n) { var r = e.substring(t, n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/); if (r) { r[0].length; return i.processingInstruction(r[1], r[2]), n + 2 } return -1 } return -1 } function Wa(e) { } function za(e, t) { return e.__proto__ = t, e } Ra.prototype = { parse: function (e, t, i) { var n = this.domBuilder; n.startDocument(), Ha(t, t = {}), function (i, e, n, r, a) { function s(e) { var t = e.slice(1, -1); return t in n ? n[t] : "#" === t.charAt(0) ? function (e) { if (65535 < e) { var t = 55296 + ((e -= 65536) >> 10), i = 56320 + (1023 & e); return String.fromCharCode(t, i) } return String.fromCharCode(e) }(parseInt(t.substr(1).replace("x", "0x"))) : (a.error("entity not found:" + e), e) } function t(e) { if (f < e) { var t = i.substring(f, e).replace(/&#?\w+;/g, s); h && o(f), r.characters(t, 0, e - f), f = e } } function o(e, t) { for (; l <= e && (t = c.exec(i));)u = t.index, l = u + t[0].length, h.lineNumber++; h.columnNumber = e - u + 1 } var u = 0, l = 0, c = /.*(?:\r\n?|\n)|.*$/g, h = r.locator, d = [{ currentNSMap: e }], p = {}, f = 0; for (; ;) { try { var m = i.indexOf("<", f); if (m < 0) { if (!i.substr(f).match(/^\s*$/)) { var g = r.doc, v = g.createTextNode(i.substr(f)); g.appendChild(v), r.currentElement = v } return } switch (f < m && t(m), i.charAt(m + 1)) { case "/": var y = i.indexOf(">", m + 3), _ = i.substring(m + 2, y), b = d.pop(); y < 0 ? (_ = i.substring(m + 2).replace(/[\s<].*/, ""), a.error("end tag name: " + _ + " is not complete:" + b.tagName), y = m + 1 + _.length) : _.match(/\s" == e && ">") || "&" == e && "&" || '"' == e && """ || "&#" + e.charCodeAt() + ";" } function Es(e, t) { if (t(e)) return !0; if (e = e.firstChild) do { if (Es(e, t)) return !0 } while (e = e.nextSibling) } function ws() { } function As(e, t, i) { e && e._inc++, "http://www.w3.org/2000/xmlns/" == i.namespaceURI && delete t._nsMap[i.prefix ? i.localName : ""] } function Is(e, t, i) { if (e && e._inc) { e._inc++; var n = t.childNodes; if (i) n[n.length++] = i; else { for (var r = t.firstChild, a = 0; r;)r = (n[a++] = r).nextSibling; n.length = a } } } function xs(e, t) { var i = t.previousSibling, n = t.nextSibling; return i ? i.nextSibling = n : e.firstChild = n, n ? n.previousSibling = i : e.lastChild = i, Is(e.ownerDocument, e), t } function Ps(e, t, i) { var n = t.parentNode; if (n && n.removeChild(t), t.nodeType === os) { var r = t.firstChild; if (null == r) return t; var a = t.lastChild } else r = a = t; var s = i ? i.previousSibling : e.lastChild; for (r.previousSibling = s, a.nextSibling = i, s ? s.nextSibling = r : e.firstChild = r, null == i ? e.lastChild = a : i.previousSibling = a; r.parentNode = e, r !== a && (r = r.nextSibling);); return Is(e.ownerDocument || e, e), t.nodeType == os && (t.firstChild = t.lastChild = null), t } function Ls() { this._nsMap = {} } function Os() { } function Ds() { } function Ns() { } function Rs() { } function Us() { } function Ms() { } function Bs() { } function js() { } function Fs() { } function Hs() { } function Vs() { } function qs() { } function Ws(e, t) { var i = [], n = 9 == this.nodeType ? this.documentElement : this, r = n.prefix, a = n.namespaceURI; if (a && null == r && null == (r = n.lookupPrefix(a))) var s = [{ namespace: a, prefix: null }]; return Gs(this, i, e, t, s), i.join("") } function zs(e, t, i) { var n = e.prefix || "", r = e.namespaceURI; if (!n && !r) return !1; if ("xml" === n && "http://www.w3.org/XML/1998/namespace" === r || "http://www.w3.org/2000/xmlns/" == r) return !1; for (var a = i.length; a--;) { var s = i[a]; if (s.prefix == n) return s.namespace != r } return !0 } function Gs(e, t, i, n, r) { if (n) { if (!(e = n(e))) return; if ("string" == typeof e) return void t.push(e) } switch (e.nodeType) { case Qa: r = r || []; var a = e.attributes, s = a.length, o = e.firstChild, u = e.tagName; i = Ya === e.namespaceURI || i, t.push("<", u); for (var l = 0; l < s; l++) { "xmlns" == (c = a.item(l)).prefix ? r.push({ prefix: c.localName, namespace: c.value }) : "xmlns" == c.nodeName && r.push({ prefix: "", namespace: c.value }) } for (l = 0; l < s; l++) { var c; if (zs(c = a.item(l), 0, r)) { var h = c.prefix || "", d = c.namespaceURI, p = h ? " xmlns:" + h : " xmlns"; t.push(p, '="', d, '"'), r.push({ prefix: h, namespace: d }) } Gs(c, t, i, n, r) } if (zs(e, 0, r)) { h = e.prefix || "", d = e.namespaceURI, p = h ? " xmlns:" + h : " xmlns"; t.push(p, '="', d, '"'), r.push({ prefix: h, namespace: d }) } if (o || i && !/^(?:meta|link|img|br|hr|input)$/i.test(u)) { if (t.push(">"), i && /^script$/i.test(u)) for (; o;)o.data ? t.push(o.data) : Gs(o, t, i, n, r), o = o.nextSibling; else for (; o;)Gs(o, t, i, n, r), o = o.nextSibling; t.push("") } else t.push("/>"); return; case as: case os: for (o = e.firstChild; o;)Gs(o, t, i, n, r), o = o.nextSibling; return; case Ja: return t.push(" ", e.name, '="', e.value.replace(/[<&"]/g, Cs), '"'); case Za: return t.push(e.data.replace(/[<&]/g, Cs)); case es: return t.push(""); case rs: return t.push("\x3c!--", e.data, "--\x3e"); case ss: var f = e.publicId, m = e.systemId; if (t.push("'); else if (m && "." != m) t.push(' SYSTEM "', m, '">'); else { var g = e.internalSubset; g && t.push(" [", g, "]"), t.push(">") } return; case ns: return t.push(""); case ts: return t.push("&", e.nodeName, ";"); default: t.push("??", e.nodeName) } } function Xs(e, t, i) { e[t] = i } fs.prototype = Error.prototype, Xa(ls, fs), ms.prototype = { length: 0, item: function (e) { return this[e] || null }, toString: function (e, t) { for (var i = [], n = 0; n < this.length; n++)Gs(this[n], i, e, t); return i.join("") } }, gs.prototype.item = function (e) { return vs(this), this[e] }, Ka(gs, ms), ys.prototype = { length: 0, item: ms.prototype.item, getNamedItem: function (e) { for (var t = this.length; t--;) { var i = this[t]; if (i.nodeName == e) return i } }, setNamedItem: function (e) { var t = e.ownerElement; if (t && t != this._ownerElement) throw new fs(ps); var i = this.getNamedItem(e.nodeName); return bs(this._ownerElement, this, e, i), i }, setNamedItemNS: function (e) { var t, i = e.ownerElement; if (i && i != this._ownerElement) throw new fs(ps); return t = this.getNamedItemNS(e.namespaceURI, e.localName), bs(this._ownerElement, this, e, t), t }, removeNamedItem: function (e) { var t = this.getNamedItem(e); return Ts(this._ownerElement, this, t), t }, removeNamedItemNS: function (e, t) { var i = this.getNamedItemNS(e, t); return Ts(this._ownerElement, this, i), i }, getNamedItemNS: function (e, t) { for (var i = this.length; i--;) { var n = this[i]; if (n.localName == t && n.namespaceURI == e) return n } return null } }, Ss.prototype = { hasFeature: function (e, t) { var i = this._features[e.toLowerCase()]; return !(!i || t && !(t in i)) }, createDocument: function (e, t, i) { var n = new ws; if (n.implementation = this, n.childNodes = new ms, (n.doctype = i) && n.appendChild(i), t) { var r = n.createElementNS(e, t); n.appendChild(r) } return n }, createDocumentType: function (e, t, i) { var n = new Ms; return n.name = e, n.nodeName = e, n.publicId = t, n.systemId = i, n } }, ks.prototype = { firstChild: null, lastChild: null, previousSibling: null, nextSibling: null, attributes: null, parentNode: null, childNodes: null, ownerDocument: null, nodeValue: null, namespaceURI: null, prefix: null, localName: null, insertBefore: function (e, t) { return Ps(this, e, t) }, replaceChild: function (e, t) { this.insertBefore(e, t), t && this.removeChild(t) }, removeChild: function (e) { return xs(this, e) }, appendChild: function (e) { return this.insertBefore(e, null) }, hasChildNodes: function () { return null != this.firstChild }, cloneNode: function (e) { return function e(t, i, n) { var r = new i.constructor; for (var a in i) { var s = i[a]; "object" != typeof s && s != r[a] && (r[a] = s) } i.childNodes && (r.childNodes = new ms); r.ownerDocument = t; switch (r.nodeType) { case Qa: var o = i.attributes, u = r.attributes = new ys, l = o.length; u._ownerElement = r; for (var c = 0; c < l; c++)r.setAttributeNode(e(t, o.item(c), !0)); break; case Ja: n = !0 }if (n) for (var h = i.firstChild; h;)r.appendChild(e(t, h, n)), h = h.nextSibling; return r }(this.ownerDocument || this, this, e) }, normalize: function () { for (var e = this.firstChild; e;) { var t = e.nextSibling; t && t.nodeType == Za && e.nodeType == Za ? (this.removeChild(t), e.appendData(t.data)) : (e.normalize(), e = t) } }, isSupported: function (e, t) { return this.ownerDocument.implementation.hasFeature(e, t) }, hasAttributes: function () { return 0 < this.attributes.length }, lookupPrefix: function (e) { for (var t = this; t;) { var i = t._nsMap; if (i) for (var n in i) if (i[n] == e) return n; t = t.nodeType == Ja ? t.ownerDocument : t.parentNode } return null }, lookupNamespaceURI: function (e) { for (var t = this; t;) { var i = t._nsMap; if (i && e in i) return i[e]; t = t.nodeType == Ja ? t.ownerDocument : t.parentNode } return null }, isDefaultNamespace: function (e) { return null == this.lookupPrefix(e) } }, Xa($a, ks), Xa($a, ks.prototype), ws.prototype = { nodeName: "#document", nodeType: as, doctype: null, documentElement: null, _inc: 1, insertBefore: function (e, t) { if (e.nodeType != os) return null == this.documentElement && e.nodeType == Qa && (this.documentElement = e), Ps(this, e, t), e.ownerDocument = this, e; for (var i = e.firstChild; i;) { var n = i.nextSibling; this.insertBefore(i, t), i = n } return e }, removeChild: function (e) { return this.documentElement == e && (this.documentElement = null), xs(this, e) }, importNode: function (e, t) { return function e(t, i, n) { var r; switch (i.nodeType) { case Qa: (r = i.cloneNode(!1)).ownerDocument = t; case os: break; case Ja: n = !0 }r = r || i.cloneNode(!1); r.ownerDocument = t; r.parentNode = null; if (n) for (var a = i.firstChild; a;)r.appendChild(e(t, a, n)), a = a.nextSibling; return r }(this, e, t) }, getElementById: function (t) { var i = null; return Es(this.documentElement, function (e) { if (e.nodeType == Qa && e.getAttribute("id") == t) return i = e, !0 }), i }, createElement: function (e) { var t = new Ls; return t.ownerDocument = this, t.nodeName = e, t.tagName = e, t.childNodes = new ms, (t.attributes = new ys)._ownerElement = t }, createDocumentFragment: function () { var e = new Hs; return e.ownerDocument = this, e.childNodes = new ms, e }, createTextNode: function (e) { var t = new Ns; return t.ownerDocument = this, t.appendData(e), t }, createComment: function (e) { var t = new Rs; return t.ownerDocument = this, t.appendData(e), t }, createCDATASection: function (e) { var t = new Us; return t.ownerDocument = this, t.appendData(e), t }, createProcessingInstruction: function (e, t) { var i = new Vs; return i.ownerDocument = this, i.tagName = i.target = e, i.nodeValue = i.data = t, i }, createAttribute: function (e) { var t = new Os; return t.ownerDocument = this, t.name = e, t.nodeName = e, t.localName = e, t.specified = !0, t }, createEntityReference: function (e) { var t = new Fs; return t.ownerDocument = this, t.nodeName = e, t }, createElementNS: function (e, t) { var i = new Ls, n = t.split(":"), r = i.attributes = new ys; return i.childNodes = new ms, i.ownerDocument = this, i.nodeName = t, i.tagName = t, i.namespaceURI = e, 2 == n.length ? (i.prefix = n[0], i.localName = n[1]) : i.localName = t, r._ownerElement = i }, createAttributeNS: function (e, t) { var i = new Os, n = t.split(":"); return i.ownerDocument = this, i.nodeName = t, i.name = t, i.namespaceURI = e, i.specified = !0, 2 == n.length ? (i.prefix = n[0], i.localName = n[1]) : i.localName = t, i } }, Ka(ws, ks), ws.prototype.getElementsByTagName = (Ls.prototype = { nodeType: Qa, hasAttribute: function (e) { return null != this.getAttributeNode(e) }, getAttribute: function (e) { var t = this.getAttributeNode(e); return t && t.value || "" }, getAttributeNode: function (e) { return this.attributes.getNamedItem(e) }, setAttribute: function (e, t) { var i = this.ownerDocument.createAttribute(e); i.value = i.nodeValue = "" + t, this.setAttributeNode(i) }, removeAttribute: function (e) { var t = this.getAttributeNode(e); t && this.removeAttributeNode(t) }, appendChild: function (e) { return e.nodeType === os ? this.insertBefore(e, null) : function (e, t) { var i = t.parentNode; if (i) { var n = e.lastChild; i.removeChild(t); n = e.lastChild } return n = e.lastChild, t.parentNode = e, t.previousSibling = n, t.nextSibling = null, n ? n.nextSibling = t : e.firstChild = t, e.lastChild = t, Is(e.ownerDocument, e, t), t }(this, e) }, setAttributeNode: function (e) { return this.attributes.setNamedItem(e) }, setAttributeNodeNS: function (e) { return this.attributes.setNamedItemNS(e) }, removeAttributeNode: function (e) { return this.attributes.removeNamedItem(e.nodeName) }, removeAttributeNS: function (e, t) { var i = this.getAttributeNodeNS(e, t); i && this.removeAttributeNode(i) }, hasAttributeNS: function (e, t) { return null != this.getAttributeNodeNS(e, t) }, getAttributeNS: function (e, t) { var i = this.getAttributeNodeNS(e, t); return i && i.value || "" }, setAttributeNS: function (e, t, i) { var n = this.ownerDocument.createAttributeNS(e, t); n.value = n.nodeValue = "" + i, this.setAttributeNode(n) }, getAttributeNodeNS: function (e, t) { return this.attributes.getNamedItemNS(e, t) }, getElementsByTagName: function (n) { return new gs(this, function (t) { var i = []; return Es(t, function (e) { e === t || e.nodeType != Qa || "*" !== n && e.tagName != n || i.push(e) }), i }) }, getElementsByTagNameNS: function (n, r) { return new gs(this, function (t) { var i = []; return Es(t, function (e) { e === t || e.nodeType !== Qa || "*" !== n && e.namespaceURI !== n || "*" !== r && e.localName != r || i.push(e) }), i }) } }).getElementsByTagName, ws.prototype.getElementsByTagNameNS = Ls.prototype.getElementsByTagNameNS, Ka(Ls, ks), Os.prototype.nodeType = Ja, Ka(Os, ks), Ds.prototype = { data: "", substringData: function (e, t) { return this.data.substring(e, e + t) }, appendData: function (e) { e = this.data + e, this.nodeValue = this.data = e, this.length = e.length }, insertData: function (e, t) { this.replaceData(e, 0, t) }, appendChild: function (e) { throw new Error(cs[hs]) }, deleteData: function (e, t) { this.replaceData(e, t, "") }, replaceData: function (e, t, i) { i = this.data.substring(0, e) + i + this.data.substring(e + t), this.nodeValue = this.data = i, this.length = i.length } }, Ka(Ds, ks), Ns.prototype = { nodeName: "#text", nodeType: Za, splitText: function (e) { var t = this.data, i = t.substring(e); t = t.substring(0, e), this.data = this.nodeValue = t, this.length = t.length; var n = this.ownerDocument.createTextNode(i); return this.parentNode && this.parentNode.insertBefore(n, this.nextSibling), n } }, Ka(Ns, Ds), Rs.prototype = { nodeName: "#comment", nodeType: rs }, Ka(Rs, Ds), Us.prototype = { nodeName: "#cdata-section", nodeType: es }, Ka(Us, Ds), Ms.prototype.nodeType = ss, Ka(Ms, ks), Bs.prototype.nodeType = us, Ka(Bs, ks), js.prototype.nodeType = is, Ka(js, ks), Fs.prototype.nodeType = ts, Ka(Fs, ks), Hs.prototype.nodeName = "#document-fragment", Hs.prototype.nodeType = os, Ka(Hs, ks), Vs.prototype.nodeType = ns, Ka(Vs, ks), qs.prototype.serializeToString = function (e, t, i) { return Ws.call(e, t, i) }, ks.prototype.toString = Ws; try { if (Object.defineProperty) { Object.defineProperty(gs.prototype, "length", { get: function () { return vs(this), this.$$length } }), Object.defineProperty(ks.prototype, "textContent", { get: function () { return function e(t) { switch (t.nodeType) { case Qa: case os: var i = []; for (t = t.firstChild; t;)7 !== t.nodeType && 8 !== t.nodeType && i.push(e(t)), t = t.nextSibling; return i.join(""); default: return t.nodeValue } }(this) }, set: function (e) { switch (this.nodeType) { case Qa: case os: for (; this.firstChild;)this.removeChild(this.firstChild); (e || String(e)) && this.appendChild(this.ownerDocument.createTextNode(e)); break; default: this.data = e, this.value = e, this.nodeValue = e } } }), Xs = function (e, t, i) { e["$$" + t] = i } } } catch (e) { } function Ks(e) { return !!e && "object" == typeof e } function Ys() { for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++)t[i] = arguments[i]; return t.reduce(function (t, i) { return Object.keys(i).forEach(function (e) { Array.isArray(t[e]) && Array.isArray(i[e]) ? t[e] = t[e].concat(i[e]) : Ks(t[e]) && Ks(i[e]) ? t[e] = Ys(t[e], i[e]) : t[e] = i[e] }), t }, {}) } function $s(e) { return e.reduce(function (e, t) { return e.concat(t) }, []) } function Qs(e) { if (!e.length) return []; for (var t = [], i = 0; i < e.length; i++)t.push(e[i]); return t } function Js(e) { var t = e.baseUrl, i = void 0 === t ? "" : t, n = e.source, r = void 0 === n ? "" : n, a = e.range, s = void 0 === a ? "" : a, o = e.indexRange, u = void 0 === o ? "" : o, l = { uri: r, resolvedUri: ba(i || "", r) }; if (s || u) { var c = (s || u).split("-"), h = parseInt(c[0], 10), d = parseInt(c[1], 10); l.byterange = { length: d - h + 1, offset: h } } return l } function Zs(e) { var t = e.type, i = void 0 === t ? "static" : t, n = e.duration, r = e.timescale, a = void 0 === r ? 1 : r, s = e.sourceDuration, o = Vo[i](e), u = function (e, t) { for (var i = [], n = e; n < t; n++)i.push(n); return i }(o.start, o.end).map(function (o) { return function (e, t) { var i = o.duration, n = o.timescale, r = void 0 === n ? 1 : n, a = o.periodIndex, s = o.startNumber; return { number: (void 0 === s ? 1 : s) + e, duration: i / r, timeline: a, time: t * i } } }(e)); if ("static" === i) { var l = u.length - 1; u[l].duration = s - n / a * l } return u } function eo(e) { var t = e.baseUrl, i = e.initialization, n = void 0 === i ? {} : i, r = e.sourceDuration, a = e.timescale, s = void 0 === a ? 1 : a, o = e.indexRange, u = void 0 === o ? "" : o, l = e.duration; if (!t) throw new Error(jo); var c = Js({ baseUrl: t, source: n.sourceURL, range: n.range }), h = Js({ baseUrl: t, source: t, indexRange: u }); if (h.map = c, l) { var d = Zs(e); d.length && (h.duration = d[0].duration, h.timeline = d[0].timeline) } else r && (h.duration = r / s, h.timeline = 0); return h.number = 0, [h] } function to(e, t, i) { for (var n = e.sidx.map ? e.sidx.map : null, r = e.sidx.duration, a = e.timeline || 0, s = e.sidx.byterange, o = s.offset + s.length, u = t.timescale, l = t.references.filter(function (e) { return 1 !== e.referenceType }), c = [], h = o + t.firstOffset, d = 0; d < l.length; d++) { var p = t.references[d], f = p.referencedSize, m = p.subsegmentDuration, g = eo({ baseUrl: i, timescale: u, timeline: a, periodIndex: a, duration: m, sourceDuration: r, indexRange: h + "-" + (h + f - 1) })[0]; n && (g.map = n), c.push(g), h += f } return e.segments = c, e } function io(e) { return function (t) { return Object.keys(t).map(function (e) { return t[e] }) }(e.reduce(function (e, t) { var i, n = t.attributes.id + (t.attributes.lang || ""); e[n] ? (t.segments[0] && (t.segments[0].discontinuity = !0), (i = e[n].segments).push.apply(i, t.segments), t.attributes.contentProtection && (e[n].attributes.contentProtection = t.attributes.contentProtection)) : e[n] = t; return e }, {})).map(function (e) { return e.discontinuityStarts = function (e, n) { return e.reduce(function (e, t, i) { return t[n] && e.push(i), e }, []) }(e.segments, "discontinuity"), e }) } function no(e, t) { if (void 0 === t && (t = {}), !Object.keys(t).length) return e; for (var i in e) { var n = e[i]; if (n.sidx) { var r = n.sidx.uri + "-" + (s = n.sidx.byterange, void 0, o = s.offset + s.length - 1, s.offset + "-" + o), a = t[r] && t[r].sidx; n.sidx && a && to(n, a, n.sidx.resolvedUri) } } var s, o; return e } function ro(e) { var t, i = e.attributes, n = e.segments, r = e.sidx, a = { attributes: (t = { NAME: i.id, AUDIO: "audio", SUBTITLES: "subs", RESOLUTION: { width: i.width, height: i.height }, CODECS: i.codecs, BANDWIDTH: i.bandwidth }, t["PROGRAM-ID"] = 1, t), uri: "", endList: "static" === (i.type || "static"), timeline: i.periodIndex, resolvedUri: "", targetDuration: i.duration, segments: n, mediaSequence: n.length ? n[0].number : 1 }; return i.contentProtection && (a.contentProtection = i.contentProtection), r && (a.sidx = r), a } function ao(e, t) { var i; if (void 0 === t && (t = {}), !e.length) return {}; var n = e[0].attributes, r = n.sourceDuration, a = n.type, s = void 0 === a ? "static" : a, o = n.suggestedPresentationDelay, u = n.minimumUpdatePeriod, l = void 0 === u ? 0 : u, c = io(e.filter(function (e) { var t = e.attributes; return "video/mp4" === t.mimeType || "video" === t.contentType })).map(ro), h = io(e.filter(function (e) { var t = e.attributes; return "audio/mp4" === t.mimeType || "audio" === t.contentType })), d = e.filter(function (e) { var t = e.attributes; return "text/vtt" === t.mimeType || "text" === t.contentType }), p = { allowCache: !0, discontinuityStarts: [], segments: [], endList: !0, mediaGroups: (i = { AUDIO: {}, VIDEO: {} }, i["CLOSED-CAPTIONS"] = {}, i.SUBTITLES = {}, i), uri: "", duration: r, playlists: no(c, t), minimumUpdatePeriod: 1e3 * l }; return "dynamic" === s && (p.suggestedPresentationDelay = o), h.length && (p.mediaGroups.AUDIO.audio = function (e, s) { var o; void 0 === s && (s = {}); var t = e.reduce(function (e, t) { var i = t.attributes.role && t.attributes.role.value || "", n = t.attributes.lang || "", r = "main"; if (n) { var a = i ? " (" + i + ")" : ""; r = t.attributes.lang + a } return e[r] && e[r].playlists[0].attributes.BANDWIDTH > t.attributes.bandwidth || (e[r] = { language: n, autoselect: !0, default: "main" === i, playlists: no([function (e) { var t, i = e.attributes, n = e.segments, r = e.sidx, a = { attributes: (t = { NAME: i.id, BANDWIDTH: i.bandwidth, CODECS: i.codecs }, t["PROGRAM-ID"] = 1, t), uri: "", endList: "static" === (i.type || "static"), timeline: i.periodIndex, resolvedUri: "", targetDuration: i.duration, segments: n, mediaSequence: n.length ? n[0].number : 1 }; return i.contentProtection && (a.contentProtection = i.contentProtection), r && (a.sidx = r), a }(t)], s), uri: "" }, "undefined" == typeof o && "main" === i && ((o = t).default = !0)), e }, {}); o || (t[Object.keys(t)[0]].default = !0); return t }(h, t)), d.length && (p.mediaGroups.SUBTITLES.subs = function (e, n) { return void 0 === n && (n = {}), e.reduce(function (e, t) { var i = t.attributes.lang || "text"; return e[i] || (e[i] = { language: i, default: !1, autoselect: !1, playlists: no([function (e) { var t, i = e.attributes, n = e.segments; return "undefined" == typeof n && (n = [{ uri: i.baseUrl, timeline: i.periodIndex, resolvedUri: i.baseUrl || "", duration: i.sourceDuration, number: 0 }], i.duration = i.sourceDuration), { attributes: (t = { NAME: i.id, BANDWIDTH: i.bandwidth }, t["PROGRAM-ID"] = 1, t), uri: "", endList: "static" === (i.type || "static"), timeline: i.periodIndex, resolvedUri: i.baseUrl || "", targetDuration: i.duration, segments: n, mediaSequence: n.length ? n[0].number : 1 } }(t)], n), uri: "" }), e }, {}) }(d, t)), p } function so(e, t) { for (var i, n, r, a, s, o, u, l, c, h, d, p, f = e.type, m = void 0 === f ? "static" : f, g = e.minimumUpdatePeriod, v = void 0 === g ? 0 : g, y = e.media, _ = void 0 === y ? "" : y, b = e.sourceDuration, T = e.timescale, S = void 0 === T ? 1 : T, k = e.startNumber, C = void 0 === k ? 1 : k, E = e.periodIndex, w = [], A = -1, I = 0; I < t.length; I++) { var x = t[I], P = x.d, L = x.r || 0, O = x.t || 0; A < 0 && (A = O), O && A < O && (A = O); var D = void 0; if (L < 0) { var N = I + 1; D = N === t.length ? "dynamic" === m && 0 < v && 0 < _.indexOf("$Number$") ? (n = A, r = P, void 0, a = (i = e).NOW, s = i.clientOffset, o = i.availabilityStartTime, u = i.timescale, l = void 0 === u ? 1 : u, c = i.start, h = void 0 === c ? 0 : c, d = i.minimumUpdatePeriod, p = (a + s) / 1e3 + (void 0 === d ? 0 : d) - (o + h), Math.ceil((p * l - n) / r)) : (b * S - A) / P : (t[N].t - A) / P } else D = L + 1; for (var R = C + w.length + D, U = C + w.length; U < R;)w.push({ number: U, duration: P / S, time: A, timeline: E }), A += P, U++ } return w } function oo(e, t) { return e.replace(qo, function (a) { return function (e, t, i, n) { if ("$$" === e) return "$"; if ("undefined" == typeof a[t]) return e; var r = "" + a[t]; return "RepresentationID" === t ? r : (n = i ? parseInt(n, 10) : 1) <= r.length ? r : new Array(n - r.length + 1).join("0") + r } }(t)) } function uo(i, e) { var n = { RepresentationID: i.id, Bandwidth: i.bandwidth || 0 }, t = i.initialization, r = void 0 === t ? { sourceURL: "", range: "" } : t, a = Js({ baseUrl: i.baseUrl, source: oo(r.sourceURL, n), range: r.range }); return function (e, t) { return e.duration || t ? e.duration ? Zs(e) : so(e, t) : [{ number: e.startNumber || 1, duration: e.sourceDuration, time: 0, timeline: e.periodIndex }] }(i, e).map(function (e) { n.Number = e.number, n.Time = e.time; var t = oo(i.media || "", n); return { uri: t, timeline: e.timeline, duration: e.duration, resolvedUri: ba(i.baseUrl || "", t), map: a, number: e.number } }) } function lo(t, e) { var i = t.duration, n = t.segmentUrls, r = void 0 === n ? [] : n; if (!i && !e || i && e) throw new Error(Fo); var a, s = r.map(function (e) { return function (e, t) { var i = e.baseUrl, n = e.initialization, r = void 0 === n ? {} : n, a = Js({ baseUrl: i, source: r.sourceURL, range: r.range }), s = Js({ baseUrl: i, source: t.media, range: t.mediaRange }); return s.map = a, s }(t, e) }); return i && (a = Zs(t)), e && (a = so(t, e)), a.map(function (e, t) { if (s[t]) { var i = s[t]; return i.timeline = e.timeline, i.duration = e.duration, i.number = e.number, i } }).filter(function (e) { return e }) } function co(e) { var t, i, n = e.attributes, r = e.segmentInfo; r.template ? (i = uo, t = Ys(n, r.template)) : r.base ? (i = eo, t = Ys(n, r.base)) : r.list && (i = lo, t = Ys(n, r.list)); var a = { attributes: n }; if (!i) return a; var s = i(t, r.timeline); if (t.duration) { var o = t, u = o.duration, l = o.timescale, c = void 0 === l ? 1 : l; t.duration = u / c } else s.length ? t.duration = s.reduce(function (e, t) { return Math.max(e, Math.ceil(t.duration)) }, 0) : t.duration = 0; return a.attributes = t, a.segments = s, r.base && t.indexRange && (a.sidx = s[0], a.segments = []), a } function ho(e, t) { return Qs(e.childNodes).filter(function (e) { return e.tagName === t }) } function po(e) { return e.textContent.trim() } function fo(e) { var t = /P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e); if (!t) return 0; var i = t.slice(1), n = i[0], r = i[1], a = i[2], s = i[3], o = i[4], u = i[5]; return 31536e3 * parseFloat(n || 0) + 2592e3 * parseFloat(r || 0) + 86400 * parseFloat(a || 0) + 3600 * parseFloat(s || 0) + 60 * parseFloat(o || 0) + parseFloat(u || 0) } function mo(e) { return e && e.attributes ? Qs(e.attributes).reduce(function (e, t) { var i = Wo[t.name] || Wo.DEFAULT; return e[t.name] = i(t.value), e }, {}) : {} } function go(e, i) { return i.length ? $s(e.map(function (t) { return i.map(function (e) { return ba(t, po(e)) }) })) : e } function vo(e) { var t = ho(e, "SegmentTemplate")[0], i = ho(e, "SegmentList")[0], n = i && ho(i, "SegmentURL").map(function (e) { return Ys({ tag: "SegmentURL" }, mo(e)) }), r = ho(e, "SegmentBase")[0], a = i || t, s = a && ho(a, "SegmentTimeline")[0], o = i || r || t, u = o && ho(o, "Initialization")[0], l = t && mo(t); l && u ? l.initialization = u && mo(u) : l && l.initialization && (l.initialization = { sourceURL: l.initialization }); var c = { template: l, timeline: s && ho(s, "S").map(function (e) { return mo(e) }), list: i && Ys(mo(i), { segmentUrls: n, initialization: mo(u) }), base: r && Ys(mo(r), { initialization: mo(u) }) }; return Object.keys(c).forEach(function (e) { c[e] || delete c[e] }), c } function yo(c, h, d) { return function (e) { var t = mo(e), i = go(h, ho(e, "BaseURL")), n = ho(e, "Role")[0], r = { role: mo(n) }, a = Ys(c, t, r), s = function (e) { return e.reduce(function (e, t) { var i = mo(t), n = zo[i.schemeIdUri]; if (n) { e[n] = { attributes: i }; var r = ho(t, "cenc:pssh")[0]; if (r) { var a = po(r), s = a && ka(a); e[n].pssh = s } } return e }, {}) }(ho(e, "ContentProtection")); Object.keys(s).length && (a = Ys(a, { contentProtection: s })); var o = vo(e), u = ho(e, "Representation"), l = Ys(d, o); return $s(u.map(function (a, s, o) { return function (e) { var t = ho(e, "BaseURL"), i = go(s, t), n = Ys(a, mo(e)), r = vo(e); return i.map(function (e) { return { segmentInfo: Ys(o, r), attributes: Ys(n, { baseUrl: e }) } }) } }(a, i, l))) } } function _o(e, t) { void 0 === t && (t = {}); var i = t, n = i.manifestUri, r = void 0 === n ? "" : n, a = i.NOW, s = void 0 === a ? Date.now() : a, o = i.clientOffset, u = void 0 === o ? 0 : o, l = ho(e, "Period"); if (!l.length) throw new Error(Uo); var c = mo(e), h = go([r], ho(e, "BaseURL")); return c.sourceDuration = c.mediaPresentationDuration || 0, c.NOW = s, c.clientOffset = u, $s(l.map(function (l, c) { return function (e, t) { var i = go(c, ho(e, "BaseURL")), n = mo(e), r = parseInt(n.id, 10), a = y.isNaN(r) ? t : r, s = Ys(l, { periodIndex: a }), o = ho(e, "AdaptationSet"), u = vo(e); return $s(o.map(yo(s, i, u))) } }(c, h))) } function bo(e) { if ("" === e) throw new Error(Mo); var t = (new Ro).parseFromString(e, "application/xml"), i = t && "MPD" === t.documentElement.tagName ? t.documentElement : null; if (!i || i && 0 < i.getElementsByTagName("parsererror").length) throw new Error(Bo); return i } function To(e, t) { return void 0 === t && (t = {}), ao(function (e) { return e.map(co) }(_o(bo(e), t)), t.sidxMapping) } function So(e) { return function (e) { var t = ho(e, "UTCTiming")[0]; if (!t) return null; var i = mo(t); switch (i.schemeIdUri) { case "urn:mpeg:dash:utc:http-head:2014": case "urn:mpeg:dash:utc:http-head:2012": i.method = "HEAD"; break; case "urn:mpeg:dash:utc:http-xsdate:2014": case "urn:mpeg:dash:utc:http-iso:2014": case "urn:mpeg:dash:utc:http-xsdate:2012": case "urn:mpeg:dash:utc:http-iso:2012": i.method = "GET"; break; case "urn:mpeg:dash:utc:direct:2014": case "urn:mpeg:dash:utc:direct:2012": i.method = "DIRECT", i.value = Date.parse(i.value); break; case "urn:mpeg:dash:utc:http-ntp:2014": case "urn:mpeg:dash:utc:ntp:2014": case "urn:mpeg:dash:utc:sntp:2014": default: throw new Error(Ho) }return i }(bo(e)) } function ko(e) { return new Date(1e3 * e - 20828448e5) } function Co(e) { return { isLeading: (12 & e[0]) >>> 2, dependsOn: 3 & e[0], isDependedOn: (192 & e[1]) >>> 6, hasRedundancy: (48 & e[1]) >>> 4, paddingValue: (14 & e[1]) >>> 1, isNonSyncSample: 1 & e[1], degradationPriority: e[2] << 8 | e[3] } } function Eo(e) { var t = ""; return t += String.fromCharCode(e[0]), t += String.fromCharCode(e[1]), t += String.fromCharCode(e[2]), t += String.fromCharCode(e[3]) } var wo, Ao, Io, xo, Po, Lo, Oo, Do = { DOMImplementation: Ss, XMLSerializer: qs }, No = t(function (e, t) { function i(e) { this.options = e || { locator: {} } } function l() { this.cdata = !1 } function c(e, t) { t.lineNumber = e.lineNumber, t.columnNumber = e.columnNumber } function h(e) { if (e) return "\n@" + (e.systemId || "") + "#[line:" + e.lineNumber + ",col:" + e.columnNumber + "]" } function r(e, t, i) { return "string" == typeof e ? e.substr(t, i) : e.length >= t + i || t ? new java.lang.String(e, t, i) + "" : e } function d(e, t) { e.currentElement ? e.currentElement.appendChild(t) : e.doc.appendChild(t) } i.prototype.parseFromString = function (e, t) { var i = this.options, n = new p, r = i.domBuilder || new l, a = i.errorHandler, s = i.locator, o = i.xmlns || {}, u = { lt: "<", gt: ">", amp: "&", quot: '"', apos: "'" }; return s && r.setDocumentLocator(s), n.errorHandler = function (n, e, r) { if (!n) { if (e instanceof l) return e; n = e } var a = {}, s = n instanceof Function; function t(t) { var i = n[t]; !i && s && (i = 2 == n.length ? function (e) { n(t, e) } : n), a[t] = i && function (e) { i("[xmldom " + t + "]\t" + e + h(r)) } || function () { } } return r = r || {}, t("warning"), t("error"), t("fatalError"), a }(a, r, s), n.domBuilder = i.domBuilder || r, /\/x?html?$/.test(t) && (u.nbsp = " ", u.copy = "©", o[""] = "http://www.w3.org/1999/xhtml"), o.xml = o.xml || "http://www.w3.org/XML/1998/namespace", e ? n.parse(e, o, u) : n.errorHandler.error("invalid doc source"), r.doc }, l.prototype = { startDocument: function () { this.doc = (new n).createDocument(null, null, null), this.locator && (this.doc.documentURI = this.locator.systemId) }, startElement: function (e, t, i, n) { var r = this.doc, a = r.createElementNS(e, i || t), s = n.length; d(this, a), this.currentElement = a, this.locator && c(this.locator, a); for (var o = 0; o < s; o++) { e = n.getURI(o); var u = n.getValue(o), l = (i = n.getQName(o), r.createAttributeNS(e, i)); this.locator && c(n.getLocator(o), l), l.value = l.nodeValue = u, a.setAttributeNode(l) } }, endElement: function (e, t, i) { var n = this.currentElement; n.tagName; this.currentElement = n.parentNode }, startPrefixMapping: function (e, t) { }, endPrefixMapping: function (e) { }, processingInstruction: function (e, t) { var i = this.doc.createProcessingInstruction(e, t); this.locator && c(this.locator, i), d(this, i) }, ignorableWhitespace: function (e, t, i) { }, characters: function (e, t, i) { if (e = r.apply(this, arguments)) { if (this.cdata) var n = this.doc.createCDATASection(e); else n = this.doc.createTextNode(e); this.currentElement ? this.currentElement.appendChild(n) : /^\s*$/.test(e) && this.doc.appendChild(n), this.locator && c(this.locator, n) } }, skippedEntity: function (e) { }, endDocument: function () { this.doc.normalize() }, setDocumentLocator: function (e) { (this.locator = e) && (e.lineNumber = 0) }, comment: function (e, t, i) { e = r.apply(this, arguments); var n = this.doc.createComment(e); this.locator && c(this.locator, n), d(this, n) }, startCDATA: function () { this.cdata = !0 }, endCDATA: function () { this.cdata = !1 }, startDTD: function (e, t, i) { var n = this.doc.implementation; if (n && n.createDocumentType) { var r = n.createDocumentType(e, t, i); this.locator && c(this.locator, r), d(this, r) } }, warning: function (e) { }, error: function (e) { }, fatalError: function (e) { throw e } }, "endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g, function (e) { l.prototype[e] = function () { return null } }); var p = Ga.XMLReader, n = t.DOMImplementation = Do.DOMImplementation; t.XMLSerializer = Do.XMLSerializer, t.DOMParser = i }), Ro = (No.DOMImplementation, No.XMLSerializer, No.DOMParser), Uo = "INVALID_NUMBER_OF_PERIOD", Mo = "DASH_EMPTY_MANIFEST", Bo = "DASH_INVALID_XML", jo = "NO_BASE_URL", Fo = "SEGMENT_TIME_UNSPECIFIED", Ho = "UNSUPPORTED_UTC_TIMING_SCHEME", Vo = { static: function (e) { var t = e.duration, i = e.timescale, n = void 0 === i ? 1 : i, r = e.sourceDuration; return { start: 0, end: Math.ceil(r / (t / n)) } }, dynamic: function (e) { var t = e.NOW, i = e.clientOffset, n = e.availabilityStartTime, r = e.timescale, a = void 0 === r ? 1 : r, s = e.duration, o = e.start, u = void 0 === o ? 0 : o, l = e.minimumUpdatePeriod, c = void 0 === l ? 0 : l, h = e.timeShiftBufferDepth, d = void 0 === h ? 1 / 0 : h, p = (t + i) / 1e3, f = n + u, m = p + c - f, g = Math.ceil(m * a / s), v = Math.floor((p - f - d) * a / s), y = Math.floor((p - f) * a / s); return { start: Math.max(0, v), end: Math.min(g, y) } } }, qo = /\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g, Wo = { mediaPresentationDuration: function (e) { return fo(e) }, availabilityStartTime: function (e) { return function (e) { return /^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e) && (e += "Z"), Date.parse(e) }(e) / 1e3 }, minimumUpdatePeriod: function (e) { return fo(e) }, suggestedPresentationDelay: function (e) { return fo(e) }, type: function (e) { return e }, timeShiftBufferDepth: function (e) { return fo(e) }, start: function (e) { return fo(e) }, width: function (e) { return parseInt(e, 10) }, height: function (e) { return parseInt(e, 10) }, bandwidth: function (e) { return parseInt(e, 10) }, startNumber: function (e) { return parseInt(e, 10) }, timescale: function (e) { return parseInt(e, 10) }, duration: function (e) { var t = parseInt(e, 10); return isNaN(t) ? fo(e) : t }, d: function (e) { return parseInt(e, 10) }, t: function (e) { return parseInt(e, 10) }, r: function (e) { return parseInt(e, 10) }, DEFAULT: function (e) { return e } }, zo = { "urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b": "org.w3.clearkey", "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed": "com.widevine.alpha", "urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95": "com.microsoft.playready", "urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb": "com.adobe.primetime" }, Go = function (e) { return e >>> 0 }, Xo = function (e) { return ("00" + e.toString(16)).slice(-2) }, Ko = Go, Yo = { avc1: function (e) { var t = new DataView(e.buffer, e.byteOffset, e.byteLength); return { dataReferenceIndex: t.getUint16(6), width: t.getUint16(24), height: t.getUint16(26), horizresolution: t.getUint16(28) + t.getUint16(30) / 16, vertresolution: t.getUint16(32) + t.getUint16(34) / 16, frameCount: t.getUint16(40), depth: t.getUint16(74), config: wo(e.subarray(78, e.byteLength)) } }, avcC: function (e) { var t, i, n, r, a = new DataView(e.buffer, e.byteOffset, e.byteLength), s = { configurationVersion: e[0], avcProfileIndication: e[1], profileCompatibility: e[2], avcLevelIndication: e[3], lengthSizeMinusOne: 3 & e[4], sps: [], pps: [] }, o = 31 & e[5]; for (n = 6, r = 0; r < o; r++)i = a.getUint16(n), n += 2, s.sps.push(new Uint8Array(e.subarray(n, n + i))), n += i; for (t = e[n], n++, r = 0; r < t; r++)i = a.getUint16(n), n += 2, s.pps.push(new Uint8Array(e.subarray(n, n + i))), n += i; return s }, btrt: function (e) { var t = new DataView(e.buffer, e.byteOffset, e.byteLength); return { bufferSizeDB: t.getUint32(0), maxBitrate: t.getUint32(4), avgBitrate: t.getUint32(8) } }, esds: function (e) { return { version: e[0], flags: new Uint8Array(e.subarray(1, 4)), esId: e[6] << 8 | e[7], streamPriority: 31 & e[8], decoderConfig: { objectProfileIndication: e[11], streamType: e[12] >>> 2 & 63, bufferSize: e[13] << 16 | e[14] << 8 | e[15], maxBitrate: e[16] << 24 | e[17] << 16 | e[18] << 8 | e[19], avgBitrate: e[20] << 24 | e[21] << 16 | e[22] << 8 | e[23], decoderConfigDescriptor: { tag: e[24], length: e[25], audioObjectType: e[26] >>> 3 & 31, samplingFrequencyIndex: (7 & e[26]) << 1 | e[27] >>> 7 & 1, channelConfiguration: e[27] >>> 3 & 15 } } } }, ftyp: function (e) { for (var t = new DataView(e.buffer, e.byteOffset, e.byteLength), i = { majorBrand: Eo(e.subarray(0, 4)), minorVersion: t.getUint32(4), compatibleBrands: [] }, n = 8; n < e.byteLength;)i.compatibleBrands.push(Eo(e.subarray(n, n + 4))), n += 4; return i }, dinf: function (e) { return { boxes: wo(e) } }, dref: function (e) { return { version: e[0], flags: new Uint8Array(e.subarray(1, 4)), dataReferences: wo(e.subarray(8)) } }, hdlr: function (e) { var t = { version: new DataView(e.buffer, e.byteOffset, e.byteLength).getUint8(0), flags: new Uint8Array(e.subarray(1, 4)), handlerType: Eo(e.subarray(8, 12)), name: "" }, i = 8; for (i = 24; i < e.byteLength; i++) { if (0 === e[i]) { i++; break } t.name += String.fromCharCode(e[i]) } return t.name = decodeURIComponent(escape(t.name)), t }, mdat: function (e) { return { byteLength: e.byteLength, nals: function (e) { var t, i, n = new DataView(e.buffer, e.byteOffset, e.byteLength), r = []; for (t = 0; t + 4 < e.length; t += i)if (i = n.getUint32(t), t += 4, i <= 0) r.push("MALFORMED DATA"); else switch (31 & e[t]) { case 1: r.push("slice_layer_without_partitioning_rbsp"); break; case 5: r.push("slice_layer_without_partitioning_rbsp_idr"); break; case 6: r.push("sei_rbsp"); break; case 7: r.push("seq_parameter_set_rbsp"); break; case 8: r.push("pic_parameter_set_rbsp"); break; case 9: r.push("access_unit_delimiter_rbsp"); break; default: r.push("UNKNOWN NAL - " + e[t] & 31) }return r }(e) } }, mdhd: function (e) { var t, i = new DataView(e.buffer, e.byteOffset, e.byteLength), n = 4, r = { version: i.getUint8(0), flags: new Uint8Array(e.subarray(1, 4)), language: "" }; return 1 === r.version ? (n += 4, r.creationTime = ko(i.getUint32(n)), n += 8, r.modificationTime = ko(i.getUint32(n)), n += 4, r.timescale = i.getUint32(n), n += 8) : (r.creationTime = ko(i.getUint32(n)), n += 4, r.modificationTime = ko(i.getUint32(n)), n += 4, r.timescale = i.getUint32(n), n += 4), r.duration = i.getUint32(n), n += 4, t = i.getUint16(n), r.language += String.fromCharCode(96 + (t >> 10)), r.language += String.fromCharCode(96 + ((992 & t) >> 5)), r.language += String.fromCharCode(96 + (31 & t)), r }, mdia: function (e) { return { boxes: wo(e) } }, mfhd: function (e) { return { version: e[0], flags: new Uint8Array(e.subarray(1, 4)), sequenceNumber: e[4] << 24 | e[5] << 16 | e[6] << 8 | e[7] } }, minf: function (e) { return { boxes: wo(e) } }, mp4a: function (e) { var t = new DataView(e.buffer, e.byteOffset, e.byteLength), i = { dataReferenceIndex: t.getUint16(6), channelcount: t.getUint16(16), samplesize: t.getUint16(18), samplerate: t.getUint16(24) + t.getUint16(26) / 65536 }; return 28 < e.byteLength && (i.streamDescriptor = wo(e.subarray(28))[0]), i }, moof: function (e) { return { boxes: wo(e) } }, moov: function (e) { return { boxes: wo(e) } }, mvex: function (e) { return { boxes: wo(e) } }, mvhd: function (e) { var t = new DataView(e.buffer, e.byteOffset, e.byteLength), i = 4, n = { version: t.getUint8(0), flags: new Uint8Array(e.subarray(1, 4)) }; return 1 === n.version ? (i += 4, n.creationTime = ko(t.getUint32(i)), i += 8, n.modificationTime = ko(t.getUint32(i)), i += 4, n.timescale = t.getUint32(i), i += 8) : (n.creationTime = ko(t.getUint32(i)), i += 4, n.modificationTime = ko(t.getUint32(i)), i += 4, n.timescale = t.getUint32(i), i += 4), n.duration = t.getUint32(i), i += 4, n.rate = t.getUint16(i) + t.getUint16(i + 2) / 16, i += 4, n.volume = t.getUint8(i) + t.getUint8(i + 1) / 8, i += 2, i += 2, i += 8, n.matrix = new Uint32Array(e.subarray(i, i + 36)), i += 36, i += 24, n.nextTrackId = t.getUint32(i), n }, pdin: function (e) { var t = new DataView(e.buffer, e.byteOffset, e.byteLength); return { version: t.getUint8(0), flags: new Uint8Array(e.subarray(1, 4)), rate: t.getUint32(4), initialDelay: t.getUint32(8) } }, sdtp: function (e) { var t, i = { version: e[0], flags: new Uint8Array(e.subarray(1, 4)), samples: [] }; for (t = 4; t < e.byteLength; t++)i.samples.push({ dependsOn: (48 & e[t]) >> 4, isDependedOn: (12 & e[t]) >> 2, hasRedundancy: 3 & e[t] }); return i }, sidx: function (e) { var t, i = new DataView(e.buffer, e.byteOffset, e.byteLength), n = { version: e[0], flags: new Uint8Array(e.subarray(1, 4)), references: [], referenceId: i.getUint32(4), timescale: i.getUint32(8), earliestPresentationTime: i.getUint32(12), firstOffset: i.getUint32(16) }, r = i.getUint16(22); for (t = 24; r; t += 12, r--)n.references.push({ referenceType: (128 & e[t]) >>> 7, referencedSize: 2147483647 & i.getUint32(t), subsegmentDuration: i.getUint32(t + 4), startsWithSap: !!(128 & e[t + 8]), sapType: (112 & e[t + 8]) >>> 4, sapDeltaTime: 268435455 & i.getUint32(t + 8) }); return n }, smhd: function (e) { return { version: e[0], flags: new Uint8Array(e.subarray(1, 4)), balance: e[4] + e[5] / 256 } }, stbl: function (e) { return { boxes: wo(e) } }, stco: function (e) { var t, i = new DataView(e.buffer, e.byteOffset, e.byteLength), n = { version: e[0], flags: new Uint8Array(e.subarray(1, 4)), chunkOffsets: [] }, r = i.getUint32(4); for (t = 8; r; t += 4, r--)n.chunkOffsets.push(i.getUint32(t)); return n }, stsc: function (e) { var t, i = new DataView(e.buffer, e.byteOffset, e.byteLength), n = i.getUint32(4), r = { version: e[0], flags: new Uint8Array(e.subarray(1, 4)), sampleToChunks: [] }; for (t = 8; n; t += 12, n--)r.sampleToChunks.push({ firstChunk: i.getUint32(t), samplesPerChunk: i.getUint32(t + 4), sampleDescriptionIndex: i.getUint32(t + 8) }); return r }, stsd: function (e) { return { version: e[0], flags: new Uint8Array(e.subarray(1, 4)), sampleDescriptions: wo(e.subarray(8)) } }, stsz: function (e) { var t, i = new DataView(e.buffer, e.byteOffset, e.byteLength), n = { version: e[0], flags: new Uint8Array(e.subarray(1, 4)), sampleSize: i.getUint32(4), entries: [] }; for (t = 12; t < e.byteLength; t += 4)n.entries.push(i.getUint32(t)); return n }, stts: function (e) { var t, i = new DataView(e.buffer, e.byteOffset, e.byteLength), n = { version: e[0], flags: new Uint8Array(e.subarray(1, 4)), timeToSamples: [] }, r = i.getUint32(4); for (t = 8; r; t += 8, r--)n.timeToSamples.push({ sampleCount: i.getUint32(t), sampleDelta: i.getUint32(t + 4) }); return n }, styp: function (e) { return Yo.ftyp(e) }, tfdt: function (e) { var t = { version: e[0], flags: new Uint8Array(e.subarray(1, 4)), baseMediaDecodeTime: Ko(e[4] << 24 | e[5] << 16 | e[6] << 8 | e[7]) }; return 1 === t.version && (t.baseMediaDecodeTime *= Math.pow(2, 32), t.baseMediaDecodeTime += Ko(e[8] << 24 | e[9] << 16 | e[10] << 8 | e[11])), t }, tfhd: function (e) { var t, i = new DataView(e.buffer, e.byteOffset, e.byteLength), n = { version: e[0], flags: new Uint8Array(e.subarray(1, 4)), trackId: i.getUint32(4) }, r = 1 & n.flags[2], a = 2 & n.flags[2], s = 8 & n.flags[2], o = 16 & n.flags[2], u = 32 & n.flags[2], l = 65536 & n.flags[0], c = 131072 & n.flags[0]; return t = 8, r && (t += 4, n.baseDataOffset = i.getUint32(12), t += 4), a && (n.sampleDescriptionIndex = i.getUint32(t), t += 4), s && (n.defaultSampleDuration = i.getUint32(t), t += 4), o && (n.defaultSampleSize = i.getUint32(t), t += 4), u && (n.defaultSampleFlags = i.getUint32(t)), l && (n.durationIsEmpty = !0), !r && c && (n.baseDataOffsetIsMoof = !0), n }, tkhd: function (e) { var t = new DataView(e.buffer, e.byteOffset, e.byteLength), i = 4, n = { version: t.getUint8(0), flags: new Uint8Array(e.subarray(1, 4)) }; return 1 === n.version ? (i += 4, n.creationTime = ko(t.getUint32(i)), i += 8, n.modificationTime = ko(t.getUint32(i)), i += 4, n.trackId = t.getUint32(i), i += 4, i += 8) : (n.creationTime = ko(t.getUint32(i)), i += 4, n.modificationTime = ko(t.getUint32(i)), i += 4, n.trackId = t.getUint32(i), i += 4, i += 4), n.duration = t.getUint32(i), i += 4, i += 8, n.layer = t.getUint16(i), i += 2, n.alternateGroup = t.getUint16(i), i += 2, n.volume = t.getUint8(i) + t.getUint8(i + 1) / 8, i += 2, i += 2, n.matrix = new Uint32Array(e.subarray(i, i + 36)), i += 36, n.width = t.getUint16(i) + t.getUint16(i + 2) / 16, i += 4, n.height = t.getUint16(i) + t.getUint16(i + 2) / 16, n }, traf: function (e) { return { boxes: wo(e) } }, trak: function (e) { return { boxes: wo(e) } }, trex: function (e) { var t = new DataView(e.buffer, e.byteOffset, e.byteLength); return { version: e[0], flags: new Uint8Array(e.subarray(1, 4)), trackId: t.getUint32(4), defaultSampleDescriptionIndex: t.getUint32(8), defaultSampleDuration: t.getUint32(12), defaultSampleSize: t.getUint32(16), sampleDependsOn: 3 & e[20], sampleIsDependedOn: (192 & e[21]) >> 6, sampleHasRedundancy: (48 & e[21]) >> 4, samplePaddingValue: (14 & e[21]) >> 1, sampleIsDifferenceSample: !!(1 & e[21]), sampleDegradationPriority: t.getUint16(22) } }, trun: function (e) { var t, i = { version: e[0], flags: new Uint8Array(e.subarray(1, 4)), samples: [] }, n = new DataView(e.buffer, e.byteOffset, e.byteLength), r = 1 & i.flags[2], a = 4 & i.flags[2], s = 1 & i.flags[1], o = 2 & i.flags[1], u = 4 & i.flags[1], l = 8 & i.flags[1], c = n.getUint32(4), h = 8; for (r && (i.dataOffset = n.getInt32(h), h += 4), a && c && (t = { flags: Co(e.subarray(h, h + 4)) }, h += 4, s && (t.duration = n.getUint32(h), h += 4), o && (t.size = n.getUint32(h), h += 4), l && (t.compositionTimeOffset = n.getUint32(h), h += 4), i.samples.push(t), c--); c--;)t = {}, s && (t.duration = n.getUint32(h), h += 4), o && (t.size = n.getUint32(h), h += 4), u && (t.flags = Co(e.subarray(h, h + 4)), h += 4), l && (t.compositionTimeOffset = n.getUint32(h), h += 4), i.samples.push(t); return i }, "url ": function (e) { return { version: e[0], flags: new Uint8Array(e.subarray(1, 4)) } }, vmhd: function (e) { var t = new DataView(e.buffer, e.byteOffset, e.byteLength); return { version: e[0], flags: new Uint8Array(e.subarray(1, 4)), graphicsmode: t.getUint16(4), opcolor: new Uint16Array([t.getUint16(6), t.getUint16(8), t.getUint16(10)]) } } }, $o = { inspect: wo = function (e) { for (var t, i, n, r, a, s = 0, o = [], u = new ArrayBuffer(e.length), l = new Uint8Array(u), c = 0; c < e.length; ++c)l[c] = e[c]; for (t = new DataView(u); s < e.byteLength;)i = t.getUint32(s), n = Eo(e.subarray(s + 4, s + 8)), r = 1 < i ? s + i : e.byteLength, (a = (Yo[n] || function (e) { return { data: e } })(e.subarray(s + 8, r))).size = i, a.type = n, o.push(a), s = r; return o }, textify: Ao = function (e, t) { var a; return t = t || 0, a = new Array(2 * t + 1).join(" "), e.map(function (r, e) { return a + r.type + "\n" + Object.keys(r).filter(function (e) { return "type" !== e && "boxes" !== e }).map(function (e) { var t = a + " " + e + ": ", i = r[e]; if (i instanceof Uint8Array || i instanceof Uint32Array) { var n = Array.prototype.slice.call(new Uint8Array(i.buffer, i.byteOffset, i.byteLength)).map(function (e) { return " " + ("00" + e.toString(16)).slice(-2) }).join("").match(/.{1,24}/g); return n ? 1 === n.length ? t + "<" + n.join("").slice(1) + ">" : t + "<\n" + n.map(function (e) { return a + " " + e }).join("\n") + "\n" + a + " >" : t + "<>" } return t + JSON.stringify(i, null, 2).split("\n").map(function (e, t) { return 0 === t ? e : a + " " + e }).join("\n") }).join("\n") + (r.boxes ? "\n" + Ao(r.boxes, t + 1) : "") }).join("\n") }, parseType: Eo, findBox: function e(t, i) { var n, r, a, s, o, u = []; if (!i.length) return null; for (n = 0; n < t.byteLength;)r = Ko(t[n] << 24 | t[n + 1] << 16 | t[n + 2] << 8 | t[n + 3]), a = Eo(t.subarray(n + 4, n + 8)), s = 1 < r ? n + r : t.byteLength, a === i[0] && (1 === i.length ? u.push(t.subarray(n + 8, s)) : (o = e(t.subarray(n + 8, s), i.slice(1))).length && (u = u.concat(o))), n = s; return u }, parseTraf: Yo.traf, parseTfdt: Yo.tfdt, parseHdlr: Yo.hdlr, parseTfhd: Yo.tfhd, parseTrun: Yo.trun, parseSidx: Yo.sidx }, Qo = Go, Jo = Xo; Io = function (e) { return $o.findBox(e, ["moov", "trak"]).reduce(function (e, t) { var i, n, r, a, s; return (i = $o.findBox(t, ["tkhd"])[0]) ? (n = i[0], a = Qo(i[r = 0 === n ? 12 : 20] << 24 | i[r + 1] << 16 | i[r + 2] << 8 | i[r + 3]), (s = $o.findBox(t, ["mdia", "mdhd"])[0]) ? (r = 0 === (n = s[0]) ? 12 : 20, e[a] = Qo(s[r] << 24 | s[r + 1] << 16 | s[r + 2] << 8 | s[r + 3]), e) : null) : null }, {}) }, xo = function (r, e) { var t, i, n; return t = $o.findBox(e, ["moof", "traf"]), i = [].concat.apply([], t.map(function (n) { return $o.findBox(n, ["tfhd"]).map(function (e) { var t, i; return t = Qo(e[4] << 24 | e[5] << 16 | e[6] << 8 | e[7]), i = r[t] || 9e4, ($o.findBox(n, ["tfdt"]).map(function (e) { var t, i; return t = e[0], i = Qo(e[4] << 24 | e[5] << 16 | e[6] << 8 | e[7]), 1 === t && (i *= Math.pow(2, 32), i += Qo(e[8] << 24 | e[9] << 16 | e[10] << 8 | e[11])), i })[0] || 1 / 0) / i }) })), n = Math.min.apply(null, i), isFinite(n) ? n : 0 }, Po = function (e, t) { var i, n = $o.findBox(t, ["moof", "traf"]), r = 0, a = 0; if (n && n.length) for (var s = $o.parseTraf(n[0]), o = 0; o < s.boxes.length; o++)"tfhd" === s.boxes[o].type ? i = s.boxes[o].trackId : "tfdt" === s.boxes[o].type ? r = s.boxes[o].baseMediaDecodeTime : "trun" === s.boxes[o].type && s.boxes[o].samples.length && (a = s.boxes[o].samples[0].compositionTimeOffset || 0); return (r + a) / (e[i] || 9e4) }, Lo = function (e) { var t = $o.findBox(e, ["moov", "trak"]), o = []; return t.forEach(function (e) { var t = $o.findBox(e, ["mdia", "hdlr"]), s = $o.findBox(e, ["tkhd"]); t.forEach(function (e, t) { var i, n, r = $o.parseType(e.subarray(8, 12)), a = s[t]; "vide" === r && (n = 0 === (i = new DataView(a.buffer, a.byteOffset, a.byteLength)).getUint8(0) ? i.getUint32(12) : i.getUint32(20), o.push(n)) }) }), o }, Oo = function (e) { var t = $o.findBox(e, ["moov", "trak"]), p = []; return t.forEach(function (e) { var t, i, n = {}, r = $o.findBox(e, ["tkhd"])[0]; r && (i = (t = new DataView(r.buffer, r.byteOffset, r.byteLength)).getUint8(0), n.id = 0 === i ? t.getUint32(12) : t.getUint32(20)); var a = $o.findBox(e, ["mdia", "hdlr"])[0]; if (a) { var s = $o.parseType(a.subarray(8, 12)); n.type = "vide" === s ? "video" : "soun" === s ? "audio" : s } var o = $o.findBox(e, ["mdia", "minf", "stbl", "stsd"])[0]; if (o) { var u = o.subarray(8); n.codec = $o.parseType(u.subarray(4, 8)); var l, c = $o.findBox(u, [n.codec])[0]; c && (/^[a-z]vc[1-9]$/i.test(n.codec) ? (l = c.subarray(78), "avcC" === $o.parseType(l.subarray(4, 8)) && 11 < l.length ? (n.codec += ".", n.codec += Jo(l[9]), n.codec += Jo(l[10]), n.codec += Jo(l[11])) : n.codec = "avc1.4d400d") : /^mp4[a,v]$/i.test(n.codec) && (l = c.subarray(28), "esds" === $o.parseType(l.subarray(4, 8)) && 20 < l.length && 0 !== l[19] ? (n.codec += "." + Jo(l[19]), n.codec += "." + Jo(l[20] >>> 2 & 63).replace(/^0/, "")) : n.codec = "mp4a.40.2")) } var h = $o.findBox(e, ["mdia", "mdhd"])[0]; if (h && r) { var d = 0 === i ? 12 : 20; n.timescale = Qo(h[d] << 24 | h[1 + d] << 16 | h[2 + d] << 8 | h[3 + d]) } p.push(n) }), p }; function Zo() { this.init = function () { var a = {}; this.on = function (e, t) { a[e] || (a[e] = []), a[e] = a[e].concat(t) }, this.off = function (e, t) { var i; return !!a[e] && (i = a[e].indexOf(t), a[e] = a[e].slice(), a[e].splice(i, 1), -1 < i) }, this.trigger = function (e) { var t, i, n, r; if (t = a[e]) if (2 === arguments.length) for (n = t.length, i = 0; i < n; ++i)t[i].call(this, arguments[1]); else { for (r = [], i = arguments.length, i = 1; i < arguments.length; ++i)r.push(arguments[i]); for (n = t.length, i = 0; i < n; ++i)t[i].apply(this, r) } }, this.dispose = function () { a = {} } } } var eu = { findBox: $o.findBox, parseType: $o.parseType, timescale: Io, startTime: xo, compositionStartTime: Po, videoTrackIds: Lo, tracks: Oo }, tu = function (e) { for (var t = 0, i = { payloadType: -1, payloadSize: 0 }, n = 0, r = 0; t < e.byteLength && 128 !== e[t];) { for (; 255 === e[t];)n += 255, t++; for (n += e[t++]; 255 === e[t];)r += 255, t++; if (r += e[t++], !i.payload && 4 === n) { i.payloadType = n, i.payloadSize = r, i.payload = e.subarray(t, t + r); break } t += r, r = n = 0 } return i }, iu = function (e) { return 181 !== e.payload[0] ? null : 49 != (e.payload[1] << 8 | e.payload[2]) ? null : "GA94" !== String.fromCharCode(e.payload[3], e.payload[4], e.payload[5], e.payload[6]) ? null : 3 !== e.payload[7] ? null : e.payload.subarray(8, e.payload.length - 1) }, nu = function (e, t) { var i, n, r, a, s = []; if (!(64 & t[0])) return s; for (n = 31 & t[0], i = 0; i < n; i++)a = { type: 3 & t[2 + (r = 3 * i)], pts: e }, 4 & t[2 + r] && (a.ccData = t[3 + r] << 8 | t[4 + r], s.push(a)); return s }, ru = function (e) { for (var t, i, n = e.byteLength, r = [], a = 1; a < n - 2;)0 === e[a] && 0 === e[a + 1] && 3 === e[a + 2] ? (r.push(a + 2), a += 2) : a++; if (0 === r.length) return e; t = n - r.length, i = new Uint8Array(t); var s = 0; for (a = 0; a < t; s++, a++)s === r[0] && (s++, r.shift()), i[a] = e[s]; return i }, au = 4; Zo.prototype.pipe = function (t) { return this.on("data", function (e) { t.push(e) }), this.on("done", function (e) { t.flush(e) }), this.on("partialdone", function (e) { t.partialFlush(e) }), this.on("endedtimeline", function (e) { t.endTimeline(e) }), this.on("reset", function (e) { t.reset(e) }), t }, Zo.prototype.push = function (e) { this.trigger("data", e) }, Zo.prototype.flush = function (e) { this.trigger("done", e) }, Zo.prototype.partialFlush = function (e) { this.trigger("partialdone", e) }, Zo.prototype.endTimeline = function (e) { this.trigger("endedtimeline", e) }, Zo.prototype.reset = function (e) { this.trigger("reset", e) }; function su() { su.prototype.init.call(this), this.captionPackets_ = [], this.ccStreams_ = [new du(0, 0), new du(0, 1), new du(1, 0), new du(1, 1)], this.reset(), this.ccStreams_.forEach(function (e) { e.on("data", this.trigger.bind(this, "data")), e.on("partialdone", this.trigger.bind(this, "partialdone")), e.on("done", this.trigger.bind(this, "done")) }, this) } var ou = Zo; (su.prototype = new ou).push = function (e) { var t, i, n; if ("sei_rbsp" === e.nalUnitType && (t = tu(e.escapedRBSP)).payloadType === au && (i = iu(t))) if (e.dts < this.latestDts_) this.ignoreNextEqualDts_ = !0; else { if (e.dts === this.latestDts_ && this.ignoreNextEqualDts_) return this.numSameDts_--, void (this.numSameDts_ || (this.ignoreNextEqualDts_ = !1)); n = nu(e.pts, i), this.captionPackets_ = this.captionPackets_.concat(n), this.latestDts_ !== e.dts && (this.numSameDts_ = 0), this.numSameDts_++, this.latestDts_ = e.dts } }, su.prototype.flushCCStreams = function (t) { this.ccStreams_.forEach(function (e) { return "flush" === t ? e.flush() : e.partialFlush() }, this) }, su.prototype.flushStream = function (e) { this.captionPackets_.length && (this.captionPackets_.forEach(function (e, t) { e.presortIndex = t }), this.captionPackets_.sort(function (e, t) { return e.pts === t.pts ? e.presortIndex - t.presortIndex : e.pts - t.pts }), this.captionPackets_.forEach(function (e) { e.type < 2 && this.dispatchCea608Packet(e) }, this), this.captionPackets_.length = 0), this.flushCCStreams(e) }, su.prototype.flush = function () { return this.flushStream("flush") }, su.prototype.partialFlush = function () { return this.flushStream("partialFlush") }, su.prototype.reset = function () { this.latestDts_ = null, this.ignoreNextEqualDts_ = !1, this.numSameDts_ = 0, this.activeCea608Channel_ = [null, null], this.ccStreams_.forEach(function (e) { e.reset() }) }, su.prototype.dispatchCea608Packet = function (e) { this.setsTextOrXDSActive(e) ? this.activeCea608Channel_[e.type] = null : this.setsChannel1Active(e) ? this.activeCea608Channel_[e.type] = 0 : this.setsChannel2Active(e) && (this.activeCea608Channel_[e.type] = 1), null !== this.activeCea608Channel_[e.type] && this.ccStreams_[(e.type << 1) + this.activeCea608Channel_[e.type]].push(e) }, su.prototype.setsChannel1Active = function (e) { return 4096 == (30720 & e.ccData) }, su.prototype.setsChannel2Active = function (e) { return 6144 == (30720 & e.ccData) }, su.prototype.setsTextOrXDSActive = function (e) { return 256 == (28928 & e.ccData) || 4138 == (30974 & e.ccData) || 6186 == (30974 & e.ccData) }; function uu(e) { return null === e ? "" : (e = cu[e] || e, String.fromCharCode(e)) } function lu() { for (var e = [], t = 15; t--;)e.push(""); return e } var cu = { 42: 225, 92: 233, 94: 237, 95: 243, 96: 250, 123: 231, 124: 247, 125: 209, 126: 241, 127: 9608, 304: 174, 305: 176, 306: 189, 307: 191, 308: 8482, 309: 162, 310: 163, 311: 9834, 312: 224, 313: 160, 314: 232, 315: 226, 316: 234, 317: 238, 318: 244, 319: 251, 544: 193, 545: 201, 546: 211, 547: 218, 548: 220, 549: 252, 550: 8216, 551: 161, 552: 42, 553: 39, 554: 8212, 555: 169, 556: 8480, 557: 8226, 558: 8220, 559: 8221, 560: 192, 561: 194, 562: 199, 563: 200, 564: 202, 565: 203, 566: 235, 567: 206, 568: 207, 569: 239, 570: 212, 571: 217, 572: 249, 573: 219, 574: 171, 575: 187, 800: 195, 801: 227, 802: 205, 803: 204, 804: 236, 805: 210, 806: 242, 807: 213, 808: 245, 809: 123, 810: 125, 811: 92, 812: 94, 813: 95, 814: 124, 815: 126, 816: 196, 817: 228, 818: 214, 819: 246, 820: 223, 821: 165, 822: 164, 823: 9474, 824: 197, 825: 229, 826: 216, 827: 248, 828: 9484, 829: 9488, 830: 9492, 831: 9496 }, hu = [4352, 4384, 4608, 4640, 5376, 5408, 5632, 5664, 5888, 5920, 4096, 4864, 4896, 5120, 5152], du = function e(t, i) { e.prototype.init.call(this), this.field_ = t || 0, this.dataChannel_ = i || 0, this.name_ = "CC" + (1 + (this.field_ << 1 | this.dataChannel_)), this.setConstants(), this.reset(), this.push = function (e) { var t, i, n, r, a; if ((t = 32639 & e.ccData) !== this.lastControlCode_) { if (4096 == (61440 & t) ? this.lastControlCode_ = t : t !== this.PADDING_ && (this.lastControlCode_ = null), n = t >>> 8, r = 255 & t, t !== this.PADDING_) if (t === this.RESUME_CAPTION_LOADING_) this.mode_ = "popOn"; else if (t === this.END_OF_CAPTION_) this.mode_ = "popOn", this.clearFormatting(e.pts), this.flushDisplayed(e.pts), i = this.displayed_, this.displayed_ = this.nonDisplayed_, this.nonDisplayed_ = i, this.startPts_ = e.pts; else if (t === this.ROLL_UP_2_ROWS_) this.rollUpRows_ = 2, this.setRollUp(e.pts); else if (t === this.ROLL_UP_3_ROWS_) this.rollUpRows_ = 3, this.setRollUp(e.pts); else if (t === this.ROLL_UP_4_ROWS_) this.rollUpRows_ = 4, this.setRollUp(e.pts); else if (t === this.CARRIAGE_RETURN_) this.clearFormatting(e.pts), this.flushDisplayed(e.pts), this.shiftRowsUp_(), this.startPts_ = e.pts; else if (t === this.BACKSPACE_) "popOn" === this.mode_ ? this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1) : this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1); else if (t === this.ERASE_DISPLAYED_MEMORY_) this.flushDisplayed(e.pts), this.displayed_ = lu(); else if (t === this.ERASE_NON_DISPLAYED_MEMORY_) this.nonDisplayed_ = lu(); else if (t === this.RESUME_DIRECT_CAPTIONING_) "paintOn" !== this.mode_ && (this.flushDisplayed(e.pts), this.displayed_ = lu()), this.mode_ = "paintOn", this.startPts_ = e.pts; else if (this.isSpecialCharacter(n, r)) a = uu((n = (3 & n) << 8) | r), this[this.mode_](e.pts, a), this.column_++; else if (this.isExtCharacter(n, r)) "popOn" === this.mode_ ? this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1) : this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1), a = uu((n = (3 & n) << 8) | r), this[this.mode_](e.pts, a), this.column_++; else if (this.isMidRowCode(n, r)) this.clearFormatting(e.pts), this[this.mode_](e.pts, " "), this.column_++, 14 == (14 & r) && this.addFormatting(e.pts, ["i"]), 1 == (1 & r) && this.addFormatting(e.pts, ["u"]); else if (this.isOffsetControlCode(n, r)) this.column_ += 3 & r; else if (this.isPAC(n, r)) { var s = hu.indexOf(7968 & t); "rollUp" === this.mode_ && (s - this.rollUpRows_ + 1 < 0 && (s = this.rollUpRows_ - 1), this.setRollUp(e.pts, s)), s !== this.row_ && (this.clearFormatting(e.pts), this.row_ = s), 1 & r && -1 === this.formatting_.indexOf("u") && this.addFormatting(e.pts, ["u"]), 16 == (16 & t) && (this.column_ = 4 * ((14 & t) >> 1)), this.isColorPAC(r) && 14 == (14 & r) && this.addFormatting(e.pts, ["i"]) } else this.isNormalChar(n) && (0 === r && (r = null), a = uu(n), a += uu(r), this[this.mode_](e.pts, a), this.column_ += a.length) } else this.lastControlCode_ = null } }; du.prototype = new ou, du.prototype.flushDisplayed = function (e) { var t = this.displayed_.map(function (e) { try { return e.trim() } catch (e) { return "" } }).join("\n").replace(/^\n+|\n+$/g, ""); t.length && this.trigger("data", { startPts: this.startPts_, endPts: e, text: t, stream: this.name_ }) }, du.prototype.reset = function () { this.mode_ = "popOn", this.topRow_ = 0, this.startPts_ = 0, this.displayed_ = lu(), this.nonDisplayed_ = lu(), this.lastControlCode_ = null, this.column_ = 0, this.row_ = 14, this.rollUpRows_ = 2, this.formatting_ = [] }, du.prototype.setConstants = function () { 0 === this.dataChannel_ ? (this.BASE_ = 16, this.EXT_ = 17, this.CONTROL_ = (20 | this.field_) << 8, this.OFFSET_ = 23) : 1 === this.dataChannel_ && (this.BASE_ = 24, this.EXT_ = 25, this.CONTROL_ = (28 | this.field_) << 8, this.OFFSET_ = 31), this.PADDING_ = 0, this.RESUME_CAPTION_LOADING_ = 32 | this.CONTROL_, this.END_OF_CAPTION_ = 47 | this.CONTROL_, this.ROLL_UP_2_ROWS_ = 37 | this.CONTROL_, this.ROLL_UP_3_ROWS_ = 38 | this.CONTROL_, this.ROLL_UP_4_ROWS_ = 39 | this.CONTROL_, this.CARRIAGE_RETURN_ = 45 | this.CONTROL_, this.RESUME_DIRECT_CAPTIONING_ = 41 | this.CONTROL_, this.BACKSPACE_ = 33 | this.CONTROL_, this.ERASE_DISPLAYED_MEMORY_ = 44 | this.CONTROL_, this.ERASE_NON_DISPLAYED_MEMORY_ = 46 | this.CONTROL_ }, du.prototype.isSpecialCharacter = function (e, t) { return e === this.EXT_ && 48 <= t && t <= 63 }, du.prototype.isExtCharacter = function (e, t) { return (e === this.EXT_ + 1 || e === this.EXT_ + 2) && 32 <= t && t <= 63 }, du.prototype.isMidRowCode = function (e, t) { return e === this.EXT_ && 32 <= t && t <= 47 }, du.prototype.isOffsetControlCode = function (e, t) { return e === this.OFFSET_ && 33 <= t && t <= 35 }, du.prototype.isPAC = function (e, t) { return e >= this.BASE_ && e < this.BASE_ + 8 && 64 <= t && t <= 127 }, du.prototype.isColorPAC = function (e) { return 64 <= e && e <= 79 || 96 <= e && e <= 127 }, du.prototype.isNormalChar = function (e) { return 32 <= e && e <= 127 }, du.prototype.setRollUp = function (e, t) { if ("rollUp" !== this.mode_ && (this.row_ = 14, this.mode_ = "rollUp", this.flushDisplayed(e), this.nonDisplayed_ = lu(), this.displayed_ = lu()), void 0 !== t && t !== this.row_) for (var i = 0; i < this.rollUpRows_; i++)this.displayed_[t - i] = this.displayed_[this.row_ - i], this.displayed_[this.row_ - i] = ""; void 0 === t && (t = this.row_), this.topRow_ = t - this.rollUpRows_ + 1 }, du.prototype.addFormatting = function (e, t) { this.formatting_ = this.formatting_.concat(t); var i = t.reduce(function (e, t) { return e + "<" + t + ">" }, ""); this[this.mode_](e, i) }, du.prototype.clearFormatting = function (e) { if (this.formatting_.length) { var t = this.formatting_.reverse().reduce(function (e, t) { return e + "" }, ""); this.formatting_ = [], this[this.mode_](e, t) } }, du.prototype.popOn = function (e, t) { var i = this.nonDisplayed_[this.row_]; i += t, this.nonDisplayed_[this.row_] = i }, du.prototype.rollUp = function (e, t) { var i = this.displayed_[this.row_]; i += t, this.displayed_[this.row_] = i }, du.prototype.shiftRowsUp_ = function () { var e; for (e = 0; e < this.topRow_; e++)this.displayed_[e] = ""; for (e = this.row_ + 1; e < 15; e++)this.displayed_[e] = ""; for (e = this.topRow_; e < this.row_; e++)this.displayed_[e] = this.displayed_[e + 1]; this.displayed_[this.row_] = "" }, du.prototype.paintOn = function (e, t) { var i = this.displayed_[this.row_]; i += t, this.displayed_[this.row_] = i }; function pu(e, t) { for (var i = e, n = 0; n < t.length; n++) { var r = t[n]; if (i < r.size) return r; i -= r.size } return null } function fu(e, c) { var n = eu.findBox(e, ["moof", "traf"]), t = eu.findBox(e, ["mdat"]), h = {}, r = []; return t.forEach(function (e, t) { var i = n[t]; r.push({ mdat: e, traf: i }) }), r.forEach(function (e) { var t, i = e.mdat, n = e.traf, r = eu.findBox(n, ["tfhd"]), a = $o.parseTfhd(r[0]), s = a.trackId, o = eu.findBox(n, ["tfdt"]), u = 0 < o.length ? $o.parseTfdt(o[0]).baseMediaDecodeTime : 0, l = eu.findBox(n, ["trun"]); c === s && 0 < l.length && (t = function (e, t, i) { var n, r, a, s, o = new DataView(e.buffer, e.byteOffset, e.byteLength), u = []; for (r = 0; r + 4 < e.length; r += a)if (a = o.getUint32(r), r += 4, !(a <= 0)) switch (31 & e[r]) { case 6: var l = e.subarray(r + 1, r + 1 + a), c = pu(r, t); n = { nalUnitType: "sei_rbsp", size: a, data: l, escapedRBSP: gu(l), trackId: i }, c ? (n.pts = c.pts, n.dts = c.dts, s = c) : (n.pts = s.pts, n.dts = s.dts), u.push(n) }return u }(i, function (e, t, i) { var n = t, r = i.defaultSampleDuration || 0, a = i.defaultSampleSize || 0, s = i.trackId, o = []; return e.forEach(function (e) { var t = $o.parseTrun(e).samples; t.forEach(function (e) { void 0 === e.duration && (e.duration = r), void 0 === e.size && (e.size = a), e.trackId = s, e.dts = n, void 0 === e.compositionTimeOffset && (e.compositionTimeOffset = 0), e.pts = n + e.compositionTimeOffset, n += e.duration }), o = o.concat(t) }), o }(l, u, a), s), h[s] || (h[s] = []), h[s] = h[s].concat(t)) }), h } function mu(e, t) { var i = 1; for (t < e && (i = -1); 4294967296 < Math.abs(t - e);)e += 8589934592 * i; return e } var gu = ru, vu = su, yu = function () { var t, a, s, o, u, i, n = !1; this.isInitialized = function () { return n }, this.init = function (e) { t = new vu, n = !0, i = !!e && e.isPartial, t.on("data", function (e) { e.startTime = e.startPts / o, e.endTime = e.endPts / o, u.captions.push(e), u.captionStreams[e.stream] = !0 }) }, this.isNewInit = function (e, t) { return !(e && 0 === e.length || t && "object" == typeof t && 0 === Object.keys(t).length) && (s !== e[0] || o !== t[s]) }, this.parse = function (e, t, i) { var n; if (!this.isInitialized()) return null; if (!t || !i) return null; if (this.isNewInit(t, i)) s = t[0], o = i[s]; else if (null === s || !o) return a.push(e), null; for (; 0 < a.length;) { var r = a.shift(); this.parse(r, t, i) } return null !== (n = function (e, t, i) { return null === t ? null : { seiNals: fu(e, t)[t], timescale: i } }(e, s, o)) && n.seiNals ? (this.pushNals(n.seiNals), this.flushStream(), u) : null }, this.pushNals = function (e) { if (!this.isInitialized() || !e || 0 === e.length) return null; e.forEach(function (e) { t.push(e) }) }, this.flushStream = function () { if (!this.isInitialized()) return null; i ? t.partialFlush() : t.flush() }, this.clearParsedCaptions = function () { u.captions = [], u.captionStreams = {} }, this.resetCaptionStream = function () { if (!this.isInitialized()) return null; t.reset() }, this.clearAllCaptions = function () { this.clearParsedCaptions(), this.resetCaptionStream() }, this.reset = function () { a = [], o = s = null, u ? this.clearParsedCaptions() : u = { captions: [], captionStreams: {} }, this.resetCaptionStream() }, this.reset() }, _u = 27, bu = 15, Tu = 21; new ou; function Su(e) { var t = 31 & e[1]; return t <<= 8, t |= e[2] } function ku(e) { return !!(64 & e[1]) } function Cu(e) { var t = 0; return 1 < (48 & e[3]) >>> 4 && (t += e[4] + 1), t } function Eu(e) { switch (e) { case 5: return "slice_layer_without_partitioning_rbsp_idr"; case 6: return "sei_rbsp"; case 7: return "seq_parameter_set_rbsp"; case 8: return "pic_parameter_set_rbsp"; case 9: return "access_unit_delimiter_rbsp"; default: return null } } function wu(e) { return e[0] << 21 | e[1] << 14 | e[2] << 7 | e[3] } var Au, Iu, xu, Pu, Lu = { parseType: function (e, t) { var i = Su(e); return 0 === i ? "pat" : i === t ? "pmt" : t ? "pes" : null }, parsePat: function (e) { var t = ku(e), i = 4 + Cu(e); return t && (i += e[i] + 1), (31 & e[i + 10]) << 8 | e[i + 11] }, parsePmt: function (e) { var t = {}, i = ku(e), n = 4 + Cu(e); if (i && (n += e[n] + 1), 1 & e[n + 5]) { var r; r = 3 + ((15 & e[n + 1]) << 8 | e[n + 2]) - 4; for (var a = 12 + ((15 & e[n + 10]) << 8 | e[n + 11]); a < r;) { var s = n + a; t[(31 & e[s + 1]) << 8 | e[s + 2]] = e[s], a += 5 + ((15 & e[s + 3]) << 8 | e[s + 4]) } return t } }, parsePayloadUnitStartIndicator: ku, parsePesType: function (e, t) { switch (t[Su(e)]) { case _u: return "video"; case bu: return "audio"; case Tu: return "timed-metadata"; default: return null } }, parsePesTime: function (e) { if (!ku(e)) return null; var t = 4 + Cu(e); if (t >= e.byteLength) return null; var i, n = null; return 192 & (i = e[t + 7]) && ((n = {}).pts = (14 & e[t + 9]) << 27 | (255 & e[t + 10]) << 20 | (254 & e[t + 11]) << 12 | (255 & e[t + 12]) << 5 | (254 & e[t + 13]) >>> 3, n.pts *= 4, n.pts += (6 & e[t + 13]) >>> 1, n.dts = n.pts, 64 & i && (n.dts = (14 & e[t + 14]) << 27 | (255 & e[t + 15]) << 20 | (254 & e[t + 16]) << 12 | (255 & e[t + 17]) << 5 | (254 & e[t + 18]) >>> 3, n.dts *= 4, n.dts += (6 & e[t + 18]) >>> 1)), n }, videoPacketContainsKeyFrame: function (e) { for (var t = 4 + Cu(e), i = e.subarray(t), n = 0, r = 0, a = !1; r < i.byteLength - 3; r++)if (1 === i[r + 2]) { n = r + 5; break } for (; n < i.byteLength;)switch (i[n]) { case 0: if (0 !== i[n - 1]) { n += 2; break } if (0 !== i[n - 2]) { n++; break } for (r + 3 !== n - 2 && "slice_layer_without_partitioning_rbsp_idr" === Eu(31 & i[r + 3]) && (a = !0); 1 !== i[++n] && n < i.length;); r = n - 2, n += 3; break; case 1: if (0 !== i[n - 1] || 0 !== i[n - 2]) { n += 3; break } "slice_layer_without_partitioning_rbsp_idr" === Eu(31 & i[r + 3]) && (a = !0), r = n - 2, n += 3; break; default: n += 3 }return i = i.subarray(r), n -= r, r = 0, i && 3 < i.byteLength && "slice_layer_without_partitioning_rbsp_idr" === Eu(31 & i[r + 3]) && (a = !0), a } }, Ou = [96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350], Du = { isLikelyAacData: function (e) { return e[0] === "I".charCodeAt(0) && e[1] === "D".charCodeAt(0) && e[2] === "3".charCodeAt(0) }, parseId3TagSize: function (e, t) { var i = e[t + 6] << 21 | e[t + 7] << 14 | e[t + 8] << 7 | e[t + 9]; return (16 & e[t + 5]) >> 4 ? 20 + i : 10 + i }, parseAdtsSize: function (e, t) { var i = (224 & e[t + 5]) >> 5, n = e[t + 4] << 3; return 6144 & e[t + 3] | n | i }, parseType: function (e, t) { return e[t] === "I".charCodeAt(0) && e[t + 1] === "D".charCodeAt(0) && e[t + 2] === "3".charCodeAt(0) ? "timed-metadata" : !0 & e[t] && 240 == (240 & e[t + 1]) ? "audio" : null }, parseSampleRate: function (e) { for (var t = 0; t + 5 < e.length;) { if (255 === e[t] && 240 == (246 & e[t + 1])) return Ou[(60 & e[t + 2]) >>> 2]; t++ } return null }, parseAacTimestamp: function (e) { var t, i, n; t = 10, 64 & e[5] && (t += 4, t += wu(e.subarray(10, 14))); do { if ((i = wu(e.subarray(t + 4, t + 8))) < 1) return null; if ("PRIV" === String.fromCharCode(e[t], e[t + 1], e[t + 2], e[t + 3])) { n = e.subarray(t + 10, t + i + 10); for (var r = 0; r < n.byteLength; r++)if (0 === n[r]) { if ("com.apple.streaming.transportStreamTimestamp" !== unescape(function (e, t, i) { var n, r = ""; for (n = t; n < i; n++)r += "%" + ("00" + e[n].toString(16)).slice(-2); return r }(n, 0, r))) break; var a = n.subarray(r + 1), s = (1 & a[3]) << 30 | a[4] << 22 | a[5] << 14 | a[6] << 6 | a[7] >>> 2; return s *= 4, s += 3 & a[7] } } t += 10, t += i } while (t < e.byteLength); return null } }, Nu = 9e4, Ru = (Au = function (e) { return 9e4 * e }, Iu = function (e, t) { return e * t }, xu = function (e) { return e / 9e4 }, Pu = function (e, t) { return e / t }, mu), Uu = {}; Uu.ts = Lu, Uu.aac = Du; function Mu(e, t, i) { for (var n, r, a, s, o = 0, u = Hu, l = !1; u <= e.byteLength;)if (71 !== e[o] || 71 !== e[u] && u !== e.byteLength) o++, u++; else { switch (n = e.subarray(o, u), Uu.ts.parseType(n, t.pid)) { case "pes": r = Uu.ts.parsePesType(n, t.table), a = Uu.ts.parsePayloadUnitStartIndicator(n), "audio" === r && a && (s = Uu.ts.parsePesTime(n)) && (s.type = "audio", i.audio.push(s), l = !0) }if (l) break; o += Hu, u += Hu } for (o = (u = e.byteLength) - Hu, l = !1; 0 <= o;)if (71 !== e[o] || 71 !== e[u] && u !== e.byteLength) o--, u--; else { switch (n = e.subarray(o, u), Uu.ts.parseType(n, t.pid)) { case "pes": r = Uu.ts.parsePesType(n, t.table), a = Uu.ts.parsePayloadUnitStartIndicator(n), "audio" === r && a && (s = Uu.ts.parsePesTime(n)) && (s.type = "audio", i.audio.push(s), l = !0) }if (l) break; o -= Hu, u -= Hu } } function Bu(e, t, i) { for (var n, r, a, s, o, u, l, c = 0, h = Hu, d = !1, p = { data: [], size: 0 }; h < e.byteLength;)if (71 !== e[c] || 71 !== e[h]) c++, h++; else { switch (n = e.subarray(c, h), Uu.ts.parseType(n, t.pid)) { case "pes": if (r = Uu.ts.parsePesType(n, t.table), a = Uu.ts.parsePayloadUnitStartIndicator(n), "video" === r && (a && !d && (s = Uu.ts.parsePesTime(n)) && (s.type = "video", i.video.push(s), d = !0), !i.firstKeyFrame)) { if (a && 0 !== p.size) { for (o = new Uint8Array(p.size), u = 0; p.data.length;)l = p.data.shift(), o.set(l, u), u += l.byteLength; if (Uu.ts.videoPacketContainsKeyFrame(o)) { var f = Uu.ts.parsePesTime(o); f && (i.firstKeyFrame = f, i.firstKeyFrame.type = "video") } p.size = 0 } p.data.push(n), p.size += n.byteLength } }if (d && i.firstKeyFrame) break; c += Hu, h += Hu } for (c = (h = e.byteLength) - Hu, d = !1; 0 <= c;)if (71 !== e[c] || 71 !== e[h]) c--, h--; else { switch (n = e.subarray(c, h), Uu.ts.parseType(n, t.pid)) { case "pes": r = Uu.ts.parsePesType(n, t.table), a = Uu.ts.parsePayloadUnitStartIndicator(n), "video" === r && a && (s = Uu.ts.parsePesTime(n)) && (s.type = "video", i.video.push(s), d = !0) }if (d) break; c -= Hu, h -= Hu } } function ju(e) { var t = { pid: null, table: null }, i = {}; for (var n in function (e, t) { for (var i, n = 0, r = Hu; r < e.byteLength;)if (71 !== e[n] || 71 !== e[r]) n++, r++; else { switch (i = e.subarray(n, r), Uu.ts.parseType(i, t.pid)) { case "pat": t.pid || (t.pid = Uu.ts.parsePat(i)); break; case "pmt": t.table || (t.table = Uu.ts.parsePmt(i)) }if (t.pid && t.table) return; n += Hu, r += Hu } }(e, t), t.table) { if (t.table.hasOwnProperty(n)) switch (t.table[n]) { case _u: i.video = [], Bu(e, t, i), 0 === i.video.length && delete i.video; break; case bu: i.audio = [], Mu(e, t, i), 0 === i.audio.length && delete i.audio } } return i } var Fu = Nu, Hu = 188, Vu = function (e, t) { var i; return (i = Uu.aac.isLikelyAacData(e) ? function (e) { for (var t, i = !1, n = 0, r = null, a = null, s = 0, o = 0; 3 <= e.length - o;) { switch (Uu.aac.parseType(e, o)) { case "timed-metadata": if (e.length - o < 10) { i = !0; break } if ((s = Uu.aac.parseId3TagSize(e, o)) > e.length) { i = !0; break } null === a && (t = e.subarray(o, o + s), a = Uu.aac.parseAacTimestamp(t)), o += s; break; case "audio": if (e.length - o < 7) { i = !0; break } if ((s = Uu.aac.parseAdtsSize(e, o)) > e.length) { i = !0; break } null === r && (t = e.subarray(o, o + s), r = Uu.aac.parseSampleRate(t)), n++, o += s; break; default: o++ }if (i) return null } if (null === r || null === a) return null; var u = Fu / r; return { audio: [{ type: "audio", dts: a, pts: a }, { type: "audio", dts: a + 1024 * n * u, pts: a + 1024 * n * u }] } }(e) : ju(e)) && (i.audio || i.video) ? (function (e, t) { if (e.audio && e.audio.length) { var i = t; "undefined" == typeof i && (i = e.audio[0].dts), e.audio.forEach(function (e) { e.dts = Ru(e.dts, i), e.pts = Ru(e.pts, i), e.dtsTime = e.dts / Fu, e.ptsTime = e.pts / Fu }) } if (e.video && e.video.length) { var n = t; if ("undefined" == typeof n && (n = e.video[0].dts), e.video.forEach(function (e) { e.dts = Ru(e.dts, n), e.pts = Ru(e.pts, n), e.dtsTime = e.dts / Fu, e.ptsTime = e.pts / Fu }), e.firstKeyFrame) { var r = e.firstKeyFrame; r.dts = Ru(r.dts, n), r.pts = Ru(r.pts, n), r.dtsTime = r.dts / Fu, r.ptsTime = r.dts / Fu } } }(i, t), i) : null }; function qu(e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") } var Wu = function (e, t, i) { return t && zu(e.prototype, t), i && zu(e, i), e }; function zu(e, t) { for (var i = 0; i < t.length; i++) { var n = t[i]; n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n) } } var Gu = null, Xu = (Ku.prototype.decrypt = function (e, t, i, n, r, a) { var s = this._key[1], o = e ^ s[0], u = n ^ s[1], l = i ^ s[2], c = t ^ s[3], h = void 0, d = void 0, p = void 0, f = s.length / 4 - 2, m = void 0, g = 4, v = this._tables[1], y = v[0], _ = v[1], b = v[2], T = v[3], S = v[4]; for (m = 0; m < f; m++)h = y[o >>> 24] ^ _[u >> 16 & 255] ^ b[l >> 8 & 255] ^ T[255 & c] ^ s[g], d = y[u >>> 24] ^ _[l >> 16 & 255] ^ b[c >> 8 & 255] ^ T[255 & o] ^ s[g + 1], p = y[l >>> 24] ^ _[c >> 16 & 255] ^ b[o >> 8 & 255] ^ T[255 & u] ^ s[g + 2], c = y[c >>> 24] ^ _[o >> 16 & 255] ^ b[u >> 8 & 255] ^ T[255 & l] ^ s[g + 3], g += 4, o = h, u = d, l = p; for (m = 0; m < 4; m++)r[(3 & -m) + a] = S[o >>> 24] << 24 ^ S[u >> 16 & 255] << 16 ^ S[l >> 8 & 255] << 8 ^ S[255 & c] ^ s[g++], h = o, o = u, u = l, l = c, c = h }, Ku); function Ku(e) { qu(this, Ku), Gu = Gu || function () { var e = [[[], [], [], [], []], [[], [], [], [], []]], t = e[0], i = e[1], n = t[4], r = i[4], a = void 0, s = void 0, o = void 0, u = [], l = [], c = void 0, h = void 0, d = void 0, p = void 0, f = void 0; for (a = 0; a < 256; a++)l[(u[a] = a << 1 ^ 283 * (a >> 7)) ^ a] = a; for (s = o = 0; !n[s]; s ^= c || 1, o = l[o] || 1)for (d = (d = o ^ o << 1 ^ o << 2 ^ o << 3 ^ o << 4) >> 8 ^ 255 & d ^ 99, f = 16843009 * u[h = u[c = u[r[n[s] = d] = s]]] ^ 65537 * h ^ 257 * c ^ 16843008 * s, p = 257 * u[d] ^ 16843008 * d, a = 0; a < 4; a++)t[a][s] = p = p << 24 ^ p >>> 8, i[a][d] = f = f << 24 ^ f >>> 8; for (a = 0; a < 5; a++)t[a] = t[a].slice(0), i[a] = i[a].slice(0); return e }(), this._tables = [[Gu[0][0].slice(), Gu[0][1].slice(), Gu[0][2].slice(), Gu[0][3].slice(), Gu[0][4].slice()], [Gu[1][0].slice(), Gu[1][1].slice(), Gu[1][2].slice(), Gu[1][3].slice(), Gu[1][4].slice()]]; var t = void 0, i = void 0, n = void 0, r = void 0, a = void 0, s = this._tables[0][4], o = this._tables[1], u = e.length, l = 1; if (4 !== u && 6 !== u && 8 !== u) throw new Error("Invalid aes key size"); for (r = e.slice(0), a = [], this._key = [r, a], t = u; t < 4 * u + 28; t++)n = r[t - 1], (t % u == 0 || 8 === u && t % u == 4) && (n = s[n >>> 24] << 24 ^ s[n >> 16 & 255] << 16 ^ s[n >> 8 & 255] << 8 ^ s[255 & n], t % u == 0 && (n = n << 8 ^ n >>> 24 ^ l << 24, l = l << 1 ^ 283 * (l >> 7))), r[t] = r[t - u] ^ n; for (i = 0; t; i++, t--)n = r[3 & i ? t : t - 4], a[i] = t <= 4 || i < 4 ? n : o[0][s[n >>> 24]] ^ o[1][s[n >> 16 & 255]] ^ o[2][s[n >> 8 & 255]] ^ o[3][s[255 & n]] } var Yu = ($u.prototype.on = function (e, t) { this.listeners[e] || (this.listeners[e] = []), this.listeners[e].push(t) }, $u.prototype.off = function (e, t) { if (!this.listeners[e]) return !1; var i = this.listeners[e].indexOf(t); return this.listeners[e].splice(i, 1), -1 < i }, $u.prototype.trigger = function (e, t) { var i = this.listeners[e]; if (i) if (2 === arguments.length) for (var n = i.length, r = 0; r < n; ++r)i[r].call(this, t); else for (var a = Array.prototype.slice.call(arguments, 1), s = i.length, o = 0; o < s; ++o)i[o].apply(this, a) }, $u.prototype.dispose = function () { this.listeners = {} }, $u.prototype.pipe = function (t) { this.on("data", function (e) { t.push(e) }) }, $u); function $u() { qu(this, $u), this.listeners = {} } var Qu, Ju = (function (e, t) { if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t); e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t) }(Zu, Qu = Yu), Zu.prototype.processJob_ = function () { this.jobs.shift()(), this.jobs.length ? this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay) : this.timeout_ = null }, Zu.prototype.push = function (e) { this.jobs.push(e), this.timeout_ || (this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay)) }, Zu); function Zu() { qu(this, Zu); var e = function (e, t) { if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return !t || "object" != typeof t && "function" != typeof t ? e : t }(this, Qu.call(this, Yu)); return e.jobs = [], e.delay = 1, e.timeout_ = null, e } function el(e) { return e << 24 | (65280 & e) << 8 | (16711680 & e) >> 8 | e >>> 24 } function tl(e, t, i) { var n = new Int32Array(e.buffer, e.byteOffset, e.byteLength >> 2), r = new Xu(Array.prototype.slice.call(t)), a = new Uint8Array(e.byteLength), s = new Int32Array(a.buffer), o = void 0, u = void 0, l = void 0, c = void 0, h = void 0, d = void 0, p = void 0, f = void 0, m = void 0; for (o = i[0], u = i[1], l = i[2], c = i[3], m = 0; m < n.length; m += 4)h = el(n[m]), d = el(n[m + 1]), p = el(n[m + 2]), f = el(n[m + 3]), r.decrypt(h, d, p, f, s, m), s[m] = el(s[m] ^ o), s[m + 1] = el(s[m + 1] ^ u), s[m + 2] = el(s[m + 2] ^ l), s[m + 3] = el(s[m + 3] ^ c), o = h, u = d, l = p, c = f; return a } var il = (nl.prototype.decryptChunk_ = function (t, i, n, r) { return function () { var e = tl(t, i, n); r.set(e, t.byteOffset) } }, Wu(nl, null, [{ key: "STEP", get: function () { return 32e3 } }]), nl); function nl(e, t, i, n) { qu(this, nl); var r = nl.STEP, a = new Int32Array(e.buffer), s = new Uint8Array(e.byteLength), o = 0; for (this.asyncStream_ = new Ju, this.asyncStream_.push(this.decryptChunk_(a.subarray(o, o + r), t, i, s)), o = r; o < a.length; o += r)i = new Uint32Array([el(a[o - 4]), el(a[o - 3]), el(a[o - 2]), el(a[o - 1])]), this.asyncStream_.push(this.decryptChunk_(a.subarray(o, o + r), t, i, s)); this.asyncStream_.push(function () { n(null, function (e) { return e.subarray(0, e.byteLength - e[e.byteLength - 1]) }(s)) }) } function rl(e, t) { return /^[a-z]+:/i.test(t) ? t : (/\/\//i.test(e) || (e = la.buildAbsoluteURL(y.location.href, e)), la.buildAbsoluteURL(e, t)) } function al(e, t, i) { return e && i.responseURL && t !== i.responseURL ? i.responseURL : t } function sl(e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") } + /** + * @videojs/http-streaming + * @version 1.12.3 + * @copyright 2020 Brightcove, Inc + * @license Apache-2.0 + */ + var ol = function (e, t, i) { return t && ul(e.prototype, t), i && ul(e, i), e }; function ul(e, t) { for (var i = 0; i < t.length; i++) { var n = t[i]; n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n) } } function ll(e, t) { if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t); e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t) } function cl(e, t) { if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return !t || "object" != typeof t && "function" != typeof t ? e : t } function hl(r, a) { ["AUDIO", "SUBTITLES"].forEach(function (e) { for (var t in r.mediaGroups[e]) for (var i in r.mediaGroups[e][t]) { var n = r.mediaGroups[e][t][i]; a(n, e, t, i) } }) } function dl(e, t) { var i = yl(e, {}), n = i.playlists[t.id]; if (!n) return null; if (n.segments && t.segments && n.segments.length === t.segments.length && n.endList === t.endList && n.mediaSequence === t.mediaSequence) return null; var r = yl(n, t); n.segments && (r.segments = function (e, t, i) { var n = t.slice(); i = i || 0; for (var r = Math.min(e.length, t.length + i), a = i; a < r; a++)n[a - i] = yl(e[a], n[a - i]); return n }(n.segments, t.segments, t.mediaSequence - n.mediaSequence)), r.segments.forEach(function (e) { !function (e, t) { e.resolvedUri || (e.resolvedUri = rl(t, e.uri)), e.key && !e.key.resolvedUri && (e.key.resolvedUri = rl(t, e.key.uri)), e.map && !e.map.resolvedUri && (e.map.resolvedUri = rl(t, e.map.uri)) }(e, r.resolvedUri) }); for (var a = 0; a < i.playlists.length; a++)i.playlists[a].id === t.id && (i.playlists[a] = r); return i.playlists[t.id] = r, i.playlists[t.uri] = r, i } function pl(e, t) { return e + "-" + t } function fl(e) { for (var t = e.playlists.length; t--;) { var i = e.playlists[t]; i.resolvedUri = rl(e.uri, i.uri), i.id = pl(t, i.uri), e.playlists[i.id] = i, (e.playlists[i.uri] = i).attributes || (i.attributes = {}, _l.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")) } } function ml(t) { hl(t, function (e) { e.uri && (e.resolvedUri = rl(t.uri, e.uri)) }) } function gl(e, t) { var i = e.segments[e.segments.length - 1]; return t && i && i.duration ? 1e3 * i.duration : 500 * (e.targetDuration || 10) } var vl = function (e, t) { if (Array.isArray(e)) return e; if (Symbol.iterator in Object(e)) return function (e, t) { var i = [], n = !0, r = !1, a = void 0; try { for (var s, o = e[Symbol.iterator](); !(n = (s = o.next()).done) && (i.push(s.value), !t || i.length !== t); n = !0); } catch (e) { r = !0, a = e } finally { try { !n && o.return && o.return() } finally { if (r) throw a } } return i }(e, t); throw new TypeError("Invalid attempt to destructure non-iterable instance") }, yl = sa.mergeOptions, _l = sa.log, bl = (ll(Tl, sa.EventTarget), ol(Tl, [{ key: "playlistRequestError", value: function (e, t, i) { var n = t.uri, r = t.id; this.request = null, i && (this.state = i), this.error = { playlist: this.master.playlists[r], status: e.status, message: "HLS playlist request error at URL: " + n + ".", responseText: e.responseText, code: 500 <= e.status ? 4 : 2 }, this.trigger("error") } }, { key: "haveMetadata", value: function (e, t, i) { var n = this; this.request = null, this.state = "HAVE_METADATA"; var r = new ga; this.customTagParsers.forEach(function (e) { return r.addParser(e) }), this.customTagMappers.forEach(function (e) { return r.addTagMapper(e) }), r.push(e.responseText), r.end(), r.manifest.uri = t, r.manifest.id = i, r.manifest.attributes = r.manifest.attributes || {}; var a = dl(this.master, r.manifest); this.targetDuration = r.manifest.targetDuration, a ? (this.master = a, this.media_ = this.master.playlists[i]) : this.trigger("playlistunchanged"), this.media().endList || (y.clearTimeout(this.mediaUpdateTimeout), this.mediaUpdateTimeout = y.setTimeout(function () { n.trigger("mediaupdatetimeout") }, gl(this.media(), !!a))), this.trigger("loadedplaylist") } }, { key: "dispose", value: function () { this.trigger("dispose"), this.stopRequest(), y.clearTimeout(this.mediaUpdateTimeout), y.clearTimeout(this.finalRenditionTimeout), this.off() } }, { key: "stopRequest", value: function () { if (this.request) { var e = this.request; this.request = null, e.onreadystatechange = null, e.abort() } } }, { key: "media", value: function (i, e) { var n = this; if (!i) return this.media_; if ("HAVE_NOTHING" === this.state) throw new Error("Cannot switch media playlist from " + this.state); if ("string" == typeof i) { if (!this.master.playlists[i]) throw new Error("Unknown playlist URI: " + i); i = this.master.playlists[i] } if (y.clearTimeout(this.finalRenditionTimeout), e) { var t = i.targetDuration / 2 * 1e3 || 5e3; this.finalRenditionTimeout = y.setTimeout(this.media.bind(this, i, !1), t) } else { var r = this.state, a = !this.media_ || i.id !== this.media_.id; if (this.master.playlists[i.id].endList) return this.request && (this.request.onreadystatechange = null, this.request.abort(), this.request = null), this.state = "HAVE_METADATA", this.media_ = i, void (a && (this.trigger("mediachanging"), this.trigger("mediachange"))); if (a) { if (this.state = "SWITCHING_MEDIA", this.request) { if (i.resolvedUri === this.request.url) return; this.request.onreadystatechange = null, this.request.abort(), this.request = null } this.media_ && this.trigger("mediachanging"), this.request = this.hls_.xhr({ uri: i.resolvedUri, withCredentials: this.withCredentials }, function (e, t) { if (n.request) { if (i.resolvedUri = al(n.handleManifestRedirects, i.resolvedUri, t), e) return n.playlistRequestError(n.request, i, r); n.haveMetadata(t, i.uri, i.id), "HAVE_MASTER" === r ? n.trigger("loadedmetadata") : n.trigger("mediachange") } }) } } } }, { key: "pause", value: function () { this.stopRequest(), y.clearTimeout(this.mediaUpdateTimeout), "HAVE_NOTHING" === this.state && (this.started = !1), "SWITCHING_MEDIA" === this.state ? this.media_ ? this.state = "HAVE_METADATA" : this.state = "HAVE_MASTER" : "HAVE_CURRENT_METADATA" === this.state && (this.state = "HAVE_METADATA") } }, { key: "load", value: function (e) { var t = this; y.clearTimeout(this.mediaUpdateTimeout); var i = this.media(); if (e) { var n = i ? i.targetDuration / 2 * 1e3 : 5e3; this.mediaUpdateTimeout = y.setTimeout(function () { return t.load() }, n) } else this.started ? i && !i.endList ? this.trigger("mediaupdatetimeout") : this.trigger("loadedplaylist") : this.start() } }, { key: "start", value: function () { var r = this; this.started = !0, this.request = this.hls_.xhr({ uri: this.srcUrl, withCredentials: this.withCredentials }, function (e, t) { if (r.request) { if (r.request = null, e) return r.error = { status: t.status, message: "HLS playlist request error at URL: " + r.srcUrl + ".", responseText: t.responseText, code: 2 }, "HAVE_NOTHING" === r.state && (r.started = !1), r.trigger("error"); var i = new ga; if (r.customTagParsers.forEach(function (e) { return i.addParser(e) }), r.customTagMappers.forEach(function (e) { return i.addTagMapper(e) }), i.push(t.responseText), i.end(), r.state = "HAVE_MASTER", r.srcUrl = al(r.handleManifestRedirects, r.srcUrl, t), i.manifest.uri = r.srcUrl, i.manifest.playlists) return r.master = i.manifest, fl(r.master), ml(r.master), r.trigger("loadedplaylist"), void (r.request || r.media(i.manifest.playlists[0])); var n = pl(0, r.srcUrl); return r.master = { mediaGroups: { AUDIO: {}, VIDEO: {}, "CLOSED-CAPTIONS": {}, SUBTITLES: {} }, uri: y.location.href, playlists: [{ uri: r.srcUrl, id: n, resolvedUri: r.srcUrl, attributes: {} }] }, r.master.playlists[n] = r.master.playlists[0], r.master.playlists[r.srcUrl] = r.master.playlists[0], r.haveMetadata(t, r.srcUrl, n), r.trigger("loadedmetadata") } }) } }]), Tl); function Tl(e, t) { var i = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : {}; sl(this, Tl); var n = cl(this, (Tl.__proto__ || Object.getPrototypeOf(Tl)).call(this)), r = i.withCredentials, a = void 0 !== r && r, s = i.handleManifestRedirects, o = void 0 !== s && s; n.srcUrl = e, n.hls_ = t, n.withCredentials = a, n.handleManifestRedirects = o; var u = t.options_; if (n.customTagParsers = u && u.customTagParsers || [], n.customTagMappers = u && u.customTagMappers || [], !n.srcUrl) throw new Error("A non-empty playlist URL is required"); return n.state = "HAVE_NOTHING", n.on("mediaupdatetimeout", function () { "HAVE_METADATA" === n.state && (n.state = "HAVE_CURRENT_METADATA", n.request = n.hls_.xhr({ uri: rl(n.master.uri, n.media().uri), withCredentials: n.withCredentials }, function (e, t) { if (n.request) return e ? n.playlistRequestError(n.request, n.media(), "HAVE_METADATA") : void n.haveMetadata(n.request, n.media().uri, n.media().id) })) }), n } function Sl(e, t, i) { var n, r; return "undefined" == typeof t && (t = e.mediaSequence + e.segments.length), t < e.mediaSequence ? 0 : (n = function (e, t) { var i = 0, n = t - e.mediaSequence, r = e.segments[n]; if (r) { if ("undefined" != typeof r.start) return { result: r.start, precise: !0 }; if ("undefined" != typeof r.end) return { result: r.end - r.duration, precise: !0 } } for (; n--;) { if ("undefined" != typeof (r = e.segments[n]).end) return { result: i + r.end, precise: !0 }; if (i += r.duration, "undefined" != typeof r.start) return { result: i + r.start, precise: !0 } } return { result: i, precise: !1 } }(e, t)).precise ? n.result : (r = function (e, t) { for (var i = 0, n = void 0, r = t - e.mediaSequence; r < e.segments.length; r++) { if ("undefined" != typeof (n = e.segments[r]).start) return { result: n.start - i, precise: !0 }; if (i += n.duration, "undefined" != typeof n.end) return { result: n.end - i, precise: !0 } } return { result: -1, precise: !1 } }(e, t)).precise ? r.result : n.result + i } function kl(e, t, i) { if (!e) return 0; if ("number" != typeof i && (i = 0), "undefined" == typeof t) { if (e.totalDuration) return e.totalDuration; if (!e.endList) return y.Infinity } return Sl(e, t, i) } function Cl(e, t, i) { var n = 0; if (i < t) { var r = [i, t]; t = r[0], i = r[1] } if (t < 0) { for (var a = t; a < Math.min(0, i); a++)n += e.targetDuration; t = 0 } for (var s = t; s < i; s++)n += e.segments[s].duration; return n } function El(e, t) { if (!e.segments.length) return 0; var i = e.segments.length, n = e.segments[i - 1].duration || e.targetDuration, r = "number" == typeof t ? t : n + 2 * e.targetDuration; if (0 === r) return i; for (var a = 0; i-- && !(r <= (a += e.segments[i].duration));); return Math.max(0, i) } function wl(e, t, i, n) { if (!e || !e.segments) return null; if (e.endList) return kl(e); if (null === t) return null; t = t || 0; var r = i ? El(e, n) : e.segments.length; return Sl(e, e.mediaSequence + r, t) } function Al(e) { return e - Math.floor(e) == 0 } function Il(e, t) { if (Al(t)) return t + .1 * e; for (var i = t.toString().split(".")[1].length, n = 1; n <= i; n++) { var r = Math.pow(10, n), a = t * r; if (Al(a) || n === i) return (a + e) / r } } function xl(e) { return e.excludeUntil && e.excludeUntil > Date.now() } function Pl(e) { return e.excludeUntil && e.excludeUntil === 1 / 0 } function Ll(e) { var t = xl(e); return !e.disabled && !t } function Ol(e, t) { return t.attributes && t.attributes[e] } function Dl(e, t) { if (1 === e.playlists.length) return !0; var i = t.attributes.BANDWIDTH || Number.MAX_VALUE; return 0 === e.playlists.filter(function (e) { return !!Ll(e) && (e.attributes.BANDWIDTH || 0) < i }).length } function Nl() { return function e(t, n) { t = nc({ timeout: 45e3 }, t); var i = e.beforeRequest || sa.Hls.xhr.beforeRequest; if (i && "function" == typeof i) { var r = i(t); r && (t = r) } var a = ic(t, function (e, t) { var i = a.response; !e && i && (a.responseTime = Date.now(), a.roundTripTime = a.responseTime - a.requestTime, a.bytesReceived = i.byteLength || i.length, a.bandwidth || (a.bandwidth = Math.floor(a.bytesReceived / a.roundTripTime * 8 * 1e3))), t.headers && (a.responseHeaders = t.headers), e && "ETIMEDOUT" === e.code && (a.timedout = !0), e || a.aborted || 200 === t.statusCode || 206 === t.statusCode || 0 === t.statusCode || (e = new Error("XHR Failed with a response of: " + (a && (i || a.responseText)))), n(e, a) }), s = a.abort; return a.abort = function () { return a.aborted = !0, s.apply(a, arguments) }, a.uri = t.uri, a.requestTime = Date.now(), a } } function Rl(e) { var t = {}; return e.byterange && (t.Range = function (e) { var t; return t = e.offset + e.length - 1, "bytes=" + e.offset + "-" + t }(e.byterange)), t } function Ul(e, t) { var i = e.toString(16); return "00".substring(0, 2 - i.length) + i + (t % 2 ? " " : "") } function Ml(e) { return 32 <= e && e < 126 ? String.fromCharCode(e) : "." } function Bl(i) { var n = {}; return Object.keys(i).forEach(function (e) { var t = i[e]; ArrayBuffer.isView(t) ? n[e] = { bytes: t.buffer, byteOffset: t.byteOffset, byteLength: t.byteLength } : n[e] = t }), n } function jl(e) { var t = e.byterange || { length: 1 / 0, offset: 0 }; return [t.length, t.offset, e.resolvedUri].join(",") } function Fl(e) { return e.resolvedUri } function Hl(e) { for (var t = Array.prototype.slice.call(e), i = "", n = 0; n < t.length / 16; n++)i += t.slice(16 * n, 16 * n + 16).map(Ul).join("") + " " + t.slice(16 * n, 16 * n + 16).map(Ml).join("") + "\n"; return i } function Vl(e) { var t = e.playlist, i = e.time, n = void 0 === i ? void 0 : i, r = e.callback; if (!r) throw new Error("getProgramTime: callback must be provided"); if (!t || void 0 === n) return r({ message: "getProgramTime: playlist and time must be provided" }); var a = function (e, t) { if (!t || !t.segments || 0 === t.segments.length) return null; for (var i = 0, n = void 0, r = 0; r < t.segments.length && !(e <= (i = (n = t.segments[r]).videoTimingInfo ? n.videoTimingInfo.transmuxedPresentationEnd : i + n.duration)); r++); var a = t.segments[t.segments.length - 1]; if (a.videoTimingInfo && a.videoTimingInfo.transmuxedPresentationEnd < e) return null; if (i < e) { if (e > i + .25 * a.duration) return null; n = a } return { segment: n, estimatedStart: n.videoTimingInfo ? n.videoTimingInfo.transmuxedPresentationStart : i - n.duration, type: n.videoTimingInfo ? "accurate" : "estimate" } }(n, t); if (!a) return r({ message: "valid programTime was not found" }); if ("estimate" === a.type) return r({ message: "Accurate programTime could not be determined. Please seek to e.seekTime and try again", seekTime: a.estimatedStart }); var s = { mediaSeconds: n }, o = function (e, t) { if (!t.dateTimeObject) return null; var i = t.videoTimingInfo.transmuxerPrependedSeconds, n = e - (t.videoTimingInfo.transmuxedPresentationStart + i); return new Date(t.dateTimeObject.getTime() + 1e3 * n) }(n, a.segment); return o && (s.programDateTime = o.toISOString()), r(null, s) } function ql(e) { var t = e.programTime, i = e.playlist, n = e.retryCount, r = void 0 === n ? 2 : n, a = e.seekTo, s = e.pauseAfterSeek, o = void 0 === s || s, u = e.tech, l = e.callback; if (!l) throw new Error("seekToProgramTime: callback must be provided"); if ("undefined" == typeof t || !i || !a) return l({ message: "seekToProgramTime: programTime, seekTo and playlist must be provided" }); if (!i.endList && !u.hasStarted_) return l({ message: "player must be playing a live stream to start buffering" }); if (!function (e) { if (!e.segments || 0 === e.segments.length) return !1; for (var t = 0; t < e.segments.length; t++) { if (!e.segments[t].dateTimeObject) return !1 } return !0 }(i)) return l({ message: "programDateTime tags must be provided in the manifest " + i.resolvedUri }); var c = function (e, t) { var i = void 0; try { i = new Date(e) } catch (e) { return null } if (!t || !t.segments || 0 === t.segments.length) return null; var n = t.segments[0]; if (i < n.dateTimeObject) return null; for (var r = 0; r < t.segments.length - 1; r++) { if (n = t.segments[r], i < t.segments[r + 1].dateTimeObject) break } var a = t.segments[t.segments.length - 1], s = a.dateTimeObject, o = a.videoTimingInfo ? function (e) { return e.transmuxedPresentationEnd - e.transmuxedPresentationStart - e.transmuxerPrependedSeconds }(a.videoTimingInfo) : a.duration + .25 * a.duration; return new Date(s.getTime() + 1e3 * o) < i ? null : (s < i && (n = a), { segment: n, estimatedStart: n.videoTimingInfo ? n.videoTimingInfo.transmuxedPresentationStart : tc.duration(t, t.mediaSequence + t.segments.indexOf(n)), type: n.videoTimingInfo ? "accurate" : "estimate" }) }(t, i); if (!c) return l({ message: t + " was not found in the stream" }); var h = c.segment, d = function (e, t) { var i = void 0, n = void 0; try { i = new Date(e), n = new Date(t) } catch (e) { } var r = i.getTime(); return (n.getTime() - r) / 1e3 }(h.dateTimeObject, t); if ("estimate" === c.type) return 0 === r ? l({ message: t + " is not buffered yet. Try again" }) : (a(c.estimatedStart + d), void u.one("seeked", function () { ql({ programTime: t, playlist: i, retryCount: r - 1, seekTo: a, pauseAfterSeek: o, tech: u, callback: l }) })); var p = h.start + d; u.one("seeked", function () { return l(null, u.currentTime()) }), o && u.pause(), a(p) } function Wl(e, t) { var i = [], n = void 0; if (e && e.length) for (n = 0; n < e.length; n++)t(e.start(n), e.end(n)) && i.push([e.start(n), e.end(n)]); return sa.createTimeRanges(i) } function zl(e, i) { return Wl(e, function (e, t) { return e - .1 <= i && i <= t + .1 }) } function Gl(e, t) { return Wl(e, function (e) { return t <= e - 1 / 30 }) } function Xl(e) { var t = []; if (!e || !e.length) return ""; for (var i = 0; i < e.length; i++)t.push(e.start(i) + " => " + e.end(i)); return t.join(", ") } function Kl(e) { for (var t = [], i = 0; i < e.length; i++)t.push({ start: e.start(i), end: e.end(i) }); return t } function Yl(e, t, i) { var n = void 0, r = void 0; if (i && i.cues) for (n = i.cues.length; n--;)(r = i.cues[n]).startTime <= t && r.endTime >= e && i.removeCue(r) } function $l(e) { return isNaN(e) || Math.abs(e) === 1 / 0 ? Number.MAX_VALUE : e } function Ql(e, t, i) { var n = y.WebKitDataCue || y.VTTCue; if (t && t.forEach(function (e) { var t = e.stream; this.inbandTextTracks_[t].addCue(new n(e.startTime + this.timestampOffset, e.endTime + this.timestampOffset, e.text)) }, e), i) { var r = $l(e.mediaSource_.duration); if (i.forEach(function (e) { var i = e.cueTime + this.timestampOffset; !("number" != typeof i || y.isNaN(i) || i < 0) && i < 1 / 0 && e.frames.forEach(function (e) { var t = new n(i, i, e.value || e.url || e.data || ""); t.frame = e, t.value = e, function (e) { Object.defineProperties(e.frame, { id: { get: function () { return sa.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."), e.value.key } }, value: { get: function () { return sa.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."), e.value.data } }, privateData: { get: function () { return sa.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."), e.value.data } } }) }(t), this.metadataTrack_.addCue(t) }, this) }, e), e.metadataTrack_ && e.metadataTrack_.cues && e.metadataTrack_.cues.length) { for (var a = e.metadataTrack_.cues, s = [], o = 0; o < a.length; o++)a[o] && s.push(a[o]); var u = s.reduce(function (e, t) { var i = e[t.startTime] || []; return i.push(t), e[t.startTime] = i, e }, {}), l = Object.keys(u).sort(function (e, t) { return Number(e) - Number(t) }); l.forEach(function (e, t) { var i = u[e], n = Number(l[t + 1]) || r; i.forEach(function (e) { e.endTime = n }) }) } } } var Jl = sa.createTimeRange, Zl = Il.bind(null, 1), ec = Il.bind(null, -1), tc = { duration: kl, seekable: function (e, t, i) { var n = t || 0, r = wl(e, t, !0, i); return null === r ? Jl() : Jl(n, r) }, safeLiveIndex: El, getMediaInfoForTime: function (e, t, i, n) { var r = void 0, a = void 0, s = e.segments.length, o = t - n; if (o < 0) { if (0 < i) for (r = i - 1; 0 <= r; r--)if (a = e.segments[r], 0 < (o += ec(a.duration))) return { mediaIndex: r, startTime: n - Cl(e, i, r) }; return { mediaIndex: 0, startTime: t } } if (i < 0) { for (r = i; r < 0; r++)if ((o -= e.targetDuration) < 0) return { mediaIndex: 0, startTime: t }; i = 0 } for (r = i; r < s; r++)if (a = e.segments[r], (o -= Zl(a.duration)) < 0) return { mediaIndex: r, startTime: n + Cl(e, i, r) }; return { mediaIndex: s - 1, startTime: t } }, isEnabled: Ll, isDisabled: function (e) { return e.disabled }, isBlacklisted: xl, isIncompatible: Pl, playlistEnd: wl, isAes: function (e) { for (var t = 0; t < e.segments.length; t++)if (e.segments[t].key) return !0; return !1 }, isFmp4: function (e) { for (var t = 0; t < e.segments.length; t++)if (e.segments[t].map) return !0; return !1 }, hasAttribute: Ol, estimateSegmentRequestTime: function (e, t, i, n) { var r = 3 < arguments.length && void 0 !== n ? n : 0; return Ol("BANDWIDTH", i) ? (e * i.attributes.BANDWIDTH - 8 * r) / t : NaN }, isLowestEnabledRendition: Dl }, ic = sa.xhr, nc = sa.mergeOptions, rc = Object.freeze({ createTransferableMessage: Bl, initSegmentId: jl, segmentKeyId: Fl, hexDump: Hl, tagDump: function (e) { var t = e.bytes; return Hl(t) }, textRanges: function (e) { var t, i, n = "", r = void 0; for (r = 0; r < e.length; r++)n += (i = r, (t = e).start(i) + "-" + t.end(i) + " "); return n } }), ac = "undefined" != typeof window ? window : {}, sc = "undefined" == typeof Symbol ? "__target" : Symbol(), oc = "application/javascript", uc = ac.BlobBuilder || ac.WebKitBlobBuilder || ac.MozBlobBuilder || ac.MSBlobBuilder, lc = ac.URL || ac.webkitURL || lc && lc.msURL, cc = ac.Worker; function hc(r, a) { return function (e) { var t = this; if (!a) return new cc(r); if (cc && !e) { var i = mc(a.toString().replace(/^function.+?{/, "").slice(0, -1)); return this[sc] = new cc(i), function (e, t) { if (!e || !t) return; var i = e.terminate; e.objURL = t, e.terminate = function () { e.objURL && lc.revokeObjectURL(e.objURL), i.call(e) } }(this[sc], i), this[sc] } var n = { postMessage: function (e) { t.onmessage && setTimeout(function () { t.onmessage({ data: e, target: n }) }) } }; a.call(n), this.postMessage = function (e) { setTimeout(function () { n.onmessage({ data: e, target: t }) }) }, this.isThisThread = !0 } } if (cc) { var dc, pc = mc("self.onmessage = function () {}"), fc = new Uint8Array(1); try { (dc = new cc(pc)).postMessage(fc, [fc.buffer]) } catch (e) { cc = null } finally { lc.revokeObjectURL(pc), dc && dc.terminate() } } function mc(t) { try { return lc.createObjectURL(new Blob([t], { type: oc })) } catch (e) { var i = new uc; return i.append(t), lc.createObjectURL(i.getBlob(type)) } } function gc(e) { return e.map(function (e) { return e.replace(/avc1\.(\d+)\.(\d+)/i, function (e, t, i) { return "avc1." + ("00" + Number(t).toString(16)).slice(-2) + "00" + ("00" + Number(i).toString(16)).slice(-2) }) }) } function vc(e) { var t, i = 0 < arguments.length && void 0 !== e ? e : "", n = { codecCount: 0 }; return n.codecCount = i.split(",").length, n.codecCount = n.codecCount || 2, (t = /(^|\s|,)+(avc[13])([^ ,]*)/i.exec(i)) && (n.videoCodec = t[2], n.videoObjectTypeIndicator = t[3]), n.audioProfile = /(^|\s|,)+mp4a.[0-9A-Fa-f]+\.([0-9A-Fa-f]+)/i.exec(i), n.audioProfile = n.audioProfile && n.audioProfile[2], n } function yc(e, t, i) { return e + "/" + t + '; codecs="' + i.filter(function (e) { return !!e }).join(", ") + '"' } function _c(e, t) { var i = function (e) { return e.segments && e.segments.length && e.segments[0].map ? "mp4" : "mp2t" }(t), n = function (e) { var t = e.attributes || {}; return t.CODECS ? vc(t.CODECS) : Cc }(t), r = t.attributes || {}, a = !0, s = !1; if (!t) return []; if (e.mediaGroups.AUDIO && r.AUDIO) { var o = e.mediaGroups.AUDIO[r.AUDIO]; if (o) for (var u in a = !(s = !0), o) if (!o[u].uri && !o[u].playlists) { a = !0; break } } s && !n.audioProfile && (a || (n.audioProfile = function (e, t) { if (!e.mediaGroups.AUDIO || !t) return null; var i = e.mediaGroups.AUDIO[t]; if (!i) return null; for (var n in i) { var r = i[n]; if (r.default && r.playlists) return vc(r.playlists[0].attributes.CODECS).audioProfile } return null }(e, r.AUDIO)), n.audioProfile || (sa.log.warn("Multiple audio tracks present but no audio codec string is specified. Attempting to use the default audio codec (mp4a.40.2)"), n.audioProfile = Cc.audioProfile)); var l = {}; n.videoCodec && (l.video = "" + n.videoCodec + n.videoObjectTypeIndicator), n.audioProfile && (l.audio = "mp4a.40." + n.audioProfile); var c = yc("audio", i, [l.audio]), h = yc("video", i, [l.video]), d = yc("video", i, [l.video, l.audio]); return s ? !a && l.video ? [h, c] : a || l.video ? [d, c] : [c, c] : l.video ? [d] : [c] } function bc(e) { var r = { type: "", parameters: {} }, t = e.trim().split(";"); return r.type = t.shift().trim(), t.forEach(function (e) { var t = e.trim().split("="); if (1 < t.length) { var i = t[0].replace(/"/g, "").trim(), n = t[1].replace(/"/g, "").trim(); r.parameters[i] = n } }), r } function Tc(e) { return /mp4a\.\d+.\d+/i.test(e) } function Sc(e) { return /avc1\.[\da-f]+/i.test(e) } var kc = new hc("./transmuxer-worker.worker.js", function (e, t) { var kt = this; !function () { function e() { this.init = function () { var a = {}; this.on = function (e, t) { a[e] || (a[e] = []), a[e] = a[e].concat(t) }, this.off = function (e, t) { var i; return !!a[e] && (i = a[e].indexOf(t), a[e] = a[e].slice(), a[e].splice(i, 1), -1 < i) }, this.trigger = function (e) { var t, i, n, r; if (t = a[e]) if (2 === arguments.length) for (n = t.length, i = 0; i < n; ++i)t[i].call(this, arguments[1]); else { for (r = [], i = arguments.length, i = 1; i < arguments.length; ++i)r.push(arguments[i]); for (n = t.length, i = 0; i < n; ++i)t[i].apply(this, r) } }, this.dispose = function () { a = {} } } } e.prototype.pipe = function (t) { return this.on("data", function (e) { t.push(e) }), this.on("done", function (e) { t.flush(e) }), this.on("partialdone", function (e) { t.partialFlush(e) }), this.on("endedtimeline", function (e) { t.endTimeline(e) }), this.on("reset", function (e) { t.reset(e) }), t }, e.prototype.push = function (e) { this.trigger("data", e) }, e.prototype.flush = function (e) { this.trigger("done", e) }, e.prototype.partialFlush = function (e) { this.trigger("partialdone", e) }, e.prototype.endTimeline = function (e) { this.trigger("endedtimeline", e) }, e.prototype.reset = function (e) { this.trigger("reset", e) }; var l, t, i, r, a, n, s, o, u, c, h, d, p, f, m, g, v, y, _, b, T, S, k, C, E, w, A, I, x, P, L, O, D, N, R, U, M, B, j, F, H = e, V = Math.pow(2, 32) - 1; !function () { var e; if (S = { avc1: [], avcC: [], btrt: [], dinf: [], dref: [], esds: [], ftyp: [], hdlr: [], mdat: [], mdhd: [], mdia: [], mfhd: [], minf: [], moof: [], moov: [], mp4a: [], mvex: [], mvhd: [], pasp: [], sdtp: [], smhd: [], stbl: [], stco: [], stsc: [], stsd: [], stsz: [], stts: [], styp: [], tfdt: [], tfhd: [], traf: [], trak: [], trun: [], trex: [], tkhd: [], vmhd: [] }, "undefined" != typeof Uint8Array) { for (e in S) S.hasOwnProperty(e) && (S[e] = [e.charCodeAt(0), e.charCodeAt(1), e.charCodeAt(2), e.charCodeAt(3)]); k = new Uint8Array(["i".charCodeAt(0), "s".charCodeAt(0), "o".charCodeAt(0), "m".charCodeAt(0)]), E = new Uint8Array(["a".charCodeAt(0), "v".charCodeAt(0), "c".charCodeAt(0), "1".charCodeAt(0)]), C = new Uint8Array([0, 0, 0, 1]), w = 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]), A = 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]), I = { video: w, audio: A }, L = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 12, 117, 114, 108, 32, 0, 0, 0, 1]), P = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0]), O = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0]), D = O, N = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), R = O, x = new Uint8Array([0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0]) } }(), l = function (e) { var t, i, n = [], r = 0; for (t = 1; t < arguments.length; t++)n.push(arguments[t]); for (t = n.length; t--;)r += n[t].byteLength; for (i = new Uint8Array(r + 8), new DataView(i.buffer, i.byteOffset, i.byteLength).setUint32(0, i.byteLength), i.set(e, 4), t = 0, r = 8; t < n.length; t++)i.set(n[t], r), r += n[t].byteLength; return i }, t = function () { return l(S.dinf, l(S.dref, L)) }, i = function (e) { return l(S.esds, new Uint8Array([0, 0, 0, 0, 3, 25, 0, 0, 0, 4, 17, 64, 21, 0, 6, 0, 0, 0, 218, 192, 0, 0, 218, 192, 5, 2, e.audioobjecttype << 3 | e.samplingfrequencyindex >>> 1, e.samplingfrequencyindex << 7 | e.channelcount << 3, 6, 1, 2])) }, m = function (e) { return l(S.hdlr, I[e]) }, f = function (e) { var t = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 3, 0, 1, 95, 144, e.duration >>> 24 & 255, e.duration >>> 16 & 255, e.duration >>> 8 & 255, 255 & e.duration, 85, 196, 0, 0]); return e.samplerate && (t[12] = e.samplerate >>> 24 & 255, t[13] = e.samplerate >>> 16 & 255, t[14] = e.samplerate >>> 8 & 255, t[15] = 255 & e.samplerate), l(S.mdhd, t) }, p = function (e) { return l(S.mdia, f(e), m(e.type), n(e)) }, a = function (e) { return l(S.mfhd, new Uint8Array([0, 0, 0, 0, (4278190080 & e) >> 24, (16711680 & e) >> 16, (65280 & e) >> 8, 255 & e])) }, n = function (e) { return l(S.minf, "video" === e.type ? l(S.vmhd, x) : l(S.smhd, P), t(), v(e)) }, s = function (e, t) { for (var i = [], n = t.length; n--;)i[n] = _(t[n]); return l.apply(null, [S.moof, a(e)].concat(i)) }, o = function (e) { for (var t = e.length, i = []; t--;)i[t] = h(e[t]); return l.apply(null, [S.moov, c(4294967295)].concat(i).concat(u(e))) }, u = function (e) { for (var t = e.length, i = []; t--;)i[t] = b(e[t]); return l.apply(null, [S.mvex].concat(i)) }, c = function (e) { var t = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 1, 95, 144, (4278190080 & e) >> 24, (16711680 & e) >> 16, (65280 & e) >> 8, 255 & e, 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 l(S.mvhd, t) }, g = function (e) { var t, i, n = e.samples || [], r = new Uint8Array(4 + n.length); for (i = 0; i < n.length; i++)t = n[i].flags, r[i + 4] = t.dependsOn << 4 | t.isDependedOn << 2 | t.hasRedundancy; return l(S.sdtp, r) }, v = function (e) { return l(S.stbl, y(e), l(S.stts, R), l(S.stsc, D), l(S.stsz, N), l(S.stco, O)) }, y = function (e) { return l(S.stsd, new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1]), "video" === e.type ? U(e) : M(e)) }, U = function (e) { var t, i, n = e.sps || [], r = e.pps || [], a = [], s = []; for (t = 0; t < n.length; t++)a.push((65280 & n[t].byteLength) >>> 8), a.push(255 & n[t].byteLength), a = a.concat(Array.prototype.slice.call(n[t])); for (t = 0; t < r.length; t++)s.push((65280 & r[t].byteLength) >>> 8), s.push(255 & r[t].byteLength), s = s.concat(Array.prototype.slice.call(r[t])); if (i = [S.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, (65280 & e.width) >> 8, 255 & e.width, (65280 & e.height) >> 8, 255 & e.height, 0, 72, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 1, 19, 118, 105, 100, 101, 111, 106, 115, 45, 99, 111, 110, 116, 114, 105, 98, 45, 104, 108, 115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 17, 17]), l(S.avcC, new Uint8Array([1, e.profileIdc, e.profileCompatibility, e.levelIdc, 255].concat([n.length], a, [r.length], s))), l(S.btrt, new Uint8Array([0, 28, 156, 128, 0, 45, 198, 192, 0, 45, 198, 192]))], e.sarRatio) { var o = e.sarRatio[0], u = e.sarRatio[1]; i.push(l(S.pasp, new Uint8Array([(4278190080 & o) >> 24, (16711680 & o) >> 16, (65280 & o) >> 8, 255 & o, (4278190080 & u) >> 24, (16711680 & u) >> 16, (65280 & u) >> 8, 255 & u]))) } return l.apply(null, i) }, M = function (e) { return l(S.mp4a, new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, (65280 & e.channelcount) >> 8, 255 & e.channelcount, (65280 & e.samplesize) >> 8, 255 & e.samplesize, 0, 0, 0, 0, (65280 & e.samplerate) >> 8, 255 & e.samplerate, 0, 0]), i(e)) }, d = function (e) { var t = new Uint8Array([0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, (4278190080 & e.id) >> 24, (16711680 & e.id) >> 16, (65280 & e.id) >> 8, 255 & e.id, 0, 0, 0, 0, (4278190080 & e.duration) >> 24, (16711680 & e.duration) >> 16, (65280 & e.duration) >> 8, 255 & e.duration, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, (65280 & e.width) >> 8, 255 & e.width, 0, 0, (65280 & e.height) >> 8, 255 & e.height, 0, 0]); return l(S.tkhd, t) }, _ = function (e) { var t, i, n, r, a, s; return t = l(S.tfhd, new Uint8Array([0, 0, 0, 58, (4278190080 & e.id) >> 24, (16711680 & e.id) >> 16, (65280 & e.id) >> 8, 255 & e.id, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])), a = Math.floor(e.baseMediaDecodeTime / (1 + V)), s = Math.floor(e.baseMediaDecodeTime % (1 + V)), i = l(S.tfdt, new Uint8Array([1, 0, 0, 0, a >>> 24 & 255, a >>> 16 & 255, a >>> 8 & 255, 255 & a, s >>> 24 & 255, s >>> 16 & 255, s >>> 8 & 255, 255 & s])), 92, "audio" === e.type ? (n = T(e, 92), l(S.traf, t, i, n)) : (r = g(e), n = T(e, r.length + 92), l(S.traf, t, i, n, r)) }, h = function (e) { return e.duration = e.duration || 4294967295, l(S.trak, d(e), p(e)) }, b = function (e) { var t = new Uint8Array([0, 0, 0, 0, (4278190080 & e.id) >> 24, (16711680 & e.id) >> 16, (65280 & e.id) >> 8, 255 & e.id, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1]); return "video" !== e.type && (t[t.length - 1] = 0), l(S.trex, t) }, F = function (e, t) { var i = 0, n = 0, r = 0, a = 0; return e.length && (void 0 !== e[0].duration && (i = 1), void 0 !== e[0].size && (n = 2), void 0 !== e[0].flags && (r = 4), void 0 !== e[0].compositionTimeOffset && (a = 8)), [0, 0, i | n | r | a, 1, (4278190080 & e.length) >>> 24, (16711680 & e.length) >>> 16, (65280 & e.length) >>> 8, 255 & e.length, (4278190080 & t) >>> 24, (16711680 & t) >>> 16, (65280 & t) >>> 8, 255 & t] }, j = function (e, t) { var i, n, r, a; for (t += 20 + 16 * (n = e.samples || []).length, i = F(n, t), a = 0; a < n.length; a++)r = n[a], i = i.concat([(4278190080 & r.duration) >>> 24, (16711680 & r.duration) >>> 16, (65280 & r.duration) >>> 8, 255 & r.duration, (4278190080 & r.size) >>> 24, (16711680 & r.size) >>> 16, (65280 & r.size) >>> 8, 255 & r.size, r.flags.isLeading << 2 | r.flags.dependsOn, r.flags.isDependedOn << 6 | r.flags.hasRedundancy << 4 | r.flags.paddingValue << 1 | r.flags.isNonSyncSample, 61440 & r.flags.degradationPriority, 15 & r.flags.degradationPriority, (4278190080 & r.compositionTimeOffset) >>> 24, (16711680 & r.compositionTimeOffset) >>> 16, (65280 & r.compositionTimeOffset) >>> 8, 255 & r.compositionTimeOffset]); return l(S.trun, new Uint8Array(i)) }, B = function (e, t) { var i, n, r, a; for (t += 20 + 8 * (n = e.samples || []).length, i = F(n, t), a = 0; a < n.length; a++)r = n[a], i = i.concat([(4278190080 & r.duration) >>> 24, (16711680 & r.duration) >>> 16, (65280 & r.duration) >>> 8, 255 & r.duration, (4278190080 & r.size) >>> 24, (16711680 & r.size) >>> 16, (65280 & r.size) >>> 8, 255 & r.size]); return l(S.trun, new Uint8Array(i)) }, T = function (e, t) { return "audio" === e.type ? B(e, t) : j(e, t) }; r = function () { return l(S.ftyp, k, C, k, E) }; function q(e, t) { var i = { size: 0, flags: { isLeading: 0, dependsOn: 1, isDependedOn: 0, hasRedundancy: 0, degradationPriority: 0, isNonSyncSample: 1 } }; return i.dataOffset = t, i.compositionTimeOffset = e.pts - e.dts, i.duration = e.duration, i.size = 4 * e.length, i.size += e.byteLength, e.keyFrame && (i.flags.dependsOn = 2, i.flags.isNonSyncSample = 0), i } function W(e) { for (var t = []; e--;)t.push(0); return t } function z() { z.prototype.init.call(this), this.captionPackets_ = [], this.ccStreams_ = [new xe(0, 0), new xe(0, 1), new xe(1, 0), new xe(1, 1)], this.reset(), this.ccStreams_.forEach(function (e) { e.on("data", this.trigger.bind(this, "data")), e.on("partialdone", this.trigger.bind(this, "partialdone")), e.on("done", this.trigger.bind(this, "done")) }, this) } var G, X, K, Y, $, Q = function (e) { return l(S.mdat, e) }, J = s, Z = function (e) { var t, i = r(), n = o(e); return (t = new Uint8Array(i.byteLength + n.byteLength)).set(i), t.set(n, i.byteLength), t }, ee = function (e) { var t, i, n = [], r = []; for (r.byteLength = 0, r.nalCount = 0, r.duration = 0, t = n.byteLength = 0; t < e.length; t++)"access_unit_delimiter_rbsp" === (i = e[t]).nalUnitType ? (n.length && (n.duration = i.dts - n.dts, r.byteLength += n.byteLength, r.nalCount += n.length, r.duration += n.duration, r.push(n)), (n = [i]).byteLength = i.data.byteLength, n.pts = i.pts, n.dts = i.dts) : ("slice_layer_without_partitioning_rbsp_idr" === i.nalUnitType && (n.keyFrame = !0), n.duration = i.dts - n.dts, n.byteLength += i.data.byteLength, n.push(i)); return r.length && (!n.duration || n.duration <= 0) && (n.duration = r[r.length - 1].duration), r.byteLength += n.byteLength, r.nalCount += n.length, r.duration += n.duration, r.push(n), r }, te = function (e) { var t, i, n = [], r = []; for (n.byteLength = 0, n.nalCount = 0, n.duration = 0, n.pts = e[0].pts, n.dts = e[0].dts, r.byteLength = 0, r.nalCount = 0, r.duration = 0, r.pts = e[0].pts, r.dts = e[0].dts, t = 0; t < e.length; t++)(i = e[t]).keyFrame ? (n.length && (r.push(n), r.byteLength += n.byteLength, r.nalCount += n.nalCount, r.duration += n.duration), (n = [i]).nalCount = i.length, n.byteLength = i.byteLength, n.pts = i.pts, n.dts = i.dts, n.duration = i.duration) : (n.duration += i.duration, n.nalCount += i.length, n.byteLength += i.byteLength, n.push(i)); return r.length && n.duration <= 0 && (n.duration = r[r.length - 1].duration), r.byteLength += n.byteLength, r.nalCount += n.nalCount, r.duration += n.duration, r.push(n), r }, ie = function (e) { var t; return !e[0][0].keyFrame && 1 < e.length && (t = e.shift(), e.byteLength -= t.byteLength, e.nalCount -= t.nalCount, e[0][0].dts = t.dts, e[0][0].pts = t.pts, e[0][0].duration += t.duration), e }, ne = function (e, t) { var i, n, r, a, s, o = t || 0, u = []; for (i = 0; i < e.length; i++)for (a = e[i], n = 0; n < a.length; n++)s = a[n], o += (r = q(s, o)).size, u.push(r); return u }, re = function (e) { var t, i, n, r, a, s, o = 0, u = e.byteLength, l = e.nalCount, c = new Uint8Array(u + 4 * l), h = new DataView(c.buffer); for (t = 0; t < e.length; t++)for (r = e[t], i = 0; i < r.length; i++)for (a = r[i], n = 0; n < a.length; n++)s = a[n], h.setUint32(o, s.data.byteLength), o += 4, c.set(s.data, o), o += s.data.byteLength; return c }, ae = [33, 16, 5, 32, 164, 27], se = [33, 65, 108, 84, 1, 2, 4, 8, 168, 2, 4, 8, 17, 191, 252], oe = { 96e3: [ae, [227, 64], W(154), [56]], 88200: [ae, [231], W(170), [56]], 64e3: [ae, [248, 192], W(240), [56]], 48e3: [ae, [255, 192], W(268), [55, 148, 128], W(54), [112]], 44100: [ae, [255, 192], W(268), [55, 163, 128], W(84), [112]], 32e3: [ae, [255, 192], W(268), [55, 234], W(226), [112]], 24e3: [ae, [255, 192], W(268), [55, 255, 128], W(268), [111, 112], W(126), [224]], 16e3: [ae, [255, 192], W(268), [55, 255, 128], W(268), [111, 255], W(269), [223, 108], W(195), [1, 192]], 12e3: [se, W(268), [3, 127, 248], W(268), [6, 255, 240], W(268), [13, 255, 224], W(268), [27, 253, 128], W(259), [56]], 11025: [se, W(268), [3, 127, 248], W(268), [6, 255, 240], W(268), [13, 255, 224], W(268), [27, 255, 192], W(268), [55, 175, 128], W(108), [112]], 8e3: [se, W(268), [3, 121, 16], W(47), [7]] }, ue = (G = oe, Object.keys(G).reduce(function (e, t) { return e[t] = new Uint8Array(G[t].reduce(function (e, t) { return e.concat(t) }, [])), e }, {})), le = 9e4, ce = (X = function (e) { return 9e4 * e }, K = function (e, t) { return e * t }, Y = function (e) { return e / 9e4 }, $ = function (e, t) { return e / t }, function (e, t) { return X($(e, t)) }), he = function (e, t) { return K(Y(e), t) }, de = function (e, t, i) { return Y(i ? e : e - t) }, pe = function (e, t, i, n) { var r, a, s, o, u, l = 0, c = 0, h = 0; if (t.length && (r = ce(e.baseMediaDecodeTime, e.samplerate), a = Math.ceil(le / (e.samplerate / 1024)), i && n && (l = r - Math.max(i, n), h = (c = Math.floor(l / a)) * a), !(c < 1 || le / 2 < h))) { for (s = (s = ue[e.samplerate]) || t[0].data, o = 0; o < c; o++)u = t[0], t.splice(0, 0, { data: s, dts: u.dts - a, pts: u.pts - a }); e.baseMediaDecodeTime -= Math.floor(he(h, e.samplerate)) } }, fe = function (e, t, i) { return t.minSegmentDts >= i ? e : (t.minSegmentDts = 1 / 0, e.filter(function (e) { return e.dts >= i && (t.minSegmentDts = Math.min(t.minSegmentDts, e.dts), t.minSegmentPts = t.minSegmentDts, !0) })) }, me = function (e) { var t, i, n = []; for (t = 0; t < e.length; t++)i = e[t], n.push({ size: i.data.byteLength, duration: 1024 }); return n }, ge = function (e) { var t, i, n = 0, r = new Uint8Array(function (e) { var t, i = 0; for (t = 0; t < e.length; t++)i += e[t].data.byteLength; return i }(e)); for (t = 0; t < e.length; t++)i = e[t], r.set(i.data, n), n += i.data.byteLength; return r }, ve = le, ye = function (e) { delete e.minSegmentDts, delete e.maxSegmentDts, delete e.minSegmentPts, delete e.maxSegmentPts }, _e = function (e, t) { var i, n = e.minSegmentDts; return t || (n -= e.timelineStartInfo.dts), i = e.timelineStartInfo.baseMediaDecodeTime, i += n, i = Math.max(0, i), "audio" === e.type && (i *= e.samplerate / ve, i = Math.floor(i)), i }, be = function (e, t) { "number" == typeof t.pts && (void 0 === e.timelineStartInfo.pts && (e.timelineStartInfo.pts = t.pts), void 0 === e.minSegmentPts ? e.minSegmentPts = t.pts : e.minSegmentPts = Math.min(e.minSegmentPts, t.pts), void 0 === e.maxSegmentPts ? e.maxSegmentPts = t.pts : e.maxSegmentPts = Math.max(e.maxSegmentPts, t.pts)), "number" == typeof t.dts && (void 0 === e.timelineStartInfo.dts && (e.timelineStartInfo.dts = t.dts), void 0 === e.minSegmentDts ? e.minSegmentDts = t.dts : e.minSegmentDts = Math.min(e.minSegmentDts, t.dts), void 0 === e.maxSegmentDts ? e.maxSegmentDts = t.dts : e.maxSegmentDts = Math.max(e.maxSegmentDts, t.dts)) }, Te = function (e) { for (var t = 0, i = { payloadType: -1, payloadSize: 0 }, n = 0, r = 0; t < e.byteLength && 128 !== e[t];) { for (; 255 === e[t];)n += 255, t++; for (n += e[t++]; 255 === e[t];)r += 255, t++; if (r += e[t++], !i.payload && 4 === n) { i.payloadType = n, i.payloadSize = r, i.payload = e.subarray(t, t + r); break } t += r, r = n = 0 } return i }, Se = function (e) { return 181 !== e.payload[0] ? null : 49 != (e.payload[1] << 8 | e.payload[2]) ? null : "GA94" !== String.fromCharCode(e.payload[3], e.payload[4], e.payload[5], e.payload[6]) ? null : 3 !== e.payload[7] ? null : e.payload.subarray(8, e.payload.length - 1) }, ke = function (e, t) { var i, n, r, a, s = []; if (!(64 & t[0])) return s; for (n = 31 & t[0], i = 0; i < n; i++)a = { type: 3 & t[2 + (r = 3 * i)], pts: e }, 4 & t[2 + r] && (a.ccData = t[3 + r] << 8 | t[4 + r], s.push(a)); return s }, Ce = 4; (z.prototype = new H).push = function (e) { var t, i, n; if ("sei_rbsp" === e.nalUnitType && (t = Te(e.escapedRBSP)).payloadType === Ce && (i = Se(t))) if (e.dts < this.latestDts_) this.ignoreNextEqualDts_ = !0; else { if (e.dts === this.latestDts_ && this.ignoreNextEqualDts_) return this.numSameDts_--, void (this.numSameDts_ || (this.ignoreNextEqualDts_ = !1)); n = ke(e.pts, i), this.captionPackets_ = this.captionPackets_.concat(n), this.latestDts_ !== e.dts && (this.numSameDts_ = 0), this.numSameDts_++, this.latestDts_ = e.dts } }, z.prototype.flushCCStreams = function (t) { this.ccStreams_.forEach(function (e) { return "flush" === t ? e.flush() : e.partialFlush() }, this) }, z.prototype.flushStream = function (e) { this.captionPackets_.length && (this.captionPackets_.forEach(function (e, t) { e.presortIndex = t }), this.captionPackets_.sort(function (e, t) { return e.pts === t.pts ? e.presortIndex - t.presortIndex : e.pts - t.pts }), this.captionPackets_.forEach(function (e) { e.type < 2 && this.dispatchCea608Packet(e) }, this), this.captionPackets_.length = 0), this.flushCCStreams(e) }, z.prototype.flush = function () { return this.flushStream("flush") }, z.prototype.partialFlush = function () { return this.flushStream("partialFlush") }, z.prototype.reset = function () { this.latestDts_ = null, this.ignoreNextEqualDts_ = !1, this.numSameDts_ = 0, this.activeCea608Channel_ = [null, null], this.ccStreams_.forEach(function (e) { e.reset() }) }, z.prototype.dispatchCea608Packet = function (e) { this.setsTextOrXDSActive(e) ? this.activeCea608Channel_[e.type] = null : this.setsChannel1Active(e) ? this.activeCea608Channel_[e.type] = 0 : this.setsChannel2Active(e) && (this.activeCea608Channel_[e.type] = 1), null !== this.activeCea608Channel_[e.type] && this.ccStreams_[(e.type << 1) + this.activeCea608Channel_[e.type]].push(e) }, z.prototype.setsChannel1Active = function (e) { return 4096 == (30720 & e.ccData) }, z.prototype.setsChannel2Active = function (e) { return 6144 == (30720 & e.ccData) }, z.prototype.setsTextOrXDSActive = function (e) { return 256 == (28928 & e.ccData) || 4138 == (30974 & e.ccData) || 6186 == (30974 & e.ccData) }; function Ee(e) { return null === e ? "" : (e = Ae[e] || e, String.fromCharCode(e)) } function we() { for (var e = [], t = 15; t--;)e.push(""); return e } var Ae = { 42: 225, 92: 233, 94: 237, 95: 243, 96: 250, 123: 231, 124: 247, 125: 209, 126: 241, 127: 9608, 304: 174, 305: 176, 306: 189, 307: 191, 308: 8482, 309: 162, 310: 163, 311: 9834, 312: 224, 313: 160, 314: 232, 315: 226, 316: 234, 317: 238, 318: 244, 319: 251, 544: 193, 545: 201, 546: 211, 547: 218, 548: 220, 549: 252, 550: 8216, 551: 161, 552: 42, 553: 39, 554: 8212, 555: 169, 556: 8480, 557: 8226, 558: 8220, 559: 8221, 560: 192, 561: 194, 562: 199, 563: 200, 564: 202, 565: 203, 566: 235, 567: 206, 568: 207, 569: 239, 570: 212, 571: 217, 572: 249, 573: 219, 574: 171, 575: 187, 800: 195, 801: 227, 802: 205, 803: 204, 804: 236, 805: 210, 806: 242, 807: 213, 808: 245, 809: 123, 810: 125, 811: 92, 812: 94, 813: 95, 814: 124, 815: 126, 816: 196, 817: 228, 818: 214, 819: 246, 820: 223, 821: 165, 822: 164, 823: 9474, 824: 197, 825: 229, 826: 216, 827: 248, 828: 9484, 829: 9488, 830: 9492, 831: 9496 }, Ie = [4352, 4384, 4608, 4640, 5376, 5408, 5632, 5664, 5888, 5920, 4096, 4864, 4896, 5120, 5152], xe = function e(t, i) { e.prototype.init.call(this), this.field_ = t || 0, this.dataChannel_ = i || 0, this.name_ = "CC" + (1 + (this.field_ << 1 | this.dataChannel_)), this.setConstants(), this.reset(), this.push = function (e) { var t, i, n, r, a; if ((t = 32639 & e.ccData) !== this.lastControlCode_) { if (4096 == (61440 & t) ? this.lastControlCode_ = t : t !== this.PADDING_ && (this.lastControlCode_ = null), n = t >>> 8, r = 255 & t, t !== this.PADDING_) if (t === this.RESUME_CAPTION_LOADING_) this.mode_ = "popOn"; else if (t === this.END_OF_CAPTION_) this.mode_ = "popOn", this.clearFormatting(e.pts), this.flushDisplayed(e.pts), i = this.displayed_, this.displayed_ = this.nonDisplayed_, this.nonDisplayed_ = i, this.startPts_ = e.pts; else if (t === this.ROLL_UP_2_ROWS_) this.rollUpRows_ = 2, this.setRollUp(e.pts); else if (t === this.ROLL_UP_3_ROWS_) this.rollUpRows_ = 3, this.setRollUp(e.pts); else if (t === this.ROLL_UP_4_ROWS_) this.rollUpRows_ = 4, this.setRollUp(e.pts); else if (t === this.CARRIAGE_RETURN_) this.clearFormatting(e.pts), this.flushDisplayed(e.pts), this.shiftRowsUp_(), this.startPts_ = e.pts; else if (t === this.BACKSPACE_) "popOn" === this.mode_ ? this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1) : this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1); else if (t === this.ERASE_DISPLAYED_MEMORY_) this.flushDisplayed(e.pts), this.displayed_ = we(); else if (t === this.ERASE_NON_DISPLAYED_MEMORY_) this.nonDisplayed_ = we(); else if (t === this.RESUME_DIRECT_CAPTIONING_) "paintOn" !== this.mode_ && (this.flushDisplayed(e.pts), this.displayed_ = we()), this.mode_ = "paintOn", this.startPts_ = e.pts; else if (this.isSpecialCharacter(n, r)) a = Ee((n = (3 & n) << 8) | r), this[this.mode_](e.pts, a), this.column_++; else if (this.isExtCharacter(n, r)) "popOn" === this.mode_ ? this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1) : this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1), a = Ee((n = (3 & n) << 8) | r), this[this.mode_](e.pts, a), this.column_++; else if (this.isMidRowCode(n, r)) this.clearFormatting(e.pts), this[this.mode_](e.pts, " "), this.column_++, 14 == (14 & r) && this.addFormatting(e.pts, ["i"]), 1 == (1 & r) && this.addFormatting(e.pts, ["u"]); else if (this.isOffsetControlCode(n, r)) this.column_ += 3 & r; else if (this.isPAC(n, r)) { var s = Ie.indexOf(7968 & t); "rollUp" === this.mode_ && (s - this.rollUpRows_ + 1 < 0 && (s = this.rollUpRows_ - 1), this.setRollUp(e.pts, s)), s !== this.row_ && (this.clearFormatting(e.pts), this.row_ = s), 1 & r && -1 === this.formatting_.indexOf("u") && this.addFormatting(e.pts, ["u"]), 16 == (16 & t) && (this.column_ = 4 * ((14 & t) >> 1)), this.isColorPAC(r) && 14 == (14 & r) && this.addFormatting(e.pts, ["i"]) } else this.isNormalChar(n) && (0 === r && (r = null), a = Ee(n), a += Ee(r), this[this.mode_](e.pts, a), this.column_ += a.length) } else this.lastControlCode_ = null } }; xe.prototype = new H, xe.prototype.flushDisplayed = function (e) { var t = this.displayed_.map(function (e) { try { return e.trim() } catch (e) { return "" } }).join("\n").replace(/^\n+|\n+$/g, ""); t.length && this.trigger("data", { startPts: this.startPts_, endPts: e, text: t, stream: this.name_ }) }, xe.prototype.reset = function () { this.mode_ = "popOn", this.topRow_ = 0, this.startPts_ = 0, this.displayed_ = we(), this.nonDisplayed_ = we(), this.lastControlCode_ = null, this.column_ = 0, this.row_ = 14, this.rollUpRows_ = 2, this.formatting_ = [] }, xe.prototype.setConstants = function () { 0 === this.dataChannel_ ? (this.BASE_ = 16, this.EXT_ = 17, this.CONTROL_ = (20 | this.field_) << 8, this.OFFSET_ = 23) : 1 === this.dataChannel_ && (this.BASE_ = 24, this.EXT_ = 25, this.CONTROL_ = (28 | this.field_) << 8, this.OFFSET_ = 31), this.PADDING_ = 0, this.RESUME_CAPTION_LOADING_ = 32 | this.CONTROL_, this.END_OF_CAPTION_ = 47 | this.CONTROL_, this.ROLL_UP_2_ROWS_ = 37 | this.CONTROL_, this.ROLL_UP_3_ROWS_ = 38 | this.CONTROL_, this.ROLL_UP_4_ROWS_ = 39 | this.CONTROL_, this.CARRIAGE_RETURN_ = 45 | this.CONTROL_, this.RESUME_DIRECT_CAPTIONING_ = 41 | this.CONTROL_, this.BACKSPACE_ = 33 | this.CONTROL_, this.ERASE_DISPLAYED_MEMORY_ = 44 | this.CONTROL_, this.ERASE_NON_DISPLAYED_MEMORY_ = 46 | this.CONTROL_ }, xe.prototype.isSpecialCharacter = function (e, t) { return e === this.EXT_ && 48 <= t && t <= 63 }, xe.prototype.isExtCharacter = function (e, t) { return (e === this.EXT_ + 1 || e === this.EXT_ + 2) && 32 <= t && t <= 63 }, xe.prototype.isMidRowCode = function (e, t) { return e === this.EXT_ && 32 <= t && t <= 47 }, xe.prototype.isOffsetControlCode = function (e, t) { return e === this.OFFSET_ && 33 <= t && t <= 35 }, xe.prototype.isPAC = function (e, t) { return e >= this.BASE_ && e < this.BASE_ + 8 && 64 <= t && t <= 127 }, xe.prototype.isColorPAC = function (e) { return 64 <= e && e <= 79 || 96 <= e && e <= 127 }, xe.prototype.isNormalChar = function (e) { return 32 <= e && e <= 127 }, xe.prototype.setRollUp = function (e, t) { if ("rollUp" !== this.mode_ && (this.row_ = 14, this.mode_ = "rollUp", this.flushDisplayed(e), this.nonDisplayed_ = we(), this.displayed_ = we()), void 0 !== t && t !== this.row_) for (var i = 0; i < this.rollUpRows_; i++)this.displayed_[t - i] = this.displayed_[this.row_ - i], this.displayed_[this.row_ - i] = ""; void 0 === t && (t = this.row_), this.topRow_ = t - this.rollUpRows_ + 1 }, xe.prototype.addFormatting = function (e, t) { this.formatting_ = this.formatting_.concat(t); var i = t.reduce(function (e, t) { return e + "<" + t + ">" }, ""); this[this.mode_](e, i) }, xe.prototype.clearFormatting = function (e) { if (this.formatting_.length) { var t = this.formatting_.reverse().reduce(function (e, t) { return e + "" }, ""); this.formatting_ = [], this[this.mode_](e, t) } }, xe.prototype.popOn = function (e, t) { var i = this.nonDisplayed_[this.row_]; i += t, this.nonDisplayed_[this.row_] = i }, xe.prototype.rollUp = function (e, t) { var i = this.displayed_[this.row_]; i += t, this.displayed_[this.row_] = i }, xe.prototype.shiftRowsUp_ = function () { var e; for (e = 0; e < this.topRow_; e++)this.displayed_[e] = ""; for (e = this.row_ + 1; e < 15; e++)this.displayed_[e] = ""; for (e = this.topRow_; e < this.row_; e++)this.displayed_[e] = this.displayed_[e + 1]; this.displayed_[this.row_] = "" }, xe.prototype.paintOn = function (e, t) { var i = this.displayed_[this.row_]; i += t, this.displayed_[this.row_] = i }; function Pe(e, t) { var i = 1; for (t < e && (i = -1); 4294967296 < Math.abs(t - e);)e += 8589934592 * i; return e } function Le(e) { var t, i; Le.prototype.init.call(this), this.type_ = e || "shared", this.push = function (e) { "shared" !== this.type_ && e.type !== this.type_ || (void 0 === i && (i = e.dts), e.dts = Pe(e.dts, i), e.pts = Pe(e.pts, i), t = e.dts, this.trigger("data", e)) }, this.flush = function () { i = t, this.trigger("done") }, this.endTimeline = function () { this.flush(), this.trigger("endedtimeline") }, this.discontinuity = function () { t = i = void 0 }, this.reset = function () { this.discontinuity(), this.trigger("reset") } } var Oe = { CaptionStream: z, Cea608Stream: xe }, De = { H264_STREAM_TYPE: 27, ADTS_STREAM_TYPE: 15, METADATA_STREAM_TYPE: 21 }; Le.prototype = new H; function Ne(e, t, i) { var n, r = ""; for (n = t; n < i; n++)r += "%" + ("00" + e[n].toString(16)).slice(-2); return r } function Re(e, t, i) { return decodeURIComponent(Ne(e, t, i)) } function Ue(e) { return e[0] << 21 | e[1] << 14 | e[2] << 7 | e[3] } var Me, Be = Le, je = { TXXX: function (e) { var t; if (3 === e.data[0]) { for (t = 1; t < e.data.length; t++)if (0 === e.data[t]) { e.description = Re(e.data, 1, t), e.value = Re(e.data, t + 1, e.data.length).replace(/\0*$/, ""); break } e.data = e.value } }, WXXX: function (e) { var t; if (3 === e.data[0]) for (t = 1; t < e.data.length; t++)if (0 === e.data[t]) { e.description = Re(e.data, 1, t), e.url = Re(e.data, t + 1, e.data.length); break } }, PRIV: function (e) { var t, i; for (t = 0; t < e.data.length; t++)if (0 === e.data[t]) { e.owner = (i = e.data, unescape(Ne(i, 0, t))); break } e.privateData = e.data.subarray(t + 1), e.data = e.privateData } }; (Me = function (e) { var t, u = { debug: !(!e || !e.debug), descriptor: e && e.descriptor }, l = 0, c = [], h = 0; if (Me.prototype.init.call(this), this.dispatchType = De.METADATA_STREAM_TYPE.toString(16), u.descriptor) for (t = 0; t < u.descriptor.length; t++)this.dispatchType += ("00" + u.descriptor[t].toString(16)).slice(-2); this.push = function (e) { var t, i, n, r, a; if ("timed-metadata" === e.type) if (e.dataAlignmentIndicator && (h = 0, c.length = 0), 0 === c.length && (e.data.length < 10 || e.data[0] !== "I".charCodeAt(0) || e.data[1] !== "D".charCodeAt(0) || e.data[2] !== "3".charCodeAt(0))) u.debug; else if (c.push(e), h += e.data.byteLength, 1 === c.length && (l = Ue(e.data.subarray(6, 10)), l += 10), !(h < l)) { for (t = { data: new Uint8Array(l), frames: [], pts: c[0].pts, dts: c[0].dts }, a = 0; a < l;)t.data.set(c[0].data.subarray(0, l - a), a), a += c[0].data.byteLength, h -= c[0].data.byteLength, c.shift(); i = 10, 64 & t.data[5] && (i += 4, i += Ue(t.data.subarray(10, 14)), l -= Ue(t.data.subarray(16, 20))); do { if ((n = Ue(t.data.subarray(i + 4, i + 8))) < 1) return; if ((r = { id: String.fromCharCode(t.data[i], t.data[i + 1], t.data[i + 2], t.data[i + 3]), data: t.data.subarray(i + 10, i + n + 10) }).key = r.id, je[r.id] && (je[r.id](r), "com.apple.streaming.transportStreamTimestamp" === r.owner)) { var s = r.data, o = (1 & s[3]) << 30 | s[4] << 22 | s[5] << 14 | s[6] << 6 | s[7] >>> 2; o *= 4, o += 3 & s[7], r.timeStamp = o, void 0 === t.pts && void 0 === t.dts && (t.pts = r.timeStamp, t.dts = r.timeStamp), this.trigger("timestamp", r) } t.frames.push(r), i += 10, i += n } while (i < l); this.trigger("data", t) } } }).prototype = new H; var Fe, He, Ve, qe = Me, We = Be; (Fe = function () { var r = new Uint8Array(188), a = 0; Fe.prototype.init.call(this), this.push = function (e) { var t, i = 0, n = 188; for (a ? ((t = new Uint8Array(e.byteLength + a)).set(r.subarray(0, a)), t.set(e, a), a = 0) : t = e; n < t.byteLength;)71 !== t[i] || 71 !== t[n] ? (i++, n++) : (this.trigger("data", t.subarray(i, n)), i += 188, n += 188); i < t.byteLength && (r.set(t.subarray(i), 0), a = t.byteLength - i) }, this.flush = function () { 188 === a && 71 === r[0] && (this.trigger("data", r), a = 0), this.trigger("done") }, this.endTimeline = function () { this.flush(), this.trigger("endedtimeline") }, this.reset = function () { a = 0, this.trigger("reset") } }).prototype = new H, (He = function () { var n, r, a, s; He.prototype.init.call(this), (s = this).packetsWaitingForPmt = [], this.programMapTable = void 0, n = function (e, t) { var i = 0; t.payloadUnitStartIndicator && (i += e[i] + 1), "pat" === t.type ? r(e.subarray(i), t) : a(e.subarray(i), t) }, r = function (e, t) { t.section_number = e[7], t.last_section_number = e[8], s.pmtPid = (31 & e[10]) << 8 | e[11], t.pmtPid = s.pmtPid }, a = function (e, t) { var i, n; if (1 & e[5]) { for (s.programMapTable = { video: null, audio: null, "timed-metadata": {} }, i = 3 + ((15 & e[1]) << 8 | e[2]) - 4, n = 12 + ((15 & e[10]) << 8 | e[11]); n < i;) { var r = e[n], a = (31 & e[n + 1]) << 8 | e[n + 2]; r === De.H264_STREAM_TYPE && null === s.programMapTable.video ? s.programMapTable.video = a : r === De.ADTS_STREAM_TYPE && null === s.programMapTable.audio ? s.programMapTable.audio = a : r === De.METADATA_STREAM_TYPE && (s.programMapTable["timed-metadata"][a] = r), n += 5 + ((15 & e[n + 3]) << 8 | e[n + 4]) } t.programMapTable = s.programMapTable } }, this.push = function (e) { var t = {}, i = 4; if (t.payloadUnitStartIndicator = !!(64 & e[1]), t.pid = 31 & e[1], t.pid <<= 8, t.pid |= e[2], 1 < (48 & e[3]) >>> 4 && (i += e[i] + 1), 0 === t.pid) t.type = "pat", n(e.subarray(i), t), this.trigger("data", t); else if (t.pid === this.pmtPid) for (t.type = "pmt", n(e.subarray(i), t), this.trigger("data", t); this.packetsWaitingForPmt.length;)this.processPes_.apply(this, this.packetsWaitingForPmt.shift()); else void 0 === this.programMapTable ? this.packetsWaitingForPmt.push([e, i, t]) : this.processPes_(e, i, t) }, this.processPes_ = function (e, t, i) { i.pid === this.programMapTable.video ? i.streamType = De.H264_STREAM_TYPE : i.pid === this.programMapTable.audio ? i.streamType = De.ADTS_STREAM_TYPE : i.streamType = this.programMapTable["timed-metadata"][i.pid], i.type = "pes", i.data = e.subarray(t), this.trigger("data", i) } }).prototype = new H, He.STREAM_TYPES = { h264: 27, adts: 15 }, (Ve = function () { function n(e, t, i) { var n, r, a = new Uint8Array(e.size), s = { type: t }, o = 0, u = 0; if (e.data.length && !(e.size < 9)) { for (s.trackId = e.data[0].pid, o = 0; o < e.data.length; o++)r = e.data[o], a.set(r.data, u), u += r.data.byteLength; !function (e, t) { var i; t.packetLength = 6 + (e[4] << 8 | e[5]), t.dataAlignmentIndicator = 0 != (4 & e[6]), 192 & (i = e[7]) && (t.pts = (14 & e[9]) << 27 | (255 & e[10]) << 20 | (254 & e[11]) << 12 | (255 & e[12]) << 5 | (254 & e[13]) >>> 3, t.pts *= 4, t.pts += (6 & e[13]) >>> 1, t.dts = t.pts, 64 & i && (t.dts = (14 & e[14]) << 27 | (255 & e[15]) << 20 | (254 & e[16]) << 12 | (255 & e[17]) << 5 | (254 & e[18]) >>> 3, t.dts *= 4, t.dts += (6 & e[18]) >>> 1)), t.data = e.subarray(9 + e[8]) }(a, s), n = "video" === t || s.packetLength <= e.size, (i || n) && (e.size = 0, e.data.length = 0), n && l.trigger("data", s) } } var t, l = this, r = { data: [], size: 0 }, a = { data: [], size: 0 }, s = { data: [], size: 0 }; Ve.prototype.init.call(this), this.push = function (i) { ({ pat: function () { }, pes: function () { var e, t; switch (i.streamType) { case De.H264_STREAM_TYPE: case De.H264_STREAM_TYPE: e = r, t = "video"; break; case De.ADTS_STREAM_TYPE: e = a, t = "audio"; break; case De.METADATA_STREAM_TYPE: e = s, t = "timed-metadata"; break; default: return }i.payloadUnitStartIndicator && n(e, t, !0), e.data.push(i), e.size += i.data.byteLength }, pmt: function () { var e = { type: "metadata", tracks: [] }; null !== (t = i.programMapTable).video && e.tracks.push({ timelineStartInfo: { baseMediaDecodeTime: 0 }, id: +t.video, codec: "avc", type: "video" }), null !== t.audio && e.tracks.push({ timelineStartInfo: { baseMediaDecodeTime: 0 }, id: +t.audio, codec: "adts", type: "audio" }), l.trigger("data", e) } })[i.type]() }, this.reset = function () { r.size = 0, r.data.length = 0, a.size = 0, a.data.length = 0, this.trigger("reset") }, this.flushStreams_ = function () { n(r, "video"), n(a, "audio"), n(s, "timed-metadata") }, this.flush = function () { this.flushStreams_(), this.trigger("done") } }).prototype = new H; var ze = { PAT_PID: 0, MP2T_PACKET_LENGTH: 188, TransportPacketStream: Fe, TransportParseStream: He, ElementaryStream: Ve, TimestampRolloverStream: We, CaptionStream: Oe.CaptionStream, Cea608Stream: Oe.Cea608Stream, MetadataStream: qe }; for (var Ge in De) De.hasOwnProperty(Ge) && (ze[Ge] = De[Ge]); var Xe, Ke = ze, Ye = le, $e = [96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350]; (Xe = function (u) { var l, c = 0; Xe.prototype.init.call(this), this.push = function (e) { var t, i, n, r, a, s, o = 0; if (u || (c = 0), "audio" === e.type) for (l ? (r = l, (l = new Uint8Array(r.byteLength + e.data.byteLength)).set(r), l.set(e.data, r.byteLength)) : l = e.data; o + 5 < l.length;)if (255 === l[o] && 240 == (246 & l[o + 1])) { if (i = 2 * (1 & ~l[o + 1]), t = (3 & l[o + 3]) << 11 | l[o + 4] << 3 | (224 & l[o + 5]) >> 5, s = (a = 1024 * (1 + (3 & l[o + 6]))) * Ye / $e[(60 & l[o + 2]) >>> 2], n = o + t, l.byteLength < n) return; if (this.trigger("data", { pts: e.pts + c * s, dts: e.dts + c * s, sampleCount: a, audioobjecttype: 1 + (l[o + 2] >>> 6 & 3), channelcount: (1 & l[o + 2]) << 2 | (192 & l[o + 3]) >>> 6, samplerate: $e[(60 & l[o + 2]) >>> 2], samplingfrequencyindex: (60 & l[o + 2]) >>> 2, samplesize: 16, data: l.subarray(o + 7 + i, n) }), c++, l.byteLength === n) return void (l = void 0); l = l.subarray(n) } else o++ }, this.flush = function () { c = 0, this.trigger("done") }, this.reset = function () { l = void 0, this.trigger("reset") }, this.endTimeline = function () { l = void 0, this.trigger("endedtimeline") } }).prototype = new H; var Qe, Je, Ze, et = Xe, tt = function (n) { var r = n.byteLength, a = 0, s = 0; this.length = function () { return 8 * r }, this.bitsAvailable = function () { return 8 * r + s }, this.loadWord = function () { var e = n.byteLength - r, t = new Uint8Array(4), i = Math.min(4, r); if (0 === i) throw new Error("no bytes available"); t.set(n.subarray(e, e + i)), a = new DataView(t.buffer).getUint32(0), s = 8 * i, r -= i }, this.skipBits = function (e) { var t; e < s || (e -= s, e -= 8 * (t = Math.floor(e / 8)), r -= t, this.loadWord()), a <<= e, s -= e }, this.readBits = function (e) { var t = Math.min(s, e), i = a >>> 32 - t; return 0 < (s -= t) ? a <<= t : 0 < r && this.loadWord(), 0 < (t = e - t) ? i << t | this.readBits(t) : i }, this.skipLeadingZeros = function () { var e; for (e = 0; e < s; ++e)if (0 != (a & 2147483648 >>> e)) return a <<= e, s -= e, e; return this.loadWord(), e + this.skipLeadingZeros() }, this.skipUnsignedExpGolomb = function () { this.skipBits(1 + this.skipLeadingZeros()) }, this.skipExpGolomb = function () { this.skipBits(1 + this.skipLeadingZeros()) }, this.readUnsignedExpGolomb = function () { var e = this.skipLeadingZeros(); return this.readBits(e + 1) - 1 }, this.readExpGolomb = function () { var e = this.readUnsignedExpGolomb(); return 1 & e ? 1 + e >>> 1 : -1 * (e >>> 1) }, this.readBoolean = function () { return 1 === this.readBits(1) }, this.readUnsignedByte = function () { return this.readBits(8) }, this.loadWord() }; (Je = function () { var n, r, a = 0; Je.prototype.init.call(this), this.push = function (e) { for (var t, i = (r = r ? ((t = new Uint8Array(r.byteLength + e.data.byteLength)).set(r), t.set(e.data, r.byteLength), t) : e.data).byteLength; a < i - 3; a++)if (1 === r[a + 2]) { n = a + 5; break } for (; n < i;)switch (r[n]) { case 0: if (0 !== r[n - 1]) { n += 2; break } if (0 !== r[n - 2]) { n++; break } for (a + 3 !== n - 2 && this.trigger("data", r.subarray(a + 3, n - 2)); 1 !== r[++n] && n < i;); a = n - 2, n += 3; break; case 1: if (0 !== r[n - 1] || 0 !== r[n - 2]) { n += 3; break } this.trigger("data", r.subarray(a + 3, n - 2)), a = n - 2, n += 3; break; default: n += 3 }r = r.subarray(a), n -= a, a = 0 }, this.reset = function () { r = null, a = 0, this.trigger("reset") }, this.flush = function () { r && 3 < r.byteLength && this.trigger("data", r.subarray(a + 3)), r = null, a = 0, this.trigger("done") }, this.endTimeline = function () { this.flush(), this.trigger("endedtimeline") } }).prototype = new H, Ze = { 100: !0, 110: !0, 122: !0, 244: !0, 44: !0, 83: !0, 86: !0, 118: !0, 128: !0, 138: !0, 139: !0, 134: !0 }, (Qe = function () { var i, n, r, a, s, o, _, t = new Je; Qe.prototype.init.call(this), (i = this).push = function (e) { "video" === e.type && (n = e.trackId, r = e.pts, a = e.dts, t.push(e)) }, t.on("data", function (e) { var t = { trackId: n, pts: r, dts: a, data: e }; switch (31 & e[0]) { case 5: t.nalUnitType = "slice_layer_without_partitioning_rbsp_idr"; break; case 6: t.nalUnitType = "sei_rbsp", t.escapedRBSP = s(e.subarray(1)); break; case 7: t.nalUnitType = "seq_parameter_set_rbsp", t.escapedRBSP = s(e.subarray(1)), t.config = o(t.escapedRBSP); break; case 8: t.nalUnitType = "pic_parameter_set_rbsp"; break; case 9: t.nalUnitType = "access_unit_delimiter_rbsp" }i.trigger("data", t) }), t.on("done", function () { i.trigger("done") }), t.on("partialdone", function () { i.trigger("partialdone") }), t.on("reset", function () { i.trigger("reset") }), t.on("endedtimeline", function () { i.trigger("endedtimeline") }), this.flush = function () { t.flush() }, this.partialFlush = function () { t.partialFlush() }, this.reset = function () { t.reset() }, this.endTimeline = function () { t.endTimeline() }, _ = function (e, t) { var i, n = 8, r = 8; for (i = 0; i < e; i++)0 !== r && (r = (n + t.readExpGolomb() + 256) % 256), n = 0 === r ? n : r }, s = function (e) { for (var t, i, n = e.byteLength, r = [], a = 1; a < n - 2;)0 === e[a] && 0 === e[a + 1] && 3 === e[a + 2] ? (r.push(a + 2), a += 2) : a++; if (0 === r.length) return e; t = n - r.length, i = new Uint8Array(t); var s = 0; for (a = 0; a < t; s++, a++)s === r[0] && (s++, r.shift()), i[a] = e[s]; return i }, o = function (e) { var t, i, n, r, a, s, o, u, l, c, h, d, p, f = 0, m = 0, g = 0, v = 0, y = 1; if (i = (t = new tt(e)).readUnsignedByte(), r = t.readUnsignedByte(), n = t.readUnsignedByte(), t.skipUnsignedExpGolomb(), Ze[i] && (3 === (a = t.readUnsignedExpGolomb()) && t.skipBits(1), t.skipUnsignedExpGolomb(), t.skipUnsignedExpGolomb(), t.skipBits(1), t.readBoolean())) for (h = 3 !== a ? 8 : 12, p = 0; p < h; p++)t.readBoolean() && _(p < 6 ? 16 : 64, t); if (t.skipUnsignedExpGolomb(), 0 === (s = t.readUnsignedExpGolomb())) t.readUnsignedExpGolomb(); else if (1 === s) for (t.skipBits(1), t.skipExpGolomb(), t.skipExpGolomb(), o = t.readUnsignedExpGolomb(), p = 0; p < o; p++)t.skipExpGolomb(); if (t.skipUnsignedExpGolomb(), t.skipBits(1), u = t.readUnsignedExpGolomb(), l = t.readUnsignedExpGolomb(), 0 === (c = t.readBits(1)) && t.skipBits(1), t.skipBits(1), t.readBoolean() && (f = t.readUnsignedExpGolomb(), m = t.readUnsignedExpGolomb(), g = t.readUnsignedExpGolomb(), v = t.readUnsignedExpGolomb()), t.readBoolean() && t.readBoolean()) { switch (t.readUnsignedByte()) { case 1: d = [1, 1]; break; case 2: d = [12, 11]; break; case 3: d = [10, 11]; break; case 4: d = [16, 11]; break; case 5: d = [40, 33]; break; case 6: d = [24, 11]; break; case 7: d = [20, 11]; break; case 8: d = [32, 11]; break; case 9: d = [80, 33]; break; case 10: d = [18, 11]; break; case 11: d = [15, 11]; break; case 12: d = [64, 33]; break; case 13: d = [160, 99]; break; case 14: d = [4, 3]; break; case 15: d = [3, 2]; break; case 16: d = [2, 1]; break; case 255: d = [t.readUnsignedByte() << 8 | t.readUnsignedByte(), t.readUnsignedByte() << 8 | t.readUnsignedByte()] }d && (y = d[0] / d[1]) } return { profileIdc: i, levelIdc: n, profileCompatibility: r, width: Math.ceil((16 * (u + 1) - 2 * f - 2 * m) * y), height: (2 - c) * (l + 1) * 16 - 2 * g - 2 * v, sarRatio: d } } }).prototype = new H; var it, nt = { H264Stream: Qe, NalByteStream: Je }, rt = function (e) { return e[0] === "I".charCodeAt(0) && e[1] === "D".charCodeAt(0) && e[2] === "3".charCodeAt(0) }, at = function (e, t) { var i = e[t + 6] << 21 | e[t + 7] << 14 | e[t + 8] << 7 | e[t + 9]; return (16 & e[t + 5]) >> 4 ? 20 + i : 10 + i }, st = function (e, t) { var i = (224 & e[t + 5]) >> 5, n = e[t + 4] << 3; return 6144 & e[t + 3] | n | i }; (it = function () { var o = new Uint8Array, u = 0; it.prototype.init.call(this), this.setTimestamp = function (e) { u = e }, this.push = function (e) { var t, i, n, r, a = 0, s = 0; for (o.length ? (r = o.length, (o = new Uint8Array(e.byteLength + r)).set(o.subarray(0, r)), o.set(e, r)) : o = e; 3 <= o.length - s;)if (o[s] !== "I".charCodeAt(0) || o[s + 1] !== "D".charCodeAt(0) || o[s + 2] !== "3".charCodeAt(0)) if (255 != (255 & o[s]) || 240 != (240 & o[s + 1])) s++; else { if (o.length - s < 7) break; if (s + (a = st(o, s)) > o.length) break; n = { type: "audio", data: o.subarray(s, s + a), pts: u, dts: u }, this.trigger("data", n), s += a } else { if (o.length - s < 10) break; if (s + (a = at(o, s)) > o.length) break; i = { type: "timed-metadata", data: o.subarray(s, s + a) }, this.trigger("data", i), s += a } t = o.length - s, o = 0 < t ? o.subarray(s) : new Uint8Array }, this.reset = function () { o = new Uint8Array, this.trigger("reset") }, this.endTimeline = function () { o = new Uint8Array, this.trigger("endedtimeline") } }).prototype = new H; function ot(e, t) { var i; if (e.length !== t.length) return !1; for (i = 0; i < e.length; i++)if (e[i] !== t[i]) return !1; return !0 } function ut(e, t, i, n, r, a) { return { start: { dts: e, pts: e + (i - t) }, end: { dts: e + (n - t), pts: e + (r - i) }, prependedContentDuration: a, baseMediaDecodeTime: e } } var lt, ct, ht, dt, pt = it, ft = nt.H264Stream, mt = rt, gt = le, vt = ["audioobjecttype", "channelcount", "samplerate", "samplingfrequencyindex", "samplesize"], yt = ["width", "height", "profileIdc", "levelIdc", "profileCompatibility", "sarRatio"]; (ct = function (a, s) { var o = [], u = 0, l = 0, c = 0, h = 1 / 0; s = s || {}, ct.prototype.init.call(this), this.push = function (t) { be(a, t), a && vt.forEach(function (e) { a[e] = t[e] }), o.push(t) }, this.setEarliestDts = function (e) { l = e - a.timelineStartInfo.baseMediaDecodeTime }, this.setVideoBaseMediaDecodeTime = function (e) { h = e }, this.setAudioAppendStart = function (e) { c = e }, this.flush = function () { var e, t, i, n, r; 0 !== o.length && (e = fe(o, a, l), a.baseMediaDecodeTime = _e(a, s.keepOriginalTimestamps), pe(a, e, c, h), a.samples = me(e), i = Q(ge(e)), o = [], t = J(u, [a]), n = new Uint8Array(t.byteLength + i.byteLength), u++, n.set(t), n.set(i, t.byteLength), ye(a), r = Math.ceil(1024 * gt / a.samplerate), e.length && this.trigger("timingInfo", { start: e[0].pts, end: e[0].pts + e.length * r }), this.trigger("data", { track: a, boxes: n })), this.trigger("done", "AudioSegmentStream") }, this.reset = function () { ye(a), o = [], this.trigger("reset") } }).prototype = new H, (lt = function (c, h) { var t, i, d = 0, p = [], f = []; h = h || {}, lt.prototype.init.call(this), delete c.minPTS, this.gopCache_ = [], this.push = function (e) { be(c, e), "seq_parameter_set_rbsp" !== e.nalUnitType || t || (t = e.config, c.sps = [e.data], yt.forEach(function (e) { c[e] = t[e] }, this)), "pic_parameter_set_rbsp" !== e.nalUnitType || i || (i = e.data, c.pps = [e.data]), p.push(e) }, this.flush = function () { for (var e, t, i, n, r, a, s, o, u = 0; p.length && "access_unit_delimiter_rbsp" !== p[0].nalUnitType;)p.shift(); if (0 === p.length) return this.resetStream_(), void this.trigger("done", "VideoSegmentStream"); if (e = ee(p), (i = te(e))[0][0].keyFrame || ((t = this.getGopForFusion_(p[0], c)) ? (u = t.duration, i.unshift(t), i.byteLength += t.byteLength, i.nalCount += t.nalCount, i.pts = t.pts, i.dts = t.dts, i.duration += t.duration) : i = ie(i)), f.length) { var l; if (!(l = h.alignGopsAtEnd ? this.alignGopsAtEnd_(i) : this.alignGopsAtStart_(i))) return this.gopCache_.unshift({ gop: i.pop(), pps: c.pps, sps: c.sps }), this.gopCache_.length = Math.min(6, this.gopCache_.length), p = [], this.resetStream_(), void this.trigger("done", "VideoSegmentStream"); ye(c), i = l } be(c, i), c.samples = ne(i), r = Q(re(i)), c.baseMediaDecodeTime = _e(c, h.keepOriginalTimestamps), this.trigger("processedGopsInfo", i.map(function (e) { return { pts: e.pts, dts: e.dts, byteLength: e.byteLength } })), s = i[0], o = i[i.length - 1], this.trigger("segmentTimingInfo", ut(c.baseMediaDecodeTime, s.dts, s.pts, o.dts + o.duration, o.pts + o.duration, u)), this.trigger("timingInfo", { start: i[0].pts, end: i[i.length - 1].pts + i[i.length - 1].duration }), this.gopCache_.unshift({ gop: i.pop(), pps: c.pps, sps: c.sps }), this.gopCache_.length = Math.min(6, this.gopCache_.length), p = [], this.trigger("baseMediaDecodeTime", c.baseMediaDecodeTime), this.trigger("timelineStartInfo", c.timelineStartInfo), n = J(d, [c]), a = new Uint8Array(n.byteLength + r.byteLength), d++, a.set(n), a.set(r, n.byteLength), this.trigger("data", { track: c, boxes: a }), this.resetStream_(), this.trigger("done", "VideoSegmentStream") }, this.reset = function () { this.resetStream_(), p = [], this.gopCache_.length = 0, f.length = 0, this.trigger("reset") }, this.resetStream_ = function () { ye(c), i = t = void 0 }, this.getGopForFusion_ = function (e) { var t, i, n, r, a, s = 1 / 0; for (a = 0; a < this.gopCache_.length; a++)n = (r = this.gopCache_[a]).gop, c.pps && ot(c.pps[0], r.pps[0]) && c.sps && ot(c.sps[0], r.sps[0]) && (n.dts < c.timelineStartInfo.dts || -1e4 <= (t = e.dts - n.dts - n.duration) && t <= 45e3 && (!i || t < s) && (i = r, s = t)); return i ? i.gop : null }, this.alignGopsAtStart_ = function (e) { var t, i, n, r, a, s, o, u; for (a = e.byteLength, s = e.nalCount, o = e.duration, t = i = 0; t < f.length && i < e.length && (n = f[t], r = e[i], n.pts !== r.pts);)r.pts > n.pts ? t++ : (i++, a -= r.byteLength, s -= r.nalCount, o -= r.duration); return 0 === i ? e : i === e.length ? null : ((u = e.slice(i)).byteLength = a, u.duration = o, u.nalCount = s, u.pts = u[0].pts, u.dts = u[0].dts, u) }, this.alignGopsAtEnd_ = function (e) { var t, i, n, r, a, s, o; for (t = f.length - 1, i = e.length - 1, a = null, s = !1; 0 <= t && 0 <= i;) { if (n = f[t], r = e[i], n.pts === r.pts) { s = !0; break } n.pts > r.pts ? t-- : (t === f.length - 1 && (a = i), i--) } if (!s && null === a) return null; if (0 === (o = s ? i : a)) return e; var u = e.slice(o), l = u.reduce(function (e, t) { return e.byteLength += t.byteLength, e.duration += t.duration, e.nalCount += t.nalCount, e }, { byteLength: 0, duration: 0, nalCount: 0 }); return u.byteLength = l.byteLength, u.duration = l.duration, u.nalCount = l.nalCount, u.pts = u[0].pts, u.dts = u[0].dts, u }, this.alignGopsWith = function (e) { f = e } }).prototype = new H, (dt = function (e, t) { this.numberOfTracks = 0, this.metadataStream = t, "undefined" != typeof (e = e || {}).remux ? this.remuxTracks = !!e.remux : this.remuxTracks = !0, "boolean" == typeof e.keepOriginalTimestamps ? this.keepOriginalTimestamps = e.keepOriginalTimestamps : this.keepOriginalTimestamps = !1, this.pendingTracks = [], this.videoTrack = null, this.pendingBoxes = [], this.pendingCaptions = [], this.pendingMetadata = [], this.pendingBytes = 0, this.emittedTracks = 0, dt.prototype.init.call(this), this.push = function (e) { return e.text ? this.pendingCaptions.push(e) : e.frames ? this.pendingMetadata.push(e) : (this.pendingTracks.push(e.track), this.pendingBytes += e.boxes.byteLength, "video" === e.track.type && (this.videoTrack = e.track, this.pendingBoxes.push(e.boxes)), void ("audio" === e.track.type && (this.audioTrack = e.track, this.pendingBoxes.unshift(e.boxes)))) } }).prototype = new H, dt.prototype.flush = function (e) { var t, i, n, r, a = 0, s = { captions: [], captionStreams: {}, metadata: [], info: {} }, o = 0; if (this.pendingTracks.length < this.numberOfTracks) { if ("VideoSegmentStream" !== e && "AudioSegmentStream" !== e) return; if (this.remuxTracks) return; if (0 === this.pendingTracks.length) return this.emittedTracks++, void (this.emittedTracks >= this.numberOfTracks && (this.trigger("done"), this.emittedTracks = 0)) } if (this.videoTrack ? (o = this.videoTrack.timelineStartInfo.pts, yt.forEach(function (e) { s.info[e] = this.videoTrack[e] }, this)) : this.audioTrack && (o = this.audioTrack.timelineStartInfo.pts, vt.forEach(function (e) { s.info[e] = this.audioTrack[e] }, this)), this.videoTrack || this.audioTrack) { for (1 === this.pendingTracks.length ? s.type = this.pendingTracks[0].type : s.type = "combined", this.emittedTracks += this.pendingTracks.length, n = Z(this.pendingTracks), s.initSegment = new Uint8Array(n.byteLength), s.initSegment.set(n), s.data = new Uint8Array(this.pendingBytes), r = 0; r < this.pendingBoxes.length; r++)s.data.set(this.pendingBoxes[r], a), a += this.pendingBoxes[r].byteLength; for (r = 0; r < this.pendingCaptions.length; r++)(t = this.pendingCaptions[r]).startTime = de(t.startPts, o, this.keepOriginalTimestamps), t.endTime = de(t.endPts, o, this.keepOriginalTimestamps), s.captionStreams[t.stream] = !0, s.captions.push(t); for (r = 0; r < this.pendingMetadata.length; r++)(i = this.pendingMetadata[r]).cueTime = de(i.pts, o, this.keepOriginalTimestamps), s.metadata.push(i); for (s.metadata.dispatchType = this.metadataStream.dispatchType, this.pendingTracks.length = 0, this.videoTrack = null, this.pendingBoxes.length = 0, this.pendingCaptions.length = 0, this.pendingBytes = 0, this.pendingMetadata.length = 0, this.trigger("data", s), r = 0; r < s.captions.length; r++)t = s.captions[r], this.trigger("caption", t); for (r = 0; r < s.metadata.length; r++)i = s.metadata[r], this.trigger("id3Frame", i) } this.emittedTracks >= this.numberOfTracks && (this.trigger("done"), this.emittedTracks = 0) }, dt.prototype.setRemux = function (e) { this.remuxTracks = e }, (ht = function (n) { var r, a, s = this, i = !0; ht.prototype.init.call(this), n = n || {}, this.baseMediaDecodeTime = n.baseMediaDecodeTime || 0, this.transmuxPipeline_ = {}, this.setupAacPipeline = function () { var t = {}; (this.transmuxPipeline_ = t).type = "aac", t.metadataStream = new Ke.MetadataStream, t.aacStream = new pt, t.audioTimestampRolloverStream = new Ke.TimestampRolloverStream("audio"), t.timedMetadataTimestampRolloverStream = new Ke.TimestampRolloverStream("timed-metadata"), t.adtsStream = new et, t.coalesceStream = new dt(n, t.metadataStream), t.headOfPipeline = t.aacStream, t.aacStream.pipe(t.audioTimestampRolloverStream).pipe(t.adtsStream), t.aacStream.pipe(t.timedMetadataTimestampRolloverStream).pipe(t.metadataStream).pipe(t.coalesceStream), t.metadataStream.on("timestamp", function (e) { t.aacStream.setTimestamp(e.timeStamp) }), t.aacStream.on("data", function (e) { "timed-metadata" !== e.type || t.audioSegmentStream || (a = a || { timelineStartInfo: { baseMediaDecodeTime: s.baseMediaDecodeTime }, codec: "adts", type: "audio" }, t.coalesceStream.numberOfTracks++, t.audioSegmentStream = new ct(a, n), t.audioSegmentStream.on("timingInfo", s.trigger.bind(s, "audioTimingInfo")), t.adtsStream.pipe(t.audioSegmentStream).pipe(t.coalesceStream)), s.trigger("trackinfo", { hasAudio: !!a, hasVideo: !!r }) }), t.coalesceStream.on("data", this.trigger.bind(this, "data")), t.coalesceStream.on("done", this.trigger.bind(this, "done")) }, this.setupTsPipeline = function () { var i = {}; (this.transmuxPipeline_ = i).type = "ts", i.metadataStream = new Ke.MetadataStream, i.packetStream = new Ke.TransportPacketStream, i.parseStream = new Ke.TransportParseStream, i.elementaryStream = new Ke.ElementaryStream, i.timestampRolloverStream = new Ke.TimestampRolloverStream, i.adtsStream = new et, i.h264Stream = new ft, i.captionStream = new Ke.CaptionStream, i.coalesceStream = new dt(n, i.metadataStream), i.headOfPipeline = i.packetStream, i.packetStream.pipe(i.parseStream).pipe(i.elementaryStream).pipe(i.timestampRolloverStream), i.timestampRolloverStream.pipe(i.h264Stream), i.timestampRolloverStream.pipe(i.adtsStream), i.timestampRolloverStream.pipe(i.metadataStream).pipe(i.coalesceStream), i.h264Stream.pipe(i.captionStream).pipe(i.coalesceStream), i.elementaryStream.on("data", function (e) { var t; if ("metadata" === e.type) { for (t = e.tracks.length; t--;)r || "video" !== e.tracks[t].type ? a || "audio" !== e.tracks[t].type || ((a = e.tracks[t]).timelineStartInfo.baseMediaDecodeTime = s.baseMediaDecodeTime) : (r = e.tracks[t]).timelineStartInfo.baseMediaDecodeTime = s.baseMediaDecodeTime; r && !i.videoSegmentStream && (i.coalesceStream.numberOfTracks++, i.videoSegmentStream = new lt(r, n), i.videoSegmentStream.on("timelineStartInfo", function (e) { a && (a.timelineStartInfo = e, i.audioSegmentStream.setEarliestDts(e.dts)) }), i.videoSegmentStream.on("processedGopsInfo", s.trigger.bind(s, "gopInfo")), i.videoSegmentStream.on("segmentTimingInfo", s.trigger.bind(s, "videoSegmentTimingInfo")), i.videoSegmentStream.on("baseMediaDecodeTime", function (e) { a && i.audioSegmentStream.setVideoBaseMediaDecodeTime(e) }), i.videoSegmentStream.on("timingInfo", s.trigger.bind(s, "videoTimingInfo")), i.h264Stream.pipe(i.videoSegmentStream).pipe(i.coalesceStream)), a && !i.audioSegmentStream && (i.coalesceStream.numberOfTracks++, i.audioSegmentStream = new ct(a, n), i.audioSegmentStream.on("timingInfo", s.trigger.bind(s, "audioTimingInfo")), i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream)), s.trigger("trackinfo", { hasAudio: !!a, hasVideo: !!r }) } }), i.coalesceStream.on("data", this.trigger.bind(this, "data")), i.coalesceStream.on("id3Frame", function (e) { e.dispatchType = i.metadataStream.dispatchType, s.trigger("id3Frame", e) }), i.coalesceStream.on("caption", this.trigger.bind(this, "caption")), i.coalesceStream.on("done", this.trigger.bind(this, "done")) }, this.setBaseMediaDecodeTime = function (e) { var t = this.transmuxPipeline_; n.keepOriginalTimestamps || (this.baseMediaDecodeTime = e), a && (a.timelineStartInfo.dts = void 0, a.timelineStartInfo.pts = void 0, ye(a), n.keepOriginalTimestamps || (a.timelineStartInfo.baseMediaDecodeTime = e), t.audioTimestampRolloverStream && t.audioTimestampRolloverStream.discontinuity()), r && (t.videoSegmentStream && (t.videoSegmentStream.gopCache_ = []), r.timelineStartInfo.dts = void 0, r.timelineStartInfo.pts = void 0, ye(r), t.captionStream.reset(), n.keepOriginalTimestamps || (r.timelineStartInfo.baseMediaDecodeTime = e)), t.timestampRolloverStream && t.timestampRolloverStream.discontinuity() }, this.setAudioAppendStart = function (e) { a && this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e) }, this.setRemux = function (e) { var t = this.transmuxPipeline_; n.remux = e, t && t.coalesceStream && t.coalesceStream.setRemux(e) }, this.alignGopsWith = function (e) { r && this.transmuxPipeline_.videoSegmentStream && this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e) }, this.push = function (e) { if (i) { var t = mt(e); t && "aac" !== this.transmuxPipeline_.type ? this.setupAacPipeline() : t || "ts" === this.transmuxPipeline_.type || this.setupTsPipeline(), i = !1 } this.transmuxPipeline_.headOfPipeline.push(e) }, this.flush = function () { i = !0, this.transmuxPipeline_.headOfPipeline.flush() }, this.endTimeline = function () { this.transmuxPipeline_.headOfPipeline.endTimeline() }, this.reset = function () { this.transmuxPipeline_.headOfPipeline && this.transmuxPipeline_.headOfPipeline.reset() }, this.resetCaptions = function () { this.transmuxPipeline_.captionStream && this.transmuxPipeline_.captionStream.reset() } }).prototype = new H; var _t = { Transmuxer: ht, VideoSegmentStream: lt, AudioSegmentStream: ct, AUDIO_PROPERTIES: vt, VIDEO_PROPERTIES: yt, generateVideoSegmentTimingInfo: ut }; function bt(e, t) { for (var i = 0; i < t.length; i++) { var n = t[i]; n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n) } } var Tt = (function (e, t, i) { return t && bt(e.prototype, t), i && bt(e, i), e }(St, [{ key: "init", value: function () { this.transmuxer && this.transmuxer.dispose(), this.transmuxer = new _t.Transmuxer(this.options), function (n, e) { e.on("data", function (e) { var t = e.initSegment; e.initSegment = { data: t.buffer, byteOffset: t.byteOffset, byteLength: t.byteLength }; var i = e.data; e.data = i.buffer, n.postMessage({ action: "data", segment: e, byteOffset: i.byteOffset, byteLength: i.byteLength }, [e.data]) }), e.captionStream && e.captionStream.on("data", function (e) { n.postMessage({ action: "caption", data: e }) }), e.on("done", function (e) { n.postMessage({ action: "done" }) }), e.on("gopInfo", function (e) { n.postMessage({ action: "gopInfo", gopInfo: e }) }), e.on("videoSegmentTimingInfo", function (e) { n.postMessage({ action: "videoSegmentTimingInfo", videoSegmentTimingInfo: e }) }) }(this.self, this.transmuxer) } }, { key: "push", value: function (e) { var t = new Uint8Array(e.data, e.byteOffset, e.byteLength); this.transmuxer.push(t) } }, { key: "reset", value: function () { this.init() } }, { key: "setTimestampOffset", value: function (e) { var t = e.timestampOffset || 0; this.transmuxer.setBaseMediaDecodeTime(Math.round(9e4 * t)) } }, { key: "setAudioAppendStart", value: function (e) { this.transmuxer.setAudioAppendStart(Math.ceil(9e4 * e.appendStart)) } }, { key: "flush", value: function (e) { this.transmuxer.flush() } }, { key: "resetCaptions", value: function () { this.transmuxer.resetCaptions() } }, { key: "alignGopsWith", value: function (e) { this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice()) } }]), St); function St(e, t) { !function (e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") }(this, St), this.options = t || {}, this.self = e, this.init() } new function (t) { t.onmessage = function (e) { "init" === e.data.action && e.data.options ? this.messageHandlers = new Tt(t, e.data.options) : (this.messageHandlers || (this.messageHandlers = new Tt(t)), e.data && e.data.action && "init" !== e.data.action && this.messageHandlers[e.data.action] && this.messageHandlers[e.data.action](e.data)) } }(kt) }() }), Cc = { videoCodec: "avc1", videoObjectTypeIndicator: ".4d400d", audioProfile: "2" }, Ec = (ll(wc, sa.EventTarget), ol(wc, [{ key: "data_", value: function (e) { var t = e.data.segment; t.data = new Uint8Array(t.data, e.data.byteOffset, e.data.byteLength), t.initSegment = new Uint8Array(t.initSegment.data, t.initSegment.byteOffset, t.initSegment.byteLength), function (e, t, i) { var n = t.player_; if (i.captions && i.captions.length) for (var r in e.inbandTextTracks_ || (e.inbandTextTracks_ = {}), i.captionStreams) if (!e.inbandTextTracks_[r]) { n.tech_.trigger({ type: "usage", name: "hls-608" }); var a = n.textTracks().getTrackById(r); e.inbandTextTracks_[r] = a || n.addRemoteTextTrack({ kind: "captions", id: r, label: r }, !1).track } i.metadata && i.metadata.length && !e.metadataTrack_ && (e.metadataTrack_ = n.addRemoteTextTrack({ kind: "metadata", label: "Timed Metadata" }, !1).track, e.metadataTrack_.inBandMetadataTrackDispatchType = i.metadata.dispatchType) }(this, this.mediaSource_, t), this.pendingBuffers_.push(t) } }, { key: "done_", value: function (e) { "closed" !== this.mediaSource_.readyState ? this.processPendingSegments_() : this.pendingBuffers_.length = 0 } }, { key: "videoSegmentTimingInfo_", value: function (e) { var t = { start: { decode: e.start.dts / 9e4, presentation: e.start.pts / 9e4 }, end: { decode: e.end.dts / 9e4, presentation: e.end.pts / 9e4 }, baseMediaDecodeTime: e.baseMediaDecodeTime / 9e4 }; e.prependedContentDuration && (t.prependedContentDuration = e.prependedContentDuration / 9e4), this.trigger({ type: "videoSegmentTimingInfo", videoSegmentTimingInfo: t }) } }, { key: "createRealSourceBuffers_", value: function () { var n = this, r = ["audio", "video"]; r.forEach(function (t) { if (n[t + "Codec_"] && !n[t + "Buffer_"]) { var i = null; if (n.mediaSource_[t + "Buffer_"]) (i = n.mediaSource_[t + "Buffer_"]).updating = !1; else { var e = t + '/mp4;codecs="' + n[t + "Codec_"] + '"'; i = function (e, t) { var i = e.addSourceBuffer(t), n = Object.create(null); function r(t) { "function" == typeof i[t] ? n[t] = function () { return i[t].apply(i, arguments) } : "undefined" == typeof n[t] && Object.defineProperty(n, t, { get: function () { return i[t] }, set: function (e) { return i[t] = e } }) } for (var a in n.updating = !1, n.realBuffer_ = i) r(a); return n }(n.mediaSource_.nativeMediaSource_, e), n.mediaSource_[t + "Buffer_"] = i } n[t + "Buffer_"] = i, ["update", "updatestart", "updateend"].forEach(function (e) { i.addEventListener(e, function () { if ("audio" !== t || !n.audioDisabled_) return "updateend" === e && (n[t + "Buffer_"].updating = !1), r.every(function (e) { return !("audio" !== e || !n.audioDisabled_) || t === e || !n[e + "Buffer_"] || !n[e + "Buffer_"].updating }) ? n.trigger(e) : void 0 }) }) } }) } }, { key: "appendBuffer", value: function (e) { if (this.bufferUpdating_ = !0, this.audioBuffer_ && this.audioBuffer_.buffered.length) { var t = this.audioBuffer_.buffered; this.transmuxer_.postMessage({ action: "setAudioAppendStart", appendStart: t.end(t.length - 1) }) } this.videoBuffer_ && this.transmuxer_.postMessage({ action: "alignGopsWith", gopsToAlignWith: function (e, t, i) { if ("undefined" == typeof t || null === t || !e.length) return []; var n = Math.ceil(9e4 * (t - i + 3)), r = void 0; for (r = 0; r < e.length && !(e[r].pts > n); r++); return e.slice(r) }(this.gopBuffer_, this.mediaSource_.player_ ? this.mediaSource_.player_.currentTime() : null, this.timeMapping_) }), this.transmuxer_.postMessage({ action: "push", data: e.buffer, byteOffset: e.byteOffset, byteLength: e.byteLength }, [e.buffer]), this.transmuxer_.postMessage({ action: "flush" }) } }, { key: "appendGopInfo_", value: function (e) { this.gopBuffer_ = function (e, t, i) { if (!t.length) return e; if (i) return t.slice(); for (var n = t[0].pts, r = 0; r < e.length && !(e[r].pts >= n); r++); return e.slice(0, r).concat(t) }(this.gopBuffer_, e.data.gopInfo, this.safeAppend_) } }, { key: "remove", value: function (e, t) { if (this.videoBuffer_ && (this.videoBuffer_.updating = !0, this.videoBuffer_.remove(e, t), this.gopBuffer_ = function (e, t, i, n) { for (var r = Math.ceil(9e4 * (t - n)), a = Math.ceil(9e4 * (i - n)), s = e.slice(), o = e.length; o-- && !(e[o].pts <= a);); if (-1 === o) return s; for (var u = o + 1; u-- && !(e[u].pts <= r);); return u = Math.max(u, 0), s.splice(u, o - u + 1), s }(this.gopBuffer_, e, t, this.timeMapping_)), !this.audioDisabled_ && this.audioBuffer_ && (this.audioBuffer_.updating = !0, this.audioBuffer_.remove(e, t)), Yl(e, t, this.metadataTrack_), this.inbandTextTracks_) for (var i in this.inbandTextTracks_) Yl(e, t, this.inbandTextTracks_[i]) } }, { key: "processPendingSegments_", value: function () { var e = { video: { segments: [], bytes: 0 }, audio: { segments: [], bytes: 0 }, captions: [], metadata: [] }; if (!this.pendingBuffers_.length) return this.trigger("updateend"), void (this.bufferUpdating_ = !1); e = this.pendingBuffers_.reduce(function (e, t) { var i = t.type, n = t.data, r = t.initSegment; return e[i].segments.push(n), e[i].bytes += n.byteLength, e[i].initSegment = r, t.captions && (e.captions = e.captions.concat(t.captions)), t.info && (e[i].info = t.info), t.metadata && (e.metadata = e.metadata.concat(t.metadata)), e }, e), this.videoBuffer_ || this.audioBuffer_ || (0 === e.video.bytes && (this.videoCodec_ = null), 0 === e.audio.bytes && (this.audioCodec_ = null), this.createRealSourceBuffers_()), e.audio.info && this.mediaSource_.trigger({ type: "audioinfo", info: e.audio.info }), e.video.info && this.mediaSource_.trigger({ type: "videoinfo", info: e.video.info }), this.appendAudioInitSegment_ && (!this.audioDisabled_ && this.audioBuffer_ && (e.audio.segments.unshift(e.audio.initSegment), e.audio.bytes += e.audio.initSegment.byteLength), this.appendAudioInitSegment_ = !1); var t = !1; this.videoBuffer_ && e.video.bytes ? (e.video.segments.unshift(e.video.initSegment), e.video.bytes += e.video.initSegment.byteLength, this.concatAndAppendSegments_(e.video, this.videoBuffer_)) : !this.videoBuffer_ || !this.audioDisabled_ && this.audioBuffer_ || (t = !0), Ql(this, e.captions, e.metadata), !this.audioDisabled_ && this.audioBuffer_ && this.concatAndAppendSegments_(e.audio, this.audioBuffer_), this.pendingBuffers_.length = 0, t && this.trigger("updateend"), this.bufferUpdating_ = !1 } }, { key: "concatAndAppendSegments_", value: function (e, t) { var i = 0, n = void 0; if (e.bytes) { n = new Uint8Array(e.bytes), e.segments.forEach(function (e) { n.set(e, i), i += e.byteLength }); try { t.updating = !0, t.appendBuffer(n) } catch (e) { this.mediaSource_.player_ && this.mediaSource_.player_.error({ code: -3, type: "APPEND_BUFFER_ERR", message: e.message, originalError: e }) } } } }, { key: "abort", value: function () { this.videoBuffer_ && this.videoBuffer_.abort(), !this.audioDisabled_ && this.audioBuffer_ && this.audioBuffer_.abort(), this.transmuxer_ && this.transmuxer_.postMessage({ action: "reset" }), this.pendingBuffers_.length = 0, this.bufferUpdating_ = !1 } }, { key: "dispose", value: function () { this.trigger("dispose"), this.off() } }]), wc); function wc(e, t) { sl(this, wc); var i = cl(this, (wc.__proto__ || Object.getPrototypeOf(wc)).call(this, sa.EventTarget)); i.timestampOffset_ = 0, i.pendingBuffers_ = [], i.bufferUpdating_ = !1, i.mediaSource_ = e, i.codecs_ = t, i.audioCodec_ = null, i.videoCodec_ = null, i.audioDisabled_ = !1, i.appendAudioInitSegment_ = !0, i.gopBuffer_ = [], i.timeMapping_ = 0, i.safeAppend_ = 11 <= sa.browser.IE_VERSION; var n = { remux: !1, alignGopsAtEnd: i.safeAppend_ }; return i.codecs_.forEach(function (e) { Tc(e) ? i.audioCodec_ = e : Sc(e) && (i.videoCodec_ = e) }), i.transmuxer_ = new kc, i.transmuxer_.postMessage({ action: "init", options: n }), i.transmuxer_.onmessage = function (e) { return "data" === e.data.action ? i.data_(e) : "done" === e.data.action ? i.done_(e) : "gopInfo" === e.data.action ? i.appendGopInfo_(e) : "videoSegmentTimingInfo" === e.data.action ? i.videoSegmentTimingInfo_(e.data.videoSegmentTimingInfo) : void 0 }, Object.defineProperty(i, "timestampOffset", { get: function () { return this.timestampOffset_ }, set: function (e) { "number" == typeof e && 0 <= e && (this.timestampOffset_ = e, this.appendAudioInitSegment_ = !0, this.gopBuffer_.length = 0, this.timeMapping_ = 0, this.transmuxer_.postMessage({ action: "setTimestampOffset", timestampOffset: e })) } }), Object.defineProperty(i, "appendWindowStart", { get: function () { return (this.videoBuffer_ || this.audioBuffer_).appendWindowStart }, set: function (e) { this.videoBuffer_ && (this.videoBuffer_.appendWindowStart = e), this.audioBuffer_ && (this.audioBuffer_.appendWindowStart = e) } }), Object.defineProperty(i, "updating", { get: function () { return !!(this.bufferUpdating_ || !this.audioDisabled_ && this.audioBuffer_ && this.audioBuffer_.updating || this.videoBuffer_ && this.videoBuffer_.updating) } }), Object.defineProperty(i, "buffered", { get: function () { return function (e, t, i) { var n = null, r = null, a = 0, s = [], o = []; if (!e && !t) return sa.createTimeRange(); if (!e) return t.buffered; if (!t) return e.buffered; if (i) return e.buffered; if (0 === e.buffered.length && 0 === t.buffered.length) return sa.createTimeRange(); for (var u = e.buffered, l = t.buffered, c = u.length; c--;)s.push({ time: u.start(c), type: "start" }), s.push({ time: u.end(c), type: "end" }); for (c = l.length; c--;)s.push({ time: l.start(c), type: "start" }), s.push({ time: l.end(c), type: "end" }); for (s.sort(function (e, t) { return e.time - t.time }), c = 0; c < s.length; c++)"start" === s[c].type ? 2 === ++a && (n = s[c].time) : "end" === s[c].type && 1 === --a && (r = s[c].time), null !== n && null !== r && (o.push([n, r]), r = n = null); return sa.createTimeRanges(o) }(this.videoBuffer_, this.audioBuffer_, this.audioDisabled_) } }), i } var Ac = (ll(Ic, sa.EventTarget), ol(Ic, [{ key: "addSeekableRange_", value: function (e, t) { var i = void 0; if (this.duration !== 1 / 0) throw (i = new Error("MediaSource.addSeekableRange() can only be invoked when the duration is Infinity")).name = "InvalidStateError", i.code = 11, i; (t > this.nativeMediaSource_.duration || isNaN(this.nativeMediaSource_.duration)) && (this.nativeMediaSource_.duration = t) } }, { key: "addSourceBuffer", value: function (e) { var t = void 0, i = bc(e); if (/^(video|audio)\/mp2t$/i.test(i.type)) { var n = []; i.parameters && i.parameters.codecs && (n = i.parameters.codecs.split(","), n = (n = gc(n)).filter(function (e) { return Tc(e) || Sc(e) })), 0 === n.length && (n = ["avc1.4d400d", "mp4a.40.2"]), t = new Ec(this, n), 0 !== this.sourceBuffers.length && (this.sourceBuffers[0].createRealSourceBuffers_(), t.createRealSourceBuffers_(), this.sourceBuffers[0].audioDisabled_ = !0) } else t = this.nativeMediaSource_.addSourceBuffer(e); return this.sourceBuffers.push(t), t } }, { key: "dispose", value: function () { this.trigger("dispose"), this.off(), this.sourceBuffers.forEach(function (e) { e.dispose && e.dispose() }), this.sourceBuffers.length = 0 } }]), Ic); function Ic() { sl(this, Ic); var a = cl(this, (Ic.__proto__ || Object.getPrototypeOf(Ic)).call(this)), e = void 0; for (e in a.nativeMediaSource_ = new y.MediaSource, a.nativeMediaSource_) e in Ic.prototype || "function" != typeof a.nativeMediaSource_[e] || (a[e] = a.nativeMediaSource_[e].bind(a.nativeMediaSource_)); return a.duration_ = NaN, Object.defineProperty(a, "duration", { get: function () { return this.duration_ === 1 / 0 ? this.duration_ : this.nativeMediaSource_.duration }, set: function (e) { (this.duration_ = e) === 1 / 0 || (this.nativeMediaSource_.duration = e) } }), Object.defineProperty(a, "seekable", { get: function () { return this.duration_ === 1 / 0 ? sa.createTimeRanges([[0, this.nativeMediaSource_.duration]]) : this.nativeMediaSource_.seekable } }), Object.defineProperty(a, "readyState", { get: function () { return this.nativeMediaSource_.readyState } }), Object.defineProperty(a, "activeSourceBuffers", { get: function () { return this.activeSourceBuffers_ } }), a.sourceBuffers = [], a.activeSourceBuffers_ = [], a.updateActiveSourceBuffers_ = function () { if (a.activeSourceBuffers_.length = 0, 1 === a.sourceBuffers.length) { var e = a.sourceBuffers[0]; return e.appendAudioInitSegment_ = !0, e.audioDisabled_ = !e.audioCodec_, void a.activeSourceBuffers_.push(e) } for (var i = !1, n = !0, t = 0; t < a.player_.audioTracks().length; t++) { var r = a.player_.audioTracks()[t]; if (r.enabled && "main" !== r.kind) { n = !(i = !0); break } } a.sourceBuffers.forEach(function (e, t) { if (e.appendAudioInitSegment_ = !0, e.videoCodec_ && e.audioCodec_) e.audioDisabled_ = i; else if (e.videoCodec_ && !e.audioCodec_) e.audioDisabled_ = !0, n = !1; else if (!e.videoCodec_ && e.audioCodec_ && (e.audioDisabled_ = t ? n : !n, e.audioDisabled_)) return; a.activeSourceBuffers_.push(e) }) }, a.onPlayerMediachange_ = function () { a.sourceBuffers.forEach(function (e) { e.appendAudioInitSegment_ = !0 }) }, a.onHlsReset_ = function () { a.sourceBuffers.forEach(function (e) { e.transmuxer_ && e.transmuxer_.postMessage({ action: "resetCaptions" }) }) }, a.onHlsSegmentTimeMapping_ = function (t) { a.sourceBuffers.forEach(function (e) { return e.timeMapping_ = t.mapping }) }, ["sourceopen", "sourceclose", "sourceended"].forEach(function (e) { this.nativeMediaSource_.addEventListener(e, this.trigger.bind(this)) }, a), a.on("sourceopen", function (e) { var t = h.querySelector('[src="' + a.url_ + '"]'); t && (a.player_ = sa(t.parentNode), a.player_ && (a.player_.tech_.on("hls-reset", a.onHlsReset_), a.player_.tech_.on("hls-segment-time-mapping", a.onHlsSegmentTimeMapping_), a.player_.audioTracks && a.player_.audioTracks() && (a.player_.audioTracks().on("change", a.updateActiveSourceBuffers_), a.player_.audioTracks().on("addtrack", a.updateActiveSourceBuffers_), a.player_.audioTracks().on("removetrack", a.updateActiveSourceBuffers_)), a.player_.on("mediachange", a.onPlayerMediachange_))) }), a.on("sourceended", function (e) { for (var t = $l(a.duration), i = 0; i < a.sourceBuffers.length; i++) { var n = a.sourceBuffers[i], r = n.metadataTrack_ && n.metadataTrack_.cues; r && r.length && (r[r.length - 1].endTime = t) } }), a.on("sourceclose", function (e) { this.sourceBuffers.forEach(function (e) { e.transmuxer_ && e.transmuxer_.terminate() }), this.sourceBuffers.length = 0, this.player_ && (this.player_.audioTracks && this.player_.audioTracks() && (this.player_.audioTracks().off("change", this.updateActiveSourceBuffers_), this.player_.audioTracks().off("addtrack", this.updateActiveSourceBuffers_), this.player_.audioTracks().off("removetrack", this.updateActiveSourceBuffers_)), this.player_.el_ && this.player_.off("mediachange", this.onPlayerMediachange_), this.player_.tech_ && this.player_.tech_.el_ && (this.player_.tech_.off("hls-reset", this.onHlsReset_), this.player_.tech_.off("hls-segment-time-mapping", this.onHlsSegmentTimeMapping_))) }), a } var xc = 0; sa.mediaSources = {}; function Pc(e, t) { var i = sa.mediaSources[e]; if (!i) throw new Error("Media Source not found (Video.js)"); i.trigger({ type: "sourceopen", swfId: t }) } function Lc() { return !!y.MediaSource && !!y.MediaSource.isTypeSupported && y.MediaSource.isTypeSupported('video/mp4;codecs="avc1.4d400d,mp4a.40.2"') } function Oc() { if (this.MediaSource = { open: Pc, supportsNativeMediaSources: Lc }, Lc()) return new Ac; throw new Error("Cannot use create a virtual MediaSource for this video") } Oc.open = Pc, Oc.supportsNativeMediaSources = Lc; var Dc = { createObjectURL: function (e) { var t = void 0; return e instanceof Ac ? (t = y.URL.createObjectURL(e.nativeMediaSource_), e.url_ = t) : e instanceof Ac ? (t = "blob:vjs-media-source/" + xc, xc++, sa.mediaSources[t] = e, t) : (t = y.URL.createObjectURL(e), e.url_ = t) } }; sa.MediaSource = Oc, sa.URL = Dc; function Nc(e, t) { for (var s = void 0, o = Bc(e, { duration: t.duration, minimumUpdatePeriod: t.minimumUpdatePeriod }), i = 0; i < t.playlists.length; i++) { var n = dl(o, t.playlists[i]); n ? o = n : s = !0 } return hl(t, function (e, t, i, n) { if (e.playlists && e.playlists.length) { var r = e.playlists[0].id, a = dl(o, e.playlists[0]); a && ((o = a).mediaGroups[t][i][n].playlists[0] = o.playlists[r], s = !1) } }), s ? null : o } function Rc(e) { var t = e.byterange.offset + e.byterange.length - 1; return e.uri + "-" + e.byterange.offset + "-" + t } function Uc(e, t) { var i, n, r = {}; for (var a in e) { var s = e[a].sidx; if (s) { var o = Rc(s); if (!t[o]) break; var u = t[o].sidxInfo; i = u, n = s, (Boolean(!i.map && !n.map) || Boolean(i.map && n.map && i.map.byterange.offset === n.map.byterange.offset && i.map.byterange.length === n.map.byterange.length)) && i.uri === n.uri && i.byterange.offset === n.byterange.offset && i.byterange.length === n.byterange.length && (r[o] = t[o]) } } return r } function Mc(e, t, i, n, r) { var a = { uri: al(n.handleManifestRedirects, e.resolvedUri), byterange: e.byterange, playlist: t }; return i(sa.mergeOptions(a, { responseType: "arraybuffer", headers: Rl(a) }), r) } var Bc = sa.mergeOptions, jc = (ll(Fc, sa.EventTarget), ol(Fc, [{ key: "setupChildLoader", value: function (e, t) { this.masterPlaylistLoader_ = e, this.childPlaylist_ = t } }, { key: "dispose", value: function () { this.trigger("dispose"), this.stopRequest(), this.loadedPlaylists_ = {}, y.clearTimeout(this.minimumUpdatePeriodTimeout_), y.clearTimeout(this.mediaRequest_), y.clearTimeout(this.mediaUpdateTimeout), this.off() } }, { key: "hasPendingRequest", value: function () { return this.request || this.mediaRequest_ } }, { key: "stopRequest", value: function () { if (this.request) { var e = this.request; this.request = null, e.onreadystatechange = null, e.abort() } } }, { key: "sidxRequestFinished_", value: function (r, a, s, o) { var u = this; return function (e, t) { if (u.request) { if (u.request = null, e) return u.error = { status: t.status, message: "DASH playlist request error at URL: " + r.uri, response: t.response, code: 2 }, s && (u.state = s), u.trigger("error"), o(a, null); var i = new Uint8Array(t.response), n = $o.parseSidx(i.subarray(8)); return o(a, n) } } } }, { key: "media", value: function (i) { var n = this; if (!i) return this.media_; if ("HAVE_NOTHING" === this.state) throw new Error("Cannot switch media playlist from " + this.state); var r = this.state; if ("string" == typeof i) { if (!this.master.playlists[i]) throw new Error("Unknown playlist URI: " + i); i = this.master.playlists[i] } var e = !this.media_ || i.id !== this.media_.id; if (e && this.loadedPlaylists_[i.id] && this.loadedPlaylists_[i.id].endList) return this.state = "HAVE_METADATA", this.media_ = i, void (e && (this.trigger("mediachanging"), this.trigger("mediachange"))); if (e) if (this.media_ && this.trigger("mediachanging"), i.sidx) { var t = void 0, a = void 0; a = this.masterPlaylistLoader_ ? (t = this.masterPlaylistLoader_.master, this.masterPlaylistLoader_.sidxMapping_) : (t = this.master, this.sidxMapping_); var s = Rc(i.sidx); a[s] = { sidxInfo: i.sidx }, this.request = Mc(i.sidx, i, this.hls_.xhr, { handleManifestRedirects: this.handleManifestRedirects }, this.sidxRequestFinished_(i, t, r, function (e, t) { if (!e || !t) throw new Error("failed to request sidx"); a[s].sidx = t, n.haveMetadata({ startingState: r, playlist: e.playlists[i.id] }) })) } else this.mediaRequest_ = y.setTimeout(this.haveMetadata.bind(this, { startingState: r, playlist: i }), 0) } }, { key: "haveMetadata", value: function (e) { var t = e.startingState, i = e.playlist; this.state = "HAVE_METADATA", this.loadedPlaylists_[i.id] = i, this.mediaRequest_ = null, this.refreshMedia_(i.id), "HAVE_MASTER" === t ? this.trigger("loadedmetadata") : this.trigger("mediachange") } }, { key: "pause", value: function () { this.stopRequest(), y.clearTimeout(this.mediaUpdateTimeout), y.clearTimeout(this.minimumUpdatePeriodTimeout_), "HAVE_NOTHING" === this.state && (this.started = !1) } }, { key: "load", value: function (e) { var t = this; y.clearTimeout(this.mediaUpdateTimeout), y.clearTimeout(this.minimumUpdatePeriodTimeout_); var i = this.media(); if (e) { var n = i ? i.targetDuration / 2 * 1e3 : 5e3; this.mediaUpdateTimeout = y.setTimeout(function () { return t.load() }, n) } else this.started ? i && !i.endList ? this.trigger("mediaupdatetimeout") : this.trigger("loadedplaylist") : this.start() } }, { key: "parseMasterXml", value: function () { var s = To(this.masterXml_, { manifestUri: this.srcUrl, clientOffset: this.clientOffset_, sidxMapping: this.sidxMapping_ }); s.uri = this.srcUrl; for (var e = 0; e < s.playlists.length; e++) { var t = "placeholder-uri-" + e; s.playlists[e].uri = t } return hl(s, function (e, t, i, n) { if (e.playlists && e.playlists.length) { var r = "placeholder-uri-" + t + "-" + i + "-" + n, a = pl(0, r); e.playlists[0].uri = r, e.playlists[0].id = a, s.playlists[a] = e.playlists[0], s.playlists[r] = e.playlists[0] } }), fl(s), ml(s), s } }, { key: "start", value: function () { var i = this; this.started = !0, this.masterPlaylistLoader_ ? this.mediaRequest_ = y.setTimeout(this.haveMaster_.bind(this), 0) : this.request = this.hls_.xhr({ uri: this.srcUrl, withCredentials: this.withCredentials }, function (e, t) { if (i.request) { if (i.request = null, e) return i.error = { status: t.status, message: "DASH playlist request error at URL: " + i.srcUrl, responseText: t.responseText, code: 2 }, "HAVE_NOTHING" === i.state && (i.started = !1), i.trigger("error"); i.masterXml_ = t.responseText, t.responseHeaders && t.responseHeaders.date ? i.masterLoaded_ = Date.parse(t.responseHeaders.date) : i.masterLoaded_ = Date.now(), i.srcUrl = al(i.handleManifestRedirects, i.srcUrl, t), i.syncClientServerClock_(i.onClientServerClockSync_.bind(i)) } }) } }, { key: "syncClientServerClock_", value: function (n) { var r = this, a = So(this.masterXml_); return null === a ? (this.clientOffset_ = this.masterLoaded_ - Date.now(), n()) : "DIRECT" === a.method ? (this.clientOffset_ = a.value - Date.now(), n()) : void (this.request = this.hls_.xhr({ uri: rl(this.srcUrl, a.value), method: a.method, withCredentials: this.withCredentials }, function (e, t) { if (r.request) { if (e) return r.clientOffset_ = r.masterLoaded_ - Date.now(), n(); var i = void 0; i = "HEAD" === a.method ? t.responseHeaders && t.responseHeaders.date ? Date.parse(t.responseHeaders.date) : r.masterLoaded_ : Date.parse(t.responseText), r.clientOffset_ = i - Date.now(), n() } })) } }, { key: "haveMaster_", value: function () { this.state = "HAVE_MASTER", this.mediaRequest_ = null, this.masterPlaylistLoader_ ? this.media_ || this.media(this.childPlaylist_) : (this.master = this.parseMasterXml(), this.trigger("loadedplaylist")) } }, { key: "onClientServerClockSync_", value: function () { var e = this; this.haveMaster_(), this.hasPendingRequest() || this.media_ || this.media(this.master.playlists[0]), this.master && this.master.minimumUpdatePeriod && (this.minimumUpdatePeriodTimeout_ = y.setTimeout(function () { e.trigger("minimumUpdatePeriod") }, this.master.minimumUpdatePeriod)) } }, { key: "refreshXml_", value: function () { var o = this; this.request = this.hls_.xhr({ uri: this.srcUrl, withCredentials: this.withCredentials }, function (e, t) { if (o.request) { if (o.request = null, e) return o.error = { status: t.status, message: "DASH playlist request error at URL: " + o.srcUrl, responseText: t.responseText, code: 2 }, "HAVE_NOTHING" === o.state && (o.started = !1), o.trigger("error"); o.masterXml_ = t.responseText, o.sidxMapping_ = function (e, t, i, a) { var n = To(e, { manifestUri: t, clientOffset: i }), s = Uc(n.playlists, a); return hl(n, function (e, t, i, n) { if (e.playlists && e.playlists.length) { var r = e.playlists; s = Bc(s, Uc(r, a)) } }), s }(o.masterXml_, o.srcUrl, o.clientOffset_, o.sidxMapping_); var i = o.parseMasterXml(), n = Nc(o.master, i), r = o.media().sidx; if (n) if (r) { var a = Rc(r); if (!o.sidxMapping_[a]) { var s = o.media(); o.request = Mc(s.sidx, s, o.hls_.xhr, { handleManifestRedirects: o.handleManifestRedirects }, o.sidxRequestFinished_(s, i, o.state, function (e, t) { if (!e || !t) throw new Error("failed to request sidx on minimumUpdatePeriod"); o.sidxMapping_[a].sidx = t, o.minimumUpdatePeriodTimeout_ = y.setTimeout(function () { o.trigger("minimumUpdatePeriod") }, o.master.minimumUpdatePeriod), o.refreshMedia_(o.media().id) })) } } else o.master = n; o.minimumUpdatePeriodTimeout_ = y.setTimeout(function () { o.trigger("minimumUpdatePeriod") }, o.master.minimumUpdatePeriod) } }) } }, { key: "refreshMedia_", value: function (e) { var t = this; if (!e) throw new Error("refreshMedia_ must take a media id"); var i = void 0, n = void 0; n = this.masterPlaylistLoader_ ? (i = this.masterPlaylistLoader_.master, this.masterPlaylistLoader_.parseMasterXml()) : (i = this.master, this.parseMasterXml()); var r = Nc(i, n); r ? (this.masterPlaylistLoader_ ? this.masterPlaylistLoader_.master = r : this.master = r, this.media_ = r.playlists[e]) : (this.media_ = n.playlists[e], this.trigger("playlistunchanged")), this.media().endList || (this.mediaUpdateTimeout = y.setTimeout(function () { t.trigger("mediaupdatetimeout") }, gl(this.media(), !!r))), this.trigger("loadedplaylist") } }]), Fc); function Fc(e, t) { var i = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : {}, n = arguments[3]; sl(this, Fc); var r = cl(this, (Fc.__proto__ || Object.getPrototypeOf(Fc)).call(this)), a = i.withCredentials, s = void 0 !== a && a, o = i.handleManifestRedirects, u = void 0 !== o && o; if (r.hls_ = t, r.withCredentials = s, r.handleManifestRedirects = u, !e) throw new Error("A non-empty playlist URL or playlist is required"); return r.on("minimumUpdatePeriod", function () { r.refreshXml_() }), r.on("mediaupdatetimeout", function () { r.refreshMedia_(r.media().id) }), r.state = "HAVE_NOTHING", r.loadedPlaylists_ = {}, "string" == typeof e ? (r.srcUrl = e, r.sidxMapping_ = {}, cl(r)) : (r.setupChildLoader(n, e), r) } function Hc(e) { return sa.log.debug ? sa.log.debug.bind(sa, "VHS:", e + " >") : function () { } } function Vc() { } var qc = (ol(Wc, [{ key: "createSourceBuffer_", value: function (e, t) { var i = this; this.sourceBuffer_ = this.mediaSource.addSourceBuffer(e), this.logger_("created SourceBuffer"), t && (t.trigger("sourcebufferadded"), this.mediaSource.sourceBuffers.length < 2) ? t.on("sourcebufferadded", function () { i.start_() }) : this.start_() } }, { key: "start_", value: function () { var t = this; this.started_ = !0, this.onUpdateendCallback_ = function () { var e = t.pendingCallback_; t.pendingCallback_ = null, t.sourceBuffer_.removing = !1, t.logger_("buffered [" + Xl(t.buffered()) + "]"), e && e(), t.runCallback_() }, this.sourceBuffer_.addEventListener("updateend", this.onUpdateendCallback_), this.runCallback_() } }, { key: "abort", value: function (e) { var t = this; this.processedAppend_ && this.queueCallback_(function () { t.sourceBuffer_.abort() }, e) } }, { key: "appendBuffer", value: function (e, t) { var i = this; this.processedAppend_ = !0, this.queueCallback_(function () { e.videoSegmentTimingInfoCallback && i.sourceBuffer_.addEventListener("videoSegmentTimingInfo", e.videoSegmentTimingInfoCallback), i.sourceBuffer_.appendBuffer(e.bytes) }, function () { e.videoSegmentTimingInfoCallback && i.sourceBuffer_.removeEventListener("videoSegmentTimingInfo", e.videoSegmentTimingInfoCallback), t() }) } }, { key: "buffered", value: function () { return this.sourceBuffer_ ? this.sourceBuffer_.buffered : sa.createTimeRanges() } }, { key: "remove", value: function (e, t, i) { var n = this, r = 2 < arguments.length && void 0 !== i ? i : Vc; this.processedAppend_ && this.queueCallback_(function () { n.logger_("remove [" + e + " => " + t + "]"), n.sourceBuffer_.removing = !0, n.sourceBuffer_.remove(e, t) }, r) } }, { key: "updating", value: function () { return !this.sourceBuffer_ || this.sourceBuffer_.updating || !!this.pendingCallback_ && this.pendingCallback_ !== Vc } }, { key: "timestampOffset", value: function (e) { var t = this; return "undefined" != typeof e && (this.queueCallback_(function () { t.sourceBuffer_.timestampOffset = e, t.runCallback_() }), this.timestampOffset_ = e), this.timestampOffset_ } }, { key: "queueCallback_", value: function (e, t) { this.callbacks_.push([e.bind(this), t]), this.runCallback_() } }, { key: "runCallback_", value: function () { var e = void 0; !this.updating() && this.callbacks_.length && this.started_ && (e = this.callbacks_.shift(), this.pendingCallback_ = e[1], e[0]()) } }, { key: "dispose", value: function () { function e() { t.sourceBuffer_ && "open" === t.mediaSource.readyState && t.sourceBuffer_.abort(), t.sourceBuffer_.removeEventListener("updateend", e) } var t = this; this.sourceBuffer_.removeEventListener("updateend", this.onUpdateendCallback_), this.sourceBuffer_.removing ? this.sourceBuffer_.addEventListener("updateend", e) : e() } }]), Wc); function Wc(e, t, i, n) { sl(this, Wc), this.callbacks_ = [], this.pendingCallback_ = null, this.timestampOffset_ = 0, this.mediaSource = e, this.processedAppend_ = !1, this.type_ = i, this.mimeType_ = t, this.logger_ = Hc("SourceUpdater[" + i + "][" + t + "]"), "closed" === e.readyState ? e.addEventListener("sourceopen", this.createSourceBuffer_.bind(this, t, n)) : this.createSourceBuffer_(t, n) } function zc(e) { e.forEach(function (e) { e.abort() }) } function Gc(e, t) { return t.timedout ? { status: t.status, message: "HLS request timed-out at URL: " + t.uri, code: ih, xhr: t } : t.aborted ? { status: t.status, message: "HLS request aborted at URL: " + t.uri, code: nh, xhr: t } : e ? { status: t.status, message: "HLS request errored at URL: " + t.uri, code: th, xhr: t } : null } function Xc(i, n, r) { var a = 0, s = !1; return function (e, t) { if (!s) return e ? (s = !0, zc(i), r(e, t)) : (a += 1) === i.length ? (t.endOfAllRequests = Date.now(), t.encryptedBytes ? function (n, r, a) { n.addEventListener("message", function e(t) { if (t.data.source === r.requestId) { n.removeEventListener("message", e); var i = t.data.decrypted; return r.bytes = new Uint8Array(i.bytes, i.byteOffset, i.byteLength), a(null, r) } }); var e = void 0; e = r.key.bytes.slice ? r.key.bytes.slice() : new Uint32Array(Array.prototype.slice.call(r.key.bytes)), n.postMessage(Bl({ source: r.requestId, encrypted: r.encryptedBytes, key: e, iv: r.key.iv }), [r.encryptedBytes.buffer, e.buffer]) }(n, t, r) : r(null, t)) : void 0 } } function Kc(t, i) { return function (e) { return t.stats = sa.mergeOptions(t.stats, function (e) { var t = e.target, i = { bandwidth: 1 / 0, bytesReceived: 0, roundTripTime: Date.now() - t.requestTime || 0 }; return i.bytesReceived = e.loaded, i.bandwidth = Math.floor(i.bytesReceived / i.roundTripTime * 8 * 1e3), i }(e)), !t.stats.firstBytesReceivedAt && t.stats.bytesReceived && (t.stats.firstBytesReceivedAt = Date.now()), i(e, t) } } function Yc(e, t, i, n, r, a, s) { var o = [], u = Xc(o, i, s); if (r.key && !r.key.bytes) { var l = e(sa.mergeOptions(t, { uri: r.key.resolvedUri, responseType: "arraybuffer" }), function (a, s) { return function (e, t) { var i = t.response, n = Gc(e, t); if (n) return s(n, a); if (16 !== i.byteLength) return s({ status: t.status, message: "Invalid HLS key at URL: " + t.uri, code: th, xhr: t }, a); var r = new DataView(i); return a.key.bytes = new Uint32Array([r.getUint32(0), r.getUint32(4), r.getUint32(8), r.getUint32(12)]), s(null, a) } }(r, u)); o.push(l) } if (r.map && !r.map.bytes) { var c = e(sa.mergeOptions(t, { uri: r.map.resolvedUri, responseType: "arraybuffer", headers: Rl(r.map) }), function (r, a, s) { return function (e, t) { var i = t.response, n = Gc(e, t); return n ? s(n, r) : 0 === i.byteLength ? s({ status: t.status, message: "Empty HLS segment content at URL: " + t.uri, code: th, xhr: t }, r) : (r.map.bytes = new Uint8Array(t.response), a && !a.isInitialized() && a.init(), r.map.timescales = eu.timescale(r.map.bytes), r.map.videoTrackIds = eu.videoTrackIds(r.map.bytes), s(null, r)) } }(r, n, u)); o.push(c) } var h = e(sa.mergeOptions(t, { uri: r.resolvedUri, responseType: "arraybuffer", headers: Rl(r) }), function (a, s, o) { return function (e, t) { var i = t.response, n = Gc(e, t), r = void 0; return n ? o(n, a) : 0 === i.byteLength ? o({ status: t.status, message: "Empty HLS segment content at URL: " + t.uri, code: th, xhr: t }, a) : (a.stats = function (e) { return { bandwidth: e.bandwidth, bytesReceived: e.bytesReceived || 0, roundTripTime: e.roundTripTime || 0 } }(t), a.key ? a.encryptedBytes = new Uint8Array(t.response) : a.bytes = new Uint8Array(t.response), s && a.map && a.map.bytes && (s.isInitialized() || s.init(), (r = s.parse(a.bytes, a.map.videoTrackIds, a.map.timescales)) && r.captions && (a.captionStreams = r.captionStreams, a.fmp4Captions = r.captions)), o(null, a)) } }(r, n, u)); return h.addEventListener("progress", Kc(r, a)), o.push(h), function () { return zc(o) } } function $c(e, t) { var i; return e && (i = y.getComputedStyle(e)) ? i[t] : "" } function Qc(e, n) { var r = e.slice(); e.sort(function (e, t) { var i = n(e, t); return 0 === i ? r.indexOf(e) - r.indexOf(t) : i }) } function Jc(e, t) { var i = void 0, n = void 0; return e.attributes.BANDWIDTH && (i = e.attributes.BANDWIDTH), i = i || y.Number.MAX_VALUE, t.attributes.BANDWIDTH && (n = t.attributes.BANDWIDTH), i - (n = n || y.Number.MAX_VALUE) } function Zc(e) { return "number" == typeof e && isFinite(e) } var eh = { GOAL_BUFFER_LENGTH: 30, MAX_GOAL_BUFFER_LENGTH: 60, GOAL_BUFFER_LENGTH_RATE: 1, INITIAL_BANDWIDTH: 4194304, BANDWIDTH_VARIANCE: 1.2, BUFFER_LOW_WATER_LINE: 0, MAX_BUFFER_LOW_WATER_LINE: 30, BUFFER_LOW_WATER_LINE_RATE: 1 }, th = 2, ih = -101, nh = -102, rh = (ll(ah, sa.EventTarget), ol(ah, [{ key: "resetStats_", value: function () { this.mediaBytesTransferred = 0, this.mediaRequests = 0, this.mediaRequestsAborted = 0, this.mediaRequestsTimedout = 0, this.mediaRequestsErrored = 0, this.mediaTransferDuration = 0, this.mediaSecondsLoaded = 0 } }, { key: "dispose", value: function () { this.trigger("dispose"), this.state = "DISPOSED", this.pause(), this.abort_(), this.sourceUpdater_ && this.sourceUpdater_.dispose(), this.resetStats_(), this.captionParser_ && this.captionParser_.reset(), this.checkBufferTimeout_ && y.clearTimeout(this.checkBufferTimeout_), this.syncController_ && this.triggerSyncInfoUpdate_ && this.syncController_.off("syncinfoupdate", this.triggerSyncInfoUpdate_), this.off() } }, { key: "abort", value: function () { "WAITING" === this.state ? (this.abort_(), this.state = "READY", this.paused() || this.monitorBuffer_()) : this.pendingSegment_ && (this.pendingSegment_ = null) } }, { key: "abort_", value: function () { this.pendingSegment_ && this.pendingSegment_.abortRequests(), this.pendingSegment_ = null } }, { key: "error", value: function (e) { return "undefined" != typeof e && (this.error_ = e), this.pendingSegment_ = null, this.error_ } }, { key: "endOfStream", value: function () { this.ended_ = !0, this.pause(), this.trigger("ended") } }, { key: "buffered_", value: function () { return this.sourceUpdater_ ? this.sourceUpdater_.buffered() : sa.createTimeRanges() } }, { key: "initSegment", value: function (e, t) { var i = 1 < arguments.length && void 0 !== t && t; if (!e) return null; var n = jl(e), r = this.initSegments_[n]; return i && !r && e.bytes && (this.initSegments_[n] = r = { resolvedUri: e.resolvedUri, byterange: e.byterange, bytes: e.bytes, timescales: e.timescales, videoTrackIds: e.videoTrackIds }), r || e } }, { key: "segmentKey", value: function (e, t) { var i = 1 < arguments.length && void 0 !== t && t; if (!e) return null; var n = Fl(e), r = this.keyCache_[n]; this.cacheEncryptionKeys_ && i && !r && e.bytes && (this.keyCache_[n] = r = { resolvedUri: e.resolvedUri, bytes: e.bytes }); var a = { resolvedUri: (r || e).resolvedUri }; return r && (a.bytes = r.bytes), a } }, { key: "couldBeginLoading_", value: function () { return this.playlist_ && (this.sourceUpdater_ || this.mimeType_ && "INIT" === this.state) && !this.paused() } }, { key: "load", value: function () { if (this.monitorBuffer_(), this.playlist_) { if (this.syncController_.setDateTimeMapping(this.playlist_), "INIT" === this.state && this.couldBeginLoading_()) return this.init_(); !this.couldBeginLoading_() || "READY" !== this.state && "INIT" !== this.state || (this.state = "READY") } } }, { key: "init_", value: function () { return this.state = "READY", this.sourceUpdater_ = new qc(this.mediaSource_, this.mimeType_, this.loaderType_, this.sourceBufferEmitter_), this.resetEverything(), this.monitorBuffer_() } }, { key: "playlist", value: function (e, t) { var i = 1 < arguments.length && void 0 !== t ? t : {}; if (e) { var n = this.playlist_, r = this.pendingSegment_; this.playlist_ = e, this.xhrOptions_ = i, "INIT" === this.state && (e.syncInfo = { mediaSequence: e.mediaSequence, time: 0 }); var a = null; if (n && (n.id ? a = n.id : n.uri && (a = n.uri)), this.logger_("playlist update [" + a + " => " + (e.id || e.uri) + "]"), this.trigger("syncinfoupdate"), "INIT" === this.state && this.couldBeginLoading_()) return this.init_(); if (n && n.uri === e.uri) { var s = e.mediaSequence - n.mediaSequence; this.logger_("live window shift [" + s + "]"), null !== this.mediaIndex && (this.mediaIndex -= s), r && (r.mediaIndex -= s, 0 <= r.mediaIndex && (r.segment = e.segments[r.mediaIndex])), this.syncController_.saveExpiredSegmentInfo(n, e) } else null !== this.mediaIndex && this.resyncLoader() } } }, { key: "pause", value: function () { this.checkBufferTimeout_ && (y.clearTimeout(this.checkBufferTimeout_), this.checkBufferTimeout_ = null) } }, { key: "paused", value: function () { return null === this.checkBufferTimeout_ } }, { key: "mimeType", value: function (e, t) { this.mimeType_ || (this.mimeType_ = e, this.sourceBufferEmitter_ = t, "INIT" === this.state && this.couldBeginLoading_() && this.init_()) } }, { key: "resetEverything", value: function (e) { this.ended_ = !1, this.resetLoader(), this.remove(0, 1 / 0, e), this.captionParser_ && this.captionParser_.clearAllCaptions(), this.trigger("reseteverything") } }, { key: "resetLoader", value: function () { this.fetchAtBuffer_ = !1, this.resyncLoader() } }, { key: "resyncLoader", value: function () { this.mediaIndex = null, this.syncPoint_ = null, this.abort() } }, { key: "remove", value: function (e, t, i) { if (t === 1 / 0 && (t = this.duration_()), this.sourceUpdater_ && this.sourceUpdater_.remove(e, t, i), Yl(e, t, this.segmentMetadataTrack_), this.inbandTextTracks_) for (var n in this.inbandTextTracks_) Yl(e, t, this.inbandTextTracks_[n]) } }, { key: "monitorBuffer_", value: function () { this.checkBufferTimeout_ && y.clearTimeout(this.checkBufferTimeout_), this.checkBufferTimeout_ = y.setTimeout(this.monitorBufferTick_.bind(this), 1) } }, { key: "monitorBufferTick_", value: function () { "READY" === this.state && this.fillBuffer_(), this.checkBufferTimeout_ && y.clearTimeout(this.checkBufferTimeout_), this.checkBufferTimeout_ = y.setTimeout(this.monitorBufferTick_.bind(this), 500) } }, { key: "fillBuffer_", value: function () { if (!this.sourceUpdater_.updating()) { this.syncPoint_ || (this.syncPoint_ = this.syncController_.getSyncPoint(this.playlist_, this.duration_(), this.currentTimeline_, this.currentTime_())); var e = this.checkBuffer_(this.buffered_(), this.playlist_, this.mediaIndex, this.hasPlayed_(), this.currentTime_(), this.syncPoint_); e && (this.isEndOfStream_(e.mediaIndex) ? this.endOfStream() : e.mediaIndex === this.playlist_.segments.length - 1 && "ended" === this.mediaSource_.readyState && !this.seeking_() || (e.timeline !== this.currentTimeline_ && (this.syncController_.reset(), e.timestampOffset = e.startOfSegment, this.captionParser_ && this.captionParser_.clearAllCaptions()), this.loadSegment_(e))) } } }, { key: "isEndOfStream_", value: function (e, t) { return function (e, t, i) { if (!e || !t) return !1; var n = i === e.segments.length; return e.endList && "open" === t.readyState && n }(1 < arguments.length && void 0 !== t ? t : this.playlist_, this.mediaSource_, e) && !this.sourceUpdater_.updating() } }, { key: "checkBuffer_", value: function (e, t, i, n, r, a) { var s = 0, o = void 0; e.length && (s = e.end(e.length - 1)); var u = Math.max(0, s - r); if (!t.segments.length) return null; if (u >= this.goalBufferLength_()) return null; if (!n && 1 <= u) return null; if (null === a) return i = this.getSyncSegmentCandidate_(t), this.generateSegmentInfo_(t, i, null, !0); if (null !== i) return t.segments[i], o = s, this.generateSegmentInfo_(t, i + 1, o, !1); if (this.fetchAtBuffer_) { var l = tc.getMediaInfoForTime(t, s, a.segmentIndex, a.time); i = l.mediaIndex, o = l.startTime } else { var c = tc.getMediaInfoForTime(t, r, a.segmentIndex, a.time); i = c.mediaIndex, o = c.startTime } return this.generateSegmentInfo_(t, i, o, !1) } }, { key: "getSyncSegmentCandidate_", value: function (e) { var t = this; if (-1 === this.currentTimeline_) return 0; var i = e.segments.map(function (e, t) { return { timeline: e.timeline, segmentIndex: t } }).filter(function (e) { return e.timeline === t.currentTimeline_ }); return i.length ? i[Math.min(i.length - 1, 1)].segmentIndex : Math.max(e.segments.length - 1, 0) } }, { key: "generateSegmentInfo_", value: function (e, t, i, n) { if (t < 0 || t >= e.segments.length) return null; var r = e.segments[t]; return { requestId: "segment-loader-" + Math.random(), uri: r.resolvedUri, mediaIndex: t, isSyncRequest: n, startOfSegment: i, playlist: e, bytes: null, encryptedBytes: null, timestampOffset: null, timeline: r.timeline, duration: r.duration, segment: r } } }, { key: "abortRequestEarly_", value: function (e) { if (this.hls_.tech_.paused() || !this.xhrOptions_.timeout || !this.playlist_.attributes.BANDWIDTH) return !1; if (Date.now() - (e.firstBytesReceivedAt || Date.now()) < 1e3) return !1; var t = this.currentTime_(), i = e.bandwidth, n = this.pendingSegment_.duration, r = tc.estimateSegmentRequestTime(n, i, this.playlist_, e.bytesReceived), a = function (e, t, i) { var n = 2 < arguments.length && void 0 !== i ? i : 1; return ((e.length ? e.end(e.length - 1) : 0) - t) / n }(this.buffered_(), t, this.hls_.tech_.playbackRate()) - 1; if (r <= a) return !1; var s = function (e) { var t = e.master, i = e.currentTime, n = e.bandwidth, r = e.duration, a = e.segmentDuration, s = e.timeUntilRebuffer, o = e.currentTimeline, u = e.syncController, l = t.playlists.filter(function (e) { return !tc.isIncompatible(e) }), c = l.filter(tc.isEnabled); c.length || (c = l.filter(function (e) { return !tc.isDisabled(e) })); var h = c.filter(tc.hasAttribute.bind(null, "BANDWIDTH")).map(function (e) { var t = u.getSyncPoint(e, r, o, i) ? 1 : 2; return { playlist: e, rebufferingImpact: tc.estimateSegmentRequestTime(a, n, e) * t - s } }), d = h.filter(function (e) { return e.rebufferingImpact <= 0 }); return Qc(d, function (e, t) { return Jc(t.playlist, e.playlist) }), d.length ? d[0] : (Qc(h, function (e, t) { return e.rebufferingImpact - t.rebufferingImpact }), h[0] || null) }({ master: this.hls_.playlists.master, currentTime: t, bandwidth: i, duration: this.duration_(), segmentDuration: n, timeUntilRebuffer: a, currentTimeline: this.currentTimeline_, syncController: this.syncController_ }); if (s) { var o = r - a - s.rebufferingImpact, u = .5; return a <= 1 / 30 && (u = 1), !(!s.playlist || s.playlist.uri === this.playlist_.uri || o < u) && (this.bandwidth = s.playlist.attributes.BANDWIDTH * eh.BANDWIDTH_VARIANCE + 1, this.abort(), this.trigger("earlyabort"), !0) } } }, { key: "handleProgress_", value: function (e, t) { this.pendingSegment_ && t.requestId === this.pendingSegment_.requestId && !this.abortRequestEarly_(t.stats) && this.trigger("progress") } }, { key: "loadSegment_", value: function (e) { this.state = "WAITING", this.pendingSegment_ = e, this.trimBackBuffer_(e), e.abortRequests = Yc(this.hls_.xhr, this.xhrOptions_, this.decrypter_, this.captionParser_, this.createSimplifiedSegmentObj_(e), this.handleProgress_.bind(this), this.segmentRequestFinished_.bind(this)) } }, { key: "trimBackBuffer_", value: function (e) { var t = function (e, t, i) { var n = t - 30; e.length && (n = Math.max(n, e.start(0))); var r = t - i; return Math.min(r, n) }(this.seekable_(), this.currentTime_(), this.playlist_.targetDuration || 10); 0 < t && this.remove(0, t) } }, { key: "createSimplifiedSegmentObj_", value: function (e) { var t = e.segment, i = { resolvedUri: t.resolvedUri, byterange: t.byterange, requestId: e.requestId }; if (t.key) { var n = t.key.iv || new Uint32Array([0, 0, 0, e.mediaIndex + e.playlist.mediaSequence]); i.key = this.segmentKey(t.key), i.key.iv = n } return t.map && (i.map = this.initSegment(t.map)), i } }, { key: "segmentRequestFinished_", value: function (e, t) { if (this.mediaRequests += 1, t.stats && (this.mediaBytesTransferred += t.stats.bytesReceived, this.mediaTransferDuration += t.stats.roundTripTime), this.pendingSegment_) { if (t.requestId === this.pendingSegment_.requestId) { if (e) return this.pendingSegment_ = null, this.state = "READY", e.code === nh ? void (this.mediaRequestsAborted += 1) : (this.pause(), e.code === ih ? (this.mediaRequestsTimedout += 1, this.bandwidth = 1, this.roundTrip = NaN, void this.trigger("bandwidthupdate")) : (this.mediaRequestsErrored += 1, this.error(e), void this.trigger("error"))); this.bandwidth = t.stats.bandwidth, this.roundTrip = t.stats.roundTripTime, t.map && (t.map = this.initSegment(t.map, !0)), t.key && this.segmentKey(t.key, !0), this.processSegmentResponse_(t) } } else this.mediaRequestsAborted += 1 } }, { key: "processSegmentResponse_", value: function (e) { var t = this.pendingSegment_; t.bytes = e.bytes, e.map && (t.segment.map.bytes = e.map.bytes), t.endOfAllRequests = e.endOfAllRequests, e.fmp4Captions && (function (e, t, i) { for (var n in i) if (!e[n]) { t.trigger({ type: "usage", name: "hls-608" }); var r = t.textTracks().getTrackById(n); e[n] = r || t.addRemoteTextTrack({ kind: "captions", id: n, label: n }, !1).track } }(this.inbandTextTracks_, this.hls_.tech_, e.captionStreams), function (e) { var r = e.inbandTextTracks, t = e.captionArray, a = e.timestampOffset; if (t) { var s = window.WebKitDataCue || window.VTTCue; t.forEach(function (e) { var t = e.stream, i = e.startTime, n = e.endTime; r[t] && (i += a, n += a, r[t].addCue(new s(i, n, e.text))) }) } }({ inbandTextTracks: this.inbandTextTracks_, captionArray: e.fmp4Captions, timestampOffset: 0 }), this.captionParser_ && this.captionParser_.clearParsedCaptions()), this.handleSegment_() } }, { key: "handleSegment_", value: function () { var e = this; if (this.pendingSegment_) { var t = this.pendingSegment_, i = t.segment, n = this.syncController_.probeSegmentInfo(t); "undefined" == typeof this.startingMedia_ && n && (n.containsAudio || n.containsVideo) && (this.startingMedia_ = { containsAudio: n.containsAudio, containsVideo: n.containsVideo }); var r = function (e, t, i) { return "main" === e && t && i ? i.containsAudio || i.containsVideo ? t.containsVideo && !i.containsVideo ? "Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest." : !t.containsVideo && i.containsVideo ? "Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest." : null : "Neither audio nor video found in segment." : null }(this.loaderType_, this.startingMedia_, n); if (r) return this.error({ message: r, blacklistDuration: 1 / 0 }), void this.trigger("error"); if (t.isSyncRequest) return this.trigger("syncinfoupdate"), this.pendingSegment_ = null, void (this.state = "READY"); if (null !== t.timestampOffset && t.timestampOffset !== this.sourceUpdater_.timestampOffset()) { if (n && n.segmentTimestampInfo) { var a = n.segmentTimestampInfo[0].ptsTime, s = n.segmentTimestampInfo[0].dtsTime; t.timestampOffset -= a - s } this.sourceUpdater_.timestampOffset(t.timestampOffset), this.trigger("timestampoffset") } var o = this.syncController_.mappingForTimeline(t.timeline); if (null !== o && this.trigger({ type: "segmenttimemapping", mapping: o }), this.state = "APPENDING", i.map) { var u = jl(i.map); if (!this.activeInitSegmentId_ || this.activeInitSegmentId_ !== u) { var l = this.initSegment(i.map); this.sourceUpdater_.appendBuffer({ bytes: l.bytes }, function () { e.activeInitSegmentId_ = u }) } } t.byteLength = t.bytes.byteLength, "number" == typeof i.start && "number" == typeof i.end ? this.mediaSecondsLoaded += i.end - i.start : this.mediaSecondsLoaded += i.duration, this.logger_(function (e) { var t = e.segment, i = t.start, n = t.end, r = e.playlist, a = r.mediaSequence, s = r.id, o = r.segments, u = void 0 === o ? [] : o, l = e.mediaIndex, c = e.timeline; return ["appending [" + l + "] of [" + a + ", " + (a + u.length) + "] from playlist [" + s + "]", "[" + i + " => " + n + "] in timeline [" + c + "]"].join(" ") }(t)), this.sourceUpdater_.appendBuffer({ bytes: t.bytes, videoSegmentTimingInfoCallback: this.handleVideoSegmentTimingInfo_.bind(this, t.requestId) }, this.handleUpdateEnd_.bind(this)) } else this.state = "READY" } }, { key: "handleVideoSegmentTimingInfo_", value: function (e, t) { if (this.pendingSegment_ && e === this.pendingSegment_.requestId) { var i = this.pendingSegment_.segment; i.videoTimingInfo || (i.videoTimingInfo = {}), i.videoTimingInfo.transmuxerPrependedSeconds = t.videoSegmentTimingInfo.prependedContentDuration || 0, i.videoTimingInfo.transmuxedPresentationStart = t.videoSegmentTimingInfo.start.presentation, i.videoTimingInfo.transmuxedPresentationEnd = t.videoSegmentTimingInfo.end.presentation, i.videoTimingInfo.baseMediaDecodeTime = t.videoSegmentTimingInfo.baseMediaDecodeTime } } }, { key: "handleUpdateEnd_", value: function () { if (!this.pendingSegment_) return this.state = "READY", void (this.paused() || this.monitorBuffer_()); var e = this.pendingSegment_, t = e.segment, i = null !== this.mediaIndex; this.pendingSegment_ = null, this.recordThroughput_(e), this.addSegmentMetadataCue_(e), this.state = "READY", this.mediaIndex = e.mediaIndex, this.fetchAtBuffer_ = !0, this.currentTimeline_ = e.timeline, this.trigger("syncinfoupdate"), t.end && this.currentTime_() - t.end > 3 * e.playlist.targetDuration ? this.resetEverything() : (i && this.trigger("bandwidthupdate"), this.trigger("progress"), this.isEndOfStream_(e.mediaIndex + 1, e.playlist) && this.endOfStream(), this.paused() || this.monitorBuffer_()) } }, { key: "recordThroughput_", value: function (e) { var t = this.throughput.rate, i = Date.now() - e.endOfAllRequests + 1, n = Math.floor(e.byteLength / i * 8 * 1e3); this.throughput.rate += (n - t) / ++this.throughput.count } }, { key: "addSegmentMetadataCue_", value: function (e) { if (this.segmentMetadataTrack_) { var t = e.segment, i = t.start, n = t.end; if (Zc(i) && Zc(n)) { Yl(i, n, this.segmentMetadataTrack_); var r = y.WebKitDataCue || y.VTTCue, a = { custom: t.custom, dateTimeObject: t.dateTimeObject, dateTimeString: t.dateTimeString, bandwidth: e.playlist.attributes.BANDWIDTH, resolution: e.playlist.attributes.RESOLUTION, codecs: e.playlist.attributes.CODECS, byteLength: e.byteLength, uri: e.uri, timeline: e.timeline, playlist: e.playlist.id, start: i, end: n }, s = new r(i, n, JSON.stringify(a)); s.value = a, this.segmentMetadataTrack_.addCue(s) } } } }]), ah); function ah(e) { sl(this, ah); var t = cl(this, (ah.__proto__ || Object.getPrototypeOf(ah)).call(this)); if (!e) throw new TypeError("Initialization settings are required"); if ("function" != typeof e.currentTime) throw new TypeError("No currentTime getter specified"); if (!e.mediaSource) throw new TypeError("No MediaSource specified"); return t.bandwidth = e.bandwidth, t.throughput = { rate: 0, count: 0 }, t.roundTrip = NaN, t.resetStats_(), t.mediaIndex = null, t.hasPlayed_ = e.hasPlayed, t.currentTime_ = e.currentTime, t.seekable_ = e.seekable, t.seeking_ = e.seeking, t.duration_ = e.duration, t.mediaSource_ = e.mediaSource, t.hls_ = e.hls, t.loaderType_ = e.loaderType, t.startingMedia_ = void 0, t.segmentMetadataTrack_ = e.segmentMetadataTrack, t.goalBufferLength_ = e.goalBufferLength, t.sourceType_ = e.sourceType, t.inbandTextTracks_ = e.inbandTextTracks, t.state_ = "INIT", t.checkBufferTimeout_ = null, t.error_ = void 0, t.currentTimeline_ = -1, t.pendingSegment_ = null, t.mimeType_ = null, t.sourceUpdater_ = null, t.xhrOptions_ = null, t.activeInitSegmentId_ = null, t.initSegments_ = {}, t.cacheEncryptionKeys_ = e.cacheEncryptionKeys, t.keyCache_ = {}, "main" === t.loaderType_ ? t.captionParser_ = new yu : t.captionParser_ = null, t.decrypter_ = e.decrypter, t.syncController_ = e.syncController, t.syncPoint_ = { segmentIndex: 0, time: 0 }, t.triggerSyncInfoUpdate_ = function () { return t.trigger("syncinfoupdate") }, t.syncController_.on("syncinfoupdate", t.triggerSyncInfoUpdate_), t.mediaSource_.addEventListener("sourceopen", function () { return t.ended_ = !1 }), t.fetchAtBuffer_ = !1, t.logger_ = Hc("SegmentLoader[" + t.loaderType_ + "]"), Object.defineProperty(t, "state", { get: function () { return this.state_ }, set: function (e) { e !== this.state_ && (this.logger_(this.state_ + " -> " + e), this.state_ = e) } }), t } function sh(e) { return decodeURIComponent(escape(String.fromCharCode.apply(null, e))) } var oh = new Uint8Array("\n\n".split("").map(function (e) { return e.charCodeAt(0) })), uh = (ll(lh, rh), ol(lh, [{ key: "buffered_", value: function () { if (!this.subtitlesTrack_ || !this.subtitlesTrack_.cues.length) return sa.createTimeRanges(); var e = this.subtitlesTrack_.cues, t = e[0].startTime, i = e[e.length - 1].startTime; return sa.createTimeRanges([[t, i]]) } }, { key: "initSegment", value: function (e, t) { var i = 1 < arguments.length && void 0 !== t && t; if (!e) return null; var n = jl(e), r = this.initSegments_[n]; if (i && !r && e.bytes) { var a = oh.byteLength + e.bytes.byteLength, s = new Uint8Array(a); s.set(e.bytes), s.set(oh, e.bytes.byteLength), this.initSegments_[n] = r = { resolvedUri: e.resolvedUri, byterange: e.byterange, bytes: s } } return r || e } }, { key: "couldBeginLoading_", value: function () { return this.playlist_ && this.subtitlesTrack_ && !this.paused() } }, { key: "init_", value: function () { return this.state = "READY", this.resetEverything(), this.monitorBuffer_() } }, { key: "track", value: function (e) { return "undefined" == typeof e || (this.subtitlesTrack_ = e, "INIT" === this.state && this.couldBeginLoading_() && this.init_()), this.subtitlesTrack_ } }, { key: "remove", value: function (e, t) { Yl(e, t, this.subtitlesTrack_) } }, { key: "fillBuffer_", value: function () { var e = this; this.syncPoint_ || (this.syncPoint_ = this.syncController_.getSyncPoint(this.playlist_, this.duration_(), this.currentTimeline_, this.currentTime_())); var t = this.checkBuffer_(this.buffered_(), this.playlist_, this.mediaIndex, this.hasPlayed_(), this.currentTime_(), this.syncPoint_); if (t = this.skipEmptySegments_(t)) { if (null === this.syncController_.timestampOffsetForTimeline(t.timeline)) return this.syncController_.one("timestampoffset", function () { e.state = "READY", e.paused() || e.monitorBuffer_() }), void (this.state = "WAITING_ON_TIMELINE"); this.loadSegment_(t) } } }, { key: "skipEmptySegments_", value: function (e) { for (; e && e.segment.empty;)e = this.generateSegmentInfo_(e.playlist, e.mediaIndex + 1, e.startOfSegment + e.duration, e.isSyncRequest); return e } }, { key: "handleSegment_", value: function () { var t = this; if (this.pendingSegment_ && this.subtitlesTrack_) { this.state = "APPENDING"; var e = this.pendingSegment_, i = e.segment; if ("function" != typeof y.WebVTT && this.subtitlesTrack_ && this.subtitlesTrack_.tech_) { var n = void 0, r = function () { t.subtitlesTrack_.tech_.off("vttjsloaded", n), t.error({ message: "Error loading vtt.js" }), t.state = "READY", t.pause(), t.trigger("error") }; return n = function () { t.subtitlesTrack_.tech_.off("vttjserror", r), t.handleSegment_() }, this.state = "WAITING_ON_VTTJS", this.subtitlesTrack_.tech_.one("vttjsloaded", n), void this.subtitlesTrack_.tech_.one("vttjserror", r) } i.requested = !0; try { this.parseVTTCues_(e) } catch (e) { return this.error({ message: e.message }), this.state = "READY", this.pause(), this.trigger("error") } if (this.updateTimeMapping_(e, this.syncController_.timelines[e.timeline], this.playlist_), e.isSyncRequest) return this.trigger("syncinfoupdate"), this.pendingSegment_ = null, void (this.state = "READY"); e.byteLength = e.bytes.byteLength, this.mediaSecondsLoaded += i.duration, e.cues.length && this.remove(e.cues[0].endTime, e.cues[e.cues.length - 1].endTime), e.cues.forEach(function (e) { t.subtitlesTrack_.addCue(t.featuresNativeTextTracks_ ? new y.VTTCue(e.startTime, e.endTime, e.text) : e) }), this.handleUpdateEnd_() } else this.state = "READY" } }, { key: "parseVTTCues_", value: function (t) { var e = void 0, i = !1; "function" == typeof y.TextDecoder ? e = new y.TextDecoder("utf8") : (e = y.WebVTT.StringDecoder(), i = !0); var n = new y.WebVTT.Parser(y, y.vttjs, e); if (t.cues = [], t.timestampmap = { MPEGTS: 0, LOCAL: 0 }, n.oncue = t.cues.push.bind(t.cues), n.ontimestampmap = function (e) { return t.timestampmap = e }, n.onparsingerror = function (e) { sa.log.warn("Error encountered when parsing cues: " + e.message) }, t.segment.map) { var r = t.segment.map.bytes; i && (r = sh(r)), n.parse(r) } var a = t.bytes; i && (a = sh(a)), n.parse(a), n.flush() } }, { key: "updateTimeMapping_", value: function (e, t, i) { var n = e.segment; if (t) if (e.cues.length) { var r = e.timestampmap, a = r.MPEGTS / 9e4 - r.LOCAL + t.mapping; if (e.cues.forEach(function (e) { e.startTime += a, e.endTime += a }), !i.syncInfo) { var s = e.cues[0].startTime, o = e.cues[e.cues.length - 1].startTime; i.syncInfo = { mediaSequence: i.mediaSequence + e.mediaIndex, time: Math.min(s, o - n.duration) } } } else n.empty = !0 } }]), lh); function lh(e) { var t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {}; sl(this, lh); var i = cl(this, (lh.__proto__ || Object.getPrototypeOf(lh)).call(this, e, t)); return i.mediaSource_ = null, i.subtitlesTrack_ = null, i.featuresNativeTextTracks_ = e.featuresNativeTextTracks, i } function ch(e, t) { for (var i = e.cues, n = 0; n < i.length; n++) { var r = i[n]; if (t >= r.adStartTime && t <= r.adEndTime) return r } return null } var hh = Vu, dh = [{ name: "VOD", run: function (e, t, i, n, r) { if (i === 1 / 0) return null; return { time: 0, segmentIndex: 0 } } }, { name: "ProgramDateTime", run: function (e, t, i, n, r) { if (!e.datetimeToDisplayTime) return null; var a = t.segments || [], s = null, o = null; r = r || 0; for (var u = 0; u < a.length; u++) { var l = a[u]; if (l.dateTimeObject) { var c = l.dateTimeObject.getTime() / 1e3 + e.datetimeToDisplayTime, h = Math.abs(r - c); if (null !== o && (0 === h || o < h)) break; o = h, s = { time: c, segmentIndex: u } } } return s } }, { name: "Segment", run: function (e, t, i, n, r) { var a = t.segments || [], s = null, o = null; r = r || 0; for (var u = 0; u < a.length; u++) { var l = a[u]; if (l.timeline === n && "undefined" != typeof l.start) { var c = Math.abs(r - l.start); if (null !== o && o < c) break; (!s || null === o || c <= o) && (o = c, s = { time: l.start, segmentIndex: u }) } } return s } }, { name: "Discontinuity", run: function (e, t, i, n, r) { var a = null; if (r = r || 0, t.discontinuityStarts && t.discontinuityStarts.length) for (var s = null, o = 0; o < t.discontinuityStarts.length; o++) { var u = t.discontinuityStarts[o], l = t.discontinuitySequence + o + 1, c = e.discontinuities[l]; if (c) { var h = Math.abs(r - c.time); if (null !== s && s < h) break; (!a || null === s || h <= s) && (s = h, a = { time: c.time, segmentIndex: u }) } } return a } }, { name: "Playlist", run: function (e, t, i, n, r) { return t.syncInfo ? { time: t.syncInfo.time, segmentIndex: t.syncInfo.mediaSequence - t.mediaSequence } : null } }], ph = (ll(fh, sa.EventTarget), ol(fh, [{ key: "getSyncPoint", value: function (e, t, i, n) { var r = this.runStrategies_(e, t, i, n); return r.length ? this.selectSyncPoint_(r, { key: "time", value: n }) : null } }, { key: "getExpiredTime", value: function (e, t) { if (!e || !e.segments) return null; var i = this.runStrategies_(e, t, e.discontinuitySequence, 0); if (!i.length) return null; var n = this.selectSyncPoint_(i, { key: "segmentIndex", value: 0 }); return 0 < n.segmentIndex && (n.time *= -1), Math.abs(n.time + Cl(e, n.segmentIndex, 0)) } }, { key: "runStrategies_", value: function (e, t, i, n) { for (var r = [], a = 0; a < dh.length; a++) { var s = dh[a], o = s.run(this, e, t, i, n); o && (o.strategy = s.name, r.push({ strategy: s.name, syncPoint: o })) } return r } }, { key: "selectSyncPoint_", value: function (e, t) { for (var i = e[0].syncPoint, n = Math.abs(e[0].syncPoint[t.key] - t.value), r = e[0].strategy, a = 1; a < e.length; a++) { var s = Math.abs(e[a].syncPoint[t.key] - t.value); s < n && (n = s, i = e[a].syncPoint, r = e[a].strategy) } return this.logger_("syncPoint for [" + t.key + ": " + t.value + "] chosen with strategy [" + r + "]: [time:" + i.time + ", segmentIndex:" + i.segmentIndex + "]"), i } }, { key: "saveExpiredSegmentInfo", value: function (e, t) { for (var i = t.mediaSequence - e.mediaSequence - 1; 0 <= i; i--) { var n = e.segments[i]; if (n && "undefined" != typeof n.start) { t.syncInfo = { mediaSequence: e.mediaSequence + i, time: n.start }, this.logger_("playlist refresh sync: [time:" + t.syncInfo.time + ", mediaSequence: " + t.syncInfo.mediaSequence + "]"), this.trigger("syncinfoupdate"); break } } } }, { key: "setDateTimeMapping", value: function (e) { if (!this.datetimeToDisplayTime && e.segments && e.segments.length && e.segments[0].dateTimeObject) { var t = e.segments[0].dateTimeObject.getTime() / 1e3; this.datetimeToDisplayTime = -t } } }, { key: "reset", value: function () { this.inspectCache_ = void 0 } }, { key: "probeSegmentInfo", value: function (e) { var t = e.segment, i = e.playlist, n = void 0; return (n = t.map ? this.probeMp4Segment_(e) : this.probeTsSegment_(e)) && this.calculateSegmentTimeMapping_(e, n) && (this.saveDiscontinuitySyncInfo_(e), i.syncInfo || (i.syncInfo = { mediaSequence: i.mediaSequence + e.mediaIndex, time: t.start })), n } }, { key: "probeMp4Segment_", value: function (e) { var t = e.segment, i = eu.timescale(t.map.bytes), n = eu.compositionStartTime(i, e.bytes); return null !== e.timestampOffset && (e.timestampOffset -= n), { start: n, end: n + t.duration } } }, { key: "probeTsSegment_", value: function (e) { var t = hh(e.bytes, this.inspectCache_), i = void 0, n = void 0, r = void 0; return t ? (t.video && 2 === t.video.length ? (this.inspectCache_ = t.video[1].dts, i = t.video[0].dtsTime, n = t.video[1].dtsTime, r = t.video) : t.audio && 2 === t.audio.length && (this.inspectCache_ = t.audio[1].dts, i = t.audio[0].dtsTime, n = t.audio[1].dtsTime, r = t.audio), { segmentTimestampInfo: r, start: i, end: n, containsVideo: t.video && 2 === t.video.length, containsAudio: t.audio && 2 === t.audio.length }) : null } }, { key: "timestampOffsetForTimeline", value: function (e) { return "undefined" == typeof this.timelines[e] ? null : this.timelines[e].time } }, { key: "mappingForTimeline", value: function (e) { return "undefined" == typeof this.timelines[e] ? null : this.timelines[e].mapping } }, { key: "calculateSegmentTimeMapping_", value: function (e, t) { var i = e.segment, n = this.timelines[e.timeline]; if (null !== e.timestampOffset) n = { time: e.startOfSegment, mapping: e.startOfSegment - t.start }, this.timelines[e.timeline] = n, this.trigger("timestampoffset"), this.logger_("time mapping for timeline " + e.timeline + ": [time: " + n.time + "] [mapping: " + n.mapping + "]"), i.start = e.startOfSegment, i.end = t.end + n.mapping; else { if (!n) return !1; i.start = t.start + n.mapping, i.end = t.end + n.mapping } return !0 } }, { key: "saveDiscontinuitySyncInfo_", value: function (e) { var t = e.playlist, i = e.segment; if (i.discontinuity) this.discontinuities[i.timeline] = { time: i.start, accuracy: 0 }; else if (t.discontinuityStarts && t.discontinuityStarts.length) for (var n = 0; n < t.discontinuityStarts.length; n++) { var r = t.discontinuityStarts[n], a = t.discontinuitySequence + n + 1, s = r - e.mediaIndex, o = Math.abs(s); if (!this.discontinuities[a] || this.discontinuities[a].accuracy > o) { var u = void 0; u = s < 0 ? i.start - Cl(t, e.mediaIndex, r) : i.end + Cl(t, e.mediaIndex + 1, r), this.discontinuities[a] = { time: u, accuracy: o } } } } }, { key: "dispose", value: function () { this.trigger("dispose"), this.off() } }]), fh); function fh() { sl(this, fh); var e = cl(this, (fh.__proto__ || Object.getPrototypeOf(fh)).call(this)); return e.inspectCache_ = void 0, e.timelines = [], e.discontinuities = [], e.datetimeToDisplayTime = null, e.logger_ = Hc("SyncController"), e } function mh(e, t) { e.abort(), e.pause(), t && t.activePlaylistLoader && (t.activePlaylistLoader.pause(), t.activePlaylistLoader = null) } function gh(e, t) { (t.activePlaylistLoader = e).load() } function vh(t) { ["AUDIO", "SUBTITLES", "CLOSED-CAPTIONS"].forEach(function (e) { Th[e](e, t) }); var i = t.mediaTypes, e = t.masterPlaylistLoader, n = t.tech, r = t.hls;["AUDIO", "SUBTITLES"].forEach(function (e) { i[e].activeGroup = function (a, s) { return function (t) { var e = s.masterPlaylistLoader, i = s.mediaTypes[a].groups, n = e.media(); if (!n) return null; var r = null; return n.attributes[a] && (r = i[n.attributes[a]]), r = r || i.main, "undefined" == typeof t ? r : null === t ? null : r.filter(function (e) { return e.id === t.id })[0] || null } }(e, t), i[e].activeTrack = Sh[e](e, t), i[e].onGroupChanged = function (o, u) { return function () { var e = u.segmentLoaders, t = e[o], i = e.main, n = u.mediaTypes[o], r = n.activeTrack(), a = n.activeGroup(r), s = n.activePlaylistLoader; mh(t, n), a && (a.playlistLoader ? (t.resyncLoader(), gh(a.playlistLoader, n)) : s && i.resetEverything()) } }(e, t), i[e].onTrackChanged = function (o, u) { return function () { var e = u.segmentLoaders, t = e[o], i = e.main, n = u.mediaTypes[o], r = n.activeTrack(), a = n.activeGroup(r), s = n.activePlaylistLoader; mh(t, n), a && (a.playlistLoader ? (s !== a.playlistLoader && (t.track && t.track(r), t.resetEverything()), gh(a.playlistLoader, n)) : i.resetEverything()) } }(e, t) }); var a = i.AUDIO.activeGroup(), s = (a.filter(function (e) { return e.default })[0] || a[0]).id; function o() { i.AUDIO.onTrackChanged(), n.trigger({ type: "usage", name: "hls-audio-change" }) } for (var u in i.AUDIO.tracks[s].enabled = !0, i.AUDIO.onTrackChanged(), e.on("mediachange", function () { ["AUDIO", "SUBTITLES"].forEach(function (e) { return i[e].onGroupChanged() }) }), n.audioTracks().addEventListener("change", o), n.remoteTextTracks().addEventListener("change", i.SUBTITLES.onTrackChanged), r.on("dispose", function () { n.audioTracks().removeEventListener("change", o), n.remoteTextTracks().removeEventListener("change", i.SUBTITLES.onTrackChanged) }), n.clearTracks("audio"), i.AUDIO.tracks) n.audioTracks().addTrack(i.AUDIO.tracks[u]) } var yh = new hc("./decrypter-worker.worker.js", function (e, t) { var i, c, g, n, r, u, s, a = this; i = function (e, t, i) { return t && o(e.prototype, t), i && o(e, i), e }, c = null, d.prototype.decrypt = function (e, t, i, n, r, a) { var s = this._key[1], o = e ^ s[0], u = n ^ s[1], l = i ^ s[2], c = t ^ s[3], h = void 0, d = void 0, p = void 0, f = s.length / 4 - 2, m = void 0, g = 4, v = this._tables[1], y = v[0], _ = v[1], b = v[2], T = v[3], S = v[4]; for (m = 0; m < f; m++)h = y[o >>> 24] ^ _[u >> 16 & 255] ^ b[l >> 8 & 255] ^ T[255 & c] ^ s[g], d = y[u >>> 24] ^ _[l >> 16 & 255] ^ b[c >> 8 & 255] ^ T[255 & o] ^ s[g + 1], p = y[l >>> 24] ^ _[c >> 16 & 255] ^ b[o >> 8 & 255] ^ T[255 & u] ^ s[g + 2], c = y[c >>> 24] ^ _[o >> 16 & 255] ^ b[u >> 8 & 255] ^ T[255 & l] ^ s[g + 3], g += 4, o = h, u = d, l = p; for (m = 0; m < 4; m++)r[(3 & -m) + a] = S[o >>> 24] << 24 ^ S[u >> 16 & 255] << 16 ^ S[l >> 8 & 255] << 8 ^ S[255 & c] ^ s[g++], h = o, o = u, u = l, l = c, c = h }, g = d, l.prototype.on = function (e, t) { this.listeners[e] || (this.listeners[e] = []), this.listeners[e].push(t) }, l.prototype.off = function (e, t) { if (!this.listeners[e]) return !1; var i = this.listeners[e].indexOf(t); return this.listeners[e].splice(i, 1), -1 < i }, l.prototype.trigger = function (e, t) { var i = this.listeners[e]; if (i) if (2 === arguments.length) for (var n = i.length, r = 0; r < n; ++r)i[r].call(this, t); else for (var a = Array.prototype.slice.call(arguments, 1), s = i.length, o = 0; o < s; ++o)i[o].apply(this, a) }, l.prototype.dispose = function () { this.listeners = {} }, l.prototype.pipe = function (t) { this.on("data", function (e) { t.push(e) }) }, function (e, t) { if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t); e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t) }(p, r = n = l), p.prototype.processJob_ = function () { this.jobs.shift()(), this.jobs.length ? this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay) : this.timeout_ = null }, p.prototype.push = function (e) { this.jobs.push(e), this.timeout_ || (this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay)) }, u = p, f.prototype.decryptChunk_ = function (t, i, n, r) { return function () { var e = function (e, t, i) { var n = new Int32Array(e.buffer, e.byteOffset, e.byteLength >> 2), r = new g(Array.prototype.slice.call(t)), a = new Uint8Array(e.byteLength), s = new Int32Array(a.buffer), o = void 0, u = void 0, l = void 0, c = void 0, h = void 0, d = void 0, p = void 0, f = void 0, m = void 0; for (o = i[0], u = i[1], l = i[2], c = i[3], m = 0; m < n.length; m += 4)h = v(n[m]), d = v(n[m + 1]), p = v(n[m + 2]), f = v(n[m + 3]), r.decrypt(h, d, p, f, s, m), s[m] = v(s[m] ^ o), s[m + 1] = v(s[m + 1] ^ u), s[m + 2] = v(s[m + 2] ^ l), s[m + 3] = v(s[m + 3] ^ c), o = h, u = d, l = p, c = f; return a }(t, i, n); r.set(e, t.byteOffset) } }, i(f, null, [{ key: "STEP", get: function () { return 32e3 } }]), s = f, new function (a) { a.onmessage = function (e) { var i = e.data, t = new Uint8Array(i.encrypted.bytes, i.encrypted.byteOffset, i.encrypted.byteLength), n = new Uint32Array(i.key.bytes, i.key.byteOffset, i.key.byteLength / 4), r = new Uint32Array(i.iv.bytes, i.iv.byteOffset, i.iv.byteLength / 4); new s(t, n, r, function (e, t) { a.postMessage(function (i) { var n = {}; return Object.keys(i).forEach(function (e) { var t = i[e]; ArrayBuffer.isView(t) ? n[e] = { bytes: t.buffer, byteOffset: t.byteOffset, byteLength: t.byteLength } : n[e] = t }), n }({ source: i.source, decrypted: t }), [t.buffer]) }) } }(a); function h(e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") } function o(e, t) { for (var i = 0; i < t.length; i++) { var n = t[i]; n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n) } } function d(e) { h(this, d), c = c || function () { var e = [[[], [], [], [], []], [[], [], [], [], []]], t = e[0], i = e[1], n = t[4], r = i[4], a = void 0, s = void 0, o = void 0, u = [], l = [], c = void 0, h = void 0, d = void 0, p = void 0, f = void 0; for (a = 0; a < 256; a++)l[(u[a] = a << 1 ^ 283 * (a >> 7)) ^ a] = a; for (s = o = 0; !n[s]; s ^= c || 1, o = l[o] || 1)for (d = (d = o ^ o << 1 ^ o << 2 ^ o << 3 ^ o << 4) >> 8 ^ 255 & d ^ 99, f = 16843009 * u[h = u[c = u[r[n[s] = d] = s]]] ^ 65537 * h ^ 257 * c ^ 16843008 * s, p = 257 * u[d] ^ 16843008 * d, a = 0; a < 4; a++)t[a][s] = p = p << 24 ^ p >>> 8, i[a][d] = f = f << 24 ^ f >>> 8; for (a = 0; a < 5; a++)t[a] = t[a].slice(0), i[a] = i[a].slice(0); return e }(), this._tables = [[c[0][0].slice(), c[0][1].slice(), c[0][2].slice(), c[0][3].slice(), c[0][4].slice()], [c[1][0].slice(), c[1][1].slice(), c[1][2].slice(), c[1][3].slice(), c[1][4].slice()]]; var t = void 0, i = void 0, n = void 0, r = void 0, a = void 0, s = this._tables[0][4], o = this._tables[1], u = e.length, l = 1; if (4 !== u && 6 !== u && 8 !== u) throw new Error("Invalid aes key size"); for (r = e.slice(0), a = [], this._key = [r, a], t = u; t < 4 * u + 28; t++)n = r[t - 1], (t % u == 0 || 8 === u && t % u == 4) && (n = s[n >>> 24] << 24 ^ s[n >> 16 & 255] << 16 ^ s[n >> 8 & 255] << 8 ^ s[255 & n], t % u == 0 && (n = n << 8 ^ n >>> 24 ^ l << 24, l = l << 1 ^ 283 * (l >> 7))), r[t] = r[t - u] ^ n; for (i = 0; t; i++, t--)n = r[3 & i ? t : t - 4], a[i] = t <= 4 || i < 4 ? n : o[0][s[n >>> 24]] ^ o[1][s[n >> 16 & 255]] ^ o[2][s[n >> 8 & 255]] ^ o[3][s[255 & n]] } function l() { h(this, l), this.listeners = {} } function p() { h(this, p); var e = function (e, t) { if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return !t || "object" != typeof t && "function" != typeof t ? e : t }(this, r.call(this, n)); return e.jobs = [], e.delay = 1, e.timeout_ = null, e } function v(e) { return e << 24 | (65280 & e) << 8 | (16711680 & e) >> 8 | e >>> 24 } function f(e, t, i, n) { h(this, f); var r = f.STEP, a = new Int32Array(e.buffer), s = new Uint8Array(e.byteLength), o = 0; for (this.asyncStream_ = new u, this.asyncStream_.push(this.decryptChunk_(a.subarray(o, o + r), t, i, s)), o = r; o < a.length; o += r)i = new Uint32Array([v(a[o - 4]), v(a[o - 3]), v(a[o - 2]), v(a[o - 1])]), this.asyncStream_.push(this.decryptChunk_(a.subarray(o, o + r), t, i, s)); this.asyncStream_.push(function () { n(null, function (e) { return e.subarray(0, e.byteLength - e[e.byteLength - 1]) }(s)) }) } }), _h = { AUDIO: function (u, l) { return function () { var e = l.segmentLoaders[u], t = l.mediaTypes[u], i = l.blacklistCurrentPlaylist; mh(e, t); var n = t.activeTrack(), r = t.activeGroup(), a = (r.filter(function (e) { return e.default })[0] || r[0]).id, s = t.tracks[a]; if (n !== s) { for (var o in sa.log.warn("Problem encountered loading the alternate audio track.Switching back to default."), t.tracks) t.tracks[o].enabled = t.tracks[o] === s; t.onTrackChanged() } else i({ message: "Problem encountered loading the default audio track." }) } }, SUBTITLES: function (n, r) { return function () { var e = r.segmentLoaders[n], t = r.mediaTypes[n]; sa.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."), mh(e, t); var i = t.activeTrack(); i && (i.mode = "disabled"), t.onTrackChanged() } } }, bh = { AUDIO: function (e, t, i) { if (t) { var n = i.tech, r = i.requestOptions, a = i.segmentLoaders[e]; t.on("loadedmetadata", function () { var e = t.media(); a.playlist(e, r), (!n.paused() || e.endList && "none" !== n.preload()) && a.load() }), t.on("loadedplaylist", function () { a.playlist(t.media(), r), n.paused() || a.load() }), t.on("error", _h[e](e, i)) } }, SUBTITLES: function (e, t, i) { var n = i.tech, r = i.requestOptions, a = i.segmentLoaders[e], s = i.mediaTypes[e]; t.on("loadedmetadata", function () { var e = t.media(); a.playlist(e, r), a.track(s.activeTrack()), (!n.paused() || e.endList && "none" !== n.preload()) && a.load() }), t.on("loadedplaylist", function () { a.playlist(t.media(), r), n.paused() || a.load() }), t.on("error", _h[e](e, i)) } }, Th = { AUDIO: function (e, t) { var i, n, r = t.hls, a = t.sourceType, s = t.segmentLoaders[e], o = t.requestOptions, u = t.master.mediaGroups, l = t.mediaTypes[e], c = l.groups, h = l.tracks, d = t.masterPlaylistLoader; for (var p in u[e] && 0 !== Object.keys(u[e]).length || (u[e] = { main: { default: { default: !0 } } }), u[e]) for (var f in c[p] || (c[p] = []), u[e][p]) { var m = u[e][p][f], g = void 0; if (g = m.resolvedUri ? new bl(m.resolvedUri, r, o) : m.playlists && "dash" === a ? new jc(m.playlists[0], r, o, d) : null, m = sa.mergeOptions({ id: f, playlistLoader: g }, m), bh[e](e, m.playlistLoader, t), c[p].push(m), "undefined" == typeof h[f]) { var v = new sa.AudioTrack({ id: f, kind: (i = m, n = void 0, n = i.default ? "main" : "alternative", i.characteristics && 0 <= i.characteristics.indexOf("public.accessibility.describes-video") && (n = "main-desc"), n), enabled: !1, language: m.language, default: m.default, label: f }); h[f] = v } } s.on("error", _h[e](e, t)) }, SUBTITLES: function (e, t) { var i = t.tech, n = t.hls, r = t.sourceType, a = t.segmentLoaders[e], s = t.requestOptions, o = t.master.mediaGroups, u = t.mediaTypes[e], l = u.groups, c = u.tracks, h = t.masterPlaylistLoader; for (var d in o[e]) for (var p in l[d] || (l[d] = []), o[e][d]) if (!o[e][d][p].forced) { var f = o[e][d][p], m = void 0; if ("hls" === r ? m = new bl(f.resolvedUri, n, s) : "dash" === r && (m = new jc(f.playlists[0], n, s, h)), f = sa.mergeOptions({ id: p, playlistLoader: m }, f), bh[e](e, f.playlistLoader, t), l[d].push(f), "undefined" == typeof c[p]) { var g = i.addRemoteTextTrack({ id: p, kind: "subtitles", default: f.default && f.autoselect, language: f.language, label: p }, !1).track; c[p] = g } } a.on("error", _h[e](e, t)) }, "CLOSED-CAPTIONS": function (e, t) { var i = t.tech, n = t.master.mediaGroups, r = t.mediaTypes[e], a = r.groups, s = r.tracks; for (var o in n[e]) for (var u in a[o] || (a[o] = []), n[e][o]) { var l = n[e][o][u]; if (l.instreamId.match(/CC\d/) && (a[o].push(sa.mergeOptions({ id: u }, l)), "undefined" == typeof s[u])) { var c = i.addRemoteTextTrack({ id: l.instreamId, kind: "captions", default: l.default && l.autoselect, language: l.language, label: u }, !1).track; s[u] = c } } } }, Sh = { AUDIO: function (i, n) { return function () { var e = n.mediaTypes[i].tracks; for (var t in e) if (e[t].enabled) return e[t]; return null } }, SUBTITLES: function (i, n) { return function () { var e = n.mediaTypes[i].tracks; for (var t in e) if ("showing" === e[t].mode || "hidden" === e[t].mode) return e[t]; return null } } }, kh = void 0, Ch = ["mediaRequests", "mediaRequestsAborted", "mediaRequestsTimedout", "mediaRequestsErrored", "mediaTransferDuration", "mediaBytesTransferred"], Eh = (ll(wh, sa.EventTarget), ol(wh, [{ key: "setupMasterPlaylistLoaderListeners_", value: function () { var n = this; this.masterPlaylistLoader_.on("loadedmetadata", function () { var e = n.masterPlaylistLoader_.media(), t = 1.5 * e.targetDuration * 1e3; Dl(n.masterPlaylistLoader_.master, n.masterPlaylistLoader_.media()) ? n.requestOptions_.timeout = 0 : n.requestOptions_.timeout = t, e.endList && "none" !== n.tech_.preload() && (n.mainSegmentLoader_.playlist(e, n.requestOptions_), n.mainSegmentLoader_.load()), vh({ sourceType: n.sourceType_, segmentLoaders: { AUDIO: n.audioSegmentLoader_, SUBTITLES: n.subtitleSegmentLoader_, main: n.mainSegmentLoader_ }, tech: n.tech_, requestOptions: n.requestOptions_, masterPlaylistLoader: n.masterPlaylistLoader_, hls: n.hls_, master: n.master(), mediaTypes: n.mediaTypes_, blacklistCurrentPlaylist: n.blacklistCurrentPlaylist.bind(n) }), n.triggerPresenceUsage_(n.master(), e); try { n.setupSourceBuffers_() } catch (e) { return sa.log.warn("Failed to create SourceBuffers", e), n.mediaSource.endOfStream("decode") } n.setupFirstPlay(), !n.mediaTypes_.AUDIO.activePlaylistLoader || n.mediaTypes_.AUDIO.activePlaylistLoader.media() ? n.trigger("selectedinitialmedia") : n.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata", function () { n.trigger("selectedinitialmedia") }) }), this.masterPlaylistLoader_.on("loadedplaylist", function () { var e = n.masterPlaylistLoader_.media(); if (!e) { n.excludeUnsupportedVariants_(); var t = void 0; return n.enableLowInitialPlaylist && (t = n.selectInitialPlaylist()), t = t || n.selectPlaylist(), n.initialMedia_ = t, void n.masterPlaylistLoader_.media(n.initialMedia_) } if (n.useCueTags_ && n.updateAdCues_(e), n.mainSegmentLoader_.playlist(e, n.requestOptions_), n.updateDuration(), n.tech_.paused() || (n.mainSegmentLoader_.load(), n.audioSegmentLoader_ && n.audioSegmentLoader_.load()), !e.endList) { var i = function () { var e = n.seekable(); 0 !== e.length && n.mediaSource.addSeekableRange_(e.start(0), e.end(0)) }; n.duration() !== 1 / 0 ? n.tech_.one("durationchange", function e() { n.duration() === 1 / 0 ? i() : n.tech_.one("durationchange", e) }) : i() } }), this.masterPlaylistLoader_.on("error", function () { n.blacklistCurrentPlaylist(n.masterPlaylistLoader_.error) }), this.masterPlaylistLoader_.on("mediachanging", function () { n.mainSegmentLoader_.abort(), n.mainSegmentLoader_.pause() }), this.masterPlaylistLoader_.on("mediachange", function () { var e = n.masterPlaylistLoader_.media(), t = 1.5 * e.targetDuration * 1e3; Dl(n.masterPlaylistLoader_.master, n.masterPlaylistLoader_.media()) ? n.requestOptions_.timeout = 0 : n.requestOptions_.timeout = t, n.mainSegmentLoader_.playlist(e, n.requestOptions_), n.mainSegmentLoader_.load(), n.tech_.trigger({ type: "mediachange", bubbles: !0 }) }), this.masterPlaylistLoader_.on("playlistunchanged", function () { var e = n.masterPlaylistLoader_.media(); n.stuckAtPlaylistEnd_(e) && (n.blacklistCurrentPlaylist({ message: "Playlist no longer updating." }), n.tech_.trigger("playliststuck")) }), this.masterPlaylistLoader_.on("renditiondisabled", function () { n.tech_.trigger({ type: "usage", name: "hls-rendition-disabled" }) }), this.masterPlaylistLoader_.on("renditionenabled", function () { n.tech_.trigger({ type: "usage", name: "hls-rendition-enabled" }) }) } }, { key: "triggerPresenceUsage_", value: function (e, t) { var i = e.mediaGroups || {}, n = !0, r = Object.keys(i.AUDIO); for (var a in i.AUDIO) for (var s in i.AUDIO[a]) i.AUDIO[a][s].uri || (n = !1); n && this.tech_.trigger({ type: "usage", name: "hls-demuxed" }), Object.keys(i.SUBTITLES).length && this.tech_.trigger({ type: "usage", name: "hls-webvtt" }), kh.Playlist.isAes(t) && this.tech_.trigger({ type: "usage", name: "hls-aes" }), kh.Playlist.isFmp4(t) && this.tech_.trigger({ type: "usage", name: "hls-fmp4" }), r.length && 1 < Object.keys(i.AUDIO[r[0]]).length && this.tech_.trigger({ type: "usage", name: "hls-alternate-audio" }), this.useCueTags_ && this.tech_.trigger({ type: "usage", name: "hls-playlist-cue-tags" }) } }, { key: "setupSegmentLoaderListeners_", value: function () { var a = this; this.mainSegmentLoader_.on("bandwidthupdate", function () { var e = a.selectPlaylist(), t = a.masterPlaylistLoader_.media(), i = a.tech_.buffered(), n = i.length ? i.end(i.length - 1) - a.tech_.currentTime() : 0, r = a.bufferLowWaterLine(); (!t.endList || a.duration() < eh.MAX_BUFFER_LOW_WATER_LINE || e.attributes.BANDWIDTH < t.attributes.BANDWIDTH || r <= n) && a.masterPlaylistLoader_.media(e), a.tech_.trigger("bandwidthupdate") }), this.mainSegmentLoader_.on("progress", function () { a.trigger("progress") }), this.mainSegmentLoader_.on("error", function () { a.blacklistCurrentPlaylist(a.mainSegmentLoader_.error()) }), this.mainSegmentLoader_.on("syncinfoupdate", function () { a.onSyncInfoUpdate_() }), this.mainSegmentLoader_.on("timestampoffset", function () { a.tech_.trigger({ type: "usage", name: "hls-timestamp-offset" }) }), this.audioSegmentLoader_.on("syncinfoupdate", function () { a.onSyncInfoUpdate_() }), this.mainSegmentLoader_.on("ended", function () { a.onEndOfStream() }), this.mainSegmentLoader_.on("earlyabort", function () { a.blacklistCurrentPlaylist({ message: "Aborted early because there isn't enough bandwidth to complete the request without rebuffering." }, 120) }), this.mainSegmentLoader_.on("reseteverything", function () { a.tech_.trigger("hls-reset") }), this.mainSegmentLoader_.on("segmenttimemapping", function (e) { a.tech_.trigger({ type: "hls-segment-time-mapping", mapping: e.mapping }) }), this.audioSegmentLoader_.on("ended", function () { a.onEndOfStream() }) } }, { key: "mediaSecondsLoaded_", value: function () { return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded + this.mainSegmentLoader_.mediaSecondsLoaded) } }, { key: "load", value: function () { this.mainSegmentLoader_.load(), this.mediaTypes_.AUDIO.activePlaylistLoader && this.audioSegmentLoader_.load(), this.mediaTypes_.SUBTITLES.activePlaylistLoader && this.subtitleSegmentLoader_.load() } }, { key: "smoothQualityChange_", value: function () { var e = this.selectPlaylist(); e !== this.masterPlaylistLoader_.media() && (this.masterPlaylistLoader_.media(e), this.mainSegmentLoader_.resetLoader()) } }, { key: "fastQualityChange_", value: function () { var e = this, t = this.selectPlaylist(); t !== this.masterPlaylistLoader_.media() && (this.masterPlaylistLoader_.media(t), this.mainSegmentLoader_.resetEverything(function () { sa.browser.IE_VERSION || sa.browser.IS_EDGE ? e.tech_.setCurrentTime(e.tech_.currentTime() + .04) : e.tech_.setCurrentTime(e.tech_.currentTime()) })) } }, { key: "play", value: function () { if (!this.setupFirstPlay()) { this.tech_.ended() && this.seekTo_(0), this.hasPlayed_ && this.load(); var e = this.tech_.seekable(); return this.tech_.duration() === 1 / 0 && this.tech_.currentTime() < e.start(0) ? this.seekTo_(e.end(e.length - 1)) : void 0 } } }, { key: "setupFirstPlay", value: function () { var e = this, t = this.masterPlaylistLoader_.media(); if (!t || this.tech_.paused() || this.hasPlayed_) return !1; if (!t.endList) { var i = this.seekable(); if (!i.length) return !1; if (sa.browser.IE_VERSION && 0 === this.tech_.readyState()) return this.tech_.one("loadedmetadata", function () { e.trigger("firstplay"), e.seekTo_(i.end(0)), e.hasPlayed_ = !0 }), !1; this.trigger("firstplay"), this.seekTo_(i.end(0)) } return this.hasPlayed_ = !0, this.load(), !0 } }, { key: "handleSourceOpen_", value: function () { try { this.setupSourceBuffers_() } catch (e) { return sa.log.warn("Failed to create Source Buffers", e), this.mediaSource.endOfStream("decode") } if (this.tech_.autoplay()) { var e = this.tech_.play(); "undefined" != typeof e && "function" == typeof e.then && e.then(null, function (e) { }) } this.trigger("sourceopen") } }, { key: "onEndOfStream", value: function () { var e = this.mainSegmentLoader_.ended_; if (this.mediaTypes_.AUDIO.activePlaylistLoader && (e = !this.mainSegmentLoader_.startingMedia_ || this.mainSegmentLoader_.startingMedia_.containsVideo ? e && this.audioSegmentLoader_.ended_ : this.audioSegmentLoader_.ended_), e) { this.logger_("calling mediaSource.endOfStream()"); try { this.mediaSource.endOfStream() } catch (e) { sa.log.warn("Failed to call media source endOfStream", e) } } } }, { key: "stuckAtPlaylistEnd_", value: function (e) { if (!this.seekable().length) return !1; var t = this.syncController_.getExpiredTime(e, this.mediaSource.duration); if (null === t) return !1; var i = kh.Playlist.playlistEnd(e, t), n = this.tech_.currentTime(), r = this.tech_.buffered(); if (!r.length) return i - n <= .1; var a = r.end(r.length - 1); return a - n <= .1 && i - a <= .1 } }, { key: "blacklistCurrentPlaylist", value: function (e, t) { var i, n = 0 < arguments.length && void 0 !== e ? e : {}, r = t, a = void 0; if (a = n.playlist || this.masterPlaylistLoader_.media(), r = r || n.blacklistDuration || this.blacklistDuration, !a) { this.error = n; try { return this.mediaSource.endOfStream("network") } catch (e) { return this.trigger("error") } } var s = 1 === this.masterPlaylistLoader_.master.playlists.filter(Ll).length, o = this.masterPlaylistLoader_.master.playlists; return 1 === o.length ? (sa.log.warn("Problem encountered with the current HLS playlist. Trying again since it is the only playlist."), this.tech_.trigger("retryplaylist"), this.masterPlaylistLoader_.load(s)) : (s && (sa.log.warn("Removing all playlists from the blacklist because the last rendition is about to be blacklisted."), o.forEach(function (e) { e.excludeUntil !== 1 / 0 && delete e.excludeUntil }), this.tech_.trigger("retryplaylist")), a.excludeUntil = Date.now() + 1e3 * r, this.tech_.trigger("blacklistplaylist"), this.tech_.trigger({ type: "usage", name: "hls-rendition-blacklisted" }), i = this.selectPlaylist(), sa.log.warn("Problem encountered with the current HLS playlist." + (n.message ? " " + n.message : "") + " Switching to another playlist."), this.masterPlaylistLoader_.media(i, s)) } }, { key: "pauseLoading", value: function () { this.mainSegmentLoader_.pause(), this.mediaTypes_.AUDIO.activePlaylistLoader && this.audioSegmentLoader_.pause(), this.mediaTypes_.SUBTITLES.activePlaylistLoader && this.subtitleSegmentLoader_.pause() } }, { key: "setCurrentTime", value: function (e) { var t = zl(this.tech_.buffered(), e); return this.masterPlaylistLoader_ && this.masterPlaylistLoader_.media() && this.masterPlaylistLoader_.media().segments ? t && t.length ? e : (this.mainSegmentLoader_.resetEverything(), this.mainSegmentLoader_.abort(), this.mediaTypes_.AUDIO.activePlaylistLoader && (this.audioSegmentLoader_.resetEverything(), this.audioSegmentLoader_.abort()), this.mediaTypes_.SUBTITLES.activePlaylistLoader && (this.subtitleSegmentLoader_.resetEverything(), this.subtitleSegmentLoader_.abort()), void this.load()) : 0 } }, { key: "duration", value: function () { return this.masterPlaylistLoader_ ? this.mediaSource ? this.mediaSource.duration : kh.Playlist.duration(this.masterPlaylistLoader_.media()) : 0 } }, { key: "seekable", value: function () { return this.seekable_ } }, { key: "onSyncInfoUpdate_", value: function () { var e = void 0; if (this.masterPlaylistLoader_) { var t = this.masterPlaylistLoader_.media(); if (t) { var i = this.syncController_.getExpiredTime(t, this.mediaSource.duration); if (null !== i) { var n = this.masterPlaylistLoader_.master.suggestedPresentationDelay, r = kh.Playlist.seekable(t, i, n); if (0 !== r.length) { if (this.mediaTypes_.AUDIO.activePlaylistLoader) { if (t = this.mediaTypes_.AUDIO.activePlaylistLoader.media(), null === (i = this.syncController_.getExpiredTime(t, this.mediaSource.duration))) return; if (0 === (e = kh.Playlist.seekable(t, i, n)).length) return } var a = void 0, s = void 0; this.seekable_ && this.seekable_.length && (a = this.seekable_.end(0), s = this.seekable_.start(0)), e ? e.start(0) > r.end(0) || r.start(0) > e.end(0) ? this.seekable_ = r : this.seekable_ = sa.createTimeRanges([[e.start(0) > r.start(0) ? e.start(0) : r.start(0), e.end(0) < r.end(0) ? e.end(0) : r.end(0)]]) : this.seekable_ = r, this.seekable_ && this.seekable_.length && this.seekable_.end(0) === a && this.seekable_.start(0) === s || (this.logger_("seekable updated [" + Xl(this.seekable_) + "]"), this.tech_.trigger("seekablechanged")) } } } } } }, { key: "updateDuration", value: function () { function e() { t.logger_("Setting duration from " + t.mediaSource.duration + " => " + n); try { t.mediaSource.duration = n } catch (e) { sa.log.warn("Failed to set media source duration", e) } t.tech_.trigger("durationchange"), t.mediaSource.removeEventListener("sourceopen", e) } var t = this, i = this.mediaSource.duration, n = kh.Playlist.duration(this.masterPlaylistLoader_.media()), r = this.tech_.buffered(); 0 < r.length && (n = Math.max(n, r.end(r.length - 1))), i !== n && ("open" !== this.mediaSource.readyState ? this.mediaSource.addEventListener("sourceopen", e) : e()) } }, { key: "dispose", value: function () { var n = this; this.trigger("dispose"), this.decrypter_.terminate(), this.masterPlaylistLoader_.dispose(), this.mainSegmentLoader_.dispose(), ["AUDIO", "SUBTITLES"].forEach(function (e) { var t = n.mediaTypes_[e].groups; for (var i in t) t[i].forEach(function (e) { e.playlistLoader && e.playlistLoader.dispose() }) }), this.audioSegmentLoader_.dispose(), this.subtitleSegmentLoader_.dispose(), this.off(), this.mediaSource.dispose && this.mediaSource.dispose() } }, { key: "master", value: function () { return this.masterPlaylistLoader_.master } }, { key: "media", value: function () { return this.masterPlaylistLoader_.media() || this.initialMedia_ } }, { key: "setupSourceBuffers_", value: function () { var e, t = this.masterPlaylistLoader_.media(); if (t && "open" === this.mediaSource.readyState) { if ((e = _c(this.masterPlaylistLoader_.master, t)).length < 1) return this.error = "No compatible SourceBuffer configuration for the variant stream:" + t.resolvedUri, this.mediaSource.endOfStream("decode"); this.configureLoaderMimeTypes_(e), this.excludeIncompatibleVariants_(t) } } }, { key: "configureLoaderMimeTypes_", value: function (e) { var t = 1 < e.length && -1 === e[0].indexOf(",") && e[0] !== e[1] ? new sa.EventTarget : null; this.mainSegmentLoader_.mimeType(e[0], t), e[1] && this.audioSegmentLoader_.mimeType(e[1], t) } }, { key: "excludeUnsupportedVariants_", value: function () { this.master().playlists.forEach(function (e) { e.attributes.CODECS && y.MediaSource && y.MediaSource.isTypeSupported && !y.MediaSource.isTypeSupported('video/mp4; codecs="' + function (e) { return e.replace(/avc1\.(\d+)\.(\d+)/i, function (e) { return gc([e])[0] }) }(e.attributes.CODECS) + '"') && (e.excludeUntil = 1 / 0) }) } }, { key: "excludeIncompatibleVariants_", value: function (e) { var i = 2, n = null, t = void 0; e.attributes.CODECS && (t = vc(e.attributes.CODECS), n = t.videoCodec, i = t.codecCount), this.master().playlists.forEach(function (e) { var t = { codecCount: 2, videoCodec: null }; e.attributes.CODECS && (t = vc(e.attributes.CODECS)), t.codecCount !== i && (e.excludeUntil = 1 / 0), t.videoCodec !== n && (e.excludeUntil = 1 / 0) }) } }, { key: "updateAdCues_", value: function (e) { var t = 0, i = this.seekable(); i.length && (t = i.start(0)), function (e, t, i) { var n = 2 < arguments.length && void 0 !== i ? i : 0; if (e.segments) for (var r = n, a = void 0, s = 0; s < e.segments.length; s++) { var o = e.segments[s]; if (a = a || ch(t, r + o.duration / 2)) { if ("cueIn" in o) { a.endTime = r, a.adEndTime = r, r += o.duration, a = null; continue } if (r < a.endTime) { r += o.duration; continue } a.endTime += o.duration } else if ("cueOut" in o && ((a = new y.VTTCue(r, r + o.duration, o.cueOut)).adStartTime = r, a.adEndTime = r + parseFloat(o.cueOut), t.addCue(a)), "cueOutCont" in o) { var u, l, c = o.cueOutCont.split("/").map(parseFloat), h = vl(c, 2); u = h[0], l = h[1], (a = new y.VTTCue(r, r + o.duration, "")).adStartTime = r - u, a.adEndTime = a.adStartTime + l, t.addCue(a) } r += o.duration } }(e, this.cueTagsTrack_, t) } }, { key: "goalBufferLength", value: function () { var e = this.tech_.currentTime(), t = eh.GOAL_BUFFER_LENGTH, i = eh.GOAL_BUFFER_LENGTH_RATE, n = Math.max(t, eh.MAX_GOAL_BUFFER_LENGTH); return Math.min(t + e * i, n) } }, { key: "bufferLowWaterLine", value: function () { var e = this.tech_.currentTime(), t = eh.BUFFER_LOW_WATER_LINE, i = eh.BUFFER_LOW_WATER_LINE_RATE, n = Math.max(t, eh.MAX_BUFFER_LOW_WATER_LINE); return Math.min(t + e * i, n) } }]), wh); function wh(e) { sl(this, wh); var t = cl(this, (wh.__proto__ || Object.getPrototypeOf(wh)).call(this)), i = e.url, n = e.handleManifestRedirects, r = e.withCredentials, a = e.tech, s = e.bandwidth, o = e.externHls, u = e.useCueTags, l = e.blacklistDuration, c = e.enableLowInitialPlaylist, h = e.sourceType, d = e.seekTo, p = e.cacheEncryptionKeys; if (!i) throw new Error("A non-empty playlist URL is required"); kh = o, t.withCredentials = r, t.tech_ = a, t.hls_ = a.hls, t.seekTo_ = d, t.sourceType_ = h, t.useCueTags_ = u, t.blacklistDuration = l, t.enableLowInitialPlaylist = c, t.useCueTags_ && (t.cueTagsTrack_ = t.tech_.addTextTrack("metadata", "ad-cues"), t.cueTagsTrack_.inBandMetadataTrackDispatchType = ""), t.requestOptions_ = { withCredentials: r, handleManifestRedirects: n, timeout: null }, t.mediaTypes_ = function () { var t = {}; return ["AUDIO", "SUBTITLES", "CLOSED-CAPTIONS"].forEach(function (e) { t[e] = { groups: {}, tracks: {}, activePlaylistLoader: null, activeGroup: Vc, activeTrack: Vc, onGroupChanged: Vc, onTrackChanged: Vc } }), t }(), t.mediaSource = new sa.MediaSource, t.mediaSource.addEventListener("sourceopen", t.handleSourceOpen_.bind(t)), t.seekable_ = sa.createTimeRanges(), t.hasPlayed_ = !1, t.syncController_ = new ph(e), t.segmentMetadataTrack_ = a.addRemoteTextTrack({ kind: "metadata", label: "segment-metadata" }, !1).track, t.decrypter_ = new yh, t.inbandTextTracks_ = {}; var f = { hls: t.hls_, mediaSource: t.mediaSource, currentTime: t.tech_.currentTime.bind(t.tech_), seekable: function () { return t.seekable() }, seeking: function () { return t.tech_.seeking() }, duration: function () { return t.mediaSource.duration }, hasPlayed: function () { return t.hasPlayed_ }, goalBufferLength: function () { return t.goalBufferLength() }, bandwidth: s, syncController: t.syncController_, decrypter: t.decrypter_, sourceType: t.sourceType_, inbandTextTracks: t.inbandTextTracks_, cacheEncryptionKeys: p }; return t.masterPlaylistLoader_ = "dash" === t.sourceType_ ? new jc(i, t.hls_, t.requestOptions_) : new bl(i, t.hls_, t.requestOptions_), t.setupMasterPlaylistLoaderListeners_(), t.mainSegmentLoader_ = new rh(sa.mergeOptions(f, { segmentMetadataTrack: t.segmentMetadataTrack_, loaderType: "main" }), e), t.audioSegmentLoader_ = new rh(sa.mergeOptions(f, { loaderType: "audio" }), e), t.subtitleSegmentLoader_ = new uh(sa.mergeOptions(f, { loaderType: "vtt", featuresNativeTextTracks: t.tech_.featuresNativeTextTracks }), e), t.setupSegmentLoaderListeners_(), Ch.forEach(function (e) { t[e + "_"] = function (e) { return this.audioSegmentLoader_[e] + this.mainSegmentLoader_[e] }.bind(t, e) }), t.logger_ = Hc("MPC"), t.masterPlaylistLoader_.load(), t } function Ah(e, t, i) { sl(this, Ah); var n = e.masterPlaylistController_, r = n[(e.options_.smoothQualityChange ? "smooth" : "fast") + "QualityChange_"].bind(n); if (t.attributes.RESOLUTION) { var a = t.attributes.RESOLUTION; this.width = a.width, this.height = a.height } this.bandwidth = t.attributes.BANDWIDTH, this.id = i, this.enabled = function (r, a, s) { return function (e) { var t = r.master.playlists[a], i = Pl(t), n = Ll(t); return "undefined" == typeof e ? n : (e ? delete t.disabled : t.disabled = !0, e === n || i || (s(), e ? r.trigger("renditionenabled") : r.trigger("renditiondisabled")), e) } }(e.playlists, t.id, r) } var Ih = ["seeking", "seeked", "pause", "playing", "error"], xh = (ol(Ph, [{ key: "monitorCurrentTime_", value: function () { this.checkCurrentTime_(), this.checkCurrentTimeTimeout_ && y.clearTimeout(this.checkCurrentTimeTimeout_), this.checkCurrentTimeTimeout_ = y.setTimeout(this.monitorCurrentTime_.bind(this), 250) } }, { key: "checkCurrentTime_", value: function () { if (this.tech_.seeking() && this.fixesBadSeeks_()) return this.consecutiveUpdates = 0, void (this.lastRecordedTime = this.tech_.currentTime()); if (!this.tech_.paused() && !this.tech_.seeking()) { var e = this.tech_.currentTime(), t = this.tech_.buffered(); if (this.lastRecordedTime === e && (!t.length || e + .1 >= t.end(t.length - 1))) return this.techWaiting_(); 5 <= this.consecutiveUpdates && e === this.lastRecordedTime ? (this.consecutiveUpdates++, this.waiting_()) : e === this.lastRecordedTime ? this.consecutiveUpdates++ : (this.consecutiveUpdates = 0, this.lastRecordedTime = e) } } }, { key: "cancelTimer_", value: function () { this.consecutiveUpdates = 0, this.timer_ && (this.logger_("cancelTimer_"), clearTimeout(this.timer_)), this.timer_ = null } }, { key: "fixesBadSeeks_", value: function () { if (!this.tech_.seeking()) return !1; var e = this.seekable(), t = this.tech_.currentTime(), i = void 0; return this.afterSeekableWindow_(e, t, this.media(), this.allowSeeksWithinUnsafeLiveWindow) && (i = e.end(e.length - 1)), this.beforeSeekableWindow_(e, t) && (i = e.start(0) + .1), "undefined" != typeof i && (this.logger_("Trying to seek outside of seekable at time " + t + " with seekable range " + Xl(e) + ". Seeking to " + i + "."), this.seekTo(i), !0) } }, { key: "waiting_", value: function () { if (!this.techWaiting_()) { var e = this.tech_.currentTime(), t = this.tech_.buffered(), i = zl(t, e); return i.length && e + 3 <= i.end(0) ? (this.cancelTimer_(), this.seekTo(e), this.logger_("Stopped at " + e + " while inside a buffered region [" + i.start(0) + " -> " + i.end(0) + "]. Attempting to resume playback by seeking to the current time."), void this.tech_.trigger({ type: "usage", name: "hls-unknown-waiting" })) : void 0 } } }, { key: "techWaiting_", value: function () { var e = this.seekable(), t = this.tech_.currentTime(); if (this.tech_.seeking() && this.fixesBadSeeks_()) return !0; if (this.tech_.seeking() || null !== this.timer_) return !0; if (this.beforeSeekableWindow_(e, t)) { var i = e.end(e.length - 1); return this.logger_("Fell out of live window at time " + t + ". Seeking to live point (seekable end) " + i), this.cancelTimer_(), this.seekTo(i), this.tech_.trigger({ type: "usage", name: "hls-live-resync" }), !0 } var n = this.tech_.buffered(), r = Gl(n, t); if (this.videoUnderflow_(r, n, t)) return this.cancelTimer_(), this.seekTo(t), this.tech_.trigger({ type: "usage", name: "hls-video-underflow" }), !0; if (0 < r.length) { var a = r.start(0) - t; return this.logger_("Stopped at " + t + ", setting timer for " + a + ", seeking to " + r.start(0)), this.timer_ = setTimeout(this.skipTheGap_.bind(this), 1e3 * a, t), !0 } return !1 } }, { key: "afterSeekableWindow_", value: function (e, t, i, n) { var r = 3 < arguments.length && void 0 !== n && n; if (!e.length) return !1; var a = e.end(e.length - 1) + .1; return !i.endList && r && (a = e.end(e.length - 1) + 3 * i.targetDuration), a < t } }, { key: "beforeSeekableWindow_", value: function (e, t) { return !!(e.length && 0 < e.start(0) && t < e.start(0) - .1) } }, { key: "videoUnderflow_", value: function (e, t, i) { if (0 === e.length) { var n = this.gapFromVideoUnderflow_(t, i); if (n) return this.logger_("Encountered a gap in video from " + n.start + " to " + n.end + ". Seeking to current time " + i), !0 } return !1 } }, { key: "skipTheGap_", value: function (e) { var t = this.tech_.buffered(), i = this.tech_.currentTime(), n = Gl(t, i); this.cancelTimer_(), 0 !== n.length && i === e && (this.logger_("skipTheGap_:", "currentTime:", i, "scheduled currentTime:", e, "nextRange start:", n.start(0)), this.seekTo(n.start(0) + 1 / 30), this.tech_.trigger({ type: "usage", name: "hls-gap-skip" })) } }, { key: "gapFromVideoUnderflow_", value: function (e, t) { for (var i = function (e) { if (e.length < 2) return sa.createTimeRanges(); for (var t = [], i = 1; i < e.length; i++) { var n = e.end(i - 1), r = e.start(i); t.push([n, r]) } return sa.createTimeRanges(t) }(e), n = 0; n < i.length; n++) { var r = i.start(n), a = i.end(n); if (t - r < 4 && 2 < t - r) return { start: r, end: a } } return null } }]), Ph); function Ph(e) { var t = this; sl(this, Ph), this.tech_ = e.tech, this.seekable = e.seekable, this.seekTo = e.seekTo, this.allowSeeksWithinUnsafeLiveWindow = e.allowSeeksWithinUnsafeLiveWindow, this.media = e.media, this.consecutiveUpdates = 0, this.lastRecordedTime = null, this.timer_ = null, this.checkCurrentTimeTimeout_ = null, this.logger_ = Hc("PlaybackWatcher"), this.logger_("initialize"); function i() { return t.monitorCurrentTime_() } function n() { return t.techWaiting_() } function r() { return t.cancelTimer_() } function a() { return t.fixesBadSeeks_() } this.tech_.on("seekablechanged", a), this.tech_.on("waiting", n), this.tech_.on(Ih, r), this.tech_.on("canplay", i), this.dispose = function () { t.logger_("dispose"), t.tech_.off("seekablechanged", a), t.tech_.off("waiting", n), t.tech_.off(Ih, r), t.tech_.off("canplay", i), t.checkCurrentTimeTimeout_ && y.clearTimeout(t.checkCurrentTimeTimeout_), t.cancelTimer_() } } function Lh(e) { !function t(i, e) { var n = 0, r = 0, a = sa.mergeOptions(Oh, e); i.ready(function () { i.trigger({ type: "usage", name: "hls-error-reload-initialized" }) }); function s() { r && i.currentTime(r) } function o(e) { null != e && (r = i.duration() !== 1 / 0 && i.currentTime() || 0, i.one("loadedmetadata", s), i.src(e), i.trigger({ type: "usage", name: "hls-error-reload" }), i.play()) } function u() { if (Date.now() - n < 1e3 * a.errorInterval) i.trigger({ type: "usage", name: "hls-error-reload-canceled" }); else { if (a.getSource && "function" == typeof a.getSource) return n = Date.now(), a.getSource.call(i, o); sa.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!") } } function l() { i.off("loadedmetadata", s), i.off("error", u), i.off("dispose", l) } i.on("error", u), i.on("dispose", l), i.reloadSourceOnError = function (e) { l(), t(i, e) } }(this, e) } var Oh = { errorInterval: 30, getSource: function (e) { return e(this.tech({ IWillNotUseThisInPlugins: !0 }).currentSource_) } }; sa.use("*", function (t) { return { setSource: function (e, t) { t(null, e) }, setCurrentTime: function (e) { return t.vhs && t.currentSource().src === t.vhs.source_.src && t.vhs.setCurrentTime(e), e }, play: function () { t.vhs && t.currentSource().src === t.vhs.source_.src && t.vhs.setCurrentTime(t.tech_.currentTime()) } } }); var Dh = { PlaylistLoader: bl, Playlist: tc, Decrypter: il, AsyncStream: Ju, decrypt: tl, utils: rc, STANDARD_PLAYLIST_SELECTOR: function () { return function (e, t, i, n, r) { var a = e.playlists.map(function (e) { var t, i; return t = e.attributes.RESOLUTION && e.attributes.RESOLUTION.width, i = e.attributes.RESOLUTION && e.attributes.RESOLUTION.height, { bandwidth: e.attributes.BANDWIDTH || y.Number.MAX_VALUE, width: t, height: i, playlist: e } }); Qc(a, function (e, t) { return e.bandwidth - t.bandwidth }); var s = (a = a.filter(function (e) { return !tc.isIncompatible(e.playlist) })).filter(function (e) { return tc.isEnabled(e.playlist) }); s.length || (s = a.filter(function (e) { return !tc.isDisabled(e.playlist) })); var o = s.filter(function (e) { return e.bandwidth * eh.BANDWIDTH_VARIANCE < t }), u = o[o.length - 1], l = o.filter(function (e) { return e.bandwidth === u.bandwidth })[0]; if (!1 === r) { var c = l || s[0] || a[0]; return c ? c.playlist : null } var h = o.filter(function (e) { return e.width && e.height }); Qc(h, function (e, t) { return e.width - t.width }); var d = h.filter(function (e) { return e.width === i && e.height === n }); u = d[d.length - 1]; var p = d.filter(function (e) { return e.bandwidth === u.bandwidth })[0], f = void 0, m = void 0, g = void 0; p || (m = (f = h.filter(function (e) { return e.width > i || e.height > n })).filter(function (e) { return e.width === f[0].width && e.height === f[0].height }), u = m[m.length - 1], g = m.filter(function (e) { return e.bandwidth === u.bandwidth })[0]); var v = g || p || l || s[0] || a[0]; return v ? v.playlist : null }(this.playlists.master, this.systemBandwidth, parseInt($c(this.tech_.el(), "width"), 10), parseInt($c(this.tech_.el(), "height"), 10), this.limitRenditionByPlayerDimensions) }, INITIAL_PLAYLIST_SELECTOR: function () { var e = this.playlists.master.playlists.filter(tc.isEnabled); return Qc(e, function (e, t) { return Jc(e, t) }), e.filter(function (e) { return vc(e.attributes.CODECS).videoCodec })[0] || null }, comparePlaylistBandwidth: Jc, comparePlaylistResolution: function (e, t) { var i = void 0, n = void 0; return e.attributes.RESOLUTION && e.attributes.RESOLUTION.width && (i = e.attributes.RESOLUTION.width), i = i || y.Number.MAX_VALUE, t.attributes.RESOLUTION && t.attributes.RESOLUTION.width && (n = t.attributes.RESOLUTION.width), i === (n = n || y.Number.MAX_VALUE) && e.attributes.BANDWIDTH && t.attributes.BANDWIDTH ? e.attributes.BANDWIDTH - t.attributes.BANDWIDTH : i - n }, xhr: Nl() };["GOAL_BUFFER_LENGTH", "MAX_GOAL_BUFFER_LENGTH", "GOAL_BUFFER_LENGTH_RATE", "BUFFER_LOW_WATER_LINE", "MAX_BUFFER_LOW_WATER_LINE", "BUFFER_LOW_WATER_LINE_RATE", "BANDWIDTH_VARIANCE"].forEach(function (t) { Object.defineProperty(Dh, t, { get: function () { return sa.log.warn("using Hls." + t + " is UNSAFE be sure you know what you are doing"), eh[t] }, set: function (e) { sa.log.warn("using Hls." + t + " is UNSAFE be sure you know what you are doing"), "number" != typeof e || e < 0 ? sa.log.warn("value of Hls." + t + " must be greater than or equal to 0") : eh[t] = e } }) }); function Nh(e) { return /^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i.test(e) ? "hls" : /^application\/dash\+xml/i.test(e) ? "dash" : null } function Rh(e, t) { for (var i = t.media(), n = -1, r = 0; r < e.length; r++)if (e[r].id === i.id) { n = r; break } e.selectedIndex_ = n, e.trigger({ selectedIndex: n, type: "change" }) } var Uh = "videojs-vhs"; Dh.canPlaySource = function () { return sa.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.") }; function Mh(e) { var t = e.masterPlaylistController_.mainSegmentLoader_, i = e.masterPlaylistController_.audioSegmentLoader_, n = sa.players[e.tech_.options_.playerId]; if (n.eme) { var r = function (e, t, i) { if (!e) return e; var n = void 0, r = void 0; if (i.mimeType_) n = t.mimeType_, r = i.mimeType_; else { var a = bc(t.mimeType_), s = a.parameters.codecs.split(","), o = void 0, u = void 0; s.forEach(function (e) { e = e.trim(), Tc(e) ? o = e : Sc(e) && (u = e) }), n = a.type + '; codecs="' + u + '"', r = a.type.replace("video", "audio") + '; codecs="' + o + '"' } var l = {}, c = t.playlist_; for (var h in e) l[h] = { audioContentType: r, videoContentType: n }, c.contentProtection && c.contentProtection[h] && c.contentProtection[h].pssh && (l[h].pssh = c.contentProtection[h].pssh), "string" == typeof e[h] && (l[h].url = e[h]); return sa.mergeOptions(e, l) }(e.source_.keySystems, t, i); r && (n.currentSource().keySystems = r, 11 !== sa.browser.IE_VERSION && n.eme.initializeMediaKeys && n.eme.initializeMediaKeys()) } } function Bh() { if (!window.localStorage) return null; var e = window.localStorage.getItem(Uh); if (!e) return null; try { return JSON.parse(e) } catch (e) { return null } } Dh.supportsNativeHls = function () { var t = h.createElement("video"); if (!sa.getTech("Html5").isSupported()) return !1; return ["application/vnd.apple.mpegurl", "audio/mpegurl", "audio/x-mpegurl", "application/x-mpegurl", "video/x-mpegurl", "video/mpegurl", "application/mpegurl"].some(function (e) { return /maybe|probably/i.test(t.canPlayType(e)) }) }(), Dh.supportsNativeDash = !!sa.getTech("Html5").isSupported() && /maybe|probably/i.test(h.createElement("video").canPlayType("application/dash+xml")), Dh.supportsTypeNatively = function (e) { return "hls" === e ? Dh.supportsNativeHls : "dash" === e && Dh.supportsNativeDash }, Dh.isSupported = function () { return sa.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.") }; var jh = sa.getComponent("Component"), Fh = (ll(Hh, jh), ol(Hh, [{ key: "setOptions_", value: function () { var t = this; if (this.options_.withCredentials = this.options_.withCredentials || !1, this.options_.handleManifestRedirects = this.options_.handleManifestRedirects || !1, this.options_.limitRenditionByPlayerDimensions = !1 !== this.options_.limitRenditionByPlayerDimensions, this.options_.smoothQualityChange = this.options_.smoothQualityChange || !1, this.options_.useBandwidthFromLocalStorage = "undefined" != typeof this.source_.useBandwidthFromLocalStorage ? this.source_.useBandwidthFromLocalStorage : this.options_.useBandwidthFromLocalStorage || !1, this.options_.customTagParsers = this.options_.customTagParsers || [], this.options_.customTagMappers = this.options_.customTagMappers || [], this.options_.cacheEncryptionKeys = this.options_.cacheEncryptionKeys || !1, "number" != typeof this.options_.blacklistDuration && (this.options_.blacklistDuration = 300), "number" != typeof this.options_.bandwidth && this.options_.useBandwidthFromLocalStorage) { var e = Bh(); e && e.bandwidth && (this.options_.bandwidth = e.bandwidth, this.tech_.trigger({ type: "usage", name: "hls-bandwidth-from-local-storage" })), e && e.throughput && (this.options_.throughput = e.throughput, this.tech_.trigger({ type: "usage", name: "hls-throughput-from-local-storage" })) } "number" != typeof this.options_.bandwidth && (this.options_.bandwidth = eh.INITIAL_BANDWIDTH), this.options_.enableLowInitialPlaylist = this.options_.enableLowInitialPlaylist && this.options_.bandwidth === eh.INITIAL_BANDWIDTH, ["withCredentials", "limitRenditionByPlayerDimensions", "bandwidth", "smoothQualityChange", "customTagParsers", "customTagMappers", "handleManifestRedirects", "cacheEncryptionKeys"].forEach(function (e) { "undefined" != typeof t.source_[e] && (t.options_[e] = t.source_[e]) }), this.limitRenditionByPlayerDimensions = this.options_.limitRenditionByPlayerDimensions } }, { key: "src", value: function (e, t) { var i = this; e && (this.setOptions_(), this.options_.url = this.source_.src, this.options_.tech = this.tech_, this.options_.externHls = Dh, this.options_.sourceType = Nh(t), this.options_.seekTo = function (e) { i.tech_.setCurrentTime(e), i.setCurrentTime(e) }, this.masterPlaylistController_ = new Eh(this.options_), this.playbackWatcher_ = new xh(sa.mergeOptions(this.options_, { seekable: function () { return i.seekable() }, media: function () { return i.masterPlaylistController_.media() } })), this.masterPlaylistController_.on("error", function () { sa.players[i.tech_.options_.playerId].error(i.masterPlaylistController_.error) }), this.masterPlaylistController_.selectPlaylist = this.selectPlaylist ? this.selectPlaylist.bind(this) : Dh.STANDARD_PLAYLIST_SELECTOR.bind(this), this.masterPlaylistController_.selectInitialPlaylist = Dh.INITIAL_PLAYLIST_SELECTOR.bind(this), this.playlists = this.masterPlaylistController_.masterPlaylistLoader_, this.mediaSource = this.masterPlaylistController_.mediaSource, Object.defineProperties(this, { selectPlaylist: { get: function () { return this.masterPlaylistController_.selectPlaylist }, set: function (e) { this.masterPlaylistController_.selectPlaylist = e.bind(this) } }, throughput: { get: function () { return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate }, set: function (e) { this.masterPlaylistController_.mainSegmentLoader_.throughput.rate = e, this.masterPlaylistController_.mainSegmentLoader_.throughput.count = 1 } }, bandwidth: { get: function () { return this.masterPlaylistController_.mainSegmentLoader_.bandwidth }, set: function (e) { this.masterPlaylistController_.mainSegmentLoader_.bandwidth = e, this.masterPlaylistController_.mainSegmentLoader_.throughput = { rate: 0, count: 0 } } }, systemBandwidth: { get: function () { var e = 1 / (this.bandwidth || 1), t = void 0; return t = 0 < this.throughput ? 1 / this.throughput : 0, Math.floor(1 / (e + t)) }, set: function () { sa.log.error('The "systemBandwidth" property is read-only') } } }), this.options_.bandwidth && (this.bandwidth = this.options_.bandwidth), this.options_.throughput && (this.throughput = this.options_.throughput), Object.defineProperties(this.stats, { bandwidth: { get: function () { return i.bandwidth || 0 }, enumerable: !0 }, mediaRequests: { get: function () { return i.masterPlaylistController_.mediaRequests_() || 0 }, enumerable: !0 }, mediaRequestsAborted: { get: function () { return i.masterPlaylistController_.mediaRequestsAborted_() || 0 }, enumerable: !0 }, mediaRequestsTimedout: { get: function () { return i.masterPlaylistController_.mediaRequestsTimedout_() || 0 }, enumerable: !0 }, mediaRequestsErrored: { get: function () { return i.masterPlaylistController_.mediaRequestsErrored_() || 0 }, enumerable: !0 }, mediaTransferDuration: { get: function () { return i.masterPlaylistController_.mediaTransferDuration_() || 0 }, enumerable: !0 }, mediaBytesTransferred: { get: function () { return i.masterPlaylistController_.mediaBytesTransferred_() || 0 }, enumerable: !0 }, mediaSecondsLoaded: { get: function () { return i.masterPlaylistController_.mediaSecondsLoaded_() || 0 }, enumerable: !0 }, buffered: { get: function () { return Kl(i.tech_.buffered()) }, enumerable: !0 }, currentTime: { get: function () { return i.tech_.currentTime() }, enumerable: !0 }, currentSource: { get: function () { return i.tech_.currentSource_ }, enumerable: !0 }, currentTech: { get: function () { return i.tech_.name_ }, enumerable: !0 }, duration: { get: function () { return i.tech_.duration() }, enumerable: !0 }, master: { get: function () { return i.playlists.master }, enumerable: !0 }, playerDimensions: { get: function () { return i.tech_.currentDimensions() }, enumerable: !0 }, seekable: { get: function () { return Kl(i.tech_.seekable()) }, enumerable: !0 }, timestamp: { get: function () { return Date.now() }, enumerable: !0 }, videoPlaybackQuality: { get: function () { return i.tech_.getVideoPlaybackQuality() }, enumerable: !0 } }), this.tech_.one("canplay", this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)), this.tech_.on("bandwidthupdate", function () { i.options_.useBandwidthFromLocalStorage && function (e) { if (window.localStorage) { var t = Bh(); t = t ? sa.mergeOptions(t, e) : e; try { window.localStorage.setItem(Uh, JSON.stringify(t)) } catch (e) { return } } }({ bandwidth: i.bandwidth, throughput: Math.round(i.throughput) }) }), this.masterPlaylistController_.on("selectedinitialmedia", function () { !function (i) { var e = i.playlists; i.representations = function () { return e && e.master && e.master.playlists ? e.master.playlists.filter(function (e) { return !Pl(e) }).map(function (e, t) { return new Ah(i, e, e.id) }) : [] } }(i), Mh(i) }), this.on(this.masterPlaylistController_, "progress", function () { this.tech_.trigger("progress") }), this.setupQualityLevels_(), this.tech_.el() && this.tech_.src(sa.URL.createObjectURL(this.masterPlaylistController_.mediaSource))) } }, { key: "setupQualityLevels_", value: function () { var e = this, t = sa.players[this.tech_.options_.playerId]; t && t.qualityLevels && !this.qualityLevels_ && (this.qualityLevels_ = t.qualityLevels(), this.masterPlaylistController_.on("selectedinitialmedia", function () { !function (t, e) { e.representations().forEach(function (e) { t.addQualityLevel(e) }), Rh(t, e.playlists) }(e.qualityLevels_, e) }), this.playlists.on("mediachange", function () { Rh(e.qualityLevels_, e.playlists) })) } }, { key: "play", value: function () { this.masterPlaylistController_.play() } }, { key: "setCurrentTime", value: function (e) { this.masterPlaylistController_.setCurrentTime(e) } }, { key: "duration", value: function () { return this.masterPlaylistController_.duration() } }, { key: "seekable", value: function () { return this.masterPlaylistController_.seekable() } }, { key: "dispose", value: function () { this.playbackWatcher_ && this.playbackWatcher_.dispose(), this.masterPlaylistController_ && this.masterPlaylistController_.dispose(), this.qualityLevels_ && this.qualityLevels_.dispose(), this.player_ && (delete this.player_.vhs, delete this.player_.dash, delete this.player_.hls), this.tech_ && this.tech_.hls && delete this.tech_.hls, function e(t, i, n) { null === t && (t = Function.prototype); var r = Object.getOwnPropertyDescriptor(t, i); if (void 0 === r) { var a = Object.getPrototypeOf(t); return null === a ? void 0 : e(a, i, n) } if ("value" in r) return r.value; var s = r.get; return void 0 !== s ? s.call(n) : void 0 }(Hh.prototype.__proto__ || Object.getPrototypeOf(Hh.prototype), "dispose", this).call(this) } }, { key: "convertToProgramTime", value: function (e, t) { return Vl({ playlist: this.masterPlaylistController_.media(), time: e, callback: t }) } }, { key: "seekToProgramTime", value: function (e, t, i, n) { var r = !(2 < arguments.length && void 0 !== i) || i, a = 3 < arguments.length && void 0 !== n ? n : 2; return ql({ programTime: e, playlist: this.masterPlaylistController_.media(), retryCount: a, pauseAfterSeek: r, seekTo: this.options_.seekTo, tech: this.options_.tech, callback: t }) } }]), Hh); function Hh(e, t, i) { sl(this, Hh); var n = cl(this, (Hh.__proto__ || Object.getPrototypeOf(Hh)).call(this, t, i.hls)); if (t.options_ && t.options_.playerId) { var r = sa(t.options_.playerId); r.hasOwnProperty("hls") || Object.defineProperty(r, "hls", { get: function () { return sa.log.warn("player.hls is deprecated. Use player.tech().hls instead."), t.trigger({ type: "usage", name: "hls-player-access" }), n }, configurable: !0 }), r.vhs = n, (r.dash = n).player_ = r } if (n.tech_ = t, n.source_ = e, n.stats = {}, n.setOptions_(), n.options_.overrideNative && t.overrideNativeAudioTracks && t.overrideNativeVideoTracks) t.overrideNativeAudioTracks(!0), t.overrideNativeVideoTracks(!0); else if (n.options_.overrideNative && (t.featuresNativeVideoTracks || t.featuresNativeAudioTracks)) throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB"); return n.on(h, ["fullscreenchange", "webkitfullscreenchange", "mozfullscreenchange", "MSFullscreenChange"], function (e) { var t = h.fullscreenElement || h.webkitFullscreenElement || h.mozFullScreenElement || h.msFullscreenElement; t && t.contains(n.tech_.el()) && n.masterPlaylistController_.smoothQualityChange_() }), n.on(n.tech_, "seeking", function () { 0 === this.tech_.currentTime() && this.tech_.player_.loop() && this.setCurrentTime(0) }), n.on(n.tech_, "error", function () { this.masterPlaylistController_ && this.masterPlaylistController_.pauseLoading() }), n.on(n.tech_, "play", n.play), n } var Vh = { name: "videojs-http-streaming", VERSION: "1.12.3", canHandleSource: function (e, t) { var i = sa.mergeOptions(sa.options, 1 < arguments.length && void 0 !== t ? t : {}); return Vh.canPlayType(e.type, i) }, handleSource: function (e, t, i) { var n = sa.mergeOptions(sa.options, 2 < arguments.length && void 0 !== i ? i : {}); return t.hls = new Fh(e, t, n), t.hls.xhr = Nl(), t.hls.src(e.src, e.type), t.hls }, canPlayType: function (e, t) { var i = sa.mergeOptions(sa.options, 1 < arguments.length && void 0 !== t ? t : {}).hls.overrideNative, n = Nh(e); return n && (!Dh.supportsTypeNatively(n) || i) ? "maybe" : "" } }; return "undefined" != typeof sa.MediaSource && "undefined" != typeof sa.URL || (sa.MediaSource = Oc, sa.URL = Dc), Oc.supportsNativeMediaSources() && sa.getTech("Html5").registerSourceHandler(Vh, 0), sa.HlsHandler = Fh, sa.HlsSourceHandler = Vh, sa.Hls = Dh, sa.use || sa.registerComponent("Hls", Dh), sa.options.hls = sa.options.hls || {}, sa.registerPlugin ? sa.registerPlugin("reloadSourceOnError", Lh) : sa.plugin("reloadSourceOnError", Lh), sa +}); +!function () { !function (a) { var b = a && a.videojs; b && (b.CDN_VERSION = "7.7.6") }(window) }(); \ No newline at end of file diff --git a/FO/js/videojs-ie8.min.js b/FO/js/videojs-ie8.min.js new file mode 100644 index 0000000..7aa78db --- /dev/null +++ b/FO/js/videojs-ie8.min.js @@ -0,0 +1 @@ +!function (a, b) { "undefined" == typeof a.HTMLVideoElement && (b.createElement("video"), b.createElement("audio"), b.createElement("track")), function (a, b) { "use strict"; "function" == typeof define && define.amd ? define(b) : "object" == typeof exports ? module.exports = b() : a.returnExports = b() }(this, function () { var b, c = Array, d = c.prototype, e = Object, f = e.prototype, g = Function.prototype, h = String, i = h.prototype, j = Number, k = j.prototype, l = d.slice, m = d.splice, n = d.push, o = d.unshift, p = d.concat, q = g.call, r = g.apply, s = Math.max, t = Math.min, u = f.toString, v = "function" == typeof Symbol && "symbol" == typeof Symbol.toStringTag, w = Function.prototype.toString, x = function (a) { try { return w.call(a), !0 } catch (b) { return !1 } }, y = "[object Function]", z = "[object GeneratorFunction]"; b = function (a) { if ("function" != typeof a) return !1; if (v) return x(a); var b = u.call(a); return b === y || b === z }; var A, B = RegExp.prototype.exec, C = function (a) { try { return B.call(a), !0 } catch (b) { return !1 } }, D = "[object RegExp]"; A = function (a) { return "object" != typeof a ? !1 : v ? C(a) : u.call(a) === D }; var E, F = String.prototype.valueOf, G = function (a) { try { return F.call(a), !0 } catch (b) { return !1 } }, H = "[object String]"; E = function (a) { return "string" == typeof a ? !0 : "object" != typeof a ? !1 : v ? G(a) : u.call(a) === H }; var I = e.defineProperty && function () { try { var a = {}; e.defineProperty(a, "x", { enumerable: !1, value: a }); for (var b in a) return !1; return a.x === a } catch (c) { return !1 } }(), J = function (a) { var b; return b = I ? function (a, b, c, d) { !d && b in a || e.defineProperty(a, b, { configurable: !0, enumerable: !1, writable: !0, value: c }) } : function (a, b, c, d) { !d && b in a || (a[b] = c) }, function (c, d, e) { for (var f in d) a.call(d, f) && b(c, f, d[f], e) } }(f.hasOwnProperty), K = function (a) { var b = typeof a; return null === a || "object" !== b && "function" !== b }, L = j.isNaN || function (a) { return a !== a }, M = { ToInteger: function (a) { var b = +a; return L(b) ? b = 0 : 0 !== b && b !== 1 / 0 && b !== -(1 / 0) && (b = (b > 0 || -1) * Math.floor(Math.abs(b))), b }, ToPrimitive: function (a) { var c, d, e; if (K(a)) return a; if (d = a.valueOf, b(d) && (c = d.call(a), K(c))) return c; if (e = a.toString, b(e) && (c = e.call(a), K(c))) return c; throw new TypeError }, ToObject: function (a) { if (null == a) throw new TypeError("can't convert " + a + " to object"); return e(a) }, ToUint32: function (a) { return a >>> 0 } }, N = function () { }; J(g, { bind: function (a) { var c = this; if (!b(c)) throw new TypeError("Function.prototype.bind called on incompatible " + c); for (var d, f = l.call(arguments, 1), g = function () { if (this instanceof d) { var b = c.apply(this, p.call(f, l.call(arguments))); return e(b) === b ? b : this } return c.apply(a, p.call(f, l.call(arguments))) }, h = s(0, c.length - f.length), i = [], j = 0; h > j; j++)n.call(i, "$" + j); return d = Function("binder", "return function (" + i.join(",") + "){ return binder.apply(this, arguments); }")(g), c.prototype && (N.prototype = c.prototype, d.prototype = new N, N.prototype = null), d } }); var O = q.bind(f.hasOwnProperty), P = q.bind(f.toString), Q = q.bind(l), R = r.bind(l), S = q.bind(i.slice), T = q.bind(i.split), U = q.bind(i.indexOf), V = q.bind(n), W = q.bind(f.propertyIsEnumerable), X = q.bind(d.sort), Y = c.isArray || function (a) { return "[object Array]" === P(a) }, Z = 1 !== [].unshift(0); J(d, { unshift: function () { return o.apply(this, arguments), this.length } }, Z), J(c, { isArray: Y }); var $ = e("a"), _ = "a" !== $[0] || !(0 in $), aa = function (a) { var b = !0, c = !0, d = !1; if (a) try { a.call("foo", function (a, c, d) { "object" != typeof d && (b = !1) }), a.call([1], function () { "use strict"; c = "string" == typeof this }, "x") } catch (e) { d = !0 } return !!a && !d && b && c }; J(d, { forEach: function (a) { var c, d = M.ToObject(this), e = _ && E(this) ? T(this, "") : d, f = -1, g = M.ToUint32(e.length); if (arguments.length > 1 && (c = arguments[1]), !b(a)) throw new TypeError("Array.prototype.forEach callback must be a function"); for (; ++f < g;)f in e && ("undefined" == typeof c ? a(e[f], f, d) : a.call(c, e[f], f, d)) } }, !aa(d.forEach)), J(d, { map: function (a) { var d, e = M.ToObject(this), f = _ && E(this) ? T(this, "") : e, g = M.ToUint32(f.length), h = c(g); if (arguments.length > 1 && (d = arguments[1]), !b(a)) throw new TypeError("Array.prototype.map callback must be a function"); for (var i = 0; g > i; i++)i in f && ("undefined" == typeof d ? h[i] = a(f[i], i, e) : h[i] = a.call(d, f[i], i, e)); return h } }, !aa(d.map)), J(d, { filter: function (a) { var c, d, e = M.ToObject(this), f = _ && E(this) ? T(this, "") : e, g = M.ToUint32(f.length), h = []; if (arguments.length > 1 && (d = arguments[1]), !b(a)) throw new TypeError("Array.prototype.filter callback must be a function"); for (var i = 0; g > i; i++)i in f && (c = f[i], ("undefined" == typeof d ? a(c, i, e) : a.call(d, c, i, e)) && V(h, c)); return h } }, !aa(d.filter)), J(d, { every: function (a) { var c, d = M.ToObject(this), e = _ && E(this) ? T(this, "") : d, f = M.ToUint32(e.length); if (arguments.length > 1 && (c = arguments[1]), !b(a)) throw new TypeError("Array.prototype.every callback must be a function"); for (var g = 0; f > g; g++)if (g in e && !("undefined" == typeof c ? a(e[g], g, d) : a.call(c, e[g], g, d))) return !1; return !0 } }, !aa(d.every)), J(d, { some: function (a) { var c, d = M.ToObject(this), e = _ && E(this) ? T(this, "") : d, f = M.ToUint32(e.length); if (arguments.length > 1 && (c = arguments[1]), !b(a)) throw new TypeError("Array.prototype.some callback must be a function"); for (var g = 0; f > g; g++)if (g in e && ("undefined" == typeof c ? a(e[g], g, d) : a.call(c, e[g], g, d))) return !0; return !1 } }, !aa(d.some)); var ba = !1; d.reduce && (ba = "object" == typeof d.reduce.call("es5", function (a, b, c, d) { return d })), J(d, { reduce: function (a) { var c = M.ToObject(this), d = _ && E(this) ? T(this, "") : c, e = M.ToUint32(d.length); if (!b(a)) throw new TypeError("Array.prototype.reduce callback must be a function"); if (0 === e && 1 === arguments.length) throw new TypeError("reduce of empty array with no initial value"); var f, g = 0; if (arguments.length >= 2) f = arguments[1]; else for (; ;) { if (g in d) { f = d[g++]; break } if (++g >= e) throw new TypeError("reduce of empty array with no initial value") } for (; e > g; g++)g in d && (f = a(f, d[g], g, c)); return f } }, !ba); var ca = !1; d.reduceRight && (ca = "object" == typeof d.reduceRight.call("es5", function (a, b, c, d) { return d })), J(d, { reduceRight: function (a) { var c = M.ToObject(this), d = _ && E(this) ? T(this, "") : c, e = M.ToUint32(d.length); if (!b(a)) throw new TypeError("Array.prototype.reduceRight callback must be a function"); if (0 === e && 1 === arguments.length) throw new TypeError("reduceRight of empty array with no initial value"); var f, g = e - 1; if (arguments.length >= 2) f = arguments[1]; else for (; ;) { if (g in d) { f = d[g--]; break } if (--g < 0) throw new TypeError("reduceRight of empty array with no initial value") } if (0 > g) return f; do g in d && (f = a(f, d[g], g, c)); while (g--); return f } }, !ca); var da = d.indexOf && -1 !== [0, 1].indexOf(1, 2); J(d, { indexOf: function (a) { var b = _ && E(this) ? T(this, "") : M.ToObject(this), c = M.ToUint32(b.length); if (0 === c) return -1; var d = 0; for (arguments.length > 1 && (d = M.ToInteger(arguments[1])), d = d >= 0 ? d : s(0, c + d); c > d; d++)if (d in b && b[d] === a) return d; return -1 } }, da); var ea = d.lastIndexOf && -1 !== [0, 1].lastIndexOf(0, -3); J(d, { lastIndexOf: function (a) { var b = _ && E(this) ? T(this, "") : M.ToObject(this), c = M.ToUint32(b.length); if (0 === c) return -1; var d = c - 1; for (arguments.length > 1 && (d = t(d, M.ToInteger(arguments[1]))), d = d >= 0 ? d : c - Math.abs(d); d >= 0; d--)if (d in b && a === b[d]) return d; return -1 } }, ea); var fa = function () { var a = [1, 2], b = a.splice(); return 2 === a.length && Y(b) && 0 === b.length }(); J(d, { splice: function (a, b) { return 0 === arguments.length ? [] : m.apply(this, arguments) } }, !fa); var ga = function () { var a = {}; return d.splice.call(a, 0, 0, 1), 1 === a.length }(); J(d, { splice: function (a, b) { if (0 === arguments.length) return []; var c = arguments; return this.length = s(M.ToInteger(this.length), 0), arguments.length > 0 && "number" != typeof b && (c = Q(arguments), c.length < 2 ? V(c, this.length - a) : c[1] = M.ToInteger(b)), m.apply(this, c) } }, !ga); var ha = function () { var a = new c(1e5); return a[8] = "x", a.splice(1, 1), 7 === a.indexOf("x") }(), ia = function () { var a = 256, b = []; return b[a] = "a", b.splice(a + 1, 0, "b"), "a" === b[a] }(); J(d, { splice: function (a, b) { for (var c, d = M.ToObject(this), e = [], f = M.ToUint32(d.length), g = M.ToInteger(a), i = 0 > g ? s(f + g, 0) : t(g, f), j = t(s(M.ToInteger(b), 0), f - i), k = 0; j > k;)c = h(i + k), O(d, c) && (e[k] = d[c]), k += 1; var l, m = Q(arguments, 2), n = m.length; if (j > n) { for (k = i; f - j > k;)c = h(k + j), l = h(k + n), O(d, c) ? d[l] = d[c] : delete d[l], k += 1; for (k = f; k > f - j + n;)delete d[k - 1], k -= 1 } else if (n > j) for (k = f - j; k > i;)c = h(k + j - 1), l = h(k + n - 1), O(d, c) ? d[l] = d[c] : delete d[l], k -= 1; k = i; for (var o = 0; o < m.length; ++o)d[k] = m[o], k += 1; return d.length = f - j + n, e } }, !ha || !ia); var ja, ka = d.join; try { ja = "1,2,3" !== Array.prototype.join.call("123", ",") } catch (la) { ja = !0 } ja && J(d, { join: function (a) { var b = "undefined" == typeof a ? "," : a; return ka.call(E(this) ? T(this, "") : this, b) } }, ja); var ma = "1,2" !== [1, 2].join(void 0); ma && J(d, { join: function (a) { var b = "undefined" == typeof a ? "," : a; return ka.call(this, b) } }, ma); var na = function (a) { for (var b = M.ToObject(this), c = M.ToUint32(b.length), d = 0; d < arguments.length;)b[c + d] = arguments[d], d += 1; return b.length = c + d, c + d }, oa = function () { var a = {}, b = Array.prototype.push.call(a, void 0); return 1 !== b || 1 !== a.length || "undefined" != typeof a[0] || !O(a, 0) }(); J(d, { push: function (a) { return Y(this) ? n.apply(this, arguments) : na.apply(this, arguments) } }, oa); var pa = function () { var a = [], b = a.push(void 0); return 1 !== b || 1 !== a.length || "undefined" != typeof a[0] || !O(a, 0) }(); J(d, { push: na }, pa), J(d, { slice: function (a, b) { var c = E(this) ? T(this, "") : this; return R(c, arguments) } }, _); var qa = function () { try { return [1, 2].sort(null), [1, 2].sort({}), !0 } catch (a) { } return !1 }(), ra = function () { try { return [1, 2].sort(/a/), !1 } catch (a) { } return !0 }(), sa = function () { try { return [1, 2].sort(void 0), !0 } catch (a) { } return !1 }(); J(d, { sort: function (a) { if ("undefined" == typeof a) return X(this); if (!b(a)) throw new TypeError("Array.prototype.sort callback must be a function"); return X(this, a) } }, qa || !sa || !ra); var ta = !{ toString: null }.propertyIsEnumerable("toString"), ua = function () { }.propertyIsEnumerable("prototype"), va = !O("x", "0"), wa = function (a) { var b = a.constructor; return b && b.prototype === a }, xa = { $window: !0, $console: !0, $parent: !0, $self: !0, $frame: !0, $frames: !0, $frameElement: !0, $webkitIndexedDB: !0, $webkitStorageInfo: !0, $external: !0 }, ya = function () { if ("undefined" == typeof a) return !1; for (var b in a) try { !xa["$" + b] && O(a, b) && null !== a[b] && "object" == typeof a[b] && wa(a[b]) } catch (c) { return !0 } return !1 }(), za = function (b) { if ("undefined" == typeof a || !ya) return wa(b); try { return wa(b) } catch (c) { return !1 } }, Aa = ["toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor"], Ba = Aa.length, Ca = function (a) { return "[object Arguments]" === P(a) }, Da = function (a) { return null !== a && "object" == typeof a && "number" == typeof a.length && a.length >= 0 && !Y(a) && b(a.callee) }, Ea = Ca(arguments) ? Ca : Da; J(e, { keys: function (a) { var c = b(a), d = Ea(a), e = null !== a && "object" == typeof a, f = e && E(a); if (!e && !c && !d) throw new TypeError("Object.keys called on a non-object"); var g = [], i = ua && c; if (f && va || d) for (var j = 0; j < a.length; ++j)V(g, h(j)); if (!d) for (var k in a) i && "prototype" === k || !O(a, k) || V(g, h(k)); if (ta) for (var l = za(a), m = 0; Ba > m; m++) { var n = Aa[m]; l && "constructor" === n || !O(a, n) || V(g, n) } return g } }); var Fa = e.keys && function () { return 2 === e.keys(arguments).length }(1, 2), Ga = e.keys && function () { var a = e.keys(arguments); return 1 !== arguments.length || 1 !== a.length || 1 !== a[0] }(1), Ha = e.keys; J(e, { keys: function (a) { return Ha(Ea(a) ? Q(a) : a) } }, !Fa || Ga); var Ia, Ja, Ka = 0 !== new Date(-0xc782b5b342b24).getUTCMonth(), La = new Date(-0x55d318d56a724), Ma = new Date(14496624e5), Na = "Mon, 01 Jan -45875 11:59:59 GMT" !== La.toUTCString(), Oa = La.getTimezoneOffset(); -720 > Oa ? (Ia = "Tue Jan 02 -45875" !== La.toDateString(), Ja = !/^Thu Dec 10 2015 \d\d:\d\d:\d\d GMT[-\+]\d\d\d\d(?: |$)/.test(Ma.toString())) : (Ia = "Mon Jan 01 -45875" !== La.toDateString(), Ja = !/^Wed Dec 09 2015 \d\d:\d\d:\d\d GMT[-\+]\d\d\d\d(?: |$)/.test(Ma.toString())); var Pa = q.bind(Date.prototype.getFullYear), Qa = q.bind(Date.prototype.getMonth), Ra = q.bind(Date.prototype.getDate), Sa = q.bind(Date.prototype.getUTCFullYear), Ta = q.bind(Date.prototype.getUTCMonth), Ua = q.bind(Date.prototype.getUTCDate), Va = q.bind(Date.prototype.getUTCDay), Wa = q.bind(Date.prototype.getUTCHours), Xa = q.bind(Date.prototype.getUTCMinutes), Ya = q.bind(Date.prototype.getUTCSeconds), Za = q.bind(Date.prototype.getUTCMilliseconds), $a = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri"], _a = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], ab = function (a, b) { return Ra(new Date(b, a, 0)) }; J(Date.prototype, { getFullYear: function () { if (!(this && this instanceof Date)) throw new TypeError("this is not a Date object."); var a = Pa(this); return 0 > a && Qa(this) > 11 ? a + 1 : a }, getMonth: function () { if (!(this && this instanceof Date)) throw new TypeError("this is not a Date object."); var a = Pa(this), b = Qa(this); return 0 > a && b > 11 ? 0 : b }, getDate: function () { if (!(this && this instanceof Date)) throw new TypeError("this is not a Date object."); var a = Pa(this), b = Qa(this), c = Ra(this); if (0 > a && b > 11) { if (12 === b) return c; var d = ab(0, a + 1); return d - c + 1 } return c }, getUTCFullYear: function () { if (!(this && this instanceof Date)) throw new TypeError("this is not a Date object."); var a = Sa(this); return 0 > a && Ta(this) > 11 ? a + 1 : a }, getUTCMonth: function () { if (!(this && this instanceof Date)) throw new TypeError("this is not a Date object."); var a = Sa(this), b = Ta(this); return 0 > a && b > 11 ? 0 : b }, getUTCDate: function () { if (!(this && this instanceof Date)) throw new TypeError("this is not a Date object."); var a = Sa(this), b = Ta(this), c = Ua(this); if (0 > a && b > 11) { if (12 === b) return c; var d = ab(0, a + 1); return d - c + 1 } return c } }, Ka), J(Date.prototype, { toUTCString: function () { if (!(this && this instanceof Date)) throw new TypeError("this is not a Date object."); var a = Va(this), b = Ua(this), c = Ta(this), d = Sa(this), e = Wa(this), f = Xa(this), g = Ya(this); return $a[a] + ", " + (10 > b ? "0" + b : b) + " " + _a[c] + " " + d + " " + (10 > e ? "0" + e : e) + ":" + (10 > f ? "0" + f : f) + ":" + (10 > g ? "0" + g : g) + " GMT" } }, Ka || Na), J(Date.prototype, { toDateString: function () { if (!(this && this instanceof Date)) throw new TypeError("this is not a Date object."); var a = this.getDay(), b = this.getDate(), c = this.getMonth(), d = this.getFullYear(); return $a[a] + " " + _a[c] + " " + (10 > b ? "0" + b : b) + " " + d } }, Ka || Ia), (Ka || Ja) && (Date.prototype.toString = function () { if (!(this && this instanceof Date)) throw new TypeError("this is not a Date object."); var a = this.getDay(), b = this.getDate(), c = this.getMonth(), d = this.getFullYear(), e = this.getHours(), f = this.getMinutes(), g = this.getSeconds(), h = this.getTimezoneOffset(), i = Math.floor(Math.abs(h) / 60), j = Math.floor(Math.abs(h) % 60); return $a[a] + " " + _a[c] + " " + (10 > b ? "0" + b : b) + " " + d + " " + (10 > e ? "0" + e : e) + ":" + (10 > f ? "0" + f : f) + ":" + (10 > g ? "0" + g : g) + " GMT" + (h > 0 ? "-" : "+") + (10 > i ? "0" + i : i) + (10 > j ? "0" + j : j) }, I && e.defineProperty(Date.prototype, "toString", { configurable: !0, enumerable: !1, writable: !0 })); var bb = -621987552e5, cb = "-000001", db = Date.prototype.toISOString && -1 === new Date(bb).toISOString().indexOf(cb), eb = Date.prototype.toISOString && "1969-12-31T23:59:59.999Z" !== new Date(-1).toISOString(); J(Date.prototype, { toISOString: function () { if (!isFinite(this)) throw new RangeError("Date.prototype.toISOString called on non-finite value."); var a = Sa(this), b = Ta(this); a += Math.floor(b / 12), b = (b % 12 + 12) % 12; var c = [b + 1, Ua(this), Wa(this), Xa(this), Ya(this)]; a = (0 > a ? "-" : a > 9999 ? "+" : "") + S("00000" + Math.abs(a), a >= 0 && 9999 >= a ? -4 : -6); for (var d = 0; d < c.length; ++d)c[d] = S("00" + c[d], -2); return a + "-" + Q(c, 0, 2).join("-") + "T" + Q(c, 2).join(":") + "." + S("000" + Za(this), -3) + "Z" } }, db || eb); var fb = function () { try { return Date.prototype.toJSON && null === new Date(NaN).toJSON() && -1 !== new Date(bb).toJSON().indexOf(cb) && Date.prototype.toJSON.call({ toISOString: function () { return !0 } }) } catch (a) { return !1 } }(); fb || (Date.prototype.toJSON = function (a) { var c = e(this), d = M.ToPrimitive(c); if ("number" == typeof d && !isFinite(d)) return null; var f = c.toISOString; if (!b(f)) throw new TypeError("toISOString property is not callable"); return f.call(c) }); var gb = 1e15 === Date.parse("+033658-09-27T01:46:40.000Z"), hb = !isNaN(Date.parse("2012-04-04T24:00:00.500Z")) || !isNaN(Date.parse("2012-11-31T23:59:59.000Z")) || !isNaN(Date.parse("2012-12-31T23:59:60.000Z")), ib = isNaN(Date.parse("2000-01-01T00:00:00.000Z")); if (ib || hb || !gb) { var jb = Math.pow(2, 31) - 1, kb = L(new Date(1970, 0, 1, 0, 0, 0, jb + 1).getTime()); Date = function (a) { var b = function (c, d, e, f, g, i, j) { var k, l = arguments.length; if (this instanceof a) { var m = i, n = j; if (kb && l >= 7 && j > jb) { var o = Math.floor(j / jb) * jb, p = Math.floor(o / 1e3); m += p, n -= 1e3 * p } k = 1 === l && h(c) === c ? new a(b.parse(c)) : l >= 7 ? new a(c, d, e, f, g, m, n) : l >= 6 ? new a(c, d, e, f, g, m) : l >= 5 ? new a(c, d, e, f, g) : l >= 4 ? new a(c, d, e, f) : l >= 3 ? new a(c, d, e) : l >= 2 ? new a(c, d) : l >= 1 ? new a(c) : new a } else k = a.apply(this, arguments); return K(k) || J(k, { constructor: b }, !0), k }, c = new RegExp("^(\\d{4}|[+-]\\d{6})(?:-(\\d{2})(?:-(\\d{2})(?:T(\\d{2}):(\\d{2})(?::(\\d{2})(?:(\\.\\d{1,}))?)?(Z|(?:([-+])(\\d{2}):(\\d{2})))?)?)?)?$"), d = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365], e = function (a, b) { var c = b > 1 ? 1 : 0; return d[b] + Math.floor((a - 1969 + c) / 4) - Math.floor((a - 1901 + c) / 100) + Math.floor((a - 1601 + c) / 400) + 365 * (a - 1970) }, f = function (b) { var c = 0, d = b; if (kb && d > jb) { var e = Math.floor(d / jb) * jb, f = Math.floor(e / 1e3); c += f, d -= 1e3 * f } return j(new a(1970, 0, 1, 0, 0, c, d)) }; for (var g in a) O(a, g) && (b[g] = a[g]); J(b, { now: a.now, UTC: a.UTC }, !0), b.prototype = a.prototype, J(b.prototype, { constructor: b }, !0); var i = function (b) { var d = c.exec(b); if (d) { var g, h = j(d[1]), i = j(d[2] || 1) - 1, k = j(d[3] || 1) - 1, l = j(d[4] || 0), m = j(d[5] || 0), n = j(d[6] || 0), o = Math.floor(1e3 * j(d[7] || 0)), p = Boolean(d[4] && !d[8]), q = "-" === d[9] ? 1 : -1, r = j(d[10] || 0), s = j(d[11] || 0), t = m > 0 || n > 0 || o > 0; return (t ? 24 : 25) > l && 60 > m && 60 > n && 1e3 > o && i > -1 && 12 > i && 24 > r && 60 > s && k > -1 && k < e(h, i + 1) - e(h, i) && (g = 60 * (24 * (e(h, i) + k) + l + r * q), g = 1e3 * (60 * (g + m + s * q) + n) + o, p && (g = f(g)), g >= -864e13 && 864e13 >= g) ? g : NaN } return a.parse.apply(this, arguments) }; return J(b, { parse: i }), b }(Date) } Date.now || (Date.now = function () { return (new Date).getTime() }); var lb = k.toFixed && ("0.000" !== 8e-5.toFixed(3) || "1" !== .9.toFixed(0) || "1.25" !== 1.255.toFixed(2) || "1000000000000000128" !== 0xde0b6b3a7640080.toFixed(0)), mb = { base: 1e7, size: 6, data: [0, 0, 0, 0, 0, 0], multiply: function (a, b) { for (var c = -1, d = b; ++c < mb.size;)d += a * mb.data[c], mb.data[c] = d % mb.base, d = Math.floor(d / mb.base) }, divide: function (a) { for (var b = mb.size, c = 0; --b >= 0;)c += mb.data[b], mb.data[b] = Math.floor(c / a), c = c % a * mb.base }, numToString: function () { for (var a = mb.size, b = ""; --a >= 0;)if ("" !== b || 0 === a || 0 !== mb.data[a]) { var c = h(mb.data[a]); "" === b ? b = c : b += S("0000000", 0, 7 - c.length) + c } return b }, pow: function Gb(a, b, c) { return 0 === b ? c : b % 2 === 1 ? Gb(a, b - 1, c * a) : Gb(a * a, b / 2, c) }, log: function (a) { for (var b = 0, c = a; c >= 4096;)b += 12, c /= 4096; for (; c >= 2;)b += 1, c /= 2; return b } }, nb = function (a) { var b, c, d, e, f, g, i, k; if (b = j(a), b = L(b) ? 0 : Math.floor(b), 0 > b || b > 20) throw new RangeError("Number.toFixed called with invalid number of decimals"); if (c = j(this), L(c)) return "NaN"; if (-1e21 >= c || c >= 1e21) return h(c); if (d = "", 0 > c && (d = "-", c = -c), e = "0", c > 1e-21) if (f = mb.log(c * mb.pow(2, 69, 1)) - 69, g = 0 > f ? c * mb.pow(2, -f, 1) : c / mb.pow(2, f, 1), g *= 4503599627370496, f = 52 - f, f > 0) { for (mb.multiply(0, g), i = b; i >= 7;)mb.multiply(1e7, 0), i -= 7; for (mb.multiply(mb.pow(10, i, 1), 0), i = f - 1; i >= 23;)mb.divide(1 << 23), i -= 23; mb.divide(1 << i), mb.multiply(1, 1), mb.divide(2), e = mb.numToString() } else mb.multiply(0, g), mb.multiply(1 << -f, 0), e = mb.numToString() + S("0.00000000000000000000", 2, 2 + b); return b > 0 ? (k = e.length, e = b >= k ? d + S("0.0000000000000000000", 0, b - k + 2) + e : d + S(e, 0, k - b) + "." + S(e, k - b)) : e = d + e, e }; J(k, { toFixed: nb }, lb); var ob = function () { try { return "1" === 1..toPrecision(void 0) } catch (a) { return !0 } }(), pb = k.toPrecision; J(k, { toPrecision: function (a) { return "undefined" == typeof a ? pb.call(this) : pb.call(this, a) } }, ob), 2 !== "ab".split(/(?:ab)*/).length || 4 !== ".".split(/(.?)(.?)/).length || "t" === "tesst".split(/(s)*/)[1] || 4 !== "test".split(/(?:)/, -1).length || "".split(/.?/).length || ".".split(/()()/).length > 1 ? !function () { var a = "undefined" == typeof /()??/.exec("")[1], b = Math.pow(2, 32) - 1; i.split = function (c, d) { var e = String(this); if ("undefined" == typeof c && 0 === d) return []; if (!A(c)) return T(this, c, d); var f, g, h, i, j = [], k = (c.ignoreCase ? "i" : "") + (c.multiline ? "m" : "") + (c.unicode ? "u" : "") + (c.sticky ? "y" : ""), l = 0, m = new RegExp(c.source, k + "g"); a || (f = new RegExp("^" + m.source + "$(?!\\s)", k)); var o = "undefined" == typeof d ? b : M.ToUint32(d); for (g = m.exec(e); g && (h = g.index + g[0].length, !(h > l && (V(j, S(e, l, g.index)), !a && g.length > 1 && g[0].replace(f, function () { for (var a = 1; a < arguments.length - 2; a++)"undefined" == typeof arguments[a] && (g[a] = void 0) }), g.length > 1 && g.index < e.length && n.apply(j, Q(g, 1)), i = g[0].length, l = h, j.length >= o)));)m.lastIndex === g.index && m.lastIndex++, g = m.exec(e); return l === e.length ? (i || !m.test("")) && V(j, "") : V(j, S(e, l)), j.length > o ? S(j, 0, o) : j } }() : "0".split(void 0, 0).length && (i.split = function (a, b) { return "undefined" == typeof a && 0 === b ? [] : T(this, a, b) }); var qb = i.replace, rb = function () { var a = []; return "x".replace(/x(.)?/g, function (b, c) { V(a, c) }), 1 === a.length && "undefined" == typeof a[0] }(); rb || (i.replace = function (a, c) { var d = b(c), e = A(a) && /\)[*?]/.test(a.source); if (d && e) { var f = function (b) { var d = arguments.length, e = a.lastIndex; a.lastIndex = 0; var f = a.exec(b) || []; return a.lastIndex = e, V(f, arguments[d - 2], arguments[d - 1]), c.apply(this, f) }; return qb.call(this, a, f) } return qb.call(this, a, c) }); var sb = i.substr, tb = "".substr && "b" !== "0b".substr(-1); J(i, { substr: function (a, b) { var c = a; return 0 > a && (c = s(this.length + a, 0)), sb.call(this, c, b) } }, tb); var ub = " \n \f\r  ᠎              \u2028\u2029\ufeff", vb = "​", wb = "[" + ub + "]", xb = new RegExp("^" + wb + wb + "*"), yb = new RegExp(wb + wb + "*$"), zb = i.trim && (ub.trim() || !vb.trim()); J(i, { trim: function () { if ("undefined" == typeof this || null === this) throw new TypeError("can't convert " + this + " to object"); return h(this).replace(xb, "").replace(yb, "") } }, zb); var Ab = q.bind(String.prototype.trim), Bb = i.lastIndexOf && -1 !== "abcあい".lastIndexOf("あい", 2); J(i, { lastIndexOf: function (a) { if ("undefined" == typeof this || null === this) throw new TypeError("can't convert " + this + " to object"); for (var b = h(this), c = h(a), d = arguments.length > 1 ? j(arguments[1]) : NaN, e = L(d) ? 1 / 0 : M.ToInteger(d), f = t(s(e, 0), b.length), g = c.length, i = f + g; i > 0;) { i = s(0, i - g); var k = U(S(b, i, f + g), c); if (-1 !== k) return i + k } return -1 } }, Bb); var Cb = i.lastIndexOf; if (J(i, { lastIndexOf: function (a) { return Cb.apply(this, arguments) } }, 1 !== i.lastIndexOf.length), (8 !== parseInt(ub + "08") || 22 !== parseInt(ub + "0x16")) && (parseInt = function (a) { var b = /^[\-+]?0[xX]/; return function (c, d) { var e = Ab(c), f = j(d) || (b.test(e) ? 16 : 10); return a(e, f) } }(parseInt)), 1 / parseFloat("-0") !== -(1 / 0) && (parseFloat = function (a) { return function (b) { var c = Ab(b), d = a(c); return 0 === d && "-" === S(c, 0, 1) ? -0 : d } }(parseFloat)), "RangeError: test" !== String(new RangeError("test"))) { var Db = function () { if ("undefined" == typeof this || null === this) throw new TypeError("can't convert " + this + " to object"); var a = this.name; "undefined" == typeof a ? a = "Error" : "string" != typeof a && (a = h(a)); var b = this.message; return "undefined" == typeof b ? b = "" : "string" != typeof b && (b = h(b)), a ? b ? a + ": " + b : a : b }; Error.prototype.toString = Db } if (I) { var Eb = function (a, b) { if (W(a, b)) { var c = Object.getOwnPropertyDescriptor(a, b); c.enumerable = !1, Object.defineProperty(a, b, c) } }; Eb(Error.prototype, "message"), "" !== Error.prototype.message && (Error.prototype.message = ""), Eb(Error.prototype, "name") } if ("/a/gim" !== String(/a/gim)) { var Fb = function () { var a = "/" + this.source + "/"; return this.global && (a += "g"), this.ignoreCase && (a += "i"), this.multiline && (a += "m"), a }; RegExp.prototype.toString = Fb } }), function (a, b) { "use strict"; "function" == typeof define && define.amd ? define(b) : "object" == typeof exports ? module.exports = b() : a.returnExports = b() }(this, function () { var a, c, d, e, f = Function.call, g = Object.prototype, h = f.bind(g.hasOwnProperty), i = f.bind(g.propertyIsEnumerable), j = f.bind(g.toString), k = h(g, "__defineGetter__"); k && (a = f.bind(g.__defineGetter__), c = f.bind(g.__defineSetter__), d = f.bind(g.__lookupGetter__), e = f.bind(g.__lookupSetter__)), Object.getPrototypeOf || (Object.getPrototypeOf = function (a) { var b = a.__proto__; return b || null === b ? b : "[object Function]" === j(a.constructor) ? a.constructor.prototype : a instanceof Object ? g : null }); var l = function (a) { try { return a.sentinel = 0, 0 === Object.getOwnPropertyDescriptor(a, "sentinel").value } catch (b) { return !1 } }; if (Object.defineProperty) { var m = l({}), n = "undefined" == typeof b || l(b.createElement("div")); if (!n || !m) var o = Object.getOwnPropertyDescriptor } if (!Object.getOwnPropertyDescriptor || o) { var p = "Object.getOwnPropertyDescriptor called on a non-object: "; Object.getOwnPropertyDescriptor = function (a, b) { if ("object" != typeof a && "function" != typeof a || null === a) throw new TypeError(p + a); if (o) try { return o.call(Object, a, b) } catch (c) { } var f; if (!h(a, b)) return f; if (f = { enumerable: i(a, b), configurable: !0 }, k) { var j = a.__proto__, l = a !== g; l && (a.__proto__ = g); var m = d(a, b), n = e(a, b); if (l && (a.__proto__ = j), m || n) return m && (f.get = m), n && (f.set = n), f } return f.value = a[b], f.writable = !0, f } } if (Object.getOwnPropertyNames || (Object.getOwnPropertyNames = function (a) { return Object.keys(a) }), !Object.create) { var q, r = !({ __proto__: null } instanceof Object), s = function () { if (!b.domain) return !1; try { return !!new ActiveXObject("htmlfile") } catch (a) { return !1 } }, t = function () { var a, b; return b = new ActiveXObject("htmlfile"), b.write(""), b.close(), a = b.parentWindow.Object.prototype, b = null, a }, u = function () { var a, c = b.createElement("iframe"), d = b.body || b.documentElement; return c.style.display = "none", d.appendChild(c), c.src = "javascript:", a = c.contentWindow.Object.prototype, d.removeChild(c), c = null, a }; q = r || "undefined" == typeof b ? function () { return { __proto__: null } } : function () { var a = s() ? t() : u(); delete a.constructor, delete a.hasOwnProperty, delete a.propertyIsEnumerable, delete a.isPrototypeOf, delete a.toLocaleString, delete a.toString, delete a.valueOf; var b = function () { }; return b.prototype = a, q = function () { return new b }, new b }, Object.create = function (a, b) { var c, d = function () { }; if (null === a) c = q(); else { if ("object" != typeof a && "function" != typeof a) throw new TypeError("Object prototype may only be an Object or null"); d.prototype = a, c = new d, c.__proto__ = a } return void 0 !== b && Object.defineProperties(c, b), c } } var v = function (a) { try { return Object.defineProperty(a, "sentinel", {}), "sentinel" in a } catch (b) { return !1 } }; if (Object.defineProperty) { var w = v({}), x = "undefined" == typeof b || v(b.createElement("div")); if (!w || !x) var y = Object.defineProperty, z = Object.defineProperties } if (!Object.defineProperty || y) { var A = "Property description must be an object: ", B = "Object.defineProperty called on non-object: ", C = "getters & setters can not be defined on this javascript engine"; Object.defineProperty = function (b, f, h) { if ("object" != typeof b && "function" != typeof b || null === b) throw new TypeError(B + b); if ("object" != typeof h && "function" != typeof h || null === h) throw new TypeError(A + h); if (y) try { return y.call(Object, b, f, h) } catch (i) { } if ("value" in h) if (k && (d(b, f) || e(b, f))) { var j = b.__proto__; b.__proto__ = g, delete b[f], b[f] = h.value, b.__proto__ = j } else b[f] = h.value; else { if (!k && ("get" in h || "set" in h)) throw new TypeError(C); "get" in h && a(b, f, h.get), "set" in h && c(b, f, h.set) } return b } } (!Object.defineProperties || z) && (Object.defineProperties = function (a, b) { if (z) try { return z.call(Object, a, b) } catch (c) { } return Object.keys(b).forEach(function (c) { "__proto__" !== c && Object.defineProperty(a, c, b[c]) }), a }), Object.seal || (Object.seal = function (a) { if (Object(a) !== a) throw new TypeError("Object.seal can only be called on Objects."); return a }), Object.freeze || (Object.freeze = function (a) { if (Object(a) !== a) throw new TypeError("Object.freeze can only be called on Objects."); return a }); try { Object.freeze(function () { }) } catch (D) { Object.freeze = function (a) { return function (b) { return "function" == typeof b ? b : a(b) } }(Object.freeze) } Object.preventExtensions || (Object.preventExtensions = function (a) { if (Object(a) !== a) throw new TypeError("Object.preventExtensions can only be called on Objects."); return a }), Object.isSealed || (Object.isSealed = function (a) { if (Object(a) !== a) throw new TypeError("Object.isSealed can only be called on Objects."); return !1 }), Object.isFrozen || (Object.isFrozen = function (a) { if (Object(a) !== a) throw new TypeError("Object.isFrozen can only be called on Objects."); return !1 }), Object.isExtensible || (Object.isExtensible = function (a) { if (Object(a) !== a) throw new TypeError("Object.isExtensible can only be called on Objects."); for (var b = ""; h(a, b);)b += "?"; a[b] = !0; var c = h(a, b); return delete a[b], c }) }) }(window, document); \ No newline at end of file diff --git a/Model/CRoom.cs b/Model/CRoom.cs new file mode 100644 index 0000000..ec85e1a --- /dev/null +++ b/Model/CRoom.cs @@ -0,0 +1,37 @@ +using System; + +namespace NP.Model +{ + /// + /// 강의실 과제제출 정보 + /// + public class CRoomLectSdInfo + { + /// 수강번호(수강키) + public int lectno { get; set; } + /// 회원번호 + public int userno { get; set; } + /// 과제토론명 + public string sdname { get; set; } + /// 과제토론키 + public int sdno { get; set; } + /// 온라인강좌 수강시작일 + public DateTime sdate { get; set; } + /// 온라인강좌 수강종료일 + public DateTime edate { get; set; } + /// 출석율(%) + public int attrate { get; set; } + /// 과제토론 참여조건 + public byte sdcondition { get; set; } + /// 과제토론 제출여부 + public bool issubmit { get; set; } + /// 과제토론 제출일시 + public DateTime submittime { get; set; } + /// 과제토론 평가여부 + public bool ischeck { get; set; } + /// 과제토론 평가일시 + public DateTime checktime { get; set; } + /// 현재 기간내 수강여부 + public bool iscurrentlecture { get; set; } + } +} \ No newline at end of file diff --git a/Model/Model.csproj b/Model/Model.csproj index fe2e421..482f89c 100644 --- a/Model/Model.csproj +++ b/Model/Model.csproj @@ -45,6 +45,7 @@ + diff --git a/Model/VMMy.cs b/Model/VMMy.cs index c07df58..3255fa1 100644 --- a/Model/VMMy.cs +++ b/Model/VMMy.cs @@ -25,5 +25,7 @@ namespace NP.Model public Users User { get; set; } public IList CMs { get; set; } public CM cmm { get; set; } + + public IList CRoomLectSdInfo { get; set; } } }
    @@ -103,8 +104,9 @@ { preflag = 1; } + //학습기간 종료후에도 시청은 가능하고, 출석인정은 되지않도록 변경 2021-01-25 - 학습하기 + 학습하기 } @@ -187,75 +189,101 @@ + @Html.Partial("./Partial/MobileChk", null, new ViewDataDictionary { { "bindmethod", "cbchkmobile" } }) @Html.Partial("./Partial/OkCert3", null, new ViewDataDictionary { }) + @section scriptsHeader{ - - + + } + @section scripts{ +@section scriptsHeader{ + ").appendTo(o)), a.opacity && (this.helper.css("opacity") && (this._storedOpacity = this.helper.css("opacity")), this.helper.css("opacity", a.opacity)), a.zIndex && (this.helper.css("zIndex") && (this._storedZIndex = this.helper.css("zIndex")), this.helper.css("zIndex", a.zIndex)), this.scrollParent[0] !== this.document[0] && "HTML" !== this.scrollParent[0].tagName && (this.overflowOffset = this.scrollParent.offset()), this._trigger("start", e, this._uiHash()), this._preserveHelperProportions || this._cacheHelperProportions(), !s) for (n = this.containers.length - 1; n >= 0; n--)this.containers[n]._trigger("activate", e, this._uiHash(this)); return t.ui.ddmanager && (t.ui.ddmanager.current = this), t.ui.ddmanager && !a.dropBehaviour && t.ui.ddmanager.prepareOffsets(this, e), this.dragging = !0, this._addClass(this.helper, "ui-sortable-helper"), this._mouseDrag(e), !0 }, _mouseDrag: function (e) { var i, s, n, o, a = this.options, r = !1; for (this.position = this._generatePosition(e), this.positionAbs = this._convertPositionTo("absolute"), this.lastPositionAbs || (this.lastPositionAbs = this.positionAbs), this.options.scroll && (this.scrollParent[0] !== this.document[0] && "HTML" !== this.scrollParent[0].tagName ? (this.overflowOffset.top + this.scrollParent[0].offsetHeight - e.pageY < a.scrollSensitivity ? this.scrollParent[0].scrollTop = r = this.scrollParent[0].scrollTop + a.scrollSpeed : e.pageY - this.overflowOffset.top < a.scrollSensitivity && (this.scrollParent[0].scrollTop = r = this.scrollParent[0].scrollTop - a.scrollSpeed), this.overflowOffset.left + this.scrollParent[0].offsetWidth - e.pageX < a.scrollSensitivity ? this.scrollParent[0].scrollLeft = r = this.scrollParent[0].scrollLeft + a.scrollSpeed : e.pageX - this.overflowOffset.left < a.scrollSensitivity && (this.scrollParent[0].scrollLeft = r = this.scrollParent[0].scrollLeft - a.scrollSpeed)) : (e.pageY - this.document.scrollTop() < a.scrollSensitivity ? r = this.document.scrollTop(this.document.scrollTop() - a.scrollSpeed) : this.window.height() - (e.pageY - this.document.scrollTop()) < a.scrollSensitivity && (r = this.document.scrollTop(this.document.scrollTop() + a.scrollSpeed)), e.pageX - this.document.scrollLeft() < a.scrollSensitivity ? r = this.document.scrollLeft(this.document.scrollLeft() - a.scrollSpeed) : this.window.width() - (e.pageX - this.document.scrollLeft()) < a.scrollSensitivity && (r = this.document.scrollLeft(this.document.scrollLeft() + a.scrollSpeed))), r !== !1 && t.ui.ddmanager && !a.dropBehaviour && t.ui.ddmanager.prepareOffsets(this, e)), this.positionAbs = this._convertPositionTo("absolute"), this.options.axis && "y" === this.options.axis || (this.helper[0].style.left = this.position.left + "px"), this.options.axis && "x" === this.options.axis || (this.helper[0].style.top = this.position.top + "px"), i = this.items.length - 1; i >= 0; i--)if (s = this.items[i], n = s.item[0], o = this._intersectsWithPointer(s), o && s.instance === this.currentContainer && n !== this.currentItem[0] && this.placeholder[1 === o ? "next" : "prev"]()[0] !== n && !t.contains(this.placeholder[0], n) && ("semi-dynamic" === this.options.type ? !t.contains(this.element[0], n) : !0)) { if (this.direction = 1 === o ? "down" : "up", "pointer" !== this.options.tolerance && !this._intersectsWithSides(s)) break; this._rearrange(e, s), this._trigger("change", e, this._uiHash()); break } return this._contactContainers(e), t.ui.ddmanager && t.ui.ddmanager.drag(this, e), this._trigger("sort", e, this._uiHash()), this.lastPositionAbs = this.positionAbs, !1 }, _mouseStop: function (e, i) { if (e) { if (t.ui.ddmanager && !this.options.dropBehaviour && t.ui.ddmanager.drop(this, e), this.options.revert) { var s = this, n = this.placeholder.offset(), o = this.options.axis, a = {}; o && "x" !== o || (a.left = n.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollLeft)), o && "y" !== o || (a.top = n.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollTop)), this.reverting = !0, t(this.helper).animate(a, parseInt(this.options.revert, 10) || 500, function () { s._clear(e) }) } else this._clear(e, i); return !1 } }, cancel: function () { if (this.dragging) { this._mouseUp(new t.Event("mouseup", { target: null })), "original" === this.options.helper ? (this.currentItem.css(this._storedCSS), this._removeClass(this.currentItem, "ui-sortable-helper")) : this.currentItem.show(); for (var e = this.containers.length - 1; e >= 0; e--)this.containers[e]._trigger("deactivate", null, this._uiHash(this)), this.containers[e].containerCache.over && (this.containers[e]._trigger("out", null, this._uiHash(this)), this.containers[e].containerCache.over = 0) } return this.placeholder && (this.placeholder[0].parentNode && this.placeholder[0].parentNode.removeChild(this.placeholder[0]), "original" !== this.options.helper && this.helper && this.helper[0].parentNode && this.helper.remove(), t.extend(this, { helper: null, dragging: !1, reverting: !1, _noFinalSort: null }), this.domPosition.prev ? t(this.domPosition.prev).after(this.currentItem) : t(this.domPosition.parent).prepend(this.currentItem)), this }, serialize: function (e) { var i = this._getItemsAsjQuery(e && e.connected), s = []; return e = e || {}, t(i).each(function () { var i = (t(e.item || this).attr(e.attribute || "id") || "").match(e.expression || /(.+)[\-=_](.+)/); i && s.push((e.key || i[1] + "[]") + "=" + (e.key && e.expression ? i[1] : i[2])) }), !s.length && e.key && s.push(e.key + "="), s.join("&") }, toArray: function (e) { var i = this._getItemsAsjQuery(e && e.connected), s = []; return e = e || {}, i.each(function () { s.push(t(e.item || this).attr(e.attribute || "id") || "") }), s }, _intersectsWith: function (t) { var e = this.positionAbs.left, i = e + this.helperProportions.width, s = this.positionAbs.top, n = s + this.helperProportions.height, o = t.left, a = o + t.width, r = t.top, h = r + t.height, l = this.offset.click.top, c = this.offset.click.left, u = "x" === this.options.axis || s + l > r && h > s + l, d = "y" === this.options.axis || e + c > o && a > e + c, p = u && d; return "pointer" === this.options.tolerance || this.options.forcePointerForContainers || "pointer" !== this.options.tolerance && this.helperProportions[this.floating ? "width" : "height"] > t[this.floating ? "width" : "height"] ? p : e + this.helperProportions.width / 2 > o && a > i - this.helperProportions.width / 2 && s + this.helperProportions.height / 2 > r && h > n - this.helperProportions.height / 2 }, _intersectsWithPointer: function (t) { var e, i, s = "x" === this.options.axis || this._isOverAxis(this.positionAbs.top + this.offset.click.top, t.top, t.height), n = "y" === this.options.axis || this._isOverAxis(this.positionAbs.left + this.offset.click.left, t.left, t.width), o = s && n; return o ? (e = this._getDragVerticalDirection(), i = this._getDragHorizontalDirection(), this.floating ? "right" === i || "down" === e ? 2 : 1 : e && ("down" === e ? 2 : 1)) : !1 }, _intersectsWithSides: function (t) { var e = this._isOverAxis(this.positionAbs.top + this.offset.click.top, t.top + t.height / 2, t.height), i = this._isOverAxis(this.positionAbs.left + this.offset.click.left, t.left + t.width / 2, t.width), s = this._getDragVerticalDirection(), n = this._getDragHorizontalDirection(); return this.floating && n ? "right" === n && i || "left" === n && !i : s && ("down" === s && e || "up" === s && !e) }, _getDragVerticalDirection: function () { var t = this.positionAbs.top - this.lastPositionAbs.top; return 0 !== t && (t > 0 ? "down" : "up") }, _getDragHorizontalDirection: function () { var t = this.positionAbs.left - this.lastPositionAbs.left; return 0 !== t && (t > 0 ? "right" : "left") }, refresh: function (t) { return this._refreshItems(t), this._setHandleClassName(), this.refreshPositions(), this }, _connectWith: function () { var t = this.options; return t.connectWith.constructor === String ? [t.connectWith] : t.connectWith }, _getItemsAsjQuery: function (e) { function i() { r.push(this) } var s, n, o, a, r = [], h = [], l = this._connectWith(); if (l && e) for (s = l.length - 1; s >= 0; s--)for (o = t(l[s], this.document[0]), n = o.length - 1; n >= 0; n--)a = t.data(o[n], this.widgetFullName), a && a !== this && !a.options.disabled && h.push([t.isFunction(a.options.items) ? a.options.items.call(a.element) : t(a.options.items, a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), a]); for (h.push([t.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : t(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]), s = h.length - 1; s >= 0; s--)h[s][0].each(i); return t(r) }, _removeCurrentsFromItems: function () { var e = this.currentItem.find(":data(" + this.widgetName + "-item)"); this.items = t.grep(this.items, function (t) { for (var i = 0; e.length > i; i++)if (e[i] === t.item[0]) return !1; return !0 }) }, _refreshItems: function (e) { this.items = [], this.containers = [this]; var i, s, n, o, a, r, h, l, c = this.items, u = [[t.isFunction(this.options.items) ? this.options.items.call(this.element[0], e, { item: this.currentItem }) : t(this.options.items, this.element), this]], d = this._connectWith(); if (d && this.ready) for (i = d.length - 1; i >= 0; i--)for (n = t(d[i], this.document[0]), s = n.length - 1; s >= 0; s--)o = t.data(n[s], this.widgetFullName), o && o !== this && !o.options.disabled && (u.push([t.isFunction(o.options.items) ? o.options.items.call(o.element[0], e, { item: this.currentItem }) : t(o.options.items, o.element), o]), this.containers.push(o)); for (i = u.length - 1; i >= 0; i--)for (a = u[i][1], r = u[i][0], s = 0, l = r.length; l > s; s++)h = t(r[s]), h.data(this.widgetName + "-item", a), c.push({ item: h, instance: a, width: 0, height: 0, left: 0, top: 0 }) }, refreshPositions: function (e) { this.floating = this.items.length ? "x" === this.options.axis || this._isFloating(this.items[0].item) : !1, this.offsetParent && this.helper && (this.offset.parent = this._getParentOffset()); var i, s, n, o; for (i = this.items.length - 1; i >= 0; i--)s = this.items[i], s.instance !== this.currentContainer && this.currentContainer && s.item[0] !== this.currentItem[0] || (n = this.options.toleranceElement ? t(this.options.toleranceElement, s.item) : s.item, e || (s.width = n.outerWidth(), s.height = n.outerHeight()), o = n.offset(), s.left = o.left, s.top = o.top); if (this.options.custom && this.options.custom.refreshContainers) this.options.custom.refreshContainers.call(this); else for (i = this.containers.length - 1; i >= 0; i--)o = this.containers[i].element.offset(), this.containers[i].containerCache.left = o.left, this.containers[i].containerCache.top = o.top, this.containers[i].containerCache.width = this.containers[i].element.outerWidth(), this.containers[i].containerCache.height = this.containers[i].element.outerHeight(); return this }, _createPlaceholder: function (e) { e = e || this; var i, s = e.options; s.placeholder && s.placeholder.constructor !== String || (i = s.placeholder, s.placeholder = { element: function () { var s = e.currentItem[0].nodeName.toLowerCase(), n = t("<" + s + ">", e.document[0]); return e._addClass(n, "ui-sortable-placeholder", i || e.currentItem[0].className)._removeClass(n, "ui-sortable-helper"), "tbody" === s ? e._createTrPlaceholder(e.currentItem.find("tr").eq(0), t("