UNPKG

scrolly-video

Version:

A component for scroll-based (or other externally controlled) playback.

1 lines 161 kB
var ScrollyVideo=function(){"use strict";function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var e,i={exports:{}};var s,r,n,a=(e||(e=1,s=i,r=i.exports,function(t,e){var i="function",n="undefined",a="object",o="string",h="model",d="name",l="type",p="vendor",f="version",u="architecture",c="console",m="mobile",_="tablet",g="smarttv",y="wearable",b="embedded",v="Amazon",w="Apple",S="ASUS",U="BlackBerry",x="Browser",E="Chrome",B="Firefox",A="Google",T="Huawei",z="LG",k="Microsoft",I="Motorola",C="Opera",P="Samsung",F="Sharp",L="Sony",D="Xiaomi",R="Zebra",N="Facebook",M=function(t){for(var e={},i=0;i<t.length;i++)e[t[i].toUpperCase()]=t[i];return e},O=function(t,e){return typeof t===o&&-1!==G(e).indexOf(G(t))},G=function(t){return t.toLowerCase()},H=function(t,e){if(typeof t===o)return t=t.replace(/^\s\s*/,""),typeof e===n?t:t.substring(0,350)},V=function(t,s){for(var r,n,o,h,d,l,p=0;p<s.length&&!d;){var f=s[p],u=s[p+1];for(r=n=0;r<f.length&&!d;)if(d=f[r++].exec(t))for(o=0;o<u.length;o++)l=d[++n],typeof(h=u[o])===a&&h.length>0?2===h.length?typeof h[1]==i?this[h[0]]=h[1].call(this,l):this[h[0]]=h[1]:3===h.length?typeof h[1]!==i||h[1].exec&&h[1].test?this[h[0]]=l?l.replace(h[1],h[2]):e:this[h[0]]=l?h[1].call(this,l,h[2]):e:4===h.length&&(this[h[0]]=l?h[3].call(this,l.replace(h[1],h[2])):e):this[h]=l||e;p+=2}},Y=function(t,i){for(var s in i)if(typeof i[s]===a&&i[s].length>0){for(var r=0;r<i[s].length;r++)if(O(i[s][r],t))return"?"===s?e:s}else if(O(i[s],t))return"?"===s?e:s;return t},j={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},q={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[f,[d,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[d,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[d,f],[/opios[\/ ]+([\w\.]+)/i],[f,[d,C+" Mini"]],[/\bopr\/([\w\.]+)/i],[f,[d,C]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[d,f],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[d,"UC"+x]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[f,[d,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[f,[d,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[d,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[d,"IE"]],[/yabrowser\/([\w\.]+)/i],[f,[d,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[d,/(.+)/,"$1 Secure "+x],f],[/\bfocus\/([\w\.]+)/i],[f,[d,B+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[d,C+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[d,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[d,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[d,C+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[d,"MIUI "+x]],[/fxios\/([-\w\.]+)/i],[f,[d,B]],[/\bqihu|(qi?ho?o?|360)browser/i],[[d,"360 "+x]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[d,/(.+)/,"$1 "+x],f],[/(comodo_dragon)\/([\w\.]+)/i],[[d,/_/g," "],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[d,f],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[d],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[d,N],f],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[d,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[d,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[d,E+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[d,E+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[d,"Android "+x]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[d,f],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[f,[d,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[f,d],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[d,[f,Y,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[d,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[d,"Netscape"],f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[d,B+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[d,f],[/(cobalt)\/([\w\.]+)/i],[d,[f,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[u,"amd64"]],[/(ia32(?=;))/i],[[u,G]],[/((?:i[346]|x)86)[;\)]/i],[[u,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[u,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[u,"armhf"]],[/windows (ce|mobile); ppc;/i],[[u,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[u,/ower/,"",G]],[/(sun4\w)[;\)]/i],[[u,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[u,G]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[h,[p,P],[l,_]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[h,[p,P],[l,m]],[/\((ip(?:hone|od)[\w ]*);/i],[h,[p,w],[l,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[h,[p,w],[l,_]],[/(macintosh);/i],[h,[p,w]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[h,[p,T],[l,_]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[h,[p,T],[l,m]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[h,/_/g," "],[p,D],[l,m]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[h,/_/g," "],[p,D],[l,_]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[h,[p,"OPPO"],[l,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[h,[p,"Vivo"],[l,m]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[h,[p,"Realme"],[l,m]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[h,[p,I],[l,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[h,[p,I],[l,_]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[h,[p,z],[l,_]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[h,[p,z],[l,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[h,[p,"Lenovo"],[l,_]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[h,/_/g," "],[p,"Nokia"],[l,m]],[/(pixel c)\b/i],[h,[p,A],[l,_]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[h,[p,A],[l,m]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[h,[p,L],[l,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[h,"Xperia Tablet"],[p,L],[l,_]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[h,[p,"OnePlus"],[l,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[h,[p,v],[l,_]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[h,/(.+)/g,"Fire Phone $1"],[p,v],[l,m]],[/(playbook);[-\w\),; ]+(rim)/i],[h,p,[l,_]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[h,[p,U],[l,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[h,[p,S],[l,_]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[h,[p,S],[l,m]],[/(nexus 9)/i],[h,[p,"HTC"],[l,_]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[p,[h,/_/g," "],[l,m]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[h,[p,"Acer"],[l,_]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[h,[p,"Meizu"],[l,m]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[h,[p,F],[l,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[p,h,[l,m]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[p,h,[l,_]],[/(surface duo)/i],[h,[p,k],[l,_]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[h,[p,"Fairphone"],[l,m]],[/(u304aa)/i],[h,[p,"AT&T"],[l,m]],[/\bsie-(\w*)/i],[h,[p,"Siemens"],[l,m]],[/\b(rct\w+) b/i],[h,[p,"RCA"],[l,_]],[/\b(venue[\d ]{2,7}) b/i],[h,[p,"Dell"],[l,_]],[/\b(q(?:mv|ta)\w+) b/i],[h,[p,"Verizon"],[l,_]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[h,[p,"Barnes & Noble"],[l,_]],[/\b(tm\d{3}\w+) b/i],[h,[p,"NuVision"],[l,_]],[/\b(k88) b/i],[h,[p,"ZTE"],[l,_]],[/\b(nx\d{3}j) b/i],[h,[p,"ZTE"],[l,m]],[/\b(gen\d{3}) b.+49h/i],[h,[p,"Swiss"],[l,m]],[/\b(zur\d{3}) b/i],[h,[p,"Swiss"],[l,_]],[/\b((zeki)?tb.*\b) b/i],[h,[p,"Zeki"],[l,_]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[p,"Dragon Touch"],h,[l,_]],[/\b(ns-?\w{0,9}) b/i],[h,[p,"Insignia"],[l,_]],[/\b((nxa|next)-?\w{0,9}) b/i],[h,[p,"NextBook"],[l,_]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[p,"Voice"],h,[l,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[p,"LvTel"],h,[l,m]],[/\b(ph-1) /i],[h,[p,"Essential"],[l,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[h,[p,"Envizen"],[l,_]],[/\b(trio[-\w\. ]+) b/i],[h,[p,"MachSpeed"],[l,_]],[/\btu_(1491) b/i],[h,[p,"Rotor"],[l,_]],[/(shield[\w ]+) b/i],[h,[p,"Nvidia"],[l,_]],[/(sprint) (\w+)/i],[p,h,[l,m]],[/(kin\.[onetw]{3})/i],[[h,/\./g," "],[p,k],[l,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[h,[p,R],[l,_]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[h,[p,R],[l,m]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[p,h,[l,c]],[/droid.+; (shield) bui/i],[h,[p,"Nvidia"],[l,c]],[/(playstation [345portablevi]+)/i],[h,[p,L],[l,c]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[h,[p,k],[l,c]],[/smart-tv.+(samsung)/i],[p,[l,g]],[/hbbtv.+maple;(\d+)/i],[[h,/^/,"SmartTV"],[p,P],[l,g]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[p,z],[l,g]],[/(apple) ?tv/i],[p,[h,w+" TV"],[l,g]],[/crkey/i],[[h,E+"cast"],[p,A],[l,g]],[/droid.+aft(\w)( bui|\))/i],[h,[p,v],[l,g]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[h,[p,F],[l,g]],[/(bravia[\w ]+)( bui|\))/i],[h,[p,L],[l,g]],[/(mitv-\w{5}) bui/i],[h,[p,D],[l,g]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[p,H],[h,H],[l,g]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,g]],[/((pebble))app/i],[p,h,[l,y]],[/droid.+; (glass) \d/i],[h,[p,A],[l,y]],[/droid.+; (wt63?0{2,3})\)/i],[h,[p,R],[l,y]],[/(quest( 2)?)/i],[h,[p,N],[l,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[p,[l,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[h,[l,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[h,[l,_]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,_]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[l,m]],[/(android[-\w\. ]{0,9});.+buil/i],[h,[p,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[d,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[d,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[d,f],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,d]],os:[[/microsoft (windows) (vista|xp)/i],[d,f],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[d,[f,Y,j]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[d,"Windows"],[f,Y,j]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[d,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[d,"Mac OS"],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[f,d],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[d,f],[/\(bb(10);/i],[f,[d,U]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[f,[d,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[d,B+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[d,"webOS"]],[/crkey\/([\d\.]+)/i],[f,[d,E+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[d,"Chromium OS"],f],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[d,f],[/(sunos) ?([\w\.\d]*)/i],[[d,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[d,f]]},W=function(i,s){if(typeof i===a&&(s=i,i=e),!(this instanceof W))return new W(i,s).getResult();var r=i||(typeof t!==n&&t.navigator&&t.navigator.userAgent?t.navigator.userAgent:""),c=s?function(t,e){var i={};for(var s in t)e[s]&&e[s].length%2==0?i[s]=e[s].concat(t[s]):i[s]=t[s];return i}(q,s):q;return this.getBrowser=function(){var t,i={};return i[d]=e,i[f]=e,V.call(i,r,c.browser),i.major=typeof(t=i.version)===o?t.replace(/[^\d\.]/g,"").split(".")[0]:e,i},this.getCPU=function(){var t={};return t[u]=e,V.call(t,r,c.cpu),t},this.getDevice=function(){var t={};return t[p]=e,t[h]=e,t[l]=e,V.call(t,r,c.device),t},this.getEngine=function(){var t={};return t[d]=e,t[f]=e,V.call(t,r,c.engine),t},this.getOS=function(){var t={};return t[d]=e,t[f]=e,V.call(t,r,c.os),t},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(t){return r=typeof t===o&&t.length>350?H(t,350):t,this},this.setUA(r),this};W.VERSION="1.0.33",W.BROWSER=M([d,f,"major"]),W.CPU=M([u]),W.DEVICE=M([h,p,l,c,m,g,_,y,b]),W.ENGINE=W.OS=M([d,f]),s.exports&&(r=s.exports=W),r.UAParser=W;var K=typeof t!==n&&(t.jQuery||t.Zepto);if(K&&!K.ua){var X=new W;K.ua=X.getResult(),K.ua.get=function(){return X.getUA()},K.ua.set=function(t){X.setUA(t);var e=X.getResult();for(var i in e)K.ua[i]=e[i]}}}("object"==typeof window?window:i.exports)),i.exports),o=t(a),h={};var d=(n||(n=1,function(t){var e,i,s,r=(e=new Date,i=4,s={setLogLevel:function(t){i=t==this.debug?1:t==this.info?2:t==this.warn?3:(this.error,4)},debug:function(t,s){void 0===console.debug&&(console.debug=console.log),1>=i&&console.debug("["+r.getDurationString(new Date-e,1e3)+"]","["+t+"]",s)},log:function(t,e){this.debug(t.msg)},info:function(t,s){2>=i&&console.info("["+r.getDurationString(new Date-e,1e3)+"]","["+t+"]",s)},warn:function(t,s){3>=i&&console.warn("["+r.getDurationString(new Date-e,1e3)+"]","["+t+"]",s)},error:function(t,s){4>=i&&console.error("["+r.getDurationString(new Date-e,1e3)+"]","["+t+"]",s)}},s);r.getDurationString=function(t,e){var i;function s(t,e){for(var i=(""+t).split(".");i[0].length<e;)i[0]="0"+i[0];return i.join(".")}t<0?(i=!0,t=-t):i=!1;var r=t/(e||1),n=Math.floor(r/3600);r-=3600*n;var a=Math.floor(r/60),o=1e3*(r-=60*a);return o-=1e3*(r=Math.floor(r)),o=Math.floor(o),(i?"-":"")+n+":"+s(a,2)+":"+s(r,2)+"."+s(o,3)},r.printRanges=function(t){var e=t.length;if(e>0){for(var i="",s=0;s<e;s++)s>0&&(i+=","),i+="["+r.getDurationString(t.start(s))+","+r.getDurationString(t.end(s))+"]";return i}return"(empty)"},t.Log=r;var n=function(t){if(!(t instanceof ArrayBuffer))throw"Needs an array buffer";this.buffer=t,this.dataview=new DataView(t),this.position=0};n.prototype.getPosition=function(){return this.position},n.prototype.getEndPosition=function(){return this.buffer.byteLength},n.prototype.getLength=function(){return this.buffer.byteLength},n.prototype.seek=function(t){var e=Math.max(0,Math.min(this.buffer.byteLength,t));return this.position=isNaN(e)||!isFinite(e)?0:e,!0},n.prototype.isEos=function(){return this.getPosition()>=this.getEndPosition()},n.prototype.readAnyInt=function(t,e){var i=0;if(this.position+t<=this.buffer.byteLength){switch(t){case 1:i=e?this.dataview.getInt8(this.position):this.dataview.getUint8(this.position);break;case 2:i=e?this.dataview.getInt16(this.position):this.dataview.getUint16(this.position);break;case 3:if(e)throw"No method for reading signed 24 bits values";i=this.dataview.getUint8(this.position)<<16,i|=this.dataview.getUint8(this.position+1)<<8,i|=this.dataview.getUint8(this.position+2);break;case 4:i=e?this.dataview.getInt32(this.position):this.dataview.getUint32(this.position);break;case 8:if(e)throw"No method for reading signed 64 bits values";i=this.dataview.getUint32(this.position)<<32,i|=this.dataview.getUint32(this.position+4);break;default:throw"readInt method not implemented for size: "+t}return this.position+=t,i}throw"Not enough bytes in buffer"},n.prototype.readUint8=function(){return this.readAnyInt(1,!1)},n.prototype.readUint16=function(){return this.readAnyInt(2,!1)},n.prototype.readUint24=function(){return this.readAnyInt(3,!1)},n.prototype.readUint32=function(){return this.readAnyInt(4,!1)},n.prototype.readUint64=function(){return this.readAnyInt(8,!1)},n.prototype.readString=function(t){if(this.position+t<=this.buffer.byteLength){for(var e="",i=0;i<t;i++)e+=String.fromCharCode(this.readUint8());return e}throw"Not enough bytes in buffer"},n.prototype.readCString=function(){for(var t=[];;){var e=this.readUint8();if(0===e)break;t.push(e)}return String.fromCharCode.apply(null,t)},n.prototype.readInt8=function(){return this.readAnyInt(1,!0)},n.prototype.readInt16=function(){return this.readAnyInt(2,!0)},n.prototype.readInt32=function(){return this.readAnyInt(4,!0)},n.prototype.readInt64=function(){return this.readAnyInt(8,!1)},n.prototype.readUint8Array=function(t){for(var e=new Uint8Array(t),i=0;i<t;i++)e[i]=this.readUint8();return e},n.prototype.readInt16Array=function(t){for(var e=new Int16Array(t),i=0;i<t;i++)e[i]=this.readInt16();return e},n.prototype.readUint16Array=function(t){for(var e=new Int16Array(t),i=0;i<t;i++)e[i]=this.readUint16();return e},n.prototype.readUint32Array=function(t){for(var e=new Uint32Array(t),i=0;i<t;i++)e[i]=this.readUint32();return e},n.prototype.readInt32Array=function(t){for(var e=new Int32Array(t),i=0;i<t;i++)e[i]=this.readInt32();return e},t.MP4BoxStream=n;var a=function(t,e,i){this._byteOffset=e||0,t instanceof ArrayBuffer?this.buffer=t:"object"==typeof t?(this.dataView=t,e&&(this._byteOffset+=e)):this.buffer=new ArrayBuffer(t||0),this.position=0,this.endianness=null==i?a.LITTLE_ENDIAN:i};a.prototype={},a.prototype.getPosition=function(){return this.position},a.prototype._realloc=function(t){if(this._dynamicSize){var e=this._byteOffset+this.position+t,i=this._buffer.byteLength;if(e<=i)e>this._byteLength&&(this._byteLength=e);else{for(i<1&&(i=1);e>i;)i*=2;var s=new ArrayBuffer(i),r=new Uint8Array(this._buffer);new Uint8Array(s,0,r.length).set(r),this.buffer=s,this._byteLength=e}}},a.prototype._trimAlloc=function(){if(this._byteLength!=this._buffer.byteLength){var t=new ArrayBuffer(this._byteLength),e=new Uint8Array(t),i=new Uint8Array(this._buffer,0,e.length);e.set(i),this.buffer=t}},a.BIG_ENDIAN=!1,a.LITTLE_ENDIAN=!0,a.prototype._byteLength=0,Object.defineProperty(a.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}}),Object.defineProperty(a.prototype,"buffer",{get:function(){return this._trimAlloc(),this._buffer},set:function(t){this._buffer=t,this._dataView=new DataView(this._buffer,this._byteOffset),this._byteLength=this._buffer.byteLength}}),Object.defineProperty(a.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(t){this._byteOffset=t,this._dataView=new DataView(this._buffer,this._byteOffset),this._byteLength=this._buffer.byteLength}}),Object.defineProperty(a.prototype,"dataView",{get:function(){return this._dataView},set:function(t){this._byteOffset=t.byteOffset,this._buffer=t.buffer,this._dataView=new DataView(this._buffer,this._byteOffset),this._byteLength=this._byteOffset+t.byteLength}}),a.prototype.seek=function(t){var e=Math.max(0,Math.min(this.byteLength,t));this.position=isNaN(e)||!isFinite(e)?0:e},a.prototype.isEof=function(){return this.position>=this._byteLength},a.prototype.mapUint8Array=function(t){this._realloc(1*t);var e=new Uint8Array(this._buffer,this.byteOffset+this.position,t);return this.position+=1*t,e},a.prototype.readInt32Array=function(t,e){t=null==t?this.byteLength-this.position/4:t;var i=new Int32Array(t);return a.memcpy(i.buffer,0,this.buffer,this.byteOffset+this.position,t*i.BYTES_PER_ELEMENT),a.arrayToNative(i,null==e?this.endianness:e),this.position+=i.byteLength,i},a.prototype.readInt16Array=function(t,e){t=null==t?this.byteLength-this.position/2:t;var i=new Int16Array(t);return a.memcpy(i.buffer,0,this.buffer,this.byteOffset+this.position,t*i.BYTES_PER_ELEMENT),a.arrayToNative(i,null==e?this.endianness:e),this.position+=i.byteLength,i},a.prototype.readInt8Array=function(t){t=null==t?this.byteLength-this.position:t;var e=new Int8Array(t);return a.memcpy(e.buffer,0,this.buffer,this.byteOffset+this.position,t*e.BYTES_PER_ELEMENT),this.position+=e.byteLength,e},a.prototype.readUint32Array=function(t,e){t=null==t?this.byteLength-this.position/4:t;var i=new Uint32Array(t);return a.memcpy(i.buffer,0,this.buffer,this.byteOffset+this.position,t*i.BYTES_PER_ELEMENT),a.arrayToNative(i,null==e?this.endianness:e),this.position+=i.byteLength,i},a.prototype.readUint16Array=function(t,e){t=null==t?this.byteLength-this.position/2:t;var i=new Uint16Array(t);return a.memcpy(i.buffer,0,this.buffer,this.byteOffset+this.position,t*i.BYTES_PER_ELEMENT),a.arrayToNative(i,null==e?this.endianness:e),this.position+=i.byteLength,i},a.prototype.readUint8Array=function(t){t=null==t?this.byteLength-this.position:t;var e=new Uint8Array(t);return a.memcpy(e.buffer,0,this.buffer,this.byteOffset+this.position,t*e.BYTES_PER_ELEMENT),this.position+=e.byteLength,e},a.prototype.readFloat64Array=function(t,e){t=null==t?this.byteLength-this.position/8:t;var i=new Float64Array(t);return a.memcpy(i.buffer,0,this.buffer,this.byteOffset+this.position,t*i.BYTES_PER_ELEMENT),a.arrayToNative(i,null==e?this.endianness:e),this.position+=i.byteLength,i},a.prototype.readFloat32Array=function(t,e){t=null==t?this.byteLength-this.position/4:t;var i=new Float32Array(t);return a.memcpy(i.buffer,0,this.buffer,this.byteOffset+this.position,t*i.BYTES_PER_ELEMENT),a.arrayToNative(i,null==e?this.endianness:e),this.position+=i.byteLength,i},a.prototype.readInt32=function(t){var e=this._dataView.getInt32(this.position,null==t?this.endianness:t);return this.position+=4,e},a.prototype.readInt16=function(t){var e=this._dataView.getInt16(this.position,null==t?this.endianness:t);return this.position+=2,e},a.prototype.readInt8=function(){var t=this._dataView.getInt8(this.position);return this.position+=1,t},a.prototype.readUint32=function(t){var e=this._dataView.getUint32(this.position,null==t?this.endianness:t);return this.position+=4,e},a.prototype.readUint16=function(t){var e=this._dataView.getUint16(this.position,null==t?this.endianness:t);return this.position+=2,e},a.prototype.readUint8=function(){var t=this._dataView.getUint8(this.position);return this.position+=1,t},a.prototype.readFloat32=function(t){var e=this._dataView.getFloat32(this.position,null==t?this.endianness:t);return this.position+=4,e},a.prototype.readFloat64=function(t){var e=this._dataView.getFloat64(this.position,null==t?this.endianness:t);return this.position+=8,e},a.endianness=new Int8Array(new Int16Array([1]).buffer)[0]>0,a.memcpy=function(t,e,i,s,r){var n=new Uint8Array(t,e,r),a=new Uint8Array(i,s,r);n.set(a)},a.arrayToNative=function(t,e){return e==this.endianness?t:this.flipArrayEndianness(t)},a.nativeToEndian=function(t,e){return this.endianness==e?t:this.flipArrayEndianness(t)},a.flipArrayEndianness=function(t){for(var e=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),i=0;i<t.byteLength;i+=t.BYTES_PER_ELEMENT)for(var s=i+t.BYTES_PER_ELEMENT-1,r=i;s>r;s--,r++){var n=e[r];e[r]=e[s],e[s]=n}return t},a.prototype.failurePosition=0,String.fromCharCodeUint8=function(t){for(var e=[],i=0;i<t.length;i++)e[i]=t[i];return String.fromCharCode.apply(null,e)},a.prototype.readString=function(t,e){return null==e||"ASCII"==e?String.fromCharCodeUint8.apply(null,[this.mapUint8Array(null==t?this.byteLength-this.position:t)]):new TextDecoder(e).decode(this.mapUint8Array(t))},a.prototype.readCString=function(t){var e=this.byteLength-this.position,i=new Uint8Array(this._buffer,this._byteOffset+this.position),s=e;null!=t&&(s=Math.min(t,e));for(var r=0;r<s&&0!==i[r];r++);var n=String.fromCharCodeUint8.apply(null,[this.mapUint8Array(r)]);return null!=t?this.position+=s-r:r!=e&&(this.position+=1),n};var o=Math.pow(2,32);a.prototype.readInt64=function(){return this.readInt32()*o+this.readUint32()},a.prototype.readUint64=function(){return this.readUint32()*o+this.readUint32()},a.prototype.readInt64=function(){return this.readUint32()*o+this.readUint32()},a.prototype.readUint24=function(){return(this.readUint8()<<16)+(this.readUint8()<<8)+this.readUint8()},t.DataStream=a,a.prototype.save=function(t){var e=new Blob([this.buffer]);if(!window.URL||!URL.createObjectURL)throw"DataStream.save: Can't create object URL.";var i=window.URL.createObjectURL(e),s=document.createElement("a");document.body.appendChild(s),s.setAttribute("href",i),s.setAttribute("download",t),s.setAttribute("target","_self"),s.click(),window.URL.revokeObjectURL(i)},a.prototype._dynamicSize=!0,Object.defineProperty(a.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(t){t||this._trimAlloc(),this._dynamicSize=t}}),a.prototype.shift=function(t){var e=new ArrayBuffer(this._byteLength-t),i=new Uint8Array(e),s=new Uint8Array(this._buffer,t,i.length);i.set(s),this.buffer=e,this.position-=t},a.prototype.writeInt32Array=function(t,e){if(this._realloc(4*t.length),t instanceof Int32Array&&this.byteOffset+this.position%t.BYTES_PER_ELEMENT===0)a.memcpy(this._buffer,this.byteOffset+this.position,t.buffer,0,t.byteLength),this.mapInt32Array(t.length,e);else for(var i=0;i<t.length;i++)this.writeInt32(t[i],e)},a.prototype.writeInt16Array=function(t,e){if(this._realloc(2*t.length),t instanceof Int16Array&&this.byteOffset+this.position%t.BYTES_PER_ELEMENT===0)a.memcpy(this._buffer,this.byteOffset+this.position,t.buffer,0,t.byteLength),this.mapInt16Array(t.length,e);else for(var i=0;i<t.length;i++)this.writeInt16(t[i],e)},a.prototype.writeInt8Array=function(t){if(this._realloc(1*t.length),t instanceof Int8Array&&this.byteOffset+this.position%t.BYTES_PER_ELEMENT===0)a.memcpy(this._buffer,this.byteOffset+this.position,t.buffer,0,t.byteLength),this.mapInt8Array(t.length);else for(var e=0;e<t.length;e++)this.writeInt8(t[e])},a.prototype.writeUint32Array=function(t,e){if(this._realloc(4*t.length),t instanceof Uint32Array&&this.byteOffset+this.position%t.BYTES_PER_ELEMENT===0)a.memcpy(this._buffer,this.byteOffset+this.position,t.buffer,0,t.byteLength),this.mapUint32Array(t.length,e);else for(var i=0;i<t.length;i++)this.writeUint32(t[i],e)},a.prototype.writeUint16Array=function(t,e){if(this._realloc(2*t.length),t instanceof Uint16Array&&this.byteOffset+this.position%t.BYTES_PER_ELEMENT===0)a.memcpy(this._buffer,this.byteOffset+this.position,t.buffer,0,t.byteLength),this.mapUint16Array(t.length,e);else for(var i=0;i<t.length;i++)this.writeUint16(t[i],e)},a.prototype.writeUint8Array=function(t){if(this._realloc(1*t.length),t instanceof Uint8Array&&this.byteOffset+this.position%t.BYTES_PER_ELEMENT===0)a.memcpy(this._buffer,this.byteOffset+this.position,t.buffer,0,t.byteLength),this.mapUint8Array(t.length);else for(var e=0;e<t.length;e++)this.writeUint8(t[e])},a.prototype.writeFloat64Array=function(t,e){if(this._realloc(8*t.length),t instanceof Float64Array&&this.byteOffset+this.position%t.BYTES_PER_ELEMENT===0)a.memcpy(this._buffer,this.byteOffset+this.position,t.buffer,0,t.byteLength),this.mapFloat64Array(t.length,e);else for(var i=0;i<t.length;i++)this.writeFloat64(t[i],e)},a.prototype.writeFloat32Array=function(t,e){if(this._realloc(4*t.length),t instanceof Float32Array&&this.byteOffset+this.position%t.BYTES_PER_ELEMENT===0)a.memcpy(this._buffer,this.byteOffset+this.position,t.buffer,0,t.byteLength),this.mapFloat32Array(t.length,e);else for(var i=0;i<t.length;i++)this.writeFloat32(t[i],e)},a.prototype.writeInt32=function(t,e){this._realloc(4),this._dataView.setInt32(this.position,t,null==e?this.endianness:e),this.position+=4},a.prototype.writeInt16=function(t,e){this._realloc(2),this._dataView.setInt16(this.position,t,null==e?this.endianness:e),this.position+=2},a.prototype.writeInt8=function(t){this._realloc(1),this._dataView.setInt8(this.position,t),this.position+=1},a.prototype.writeUint32=function(t,e){this._realloc(4),this._dataView.setUint32(this.position,t,null==e?this.endianness:e),this.position+=4},a.prototype.writeUint16=function(t,e){this._realloc(2),this._dataView.setUint16(this.position,t,null==e?this.endianness:e),this.position+=2},a.prototype.writeUint8=function(t){this._realloc(1),this._dataView.setUint8(this.position,t),this.position+=1},a.prototype.writeFloat32=function(t,e){this._realloc(4),this._dataView.setFloat32(this.position,t,null==e?this.endianness:e),this.position+=4},a.prototype.writeFloat64=function(t,e){this._realloc(8),this._dataView.setFloat64(this.position,t,null==e?this.endianness:e),this.position+=8},a.prototype.writeUCS2String=function(t,e,i){null==i&&(i=t.length);for(var s=0;s<t.length&&s<i;s++)this.writeUint16(t.charCodeAt(s),e);for(;s<i;s++)this.writeUint16(0)},a.prototype.writeString=function(t,e,i){var s=0;if(null==e||"ASCII"==e)if(null!=i){var r=Math.min(t.length,i);for(s=0;s<r;s++)this.writeUint8(t.charCodeAt(s));for(;s<i;s++)this.writeUint8(0)}else for(s=0;s<t.length;s++)this.writeUint8(t.charCodeAt(s));else this.writeUint8Array(new TextEncoder(e).encode(t.substring(0,i)))},a.prototype.writeCString=function(t,e){var i=0;if(null!=e){var s=Math.min(t.length,e);for(i=0;i<s;i++)this.writeUint8(t.charCodeAt(i));for(;i<e;i++)this.writeUint8(0)}else{for(i=0;i<t.length;i++)this.writeUint8(t.charCodeAt(i));this.writeUint8(0)}},a.prototype.writeStruct=function(t,e){for(var i=0;i<t.length;i+=2){var s=t[i+1];this.writeType(s,e[t[i]],e)}},a.prototype.writeType=function(t,e,i){var s;if("function"==typeof t)return t(this,e);if("object"==typeof t&&!(t instanceof Array))return t.set(this,e,i);var r=null,n="ASCII",o=this.position;switch("string"==typeof t&&/:/.test(t)&&(s=t.split(":"),t=s[0],r=parseInt(s[1])),"string"==typeof t&&/,/.test(t)&&(s=t.split(","),t=s[0],n=parseInt(s[1])),t){case"uint8":this.writeUint8(e);break;case"int8":this.writeInt8(e);break;case"uint16":this.writeUint16(e,this.endianness);break;case"int16":this.writeInt16(e,this.endianness);break;case"uint32":this.writeUint32(e,this.endianness);break;case"int32":this.writeInt32(e,this.endianness);break;case"float32":this.writeFloat32(e,this.endianness);break;case"float64":this.writeFloat64(e,this.endianness);break;case"uint16be":this.writeUint16(e,a.BIG_ENDIAN);break;case"int16be":this.writeInt16(e,a.BIG_ENDIAN);break;case"uint32be":this.writeUint32(e,a.BIG_ENDIAN);break;case"int32be":this.writeInt32(e,a.BIG_ENDIAN);break;case"float32be":this.writeFloat32(e,a.BIG_ENDIAN);break;case"float64be":this.writeFloat64(e,a.BIG_ENDIAN);break;case"uint16le":this.writeUint16(e,a.LITTLE_ENDIAN);break;case"int16le":this.writeInt16(e,a.LITTLE_ENDIAN);break;case"uint32le":this.writeUint32(e,a.LITTLE_ENDIAN);break;case"int32le":this.writeInt32(e,a.LITTLE_ENDIAN);break;case"float32le":this.writeFloat32(e,a.LITTLE_ENDIAN);break;case"float64le":this.writeFloat64(e,a.LITTLE_ENDIAN);break;case"cstring":this.writeCString(e,r);break;case"string":this.writeString(e,n,r);break;case"u16string":this.writeUCS2String(e,this.endianness,r);break;case"u16stringle":this.writeUCS2String(e,a.LITTLE_ENDIAN,r);break;case"u16stringbe":this.writeUCS2String(e,a.BIG_ENDIAN,r);break;default:if(3==t.length){for(var h=t[1],d=0;d<e.length;d++)this.writeType(h,e[d]);break}this.writeStruct(t,e)}null!=r&&(this.position=o,this._realloc(r),this.position=o+r)},a.prototype.writeUint64=function(t){var e=Math.floor(t/o);this.writeUint32(e),this.writeUint32(4294967295&t)},a.prototype.writeUint24=function(t){this.writeUint8((16711680&t)>>16),this.writeUint8((65280&t)>>8),this.writeUint8(255&t)},a.prototype.adjustUint32=function(t,e){var i=this.position;this.seek(t),this.writeUint32(e),this.seek(i)},a.prototype.mapInt32Array=function(t,e){this._realloc(4*t);var i=new Int32Array(this._buffer,this.byteOffset+this.position,t);return a.arrayToNative(i,null==e?this.endianness:e),this.position+=4*t,i},a.prototype.mapInt16Array=function(t,e){this._realloc(2*t);var i=new Int16Array(this._buffer,this.byteOffset+this.position,t);return a.arrayToNative(i,null==e?this.endianness:e),this.position+=2*t,i},a.prototype.mapInt8Array=function(t){this._realloc(1*t);var e=new Int8Array(this._buffer,this.byteOffset+this.position,t);return this.position+=1*t,e},a.prototype.mapUint32Array=function(t,e){this._realloc(4*t);var i=new Uint32Array(this._buffer,this.byteOffset+this.position,t);return a.arrayToNative(i,null==e?this.endianness:e),this.position+=4*t,i},a.prototype.mapUint16Array=function(t,e){this._realloc(2*t);var i=new Uint16Array(this._buffer,this.byteOffset+this.position,t);return a.arrayToNative(i,null==e?this.endianness:e),this.position+=2*t,i},a.prototype.mapFloat64Array=function(t,e){this._realloc(8*t);var i=new Float64Array(this._buffer,this.byteOffset+this.position,t);return a.arrayToNative(i,null==e?this.endianness:e),this.position+=8*t,i},a.prototype.mapFloat32Array=function(t,e){this._realloc(4*t);var i=new Float32Array(this._buffer,this.byteOffset+this.position,t);return a.arrayToNative(i,null==e?this.endianness:e),this.position+=4*t,i};var h=function(t){this.buffers=[],this.bufferIndex=-1,t&&(this.insertBuffer(t),this.bufferIndex=0)};(h.prototype=new a(new ArrayBuffer,0,a.BIG_ENDIAN)).initialized=function(){var t;return this.bufferIndex>-1||(this.buffers.length>0?0===(t=this.buffers[0]).fileStart?(this.buffer=t,this.bufferIndex=0,r.debug("MultiBufferStream","Stream ready for parsing"),!0):(r.warn("MultiBufferStream","The first buffer should have a fileStart of 0"),this.logBufferLevel(),!1):(r.warn("MultiBufferStream","No buffer to start parsing from"),this.logBufferLevel(),!1))},ArrayBuffer.concat=function(t,e){r.debug("ArrayBuffer","Trying to create a new buffer of size: "+(t.byteLength+e.byteLength));var i=new Uint8Array(t.byteLength+e.byteLength);return i.set(new Uint8Array(t),0),i.set(new Uint8Array(e),t.byteLength),i.buffer},h.prototype.reduceBuffer=function(t,e,i){var s;return(s=new Uint8Array(i)).set(new Uint8Array(t,e,i)),s.buffer.fileStart=t.fileStart+e,s.buffer.usedBytes=0,s.buffer},h.prototype.insertBuffer=function(t){for(var e=!0,i=0;i<this.buffers.length;i++){var s=this.buffers[i];if(t.fileStart<=s.fileStart){if(t.fileStart===s.fileStart){if(t.byteLength>s.byteLength){this.buffers.splice(i,1),i--;continue}r.warn("MultiBufferStream","Buffer (fileStart: "+t.fileStart+" - Length: "+t.byteLength+") already appended, ignoring")}else t.fileStart+t.byteLength<=s.fileStart||(t=this.reduceBuffer(t,0,s.fileStart-t.fileStart)),r.debug("MultiBufferStream","Appending new buffer (fileStart: "+t.fileStart+" - Length: "+t.byteLength+")"),this.buffers.splice(i,0,t),0===i&&(this.buffer=t);e=!1;break}if(t.fileStart<s.fileStart+s.byteLength){var n=s.fileStart+s.byteLength-t.fileStart,a=t.byteLength-n;if(!(a>0)){e=!1;break}t=this.reduceBuffer(t,n,a)}}e&&(r.debug("MultiBufferStream","Appending new buffer (fileStart: "+t.fileStart+" - Length: "+t.byteLength+")"),this.buffers.push(t),0===i&&(this.buffer=t))},h.prototype.logBufferLevel=function(t){var e,i,s,n,a,o=[],h="";for(s=0,n=0,e=0;e<this.buffers.length;e++)i=this.buffers[e],0===e?(a={},o.push(a),a.start=i.fileStart,a.end=i.fileStart+i.byteLength,h+="["+a.start+"-"):a.end===i.fileStart?a.end=i.fileStart+i.byteLength:((a={}).start=i.fileStart,h+=o[o.length-1].end-1+"], ["+a.start+"-",a.end=i.fileStart+i.byteLength,o.push(a)),s+=i.usedBytes,n+=i.byteLength;o.length>0&&(h+=a.end-1+"]");var d=t?r.info:r.debug;0===this.buffers.length?d("MultiBufferStream","No more buffer in memory"):d("MultiBufferStream",this.buffers.length+" stored buffer(s) ("+s+"/"+n+" bytes), continuous ranges: "+h)},h.prototype.cleanBuffers=function(){var t,e;for(t=0;t<this.buffers.length;t++)(e=this.buffers[t]).usedBytes===e.byteLength&&(r.debug("MultiBufferStream","Removing buffer #"+t),this.buffers.splice(t,1),t--)},h.prototype.mergeNextBuffer=function(){var t;if(this.bufferIndex+1<this.buffers.length){if((t=this.buffers[this.bufferIndex+1]).fileStart===this.buffer.fileStart+this.buffer.byteLength){var e=this.buffer.byteLength,i=this.buffer.usedBytes,s=this.buffer.fileStart;return this.buffers[this.bufferIndex]=ArrayBuffer.concat(this.buffer,t),this.buffer=this.buffers[this.bufferIndex],this.buffers.splice(this.bufferIndex+1,1),this.buffer.usedBytes=i,this.buffer.fileStart=s,r.debug("ISOFile","Concatenating buffer for box parsing (length: "+e+"->"+this.buffer.byteLength+")"),!0}return!1}return!1},h.prototype.findPosition=function(t,e,i){var s,n=null,a=-1;for(s=!0===t?0:this.bufferIndex;s<this.buffers.length&&(n=this.buffers[s]).fileStart<=e;)a=s,i&&(n.fileStart+n.byteLength<=e?n.usedBytes=n.byteLength:n.usedBytes=e-n.fileStart,this.logBufferLevel()),s++;return-1!==a&&(n=this.buffers[a]).fileStart+n.byteLength>=e?(r.debug("MultiBufferStream","Found position in existing buffer #"+a),a):-1},h.prototype.findEndContiguousBuf=function(t){var e,i,s,r=void 0!==t?t:this.bufferIndex;if(i=this.buffers[r],this.buffers.length>r+1)for(e=r+1;e<this.buffers.length&&(s=this.buffers[e]).fileStart===i.fileStart+i.byteLength;e++)i=s;return i.fileStart+i.byteLength},h.prototype.getEndFilePositionAfter=function(t){var e=this.findPosition(!0,t,!1);return-1!==e?this.findEndContiguousBuf(e):t},h.prototype.addUsedBytes=function(t){this.buffer.usedBytes+=t,this.logBufferLevel()},h.prototype.setAllUsedBytes=function(){this.buffer.usedBytes=this.buffer.byteLength,this.logBufferLevel()},h.prototype.seek=function(t,e,i){var s;return-1!==(s=this.findPosition(e,t,i))?(this.buffer=this.buffers[s],this.bufferIndex=s,this.position=t-this.buffer.fileStart,r.debug("MultiBufferStream","Repositioning parser at buffer position: "+this.position),!0):(r.debug("MultiBufferStream","Position "+t+" not found in buffered data"),!1)},h.prototype.getPosition=function(){if(-1===this.bufferIndex||null===this.buffers[this.bufferIndex])throw"Error accessing position in the MultiBufferStream";return this.buffers[this.bufferIndex].fileStart+this.position},h.prototype.getLength=function(){return this.byteLength},h.prototype.getEndPosition=function(){if(-1===this.bufferIndex||null===this.buffers[this.bufferIndex])throw"Error accessing position in the MultiBufferStream";return this.buffers[this.bufferIndex].fileStart+this.byteLength},t.MultiBufferStream=h;var d=function(){var t=[];t[3]="ES_Descriptor",t[4]="DecoderConfigDescriptor",t[5]="DecoderSpecificInfo",t[6]="SLConfigDescriptor",this.getDescriptorName=function(e){return t[e]};var e=this,i={};return this.parseOneDescriptor=function(e){var s,n,a,o=0;for(s=e.readUint8(),a=e.readUint8();128&a;)o=(127&a)<<7,a=e.readUint8();return o+=127&a,r.debug("MPEG4DescriptorParser","Found "+(t[s]||"Descriptor "+s)+", size "+o+" at position "+e.getPosition()),(n=t[s]?new i[t[s]](o):new i.Descriptor(o)).parse(e),n},i.Descriptor=function(t,e){this.tag=t,this.size=e,this.descs=[]},i.Descriptor.prototype.parse=function(t){this.data=t.readUint8Array(this.size)},i.Descriptor.prototype.findDescriptor=function(t){for(var e=0;e<this.descs.length;e++)if(this.descs[e].tag==t)return this.descs[e];return null},i.Descriptor.prototype.parseRemainingDescriptors=function(t){for(var i=t.position;t.position<i+this.size;){var s=e.parseOneDescriptor(t);this.descs.push(s)}},i.ES_Descriptor=function(t){i.Descriptor.call(this,3,t)},i.ES_Descriptor.prototype=new i.Descriptor,i.ES_Descriptor.prototype.parse=function(t){if(this.ES_ID=t.readUint16(),this.flags=t.readUint8(),this.size-=3,128&this.flags?(this.dependsOn_ES_ID=t.readUint16(),this.size-=2):this.dependsOn_ES_ID=0,64&this.flags){var e=t.readUint8();this.URL=t.readString(e),this.size-=e+1}else this.URL="";32&this.flags?(this.OCR_ES_ID=t.readUint16(),this.size-=2):this.OCR_ES_ID=0,this.parseRemainingDescriptors(t)},i.ES_Descriptor.prototype.getOTI=function(t){var e=this.findDescriptor(4);return e?e.oti:0},i.ES_Descriptor.prototype.getAudioConfig=function(t){var e=this.findDescriptor(4);if(!e)return null;var i=e.findDescriptor(5);if(i&&i.data){var s=(248&i.data[0])>>3;return 31===s&&i.data.length>=2&&(s=32+((7&i.data[0])<<3)+((224&i.data[1])>>5)),s}return null},i.DecoderConfigDescriptor=function(t){i.Descriptor.call(this,4,t)},i.DecoderConfigDescriptor.prototype=new i.Descriptor,i.DecoderConfigDescriptor.prototype.parse=function(t){this.oti=t.readUint8(),this.streamType=t.readUint8(),this.bufferSize=t.readUint24(),this.maxBitrate=t.readUint32(),this.avgBitrate=t.readUint32(),this.size-=13,this.parseRemainingDescriptors(t)},i.DecoderSpecificInfo=function(t){i.Descriptor.call(this,5,t)},i.DecoderSpecificInfo.prototype=new i.Descriptor,i.SLConfigDescriptor=function(t){i.Descriptor.call(this,6,t)},i.SLConfigDescriptor.prototype=new i.Descriptor,this};t.MPEG4DescriptorParser=d;var l={ERR_INVALID_DATA:-1,ERR_NOT_ENOUGH_DATA:0,OK:1,BASIC_BOXES:["mdat","idat","free","skip","meco","strk"],FULL_BOXES:["hmhd","nmhd","iods","xml ","bxml","ipro","mere"],CONTAINER_BOXES:[["moov",["trak","pssh"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl",["sgpd","sbgp"]],["mvex",["trex"]],["moof",["traf"]],["traf",["trun","sgpd","sbgp"]],["vttc"],["tref"],["iref"],["mfra",["tfra"]],["meco"],["hnti"],["hinf"],["strk"],["strd"],["sinf"],["rinf"],["schi"],["trgr"],["udta",["kind"]],["iprp",["ipma"]],["ipco"]],boxCodes:[],fullBoxCodes:[],containerBoxCodes:[],sampleEntryCodes:{},sampleGroupEntryCodes:[],trackGroupTypes:[],UUIDBoxes:{},UUIDs:[],initialize:function(){l.FullBox.prototype=new l.Box,l.ContainerBox.prototype=new l.Box,l.SampleEntry.prototype=new l.Box,l.TrackGroupTypeBox.prototype=new l.FullBox,l.BASIC_BOXES.forEach((function(t){l.createBoxCtor(t)})),l.FULL_BOXES.forEach((function(t){l.createFullBoxCtor(t)})),l.CONTAINER_BOXES.forEach((function(t){l.createContainerBoxCtor(t[0],null,t[1])}))},Box:function(t,e,i){this.type=t,this.size=e,this.uuid=i},FullBox:function(t,e,i){l.Box.call(this,t,e,i),this.flags=0,this.version=0},ContainerBox:function(t,e,i){l.Box.call(this,t,e,i),this.boxes=[]},SampleEntry:function(t,e,i,s){l.ContainerBox.call(this,t,e),this.hdr_size=i,this.start=s},SampleGroupEntry:function(t){this.grouping_type=t},TrackGroupTypeBox:function(t,e){l.FullBox.call(this,t,e)},createBoxCtor:function(t,e){l.boxCodes.push(t),l[t+"Box"]=function(e){l.Box.call(this,t,e)},l[t+"Box"].prototype=new l.Box,e&&(l[t+"Box"].prototype.parse=e)},createFullBoxCtor:function(t,e){l[t+"Box"]=function(e){l.FullBox.call(this,t,e)},l[t+"Box"].prototype=new l.FullBox,l[t+"Box"].prototype.parse=function(t){this.parseFullHeader(t),e&&e.call(this,t)}},addSubBoxArrays:function(t){if(t){this.subBoxNames=t;for(var e=t.length,i=0;i<e;i++)this[t[i]+"s"]=[]}},createContainerBoxCtor:function(t,e,i){l[t+"Box"]=function(e){l.ContainerBox.call(this,t,e),l.addSubBoxArrays.call(this,i)},l[t+"Box"].prototype=new l.ContainerBox,e&&(l[t+"Box"].prototype.parse=e)},createMediaSampleEntryCtor:function(t,e,i){l.sampleEntryCodes[t]=[],l[t+"SampleEntry"]=function(t,e){l.SampleEntry.call(this,t,e),l.addSubBoxArrays.call(this,i)},l[t+"SampleEntry"].prototype=new l.SampleEntry,e&&(l[t+"SampleEntry"].prototype.parse=e)},createSampleEntryCtor:function(t,e,i,s){l.sampleEntryCodes[t].push(e),l[e+"SampleEntry"]=function(i){l[t+"SampleEntry"].call(this,e,i),l.addSubBoxArrays.call(this,s)},l[e+"SampleEntry"].prototype=new l[t+"SampleEntry"],i&&(l[e+"SampleEntry"].prototype.parse=i)},createEncryptedSampleEntryCtor:function(t,e,i){l.createSampleEntryCtor.call(this,t,e,i,["sinf"])},createSampleGroupCtor:function(t,e){l[t+"SampleGroupEntry"]=function(e){l.SampleGroupEntry.call(this,t,e)},l[t+"SampleGroupEntry"].prototype=new l.SampleGroupEntry,e&&(l[t+"SampleGroupEntry"].prototype.parse=e)},createTrackGroupCtor:function(t,e){l[t+"TrackGroupTypeBox"]=function(e){l.TrackGroupTypeBox.call(this,t,e)},l[t+"TrackGroupTypeBox"].prototype=new l.TrackGroupTypeBox,e&&(l[t+"TrackGroupTypeBox"].prototype.parse=e)},createUUIDBox:function(t,e,i,s){l.UUIDs.push(t),l.UUIDBoxes[t]=function(s){e?l.FullBox.call(this,"uuid",s,t):i?l.ContainerBox.call(this,"uuid",s,t):l.Box.call(this,"uuid",s,t)},l.UUIDBoxes[t].prototype=e?new l.FullBox:i?new l.ContainerBox:new l.Box,s&&(l.UUIDBoxes[t].prototype.parse=e?function(t){this.parseFullHeader(t),s&&s.call(this,t)}:s)}};l.initialize(),l.TKHD_FLAG_ENABLED=1,l.TKHD_FLAG_IN_MOVIE=2,l.TKHD_FLAG_IN_PREVIEW=4,l.TFHD_FLAG_BASE_DATA_OFFSET=1,l.TFHD_FLAG_SAMPLE_DESC=2,l.TFHD_FLAG_SAMPLE_DUR=8,l.TFHD_FLAG_SAMPLE_SIZE=16,l.TFHD_FLAG_SAMPLE_FLAGS=32,l.TFHD_FLAG_DUR_EMPTY=65536,l.TFHD_FLAG_DEFAULT_BASE_IS_MOOF=131072,l.TRUN_FLAGS_DATA_OFFSET=1,l.TRUN_FLAGS_FIRST_FLAG=4,l.TRUN_FLAGS_DURATION=256,l.TRUN_FLAGS_SIZE=512,l.TRUN_FLAGS_FLAGS=1024,l.TRUN_FLAGS_CTS_OFFSET=2048,l.Box.prototype.add=function(t){return this.addBox(new l[t+"Box"])},l.Box.prototype.addBox=function(t){return this.boxes.push(t),this[t.type+"s"]?this[t.type+"s"].push(t):this[t.type]=t,t},l.Box.prototype.set=function(t,e){return this[t]=e,this},l.Box.prototype.addEntry=function(t,e){var i=e||"entries";return this[i]||(this[i]=[]),this[i].push(t),this},t.BoxParser=l,l.parseUUID=function(t){return l.parseHex16(t)},l.parseHex16=function(t){for(var e="",i=0;i<16;i++){var s=t.readUint8().toString(16);e+=1===s.length?"0"+s:s}return e},l.parseOneBox=function(t,e,i){var s,n,a,o=t.getPosition(),h=0;if(t.getEndPosition()-o<8)return r.debug("BoxParser","Not enough data in stream to parse the type and size of the box"),{code:l.ERR_NOT_ENOUGH_DATA};if(i&&i<8)return r.debug("BoxParser","Not enough bytes left in the parent box to parse a new box"),{code:l.ERR_NOT_ENOUGH_DATA};var d=t.readUint32(),p=t.readString(4),f=p;if(r.debug("BoxParser","Found box of type '"+p+"' and size "+d+" at position "+o),h=8,"uuid"==p){if(t.getEndPosition()-t.getPosition()<16||i-h<16)return t.seek(o),r.debug("BoxParser","Not enough bytes left in the parent box to parse a UUID box"),{code:l.ERR_NOT_ENOUGH_DATA};h+=16,f=a=l.parseUUID(t)}if(1==d){if(t.getEndPosition()-t.getPosition()<8||i&&i-h<8)return t.seek(o),r.warn("BoxParser",'Not enough data in stream to parse the extended size of the "'+p+'" box'),{code:l.ERR_NOT_ENOUGH_DATA};d=t.readUint64(),h+=8}else if(0===d)if(i)d=i;else if("mdat"!==p)return r.error("BoxParser","Unlimited box size not supported for type: '"+p+"'"),s=new l.Box(p,d),{code:l.OK,box:s,size:s.size};return d<h?(r.error("BoxParser","Box of type "+p+" has an invalid size "+d+" (too small to be a box)"),{code:l.ERR_NOT_ENOUGH_DATA,type:p,size:d,hdr_size:h,start:o}):i&&d>i?(r.error("BoxParser","Box of type '"+p+"' has a size "+d+" greater than its container size "+i),{code:l.ERR_NOT_ENOUGH_DATA,type:p,size:d,hdr_size:h,start:o}):o+d>t.getEndPosition()?(t.seek(o),r.info("BoxParser","Not enough data in stream to parse the entire '"+p+"' box"),{code:l.ERR_NOT_ENOUGH_DATA,type:p,size:d,hdr_size:h,start:o}):e?{code:l.OK,type:p,size:d,hdr_size:h,start:o}:(l[p+"Box"]?s=new l[p+"Box"](d):"uuid"!==p?(r.warn("BoxParser","Unknown box type: '"+p+"'"),(s=new l.Box(p,d)).has_unparsed_data=!0):l.UUIDBoxes[a]?s=new l.UUIDBoxes[a](d):(r.warn("BoxParser","Unknown uuid type: '"+a+"'"),(s=new l.Box(p,d)).uuid=a,s.has_unparsed_data=!0),s.hdr_size=h,s.start=o,s.write===l.Box.prototype.write&&"mdat"!==s.type&&(r.info("BoxParser","'"+f+"' box writing not yet implemented, keeping unparsed data in memory for later write"),s.parseDataAndRewind(t)),s.parse(t),(n=t.getPosition()-(s.start+s.size))<0?(r.warn("BoxParser","Parsing of box '"+f+"' did not read the entire indicated box data size (missing "+-n+" bytes), seeking forward"),t.seek(s.start+s.size)):n>0&&(r.error("BoxParser","Parsing of box '"+f+"' read "+n+" more bytes than the indicated box data size, seeking backwards"),t.seek(s.start+s.size)),{code:l.OK,box:s,size:s.size})},l.Box.prototype.parse=function(t){"mdat"!=this.type?this.data=t.readUint8Array(this.size-this.hdr_size):0===this.size?t.seek(t.getEndPosition()):t.seek(this.start+this.size)},l.Box.prototype.pars