From 5597f7b984a12cbc46c67b16e6c2468f20c71c08 Mon Sep 17 00:00:00 2001 From: Sangwon Oh Date: Thu, 22 Dec 2022 17:10:44 +0900 Subject: [PATCH] Add HLS DVR feature In case of HLS Live Stream, it is possible to control the playback position with the Seek Bar. Added live catch-up function when HLS live stream. --- dist/ovenplayer.js | 2 +- dist/ovenplayer.js.map | 2 +- package.json | 2 +- src/js/api/Api.js | 225 ++++++++++++------ src/js/api/provider/html5/providers/Hls.js | 4 +- src/js/view/components/controls/main.js | 18 +- .../view/components/controls/progressBar.js | 135 ++++++----- .../view/components/controls/timeDisplay.js | 63 +++-- .../controls/timeDisplayTemplate.js | 2 +- src/stylesheet/ovenplayer.less | 9 + 10 files changed, 293 insertions(+), 169 deletions(-) diff --git a/dist/ovenplayer.js b/dist/ovenplayer.js index 3e47e563..89b0c114 100644 --- a/dist/ovenplayer.js +++ b/dist/ovenplayer.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.OvenPlayer=t():e.OvenPlayer=t()}(self,(function(){return function(){var e={6757:function(e,t,n){"use strict";n.d(t,{default:function(){return ar}});var r="0.10.23",o=n(741),i=n.n(o);function A(e){return e?e.replace(/^\s+|\s+$/g,""):""}var a=function(e){return e&&"rtmp"!=e.substr(0,4)?function(e){var t="";return/[(,]format=mpd-/i.test(e)?t="mpd":/[(,]format=m3u8-/i.test(e)&&(t="m3u8"),t}(e)||((e=e.split("?")[0].split("#")[0]).lastIndexOf(".")>-1?e.substr(e.lastIndexOf(".")+1,e.length).toLowerCase():""):""};function s(e){var t=parseInt(e,10);if(!e)return"00:00";var n=Math.floor(t/3600),r=Math.floor((t-3600*n)/60),o=t-3600*n-60*r;return r<10&&(r="0"+r),o<10&&(o="0"+o),n>0?n+":"+r+":"+o:r+":"+o}function l(e,t){if(!e)return 0;if(i().isNumber(e)&&!i().isNaN(e))return e;var n=(e=e.replace(",",".")).split(":"),r=n.length,o=0;if("s"===e.slice(-1))o=parseFloat(e);else if("m"===e.slice(-1))o=60*parseFloat(e);else if("h"===e.slice(-1))o=3600*parseFloat(e);else if(r>1){var A=r-1;4===r&&(t&&(o=parseFloat(n[A])/t),A-=1),o+=parseFloat(n[A]),o+=60*parseFloat(n[A-1]),r>=3&&(o+=3600*parseFloat(n[A-2]))}else o=parseFloat(e);return i().isNaN(o)?0:o}function c(e){var t={},n=e.split("\r\n");1===n.length&&(n=e.split("\n"));var r=1;if(n[0].indexOf(" --\x3e ")>0&&(r=0),n.length>r+1&&n[r+1]){var o=n[r],i=o.indexOf(" --\x3e ");i>0&&(t.start=l(o.substr(0,i)),t.end=l(o.substr(i+5)),t.text=n.slice(r+1).join("\r\n"))}return t}var u=window.VTTCue,f={"":!0,lr:!0,rl:!0},p={start:!0,middle:!0,end:!0,left:!0,right:!0};function d(e){return"string"==typeof e&&!!p[e.toLowerCase()]&&e.toLowerCase()}function g(e){for(var t=1;t100)throw new Error("Position must be between 0 and 100.");C=e,this.hasBeenReset=!0}})),Object.defineProperty(r,"positionAlign",g({},i,{get:function(){return y},set:function(e){var t=d(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");y=t,this.hasBeenReset=!0}})),Object.defineProperty(r,"size",g({},i,{get:function(){return b},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");b=e,this.hasBeenReset=!0}})),Object.defineProperty(r,"align",g({},i,{get:function(){return w},set:function(e){var t=d(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");w=t,this.hasBeenReset=!0}})),r.displayState=void 0,o)return r}).prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)});var h=u,v={"":!0,up:!0};function m(e){return"number"==typeof e&&e>=0&&e<=100}var C=function(){var e=100,t=3,n=0,r=100,o=0,i=100,A="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!m(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return r},set:function(e){if(!m(e))throw new Error("RegionAnchorX must be between 0 and 100.");r=e}},regionAnchorX:{enumerable:!0,get:function(){return n},set:function(e){if(!m(e))throw new Error("RegionAnchorY must be between 0 and 100.");n=e}},viewportAnchorY:{enumerable:!0,get:function(){return i},set:function(e){if(!m(e))throw new Error("ViewportAnchorY must be between 0 and 100.");i=e}},viewportAnchorX:{enumerable:!0,get:function(){return o},set:function(e){if(!m(e))throw new Error("ViewportAnchorX must be between 0 and 100.");o=e}},scroll:{enumerable:!0,get:function(){return A},set:function(e){var t=function(e){return"string"==typeof e&&!!v[e.toLowerCase()]&&e.toLowerCase()}(e);if(!1===t)throw new SyntaxError("An invalid or illegal string was specified.");A=t}}})},y=function(){};function b(e,t){return void 0===t&&(t=1),"rgba("+[parseInt(e.substring(0,2),16),parseInt(e.substring(2,4),16),parseInt(e.substring(4,6),16),t].join(",")+")"}var w=1;function E(e,t,n){switch(n){case"webvtt.font.color":case"webvtt.font.opacity":var r=Services.prefs.getCharPref("webvtt.font.color"),o=Services.prefs.getIntPref("webvtt.font.opacity")/100;B.fontSet=b(r,o);break;case"webvtt.font.scale":w=Services.prefs.getIntPref("webvtt.font.scale")/100;break;case"webvtt.bg.color":case"webvtt.bg.opacity":var i=Services.prefs.getCharPref("webvtt.bg.color"),A=Services.prefs.getIntPref("webvtt.bg.opacity")/100;B.backgroundSet=b(i,A);break;case"webvtt.edge.color":case"webvtt.edge.type":var a=Services.prefs.getIntPref("webvtt.edge.type"),s=Services.prefs.getCharPref("webvtt.edge.color");B.edgeSet=["","0px 0px ","4px 4px 4px ","-2px -2px ","2px 2px "][a]+b(s)}}if("undefined"!=typeof Services){var B={};["webvtt.font.color","webvtt.font.opacity","webvtt.font.scale","webvtt.bg.color","webvtt.bg.opacity","webvtt.edge.color","webvtt.edge.type"].forEach((function(e){E(0,0,e),Services.prefs.addObserver(e,E,!1)}))}var x=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function k(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function I(e){function t(e,t,n,r){return 3600*(0|e)+60*(0|t)+(0|n)+(0|r)/1e3}var n=e.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return n?n[3]?t(n[1],n[2],n[3].replace(":",""),n[4]):n[1]>59?t(n[1],n[2],0,n[4]):t(0,n[1],n[2],n[4]):null}function S(){this.values=x(null)}function T(e,t,n,r){var o=r?e.split(r):[e];for(var i in o)if("string"==typeof o[i]){var A=o[i].split(n);2===A.length&&t(A[0],A[1])}}function L(e,t,n){var r=e;function o(){var t=I(e);if(null===t)throw new k(k.Errors.BadTimeStamp,"Malformed timestamp: "+r);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function i(){e=e.replace(/^\s+/,"")}if(i(),t.startTime=o(),i(),"--\x3e"!==e.substr(0,3))throw new k(k.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+r);e=e.substr(3),i(),t.endTime=o(),i(),function(e,t){var r=new S;T(e,(function(e,t){switch(e){case"region":for(var o=n.length-1;o>=0;o--)if(n[o].id===t){r.set(e,n[o].region);break}break;case"vertical":r.alt(e,t,["rl","lr"]);break;case"line":var i=t.split(","),A=i[0];r.integer(e,A),r.percent(e,A)&&r.set("snapToLines",!1),r.alt(e,A,["auto"]),2===i.length&&r.alt("lineAlign",i[1],["start","middle","end"]);break;case"position":i=t.split(","),r.percent(e,i[0]),2===i.length&&r.alt("positionAlign",i[1],["start","middle","end"]);break;case"size":r.percent(e,t);break;case"align":r.alt(e,t,["start","middle","end","left","right"])}}),/:/,/\s/)}(e)}k.prototype=x(Error.prototype),k.prototype.constructor=k,k.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},S.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,n){for(var r=0;r=0&&t<=100)&&(this.set(e,t),!0)}};var R={"&":"&","<":"<",">":">","‎":"‎","‏":"‏"," ":" "},Q={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},M={v:"title",lang:"lang"},O={rt:"ruby"};function D(e,t){function n(){if(!t)return null;var e,n=t.match(/^([^<]*)(<[^>]+>?)?/);return e=n[1]?n[1]:n[2],t=t.substr(e.length),e}function r(e){return R[e]}function o(e){for(;p=e.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)e=e.replace(p[0],r);return e}function i(e,t){return!O[t.localName]||O[t.localName]===e.localName}function A(t,n){var r=Q[t];if(!r)return null;var o=e.document.createElement(r);o.localName=r;var i=M[t];return i&&n&&(o[i]=n.trim()),o}for(var a,s=e.document.createElement("div"),l=s,c=[];null!==(a=n());)if("<"!==a[0])l.appendChild(e.document.createTextNode(o(a)));else{if("/"===a[1]){c.length&&c[c.length-1]===a.substr(2).replace(">","")&&(c.pop(),l=l.parentNode);continue}var u,f=I(a.substr(1,a.length-2));if(f){u=e.document.createProcessingInstruction("timestamp",f),l.appendChild(u);continue}var p=a.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!p)continue;if(!(u=A(p[1],p[3])))continue;if(!i(l,u))continue;p[2]&&(u.className=p[2].substr(1).replace("."," ")),c.push(p[1]),l.appendChild(u),l=u}return s}var F=[1470,1472,1475,1478,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,1520,1521,1522,1523,1524,1544,1547,1549,1563,1566,1567,1568,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,1595,1596,1597,1598,1599,1600,1601,1602,1603,1604,1605,1606,1607,1608,1609,1610,1645,1646,1647,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1669,1670,1671,1672,1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703,1704,1705,1706,1707,1708,1709,1710,1711,1712,1713,1714,1715,1716,1717,1718,1719,1720,1721,1722,1723,1724,1725,1726,1727,1728,1729,1730,1731,1732,1733,1734,1735,1736,1737,1738,1739,1740,1741,1742,1743,1744,1745,1746,1747,1748,1749,1765,1766,1774,1775,1786,1787,1788,1789,1790,1791,1792,1793,1794,1795,1796,1797,1798,1799,1800,1801,1802,1803,1804,1805,1807,1808,1810,1811,1812,1813,1814,1815,1816,1817,1818,1819,1820,1821,1822,1823,1824,1825,1826,1827,1828,1829,1830,1831,1832,1833,1834,1835,1836,1837,1838,1839,1869,1870,1871,1872,1873,1874,1875,1876,1877,1878,1879,1880,1881,1882,1883,1884,1885,1886,1887,1888,1889,1890,1891,1892,1893,1894,1895,1896,1897,1898,1899,1900,1901,1902,1903,1904,1905,1906,1907,1908,1909,1910,1911,1912,1913,1914,1915,1916,1917,1918,1919,1920,1921,1922,1923,1924,1925,1926,1927,1928,1929,1930,1931,1932,1933,1934,1935,1936,1937,1938,1939,1940,1941,1942,1943,1944,1945,1946,1947,1948,1949,1950,1951,1952,1953,1954,1955,1956,1957,1969,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2e3,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2036,2037,2042,2048,2049,2050,2051,2052,2053,2054,2055,2056,2057,2058,2059,2060,2061,2062,2063,2064,2065,2066,2067,2068,2069,2074,2084,2088,2096,2097,2098,2099,2100,2101,2102,2103,2104,2105,2106,2107,2108,2109,2110,2112,2113,2114,2115,2116,2117,2118,2119,2120,2121,2122,2123,2124,2125,2126,2127,2128,2129,2130,2131,2132,2133,2134,2135,2136,2142,2208,2210,2211,2212,2213,2214,2215,2216,2217,2218,2219,2220,8207,64285,64287,64288,64289,64290,64291,64292,64293,64294,64295,64296,64298,64299,64300,64301,64302,64303,64304,64305,64306,64307,64308,64309,64310,64312,64313,64314,64315,64316,64318,64320,64321,64323,64324,64326,64327,64328,64329,64330,64331,64332,64333,64334,64335,64336,64337,64338,64339,64340,64341,64342,64343,64344,64345,64346,64347,64348,64349,64350,64351,64352,64353,64354,64355,64356,64357,64358,64359,64360,64361,64362,64363,64364,64365,64366,64367,64368,64369,64370,64371,64372,64373,64374,64375,64376,64377,64378,64379,64380,64381,64382,64383,64384,64385,64386,64387,64388,64389,64390,64391,64392,64393,64394,64395,64396,64397,64398,64399,64400,64401,64402,64403,64404,64405,64406,64407,64408,64409,64410,64411,64412,64413,64414,64415,64416,64417,64418,64419,64420,64421,64422,64423,64424,64425,64426,64427,64428,64429,64430,64431,64432,64433,64434,64435,64436,64437,64438,64439,64440,64441,64442,64443,64444,64445,64446,64447,64448,64449,64467,64468,64469,64470,64471,64472,64473,64474,64475,64476,64477,64478,64479,64480,64481,64482,64483,64484,64485,64486,64487,64488,64489,64490,64491,64492,64493,64494,64495,64496,64497,64498,64499,64500,64501,64502,64503,64504,64505,64506,64507,64508,64509,64510,64511,64512,64513,64514,64515,64516,64517,64518,64519,64520,64521,64522,64523,64524,64525,64526,64527,64528,64529,64530,64531,64532,64533,64534,64535,64536,64537,64538,64539,64540,64541,64542,64543,64544,64545,64546,64547,64548,64549,64550,64551,64552,64553,64554,64555,64556,64557,64558,64559,64560,64561,64562,64563,64564,64565,64566,64567,64568,64569,64570,64571,64572,64573,64574,64575,64576,64577,64578,64579,64580,64581,64582,64583,64584,64585,64586,64587,64588,64589,64590,64591,64592,64593,64594,64595,64596,64597,64598,64599,64600,64601,64602,64603,64604,64605,64606,64607,64608,64609,64610,64611,64612,64613,64614,64615,64616,64617,64618,64619,64620,64621,64622,64623,64624,64625,64626,64627,64628,64629,64630,64631,64632,64633,64634,64635,64636,64637,64638,64639,64640,64641,64642,64643,64644,64645,64646,64647,64648,64649,64650,64651,64652,64653,64654,64655,64656,64657,64658,64659,64660,64661,64662,64663,64664,64665,64666,64667,64668,64669,64670,64671,64672,64673,64674,64675,64676,64677,64678,64679,64680,64681,64682,64683,64684,64685,64686,64687,64688,64689,64690,64691,64692,64693,64694,64695,64696,64697,64698,64699,64700,64701,64702,64703,64704,64705,64706,64707,64708,64709,64710,64711,64712,64713,64714,64715,64716,64717,64718,64719,64720,64721,64722,64723,64724,64725,64726,64727,64728,64729,64730,64731,64732,64733,64734,64735,64736,64737,64738,64739,64740,64741,64742,64743,64744,64745,64746,64747,64748,64749,64750,64751,64752,64753,64754,64755,64756,64757,64758,64759,64760,64761,64762,64763,64764,64765,64766,64767,64768,64769,64770,64771,64772,64773,64774,64775,64776,64777,64778,64779,64780,64781,64782,64783,64784,64785,64786,64787,64788,64789,64790,64791,64792,64793,64794,64795,64796,64797,64798,64799,64800,64801,64802,64803,64804,64805,64806,64807,64808,64809,64810,64811,64812,64813,64814,64815,64816,64817,64818,64819,64820,64821,64822,64823,64824,64825,64826,64827,64828,64829,64848,64849,64850,64851,64852,64853,64854,64855,64856,64857,64858,64859,64860,64861,64862,64863,64864,64865,64866,64867,64868,64869,64870,64871,64872,64873,64874,64875,64876,64877,64878,64879,64880,64881,64882,64883,64884,64885,64886,64887,64888,64889,64890,64891,64892,64893,64894,64895,64896,64897,64898,64899,64900,64901,64902,64903,64904,64905,64906,64907,64908,64909,64910,64911,64914,64915,64916,64917,64918,64919,64920,64921,64922,64923,64924,64925,64926,64927,64928,64929,64930,64931,64932,64933,64934,64935,64936,64937,64938,64939,64940,64941,64942,64943,64944,64945,64946,64947,64948,64949,64950,64951,64952,64953,64954,64955,64956,64957,64958,64959,64960,64961,64962,64963,64964,64965,64966,64967,65008,65009,65010,65011,65012,65013,65014,65015,65016,65017,65018,65019,65020,65136,65137,65138,65139,65140,65142,65143,65144,65145,65146,65147,65148,65149,65150,65151,65152,65153,65154,65155,65156,65157,65158,65159,65160,65161,65162,65163,65164,65165,65166,65167,65168,65169,65170,65171,65172,65173,65174,65175,65176,65177,65178,65179,65180,65181,65182,65183,65184,65185,65186,65187,65188,65189,65190,65191,65192,65193,65194,65195,65196,65197,65198,65199,65200,65201,65202,65203,65204,65205,65206,65207,65208,65209,65210,65211,65212,65213,65214,65215,65216,65217,65218,65219,65220,65221,65222,65223,65224,65225,65226,65227,65228,65229,65230,65231,65232,65233,65234,65235,65236,65237,65238,65239,65240,65241,65242,65243,65244,65245,65246,65247,65248,65249,65250,65251,65252,65253,65254,65255,65256,65257,65258,65259,65260,65261,65262,65263,65264,65265,65266,65267,65268,65269,65270,65271,65272,65273,65274,65275,65276,67584,67585,67586,67587,67588,67589,67592,67594,67595,67596,67597,67598,67599,67600,67601,67602,67603,67604,67605,67606,67607,67608,67609,67610,67611,67612,67613,67614,67615,67616,67617,67618,67619,67620,67621,67622,67623,67624,67625,67626,67627,67628,67629,67630,67631,67632,67633,67634,67635,67636,67637,67639,67640,67644,67647,67648,67649,67650,67651,67652,67653,67654,67655,67656,67657,67658,67659,67660,67661,67662,67663,67664,67665,67666,67667,67668,67669,67671,67672,67673,67674,67675,67676,67677,67678,67679,67840,67841,67842,67843,67844,67845,67846,67847,67848,67849,67850,67851,67852,67853,67854,67855,67856,67857,67858,67859,67860,67861,67862,67863,67864,67865,67866,67867,67872,67873,67874,67875,67876,67877,67878,67879,67880,67881,67882,67883,67884,67885,67886,67887,67888,67889,67890,67891,67892,67893,67894,67895,67896,67897,67903,67968,67969,67970,67971,67972,67973,67974,67975,67976,67977,67978,67979,67980,67981,67982,67983,67984,67985,67986,67987,67988,67989,67990,67991,67992,67993,67994,67995,67996,67997,67998,67999,68e3,68001,68002,68003,68004,68005,68006,68007,68008,68009,68010,68011,68012,68013,68014,68015,68016,68017,68018,68019,68020,68021,68022,68023,68030,68031,68096,68112,68113,68114,68115,68117,68118,68119,68121,68122,68123,68124,68125,68126,68127,68128,68129,68130,68131,68132,68133,68134,68135,68136,68137,68138,68139,68140,68141,68142,68143,68144,68145,68146,68147,68160,68161,68162,68163,68164,68165,68166,68167,68176,68177,68178,68179,68180,68181,68182,68183,68184,68192,68193,68194,68195,68196,68197,68198,68199,68200,68201,68202,68203,68204,68205,68206,68207,68208,68209,68210,68211,68212,68213,68214,68215,68216,68217,68218,68219,68220,68221,68222,68223,68352,68353,68354,68355,68356,68357,68358,68359,68360,68361,68362,68363,68364,68365,68366,68367,68368,68369,68370,68371,68372,68373,68374,68375,68376,68377,68378,68379,68380,68381,68382,68383,68384,68385,68386,68387,68388,68389,68390,68391,68392,68393,68394,68395,68396,68397,68398,68399,68400,68401,68402,68403,68404,68405,68416,68417,68418,68419,68420,68421,68422,68423,68424,68425,68426,68427,68428,68429,68430,68431,68432,68433,68434,68435,68436,68437,68440,68441,68442,68443,68444,68445,68446,68447,68448,68449,68450,68451,68452,68453,68454,68455,68456,68457,68458,68459,68460,68461,68462,68463,68464,68465,68466,68472,68473,68474,68475,68476,68477,68478,68479,68608,68609,68610,68611,68612,68613,68614,68615,68616,68617,68618,68619,68620,68621,68622,68623,68624,68625,68626,68627,68628,68629,68630,68631,68632,68633,68634,68635,68636,68637,68638,68639,68640,68641,68642,68643,68644,68645,68646,68647,68648,68649,68650,68651,68652,68653,68654,68655,68656,68657,68658,68659,68660,68661,68662,68663,68664,68665,68666,68667,68668,68669,68670,68671,68672,68673,68674,68675,68676,68677,68678,68679,68680,126464,126465,126466,126467,126469,126470,126471,126472,126473,126474,126475,126476,126477,126478,126479,126480,126481,126482,126483,126484,126485,126486,126487,126488,126489,126490,126491,126492,126493,126494,126495,126497,126498,126500,126503,126505,126506,126507,126508,126509,126510,126511,126512,126513,126514,126516,126517,126518,126519,126521,126523,126530,126535,126537,126539,126541,126542,126543,126545,126546,126548,126551,126553,126555,126557,126559,126561,126562,126564,126567,126568,126569,126570,126572,126573,126574,126575,126576,126577,126578,126580,126581,126582,126583,126585,126586,126587,126588,126590,126592,126593,126594,126595,126596,126597,126598,126599,126600,126601,126603,126604,126605,126606,126607,126608,126609,126610,126611,126612,126613,126614,126615,126616,126617,126618,126619,126625,126626,126627,126629,126630,126631,126632,126633,126635,126636,126637,126638,126639,126640,126641,126642,126643,126644,126645,126646,126647,126648,126649,126650,126651,1114109];function P(){}function U(e,t,n){var r="undefined"!=typeof navigator&&/MSIE\s8\.0/.test(navigator.userAgent),o="rgba(255, 255, 255, 1)",i="rgba(0, 0, 0, 0.8)",A="";void 0!==B&&(o=B.fontSet,i=B.backgroundSet,A=B.edgeSet),r&&(o="rgb(255, 255, 255)",i="rgb(0, 0, 0)"),P.call(this),this.cue=t,this.cueDiv=D(e,t.text);var a={color:o,backgroundColor:i,textShadow:A,position:"relative",left:0,right:0,top:0,bottom:0,display:"inline"};r||(a.writingMode=""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",a.unicodeBidi="plaintext"),this.applyStyles(a,this.cueDiv),this.div=e.document.createElement("div"),a={textAlign:"middle"===t.align?"center":t.align,font:n.font,whiteSpace:"pre-line",position:"absolute"},r||(a.direction=function(e){var t,n=[],r="";if(!e||!e.childNodes)return"ltr";function o(e,t){for(var n=t.childNodes.length-1;n>=0;n--)e.push(t.childNodes[n])}function i(e){if(!e||!e.length)return null;var t=e.pop(),n=t.textContent||t.innerText;if(n){var r=n.match(/^.*(\n|\r)/);return r?(e.length=0,r[0]):n}return"ruby"===t.tagName?i(e):t.childNodes?(o(e,t),i(e)):void 0}for(o(n,e);r=i(n);)for(var A=0;A=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,n=t.textTrackList,r=0,o=0;ou&&(c=c<0?-1:1,c*=Math.ceil(u/l)*l),A<0&&(c+=""===i.vertical?n.height:n.width,a=a.reverse()),o.move(f,c)}else{var p=o.lineHeight/n.height*100;switch(i.lineAlign){case"middle":A-=p/2;break;case"end":A-=p}switch(i.vertical){case"":t.applyStyles({top:t.formatStyle(A,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(A,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(A,"%")})}a=["+y","-x","+x","-y"],o=new N(t)}var d=function(e,t){for(var o,i=new N(e),A=1,a=0;as&&(o=new N(e),A=s),e=new N(i)}return o||i}(o,a);t.move(d.toCSSCompatValues(n))}P.prototype.applyStyles=function(e,t){for(var n in t=t||this.div,e)e.hasOwnProperty(n)&&(t.style[n]=e[n])},P.prototype.formatStyle=function(e,t){return 0===e?0:e+t},U.prototype=x(P.prototype),U.prototype.constructor=U,N.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}},N.prototype.overlaps=function(e){return this.lefte.left&&this.tope.top},N.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},N.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom}},N.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)},N.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}},N.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,n=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,r=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||r,height:e.height||t,bottom:e.bottom||r+(e.height||t),width:e.width||n}},y.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},y.convertCueToDOMTree=function(e,t){return e&&t?D(e,t):null},y.processCues=function(e,t,n){if(!e||!t||!n)return null;for(;n.firstChild;)n.removeChild(n.firstChild);var r=e.document.createElement("div");if(r.style.position="absolute",r.style.left="0",r.style.right="0",r.style.top="0",r.style.bottom="0",r.style.margin="1.5%",n.appendChild(r),function(e){for(var t=0;t]*<[a-z]*/g,_=/]+?start[^=]*=[^0-9]*([0-9]*)["^0-9"]*/i,H=/]*>/gi,J=function(e,t){return t=(((t||"")+"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join(""),e.replace(/|<\?(?:php)?[\s\S]*?\?>/gi,"").replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,(function(e,n){return t.indexOf("<"+n.toLowerCase()+">")>-1?e:""}))},Z=function(e){return e.sort((function(e,t){var n;return 0==(n=e.start-t.start)?e.end-t.end:n}))},K=function(){var e={},t=function(e){return e.map((function(e){return new h(e.start,e.end,e.text)}))};return e.load=function(e,n,r,o){fetch(e.file).then((function(e){e.ok?e.text().then((function(e){var o=[],i=[];if(e.indexOf("WEBVTT")>=0){OvenPlayerConsole.log("WEBVTT LOADED");var a=new j.Parser(window,j.StringDecoder());i=[],a.oncue=function(e){i.push(e)},a.onflush=function(){r(i)},a.parse(e)}else if(e.indexOf("SAMI")>=0){OvenPlayerConsole.log("SAMI LOADED");var s=function(e,t){var n,r,o,i,A,a,s,l,c,u;if(s=function(){var t,n,r,A,s,l,c,f,p,d,g,h,v,m,C,y;for(n=function(e){var n;return(n=new Error(e)).line=c,n.context=t,o.push(n)},c=1,p=[],v={},h=e;d=h.search(),!(f<=0||d<0);)f=h.slice(d+1).search(G)+1,t=f>0?h.slice(d,d+f):h.slice(d),c+=(null!=(m=h.slice(0,d).match(z))?m.length:void 0)||0,V.test(t)&&n("ERROR_BROKEN_TAGS"),h=h.slice(d+f),(null===(g=+(null!=(C=t.match(_))?parseFloat(C[1]/1e3):void 0))||g<0)&&n("ERROR_INVALID_TIME"),(s=i(t))||n("ERROR_INVALID_LANGUAGE"),c+=(null!=(y=t.match(z))?y.length:void 0)||0,t=(t=t.replace(z,"")).replace(H,"\n"),A={start:g,text:"",contents:r=J(t).trim()},s&&(A.text=r),v[s]||(v[s]=[]),A.start&&v[s].push(A);u=u||function(){var e,t,n=window.navigator,r=["language","browserLanguage","systemLanguage","userLanguage"];if(Array.isArray(n.languages))for(e=0;e0&&(l=b.indexOf(u)>-1?v[u]:v[b.filter((function(e){return"undefined"!==e}))[0]],l=Z(l),l=a(l),p=p.concat(l)),Z(p)},i=function(e){var t,r;if(e)for(t in n)if((r=n[t]).reClassName.test(e))return r.lang},a=function(e){var t,n,o;for(t=e.length;t--;)n=e[t],null!=(o=e[t-1])&&(o.end=n.start),n.contents&&" "!==n.contents?(delete e[t].contents,n.end||(n.end=n.start+r)):e.splice(t,1);return e},o=[],n={KRCC:{lang:"ko",reClassName:new RegExp("class[^=]*?=[\"'S]*(KRCC)['\"S]?","i")},KOCC:{lang:"ko",reClassName:new RegExp("class[^=]*?=[\"'S]*(KOCC)['\"S]?","i")},KR:{lang:"ko",reClassName:new RegExp("class[^=]*?=[\"'S]*(KR)['\"S]?","i")},ENCC:{lang:"en",reClassName:new RegExp("class[^=]*?=[\"'S]*(ENCC)['\"S]?","i")},EGCC:{lang:"en",reClassName:new RegExp("class[^=]*?=[\"'S]*(EGCC)['\"S]?","i")},EN:{lang:"en",reClassName:new RegExp("class[^=]*?=[\"'S]*(EN)['\"S]?","i")},JPCC:{lang:"ja",reClassName:new RegExp("class[^=]*?=[\"'S]*(JPCC)['\"S]?","i")}},null!=t?t.definedLangs:void 0)for(A in c=t.definedLangs)l=c[A],n[A]=l;return r=(null!=t?t.duration:void 0)||10,u=t.fixedLang,e=e.trim(),{result:s(),errors:o}}(e,{fixedLang:n});i=t(s.result),r(i)}else OvenPlayerConsole.log("SRT LOADED"),o=function(e){var t=[],n=(e=A(e)).split("\r\n\r\n");1===n.length&&(n=e.split("\n\n"));for(var r=0;rGet Adobe Flash player",reason:"It looks like not found swf or your environment is localhost."},103:{code:103,message:"Can not load due to dash.js. Please use the latest dash.js.",reason:"dash.js version is old."},104:{code:104,message:"Can not load due to google ima for Ads. ",reason:"Please check the google ima library."},105:{code:105,message:"Error initializing DASH.",reason:"Error initializing DASH."},106:{code:106,message:"Error initializing HLS.",reason:"Error initializing HLS."},300:{code:300,message:"Can not play due to unknown reasons.",reason:"Can not play due to unknown reasons."},301:{code:301,message:"Fetching process aborted by user.",reason:"Fetching process aborted by user."},302:{code:302,message:"Some of the media could not be downloaded due to a network error.",reason:"Error occurred when downloading."},303:{code:303,message:"Unable to load media. This may be due to a server or network error, or due to an unsupported format.",reason:"Error occurred when decoding."},304:{code:304,message:"Media playback has been canceled. It looks like your media is corrupted or your browser does not support the features your media uses.",reason:"Media playback not supported."},305:{code:305,message:"Can not load captions due to unknown reasons.",reason:"Can not load captions due to unknown reasons."},306:{code:306,message:"Unable to load media. This may be due to a server or network error, or due to an unsupported format.",reason:"The server cannot or will not process the request."},307:{code:307,message:"Unable to load media. This may be due to a server or network error, or due to an unsupported format.",reason:"The server refused the request."},308:{code:308,message:"Unable to load media. This may be due to a server or network error, or due to an unsupported format.",reason:"The server do not accept the request."},501:{code:501,message:"Connection with low-latency(OME) server failed.",reason:"WebSocket connection failed."},502:{code:502,message:"Connection with low-latency(OME) server failed.",reason:"WebRTC addIceCandidate failed."},503:{code:503,message:"Connection with low-latency(OME) server failed.",reason:"WebRTC setRemoteDescription failed."},504:{code:504,message:"Connection with low-latency(OME) server failed.",reason:"WebRTC peer createOffer failed."},505:{code:505,message:"Connection with low-latency(OME) server failed.",reason:"WebRTC setLocalDescription failed."},506:{code:506,message:"Connection with low-latency(OME) server failed.",reason:"WebRTC internal error."},510:{code:510,message:"Network connection is unstable. Check the network connection.",reason:"Network is slow."},511:{code:511,message:"Connection with low-latency(OME) terminated unexpectedly.",reason:"Unexpected end of connection."},512:{code:512,message:"Connection with low-latency(OME) server failed.",reason:"Connection timeout."}}}},{lang:"ko",ui:{context:"오븐플레이어에 관하여",controls:{live:"라이브",low_latency_live:"초저지연 라이브",low_latency_p2p:"초저지연 P2P"},playlist:"플레이리스트",setting:{title:"설정",speed:"재생 속도",speedUnit:"x",source:"소스",quality:"품질",caption:"자막",display:"표시"}},api:{message:{muted_play:"눌러서 소리 켜기"},error:{100:{code:100,message:"알 수 없는 이유로 로드 할 수 없습니다.",reason:"알 수 없는 이유로 로드 할 수 없습니다."},101:{code:101,message:"지원되는 미디어를 찾지 못해 로드 할 수 없습니다.",reason:"Can not load due to playable media not found."},102:{code:102,message:"플레시 로드가 중단 되었습니다.
Get Adobe Flash player",reason:"It looks like not found swf or your environment is localhost."},103:{code:103,message:"DashJS로 인해 로드 할 수 없습니다. 최신 dash.js를 사용해 주세요.",reason:"dash.js version is old."},104:{code:104,message:"Google IMA 라이브러리가 없어 로드 할 수 없습니다.",reason:"Please check the google ima library."},105:{code:105,message:"DASH 초기화 중 오류가 발생했습니다.",reason:"Error initializing DASH."},106:{code:106,message:"HLS 초기화 중 오류가 발생했습니다.",reason:"Error initializing HLS."},300:{code:300,message:"알 수 없는 이유로 재생할 수 없습니다.",reason:"Can not play due to unknown reasons."},301:{code:301,message:"사용자에 의한 프로세스 중단.",reason:"Fetching process aborted by user."},302:{code:302,message:"네트워크 오류로 인해 일부 미디어를 다운로드 할 수 없습니다.",reason:"Error occurred when downloading."},303:{code:303,message:"미디어를 로드 할 수 없습니다. 서버 또는 네트워크 오류 또는 지원되지 않는 형식으로 인해 발생할 수 있습니다.",reason:"Error occurred when decoding."},304:{code:304,message:"미디어 재생이 취소되었습니다. 미디어가 손상되었거나 브라우저가 미디어에서 사용하는 기능을 지원하지 않는 것 같습니다.",reason:"Media playback not supported."},305:{code:305,message:"알 수 없는 이유로 자막을 로드 할 수 없습니다.",reason:"Can not load captions due to unknown reasons."},306:{code:306,message:"미디어를 로드 할 수 없습니다. 서버 또는 네트워크 오류 또는 지원되지 않는 형식으로 인해 발생할 수 있습니다.",reason:"The server cannot or will not process the request."},307:{code:307,message:"미디어를 로드 할 수 없습니다. 서버 또는 네트워크 오류 또는 지원되지 않는 형식으로 인해 발생할 수 있습니다.",reason:"The server refused the request."},308:{code:308,message:"미디어를 로드 할 수 없습니다. 서버 또는 네트워크 오류 또는 지원되지 않는 형식으로 인해 발생할 수 있습니다.",reason:"The server do not accept the request."},501:{code:501,message:"웹소켓 연결 실패",reason:"WebSocket connection failed."},502:{code:502,message:"저지연(OME) 서버와 연결에 실패했습니다.",reason:"WebRTC addIceCandidate failed."},503:{code:503,message:"저지연(OME) 서버와 연결에 실패했습니다.",reason:"WebRTC setRemoteDescription failed."},504:{code:504,message:"저지연(OME) 서버와 연결에 실패했습니다.",reason:"WebRTC peer createOffer failed."},505:{code:505,message:"저지연(OME) 서버와 연결에 실패했습니다.",reason:"WebRTC setLocalDescription failed."},506:{code:506,message:"저지연(OME) 서버와 연결에 실패했습니다.",reason:"WebRTC internal error."},510:{code:510,message:"네트워크 연결이 불안정합니다. 네트워크 연결을 확인하십시오.",reason:"Network is slow."},511:{code:511,message:"저지연(OME) 서버와 연결에 실패했습니다.",reason:"Unexpected end of connection."},512:{code:512,message:"저지연(OME) 서버와 연결에 실패했습니다.",reason:"Connection timeout."}}}},{lang:"pl",ui:{context:"O OvenPlayer",controls:{live:"Transmisja na żywo",low_latency_live:"Transmisja z niskim opóźnieniem",low_latency_p2p:"Transmisja z niskim opóźnieniem P2P"},playlist:"Playlista",setting:{title:"Ustawienia",speed:"Prędkość",speedUnit:"x",source:"Źrodło",quality:"Jakość",caption:"Podtytuł",display:"Wyświetlacz"}},api:{message:{muted_play:"Naciśnij tutaj, aby aktywować dźwięk"},error:{100:{code:100,message:"Nie można załadować z nieznanego powodu.",reason:"Can not load due to unknown reasons."},101:{code:101,message:"Nie można załadować, ponieważ nie znaleziono multimediów, który można odtworzyć.",reason:"Can not load due to playable media not found."},102:{code:102,message:"Flash fetching process aborted.
Get Adobe Flash player",reason:"It looks like not found swf or your environment is localhost."},103:{code:103,message:"Nie można załadować, ponieważ wersja dash.js jest za stara.",reason:"dash.js version is old."},104:{code:104,message:"Can not load due to google ima for Ads. ",reason:"Please check the google ima library."},105:{code:105,message:"Nie można załadować, nie znaleziono DASH.",reason:"Error initializing DASH."},106:{code:106,message:"Nie można załadować, nie znaleziono hlsjs.",reason:"Error initializing HLS"},300:{code:300,message:"Nie można odtworzyć z nieznanego powodu.",reason:"Can not play due to unknown reasons."},301:{code:301,message:"Proces pobierania przerwany przez użytkownika.",reason:"Fetching process aborted by user."},302:{code:302,message:"Nie udało się pobrać niektórych multimediów z powodu błędu sieci.",reason:"Error occurred when downloading."},303:{code:303,message:"Nie udało się załadować niektórych multimediów. Może być to spowodowane problemem z serwerem, siecią lub niewspieranym formatem.",reason:"Error occurred when decoding."},304:{code:304,message:"Odtwarzanie zostało anulowane. Wygląda na to, że plik jest uszkodzony lub Twoja przeglądarka nie obsługuje tego pliku.",reason:"Media playback not supported."},305:{code:305,message:"Nie można wczytać napisów z nieznanego powodu.",reason:"Can not load captions due to unknown reasons."},306:{code:306,message:"Nie udało się załadować niektórych multimediów. Może być to spowodowane problemem z serwerem, siecią lub niewspieranym formatem.",reason:"The server cannot or will not process the request."},307:{code:307,message:"Nie udało się załadować niektórych multimediów. Może być to spowodowane problemem z serwerem, siecią lub niewspieranym formatem.",reason:"The server refused the request."},308:{code:308,message:"Nie udało się załadować niektórych multimediów. Może być to spowodowane problemem z serwerem, siecią lub niewspieranym formatem.",reason:"The server do not accept the request."},501:{code:501,message:"Połączenie z serwerem niskiego opóźnienia (OME) nie powiodło się.",reason:"WebSocket connection failed."},502:{code:502,message:"Połączenie z serwerem niskiego opóźnienia (OME) nie powiodło się.",reason:"WebRTC addIceCandidate failed."},503:{code:503,message:"Połączenie z serwerem niskiego opóźnienia (OME) nie powiodło się.",reason:"WebRTC setRemoteDescription failed."},504:{code:504,message:"Połączenie z serwerem niskiego opóźnienia (OME) nie powiodło się.",reason:"WebRTC peer createOffer failed."},505:{code:505,message:"Połączenie z serwerem niskiego opóźnienia (OME) nie powiodło się.",reason:"WebRTC setLocalDescription failed."},506:{code:506,message:"Połączenie z serwerem niskiego opóźnienia (OME) nie powiodło się.",reason:"WebRTC internal error."},510:{code:510,message:"Połączenie sieciowe jest niestabilne. Sprawdź swoją sieć.",reason:"Network is slow."},511:{code:511,message:"Połączenie z serwerem niskiego opóźnienia (OME) nieoczekiwanie zakończone.",reason:"Unexpected end of connection."},512:{code:512,message:"Połączenie z serwerem niskiego opóźnienia (OME) nie powiodło się.",reason:"Connection timeout."}}}}],Ye=function(e){return"subtitles"===e||"captions"===e},Ge=function(e){var t=e,n=[],r=function(e,t,n){var r=0,o=e.length;for(r=0;r1?n:n[0]};return(r=i().isElement(t)||i().every(t,(function(e){return i().isElement(e)}))?t:"document"===t?document:"window"===t?window:o(document,t))?(n.show=function(){r.style.display="block"},n.hide=function(){r.style.display="none"},n.addClass=function(e){r.classList?r.classList.add(e):-1===r.className.split(" ").indexOf(e)&&(r.className+=" "+e)},n.after=function(e){r.insertAdjacentHTML("afterend",e)},n.append=function(e){r.appendChild(e)},n.before=function(e){r.insertAdjacentHTML("beforebegin",e)},n.children=function(){return r.children||[]},n.contains=function(e){return r!==e&&r.contains(e)},n.empty=function(){r.innerHTML=""},n.find=function(t){return e(o(r,t))},n.css=function(e,t){if(!t)return r.style[e];r.length>0?r.forEach((function(n){n.style[e]=t})):r.style[e]=t},n.removeClass=function(e){r.classList?r.classList.remove(e):r.className=r.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")},n.removeAttribute=function(e){r.removeAttribute(e)},n.text=function(e){if(void 0===e)return r.textContent;r.textContent=e},n.html=function(e){r.innerHTML=e},n.hasClass=function(e){return r.classList?r.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(r.name)},n.is=function(e){return r===e},n.offset=function(){var e=r.getBoundingClientRect();return{top:e.top+document.body.scrollTop,left:e.left+document.body.scrollLeft}},n.width=function(){return r.clientWidth},n.height=function(){return r.clientHeight},n.attr=function(e){return r.getAttribute(e)},n.replace=function(e){r.replaceWith(e)},n.remove=function(){r.length>1?r.parentElement.removeChild(r):r.remove()},n.removeChild=function(e){if(e)r.removeChild(e);else for(;r.hasChildNodes();)r.removeChild(r.firstChild)},n.get=function(){return r},n.closest=function(t){r.closest=function(e){var t=r;do{if(t.matches(e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null};var n=r.closest(t);return n?e(n):null},n):null}),Ve=function(e,t){if(e)return 0==e.indexOf("rtmp:")||"rtmp"==t},_e=function(e,t){return!!e&&(0===e.indexOf("ws:")||0===e.indexOf("wss:")||"webrtc"===t)},He=function(e,t){if(e)return"hls"===t||"m3u8"===t||"application/vnd.apple.mpegurl"===t||"m3u8"==a(e)},Je=function(e,t){if(e)return"mpd"===t||"dash"===t||"application/dash+xml"===t||"mpd"==a(e)},Ze=function(e){if(!e)return null;var t=null;if("string"==typeof e)t=document.getElementById(e);else{if(!e.nodeType)return null;t=e}return t},Ke=function(){var e={};OvenPlayerConsole.log("SupportChecker loaded.");var t=Y(),n=[{name:"html5",checkSupport:function(e){var n=document.createElement("video");if(!n.canPlayType)return!1;var r=e.file,o=e.type;if(!o)return!1;var i=e.mimeType||{aac:"audio/mp4",mp4:"video/mp4",f4v:"video/mp4",m4v:"video/mp4",mov:"video/mp4",mp3:"audio/mpeg",mpeg:"audio/mpeg",ogv:"video/ogg",ogg:"video/ogg",oga:"video/ogg",vorbis:"video/ogg",webm:"video/webm",f4a:"video/aac",m3u8:"application/vnd.apple.mpegurl",m3u:"application/vnd.apple.mpegurl",hls:"application/vnd.apple.mpegurl"}[o];return!(He(r,o)&&("Microsoft Edge"===t.browser||"Android"===t.os)||Ve(r,o)||_e(r,o)||!i||!n.canPlayType(i))}},{name:"webrtc",checkSupport:function(e){if(!document.createElement("video").canPlayType)return!1;if(Ve(t,n))return!1;var t=e.file,n=e.type;return!!_e(t,n)}},{name:"dash",checkSupport:function(e){var t=e.file,n=e.type;return!Ve(t,n)&&!("function"!=typeof(window.MediaSource||window.WebKitMediaSource)||!Je(t,n))}},{name:"hls",checkSupport:function(e){document.createElement("video");var t,n,r,o,i=e.file,A=e.type;return!Ve(i,A)&&(t=function(){if("undefined"!=typeof window)return window.MediaSource||window.WebKitMediaSource}(),n=window.SourceBuffer||window.WebKitSourceBuffer,r=t&&"function"==typeof t.isTypeSupported&&t.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),o=!n||n.prototype&&"function"==typeof n.prototype.appendBuffer&&"function"==typeof n.prototype.remove,!!r&&!!o)}},{name:"rtmp",checkSupport:function(e){var n=e.file,r=e.type;return!(!Ve(n,r)||!function(){var e=!1;if("ActiveXObject"in window)try{e=!!new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(t){e=!1}else e=!!navigator.mimeTypes["application/x-shockwave-flash"];return e}()||"Microsoft Edge"===t.browser||"Android"===t.os||"iOS"===t.os||"Safari"===t.browser)}}];return e.findProviderNameBySource=function(e){OvenPlayerConsole.log("SupportChecker : findProviderNameBySource()",e);for(var t=e===Object(e)?e:{},r=0;r0&&void 0!==arguments[0]?arguments[0]:{};lt(this,e),this.id=t.id||null,this.adId=t.adId||null,this.sequence=t.sequence||null,this.apiFramework=t.apiFramework||null,this.trackingEvents={}},gt=function(e){ot(n,e);var t=At(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return lt(this,n),(e=t.call(this,r)).type="companion",e.variations=[],e}return n}(dt);function ht(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[];for(var r in t.ASSETURI&&(t.ASSETURI=vt(t.ASSETURI)),t.CONTENTPLAYHEAD&&(t.CONTENTPLAYHEAD=vt(t.CONTENTPLAYHEAD)),t.ERRORCODE&&!/^[0-9]{3}$/.test(t.ERRORCODE)&&(t.ERRORCODE=900),t.CACHEBUSTING=mt(Math.round(1e8*Math.random()).toString()),t.TIMESTAMP=vt((new Date).toISOString()),t.RANDOM=t.random=t.CACHEBUSTING,e){var o=e[r];if("string"==typeof o){for(var i in t){var A=t[i],a="[".concat(i,"]"),s="%%".concat(i,"%%");o=(o=o.replace(a,A)).replace(s,A)}n.push(o)}}return n}function vt(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%".concat(e.charCodeAt(0).toString(16))}))}function mt(e){return e.length<8?Ct(0,8-e.length,!1).map((function(e){return"0"})).join("")+e:e}function Ct(e,t,n){for(var r=[],o=ei;o?A++:A--)r.push(A);return r}var yt={track:function(e,t){ht(e,t).forEach((function(e){"undefined"!=typeof window&&null!==window&&((new Image).src=e)}))},resolveURLTemplates:ht,encodeURIComponentRFC3986:vt,leftpad:mt,range:Ct,isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},flatten:function e(t){return t.reduce((function(t,n){return t.concat(Array.isArray(n)?e(n):n)}),[])}},bt=function(e,t){var n=e.childNodes;for(var r in n){var o=n[r];if(o.nodeName===t)return o}},wt=function(e,t){var n=[],r=e.childNodes;for(var o in r){var i=r[o];i.nodeName===t&&n.push(i)}return n},Et=function(e,t){if(!t)return e;if(0===e.indexOf("//")){var n=location.protocol;return"".concat(n).concat(e)}return-1===e.indexOf("://")?"".concat(t.slice(0,t.lastIndexOf("/")),"/").concat(e):e},Bt=function(e){return-1!==["true","TRUE","1"].indexOf(e)},xt=function(e){return e&&(e.textContent||e.text||"").trim()},kt=function(e,t,n){var r=t.getAttribute(e);r&&n.setAttribute(e,r)},It=function(e){if(null==e)return-1;if(yt.isNumeric(e))return parseInt(e);var t=e.split(":");if(3!==t.length)return-1;var n=t[2].split("."),r=parseInt(n[0]);2===n.length&&(r+=parseFloat("0.".concat(n[1])));var o=parseInt(60*t[1]),i=parseInt(60*t[0]*60);return isNaN(i)||isNaN(o)||isNaN(r)||o>3600||r>60?-1:i+o+r},St=function(e){var t=[],n=null;return e.forEach((function(r,o){if(r.sequence&&(r.sequence=parseInt(r.sequence,10)),r.sequence>1){var i=e[o-1];if(i&&i.sequence===r.sequence-1)return void(n&&n.push(r));delete r.sequence}n=[r],t.push(n)})),t},Tt=function(e,t){e.errorURLTemplates=t.errorURLTemplates.concat(e.errorURLTemplates),e.impressionURLTemplates=t.impressionURLTemplates.concat(e.impressionURLTemplates),e.extensions=t.extensions.concat(e.extensions),e.creatives.forEach((function(e){if(t.trackingEvents&&t.trackingEvents[e.type])for(var n in t.trackingEvents[e.type]){var r=t.trackingEvents[e.type][n];e.trackingEvents[n]||(e.trackingEvents[n]=[]),e.trackingEvents[n]=e.trackingEvents[n].concat(r)}})),t.videoClickTrackingURLTemplates&&t.videoClickTrackingURLTemplates.length&&e.creatives.forEach((function(e){"linear"===e.type&&(e.videoClickTrackingURLTemplates=e.videoClickTrackingURLTemplates.concat(t.videoClickTrackingURLTemplates))})),t.videoCustomClickURLTemplates&&t.videoCustomClickURLTemplates.length&&e.creatives.forEach((function(e){"linear"===e.type&&(e.videoCustomClickURLTemplates=e.videoCustomClickURLTemplates.concat(t.videoCustomClickURLTemplates))})),t.videoClickThroughURLTemplate&&e.creatives.forEach((function(e){"linear"===e.type&&null==e.videoClickThroughURLTemplate&&(e.videoClickThroughURLTemplate=t.videoClickThroughURLTemplate)}))};function Lt(e,t){var n=new gt(t);return wt(e,"Companion").forEach((function(e){var t=new pt;t.id=e.getAttribute("id")||null,t.width=e.getAttribute("width"),t.height=e.getAttribute("height"),t.companionClickTrackingURLTemplates=[],wt(e,"HTMLResource").forEach((function(e){t.type=e.getAttribute("creativeType")||"text/html",t.htmlResource=xt(e)})),wt(e,"IFrameResource").forEach((function(e){t.type=e.getAttribute("creativeType")||0,t.iframeResource=xt(e)})),wt(e,"StaticResource").forEach((function(n){t.type=n.getAttribute("creativeType")||0,wt(e,"AltText").forEach((function(e){t.altText=xt(e)})),t.staticResource=xt(n)})),wt(e,"TrackingEvents").forEach((function(e){wt(e,"Tracking").forEach((function(e){var n=e.getAttribute("event"),r=xt(e);n&&r&&(null==t.trackingEvents[n]&&(t.trackingEvents[n]=[]),t.trackingEvents[n].push(r))}))})),wt(e,"CompanionClickTracking").forEach((function(e){t.companionClickTrackingURLTemplates.push(xt(e))})),t.companionClickThroughURLTemplate=xt(bt(e,"CompanionClickThrough")),t.companionClickTrackingURLTemplate=xt(bt(e,"CompanionClickTracking")),n.variations.push(t)})),n}var Rt=function(e){ot(n,e);var t=At(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return lt(this,n),(e=t.call(this,r)).type="linear",e.duration=0,e.skipDelay=null,e.mediaFiles=[],e.videoClickThroughURLTemplate=null,e.videoClickTrackingURLTemplates=[],e.videoCustomClickURLTemplates=[],e.adParameters=null,e.icons=[],e}return n}(dt),Qt=function e(){lt(this,e),this.program=null,this.height=0,this.width=0,this.xPosition=0,this.yPosition=0,this.apiFramework=null,this.offset=null,this.duration=0,this.type=null,this.staticResource=null,this.htmlResource=null,this.iframeResource=null,this.iconClickThroughURLTemplate=null,this.iconClickTrackingURLTemplates=[],this.iconViewTrackingURLTemplate=null},Mt=function e(){lt(this,e),this.id=null,this.fileURL=null,this.deliveryType="progressive",this.mimeType=null,this.codec=null,this.bitrate=0,this.minBitrate=0,this.maxBitrate=0,this.width=0,this.height=0,this.apiFramework=null,this.scalable=null,this.maintainAspectRatio=null};function Ot(e,t){var n,r=new Rt(t);r.duration=It(xt(bt(e,"Duration")));var o=e.getAttribute("skipoffset");if(null==o)r.skipDelay=null;else if("%"===o.charAt(o.length-1)&&-1!==r.duration){var i=parseInt(o,10);r.skipDelay=r.duration*(i/100)}else r.skipDelay=It(o);var A=bt(e,"VideoClicks");A&&(r.videoClickThroughURLTemplate=xt(bt(A,"ClickThrough")),wt(A,"ClickTracking").forEach((function(e){r.videoClickTrackingURLTemplates.push(xt(e))})),wt(A,"CustomClick").forEach((function(e){r.videoCustomClickURLTemplates.push(xt(e))})));var a=bt(e,"AdParameters");a&&(r.adParameters=xt(a)),wt(e,"TrackingEvents").forEach((function(e){wt(e,"Tracking").forEach((function(e){var t=e.getAttribute("event"),o=xt(e);if(t&&o){if("progress"===t){if(!(n=e.getAttribute("offset")))return;t="%"===n.charAt(n.length-1)?"progress-".concat(n):"progress-".concat(Math.round(It(n)))}null==r.trackingEvents[t]&&(r.trackingEvents[t]=[]),r.trackingEvents[t].push(o)}}))})),wt(e,"MediaFiles").forEach((function(e){wt(e,"MediaFile").forEach((function(e){var t=new Mt;t.id=e.getAttribute("id"),t.fileURL=xt(e),t.deliveryType=e.getAttribute("delivery"),t.codec=e.getAttribute("codec"),t.mimeType=e.getAttribute("type"),t.apiFramework=e.getAttribute("apiFramework"),t.bitrate=parseInt(e.getAttribute("bitrate")||0),t.minBitrate=parseInt(e.getAttribute("minBitrate")||0),t.maxBitrate=parseInt(e.getAttribute("maxBitrate")||0),t.width=parseInt(e.getAttribute("width")||0),t.height=parseInt(e.getAttribute("height")||0);var n=e.getAttribute("scalable");n&&"string"==typeof n&&("true"===(n=n.toLowerCase())?t.scalable=!0:"false"===n&&(t.scalable=!1));var o=e.getAttribute("maintainAspectRatio");o&&"string"==typeof o&&("true"===(o=o.toLowerCase())?t.maintainAspectRatio=!0:"false"===o&&(t.maintainAspectRatio=!1)),r.mediaFiles.push(t)}))}));var s=bt(e,"Icons");return s&&wt(s,"Icon").forEach((function(e){var t=new Qt;t.program=e.getAttribute("program"),t.height=parseInt(e.getAttribute("height")||0),t.width=parseInt(e.getAttribute("width")||0),t.xPosition=function(e){return-1!==["left","right"].indexOf(e)?e:parseInt(e||0)}(e.getAttribute("xPosition")),t.yPosition=function(e){return-1!==["top","bottom"].indexOf(e)?e:parseInt(e||0)}(e.getAttribute("yPosition")),t.apiFramework=e.getAttribute("apiFramework"),t.offset=It(e.getAttribute("offset")),t.duration=It(e.getAttribute("duration")),wt(e,"HTMLResource").forEach((function(e){t.type=e.getAttribute("creativeType")||"text/html",t.htmlResource=xt(e)})),wt(e,"IFrameResource").forEach((function(e){t.type=e.getAttribute("creativeType")||0,t.iframeResource=xt(e)})),wt(e,"StaticResource").forEach((function(e){t.type=e.getAttribute("creativeType")||0,t.staticResource=xt(e)}));var n=bt(e,"IconClicks");n&&(t.iconClickThroughURLTemplate=xt(bt(n,"IconClickThrough")),wt(n,"IconClickTracking").forEach((function(e){t.iconClickTrackingURLTemplates.push(xt(e))}))),t.iconViewTrackingURLTemplate=xt(bt(e,"IconViewTracking")),r.icons.push(t)})),r}var Dt,Ft=function(e){ot(n,e);var t=At(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return lt(this,n),(e=t.call(this,r)).type="nonlinear",e.variations=[],e}return n}(dt),Pt=function e(){lt(this,e),this.id=null,this.width=0,this.height=0,this.expandedWidth=0,this.expandedHeight=0,this.scalable=!0,this.maintainAspectRatio=!0,this.minSuggestedDuration=0,this.apiFramework="static",this.type=null,this.staticResource=null,this.htmlResource=null,this.iframeResource=null,this.nonlinearClickThroughURLTemplate=null,this.nonlinearClickTrackingURLTemplates=[],this.adParameters=null};function Ut(e,t){var n=new Ft(t);return wt(e,"TrackingEvents").forEach((function(e){var t,r;wt(e,"Tracking").forEach((function(e){t=e.getAttribute("event"),r=xt(e),t&&r&&(null==n.trackingEvents[t]&&(n.trackingEvents[t]=[]),n.trackingEvents[t].push(r))}))})),wt(e,"NonLinear").forEach((function(e){var t=new Pt;t.id=e.getAttribute("id")||null,t.width=e.getAttribute("width"),t.height=e.getAttribute("height"),t.expandedWidth=e.getAttribute("expandedWidth"),t.expandedHeight=e.getAttribute("expandedHeight"),t.scalable=Bt(e.getAttribute("scalable")),t.maintainAspectRatio=Bt(e.getAttribute("maintainAspectRatio")),t.minSuggestedDuration=It(e.getAttribute("minSuggestedDuration")),t.apiFramework=e.getAttribute("apiFramework"),wt(e,"HTMLResource").forEach((function(e){t.type=e.getAttribute("creativeType")||"text/html",t.htmlResource=xt(e)})),wt(e,"IFrameResource").forEach((function(e){t.type=e.getAttribute("creativeType")||0,t.iframeResource=xt(e)})),wt(e,"StaticResource").forEach((function(e){t.type=e.getAttribute("creativeType")||0,t.staticResource=xt(e)}));var r=bt(e,"AdParameters");r&&(t.adParameters=xt(r)),t.nonlinearClickThroughURLTemplate=xt(bt(e,"NonLinearClickThrough")),wt(e,"NonLinearClickTracking").forEach((function(e){t.nonlinearClickTrackingURLTemplates.push(xt(e))})),n.variations.push(t)})),n}function Nt(e){var t=e.childNodes;for(var n in t){var r=t[n];if(-1!==["Wrapper","InLine"].indexOf(r.nodeName)){if(kt("id",e,r),kt("sequence",e,r),"Wrapper"===r.nodeName)return jt(r);if("InLine"===r.nodeName)return Wt(r)}}}function Wt(e){var t=e.childNodes,n=new ct;for(var r in n.id=e.getAttribute("id")||null,n.sequence=e.getAttribute("sequence")||null,t){var o=t[r];switch(o.nodeName){case"Error":n.errorURLTemplates.push(xt(o));break;case"Impression":n.impressionURLTemplates.push(xt(o));break;case"Creatives":wt(o,"Creative").forEach((function(e){var t={id:e.getAttribute("id")||null,adId:Gt(e),sequence:e.getAttribute("sequence")||null,apiFramework:e.getAttribute("apiFramework")||null};for(var r in e.childNodes){var o=e.childNodes[r];switch(o.nodeName){case"Linear":var i=Ot(o,t);i&&n.creatives.push(i);break;case"NonLinearAds":var A=Ut(o,t);A&&n.creatives.push(A);break;case"CompanionAds":var a=Lt(o,t);a&&n.creatives.push(a)}}}));break;case"Extensions":Yt(n.extensions,wt(o,"Extension"));break;case"AdSystem":n.system={value:xt(o),version:o.getAttribute("version")||null};break;case"AdTitle":n.title=xt(o);break;case"Description":n.description=xt(o);break;case"Advertiser":n.advertiser=xt(o);break;case"Pricing":n.pricing={value:xt(o),model:o.getAttribute("model")||null,currency:o.getAttribute("currency")||null};break;case"Survey":n.survey=xt(o)}}return n}function jt(e){var t=Wt(e),n=bt(e,"VASTAdTagURI");if(n?t.nextWrapperURL=xt(n):(n=bt(e,"VASTAdTagURL"))&&(t.nextWrapperURL=xt(bt(n,"URL"))),t.creatives.forEach((function(e){if(-1!==["linear","nonlinear"].indexOf(e.type)){if(e.trackingEvents){t.trackingEvents||(t.trackingEvents={}),t.trackingEvents[e.type]||(t.trackingEvents[e.type]={});var n=function(n){var r=e.trackingEvents[n];t.trackingEvents[e.type][n]||(t.trackingEvents[e.type][n]=[]),r.forEach((function(r){t.trackingEvents[e.type][n].push(r)}))};for(var r in e.trackingEvents)n(r)}e.videoClickTrackingURLTemplates&&(t.videoClickTrackingURLTemplates||(t.videoClickTrackingURLTemplates=[]),e.videoClickTrackingURLTemplates.forEach((function(e){t.videoClickTrackingURLTemplates.push(e)}))),e.videoClickThroughURLTemplate&&(t.videoClickThroughURLTemplate=e.videoClickThroughURLTemplate),e.videoCustomClickURLTemplates&&(t.videoCustomClickURLTemplates||(t.videoCustomClickURLTemplates=[]),e.videoCustomClickURLTemplates.forEach((function(e){t.videoCustomClickURLTemplates.push(e)})))}})),t.nextWrapperURL)return t}function Yt(e,t){t.forEach((function(t){var n=new ut,r=t.attributes,o=t.childNodes;if(t.attributes)for(var i in r){var A=r[i];A.nodeName&&A.nodeValue&&(n.attributes[A.nodeName]=A.nodeValue)}for(var a in o){var s=o[a],l=xt(s);if("#comment"!==s.nodeName&&""!==l){var c=new ft;if(c.name=s.nodeName,c.value=l,s.attributes){var u=s.attributes;for(var f in u){var p=u[f];c.attributes[p.nodeName]=p.nodeValue}}n.children.push(c)}}e.push(n)}))}function Gt(e){return e.getAttribute("AdID")||e.getAttribute("adID")||e.getAttribute("adId")||null}function zt(){}function Vt(){Vt.init.call(this)}function _t(e){return void 0===e._maxListeners?Vt.defaultMaxListeners:e._maxListeners}function Ht(e,t,n){if(t)e.call(n);else for(var r=e.length,o=tn(e,r),i=0;i0&&A.length>o){A.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+A.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=e,a.type=t,a.count=A.length,function(e){"function"==typeof console.warn?console.warn(e):console.log(e)}(a)}}else A=i[t]=n,++e._eventsCount;return e}function $t(e,t,n){var r=!1;function o(){e.removeListener(t,o),r||(r=!0,n.apply(e,arguments))}return o.listener=n,o}function en(e){var t=this._events;if(t){var n=t[e];if("function"==typeof n)return 1;if(n)return n.length}return 0}function tn(e,t){for(var n=new Array(t);t--;)n[t]=e[t];return n}zt.prototype=Object.create(null),Vt.EventEmitter=Vt,Vt.usingDomains=!1,Vt.prototype.domain=void 0,Vt.prototype._events=void 0,Vt.prototype._maxListeners=void 0,Vt.defaultMaxListeners=10,Vt.init=function(){this.domain=null,Vt.usingDomains&&(!Dt.active||this instanceof Dt.Domain||(this.domain=Dt.active)),this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new zt,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Vt.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},Vt.prototype.getMaxListeners=function(){return _t(this)},Vt.prototype.emit=function(e){var t,n,r,o,i,A,a,s="error"===e;if(A=this._events)s=s&&null==A.error;else if(!s)return!1;if(a=this.domain,s){if(t=arguments[1],!a){if(t instanceof Error)throw t;var l=new Error('Uncaught, unspecified "error" event. ('+t+")");throw l.context=t,l}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=a,t.domainThrown=!1,a.emit("error",t),!1}if(!(n=A[e]))return!1;var c="function"==typeof n;switch(r=arguments.length){case 1:Ht(n,c,this);break;case 2:Jt(n,c,this,arguments[1]);break;case 3:Zt(n,c,this,arguments[1],arguments[2]);break;case 4:Kt(n,c,this,arguments[1],arguments[2],arguments[3]);break;default:for(o=new Array(r-1),i=1;i0;)if(n[i]===t||n[i].listener&&n[i].listener===t){A=n[i].listener,o=i;break}if(o<0)return this;if(1===n.length){if(n[0]=void 0,0==--this._eventsCount)return this._events=new zt,this;delete r[e]}else!function(e,t){for(var n=t,r=n+1,o=e.length;r0?Reflect.ownKeys(this._events):[]};var nn=function(e,t,n){var r="function"==typeof window.ActiveXObject?new window.ActiveXObject("Microsoft.XMLDOM"):void 0;if(!r)return n(new Error("FlashURLHandler: Microsoft.XMLDOM format not supported"));r.async=!1,request.open("GET",e),request.timeout=t.timeout||0,request.withCredentials=t.withCredentials||!1,request.send(),request.onprogress=function(){},request.onload=function(){r.loadXML(request.responseText),n(null,r)}},rn=function(){return window.XDomainRequest&&(e=new XDomainRequest),!!e;var e},on=function(e,t,n){n(new Error("Please bundle the library for node to use the node urlHandler"))};function An(){try{var e=new window.XMLHttpRequest;return"withCredentials"in e?e:null}catch(e){return console.log("Error in XHRURLHandler support check:",e),null}}var an,sn,ln=function(e,t,n){if("https:"===window.location.protocol&&0===e.indexOf("http://"))return n(new Error("XHRURLHandler: Cannot go from HTTPS to HTTP."));try{var r=An();r.open("GET",e),r.timeout=t.timeout||0,r.withCredentials=t.withCredentials||!1,r.overrideMimeType&&r.overrideMimeType("text/xml"),r.onreadystatechange=function(){4===r.readyState&&(200===r.status?n(null,r.responseXML):n(new Error("XHRURLHandler: ".concat(r.statusText))))},r.send()}catch(e){n(new Error("XHRURLHandler: Unexpected error"))}},cn=function(){return!!An()},un={get:function(e,t,n){return n||("function"==typeof t&&(n=t),t={}),"undefined"==typeof window||null===window?on(e,t,n):cn()?ln(e,t,n):rn()?nn(e,t,n):n(new Error("Current context is not supported by any of the default URLHandlers. Please provide a custom URLHandler"))}},fn=function e(){lt(this,e),this.ads=[],this.errorURLTemplates=[]},pn={ERRORCODE:900,extensions:[]},dn=function(e){ot(n,e);var t=At(n);function n(){var e;return lt(this,n),(e=t.call(this)).remainingAds=[],e.parentURLs=[],e.errorURLTemplates=[],e.rootErrorURLTemplates=[],e.maxWrapperDepth=null,e.URLTemplateFilters=[],e.fetchingOptions={},e}return rt(n,[{key:"addURLTemplateFilter",value:function(e){"function"==typeof e&&this.URLTemplateFilters.push(e)}},{key:"removeURLTemplateFilter",value:function(){this.URLTemplateFilters.pop()}},{key:"countURLTemplateFilters",value:function(){return this.URLTemplateFilters.length}},{key:"clearURLTemplateFilters",value:function(){this.URLTemplateFilters=[]}},{key:"trackVastError",value:function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o0&&void 0!==arguments[0]?arguments[0]:{};this.rootURL="",this.remainingAds=[],this.parentURLs=[],this.errorURLTemplates=[],this.rootErrorURLTemplates=[],this.maxWrapperDepth=e.wrapperLimit||10,this.fetchingOptions={timeout:e.timeout,withCredentials:e.withCredentials},this.urlHandler=e.urlhandler||un}},{key:"getRemainingAds",value:function(e){var t=this;if(0===this.remainingAds.length)return Promise.reject(new Error("No more ads are available for the given VAST"));var n=e?yt.flatten(this.remainingAds):this.remainingAds.shift();return this.errorURLTemplates=[],this.parentURLs=[],this.resolveAds(n,{wrapperDepth:0,originalUrl:this.rootURL}).then((function(e){return t.buildVASTResponse(e)}))}},{key:"getAndParseVAST",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.initParsingStatus(n),this.rootURL=e,this.fetchVAST(e).then((function(r){return n.originalUrl=e,n.isRootVAST=!0,t.parse(r,n).then((function(e){return t.buildVASTResponse(e)}))}))}},{key:"parseVAST",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.initParsingStatus(n),n.isRootVAST=!0,this.parse(e,n).then((function(e){return t.buildVASTResponse(e)}))}},{key:"buildVASTResponse",value:function(e){var t=new fn;return t.ads=e,t.errorURLTemplates=this.getErrorURLTemplates(),this.completeWrapperResolving(t),t}},{key:"parse",value:function(e,t){var n=t.resolveAll,r=void 0===n||n,o=t.wrapperSequence,i=void 0===o?null:o,A=t.originalUrl,a=void 0===A?null:A,s=t.wrapperDepth,l=void 0===s?0:s,c=t.isRootVAST,u=void 0!==c&&c;if(!e||!e.documentElement||"VAST"!==e.documentElement.nodeName)return Promise.reject(new Error("Invalid VAST XMLDocument"));var f=[],p=e.documentElement.childNodes;for(var d in p){var g=p[d];if("Error"===g.nodeName){var h=xt(g);u?this.rootErrorURLTemplates.push(h):this.errorURLTemplates.push(h)}if("Ad"===g.nodeName){var v=Nt(g);v?f.push(v):this.trackVastError(this.getErrorURLTemplates(),{ERRORCODE:101})}}var m=f.length,C=f[m-1];return 1===m&&null!=i&&C&&!C.sequence&&(C.sequence=i),!1===r&&(this.remainingAds=St(f),f=this.remainingAds.shift()),this.resolveAds(f,{wrapperDepth:l,originalUrl:a})}},{key:"resolveAds",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,r=n.wrapperDepth,o=n.originalUrl,i=[];return t.forEach((function(t){var n=e.resolveWrappers(t,r,o);i.push(n)})),Promise.all(i).then((function(t){var n=yt.flatten(t);if(!n&&e.remainingAds.length>0){var i=e.remainingAds.shift();return e.resolveAds(i,{wrapperDepth:r,originalUrl:o})}return n}))}},{key:"resolveWrappers",value:function(e,t,n){var r=this;return new Promise((function(o,i){if(t++,!e.nextWrapperURL)return delete e.nextWrapperURL,o(e);if(t>=r.maxWrapperDepth||-1!==r.parentURLs.indexOf(e.nextWrapperURL))return e.errorCode=302,delete e.nextWrapperURL,o(e);e.nextWrapperURL=Et(e.nextWrapperURL,n);var A=e.sequence;n=e.nextWrapperURL,r.fetchVAST(e.nextWrapperURL,t,n).then((function(i){return r.parse(i,{originalUrl:n,wrapperSequence:A,wrapperDepth:t}).then((function(t){if(delete e.nextWrapperURL,0===t.length)return e.creatives=[],o(e);t.forEach((function(t){t&&Tt(t,e)})),o(t)}))})).catch((function(t){e.errorCode=301,e.errorMessage=t.message,o(e)}))}))}},{key:"completeWrapperResolving",value:function(e){if(0===e.ads.length)this.trackVastError(e.errorURLTemplates,{ERRORCODE:303});else for(var t=e.ads.length-1;t>=0;t--){var n=e.ads[t];(n.errorCode||0===n.creatives.length)&&(this.trackVastError(n.errorURLTemplates.concat(e.errorURLTemplates),{ERRORCODE:n.errorCode||303},{ERRORMESSAGE:n.errorMessage||""},{extensions:n.extensions},{system:n.system}),e.ads.splice(t,1))}}}]),n}(Vt),gn=null,hn={data:{},length:0,getItem:function(e){return this.data[e]},setItem:function(e,t){this.data[e]=t,this.length=Object.keys(this.data).length},removeItem:function(e){delete data[e],this.length=Object.keys(this.data).length},clear:function(){this.data={},this.length=0}},vn=function(){function e(){lt(this,e),this.storage=this.initStorage()}return rt(e,[{key:"initStorage",value:function(){if(gn)return gn;try{gn="undefined"!=typeof window&&null!==window?window.localStorage||window.sessionStorage:null}catch(e){gn=null}return gn&&!this.isStorageDisabled(gn)||(gn=hn).clear(),gn}},{key:"isStorageDisabled",value:function(e){var t="__VASTStorage__";try{if(e.setItem(t,t),e.getItem(t)!==t)return e.removeItem(t),!0}catch(e){return!0}return e.removeItem(t),!1}},{key:"getItem",value:function(e){return this.storage.getItem(e)}},{key:"setItem",value:function(e,t){return this.storage.setItem(e,t)}},{key:"removeItem",value:function(e){return this.storage.removeItem(e)}},{key:"clear",value:function(){return this.storage.clear()}}]),e}(),mn=function(){function e(t,n,r){lt(this,e),this.cappingFreeLunch=t||0,this.cappingMinimumTimeInterval=n||0,this.defaultOptions={withCredentials:!1,timeout:0},this.vastParser=new dn,this.storage=r||new vn,void 0===this.lastSuccessfulAd&&(this.lastSuccessfulAd=0),void 0===this.totalCalls&&(this.totalCalls=0),void 0===this.totalCallsTimeout&&(this.totalCallsTimeout=0)}return rt(e,[{key:"getParser",value:function(){return this.vastParser}},{key:"lastSuccessfulAd",get:function(){return this.storage.getItem("vast-client-last-successful-ad")},set:function(e){this.storage.setItem("vast-client-last-successful-ad",e)}},{key:"totalCalls",get:function(){return this.storage.getItem("vast-client-total-calls")},set:function(e){this.storage.setItem("vast-client-total-calls",e)}},{key:"totalCallsTimeout",get:function(){return this.storage.getItem("vast-client-total-calls-timeout")},set:function(e){this.storage.setItem("vast-client-total-calls-timeout",e)}},{key:"hasRemainingAds",value:function(){return this.vastParser.remainingAds.length>0}},{key:"getNextAds",value:function(e){return this.vastParser.getRemainingAds(e)}},{key:"get",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Date.now();return(n=Object.assign(this.defaultOptions,n)).hasOwnProperty("resolveAll")||(n.resolveAll=!1),this.totalCallsTimeout=t.totalCalls)return i(new Error("VAST call canceled – FreeLunch capping not reached yet ".concat(t.totalCalls,"/").concat(t.cappingFreeLunch)));var A=r-t.lastSuccessfulAd;if(A<0)t.lastSuccessfulAd=0;else if(A3&&void 0!==arguments[3]?arguments[3]:null;for(var a in lt(this,n),(i=t.call(this)).ad=r,i.creative=o,i.variation=A,i.muted=!1,i.impressed=!1,i.skippable=!1,i.trackingEvents={},i._alreadyTriggeredQuartiles={},i.emitAlwaysEvents=["creativeView","start","firstQuartile","midpoint","thirdQuartile","complete","resume","pause","rewind","skip","closeLinear","close"],i.creative.trackingEvents){var s=i.creative.trackingEvents[a];i.trackingEvents[a]=s.slice(0)}return i.creative instanceof Rt?i._initLinearTracking():i._initVariationTracking(),e&&i.on("start",(function(){e.lastSuccessfulAd=Date.now()})),i}return rt(n,[{key:"_initLinearTracking",value:function(){this.linear=!0,this.skipDelay=this.creative.skipDelay,this.setDuration(this.creative.duration),this.clickThroughURLTemplate=this.creative.videoClickThroughURLTemplate,this.clickTrackingURLTemplates=this.creative.videoClickTrackingURLTemplates}},{key:"_initVariationTracking",value:function(){if(this.linear=!1,this.skipDelay=-1,this.variation){for(var e in this.variation.trackingEvents){var t=this.variation.trackingEvents[e];this.trackingEvents[e]?this.trackingEvents[e]=this.trackingEvents[e].concat(t.slice(0)):this.trackingEvents[e]=t.slice(0)}this.variation instanceof Pt?(this.clickThroughURLTemplate=this.variation.nonlinearClickThroughURLTemplate,this.clickTrackingURLTemplates=this.variation.nonlinearClickTrackingURLTemplates,this.setDuration(this.variation.minSuggestedDuration)):this.variation instanceof pt&&(this.clickThroughURLTemplate=this.variation.companionClickThroughURLTemplate,this.clickTrackingURLTemplates=this.variation.companionClickTrackingURLTemplates)}}},{key:"setDuration",value:function(e){this.assetDuration=e,this.quartiles={firstQuartile:Math.round(25*this.assetDuration)/100,midpoint:Math.round(50*this.assetDuration)/100,thirdQuartile:Math.round(75*this.assetDuration)/100}}},{key:"setProgress",value:function(e){var t=this,n=this.skipDelay||-1;if(-1===n||this.skippable||(n>e?this.emit("skip-countdown",n-e):(this.skippable=!0,this.emit("skip-countdown",0))),this.assetDuration>0){var r=[];if(e>0){var o=Math.round(e/this.assetDuration*100);for(var i in r.push("start"),r.push("progress-".concat(o,"%")),r.push("progress-".concat(Math.round(e))),this.quartiles)this.isQuartileReached(i,this.quartiles[i],e)&&(r.push(i),this._alreadyTriggeredQuartiles[i]=!0)}r.forEach((function(e){t.track(e,!0)})),e0&&void 0!==arguments[0]?arguments[0]:null;this.clickTrackingURLTemplates&&this.clickTrackingURLTemplates.length&&this.trackURLs(this.clickTrackingURLTemplates);var t=this.clickThroughURLTemplate||e;if(t){var n=this.linear?{CONTENTPLAYHEAD:this.progressFormatted()}:{},r=yt.resolveURLTemplates([t],n)[0];this.emit("clickthrough",r)}}},{key:"track",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];"closeLinear"===e&&!this.trackingEvents[e]&&this.trackingEvents.close&&(e="close");var n=this.trackingEvents[e],r=this.emitAlwaysEvents.indexOf(e)>-1;n?(this.emit(e,""),this.trackURLs(n)):r&&this.emit(e,""),t&&(delete this.trackingEvents[e],r&&this.emitAlwaysEvents.splice(this.emitAlwaysEvents.indexOf(e),1))}},{key:"trackURLs",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.linear&&(this.creative&&this.creative.mediaFiles&&this.creative.mediaFiles[0]&&this.creative.mediaFiles[0].fileURL&&(t.ASSETURI=this.creative.mediaFiles[0].fileURL),t.CONTENTPLAYHEAD=this.progressFormatted()),yt.track(e,t)}},{key:"progressFormatted",value:function(){var e=parseInt(this.progress),t=e/3600;t.length<2&&(t="0".concat(t));var n=e/60%60;n.length<2&&(n="0".concat(n));var r=e%60;return r.length<2&&(r="0".concat(n)),"".concat(t,":").concat(n,":").concat(r,".").concat(parseInt(100*(this.progress-e)))}}]),n}(Vt),yn=function(e,t,n,r){var o,i={},A={started:!1,active:!1,isVideoEnded:!1,lang:n.getLanguage()},a=null,s="",l=null,c="",u="",f=!1,p=n.getBrowser(),d="Android"===p.os||"iOS"===p.os;(o=document.createElement("div")).setAttribute("class","op-ads"),o.setAttribute("id","op-ads"),n.getContainer().append(o),(l=document.createElement("video")).setAttribute("playsinline","true"),l.setAttribute("title","Advertisement"),l.setAttribute("class","op-ads-vast-video"),(u=document.createElement("div")).setAttribute("class","op-ads-button"),(c=document.createElement("div")).setAttribute("class","op-ads-textview"),u.append(c),o.append(l),o.append(u),s=o;var g=new mn,h=null,v=null,m=function(e){console.log(e),l.style.display="none",t.trigger(se,{code:e.code,message:e.message}),A.active=!1,A.started=!0,t.play()};return i.isActive=function(){return A.active},i.started=function(){return A.started},i.play=function(){return A.started?l.play():new Promise((function(o,i){!function s(){t.metaLoaded()?(OvenPlayerConsole.log("VAST : main contents meta loaded."),function(){OvenPlayerConsole.log("VAST : checkAutoplaySupport() ");var n=document.createElement("video");n.setAttribute("playsinline","true"),n.src=Xe,n.load(),l.load(),d&&t.getName()!==ue&&e.load();var r=function(e,t){f=e,n.pause(),n.remove()};return new Promise((function(e,t){if(n.play){var o=n.play();void 0!==o?o.then((function(){OvenPlayerConsole.log("VAST : auto play allowed."),r(!0),e()})).catch((function(t){OvenPlayerConsole.log("VAST : auto play failed",t.message),r(!1),e()})):(OvenPlayerConsole.log("VAST : promise not support"),r(!0),e())}else OvenPlayerConsole.log("VAST : !temporarySupportCheckVideo.play"),r(!0),e()}))}().then((function(){n.isAutoStart()&&!f?(OvenPlayerConsole.log("VAST : autoplayAllowed : false"),A.started=!1,i(new Error("autoplayNotAllowed"))):(g.get(r).then((function(n){if(OvenPlayerConsole.log("VAST : initRequest()"),!(v=n.ads[0]))throw{code:401,message:"File not found. Unable to find Linear/MediaFile from URI."};h=new Cn(g,v,v.creatives[0]),OvenPlayerConsole.log("VAST : created ad tracker."),a=function(e,t,n,r,o,i,A){var a={},s={},l=ze(i),c=ze(o),u=ze(e);n.on(Re,(function(t){t.mute?e.muted=!0:(e.muted=!1,e.volume=t.volume/100)}),s);var f=function(){r.active=!1,c.hide(),!r.started||0!==n.getPosition()&&r.isVideoEnded||(u.hide(),n.play()),n.trigger(ae)},p=function(n){l.hasClass("videoAdUiAction")&&(t.skip(),e.pause(),f())};return i.addEventListener("click",p,!1),a.error=function(){OvenPlayerConsole.log("VAST : listener : error.",e.error),console.log("VAST : listener : error.",e.error);var n={},r=e.error&&e.error.code||0;2===r?(n.code=402,n.message="Timeout of MediaFile URI."):3===r?(n.code=405,n.message="Problem displaying MediaFile. Video player found a MediaFile with supported type but couldn’t display it. MediaFile may include: unsupported codecs, different MIME type than MediaFile@type, unsupported delivery method, etc."):4===r?(n.code=403,n.message="Couldn’t find MediaFile that is supported by this video player, based on the attributes of the MediaFile element."):(n.code=400,n.message="General Linear error. Video player is unable to display the Linear Ad."),t.errorWithCode(n.code),A("405")},a.canplay=function(){},a.ended=function(){t.complete(),f()},a.click=function(e){t.click()},a.play=function(){t.setPaused(!1)},a.pause=function(){t.setPaused(!0)},a.timeupdate=function(r){t.setProgress(r.target.currentTime),n.trigger(Se,{duration:e.duration,position:e.currentTime})},a.volumechange=function(e){OvenPlayerConsole.log("VAST : listener : Ad Video Volumechange."),t.setMuted(e.target.muted)},a.loadedmetadata=function(){OvenPlayerConsole.log("VAST : listener : Ad CONTENT LOADED ."),ee===n.getState()&&n.pause(),t.trackImpression(),n.trigger(oe,{remaining:e.duration,isLinear:!0}),e.play()},t.on("skip",(function(){OvenPlayerConsole.log("VAST : listener : skipped")})),t.on("mute",(function(){OvenPlayerConsole.log("VAST : listener : muted")})),t.on("unmute",(function(){OvenPlayerConsole.log("VAST : listener : unmuted")})),t.on("resume",(function(){OvenPlayerConsole.log("VAST : listener : vastTracker resumed."),r.started&&n.setState(ie)})),t.on("pause",(function(){OvenPlayerConsole.log("VAST : listener : vastTracker paused."),n.setState(Ae)})),t.on("clickthrough",(function(e){OvenPlayerConsole.log("VAST : listener : clickthrough :",e),window.open(e,"_blank")})),t.on("skip-countdown",(function(e){0===e?("ko"===r.lang?l.html("광고 건너뛰기"):l.html("Ad Skip"),l.addClass("videoAdUiAction")):"ko"===r.lang?l.html(parseInt(e)+1+"초 후에 이 광고를 건너뛸 수 있습니다."):l.html("You can skip this ad in "+(parseInt(e)+1))})),t.on("rewind",(function(){OvenPlayerConsole.log("VAST : listener : rewind")})),t.on("start",(function(){OvenPlayerConsole.log("VAST : listener : started"),r.started=!0,r.active=!0,u.show(),c.show(),n.trigger(Ie,{isLinear:!0}),n.setState(ie)})),t.on("firstQuartile",(function(){OvenPlayerConsole.log("VAST : listener : firstQuartile")})),t.on("midpoint",(function(){OvenPlayerConsole.log("VAST : listener : midpoint")})),t.on("thirdQuartile",(function(){OvenPlayerConsole.log("VAST : listener : thirdQuartile")})),t.on("creativeView",(function(){OvenPlayerConsole.log("VAST : listener : creativeView")})),Object.keys(a).forEach((function(t){e.removeEventListener(t,a[t]),e.addEventListener(t,a[t])})),s.destroy=function(){OvenPlayerConsole.log("EventListener : destroy()"),i.removeEventListener("click",p,!1),Object.keys(a).forEach((function(t){e.removeEventListener(t,a[t])}))},s}(l,h,t,A,u,c,m);var r="";v.creatives&&v.creatives.length>0&&v.creatives[0].mediaFiles&&v.creatives[0].mediaFiles.length>0&&v.creatives[0].mediaFiles[0].fileURL&&(r=v.creatives[0].mediaFiles[0].fileURL,OvenPlayerConsole.log("VAST : media url : ",r)),l.src=r,l.volume=e.volume,l.muted=e.muted})).catch((function(e){m(e)})),o())}))):setTimeout(s,100)}()}))},i.pause=function(){l.pause()},i.videoEndedCallback=function(e){e(),A.isVideoEnded=!0},i.destroy=function(){a&&(a.destroy(),a=null),h=null,g=null,s.remove()},i},bn=function(e,t,n){OvenPlayerConsole.log("[Provider] loaded. ");var r={};Ge(r);var o=e.element,i=null,A=null;e.adTagUrl&&(OvenPlayerConsole.log("[Provider] Ad Client - ",t.getAdClient()),(i="vast"===t.getAdClient()?yn(o,r,t,e.adTagUrl):et(o,r,t,e.adTagUrl))||console.log("Can not load due to google ima for Ads.")),A=function(e,t,n,r){var o={};OvenPlayerConsole.log("EventListener loaded.",e,t);var i={},A=-1,a=e;return o.canplay=function(){t.setCanSeek(!0),t.trigger("bufferFull"),OvenPlayerConsole.log("EventListener : on canplay")},o.durationchange=function(){o.progress(),OvenPlayerConsole.log("EventListener : on durationchange"),t.trigger("durationChanged")},o.ended=function(){OvenPlayerConsole.log("EventListener : on ended"),a.pause(),t.getState()!==X&&t.getState()!==q&&t.getState()!==te&&(n?n((function(){t.setState(q)})):t.setState(q))},o.loadeddata=function(){},o.loadedmetadata=function(){var e=t.getSources(),n=t.getCurrentSource(),r=n>-1?e[n].type:"",o={duration:t.isLive()?1/0:a.duration,type:r};t.setMetaLoaded(),OvenPlayerConsole.log("EventListener : on loadedmetadata",o),t.trigger(Me,o)},o.pause=function(){return t.getState()!==q&&t.getState()!==te&&!a.ended&&!a.error&&a.currentTime!==a.duration&&(OvenPlayerConsole.log("EventListener : on pause"),void t.setState($))},o.loadstart=function(){r&&!r.getConfig().showBigPlayButton&&r.getConfig().autoStart&&t.setState(ne)},o.play=function(){A=-1,a.paused||t.getState()===ee||t.setState(ne)},o.playing=function(){OvenPlayerConsole.log("EventListener : on playing"),A<0&&t.setState(ee)},o.progress=function(){var e=a.buffered;if(!e)return!1;var n,r=a.duration,o=a.currentTime,i=(n=(e.length>0?e.end(e.length-1):0)/r,Math.max(Math.min(n,1),0));t.setBuffer(100*i),t.trigger(Te,{bufferPercent:100*i,position:o,duration:r}),OvenPlayerConsole.log("EventListener : on progress",100*i)},o.timeupdate=function(){var e=a.currentTime,n=a.duration;if(!isNaN(n)){if(e>n)return a.pause(),void t.setState(q);var r=t.getSources()[t.getCurrentSource()].sectionStart;r&&eo&&t.getState()===ee)return t.stop(),void t.setState(q);n>9e15&&(n=1/0),t.isSeeking()||a.paused||t.getState()!==re&&t.getState()!==ne&&t.getState()!==ie||function(e,t){return e.toFixed(2)===t.toFixed(2)}(A,e)||(A=-1,t.setState(ee)),r&&r>0&&(e-=r)<0&&(e=0),o&&(n=o),r&&(n-=r),(t.getState()===ee||t.isSeeking())&&t.trigger(Le,{position:e,duration:n})}},o.seeking=function(){t.setSeeking(!0),OvenPlayerConsole.log("EventListener : on seeking",a.currentTime),t.trigger("seek",{position:a.currentTime})},o.seeked=function(){t.isSeeking()&&(OvenPlayerConsole.log("EventListener : on seeked"),t.setSeeking(!1),t.trigger("seeked"))},o.stalled=function(){OvenPlayerConsole.log("EventListener : on stalled")},o.waiting=function(){OvenPlayerConsole.log("EventListener : on waiting",t.getState()),t.isSeeking()?t.setState(ne):t.getState()===ee&&(A=a.currentTime,t.setState(re))},o.volumechange=function(){OvenPlayerConsole.log("EventListener : on volumechange",Math.round(100*a.volume)),t.trigger(Re,{volume:Math.round(100*a.volume),mute:a.muted})},o.error=function(){var e={0:300,1:301,2:302,3:303,4:304}[a.error&&a.error.code||0]||0;OvenPlayerConsole.log("EventListener : on error",e),qe(We.codes[e],t)},Object.keys(o).forEach((function(e){a.removeEventListener(e,o[e]),a.addEventListener(e,o[e])})),i.destroy=function(){OvenPlayerConsole.log("EventListener : destroy()"),Object.keys(o).forEach((function(e){a.removeEventListener(e,o[e])}))},i}(o,r,i?i.videoEndedCallback:null,t),o.playbackRate=o.defaultPlaybackRate=t.getPlaybackRate();var a=function(i){var A=e.sources[e.currentSource];if(e.framerate=A.framerate,r.setVolume(t.getVolume()),e.framerate||t.setTimecodeMode(!0),n)n(A,i);else{OvenPlayerConsole.log("source loaded : ",A,"lastPlayPosition : "+i);var a=o.src;A.file!==a&&(o.src=A.file,(a||""===a)&&o.load()),r.on(Me,(function(){i>0&&r.seek(i)}))}};return r.getName=function(){return e.name},r.getMse=function(){return e.mse},r.getMediaElement=function(){return e.element},r.canSeek=function(){return e.canSeek},r.setCanSeek=function(t){e.canSeek=t},r.isSeeking=function(){return e.seeking},r.setSeeking=function(t){e.seeking=t},r.setMetaLoaded=function(){e.isLoaded=!0},r.metaLoaded=function(){return e.isLoaded},r.setState=function(t){if(e.state!==t){var n=e.state;if(OvenPlayerConsole.log("Provider : setState()",t),n===ie&&(t===te||t===X))return!1;switch(OvenPlayerConsole.log("Provider : triggerSatatus",t),t){case q:r.trigger("complete");break;case $:r.trigger(be,{prevState:e.state,newstate:$});break;case Ae:r.trigger(be,{prevState:e.state,newstate:Ae});break;case ee:r.trigger(we,{prevState:e.state,newstate:ee});break;case ie:r.trigger(we,{prevState:e.state,newstate:ie})}e.state=t,r.trigger(ye,{prevstate:n,newstate:e.state})}},r.getState=function(){return e.state},r.setBuffer=function(t){e.buffer=t},r.getBuffer=function(){return e.buffer},r.isLive=function(){return!!e.isLive||o.duration===1/0},r.getDuration=function(){return r.isLive()?1/0:o.duration},r.getPosition=function(){return o?o.currentTime:0},r.setVolume=function(e){if(!o)return!1;o.volume=e/100,t.setVolume(e)},r.getVolume=function(){return t.getVolume()},r.setMute=function(e){if(!o)return!1;if(void 0===e){var n=t.isMute();o.muted=!n,t.setMute(!n),r.trigger(Qe,{mute:t.isMute()})}else o.muted=e,t.setMute(e),r.trigger(Qe,{mute:t.isMute()});return o.muted},r.getMute=function(){return t.isMute()},r.preload=function(n,o){return e.sources=n,e.currentSource=$e(n,t),a(o||0),new Promise((function(e,n){t.isMute()&&r.setMute(!0),t.getVolume()&&r.setVolume(t.getVolume()),e()}))},r.load=function(n){e.sources=n,e.currentSource=$e(n,t),a(0)},r.play=function(){if(OvenPlayerConsole.log("Provider : play()"),!o)return!1;if(r.getState()!==ee)if(i&&i.isActive()||i&&!i.started())i.play().then((function(e){OvenPlayerConsole.log("Provider : ads play success")})).catch((function(e){OvenPlayerConsole.log("Provider : ads play fail",e)}));else{var e=o.play();void 0!==e?e.then((function(){OvenPlayerConsole.log("Provider : video play success")})).catch((function(e){OvenPlayerConsole.log("Provider : video play error",e.message)})):OvenPlayerConsole.log("Provider : video play success (ie)")}},r.pause=function(){if(OvenPlayerConsole.log("Provider : pause()"),!o)return!1;r.getState()===ee?o.pause():r.getState()===ie&&i.pause()},r.seek=function(e){if(!o)return!1;o.currentTime=e},r.setPlaybackRate=function(e){return!!o&&(r.trigger("playbackRateChanged",{playbackRate:e}),o.playbackRate=o.defaultPlaybackRate=e)},r.getPlaybackRate=function(){return o?o.playbackRate:0},r.getSources=function(){return o?e.sources.map((function(e,t){var n={file:e.file,type:e.type,label:e.label,index:t,sectionStart:e.sectionStart,sectionEnd:e.sectionEnd,gridThumbnail:e.gridThumbnail};return e.lowLatency&&(n.lowLatency=e.lowLatency),n})):[]},r.getCurrentSource=function(){return e.currentSource},r.setCurrentSource=function(n,i){if(n>-1&&e.sources&&e.sources.length>n)return OvenPlayerConsole.log("source changed : "+n),e.currentSource=n,r.trigger(Oe,{currentSource:n}),t.setSourceIndex(n),r.setState(X),i&&a(o.currentTime||0),e.currentSource},r.getQualityLevels=function(){return o?e.qualityLevels:[]},r.getCurrentQuality=function(){return o?e.currentQuality:null},r.setCurrentQuality=function(e){},r.isAutoQuality=function(){},r.setAutoQuality=function(e){},r.getFramerate=function(){return e.framerate},r.setFramerate=function(t){return e.framerate=t},r.seekFrame=function(t){var n=e.framerate,i=(o.currentTime*n+t)/n;i+=1e-5,r.pause(),r.seek(i)},r.stop=function(){if(!o)return!1;for(OvenPlayerConsole.log("CORE : stop() "),o.removeAttribute("preload"),o.removeAttribute("src");o.firstChild;)o.removeChild(o.firstChild);r.pause(),r.setState(X)},r.destroy=function(){if(!o)return!1;r.stop(),A.destroy(),i&&(i.destroy(),i=null),r.off(),OvenPlayerConsole.log("CORE : destroy() player stop, listener, event destroied")},r.super=function(e){var t=r[e];return function(){return t.apply(r,arguments)}},r},wn=function(e,t,n){var r=bn({name:le,element:e,mse:null,listener:null,isLoaded:!1,canSeek:!1,isLive:!1,seeking:!1,state:X,buffer:0,framerate:0,currentQuality:-1,currentSource:-1,qualityLevels:[],sources:[],adTagUrl:n},t,null),o=r.super("destroy");return OvenPlayerConsole.log("HTML5 PROVIDER LOADED."),r.destroy=function(){OvenPlayerConsole.log("HTML5 : PROVIDER DESTROYED."),o()},r},En=function(e,t,n,r,o,A,a,s){var l={},c={},u=null,f=!1,p=null,d=null,g={},h=!1,v=!1,m=null,C=!1;a.getConfig().webrtcConfig&&!0===a.getConfig().webrtcConfig.recoverPacketLoss&&(v=!0);var y=!0;a.getConfig().webrtcConfig&&!1===a.getConfig().webrtcConfig.generatePublicCandidate&&(y=a.getConfig().webrtcConfig.generatePublicCandidate);var b,w=Y();function E(e){var t=null;return d&&e===d.id?t=d.peerConnection:g[e]&&(t=g[e].peerConnection),t}function B(e){e.statisticsTimer&&clearTimeout(e.statisticsTimer),e.status||(e.status={},e.status.lostPacketsArr=[],e.status.slotLength=8,e.status.prevPacketsLost=0,e.status.avg8Losses=0,e.status.avgMoreThanThresholdCount=0,e.status.threshold=40);var t=e.status.lostPacketsArr,n=e.status.slotLength,r=e.status.prevPacketsLost,o=e.status.avg8Losses,A=e.status.threshold;e.statisticsTimer=setTimeout((function(){if(!e.peerConnection)return!1;e.peerConnection.getStats().then((function(s){s&&a.getConfig().autoFallback&&s&&(s.forEach((function(a){if("inbound-rtp"===a.type&&"video"===a.kind&&!a.isRemote){var s=parseInt(a.packetsLost)-parseInt(r);t.push(parseInt(a.packetsLost)-parseInt(r)),t.length>n&&t.shift(),t.length===n&&(o=i().reduce(t,(function(e,t){return e+t}),0)/n,OvenPlayerConsole.log("Last8 LOST PACKET AVG : "+o,"Current Packet LOST: "+s,"Total Packet Lost: "+a.packetsLost,t),o>A?(e.status.avgMoreThanThresholdCount=e.status.avgMoreThanThresholdCount+1,e.status.avgMoreThanThresholdCount>=60&&(OvenPlayerConsole.log("NETWORK UNSTABLED!!! "),Q(We.codes[510]))):e.status.avgMoreThanThresholdCount=0),e.status.prevPacketsLost=a.packetsLost}})),B(e))}))}),2e3)}function x(e,o,A,s,c){var f={};if(a.getConfig().webrtcConfig&&a.getConfig().webrtcConfig.iceServers)f.iceServers=a.getConfig().webrtcConfig.iceServers,a.getConfig().webrtcConfig.iceTransportPolicy&&(f.iceTransportPolicy=a.getConfig().webrtcConfig.iceTransportPolicy);else if(c){f.iceServers=[];for(var g=0;g-1){y=!0;break}if(!y&&C.urls.length>0){var E=i().clone(C.urls[0]),x=S(E);b&&x&&C.urls.push(E.replace(x,b))}C.username=m.username||m.user_name,C.credential=m.credential,f.iceServers.push(C)}f.iceTransportPolicy="relay"}else f=l;OvenPlayerConsole.log("Main Peer Connection Config : ",f);var k=null;try{k=new RTCPeerConnection(f)}catch(e){var T=We.codes[506];return T.error=e,void Q(T)}d={id:e,peerId:o,peerConnection:k},k.setRemoteDescription(new RTCSessionDescription(A)).then((function(){k.createAnswer().then((function(t){var n=function(e){for(var t=e.split("\r\n"),n=-1,r=0;r-1&&t[r].indexOf("opus")>-1){n=t[r].split(" ")[0].split(":")[1];break}return n}(A.sdp);n>-1&&function(e,t){for(var n=e.split("\r\n"),r=!1,o=0;o-1){n[o].indexOf("stereo=1")>-1&&(r=!0);break}return r}(A.sdp,n)&&(t.sdp=function(e,t){for(var n=e.split("\r\n"),r=0;r-1){-1===n[r].indexOf("stereo=1")&&(n[r]=n[r]+";stereo=1");break}return n.join("\r\n")}(t.sdp,n)),OvenPlayerConsole.log("Local SDP",t),M(u,{id:e,peer_id:o,command:"answer",sdp:t}),OvenPlayerConsole.log("create Host Answer : success"),k.setLocalDescription(t).then((function(){})).catch((function(e){var t=We.codes[505];t.error=e,Q(t)}))})).catch((function(e){var t=We.codes[504];t.error=e,Q(t)}))})).catch((function(e){var t=We.codes[503];t.error=e,Q(t)})),s&&L(k,s),k.onicecandidate=function(t){t.candidate&&(OvenPlayerConsole.log("WebRTCLoader send candidate to server : ",t.candidate),M(u,{id:e,peer_id:o,command:"candidate",candidates:[t.candidate]}))},k.onconnectionstatechange=function(e){OvenPlayerConsole.log("[on connection state change]",k.connectionState,e),"connected"===k.connectionState&&r&&r()},k.onicecandidateerror=function(e){},k.onicegatheringstatechange=function(e){},k.oniceconnectionstatechange=function(e){OvenPlayerConsole.log("[on ice connection state change]",k.iceConnectionState,e),"connected"===k.iceConnectionState&&r&&r(),("disconnected"===k.iceConnectionState||"closed"===k.iceConnectionState)&&(h||d&&Q(We.codes[511]))},k.ontrack=function(e){if(OvenPlayerConsole.log("stream received."),OvenPlayerConsole.log("Recovery On Packet Loss :",v),v&&B(d),p=e.streams[0],n(e.streams[0]),a.getConfig().webrtcConfig&&a.getConfig().webrtcConfig.playoutDelayHint)for(var t=a.getConfig().webrtcConfig.playoutDelayHint,r=d.peerConnection.getReceivers(),o=0;o0){for(var n in g){var r=g[n].peerConnection;r&&(OvenPlayerConsole.log("Closing client peer connection..."),r.close(),r=null)}g={}}u?(OvenPlayerConsole.log("Closing websocket connection..."),OvenPlayerConsole.log("Send Signaling : Stop."),1===u.readyState&&(h=!0,d&&M(u,{command:"stop",id:d.id}),u.close())):h=!1,u=null,t&&(o&&o(t),A(t,e))}function M(e,t){e&&e.send(JSON.stringify(t))}return b=window.onbeforeunload,window.onbeforeunload=function(e){b&&b(e),OvenPlayerConsole.log("This calls auto when browser closed."),Q()},e.setCurrentQuality=function(e){if(!m)return-1;var t=m.renditions[e];return t?(M(u,{command:"change_rendition",id:d.id,rendition_name:t.name,auto:!1}),C=!1,s.currentQuality=e,s.currentQuality):s.currentQuality},e.isAutoQuality=function(){return C},e.setAutoQuality=function(e){M(u,{command:"change_rendition",id:d.id,auto:e}),C=e},c.connect=function(){OvenPlayerConsole.log("WebRTCLoader connecting..."),OvenPlayerConsole.log("WebRTCLoader url : "+t),R()},c.destroy=function(){h=!0,Q()},c},Bn=function(e,t,n){var r={},o=null,i=null,A=null,a=null,s=null,l={name:ce,element:e,mse:null,listener:null,isLoaded:!1,canSeek:!1,isLive:!1,seeking:!1,state:X,buffer:0,framerate:0,currentQuality:-1,currentSource:-1,qualityLevels:[],sources:[],adTagUrl:n},c=1e4,u=0,f=null,p=!1;function d(){if(_e(a.file,a.type)){clearTimeout(f),OvenPlayerConsole.log("WEBRTC : onBeforeLoad : ",a),o&&(o.destroy(),o=null);var n=null,i=null;u>0&&(n=function(){clearTimeout(f)},i=function(){clearTimeout(f),performance.now(),p=!0}),o=En(r,a.file,(function(t){if(e.srcObject&&(e.srcObject=null),s&&(s.close(),s=null),e.srcObject=t,t.getAudioTracks().length>0){var n=window.AudioContext||window.webkitAudioContext;(function(e){var t=/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent),n=(/iPhone|iPad|iPod/i.test(navigator.userAgent),!1);t&&"suspended"===e.state&&document.addEventListener("touchend",(function(){n||"running"===e.state||(e.resume(),n=!0)}))})(s=new n),s.createMediaStreamSource(t)}}),i,n,qe,t,l),performance.now(),o.connect(),u>0&&(r.once(ye,(function(e){p||e.newstate===X&&(clearTimeout(f),g())})),r.once(Ce,(function(){p=!1})),f=setTimeout((function(){if(u>0)p||(g(),d());else{g();var e=We.codes[512];qe(e,r)}u--}),c))}}function g(){o&&(o.destroy(),o=null,e.srcObject=null)}return r=bn(l,t,(function(e){var n=t.getConfig();n.webrtcConfig&&("number"==typeof n.webrtcConfig.connectionTimeout&&n.webrtcConfig.connectionTimeout>0&&(c=n.webrtcConfig.connectionTimeout),"number"==typeof n.webrtcConfig.timeoutMaxRetry&&n.webrtcConfig.timeoutMaxRetry>0&&(u=n.webrtcConfig.timeoutMaxRetry)),a=e,d()})),i=r.super("destroy"),A=r.super("play"),OvenPlayerConsole.log("WEBRTC PROVIDER LOADED."),r.destroy=function(){clearTimeout(f),g(),OvenPlayerConsole.log("WEBRTC : PROVIDER DESTROYED."),i()},r.play=function(){u>0&&!p&&d(),A()},r},xn=function(e,t,n){var r=t?1e3:1024;if(Math.abs(e)=r&&A=0&&r.seek(t)})),o.on(Hls.Events.LEVEL_SWITCHED,(function(e,t){f.currentQuality=t.level,r.trigger(De,{isAuto:o.autoLevelEnabled,currentQuality:f.currentQuality,type:"render"})})),o.on(Hls.Events.ERROR,(function(t,n){if(n&&n.networkDetails&&202===n.networkDetails.status)return a&&(clearTimeout(a),a=null),r.setState(ne),void(a=setTimeout((function(){o&&(r.stop(),o.stopLoad(),o.loadSource(e.file))}),1e3));if(n.fatal){var i=302;n&&n.networkDetails&&400===n.networkDetails.status?i=306:n&&n.networkDetails&&403===n.networkDetails.status?i=307:n&&n.networkDetails&&406===n.networkDetails.status&&(i=308);var A=We.codes[i];A.error=n.details,qe(A,r)}})),r.on(ye,(function(e){s||e.prevstate!==ne||e.newstate!==X||(a&&(clearTimeout(a),a=null),o&&o.stopLoad())}))}))).setCurrentQuality=function(e){return o.currentLevel=e,f.currentQuality=e,f.currentQuality},r.isAutoQuality=function(){return o.autoLevelEnabled},r.setAutoQuality=function(e){o.currentLevel=e?-1:o.currentLevel},i=r.super("stop"),r.stop=function(){a&&(clearTimeout(a),a=null),o&&o.stopLoad(),i()},A=r.super("destroy"),r.destroy=function(){a&&(clearTimeout(a),a=null),o&&(o.destroy(),r.trigger("hlsDestroyed")),o=null,OvenPlayerConsole.log("HLS : PROVIDER DESTROYED."),A()},OvenPlayerConsole.log("HLS PROVIDER LOADED.")}catch(e){var p=We.codes[106];throw p.error=e,p}return r},Sn=function(e){var t={};Ge(t),OvenPlayerConsole.log("API loaded.");var n=function(e){var t={},n={playlist:[],currentIndex:0},r=Ke();OvenPlayerConsole.log("PlaylistManager loaded.");var o=function(e){if(e&&(e.file||e.host||e.application||e.stream)){var t=Object.assign({},{default:!1},e);t.file=A(""+t.file),t.host&&t.application&&t.stream&&(t.file=t.host+"/"+t.application+"/stream/"+t.stream,delete t.host,delete t.application,delete t.stream);var n=/^[^/]+\/(?:x-)?([^/]+)$/;if(n.test(t.type)&&(t.mimeType=t.type,t.type=t.type.replace(n,"$1")),Ve(t.file)?t.type="rtmp":_e(t.file)?t.type="webrtc":He(t.file,t.type)?t.type="hls":Je(t.file,t.type)?t.type="dash":t.type||(t.type=a(t.file)),t.lowLatency&&(t.lowLatency=t.lowLatency),t.type){switch(t.type){case"m3u8":case"vnd.apple.mpegurl":t.type="hls";break;case"m4a":t.type="aac";break;case"smil":t.type="rtmp"}return Object.keys(t).forEach((function(e){""===t[e]&&delete t[e]})),t}}};return t.initPlaylist=function(e,t){OvenPlayerConsole.log("PlaylistManager setPlaylist() ",e);var A=(i().isArray(e)?e:[e]).map((function(e){i().isArray(e.tracks)||delete e.tracks;var n=Object.assign({},{sources:[],tracks:[],title:""},e);n.sources!==Object(n.sources)||i().isArray(n.sources)||(n.sources=[o(n.sources)]),i().isArray(n.sources)&&0!==n.sources.length||(n.sources=[o(n)]),i().isArray(n.sources)&&0!==n.sources.length||(e.levels?n.sources=e.levels:n.sources=[o(e)]);for(var A=0;A0}))||[];return n.playlist=A,A},t.getPlaylist=function(){return OvenPlayerConsole.log("PlaylistManager getPlaylist() ",n.playlist),n.playlist},t.getCurrentPlayList=function(){return n.playlist[n.currentIndex]?n.playlist[n.currentIndex]:[]},t.getCurrentPlaylistIndex=function(){return n.currentIndex},t.setCurrentPlaylist=function(t){return n.playlist[t]&&(n.currentIndex=t,e.trigger(he,n.currentIndex)),n.currentIndex},t.getCurrentSources=function(){return n.playlist[n.currentIndex]?(OvenPlayerConsole.log("PlaylistManager getCurrentSources() ",n.playlist[n.currentIndex].sources),n.playlist[n.currentIndex].sources):null},t.getCurrentAdTag=function(){if(n.playlist[n.currentIndex])return n.playlist[n.currentIndex].adTagUrl||""},t}(t),o=function(){var e=Ke(),t={},n={};OvenPlayerConsole.log("ProviderController loaded.");var r=function(e,n){t[e]||(OvenPlayerConsole.log("ProviderController _registerProvider() ",e),t[e]=n)},o={html5:function(){var e=wn;return r(le,e),{name:le,provider:e}},webrtc:function(){var e=Bn;return r(ce,e),{name:ce,provider:e}},dash:function(){var e=kn;return r(ue,e),{name:ue,provider:e}},hls:function(){var e=In;return r(fe,e),{name:fe,provider:e}}};return n.loadProviders=function(t){var n=e.findProviderNamesByPlaylist(t);return OvenPlayerConsole.log("ProviderController loadProviders() ",n),n?Promise.all(n.filter((function(e){return!!o[e]})).map((function(e){return o[e]()}))):Promise.reject(We.codes[101])},n.findByName=function(e){return OvenPlayerConsole.log("ProviderController findByName() ",e),t[e]},n.getProviderBySource=function(t){var r=e.findProviderNameBySource(t);return OvenPlayerConsole.log("ProviderController getProviderBySource() ",r),n.findByName(r)},n.isSameProvider=function(t,n){return OvenPlayerConsole.log("ProviderController isSameProvider() ",e.findProviderNameBySource(t),e.findProviderNameBySource(n)),e.findProviderNameBySource(t)===e.findProviderNameBySource(n)},n}(),s=Y(),l=function(e,t){var n={},r=ze(e),o="";return OvenPlayerConsole.log("MediaManager loaded. browser : ",t),n.createMedia=function(e,t){return n.empty(),i=t.isLoop(),A=t.isAutoStart(),(o=document.createElement("video")).setAttribute("disableremoteplayback",""),o.setAttribute("webkit-playsinline","true"),o.setAttribute("playsinline","true"),i&&o.setAttribute("loop",""),A&&o.setAttribute("autoplay",""),r.append(o),o;var i,A},n.createAdContainer=function(){var e=document.createElement("div");return e.setAttribute("class","op-ads"),r.append(e),e},n.empty=function(){OvenPlayerConsole.log("MediaManager removeElement()"),r.removeChild(o),o=null},n.destroy=function(){r.removeChild(),r=null,o=null},n}(e,s),c="",u="",f="",p=function(e){OvenPlayerConsole.log("runNextPlaylist");var r=e,o=!!n.getPlaylist()[r];u.setSourceIndex(0),u.setVolume(c.getVolume()),o?(n.setCurrentPlaylist(r),d()):t.trigger(ve,null)},d=function(e){return o.loadProviders(n.getCurrentPlayList()).then((function(e){if(e.length<1)throw We.codes[101];c&&(c.destroy(),c=null),f&&(f.destroy(),f=null),f=function(e,t){var n={},r=[],o=-1,A=K(),a=!0;OvenPlayerConsole.log("Caption Manager >> ",t);var s=function(e,t){return e.data=t||[],e.name=e.label||e.name||e.language,e.id=function(e,t){var n,o=e.kind||"cc";return n=e.default||e.defaulttrack?"default":e.id||o+t,a&&(l(r.length||0),a=!1),n}(e,r.length),r.push(e),e.id},l=function(t){o=t,e.trigger(Pe,o)};if(e.getConfig().playlist&&e.getConfig().playlist.length>0){var c=e.getConfig().playlist[t];if(c&&c.tracks&&c.tracks.length>0)for(var u=function(t){var n=c.tracks[t];Ye(n.kind)&&!i().findWhere(n,{file:n.file})&&A.load(n,n.lang,(function(e){e&&e.length>0&&s(n,e)}),(function(t){var n=We.codes[305];n.error=t,e.trigger(Ce,n)}))},f=0;f-1&&r[o]){var A=i().filter(r[o].data,(function(e){return n>=e.startTime&&(!e.endTime||n)<=e.endTime}));A&&A.length>0&&e.trigger(Fe,A[0])}})),n.flushCaptionList=function(e){r=[],l(e)},n.getCaptionList=function(){return r||[]},n.getCurrentCaption=function(){return o},n.setCurrentCaption=function(e){if(!(e>-2&&e0&&s(t,e)}),(function(t){var n=errors[305];n.error=t,e.trigger(Ce,n)}))},n.removeCaption=function(e){return e>-1&&e=.25&&e<=4})).map((function(e){return Math.round(4*e)/4}))).indexOf(1)<0&&A.push(1),A.sort(),t.playbackRates=A,t.rtmpBufferTime=t.rtmpBufferTime>10?10:t.rtmpBufferTime,t.rtmpBufferTimeMax=t.rtmpBufferTimeMax>50?50:t.rtmpBufferTimeMax,t.playbackRates.indexOf(t.playbackRate)<0&&(t.playbackRate=1);var a=t.playlist;if(a)i().isArray(a.playlist)&&(t.feedData=a,t.playlist=a.playlist);else{var s=i().pick(t,["title","description","type","image","file","sources","tracks","host","application","stream","adTagUrl"]);t.playlist=[s]}return delete t.duration,t}(e);return{getConfig:function(){return n},getAdClient:function(){return n.adClient},setConfig:function(e,t){n[e]=t},getContainer:function(){return n.mediaContainer},getPlaybackRate:function(){return n.playbackRate},setPlaybackRate:function(e){return n.playbackRate=e,e},getQualityLabel:function(){return n.qualityLabel},setQualityLabel:function(e){n.qualityLabel=e},isCurrentProtocolOnly:function(){return n.currentProtocolOnly},getSourceIndex:function(){return n.sourceIndex},setSourceIndex:function(e){n.sourceIndex=e},setTimecodeMode:function(e){n.timecode!==e&&(n.timecode=e,t.trigger(Ue,e))},isTimecodeMode:function(){return n.timecode},getRtmpBufferTime:function(){return n.rtmpBufferTime},getRtmpBufferTimeMax:function(){return n.rtmpBufferTimeMax},setMute:function(e){n.mute=e},isMute:function(){return n.mute},getVolume:function(){return n.volume},setVolume:function(e){n.volume=e},isLoop:function(){return n.loop},isAutoStart:function(){return n.autoStart},isControls:function(){return n.controls},getPlaybackRates:function(){return n.playbackRates},getBrowser:function(){return n.browser},getSystemText:function(){return n.systemText},getLanguage:function(){return n.lang},getPlaylist:function(){return n.playlist},setPlaylist:function(e){return i().isArray(e)?n.playlist=e:n.playlist=[e],n.playlist}}}(r,t),OvenPlayerConsole.log("API : init()"),OvenPlayerConsole.log("API : init() config : ",u),We.codes=u.getSystemText().api.error,n.initPlaylist(u.getPlaylist(),u),OvenPlayerConsole.log("API : init() sources : ",n.getCurrentSources()),d(),setTimeout((function(){t.trigger(de)}))},t.getProviderName=function(){return c?c.getName():null},t.getMseInstance=function(){return c?c.getMse():null},t.getConfig=function(){return OvenPlayerConsole.log("API : getConfig()",u.getConfig()),u.getConfig()},t.getBrowser=function(){return u.getBrowser()},t.setTimecodeMode=function(e){OvenPlayerConsole.log("API : setTimecodeMode()",e),u.setTimecodeMode(e)},t.isTimecodeMode=function(){return OvenPlayerConsole.log("API : isTimecodeMode()"),u.isTimecodeMode()},t.getFramerate=function(){if(OvenPlayerConsole.log("API : getFramerate()"),c)return c.getFramerate()},t.seekFrame=function(e){return c?(OvenPlayerConsole.log("API : seekFrame()",e),c.seekFrame(e)):null},t.getDuration=function(){return c?(OvenPlayerConsole.log("API : getDuration()",c.getDuration()),c.getDuration()):null},t.getPosition=function(){return c?(OvenPlayerConsole.log("API : getPosition()",c.getPosition()),c.getPosition()):null},t.getVolume=function(){return c?(OvenPlayerConsole.log("API : getVolume()",c.getVolume()),c.getVolume()):null},t.setVolume=function(e){if(!c)return null;OvenPlayerConsole.log("API : setVolume() "+e),c.setVolume(e)},t.setMute=function(e){return c?(OvenPlayerConsole.log("API : setMute() "+e),c.setMute(e)):null},t.getMute=function(){return c?(OvenPlayerConsole.log("API : getMute() "+c.getMute()),c.getMute()):null},t.load=function(e){return OvenPlayerConsole.log("API : load() ",e),e&&(u.setSourceIndex(0),c&&c.getQualityLevels().length>0&&c.setCurrentQuality(0),"sources"in e?u.setPlaylist(e):u.setPlaylist({sources:e}),n.initPlaylist(u.getPlaylist(),u)),d()},t.play=function(){if(!c)return null;OvenPlayerConsole.log("API : play() "),c.metaLoaded()||u.isAutoStart()?c.play():t.once(Me,(function(){c.play()}))},t.pause=function(){if(!c)return null;OvenPlayerConsole.log("API : pause() "),c.pause()},t.seek=function(e){if(!c)return null;OvenPlayerConsole.log("API : seek() "+e),c.seek(e)},t.setPlaybackRate=function(e){return c?(OvenPlayerConsole.log("API : setPlaybackRate() ",e),c.setPlaybackRate(u.setPlaybackRate(e))):null},t.getPlaybackRate=function(){return c?(OvenPlayerConsole.log("API : getPlaybackRate() ",c.getPlaybackRate()),c.getPlaybackRate()):null},t.getPlaylist=function(){return OvenPlayerConsole.log("API : getPlaylist() ",n.getPlaylist()),n.getPlaylist()},t.getCurrentPlaylist=function(){return OvenPlayerConsole.log("API : getCurrentPlaylist() ",n.getCurrentPlaylistIndex()),n.getCurrentPlaylistIndex()},t.setCurrentPlaylist=function(e){OvenPlayerConsole.log("API : setCurrentPlaylist() ",e),p(e)},t.getSources=function(){return c?(OvenPlayerConsole.log("API : getSources() ",c.getSources()),c.getSources()):null},t.getCurrentSource=function(){return c?(OvenPlayerConsole.log("API : getCurrentSource() ",c.getCurrentSource()),c.getCurrentSource()):null},t.setCurrentSource=function(e){if(!c)return null;OvenPlayerConsole.log("API : setCurrentSource() ",e);var n=c.getPosition();return u.setSourceIndex(e),d(n).then((function(){t.trigger(Oe,{currentSource:e})})),e},t.getQualityLevels=function(){return c?(OvenPlayerConsole.log("API : getQualityLevels() ",c.getQualityLevels()),c.getQualityLevels()):null},t.getCurrentQuality=function(){return c?(OvenPlayerConsole.log("API : getCurrentQuality() ",c.getCurrentQuality()),c.getCurrentQuality()):null},t.setCurrentQuality=function(e){return c?(OvenPlayerConsole.log("API : setCurrentQuality() ",e),c.setCurrentQuality(e)):null},t.isAutoQuality=function(){return c?(OvenPlayerConsole.log("API : isAutoQuality()"),c.isAutoQuality()):null},t.setAutoQuality=function(e){return c?(OvenPlayerConsole.log("API : setAutoQuality() ",e),c.setAutoQuality(e)):null},t.getCaptionList=function(){return f?(OvenPlayerConsole.log("API : getCaptionList() ",f.getCaptionList()),f.getCaptionList()):null},t.getCurrentCaption=function(){return f?(OvenPlayerConsole.log("API : getCurrentCaption() ",f.getCurrentCaption()),f.getCurrentCaption()):null},t.setCurrentCaption=function(e){if(!f)return null;OvenPlayerConsole.log("API : setCurrentCaption() ",e),f.setCurrentCaption(e)},t.addCaption=function(e){return f?(OvenPlayerConsole.log("API : addCaption() "),f.addCaption(e)):null},t.removeCaption=function(e){return f?(OvenPlayerConsole.log("API : removeCaption() ",e),f.removeCaption(e)):null},t.getBuffer=function(){if(!c)return null;OvenPlayerConsole.log("API : getBuffer() ",c.getBuffer()),c.getBuffer()},t.getState=function(){return c?(OvenPlayerConsole.log("API : getState() ",c.getState()),c.getState()):null},t.stop=function(){if(!c)return null;OvenPlayerConsole.log("API : stop() "),c.stop()},t.remove=function(){OvenPlayerConsole.log("API : remove() "),f&&(f.destroy(),f=null),c&&(c.destroy(),c=null),l&&(l.destroy(),l=null),t.trigger(ge),t.off(),o=null,n=null,u=null,OvenPlayerConsole.log("API : remove() - currentProvider, providerController, playlistManager, playerConfig, api event destroed. "),Tn.removePlayer(t)},t.getMediaElement=function(){return c.getMediaElement()},t.getVersion=function(){return r},t},Tn=(sn=(an={}).playerList=[],an.create=function(e,t){window.OvenPlayerConsole&&0!==Object.keys(window.OvenPlayerConsole).length||(window.OvenPlayerConsole={},OvenPlayerConsole.log=function(){});var n=Ze(e),r=Sn(n);return r.init(t),sn.push(r),r},an.getPlayerList=function(){return sn},an.getPlayerByContainerId=function(e){for(var t=0;t
'+(t.isRoot?"":'<')+''+t.title+'
';return i().forEach(t.body,(function(e){n+=Rn(e,t.useCheck)})),n+="
"},Rn=function(e,t){return'
'+(t?'':"")+''+e.title+""+(e.hasNext?'>'+e.description+"":"")+"
"},Qn=function(e,t){return'
')+'
').concat(e.image?""):''," ").concat(e.duration?''.concat(s(e.duration),""):"","
")+'
'.concat(e.title,"
")+"
"},Mn={TextViewTemplate:function(e){return'
'+"

".concat(e,"

")+'
'},ViewTemplate:function(e,t){return'
")+'
'},HelpersTemplate:function(e,t){return'
'},BigButtonTemplate:function(e,t){return'
'+"".concat(t===ee?'':"")+"".concat(t===$?'':"")+"".concat(t===X?'':"")+"".concat(t===q?'':"")+"
"},ThumbnailTemplate:function(e,t){return'
'+"".concat(t.title?'
'.concat(t.title,"
"):"")+"
"},WaterMarkTemplate:function(e,t){return'
'+"".concat(t.waterMark.image?''):"")+"".concat(t.waterMark.text?''.concat(t.waterMark.text,""):"")+"
"},MessageBoxTemplate:function(e,t){return'
')+'
'+'
'.concat(t.message)+"".concat(t.description?'
'.concat(t.description,"
"):"")+"
"+"".concat(t.iconClass?'
'):"")+"
"},SpinnerTemplate:function(e){return'
'},ContextPanelTemplate:function(e){return'
'+''.concat(e.context," ").concat(r,"")+"
"},CaptionViewerTemplate:function(e){return'
      
'},ControlsTemplate:function(e,t){return'
'+'
'.concat(t?'':"","
")+'
'},VolumeButtonTemplate:function(e){return'
'},ProgressBarTemplate:function(e){return'
00:00
'},PlayButtonTemplate:function(e){return'
'},SettingButtonTemplate:function(e){return''},FrameButtonsTemplate:function(e){return'
'},TimeDisplayTemplate:function(e,t){return'
'+(t.duration===1/0?''+("webrtc"===t.type?t.isP2P?''.concat(e.controls.low_latency_p2p,""):''.concat(e.controls.low_latency_live,""):"".concat(e.controls.live,""))+"":'00:00 / 00:00')+"
"},FullScreenButtonTemplate:function(e){return''},PanelsTemplate:Ln,SpeedPanelTemplate:Ln,SourcePanelTemplate:Ln,QualityPanelTemplate:Ln,CaptionPanelTemplate:Ln,TimeDisplayPanelTemplate:Ln,PlaylistPanelTemplate:function(e,t){return'
'+'
'.concat(e.playlist,'
')+'
'}},On=function(e,t,n,r,o,A,a,s){var l,c=i().isElement(e)?ze(e):e,u={},f=null,p={};p.data=r;var d=function(e){var t=document.createElement("div");return t.innerHTML=e,l=ze(t.firstChild),t.firstChild};return n&&n.systemText&&(f=n.systemText.ui),s?c.replace(d(Mn[t+"Template"](f,r))):c.append(d(Mn[t+"Template"](f,r))),A&&A(l,p),Object.keys(o).forEach((function(e){var t=e.split(" "),n=t[0].replace(/ /gi,""),r=t[1].replace(/ /gi,""),i="";if(i="document"===r||"window"===r||"body"===r?ze(r):l.find(r)||(l.hasClass(r.replace(".",""))?l:null),!(n&&r&&i))return!1;var A=Object.keys(u).length++,a=function(t){return o[e](t,l,p)};u[A]={name:n,target:r,callback:a};var s=null;n.indexOf("touch")>-1&&(s={passive:!0});var c=i.get().length;if(c>1)for(var f=i.get(),d=0;d1)for(var o=n.get(),i=0;i-1?o=!1:(o=!0,e.find(".op-caption-text").text(""))}),r),t.on(Fe,(function(t){if(!o&&t&&t.text){var n=t.endTime-t.startTime;i&&clearTimeout(i),e.find(".op-caption-text").html(t.text),n&&(i=setTimeout((function(){e.find(".op-caption-text").text("")}),1e3*n))}}),r)}),(function(n){e.find(".op-caption-text").text(""),t.off(Pe,null,n),t.off(Fe,null,n)}))}(e,t),t.on(de,(function(){c&&v(),u&&(r&&r.destroy(),r=function(e,t,n){var r=null,o=null;return On(e,"WaterMark",t.getConfig(),n,{},(function(e,n){r=e.find(".op-watermark"),o=e.find(".op-watermark-text");var A=t.getConfig().waterMark,a=A.position||"top-right",s=A.y||"5%",l=A.x||"2.8125%";r.css(a.split("-")[0],s),r.css(a.split("-")[1],l);var c=A.width||"auto",u=A.height||"auto";r.css("width",c),r.css("height",u);var f=A.opacity||.7;r.css("opacity",f),A.text&&A.font&&i().each(A.font,(function(e,t){o.css(t,e)}))}),(function(){}))}(e,t,t.getConfig())),o||(h($),o=!0)}),p),t.on(ke,(function(n){n.message&&(A&&A.destroy(),a&&a.destroy(),l=Dn(e,t,n.message,null,n.timer,n.iconClass,n.onClickCallback,!1),t.once(Qe,(function(e){!e.mute&&l&&l.destroy()}),p))}),p),t.on(ye,(function(e){e&&e.newstate&&(e.newstate===X&&a&&a.destroy(),e.newstate===ee||e.newstate===ie?(f=!1,a&&a.destroy(),A&&A.destroy(),n&&n.destroy(),d||s.show(!1)):e.newstate===q?(s.show(!1),h(e.newstate)):e.newstate===re||e.newstate===ne||"adLoading"===e.newstate?(f=!1,a&&a.destroy(),A&&A.destroy(),s.show(!0)):d||s.show(!1))}),p),t.on(Oe,(function(){c&&v()})),t.on(De,(function(e){if(e.currentQuality<0)return!1;e.isAuto?(d=!1,s.show(!1)):"request"===e.type?(g=e.currentQuality,d=!0,s.show(!0)):"render"===e.type&&g===e.currentQuality&&(d=!1,s.show(!1))}),p),t.on(Ce,(function(n){if(510===n.code&&(f=!0),101===n.code&&0===t.getPlaylist().length&&(f=!0),!f){var r="",o="";A&&A.destroy(),n&&n.code&&n.code>=100&&n.code<1e3?(r=n.message,100===n.code&&(o=n.error.toString())):r="Can not play due to unknown reasons.",OvenPlayerConsole.log("error occured : ",n),function(n,r,o,i,s,l){A&&A.destroy(),a&&a.destroy(),a=Dn(e,t,n,r,null,"op-warning",null,!0)}(r,o)}}),p),t.on(me,(function(e){var n="Because the network connection is unstable, the following media source will be played.";t.getCurrentSource()+1===t.getQualityLevels().length&&(n="Network connection is unstable. Check the network connection."),OvenPlayerConsole.log(n)}),p),t.on(ve,(function(){c&&v()}),p)}),(function(e){t.off(de,null,e),t.off(ye,null,e),t.off(ke,null,e),t.off(Ce,null,e),t.off(me,null,e),t.off(ve,null,e),t.off(he,null,e)}))},Pn=[],Un=function(){var e={},t=function(){for(var e=0;e1,!0===t.getConfig().hidePlaylistIcon&&(c=!1);var m={"mouseleave .op-controls":function(e,t,n){e.preventDefault(),r.setMouseDown(!1),t.find(".op-volume-slider-container").removeClass("active")},"click .op-playlist-button":function(e,n,r){e.preventDefault(),function(e,t){var n=ze(t.getContainerElement()),r="",o=t.getPlaylist(),i=o.length,A=6,a=0,s=[];function l(e){var n,a,l=Math.ceil(i/A),c=t.getCurrentPlaylist();s=o.slice(e*A,e*A+A),r.find(".op-playlist-body-row").removeChild(),r.find(".op-arrow-left").removeClass("disable"),r.find(".op-arrow-right").removeClass("disable");for(var u=0;u576?A=6:n.width()<=576&&(A=1);var u={"click .btn-close":function(e,t,n){e.preventDefault(),n.destroy()},"click .op-arrow-left":function(e,t,n){e.preventDefault(),ze(e.target).hasClass("disable")||l(--a)},"click .op-arrow-right":function(e,t,n){e.preventDefault(),ze(e.target).hasClass("disable")||l(++a)}};On(e,"PlaylistPanel",t.getConfig(),o,u,(function(e,n){r=e,l(a=c()),t.on(Be,(function(e){"xsmall"===e&&6===A?(A=1,l(a=c())):"small"!==e&&"medium"!==e&&"large"!==e||1!==A||(A=6,l(a=c()))}),n),t.on(he,(function(e){l(a=c())}),n),e.get().addEventListener("click",(function(e){for(var n=e.target;n;){if(ze(n).hasClass("op-playlist-card"))return void t.setCurrentPlaylist(parseInt(ze(n).attr("data-index")));n=n.parentElement}}),!0)}),(function(e){t.off(Be,null,e),t.off(he,null,e)}))}(n,t)}};return On(e,"Controls",t.getConfig(),c,m,(function(e,c){function p(n){A&&A.destroy(),A=function(e,t,n){var r=ze(t.getContainerElement());t.getConfig().disableSeekUI&&e.addClass("op-progressbar-container-disabled");var o=0,i=!1,A=Un(),a="",l=0,c="",u="",f="",p="",d="",g="",h=0,v="",m="",C=t.getBrowser().mobile;function y(e){var t=c.width(),n=t*e;f.css("width",n+"px"),p.css("left",n+"px");var r=(t-h)*e;d.css("left",r+"px"),o=n}function b(e){var t=c.width()*e;p.css("width",(0===e?e:t-o)+"px")}function w(e){var t=c.width(),n=c.offset().left,r=e.pageX;e.touches&&(r=e.pageX||e.touches[0].clientX);var o=(r-n)/t;return o<0?0:o>1?1:o}function E(e,n){if(A.size()>0||-1===e)return v.hide(),void m.hide();v.show(),m.show();var r=t.getDuration()*e;t.isTimecodeMode()?v.text(s(r)):v.text(Math.round(r*t.getFramerate()));var o=v.width(),i=c.width(),l=i*e,u=n.pageX-c.offset().left;n.touches&&(u=(n.pageX||n.touches[0].clientX)-c.offset().left);var f=function(e){return u0&&(n+=r),t.seek(n)}var x={"touchstart .op-progressbar":function(e){if(n)return!1;i=!0;var t=w(e);if(-1===t)return!1;y(t),b(0),B(t)},"touchmove .op-progressbar":function(e){if(i){var t=w(e);if(-1===t)return!1;y(t),b(0),B(t),E(t,e)}},"touchend .op-progressbar":function(e){i&&(i=!1),r.removeClass("op-progressbar-hover"),v.hide(),m.hide()},"mouseenter .op-progressbar":function(e,t,o){e.preventDefault(),C||(n||v.show(),r.addClass("op-progressbar-hover"))},"mouseleave .op-progressbar":function(e,t,n){e.preventDefault(),r.removeClass("op-progressbar-hover"),v.hide(),m.hide(),b(0)},"mousedown .op-progressbar":function(e,t,r){if(e.preventDefault(),n||C)return!1;i=!0;var o=w(e);if(-1===o)return!1;y(o),b(0),B(o)},"mousemove .op-progressbar":function(e,t,r){if(e.preventDefault(),!i&&!n&&!C){var o=w(e);b(o),E(o,e)}if(i&&!C){var A=w(e);if(-1===A)return!1;y(A),b(0),B(A),E(A,e)}},"mouseup .op-progressbar":function(e,t,n){e.preventDefault(),i&&!C&&(i=!1,r.removeClass("op-progressbar-hover"))}};return t.getConfig().disableSeekUI&&(x={}),On(e,"ProgressBar",t.getConfig(),null,x,(function(e,r){c=e,u=e.find(".op-load-progress"),f=e.find(".op-play-progress"),p=e.find(".op-hover-progress"),d=e.find(".op-progressbar-knob-container"),g=e.find(".op-progressbar-knob"),h=g.width(),v=e.find(".op-progressbar-time"),m=e.find(".op-progressbar-preview"),n?t.on(Se,(function(e){e&&e.duration&&e.position&&(y(e.position/e.duration),e.duration)}),r):(t.on(Le,(function(e){e&&e.duration&&e.position&&(l=e.duration,y(e.position/e.duration))}),r),t.on(Te,(function(e){var t,n;e&&e.bufferPercent&&(t=e.bufferPercent/100,n=c.width()*t,u.css("width",n+"px"))}),r))}),(function(e){n?t.off(Se,null,e):(t.off(Le,null,e),t.off(Te,null,e))}))}(e.find(".op-progressbar-container"),t,n)}function m(){i&&i.destroy(),i=function(e,t){var n=Un(),r={"click .op-setting-button":function(e,r,o){e.preventDefault();var i=r.closest(".op-controls-container");if(n.size()>0)n.clear();else{var A=function(e){var t={id:"panel-"+(new Date).getTime(),title:"Settings",body:[],isRoot:!0,panelType:""},n=e.getConfig();n&&n.systemText&&(Object.keys(jn).forEach((function(e){jn[e]=n.systemText.ui.setting[e]})),t.title=n.systemText.ui.setting.title);var r=e.getSources(),o=r&&r.length>0?r[e.getCurrentSource()]:null,i=e.getQualityLevels(),A=i&&i.length>0?i[e.getCurrentQuality()]:null,a=e.getCaptionList(),s=e.getCurrentCaption(),l=e.getFramerate();if(e.getDuration()!==1/0&&o&&o.type!==pe){var c={title:jn.speed,value:e.getPlaybackRate()+jn.speedUnit,description:e.getPlaybackRate()+jn.speedUnit,panelType:"speed",hasNext:!0};t.body.push(c)}if(r&&r.length>0){var u={title:jn.source,value:o?o.label:"Default",description:o?o.label:"Default",panelType:"source",hasNext:!0};t.body.push(u)}if(i&&i.length>0){var f={title:jn.quality,value:A?A.label:"Default",description:A?A.label:"Default",panelType:"quality",hasNext:!0};t.body.push(f)}if(a&&a.length>0){var p={title:jn.caption,value:a[s]?a[s].label:"OFF",description:a[s]?a[s].label:"OFF",panelType:"caption",hasNext:!0};t.body.push(p)}if(l>0){var d={title:jn.display,value:e.isTimecodeMode()?"Play time":"Framecode",description:e.isTimecodeMode()?"Play time":"Framecode",panelType:"display",hasNext:!0};t.body.push(d)}return t}(t);n.add(Wn(i,t,A))}}};return On(e,"SettingButton",t.getConfig(),null,r,(function(e,t){}),(function(e){}))}(e.find(".setting-holder"),t)}function C(){l||(l=function(e,t){var n=ze(t.getContainerElement()),r="",o="",i=!1,A=(t.getConfig(),t.getBrowser()),a="iOS"===A.os,s=(A.os,""),l=!1,c={onfullscreenchange:"fullscreenchange",onmozfullscreenchange:"mozfullscreenchange",onwebkitfullscreenchange:"webkitfullscreenchange",MSFullscreenChange:"MSFullscreenChange"};function u(){var e=!1,t=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;return t&&n.get()===t&&(e=!0),e}function f(){OvenPlayerConsole.log("FULLSCREEN STATE : ",u()),u()?(n.addClass("op-fullscreen"),i=!0,r.hide(),o.show()):(n.removeClass("op-fullscreen"),i=!1,r.show(),o.hide())}function p(){OvenPlayerConsole.log("afterFullScreenChangedCallback () "),f(),t.trigger(xe,i)}function d(){i?(n.removeClass("op-fullscreen"),i=!1,r.show(),o.hide()):(n.addClass("op-fullscreen"),i=!0,r.hide(),o.show()),t.trigger(xe,i)}function g(){var e;!i||a&&!u()?function(){var e,r="",o=n.get(),A=n.find("video")?n.find("video").get():o,s=null;if(a){if(A.length>1)for(var c=0;c1)for(var o=0;o9e15&&(n.duration=1/0);var r=t.getSources()[t.getCurrentSource()].sectionStart,o=t.getSources()[t.getCurrentSource()].sectionEnd;o&&(n.duration=o),r&&(n.duration=n.duration-r),function(n){a&&a.destroy(),a=function(e,t,n){var r="",o="";function i(e){return s(e)}return On(e,"TimeDisplay",t.getConfig(),n,{},(function(e,A){var a=t.isTimecodeMode();r=e.find(".op-time-current"),o=e.find(".op-time-duration"),n.duration!==1/0&&(a?o.text(i(n.duration)):o.text(Math.round(n.duration*t.getFramerate())+" ("+t.getFramerate()+"fps)"),t.on(Ue,(function(e){(a=e)?o.text(i(n.duration)):o.text(Math.round(n.duration*t.getFramerate())+" ("+t.getFramerate()+"fps)")}),A),t.on(Le,(function(e){a?r.text(i(e.position)):r.text(Math.round(e.position*t.getFramerate()))}),A))}),(function(e){t.off(Ue,null,e),t.off(Le,null,e)}))}(e.find(".op-left-controls"),t,n)}(n),C(),t.getFramerate&&t.getFramerate(),n.duration===1/0?(OvenPlayerConsole.log("[[[[LIVE MODE]]]]"),A&&A.destroy()):p(!1),u=!0}function b(){a&&a.destroy(),A&&A.destroy(),m(),C(),h.removeClass("linear-ad")}o=function(e,t){var n="",r="",o="",i="",A="",a="",s="",l={"click .op-play-button":function(e,n,r){e.preventDefault();var o=t.getState(),i=t.getPlaylist(),A=t.getCurrentPlaylist();o===X?t.play():o===ee||o===ie?t.pause():o===ne||o===re?t.stop():o===$||o===Ae?t.play():o===te?t.setCurrentSource(t.getCurrentSource()):o===q&&i.length===A+1&&(t.seek(0),t.play())},"click .op-seek-button-back":function(e,n,r){var o=t.getConfig().seekControlInterval;o||(o=10);var i=t.getPosition()-o;i<0&&(i=0),t.seek(i)},"click .op-seek-button-forward":function(e,n,r){var o=t.getConfig().seekControlInterval;o||(o=10);var i=t.getPosition()+o;i>t.getDuration()&&(i=t.getDuration()),t.seek(i)}};return On(e,"PlayButton",t.getConfig(),null,l,(function(e,l){n=e.find(".op-play-button .op-play"),r=e.find(".op-play-button .op-pause"),o=e.find(".op-play-button .op-replay"),i=e.find(".op-seek-button-back"),A=e.find(".op-seek-button-forward"),a=e.find(".op-seek-back-text"),s=e.find(".op-seek-forward-text"),t.on(ye,(function(e){var t;e&&e.newstate&&(t=e.newstate,n.hide(),r.hide(),o.hide(),t===ee||t===ie||t===ne||t===re?r.show():t===$||t===Ae?n.show():t===q?o.show():n.show())}),l),t.getConfig().showSeekControl||(i.hide(),A.hide());var c=t.getConfig().seekControlInterval;c?(a.text(c),s.text(c)):(a.text(10),s.text(10))}),(function(e){t.off(ye,null,e)}))}(e.find(".op-left-controls"),t),r=function(e,t){var n="",r="",o="",i="",A="",a="",s="",l=!1,c=0,u="iOS"===t.getBrowser().os||"Android"===t.getBrowser().os;function f(e){t.getMute()&&(e=0),function(e){A.hide(),a.hide(),s.hide(),e>=70?A.show():e<70&&e>0?a.show():0==e?s.show():A.show()}(e);var n=c*e/100;o.css("left",n+"px"),i.css("width",n+"px")}function p(e){var t=((e.pageX||e.touches[0].clientX)-r.offset().left)/70*100;return t<0&&(t=0),t>100&&(t=100),t}var d={"click .op-volume-button":function(e,n,r){e.preventDefault(),u||(0===t.getVolume()?(t.setMute(!1),t.setVolume(100)):t.setMute())},"mouseenter .op-volume-button":function(e,t,r){e.preventDefault(),u||n.addClass("active")},"mouseleave .op-volume-silder":function(e,t,n){e.preventDefault(),l=!1},"mousedown .op-volume-silder":function(e,n,r){e.preventDefault(),l=!0,t.setMute(!1),t.setVolume(p(e))},"mouseup .op-volume-silder":function(e,t,n){e.preventDefault(),l=!1},"mousemove .op-volume-silder":function(e,n,r){if(e.preventDefault(),!l)return!1;t.setVolume(p(e))},"touchstart .op-volume-button":function(e){u&&(t.getMute()?t.setMute(!1):t.setMute(!0))}},g=On(e,"VolumeButton",t.getConfig(),null,d,(function(e,l){n=e.find(".op-volume-slider-container"),t.getBrowser().mobile&&n.hide(),r=e.find(".op-volume-silder"),o=e.find(".op-volume-slider-handle"),i=e.find(".op-volume-slider-value"),A=e.find(".op-volume-max"),a=e.find(".op-volume-small"),s=e.find(".op-volume-mute"),c=64,o.css("left",c+"px"),f(t.getVolume()),t.on(de,(function(){f(t.getVolume())}),l),t.on(Re,(function(e){f(e.volume)}),l),t.on(Qe,(function(e){e.mute?f(0):f(t.getVolume())}),l)}),(function(e){t.off(de,null,e),t.off(Re,null,e),t.off(Qe,null,e)}));return g.setMouseDown=function(e){l=e},g}(e.find(".op-left-controls"),t);var w=t.getPlaylist(),E=t.getCurrentPlaylist();w&&w[E]&&w[E].adTagUrl||m(),C(),t.on(de,(function(){e.show()}),c),t.on(Me,(function(e){n=e.duration,v=e,e.isP2P=f,y(e)}),c),t.on(Le,(function(e){(d||t&&t.getProviderName&&"rtmp"===t.getProviderName())&&!n&&v&&v.duration!==e.duration&&(v=e,y(e))}),c),t.on(Be,(function(e){h.find(".op-setting-panel")&&h.find(".op-setting-panel").css("max-height",h.height()-h.find(".op-bottom-panel").height()+"px")}),c),t.on(Ne,(function(e){f=e}),c),t.on(we,(function(){if(!u){var n="";t.getSources().length>0&&t.getSources()[t.getCurrentSource()]&&t.getSources()[t.getCurrentSource()].type&&(n=t.getSources()[t.getCurrentSource()].type),y({isP2P:f,duration:t.getDuration(),type:n})}e.show()}),c),t.on(Ce,(function(t){e.show()}),c),t.on(Ie,(function(e){e.isLinear?(h.addClass("linear-ad"),p(!0),a&&a.destroy(),i&&i.destroy(),g&&l&&l.destroy()):h.removeClass("linear-ad")}),c),t.on(ae,(function(){b()}),c),t.on(se,(function(){b()}),c),t.on(Oe,(function(){b()}),c)}),(function(e){t.off(Me,null,e),t.off(Le,null,e),t.off(ae,null,e),t.off(Ie,null,e),t.off(Ne,null,e),t.off(se,null,e),t.off(Be,null,e),t.off(Oe,null,e),a&&a.destroy(),o&&o.destroy(),A&&A.destroy(),l&&l.destroy(),r&&r.destroy()}))},Gn=n(5655),zn=n.n(Gn),Vn=n(3379),_n=n.n(Vn),Hn=n(7795),Jn=n.n(Hn),Zn=n(569),Kn=n.n(Zn),Xn=n(3565),qn=n.n(Xn),$n=n(9216),er=n.n($n),tr=n(4589),nr=n.n(tr),rr=n(2021),or={};or.styleTagTransform=nr(),or.setAttributes=qn(),or.insert=Kn().bind(null,"head"),or.domAPI=Jn(),or.insertStyleElement=er(),_n()(rr.Z,or),rr.Z&&rr.Z.locals&&rr.Z.locals;var ir,Ar=function(e){var t,n="",r="",o="",i="",A=null,a="",s=X,l=!1,c=Un(),u="",f="",p={};function d(e,n){if(a&&(clearTimeout(a),a=null),e){if(c.size()>0)return!1;t.addClass("op-autohide")}else t.removeClass("op-autohide"),n&&(a=setTimeout((function(){if(c.size()>0)return!1;t.addClass("op-autohide")}),3e3))}function g(){var e=s;e===X||e===$||e===q?(e===q&&A.seek(0),A.play()):e===ee&&A.pause()}function h(e,t){var n,r=A.getDuration(),o=A.getPosition();n=t?Math.max(o-e,0):Math.min(o+e,r),A.seek(n)}function v(e){var t,n=A.getVolume();t=e?Math.min(n+5,100):Math.max(n-5,0),A.setVolume(t)}function m(){var e=t.width();e<576?(u="xsmall",t.addClass("xsmall"),e<490&&t.addClass("xxsmall")):e<768?(u="small",t.addClass("small")):e<992?(u="medium",t.addClass("medium")):(u="large",t.addClass("large"))}var C={"click .ovenplayer":function(e,t,n){if(A&&A.trigger(Ee,e),i)return e.preventDefault(),i.destroy(),i=null,!1;if(!ze(e.target).closest(".op-controls-container")&&!ze(e.target).closest(".op-setting-panel")){if(c.size()>0)return e.preventDefault(),c.clear(),!1;A.getDuration()===1/0||A.getBrowser().mobile||g()}},"dblclick .ovenplayer":function(e,t,n){A&&A.getConfig().expandFullScreenUI&&A.toggleFullScreen&&(ze(e.target).closest(".op-controls-container")||ze(e.target).closest(".op-setting-panel")||A.toggleFullScreen())},"touchstart .ovenplayer":function(e,t,n){s===ee||s===X||s===ne||s===ie&&"xsmall"===u?d(!1,!0):d(!1)},"mouseenter .ovenplayer":function(e,t,n){e.preventDefault(),s===ee||s===X||s===ne||s===ie&&"xsmall"===u?d(!1,!0):d(!1)},"mousemove .ovenplayer":function(e,t,n){e.preventDefault(),s===ee||s===X||s===ne||s===ie&&"xsmall"===u?d(!1,!0):d(!1)},"mouseleave .ovenplayer":function(e,t,n){e.preventDefault(),(s===ee||s===X||s===ne||s===ie&&"xsmall"===u)&&d(!0)},"keydown .ovenplayer":function(e,t,n){var r=A.getFramerate();switch(e.keyCode){case 16:e.preventDefault(),l=!0;break;case 32:e.preventDefault(),g();break;case 37:e.preventDefault(),A.getConfig().disableSeekUI||(l&&r?A.seekFrame(-1):h(5,!0));break;case 39:e.preventDefault(),A.getConfig().disableSeekUI||(l&&r?A.seekFrame(1):h(5,!1));break;case 38:e.preventDefault(),v(!0);break;case 40:e.preventDefault(),v(!1)}},"keyup .ovenplayer":function(e,t,n){switch(e.keyCode){case 16:e.preventDefault(),l=!1}},"contextmenu .ovenplayer":function(e,n,r){if(e.stopPropagation(),!ze(e.currentTarget).find("object"))return e.preventDefault(),o=e.pageX,a=e.pageY,i&&(i.destroy(),i=null),i=function(e,t,n){var r=ze(t.getContainerElement()),o={"click .op-context-item":function(e,t,n){e.preventDefault(),window.open("https://github.com/AirenSoft/OvenPlayer","_blank")}};return On(e,"ContextPanel",t.getConfig(),n,o,(function(e,t){var o=e.width(),i=e.height(),A=Math.min(n.pageX-r.offset().left,r.width()-o),a=Math.min(n.pageY-r.offset().top,r.height()-i);e.css("left",A+"px"),e.css("top",a+"px")}),(function(){}))}(t,A,{pageX:o,pageY:a}),!1;var o,a}};return(p=On(e,"View",null,e.id,C,(function(e,r){t=e,n=r,m(),f=u,new(zn())(t.get(),(function(){t.removeClass("large"),t.removeClass("medium"),t.removeClass("small"),t.removeClass("xsmall"),t.removeClass("xxsmall"),m(),u!==f&&(f=u,A&&A.trigger(Be,f))}))}),(function(){o&&(o.destroy(),o=null),r&&(r.destroy(),r=null)}),!0)).getMediaElementContainer=function(){return t.find(".op-media-element-container").get()},p.setApi=function(e){(A=e).getContainerElement=function(){return t.get()},A.getContainerId=function(){return t.get().id},A.on(de,(function(n){r||(r=Yn(t.find(".op-ui"),e)),i||t.addClass("op-no-controls")})),A.on(Ce,(function(e){if(A){var t=A.getSources()||[];r&&t.length}})),A.on(ge,(function(e){n.destroy()})),A.on(we,(function(n){!r&&i&&(r=Yn(t.find(".op-ui"),e))})),A.on(ye,(function(e){e&&e.newstate&&(s=e.newstate,e.newstate===ee||e.newstate===ie&&"xsmall"===u?d(!1,!0):d(!1))}));var i=A.getConfig()&&A.getConfig().controls;o=Fn(t.find(".op-ui"),e),r=Yn(t.find(".op-ui"),e);var a=A.getConfig().aspectRatio;if(a&&2===a.split(":").length){var l=1*a.split(":")[0],c=1*a.split(":")[1]/l*100;t.find(".op-ratio").css("padding-bottom",c+"%")}A.showControls=function(e){e?(t.removeClass("op-no-controls"),d(!1,!0)):t.addClass("op-no-controls")}},p},ar=(ir={},Object.assign(ir,Tn),ir.create=function(e,t){console.log("[OvenPlayer] v.0.10.23");var n=Ze(e),r=Ar(n),o=Tn.create(r.getMediaElementContainer(),t);return r.setApi(o),o},ir)},1001:function(){!function(e){"use strict";if("window"in e&&"document"in e){document.querySelectorAll||(document.querySelectorAll=function(e){var t,n=document.createElement("style"),r=[];for(document.documentElement.firstChild.appendChild(n),document._qsa=[],n.styleSheet.cssText=e+"{x-qsa:expression(document._qsa && document._qsa.push(this))}",window.scrollBy(0,0),n.parentNode.removeChild(n);document._qsa.length;)(t=document._qsa.shift()).style.removeAttribute("x-qsa"),r.push(t);return document._qsa=null,r}),document.querySelector||(document.querySelector=function(e){var t=document.querySelectorAll(e);return t.length?t[0]:null}),document.getElementsByClassName||(document.getElementsByClassName=function(e){return e=String(e).replace(/^|\s+/g,"."),document.querySelectorAll(e)}),e.Node=e.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(t){t[0]in e.Node||(e.Node[t[0]]=t[1])})),e.DOMException=e.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(t){t[0]in e.DOMException||(e.DOMException[t[0]]=t[1])})),function(){function t(e,t,n){if("function"==typeof t){"DOMContentLoaded"===e&&(e="load");var r=this,o=function(e){e._timeStamp=Date.now(),e._currentTarget=r,t.call(this,e),e._currentTarget=null};this["_"+e+t]=o,this.attachEvent("on"+e,o)}}function n(e,t,n){if("function"==typeof t){"DOMContentLoaded"===e&&(e="load");var r=this["_"+e+t];r&&(this.detachEvent("on"+e,r),this["_"+e+t]=null)}}"Element"in e&&!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(e){e.prototype.addEventListener=t,e.prototype.removeEventListener=n})))}(),function(){function t(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}"CustomEvent"in e&&"function"==typeof e.CustomEvent||(t.prototype=e.Event.prototype,e.CustomEvent=t)}(),window.addEvent=function(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&(e["e"+t+n]=n,e[t+n]=function(){var r=window.event;r.currentTarget=e,r.preventDefault=function(){r.returnValue=!1},r.stopPropagation=function(){r.cancelBubble=!0},r.target=r.srcElement,r.timeStamp=Date.now(),e["e"+t+n].call(this,r)},e.attachEvent("on"+t,e[t+n]))},window.removeEvent=function(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent&&(e.detachEvent("on"+t,e[t+n]),e[t+n]=null,e["e"+t+n]=null)},function(){function t(e,t){function n(e){return e.length?e.split(/\s+/g):[]}function r(e,t){var r=n(t),o=r.indexOf(e);return-1!==o&&r.splice(o,1),r.join(" ")}if(Object.defineProperties(this,{length:{get:function(){return n(e[t]).length}},item:{value:function(r){var o=n(e[t]);return 0<=r&&r=0&&t.item(n)!==this;);return n>-1})),window.Element&&!Element.prototype.closest&&(Element.prototype.closest=function(e){var t,n=(this.document||this.ownerDocument).querySelectorAll(e),r=this;do{for(t=n.length;--t>=0&&n.item(t)!==r;);}while(t<0&&(r=r.parentElement));return r});var t={prepend:function(){var e=[].slice.call(arguments);e=o(e),this.insertBefore(e,this.firstChild)},append:function(){var e=[].slice.call(arguments);e=o(e),this.appendChild(e)}};r(e.Document||e.HTMLDocument,t),r(e.DocumentFragment,t),r(e.Element,t);var n={before:function(){var e=[].slice.call(arguments),t=this.parentNode;if(t){for(var n=this.previousSibling;-1!==e.indexOf(n);)n=n.previousSibling;var r=o(e);t.insertBefore(r,n?n.nextSibling:t.firstChild)}},after:function(){var e=[].slice.call(arguments),t=this.parentNode;if(t){for(var n=this.nextSibling;-1!==e.indexOf(n);)n=n.nextSibling;var r=o(e);t.insertBefore(r,n)}},replaceWith:function(){var e=[].slice.call(arguments),t=this.parentNode;if(t){for(var n=this.nextSibling;-1!==e.indexOf(n);)n=n.nextSibling;var r=o(e);this.parentNode===t?t.replaceChild(r,this):t.insertBefore(r,n)}},remove:function(){this.parentNode&&this.parentNode.removeChild(this)}};r(e.DocumentType,n),r(e.Element,n),r(e.CharacterData,n)}function r(e,t){e&&Object.keys(t).forEach((function(n){if(!(n in e)&&!(n in e.prototype))try{Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(t,n))}catch(r){e[n]=t[n]}}))}function o(e){var t=null;return 1===(e=e.map((function(e){return e instanceof Node?e:document.createTextNode(e)}))).length?t=e[0]:(t=document.createDocumentFragment(),e.forEach((function(e){t.appendChild(e)}))),t}}(self)},5655:function(e,t){var n,r;r=this,void 0===(n=function(){return r.returnExportsGlobal=function(){"use strict";function e(){var e,t;this.q=[],this.add=function(e){this.q.push(e)},this.call=function(){for(e=0,t=this.q.length;t>e;e++)this.q[e].call()}}function t(t,r){if(t.resizedAttached){if(t.resizedAttached)return void t.resizedAttached.add(r)}else t.resizedAttached=new e,t.resizedAttached.add(r);t.resizeSensor=document.createElement("div"),t.resizeSensor.className="resize-sensor";var o="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden; opacity: 0;",i="position: absolute; left: 0; top: 0; transition: 0s;";t.resizeSensor.style.cssText=o,t.resizeSensor.innerHTML='
',t.appendChild(t.resizeSensor),"static"==function(e,t){return e.currentStyle?e.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(e,null).getPropertyValue(t):e.style[t]}(t,"position")&&(t.style.position="relative");var A=t.resizeSensor.childNodes[0],a=A.childNodes[0],s=t.resizeSensor.childNodes[1],l=function(){a.style.width="100000px",a.style.height="100000px",A.scrollLeft=1e5,A.scrollTop=1e5,s.scrollLeft=1e5,s.scrollTop=1e5};l();var c=!1;n((function e(){t.resizedAttached&&(c&&(t.resizedAttached.call(),c=!1),n(e))}));var u,f,p,d,g=function(){((p=t.offsetWidth)!=u||(d=t.offsetHeight)!=f)&&(c=!0,u=p,f=d),l()},h=function(e,t,n){e.attachEvent?e.attachEvent("on"+t,n):e.addEventListener(t,n)};h(A,"scroll",g),h(s,"scroll",g)}var n=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){return window.setTimeout(e,20)},r=function(e,n){var r=Object.prototype.toString.call(e),o=this._isCollectionTyped="[object Array]"===r||"[object NodeList]"===r||"[object HTMLCollection]"===r||"undefined"!=typeof jQuery&&e instanceof window.jQuery||"undefined"!=typeof Elements&&e instanceof window.Elements;if(this._element=e,o)for(var i=0,A=e.length;A>i;i++)t(e[i],n);else t(e,n)};return r.prototype.detach=function(){var e=this._isCollectionTyped,t=this._element;if(e)for(var n=0,o=t.length;o>n;n++)r.detach(t[n]);else r.detach(t)},r.detach=function(e){e.resizeSensor&&(e.removeChild(e.resizeSensor),delete e.resizeSensor,delete e.resizedAttached)},r}()}.apply(t,[]))||(e.exports=n)},741:function(e,t,n){var r,o,i;function A(e){return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}i=function(){var e="1.13.1",t="object"==("undefined"==typeof self?"undefined":A(self))&&self.self===self&&self||"object"==(void 0===n.g?"undefined":A(n.g))&&n.g.global===n.g&&n.g||Function("return this")()||{},r=Array.prototype,o=Object.prototype,i="undefined"!=typeof Symbol?Symbol.prototype:null,a=r.push,s=r.slice,l=o.toString,c=o.hasOwnProperty,u="undefined"!=typeof ArrayBuffer,f="undefined"!=typeof DataView,p=Array.isArray,d=Object.keys,g=Object.create,h=u&&ArrayBuffer.isView,v=isNaN,m=isFinite,C=!{toString:null}.propertyIsEnumerable("toString"),y=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],b=Math.pow(2,53)-1;function w(e,t){return t=null==t?e.length-1:+t,function(){for(var n=Math.max(arguments.length-t,0),r=Array(n),o=0;o=0&&n<=b}}function Z(e){return function(t){return null==t?void 0:t[e]}}var K=Z("byteLength"),X=J(K),q=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/,$=u?function(e){return h?h(e)&&!j(e):X(e)&&q.test(l.call(e))}:H(!1),ee=Z("length");function te(e,t){t=function(e){for(var t={},n=e.length,r=0;r":">",'"':""","'":"'","`":"`"},Ve=Ge(ze),_e=Ge(be(ze)),He=oe.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Je=/(.)^/,Ze={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Ke=/\\|'|\r|\n|\u2028|\u2029/g;function Xe(e){return"\\"+Ze[e]}var qe=/^\s*(\w|\$)+\s*$/,$e=0;function et(e,t,n,r,o){if(!(r instanceof t))return e.apply(n,o);var i=Ie(e.prototype),A=e.apply(i,o);return E(A)?A:i}var tt=w((function(e,t){var n=tt.placeholder;return function r(){for(var o=0,i=t.length,A=Array(i),a=0;a1)ot(a,t-1,n,r),o=r.length;else for(var s=0,l=a.length;s0&&(n=t.apply(this,arguments)),e<=1&&(t=null),n}}var ct=tt(lt,2);function ut(e,t,n){t=Ne(t,n);for(var r,o=ne(e),i=0,A=o.length;i0?0:o-1;i>=0&&i0?A=i>=0?i:Math.max(i+a,A):a=i>=0?Math.min(i+1,a):i+a+1;else if(n&&i&&a)return r[i=n(r,o)]===o?i:-1;if(o!=o)return(i=t(s.call(r,A,a),_))>=0?i+A:-1;for(i=e>0?A:a-1;i>=0&&i0?0:A-1;for(o||(r=t[i?i[a]:a],a+=e);a>=0&&a=3;return t(e,Fe(n,o,4),r,i)}}var Et=wt(1),Bt=wt(-1);function xt(e,t,n){var r=[];return t=Ne(t,n),yt(e,(function(e,n,o){t(e,n,o)&&r.push(e)})),r}function kt(e,t,n){t=Ne(t,n);for(var r=!rt(e)&&ne(e),o=(r||e).length,i=0;i=0}var Tt=w((function(e,t,n){var r,o;return F(t)?o=t:(t=Le(t),r=t.slice(0,-1),t=t[t.length-1]),bt(e,(function(e){var i=o;if(!i){if(r&&r.length&&(e=Re(e,r)),null==e)return;i=e[t]}return null==i?i:i.apply(e,n)}))}));function Lt(e,t){return bt(e,De(t))}function Rt(e,t,n){var r,o,i=-1/0,a=-1/0;if(null==t||"number"==typeof t&&"object"!=A(e[0])&&null!=e)for(var s=0,l=(e=rt(e)?e:ye(e)).length;si&&(i=r);else t=Ne(t,n),yt(e,(function(e,n,r){((o=t(e,n,r))>a||o===-1/0&&i===-1/0)&&(i=e,a=o)}));return i}function Qt(e,t,n){if(null==t||n)return rt(e)||(e=ye(e)),e[je(e.length-1)];var r=rt(e)?Se(e):ye(e),o=ee(r);t=Math.max(Math.min(t,o),0);for(var i=o-1,A=0;A1&&(r=Fe(r,t[1])),t=se(e)):(r=Nt,t=ot(t,!1,!1),e=Object(e));for(var o=0,i=t.length;o1&&(n=t[1])):(t=bt(ot(t,!1,!1),String),r=function(e,n){return!St(t,n)}),Wt(e,r,n)}));function Yt(e,t,n){return s.call(e,0,Math.max(0,e.length-(null==t||n?1:t)))}function Gt(e,t,n){return null==e||e.length<1?null==t||n?void 0:[]:null==t||n?e[0]:Yt(e,e.length-t)}function zt(e,t,n){return s.call(e,null==t||n?1:t)}var Vt=w((function(e,t){return t=ot(t,!0,!0),xt(e,(function(e){return!St(t,e)}))})),_t=w((function(e,t){return Vt(e,t)}));function Ht(e,t,n,r){x(t)||(r=n,n=t,t=!1),null!=n&&(n=Ne(n,r));for(var o=[],i=[],A=0,a=ee(e);At?(r&&(clearTimeout(r),r=null),a=l,A=e.apply(o,i),r||(o=i=null)):r||!1===n.trailing||(r=setTimeout(s,c)),A};return l.cancel=function(){clearTimeout(r),a=0,r=o=i=null},l},debounce:function(e,t,n){var r,o,i,A,a,s=function s(){var l=Ye()-o;t>l?r=setTimeout(s,t-l):(r=null,n||(A=e.apply(a,i)),r||(i=a=null))},l=w((function(l){return a=this,i=l,o=Ye(),r||(r=setTimeout(s,t),n&&(A=e.apply(a,i))),A}));return l.cancel=function(){clearTimeout(r),r=i=a=null},l},wrap:function(e,t){return tt(t,e)},negate:st,compose:function(){var e=arguments,t=e.length-1;return function(){for(var n=t,r=e[t].apply(this,arguments);n--;)r=e[n].call(this,r);return r}},after:function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},before:lt,once:ct,findKey:ut,findIndex:pt,findLastIndex:dt,sortedIndex:gt,indexOf:vt,lastIndexOf:mt,find:Ct,detect:Ct,findWhere:function(e,t){return Ct(e,Oe(t))},each:yt,forEach:yt,map:bt,collect:bt,reduce:Et,foldl:Et,inject:Et,reduceRight:Bt,foldr:Bt,filter:xt,select:xt,reject:function(e,t,n){return xt(e,st(Ne(t)),n)},every:kt,all:kt,some:It,any:It,contains:St,includes:St,include:St,invoke:Tt,pluck:Lt,where:function(e,t){return xt(e,Oe(t))},max:Rt,min:function(e,t,n){var r,o,i=1/0,a=1/0;if(null==t||"number"==typeof t&&"object"!=A(e[0])&&null!=e)for(var s=0,l=(e=rt(e)?e:ye(e)).length;sr||void 0===n)return 1;if(n>8&255]},F=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},P=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},U=function(e){return Q(e,23,4)},N=function(e){return Q(e,52,8)},W=function(e,t){v(e.prototype,t,{get:function(){return b(this)[t]}})},j=function(e,t,n,r){var o=f(n),i=b(e);if(o+t>i.byteLength)throw R(x);var A=b(i.buffer).bytes,a=o+i.byteOffset,s=A.slice(a,a+t);return r?s:s.reverse()},Y=function(e,t,n,r,o,i){var A=f(n),a=b(e);if(A+t>a.byteLength)throw R(x);for(var s=b(a.buffer).bytes,l=A+a.byteOffset,c=r(+o),u=0;u_;)(G=V[_++])in I||A(I,G,k[G]);z.constructor=I}g&&d(T)!==L&&g(T,L);var H=new S(new I(2)),J=T.setInt8;H.setInt8(0,2147483648),H.setInt8(1,2147483649),!H.getInt8(0)&&H.getInt8(1)||a(T,{setInt8:function(e,t){J.call(this,e,t<<24>>24)},setUint8:function(e,t){J.call(this,e,t<<24>>24)}},{unsafe:!0})}else I=function(e){l(this,I,E);var t=f(e);w(this,{bytes:m.call(new Array(t),0),byteLength:t}),o||(this.byteLength=t)},S=function(e,t,n){l(this,S,B),l(e,I,B);var r=b(e).byteLength,i=c(t);if(i<0||i>r)throw R("Wrong offset");if(i+(n=void 0===n?r-i:u(n))>r)throw R("Wrong length");w(this,{buffer:e,byteLength:n,byteOffset:i}),o||(this.buffer=e,this.byteLength=n,this.byteOffset=i)},o&&(W(I,"byteLength"),W(S,"buffer"),W(S,"byteLength"),W(S,"byteOffset")),a(S.prototype,{getInt8:function(e){return j(this,1,e)[0]<<24>>24},getUint8:function(e){return j(this,1,e)[0]},getInt16:function(e){var t=j(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=j(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return P(j(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return P(j(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return M(j(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return M(j(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){Y(this,1,e,O,t)},setUint8:function(e,t){Y(this,1,e,O,t)},setInt16:function(e,t){Y(this,2,e,D,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){Y(this,2,e,D,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){Y(this,4,e,F,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){Y(this,4,e,F,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){Y(this,4,e,U,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){Y(this,8,e,N,t,arguments.length>2?arguments[2]:void 0)}});C(I,E),C(S,B),e.exports={ArrayBuffer:I,DataView:S}},1048:function(e,t,n){"use strict";var r=n(7908),o=n(1400),i=n(7466),A=Math.min;e.exports=[].copyWithin||function(e,t){var n=r(this),a=i(n.length),s=o(e,a),l=o(t,a),c=arguments.length>2?arguments[2]:void 0,u=A((void 0===c?a:o(c,a))-l,a-s),f=1;for(l0;)l in n?n[s]=n[l]:delete n[s],s+=f,l+=f;return n}},1285:function(e,t,n){"use strict";var r=n(7908),o=n(1400),i=n(7466);e.exports=function(e){for(var t=r(this),n=i(t.length),A=arguments.length,a=o(A>1?arguments[1]:void 0,n),s=A>2?arguments[2]:void 0,l=void 0===s?n:o(s,n);l>a;)t[a++]=e;return t}},8533:function(e,t,n){"use strict";var r=n(2092).forEach,o=n(2133)("forEach");e.exports=o?[].forEach:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}},7745:function(e){e.exports=function(e,t){for(var n=0,r=t.length,o=new e(r);r>n;)o[n]=t[n++];return o}},8457:function(e,t,n){"use strict";var r=n(9974),o=n(7908),i=n(3411),A=n(7659),a=n(7466),s=n(6135),l=n(1246);e.exports=function(e){var t,n,c,u,f,p,d=o(e),g="function"==typeof this?this:Array,h=arguments.length,v=h>1?arguments[1]:void 0,m=void 0!==v,C=l(d),y=0;if(m&&(v=r(v,h>2?arguments[2]:void 0,2)),null==C||g==Array&&A(C))for(n=new g(t=a(d.length));t>y;y++)p=m?v(d[y],y):d[y],s(n,y,p);else for(f=(u=C.call(d)).next,n=new g;!(c=f.call(u)).done;y++)p=m?i(u,v,[c.value,y],!0):c.value,s(n,y,p);return n.length=y,n}},1318:function(e,t,n){var r=n(5656),o=n(7466),i=n(1400),A=function(e){return function(t,n,A){var a,s=r(t),l=o(s.length),c=i(A,l);if(e&&n!=n){for(;l>c;)if((a=s[c++])!=a)return!0}else for(;l>c;c++)if((e||c in s)&&s[c]===n)return e||c||0;return!e&&-1}};e.exports={includes:A(!0),indexOf:A(!1)}},2092:function(e,t,n){var r=n(9974),o=n(8361),i=n(7908),A=n(7466),a=n(5417),s=[].push,l=function(e){var t=1==e,n=2==e,l=3==e,c=4==e,u=6==e,f=7==e,p=5==e||u;return function(d,g,h,v){for(var m,C,y=i(d),b=o(y),w=r(g,h,3),E=A(b.length),B=0,x=v||a,k=t?x(d,E):n||f?x(d,0):void 0;E>B;B++)if((p||B in b)&&(C=w(m=b[B],B,y),e))if(t)k[B]=C;else if(C)switch(e){case 3:return!0;case 5:return m;case 6:return B;case 2:s.call(k,m)}else switch(e){case 4:return!1;case 7:s.call(k,m)}return u?-1:l||c?c:k}};e.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}},6583:function(e,t,n){"use strict";var r=n(5656),o=n(9958),i=n(7466),A=n(2133),a=Math.min,s=[].lastIndexOf,l=!!s&&1/[1].lastIndexOf(1,-0)<0,c=A("lastIndexOf"),u=l||!c;e.exports=u?function(e){if(l)return s.apply(this,arguments)||0;var t=r(this),n=i(t.length),A=n-1;for(arguments.length>1&&(A=a(A,o(arguments[1]))),A<0&&(A=n+A);A>=0;A--)if(A in t&&t[A]===e)return A||0;return-1}:s},1194:function(e,t,n){var r=n(7293),o=n(5112),i=n(7392),A=o("species");e.exports=function(e){return i>=51||!r((function(){var t=[];return(t.constructor={})[A]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},2133:function(e,t,n){"use strict";var r=n(7293);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){throw 1},1)}))}},3671:function(e,t,n){var r=n(3099),o=n(7908),i=n(8361),A=n(7466),a=function(e){return function(t,n,a,s){r(n);var l=o(t),c=i(l),u=A(l.length),f=e?u-1:0,p=e?-1:1;if(a<2)for(;;){if(f in c){s=c[f],f+=p;break}if(f+=p,e?f<0:u<=f)throw TypeError("Reduce of empty array with no initial value")}for(;e?f>=0:u>f;f+=p)f in c&&(s=n(s,c[f],f,l));return s}};e.exports={left:a(!1),right:a(!0)}},4362:function(e){var t=Math.floor,n=function(e,i){var A=e.length,a=t(A/2);return A<8?r(e,i):o(n(e.slice(0,a),i),n(e.slice(a),i),i)},r=function(e,t){for(var n,r,o=e.length,i=1;i0;)e[r]=e[--r];r!==i++&&(e[r]=n)}return e},o=function(e,t,n){for(var r=e.length,o=t.length,i=0,A=0,a=[];i1?arguments[1]:void 0,3);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!v(this,e)}}),i(c.prototype,n?{get:function(e){var t=v(this,e);return t&&t.value},set:function(e,t){return h(this,0===e?0:e,t)}}:{add:function(e){return h(this,e=0===e?0:e,e)}}),u&&r(c.prototype,"size",{get:function(){return p(this).size}}),c},setStrong:function(e,t,n){var r=t+" Iterator",o=g(t),i=g(r);l(e,t,(function(e,t){d(this,{type:r,target:e,state:o(e),kind:t,last:void 0})}),(function(){for(var e=i(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?"keys"==t?{value:n.key,done:!1}:"values"==t?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})}),n?"entries":"values",!n,!0),c(t)}}},9320:function(e,t,n){"use strict";var r=n(2248),o=n(2423).getWeakData,i=n(9670),A=n(111),a=n(5787),s=n(408),l=n(2092),c=n(6656),u=n(9909),f=u.set,p=u.getterFor,d=l.find,g=l.findIndex,h=0,v=function(e){return e.frozen||(e.frozen=new m)},m=function(){this.entries=[]},C=function(e,t){return d(e.entries,(function(e){return e[0]===t}))};m.prototype={get:function(e){var t=C(this,e);if(t)return t[1]},has:function(e){return!!C(this,e)},set:function(e,t){var n=C(this,e);n?n[1]=t:this.entries.push([e,t])},delete:function(e){var t=g(this.entries,(function(t){return t[0]===e}));return~t&&this.entries.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,n,l){var u=e((function(e,r){a(e,u,t),f(e,{type:t,id:h++,frozen:void 0}),null!=r&&s(r,e[l],{that:e,AS_ENTRIES:n})})),d=p(t),g=function(e,t,n){var r=d(e),A=o(i(t),!0);return!0===A?v(r).set(t,n):A[r.id]=n,e};return r(u.prototype,{delete:function(e){var t=d(this);if(!A(e))return!1;var n=o(e);return!0===n?v(t).delete(e):n&&c(n,t.id)&&delete n[t.id]},has:function(e){var t=d(this);if(!A(e))return!1;var n=o(e);return!0===n?v(t).has(e):n&&c(n,t.id)}}),r(u.prototype,n?{get:function(e){var t=d(this);if(A(e)){var n=o(e);return!0===n?v(t).get(e):n?n[t.id]:void 0}},set:function(e,t){return g(this,e,t)}}:{add:function(e){return g(this,e,!0)}}),u}}},7710:function(e,t,n){"use strict";var r=n(2109),o=n(7854),i=n(4705),A=n(1320),a=n(2423),s=n(408),l=n(5787),c=n(111),u=n(7293),f=n(7072),p=n(8003),d=n(9587);e.exports=function(e,t,n){var g=-1!==e.indexOf("Map"),h=-1!==e.indexOf("Weak"),v=g?"set":"add",m=o[e],C=m&&m.prototype,y=m,b={},w=function(e){var t=C[e];A(C,e,"add"==e?function(e){return t.call(this,0===e?0:e),this}:"delete"==e?function(e){return!(h&&!c(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return h&&!c(e)?void 0:t.call(this,0===e?0:e)}:"has"==e?function(e){return!(h&&!c(e))&&t.call(this,0===e?0:e)}:function(e,n){return t.call(this,0===e?0:e,n),this})};if(i(e,"function"!=typeof m||!(h||C.forEach&&!u((function(){(new m).entries().next()})))))y=n.getConstructor(t,e,g,v),a.enable();else if(i(e,!0)){var E=new y,B=E[v](h?{}:-0,1)!=E,x=u((function(){E.has(1)})),k=f((function(e){new m(e)})),I=!h&&u((function(){for(var e=new m,t=5;t--;)e[v](t,t);return!e.has(-0)}));k||((y=t((function(t,n){l(t,y,e);var r=d(new m,t,y);return null!=n&&s(n,r[v],{that:r,AS_ENTRIES:g}),r}))).prototype=C,C.constructor=y),(x||I)&&(w("delete"),w("has"),g&&w("get")),(I||B)&&w(v),h&&C.clear&&delete C.clear}return b[e]=y,r({global:!0,forced:y!=m},b),p(y,e),h||n.setStrong(y,e,g),y}},9920:function(e,t,n){var r=n(6656),o=n(3887),i=n(1236),A=n(3070);e.exports=function(e,t){for(var n=o(t),a=A.f,s=i.f,l=0;l"+a+""}},4994:function(e,t,n){"use strict";var r=n(3383).IteratorPrototype,o=n(30),i=n(9114),A=n(8003),a=n(7497),s=function(){return this};e.exports=function(e,t,n){var l=t+" Iterator";return e.prototype=o(r,{next:i(1,n)}),A(e,l,!1,!0),a[l]=s,e}},8880:function(e,t,n){var r=n(9781),o=n(3070),i=n(9114);e.exports=r?function(e,t,n){return o.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},9114:function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},6135:function(e,t,n){"use strict";var r=n(4948),o=n(3070),i=n(9114);e.exports=function(e,t,n){var A=r(t);A in e?o.f(e,A,i(0,n)):e[A]=n}},5573:function(e,t,n){"use strict";var r=n(7293),o=n(6650).start,i=Math.abs,A=Date.prototype,a=A.getTime,s=A.toISOString;e.exports=r((function(){return"0385-07-25T07:06:39.999Z"!=s.call(new Date(-50000000000001))}))||!r((function(){s.call(new Date(NaN))}))?function(){if(!isFinite(a.call(this)))throw RangeError("Invalid time value");var e=this,t=e.getUTCFullYear(),n=e.getUTCMilliseconds(),r=t<0?"-":t>9999?"+":"";return r+o(i(t),r?6:4,0)+"-"+o(e.getUTCMonth()+1,2,0)+"-"+o(e.getUTCDate(),2,0)+"T"+o(e.getUTCHours(),2,0)+":"+o(e.getUTCMinutes(),2,0)+":"+o(e.getUTCSeconds(),2,0)+"."+o(n,3,0)+"Z"}:s},8709:function(e,t,n){"use strict";var r=n(9670),o=n(2140);e.exports=function(e){if(r(this),"string"===e||"default"===e)e="string";else if("number"!==e)throw TypeError("Incorrect hint");return o(this,e)}},654:function(e,t,n){"use strict";var r=n(2109),o=n(4994),i=n(9518),A=n(7674),a=n(8003),s=n(8880),l=n(1320),c=n(5112),u=n(1913),f=n(7497),p=n(3383),d=p.IteratorPrototype,g=p.BUGGY_SAFARI_ITERATORS,h=c("iterator"),v="keys",m="values",C="entries",y=function(){return this};e.exports=function(e,t,n,c,p,b,w){o(n,t,c);var E,B,x,k=function(e){if(e===p&&R)return R;if(!g&&e in T)return T[e];switch(e){case v:case m:case C:return function(){return new n(this,e)}}return function(){return new n(this)}},I=t+" Iterator",S=!1,T=e.prototype,L=T[h]||T["@@iterator"]||p&&T[p],R=!g&&L||k(p),Q="Array"==t&&T.entries||L;if(Q&&(E=i(Q.call(new e)),d!==Object.prototype&&E.next&&(u||i(E)===d||(A?A(E,d):"function"!=typeof E[h]&&s(E,h,y)),a(E,I,!0,!0),u&&(f[I]=y))),p==m&&L&&L.name!==m&&(S=!0,R=function(){return L.call(this)}),u&&!w||T[h]===R||s(T,h,R),f[t]=R,p)if(B={values:k(m),keys:b?R:k(v),entries:k(C)},w)for(x in B)(g||S||!(x in T))&&l(T,x,B[x]);else r({target:t,proto:!0,forced:g||S},B);return B}},7235:function(e,t,n){var r=n(857),o=n(6656),i=n(6061),A=n(3070).f;e.exports=function(e){var t=r.Symbol||(r.Symbol={});o(t,e)||A(t,e,{value:i.f(e)})}},9781:function(e,t,n){var r=n(7293);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},317:function(e,t,n){var r=n(7854),o=n(111),i=r.document,A=o(i)&&o(i.createElement);e.exports=function(e){return A?i.createElement(e):{}}},8324:function(e){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8886:function(e,t,n){var r=n(8113).match(/firefox\/(\d+)/i);e.exports=!!r&&+r[1]},7871:function(e){e.exports="object"==typeof window},256:function(e,t,n){var r=n(8113);e.exports=/MSIE|Trident/.test(r)},1528:function(e,t,n){var r=n(8113),o=n(7854);e.exports=/ipad|iphone|ipod/i.test(r)&&void 0!==o.Pebble},8334:function(e,t,n){var r=n(8113);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},5268:function(e,t,n){var r=n(4326),o=n(7854);e.exports="process"==r(o.process)},1036:function(e,t,n){var r=n(8113);e.exports=/web0s(?!.*chrome)/i.test(r)},8113:function(e,t,n){var r=n(5005);e.exports=r("navigator","userAgent")||""},7392:function(e,t,n){var r,o,i=n(7854),A=n(8113),a=i.process,s=i.Deno,l=a&&a.versions||s&&s.version,c=l&&l.v8;c?o=(r=c.split("."))[0]<4?1:r[0]+r[1]:A&&(!(r=A.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=A.match(/Chrome\/(\d+)/))&&(o=r[1]),e.exports=o&&+o},8008:function(e,t,n){var r=n(8113).match(/AppleWebKit\/(\d+)\./);e.exports=!!r&&+r[1]},748:function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:function(e,t,n){var r=n(7854),o=n(1236).f,i=n(8880),A=n(1320),a=n(3505),s=n(9920),l=n(4705);e.exports=function(e,t){var n,c,u,f,p,d=e.target,g=e.global,h=e.stat;if(n=g?r:h?r[d]||a(d,{}):(r[d]||{}).prototype)for(c in t){if(f=t[c],u=e.noTargetGet?(p=o(n,c))&&p.value:n[c],!l(g?c:d+(h?".":"#")+c,e.forced)&&void 0!==u){if(typeof f==typeof u)continue;s(f,u)}(e.sham||u&&u.sham)&&i(f,"sham",!0),A(n,c,f,e)}}},7293:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},7007:function(e,t,n){"use strict";n(4916);var r=n(1320),o=n(2261),i=n(7293),A=n(5112),a=n(8880),s=A("species"),l=RegExp.prototype;e.exports=function(e,t,n,c){var u=A(e),f=!i((function(){var t={};return t[u]=function(){return 7},7!=""[e](t)})),p=f&&!i((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[s]=function(){return n},n.flags="",n[u]=/./[u]),n.exec=function(){return t=!0,null},n[u](""),!t}));if(!f||!p||n){var d=/./[u],g=t(u,""[e],(function(e,t,n,r,i){var A=t.exec;return A===o||A===l.exec?f&&!i?{done:!0,value:d.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}));r(String.prototype,e,g[0]),r(l,u,g[1])}c&&a(l[u],"sham",!0)}},6790:function(e,t,n){"use strict";var r=n(3157),o=n(7466),i=n(9974),A=function(e,t,n,a,s,l,c,u){for(var f,p=s,d=0,g=!!c&&i(c,u,3);d0&&r(f))p=A(e,t,f,o(f.length),p,l-1)-1;else{if(p>=9007199254740991)throw TypeError("Exceed the acceptable array length");e[p]=f}p++}d++}return p};e.exports=A},6677:function(e,t,n){var r=n(7293);e.exports=!r((function(){return Object.isExtensible(Object.preventExtensions({}))}))},9974:function(e,t,n){var r=n(3099);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},7065:function(e,t,n){"use strict";var r=n(3099),o=n(111),i=[].slice,A={},a=function(e,t,n){if(!(t in A)){for(var r=[],o=0;o]*>)/g,a=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,n,s,l,c){var u=n+e.length,f=s.length,p=a;return void 0!==l&&(l=r(l),p=A),i.call(c,p,(function(r,i){var A;switch(i.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,n);case"'":return t.slice(u);case"<":A=l[i.slice(1,-1)];break;default:var a=+i;if(0===a)return r;if(a>f){var c=o(a/10);return 0===c?r:c<=f?void 0===s[c-1]?i.charAt(1):s[c-1]+i.charAt(1):r}A=s[a-1]}return void 0===A?"":A}))}},7854:function(e,t,n){var r=function(e){return e&&e.Math==Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},6656:function(e,t,n){var r=n(7908),o={}.hasOwnProperty;e.exports=Object.hasOwn||function(e,t){return o.call(r(e),t)}},3501:function(e){e.exports={}},842:function(e,t,n){var r=n(7854);e.exports=function(e,t){var n=r.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))}},490:function(e,t,n){var r=n(5005);e.exports=r("document","documentElement")},4664:function(e,t,n){var r=n(9781),o=n(7293),i=n(317);e.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},1179:function(e){var t=Math.abs,n=Math.pow,r=Math.floor,o=Math.log,i=Math.LN2;e.exports={pack:function(e,A,a){var s,l,c,u=new Array(a),f=8*a-A-1,p=(1<>1,g=23===A?n(2,-24)-n(2,-77):0,h=e<0||0===e&&1/e<0?1:0,v=0;for((e=t(e))!=e||e===1/0?(l=e!=e?1:0,s=p):(s=r(o(e)/i),e*(c=n(2,-s))<1&&(s--,c*=2),(e+=s+d>=1?g/c:g*n(2,1-d))*c>=2&&(s++,c/=2),s+d>=p?(l=0,s=p):s+d>=1?(l=(e*c-1)*n(2,A),s+=d):(l=e*n(2,d-1)*n(2,A),s=0));A>=8;u[v++]=255&l,l/=256,A-=8);for(s=s<0;u[v++]=255&s,s/=256,f-=8);return u[--v]|=128*h,u},unpack:function(e,t){var r,o=e.length,i=8*o-t-1,A=(1<>1,s=i-7,l=o-1,c=e[l--],u=127&c;for(c>>=7;s>0;u=256*u+e[l],l--,s-=8);for(r=u&(1<<-s)-1,u>>=-s,s+=t;s>0;r=256*r+e[l],l--,s-=8);if(0===u)u=1-a;else{if(u===A)return r?NaN:c?-1/0:1/0;r+=n(2,t),u-=a}return(c?-1:1)*r*n(2,u-t)}}},8361:function(e,t,n){var r=n(7293),o=n(4326),i="".split;e.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==o(e)?i.call(e,""):Object(e)}:Object},9587:function(e,t,n){var r=n(111),o=n(7674);e.exports=function(e,t,n){var i,A;return o&&"function"==typeof(i=t.constructor)&&i!==n&&r(A=i.prototype)&&A!==n.prototype&&o(e,A),e}},2788:function(e,t,n){var r=n(5465),o=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(e){return o.call(e)}),e.exports=r.inspectSource},2423:function(e,t,n){var r=n(2109),o=n(3501),i=n(111),A=n(6656),a=n(3070).f,s=n(8006),l=n(1156),c=n(9711),u=n(6677),f=!1,p=c("meta"),d=0,g=Object.isExtensible||function(){return!0},h=function(e){a(e,p,{value:{objectID:"O"+d++,weakData:{}}})},v=e.exports={enable:function(){v.enable=function(){},f=!0;var e=s.f,t=[].splice,n={};n[p]=1,e(n).length&&(s.f=function(n){for(var r=e(n),o=0,i=r.length;of;f++)if((d=E(e[f]))&&d instanceof l)return d;return new l(!1)}c=u.call(e)}for(g=c.next;!(h=g.call(c)).done;){try{d=E(h.value)}catch(e){throw s(c),e}if("object"==typeof d&&d&&d instanceof l)return d}return new l(!1)}},9212:function(e,t,n){var r=n(9670);e.exports=function(e){var t=e.return;if(void 0!==t)return r(t.call(e)).value}},3383:function(e,t,n){"use strict";var r,o,i,A=n(7293),a=n(9518),s=n(8880),l=n(6656),c=n(5112),u=n(1913),f=c("iterator"),p=!1;[].keys&&("next"in(i=[].keys())?(o=a(a(i)))!==Object.prototype&&(r=o):p=!0);var d=null==r||A((function(){var e={};return r[f].call(e)!==e}));d&&(r={}),u&&!d||l(r,f)||s(r,f,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:p}},7497:function(e){e.exports={}},6736:function(e){var t=Math.expm1,n=Math.exp;e.exports=!t||t(10)>22025.465794806718||t(10)<22025.465794806718||-2e-17!=t(-2e-17)?function(e){return 0==(e=+e)?e:e>-1e-6&&e<1e-6?e+e*e/2:n(e)-1}:t},6130:function(e,t,n){var r=n(4310),o=Math.abs,i=Math.pow,A=i(2,-52),a=i(2,-23),s=i(2,127)*(2-a),l=i(2,-126);e.exports=Math.fround||function(e){var t,n,i=o(e),c=r(e);return is||n!=n?c*(1/0):c*n}},6513:function(e){var t=Math.log;e.exports=Math.log1p||function(e){return(e=+e)>-1e-8&&e<1e-8?e-e*e/2:t(1+e)}},4310:function(e){e.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},5948:function(e,t,n){var r,o,i,A,a,s,l,c,u=n(7854),f=n(1236).f,p=n(261).set,d=n(8334),g=n(1528),h=n(1036),v=n(5268),m=u.MutationObserver||u.WebKitMutationObserver,C=u.document,y=u.process,b=u.Promise,w=f(u,"queueMicrotask"),E=w&&w.value;E||(r=function(){var e,t;for(v&&(e=y.domain)&&e.exit();o;){t=o.fn,o=o.next;try{t()}catch(e){throw o?A():i=void 0,e}}i=void 0,e&&e.enter()},d||v||h||!m||!C?!g&&b&&b.resolve?((l=b.resolve(void 0)).constructor=b,c=l.then,A=function(){c.call(l,r)}):A=v?function(){y.nextTick(r)}:function(){p.call(u,r)}:(a=!0,s=C.createTextNode(""),new m(r).observe(s,{characterData:!0}),A=function(){s.data=a=!a})),e.exports=E||function(e){var t={fn:e,next:void 0};i&&(i.next=t),o||(o=t,A()),i=t}},3366:function(e,t,n){var r=n(7854);e.exports=r.Promise},133:function(e,t,n){var r=n(7392),o=n(7293);e.exports=!!Object.getOwnPropertySymbols&&!o((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},590:function(e,t,n){var r=n(7293),o=n(5112),i=n(1913),A=o("iterator");e.exports=!r((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),n+=r+e})),i&&!e.toJSON||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[A]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host}))},8536:function(e,t,n){var r=n(7854),o=n(2788),i=r.WeakMap;e.exports="function"==typeof i&&/native code/.test(o(i))},8523:function(e,t,n){"use strict";var r=n(3099),o=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)};e.exports.f=function(e){return new o(e)}},3929:function(e,t,n){var r=n(7850);e.exports=function(e){if(r(e))throw TypeError("The method doesn't accept regular expressions");return e}},7023:function(e,t,n){var r=n(7854).isFinite;e.exports=Number.isFinite||function(e){return"number"==typeof e&&r(e)}},2814:function(e,t,n){var r=n(7854),o=n(1340),i=n(3111).trim,A=n(1361),a=r.parseFloat,s=1/a(A+"-0")!=-1/0;e.exports=s?function(e){var t=i(o(e)),n=a(t);return 0===n&&"-"==t.charAt(0)?-0:n}:a},3009:function(e,t,n){var r=n(7854),o=n(1340),i=n(3111).trim,A=n(1361),a=r.parseInt,s=/^[+-]?0[Xx]/,l=8!==a(A+"08")||22!==a(A+"0x16");e.exports=l?function(e,t){var n=i(o(e));return a(n,t>>>0||(s.test(n)?16:10))}:a},1574:function(e,t,n){"use strict";var r=n(9781),o=n(7293),i=n(1956),A=n(5181),a=n(5296),s=n(7908),l=n(8361),c=Object.assign,u=Object.defineProperty;e.exports=!c||o((function(){if(r&&1!==c({b:1},c(u({},"a",{enumerable:!0,get:function(){u(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),o="abcdefghijklmnopqrst";return e[n]=7,o.split("").forEach((function(e){t[e]=e})),7!=c({},e)[n]||i(c({},t)).join("")!=o}))?function(e,t){for(var n=s(e),o=arguments.length,c=1,u=A.f,f=a.f;o>c;)for(var p,d=l(arguments[c++]),g=u?i(d).concat(u(d)):i(d),h=g.length,v=0;h>v;)p=g[v++],r&&!f.call(d,p)||(n[p]=d[p]);return n}:c},30:function(e,t,n){var r,o=n(9670),i=n(6048),A=n(748),a=n(3501),s=n(490),l=n(317),c=n(6200)("IE_PROTO"),u=function(){},f=function(e){return"